@galacticcouncil/sdk 0.0.1-beta.10 → 0.0.1-beta.11

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.
@@ -1,7 +1,23 @@
1
1
  import { Router } from './router';
2
- import { Trade } from '../types';
2
+ import { Trade, Amount } from '../types';
3
3
  import { BigNumber } from '../utils/bignumber';
4
4
  export declare class TradeRouter extends Router {
5
+ /**
6
+ * Calculate and return best possible spot price for tokenIn>tokenOut
7
+ *
8
+ * @param {string} tokenIn - Storage key of tokenIn
9
+ * @param {string} tokenOut - Storage key of tokenOut
10
+ * @return Best possible spot price of given token pair
11
+ */
12
+ getBestSpotPrice(tokenIn: string, tokenOut: string): Promise<Amount>;
13
+ /**
14
+ * Calculate and return spot price for given path
15
+ *
16
+ * @param path - current path
17
+ * @param poolsMap - pools map
18
+ * @returns Spot price for given path
19
+ */
20
+ private getSpotPrice;
5
21
  /**
6
22
  * Calculate and return best possible sell trade for tokenIn>tokenOut
7
23
  *
@@ -79,3 +79,7 @@ export declare type Trade = Humanizer & {
79
79
  export interface Humanizer {
80
80
  toHuman(): any;
81
81
  }
82
+ export interface Amount {
83
+ amount: BigNumber;
84
+ decimals: number;
85
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacticcouncil/sdk",
3
- "version": "0.0.1-beta.10",
3
+ "version": "0.0.1-beta.11",
4
4
  "private": false,
5
5
  "description": "Galactic SDK",
6
6
  "author": "Pavol Noha <palo@hydradx.io>",