pub fn withdraw_tokens<T: Config>(
_msa_owner_public_key: T::AccountId,
msa_owner_proof: MultiSignature,
authorization_payload: AuthorizedKeyData<T>,
)
Expand description
Withdraw all available tokens from the account associated with the MSA, to the account of the caller.
The origin
parameter represents the account from which the function is called and must be the account receiving the tokens.
The function requires one signature: msa_owner_proof
, which serve as proof that the owner of the MSA authorizes the transaction.
The necessary information for the withdrawal authorization, the destination account and the MSA ID, are contained in the authorization_payload
parameter of type AddKeyData.
It also contains an expiration block number for the proof, ensuring it is valid and must be greater than the current block.
§Events
pallet_balances::Event::<T,I>::Transfer
- Transfer token event
§Errors
Error::ProofHasExpired
- the current block is less than theexpired
block number set inAddKeyData
.Error::ProofNotYetValid
- theexpired
block number set inAddKeyData
is greater than the current block number plus mortality_block_limit().Error::SignatureAlreadySubmitted
- signature has already been used.Error::InsufficientBalanceToWithdraw
- the MSA account has not balance to withdrawError::UnexpectedTokenTransferError
- the token transfer failed
§Warning: Doc-Only
This function is an automatically generated, and is doc-only, uncallable
stub. See the real version in
Pallet::withdraw_tokens
.