pub struct SettlementCallApi<'api> { /* private fields */ }Implementations§
Source§impl<'api> SettlementCallApi<'api>
impl<'api> SettlementCallApi<'api>
Sourcepub fn create_venue(
&self,
details: VenueDetails,
signers: BTreeSet<AccountId>,
typ: VenueType,
) -> Result<WrappedCall>
pub fn create_venue( &self, details: VenueDetails, signers: BTreeSet<AccountId>, typ: VenueType, ) -> Result<WrappedCall>
Registers a new venue.
details- Extra details about a venuesigners- Array of signers that are allowed to sign receipts for this venuetyp- Type of venue being created
Sourcepub fn update_venue_details(
&self,
id: VenueId,
details: VenueDetails,
) -> Result<WrappedCall>
pub fn update_venue_details( &self, id: VenueId, details: VenueDetails, ) -> Result<WrappedCall>
Edit a venue’s details.
idspecifies the ID of the venue to edit.detailsspecifies the updated venue details.
Sourcepub fn update_venue_type(
&self,
id: VenueId,
typ: VenueType,
) -> Result<WrappedCall>
pub fn update_venue_type( &self, id: VenueId, typ: VenueType, ) -> Result<WrappedCall>
Edit a venue’s type.
idspecifies the ID of the venue to edit.typespecifies the new type of the venue.
Sourcepub fn affirm_with_receipts(
&self,
id: InstructionId,
receipt_details: Vec<ReceiptDetails<AccountId, MultiSignature, u64>>,
holder_set: BTreeSet<AssetHolder>,
) -> Result<WrappedCall>
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
Sourcepub fn set_venue_filtering(
&self,
asset_id: AssetId,
enabled: bool,
) -> Result<WrappedCall>
pub fn set_venue_filtering( &self, asset_id: AssetId, enabled: bool, ) -> Result<WrappedCall>
Sourcepub fn allow_venues(
&self,
asset_id: AssetId,
venues: Vec<VenueId>,
) -> Result<WrappedCall>
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
Sourcepub fn disallow_venues(
&self,
asset_id: AssetId,
venues: Vec<VenueId>,
) -> Result<WrappedCall>
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
Sourcepub fn update_venue_signers(
&self,
id: VenueId,
signers: BTreeSet<AccountId>,
add_signers: bool,
) -> Result<WrappedCall>
pub fn update_venue_signers( &self, id: VenueId, signers: BTreeSet<AccountId>, add_signers: bool, ) -> Result<WrappedCall>
Edit a venue’s signers.
idspecifies the ID of the venue to edit.signersspecifies the signers to add/remove.add_signersspecifies the update type add/remove of venue where add is true and remove is false.
Sourcepub 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>
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 theweight_limitis 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.
Sourcepub 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>
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.
Sourcepub 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>
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
Sourcepub fn affirm_instruction(
&self,
id: InstructionId,
holder_set: BTreeSet<AssetHolder>,
) -> Result<WrappedCall>
pub fn affirm_instruction( &self, id: InstructionId, holder_set: BTreeSet<AssetHolder>, ) -> Result<WrappedCall>
Sourcepub fn reject_instruction(
&self,
id: InstructionId,
asset_holder: AssetHolder,
) -> Result<WrappedCall>
pub fn reject_instruction( &self, id: InstructionId, asset_holder: AssetHolder, ) -> Result<WrappedCall>
Sourcepub fn execute_scheduled_instruction(
&self,
id: InstructionId,
weight_limit: Weight,
) -> Result<WrappedCall>
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.
Sourcepub 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>
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
Sourcepub fn affirm_instruction_with_count(
&self,
id: InstructionId,
holder_set: BTreeSet<AssetHolder>,
number_of_assets: Option<AffirmationCount>,
) -> Result<WrappedCall>
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
Sourcepub fn reject_instruction_with_count(
&self,
id: InstructionId,
asset_holder: AssetHolder,
number_of_assets: Option<AssetCount>,
) -> Result<WrappedCall>
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
Sourcepub 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>
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.
Sourcepub 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>
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
Sourcepub fn affirm_instruction_as_mediator(
&self,
instruction_id: InstructionId,
expiry: Option<u64>,
) -> Result<WrappedCall>
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).
Sourcepub fn reject_instruction_as_mediator(
&self,
instruction_id: InstructionId,
number_of_assets: Option<AssetCount>,
) -> Result<WrappedCall>
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.
Sourcepub fn lock_instruction(
&self,
inst_id: InstructionId,
weight_limit: Weight,
) -> Result<WrappedCall>
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.
Sourcepub fn set_mandatory_receiver_affirmation(
&self,
requirement: AffirmationRequirement,
) -> Result<WrappedCall>
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.
Sourcepub fn transfer_funds(
&self,
from: Option<AssetHolder>,
to: AssetHolder,
fund: Fund,
) -> Result<WrappedCall>
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):
fromandtoresolve to the same DID. Transfers immediately viabase_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::Accountsources 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
Approvalevent emitted on spend. Use theallowanceRuntime API to query remaining allowance.
§Arguments
origin— Signed origin. Caller must have a registered DID.from— Source.Nonedefaults 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.
Sourcepub fn unlock_instruction(&self, inst_id: InstructionId) -> Result<WrappedCall>
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>
impl<'api> Clone for SettlementCallApi<'api>
Source§fn clone(&self) -> SettlementCallApi<'api>
fn clone(&self) -> SettlementCallApi<'api>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto 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> 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.