transfer
Creates a transaction and broadcasts it to the network
Request
If you use multiple addresses in destinations field, make sure there are maximum 1 integrated address involved, or, if "payment id" parameter was specified, then integrated addresses are not allowed.
{
"id": 0,
"jsonrpc": "2.0",
"method": "transfer",
"params": {
"comment": "",
"destinations": [{
"address": "NiRDNaMeZjwCjnHuU5gUNyrP1pM3U5vckbakzzV6dEHyDYeCpW8XGLBFTshcaY8LkG9RQn7FsQx8w2JeJzJwPwuDm2NfixPAXf",
"amount": 10000000000000
}],
"fee": 10000000000,
"hide_receiver": true,
"mixin": 15,
"payment_id": "1dfe5a88ff9effb3",
"push_payer": false,
"service_entries": [{
"body": "dcfd7e055a6a3043ea3541a571a57a63e25dcc64e4a270f14fa9a58ac5dbec85dcfd7e055a6a3043ea3541a571a57a63e25dcc64e4a270f14fa9a58ac5dbec85",
"flags": 0,
"instruction": "",
"security": "d8f6e37f28a632c06b0b3466db1b9d2d1b36a580ee35edfd971dc1423bc412a5",
"service_id": ""
}],
"service_entries_permanent": true
}
}
Request parameters
- comment - string; text comment that is displayed in UI. Attached to the transaction in encrypted form, so only the counterparties can read it. Optional; pass an empty string to omit it.
- destinations - array of objects; the list of recipients. At least one entry is required. Fields of each entry:
- address - string; destination address. May be a standard
NiR-prefixed address, an integrated address or a registered alias. - amount - unsigned int; amount to transfer to this destination, in atomic units.
- address - string; destination address. May be a standard
- fee - unsigned int; fee to be paid on behalf of sender's wallet (paid in native coins). Must be at least the minimum fee currently accepted by the tx pool, otherwise the call fails with a
WRONG_ARGUMENTerror. - hide_receiver - boolean; controls whether information about the remote address (destination) is embedded in the transaction. This might be needed when the wallet is restored from a seed phrase and fully resynced: if this option was
true, the sender will no longer be able to see the remote address of the sent transaction. - mixin - unsigned int; specifies the number of mixins (decoys) that will be used to create the inputs. Relevant for pre-Zarcanum outputs; for post-Zarcanum outputs this option is superseded by a number defined by network hard rules (15+).
- payment_id - string; hex-encoded payment id, normally used by exchanges for their user database. Optional; pass an empty string to omit it. Cannot be combined with an integrated address that already carries a payment id.
- push_payer - boolean; reveal information about the sender of this transaction, i.e. add the sender's address to the transaction in encrypted form, so that only the receiver can see who sent it.
- service_entries - array of objects; service entries that might be used by different apps that work on top of the Nirmata Network. Not part of consensus. Optional. Fields of each entry:
- body - string; hex-encoded body of the attachment.
- flags - unsigned int; flags that help the wallet automatically process some properties of the attachment. A combination of
TX_SERVICE_ATTACHMENT_ENCRYPT_BODY= 1,TX_SERVICE_ATTACHMENT_DEFLATE_BODY= 2,TX_SERVICE_ATTACHMENT_ENCRYPT_BODY_ISOLATE_AUDITABLE= 4,TX_SERVICE_ATTACHMENT_ENCRYPT_ADD_PROOF= 8. - instruction - string; instruction that makes sense for this particular service.
- security - string; hex-encoded public key of the owner. Optional.
- service_id - string; service id, the identifier that distinguishes one service from another.
- service_entries_permanent - boolean; tells the wallet that
service_entriesshould be placed in theextrasection of the transaction (which is not pruned after checkpoints) rather than inattachment.
This method does not accept an unlock_time parameter, and destinations do not accept an asset_id — the wallet always sends native coins with no time lock. Both fields are ignored if present in the request.
Response
{
"id": 0,
"jsonrpc": "2.0",
"result": {
"tx_hash": "b329cce92a23fdaf89a5ad907ca9c4c1fbd052b79ec8414438533c83b39afc2b",
"tx_size": 4327,
"tx_unsigned_hex": ""
}
}
Response information
Which fields are populated depends on the kind of wallet the RPC server is serving. A normal, spend-capable wallet signs and relays the transaction itself and fills in tx_hash and tx_size, leaving tx_unsigned_hex empty. A watch-only wallet cannot sign, so it returns the unsigned transaction in tx_unsigned_hex and leaves both tx_hash and tx_size empty/zero — the hash is not final until the transaction has been signed. In that case, pass tx_unsigned_hex to sign_transfer on the corresponding cold wallet, then relay the signed blob with submit_transfer.
- tx_hash - string; hash identifier of the transaction that was successfully sent. Empty for watch-only wallets.
- tx_size - unsigned int; size of the created and broadcast transaction, in bytes.
0for watch-only wallets. - tx_unsigned_hex - string; hex-encoded unsigned transaction (for watch-only wallets; to be used in the cold-signing process). Empty for normal wallets.
This method returns no status field. Failures are reported as a JSON-RPC error object instead of a result, so a response containing result always means the request succeeded.