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>
impl<'a, T> Sg721Contract<'a, T>
pub fn instantiate( &self, deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: InstantiateMsg ) -> Result<Response, ContractError>
pub fn execute( &self, deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: ExecuteMsg<T, Empty> ) -> Result<Response, ContractError>
pub fn update_collection_info( &self, deps: DepsMut<'_>, env: Env, info: MessageInfo, collection_msg: UpdateCollectionInfoMsg<RoyaltyInfoResponse> ) -> Result<Response, ContractError>
sourcepub fn update_start_trading_time(
&self,
deps: DepsMut<'_>,
_env: Env,
info: MessageInfo,
start_time: Option<Timestamp>
) -> Result<Response, ContractError>
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.
pub fn freeze_collection_info( &self, deps: DepsMut<'_>, _env: Env, info: MessageInfo ) -> Result<Response, ContractError>
pub fn mint( &self, deps: DepsMut<'_>, _env: Env, info: MessageInfo, nft_data: NftParams<T> ) -> Result<Response, ContractError>
pub fn query( &self, deps: Deps<'_>, env: Env, msg: QueryMsg ) -> StdResult<Binary>
pub fn query_collection_info( &self, deps: Deps<'_> ) -> StdResult<CollectionInfoResponse>
pub fn migrate( deps: DepsMut<'_>, env: Env, _msg: Empty ) -> Result<Response, ContractError>
Methods from Deref<Target = Cw721Contract<'a, T, StargazeMsgWrapper, Empty, Empty>>§
pub fn instantiate( &self, deps: DepsMut<'_>, _env: Env, _info: MessageInfo, msg: InstantiateMsg ) -> Result<Response<C>, StdError>
pub fn execute( &self, deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: ExecuteMsg<T, E> ) -> Result<Response<C>, ContractError>
pub fn mint( &self, deps: DepsMut<'_>, info: MessageInfo, token_id: String, owner: String, token_uri: Option<String>, extension: T ) -> Result<Response<C>, ContractError>
pub fn _transfer_nft( &self, deps: DepsMut<'_>, env: &Env, info: &MessageInfo, recipient: &str, token_id: &str ) -> Result<TokenInfo<T>, ContractError>
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>
sourcepub fn check_can_approve(
&self,
deps: Deps<'_>,
env: &Env,
info: &MessageInfo,
token: &TokenInfo<T>
) -> Result<(), ContractError>
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
sourcepub fn check_can_send(
&self,
deps: Deps<'_>,
env: &Env,
info: &MessageInfo,
token: &TokenInfo<T>
) -> Result<(), ContractError>
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
pub fn query( &self, deps: Deps<'_>, env: Env, msg: QueryMsg<Q> ) -> Result<Binary, StdError>
pub fn minter(&self, deps: Deps<'_>) -> Result<MinterResponse, StdError>
pub fn token_count(&self, storage: &dyn Storage) -> Result<u64, StdError>
pub fn increment_tokens( &self, storage: &mut dyn Storage ) -> Result<u64, StdError>
pub fn decrement_tokens( &self, storage: &mut dyn Storage ) -> Result<u64, StdError>
Trait Implementations§
source§impl<'a, T> Default for Sg721Contract<'a, T>
impl<'a, T> Default for Sg721Contract<'a, T>
source§impl<'a, T> Deref for Sg721Contract<'a, T>
impl<'a, T> Deref for Sg721Contract<'a, T>
§type Target = Cw721Contract<'a, T, StargazeMsgWrapper, Empty, Empty>
type Target = Cw721Contract<'a, T, StargazeMsgWrapper, Empty, Empty>
The resulting type after dereferencing.
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more