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 -> Optimism
const route = {
originChainId: arbitrum.id,
destinationChainId: optimism.id,
inputToken: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
outputToken: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
};
const quote = await client.getQuote({
route,
inputAmount: parseUnit("1000", 6) // USDC decimals
})
// 3. Execute quote
await client.executeQuote({
walletClient: wallet,
deposit: quote.deposit,
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
- Medium: https://medium.com/across-protocol