@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,182 @@
|
|
|
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
|
+
];
|
|
182
|
+
//# sourceMappingURL=MultisigModularAccountFactoryAbi_V1_0_0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultisigModularAccountFactoryAbi_V1_0_0.js","sourceRoot":"","sources":["../../../src/abi/MultisigModularAccountFactoryAbi_V1_0_0.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uCAAuC,GAAG;IACrD;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAC3D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE;YACpE,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE;YACpE;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,4BAA4B;gBAClC,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,YAAY,EAAE,sBAAsB;gBACpC,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,SAAS;aAChB;SACF;QACD,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,aAAa;KACpB;IACD,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE;IACpD,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE;IACnD,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,kBAAkB,E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AAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;YAChE,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAC3D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;SAC7D;QACD,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAC1E,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;IACD,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;CACvC,CAAC","sourcesContent":["export const MultisigModularAccountFactoryAbi_V1_0_0 = [\n {\n inputs: [\n { internalType: \"address\", name: \"owner\", type: \"address\" },\n { internalType: \"address\", name: \"multisigPlugin\", type: \"address\" },\n { internalType: \"address\", name: \"implementation\", type: \"address\" },\n {\n internalType: \"bytes32\",\n name: \"multisigPluginManifestHash\",\n type: \"bytes32\",\n },\n {\n internalType: \"contract IEntryPoint\",\n name: \"entryPoint\",\n type: \"address\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n { inputs: [], name: \"InvalidAction\", type: \"error\" },\n { inputs: [], name: \"InvalidOwner\", type: \"error\" },\n { inputs: [], name: \"InvalidThreshold\", type: \"error\" },\n { inputs: [], name: \"OwnersArrayEmpty\", type: \"error\" },\n { inputs: [], name: \"OwnersLimitExceeded\", type: \"error\" },\n { inputs: [], name: \"TransferFailed\", type: \"error\" },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"previousOwner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"OwnershipTransferStarted\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"previousOwner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"OwnershipTransferred\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"ENTRYPOINT\",\n outputs: [\n { internalType: \"contract IEntryPoint\", name: \"\", type: \"address\" },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"IMPL\",\n outputs: [{ internalType: \"address\", name: \"\", type: \"address\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"MULTISIG_PLUGIN\",\n outputs: [{ internalType: \"address\", name: \"\", type: \"address\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"acceptOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"uint32\", name: \"unstakeDelay\", type: \"uint32\" },\n { internalType: \"uint256\", name: \"amount\", type: \"uint256\" },\n ],\n name: \"addStake\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"uint256\", name: \"salt\", type: \"uint256\" },\n { internalType: \"address[]\", name: \"owners\", type: \"address[]\" },\n { internalType: \"uint128\", name: \"threshold\", type: \"uint128\" },\n ],\n name: \"createAccount\",\n outputs: [{ internalType: \"address\", name: \"addr\", type: \"address\" }],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"uint256\", name: \"salt\", type: \"uint256\" },\n { internalType: \"address[]\", name: \"owners\", type: \"address[]\" },\n { internalType: \"uint128\", name: \"threshold\", type: \"uint128\" },\n ],\n name: \"getAddress\",\n outputs: [{ internalType: \"address\", name: \"\", type: \"address\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [{ internalType: \"address\", name: \"\", type: \"address\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pendingOwner\",\n outputs: [{ internalType: \"address\", name: \"\", type: \"address\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"renounceOwnership\",\n outputs: [],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"newOwner\", type: \"address\" }],\n name: \"transferOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"unlockStake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address payable\", name: \"to\", type: \"address\" },\n { internalType: \"address\", name: \"token\", type: \"address\" },\n { internalType: \"uint256\", name: \"amount\", type: \"uint256\" },\n ],\n name: \"withdraw\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address payable\", name: \"to\", type: \"address\" }],\n name: \"withdrawStake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n { stateMutability: \"payable\", type: \"receive\" },\n] as const;\n"]}
|
|
@@ -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,9 @@
|
|
|
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";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/abi/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,uCAAuC,EAAE,MAAM,2CAA2C,CAAC;AACpG,OAAO,EAAE,yCAAyC,EAAE,MAAM,6CAA6C,CAAC;AACxG,OAAO,EAAE,uCAAuC,EAAE,MAAM,2CAA2C,CAAC","sourcesContent":["export { LightAccountFactoryAbi_V1_0_1 } from \"./LightAccountFactoryAbi_V1_0_1\";\nexport { LightAccountFactoryAbi_V1_0_2 } from \"./LightAccountFactoryAbi_V1_0_2\";\nexport { LightAccountFactoryAbi_V1_1_0 } from \"./LightAccountFactoryAbi_V1_1_0\";\nexport { LightAccountFactoryAbi_V2_0_0 } from \"./LightAccountFactoryAbi_V2_0_0\";\nexport { ModularAccountFactoryAbi_V2_0_0 } from \"./ModularAccountFactoryAbi_V2_0_0\";\nexport { MultiOwnerLightAccountFactoryAbi_V2_0_0 } from \"./MultiOwnerLightAccountFactoryAbi_V2_0_0\";\nexport { MultiOwnerModularAccountFactoryAbi_V1_0_0 } from \"./MultiOwnerModularAccountFactoryAbi_V1_0_0\";\nexport { MultisigModularAccountFactoryAbi_V1_0_0 } from \"./MultisigModularAccountFactoryAbi_V1_0_0\";\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const Capabilities: import("@sinclair/typebox").TObject<{
|
|
2
|
+
permissions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
3
|
+
context: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
4
|
+
}>>;
|
|
5
|
+
paymasterService: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
6
|
+
policyId: import("@sinclair/typebox").TString;
|
|
7
|
+
}>>;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { PaymasterCapability } from "./paymaster";
|
|
3
|
+
import { PermissionsCapability } from "./permissions";
|
|
4
|
+
export const Capabilities = Type.Object({
|
|
5
|
+
permissions: Type.Optional(PermissionsCapability),
|
|
6
|
+
paymasterService: Type.Optional(PaymasterCapability),
|
|
7
|
+
}, { minProperties: 1 });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/capabilities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CACrC;IACE,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IACjD,gBAAgB,EAAE,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC;CACrD,EACD,EAAE,aAAa,EAAE,CAAC,EAAE,CACrB,CAAC","sourcesContent":["import { Type } from \"@sinclair/typebox\";\nimport { PaymasterCapability } from \"./paymaster\";\nimport { PermissionsCapability } from \"./permissions\";\n\nexport const Capabilities = Type.Object(\n {\n permissions: Type.Optional(PermissionsCapability),\n paymasterService: Type.Optional(PaymasterCapability),\n },\n { minProperties: 1 },\n);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paymaster.js","sourceRoot":"","sources":["../../../src/capabilities/paymaster.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC7C,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE;CACxB,CAAC,CAAC","sourcesContent":["import { Type } from \"@sinclair/typebox\";\n\nexport const PaymasterCapability = Type.Object({\n policyId: Type.String(),\n});\n"]}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { PermissionType } from "@account-kit/smart-contracts/experimental";
|
|
2
|
+
import { type TLiteral, type TObject } from "@sinclair/typebox";
|
|
3
|
+
export declare const PermissionsArray: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[TObject<{
|
|
4
|
+
type: TLiteral<PermissionType.NATIVE_TOKEN_TRANSFER>;
|
|
5
|
+
data: TObject<{
|
|
6
|
+
allowance: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
7
|
+
}>;
|
|
8
|
+
}>, TObject<{
|
|
9
|
+
type: TLiteral<PermissionType.ERC20_TOKEN_TRANSFER>;
|
|
10
|
+
data: TObject<{
|
|
11
|
+
allowance: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
12
|
+
address: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
13
|
+
}>;
|
|
14
|
+
}>, TObject<{
|
|
15
|
+
type: TLiteral<PermissionType.GAS_LIMIT>;
|
|
16
|
+
data: TObject<{
|
|
17
|
+
limit: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
18
|
+
}>;
|
|
19
|
+
}>, TObject<{
|
|
20
|
+
type: TLiteral<PermissionType.CONTRACT_ACCESS>;
|
|
21
|
+
data: TObject<{
|
|
22
|
+
address: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
23
|
+
}>;
|
|
24
|
+
}>, TObject<{
|
|
25
|
+
type: TLiteral<PermissionType.ACCOUNT_FUNCTIONS>;
|
|
26
|
+
data: TObject<{
|
|
27
|
+
functions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
28
|
+
}>;
|
|
29
|
+
}>, TObject<{
|
|
30
|
+
type: TLiteral<PermissionType.FUNCTIONS_ON_ALL_CONTRACTS>;
|
|
31
|
+
data: TObject<{
|
|
32
|
+
functions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
33
|
+
}>;
|
|
34
|
+
}>, TObject<{
|
|
35
|
+
type: TLiteral<PermissionType.FUNCTIONS_ON_CONTRACT>;
|
|
36
|
+
data: TObject<{
|
|
37
|
+
address: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
38
|
+
functions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
39
|
+
}>;
|
|
40
|
+
}>, TObject<{
|
|
41
|
+
type: TLiteral<PermissionType.ROOT>;
|
|
42
|
+
data: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
43
|
+
}>]>>;
|
|
44
|
+
export declare const PermissionsContext: TObject<{
|
|
45
|
+
context: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
46
|
+
}>;
|
|
47
|
+
export declare const PermissionsData: TObject<{
|
|
48
|
+
chainId: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
49
|
+
expiry: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
50
|
+
key: TObject<{
|
|
51
|
+
type: import("@sinclair/typebox").TUnion<[TLiteral<"secp256k1">, TLiteral<"contract">]>;
|
|
52
|
+
publicKey: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
53
|
+
}>;
|
|
54
|
+
permissions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[TObject<{
|
|
55
|
+
type: TLiteral<PermissionType.NATIVE_TOKEN_TRANSFER>;
|
|
56
|
+
data: TObject<{
|
|
57
|
+
allowance: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
58
|
+
}>;
|
|
59
|
+
}>, TObject<{
|
|
60
|
+
type: TLiteral<PermissionType.ERC20_TOKEN_TRANSFER>;
|
|
61
|
+
data: TObject<{
|
|
62
|
+
allowance: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
63
|
+
address: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
64
|
+
}>;
|
|
65
|
+
}>, TObject<{
|
|
66
|
+
type: TLiteral<PermissionType.GAS_LIMIT>;
|
|
67
|
+
data: TObject<{
|
|
68
|
+
limit: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
69
|
+
}>;
|
|
70
|
+
}>, TObject<{
|
|
71
|
+
type: TLiteral<PermissionType.CONTRACT_ACCESS>;
|
|
72
|
+
data: TObject<{
|
|
73
|
+
address: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
74
|
+
}>;
|
|
75
|
+
}>, TObject<{
|
|
76
|
+
type: TLiteral<PermissionType.ACCOUNT_FUNCTIONS>;
|
|
77
|
+
data: TObject<{
|
|
78
|
+
functions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
79
|
+
}>;
|
|
80
|
+
}>, TObject<{
|
|
81
|
+
type: TLiteral<PermissionType.FUNCTIONS_ON_ALL_CONTRACTS>;
|
|
82
|
+
data: TObject<{
|
|
83
|
+
functions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
84
|
+
}>;
|
|
85
|
+
}>, TObject<{
|
|
86
|
+
type: TLiteral<PermissionType.FUNCTIONS_ON_CONTRACT>;
|
|
87
|
+
data: TObject<{
|
|
88
|
+
address: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
89
|
+
functions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">>;
|
|
90
|
+
}>;
|
|
91
|
+
}>, TObject<{
|
|
92
|
+
type: TLiteral<PermissionType.ROOT>;
|
|
93
|
+
data: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
94
|
+
}>]>>;
|
|
95
|
+
}>;
|
|
96
|
+
export declare const PermissionsCapability: TObject<{
|
|
97
|
+
context: import("@sinclair/typebox").TTemplateLiteralSyntax<"0x${string}">;
|
|
98
|
+
}>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { PermissionType } from "@account-kit/smart-contracts/experimental";
|
|
2
|
+
import { Type, } from "@sinclair/typebox";
|
|
3
|
+
import { KeySigner, TypeAddress, TypeHex } from "../../schemas";
|
|
4
|
+
const Permission = (type, data, description) => {
|
|
5
|
+
return Type.Object({
|
|
6
|
+
type: Type.Literal(type),
|
|
7
|
+
data,
|
|
8
|
+
}, { description: description });
|
|
9
|
+
};
|
|
10
|
+
const NativeTokenTransfer = Permission(PermissionType.NATIVE_TOKEN_TRANSFER, Type.Object({
|
|
11
|
+
allowance: TypeHex(),
|
|
12
|
+
}), "allows transfer of native tokens from the account");
|
|
13
|
+
const Erc20TokenTransfer = Permission(PermissionType.ERC20_TOKEN_TRANSFER, Type.Object({
|
|
14
|
+
allowance: TypeHex(),
|
|
15
|
+
address: TypeAddress,
|
|
16
|
+
}), "allows transfer or approval of erc20 tokens from the account");
|
|
17
|
+
const GasLimit = Permission(PermissionType.GAS_LIMIT, Type.Object({
|
|
18
|
+
limit: TypeHex(),
|
|
19
|
+
}), "allows the key to spend gas for UOs");
|
|
20
|
+
const ContractAccess = Permission(PermissionType.CONTRACT_ACCESS, Type.Object({
|
|
21
|
+
address: TypeAddress,
|
|
22
|
+
}), "grants access to all functions in a contract");
|
|
23
|
+
const AccountFunction = Permission(PermissionType.ACCOUNT_FUNCTIONS, Type.Object({
|
|
24
|
+
functions: Type.Array(TypeHex(), { minItems: 1 }),
|
|
25
|
+
}), "grants access to functions in the account");
|
|
26
|
+
const AllExternalFunctionAccess = Permission(PermissionType.FUNCTIONS_ON_ALL_CONTRACTS, Type.Object({
|
|
27
|
+
functions: Type.Array(TypeHex(), { minItems: 1 }),
|
|
28
|
+
}), "access to a function selector in any address or contract");
|
|
29
|
+
const ContractFunctionAccess = Permission(PermissionType.FUNCTIONS_ON_CONTRACT, Type.Object({
|
|
30
|
+
address: TypeAddress,
|
|
31
|
+
functions: Type.Array(TypeHex(), { minItems: 1 }),
|
|
32
|
+
}), "grants access to specified functions on a specific contract");
|
|
33
|
+
const Root = Permission(PermissionType.ROOT, Type.Optional(Type.Never()), "grants full access to everything");
|
|
34
|
+
export const PermissionsArray = Type.Array(Type.Union([
|
|
35
|
+
// 7715 permissions
|
|
36
|
+
NativeTokenTransfer,
|
|
37
|
+
Erc20TokenTransfer,
|
|
38
|
+
GasLimit,
|
|
39
|
+
// additional permissions
|
|
40
|
+
ContractAccess,
|
|
41
|
+
AccountFunction,
|
|
42
|
+
AllExternalFunctionAccess,
|
|
43
|
+
ContractFunctionAccess,
|
|
44
|
+
Root,
|
|
45
|
+
]), { minItems: 1 });
|
|
46
|
+
export const PermissionsContext = Type.Object({
|
|
47
|
+
context: TypeHex(),
|
|
48
|
+
});
|
|
49
|
+
export const PermissionsData = Type.Object({
|
|
50
|
+
chainId: TypeHex(),
|
|
51
|
+
expiry: Type.Optional(Type.Number()),
|
|
52
|
+
key: KeySigner,
|
|
53
|
+
permissions: PermissionsArray,
|
|
54
|
+
});
|
|
55
|
+
export const PermissionsCapability = Type.Union([
|
|
56
|
+
PermissionsContext,
|
|
57
|
+
// TODO: support permissions object here instead of only context-encoded permissions
|
|
58
|
+
// PermissionsData,
|
|
59
|
+
]);
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/capabilities/permissions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EACL,IAAI,GAKL,MAAM,mBAAmB,C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AC,KAAK,CAAC;IAC9C,kBAAkB;IAClB,oFAAoF;IACpF,mBAAmB;CACpB,CAAC,CAAC","sourcesContent":["import { PermissionType } from \"@account-kit/smart-contracts/experimental\";\nimport {\n Type,\n type TLiteral,\n type TLiteralValue,\n type TObject,\n type TSchema,\n} from \"@sinclair/typebox\";\nimport { KeySigner, TypeAddress, TypeHex } from \"../../schemas\";\n\nconst Permission = <\n TData extends TSchema,\n TLiteralVal extends TLiteralValue,\n TType extends TLiteral<TLiteralVal>,\n>(\n type: TLiteralVal,\n data: TData,\n description: string,\n): TObject<{ type: TType; data: TData }> => {\n return Type.Object(\n {\n type: Type.Literal(type),\n data,\n },\n { description: description },\n ) as never;\n};\n\nconst NativeTokenTransfer = Permission(\n PermissionType.NATIVE_TOKEN_TRANSFER,\n Type.Object({\n allowance: TypeHex(),\n }),\n \"allows transfer of native tokens from the account\",\n);\n\nconst Erc20TokenTransfer = Permission(\n PermissionType.ERC20_TOKEN_TRANSFER,\n Type.Object({\n allowance: TypeHex(),\n address: TypeAddress,\n }),\n \"allows transfer or approval of erc20 tokens from the account\",\n);\n\nconst GasLimit = Permission(\n PermissionType.GAS_LIMIT,\n Type.Object({\n limit: TypeHex(),\n }),\n \"allows the key to spend gas for UOs\",\n);\n\nconst ContractAccess = Permission(\n PermissionType.CONTRACT_ACCESS,\n Type.Object({\n address: TypeAddress,\n }),\n \"grants access to all functions in a contract\",\n);\n\nconst AccountFunction = Permission(\n PermissionType.ACCOUNT_FUNCTIONS,\n Type.Object({\n functions: Type.Array(TypeHex(), { minItems: 1 }),\n }),\n \"grants access to functions in the account\",\n);\n\nconst AllExternalFunctionAccess = Permission(\n PermissionType.FUNCTIONS_ON_ALL_CONTRACTS,\n Type.Object({\n functions: Type.Array(TypeHex(), { minItems: 1 }),\n }),\n \"access to a function selector in any address or contract\",\n);\n\nconst ContractFunctionAccess = Permission(\n PermissionType.FUNCTIONS_ON_CONTRACT,\n Type.Object({\n address: TypeAddress,\n functions: Type.Array(TypeHex(), { minItems: 1 }),\n }),\n \"grants access to specified functions on a specific contract\",\n);\n\nconst Root = Permission(\n PermissionType.ROOT,\n Type.Optional(Type.Never()),\n \"grants full access to everything\",\n);\n\nexport const PermissionsArray = Type.Array(\n Type.Union([\n // 7715 permissions\n NativeTokenTransfer,\n Erc20TokenTransfer,\n GasLimit,\n // additional permissions\n ContractAccess,\n AccountFunction,\n AllExternalFunctionAccess,\n ContractFunctionAccess,\n Root,\n ]),\n { minItems: 1 },\n);\n\nexport const PermissionsContext = Type.Object({\n context: TypeHex(),\n});\n\nexport const PermissionsData = Type.Object({\n chainId: TypeHex(),\n expiry: Type.Optional(Type.Number()),\n key: KeySigner,\n permissions: PermissionsArray,\n});\n\nexport const PermissionsCapability = Type.Union([\n PermissionsContext,\n // TODO: support permissions object here instead of only context-encoded permissions\n // PermissionsData,\n]);\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Static } from "@sinclair/typebox";
|
|
2
|
+
import { type Hex } from "viem";
|
|
3
|
+
import type { PermissionsData } from ".";
|
|
4
|
+
import type { KeySigner } from "../../schemas";
|
|
5
|
+
export declare const SESSION_ID_LENGTH_BYTES = 16;
|
|
6
|
+
export declare const ENTITY_ID_LENGTH_BYTES = 4;
|
|
7
|
+
export declare const PermissionsContextVersion: {
|
|
8
|
+
readonly REMOTE_MODE_DEFERRED_ACTION: "0x00";
|
|
9
|
+
readonly LOCAL_MODE_DEFERRED_ACTION: "0x01";
|
|
10
|
+
readonly NON_DEFERRED_ACTION: "0x02";
|
|
11
|
+
};
|
|
12
|
+
type DecodedPermissionsContext = {
|
|
13
|
+
contextVersion: keyof typeof PermissionsContextVersion;
|
|
14
|
+
} & ({
|
|
15
|
+
contextVersion: "REMOTE_MODE_DEFERRED_ACTION";
|
|
16
|
+
sessionId: Hex;
|
|
17
|
+
signature: Hex;
|
|
18
|
+
deferredAction?: never;
|
|
19
|
+
} | {
|
|
20
|
+
contextVersion: "LOCAL_MODE_DEFERRED_ACTION";
|
|
21
|
+
deferredAction: Hex;
|
|
22
|
+
sessionId?: never;
|
|
23
|
+
signature?: never;
|
|
24
|
+
} | {
|
|
25
|
+
contextVersion: "NON_DEFERRED_ACTION";
|
|
26
|
+
deferredAction?: never;
|
|
27
|
+
sessionId?: never;
|
|
28
|
+
signature?: never;
|
|
29
|
+
entityId: Hex;
|
|
30
|
+
isGlobalValidation: boolean;
|
|
31
|
+
});
|
|
32
|
+
export declare const encodePermissionsContext: (context: DecodedPermissionsContext) => Hex;
|
|
33
|
+
export declare const decodePermissionsContext: (input: Hex) => DecodedPermissionsContext;
|
|
34
|
+
export declare const prefixSignatureKeyType: (sig: Hex, type: KeySigner["type"]) => Hex;
|
|
35
|
+
export declare const isGlobalValidation: (data: Pick<Static<typeof PermissionsData>, "permissions">) => boolean;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { PermissionType } from "@account-kit/smart-contracts/experimental";
|
|
2
|
+
import { concatHex, sliceHex } from "viem";
|
|
3
|
+
import { assertNever } from "../../utils";
|
|
4
|
+
export const SESSION_ID_LENGTH_BYTES = 16;
|
|
5
|
+
export const ENTITY_ID_LENGTH_BYTES = 4;
|
|
6
|
+
export const PermissionsContextVersion = {
|
|
7
|
+
REMOTE_MODE_DEFERRED_ACTION: "0x00",
|
|
8
|
+
LOCAL_MODE_DEFERRED_ACTION: "0x01",
|
|
9
|
+
NON_DEFERRED_ACTION: "0x02",
|
|
10
|
+
};
|
|
11
|
+
export const encodePermissionsContext = (context) => {
|
|
12
|
+
switch (context.contextVersion) {
|
|
13
|
+
case "REMOTE_MODE_DEFERRED_ACTION":
|
|
14
|
+
return concatHex([
|
|
15
|
+
PermissionsContextVersion.REMOTE_MODE_DEFERRED_ACTION,
|
|
16
|
+
context.sessionId,
|
|
17
|
+
context.signature,
|
|
18
|
+
]);
|
|
19
|
+
case "LOCAL_MODE_DEFERRED_ACTION":
|
|
20
|
+
return concatHex([
|
|
21
|
+
PermissionsContextVersion.LOCAL_MODE_DEFERRED_ACTION,
|
|
22
|
+
context.deferredAction,
|
|
23
|
+
]);
|
|
24
|
+
case "NON_DEFERRED_ACTION":
|
|
25
|
+
return concatHex([
|
|
26
|
+
PermissionsContextVersion.NON_DEFERRED_ACTION,
|
|
27
|
+
context.isGlobalValidation ? "0x01" : "0x00",
|
|
28
|
+
context.entityId,
|
|
29
|
+
]);
|
|
30
|
+
default:
|
|
31
|
+
return assertNever(context, "Unexpected context version");
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
export const decodePermissionsContext = (input) => {
|
|
35
|
+
const contextVersion = sliceHex(input, 0, 1);
|
|
36
|
+
switch (contextVersion) {
|
|
37
|
+
case "0x00": {
|
|
38
|
+
const sessionId = sliceHex(input, 1, SESSION_ID_LENGTH_BYTES + 1);
|
|
39
|
+
const signature = sliceHex(input, SESSION_ID_LENGTH_BYTES + 1);
|
|
40
|
+
return {
|
|
41
|
+
contextVersion: "REMOTE_MODE_DEFERRED_ACTION",
|
|
42
|
+
sessionId,
|
|
43
|
+
signature,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
case "0x01": {
|
|
47
|
+
const deferredAction = sliceHex(input, 1);
|
|
48
|
+
return {
|
|
49
|
+
contextVersion: "LOCAL_MODE_DEFERRED_ACTION",
|
|
50
|
+
deferredAction,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
case "0x02": {
|
|
54
|
+
const isGlobalValidation = sliceHex(input, 1, 2) === "0x01";
|
|
55
|
+
const entityId = sliceHex(input, 2, ENTITY_ID_LENGTH_BYTES + 2);
|
|
56
|
+
return {
|
|
57
|
+
contextVersion: "NON_DEFERRED_ACTION",
|
|
58
|
+
isGlobalValidation,
|
|
59
|
+
entityId,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
default:
|
|
63
|
+
return assertNever(contextVersion, `Unexpected context version: ${contextVersion}`);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
export const prefixSignatureKeyType = (sig, type) => {
|
|
67
|
+
switch (type) {
|
|
68
|
+
case "secp256k1":
|
|
69
|
+
return concatHex(["0x00", sig]);
|
|
70
|
+
case "contract":
|
|
71
|
+
return concatHex(["0x01", sig]);
|
|
72
|
+
default:
|
|
73
|
+
return assertNever(type, "Unexpected session key type");
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
export const isGlobalValidation = (data) => {
|
|
77
|
+
return data.permissions.some((p) => p.type === PermissionType.ROOT);
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=mav2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mav2.js","sourceRoot":"","sources":["../../../../src/capabilities/permissions/mav2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE3E,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAY,MAAM,MAAM,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAC1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAExC,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,2BAA2B,EAAE,MAAM;IACnC,0BAA0B,EAAE,MAAM;IAClC,mBAAmB,EAAE,MAAM;CACnB,CAAC;AA8BX,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,OAAkC,EAC7B,EAAE;IACP,QAAQ,OAAO,CAAC,cAAc,EAAE,CAAC;QAC/B,KAAK,6BAA6B;YAChC,OAAO,SAAS,CAAC;gBACf,yBAAyB,CAAC,2BAA2B;gBACrD,OAAO,CAAC,SAAS;gBACjB,OAAO,CAAC,SAAS;aAClB,CAAC,CAAC;QACL,KAAK,4BAA4B;YAC/B,OAAO,SAAS,CAAC;gBACf,yBAAyB,CAAC,0BAA0B;gBACpD,OAAO,CAAC,cAAc;aACvB,CAAC,CAAC;QACL,KAAK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AC;QACJ,CAAC;QACD;YACE,OAAO,WAAW,CAChB,cAAc,EACd,+BAA+B,cAAc,EAAE,CAChD,CAAC;IACN,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,GAAQ,EACR,IAAuB,EAClB,EAAE;IACP,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,WAAW;YACd,OAAO,SAAS,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;QAClC,KAAK,UAAU;YACb,OAAO,SAAS,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;QAClC;YACE,OAAO,WAAW,CAAC,IAAI,EAAE,6BAA6B,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,IAAyD,EAChD,EAAE;IACX,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,cAAc,CAAC,IAAI,CAAC,CAAC;AACtE,CAAC,CAAC","sourcesContent":["import { PermissionType } from \"@account-kit/smart-contracts/experimental\";\nimport type { Static } from \"@sinclair/typebox\";\nimport { concatHex, sliceHex, type Hex } from \"viem\";\nimport type { PermissionsData } from \".\";\nimport type { KeySigner } from \"../../schemas\";\nimport { assertNever } from \"../../utils\";\n\nexport const SESSION_ID_LENGTH_BYTES = 16;\nexport const ENTITY_ID_LENGTH_BYTES = 4;\n\nexport const PermissionsContextVersion = {\n REMOTE_MODE_DEFERRED_ACTION: \"0x00\",\n LOCAL_MODE_DEFERRED_ACTION: \"0x01\",\n NON_DEFERRED_ACTION: \"0x02\",\n} as const;\n\ntype ContextVersionHex =\n (typeof PermissionsContextVersion)[keyof typeof PermissionsContextVersion];\n\ntype DecodedPermissionsContext = {\n contextVersion: keyof typeof PermissionsContextVersion;\n} & (\n | {\n contextVersion: \"REMOTE_MODE_DEFERRED_ACTION\";\n sessionId: Hex;\n signature: Hex;\n deferredAction?: never;\n }\n | {\n contextVersion: \"LOCAL_MODE_DEFERRED_ACTION\";\n deferredAction: Hex;\n sessionId?: never;\n signature?: never;\n }\n | {\n contextVersion: \"NON_DEFERRED_ACTION\";\n deferredAction?: never;\n sessionId?: never;\n signature?: never;\n entityId: Hex;\n isGlobalValidation: boolean;\n }\n);\n\nexport const encodePermissionsContext = (\n context: DecodedPermissionsContext,\n): Hex => {\n switch (context.contextVersion) {\n case \"REMOTE_MODE_DEFERRED_ACTION\":\n return concatHex([\n PermissionsContextVersion.REMOTE_MODE_DEFERRED_ACTION,\n context.sessionId,\n context.signature,\n ]);\n case \"LOCAL_MODE_DEFERRED_ACTION\":\n return concatHex([\n PermissionsContextVersion.LOCAL_MODE_DEFERRED_ACTION,\n context.deferredAction,\n ]);\n case \"NON_DEFERRED_ACTION\":\n return concatHex([\n PermissionsContextVersion.NON_DEFERRED_ACTION,\n context.isGlobalValidation ? \"0x01\" : \"0x00\",\n context.entityId,\n ]);\n default:\n return assertNever(context, \"Unexpected context version\");\n }\n};\n\nexport const decodePermissionsContext = (\n input: Hex,\n): DecodedPermissionsContext => {\n const contextVersion = sliceHex(input, 0, 1) as ContextVersionHex;\n switch (contextVersion) {\n case \"0x00\": {\n const sessionId = sliceHex(input, 1, SESSION_ID_LENGTH_BYTES + 1);\n const signature = sliceHex(input, SESSION_ID_LENGTH_BYTES + 1);\n return {\n contextVersion: \"REMOTE_MODE_DEFERRED_ACTION\",\n sessionId,\n signature,\n };\n }\n case \"0x01\": {\n const deferredAction = sliceHex(input, 1);\n return {\n contextVersion: \"LOCAL_MODE_DEFERRED_ACTION\",\n deferredAction,\n };\n }\n case \"0x02\": {\n const isGlobalValidation = sliceHex(input, 1, 2) === \"0x01\";\n const entityId = sliceHex(input, 2, ENTITY_ID_LENGTH_BYTES + 2);\n return {\n contextVersion: \"NON_DEFERRED_ACTION\",\n isGlobalValidation,\n entityId,\n };\n }\n default:\n return assertNever(\n contextVersion,\n `Unexpected context version: ${contextVersion}`,\n );\n }\n};\n\nexport const prefixSignatureKeyType = (\n sig: Hex,\n type: KeySigner[\"type\"],\n): Hex => {\n switch (type) {\n case \"secp256k1\":\n return concatHex([\"0x00\", sig]);\n case \"contract\":\n return concatHex([\"0x01\", sig]);\n default:\n return assertNever(type, \"Unexpected session key type\");\n }\n};\n\nexport const isGlobalValidation = (\n data: Pick<Static<typeof PermissionsData>, \"permissions\">,\n): boolean => {\n return data.permissions.some((p) => p.type === PermissionType.ROOT);\n};\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export type CreateAccountParams = Omit<Extract<Static<typeof wallet_createAccount>["Request"]["params"][0], {
|
|
7
|
+
signerAddress: Address;
|
|
8
|
+
}>, "signerAddress">;
|
|
9
|
+
export type CreateAccountResult = Static<typeof wallet_createAccount>["ReturnType"];
|
|
10
|
+
export declare function createAccount(client: InnerWalletApiClient, signer: SmartAccountSigner, params: CreateAccountParams): Promise<CreateAccountResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAccount.js","sourceRoot":"","sources":["../../../../src/client/actions/createAccount.ts"],"names":[],"mappings":"AAkBA,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAA4B,EAC5B,MAA0B,EAC1B,MAA2B;IAE3B,OAAO,MAAM,CAAC,OAAO,CAAC;QACpB,MAAM,EAAE,sBAAsB;QAC9B,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC;KAClE,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { SmartAccountSigner } from \"@aa-sdk/core\";\nimport type { Static } from \"@sinclair/typebox\";\nimport type { Address } from \"abitype\";\nimport type { wallet_createAccount } from \"../../rpc/request\";\nimport type { InnerWalletApiClient } from \"../../types\";\n\nexport type CreateAccountParams = Omit<\n Extract<\n Static<typeof wallet_createAccount>[\"Request\"][\"params\"][0],\n { signerAddress: Address }\n >,\n \"signerAddress\"\n>;\n\nexport type CreateAccountResult = Static<\n typeof wallet_createAccount\n>[\"ReturnType\"];\n\nexport async function createAccount(\n client: InnerWalletApiClient,\n signer: SmartAccountSigner,\n params: CreateAccountParams,\n): Promise<CreateAccountResult> {\n return client.request({\n method: \"wallet_createAccount\",\n params: [{ signerAddress: await signer.getAddress(), ...params }],\n });\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Address, JsonRpcAccount } from "viem";
|
|
2
|
+
import type { GetCallsStatusParams as IsomorphicGetCallsStatusParams, GetCallsStatusResponse as IsomorphicGetCallsStatusResult } from "../../isomorphic/actions/getCallsStatus";
|
|
3
|
+
import type { InnerWalletApiClient } from "../../types";
|
|
4
|
+
export type GetCallsStatusParams = IsomorphicGetCallsStatusParams;
|
|
5
|
+
export type GetCallsStatusResult = IsomorphicGetCallsStatusResult;
|
|
6
|
+
export declare function getCallsStatus<TAccount extends JsonRpcAccount<Address> | undefined = JsonRpcAccount<Address> | undefined>(client: InnerWalletApiClient<TAccount>, params: GetCallsStatusParams): Promise<GetCallsStatusResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCallsStatus.js","sourceRoot":"","sources":["../../../../src/client/actions/getCallsStatus.ts"],"names":[],"mappings":"AAoBA,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA4B,EAC5B,MAA4B;IAE5B,OAAO,MAAM,MAAM,CAAC,OAAO,CAAC;QAC1B,MAAM,EAAE,uBAAuB;QAC/B,MAAM,EAAE,CAAC,MAAM,CAAC;KACjB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Address, JsonRpcAccount } from \"viem\";\nimport type {\n GetCallsStatusParams as IsomorphicGetCallsStatusParams,\n GetCallsStatusResponse as IsomorphicGetCallsStatusResult,\n} from \"../../isomorphic/actions/getCallsStatus\";\nimport type { InnerWalletApiClient } from \"../../types\";\n\nexport type GetCallsStatusParams = IsomorphicGetCallsStatusParams;\n\nexport type GetCallsStatusResult = IsomorphicGetCallsStatusResult;\n\nexport async function getCallsStatus<\n TAccount extends JsonRpcAccount<Address> | undefined =\n | JsonRpcAccount<Address>\n | undefined,\n>(\n client: InnerWalletApiClient<TAccount>,\n params: GetCallsStatusParams,\n): Promise<GetCallsStatusResult>;\n\nexport async function getCallsStatus(\n client: InnerWalletApiClient,\n params: GetCallsStatusParams,\n): Promise<GetCallsStatusResult> {\n return await client.request({\n method: \"wallet_getCallsStatus\",\n params: [params],\n });\n}\n"]}
|