Send a transaction with many outputs.
POST/wallet/send-tx
Send a transaction with many outputs.
Request
Header Parameters
Defines the key of the wallet on which the request will be executed.
- application/json
Body
required
Data to create the transaction
Array [
]
Array [
]
outputs
object[]
required
Outputs to create the transaction.
Destination address of the output. Required if P2PKH or P2SH.
The value parameter must be an integer with the value in cents, i.e., 123 means 1.23 HTR. Required if P2PKH or P2SH.
Token id of the output. If not sent, HTR will be chosen.
Type of output script. Required if data script and expected to be "data".
Data string of the data script output. Required if it's a data script output.
Timelock value for the output. Used only for P2PKH or P2SH.
inputs
object[]
Inputs to create the transaction.
Hash of the transaction being spent in this input. Used if not type query.
Index of the output being spent in this input. Used if not type query.
Type of input object. Can be 'query' only for now.
Maximum number of utxos to filter in the query. Optional query parameter when using type query.
Token uid to filter utxos in the query. Optional query parameter when using type query.
Address to filter utxos in the query. Optional query parameter when using type query.
Filter only utxos with value smaller than this. Optional query parameter when using type query.
Filter only utxos with value bigger than this. Optional query parameter when using type query.
token
object
deprecated
[DEPRECATED] Token to send the transaction, just in case is not HTR. This parameter is old and will be deprecated soon, you must preferably use the token parameter in the output object.
UID of the custom token to send the transaction.
Name of the custom token to send the transaction.
Symbol of the custom token to send the transaction.
Optional address to send the change amount.
Responses
- 200
Send a transaction with many outputs
- application/json
- Schema
- error
- success
- wallet-not-ready
- no-wallet-id
- invalid-wallet-id
Schema
any
Insuficient amount of tokens
{
"success": false,
"error": "Token HTR: Insufficient amount of tokens"
}
Success
{
"success": true,
"message": "",
"return_code": "success",
"tx": {
"hash": "00000000059dfb65633acacc402c881b128cc7f5c04b6cea537ea2136f1b97fb",
"nonce": 2455281664,
"timestamp": 1594955941,
"version": 1,
"weight": 18.11897634891149,
"parents": [
"00000000556bbfee6d37cc099a17747b06f48ca3d9bf4af85c707aa95ad04b3f",
"00000000e2e3e304e364edebff1c04c95cc9ef282463295f6e417b85fec361dd"
],
"inputs": [
{
"tx_id": "00000000caaa37ab729805b91af2de8174e3ef24410f4effc4ffda3b610eae65",
"index": 1,
"data": "RjBEAiAYR8jc+zqY596QyMp+K3Eag3kQB5aXdfYja19Fa17u0wIgCdhBQpjlBiAawP/9WRAqAzW85CJlBpzq+YVhUALg8IUhAueFQuEkAo+s2m7nj/hnh0nyphcUuxa2LoRBjOsEOHRQ"
},
{
"tx_id": "00000000caaa37ab729805b91af2de8174e3ef24410f4effc4ffda3b610eae65",
"index": 2,
"data": "RzBFAiEAofVXnCKNCEu4GRk7j+wHpQM6qmezRcfxHCe/PcUdbegCIE2nip27ZQtkpkEgNEhycqHM4CkLYMLVUgskphYsd/M9IQLHG6YJxXifQ6eMxPHbINFEJAUvrzKWe9V7AXXW4iywjg=="
}
],
"outputs": [
{
"value": 100,
"token_data": 0,
"script": "dqkUqdK8VisGSJuNItIBRYFfSHfHjPeIrA=="
},
{
"value": 200,
"token_data": 0,
"script": "dqkUISAnpOn9Vo269QBvOfBeWJTLx82IrA=="
}
],
"tokens": []
}
}
Wallet is not ready yet
{
"success": false,
"message": "Wallet is not ready.",
"state": 1
}
No wallet id parameter
{
"success": false,
"message": "Parameter 'wallet-id' is required."
}
Wallet id parameter is invalid
{
"success": false,
"message": "Invalid wallet-id parameter."
}