Socket
Book a DemoInstallSign in
Socket

cosmos-directory-client

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cosmos-directory-client

JavaScript client for fetching cosmos.directory endpoints 🛵

0.0.6
latest
Source
npmnpm
Version published
Weekly downloads
1.2K
-15.06%
Maintainers
4
Weekly downloads
 
Created
Source

npm/v npm/dt stars

cosmos-directory-client

JavaScript client for fetching cosmos.directory endpoints 🛵

Installing

# using npm
npm install cosmos-directory-client

# using yarn
yarn add cosmos-directory-client

# using pnpm
pnpm add cosmos-directory-client

Basic example

Creating client

You can create the directory client via class or using helper functions:

import { DirectoryClient, createClient, createTestnetClient } from "cosmos-directory-client";

const client = new DirectoryClient({ ... });
const clientAlt = createClient({ ... });
const testnetClient = createTestnetClient({ ... });

All clients defaults to https://cosmos.directory and https://testcosmos.directory for testnet client. You can pass optional arguments on instantiation.

Using client

All fetcher functions uses the built-in fetch object. You can pass custom fetch implementation when instantiating the client.

const { chains } = await client.fetchChains();
const { chain } = await client.fetchChain("juno");
const { chains } = await client.fetchStatus();
const { validators } = await client.fetchValidators();
const { validator } = await client.fetchValidator("frens");

API

View library APIs via paka.dev: https://paka.dev/npm/cosmos-directory-client

License

MIT License, Copyright (c) 2022 Strangelove Ventures

FAQs

Package last updated on 30 Aug 2022

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.