# api\_entities\_Instruction.Instruction

[@polymeshassociation/polymesh-sdk](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes) / [Modules](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/modules) / [api/entities/Instruction](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/modules-1/api_entities_instruction) / Instruction

## Class: Instruction

[api/entities/Instruction](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/modules-1/api_entities_instruction).Instruction

Represents a settlement Instruction to be executed on a certain Venue

### Hierarchy

* [`Entity`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_entity.entity)<[`UniqueIdentifiers`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/api_entities_instruction.uniqueidentifiers), `string`>

  ↳ **`Instruction`**

### Table of contents

#### Properties

* [id](#id)
* [uuid](#uuid)

#### Methods

* [affirm](#affirm)
* [details](#details)
* [exists](#exists)
* [getAffirmations](#getaffirmations)
* [getLegs](#getlegs)
* [getStatus](#getstatus)
* [isEqual](#isequal)
* [isExecuted](#isexecuted)
* [isPending](#ispending)
* [reject](#reject)
* [reschedule](#reschedule)
* [toHuman](#tohuman)
* [withdraw](#withdraw)
* [generateUuid](#generateuuid)
* [unserialize](#unserialize)

### Properties

#### id

• **id**: `BigNumber`

Identifier number of the venue

**Defined in**

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

***

#### uuid

• **uuid**: `string`

**Inherited from**

[Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_entity.entity).[uuid](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/api_entities_entity.entity#uuid)

**Defined in**

[api/entities/Entity.ts:46](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Entity.ts#L46)

### Methods

#### affirm

▸ **affirm**(`opts?`): `Promise`<`TransactionQueue`<[`Instruction`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_instruction.instruction), [`Instruction`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_instruction.instruction), `unknown`\[]\[]>>

Affirm this instruction (authorize)

**`note`** this method is of type [NoArgsProcedureMethod](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.noargsproceduremethod), which means you can call [affirm.checkAuthorization](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.noargsproceduremethod#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters**

| Name    | Type                                                                                                                        |
| ------- | --------------------------------------------------------------------------------------------------------------------------- |
| `opts?` | [`ProcedureOpts`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.procedureopts) |

**Returns**

`Promise`<`TransactionQueue`<[`Instruction`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_instruction.instruction), [`Instruction`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_instruction.instruction), `unknown`\[]\[]>>

**Defined in**

[api/entities/Instruction/index.ts:406](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Instruction/index.ts#L406)

***

#### details

▸ **details**(): `Promise`<[`InstructionDetails`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/modules-1/api_entities_instruction_types#instructiondetails)>

Retrieve information specific to this Instruction

**Returns**

`Promise`<[`InstructionDetails`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/modules-1/api_entities_instruction_types#instructiondetails)>

**Defined in**

[api/entities/Instruction/index.ts:198](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Instruction/index.ts#L198)

***

#### exists

▸ **exists**(): `Promise`<`boolean`>

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

**Returns**

`Promise`<`boolean`>

**Overrides**

[Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_entity.entity).[exists](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/api_entities_entity.entity#exists)

**Defined in**

[api/entities/Instruction/index.ts:180](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Instruction/index.ts#L180)

***

#### getAffirmations

▸ **getAffirmations**(`paginationOpts?`): `Promise`<[`ResultSet`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.resultset)<[`InstructionAffirmation`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/api_entities_instruction_types.instructionaffirmation)>>

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

**`note`** supports pagination

**Parameters**

| Name              | Type                                                                                                                                |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `paginationOpts?` | [`PaginationOptions`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.paginationoptions) |

**Returns**

`Promise`<[`ResultSet`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.resultset)<[`InstructionAffirmation`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/api_entities_instruction_types.instructionaffirmation)>>

**Defined in**

[api/entities/Instruction/index.ts:257](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Instruction/index.ts#L257)

***

#### getLegs

▸ **getLegs**(`paginationOpts?`): `Promise`<[`ResultSet`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.resultset)<[`Leg`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/api_entities_instruction_types.leg)>>

Retrieve all legs of this Instruction

**`note`** supports pagination

**Parameters**

| Name              | Type                                                                                                                                |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `paginationOpts?` | [`PaginationOptions`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.paginationoptions) |

**Returns**

`Promise`<[`ResultSet`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.resultset)<[`Leg`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/api_entities_instruction_types.leg)>>

**Defined in**

[api/entities/Instruction/index.ts:303](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Instruction/index.ts#L303)

***

#### getStatus

▸ **getStatus**(): `Promise`<[`InstructionStatusResult`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/modules-1/api_entities_instruction_types#instructionstatusresult)>

Retrieve current status of this Instruction

**`note`** uses the middleware

**Returns**

`Promise`<[`InstructionStatusResult`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/modules-1/api_entities_instruction_types#instructionstatusresult)>

**Defined in**

[api/entities/Instruction/index.ts:354](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Instruction/index.ts#L354)

***

#### isEqual

▸ **isEqual**(`entity`): `boolean`

Determine whether this Entity is the same as another one

**Parameters**

| Name     | Type                                                                                                                                           |
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `entity` | [`Entity`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_entity.entity)<`unknown`, `unknown`> |

**Returns**

`boolean`

**Inherited from**

[Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_entity.entity).[isEqual](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/api_entities_entity.entity#isequal)

**Defined in**

[api/entities/Entity.ts:61](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Entity.ts#L61)

***

#### 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:135](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Instruction/index.ts#L135)

***

#### isPending

▸ **isPending**(): `Promise`<`boolean`>

Retrieve whether the Instruction is still pending on chain

**Returns**

`Promise`<`boolean`>

**Defined in**

[api/entities/Instruction/index.ts:159](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Instruction/index.ts#L159)

***

#### reject

▸ **reject**(`opts?`): `Promise`<`TransactionQueue`<[`Instruction`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_instruction.instruction), [`Instruction`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_instruction.instruction), `unknown`\[]\[]>>

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 [NoArgsProcedureMethod](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.noargsproceduremethod), which means you can call [reject.checkAuthorization](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.noargsproceduremethod#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters**

| Name    | Type                                                                                                                        |
| ------- | --------------------------------------------------------------------------------------------------------------------------- |
| `opts?` | [`ProcedureOpts`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.procedureopts) |

**Returns**

`Promise`<`TransactionQueue`<[`Instruction`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_instruction.instruction), [`Instruction`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_instruction.instruction), `unknown`\[]\[]>>

**Defined in**

[api/entities/Instruction/index.ts:396](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Instruction/index.ts#L396)

***

#### reschedule

▸ **reschedule**(`opts?`): `Promise`<`TransactionQueue`<[`Instruction`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_instruction.instruction), [`Instruction`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_instruction.instruction), `unknown`\[]\[]>>

Reschedules a failed Instruction to be tried again

**`throws`** if the Instruction status is not `InstructionStatus.Failed`

**`note`** this method is of type [NoArgsProcedureMethod](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.noargsproceduremethod), which means you can call [reschedule.checkAuthorization](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.noargsproceduremethod#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters**

| Name    | Type                                                                                                                        |
| ------- | --------------------------------------------------------------------------------------------------------------------------- |
| `opts?` | [`ProcedureOpts`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.procedureopts) |

**Returns**

`Promise`<`TransactionQueue`<[`Instruction`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_instruction.instruction), [`Instruction`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_instruction.instruction), `unknown`\[]\[]>>

**Defined in**

[api/entities/Instruction/index.ts:428](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Instruction/index.ts#L428)

***

#### toHuman

▸ **toHuman**(): `string`

Return the Instruction's ID

**Returns**

`string`

**Overrides**

[Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_entity.entity).[toHuman](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/api_entities_entity.entity#tohuman)

**Defined in**

[api/entities/Instruction/index.ts:457](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Instruction/index.ts#L457)

***

#### withdraw

▸ **withdraw**(`opts?`): `Promise`<`TransactionQueue`<[`Instruction`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_instruction.instruction), [`Instruction`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_instruction.instruction), `unknown`\[]\[]>>

Withdraw affirmation from this instruction (unauthorize)

**`note`** this method is of type [NoArgsProcedureMethod](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.noargsproceduremethod), which means you can call [withdraw.checkAuthorization](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.noargsproceduremethod#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters**

| Name    | Type                                                                                                                        |
| ------- | --------------------------------------------------------------------------------------------------------------------------- |
| `opts?` | [`ProcedureOpts`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.procedureopts) |

**Returns**

`Promise`<`TransactionQueue`<[`Instruction`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_instruction.instruction), [`Instruction`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_instruction.instruction), `unknown`\[]\[]>>

**Defined in**

[api/entities/Instruction/index.ts:416](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Instruction/index.ts#L416)

***

#### 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**

[Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_entity.entity).[generateUuid](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/api_entities_entity.entity#generateuuid)

**Defined in**

[api/entities/Entity.ts:14](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Entity.ts#L14)

***

#### 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`

**Inherited from**

[Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_entity.entity).[unserialize](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/api_entities_entity.entity#unserialize)

**Defined in**

[api/entities/Entity.ts:23](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Entity.ts#L23)
