0.0.4 • Published 3 years ago

cosmos-directory-js v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

cosmos-directory-js

JavaScript helper library to fetch Cosmos chain registry via cosmos.directory

npm install publish

Installing

# using npm
npm install cosmos-directory-js

# using yarn
yarn add cosmos-directory-js

Usage

// using commonjs
const { fetchAllChains } = require("cosmos-directory-js");

// using esm
import { fetchAllChains } from "cosmos-directory-js";

// example usages
const { chains } = await fetchAllChains();
const { validators } = await fetchAllValidators();

Custom Endpoint

cosmos-directory-js uses cosmos.directory as the default endpoint configured at constants.ts. To override endpoint values, define env values DIRECTORY_CHAINS_ENDPOINT and DIRECTORY_VALIDATORS_ENDPOINT.

For example, if you have another cosmos.directory deployed at https://example.com, replace env values like below:

DIRECTORY_CHAINS_ENDPOINT="https://chains.example.com"
DIRECTORY_VALIDATORS_ENDPOINT="https://validators.example.com"

API

View API documentation page at https://cosmos-directory-js.vercel.app

License

MIT License, Copyright (c) 2022 Strangelove Ventures

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago