# Instruction

Represents a settlement Instruction to be executed on a certain Venue

## Hierarchy

* [Entity](/polymesh-sdk-api-reference/docs-beta/classes/entity.md)‹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)
* [getStatusV2](#getstatusv2)
* [isEqual](#isequal)
* [isExecuted](#isexecuted)
* [isPending](#ispending)
* [reject](#reject)
* [reschedule](#reschedule)
* [toHuman](#tohuman)
* [withdraw](#withdraw)
* [generateUuid](#static-generateuuid)
* [unserialize](#static-unserialize)

## Properties

### `Protected` context

• **context**: *Context*

*Inherited from* [*CheckpointSchedule*](/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule.md)*.*[*context*](/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule.md#protected-context)

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

***

### id

• **id**: *BigNumber*

*Defined in* [*src/api/entities/Instruction/index.ts:80*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Instruction/index.ts#L80)

Identifier number of the venue

***

### uuid

• **uuid**: *string*

*Inherited from* [*CheckpointSchedule*](/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule.md)*.*[*uuid*](/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule.md#uuid)

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

## Methods

### affirm

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

*Defined in* [*src/api/entities/Instruction/index.ts:448*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Instruction/index.ts#L448)

Affirm this instruction (authorize)

**`note`** this method is of type [NoArgsProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/noargsproceduremethod.md), which means you can call [affirm.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/noargsproceduremethod.md#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://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md) |

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

***

### details

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

*Defined in* [*src/api/entities/Instruction/index.ts:201*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Instruction/index.ts#L201)

Retrieve information specific to this Instruction

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

***

### exists

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

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

*Defined in* [*src/api/entities/Instruction/index.ts:183*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Instruction/index.ts#L183)

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/beta/docs/interfaces/paginationoptions.md)): *Promise‹*[*ResultSet*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/resultset.md)*‹*[*InstructionAffirmation*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/instructionaffirmation.md)*››*

*Defined in* [*src/api/entities/Instruction/index.ts:260*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Instruction/index.ts#L260)

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/beta/docs/interfaces/paginationoptions.md) |

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

***

### getLegs

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

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

Retrieve all legs of this Instruction

**`note`** supports pagination

**Parameters:**

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

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

***

### getStatus

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

*Defined in* [*src/api/entities/Instruction/index.ts:357*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Instruction/index.ts#L357)

Retrieve current status of this Instruction

**`note`** uses the middleware

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

***

### getStatusV2

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

*Defined in* [*src/api/entities/Instruction/index.ts:395*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Instruction/index.ts#L395)

Retrieve current status of this Instruction

**`note`** uses the middlewareV2

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

***

### isEqual

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

*Inherited from* [*CheckpointSchedule*](/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule.md)*.*[*isEqual*](/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule.md#isequal)

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

Determine whether this Entity is the same as another one

**Parameters:**

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

**Returns:** *boolean*

***

### isExecuted

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

*Defined in* [*src/api/entities/Instruction/index.ts:138*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Instruction/index.ts#L138)

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

Retrieve whether the Instruction is still pending on chain

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

***

### reject

▸ **reject**(`opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue.md)*‹*[*Instruction*](/polymesh-sdk-api-reference/docs-beta/classes/instruction.md)*››*

*Defined in* [*src/api/entities/Instruction/index.ts:438*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Instruction/index.ts#L438)

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://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/noargsproceduremethod.md), which means you can call [reject.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/noargsproceduremethod.md#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://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md) |

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

***

### reschedule

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

*Defined in* [*src/api/entities/Instruction/index.ts:470*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Instruction/index.ts#L470)

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://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/noargsproceduremethod.md), which means you can call [reschedule.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/noargsproceduremethod.md#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://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md) |

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

***

### toHuman

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

*Overrides* [*Entity*](/polymesh-sdk-api-reference/docs-beta/classes/entity.md)*.*[*toHuman*](/polymesh-sdk-api-reference/docs-beta/classes/entity.md#abstract-tohuman)

*Defined in* [*src/api/entities/Instruction/index.ts:527*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Instruction/index.ts#L527)

Return the Instruction's ID

**Returns:** *string*

***

### withdraw

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

*Defined in* [*src/api/entities/Instruction/index.ts:458*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Instruction/index.ts#L458)

Withdraw affirmation from this instruction (unauthorize)

**`note`** this method is of type [NoArgsProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/noargsproceduremethod.md), which means you can call [withdraw.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/noargsproceduremethod.md#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://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md) |

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

***

### `Static` generateUuid

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

*Inherited from* [*CheckpointSchedule*](/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule.md)*.*[*generateUuid*](/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule.md#static-generateuuid)

*Defined in* [*src/api/entities/Entity.ts:14*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/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*](/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule.md)*.*[*unserialize*](/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule.md#static-unserialize)

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/instruction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
