Tutorial — Cross-chain
Post and fill an ERC-7683 intent
Open a
CrossChainOrder on Tenzro, see the deterministic order_id, and watch the destination-chain fill flow through your chosen ProofRoute.- Level
- Intermediate
- Time
- ~20 min
- Prerequisites
- Two chains connected via LayerZero/Wormhole/DeBridge/Hyperlane
- Stack
- TS SDK
01
Build the order
import { TenzroClient } from "tenzro-sdk";
const client = new TenzroClient({ endpoint: "https://rpc.tenzro.network" });
const erc7683 = client.erc7683();
// The order_id is deterministic:
// SHA-256("tenzro/7683/order" || swapper || nonce_le || origin_chain_id_le
// || fill_deadline_le || order_data_type || order_data)
// Compute it locally (off-node) and persist the envelope on the origin chain.
// Then read it back through the ERC-7683 client:
const order = await erc7683.getOrder(orderId);
console.log(order);02
Post on the origin (Tenzro)
Posting writes the envelope under the 7683_origin: keyspace in CF_SETTLEMENTS. The OrderState starts Open and transitions through AwaitingProof as the fill side acks.
03
Fill on the destination
A filler picks up the order from the chosen ProofRoute (LayerZero, Wormhole, DeBridge, or Hyperlane), executes the FillInstruction on the destination chain, and writes idempotent state under 7683_dest:<order_id>.
04
Finalize
When the proof arrives back on origin, OrderState becomes Settled. If the fill never lands by fillDeadline, the order becomes ForceRefundEligible; the swapper triggers a refund. The u128 ↔ uint256 helpers reject silent truncation on amounts larger than the internal ledger can express.