TalismanSociety / chaindata

A community controlled repository of relay and parachain information in the Polkadot ecosystem.

Home Page:https://raw.githubusercontent.com/TalismanSociety/chaindata/main/dist/index.txt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chaindata

Talisman

api-link

A community controlled repository of relay and parachain information in the Polkadot ecosystem.

The goals of this repo are:

  1. Provide a community-managed index of Polkadot parachains and their connection information (rpcs, chainspecs)
  2. Provide a source of chain and token assets across the ecosystem
  3. Enable developers to retrieve this information via an API suitable to their project (json/rest, npm soon™)
  4. Move towards a decentralised model

Usage

The files in this repo, data/chaindata.json, data/testnets-chaindata.json and data/evm-networks.json are used to configure a GitHub workflow which scrapes information from each chain and publishes it as a collection of JSON files in the dist directory of this repo.

The published files can be browsed at this URL: https://raw.githubusercontent.com/TalismanSociety/chaindata/main/dist/index.txt

As an example, you could use this request to get a summary of all chains including the the names, logos, genesisHashes and address type prefixes:

const chainsSummaryUrl = "https://raw.githubusercontent.com/TalismanSociety/chaindata/main/dist/chains/summary.json"
const summary = await fetch(chainsSummaryUrl).then(result => result.json())

For an example of a more advanced use-case, you can check out the Talisman wallet source code.
The wallet uses chaindata to populate a database of chains and tokens which is used for features like account balance subscriptions and sending funds.

Contributing

To make a contribution, please fork this repo and make your changes in your fork, then open a PR to merge your changes back into this repo.

To add chain or token logos:

Substrate chain logos

  1. Identify the chain id from chaindata.json or testnets-chaindata.json
  2. Add your logo (in svg format) to assets/chains/${id}.svg

EVM chain logos

  1. Identify the chain id from https://chainlist.org
    Use the base-10 id (e.g. 1, or 137), not the base-16 id (e.g. 0x1, or 0x89)
  2. Add your logo (in svg format) to assets/chains/${id}.svg

Token logos

  1. Identify the token symbol (e.g. KSM)
  2. Add your logo (in svg format) to assets/tokens/${symbol}.svg

To build the dist directory locally:

  1. Install pnpm
  2. Clone the repo via
    git clone git@github.com:TalismanSociety/chaindata.git
  3. Install the deps via
    pnpm install
  4. Copy .env.sample to .env and fill in the variables
  5. Run the build via
    pnpm build

File structure

Some files are edited manually, some other are generated automatically as part of the CI.

The table below describes the purpose of each file and how it is edited.

File name Edit Type Purpose
data/chaindata.json manual A list of all parachains and relay chains in the Polkadot ecosystem
data/testnets-chaindata.json manual A list of all parachains and relay chains in the Polkadot ecosystem
data/generated/chains-extras-cache.json automatic Caches static data for each substrate chain
data/evm-networks.json manual List of EVM chains supported by default in Talisman
data/generated/known-evm-networks.json automatic List of EVM networks, generated from ethereum-lists
data/known-evm-networks-overrides.json manual Overrides to known-evm-networks.json, matched by chain id
data/cache/known-evm-networks-icons-cache.json automatic Caches images for each network defined in ethereum-lists
data/cache/known-evm-tokens-cache.json automatic Caches static data for ERC20 tokens

About

A community controlled repository of relay and parachain information in the Polkadot ecosystem.

https://raw.githubusercontent.com/TalismanSociety/chaindata/main/dist/index.txt

License:GNU General Public License v3.0


Languages

Language:TypeScript 94.8%Language:JavaScript 5.2%