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