@account-kit/smart-contracts 4.7.0 → 4.9.0

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 (187) hide show
  1. package/dist/esm/src/light-account/clients/alchemyClient.js +6 -12
  2. package/dist/esm/src/light-account/clients/alchemyClient.js.map +1 -1
  3. package/dist/esm/src/light-account/clients/client.d.ts +9 -4
  4. package/dist/esm/src/light-account/clients/client.js +26 -1
  5. package/dist/esm/src/light-account/clients/client.js.map +1 -1
  6. package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js +6 -11
  7. package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
  8. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.d.ts +10 -4
  9. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js +27 -3
  10. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js.map +1 -1
  11. package/dist/esm/src/ma-v2/abis/accountFactoryAbi.d.ts +492 -0
  12. package/dist/esm/src/ma-v2/abis/accountFactoryAbi.js +639 -0
  13. package/dist/esm/src/ma-v2/abis/accountFactoryAbi.js.map +1 -0
  14. package/dist/esm/src/ma-v2/abis/modularAccountAbi.d.ts +954 -0
  15. package/dist/esm/src/ma-v2/abis/modularAccountAbi.js +1242 -0
  16. package/dist/esm/src/ma-v2/abis/modularAccountAbi.js.map +1 -0
  17. package/dist/esm/src/ma-v2/abis/semiModularAccountBytecodeAbi.d.ts +991 -0
  18. package/dist/esm/src/ma-v2/abis/semiModularAccountBytecodeAbi.js +1289 -0
  19. package/dist/esm/src/ma-v2/abis/semiModularAccountBytecodeAbi.js.map +1 -0
  20. package/dist/esm/src/ma-v2/abis/semiModularAccountStorageAbi.d.ts +1001 -0
  21. package/dist/esm/src/ma-v2/abis/semiModularAccountStorageAbi.js +1302 -0
  22. package/dist/esm/src/ma-v2/abis/semiModularAccountStorageAbi.js.map +1 -0
  23. package/dist/esm/src/ma-v2/account/nativeSMASigner.d.ts +238 -0
  24. package/dist/esm/src/ma-v2/account/nativeSMASigner.js +88 -0
  25. package/dist/esm/src/ma-v2/account/nativeSMASigner.js.map +1 -0
  26. package/dist/esm/src/ma-v2/account/semiModularAccountV2.d.ts +41 -0
  27. package/dist/esm/src/ma-v2/account/semiModularAccountV2.js +148 -0
  28. package/dist/esm/src/ma-v2/account/semiModularAccountV2.js.map +1 -0
  29. package/dist/esm/src/ma-v2/actions/common/types.d.ts +31 -0
  30. package/dist/esm/src/ma-v2/actions/common/types.js +6 -0
  31. package/dist/esm/src/ma-v2/actions/common/types.js.map +1 -0
  32. package/dist/esm/src/ma-v2/actions/common/utils.d.ts +76 -0
  33. package/dist/esm/src/ma-v2/actions/common/utils.js +100 -0
  34. package/dist/esm/src/ma-v2/actions/common/utils.js.map +1 -0
  35. package/dist/esm/src/ma-v2/actions/install-validation/installValidation.d.ts +71 -0
  36. package/dist/esm/src/ma-v2/actions/install-validation/installValidation.js +109 -0
  37. package/dist/esm/src/ma-v2/actions/install-validation/installValidation.js.map +1 -0
  38. package/dist/esm/src/ma-v2/client/client.d.ts +13 -0
  39. package/dist/esm/src/ma-v2/client/client.js +54 -0
  40. package/dist/esm/src/ma-v2/client/client.js.map +1 -0
  41. package/dist/esm/src/ma-v2/index.d.ts +26 -0
  42. package/dist/esm/src/ma-v2/index.js +24 -0
  43. package/dist/esm/src/ma-v2/index.js.map +1 -0
  44. package/dist/esm/src/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.d.ts +556 -0
  45. package/dist/esm/src/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.js +716 -0
  46. package/dist/esm/src/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.js.map +1 -0
  47. package/dist/esm/src/ma-v2/modules/allowlist-module/module.d.ts +579 -0
  48. package/dist/esm/src/ma-v2/modules/allowlist-module/module.js +56 -0
  49. package/dist/esm/src/ma-v2/modules/allowlist-module/module.js.map +1 -0
  50. package/dist/esm/src/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.d.ts +312 -0
  51. package/dist/esm/src/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.js +404 -0
  52. package/dist/esm/src/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.js.map +1 -0
  53. package/dist/esm/src/ma-v2/modules/native-token-limit-module/module.d.ts +322 -0
  54. package/dist/esm/src/ma-v2/modules/native-token-limit-module/module.js +14 -0
  55. package/dist/esm/src/ma-v2/modules/native-token-limit-module/module.js.map +1 -0
  56. package/dist/esm/src/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.d.ts +186 -0
  57. package/dist/esm/src/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.js +242 -0
  58. package/dist/esm/src/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.js.map +1 -0
  59. package/dist/esm/src/ma-v2/modules/paymaster-guard-module/module.d.ts +196 -0
  60. package/dist/esm/src/ma-v2/modules/paymaster-guard-module/module.js +25 -0
  61. package/dist/esm/src/ma-v2/modules/paymaster-guard-module/module.js.map +1 -0
  62. package/dist/esm/src/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.d.ts +45 -0
  63. package/dist/esm/src/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.js +331 -0
  64. package/dist/esm/src/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.js.map +1 -0
  65. package/dist/esm/src/ma-v2/modules/single-signer-validation/module.d.ts +10 -0
  66. package/dist/esm/src/ma-v2/modules/single-signer-validation/module.js +16 -0
  67. package/dist/esm/src/ma-v2/modules/single-signer-validation/module.js.map +1 -0
  68. package/dist/esm/src/ma-v2/modules/single-signer-validation/signer.d.ts +239 -0
  69. package/dist/esm/src/ma-v2/modules/single-signer-validation/signer.js +93 -0
  70. package/dist/esm/src/ma-v2/modules/single-signer-validation/signer.js.map +1 -0
  71. package/dist/esm/src/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.d.ts +229 -0
  72. package/dist/esm/src/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.js +296 -0
  73. package/dist/esm/src/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.js.map +1 -0
  74. package/dist/esm/src/ma-v2/modules/time-range-module/module.d.ts +245 -0
  75. package/dist/esm/src/ma-v2/modules/time-range-module/module.js +42 -0
  76. package/dist/esm/src/ma-v2/modules/time-range-module/module.js.map +1 -0
  77. package/dist/esm/src/ma-v2/modules/utils.d.ts +91 -0
  78. package/dist/esm/src/ma-v2/modules/utils.js +188 -0
  79. package/dist/esm/src/ma-v2/modules/utils.js.map +1 -0
  80. package/dist/esm/src/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.d.ts +287 -0
  81. package/dist/esm/src/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.js +374 -0
  82. package/dist/esm/src/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.js.map +1 -0
  83. package/dist/esm/src/ma-v2/utils.d.ts +16 -0
  84. package/dist/esm/src/ma-v2/utils.js +105 -0
  85. package/dist/esm/src/ma-v2/utils.js.map +1 -0
  86. package/dist/esm/src/msca/client/alchemyClient.js +4 -17
  87. package/dist/esm/src/msca/client/alchemyClient.js.map +1 -1
  88. package/dist/esm/src/msca/client/client.d.ts +14 -5
  89. package/dist/esm/src/msca/client/client.js +62 -0
  90. package/dist/esm/src/msca/client/client.js.map +1 -1
  91. package/dist/esm/src/msca/client/multiSigAlchemyClient.d.ts +4 -2
  92. package/dist/esm/src/msca/client/multiSigAlchemyClient.js +5 -19
  93. package/dist/esm/src/msca/client/multiSigAlchemyClient.js.map +1 -1
  94. package/dist/types/src/light-account/clients/alchemyClient.d.ts.map +1 -1
  95. package/dist/types/src/light-account/clients/client.d.ts +9 -4
  96. package/dist/types/src/light-account/clients/client.d.ts.map +1 -1
  97. package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts.map +1 -1
  98. package/dist/types/src/light-account/clients/multiOwnerLightAccount.d.ts +10 -4
  99. package/dist/types/src/light-account/clients/multiOwnerLightAccount.d.ts.map +1 -1
  100. package/dist/types/src/ma-v2/abis/accountFactoryAbi.d.ts +493 -0
  101. package/dist/types/src/ma-v2/abis/accountFactoryAbi.d.ts.map +1 -0
  102. package/dist/types/src/ma-v2/abis/modularAccountAbi.d.ts +955 -0
  103. package/dist/types/src/ma-v2/abis/modularAccountAbi.d.ts.map +1 -0
  104. package/dist/types/src/ma-v2/abis/semiModularAccountBytecodeAbi.d.ts +992 -0
  105. package/dist/types/src/ma-v2/abis/semiModularAccountBytecodeAbi.d.ts.map +1 -0
  106. package/dist/types/src/ma-v2/abis/semiModularAccountStorageAbi.d.ts +1002 -0
  107. package/dist/types/src/ma-v2/abis/semiModularAccountStorageAbi.d.ts.map +1 -0
  108. package/dist/types/src/ma-v2/account/nativeSMASigner.d.ts +239 -0
  109. package/dist/types/src/ma-v2/account/nativeSMASigner.d.ts.map +1 -0
  110. package/dist/types/src/ma-v2/account/semiModularAccountV2.d.ts +42 -0
  111. package/dist/types/src/ma-v2/account/semiModularAccountV2.d.ts.map +1 -0
  112. package/dist/types/src/ma-v2/actions/common/types.d.ts +32 -0
  113. package/dist/types/src/ma-v2/actions/common/types.d.ts.map +1 -0
  114. package/dist/types/src/ma-v2/actions/common/utils.d.ts +77 -0
  115. package/dist/types/src/ma-v2/actions/common/utils.d.ts.map +1 -0
  116. package/dist/types/src/ma-v2/actions/install-validation/installValidation.d.ts +72 -0
  117. package/dist/types/src/ma-v2/actions/install-validation/installValidation.d.ts.map +1 -0
  118. package/dist/types/src/ma-v2/client/client.d.ts +14 -0
  119. package/dist/types/src/ma-v2/client/client.d.ts.map +1 -0
  120. package/dist/types/src/ma-v2/index.d.ts +27 -0
  121. package/dist/types/src/ma-v2/index.d.ts.map +1 -0
  122. package/dist/types/src/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.d.ts +557 -0
  123. package/dist/types/src/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.d.ts.map +1 -0
  124. package/dist/types/src/ma-v2/modules/allowlist-module/module.d.ts +580 -0
  125. package/dist/types/src/ma-v2/modules/allowlist-module/module.d.ts.map +1 -0
  126. package/dist/types/src/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.d.ts +313 -0
  127. package/dist/types/src/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.d.ts.map +1 -0
  128. package/dist/types/src/ma-v2/modules/native-token-limit-module/module.d.ts +323 -0
  129. package/dist/types/src/ma-v2/modules/native-token-limit-module/module.d.ts.map +1 -0
  130. package/dist/types/src/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.d.ts +187 -0
  131. package/dist/types/src/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.d.ts.map +1 -0
  132. package/dist/types/src/ma-v2/modules/paymaster-guard-module/module.d.ts +197 -0
  133. package/dist/types/src/ma-v2/modules/paymaster-guard-module/module.d.ts.map +1 -0
  134. package/dist/types/src/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.d.ts +46 -0
  135. package/dist/types/src/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.d.ts.map +1 -0
  136. package/dist/types/src/ma-v2/modules/single-signer-validation/module.d.ts +11 -0
  137. package/dist/types/src/ma-v2/modules/single-signer-validation/module.d.ts.map +1 -0
  138. package/dist/types/src/ma-v2/modules/single-signer-validation/signer.d.ts +240 -0
  139. package/dist/types/src/ma-v2/modules/single-signer-validation/signer.d.ts.map +1 -0
  140. package/dist/types/src/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.d.ts +230 -0
  141. package/dist/types/src/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.d.ts.map +1 -0
  142. package/dist/types/src/ma-v2/modules/time-range-module/module.d.ts +246 -0
  143. package/dist/types/src/ma-v2/modules/time-range-module/module.d.ts.map +1 -0
  144. package/dist/types/src/ma-v2/modules/utils.d.ts +92 -0
  145. package/dist/types/src/ma-v2/modules/utils.d.ts.map +1 -0
  146. package/dist/types/src/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.d.ts +288 -0
  147. package/dist/types/src/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.d.ts.map +1 -0
  148. package/dist/types/src/ma-v2/utils.d.ts +17 -0
  149. package/dist/types/src/ma-v2/utils.d.ts.map +1 -0
  150. package/dist/types/src/msca/client/alchemyClient.d.ts.map +1 -1
  151. package/dist/types/src/msca/client/client.d.ts +14 -5
  152. package/dist/types/src/msca/client/client.d.ts.map +1 -1
  153. package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts +4 -2
  154. package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts.map +1 -1
  155. package/package.json +11 -5
  156. package/src/light-account/clients/alchemyClient.ts +5 -14
  157. package/src/light-account/clients/client.ts +52 -6
  158. package/src/light-account/clients/multiOwnerAlchemyClient.ts +5 -13
  159. package/src/light-account/clients/multiOwnerLightAccount.ts +64 -8
  160. package/src/ma-v2/abis/accountFactoryAbi.ts +638 -0
  161. package/src/ma-v2/abis/modularAccountAbi.ts +1241 -0
  162. package/src/ma-v2/abis/semiModularAccountBytecodeAbi.ts +1288 -0
  163. package/src/ma-v2/abis/semiModularAccountStorageAbi.ts +1301 -0
  164. package/src/ma-v2/account/nativeSMASigner.ts +121 -0
  165. package/src/ma-v2/account/semiModularAccountV2.ts +289 -0
  166. package/src/ma-v2/actions/common/types.ts +37 -0
  167. package/src/ma-v2/actions/common/utils.ts +103 -0
  168. package/src/ma-v2/actions/install-validation/installValidation.ts +213 -0
  169. package/src/ma-v2/client/client.ts +117 -0
  170. package/src/ma-v2/index.ts +47 -0
  171. package/src/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.ts +715 -0
  172. package/src/ma-v2/modules/allowlist-module/module.ts +87 -0
  173. package/src/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.ts +403 -0
  174. package/src/ma-v2/modules/native-token-limit-module/module.ts +21 -0
  175. package/src/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.ts +241 -0
  176. package/src/ma-v2/modules/paymaster-guard-module/module.ts +35 -0
  177. package/src/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.ts +330 -0
  178. package/src/ma-v2/modules/single-signer-validation/module.ts +24 -0
  179. package/src/ma-v2/modules/single-signer-validation/signer.ts +127 -0
  180. package/src/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.ts +295 -0
  181. package/src/ma-v2/modules/time-range-module/module.ts +63 -0
  182. package/src/ma-v2/modules/utils.ts +213 -0
  183. package/src/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.ts +373 -0
  184. package/src/ma-v2/utils.ts +138 -0
  185. package/src/msca/client/alchemyClient.ts +3 -22
  186. package/src/msca/client/client.ts +157 -13
  187. package/src/msca/client/multiSigAlchemyClient.ts +6 -29
@@ -1,5 +1,5 @@
1
- import { createAlchemySmartAccountClient, } from "@account-kit/infra";
2
- import { createLightAccount, lightAccountClientActions, } from "@account-kit/smart-contracts";
1
+ import {} from "@account-kit/infra";
2
+ import { createLightAccountClient, } from "@account-kit/smart-contracts";
3
3
  import {} from "viem";
4
4
  /**
5
5
  * Creates an Alchemy smart account client connected to a Light Account instance.
@@ -17,22 +17,16 @@ import {} from "viem";
17
17
  * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
18
18
  * });
19
19
  * ```
20
- *
20
+ * @deprecated Use createLightAccountClient instead now, it should switch depending on the transport
21
21
  * @param {AlchemyLightAccountClientConfig} config The configuration for setting up the Alchemy Light Account Client
22
22
  * @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created client
23
23
  */
24
24
  export async function createLightAccountAlchemyClient({ opts, transport, chain, ...config }) {
25
- const account = await createLightAccount({
26
- ...config,
25
+ return createLightAccountClient({
26
+ opts,
27
27
  transport,
28
28
  chain,
29
- });
30
- return createAlchemySmartAccountClient({
31
29
  ...config,
32
- transport,
33
- chain,
34
- account,
35
- opts,
36
- }).extend(lightAccountClientActions);
30
+ });
37
31
  }
38
32
  //# sourceMappingURL=alchemyClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alchemyClient.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/alchemyClient.ts"],"names":[],"mappings":"AACA,OAAO,EACL,+BAA+B,GAGhC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kBAAkB,EAClB,yBAAyB,GAI1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAc,MAAM,MAAM,CAAC;AAsBlC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,+BAA+B,CAAC,EACpD,IAAI,EACJ,SAAS,EACT,KAAK,EACL,GAAG,MAAM,EACuB;IAChC,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC;QACvC,GAAG,MAAM;QACT,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,OAAO,+BAA+B,CAAC;QACrC,GAAG,MAAM;QACT,SAAS;QACT,KAAK;QACL,OAAO;QACP,IAAI;KACL,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import type { HttpTransport, SmartAccountSigner } from \"@aa-sdk/core\";\nimport {\n createAlchemySmartAccountClient,\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n createLightAccount,\n lightAccountClientActions,\n type CreateLightAccountParams,\n type LightAccount,\n type LightAccountClientActions,\n} from \"@account-kit/smart-contracts\";\nimport { type Chain } from \"viem\";\n\nexport type AlchemyLightAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<CreateLightAccountParams<HttpTransport, TSigner>, \"transport\"> &\n Omit<\n AlchemySmartAccountClientConfig<Chain, LightAccount<TSigner>>,\n \"account\"\n >;\n\nexport async function createLightAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyLightAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n Chain | undefined,\n LightAccount<TSigner>,\n LightAccountClientActions<TSigner>\n >\n>;\n\n/**\n * Creates an Alchemy smart account client connected to a Light Account instance.\n *\n * @example\n * ```ts\n * import { createLightAccountAlchemyClient } from \"@account-kit/smart-contracts\";\n * import { sepolia, alchemy } from \"@account-kit/infra\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const lightAccountClient = await createLightAccountAlchemyClient({\n * transport: alchemy({ apiKey: \"your-api-key\" }),\n * chain: sepolia,\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {AlchemyLightAccountClientConfig} config The configuration for setting up the Alchemy Light Account Client\n * @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created client\n */\nexport async function createLightAccountAlchemyClient({\n opts,\n transport,\n chain,\n ...config\n}: AlchemyLightAccountClientConfig): Promise<AlchemySmartAccountClient> {\n const account = await createLightAccount({\n ...config,\n transport,\n chain,\n });\n\n return createAlchemySmartAccountClient({\n ...config,\n transport,\n chain,\n account,\n opts,\n }).extend(lightAccountClientActions);\n}\n"]}
1
+ {"version":3,"file":"alchemyClient.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/alchemyClient.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,wBAAwB,GAIzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAc,MAAM,MAAM,CAAC;AAsBlC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,+BAA+B,CAAC,EACpD,IAAI,EACJ,SAAS,EACT,KAAK,EACL,GAAG,MAAM,EACuB;IAChC,OAAO,wBAAwB,CAAC;QAC9B,IAAI;QACJ,SAAS;QACT,KAAK;QACL,GAAG,MAAM;KACV,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { HttpTransport, SmartAccountSigner } from \"@aa-sdk/core\";\nimport {\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n createLightAccountClient,\n type CreateLightAccountParams,\n type LightAccount,\n type LightAccountClientActions,\n} from \"@account-kit/smart-contracts\";\nimport { type Chain } from \"viem\";\n\nexport type AlchemyLightAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<CreateLightAccountParams<HttpTransport, TSigner>, \"transport\"> &\n Omit<\n AlchemySmartAccountClientConfig<Chain, LightAccount<TSigner>>,\n \"account\"\n >;\n\nexport async function createLightAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyLightAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n Chain | undefined,\n LightAccount<TSigner>,\n LightAccountClientActions<TSigner>\n >\n>;\n\n/**\n * Creates an Alchemy smart account client connected to a Light Account instance.\n *\n * @example\n * ```ts\n * import { createLightAccountAlchemyClient } from \"@account-kit/smart-contracts\";\n * import { sepolia, alchemy } from \"@account-kit/infra\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const lightAccountClient = await createLightAccountAlchemyClient({\n * transport: alchemy({ apiKey: \"your-api-key\" }),\n * chain: sepolia,\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n * @deprecated Use createLightAccountClient instead now, it should switch depending on the transport\n * @param {AlchemyLightAccountClientConfig} config The configuration for setting up the Alchemy Light Account Client\n * @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created client\n */\nexport async function createLightAccountAlchemyClient({\n opts,\n transport,\n chain,\n ...config\n}: AlchemyLightAccountClientConfig): Promise<AlchemySmartAccountClient> {\n return createLightAccountClient({\n opts,\n transport,\n chain,\n ...config,\n });\n}\n"]}
@@ -1,9 +1,14 @@
1
- import { type SmartAccountClient, type SmartAccountClientActions, type SmartAccountClientConfig, type SmartAccountSigner, type SmartContractAccount } from "@aa-sdk/core";
1
+ import { type NotType, type SmartAccountClient, type SmartAccountClientActions, type SmartAccountClientConfig, type SmartAccountSigner, type SmartContractAccount } from "@aa-sdk/core";
2
2
  import { type Chain, type CustomTransport, type Transport } from "viem";
3
- import { type CreateLightAccountParams, type LightAccount } from "../accounts/account.js";
3
+ import { type CreateLightAccountParams, type LightAccount } from "@account-kit/smart-contracts";
4
4
  import { type LightAccountClientActions } from "../decorators/lightAccount.js";
5
- export type CreateLightAccountClientParams<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner> = {
5
+ import { type AlchemySmartAccountClient, type AlchemyTransport } from "@account-kit/infra";
6
+ import { type AlchemyLightAccountClientConfig } from "./alchemyClient.js";
7
+ export type CreateLightAccountClientParams<TTransport extends Transport | AlchemyTransport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner> = {
6
8
  transport: CreateLightAccountParams<TTransport, TSigner>["transport"];
7
9
  chain: CreateLightAccountParams<TTransport, TSigner>["chain"];
8
10
  } & Omit<CreateLightAccountParams<TTransport, TSigner>, "transport" | "chain"> & Omit<SmartAccountClientConfig<TTransport, TChain>, "transport" | "account" | "chain">;
9
- export declare function createLightAccountClient<TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner>(args: CreateLightAccountClientParams<Transport, TChain, TSigner>): Promise<SmartAccountClient<CustomTransport, Chain, LightAccount<TSigner>, SmartAccountClientActions<Chain, SmartContractAccount> & LightAccountClientActions<TSigner, LightAccount<TSigner>>>>;
11
+ export declare function createLightAccountClient<TSigner extends SmartAccountSigner = SmartAccountSigner>(params: AlchemyLightAccountClientConfig<TSigner> & {
12
+ transport: AlchemyTransport;
13
+ }): Promise<AlchemySmartAccountClient<Chain | undefined, LightAccount<TSigner>, LightAccountClientActions<TSigner>>>;
14
+ export declare function createLightAccountClient<TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner, TTransport extends Transport = Transport>(args: CreateLightAccountClientParams<TTransport, TChain, TSigner> & NotType<TTransport, AlchemyTransport>): Promise<SmartAccountClient<CustomTransport, TChain, LightAccount<TSigner>, SmartAccountClientActions<Chain, SmartContractAccount> & LightAccountClientActions<TSigner, LightAccount<TSigner>>>>;
@@ -1,10 +1,14 @@
1
1
  import { createSmartAccountClient, } from "@aa-sdk/core";
2
2
  import {} from "viem";
3
- import { createLightAccount, } from "../accounts/account.js";
3
+ import { createLightAccount, } from "@account-kit/smart-contracts";
4
4
  import { lightAccountClientActions, } from "../decorators/lightAccount.js";
5
+ import { isAlchemyTransport, createAlchemySmartAccountClient, } from "@account-kit/infra";
6
+ import {} from "./alchemyClient.js";
5
7
  /**
6
8
  * Creates a light account client using the provided parameters, including account information, transport mechanism, blockchain chain, and additional client configurations. This function first creates a light account and then uses it to create a smart account client, extending it with light account client actions.
7
9
  *
10
+ * Also, we modified the return type to be the light account alchemy client if the transport is alchemy.
11
+ *
8
12
  * @example
9
13
  * ```ts
10
14
  * import { createLightAccountClient } from "@account-kit/smart-contracts";
@@ -18,6 +22,19 @@ import { lightAccountClientActions, } from "../decorators/lightAccount.js";
18
22
  * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
19
23
  * });
20
24
  * ```
25
+ * @example
26
+ * ```ts
27
+ * import { createLightAccountClient } from "@account-kit/smart-contracts";
28
+ * import { sepolia, alchemy } from "@account-kit/infra";
29
+ * import { LocalAccountSigner } from "@aa-sdk/core";
30
+ * import { generatePrivateKey } from "viem"
31
+ *
32
+ * const lightAlchemyAccountClient = await createLightAccountClient({
33
+ * transport: alchemy({ apiKey: "your-api-key" }),
34
+ * chain: sepolia,
35
+ * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
36
+ * });
37
+ * ```
21
38
  *
22
39
  * @param {CreateLightAccountClientParams} params The parameters for creating a light account client
23
40
  * @returns {Promise<SmartAccountClient>} A promise that resolves to a `SmartAccountClient` object containing the created account information and methods
@@ -29,6 +46,14 @@ export async function createLightAccountClient(params) {
29
46
  transport,
30
47
  chain,
31
48
  });
49
+ if (isAlchemyTransport(transport, chain)) {
50
+ return createAlchemySmartAccountClient({
51
+ ...params,
52
+ transport,
53
+ chain,
54
+ account: lightAccount,
55
+ }).extend(lightAccountClientActions);
56
+ }
32
57
  return createSmartAccountClient({
33
58
  ...params,
34
59
  transport,
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,GAMzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAoD,MAAM,MAAM,CAAC;AACxE,OAAO,EACL,kBAAkB,GAGnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,yBAAyB,GAE1B,MAAM,+BAA+B,CAAC;AA8BvC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,MAAsC;IAEtC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IAEpC,MAAM,YAAY,GAAG,MAAM,kBAAkB,CAAC;QAC5C,GAAG,MAAM;QACT,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,OAAO,wBAAwB,CAAC;QAC9B,GAAG,MAAM;QACT,SAAS;QACT,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import {\n createSmartAccountClient,\n type SmartAccountClient,\n type SmartAccountClientActions,\n type SmartAccountClientConfig,\n type SmartAccountSigner,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { type Chain, type CustomTransport, type Transport } from \"viem\";\nimport {\n createLightAccount,\n type CreateLightAccountParams,\n type LightAccount,\n} from \"../accounts/account.js\";\nimport {\n lightAccountClientActions,\n type LightAccountClientActions,\n} from \"../decorators/lightAccount.js\";\n\nexport type CreateLightAccountClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = {\n transport: CreateLightAccountParams<TTransport, TSigner>[\"transport\"];\n chain: CreateLightAccountParams<TTransport, TSigner>[\"chain\"];\n} & Omit<CreateLightAccountParams<TTransport, TSigner>, \"transport\" | \"chain\"> &\n Omit<\n SmartAccountClientConfig<TTransport, TChain>,\n \"transport\" | \"account\" | \"chain\"\n >;\n\nexport function createLightAccountClient<\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n args: CreateLightAccountClientParams<Transport, TChain, TSigner>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n Chain,\n LightAccount<TSigner>,\n SmartAccountClientActions<Chain, SmartContractAccount> &\n LightAccountClientActions<TSigner, LightAccount<TSigner>>\n >\n>;\n\n/**\n * Creates a light account client using the provided parameters, including account information, transport mechanism, blockchain chain, and additional client configurations. This function first creates a light account and then uses it to create a smart account client, extending it with light account client actions.\n *\n * @example\n * ```ts\n * import { createLightAccountClient } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http, generatePrivateKey } from \"viem\"\n *\n * const account = await createLightAccountClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {CreateLightAccountClientParams} params The parameters for creating a light account client\n * @returns {Promise<SmartAccountClient>} A promise that resolves to a `SmartAccountClient` object containing the created account information and methods\n */\nexport async function createLightAccountClient(\n params: CreateLightAccountClientParams\n): Promise<SmartAccountClient> {\n const { transport, chain } = params;\n\n const lightAccount = await createLightAccount({\n ...params,\n transport,\n chain,\n });\n\n return createSmartAccountClient({\n ...params,\n transport,\n chain: chain,\n account: lightAccount,\n }).extend(lightAccountClientActions);\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,GAOzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAoD,MAAM,MAAM,CAAC;AACxE,OAAO,EACL,kBAAkB,GAGnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,yBAAyB,GAE1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,+BAA+B,GAGhC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAwC,MAAM,oBAAoB,CAAC;AA6C1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,MAAsC;IAEtC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IAEpC,MAAM,YAAY,GAAG,MAAM,kBAAkB,CAAC;QAC5C,GAAG,MAAM;QACT,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IACH,IAAI,kBAAkB,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,+BAA+B,CAAC;YACrC,GAAG,MAAM;YACT,SAAS;YACT,KAAK;YACL,OAAO,EAAE,YAAY;SACtB,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,wBAAwB,CAAC;QAC9B,GAAG,MAAM;QACT,SAAS;QACT,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import {\n createSmartAccountClient,\n type NotType,\n type SmartAccountClient,\n type SmartAccountClientActions,\n type SmartAccountClientConfig,\n type SmartAccountSigner,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { type Chain, type CustomTransport, type Transport } from \"viem\";\nimport {\n createLightAccount,\n type CreateLightAccountParams,\n type LightAccount,\n} from \"@account-kit/smart-contracts\";\nimport {\n lightAccountClientActions,\n type LightAccountClientActions,\n} from \"../decorators/lightAccount.js\";\nimport {\n isAlchemyTransport,\n createAlchemySmartAccountClient,\n type AlchemySmartAccountClient,\n type AlchemyTransport,\n} from \"@account-kit/infra\";\nimport { type AlchemyLightAccountClientConfig } from \"./alchemyClient.js\";\n\nexport type CreateLightAccountClientParams<\n TTransport extends Transport | AlchemyTransport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = {\n transport: CreateLightAccountParams<TTransport, TSigner>[\"transport\"];\n chain: CreateLightAccountParams<TTransport, TSigner>[\"chain\"];\n} & Omit<CreateLightAccountParams<TTransport, TSigner>, \"transport\" | \"chain\"> &\n Omit<\n SmartAccountClientConfig<TTransport, TChain>,\n \"transport\" | \"account\" | \"chain\"\n >;\n\nexport function createLightAccountClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyLightAccountClientConfig<TSigner> & {\n transport: AlchemyTransport;\n }\n): Promise<\n AlchemySmartAccountClient<\n Chain | undefined,\n LightAccount<TSigner>,\n LightAccountClientActions<TSigner>\n >\n>;\nexport function createLightAccountClient<\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TTransport extends Transport = Transport\n>(\n args: CreateLightAccountClientParams<TTransport, TChain, TSigner> &\n NotType<TTransport, AlchemyTransport>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n TChain,\n LightAccount<TSigner>,\n SmartAccountClientActions<Chain, SmartContractAccount> &\n LightAccountClientActions<TSigner, LightAccount<TSigner>>\n >\n>;\n\n/**\n * Creates a light account client using the provided parameters, including account information, transport mechanism, blockchain chain, and additional client configurations. This function first creates a light account and then uses it to create a smart account client, extending it with light account client actions.\n *\n * Also, we modified the return type to be the light account alchemy client if the transport is alchemy.\n *\n * @example\n * ```ts\n * import { createLightAccountClient } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http, generatePrivateKey } from \"viem\"\n *\n * const account = await createLightAccountClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n * @example\n * ```ts\n * import { createLightAccountClient } from \"@account-kit/smart-contracts\";\n * import { sepolia, alchemy } from \"@account-kit/infra\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const lightAlchemyAccountClient = await createLightAccountClient({\n * transport: alchemy({ apiKey: \"your-api-key\" }),\n * chain: sepolia,\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {CreateLightAccountClientParams} params The parameters for creating a light account client\n * @returns {Promise<SmartAccountClient>} A promise that resolves to a `SmartAccountClient` object containing the created account information and methods\n */\nexport async function createLightAccountClient(\n params: CreateLightAccountClientParams\n): Promise<SmartAccountClient | AlchemySmartAccountClient> {\n const { transport, chain } = params;\n\n const lightAccount = await createLightAccount({\n ...params,\n transport,\n chain,\n });\n if (isAlchemyTransport(transport, chain)) {\n return createAlchemySmartAccountClient({\n ...params,\n transport,\n chain,\n account: lightAccount,\n }).extend(lightAccountClientActions);\n }\n\n return createSmartAccountClient({\n ...params,\n transport,\n chain: chain,\n account: lightAccount,\n }).extend(lightAccountClientActions);\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { createAlchemySmartAccountClient, } from "@account-kit/infra";
2
- import { createMultiOwnerLightAccount, multiOwnerLightAccountClientActions, } from "@account-kit/smart-contracts";
1
+ import {} from "@account-kit/infra";
2
+ import { createMultiOwnerLightAccountClient, } from "@account-kit/smart-contracts";
3
3
  import {} from "viem";
4
4
  /**
5
5
  * Creates a multi-owner light account Alchemy client using the provided configuration.
@@ -20,21 +20,16 @@ import {} from "viem";
20
20
  * });
21
21
  * ```
22
22
  *
23
+ * @deprecated Use createMultiOwnerLightAccountAlchemyClient instead now, it should switch depending on the transport
23
24
  * @param {AlchemyMultiOwnerLightAccountClientConfig} config The configuration for creating the Alchemy client
24
25
  * @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created account information and methods
25
26
  */
26
27
  export async function createMultiOwnerLightAccountAlchemyClient({ opts, transport, chain, ...config }) {
27
- const account = await createMultiOwnerLightAccount({
28
- ...config,
28
+ return createMultiOwnerLightAccountClient({
29
+ opts,
29
30
  transport,
30
31
  chain,
31
- });
32
- return createAlchemySmartAccountClient({
33
32
  ...config,
34
- transport,
35
- chain,
36
- account,
37
- opts,
38
- }).extend(multiOwnerLightAccountClientActions);
33
+ });
39
34
  }
40
35
  //# sourceMappingURL=multiOwnerAlchemyClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"multiOwnerAlchemyClient.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerAlchemyClient.ts"],"names":[],"mappings":"AACA,OAAO,EACL,+BAA+B,GAGhC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,4BAA4B,EAC5B,mCAAmC,GAIpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAc,MAAM,MAAM,CAAC;AAyBlC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,KAAK,UAAU,yCAAyC,CAAC,EAC9D,IAAI,EACJ,SAAS,EACT,KAAK,EACL,GAAG,MAAM,EACiC;IAC1C,MAAM,OAAO,GAAG,MAAM,4BAA4B,CAAC;QACjD,GAAG,MAAM;QACT,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,OAAO,+BAA+B,CAAC;QACrC,GAAG,MAAM;QACT,SAAS;QACT,KAAK;QACL,OAAO;QACP,IAAI;KACL,CAAC,CAAC,MAAM,CAAC,mCAAmC,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import type { HttpTransport, SmartAccountSigner } from \"@aa-sdk/core\";\nimport {\n createAlchemySmartAccountClient,\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n createMultiOwnerLightAccount,\n multiOwnerLightAccountClientActions,\n type CreateMultiOwnerLightAccountParams,\n type MultiOwnerLightAccount,\n type MultiOwnerLightAccountClientActions,\n} from \"@account-kit/smart-contracts\";\nimport { type Chain } from \"viem\";\n\nexport type AlchemyMultiOwnerLightAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateMultiOwnerLightAccountParams<HttpTransport, TSigner>,\n \"transport\" | \"type\"\n> &\n Omit<\n AlchemySmartAccountClientConfig<Chain, MultiOwnerLightAccount<TSigner>>,\n \"account\"\n >;\n\nexport async function createMultiOwnerLightAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyMultiOwnerLightAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n Chain | undefined,\n MultiOwnerLightAccount<TSigner>,\n MultiOwnerLightAccountClientActions<TSigner>\n >\n>;\n\n/**\n * Creates a multi-owner light account Alchemy client using the provided configuration.\n *\n * @example\n * ```ts\n * import { createMultiOwnerLightAccountAlchemyClient } from \"@account-kit/smart-contracts\";\n * import { sepolia, alchemy } from \"@account-kit/infra\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const lightAccountClient = await createMultiOwnerLightAccountAlchemyClient({\n * transport: alchemy({\n * apiKey: \"your-api-key\",\n * }),\n * chain: sepolia\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {AlchemyMultiOwnerLightAccountClientConfig} config The configuration for creating the Alchemy client\n * @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created account information and methods\n */\nexport async function createMultiOwnerLightAccountAlchemyClient({\n opts,\n transport,\n chain,\n ...config\n}: AlchemyMultiOwnerLightAccountClientConfig): Promise<AlchemySmartAccountClient> {\n const account = await createMultiOwnerLightAccount({\n ...config,\n transport,\n chain,\n });\n\n return createAlchemySmartAccountClient({\n ...config,\n transport,\n chain,\n account,\n opts,\n }).extend(multiOwnerLightAccountClientActions);\n}\n"]}
1
+ {"version":3,"file":"multiOwnerAlchemyClient.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerAlchemyClient.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kCAAkC,GAInC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAc,MAAM,MAAM,CAAC;AAyBlC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,KAAK,UAAU,yCAAyC,CAAC,EAC9D,IAAI,EACJ,SAAS,EACT,KAAK,EACL,GAAG,MAAM,EACiC;IAC1C,OAAO,kCAAkC,CAAC;QACxC,IAAI;QACJ,SAAS;QACT,KAAK;QACL,GAAG,MAAM;KACV,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { HttpTransport, SmartAccountSigner } from \"@aa-sdk/core\";\nimport {\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n createMultiOwnerLightAccountClient,\n type CreateMultiOwnerLightAccountParams,\n type MultiOwnerLightAccount,\n type MultiOwnerLightAccountClientActions,\n} from \"@account-kit/smart-contracts\";\nimport { type Chain } from \"viem\";\n\nexport type AlchemyMultiOwnerLightAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateMultiOwnerLightAccountParams<HttpTransport, TSigner>,\n \"transport\" | \"type\"\n> &\n Omit<\n AlchemySmartAccountClientConfig<Chain, MultiOwnerLightAccount<TSigner>>,\n \"account\"\n >;\n\nexport async function createMultiOwnerLightAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyMultiOwnerLightAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n Chain | undefined,\n MultiOwnerLightAccount<TSigner>,\n MultiOwnerLightAccountClientActions<TSigner>\n >\n>;\n\n/**\n * Creates a multi-owner light account Alchemy client using the provided configuration.\n *\n * @example\n * ```ts\n * import { createMultiOwnerLightAccountAlchemyClient } from \"@account-kit/smart-contracts\";\n * import { sepolia, alchemy } from \"@account-kit/infra\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const lightAccountClient = await createMultiOwnerLightAccountAlchemyClient({\n * transport: alchemy({\n * apiKey: \"your-api-key\",\n * }),\n * chain: sepolia\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @deprecated Use createMultiOwnerLightAccountAlchemyClient instead now, it should switch depending on the transport\n * @param {AlchemyMultiOwnerLightAccountClientConfig} config The configuration for creating the Alchemy client\n * @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created account information and methods\n */\nexport async function createMultiOwnerLightAccountAlchemyClient({\n opts,\n transport,\n chain,\n ...config\n}: AlchemyMultiOwnerLightAccountClientConfig): Promise<AlchemySmartAccountClient> {\n return createMultiOwnerLightAccountClient({\n opts,\n transport,\n chain,\n ...config,\n });\n}\n"]}
@@ -1,9 +1,15 @@
1
- import { type SmartAccountClient, type SmartAccountClientActions, type SmartAccountClientConfig, type SmartAccountSigner, type SmartContractAccount } from "@aa-sdk/core";
1
+ import { type NotType, type SmartAccountClient, type SmartAccountClientActions, type SmartAccountClientConfig, type SmartAccountSigner, type SmartContractAccount } from "@aa-sdk/core";
2
2
  import { type Chain, type CustomTransport, type Transport } from "viem";
3
- import { type CreateMultiOwnerLightAccountParams, type MultiOwnerLightAccount } from "../accounts/multiOwner.js";
4
- import { type MultiOwnerLightAccountClientActions } from "../decorators/multiOwnerLightAccount.js";
3
+ import { type CreateMultiOwnerLightAccountParams, type MultiOwnerLightAccount, type MultiOwnerLightAccountClientActions, type AlchemyMultiOwnerLightAccountClientConfig } from "@account-kit/smart-contracts";
4
+ import { type AlchemySmartAccountClient, type AlchemyTransport } from "@account-kit/infra";
5
5
  export type CreateMultiOwnerLightAccountClientParams<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner> = {
6
6
  transport: CreateMultiOwnerLightAccountParams<TTransport, TSigner>["transport"];
7
7
  chain: CreateMultiOwnerLightAccountParams<TTransport, TSigner>["chain"];
8
8
  } & Omit<CreateMultiOwnerLightAccountParams<TTransport, TSigner>, "transport" | "chain"> & Omit<SmartAccountClientConfig<TTransport, TChain>, "transport" | "account" | "chain">;
9
- export declare function createMultiOwnerLightAccountClient<TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner>(args: CreateMultiOwnerLightAccountClientParams<Transport, TChain, TSigner>): Promise<SmartAccountClient<CustomTransport, Chain, MultiOwnerLightAccount<TSigner>, SmartAccountClientActions<Chain, SmartContractAccount> & MultiOwnerLightAccountClientActions<TSigner, MultiOwnerLightAccount<TSigner>>>>;
9
+ export type CreateMultiOwnerLightAccountClientDynamicTransportParams<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner> = (AlchemyMultiOwnerLightAccountClientConfig<TSigner> & {
10
+ transport: AlchemyTransport;
11
+ }) | CreateMultiOwnerLightAccountClientParams<TTransport, TChain, TSigner>;
12
+ export declare function createMultiOwnerLightAccountClient<TSigner extends SmartAccountSigner = SmartAccountSigner>(params: AlchemyMultiOwnerLightAccountClientConfig<TSigner> & {
13
+ transport: AlchemyTransport;
14
+ }): Promise<AlchemySmartAccountClient<Chain | undefined, MultiOwnerLightAccount<TSigner>, MultiOwnerLightAccountClientActions<TSigner>>>;
15
+ export declare function createMultiOwnerLightAccountClient<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner>(args: CreateMultiOwnerLightAccountClientParams<TTransport, TChain, TSigner> & NotType<TTransport, AlchemyTransport>): Promise<SmartAccountClient<CustomTransport, Chain, MultiOwnerLightAccount<TSigner>, SmartAccountClientActions<Chain, SmartContractAccount> & MultiOwnerLightAccountClientActions<TSigner, MultiOwnerLightAccount<TSigner>>>>;
@@ -1,7 +1,7 @@
1
1
  import { createSmartAccountClient, } from "@aa-sdk/core";
2
2
  import {} from "viem";
3
- import { createMultiOwnerLightAccount, } from "../accounts/multiOwner.js";
4
- import { multiOwnerLightAccountClientActions, } from "../decorators/multiOwnerLightAccount.js";
3
+ import { multiOwnerLightAccountClientActions, createMultiOwnerLightAccount, } from "@account-kit/smart-contracts";
4
+ import { isAlchemyTransport, createAlchemySmartAccountClient, } from "@account-kit/infra";
5
5
  /**
6
6
  * Creates a multi-owner light account client using the provided parameters. It first creates a multi-owner light account and then creates a smart account client with the provided configurations.
7
7
  *
@@ -19,7 +19,23 @@ import { multiOwnerLightAccountClientActions, } from "../decorators/multiOwnerLi
19
19
  * });
20
20
  * ```
21
21
  *
22
- * @param {CreateMultiOwnerLightAccountClientParams} params the configuration for creating the multi-owner light account client
22
+ * @example
23
+ * ```ts
24
+ * import { createMultiOwnerLightAccountClient } from "@account-kit/smart-contracts";
25
+ * import { sepolia, alchemy } from "@account-kit/infra";
26
+ * import { LocalAccountSigner } from "@aa-sdk/core";
27
+ * import { generatePrivateKey } from "viem"
28
+ *
29
+ * const lightAccountClient = await createMultiOwnerLightAccountClient({
30
+ * transport: alchemy({
31
+ * apiKey: "your-api-key",
32
+ * }),
33
+ * chain: sepolia
34
+ * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
35
+ * });
36
+ * ```
37
+ *
38
+ * @param {CreateMultiOwnerLightAccountClientDynamicTransportParams} params the configuration for creating the multi-owner light / alchemy account client with the provided parameters transport
23
39
  * @returns {Promise<SmartAccountClient>} a promise that resolves to a `SmartAccountClient` containing the created account client and relevant methods
24
40
  */
25
41
  export async function createMultiOwnerLightAccountClient(params) {
@@ -29,6 +45,14 @@ export async function createMultiOwnerLightAccountClient(params) {
29
45
  transport,
30
46
  chain,
31
47
  });
48
+ if (isAlchemyTransport(transport, chain)) {
49
+ return createAlchemySmartAccountClient({
50
+ ...params,
51
+ transport,
52
+ chain,
53
+ account: lightAccount,
54
+ }).extend(multiOwnerLightAccountClientActions);
55
+ }
32
56
  return createSmartAccountClient({
33
57
  ...params,
34
58
  transport,
@@ -1 +1 @@
1
- {"version":3,"file":"multiOwnerLightAccount.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerLightAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,GAMzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAoD,MAAM,MAAM,CAAC;AACxE,OAAO,EACL,4BAA4B,GAG7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,mCAAmC,GAEpC,MAAM,yCAAyC,CAAC;AAuCjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,kCAAkC,CACtD,MAAgD;IAEhD,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IAEpC,MAAM,YAAY,GAAG,MAAM,4BAA4B,CAAC;QACtD,GAAG,MAAM;QACT,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,OAAO,wBAAwB,CAAC;QAC9B,GAAG,MAAM;QACT,SAAS;QACT,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC,MAAM,CAAC,mCAAmC,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import {\n createSmartAccountClient,\n type SmartAccountClient,\n type SmartAccountClientActions,\n type SmartAccountClientConfig,\n type SmartAccountSigner,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { type Chain, type CustomTransport, type Transport } from \"viem\";\nimport {\n createMultiOwnerLightAccount,\n type CreateMultiOwnerLightAccountParams,\n type MultiOwnerLightAccount,\n} from \"../accounts/multiOwner.js\";\nimport {\n multiOwnerLightAccountClientActions,\n type MultiOwnerLightAccountClientActions,\n} from \"../decorators/multiOwnerLightAccount.js\";\n\nexport type CreateMultiOwnerLightAccountClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = {\n transport: CreateMultiOwnerLightAccountParams<\n TTransport,\n TSigner\n >[\"transport\"];\n chain: CreateMultiOwnerLightAccountParams<TTransport, TSigner>[\"chain\"];\n} & Omit<\n CreateMultiOwnerLightAccountParams<TTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<\n SmartAccountClientConfig<TTransport, TChain>,\n \"transport\" | \"account\" | \"chain\"\n >;\n\nexport function createMultiOwnerLightAccountClient<\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n args: CreateMultiOwnerLightAccountClientParams<Transport, TChain, TSigner>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n Chain,\n MultiOwnerLightAccount<TSigner>,\n SmartAccountClientActions<Chain, SmartContractAccount> &\n MultiOwnerLightAccountClientActions<\n TSigner,\n MultiOwnerLightAccount<TSigner>\n >\n >\n>;\n\n/**\n * Creates a multi-owner light account client using the provided parameters. It first creates a multi-owner light account and then creates a smart account client with the provided configurations.\n *\n * @example\n * ```ts\n * import { createMultiOwnerLightAccountClient } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http, generatePrivateKey } from \"viem\"\n *\n * const account = await createMultiOwnerLightAccountClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {CreateMultiOwnerLightAccountClientParams} params the configuration for creating the multi-owner light account client\n * @returns {Promise<SmartAccountClient>} a promise that resolves to a `SmartAccountClient` containing the created account client and relevant methods\n */\nexport async function createMultiOwnerLightAccountClient(\n params: CreateMultiOwnerLightAccountClientParams\n): Promise<SmartAccountClient> {\n const { transport, chain } = params;\n\n const lightAccount = await createMultiOwnerLightAccount({\n ...params,\n transport,\n chain,\n });\n\n return createSmartAccountClient({\n ...params,\n transport,\n chain: chain,\n account: lightAccount,\n }).extend(multiOwnerLightAccountClientActions);\n}\n"]}
1
+ {"version":3,"file":"multiOwnerLightAccount.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerLightAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,GAOzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAoD,MAAM,MAAM,CAAC;AACxE,OAAO,EACL,mCAAmC,EACnC,4BAA4B,GAK7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,kBAAkB,EAClB,+BAA+B,GAGhC,MAAM,oBAAoB,CAAC;AAiE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,KAAK,UAAU,kCAAkC,CACtD,MAAgE;IAEhE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IAEpC,MAAM,YAAY,GAAG,MAAM,4BAA4B,CAAC;QACtD,GAAG,MAAM;QACT,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IACH,IAAI,kBAAkB,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,+BAA+B,CAAC;YACrC,GAAG,MAAM;YACT,SAAS;YACT,KAAK;YACL,OAAO,EAAE,YAAY;SACtB,CAAC,CAAC,MAAM,CAAC,mCAAmC,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,wBAAwB,CAAC;QAC9B,GAAG,MAAM;QACT,SAAS;QACT,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC,MAAM,CAAC,mCAAmC,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import {\n createSmartAccountClient,\n type NotType,\n type SmartAccountClient,\n type SmartAccountClientActions,\n type SmartAccountClientConfig,\n type SmartAccountSigner,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { type Chain, type CustomTransport, type Transport } from \"viem\";\nimport {\n multiOwnerLightAccountClientActions,\n createMultiOwnerLightAccount,\n type CreateMultiOwnerLightAccountParams,\n type MultiOwnerLightAccount,\n type MultiOwnerLightAccountClientActions,\n type AlchemyMultiOwnerLightAccountClientConfig,\n} from \"@account-kit/smart-contracts\";\nimport {\n isAlchemyTransport,\n createAlchemySmartAccountClient,\n type AlchemySmartAccountClient,\n type AlchemyTransport,\n} from \"@account-kit/infra\";\n\nexport type CreateMultiOwnerLightAccountClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = {\n transport: CreateMultiOwnerLightAccountParams<\n TTransport,\n TSigner\n >[\"transport\"];\n chain: CreateMultiOwnerLightAccountParams<TTransport, TSigner>[\"chain\"];\n} & Omit<\n CreateMultiOwnerLightAccountParams<TTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<\n SmartAccountClientConfig<TTransport, TChain>,\n \"transport\" | \"account\" | \"chain\"\n >;\n\nexport type CreateMultiOwnerLightAccountClientDynamicTransportParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> =\n | (AlchemyMultiOwnerLightAccountClientConfig<TSigner> & {\n transport: AlchemyTransport;\n })\n | CreateMultiOwnerLightAccountClientParams<TTransport, TChain, TSigner>;\n\nexport async function createMultiOwnerLightAccountClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyMultiOwnerLightAccountClientConfig<TSigner> & {\n transport: AlchemyTransport;\n }\n): Promise<\n AlchemySmartAccountClient<\n Chain | undefined,\n MultiOwnerLightAccount<TSigner>,\n MultiOwnerLightAccountClientActions<TSigner>\n >\n>;\n\nexport function createMultiOwnerLightAccountClient<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n args: CreateMultiOwnerLightAccountClientParams<TTransport, TChain, TSigner> &\n NotType<TTransport, AlchemyTransport>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n Chain,\n MultiOwnerLightAccount<TSigner>,\n SmartAccountClientActions<Chain, SmartContractAccount> &\n MultiOwnerLightAccountClientActions<\n TSigner,\n MultiOwnerLightAccount<TSigner>\n >\n >\n>;\n\n/**\n * Creates a multi-owner light account client using the provided parameters. It first creates a multi-owner light account and then creates a smart account client with the provided configurations.\n *\n * @example\n * ```ts\n * import { createMultiOwnerLightAccountClient } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http, generatePrivateKey } from \"viem\"\n *\n * const account = await createMultiOwnerLightAccountClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @example\n * ```ts\n * import { createMultiOwnerLightAccountClient } from \"@account-kit/smart-contracts\";\n * import { sepolia, alchemy } from \"@account-kit/infra\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const lightAccountClient = await createMultiOwnerLightAccountClient({\n * transport: alchemy({\n * apiKey: \"your-api-key\",\n * }),\n * chain: sepolia\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {CreateMultiOwnerLightAccountClientDynamicTransportParams} params the configuration for creating the multi-owner light / alchemy account client with the provided parameters transport\n * @returns {Promise<SmartAccountClient>} a promise that resolves to a `SmartAccountClient` containing the created account client and relevant methods\n */\nexport async function createMultiOwnerLightAccountClient(\n params: CreateMultiOwnerLightAccountClientDynamicTransportParams\n): Promise<SmartAccountClient | AlchemySmartAccountClient> {\n const { transport, chain } = params;\n\n const lightAccount = await createMultiOwnerLightAccount({\n ...params,\n transport,\n chain,\n });\n if (isAlchemyTransport(transport, chain)) {\n return createAlchemySmartAccountClient({\n ...params,\n transport,\n chain,\n account: lightAccount,\n }).extend(multiOwnerLightAccountClientActions);\n }\n\n return createSmartAccountClient({\n ...params,\n transport,\n chain: chain,\n account: lightAccount,\n }).extend(multiOwnerLightAccountClientActions);\n}\n"]}