@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.
- package/dist/{chunk-2PY5RNVS.cjs → chunk-DX73FB4P.cjs} +11 -11
- package/dist/{chunk-2PY5RNVS.cjs.map → chunk-DX73FB4P.cjs.map} +1 -1
- package/dist/{chunk-3KMF6ST3.cjs → chunk-JJ2LGENO.cjs} +4 -4
- package/dist/{chunk-3KMF6ST3.cjs.map → chunk-JJ2LGENO.cjs.map} +1 -1
- package/dist/{chunk-ARZSGP5Y.cjs → chunk-L5UHQQVC.cjs} +6 -6
- package/dist/{chunk-ARZSGP5Y.cjs.map → chunk-L5UHQQVC.cjs.map} +1 -1
- package/dist/{chunk-WTWG6QXP.js → chunk-TXA4GK5C.js} +2 -2
- package/dist/{chunk-PYIJO5XF.js → chunk-VG23GIWQ.js} +2 -2
- package/dist/{chunk-N5M3BLOV.js → chunk-WAFUL62X.js} +2 -2
- package/dist/{chunk-52SZJDFT.cjs → chunk-X2JZFK4C.cjs} +4 -2
- package/dist/chunk-X2JZFK4C.cjs.map +1 -0
- package/dist/{chunk-S5CCEO4O.js → chunk-Y3HMGOYW.js} +3 -1
- package/dist/{chunk-S5CCEO4O.js.map → chunk-Y3HMGOYW.js.map} +1 -1
- package/dist/eip712/index.cjs +3 -3
- package/dist/eip712/index.js +2 -2
- package/dist/index.cjs +60 -66
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -9
- package/dist/index.d.ts +27 -9
- package/dist/index.js +40 -46
- package/dist/index.js.map +1 -1
- package/dist/quoting/index.cjs +3 -3
- package/dist/quoting/index.js +2 -2
- package/dist/swap/index.cjs +3 -3
- package/dist/swap/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-52SZJDFT.cjs.map +0 -1
- /package/dist/{chunk-WTWG6QXP.js.map → chunk-TXA4GK5C.js.map} +0 -0
- /package/dist/{chunk-PYIJO5XF.js.map → chunk-VG23GIWQ.js.map} +0 -0
- /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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
-
|
|
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
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
{ type: "
|
|
410
|
-
|
|
411
|
-
{ type: "
|
|
412
|
-
|
|
413
|
-
{ type: "
|
|
414
|
-
|
|
415
|
-
{ type: "bytes32" },
|
|
416
|
-
|
|
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
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
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:
|
|
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
|
|
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
|
|
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,
|