npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@energi/energiswap-default-token-list

v3.0.9

Published

Energiswap Default Token List

Downloads

209

Readme

@energi/energiswap-default-token-list

npm

This NPM module contains the default token list for all dApss used in the Energi ecosystem. It also contains all SVG logo files.

Requirements

  • nodejs v14.17.*
  • yarn v1.22.*

Build Token List

yarn
yarn build

The dist/index.js will be created with all tokens.

Publishing

yarn build
yarn publish

How To Use

Install

Add library to project using one of the following commands.

yarn add @energi/energiswap-default-token-list
# or
npm install @energi/energiswap-default-token-list

Usage


import energiswapDefaultTokens from '@energi/energiswap-default-token-list'

console.log(energiswapDefaultTokens)

// {
//    name: "Energiswap Default Token List",
//    timestamp: "2022-01-28T10:31:02.051Z",
//    version: {
//        "major": 3,
//        "minor": 0,
//        "patch": 0
//    },
//    tags: {},
//    keywords: [
//        "energiswap",
//        "default"
//    ],
//    tokens: [ {...}, {...}, {...}, ... ]
// }

const tokensList = energiswapDefaultTokens.tokens

// For mainnet tokens filter the token list using the chainId 39797
// and for testnet use chainId 49797
const mainnetTokens = tokens.filter((token) => token.chainId === 39797)

Token Example

const tokensList = energiswapDefaultTokens.tokens

// should return DAI, index 0 is reserved for WNRG
const token = tokensList[1]

console.log(token)
 
// {
//   address: "0x0ee5893f434017d8881750101Ea2F7c49c0eb503"
//   chainId: 39797
//   decimals: 18
//   ethereum: "0x6b175474e89094c44da98b954eedeac495271d0f"
//   logo: <svg />
//   name: "Dai"
//   symbol: "DAI"
// }

// For a specific token, search the list using token address 
// or symbol (NOTE: Symbols are not guaranteed to be unique)

// by token address
const BTC = tokens.find((token) => token.address === '0x29a791703e5A5A8D1578F8611b4D3691377CEbc0')

// by token symbol
const BTC = tokens.find((token) => token.symbol === 'BTC')

Fetch tokens from blockchain

  import tokensList from '@energi/energiswap-default-token-list';

  // accepts two parameters, either mainnet or testnet
  const tokens = tokensList.utility.getTokens('mainnet');
  // returns a promise with a list of tokens with following format as a result:
  // [
  //   {
  //     address: "0x0ee5893f434017d8881750101Ea2F7c49c0eb503"
  //     chainId: 39797
  //     decimals: 18
  //     ethereum: "0x6b175474e89094c44da98b954eedeac495271d0f"
  //     name: "Dai"
  //     symbol: "DAI"
  //   },
  //   ...
  // ]

Disclaimer

Filing an issue does not guarantee addition to this default token list. We do not review token addition requests in any particular order and we do not guarantee that we will review your request to add the token to the default list.