Skip to content

across-protocol/constants

Repository files navigation

Across Constants

npm

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/constants

Usage

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 address

What'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-fix

Adding Tokens or Networks

  1. New network: Add chain ID constant to src/networks.ts.
  2. New token: Add entry to TOKEN_SYMBOLS_MAP in src/tokens.ts.
  3. Run yarn lint-fix && yarn build to 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

About

Export commonly used constant files

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors