-
Notifications
You must be signed in to change notification settings - Fork 11
api.entities.Instruction.Instruction
api/entities/Instruction.Instruction
Represents a settlement Instruction to be executed on a certain Venue
-
Entity
<UniqueIdentifiers
,string
>↳
Instruction
- affirm
- affirmAsMediator
- details
- executeManually
- exists
- generateOffChainAffirmationReceipt
- getAffirmations
- getInvolvedPortfolios
- getLegs
- getMediators
- getOffChainAffirmationForLeg
- getOffChainAffirmations
- getStatus
- isEqual
- isExecuted
- isPending
- onStatusChange
- reject
- rejectAsMediator
- toHuman
- withdraw
- withdrawAsMediator
- generateUuid
- unserialize
• id: BigNumber
Unique identifier number of the instruction
api/entities/Instruction/index.ts:125
• uuid: string
▸ affirm(args?
, opts?
): Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Affirm this instruction (authorize)
Name | Type |
---|---|
args? |
AffirmInstructionParams |
opts? |
ProcedureOpts |
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
api/entities/Instruction/index.ts:807
▸ affirmAsMediator(args?
, opts?
): Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Affirm this instruction as a mediator (authorize)
Name | Type |
---|---|
args? |
AffirmAsMediatorParams |
opts? |
ProcedureOpts |
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
api/entities/Instruction/index.ts:841
▸ details(): Promise
<InstructionDetails
>
Retrieve information specific to this Instruction
Promise
<InstructionDetails
>
Note
uses middleware (if available) to retrieve information, otherwise directly queries from the chain
Throws
if
- instruction does not exists
- instruction is not yet processed by the middleware (when querying from middleware)
- instruction is executed/rejected and was pruned from chain (when querying from chain)
api/entities/Instruction/index.ts:463
▸ executeManually(args?
, opts?
): Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Executes an Instruction either of type SettleManual
or a Failed
instruction
Name | Type |
---|---|
args? |
ExecuteManualInstructionParams |
opts? |
ProcedureOpts |
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
api/entities/Instruction/index.ts:861
▸ exists(): Promise
<boolean
>
Determine whether this Instruction exists on chain (or existed and was pruned)
Promise
<boolean
>
api/entities/Instruction/index.ts:304
▸ generateOffChainAffirmationReceipt(args
): Promise
<OffChainAffirmationReceipt
>
Generate an offchain affirmation receipt for a specific leg and UID
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 |
Promise
<OffChainAffirmationReceipt
>
api/entities/Instruction/index.ts:1191
▸ getAffirmations(paginationOpts?
): Promise
<ResultSet
<InstructionAffirmation
>>
Retrieve every authorization generated by this Instruction (status and authorizing Identity)
Name | Type |
---|---|
paginationOpts? |
PaginationOptions | MiddlewarePaginationOptions
|
Promise
<ResultSet
<InstructionAffirmation
>>
Note
supports pagination.
Note
uses middleware (if available) to retrieve information, otherwise directly queries from the chain
Throws
if
- instruction does not exists
- instruction is executed/rejected and was pruned from chain (when querying from chain)
api/entities/Instruction/index.ts:499
▸ getInvolvedPortfolios(args
): Promise
<(NumberedPortfolio
| DefaultPortfolio
)[]>
Retrieve all the involved portfolios in this Instruction where the given identity is a custodian of
Name | Type |
---|---|
args |
Object |
args.did |
string |
Promise
<(NumberedPortfolio
| DefaultPortfolio
)[]>
api/entities/Instruction/index.ts:912
▸ getLegs(paginationOpts?
): Promise
<ResultSet
<Leg
>>
Retrieve all legs of this Instruction
Name | Type |
---|---|
paginationOpts? |
PaginationOptions | MiddlewarePaginationOptions
|
Note
supports pagination
Note
uses middleware (if available) to retrieve information, otherwise directly queries from the chain
Throws
if
- instruction does not exists
- instruction is not yet processed by the middleware (when querying from middleware)
- instruction is executed/rejected and was pruned from chain (when querying from chain)
api/entities/Instruction/index.ts:687
▸ getMediators(): Promise
<MediatorAffirmation
[]>
Returns the mediators for the Instruction, along with their affirmation status
Promise
<MediatorAffirmation
[]>
Note
uses middleware (if available) to retrieve information, otherwise directly queries from the chain
Throws
if
- instruction does not exists
- instruction is not yet processed by the middleware (when querying from middleware)
- instruction is executed/rejected and was pruned from chain (when querying from chain)
api/entities/Instruction/index.ts:966
▸ getOffChainAffirmationForLeg(args
): Promise
<AffirmationStatus
>
Returns affirmation status for a specific offchain leg in this Instruction
Name | Type | Description |
---|---|---|
args |
Object |
- |
args.legId |
BigNumber |
index of the leg whose affirmation status is to be fetched |
Promise
<AffirmationStatus
>
Note
uses middleware (if available) to retrieve information, otherwise directly queries from the chain
Throws
if
- instruction does not exists
- legId provided is not an off-chain leg
- instruction is not yet processed by the middleware (when querying from middleware)
- instruction is executed/rejected and was pruned from chain (when querying from chain)
api/entities/Instruction/index.ts:1111
▸ getOffChainAffirmations(): Promise
<OffChainAffirmation
[]>
Returns affirmation statuses for offchain legs in this Instruction
Promise
<OffChainAffirmation
[]>
Note
uses middleware (if available) to retrieve information, otherwise directly queries from the chain
Throws
if
- instruction does not exists
- instruction is not yet processed by the middleware (when querying from middleware)
- instruction is executed/rejected and was pruned from chain (when querying from chain)
api/entities/Instruction/index.ts:1046
▸ getStatus(): Promise
<InstructionStatusResult
>
Retrieve current status of this Instruction
Promise
<InstructionStatusResult
>
Note
uses the middlewareV2
api/entities/Instruction/index.ts:732
▸ isEqual(entity
): boolean
Determine whether this Entity is the same as another one
Name | Type |
---|---|
entity |
Entity <unknown , unknown > |
boolean
▸ isExecuted(): Promise
<boolean
>
Retrieve whether the Instruction has already been executed and pruned from the chain.
Promise
<boolean
>
api/entities/Instruction/index.ts:216
▸ isPending(): Promise
<boolean
>
Retrieve whether the Instruction is still pending on chain
Promise
<boolean
>
api/entities/Instruction/index.ts:245
▸ onStatusChange(callback
): Promise
<UnsubCallback
>
Retrieve current status of the Instruction. This can be subscribed to know if instruction fails
Name | Type |
---|---|
callback |
SubCallback <InstructionStatus > |
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.
api/entities/Instruction/index.ts:270
▸ reject(args?
, opts?
): Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Reject this instruction
Name | Type |
---|---|
args? |
RejectInstructionParams |
opts? |
ProcedureOpts |
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
api/entities/Instruction/index.ts:797
▸ rejectAsMediator(opts?
): Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Reject this instruction as a mediator
Name | Type |
---|---|
opts? |
ProcedureOpts |
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
api/entities/Instruction/index.ts:831
▸ toHuman(): string
Return the Instruction's ID
string
api/entities/Instruction/index.ts:905
▸ withdraw(args?
, opts?
): Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Withdraw affirmation from this instruction (unauthorize)
Name | Type |
---|---|
args? |
WithdrawInstructionParams |
opts? |
ProcedureOpts |
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
api/entities/Instruction/index.ts:817
▸ withdrawAsMediator(opts?
): Promise
<GenericPolymeshTransaction
<Instruction
, Instruction
>>
Withdraw affirmation from this instruction as a mediator (unauthorize)
Name | Type |
---|---|
opts? |
ProcedureOpts |
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
api/entities/Instruction/index.ts:851
▸ Static
generateUuid<Identifiers
>(identifiers
): string
Generate the Entity's UUID from its identifying properties
Name |
---|
Identifiers |
Name | Type |
---|---|
identifiers |
Identifiers |
string
▸ Static
unserialize<Identifiers
>(serialized
): Identifiers
Unserialize a UUID into its Unique Identifiers
Name |
---|
Identifiers |
Name | Type | Description |
---|---|---|
serialized |
string |
UUID to unserialize |
Identifiers
Entities
- Account
- Asset
- Authorization Request
- Checkpoint
- Checkpoint Schedule
- Corporate Action
- Corporate Action Base
- Custom Permission Group
- Default Portfolio
- Default Trusted Claim Issuer
- Dividend Distribution
- Entity
- Identity
- Instruction
- Known Permission Group
- Metadata Entry
- Multi Sig Proposal
- Numbered Portfolio
- Offering
- Permission Group
- Portfolio
- Subsidies
- Subsidy
- Ticker Reservation
- Venue
- Authorizations
- Types