Enum snip1155_reference_impl::msg::ExecuteMsg
source · pub enum ExecuteMsg {
Show 20 variants
CurateTokenIds {
initial_tokens: Vec<CurateTokenId>,
memo: Option<String>,
padding: Option<String>,
},
MintTokens {
mint_tokens: Vec<TokenAmount>,
memo: Option<String>,
padding: Option<String>,
},
BurnTokens {
burn_tokens: Vec<TokenAmount>,
memo: Option<String>,
padding: Option<String>,
},
ChangeMetadata {
token_id: String,
public_metadata: Box<Option<Metadata>>,
private_metadata: Box<Option<Metadata>>,
},
Transfer {
token_id: String,
from: Addr,
recipient: Addr,
amount: Uint128,
memo: Option<String>,
padding: Option<String>,
},
BatchTransfer {
actions: Vec<TransferAction>,
padding: Option<String>,
},
Send {
token_id: String,
from: Addr,
recipient: Addr,
recipient_code_hash: Option<String>,
amount: Uint128,
msg: Option<Binary>,
memo: Option<String>,
padding: Option<String>,
},
BatchSend {
actions: Vec<SendAction>,
padding: Option<String>,
},
GivePermission {
allowed_address: Addr,
token_id: String,
view_balance: Option<bool>,
view_balance_expiry: Option<Expiration>,
view_private_metadata: Option<bool>,
view_private_metadata_expiry: Option<Expiration>,
transfer: Option<Uint128>,
transfer_expiry: Option<Expiration>,
padding: Option<String>,
},
RevokePermission {
token_id: String,
owner: Addr,
allowed_address: Addr,
padding: Option<String>,
},
CreateViewingKey {
entropy: String,
padding: Option<String>,
},
SetViewingKey {
key: String,
padding: Option<String>,
},
RevokePermit {
permit_name: String,
padding: Option<String>,
},
AddCurators {
add_curators: Vec<Addr>,
padding: Option<String>,
},
RemoveCurators {
remove_curators: Vec<Addr>,
padding: Option<String>,
},
AddMinters {
token_id: String,
add_minters: Vec<Addr>,
padding: Option<String>,
},
RemoveMinters {
token_id: String,
remove_minters: Vec<Addr>,
padding: Option<String>,
},
ChangeAdmin {
new_admin: Addr,
padding: Option<String>,
},
RemoveAdmin {
current_admin: Addr,
contract_address: Addr,
padding: Option<String>,
},
RegisterReceive {
code_hash: String,
padding: Option<String>,
},
}
Expand description
Handle messages to SNIP1155 contract.
Mostly responds with HandleAnswer { <variant_name>: { status: success }}
if successful.
See HandleAnswer for the response messages for each variant.
Variants§
CurateTokenIds
curates new token_ids. Only curators can access this function.
MintTokens
mints additional tokens of existing fungible token_ids, if configuration allows this, ie
enable_mint == true
.
Only minters can access this function
BurnTokens
burns existing tokens, if configuration allows this, ie
enable_burn == true
.
Only owners can burn their own tokens in the base specifications. Flexibility is built
into the contract functions to allow other addresses to burn tokens, allowed in additional specifications.
ChangeMetadata
Fields
public_metadata: Box<Option<Metadata>>
does not attempt to change if left blank. Can effectively remove metadata by setting
metadata to Some(Metadata {token_uri: None, extension: None})
used Box
private_metadata: Box<Option<Metadata>>
does not attempt to change if left blank. Can effectively remove metadata by setting
metadata to Some(Metadata {token_uri: None, extension: None})
used Box
allows owner or minter to change metadata if allowed by token_id configuration.
Transfer
transfers one or more tokens of a single token_id. Other third address can perform this function if it has permission to transfer. ie: if addr3 can call this function to transfer tokens from addr0 to addr2, if addr0 gives addr3 enough transfer allowance.
BatchTransfer
performs transfer
s of multiple token_ids in a single transaction
Send
similar to transfer, but also sends a cosmos message. The recipient needs to be a contract that has a SNIP1155Receive handle function. See receiver for more information.
BatchSend
performs send
of multiple token_ids in a single transaction
GivePermission
Fields
allowed_address: Addr
address being granted/revoked permission
token_id: String
token id to apply approval/revocation to.
Additional Spec feature: if == None, perform action for all owner’s token_id
s
view_balance: Option<bool>
optional permission level for viewing balance. If ignored, leaves current permission settings
view_balance_expiry: Option<Expiration>
view_private_metadata: Option<bool>
optional permission level for viewing private metadata. If ignored, leaves current permission settings
view_private_metadata_expiry: Option<Expiration>
transfer: Option<Uint128>
set allowance by for transfer approvals. If ignored, leaves current permission settings
transfer_expiry: Option<Expiration>
allows an owner of token_ids to change transfer or viewership permissions to other addresses.
The base specification has three types of permissions:
- view balance permission: owner can allow another address to view owner’s balance of specific token_ids
- view private metadata: owner can allow another address to view private metadata of specific token_ids
- transfer allowance: owner can give permission to another address to transfer tokens up to a certain limit (cumulatively) Owners can set an expiry for each of these permissions.
SNIP1155 gives flexibility for permissions to have any combination of
- type of permission granted
- on which token_ids
RevokePermission
Removes all permissions that a specific owner has granted to a specific address, for a specific token_id.
A permission grantee can use this function to renounce a permission it has been given.
For owners, the GivePermission
message can be used instead to have the same effect as RevokePermission
.
CreateViewingKey
SetViewingKey
RevokePermit
disallow the use of a query permit
AddCurators
RemoveCurators
AddMinters
RemoveMinters
ChangeAdmin
RemoveAdmin
Permanently breaks admin keys for this contract. No admin function can be called after this action. Any existing curators or minters will remain as curators or minters; no new curators can be added and no current curator can be removed.
Requires caller to input current admin address and contract address. These inputs are not strictly necessary, but as a safety precaution to reduce the chances of accidentally calling this function.
RegisterReceive
Trait Implementations§
source§impl Clone for ExecuteMsg
impl Clone for ExecuteMsg
source§fn clone(&self) -> ExecuteMsg
fn clone(&self) -> ExecuteMsg
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ExecuteMsg
impl Debug for ExecuteMsg
source§impl<'de> Deserialize<'de> for ExecuteMsg
impl<'de> Deserialize<'de> for ExecuteMsg
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl JsonSchema for ExecuteMsg
impl JsonSchema for ExecuteMsg
source§fn schema_name() -> String
fn schema_name() -> String
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read more