Skip to main content
Flex API

Flex API

Namespaces

Type Aliases

EscrowAccountData

EscrowAccountData = object
Defined in: types.ts:39 Decoded on-chain state of a Flex escrow account.

Properties

bump
bump: number
Defined in: types.ts:51
deadmanTimeoutSlots
deadmanTimeoutSlots: bigint
Defined in: types.ts:47
facilitator
facilitator: Address
Defined in: types.ts:42
index
index: bigint
Defined in: types.ts:43
lastActivitySlot
lastActivitySlot: bigint
Defined in: types.ts:48
maxSessionKeys
maxSessionKeys: number
Defined in: types.ts:49
mintCount
mintCount: bigint
Defined in: types.ts:45
owner
owner: Address
Defined in: types.ts:41
pendingCount
pendingCount: bigint
Defined in: types.ts:44
refundTimeoutSlots
refundTimeoutSlots: bigint
Defined in: types.ts:46
sessionKeyCount
sessionKeyCount: number
Defined in: types.ts:50
version
version: number
Defined in: types.ts:40

FlexError

FlexError = typeof FLEX_ERROR__AUTHORIZATION_EXPIRED | typeof FLEX_ERROR__DEADMAN_NOT_EXPIRED | typeof FLEX_ERROR__DEADMAN_TIMEOUT_TOO_LONG | typeof FLEX_ERROR__DEADMAN_TIMEOUT_TOO_SHORT | typeof FLEX_ERROR__DEADMAN_TOO_CLOSE_TO_REFUND | typeof FLEX_ERROR__DUPLICATE_ACCOUNTS | typeof FLEX_ERROR__DUPLICATE_SPLIT_RECIPIENT | typeof FLEX_ERROR__EXPIRY_TOO_FAR | typeof FLEX_ERROR__FINALIZATION_DEADLINE_PASSED | typeof FLEX_ERROR__GRACE_PERIOD_EXCEEDS_REFUND_TIMEOUT | typeof FLEX_ERROR__INSUFFICIENT_BALANCE | typeof FLEX_ERROR__INVALID_ED25519_INSTRUCTION | typeof FLEX_ERROR__INVALID_SIGNATURE | typeof FLEX_ERROR__INVALID_SPLIT_BPS | typeof FLEX_ERROR__INVALID_SPLIT_COUNT | typeof FLEX_ERROR__INVALID_SPLIT_RECIPIENT | typeof FLEX_ERROR__INVALID_TOKEN_ACCOUNT_PAIR | typeof FLEX_ERROR__INVALID_VOID_AUTHORITY | typeof FLEX_ERROR__MINT_LIMIT_REACHED | typeof FLEX_ERROR__OWNER_ONLY | typeof FLEX_ERROR__PENDING_COUNT_MISMATCH | typeof FLEX_ERROR__PENDING_LIMIT_REACHED | typeof FLEX_ERROR__PENDING_SETTLEMENTS_EXIST | typeof FLEX_ERROR__REFUND_AMOUNT_ZERO | typeof FLEX_ERROR__REFUND_EXCEEDS_AMOUNT | typeof FLEX_ERROR__REFUND_TIMEOUT_TOO_LONG | typeof FLEX_ERROR__REFUND_TIMEOUT_TOO_SHORT | typeof FLEX_ERROR__REFUND_WINDOW_EXPIRED | typeof FLEX_ERROR__REFUND_WINDOW_NOT_EXPIRED | typeof FLEX_ERROR__SESSION_KEY_ALREADY_EXPIRED | typeof FLEX_ERROR__SESSION_KEY_COUNT_UNDERFLOW | typeof FLEX_ERROR__SESSION_KEY_EXPIRED | typeof FLEX_ERROR__SESSION_KEY_GRACE_PERIOD_ACTIVE | typeof FLEX_ERROR__SESSION_KEY_LIMIT_REACHED | typeof FLEX_ERROR__SESSION_KEY_REVOKED | typeof FLEX_ERROR__SESSION_KEYS_EXIST | typeof FLEX_ERROR__SESSION_KEY_STILL_ACTIVE | typeof FLEX_ERROR__SETTLE_AMOUNT_ZERO | typeof FLEX_ERROR__SETTLE_EXCEEDS_MAX | typeof FLEX_ERROR__SPLIT_BPS_ZERO | typeof FLEX_ERROR__SPLIT_CALCULATION_OVERFLOW | typeof FLEX_ERROR__UNAUTHORIZED_FACILITATOR | typeof FLEX_ERROR__UNSUPPORTED_ACCOUNT_VERSION | typeof FLEX_ERROR__VOID_CONDITION_NOT_MET
Defined in: generated/errors/flex.ts:106

FlexPaymentPayload

FlexPaymentPayload = typeof FlexPaymentPayload.infer
Defined in: types.ts:13 Runtime validator for the client-submitted Flex payment payload.

FlexPaymentRequirementsExtra

FlexPaymentRequirementsExtra = typeof FlexPaymentRequirementsExtra.infer
Defined in: types.ts:27 Runtime validator for the extra field in Flex payment requirements.

FlexSplitEntry

FlexSplitEntry = typeof FlexSplitEntry.infer
Defined in: types.ts:5 Runtime validator for a single split entry in a Flex payment payload.

PendingSettlementData

PendingSettlementData = object
Defined in: types.ts:68 Decoded on-chain state of a pending settlement awaiting finalization.

Properties

amount
amount: bigint
Defined in: types.ts:72
authorizationId
authorizationId: bigint
Defined in: types.ts:75
bump
bump: number
Defined in: types.ts:81
escrow
escrow: Address
Defined in: types.ts:70
expiresAtSlot
expiresAtSlot: bigint
Defined in: types.ts:76
maxAmount
maxAmount: bigint
Defined in: types.ts:74
mint
mint: Address
Defined in: types.ts:71
originalAmount
originalAmount: bigint
Defined in: types.ts:73
sessionKey
sessionKey: Address
Defined in: types.ts:78
splitCount
splitCount: number
Defined in: types.ts:79
splits
splits: object[]
Defined in: types.ts:80
bps
bps: number
recipient
recipient: Address
submittedAtSlot
submittedAtSlot: bigint
Defined in: types.ts:77
version
version: number
Defined in: types.ts:69

SessionKeyData

SessionKeyData = object
Defined in: types.ts:55 Decoded on-chain state of a session key registered to an escrow.

Properties

active
active: boolean
Defined in: types.ts:61
bump
bump: number
Defined in: types.ts:64
createdAtSlot
createdAtSlot: bigint
Defined in: types.ts:59
escrow
escrow: Address
Defined in: types.ts:57
expiresAtSlot
expiresAtSlot: bigint | null
Defined in: types.ts:60
key
key: Address
Defined in: types.ts:58
revocationGracePeriodSlots
revocationGracePeriodSlots: bigint
Defined in: types.ts:63
revokedAtSlot
revokedAtSlot: bigint | null
Defined in: types.ts:62
version
version: number
Defined in: types.ts:56

SplitEntry

SplitEntry = object
Defined in: generated/types/splitEntry.ts:23

Properties

bps
bps: number
Defined in: generated/types/splitEntry.ts:23
recipient
recipient: Address
Defined in: generated/types/splitEntry.ts:23

SplitInput

SplitInput = object
Defined in: authorization.ts:10 A single split directing a share of a settlement to a token account.

Properties

bps
bps: number
Defined in: authorization.ts:12
recipient
recipient: Address
Defined in: authorization.ts:11

Variables

FLEX_ERROR__AUTHORIZATION_EXPIRED

const FLEX_ERROR__AUTHORIZATION_EXPIRED: 6002 = 0x1772
Defined in: generated/errors/flex.ts:22 AuthorizationExpired: Authorization has expired

FLEX_ERROR__DEADMAN_NOT_EXPIRED

const FLEX_ERROR__DEADMAN_NOT_EXPIRED: 6005 = 0x1775
Defined in: generated/errors/flex.ts:28 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 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 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 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 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 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 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 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 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 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 InvalidEd25519Instruction: Ed25519 instruction malformed or missing

FLEX_ERROR__INVALID_SIGNATURE

const FLEX_ERROR__INVALID_SIGNATURE: 6003 = 0x1773
Defined in: generated/errors/flex.ts:24 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 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 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 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 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 InvalidVoidAuthority: Authority must be escrow owner or facilitator

FLEX_ERROR__MINT_LIMIT_REACHED

const FLEX_ERROR__MINT_LIMIT_REACHED: 6014 = 0x177e
Defined in: generated/errors/flex.ts:46 MintLimitReached: Maximum mints per escrow reached

FLEX_ERROR__OWNER_ONLY

const FLEX_ERROR__OWNER_ONLY: 6036 = 0x1794
Defined in: generated/errors/flex.ts:90 OwnerOnly: Only the escrow owner can create new vault accounts

FLEX_ERROR__PENDING_LIMIT_REACHED

const FLEX_ERROR__PENDING_LIMIT_REACHED: 6013 = 0x177d
Defined in: generated/errors/flex.ts:44 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 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 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 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 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 RefundTimeoutTooShort: Refund timeout below minimum of 150 slots

FLEX_ERROR__REFUND_WINDOW_EXPIRED

const FLEX_ERROR__REFUND_WINDOW_EXPIRED: 6010 = 0x177a
Defined in: generated/errors/flex.ts:38 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 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 SessionKeyAlreadyExpired: Session key expires_at_slot is already in the past

FLEX_ERROR__SESSION_KEY_EXPIRED

const FLEX_ERROR__SESSION_KEY_EXPIRED: 6000 = 0x1770
Defined in: generated/errors/flex.ts:18 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 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 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 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 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 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 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 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 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 SplitCalculationOverflow: Split calculation arithmetic overflow

FLEX_ERROR__UNAUTHORIZED_FACILITATOR

const FLEX_ERROR__UNAUTHORIZED_FACILITATOR: 6006 = 0x1776
Defined in: generated/errors/flex.ts:30 UnauthorizedFacilitator: Signer is not the registered facilitator

FLEX_ERROR__VOID_CONDITION_NOT_MET

const FLEX_ERROR__VOID_CONDITION_NOT_MET: 6040 = 0x1798
Defined in: generated/errors/flex.ts:98 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

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 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 Runtime validator for the extra field in Flex payment requirements.

FlexSplitEntry

const FlexSplitEntry: Type<{ bps: number; recipient: string; }, { }>
Defined in: types.ts:5 Runtime validator for a single split entry in a Flex payment payload.

Functions

createEd25519VerifyInstruction()

createEd25519VerifyInstruction(args): Instruction
Defined in: authorization.ts:97 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 | null>
Defined in: query.ts:106 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 | null> The decoded account data, or null if it does not exist

fetchPendingSettlement()

fetchPendingSettlement(rpc, addr): Promise<PendingSettlementData | null>
Defined in: query.ts:138 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 | null> The decoded settlement data, or null if it does not exist

fetchSessionKey()

fetchSessionKey(rpc, addr): Promise<SessionKeyData | null>
Defined in: query.ts:122 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 | null> The decoded session key data, or null if it does not exist

findEscrowsByFacilitator()

findEscrowsByFacilitator(rpc, facilitator): Promise<object[]>
Defined in: query.ts:201 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:155 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:249 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

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

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

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:152

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

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

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

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

Returns

FixedSizeEncoder<FinalizeInstructionDataArgs>

getFlexErrorMessage()

getFlexErrorMessage(code): string
Defined in: generated/errors/flex.ts:202

Parameters

code
FlexError

Returns

string

getRefundInstruction()

getRefundInstruction<TAccountEscrow, TAccountFacilitator, TAccountPending, TProgramAddress>(input, config?): RefundInstruction<TProgramAddress, TAccountEscrow, TAccountFacilitator, TAccountPending>
Defined in: generated/instructions/refund.ts:119

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

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

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

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

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 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 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