Send Coins
Transfer coins between accounts and repositories.
The native coin can be transferred from one account to another account by creating and sending a TxCoinTransfer
transaction.
Example
The code above calls the user.send
console method, passing to it the transaction data and a key from the key store.
In the example above, we unlock Alice’s private key using user.getKey
, set the transfer value to 5000
and fee to 1
.
to
specifies the recipient of the transaction value. To can be a user address or a repository full address.
nonce
is the number of all transactions Alice’s key has sent to the network. The nonce value is used to order Alice’s transactions and prevent a double-spend attack. If not provided, it will be automatically set.
On the console, the accounts
global variable contains a list of address of keys on the keystore.
Send Coins to a Repository
Here we are transferring 5000
coins to a repository called cashmap
; We prefixed the repository name with r/
to indicate that the recipient is a repo.
Last updated