Cw721Contract

Struct Cw721Contract 

Source
pub struct Cw721Contract<'a, T, C>{
Show 13 fields pub contract_info: Item<'a, ContractInfoResponse>, pub minter: Item<'a, Addr>, pub token_count: Item<'a, u64>, pub operators: Map<'a, (&'a Addr, &'a Addr), Expiration>, pub tokens: IndexedMap<'a, &'a str, TokenInfo<T>, TokenIndexes<'a, T>>, pub base_uri: Item<'a, String>, pub base_ext: Item<'a, String>, pub pre_reveal_uri: Item<'a, String>, pub is_on_reveal: Item<'a, bool>, pub team: Item<'a, Addr>, pub pro: Item<'a, Addr>, pub treas: Item<'a, Addr>, pub free_token_count: Item<'a, u64>, /* private fields */
}

Fields§

§contract_info: Item<'a, ContractInfoResponse>§minter: Item<'a, Addr>§token_count: Item<'a, u64>§operators: Map<'a, (&'a Addr, &'a Addr), Expiration>

Stored as (granter, operator) giving operator full control over granter’s account

§tokens: IndexedMap<'a, &'a str, TokenInfo<T>, TokenIndexes<'a, T>>§base_uri: Item<'a, String>

Extended states

§base_ext: Item<'a, String>§pre_reveal_uri: Item<'a, String>§is_on_reveal: Item<'a, bool>§team: Item<'a, Addr>§pro: Item<'a, Addr>§treas: Item<'a, Addr>§free_token_count: Item<'a, u64>

Implementations§

Source§

impl<'a, T, C> Cw721Contract<'a, T, C>

Source

pub fn instantiate( &self, deps: DepsMut<'_>, _env: Env, _info: MessageInfo, msg: InstantiateMsg, ) -> StdResult<Response<C>>

Source

pub fn execute( &self, deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: ExecuteMsg<T>, ) -> Result<Response<C>, ContractError>

Source§

impl<'a, T, C> Cw721Contract<'a, T, C>

Source

pub fn mint( &self, deps: DepsMut<'_>, _env: Env, info: MessageInfo, msg: MintMsg<T>, ) -> Result<Response<C>, ContractError>

Source§

impl<'a, T, C> Cw721Contract<'a, T, C>

Source

pub fn _transfer_nft( &self, deps: DepsMut<'_>, env: &Env, info: &MessageInfo, recipient: &str, token_id: &str, ) -> Result<TokenInfo<T>, ContractError>

Source

pub fn _update_approvals( &self, deps: DepsMut<'_>, env: &Env, info: &MessageInfo, spender: &str, token_id: &str, add: bool, expires: Option<Expiration>, ) -> Result<TokenInfo<T>, ContractError>

Source

pub fn check_can_approve( &self, deps: Deps<'_>, env: &Env, info: &MessageInfo, token: &TokenInfo<T>, ) -> Result<(), ContractError>

returns true iff the sender can execute approve or reject on the contract

Source§

impl<'a, T, C> Cw721Contract<'a, T, C>

Source

pub fn minter(&self, deps: Deps<'_>) -> StdResult<MinterResponse>

Source

pub fn query( &self, deps: Deps<'_>, env: Env, msg: QueryMsg, ) -> StdResult<Binary>

Source§

impl<'a, T, C> Cw721Contract<'a, T, C>

Source

pub fn token_count(&self, storage: &dyn Storage) -> StdResult<u64>

Source

pub fn increment_tokens(&self, storage: &mut dyn Storage) -> StdResult<u64>

Trait Implementations§

Source§

impl<'a, T, C> Cw721Execute<T, C> for Cw721Contract<'a, T, C>

Source§

type Err = ContractError

Source§

fn transfer_nft( &self, deps: DepsMut<'_>, env: Env, info: MessageInfo, recipient: String, token_id: String, ) -> Result<Response<C>, ContractError>

Source§

fn send_nft( &self, deps: DepsMut<'_>, env: Env, info: MessageInfo, contract: String, token_id: String, msg: Binary, ) -> Result<Response<C>, ContractError>

Source§

fn approve( &self, deps: DepsMut<'_>, env: Env, info: MessageInfo, spender: String, token_id: String, expires: Option<Expiration>, ) -> Result<Response<C>, ContractError>

Source§

fn revoke( &self, deps: DepsMut<'_>, env: Env, info: MessageInfo, spender: String, token_id: String, ) -> Result<Response<C>, ContractError>

Source§

fn approve_all( &self, deps: DepsMut<'_>, env: Env, info: MessageInfo, operator: String, expires: Option<Expiration>, ) -> Result<Response<C>, ContractError>

Source§

fn revoke_all( &self, deps: DepsMut<'_>, _env: Env, info: MessageInfo, operator: String, ) -> Result<Response<C>, ContractError>

Source§

impl<'a, T, C> Cw721Query<T> for Cw721Contract<'a, T, C>

Source§

fn contract_info(&self, deps: Deps<'_>) -> StdResult<ContractInfoResponse>

Source§

fn num_tokens(&self, deps: Deps<'_>) -> StdResult<NumTokensResponse>

Source§

fn nft_info( &self, deps: Deps<'_>, token_id: String, ) -> StdResult<NftInfoResponse<T>>

Source§

fn owner_of( &self, deps: Deps<'_>, env: Env, token_id: String, include_expired: bool, ) -> StdResult<OwnerOfResponse>

Source§

fn all_approvals( &self, deps: Deps<'_>, env: Env, owner: String, include_expired: bool, start_after: Option<String>, limit: Option<u32>, ) -> StdResult<ApprovedForAllResponse>

Source§

fn tokens( &self, deps: Deps<'_>, owner: String, start_after: Option<String>, limit: Option<u32>, ) -> StdResult<TokensResponse>

Source§

fn all_tokens( &self, deps: Deps<'_>, start_after: Option<String>, limit: Option<u32>, ) -> StdResult<TokensResponse>

Source§

fn all_nft_info( &self, deps: Deps<'_>, env: Env, token_id: String, include_expired: bool, ) -> StdResult<AllNftInfoResponse<T>>

Source§

impl<T, C> Default for Cw721Contract<'static, T, C>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a, T, C> Cw721<T, C> for Cw721Contract<'a, T, C>

Auto Trait Implementations§

§

impl<'a, T, C> Freeze for Cw721Contract<'a, T, C>

§

impl<'a, T, C> RefUnwindSafe for Cw721Contract<'a, T, C>

§

impl<'a, T, C> Send for Cw721Contract<'a, T, C>
where C: Send, T: Send,

§

impl<'a, T, C> Sync for Cw721Contract<'a, T, C>
where C: Sync, T: Sync,

§

impl<'a, T, C> Unpin for Cw721Contract<'a, T, C>
where C: Unpin, T: Unpin,

§

impl<'a, T, C> UnwindSafe for Cw721Contract<'a, T, C>
where C: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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

Source§

type Output = T

Should always be Self
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.