Claim
Releases a two-party escrow deposit to a claimant. The claim authority (a required signer) authorizes the transfer; the program moves the escrowed tokens from the vault to the claimant's associated token account and closes the EscrowDeposit, returning its rent to the fee payer.
Program method — claim
Derives the escrow PDA, the vault, and the claimant's associated token account, then builds, signs (payer + claim_authority), and sends.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
payer | Keypair | yes | — | The fee payer; co-signs. Receives the closed deposit's rent. |
mint | #to_s | yes | — | The escrowed mint. |
claim_authority | Keypair | yes | — | The deposit's claim authority; co-signs. |
claimant | #to_s | yes | — | Recipient of the released tokens (its ATA is derived). |
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.
ruby
tx = program.claim(
payer: claim_authority,
mint: mint_address,
claim_authority: claim_authority,
claimant: claimant.address
)
connection.wait_for_confirmed_signature { tx.signature }Composer — ZarTrustlessEscrowClaimComposer
The escrow PDA, vault, and claimant token account must be resolved first.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
mint | #to_s | yes | — | The escrowed mint. |
claim_authority | #to_s | yes | — | The claim authority (readonly signer). |
claimant | #to_s | yes | — | Recipient of the released tokens. |
claimant_token_account | #to_s | yes | — | The claimant'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; writable signer. |
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. |
ruby
escrow_deposit, = program.get_escrow_deposit_address(claim_authority: claim_authority.address)
vault, = program.get_vault_address(mint: mint_address)
claimant_ata, = Solace::Programs::AssociatedTokenAccount.get_address(
owner: claimant.address, mint: mint_address
)
composer = Solace::Composers::ZarTrustlessEscrowClaimComposer.new(
mint: mint_address,
claim_authority: claim_authority.address,
claimant: claimant.address,
claimant_token_account: claimant_ata,
escrow_deposit: escrow_deposit,
program_token_account: vault,
fee_payer: claim_authority.address
)
tx = Solace::TransactionComposer.new(connection:)
.add_instruction(composer)
.set_fee_payer(claim_authority)
.compose_transaction
tx.sign(claim_authority)
connection.send_transaction(tx.serialize)Low-level instruction (advanced)
ClaimInstruction.build encodes the raw instruction.
- Discriminator:
[62, 198, 214, 193, 213, 159, 108, 210] - Encodes (
data): discriminator only — no arguments. - Accounts (in order):
mint·claim_authority(readonly signer) ·claimant·claimant_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 |
|---|---|---|---|
mint_index | Integer | yes | Index of the mint. |
claim_authority_index | Integer | yes | Index of the claim authority. |
claimant_index | Integer | yes | Index of the claimant. |
claimant_token_account_index | Integer | yes | Index of the claimant'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. |