@account-kit/wallet-client 0.0.1-alpha.1
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/esm/abi/LightAccountFactoryAbi_V1_0_1.d.ts +55 -0
- package/dist/esm/abi/LightAccountFactoryAbi_V1_0_1.js +45 -0
- package/dist/esm/abi/LightAccountFactoryAbi_V1_0_1.js.map +1 -0
- package/dist/esm/abi/LightAccountFactoryAbi_V1_0_2.d.ts +55 -0
- package/dist/esm/abi/LightAccountFactoryAbi_V1_0_2.js +45 -0
- package/dist/esm/abi/LightAccountFactoryAbi_V1_0_2.js.map +1 -0
- package/dist/esm/abi/LightAccountFactoryAbi_V1_1_0.d.ts +55 -0
- package/dist/esm/abi/LightAccountFactoryAbi_V1_1_0.js +45 -0
- package/dist/esm/abi/LightAccountFactoryAbi_V1_1_0.js.map +1 -0
- package/dist/esm/abi/LightAccountFactoryAbi_V2_0_0.d.ts +256 -0
- package/dist/esm/abi/LightAccountFactoryAbi_V2_0_0.js +202 -0
- package/dist/esm/abi/LightAccountFactoryAbi_V2_0_0.js.map +1 -0
- package/dist/esm/abi/ModularAccountFactoryAbi_V2_0_0.d.ts +492 -0
- package/dist/esm/abi/ModularAccountFactoryAbi_V2_0_0.js +399 -0
- package/dist/esm/abi/ModularAccountFactoryAbi_V2_0_0.js.map +1 -0
- package/dist/esm/abi/MultiOwnerLightAccountFactoryAbi_V2_0_0.d.ts +286 -0
- package/dist/esm/abi/MultiOwnerLightAccountFactoryAbi_V2_0_0.js +225 -0
- package/dist/esm/abi/MultiOwnerLightAccountFactoryAbi_V2_0_0.js.map +1 -0
- package/dist/esm/abi/MultiOwnerModularAccountFactoryAbi_V1_0_0.d.ts +234 -0
- package/dist/esm/abi/MultiOwnerModularAccountFactoryAbi_V1_0_0.js +179 -0
- package/dist/esm/abi/MultiOwnerModularAccountFactoryAbi_V1_0_0.js.map +1 -0
- package/dist/esm/abi/MultisigModularAccountFactoryAbi_V1_0_0.d.ts +246 -0
- package/dist/esm/abi/MultisigModularAccountFactoryAbi_V1_0_0.js +182 -0
- package/dist/esm/abi/MultisigModularAccountFactoryAbi_V1_0_0.js.map +1 -0
- package/dist/esm/abi/index.d.ts +8 -0
- package/dist/esm/abi/index.js +9 -0
- package/dist/esm/abi/index.js.map +1 -0
- package/dist/esm/capabilities/index.d.ts +8 -0
- package/dist/esm/capabilities/index.js +8 -0
- package/dist/esm/capabilities/index.js.map +1 -0
- package/dist/esm/capabilities/paymaster.d.ts +3 -0
- package/dist/esm/capabilities/paymaster.js +5 -0
- package/dist/esm/capabilities/paymaster.js.map +1 -0
- package/dist/esm/capabilities/permissions/index.d.ts +98 -0
- package/dist/esm/capabilities/permissions/index.js +60 -0
- package/dist/esm/capabilities/permissions/index.js.map +1 -0
- package/dist/esm/capabilities/permissions/mav2.d.ts +36 -0
- package/dist/esm/capabilities/permissions/mav2.js +79 -0
- package/dist/esm/capabilities/permissions/mav2.js.map +1 -0
- package/dist/esm/client/actions/createAccount.d.ts +10 -0
- package/dist/esm/client/actions/createAccount.js +7 -0
- package/dist/esm/client/actions/createAccount.js.map +1 -0
- package/dist/esm/client/actions/getCallsStatus.d.ts +6 -0
- package/dist/esm/client/actions/getCallsStatus.js +7 -0
- package/dist/esm/client/actions/getCallsStatus.js.map +1 -0
- package/dist/esm/client/actions/grantPermissions.d.ts +13 -0
- package/dist/esm/client/actions/grantPermissions.js +11 -0
- package/dist/esm/client/actions/grantPermissions.js.map +1 -0
- package/dist/esm/client/actions/listAccounts.d.ts +6 -0
- package/dist/esm/client/actions/listAccounts.js +4 -0
- package/dist/esm/client/actions/listAccounts.js.map +1 -0
- package/dist/esm/client/actions/prepareCalls.d.ts +15 -0
- package/dist/esm/client/actions/prepareCalls.js +17 -0
- package/dist/esm/client/actions/prepareCalls.js.map +1 -0
- package/dist/esm/client/actions/requestAccount.d.ts +11 -0
- package/dist/esm/client/actions/requestAccount.js +28 -0
- package/dist/esm/client/actions/requestAccount.js.map +1 -0
- package/dist/esm/client/actions/sendPreparedCalls.d.ts +6 -0
- package/dist/esm/client/actions/sendPreparedCalls.js +8 -0
- package/dist/esm/client/actions/sendPreparedCalls.js.map +1 -0
- package/dist/esm/client/actions/signMessage.d.ts +6 -0
- package/dist/esm/client/actions/signMessage.js +7 -0
- package/dist/esm/client/actions/signMessage.js.map +1 -0
- package/dist/esm/client/actions/signSignatureRequest.d.ts +10 -0
- package/dist/esm/client/actions/signSignatureRequest.js +15 -0
- package/dist/esm/client/actions/signSignatureRequest.js.map +1 -0
- package/dist/esm/client/actions/signTypedData.d.ts +6 -0
- package/dist/esm/client/actions/signTypedData.js +7 -0
- package/dist/esm/client/actions/signTypedData.js.map +1 -0
- package/dist/esm/client/client.e2e-test.d.ts +1 -0
- package/dist/esm/client/client.e2e-test.js +238 -0
- package/dist/esm/client/client.e2e-test.js.map +1 -0
- package/dist/esm/client/decorator.d.ts +24 -0
- package/dist/esm/client/decorator.js +25 -0
- package/dist/esm/client/decorator.js.map +1 -0
- package/dist/esm/client/index.d.ts +18 -0
- package/dist/esm/client/index.js +43 -0
- package/dist/esm/client/index.js.map +1 -0
- package/dist/esm/exports/index.d.ts +13 -0
- package/dist/esm/exports/index.js +18 -0
- package/dist/esm/exports/index.js.map +1 -0
- package/dist/esm/exports/internal.d.ts +13 -0
- package/dist/esm/exports/internal.js +15 -0
- package/dist/esm/exports/internal.js.map +1 -0
- package/dist/esm/isomorphic/actions/createSession.d.ts +14 -0
- package/dist/esm/isomorphic/actions/createSession.js +63 -0
- package/dist/esm/isomorphic/actions/createSession.js.map +1 -0
- package/dist/esm/isomorphic/actions/getCallsStatus.d.ts +21 -0
- package/dist/esm/isomorphic/actions/getCallsStatus.js +60 -0
- package/dist/esm/isomorphic/actions/getCallsStatus.js.map +1 -0
- package/dist/esm/isomorphic/actions/prepareCalls.d.ts +8 -0
- package/dist/esm/isomorphic/actions/prepareCalls.js +57 -0
- package/dist/esm/isomorphic/actions/prepareCalls.js.map +1 -0
- package/dist/esm/isomorphic/actions/sendPreparedCalls.d.ts +8 -0
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js +43 -0
- package/dist/esm/isomorphic/actions/sendPreparedCalls.js.map +1 -0
- package/dist/esm/isomorphic/client.d.ts +97 -0
- package/dist/esm/isomorphic/client.js +30 -0
- package/dist/esm/isomorphic/client.js.map +1 -0
- package/dist/esm/isomorphic/utils/createAccount.d.ts +22 -0
- package/dist/esm/isomorphic/utils/createAccount.js +32 -0
- package/dist/esm/isomorphic/utils/createAccount.js.map +1 -0
- package/dist/esm/isomorphic/utils/createDummySigner.d.ts +3 -0
- package/dist/esm/isomorphic/utils/createDummySigner.js +17 -0
- package/dist/esm/isomorphic/utils/createDummySigner.js.map +1 -0
- package/dist/esm/isomorphic/utils/parsePermissionsContext.d.ts +20 -0
- package/dist/esm/isomorphic/utils/parsePermissionsContext.js +21 -0
- package/dist/esm/isomorphic/utils/parsePermissionsContext.js.map +1 -0
- package/dist/esm/local/client.d.ts +3 -0
- package/dist/esm/local/client.js +89 -0
- package/dist/esm/local/client.js.map +1 -0
- package/dist/esm/remote/client.d.ts +3 -0
- package/dist/esm/remote/client.js +42 -0
- package/dist/esm/remote/client.js.map +1 -0
- package/dist/esm/rpc/request.d.ts +329 -0
- package/dist/esm/rpc/request.js +194 -0
- package/dist/esm/rpc/request.js.map +1 -0
- package/dist/esm/rpc/schema.d.ts +319 -0
- package/dist/esm/rpc/schema.js +5 -0
- package/dist/esm/rpc/schema.js.map +1 -0
- package/dist/esm/schemas.d.ts +216 -0
- package/dist/esm/schemas.js +211 -0
- package/dist/esm/schemas.js.map +1 -0
- package/dist/esm/types.d.ts +27 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils.d.ts +4 -0
- package/dist/esm/utils.js +12 -0
- package/dist/esm/utils.js.map +1 -0
- package/dist/types/abi/LightAccountFactoryAbi_V1_0_1.d.ts +56 -0
- package/dist/types/abi/LightAccountFactoryAbi_V1_0_1.d.ts.map +1 -0
- package/dist/types/abi/LightAccountFactoryAbi_V1_0_2.d.ts +56 -0
- package/dist/types/abi/LightAccountFactoryAbi_V1_0_2.d.ts.map +1 -0
- package/dist/types/abi/LightAccountFactoryAbi_V1_1_0.d.ts +56 -0
- package/dist/types/abi/LightAccountFactoryAbi_V1_1_0.d.ts.map +1 -0
- package/dist/types/abi/LightAccountFactoryAbi_V2_0_0.d.ts +257 -0
- package/dist/types/abi/LightAccountFactoryAbi_V2_0_0.d.ts.map +1 -0
- package/dist/types/abi/ModularAccountFactoryAbi_V2_0_0.d.ts +493 -0
- package/dist/types/abi/ModularAccountFactoryAbi_V2_0_0.d.ts.map +1 -0
- package/dist/types/abi/MultiOwnerLightAccountFactoryAbi_V2_0_0.d.ts +287 -0
- package/dist/types/abi/MultiOwnerLightAccountFactoryAbi_V2_0_0.d.ts.map +1 -0
- package/dist/types/abi/MultiOwnerModularAccountFactoryAbi_V1_0_0.d.ts +235 -0
- package/dist/types/abi/MultiOwnerModularAccountFactoryAbi_V1_0_0.d.ts.map +1 -0
- package/dist/types/abi/MultisigModularAccountFactoryAbi_V1_0_0.d.ts +247 -0
- package/dist/types/abi/MultisigModularAccountFactoryAbi_V1_0_0.d.ts.map +1 -0
- package/dist/types/abi/index.d.ts +9 -0
- package/dist/types/abi/index.d.ts.map +1 -0
- package/dist/types/capabilities/index.d.ts +9 -0
- package/dist/types/capabilities/index.d.ts.map +1 -0
- package/dist/types/capabilities/paymaster.d.ts +4 -0
- package/dist/types/capabilities/paymaster.d.ts.map +1 -0
- package/dist/types/capabilities/permissions/index.d.ts +99 -0
- package/dist/types/capabilities/permissions/index.d.ts.map +1 -0
- package/dist/types/capabilities/permissions/mav2.d.ts +37 -0
- package/dist/types/capabilities/permissions/mav2.d.ts.map +1 -0
- package/dist/types/client/actions/createAccount.d.ts +11 -0
- package/dist/types/client/actions/createAccount.d.ts.map +1 -0
- package/dist/types/client/actions/getCallsStatus.d.ts +7 -0
- package/dist/types/client/actions/getCallsStatus.d.ts.map +1 -0
- package/dist/types/client/actions/grantPermissions.d.ts +14 -0
- package/dist/types/client/actions/grantPermissions.d.ts.map +1 -0
- package/dist/types/client/actions/listAccounts.d.ts +7 -0
- package/dist/types/client/actions/listAccounts.d.ts.map +1 -0
- package/dist/types/client/actions/prepareCalls.d.ts +16 -0
- package/dist/types/client/actions/prepareCalls.d.ts.map +1 -0
- package/dist/types/client/actions/requestAccount.d.ts +12 -0
- package/dist/types/client/actions/requestAccount.d.ts.map +1 -0
- package/dist/types/client/actions/sendPreparedCalls.d.ts +7 -0
- package/dist/types/client/actions/sendPreparedCalls.d.ts.map +1 -0
- package/dist/types/client/actions/signMessage.d.ts +7 -0
- package/dist/types/client/actions/signMessage.d.ts.map +1 -0
- package/dist/types/client/actions/signSignatureRequest.d.ts +11 -0
- package/dist/types/client/actions/signSignatureRequest.d.ts.map +1 -0
- package/dist/types/client/actions/signTypedData.d.ts +7 -0
- package/dist/types/client/actions/signTypedData.d.ts.map +1 -0
- package/dist/types/client/client.e2e-test.d.ts +2 -0
- package/dist/types/client/client.e2e-test.d.ts.map +1 -0
- package/dist/types/client/decorator.d.ts +25 -0
- package/dist/types/client/decorator.d.ts.map +1 -0
- package/dist/types/client/index.d.ts +19 -0
- package/dist/types/client/index.d.ts.map +1 -0
- package/dist/types/exports/index.d.ts +14 -0
- package/dist/types/exports/index.d.ts.map +1 -0
- package/dist/types/exports/internal.d.ts +14 -0
- package/dist/types/exports/internal.d.ts.map +1 -0
- package/dist/types/isomorphic/actions/createSession.d.ts +15 -0
- package/dist/types/isomorphic/actions/createSession.d.ts.map +1 -0
- package/dist/types/isomorphic/actions/getCallsStatus.d.ts +22 -0
- package/dist/types/isomorphic/actions/getCallsStatus.d.ts.map +1 -0
- package/dist/types/isomorphic/actions/prepareCalls.d.ts +9 -0
- package/dist/types/isomorphic/actions/prepareCalls.d.ts.map +1 -0
- package/dist/types/isomorphic/actions/sendPreparedCalls.d.ts +9 -0
- package/dist/types/isomorphic/actions/sendPreparedCalls.d.ts.map +1 -0
- package/dist/types/isomorphic/client.d.ts +98 -0
- package/dist/types/isomorphic/client.d.ts.map +1 -0
- package/dist/types/isomorphic/utils/createAccount.d.ts +23 -0
- package/dist/types/isomorphic/utils/createAccount.d.ts.map +1 -0
- package/dist/types/isomorphic/utils/createDummySigner.d.ts +4 -0
- package/dist/types/isomorphic/utils/createDummySigner.d.ts.map +1 -0
- package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts +21 -0
- package/dist/types/isomorphic/utils/parsePermissionsContext.d.ts.map +1 -0
- package/dist/types/local/client.d.ts +4 -0
- package/dist/types/local/client.d.ts.map +1 -0
- package/dist/types/remote/client.d.ts +4 -0
- package/dist/types/remote/client.d.ts.map +1 -0
- package/dist/types/rpc/request.d.ts +330 -0
- package/dist/types/rpc/request.d.ts.map +1 -0
- package/dist/types/rpc/schema.d.ts +320 -0
- package/dist/types/rpc/schema.d.ts.map +1 -0
- package/dist/types/schemas.d.ts +217 -0
- package/dist/types/schemas.d.ts.map +1 -0
- package/dist/types/types.d.ts +28 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/utils.d.ts +5 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/package.json +67 -0
- package/src/abi/LightAccountFactoryAbi_V1_0_1.ts +44 -0
- package/src/abi/LightAccountFactoryAbi_V1_0_2.ts +44 -0
- package/src/abi/LightAccountFactoryAbi_V1_1_0.ts +44 -0
- package/src/abi/LightAccountFactoryAbi_V2_0_0.ts +201 -0
- package/src/abi/ModularAccountFactoryAbi_V2_0_0.ts +398 -0
- package/src/abi/MultiOwnerLightAccountFactoryAbi_V2_0_0.ts +224 -0
- package/src/abi/MultiOwnerModularAccountFactoryAbi_V1_0_0.ts +178 -0
- package/src/abi/MultisigModularAccountFactoryAbi_V1_0_0.ts +181 -0
- package/src/abi/index.ts +8 -0
- package/src/capabilities/index.ts +11 -0
- package/src/capabilities/paymaster.ts +5 -0
- package/src/capabilities/permissions/index.ts +124 -0
- package/src/capabilities/permissions/mav2.ts +127 -0
- package/src/client/actions/createAccount.ts +28 -0
- package/src/client/actions/getCallsStatus.ts +29 -0
- package/src/client/actions/grantPermissions.ts +48 -0
- package/src/client/actions/listAccounts.ts +18 -0
- package/src/client/actions/prepareCalls.ts +55 -0
- package/src/client/actions/requestAccount.ts +71 -0
- package/src/client/actions/sendPreparedCalls.ts +23 -0
- package/src/client/actions/signMessage.ts +32 -0
- package/src/client/actions/signSignatureRequest.ts +34 -0
- package/src/client/actions/signTypedData.ts +32 -0
- package/src/client/client.e2e-test.ts +294 -0
- package/src/client/decorator.ts +102 -0
- package/src/client/index.ts +93 -0
- package/src/exports/index.ts +32 -0
- package/src/exports/internal.ts +16 -0
- package/src/isomorphic/actions/createSession.ts +116 -0
- package/src/isomorphic/actions/getCallsStatus.ts +98 -0
- package/src/isomorphic/actions/prepareCalls.ts +99 -0
- package/src/isomorphic/actions/sendPreparedCalls.ts +95 -0
- package/src/isomorphic/client.ts +81 -0
- package/src/isomorphic/utils/createAccount.ts +58 -0
- package/src/isomorphic/utils/createDummySigner.ts +26 -0
- package/src/isomorphic/utils/parsePermissionsContext.ts +33 -0
- package/src/local/client.ts +132 -0
- package/src/remote/client.ts +67 -0
- package/src/rpc/request.ts +258 -0
- package/src/rpc/schema.ts +40 -0
- package/src/schemas.ts +257 -0
- package/src/types.ts +60 -0
- package/src/utils.ts +13 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
export const MultiOwnerModularAccountFactoryAbi_V1_0_0 = [
|
|
2
|
+
{
|
|
3
|
+
inputs: [
|
|
4
|
+
{ internalType: "address", name: "owner", type: "address" },
|
|
5
|
+
{ internalType: "address", name: "multiOwnerPlugin", type: "address" },
|
|
6
|
+
{ internalType: "address", name: "implementation", type: "address" },
|
|
7
|
+
{
|
|
8
|
+
internalType: "bytes32",
|
|
9
|
+
name: "multiOwnerPluginManifestHash",
|
|
10
|
+
type: "bytes32",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
internalType: "contract IEntryPoint",
|
|
14
|
+
name: "entryPoint",
|
|
15
|
+
type: "address",
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
stateMutability: "nonpayable",
|
|
19
|
+
type: "constructor",
|
|
20
|
+
},
|
|
21
|
+
{ inputs: [], name: "InvalidAction", type: "error" },
|
|
22
|
+
{ inputs: [], name: "InvalidOwner", type: "error" },
|
|
23
|
+
{ inputs: [], name: "OwnersArrayEmpty", type: "error" },
|
|
24
|
+
{ inputs: [], name: "OwnersLimitExceeded", type: "error" },
|
|
25
|
+
{ inputs: [], name: "TransferFailed", type: "error" },
|
|
26
|
+
{
|
|
27
|
+
anonymous: false,
|
|
28
|
+
inputs: [
|
|
29
|
+
{
|
|
30
|
+
indexed: true,
|
|
31
|
+
internalType: "address",
|
|
32
|
+
name: "previousOwner",
|
|
33
|
+
type: "address",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
indexed: true,
|
|
37
|
+
internalType: "address",
|
|
38
|
+
name: "newOwner",
|
|
39
|
+
type: "address",
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
name: "OwnershipTransferStarted",
|
|
43
|
+
type: "event",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
anonymous: false,
|
|
47
|
+
inputs: [
|
|
48
|
+
{
|
|
49
|
+
indexed: true,
|
|
50
|
+
internalType: "address",
|
|
51
|
+
name: "previousOwner",
|
|
52
|
+
type: "address",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
indexed: true,
|
|
56
|
+
internalType: "address",
|
|
57
|
+
name: "newOwner",
|
|
58
|
+
type: "address",
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
name: "OwnershipTransferred",
|
|
62
|
+
type: "event",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
inputs: [],
|
|
66
|
+
name: "ENTRYPOINT",
|
|
67
|
+
outputs: [
|
|
68
|
+
{ internalType: "contract IEntryPoint", name: "", type: "address" },
|
|
69
|
+
],
|
|
70
|
+
stateMutability: "view",
|
|
71
|
+
type: "function",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
inputs: [],
|
|
75
|
+
name: "IMPL",
|
|
76
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
77
|
+
stateMutability: "view",
|
|
78
|
+
type: "function",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
inputs: [],
|
|
82
|
+
name: "MULTI_OWNER_PLUGIN",
|
|
83
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
84
|
+
stateMutability: "view",
|
|
85
|
+
type: "function",
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
inputs: [],
|
|
89
|
+
name: "acceptOwnership",
|
|
90
|
+
outputs: [],
|
|
91
|
+
stateMutability: "nonpayable",
|
|
92
|
+
type: "function",
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
inputs: [
|
|
96
|
+
{ internalType: "uint32", name: "unstakeDelay", type: "uint32" },
|
|
97
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
98
|
+
],
|
|
99
|
+
name: "addStake",
|
|
100
|
+
outputs: [],
|
|
101
|
+
stateMutability: "payable",
|
|
102
|
+
type: "function",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
inputs: [
|
|
106
|
+
{ internalType: "uint256", name: "salt", type: "uint256" },
|
|
107
|
+
{ internalType: "address[]", name: "owners", type: "address[]" },
|
|
108
|
+
],
|
|
109
|
+
name: "createAccount",
|
|
110
|
+
outputs: [{ internalType: "address", name: "addr", type: "address" }],
|
|
111
|
+
stateMutability: "nonpayable",
|
|
112
|
+
type: "function",
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
inputs: [
|
|
116
|
+
{ internalType: "uint256", name: "salt", type: "uint256" },
|
|
117
|
+
{ internalType: "address[]", name: "owners", type: "address[]" },
|
|
118
|
+
],
|
|
119
|
+
name: "getAddress",
|
|
120
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
121
|
+
stateMutability: "view",
|
|
122
|
+
type: "function",
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
inputs: [],
|
|
126
|
+
name: "owner",
|
|
127
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
128
|
+
stateMutability: "view",
|
|
129
|
+
type: "function",
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
inputs: [],
|
|
133
|
+
name: "pendingOwner",
|
|
134
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
135
|
+
stateMutability: "view",
|
|
136
|
+
type: "function",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
inputs: [],
|
|
140
|
+
name: "renounceOwnership",
|
|
141
|
+
outputs: [],
|
|
142
|
+
stateMutability: "view",
|
|
143
|
+
type: "function",
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
|
|
147
|
+
name: "transferOwnership",
|
|
148
|
+
outputs: [],
|
|
149
|
+
stateMutability: "nonpayable",
|
|
150
|
+
type: "function",
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
inputs: [],
|
|
154
|
+
name: "unlockStake",
|
|
155
|
+
outputs: [],
|
|
156
|
+
stateMutability: "nonpayable",
|
|
157
|
+
type: "function",
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
inputs: [
|
|
161
|
+
{ internalType: "address payable", name: "to", type: "address" },
|
|
162
|
+
{ internalType: "address", name: "token", type: "address" },
|
|
163
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
164
|
+
],
|
|
165
|
+
name: "withdraw",
|
|
166
|
+
outputs: [],
|
|
167
|
+
stateMutability: "nonpayable",
|
|
168
|
+
type: "function",
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
inputs: [{ internalType: "address payable", name: "to", type: "address" }],
|
|
172
|
+
name: "withdrawStake",
|
|
173
|
+
outputs: [],
|
|
174
|
+
stateMutability: "nonpayable",
|
|
175
|
+
type: "function",
|
|
176
|
+
},
|
|
177
|
+
{ stateMutability: "payable", type: "receive" },
|
|
178
|
+
] as const;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export const MultisigModularAccountFactoryAbi_V1_0_0 = [
|
|
2
|
+
{
|
|
3
|
+
inputs: [
|
|
4
|
+
{ internalType: "address", name: "owner", type: "address" },
|
|
5
|
+
{ internalType: "address", name: "multisigPlugin", type: "address" },
|
|
6
|
+
{ internalType: "address", name: "implementation", type: "address" },
|
|
7
|
+
{
|
|
8
|
+
internalType: "bytes32",
|
|
9
|
+
name: "multisigPluginManifestHash",
|
|
10
|
+
type: "bytes32",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
internalType: "contract IEntryPoint",
|
|
14
|
+
name: "entryPoint",
|
|
15
|
+
type: "address",
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
stateMutability: "nonpayable",
|
|
19
|
+
type: "constructor",
|
|
20
|
+
},
|
|
21
|
+
{ inputs: [], name: "InvalidAction", type: "error" },
|
|
22
|
+
{ inputs: [], name: "InvalidOwner", type: "error" },
|
|
23
|
+
{ inputs: [], name: "InvalidThreshold", type: "error" },
|
|
24
|
+
{ inputs: [], name: "OwnersArrayEmpty", type: "error" },
|
|
25
|
+
{ inputs: [], name: "OwnersLimitExceeded", type: "error" },
|
|
26
|
+
{ inputs: [], name: "TransferFailed", type: "error" },
|
|
27
|
+
{
|
|
28
|
+
anonymous: false,
|
|
29
|
+
inputs: [
|
|
30
|
+
{
|
|
31
|
+
indexed: true,
|
|
32
|
+
internalType: "address",
|
|
33
|
+
name: "previousOwner",
|
|
34
|
+
type: "address",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
indexed: true,
|
|
38
|
+
internalType: "address",
|
|
39
|
+
name: "newOwner",
|
|
40
|
+
type: "address",
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
name: "OwnershipTransferStarted",
|
|
44
|
+
type: "event",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
anonymous: false,
|
|
48
|
+
inputs: [
|
|
49
|
+
{
|
|
50
|
+
indexed: true,
|
|
51
|
+
internalType: "address",
|
|
52
|
+
name: "previousOwner",
|
|
53
|
+
type: "address",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
indexed: true,
|
|
57
|
+
internalType: "address",
|
|
58
|
+
name: "newOwner",
|
|
59
|
+
type: "address",
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
name: "OwnershipTransferred",
|
|
63
|
+
type: "event",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
inputs: [],
|
|
67
|
+
name: "ENTRYPOINT",
|
|
68
|
+
outputs: [
|
|
69
|
+
{ internalType: "contract IEntryPoint", name: "", type: "address" },
|
|
70
|
+
],
|
|
71
|
+
stateMutability: "view",
|
|
72
|
+
type: "function",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
inputs: [],
|
|
76
|
+
name: "IMPL",
|
|
77
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
78
|
+
stateMutability: "view",
|
|
79
|
+
type: "function",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
inputs: [],
|
|
83
|
+
name: "MULTISIG_PLUGIN",
|
|
84
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
85
|
+
stateMutability: "view",
|
|
86
|
+
type: "function",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
inputs: [],
|
|
90
|
+
name: "acceptOwnership",
|
|
91
|
+
outputs: [],
|
|
92
|
+
stateMutability: "nonpayable",
|
|
93
|
+
type: "function",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
inputs: [
|
|
97
|
+
{ internalType: "uint32", name: "unstakeDelay", type: "uint32" },
|
|
98
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
99
|
+
],
|
|
100
|
+
name: "addStake",
|
|
101
|
+
outputs: [],
|
|
102
|
+
stateMutability: "payable",
|
|
103
|
+
type: "function",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
inputs: [
|
|
107
|
+
{ internalType: "uint256", name: "salt", type: "uint256" },
|
|
108
|
+
{ internalType: "address[]", name: "owners", type: "address[]" },
|
|
109
|
+
{ internalType: "uint128", name: "threshold", type: "uint128" },
|
|
110
|
+
],
|
|
111
|
+
name: "createAccount",
|
|
112
|
+
outputs: [{ internalType: "address", name: "addr", type: "address" }],
|
|
113
|
+
stateMutability: "nonpayable",
|
|
114
|
+
type: "function",
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
inputs: [
|
|
118
|
+
{ internalType: "uint256", name: "salt", type: "uint256" },
|
|
119
|
+
{ internalType: "address[]", name: "owners", type: "address[]" },
|
|
120
|
+
{ internalType: "uint128", name: "threshold", type: "uint128" },
|
|
121
|
+
],
|
|
122
|
+
name: "getAddress",
|
|
123
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
124
|
+
stateMutability: "view",
|
|
125
|
+
type: "function",
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
inputs: [],
|
|
129
|
+
name: "owner",
|
|
130
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
131
|
+
stateMutability: "view",
|
|
132
|
+
type: "function",
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
inputs: [],
|
|
136
|
+
name: "pendingOwner",
|
|
137
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
138
|
+
stateMutability: "view",
|
|
139
|
+
type: "function",
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
inputs: [],
|
|
143
|
+
name: "renounceOwnership",
|
|
144
|
+
outputs: [],
|
|
145
|
+
stateMutability: "view",
|
|
146
|
+
type: "function",
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
|
|
150
|
+
name: "transferOwnership",
|
|
151
|
+
outputs: [],
|
|
152
|
+
stateMutability: "nonpayable",
|
|
153
|
+
type: "function",
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
inputs: [],
|
|
157
|
+
name: "unlockStake",
|
|
158
|
+
outputs: [],
|
|
159
|
+
stateMutability: "nonpayable",
|
|
160
|
+
type: "function",
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
inputs: [
|
|
164
|
+
{ internalType: "address payable", name: "to", type: "address" },
|
|
165
|
+
{ internalType: "address", name: "token", type: "address" },
|
|
166
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
167
|
+
],
|
|
168
|
+
name: "withdraw",
|
|
169
|
+
outputs: [],
|
|
170
|
+
stateMutability: "nonpayable",
|
|
171
|
+
type: "function",
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
inputs: [{ internalType: "address payable", name: "to", type: "address" }],
|
|
175
|
+
name: "withdrawStake",
|
|
176
|
+
outputs: [],
|
|
177
|
+
stateMutability: "nonpayable",
|
|
178
|
+
type: "function",
|
|
179
|
+
},
|
|
180
|
+
{ stateMutability: "payable", type: "receive" },
|
|
181
|
+
] as const;
|
package/src/abi/index.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { LightAccountFactoryAbi_V1_0_1 } from "./LightAccountFactoryAbi_V1_0_1";
|
|
2
|
+
export { LightAccountFactoryAbi_V1_0_2 } from "./LightAccountFactoryAbi_V1_0_2";
|
|
3
|
+
export { LightAccountFactoryAbi_V1_1_0 } from "./LightAccountFactoryAbi_V1_1_0";
|
|
4
|
+
export { LightAccountFactoryAbi_V2_0_0 } from "./LightAccountFactoryAbi_V2_0_0";
|
|
5
|
+
export { ModularAccountFactoryAbi_V2_0_0 } from "./ModularAccountFactoryAbi_V2_0_0";
|
|
6
|
+
export { MultiOwnerLightAccountFactoryAbi_V2_0_0 } from "./MultiOwnerLightAccountFactoryAbi_V2_0_0";
|
|
7
|
+
export { MultiOwnerModularAccountFactoryAbi_V1_0_0 } from "./MultiOwnerModularAccountFactoryAbi_V1_0_0";
|
|
8
|
+
export { MultisigModularAccountFactoryAbi_V1_0_0 } from "./MultisigModularAccountFactoryAbi_V1_0_0";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { PaymasterCapability } from "./paymaster";
|
|
3
|
+
import { PermissionsCapability } from "./permissions";
|
|
4
|
+
|
|
5
|
+
export const Capabilities = Type.Object(
|
|
6
|
+
{
|
|
7
|
+
permissions: Type.Optional(PermissionsCapability),
|
|
8
|
+
paymasterService: Type.Optional(PaymasterCapability),
|
|
9
|
+
},
|
|
10
|
+
{ minProperties: 1 },
|
|
11
|
+
);
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { PermissionType } from "@account-kit/smart-contracts/experimental";
|
|
2
|
+
import {
|
|
3
|
+
Type,
|
|
4
|
+
type TLiteral,
|
|
5
|
+
type TLiteralValue,
|
|
6
|
+
type TObject,
|
|
7
|
+
type TSchema,
|
|
8
|
+
} from "@sinclair/typebox";
|
|
9
|
+
import { KeySigner, TypeAddress, TypeHex } from "../../schemas";
|
|
10
|
+
|
|
11
|
+
const Permission = <
|
|
12
|
+
TData extends TSchema,
|
|
13
|
+
TLiteralVal extends TLiteralValue,
|
|
14
|
+
TType extends TLiteral<TLiteralVal>,
|
|
15
|
+
>(
|
|
16
|
+
type: TLiteralVal,
|
|
17
|
+
data: TData,
|
|
18
|
+
description: string,
|
|
19
|
+
): TObject<{ type: TType; data: TData }> => {
|
|
20
|
+
return Type.Object(
|
|
21
|
+
{
|
|
22
|
+
type: Type.Literal(type),
|
|
23
|
+
data,
|
|
24
|
+
},
|
|
25
|
+
{ description: description },
|
|
26
|
+
) as never;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const NativeTokenTransfer = Permission(
|
|
30
|
+
PermissionType.NATIVE_TOKEN_TRANSFER,
|
|
31
|
+
Type.Object({
|
|
32
|
+
allowance: TypeHex(),
|
|
33
|
+
}),
|
|
34
|
+
"allows transfer of native tokens from the account",
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const Erc20TokenTransfer = Permission(
|
|
38
|
+
PermissionType.ERC20_TOKEN_TRANSFER,
|
|
39
|
+
Type.Object({
|
|
40
|
+
allowance: TypeHex(),
|
|
41
|
+
address: TypeAddress,
|
|
42
|
+
}),
|
|
43
|
+
"allows transfer or approval of erc20 tokens from the account",
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const GasLimit = Permission(
|
|
47
|
+
PermissionType.GAS_LIMIT,
|
|
48
|
+
Type.Object({
|
|
49
|
+
limit: TypeHex(),
|
|
50
|
+
}),
|
|
51
|
+
"allows the key to spend gas for UOs",
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const ContractAccess = Permission(
|
|
55
|
+
PermissionType.CONTRACT_ACCESS,
|
|
56
|
+
Type.Object({
|
|
57
|
+
address: TypeAddress,
|
|
58
|
+
}),
|
|
59
|
+
"grants access to all functions in a contract",
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const AccountFunction = Permission(
|
|
63
|
+
PermissionType.ACCOUNT_FUNCTIONS,
|
|
64
|
+
Type.Object({
|
|
65
|
+
functions: Type.Array(TypeHex(), { minItems: 1 }),
|
|
66
|
+
}),
|
|
67
|
+
"grants access to functions in the account",
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
const AllExternalFunctionAccess = Permission(
|
|
71
|
+
PermissionType.FUNCTIONS_ON_ALL_CONTRACTS,
|
|
72
|
+
Type.Object({
|
|
73
|
+
functions: Type.Array(TypeHex(), { minItems: 1 }),
|
|
74
|
+
}),
|
|
75
|
+
"access to a function selector in any address or contract",
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
const ContractFunctionAccess = Permission(
|
|
79
|
+
PermissionType.FUNCTIONS_ON_CONTRACT,
|
|
80
|
+
Type.Object({
|
|
81
|
+
address: TypeAddress,
|
|
82
|
+
functions: Type.Array(TypeHex(), { minItems: 1 }),
|
|
83
|
+
}),
|
|
84
|
+
"grants access to specified functions on a specific contract",
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const Root = Permission(
|
|
88
|
+
PermissionType.ROOT,
|
|
89
|
+
Type.Optional(Type.Never()),
|
|
90
|
+
"grants full access to everything",
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
export const PermissionsArray = Type.Array(
|
|
94
|
+
Type.Union([
|
|
95
|
+
// 7715 permissions
|
|
96
|
+
NativeTokenTransfer,
|
|
97
|
+
Erc20TokenTransfer,
|
|
98
|
+
GasLimit,
|
|
99
|
+
// additional permissions
|
|
100
|
+
ContractAccess,
|
|
101
|
+
AccountFunction,
|
|
102
|
+
AllExternalFunctionAccess,
|
|
103
|
+
ContractFunctionAccess,
|
|
104
|
+
Root,
|
|
105
|
+
]),
|
|
106
|
+
{ minItems: 1 },
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
export const PermissionsContext = Type.Object({
|
|
110
|
+
context: TypeHex(),
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
export const PermissionsData = Type.Object({
|
|
114
|
+
chainId: TypeHex(),
|
|
115
|
+
expiry: Type.Optional(Type.Number()),
|
|
116
|
+
key: KeySigner,
|
|
117
|
+
permissions: PermissionsArray,
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
export const PermissionsCapability = Type.Union([
|
|
121
|
+
PermissionsContext,
|
|
122
|
+
// TODO: support permissions object here instead of only context-encoded permissions
|
|
123
|
+
// PermissionsData,
|
|
124
|
+
]);
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { PermissionType } from "@account-kit/smart-contracts/experimental";
|
|
2
|
+
import type { Static } from "@sinclair/typebox";
|
|
3
|
+
import { concatHex, sliceHex, type Hex } from "viem";
|
|
4
|
+
import type { PermissionsData } from ".";
|
|
5
|
+
import type { KeySigner } from "../../schemas";
|
|
6
|
+
import { assertNever } from "../../utils";
|
|
7
|
+
|
|
8
|
+
export const SESSION_ID_LENGTH_BYTES = 16;
|
|
9
|
+
export const ENTITY_ID_LENGTH_BYTES = 4;
|
|
10
|
+
|
|
11
|
+
export const PermissionsContextVersion = {
|
|
12
|
+
REMOTE_MODE_DEFERRED_ACTION: "0x00",
|
|
13
|
+
LOCAL_MODE_DEFERRED_ACTION: "0x01",
|
|
14
|
+
NON_DEFERRED_ACTION: "0x02",
|
|
15
|
+
} as const;
|
|
16
|
+
|
|
17
|
+
type ContextVersionHex =
|
|
18
|
+
(typeof PermissionsContextVersion)[keyof typeof PermissionsContextVersion];
|
|
19
|
+
|
|
20
|
+
type DecodedPermissionsContext = {
|
|
21
|
+
contextVersion: keyof typeof PermissionsContextVersion;
|
|
22
|
+
} & (
|
|
23
|
+
| {
|
|
24
|
+
contextVersion: "REMOTE_MODE_DEFERRED_ACTION";
|
|
25
|
+
sessionId: Hex;
|
|
26
|
+
signature: Hex;
|
|
27
|
+
deferredAction?: never;
|
|
28
|
+
}
|
|
29
|
+
| {
|
|
30
|
+
contextVersion: "LOCAL_MODE_DEFERRED_ACTION";
|
|
31
|
+
deferredAction: Hex;
|
|
32
|
+
sessionId?: never;
|
|
33
|
+
signature?: never;
|
|
34
|
+
}
|
|
35
|
+
| {
|
|
36
|
+
contextVersion: "NON_DEFERRED_ACTION";
|
|
37
|
+
deferredAction?: never;
|
|
38
|
+
sessionId?: never;
|
|
39
|
+
signature?: never;
|
|
40
|
+
entityId: Hex;
|
|
41
|
+
isGlobalValidation: boolean;
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export const encodePermissionsContext = (
|
|
46
|
+
context: DecodedPermissionsContext,
|
|
47
|
+
): Hex => {
|
|
48
|
+
switch (context.contextVersion) {
|
|
49
|
+
case "REMOTE_MODE_DEFERRED_ACTION":
|
|
50
|
+
return concatHex([
|
|
51
|
+
PermissionsContextVersion.REMOTE_MODE_DEFERRED_ACTION,
|
|
52
|
+
context.sessionId,
|
|
53
|
+
context.signature,
|
|
54
|
+
]);
|
|
55
|
+
case "LOCAL_MODE_DEFERRED_ACTION":
|
|
56
|
+
return concatHex([
|
|
57
|
+
PermissionsContextVersion.LOCAL_MODE_DEFERRED_ACTION,
|
|
58
|
+
context.deferredAction,
|
|
59
|
+
]);
|
|
60
|
+
case "NON_DEFERRED_ACTION":
|
|
61
|
+
return concatHex([
|
|
62
|
+
PermissionsContextVersion.NON_DEFERRED_ACTION,
|
|
63
|
+
context.isGlobalValidation ? "0x01" : "0x00",
|
|
64
|
+
context.entityId,
|
|
65
|
+
]);
|
|
66
|
+
default:
|
|
67
|
+
return assertNever(context, "Unexpected context version");
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const decodePermissionsContext = (
|
|
72
|
+
input: Hex,
|
|
73
|
+
): DecodedPermissionsContext => {
|
|
74
|
+
const contextVersion = sliceHex(input, 0, 1) as ContextVersionHex;
|
|
75
|
+
switch (contextVersion) {
|
|
76
|
+
case "0x00": {
|
|
77
|
+
const sessionId = sliceHex(input, 1, SESSION_ID_LENGTH_BYTES + 1);
|
|
78
|
+
const signature = sliceHex(input, SESSION_ID_LENGTH_BYTES + 1);
|
|
79
|
+
return {
|
|
80
|
+
contextVersion: "REMOTE_MODE_DEFERRED_ACTION",
|
|
81
|
+
sessionId,
|
|
82
|
+
signature,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
case "0x01": {
|
|
86
|
+
const deferredAction = sliceHex(input, 1);
|
|
87
|
+
return {
|
|
88
|
+
contextVersion: "LOCAL_MODE_DEFERRED_ACTION",
|
|
89
|
+
deferredAction,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
case "0x02": {
|
|
93
|
+
const isGlobalValidation = sliceHex(input, 1, 2) === "0x01";
|
|
94
|
+
const entityId = sliceHex(input, 2, ENTITY_ID_LENGTH_BYTES + 2);
|
|
95
|
+
return {
|
|
96
|
+
contextVersion: "NON_DEFERRED_ACTION",
|
|
97
|
+
isGlobalValidation,
|
|
98
|
+
entityId,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
default:
|
|
102
|
+
return assertNever(
|
|
103
|
+
contextVersion,
|
|
104
|
+
`Unexpected context version: ${contextVersion}`,
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const prefixSignatureKeyType = (
|
|
110
|
+
sig: Hex,
|
|
111
|
+
type: KeySigner["type"],
|
|
112
|
+
): Hex => {
|
|
113
|
+
switch (type) {
|
|
114
|
+
case "secp256k1":
|
|
115
|
+
return concatHex(["0x00", sig]);
|
|
116
|
+
case "contract":
|
|
117
|
+
return concatHex(["0x01", sig]);
|
|
118
|
+
default:
|
|
119
|
+
return assertNever(type, "Unexpected session key type");
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const isGlobalValidation = (
|
|
124
|
+
data: Pick<Static<typeof PermissionsData>, "permissions">,
|
|
125
|
+
): boolean => {
|
|
126
|
+
return data.permissions.some((p) => p.type === PermissionType.ROOT);
|
|
127
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
2
|
+
import type { Static } from "@sinclair/typebox";
|
|
3
|
+
import type { Address } from "abitype";
|
|
4
|
+
import type { wallet_createAccount } from "../../rpc/request";
|
|
5
|
+
import type { InnerWalletApiClient } from "../../types";
|
|
6
|
+
|
|
7
|
+
export type CreateAccountParams = Omit<
|
|
8
|
+
Extract<
|
|
9
|
+
Static<typeof wallet_createAccount>["Request"]["params"][0],
|
|
10
|
+
{ signerAddress: Address }
|
|
11
|
+
>,
|
|
12
|
+
"signerAddress"
|
|
13
|
+
>;
|
|
14
|
+
|
|
15
|
+
export type CreateAccountResult = Static<
|
|
16
|
+
typeof wallet_createAccount
|
|
17
|
+
>["ReturnType"];
|
|
18
|
+
|
|
19
|
+
export async function createAccount(
|
|
20
|
+
client: InnerWalletApiClient,
|
|
21
|
+
signer: SmartAccountSigner,
|
|
22
|
+
params: CreateAccountParams,
|
|
23
|
+
): Promise<CreateAccountResult> {
|
|
24
|
+
return client.request({
|
|
25
|
+
method: "wallet_createAccount",
|
|
26
|
+
params: [{ signerAddress: await signer.getAddress(), ...params }],
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Address, JsonRpcAccount } from "viem";
|
|
2
|
+
import type {
|
|
3
|
+
GetCallsStatusParams as IsomorphicGetCallsStatusParams,
|
|
4
|
+
GetCallsStatusResponse as IsomorphicGetCallsStatusResult,
|
|
5
|
+
} from "../../isomorphic/actions/getCallsStatus";
|
|
6
|
+
import type { InnerWalletApiClient } from "../../types";
|
|
7
|
+
|
|
8
|
+
export type GetCallsStatusParams = IsomorphicGetCallsStatusParams;
|
|
9
|
+
|
|
10
|
+
export type GetCallsStatusResult = IsomorphicGetCallsStatusResult;
|
|
11
|
+
|
|
12
|
+
export async function getCallsStatus<
|
|
13
|
+
TAccount extends JsonRpcAccount<Address> | undefined =
|
|
14
|
+
| JsonRpcAccount<Address>
|
|
15
|
+
| undefined,
|
|
16
|
+
>(
|
|
17
|
+
client: InnerWalletApiClient<TAccount>,
|
|
18
|
+
params: GetCallsStatusParams,
|
|
19
|
+
): Promise<GetCallsStatusResult>;
|
|
20
|
+
|
|
21
|
+
export async function getCallsStatus(
|
|
22
|
+
client: InnerWalletApiClient,
|
|
23
|
+
params: GetCallsStatusParams,
|
|
24
|
+
): Promise<GetCallsStatusResult> {
|
|
25
|
+
return await client.request({
|
|
26
|
+
method: "wallet_getCallsStatus",
|
|
27
|
+
params: [params],
|
|
28
|
+
});
|
|
29
|
+
}
|