# Instruction

Represents a settlement Instruction to be executed on a certain Venue

## Hierarchy

* [Entity](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/classes/entity)‹UniqueIdentifiers, string›

  ↳ **Instruction**

## Index

### Properties

* [context](#protected-context)
* [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)
* [toJson](#tojson)
* [withdraw](#withdraw)
* [generateUuid](#static-generateuuid)
* [unserialize](#static-unserialize)

## Properties

### `Protected` context

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

*Inherited from* [*Entity*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/classes/entity)*.*[*context*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/entity#protected-context)

*Defined in* [*src/api/entities/Entity.ts:48*](https://github.com/PolymathNetwork/polymesh-sdk/blob/108d588b/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/108d588b/src/api/entities/Instruction/index.ts#L77)

Identifier number of the venue

***

### uuid

• **uuid**: *string*

*Inherited from* [*Entity*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/classes/entity)*.*[*uuid*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/entity#uuid)

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

## Methods

### affirm

▸ **affirm**(`args`: void, `opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/classes/transactionqueue)*‹*[*Instruction*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/classes/instruction)*››*

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

Affirm this instruction (authorize)

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/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](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/procedureopts.md) |

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

***

### details

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

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

Retrieve information specific to this Instruction

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

***

### exists

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

*Overrides* [*Entity*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/classes/entity)*.*[*exists*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/entity#abstract-exists)

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

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

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

***

### getAffirmations

▸ **getAffirmations**(`paginationOpts?`: [PaginationOptions](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/paginationoptions.md)): *Promise‹*[*ResultSet*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/resultset.md)*‹*[*InstructionAffirmation*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/instructionaffirmation.md)*››*

*Defined in* [*src/api/entities/Instruction/index.ts:253*](https://github.com/PolymathNetwork/polymesh-sdk/blob/108d588b/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](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/paginationoptions.md) |

**Returns:** *Promise‹*[*ResultSet*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/resultset.md)*‹*[*InstructionAffirmation*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/instructionaffirmation.md)*››*

***

### getLegs

▸ **getLegs**(`paginationOpts?`: [PaginationOptions](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/paginationoptions.md)): *Promise‹*[*ResultSet*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/resultset.md)*‹*[*Leg*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/leg.md)*››*

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

Retrieve all legs of this Instruction

**`note`** supports pagination

**Parameters:**

| Name              | Type                                                                                                                    |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `paginationOpts?` | [PaginationOptions](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/paginationoptions.md) |

**Returns:** *Promise‹*[*ResultSet*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/resultset.md)*‹*[*Leg*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/leg.md)*››*

***

### getStatus

▸ **getStatus**(): *Promise‹*[*InstructionStatusResult*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/globals#instructionstatusresult)*›*

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

Retrieve current status of this Instruction

**`note`** uses the middleware

**Returns:** *Promise‹*[*InstructionStatusResult*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/globals#instructionstatusresult)*›*

***

### isEqual

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

*Inherited from* [*Entity*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/classes/entity)*.*[*isEqual*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/entity#isequal)

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

Determine whether this Entity is the same as another one

**Parameters:**

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

**Returns:** *boolean*

***

### isExecuted

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

*Defined in* [*src/api/entities/Instruction/index.ts:131*](https://github.com/PolymathNetwork/polymesh-sdk/blob/108d588b/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/108d588b/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](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/classes/transactionqueue)*‹*[*Instruction*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/classes/instruction)*››*

*Defined in* [*src/api/entities/Instruction/index.ts:392*](https://github.com/PolymathNetwork/polymesh-sdk/blob/108d588b/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](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/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](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/procedureopts.md) |

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

***

### reschedule

▸ **reschedule**(`args`: void, `opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/classes/transactionqueue)*‹*[*Instruction*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/classes/instruction)*››*

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

Schedule a failed Instructi oto rwaa

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/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](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/procedureopts.md) |

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

***

### toJson

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

*Overrides* [*Entity*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/classes/entity)*.*[*toJson*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/entity#abstract-tojson)

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

Return the Instruction's ID

**Returns:** *string*

***

### withdraw

▸ **withdraw**(`args`: void, `opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/classes/transactionqueue)*‹*[*Instruction*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/classes/instruction)*››*

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

Withdraw affirmation from this instruction (unauthorize)

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/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](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v13/docs/interfaces/procedureopts.md) |

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

***

### `Static` generateUuid

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

*Inherited from* [*Entity*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/classes/entity)*.*[*generateUuid*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/entity#static-generateuuid)

*Defined in* [*src/api/entities/Entity.ts:14*](https://github.com/PolymathNetwork/polymesh-sdk/blob/108d588b/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*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/classes/entity)*.*[*unserialize*](https://developers.polymath.network/polymesh-sdk-api-reference/v13.0.0/entity#static-unserialize)

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