MIT

Identifier: MIT_@across-protocol-app-sdk_0.2.3


across logo

Toolkit 🛠️ for building on top of the Across Protocol

Fastest and lowest-cost bridging for end-users. Streamlined interoperability for developers.

MIT License


## Overview Quickly integrate with a few lines of code. See [here](./packages/sdk/README.md) for more details. ```ts 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 }, }); ``` ## Tools | Package | Description | | ------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | [`@across-protocol/app-sdk`](./packages/sdk/README.md) | TypeScript package for building on top of Across Protocol's Smart Contracts and Quotes API | ## Examples | App | Description | | ---------------------------------- | ------------------------------------ | | [using viem](./apps/example/app) | Example Next.js app using [viem]() | | [using ethers](./apps/example/app) | Example Next.js app using [ethers]() | ## Links - Website: - App: - Docs: - X/Twitter: - Medium:

previous

next