Enum secret_toolkit_snip721::query::QueryMsg
source · pub enum QueryMsg {
Show 16 variants
ContractInfo {},
NumTokens {
viewer: Option<ViewerInfo>,
},
AllTokens {
viewer: Option<ViewerInfo>,
start_after: Option<String>,
limit: Option<u32>,
},
OwnerOf {
token_id: String,
viewer: Option<ViewerInfo>,
include_expired: Option<bool>,
},
NftInfo {
token_id: String,
},
AllNftInfo {
token_id: String,
viewer: Option<ViewerInfo>,
include_expired: Option<bool>,
},
PrivateMetadata {
token_id: String,
viewer: Option<ViewerInfo>,
},
NftDossier {
token_id: String,
viewer: Option<ViewerInfo>,
include_expired: Option<bool>,
},
TokenApprovals {
token_id: String,
viewing_key: String,
include_expired: Option<bool>,
},
ApprovedForAll {
owner: String,
viewing_key: Option<String>,
include_expired: Option<bool>,
},
InventoryApprovals {
address: String,
viewing_key: String,
include_expired: Option<bool>,
},
Tokens {
owner: String,
viewer: Option<String>,
viewing_key: Option<String>,
start_after: Option<String>,
limit: Option<u32>,
},
TransactionHistory {
address: String,
viewing_key: String,
page: Option<u32>,
page_size: Option<u32>,
},
Minters {},
IsUnwrapped {
token_id: String,
},
VerifyTransferApproval {
token_ids: Vec<String>,
address: String,
viewing_key: String,
},
}
Expand description
SNIP-721 queries
Variants§
ContractInfo
Fields
display the contract’s name and symbol
NumTokens
Fields
viewer: Option<ViewerInfo>
optional address and key requesting to view the number of tokens
display the number of tokens controlled by the contract. The token supply must either be public, or the querier must be an authenticated minter
AllTokens
Fields
viewer: Option<ViewerInfo>
optional address and key requesting to view the list of tokens
display an optionally paginated list of all the tokens controlled by the contract. The token supply must either be public, or the querier must be authorized to view
OwnerOf
Fields
viewer: Option<ViewerInfo>
optional address and key requesting to view the token owner
display the owner of the specified token if authorized to view it. If the requester
is also the token’s owner, the response will also include a list of any addresses
that can transfer this token. The transfer approval list is for CW721 compliance,
but the NftDossier
query will be more complete by showing viewing approvals as well
NftInfo
displays the token’s public metadata
AllNftInfo
Fields
viewer: Option<ViewerInfo>
optional address and key requesting to view the token owner
PrivateMetadata
Fields
viewer: Option<ViewerInfo>
optional address and key requesting to view the private metadata
displays the token’s private Metadata
NftDossier
Fields
viewer: Option<ViewerInfo>
optional address and key requesting to view the token information
displays all the information about a token that the viewer has permission to see. This may include the owner, the public metadata, the private metadata, and the token and inventory approvals
TokenApprovals
Fields
list all the Approvals
in place for a specified token if given the owner’s viewing
key
ApprovedForAll
Fields
displays a list of all the CW721-style operators (any address that was granted approval to transfer all of the owner’s tokens). This query is provided to maintain CW-721 compliance, however, approvals are private on secret network, so only the owner’s viewing key will authorize the ability to see the list of operators
InventoryApprovals
Fields
list all the inventory-wide Approvals
in place for the specified address if given the
the correct viewing key for the address
Tokens
Fields
displays a list of all the tokens belonging to the input owner in which the viewer has view_owner permission
TransactionHistory
Fields
display the transaction history for the specified address in reverse chronological order
Minters
Fields
display the list of authorized minters
IsUnwrapped
display if a token is unwrapped
VerifyTransferApproval
Fields
verify that the specified address has approval to transfer every listed token
Implementations§
source§impl QueryMsg
impl QueryMsg
sourcepub fn query<C: CustomQuery, T: DeserializeOwned>(
&self,
querier: QuerierWrapper<'_, C>,
block_size: usize,
code_hash: String,
contract_addr: String
) -> StdResult<T>
pub fn query<C: CustomQuery, T: DeserializeOwned>( &self, querier: QuerierWrapper<'_, C>, block_size: usize, code_hash: String, contract_addr: String ) -> StdResult<T>
Returns a StdResult
Arguments
querier
- a reference to the Querier dependency of the querying contractblock_size
- pad the message to blocks of this sizecode_hash
- String holding the code hash of the contract being queriedcontract_addr
- address of the contract being queried