Skip to main content

SettlementCallApi

Struct SettlementCallApi 

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

Implementations§

Source§

impl<'api> SettlementCallApi<'api>

Source

pub fn create_venue( &self, details: VenueDetails, signers: BTreeSet<AccountId>, typ: VenueType, ) -> Result<WrappedCall>

Registers a new venue.

  • details - Extra details about a venue
  • signers - Array of signers that are allowed to sign receipts for this venue
  • typ - Type of venue being created
Source

pub fn update_venue_details( &self, id: VenueId, details: VenueDetails, ) -> Result<WrappedCall>

Edit a venue’s details.

  • id specifies the ID of the venue to edit.
  • details specifies the updated venue details.
Source

pub fn update_venue_type( &self, id: VenueId, typ: VenueType, ) -> Result<WrappedCall>

Edit a venue’s type.

  • id specifies the ID of the venue to edit.
  • type specifies the new type of the venue.
Source

pub fn affirm_with_receipts( &self, id: InstructionId, receipt_details: Vec<ReceiptDetails<AccountId, MultiSignature, u64>>, holder_set: BTreeSet<AssetHolder>, ) -> Result<WrappedCall>

Affirms an instruction using receipts for offchain transfers.

§Arguments
  • id - the [InstructionId] of the instruction being affirmed.
  • receipt_details - a vector of [ReceiptDetails], which contain the details about the offchain transfer.
  • holder_set - a vector of [AssetHolder] under the caller’s control and intended for affirmation.
§Permissions
  • Portfolio/Account
Source

pub fn set_venue_filtering( &self, asset_id: AssetId, enabled: bool, ) -> Result<WrappedCall>

Enables or disabled venue filtering for a token.

§Arguments
  • asset_id - AssetId of the token in question.
  • enabled - Boolean that decides if the filtering should be enabled.
§Permissions
  • Asset
Source

pub fn allow_venues( &self, asset_id: AssetId, venues: Vec<VenueId>, ) -> Result<WrappedCall>

Allows additional venues to create instructions involving an asset.

  • asset_id - AssetId of the token in question.
  • venues - Array of venues that are allowed to create instructions for the token in question.
§Permissions
  • Asset
Source

pub fn disallow_venues( &self, asset_id: AssetId, venues: Vec<VenueId>, ) -> Result<WrappedCall>

Revokes permission given to venues for creating instructions involving a particular asset.

  • asset_id - AssetId of the token in question.
  • venues - Array of venues that are no longer allowed to create instructions for the token in question.
§Permissions
  • Asset
Source

pub fn update_venue_signers( &self, id: VenueId, signers: BTreeSet<AccountId>, add_signers: bool, ) -> Result<WrappedCall>

Edit a venue’s signers.

  • id specifies the ID of the venue to edit.
  • signers specifies the signers to add/remove.
  • add_signers specifies the update type add/remove of venue where add is true and remove is false.
Source

pub fn execute_manual_instruction( &self, id: InstructionId, asset_holder: Option<AssetHolder>, fungible_transfers: u32, nfts_transfers: u32, offchain_transfers: u32, weight_limit: Option<Weight>, ) -> Result<WrappedCall>

Manually executes an instruction.

§Arguments
  • id: The [InstructionId] of the instruction to be executed.
  • asset_holder: One of the caller’s [AssetHolder] which is also a counter patry in the instruction. If None, the caller must be the venue creator or a counter party in a [Leg::OffChain].
  • fungible_transfers: The number of fungible legs in the instruction.
  • nfts_transfers: The number of nfts being transferred in the instruction.
  • offchain_transfers: The number of offchain legs in the instruction.
  • weight_limit: An optional maximum [Weight] value to be charged for executing the instruction. If the weight_limit is less than the required amount, the instruction will fail execution.

Note: calling the rpc method get_execute_instruction_info returns an instance of [ExecuteInstructionInfo], which contains the count parameters.

Source

pub fn add_instruction( &self, venue_id: Option<VenueId>, settlement_type: SettlementType<u32>, trade_date: Option<u64>, value_date: Option<u64>, legs: Vec<Leg>, instruction_memo: Option<Memo>, ) -> Result<WrappedCall>

Adds a new instruction.

§Arguments
  • venue_id: The optional [VenueId] of the venue this instruction belongs to.
  • settlement_type: The [SettlementType] specifying when the instruction should be settled.
  • trade_date: Optional date from which people can interact with this instruction.
  • value_date: Optional date after which the instruction should be settled (not enforced).
  • legs: A vector of all [Leg] included in this instruction.
  • memo: An optional [Memo] field for this instruction.
Source

pub fn add_and_affirm_instruction( &self, venue_id: Option<VenueId>, settlement_type: SettlementType<u32>, trade_date: Option<u64>, value_date: Option<u64>, legs: Vec<Leg>, holder_set: BTreeSet<AssetHolder>, instruction_memo: Option<Memo>, ) -> Result<WrappedCall>

Adds and affirms a new instruction.

§Arguments
  • venue_id: The [VenueId] of the venue this instruction belongs to.
  • settlement_type: The [SettlementType] specifying when the instruction should be settled.
  • trade_date: Optional date from which people can interact with this instruction.
  • value_date: Optional date after which the instruction should be settled (not enforced).
  • legs: A vector of all [Leg] included in this instruction.
  • holder_set: A set of [AssetHolder] under the caller’s control and intended for affirmation.
  • memo: An optional [Memo] field for this instruction.
§Permissions
  • Portfolio
Source

pub fn affirm_instruction( &self, id: InstructionId, holder_set: BTreeSet<AssetHolder>, ) -> Result<WrappedCall>

Provide affirmation to an existing instruction.

§Arguments
  • id - the [InstructionId] of the instruction being affirmed.
  • holder_set - a set of [AssetHolder] under the caller’s control and intended for affirmation.
§Permissions
  • Portfolio
Source

pub fn reject_instruction( &self, id: InstructionId, asset_holder: AssetHolder, ) -> Result<WrappedCall>

Rejects an existing instruction.

§Arguments
  • id - the [InstructionId] of the instruction being rejected.
  • asset_holder - the [AssetHolder] that belongs to the instruction and is rejecting it.
§Permissions
  • Portfolio
Source

pub fn execute_scheduled_instruction( &self, id: InstructionId, weight_limit: Weight, ) -> Result<WrappedCall>

Root callable extrinsic, used as an internal call to execute a scheduled settlement instruction.

Source

pub fn affirm_with_receipts_with_count( &self, id: InstructionId, receipt_details: Vec<ReceiptDetails<AccountId, MultiSignature, u64>>, holder_set: BTreeSet<AssetHolder>, number_of_assets: Option<AffirmationCount>, ) -> Result<WrappedCall>

Affirms an instruction using receipts for offchain transfers.

§Arguments
  • id - the [InstructionId] of the instruction being affirmed.
  • receipt_details - a vector of [ReceiptDetails], which contain the details about the offchain transfer.
  • holder_set - a vector of [AssetHolder] under the caller’s control and intended for affirmation.
  • number_of_assets - an optional [AffirmationCount] that will be used for a precise fee estimation before executing the extrinsic.

Note: calling the rpc method get_affirmation_count returns an instance of [AffirmationCount].

§Permissions
  • Portfolio
Source

pub fn affirm_instruction_with_count( &self, id: InstructionId, holder_set: BTreeSet<AssetHolder>, number_of_assets: Option<AffirmationCount>, ) -> Result<WrappedCall>

Provide affirmation to an existing instruction.

§Arguments
  • id - the [InstructionId] of the instruction being affirmed.
  • holder_set - a vector of [AssetHolder] under the caller’s control and intended for affirmation.
  • number_of_assets - an optional [AffirmationCount] that will be used for a precise fee estimation before executing the extrinsic.

Note: calling the rpc method get_affirmation_count returns an instance of [AffirmationCount].

§Permissions
  • Portfolio
Source

pub fn reject_instruction_with_count( &self, id: InstructionId, asset_holder: AssetHolder, number_of_assets: Option<AssetCount>, ) -> Result<WrappedCall>

Rejects an existing instruction.

§Arguments
  • id - the [InstructionId] of the instruction being rejected.
  • asset_holder - the [AssetHolder] that belongs to the instruction and is rejecting it.
  • number_of_assets - an optional [AssetCount] that will be used for a precise fee estimation before executing the extrinsic.

Note: calling the rpc method get_execute_instruction_info returns an instance of [ExecuteInstructionInfo], which contain the asset count.

§Permissions
  • Portfolio
Source

pub fn add_instruction_with_mediators( &self, venue_id: Option<VenueId>, settlement_type: SettlementType<u32>, trade_date: Option<u64>, value_date: Option<u64>, legs: Vec<Leg>, instruction_memo: Option<Memo>, mediators: BTreeSet<IdentityId>, ) -> Result<WrappedCall>

Adds a new instruction with mediators.

§Arguments
  • venue_id: The [VenueId] of the venue this instruction belongs to.
  • settlement_type: The [SettlementType] specifying when the instruction should be settled.
  • trade_date: Optional date from which people can interact with this instruction.
  • value_date: Optional date after which the instruction should be settled (not enforced).
  • legs: A vector of all [Leg] included in this instruction.
  • instruction_memo: An optional [Memo] field for this instruction.
  • mediators: A set of [IdentityId] of all the mandatory mediators for the instruction.
Source

pub fn add_and_affirm_with_mediators( &self, venue_id: Option<VenueId>, settlement_type: SettlementType<u32>, trade_date: Option<u64>, value_date: Option<u64>, legs: Vec<Leg>, holder_set: BTreeSet<AssetHolder>, instruction_memo: Option<Memo>, mediators: BTreeSet<IdentityId>, ) -> Result<WrappedCall>

Adds and affirms a new instruction with mediators.

§Arguments
  • venue_id: The [VenueId] of the venue this instruction belongs to.
  • settlement_type: The [SettlementType] specifying when the instruction should be settled.
  • trade_date: Optional date from which people can interact with this instruction.
  • value_date: Optional date after which the instruction should be settled (not enforced).
  • legs: A vector of all [Leg] included in this instruction.
  • holder_set: A set of [AssetHolder] under the caller’s control and intended for affirmation.
  • instruction_memo: An optional [Memo] field for this instruction.
  • mediators: A set of [IdentityId] of all the mandatory mediators for the instruction.
§Permissions
  • Portfolio
Source

pub fn affirm_instruction_as_mediator( &self, instruction_id: InstructionId, expiry: Option<u64>, ) -> Result<WrappedCall>

Affirms the instruction as a mediator - should only be called by mediators, otherwise it will fail.

§Arguments
  • origin: The secondary key of the sender.
  • instruction_id: The [InstructionId] that will be affirmed by the mediator.
  • expiry: An Optional value for defining when the affirmation will expire (None means it will always be valid).
Source

pub fn reject_instruction_as_mediator( &self, instruction_id: InstructionId, number_of_assets: Option<AssetCount>, ) -> Result<WrappedCall>

Rejects an existing instruction - should only be called by mediators, otherwise it will fail.

§Arguments
  • instruction_id - the [InstructionId] of the instruction being rejected.
  • number_of_assets - an optional [AssetCount] that will be used for a precise fee estimation before executing the extrinsic.

Note: calling the rpc method get_execute_instruction_info returns an instance of [ExecuteInstructionInfo], which contain the asset count.

Source

pub fn lock_instruction( &self, inst_id: InstructionId, weight_limit: Weight, ) -> Result<WrappedCall>

Moves the instruction status to LockedForExecution. This function must be called by a mediator of the instruction and will only suceed if the following conditions are met:

  • All affirmations have been received.
  • Instruction is pending or has failed at least one time.
  • All mediator’s affirmations are still valid.
  • All assets are in the allowed venue list.
  • All senders have the right amount of assets being transferred.
  • All senders and receivers are compliant and have valid CDD claims.
  • All assets’ statistics are still valid.
  • There are no frozen assets.
§Arguments
  • origin - The origin of the call, specifying the caller.
  • inst_id - The [InstructionId] of the instruction to be locked.
  • weight_limit - A maximum [Weight] value to be charged for locking the instruction.
Source

pub fn set_mandatory_receiver_affirmation( &self, requirement: AffirmationRequirement, ) -> Result<WrappedCall>

Sets whether the caller’s identity requires mandatory receiver affirmation for incoming transfers.

When require is true, the caller’s identity must explicitly affirm any incoming asset transfer. When require is false (default), incoming transfers are auto-affirmed.

§Events
  • MandatoryReceiverAffirmationSet - When the mandatory receiver affirmation flag is updated.
Source

pub fn transfer_funds( &self, from: Option<AssetHolder>, to: AssetHolder, fund: Fund, ) -> Result<WrappedCall>

Transfer assets between accounts and portfolios.

Currently supports two modes:

  • Direct (owner, same-identity): from and to resolve to the same DID. Transfers immediately via base_transfer — no settlement instruction, no affirmation.
  • Direct (spender): Caller differs from source owner. Spender-approval mode. Allowance is checked and decremented. Spender mode is only available for AssetHolder::Account sources with fungible funds.

When from is None, defaults to AssetHolder::Account(caller).

§Spender-mode allowance behavior
  • Finite allowance: decremented by transfer amount. Removed when depleted to zero.
  • Unlimited allowance (Balance::MAX): never decremented, no storage write.
  • No Approval event emitted on spend. Use the allowance Runtime API to query remaining allowance.
§Arguments
  • origin — Signed origin. Caller must have a registered DID.
  • from — Source. None defaults to caller’s account. When set to a different account, spender-approval mode activates.
  • to — Destination account or portfolio.
  • fund — Asset and amount (fungible) or NFT IDs (non-fungible), plus optional memo.
Source

pub fn unlock_instruction(&self, inst_id: InstructionId) -> Result<WrappedCall>

Unlocks an instruction that is currently in LockedForExecution status, moving it back to Pending. Only a mediator of the instruction can call this.

After unlocking, the mediator must wait at least [Config::RelockCooldown] before locking the instruction again. This gives other parties time to reject the instruction if they wish to back out.

§Arguments
  • origin - The origin of the call, must be a mediator of the instruction.
  • inst_id - The [InstructionId] of the instruction to unlock.

Trait Implementations§

Source§

impl<'api> Clone for SettlementCallApi<'api>

Source§

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

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

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

Source§

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

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'api> Freeze for SettlementCallApi<'api>

§

impl<'api> !RefUnwindSafe for SettlementCallApi<'api>

§

impl<'api> Send for SettlementCallApi<'api>

§

impl<'api> Sync for SettlementCallApi<'api>

§

impl<'api> Unpin for SettlementCallApi<'api>

§

impl<'api> UnsafeUnpin for SettlementCallApi<'api>

§

impl<'api> !UnwindSafe for SettlementCallApi<'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> JsonSchemaMaybe for T

Source§

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