Skip to content

Commit 2e2d7bd

Browse files
committed
chore: updated openrpc with sendTransaction
1 parent bce7a71 commit 2e2d7bd

File tree

1 file changed

+116
-6
lines changed

1 file changed

+116
-6
lines changed

docs/openrpc.json

Lines changed: 116 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312
{
313313
"name": "nc_id",
314314
"summary": "Id of contract being called",
315-
"description": "Should be used for any method different than initialize, to execute a contract. Should not be used with method initialize."
315+
"description": "Should be used for any method different than initialize, to execute a contract. Should not be used with method initialize.",
316316
"schema": {
317317
"description": "32 bytes encoded in hexadecimal.",
318318
"type": "string",
@@ -353,11 +353,11 @@
353353
"type": "object",
354354
"oneOf": [
355355
{
356-
"description": "If push_tx parameter was false, wallet application returns transaction encoded in hexadecimal, ready to be pushed by any one."
356+
"description": "If push_tx parameter was false, wallet application returns transaction encoded in hexadecimal, ready to be pushed by any one.",
357357
"$ref": "#/components/schemas/TransactionHex"
358358
},
359359
{
360-
"description": "If push_tx parameter was true, wallet application returns the transaction already registered in the blockchain."
360+
"description": "If push_tx parameter was true, wallet application returns the transaction already registered in the blockchain.",
361361
"$ref": "#/components/schemas/NanoContract"
362362
}
363363
]
@@ -486,11 +486,11 @@
486486
"type": "object",
487487
"oneOf": [
488488
{
489-
"description": "If push_tx parameter was false, wallet application returns transaction encoded in hexadecimal, ready to be pushed by any one."
489+
"description": "If push_tx parameter was false, wallet application returns transaction encoded in hexadecimal, ready to be pushed by any one.",
490490
"$ref": "#/components/schemas/TransactionHex"
491491
},
492492
{
493-
"description": "If push_tx parameter was true, wallet application returns the transaction already registered in the blockchain."
493+
"description": "If push_tx parameter was true, wallet application returns the transaction already registered in the blockchain.",
494494
"$ref": "#/components/schemas/Transaction"
495495
}
496496
]
@@ -557,6 +557,104 @@
557557
"$ref": "#/components/errors/PromptRejectedError"
558558
}
559559
]
560+
},
561+
{
562+
"name": "htr_sendTransaction",
563+
"summary": "Sends a transaction",
564+
"description": "Sends tokens to multiple addresses or creates data outputs. This method allows creating complex transactions with multiple outputs. DApp provides wallet application with output details, and optionally specific inputs to use. Wallet application assembles, signs, and sends the transaction.",
565+
"paramStructure": "by-name",
566+
"params": [
567+
{
568+
"$ref": "#/components/contentDescriptors/Network"
569+
},
570+
{
571+
"name": "outputs",
572+
"summary": "List of transaction outputs to create",
573+
"required": true,
574+
"schema": {
575+
"type": "array",
576+
"items": {
577+
"type": "object",
578+
"properties": {
579+
"address": {
580+
"description": "Destination address for the tokens",
581+
"$ref": "#/components/schemas/Address"
582+
},
583+
"value": {
584+
"description": "Amount of tokens to send",
585+
"type": "string"
586+
},
587+
"token": {
588+
"description": "Token UID, defaults to HTR if not specified",
589+
"$ref": "#/components/schemas/Token"
590+
},
591+
"type": {
592+
"description": "Output type, can be 'data' for data outputs",
593+
"type": "string"
594+
},
595+
"data": {
596+
"description": "Array of data strings for data outputs",
597+
"type": "array",
598+
"items": {
599+
"type": "string"
600+
}
601+
}
602+
}
603+
}
604+
}
605+
},
606+
{
607+
"name": "inputs",
608+
"summary": "Optional specific inputs to use in transaction",
609+
"schema": {
610+
"type": "array",
611+
"items": {
612+
"type": "object",
613+
"properties": {
614+
"txId": {
615+
"description": "Transaction ID of the input",
616+
"$ref": "#/components/schemas/TransactionId"
617+
},
618+
"index": {
619+
"description": "Output index in the transaction",
620+
"type": "number"
621+
}
622+
},
623+
"required": ["txId", "index"]
624+
}
625+
}
626+
},
627+
{
628+
"name": "changeAddress",
629+
"summary": "Address to receive change from the transaction",
630+
"schema": {
631+
"$ref": "#/components/schemas/Address"
632+
}
633+
}
634+
],
635+
"result": {
636+
"name": "SendTransactionResponse",
637+
"schema": {
638+
"$ref": "#/components/schemas/Transaction"
639+
}
640+
},
641+
"errors": [
642+
{
643+
"$ref": "#/components/errors/DifferentNetworkError"
644+
},
645+
{
646+
"$ref": "#/components/errors/PromptRejectedError"
647+
},
648+
{
649+
"$ref": "#/components/errors/SendTransactionError"
650+
},
651+
{
652+
"$ref": "#/components/errors/InsufficientFundsError"
653+
},
654+
{
655+
"$ref": "#/components/errors/PrepareSendTransactionError"
656+
}
657+
]
560658
}
561659
],
562660
"components": {
@@ -882,7 +980,7 @@
882980
},
883981
"Buffer": {
884982
"type": "string"
885-
},
983+
}
886984
},
887985
"errors":{
888986
"NotImplementedError": {
@@ -912,6 +1010,18 @@
9121010
"CreateTokenError": {
9131011
"code": -31007,
9141012
"message": "Error creating token"
1013+
},
1014+
"SendTransactionError": {
1015+
"code": -31008,
1016+
"message": "Error sending transaction"
1017+
},
1018+
"InsufficientFundsError": {
1019+
"code": -31009,
1020+
"message": "Insufficient funds"
1021+
},
1022+
"PrepareSendTransactionError": {
1023+
"code": -31010,
1024+
"message": "Error preparing transaction"
9151025
}
9161026
}
9171027
}

0 commit comments

Comments
 (0)