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 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>
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
: 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.
Sourcepub fn accept_asset_ownership_transfer(
&self,
auth_id: u64,
) -> Result<WrappedCall>
pub fn accept_asset_ownership_transfer( &self, auth_id: u64, ) -> Result<WrappedCall>
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,
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>
Initializes a new [AssetDetails
], with the initiating account as its owner.
The total supply will initially be zero. To mint tokens, use [Module::issue
].
§Arguments
origin
: contains the secondary key of the caller (i.e. who signed the transaction to execute this function).asset_name
: the [AssetName
] associated to the security token.divisible
: sets [AssetDetails::divisible
], wheretrue
means the token is divisible.asset_type
: the [AssetType
] that represents the security type of the [AssetDetails
].asset_identifiers
: a vector of [AssetIdentifier
].funding_round_name
: the name of the funding round ([FundingRoundName
]).
§Permissions
- Portfolio
Sourcepub fn freeze(&self, asset_id: AssetId) -> Result<WrappedCall>
pub fn freeze(&self, asset_id: AssetId) -> Result<WrappedCall>
Sourcepub fn unfreeze(&self, asset_id: AssetId) -> Result<WrappedCall>
pub fn unfreeze(&self, asset_id: AssetId) -> Result<WrappedCall>
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>
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.
§Arguments
origin
: A signer that has permissions to act as an agent ofticker
.asset_id
: the [AssetId
] associated to the token.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
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 token.
§Arguments
origin
: is a signer that has permissions to act as an agent ofasset_id
.asset_id
: the [AssetId
] associated to the token.value
: amount of tokens to redeem.portfolio_kind
: the [PortfolioKind
] that will have its balance reduced.
§Permissions
- Asset
- Portfolio
Sourcepub fn make_divisible(&self, asset_id: AssetId) -> Result<WrappedCall>
pub fn make_divisible(&self, asset_id: AssetId) -> Result<WrappedCall>
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>
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>
Sourcepub fn set_funding_round(
&self,
asset_id: AssetId,
founding_round_name: FundingRoundName,
) -> Result<WrappedCall>
pub fn set_funding_round( &self, asset_id: AssetId, founding_round_name: FundingRoundName, ) -> Result<WrappedCall>
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>
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 token from from_portfolio
to the caller’s default portfolio.
§Arguments
origin
: a signer that has permissions to act as an agent ofasset_id
.asset_id
: the [AssetId
] associated to the token.value
: the [Balance
] of tokens that will be transferred.from_portfolio
: the [PortfolioId
] that will have its balance reduced.
§Permissions
- Asset
- Portfolio
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.
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,
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>
Initializes a new [AssetDetails
], with the initiating account as its owner.
The total supply will initially be zero. To mint tokens, use [Module::issue
].
Note: Utility extrinsic to batch [Module::create_asset
] and [Module::register_custom_asset_type
].
§Arguments
origin
: contains the secondary key of the caller (i.e. who signed the transaction to execute this function).asset_name
: the [AssetName
] associated to the security token.divisible
: sets [AssetDetails::divisible
], wheretrue
means the token is divisible.custom_asset_type
: the custom asset type of the token.asset_identifiers
: a vector of [AssetIdentifier
].funding_round_name
: the name of the funding round ([FundingRoundName
]).
§Permissions
- Portfolio
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.
§Arguments
origin
: is a signer that has permissions to act as an agent ofasset_id
.asset_id
: the [AssetId
] associated to the token.key
: the [AssetMetadataKey
] associated to the token.value
: the [AssetMetadataValue
] of the given metadata key.details
: optional [AssetMetadataValueDetail
] (expire, lock status).
§Permissions
- Agent
- Asset
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).
§Arguments
origin
: is a signer that has permissions to act as an agent ofasset_id
.asset_id
: the [AssetId
] associated to the token.key
: the [AssetMetadataKey
] associated to the token.details
: the [AssetMetadataValueDetail
] (expire, lock status) that will be associated to the token.
§Permissions
- Agent
- Asset
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.
§Arguments
origin
: is a signer that has permissions to act as an agent ofasset_id
.asset_id
: the [AssetId
] associated to the token.name
: the [AssetMetadataName
].spec
: the asset metadata specifications ([AssetMetadataSpec
]).value
: the [AssetMetadataValue
] of the given metadata key.details
: optional [AssetMetadataValueDetail
] (expire, lock status).
§Permissions
- Agent
- Asset
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>
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.
§Arguments
origin
: is a signer that has permissions to act as an agent ofasset_id
.name
: the [AssetMetadataName
].spec
: the asset metadata specifications ([AssetMetadataSpec
]).
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>
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>
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>
Sourcepub fn exempt_asset_affirmation(&self, asset_id: AssetId) -> Result<WrappedCall>
pub fn exempt_asset_affirmation(&self, asset_id: AssetId) -> Result<WrappedCall>
Sourcepub fn remove_asset_affirmation_exemption(
&self,
asset_id: AssetId,
) -> Result<WrappedCall>
pub fn remove_asset_affirmation_exemption( &self, asset_id: AssetId, ) -> Result<WrappedCall>
Sourcepub fn pre_approve_asset(&self, asset_id: AssetId) -> Result<WrappedCall>
pub fn pre_approve_asset(&self, asset_id: AssetId) -> Result<WrappedCall>
Sourcepub fn remove_asset_pre_approval(
&self,
asset_id: AssetId,
) -> Result<WrappedCall>
pub fn remove_asset_pre_approval( &self, asset_id: AssetId, ) -> Result<WrappedCall>
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 transfering asset_id
.
§Arguments
origin
: The secondary key of the sender.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
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
.
§Arguments
origin
: the secondary key of the sender.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
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>
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>
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
.