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>
pub fn create_nft_collection( &self, ticker: Ticker, nft_type: Option<NonFungibleType>, collection_keys: NFTCollectionKeys ) -> Result<WrappedCall>
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>
pub fn issue_nft( &self, ticker: Ticker, nft_metadata_attributes: Vec<NFTMetadataAttribute>, portfolio_kind: PortfolioKind ) -> Result<WrappedCall>
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>
pub fn redeem_nft( &self, ticker: Ticker, nft_id: NFTId, portfolio_kind: PortfolioKind ) -> Result<WrappedCall>
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
sourcepub fn controller_transfer(
&self,
ticker: Ticker,
nfts: NFTs,
source_portfolio: PortfolioId,
callers_portfolio_kind: PortfolioKind
) -> Result<WrappedCall>
pub fn controller_transfer( &self, ticker: Ticker, nfts: NFTs, source_portfolio: PortfolioId, callers_portfolio_kind: PortfolioKind ) -> Result<WrappedCall>
Forces the transfer of NFTs from a given portfolio to 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 [NFTId] of the NFT to be transferred.source_portfolio- the [PortfolioId] that currently holds the NFT.callers_portfolio_kind- the [PortfolioKind] of the caller’s 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> Freeze for NftCallApi<'api>
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
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
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 moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from.source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T.