@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/src/types.ts CHANGED
@@ -29,7 +29,8 @@ export enum Dapp {
29
29
  AERODROMECL = "aerodromeCL",
30
30
  RAMSESCL = "ramsesCL",
31
31
  PANCAKECL = "pancakeCL",
32
- COMPOUNDV3 = "compoundV3"
32
+ COMPOUNDV3 = "compoundV3",
33
+ ODOS = "odos"
33
34
  }
34
35
 
35
36
  export enum Transaction {
@@ -99,13 +99,25 @@ export const getPoolTxOrGasEstimate = async (
99
99
  args: any[],
100
100
  estimateGas: boolean
101
101
  ): Promise<any> => {
102
- if (estimateGas) {
103
- return await pool.poolLogic.estimateGas.execTransaction(
104
- args[0],
105
- args[1],
106
- args[2]
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
- return await pool.poolLogic.execTransaction(args[0], args[1], args[2]);
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
  };