iridium_walletd sendTransaction method
The sendTransaction method allows you to send transaction to one or several addresses. It also allow you to use a payment_id for a transaction to a single address.
Input:
Argument | Mandatory | Description | Format | Example |
---|---|---|---|---|
addresses | No | Array of addresses take the funds from | array | |
transfers | Yes | Array of address, amount1) | array | “amount”: 1000000000,“address”: “ir2HYyQRq3NZnsTqmHjBev2j5go5u4jMeNKwmVxtqhBE3nGomdk6a2tZ84b8EVBtYLGCBpMdjCDhZjc5ZwjfM8Hc2ryrsKXed” |
fee | Yes | Transaction fee2) | uint64 | 5000 |
unlockTime | No | Height of the block until which transaction is locked. | uint64 | 20 |
anonymity | Yes | Privacy level (mixin). Minimum 3, 10 is the higher. | uint64 | 3 |
extra | No | String of variable length. Can contain A-Z, 0-9 characters. | string | |
paymentId | No | payment_id | string | 372209c11ea6f6563ff319285fb2625dfbcde2573d1c32a585b1898639072912 |
changeAddress | No | Valid and existing in this container address. | string | ir2qzAzr1KfCk2sTsLdEq8BRSRyHnahcKJrPRZg8rHtkRCNBHJiiyNz8vWjwoM6F4PSbPQuNusEgGXc2A4NoDrQr2dH4rbmGs |
Note: if container contains only 1 address, changeAddress field can be left empty and the change is going to be sent to this address
Note: if addresses field contains only 1 address, changeAddress can be left empty and the change is going to be sent to this address
Note: in the rest of the cases, changeAddress field is mandatory and must contain an address.
Output:
Argument | Description | Format | Example |
---|---|---|---|
transactionHash | Hash of the sent transaction. | string | be1b16ebf9bd344a8b409ed94ce75e62d23a260439b27234f8d88e2f6c3ec51c |
Basic transaction from one address to another
Sending 10 IRD from a walletd with only one address:
Input Example:
{ "params":{ "anonymity":3, "fee":5000, "transfers":["amount":1000000000,"address":"ir2HYyQRq3NZnsTqmHjBev2j5go5u4jMeNKwmVxtqhBE3nGomdk6a2tZ84b8EVBtYLGCBpMdjCDhZjc5ZwjfM8Hc2ryrsKXed"] }, "jsonrpc":"2.0", "id":"test", "method":"sendTransaction" }
$ curl -s -X POST -d '{"params":{ "anonymity":3,"fee":5000,"transfers":[{"amount":1000000000,"address":"ir2HYyQRq3NZnsTqmHjBev2j5go5u4jMeNKwmVxtqhBE3nGomdk6a2tZ84b8EVBtYLGCBpMdjCDhZjc5ZwjfM8Hc2ryrsKXed"}]},"jsonrpc":"2.0","id":"test","method":"sendTransaction"}' localhost:14101/json_rpc | jq
Output Example:
{ "id": "test", "jsonrpc": "2.0", "result": { "transactionHash": "be1b16ebf9bd344a8b409ed94ce75e62d23a260439b27234f8d88e2f6c3ec51c" } }
Elaborated transaction from one address to some others
Sending 20 IRD from an address in walletd to 2 others address (10 IRD each):
Input Example:
{ "params":{ "anonymity":3, "fee":5000, "unlockTime":20, "paymentId":"372209c11ea6f6563ff319285fb2625dfbcde2573d1c32a585b1898639072912", "addresses":[ "ir48V76oJqAhYpGmsJgn79Yk6vvwYhU2cDc7azm3UW8C4EyzhhEDUUQjXtrbwzwpJ6Kp2ebwHErWD9VxBVnmXBk41oDB3Lt4j" ], "transfers":[ { "amount":1000000000, "address":"ir2HYyQRq3NZnsTqmHjBev2j5go5u4jMeNKwmVxtqhBE3nGomdk6a2tZ84b8EVBtYLGCBpMdjCDhZjc5ZwjfM8Hc2ryrsKXed" }, { "amount":1000000000, "address":"ir2SVdtNDnM4tCMkoFf9DqaAgx9qw9Qbxd78FABp6TGu4tvdhtVycdtbtDRpXJYAV8X43cy2vkw2QeP6P5cUxiMH33Lepab3v" } ], "changeAddress":"ir48V76oJqAhYpGmsJgn79Yk6vvwYhU2cDc7azm3UW8C4EyzhhEDUUQjXtrbwzwpJ6Kp2ebwHErWD9VxBVnmXBk41oDB3Lt4j" }, "jsonrpc":"2.0", "id":"test", "method":"sendTransaction" }
$ curl -s -X POST -d '{"params":{"anonymity":4,"fee":5000,"unlockTime":20,"paymentId":"372209c11ea6f6563ff319285fb2625dfbcde2573d1c32a585b1898639072912","addresses":["ir48V76oJqAhYpGmsJgn79Yk6vvwYhU2cDc7azm3UW8C4EyzhhEDUUQjXtrbwzwpJ6Kp2ebwHErWD9VxBVnmXBk41oDB3Lt4j"],"transfers":[{"amount":1000000000,"address":"ir2HYyQRq3NZnsTqmHjBev2j5go5u4jMeNKwmVxtqhBE3nGomdk6a2tZ84b8EVBtYLGCBpMdjCDhZjc5ZwjfM8Hc2ryrsKXed"},{"amount":1000000000,"address":"ir2SVdtNDnM4tCMkoFf9DqaAgx9qw9Qbxd78FABp6TGu4tvdhtVycdtbtDRpXJYAV8X43cy2vkw2QeP6P5cUxiMH33Lepab3v"}],"changeAddress":"ir48V76oJqAhYpGmsJgn79Yk6vvwYhU2cDc7azm3UW8C4EyzhhEDUUQjXtrbwzwpJ6Kp2ebwHErWD9VxBVnmXBk41oDB3Lt4j"},"jsonrpc":"2.0","id":"test","method":"sendTransaction"}' localhost:14101/json_rpc | jq( a very long line

Output Example:
{ "id": "test", "jsonrpc": "2.0", "result": { "transactionHash": "8d289898915e174e328ea6fec23a82ad8eff9d87487a982611ab750ab8bf028c" } }