Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@elementfi/tokenlist

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@elementfi/tokenlist

The Tokenlist for Element.finance

unpublished
npmnpm
Version
1.0.0-alpha.3
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

elf-tokenlist

The Tokenlist for Element.finance

Install

To install this repo as a dependency on another repo, you'll need to follow these steps in that repo.

  • Run
npm install git+https://github.com/element-fi/elf-tokenlist.git
  • Since this repo is not an npm package yet, add this script to package.json to stay up-to-date with the latest version.
  "scripts": {
    "update-elf-tokenlist": "npm install git+https://github.com/element-fi/elf-tokenlist.git"
  },

Setup

To setup this repo you need to run the following:

npm ci

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

Deploying a new term

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

# build the new tokenlists, elf-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 { ElementTokenTag, mainnetTokenList } from "elf-tokenlist";

// Get the list of principal tokens that have not yet reached maturity
const principalTokens = mainnetTokenList.tokens
  .filter(
    (token) => token.tags?.includes(ElementTokenTag.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:

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

FAQs

Package last updated on 14 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts