@injectivelabs/spot-consumer
TypeScript icon, indicating that this package has built-in type declarations

0.5.8 • Public • Published

DEPRECATED - Please use @injectivelabs/sdk-ts

🌟 Injective Protocol - Spot Market Consumer

downloads npm-version license

A convenient way to consume Spot Markets


📚 Installation

yarn add @injectivelabs/spot-consumer

📖 Documentation

This package is a TypeScript wrapper around the GRPC API provided by our Injective Exchange for spot markets.

The package is split between two separate concerns, "consumers" and "transformers". With the "consumers" we are making GRPC API calls to the Injective Exchange, and with the "transformers" we are transforming the data from a protobuf message to a plain TypeScript object that can be used more conveniently.

📖 Example Usage

// file: index.ts
import { SpotMarketConsumer, SpotMarketTransformer } from "@injectivelabs/spot-consumer"

const endpoint = '' // Exchange API endpoint
const spotMarketConsumer = new SpotMarketConsumer(endpoint)

(async() => {
  const markets = SpotMarketTransformer.marketsToUiMarkets(await spotMarketConsumer.fetchMarkets()) // returns UiSpotMarket[]

  console.log(markets)
})()

📜 Contribution

Contribution guides and practices will be available once there is a stable foundation of the whole package set within the injective-ts repo.


Support

Reach out to us at one of the following places!


🔓 License

License

Readme

Keywords

none

Package Sidebar

Install

npm i @injectivelabs/spot-consumer

Weekly Downloads

1

Version

0.5.8

License

MIT

Unpacked Size

93.1 kB

Total Files

79

Last publish

Collaborators

  • mmeloni
  • hmoragrega
  • shane-moore
  • phucta
  • thomasralee
  • albertchon
  • bangjelkoski
  • markuswaas
  • maximshen