Tutorial — DeFi
Build a cross-chain DeFi app
The bridge router on Tenzro picks an adapter across LayerZero V2, Chainlink CCIP, deBridge DLN, and Wormhole NTT, then dispatches the protocol-specific signed message.
- Level
- Advanced
- Time
- ~40 min
- Prerequisites
- Funded EVM wallet
- Stack
- TypeScript
01
List available routes
Routes returns ranked candidates with adapter, fee, and ETA.
import { TenzroClient } from "tenzro-sdk";
const client = new TenzroClient({ endpoint: "https://rpc.tenzro.network" });
const routes = await client.bridge().getRoutes("ethereum", "tenzro-testnet", "USDC");
console.log(routes);02
Estimate the fee for a specific adapter
Live fee quote from the underlying adapter — LayerZero EndpointV2.quote(), CCIP Router.getFee(), DLN order-creation API, or Wormhole.
const fee = await client.bridge().estimateFee("ethereum", "tenzro-testnet", "USDC", "500", "layerzero");
console.log("estimated fee:", fee);03
Dispatch the bridge transfer
The adapter signs the protocol-specific message; the node submits and returns a transfer ID.
const transfer = await client.bridge().bridgeTokens(
"ethereum",
"tenzro-testnet",
"USDC",
"500",
recipient,
"layerzero",
);04
Track until delivery
Poll the transfer status until the destination side confirms.
const status = await client.bridge().getTransferStatus(transfer.transfer_id);
console.log("status:", status);Related