@galacticcouncil/sdk 0.0.1-beta.3 → 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,20 +1,35 @@
1
1
  <h1><code>Galactic SDK</code></h1>
2
+ <p>
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
+
10
+ </p>
2
11
  Galactic SDK is collection of components crafted to ease Basilisk & HydraDX chains integration.
3
12
  <br />
4
13
  <br />
5
14
  Table of content:
6
15
 
16
+ - [Installation](#installation)
7
17
  - [Components](#components)
8
- - [Router](#router)
9
- - [Trader](#trader)
18
+ - [TradeRouter](#traderouter)
19
+ - [TradeExecutor](#tradeexecutor)
10
20
  - [Examples](#examples)
11
- - [Packaging](#packaging)
12
21
  - [Roadmap](#roadmap)
13
22
  - [Issue reporting](#issue-reporting)
14
23
 
24
+ ## Installation
25
+
26
+ Install with [npm](https://www.npmjs.com/):
27
+
28
+ `npm install @galacticcouncil/sdk`
29
+
15
30
  ## Components
16
31
 
17
- ### Router
32
+ ### TradeRouter
18
33
 
19
34
  Off-chain optimization of orders across pools for best price execution. Router does not perform any on-chain transations.
20
35
 
@@ -30,15 +45,13 @@ getBestBuyPrice(tokenIn: string, tokenOut: string, amountOut: BigNumber): Swap[]
30
45
  ```
31
46
 
32
47
  For type signature visit [types.ts](src/types.ts)<br />
33
- **Note:** All amount args are formatted as bignumber 1^12!!!
34
48
 
35
49
  #### Usage
36
50
 
37
51
  ```typescript
38
52
  // Import
39
53
  import { ApiPromise, WsProvider } from '@polkadot/api';
40
- import { PolkadotPoolService } from '@galactic/pool';
41
- import { Router } from '@galactic/api';
54
+ import { TradeRouter, PolkadotPoolService } from '@galacticcouncil/sdk';
42
55
 
43
56
  // Initialize Polkadot API
44
57
  const wsProvider = new WsProvider('wss://rpc.basilisk.cloud');
@@ -46,14 +59,14 @@ const api = await ApiPromise.create({ provider: wsProvider });
46
59
 
47
60
  // Initialize Router
48
61
  const poolService = new PolkadotPoolService(api);
49
- const router = new Router(poolService);
62
+ const tradeRouter = new TradeRouter(poolService);
50
63
 
51
64
  // Do something
52
- const result = await router.getAllAssets();
65
+ const result = await tradeRouter.getAllAssets();
53
66
  console.log(result);
54
67
  ```
55
68
 
56
- ### Trader
69
+ ### TradeExecutor
57
70
 
58
71
  On-chain transaction executor using data from router to perform best possible trade.
59
72
 
@@ -65,18 +78,10 @@ SDK Examples and testing helpers.
65
78
 
66
79
  ### Run
67
80
 
68
- 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.
69
82
 
70
83
  To demonstrate full working examples on real chain see [script](test/script/examples) section.
71
84
 
72
- ## Packaging
73
-
74
- - api - Router & Trader impl
75
- - client - Substrate chain based clients
76
- - pool - Pool specific logic, math, clients
77
- - suggester - Route proposing, graph utils, BFS, DFS
78
- - utils - bignumber, math, collections
79
-
80
85
  ## Roadmap
81
86
 
82
87
  Component list and current status ⬇️
@@ -85,16 +90,16 @@ Component list and current status ⬇️
85
90
  - 🛠 Work in progress
86
91
  - ⏳ Planning to build
87
92
 
88
- | Name | Type | |
89
- | -------- | :----: | --: |
90
- | Router | API | 🧪 |
91
- | Trader | API | 🛠 |
92
- | Polkadot | Client | 🧪 |
93
- | Capi | Client | ⏳ |
94
- | XYK | Pool | 🧪 |
95
- | LBP | Pool | ⏳ |
96
- | Stable | Pool | ⏳ |
97
- | 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 | ⏳ |
98
103
 
99
104
  ## Issue reporting
100
105