Skip to main content
Version: 23.0.x

Class: Instruction

api/entities/Instruction.Instruction

Represents a settlement Instruction to be executed on a certain Venue

Hierarchy

Properties

id

id: BigNumber

Unique identifier number of the instruction

Defined in

api/entities/Instruction/index.ts:89


uuid

uuid: string

Inherited from

Entity.uuid

Defined in

api/entities/Entity.ts:46

Methods

affirm

affirm(args?, opts?): Promise<GenericPolymeshTransaction<Instruction, Instruction>>

Affirm this instruction (authorize)

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

Parameters

NameType
args?AffirmOrWithdrawInstructionParams
opts?ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<Instruction, Instruction>>


details

details(): Promise<InstructionDetails>

Retrieve information specific to this Instruction

Returns

Promise<InstructionDetails>


executeManually

executeManually(args?, opts?): Promise<GenericPolymeshTransaction<Instruction, Instruction>>

Executes an Instruction either of type SettleManual or a Failed 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

Parameters

NameType
args?ExecuteManualInstructionParams
opts?ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<Instruction, Instruction>>


exists

exists(): Promise<boolean>

Determine whether this Instruction exists on chain (or existed and was pruned)

Returns

Promise<boolean>

Overrides

Entity.exists


getAffirmations

getAffirmations(paginationOpts?): Promise<ResultSet<InstructionAffirmation>>

Retrieve every authorization generated by this Instruction (status and authorizing Identity)

Note

supports pagination

Parameters

NameType
paginationOpts?PaginationOptions

Returns

Promise<ResultSet<InstructionAffirmation>>


getInvolvedPortfolios

getInvolvedPortfolios(args): Promise<(NumberedPortfolio | DefaultPortfolio)[]>

Retrieve all the involved portfolios in this Instruction where the given identity is a custodian of

Parameters

NameType
argsObject
args.didstring

Returns

Promise<(NumberedPortfolio | DefaultPortfolio)[]>


getLegs

getLegs(paginationOpts?): Promise<ResultSet<Leg>>

Retrieve all legs of this Instruction

Note

supports pagination

Parameters

NameType
paginationOpts?PaginationOptions

Returns

Promise<ResultSet<Leg>>


getStatus

getStatus(): Promise<InstructionStatusResult>

Retrieve current status of this Instruction

Note

uses the middlewareV2

Returns

Promise<InstructionStatusResult>


isEqual

isEqual(entity): boolean

Determine whether this Entity is the same as another one

Parameters

NameType
entityEntity<unknown, unknown>

Returns

boolean

Inherited from

Entity.isEqual


isExecuted

isExecuted(): Promise<boolean>

Retrieve whether the Instruction has already been executed and pruned from the chain.

Returns

Promise<boolean>


isPending

isPending(): Promise<boolean>

Retrieve whether the Instruction is still pending on chain

Returns

Promise<boolean>


onStatusChange

onStatusChange(callback): Promise<UnsubCallback>

Retrieve current status of the Instruction. This can be subscribed to know if instruction fails

Note

can be subscribed to

Note

current status as Executed means that the Instruction has been executed/rejected and pruned from the chain.

Parameters

NameType
callbackSubCallback<InstructionStatus>

Returns

Promise<UnsubCallback>


reject

reject(args?, opts?): Promise<GenericPolymeshTransaction<Instruction, Instruction>>

Reject this 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

Parameters

NameType
args?RejectInstructionParams
opts?ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<Instruction, Instruction>>


toHuman

toHuman(): string

Return the Instruction's ID

Returns

string

Overrides

Entity.toHuman


withdraw

withdraw(args?, opts?): Promise<GenericPolymeshTransaction<Instruction, Instruction>>

Withdraw affirmation from this instruction (unauthorize)

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

Parameters

NameType
args?AffirmOrWithdrawInstructionParams
opts?ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<Instruction, Instruction>>


generateUuid

Static generateUuid<Identifiers>(identifiers): string

Generate the Entity's UUID from its identifying properties

Type parameters

Name
Identifiers

Parameters

NameType
identifiersIdentifiers

Returns

string

Inherited from

Entity.generateUuid


unserialize

Static unserialize<Identifiers>(serialized): Identifiers

Unserialize a UUID into its Unique Identifiers

Type parameters

Name
Identifiers

Parameters

NameTypeDescription
serializedstringUUID to unserialize

Returns

Identifiers

Inherited from

Entity.unserialize