Class: Instruction
api/entities/Instruction.Instruction
Represents a settlement Instruction to be executed on a certain Venue
Hierarchy
-
Entity
<UniqueIdentifiers
,string
>↳
Instruction
Properties
id
• id: BigNumber
Unique identifier number of the instruction
Defined in
api/entities/Instruction/index.ts:102
uuid
• uuid: string
Inherited from
Defined in
Methods
affirm
▸ affirm(args?
, opts?
): Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Affirm this instruction (authorize)
Parameters
Name | Type |
---|---|
args? | AffirmInstructionParams |
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Note
this method is of type OptionalArgsProcedureMethod, which means you can call affirm.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/entities/Instruction/index.ts:560
affirmAsMediator
▸ affirmAsMediator(args?
, opts?
): Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Affirm this instruction as a mediator (authorize)
Parameters
Name | Type |
---|---|
args? | AffirmAsMediatorParams |
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Note
this method is of type OptionalArgsProcedureMethod, which means you can call affirmAsMediator.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/entities/Instruction/index.ts:594
details
▸ details(): Promise
<InstructionDetails
>
Retrieve information specific to this Instruction
Returns
Promise
<InstructionDetails
>
Defined in
api/entities/Instruction/index.ts:299
executeManually
▸ executeManually(args?
, opts?
): Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Executes an Instruction either of type SettleManual
or a Failed
instruction
Parameters
Name | Type |
---|---|
args? | ExecuteManualInstructionParams |
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Note
this method is of type OptionalArgsProcedureMethod, which means you can call executeManually.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/entities/Instruction/index.ts:614
exists
▸ exists(): Promise
<boolean
>
Determine whether this Instruction exists on chain (or existed and was pruned)
Returns
Promise
<boolean
>
Overrides
Defined in
api/entities/Instruction/index.ts:281
generateOffChainAffirmationReceipt
▸ generateOffChainAffirmationReceipt(args
): Promise
<OffChainAffirmationReceipt
>
Generate an offchain affirmation receipt for a specific leg and UID
Parameters
Name | Type | Description |
---|---|---|
args | Object | - |
args.legId | BigNumber | index of the offchain leg in this instruction |
args.metadata? | string | (optional) metadata to be associated with the receipt |
args.signer? | string | Account | (optional) Signer to be used to generate receipt signature. Defaults to signing Account associated with the SDK |
args.signerKeyRingType? | SignerKeyRingType | (optional) keyring type of the signer. Defaults to 'Sr25519' |
args.uid | BigNumber | UID of the receipt |
Returns
Promise
<OffChainAffirmationReceipt
>
Defined in
api/entities/Instruction/index.ts:826
getAffirmations
▸ getAffirmations(paginationOpts?
): Promise
<ResultSet
<InstructionAffirmation
>>
Retrieve every authorization generated by this Instruction (status and authorizing Identity)
Parameters
Name | Type |
---|---|
paginationOpts? | PaginationOptions |
Returns
Promise
<ResultSet
<InstructionAffirmation
>>
Note
supports pagination
Defined in
api/entities/Instruction/index.ts:351
getInvolvedPortfolios
▸ getInvolvedPortfolios(args
): Promise
<(NumberedPortfolio
| DefaultPortfolio
)[]>
Retrieve all the involved portfolios in this Instruction where the given identity is a custodian of
Parameters
Name | Type |
---|---|
args | Object |
args.did | string |
Returns
Promise
<(NumberedPortfolio
| DefaultPortfolio
)[]>
Defined in
api/entities/Instruction/index.ts:664
getLegs
▸ getLegs(paginationOpts?
): Promise
<ResultSet
<Leg
>>
Retrieve all legs of this Instruction
Parameters
Name | Type |
---|---|
paginationOpts? | PaginationOptions |
Returns
Note
supports pagination
Defined in
api/entities/Instruction/index.ts:397
getMediators
▸ getMediators(): Promise
<MediatorAffirmation
[]>
Returns the mediators for the Instruction, along with their affirmation status
Returns
Promise
<MediatorAffirmation
[]>
Defined in
api/entities/Instruction/index.ts:711
getOffChainAffirmationForLeg
▸ getOffChainAffirmationForLeg(args
): Promise
<AffirmationStatus
>
Returns affirmation status for a specific offchain leg in this Instruction
Parameters
Name | Type | Description |
---|---|---|
args | Object | - |
args.legId | BigNumber | index of the leg whose affirmation status is to be fetched |
Returns
Promise
<AffirmationStatus
>
Defined in
api/entities/Instruction/index.ts:775
getOffChainAffirmations
▸ getOffChainAffirmations(): Promise
<OffChainAffirmation
[]>
Returns affirmation statuses for offchain legs in this Instruction
Returns
Promise
<OffChainAffirmation
[]>
Defined in
api/entities/Instruction/index.ts:740
getStatus
▸ getStatus(): Promise
<InstructionStatusResult
>
Retrieve current status of this Instruction
Returns
Promise
<InstructionStatusResult
>
Note
uses the middlewareV2
Defined in
api/entities/Instruction/index.ts:497
isEqual
▸ isEqual(entity
): boolean
Determine whether this Entity is the same as another one
Parameters
Name | Type |
---|---|
entity | Entity <unknown , unknown > |
Returns
boolean
Inherited from
Defined in
isExecuted
▸ isExecuted(): Promise
<boolean
>
Retrieve whether the Instruction has already been executed and pruned from the chain.
Returns
Promise
<boolean
>
Defined in
api/entities/Instruction/index.ts:193
isPending
▸ isPending(): Promise
<boolean
>
Retrieve whether the Instruction is still pending on chain
Returns
Promise
<boolean
>
Defined in
api/entities/Instruction/index.ts:222
onStatusChange
▸ onStatusChange(callback
): Promise
<UnsubCallback
>
Retrieve current status of the Instruction. This can be subscribed to know if instruction fails
Parameters
Name | Type |
---|---|
callback | SubCallback <InstructionStatus > |
Returns
Promise
<UnsubCallback
>
Note
can be subscribed to, if connected to node using a web socket
Note
current status as Executed
means that the Instruction has been executed/rejected and pruned from
the chain.
Defined in
api/entities/Instruction/index.ts:247
reject
▸ reject(args?
, opts?
): Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Reject this instruction
Parameters
Name | Type |
---|---|
args? | RejectInstructionParams |
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Note
reject on SettleOnAffirmation
will execute the settlement and it will fail immediately.
Note
reject on SettleOnBlock
behaves just like unauthorize
Note
reject on SettleManual
behaves just like unauthorize
Note
this method is of type OptionalArgsProcedureMethod, which means you can call reject.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/entities/Instruction/index.ts:550
rejectAsMediator
▸ rejectAsMediator(opts?
): Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Reject this instruction as a mediator
Parameters
Name | Type |
---|---|
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Note
reject on SettleOnAffirmation
will execute the settlement and it will fail immediately.
Note
reject on SettleOnBlock
behaves just like unauthorize
Note
reject on SettleManual
behaves just like unauthorize
Note
this method is of type NoArgsProcedureMethod, which means you can call rejectAsMediator.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/entities/Instruction/index.ts:584
toHuman
▸ toHuman(): string
Return the Instruction's ID
Returns
string
Overrides
Defined in
api/entities/Instruction/index.ts:657
withdraw
▸ withdraw(args?
, opts?
): Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Withdraw affirmation from this instruction (unauthorize)
Parameters
Name | Type |
---|---|
args? | WithdrawInstructionParams |
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Note
this method is of type OptionalArgsProcedureMethod, which means you can call withdraw.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/entities/Instruction/index.ts:570
withdrawAsMediator
▸ withdrawAsMediator(opts?
): Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Withdraw affirmation from this instruction as a mediator (unauthorize)
Parameters
Name | Type |
---|---|
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Note
this method is of type NoArgsProcedureMethod, which means you can call withdrawAsMediator.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/entities/Instruction/index.ts:604
generateUuid
▸ Static
generateUuid<Identifiers
>(identifiers
): string
Generate the Entity's UUID from its identifying properties
Type parameters
Name |
---|
Identifiers |
Parameters
Name | Type |
---|---|
identifiers | Identifiers |
Returns
string
Inherited from
Defined in
unserialize
▸ Static
unserialize<Identifiers
>(serialized
): Identifiers
Unserialize a UUID into its Unique Identifiers
Type parameters
Name |
---|
Identifiers |
Parameters
Name | Type | Description |
---|---|---|
serialized | string | UUID to unserialize |
Returns
Identifiers