@dhedge/v2-sdk 1.9.7 → 1.9.8
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 +4 -4
- package/dist/entities/pool.d.ts +4 -4
- package/dist/types.d.ts +2 -1
- package/dist/v2-sdk.cjs.development.js +6 -5
- package/dist/v2-sdk.cjs.development.js.map +1 -1
- package/dist/v2-sdk.cjs.production.min.js +1 -1
- package/dist/v2-sdk.cjs.production.min.js.map +1 -1
- package/dist/v2-sdk.esm.js +6 -5
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/config.ts +3 -1
- package/src/entities/pool.ts +6 -4
- package/src/test/aerodrome.test.ts +154 -0
- package/src/types.ts +2 -1
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ yarn add @dhedge/v2-sdk
|
|
|
61
61
|
<a href="#uniswap-v3-style">Uniswap-v3 style protocols</a>
|
|
62
62
|
</li>
|
|
63
63
|
<li>
|
|
64
|
-
<a href="#velodromev2--ramses">VelodromeV2 / Ramses</a>
|
|
64
|
+
<a href="#velodromev2--ramses">VelodromeV2 / Ramses / Aerodrome</a>
|
|
65
65
|
</li>
|
|
66
66
|
</ul>
|
|
67
67
|
</li>
|
|
@@ -378,12 +378,12 @@ const result = await pool.increaseLiquidity(
|
|
|
378
378
|
const tx = await pool.claimFees(Dapp.UNISWAPV3, tokenId);
|
|
379
379
|
```
|
|
380
380
|
|
|
381
|
-
#### VelodromeV2 / Ramses
|
|
381
|
+
#### VelodromeV2 / Ramses / Aerodrome
|
|
382
382
|
|
|
383
|
-
For VelodromeV2 / Ramses, we use `addLiquidityV2`, `stakeInGauge`, `unstakeFromGauge`, `removeLiquidityV2`, and `claimFees`.
|
|
383
|
+
For VelodromeV2 / Ramses / Aerodrome , we use `addLiquidityV2`, `stakeInGauge`, `unstakeFromGauge`, `removeLiquidityV2`, and `claimFees`.
|
|
384
384
|
|
|
385
385
|
Add liquidity of 100 USDC and 0.00043 WETH to USDC/WETH Ramses pool
|
|
386
|
-
(for Velodrome just use Dapp.VELODROMEV2). see example in the [arrakis test](https://github.com/dhedge/dhedge-v2-sdk/blob/master/src/test/ramses.test.ts)
|
|
386
|
+
(for Velodrome just use Dapp.VELODROMEV2, for Aerodrome Dapp.AERODROME). see example in the [arrakis test](https://github.com/dhedge/dhedge-v2-sdk/blob/master/src/test/ramses.test.ts), [velodromeV2 test](https://github.com/dhedge/dhedge-v2-sdk/blob/master/src/test/velodromeV2.test.ts) and [aerdodrome test](https://github.com/dhedge/dhedge-v2-sdk/blob/master/src/test/aerdodrome.test.ts)
|
|
387
387
|
|
|
388
388
|
```ts
|
|
389
389
|
const tx = await pool.addLiquidityV2(
|
package/dist/entities/pool.d.ts
CHANGED
|
@@ -368,7 +368,7 @@ export declare class Pool {
|
|
|
368
368
|
removeLiquidityVelodromeV2(assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
|
|
369
369
|
/**
|
|
370
370
|
* Add liquidity to Velodrome V2 or Ramses pool
|
|
371
|
-
* @param {Dapp} dapp VelodromeV2 or
|
|
371
|
+
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
372
372
|
* @param {string} assetA First asset
|
|
373
373
|
* @param {string} assetB Second asset
|
|
374
374
|
* @param {BigNumber | string} amountA Amount first asset
|
|
@@ -378,10 +378,10 @@ export declare class Pool {
|
|
|
378
378
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
379
379
|
* @returns {Promise<any>} Transaction
|
|
380
380
|
*/
|
|
381
|
-
addLiquidityV2(dapp: Dapp.VELODROMEV2 | Dapp.RAMSES, assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
|
|
381
|
+
addLiquidityV2(dapp: Dapp.VELODROMEV2 | Dapp.RAMSES | Dapp.AERODROME, assetA: string, assetB: string, amountA: BigNumber | string, amountB: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
|
|
382
382
|
/**
|
|
383
383
|
* Remove liquidity from Velodrome V2 or Ramses pool
|
|
384
|
-
* @param {Dapp} dapp VelodromeV2 or
|
|
384
|
+
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
385
385
|
* @param {string} assetA First asset
|
|
386
386
|
* @param {string} assetB Second asset
|
|
387
387
|
* @param {BigNumber | string} amount Amount of LP tokens
|
|
@@ -390,7 +390,7 @@ export declare class Pool {
|
|
|
390
390
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
391
391
|
* @returns {Promise<any>} Transaction
|
|
392
392
|
*/
|
|
393
|
-
removeLiquidityV2(dapp: Dapp.VELODROMEV2 | Dapp.RAMSES, assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
|
|
393
|
+
removeLiquidityV2(dapp: Dapp.VELODROMEV2 | Dapp.RAMSES | Dapp.AERODROME, assetA: string, assetB: string, amount: BigNumber | string, isStable: boolean, options?: any, estimateGas?: boolean): Promise<any>;
|
|
394
394
|
/**
|
|
395
395
|
* Trade options on lyra
|
|
396
396
|
* @param {LyraOptionMarket} market Underlying market e.g. eth
|
package/dist/types.d.ts
CHANGED
|
@@ -4215,6 +4215,7 @@ var ManagerLogic = {
|
|
|
4215
4215
|
Dapp["LYRA"] = "lyra";
|
|
4216
4216
|
Dapp["ZEROEX"] = "0x";
|
|
4217
4217
|
Dapp["RAMSES"] = "ramses";
|
|
4218
|
+
Dapp["AERODROME"] = "aerodrome";
|
|
4218
4219
|
})(exports.Dapp || (exports.Dapp = {}));
|
|
4219
4220
|
|
|
4220
4221
|
(function (Transaction) {
|
|
@@ -4244,7 +4245,7 @@ var _factoryAddress, _Network$POLYGON, _Network$OPTIMISM, _Network$ARBITRUM, _Ne
|
|
|
4244
4245
|
require("dotenv").config();
|
|
4245
4246
|
|
|
4246
4247
|
var factoryAddress = (_factoryAddress = {}, _factoryAddress[exports.Network.POLYGON] = process.env.STAGING_CONTRACTS ? "0xDd87eCdB10cFF7004276AAbAbd30e7a08F69bb53" : "0xfdc7b8bFe0DD3513Cc669bB8d601Cb83e2F69cB0", _factoryAddress[exports.Network.OPTIMISM] = "0x5e61a079A178f0E5784107a4963baAe0c5a680c6", _factoryAddress[exports.Network.ARBITRUM] = "0xfffb5fb14606eb3a548c113026355020ddf27535", _factoryAddress[exports.Network.BASE] = "0x49Afe3abCf66CF09Fab86cb1139D8811C8afe56F", _factoryAddress);
|
|
4247
|
-
var routerAddress = (_routerAddress = {}, _routerAddress[exports.Network.POLYGON] = (_Network$POLYGON = {}, _Network$POLYGON[exports.Dapp.SUSHISWAP] = "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506", _Network$POLYGON[exports.Dapp.AAVE] = "0x8dFf5E27EA6b7AC08EbFdf9eB090F32ee9a30fcf", _Network$POLYGON[exports.Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$POLYGON[exports.Dapp.ONEINCH] = "0x1111111254EEB25477B68fb85Ed929f73A960582", _Network$POLYGON[exports.Dapp.QUICKSWAP] = "0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff", _Network$POLYGON[exports.Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$POLYGON[exports.Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$POLYGON[exports.Dapp.ARRAKIS] = "0xc73fb100a995b33f9fa181d420f4c8d74506df66", _Network$POLYGON[exports.Dapp.TOROS] = "0xB2F1498983bf9c9442c35F772e6C1AdE66a8DeDE", _Network$POLYGON[exports.Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _Network$POLYGON), _routerAddress[exports.Network.OPTIMISM] = (_Network$OPTIMISM = {}, _Network$OPTIMISM[exports.Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$OPTIMISM[exports.Dapp.SYNTHETIX] = "0x8700dAec35aF8Ff88c16BdF0418774CB3D7599B4", _Network$OPTIMISM[exports.Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$OPTIMISM[exports.Dapp.ONEINCH] = "0x1111111254EEB25477B68fb85Ed929f73A960582", _Network$OPTIMISM[exports.Dapp.TOROS] = "0x3988513793bCE39f0167064A9F7fC3617FaF35AB", _Network$OPTIMISM[exports.Dapp.VELODROME] = "0x9c12939390052919aF3155f41Bf4160Fd3666A6f", _Network$OPTIMISM[exports.Dapp.VELODROMEV2] = "0xa062ae8a9c5e11aaa026fc2670b0d65ccc8b2858", _Network$OPTIMISM[exports.Dapp.LYRA] = "0xCCE7819d65f348c64B7Beb205BA367b3fE33763B", _Network$OPTIMISM[exports.Dapp.ARRAKIS] = "0x9ce88a56d120300061593eF7AD074A1B710094d5", _Network$OPTIMISM[exports.Dapp.ZEROEX] = "0xdef1abe32c034e558cdd535791643c58a13acc10", _Network$OPTIMISM), _routerAddress[exports.Network.ARBITRUM] = (_Network$ARBITRUM = {}, _Network$ARBITRUM[exports.Dapp.ONEINCH] = "0x1111111254EEB25477B68fb85Ed929f73A960582", _Network$ARBITRUM[exports.Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$ARBITRUM[exports.Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$ARBITRUM[exports.Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$ARBITRUM[exports.Dapp.RAMSES] = "0xaaa87963efeb6f7e0a2711f397663105acb1805e", _Network$ARBITRUM), _routerAddress[exports.Network.BASE] = (_Network$BASE = {}, _Network$BASE[exports.Dapp.ONEINCH] = "0x1111111254EEB25477B68fb85Ed929f73A960582", _Network$BASE[exports.Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _Network$BASE), _routerAddress);
|
|
4248
|
+
var routerAddress = (_routerAddress = {}, _routerAddress[exports.Network.POLYGON] = (_Network$POLYGON = {}, _Network$POLYGON[exports.Dapp.SUSHISWAP] = "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506", _Network$POLYGON[exports.Dapp.AAVE] = "0x8dFf5E27EA6b7AC08EbFdf9eB090F32ee9a30fcf", _Network$POLYGON[exports.Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$POLYGON[exports.Dapp.ONEINCH] = "0x1111111254EEB25477B68fb85Ed929f73A960582", _Network$POLYGON[exports.Dapp.QUICKSWAP] = "0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff", _Network$POLYGON[exports.Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$POLYGON[exports.Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$POLYGON[exports.Dapp.ARRAKIS] = "0xc73fb100a995b33f9fa181d420f4c8d74506df66", _Network$POLYGON[exports.Dapp.TOROS] = "0xB2F1498983bf9c9442c35F772e6C1AdE66a8DeDE", _Network$POLYGON[exports.Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _Network$POLYGON), _routerAddress[exports.Network.OPTIMISM] = (_Network$OPTIMISM = {}, _Network$OPTIMISM[exports.Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$OPTIMISM[exports.Dapp.SYNTHETIX] = "0x8700dAec35aF8Ff88c16BdF0418774CB3D7599B4", _Network$OPTIMISM[exports.Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$OPTIMISM[exports.Dapp.ONEINCH] = "0x1111111254EEB25477B68fb85Ed929f73A960582", _Network$OPTIMISM[exports.Dapp.TOROS] = "0x3988513793bCE39f0167064A9F7fC3617FaF35AB", _Network$OPTIMISM[exports.Dapp.VELODROME] = "0x9c12939390052919aF3155f41Bf4160Fd3666A6f", _Network$OPTIMISM[exports.Dapp.VELODROMEV2] = "0xa062ae8a9c5e11aaa026fc2670b0d65ccc8b2858", _Network$OPTIMISM[exports.Dapp.LYRA] = "0xCCE7819d65f348c64B7Beb205BA367b3fE33763B", _Network$OPTIMISM[exports.Dapp.ARRAKIS] = "0x9ce88a56d120300061593eF7AD074A1B710094d5", _Network$OPTIMISM[exports.Dapp.ZEROEX] = "0xdef1abe32c034e558cdd535791643c58a13acc10", _Network$OPTIMISM), _routerAddress[exports.Network.ARBITRUM] = (_Network$ARBITRUM = {}, _Network$ARBITRUM[exports.Dapp.ONEINCH] = "0x1111111254EEB25477B68fb85Ed929f73A960582", _Network$ARBITRUM[exports.Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$ARBITRUM[exports.Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$ARBITRUM[exports.Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$ARBITRUM[exports.Dapp.RAMSES] = "0xaaa87963efeb6f7e0a2711f397663105acb1805e", _Network$ARBITRUM), _routerAddress[exports.Network.BASE] = (_Network$BASE = {}, _Network$BASE[exports.Dapp.ONEINCH] = "0x1111111254EEB25477B68fb85Ed929f73A960582", _Network$BASE[exports.Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _Network$BASE[exports.Dapp.AERODROME] = "0xcF77a3Ba9A5CA399B7c97c74d54e5b1Beb874E43", _Network$BASE[exports.Dapp.AAVEV3] = "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5", _Network$BASE), _routerAddress);
|
|
4248
4249
|
var dappFactoryAddress = (_dappFactoryAddress = {}, _dappFactoryAddress[exports.Network.POLYGON] = (_Network$POLYGON2 = {}, _Network$POLYGON2[exports.Dapp.SUSHISWAP] = "0xc35DADB65012eC5796536bD9864eD8773aBc74C4", _Network$POLYGON2[exports.Dapp.QUICKSWAP] = "0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32", _Network$POLYGON2), _dappFactoryAddress[exports.Network.OPTIMISM] = {}, _dappFactoryAddress[exports.Network.ARBITRUM] = {}, _dappFactoryAddress[exports.Network.BASE] = {}, _dappFactoryAddress);
|
|
4249
4250
|
var stakingAddress = (_stakingAddress = {}, _stakingAddress[exports.Network.POLYGON] = (_Network$POLYGON3 = {}, _Network$POLYGON3[exports.Dapp.SUSHISWAP] = "0x0769fd68dFb93167989C6f7254cd0D766Fb2841F", _Network$POLYGON3[exports.Dapp.BALANCER] = "0x0F3e0c4218b7b0108a3643cFe9D3ec0d4F57c54e", _Network$POLYGON3[exports.Dapp.AAVE] = "0x357D51124f59836DeD84c8a1730D72B749d8BC23", _Network$POLYGON3[exports.Dapp.AAVEV3] = "0x929EC64c34a17401F460460D4B9390518E5B473e", _Network$POLYGON3), _stakingAddress[exports.Network.OPTIMISM] = {}, _stakingAddress[exports.Network.ARBITRUM] = {}, _stakingAddress[exports.Network.BASE] = {}, _stakingAddress);
|
|
4250
4251
|
var aaveAddressProvider = (_aaveAddressProvider = {}, _aaveAddressProvider[exports.Network.POLYGON] = (_Network$POLYGON4 = {}, _Network$POLYGON4[exports.Dapp.AAVE] = "0xd05e3E715d945B59290df0ae8eF85c1BdB684744", _Network$POLYGON4[exports.Dapp.AAVEV3] = "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb", _Network$POLYGON4), _aaveAddressProvider[exports.Network.OPTIMISM] = (_Network$OPTIMISM2 = {}, _Network$OPTIMISM2[exports.Dapp.AAVEV3] = "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb", _Network$OPTIMISM2), _aaveAddressProvider[exports.Network.ARBITRUM] = (_Network$ARBITRUM2 = {}, _Network$ARBITRUM2[exports.Dapp.AAVEV3] = "0xa97684ead0e402dc232d5a977953df7ecbab3cdb", _Network$ARBITRUM2), _aaveAddressProvider[exports.Network.BASE] = (_Network$BASE2 = {}, _Network$BASE2[exports.Dapp.AAVEV3] = "0xe20fCBdBfFC4Dd138cE8b2E6FBb6CB49777ad64D", _Network$BASE2), _aaveAddressProvider);
|
|
@@ -20843,7 +20844,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
20843
20844
|
}
|
|
20844
20845
|
|
|
20845
20846
|
_context13.t0 = dapp;
|
|
20846
|
-
_context13.next = _context13.t0 === exports.Dapp.BALANCER ? 5 : _context13.t0 === exports.Dapp.VELODROME ? 8 : _context13.t0 === exports.Dapp.RAMSES ? 8 : _context13.t0 === exports.Dapp.VELODROMEV2 ? 10 : 12;
|
|
20847
|
+
_context13.next = _context13.t0 === exports.Dapp.BALANCER ? 5 : _context13.t0 === exports.Dapp.VELODROME ? 8 : _context13.t0 === exports.Dapp.RAMSES ? 8 : _context13.t0 === exports.Dapp.VELODROMEV2 ? 10 : _context13.t0 === exports.Dapp.AERODROME ? 10 : 12;
|
|
20847
20848
|
break;
|
|
20848
20849
|
|
|
20849
20850
|
case 5:
|
|
@@ -21908,7 +21909,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
21908
21909
|
}
|
|
21909
21910
|
|
|
21910
21911
|
_context30.t0 = dapp;
|
|
21911
|
-
_context30.next = _context30.t0 === exports.Dapp.UNISWAPV3 ? 5 : _context30.t0 === exports.Dapp.ARRAKIS ? 9 : _context30.t0 === exports.Dapp.BALANCER ? 9 : _context30.t0 === exports.Dapp.VELODROME ? 13 : _context30.t0 === exports.Dapp.RAMSES ? 13 : _context30.t0 === exports.Dapp.VELODROMEV2 ? 16 : 19;
|
|
21912
|
+
_context30.next = _context30.t0 === exports.Dapp.UNISWAPV3 ? 5 : _context30.t0 === exports.Dapp.ARRAKIS ? 9 : _context30.t0 === exports.Dapp.BALANCER ? 9 : _context30.t0 === exports.Dapp.VELODROME ? 13 : _context30.t0 === exports.Dapp.RAMSES ? 13 : _context30.t0 === exports.Dapp.VELODROMEV2 ? 16 : _context30.t0 === exports.Dapp.AERODROME ? 16 : 19;
|
|
21912
21913
|
break;
|
|
21913
21914
|
|
|
21914
21915
|
case 5:
|
|
@@ -22267,7 +22268,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
22267
22268
|
}()
|
|
22268
22269
|
/**
|
|
22269
22270
|
* Add liquidity to Velodrome V2 or Ramses pool
|
|
22270
|
-
* @param {Dapp} dapp VelodromeV2 or
|
|
22271
|
+
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
22271
22272
|
* @param {string} assetA First asset
|
|
22272
22273
|
* @param {string} assetB Second asset
|
|
22273
22274
|
* @param {BigNumber | string} amountA Amount first asset
|
|
@@ -22330,7 +22331,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
22330
22331
|
}()
|
|
22331
22332
|
/**
|
|
22332
22333
|
* Remove liquidity from Velodrome V2 or Ramses pool
|
|
22333
|
-
* @param {Dapp} dapp VelodromeV2 or
|
|
22334
|
+
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
22334
22335
|
* @param {string} assetA First asset
|
|
22335
22336
|
* @param {string} assetB Second asset
|
|
22336
22337
|
* @param {BigNumber | string} amount Amount of LP tokens
|