@1delta/calldatalib 0.0.8 → 0.0.10

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.
@@ -130,7 +130,7 @@ export declare function encodeCurveStyleSwap(tokenOut: Address, receiver: Addres
130
130
  export declare function encodeCurveNGStyleSwap(tokenOut: Address, receiver: Address, pool: Address, indexIn: bigint, indexOut: bigint, selectorId: bigint, cfg: any): Hex;
131
131
  export declare function encodeNextGenDexSettle(singleton: Address, nativeAmount: bigint): Hex;
132
132
  export declare function encodeNextGenDexSettleBalancer(singleton: Address, asset: Address, amountHint: bigint): Hex;
133
- export declare function encodeTransferIn(asset: Address, receiver: Address, amount: bigint): Hex;
133
+ export declare function encodeTransferIn(asset: Address, from: Address, amount: bigint): Hex;
134
134
  export declare function encodeSweep(asset: Address, receiver: Address, amount: bigint, sweepType: any): Hex;
135
135
  export declare function encodeWrap(amount: bigint, wrapTarget: Address): Hex;
136
136
  export declare function encodeApprove(asset: Address, target: Address): Hex;
@@ -199,7 +199,7 @@ export function encodeUniswapV2StyleSwap(tokenOut, receiver, forkId, pool, feeDe
199
199
  pool,
200
200
  uint16(feeDenom),
201
201
  uint8(forkId),
202
- uint16(flashCalldata.length / 2 - 1),
202
+ uint16(cfg === DexPayConfig.FLASH ? flashCalldata.length / 2 - 1 : uint256(cfg)),
203
203
  bytes(cfg === DexPayConfig.FLASH ? flashCalldata : newbytes(0)),
204
204
  ]);
205
205
  }
@@ -310,7 +310,7 @@ export function encodeDodoStyleSwap(currentData, tokenOut, receiver, pool, selec
310
310
  export function encodeWooStyleSwap(currentData, tokenOut, receiver, pool, cfg) {
311
311
  if (cfg === DexPayConfig.FLASH)
312
312
  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))]);
313
+ return encodePacked(["bytes", "address", "address", "uint8", "address", "uint8"], [currentData, tokenOut, receiver, uint8(DexTypeMappings.WOO_FI_ID), pool, uint8(uint256(cfg))]);
314
314
  }
315
315
  export function encodeGmxStyleSwap(currentData, tokenOut, receiver, pool, cfg) {
316
316
  if (cfg === DexPayConfig.FLASH)
@@ -367,8 +367,8 @@ export function encodeNextGenDexSettleBalancer(singleton, asset, amountHint) {
367
367
  uint128(amountHint >= 0xffffffffffffffffffffffffffffffn ? 0xffffffffffffffffffffffffffffffn : amountHint),
368
368
  ]);
369
369
  }
370
- export function encodeTransferIn(asset, receiver, amount) {
371
- return encodePacked(["uint8", "uint8", "address", "address", "uint128"], [uint8(ComposerCommands.TRANSFERS), uint8(TransferIds.TRANSFER_FROM), asset, receiver, uint128(amount)]);
370
+ export function encodeTransferIn(asset, from, amount) {
371
+ return encodePacked(["uint8", "uint8", "address", "address", "uint128"], [uint8(ComposerCommands.TRANSFERS), uint8(TransferIds.TRANSFER_FROM), asset, from, uint128(amount)]);
372
372
  }
373
373
  export function encodeSweep(asset, receiver, amount, sweepType) {
374
374
  return encodePacked(["uint8", "uint8", "address", "address", "uint8", "uint128"], [uint8(ComposerCommands.TRANSFERS), uint8(TransferIds.SWEEP), asset, receiver, sweepType, uint128(amount)]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1delta/calldatalib",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "Generated CalldataLib TypeScript functions for 1delta smart contracts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",