permissionless 0.0.26 → 0.0.28

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 (180) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js +16 -13
  3. package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js.map +1 -1
  4. package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js +16 -13
  5. package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -1
  6. package/_cjs/accounts/signerToSafeSmartAccount.js +20 -17
  7. package/_cjs/accounts/signerToSafeSmartAccount.js.map +1 -1
  8. package/_cjs/accounts/signerToSimpleSmartAccount.js +15 -12
  9. package/_cjs/accounts/signerToSimpleSmartAccount.js.map +1 -1
  10. package/_cjs/actions/bundler/estimateUserOperationGas.js.map +1 -1
  11. package/_cjs/actions/bundler/getUserOperationByHash.js.map +1 -1
  12. package/_cjs/actions/bundler/getUserOperationReceipt.js.map +1 -1
  13. package/_cjs/actions/bundler/sendUserOperation.js.map +1 -1
  14. package/_cjs/actions/bundler/waitForUserOperationReceipt.js.map +1 -1
  15. package/_cjs/actions/pimlico/getUserOperationGasPrice.js.map +1 -1
  16. package/_cjs/actions/pimlico/getUserOperationStatus.js.map +1 -1
  17. package/_cjs/actions/pimlico/sponsorUserOperation.js.map +1 -1
  18. package/_cjs/actions/pimlico/validateSponsorshipPolicies.js.map +1 -1
  19. package/_cjs/actions/public/getAccountNonce.js +2 -1
  20. package/_cjs/actions/public/getAccountNonce.js.map +1 -1
  21. package/_cjs/actions/public/getSenderAddress.js +2 -1
  22. package/_cjs/actions/public/getSenderAddress.js.map +1 -1
  23. package/_cjs/actions/smartAccount/deployContract.js +4 -3
  24. package/_cjs/actions/smartAccount/deployContract.js.map +1 -1
  25. package/_cjs/actions/smartAccount/prepareUserOperationRequest.js.map +1 -1
  26. package/_cjs/actions/smartAccount/sendTransaction.js.map +1 -1
  27. package/_cjs/actions/smartAccount/sendTransactions.js.map +1 -1
  28. package/_cjs/actions/smartAccount/sendUserOperation.js +1 -2
  29. package/_cjs/actions/smartAccount/sendUserOperation.js.map +1 -1
  30. package/_cjs/actions/smartAccount/signTypedData.js.map +1 -1
  31. package/_cjs/actions/smartAccount.js.map +1 -1
  32. package/_cjs/clients/createSmartAccountClient.js.map +1 -1
  33. package/_cjs/clients/decorators/bundler.js.map +1 -1
  34. package/_cjs/clients/decorators/pimlico.js.map +1 -1
  35. package/_cjs/clients/decorators/smartAccount.js +30 -28
  36. package/_cjs/clients/decorators/smartAccount.js.map +1 -1
  37. package/_cjs/utils/deepHexlify.js.map +1 -1
  38. package/_cjs/utils/index.js +3 -1
  39. package/_cjs/utils/index.js.map +1 -1
  40. package/_cjs/utils/isSmartAccountDeployed.js +15 -0
  41. package/_cjs/utils/isSmartAccountDeployed.js.map +1 -0
  42. package/_cjs/utils/observe.js.map +1 -1
  43. package/_cjs/utils/signUserOperationHashWithECDSA.js.map +1 -1
  44. package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js +17 -14
  45. package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js.map +1 -1
  46. package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js +17 -14
  47. package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -1
  48. package/_esm/accounts/signerToSafeSmartAccount.js +21 -18
  49. package/_esm/accounts/signerToSafeSmartAccount.js.map +1 -1
  50. package/_esm/accounts/signerToSimpleSmartAccount.js +16 -13
  51. package/_esm/accounts/signerToSimpleSmartAccount.js.map +1 -1
  52. package/_esm/actions/bundler/estimateUserOperationGas.js.map +1 -1
  53. package/_esm/actions/bundler/getUserOperationByHash.js.map +1 -1
  54. package/_esm/actions/bundler/getUserOperationReceipt.js.map +1 -1
  55. package/_esm/actions/bundler/sendUserOperation.js.map +1 -1
  56. package/_esm/actions/bundler/waitForUserOperationReceipt.js.map +1 -1
  57. package/_esm/actions/pimlico/getUserOperationGasPrice.js.map +1 -1
  58. package/_esm/actions/pimlico/getUserOperationStatus.js.map +1 -1
  59. package/_esm/actions/pimlico/sponsorUserOperation.js.map +1 -1
  60. package/_esm/actions/pimlico/validateSponsorshipPolicies.js +1 -1
  61. package/_esm/actions/pimlico/validateSponsorshipPolicies.js.map +1 -1
  62. package/_esm/actions/public/getAccountNonce.js +2 -1
  63. package/_esm/actions/public/getAccountNonce.js.map +1 -1
  64. package/_esm/actions/public/getSenderAddress.js +2 -1
  65. package/_esm/actions/public/getSenderAddress.js.map +1 -1
  66. package/_esm/actions/smartAccount/deployContract.js +5 -5
  67. package/_esm/actions/smartAccount/deployContract.js.map +1 -1
  68. package/_esm/actions/smartAccount/prepareUserOperationRequest.js.map +1 -1
  69. package/_esm/actions/smartAccount/sendTransaction.js +1 -1
  70. package/_esm/actions/smartAccount/sendTransaction.js.map +1 -1
  71. package/_esm/actions/smartAccount/sendTransactions.js +1 -1
  72. package/_esm/actions/smartAccount/sendTransactions.js.map +1 -1
  73. package/_esm/actions/smartAccount/sendUserOperation.js +1 -2
  74. package/_esm/actions/smartAccount/sendUserOperation.js.map +1 -1
  75. package/_esm/actions/smartAccount/signTypedData.js.map +1 -1
  76. package/_esm/actions/smartAccount.js.map +1 -1
  77. package/_esm/clients/createSmartAccountClient.js.map +1 -1
  78. package/_esm/clients/decorators/bundler.js.map +1 -1
  79. package/_esm/clients/decorators/pimlico.js +1 -1
  80. package/_esm/clients/decorators/pimlico.js.map +1 -1
  81. package/_esm/clients/decorators/smartAccount.js +30 -28
  82. package/_esm/clients/decorators/smartAccount.js.map +1 -1
  83. package/_esm/utils/deepHexlify.js.map +1 -1
  84. package/_esm/utils/index.js +2 -1
  85. package/_esm/utils/index.js.map +1 -1
  86. package/_esm/utils/isSmartAccountDeployed.js +11 -0
  87. package/_esm/utils/isSmartAccountDeployed.js.map +1 -0
  88. package/_esm/utils/observe.js.map +1 -1
  89. package/_esm/utils/signUserOperationHashWithECDSA.js.map +1 -1
  90. package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts +2 -1
  91. package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts.map +1 -1
  92. package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts +2 -1
  93. package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts.map +1 -1
  94. package/_types/accounts/signerToSafeSmartAccount.d.ts +3 -2
  95. package/_types/accounts/signerToSafeSmartAccount.d.ts.map +1 -1
  96. package/_types/accounts/signerToSimpleSmartAccount.d.ts +2 -1
  97. package/_types/accounts/signerToSimpleSmartAccount.d.ts.map +1 -1
  98. package/_types/accounts/types.d.ts +3 -3
  99. package/_types/accounts/types.d.ts.map +1 -1
  100. package/_types/actions/bundler/estimateUserOperationGas.d.ts +2 -1
  101. package/_types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -1
  102. package/_types/actions/bundler/getUserOperationByHash.d.ts +3 -2
  103. package/_types/actions/bundler/getUserOperationByHash.d.ts.map +1 -1
  104. package/_types/actions/bundler/getUserOperationReceipt.d.ts +2 -1
  105. package/_types/actions/bundler/getUserOperationReceipt.d.ts.map +1 -1
  106. package/_types/actions/bundler/sendUserOperation.d.ts +2 -1
  107. package/_types/actions/bundler/sendUserOperation.d.ts.map +1 -1
  108. package/_types/actions/bundler/waitForUserOperationReceipt.d.ts +2 -1
  109. package/_types/actions/bundler/waitForUserOperationReceipt.d.ts.map +1 -1
  110. package/_types/actions/pimlico/getUserOperationGasPrice.d.ts +2 -1
  111. package/_types/actions/pimlico/getUserOperationGasPrice.d.ts.map +1 -1
  112. package/_types/actions/pimlico/getUserOperationStatus.d.ts +2 -1
  113. package/_types/actions/pimlico/getUserOperationStatus.d.ts.map +1 -1
  114. package/_types/actions/pimlico/sponsorUserOperation.d.ts +2 -1
  115. package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -1
  116. package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts +5 -4
  117. package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts.map +1 -1
  118. package/_types/actions/pimlico.d.ts +2 -2
  119. package/_types/actions/pimlico.d.ts.map +1 -1
  120. package/_types/actions/public/getAccountNonce.d.ts +2 -1
  121. package/_types/actions/public/getAccountNonce.d.ts.map +1 -1
  122. package/_types/actions/public/getSenderAddress.d.ts +2 -1
  123. package/_types/actions/public/getSenderAddress.d.ts.map +1 -1
  124. package/_types/actions/smartAccount/deployContract.d.ts +4 -3
  125. package/_types/actions/smartAccount/deployContract.d.ts.map +1 -1
  126. package/_types/actions/smartAccount/prepareUserOperationRequest.d.ts +2 -2
  127. package/_types/actions/smartAccount/prepareUserOperationRequest.d.ts.map +1 -1
  128. package/_types/actions/smartAccount/sendTransaction.d.ts +4 -3
  129. package/_types/actions/smartAccount/sendTransaction.d.ts.map +1 -1
  130. package/_types/actions/smartAccount/sendTransactions.d.ts +4 -4
  131. package/_types/actions/smartAccount/sendTransactions.d.ts.map +1 -1
  132. package/_types/actions/smartAccount/sendUserOperation.d.ts +3 -4
  133. package/_types/actions/smartAccount/sendUserOperation.d.ts.map +1 -1
  134. package/_types/actions/smartAccount/writeContract.d.ts +3 -3
  135. package/_types/actions/smartAccount/writeContract.d.ts.map +1 -1
  136. package/_types/actions/smartAccount.d.ts +2 -2
  137. package/_types/actions/smartAccount.d.ts.map +1 -1
  138. package/_types/clients/createSmartAccountClient.d.ts +5 -3
  139. package/_types/clients/createSmartAccountClient.d.ts.map +1 -1
  140. package/_types/clients/decorators/bundler.d.ts +6 -5
  141. package/_types/clients/decorators/bundler.d.ts.map +1 -1
  142. package/_types/clients/decorators/pimlico.d.ts +7 -6
  143. package/_types/clients/decorators/pimlico.d.ts.map +1 -1
  144. package/_types/clients/decorators/smartAccount.d.ts +8 -7
  145. package/_types/clients/decorators/smartAccount.d.ts.map +1 -1
  146. package/_types/utils/index.d.ts +2 -1
  147. package/_types/utils/index.d.ts.map +1 -1
  148. package/_types/utils/isSmartAccountDeployed.d.ts +3 -0
  149. package/_types/utils/isSmartAccountDeployed.d.ts.map +1 -0
  150. package/accounts/biconomy/signerToBiconomySmartAccount.ts +25 -18
  151. package/accounts/kernel/signerToEcdsaKernelSmartAccount.ts +24 -13
  152. package/accounts/signerToSafeSmartAccount.ts +24 -18
  153. package/accounts/signerToSimpleSmartAccount.ts +25 -18
  154. package/accounts/types.ts +4 -3
  155. package/actions/bundler/estimateUserOperationGas.ts +3 -2
  156. package/actions/bundler/getUserOperationByHash.ts +4 -3
  157. package/actions/bundler/getUserOperationReceipt.ts +3 -2
  158. package/actions/bundler/sendUserOperation.ts +2 -1
  159. package/actions/bundler/waitForUserOperationReceipt.ts +3 -2
  160. package/actions/pimlico/getUserOperationGasPrice.ts +2 -1
  161. package/actions/pimlico/getUserOperationStatus.ts +3 -2
  162. package/actions/pimlico/sponsorUserOperation.ts +3 -2
  163. package/actions/pimlico/validateSponsorshipPolicies.ts +6 -5
  164. package/actions/pimlico.ts +2 -2
  165. package/actions/public/getAccountNonce.ts +4 -1
  166. package/actions/public/getSenderAddress.ts +4 -1
  167. package/actions/smartAccount/deployContract.ts +19 -15
  168. package/actions/smartAccount/prepareUserOperationRequest.ts +3 -2
  169. package/actions/smartAccount/sendTransaction.ts +6 -7
  170. package/actions/smartAccount/sendTransactions.ts +5 -5
  171. package/actions/smartAccount/sendUserOperation.ts +5 -12
  172. package/actions/smartAccount/writeContract.ts +3 -3
  173. package/actions/smartAccount.ts +0 -2
  174. package/clients/createSmartAccountClient.ts +10 -16
  175. package/clients/decorators/bundler.ts +12 -9
  176. package/clients/decorators/pimlico.ts +12 -9
  177. package/clients/decorators/smartAccount.ts +34 -25
  178. package/package.json +1 -1
  179. package/utils/index.ts +3 -1
  180. package/utils/isSmartAccountDeployed.ts +16 -0
@@ -1 +1 @@
1
- {"version":3,"file":"createSmartAccountClient.d.ts","sourceRoot":"","sources":["../../clients/createSmartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,KAAK,EACL,MAAM,EACN,YAAY,EAC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AAW,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,iBAAiB,GAAG,WAAW,CAC3E,GAAG;IACA,OAAO,CAAC,EAAE,OAAO,CAAA;CACpB,GAAG,8BAA8B,CACrC,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wBAAgB,wBAAwB,CACpC,UAAU,SAAS,SAAS,EAC5B,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,SAAS,EAC5C,aAAa,SAAS,YAAY,GAAG,SAAS,GAAG,SAAS,EAE1D,UAAU,EAAE,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,GACxE,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,CAAA"}
@@ -5,6 +5,7 @@ import { type GetUserOperationByHashParameters, type GetUserOperationByHashRetur
5
5
  import { type GetUserOperationReceiptParameters, type GetUserOperationReceiptReturnType } from "../../actions/bundler/getUserOperationReceipt.js";
6
6
  import { type SendUserOperationParameters } from "../../actions/bundler/sendUserOperation.js";
7
7
  import { type WaitForUserOperationReceiptParameters } from "../../actions/bundler/waitForUserOperationReceipt.js";
8
+ import type { Prettify } from "../../types/index.js";
8
9
  export type BundlerActions = {
9
10
  /**
10
11
  *
@@ -31,7 +32,7 @@ export type BundlerActions = {
31
32
  *
32
33
  * // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
33
34
  */
34
- sendUserOperation: (args: SendUserOperationParameters) => Promise<Hash>;
35
+ sendUserOperation: (args: Prettify<SendUserOperationParameters>) => Promise<Hash>;
35
36
  /**
36
37
  *
37
38
  * Estimates preVerificationGas, verificationGasLimit and callGasLimit for user operation
@@ -57,7 +58,7 @@ export type BundlerActions = {
57
58
  *
58
59
  * // Return {preVerificationGas: 43492n, verificationGasLimit: 59436n, callGasLimit: 9000n}
59
60
  */
60
- estimateUserOperationGas: (args: EstimateUserOperationGasParameters) => Promise<EstimateUserOperationGasReturnType>;
61
+ estimateUserOperationGas: (args: Prettify<EstimateUserOperationGasParameters>) => Promise<Prettify<EstimateUserOperationGasReturnType>>;
61
62
  /**
62
63
  *
63
64
  * Returns the supported entrypoints by the bundler service
@@ -122,7 +123,7 @@ export type BundlerActions = {
122
123
  * await bundlerClient.getUserOperationByHash(userOpHash)
123
124
  *
124
125
  */
125
- getUserOperationByHash: (args: GetUserOperationByHashParameters) => Promise<GetUserOperationByHashReturnType>;
126
+ getUserOperationByHash: (args: Prettify<GetUserOperationByHashParameters>) => Promise<Prettify<GetUserOperationByHashReturnType> | null>;
126
127
  /**
127
128
  *
128
129
  * Returns the user operation receipt from userOpHash
@@ -144,7 +145,7 @@ export type BundlerActions = {
144
145
  * await bundlerClient.getUserOperationReceipt({hash: userOpHash})
145
146
  *
146
147
  */
147
- getUserOperationReceipt: (args: GetUserOperationReceiptParameters) => Promise<GetUserOperationReceiptReturnType | null>;
148
+ getUserOperationReceipt: (args: Prettify<GetUserOperationReceiptParameters>) => Promise<Prettify<GetUserOperationReceiptReturnType> | null>;
148
149
  /**
149
150
  * Waits for the User Operation to be included on a [Block](https://viem.sh/docs/glossary/terms.html#block) (one confirmation), and then returns the [User Operation Receipt](https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt).
150
151
  *
@@ -166,7 +167,7 @@ export type BundlerActions = {
166
167
  * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
167
168
  * })
168
169
  */
169
- waitForUserOperationReceipt: (args: WaitForUserOperationReceiptParameters) => Promise<GetUserOperationReceiptReturnType>;
170
+ waitForUserOperationReceipt: (args: Prettify<WaitForUserOperationReceiptParameters>) => Promise<Prettify<GetUserOperationReceiptReturnType>>;
170
171
  };
171
172
  declare const bundlerActions: (client: Client) => BundlerActions;
172
173
  export { bundlerActions };
@@ -1 +1 @@
1
- {"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../../clients/decorators/bundler.ts"],"names":[],"mappings":"AAAA,OA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AAA;IAC9C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;IAC9B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,sBAAsB,EAAE,CACpB,IAAI,EAAE,QAAQ,CAAC,gCAAgC,CAAC,KAC/C,OAAO,CAAC,QAAQ,CAAC,gCAAgC,CAAC,GAAG,IAAI,CAAC,CAAA;IAC/D;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,uBAAuB,EAAE,CACrB,IAAI,EAAE,QAAQ,CAAC,iCAAiC,CAAC,KAChD,OAAO,CAAC,QAAQ,CAAC,iCAAiC,CAAC,GAAG,IAAI,CAAC,CAAA;IAEhE;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,2BAA2B,EAAE,CACzB,IAAI,EAAE,QAAQ,CAAC,qCAAqC,CAAC,KACpD,OAAO,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC,CAAA;CAC5D,CAAA;AAED,QAAA,MAAM,cAAc,WAAY,MAAM,KAAG,cAgBvC,CAAA;AAEF,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -1,8 +1,9 @@
1
1
  import type { Client } from "viem";
2
- import { type ValidateSponsorshipPoliciesParameters, type ValidateSponsorshipPoliciesReturnType } from "../../actions/pimlico.js";
2
+ import { type ValidateSponsorshipPolicies, type ValidateSponsorshipPoliciesParameters } from "../../actions/pimlico.js";
3
3
  import { type GetUserOperationGasPriceReturnType } from "../../actions/pimlico/getUserOperationGasPrice.js";
4
4
  import { type GetUserOperationStatusParameters, type GetUserOperationStatusReturnType } from "../../actions/pimlico/getUserOperationStatus.js";
5
5
  import { type PimlicoSponsorUserOperationParameters, type SponsorUserOperationReturnType } from "../../actions/pimlico/sponsorUserOperation.js";
6
+ import type { Prettify } from "../../types/index.js";
6
7
  export type PimlicoBundlerActions = {
7
8
  /**
8
9
  * Returns the live gas prices that you can use to send a user operation.
@@ -23,7 +24,7 @@ export type PimlicoBundlerActions = {
23
24
  *
24
25
  * await bundlerClient.getUserOperationGasPrice()
25
26
  */
26
- getUserOperationGasPrice: () => Promise<GetUserOperationGasPriceReturnType>;
27
+ getUserOperationGasPrice: () => Promise<Prettify<GetUserOperationGasPriceReturnType>>;
27
28
  /**
28
29
  * Returns the status of the userOperation that is pending in the mempool.
29
30
  *
@@ -43,7 +44,7 @@ export type PimlicoBundlerActions = {
43
44
  *
44
45
  * await bundlerClient.getUserOperationStatus({ hash: userOpHash })
45
46
  */
46
- getUserOperationStatus: (args: GetUserOperationStatusParameters) => Promise<GetUserOperationStatusReturnType>;
47
+ getUserOperationStatus: (args: Prettify<GetUserOperationStatusParameters>) => Promise<Prettify<GetUserOperationStatusReturnType>>;
47
48
  };
48
49
  export declare const pimlicoBundlerActions: (client: Client) => PimlicoBundlerActions;
49
50
  export type PimlicoPaymasterClientActions = {
@@ -70,15 +71,15 @@ export type PimlicoPaymasterClientActions = {
70
71
  * }})
71
72
  *
72
73
  */
73
- sponsorUserOperation: (args: PimlicoSponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType>;
74
- validateSponsorshipPolicies: (args: ValidateSponsorshipPoliciesParameters) => Promise<ValidateSponsorshipPoliciesReturnType>;
74
+ sponsorUserOperation: (args: Prettify<PimlicoSponsorUserOperationParameters>) => Promise<Prettify<SponsorUserOperationReturnType>>;
75
+ validateSponsorshipPolicies: (args: Prettify<ValidateSponsorshipPoliciesParameters>) => Promise<Prettify<ValidateSponsorshipPolicies>[]>;
75
76
  };
76
77
  /**
77
78
  * Returns valid sponsorship policies for a userOperation from the list of ids passed
78
79
  * - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/ValidateSponsorshipPolicies
79
80
  *
80
81
  * @param args {@link ValidateSponsorshipPoliciesParameters} UserOperation you want to sponsor & entryPoint.
81
- * @returns valid sponsorship policies, see {@link ValidateSponsorshipPoliciesReturnType}
82
+ * @returns valid sponsorship policies, see {@link ValidateSponsorshipPolicies}
82
83
  *
83
84
  * @example
84
85
  * import { createClient } from "viem"
@@ -1 +1 @@
1
- {"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAQ,MAAM,MAAM,CAAA;AACxC,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,qCAAqC,EAE7C,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACH,KAAK,kCAAkC,EAE1C,MAAM,mDAAmD,CAAA;AAC1D,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EAExC,MAAM,iDAAiD,CAAA;AACxD,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,8BAA8B,EAEtC,MAAM,+CAA+C,CAAA;AAMtD,MAAM,MAAM,qBAAqB,GAAG;IAChC;;;;;;;;;;;;;;;;;;OAkBG;IACH,wBAAwB,EAAE,MAAM,OAAO,CAAC,kCAAkC,CAAC,CAAA;IAC3E;;;;;;;;;;;;;;;;;;OAkBG;IACH,sBAAsB,EAAE,CACpB,IAAI,EAAE,gCAAgC,KACrC,OAAO,CAAC,gCAAgC,CAAC,CAAA;CACjD,CAAA;AAED,eAAO,MAAM,qBAAqB,WACtB,MAAM,KACf,qBAKD,CAAA;AAEF,MAAM,MAAM,6BAA6B,GAAG;IACxC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,oBAAoB,EAAE,CAClB,IAAI,EAAE,qCAAqC,KAC1C,OAAO,CAAC,8BAA8B,CAAC,CAAA;IAE5C,2BAA2B,EAAE,CACzB,IAAI,EAAE,qCAAqC,KAC1C,OAAO,CAAC,qCAAqC,CAAC,CAAA;CACtD,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,uBAAuB,WACxB,MAAM,KACf,6BAMD,CAAA;AAEF;;GAEG"}
1
+ {"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts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MD,CAAA;AAEF;;GAEG"}
@@ -1,13 +1,14 @@
1
- import type { Abi, Chain, Client, ContractFunctionArgs, ContractFunctionName, DeployContractParameters, SendTransactionParameters, Transport, TypedData, WriteContractParameters } from "viem";
1
+ import type { Abi, Chain, Client, ContractFunctionArgs, ContractFunctionName, DeployContractParameters, Hash, SendTransactionParameters, Transport, TypedData, WriteContractParameters } from "viem";
2
2
  import type { SmartAccount } from "../../accounts/types.js";
3
3
  import { type SendTransactionsWithPaymasterParameters, sendTransactions } from "../../actions/smartAccount.js";
4
4
  import { deployContract } from "../../actions/smartAccount/deployContract.js";
5
5
  import { type PrepareUserOperationRequestReturnType, type SponsorUserOperationMiddleware, prepareUserOperationRequest } from "../../actions/smartAccount/prepareUserOperationRequest.js";
6
6
  import { sendTransaction } from "../../actions/smartAccount/sendTransaction.js";
7
- import { type SendUserOperationReturnType, sendUserOperation } from "../../actions/smartAccount/sendUserOperation.js";
7
+ import { sendUserOperation } from "../../actions/smartAccount/sendUserOperation.js";
8
8
  import { signMessage } from "../../actions/smartAccount/signMessage.js";
9
9
  import { signTypedData } from "../../actions/smartAccount/signTypedData.js";
10
10
  import { writeContract } from "../../actions/smartAccount/writeContract.js";
11
+ import type { Prettify } from "../../types/index.js";
11
12
  export type SmartAccountActions<TChain extends Chain | undefined = Chain | undefined, TSmartAccount extends SmartAccount | undefined = SmartAccount | undefined> = {
12
13
  /**
13
14
  * Creates, signs, and sends a new transaction to the network.
@@ -222,7 +223,7 @@ export type SmartAccountActions<TChain extends Chain | undefined = Chain | undef
222
223
  * bytecode: '0x608060405260405161083e38038061083e833981016040819052610...',
223
224
  * })
224
225
  */
225
- deployContract: <const TAbi extends Abi | readonly unknown[], TChainOverride extends Chain | undefined = undefined>(args: DeployContractParameters<TAbi, TChain, TSmartAccount, TChainOverride>) => ReturnType<typeof deployContract<TChain, TSmartAccount>>;
226
+ deployContract: <const TAbi extends Abi | readonly unknown[], TChainOverride extends Chain | undefined = undefined>(args: Prettify<DeployContractParameters<TAbi, TChain, TSmartAccount, TChainOverride>>) => ReturnType<typeof deployContract<TChain, TSmartAccount>>;
226
227
  /**
227
228
  * Executes a write function on a contract.
228
229
  * This function also allows you to sponsor this transaction if sender is a smartAccount
@@ -272,8 +273,8 @@ export type SmartAccountActions<TChain extends Chain | undefined = Chain | undef
272
273
  * const hash = await client.writeContract(request)
273
274
  */
274
275
  writeContract: <const TAbi extends Abi | readonly unknown[], TFunctionName extends ContractFunctionName<TAbi, "nonpayable" | "payable"> = ContractFunctionName<TAbi, "nonpayable" | "payable">, TArgs extends ContractFunctionArgs<TAbi, "nonpayable" | "payable", TFunctionName> = ContractFunctionArgs<TAbi, "nonpayable" | "payable", TFunctionName>, TChainOverride extends Chain | undefined = undefined>(args: WriteContractParameters<TAbi, TFunctionName, TArgs, TChain, TSmartAccount, TChainOverride>) => ReturnType<typeof writeContract<TChain, TSmartAccount, TAbi, TFunctionName, TArgs, TChainOverride>>;
275
- prepareUserOperationRequest: <TTransport extends Transport>(args: Parameters<typeof prepareUserOperationRequest<TTransport, TChain, TSmartAccount>>[1]) => Promise<PrepareUserOperationRequestReturnType>;
276
- sendUserOperation: <TTransport extends Transport>(args: Parameters<typeof sendUserOperation<TTransport, TChain, TSmartAccount>>[1]) => Promise<SendUserOperationReturnType>;
276
+ prepareUserOperationRequest: <TTransport extends Transport>(args: Prettify<Parameters<typeof prepareUserOperationRequest<TTransport, TChain, TSmartAccount>>[1]>) => Promise<Prettify<PrepareUserOperationRequestReturnType>>;
277
+ sendUserOperation: <TTransport extends Transport>(args: Prettify<Parameters<typeof sendUserOperation<TTransport, TChain, TSmartAccount>>[1]>) => Promise<Hash>;
277
278
  /**
278
279
  * Creates, signs, and sends a new transaction to the network.
279
280
  * This function also allows you to sponsor this transaction if sender is a smartAccount
@@ -323,7 +324,7 @@ export type SmartAccountActions<TChain extends Chain | undefined = Chain | undef
323
324
  * value: 10000000000000000n
324
325
  * }])
325
326
  */
326
- sendTransactions: (args: SendTransactionsWithPaymasterParameters<TSmartAccount>) => ReturnType<typeof sendTransactions<TChain, TSmartAccount>>;
327
+ sendTransactions: (args: Prettify<SendTransactionsWithPaymasterParameters<TSmartAccount>>) => ReturnType<typeof sendTransactions<TChain, TSmartAccount>>;
327
328
  };
328
- export declare const smartAccountActions: ({ sponsorUserOperation }: SponsorUserOperationMiddleware) => <TTransport extends Transport, TChain extends Chain | undefined = Chain | undefined, TSmartAccount extends SmartAccount | undefined = SmartAccount | undefined>(client: Client<TTransport, TChain, TSmartAccount>) => SmartAccountActions<TChain, TSmartAccount>;
329
+ export declare function smartAccountActions({ sponsorUserOperation }: SponsorUserOperationMiddleware): <TTransport extends Transport, TChain extends Chain | undefined = Chain | undefined, TSmartAccount extends SmartAccount | undefined = SmartAccount | undefined>(client: Client<TTransport, TChain, TSmartAccount>) => SmartAccountActions<TChain, TSmartAccount>;
329
330
  //# sourceMappingURL=smartAccount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"smartAccount.d.ts","sourceRoot":"","sources":["../../../clients/decorators/smartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,GAAG,EACH,KAAK,EACL,MAAM,EACN,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,EACzB,SAAS,EACT,SAAS,EACT,uBAAuB,EAC1B,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EACH,KAAK,uCAAuC,EAC5C,gBAAgB,EACnB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAEH,cAAc,EACjB,MAAM,8CAA8C,CAAA;AACrD,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,8BAA8B,EACnC,2BAA2B,EAC9B,MAAM,2DAA2D,CAAA;AAClE,OAAO,EAEH,eAAe,EAClB,MAAM,+CAA+C,CAAA;AACtD,OAAO,EAEH,KAAK,2BAA2B,EAChC,iBAAiB,EACpB,MAAM,iDAAiD,CAAA;A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,CAAC,qCAAqC,CAAC,CAAA;IACnD,iBAAiB,EAAE,CAAC,UAAU,SAAS,SAAS,EAC5C,IAAI,EAAE,UAAU,CACZ,OAAO,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,CAC9D,CAAC,CAAC,CAAC,KACH,OAAO,CAAC,2BAA2B,CAAC,CAAA;IACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDG;IACH,gBAAgB,EAAE,CACd,IAAI,EAAE,uCAAuC,CAAC,aAAa,CAAC,KAC3D,UAAU,CAAC,OAAO,gBAAgB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAA;CAClE,CAAA;AAED,eAAO,MAAM,mBAAmB,6BACD,8BAA8B,qQA0CvD,CAAA"}
1
+ {"version":3,"file":"smartAccount.d.ts","sourceRoot":"","sources":["../../../clients/decorators/smartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,GAAG,EACH,KAAK,EACL,MAAM,EACN,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,IAAI,EACJ,yBAAyB,EACzB,SAAS,EACT,SAAS,EACT,uBAAuB,EAC1B,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EACH,KAAK,uCAAuC,EAC5C,gBAAgB,EACnB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAEH,cAAc,EACjB,MAAM,8CAA8C,CAAA;AACrD,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,8BAA8B,EACnC,2BAA2B,EAC9B,MAAM,2DAA2D,CAAA;AAClE,OAAO,EAEH,eAAe,EAClB,MAAM,+CAA+C,CAAA;AACtD,OAAO,EAEH,iBAAiB,EACpB,MAAM,iDAAiD,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,6C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AO,CAAC,QAAQ,CAAC,qCAAqC,CAAC,CAAC,CAAA;IAC7D,iBAAiB,EAAE,CAAC,UAAU,SAAS,SAAS,EAC5C,IAAI,EAAE,QAAQ,CACV,UAAU,CACN,OAAO,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,CAC9D,CAAC,CAAC,CAAC,CACP,KACA,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDG;IACH,gBAAgB,EAAE,CACd,IAAI,EAAE,QAAQ,CAAC,uCAAuC,CAAC,aAAa,CAAC,CAAC,KACrE,UAAU,CAAC,OAAO,gBAAgB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAA;CAClE,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAChC,oBAAoB,EACvB,EAAE,8BAA8B,oQA2ChC"}
@@ -3,8 +3,9 @@ import { deepHexlify, transactionReceiptStatus } from "./deepHexlify.js";
3
3
  import { getAction } from "./getAction.js";
4
4
  import { type GetRequiredPrefundReturnType, getRequiredPrefund } from "./getRequiredPrefund.js";
5
5
  import { type GetUserOperationHashParams, getUserOperationHash } from "./getUserOperationHash.js";
6
+ import { isSmartAccountDeployed } from "./isSmartAccountDeployed";
6
7
  import { AccountOrClientNotFoundError, type SignUserOperationHashWithECDSAParams, signUserOperationHashWithECDSA } from "./signUserOperationHashWithECDSA.js";
7
8
  import { walletClientToCustomSigner } from "./walletClientToCustomSigner.js";
8
9
  export declare function parseAccount(account: Address | Account): Account;
9
- export { transactionReceiptStatus, deepHexlify, getAction, getUserOperationHash, getRequiredPrefund, walletClientToCustomSigner, type GetRequiredPrefundReturnType, type GetUserOperationHashParams, signUserOperationHashWithECDSA, type SignUserOperationHashWithECDSAParams, AccountOrClientNotFoundError };
10
+ export { transactionReceiptStatus, deepHexlify, getAction, getUserOperationHash, getRequiredPrefund, walletClientToCustomSigner, type GetRequiredPrefundReturnType, type GetUserOperationHashParams, signUserOperationHashWithECDSA, type SignUserOperationHashWithECDSAParams, AccountOrClientNotFoundError, isSmartAccountDeployed };
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EACH,KAAK,4BAA4B,EACjC,kBAAkB,EACrB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACH,KAAK,0BAA0B,EAC/B,oBAAoB,EACvB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACH,4BAA4B,EAC5B,KAAK,oCAAoC,EACzC,8BAA8B,EACjC,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AAE5E,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAIhE;AAED,OAAO,EACH,wBAAwB,EACxB,WAAW,EACX,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,8BAA8B,EAC9B,KAAK,oCAAoC,EACzC,4BAA4B,EAC/B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EACH,KAAK,4BAA4B,EACjC,kBAAkB,EACrB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACH,KAAK,0BAA0B,EAC/B,oBAAoB,EACvB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EACH,4BAA4B,EAC5B,KAAK,oCAAoC,EACzC,8BAA8B,EACjC,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AAE5E,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAIhE;AAED,OAAO,EACH,wBAAwB,EACxB,WAAW,EACX,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,8BAA8B,EAC9B,KAAK,oCAAoC,EACzC,4BAA4B,EAC5B,sBAAsB,EACzB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { Address, Client } from "viem";
2
+ export declare const isSmartAccountDeployed: (client: Client, address: Address) => Promise<boolean>;
3
+ //# sourceMappingURL=isSmartAccountDeployed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isSmartAccountDeployed.d.ts","sourceRoot":"","sources":["../../utils/isSmartAccountDeployed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAG3C,eAAO,MAAM,sBAAsB,WACvB,MAAM,WACL,OAAO,KACjB,QAAQ,OAAO,CASjB,CAAA"}
@@ -17,14 +17,10 @@ import {
17
17
  parseAbiParameters
18
18
  } from "viem"
19
19
  import { toAccount } from "viem/accounts"
20
- import {
21
- getBytecode,
22
- getChainId,
23
- signMessage,
24
- signTypedData
25
- } from "viem/actions"
20
+ import { getChainId, signMessage, signTypedData } from "viem/actions"
26
21
  import { getAccountNonce } from "../../actions/public/getAccountNonce.js"
27
22
  import { getUserOperationHash } from "../../utils/getUserOperationHash.js"
23
+ import { isSmartAccountDeployed } from "../../utils/isSmartAccountDeployed.js"
28
24
  import {
29
25
  SignTransactionNotSupportedBySmartAccount,
30
26
  type SmartAccount,
@@ -207,6 +203,7 @@ export async function signerToBiconomySmartAccount<
207
203
  client: Client<TTransport, TChain, undefined>,
208
204
  {
209
205
  signer,
206
+ address,
210
207
  entryPoint,
211
208
  index = 0n,
212
209
  factoryAddress = BICONOMY_ADDRESSES.FACTORY_ADDRESS,
@@ -216,6 +213,7 @@ export async function signerToBiconomySmartAccount<
216
213
  }: {
217
214
  signer: SmartAccountSigner<TSource, TAddress>
218
215
  entryPoint: Address
216
+ address?: Address
219
217
  index?: bigint
220
218
  factoryAddress?: Address
221
219
  accountLogicAddress?: Address
@@ -242,19 +240,25 @@ export async function signerToBiconomySmartAccount<
242
240
 
243
241
  // Fetch account address and chain id
244
242
  const [accountAddress, chainId] = await Promise.all([
245
- getAccountAddress({
246
- owner: viemSigner.address,
247
- ecdsaModuleAddress,
248
- factoryAddress,
249
- accountLogicAddress,
250
- fallbackHandlerAddress,
251
- index
252
- }),
243
+ address ??
244
+ getAccountAddress({
245
+ owner: viemSigner.address,
246
+ ecdsaModuleAddress,
247
+ factoryAddress,
248
+ accountLogicAddress,
249
+ fallbackHandlerAddress,
250
+ index
251
+ }),
253
252
  getChainId(client)
254
253
  ])
255
254
 
256
255
  if (!accountAddress) throw new Error("Account address not found")
257
256
 
257
+ let smartAccountDeployed = await isSmartAccountDeployed(
258
+ client,
259
+ accountAddress
260
+ )
261
+
258
262
  // Build the EOA Signer
259
263
  const account = toAccount({
260
264
  address: accountAddress,
@@ -319,11 +323,14 @@ export async function signerToBiconomySmartAccount<
319
323
 
320
324
  // Encode the init code
321
325
  async getInitCode() {
322
- const contractCode = await getBytecode(client, {
323
- address: accountAddress
324
- })
326
+ if (smartAccountDeployed) return "0x"
327
+
328
+ smartAccountDeployed = await isSmartAccountDeployed(
329
+ client,
330
+ accountAddress
331
+ )
325
332
 
326
- if ((contractCode?.length ?? 0) > 2) return "0x"
333
+ if (smartAccountDeployed) return "0x"
327
334
 
328
335
  return generateInitCode()
329
336
  },
@@ -13,7 +13,6 @@ import {
13
13
  } from "viem"
14
14
  import { toAccount } from "viem/accounts"
15
15
  import {
16
- getBytecode,
17
16
  getChainId,
18
17
  readContract,
19
18
  signMessage,
@@ -22,6 +21,7 @@ import {
22
21
  import { getAccountNonce } from "../../actions/public/getAccountNonce.js"
23
22
  import { getSenderAddress } from "../../actions/public/getSenderAddress.js"
24
23
  import { getUserOperationHash } from "../../utils/getUserOperationHash.js"
24
+ import { isSmartAccountDeployed } from "../../utils/isSmartAccountDeployed.js"
25
25
  import type { SmartAccount } from "../types.js"
26
26
  import {
27
27
  SignTransactionNotSupportedBySmartAccount,
@@ -219,6 +219,7 @@ export async function signerToEcdsaKernelSmartAccount<
219
219
  client: Client<TTransport, TChain, undefined>,
220
220
  {
221
221
  signer,
222
+ address,
222
223
  entryPoint,
223
224
  index = 0n,
224
225
  factoryAddress = KERNEL_ADDRESSES.FACTORY_ADDRESS,
@@ -228,6 +229,7 @@ export async function signerToEcdsaKernelSmartAccount<
228
229
  }: {
229
230
  signer: SmartAccountSigner<TSource, TAddress>
230
231
  entryPoint: Address
232
+ address?: Address
231
233
  index?: bigint
232
234
  factoryAddress?: Address
233
235
  accountLogicAddress?: Address
@@ -255,19 +257,25 @@ export async function signerToEcdsaKernelSmartAccount<
255
257
 
256
258
  // Fetch account address and chain id
257
259
  const [accountAddress, chainId] = await Promise.all([
258
- getAccountAddress<TTransport, TChain>({
259
- client,
260
- entryPoint,
261
- owner: viemSigner.address,
262
- ecdsaValidatorAddress,
263
- initCodeProvider: generateInitCode,
264
- deployedAccountAddress
265
- }),
260
+ address ??
261
+ getAccountAddress<TTransport, TChain>({
262
+ client,
263
+ entryPoint,
264
+ owner: viemSigner.address,
265
+ ecdsaValidatorAddress,
266
+ initCodeProvider: generateInitCode,
267
+ deployedAccountAddress
268
+ }),
266
269
  getChainId(client)
267
270
  ])
268
271
 
269
272
  if (!accountAddress) throw new Error("Account address not found")
270
273
 
274
+ let smartAccountDeployed = await isSmartAccountDeployed(
275
+ client,
276
+ accountAddress
277
+ )
278
+
271
279
  // Build the EOA Signer
272
280
  const account = toAccount({
273
281
  address: accountAddress,
@@ -328,11 +336,14 @@ export async function signerToEcdsaKernelSmartAccount<
328
336
 
329
337
  // Encode the init code
330
338
  async getInitCode() {
331
- const contractCode = await getBytecode(client, {
332
- address: accountAddress
333
- })
339
+ if (smartAccountDeployed) return "0x"
340
+
341
+ smartAccountDeployed = await isSmartAccountDeployed(
342
+ client,
343
+ accountAddress
344
+ )
334
345
 
335
- if ((contractCode?.length ?? 0) > 2) return "0x"
346
+ if (smartAccountDeployed) return "0x"
336
347
 
337
348
  return generateInitCode()
338
349
  },
@@ -22,13 +22,13 @@ import {
22
22
  } from "viem"
23
23
  import { toAccount } from "viem/accounts"
24
24
  import {
25
- getBytecode,
26
25
  getChainId,
27
26
  readContract,
28
27
  signMessage,
29
28
  signTypedData
30
29
  } from "viem/actions"
31
30
  import { getAccountNonce } from "../actions/public/getAccountNonce.js"
31
+ import { isSmartAccountDeployed } from "../utils/isSmartAccountDeployed.js"
32
32
  import {
33
33
  SignTransactionNotSupportedBySmartAccount,
34
34
  type SmartAccount,
@@ -502,6 +502,7 @@ export async function signerToSafeSmartAccount<
502
502
  client: Client<TTransport, TChain>,
503
503
  {
504
504
  signer,
505
+ address,
505
506
  safeVersion,
506
507
  entryPoint,
507
508
  addModuleLibAddress: _addModuleLibAddress,
@@ -516,9 +517,10 @@ export async function signerToSafeSmartAccount<
516
517
  safeModules = [],
517
518
  setupTransactions = []
518
519
  }: {
519
- safeVersion: SafeVersion
520
520
  signer: SmartAccountSigner<TSource, TAddress>
521
+ safeVersion: SafeVersion
521
522
  entryPoint: Address
523
+ address?: Address
522
524
  addModuleLibAddress?: Address
523
525
  safe4337ModuleAddress?: Address
524
526
  safeProxyFactoryAddress?: Address
@@ -561,21 +563,25 @@ export async function signerToSafeSmartAccount<
561
563
  multiSendCallOnlyAddress: _multiSendCallOnlyAddress
562
564
  })
563
565
 
564
- const accountAddress = await getAccountAddress<TTransport, TChain>({
565
- client,
566
- owner: viemSigner.address,
567
- addModuleLibAddress,
568
- safe4337ModuleAddress,
569
- safeProxyFactoryAddress,
570
- safeSingletonAddress,
571
- multiSendAddress,
572
- saltNonce,
573
- setupTransactions,
574
- safeModules
575
- })
566
+ const accountAddress =
567
+ address ??
568
+ (await getAccountAddress<TTransport, TChain>({
569
+ client,
570
+ owner: viemSigner.address,
571
+ addModuleLibAddress,
572
+ safe4337ModuleAddress,
573
+ safeProxyFactoryAddress,
574
+ safeSingletonAddress,
575
+ multiSendAddress,
576
+ saltNonce,
577
+ setupTransactions,
578
+ safeModules
579
+ }))
576
580
 
577
581
  if (!accountAddress) throw new Error("Account address not found")
578
582
 
583
+ let safeDeployed = await isSmartAccountDeployed(client, accountAddress)
584
+
579
585
  const account = toAccount({
580
586
  address: accountAddress,
581
587
  async signMessage({ message }) {
@@ -695,11 +701,11 @@ export async function signerToSafeSmartAccount<
695
701
  )
696
702
  },
697
703
  async getInitCode() {
698
- const contractCode = await getBytecode(client, {
699
- address: accountAddress
700
- })
704
+ if (safeDeployed) return "0x"
705
+
706
+ safeDeployed = await isSmartAccountDeployed(client, accountAddress)
701
707
 
702
- if ((contractCode?.length ?? 0) > 2) return "0x"
708
+ if (safeDeployed) return "0x"
703
709
 
704
710
  return getAccountInitCode({
705
711
  owner: viemSigner.address,
@@ -11,15 +11,11 @@ import {
11
11
  encodeFunctionData
12
12
  } from "viem"
13
13
  import { toAccount } from "viem/accounts"
14
- import {
15
- getBytecode,
16
- getChainId,
17
- signMessage,
18
- signTypedData
19
- } from "viem/actions"
14
+ import { getChainId, signMessage, signTypedData } from "viem/actions"
20
15
  import { getAccountNonce } from "../actions/public/getAccountNonce.js"
21
16
  import { getSenderAddress } from "../actions/public/getSenderAddress.js"
22
17
  import { getUserOperationHash } from "../utils/getUserOperationHash.js"
18
+ import { isSmartAccountDeployed } from "../utils/isSmartAccountDeployed.js"
23
19
  import {
24
20
  SignTransactionNotSupportedBySmartAccount,
25
21
  type SmartAccount,
@@ -113,12 +109,14 @@ export async function signerToSimpleSmartAccount<
113
109
  signer,
114
110
  factoryAddress,
115
111
  entryPoint,
116
- index = 0n
112
+ index = 0n,
113
+ address
117
114
  }: {
118
115
  signer: SmartAccountSigner<TSource, TAddress>
119
116
  factoryAddress: Address
120
117
  entryPoint: Address
121
118
  index?: bigint
119
+ address?: Address
122
120
  }
123
121
  ): Promise<SimpleSmartAccount<TTransport, TChain>> {
124
122
  const viemSigner: LocalAccount = {
@@ -129,18 +127,24 @@ export async function signerToSimpleSmartAccount<
129
127
  } as LocalAccount
130
128
 
131
129
  const [accountAddress, chainId] = await Promise.all([
132
- getAccountAddress<TTransport, TChain>({
133
- client,
134
- factoryAddress,
135
- entryPoint,
136
- owner: viemSigner.address,
137
- index
138
- }),
130
+ address ??
131
+ getAccountAddress<TTransport, TChain>({
132
+ client,
133
+ factoryAddress,
134
+ entryPoint,
135
+ owner: viemSigner.address,
136
+ index
137
+ }),
139
138
  getChainId(client)
140
139
  ])
141
140
 
142
141
  if (!accountAddress) throw new Error("Account address not found")
143
142
 
143
+ let smartAccountDeployed = await isSmartAccountDeployed(
144
+ client,
145
+ accountAddress
146
+ )
147
+
144
148
  const account = toAccount({
145
149
  address: accountAddress,
146
150
  async signMessage({ message }) {
@@ -189,11 +193,14 @@ export async function signerToSimpleSmartAccount<
189
193
  })
190
194
  },
191
195
  async getInitCode() {
192
- const contractCode = await getBytecode(client, {
193
- address: accountAddress
194
- })
196
+ if (smartAccountDeployed) return "0x"
197
+
198
+ smartAccountDeployed = await isSmartAccountDeployed(
199
+ client,
200
+ accountAddress
201
+ )
195
202
 
196
- if ((contractCode?.length ?? 0) > 2) return "0x"
203
+ if (smartAccountDeployed) return "0x"
197
204
 
198
205
  return getAccountInitCode(factoryAddress, viemSigner.address, index)
199
206
  },
package/accounts/types.ts CHANGED
@@ -28,7 +28,8 @@ export class SignTransactionNotSupportedBySmartAccount extends BaseError {
28
28
  export type SmartAccount<
29
29
  Name extends string = string,
30
30
  transport extends Transport = Transport,
31
- chain extends Chain | undefined = Chain | undefined
31
+ chain extends Chain | undefined = Chain | undefined,
32
+ TAbi extends Abi | readonly unknown[] = Abi
32
33
  > = LocalAccount<Name> & {
33
34
  client: Client<transport, chain>
34
35
  entryPoint: Address
@@ -48,7 +49,7 @@ export type SmartAccount<
48
49
  }[]
49
50
  ) => Promise<Hex>
50
51
  getDummySignature(userOperation: UserOperation): Promise<Hex>
51
- encodeDeployCallData: <TAbi extends Abi | readonly unknown[] = Abi>({
52
+ encodeDeployCallData: ({
52
53
  abi,
53
54
  args,
54
55
  bytecode
@@ -57,6 +58,6 @@ export type SmartAccount<
57
58
  }
58
59
 
59
60
  export type SmartAccountSigner<
60
- TSource extends string,
61
+ TSource extends string = string,
61
62
  TAddress extends Address = Address
62
63
  > = Omit<LocalAccount<TSource, TAddress>, "signTransaction">
@@ -2,6 +2,7 @@ import type { Account, Address, Chain, Client, Transport } from "viem"
2
2
  import type { PartialBy } from "viem/types/utils"
3
3
  import type { BundlerClient } from "../../clients/createBundlerClient.js"
4
4
  import type { BundlerRpcSchema } from "../../types/bundler.js"
5
+ import type { Prettify } from "../../types/index.js"
5
6
  import type { UserOperation } from "../../types/userOperation.js"
6
7
  import type { UserOperationWithBigIntAsHex } from "../../types/userOperation.js"
7
8
  import { deepHexlify } from "../../utils/deepHexlify.js"
@@ -53,8 +54,8 @@ export const estimateUserOperationGas = async <
53
54
  TAccount extends Account | undefined = Account | undefined
54
55
  >(
55
56
  client: Client<TTransport, TChain, TAccount, BundlerRpcSchema>,
56
- args: EstimateUserOperationGasParameters
57
- ): Promise<EstimateUserOperationGasReturnType> => {
57
+ args: Prettify<EstimateUserOperationGasParameters>
58
+ ): Promise<Prettify<EstimateUserOperationGasReturnType>> => {
58
59
  const { userOperation, entryPoint } = args
59
60
 
60
61
  const response = await client.request({