@pafi-dev/core 0.5.13 → 0.5.15

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.
Files changed (30) hide show
  1. package/dist/{chunk-2PY5RNVS.cjs → chunk-DX73FB4P.cjs} +11 -11
  2. package/dist/{chunk-2PY5RNVS.cjs.map → chunk-DX73FB4P.cjs.map} +1 -1
  3. package/dist/{chunk-3KMF6ST3.cjs → chunk-JJ2LGENO.cjs} +4 -4
  4. package/dist/{chunk-3KMF6ST3.cjs.map → chunk-JJ2LGENO.cjs.map} +1 -1
  5. package/dist/{chunk-ARZSGP5Y.cjs → chunk-L5UHQQVC.cjs} +6 -6
  6. package/dist/{chunk-ARZSGP5Y.cjs.map → chunk-L5UHQQVC.cjs.map} +1 -1
  7. package/dist/{chunk-WTWG6QXP.js → chunk-TXA4GK5C.js} +2 -2
  8. package/dist/{chunk-PYIJO5XF.js → chunk-VG23GIWQ.js} +2 -2
  9. package/dist/{chunk-N5M3BLOV.js → chunk-WAFUL62X.js} +2 -2
  10. package/dist/{chunk-52SZJDFT.cjs → chunk-X2JZFK4C.cjs} +4 -2
  11. package/dist/chunk-X2JZFK4C.cjs.map +1 -0
  12. package/dist/{chunk-S5CCEO4O.js → chunk-Y3HMGOYW.js} +3 -1
  13. package/dist/{chunk-S5CCEO4O.js.map → chunk-Y3HMGOYW.js.map} +1 -1
  14. package/dist/eip712/index.cjs +3 -3
  15. package/dist/eip712/index.js +2 -2
  16. package/dist/index.cjs +60 -66
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +27 -9
  19. package/dist/index.d.ts +27 -9
  20. package/dist/index.js +40 -46
  21. package/dist/index.js.map +1 -1
  22. package/dist/quoting/index.cjs +3 -3
  23. package/dist/quoting/index.js +2 -2
  24. package/dist/swap/index.cjs +3 -3
  25. package/dist/swap/index.js +2 -2
  26. package/package.json +1 -1
  27. package/dist/chunk-52SZJDFT.cjs.map +0 -1
  28. /package/dist/{chunk-WTWG6QXP.js.map → chunk-TXA4GK5C.js.map} +0 -0
  29. /package/dist/{chunk-PYIJO5XF.js.map → chunk-VG23GIWQ.js.map} +0 -0
  30. /package/dist/{chunk-N5M3BLOV.js.map → chunk-WAFUL62X.js.map} +0 -0
package/dist/index.js CHANGED
@@ -43,7 +43,7 @@ import {
43
43
  verifyBurnRequest,
44
44
  verifyMintRequest,
45
45
  verifyReceiverConsent
46
- } from "./chunk-WTWG6QXP.js";
46
+ } from "./chunk-TXA4GK5C.js";
47
47
  import {
48
48
  buildAllPaths,
49
49
  combineRoutes,
@@ -51,7 +51,7 @@ import {
51
51
  quoteBestRoute,
52
52
  quoteExactInput,
53
53
  quoteExactInputSingle
54
- } from "./chunk-N5M3BLOV.js";
54
+ } from "./chunk-WAFUL62X.js";
55
55
  import {
56
56
  v4QuoterAbi
57
57
  } from "./chunk-KFWZRL7I.js";
@@ -82,7 +82,7 @@ import {
82
82
  erc20TransferOp,
83
83
  rawCallOp,
84
84
  simulateSwap
85
- } from "./chunk-PYIJO5XF.js";
85
+ } from "./chunk-VG23GIWQ.js";
86
86
  import {
87
87
  erc20Abi,
88
88
  permit2Abi,
@@ -92,6 +92,7 @@ import {
92
92
  COMMON_POOLS,
93
93
  COMMON_TOKENS,
94
94
  ENTRY_POINT_V07,
95
+ ENTRY_POINT_V08,
95
96
  PERMIT2_ADDRESS,
96
97
  POINT_TOKEN_POOLS,
97
98
  SUPPORTED_CHAINS,
@@ -100,7 +101,7 @@ import {
100
101
  burnRequestTypes,
101
102
  mintRequestTypes,
102
103
  receiverConsentTypes
103
- } from "./chunk-S5CCEO4O.js";
104
+ } from "./chunk-Y3HMGOYW.js";
104
105
 
105
106
  // src/index.ts
106
107
  import { createPublicClient, http as http2 } from "viem";
@@ -380,8 +381,7 @@ function serializeUserOpToJsonRpc(userOp, signature) {
380
381
  // src/userop/computeUserOpHash.ts
381
382
  import {
382
383
  concat,
383
- encodeAbiParameters as encodeAbiParameters2,
384
- keccak256 as keccak2562,
384
+ hashTypedData,
385
385
  pad,
386
386
  toHex
387
387
  } from "viem";
@@ -397,44 +397,37 @@ function computeUserOpHash(userOp, chainId) {
397
397
  pad(toHex(userOp.paymasterPostOpGasLimit ?? 0n), { size: 16 }),
398
398
  userOp.paymasterData ?? "0x"
399
399
  ]) : "0x";
400
- const packed = keccak2562(
401
- encodeAbiParameters2(
402
- [
403
- { type: "address" },
404
- // sender
405
- { type: "uint256" },
406
- // nonce
407
- { type: "bytes32" },
408
- // keccak(initCode) — no factory so keccak(0x)
409
- { type: "bytes32" },
410
- // keccak(callData)
411
- { type: "bytes32" },
412
- // accountGasLimits
413
- { type: "uint256" },
414
- // preVerificationGas
415
- { type: "bytes32" },
416
- // gasFees
417
- { type: "bytes32" }
418
- // keccak(paymasterAndData)
419
- ],
420
- [
421
- userOp.sender,
422
- userOp.nonce,
423
- keccak2562("0x"),
424
- keccak2562(userOp.callData),
425
- accountGasLimits,
426
- userOp.preVerificationGas,
427
- gasFees,
428
- keccak2562(paymasterAndData)
400
+ return hashTypedData({
401
+ domain: {
402
+ name: "ERC4337",
403
+ version: "1",
404
+ chainId,
405
+ verifyingContract: ENTRY_POINT_V08
406
+ },
407
+ types: {
408
+ PackedUserOperation: [
409
+ { name: "sender", type: "address" },
410
+ { name: "nonce", type: "uint256" },
411
+ { name: "initCode", type: "bytes" },
412
+ { name: "callData", type: "bytes" },
413
+ { name: "accountGasLimits", type: "bytes32" },
414
+ { name: "preVerificationGas", type: "uint256" },
415
+ { name: "gasFees", type: "bytes32" },
416
+ { name: "paymasterAndData", type: "bytes" }
429
417
  ]
430
- )
431
- );
432
- return keccak2562(
433
- encodeAbiParameters2(
434
- [{ type: "bytes32" }, { type: "address" }, { type: "uint256" }],
435
- [packed, ENTRY_POINT_V07, BigInt(chainId)]
436
- )
437
- );
418
+ },
419
+ primaryType: "PackedUserOperation",
420
+ message: {
421
+ sender: userOp.sender,
422
+ nonce: userOp.nonce,
423
+ initCode: "0x",
424
+ callData: userOp.callData,
425
+ accountGasLimits,
426
+ preVerificationGas: userOp.preVerificationGas,
427
+ gasFees,
428
+ paymasterAndData
429
+ }
430
+ });
438
431
  }
439
432
  function pack128(hi, lo) {
440
433
  return `0x${(hi << 128n | lo).toString(16).padStart(64, "0")}`;
@@ -559,7 +552,7 @@ async function getAaNonce(client, userAddress) {
559
552
  }
560
553
  ];
561
554
  return client.readContract({
562
- address: ENTRY_POINT_V07,
555
+ address: ENTRY_POINT_V08,
563
556
  abi: NONCE_ABI,
564
557
  functionName: "getNonce",
565
558
  args: [userAddress, 0n]
@@ -567,14 +560,14 @@ async function getAaNonce(client, userAddress) {
567
560
  }
568
561
 
569
562
  // src/delegation/computeAuthorizationHash.ts
570
- import { concat as concat2, keccak256 as keccak2563, toRlp } from "viem";
563
+ import { concat as concat2, keccak256 as keccak2562, toRlp } from "viem";
571
564
  function computeAuthorizationHash(chainId, address, nonce) {
572
565
  const rlpEncoded = toRlp([
573
566
  toMinimalHex(BigInt(chainId)),
574
567
  address,
575
568
  toMinimalHex(nonce)
576
569
  ]);
577
- return keccak2563(concat2(["0x05", rlpEncoded]));
570
+ return keccak2562(concat2(["0x05", rlpEncoded]));
578
571
  }
579
572
  function isDelegatedToTarget(code, target) {
580
573
  if (!code || code === "0x") return false;
@@ -1105,6 +1098,7 @@ export {
1105
1098
  ConfigurationError,
1106
1099
  DUMMY_SIGNATURE_V07,
1107
1100
  ENTRY_POINT_V07,
1101
+ ENTRY_POINT_V08,
1108
1102
  ORDERLY_RELAY_ABI,
1109
1103
  ORDERLY_VAULT_ABI,
1110
1104
  ORDERLY_VAULT_ADDRESSES,