@injectivelabs/spot-consumer
v0.5.8
Published
Spot Trading on Injective Protocol made easy. Can be reused throughout Injective's projects.
Downloads
143
Maintainers
Keywords
Readme
DEPRECATED - Please use @injectivelabs/sdk-ts
🌟 Injective Protocol - Spot Market Consumer
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!
- Website at
injectiveprotocol.com
- Twitter at
@InjectiveLabs