Enum polymesh_api::polymesh::types::pallet_asset::Call
source · pub enum Call {
Show 26 variants
register_ticker {
ticker: Ticker,
},
accept_ticker_transfer {
auth_id: u64,
},
accept_asset_ownership_transfer {
auth_id: u64,
},
create_asset {
name: AssetName,
ticker: Ticker,
divisible: bool,
asset_type: AssetType,
identifiers: Vec<AssetIdentifier>,
funding_round: Option<FundingRoundName>,
disable_iu: bool,
},
freeze {
ticker: Ticker,
},
unfreeze {
ticker: Ticker,
},
rename_asset {
ticker: Ticker,
name: AssetName,
},
issue {
ticker: Ticker,
amount: u128,
},
redeem {
ticker: Ticker,
value: u128,
},
make_divisible {
ticker: Ticker,
},
add_documents {
docs: Vec<Document>,
ticker: Ticker,
},
remove_documents {
ids: Vec<DocumentId>,
ticker: Ticker,
},
set_funding_round {
ticker: Ticker,
name: FundingRoundName,
},
update_identifiers {
ticker: Ticker,
identifiers: Vec<AssetIdentifier>,
},
claim_classic_ticker {
ticker: Ticker,
ethereum_signature: EcdsaSignature,
},
reserve_classic_ticker {
classic_ticker_import: ClassicTickerImport,
contract_did: IdentityId,
config: TickerRegistrationConfig<u64>,
},
controller_transfer {
ticker: Ticker,
value: u128,
from_portfolio: PortfolioId,
},
register_custom_asset_type {
ty: Vec<u8>,
},
create_asset_with_custom_type {
name: AssetName,
ticker: Ticker,
divisible: bool,
custom_asset_type: Vec<u8>,
identifiers: Vec<AssetIdentifier>,
funding_round: Option<FundingRoundName>,
disable_iu: bool,
},
set_asset_metadata {
ticker: Ticker,
key: AssetMetadataKey,
value: AssetMetadataValue,
detail: Option<AssetMetadataValueDetail<u64>>,
},
set_asset_metadata_details {
ticker: Ticker,
key: AssetMetadataKey,
detail: AssetMetadataValueDetail<u64>,
},
register_and_set_local_asset_metadata {
ticker: Ticker,
name: AssetMetadataName,
spec: AssetMetadataSpec,
value: AssetMetadataValue,
detail: Option<AssetMetadataValueDetail<u64>>,
},
register_asset_metadata_local_type {
ticker: Ticker,
name: AssetMetadataName,
spec: AssetMetadataSpec,
},
register_asset_metadata_global_type {
name: AssetMetadataName,
spec: AssetMetadataSpec,
},
redeem_from_portfolio {
ticker: Ticker,
value: u128,
portfolio: PortfolioKind,
},
update_asset_type {
ticker: Ticker,
asset_type: AssetType,
},
}Expand description
Dispatchable calls.
Each variant of this enum maps to a dispatchable function from the associated module.
Variants§
register_ticker
Registers a new ticker or extends validity of an existing ticker. NB: Ticker validity does not get carry forward when renewing ticker.
Arguments
originIt contains the secondary key of the caller (i.e. who signed the transaction to execute this function).tickerticker to register.
Permissions
- Asset
accept_ticker_transfer
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
originIt contains the secondary key of the caller (i.e. who signed the transaction to execute this function).auth_idAuthorization ID of ticker transfer authorization.
Errors
AuthorizationError::BadTypeifauth_idis not a valid ticket transfer authorization.
accept_asset_ownership_transfer
This function is used to accept a token ownership transfer. NB: To reject the transfer, call remove auth function in identity module.
Arguments
originIt contains the secondary key of the caller (i.e. who signed the transaction to execute this function).auth_idAuthorization ID of the token ownership transfer authorization.
create_asset
Initializes a new security token, with the initiating account as its owner.
The total supply will initially be zero. To mint tokens, use issue.
Arguments
origin- contains the secondary key of the caller (i.e. who signed the transaction to execute this function).name- the name of the token.ticker- the ticker symbol of the token.divisible- a boolean to identify the divisibility status of the token.asset_type- the asset type.identifiers- a vector of asset identifiers.funding_round- name of the funding round.disable_iu- whether or not investor uniqueness enforcement should be disabled. This cannot be changed after creating the asset.
Errors
InvalidAssetIdentifierif any ofidentifiersare invalid.MaxLengthOfAssetNameExceededifname’s length exceedsT::AssetNameMaxLength.FundingRoundNameMaxLengthExceededif the name of the funding round is longer thatT::FundingRoundNameMaxLength.AssetAlreadyCreatedif asset was already created.TickerTooLongifticker’s length is greater thanconfig.max_ticker_lengthchain parameter.TickerNotAsciiiftickeris not yet registered, and contains non-ascii printable characters (from code 32 to 126) or any character after first occurrence of\0.
Permissions
- Portfolio
freeze
Freezes transfers and minting of a given token.
Arguments
origin- the secondary key of the sender.ticker- the ticker of the token.
Errors
AlreadyFrozeniftickeris already frozen.
Permissions
- Asset
unfreeze
Unfreezes transfers and minting of a given token.
Arguments
origin- the secondary key of the sender.ticker- the ticker of the frozen token.
Errors
NotFrozeniftickeris not frozen yet.
Permissions
- Asset
rename_asset
Renames a given token.
Arguments
origin- the secondary key of the sender.ticker- the ticker of the token.name- the new name of the token.
Errors
MaxLengthOfAssetNameExceededif length ofnameis greater thanT::AssetNameMaxLength.
Permissions
- Asset
issue
Issue, or mint, new tokens to the caller, which must be an authorized external agent.
Arguments
originis a signer that has permissions to act as an agent ofticker.tickerof the token.amountof tokens that get issued.
Permissions
- Asset
- Portfolio
redeem
Redeems existing tokens by reducing the balance of the caller’s default portfolio and the total supply of the token
Arguments
originis a signer that has permissions to act as an agent ofticker.tickerTicker of the token.valueAmount of tokens to redeem.
Errors
UnauthorizedIf called by someone without the appropriate external agent permissionsInvalidGranularityIf the amount is not divisible by 10^6 for non-divisible tokensInsufficientPortfolioBalanceIf the caller’s default portfolio doesn’t have enough free balance
Permissions
- Asset
- Portfolio
make_divisible
Makes an indivisible token divisible.
Arguments
originis a signer that has permissions to act as an agent ofticker.tickerTicker of the token.
Errors
AssetAlreadyDivisibleiftickeris already divisible.
Permissions
- Asset
add_documents
Add documents for a given token.
Arguments
originis a signer that has permissions to act as an agent ofticker.tickerTicker of the token.docsDocuments to be attached toticker.
Permissions
- Asset
remove_documents
Remove documents for a given token.
Arguments
originis a signer that has permissions to act as an agent ofticker.tickerTicker of the token.idsDocuments ids to be removed fromticker.
Permissions
- Asset
set_funding_round
Sets the name of the current funding round.
Arguments
origin- a signer that has permissions to act as an agent ofticker.ticker- the ticker of the token.name- the desired name of the current funding round.
Errors
FundingRoundNameMaxLengthExceededif length ofnameis greater thanT::FundingRoundNameMaxLength.
Permissions
- Asset
update_identifiers
Updates the asset identifiers.
Arguments
origin- a signer that has permissions to act as an agent ofticker.ticker- the ticker of the token.identifiers- the asset identifiers to be updated in the form of a vector of pairs ofIdentifierTypeandAssetIdentifiervalue.
Errors
InvalidAssetIdentifierifidentifierscontains any invalid identifier.
Permissions
- Asset
claim_classic_ticker
Claim a systematically reserved Polymath Classic (PMC) ticker
and transfer it to the origin’s identity.
To verify that the origin is in control of the Ethereum account on the books,
an ethereum_signature containing the origin’s DID as the message
must be provided by that Ethereum account.
Errors
NoSuchClassicTickerif this is not a systematically reserved PMC ticker.TickerAlreadyRegisteredif the ticker was already registered, e.g., byorigin.TickerRegistrationExpiredif the ticker’s registration has expired.BadOriginif not signed.InvalidEthereumSignatureif theethereum_signatureis not valid.NotAnOwnerif the ethereum account is not the owner of the PMC ticker.
reserve_classic_ticker
Fields
classic_ticker_import: ClassicTickerImportcontract_did: IdentityIdconfig: TickerRegistrationConfig<u64>Reserve a Polymath Classic (PMC) ticker. Must be called by root, and assigns the ticker to a systematic DID.
Arguments
originwhich must be root.classic_ticker_importspecification for the PMC ticker.contract_didto reserve the ticker to ifclassic_ticker_import.is_contractholds.configto use for expiry and ticker length.
Errors
AssetAlreadyCreatedifclassic_ticker_import.tickerwas created as an asset.TickerTooLongif theconfigconsiders theclassic_ticker_import.tickertoo long.TickerAlreadyRegisteredifclassic_ticker_import.tickerwas already registered.
controller_transfer
Forces a transfer of token from from_portfolio to the caller’s default portfolio.
Arguments
originMust be an external agent with appropriate permissions for a given ticker.tickerTicker symbol of the asset.valueAmount of tokens need to force transfer.from_portfolioFrom whom portfolio tokens gets transferred.
register_custom_asset_type
Registers a custom asset type.
The provided ty will be bound to an ID in storage.
The ID can then be used in AssetType::Custom.
Should the ty already exist in storage, no second ID is assigned to it.
Arguments
originwho called the extrinsic.tycontains the string representation of the asset type.
create_asset_with_custom_type
Utility extrinsic to batch create_asset and register_custom_asset_type.
set_asset_metadata
Fields
key: AssetMetadataKeyvalue: AssetMetadataValuedetail: Option<AssetMetadataValueDetail<u64>>Set asset metadata value.
Arguments
originis a signer that has permissions to act as an agent ofticker.tickerTicker of the token.keyMetadata key.valueMetadata value.detailsOptional Metadata value details (expire, lock status).
Errors
AssetMetadataKeyIsMissingif the metadata type key doesn’t exist.AssetMetadataValueIsLockedif the metadata value forkeyis locked.AssetMetadataValueMaxLengthExceededif the metadata value exceeds the maximum length.
Permissions
- Agent
- Asset
set_asset_metadata_details
Set asset metadata value details (expire, lock status).
Arguments
originis a signer that has permissions to act as an agent ofticker.tickerTicker of the token.keyMetadata key.detailsMetadata value details (expire, lock status).
Errors
AssetMetadataKeyIsMissingif the metadata type key doesn’t exist.AssetMetadataValueIsLockedif the metadata value forkeyis locked.
Permissions
- Agent
- Asset
register_and_set_local_asset_metadata
Fields
name: AssetMetadataNamespec: AssetMetadataSpecvalue: AssetMetadataValuedetail: Option<AssetMetadataValueDetail<u64>>Registers and set local asset metadata.
Arguments
originis a signer that has permissions to act as an agent ofticker.tickerTicker of the token.nameMetadata name.specMetadata type definition.valueMetadata value.detailsOptional Metadata value details (expire, lock status).
Errors
AssetMetadataLocalKeyAlreadyExistsif a local metadata type withnamealready exists forticker.AssetMetadataNameMaxLengthExceededif the metadatanameexceeds the maximum length.AssetMetadataTypeDefMaxLengthExceededif the metadataspectype definition exceeds the maximum length.AssetMetadataValueMaxLengthExceededif the metadata value exceeds the maximum length.
Permissions
- Agent
- Asset
register_asset_metadata_local_type
Registers asset metadata local type.
Arguments
originis a signer that has permissions to act as an agent ofticker.tickerTicker of the token.nameMetadata name.specMetadata type definition.
Errors
AssetMetadataLocalKeyAlreadyExistsif a local metadata type withnamealready exists forticker.AssetMetadataNameMaxLengthExceededif the metadatanameexceeds the maximum length.AssetMetadataTypeDefMaxLengthExceededif the metadataspectype definition exceeds the maximum length.
Permissions
- Agent
- Asset
register_asset_metadata_global_type
Registers asset metadata global type.
Arguments
originis a signer that has permissions to act as an agent ofticker.nameMetadata name.specMetadata type definition.
Errors
AssetMetadataGlobalKeyAlreadyExistsif a globa metadata type withnamealready exists.AssetMetadataNameMaxLengthExceededif the metadatanameexceeds the maximum length.AssetMetadataTypeDefMaxLengthExceededif the metadataspectype definition exceeds the maximum length.
redeem_from_portfolio
Redeems existing tokens by reducing the balance of the caller’s portfolio and the total supply of the token
Arguments
originis a signer that has permissions to act as an agent ofticker.tickerTicker of the token.valueAmount of tokens to redeem.portfolioFrom whom portfolio tokens gets transferred.
Errors
UnauthorizedIf called by someone without the appropriate external agent permissionsInvalidGranularityIf the amount is not divisible by 10^6 for non-divisible tokensInsufficientPortfolioBalanceIf the caller’sportfoliodoesn’t have enough free balancePortfolioDoesNotExistIf the portfolio doesn’t exist.
Permissions
- Asset
- Portfolio
update_asset_type
Updates the type of an asset.
Arguments
origin- the secondary key of the sender.ticker- the ticker of the token.asset_type- the new type of the token.
Errors
InvalidCustomAssetTypeIdifasset_typeis of type custom and has an invalid type id.
Permissions
- Asset
Implementations§
Trait Implementations§
source§impl Decode for Call
impl Decode for Call
source§impl<'de> Deserialize<'de> for Call
impl<'de> Deserialize<'de> for Call
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Encode for Call
impl Encode for Call
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
source§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
impl EncodeLike<Call> for Call
impl Eq for Call
impl StructuralEq for Call
impl StructuralPartialEq for Call
Auto Trait Implementations§
impl RefUnwindSafe for Call
impl Send for Call
impl Sync for Call
impl Unpin for Call
impl UnwindSafe for Call
Blanket Implementations§
§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>,
source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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. Read more§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read more§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read moresource§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>,
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
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
T.