Skip to main content
The TypeScript SDK is WIP. Today, submission is two steps: an on-chain createIntent call on BridgeIntentV2, plus an encrypted recipient bundle stored on the relayer via POST /store-recipients. The SDK will wrap both into a single submit call.
A submission is two artifacts:
  1. An on-chain intent (the public part) created by calling BridgeIntentV2.createIntent on the source chain. This is the solver-facing offer: “I’m offering X of tokenA for Y of tokenB delivered on chain Z, plus a reward of R.”
  2. An encrypted recipient bundle (the confidential part) stored on the relayer. This contains the actual recipient addresses and per-recipient amounts, encrypted to the relayer’s ECIES public key.
Together, they form a complete confidential intent. Solvers see the public offer pre-bid (batched with others so they can’t tell individual amounts apart), and only the winning solver receives the re-encrypted recipient bundle.

1. Create the on-chain intent

The on-chain call publishes the solver-facing parameters plus an encrypted blob that only the relayer can decrypt (the on-chain recovery anchor, see privacy guarantees).
Using ethers:
Before calling this, the user must have approved tokenA to the bridge contract for amountIn + reward.

2. Store the encrypted recipient bundle

After the on-chain intent is mined, tell the relayer who should actually receive the funds on the destination chain. This information is encrypted; the relayer stores it and only reveals it (re-encrypted) to the solver that wins the bid.
See POST /store-recipients for the full request shape.

How solvers see your intent

Once both steps are done, the relayer does the following:
  1. Batches your intentId with other live intents that share the same token pair + chain pair.
  2. Broadcasts to all solvers in plaintext: rate, token pair, total batch size, available fees. No sender, no per-intent recipient, no per-intent amount.
  3. Waits for a solver to bid to fill some portion of the batch.
  4. On bid win, re-encrypts the recipient bundle to the winning solver’s keypair and hands it over.
  5. Solver delivers to the stealth address(es) on the destination chain.
You never see any of this, just track the intentId until settlement.

Planned SDK surface

This wraps the two steps above: signs and sends createIntent, then encrypts the recipient list and posts to /store-recipients.

Submitting a batch

For payroll, refunds, or any N-recipient flow, submit many intents in a loop today:
An atomic batched-intent contract path is planned so the whole batch can land in a single on-chain transaction and share a single signature. Today, each recipient = one createIntent call.

Validation errors

createIntent can revert for on-chain reasons (insufficient allowance, bad addresses, zero amount, past deadline). /store-recipients can reject if the intent ID doesn’t exist on-chain, the chain ID is wrong, or the encrypted payload can’t be decoded. Typical client-side handling:
See error reference for the complete list. The _auctionDuration arg on createIntent sets how long solvers have to bid before the bridge finalizes the winner. A longer auction gives more solvers a chance to bid (better rates). A shorter one ships faster but may get no bid if solvers are idle.

Track intents to settlement

Polling, subscriptions, and webhooks.