wrapped-in-chains
TypeScript icon, indicating that this package has built-in type declarations

0.2.7 • Public • Published

wrapped-in-chains

Statements Branches Functions Lines
Statements Branches Functions Lines

Description

Zero dependency module to parse and display all a buttload of information from 382 chains.

  • Human readible network name? Got you.
  • RPC urls? Got you.
  • Faucets? mmmhmmm
  • Project URLs? doi
  • Icons? Got you fam.

Usage

import WrappedInChains from 'wrapped-in-chains';

// Get by Id
const chainData = WrappedInChains.getById(chainId: <string|number|hex-string>);

// Get by name
const chainData = WrappedInChains.getByName(chainName: string);

// Get by symbol
const chainData = WrappedInChains.getBySymbol(chainName: string);

/*
  Example data with all the trimmings
  {
    "name": "Rangers Protocol Testnet Robin",
    "chain": "Rangers",
    "icon": "rangers",
    "rpc": ["https://robin.rangersprotocol.com/api/jsonrpc"],
    "faucets": ["https://robin-faucet.rangersprotocol.com"],
    "nativeCurrency": {
      "name": "Rangers Protocol Gas",
      "symbol": "tRPG",
      "decimals": 18
    },
    "infoURL": "https://rangersprotocol.com",
    "shortName": "trpg",
    "chainId": 9527,
    "networkId": 9527,
    "explorers": [
      {
        "name": "rangersscan-robin",
        "url": "https://robin-rangersscan.rangersprotocol.com",
        "standard": "none"
      }
    ],
    "icon_name": "rangers",
    "icon_url": "ipfs://QmfHG3xbg4iiopagww93Gu7tmvCpPwZdiwsUjd3Dt5mRwT",
    "icon_width": 835,
    "icon_height": 835,
    "icon_format": "png"
  }
*/

Development

# Tests
npm run test

# Watch tests
npm run test:watch

# download and sync data
npm run sync

# build
npm run build

Disclamer

All this data is aggrregated data from chainlist

If you'd like a slimmed down situation, you can run the sync script npm run sync to download and merge all the most recent data. You'll find the raw and merged data in the data directory after the sync (it is not tracked). You can then pick out the chains you care for and keep on keepin' on.

Package Sidebar

Install

npm i wrapped-in-chains

Weekly Downloads

13

Version

0.2.7

License

ISC

Unpacked Size

242 kB

Total Files

11

Last publish

Collaborators

  • archae0pteryx