@dhedge/v2-sdk 1.9.0 → 1.9.2

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,11 +28,11 @@ 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).
31
+ If you want to use 1Inch to trade pool assets you need to apply for an API key at [1Inch Dev Portal](https://docs.1inch.io/docs/aggregation-protocol/introduction).
32
32
  Then you need to copy .env.example file to .env and set your url there.
33
33
 
34
34
  ```
35
- ONEINCH_API_URL=https://my-personal-url.1inch.io/v5.0
35
+ ONEINCH_API_KEY=YOUR_API_KEY_FROM_1INCH
36
36
  ```
37
37
 
38
38
  Initialize the sdk with an [ethers wallet](https://docs.ethers.io/v5/api/signer/#Wallet) and the network.
@@ -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
@@ -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";
@@ -0,0 +1,3 @@
1
+ import { ethers } from "../..";
2
+ import { Pool } from "../../entities";
3
+ export declare function getOneInchSwapTxData(pool: Pool, assetFrom: string, assetTo: string, amountIn: ethers.BigNumber | string, slippage: number): 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>;
@@ -0,0 +1,13 @@
1
+ import { ethers } from "ethers";
2
+ import { Network } from "../../types";
3
+ export declare type TestingRunParams = {
4
+ network: Network;
5
+ wallet: ethers.Wallet;
6
+ };
7
+ declare type TestHelperParams = {
8
+ testingRun: (testingRunParams: TestingRunParams) => void;
9
+ } & {
10
+ network: Network;
11
+ };
12
+ export declare const testingHelper: ({ network, testingRun }: TestHelperParams) => void;
13
+ export {};
@@ -1,2 +1,9 @@
1
1
  import { ethers } from "ethers";
2
+ import { Network } from "../types";
2
3
  export declare const wallet: ethers.Wallet;
4
+ export declare const networkPortMap: {
5
+ polygon: number;
6
+ optimism: number;
7
+ arbitrum: number;
8
+ };
9
+ export declare const getWallet: (network: Network) => ethers.Wallet;
package/dist/types.d.ts CHANGED
@@ -17,7 +17,9 @@ export declare enum Dapp {
17
17
  ARRAKIS = "arrakis",
18
18
  TOROS = "toros",
19
19
  VELODROME = "velodrome",
20
- LYRA = "lyra"
20
+ VELODROMEV2 = "velodromeV2",
21
+ LYRA = "lyra",
22
+ ZEROEX = "0x"
21
23
  }
22
24
  export declare enum Transaction {
23
25
  SWAP = "swapExactTokensForTokens",