pub enum HandleMsg {
Show 21 variants TransferNft { recipient: String, token_id: String, memo: Option<String>, padding: Option<String>, }, SendNft { contract: String, token_id: String, msg: Option<Binary>, memo: Option<String>, padding: Option<String>, }, Approve { spender: String, token_id: String, expires: Option<Expiration>, padding: Option<String>, }, Revoke { spender: String, token_id: String, padding: Option<String>, }, ApproveAll { operator: String, expires: Option<Expiration>, padding: Option<String>, }, RevokeAll { operator: String, padding: Option<String>, }, SetWhitelistedApproval { address: String, token_id: Option<String>, view_owner: Option<AccessLevel>, view_private_metadata: Option<AccessLevel>, transfer: Option<AccessLevel>, expires: Option<Expiration>, padding: Option<String>, }, RegisterReceiveNft { code_hash: String, also_implements_batch_receive_nft: Option<bool>, padding: Option<String>, }, SetViewingKey { key: String, padding: Option<String>, }, MintNft { token_id: Option<String>, owner: Option<String>, public_metadata: Option<Metadata>, private_metadata: Option<Metadata>, memo: Option<String>, padding: Option<String>, }, AddMinters { minters: Vec<String>, padding: Option<String>, }, RemoveMinters { minters: Vec<String>, padding: Option<String>, }, SetMinters { minters: Vec<String>, padding: Option<String>, }, SetMetadata { token_id: String, public_metadata: Option<Metadata>, private_metadata: Option<Metadata>, padding: Option<String>, }, BatchMintNft { mints: Vec<Mint>, padding: Option<String>, }, BatchTransferNft { transfers: Vec<Transfer>, padding: Option<String>, }, BatchSendNft { sends: Vec<Send>, padding: Option<String>, }, BurnNft { token_id: String, memo: Option<String>, padding: Option<String>, }, BatchBurnNft { burns: Vec<Burn>, padding: Option<String>, }, SetGlobalApproval { token_id: Option<String>, view_owner: Option<AccessLevel>, view_private_metadata: Option<AccessLevel>, expires: Option<Expiration>, padding: Option<String>, }, Reveal { token_id: String, padding: Option<String>, },
}
Expand description

SNIP-721 contract handle messages

Variants§

§

TransferNft

Fields

§recipient: String

recipient of the transfer

§token_id: String

id of the token to transfer

§memo: Option<String>

optional memo for the tx

§padding: Option<String>

optional message length padding

transfer a token

§

SendNft

Fields

§contract: String

address to send the token to

§token_id: String

id of the token to send

§msg: Option<Binary>

optional message to send with the (Batch)RecieveNft callback

§memo: Option<String>

optional memo for the tx

§padding: Option<String>

optional message length padding

send a token and call receiving contract’s (Batch)ReceiveNft

§

Approve

Fields

§spender: String

address being granted the permission

§token_id: String

id of the token that the spender can transfer

§expires: Option<Expiration>

optional expiration for this approval

§padding: Option<String>

optional message length padding

gives the spender permission to transfer the specified token. If you are the owner of the token, you can use SetWhitelistedApproval to accomplish the same thing. If you are an operator, you can only use Approve

§

Revoke

Fields

§spender: String

address whose permission is revoked

§token_id: String

id of the token that the spender can no longer transfer

§padding: Option<String>

optional message length padding

revokes the spender’s permission to transfer the specified token. If you are the owner of the token, you can use SetWhitelistedApproval to accomplish the same thing. If you are an operator, you can only use Revoke, but you can not revoke the transfer approval of another operator

§

ApproveAll

Fields

§operator: String

address being granted permission to transfer

§expires: Option<Expiration>

optional expiration for this approval

§padding: Option<String>

optional message length padding

provided for cw721 compliance, but can be done with SetWhitelistedApproval… gives the operator permission to transfer all of the message sender’s tokens

§

RevokeAll

Fields

§operator: String

address whose permissions are revoked

§padding: Option<String>

optional message length padding

provided for cw721 compliance, but can be done with SetWhitelistedApproval… revokes the operator’s permission to transfer any of the message sender’s tokens

§

SetWhitelistedApproval

Fields

§address: String

address being granted/revoked permission

§token_id: Option<String>

optional token id to apply approval/revocation to

§view_owner: Option<AccessLevel>

optional permission level for viewing the owner

§view_private_metadata: Option<AccessLevel>

optional permission level for viewing private metadata

§transfer: Option<AccessLevel>

optional permission level for transferring

§expires: Option<Expiration>

optional expiration

§padding: Option<String>

optional message length padding

add/remove approval(s) for a specific address on the token(s) you own. Any permissions that are omitted will keep the current permission setting for that whitelist address

§

RegisterReceiveNft

Fields

§code_hash: String

receving contract’s code hash

§also_implements_batch_receive_nft: Option<bool>

optionally true if the contract also implements BatchReceiveNft. Defaults to false if not specified

§padding: Option<String>

optional message length padding

register that the message sending contract implements ReceiveNft and possibly BatchReceiveNft

§

SetViewingKey

Fields

§key: String

desired viewing key

§padding: Option<String>

optional message length padding

set viewing key

§

MintNft

Fields

§token_id: Option<String>

optional token id. if omitted, uses current token index

§owner: Option<String>

optional owner address. if omitted, owned by the message sender

§public_metadata: Option<Metadata>

optional public metadata that can be seen by everyone

§private_metadata: Option<Metadata>

optional private metadata that can only be seen by the owner and whitelist

§memo: Option<String>

optional memo for the tx

§padding: Option<String>

optional message length padding

mint new token

§

AddMinters

Fields

§minters: Vec<String>

list of addresses that can now mint

§padding: Option<String>

optional message length padding

add addresses with minting authority

§

RemoveMinters

Fields

§minters: Vec<String>

list of addresses no longer allowed to mint

§padding: Option<String>

optional message length padding

revoke minting authority from addresses

§

SetMinters

Fields

§minters: Vec<String>

list of addresses with minting authority

§padding: Option<String>

optional message length padding

define list of addresses with minting authority

§

SetMetadata

Fields

§token_id: String

id of the token whose metadata should be updated

§public_metadata: Option<Metadata>

the optional new public metadata

§private_metadata: Option<Metadata>

the optional new private metadata

§padding: Option<String>

optional message length padding

set the public and/or private metadata.

§

BatchMintNft

Fields

§mints: Vec<Mint>

list of mint operations to perform

§padding: Option<String>

optional message length padding

Mint multiple tokens

§

BatchTransferNft

Fields

§transfers: Vec<Transfer>

list of transfers to perform

§padding: Option<String>

optional message length padding

transfer many tokens

§

BatchSendNft

Fields

§sends: Vec<Send>

list of sends to perform

§padding: Option<String>

optional message length padding

send many tokens and call receiving contracts’ (Batch)ReceiveNft

§

BurnNft

Fields

§token_id: String

token to burn

§memo: Option<String>

optional memo for the tx

§padding: Option<String>

optional message length padding

burn a token

§

BatchBurnNft

Fields

§burns: Vec<Burn>

list of burns to perform

§padding: Option<String>

optional message length padding

burn many tokens

§

SetGlobalApproval

Fields

§token_id: Option<String>

optional token id to apply approval/revocation to

§view_owner: Option<AccessLevel>

optional permission level for viewing the owner

§view_private_metadata: Option<AccessLevel>

optional permission level for viewing private metadata

§expires: Option<Expiration>

optional expiration

§padding: Option<String>

optional message length padding

add/remove approval(s) that whitelist everyone (makes public)

§

Reveal

Fields

§token_id: String

id of the token to unwrap

§padding: Option<String>

optional message length padding

Reveal the private metadata of a sealed token and mark the token as having been unwrapped

Implementations§

source§

impl HandleMsg

source

pub fn to_cosmos_msg( &self, block_size: usize, code_hash: String, contract_addr: String, send_amount: Option<Uint128> ) -> StdResult<CosmosMsg>

Returns a StdResult used to execute a SNIP721 contract function

Arguments
  • block_size - pad the message to blocks of this size
  • code_hash - String holding the code hash of the contract being called
  • contract_addr - address of the contract being called
  • send_amount - Optional Uint128 amount of native coin to send with the callback message NOTE: No SNIP721 messages send native coin, but the parameter is included in case that ever changes

Trait Implementations§

source§

impl Clone for HandleMsg

source§

fn clone(&self) -> HandleMsg

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for HandleMsg

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for HandleMsg

source§

fn eq(&self, other: &HandleMsg) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for HandleMsg

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for HandleMsg

source§

impl StructuralEq for HandleMsg

source§

impl StructuralPartialEq for HandleMsg

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.