New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@injectivelabs/networks

Package Overview
Dependencies
Maintainers
9
Versions
384
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@injectivelabs/networks

Endpoints, networks, etc. Can be reused throughout Injective's projects.

  • 1.0.22
  • npm
  • Socket score

Version published
Weekly downloads
32K
increased by2.34%
Maintainers
9
Weekly downloads
 
Created
Source

🌟 Injective Protocol - Networks and Endpoints

downloads npm-version license

Accessing decentralized finance through TypeScript (for Web and Node environment)

@injectivelabs/networks is a TypeScript package for providing a pre-defined set of endpoints which can be used to fetch data from different data sources, broadcast transactions to sentry nodes, use the Tendermint RPC, etc, for different environments (Mainnet, Testnet, Devnet, etc).

📚 Installation

yarn add @injectivelabs/networks

📖 Documentation

This package exports an enum Network that developers can use for the different environments the Injective Chain can be run.

There are two key functions exported from this package:

  • export function getEndpointsForNetwork(network: Network): NetworkEndpoints
  • export function getNetworkInfo(network: Network): ChainInfo

The first one, getEndpointsForNetwork returns a pre-defined set of endpoints that can be used by the developers - depending on their need. Here is the interface that gets returned from this function:

export type NetworkEndpoints = {
  exchangeApi: string // @deprecated - the grpc-web port of the exchange API service
  indexerApi: string // the grpc-web port of the indexer API service
  sentryGrpcApi: string // the grpc-web port of the sentry node
  sentryHttpApi: string // the REST endpoint of the sentry node
  tendermintApi?: string // the REST endpoint of the Tendermint RPC
  chronosApi?: string // the REST endpoint of the chronos API service
  exchangeWeb3GatewayApi?: string // the grpc-web port of the web3-gateway service API
}

Lets explain these endpoints, and what do they mean:

  • exchangeApi / indexerApi is the grpc-web endpoint that we can use to connect to the exchange/indexer service which listens for events from the chain, processes the events and stores the data into a mongoDB so its easier and much more performant to serve that data than querying it straight from the chain itself,
  • sentryGrpcApi is the grpc-web endpoint that we can use to connect to a sentry node. A Sentry node is basically a read (and light) only version of the chain that we can use to query data directly from the chain.
  • sentryHttpApi is the REST endpoint that we can use to connect to a sentry node.
  • tendermintApi is the REST endpoint that we can use to connect to the Tendermint RPC,
  • chronosApi is the REST endpoint that we can use to connect to the Chronos API which is part of the exchange/indexer service which is used for rendering the TradingView chart and getting OHLC data for the markets,
  • exchangeWeb3GatewayApi is the grpc-web endpoint that we can use to connect to the web3-gateway which is part of the exchange/indexer service which is used for preparing and broadcasting Cosmos transactions using Ethereum native wallets + supports for fee delegation

The getNetworkInfo exports these endpoints plus the chainId and the default fee for the Network we want.


⛑ Support

Reach out to us at one of the following places!


🔓 License

This software is licensed under the MIT license. See LICENSE for full disclosure.

 

Powering the future of decentralized finance.

FAQs

Package last updated on 15 Sep 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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc