This is the Across Protocol toolkit monorepo — home of the @across-protocol/app-sdk, the TypeScript SDK for integrating Across bridging and swaps into dApps.
Read docs in this order:
- This file (
AGENTS.md) for top-level navigation and module map. packages/sdk/README.mdfor SDK usage, authentication, and examples.apps/example/for working integration examples (viem + ethers).
Keep all relevant AGENTS.md and README.md files updated in the same change whenever SDK APIs, actions, or types change.
- Before writing implementation plans, surface material ambiguities first and resolve them with the user.
- For each new task, propose 0-3 targeted updates to
AGENTS.mdorREADME.mdfiles (or explicitly state why no updates are needed). - When adding new SDK actions, update the action list in this file and the SDK README.
- SDK source:
packages/sdk/src/ - SDK entry point:
packages/sdk/src/index.ts - SDK client:
packages/sdk/src/client.ts - SDK actions:
packages/sdk/src/actions/ - API layer:
packages/sdk/src/api/ - SDK types:
packages/sdk/src/types/ - SDK utilities:
packages/sdk/src/utils/ - SDK tests:
packages/sdk/test/ - Example app (viem):
apps/example/app/viem/ - Example app (ethers):
apps/example/app/ethers/ - Changesets:
.changeset/
The SDK exposes these actions through AcrossClient:
Quotes and routes:
getSuggestedFees— Protocol fee suggestionsgetAvailableRoutes— Discover supported routesgetLimits— Transfer limitsgetQuote— Bridge quotegetSwapQuote— Swap + bridge quotegetSwapTokens— Available swap tokensgetSwapChains— Available swap chains
Execution:
executeQuote— Execute a bridge quoteexecuteSwapQuote— Execute a swap + bridge quotesimulateDepositTx— Simulate deposit transactionsimulateApproveTx— Simulate token approvalsimulateUpdateDepositTx— Simulate deposit update
Tracking:
waitForDepositTx— Wait for deposit confirmationwaitForFillTx— Wait for fill on destination chaingetDeposit— Get deposit by IDgetDepositFromLogs— Parse deposit from tx logsgetFillByDepositTx— Find fill for a deposit
Other:
signUpdateDeposit— Sign deposit update message
toolkit/
├── packages/
│ ├── sdk/ # @across-protocol/app-sdk
│ │ ├── src/
│ │ │ ├── index.ts # Main export
│ │ │ ├── client.ts # AcrossClient class
│ │ │ ├── actions/ # 18 SDK action implementations
│ │ │ ├── api/ # API communication (routes, fees, swap)
│ │ │ ├── abis/ # SpokePool ABIs (v3, v3_5)
│ │ │ ├── constants/ # SDK constants
│ │ │ ├── errors/ # Error types
│ │ │ ├── types/ # TypeScript type definitions
│ │ │ └── utils/ # Utilities (logger, multicall, tenderly, etc.)
│ │ ├── test/
│ │ │ ├── unit/ # Unit tests
│ │ │ ├── e2e/ # End-to-end tests
│ │ │ ├── mocks/ # API mocks and fixtures
│ │ │ └── common/ # Test setup and helpers
│ │ ├── vitest.config.ts # Test configuration
│ │ └── package.json # Peer dep: viem@^2.31.2
│ ├── eslint-config/ # Shared ESLint config
│ └── typescript-config/ # Shared TypeScript config
├── apps/
│ └── example/ # Next.js demo app
│ ├── app/viem/ # viem + wagmi integration example
│ ├── app/ethers/ # ethers v5 integration example
│ └── scripts/ # CLI demo scripts
├── turbo.json # Turborepo config
├── pnpm-workspace.yaml # Workspace definition
├── .changeset/ # Changeset versioning
└── package.json # pnpm, Node >=18
# Build all packages
pnpm build
# Run all tests
pnpm test
# Run SDK tests only
cd packages/sdk && pnpm test
# Lint and type-check
pnpm lint
# Format
pnpm format
# Release workflow
pnpm version-packages # Changeset version bump
pnpm release # Build + publish to npmThis repo uses changesets for versioning:
- Create a changeset:
pnpm changeset - Version packages:
pnpm version-packages - Merge to master — CI publishes automatically via GitHub Actions.
- viem (peer dependency, ^2.31.2) — Ethereum client library
- zod — Runtime type validation
- Vitest — Test framework
- MSW — API mocking in tests