permissionless 0.2.12 → 0.2.14
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/toBiconomySmartAccount.js.map +1 -1
- package/_cjs/accounts/index.js +3 -1
- package/_cjs/accounts/index.js.map +1 -1
- package/_cjs/accounts/nexus/toNexusSmartAccount.js +198 -0
- package/_cjs/accounts/nexus/toNexusSmartAccount.js.map +1 -0
- package/_cjs/accounts/safe/toSafeSmartAccount.js +1 -9
- package/_cjs/accounts/safe/toSafeSmartAccount.js.map +1 -1
- package/_cjs/actions/erc7579/isModuleInstalled.js +8 -13
- package/_cjs/actions/erc7579/isModuleInstalled.js.map +1 -1
- package/_cjs/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js +5 -3
- package/_cjs/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js.map +1 -1
- package/_cjs/utils/encodeInstallModule.js +9 -6
- package/_cjs/utils/encodeInstallModule.js.map +1 -1
- package/_cjs/utils/encodeUninstallModule.js +9 -6
- package/_cjs/utils/encodeUninstallModule.js.map +1 -1
- package/_esm/accounts/biconomy/toBiconomySmartAccount.js +2 -7
- package/_esm/accounts/biconomy/toBiconomySmartAccount.js.map +1 -1
- package/_esm/accounts/index.js +2 -1
- package/_esm/accounts/index.js.map +1 -1
- package/_esm/accounts/nexus/toNexusSmartAccount.js +201 -0
- package/_esm/accounts/nexus/toNexusSmartAccount.js.map +1 -0
- package/_esm/accounts/safe/toSafeSmartAccount.js +1 -9
- package/_esm/accounts/safe/toSafeSmartAccount.js.map +1 -1
- package/_esm/actions/erc7579/isModuleInstalled.js +8 -13
- package/_esm/actions/erc7579/isModuleInstalled.js.map +1 -1
- package/_esm/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js +5 -3
- package/_esm/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js.map +1 -1
- package/_esm/utils/encodeInstallModule.js +9 -6
- package/_esm/utils/encodeInstallModule.js.map +1 -1
- package/_esm/utils/encodeUninstallModule.js +9 -6
- package/_esm/utils/encodeUninstallModule.js.map +1 -1
- package/_types/accounts/biconomy/toBiconomySmartAccount.d.ts +2 -7
- package/_types/accounts/biconomy/toBiconomySmartAccount.d.ts.map +1 -1
- package/_types/accounts/index.d.ts +2 -1
- package/_types/accounts/index.d.ts.map +1 -1
- package/_types/accounts/nexus/toNexusSmartAccount.d.ts +26 -0
- package/_types/accounts/nexus/toNexusSmartAccount.d.ts.map +1 -0
- package/_types/accounts/safe/toSafeSmartAccount.d.ts.map +1 -1
- package/_types/actions/erc7579/isModuleInstalled.d.ts.map +1 -1
- package/_types/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.d.ts.map +1 -1
- package/_types/utils/encodeInstallModule.d.ts.map +1 -1
- package/_types/utils/encodeUninstallModule.d.ts.map +1 -1
- package/accounts/biconomy/toBiconomySmartAccount.ts +2 -8
- package/accounts/index.ts +11 -0
- package/accounts/nexus/toNexusSmartAccount.ts +331 -0
- package/accounts/safe/toSafeSmartAccount.ts +1 -12
- package/actions/erc7579/installModule.test.ts +4 -4
- package/actions/erc7579/installModules.test.ts +4 -4
- package/actions/erc7579/isModuleInstalled.test.ts +2 -2
- package/actions/erc7579/isModuleInstalled.ts +8 -13
- package/actions/erc7579/uninstallModule.test.ts +2 -2
- package/actions/erc7579/uninstallModules.test.ts +2 -2
- package/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.ts +6 -5
- package/package.json +1 -1
- package/utils/encodeInstallModule.ts +9 -6
- package/utils/encodeUninstallModule.ts +9 -6
|
@@ -35,7 +35,7 @@ describe.each(getCoreSmartAccounts())(
|
|
|
35
35
|
const opHash = await smartClient.installModule({
|
|
36
36
|
account: smartClient.account as any,
|
|
37
37
|
type: "executor",
|
|
38
|
-
address: "
|
|
38
|
+
address: "0x4Fd8d57b94966982B62e9588C27B4171B55E8354",
|
|
39
39
|
context: name.startsWith("Kernel 7579")
|
|
40
40
|
? encodePacked(
|
|
41
41
|
["address", "bytes"],
|
|
@@ -60,7 +60,7 @@ describe.each(getCoreSmartAccounts())(
|
|
|
60
60
|
{
|
|
61
61
|
account: smartClient.account,
|
|
62
62
|
type: "executor",
|
|
63
|
-
address: "
|
|
63
|
+
address: "0x4Fd8d57b94966982B62e9588C27B4171B55E8354",
|
|
64
64
|
context: "0x"
|
|
65
65
|
}
|
|
66
66
|
)
|
|
@@ -58,28 +58,23 @@ export async function isModuleInstalled<
|
|
|
58
58
|
|
|
59
59
|
const abi = [
|
|
60
60
|
{
|
|
61
|
-
name: "isModuleInstalled",
|
|
62
61
|
type: "function",
|
|
63
|
-
|
|
62
|
+
name: "isModuleInstalled",
|
|
64
63
|
inputs: [
|
|
65
64
|
{
|
|
65
|
+
name: "moduleType",
|
|
66
66
|
type: "uint256",
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
type: "address",
|
|
71
|
-
name: "module"
|
|
67
|
+
internalType: "uint256"
|
|
72
68
|
},
|
|
69
|
+
{ name: "module", type: "address", internalType: "address" },
|
|
73
70
|
{
|
|
71
|
+
name: "additionalContext",
|
|
74
72
|
type: "bytes",
|
|
75
|
-
|
|
73
|
+
internalType: "bytes"
|
|
76
74
|
}
|
|
77
75
|
],
|
|
78
|
-
outputs: [
|
|
79
|
-
|
|
80
|
-
type: "bool"
|
|
81
|
-
}
|
|
82
|
-
]
|
|
76
|
+
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
77
|
+
stateMutability: "view"
|
|
83
78
|
}
|
|
84
79
|
] as const
|
|
85
80
|
|
|
@@ -34,7 +34,7 @@ describe.each(getCoreSmartAccounts())(
|
|
|
34
34
|
|
|
35
35
|
const opHash = await smartClient.installModule({
|
|
36
36
|
type: "executor",
|
|
37
|
-
address: "
|
|
37
|
+
address: "0x4Fd8d57b94966982B62e9588C27B4171B55E8354",
|
|
38
38
|
context: name.startsWith("Kernel 7579")
|
|
39
39
|
? encodePacked(
|
|
40
40
|
["address", "bytes"],
|
|
@@ -59,7 +59,7 @@ describe.each(getCoreSmartAccounts())(
|
|
|
59
59
|
{
|
|
60
60
|
account: smartClient.account,
|
|
61
61
|
type: "executor",
|
|
62
|
-
address: "
|
|
62
|
+
address: "0x4Fd8d57b94966982B62e9588C27B4171B55E8354",
|
|
63
63
|
context: name.startsWith("Kernel 7579")
|
|
64
64
|
? "0x"
|
|
65
65
|
: encodeAbiParameters(
|
|
@@ -34,7 +34,7 @@ describe.each(getCoreSmartAccounts())(
|
|
|
34
34
|
|
|
35
35
|
const opHash = await smartClient.installModule({
|
|
36
36
|
type: "executor",
|
|
37
|
-
address: "
|
|
37
|
+
address: "0x4Fd8d57b94966982B62e9588C27B4171B55E8354",
|
|
38
38
|
context: name.startsWith("Kernel 7579")
|
|
39
39
|
? encodePacked(
|
|
40
40
|
["address", "bytes"],
|
|
@@ -62,7 +62,7 @@ describe.each(getCoreSmartAccounts())(
|
|
|
62
62
|
{
|
|
63
63
|
type: "executor",
|
|
64
64
|
address:
|
|
65
|
-
"
|
|
65
|
+
"0x4Fd8d57b94966982B62e9588C27B4171B55E8354",
|
|
66
66
|
context: name.startsWith("Kernel 7579")
|
|
67
67
|
? "0x"
|
|
68
68
|
: encodeAbiParameters(
|
|
@@ -138,15 +138,16 @@ export const prepareUserOperationForErc20Paymaster =
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
////////////////////////////////////////////////////////////////////////////////
|
|
141
|
-
|
|
142
141
|
// Call prepareUserOperation
|
|
143
142
|
////////////////////////////////////////////////////////////////////////////////
|
|
144
143
|
|
|
145
144
|
const allowanceSlot = _allowanceSlot ?? quotes[0].allowanceSlot
|
|
146
145
|
const balanceSlot = _balanceSlot ?? quotes[0].balanceSlot
|
|
147
146
|
|
|
148
|
-
const
|
|
149
|
-
|
|
147
|
+
const hasAllowanceSlot = allowanceSlot !== undefined
|
|
148
|
+
const hasBalanceSlot = balanceSlot !== undefined
|
|
149
|
+
|
|
150
|
+
const hasSlot = hasAllowanceSlot && hasBalanceSlot
|
|
150
151
|
|
|
151
152
|
if (!hasSlot && balanceOverride) {
|
|
152
153
|
throw new Error(
|
|
@@ -155,7 +156,7 @@ export const prepareUserOperationForErc20Paymaster =
|
|
|
155
156
|
}
|
|
156
157
|
|
|
157
158
|
const balanceStateOverride =
|
|
158
|
-
balanceOverride &&
|
|
159
|
+
balanceOverride && hasBalanceSlot
|
|
159
160
|
? erc20BalanceOverride({
|
|
160
161
|
token,
|
|
161
162
|
owner: account.address,
|
|
@@ -164,7 +165,7 @@ export const prepareUserOperationForErc20Paymaster =
|
|
|
164
165
|
: undefined
|
|
165
166
|
|
|
166
167
|
const allowanceStateOverride =
|
|
167
|
-
balanceOverride &&
|
|
168
|
+
balanceOverride && hasAllowanceSlot
|
|
168
169
|
? erc20AllowanceOverride({
|
|
169
170
|
token,
|
|
170
171
|
owner: account.address,
|
package/package.json
CHANGED
|
@@ -54,24 +54,27 @@ export function encodeInstallModule<
|
|
|
54
54
|
data: encodeFunctionData({
|
|
55
55
|
abi: [
|
|
56
56
|
{
|
|
57
|
-
name: "installModule",
|
|
58
57
|
type: "function",
|
|
59
|
-
|
|
58
|
+
name: "installModule",
|
|
60
59
|
inputs: [
|
|
61
60
|
{
|
|
61
|
+
name: "moduleType",
|
|
62
62
|
type: "uint256",
|
|
63
|
-
|
|
63
|
+
internalType: "uint256"
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
|
+
name: "module",
|
|
66
67
|
type: "address",
|
|
67
|
-
|
|
68
|
+
internalType: "address"
|
|
68
69
|
},
|
|
69
70
|
{
|
|
71
|
+
name: "initData",
|
|
70
72
|
type: "bytes",
|
|
71
|
-
|
|
73
|
+
internalType: "bytes"
|
|
72
74
|
}
|
|
73
75
|
],
|
|
74
|
-
outputs: []
|
|
76
|
+
outputs: [],
|
|
77
|
+
stateMutability: "nonpayable"
|
|
75
78
|
}
|
|
76
79
|
],
|
|
77
80
|
functionName: "installModule",
|
|
@@ -54,24 +54,27 @@ export function encodeUninstallModule<
|
|
|
54
54
|
data: encodeFunctionData({
|
|
55
55
|
abi: [
|
|
56
56
|
{
|
|
57
|
-
name: "uninstallModule",
|
|
58
57
|
type: "function",
|
|
59
|
-
|
|
58
|
+
name: "uninstallModule",
|
|
60
59
|
inputs: [
|
|
61
60
|
{
|
|
61
|
+
name: "moduleType",
|
|
62
62
|
type: "uint256",
|
|
63
|
-
|
|
63
|
+
internalType: "uint256"
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
|
+
name: "module",
|
|
66
67
|
type: "address",
|
|
67
|
-
|
|
68
|
+
internalType: "address"
|
|
68
69
|
},
|
|
69
70
|
{
|
|
71
|
+
name: "deInitData",
|
|
70
72
|
type: "bytes",
|
|
71
|
-
|
|
73
|
+
internalType: "bytes"
|
|
72
74
|
}
|
|
73
75
|
],
|
|
74
|
-
outputs: []
|
|
76
|
+
outputs: [],
|
|
77
|
+
stateMutability: "nonpayable"
|
|
75
78
|
}
|
|
76
79
|
],
|
|
77
80
|
functionName: "uninstallModule",
|