[][src]Function transaction_builder::encode_add_currency_to_account_script

pub fn encode_add_currency_to_account_script(currency: TypeTag) -> Script


Adds a zero Currency balance to the sending account. This will enable account to send, receive, and hold Libra::Libra<Currency> coins. This transaction can be successfully sent by any account that is allowed to hold balances (e.g., VASP, Designated Dealer).

Technical Description

After the successful execution of this transaction the sending account will have a LibraAccount::Balance<Currency> resource with zero balance published under it. Only accounts that can hold balances can send this transaction, the sending account cannot already have a LibraAccount::Balance<Currency> published under it.


CurrencyTypeThe Move type for the Currency being added to the sending account of the transaction. Currency must be an already-registered currency on-chain.
account&signerThe signer of the sending account of the transaction.

Common Abort Conditions

Error CategoryError ReasonDescription
Errors::NOT_PUBLISHEDLibra::ECURRENCY_INFOThe Currency is not a registered currency on-chain.
Errors::INVALID_ARGUMENTLibraAccount::EROLE_CANT_STORE_BALANCEThe sending account's role does not permit balances.
Errors::ALREADY_PUBLISHEDLibraAccount::EADD_EXISTING_CURRENCYA balance for Currency is already published under the sending account.

Related Scripts