pub struct CallApi<'api> { /* private fields */ }

Implementations

Registers a new ticker or extends validity of an existing ticker. NB: Ticker validity does not get carry forward when renewing ticker.

Arguments
  • origin It contains the secondary key of the caller (i.e. who signed the transaction to execute this function).
  • ticker ticker to register.
Permissions
  • Asset

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 It contains the secondary key of the caller (i.e. who signed the transaction to execute this function).
  • auth_id Authorization ID of ticker transfer authorization.
Errors
  • AuthorizationError::BadType if auth_id is not a valid ticket transfer authorization.

This function is used to accept a token ownership transfer. NB: To reject the transfer, call remove auth function in identity module.

Arguments
  • origin It contains the secondary key of the caller (i.e. who signed the transaction to execute this function).
  • auth_id Authorization ID of the token ownership transfer authorization.

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
  • InvalidAssetIdentifier if any of identifiers are invalid.
  • MaxLengthOfAssetNameExceeded if name’s length exceeds T::AssetNameMaxLength.
  • FundingRoundNameMaxLengthExceeded if the name of the funding round is longer that T::FundingRoundNameMaxLength.
  • AssetAlreadyCreated if asset was already created.
  • TickerTooLong if ticker’s length is greater than config.max_ticker_length chain parameter.
  • TickerNotAscii if ticker is not yet registered, and contains non-ascii printable characters (from code 32 to 126) or any character after first occurrence of \0.
Permissions
  • Portfolio

Freezes transfers and minting of a given token.

Arguments
  • origin - the secondary key of the sender.
  • ticker - the ticker of the token.
Errors
  • AlreadyFrozen if ticker is already frozen.
Permissions
  • Asset

Unfreezes transfers and minting of a given token.

Arguments
  • origin - the secondary key of the sender.
  • ticker - the ticker of the frozen token.
Errors
  • NotFrozen if ticker is not frozen yet.
Permissions
  • 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
  • MaxLengthOfAssetNameExceeded if length of name is greater than T::AssetNameMaxLength.
Permissions
  • Asset

Issue, or mint, new tokens to the caller, which must be an authorized external agent.

Arguments
  • origin is a signer that has permissions to act as an agent of ticker.
  • ticker of the token.
  • amount of tokens that get issued.
Permissions
  • Asset
  • Portfolio

Redeems existing tokens by reducing the balance of the caller’s default portfolio and the total supply of the token

Arguments
  • origin is a signer that has permissions to act as an agent of ticker.
  • ticker Ticker of the token.
  • value Amount of tokens to redeem.
Errors
  • Unauthorized If called by someone without the appropriate external agent permissions
  • InvalidGranularity If the amount is not divisible by 10^6 for non-divisible tokens
  • InsufficientPortfolioBalance If the caller’s default portfolio doesn’t have enough free balance
Permissions
  • Asset
  • Portfolio

Makes an indivisible token divisible.

Arguments
  • origin is a signer that has permissions to act as an agent of ticker.
  • ticker Ticker of the token.
Errors
  • AssetAlreadyDivisible if ticker is already divisible.
Permissions
  • Asset

Add documents for a given token.

Arguments
  • origin is a signer that has permissions to act as an agent of ticker.
  • ticker Ticker of the token.
  • docs Documents to be attached to ticker.
Permissions
  • Asset

Remove documents for a given token.

Arguments
  • origin is a signer that has permissions to act as an agent of ticker.
  • ticker Ticker of the token.
  • ids Documents ids to be removed from ticker.
Permissions
  • Asset

Sets the name of the current funding round.

Arguments
  • origin - a signer that has permissions to act as an agent of ticker.
  • ticker - the ticker of the token.
  • name - the desired name of the current funding round.
Errors
  • FundingRoundNameMaxLengthExceeded if length of name is greater than T::FundingRoundNameMaxLength.
Permissions
  • Asset

Updates the asset identifiers.

Arguments
  • origin - a signer that has permissions to act as an agent of ticker.
  • ticker - the ticker of the token.
  • identifiers - the asset identifiers to be updated in the form of a vector of pairs of IdentifierType and AssetIdentifier value.
Errors
  • InvalidAssetIdentifier if identifiers contains any invalid identifier.
Permissions
  • Asset

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
  • NoSuchClassicTicker if this is not a systematically reserved PMC ticker.
  • TickerAlreadyRegistered if the ticker was already registered, e.g., by origin.
  • TickerRegistrationExpired if the ticker’s registration has expired.
  • BadOrigin if not signed.
  • InvalidEthereumSignature if the ethereum_signature is not valid.
  • NotAnOwner if the ethereum account is not the owner of the PMC ticker.

Reserve a Polymath Classic (PMC) ticker. Must be called by root, and assigns the ticker to a systematic DID.

Arguments
  • origin which must be root.
  • classic_ticker_import specification for the PMC ticker.
  • contract_did to reserve the ticker to if classic_ticker_import.is_contract holds.
  • config to use for expiry and ticker length.
Errors
  • AssetAlreadyCreated if classic_ticker_import.ticker was created as an asset.
  • TickerTooLong if the config considers the classic_ticker_import.ticker too long.
  • TickerAlreadyRegistered if classic_ticker_import.ticker was already registered.

Forces a transfer of token from from_portfolio to the caller’s default portfolio.

Arguments
  • origin Must be an external agent with appropriate permissions for a given ticker.
  • ticker Ticker symbol of the asset.
  • value Amount of tokens need to force transfer.
  • from_portfolio From whom portfolio tokens gets transferred.

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
  • origin who called the extrinsic.
  • ty contains the string representation of the asset type.

Utility extrinsic to batch create_asset and register_custom_asset_type.

Set asset metadata value.

Arguments
  • origin is a signer that has permissions to act as an agent of ticker.
  • ticker Ticker of the token.
  • key Metadata key.
  • value Metadata value.
  • details Optional Metadata value details (expire, lock status).
Errors
  • AssetMetadataKeyIsMissing if the metadata type key doesn’t exist.
  • AssetMetadataValueIsLocked if the metadata value for key is locked.
  • AssetMetadataValueMaxLengthExceeded if the metadata value exceeds the maximum length.
Permissions
  • Agent
  • Asset

Set asset metadata value details (expire, lock status).

Arguments
  • origin is a signer that has permissions to act as an agent of ticker.
  • ticker Ticker of the token.
  • key Metadata key.
  • details Metadata value details (expire, lock status).
Errors
  • AssetMetadataKeyIsMissing if the metadata type key doesn’t exist.
  • AssetMetadataValueIsLocked if the metadata value for key is locked.
Permissions
  • Agent
  • Asset

Registers and set local asset metadata.

Arguments
  • origin is a signer that has permissions to act as an agent of ticker.
  • ticker Ticker of the token.
  • name Metadata name.
  • spec Metadata type definition.
  • value Metadata value.
  • details Optional Metadata value details (expire, lock status).
Errors
  • AssetMetadataLocalKeyAlreadyExists if a local metadata type with name already exists for ticker.
  • AssetMetadataNameMaxLengthExceeded if the metadata name exceeds the maximum length.
  • AssetMetadataTypeDefMaxLengthExceeded if the metadata spec type definition exceeds the maximum length.
  • AssetMetadataValueMaxLengthExceeded if the metadata value exceeds the maximum length.
Permissions
  • Agent
  • Asset

Registers asset metadata local type.

Arguments
  • origin is a signer that has permissions to act as an agent of ticker.
  • ticker Ticker of the token.
  • name Metadata name.
  • spec Metadata type definition.
Errors
  • AssetMetadataLocalKeyAlreadyExists if a local metadata type with name already exists for ticker.
  • AssetMetadataNameMaxLengthExceeded if the metadata name exceeds the maximum length.
  • AssetMetadataTypeDefMaxLengthExceeded if the metadata spec type definition exceeds the maximum length.
Permissions
  • Agent
  • Asset

Registers asset metadata global type.

Arguments
  • origin is a signer that has permissions to act as an agent of ticker.
  • name Metadata name.
  • spec Metadata type definition.
Errors
  • AssetMetadataGlobalKeyAlreadyExists if a globa metadata type with name already exists.
  • AssetMetadataNameMaxLengthExceeded if the metadata name exceeds the maximum length.
  • AssetMetadataTypeDefMaxLengthExceeded if the metadata spec type definition exceeds the maximum length.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert from a value of T into an equivalent instance of Option<Self>. Read more

Consume self to return Some equivalent value of Option<T>. Read more

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. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

Should always be Self

Convert from a value of T into an equivalent instance of Self. Read more

Consume self to return an equivalent value of T. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The counterpart to unchecked_from.

Consume self to return an equivalent value of T.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more