permissionless 0.3.5 → 0.3.7
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/CHANGELOG.md +13 -0
- package/_cjs/accounts/biconomy/index.js +8 -0
- package/_cjs/accounts/biconomy/index.js.map +1 -0
- package/_cjs/accounts/biconomy/toBiconomySmartAccount.js +9 -5
- package/_cjs/accounts/biconomy/toBiconomySmartAccount.js.map +1 -1
- package/_cjs/accounts/etherspot/index.js +8 -0
- package/_cjs/accounts/etherspot/index.js.map +1 -0
- package/_cjs/accounts/kernel/index.js +18 -0
- package/_cjs/accounts/kernel/index.js.map +1 -0
- package/_cjs/accounts/kernel/toKernelSmartAccount.js +10 -6
- package/_cjs/accounts/kernel/toKernelSmartAccount.js.map +1 -1
- package/_cjs/accounts/kernel/utils/signMessage.js +9 -7
- package/_cjs/accounts/kernel/utils/signMessage.js.map +1 -1
- package/_cjs/accounts/kernel/utils/signTypedData.js +7 -6
- package/_cjs/accounts/kernel/utils/signTypedData.js.map +1 -1
- package/_cjs/accounts/kernel/utils/wrapMessageHash.js +3 -3
- package/_cjs/accounts/kernel/utils/wrapMessageHash.js.map +1 -1
- package/_cjs/accounts/light/index.js +8 -0
- package/_cjs/accounts/light/index.js.map +1 -0
- package/_cjs/accounts/light/toLightSmartAccount.js +9 -5
- package/_cjs/accounts/light/toLightSmartAccount.js.map +1 -1
- package/_cjs/accounts/nexus/index.js +8 -0
- package/_cjs/accounts/nexus/index.js.map +1 -0
- package/_cjs/accounts/safe/signUserOperation.js +3 -0
- package/_cjs/accounts/safe/signUserOperation.js.map +1 -1
- package/_cjs/accounts/safe/toSafeSmartAccount.js +4 -3
- package/_cjs/accounts/safe/toSafeSmartAccount.js.map +1 -1
- package/_cjs/accounts/simple/index.js +10 -0
- package/_cjs/accounts/simple/index.js.map +1 -0
- package/_cjs/accounts/simple/toSimpleSmartAccount.js +15 -10
- package/_cjs/accounts/simple/toSimpleSmartAccount.js.map +1 -1
- package/_cjs/accounts/thirdweb/index.js +8 -0
- package/_cjs/accounts/thirdweb/index.js.map +1 -0
- package/_cjs/accounts/thirdweb/utils/decodeCallData.js +7 -5
- package/_cjs/accounts/thirdweb/utils/decodeCallData.js.map +1 -1
- package/_cjs/accounts/trust/index.js +8 -0
- package/_cjs/accounts/trust/index.js.map +1 -0
- package/_cjs/accounts/trust/utils/decodeCallData.js +7 -5
- package/_cjs/accounts/trust/utils/decodeCallData.js.map +1 -1
- package/_cjs/actions/{erc7579.js → erc7579/index.js} +9 -9
- package/_cjs/actions/erc7579/index.js.map +1 -0
- package/_cjs/actions/{etherspot.js → etherspot/index.js} +2 -2
- package/_cjs/actions/etherspot/index.js.map +1 -0
- package/_cjs/actions/{passkeyServer.js → passkeyServer/index.js} +4 -4
- package/_cjs/actions/passkeyServer/index.js.map +1 -0
- package/_cjs/actions/pimlico/estimateErc20PaymasterCost.js +7 -3
- package/_cjs/actions/pimlico/estimateErc20PaymasterCost.js.map +1 -1
- package/_cjs/actions/{pimlico.js → pimlico/index.js} +8 -8
- package/_cjs/actions/pimlico/index.js.map +1 -0
- package/_cjs/actions/{smartAccount.js → smartAccount/index.js} +5 -5
- package/_cjs/actions/smartAccount/index.js.map +1 -0
- package/_cjs/clients/createSmartAccountClient.js.map +1 -1
- package/_cjs/clients/decorators/pimlico.js +4 -4
- package/_cjs/clients/decorators/pimlico.js.map +1 -1
- package/_cjs/clients/{passkeyServer.js → passkeyServer/index.js} +2 -2
- package/_cjs/clients/passkeyServer/index.js.map +1 -0
- package/_cjs/clients/{pimlico.js → pimlico/index.js} +2 -2
- package/_cjs/clients/pimlico/index.js.map +1 -0
- package/_cjs/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js +6 -5
- package/_cjs/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js.map +1 -1
- package/_esm/accounts/biconomy/index.js +5 -0
- package/_esm/accounts/biconomy/index.js.map +1 -0
- package/_esm/accounts/biconomy/toBiconomySmartAccount.js +9 -5
- package/_esm/accounts/biconomy/toBiconomySmartAccount.js.map +1 -1
- package/_esm/accounts/etherspot/index.js +5 -0
- package/_esm/accounts/etherspot/index.js.map +1 -0
- package/_esm/accounts/kernel/index.js +15 -0
- package/_esm/accounts/kernel/index.js.map +1 -0
- package/_esm/accounts/kernel/toKernelSmartAccount.js +10 -6
- package/_esm/accounts/kernel/toKernelSmartAccount.js.map +1 -1
- package/_esm/accounts/kernel/utils/signMessage.js +9 -7
- package/_esm/accounts/kernel/utils/signMessage.js.map +1 -1
- package/_esm/accounts/kernel/utils/signTypedData.js +7 -6
- package/_esm/accounts/kernel/utils/signTypedData.js.map +1 -1
- package/_esm/accounts/kernel/utils/wrapMessageHash.js +3 -3
- package/_esm/accounts/kernel/utils/wrapMessageHash.js.map +1 -1
- package/_esm/accounts/light/index.js +5 -0
- package/_esm/accounts/light/index.js.map +1 -0
- package/_esm/accounts/light/toLightSmartAccount.js +9 -5
- package/_esm/accounts/light/toLightSmartAccount.js.map +1 -1
- package/_esm/accounts/nexus/index.js +5 -0
- package/_esm/accounts/nexus/index.js.map +1 -0
- package/_esm/accounts/safe/signUserOperation.js +3 -0
- package/_esm/accounts/safe/signUserOperation.js.map +1 -1
- package/_esm/accounts/safe/toSafeSmartAccount.js +4 -3
- package/_esm/accounts/safe/toSafeSmartAccount.js.map +1 -1
- package/_esm/accounts/simple/index.js +7 -0
- package/_esm/accounts/simple/index.js.map +1 -0
- package/_esm/accounts/simple/toSimpleSmartAccount.js +15 -10
- package/_esm/accounts/simple/toSimpleSmartAccount.js.map +1 -1
- package/_esm/accounts/thirdweb/index.js +5 -0
- package/_esm/accounts/thirdweb/index.js.map +1 -0
- package/_esm/accounts/thirdweb/utils/decodeCallData.js +7 -5
- package/_esm/accounts/thirdweb/utils/decodeCallData.js.map +1 -1
- package/_esm/accounts/trust/index.js +5 -0
- package/_esm/accounts/trust/index.js.map +1 -0
- package/_esm/accounts/trust/utils/decodeCallData.js +7 -5
- package/_esm/accounts/trust/utils/decodeCallData.js.map +1 -1
- package/_esm/actions/{erc7579.js → erc7579/index.js} +9 -9
- package/_esm/actions/erc7579/index.js.map +1 -0
- package/_esm/actions/etherspot/index.js +2 -0
- package/_esm/actions/etherspot/index.js.map +1 -0
- package/_esm/actions/passkeyServer/index.js +4 -0
- package/_esm/actions/passkeyServer/index.js.map +1 -0
- package/_esm/actions/pimlico/estimateErc20PaymasterCost.js +7 -3
- package/_esm/actions/pimlico/estimateErc20PaymasterCost.js.map +1 -1
- package/_esm/actions/pimlico/index.js +8 -0
- package/_esm/actions/pimlico/index.js.map +1 -0
- package/_esm/actions/smartAccount/index.js +5 -0
- package/_esm/actions/smartAccount/index.js.map +1 -0
- package/_esm/clients/createSmartAccountClient.js.map +1 -1
- package/_esm/clients/decorators/pimlico.js +1 -1
- package/_esm/clients/decorators/pimlico.js.map +1 -1
- package/_esm/clients/{passkeyServer.js → passkeyServer/index.js} +2 -2
- package/_esm/clients/passkeyServer/index.js.map +1 -0
- package/_esm/clients/{pimlico.js → pimlico/index.js} +2 -2
- package/_esm/clients/pimlico/index.js.map +1 -0
- package/_esm/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js +5 -4
- package/_esm/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js.map +1 -1
- package/_types/accounts/biconomy/index.d.ts +6 -0
- package/_types/accounts/biconomy/index.d.ts.map +1 -0
- package/_types/accounts/biconomy/toBiconomySmartAccount.d.ts.map +1 -1
- package/_types/accounts/etherspot/index.d.ts +6 -0
- package/_types/accounts/etherspot/index.d.ts.map +1 -0
- package/_types/accounts/kernel/index.d.ts +22 -0
- package/_types/accounts/kernel/index.d.ts.map +1 -0
- package/_types/accounts/kernel/toKernelSmartAccount.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/signMessage.d.ts +4 -5
- package/_types/accounts/kernel/utils/signMessage.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/signTypedData.d.ts +4 -4
- package/_types/accounts/kernel/utils/signTypedData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/wrapMessageHash.d.ts +8 -3
- package/_types/accounts/kernel/utils/wrapMessageHash.d.ts.map +1 -1
- package/_types/accounts/light/index.d.ts +6 -0
- package/_types/accounts/light/index.d.ts.map +1 -0
- package/_types/accounts/light/toLightSmartAccount.d.ts.map +1 -1
- package/_types/accounts/nexus/index.d.ts +6 -0
- package/_types/accounts/nexus/index.d.ts.map +1 -0
- package/_types/accounts/safe/signUserOperation.d.ts.map +1 -1
- package/_types/accounts/safe/toSafeSmartAccount.d.ts.map +1 -1
- package/_types/accounts/simple/index.d.ts +9 -0
- package/_types/accounts/simple/index.d.ts.map +1 -0
- package/_types/accounts/simple/toSimpleSmartAccount.d.ts.map +1 -1
- package/_types/accounts/thirdweb/index.d.ts +6 -0
- package/_types/accounts/thirdweb/index.d.ts.map +1 -0
- package/_types/accounts/thirdweb/utils/decodeCallData.d.ts.map +1 -1
- package/_types/accounts/trust/index.d.ts +6 -0
- package/_types/accounts/trust/index.d.ts.map +1 -0
- package/_types/accounts/trust/utils/decodeCallData.d.ts.map +1 -1
- package/_types/actions/{erc7579.d.ts → erc7579/index.d.ts} +11 -11
- package/_types/actions/erc7579/index.d.ts.map +1 -0
- package/_types/actions/etherspot/index.d.ts +2 -0
- package/_types/actions/etherspot/index.d.ts.map +1 -0
- package/_types/actions/passkeyServer/index.d.ts +4 -0
- package/_types/actions/passkeyServer/index.d.ts.map +1 -0
- package/_types/actions/pimlico/estimateErc20PaymasterCost.d.ts.map +1 -1
- package/_types/actions/pimlico/index.d.ts +8 -0
- package/_types/actions/pimlico/index.d.ts.map +1 -0
- package/_types/actions/smartAccount/index.d.ts +5 -0
- package/_types/actions/smartAccount/index.d.ts.map +1 -0
- package/_types/clients/createSmartAccountClient.d.ts +9 -1
- package/_types/clients/createSmartAccountClient.d.ts.map +1 -1
- package/_types/clients/decorators/pimlico.d.ts +1 -1
- package/_types/clients/decorators/pimlico.d.ts.map +1 -1
- package/_types/clients/{passkeyServer.d.ts → passkeyServer/index.d.ts} +8 -4
- package/_types/clients/passkeyServer/index.d.ts.map +1 -0
- package/_types/clients/pimlico/index.d.ts +21 -0
- package/_types/clients/pimlico/index.d.ts.map +1 -0
- package/_types/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.d.ts.map +1 -1
- package/accounts/biconomy/index.ts +11 -0
- package/accounts/biconomy/package.json +6 -0
- package/accounts/biconomy/toBiconomySmartAccount.ts +13 -5
- package/accounts/etherspot/index.ts +11 -0
- package/accounts/etherspot/package.json +6 -0
- package/accounts/kernel/index.ts +33 -0
- package/accounts/kernel/package.json +6 -0
- package/accounts/kernel/toKernelSmartAccount.ts +13 -6
- package/accounts/kernel/utils/signMessage.ts +19 -15
- package/accounts/kernel/utils/signTypedData.ts +14 -11
- package/accounts/kernel/utils/wrapMessageHash.ts +11 -8
- package/accounts/light/index.ts +12 -0
- package/accounts/light/package.json +6 -0
- package/accounts/light/toLightSmartAccount.ts +13 -5
- package/accounts/nexus/index.ts +11 -0
- package/accounts/nexus/package.json +6 -0
- package/accounts/package.json +6 -0
- package/accounts/safe/package.json +6 -0
- package/accounts/safe/signUserOperation.ts +4 -0
- package/accounts/safe/toSafeSmartAccount.ts +5 -3
- package/accounts/simple/index.ts +18 -0
- package/accounts/simple/package.json +6 -0
- package/accounts/simple/toSimpleSmartAccount.ts +21 -10
- package/accounts/thirdweb/index.ts +11 -0
- package/accounts/thirdweb/package.json +6 -0
- package/accounts/thirdweb/utils/decodeCallData.ts +9 -5
- package/accounts/trust/index.ts +11 -0
- package/accounts/trust/package.json +6 -0
- package/accounts/trust/utils/decodeCallData.ts +9 -5
- package/actions/{erc7579.ts → erc7579/index.ts} +10 -16
- package/actions/erc7579/package.json +6 -0
- package/actions/{etherspot.ts → etherspot/index.ts} +1 -1
- package/actions/etherspot/package.json +6 -0
- package/actions/{passkeyServer.ts → passkeyServer/index.ts} +3 -3
- package/actions/passkeyServer/package.json +6 -0
- package/actions/pimlico/estimateErc20PaymasterCost.ts +9 -3
- package/actions/{pimlico.ts → pimlico/index.ts} +7 -7
- package/actions/pimlico/package.json +6 -0
- package/actions/smartAccount/index.ts +7 -0
- package/actions/smartAccount/package.json +6 -0
- package/clients/createSmartAccountClient.ts +45 -20
- package/clients/decorators/pimlico.ts +10 -10
- package/clients/package.json +6 -0
- package/clients/{passkeyServer.ts → passkeyServer/index.ts} +15 -13
- package/clients/passkeyServer/package.json +6 -0
- package/clients/{pimlico.ts → pimlico/index.ts} +50 -23
- package/clients/pimlico/package.json +6 -0
- package/errors/package.json +6 -0
- package/experimental/pimlico/package.json +6 -0
- package/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.ts +6 -4
- package/package.json +74 -29
- package/utils/package.json +6 -0
- package/_cjs/actions/erc7579.js.map +0 -1
- package/_cjs/actions/etherspot.js.map +0 -1
- package/_cjs/actions/passkeyServer.js.map +0 -1
- package/_cjs/actions/pimlico.js.map +0 -1
- package/_cjs/actions/smartAccount.js.map +0 -1
- package/_cjs/clients/passkeyServer.js.map +0 -1
- package/_cjs/clients/pimlico.js.map +0 -1
- package/_esm/actions/erc7579.js.map +0 -1
- package/_esm/actions/etherspot.js +0 -2
- package/_esm/actions/etherspot.js.map +0 -1
- package/_esm/actions/passkeyServer.js +0 -4
- package/_esm/actions/passkeyServer.js.map +0 -1
- package/_esm/actions/pimlico.js +0 -8
- package/_esm/actions/pimlico.js.map +0 -1
- package/_esm/actions/smartAccount.js +0 -5
- package/_esm/actions/smartAccount.js.map +0 -1
- package/_esm/clients/passkeyServer.js.map +0 -1
- package/_esm/clients/pimlico.js.map +0 -1
- package/_types/actions/erc7579.d.ts.map +0 -1
- package/_types/actions/etherspot.d.ts +0 -2
- package/_types/actions/etherspot.d.ts.map +0 -1
- package/_types/actions/passkeyServer.d.ts +0 -4
- package/_types/actions/passkeyServer.d.ts.map +0 -1
- package/_types/actions/pimlico.d.ts +0 -8
- package/_types/actions/pimlico.d.ts.map +0 -1
- package/_types/actions/smartAccount.d.ts +0 -5
- package/_types/actions/smartAccount.d.ts.map +0 -1
- package/_types/clients/passkeyServer.d.ts.map +0 -1
- package/_types/clients/pimlico.d.ts +0 -13
- package/_types/clients/pimlico.d.ts.map +0 -1
- package/accounts/decodeCalls.test.ts +0 -505
- package/accounts/safe/signUserOperation.test.ts +0 -275
- package/actions/erc7579/accountId.test.ts +0 -39
- package/actions/erc7579/installModule.test.ts +0 -216
- package/actions/erc7579/installModules.test.ts +0 -237
- package/actions/erc7579/isModuleInstalled.test.ts +0 -72
- package/actions/erc7579/supportsExecutionMode.test.ts +0 -108
- package/actions/erc7579/supportsModule.test.ts +0 -35
- package/actions/erc7579/uninstallModule.test.ts +0 -129
- package/actions/erc7579/uninstallModules.test.ts +0 -117
- package/actions/pimlico/getTokenQuotes.test.ts +0 -90
- package/actions/pimlico/getUserOperationGasPrice.test.ts +0 -82
- package/actions/pimlico/getUserOperationStatus.test.ts +0 -199
- package/actions/pimlico/sponsorUserOperation.test.ts +0 -236
- package/actions/pimlico/validateSponsorshipPolicies.test.ts +0 -153
- package/actions/public/getAccountNonce.test.ts +0 -96
- package/actions/public/getSenderAddress.test.ts +0 -154
- package/actions/smartAccount/getCallsStatus.test.ts +0 -255
- package/actions/smartAccount/sendCalls.test.ts +0 -571
- package/actions/smartAccount/sendTransaction.test.ts +0 -416
- package/actions/smartAccount/signMessage.test.ts +0 -219
- package/actions/smartAccount/signTypedData.test.ts +0 -228
- package/actions/smartAccount.ts +0 -7
- package/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.test.ts +0 -523
- package/types/package.json +0 -6
- package/utils/decodeNonce.test.ts +0 -40
- package/utils/deepHexlify.test.ts +0 -57
- package/utils/encode7579Calls.test.ts +0 -69
- package/utils/encodeNonce.test.ts +0 -38
- package/utils/erc20AllowanceOverride.test.ts +0 -59
- package/utils/erc20BalanceOverride.test.ts +0 -57
- package/utils/getAddressFromInitCodeOrPaymasterAndData.test.ts +0 -31
- package/utils/getPackedUserOperation.test.ts +0 -204
- package/utils/getRequiredPrefund.test.ts +0 -90
- package/vitest.config.ts +0 -31
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import { getAddress, zeroAddress } from "viem"
|
|
2
|
-
import { privateKeyToAccount } from "viem/accounts"
|
|
3
|
-
import { describe, expect } from "vitest"
|
|
4
|
-
import { testWithRpc } from "../../../permissionless-test/src/testWithRpc"
|
|
5
|
-
import {
|
|
6
|
-
getCoreSmartAccounts,
|
|
7
|
-
getPublicClient
|
|
8
|
-
} from "../../../permissionless-test/src/utils"
|
|
9
|
-
import { signTypedData } from "./signTypedData"
|
|
10
|
-
|
|
11
|
-
const privateKey =
|
|
12
|
-
"0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356"
|
|
13
|
-
|
|
14
|
-
const typedData = {
|
|
15
|
-
domain: {
|
|
16
|
-
name: "Ether Mail",
|
|
17
|
-
version: "1",
|
|
18
|
-
chainId: 1,
|
|
19
|
-
verifyingContract: getAddress(
|
|
20
|
-
"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"
|
|
21
|
-
)
|
|
22
|
-
},
|
|
23
|
-
types: {
|
|
24
|
-
Person: [
|
|
25
|
-
{ name: "name", type: "string" },
|
|
26
|
-
{ name: "wallet", type: "address" }
|
|
27
|
-
],
|
|
28
|
-
Mail: [
|
|
29
|
-
{ name: "from", type: "Person" },
|
|
30
|
-
{ name: "to", type: "Person" },
|
|
31
|
-
{ name: "contents", type: "string" }
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
primaryType: "Mail" as const,
|
|
35
|
-
message: {
|
|
36
|
-
from: {
|
|
37
|
-
name: "Cow",
|
|
38
|
-
wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"
|
|
39
|
-
},
|
|
40
|
-
to: {
|
|
41
|
-
name: "Bob",
|
|
42
|
-
wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"
|
|
43
|
-
},
|
|
44
|
-
contents: "Hello, Bob!"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
describe.each(getCoreSmartAccounts())(
|
|
49
|
-
"signTypedData $name",
|
|
50
|
-
({
|
|
51
|
-
getSmartAccountClient,
|
|
52
|
-
isEip1271Compliant,
|
|
53
|
-
supportsEntryPointV06,
|
|
54
|
-
supportsEntryPointV07,
|
|
55
|
-
supportsEntryPointV08,
|
|
56
|
-
isEip7702Compliant,
|
|
57
|
-
name
|
|
58
|
-
}) => {
|
|
59
|
-
testWithRpc.skipIf(isEip1271Compliant || !supportsEntryPointV06)(
|
|
60
|
-
"not isEip1271Compliant_v06",
|
|
61
|
-
async ({ rpc }) => {
|
|
62
|
-
const smartClient = await getSmartAccountClient({
|
|
63
|
-
entryPoint: {
|
|
64
|
-
version: "0.6"
|
|
65
|
-
},
|
|
66
|
-
...rpc
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
await expect(async () =>
|
|
70
|
-
signTypedData(smartClient, typedData)
|
|
71
|
-
).rejects.toThrow()
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
testWithRpc.skipIf(!isEip1271Compliant || !supportsEntryPointV06)(
|
|
76
|
-
"isEip1271Compliant_v06",
|
|
77
|
-
async ({ rpc }) => {
|
|
78
|
-
const { anvilRpc } = rpc
|
|
79
|
-
|
|
80
|
-
const smartClient = await getSmartAccountClient({
|
|
81
|
-
entryPoint: {
|
|
82
|
-
version: "0.6"
|
|
83
|
-
},
|
|
84
|
-
...rpc
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
const signature = await signTypedData(smartClient, typedData)
|
|
88
|
-
|
|
89
|
-
const publicClient = getPublicClient(anvilRpc)
|
|
90
|
-
|
|
91
|
-
const isVerified = await publicClient.verifyTypedData({
|
|
92
|
-
...typedData,
|
|
93
|
-
address: smartClient.account.address,
|
|
94
|
-
signature
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
expect(isVerified).toBeTruthy()
|
|
98
|
-
}
|
|
99
|
-
)
|
|
100
|
-
|
|
101
|
-
testWithRpc.skipIf(isEip1271Compliant || !supportsEntryPointV07)(
|
|
102
|
-
"not isEip1271Compliant_v07",
|
|
103
|
-
async ({ rpc }) => {
|
|
104
|
-
const smartClient = await getSmartAccountClient({
|
|
105
|
-
entryPoint: {
|
|
106
|
-
version: "0.7"
|
|
107
|
-
},
|
|
108
|
-
...rpc
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
await expect(async () =>
|
|
112
|
-
signTypedData(smartClient, typedData)
|
|
113
|
-
).rejects.toThrow()
|
|
114
|
-
}
|
|
115
|
-
)
|
|
116
|
-
|
|
117
|
-
testWithRpc.skipIf(!isEip1271Compliant || !supportsEntryPointV07)(
|
|
118
|
-
"isEip1271Compliant_v07",
|
|
119
|
-
async ({ rpc }) => {
|
|
120
|
-
const { anvilRpc } = rpc
|
|
121
|
-
|
|
122
|
-
const privateKeyAccount = privateKeyToAccount(privateKey)
|
|
123
|
-
|
|
124
|
-
const smartClient = await getSmartAccountClient({
|
|
125
|
-
entryPoint: {
|
|
126
|
-
version: "0.7"
|
|
127
|
-
},
|
|
128
|
-
privateKey, // anvil private key
|
|
129
|
-
...rpc
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
const signature = await signTypedData(smartClient, typedData)
|
|
133
|
-
|
|
134
|
-
const publicClient = getPublicClient(anvilRpc)
|
|
135
|
-
|
|
136
|
-
if (name === "LightAccount 2.0.0") {
|
|
137
|
-
// LightAccount 2.0.0 doesn't support EIP-1271
|
|
138
|
-
return
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (
|
|
142
|
-
name.includes("Safe 7579") ||
|
|
143
|
-
name.includes("Kernel 0.3.3 + EIP-7702")
|
|
144
|
-
) {
|
|
145
|
-
const publicClient = getPublicClient(anvilRpc)
|
|
146
|
-
|
|
147
|
-
// Due to 7579 launchpad, we can't verify the signature before deploying the account.
|
|
148
|
-
await smartClient.sendTransaction({
|
|
149
|
-
calls: [{ to: zeroAddress, value: 0n }],
|
|
150
|
-
authorization: isEip7702Compliant
|
|
151
|
-
? await privateKeyAccount.signAuthorization({
|
|
152
|
-
address: (smartClient.account as any)
|
|
153
|
-
.implementation,
|
|
154
|
-
chainId: smartClient.chain.id,
|
|
155
|
-
nonce: await publicClient.getTransactionCount(
|
|
156
|
-
{
|
|
157
|
-
address: smartClient.account.address
|
|
158
|
-
}
|
|
159
|
-
)
|
|
160
|
-
})
|
|
161
|
-
: undefined
|
|
162
|
-
})
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
const isVerified = await publicClient.verifyTypedData({
|
|
166
|
-
...typedData,
|
|
167
|
-
address: smartClient.account.address,
|
|
168
|
-
signature
|
|
169
|
-
})
|
|
170
|
-
|
|
171
|
-
expect(isVerified).toBeTruthy()
|
|
172
|
-
}
|
|
173
|
-
)
|
|
174
|
-
|
|
175
|
-
testWithRpc.skipIf(isEip1271Compliant || !supportsEntryPointV08)(
|
|
176
|
-
"not isEip1271Compliant_v08",
|
|
177
|
-
async ({ rpc }) => {
|
|
178
|
-
const smartClient = await getSmartAccountClient({
|
|
179
|
-
entryPoint: {
|
|
180
|
-
version: "0.8"
|
|
181
|
-
},
|
|
182
|
-
...rpc
|
|
183
|
-
})
|
|
184
|
-
|
|
185
|
-
await expect(async () =>
|
|
186
|
-
signTypedData(smartClient, typedData)
|
|
187
|
-
).rejects.toThrow()
|
|
188
|
-
}
|
|
189
|
-
)
|
|
190
|
-
|
|
191
|
-
testWithRpc.skipIf(!isEip1271Compliant || !supportsEntryPointV08)(
|
|
192
|
-
"isEip1271Compliant_v08",
|
|
193
|
-
async ({ rpc }) => {
|
|
194
|
-
const { anvilRpc } = rpc
|
|
195
|
-
|
|
196
|
-
const smartClient = await getSmartAccountClient({
|
|
197
|
-
entryPoint: {
|
|
198
|
-
version: "0.8"
|
|
199
|
-
},
|
|
200
|
-
...rpc
|
|
201
|
-
})
|
|
202
|
-
|
|
203
|
-
const signature = await signTypedData(smartClient, typedData)
|
|
204
|
-
|
|
205
|
-
const publicClient = getPublicClient(anvilRpc)
|
|
206
|
-
|
|
207
|
-
if (name === "LightAccount 2.0.0") {
|
|
208
|
-
// LightAccount 2.0.0 doesn't support EIP-1271
|
|
209
|
-
return
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
if (name.includes("Safe 7579")) {
|
|
213
|
-
// Due to 7579 launchpad, we can't verify the signature before deploying the account.
|
|
214
|
-
await smartClient.sendTransaction({
|
|
215
|
-
calls: [{ to: zeroAddress, value: 0n }]
|
|
216
|
-
})
|
|
217
|
-
}
|
|
218
|
-
const isVerified = await publicClient.verifyTypedData({
|
|
219
|
-
...typedData,
|
|
220
|
-
address: smartClient.account.address,
|
|
221
|
-
signature
|
|
222
|
-
})
|
|
223
|
-
|
|
224
|
-
expect(isVerified).toBeTruthy()
|
|
225
|
-
}
|
|
226
|
-
)
|
|
227
|
-
}
|
|
228
|
-
)
|
package/actions/smartAccount.ts
DELETED