Account Types
The program stores two account types. Both are immutable value objects (Data.define) that deserialize the on-chain Borsh layout (after skipping the 8-byte Anchor discriminator). fetch_* returns them.
EscrowDeposit
The two-party escrow record, created by deposit, keyed by the claim authority. Solace::ZarTrustlessEscrow::EscrowDeposit.
| Field | Type | Description |
|---|---|---|
version | Integer (u8) | Escrow deposit version. |
mint | String | Base58 mint of the escrowed tokens. |
depositor | String | Base58 original depositor. |
claim_pubkey | String | Base58 authority that can claim the deposit. |
amount | Integer (u64) | Escrowed amount, in base units. |
sponsor | String, nil | Base58 fee sponsor, or nil if unsponsored. |
ruby
address, = program.get_escrow_deposit_address(claim_authority: claim_authority.address)
deposit = program.fetch_escrow_deposit(address:)
deposit.amount # => 1_000_000
deposit.sponsor # => nilMediatedEscrowDeposit
The three-party escrow record, created by mediated deposit, keyed by the caller's id. Solace::ZarTrustlessEscrow::MediatedEscrowDeposit.
| Field | Type | Description |
|---|---|---|
version | Integer (u8) | Mediated escrow deposit version. |
mint | String | Base58 mint of the escrowed tokens. |
depositor | String | Base58 original depositor. |
mediator | String | Base58 mediator who decides the outcome. |
beneficiary | String | Base58 beneficiary the mediator may release to. |
amount | Integer (u64) | Escrowed amount, in base units. |
rent_collector | String, nil | Base58 account that collects rent on close, or nil. |
expires_at | Integer, nil | Unix timestamp after which the depositor may reclaim, or nil. |
ruby
address, = program.get_mediated_escrow_deposit_address(id:)
escrow = program.fetch_mediated_escrow_deposit(address:)
escrow.mediator # => "9xQ…"
escrow.expires_at # => 1_780_000_000 or nil