pub trait NonFungibleTokenApprovalReceiver {
// Required method
fn nft_on_approve(
&mut self,
token_id: TokenId,
owner_id: AccountId,
approval_id: u64,
msg: String,
) -> PromiseOrValue<String>;
}
Expand description
Approval receiver is the trait for the method called (or attempted to be called) when an NFT contract adds an approval for an account.
Required Methods§
Sourcefn nft_on_approve(
&mut self,
token_id: TokenId,
owner_id: AccountId,
approval_id: u64,
msg: String,
) -> PromiseOrValue<String>
fn nft_on_approve( &mut self, token_id: TokenId, owner_id: AccountId, approval_id: u64, msg: String, ) -> PromiseOrValue<String>
Respond to notification that contract has been granted approval for a token.
Notes
- Contract knows the token contract ID from
predecessor_account_id
Arguments:
token_id
: the token to which this contract has been granted approvalowner_id
: the owner of the tokenapproval_id
: the approval ID stored by NFT contract for this approval. Expected to be a number within the 2^53 limit representable by JSON.msg
: specifies information needed by the approved contract in order to handle the approval. Can indicate both a function to call and the parameters to pass to that function.