@dhedge/v2-sdk 1.9.4 → 1.9.6
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/dist/entities/pool.d.ts +76 -39
- package/dist/test/constants.d.ts +13 -0
- package/dist/test/utils/testingHelper.d.ts +14 -0
- package/dist/test/wallet.d.ts +1 -0
- package/dist/types.d.ts +2 -1
- package/dist/utils/contract.d.ts +2 -1
- package/dist/v2-sdk.cjs.development.js +976 -447
- 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 +976 -447
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +3 -2
- package/src/abi/PoolLogic.json +349 -63
- package/src/config.ts +23 -7
- package/src/entities/pool.ts +334 -222
- package/src/test/constants.ts +15 -1
- package/src/test/lyra.test.ts +7 -6
- package/src/test/oneInch.test.ts +66 -3
- package/src/test/synthetix.test.ts +3 -1
- package/src/test/uniswap.test.ts +180 -148
- package/src/test/utils/testingHelper.ts +55 -1
- package/src/test/wallet.ts +2 -1
- package/src/test/zeroEx.test.ts +40 -4
- package/src/types.ts +3 -2
- package/src/utils/contract.ts +17 -1
package/src/types.ts
CHANGED
|
@@ -5,6 +5,7 @@ export enum Network {
|
|
|
5
5
|
POLYGON = "polygon",
|
|
6
6
|
OPTIMISM = "optimism",
|
|
7
7
|
ARBITRUM = "arbitrum",
|
|
8
|
+
BASE = "base"
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export enum Dapp {
|
|
@@ -22,7 +23,7 @@ export enum Dapp {
|
|
|
22
23
|
VELODROMEV2 = "velodromeV2",
|
|
23
24
|
LYRA = "lyra",
|
|
24
25
|
ZEROEX = "0x",
|
|
25
|
-
RAMSES = "ramses"
|
|
26
|
+
RAMSES = "ramses"
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export enum Transaction {
|
|
@@ -44,7 +45,7 @@ export enum Transaction {
|
|
|
44
45
|
BURN = "burn",
|
|
45
46
|
SWAP_SYNTHS = "exchangeWithTracking",
|
|
46
47
|
ADD_LIQUIDITY_STAKE = "addLiquidityAndStake",
|
|
47
|
-
REMOVE_LIQUIDITY_UNSTAKE = "removeLiquidityAndUnstake"
|
|
48
|
+
REMOVE_LIQUIDITY_UNSTAKE = "removeLiquidityAndUnstake"
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
export type AddressNetworkMap = Readonly<Record<Network, string>>;
|
package/src/utils/contract.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import set from "lodash/set";
|
|
4
4
|
import { Interface } from "@ethersproject/abi";
|
|
5
5
|
import { multiCallAddress } from "../config";
|
|
6
|
-
import { ethers, Network } from "..";
|
|
6
|
+
import { ethers, Network, Pool } from "..";
|
|
7
7
|
|
|
8
8
|
export async function call(
|
|
9
9
|
provider: ethers.Signer,
|
|
@@ -93,3 +93,19 @@ export class Multicaller {
|
|
|
93
93
|
return obj;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
+
|
|
97
|
+
export const getPoolTxOrGasEstimate = async (
|
|
98
|
+
pool: Pool,
|
|
99
|
+
args: any[],
|
|
100
|
+
estimateGas: boolean
|
|
101
|
+
): Promise<any> => {
|
|
102
|
+
if (estimateGas) {
|
|
103
|
+
return await pool.poolLogic.estimateGas.execTransaction(
|
|
104
|
+
args[0],
|
|
105
|
+
args[1],
|
|
106
|
+
args[2]
|
|
107
|
+
);
|
|
108
|
+
} else {
|
|
109
|
+
return await pool.poolLogic.execTransaction(args[0], args[1], args[2]);
|
|
110
|
+
}
|
|
111
|
+
};
|