permissionless 0.2.3 → 0.2.4
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 +8 -0
- package/README.md +46 -18
- package/_cjs/actions/erc7579/installModule.js +9 -37
- package/_cjs/actions/erc7579/installModule.js.map +1 -1
- package/_cjs/actions/erc7579/installModules.js +11 -33
- package/_cjs/actions/erc7579/installModules.js.map +1 -1
- package/_cjs/actions/erc7579/isModuleInstalled.js +3 -3
- package/_cjs/actions/erc7579/isModuleInstalled.js.map +1 -1
- package/_cjs/actions/erc7579/uninstallModule.js +9 -37
- package/_cjs/actions/erc7579/uninstallModule.js.map +1 -1
- package/_cjs/actions/erc7579/uninstallModules.js +11 -33
- package/_cjs/actions/erc7579/uninstallModules.js.map +1 -1
- package/_cjs/utils/encodeInstallModule.js +53 -0
- package/_cjs/utils/encodeInstallModule.js.map +1 -0
- package/_cjs/utils/encodeUninstallModule.js +53 -0
- package/_cjs/utils/encodeUninstallModule.js.map +1 -0
- package/_cjs/utils/index.js +5 -1
- package/_cjs/utils/index.js.map +1 -1
- package/_esm/actions/erc7579/installModule.js +9 -37
- package/_esm/actions/erc7579/installModule.js.map +1 -1
- package/_esm/actions/erc7579/installModules.js +11 -33
- package/_esm/actions/erc7579/installModules.js.map +1 -1
- package/_esm/actions/erc7579/isModuleInstalled.js +3 -3
- package/_esm/actions/erc7579/isModuleInstalled.js.map +1 -1
- package/_esm/actions/erc7579/uninstallModule.js +9 -37
- package/_esm/actions/erc7579/uninstallModule.js.map +1 -1
- package/_esm/actions/erc7579/uninstallModules.js +11 -33
- package/_esm/actions/erc7579/uninstallModules.js.map +1 -1
- package/_esm/utils/encodeInstallModule.js +49 -0
- package/_esm/utils/encodeInstallModule.js.map +1 -0
- package/_esm/utils/encodeUninstallModule.js +49 -0
- package/_esm/utils/encodeUninstallModule.js.map +1 -0
- package/_esm/utils/index.js +3 -1
- package/_esm/utils/index.js.map +1 -1
- package/_types/actions/erc7579/installModule.d.ts +18 -6
- package/_types/actions/erc7579/installModule.d.ts.map +1 -1
- package/_types/actions/erc7579/installModules.d.ts +13 -9
- package/_types/actions/erc7579/installModules.d.ts.map +1 -1
- package/_types/actions/erc7579/isModuleInstalled.d.ts +5 -2
- package/_types/actions/erc7579/isModuleInstalled.d.ts.map +1 -1
- package/_types/actions/erc7579/uninstallModule.d.ts +18 -6
- package/_types/actions/erc7579/uninstallModule.d.ts.map +1 -1
- package/_types/actions/erc7579/uninstallModules.d.ts +13 -11
- package/_types/actions/erc7579/uninstallModules.d.ts.map +1 -1
- package/_types/utils/encodeInstallModule.d.ts +20 -0
- package/_types/utils/encodeInstallModule.d.ts.map +1 -0
- package/_types/utils/encodeUninstallModule.d.ts +20 -0
- package/_types/utils/encodeUninstallModule.d.ts.map +1 -0
- package/_types/utils/index.d.ts +3 -1
- package/_types/utils/index.d.ts.map +1 -1
- package/actions/erc7579/installModule.test.ts +1 -1
- package/actions/erc7579/installModule.ts +45 -46
- package/actions/erc7579/installModules.test.ts +7 -0
- package/actions/erc7579/installModules.ts +40 -49
- package/actions/erc7579/isModuleInstalled.ts +17 -5
- package/actions/erc7579/uninstallModule.ts +52 -47
- package/actions/erc7579/uninstallModules.ts +40 -51
- package/package.json +2 -8
- package/utils/encodeInstallModule.ts +85 -0
- package/utils/encodeUninstallModule.ts +85 -0
- package/utils/index.ts +11 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { encodeFunctionData, getAddress } from "viem";
|
|
2
1
|
import { sendUserOperation } from "viem/account-abstraction";
|
|
3
2
|
import { getAction, parseAccount } from "viem/utils";
|
|
4
3
|
import { AccountNotFoundError } from "../../errors/index.js";
|
|
5
|
-
import {
|
|
4
|
+
import { encodeInstallModule } from "../../utils/index.js";
|
|
6
5
|
export async function installModule(client, parameters) {
|
|
7
|
-
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, address, context } = parameters;
|
|
6
|
+
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, address, context, initData, type, calls, paymaster, paymasterContext } = parameters;
|
|
8
7
|
if (!account_) {
|
|
9
8
|
throw new AccountNotFoundError({
|
|
10
9
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
@@ -13,41 +12,14 @@ export async function installModule(client, parameters) {
|
|
|
13
12
|
const account = parseAccount(account_);
|
|
14
13
|
return getAction(client, sendUserOperation, "sendUserOperation")({
|
|
15
14
|
calls: [
|
|
16
|
-
{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
{
|
|
22
|
-
name: "installModule",
|
|
23
|
-
type: "function",
|
|
24
|
-
stateMutability: "nonpayable",
|
|
25
|
-
inputs: [
|
|
26
|
-
{
|
|
27
|
-
type: "uint256",
|
|
28
|
-
name: "moduleTypeId"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
type: "address",
|
|
32
|
-
name: "module"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
type: "bytes",
|
|
36
|
-
name: "initData"
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
outputs: []
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
functionName: "installModule",
|
|
43
|
-
args: [
|
|
44
|
-
parseModuleTypeId(parameters.type),
|
|
45
|
-
getAddress(address),
|
|
46
|
-
context
|
|
47
|
-
]
|
|
48
|
-
})
|
|
49
|
-
}
|
|
15
|
+
...encodeInstallModule({
|
|
16
|
+
account,
|
|
17
|
+
modules: [{ address, context: context ?? initData, type }]
|
|
18
|
+
}),
|
|
19
|
+
...(calls ?? [])
|
|
50
20
|
],
|
|
21
|
+
paymaster,
|
|
22
|
+
paymasterContext,
|
|
51
23
|
maxFeePerGas,
|
|
52
24
|
maxPriorityFeePerGas,
|
|
53
25
|
nonce,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installModule.js","sourceRoot":"","sources":["../../../actions/erc7579/installModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"installModule.js","sourceRoot":"","sources":["../../../actions/erc7579/installModule.ts"],"names":[],"mappings":"AACA,OAAO,EAKH,iBAAiB,EACpB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAsCjD,MAAM,CAAC,KAAK,UAAU,aAAa,CAG/B,MAAc,EACd,UAAkD;IAElD,MAAM,EACF,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,OAAO,EACP,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,SAAS,EACT,gBAAgB,EACnB,GAAG,UAAU,CAAA;IAEd,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,oBAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAiB,CAAA;IAEtD,OAAO,SAAS,CACZ,MAAM,EACN,iBAAiB,EACjB,mBAAmB,CACtB,CAAC;QACE,KAAK,EAAE;YACH,GAAG,mBAAmB,CAAC;gBACnB,OAAO;gBACP,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,IAAI,EAAE,CAAC;aAC7D,CAAC;YACF,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACnB;QACD,SAAS;QACT,gBAAgB;QAChB,YAAY;QACZ,oBAAoB;QACpB,KAAK;QACL,OAAO;KACV,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { encodeFunctionData, getAddress } from "viem";
|
|
2
1
|
import { sendUserOperation } from "viem/account-abstraction";
|
|
3
2
|
import { getAction, parseAccount } from "viem/utils";
|
|
4
3
|
import { AccountNotFoundError } from "../../errors/index.js";
|
|
5
|
-
import {
|
|
4
|
+
import { encodeInstallModule } from "../../utils/encodeInstallModule.js";
|
|
6
5
|
export async function installModules(client, parameters) {
|
|
7
|
-
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, modules } = parameters;
|
|
6
|
+
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, modules, paymaster, paymasterContext, calls } = parameters;
|
|
8
7
|
if (!account_) {
|
|
9
8
|
throw new AccountNotFoundError({
|
|
10
9
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
@@ -12,36 +11,15 @@ export async function installModules(client, parameters) {
|
|
|
12
11
|
}
|
|
13
12
|
const account = parseAccount(account_);
|
|
14
13
|
return getAction(client, sendUserOperation, "sendUserOperation")({
|
|
15
|
-
calls:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
inputs: [
|
|
25
|
-
{
|
|
26
|
-
type: "uint256",
|
|
27
|
-
name: "moduleTypeId"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
type: "address",
|
|
31
|
-
name: "module"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
type: "bytes",
|
|
35
|
-
name: "initData"
|
|
36
|
-
}
|
|
37
|
-
],
|
|
38
|
-
outputs: []
|
|
39
|
-
}
|
|
40
|
-
],
|
|
41
|
-
functionName: "installModule",
|
|
42
|
-
args: [parseModuleTypeId(type), getAddress(address), context]
|
|
43
|
-
})
|
|
44
|
-
})),
|
|
14
|
+
calls: [
|
|
15
|
+
...encodeInstallModule({
|
|
16
|
+
account,
|
|
17
|
+
modules
|
|
18
|
+
}),
|
|
19
|
+
...(calls ?? [])
|
|
20
|
+
],
|
|
21
|
+
paymaster,
|
|
22
|
+
paymasterContext,
|
|
45
23
|
maxFeePerGas,
|
|
46
24
|
maxPriorityFeePerGas,
|
|
47
25
|
nonce,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installModules.js","sourceRoot":"","sources":["../../../actions/erc7579/installModules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"installModules.js","sourceRoot":"","sources":["../../../actions/erc7579/installModules.ts"],"names":[],"mappings":"AACA,OAAO,EAIH,iBAAiB,EACpB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAEH,mBAAmB,EACtB,MAAM,iCAAiC,CAAA;AA4BxC,MAAM,CAAC,KAAK,UAAU,cAAc,CAGhC,MAA2D,EAC3D,UAAmD;IAEnD,MAAM,EACF,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,KAAK,EACR,GAAG,UAAU,CAAA;IAEd,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,oBAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAiB,CAAA;IACtD,OAAO,SAAS,CACZ,MAAM,EACN,iBAAiB,EACjB,mBAAmB,CACtB,CAAC;QACE,KAAK,EAAE;YACH,GAAG,mBAAmB,CAAC;gBACnB,OAAO;gBACP,OAAO;aACV,CAAC;YACF,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACnB;QACD,SAAS;QACT,gBAAgB;QAChB,YAAY;QACZ,oBAAoB;QACpB,KAAK;QACL,OAAO,EAAE,OAAO;KACnB,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { getAction, parseAccount } from "viem/utils";
|
|
|
4
4
|
import { AccountNotFoundError } from "../../errors/index.js";
|
|
5
5
|
import { parseModuleTypeId } from "./supportsModule.js";
|
|
6
6
|
export async function isModuleInstalled(client, parameters) {
|
|
7
|
-
const { account: account_ = client.account, address, context } = parameters;
|
|
7
|
+
const { account: account_ = client.account, address, context, additionalContext } = parameters;
|
|
8
8
|
if (!account_) {
|
|
9
9
|
throw new AccountNotFoundError({
|
|
10
10
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
@@ -45,7 +45,7 @@ export async function isModuleInstalled(client, parameters) {
|
|
|
45
45
|
args: [
|
|
46
46
|
parseModuleTypeId(parameters.type),
|
|
47
47
|
getAddress(address),
|
|
48
|
-
context
|
|
48
|
+
context ?? additionalContext
|
|
49
49
|
],
|
|
50
50
|
address: account.address
|
|
51
51
|
});
|
|
@@ -63,7 +63,7 @@ export async function isModuleInstalled(client, parameters) {
|
|
|
63
63
|
args: [
|
|
64
64
|
parseModuleTypeId(parameters.type),
|
|
65
65
|
getAddress(address),
|
|
66
|
-
context
|
|
66
|
+
context ?? additionalContext
|
|
67
67
|
]
|
|
68
68
|
})
|
|
69
69
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isModuleInstalled.js","sourceRoot":"","sources":["../../../actions/erc7579/isModuleInstalled.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,8BAA8B,
|
|
1
|
+
{"version":3,"file":"isModuleInstalled.js","sourceRoot":"","sources":["../../../actions/erc7579/isModuleInstalled.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,8BAA8B,EAI9B,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,EACb,MAAM,MAAM,CAAA;AAKb,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAmB,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAgBrE,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAGnC,MAA2D,EAC3D,UAAsD;IAEtD,MAAM,EACF,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,OAAO,EACP,OAAO,EACP,iBAAiB,EACpB,GAAG,UAAU,CAAA;IAEd,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,oBAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAiB,CAAA;IAEtD,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAA;IAEnC,MAAM,GAAG,GAAG;QACR;YACI,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE,UAAU;YAChB,eAAe,EAAE,MAAM;YACvB,MAAM,EAAE;gBACJ;oBACI,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,cAAc;iBACvB;gBACD;oBACI,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,QAAQ;iBACjB;gBACD;oBACI,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,mBAAmB;iBAC5B;aACJ;YACD,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,MAAM;iBACf;aACJ;SACJ;KACK,CAAA;IAEV,IAAI,CAAC;QACD,OAAO,MAAM,SAAS,CAClB,YAAY,EACZ,YAAY,EACZ,cAAc,CACjB,CAAC;YACE,GAAG;YACH,YAAY,EAAE,mBAAmB;YACjC,IAAI,EAAE;gBACF,iBAAiB,CAAC,UAAU,CAAC,IAAI,CAAC;gBAClC,UAAU,CAAC,OAAO,CAAC;gBACnB,OAAO,IAAI,iBAAiB;aAC/B;YACD,OAAO,EAAE,OAAO,CAAC,OAAO;SAC3B,CAAC,CAAA;IACN,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,IAAI,KAAK,YAAY,8BAA8B,EAAE,CAAC;YAClD,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,MAAM,OAAO,CAAC,cAAc,EAAE,CAAA;YAE/D,MAAM,MAAM,GAAG,MAAM,SAAS,CAC1B,YAAY,EACZ,IAAI,EACJ,MAAM,CACT,CAAC;gBACE,OAAO,EAAE,OAAO;gBAChB,WAAW,EAAE,WAAW;gBACxB,EAAE,EAAE,OAAO,CAAC,OAAO;gBACnB,IAAI,EAAE,kBAAkB,CAAC;oBACrB,GAAG;oBACH,YAAY,EAAE,mBAAmB;oBACjC,IAAI,EAAE;wBACF,iBAAiB,CAAC,UAAU,CAAC,IAAI,CAAC;wBAClC,UAAU,CAAC,OAAO,CAAC;wBACnB,OAAO,IAAI,iBAAiB;qBAC/B;iBACJ,CAAC;aACL,CAAC,CAAA;YAEF,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;YAChD,CAAC;YAED,OAAO,oBAAoB,CAAC;gBACxB,GAAG;gBACH,YAAY,EAAE,mBAAmB;gBACjC,IAAI,EAAE,MAAM,CAAC,IAAI;aACpB,CAAC,CAAA;QACN,CAAC;QAED,MAAM,KAAK,CAAA;IACf,CAAC;AACL,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { encodeFunctionData, getAddress } from "viem";
|
|
2
1
|
import { sendUserOperation } from "viem/account-abstraction";
|
|
3
2
|
import { getAction } from "viem/utils";
|
|
4
3
|
import { parseAccount } from "viem/utils";
|
|
5
4
|
import { AccountNotFoundError } from "../../errors/index.js";
|
|
6
|
-
import {
|
|
5
|
+
import { encodeUninstallModule } from "../../utils/encodeUninstallModule.js";
|
|
7
6
|
export async function uninstallModule(client, parameters) {
|
|
8
|
-
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, address, context } = parameters;
|
|
7
|
+
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, address, context, deInitData, type, calls, paymaster, paymasterContext } = parameters;
|
|
9
8
|
if (!account_) {
|
|
10
9
|
throw new AccountNotFoundError({
|
|
11
10
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
@@ -14,41 +13,14 @@ export async function uninstallModule(client, parameters) {
|
|
|
14
13
|
const account = parseAccount(account_);
|
|
15
14
|
return getAction(client, sendUserOperation, "sendUserOperation")({
|
|
16
15
|
calls: [
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
name: "uninstallModule",
|
|
24
|
-
type: "function",
|
|
25
|
-
stateMutability: "nonpayable",
|
|
26
|
-
inputs: [
|
|
27
|
-
{
|
|
28
|
-
type: "uint256",
|
|
29
|
-
name: "moduleTypeId"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
type: "address",
|
|
33
|
-
name: "module"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
type: "bytes",
|
|
37
|
-
name: "deInitData"
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
outputs: []
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
functionName: "uninstallModule",
|
|
44
|
-
args: [
|
|
45
|
-
parseModuleTypeId(parameters.type),
|
|
46
|
-
getAddress(address),
|
|
47
|
-
context
|
|
48
|
-
]
|
|
49
|
-
})
|
|
50
|
-
}
|
|
16
|
+
...encodeUninstallModule({
|
|
17
|
+
account,
|
|
18
|
+
modules: [{ type, address, context: context ?? deInitData }]
|
|
19
|
+
}),
|
|
20
|
+
...(calls ?? [])
|
|
51
21
|
],
|
|
22
|
+
paymaster,
|
|
23
|
+
paymasterContext,
|
|
52
24
|
maxFeePerGas,
|
|
53
25
|
maxPriorityFeePerGas,
|
|
54
26
|
nonce,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstallModule.js","sourceRoot":"","sources":["../../../actions/erc7579/uninstallModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uninstallModule.js","sourceRoot":"","sources":["../../../actions/erc7579/uninstallModule.ts"],"names":[],"mappings":"AASA,OAAO,EAKH,iBAAiB,EACpB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AAsCzE,MAAM,CAAC,KAAK,UAAU,eAAe,CAGjC,MAA2D,EAC3D,UAAoD;IAEpD,MAAM,EACF,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,OAAO,EACP,OAAO,EACP,UAAU,EACV,IAAI,EACJ,KAAK,EACL,SAAS,EACT,gBAAgB,EACnB,GAAG,UAAU,CAAA;IAEd,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,oBAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAiB,CAAA;IAEtD,OAAO,SAAS,CACZ,MAAM,EACN,iBAAiB,EACjB,mBAAmB,CACtB,CAAC;QACE,KAAK,EAAE;YACH,GAAG,qBAAqB,CAAC;gBACrB,OAAO;gBACP,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,CAAC;aAC/D,CAAC;YACF,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACnB;QACD,SAAS;QACT,gBAAgB;QAChB,YAAY;QACZ,oBAAoB;QACpB,KAAK;QACL,OAAO,EAAE,OAAO;KACnB,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { encodeFunctionData, getAddress } from "viem";
|
|
2
1
|
import { sendUserOperation } from "viem/account-abstraction";
|
|
3
2
|
import { getAction } from "viem/utils";
|
|
4
3
|
import { parseAccount } from "viem/utils";
|
|
5
4
|
import { AccountNotFoundError } from "../../errors/index.js";
|
|
6
|
-
import {
|
|
5
|
+
import { encodeUninstallModule } from "../../utils/encodeUninstallModule.js";
|
|
7
6
|
export async function uninstallModules(client, parameters) {
|
|
8
|
-
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, modules } = parameters;
|
|
7
|
+
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, modules, calls, paymaster, paymasterContext } = parameters;
|
|
9
8
|
if (!account_) {
|
|
10
9
|
throw new AccountNotFoundError({
|
|
11
10
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
@@ -13,36 +12,15 @@ export async function uninstallModules(client, parameters) {
|
|
|
13
12
|
}
|
|
14
13
|
const account = parseAccount(account_);
|
|
15
14
|
return getAction(client, sendUserOperation, "sendUserOperation")({
|
|
16
|
-
calls:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
inputs: [
|
|
26
|
-
{
|
|
27
|
-
type: "uint256",
|
|
28
|
-
name: "moduleTypeId"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
type: "address",
|
|
32
|
-
name: "module"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
type: "bytes",
|
|
36
|
-
name: "deInitData"
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
outputs: []
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
functionName: "uninstallModule",
|
|
43
|
-
args: [parseModuleTypeId(type), getAddress(address), context]
|
|
44
|
-
})
|
|
45
|
-
})),
|
|
15
|
+
calls: [
|
|
16
|
+
...encodeUninstallModule({
|
|
17
|
+
account,
|
|
18
|
+
modules
|
|
19
|
+
}),
|
|
20
|
+
...(calls ?? [])
|
|
21
|
+
],
|
|
22
|
+
paymaster,
|
|
23
|
+
paymasterContext,
|
|
46
24
|
maxFeePerGas,
|
|
47
25
|
maxPriorityFeePerGas,
|
|
48
26
|
nonce,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstallModules.js","sourceRoot":"","sources":["../../../actions/erc7579/uninstallModules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uninstallModules.js","sourceRoot":"","sources":["../../../actions/erc7579/uninstallModules.ts"],"names":[],"mappings":"AACA,OAAO,EAIH,iBAAiB,EACpB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAEH,qBAAqB,EACxB,MAAM,mCAAmC,CAAA;AA4B1C,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAGlC,MAA2D,EAC3D,UAAqD;IAErD,MAAM,EACF,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,OAAO,EACP,KAAK,EACL,SAAS,EACT,gBAAgB,EACnB,GAAG,UAAU,CAAA;IAEd,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,oBAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAiB,CAAA;IAEtD,OAAO,SAAS,CACZ,MAAM,EACN,iBAAiB,EACjB,mBAAmB,CACtB,CAAC;QACE,KAAK,EAAE;YACH,GAAG,qBAAqB,CAAC;gBACrB,OAAO;gBACP,OAAO;aACV,CAAC;YACF,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACnB;QACD,SAAS;QACT,gBAAgB;QAChB,YAAY;QACZ,oBAAoB;QACpB,KAAK;QACL,OAAO;KACV,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { encodeFunctionData, getAddress } from "viem";
|
|
2
|
+
import { parseModuleTypeId } from "../actions/erc7579/supportsModule.js";
|
|
3
|
+
import { AccountNotFoundError } from "../errors/index.js";
|
|
4
|
+
export function encodeInstallModule(parameters) {
|
|
5
|
+
const account = parameters.account;
|
|
6
|
+
if (!account) {
|
|
7
|
+
throw new AccountNotFoundError({
|
|
8
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
const modules = Array.isArray(parameters.modules)
|
|
12
|
+
? parameters.modules
|
|
13
|
+
: [parameters.modules];
|
|
14
|
+
return modules.map(({ type, address, context, initData }) => ({
|
|
15
|
+
to: account.address,
|
|
16
|
+
value: BigInt(0),
|
|
17
|
+
data: encodeFunctionData({
|
|
18
|
+
abi: [
|
|
19
|
+
{
|
|
20
|
+
name: "installModule",
|
|
21
|
+
type: "function",
|
|
22
|
+
stateMutability: "nonpayable",
|
|
23
|
+
inputs: [
|
|
24
|
+
{
|
|
25
|
+
type: "uint256",
|
|
26
|
+
name: "moduleTypeId"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: "address",
|
|
30
|
+
name: "module"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: "bytes",
|
|
34
|
+
name: "initData"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
outputs: []
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
functionName: "installModule",
|
|
41
|
+
args: [
|
|
42
|
+
parseModuleTypeId(type),
|
|
43
|
+
getAddress(address),
|
|
44
|
+
context ?? initData
|
|
45
|
+
]
|
|
46
|
+
})
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=encodeInstallModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encodeInstallModule.js","sourceRoot":"","sources":["../../utils/encodeInstallModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,kBAAkB,EAClB,UAAU,EACb,MAAM,MAAM,CAAA;AAKb,OAAO,EAEH,iBAAiB,EACpB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAoBhD,MAAM,UAAU,mBAAmB,CAEjC,UAAwD;IACtD,MAAM,OAAO,GAAG,UAAU,CAAC,OAAuB,CAAA;IAElD,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,oBAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;QAC7C,CAAC,CAAC,UAAU,CAAC,OAAO;QACpB,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;IAE1B,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;QAC1D,EAAE,EAAE,OAAO,CAAC,OAAO;QACnB,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;QAChB,IAAI,EAAE,kBAAkB,CAAC;YACrB,GAAG,EAAE;gBACD;oBACI,IAAI,EAAE,eAAe;oBACrB,IAAI,EAAE,UAAU;oBAChB,eAAe,EAAE,YAAY;oBAC7B,MAAM,EAAE;wBACJ;4BACI,IAAI,EAAE,SAAS;4BACf,IAAI,EAAE,cAAc;yBACvB;wBACD;4BACI,IAAI,EAAE,SAAS;4BACf,IAAI,EAAE,QAAQ;yBACjB;wBACD;4BACI,IAAI,EAAE,OAAO;4BACb,IAAI,EAAE,UAAU;yBACnB;qBACJ;oBACD,OAAO,EAAE,EAAE;iBACd;aACJ;YACD,YAAY,EAAE,eAAe;YAC7B,IAAI,EAAE;gBACF,iBAAiB,CAAC,IAAI,CAAC;gBACvB,UAAU,CAAC,OAAO,CAAC;gBACnB,OAAO,IAAI,QAAQ;aACtB;SACJ,CAAC;KACL,CAAC,CAAC,CAAA;AACP,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { encodeFunctionData, getAddress } from "viem";
|
|
2
|
+
import { parseModuleTypeId } from "../actions/erc7579/supportsModule.js";
|
|
3
|
+
import { AccountNotFoundError } from "../errors/index.js";
|
|
4
|
+
export function encodeUninstallModule(parameters) {
|
|
5
|
+
const account = parameters.account;
|
|
6
|
+
if (!account) {
|
|
7
|
+
throw new AccountNotFoundError({
|
|
8
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
const modules = Array.isArray(parameters.modules)
|
|
12
|
+
? parameters.modules
|
|
13
|
+
: [parameters.modules];
|
|
14
|
+
return modules.map(({ type, address, context, deInitData }) => ({
|
|
15
|
+
to: account.address,
|
|
16
|
+
value: BigInt(0),
|
|
17
|
+
data: encodeFunctionData({
|
|
18
|
+
abi: [
|
|
19
|
+
{
|
|
20
|
+
name: "uninstallModule",
|
|
21
|
+
type: "function",
|
|
22
|
+
stateMutability: "nonpayable",
|
|
23
|
+
inputs: [
|
|
24
|
+
{
|
|
25
|
+
type: "uint256",
|
|
26
|
+
name: "moduleTypeId"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: "address",
|
|
30
|
+
name: "module"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: "bytes",
|
|
34
|
+
name: "deInitData"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
outputs: []
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
functionName: "uninstallModule",
|
|
41
|
+
args: [
|
|
42
|
+
parseModuleTypeId(type),
|
|
43
|
+
getAddress(address),
|
|
44
|
+
context ?? deInitData
|
|
45
|
+
]
|
|
46
|
+
})
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=encodeUninstallModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encodeUninstallModule.js","sourceRoot":"","sources":["../../utils/encodeUninstallModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,kBAAkB,EAClB,UAAU,EACb,MAAM,MAAM,CAAA;AAKb,OAAO,EAEH,iBAAiB,EACpB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAoBhD,MAAM,UAAU,qBAAqB,CAEnC,UAA0D;IACxD,MAAM,OAAO,GAAG,UAAU,CAAC,OAAuB,CAAA;IAElD,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,oBAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;QAC7C,CAAC,CAAC,UAAU,CAAC,OAAO;QACpB,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;IAE1B,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5D,EAAE,EAAE,OAAO,CAAC,OAAO;QACnB,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;QAChB,IAAI,EAAE,kBAAkB,CAAC;YACrB,GAAG,EAAE;gBACD;oBACI,IAAI,EAAE,iBAAiB;oBACvB,IAAI,EAAE,UAAU;oBAChB,eAAe,EAAE,YAAY;oBAC7B,MAAM,EAAE;wBACJ;4BACI,IAAI,EAAE,SAAS;4BACf,IAAI,EAAE,cAAc;yBACvB;wBACD;4BACI,IAAI,EAAE,SAAS;4BACf,IAAI,EAAE,QAAQ;yBACjB;wBACD;4BACI,IAAI,EAAE,OAAO;4BACb,IAAI,EAAE,YAAY;yBACrB;qBACJ;oBACD,OAAO,EAAE,EAAE;iBACd;aACJ;YACD,YAAY,EAAE,iBAAiB;YAC/B,IAAI,EAAE;gBACF,iBAAiB,CAAC,IAAI,CAAC;gBACvB,UAAU,CAAC,OAAO,CAAC;gBACnB,OAAO,IAAI,UAAU;aACxB;SACJ,CAAC;KACL,CAAC,CAAC,CAAA;AACP,CAAC"}
|
package/_esm/utils/index.js
CHANGED
|
@@ -5,6 +5,8 @@ import { isSmartAccountDeployed } from "./isSmartAccountDeployed.js";
|
|
|
5
5
|
import { toOwner } from "./toOwner.js";
|
|
6
6
|
import { decodeNonce } from "./decodeNonce.js";
|
|
7
7
|
import { encodeNonce } from "./encodeNonce.js";
|
|
8
|
+
import { encodeInstallModule } from "./encodeInstallModule.js";
|
|
8
9
|
import { getPackedUserOperation } from "./getPackedUserOperation.js";
|
|
9
|
-
|
|
10
|
+
import { encode7579Calls } from "./encode7579Calls.js";
|
|
11
|
+
export { transactionReceiptStatus, deepHexlify, getRequiredPrefund, toOwner, isSmartAccountDeployed, getAddressFromInitCodeOrPaymasterAndData, getPackedUserOperation, encodeNonce, decodeNonce, encodeInstallModule, encode7579Calls };
|
|
10
12
|
//# sourceMappingURL=index.js.map
|
package/_esm/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAA;AACrE,OAAO,EAAE,wCAAwC,EAAE,MAAM,4CAA4C,CAAA;AACrG,OAAO,EAEH,kBAAkB,EACrB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EACH,wBAAwB,EACxB,WAAW,EACX,kBAAkB,EAClB,OAAO,EAEP,sBAAsB,EACtB,wCAAwC,EACxC,sBAAsB,EACtB,WAAW,EACX,WAAW,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAA;AACrE,OAAO,EAAE,wCAAwC,EAAE,MAAM,4CAA4C,CAAA;AACrG,OAAO,EAEH,kBAAkB,EACrB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,EAEH,mBAAmB,EACtB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAA6B,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAE9E,OAAO,EACH,wBAAwB,EACxB,WAAW,EACX,kBAAkB,EAClB,OAAO,EAEP,sBAAsB,EACtB,wCAAwC,EACxC,sBAAsB,EACtB,WAAW,EACX,WAAW,EAEX,mBAAmB,EAEnB,eAAe,EAClB,CAAA"}
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type GetSmartAccountParameter, type SmartAccount } from "viem/account-abstraction";
|
|
3
|
-
import {
|
|
4
|
-
export type InstallModuleParameters<TSmartAccount extends SmartAccount | undefined> = GetSmartAccountParameter<TSmartAccount> & {
|
|
1
|
+
import type { Address, Client, Hex, Narrow, OneOf } from "viem";
|
|
2
|
+
import { type GetSmartAccountParameter, type PaymasterActions, type SmartAccount, type UserOperationCalls } from "viem/account-abstraction";
|
|
3
|
+
import type { ModuleType } from "./supportsModule";
|
|
4
|
+
export type InstallModuleParameters<TSmartAccount extends SmartAccount | undefined, calls extends readonly unknown[] = readonly unknown[]> = GetSmartAccountParameter<TSmartAccount> & {
|
|
5
5
|
type: ModuleType;
|
|
6
6
|
address: Address;
|
|
7
|
-
context: Hex;
|
|
8
7
|
maxFeePerGas?: bigint;
|
|
9
8
|
maxPriorityFeePerGas?: bigint;
|
|
10
9
|
nonce?: bigint;
|
|
11
|
-
|
|
10
|
+
calls?: UserOperationCalls<Narrow<calls>>;
|
|
11
|
+
paymaster?: Address | true | {
|
|
12
|
+
/** Retrieves paymaster-related User Operation properties to be used for sending the User Operation. */
|
|
13
|
+
getPaymasterData?: PaymasterActions["getPaymasterData"] | undefined;
|
|
14
|
+
/** Retrieves paymaster-related User Operation properties to be used for gas estimation. */
|
|
15
|
+
getPaymasterStubData?: PaymasterActions["getPaymasterStubData"] | undefined;
|
|
16
|
+
} | undefined;
|
|
17
|
+
/** Paymaster context to pass to `getPaymasterData` and `getPaymasterStubData` calls. */
|
|
18
|
+
paymasterContext?: unknown | undefined;
|
|
19
|
+
} & OneOf<{
|
|
20
|
+
context: Hex;
|
|
21
|
+
} | {
|
|
22
|
+
initData: Hex;
|
|
23
|
+
}>;
|
|
12
24
|
export declare function installModule<TSmartAccount extends SmartAccount | undefined>(client: Client, parameters: InstallModuleParameters<TSmartAccount>): Promise<Hex>;
|
|
13
25
|
//# sourceMappingURL=installModule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installModule.d.ts","sourceRoot":"","sources":["../../../actions/erc7579/installModule.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"installModule.d.ts","sourceRoot":"","sources":["../../../actions/erc7579/installModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAC/D,OAAO,EACH,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAE1B,MAAM,0BAA0B,CAAA;AAIjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,MAAM,MAAM,uBAAuB,CAC/B,aAAa,SAAS,YAAY,GAAG,SAAS,EAC9C,KAAK,SAAS,SAAS,OAAO,EAAE,GAAG,SAAS,OAAO,EAAE,IACrD,wBAAwB,CAAC,aAAa,CAAC,GAAG;IAC1C,IAAI,EAAE,UAAU,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IACzC,SAAS,CAAC,EACJ,OAAO,GACP,IAAI,GACJ;QACI,uGAAuG;QACvG,gBAAgB,CAAC,EACX,gBAAgB,CAAC,kBAAkB,CAAC,GACpC,SAAS,CAAA;QACf,2FAA2F;QAC3F,oBAAoB,CAAC,EACf,gBAAgB,CAAC,sBAAsB,CAAC,GACxC,SAAS,CAAA;KAClB,GACD,SAAS,CAAA;IACf,wFAAwF;IACxF,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CACzC,GAAG,KAAK,CACC;IACI,OAAO,EAAE,GAAG,CAAA;CACf,GACD;IACI,QAAQ,EAAE,GAAG,CAAA;CAChB,CACN,CAAA;AAEL,wBAAsB,aAAa,CAC/B,aAAa,SAAS,YAAY,GAAG,SAAS,EAE9C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,uBAAuB,CAAC,aAAa,CAAC,GACnD,OAAO,CAAC,GAAG,CAAC,CA0Cd"}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
4
|
-
export type InstallModulesParameters<TSmartAccount extends SmartAccount | undefined> =
|
|
5
|
-
modules: {
|
|
6
|
-
type: ModuleType;
|
|
7
|
-
address: Address;
|
|
8
|
-
context: Hex;
|
|
9
|
-
}[];
|
|
1
|
+
import type { Address, Chain, Client, Hex, Narrow, Transport } from "viem";
|
|
2
|
+
import { type PaymasterActions, type SmartAccount, type UserOperationCalls } from "viem/account-abstraction";
|
|
3
|
+
import { type EncodeInstallModuleParameters } from "../../utils/encodeInstallModule";
|
|
4
|
+
export type InstallModulesParameters<TSmartAccount extends SmartAccount | undefined, calls extends readonly unknown[] = readonly unknown[]> = EncodeInstallModuleParameters<TSmartAccount> & {
|
|
10
5
|
maxFeePerGas?: bigint;
|
|
11
6
|
maxPriorityFeePerGas?: bigint;
|
|
12
7
|
nonce?: bigint;
|
|
8
|
+
calls?: UserOperationCalls<Narrow<calls>>;
|
|
9
|
+
paymaster?: Address | true | {
|
|
10
|
+
/** Retrieves paymaster-related User Operation properties to be used for sending the User Operation. */
|
|
11
|
+
getPaymasterData?: PaymasterActions["getPaymasterData"] | undefined;
|
|
12
|
+
/** Retrieves paymaster-related User Operation properties to be used for gas estimation. */
|
|
13
|
+
getPaymasterStubData?: PaymasterActions["getPaymasterStubData"] | undefined;
|
|
14
|
+
} | undefined;
|
|
15
|
+
/** Paymaster context to pass to `getPaymasterData` and `getPaymasterStubData` calls. */
|
|
16
|
+
paymasterContext?: unknown | undefined;
|
|
13
17
|
};
|
|
14
18
|
export declare function installModules<TSmartAccount extends SmartAccount | undefined>(client: Client<Transport, Chain | undefined, TSmartAccount>, parameters: InstallModulesParameters<TSmartAccount>): Promise<Hex>;
|
|
15
19
|
//# sourceMappingURL=installModules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installModules.d.ts","sourceRoot":"","sources":["../../../actions/erc7579/installModules.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"installModules.d.ts","sourceRoot":"","sources":["../../../actions/erc7579/installModules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAC1E,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAE1B,MAAM,0BAA0B,CAAA;AAGjC,OAAO,EACH,KAAK,6BAA6B,EAErC,MAAM,iCAAiC,CAAA;AAExC,MAAM,MAAM,wBAAwB,CAChC,aAAa,SAAS,YAAY,GAAG,SAAS,EAC9C,KAAK,SAAS,SAAS,OAAO,EAAE,GAAG,SAAS,OAAO,EAAE,IACrD,6BAA6B,CAAC,aAAa,CAAC,GAAG;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IACzC,SAAS,CAAC,EACJ,OAAO,GACP,IAAI,GACJ;QACI,uGAAuG;QACvG,gBAAgB,CAAC,EACX,gBAAgB,CAAC,kBAAkB,CAAC,GACpC,SAAS,CAAA;QACf,2FAA2F;QAC3F,oBAAoB,CAAC,EACf,gBAAgB,CAAC,sBAAsB,CAAC,GACxC,SAAS,CAAA;KAClB,GACD,SAAS,CAAA;IACf,wFAAwF;IACxF,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CACzC,CAAA;AAED,wBAAsB,cAAc,CAChC,aAAa,SAAS,YAAY,GAAG,SAAS,EAE9C,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,aAAa,CAAC,EAC3D,UAAU,EAAE,wBAAwB,CAAC,aAAa,CAAC,GACpD,OAAO,CAAC,GAAG,CAAC,CAsCd"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { type Address, type Chain, type Client, type Hex, type Transport } from "viem";
|
|
1
|
+
import { type Address, type Chain, type Client, type Hex, type OneOf, type Transport } from "viem";
|
|
2
2
|
import type { GetSmartAccountParameter, SmartAccount } from "viem/account-abstraction";
|
|
3
3
|
import { type ModuleType } from "./supportsModule";
|
|
4
4
|
export type IsModuleInstalledParameters<TSmartAccount extends SmartAccount | undefined> = GetSmartAccountParameter<TSmartAccount> & {
|
|
5
5
|
type: ModuleType;
|
|
6
6
|
address: Address;
|
|
7
|
+
} & OneOf<{
|
|
8
|
+
additionalContext: Hex;
|
|
9
|
+
} | {
|
|
7
10
|
context: Hex;
|
|
8
|
-
}
|
|
11
|
+
}>;
|
|
9
12
|
export declare function isModuleInstalled<TSmartAccount extends SmartAccount | undefined>(client: Client<Transport, Chain | undefined, TSmartAccount>, parameters: IsModuleInstalledParameters<TSmartAccount>): Promise<boolean>;
|
|
10
13
|
//# sourceMappingURL=isModuleInstalled.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isModuleInstalled.d.ts","sourceRoot":"","sources":["../../../actions/erc7579/isModuleInstalled.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,MAAM,EAEX,KAAK,GAAG,EACR,KAAK,SAAS,EAIjB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EACR,wBAAwB,EACxB,YAAY,EACf,MAAM,0BAA0B,CAAA;AAIjC,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,kBAAkB,CAAA;AAErE,MAAM,MAAM,2BAA2B,CACnC,aAAa,SAAS,YAAY,GAAG,SAAS,IAC9C,wBAAwB,CAAC,aAAa,CAAC,GAAG;IAC1C,IAAI,EAAE,UAAU,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"isModuleInstalled.d.ts","sourceRoot":"","sources":["../../../actions/erc7579/isModuleInstalled.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,MAAM,EAEX,KAAK,GAAG,EACR,KAAK,KAAK,EACV,KAAK,SAAS,EAIjB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EACR,wBAAwB,EACxB,YAAY,EACf,MAAM,0BAA0B,CAAA;AAIjC,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,kBAAkB,CAAA;AAErE,MAAM,MAAM,2BAA2B,CACnC,aAAa,SAAS,YAAY,GAAG,SAAS,IAC9C,wBAAwB,CAAC,aAAa,CAAC,GAAG;IAC1C,IAAI,EAAE,UAAU,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;CACnB,GAAG,KAAK,CACC;IACI,iBAAiB,EAAE,GAAG,CAAA;CACzB,GACD;IACI,OAAO,EAAE,GAAG,CAAA;CACf,CACN,CAAA;AAEL,wBAAsB,iBAAiB,CACnC,aAAa,SAAS,YAAY,GAAG,SAAS,EAE9C,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,aAAa,CAAC,EAC3D,UAAU,EAAE,2BAA2B,CAAC,aAAa,CAAC,GACvD,OAAO,CAAC,OAAO,CAAC,CAgGlB"}
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type GetSmartAccountParameter, type SmartAccount } from "viem/account-abstraction";
|
|
3
|
-
import {
|
|
4
|
-
export type UninstallModuleParameters<TSmartAccount extends SmartAccount | undefined> = GetSmartAccountParameter<TSmartAccount> & {
|
|
1
|
+
import type { Address, Chain, Client, Hex, Narrow, OneOf, Transport } from "viem";
|
|
2
|
+
import { type GetSmartAccountParameter, type PaymasterActions, type SmartAccount, type UserOperationCalls } from "viem/account-abstraction";
|
|
3
|
+
import type { ModuleType } from "./supportsModule";
|
|
4
|
+
export type UninstallModuleParameters<TSmartAccount extends SmartAccount | undefined, calls extends readonly unknown[] = readonly unknown[]> = GetSmartAccountParameter<TSmartAccount> & {
|
|
5
5
|
type: ModuleType;
|
|
6
6
|
address: Address;
|
|
7
|
-
context: Hex;
|
|
8
7
|
maxFeePerGas?: bigint;
|
|
9
8
|
maxPriorityFeePerGas?: bigint;
|
|
10
9
|
nonce?: bigint;
|
|
11
|
-
|
|
10
|
+
calls?: UserOperationCalls<Narrow<calls>>;
|
|
11
|
+
paymaster?: Address | true | {
|
|
12
|
+
/** Retrieves paymaster-related User Operation properties to be used for sending the User Operation. */
|
|
13
|
+
getPaymasterData?: PaymasterActions["getPaymasterData"] | undefined;
|
|
14
|
+
/** Retrieves paymaster-related User Operation properties to be used for gas estimation. */
|
|
15
|
+
getPaymasterStubData?: PaymasterActions["getPaymasterStubData"] | undefined;
|
|
16
|
+
} | undefined;
|
|
17
|
+
/** Paymaster context to pass to `getPaymasterData` and `getPaymasterStubData` calls. */
|
|
18
|
+
paymasterContext?: unknown | undefined;
|
|
19
|
+
} & OneOf<{
|
|
20
|
+
deInitData: Hex;
|
|
21
|
+
} | {
|
|
22
|
+
context: Hex;
|
|
23
|
+
}>;
|
|
12
24
|
export declare function uninstallModule<TSmartAccount extends SmartAccount | undefined>(client: Client<Transport, Chain | undefined, TSmartAccount>, parameters: UninstallModuleParameters<TSmartAccount>): Promise<Hex>;
|
|
13
25
|
//# sourceMappingURL=uninstallModule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstallModule.d.ts","sourceRoot":"","sources":["../../../actions/erc7579/uninstallModule.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"uninstallModule.d.ts","sourceRoot":"","sources":["../../../actions/erc7579/uninstallModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EACP,KAAK,EACL,MAAM,EACN,GAAG,EACH,MAAM,EACN,KAAK,EACL,SAAS,EACZ,MAAM,MAAM,CAAA;AACb,OAAO,EACH,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAE1B,MAAM,0BAA0B,CAAA;AAKjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,MAAM,MAAM,yBAAyB,CACjC,aAAa,SAAS,YAAY,GAAG,SAAS,EAC9C,KAAK,SAAS,SAAS,OAAO,EAAE,GAAG,SAAS,OAAO,EAAE,IACrD,wBAAwB,CAAC,aAAa,CAAC,GAAG;IAC1C,IAAI,EAAE,UAAU,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IACzC,SAAS,CAAC,EACJ,OAAO,GACP,IAAI,GACJ;QACI,uGAAuG;QACvG,gBAAgB,CAAC,EACX,gBAAgB,CAAC,kBAAkB,CAAC,GACpC,SAAS,CAAA;QACf,2FAA2F;QAC3F,oBAAoB,CAAC,EACf,gBAAgB,CAAC,sBAAsB,CAAC,GACxC,SAAS,CAAA;KAClB,GACD,SAAS,CAAA;IACf,wFAAwF;IACxF,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CACzC,GAAG,KAAK,CACC;IACI,UAAU,EAAE,GAAG,CAAA;CAClB,GACD;IACI,OAAO,EAAE,GAAG,CAAA;CACf,CACN,CAAA;AAEL,wBAAsB,eAAe,CACjC,aAAa,SAAS,YAAY,GAAG,SAAS,EAE9C,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,aAAa,CAAC,EAC3D,UAAU,EAAE,yBAAyB,CAAC,aAAa,CAAC,GACrD,OAAO,CAAC,GAAG,CAAC,CA0Cd"}
|