Skip to content

Commit

Permalink
feat: initial setup for the spot consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
bangjelkoski committed Apr 10, 2021
1 parent 22c6807 commit 78dc6a7
Show file tree
Hide file tree
Showing 36 changed files with 697 additions and 254 deletions.
7 changes: 0 additions & 7 deletions packages/chronos-consumer/.npmignore

This file was deleted.

36 changes: 0 additions & 36 deletions packages/chronos-consumer/CHANGELOG.md

This file was deleted.

20 changes: 0 additions & 20 deletions packages/chronos-consumer/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions packages/chronos-consumer/jest.config.js

This file was deleted.

34 changes: 0 additions & 34 deletions packages/chronos-consumer/package.json

This file was deleted.

1 change: 0 additions & 1 deletion packages/chronos-consumer/src/index.ts

This file was deleted.

11 changes: 0 additions & 11 deletions packages/chronos-consumer/tsconfig.build.json

This file was deleted.

3 changes: 0 additions & 3 deletions packages/chronos-consumer/tsconfig.json

This file was deleted.

6 changes: 6 additions & 0 deletions packages/exchange-consumer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.0.29](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/exchange-consumer@0.0.28...@injectivelabs/exchange-consumer@0.0.29) (2021-04-10)

### Features

* initial setup for the spot consumer ([8628cd9](https://github.com/InjectiveLabs/injective-ts/commit/8628cd991927250448bf466b938beb9bff58e28f))

## [0.0.28](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/exchange-consumer@0.0.27...@injectivelabs/exchange-consumer@0.0.28) (2021-04-08)

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions packages/exchange-consumer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/exchange-consumer",
"description": "Interacting with our Exchange API made easy. Can be reused throughout Injective's projects.",
"version": "0.0.28",
"version": "0.0.29",
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -31,7 +31,7 @@
"@improbable-eng/grpc-web-node-http-transport": "^0.14.0",
"@injectivelabs/chain-api": "^1.4.3",
"@injectivelabs/exceptions": "^0.0.18",
"@injectivelabs/exchange-api": "^1.0.13",
"@injectivelabs/exchange-api": "^2.0.0",
"@injectivelabs/ts-types": "^0.0.15",
"@injectivelabs/tx-utils": "^0.0.3",
"@injectivelabs/utils": "^0.0.23",
Expand Down
7 changes: 0 additions & 7 deletions packages/graph-consumer/.npmignore

This file was deleted.

36 changes: 0 additions & 36 deletions packages/graph-consumer/CHANGELOG.md

This file was deleted.

20 changes: 0 additions & 20 deletions packages/graph-consumer/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions packages/graph-consumer/jest.config.js

This file was deleted.

34 changes: 0 additions & 34 deletions packages/graph-consumer/package.json

This file was deleted.

1 change: 0 additions & 1 deletion packages/graph-consumer/src/index.ts

This file was deleted.

11 changes: 0 additions & 11 deletions packages/graph-consumer/tsconfig.build.json

This file was deleted.

3 changes: 0 additions & 3 deletions packages/graph-consumer/tsconfig.json

This file was deleted.

6 changes: 6 additions & 0 deletions packages/spot-consumer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.0.7](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/spot-consumer@0.0.6...@injectivelabs/spot-consumer@0.0.7) (2021-04-10)

### Features

* initial setup for the spot consumer ([8628cd9](https://github.com/InjectiveLabs/injective-ts/commit/8628cd991927250448bf466b938beb9bff58e28f))

## [0.0.6](https://github.com/InjectiveLabs/injective-ts/compare/@injectivelabs/spot-consumer@0.0.5...@injectivelabs/spot-consumer@0.0.6) (2021-03-14)

**Note:** Version bump only for package @injectivelabs/spot-consumer
Expand Down
42 changes: 40 additions & 2 deletions packages/spot-consumer/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,47 @@
# 🌟 Injective Protocol - Spot API
# 🌟 Injective Protocol - Web3 Strategy

[![downloads](https://img.shields.io/npm/dm/@injectivelabs/spot-consumer.svg)](https://www.npmjs.com/package/@injectivelabs/spot-consumer)
[![npm-version](https://img.shields.io/npm/v/@injectivelabs/spot-consumer.svg)](https://www.npmjs.com/package/@injectivelabs/spot-consumer)
[![license](https://img.shields.io/npm/l/express.svg)]()

_A convenient way to consume Spot Market and Subaccounts API._

---

## 📚 Getting Started
## 📚 Installation

```bash
yarn add @injectivelabs/spot-consumer
```

## 📖 Documentation

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

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

```ts
// 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
Expand All @@ -18,3 +54,5 @@ Reach out to us at one of the following places!
---

## 🔓 License

[![License](https://img.shields.io/:license-mit-blue.svg?style=flat-square)](https://badges.mit-license.org)
8 changes: 7 additions & 1 deletion packages/spot-consumer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@injectivelabs/spot-consumer",
"description": "Spot Trading on Injective Protocol made easy. Can be reused throughout Injective's projects.",
"version": "0.0.6",
"version": "0.0.7",
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -27,6 +27,12 @@
"start": "node dist/index.js"
},
"dependencies": {
"@improbable-eng/grpc-web": "^0.14.0",
"@improbable-eng/grpc-web-node-http-transport": "^0.14.0",
"@injectivelabs/exceptions": "^0.0.18",
"@injectivelabs/exchange-api": "^2.0.0",
"@injectivelabs/ts-types": "^0.0.15",
"@injectivelabs/utils": "^0.0.23",
"link-module-alias": "^1.2.0",
"shx": "^0.3.2"
},
Expand Down
Loading

0 comments on commit 78dc6a7

Please sign in to comment.