Skip to content

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 metadataconstusdc=TOKEN_SYMBOLS_MAP.USDC;console.log(usdc.decimals);// 6console.log(usdc.addresses[1]);// Ethereum mainnet address

What's Exported

ModuleDescription
networksChain ID constants for testnets and mainnets, chain metadata
tokensTOKEN_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

1 star

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages