@account-kit/smart-contracts 4.35.0 → 4.35.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.
Files changed (186) hide show
  1. package/dist/esm/plugindefs/session-key/config.js.map +1 -1
  2. package/dist/esm/src/light-account/accounts/account.js.map +1 -1
  3. package/dist/esm/src/light-account/accounts/base.js.map +1 -1
  4. package/dist/esm/src/light-account/accounts/multiOwner.js.map +1 -1
  5. package/dist/esm/src/light-account/accounts/predictAddress.js.map +1 -1
  6. package/dist/esm/src/light-account/actions/transferOwnership.d.ts +1 -1
  7. package/dist/esm/src/light-account/actions/transferOwnership.js.map +1 -1
  8. package/dist/esm/src/light-account/actions/updateOwners.js.map +1 -1
  9. package/dist/esm/src/light-account/clients/alchemyClient.js.map +1 -1
  10. package/dist/esm/src/light-account/clients/client.js.map +1 -1
  11. package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
  12. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js.map +1 -1
  13. package/dist/esm/src/light-account/decorators/lightAccount.js.map +1 -1
  14. package/dist/esm/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
  15. package/dist/esm/src/light-account/types.js.map +1 -1
  16. package/dist/esm/src/light-account/utils.d.ts +1 -1
  17. package/dist/esm/src/light-account/utils.js.map +1 -1
  18. package/dist/esm/src/ma-v2/account/common/modularAccountV2Base.js.map +1 -1
  19. package/dist/esm/src/ma-v2/account/modularAccountV2.js.map +1 -1
  20. package/dist/esm/src/ma-v2/account/nativeSMASigner.d.ts +2 -207
  21. package/dist/esm/src/ma-v2/account/nativeSMASigner.js +7 -4
  22. package/dist/esm/src/ma-v2/account/nativeSMASigner.js.map +1 -1
  23. package/dist/esm/src/ma-v2/account/predictAddress.js.map +1 -1
  24. package/dist/esm/src/ma-v2/actions/deferralActions.js.map +1 -1
  25. package/dist/esm/src/ma-v2/actions/install-validation/installValidation.js.map +1 -1
  26. package/dist/esm/src/ma-v2/client/client.js.map +1 -1
  27. package/dist/esm/src/ma-v2/modules/allowlist-module/module.js.map +1 -1
  28. package/dist/esm/src/ma-v2/modules/native-token-limit-module/module.js.map +1 -1
  29. package/dist/esm/src/ma-v2/modules/paymaster-guard-module/module.js.map +1 -1
  30. package/dist/esm/src/ma-v2/modules/single-signer-validation/module.js.map +1 -1
  31. package/dist/esm/src/ma-v2/modules/single-signer-validation/signer.d.ts +2 -207
  32. package/dist/esm/src/ma-v2/modules/single-signer-validation/signer.js +7 -4
  33. package/dist/esm/src/ma-v2/modules/single-signer-validation/signer.js.map +1 -1
  34. package/dist/esm/src/ma-v2/modules/time-range-module/module.js.map +1 -1
  35. package/dist/esm/src/ma-v2/modules/utils.js.map +1 -1
  36. package/dist/esm/src/ma-v2/modules/webauthn-validation/module.js.map +1 -1
  37. package/dist/esm/src/ma-v2/permissionBuilder.js.map +1 -1
  38. package/dist/esm/src/ma-v2/permissionBuilderErrors.js +1 -1
  39. package/dist/esm/src/ma-v2/permissionBuilderErrors.js.map +1 -1
  40. package/dist/esm/src/ma-v2/utils.js.map +1 -1
  41. package/dist/esm/src/msca/account/multiOwnerAccount.js.map +1 -1
  42. package/dist/esm/src/msca/account/multisigAccount.d.ts +1 -1
  43. package/dist/esm/src/msca/account/multisigAccount.js.map +1 -1
  44. package/dist/esm/src/msca/account-loupe/decorator.js.map +1 -1
  45. package/dist/esm/src/msca/account-loupe/types.js.map +1 -1
  46. package/dist/esm/src/msca/client/alchemyClient.js.map +1 -1
  47. package/dist/esm/src/msca/client/client.js.map +1 -1
  48. package/dist/esm/src/msca/client/multiSigAlchemyClient.js.map +1 -1
  49. package/dist/esm/src/msca/plugin-manager/decorator.js.map +1 -1
  50. package/dist/esm/src/msca/plugin-manager/installPlugin.js.map +1 -1
  51. package/dist/esm/src/msca/plugin-manager/uninstallPlugin.js.map +1 -1
  52. package/dist/esm/src/msca/plugins/multi-owner/extension.js.map +1 -1
  53. package/dist/esm/src/msca/plugins/multi-owner/plugin.js.map +1 -1
  54. package/dist/esm/src/msca/plugins/multi-owner/signer.d.ts +3 -208
  55. package/dist/esm/src/msca/plugins/multi-owner/signer.js.map +1 -1
  56. package/dist/esm/src/msca/plugins/multisig/actions/getThreshold.js.map +1 -1
  57. package/dist/esm/src/msca/plugins/multisig/actions/isOwnerOf.js.map +1 -1
  58. package/dist/esm/src/msca/plugins/multisig/actions/proposeUserOperation.js.map +1 -1
  59. package/dist/esm/src/msca/plugins/multisig/actions/readOwners.js.map +1 -1
  60. package/dist/esm/src/msca/plugins/multisig/actions/signMultisigUserOperation.js.map +1 -1
  61. package/dist/esm/src/msca/plugins/multisig/extension.js.map +1 -1
  62. package/dist/esm/src/msca/plugins/multisig/middleware.js.map +1 -1
  63. package/dist/esm/src/msca/plugins/multisig/plugin.js.map +1 -1
  64. package/dist/esm/src/msca/plugins/multisig/signer.d.ts +3 -208
  65. package/dist/esm/src/msca/plugins/multisig/signer.js.map +1 -1
  66. package/dist/esm/src/msca/plugins/multisig/types.js.map +1 -1
  67. package/dist/esm/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
  68. package/dist/esm/src/msca/plugins/multisig/utils/getSignerType.d.ts +1 -1
  69. package/dist/esm/src/msca/plugins/multisig/utils/getSignerType.js.map +1 -1
  70. package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +1 -1
  71. package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
  72. package/dist/esm/src/msca/plugins/session-key/extension.js.map +1 -1
  73. package/dist/esm/src/msca/plugins/session-key/permissions.js.map +1 -1
  74. package/dist/esm/src/msca/plugins/session-key/plugin.js.map +1 -1
  75. package/dist/esm/src/msca/plugins/session-key/signer.d.ts +4 -209
  76. package/dist/esm/src/msca/plugins/session-key/signer.js.map +1 -1
  77. package/dist/esm/src/msca/plugins/session-key/utils.js.map +1 -1
  78. package/dist/esm/src/msca/plugins/types.js.map +1 -1
  79. package/dist/esm/src/msca/utils.js.map +1 -1
  80. package/dist/types/src/light-account/accounts/account.d.ts.map +1 -1
  81. package/dist/types/src/light-account/accounts/base.d.ts.map +1 -1
  82. package/dist/types/src/light-account/accounts/multiOwner.d.ts.map +1 -1
  83. package/dist/types/src/light-account/actions/transferOwnership.d.ts +1 -1
  84. package/dist/types/src/light-account/actions/transferOwnership.d.ts.map +1 -1
  85. package/dist/types/src/light-account/actions/updateOwners.d.ts.map +1 -1
  86. package/dist/types/src/light-account/types.d.ts.map +1 -1
  87. package/dist/types/src/light-account/utils.d.ts +1 -1
  88. package/dist/types/src/light-account/utils.d.ts.map +1 -1
  89. package/dist/types/src/ma-v2/account/nativeSMASigner.d.ts +2 -207
  90. package/dist/types/src/ma-v2/account/nativeSMASigner.d.ts.map +1 -1
  91. package/dist/types/src/ma-v2/modules/allowlist-module/module.d.ts.map +1 -1
  92. package/dist/types/src/ma-v2/modules/single-signer-validation/signer.d.ts +2 -207
  93. package/dist/types/src/ma-v2/modules/single-signer-validation/signer.d.ts.map +1 -1
  94. package/dist/types/src/ma-v2/modules/utils.d.ts.map +1 -1
  95. package/dist/types/src/ma-v2/permissionBuilderErrors.d.ts.map +1 -1
  96. package/dist/types/src/ma-v2/utils.d.ts.map +1 -1
  97. package/dist/types/src/msca/account/multisigAccount.d.ts +1 -1
  98. package/dist/types/src/msca/account/multisigAccount.d.ts.map +1 -1
  99. package/dist/types/src/msca/plugin-manager/decorator.d.ts.map +1 -1
  100. package/dist/types/src/msca/plugin-manager/installPlugin.d.ts.map +1 -1
  101. package/dist/types/src/msca/plugin-manager/uninstallPlugin.d.ts.map +1 -1
  102. package/dist/types/src/msca/plugins/multi-owner/plugin.d.ts.map +1 -1
  103. package/dist/types/src/msca/plugins/multi-owner/signer.d.ts +3 -208
  104. package/dist/types/src/msca/plugins/multi-owner/signer.d.ts.map +1 -1
  105. package/dist/types/src/msca/plugins/multisig/actions/proposeUserOperation.d.ts.map +1 -1
  106. package/dist/types/src/msca/plugins/multisig/plugin.d.ts.map +1 -1
  107. package/dist/types/src/msca/plugins/multisig/signer.d.ts +3 -208
  108. package/dist/types/src/msca/plugins/multisig/signer.d.ts.map +1 -1
  109. package/dist/types/src/msca/plugins/multisig/types.d.ts.map +1 -1
  110. package/dist/types/src/msca/plugins/multisig/utils/formatSignatures.d.ts.map +1 -1
  111. package/dist/types/src/msca/plugins/multisig/utils/getSignerType.d.ts +1 -1
  112. package/dist/types/src/msca/plugins/multisig/utils/getSignerType.d.ts.map +1 -1
  113. package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +1 -1
  114. package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts.map +1 -1
  115. package/dist/types/src/msca/plugins/session-key/extension.d.ts.map +1 -1
  116. package/dist/types/src/msca/plugins/session-key/plugin.d.ts.map +1 -1
  117. package/dist/types/src/msca/plugins/session-key/signer.d.ts +4 -209
  118. package/dist/types/src/msca/plugins/session-key/signer.d.ts.map +1 -1
  119. package/dist/types/src/msca/utils.d.ts.map +1 -1
  120. package/package.json +7 -9
  121. package/plugindefs/session-key/config.ts +1 -1
  122. package/src/light-account/accounts/account.ts +7 -5
  123. package/src/light-account/accounts/base.ts +18 -15
  124. package/src/light-account/accounts/multiOwner.ts +9 -6
  125. package/src/light-account/accounts/predictAddress.ts +5 -5
  126. package/src/light-account/actions/transferOwnership.ts +5 -4
  127. package/src/light-account/actions/updateOwners.ts +6 -5
  128. package/src/light-account/clients/alchemyClient.ts +3 -3
  129. package/src/light-account/clients/client.ts +6 -6
  130. package/src/light-account/clients/multiOwnerAlchemyClient.ts +3 -3
  131. package/src/light-account/clients/multiOwnerLightAccount.ts +7 -7
  132. package/src/light-account/decorators/lightAccount.ts +4 -4
  133. package/src/light-account/decorators/multiOwnerLightAccount.ts +4 -4
  134. package/src/light-account/types.ts +3 -2
  135. package/src/light-account/utils.ts +10 -10
  136. package/src/ma-v2/account/common/modularAccountV2Base.ts +8 -8
  137. package/src/ma-v2/account/modularAccountV2.ts +4 -4
  138. package/src/ma-v2/account/nativeSMASigner.ts +16 -13
  139. package/src/ma-v2/account/predictAddress.ts +13 -13
  140. package/src/ma-v2/actions/deferralActions.ts +7 -7
  141. package/src/ma-v2/actions/install-validation/installValidation.ts +14 -14
  142. package/src/ma-v2/client/client.ts +8 -8
  143. package/src/ma-v2/modules/allowlist-module/module.ts +5 -5
  144. package/src/ma-v2/modules/native-token-limit-module/module.ts +1 -1
  145. package/src/ma-v2/modules/paymaster-guard-module/module.ts +2 -2
  146. package/src/ma-v2/modules/single-signer-validation/module.ts +2 -2
  147. package/src/ma-v2/modules/single-signer-validation/signer.ts +14 -11
  148. package/src/ma-v2/modules/time-range-module/module.ts +6 -6
  149. package/src/ma-v2/modules/utils.ts +4 -4
  150. package/src/ma-v2/modules/webauthn-validation/module.ts +2 -2
  151. package/src/ma-v2/permissionBuilder.ts +14 -14
  152. package/src/ma-v2/permissionBuilderErrors.ts +9 -7
  153. package/src/ma-v2/utils.ts +4 -4
  154. package/src/msca/account/multiOwnerAccount.ts +5 -5
  155. package/src/msca/account/multisigAccount.ts +6 -6
  156. package/src/msca/account-loupe/decorator.ts +11 -11
  157. package/src/msca/account-loupe/types.ts +1 -1
  158. package/src/msca/client/alchemyClient.ts +4 -4
  159. package/src/msca/client/client.ts +12 -12
  160. package/src/msca/client/multiSigAlchemyClient.ts +4 -4
  161. package/src/msca/plugin-manager/decorator.ts +6 -5
  162. package/src/msca/plugin-manager/installPlugin.ts +8 -7
  163. package/src/msca/plugin-manager/uninstallPlugin.ts +6 -5
  164. package/src/msca/plugins/multi-owner/extension.ts +10 -10
  165. package/src/msca/plugins/multi-owner/plugin.ts +21 -19
  166. package/src/msca/plugins/multi-owner/signer.ts +4 -4
  167. package/src/msca/plugins/multisig/actions/getThreshold.ts +3 -3
  168. package/src/msca/plugins/multisig/actions/isOwnerOf.ts +2 -2
  169. package/src/msca/plugins/multisig/actions/proposeUserOperation.ts +4 -3
  170. package/src/msca/plugins/multisig/actions/readOwners.ts +3 -3
  171. package/src/msca/plugins/multisig/actions/signMultisigUserOperation.ts +5 -5
  172. package/src/msca/plugins/multisig/extension.ts +16 -16
  173. package/src/msca/plugins/multisig/middleware.ts +2 -2
  174. package/src/msca/plugins/multisig/plugin.ts +21 -19
  175. package/src/msca/plugins/multisig/signer.ts +5 -5
  176. package/src/msca/plugins/multisig/types.ts +4 -2
  177. package/src/msca/plugins/multisig/utils/formatSignatures.ts +1 -1
  178. package/src/msca/plugins/multisig/utils/getSignerType.ts +2 -2
  179. package/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts +7 -6
  180. package/src/msca/plugins/session-key/extension.ts +16 -14
  181. package/src/msca/plugins/session-key/permissions.ts +7 -7
  182. package/src/msca/plugins/session-key/plugin.ts +30 -28
  183. package/src/msca/plugins/session-key/signer.ts +5 -5
  184. package/src/msca/plugins/session-key/utils.ts +4 -4
  185. package/src/msca/plugins/types.ts +1 -1
  186. package/src/msca/utils.ts +11 -11
@@ -1,5 +1,5 @@
1
1
  import type { SmartAccountSigner } from "@aa-sdk/core";
2
- import { type Hex, type SignableMessage, type TypedDataDefinition, type Chain, type Address } from "viem";
2
+ import { type Address, type Chain, type Hex, type SignableMessage, type TypedData, type TypedDataDefinition } from "viem";
3
3
  /**
4
4
  * Creates an object with methods for generating a dummy signature, signing user operation hashes, signing messages, and signing typed data.
5
5
  *
@@ -31,210 +31,5 @@ export declare const singleSignerMessageSigner: (signer: SmartAccountSigner, cha
31
31
  signMessage({ message }: {
32
32
  message: SignableMessage;
33
33
  }): Promise<Hex>;
34
- signTypedData: <const typedData extends Record<string, unknown> | {
35
- [x: string]: readonly import("viem").TypedDataParameter[];
36
- [x: `string[${string}]`]: undefined;
37
- [x: `function[${string}]`]: undefined;
38
- [x: `address[${string}]`]: undefined;
39
- [x: `uint64[${string}]`]: undefined;
40
- [x: `bytes32[${string}]`]: undefined;
41
- [x: `bytes[${string}]`]: undefined;
42
- [x: `uint256[${string}]`]: undefined;
43
- [x: `bytes4[${string}]`]: undefined;
44
- [x: `bool[${string}]`]: undefined;
45
- [x: `bytes1[${string}]`]: undefined;
46
- [x: `uint32[${string}]`]: undefined;
47
- [x: `bytes2[${string}]`]: undefined;
48
- [x: `bytes3[${string}]`]: undefined;
49
- [x: `bytes5[${string}]`]: undefined;
50
- [x: `bytes6[${string}]`]: undefined;
51
- [x: `bytes11[${string}]`]: undefined;
52
- [x: `bytes7[${string}]`]: undefined;
53
- [x: `bytes9[${string}]`]: undefined;
54
- [x: `bytes27[${string}]`]: undefined;
55
- [x: `bytes22[${string}]`]: undefined;
56
- [x: `bytes8[${string}]`]: undefined;
57
- [x: `bytes10[${string}]`]: undefined;
58
- [x: `bytes12[${string}]`]: undefined;
59
- [x: `bytes13[${string}]`]: undefined;
60
- [x: `bytes14[${string}]`]: undefined;
61
- [x: `bytes15[${string}]`]: undefined;
62
- [x: `bytes16[${string}]`]: undefined;
63
- [x: `bytes17[${string}]`]: undefined;
64
- [x: `bytes18[${string}]`]: undefined;
65
- [x: `bytes19[${string}]`]: undefined;
66
- [x: `bytes20[${string}]`]: undefined;
67
- [x: `bytes21[${string}]`]: undefined;
68
- [x: `bytes23[${string}]`]: undefined;
69
- [x: `bytes24[${string}]`]: undefined;
70
- [x: `bytes25[${string}]`]: undefined;
71
- [x: `bytes26[${string}]`]: undefined;
72
- [x: `bytes28[${string}]`]: undefined;
73
- [x: `bytes29[${string}]`]: undefined;
74
- [x: `bytes30[${string}]`]: undefined;
75
- [x: `bytes31[${string}]`]: undefined;
76
- [x: `int[${string}]`]: undefined;
77
- [x: `int8[${string}]`]: undefined;
78
- [x: `int16[${string}]`]: undefined;
79
- [x: `int24[${string}]`]: undefined;
80
- [x: `int32[${string}]`]: undefined;
81
- [x: `int40[${string}]`]: undefined;
82
- [x: `int48[${string}]`]: undefined;
83
- [x: `int56[${string}]`]: undefined;
84
- [x: `int64[${string}]`]: undefined;
85
- [x: `int72[${string}]`]: undefined;
86
- [x: `int80[${string}]`]: undefined;
87
- [x: `int88[${string}]`]: undefined;
88
- [x: `int96[${string}]`]: undefined;
89
- [x: `int104[${string}]`]: undefined;
90
- [x: `int112[${string}]`]: undefined;
91
- [x: `int120[${string}]`]: undefined;
92
- [x: `int128[${string}]`]: undefined;
93
- [x: `int136[${string}]`]: undefined;
94
- [x: `int144[${string}]`]: undefined;
95
- [x: `int152[${string}]`]: undefined;
96
- [x: `int160[${string}]`]: undefined;
97
- [x: `int168[${string}]`]: undefined;
98
- [x: `int176[${string}]`]: undefined;
99
- [x: `int184[${string}]`]: undefined;
100
- [x: `int192[${string}]`]: undefined;
101
- [x: `int200[${string}]`]: undefined;
102
- [x: `int208[${string}]`]: undefined;
103
- [x: `int216[${string}]`]: undefined;
104
- [x: `int224[${string}]`]: undefined;
105
- [x: `int232[${string}]`]: undefined;
106
- [x: `int240[${string}]`]: undefined;
107
- [x: `int248[${string}]`]: undefined;
108
- [x: `int256[${string}]`]: undefined;
109
- [x: `uint[${string}]`]: undefined;
110
- [x: `uint8[${string}]`]: undefined;
111
- [x: `uint16[${string}]`]: undefined;
112
- [x: `uint24[${string}]`]: undefined;
113
- [x: `uint40[${string}]`]: undefined;
114
- [x: `uint48[${string}]`]: undefined;
115
- [x: `uint56[${string}]`]: undefined;
116
- [x: `uint72[${string}]`]: undefined;
117
- [x: `uint80[${string}]`]: undefined;
118
- [x: `uint88[${string}]`]: undefined;
119
- [x: `uint96[${string}]`]: undefined;
120
- [x: `uint104[${string}]`]: undefined;
121
- [x: `uint112[${string}]`]: undefined;
122
- [x: `uint120[${string}]`]: undefined;
123
- [x: `uint128[${string}]`]: undefined;
124
- [x: `uint136[${string}]`]: undefined;
125
- [x: `uint144[${string}]`]: undefined;
126
- [x: `uint152[${string}]`]: undefined;
127
- [x: `uint160[${string}]`]: undefined;
128
- [x: `uint168[${string}]`]: undefined;
129
- [x: `uint176[${string}]`]: undefined;
130
- [x: `uint184[${string}]`]: undefined;
131
- [x: `uint192[${string}]`]: undefined;
132
- [x: `uint200[${string}]`]: undefined;
133
- [x: `uint208[${string}]`]: undefined;
134
- [x: `uint216[${string}]`]: undefined;
135
- [x: `uint224[${string}]`]: undefined;
136
- [x: `uint232[${string}]`]: undefined;
137
- [x: `uint240[${string}]`]: undefined;
138
- [x: `uint248[${string}]`]: undefined;
139
- string?: undefined;
140
- address?: undefined;
141
- uint64?: undefined;
142
- bytes32?: undefined;
143
- bytes?: undefined;
144
- uint256?: undefined;
145
- bytes4?: undefined;
146
- bool?: undefined;
147
- bytes1?: undefined;
148
- uint32?: undefined;
149
- bytes2?: undefined;
150
- bytes3?: undefined;
151
- bytes5?: undefined;
152
- bytes6?: undefined;
153
- bytes11?: undefined;
154
- bytes7?: undefined;
155
- bytes9?: undefined;
156
- bytes27?: undefined;
157
- bytes22?: undefined;
158
- bytes8?: undefined;
159
- bytes10?: undefined;
160
- bytes12?: undefined;
161
- bytes13?: undefined;
162
- bytes14?: undefined;
163
- bytes15?: undefined;
164
- bytes16?: undefined;
165
- bytes17?: undefined;
166
- bytes18?: undefined;
167
- bytes19?: undefined;
168
- bytes20?: undefined;
169
- bytes21?: undefined;
170
- bytes23?: undefined;
171
- bytes24?: undefined;
172
- bytes25?: undefined;
173
- bytes26?: undefined;
174
- bytes28?: undefined;
175
- bytes29?: undefined;
176
- bytes30?: undefined;
177
- bytes31?: undefined;
178
- int8?: undefined;
179
- int16?: undefined;
180
- int24?: undefined;
181
- int32?: undefined;
182
- int40?: undefined;
183
- int48?: undefined;
184
- int56?: undefined;
185
- int64?: undefined;
186
- int72?: undefined;
187
- int80?: undefined;
188
- int88?: undefined;
189
- int96?: undefined;
190
- int104?: undefined;
191
- int112?: undefined;
192
- int120?: undefined;
193
- int128?: undefined;
194
- int136?: undefined;
195
- int144?: undefined;
196
- int152?: undefined;
197
- int160?: undefined;
198
- int168?: undefined;
199
- int176?: undefined;
200
- int184?: undefined;
201
- int192?: undefined;
202
- int200?: undefined;
203
- int208?: undefined;
204
- int216?: undefined;
205
- int224?: undefined;
206
- int232?: undefined;
207
- int240?: undefined;
208
- int248?: undefined;
209
- int256?: undefined;
210
- uint8?: undefined;
211
- uint16?: undefined;
212
- uint24?: undefined;
213
- uint40?: undefined;
214
- uint48?: undefined;
215
- uint56?: undefined;
216
- uint72?: undefined;
217
- uint80?: undefined;
218
- uint88?: undefined;
219
- uint96?: undefined;
220
- uint104?: undefined;
221
- uint112?: undefined;
222
- uint120?: undefined;
223
- uint128?: undefined;
224
- uint136?: undefined;
225
- uint144?: undefined;
226
- uint152?: undefined;
227
- uint160?: undefined;
228
- uint168?: undefined;
229
- uint176?: undefined;
230
- uint184?: undefined;
231
- uint192?: undefined;
232
- uint200?: undefined;
233
- uint208?: undefined;
234
- uint216?: undefined;
235
- uint224?: undefined;
236
- uint232?: undefined;
237
- uint240?: undefined;
238
- uint248?: undefined;
239
- }, primaryType extends "EIP712Domain" | keyof typedData = keyof typedData>(typedDataDefinition: TypedDataDefinition<typedData, primaryType>) => Promise<Hex>;
34
+ signTypedData: <const typedData extends TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(typedDataDefinition: TypedDataDefinition<typedData, primaryType>) => Promise<Hex>;
240
35
  };
@@ -1,6 +1,6 @@
1
- import { hashMessage, hashTypedData, concatHex, concat, } from "viem";
1
+ import { concat, concatHex, hashMessage, hashTypedData, } from "viem";
2
2
  import { getDefaultSingleSignerValidationModuleAddress, SignatureType, } from "../utils.js";
3
- import { packUOSignature, pack1271Signature } from "../../utils.js";
3
+ import { pack1271Signature, packUOSignature } from "../../utils.js";
4
4
  /**
5
5
  * Creates an object with methods for generating a dummy signature, signing user operation hashes, signing messages, and signing typed data.
6
6
  *
@@ -73,8 +73,11 @@ export const singleSignerMessageSigner = (signer, chain, accountAddress, entityI
73
73
  // we don't apply the expected 1271 packing since deferred sigs use typed data sigs and don't expect the 1271 packing
74
74
  signTypedData: async (typedDataDefinition) => {
75
75
  // the accounts domain already gives replay protection across accounts for deferred actions, so we don't need to apply another wrapping
76
- const isDeferredAction = typedDataDefinition?.primaryType === "DeferredAction" &&
77
- typedDataDefinition?.domain?.verifyingContract === accountAddress;
76
+ const isDeferredAction = typedDataDefinition.primaryType === "DeferredAction" &&
77
+ typedDataDefinition.domain != null &&
78
+ // @ts-expect-error the domain type I think changed in viem, so this is not working correctly (TODO: fix this)
79
+ "verifyingContract" in typedDataDefinition.domain &&
80
+ typedDataDefinition.domain.verifyingContract === accountAddress;
78
81
  const validationSignature = await signer.signTypedData({
79
82
  domain: {
80
83
  chainId: Number(chain.id),
@@ -1 +1 @@
1
- {"version":3,"file":"signer.js","sourceRoot":"","sources":["../../../../../../src/ma-v2/modules/single-signer-validation/signer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,aAAa,EACb,SAAS,EAOT,MAAM,GACP,MAAM,MAAM,CAAC;AACd,OAAO,EACL,6CAA6C,EAC7C,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACpE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,MAA0B,EAC1B,KAAY,EACZ,cAAuB,EACvB,QAAgB,EAChB,kBAAwB,EACxB,EAAE;IACF,OAAO;QACL,iBAAiB,EAAE,GAAQ,EAAE;YAC3B,MAAM,GAAG,GAAG,eAAe,CAAC;gBAC1B,uBAAuB;gBACvB,mBAAmB,EACjB,sIAAsI;aACzI,CAAC,CAAC;YAEH,OAAO,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QACzE,CAAC;QAED,qBAAqB,EAAE,KAAK,EAAE,MAAW,EAAgB,EAAE;YACzD,IAAI,GAAG,GAAG,MAAM,MAAM;iBACnB,WAAW,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;iBAC5B,IAAI,CAAC,CAAC,SAAc,EAAE,EAAE,CACvB,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N,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;oBACzB,iBAAiB,EACf,6CAA6C,CAAC,KAAK,CAAC;oBACtD,IAAI,EAAE,SAAS,CAAC,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;iBAC1D;gBACD,KAAK,EAAE;oBACL,cAAc,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;iBACpD;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE,aAAa,CAAC,mBAAmB,CAAC;iBACzC;gBACD,WAAW,EAAE,gBAAgB;aAC9B,CAAC,CAAC;YAEH,mCAAmC;YACnC,OAAO,gBAAgB;gBACrB,CAAC,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;gBAClD,CAAC,CAAC,iBAAiB,CAAC;oBAChB,mBAAmB;oBACnB,QAAQ;iBACT,CAAC,CAAC;QACT,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { SmartAccountSigner } from \"@aa-sdk/core\";\nimport {\n hashMessage,\n hashTypedData,\n concatHex,\n type Hex,\n type SignableMessage,\n type TypedData,\n type TypedDataDefinition,\n type Chain,\n type Address,\n concat,\n} from \"viem\";\nimport {\n getDefaultSingleSignerValidationModuleAddress,\n SignatureType,\n} from \"../utils.js\";\n\nimport { packUOSignature, pack1271Signature } from \"../../utils.js\";\n/**\n * Creates an object with methods for generating a dummy signature, signing user operation hashes, signing messages, and signing typed data.\n *\n * @example \n \n * ```ts\n * import { singleSignerMessageSigner } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n *\n * const MNEMONIC = \"...\":\n * \n * const account = createModularAccountV2({ config });\n *\n * const signer = LocalAccountSigner.mnemonicToAccountSigner(MNEMONIC);\n *\n * const messageSigner = singleSignerMessageSigner(signer, chain, account.address, account.signerEntity.entityId);\n * ```\n *\n * @param {SmartAccountSigner} signer Signer to use for signing operations\n * @param {Chain} chain Chain object for the signer\n * @param {Address} accountAddress address of the smart account using this signer\n * @param {number} entityId the entity id of the signing validation\n * @param {Hex} deferredActionData optional deferred action data to prepend to the uo signatures\n * @returns {object} an object with methods for signing operations and managing signatures\n */\nexport const singleSignerMessageSigner = (\n signer: SmartAccountSigner,\n chain: Chain,\n accountAddress: Address,\n entityId: number,\n deferredActionData?: Hex\n) => {\n return {\n getDummySignature: (): Hex => {\n const sig = packUOSignature({\n // orderedHookData: [],\n validationSignature:\n \"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c\",\n });\n\n return deferredActionData ? concatHex([deferredActionData, sig]) : sig;\n },\n\n signUserOperationHash: async (uoHash: Hex): Promise<Hex> => {\n let sig = await signer\n .signMessage({ raw: uoHash })\n .then((signature: Hex) =>\n packUOSignature({\n // orderedHookData: [],\n validationSignature: signature,\n })\n );\n\n if (deferredActionData) {\n sig = concatHex([deferredActionData, sig]);\n deferredActionData = undefined;\n }\n\n return sig;\n },\n\n // we apply the expected 1271 packing here since the account contract will expect it\n async signMessage({ message }: { message: SignableMessage }): Promise<Hex> {\n const hash = await hashMessage(message);\n\n return pack1271Signature({\n validationSignature: await signer.signTypedData({\n domain: {\n chainId: Number(chain.id),\n verifyingContract:\n getDefaultSingleSignerValidationModuleAddress(chain),\n salt: concatHex([`0x${\"00\".repeat(12)}`, accountAddress]),\n },\n types: {\n ReplaySafeHash: [{ name: \"hash\", type: \"bytes32\" }],\n },\n message: {\n hash,\n },\n primaryType: \"ReplaySafeHash\",\n }),\n entityId,\n });\n },\n\n // TODO: maybe move \"sign deferred actions\" to a separate function?\n // we don't apply the expected 1271 packing since deferred sigs use typed data sigs and don't expect the 1271 packing\n signTypedData: async <\n const typedData extends TypedData | Record<string, unknown>,\n primaryType extends keyof typedData | \"EIP712Domain\" = keyof typedData\n >(\n typedDataDefinition: TypedDataDefinition<typedData, primaryType>\n ): Promise<Hex> => {\n // the accounts domain already gives replay protection across accounts for deferred actions, so we don't need to apply another wrapping\n const isDeferredAction =\n typedDataDefinition?.primaryType === \"DeferredAction\" &&\n typedDataDefinition?.domain?.verifyingContract === accountAddress;\n\n const validationSignature = await signer.signTypedData({\n domain: {\n chainId: Number(chain.id),\n verifyingContract:\n getDefaultSingleSignerValidationModuleAddress(chain),\n salt: concatHex([`0x${\"00\".repeat(12)}`, accountAddress]),\n },\n types: {\n ReplaySafeHash: [{ name: \"hash\", type: \"bytes32\" }],\n },\n message: {\n hash: hashTypedData(typedDataDefinition),\n },\n primaryType: \"ReplaySafeHash\",\n });\n\n // TODO: Handle non-EOA signer case\n return isDeferredAction\n ? concat([SignatureType.EOA, validationSignature])\n : pack1271Signature({\n validationSignature,\n entityId,\n });\n },\n };\n};\n"]}
1
+ {"version":3,"file":"signer.js","sourceRoot":"","sources":["../../../../../../src/ma-v2/modules/single-signer-validation/signer.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,MAAM,EACN,SAAS,EACT,WAAW,EACX,aAAa,GAKd,MAAM,MAAM,CAAC;AACd,OAAO,EACL,6CAA6C,EAC7C,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACpE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,MAA0B,EAC1B,KAAY,EACZ,cAAuB,EACvB,QAAgB,EAChB,kBAAwB,EACxB,EAAE;IACF,OAAO;QACL,iBAAiB,EAAE,GAAQ,EAAE;YAC3B,MAAM,GAAG,GAAG,eAAe,CAAC;gBAC1B,uBAAuB;gBACvB,mBAAmB,EACjB,sIAAsI;aACzI,CAAC,CAAC;YAEH,OAAO,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC,CA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H;QACrH,aAAa,EAAE,KAAK,EAIlB,mBAAgE,EAClD,EAAE;YAChB,uIAAuI;YACvI,MAAM,gBAAgB,GACpB,mBAAmB,CAAC,WAAW,KAAK,gBAAgB;gBACpD,mBAAmB,CAAC,MAAM,IAAI,IAAI;gBAClC,8GAA8G;gBAC9G,mBAAmB,IAAI,mBAAmB,CAAC,MAAM;gBACjD,mBAAmB,CAAC,MAAM,CAAC,iBAAiB,KAAK,cAAc,CAAC;YAElE,MAAM,mBAAmB,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC;gBACrD,MAAM,EAAE;oBACN,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;oBACzB,iBAAiB,EACf,6CAA6C,CAAC,KAAK,CAAC;oBACtD,IAAI,EAAE,SAAS,CAAC,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;iBAC1D;gBACD,KAAK,EAAE;oBACL,cAAc,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;iBACpD;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE,aAAa,CAAC,mBAAmB,CAAC;iBACzC;gBACD,WAAW,EAAE,gBAAgB;aAC9B,CAAC,CAAC;YAEH,mCAAmC;YACnC,OAAO,gBAAgB;gBACrB,CAAC,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;gBAClD,CAAC,CAAC,iBAAiB,CAAC;oBAChB,mBAAmB;oBACnB,QAAQ;iBACT,CAAC,CAAC;QACT,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { SmartAccountSigner } from \"@aa-sdk/core\";\nimport {\n type Address,\n type Chain,\n concat,\n concatHex,\n hashMessage,\n hashTypedData,\n type Hex,\n type SignableMessage,\n type TypedData,\n type TypedDataDefinition,\n} from \"viem\";\nimport {\n getDefaultSingleSignerValidationModuleAddress,\n SignatureType,\n} from \"../utils.js\";\n\nimport { pack1271Signature, packUOSignature } from \"../../utils.js\";\n/**\n * Creates an object with methods for generating a dummy signature, signing user operation hashes, signing messages, and signing typed data.\n *\n * @example \n \n * ```ts\n * import { singleSignerMessageSigner } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n *\n * const MNEMONIC = \"...\":\n * \n * const account = createModularAccountV2({ config });\n *\n * const signer = LocalAccountSigner.mnemonicToAccountSigner(MNEMONIC);\n *\n * const messageSigner = singleSignerMessageSigner(signer, chain, account.address, account.signerEntity.entityId);\n * ```\n *\n * @param {SmartAccountSigner} signer Signer to use for signing operations\n * @param {Chain} chain Chain object for the signer\n * @param {Address} accountAddress address of the smart account using this signer\n * @param {number} entityId the entity id of the signing validation\n * @param {Hex} deferredActionData optional deferred action data to prepend to the uo signatures\n * @returns {object} an object with methods for signing operations and managing signatures\n */\nexport const singleSignerMessageSigner = (\n signer: SmartAccountSigner,\n chain: Chain,\n accountAddress: Address,\n entityId: number,\n deferredActionData?: Hex,\n) => {\n return {\n getDummySignature: (): Hex => {\n const sig = packUOSignature({\n // orderedHookData: [],\n validationSignature:\n \"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c\",\n });\n\n return deferredActionData ? concatHex([deferredActionData, sig]) : sig;\n },\n\n signUserOperationHash: async (uoHash: Hex): Promise<Hex> => {\n let sig = await signer\n .signMessage({ raw: uoHash })\n .then((signature: Hex) =>\n packUOSignature({\n // orderedHookData: [],\n validationSignature: signature,\n }),\n );\n\n if (deferredActionData) {\n sig = concatHex([deferredActionData, sig]);\n deferredActionData = undefined;\n }\n\n return sig;\n },\n\n // we apply the expected 1271 packing here since the account contract will expect it\n async signMessage({ message }: { message: SignableMessage }): Promise<Hex> {\n const hash = await hashMessage(message);\n\n return pack1271Signature({\n validationSignature: await signer.signTypedData({\n domain: {\n chainId: Number(chain.id),\n verifyingContract:\n getDefaultSingleSignerValidationModuleAddress(chain),\n salt: concatHex([`0x${\"00\".repeat(12)}`, accountAddress]),\n },\n types: {\n ReplaySafeHash: [{ name: \"hash\", type: \"bytes32\" }],\n },\n message: {\n hash,\n },\n primaryType: \"ReplaySafeHash\",\n }),\n entityId,\n });\n },\n\n // TODO: maybe move \"sign deferred actions\" to a separate function?\n // we don't apply the expected 1271 packing since deferred sigs use typed data sigs and don't expect the 1271 packing\n signTypedData: async <\n const typedData extends TypedData | Record<string, unknown>,\n primaryType extends keyof typedData | \"EIP712Domain\" = keyof typedData,\n >(\n typedDataDefinition: TypedDataDefinition<typedData, primaryType>,\n ): Promise<Hex> => {\n // the accounts domain already gives replay protection across accounts for deferred actions, so we don't need to apply another wrapping\n const isDeferredAction =\n typedDataDefinition.primaryType === \"DeferredAction\" &&\n typedDataDefinition.domain != null &&\n // @ts-expect-error the domain type I think changed in viem, so this is not working correctly (TODO: fix this)\n \"verifyingContract\" in typedDataDefinition.domain &&\n typedDataDefinition.domain.verifyingContract === accountAddress;\n\n const validationSignature = await signer.signTypedData({\n domain: {\n chainId: Number(chain.id),\n verifyingContract:\n getDefaultSingleSignerValidationModuleAddress(chain),\n salt: concatHex([`0x${\"00\".repeat(12)}`, accountAddress]),\n },\n types: {\n ReplaySafeHash: [{ name: \"hash\", type: \"bytes32\" }],\n },\n message: {\n hash: hashTypedData(typedDataDefinition),\n },\n primaryType: \"ReplaySafeHash\",\n });\n\n // TODO: Handle non-EOA signer case\n return isDeferredAction\n ? concat([SignatureType.EOA, validationSignature])\n : pack1271Signature({\n validationSignature,\n entityId,\n });\n },\n };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../../src/ma-v2/modules/time-range-module/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA0B,MAAM,MAAM,CAAC;AAEnE,OAAO,EAAE,kBAAkB,EAA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E;gBACE,IAAI,EAAE,QAAQ;aACf;SACF,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IACJ,CAAC;IACD,kBAAkB,EAAE,CAAC,IAIpB,EAAO,EAAE;QACR,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;QAElD,OAAO,mBAAmB,CACxB;YACE;gBACE,IAAI,EAAE,QAAQ;aACf;YACD;gBACE,IAAI,EAAE,QAAQ;aACf;YACD;gBACE,IAAI,EAAE,QAAQ;aACf;SACF,EACD,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,CAAC,CACnC,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import { encodeAbiParameters, type Address, type Hex } from \"viem\";\n\nimport { timeRangeModuleAbi } from \"./abis/timeRangeModuleAbi.js\";\nimport { HookType, type HookConfig } from \"../../actions/common/types.js\";\n\nexport const TimeRangeModule = {\n abi: timeRangeModuleAbi,\n buildHook: (\n installArgs: {\n entityId: number;\n validUntil: number;\n validAfter: number;\n },\n address: Address\n ): { hookConfig: HookConfig; initData: Hex } => {\n if (installArgs.validUntil > 2 ** 48 - 1) {\n throw new Error(\n \"TimeRangeModule.buildHook: validUntil > type(uint48).max\"\n );\n }\n\n if (installArgs.validAfter > 2 ** 48 - 1) {\n throw new Error(\n \"TimeRangeModule.buildHook: validAfter > type(uint48).max\"\n );\n }\n\n const installData = TimeRangeModule.encodeOnInstallData(installArgs);\n return {\n hookConfig: {\n address: address,\n entityId: installArgs.entityId,\n hookType: HookType.VALIDATION,\n hasPreHooks: false,\n hasPostHooks: false,\n },\n initData: installData,\n };\n },\n encodeOnInstallData: (args: {\n entityId: number;\n validUntil: number;\n validAfter: number;\n }): Hex => {\n const { entityId, validUntil, validAfter } = args;\n\n return encodeAbiParameters(\n [\n {\n type: \"uint32\",\n },\n {\n type: \"uint48\",\n },\n {\n type: \"uint48\",\n },\n ],\n [entityId, validUntil, validAfter]\n );\n },\n encodeOnUninstallData: (args: { entityId: number }): Hex => {\n const { entityId } = args;\n\n return encodeAbiParameters(\n [\n {\n type: \"uint32\",\n },\n ],\n [entityId]\n );\n },\n encodeSetTimeRange: (args: {\n entityId: number;\n validUntil: number;\n validAfter: number;\n }): Hex => {\n const { entityId, validUntil, validAfter } = args;\n\n return encodeAbiParameters(\n [\n {\n type: \"uint32\",\n },\n {\n type: \"uint48\",\n },\n {\n type: \"uint48\",\n },\n ],\n [entityId, validUntil, validAfter]\n );\n },\n};\n"]}
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../../src/ma-v2/modules/time-range-module/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA0B,MAAM,MAAM,CAAC;AAEnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAmB,MAAM,+BAA+B,CAAC;AAE1E,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,GAAG,EAAE,kBAAkB;IACvB,SAAS,EAAE,CACT,WAIC,EACD,OAAgB,EAC2B,EAAE;QAC7C,IAAI,WAAW,CAAC,UAAU,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;QACJ,CAAC;QAED,IAAI,WAAW,CAAC,UAAU,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;QACJ,CAAC;QAED,MAAM,WAAW,GAAG,eAAe,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;QACrE,OAAO;YACL,UAAU,EAAE;gBACV,OAAO,EAAE,OAAO;gBAChB,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,QAAQ,EAAE,QAAQ,CAAC,UAAU;gBAC7B,WAAW,EAAE,KAAK;gBAClB,YAAY,EAAE,KAAK;aACpB;YACD,QAAQ,EAAE,WAAW;SACtB,CAAC;IACJ,CAAC;IACD,mBAAmB,EAAE,CAAC,IAIrB,EAAO,EAAE;QACR,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;QAElD,OAAO,mBAAmB,CACxB;YACE;gBACE,IAAI,EAAE,QAAQ;aACf;YACD;gBACE,IAAI,EAAE,QAAQ;aACf;YACD;gBACE,IAAI,EAAE,QAAQ;aACf;SACF,EACD,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,CAAC,CACnC,CAAC;IACJ,CAAC;IACD,qBAAqB,EAAE,CAAC,IAA0B,EAAO,EAAE;QACzD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAE1B,OAAO,mBAAmB,CACxB;YACE;gBACE,IAAI,EAAE,QAAQ;aACf;SACF,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IACJ,CAAC;IACD,kBAAkB,EAAE,CAAC,IAIpB,EAAO,EAAE;QACR,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;QAElD,OAAO,mBAAmB,CACxB;YACE;gBACE,IAAI,EAAE,QAAQ;aACf;YACD;gBACE,IAAI,EAAE,QAAQ;aACf;YACD;gBACE,IAAI,EAAE,QAAQ;aACf;SACF,EACD,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,CAAC,CACnC,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import { encodeAbiParameters, type Address, type Hex } from \"viem\";\n\nimport { timeRangeModuleAbi } from \"./abis/timeRangeModuleAbi.js\";\nimport { HookType, type HookConfig } from \"../../actions/common/types.js\";\n\nexport const TimeRangeModule = {\n abi: timeRangeModuleAbi,\n buildHook: (\n installArgs: {\n entityId: number;\n validUntil: number;\n validAfter: number;\n },\n address: Address,\n ): { hookConfig: HookConfig; initData: Hex } => {\n if (installArgs.validUntil > 2 ** 48 - 1) {\n throw new Error(\n \"TimeRangeModule.buildHook: validUntil > type(uint48).max\",\n );\n }\n\n if (installArgs.validAfter > 2 ** 48 - 1) {\n throw new Error(\n \"TimeRangeModule.buildHook: validAfter > type(uint48).max\",\n );\n }\n\n const installData = TimeRangeModule.encodeOnInstallData(installArgs);\n return {\n hookConfig: {\n address: address,\n entityId: installArgs.entityId,\n hookType: HookType.VALIDATION,\n hasPreHooks: false,\n hasPostHooks: false,\n },\n initData: installData,\n };\n },\n encodeOnInstallData: (args: {\n entityId: number;\n validUntil: number;\n validAfter: number;\n }): Hex => {\n const { entityId, validUntil, validAfter } = args;\n\n return encodeAbiParameters(\n [\n {\n type: \"uint32\",\n },\n {\n type: \"uint48\",\n },\n {\n type: \"uint48\",\n },\n ],\n [entityId, validUntil, validAfter],\n );\n },\n encodeOnUninstallData: (args: { entityId: number }): Hex => {\n const { entityId } = args;\n\n return encodeAbiParameters(\n [\n {\n type: \"uint32\",\n },\n ],\n [entityId],\n );\n },\n encodeSetTimeRange: (args: {\n entityId: number;\n validUntil: number;\n validAfter: number;\n }): Hex => {\n const { entityId, validUntil, validAfter } = args;\n\n return encodeAbiParameters(\n [\n {\n type: \"uint32\",\n },\n {\n type: \"uint48\",\n },\n {\n type: \"uint48\",\n },\n ],\n [entityId, validUntil, validAfter],\n );\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/ma-v2/modules/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,OAAO,GACR,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,6BAAY,CAAA;IACZ,kCAAiB,CAAA;AACnB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,CACvD,KAAY,EACH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AE,CAAC;QAChB,KAAK,WAAW,CAAC,EAAE,CAAC;QACpB,KAAK,QAAQ,CAAC,EAAE,CAAC;QACjB,KAAK,eAAe,CAAC,EAAE,CAAC;QACxB,KAAK,QAAQ,CAAC,EAAE,CAAC;QACjB,KAAK,eAAe,CAAC,EAAE,CAAC;QACxB,KAAK,IAAI,CAAC,EAAE,CAAC;QACb;YACE,OAAO,4CAA4C,CAAC;IACxD,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,KAAY,EAAW,EAAE;IACxE,QAAQ,KAAK,CAAC,EAAE,EAAE,CAAC;QACjB,wBAAwB;QACxB,KAAK,OAAO,CAAC,EAAE,CAAC;QAChB,KAAK,WAAW,CAAC,EAAE,CAAC;QACpB,KAAK,OAAO,CAAC,EAAE,CAAC;QAChB,KAAK,OAAO,CAAC,EAAE,CAAC;QAChB,KAAK,WAAW,CAAC,EAAE,CAAC;QACpB,KAAK,QAAQ,CAAC,EAAE,CAAC;QACjB,KAAK,eAAe,CAAC,EAAE,CAAC;QACxB,KAAK,QAAQ,CAAC,EAAE,CAAC;QACjB,KAAK,eAAe,CAAC,EAAE,CAAC;QACxB,KAAK,IAAI,CAAC,EAAE,CAAC;QACb;YACE,OAAO,4CAA4C,CAAC;IACxD,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { Chain, Address } from \"viem\";\nimport {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n mainnet,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n sepolia,\n} from \"@account-kit/infra\";\n\nexport enum SignatureType {\n EOA = \"0x00\",\n CONTRACT = \"0x01\",\n}\n\n/**\n * Maps a given chain to a specific address of the webauthn validation module by its chain ID. If no direct mapping exists, it defaults to returning a specific address.\n *\n * @example\n * ```ts\n * import { getDefaultWebauthnValidationModuleAddress } from \"@account-kit/smart-contracts\";\n * import { Chain, Address } from \"viem\";\n *\n * const chain: Chain = ...\n * const webauthnValidationAddress: Address = getDefaultWebauthnValidationModuleAddress(chain);\n * ```\n * @param {Chain} chain The chain object containing the chain ID to map\n * @returns {Address} The webauthn validation module address associated with the specified chain ID or a default address if no specific mapping exists\n */\nexport const getDefaultWebauthnValidationModuleAddress = (\n chain: Chain\n): Address => {\n switch (chain.id) {\n // TODO: case mekong.id:\n case sepolia.id:\n case baseSepolia.id:\n case polygon.id:\n case mainnet.id:\n case polygonAmoy.id:\n case optimism.id:\n case optimismSepolia.id:\n case arbitrum.id:\n case arbitrumSepolia.id:\n case base.id:\n default:\n return \"0x0000000000001D9d34E07D9834274dF9ae575217\";\n }\n};\n\n/**\n * Maps a given chain to a specific address of the time range module by its chain ID. If no direct mapping exists, it defaults to returning a specific address.\n *\n * @example\n * ```ts\n * import { getDefaultTimeRangeModuleAddress } from \"@account-kit/smart-contracts\";\n * import { Chain, Address } from \"viem\";\n *\n * const chain: Chain = ...\n * const timeRangeModuleAddress: Address = getDefaultTimeRangeModuleAddress(chain);\n * ```\n * @param {Chain} chain The chain object containing the chain ID to map\n * @returns {Address} The time range module address associated with the specified chain ID or a default address if no specific mapping exists\n */\nexport const getDefaultTimeRangeModuleAddress = (chain: Chain): Address => {\n switch (chain.id) {\n // TODO: case mekong.id:\n case sepolia.id:\n case baseSepolia.id:\n case polygon.id:\n case mainnet.id:\n case polygonAmoy.id:\n case optimism.id:\n case optimismSepolia.id:\n case arbitrum.id:\n case arbitrumSepolia.id:\n case base.id:\n default:\n return \"0x00000000000082B8e2012be914dFA4f62A0573eA\";\n }\n};\n\n/**\n * Maps a given chain to a specific address of the single signer validation module by its chain ID. If no direct mapping exists, it defaults to returning a specific address.\n *\n * @example\n * ```ts\n * import { getDefaultSingleSignerValidationModuleAddress } from \"@account-kit/smart-contracts\";\n * import { Chain, Address } from \"viem\";\n *\n * const chain: Chain = ...\n * const singleSignerValidationAddress: Address = getDefaultSingleSignerValidationModuleAddress(chain);\n * ```\n * @param {Chain} chain The chain object containing the chain ID to map\n * @returns {Address} The single signer validation module address associated with the specified chain ID or a default address if no specific mapping exists\n */\nexport const getDefaultSingleSignerValidationModuleAddress = (\n chain: Chain\n): Address => {\n switch (chain.id) {\n // TODO: case mekong.id:\n case sepolia.id:\n case baseSepolia.id:\n case polygon.id:\n case mainnet.id:\n case polygonAmoy.id:\n case optimism.id:\n case optimismSepolia.id:\n case arbitrum.id:\n case arbitrumSepolia.id:\n case base.id:\n default:\n return \"0x00000000000099DE0BF6fA90dEB851E2A2df7d83\";\n }\n};\n\n/**\n * Maps a given chain to a specific address of the paymaster guard module by its chain ID. If no direct mapping exists, it defaults to returning a specific address.\n *\n * @example\n * ```ts\n * import { getDefaultPaymasterGuardModuleAddress } from \"@account-kit/smart-contracts\";\n * import { Chain, Address } from \"viem\";\n *\n * const chain: Chain = ...\n * const paymasterGuardAddress: Address = getDefaultPaymasterGuardModuleAddress(chain);\n * ```\n * @param {Chain} chain The chain object containing the chain ID to map\n * @returns {Address} The paymaster guard module address associated with the specified chain ID or a default address if no specific mapping exists\n */\nexport const getDefaultPaymasterGuardModuleAddress = (\n chain: Chain\n): Address => {\n switch (chain.id) {\n // TODO: case mekong.id:\n case sepolia.id:\n case baseSepolia.id:\n case polygon.id:\n case mainnet.id:\n case polygonAmoy.id:\n case optimism.id:\n case optimismSepolia.id:\n case arbitrum.id:\n case arbitrumSepolia.id:\n case base.id:\n default:\n return \"0x0000000000001aA7A7F7E29abe0be06c72FD42A1\";\n }\n};\n\n/**\n * Maps a given chain to a specific address of the native token limit module by its chain ID. If no direct mapping exists, it defaults to returning a specific address.\n *\n * @example\n * ```ts\n * import { getDefaultNativeTokenLimitModuleAddress } from \"@account-kit/smart-contracts\";\n * import { Chain, Address } from \"viem\";\n *\n * const chain: Chain = ...\n * const nativeTokenLimitAddress: Address = getDefaultNativeTokenLimitModuleAddress(chain);\n * ```\n * @param {Chain} chain The chain object containing the chain ID to map\n * @returns {Address} The native token limit module address associated with the specified chain ID or a default address if no specific mapping exists\n */\nexport const getDefaultNativeTokenLimitModuleAddress = (\n chain: Chain\n): Address => {\n switch (chain.id) {\n // TODO: case mekong.id:\n case sepolia.id:\n case baseSepolia.id:\n case polygon.id:\n case mainnet.id:\n case polygonAmoy.id:\n case optimism.id:\n case optimismSepolia.id:\n case arbitrum.id:\n case arbitrumSepolia.id:\n case base.id:\n default:\n return \"0x00000000000001e541f0D090868FBe24b59Fbe06\";\n }\n};\n\n/**\n * Maps a given chain to a specific address of the allowlist module by its chain ID. If no direct mapping exists, it defaults to returning a specific address.\n *\n * @example\n * ```ts\n * import { getDefaultAllowlistModuleAddress } from \"@account-kit/smart-contracts\";\n * import { Chain, Address } from \"viem\";\n *\n * const chain: Chain = ...\n * const allowlistModule: Address = getDefaultAllowlistModuleAddress(chain);\n * ```\n * @param {Chain} chain The chain object containing the chain ID to map\n * @returns {Address} The allowlist module address associated with the specified chain ID or a default address if no specific mapping exists\n */\nexport const getDefaultAllowlistModuleAddress = (chain: Chain): Address => {\n switch (chain.id) {\n // TODO: case mekong.id:\n case sepolia.id:\n case baseSepolia.id:\n case polygon.id:\n case mainnet.id:\n case polygonAmoy.id:\n case optimism.id:\n case optimismSepolia.id:\n case arbitrum.id:\n case arbitrumSepolia.id:\n case base.id:\n default:\n return \"0x00000000003e826473a313e600b5b9b791f5a59a\";\n }\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/ma-v2/modules/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,OAAO,GACR,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,6BAAY,CAAA;IACZ,kCAAiB,CAAA;AACnB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,M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E,CAAC;QAChB,KAAK,OAAO,CAAC,EAAE,CAAC;QAChB,KAAK,WAAW,CAAC,EAAE,CAAC;QACpB,KAAK,QAAQ,CAAC,EAAE,CAAC;QACjB,KAAK,eAAe,CAAC,EAAE,CAAC;QACxB,KAAK,QAAQ,CAAC,EAAE,CAAC;QACjB,KAAK,eAAe,CAAC,EAAE,CAAC;QACxB,KAAK,IAAI,CAAC,EAAE,CAAC;QACb;YACE,OAAO,4CAA4C,CAAC;IACxD,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,KAAY,EAAW,EAAE;IACxE,QAAQ,KAAK,CAAC,EAAE,EAAE,CAAC;QACjB,wBAAwB;QACxB,KAAK,OAAO,CAAC,EAAE,CAAC;QAChB,KAAK,WAAW,CAAC,EAAE,CAAC;QACpB,KAAK,OAAO,CAAC,EAAE,CAAC;QAChB,KAAK,OAAO,CAAC,EAAE,CAAC;QAChB,KAAK,WAAW,CAAC,EAAE,CAAC;QACpB,KAAK,QAAQ,CAAC,EAAE,CAAC;QACjB,KAAK,eAAe,CAAC,EAAE,CAAC;QACxB,KAAK,QAAQ,CAAC,EAAE,CAAC;QACjB,KAAK,eAAe,CAAC,EAAE,CAAC;QACxB,KAAK,IAAI,CAAC,EAAE,CAAC;QACb;YACE,OAAO,4CAA4C,CAAC;IACxD,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { Chain, Address } from \"viem\";\nimport {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n mainnet,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n sepolia,\n} from \"@account-kit/infra\";\n\nexport enum SignatureType {\n EOA = \"0x00\",\n CONTRACT = \"0x01\",\n}\n\n/**\n * Maps a given chain to a specific address of the webauthn validation module by its chain ID. If no direct mapping exists, it defaults to returning a specific address.\n *\n * @example\n * ```ts\n * import { getDefaultWebauthnValidationModuleAddress } from \"@account-kit/smart-contracts\";\n * import { Chain, Address } from \"viem\";\n *\n * const chain: Chain = ...\n * const webauthnValidationAddress: Address = getDefaultWebauthnValidationModuleAddress(chain);\n * ```\n * @param {Chain} chain The chain object containing the chain ID to map\n * @returns {Address} The webauthn validation module address associated with the specified chain ID or a default address if no specific mapping exists\n */\nexport const getDefaultWebauthnValidationModuleAddress = (\n chain: Chain,\n): Address => {\n switch (chain.id) {\n // TODO: case mekong.id:\n case sepolia.id:\n case baseSepolia.id:\n case polygon.id:\n case mainnet.id:\n case polygonAmoy.id:\n case optimism.id:\n case optimismSepolia.id:\n case arbitrum.id:\n case arbitrumSepolia.id:\n case base.id:\n default:\n return \"0x0000000000001D9d34E07D9834274dF9ae575217\";\n }\n};\n\n/**\n * Maps a given chain to a specific address of the time range module by its chain ID. If no direct mapping exists, it defaults to returning a specific address.\n *\n * @example\n * ```ts\n * import { getDefaultTimeRangeModuleAddress } from \"@account-kit/smart-contracts\";\n * import { Chain, Address } from \"viem\";\n *\n * const chain: Chain = ...\n * const timeRangeModuleAddress: Address = getDefaultTimeRangeModuleAddress(chain);\n * ```\n * @param {Chain} chain The chain object containing the chain ID to map\n * @returns {Address} The time range module address associated with the specified chain ID or a default address if no specific mapping exists\n */\nexport const getDefaultTimeRangeModuleAddress = (chain: Chain): Address => {\n switch (chain.id) {\n // TODO: case mekong.id:\n case sepolia.id:\n case baseSepolia.id:\n case polygon.id:\n case mainnet.id:\n case polygonAmoy.id:\n case optimism.id:\n case optimismSepolia.id:\n case arbitrum.id:\n case arbitrumSepolia.id:\n case base.id:\n default:\n return \"0x00000000000082B8e2012be914dFA4f62A0573eA\";\n }\n};\n\n/**\n * Maps a given chain to a specific address of the single signer validation module by its chain ID. If no direct mapping exists, it defaults to returning a specific address.\n *\n * @example\n * ```ts\n * import { getDefaultSingleSignerValidationModuleAddress } from \"@account-kit/smart-contracts\";\n * import { Chain, Address } from \"viem\";\n *\n * const chain: Chain = ...\n * const singleSignerValidationAddress: Address = getDefaultSingleSignerValidationModuleAddress(chain);\n * ```\n * @param {Chain} chain The chain object containing the chain ID to map\n * @returns {Address} The single signer validation module address associated with the specified chain ID or a default address if no specific mapping exists\n */\nexport const getDefaultSingleSignerValidationModuleAddress = (\n chain: Chain,\n): Address => {\n switch (chain.id) {\n // TODO: case mekong.id:\n case sepolia.id:\n case baseSepolia.id:\n case polygon.id:\n case mainnet.id:\n case polygonAmoy.id:\n case optimism.id:\n case optimismSepolia.id:\n case arbitrum.id:\n case arbitrumSepolia.id:\n case base.id:\n default:\n return \"0x00000000000099DE0BF6fA90dEB851E2A2df7d83\";\n }\n};\n\n/**\n * Maps a given chain to a specific address of the paymaster guard module by its chain ID. If no direct mapping exists, it defaults to returning a specific address.\n *\n * @example\n * ```ts\n * import { getDefaultPaymasterGuardModuleAddress } from \"@account-kit/smart-contracts\";\n * import { Chain, Address } from \"viem\";\n *\n * const chain: Chain = ...\n * const paymasterGuardAddress: Address = getDefaultPaymasterGuardModuleAddress(chain);\n * ```\n * @param {Chain} chain The chain object containing the chain ID to map\n * @returns {Address} The paymaster guard module address associated with the specified chain ID or a default address if no specific mapping exists\n */\nexport const getDefaultPaymasterGuardModuleAddress = (\n chain: Chain,\n): Address => {\n switch (chain.id) {\n // TODO: case mekong.id:\n case sepolia.id:\n case baseSepolia.id:\n case polygon.id:\n case mainnet.id:\n case polygonAmoy.id:\n case optimism.id:\n case optimismSepolia.id:\n case arbitrum.id:\n case arbitrumSepolia.id:\n case base.id:\n default:\n return \"0x0000000000001aA7A7F7E29abe0be06c72FD42A1\";\n }\n};\n\n/**\n * Maps a given chain to a specific address of the native token limit module by its chain ID. If no direct mapping exists, it defaults to returning a specific address.\n *\n * @example\n * ```ts\n * import { getDefaultNativeTokenLimitModuleAddress } from \"@account-kit/smart-contracts\";\n * import { Chain, Address } from \"viem\";\n *\n * const chain: Chain = ...\n * const nativeTokenLimitAddress: Address = getDefaultNativeTokenLimitModuleAddress(chain);\n * ```\n * @param {Chain} chain The chain object containing the chain ID to map\n * @returns {Address} The native token limit module address associated with the specified chain ID or a default address if no specific mapping exists\n */\nexport const getDefaultNativeTokenLimitModuleAddress = (\n chain: Chain,\n): Address => {\n switch (chain.id) {\n // TODO: case mekong.id:\n case sepolia.id:\n case baseSepolia.id:\n case polygon.id:\n case mainnet.id:\n case polygonAmoy.id:\n case optimism.id:\n case optimismSepolia.id:\n case arbitrum.id:\n case arbitrumSepolia.id:\n case base.id:\n default:\n return \"0x00000000000001e541f0D090868FBe24b59Fbe06\";\n }\n};\n\n/**\n * Maps a given chain to a specific address of the allowlist module by its chain ID. If no direct mapping exists, it defaults to returning a specific address.\n *\n * @example\n * ```ts\n * import { getDefaultAllowlistModuleAddress } from \"@account-kit/smart-contracts\";\n * import { Chain, Address } from \"viem\";\n *\n * const chain: Chain = ...\n * const allowlistModule: Address = getDefaultAllowlistModuleAddress(chain);\n * ```\n * @param {Chain} chain The chain object containing the chain ID to map\n * @returns {Address} The allowlist module address associated with the specified chain ID or a default address if no specific mapping exists\n */\nexport const getDefaultAllowlistModuleAddress = (chain: Chain): Address => {\n switch (chain.id) {\n // TODO: case mekong.id:\n case sepolia.id:\n case baseSepolia.id:\n case polygon.id:\n case mainnet.id:\n case polygonAmoy.id:\n case optimism.id:\n case optimismSepolia.id:\n case arbitrum.id:\n case arbitrumSepolia.id:\n case base.id:\n default:\n return \"0x00000000003e826473a313e600b5b9b791f5a59a\";\n }\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../../src/ma-v2/modules/webauthn-validation/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAY,MAAM,MAAM,CAAC;AAErD,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,mBAAmB,EAAE,CAAC,IAIrB,EAAO,EAAE;QACR,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC;QAChC,OAAO,mBAAmB,CACxB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAC9D,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CACjB,CAAC;IACJ,CAAC;IAED,qBAAqB,EAAE,CAAC,IAA0B,EAAO,EAAE;QACzD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAE1B,OAAO,mBAAmB,CACxB;YACE;gBACE,IAAI,EAAE,QAAQ;aACf;SACF,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import { encodeAbiParameters, type Hex } from \"viem\";\n\nexport const WebAuthnValidationModule = {\n encodeOnInstallData: (args: {\n entityId: number;\n x: bigint;\n y: bigint;\n }): Hex => {\n const { entityId, x, y } = args;\n return encodeAbiParameters(\n [{ type: \"uint32\" }, { type: \"uint256\" }, { type: \"uint256\" }],\n [entityId, x, y]\n );\n },\n\n encodeOnUninstallData: (args: { entityId: number }): Hex => {\n const { entityId } = args;\n\n return encodeAbiParameters(\n [\n {\n type: \"uint32\",\n },\n ],\n [entityId]\n );\n },\n};\n"]}
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../../src/ma-v2/modules/webauthn-validation/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAY,MAAM,MAAM,CAAC;AAErD,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,mBAAmB,EAAE,CAAC,IAIrB,EAAO,EAAE;QACR,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC;QAChC,OAAO,mBAAmB,CACxB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAC9D,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CACjB,CAAC;IACJ,CAAC;IAED,qBAAqB,EAAE,CAAC,IAA0B,EAAO,EAAE;QACzD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAE1B,OAAO,mBAAmB,CACxB;YACE;gBACE,IAAI,EAAE,QAAQ;aACf;SACF,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import { encodeAbiParameters, type Hex } from \"viem\";\n\nexport const WebAuthnValidationModule = {\n encodeOnInstallData: (args: {\n entityId: number;\n x: bigint;\n y: bigint;\n }): Hex => {\n const { entityId, x, y } = args;\n return encodeAbiParameters(\n [{ type: \"uint32\" }, { type: \"uint256\" }, { type: \"uint256\" }],\n [entityId, x, y],\n );\n },\n\n encodeOnUninstallData: (args: { entityId: number }): Hex => {\n const { entityId } = args;\n\n return encodeAbiParameters(\n [\n {\n type: \"uint32\",\n },\n ],\n [entityId],\n );\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"permissionBuilder.js","sourceRoot":"","sources":["../../../../src/ma-v2/permissionBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAA0B,MAAM,MAAM,CAAC;AAC7E,OAAO,EACL,QAAQ,GAGT,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,wBAAwB,GAEzB,MAAM,mDAAmD,CAAC;AAE3D,OAAO,EACL,eAAe,GAEhB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EACL,gCAAgC,EAChC,uCAAuC,EACvC,6CAA6C,EAC7C,gCAAgC,GACjC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EACL,2BAA2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AAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC9C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;gBACd,UAAU,EAAE,QAAQ,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,UAAU;gBAChE,QAAQ,EAAE,eAAe,CAAC,mBAAmB,CAC3C,QAAQ,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CACnD;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAED,MAAM,UAAU,WAAW,CAAC,MAAa;IACvC,MAAM,IAAI,8BAA8B,EAAE,CAAC;AAC7C,CAAC","sourcesContent":["import { maxUint48, toHex, zeroAddress, type Address, type Hex } from \"viem\";\nimport {\n HookType,\n type HookConfig,\n type ValidationConfig,\n} from \"./actions/common/types.js\";\nimport {\n installValidationActions,\n type InstallValidationParams,\n} from \"./actions/install-validation/installValidation.js\";\nimport type { ModularAccountV2Client } from \"./client/client.js\";\nimport {\n deferralActions,\n type DeferredActionTypedData,\n} from \"./actions/deferralActions.js\";\nimport { NativeTokenLimitModule } from \"./modules/native-token-limit-module/module.js\";\nimport {\n getDefaultAllowlistModuleAddress,\n getDefaultNativeTokenLimitModuleAddress,\n getDefaultSingleSignerValidationModuleAddress,\n getDefaultTimeRangeModuleAddress,\n} from \"./modules/utils.js\";\nimport { SingleSignerValidationModule } from \"./modules/single-signer-validation/module.js\";\nimport { AllowlistModule } from \"./modules/allowlist-module/module.js\";\nimport { TimeRangeModule } from \"./modules/time-range-module/module.js\";\nimport {\n AccountAddressAsTargetError,\n DeadlineOverLimitError,\n DuplicateTargetAddressError,\n ExpiredDeadlineError,\n MultipleGasLimitError,\n MultipleNativeTokenTransferError,\n NoFunctionsProvidedError,\n RootPermissionOnlyError,\n SelectorNotAllowed,\n UnsupportedPermissionTypeError,\n ValidationConfigUnsetError,\n ZeroAddressError,\n} from \"./permissionBuilderErrors.js\";\n\n// We use this to offset the ERC20 spend limit entityId\nconst HALF_UINT32 = 2147483647;\nconst ERC20_APPROVE_SELECTOR = \"0x095ea7b3\";\nconst ERC20_TRANSFER_SELECTOR = \"0xa9059cbb\";\nconst ACCOUNT_EXECUTE_SELECTOR = \"0xb61d27f6\";\nconst ACCOUNT_EXECUTEBATCH_SELECTOR = \"0x34fcd5be\";\n\nexport enum PermissionType {\n NATIVE_TOKEN_TRANSFER = \"native-token-transfer\",\n ERC20_TOKEN_TRANSFER = \"erc20-token-transfer\",\n // ERC721_TOKEN_TRANSFER = \"erc721-token-transfer\", //Unimplemented\n // ERC1155_TOKEN_TRANSFER = \"erc1155-token-transfer\", //Unimplemented\n GAS_LIMIT = \"gas-limit\",\n // CALL_LIMIT = \"call-limit\", //Unimplemented\n // RATE_LIMIT = \"rate-limit\", //Unimplemented\n CONTRACT_ACCESS = \"contract-access\",\n ACCOUNT_FUNCTIONS = \"account-functions\",\n FUNCTIONS_ON_ALL_CONTRACTS = \"functions-on-all-contracts\",\n FUNCTIONS_ON_CONTRACT = \"functions-on-contract\",\n ROOT = \"root\",\n}\n\nenum HookIdentifier {\n NATIVE_TOKEN_TRANSFER,\n ERC20_TOKEN_TRANSFER,\n GAS_LIMIT,\n PREVAL_ALLOWLIST, // aggregate of CONTRACT_ACCESS, ACCOUNT_FUNCTIONS, FUNCTIONS_ON_ALL_CONTRACTS, FUNCTIONS_ON_CONTRACT\n}\n\ntype PreExecutionHookConfig = {\n address: Address;\n entityId: number;\n hookType: HookType.EXECUTION;\n hasPreHooks: true;\n hasPostHooks: false;\n};\n\ntype PreValidationHookConfig = {\n address: Address;\n entityId: number;\n hookType: HookType.VALIDATION;\n hasPreHooks: true;\n hasPostHooks: false;\n};\n\ntype RawHooks = {\n [HookIdentifier.NATIVE_TOKEN_TRANSFER]:\n | {\n hookConfig: PreExecutionHookConfig;\n initData: {\n entityId: number;\n spendLimit: bigint;\n };\n }\n | undefined;\n [HookIdentifier.ERC20_TOKEN_TRANSFER]:\n | {\n hookConfig: PreExecutionHookConfig;\n initData: {\n entityId: number;\n inputs: Array<{\n target: Address;\n hasSelectorAllowlist: boolean;\n hasERC20SpendLimit: boolean;\n erc20SpendLimit: bigint;\n selectors: Array<Hex>;\n }>;\n };\n }\n | undefined;\n [HookIdentifier.GAS_LIMIT]:\n | {\n hookConfig: PreValidationHookConfig;\n initData: {\n entityId: number;\n spendLimit: bigint;\n };\n }\n | undefined;\n [HookIdentifier.PREVAL_ALLOWLIST]:\n | {\n hookConfig: PreValidationHookConfig;\n\n initData: {\n entityId: number;\n inputs: Array<{\n target: Address;\n hasSelectorAllowlist: boolean;\n hasERC20SpendLimit: boolean;\n erc20SpendLimit: bigint;\n selectors: Array<Hex>;\n }>;\n };\n }\n | undefined;\n};\n\ntype Key = {\n publicKey: Hex;\n type: \"secp256k1\" | \"contract\";\n};\n\nexport type Permission =\n | {\n // this permission allows transfer of native tokens from the account\n type: PermissionType.NATIVE_TOKEN_TRANSFER;\n data: {\n allowance: Hex;\n };\n }\n | {\n // this permission allows transfer or approval of erc20 tokens from the account\n type: PermissionType.ERC20_TOKEN_TRANSFER;\n data: {\n address: Address; // erc20 token contract address\n allowance: Hex;\n };\n }\n | {\n // this permissions allows the key to spend gas for UOs\n type: PermissionType.GAS_LIMIT;\n data: {\n limit: Hex;\n };\n }\n | {\n // this permission grants access to all functions in a contract\n type: PermissionType.CONTRACT_ACCESS;\n data: {\n address: Address;\n };\n }\n | {\n // this permission grants access to functions in the account\n type: PermissionType.ACCOUNT_FUNCTIONS;\n data: {\n functions: Hex[]; // function signatures\n };\n }\n | {\n // this permission grants access to a function selector in any address or contract\n type: PermissionType.FUNCTIONS_ON_ALL_CONTRACTS;\n data: {\n functions: Hex[]; // function signatures\n };\n }\n | {\n // this permission grants access to specified functions on a specific contract\n type: PermissionType.FUNCTIONS_ON_CONTRACT;\n data: {\n address: Address;\n functions: Hex[];\n };\n }\n | {\n // this permission grants full access to everything\n type: PermissionType.ROOT;\n data?: never;\n };\n\ntype Hook = {\n hookConfig: HookConfig;\n initData: Hex;\n};\n\nexport class PermissionBuilder {\n private client: ModularAccountV2Client;\n private validationConfig: ValidationConfig = {\n moduleAddress: zeroAddress,\n entityId: 0, // uint32\n isGlobal: false,\n isSignatureValidation: false,\n isUserOpValidation: false,\n };\n private selectors: Hex[] = [];\n private installData: Hex = \"0x\";\n private permissions: Permission[] = [];\n private hooks: Hook[] = [];\n private nonce: bigint = 0n;\n private hasAssociatedExecHooks: boolean = false;\n private deadline: number = 0;\n\n constructor({\n client,\n key,\n entityId,\n nonce,\n selectors,\n hooks,\n deadline,\n }: {\n client: ModularAccountV2Client;\n key: Key;\n entityId: number;\n nonce: bigint;\n selectors?: Hex[];\n hooks?: Hook[];\n deadline?: number;\n }) {\n this.client = client;\n this.validationConfig = {\n moduleAddress: getDefaultSingleSignerValidationModuleAddress(\n this.client.chain\n ),\n entityId,\n isUserOpValidation: true,\n isGlobal: false,\n isSignatureValidation: false,\n };\n this.installData = SingleSignerValidationModule.encodeOnInstallData({\n entityId: entityId,\n signer: key.publicKey,\n });\n this.nonce = nonce;\n if (selectors) this.selectors = selectors;\n if (hooks) this.hooks = hooks;\n if (deadline) this.deadline = deadline;\n }\n\n addSelector({ selector }: { selector: Hex }): this {\n this.selectors.push(selector);\n return this;\n }\n\n addPermission({ permission }: { permission: Permission }): this {\n // Check 1: If we're adding root, we can't have any other permissions\n if (permission.type === PermissionType.ROOT) {\n if (this.permissions.length !== 0) {\n throw new RootPermissionOnlyError(permission);\n }\n this.permissions.push(permission);\n // Set isGlobal to true\n this.validationConfig.isGlobal = true;\n return this;\n }\n\n // Check 2: If the permission is NOT ROOT (guaranteed), ensure there is no ROOT permission set\n // Will resolve to undefined if ROOT is not found\n // NOTE: Technically this could be replaced by checking permissions[0] since it should not be possible\n // to have >1 permission with root among them\n if (this.permissions.find((p) => p.type === PermissionType.ROOT)) {\n throw new RootPermissionOnlyError(permission);\n }\n\n // Check 3: If the permission is either CONTRACT_ACCESS or FUNCTIONS_ON_CONTRACT, ensure it doesn't collide with another like it.\n if (\n permission.type === PermissionType.CONTRACT_ACCESS ||\n permission.type === PermissionType.FUNCTIONS_ON_CONTRACT\n ) {\n // Check 3.1: address must not be the account address, or the user should use the ACCOUNT_FUNCTIONS permission\n if (permission.data.address === this.client.account.address) {\n throw new AccountAddressAsTargetError(permission);\n }\n\n // Check 3.2: there must not be an existing permission with this address as a target\n const targetAddress = permission.data.address;\n const existingPermissionWithSameAddress = this.permissions.find(\n (p) =>\n (p.type === PermissionType.CONTRACT_ACCESS &&\n \"address\" in p.data &&\n p.data.address === targetAddress) ||\n (p.type === PermissionType.FUNCTIONS_ON_CONTRACT &&\n \"address\" in p.data &&\n p.data.address === targetAddress)\n );\n\n if (existingPermissionWithSameAddress) {\n throw new DuplicateTargetAddressError(permission, targetAddress);\n }\n }\n\n // Check 4: If the permission is ACCOUNT_FUNCTIONS, add selectors\n if (permission.type === PermissionType.ACCOUNT_FUNCTIONS) {\n if (permission.data.functions.length === 0) {\n throw new NoFunctionsProvidedError(permission);\n }\n // Explicitly disallow adding execute & executeBatch\n if (permission.data.functions.includes(ACCOUNT_EXECUTE_SELECTOR)) {\n throw new SelectorNotAllowed(\"execute\");\n } else if (\n permission.data.functions.includes(ACCOUNT_EXECUTEBATCH_SELECTOR)\n ) {\n throw new SelectorNotAllowed(\"executeBatch\");\n }\n this.selectors = [...this.selectors, ...permission.data.functions];\n }\n\n this.permissions.push(permission);\n return this;\n }\n\n addPermissions({ permissions }: { permissions: Permission[] }): this {\n // We could validate each permission here, but for simplicity we'll just add them\n // A better approach would be to call addPermission for each one\n permissions.forEach((permission) => {\n this.addPermission({ permission });\n });\n return this;\n }\n\n // Use for building deferred action typed data to sign\n async compileDeferred(): Promise<{\n typedData: DeferredActionTypedData;\n fullPreSignatureDeferredActionDigest: Hex;\n }> {\n // Add time range module hook via expiry\n if (this.deadline !== 0) {\n if (this.deadline < Date.now() / 1000) {\n throw new ExpiredDeadlineError(this.deadline, Date.now() / 1000);\n }\n if (this.deadline > maxUint48) {\n throw new DeadlineOverLimitError(this.deadline);\n }\n\n this.hooks.push(\n TimeRangeModule.buildHook(\n {\n entityId: this.validationConfig.entityId,\n validUntil: this.deadline,\n validAfter: 0,\n },\n getDefaultTimeRangeModuleAddress(this.client.chain)\n )\n );\n }\n\n const installValidationCall = await this.compileRaw();\n\n const { typedData } = await deferralActions(\n this.client\n ).createDeferredActionTypedDataObject({\n callData: installValidationCall,\n deadline: this.deadline,\n nonce: this.nonce,\n });\n\n const preSignatureDigest = deferralActions(\n this.client\n ).buildPreSignatureDeferredActionDigest({ typedData });\n\n // Encode additional information to build the full pre-signature digest\n const fullPreSignatureDeferredActionDigest: `0x${string}` = `0x0${\n this.hasAssociatedExecHooks ? \"1\" : \"0\"\n }${toHex(this.nonce, {\n size: 32,\n }).slice(2)}${preSignatureDigest.slice(2)}`;\n\n return {\n typedData,\n fullPreSignatureDeferredActionDigest,\n };\n }\n\n // Use for direct `installValidation()` low-level calls (maybe useless)\n async compileRaw(): Promise<Hex> {\n // Translate all permissions into raw hooks if >0\n if (this.permissions.length > 0) {\n const rawHooks = this.translatePermissions(\n this.validationConfig.entityId\n );\n // Add the translated permissions as hooks\n this.addHooks(rawHooks);\n }\n this.validateConfiguration();\n\n return await installValidationActions(this.client).encodeInstallValidation({\n validationConfig: this.validationConfig,\n selectors: this.selectors,\n installData: this.installData,\n hooks: this.hooks,\n account: this.client.account,\n });\n }\n\n // Use for compiling args to installValidation\n async compileInstallArgs(): Promise<InstallValidationParams> {\n this.validateConfiguration();\n\n return {\n validationConfig: this.validationConfig,\n selectors: this.selectors,\n installData: this.installData,\n hooks: this.hooks,\n account: this.client.account,\n };\n }\n\n private validateConfiguration(): void {\n if (\n this.validationConfig.isGlobal === false &&\n this.selectors.length === 0\n ) {\n throw new ValidationConfigUnsetError();\n }\n }\n\n // Used to translate consolidated permissions into raw unencoded hooks\n // Note entityId will be a member object later\n private translatePermissions(entityId: number): RawHooks {\n const rawHooks: RawHooks = {\n [HookIdentifier.NATIVE_TOKEN_TRANSFER]: undefined,\n [HookIdentifier.ERC20_TOKEN_TRANSFER]: undefined,\n [HookIdentifier.GAS_LIMIT]: undefined,\n [HookIdentifier.PREVAL_ALLOWLIST]: undefined,\n };\n\n this.permissions.forEach((permission) => {\n switch (permission.type) {\n case PermissionType.NATIVE_TOKEN_TRANSFER:\n // Should never be added twice, check is on addPermission(s) too\n if (rawHooks[HookIdentifier.NATIVE_TOKEN_TRANSFER] !== undefined) {\n throw new MultipleNativeTokenTransferError(permission);\n }\n rawHooks[HookIdentifier.NATIVE_TOKEN_TRANSFER] = {\n hookConfig: {\n address: getDefaultNativeTokenLimitModuleAddress(\n this.client.chain\n ),\n entityId,\n hookType: HookType.EXECUTION,\n hasPreHooks: true,\n hasPostHooks: false,\n },\n initData: {\n entityId,\n spendLimit: BigInt(permission.data.allowance),\n },\n };\n this.hasAssociatedExecHooks = true;\n break;\n case PermissionType.ERC20_TOKEN_TRANSFER:\n if (permission.data.address === zeroAddress) {\n throw new ZeroAddressError(permission);\n }\n rawHooks[HookIdentifier.ERC20_TOKEN_TRANSFER] = {\n hookConfig: {\n address: getDefaultAllowlistModuleAddress(this.client.chain),\n entityId: entityId + HALF_UINT32,\n hookType: HookType.EXECUTION,\n hasPreHooks: true,\n hasPostHooks: false,\n },\n initData: {\n entityId: entityId + HALF_UINT32,\n inputs: [\n // Add previous inputs if they exist\n ...(rawHooks[HookIdentifier.ERC20_TOKEN_TRANSFER]?.initData\n .inputs || []),\n {\n target: permission.data.address,\n hasSelectorAllowlist: false,\n hasERC20SpendLimit: true,\n erc20SpendLimit: BigInt(permission.data.allowance),\n selectors: [],\n },\n ],\n },\n };\n this.hasAssociatedExecHooks = true;\n // Also allow `approve` and `transfer` for the erc20\n rawHooks[HookIdentifier.PREVAL_ALLOWLIST] = {\n hookConfig: {\n address: getDefaultAllowlistModuleAddress(this.client.chain),\n entityId,\n hookType: HookType.VALIDATION,\n hasPreHooks: true,\n hasPostHooks: false,\n },\n initData: {\n entityId,\n inputs: [\n // Add previous inputs if they exist\n ...(rawHooks[HookIdentifier.PREVAL_ALLOWLIST]?.initData\n .inputs || []),\n {\n target: permission.data.address,\n hasSelectorAllowlist: true,\n hasERC20SpendLimit: false,\n erc20SpendLimit: 0n,\n selectors: [ERC20_APPROVE_SELECTOR, ERC20_TRANSFER_SELECTOR], // approve, transfer\n },\n ],\n },\n };\n break;\n case PermissionType.GAS_LIMIT:\n // Should only ever be added once, check is also on addPermission(s)\n if (rawHooks[HookIdentifier.GAS_LIMIT] !== undefined) {\n throw new MultipleGasLimitError(permission);\n }\n rawHooks[HookIdentifier.GAS_LIMIT] = {\n hookConfig: {\n address: getDefaultNativeTokenLimitModuleAddress(\n this.client.chain\n ),\n entityId,\n hookType: HookType.VALIDATION,\n hasPreHooks: true,\n hasPostHooks: false,\n },\n initData: {\n entityId,\n spendLimit: BigInt(permission.data.limit),\n },\n };\n break;\n case PermissionType.CONTRACT_ACCESS:\n if (permission.data.address === zeroAddress) {\n throw new ZeroAddressError(permission);\n }\n rawHooks[HookIdentifier.PREVAL_ALLOWLIST] = {\n hookConfig: {\n address: getDefaultAllowlistModuleAddress(this.client.chain),\n entityId,\n hookType: HookType.VALIDATION,\n hasPreHooks: true,\n hasPostHooks: false,\n },\n initData: {\n entityId,\n inputs: [\n // Add previous inputs if they exist\n ...(rawHooks[HookIdentifier.PREVAL_ALLOWLIST]?.initData\n .inputs || []),\n {\n target: permission.data.address,\n hasSelectorAllowlist: false,\n hasERC20SpendLimit: false,\n erc20SpendLimit: 0n,\n selectors: [],\n },\n ],\n },\n };\n break;\n case PermissionType.ACCOUNT_FUNCTIONS:\n // This is handled in add permissions\n break;\n case PermissionType.FUNCTIONS_ON_ALL_CONTRACTS:\n if (permission.data.functions.length === 0) {\n throw new NoFunctionsProvidedError(permission);\n }\n rawHooks[HookIdentifier.PREVAL_ALLOWLIST] = {\n hookConfig: {\n address: getDefaultAllowlistModuleAddress(this.client.chain),\n entityId,\n hookType: HookType.VALIDATION,\n hasPreHooks: true,\n hasPostHooks: false,\n },\n initData: {\n entityId,\n inputs: [\n // Add previous inputs if they exist\n ...(rawHooks[HookIdentifier.PREVAL_ALLOWLIST]?.initData\n .inputs || []),\n {\n target: zeroAddress,\n hasSelectorAllowlist: false,\n hasERC20SpendLimit: false,\n erc20SpendLimit: 0n,\n selectors: permission.data.functions,\n },\n ],\n },\n };\n break;\n case PermissionType.FUNCTIONS_ON_CONTRACT:\n if (permission.data.functions.length === 0) {\n throw new NoFunctionsProvidedError(permission);\n }\n if (permission.data.address === zeroAddress) {\n throw new ZeroAddressError(permission);\n }\n rawHooks[HookIdentifier.PREVAL_ALLOWLIST] = {\n hookConfig: {\n address: getDefaultAllowlistModuleAddress(this.client.chain),\n entityId,\n hookType: HookType.VALIDATION,\n hasPreHooks: true,\n hasPostHooks: false,\n },\n initData: {\n entityId,\n inputs: [\n // Add previous inputs if they exist\n ...(rawHooks[HookIdentifier.PREVAL_ALLOWLIST]?.initData\n .inputs || []),\n {\n target: permission.data.address,\n hasSelectorAllowlist: true,\n hasERC20SpendLimit: false,\n erc20SpendLimit: 0n,\n selectors: permission.data.functions,\n },\n ],\n },\n };\n break;\n case PermissionType.ROOT:\n // Root permission handled in addPermission\n break;\n default:\n assertNever(permission);\n }\n\n // isGlobal guaranteed to be false since it's only set with root permissions,\n // we must add access to execute & executeBatch if there's a preVal allowlist hook set.\n if (rawHooks[HookIdentifier.PREVAL_ALLOWLIST] !== undefined) {\n const selectorsToAdd: `0x${string}`[] = [\n ACCOUNT_EXECUTE_SELECTOR,\n ACCOUNT_EXECUTEBATCH_SELECTOR,\n ]; // execute, executeBatch\n\n // Only add the selectors if they aren't already in this.selectors\n const newSelectors = selectorsToAdd.filter(\n (selector) => !this.selectors.includes(selector)\n );\n\n this.selectors = [...this.selectors, ...newSelectors];\n }\n });\n\n return rawHooks;\n }\n\n private addHooks(rawHooks: RawHooks) {\n if (rawHooks[HookIdentifier.NATIVE_TOKEN_TRANSFER]) {\n this.hooks.push({\n hookConfig: rawHooks[HookIdentifier.NATIVE_TOKEN_TRANSFER].hookConfig,\n initData: NativeTokenLimitModule.encodeOnInstallData(\n rawHooks[HookIdentifier.NATIVE_TOKEN_TRANSFER].initData\n ),\n });\n }\n\n if (rawHooks[HookIdentifier.ERC20_TOKEN_TRANSFER]) {\n this.hooks.push({\n hookConfig: rawHooks[HookIdentifier.ERC20_TOKEN_TRANSFER].hookConfig,\n initData: AllowlistModule.encodeOnInstallData(\n rawHooks[HookIdentifier.ERC20_TOKEN_TRANSFER].initData\n ),\n });\n }\n\n if (rawHooks[HookIdentifier.GAS_LIMIT]) {\n this.hooks.push({\n hookConfig: rawHooks[HookIdentifier.GAS_LIMIT].hookConfig,\n initData: NativeTokenLimitModule.encodeOnInstallData(\n rawHooks[HookIdentifier.GAS_LIMIT].initData\n ),\n });\n }\n\n if (rawHooks[HookIdentifier.PREVAL_ALLOWLIST]) {\n this.hooks.push({\n hookConfig: rawHooks[HookIdentifier.PREVAL_ALLOWLIST].hookConfig,\n initData: AllowlistModule.encodeOnInstallData(\n rawHooks[HookIdentifier.PREVAL_ALLOWLIST].initData\n ),\n });\n }\n }\n}\n\nexport function assertNever(_valid: never): never {\n throw new UnsupportedPermissionTypeError();\n}\n"]}
1
+ {"version":3,"file":"permissionBuilder.js","sourceRoot":"","sources":["../../../../src/ma-v2/permissionBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAA0B,MAAM,MAAM,CAAC;AAC7E,OAAO,EACL,QAAQ,GAGT,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,wBAAwB,GAEzB,MAAM,mDAAmD,CAAC;AAE3D,OAAO,EACL,eAAe,GAEhB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EACL,gCAAgC,EAChC,uCAAuC,EACvC,6CAA6C,EAC7C,gCAAgC,GACjC,MAAM,oBAAoB,CAAC;AAC5B,O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AAC,CAAC,UAAU;gBACzD,QAAQ,EAAE,sBAAsB,CAAC,mBAAmB,CAClD,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,QAAQ,CAC5C;aACF,CAAC,CAAC;QACL,CAAC;QAED,IAAI,QAAQ,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC9C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;gBACd,UAAU,EAAE,QAAQ,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,UAAU;gBAChE,QAAQ,EAAE,eAAe,CAAC,mBAAmB,CAC3C,QAAQ,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CACnD;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAED,MAAM,UAAU,WAAW,CAAC,MAAa;IACvC,MAAM,IAAI,8BAA8B,EAAE,CAAC;AAC7C,CAAC","sourcesContent":["import { maxUint48, toHex, zeroAddress, type Address, type Hex } from \"viem\";\nimport {\n HookType,\n type HookConfig,\n type ValidationConfig,\n} from \"./actions/common/types.js\";\nimport {\n installValidationActions,\n type InstallValidationParams,\n} from \"./actions/install-validation/installValidation.js\";\nimport type { ModularAccountV2Client } from \"./client/client.js\";\nimport {\n deferralActions,\n type DeferredActionTypedData,\n} from \"./actions/deferralActions.js\";\nimport { NativeTokenLimitModule } from \"./modules/native-token-limit-module/module.js\";\nimport {\n getDefaultAllowlistModuleAddress,\n getDefaultNativeTokenLimitModuleAddress,\n getDefaultSingleSignerValidationModuleAddress,\n getDefaultTimeRangeModuleAddress,\n} from \"./modules/utils.js\";\nimport { SingleSignerValidationModule } from \"./modules/single-signer-validation/module.js\";\nimport { AllowlistModule } from \"./modules/allowlist-module/module.js\";\nimport { TimeRangeModule } from \"./modules/time-range-module/module.js\";\nimport {\n AccountAddressAsTargetError,\n DeadlineOverLimitError,\n DuplicateTargetAddressError,\n ExpiredDeadlineError,\n MultipleGasLimitError,\n MultipleNativeTokenTransferError,\n NoFunctionsProvidedError,\n RootPermissionOnlyError,\n SelectorNotAllowed,\n UnsupportedPermissionTypeError,\n ValidationConfigUnsetError,\n ZeroAddressError,\n} from \"./permissionBuilderErrors.js\";\n\n// We use this to offset the ERC20 spend limit entityId\nconst HALF_UINT32 = 2147483647;\nconst ERC20_APPROVE_SELECTOR = \"0x095ea7b3\";\nconst ERC20_TRANSFER_SELECTOR = \"0xa9059cbb\";\nconst ACCOUNT_EXECUTE_SELECTOR = \"0xb61d27f6\";\nconst ACCOUNT_EXECUTEBATCH_SELECTOR = \"0x34fcd5be\";\n\nexport enum PermissionType {\n NATIVE_TOKEN_TRANSFER = \"native-token-transfer\",\n ERC20_TOKEN_TRANSFER = \"erc20-token-transfer\",\n // ERC721_TOKEN_TRANSFER = \"erc721-token-transfer\", //Unimplemented\n // ERC1155_TOKEN_TRANSFER = \"erc1155-token-transfer\", //Unimplemented\n GAS_LIMIT = \"gas-limit\",\n // CALL_LIMIT = \"call-limit\", //Unimplemented\n // RATE_LIMIT = \"rate-limit\", //Unimplemented\n CONTRACT_ACCESS = \"contract-access\",\n ACCOUNT_FUNCTIONS = \"account-functions\",\n FUNCTIONS_ON_ALL_CONTRACTS = \"functions-on-all-contracts\",\n FUNCTIONS_ON_CONTRACT = \"functions-on-contract\",\n ROOT = \"root\",\n}\n\nenum HookIdentifier {\n NATIVE_TOKEN_TRANSFER,\n ERC20_TOKEN_TRANSFER,\n GAS_LIMIT,\n PREVAL_ALLOWLIST, // aggregate of CONTRACT_ACCESS, ACCOUNT_FUNCTIONS, FUNCTIONS_ON_ALL_CONTRACTS, FUNCTIONS_ON_CONTRACT\n}\n\ntype PreExecutionHookConfig = {\n address: Address;\n entityId: number;\n hookType: HookType.EXECUTION;\n hasPreHooks: true;\n hasPostHooks: false;\n};\n\ntype PreValidationHookConfig = {\n address: Address;\n entityId: number;\n hookType: HookType.VALIDATION;\n hasPreHooks: true;\n hasPostHooks: false;\n};\n\ntype RawHooks = {\n [HookIdentifier.NATIVE_TOKEN_TRANSFER]:\n | {\n hookConfig: PreExecutionHookConfig;\n initData: {\n entityId: number;\n spendLimit: bigint;\n };\n }\n | undefined;\n [HookIdentifier.ERC20_TOKEN_TRANSFER]:\n | {\n hookConfig: PreExecutionHookConfig;\n initData: {\n entityId: number;\n inputs: Array<{\n target: Address;\n hasSelectorAllowlist: boolean;\n hasERC20SpendLimit: boolean;\n erc20SpendLimit: bigint;\n selectors: Array<Hex>;\n }>;\n };\n }\n | undefined;\n [HookIdentifier.GAS_LIMIT]:\n | {\n hookConfig: PreValidationHookConfig;\n initData: {\n entityId: number;\n spendLimit: bigint;\n };\n }\n | undefined;\n [HookIdentifier.PREVAL_ALLOWLIST]:\n | {\n hookConfig: PreValidationHookConfig;\n\n initData: {\n entityId: number;\n inputs: Array<{\n target: Address;\n hasSelectorAllowlist: boolean;\n hasERC20SpendLimit: boolean;\n erc20SpendLimit: bigint;\n selectors: Array<Hex>;\n }>;\n };\n }\n | undefined;\n};\n\ntype Key = {\n publicKey: Hex;\n type: \"secp256k1\" | \"contract\";\n};\n\nexport type Permission =\n | {\n // this permission allows transfer of native tokens from the account\n type: PermissionType.NATIVE_TOKEN_TRANSFER;\n data: {\n allowance: Hex;\n };\n }\n | {\n // this permission allows transfer or approval of erc20 tokens from the account\n type: PermissionType.ERC20_TOKEN_TRANSFER;\n data: {\n address: Address; // erc20 token contract address\n allowance: Hex;\n };\n }\n | {\n // this permissions allows the key to spend gas for UOs\n type: PermissionType.GAS_LIMIT;\n data: {\n limit: Hex;\n };\n }\n | {\n // this permission grants access to all functions in a contract\n type: PermissionType.CONTRACT_ACCESS;\n data: {\n address: Address;\n };\n }\n | {\n // this permission grants access to functions in the account\n type: PermissionType.ACCOUNT_FUNCTIONS;\n data: {\n functions: Hex[]; // function signatures\n };\n }\n | {\n // this permission grants access to a function selector in any address or contract\n type: PermissionType.FUNCTIONS_ON_ALL_CONTRACTS;\n data: {\n functions: Hex[]; // function signatures\n };\n }\n | {\n // this permission grants access to specified functions on a specific contract\n type: PermissionType.FUNCTIONS_ON_CONTRACT;\n data: {\n address: Address;\n functions: Hex[];\n };\n }\n | {\n // this permission grants full access to everything\n type: PermissionType.ROOT;\n data?: never;\n };\n\ntype Hook = {\n hookConfig: HookConfig;\n initData: Hex;\n};\n\nexport class PermissionBuilder {\n private client: ModularAccountV2Client;\n private validationConfig: ValidationConfig = {\n moduleAddress: zeroAddress,\n entityId: 0, // uint32\n isGlobal: false,\n isSignatureValidation: false,\n isUserOpValidation: false,\n };\n private selectors: Hex[] = [];\n private installData: Hex = \"0x\";\n private permissions: Permission[] = [];\n private hooks: Hook[] = [];\n private nonce: bigint = 0n;\n private hasAssociatedExecHooks: boolean = false;\n private deadline: number = 0;\n\n constructor({\n client,\n key,\n entityId,\n nonce,\n selectors,\n hooks,\n deadline,\n }: {\n client: ModularAccountV2Client;\n key: Key;\n entityId: number;\n nonce: bigint;\n selectors?: Hex[];\n hooks?: Hook[];\n deadline?: number;\n }) {\n this.client = client;\n this.validationConfig = {\n moduleAddress: getDefaultSingleSignerValidationModuleAddress(\n this.client.chain,\n ),\n entityId,\n isUserOpValidation: true,\n isGlobal: false,\n isSignatureValidation: false,\n };\n this.installData = SingleSignerValidationModule.encodeOnInstallData({\n entityId: entityId,\n signer: key.publicKey,\n });\n this.nonce = nonce;\n if (selectors) this.selectors = selectors;\n if (hooks) this.hooks = hooks;\n if (deadline) this.deadline = deadline;\n }\n\n addSelector({ selector }: { selector: Hex }): this {\n this.selectors.push(selector);\n return this;\n }\n\n addPermission({ permission }: { permission: Permission }): this {\n // Check 1: If we're adding root, we can't have any other permissions\n if (permission.type === PermissionType.ROOT) {\n if (this.permissions.length !== 0) {\n throw new RootPermissionOnlyError(permission);\n }\n this.permissions.push(permission);\n // Set isGlobal to true\n this.validationConfig.isGlobal = true;\n return this;\n }\n\n // Check 2: If the permission is NOT ROOT (guaranteed), ensure there is no ROOT permission set\n // Will resolve to undefined if ROOT is not found\n // NOTE: Technically this could be replaced by checking permissions[0] since it should not be possible\n // to have >1 permission with root among them\n if (this.permissions.find((p) => p.type === PermissionType.ROOT)) {\n throw new RootPermissionOnlyError(permission);\n }\n\n // Check 3: If the permission is either CONTRACT_ACCESS or FUNCTIONS_ON_CONTRACT, ensure it doesn't collide with another like it.\n if (\n permission.type === PermissionType.CONTRACT_ACCESS ||\n permission.type === PermissionType.FUNCTIONS_ON_CONTRACT\n ) {\n // Check 3.1: address must not be the account address, or the user should use the ACCOUNT_FUNCTIONS permission\n if (permission.data.address === this.client.account.address) {\n throw new AccountAddressAsTargetError(permission);\n }\n\n // Check 3.2: there must not be an existing permission with this address as a target\n const targetAddress = permission.data.address;\n const existingPermissionWithSameAddress = this.permissions.find(\n (p) =>\n (p.type === PermissionType.CONTRACT_ACCESS &&\n \"address\" in p.data &&\n p.data.address === targetAddress) ||\n (p.type === PermissionType.FUNCTIONS_ON_CONTRACT &&\n \"address\" in p.data &&\n p.data.address === targetAddress),\n );\n\n if (existingPermissionWithSameAddress) {\n throw new DuplicateTargetAddressError(permission, targetAddress);\n }\n }\n\n // Check 4: If the permission is ACCOUNT_FUNCTIONS, add selectors\n if (permission.type === PermissionType.ACCOUNT_FUNCTIONS) {\n if (permission.data.functions.length === 0) {\n throw new NoFunctionsProvidedError(permission);\n }\n // Explicitly disallow adding execute & executeBatch\n if (permission.data.functions.includes(ACCOUNT_EXECUTE_SELECTOR)) {\n throw new SelectorNotAllowed(\"execute\");\n } else if (\n permission.data.functions.includes(ACCOUNT_EXECUTEBATCH_SELECTOR)\n ) {\n throw new SelectorNotAllowed(\"executeBatch\");\n }\n this.selectors = [...this.selectors, ...permission.data.functions];\n }\n\n this.permissions.push(permission);\n return this;\n }\n\n addPermissions({ permissions }: { permissions: Permission[] }): this {\n // We could validate each permission here, but for simplicity we'll just add them\n // A better approach would be to call addPermission for each one\n permissions.forEach((permission) => {\n this.addPermission({ permission });\n });\n return this;\n }\n\n // Use for building deferred action typed data to sign\n async compileDeferred(): Promise<{\n typedData: DeferredActionTypedData;\n fullPreSignatureDeferredActionDigest: Hex;\n }> {\n // Add time range module hook via expiry\n if (this.deadline !== 0) {\n if (this.deadline < Date.now() / 1000) {\n throw new ExpiredDeadlineError(this.deadline, Date.now() / 1000);\n }\n if (this.deadline > maxUint48) {\n throw new DeadlineOverLimitError(this.deadline);\n }\n\n this.hooks.push(\n TimeRangeModule.buildHook(\n {\n entityId: this.validationConfig.entityId,\n validUntil: this.deadline,\n validAfter: 0,\n },\n getDefaultTimeRangeModuleAddress(this.client.chain),\n ),\n );\n }\n\n const installValidationCall = await this.compileRaw();\n\n const { typedData } = await deferralActions(\n this.client,\n ).createDeferredActionTypedDataObject({\n callData: installValidationCall,\n deadline: this.deadline,\n nonce: this.nonce,\n });\n\n const preSignatureDigest = deferralActions(\n this.client,\n ).buildPreSignatureDeferredActionDigest({ typedData });\n\n // Encode additional information to build the full pre-signature digest\n const fullPreSignatureDeferredActionDigest: `0x${string}` = `0x0${\n this.hasAssociatedExecHooks ? \"1\" : \"0\"\n }${toHex(this.nonce, {\n size: 32,\n }).slice(2)}${preSignatureDigest.slice(2)}`;\n\n return {\n typedData,\n fullPreSignatureDeferredActionDigest,\n };\n }\n\n // Use for direct `installValidation()` low-level calls (maybe useless)\n async compileRaw(): Promise<Hex> {\n // Translate all permissions into raw hooks if >0\n if (this.permissions.length > 0) {\n const rawHooks = this.translatePermissions(\n this.validationConfig.entityId,\n );\n // Add the translated permissions as hooks\n this.addHooks(rawHooks);\n }\n this.validateConfiguration();\n\n return await installValidationActions(this.client).encodeInstallValidation({\n validationConfig: this.validationConfig,\n selectors: this.selectors,\n installData: this.installData,\n hooks: this.hooks,\n account: this.client.account,\n });\n }\n\n // Use for compiling args to installValidation\n async compileInstallArgs(): Promise<InstallValidationParams> {\n this.validateConfiguration();\n\n return {\n validationConfig: this.validationConfig,\n selectors: this.selectors,\n installData: this.installData,\n hooks: this.hooks,\n account: this.client.account,\n };\n }\n\n private validateConfiguration(): void {\n if (\n this.validationConfig.isGlobal === false &&\n this.selectors.length === 0\n ) {\n throw new ValidationConfigUnsetError();\n }\n }\n\n // Used to translate consolidated permissions into raw unencoded hooks\n // Note entityId will be a member object later\n private translatePermissions(entityId: number): RawHooks {\n const rawHooks: RawHooks = {\n [HookIdentifier.NATIVE_TOKEN_TRANSFER]: undefined,\n [HookIdentifier.ERC20_TOKEN_TRANSFER]: undefined,\n [HookIdentifier.GAS_LIMIT]: undefined,\n [HookIdentifier.PREVAL_ALLOWLIST]: undefined,\n };\n\n this.permissions.forEach((permission) => {\n switch (permission.type) {\n case PermissionType.NATIVE_TOKEN_TRANSFER:\n // Should never be added twice, check is on addPermission(s) too\n if (rawHooks[HookIdentifier.NATIVE_TOKEN_TRANSFER] !== undefined) {\n throw new MultipleNativeTokenTransferError(permission);\n }\n rawHooks[HookIdentifier.NATIVE_TOKEN_TRANSFER] = {\n hookConfig: {\n address: getDefaultNativeTokenLimitModuleAddress(\n this.client.chain,\n ),\n entityId,\n hookType: HookType.EXECUTION,\n hasPreHooks: true,\n hasPostHooks: false,\n },\n initData: {\n entityId,\n spendLimit: BigInt(permission.data.allowance),\n },\n };\n this.hasAssociatedExecHooks = true;\n break;\n case PermissionType.ERC20_TOKEN_TRANSFER:\n if (permission.data.address === zeroAddress) {\n throw new ZeroAddressError(permission);\n }\n rawHooks[HookIdentifier.ERC20_TOKEN_TRANSFER] = {\n hookConfig: {\n address: getDefaultAllowlistModuleAddress(this.client.chain),\n entityId: entityId + HALF_UINT32,\n hookType: HookType.EXECUTION,\n hasPreHooks: true,\n hasPostHooks: false,\n },\n initData: {\n entityId: entityId + HALF_UINT32,\n inputs: [\n // Add previous inputs if they exist\n ...(rawHooks[HookIdentifier.ERC20_TOKEN_TRANSFER]?.initData\n .inputs || []),\n {\n target: permission.data.address,\n hasSelectorAllowlist: false,\n hasERC20SpendLimit: true,\n erc20SpendLimit: BigInt(permission.data.allowance),\n selectors: [],\n },\n ],\n },\n };\n this.hasAssociatedExecHooks = true;\n // Also allow `approve` and `transfer` for the erc20\n rawHooks[HookIdentifier.PREVAL_ALLOWLIST] = {\n hookConfig: {\n address: getDefaultAllowlistModuleAddress(this.client.chain),\n entityId,\n hookType: HookType.VALIDATION,\n hasPreHooks: true,\n hasPostHooks: false,\n },\n initData: {\n entityId,\n inputs: [\n // Add previous inputs if they exist\n ...(rawHooks[HookIdentifier.PREVAL_ALLOWLIST]?.initData\n .inputs || []),\n {\n target: permission.data.address,\n hasSelectorAllowlist: true,\n hasERC20SpendLimit: false,\n erc20SpendLimit: 0n,\n selectors: [ERC20_APPROVE_SELECTOR, ERC20_TRANSFER_SELECTOR], // approve, transfer\n },\n ],\n },\n };\n break;\n case PermissionType.GAS_LIMIT:\n // Should only ever be added once, check is also on addPermission(s)\n if (rawHooks[HookIdentifier.GAS_LIMIT] !== undefined) {\n throw new MultipleGasLimitError(permission);\n }\n rawHooks[HookIdentifier.GAS_LIMIT] = {\n hookConfig: {\n address: getDefaultNativeTokenLimitModuleAddress(\n this.client.chain,\n ),\n entityId,\n hookType: HookType.VALIDATION,\n hasPreHooks: true,\n hasPostHooks: false,\n },\n initData: {\n entityId,\n spendLimit: BigInt(permission.data.limit),\n },\n };\n break;\n case PermissionType.CONTRACT_ACCESS:\n if (permission.data.address === zeroAddress) {\n throw new ZeroAddressError(permission);\n }\n rawHooks[HookIdentifier.PREVAL_ALLOWLIST] = {\n hookConfig: {\n address: getDefaultAllowlistModuleAddress(this.client.chain),\n entityId,\n hookType: HookType.VALIDATION,\n hasPreHooks: true,\n hasPostHooks: false,\n },\n initData: {\n entityId,\n inputs: [\n // Add previous inputs if they exist\n ...(rawHooks[HookIdentifier.PREVAL_ALLOWLIST]?.initData\n .inputs || []),\n {\n target: permission.data.address,\n hasSelectorAllowlist: false,\n hasERC20SpendLimit: false,\n erc20SpendLimit: 0n,\n selectors: [],\n },\n ],\n },\n };\n break;\n case PermissionType.ACCOUNT_FUNCTIONS:\n // This is handled in add permissions\n break;\n case PermissionType.FUNCTIONS_ON_ALL_CONTRACTS:\n if (permission.data.functions.length === 0) {\n throw new NoFunctionsProvidedError(permission);\n }\n rawHooks[HookIdentifier.PREVAL_ALLOWLIST] = {\n hookConfig: {\n address: getDefaultAllowlistModuleAddress(this.client.chain),\n entityId,\n hookType: HookType.VALIDATION,\n hasPreHooks: true,\n hasPostHooks: false,\n },\n initData: {\n entityId,\n inputs: [\n // Add previous inputs if they exist\n ...(rawHooks[HookIdentifier.PREVAL_ALLOWLIST]?.initData\n .inputs || []),\n {\n target: zeroAddress,\n hasSelectorAllowlist: false,\n hasERC20SpendLimit: false,\n erc20SpendLimit: 0n,\n selectors: permission.data.functions,\n },\n ],\n },\n };\n break;\n case PermissionType.FUNCTIONS_ON_CONTRACT:\n if (permission.data.functions.length === 0) {\n throw new NoFunctionsProvidedError(permission);\n }\n if (permission.data.address === zeroAddress) {\n throw new ZeroAddressError(permission);\n }\n rawHooks[HookIdentifier.PREVAL_ALLOWLIST] = {\n hookConfig: {\n address: getDefaultAllowlistModuleAddress(this.client.chain),\n entityId,\n hookType: HookType.VALIDATION,\n hasPreHooks: true,\n hasPostHooks: false,\n },\n initData: {\n entityId,\n inputs: [\n // Add previous inputs if they exist\n ...(rawHooks[HookIdentifier.PREVAL_ALLOWLIST]?.initData\n .inputs || []),\n {\n target: permission.data.address,\n hasSelectorAllowlist: true,\n hasERC20SpendLimit: false,\n erc20SpendLimit: 0n,\n selectors: permission.data.functions,\n },\n ],\n },\n };\n break;\n case PermissionType.ROOT:\n // Root permission handled in addPermission\n break;\n default:\n assertNever(permission);\n }\n\n // isGlobal guaranteed to be false since it's only set with root permissions,\n // we must add access to execute & executeBatch if there's a preVal allowlist hook set.\n if (rawHooks[HookIdentifier.PREVAL_ALLOWLIST] !== undefined) {\n const selectorsToAdd: `0x${string}`[] = [\n ACCOUNT_EXECUTE_SELECTOR,\n ACCOUNT_EXECUTEBATCH_SELECTOR,\n ]; // execute, executeBatch\n\n // Only add the selectors if they aren't already in this.selectors\n const newSelectors = selectorsToAdd.filter(\n (selector) => !this.selectors.includes(selector),\n );\n\n this.selectors = [...this.selectors, ...newSelectors];\n }\n });\n\n return rawHooks;\n }\n\n private addHooks(rawHooks: RawHooks) {\n if (rawHooks[HookIdentifier.NATIVE_TOKEN_TRANSFER]) {\n this.hooks.push({\n hookConfig: rawHooks[HookIdentifier.NATIVE_TOKEN_TRANSFER].hookConfig,\n initData: NativeTokenLimitModule.encodeOnInstallData(\n rawHooks[HookIdentifier.NATIVE_TOKEN_TRANSFER].initData,\n ),\n });\n }\n\n if (rawHooks[HookIdentifier.ERC20_TOKEN_TRANSFER]) {\n this.hooks.push({\n hookConfig: rawHooks[HookIdentifier.ERC20_TOKEN_TRANSFER].hookConfig,\n initData: AllowlistModule.encodeOnInstallData(\n rawHooks[HookIdentifier.ERC20_TOKEN_TRANSFER].initData,\n ),\n });\n }\n\n if (rawHooks[HookIdentifier.GAS_LIMIT]) {\n this.hooks.push({\n hookConfig: rawHooks[HookIdentifier.GAS_LIMIT].hookConfig,\n initData: NativeTokenLimitModule.encodeOnInstallData(\n rawHooks[HookIdentifier.GAS_LIMIT].initData,\n ),\n });\n }\n\n if (rawHooks[HookIdentifier.PREVAL_ALLOWLIST]) {\n this.hooks.push({\n hookConfig: rawHooks[HookIdentifier.PREVAL_ALLOWLIST].hookConfig,\n initData: AllowlistModule.encodeOnInstallData(\n rawHooks[HookIdentifier.PREVAL_ALLOWLIST].initData,\n ),\n });\n }\n }\n}\n\nexport function assertNever(_valid: never): never {\n throw new UnsupportedPermissionTypeError();\n}\n"]}
@@ -104,7 +104,7 @@ export class ValidationConfigUnsetError extends PermissionBuilderError {
104
104
  * Constructor for initializing an error message indicating the validation config is unset.
105
105
  */
106
106
  constructor() {
107
- super("Validation config unset, use permissionBuilder.configure(...)");
107
+ super("Missing permission among: functions on contract, functions on all contracts, account functions, contract access, or erc20 token transfer");
108
108
  Object.defineProperty(this, "name", {
109
109
  enumerable: true,
110
110
  configurable: true,
@@ -1 +1 @@
1
- {"version":3,"file":"permissionBuil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1B,KAAK,CACH,+BAA+B,QAAQ,oCAAoC,CAC5E,CAAC;QAVK;;;;mBAAO,2CAA2C;WAAC;IAW5D,CAAC;CACF;AAED,MAAM,OAAO,0BAA2B,SAAQ,sBAAsB;IAGpE;;OAEG;IACH;QACE,KAAK,CAAC,+DAA+D,CAAC,CAAC;QANhE;;;;mBAAO,+CAA+C;WAAC;IAOhE,CAAC;CACF;AAED,MAAM,OAAO,gCAAiC,SAAQ,sBAAsB;IAG1E;;;;OAIG;IACH,YAAY,UAAsB;QAChC,KAAK,CACH,GAAG,UAAU,CAAC,IAAI,0DAA0D,CAC7E,CAAC;QAVK;;;;mBAAO,qDAAqD;WAAC;IAWtE,CAAC;CACF;AAED,MAAM,OAAO,gBAAiB,SAAQ,sBAAsB;IAG1D;;;;OAIG;IACH,YAAY,UAAsB;QAChC,KAAK,CAAC,GAAG,UAAU,CAAC,IAAI,yBAAyB,CAAC,CAAC;QAR5C;;;;mBAAO,qCAAqC;WAAC;IAStD,CAAC;CACF;AAED,MAAM,OAAO,qBAAsB,SAAQ,sBAAsB;IAG/D;;;;OAIG;IACH,YAAY,UAAsB;QAChC,KAAK,CAAC,GAAG,UAAU,CAAC,IAAI,8CAA8C,CAAC,CAAC;QARjE;;;;mBAAO,0CAA0C;WAAC;IAS3D,CAAC;CACF;AAED,MAAM,OAAO,8BAA+B,SAAQ,sBAAsB;IAGxE;;OAEG;IACH;QACE,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAN9B;;;;mBAAO,mDAAmD;WAAC;IAOpE,CAAC;CACF;AAED,MAAM,OAAO,kBAAmB,SAAQ,sBAAsB;IAG5D;;;;OAIG;IACH,YAAY,YAAoB;QAC9B,KAAK,CAAC,cAAc,YAAY,iBAAiB,CAAC,CAAC;QAR5C;;;;mBAAO,oBAAoB;WAAC;IASrC,CAAC;CACF","sourcesContent":["import { BaseError, type Address } from \"@aa-sdk/core\";\nimport type { Permission } from \"./permissionBuilder\";\n\nexport abstract class PermissionBuilderError extends BaseError {}\n\nexport class RootPermissionOnlyError extends PermissionBuilderError {\n override name = \"PermissionBuilder: RootPermissionOnlyError\";\n\n /**\n * Constructor for initializing an error message indicating that an account could not be found to execute the specified action.\n *\n * @param {Permission} permission The permission trying to be added atop the root permission\n */\n constructor(permission: Permission) {\n super(\n `Adding ${permission.type}: Cannot add permissions with ROOT permission`\n );\n }\n}\n\nexport class AccountAddressAsTargetError extends PermissionBuilderError {\n override name = \"PermissionBuilder: AccountAddressAsTargetError\";\n\n /**\n * Constructor for initializing an error message indicating that account address is used as target.\n *\n * @param {Permission} permission The permission with account address as target\n */\n constructor(permission: Permission) {\n super(\n `${permission.type}: Account address as target, use ACCOUNT_FUNCTIONS for account address`\n );\n }\n}\n\nexport class DuplicateTargetAddressError extends PermissionBuilderError {\n override name = \"PermissionBuilder: DuplicateTargetAddressError\";\n\n /**\n * Constructor for initializing an error message indicating duplicate target address in permissions.\n *\n * @param {Permission} permission The permission with duplicate target address\n * @param {Address} targetAddress The duplicate target address\n */\n constructor(permission: Permission, targetAddress: Address) {\n super(\n `${permission.type}: Address ${targetAddress} already has a permission. Cannot add multiple CONTRACT_ACCESS or FUNCTIONS_ON_CONTRACT permissions for the same target address.`\n );\n }\n}\n\nexport class NoFunctionsProvidedError extends PermissionBuilderError {\n override name = \"PermissionBuilder: NoFunctionsProvidedError\";\n\n /**\n * Constructor for initializing an error message indicating no functions were provided.\n *\n * @param {Permission} permission The permission missing functions\n */\n constructor(permission: Permission) {\n super(`${permission.type}: No functions provided`);\n }\n}\n\nexport class ExpiredDeadlineError extends PermissionBuilderError {\n override name = \"PermissionBuilder: ExpiredDeadlineError\";\n\n /**\n * Constructor for initializing an error message indicating the deadline has expired.\n *\n * @param {number} deadline The expired deadline timestamp\n * @param {number} currentTime The current timestamp\n */\n constructor(deadline: number, currentTime: number) {\n super(\n `compileDeferred(): deadline ${deadline} cannot be before now (${currentTime})`\n );\n }\n}\n\nexport class DeadlineOverLimitError extends PermissionBuilderError {\n override name = \"PermissionBuilder: DeadlineOverLimitError\";\n\n /**\n * Constructor for initializing an error message indicating the deadline has expired.\n *\n * @param {number} deadline The expired deadline timestamp\n */\n constructor(deadline: number) {\n super(\n `compileDeferred(): deadline ${deadline} cannot be > max uint48 (2^48 - 1)`\n );\n }\n}\n\nexport class ValidationConfigUnsetError extends PermissionBuilderError {\n override name = \"PermissionBuilder: ValidationConfigUnsetError\";\n\n /**\n * Constructor for initializing an error message indicating the validation config is unset.\n */\n constructor() {\n super(\"Validation config unset, use permissionBuilder.configure(...)\");\n }\n}\n\nexport class MultipleNativeTokenTransferError extends PermissionBuilderError {\n override name = \"PermissionBuilder: MultipleNativeTokenTransferError\";\n\n /**\n * Constructor for initializing an error message indicating multiple native token transfer permissions.\n *\n * @param {Permission} permission The duplicate native token transfer permission\n */\n constructor(permission: Permission) {\n super(\n `${permission.type}: Must have at most ONE native token transfer permission`\n );\n }\n}\n\nexport class ZeroAddressError extends PermissionBuilderError {\n override name = \"PermissionBuilder: ZeroAddressError\";\n\n /**\n * Constructor for initializing an error message indicating zero address was provided.\n *\n * @param {Permission} permission The permission with zero address\n */\n constructor(permission: Permission) {\n super(`${permission.type}: Zero address provided`);\n }\n}\n\nexport class MultipleGasLimitError extends PermissionBuilderError {\n override name = \"PermissionBuilder: MultipleGasLimitError\";\n\n /**\n * Constructor for initializing an error message indicating multiple gas limit permissions.\n *\n * @param {Permission} permission The duplicate gas limit permission\n */\n constructor(permission: Permission) {\n super(`${permission.type}: Must have at most ONE gas limit permission`);\n }\n}\n\nexport class UnsupportedPermissionTypeError extends PermissionBuilderError {\n override name = \"PermissionBuilder: UnsupportedPermissionTypeError\";\n\n /**\n * Constructor for initializing an error message indicating an unsupported permission type.\n */\n constructor() {\n super(`Unsupported permission type`);\n }\n}\n\nexport class SelectorNotAllowed extends PermissionBuilderError {\n override name = \"SelectorNotAllowed\";\n\n /**\n * Constructor for initializing an error message indicating that the selector being added is not allowed.\n *\n * @param {string} functionName The function name of the selector that is being added.\n */\n constructor(functionName: string) {\n super(`Cannot add ${functionName} on the account`);\n }\n}\n"]}
1
+ {"version":3,"file":"permissionBuilderErrors.js","sourceRoot":"","sources":["../../../../src/ma-v2/permissionBuilderErrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgB,MAAM,cAAc,CAAC;AAGvD,MAAM,OAAgB,sBAAuB,SAAQ,SAAS;CAAG;AAEjE,MAAM,OAAO,uBAAwB,SAAQ,sBAAsB;IAGjE;;;;OAIG;IACH,YAAY,UAAsB;QAChC,KAAK,CACH,UAAU,UAAU,CAAC,IAAI,+CAA+C,CACzE,CAAC;QAVK;;;;mBAAO,4CAA4C;WAAC;IAW7D,CAAC;CACF;AAED,MAAM,OAAO,2BAA4B,SAAQ,sBAAsB;IAGrE;;;;OAIG;IACH,YAAY,UAAsB;QAChC,KAAK,CACH,GAAG,UAAU,CAAC,IAAI,wEAAwE,CAC3F,CAAC;QAVK;;;;mBAAO,gDAAgD;WAAC;IAWjE,CAAC;CACF;AAED,MAAM,OAAO,2BAA4B,SAAQ,sBAAsB;IAGrE;;;;;OAKG;IACH,YAAY,UAAsB,EAAE,aAAsB;QACxD,KAAK,CACH,GAAG,UAAU,CAAC,IAAI,aAAa,aAAa,kIAAkI,CAC/K,CAAC;QAXK;;;;mBAAO,gDAAgD;WAAC;IAYjE,CAAC;CACF;AAED,MAAM,OAAO,wBAAyB,SAAQ,sBAAsB;IAGlE;;;;OAIG;IACH,YAAY,UAAsB;QAChC,KAAK,CAAC,GAAG,UAAU,CAAC,IAAI,yBAAyB,CAAC,CAAC;QAR5C;;;;mBAAO,6CAA6C;WAAC;IAS9D,CAAC;CACF;AAED,MAAM,OAAO,oBAAqB,SAAQ,sBAAsB;IAG9D;;;;;OAKG;IACH,YAAY,QAAgB,EAAE,WAAmB;QAC/C,KAAK,CACH,+BAA+B,QAAQ,0BAA0B,WAAW,GAAG,CAChF,CAAC;QAXK;;;;mBAAO,yCAAyC;WAAC;IAY1D,CAAC;CACF;AAED,MA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@aa-sdk/core\";\nimport type { Permission } from \"./permissionBuilder\";\n\nexport abstract class PermissionBuilderError extends BaseError {}\n\nexport class RootPermissionOnlyError extends PermissionBuilderError {\n override name = \"PermissionBuilder: RootPermissionOnlyError\";\n\n /**\n * Constructor for initializing an error message indicating that an account could not be found to execute the specified action.\n *\n * @param {Permission} permission The permission trying to be added atop the root permission\n */\n constructor(permission: Permission) {\n super(\n `Adding ${permission.type}: Cannot add permissions with ROOT permission`,\n );\n }\n}\n\nexport class AccountAddressAsTargetError extends PermissionBuilderError {\n override name = \"PermissionBuilder: AccountAddressAsTargetError\";\n\n /**\n * Constructor for initializing an error message indicating that account address is used as target.\n *\n * @param {Permission} permission The permission with account address as target\n */\n constructor(permission: Permission) {\n super(\n `${permission.type}: Account address as target, use ACCOUNT_FUNCTIONS for account address`,\n );\n }\n}\n\nexport class DuplicateTargetAddressError extends PermissionBuilderError {\n override name = \"PermissionBuilder: DuplicateTargetAddressError\";\n\n /**\n * Constructor for initializing an error message indicating duplicate target address in permissions.\n *\n * @param {Permission} permission The permission with duplicate target address\n * @param {Address} targetAddress The duplicate target address\n */\n constructor(permission: Permission, targetAddress: Address) {\n super(\n `${permission.type}: Address ${targetAddress} already has a permission. Cannot add multiple CONTRACT_ACCESS or FUNCTIONS_ON_CONTRACT permissions for the same target address.`,\n );\n }\n}\n\nexport class NoFunctionsProvidedError extends PermissionBuilderError {\n override name = \"PermissionBuilder: NoFunctionsProvidedError\";\n\n /**\n * Constructor for initializing an error message indicating no functions were provided.\n *\n * @param {Permission} permission The permission missing functions\n */\n constructor(permission: Permission) {\n super(`${permission.type}: No functions provided`);\n }\n}\n\nexport class ExpiredDeadlineError extends PermissionBuilderError {\n override name = \"PermissionBuilder: ExpiredDeadlineError\";\n\n /**\n * Constructor for initializing an error message indicating the deadline has expired.\n *\n * @param {number} deadline The expired deadline timestamp\n * @param {number} currentTime The current timestamp\n */\n constructor(deadline: number, currentTime: number) {\n super(\n `compileDeferred(): deadline ${deadline} cannot be before now (${currentTime})`,\n );\n }\n}\n\nexport class DeadlineOverLimitError extends PermissionBuilderError {\n override name = \"PermissionBuilder: DeadlineOverLimitError\";\n\n /**\n * Constructor for initializing an error message indicating the deadline has expired.\n *\n * @param {number} deadline The expired deadline timestamp\n */\n constructor(deadline: number) {\n super(\n `compileDeferred(): deadline ${deadline} cannot be > max uint48 (2^48 - 1)`,\n );\n }\n}\n\nexport class ValidationConfigUnsetError extends PermissionBuilderError {\n override name = \"PermissionBuilder: ValidationConfigUnsetError\";\n\n /**\n * Constructor for initializing an error message indicating the validation config is unset.\n */\n constructor() {\n super(\n \"Missing permission among: functions on contract, functions on all contracts, account functions, contract access, or erc20 token transfer\",\n );\n }\n}\n\nexport class MultipleNativeTokenTransferError extends PermissionBuilderError {\n override name = \"PermissionBuilder: MultipleNativeTokenTransferError\";\n\n /**\n * Constructor for initializing an error message indicating multiple native token transfer permissions.\n *\n * @param {Permission} permission The duplicate native token transfer permission\n */\n constructor(permission: Permission) {\n super(\n `${permission.type}: Must have at most ONE native token transfer permission`,\n );\n }\n}\n\nexport class ZeroAddressError extends PermissionBuilderError {\n override name = \"PermissionBuilder: ZeroAddressError\";\n\n /**\n * Constructor for initializing an error message indicating zero address was provided.\n *\n * @param {Permission} permission The permission with zero address\n */\n constructor(permission: Permission) {\n super(`${permission.type}: Zero address provided`);\n }\n}\n\nexport class MultipleGasLimitError extends PermissionBuilderError {\n override name = \"PermissionBuilder: MultipleGasLimitError\";\n\n /**\n * Constructor for initializing an error message indicating multiple gas limit permissions.\n *\n * @param {Permission} permission The duplicate gas limit permission\n */\n constructor(permission: Permission) {\n super(`${permission.type}: Must have at most ONE gas limit permission`);\n }\n}\n\nexport class UnsupportedPermissionTypeError extends PermissionBuilderError {\n override name = \"PermissionBuilder: UnsupportedPermissionTypeError\";\n\n /**\n * Constructor for initializing an error message indicating an unsupported permission type.\n */\n constructor() {\n super(`Unsupported permission type`);\n }\n}\n\nexport class SelectorNotAllowed extends PermissionBuilderError {\n override name = \"SelectorNotAllowed\";\n\n /**\n * Constructor for initializing an error message indicating that the selector being added is not allowed.\n *\n * @param {string} functionName The function name of the selector that is being added.\n */\n constructor(functionName: string) {\n super(`Cannot add ${functionName} on the account`);\n }\n}\n"]}