App SDK Reference

About the App SDK

The Across App SDK is written and maintained by the engineering team at Risk Labs.

It is written in typescript and available on NPM at @across-protocol/app-sdk.

How can I use the App SDK?

The @across-protocol/app-sdk provides useful abstractions on top of Across' Smart Contracts and API. It can be used to easily integrate Across into your application to offer instant bridging or enable users to seamlessly interact with your app using assets from any chain. The App SDK provides utilities to:

  • retrieve routes, chain and token details

  • retrieve and execute quotes

  • handle destination chain contract calls

  • track status of deposits

Installation

To add the App SDK to your project, use npm or yarn to npm install @across-protocol/app-sdk or yarn add @across-protocol/app-sdk.

This can be used either in a frontend application or a node js project.

Testnet Across SDK

You can initialize the App SDK in testnet environment as follows:

import { createAcrossClient } from "@across-protocol/app-sdk";
import { mainnet, optimism, arbitrum } from "viem/chains";

const client = createAcrossClient({
  integratorId: "<your-integratorId>", // 2-byte hex string
  chains: [mainnet, optimism, arbitrum],
  useTestnet: true,
});

While using the App SDK in testnet environment, fills will typically take around 1 minute, significantly slower than mainnet's 2 second fills. This performance difference exists because testnet lacks the economic incentives and relayer competition that drive mainnet's performance and reliability.

Perform relatively smaller deposits (~$10) during testing. Remember that relayer settlement does not occur on the testnet and unfilled deposits are not automatically refunded.

We recommend using the testnet App SDK implementation only to verify your integration is correct, then switch to mainnet to experience Across in its true form. You can switch the App SDK to mainnet by simply removing the useTestnetparameter or setting it to false.

Basic Usage

Please ensure that you claim your integratorIDby filling this form before launching your product. This will allow Across to support you effectively and enable co-marketing opportunities as you grow and gain traction.

You can read about the different App SDK modules on the Github README page.

Last updated