Transfer Tokens
This example assumes you have read and followed the instructions in the Prerequisites and Setup sections.
Let's assume:
  • oasis1qr6swa6gsp2ukfjcdmka8wrkrwz294t7ev39nrw6 is our staking account address,
  • oasis1qr3jc2yfhszpyy0daha2l9xjlkrxnzas0uaje4t3 is the destination's staking account address.
To convert your entity's ID to a staking account address, see the Obtain Account Address From Entity's ID section.

Query Our Account's Info

To query our staking account's information, use the following command:
1
oasis-node stake account info \
2
-a $ADDR \
3
--stake.account.address oasis1qr6swa6gsp2ukfjcdmka8wrkrwz294t7ev39nrw6
Copied!
For a detailed explanation on querying account information, see the Get Info section.
Before the transaction, this outputs:
1
General Account:
2
Balance: ROSE 601.492492765
3
Nonce: 7
4
Escrow Account:
5
Active:
6
Balance: ROSE 11242.38481664
7
Total Shares: 10000000000000
8
Debonding:
9
Balance: ROSE 0.0
10
Total Shares: 0
11
...
Copied!
We can observe that:
  • General account's balance is ~601 tokens.
  • Account's nonce is 7.
  • ~11242 tokens are actively bounded to the escrow account.
  • The amount of tokens that are currently debonding is 0.

Query Destination Account's Info

To query the destination account's information, use the following command:
1
oasis-node stake account info \
2
-a $ADDR \
3
--stake.account.address oasis1qr3jc2yfhszpyy0daha2l9xjlkrxnzas0uaje4t3
Copied!
Before the transaction, this outputs:
1
General Account:
2
Balance: ROSE 0.0
3
Nonce: 1030
4
Escrow Account:
5
Active:
6
Balance: ROSE 0.0
7
Total Shares: 0
8
Debonding:
9
Balance: ROSE 0.0
10
Total Shares: 0
11
...
Copied!
We can observe that both, the general account and the escrow account (actively bounded and debonding), have a balance of 0 tokens.

Generate a Transfer Transaction

Let's generate a transfer transaction of 170 tokens, (i.e. 170 * 10^9 base units), from our account to the chosen destination account and store it to tx_transfer.json:
1
oasis-node stake account gen_transfer \
2
"${TX_FLAGS[@]}" \
3
--stake.amount 170000000000 \
4
--stake.transfer.destination oasis1qr3jc2yfhszpyy0daha2l9xjlkrxnzas0uaje4t3 \
5
--transaction.file tx_transfer.json \
6
--transaction.nonce 7 \
7
--transaction.fee.gas 1000 \
8
--transaction.fee.amount 2000
Copied!
This will output a preview of the generated transaction:
1
You are about to sign the following transaction:
2
Nonce: 7
3
Fee:
4
Amount: ROSE 0.000002
5
Gas limit: 1000
6
(gas price: ROSE 0.000000002 per gas unit)
7
Method: staking.Transfer
8
Body:
9
To: oasis1qr3jc2yfhszpyy0daha2l9xjlkrxnzas0uaje4t3
10
Amount: ROSE 170.0
11
Other info:
12
Genesis document's hash: 976c302f696e417bd861b599e79261244f4391f3887a488212ee122ca7bbf0a8
Copied!
and ask you for confirmation.

Submit the Transaction

To submit the generated transaction, we need to copy tx_transfer.json to the online Oasis node (i.e. the server) and submit it from there:
1
oasis-node consensus submit_tx \
2
-a $ADDR \
3
--transaction.file tx_transfer.json
Copied!

Query Both Accounts' Info

Let's check both accounts' info, first ours:
1
General Account:
2
Balance: ROSE 431.492490765
3
Nonce: 8
4
Escrow Account:
5
Active:
6
Balance: ROSE 11242.38481664
7
Total Shares: 10000000000000
8
Debonding:
9
Balance: ROSE 0.0
10
Total Shares: 0
11
...
Copied!
and then the destination's:
1
General Account:
2
Balance: ROSE 170.0
3
Nonce: 1030
4
Escrow Account:
5
Active:
6
Balance: ROSE 0.0
7
Total Shares: 0
8
Debonding:
9
Balance: ROSE 0.0
10
Total Shares: 0
11
...
Copied!
We can observe that:
  • Our general balance decreased for 170.000002 tokens. The 0.000002 token corresponds to the fee that we specified we will pay for this transaction.
  • Our account's nonce increased to 8.
  • Destination account's general balance increased for 170 tokens.
Last modified 9mo ago