@dhedge/v2-sdk 1.10.9 → 1.10.11
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/config.d.ts +2 -1
- package/dist/entities/dhedge.d.ts +1 -1
- package/dist/entities/pool.d.ts +2 -1
- package/dist/services/flatmoney/stableLp.d.ts +1 -0
- package/dist/services/odos/index.d.ts +3 -0
- package/dist/test/constants.d.ts +4 -0
- package/dist/types.d.ts +2 -1
- package/dist/v2-sdk.cjs.development.js +354 -61
- 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 +354 -61
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/abi/flatmoney/v2/IOrderExecutionModule.json +96 -0
- package/src/config.ts +18 -6
- package/src/entities/dhedge.ts +5 -4
- package/src/entities/pool.ts +14 -1
- package/src/services/flatmoney/keeperFee.ts +12 -4
- package/src/services/flatmoney/stableLp.ts +30 -8
- package/src/services/odos/index.ts +61 -0
- package/src/test/constants.ts +6 -1
- package/src/test/flatmoney.test.ts +30 -11
- package/src/test/odos.test.ts +109 -0
- package/src/types.ts +2 -1
- package/src/utils/contract.ts +19 -7
package/src/types.ts
CHANGED
package/src/utils/contract.ts
CHANGED
|
@@ -99,13 +99,25 @@ export const getPoolTxOrGasEstimate = async (
|
|
|
99
99
|
args: any[],
|
|
100
100
|
estimateGas: boolean
|
|
101
101
|
): Promise<any> => {
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
if (pool.isDhedge) {
|
|
103
|
+
if (estimateGas) {
|
|
104
|
+
return await pool.poolLogic.estimateGas.execTransaction(
|
|
105
|
+
args[0],
|
|
106
|
+
args[1],
|
|
107
|
+
args[2]
|
|
108
|
+
);
|
|
109
|
+
} else {
|
|
110
|
+
return await pool.poolLogic.execTransaction(args[0], args[1], args[2]);
|
|
111
|
+
}
|
|
108
112
|
} else {
|
|
109
|
-
|
|
113
|
+
if (estimateGas) {
|
|
114
|
+
return await pool.signer.estimateGas({ to: args[0], data: args[1] });
|
|
115
|
+
} else {
|
|
116
|
+
return await pool.signer.sendTransaction({
|
|
117
|
+
to: args[0],
|
|
118
|
+
data: args[1],
|
|
119
|
+
...args[2]
|
|
120
|
+
});
|
|
121
|
+
}
|
|
110
122
|
}
|
|
111
123
|
};
|