2

I used the following command to pass a monero transaction with the daemon :

{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"account_index":2,"destinations":[{"amount":100000000,"address":"9wNgSYy2F9qPZu7KBjvsFgZLTKE2TZgEpNFbGka9gA5zPmAXS35QzzYaLKJRkYTnzgArGNX7TvSqZC87tBLwtaC5RQgJ8rm"}]}}

But I need a command whose I can define the source address from which I can send the coin monero.

MoneroDev
  • 45
  • 3

1 Answers1

1

Each account in a wallet has a number, and each subaddress in an account has a number.

You can add the account_index and subaddr_indices options when calling the transfer method to indicate from which subaddress (or subaddresses) the coins will be taken.

For example to use subaddress n°3 in account n°2 as source of the coins:

{"jsonrpc":"2.0",
 "id":"0",
 "method":"transfer",
 "params":{"account_index":2,
           "subaddr_indices":[3],
           "destinations":[{"amount":100000000, "address":"9wNgSYy2F9qPZu7KBjvsFgZLTKE2TZgEpNFbGka9gA5zPmAXS35QzzYaLKJRkYTnzgArGNX7TvSqZC87tBLwtaC5RQgJ8rm"}],
           "get_tx_key":true}}

The documentation of the transfer method is here.

glv
  • 3,364
  • 11
  • 15