Send tokens
POST/wallet/send_tokens
Send tokens
Request
- application/json
Body
required
Data to create transactions
Array [
]
Array [
]
data
object
required
outputs
object[]
required
List of outputs to send the tokens
Destination address in base58
Value to be sent to the address (without decimal places, e.g. if you want to send 10.02 the value must be 1002)
Timestamp until when the output is locked
Hex encoded token uid, ommit for HTR
inputs
object[]
required
List of inputs to spend the tokens (can be empty)
Hash in hex of the spending transaction
Index of the output is being spent
The timestamp for the transaction. If sent without the inputs, server will chose inputs whose timestamp is smaller than the given value (so the tx is valid). If user sends timestamp=0, server will use current time.
Responses
- 200
Success
- application/json
- Schema
- success
- error1
- error2
- error3
- error4
Schema
any
Success
{
"success": true,
"message": "",
"tx": {
"hash": "00000c064ec72c8561a24b65bd50095a401b8d9a66c360cfe99cfcfeed73afc4",
"nonce": 2979,
"timestamp": 1547211690,
"version": 1,
"weight": 17.93619278054934,
"parents": [
"00000257054251161adff5899a451ae974ac62ca44a7a31179eec5750b0ea406",
"00000b8792cb13e8adb51cc7d866541fc29b532e8dec95ae4661cf3da4d42cb4"
],
"inputs": [
{
"tx_id": "00000257054251161adff5899a451ae974ac62ca44a7a31179eec5750b0ea406",
"index": 0,
"data": "RzBFAiAh6Jq+HOn9laOq3A5uUcaGLdWB4gM6RehsaP9OIMrOrwIhAOjWT+4ceSQI8CNXqaNNJgaOzCDhmFF1z1rhxOMCgonxIQNhXZKwBZeKxJpsJEqP4gIS4FFbEpG284HhmBfp1p5gUw=="
}
],
"outputs": [
{
"value": 1109,
"script": "dqkUMUdd0fmGCmGfv7B5UriM5VS5g16IrA=="
},
{
"value": 800,
"script": "dqkUeZkoJssEgwjPw/1ubA9XXZNk+xGIrA=="
}
],
"tokens": []
}
}
Invalid address
{
"success": false,
"message": "The address abc is invalid"
}
Insufficient funds
{
"success": false,
"message": "Insufficient funds. Requested amount: 200 / Available: 50"
}
Invalid input
{
"success": false,
"message": "Invalid input to create transaction"
}
Propagation error
{
"success": false,
"message": "Propagation error message",
"tx": {
"hash": "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f",
"nonce": 17076,
"timestamp": 1539271482,
"version": 1,
"weight": 14,
"parents": [],
"inputs": [],
"outputs": [],
"tokens": [],
"accumulated_weight": 14
}
}