@galacticcouncil/sdk 0.0.1-beta.5 → 0.0.1-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  <h1><code>Galactic SDK</code></h1>
2
2
  <p>
3
- <a href="https://badge.fury.io/js/@galacticcouncil%2Fsdk"><img src="https://badge.fury.io/js/@galacticcouncil%2Fsdk.svg" alt="npm version" height="18"></a>
3
+
4
+ [![npm version](https://img.shields.io/npm/v/@galacticcouncil/sdk.svg)](https://www.npmjs.com/package/@galacticcouncil/sdk)
5
+ ![Coverage](./badges/coverage-jest%20coverage.svg)
6
+ ![npm bundle size](https://img.shields.io/bundlephobia/min/sdk)
7
+ [![npm downloads](https://img.shields.io/npm/dw/@galacticcouncil/sdk.svg)](https://www.npmjs.com/package/@galacticcouncil/sdk)
8
+ ![Last commit](https://img.shields.io/github/last-commit/galacticcouncil/sdk?logo=git)
9
+
4
10
  </p>
5
11
  Galactic SDK is collection of components crafted to ease Basilisk & HydraDX chains integration.
6
12
  <br />
@@ -9,10 +15,9 @@ Table of content:
9
15
 
10
16
  - [Installation](#installation)
11
17
  - [Components](#components)
12
- - [Router](#router)
13
- - [Trader](#trader)
18
+ - [TradeRouter](#traderouter)
19
+ - [TradeExecutor](#tradeexecutor)
14
20
  - [Examples](#examples)
15
- - [Packaging](#packaging)
16
21
  - [Roadmap](#roadmap)
17
22
  - [Issue reporting](#issue-reporting)
18
23
 
@@ -24,7 +29,7 @@ Install with [npm](https://www.npmjs.com/):
24
29
 
25
30
  ## Components
26
31
 
27
- ### Router
32
+ ### TradeRouter
28
33
 
29
34
  Off-chain optimization of orders across pools for best price execution. Router does not perform any on-chain transations.
30
35
 
@@ -46,8 +51,7 @@ For type signature visit [types.ts](src/types.ts)<br />
46
51
  ```typescript
47
52
  // Import
48
53
  import { ApiPromise, WsProvider } from '@polkadot/api';
49
- import { PolkadotPoolService } from '@galactic/pool';
50
- import { Router } from '@galactic/api';
54
+ import { TradeRouter, PolkadotPoolService } from '@galacticcouncil/sdk';
51
55
 
52
56
  // Initialize Polkadot API
53
57
  const wsProvider = new WsProvider('wss://rpc.basilisk.cloud');
@@ -55,14 +59,14 @@ const api = await ApiPromise.create({ provider: wsProvider });
55
59
 
56
60
  // Initialize Router
57
61
  const poolService = new PolkadotPoolService(api);
58
- const router = new Router(poolService);
62
+ const tradeRouter = new TradeRouter(poolService);
59
63
 
60
64
  // Do something
61
- const result = await router.getAllAssets();
65
+ const result = await tradeRouter.getAllAssets();
62
66
  console.log(result);
63
67
  ```
64
68
 
65
- ### Trader
69
+ ### TradeExecutor
66
70
 
67
71
  On-chain transaction executor using data from router to perform best possible trade.
68
72
 
@@ -74,18 +78,10 @@ SDK Examples and testing helpers.
74
78
 
75
79
  ### Run
76
80
 
77
- Run: `$ npx tsx ./test/script/examples/${{examplePackage}}/${{exampleName}}.ts` with valid example package & name.
81
+ Run: `$ npx tsx ./test/script/examples/<examplePackage>/<exampleName>.ts` with valid example package & name.
78
82
 
79
83
  To demonstrate full working examples on real chain see [script](test/script/examples) section.
80
84
 
81
- ## Packaging
82
-
83
- - api - Trade api, ...
84
- - client - Substrate chain based clients
85
- - pool - Pool specific logic, math, client
86
- - suggester - Route proposing, graph utils & algorithms, BFS, DFS
87
- - utils - bignumber, math, collections
88
-
89
85
  ## Roadmap
90
86
 
91
87
  Component list and current status ⬇️
@@ -94,16 +90,16 @@ Component list and current status ⬇️
94
90
  - 🛠 Work in progress
95
91
  - ⏳ Planning to build
96
92
 
97
- | Name | Type | |
98
- | -------- | :----: | --: |
99
- | Router | API | 🧪 |
100
- | Trader | API | 🛠 |
101
- | Polkadot | Client | 🧪 |
102
- | Capi | Client | ⏳ |
103
- | XYK | Pool | 🧪 |
104
- | LBP | Pool | ⏳ |
105
- | Stable | Pool | ⏳ |
106
- | Omni | Pool | ⏳ |
93
+ | Name | Type | |
94
+ | ------------- | :----: | --: |
95
+ | TradeRouter | API | 🧪 |
96
+ | TradeExecutor | API | 🛠 |
97
+ | Polkadot | Client | 🧪 |
98
+ | Capi | Client | ⏳ |
99
+ | XYK | Pool | 🧪 |
100
+ | LBP | Pool | ⏳ |
101
+ | Stable | Pool | ⏳ |
102
+ | Omni | Pool | ⏳ |
107
103
 
108
104
  ## Issue reporting
109
105