@across-protocol/constants
v3.1.107
Published
Export commonly re-used values for Across repositories
Keywords
Readme
Across Constants
Shared library exporting network, token, and address definitions used across the Across Protocol ecosystem.
Installation
# npm
npm install @across-protocol/constants
# yarn
yarn add @across-protocol/constantsUsage
import { TOKEN_SYMBOLS_MAP } from "@across-protocol/constants";
// Access token metadata
const usdc = TOKEN_SYMBOLS_MAP.USDC;
console.log(usdc.decimals); // 6
console.log(usdc.addresses[1]); // Ethereum mainnet addressWhat's Exported
| Module | Description |
|--------|-------------|
| networks | Chain ID constants for testnets and mainnets, chain metadata |
| tokens | TOKEN_SYMBOLS_MAP — token name, symbol, decimals, per-chain addresses, coingeckoId |
Development
# Build (CJS + ESM + TypeScript declarations)
yarn build
# Lint
yarn lint
# Auto-fix lint issues
yarn lint-fixAdding Tokens or Networks
- New network: Add chain ID constant to
src/networks.ts. - New token: Add entry to
TOKEN_SYMBOLS_MAPinsrc/tokens.ts. - Run
yarn lint-fix && yarn buildto verify.
Publishing
Published to npm automatically via GitHub Actions on GitHub release. Supports pre-release versions for beta/canary tags.
License
AGPL-3.0-only
