This package includes a JSON schema for token lists, and TypeScript utilities for working with token lists.
The JSON schema represents the specification for a token list which can be used in the Uniswap Interface.
This package does not include token list validation. You can easily do this by including a library such as ajv to perform the validation against the JSON schema.
Currently, the best way to author token lists is to use an editor that supports JSON schema validation. Most popular code editors do, such as IntelliJ or VSCode. Other editors can be found here.
Once you have set up the JSON schema, you should get inline validation errors, which provide details about each field in the token list schema.
Note that in order for your token list to be able to be used, it must pass JSON schema validation.
Below is a list of commands you will probably find useful.
Runs the project in development/watch mode. Your project will be rebuilt upon changes. TSDX has a special logger for you convenience. Error messages are pretty printed and formatted for compatibility VS Code's Problems tab.
Your library will be rebuilt if you make edits.
Bundles the package to the dist
folder.
The package is optimized and bundled with Rollup into multiple formats (CommonJS, UMD, and ES Module).
Runs the test watcher (Jest) in an interactive mode. By default, runs tests related to files changed since the last commit.