> ## Documentation Index
> Fetch the complete documentation index at: https://docs.faremeter.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Flex API Reference

> API reference documentation for the Flex Payment Scheme SDK

**Flex API**

***

# Flex API

## Namespaces

* [facilitator](/api/flex-solana.src.Namespace.facilitator.md)

## Type Aliases

### EscrowAccountData

> **EscrowAccountData** = `object`

Defined in: [types.ts:39](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L39)

Decoded on-chain state of a Flex escrow account.

#### Properties

##### bump

> **bump**: `number`

Defined in: [types.ts:52](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L52)

##### deadmanTimeoutSlots

> **deadmanTimeoutSlots**: `bigint`

Defined in: [types.ts:48](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L48)

##### facilitator

> **facilitator**: `Address`

Defined in: [types.ts:42](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L42)

##### index

> **index**: `bigint`

Defined in: [types.ts:43](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L43)

##### lastActivitySlot

> **lastActivitySlot**: `bigint`

Defined in: [types.ts:49](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L49)

##### maxPending

> **maxPending**: `number`

Defined in: [types.ts:45](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L45)

##### maxSessionKeys

> **maxSessionKeys**: `number`

Defined in: [types.ts:50](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L50)

##### mintCount

> **mintCount**: `bigint`

Defined in: [types.ts:46](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L46)

##### owner

> **owner**: `Address`

Defined in: [types.ts:41](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L41)

##### pendingCount

> **pendingCount**: `number`

Defined in: [types.ts:44](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L44)

##### refundTimeoutSlots

> **refundTimeoutSlots**: `bigint`

Defined in: [types.ts:47](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L47)

##### sessionKeyCount

> **sessionKeyCount**: `number`

Defined in: [types.ts:51](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L51)

##### version

> **version**: `number`

Defined in: [types.ts:40](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L40)

***

### FlexError

> **FlexError** = *typeof* [`FLEX_ERROR__AUTHORIZATION_EXPIRED`](#flex_error__authorization_expired) | *typeof* [`FLEX_ERROR__DEADMAN_NOT_EXPIRED`](#flex_error__deadman_not_expired) | *typeof* [`FLEX_ERROR__DEADMAN_TIMEOUT_TOO_LONG`](#flex_error__deadman_timeout_too_long) | *typeof* [`FLEX_ERROR__DEADMAN_TIMEOUT_TOO_SHORT`](#flex_error__deadman_timeout_too_short) | *typeof* [`FLEX_ERROR__DEADMAN_TOO_CLOSE_TO_REFUND`](#flex_error__deadman_too_close_to_refund) | *typeof* [`FLEX_ERROR__DUPLICATE_ACCOUNTS`](#flex_error__duplicate_accounts) | *typeof* [`FLEX_ERROR__DUPLICATE_SPLIT_RECIPIENT`](#flex_error__duplicate_split_recipient) | *typeof* [`FLEX_ERROR__EXPIRY_TOO_FAR`](#flex_error__expiry_too_far) | *typeof* [`FLEX_ERROR__FINALIZATION_DEADLINE_PASSED`](#flex_error__finalization_deadline_passed) | *typeof* [`FLEX_ERROR__GRACE_PERIOD_EXCEEDS_REFUND_TIMEOUT`](#flex_error__grace_period_exceeds_refund_timeout) | *typeof* [`FLEX_ERROR__INSUFFICIENT_BALANCE`](#flex_error__insufficient_balance) | *typeof* [`FLEX_ERROR__INVALID_ED25519_INSTRUCTION`](#flex_error__invalid_ed25519_instruction) | *typeof* [`FLEX_ERROR__INVALID_SIGNATURE`](#flex_error__invalid_signature) | *typeof* [`FLEX_ERROR__INVALID_SPLIT_BPS`](#flex_error__invalid_split_bps) | *typeof* [`FLEX_ERROR__INVALID_SPLIT_COUNT`](#flex_error__invalid_split_count) | *typeof* [`FLEX_ERROR__INVALID_SPLIT_RECIPIENT`](#flex_error__invalid_split_recipient) | *typeof* [`FLEX_ERROR__INVALID_TOKEN_ACCOUNT_PAIR`](#flex_error__invalid_token_account_pair) | *typeof* [`FLEX_ERROR__INVALID_VOID_AUTHORITY`](#flex_error__invalid_void_authority) | *typeof* [`FLEX_ERROR__MAX_PENDING_TOO_LARGE`](#flex_error__max_pending_too_large) | *typeof* [`FLEX_ERROR__MAX_PENDING_ZERO`](#flex_error__max_pending_zero) | *typeof* [`FLEX_ERROR__MINT_LIMIT_REACHED`](#flex_error__mint_limit_reached) | *typeof* [`FLEX_ERROR__OWNER_ONLY`](#flex_error__owner_only) | *typeof* [`FLEX_ERROR__PENDING_COUNT_MISMATCH`](#flex_error__pending_count_mismatch) | *typeof* [`FLEX_ERROR__PENDING_LIMIT_REACHED`](#flex_error__pending_limit_reached) | *typeof* [`FLEX_ERROR__PENDING_SETTLEMENTS_EXIST`](#flex_error__pending_settlements_exist) | *typeof* [`FLEX_ERROR__REFUND_AMOUNT_ZERO`](#flex_error__refund_amount_zero) | *typeof* [`FLEX_ERROR__REFUND_EXCEEDS_AMOUNT`](#flex_error__refund_exceeds_amount) | *typeof* [`FLEX_ERROR__REFUND_TIMEOUT_TOO_LONG`](#flex_error__refund_timeout_too_long) | *typeof* [`FLEX_ERROR__REFUND_TIMEOUT_TOO_SHORT`](#flex_error__refund_timeout_too_short) | *typeof* [`FLEX_ERROR__REFUND_WINDOW_EXPIRED`](#flex_error__refund_window_expired) | *typeof* [`FLEX_ERROR__REFUND_WINDOW_NOT_EXPIRED`](#flex_error__refund_window_not_expired) | *typeof* [`FLEX_ERROR__SESSION_KEY_ALREADY_EXPIRED`](#flex_error__session_key_already_expired) | *typeof* [`FLEX_ERROR__SESSION_KEY_COUNT_UNDERFLOW`](#flex_error__session_key_count_underflow) | *typeof* [`FLEX_ERROR__SESSION_KEY_EXPIRED`](#flex_error__session_key_expired) | *typeof* [`FLEX_ERROR__SESSION_KEY_GRACE_PERIOD_ACTIVE`](#flex_error__session_key_grace_period_active) | *typeof* [`FLEX_ERROR__SESSION_KEY_LIMIT_REACHED`](#flex_error__session_key_limit_reached) | *typeof* [`FLEX_ERROR__SESSION_KEY_REVOKED`](#flex_error__session_key_revoked) | *typeof* [`FLEX_ERROR__SESSION_KEYS_EXIST`](#flex_error__session_keys_exist) | *typeof* [`FLEX_ERROR__SESSION_KEY_STILL_ACTIVE`](#flex_error__session_key_still_active) | *typeof* [`FLEX_ERROR__SETTLE_AMOUNT_ZERO`](#flex_error__settle_amount_zero) | *typeof* [`FLEX_ERROR__SETTLE_EXCEEDS_MAX`](#flex_error__settle_exceeds_max) | *typeof* [`FLEX_ERROR__SPLIT_BPS_ZERO`](#flex_error__split_bps_zero) | *typeof* [`FLEX_ERROR__SPLIT_CALCULATION_OVERFLOW`](#flex_error__split_calculation_overflow) | *typeof* [`FLEX_ERROR__UNAUTHORIZED_FACILITATOR`](#flex_error__unauthorized_facilitator) | *typeof* [`FLEX_ERROR__UNSUPPORTED_ACCOUNT_VERSION`](#flex_error__unsupported_account_version) | *typeof* [`FLEX_ERROR__VOID_CONDITION_NOT_MET`](#flex_error__void_condition_not_met)

Defined in: [generated/errors/flex.ts:110](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L110)

***

### FlexPaymentPayload

> **FlexPaymentPayload** = *typeof* `FlexPaymentPayload.infer`

Defined in: [types.ts:13](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L13)

Runtime validator for the client-submitted Flex payment payload.

***

### FlexPaymentRequirementsExtra

> **FlexPaymentRequirementsExtra** = *typeof* `FlexPaymentRequirementsExtra.infer`

Defined in: [types.ts:27](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L27)

Runtime validator for the `extra` field in Flex payment requirements.

***

### FlexSplitEntry

> **FlexSplitEntry** = *typeof* `FlexSplitEntry.infer`

Defined in: [types.ts:5](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L5)

Runtime validator for a single split entry in a Flex payment payload.

***

### PendingSettlementData

> **PendingSettlementData** = `object`

Defined in: [types.ts:69](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L69)

Decoded on-chain state of a pending settlement awaiting finalization.

#### Properties

##### amount

> **amount**: `bigint`

Defined in: [types.ts:73](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L73)

##### authorizationId

> **authorizationId**: `bigint`

Defined in: [types.ts:76](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L76)

##### bump

> **bump**: `number`

Defined in: [types.ts:82](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L82)

##### escrow

> **escrow**: `Address`

Defined in: [types.ts:71](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L71)

##### expiresAtSlot

> **expiresAtSlot**: `bigint`

Defined in: [types.ts:77](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L77)

##### maxAmount

> **maxAmount**: `bigint`

Defined in: [types.ts:75](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L75)

##### mint

> **mint**: `Address`

Defined in: [types.ts:72](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L72)

##### originalAmount

> **originalAmount**: `bigint`

Defined in: [types.ts:74](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L74)

##### sessionKey

> **sessionKey**: `Address`

Defined in: [types.ts:79](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L79)

##### splitCount

> **splitCount**: `number`

Defined in: [types.ts:80](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L80)

##### splits

> **splits**: `object`\[]

Defined in: [types.ts:81](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L81)

###### bps

> **bps**: `number`

###### recipient

> **recipient**: `Address`

##### submittedAtSlot

> **submittedAtSlot**: `bigint`

Defined in: [types.ts:78](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L78)

##### version

> **version**: `number`

Defined in: [types.ts:70](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L70)

***

### SessionKeyData

> **SessionKeyData** = `object`

Defined in: [types.ts:56](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L56)

Decoded on-chain state of a session key registered to an escrow.

#### Properties

##### active

> **active**: `boolean`

Defined in: [types.ts:62](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L62)

##### bump

> **bump**: `number`

Defined in: [types.ts:65](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L65)

##### createdAtSlot

> **createdAtSlot**: `bigint`

Defined in: [types.ts:60](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L60)

##### escrow

> **escrow**: `Address`

Defined in: [types.ts:58](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L58)

##### expiresAtSlot

> **expiresAtSlot**: `bigint` | `null`

Defined in: [types.ts:61](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L61)

##### key

> **key**: `Address`

Defined in: [types.ts:59](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L59)

##### revocationGracePeriodSlots

> **revocationGracePeriodSlots**: `bigint`

Defined in: [types.ts:64](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L64)

##### revokedAtSlot

> **revokedAtSlot**: `bigint` | `null`

Defined in: [types.ts:63](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L63)

##### version

> **version**: `number`

Defined in: [types.ts:57](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L57)

***

### SplitEntry

> **SplitEntry** = `object`

Defined in: [generated/types/splitEntry.ts:23](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/types/splitEntry.ts#L23)

#### Properties

##### bps

> **bps**: `number`

Defined in: [generated/types/splitEntry.ts:23](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/types/splitEntry.ts#L23)

##### recipient

> **recipient**: `Address`

Defined in: [generated/types/splitEntry.ts:23](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/types/splitEntry.ts#L23)

***

### SplitInput

> **SplitInput** = `object`

Defined in: [authorization.ts:10](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/authorization.ts#L10)

A single split directing a share of a settlement to a token account.

#### Properties

##### bps

> **bps**: `number`

Defined in: [authorization.ts:12](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/authorization.ts#L12)

##### recipient

> **recipient**: `Address`

Defined in: [authorization.ts:11](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/authorization.ts#L11)

## Variables

### FLEX\_ERROR\_\_AUTHORIZATION\_EXPIRED

> `const` **FLEX\_ERROR\_\_AUTHORIZATION\_EXPIRED**: `6002` = `0x1772`

Defined in: [generated/errors/flex.ts:22](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L22)

AuthorizationExpired: Authorization has expired

***

### FLEX\_ERROR\_\_DEADMAN\_NOT\_EXPIRED

> `const` **FLEX\_ERROR\_\_DEADMAN\_NOT\_EXPIRED**: `6005` = `0x1775`

Defined in: [generated/errors/flex.ts:28](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L28)

DeadmanNotExpired: Cannot emergency close before timeout

***

### FLEX\_ERROR\_\_DEADMAN\_TIMEOUT\_TOO\_LONG

> `const` **FLEX\_ERROR\_\_DEADMAN\_TIMEOUT\_TOO\_LONG**: `6034` = `0x1792`

Defined in: [generated/errors/flex.ts:86](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L86)

DeadmanTimeoutTooLong: Deadman timeout exceeds maximum of 2592000 slots

***

### FLEX\_ERROR\_\_DEADMAN\_TIMEOUT\_TOO\_SHORT

> `const` **FLEX\_ERROR\_\_DEADMAN\_TIMEOUT\_TOO\_SHORT**: `6032` = `0x1790`

Defined in: [generated/errors/flex.ts:82](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L82)

DeadmanTimeoutTooShort: Deadman timeout below minimum of 1000 slots

***

### FLEX\_ERROR\_\_DEADMAN\_TOO\_CLOSE\_TO\_REFUND

> `const` **FLEX\_ERROR\_\_DEADMAN\_TOO\_CLOSE\_TO\_REFUND**: `6035` = `0x1793`

Defined in: [generated/errors/flex.ts:88](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L88)

DeadmanTooCloseToRefund: Deadman timeout must be at least 2x refund timeout

***

### FLEX\_ERROR\_\_DUPLICATE\_ACCOUNTS

> `const` **FLEX\_ERROR\_\_DUPLICATE\_ACCOUNTS**: `6017` = `0x1781`

Defined in: [generated/errors/flex.ts:52](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L52)

DuplicateAccounts: Same account passed multiple times

***

### FLEX\_ERROR\_\_DUPLICATE\_SPLIT\_RECIPIENT

> `const` **FLEX\_ERROR\_\_DUPLICATE\_SPLIT\_RECIPIENT**: `6024` = `0x1788`

Defined in: [generated/errors/flex.ts:66](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L66)

DuplicateSplitRecipient: Duplicate recipient in splits

***

### FLEX\_ERROR\_\_EXPIRY\_TOO\_FAR

> `const` **FLEX\_ERROR\_\_EXPIRY\_TOO\_FAR**: `6029` = `0x178d`

Defined in: [generated/errors/flex.ts:76](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L76)

ExpiryTooFar: Authorization expiry exceeds refund timeout

***

### FLEX\_ERROR\_\_FINALIZATION\_DEADLINE\_PASSED

> `const` **FLEX\_ERROR\_\_FINALIZATION\_DEADLINE\_PASSED**: `6039` = `0x1797`

Defined in: [generated/errors/flex.ts:96](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L96)

FinalizationDeadlinePassed: Finalization deadline has passed

***

### FLEX\_ERROR\_\_GRACE\_PERIOD\_EXCEEDS\_REFUND\_TIMEOUT

> `const` **FLEX\_ERROR\_\_GRACE\_PERIOD\_EXCEEDS\_REFUND\_TIMEOUT**: `6043` = `0x179b`

Defined in: [generated/errors/flex.ts:104](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L104)

GracePeriodExceedsRefundTimeout: Grace period must be shorter than the escrow refund timeout

***

### FLEX\_ERROR\_\_INSUFFICIENT\_BALANCE

> `const` **FLEX\_ERROR\_\_INSUFFICIENT\_BALANCE**: `6004` = `0x1774`

Defined in: [generated/errors/flex.ts:26](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L26)

InsufficientBalance: Token account balance insufficient

***

### FLEX\_ERROR\_\_INVALID\_ED25519\_INSTRUCTION

> `const` **FLEX\_ERROR\_\_INVALID\_ED25519\_INSTRUCTION**: `6019` = `0x1783`

Defined in: [generated/errors/flex.ts:56](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L56)

InvalidEd25519Instruction: Ed25519 instruction malformed or missing

***

### FLEX\_ERROR\_\_INVALID\_SIGNATURE

> `const` **FLEX\_ERROR\_\_INVALID\_SIGNATURE**: `6003` = `0x1773`

Defined in: [generated/errors/flex.ts:24](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L24)

InvalidSignature: Ed25519 signature verification failed

***

### FLEX\_ERROR\_\_INVALID\_SPLIT\_BPS

> `const` **FLEX\_ERROR\_\_INVALID\_SPLIT\_BPS**: `6022` = `0x1786`

Defined in: [generated/errors/flex.ts:62](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L62)

InvalidSplitBps: Split bps do not sum to 10000

***

### FLEX\_ERROR\_\_INVALID\_SPLIT\_COUNT

> `const` **FLEX\_ERROR\_\_INVALID\_SPLIT\_COUNT**: `6021` = `0x1785`

Defined in: [generated/errors/flex.ts:60](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L60)

InvalidSplitCount: Split count must be between 1 and 5

***

### FLEX\_ERROR\_\_INVALID\_SPLIT\_RECIPIENT

> `const` **FLEX\_ERROR\_\_INVALID\_SPLIT\_RECIPIENT**: `6020` = `0x1784`

Defined in: [generated/errors/flex.ts:58](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L58)

InvalidSplitRecipient: Recipient is not a valid token account for the specified mint

***

### FLEX\_ERROR\_\_INVALID\_TOKEN\_ACCOUNT\_PAIR

> `const` **FLEX\_ERROR\_\_INVALID\_TOKEN\_ACCOUNT\_PAIR**: `6015` = `0x177f`

Defined in: [generated/errors/flex.ts:48](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L48)

InvalidTokenAccountPair: Token account pair validation failed

***

### FLEX\_ERROR\_\_INVALID\_VOID\_AUTHORITY

> `const` **FLEX\_ERROR\_\_INVALID\_VOID\_AUTHORITY**: `6041` = `0x1799`

Defined in: [generated/errors/flex.ts:100](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L100)

InvalidVoidAuthority: Authority must be escrow owner or facilitator

***

### FLEX\_ERROR\_\_MAX\_PENDING\_TOO\_LARGE

> `const` **FLEX\_ERROR\_\_MAX\_PENDING\_TOO\_LARGE**: `6045` = `0x179d`

Defined in: [generated/errors/flex.ts:108](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L108)

MaxPendingTooLarge: Max pending exceeds protocol limit

***

### FLEX\_ERROR\_\_MAX\_PENDING\_ZERO

> `const` **FLEX\_ERROR\_\_MAX\_PENDING\_ZERO**: `6044` = `0x179c`

Defined in: [generated/errors/flex.ts:106](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L106)

MaxPendingZero: Max pending must be at least 1

***

### FLEX\_ERROR\_\_MINT\_LIMIT\_REACHED

> `const` **FLEX\_ERROR\_\_MINT\_LIMIT\_REACHED**: `6014` = `0x177e`

Defined in: [generated/errors/flex.ts:46](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L46)

MintLimitReached: Maximum mints per escrow reached

***

### FLEX\_ERROR\_\_OWNER\_ONLY

> `const` **FLEX\_ERROR\_\_OWNER\_ONLY**: `6036` = `0x1794`

Defined in: [generated/errors/flex.ts:90](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L90)

OwnerOnly: Only the escrow owner can create new vault accounts

***

### FLEX\_ERROR\_\_PENDING\_COUNT\_MISMATCH

> `const` **FLEX\_ERROR\_\_PENDING\_COUNT\_MISMATCH**: `6012` = `0x177c`

Defined in: [generated/errors/flex.ts:42](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L42)

PendingCountMismatch: Remaining accounts count does not match pending\_count

***

### FLEX\_ERROR\_\_PENDING\_LIMIT\_REACHED

> `const` **FLEX\_ERROR\_\_PENDING\_LIMIT\_REACHED**: `6013` = `0x177d`

Defined in: [generated/errors/flex.ts:44](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L44)

PendingLimitReached: Maximum pending settlements reached

***

### FLEX\_ERROR\_\_PENDING\_SETTLEMENTS\_EXIST

> `const` **FLEX\_ERROR\_\_PENDING\_SETTLEMENTS\_EXIST**: `6008` = `0x1778`

Defined in: [generated/errors/flex.ts:34](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L34)

PendingSettlementsExist: Cannot close escrow with pending settlements

***

### FLEX\_ERROR\_\_REFUND\_AMOUNT\_ZERO

> `const` **FLEX\_ERROR\_\_REFUND\_AMOUNT\_ZERO**: `6030` = `0x178e`

Defined in: [generated/errors/flex.ts:78](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L78)

RefundAmountZero: Refund amount must be greater than zero

***

### FLEX\_ERROR\_\_REFUND\_EXCEEDS\_AMOUNT

> `const` **FLEX\_ERROR\_\_REFUND\_EXCEEDS\_AMOUNT**: `6011` = `0x177b`

Defined in: [generated/errors/flex.ts:40](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L40)

RefundExceedsAmount: Cannot refund more than pending amount

***

### FLEX\_ERROR\_\_REFUND\_TIMEOUT\_TOO\_LONG

> `const` **FLEX\_ERROR\_\_REFUND\_TIMEOUT\_TOO\_LONG**: `6033` = `0x1791`

Defined in: [generated/errors/flex.ts:84](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L84)

RefundTimeoutTooLong: Refund timeout exceeds maximum of 1296000 slots

***

### FLEX\_ERROR\_\_REFUND\_TIMEOUT\_TOO\_SHORT

> `const` **FLEX\_ERROR\_\_REFUND\_TIMEOUT\_TOO\_SHORT**: `6031` = `0x178f`

Defined in: [generated/errors/flex.ts:80](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L80)

RefundTimeoutTooShort: Refund timeout below minimum of 10 slots

***

### FLEX\_ERROR\_\_REFUND\_WINDOW\_EXPIRED

> `const` **FLEX\_ERROR\_\_REFUND\_WINDOW\_EXPIRED**: `6010` = `0x177a`

Defined in: [generated/errors/flex.ts:38](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L38)

RefundWindowExpired: Cannot refund after refund timeout

***

### FLEX\_ERROR\_\_REFUND\_WINDOW\_NOT\_EXPIRED

> `const` **FLEX\_ERROR\_\_REFUND\_WINDOW\_NOT\_EXPIRED**: `6009` = `0x1779`

Defined in: [generated/errors/flex.ts:36](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L36)

RefundWindowNotExpired: Cannot finalize before refund timeout

***

### FLEX\_ERROR\_\_SESSION\_KEY\_ALREADY\_EXPIRED

> `const` **FLEX\_ERROR\_\_SESSION\_KEY\_ALREADY\_EXPIRED**: `6042` = `0x179a`

Defined in: [generated/errors/flex.ts:102](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L102)

SessionKeyAlreadyExpired: Session key expires\_at\_slot is already in the past

***

### FLEX\_ERROR\_\_SESSION\_KEY\_COUNT\_UNDERFLOW

> `const` **FLEX\_ERROR\_\_SESSION\_KEY\_COUNT\_UNDERFLOW**: `6026` = `0x178a`

Defined in: [generated/errors/flex.ts:70](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L70)

SessionKeyCountUnderflow: Session key count underflow

***

### FLEX\_ERROR\_\_SESSION\_KEY\_EXPIRED

> `const` **FLEX\_ERROR\_\_SESSION\_KEY\_EXPIRED**: `6000` = `0x1770`

Defined in: [generated/errors/flex.ts:18](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L18)

SessionKeyExpired: Session key has expired

***

### FLEX\_ERROR\_\_SESSION\_KEY\_GRACE\_PERIOD\_ACTIVE

> `const` **FLEX\_ERROR\_\_SESSION\_KEY\_GRACE\_PERIOD\_ACTIVE**: `6007` = `0x1777`

Defined in: [generated/errors/flex.ts:32](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L32)

SessionKeyGracePeriodActive: Cannot close session key during grace period

***

### FLEX\_ERROR\_\_SESSION\_KEY\_LIMIT\_REACHED

> `const` **FLEX\_ERROR\_\_SESSION\_KEY\_LIMIT\_REACHED**: `6018` = `0x1782`

Defined in: [generated/errors/flex.ts:54](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L54)

SessionKeyLimitReached: Maximum session keys per escrow reached

***

### FLEX\_ERROR\_\_SESSION\_KEY\_REVOKED

> `const` **FLEX\_ERROR\_\_SESSION\_KEY\_REVOKED**: `6001` = `0x1771`

Defined in: [generated/errors/flex.ts:20](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L20)

SessionKeyRevoked: Session key revoked and grace period elapsed

***

### FLEX\_ERROR\_\_SESSION\_KEY\_STILL\_ACTIVE

> `const` **FLEX\_ERROR\_\_SESSION\_KEY\_STILL\_ACTIVE**: `6025` = `0x1789`

Defined in: [generated/errors/flex.ts:68](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L68)

SessionKeyStillActive: Session key must be revoked before closing

***

### FLEX\_ERROR\_\_SESSION\_KEYS\_EXIST

> `const` **FLEX\_ERROR\_\_SESSION\_KEYS\_EXIST**: `6038` = `0x1796`

Defined in: [generated/errors/flex.ts:94](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L94)

SessionKeysExist: Cannot close escrow with active session keys

***

### FLEX\_ERROR\_\_SETTLE\_AMOUNT\_ZERO

> `const` **FLEX\_ERROR\_\_SETTLE\_AMOUNT\_ZERO**: `6028` = `0x178c`

Defined in: [generated/errors/flex.ts:74](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L74)

SettleAmountZero: Settle amount must be greater than zero

***

### FLEX\_ERROR\_\_SETTLE\_EXCEEDS\_MAX

> `const` **FLEX\_ERROR\_\_SETTLE\_EXCEEDS\_MAX**: `6027` = `0x178b`

Defined in: [generated/errors/flex.ts:72](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L72)

SettleExceedsMax: Settle amount exceeds max authorized amount

***

### FLEX\_ERROR\_\_SPLIT\_BPS\_ZERO

> `const` **FLEX\_ERROR\_\_SPLIT\_BPS\_ZERO**: `6023` = `0x1787`

Defined in: [generated/errors/flex.ts:64](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L64)

SplitBpsZero: A split entry has bps of zero

***

### FLEX\_ERROR\_\_SPLIT\_CALCULATION\_OVERFLOW

> `const` **FLEX\_ERROR\_\_SPLIT\_CALCULATION\_OVERFLOW**: `6037` = `0x1795`

Defined in: [generated/errors/flex.ts:92](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L92)

SplitCalculationOverflow: Split calculation arithmetic overflow

***

### FLEX\_ERROR\_\_UNAUTHORIZED\_FACILITATOR

> `const` **FLEX\_ERROR\_\_UNAUTHORIZED\_FACILITATOR**: `6006` = `0x1776`

Defined in: [generated/errors/flex.ts:30](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L30)

UnauthorizedFacilitator: Signer is not the registered facilitator

***

### FLEX\_ERROR\_\_UNSUPPORTED\_ACCOUNT\_VERSION

> `const` **FLEX\_ERROR\_\_UNSUPPORTED\_ACCOUNT\_VERSION**: `6016` = `0x1780`

Defined in: [generated/errors/flex.ts:50](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L50)

UnsupportedAccountVersion: Account version not supported by this program

***

### FLEX\_ERROR\_\_VOID\_CONDITION\_NOT\_MET

> `const` **FLEX\_ERROR\_\_VOID\_CONDITION\_NOT\_MET**: `6040` = `0x1798`

Defined in: [generated/errors/flex.ts:98](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L98)

VoidConditionNotMet: Neither deadman timeout nor finalization deadline has passed

***

### FLEX\_PROGRAM\_ADDRESS

> `const` **FLEX\_PROGRAM\_ADDRESS**: `Address`\<`"EcfUgNgDXmBx4Xns2qZLE54xpM7V1N6PL8MdDW1syujS"`>

Defined in: [generated/programs/flex.ts:99](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/programs/flex.ts#L99)

***

### FlexPaymentPayload

> `const` **FlexPaymentPayload**: `Type`\<\{ `authorizationId`: `string`; `escrow`: `string`; `expiresAtSlot`: `string`; `maxAmount`: `string`; `mint`: `string`; `sessionKey`: `string`; `signature`: `string`; `splits`: `object`\[]; }, \{ }>

Defined in: [types.ts:13](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L13)

Runtime validator for the client-submitted Flex payment payload.

***

### FlexPaymentRequirementsExtra

> `const` **FlexPaymentRequirementsExtra**: `Type`\<\{ `escrow?`: `string`; `facilitator`: `string`; `minGracePeriodSlots?`: `string`; `splits`: `object`\[]; `supportedMints`: `string`\[]; }, \{ }>

Defined in: [types.ts:27](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L27)

Runtime validator for the `extra` field in Flex payment requirements.

***

### FlexSplitEntry

> `const` **FlexSplitEntry**: `Type`\<\{ `bps`: `number`; `recipient`: `string`; }, \{ }>

Defined in: [types.ts:5](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/types.ts#L5)

Runtime validator for a single split entry in a Flex payment payload.

***

### MAX\_DEADMAN\_TIMEOUT\_SLOTS

> `const` **MAX\_DEADMAN\_TIMEOUT\_SLOTS**: `2592000` = `2592000`

Defined in: [generated/constants/index.ts:6](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/constants/index.ts#L6)

This code was AUTOGENERATED from the Anchor IDL.
Please DO NOT EDIT THIS FILE. Re-run `make generate-client` to update it.

***

### MAX\_MINTS

> `const` **MAX\_MINTS**: `8` = `8`

Defined in: [generated/constants/index.ts:7](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/constants/index.ts#L7)

***

### MAX\_PENDING\_LIMIT

> `const` **MAX\_PENDING\_LIMIT**: `65535` = `65535`

Defined in: [generated/constants/index.ts:8](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/constants/index.ts#L8)

***

### MAX\_REFUND\_TIMEOUT\_SLOTS

> `const` **MAX\_REFUND\_TIMEOUT\_SLOTS**: `1296000` = `1296000`

Defined in: [generated/constants/index.ts:9](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/constants/index.ts#L9)

***

### MAX\_SPLITS

> `const` **MAX\_SPLITS**: `5` = `5`

Defined in: [generated/constants/index.ts:10](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/constants/index.ts#L10)

***

### MIN\_DEADMAN\_TIMEOUT\_SLOTS

> `const` **MIN\_DEADMAN\_TIMEOUT\_SLOTS**: `1000` = `1000`

Defined in: [generated/constants/index.ts:11](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/constants/index.ts#L11)

***

### MIN\_REFUND\_TIMEOUT\_SLOTS

> `const` **MIN\_REFUND\_TIMEOUT\_SLOTS**: `10` = `10`

Defined in: [generated/constants/index.ts:12](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/constants/index.ts#L12)

## Functions

### createEd25519VerifyInstruction()

> **createEd25519VerifyInstruction**(`args`): `Instruction`

Defined in: [authorization.ts:97](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/authorization.ts#L97)

Builds an Ed25519 precompile instruction that verifies a payment
authorization signature inline within a Solana transaction.

Header layout:
u8   num\_signatures = 1
u8   padding = 0

Entry layout (one per signature):
u16  signature\_offset
u16  signature\_instruction\_index = 0xFFFF (inline)
u16  public\_key\_offset
u16  public\_key\_instruction\_index = 0xFFFF (inline)
u16  message\_data\_offset
u16  message\_data\_size
u16  message\_instruction\_index = 0xFFFF (inline)

Data:
\[64 bytes] signature
\[32 bytes] public\_key
\[N bytes]  message

#### Parameters

##### args

###### message

`Uint8Array`

###### publicKey

`Address`

###### signature

`Uint8Array`

#### Returns

`Instruction`

***

### fetchEscrowAccount()

> **fetchEscrowAccount**(`rpc`, `addr`): `Promise`\<[`EscrowAccountData`](#escrowaccountdata) | `null`>

Defined in: [query.ts:107](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/query.ts#L107)

Fetches a single escrow account by address.

#### Parameters

##### rpc

`FlexRpc`

Solana RPC client

##### addr

`Address`

On-chain address of the escrow PDA

#### Returns

`Promise`\<[`EscrowAccountData`](#escrowaccountdata) | `null`>

The decoded account data, or `null` if it does not exist

***

### fetchPendingSettlement()

> **fetchPendingSettlement**(`rpc`, `addr`): `Promise`\<[`PendingSettlementData`](#pendingsettlementdata) | `null`>

Defined in: [query.ts:139](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/query.ts#L139)

Fetches a single pending settlement account by address.

#### Parameters

##### rpc

`FlexRpc`

Solana RPC client

##### addr

`Address`

On-chain address of the pending settlement PDA

#### Returns

`Promise`\<[`PendingSettlementData`](#pendingsettlementdata) | `null`>

The decoded settlement data, or `null` if it does not exist

***

### fetchSessionKey()

> **fetchSessionKey**(`rpc`, `addr`): `Promise`\<[`SessionKeyData`](#sessionkeydata) | `null`>

Defined in: [query.ts:123](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/query.ts#L123)

Fetches a single session key account by address.

#### Parameters

##### rpc

`FlexRpc`

Solana RPC client

##### addr

`Address`

On-chain address of the session key PDA

#### Returns

`Promise`\<[`SessionKeyData`](#sessionkeydata) | `null`>

The decoded session key data, or `null` if it does not exist

***

### findEscrowsByFacilitator()

> **findEscrowsByFacilitator**(`rpc`, `facilitator`): `Promise`\<`object`\[]>

Defined in: [query.ts:202](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/query.ts#L202)

Finds all escrow accounts managed by a given facilitator using
`getProgramAccounts` with a discriminator + facilitator filter.

#### Parameters

##### rpc

`FlexRpc`

Solana RPC client

##### facilitator

`Address`

Address of the facilitator

#### Returns

`Promise`\<`object`\[]>

Array of escrow addresses and their decoded data

***

### findEscrowsByOwner()

> **findEscrowsByOwner**(`rpc`, `owner`): `Promise`\<`object`\[]>

Defined in: [query.ts:156](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/query.ts#L156)

Finds all escrow accounts owned by a given wallet using
`getProgramAccounts` with a discriminator + owner filter.

#### Parameters

##### rpc

`FlexRpc`

Solana RPC client

##### owner

`Address`

Wallet address of the escrow owner

#### Returns

`Promise`\<`object`\[]>

Array of escrow addresses and their decoded data

***

### findPendingSettlementsByEscrow()

> **findPendingSettlementsByEscrow**(`rpc`, `escrow`): `Promise`\<`object`\[]>

Defined in: [query.ts:250](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/query.ts#L250)

Finds all pending settlement accounts belonging to an escrow using
`getProgramAccounts` with a discriminator + escrow filter.

#### Parameters

##### rpc

`FlexRpc`

Solana RPC client

##### escrow

`Address`

Address of the parent escrow PDA

#### Returns

`Promise`\<`object`\[]>

Array of pending settlement addresses and their decoded data

***

### findVaultPda()

> **findVaultPda**(`seeds`, `config`): `Promise`\<readonly \[`Address`\<`string`>, `ProgramDerivedAddressBump`]>

Defined in: [generated/pdas/vault.ts:22](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/pdas/vault.ts#L22)

#### Parameters

##### seeds

`VaultSeeds`

##### config

###### programAddress?

`Address`

#### Returns

`Promise`\<readonly \[`Address`\<`string`>, `ProgramDerivedAddressBump`]>

***

### getCloseEscrowInstruction()

> **getCloseEscrowInstruction**\<`TAccountEscrow`, `TAccountOwner`, `TAccountFacilitator`, `TAccountTokenProgram`, `TProgramAddress`>(`input`, `config?`): `CloseEscrowInstruction`\<`TProgramAddress`, `TAccountEscrow`, `TAccountOwner`, `TAccountFacilitator`, `TAccountTokenProgram`>

Defined in: [generated/instructions/closeEscrow.ts:121](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/instructions/closeEscrow.ts#L121)

#### Type Parameters

##### TAccountEscrow

`TAccountEscrow` *extends* `string`

##### TAccountOwner

`TAccountOwner` *extends* `string`

##### TAccountFacilitator

`TAccountFacilitator` *extends* `string`

##### TAccountTokenProgram

`TAccountTokenProgram` *extends* `string`

##### TProgramAddress

`TProgramAddress` *extends* `Address` = `Address`\<`"EcfUgNgDXmBx4Xns2qZLE54xpM7V1N6PL8MdDW1syujS"`>

#### Parameters

##### input

`CloseEscrowInput`\<`TAccountEscrow`, `TAccountOwner`, `TAccountFacilitator`, `TAccountTokenProgram`>

##### config?

###### programAddress?

`TProgramAddress`

#### Returns

`CloseEscrowInstruction`\<`TProgramAddress`, `TAccountEscrow`, `TAccountOwner`, `TAccountFacilitator`, `TAccountTokenProgram`>

***

### getCloseSessionKeyInstruction()

> **getCloseSessionKeyInstruction**\<`TAccountOwner`, `TAccountEscrow`, `TAccountSessionKeyAccount`, `TProgramAddress`>(`input`, `config?`): `CloseSessionKeyInstruction`\<`TProgramAddress`, `TAccountOwner`, `TAccountEscrow`, `TAccountSessionKeyAccount`>

Defined in: [generated/instructions/closeSessionKey.ts:113](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/instructions/closeSessionKey.ts#L113)

#### Type Parameters

##### TAccountOwner

`TAccountOwner` *extends* `string`

##### TAccountEscrow

`TAccountEscrow` *extends* `string`

##### TAccountSessionKeyAccount

`TAccountSessionKeyAccount` *extends* `string`

##### TProgramAddress

`TProgramAddress` *extends* `Address` = `Address`\<`"EcfUgNgDXmBx4Xns2qZLE54xpM7V1N6PL8MdDW1syujS"`>

#### Parameters

##### input

`CloseSessionKeyInput`\<`TAccountOwner`, `TAccountEscrow`, `TAccountSessionKeyAccount`>

##### config?

###### programAddress?

`TProgramAddress`

#### Returns

`CloseSessionKeyInstruction`\<`TProgramAddress`, `TAccountOwner`, `TAccountEscrow`, `TAccountSessionKeyAccount`>

***

### getCreateEscrowInstructionAsync()

> **getCreateEscrowInstructionAsync**\<`TAccountOwner`, `TAccountEscrow`, `TAccountSystemProgram`, `TProgramAddress`>(`input`, `config?`): `Promise`\<`CreateEscrowInstruction`\<`TProgramAddress`, `TAccountOwner`, `TAccountEscrow`, `TAccountSystemProgram`, \[]>>

Defined in: [generated/instructions/createEscrow.ts:159](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/instructions/createEscrow.ts#L159)

#### Type Parameters

##### TAccountOwner

`TAccountOwner` *extends* `string`

##### TAccountEscrow

`TAccountEscrow` *extends* `string`

##### TAccountSystemProgram

`TAccountSystemProgram` *extends* `string`

##### TProgramAddress

`TProgramAddress` *extends* `Address` = `Address`\<`"EcfUgNgDXmBx4Xns2qZLE54xpM7V1N6PL8MdDW1syujS"`>

#### Parameters

##### input

`CreateEscrowAsyncInput`\<`TAccountOwner`, `TAccountEscrow`, `TAccountSystemProgram`>

##### config?

###### programAddress?

`TProgramAddress`

#### Returns

`Promise`\<`CreateEscrowInstruction`\<`TProgramAddress`, `TAccountOwner`, `TAccountEscrow`, `TAccountSystemProgram`, \[]>>

***

### getDepositInstructionAsync()

> **getDepositInstructionAsync**\<`TAccountDepositor`, `TAccountEscrow`, `TAccountMint`, `TAccountVault`, `TAccountSource`, `TAccountTokenProgram`, `TAccountSystemProgram`, `TProgramAddress`>(`input`, `config?`): `Promise`\<`DepositInstruction`\<`TProgramAddress`, `TAccountDepositor`, `TAccountEscrow`, `TAccountMint`, `TAccountVault`, `TAccountSource`, `TAccountTokenProgram`, `TAccountSystemProgram`, \[]>>

Defined in: [generated/instructions/deposit.ts:149](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/instructions/deposit.ts#L149)

#### Type Parameters

##### TAccountDepositor

`TAccountDepositor` *extends* `string`

##### TAccountEscrow

`TAccountEscrow` *extends* `string`

##### TAccountMint

`TAccountMint` *extends* `string`

##### TAccountVault

`TAccountVault` *extends* `string`

##### TAccountSource

`TAccountSource` *extends* `string`

##### TAccountTokenProgram

`TAccountTokenProgram` *extends* `string`

##### TAccountSystemProgram

`TAccountSystemProgram` *extends* `string`

##### TProgramAddress

`TProgramAddress` *extends* `Address` = `Address`\<`"EcfUgNgDXmBx4Xns2qZLE54xpM7V1N6PL8MdDW1syujS"`>

#### Parameters

##### input

`DepositAsyncInput`\<`TAccountDepositor`, `TAccountEscrow`, `TAccountMint`, `TAccountVault`, `TAccountSource`, `TAccountTokenProgram`, `TAccountSystemProgram`>

##### config?

###### programAddress?

`TProgramAddress`

#### Returns

`Promise`\<`DepositInstruction`\<`TProgramAddress`, `TAccountDepositor`, `TAccountEscrow`, `TAccountMint`, `TAccountVault`, `TAccountSource`, `TAccountTokenProgram`, `TAccountSystemProgram`, \[]>>

***

### getEmergencyCloseInstruction()

> **getEmergencyCloseInstruction**\<`TAccountEscrow`, `TAccountOwner`, `TAccountTokenProgram`, `TProgramAddress`>(`input`, `config?`): `EmergencyCloseInstruction`\<`TProgramAddress`, `TAccountEscrow`, `TAccountOwner`, `TAccountTokenProgram`>

Defined in: [generated/instructions/emergencyClose.ts:115](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/instructions/emergencyClose.ts#L115)

#### Type Parameters

##### TAccountEscrow

`TAccountEscrow` *extends* `string`

##### TAccountOwner

`TAccountOwner` *extends* `string`

##### TAccountTokenProgram

`TAccountTokenProgram` *extends* `string`

##### TProgramAddress

`TProgramAddress` *extends* `Address` = `Address`\<`"EcfUgNgDXmBx4Xns2qZLE54xpM7V1N6PL8MdDW1syujS"`>

#### Parameters

##### input

`EmergencyCloseInput`\<`TAccountEscrow`, `TAccountOwner`, `TAccountTokenProgram`>

##### config?

###### programAddress?

`TProgramAddress`

#### Returns

`EmergencyCloseInstruction`\<`TProgramAddress`, `TAccountEscrow`, `TAccountOwner`, `TAccountTokenProgram`>

***

### getFinalizeInstruction()

> **getFinalizeInstruction**\<`TAccountEscrow`, `TAccountFacilitator`, `TAccountPending`, `TAccountTokenAccount`, `TAccountTokenProgram`, `TProgramAddress`>(`input`, `config?`): `FinalizeInstruction`\<`TProgramAddress`, `TAccountEscrow`, `TAccountFacilitator`, `TAccountPending`, `TAccountTokenAccount`, `TAccountTokenProgram`>

Defined in: [generated/instructions/finalize.ts:119](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/instructions/finalize.ts#L119)

#### Type Parameters

##### TAccountEscrow

`TAccountEscrow` *extends* `string`

##### TAccountFacilitator

`TAccountFacilitator` *extends* `string`

##### TAccountPending

`TAccountPending` *extends* `string`

##### TAccountTokenAccount

`TAccountTokenAccount` *extends* `string`

##### TAccountTokenProgram

`TAccountTokenProgram` *extends* `string`

##### TProgramAddress

`TProgramAddress` *extends* `Address` = `Address`\<`"EcfUgNgDXmBx4Xns2qZLE54xpM7V1N6PL8MdDW1syujS"`>

#### Parameters

##### input

`FinalizeInput`\<`TAccountEscrow`, `TAccountFacilitator`, `TAccountPending`, `TAccountTokenAccount`, `TAccountTokenProgram`>

##### config?

###### programAddress?

`TProgramAddress`

#### Returns

`FinalizeInstruction`\<`TProgramAddress`, `TAccountEscrow`, `TAccountFacilitator`, `TAccountPending`, `TAccountTokenAccount`, `TAccountTokenProgram`>

***

### getFinalizeInstructionDataEncoder()

> **getFinalizeInstructionDataEncoder**(): `FixedSizeEncoder`\<`FinalizeInstructionDataArgs`>

Defined in: [generated/instructions/finalize.ts:82](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/instructions/finalize.ts#L82)

#### Returns

`FixedSizeEncoder`\<`FinalizeInstructionDataArgs`>

***

### getFlexErrorMessage()

> **getFlexErrorMessage**(`code`): `string`

Defined in: [generated/errors/flex.ts:210](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/errors/flex.ts#L210)

#### Parameters

##### code

[`FlexError`](#flexerror)

#### Returns

`string`

***

### getRefundInstruction()

> **getRefundInstruction**\<`TAccountEscrow`, `TAccountFacilitator`, `TAccountPending`, `TProgramAddress`>(`input`, `config?`): `RefundInstruction`\<`TProgramAddress`, `TAccountEscrow`, `TAccountFacilitator`, `TAccountPending`>

Defined in: [generated/instructions/refund.ts:119](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/instructions/refund.ts#L119)

#### Type Parameters

##### TAccountEscrow

`TAccountEscrow` *extends* `string`

##### TAccountFacilitator

`TAccountFacilitator` *extends* `string`

##### TAccountPending

`TAccountPending` *extends* `string`

##### TProgramAddress

`TProgramAddress` *extends* `Address` = `Address`\<`"EcfUgNgDXmBx4Xns2qZLE54xpM7V1N6PL8MdDW1syujS"`>

#### Parameters

##### input

`RefundInput`\<`TAccountEscrow`, `TAccountFacilitator`, `TAccountPending`>

##### config?

###### programAddress?

`TProgramAddress`

#### Returns

`RefundInstruction`\<`TProgramAddress`, `TAccountEscrow`, `TAccountFacilitator`, `TAccountPending`>

***

### getRegisterSessionKeyInstructionAsync()

> **getRegisterSessionKeyInstructionAsync**\<`TAccountOwner`, `TAccountEscrow`, `TAccountSessionKeyAccount`, `TAccountSystemProgram`, `TProgramAddress`>(`input`, `config?`): `Promise`\<`RegisterSessionKeyInstruction`\<`TProgramAddress`, `TAccountOwner`, `TAccountEscrow`, `TAccountSessionKeyAccount`, `TAccountSystemProgram`, \[]>>

Defined in: [generated/instructions/registerSessionKey.ts:153](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/instructions/registerSessionKey.ts#L153)

#### Type Parameters

##### TAccountOwner

`TAccountOwner` *extends* `string`

##### TAccountEscrow

`TAccountEscrow` *extends* `string`

##### TAccountSessionKeyAccount

`TAccountSessionKeyAccount` *extends* `string`

##### TAccountSystemProgram

`TAccountSystemProgram` *extends* `string`

##### TProgramAddress

`TProgramAddress` *extends* `Address` = `Address`\<`"EcfUgNgDXmBx4Xns2qZLE54xpM7V1N6PL8MdDW1syujS"`>

#### Parameters

##### input

`RegisterSessionKeyAsyncInput`\<`TAccountOwner`, `TAccountEscrow`, `TAccountSessionKeyAccount`, `TAccountSystemProgram`>

##### config?

###### programAddress?

`TProgramAddress`

#### Returns

`Promise`\<`RegisterSessionKeyInstruction`\<`TProgramAddress`, `TAccountOwner`, `TAccountEscrow`, `TAccountSessionKeyAccount`, `TAccountSystemProgram`, \[]>>

***

### getRevokeSessionKeyInstruction()

> **getRevokeSessionKeyInstruction**\<`TAccountOwner`, `TAccountEscrow`, `TAccountSessionKeyAccount`, `TProgramAddress`>(`input`, `config?`): `RevokeSessionKeyInstruction`\<`TProgramAddress`, `TAccountOwner`, `TAccountEscrow`, `TAccountSessionKeyAccount`>

Defined in: [generated/instructions/revokeSessionKey.ts:114](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/instructions/revokeSessionKey.ts#L114)

#### Type Parameters

##### TAccountOwner

`TAccountOwner` *extends* `string`

##### TAccountEscrow

`TAccountEscrow` *extends* `string`

##### TAccountSessionKeyAccount

`TAccountSessionKeyAccount` *extends* `string`

##### TProgramAddress

`TProgramAddress` *extends* `Address` = `Address`\<`"EcfUgNgDXmBx4Xns2qZLE54xpM7V1N6PL8MdDW1syujS"`>

#### Parameters

##### input

`RevokeSessionKeyInput`\<`TAccountOwner`, `TAccountEscrow`, `TAccountSessionKeyAccount`>

##### config?

###### programAddress?

`TProgramAddress`

#### Returns

`RevokeSessionKeyInstruction`\<`TProgramAddress`, `TAccountOwner`, `TAccountEscrow`, `TAccountSessionKeyAccount`>

***

### getSubmitAuthorizationInstructionAsync()

> **getSubmitAuthorizationInstructionAsync**\<`TAccountEscrow`, `TAccountFacilitator`, `TAccountSessionKey`, `TAccountTokenAccount`, `TAccountPending`, `TAccountInstructionsSysvar`, `TAccountSystemProgram`, `TProgramAddress`>(`input`, `config?`): `Promise`\<`SubmitAuthorizationInstruction`\<`TProgramAddress`, `TAccountEscrow`, `TAccountFacilitator`, `TAccountSessionKey`, `TAccountTokenAccount`, `TAccountPending`, `TAccountInstructionsSysvar`, `TAccountSystemProgram`, \[]>>

Defined in: [generated/instructions/submitAuthorization.ts:191](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/instructions/submitAuthorization.ts#L191)

#### Type Parameters

##### TAccountEscrow

`TAccountEscrow` *extends* `string`

##### TAccountFacilitator

`TAccountFacilitator` *extends* `string`

##### TAccountSessionKey

`TAccountSessionKey` *extends* `string`

##### TAccountTokenAccount

`TAccountTokenAccount` *extends* `string`

##### TAccountPending

`TAccountPending` *extends* `string`

##### TAccountInstructionsSysvar

`TAccountInstructionsSysvar` *extends* `string`

##### TAccountSystemProgram

`TAccountSystemProgram` *extends* `string`

##### TProgramAddress

`TProgramAddress` *extends* `Address` = `Address`\<`"EcfUgNgDXmBx4Xns2qZLE54xpM7V1N6PL8MdDW1syujS"`>

#### Parameters

##### input

`SubmitAuthorizationAsyncInput`\<`TAccountEscrow`, `TAccountFacilitator`, `TAccountSessionKey`, `TAccountTokenAccount`, `TAccountPending`, `TAccountInstructionsSysvar`, `TAccountSystemProgram`>

##### config?

###### programAddress?

`TProgramAddress`

#### Returns

`Promise`\<`SubmitAuthorizationInstruction`\<`TProgramAddress`, `TAccountEscrow`, `TAccountFacilitator`, `TAccountSessionKey`, `TAccountTokenAccount`, `TAccountPending`, `TAccountInstructionsSysvar`, `TAccountSystemProgram`, \[]>>

***

### getVoidPendingInstruction()

> **getVoidPendingInstruction**\<`TAccountEscrow`, `TAccountAuthority`, `TAccountFacilitator`, `TAccountPending`, `TProgramAddress`>(`input`, `config?`): `VoidPendingInstruction`\<`TProgramAddress`, `TAccountEscrow`, `TAccountAuthority`, `TAccountFacilitator`, `TAccountPending`>

Defined in: [generated/instructions/voidPending.ts:117](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/generated/instructions/voidPending.ts#L117)

#### Type Parameters

##### TAccountEscrow

`TAccountEscrow` *extends* `string`

##### TAccountAuthority

`TAccountAuthority` *extends* `string`

##### TAccountFacilitator

`TAccountFacilitator` *extends* `string`

##### TAccountPending

`TAccountPending` *extends* `string`

##### TProgramAddress

`TProgramAddress` *extends* `Address` = `Address`\<`"EcfUgNgDXmBx4Xns2qZLE54xpM7V1N6PL8MdDW1syujS"`>

#### Parameters

##### input

`VoidPendingInput`\<`TAccountEscrow`, `TAccountAuthority`, `TAccountFacilitator`, `TAccountPending`>

##### config?

###### programAddress?

`TProgramAddress`

#### Returns

`VoidPendingInstruction`\<`TProgramAddress`, `TAccountEscrow`, `TAccountAuthority`, `TAccountFacilitator`, `TAccountPending`>

***

### serializePaymentAuthorization()

> **serializePaymentAuthorization**(`args`): `Uint8Array`\<`ArrayBuffer`>

Defined in: [authorization.ts:33](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/authorization.ts#L33)

Serializes a payment authorization into the binary format expected
by the Flex on-chain program for Ed25519 signature verification.

#### Parameters

##### args

`SerializePaymentAuthorizationArgs`

Authorization fields to serialize

#### Returns

`Uint8Array`\<`ArrayBuffer`>

The serialized message bytes

***

### signPaymentAuthorization()

> **signPaymentAuthorization**(`args`): `Promise`\<`Uint8Array`\<`ArrayBuffer`>>

Defined in: [authorization.ts:63](https://github.com/faremeter/flex/blob/main/packages/flex-solana/src/authorization.ts#L63)

Signs a serialized payment authorization using the Web Crypto Ed25519 API.

#### Parameters

##### args

The message bytes and the session key pair

###### keyPair

`CryptoKeyPair`

###### message

`Uint8Array`\<`ArrayBuffer`>

#### Returns

`Promise`\<`Uint8Array`\<`ArrayBuffer`>>

The 64-byte Ed25519 signature


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.