Socket
Socket
Sign inDemoInstall

elrond-data

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    elrond-data

Data for building with Elrond.


Version published
Weekly downloads
4
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

1.3.1 (2020-11-24)

Features

  • Add network system contract addresses (b0ab225)

Readme

Source

NPM module Join the community Follow on Twitter

elrond-data

Data for building with Elrond.

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'

const tokenData = 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'

const bal: 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

FAQs

Last updated on 24 Nov 2020

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc