@factordao/tokenlist
v1.3.35
Published
This repository contains the tokenlist for Factor, which provides standardized token information for various chains and protocols including Arbitrum, Optimism, and Base and future Chains.
Keywords
Readme
Factor Tokenlist
This repository contains the tokenlist for Factor, which provides standardized token information for various chains and protocols including Arbitrum, Optimism, and Base and future Chains.
Project Structure
The tokenlist is organized as follows:
src/: Source code for the tokenlistchains/: Contains token definitions organized by chainarbitrum/: Arbitrum tokensoptimism/: Optimism tokensbase/: Base tokens
types/: TypeScript type definitions for tokens
assets/: Asset files (like images)cli/: Command-line tools for the project
Each chain directory contains multiple files organized by protocol (e.g., aave.ts, compound.ts, pendle.ts, general.ts), where token definitions are stored.
Token Structure
Tokens are defined with properties including:
- Address
- Symbol
- Name
- Decimals
- Associated protocols
- Building blocks (functionality)
- Other metadata specific to token types
How to Use
The tokenlist can be imported in your project using:
import { FactorTokenlist } from '@factordao/tokenlist';
import { ChainId } from '@factordao/tokenlist/types';
// Initialize the tokenlist for a specific chain
const tokenlist = new FactorTokenlist(ChainId.ARBITRUM_ONE);
// Get all tokens
const allTokens = tokenlist.getAllGeneralTokens();
// Get tokens by protocol
const aaveTokens = tokenlist.getTokensByProtocol(Protocols.AAVE);How to Contribute
We welcome contributions to the tokenlist. Here's how you can contribute:
Fork the repository
Click the "Fork" button at the top right of this repository to create your own copy.Clone your fork
git clone https://github.com/YOUR_USERNAME/factor-tokenlist.git cd factor-tokenlistCreate a new branch
git checkout -b add-new-tokensAdd your tokens
- Locate the appropriate chain directory in
src/chain/<chain_name> - Add your tokens to the relevant protocol file or create a new one if needed
- Ensure your tokens follow the proper typing conventions
- Locate the appropriate chain directory in
Update the version
Change the version number inpackage.jsonfollowing semantic versioning:- Patch version (1.2.1 → 1.2.2) for bug fixes and minor changes
- Minor version (1.2.1 → 1.3.0) for new tokens that don't break compatibility
- Major version (1.2.1 → 2.0.0) for breaking changes
Commit and push your changes
git add . git commit -m "Add tokens for XYZ protocol" git push origin add-new-tokensCreate a Pull Request
- Go to your fork on GitHub
- Click the "Compare & pull request" button
- Submit the PR to the
mainbranch of the original repository - Provide a detailed description of your changes
Review Process
- The Factor team will review your PR
- We may request changes or provide feedback
- Once approved, your changes will be merged into the main branch
- After merging, the package will be published to npm
License
MIT
