@dhedge/v2-sdk 1.8.3 → 1.9.1

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
@@ -28,6 +28,13 @@ yarn add @dhedge/v2-sdk
28
28
 
29
29
  ### Initial setup
30
30
 
31
+ If you want to use 1Inch to trade pool assets you need to apply for an enterprise endpoint at [1Inch](https://docs.1inch.io/docs/aggregation-protocol/introduction).
32
+ Then you need to copy .env.example file to .env and set your url there.
33
+
34
+ ```
35
+ ONEINCH_API_URL=https://my-personal-url.1inch.io/v5.0
36
+ ```
37
+
31
38
  Initialize the sdk with an [ethers wallet](https://docs.ethers.io/v5/api/signer/#Wallet) and the network.
32
39
 
33
40
  ```
@@ -135,7 +135,7 @@ export declare class Pool {
135
135
  */
136
136
  unStake(dapp: Dapp, asset: string, amount: BigNumber | string, options?: any): Promise<any>;
137
137
  /**
138
- * Unstake liquidity pool tokens from gauge contract
138
+ * Unstake liquidity pool tokens from Velodrome or Balancer gauge
139
139
  * @param {string} gauge Gauge contract address
140
140
  * @param {BigNumber | string} amount Amount of liquidity pool tokens
141
141
  * @param {any} options Transaction options
@@ -311,6 +311,27 @@ export declare class Pool {
311
311
  * @returns {Promise<any>} Transaction
312
312
  */
313
313
  removeLiquidityVelodrome(assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any): Promise<any>;
314
+ /**
315
+ * Add liquidity to Velodrome V2 pool
316
+ * @param {string} assetA First asset
317
+ * @param {string} assetB Second asset
318
+ * @param {BigNumber | string} amountA Amount first asset
319
+ * @param {BigNumber | string} amountB Amount second asset
320
+ * @param { boolean } isStable Is stable pool
321
+ * @param {any} options Transaction options
322
+ * @returns {Promise<any>} Transaction
323
+ */
324
+ addLiquidityVelodromeV2(assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, isStable: boolean, options?: any): Promise<any>;
325
+ /**
326
+ * Remove liquidity from Velodrome V2 pool
327
+ * @param {string} assetA First asset
328
+ * @param {string} assetB Second asset
329
+ * @param {BigNumber | string} amount Amount of LP tokens
330
+ * @param { boolean } isStable Is stable pool
331
+ * @param {any} options Transaction options
332
+ * @returns {Promise<any>} Transaction
333
+ */
334
+ removeLiquidityVelodromeV2(assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any): Promise<any>;
314
335
  /**
315
336
  * Trade options on lyra
316
337
  * @param {LyraOptionMarket} market Underlying market e.g. eth
@@ -347,4 +368,11 @@ export declare class Pool {
347
368
  * @returns {Promise<any>} Transaction
348
369
  */
349
370
  changeFuturesPosition(market: string, changeAmount: BigNumber | string, options?: any): Promise<any>;
371
+ /** Cancels an open oder on Synthetix futures market
372
+ *
373
+ * @param {string} market Address of futures market
374
+ * @param {any} options Transaction options
375
+ * @returns {Promise<any>} Transaction
376
+ */
377
+ cancelFuturesOrder(market: string, options?: any): Promise<any>;
350
378
  }
@@ -0,0 +1,3 @@
1
+ export declare class ApiError extends Error {
2
+ constructor(message?: string);
3
+ }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./entities";
2
2
  export * from "./types";
3
+ export * from "./errors";
3
4
  export { ethers } from "ethers";
@@ -1,2 +1,3 @@
1
1
  import { Pool, ethers } from "../..";
2
2
  export declare function getFuturesChangePositionTxData(amount: ethers.BigNumber | string, market: string, pool: Pool): Promise<string>;
3
+ export declare function getFuturesCancelOrderTxData(pool: Pool): Promise<string>;
@@ -1,4 +1,4 @@
1
1
  import { BigNumber } from "ethers";
2
2
  import { Pool } from "../../entities";
3
- export declare function getVelodromeStakeTxData(amount: BigNumber | string): any;
4
- export declare function getVelodromeClaimTxData(pool: Pool, gauge: string): Promise<any>;
3
+ export declare function getVelodromeStakeTxData(amount: BigNumber | string, v2: boolean): any;
4
+ export declare function getVelodromeClaimTxData(pool: Pool, gauge: string, v2: boolean): Promise<any>;
@@ -0,0 +1,3 @@
1
+ import { BigNumber } from "ethers";
2
+ import { Network } from "../../types";
3
+ export declare const getZeroExTradeTxData: (network: Network, assetFrom: string, assetTo: string, amountIn: BigNumber | string, slippage: number | undefined, takerAddress: string) => Promise<string>;
@@ -16,6 +16,7 @@ export declare const KWENTA_ETH_PERP_V2 = "0x2b3bb4c683bfc5239b029131eef3b1d2144
16
16
  export declare const TEST_POOL: {
17
17
  polygon: string;
18
18
  optimism: string;
19
+ arbitrum: string;
19
20
  };
20
21
  export declare const CONTRACT_ADDRESS: {
21
22
  polygon: {
@@ -30,8 +31,14 @@ export declare const CONTRACT_ADDRESS: {
30
31
  SUSD: string;
31
32
  WETH: string;
32
33
  KWENTA_ETH_PERP_V2: string;
33
- ARRAKIS_USDC_WETH_GAUGE: string;
34
- ARRAKIS_USDC_WETH_LP: string;
34
+ };
35
+ arbitrum: {
36
+ USDC: string;
37
+ WETH: string;
38
+ WBTC: string;
39
+ WSTETH: string;
40
+ BALANCER_WSTETH_WETH_POOL: string;
41
+ BALANCER_WSTETH_WETH_GAUGE: string;
35
42
  };
36
43
  };
37
44
  export declare const MAX_AMOUNT: ethers.BigNumber;
@@ -0,0 +1,2 @@
1
+ import { Pool } from "../..";
2
+ export declare function getDelayedOrders(market: string, pool: Pool): Promise<any>;
package/dist/types.d.ts CHANGED
@@ -2,7 +2,8 @@ import { Deployment } from "@lyrafinance/lyra-js";
2
2
  import { BigNumber } from "ethers";
3
3
  export declare enum Network {
4
4
  POLYGON = "polygon",
5
- OPTIMISM = "optimism"
5
+ OPTIMISM = "optimism",
6
+ ARBITRUM = "arbitrum"
6
7
  }
7
8
  export declare enum Dapp {
8
9
  SUSHISWAP = "sushiswap",
@@ -16,7 +17,9 @@ export declare enum Dapp {
16
17
  ARRAKIS = "arrakis",
17
18
  TOROS = "toros",
18
19
  VELODROME = "velodrome",
19
- LYRA = "lyra"
20
+ VELODROMEV2 = "velodromeV2",
21
+ LYRA = "lyra",
22
+ ZEROEX = "0x"
20
23
  }
21
24
  export declare enum Transaction {
22
25
  SWAP = "swapExactTokensForTokens",