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

§start_after: Option<String>

optionally display only token ids that come after the input String in lexicographical order

§limit: Option<u32>

optional number of token ids to display

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

§token_id: String
§viewer: Option<ViewerInfo>

optional address and key requesting to view the token owner

§include_expired: Option<bool>

optionally include expired Approvals in the response list. If ommitted or false, expired Approvals will be filtered out of the response

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

Fields

§token_id: String

displays the token’s public metadata

§

AllNftInfo

Fields

§token_id: String
§viewer: Option<ViewerInfo>

optional address and key requesting to view the token owner

§include_expired: Option<bool>

optionally include expired Approvals in the response list. If ommitted or false, expired Approvals will be filtered out of the response

displays all the information contained in the OwnerOf and NftInfo queries

§

PrivateMetadata

Fields

§token_id: String
§viewer: Option<ViewerInfo>

optional address and key requesting to view the private metadata

displays the token’s private Metadata

§

NftDossier

Fields

§token_id: String
§viewer: Option<ViewerInfo>

optional address and key requesting to view the token information

§include_expired: Option<bool>

optionally include expired Approvals in the response list. If ommitted or false, expired Approvals will be filtered out of the response

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

§token_id: String
§viewing_key: String

the token owner’s viewing key

§include_expired: Option<bool>

optionally include expired Approvals in the response list. If ommitted or false, expired Approvals will be filtered out of the response

list all the Approvals in place for a specified token if given the owner’s viewing key

§

ApprovedForAll

Fields

§owner: String
§viewing_key: Option<String>

optional viewing key to authenticate this query. It is “optional” only in the sense that a CW721 query does not have this field. However, not providing the key will always result in an empty list

§include_expired: Option<bool>

optionally include expired Approvals in the response list. If ommitted or false, expired Approvals will be filtered out of the response

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

§address: String
§viewing_key: String

the viewing key

§include_expired: Option<bool>

optionally include expired Approvals in the response list. If ommitted or false, expired Approvals will be filtered out of the response

list all the inventory-wide Approvals in place for the specified address if given the the correct viewing key for the address

§

Tokens

Fields

§owner: String
§viewer: Option<String>

optional address of the querier if different from the owner

§viewing_key: Option<String>

optional viewing key

§start_after: Option<String>

optionally display only token ids that come after the input String in lexicographical order

§limit: Option<u32>

optional number of token ids to display

displays a list of all the tokens belonging to the input owner in which the viewer has view_owner permission

§

TransactionHistory

Fields

§address: String
§viewing_key: String

viewing key

§page: Option<u32>

optional page to display

§page_size: Option<u32>

optional number of transactions per page

display the transaction history for the specified address in reverse chronological order

§

Minters

Fields

display the list of authorized minters

§

IsUnwrapped

Fields

§token_id: String

display if a token is unwrapped

§

VerifyTransferApproval

Fields

§token_ids: Vec<String>

list of tokens to verify approval for

§address: String

address that has approval

§viewing_key: String

viewing key

verify that the specified address has approval to transfer every listed token

Implementations§

source§

impl QueryMsg

source

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, where T is the “Response” type that wraps the query answer

Arguments
  • querier - a reference to the Querier dependency of the querying contract
  • block_size - pad the message to blocks of this size
  • code_hash - String holding the code hash of the contract being queried
  • contract_addr - address of the contract being queried

Trait Implementations§

source§

impl Clone for QueryMsg

source§

fn clone(&self) -> QueryMsg

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 QueryMsg

source§

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

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

impl Display for QueryMsg

source§

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

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

impl PartialEq for QueryMsg

source§

fn eq(&self, other: &QueryMsg) -> 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 QueryMsg

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 QueryMsg

source§

impl StructuralEq for QueryMsg

source§

impl StructuralPartialEq for QueryMsg

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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. 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.