@locklessfi/tokenlist
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

lkl-tokenlist

The Tokenlist for Lockless.finance

Install

npm install @locklessfi/tokenlist

Setup

To setup this repo you need to run the following:

npm ci

You'll also need to add api keys listed in lkl.default.env to your local lkl.env file.

Deploying a new term

When a new term is deployed in the lkl-deploy repo, run this command to regenerate the tokenlist:

# build the new tokenlists, lkl-deploy repo must have the updated list
npm run build

Once complete, commit all file changes and submit a PR to main.

Any project that wants the latest tokenlist will now need to update their dependency on this repo. See below for handy script that makes upgrading easy for consumers.

Usage Examples

List the open principal tokens

This is how to get a list of currently open principal tokens.

import { LocklessTokenTag, mainnetTokenList } from "lkl-tokenlist";

// Get the list of principal tokens that have not yet reached maturity
const principalTokens = mainnetTokenList.tokens
  .filter(
    (token) => token.tags?.includes(LocklessTokenTag.PRINCIPAL)
  )
  .filter(
    (token) => token.extensions.unlockTimestamp > Date.now() * 1000
  ).

Developer Config

To build this repo you need to configure some env variables. For linux and mac run the following:

  1. Copy lkl.default.env
cp lkl.default.env lkl.env
  1. Update lkl.env with your alchemy api key
export ALCHEMY_MAINNET_API_KEY=
export ALCHEMY_GOERLI_API_KEY=
  1. Source the env file
source lkl.env

Readme

Keywords

none

Package Sidebar

Install

npm i @locklessfi/tokenlist

Weekly Downloads

0

Version

1.0.1

License

none

Unpacked Size

41 kB

Total Files

12

Last publish

Collaborators

  • lienhage