@galacticcouncil/sdk 0.0.1-beta.14 → 0.0.1-beta.16

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.
@@ -18,6 +18,13 @@ export declare class TradeRouter extends Router {
18
18
  * @returns Spot price for given path
19
19
  */
20
20
  private getSpotPrice;
21
+ /**
22
+ * Check whether trade is direct or not
23
+ *
24
+ * @param swaps - Trade route
25
+ * @returns true if direct trade, otherwise false
26
+ */
27
+ private isDirectTrade;
21
28
  /**
22
29
  * Calculate and return best possible sell trade for assetIn>assetOut
23
30
  *
@@ -12,10 +12,13 @@ export declare class LbpPool implements Pool {
12
12
  address: string;
13
13
  tradeFee: PoolFee;
14
14
  tokens: WeightedPoolToken[];
15
+ maxInRatio: number;
16
+ maxOutRatio: number;
17
+ minTradingLimit: number;
15
18
  repayFee: PoolFee;
16
19
  repayFeeApply: boolean;
17
20
  static fromPool(pool: PoolBase): LbpPool;
18
- constructor(address: string, swapFee: PoolFee, tokens: WeightedPoolToken[], repayFee: PoolFee, repayFeeApply: boolean);
21
+ constructor(address: string, swapFee: PoolFee, tokens: WeightedPoolToken[], maxInRation: number, maxOutRatio: number, minTradeLimit: number, repayFee: PoolFee, repayFeeApply: boolean);
19
22
  validPair(_tokenIn: string, _tokenOut: string): boolean;
20
23
  parsePoolPair(tokenIn: string, tokenOut: string): WeightedPoolPair;
21
24
  /**
@@ -5,8 +5,11 @@ export declare class XykPool implements Pool {
5
5
  address: string;
6
6
  tradeFee: PoolFee;
7
7
  tokens: PoolToken[];
8
+ maxInRatio: number;
9
+ maxOutRatio: number;
10
+ minTradingLimit: number;
8
11
  static fromPool(pool: PoolBase): XykPool;
9
- constructor(address: string, swapFee: PoolFee, tokens: PoolToken[]);
12
+ constructor(address: string, swapFee: PoolFee, tokens: PoolToken[], maxInRation: number, maxOutRatio: number, minTradeLimit: number);
10
13
  validPair(_tokenIn: string, _tokenOut: string): boolean;
11
14
  parsePoolPair(tokenIn: string, tokenOut: string): PoolPair;
12
15
  validateBuy(poolPair: PoolPair, amountOut: BigNumber): BuyTransfer;
@@ -10,12 +10,9 @@ export declare enum PoolType {
10
10
  Omni = "Omni"
11
11
  }
12
12
  export declare enum PoolError {
13
- TradingLimitReached = "TradingLimitReached",
14
13
  InsufficientTradingAmount = "InsufficientTradingAmount",
15
- InsufficientBalance = "InsufficientBalance",
16
14
  MaxInRatioExceeded = "MaxInRatioExceeded",
17
- AssetAmountNotReachedLimit = "AssetAmountNotReachedLimit",
18
- AssetAmountExceededLimit = "AssetAmountExceededLimit"
15
+ MaxOutRatioExceeded = "MaxOutRatioExceeded"
19
16
  }
20
17
  export interface PoolPair {
21
18
  assetIn: string;
@@ -30,6 +27,9 @@ export declare type PoolBase = {
30
27
  type: PoolType;
31
28
  tradeFee: PoolFee;
32
29
  tokens: PoolToken[];
30
+ maxInRatio: number;
31
+ maxOutRatio: number;
32
+ minTradingLimit: number;
33
33
  repayFee?: PoolFee;
34
34
  repayFeeApply?: boolean;
35
35
  };
@@ -87,6 +87,7 @@ export declare type Swap = Hop & Humanizer & {
87
87
  spotPrice: BigNumber;
88
88
  tradeFeePct: number;
89
89
  priceImpactPct: number;
90
+ errors: PoolError[];
90
91
  };
91
92
  export declare type SellSwap = Swap & PoolSell;
92
93
  export declare type BuySwap = Swap & PoolBuy;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacticcouncil/sdk",
3
- "version": "0.0.1-beta.14",
3
+ "version": "0.0.1-beta.16",
4
4
  "private": false,
5
5
  "description": "Galactic SDK",
6
6
  "author": "Pavol Noha <palo@hydradx.io>",