Bridge Any Asset with the TypeScript SDK

With v5.93.0 of the TypeScript SDK, we've added full beta functionality for thirdweb's new Universal Bridge. The bridge currently covers 50+ chains and over 30,000 routes.
- Bridge.Buy - Specify an exact destination amount to receive
quote
: Get estimates without a wallet connectionprepare
: Get finalized quotes with transaction data
- Bridge.Sell - Specify the exact origin amount to send
quote
: Get estimates without a wallet connectionprepare
: Get finalized quotes with transaction data
When you call prepare
, you might get multiple transactions back. You must send all transactions in order and sequentially for the full route to succeed. Before sending each transaction, call Bridge.status
for the previous transaction until it returns COMPLETED
. Do not simply wait for the transaction receipt, as this doesn't account for the destination chain transaction (if there is one).
The transactions returned do not include approvals. Send any necessary approvals before their corresponding transactions.
- Bridge.routes - Advanced function to discover and filter available bridge routes
- Filter by token address, chain ID, or both
- Full pagination support with customizable limit and offset
- Bridge.status - Comprehensive transaction status tracking
- Clear status indicators: "COMPLETED", "PENDING", "FAILED", or "NOT_FOUND"
- Detailed transaction reporting including origin and destination amounts and chains
- Standardized error handling with descriptive, formatted error messages
- Four underlying types are exported for use with the bridging functions:
Route
: Defines bridge routes between chains and tokensStatus
: Represents bridge transaction status dataQuote
: Contains detailed bridge transaction quote informationPreparedQuote
: Extends Quote with complete transaction data
The Bridge module is accessible as a top-level export:
Use Bridge.Buy
, Bridge.Sell
, Bridge.routes
, and Bridge.status
to access the corresponding functionality.
Or, import the functions directly from the module: