Skip to content
This repository was archived by the owner on Oct 21, 2023. It is now read-only.

Latest commit

History

History
86 lines (59 loc) · 1.91 KB

File metadata and controls

86 lines (59 loc) · 1.91 KB

NPM moduleJoin the communityFollow on Twitter

elrond-data

JSON data files for Elrond network and token configurations.

Features:

  • Contains default configuration for Mainnet and Testnet tokens.
  • Small and lightweight
  • Cross-platform: Node.js, Browser, Web workers and React Native.
  • Typescript definitions.
  • Full documentation

Installation

npm install --save elrond-data

Usage

All predefined token and network metadata are in tokens.json and networks.json respectively.

This data gets loaded in and exposed via the Data export:

import{data}'elrond-data'consttokenData=data.getToken('xegld')console.log(JSON.stringify(tokenData,null,2))/* { "symbol": "XeGLD", "name": "Elrond Test eGold", "decimals": 18, "id": "xegld" }*/

If you are building in Typescript then there are various useful type definitions available, for example:

import{Balance}from'elrond-data'constbal: Balance={token: 'egld',amount: '1000',}

For a full list and further documentation see https://erddevcode.github.io/utils/.

Developer guide

To build both ESM and CommonJS output:

yarn build

To re-build the CommonJS output on chnage:

yarn dev

To build the docs:

yarn build-docs

To publish a new release (this will create a tag, publish to NPM and publich the latest docs):

yarn release

License

MIT