Thank you for your interest in contributing to Dex-Toolkit! We appreciate all contributions, big or small.
-
Fork the repository: Click the "Fork" button in the top-right corner of the repository page.
-
Clone your fork:
git clone https://github.com/niZmosis/dex-toolkit.git
-
Create a branch:
git checkout -b my-new-branch
-
Run the following command to set up the project:
pnpm setup:initial
-
Start watching all packages:
pnpm start
-
Make your changes:
- Follow the code style guidelines.
- Write clear commit messages.
-
Push your changes:
git push origin my-new-branch
-
Open a pull request: Go to the original repository and click "New pull request."
Check the TODO.md file to see the current list of tasks.
-
Add the Chain ID to chainIds.ts
-
Add the Network Config to networks
- Ensure to add the Network config to
getChainConfig
at the bottom of the file. - If adding a new DEX, export it in the barrel file.
- Ensure to add the Network config to
-
Add the Network Icon to images
-
Add the created Network Config to
getChainConfig
in chainConfigs -
Run Tests:
pnpm test:utils:networks
-
Update the compatibility table in the README.md README.md
-
Add the DEX Type to dex.types.ts.
-
Add the DEX Type to the Map in dex.utils.ts.
-
Add the DEX Config to configs/index.ts:
- Ensure to add the DEX config to
getDexConfig
andgetAllDexConfigs
at the bottom of the file. - If adding a new DEX, export it in the barrel file.
- Ensure to add the DEX config to
-
Check contracts for method names and map them if needed. See traderJoeSwap.dex.ts for reference.
-
Run Tests:
pnpm test:utils:dexs
-
Update the compatibility table in the README.md README.md.
-
Add the Token Config to configs/index.ts:
- Ensure the token config is added to
getTokenForChainId
at the bottom of the file. - If adding a new token, export it in the barrel file.
- Ensure the token config is added to
-
Add the Token Config to
tokenClasses
in tokenConfigs.ts. -
Run Tests:
pnpm test:utils:tokens
-
Update the compatibility table in the README.md README.md.
-
Add ABI files to abis:
- Files can be either
.json
or.ts
exporting aJSONFragment
array.
- Files can be either
-
Generate ABI typings and classes:
cd packages/utils && pnpm gen:abis
- Typings output:
packages/types/src/abis/types
. - Classes output:
packages/contract/src
.
- Typings output:
- Keep items in alphabetical order where applicable.
Before committing, run
pnpm precommit
to preform all linting, formatting, docs, and tests.
If you have any questions or need help getting started, feel free to open an issue or contact us on [communication channel, e.g., Discord].