# Settlements

Handles all Asset Settlements related functionality Handles all Settlement related functionality

## Hierarchy

* Namespace‹[Asset](https://developers.polymath.network/polymesh-sdk-api-reference/classes/asset)›

  ↳ **Settlements**

## Index

### Properties

* [context](#protected-context)
* [parent](#protected-parent)

### Methods

* [addInstruction](#addinstruction)
* [affirmInstruction](#affirminstruction)
* [canSettle](#cansettle)
* [canTransfer](#cantransfer)
* [createVenue](#createvenue)
* [getInstruction](#getinstruction)
* [getVenue](#getvenue)

## Properties

### `Protected` context

• **context**: *Context*

*Inherited from void*

*Defined in* [*src/api/entities/Namespace.ts:11*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/api/entities/Namespace.ts#L11)

*Defined in* [*src/Settlements.ts:25*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/Settlements.ts#L25)

***

### `Protected` parent

• **parent**: [*Asset*](https://developers.polymath.network/polymesh-sdk-api-reference/classes/asset)

*Inherited from void*

*Defined in* [*src/api/entities/Namespace.ts:9*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/api/entities/Namespace.ts#L9)

## Methods

### addInstruction

▸ **addInstruction**(`args`: [AddInstructionWithVenueIdParams](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/addinstructionwithvenueidparams.md), `opts?`: [ProcedureOpts](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/classes/transactionqueue)*‹*[*Instruction*](https://developers.polymath.network/polymesh-sdk-api-reference/classes/instruction)*\[],* [*Instruction*](https://developers.polymath.network/polymesh-sdk-api-reference/classes/instruction)*››*

*Defined in* [*src/Settlements.ts:118*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/Settlements.ts#L118)

Create an Instruction to exchange Assets

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/proceduremethod.md), which means you can call [addInstruction.checkAuthorization](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/proceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

| Name    | Type                                                                                                                                                    |
| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `args`  | [AddInstructionWithVenueIdParams](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/addinstructionwithvenueidparams.md) |
| `opts?` | [ProcedureOpts](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/procedureopts.md)                                     |

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

***

### affirmInstruction

▸ **affirmInstruction**(`args`: [AffirmInstructionParams](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/affirminstructionparams.md), `opts?`: [ProcedureOpts](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/classes/transactionqueue)*‹*[*Instruction*](https://developers.polymath.network/polymesh-sdk-api-reference/classes/instruction)*››*

*Defined in* [*src/Settlements.ts:128*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/Settlements.ts#L128)

Affirm an Instruction (authorize)

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/proceduremethod.md), which means you can call [affirmInstruction.checkAuthorization](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/proceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

| Name    | Type                                                                                                                                    |
| ------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `args`  | [AffirmInstructionParams](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/affirminstructionparams.md) |
| `opts?` | [ProcedureOpts](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/procedureopts.md)                     |

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

***

### canSettle

▸ **canSettle**(`args`: object): *Promise‹*[*TransferStatus*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/enums/transferstatus.md)*›*

*Defined in* [*src/api/entities/Asset/Settlements.ts:38*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/api/entities/Asset/Settlements.ts#L38)

Check whether it is possible to create a settlement Instruction to transfer a certain amount of this Asset's tokens between two Portfolios.

**`note`** this takes locked tokens into account. For example, if portfolio A has 1000 tokens and this function is called to check if 700 of them can be transferred to portfolio B (assuming everything else checks out) the result will be success. If an instruction is created and authorized to transfer those 700 tokens, they would become locked. From that point, further calls to this function would yield failed results because of the funds being locked, even though they haven't been transferred yet

**`deprecated`** in favor of [canTransfer](#cantransfer)

**Parameters:**

▪ **args**: *object*

| Name     | Type                                                                                                  | Description                                                                       |
| -------- | ----------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `amount` | BigNumber                                                                                             | amount of tokens to transfer                                                      |
| `from?`  | [PortfolioLike](https://developers.polymath.network/polymesh-sdk-api-reference/globals#portfoliolike) | sender Portfolio (optional, defaults to the signing Identity's Default Portfolio) |
| `to`     | [PortfolioLike](https://developers.polymath.network/polymesh-sdk-api-reference/globals#portfoliolike) | receiver Portfolio                                                                |

**Returns:** *Promise‹*[*TransferStatus*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/enums/transferstatus.md)*›*

***

### canTransfer

▸ **canTransfer**(`args`: object): *Promise‹*[*TransferBreakdown*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/transferbreakdown.md)*›*

*Defined in* [*src/api/entities/Asset/Settlements.ts:107*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/api/entities/Asset/Settlements.ts#L107)

Check whether it is possible to create a settlement instruction to transfer a certain amount of this asset between two Portfolios. Returns a breakdown of the transaction containing general errors (such as insufficient balance or invalid receiver), any broken transfer restrictions, and any compliance failures

**`note`** this takes locked tokens into account. For example, if portfolio A has 1000 tokens and this function is called to check if 700 of them can be transferred to portfolio B (assuming everything else checks out) the result will be success. If an instruction is created and authorized to transfer those 700 tokens, they would become locked. From that point, further calls to this function would yield failed results because of the funds being locked, even though they haven't been transferred yet

**Parameters:**

▪ **args**: *object*

| Name     | Type                                                                                                  | Description                                                                       |
| -------- | ----------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `amount` | BigNumber                                                                                             | amount of tokens to transfer                                                      |
| `from?`  | [PortfolioLike](https://developers.polymath.network/polymesh-sdk-api-reference/globals#portfoliolike) | sender Portfolio (optional, defaults to the signing Identity's Default Portfolio) |
| `to`     | [PortfolioLike](https://developers.polymath.network/polymesh-sdk-api-reference/globals#portfoliolike) | receiver Portfolio                                                                |

**Returns:** *Promise‹*[*TransferBreakdown*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/transferbreakdown.md)*›*

***

### createVenue

▸ **createVenue**(`args`: [CreateVenueParams](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/createvenueparams.md), `opts?`: [ProcedureOpts](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/classes/transactionqueue)*‹*[*Venue*](https://developers.polymath.network/polymesh-sdk-api-reference/classes/venue)*››*

*Defined in* [*src/Settlements.ts:108*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/Settlements.ts#L108)

Create a Venue under the ownership of the signing Identity

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/proceduremethod.md), which means you can call [createVenue.checkAuthorization](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/proceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

| Name    | Type                                                                                                                        |
| ------- | --------------------------------------------------------------------------------------------------------------------------- |
| `args`  | [CreateVenueParams](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/createvenueparams.md) |
| `opts?` | [ProcedureOpts](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/procedureopts.md)         |

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

***

### getInstruction

▸ **getInstruction**(`args`: object): *Promise‹*[*Instruction*](https://developers.polymath.network/polymesh-sdk-api-reference/classes/instruction)*›*

*Defined in* [*src/Settlements.ts:86*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/Settlements.ts#L86)

Retrieve an Instruction by its ID

**Parameters:**

▪ **args**: *object*

| Name | Type      |
| ---- | --------- |
| `id` | BigNumber |

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

***

### getVenue

▸ **getVenue**(`args`: object): *Promise‹*[*Venue*](https://developers.polymath.network/polymesh-sdk-api-reference/classes/venue)*›*

*Defined in* [*src/Settlements.ts:65*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/Settlements.ts#L65)

Retrieve a Venue by its ID

**Parameters:**

▪ **args**: *object*

| Name | Type      |
| ---- | --------- |
| `id` | BigNumber |

**Returns:** *Promise‹*[*Venue*](https://developers.polymath.network/polymesh-sdk-api-reference/classes/venue)*›*
