pub struct CallApi<'api> { /* private fields */ }
Implementations
sourceimpl<'api> CallApi<'api>
impl<'api> CallApi<'api>
sourcepub fn register_ticker(&self, ticker: Ticker) -> Result<WrappedCall<'api>>
pub fn register_ticker(&self, ticker: Ticker) -> Result<WrappedCall<'api>>
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
sourcepub fn accept_ticker_transfer(&self, auth_id: u64) -> Result<WrappedCall<'api>>
pub fn accept_ticker_transfer(&self, auth_id: u64) -> Result<WrappedCall<'api>>
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
ifauth_id
is not a valid ticket transfer authorization.
sourcepub fn accept_asset_ownership_transfer(
&self,
auth_id: u64
) -> Result<WrappedCall<'api>>
pub fn accept_asset_ownership_transfer(
&self,
auth_id: u64
) -> Result<WrappedCall<'api>>
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.
sourcepub fn create_asset(
&self,
name: AssetName,
ticker: Ticker,
divisible: bool,
asset_type: AssetType,
identifiers: Vec<AssetIdentifier>,
funding_round: Option<FundingRoundName>,
disable_iu: bool
) -> Result<WrappedCall<'api>>
pub fn create_asset(
&self,
name: AssetName,
ticker: Ticker,
divisible: bool,
asset_type: AssetType,
identifiers: Vec<AssetIdentifier>,
funding_round: Option<FundingRoundName>,
disable_iu: bool
) -> Result<WrappedCall<'api>>
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 ofidentifiers
are invalid.MaxLengthOfAssetNameExceeded
ifname
’s length exceedsT::AssetNameMaxLength
.FundingRoundNameMaxLengthExceeded
if the name of the funding round is longer thatT::FundingRoundNameMaxLength
.AssetAlreadyCreated
if asset was already created.TickerTooLong
ifticker
’s length is greater thanconfig.max_ticker_length
chain parameter.TickerNotAscii
ifticker
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
sourcepub fn freeze(&self, ticker: Ticker) -> Result<WrappedCall<'api>>
pub fn freeze(&self, ticker: Ticker) -> Result<WrappedCall<'api>>
Freezes transfers and minting of a given token.
Arguments
origin
- the secondary key of the sender.ticker
- the ticker of the token.
Errors
AlreadyFrozen
ifticker
is already frozen.
Permissions
- Asset
sourcepub fn unfreeze(&self, ticker: Ticker) -> Result<WrappedCall<'api>>
pub fn unfreeze(&self, ticker: Ticker) -> Result<WrappedCall<'api>>
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
ifticker
is not frozen yet.
Permissions
- Asset
sourcepub fn rename_asset(
&self,
ticker: Ticker,
name: AssetName
) -> Result<WrappedCall<'api>>
pub fn rename_asset(
&self,
ticker: Ticker,
name: AssetName
) -> Result<WrappedCall<'api>>
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 ofname
is greater thanT::AssetNameMaxLength
.
Permissions
- Asset
sourcepub fn issue(&self, ticker: Ticker, amount: u128) -> Result<WrappedCall<'api>>
pub fn issue(&self, ticker: Ticker, amount: u128) -> Result<WrappedCall<'api>>
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 ofticker
.ticker
of the token.amount
of tokens that get issued.
Permissions
- Asset
- Portfolio
sourcepub fn redeem(&self, ticker: Ticker, value: u128) -> Result<WrappedCall<'api>>
pub fn redeem(&self, ticker: Ticker, value: u128) -> Result<WrappedCall<'api>>
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 ofticker
.ticker
Ticker of the token.value
Amount of tokens to redeem.
Errors
Unauthorized
If called by someone without the appropriate external agent permissionsInvalidGranularity
If the amount is not divisible by 10^6 for non-divisible tokensInsufficientPortfolioBalance
If the caller’s default portfolio doesn’t have enough free balance
Permissions
- Asset
- Portfolio
sourcepub fn make_divisible(&self, ticker: Ticker) -> Result<WrappedCall<'api>>
pub fn make_divisible(&self, ticker: Ticker) -> Result<WrappedCall<'api>>
Makes an indivisible token divisible.
Arguments
origin
is a signer that has permissions to act as an agent ofticker
.ticker
Ticker of the token.
Errors
AssetAlreadyDivisible
ifticker
is already divisible.
Permissions
- Asset
sourcepub fn add_documents(
&self,
docs: Vec<Document>,
ticker: Ticker
) -> Result<WrappedCall<'api>>
pub fn add_documents(
&self,
docs: Vec<Document>,
ticker: Ticker
) -> Result<WrappedCall<'api>>
Add documents for a given token.
Arguments
origin
is a signer that has permissions to act as an agent ofticker
.ticker
Ticker of the token.docs
Documents to be attached toticker
.
Permissions
- Asset
sourcepub fn remove_documents(
&self,
ids: Vec<DocumentId>,
ticker: Ticker
) -> Result<WrappedCall<'api>>
pub fn remove_documents(
&self,
ids: Vec<DocumentId>,
ticker: Ticker
) -> Result<WrappedCall<'api>>
Remove documents for a given token.
Arguments
origin
is a signer that has permissions to act as an agent ofticker
.ticker
Ticker of the token.ids
Documents ids to be removed fromticker
.
Permissions
- Asset
sourcepub fn set_funding_round(
&self,
ticker: Ticker,
name: FundingRoundName
) -> Result<WrappedCall<'api>>
pub fn set_funding_round(
&self,
ticker: Ticker,
name: FundingRoundName
) -> Result<WrappedCall<'api>>
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
FundingRoundNameMaxLengthExceeded
if length ofname
is greater thanT::FundingRoundNameMaxLength
.
Permissions
- Asset
sourcepub fn update_identifiers(
&self,
ticker: Ticker,
identifiers: Vec<AssetIdentifier>
) -> Result<WrappedCall<'api>>
pub fn update_identifiers(
&self,
ticker: Ticker,
identifiers: Vec<AssetIdentifier>
) -> Result<WrappedCall<'api>>
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 ofIdentifierType
andAssetIdentifier
value.
Errors
InvalidAssetIdentifier
ifidentifiers
contains any invalid identifier.
Permissions
- Asset
sourcepub fn claim_classic_ticker(
&self,
ticker: Ticker,
ethereum_signature: EcdsaSignature
) -> Result<WrappedCall<'api>>
pub fn claim_classic_ticker(
&self,
ticker: Ticker,
ethereum_signature: EcdsaSignature
) -> Result<WrappedCall<'api>>
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., byorigin
.TickerRegistrationExpired
if the ticker’s registration has expired.BadOrigin
if not signed.InvalidEthereumSignature
if theethereum_signature
is not valid.NotAnOwner
if the ethereum account is not the owner of the PMC ticker.
sourcepub fn reserve_classic_ticker(
&self,
classic_ticker_import: ClassicTickerImport,
contract_did: IdentityId,
config: TickerRegistrationConfig<u64>
) -> Result<WrappedCall<'api>>
pub fn reserve_classic_ticker(
&self,
classic_ticker_import: ClassicTickerImport,
contract_did: IdentityId,
config: TickerRegistrationConfig<u64>
) -> Result<WrappedCall<'api>>
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 ifclassic_ticker_import.is_contract
holds.config
to use for expiry and ticker length.
Errors
AssetAlreadyCreated
ifclassic_ticker_import.ticker
was created as an asset.TickerTooLong
if theconfig
considers theclassic_ticker_import.ticker
too long.TickerAlreadyRegistered
ifclassic_ticker_import.ticker
was already registered.
sourcepub fn controller_transfer(
&self,
ticker: Ticker,
value: u128,
from_portfolio: PortfolioId
) -> Result<WrappedCall<'api>>
pub fn controller_transfer(
&self,
ticker: Ticker,
value: u128,
from_portfolio: PortfolioId
) -> Result<WrappedCall<'api>>
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.
sourcepub fn register_custom_asset_type(
&self,
ty: Vec<u8>
) -> Result<WrappedCall<'api>>
pub fn register_custom_asset_type(
&self,
ty: Vec<u8>
) -> Result<WrappedCall<'api>>
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.
sourcepub fn create_asset_with_custom_type(
&self,
name: AssetName,
ticker: Ticker,
divisible: bool,
custom_asset_type: Vec<u8>,
identifiers: Vec<AssetIdentifier>,
funding_round: Option<FundingRoundName>,
disable_iu: bool
) -> Result<WrappedCall<'api>>
pub fn create_asset_with_custom_type(
&self,
name: AssetName,
ticker: Ticker,
divisible: bool,
custom_asset_type: Vec<u8>,
identifiers: Vec<AssetIdentifier>,
funding_round: Option<FundingRoundName>,
disable_iu: bool
) -> Result<WrappedCall<'api>>
Utility extrinsic to batch create_asset
and register_custom_asset_type
.
sourcepub fn set_asset_metadata(
&self,
ticker: Ticker,
key: AssetMetadataKey,
value: AssetMetadataValue,
detail: Option<AssetMetadataValueDetail<u64>>
) -> Result<WrappedCall<'api>>
pub fn set_asset_metadata(
&self,
ticker: Ticker,
key: AssetMetadataKey,
value: AssetMetadataValue,
detail: Option<AssetMetadataValueDetail<u64>>
) -> Result<WrappedCall<'api>>
Set asset metadata value.
Arguments
origin
is a signer that has permissions to act as an agent ofticker
.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 forkey
is locked.AssetMetadataValueMaxLengthExceeded
if the metadata value exceeds the maximum length.
Permissions
- Agent
- Asset
sourcepub fn set_asset_metadata_details(
&self,
ticker: Ticker,
key: AssetMetadataKey,
detail: AssetMetadataValueDetail<u64>
) -> Result<WrappedCall<'api>>
pub fn set_asset_metadata_details(
&self,
ticker: Ticker,
key: AssetMetadataKey,
detail: AssetMetadataValueDetail<u64>
) -> Result<WrappedCall<'api>>
Set asset metadata value details (expire, lock status).
Arguments
origin
is a signer that has permissions to act as an agent ofticker
.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 forkey
is locked.
Permissions
- Agent
- Asset
sourcepub fn register_and_set_local_asset_metadata(
&self,
ticker: Ticker,
name: AssetMetadataName,
spec: AssetMetadataSpec,
value: AssetMetadataValue,
detail: Option<AssetMetadataValueDetail<u64>>
) -> Result<WrappedCall<'api>>
pub fn register_and_set_local_asset_metadata(
&self,
ticker: Ticker,
name: AssetMetadataName,
spec: AssetMetadataSpec,
value: AssetMetadataValue,
detail: Option<AssetMetadataValueDetail<u64>>
) -> Result<WrappedCall<'api>>
Registers and set local asset metadata.
Arguments
origin
is a signer that has permissions to act as an agent ofticker
.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 withname
already exists forticker
.AssetMetadataNameMaxLengthExceeded
if the metadataname
exceeds the maximum length.AssetMetadataTypeDefMaxLengthExceeded
if the metadataspec
type definition exceeds the maximum length.AssetMetadataValueMaxLengthExceeded
if the metadata value exceeds the maximum length.
Permissions
- Agent
- Asset
sourcepub fn register_asset_metadata_local_type(
&self,
ticker: Ticker,
name: AssetMetadataName,
spec: AssetMetadataSpec
) -> Result<WrappedCall<'api>>
pub fn register_asset_metadata_local_type(
&self,
ticker: Ticker,
name: AssetMetadataName,
spec: AssetMetadataSpec
) -> Result<WrappedCall<'api>>
Registers asset metadata local type.
Arguments
origin
is a signer that has permissions to act as an agent ofticker
.ticker
Ticker of the token.name
Metadata name.spec
Metadata type definition.
Errors
AssetMetadataLocalKeyAlreadyExists
if a local metadata type withname
already exists forticker
.AssetMetadataNameMaxLengthExceeded
if the metadataname
exceeds the maximum length.AssetMetadataTypeDefMaxLengthExceeded
if the metadataspec
type definition exceeds the maximum length.
Permissions
- Agent
- Asset
sourcepub fn register_asset_metadata_global_type(
&self,
name: AssetMetadataName,
spec: AssetMetadataSpec
) -> Result<WrappedCall<'api>>
pub fn register_asset_metadata_global_type(
&self,
name: AssetMetadataName,
spec: AssetMetadataSpec
) -> Result<WrappedCall<'api>>
Registers asset metadata global type.
Arguments
origin
is a signer that has permissions to act as an agent ofticker
.name
Metadata name.spec
Metadata type definition.
Errors
AssetMetadataGlobalKeyAlreadyExists
if a globa metadata type withname
already exists.AssetMetadataNameMaxLengthExceeded
if the metadataname
exceeds the maximum length.AssetMetadataTypeDefMaxLengthExceeded
if the metadataspec
type definition exceeds the maximum length.
Trait Implementations
Auto Trait Implementations
impl<'api> !RefUnwindSafe for CallApi<'api>
impl<'api> Send for CallApi<'api>
impl<'api> Sync for CallApi<'api>
impl<'api> Unpin for CallApi<'api>
impl<'api> !UnwindSafe for CallApi<'api>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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>,
Convert from a value of T
into an equivalent instance of Option<Self>
. Read more
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
Consume self to return Some
equivalent value of Option<T>
. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
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
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &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)
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
sourcefn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
Convert from a value of T
into an equivalent instance of Self
. Read more
sourcefn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of T
. Read more
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to unchecked_from
.
sourceimpl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
sourcefn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of T
.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more