> For the complete documentation index, see [llms.txt](https://developers.polymath.network/polymesh-sdk-api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v9/classes/instruction.md).

# Instruction

Represents a settlement Instruction to be executed on a certain Venue

## Hierarchy

* [Entity](/polymesh-sdk-api-reference/docs-v9/classes/entity.md)‹UniqueIdentifiers, string›

  ↳ **Instruction**

## Index

### Properties

* [context](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#protected-context)
* [id](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#id)
* [uuid](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#uuid)

### Methods

* [affirm](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#affirm)
* [details](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#details)
* [exists](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#exists)
* [getAffirmations](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#getaffirmations)
* [getLegs](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#getlegs)
* [getStatus](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#getstatus)
* [isEqual](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#isequal)
* [isExecuted](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#isexecuted)
* [isPending](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#ispending)
* [reject](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#reject)
* [reschedule](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#reschedule)
* [toJson](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#tojson)
* [withdraw](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#withdraw)
* [generateUuid](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#static-generateuuid)
* [unserialize](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md#static-unserialize)

## Properties

### `Protected` context

• **context**: [*Context*](/polymesh-sdk-api-reference/docs-v9/classes/context.md)

*Inherited from* [*Entity*](/polymesh-sdk-api-reference/docs-v9/classes/entity.md)*.*[*context*](/polymesh-sdk-api-reference/docs-v9/classes/entity.md#protected-context)

*Defined in* [*src/api/entities/Entity.ts:48*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Entity.ts#L48)

### id

• **id**: *BigNumber*

*Defined in* [*src/api/entities/Instruction/index.ts:77*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Instruction/index.ts#L77)

Identifier number of the venue

### uuid

• **uuid**: *string*

*Inherited from* [*Entity*](/polymesh-sdk-api-reference/docs-v9/classes/entity.md)*.*[*uuid*](/polymesh-sdk-api-reference/docs-v9/classes/entity.md#uuid)

*Defined in* [*src/api/entities/Entity.ts:46*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Entity.ts#L46)

## Methods

### affirm

▸ **affirm**(`args`: void, `opts?`: [ProcedureOpts](/polymesh-sdk-api-reference/docs-v9/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](/polymesh-sdk-api-reference/docs-v9/classes/transactionqueue.md)*‹*[*Instruction*](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md)*››*

*Defined in* [*src/api/entities/Instruction/index.ts:402*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Instruction/index.ts#L402)

Affirm this instruction (authorize)

**`note`** this method is of type [ProcedureMethod](/polymesh-sdk-api-reference/docs-v9/interfaces/proceduremethod.md), which means you can call `affirm.checkAuthorization` on it to see whether the Current Account has the required permissions to run it

**Parameters:**

| Name    | Type                                                                             |
| ------- | -------------------------------------------------------------------------------- |
| `args`  | void                                                                             |
| `opts?` | [ProcedureOpts](/polymesh-sdk-api-reference/docs-v9/interfaces/procedureopts.md) |

**Returns:** *Promise‹*[*TransactionQueue*](/polymesh-sdk-api-reference/docs-v9/classes/transactionqueue.md)*‹*[*Instruction*](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md)*››*

### details

▸ **details**(): *Promise‹*[*InstructionDetails*](/polymesh-sdk-api-reference/docs-v9/globals.md#instructiondetails)*›*

*Defined in* [*src/api/entities/Instruction/index.ts:194*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Instruction/index.ts#L194)

Retrieve information specific to this Instruction

**Returns:** *Promise‹*[*InstructionDetails*](/polymesh-sdk-api-reference/docs-v9/globals.md#instructiondetails)*›*

### exists

▸ **exists**(): *Promise‹boolean›*

*Defined in* [*src/api/entities/Instruction/index.ts:176*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Instruction/index.ts#L176)

Retrieve whether the Instruction exists on chain (or existed and was pruned)

**Returns:** *Promise‹boolean›*

### getAffirmations

▸ **getAffirmations**(`paginationOpts?`: [PaginationOptions](/polymesh-sdk-api-reference/docs-v9/interfaces/paginationoptions.md)): *Promise‹*[*ResultSet*](/polymesh-sdk-api-reference/docs-v9/interfaces/resultset.md)*‹*[*InstructionAffirmation*](/polymesh-sdk-api-reference/docs-v9/interfaces/instructionaffirmation.md)*››*

*Defined in* [*src/api/entities/Instruction/index.ts:253*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Instruction/index.ts#L253)

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

**`note`** supports pagination

**Parameters:**

| Name              | Type                                                                                     |
| ----------------- | ---------------------------------------------------------------------------------------- |
| `paginationOpts?` | [PaginationOptions](/polymesh-sdk-api-reference/docs-v9/interfaces/paginationoptions.md) |

**Returns:** *Promise‹*[*ResultSet*](/polymesh-sdk-api-reference/docs-v9/interfaces/resultset.md)*‹*[*InstructionAffirmation*](/polymesh-sdk-api-reference/docs-v9/interfaces/instructionaffirmation.md)*››*

### getLegs

▸ **getLegs**(`paginationOpts?`: [PaginationOptions](/polymesh-sdk-api-reference/docs-v9/interfaces/paginationoptions.md)): *Promise‹*[*ResultSet*](/polymesh-sdk-api-reference/docs-v9/interfaces/resultset.md)*‹*[*Leg*](/polymesh-sdk-api-reference/docs-v9/interfaces/leg.md)*››*

*Defined in* [*src/api/entities/Instruction/index.ts:299*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Instruction/index.ts#L299)

Retrieve all legs of this Instruction

**`note`** supports pagination

**Parameters:**

| Name              | Type                                                                                     |
| ----------------- | ---------------------------------------------------------------------------------------- |
| `paginationOpts?` | [PaginationOptions](/polymesh-sdk-api-reference/docs-v9/interfaces/paginationoptions.md) |

**Returns:** *Promise‹*[*ResultSet*](/polymesh-sdk-api-reference/docs-v9/interfaces/resultset.md)*‹*[*Leg*](/polymesh-sdk-api-reference/docs-v9/interfaces/leg.md)*››*

### getStatus

▸ **getStatus**(): *Promise‹*[*InstructionStatusResult*](/polymesh-sdk-api-reference/docs-v9/globals.md#instructionstatusresult)*›*

*Defined in* [*src/api/entities/Instruction/index.ts:350*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Instruction/index.ts#L350)

Retrieve current status of this Instruction

**`note`** uses the middleware

**Returns:** *Promise‹*[*InstructionStatusResult*](/polymesh-sdk-api-reference/docs-v9/globals.md#instructionstatusresult)*›*

### isEqual

▸ **isEqual**(`entity`: [Entity](/polymesh-sdk-api-reference/docs-v9/classes/entity.md)‹unknown, unknown›): *boolean*

*Inherited from* [*Entity*](/polymesh-sdk-api-reference/docs-v9/classes/entity.md)*.*[*isEqual*](/polymesh-sdk-api-reference/docs-v9/classes/entity.md#isequal)

*Defined in* [*src/api/entities/Entity.ts:61*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Entity.ts#L61)

Whether this Entity is the same as another one

**Parameters:**

| Name     | Type                                                                              |
| -------- | --------------------------------------------------------------------------------- |
| `entity` | [Entity](/polymesh-sdk-api-reference/docs-v9/classes/entity.md)‹unknown, unknown› |

**Returns:** *boolean*

### isExecuted

▸ **isExecuted**(): *Promise‹boolean›*

*Defined in* [*src/api/entities/Instruction/index.ts:131*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Instruction/index.ts#L131)

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

**Returns:** *Promise‹boolean›*

### isPending

▸ **isPending**(): *Promise‹boolean›*

*Defined in* [*src/api/entities/Instruction/index.ts:155*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Instruction/index.ts#L155)

Retrieve whether the Instruction is still pending on chain

**Returns:** *Promise‹boolean›*

### reject

▸ **reject**(`args`: void, `opts?`: [ProcedureOpts](/polymesh-sdk-api-reference/docs-v9/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](/polymesh-sdk-api-reference/docs-v9/classes/transactionqueue.md)*‹*[*Instruction*](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md)*››*

*Defined in* [*src/api/entities/Instruction/index.ts:392*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Instruction/index.ts#L392)

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`** this method is of type [ProcedureMethod](/polymesh-sdk-api-reference/docs-v9/interfaces/proceduremethod.md), which means you can call `reject.checkAuthorization` on it to see whether the Current Account has the required permissions to run it

**Parameters:**

| Name    | Type                                                                             |
| ------- | -------------------------------------------------------------------------------- |
| `args`  | void                                                                             |
| `opts?` | [ProcedureOpts](/polymesh-sdk-api-reference/docs-v9/interfaces/procedureopts.md) |

**Returns:** *Promise‹*[*TransactionQueue*](/polymesh-sdk-api-reference/docs-v9/classes/transactionqueue.md)*‹*[*Instruction*](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md)*››*

### reschedule

▸ **reschedule**(`args`: void, `opts?`: [ProcedureOpts](/polymesh-sdk-api-reference/docs-v9/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](/polymesh-sdk-api-reference/docs-v9/classes/transactionqueue.md)*‹*[*Instruction*](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md)*››*

*Defined in* [*src/api/entities/Instruction/index.ts:422*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Instruction/index.ts#L422)

Schedule a failed Instructi oto rwaa

**`note`** this method is of type [ProcedureMethod](/polymesh-sdk-api-reference/docs-v9/interfaces/proceduremethod.md), which means you can call `reschedule.checkAuthorization` on it to see whether the Current Account has the required permissions to run it

**Parameters:**

| Name    | Type                                                                             |
| ------- | -------------------------------------------------------------------------------- |
| `args`  | void                                                                             |
| `opts?` | [ProcedureOpts](/polymesh-sdk-api-reference/docs-v9/interfaces/procedureopts.md) |

**Returns:** *Promise‹*[*TransactionQueue*](/polymesh-sdk-api-reference/docs-v9/classes/transactionqueue.md)*‹*[*Instruction*](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md)*››*

### toJson

▸ **toJson**(): *string*

*Overrides* [*Entity*](/polymesh-sdk-api-reference/docs-v9/classes/entity.md)*.*[*toJson*](/polymesh-sdk-api-reference/docs-v9/classes/entity.md#abstract-tojson)

*Defined in* [*src/api/entities/Instruction/index.ts:451*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Instruction/index.ts#L451)

Return the Instruction's ID

**Returns:** *string*

### withdraw

▸ **withdraw**(`args`: void, `opts?`: [ProcedureOpts](/polymesh-sdk-api-reference/docs-v9/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](/polymesh-sdk-api-reference/docs-v9/classes/transactionqueue.md)*‹*[*Instruction*](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md)*››*

*Defined in* [*src/api/entities/Instruction/index.ts:412*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Instruction/index.ts#L412)

Withdraw affirmation from this instruction (unauthorize)

**`note`** this method is of type [ProcedureMethod](/polymesh-sdk-api-reference/docs-v9/interfaces/proceduremethod.md), which means you can call `withdraw.checkAuthorization` on it to see whether the Current Account has the required permissions to run it

**Parameters:**

| Name    | Type                                                                             |
| ------- | -------------------------------------------------------------------------------- |
| `args`  | void                                                                             |
| `opts?` | [ProcedureOpts](/polymesh-sdk-api-reference/docs-v9/interfaces/procedureopts.md) |

**Returns:** *Promise‹*[*TransactionQueue*](/polymesh-sdk-api-reference/docs-v9/classes/transactionqueue.md)*‹*[*Instruction*](/polymesh-sdk-api-reference/docs-v9/classes/instruction.md)*››*

### `Static` generateUuid

▸ **generateUuid**‹**Identifiers**›(`identifiers`: Identifiers): *string*

*Inherited from* [*Entity*](/polymesh-sdk-api-reference/docs-v9/classes/entity.md)*.*[*generateUuid*](/polymesh-sdk-api-reference/docs-v9/classes/entity.md#static-generateuuid)

*Defined in* [*src/api/entities/Entity.ts:14*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Entity.ts#L14)

Generate the Entity's UUID from its identifying properties

**Type parameters:**

▪ **Identifiers**

**Parameters:**

| Name          | Type        | Description |
| ------------- | ----------- | ----------- |
| `identifiers` | Identifiers |             |

**Returns:** *string*

### `Static` unserialize

▸ **unserialize**‹**Identifiers**›(`serialized`: string): *Identifiers*

*Inherited from* [*Entity*](/polymesh-sdk-api-reference/docs-v9/classes/entity.md)*.*[*unserialize*](/polymesh-sdk-api-reference/docs-v9/classes/entity.md#static-unserialize)

*Defined in* [*src/api/entities/Entity.ts:23*](https://github.com/PolymathNetwork/polymesh-sdk/blob/56921667/src/api/entities/Entity.ts#L23)

Unserialize a UUID into its Unique Identifiers

**Type parameters:**

▪ **Identifiers**

**Parameters:**

| Name         | Type   | Description         |
| ------------ | ------ | ------------------- |
| `serialized` | string | UUID to unserialize |

**Returns:** *Identifiers*
