Struct sg721_base::Sg721Contract

source ·
pub struct Sg721Contract<'a, T>{
    pub parent: Cw721Contract<'a, T, StargazeMsgWrapper, Empty, Empty>,
    pub collection_info: Item<'a, CollectionInfo<RoyaltyInfo>>,
    pub frozen_collection_info: Item<'a, bool>,
    pub royalty_updated_at: Item<'a, Timestamp>,
}

Fields§

§parent: Cw721Contract<'a, T, StargazeMsgWrapper, Empty, Empty>§collection_info: Item<'a, CollectionInfo<RoyaltyInfo>>§frozen_collection_info: Item<'a, bool>

Instantiate set to false by the minter, then true by creator to freeze collection info

§royalty_updated_at: Item<'a, Timestamp>

Implementations§

source§

impl<'a, T> Sg721Contract<'a, T>

source

pub fn instantiate( &self, deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: InstantiateMsg ) -> Result<Response, ContractError>

source

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

source

pub fn update_collection_info( &self, deps: DepsMut<'_>, env: Env, info: MessageInfo, collection_msg: UpdateCollectionInfoMsg<RoyaltyInfoResponse> ) -> Result<Response, ContractError>

source

pub fn update_start_trading_time( &self, deps: DepsMut<'_>, _env: Env, info: MessageInfo, start_time: Option<Timestamp> ) -> Result<Response, ContractError>

Called by the minter reply handler after custom validations on trading start time. Minter has start_time, default offset, makes sense to execute from minter.

source

pub fn freeze_collection_info( &self, deps: DepsMut<'_>, _env: Env, info: MessageInfo ) -> Result<Response, ContractError>

source

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

source

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

source

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

source

pub fn migrate( deps: DepsMut<'_>, env: Env, _msg: Empty ) -> Result<Response, ContractError>

Methods from Deref<Target = Cw721Contract<'a, T, StargazeMsgWrapper, Empty, Empty>>§

source

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

source

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

source

pub fn mint( &self, deps: DepsMut<'_>, info: MessageInfo, token_id: String, owner: String, token_uri: Option<String>, extension: T ) -> Result<Response<C>, ContractError>

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

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

returns true iff the sender can transfer ownership of the token

source

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

source

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

source

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

source

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

source

pub fn decrement_tokens( &self, storage: &mut dyn Storage ) -> Result<u64, StdError>

Trait Implementations§

source§

impl<'a, T> Default for Sg721Contract<'a, T>

source§

fn default() -> Self

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

impl<'a, T> Deref for Sg721Contract<'a, T>

§

type Target = Cw721Contract<'a, T, StargazeMsgWrapper, Empty, Empty>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<'a, T> Freeze for Sg721Contract<'a, T>

§

impl<'a, T> RefUnwindSafe for Sg721Contract<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for Sg721Contract<'a, T>
where T: Send,

§

impl<'a, T> Sync for Sg721Contract<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for Sg721Contract<'a, T>
where T: Unpin,

§

impl<'a, T> UnwindSafe for Sg721Contract<'a, T>
where 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<U> As for U

source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. 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

§

type Output = T

Should always be Self
source§

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