@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.
@@ -75,23 +75,22 @@ export declare enum ForwarderCommands {
75
75
  }
76
76
  export declare enum DexTypeMappings {
77
77
  UNISWAP_V3_ID = 0,
78
- IZI_ID = 1,
78
+ UNISWAP_V2_ID = 1,
79
79
  UNISWAP_V4_ID = 2,
80
- BALANCER_V3_ID = 4,
81
- BALANCER_V2_ID = 3,
82
- UNISWAP_V2_ID = 6,
83
- UNISWAP_V2_FOT_ID = 7,
84
- CURVE_V1_STANDARD_ID = 60,
85
- CURVE_FORK_ID = 61,
86
- UNISWAP_V2_MAX_ID = 150,
87
- CURVE_RECEIVED_ID = 150,
88
- WOO_FI_ID = 155,
89
- LB_ID = 160,
90
- GMX_ID = 170,
91
- KTX_ID = 171,
92
- MAX_GMX_ID = 173,
93
- DODO_ID = 180,
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 {
@@ -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["IZI_ID"] = 1] = "IZI_ID";
93
+ DexTypeMappings[DexTypeMappings["UNISWAP_V2_ID"] = 1] = "UNISWAP_V2_ID";
94
94
  DexTypeMappings[DexTypeMappings["UNISWAP_V4_ID"] = 2] = "UNISWAP_V4_ID";
95
- DexTypeMappings[DexTypeMappings["BALANCER_V3_ID"] = 4] = "BALANCER_V3_ID";
96
- DexTypeMappings[DexTypeMappings["BALANCER_V2_ID"] = 3] = "BALANCER_V2_ID";
97
- DexTypeMappings[DexTypeMappings["UNISWAP_V2_ID"] = 6] = "UNISWAP_V2_ID";
98
- DexTypeMappings[DexTypeMappings["UNISWAP_V2_FOT_ID"] = 7] = "UNISWAP_V2_FOT_ID";
99
- DexTypeMappings[DexTypeMappings["CURVE_V1_STANDARD_ID"] = 60] = "CURVE_V1_STANDARD_ID";
100
- DexTypeMappings[DexTypeMappings["CURVE_FORK_ID"] = 61] = "CURVE_FORK_ID";
101
- DexTypeMappings[DexTypeMappings["UNISWAP_V2_MAX_ID"] = 150] = "UNISWAP_V2_MAX_ID";
102
- DexTypeMappings[DexTypeMappings["CURVE_RECEIVED_ID"] = 150] = "CURVE_RECEIVED_ID";
103
- DexTypeMappings[DexTypeMappings["WOO_FI_ID"] = 155] = "WOO_FI_ID";
104
- DexTypeMappings[DexTypeMappings["LB_ID"] = 160] = "LB_ID";
105
- DexTypeMappings[DexTypeMappings["GMX_ID"] = 170] = "GMX_ID";
106
- DexTypeMappings[DexTypeMappings["KTX_ID"] = 171] = "KTX_ID";
107
- DexTypeMappings[DexTypeMappings["MAX_GMX_ID"] = 173] = "MAX_GMX_ID";
108
- DexTypeMappings[DexTypeMappings["DODO_ID"] = 180] = "DODO_ID";
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", "uint16"], [currentData, tokenOut, receiver, uint8(DexTypeMappings.WOO_FI_ID), pool, uint16(uint256(cfg))]);
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1delta/calldatalib",
3
- "version": "0.0.8",
3
+ "version": "0.0.20",
4
4
  "description": "Generated CalldataLib TypeScript functions for 1delta smart contracts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",