# Instruction

Represents a settlement Instruction to be executed on a certain Venue

## Hierarchy

* [Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/entity)‹UniqueIdentifiers›

  ↳ **Instruction**

## Index

### Properties

* [context](#protected-context)
* [id](#id)
* [uuid](#uuid)

### Methods

* [affirm](#affirm)
* [details](#details)
* [exists](#exists)
* [getAffirmations](#getaffirmations)
* [getLegs](#getlegs)
* [isEqual](#isequal)
* [reject](#reject)
* [withdraw](#withdraw)
* [generateUuid](#static-generateuuid)
* [unserialize](#static-unserialize)

## Properties

### `Protected` context

• **context**: [*Context*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/context)

*Inherited from* [*CheckpointSchedule*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/checkpointschedule)*.*[*context*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/checkpointschedule#protected-context)

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

### id

• **id**: *BigNumber*

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

Identifier number of the venue

### uuid

• **uuid**: *string*

*Inherited from* [*CheckpointSchedule*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/checkpointschedule)*.*[*uuid*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/checkpointschedule#uuid)

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

## Methods

### affirm

▸ **affirm**(`args`: void): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/transactionqueue)*‹*[*Instruction*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/instruction)*››*

*Defined in* [*src/api/entities/Instruction/index.ts:296*](https://github.com/PolymathNetwork/polymesh-sdk/blob/23062de4/src/api/entities/Instruction/index.ts#L296)

Affirm this instruction (authorize)

**`note`** this method is of type [ProcedureMethod](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/interfaces/proceduremethod), 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 |

**Returns:** *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/transactionqueue)*‹*[*Instruction*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/instruction)*››*

### details

▸ **details**(): *Promise‹*[*InstructionDetails*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/globals#instructiondetails)*›*

*Defined in* [*src/api/entities/Instruction/index.ts:129*](https://github.com/PolymathNetwork/polymesh-sdk/blob/23062de4/src/api/entities/Instruction/index.ts#L129)

Retrieve information specific to this Instruction

**Returns:** *Promise‹*[*InstructionDetails*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/globals#instructiondetails)*›*

### exists

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

*Defined in* [*src/api/entities/Instruction/index.ts:108*](https://github.com/PolymathNetwork/polymesh-sdk/blob/23062de4/src/api/entities/Instruction/index.ts#L108)

Retrieve whether the Instruction still exists on chain. Executed/rejected instructions are pruned from the storage

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

### getAffirmations

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

*Defined in* [*src/api/entities/Instruction/index.ts:185*](https://github.com/PolymathNetwork/polymesh-sdk/blob/23062de4/src/api/entities/Instruction/index.ts#L185)

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-v6/interfaces/paginationoptions) |

**Returns:** *Promise‹*[*ResultSet*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/interfaces/resultset)*‹*[*InstructionAffirmation*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/interfaces/instructionaffirmation)*››*

### getLegs

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

*Defined in* [*src/api/entities/Instruction/index.ts:231*](https://github.com/PolymathNetwork/polymesh-sdk/blob/23062de4/src/api/entities/Instruction/index.ts#L231)

Retrieve all legs of this Instruction

**`note`** supports pagination

**Parameters:**

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

**Returns:** *Promise‹*[*ResultSet*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/interfaces/resultset)*‹*[*Leg*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/interfaces/leg)*››*

### isEqual

▸ **isEqual**(`entity`: [Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/entity)‹unknown›): *boolean*

*Inherited from* [*CheckpointSchedule*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/checkpointschedule)*.*[*isEqual*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/checkpointschedule#isequal)

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

Whether this Entity is the same as another one

**Parameters:**

| Name     | Type                                                                                                     |
| -------- | -------------------------------------------------------------------------------------------------------- |
| `entity` | [Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/entity)‹unknown› |

**Returns:** *boolean*

### reject

▸ **reject**(`args`: void): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/transactionqueue)*‹*[*Instruction*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/instruction)*››*

*Defined in* [*src/api/entities/Instruction/index.ts:286*](https://github.com/PolymathNetwork/polymesh-sdk/blob/23062de4/src/api/entities/Instruction/index.ts#L286)

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](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/interfaces/proceduremethod), 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 |

**Returns:** *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/transactionqueue)*‹*[*Instruction*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/instruction)*››*

### withdraw

▸ **withdraw**(`args`: void): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/transactionqueue)*‹*[*Instruction*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/instruction)*››*

*Defined in* [*src/api/entities/Instruction/index.ts:306*](https://github.com/PolymathNetwork/polymesh-sdk/blob/23062de4/src/api/entities/Instruction/index.ts#L306)

Withdraw affirmation from this instruction (unauthorize)

**`note`** this method is of type [ProcedureMethod](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/interfaces/proceduremethod), 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 |

**Returns:** *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/transactionqueue)*‹*[*Instruction*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/instruction)*››*

### `Static` generateUuid

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

*Inherited from* [*CheckpointSchedule*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/checkpointschedule)*.*[*generateUuid*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/checkpointschedule#static-generateuuid)

*Defined in* [*src/api/entities/Entity.ts:14*](https://github.com/PolymathNetwork/polymesh-sdk/blob/23062de4/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* [*CheckpointSchedule*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/classes/checkpointschedule)*.*[*unserialize*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v6/checkpointschedule#static-unserialize)

*Defined in* [*src/api/entities/Entity.ts:23*](https://github.com/PolymathNetwork/polymesh-sdk/blob/23062de4/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*
