Skip to main content
Shape layer for cross-chain bridge operations: quote request/response types, bridge-route classification, and multi-quote aggregation. Adapts Squid Router (Axelar-backed, wide chain coverage) and Across Protocol (UMA optimistic-oracle, fastest for EVM-to-EVM pairs). Includes glide-internal — the same-tenant vault hop that is free and instant. Pure functions, no IO. Actual SDK calls live in apps/web.

Install

npmjs.com/package/@glideco/crosschain-bridge

Why two adapters

Across Protocol is cheaper and faster on the EVM-to-EVM common case. Squid covers the rest: EVM ↔ Solana, EVM ↔ Stellar, EVM ↔ Cosmos, and Solana ↔ Stellar. By classifying the chain pair first and only quoting the applicable adapter, the smart-router avoids sending a cross-chain quote to Across for a Base → Solana transfer where Across has no coverage. glide-internal appears in the bridge ID set so the smart-router can include same-tenant vault hops in candidate scoring without special-casing. A same-chain pair resolves to ['glide-internal'] — no bridge call needed.

Bridge route classification

The Across-eligible chains are eth, base, arb, op, polygon. Squid additionally covers sol, tempo, stellar.

Quoting

Quote aggregation

aggregateQuotes sorts by bridgeFee ASC using BigInt comparison (avoids IEEE-754 precision loss on large token amounts), with etaSeconds as a tiebreaker. It throws when all quotes are stale — the caller must re-quote rather than dispatch a stale route payload.

Dispatch

After picking a quote, wrap it in a BridgeDispatchRequest with the idempotency key and Glide audit fields before passing it to the adapter in apps/web:
The dispatch result carries status: 'pending' | 'in_flight' | 'completed' | 'failed' | 'refunded' and optional fromTxHash / toTxHash. The crypto-send-discover-destination Inngest function in apps/web polls for toTxHash on cross-chain rows until the destination settles or the 24h ageout fires.

Reading list