@1delta/calldatalib 0.0.8 → 0.0.20
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/CalldataLib.d.ts +15 -16
- package/dist/CalldataLib.js +17 -18
- package/package.json +1 -1
package/dist/CalldataLib.d.ts
CHANGED
|
@@ -75,23 +75,22 @@ export declare enum ForwarderCommands {
|
|
|
75
75
|
}
|
|
76
76
|
export declare enum DexTypeMappings {
|
|
77
77
|
UNISWAP_V3_ID = 0,
|
|
78
|
-
|
|
78
|
+
UNISWAP_V2_ID = 1,
|
|
79
79
|
UNISWAP_V4_ID = 2,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
SYNC_SWAP_ID = 190,
|
|
80
|
+
IZI_ID = 5,
|
|
81
|
+
UNISWAP_V2_FOT_ID = 3,
|
|
82
|
+
CURVE_V1_STANDARD_ID = 64,
|
|
83
|
+
CURVE_RECEIVED_ID = 65,
|
|
84
|
+
CURVE_FORK_ID = 66,
|
|
85
|
+
WOO_FI_ID = 80,
|
|
86
|
+
GMX_ID = 90,
|
|
87
|
+
KTX_ID = 91,
|
|
88
|
+
BALANCER_V2_ID = 128,
|
|
89
|
+
BALANCER_V3_ID = 129,
|
|
90
|
+
LB_ID = 140,
|
|
91
|
+
DODO_ID = 150,
|
|
92
|
+
SYNC_SWAP_ID = 160,
|
|
93
|
+
ERC4646_ID = 253,
|
|
95
94
|
NATIVE_WRAP_ID = 254
|
|
96
95
|
}
|
|
97
96
|
export declare enum DexForkMappings {
|
package/dist/CalldataLib.js
CHANGED
|
@@ -90,23 +90,22 @@ export var ForwarderCommands;
|
|
|
90
90
|
export var DexTypeMappings;
|
|
91
91
|
(function (DexTypeMappings) {
|
|
92
92
|
DexTypeMappings[DexTypeMappings["UNISWAP_V3_ID"] = 0] = "UNISWAP_V3_ID";
|
|
93
|
-
DexTypeMappings[DexTypeMappings["
|
|
93
|
+
DexTypeMappings[DexTypeMappings["UNISWAP_V2_ID"] = 1] = "UNISWAP_V2_ID";
|
|
94
94
|
DexTypeMappings[DexTypeMappings["UNISWAP_V4_ID"] = 2] = "UNISWAP_V4_ID";
|
|
95
|
-
DexTypeMappings[DexTypeMappings["
|
|
96
|
-
DexTypeMappings[DexTypeMappings["
|
|
97
|
-
DexTypeMappings[DexTypeMappings["
|
|
98
|
-
DexTypeMappings[DexTypeMappings["
|
|
99
|
-
DexTypeMappings[DexTypeMappings["
|
|
100
|
-
DexTypeMappings[DexTypeMappings["
|
|
101
|
-
DexTypeMappings[DexTypeMappings["
|
|
102
|
-
DexTypeMappings[DexTypeMappings["
|
|
103
|
-
DexTypeMappings[DexTypeMappings["
|
|
104
|
-
DexTypeMappings[DexTypeMappings["
|
|
105
|
-
DexTypeMappings[DexTypeMappings["
|
|
106
|
-
DexTypeMappings[DexTypeMappings["
|
|
107
|
-
DexTypeMappings[DexTypeMappings["
|
|
108
|
-
DexTypeMappings[DexTypeMappings["
|
|
109
|
-
DexTypeMappings[DexTypeMappings["SYNC_SWAP_ID"] = 190] = "SYNC_SWAP_ID";
|
|
95
|
+
DexTypeMappings[DexTypeMappings["IZI_ID"] = 5] = "IZI_ID";
|
|
96
|
+
DexTypeMappings[DexTypeMappings["UNISWAP_V2_FOT_ID"] = 3] = "UNISWAP_V2_FOT_ID";
|
|
97
|
+
DexTypeMappings[DexTypeMappings["CURVE_V1_STANDARD_ID"] = 64] = "CURVE_V1_STANDARD_ID";
|
|
98
|
+
DexTypeMappings[DexTypeMappings["CURVE_RECEIVED_ID"] = 65] = "CURVE_RECEIVED_ID";
|
|
99
|
+
DexTypeMappings[DexTypeMappings["CURVE_FORK_ID"] = 66] = "CURVE_FORK_ID";
|
|
100
|
+
DexTypeMappings[DexTypeMappings["WOO_FI_ID"] = 80] = "WOO_FI_ID";
|
|
101
|
+
DexTypeMappings[DexTypeMappings["GMX_ID"] = 90] = "GMX_ID";
|
|
102
|
+
DexTypeMappings[DexTypeMappings["KTX_ID"] = 91] = "KTX_ID";
|
|
103
|
+
DexTypeMappings[DexTypeMappings["BALANCER_V2_ID"] = 128] = "BALANCER_V2_ID";
|
|
104
|
+
DexTypeMappings[DexTypeMappings["BALANCER_V3_ID"] = 129] = "BALANCER_V3_ID";
|
|
105
|
+
DexTypeMappings[DexTypeMappings["LB_ID"] = 140] = "LB_ID";
|
|
106
|
+
DexTypeMappings[DexTypeMappings["DODO_ID"] = 150] = "DODO_ID";
|
|
107
|
+
DexTypeMappings[DexTypeMappings["SYNC_SWAP_ID"] = 160] = "SYNC_SWAP_ID";
|
|
108
|
+
DexTypeMappings[DexTypeMappings["ERC4646_ID"] = 253] = "ERC4646_ID";
|
|
110
109
|
DexTypeMappings[DexTypeMappings["NATIVE_WRAP_ID"] = 254] = "NATIVE_WRAP_ID";
|
|
111
110
|
})(DexTypeMappings || (DexTypeMappings = {}));
|
|
112
111
|
export var DexForkMappings;
|
|
@@ -199,7 +198,7 @@ export function encodeUniswapV2StyleSwap(tokenOut, receiver, forkId, pool, feeDe
|
|
|
199
198
|
pool,
|
|
200
199
|
uint16(feeDenom),
|
|
201
200
|
uint8(forkId),
|
|
202
|
-
uint16(flashCalldata.length / 2 - 1),
|
|
201
|
+
uint16(cfg === DexPayConfig.FLASH ? flashCalldata.length / 2 - 1 : uint256(cfg)),
|
|
203
202
|
bytes(cfg === DexPayConfig.FLASH ? flashCalldata : newbytes(0)),
|
|
204
203
|
]);
|
|
205
204
|
}
|
|
@@ -310,7 +309,7 @@ export function encodeDodoStyleSwap(currentData, tokenOut, receiver, pool, selec
|
|
|
310
309
|
export function encodeWooStyleSwap(currentData, tokenOut, receiver, pool, cfg) {
|
|
311
310
|
if (cfg === DexPayConfig.FLASH)
|
|
312
311
|
throw new Error("NoflashforWoo");
|
|
313
|
-
return encodePacked(["bytes", "address", "address", "uint8", "address", "
|
|
312
|
+
return encodePacked(["bytes", "address", "address", "uint8", "address", "uint8"], [currentData, tokenOut, receiver, uint8(DexTypeMappings.WOO_FI_ID), pool, uint8(uint256(cfg))]);
|
|
314
313
|
}
|
|
315
314
|
export function encodeGmxStyleSwap(currentData, tokenOut, receiver, pool, cfg) {
|
|
316
315
|
if (cfg === DexPayConfig.FLASH)
|