Struct AssetCallApi

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

Implementations§

Source§

impl<'api> AssetCallApi<'api>

Source

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
Source

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.
Source

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.
Source

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], where true 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
Source

pub fn freeze(&self, asset_id: AssetId) -> Result<WrappedCall>

Freezes transfers of a given token.

§Arguments
  • origin: the secondary key of the sender.
  • asset_id: the [AssetId] associated to the token.
§Permissions
  • Asset
Source

pub fn unfreeze(&self, asset_id: AssetId) -> Result<WrappedCall>

Unfreezes transfers of a given token.

§Arguments
  • origin: the secondary key of the sender.
  • asset_id: the [AssetId] associated to the token.
§Permissions
  • Asset
Source

pub fn rename_asset( &self, asset_id: AssetId, asset_name: AssetName, ) -> Result<WrappedCall>

Updates the [AssetName] associated to a security token.

§Arguments
  • origin: the secondary key of the sender.
  • asset_id: the [AssetId] associated to the token.
  • asset_name: the [AssetName] that will be associated to the token.
§Permissions
  • Asset
Source

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 of ticker.
  • 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
Source

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 of asset_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
Source

pub fn make_divisible(&self, asset_id: AssetId) -> Result<WrappedCall>

If the token associated to asset_id is indivisible, sets [AssetDetails::divisible] to true.

§Arguments
  • origin: is a signer that has permissions to act as an agent of ticker.
  • asset_id: the [AssetId] associated to the token.
§Permissions
  • Asset
Source

pub fn add_documents( &self, docs: Vec<Document>, asset_id: AssetId, ) -> Result<WrappedCall>

Add documents for a given token.

§Arguments
  • origin: is a signer that has permissions to act as an agent of asset_id.
  • asset_id: the [AssetId] associated to the token.
  • docs: documents to be attached to the token.
§Permissions
  • Asset
Source

pub fn remove_documents( &self, docs_id: Vec<DocumentId>, asset_id: AssetId, ) -> Result<WrappedCall>

Remove documents for a given token.

§Arguments
  • origin: is a signer that has permissions to act as an agent of asset_id.
  • asset_id: the [AssetId] associated to the token.
  • docs_id: a vector of all [DocumentId] that will be removed from the token.
§Permissions
  • Asset
Source

pub fn set_funding_round( &self, asset_id: AssetId, founding_round_name: FundingRoundName, ) -> Result<WrappedCall>

Sets the name of the current funding round.

§Arguments
  • origin: a signer that has permissions to act as an agent of asset_id.
  • asset_id: the [AssetId] associated to the token.
  • founding_round_name: the [FoundingRoundName] of the current funding round.
§Permissions
  • Asset
Source

pub fn update_identifiers( &self, asset_id: AssetId, asset_identifiers: Vec<AssetIdentifier>, ) -> Result<WrappedCall>

Updates the asset identifiers associated to the token.

§Arguments
  • origin: a signer that has permissions to act as an agent of asset_id.
  • asset_id: the [AssetId] associated to the token.
  • asset_identifiers: a vector of [AssetIdentifier] that will be associated to the token.
§Permissions
  • Asset
Source

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 of asset_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
Source

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.
Source

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], where true 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
Source

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 of asset_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
Source

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 of asset_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
Source

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 of asset_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
Source

pub fn register_asset_metadata_local_type( &self, asset_id: AssetId, name: AssetMetadataName, spec: AssetMetadataSpec, ) -> Result<WrappedCall>

Registers asset metadata local type.

§Arguments
  • origin: is a signer that has permissions to act as an agent of asset_id.
  • asset_id: the [AssetId] associated to the token.
  • name: the [AssetMetadataName].
  • spec: the asset metadata specifications ([AssetMetadataSpec]).
§Permissions
  • Agent
  • Asset
Source

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 of asset_id.
  • name: the [AssetMetadataName].
  • spec: the asset metadata specifications ([AssetMetadataSpec]).
Source

pub fn update_asset_type( &self, asset_id: AssetId, asset_type: AssetType, ) -> Result<WrappedCall>

Updates the type of an asset.

§Arguments
  • origin: it contains the secondary key of the sender
  • asset_id: the [AssetId] associated to the token.
  • asset_type: the new [AssetType] of the token.
§Permissions
  • Asset
Source

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.

§Arguments
  • origin: the secondary key of the sender.
  • asset_id: the [AssetId] associated to the local metadata key.
  • local_key: the [AssetMetadataLocalKey] that will be removed.
§Permissions
  • Asset
Source

pub fn remove_metadata_value( &self, asset_id: AssetId, metadata_key: AssetMetadataKey, ) -> Result<WrappedCall>

Removes the asset metadata value of a metadata key.

§Arguments
  • origin: the secondary key of the sender.
  • asset_id: the [AssetId] associated to the metadata key.
  • metadata_key: the [AssetMetadataKey] that will have its value deleted.
§Permissions
  • Asset
Source

pub fn exempt_asset_affirmation(&self, asset_id: AssetId) -> Result<WrappedCall>

Pre-approves the receivement of the asset for all identities.

§Arguments
  • origin: the secondary key of the sender.
  • asset_id: the [AssetId] that will be exempt from affirmation.
§Permissions
  • Root
Source

pub fn remove_asset_affirmation_exemption( &self, asset_id: AssetId, ) -> Result<WrappedCall>

Removes the pre-approval of the asset for all identities.

§Arguments
  • origin: the secondary key of the sender.
  • asset_id: the [AssetId] that will have its exemption removed.
§Permissions
  • Root
Source

pub fn pre_approve_asset(&self, asset_id: AssetId) -> Result<WrappedCall>

Pre-approves the receivement of an asset.

§Arguments
  • origin: the secondary key of the sender.
  • asset_id: the [AssetId] that will be exempt from affirmation.
§Permissions
  • Asset
Source

pub fn remove_asset_pre_approval( &self, asset_id: AssetId, ) -> Result<WrappedCall>

Removes the pre approval of an asset.

§Arguments
  • origin - the secondary key of the sender.
  • asset_id: the [AssetId] that will have its exemption removed.
§Permissions
  • Asset
Source

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
Source

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

Establishes a connection between a ticker and an AssetId.

§Arguments
  • origin: the secondary key of the sender.
  • ticker: the [Ticker] that will be linked to the given asset_id.
  • asset_id: the [AssetId] that will be connected to ticker.
§Permissions
  • Asset

Removes the link between a ticker and an asset.

§Arguments
  • origin: the secondary key of the sender.
  • ticker: the [Ticker] that will be unlinked from the given asset_id.
  • asset_id: the [AssetId] that will be unlink from ticker.
§Permissions
  • Asset

Trait Implementations§

Source§

impl<'api> Clone for AssetCallApi<'api>

Source§

fn clone(&self) -> AssetCallApi<'api>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'api> From<&'api Api> for AssetCallApi<'api>

Source§

fn from(api: &'api Api) -> Self

Converts to this type from the input type.

Auto 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CheckedConversion for T

Source§

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
Source§

fn checked_into<T>(self) -> Option<T>
where Self: TryInto<T>,

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<Src, Dest> IntoTuple<Dest> for Src
where Dest: FromTuple<Src>,

Source§

fn into_tuple(self) -> Dest

Source§

impl<T, Outer> IsWrappedBy<Outer> for T
where Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

Source§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

Source§

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatedConversion for T

Source§

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
Source§

fn saturated_into<T>(self) -> T
where Self: UniqueSaturatedInto<T>,

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

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> UncheckedInto<T> for S
where T: UncheckedFrom<S>,

Source§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
Source§

impl<T, S> UniqueSaturatedInto<T> for S
where T: Bounded, S: TryInto<T>,

Source§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> JsonSchemaMaybe for T

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSendSync for T