Toolkit 🛠️ for building on top of the Across Protocol
Fastest and lowest-cost bridging for end-users. Streamlined interoperability for developers.
Quickly integrate with a few lines of code. See here for more details.
import { createAcrossClient } from "@across-protocol/app-sdk";
import { mainnet, optimism, arbitrum } from "viem/chains";
import { useWalletClient } from "wagmi";
const wallet = useWalletClient();
// 1. Create client
const client = createAcrossClient({
integratorId: "0xdead", // 2-byte hex string
chains: [mainnet, optimism, arbitrum],
});
// 2. Retrieve quote for USDC from Arbitrum -> ETH on Optimism
const route = {
originChainId: arbitrum.id,
destinationChainId: optimism.id,
inputToken: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", // USDC
outputToken: "0x0000000000000000000000000000000000000000", // Native ETH
};
const swapQuote = await client.getSwapQuote({
route,
amount: parseUnit("10", 6), // USDC decimals
});
// 3. Execute quote
await client.executeSwapQuote({
walletClient: wallet,
swapQuote,
onProgress: (progress) => {
// handle progress
},
});
Package | Description |
---|---|
@across-protocol/app-sdk |
TypeScript package for building on top of Across Protocol's Smart Contracts and Quotes API |
App | Description |
---|---|
using viem | Example Next.js app using viem |
using ethers | Example Next.js app using ethers |
- Website: https://across.to
- App: https://app.across.to
- Docs: https://docs.across.to
- X/Twitter: https://x.com/AcrossProtocol
- Medium: https://medium.com/across-protocol