Calls
forceTransfer
Exactly astransfer, except the origin must be root and the source account may be specified.
Namespace
forceUnreserve
Unreserve some balance from a user by force. Can only be called by ROOT. NamespacesetBalance
Set the balances of a given account. This will alterFreeBalance and ReservedBalance in storage. it will also alter the total issuance of the system (TotalIssuance) appropriately. If the new free or reserved balance is below the existential deposit, it will reset the account nonce (frame_system::AccountNonce).
The dispatch origin for this call is root.
Namespace
transfer
Transfer some liquid-free balance to another account.transfer will set the FreeBalance of the sender and receiver. If the sender’s account is below the existential deposit as a result of the transfer, the account will be reaped.
The dispatch origin for this call must be Signed by the transactor.
Namespace
transferAll
Transfer the entire transferable balance from the caller account. NOTE: This function only attempts to transfer transferable balances. This means that any locked, reserved, or existential deposits (whenkeep_alive is true), will not be transferred by this function. To ensure that this function results in a killed account, you might need to prepare the account by removing any reference counters, storage deposits, etc.
The dispatch origin of this call must be Signed.
-
dest: The recipient of the transfer. -
keep_alive: A boolean to determine if thetransfer_alloperation should send all of the funds the account has, causing the sender account to be killed (false), or transfer everything except at least the existential deposit, which will guarantee to keep the sender account alive (true). #
transferKeepAlive
Same as thetransfer call, but with a check that the transfer will not kill the origin account.
99% of the time you want transfer instead.
Namespace
Storage
account
The Balances pallet example of storing the balance of an account. Examplenocompile impl pallet_balances::Config for Runtime { type AccountStore = StorageMapShim<Self::Account<Runtime>, frame_system::Provider<Runtime>, AccountId, Self::AccountData<Balance>> }
You can also store the balance of an account in the System pallet.
Example
nocompile impl pallet_balances::Config for Runtime { type AccountStore = System }
But this comes with tradeoffs, storing account balances in the system pallet stores frame_system data alongside the account data contrary to storing account balances in the Balances pallet, which uses a StorageMap to store balances data only. NOTE: This is only used in the case that this pallet is used to store balances.
Namespace