@startale-scs/aa-sdk 0.0.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 (671) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +20 -0
  3. package/dist/_cjs/account/decorators/getFactoryData.js +36 -0
  4. package/dist/_cjs/account/decorators/getFactoryData.js.map +1 -0
  5. package/dist/_cjs/account/decorators/getStartaleAccountAddress.js +18 -0
  6. package/dist/_cjs/account/decorators/getStartaleAccountAddress.js.map +1 -0
  7. package/dist/_cjs/account/decorators/index.js +6 -0
  8. package/dist/_cjs/account/decorators/index.js.map +1 -0
  9. package/dist/_cjs/account/index.js +6 -0
  10. package/dist/_cjs/account/index.js.map +1 -0
  11. package/dist/_cjs/account/toStartaleSmartAccount.js +251 -0
  12. package/dist/_cjs/account/toStartaleSmartAccount.js.map +1 -0
  13. package/dist/_cjs/account/utils/AccountNotFound.js +18 -0
  14. package/dist/_cjs/account/utils/AccountNotFound.js.map +1 -0
  15. package/dist/_cjs/account/utils/Constants.js +128 -0
  16. package/dist/_cjs/account/utils/Constants.js.map +1 -0
  17. package/dist/_cjs/account/utils/Helpers.js +39 -0
  18. package/dist/_cjs/account/utils/Helpers.js.map +1 -0
  19. package/dist/_cjs/account/utils/Logger.js +35 -0
  20. package/dist/_cjs/account/utils/Logger.js.map +1 -0
  21. package/dist/_cjs/account/utils/Types.js +3 -0
  22. package/dist/_cjs/account/utils/Types.js.map +1 -0
  23. package/dist/_cjs/account/utils/Utils.js +258 -0
  24. package/dist/_cjs/account/utils/Utils.js.map +1 -0
  25. package/dist/_cjs/account/utils/contractSimulation.js +27 -0
  26. package/dist/_cjs/account/utils/contractSimulation.js.map +1 -0
  27. package/dist/_cjs/account/utils/deepHexlify.js +26 -0
  28. package/dist/_cjs/account/utils/deepHexlify.js.map +1 -0
  29. package/dist/_cjs/account/utils/fromBundlerClient.js +45 -0
  30. package/dist/_cjs/account/utils/fromBundlerClient.js.map +1 -0
  31. package/dist/_cjs/account/utils/getAAError.js +37 -0
  32. package/dist/_cjs/account/utils/getAAError.js.map +1 -0
  33. package/dist/_cjs/account/utils/getChain.js +66 -0
  34. package/dist/_cjs/account/utils/getChain.js.map +1 -0
  35. package/dist/_cjs/account/utils/getVersion.js +46 -0
  36. package/dist/_cjs/account/utils/getVersion.js.map +1 -0
  37. package/dist/_cjs/account/utils/index.js +27 -0
  38. package/dist/_cjs/account/utils/index.js.map +1 -0
  39. package/dist/_cjs/account/utils/parseErrorMessage.js +79 -0
  40. package/dist/_cjs/account/utils/parseErrorMessage.js.map +1 -0
  41. package/dist/_cjs/account/utils/tenderlySimulation.js +52 -0
  42. package/dist/_cjs/account/utils/tenderlySimulation.js.map +1 -0
  43. package/dist/_cjs/account/utils/toInitData.js +13 -0
  44. package/dist/_cjs/account/utils/toInitData.js.map +1 -0
  45. package/dist/_cjs/account/utils/toInstallData.js +15 -0
  46. package/dist/_cjs/account/utils/toInstallData.js.map +1 -0
  47. package/dist/_cjs/account/utils/toSigner.js +81 -0
  48. package/dist/_cjs/account/utils/toSigner.js.map +1 -0
  49. package/dist/_cjs/clients/createHttpClient.js +42 -0
  50. package/dist/_cjs/clients/createHttpClient.js.map +1 -0
  51. package/dist/_cjs/clients/createSCSBundlerClient.js +45 -0
  52. package/dist/_cjs/clients/createSCSBundlerClient.js.map +1 -0
  53. package/dist/_cjs/clients/createSCSPaymasterClient.js +39 -0
  54. package/dist/_cjs/clients/createSCSPaymasterClient.js.map +1 -0
  55. package/dist/_cjs/clients/decorators/bundler/getGasFeeValues.js +34 -0
  56. package/dist/_cjs/clients/decorators/bundler/getGasFeeValues.js.map +1 -0
  57. package/dist/_cjs/clients/decorators/bundler/getUserOperationStatus.js +10 -0
  58. package/dist/_cjs/clients/decorators/bundler/getUserOperationStatus.js.map +1 -0
  59. package/dist/_cjs/clients/decorators/bundler/index.js +15 -0
  60. package/dist/_cjs/clients/decorators/bundler/index.js.map +1 -0
  61. package/dist/_cjs/clients/decorators/bundler/waitForConfirmedUserOperationReceipt.js +27 -0
  62. package/dist/_cjs/clients/decorators/bundler/waitForConfirmedUserOperationReceipt.js.map +1 -0
  63. package/dist/_cjs/clients/decorators/bundler/waitForUserOperationReceipt.js +13 -0
  64. package/dist/_cjs/clients/decorators/bundler/waitForUserOperationReceipt.js.map +1 -0
  65. package/dist/_cjs/clients/decorators/erc7579/accountId.js +65 -0
  66. package/dist/_cjs/clients/decorators/erc7579/accountId.js.map +1 -0
  67. package/dist/_cjs/clients/decorators/erc7579/getActiveHook.js +43 -0
  68. package/dist/_cjs/clients/decorators/erc7579/getActiveHook.js.map +1 -0
  69. package/dist/_cjs/clients/decorators/erc7579/getFallbackBySelector.js +56 -0
  70. package/dist/_cjs/clients/decorators/erc7579/getFallbackBySelector.js.map +1 -0
  71. package/dist/_cjs/clients/decorators/erc7579/getInstalledExecutors.js +63 -0
  72. package/dist/_cjs/clients/decorators/erc7579/getInstalledExecutors.js.map +1 -0
  73. package/dist/_cjs/clients/decorators/erc7579/getInstalledValidators.js +61 -0
  74. package/dist/_cjs/clients/decorators/erc7579/getInstalledValidators.js.map +1 -0
  75. package/dist/_cjs/clients/decorators/erc7579/getPreviousModule.js +37 -0
  76. package/dist/_cjs/clients/decorators/erc7579/getPreviousModule.js.map +1 -0
  77. package/dist/_cjs/clients/decorators/erc7579/index.js +64 -0
  78. package/dist/_cjs/clients/decorators/erc7579/index.js.map +1 -0
  79. package/dist/_cjs/clients/decorators/erc7579/installModule.js +94 -0
  80. package/dist/_cjs/clients/decorators/erc7579/installModule.js.map +1 -0
  81. package/dist/_cjs/clients/decorators/erc7579/installModules.js +25 -0
  82. package/dist/_cjs/clients/decorators/erc7579/installModules.js.map +1 -0
  83. package/dist/_cjs/clients/decorators/erc7579/isModuleInstalled.js +90 -0
  84. package/dist/_cjs/clients/decorators/erc7579/isModuleInstalled.js.map +1 -0
  85. package/dist/_cjs/clients/decorators/erc7579/supportsExecutionMode.js +102 -0
  86. package/dist/_cjs/clients/decorators/erc7579/supportsExecutionMode.js.map +1 -0
  87. package/dist/_cjs/clients/decorators/erc7579/supportsModule.js +90 -0
  88. package/dist/_cjs/clients/decorators/erc7579/supportsModule.js.map +1 -0
  89. package/dist/_cjs/clients/decorators/erc7579/uninstallFallback.js +61 -0
  90. package/dist/_cjs/clients/decorators/erc7579/uninstallFallback.js.map +1 -0
  91. package/dist/_cjs/clients/decorators/erc7579/uninstallModule.js +79 -0
  92. package/dist/_cjs/clients/decorators/erc7579/uninstallModule.js.map +1 -0
  93. package/dist/_cjs/clients/decorators/erc7579/uninstallModules.js +26 -0
  94. package/dist/_cjs/clients/decorators/erc7579/uninstallModules.js.map +1 -0
  95. package/dist/_cjs/clients/decorators/index.js +8 -0
  96. package/dist/_cjs/clients/decorators/index.js.map +1 -0
  97. package/dist/_cjs/clients/decorators/smartAccount/debugUserOperation.js +75 -0
  98. package/dist/_cjs/clients/decorators/smartAccount/debugUserOperation.js.map +1 -0
  99. package/dist/_cjs/clients/decorators/smartAccount/index.js +32 -0
  100. package/dist/_cjs/clients/decorators/smartAccount/index.js.map +1 -0
  101. package/dist/_cjs/clients/decorators/smartAccount/prepareTokenPaymasterUserOp.js +32 -0
  102. package/dist/_cjs/clients/decorators/smartAccount/prepareTokenPaymasterUserOp.js.map +1 -0
  103. package/dist/_cjs/clients/decorators/smartAccount/prepareUserOperationWithoutSignature.js +35 -0
  104. package/dist/_cjs/clients/decorators/smartAccount/prepareUserOperationWithoutSignature.js.map +1 -0
  105. package/dist/_cjs/clients/decorators/smartAccount/sendTokenPaymasterUserOp.js +21 -0
  106. package/dist/_cjs/clients/decorators/smartAccount/sendTokenPaymasterUserOp.js.map +1 -0
  107. package/dist/_cjs/clients/decorators/smartAccount/sendTransaction.js +41 -0
  108. package/dist/_cjs/clients/decorators/smartAccount/sendTransaction.js.map +1 -0
  109. package/dist/_cjs/clients/decorators/smartAccount/signMessage.js +14 -0
  110. package/dist/_cjs/clients/decorators/smartAccount/signMessage.js.map +1 -0
  111. package/dist/_cjs/clients/decorators/smartAccount/signTypedData.js +31 -0
  112. package/dist/_cjs/clients/decorators/smartAccount/signTypedData.js.map +1 -0
  113. package/dist/_cjs/clients/decorators/smartAccount/upgradeSmartAccount.js +61 -0
  114. package/dist/_cjs/clients/decorators/smartAccount/upgradeSmartAccount.js.map +1 -0
  115. package/dist/_cjs/clients/decorators/smartAccount/waitForTransactionReceipt.js +17 -0
  116. package/dist/_cjs/clients/decorators/smartAccount/waitForTransactionReceipt.js.map +1 -0
  117. package/dist/_cjs/clients/decorators/smartAccount/writeContract.js +20 -0
  118. package/dist/_cjs/clients/decorators/smartAccount/writeContract.js.map +1 -0
  119. package/dist/_cjs/clients/decorators/tokenPaymaster/getSupportedTokens.js +25 -0
  120. package/dist/_cjs/clients/decorators/tokenPaymaster/getSupportedTokens.js.map +1 -0
  121. package/dist/_cjs/clients/decorators/tokenPaymaster/getTokenPaymasterQuotes.js +35 -0
  122. package/dist/_cjs/clients/decorators/tokenPaymaster/getTokenPaymasterQuotes.js.map +1 -0
  123. package/dist/_cjs/clients/decorators/tokenPaymaster/index.js +11 -0
  124. package/dist/_cjs/clients/decorators/tokenPaymaster/index.js.map +1 -0
  125. package/dist/_cjs/clients/index.js +8 -0
  126. package/dist/_cjs/clients/index.js.map +1 -0
  127. package/dist/_cjs/constants/abi/AccountFactory.js +337 -0
  128. package/dist/_cjs/constants/abi/AccountFactory.js.map +1 -0
  129. package/dist/_cjs/constants/abi/AccountImplementationAbi.js +1179 -0
  130. package/dist/_cjs/constants/abi/AccountImplementationAbi.js.map +1 -0
  131. package/dist/_cjs/constants/abi/BootstrapAbi.js +730 -0
  132. package/dist/_cjs/constants/abi/BootstrapAbi.js.map +1 -0
  133. package/dist/_cjs/constants/abi/ComposabilityAbi.js +274 -0
  134. package/dist/_cjs/constants/abi/ComposabilityAbi.js.map +1 -0
  135. package/dist/_cjs/constants/abi/EIP1271Abi.js +31 -0
  136. package/dist/_cjs/constants/abi/EIP1271Abi.js.map +1 -0
  137. package/dist/_cjs/constants/abi/ERC7484RegistryAbi.js +17 -0
  138. package/dist/_cjs/constants/abi/ERC7484RegistryAbi.js.map +1 -0
  139. package/dist/_cjs/constants/abi/EntryPointABI.js +661 -0
  140. package/dist/_cjs/constants/abi/EntryPointABI.js.map +1 -0
  141. package/dist/_cjs/constants/abi/SmartSessionAbi.js +1472 -0
  142. package/dist/_cjs/constants/abi/SmartSessionAbi.js.map +1 -0
  143. package/dist/_cjs/constants/abi/TokenWithPermitAbi.js +622 -0
  144. package/dist/_cjs/constants/abi/TokenWithPermitAbi.js.map +1 -0
  145. package/dist/_cjs/constants/abi/UniActionPolicyAbi.js +62 -0
  146. package/dist/_cjs/constants/abi/UniActionPolicyAbi.js.map +1 -0
  147. package/dist/_cjs/constants/abi/UniswapSwapRouterAbi.js +486 -0
  148. package/dist/_cjs/constants/abi/UniswapSwapRouterAbi.js.map +1 -0
  149. package/dist/_cjs/constants/abi/index.js +14 -0
  150. package/dist/_cjs/constants/abi/index.js.map +1 -0
  151. package/dist/_cjs/constants/index.js +62 -0
  152. package/dist/_cjs/constants/index.js.map +1 -0
  153. package/dist/_cjs/index.js +13 -0
  154. package/dist/_cjs/index.js.map +1 -0
  155. package/dist/_cjs/modules/index.js +8 -0
  156. package/dist/_cjs/modules/index.js.map +1 -0
  157. package/dist/_cjs/modules/toEmptyExecutor.js +10 -0
  158. package/dist/_cjs/modules/toEmptyExecutor.js.map +1 -0
  159. package/dist/_cjs/modules/toEmptyHook.js +10 -0
  160. package/dist/_cjs/modules/toEmptyHook.js.map +1 -0
  161. package/dist/_cjs/modules/utils/Helpers.js +59 -0
  162. package/dist/_cjs/modules/utils/Helpers.js.map +1 -0
  163. package/dist/_cjs/modules/utils/Types.js +15 -0
  164. package/dist/_cjs/modules/utils/Types.js.map +1 -0
  165. package/dist/_cjs/modules/utils/Uid.js +14 -0
  166. package/dist/_cjs/modules/utils/Uid.js.map +1 -0
  167. package/dist/_cjs/modules/utils/composabilityCalls.js +117 -0
  168. package/dist/_cjs/modules/utils/composabilityCalls.js.map +1 -0
  169. package/dist/_cjs/modules/utils/index.js +9 -0
  170. package/dist/_cjs/modules/utils/index.js.map +1 -0
  171. package/dist/_cjs/modules/utils/runtimeAbiEncoding.js +276 -0
  172. package/dist/_cjs/modules/utils/runtimeAbiEncoding.js.map +1 -0
  173. package/dist/_cjs/modules/utils/toModule.js +39 -0
  174. package/dist/_cjs/modules/utils/toModule.js.map +1 -0
  175. package/dist/_cjs/modules/validators/default/index.js +5 -0
  176. package/dist/_cjs/modules/validators/default/index.js.map +1 -0
  177. package/dist/_cjs/modules/validators/default/toDefaultModule.js +18 -0
  178. package/dist/_cjs/modules/validators/default/toDefaultModule.js.map +1 -0
  179. package/dist/_cjs/modules/validators/index.js +9 -0
  180. package/dist/_cjs/modules/validators/index.js.map +1 -0
  181. package/dist/_cjs/modules/validators/ownable/decorators/addOwner.js +44 -0
  182. package/dist/_cjs/modules/validators/ownable/decorators/addOwner.js.map +1 -0
  183. package/dist/_cjs/modules/validators/ownable/decorators/getAddOwnerTx.js +42 -0
  184. package/dist/_cjs/modules/validators/ownable/decorators/getAddOwnerTx.js.map +1 -0
  185. package/dist/_cjs/modules/validators/ownable/decorators/getOwners.js +28 -0
  186. package/dist/_cjs/modules/validators/ownable/decorators/getOwners.js.map +1 -0
  187. package/dist/_cjs/modules/validators/ownable/decorators/getRemoveOwnerTx.js +38 -0
  188. package/dist/_cjs/modules/validators/ownable/decorators/getRemoveOwnerTx.js.map +1 -0
  189. package/dist/_cjs/modules/validators/ownable/decorators/getSetThresholdTx.js +32 -0
  190. package/dist/_cjs/modules/validators/ownable/decorators/getSetThresholdTx.js.map +1 -0
  191. package/dist/_cjs/modules/validators/ownable/decorators/getThreshold.js +28 -0
  192. package/dist/_cjs/modules/validators/ownable/decorators/getThreshold.js.map +1 -0
  193. package/dist/_cjs/modules/validators/ownable/decorators/index.js +70 -0
  194. package/dist/_cjs/modules/validators/ownable/decorators/index.js.map +1 -0
  195. package/dist/_cjs/modules/validators/ownable/decorators/multiSign.js +25 -0
  196. package/dist/_cjs/modules/validators/ownable/decorators/multiSign.js.map +1 -0
  197. package/dist/_cjs/modules/validators/ownable/decorators/prepareForMultiSign.js +22 -0
  198. package/dist/_cjs/modules/validators/ownable/decorators/prepareForMultiSign.js.map +1 -0
  199. package/dist/_cjs/modules/validators/ownable/decorators/removeOwner.js +44 -0
  200. package/dist/_cjs/modules/validators/ownable/decorators/removeOwner.js.map +1 -0
  201. package/dist/_cjs/modules/validators/ownable/decorators/setThreshold.js +39 -0
  202. package/dist/_cjs/modules/validators/ownable/decorators/setThreshold.js.map +1 -0
  203. package/dist/_cjs/modules/validators/ownable/index.js +6 -0
  204. package/dist/_cjs/modules/validators/ownable/index.js.map +1 -0
  205. package/dist/_cjs/modules/validators/ownable/toOwnableModule.js +16 -0
  206. package/dist/_cjs/modules/validators/ownable/toOwnableModule.js.map +1 -0
  207. package/dist/_cjs/modules/validators/smartSessionsValidator/Helpers.js +124 -0
  208. package/dist/_cjs/modules/validators/smartSessionsValidator/Helpers.js.map +1 -0
  209. package/dist/_cjs/modules/validators/smartSessionsValidator/Types.js +13 -0
  210. package/dist/_cjs/modules/validators/smartSessionsValidator/Types.js.map +1 -0
  211. package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/grantPermission.js +38 -0
  212. package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/grantPermission.js.map +1 -0
  213. package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/index.js +27 -0
  214. package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/index.js.map +1 -0
  215. package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/preparePermission.js +127 -0
  216. package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/preparePermission.js.map +1 -0
  217. package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/usePermission.js +16 -0
  218. package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/usePermission.js.map +1 -0
  219. package/dist/_cjs/modules/validators/smartSessionsValidator/index.js +8 -0
  220. package/dist/_cjs/modules/validators/smartSessionsValidator/index.js.map +1 -0
  221. package/dist/_cjs/modules/validators/smartSessionsValidator/toSmartSessionsValidator.js +49 -0
  222. package/dist/_cjs/modules/validators/smartSessionsValidator/toSmartSessionsValidator.js.map +1 -0
  223. package/dist/_cjs/modules/validators/toValidator.js +21 -0
  224. package/dist/_cjs/modules/validators/toValidator.js.map +1 -0
  225. package/dist/_cjs/package.json +1 -0
  226. package/dist/_esm/account/decorators/getFactoryData.js +31 -0
  227. package/dist/_esm/account/decorators/getFactoryData.js.map +1 -0
  228. package/dist/_esm/account/decorators/getStartaleAccountAddress.js +31 -0
  229. package/dist/_esm/account/decorators/getStartaleAccountAddress.js.map +1 -0
  230. package/dist/_esm/account/decorators/index.js +3 -0
  231. package/dist/_esm/account/decorators/index.js.map +1 -0
  232. package/dist/_esm/account/index.js +3 -0
  233. package/dist/_esm/account/index.js.map +1 -0
  234. package/dist/_esm/account/toStartaleSmartAccount.js +327 -0
  235. package/dist/_esm/account/toStartaleSmartAccount.js.map +1 -0
  236. package/dist/_esm/account/utils/AccountNotFound.js +17 -0
  237. package/dist/_esm/account/utils/AccountNotFound.js.map +1 -0
  238. package/dist/_esm/account/utils/Constants.js +129 -0
  239. package/dist/_esm/account/utils/Constants.js.map +1 -0
  240. package/dist/_esm/account/utils/Helpers.js +45 -0
  241. package/dist/_esm/account/utils/Helpers.js.map +1 -0
  242. package/dist/_esm/account/utils/Logger.js +50 -0
  243. package/dist/_esm/account/utils/Logger.js.map +1 -0
  244. package/dist/_esm/account/utils/Types.js +2 -0
  245. package/dist/_esm/account/utils/Types.js.map +1 -0
  246. package/dist/_esm/account/utils/Utils.js +319 -0
  247. package/dist/_esm/account/utils/Utils.js.map +1 -0
  248. package/dist/_esm/account/utils/contractSimulation.js +48 -0
  249. package/dist/_esm/account/utils/contractSimulation.js.map +1 -0
  250. package/dist/_esm/account/utils/deepHexlify.js +63 -0
  251. package/dist/_esm/account/utils/deepHexlify.js.map +1 -0
  252. package/dist/_esm/account/utils/fromBundlerClient.js +67 -0
  253. package/dist/_esm/account/utils/fromBundlerClient.js.map +1 -0
  254. package/dist/_esm/account/utils/getAAError.js +34 -0
  255. package/dist/_esm/account/utils/getAAError.js.map +1 -0
  256. package/dist/_esm/account/utils/getChain.js +117 -0
  257. package/dist/_esm/account/utils/getChain.js.map +1 -0
  258. package/dist/_esm/account/utils/getVersion.js +163 -0
  259. package/dist/_esm/account/utils/getVersion.js.map +1 -0
  260. package/dist/_esm/account/utils/index.js +19 -0
  261. package/dist/_esm/account/utils/index.js.map +1 -0
  262. package/dist/_esm/account/utils/parseErrorMessage.js +89 -0
  263. package/dist/_esm/account/utils/parseErrorMessage.js.map +1 -0
  264. package/dist/_esm/account/utils/tenderlySimulation.js +47 -0
  265. package/dist/_esm/account/utils/tenderlySimulation.js.map +1 -0
  266. package/dist/_esm/account/utils/toInitData.js +14 -0
  267. package/dist/_esm/account/utils/toInitData.js.map +1 -0
  268. package/dist/_esm/account/utils/toInstallData.js +16 -0
  269. package/dist/_esm/account/utils/toInstallData.js.map +1 -0
  270. package/dist/_esm/account/utils/toSigner.js +91 -0
  271. package/dist/_esm/account/utils/toSigner.js.map +1 -0
  272. package/dist/_esm/clients/createHttpClient.js +43 -0
  273. package/dist/_esm/clients/createHttpClient.js.map +1 -0
  274. package/dist/_esm/clients/createSCSBundlerClient.js +56 -0
  275. package/dist/_esm/clients/createSCSBundlerClient.js.map +1 -0
  276. package/dist/_esm/clients/createSCSPaymasterClient.js +74 -0
  277. package/dist/_esm/clients/createSCSPaymasterClient.js.map +1 -0
  278. package/dist/_esm/clients/decorators/bundler/getGasFeeValues.js +53 -0
  279. package/dist/_esm/clients/decorators/bundler/getGasFeeValues.js.map +1 -0
  280. package/dist/_esm/clients/decorators/bundler/getUserOperationStatus.js +8 -0
  281. package/dist/_esm/clients/decorators/bundler/getUserOperationStatus.js.map +1 -0
  282. package/dist/_esm/clients/decorators/bundler/index.js +11 -0
  283. package/dist/_esm/clients/decorators/bundler/index.js.map +1 -0
  284. package/dist/_esm/clients/decorators/bundler/waitForConfirmedUserOperationReceipt.js +26 -0
  285. package/dist/_esm/clients/decorators/bundler/waitForConfirmedUserOperationReceipt.js.map +1 -0
  286. package/dist/_esm/clients/decorators/bundler/waitForUserOperationReceipt.js +10 -0
  287. package/dist/_esm/clients/decorators/bundler/waitForUserOperationReceipt.js.map +1 -0
  288. package/dist/_esm/clients/decorators/erc7579/accountId.js +77 -0
  289. package/dist/_esm/clients/decorators/erc7579/accountId.js.map +1 -0
  290. package/dist/_esm/clients/decorators/erc7579/getActiveHook.js +52 -0
  291. package/dist/_esm/clients/decorators/erc7579/getActiveHook.js.map +1 -0
  292. package/dist/_esm/clients/decorators/erc7579/getFallbackBySelector.js +67 -0
  293. package/dist/_esm/clients/decorators/erc7579/getFallbackBySelector.js.map +1 -0
  294. package/dist/_esm/clients/decorators/erc7579/getInstalledExecutors.js +74 -0
  295. package/dist/_esm/clients/decorators/erc7579/getInstalledExecutors.js.map +1 -0
  296. package/dist/_esm/clients/decorators/erc7579/getInstalledValidators.js +72 -0
  297. package/dist/_esm/clients/decorators/erc7579/getInstalledValidators.js.map +1 -0
  298. package/dist/_esm/clients/decorators/erc7579/getPreviousModule.js +54 -0
  299. package/dist/_esm/clients/decorators/erc7579/getPreviousModule.js.map +1 -0
  300. package/dist/_esm/clients/decorators/erc7579/index.js +48 -0
  301. package/dist/_esm/clients/decorators/erc7579/index.js.map +1 -0
  302. package/dist/_esm/clients/decorators/erc7579/installModule.js +109 -0
  303. package/dist/_esm/clients/decorators/erc7579/installModule.js.map +1 -0
  304. package/dist/_esm/clients/decorators/erc7579/installModules.js +41 -0
  305. package/dist/_esm/clients/decorators/erc7579/installModules.js.map +1 -0
  306. package/dist/_esm/clients/decorators/erc7579/isModuleInstalled.js +106 -0
  307. package/dist/_esm/clients/decorators/erc7579/isModuleInstalled.js.map +1 -0
  308. package/dist/_esm/clients/decorators/erc7579/supportsExecutionMode.js +120 -0
  309. package/dist/_esm/clients/decorators/erc7579/supportsExecutionMode.js.map +1 -0
  310. package/dist/_esm/clients/decorators/erc7579/supportsModule.js +108 -0
  311. package/dist/_esm/clients/decorators/erc7579/supportsModule.js.map +1 -0
  312. package/dist/_esm/clients/decorators/erc7579/uninstallFallback.js +76 -0
  313. package/dist/_esm/clients/decorators/erc7579/uninstallFallback.js.map +1 -0
  314. package/dist/_esm/clients/decorators/erc7579/uninstallModule.js +94 -0
  315. package/dist/_esm/clients/decorators/erc7579/uninstallModule.js.map +1 -0
  316. package/dist/_esm/clients/decorators/erc7579/uninstallModules.js +42 -0
  317. package/dist/_esm/clients/decorators/erc7579/uninstallModules.js.map +1 -0
  318. package/dist/_esm/clients/decorators/index.js +5 -0
  319. package/dist/_esm/clients/decorators/index.js.map +1 -0
  320. package/dist/_esm/clients/decorators/smartAccount/debugUserOperation.js +105 -0
  321. package/dist/_esm/clients/decorators/smartAccount/debugUserOperation.js.map +1 -0
  322. package/dist/_esm/clients/decorators/smartAccount/index.js +28 -0
  323. package/dist/_esm/clients/decorators/smartAccount/index.js.map +1 -0
  324. package/dist/_esm/clients/decorators/smartAccount/prepareTokenPaymasterUserOp.js +60 -0
  325. package/dist/_esm/clients/decorators/smartAccount/prepareTokenPaymasterUserOp.js.map +1 -0
  326. package/dist/_esm/clients/decorators/smartAccount/prepareUserOperationWithoutSignature.js +36 -0
  327. package/dist/_esm/clients/decorators/smartAccount/prepareUserOperationWithoutSignature.js.map +1 -0
  328. package/dist/_esm/clients/decorators/smartAccount/sendTokenPaymasterUserOp.js +44 -0
  329. package/dist/_esm/clients/decorators/smartAccount/sendTokenPaymasterUserOp.js.map +1 -0
  330. package/dist/_esm/clients/decorators/smartAccount/sendTransaction.js +57 -0
  331. package/dist/_esm/clients/decorators/smartAccount/sendTransaction.js.map +1 -0
  332. package/dist/_esm/clients/decorators/smartAccount/signMessage.js +30 -0
  333. package/dist/_esm/clients/decorators/smartAccount/signMessage.js.map +1 -0
  334. package/dist/_esm/clients/decorators/smartAccount/signTypedData.js +82 -0
  335. package/dist/_esm/clients/decorators/smartAccount/signTypedData.js.map +1 -0
  336. package/dist/_esm/clients/decorators/smartAccount/upgradeSmartAccount.js +75 -0
  337. package/dist/_esm/clients/decorators/smartAccount/upgradeSmartAccount.js.map +1 -0
  338. package/dist/_esm/clients/decorators/smartAccount/waitForTransactionReceipt.js +14 -0
  339. package/dist/_esm/clients/decorators/smartAccount/waitForTransactionReceipt.js.map +1 -0
  340. package/dist/_esm/clients/decorators/smartAccount/writeContract.js +40 -0
  341. package/dist/_esm/clients/decorators/smartAccount/writeContract.js.map +1 -0
  342. package/dist/_esm/clients/decorators/tokenPaymaster/getSupportedTokens.js +35 -0
  343. package/dist/_esm/clients/decorators/tokenPaymaster/getSupportedTokens.js.map +1 -0
  344. package/dist/_esm/clients/decorators/tokenPaymaster/getTokenPaymasterQuotes.js +70 -0
  345. package/dist/_esm/clients/decorators/tokenPaymaster/getTokenPaymasterQuotes.js.map +1 -0
  346. package/dist/_esm/clients/decorators/tokenPaymaster/index.js +63 -0
  347. package/dist/_esm/clients/decorators/tokenPaymaster/index.js.map +1 -0
  348. package/dist/_esm/clients/index.js +5 -0
  349. package/dist/_esm/clients/index.js.map +1 -0
  350. package/dist/_esm/constants/abi/AccountFactory.js +334 -0
  351. package/dist/_esm/constants/abi/AccountFactory.js.map +1 -0
  352. package/dist/_esm/constants/abi/AccountImplementationAbi.js +1176 -0
  353. package/dist/_esm/constants/abi/AccountImplementationAbi.js.map +1 -0
  354. package/dist/_esm/constants/abi/BootstrapAbi.js +727 -0
  355. package/dist/_esm/constants/abi/BootstrapAbi.js.map +1 -0
  356. package/dist/_esm/constants/abi/ComposabilityAbi.js +271 -0
  357. package/dist/_esm/constants/abi/ComposabilityAbi.js.map +1 -0
  358. package/dist/_esm/constants/abi/EIP1271Abi.js +28 -0
  359. package/dist/_esm/constants/abi/EIP1271Abi.js.map +1 -0
  360. package/dist/_esm/constants/abi/ERC7484RegistryAbi.js +14 -0
  361. package/dist/_esm/constants/abi/ERC7484RegistryAbi.js.map +1 -0
  362. package/dist/_esm/constants/abi/EntryPointABI.js +658 -0
  363. package/dist/_esm/constants/abi/EntryPointABI.js.map +1 -0
  364. package/dist/_esm/constants/abi/SmartSessionAbi.js +1469 -0
  365. package/dist/_esm/constants/abi/SmartSessionAbi.js.map +1 -0
  366. package/dist/_esm/constants/abi/TokenWithPermitAbi.js +619 -0
  367. package/dist/_esm/constants/abi/TokenWithPermitAbi.js.map +1 -0
  368. package/dist/_esm/constants/abi/UniActionPolicyAbi.js +59 -0
  369. package/dist/_esm/constants/abi/UniActionPolicyAbi.js.map +1 -0
  370. package/dist/_esm/constants/abi/UniswapSwapRouterAbi.js +483 -0
  371. package/dist/_esm/constants/abi/UniswapSwapRouterAbi.js.map +1 -0
  372. package/dist/_esm/constants/abi/index.js +11 -0
  373. package/dist/_esm/constants/abi/index.js.map +1 -0
  374. package/dist/_esm/constants/index.js +29 -0
  375. package/dist/_esm/constants/index.js.map +1 -0
  376. package/dist/_esm/index.js +12 -0
  377. package/dist/_esm/index.js.map +1 -0
  378. package/dist/_esm/modules/index.js +6 -0
  379. package/dist/_esm/modules/index.js.map +1 -0
  380. package/dist/_esm/modules/toEmptyExecutor.js +6 -0
  381. package/dist/_esm/modules/toEmptyExecutor.js.map +1 -0
  382. package/dist/_esm/modules/toEmptyHook.js +6 -0
  383. package/dist/_esm/modules/toEmptyHook.js.map +1 -0
  384. package/dist/_esm/modules/utils/Helpers.js +81 -0
  385. package/dist/_esm/modules/utils/Helpers.js.map +1 -0
  386. package/dist/_esm/modules/utils/Types.js +12 -0
  387. package/dist/_esm/modules/utils/Types.js.map +1 -0
  388. package/dist/_esm/modules/utils/Uid.js +11 -0
  389. package/dist/_esm/modules/utils/Uid.js.map +1 -0
  390. package/dist/_esm/modules/utils/composabilityCalls.js +127 -0
  391. package/dist/_esm/modules/utils/composabilityCalls.js.map +1 -0
  392. package/dist/_esm/modules/utils/index.js +6 -0
  393. package/dist/_esm/modules/utils/index.js.map +1 -0
  394. package/dist/_esm/modules/utils/runtimeAbiEncoding.js +365 -0
  395. package/dist/_esm/modules/utils/runtimeAbiEncoding.js.map +1 -0
  396. package/dist/_esm/modules/utils/toModule.js +61 -0
  397. package/dist/_esm/modules/utils/toModule.js.map +1 -0
  398. package/dist/_esm/modules/validators/default/index.js +2 -0
  399. package/dist/_esm/modules/validators/default/index.js.map +1 -0
  400. package/dist/_esm/modules/validators/default/toDefaultModule.js +14 -0
  401. package/dist/_esm/modules/validators/default/toDefaultModule.js.map +1 -0
  402. package/dist/_esm/modules/validators/index.js +6 -0
  403. package/dist/_esm/modules/validators/index.js.map +1 -0
  404. package/dist/_esm/modules/validators/ownable/decorators/addOwner.js +52 -0
  405. package/dist/_esm/modules/validators/ownable/decorators/addOwner.js.map +1 -0
  406. package/dist/_esm/modules/validators/ownable/decorators/getAddOwnerTx.js +50 -0
  407. package/dist/_esm/modules/validators/ownable/decorators/getAddOwnerTx.js.map +1 -0
  408. package/dist/_esm/modules/validators/ownable/decorators/getOwners.js +38 -0
  409. package/dist/_esm/modules/validators/ownable/decorators/getOwners.js.map +1 -0
  410. package/dist/_esm/modules/validators/ownable/decorators/getRemoveOwnerTx.js +46 -0
  411. package/dist/_esm/modules/validators/ownable/decorators/getRemoveOwnerTx.js.map +1 -0
  412. package/dist/_esm/modules/validators/ownable/decorators/getSetThresholdTx.js +48 -0
  413. package/dist/_esm/modules/validators/ownable/decorators/getSetThresholdTx.js.map +1 -0
  414. package/dist/_esm/modules/validators/ownable/decorators/getThreshold.js +54 -0
  415. package/dist/_esm/modules/validators/ownable/decorators/getThreshold.js.map +1 -0
  416. package/dist/_esm/modules/validators/ownable/decorators/index.js +57 -0
  417. package/dist/_esm/modules/validators/ownable/decorators/index.js.map +1 -0
  418. package/dist/_esm/modules/validators/ownable/decorators/multiSign.js +22 -0
  419. package/dist/_esm/modules/validators/ownable/decorators/multiSign.js.map +1 -0
  420. package/dist/_esm/modules/validators/ownable/decorators/prepareForMultiSign.js +21 -0
  421. package/dist/_esm/modules/validators/ownable/decorators/prepareForMultiSign.js.map +1 -0
  422. package/dist/_esm/modules/validators/ownable/decorators/removeOwner.js +63 -0
  423. package/dist/_esm/modules/validators/ownable/decorators/removeOwner.js.map +1 -0
  424. package/dist/_esm/modules/validators/ownable/decorators/setThreshold.js +62 -0
  425. package/dist/_esm/modules/validators/ownable/decorators/setThreshold.js.map +1 -0
  426. package/dist/_esm/modules/validators/ownable/index.js +3 -0
  427. package/dist/_esm/modules/validators/ownable/index.js.map +1 -0
  428. package/dist/_esm/modules/validators/ownable/toOwnableModule.js +38 -0
  429. package/dist/_esm/modules/validators/ownable/toOwnableModule.js.map +1 -0
  430. package/dist/_esm/modules/validators/smartSessionsValidator/Helpers.js +173 -0
  431. package/dist/_esm/modules/validators/smartSessionsValidator/Helpers.js.map +1 -0
  432. package/dist/_esm/modules/validators/smartSessionsValidator/Types.js +13 -0
  433. package/dist/_esm/modules/validators/smartSessionsValidator/Types.js.map +1 -0
  434. package/dist/_esm/modules/validators/smartSessionsValidator/decorators/grantPermission.js +79 -0
  435. package/dist/_esm/modules/validators/smartSessionsValidator/decorators/grantPermission.js.map +1 -0
  436. package/dist/_esm/modules/validators/smartSessionsValidator/decorators/index.js +40 -0
  437. package/dist/_esm/modules/validators/smartSessionsValidator/decorators/index.js.map +1 -0
  438. package/dist/_esm/modules/validators/smartSessionsValidator/decorators/preparePermission.js +191 -0
  439. package/dist/_esm/modules/validators/smartSessionsValidator/decorators/preparePermission.js.map +1 -0
  440. package/dist/_esm/modules/validators/smartSessionsValidator/decorators/usePermission.js +47 -0
  441. package/dist/_esm/modules/validators/smartSessionsValidator/decorators/usePermission.js.map +1 -0
  442. package/dist/_esm/modules/validators/smartSessionsValidator/index.js +5 -0
  443. package/dist/_esm/modules/validators/smartSessionsValidator/index.js.map +1 -0
  444. package/dist/_esm/modules/validators/smartSessionsValidator/toSmartSessionsValidator.js +82 -0
  445. package/dist/_esm/modules/validators/smartSessionsValidator/toSmartSessionsValidator.js.map +1 -0
  446. package/dist/_esm/modules/validators/toValidator.js +17 -0
  447. package/dist/_esm/modules/validators/toValidator.js.map +1 -0
  448. package/dist/_esm/package.json +1 -0
  449. package/dist/_types/account/decorators/getFactoryData.d.ts +25 -0
  450. package/dist/_types/account/decorators/getFactoryData.d.ts.map +1 -0
  451. package/dist/_types/account/decorators/getStartaleAccountAddress.d.ts +33 -0
  452. package/dist/_types/account/decorators/getStartaleAccountAddress.d.ts.map +1 -0
  453. package/dist/_types/account/decorators/index.d.ts +3 -0
  454. package/dist/_types/account/decorators/index.d.ts.map +1 -0
  455. package/dist/_types/account/index.d.ts +3 -0
  456. package/dist/_types/account/index.d.ts.map +1 -0
  457. package/dist/_types/account/toStartaleSmartAccount.d.ts +110 -0
  458. package/dist/_types/account/toStartaleSmartAccount.d.ts.map +1 -0
  459. package/dist/_types/account/utils/AccountNotFound.d.ts +10 -0
  460. package/dist/_types/account/utils/AccountNotFound.d.ts.map +1 -0
  461. package/dist/_types/account/utils/Constants.d.ts +73 -0
  462. package/dist/_types/account/utils/Constants.d.ts.map +1 -0
  463. package/dist/_types/account/utils/Helpers.d.ts +21 -0
  464. package/dist/_types/account/utils/Helpers.d.ts.map +1 -0
  465. package/dist/_types/account/utils/Logger.d.ts +20 -0
  466. package/dist/_types/account/utils/Logger.d.ts.map +1 -0
  467. package/dist/_types/account/utils/Types.d.ts +94 -0
  468. package/dist/_types/account/utils/Types.d.ts.map +1 -0
  469. package/dist/_types/account/utils/Utils.d.ts +129 -0
  470. package/dist/_types/account/utils/Utils.d.ts.map +1 -0
  471. package/dist/_types/account/utils/contractSimulation.d.ts +801 -0
  472. package/dist/_types/account/utils/contractSimulation.d.ts.map +1 -0
  473. package/dist/_types/account/utils/deepHexlify.d.ts +41 -0
  474. package/dist/_types/account/utils/deepHexlify.d.ts.map +1 -0
  475. package/dist/_types/account/utils/fromBundlerClient.d.ts +50 -0
  476. package/dist/_types/account/utils/fromBundlerClient.d.ts.map +1 -0
  477. package/dist/_types/account/utils/getAAError.d.ts +17 -0
  478. package/dist/_types/account/utils/getAAError.d.ts.map +1 -0
  479. package/dist/_types/account/utils/getChain.d.ts +64 -0
  480. package/dist/_types/account/utils/getChain.d.ts.map +1 -0
  481. package/dist/_types/account/utils/getVersion.d.ts +135 -0
  482. package/dist/_types/account/utils/getVersion.d.ts.map +1 -0
  483. package/dist/_types/account/utils/index.d.ts +19 -0
  484. package/dist/_types/account/utils/index.d.ts.map +1 -0
  485. package/dist/_types/account/utils/parseErrorMessage.d.ts +2 -0
  486. package/dist/_types/account/utils/parseErrorMessage.d.ts.map +1 -0
  487. package/dist/_types/account/utils/tenderlySimulation.d.ts +13 -0
  488. package/dist/_types/account/utils/tenderlySimulation.d.ts.map +1 -0
  489. package/dist/_types/account/utils/toInitData.d.ts +12 -0
  490. package/dist/_types/account/utils/toInitData.d.ts.map +1 -0
  491. package/dist/_types/account/utils/toInstallData.d.ts +8 -0
  492. package/dist/_types/account/utils/toInstallData.d.ts.map +1 -0
  493. package/dist/_types/account/utils/toSigner.d.ts +26 -0
  494. package/dist/_types/account/utils/toSigner.d.ts.map +1 -0
  495. package/dist/_types/clients/createHttpClient.d.ts +44 -0
  496. package/dist/_types/clients/createHttpClient.d.ts.map +1 -0
  497. package/dist/_types/clients/createSCSBundlerClient.d.ts +66 -0
  498. package/dist/_types/clients/createSCSBundlerClient.d.ts.map +1 -0
  499. package/dist/_types/clients/createSCSPaymasterClient.d.ts +71 -0
  500. package/dist/_types/clients/createSCSPaymasterClient.d.ts.map +1 -0
  501. package/dist/_types/clients/decorators/bundler/getGasFeeValues.d.ts +51 -0
  502. package/dist/_types/clients/decorators/bundler/getGasFeeValues.d.ts.map +1 -0
  503. package/dist/_types/clients/decorators/bundler/getUserOperationStatus.d.ts +17 -0
  504. package/dist/_types/clients/decorators/bundler/getUserOperationStatus.d.ts.map +1 -0
  505. package/dist/_types/clients/decorators/bundler/index.d.ts +61 -0
  506. package/dist/_types/clients/decorators/bundler/index.d.ts.map +1 -0
  507. package/dist/_types/clients/decorators/bundler/waitForConfirmedUserOperationReceipt.d.ts +8 -0
  508. package/dist/_types/clients/decorators/bundler/waitForConfirmedUserOperationReceipt.d.ts.map +1 -0
  509. package/dist/_types/clients/decorators/bundler/waitForUserOperationReceipt.d.ts +5 -0
  510. package/dist/_types/clients/decorators/bundler/waitForUserOperationReceipt.d.ts.map +1 -0
  511. package/dist/_types/clients/decorators/erc7579/accountId.d.ts +21 -0
  512. package/dist/_types/clients/decorators/erc7579/accountId.d.ts.map +1 -0
  513. package/dist/_types/clients/decorators/erc7579/getActiveHook.d.ts +35 -0
  514. package/dist/_types/clients/decorators/erc7579/getActiveHook.d.ts.map +1 -0
  515. package/dist/_types/clients/decorators/erc7579/getFallbackBySelector.d.ts +43 -0
  516. package/dist/_types/clients/decorators/erc7579/getFallbackBySelector.d.ts.map +1 -0
  517. package/dist/_types/clients/decorators/erc7579/getInstalledExecutors.d.ts +52 -0
  518. package/dist/_types/clients/decorators/erc7579/getInstalledExecutors.d.ts.map +1 -0
  519. package/dist/_types/clients/decorators/erc7579/getInstalledValidators.d.ts +52 -0
  520. package/dist/_types/clients/decorators/erc7579/getInstalledValidators.d.ts.map +1 -0
  521. package/dist/_types/clients/decorators/erc7579/getPreviousModule.d.ts +32 -0
  522. package/dist/_types/clients/decorators/erc7579/getPreviousModule.d.ts.map +1 -0
  523. package/dist/_types/clients/decorators/erc7579/index.d.ts +165 -0
  524. package/dist/_types/clients/decorators/erc7579/index.d.ts.map +1 -0
  525. package/dist/_types/clients/decorators/erc7579/installModule.d.ts +36 -0
  526. package/dist/_types/clients/decorators/erc7579/installModule.d.ts.map +1 -0
  527. package/dist/_types/clients/decorators/erc7579/installModules.d.ts +36 -0
  528. package/dist/_types/clients/decorators/erc7579/installModules.d.ts.map +1 -0
  529. package/dist/_types/clients/decorators/erc7579/isModuleInstalled.d.ts +54 -0
  530. package/dist/_types/clients/decorators/erc7579/isModuleInstalled.d.ts.map +1 -0
  531. package/dist/_types/clients/decorators/erc7579/supportsExecutionMode.d.ts +54 -0
  532. package/dist/_types/clients/decorators/erc7579/supportsExecutionMode.d.ts.map +1 -0
  533. package/dist/_types/clients/decorators/erc7579/supportsModule.d.ts +48 -0
  534. package/dist/_types/clients/decorators/erc7579/supportsModule.d.ts.map +1 -0
  535. package/dist/_types/clients/decorators/erc7579/uninstallFallback.d.ts +35 -0
  536. package/dist/_types/clients/decorators/erc7579/uninstallFallback.d.ts.map +1 -0
  537. package/dist/_types/clients/decorators/erc7579/uninstallModule.d.ts +35 -0
  538. package/dist/_types/clients/decorators/erc7579/uninstallModule.d.ts.map +1 -0
  539. package/dist/_types/clients/decorators/erc7579/uninstallModules.d.ts +32 -0
  540. package/dist/_types/clients/decorators/erc7579/uninstallModules.d.ts.map +1 -0
  541. package/dist/_types/clients/decorators/index.d.ts +5 -0
  542. package/dist/_types/clients/decorators/index.d.ts.map +1 -0
  543. package/dist/_types/clients/decorators/smartAccount/debugUserOperation.d.ts +35 -0
  544. package/dist/_types/clients/decorators/smartAccount/debugUserOperation.d.ts.map +1 -0
  545. package/dist/_types/clients/decorators/smartAccount/index.d.ts +315 -0
  546. package/dist/_types/clients/decorators/smartAccount/index.d.ts.map +1 -0
  547. package/dist/_types/clients/decorators/smartAccount/prepareTokenPaymasterUserOp.d.ts +51 -0
  548. package/dist/_types/clients/decorators/smartAccount/prepareTokenPaymasterUserOp.d.ts.map +1 -0
  549. package/dist/_types/clients/decorators/smartAccount/prepareUserOperationWithoutSignature.d.ts +16 -0
  550. package/dist/_types/clients/decorators/smartAccount/prepareUserOperationWithoutSignature.d.ts.map +1 -0
  551. package/dist/_types/clients/decorators/smartAccount/sendTokenPaymasterUserOp.d.ts +36 -0
  552. package/dist/_types/clients/decorators/smartAccount/sendTokenPaymasterUserOp.d.ts.map +1 -0
  553. package/dist/_types/clients/decorators/smartAccount/sendTransaction.d.ts +23 -0
  554. package/dist/_types/clients/decorators/smartAccount/sendTransaction.d.ts.map +1 -0
  555. package/dist/_types/clients/decorators/smartAccount/signMessage.d.ts +23 -0
  556. package/dist/_types/clients/decorators/smartAccount/signMessage.d.ts.map +1 -0
  557. package/dist/_types/clients/decorators/smartAccount/signTypedData.d.ts +60 -0
  558. package/dist/_types/clients/decorators/smartAccount/signTypedData.d.ts.map +1 -0
  559. package/dist/_types/clients/decorators/smartAccount/upgradeSmartAccount.d.ts +40 -0
  560. package/dist/_types/clients/decorators/smartAccount/upgradeSmartAccount.d.ts.map +1 -0
  561. package/dist/_types/clients/decorators/smartAccount/waitForTransactionReceipt.d.ts +6 -0
  562. package/dist/_types/clients/decorators/smartAccount/waitForTransactionReceipt.d.ts.map +1 -0
  563. package/dist/_types/clients/decorators/smartAccount/writeContract.d.ts +27 -0
  564. package/dist/_types/clients/decorators/smartAccount/writeContract.d.ts.map +1 -0
  565. package/dist/_types/clients/decorators/tokenPaymaster/getSupportedTokens.d.ts +16 -0
  566. package/dist/_types/clients/decorators/tokenPaymaster/getSupportedTokens.d.ts.map +1 -0
  567. package/dist/_types/clients/decorators/tokenPaymaster/getTokenPaymasterQuotes.d.ts +88 -0
  568. package/dist/_types/clients/decorators/tokenPaymaster/getTokenPaymasterQuotes.d.ts.map +1 -0
  569. package/dist/_types/clients/decorators/tokenPaymaster/index.d.ts +65 -0
  570. package/dist/_types/clients/decorators/tokenPaymaster/index.d.ts.map +1 -0
  571. package/dist/_types/clients/index.d.ts +5 -0
  572. package/dist/_types/clients/index.d.ts.map +1 -0
  573. package/dist/_types/constants/abi/AccountFactory.d.ts +259 -0
  574. package/dist/_types/constants/abi/AccountFactory.d.ts.map +1 -0
  575. package/dist/_types/constants/abi/AccountImplementationAbi.d.ts +903 -0
  576. package/dist/_types/constants/abi/AccountImplementationAbi.d.ts.map +1 -0
  577. package/dist/_types/constants/abi/BootstrapAbi.d.ts +554 -0
  578. package/dist/_types/constants/abi/BootstrapAbi.d.ts.map +1 -0
  579. package/dist/_types/constants/abi/ComposabilityAbi.d.ts +67 -0
  580. package/dist/_types/constants/abi/ComposabilityAbi.d.ts.map +1 -0
  581. package/dist/_types/constants/abi/EIP1271Abi.d.ts +54 -0
  582. package/dist/_types/constants/abi/EIP1271Abi.d.ts.map +1 -0
  583. package/dist/_types/constants/abi/ERC7484RegistryAbi.d.ts +16 -0
  584. package/dist/_types/constants/abi/ERC7484RegistryAbi.d.ts.map +1 -0
  585. package/dist/_types/constants/abi/EntryPointABI.d.ts +776 -0
  586. package/dist/_types/constants/abi/EntryPointABI.d.ts.map +1 -0
  587. package/dist/_types/constants/abi/SmartSessionAbi.d.ts +90 -0
  588. package/dist/_types/constants/abi/SmartSessionAbi.d.ts.map +1 -0
  589. package/dist/_types/constants/abi/TokenWithPermitAbi.d.ts +477 -0
  590. package/dist/_types/constants/abi/TokenWithPermitAbi.d.ts.map +1 -0
  591. package/dist/_types/constants/abi/UniActionPolicyAbi.d.ts +33 -0
  592. package/dist/_types/constants/abi/UniActionPolicyAbi.d.ts.map +1 -0
  593. package/dist/_types/constants/abi/UniswapSwapRouterAbi.d.ts +821 -0
  594. package/dist/_types/constants/abi/UniswapSwapRouterAbi.d.ts.map +1 -0
  595. package/dist/_types/constants/abi/index.d.ts +11 -0
  596. package/dist/_types/constants/abi/index.d.ts.map +1 -0
  597. package/dist/_types/constants/index.d.ts +16 -0
  598. package/dist/_types/constants/index.d.ts.map +1 -0
  599. package/dist/_types/index.d.ts +7 -0
  600. package/dist/_types/index.d.ts.map +1 -0
  601. package/dist/_types/modules/index.d.ts +6 -0
  602. package/dist/_types/modules/index.d.ts.map +1 -0
  603. package/dist/_types/modules/toEmptyExecutor.d.ts +3 -0
  604. package/dist/_types/modules/toEmptyExecutor.d.ts.map +1 -0
  605. package/dist/_types/modules/toEmptyHook.d.ts +3 -0
  606. package/dist/_types/modules/toEmptyHook.d.ts.map +1 -0
  607. package/dist/_types/modules/utils/Helpers.d.ts +48 -0
  608. package/dist/_types/modules/utils/Helpers.d.ts.map +1 -0
  609. package/dist/_types/modules/utils/Types.d.ts +103 -0
  610. package/dist/_types/modules/utils/Types.d.ts.map +1 -0
  611. package/dist/_types/modules/utils/Uid.d.ts +2 -0
  612. package/dist/_types/modules/utils/Uid.d.ts.map +1 -0
  613. package/dist/_types/modules/utils/composabilityCalls.d.ts +63 -0
  614. package/dist/_types/modules/utils/composabilityCalls.d.ts.map +1 -0
  615. package/dist/_types/modules/utils/index.d.ts +6 -0
  616. package/dist/_types/modules/utils/index.d.ts.map +1 -0
  617. package/dist/_types/modules/utils/runtimeAbiEncoding.d.ts +18 -0
  618. package/dist/_types/modules/utils/runtimeAbiEncoding.d.ts.map +1 -0
  619. package/dist/_types/modules/utils/toModule.d.ts +28 -0
  620. package/dist/_types/modules/utils/toModule.d.ts.map +1 -0
  621. package/dist/_types/modules/validators/default/index.d.ts +2 -0
  622. package/dist/_types/modules/validators/default/index.d.ts.map +1 -0
  623. package/dist/_types/modules/validators/default/toDefaultModule.d.ts +3 -0
  624. package/dist/_types/modules/validators/default/toDefaultModule.d.ts.map +1 -0
  625. package/dist/_types/modules/validators/index.d.ts +6 -0
  626. package/dist/_types/modules/validators/index.d.ts.map +1 -0
  627. package/dist/_types/modules/validators/ownable/decorators/addOwner.d.ts +36 -0
  628. package/dist/_types/modules/validators/ownable/decorators/addOwner.d.ts.map +1 -0
  629. package/dist/_types/modules/validators/ownable/decorators/getAddOwnerTx.d.ts +30 -0
  630. package/dist/_types/modules/validators/ownable/decorators/getAddOwnerTx.d.ts.map +1 -0
  631. package/dist/_types/modules/validators/ownable/decorators/getOwners.d.ts +25 -0
  632. package/dist/_types/modules/validators/ownable/decorators/getOwners.d.ts.map +1 -0
  633. package/dist/_types/modules/validators/ownable/decorators/getRemoveOwnerTx.d.ts +30 -0
  634. package/dist/_types/modules/validators/ownable/decorators/getRemoveOwnerTx.d.ts.map +1 -0
  635. package/dist/_types/modules/validators/ownable/decorators/getSetThresholdTx.d.ts +39 -0
  636. package/dist/_types/modules/validators/ownable/decorators/getSetThresholdTx.d.ts.map +1 -0
  637. package/dist/_types/modules/validators/ownable/decorators/getThreshold.d.ts +40 -0
  638. package/dist/_types/modules/validators/ownable/decorators/getThreshold.d.ts.map +1 -0
  639. package/dist/_types/modules/validators/ownable/decorators/index.d.ts +37 -0
  640. package/dist/_types/modules/validators/ownable/decorators/index.d.ts.map +1 -0
  641. package/dist/_types/modules/validators/ownable/decorators/multiSign.d.ts +11 -0
  642. package/dist/_types/modules/validators/ownable/decorators/multiSign.d.ts.map +1 -0
  643. package/dist/_types/modules/validators/ownable/decorators/prepareForMultiSign.d.ts +25 -0
  644. package/dist/_types/modules/validators/ownable/decorators/prepareForMultiSign.d.ts.map +1 -0
  645. package/dist/_types/modules/validators/ownable/decorators/removeOwner.d.ts +47 -0
  646. package/dist/_types/modules/validators/ownable/decorators/removeOwner.d.ts.map +1 -0
  647. package/dist/_types/modules/validators/ownable/decorators/setThreshold.d.ts +51 -0
  648. package/dist/_types/modules/validators/ownable/decorators/setThreshold.d.ts.map +1 -0
  649. package/dist/_types/modules/validators/ownable/index.d.ts +3 -0
  650. package/dist/_types/modules/validators/ownable/index.d.ts.map +1 -0
  651. package/dist/_types/modules/validators/ownable/toOwnableModule.d.ts +44 -0
  652. package/dist/_types/modules/validators/ownable/toOwnableModule.d.ts.map +1 -0
  653. package/dist/_types/modules/validators/smartSessionsValidator/Helpers.d.ts +110 -0
  654. package/dist/_types/modules/validators/smartSessionsValidator/Helpers.d.ts.map +1 -0
  655. package/dist/_types/modules/validators/smartSessionsValidator/Types.d.ts +223 -0
  656. package/dist/_types/modules/validators/smartSessionsValidator/Types.d.ts.map +1 -0
  657. package/dist/_types/modules/validators/smartSessionsValidator/decorators/grantPermission.d.ts +73 -0
  658. package/dist/_types/modules/validators/smartSessionsValidator/decorators/grantPermission.d.ts.map +1 -0
  659. package/dist/_types/modules/validators/smartSessionsValidator/decorators/index.d.ts +70 -0
  660. package/dist/_types/modules/validators/smartSessionsValidator/decorators/index.d.ts.map +1 -0
  661. package/dist/_types/modules/validators/smartSessionsValidator/decorators/preparePermission.d.ts +81 -0
  662. package/dist/_types/modules/validators/smartSessionsValidator/decorators/preparePermission.d.ts.map +1 -0
  663. package/dist/_types/modules/validators/smartSessionsValidator/decorators/usePermission.d.ts +63 -0
  664. package/dist/_types/modules/validators/smartSessionsValidator/decorators/usePermission.d.ts.map +1 -0
  665. package/dist/_types/modules/validators/smartSessionsValidator/index.d.ts +5 -0
  666. package/dist/_types/modules/validators/smartSessionsValidator/index.d.ts.map +1 -0
  667. package/dist/_types/modules/validators/smartSessionsValidator/toSmartSessionsValidator.d.ts +65 -0
  668. package/dist/_types/modules/validators/smartSessionsValidator/toSmartSessionsValidator.d.ts.map +1 -0
  669. package/dist/_types/modules/validators/toValidator.d.ts +45 -0
  670. package/dist/_types/modules/validators/toValidator.d.ts.map +1 -0
  671. package/package.json +134 -0
@@ -0,0 +1,191 @@
1
+ import { getUniversalActionPolicy } from "@rhinestone/module-sdk";
2
+ import { getPermissionId } from "@rhinestone/module-sdk";
3
+ import { encodeFunctionData, parseAccount } from "viem/utils";
4
+ import { ERROR_MESSAGES } from "../../../../account/index.js";
5
+ import { AccountNotFoundError } from "../../../../account/utils/AccountNotFound.js";
6
+ import { OWNABLE_VALIDATOR_ADDRESS, SMART_SESSIONS_ADDRESS, encodeValidationData, getSpendingLimitsPolicy, getSudoPolicy, getUsageLimitPolicy, getValueLimitPolicy } from "../../../../constants/index.js";
7
+ import { SmartSessionAbi } from "../../../../constants/abi/SmartSessionAbi.js";
8
+ import { abiToPoliciesInfo, applyDefaults, createActionConfig, createActionData, generateSalt, toActionConfig } from "../Helpers.js";
9
+ export const ONE_YEAR_FROM_NOW_IN_SECONDS = Date.now() + 60 * 60 * 24 * 365;
10
+ /**
11
+ * Generates the action data for creating sessions in the SmartSessionValidator.
12
+ *
13
+ * @param sessionRequestedInfo - Array of session data parameters.
14
+ * @param client - The public client for blockchain interactions.
15
+ * @returns A promise that resolves to the action data and permission IDs, or an Error.
16
+ */
17
+ export const getPermissionAction = async ({ chainId, sessionRequestedInfo, withPaymaster = false }) => {
18
+ const sessions = [];
19
+ const permissionIds = [];
20
+ const resolvedPolicyInfo2ActionData = (actionPolicyInfo) => {
21
+ const policyData = [];
22
+ // create time frame policy here..
23
+ // const timeFramePolicy = getTimeFramePolicy({
24
+ // validUntil: actionPolicyInfo.validUntil ?? ONE_YEAR_FROM_NOW_IN_SECONDS,
25
+ // validAfter: actionPolicyInfo.validAfter ?? 0
26
+ // })
27
+ // Todo: Get TimeFramePolicy audited and deploy on Soneium
28
+ // Note: currently this throws UnsupportedPolicy
29
+ // policyData.push(timeFramePolicy)
30
+ const hasValidRules = actionPolicyInfo?.rules && actionPolicyInfo?.rules?.length > 0;
31
+ if (hasValidRules) {
32
+ const actionConfig = createActionConfig(actionPolicyInfo.rules ?? [], actionPolicyInfo.valueLimit);
33
+ // create uni action policy here..
34
+ const uniActionPolicyInfo = getUniversalActionPolicy(toActionConfig(actionConfig));
35
+ policyData.push(uniActionPolicyInfo);
36
+ }
37
+ // create sudo policy here..
38
+ if (actionPolicyInfo.sudo || !hasValidRules) {
39
+ const sudoPolicy = getSudoPolicy();
40
+ policyData.push(sudoPolicy);
41
+ }
42
+ // create value limit policy here..
43
+ if (actionPolicyInfo.valueLimit) {
44
+ const valueLimitPolicy = getValueLimitPolicy({
45
+ limit: actionPolicyInfo.valueLimit
46
+ });
47
+ policyData.push(valueLimitPolicy);
48
+ }
49
+ // create usage limit policy here..
50
+ if (actionPolicyInfo.usageLimit) {
51
+ const usageLimitPolicy = getUsageLimitPolicy({
52
+ limit: actionPolicyInfo.usageLimit
53
+ });
54
+ policyData.push(usageLimitPolicy);
55
+ }
56
+ // create token spending limit policy here..
57
+ if (actionPolicyInfo.tokenLimits?.length) {
58
+ const spendingLimitPolicy = getSpendingLimitsPolicy(actionPolicyInfo.tokenLimits);
59
+ policyData.push(spendingLimitPolicy);
60
+ }
61
+ // Create ActionData
62
+ const actionPolicy = createActionData(actionPolicyInfo.contractAddress, actionPolicyInfo.functionSelector, policyData);
63
+ return actionPolicy;
64
+ };
65
+ // Start populating the session for each param provided
66
+ for (const sessionInfo of sessionRequestedInfo) {
67
+ const actionPolicies = [];
68
+ for (const actionPolicyInfo of sessionInfo.actionPoliciesInfo ?? []) {
69
+ if (actionPolicyInfo.abi) {
70
+ // Resolve the abi to multiple function selectors...
71
+ const resolvedPolicyInfos = abiToPoliciesInfo(actionPolicyInfo);
72
+ const actionPolicies_ = resolvedPolicyInfos.map(resolvedPolicyInfo2ActionData);
73
+ actionPolicies.push(...actionPolicies_);
74
+ }
75
+ else {
76
+ const actionPolicy = resolvedPolicyInfo2ActionData(actionPolicyInfo);
77
+ actionPolicies.push(actionPolicy);
78
+ }
79
+ }
80
+ const userOpPolicies = withPaymaster ? [getSudoPolicy()] : [];
81
+ const session = {
82
+ chainId: BigInt(chainId),
83
+ permitERC4337Paymaster: withPaymaster,
84
+ sessionValidator: OWNABLE_VALIDATOR_ADDRESS,
85
+ sessionValidatorInitData: encodeValidationData({
86
+ threshold: 1,
87
+ owners: [sessionInfo.sessionKeyData]
88
+ }),
89
+ salt: sessionInfo.salt ?? generateSalt(),
90
+ userOpPolicies,
91
+ actions: actionPolicies,
92
+ erc7739Policies: {
93
+ allowedERC7739Content: [],
94
+ erc1271Policies: []
95
+ }
96
+ };
97
+ const permissionId = getPermissionId({
98
+ session
99
+ });
100
+ // push permissionId to the array
101
+ permissionIds.push(permissionId);
102
+ // Push to sessions array
103
+ sessions.push(session);
104
+ }
105
+ const preparePermissionData = encodeFunctionData({
106
+ abi: SmartSessionAbi,
107
+ functionName: "enableSessions",
108
+ args: [sessions]
109
+ });
110
+ return {
111
+ action: {
112
+ target: SMART_SESSIONS_ADDRESS,
113
+ value: BigInt(0),
114
+ callData: preparePermissionData
115
+ },
116
+ permissionIds: permissionIds,
117
+ sessions
118
+ };
119
+ };
120
+ /**
121
+ * Adds multiple sessions to the SmartSessionValidator module of a given smart account.
122
+ *
123
+ * This function prepares and sends a user operation to create multiple sessions
124
+ * for the specified modular smart account. Each session can have its own policies
125
+ * and permissions.
126
+ *
127
+ * @template TModularSmartAccount - Type of the modular smart account, extending ModularSmartAccount or undefined.
128
+ * @param client - The client used to interact with the blockchain.
129
+ * @param parameters - Parameters including the smart account, required session specific policies info, and optional gas settings.
130
+ * @returns A promise that resolves to an object containing the user operation hash and an array of permission IDs.
131
+ *
132
+ * @throws {AccountNotFoundError} If the account is not found.
133
+ * @throws {Error} If there's an error getting the enable sessions action.
134
+ *
135
+ * @example
136
+ * ```typescript
137
+ * import { preparePermission } from '@startale-scs/aa-sdk'
138
+ *
139
+ * const result = await preparePermission(startaleClient, {
140
+ * sessionRequestedInfo: [
141
+ * {
142
+ * sessionKeyData: '0x...',
143
+ * actionPoliciesInfo: [
144
+ * {
145
+ * contractAddress: '0x...',
146
+ * functionSelector: '0x...',
147
+ * rules: [...],
148
+ * valueLimit: 1000000000000000000n
149
+ * }
150
+ * ],
151
+ * sessionValidUntil: 1234567890
152
+ * }
153
+ * ]
154
+ * });
155
+ * console.log(result.userOpHash); // '0x...'
156
+ * console.log(result.permissionIds); // ['0x...', '0x...']
157
+ * ```
158
+ *
159
+ * @remarks
160
+ * - Ensure that the client has sufficient gas to cover the transaction.
161
+ * - The number of sessions created is determined by the length of the `sessionRequestedInfo` array.
162
+ * - Each session's policies and permissions are determined by the `actionPoliciesInfo` provided.
163
+ */
164
+ export async function preparePermission(client, parameters) {
165
+ const { publicClient: publicClient_ = client.account?.client, account: account_ = client.account, sessionRequestedInfo } = parameters;
166
+ if (!account_) {
167
+ throw new AccountNotFoundError({
168
+ docsPath: "/startale-client/methods#sendtransaction"
169
+ });
170
+ }
171
+ const account = parseAccount(account_);
172
+ if (!account || !account.address) {
173
+ throw new Error("Account not found");
174
+ }
175
+ const withPaymaster = !!client?.paymaster;
176
+ const chainId = publicClient_?.chain?.id;
177
+ if (!chainId) {
178
+ throw new Error(ERROR_MESSAGES.CHAIN_NOT_FOUND);
179
+ }
180
+ const defaultedSessionRequestedInfo = sessionRequestedInfo.map(applyDefaults);
181
+ const actionResponse = await getPermissionAction({
182
+ chainId,
183
+ sessionRequestedInfo: defaultedSessionRequestedInfo,
184
+ withPaymaster
185
+ });
186
+ if (actionResponse instanceof Error) {
187
+ throw actionResponse;
188
+ }
189
+ return actionResponse;
190
+ }
191
+ //# sourceMappingURL=preparePermission.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preparePermission.js","sourceRoot":"","sources":["../../../../../../src/sdk/modules/validators/smartSessionsValidator/decorators/preparePermission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAEL,yBAAyB,EAEzB,sBAAsB,EAEtB,oBAAoB,EACpB,uBAAuB,EACvB,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAA;AAE3E,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACf,MAAM,YAAY,CAAA;AAQnB,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAA;AAwB3E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EAAE,EACxC,OAAO,EACP,oBAAoB,EACpB,aAAa,GAAG,KAAK,EAKtB,EAA8C,EAAE;IAC/C,MAAM,QAAQ,GAAc,EAAE,C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C,CAAA;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAwB,CAAA;IAC7D,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;IACtC,CAAC;IAED,MAAM,aAAa,GAAG,CAAC,CAAE,MAAkB,EAAE,SAAS,CAAA;IACtD,MAAM,OAAO,GAAG,aAAa,EAAE,KAAK,EAAE,EAAE,CAAA;IAExC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAA;IACjD,CAAC;IAED,MAAM,6BAA6B,GAAG,oBAAoB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;IAE7E,MAAM,cAAc,GAAG,MAAM,mBAAmB,CAAC;QAC/C,OAAO;QACP,oBAAoB,EAAE,6BAA6B;QACnD,aAAa;KACd,CAAC,CAAA;IAEF,IAAI,cAAc,YAAY,KAAK,EAAE,CAAC;QACpC,MAAM,cAAc,CAAA;IACtB,CAAC;IAED,OAAO,cAAc,CAAA;AACvB,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { sendUserOperation } from "viem/account-abstraction";
2
+ import { getAction } from "viem/utils";
3
+ import { AccountNotFoundError } from "../../../../account/utils/AccountNotFound.js";
4
+ /**
5
+ * Executes actions using a smart session.
6
+ *
7
+ * This function allows for the execution of one or more actions within an enabled smart session.
8
+ * It can handle batch transactions if the session is configured for multiple actions.
9
+ *
10
+ * @template TModularSmartAccount - Type of the modular smart account, extending ModularSmartAccount or undefined.
11
+ * @param client - The client used to interact with the blockchain.
12
+ * @param parameters - Parameters for using the session, including actions to execute and optional gas settings.
13
+ * @returns A promise that resolves to the hash of the sent user operation.
14
+ *
15
+ * @throws {AccountNotFoundError} If no account is provided and the client doesn't have an associated account.
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * const result = await usePermission(startaleClient, {
20
+ * calls: [
21
+ * {
22
+ * to: '0x1234...',
23
+ * data: '0xabcdef...'
24
+ * }
25
+ * ],
26
+ * maxFeePerGas: 1000000000n
27
+ * });
28
+ * console.log(`Transaction hash: ${result}`);
29
+ * ```
30
+ *
31
+ * @remarks
32
+ * - Ensure that the session is enabled and has the necessary permissions for the actions being executed.
33
+ * - For batch transactions, all actions must be permitted within the same session.
34
+ * - The function uses the `sendUserOperation` method, which is specific to account abstraction implementations.
35
+ */
36
+ export async function usePermission(client, parameters) {
37
+ const { account: account_ = client.account } = parameters;
38
+ if (!account_) {
39
+ throw new AccountNotFoundError({
40
+ docsPath: "/startale-client/methods#sendtransaction"
41
+ });
42
+ }
43
+ return await getAction(client, sendUserOperation, "sendUserOperation"
44
+ // @ts-ignore
45
+ )(parameters);
46
+ }
47
+ //# sourceMappingURL=usePermission.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePermission.js","sourceRoot":"","sources":["../../../../../../src/sdk/modules/validators/smartSessionsValidator/decorators/usePermission.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAiChF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAGjC,MAAkE,EAClE,UAAyD;IAEzD,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,UAAU,CAAA;IAEzD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,oBAAoB,CAAC;YAC7B,QAAQ,EAAE,0CAA0C;SACrD,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,MAAM,SAAS,CACpB,MAAM,EACN,iBAAiB,EACjB,mBAAmB;IACnB,aAAa;KACd,CAAC,UAAU,CAAC,CAAA;AACf,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from "./decorators/index.js";
2
+ export * from "./toSmartSessionsValidator.js";
3
+ export * from "./Helpers.js";
4
+ export * from "./Types.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/sdk/modules/validators/smartSessionsValidator/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA"}
@@ -0,0 +1,82 @@
1
+ import { encodePacked } from "viem";
2
+ import { SMART_SESSIONS_ADDRESS, SmartSessionMode, encodeSmartSessionSignature, getOwnableValidatorMockSignature, getSmartSessionsValidator } from "../../../constants/index.js";
3
+ import { toModule } from "../../utils/toModule.js";
4
+ export const DUMMY_ECDSA_SIG = "0xe8b94748580ca0b4993c9a1b86b5be851bfc076ff5ce3a1ff65bf16392acfcb800f9b4f1aef1555c7fce5599fffb17e7c635502154a0333ba21f3ae491839af51c";
5
+ /**
6
+ * Gets the initialization data for a Use Session module.
7
+ *
8
+ * @param _ - Optional arguments (currently unused).
9
+ * @returns The module metadata including address, type, and initialization data.
10
+ */
11
+ export const getUsePermissionModuleInitData = (_) => ({
12
+ address: SMART_SESSIONS_ADDRESS,
13
+ type: "validator",
14
+ initData: "0x"
15
+ });
16
+ /**
17
+ * Gets the initialization data for a Use Session.
18
+ *
19
+ * @param signerAddress - The address of the signer for the session.
20
+ * @returns The encoded initialization data as a hexadecimal string.
21
+ */
22
+ export const getUsePermissionInitData = ({ signerAddress }) => encodePacked(["address"], [signerAddress]);
23
+ /**
24
+ * Creates a Smart Sessions module for a modular smart account.
25
+ *
26
+ * This function sets up a Smart Sessions module with the specified parameters,
27
+ * including session mode, permission ID, and session data.
28
+ *
29
+ * @param parameters - The parameters for creating the Smart Sessions module.
30
+ * @returns A Module object representing the created Smart Sessions module.
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * const smartSessionsModule = toSmartSessionsValidator({
35
+ * account: mySmartAccount,
36
+ * signer: mySigner,
37
+ * moduleData: {
38
+ * permissionId: '0x1234...',
39
+ * mode: SmartSessionMode.USE,
40
+ * enableSessionData: '0x5678...'
41
+ * }
42
+ * });
43
+ * ```
44
+ *
45
+ * @remarks
46
+ * - The function generates stub signatures and can sign user operation hashes.
47
+ * - It uses the SmartSession address from the predefined addresses.
48
+ * - The default session mode is USE if not specified.
49
+ */
50
+ export const toSmartSessionsValidator = (parameters) => {
51
+ const { account, signer, moduleInitData: moduleInitData_, deInitData = "0x", initData: initData_, initArgs: initArgs_ = { signerAddress: signer.address }, moduleData: { permissionIdIndex = 0, permissionIds = [], mode = SmartSessionMode.USE, enableSessionData } = {} } = parameters;
52
+ const initData = initData_ ?? getUsePermissionInitData(initArgs_);
53
+ const moduleInitData = moduleInitData_ ?? getSmartSessionsValidator({ useRegistry: false });
54
+ return toModule({
55
+ ...parameters,
56
+ signer,
57
+ accountAddress: account.address,
58
+ address: SMART_SESSIONS_ADDRESS,
59
+ initData,
60
+ moduleInitData,
61
+ deInitData,
62
+ getStubSignature: async () => encodeSmartSessionSignature({
63
+ mode,
64
+ permissionId: permissionIds[permissionIdIndex],
65
+ enableSessionData,
66
+ signature: getOwnableValidatorMockSignature({
67
+ threshold: 1
68
+ })
69
+ }),
70
+ signUserOpHash: async (userOpHash) => {
71
+ return encodeSmartSessionSignature({
72
+ mode,
73
+ permissionId: permissionIds[permissionIdIndex],
74
+ enableSessionData,
75
+ signature: await signer.signMessage({
76
+ message: { raw: userOpHash }
77
+ })
78
+ });
79
+ }
80
+ });
81
+ };
82
+ //# sourceMappingURL=toSmartSessionsValidator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toSmartSessionsValidator.js","sourceRoot":"","sources":["../../../../../src/sdk/modules/validators/smartSessionsValidator/toSmartSessionsValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,YAAY,EA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C;QACd,GAAG,UAAU;QACb,MAAM;QACN,cAAc,EAAE,OAAO,CAAC,OAAO;QAC/B,OAAO,EAAE,sBAAsB;QAC/B,QAAQ;QACR,cAAc;QACd,UAAU;QACV,gBAAgB,EAAE,KAAK,IAAI,EAAE,CAC3B,2BAA2B,CAAC;YAC1B,IAAI;YACJ,YAAY,EAAE,aAAa,CAAC,iBAAiB,CAAC;YAC9C,iBAAiB;YACjB,SAAS,EAAE,gCAAgC,CAAC;gBAC1C,SAAS,EAAE,CAAC;aACb,CAAC;SACH,CAAC;QACJ,cAAc,EAAE,KAAK,EAAE,UAAe,EAAE,EAAE;YACxC,OAAO,2BAA2B,CAAC;gBACjC,IAAI;gBACJ,YAAY,EAAE,aAAa,CAAC,iBAAiB,CAAC;gBAC9C,iBAAiB;gBACjB,SAAS,EAAE,MAAM,MAAM,CAAC,WAAW,CAAC;oBAClC,OAAO,EAAE,EAAE,GAAG,EAAE,UAAiB,EAAE;iBACpC,CAAC;aACH,CAAC,CAAA;QACJ,CAAC;KACF,CAAuB,CAAA;AAC1B,CAAC,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { DUMMY_SIGNATURE } from "../index.js";
2
+ export const toValidator = (parameters) => {
3
+ const { deInitData = "0x", type = "validator", signer, data = "0x", module, ...rest } = parameters;
4
+ return {
5
+ deInitData,
6
+ data,
7
+ module,
8
+ address: module,
9
+ signer,
10
+ type,
11
+ getStubSignature: async () => DUMMY_SIGNATURE,
12
+ signUserOpHash: async (userOpHash) => await signer.signMessage({ message: { raw: userOpHash } }),
13
+ signMessage: async (message) => await signer.signMessage({ message }),
14
+ ...rest
15
+ };
16
+ };
17
+ //# sourceMappingURL=toValidator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toValidator.js","sourceRoot":"","sources":["../../../../src/sdk/modules/validators/toValidator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAA;AAuDpC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,UAA+B,EAAa,EAAE;IACxE,MAAM,EACJ,UAAU,GAAG,IAAI,EACjB,IAAI,GAAG,WAAW,EAClB,MAAM,EACN,IAAI,GAAG,IAAI,EACX,MAAM,EACN,GAAG,IAAI,EACR,GAAG,UAAU,CAAA;IAEd,OAAO;QACL,UAAU;QACV,IAAI;QACJ,MAAM;QACN,OAAO,EAAE,MAAM;QACf,MAAM;QACN,IAAI;QACJ,gBAAgB,EAAE,KAAK,IAAI,EAAE,CAAC,eAAe;QAC7C,cAAc,EAAE,KAAK,EAAE,UAAe,EAAE,EAAE,CACxC,MAAM,MAAM,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,CAAC;QAC5D,WAAW,EAAE,KAAK,EAAE,OAAwB,EAAE,EAAE,CAC9C,MAAM,MAAM,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC;QACvC,GAAG,IAAI;KACR,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ {"type": "module","sideEffects":false}
@@ -0,0 +1,25 @@
1
+ import { type Address, type Hex } from "viem";
2
+ import type { GenericModuleConfig, PrevalidationHookModuleConfig } from "../toStartaleSmartAccount";
3
+ export type GetFactoryDataParams = {
4
+ /** Hex string of the validator init data */
5
+ initData: Hex;
6
+ /** Account index for deterministic deployment */
7
+ index: bigint;
8
+ };
9
+ export declare const getFactoryData: ({ initData, index }: GetFactoryDataParams) => Hex;
10
+ export type ModuleConfig = {
11
+ module: Address;
12
+ data: Hex;
13
+ };
14
+ export type GetInitDataParams = {
15
+ defaultValidator: GenericModuleConfig;
16
+ prevalidationHooks: PrevalidationHookModuleConfig[];
17
+ validators: GenericModuleConfig[];
18
+ executors: GenericModuleConfig[];
19
+ hook: GenericModuleConfig;
20
+ fallbacks: GenericModuleConfig[];
21
+ registryAddress: Address;
22
+ bootStrapAddress: Address;
23
+ };
24
+ export declare const getInitData: (params: GetInitDataParams) => Hex;
25
+ //# sourceMappingURL=getFactoryData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFactoryData.d.ts","sourceRoot":"","sources":["../../../../src/sdk/account/decorators/getFactoryData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EAMT,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EACV,mBAAmB,EACnB,6BAA6B,EAC9B,MAAM,2BAA2B,CAAA;AAElC,MAAM,MAAM,oBAAoB,GAAG;IACjC,4CAA4C;IAC5C,QAAQ,EAAE,GAAG,CAAA;IACb,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,qBAG5B,oBAAoB,KAAG,GAUzB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,GAAG,CAAA;CACV,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,gBAAgB,EAAE,mBAAmB,CAAA;IACrC,kBAAkB,EAAE,6BAA6B,EAAE,CAAA;IACnD,UAAU,EAAE,mBAAmB,EAAE,CAAA;IACjC,SAAS,EAAE,mBAAmB,EAAE,CAAA;IAChC,IAAI,EAAE,mBAAmB,CAAA;IACzB,SAAS,EAAE,mBAAmB,EAAE,CAAA;IAChC,eAAe,EAAE,OAAO,CAAA;IACxB,gBAAgB,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,QAAQ,iBAAiB,KAAG,GAqBrD,CAAA"}
@@ -0,0 +1,33 @@
1
+ import { type Address } from "viem";
2
+ import type { PublicClient } from "viem";
3
+ /**
4
+ * Parameters for getting the MEE counterfactual address
5
+ * @property publicClient - {@link PublicClient} The public client to use for the read contract
6
+ * @property signerAddress - {@link Address} The address of the EOA signer
7
+ * @property index - Optional BigInt index for deterministic deployment (defaults to 0)
8
+ */
9
+ export type GetUniversalAddressParams<ExtendedPublicClient extends PublicClient> = {
10
+ factoryAddress: Address;
11
+ publicClient: ExtendedPublicClient;
12
+ initData: Address;
13
+ index: bigint;
14
+ };
15
+ /**
16
+ * Gets the counterfactual address for the smart account
17
+ *
18
+ * @param params - {@link GetUniversalAddressParams} Configuration for address computation
19
+ * @param params.publicClient - The public client to use for the read contract
20
+ * @param params.signerAddress - The address of the EOA signer
21
+ * @param params.index - Optional account index (defaults to 0)
22
+ *
23
+ * @returns Promise resolving to the {@link Address} of the counterfactual account
24
+ *
25
+ * @example
26
+ * const accountAddress = await getSmartAccountAddress({
27
+ * publicClient: viemPublicClient,
28
+ * initData: "0x123...",
29
+ * index: BigInt(0)
30
+ * });
31
+ */
32
+ export declare const getStartaleAccountAddress: (params: GetUniversalAddressParams<PublicClient>) => Promise<Address>;
33
+ //# sourceMappingURL=getStartaleAccountAddress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getStartaleAccountAddress.d.ts","sourceRoot":"","sources":["../../../../src/sdk/account/decorators/getStartaleAccountAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,MAAM,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAIxC;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,CACnC,oBAAoB,SAAS,YAAY,IACvC;IACF,cAAc,EAAE,OAAO,CAAA;IACvB,YAAY,EAAE,oBAAoB,CAAA;IAClC,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,yBAAyB,GACpC,QAAQ,yBAAyB,CAAC,YAAY,CAAC,KAC9C,OAAO,CAAC,OAAO,CAgBjB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from "./getStartaleAccountAddress.js";
2
+ export * from "./getFactoryData.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sdk/account/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAA;AAC9C,cAAc,qBAAqB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from "./utils";
2
+ export * from "./toStartaleSmartAccount";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/account/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,0BAA0B,CAAA"}
@@ -0,0 +1,110 @@
1
+ import { type Account, type Address, type Chain, type ClientConfig, type Hex, type LocalAccount, type OneOf, type Prettify, type PublicClient, type RpcSchema, type Transport, type WalletClient } from "viem";
2
+ import { type SmartAccount, type SmartAccountImplementation, type UserOperation } from "viem/account-abstraction";
3
+ import { EntrypointAbi } from "../constants/abi";
4
+ import type { ComposableCall } from "../modules";
5
+ import type { Validator } from "../modules/validators/toValidator";
6
+ import type { Module } from "../modules/utils/Types";
7
+ import type { Call } from "./utils/Types";
8
+ import { type EthersWallet } from "./utils/Utils";
9
+ import { type EthereumProvider, type Signer } from "./utils/toSigner";
10
+ /**
11
+ * Base module configuration type
12
+ */
13
+ export type MinimalModuleConfig = {
14
+ module: Address;
15
+ data: Hex;
16
+ };
17
+ /**
18
+ * Generic module configuration type that can be extended with additional properties
19
+ */
20
+ export type GenericModuleConfig<T extends MinimalModuleConfig = MinimalModuleConfig> = T;
21
+ export type PrevalidationHookModuleConfig = GenericModuleConfig & {
22
+ hookType: bigint;
23
+ };
24
+ /**
25
+ * Parameters for creating a Startale Smart Account
26
+ */
27
+ export type ToStartaleSmartAccountParameters = {
28
+ /** The blockchain network */
29
+ chain: Chain;
30
+ /** The transport configuration */
31
+ transport: ClientConfig["transport"];
32
+ /** The signer account or address */
33
+ signer: OneOf<EthereumProvider | WalletClient<Transport, Chain | undefined, Account> | LocalAccount | EthersWallet>;
34
+ /** Optional index for the account */
35
+ index?: bigint | undefined;
36
+ /** Optional account address override */
37
+ accountAddress?: Address;
38
+ /** Optional validator modules configuration */
39
+ validators?: Array<Validator>;
40
+ /** Optional executor modules configuration */
41
+ executors?: Array<GenericModuleConfig>;
42
+ /** Optional prevalidation hook modules configuration */
43
+ prevalidationHooks?: Array<PrevalidationHookModuleConfig>;
44
+ /** Optional hook module configuration */
45
+ hook?: GenericModuleConfig;
46
+ /** Optional fallback modules configuration */
47
+ fallbacks?: Array<GenericModuleConfig>;
48
+ /** Optional registry address */
49
+ registryAddress?: Address;
50
+ /** Optional factory address */
51
+ factoryAddress?: Address;
52
+ /** Optional bootstrap address */
53
+ bootStrapAddress?: Address;
54
+ } & Prettify<Pick<ClientConfig<Transport, Chain, Account, RpcSchema>, "account" | "cacheTime" | "chain" | "key" | "name" | "pollingInterval" | "rpcSchema">>;
55
+ /**
56
+ * Startale Smart Account type
57
+ */
58
+ export type StartaleSmartAccount = Prettify<SmartAccount<StartaleSmartAccountImplementation>>;
59
+ /**
60
+ * Startale Smart Account Implementation
61
+ */
62
+ export type StartaleSmartAccountImplementation = SmartAccountImplementation<typeof EntrypointAbi, "0.7", {
63
+ /** Gets the counterfactual address of the account */
64
+ getAddress: () => Promise<Address>;
65
+ /** Gets the init code for the account */
66
+ getInitCode: () => Hex;
67
+ /** Encodes a single call for execution */
68
+ encodeExecute: (call: Call) => Promise<Hex>;
69
+ /** Encodes a batch of calls for execution */
70
+ encodeExecuteBatch: (calls: readonly Call[]) => Promise<Hex>;
71
+ /** Encodes a composable call for execution */
72
+ encodeExecuteComposable: (calls: ComposableCall[]) => Promise<Hex>;
73
+ /** Calculates the hash of a user operation */
74
+ getUserOpHash: (userOp: UserOperation) => Hex;
75
+ /** Factory data used for account creation */
76
+ factoryData: Hex;
77
+ /** Factory address used for account creation */
78
+ factoryAddress: Address;
79
+ /** The signer instance */
80
+ signer: Signer;
81
+ /** The public client instance */
82
+ publicClient: PublicClient;
83
+ /** The wallet client instance */
84
+ walletClient: WalletClient;
85
+ /** The blockchain network */
86
+ chain: Chain;
87
+ /** Get the active module */
88
+ getModule: () => Validator;
89
+ /** Set the active module */
90
+ setModule: (validationModule: Module) => void;
91
+ }>;
92
+ /**
93
+ * @description Create a Startale Smart Account.
94
+ *
95
+ * @param parameters - {@link ToStartaleSmartAccountParameters}
96
+ * @returns Startale Smart Account. {@link StartaleSmartAccount}
97
+ *
98
+ * @example
99
+ * import { toStartaleAccount } from '@startale-scs/aa-sdk'
100
+ * import { createWalletClient, http } from 'viem'
101
+ * import { mainnet } from 'viem/chains'
102
+ *
103
+ * const account = await toStartaleAccount({
104
+ * chain: mainnet,
105
+ * transport: http(),
106
+ * signer: '0x...',
107
+ * })
108
+ */
109
+ export declare const toStartaleSmartAccount: (parameters: ToStartaleSmartAccountParameters) => Promise<StartaleSmartAccount>;
110
+ //# sourceMappingURL=toStartaleSmartAccount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toStartaleSmartAccount.d.ts","sourceRoot":"","sources":["../../../src/sdk/account/toStartaleSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,GAAG,EACR,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,SAAS,EAId,KAAK,YAAY,EAkBlB,MAAM,MAAM,CAAA;AACb,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAInB,MAAM,0BAA0B,CAAA;AAQjC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,OAAO,KAAK,EAAsB,cAAc,EAAE,MAAM,YAAY,CAAA;AAGpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,w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AE,YAAY,CAAA;IAE1B,iCAAiC;IACjC,YAAY,EAAE,YAAY,CAAA;IAE1B,6BAA6B;IAC7B,KAAK,EAAE,KAAK,CAAA;IAEZ,4BAA4B;IAC5B,SAAS,EAAE,MAAM,SAAS,CAAA;IAE1B,4BAA4B;IAC5B,SAAS,EAAE,CAAC,gBAAgB,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9C,CACF,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,sBAAsB,GACjC,YAAY,gCAAgC,KAC3C,OAAO,CAAC,oBAAoB,CAwY9B,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { BaseError } from "viem";
2
+ /**
3
+ * @ignore
4
+ */
5
+ export declare class AccountNotFoundError extends BaseError {
6
+ constructor({ docsPath }?: {
7
+ docsPath?: string | undefined;
8
+ });
9
+ }
10
+ //# sourceMappingURL=AccountNotFound.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountNotFound.d.ts","sourceRoot":"","sources":["../../../../src/sdk/account/utils/AccountNotFound.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAEhC;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;gBACrC,EAAE,QAAQ,EAAE,GAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAO;CAajE"}