Universal Bridge

Universal Bridge allows you to create both simple and advanced payment flows for bridging, swapping, onramping, and peer-to-peer purchases. It's been used to drive millions in NFT sales, bridge native tokens to brand new chains, send stablecoins between users, and more. To get started check out the SDK functions, API reference, or playground.

Features

Cross-Chain Asset Routing

Intelligent multi-hop routing to find optimal paths between any supported tokens and chains.

Fiat-to-Crypto Onramps

Direct integration with Stripe, Coinbase, and Transak for seamless fiat onramps.

Real-time Status Tracking

Monitor transaction progress across chains with comprehensive status APIs.

Global Coverage

Support for 160+ countries and regions for fiat onramps and cross-chain transactions.

Webhook Integration

Real-time notifications for transaction completion and status updates.

Revenue Generation

Earn revenue by charging fees on every transaction that flows through your application.

SDK Modules

The Universal Bridge SDK is organized into several modules, each handling specific functionality:

ModulePurposeKey Functions
BuyCross-chain token purchasingquote(), prepare()
SellToken selling and swappingquote(), prepare()
TransferSame-chain and cross-chain transfersprepare()
OnrampFiat-to-crypto conversionprepare(), status()
RoutesRoute discovery and filteringroutes()
StatusTransaction status trackingstatus()

Supported Chains

Universal Bridge is supported on select EVM compatible chains. To view the full list, visit thirdweb chainlist.

Onramp Providers

Implementation Approaches

APPROACHDESCRIPTIONBEST FOR
TypeScript SDKFull-featured SDK with quote, prepare, and status functionsDevelopers building custom applications with complete control
REST APIDirect API access for any programming languageBackend services, mobile apps, or non-JavaScript environments
WebhooksReal-time transaction status notificationsApplications requiring instant completion updates
PlaygroundInteractive testing environmentTesting and prototyping bridge functionality

Quick Start Examples

Basic Cross-Chain Purchase

import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb";
// Get a quote for purchasing ETH on Optimism using ETH on Mainnet
const quote = await Bridge.Buy.quote({
originChainId: 1, // Ethereum Mainnet
originTokenAddress: NATIVE_TOKEN_ADDRESS,
destinationChainId: 10, // Optimism
destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
amount: toWei("0.01"),
client: thirdwebClient,
});
// Prepare finalized transactions
const prepared = await Bridge.Buy.prepare({
originChainId: 1,
originTokenAddress: NATIVE_TOKEN_ADDRESS,
destinationChainId: 10,
destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
amount: toWei("0.01"),
sender: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709",
receiver: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709",
client: thirdwebClient,
});

Fiat Onramp

// Prepare a Stripe onramp to purchase ETH
const onramp = await Bridge.Onramp.prepare({
client: thirdwebClient,
onramp: "stripe",
chainId: 1,
tokenAddress: NATIVE_TOKEN_ADDRESS,
receiver: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709",
amount: toWei("10"),
country: "US",
});
// Redirect user to onramp.link to complete purchase

Status Tracking

// Check transaction status
const status = await Bridge.status({
transactionHash:
"0x5959b9321ec581640db531b80bac53cbd968f3d34fc6cb1d5f4ea75f26df2ad7",
chainId: 137,
client: thirdwebClient,
});
if (status.status === "COMPLETED") {
console.log("Bridge completed!");
console.log("Final amount:", status.destinationAmount);
}