pub struct AssetCallApi<'api> { /* private fields */ }Implementations§
Source§impl<'api> AssetCallApi<'api>
impl<'api> AssetCallApi<'api>
Sourcepub fn register_unique_ticker(&self, ticker: Ticker) -> Result<WrappedCall>
pub fn register_unique_ticker(&self, ticker: Ticker) -> Result<WrappedCall>
Registers a unique ticker or extends the validity of an existing ticker.
This function allows the caller to register a new ticker or extend the registration of an existing ticker. The ticker validity does not carry forward when renewing.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.ticker- The ticker to register.
§Events
TickerRegistered- When a ticker is successfully registered.
§Errors
TickerAlreadyRegistered- If the ticker is already registered.TickerTooLong- If the ticker length exceeds the maximum allowed length.InvalidTickerCharacter- If the ticker contains invalid characters.
Sourcepub fn accept_ticker_transfer(&self, auth_id: u64) -> Result<WrappedCall>
pub fn accept_ticker_transfer(&self, auth_id: u64) -> Result<WrappedCall>
Accepts a ticker transfer.
Consumes the authorization auth_id (see pallet_identity::consume_auth).
NB: To reject the transfer, call remove auth function in identity module.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.auth_id- Authorization ID of ticker transfer authorization.
§Events
TickerTransferred- When a ticker is successfully transferred.
§Errors
TickerRegistrationNotFound- If the ticker registration is not found.TickerIsAlreadyLinkedToAnAsset- If the ticker is already linked to an asset.
Sourcepub fn accept_asset_ownership_transfer(
&self,
auth_id: u64,
) -> Result<WrappedCall>
pub fn accept_asset_ownership_transfer( &self, auth_id: u64, ) -> Result<WrappedCall>
Accepts an asset ownership transfer.
Consumes the authorization auth_id (see pallet_identity::consume_auth).
NB: To reject the transfer, call remove auth function in identity module.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.auth_id- Authorization ID of the asset ownership transfer authorization.
§Events
AssetOwnershipTransferred- When a asset ownership is successfully transferred.
§Errors
TickerRegistrationNotFound- If the ticker registration is not found.TickerIsAlreadyLinkedToAnAsset- If the ticker is already linked to an asset.
Sourcepub fn create_asset(
&self,
asset_name: AssetName,
divisible: bool,
asset_type: AssetType,
asset_identifiers: Vec<AssetIdentifier>,
funding_round_name: Option<FundingRoundName>,
) -> Result<WrappedCall>
pub fn create_asset( &self, asset_name: AssetName, divisible: bool, asset_type: AssetType, asset_identifiers: Vec<AssetIdentifier>, funding_round_name: Option<FundingRoundName>, ) -> Result<WrappedCall>
Creates a new asset.
The total supply will initially be zero. To mint tokens, use [Pallet::issue].
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_name- The [AssetName] of the new asset.divisible- Sets [AssetDetails::divisible], wheretruemeans the asset is divisible.asset_type- The [AssetType] of the new asset.asset_identifiers- A vector of [AssetIdentifier].funding_round_name- The name of the funding round ([FundingRoundName]).
§Events
AssetCreated- When a new asset is successfully created.
§Errors
MaxLengthOfAssetNameExceeded- If the asset name length exceeds the maximum allowed length.InvalidCustomAssetTypeId- If the custom asset type ID is invalid.InvalidAssetIdentifier- If any of the asset identifiers are invalid.
Sourcepub fn freeze(&self, asset_id: AssetId) -> Result<WrappedCall>
pub fn freeze(&self, asset_id: AssetId) -> Result<WrappedCall>
Freezes transfers of a given asset.
This function allows the asset issuer or an external agent to freeze transfers of a given asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The asset to freeze.
§Permissions
- Asset
§Events
AssetFrozen- When an asset is successfully frozen.
§Errors
NoSuchAsset- If the asset does not exist.AlreadyFrozen- If the asset is already frozen.
Sourcepub fn unfreeze(&self, asset_id: AssetId) -> Result<WrappedCall>
pub fn unfreeze(&self, asset_id: AssetId) -> Result<WrappedCall>
Unfreezes transfers of a given asset.
This function allows the asset issuer or an external agent to unfreeze transfers of a given asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The asset to unfreeze.
§Permissions
- Asset
§Events
AssetUnfrozen- When an asset is successfully unfrozen.
§Errors
NoSuchAsset- If the asset does not exist.NotFrozen- If the asset is not frozen.
Sourcepub fn rename_asset(
&self,
asset_id: AssetId,
asset_name: AssetName,
) -> Result<WrappedCall>
pub fn rename_asset( &self, asset_id: AssetId, asset_name: AssetName, ) -> Result<WrappedCall>
Updates the [AssetName] associated to an asset.
This function allows the asset issuer or an external agent to update the name of an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] associated to the asset.asset_name- The new [AssetName] that will be associated to the asset.
§Permissions
- Asset
§Events
AssetRenamed- When an asset is successfully renamed.
§Errors
MaxLengthOfAssetNameExceeded- If the asset name length exceeds the maximum allowed length.NoSuchAsset- If the asset does not exist.
Sourcepub fn issue(
&self,
asset_id: AssetId,
amount: u128,
portfolio_kind: PortfolioKind,
) -> Result<WrappedCall>
pub fn issue( &self, asset_id: AssetId, amount: u128, portfolio_kind: PortfolioKind, ) -> Result<WrappedCall>
Issue (i.e mint) new tokens to the caller, which must be an authorized external agent.
This function allows the asset issuer or an external agent to mint new tokens for a given asset.
§Arguments
origin: A signer that has permissions to act as an agent ofticker.asset_id: the [AssetId] associated to the asset.amount: The amount of tokens that will be issued.portfolio_kind: The [PortfolioKind] of the portfolio that will receive the minted tokens.
§Permissions
- Asset
- Portfolio
§Events
AssetBalanceUpdated- When the asset balance is successfully updated.
§Errors
UnexpectedNonFungibleToken- If the asset is a non-fungible token.InvalidGranularity- If the amount to issue does not meet the granularity requirements.TotalSupplyOverflow- If the total supply exceeds the maximum allowed limit.
Sourcepub fn redeem(
&self,
asset_id: AssetId,
value: u128,
portfolio_kind: PortfolioKind,
) -> Result<WrappedCall>
pub fn redeem( &self, asset_id: AssetId, value: u128, portfolio_kind: PortfolioKind, ) -> Result<WrappedCall>
Redeems (i.e burns) existing tokens by reducing the balance of the caller’s portfolio and the total supply of the asset.
This function allows the asset issuer or an external agent to redeem tokens from a given asset.
§Arguments
origin: is a signer that has permissions to act as an agent ofasset_id.asset_id: the [AssetId] associated to the asset.value: amount of tokens to redeem.portfolio_kind: the [PortfolioKind] that will have its balance reduced.
§Permissions
- Asset
- Portfolio
§Events
AssetBalanceUpdated- When the asset balance is successfully updated.
§Errors
UnexpectedNonFungibleToken- If the asset is a non-fungible token.InvalidGranularity- If the value to redeem does not meet the granularity requirements.TotalSupplyOverflow- If the total supply exceeds the maximum allowed limit.
Sourcepub fn make_divisible(&self, asset_id: AssetId) -> Result<WrappedCall>
pub fn make_divisible(&self, asset_id: AssetId) -> Result<WrappedCall>
If the asset associated to asset_id is indivisible, sets [AssetDetails::divisible] to true.
This function allows the asset issuer or an external agent to make an indivisible asset divisible.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] associated to the asset.
§Permissions
- Asset
§Events
DivisibilityChanged- When the divisibility of an asset is successfully changed.
§Errors
NoSuchAsset- If the asset does not exist.UnexpectedNonFungibleToken- If the asset is a non-fungible token.AssetAlreadyDivisible- If the asset is already divisible.
Sourcepub fn add_documents(
&self,
docs: Vec<Document>,
asset_id: AssetId,
) -> Result<WrappedCall>
pub fn add_documents( &self, docs: Vec<Document>, asset_id: AssetId, ) -> Result<WrappedCall>
Add documents for a given asset.
This function allows the asset issuer or an external agent to add documents to an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] associated to the asset.docs- Documents to be attached to the asset.
§Permissions
- Asset
§Events
DocumentAdded- When a document is successfully added to an asset.
§Errors
CounterOverflow- If the document ID counter overflows.
Sourcepub fn remove_documents(
&self,
docs_id: Vec<DocumentId>,
asset_id: AssetId,
) -> Result<WrappedCall>
pub fn remove_documents( &self, docs_id: Vec<DocumentId>, asset_id: AssetId, ) -> Result<WrappedCall>
Remove documents for a given asset.
This function allows the asset issuer or an external agent to remove documents from an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] associated to the asset.docs_id- A vector of all [DocumentId] that will be removed from the asset.
§Permissions
- Asset
§Events
DocumentRemoved- When a document is successfully removed from an asset.
Sourcepub fn set_funding_round(
&self,
asset_id: AssetId,
funding_round_name: FundingRoundName,
) -> Result<WrappedCall>
pub fn set_funding_round( &self, asset_id: AssetId, funding_round_name: FundingRoundName, ) -> Result<WrappedCall>
Sets the name of the current funding round.
This function allows the asset issuer or an external agent to set the name of the current funding round for an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] associated to the asset.funding_round_name- The [FundingRoundName] of the current funding round.
§Permissions
- Asset
§Events
FundingRoundSet- When the funding round name is successfully set.
§Errors
FundingRoundNameMaxLengthExceeded- If the funding round name length exceeds the maximum allowed length.
Sourcepub fn update_identifiers(
&self,
asset_id: AssetId,
asset_identifiers: Vec<AssetIdentifier>,
) -> Result<WrappedCall>
pub fn update_identifiers( &self, asset_id: AssetId, asset_identifiers: Vec<AssetIdentifier>, ) -> Result<WrappedCall>
Updates the asset identifiers associated to the asset.
This function allows the asset issuer or an external agent to update the asset identifiers for an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] associated to the asset.asset_identifiers- A vector of [AssetIdentifier] that will be associated to the asset.
§Permissions
- Asset
§Events
IdentifiersUpdated- When the asset identifiers are successfully updated.
§Errors
InvalidAssetIdentifier- If any of the asset identifiers are invalid.
Sourcepub fn controller_transfer(
&self,
asset_id: AssetId,
value: u128,
from_portfolio: PortfolioId,
) -> Result<WrappedCall>
pub fn controller_transfer( &self, asset_id: AssetId, value: u128, from_portfolio: PortfolioId, ) -> Result<WrappedCall>
Forces a transfer of tokens from from_portfolio to the caller’s default portfolio.
This function allows the asset issuer or an external agent to force a transfer of tokens from one portfolio to another.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] associated to the asset.value- The [Balance] of tokens that will be transferred.from_portfolio- The [PortfolioId] that will have its balance reduced.
§Permissions
- Asset
- Portfolio
§Events
ControllerTransfer- When tokens are successfully transferred.
§Errors
UnexpectedNonFungibleToken- If the asset is a non-fungible token.InvalidGranularity- If the amount to transfer does not meet the granularity requirements.TotalSupplyOverflow- If the total supply exceeds the maximum allowed limit.
Sourcepub fn register_custom_asset_type(&self, ty: Vec<u8>) -> Result<WrappedCall>
pub fn register_custom_asset_type(&self, ty: Vec<u8>) -> Result<WrappedCall>
Registers a custom asset type.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.ty- Contains the string representation of the asset type.
§Events
CustomAssetTypeRegistered- When a new custom asset type is successfully registered.CustomAssetTypeAlreadyRegistered- When the custom asset type is already registered.
§Errors
TooLong- If the custom asset type length exceeds the maximum allowed length.
Sourcepub fn create_asset_with_custom_type(
&self,
asset_name: AssetName,
divisible: bool,
custom_asset_type: Vec<u8>,
asset_identifiers: Vec<AssetIdentifier>,
funding_round_name: Option<FundingRoundName>,
) -> Result<WrappedCall>
pub fn create_asset_with_custom_type( &self, asset_name: AssetName, divisible: bool, custom_asset_type: Vec<u8>, asset_identifiers: Vec<AssetIdentifier>, funding_round_name: Option<FundingRoundName>, ) -> Result<WrappedCall>
Creates a new asset with a new custom asset type.
The total supply will initially be zero. To mint tokens, use [Pallet::issue].
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_name- The [AssetName] of the new asset.divisible- Sets [AssetDetails::divisible], wheretruemeans the asset is divisible.custom_asset_type- The custom asset type of the asset.asset_identifiers- A vector of [AssetIdentifier].funding_round_name- The name of the funding round ([FundingRoundName]).
§Events
AssetCreated- When a new asset is successfully created.CustomAssetTypeRegistered- When a new custom asset type is successfully registered.CustomAssetTypeAlreadyRegistered- When the custom asset type is already registered.
§Errors
MaxLengthOfAssetNameExceeded- If the asset name length exceeds the maximum allowed length.InvalidCustomAssetTypeId- If the custom asset type ID is invalid.InvalidAssetIdentifier- If any of the asset identifiers are invalid.TooLong- If the custom asset type length exceeds the maximum allowed length.
Sourcepub fn set_asset_metadata(
&self,
asset_id: AssetId,
key: AssetMetadataKey,
value: AssetMetadataValue,
detail: Option<AssetMetadataValueDetail<u64>>,
) -> Result<WrappedCall>
pub fn set_asset_metadata( &self, asset_id: AssetId, key: AssetMetadataKey, value: AssetMetadataValue, detail: Option<AssetMetadataValueDetail<u64>>, ) -> Result<WrappedCall>
Set asset metadata value.
This function allows the asset issuer or an external agent to set metadata for an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] associated to the asset.key- The [AssetMetadataKey] associated to the asset.value- The [AssetMetadataValue] of the given metadata key.details- Optional [AssetMetadataValueDetail] (expire, lock status).
§Permissions
- Asset
§Events
SetAssetMetadataValue- When the asset metadata value is successfully set.
§Errors
AssetMetadataKeyIsMissing- If the metadata key is missing.AssetMetadataValueIsLocked- If the metadata value is locked.AssetMetadataValueMaxLengthExceeded- If the metadata value length exceeds the maximum allowed length.
Sourcepub fn set_asset_metadata_details(
&self,
asset_id: AssetId,
key: AssetMetadataKey,
detail: AssetMetadataValueDetail<u64>,
) -> Result<WrappedCall>
pub fn set_asset_metadata_details( &self, asset_id: AssetId, key: AssetMetadataKey, detail: AssetMetadataValueDetail<u64>, ) -> Result<WrappedCall>
Set asset metadata value details (expire, lock status).
This function allows the asset issuer or an external agent to set metadata details for an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] associated to the asset.key- The [AssetMetadataKey] associated to the asset.details- The [AssetMetadataValueDetail] (expire, lock status) that will be associated to the asset.
§Permissions
- Asset
§Events
SetAssetMetadataValueDetails- When the asset metadata value details are successfully set.
§Errors
AssetMetadataKeyIsMissing- If the metadata key is missing.AssetMetadataValueIsLocked- If the metadata value is locked.AssetMetadataValueIsEmpty- If the metadata value is empty.
Sourcepub fn register_and_set_local_asset_metadata(
&self,
asset_id: AssetId,
name: AssetMetadataName,
spec: AssetMetadataSpec,
value: AssetMetadataValue,
detail: Option<AssetMetadataValueDetail<u64>>,
) -> Result<WrappedCall>
pub fn register_and_set_local_asset_metadata( &self, asset_id: AssetId, name: AssetMetadataName, spec: AssetMetadataSpec, value: AssetMetadataValue, detail: Option<AssetMetadataValueDetail<u64>>, ) -> Result<WrappedCall>
Registers and set local asset metadata.
This function allows the asset issuer or an external agent to register and set local metadata for an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] associated to the asset.name- The [AssetMetadataName].spec- The asset metadata specifications ([AssetMetadataSpec]).value- The [AssetMetadataValue] of the given metadata key.details- Optional [AssetMetadataValueDetail] (expire, lock status).
§Permissions
- Asset
§Events
RegisterAssetMetadataLocalType- When the local asset metadata type is successfully registered.SetAssetMetadataValue- When the asset metadata value is successfully set.
§Errors
AssetMetadataLocalKeyAlreadyExists- If the local metadata key already exists.AssetMetadataValueIsLocked- If the metadata value is locked.AssetMetadataValueMaxLengthExceeded- If the metadata value length exceeds the maximum allowed length.
Sourcepub fn register_asset_metadata_local_type(
&self,
asset_id: AssetId,
name: AssetMetadataName,
spec: AssetMetadataSpec,
) -> Result<WrappedCall>
pub fn register_asset_metadata_local_type( &self, asset_id: AssetId, name: AssetMetadataName, spec: AssetMetadataSpec, ) -> Result<WrappedCall>
Registers asset metadata local type.
This function allows the asset issuer or an external agent to register a local metadata type for an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] associated to the asset.name- The [AssetMetadataName].spec- The asset metadata specifications ([AssetMetadataSpec]).
§Permissions
- Asset
§Events
RegisterAssetMetadataLocalType- When the local asset metadata type is successfully registered.
§Errors
AssetMetadataLocalKeyAlreadyExists- If the local metadata key already exists.AssetMetadataNameMaxLengthExceeded- If the metadata name length exceeds the maximum allowed length.AssetMetadataTypeDefMaxLengthExceeded- If the metadata type definition length exceeds the maximum allowed length.
Sourcepub fn register_asset_metadata_global_type(
&self,
name: AssetMetadataName,
spec: AssetMetadataSpec,
) -> Result<WrappedCall>
pub fn register_asset_metadata_global_type( &self, name: AssetMetadataName, spec: AssetMetadataSpec, ) -> Result<WrappedCall>
Registers asset metadata global type.
This function allows the root origin to register a global metadata type.
§Arguments
origin- The root origin.name- The [AssetMetadataName].spec- The asset metadata specifications ([AssetMetadataSpec]).
§Events
RegisterAssetMetadataGlobalType- When the global asset metadata type is successfully registered.
§Errors
AssetMetadataGlobalKeyAlreadyExists- If the global metadata key already exists.AssetMetadataNameMaxLengthExceeded- If the metadata name length exceeds the maximum allowed length.AssetMetadataTypeDefMaxLengthExceeded- If the metadata type definition length exceeds the maximum allowed length.
Sourcepub fn update_asset_type(
&self,
asset_id: AssetId,
asset_type: AssetType,
) -> Result<WrappedCall>
pub fn update_asset_type( &self, asset_id: AssetId, asset_type: AssetType, ) -> Result<WrappedCall>
Updates the type of an asset.
This function allows the asset issuer or an external agent to update the type of an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] associated to the asset.asset_type- The new [AssetType] of the asset.
§Permissions
- Asset
§Events
AssetTypeChanged- When the asset type is successfully changed.
§Errors
NoSuchAsset- If the asset does not exist.InvalidCustomAssetTypeId- If the custom asset type ID is invalid.IncompatibleAssetTypeUpdate- If the new asset type is incompatible with the existing asset type.
Sourcepub fn remove_local_metadata_key(
&self,
asset_id: AssetId,
local_key: AssetMetadataLocalKey,
) -> Result<WrappedCall>
pub fn remove_local_metadata_key( &self, asset_id: AssetId, local_key: AssetMetadataLocalKey, ) -> Result<WrappedCall>
Removes the asset metadata key and value of a local key.
This function allows the asset issuer or an external agent to remove a local metadata key and its value for an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] associated to the local metadata key.local_key- The [AssetMetadataLocalKey] that will be removed.
§Permissions
- Asset
§Events
LocalMetadataKeyDeleted- When the local metadata key is successfully deleted.
§Errors
AssetMetadataKeyIsMissing- If the local metadata key is missing.AssetMetadataValueIsLocked- If the metadata value is locked.AssetMetadataKeyBelongsToNFTCollection- If the metadata key belongs to an NFT collection.
Sourcepub fn remove_metadata_value(
&self,
asset_id: AssetId,
metadata_key: AssetMetadataKey,
) -> Result<WrappedCall>
pub fn remove_metadata_value( &self, asset_id: AssetId, metadata_key: AssetMetadataKey, ) -> Result<WrappedCall>
Removes the asset metadata value of a metadata key.
This function allows the asset issuer or an external agent to remove a metadata value for an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] associated to the metadata key.metadata_key- The [AssetMetadataKey] that will have its value deleted.
§Permissions
- Asset
§Events
MetadataValueDeleted- When the metadata value is successfully deleted.
§Errors
AssetMetadataKeyIsMissing- If the metadata key is missing.AssetMetadataValueIsLocked- If the metadata value is locked.
Sourcepub fn exempt_asset_affirmation(&self, asset_id: AssetId) -> Result<WrappedCall>
pub fn exempt_asset_affirmation(&self, asset_id: AssetId) -> Result<WrappedCall>
Pre-approves the receivement of the asset for all identities.
This function allows the root origin to pre-approve the receivement of an asset for all identities.
§Arguments
origin- The root origin.asset_id- The [AssetId] that will be exempt from affirmation.
§Events
AssetAffirmationExemption- When the asset is successfully exempted from affirmation.
Sourcepub fn remove_asset_affirmation_exemption(
&self,
asset_id: AssetId,
) -> Result<WrappedCall>
pub fn remove_asset_affirmation_exemption( &self, asset_id: AssetId, ) -> Result<WrappedCall>
Removes the pre-approval of the asset for all identities.
This function allows the root origin to remove the pre-approval of an asset for all identities.
§Arguments
origin- The root origin.asset_id- The [AssetId] that will have its exemption removed.
§Events
RemoveAssetAffirmationExemption- When the asset’s affirmation exemption is successfully removed.
Sourcepub fn pre_approve_asset(&self, asset_id: AssetId) -> Result<WrappedCall>
pub fn pre_approve_asset(&self, asset_id: AssetId) -> Result<WrappedCall>
Pre-approves the receivement of an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] that will be exempt from affirmation.
§Permissions
- Asset
§Events
PreApprovedAsset- When the asset is successfully pre-approved for receivement.
Sourcepub fn remove_asset_pre_approval(
&self,
asset_id: AssetId,
) -> Result<WrappedCall>
pub fn remove_asset_pre_approval( &self, asset_id: AssetId, ) -> Result<WrappedCall>
Removes the pre-approval of an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] that will have its exemption removed.
§Permissions
- Asset
§Events
RemovePreApprovedAsset- When the asset’s pre-approval is successfully removed.
Sourcepub fn add_mandatory_mediators(
&self,
asset_id: AssetId,
mediators: BTreeSet<IdentityId>,
) -> Result<WrappedCall>
pub fn add_mandatory_mediators( &self, asset_id: AssetId, mediators: BTreeSet<IdentityId>, ) -> Result<WrappedCall>
Sets all identities in the mediators set as mandatory mediators for any instruction transferring asset_id.
This function allows the asset issuer or an external agent to add mandatory mediators for an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] of the asset that will require the mediators.mediators- A set of [IdentityId] of all the mandatory mediators for the given ticker.
§Permissions
- Asset
§Events
AssetMediatorsAdded- When the mandatory mediators are successfully added.
§Errors
NumberOfAssetMediatorsExceeded- If the number of mandatory mediators exceeds the maximum allowed limit.
Sourcepub fn remove_mandatory_mediators(
&self,
asset_id: AssetId,
mediators: BTreeSet<IdentityId>,
) -> Result<WrappedCall>
pub fn remove_mandatory_mediators( &self, asset_id: AssetId, mediators: BTreeSet<IdentityId>, ) -> Result<WrappedCall>
Removes all identities in the mediators set from the mandatory mediators list for the given asset_id.
This function allows the asset issuer or an external agent to remove mandatory mediators for an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_id- The [AssetId] of the asset that will have mediators removed.mediators- A set of [IdentityId] of all the mediators that will be removed from the mandatory mediators list.
§Permissions
- Asset
§Events
AssetMediatorsRemoved- When the mandatory mediators are successfully removed.
Sourcepub fn link_ticker_to_asset_id(
&self,
ticker: Ticker,
asset_id: AssetId,
) -> Result<WrappedCall>
pub fn link_ticker_to_asset_id( &self, ticker: Ticker, asset_id: AssetId, ) -> Result<WrappedCall>
Establishes a connection between a ticker and an AssetId.
This function allows the asset issuer or an external agent to link a ticker to an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.ticker- The [Ticker] that will be linked to the givenasset_id.asset_id- The [AssetId] that will be connected toticker.
§Permissions
- Asset
§Events
TickerLinkedToAsset- When the ticker is successfully linked to the asset.
§Errors
TickerNotRegisteredToCaller- If the ticker is not registered to the caller.TickerRegistrationExpired- If the ticker registration has expired.TickerRegistrationNotFound- If the ticker registration is not found.TickerIsAlreadyLinkedToAnAsset- If the ticker is already linked to an asset.AssetIsAlreadyLinkedToATicker- If the asset is already linked to a ticker.
Sourcepub fn unlink_ticker_from_asset_id(
&self,
ticker: Ticker,
asset_id: AssetId,
) -> Result<WrappedCall>
pub fn unlink_ticker_from_asset_id( &self, ticker: Ticker, asset_id: AssetId, ) -> Result<WrappedCall>
Removes the link between a ticker and an asset.
This function allows the asset issuer or an external agent to unlink a ticker from an asset.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.ticker- The [Ticker] that will be unlinked from the givenasset_id.asset_id- The [AssetId] that will be unlinked fromticker.
§Permissions
- Asset
§Events
TickerUnlinkedFromAsset- When the ticker is successfully unlinked from the asset.
§Errors
TickerNotRegisteredToCaller- If the ticker is not registered to the caller.TickerRegistrationNotFound- If the ticker registration is not found.TickerIsNotLinkedToTheAsset- If the ticker is not linked to the asset.
Sourcepub fn update_global_metadata_spec(
&self,
asset_metadata_name: AssetMetadataName,
asset_metadata_spec: AssetMetadataSpec,
) -> Result<WrappedCall>
pub fn update_global_metadata_spec( &self, asset_metadata_name: AssetMetadataName, asset_metadata_spec: AssetMetadataSpec, ) -> Result<WrappedCall>
Updates the global metadata specification.
§Arguments
origin- The origin of the call, which can be the primary or secondary key of an identity.asset_metadata_name- The [AssetMetadataName] associated with the global metadata.asset_metadata_spec- The new [AssetMetadataSpec] that will be associated with the global metadata.
§Events
GlobalMetadataSpecUpdated- When the global metadata specification is successfully updated.
§Errors
BadOrigin- If the origin is not authorized.TooLong- If the metadata url or description length exceeds the maximum allowed length.AssetMetadataTypeDefMaxLengthExceeded- If the metadata type definition length exceeds the maximum allowed length.
Trait Implementations§
Source§impl<'api> Clone for AssetCallApi<'api>
impl<'api> Clone for AssetCallApi<'api>
Source§fn clone(&self) -> AssetCallApi<'api>
fn clone(&self) -> AssetCallApi<'api>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'api> Freeze for AssetCallApi<'api>
impl<'api> !RefUnwindSafe for AssetCallApi<'api>
impl<'api> Send for AssetCallApi<'api>
impl<'api> Sync for AssetCallApi<'api>
impl<'api> Unpin for AssetCallApi<'api>
impl<'api> !UnwindSafe for AssetCallApi<'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
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>
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>
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>,
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
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
T.