pub enum QueryAnswer {
    ContractInfo {
        admin: Option<Addr>,
        curators: Vec<Addr>,
        all_token_ids: Vec<String>,
    },
    Balance {
        amount: Uint128,
    },
    AllBalances(Vec<OwnerBalance>),
    TransactionHistory {
        txs: Vec<Tx>,
        total: u64,
    },
    Permission(Option<Permission>),
    AllPermissions {
        permission_keys: Vec<PermissionKey>,
        permissions: Vec<Permission>,
        total: u64,
    },
    TokenIdPublicInfo {
        token_id_info: StoredTokenInfo,
        total_supply: Option<Uint128>,
        owner: Option<Addr>,
    },
    TokenIdPrivateInfo {
        token_id_info: StoredTokenInfo,
        total_supply: Option<Uint128>,
        owner: Option<Addr>,
    },
    RegisteredCodeHash {
        code_hash: Option<String>,
    },
    ViewingKeyError {
        msg: String,
    },
}
Expand description

the query responses for each QueryMsg variant

Variants§

§

ContractInfo

Fields

§admin: Option<Addr>
§curators: Vec<Addr>

the list of curators in the contract

§all_token_ids: Vec<String>

the list of all token_ids that have been curated

returns contract-level information:

§

Balance

Fields

§amount: Uint128

returns balance of a specific token_id. Owners can give permission to other addresses to query their balance

§

AllBalances(Vec<OwnerBalance>)

returns all token_id balances owned by an address. Only owners can use this query

§

TransactionHistory

Fields

§txs: Vec<Tx>
§total: u64

all permissions related to a particular address. Note that “curation” is not recorded as a transaction per se, but the tokens minted as part of the initial_balances set by the curator is recorded under TxAction::Mint

§

Permission(Option<Permission>)

§

AllPermissions

Fields

§permission_keys: Vec<PermissionKey>
§permissions: Vec<Permission>
§total: u64

the total number of permission entries stored for a given granter, which may include “blank” permissions, ie: where all permissions are set to false or Uint128(0)

all permissions granted, viewable by the permission granter. Users or applications can match the permission_keys that corresponds to each permission as they have a similar order, ie: the index of permission_keys vector corresponds to the index of the permissions vector.

§

TokenIdPublicInfo

Fields

§token_id_info: StoredTokenInfo

token_id_info.private_metadata will always = None

§total_supply: Option<Uint128>

if public_total_supply == false, total_supply = None

§owner: Option<Addr>

if owner_is_public == false, total_supply = None

§

TokenIdPrivateInfo

Fields

§token_id_info: StoredTokenInfo
§total_supply: Option<Uint128>

if public_total_supply == false, total_supply = None

§owner: Option<Addr>

if owner_is_public == false, total_supply = None

§

RegisteredCodeHash

Fields

§code_hash: Option<String>

returns None if contract has not registered with SNIP1155 contract

§

ViewingKeyError

Fields

returned when an viewing_key-specific errors occur during a user’s attempt to perform an authenticated query

Trait Implementations§

source§

impl Debug for QueryAnswer

source§

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

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

impl<'de> Deserialize<'de> for QueryAnswer

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl JsonSchema for QueryAnswer

source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
source§

fn json_schema(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
source§

impl Serialize for QueryAnswer

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

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,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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<T> for T

§

type Output = T

Should always be Self
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · 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.
const: unstable · source§

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

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,