Skip to main content
Claimable balances allow you to send payments that can be claimed by the recipient based on specific conditions. This is useful for escrow-like functionality, conditional payments, or time-locked transfers.

Setup

For the following examples we will use these accounts:

Basic Examples

Unconditional Claimable Balance

Create a claimable balance that can be claimed immediately by the recipient:
You can also explicitly specify unconditional:

Multiple Claimants

Create a claimable balance that can be claimed by any of multiple recipients:

Time-Based Predicates

Before Absolute Time

Create a claimable balance that must be claimed before a specific date:

Before Relative Time

Create a claimable balance that must be claimed within 1 hour (3600 seconds) from creation:

Logical Predicates

Not Predicate

Create a claimable balance that can be claimed after a certain time (NOT before relative time):
This means: “Can be claimed, but NOT before 2 hours have passed” (effectively: can be claimed after 2 hours).

And Predicate

Create a claimable balance with multiple conditions that must ALL be true:
This means: “Can be claimed before Dec 31, 2024 AND after 1 day has passed”.

Or Predicate

Create a claimable balance where either condition can be true:
This means: “Can be claimed within 1 hour OR after June 1, 2024”.

Complex Examples

Mixed Claimants with Different Predicates

Create a claimable balance with multiple claimants having different claim conditions:
This creates a balance where:
  • Bob can claim within 1 hour
  • Charlie can claim after 1 day has passed

Escrow-Style Payment

Create an escrow where the recipient has 30 days to claim, otherwise it returns to sender:
This means:
  • Bob can claim within 30 days
  • Alice can reclaim after 30 days if Bob hasn’t claimed

Custom Asset Claimable Balance

Create a claimable balance for a custom asset:
cookbooktest.ignore

Understanding Predicates

Note: Predicates must be valid JSON, so you must use proper quoting and escaping.

Predicate Types

Time Format Notes

  • Absolute times: Use Unix timestamps (seconds since epoch)
  • Relative times: Seconds from claimable balance creation time
  • Timestamps: Must be in the future when creating the balance

Common Use Cases

1. Simple Payment with Deadline

2. Delayed Payment

3. Emergency Fund

Notes

  • --amount: Amount in stroops (1 XLM = 10,000,000 stroops)
  • --asset: Use “native” for XLM or “CODE:ISSUER” format for other assets
  • --claimant: Account with optional predicate (can be specified multiple times)
  • Predicates are evaluated when the claimable balance is claimed, not when created
  • And and Or predicates must have exactly 2 sub-predicates
  • Complex predicates can be nested to create sophisticated claim conditions