Reclaim
Returns an unclaimed two-party escrow deposit to the depositor. The program moves the escrowed tokens from the vault back to the depositor's associated token account and closes the EscrowDeposit. The fee payer may be the depositor or the recorded sponsor — no separate authority signature is needed beyond the fee payer.
There is no expiry: a deposit can be reclaimed any time before it's claimed (see Expiry & Reclaim).
Program method — reclaim
Derives the escrow PDA, the vault, and the depositor's associated token account, then builds, signs (payer), and sends.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
payer | Keypair | yes | — | The fee payer — the depositor or the sponsor; the only signer. |
mint | #to_s | yes | — | The escrowed mint. |
depositor | #to_s | yes | — | The original depositor; receives the returned tokens (its ATA is derived). |
claim_authority | #to_s | yes | — | The authority the deposit is keyed by; used to derive the escrow PDA. |
token_program_id | String | no | legacy SPL Token | Token program that owns the mint. |
Plus the shared sign: / execute: controls and Solace::Transaction return — see Conventions.
tx = program.reclaim(
payer: depositor,
mint: mint_address,
depositor: depositor.address,
claim_authority: claim_authority.address
)
connection.wait_for_confirmed_signature { tx.signature }Composer — ZarTrustlessEscrowReclaimComposer
The escrow PDA, vault, and depositor token account must be resolved first.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
mint | #to_s | yes | — | The escrowed mint. |
depositor | #to_s | yes | — | The original depositor (receives the tokens). |
depositor_token_account | #to_s | yes | — | The depositor's destination token account (ATA). |
escrow_deposit | #to_s | yes | — | The EscrowDeposit PDA — from get_escrow_deposit_address. |
program_token_account | #to_s | yes | — | The vault PDA — from get_vault_address. |
fee_payer | #to_s · Keypair | yes | — | Fee payer (depositor or sponsor); writable signer. |
claim_authority | #to_s | yes | — | Authority used to derive the escrow PDA. |
program_id | #to_s | no | mainnet PROGRAM_ID | The escrow program id. |
token_program_id | #to_s | no | legacy SPL Token | Token program that owns the mint. |
escrow_deposit, = program.get_escrow_deposit_address(claim_authority: claim_authority.address)
vault, = program.get_vault_address(mint: mint_address)
depositor_ata, = Solace::Programs::AssociatedTokenAccount.get_address(
owner: depositor.address, mint: mint_address
)
composer = Solace::Composers::ZarTrustlessEscrowReclaimComposer.new(
mint: mint_address,
depositor: depositor.address,
depositor_token_account: depositor_ata,
escrow_deposit: escrow_deposit,
program_token_account: vault,
fee_payer: depositor.address,
claim_authority: claim_authority.address
)
tx = Solace::TransactionComposer.new(connection:)
.add_instruction(composer)
.set_fee_payer(depositor)
.compose_transaction
tx.sign(depositor)
connection.send_transaction(tx.serialize)Low-level instruction (advanced)
ReclaimInstruction.build encodes the raw instruction.
- Discriminator:
[105, 179, 220, 94, 121, 140, 144, 24] - Encodes (
data):pubkey(claim_authority) - Accounts (in order):
mint·depositor·depositor_token_account(writable) ·escrow_deposit(writable) ·program_token_account(writable) ·fee_payer(writable signer) ·system_program·token_program·associated_token_program.
| Parameter | Type | Required | Description |
|---|---|---|---|
claim_authority | #to_s | yes | Authority used to derive the escrow PDA; encoded into data. |
mint_index | Integer | yes | Index of the mint. |
depositor_index | Integer | yes | Index of the depositor. |
depositor_token_account_index | Integer | yes | Index of the depositor's token account. |
escrow_deposit_index | Integer | yes | Index of the EscrowDeposit PDA. |
program_token_account_index | Integer | yes | Index of the vault. |
fee_payer_index | Integer | yes | Index of the fee payer. |
system_program_index | Integer | yes | Index of the System program. |
token_program_index | Integer | yes | Index of the token program. |
associated_token_program_index | Integer | yes | Index of the Associated Token Account program. |
program_index | Integer | yes | Index of the escrow program. |