pub struct NftCallApi<'api> { /* private fields */ }
Implementations§
Source§impl<'api> NftCallApi<'api>
impl<'api> NftCallApi<'api>
Sourcepub fn create_nft_collection(
&self,
asset_id: Option<AssetId>,
nft_type: Option<NonFungibleType>,
collection_keys: NFTCollectionKeys,
) -> Result<WrappedCall>
pub fn create_nft_collection( &self, asset_id: Option<AssetId>, 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).asset_id
- optional [AssetId
] associated to the new collection.None
will create a new asset.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 asset_id 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,
asset_id: AssetId,
nft_metadata_attributes: Vec<NFTMetadataAttribute>,
portfolio_kind: PortfolioKind,
) -> Result<WrappedCall>
pub fn issue_nft( &self, asset_id: AssetId, 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 ofasset_id
.asset_id
- the [AssetId
] 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 asset_id 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,
asset_id: AssetId,
nft_id: NFTId,
portfolio_kind: PortfolioKind,
number_of_keys: Option<u8>,
) -> Result<WrappedCall>
pub fn redeem_nft( &self, asset_id: AssetId, nft_id: NFTId, portfolio_kind: PortfolioKind, number_of_keys: Option<u8>, ) -> Result<WrappedCall>
Redeems the given NFT from the caller’s portfolio.
§Arguments
origin
- is a signer that has permissions to act as an agent ofasset_id
.asset_id
- the [AssetId
] 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 asset_id has not been created.NFTNotFound
- if the given NFT does not exist in the portfolio.
§Permissions
- Asset
- Portfolio
Sourcepub fn controller_transfer(
&self,
nfts: NFTs,
source_portfolio: PortfolioId,
callers_portfolio_kind: PortfolioKind,
) -> Result<WrappedCall>
pub fn controller_transfer( &self, 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 ofasset_id
.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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
Source§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
.