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.

back to methods summary

Input:

ArgumentMandatoryDescriptionFormatExample
addresses No Array of addresses take the funds fromarray
transfers Yes Array of address, amount1)array“amount”: 1000000000,“address”: “ir2HYyQRq3NZnsTqmHjBev2j5go5u4jMeNKwmVxtqhBE3nGomdk6a2tZ84b8EVBtYLGCBpMdjCDhZjc5ZwjfM8Hc2ryrsKXed”
fee Yes Transaction fee2)uint645000
unlockTime No Height of the block until which transaction is locked.uint6420
anonymity Yes Privacy level (mixin). Minimum 3, 10 is the higher.uint643
extra No String of variable length. Can contain A-Z, 0-9 characters.string
paymentId No payment_idstring372209c11ea6f6563ff319285fb2625dfbcde2573d1c32a585b1898639072912
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:

ArgumentDescriptionFormatExample
transactionHashHash of the sent transaction.string be1b16ebf9bd344a8b409ed94ce75e62d23a260439b27234f8d88e2f6c3ec51c

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"
  }
}

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 8-))

Output Example:

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

back to methods summary


1)
In Iridium unit, so 10 (IRD) = 10*10^8 = 1000000000 units
2)
Minimal fee in Iridium is 0.00005 IRD. This parameter should be specified in minimal available IRD units. For example, if your fee is 0.00005 IRD, you should pass it as 5000 - Iridium decimal units is 8 so 1 unit = 1/10^8 IRD