Snip721Querier Methods
The Snip721Querier type exposes the following members.
Methods
Name | Description | |
---|---|---|
GetAllNftInfo |
AllNftInfo displays the result of both OwnerOf and NftInfo in a single query.
This is provided for CW-721 compliance, but for more complete information about a token, use NftDossier, which will include
private metadata and view_owner and view_private_metadata approvals if the querier is permitted to view this information.
|
|
GetAllTokens |
AllTokens returns an optionally paginated list of all the token IDs controlled by the contract.
If the contract's token supply is private, only an authenticated minter's address will be allowed to perform this query.
When paginating, supply the last token ID received in a response as the start_after token ID of the next query to continue listing where the previous query stopped.
|
|
GetApprovedForAll |
ApprovedForAll displays all the addresses that have approval to transfer all of the specified owner's tokens.
This is provided to comply with CW-721 specification, but because approvals are private on Secret Network, if the owner's viewing key is not provided,
no approvals will be displayed. For a more complete list of inventory-wide approvals,
the owner should use InventoryApprovals which also includes view_owner and view_private_metadata approvals.
|
|
GetBatchNftDossier |
Displays all the information about multiple tokens that the viewer has permission to see.
This may include the owner, the public metadata, the private metadata, royalty
information, mint run information, whether the token is unwrapped, whether the token is
transferable, and the token and inventory approvals
|
|
GetContractConfig |
ContractConfig returns the configuration values that were selected when the contract was instantiated. See Config for an explanation of the configuration options.
This query is not authenticated.
|
|
GetContractInfo |
ContractInfo returns the contract's name and symbol.
This query is not authenticated.
|
|
GetImplementsNonTransferableTokens |
ImplementsNonTransferableTokens is a SNIP-722 query which indicates whether the contract implements non-transferable tokens.
Because legacy SNIP-721 contracts do not implement this query and do not implement non-transferable tokens, any use of this query should always check for an error response,
and if the response is an error, it can be considered that the contract does not implement non-transferable tokens.
Because message parsing ignores input fields that a contract does not expect, this query should be used before attempting to mint a non-transferable token.
If the message is sent to a SNIP-721 contract that does not implement non-transferable tokens,
the transferable field will just be ignored and the resulting NFT will still be created, but will always be transferable.
|
|
GetImplementsTokenSubtype |
ImplementsTokenSubtype is a SNIP-722 query which indicates whether the contract implements the token_subtype Extension field.
Because legacy SNIP-721 contracts do not implement this query and do not implement token subtypes, any use of this query should always check for an error response,
and if the response is an error, it can be considered that the contract does not implement subtypes.
Because message parsing ignores input fields that a contract does not expect, this query should be used before attempting a message that uses the token_subtype Extension field.
If the message is sent to a SNIP-721 contract that does not implement token_subtype, that field will just be ignored and the resulting NFT will still be created/updated,
but without a token_subtype.
|
|
GetInventoryApprovals |
InventoryApprovals returns whether all the address' tokens have public ownership and/or public display of private metadata,
and lists all the inventory-wide approvals the address has granted. Only the viewing key for this specified address will be accepted.
(This query MUST be authenticated)
|
|
GetIsTransferable |
IsTransferable is a SNIP-722 query that indicates whether the token is transferable.
This query is not authenticated.
|
|
GetIsUnwrapped |
IsUnwrapped indicates whether the token has been unwrapped.
If sealed metadata is not enabled, all tokens are considered to be unwrapped.
This query is not authenticated..
|
|
GetMinters |
Minters returns the list of addresses that are authorized to mint tokens.
This query is not authenticated.
|
|
GetNftDossier |
NftDossier returns all the information about a token that the viewer is permitted to view.
If no viewer is provided, NftDossier will only display the information that has been made public.
The response may include the owner, the public metadata, the private metadata, the reason the private metadata is not viewable,
the royalty information, the mint run information, whether the token is transferable, whether ownership is public,
whether the private metadata is public, and (if the querier is the owner,) the approvals for this token as well as the inventory-wide approvals for the owner.
This implementation will only display a token's royalty recipient addresses if the querier has permission to transfer the token.
SNIP-722 adds a transferable field to the NftDossier response.
SNIP-723 (specification to be written) adds an unwrapped field which is false if private metadata for this token is sealed.
|
|
GetNftInfo |
NftInfo returns the public metadata of a token.
It follows CW-721 specification, which is based on ERC-721 Metadata JSON Schema.
At most, one of the fields token_uri OR extension will be defined.
|
|
GetNumTokens |
NumTokens returns the number of tokens controlled by the contract.
If the contract's token supply is private, only an authenticated minter's address will be allowed to perform this query.
|
|
GetNumTokensOfOwner |
Displays the number of tokens that the querier has permission to see the owner and that belong to the specified address.
|
|
GetOwnerOf |
OwnerOf returns the owner of the specified token if the querier is the owner or has been granted permission to view the owner.
If the querier is the owner, OwnerOf will also display all the addresses that have been given transfer permission.
The transfer approval list is provided as part of CW-721 compliance; however, the token owner is advised to use NftDossier for a more
complete list that includes view_owner and view_private_metadata approvals (which CW-721 is not capable of keeping private).
If no viewer is provided, OwnerOf will only display the owner if ownership is public for this token.
|
|
GetPrivateMetadata |
PrivateMetadata returns the private metadata of a token if the querier is permitted to view it.
It follows CW-721 metadata specification, which is based on ERC-721 Metadata JSON Schema.
At most, one of the fields token_uri OR extension will be defined.
If the metadata is sealed, no one is permitted to view it until it has been unwrapped with Reveal.
If no viewer is provided, PrivateMetadata will only display the private metadata if the private metadata is public for this token.
|
|
GetRegisteredCodeHash |
RegisteredCodeHash will display the code hash of the specified contract if it has registered its receiver interface and will indicate whether the contract implements BatchReceiveNft.
|
|
GetRoyaltyInfo |
If a token_id is provided in the request, RoyaltyInfo returns the royalty information for that token.
This implementation will only display a token's royalty recipient addresses if the querier has permission to transfer the token.
If no token_id is requested, RoyaltyInfo displays the default royalty information for the contract.
This implementation will only display the contract's default royalty recipient addresses if the querier is an authorized minter.
|
|
GetTokenApprovals |
TokenApprovals returns whether the owner and private metadata of a token is public, and lists all the approvals specific to this token.
Only the token's owner may perform TokenApprovals.
(This query MUST be authenticated)
|
|
GetTokens |
Tokens displays an optionally paginated list of all the token IDs that belong to the specified owner.
It will only display the owner's tokens on which the querier has view_owner permission.
If no viewing key is provided, it will only display the owner's tokens that have public ownership.
When paginating, supply the last token ID received in a response as the start_after string of the next query to continue listing where the previous query stopped.
|
|
GetTransactionHistory |
TransactionHistory displays an optionally paginated list of transactions (mint, burn, and transfer) in reverse chronological order that involve the specified address.
(This query MUST be authenticated)
|
|
GetVerifyTransferApproval |
VerifyTransferApproval will verify that the specified address has approval to transfer the entire provided list of tokens.
As explained above, queries may experience a delay in revealing expired approvals, so it is possible that a transfer attempt will still fail
even after being verified by VerifyTransferApproval. If the address does not have transfer approval on all the tokens,
the response will indicate the first token encountered that can not be transferred by the address.
Because the intent of VerifyTransferApproval is to provide contracts a way to know before-hand whether an attempt to transfer tokens will fail,
this implementation will consider any SNIP-722 non-transferable token as unapproved for transfer.
(This query MUST be authenticated)
|