Struct polymesh_api::polymesh::api::nft::NftCallApi
source · pub struct NftCallApi<'api> { /* private fields */ }Implementations§
source§impl<'api> NftCallApi<'api>
impl<'api> NftCallApi<'api>
sourcepub fn create_nft_collection(
&self,
ticker: Ticker,
nft_type: Option<NonFungibleType>,
collection_keys: NFTCollectionKeys
) -> Result<WrappedCall<'api>>
pub fn create_nft_collection( &self, ticker: Ticker, nft_type: Option<NonFungibleType>, collection_keys: NFTCollectionKeys ) -> Result<WrappedCall<'api>>
Cretes a new NFTCollection.
Arguments
origin- contains the secondary key of the caller (i.e. who signed the transaction to execute this function).ticker- the ticker associated to the new collection.nft_type- in case the asset hasn’t been created yet, one will be created with the given type.collection_keys- all mandatory metadata keys that the tokens in the collection must have.
Errors
CollectionAlredyRegistered- if the ticker is already associated to an NFT collection.InvalidAssetType- if the associated asset is not of type NFT.MaxNumberOfKeysExceeded- if the number of metadata keys for the collection is greater than the maximum allowed.UnregisteredMetadataKey- if any of the metadata keys needed for the collection has not been registered.DuplicateMetadataKey- if a duplicate metadata keys has been passed as input.
Permissions
- Asset
sourcepub fn issue_nft(
&self,
ticker: Ticker,
nft_metadata_attributes: Vec<NFTMetadataAttribute>,
portfolio_kind: PortfolioKind
) -> Result<WrappedCall<'api>>
pub fn issue_nft( &self, ticker: Ticker, nft_metadata_attributes: Vec<NFTMetadataAttribute>, portfolio_kind: PortfolioKind ) -> Result<WrappedCall<'api>>
Issues an NFT to the caller.
Arguments
origin- is a signer that has permissions to act as an agent ofticker.ticker- the ticker of the NFT collection.nft_metadata_attributes- all mandatory metadata keys and values for the NFT.
portfolio_kind- the portfolio that will receive the minted nft.
Errors
CollectionNotFound- if the collection associated to the given ticker has not been created.InvalidMetadataAttribute- if the number of attributes is not equal to the number set in the collection or attempting to set a value for a key not definied in the collection.DuplicateMetadataKey- if a duplicate metadata keys has been passed as input.
Permissions
- Asset
- Portfolio
sourcepub fn redeem_nft(
&self,
ticker: Ticker,
nft_id: NFTId,
portfolio_kind: PortfolioKind
) -> Result<WrappedCall<'api>>
pub fn redeem_nft( &self, ticker: Ticker, nft_id: NFTId, portfolio_kind: PortfolioKind ) -> Result<WrappedCall<'api>>
Redeems the given NFT from the caller’s portfolio.
Arguments
origin- is a signer that has permissions to act as an agent ofticker.ticker- the ticker of the NFT collection.nft_id- the id of the NFT to be burned.portfolio_kind- the portfolio that contains the nft.
Errors
CollectionNotFound- if the collection associated to the given ticker has not been created.NFTNotFound- if the given NFT does not exist in the portfolio.
Permissions
- Asset
- Portfolio
Trait Implementations§
source§impl<'api> Clone for NftCallApi<'api>
impl<'api> Clone for NftCallApi<'api>
source§fn clone(&self) -> NftCallApi<'api>
fn clone(&self) -> NftCallApi<'api>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'api> !RefUnwindSafe for NftCallApi<'api>
impl<'api> Send for NftCallApi<'api>
impl<'api> Sync for NftCallApi<'api>
impl<'api> Unpin for NftCallApi<'api>
impl<'api> !UnwindSafe for NftCallApi<'api>
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
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where Self: TryInto<T>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T. Read more§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T.