Transaction basics

Introduction

Here, you'll learn the fundamentals of creating a transaction. You'll be able to check your credit balance as well as send them to other accounts.

Balance

To begin with creating a transaction, you'll first need to have an account with sufficient credits to send. If you have just created the wallet, you wouldn't have any balance. Therefore, you'll need to have one sent to your wallet address, or you'll have to mine them. To check you wallet balance, you can use the following action in the shell.

$ accountBalance address:0x0002a149e0b6ed3f4492818d31b6704bee96e0b3e5fbd282a7

You can use this action to check the balance of any wallet address. If you previously selected a wallet using selectWallet, you can simply call the action without the address option and it would return the balance of your default wallet.

$ accountBalance
Account balance
Balance: 20,000,000,000,000,000,000

Create transaction

Creating a transaction requires you to have a private key, used to sign and authorize the transaction. The options required are the private key, receiver address, amount to send, and an optional fee.

$ createTransaction key:0x001122... receiverAddress:0x0002a149e0b6ed3f4492818d31b6704bee96e0b3e5fbd282a7 amount:2700000

The simpler alternative is to use the selected wallet. You can omit the key option if a default wallet is already selected. It would send from the account of the selected wallet. You can also include an optional fee that rewards miners to process your transaction.

$ createTransaction receiverAddress:0x0002a149e0b6ed3f4492818d31b6704bee96e0b3e5fbd282a7 amount:27000000000000 fee:100

After you have created the transaction, it would be added be added to the list of pending transactions and propagated to peer nodes. You can view the details of the transaction. Your private key is converted to a public key in the transaction, which the network can use to verify the signature and derive your wallet address.

Transaction created:
Id: 0x7a5c6a7efd5700193ebe68eaf8a374d604ad231421e579f305ddffba41475cf0
Version: 1
Sender Key: 0x3076301006072a8648ce3d020106052b810400220...
Receiver Address: 0x0002a149e0b6ed3f4492818d31b6704bee96e0b3e5fbd282a7
Amount: 27,000,000,000,000
Signature: 0x3065023100c7b54fc28a6a742b39fdc2616a13c316f...
Time: 1642406777271
Type: send
Fee: 100

View transactions

When the transaction has been confirmed, it would appear in your account transaction history. Again, you can omit the address to use the default selected wallet.

$ accountTransactions address:0x0002a149e0b6ed3f4492818d31b6704bee96e0b3e5fbd282a7

Reference

That is all for the essentials. For the full list of transaction actions, go to the transaction reference.