@aa-sdk/core 4.0.0-alpha.1 → 4.0.0-alpha.10

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 (263) hide show
  1. package/dist/cjs/account/smartContractAccount.d.ts +9 -3
  2. package/dist/cjs/account/smartContractAccount.js +11 -6
  3. package/dist/cjs/account/smartContractAccount.js.map +1 -1
  4. package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.js.map +1 -1
  5. package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.js.map +1 -1
  6. package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -1
  7. package/dist/cjs/actions/smartAccount/estimateUserOperationGas.js.map +1 -1
  8. package/dist/cjs/actions/smartAccount/internal/initUserOperation.js.map +1 -1
  9. package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.js.map +1 -1
  10. package/dist/cjs/actions/smartAccount/internal/sendUserOperation.js.map +1 -1
  11. package/dist/cjs/actions/smartAccount/sendUserOperation.js.map +1 -1
  12. package/dist/cjs/client/bundlerClient.js.map +1 -1
  13. package/dist/cjs/client/decorators/bundlerClient.js.map +1 -1
  14. package/dist/cjs/client/isSmartAccountClient.js.map +1 -1
  15. package/dist/cjs/client/types.d.ts +2 -7
  16. package/dist/cjs/client/types.js.map +1 -1
  17. package/dist/cjs/ens/utils.d.ts +1 -1
  18. package/dist/cjs/ens/utils.js +3 -3
  19. package/dist/cjs/ens/utils.js.map +1 -1
  20. package/dist/cjs/errors/account.js.map +1 -1
  21. package/dist/cjs/errors/client.js.map +1 -1
  22. package/dist/cjs/errors/entrypoint.js.map +1 -1
  23. package/dist/cjs/errors/signer.js.map +1 -1
  24. package/dist/cjs/errors/transaction.js.map +1 -1
  25. package/dist/cjs/errors/useroperation.js.map +1 -1
  26. package/dist/cjs/index.d.ts +3 -6
  27. package/dist/cjs/index.js +38 -64
  28. package/dist/cjs/index.js.map +1 -1
  29. package/dist/cjs/logger.js.map +1 -1
  30. package/dist/cjs/middleware/actions.js +2 -18
  31. package/dist/cjs/middleware/actions.js.map +1 -1
  32. package/dist/cjs/middleware/defaults/gasEstimator.js +4 -2
  33. package/dist/cjs/middleware/defaults/gasEstimator.js.map +1 -1
  34. package/dist/cjs/middleware/erc7677middleware.d.ts +40 -0
  35. package/dist/cjs/middleware/erc7677middleware.js +77 -0
  36. package/dist/cjs/middleware/erc7677middleware.js.map +1 -0
  37. package/dist/cjs/middleware/noopMiddleware.d.ts +2 -1
  38. package/dist/cjs/middleware/noopMiddleware.js.map +1 -1
  39. package/dist/cjs/middleware/types.d.ts +3 -2
  40. package/dist/cjs/middleware/types.js.map +1 -1
  41. package/dist/cjs/signer/local-account.d.ts +44 -44
  42. package/dist/cjs/signer/local-account.js.map +1 -1
  43. package/dist/cjs/signer/wallet-client.d.ts +44 -44
  44. package/dist/cjs/signer/wallet-client.js.map +1 -1
  45. package/dist/cjs/transport/split.js.map +1 -1
  46. package/dist/cjs/utils/bigint.js.map +1 -1
  47. package/dist/cjs/utils/bytes.js.map +1 -1
  48. package/dist/cjs/utils/defaults.d.ts +2 -4
  49. package/dist/cjs/utils/defaults.js +5 -45
  50. package/dist/cjs/utils/defaults.js.map +1 -1
  51. package/dist/cjs/utils/index.d.ts +0 -3
  52. package/dist/cjs/utils/index.js +1 -25
  53. package/dist/cjs/utils/index.js.map +1 -1
  54. package/dist/cjs/utils/types.js.map +1 -1
  55. package/dist/cjs/utils/userop.js.map +1 -1
  56. package/dist/cjs/version.d.ts +1 -1
  57. package/dist/cjs/version.js +1 -1
  58. package/dist/cjs/version.js.map +1 -1
  59. package/dist/esm/account/smartContractAccount.d.ts +9 -3
  60. package/dist/esm/account/smartContractAccount.js +6 -1
  61. package/dist/esm/account/smartContractAccount.js.map +1 -1
  62. package/dist/esm/actions/smartAccount/buildUserOperationFromTx.js.map +1 -1
  63. package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.js.map +1 -1
  64. package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -1
  65. package/dist/esm/actions/smartAccount/estimateUserOperationGas.js.map +1 -1
  66. package/dist/esm/actions/smartAccount/internal/initUserOperation.js.map +1 -1
  67. package/dist/esm/actions/smartAccount/internal/runMiddlewareStack.js.map +1 -1
  68. package/dist/esm/actions/smartAccount/internal/sendUserOperation.js.map +1 -1
  69. package/dist/esm/actions/smartAccount/sendUserOperation.js.map +1 -1
  70. package/dist/esm/client/bundlerClient.js.map +1 -1
  71. package/dist/esm/client/decorators/bundlerClient.js.map +1 -1
  72. package/dist/esm/client/isSmartAccountClient.js.map +1 -1
  73. package/dist/esm/client/types.d.ts +2 -7
  74. package/dist/esm/client/types.js.map +1 -1
  75. package/dist/esm/ens/utils.d.ts +1 -1
  76. package/dist/esm/ens/utils.js +1 -1
  77. package/dist/esm/ens/utils.js.map +1 -1
  78. package/dist/esm/errors/account.js.map +1 -1
  79. package/dist/esm/errors/client.js.map +1 -1
  80. package/dist/esm/errors/entrypoint.js.map +1 -1
  81. package/dist/esm/errors/signer.js.map +1 -1
  82. package/dist/esm/errors/transaction.js.map +1 -1
  83. package/dist/esm/errors/useroperation.js.map +1 -1
  84. package/dist/esm/index.d.ts +3 -6
  85. package/dist/esm/index.js +2 -4
  86. package/dist/esm/index.js.map +1 -1
  87. package/dist/esm/logger.js.map +1 -1
  88. package/dist/esm/middleware/actions.js +3 -18
  89. package/dist/esm/middleware/actions.js.map +1 -1
  90. package/dist/esm/middleware/defaults/gasEstimator.js +4 -2
  91. package/dist/esm/middleware/defaults/gasEstimator.js.map +1 -1
  92. package/dist/esm/middleware/erc7677middleware.d.ts +40 -0
  93. package/dist/esm/middleware/erc7677middleware.js +73 -0
  94. package/dist/esm/middleware/erc7677middleware.js.map +1 -0
  95. package/dist/esm/middleware/noopMiddleware.d.ts +2 -1
  96. package/dist/esm/middleware/noopMiddleware.js.map +1 -1
  97. package/dist/esm/middleware/types.d.ts +3 -2
  98. package/dist/esm/middleware/types.js.map +1 -1
  99. package/dist/esm/signer/local-account.d.ts +44 -44
  100. package/dist/esm/signer/local-account.js.map +1 -1
  101. package/dist/esm/signer/wallet-client.d.ts +44 -44
  102. package/dist/esm/signer/wallet-client.js.map +1 -1
  103. package/dist/esm/transport/split.js.map +1 -1
  104. package/dist/esm/utils/bigint.js.map +1 -1
  105. package/dist/esm/utils/bytes.js.map +1 -1
  106. package/dist/esm/utils/defaults.d.ts +2 -4
  107. package/dist/esm/utils/defaults.js +1 -40
  108. package/dist/esm/utils/defaults.js.map +1 -1
  109. package/dist/esm/utils/index.d.ts +0 -3
  110. package/dist/esm/utils/index.js +0 -11
  111. package/dist/esm/utils/index.js.map +1 -1
  112. package/dist/esm/utils/types.js.map +1 -1
  113. package/dist/esm/utils/userop.js.map +1 -1
  114. package/dist/esm/version.d.ts +1 -1
  115. package/dist/esm/version.js +1 -1
  116. package/dist/esm/version.js.map +1 -1
  117. package/dist/types/account/smartContractAccount.d.ts +17 -11
  118. package/dist/types/account/smartContractAccount.d.ts.map +1 -1
  119. package/dist/types/actions/smartAccount/buildUserOperationFromTx.d.ts +33 -33
  120. package/dist/types/actions/smartAccount/buildUserOperationFromTxs.d.ts +43 -59
  121. package/dist/types/actions/smartAccount/buildUserOperationFromTxs.d.ts.map +1 -1
  122. package/dist/types/actions/smartAccount/checkGasSponsorshipEligibility.d.ts +18 -18
  123. package/dist/types/actions/smartAccount/estimateUserOperationGas.d.ts +3 -3
  124. package/dist/types/actions/smartAccount/internal/initUserOperation.d.ts +3 -4
  125. package/dist/types/actions/smartAccount/internal/initUserOperation.d.ts.map +1 -1
  126. package/dist/types/actions/smartAccount/internal/runMiddlewareStack.d.ts +0 -14
  127. package/dist/types/actions/smartAccount/internal/runMiddlewareStack.d.ts.map +1 -1
  128. package/dist/types/actions/smartAccount/internal/sendUserOperation.d.ts +0 -7
  129. package/dist/types/actions/smartAccount/internal/sendUserOperation.d.ts.map +1 -1
  130. package/dist/types/actions/smartAccount/sendUserOperation.d.ts +17 -3
  131. package/dist/types/actions/smartAccount/sendUserOperation.d.ts.map +1 -1
  132. package/dist/types/client/bundlerClient.d.ts +2 -2
  133. package/dist/types/client/decorators/bundlerClient.d.ts +8 -8
  134. package/dist/types/client/isSmartAccountClient.d.ts +4 -4
  135. package/dist/types/client/types.d.ts +2 -7
  136. package/dist/types/client/types.d.ts.map +1 -1
  137. package/dist/types/ens/utils.d.ts +1 -1
  138. package/dist/types/ens/utils.d.ts.map +1 -1
  139. package/dist/types/errors/account.d.ts +53 -4
  140. package/dist/types/errors/account.d.ts.map +1 -1
  141. package/dist/types/errors/client.d.ts +15 -0
  142. package/dist/types/errors/client.d.ts.map +1 -1
  143. package/dist/types/errors/entrypoint.d.ts +12 -0
  144. package/dist/types/errors/entrypoint.d.ts.map +1 -1
  145. package/dist/types/errors/signer.d.ts +5 -0
  146. package/dist/types/errors/signer.d.ts.map +1 -1
  147. package/dist/types/errors/transaction.d.ts +8 -1
  148. package/dist/types/errors/transaction.d.ts.map +1 -1
  149. package/dist/types/errors/useroperation.d.ts +5 -5
  150. package/dist/types/errors/useroperation.d.ts.map +1 -1
  151. package/dist/types/index.d.ts +3 -6
  152. package/dist/types/index.d.ts.map +1 -1
  153. package/dist/types/logger.d.ts +88 -0
  154. package/dist/types/logger.d.ts.map +1 -1
  155. package/dist/types/middleware/actions.d.ts +3 -3
  156. package/dist/types/middleware/actions.d.ts.map +1 -1
  157. package/dist/types/middleware/defaults/gasEstimator.d.ts +2 -2
  158. package/dist/types/middleware/defaults/gasEstimator.d.ts.map +1 -1
  159. package/dist/types/middleware/erc7677middleware.d.ts +62 -0
  160. package/dist/types/middleware/erc7677middleware.d.ts.map +1 -0
  161. package/dist/types/middleware/noopMiddleware.d.ts +4 -4
  162. package/dist/types/middleware/noopMiddleware.d.ts.map +1 -1
  163. package/dist/types/middleware/types.d.ts +3 -2
  164. package/dist/types/middleware/types.d.ts.map +1 -1
  165. package/dist/types/signer/local-account.d.ts +137 -45
  166. package/dist/types/signer/local-account.d.ts.map +1 -1
  167. package/dist/types/signer/wallet-client.d.ts +133 -44
  168. package/dist/types/signer/wallet-client.d.ts.map +1 -1
  169. package/dist/types/transport/split.d.ts +2 -2
  170. package/dist/types/utils/bigint.d.ts +14 -14
  171. package/dist/types/utils/bigint.d.ts.map +1 -1
  172. package/dist/types/utils/bytes.d.ts +5 -5
  173. package/dist/types/utils/defaults.d.ts +2 -12
  174. package/dist/types/utils/defaults.d.ts.map +1 -1
  175. package/dist/types/utils/index.d.ts +12 -22
  176. package/dist/types/utils/index.d.ts.map +1 -1
  177. package/dist/types/utils/types.d.ts +2 -2
  178. package/dist/types/utils/userop.d.ts +33 -33
  179. package/dist/types/version.d.ts +1 -1
  180. package/dist/types/version.d.ts.map +1 -1
  181. package/package.json +4 -3
  182. package/src/account/smartContractAccount.ts +19 -13
  183. package/src/actions/smartAccount/buildUserOperationFromTx.ts +35 -35
  184. package/src/actions/smartAccount/buildUserOperationFromTxs.ts +44 -60
  185. package/src/actions/smartAccount/checkGasSponsorshipEligibility.ts +19 -19
  186. package/src/actions/smartAccount/estimateUserOperationGas.ts +3 -3
  187. package/src/actions/smartAccount/internal/initUserOperation.ts +3 -4
  188. package/src/actions/smartAccount/internal/runMiddlewareStack.ts +0 -22
  189. package/src/actions/smartAccount/internal/sendUserOperation.ts +0 -7
  190. package/src/actions/smartAccount/sendUserOperation.ts +17 -3
  191. package/src/client/bundlerClient.ts +2 -2
  192. package/src/client/decorators/bundlerClient.ts +8 -8
  193. package/src/client/isSmartAccountClient.ts +4 -4
  194. package/src/client/types.ts +2 -15
  195. package/src/ens/utils.ts +1 -2
  196. package/src/errors/account.ts +64 -4
  197. package/src/errors/client.ts +18 -0
  198. package/src/errors/entrypoint.ts +12 -0
  199. package/src/errors/signer.ts +6 -0
  200. package/src/errors/transaction.ts +10 -1
  201. package/src/errors/useroperation.ts +5 -6
  202. package/src/index.ts +2 -31
  203. package/src/logger.ts +88 -0
  204. package/src/middleware/actions.ts +6 -27
  205. package/src/middleware/defaults/gasEstimator.ts +9 -5
  206. package/src/middleware/erc7677middleware.ts +201 -0
  207. package/src/middleware/noopMiddleware.ts +6 -4
  208. package/src/middleware/types.ts +16 -7
  209. package/src/signer/local-account.ts +94 -2
  210. package/src/signer/wallet-client.ts +89 -0
  211. package/src/transport/split.ts +2 -2
  212. package/src/utils/bigint.ts +15 -15
  213. package/src/utils/bytes.ts +5 -5
  214. package/src/utils/defaults.ts +3 -76
  215. package/src/utils/index.ts +12 -35
  216. package/src/utils/types.ts +2 -2
  217. package/src/utils/userop.ts +33 -33
  218. package/src/version.ts +1 -1
  219. package/dist/cjs/account/base.d.ts +0 -49
  220. package/dist/cjs/account/base.js +0 -257
  221. package/dist/cjs/account/base.js.map +0 -1
  222. package/dist/cjs/account/schema.d.ts +0 -100
  223. package/dist/cjs/account/schema.js +0 -43
  224. package/dist/cjs/account/schema.js.map +0 -1
  225. package/dist/cjs/account/simple.d.ts +0 -14
  226. package/dist/cjs/account/simple.js +0 -119
  227. package/dist/cjs/account/simple.js.map +0 -1
  228. package/dist/cjs/account/types.d.ts +0 -30
  229. package/dist/cjs/account/types.js +0 -3
  230. package/dist/cjs/account/types.js.map +0 -1
  231. package/dist/cjs/chains/index.d.ts +0 -20
  232. package/dist/cjs/chains/index.js +0 -169
  233. package/dist/cjs/chains/index.js.map +0 -1
  234. package/dist/esm/account/base.d.ts +0 -49
  235. package/dist/esm/account/base.js +0 -253
  236. package/dist/esm/account/base.js.map +0 -1
  237. package/dist/esm/account/schema.d.ts +0 -100
  238. package/dist/esm/account/schema.js +0 -35
  239. package/dist/esm/account/schema.js.map +0 -1
  240. package/dist/esm/account/simple.d.ts +0 -14
  241. package/dist/esm/account/simple.js +0 -115
  242. package/dist/esm/account/simple.js.map +0 -1
  243. package/dist/esm/account/types.d.ts +0 -30
  244. package/dist/esm/account/types.js +0 -2
  245. package/dist/esm/account/types.js.map +0 -1
  246. package/dist/esm/chains/index.d.ts +0 -20
  247. package/dist/esm/chains/index.js +0 -166
  248. package/dist/esm/chains/index.js.map +0 -1
  249. package/dist/types/account/base.d.ts +0 -128
  250. package/dist/types/account/base.d.ts.map +0 -1
  251. package/dist/types/account/schema.d.ts +0 -101
  252. package/dist/types/account/schema.d.ts.map +0 -1
  253. package/dist/types/account/simple.d.ts +0 -15
  254. package/dist/types/account/simple.d.ts.map +0 -1
  255. package/dist/types/account/types.d.ts +0 -144
  256. package/dist/types/account/types.d.ts.map +0 -1
  257. package/dist/types/chains/index.d.ts +0 -21
  258. package/dist/types/chains/index.d.ts.map +0 -1
  259. package/src/account/base.ts +0 -415
  260. package/src/account/schema.ts +0 -51
  261. package/src/account/simple.ts +0 -221
  262. package/src/account/types.ts +0 -184
  263. package/src/chains/index.ts +0 -194
@@ -21,17 +21,67 @@ export class LocalAccountSigner<
21
21
  inner: T;
22
22
  signerType: string;
23
23
 
24
+ /**
25
+ * A function to initialize an object with an inner parameter and derive a signerType from it.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * import { LocalAccountSigner } from "@aa-sdk/core";
30
+ * import { privateKeyToAccount, generatePrivateKey } from "viem";
31
+ *
32
+ * const signer = new LocalAccountSigner(
33
+ * privateKeyToAccount(generatePrivateKey()),
34
+ * );
35
+ * ```
36
+ *
37
+ * @param {T} inner The inner parameter containing the necessary data
38
+ */
24
39
  constructor(inner: T) {
25
40
  this.inner = inner;
26
41
  this.signerType = inner.type; // type: "local"
27
42
  }
28
43
 
44
+ /**
45
+ * Signs the provided message using the inner signMessage function.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * import { LocalAccountSigner } from "@aa-sdk/core";
50
+ * import { generatePrivateKey } from "viem";
51
+ *
52
+ * const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());
53
+ * const signature = await signer.signMessage("Hello, world!");
54
+ * ```
55
+ *
56
+ * @param {string} message The message to be signed
57
+ * @returns {Promise<any>} A promise that resolves to the signed message
58
+ */
29
59
  readonly signMessage: (message: SignableMessage) => Promise<`0x${string}`> = (
30
60
  message
31
61
  ) => {
32
62
  return this.inner.signMessage({ message });
33
63
  };
34
64
 
65
+ /**
66
+ * Signs typed data using the given parameters.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * import { LocalAccountSigner } from "@aa-sdk/core";
71
+ * import { generatePrivateKey } from "viem";
72
+ *
73
+ * const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());
74
+ * const signature = await signer.signTypedData({
75
+ * domain: {},
76
+ * types: {},
77
+ * primaryType: "",
78
+ * message: {},
79
+ * });
80
+ * ```
81
+ *
82
+ * @param {TypedDataDefinition<TTypedData, TPrimaryType>} params The parameters defining the typed data and primary type
83
+ * @returns {Promise<Hex>} A promise that resolves to the signed data in hexadecimal format
84
+ */
35
85
  readonly signTypedData = async <
36
86
  const TTypedData extends TypedData | { [key: string]: unknown },
37
87
  TPrimaryType extends string = string
@@ -41,10 +91,39 @@ export class LocalAccountSigner<
41
91
  return this.inner.signTypedData(params);
42
92
  };
43
93
 
44
- readonly getAddress: () => Promise<`0x${string}`> = async () => {
94
+ /**
95
+ * Returns the address of the inner object in a specific hexadecimal format.
96
+ *
97
+ * @example
98
+ * ```ts
99
+ * import { LocalAccountSigner } from "@aa-sdk/core";
100
+ * import { generatePrivateKey } from "viem";
101
+ *
102
+ * const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());
103
+ * const address = await signer.getAddress();
104
+ * ```
105
+ *
106
+ * @returns {Promise<Hex>} A promise that resolves to the address in the format `0x{string}`
107
+ */
108
+ readonly getAddress = async (): Promise<`0x${string}`> => {
45
109
  return this.inner.address;
46
110
  };
47
111
 
112
+ /**
113
+ * Creates a LocalAccountSigner using the provided mnemonic key and optional HD options.
114
+ *
115
+ * @example
116
+ * ```ts
117
+ * import { LocalAccountSigner } from "@aa-sdk/core";
118
+ * import { generateMnemonic } from "viem";
119
+ *
120
+ * const signer = LocalAccountSigner.mnemonicToAccountSigner(generateMnemonic());
121
+ * ```
122
+ *
123
+ * @param {string} key The mnemonic key to derive the account from.
124
+ * @param {HDOptions} [opts] Optional HD options for deriving the account.
125
+ * @returns {LocalAccountSigner<HDAccount>} A LocalAccountSigner object for the derived account.
126
+ */
48
127
  static mnemonicToAccountSigner(
49
128
  key: string,
50
129
  opts?: HDOptions
@@ -53,7 +132,20 @@ export class LocalAccountSigner<
53
132
  return new LocalAccountSigner(signer);
54
133
  }
55
134
 
56
- static privateKeyToAccountSigner(
135
+ /**
136
+ * Creates a `LocalAccountSigner` instance using the provided private key.
137
+ *
138
+ * @example
139
+ * ```ts
140
+ * import { LocalAccountSigner } from "@aa-sdk/core";
141
+ * import { generatePrivateKey } from "viem";
142
+ *
143
+ * const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());
144
+ * ```
145
+ *
146
+ * @param {Hex} key The private key in hexadecimal format
147
+ * @returns {LocalAccountSigner<PrivateKeyAccount>} An instance of `LocalAccountSigner` initialized with the provided private key
148
+ */ static privateKeyToAccountSigner(
57
149
  key: Hex
58
150
  ): LocalAccountSigner<PrivateKeyAccount> {
59
151
  const signer = privateKeyToAccount(key);
@@ -16,6 +16,27 @@ export class WalletClientSigner implements SmartAccountSigner<WalletClient> {
16
16
  signerType: string;
17
17
  inner: WalletClient;
18
18
 
19
+ /**
20
+ * Initializes a signer with a given wallet client and signer type.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * import { WalletClientSigner } from "@aa-sdk/core";
25
+ * import { createWalletClient, custom } from 'viem'
26
+ * import { mainnet } from 'viem/chains'
27
+ *
28
+ * const client = createWalletClient({
29
+ * chain: mainnet,
30
+ * transport: custom(window.ethereum!)
31
+ * });
32
+ *
33
+ * const signer = new WalletClientSigner(client, 'wallet');
34
+ * ```
35
+ *
36
+ * @param {WalletClient} client The wallet client to interact with
37
+ * @param {string} signerType The type of signer; must be a valid signer type, otherwise an error will be thrown
38
+ * @throws {InvalidSignerTypeError} If the signer type is invalid
39
+ */
19
40
  constructor(client: WalletClient, signerType: string) {
20
41
  this.inner = client;
21
42
  if (!signerType) {
@@ -24,11 +45,52 @@ export class WalletClientSigner implements SmartAccountSigner<WalletClient> {
24
45
  this.signerType = signerType;
25
46
  }
26
47
 
48
+ /**
49
+ * Asynchronously retrieves addresses from the inner object and returns the first address after applying the `getAddress` function.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * import { WalletClientSigner } from "@aa-sdk/core";
54
+ * import { createWalletClient, custom } from 'viem'
55
+ * import { mainnet } from 'viem/chains'
56
+ *
57
+ * const client = createWalletClient({
58
+ * chain: mainnet,
59
+ * transport: custom(window.ethereum!)
60
+ * });
61
+ *
62
+ * const signer = new WalletClientSigner(client, 'wallet');
63
+ * console.log(await signer.getAddress());
64
+ * ```
65
+ *
66
+ * @returns {Promise<string>} A promise that resolves to the first address after being processed by the `getAddress` function.
67
+ */
27
68
  getAddress: () => Promise<`0x${string}`> = async () => {
28
69
  let addresses = await this.inner.getAddresses();
29
70
  return getAddress(addresses[0]);
30
71
  };
31
72
 
73
+ /**
74
+ * Signs a message using the account's signing method.
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * import { WalletClientSigner } from "@aa-sdk/core";
79
+ * import { createWalletClient, custom } from 'viem'
80
+ * import { mainnet } from 'viem/chains'
81
+ *
82
+ * const client = createWalletClient({
83
+ * chain: mainnet,
84
+ * transport: custom(window.ethereum!)
85
+ * });
86
+ *
87
+ * const signer = new WalletClientSigner(client, 'wallet');
88
+ * console.log(await signer.signMessage("hello"));
89
+ * ```
90
+ *
91
+ * @param {string} message the message string that needs to be signed
92
+ * @returns {Promise<string>} a promise that resolves to the signed message
93
+ */
32
94
  readonly signMessage: (message: SignableMessage) => Promise<`0x${string}`> =
33
95
  async (message) => {
34
96
  const account = this.inner.account ?? (await this.getAddress());
@@ -36,6 +98,33 @@ export class WalletClientSigner implements SmartAccountSigner<WalletClient> {
36
98
  return this.inner.signMessage({ message, account });
37
99
  };
38
100
 
101
+ /**
102
+ * Signs the provided typed data using the account's private key.
103
+ *
104
+ * @example
105
+ * ```ts
106
+ * import { WalletClientSigner } from "@aa-sdk/core";
107
+ * import { createWalletClient, custom } from 'viem'
108
+ * import { mainnet } from 'viem/chains'
109
+ *
110
+ * const client = createWalletClient({
111
+ * chain: mainnet,
112
+ * transport: custom(window.ethereum!)
113
+ * });
114
+ *
115
+ * const signer = new WalletClientSigner(client, 'wallet');
116
+ * console.log(await signer.signTypedData({
117
+ * types: {
118
+ * "Message": [{ name: "content", type: "string" }]
119
+ * },
120
+ * primaryType: "Message",
121
+ * message: { content: "Hello" },
122
+ * }));
123
+ * ```
124
+ *
125
+ * @param {TypedDataDefinition<TTypedData, TPrimaryType>} typedData The typed data to be signed
126
+ * @returns {Promise<Hex>} A promise that resolves to a hex string representing the signed data
127
+ */
39
128
  signTypedData = async <
40
129
  const TTypedData extends TypedData | { [key: string]: unknown },
41
130
  TPrimaryType extends string = string
@@ -37,8 +37,8 @@ export interface SplitTransportParams {
37
37
  * });
38
38
  * ```
39
39
  *
40
- * @param params {@link SplitTransportParams} split transport configuration containing the methods overrides and fallback transport
41
- * @returns a {@link CustomTransport} that splits traffic
40
+ * @param {SplitTransportParams} params split transport configuration containing the methods overrides and fallback transport
41
+ * @returns {CustomTransport} a viem Transport that splits traffic
42
42
  */
43
43
  export const split = (params: SplitTransportParams): CustomTransport => {
44
44
  const overrideMap = params.overrides.reduce((accum, curr) => {
@@ -5,8 +5,8 @@ import { isMultiplier } from "./schema.js";
5
5
  /**
6
6
  * Returns the max bigint in a list of bigints
7
7
  *
8
- * @param args a list of bigints to get the max of
9
- * @returns the max bigint in the list
8
+ * @param {bigint[]} args a list of bigints to get the max of
9
+ * @returns {bigint} the max bigint in the list
10
10
  */
11
11
  export const bigIntMax = (...args: bigint[]): bigint => {
12
12
  if (!args.length) {
@@ -19,8 +19,8 @@ export const bigIntMax = (...args: bigint[]): bigint => {
19
19
  /**
20
20
  * Returns the min bigint in a list of bigints
21
21
  *
22
- * @param args a list of bigints to get the max of
23
- * @returns the min bigint in the list
22
+ * @param {bigint[]} args a list of bigints to get the max of
23
+ * @returns {bigint} the min bigint in the list
24
24
  */
25
25
  export const bigIntMin = (...args: bigint[]): bigint => {
26
26
  if (!args.length) {
@@ -33,16 +33,16 @@ export const bigIntMin = (...args: bigint[]): bigint => {
33
33
  /**
34
34
  * Given a bigint and a min-max range, returns the min-max clamped bigint value
35
35
  *
36
- * @param value a bigint value to clamp
37
- * @param lower lower bound min max tuple value
38
- * @param upper upper bound min max tuple value
39
- * @returns the clamped bigint value per given range
36
+ * @param {BigNumberish} value a bigint value to clamp
37
+ * @param {BigNumberish | undefined} lower lower bound min max tuple value
38
+ * @param {BigNumberish | undefined} upper upper bound min max tuple value
39
+ * @returns {bigint} the clamped bigint value per given range
40
40
  */
41
41
  export const bigIntClamp = (
42
42
  value: BigNumberish,
43
43
  lower: BigNumberish | null | undefined,
44
44
  upper: BigNumberish | null | undefined
45
- ) => {
45
+ ): bigint => {
46
46
  lower = lower != null ? BigInt(lower) : null;
47
47
  upper = upper != null ? BigInt(upper) : null;
48
48
 
@@ -71,10 +71,10 @@ export enum RoundingMode {
71
71
  * Given a bigint and a number (which can be a float), returns the bigint value.
72
72
  * Note: this function has loss and will round down to the nearest integer.
73
73
  *
74
- * @param base - the number to be multiplied
75
- * @param multiplier - the amount to multiply by
76
- * @param roundingMode - the rounding mode to use when calculating the percent. defaults to ROUND_UP
77
- * @returns the bigint value of the multiplication with the number rounded by the rounding mode
74
+ * @param {BigNumberish} base - the number to be multiplied
75
+ * @param {number} multiplier - the amount to multiply by
76
+ * @param {RoundingMode} roundingMode - the rounding mode to use when calculating the percent. defaults to ROUND_UP
77
+ * @returns {bigint} the bigint value of the multiplication with the number rounded by the rounding mode
78
78
  */
79
79
  export const bigIntMultiply = (
80
80
  base: BigNumberish,
@@ -111,8 +111,8 @@ export const bigIntMultiply = (
111
111
  * });
112
112
  * ```
113
113
  *
114
- * @param phrase -- any string value.
115
- * @returns the bigint value of the hashed string
114
+ * @param {string} phrase -- any string value.
115
+ * @returns {bigint} the bigint value of the hashed string
116
116
  */
117
117
  export const stringToIndex = (phrase: string): bigint =>
118
118
  BigInt(keccak256(toHex(phrase)));
@@ -8,11 +8,11 @@ type TakeBytesOpts = {
8
8
  /**
9
9
  * Given a bytes string, returns a slice of the bytes
10
10
  *
11
- * @param bytes - the hex string representing bytes
12
- * @param opts - optional parameters for slicing the bytes
13
- * @param opts.offset - the offset in bytes to start slicing from
14
- * @param opts.count - the number of bytes to slice
15
- * @returns the sliced bytes
11
+ * @param {Hex} bytes - the hex string representing bytes
12
+ * @param {TakeBytesOpts} opts - optional parameters for slicing the bytes
13
+ * @param {number} opts.offset - the offset in bytes to start slicing from
14
+ * @param {number} opts.count - the number of bytes to slice
15
+ * @returns {Hex} the sliced bytes
16
16
  */
17
17
  export const takeBytes = (bytes: Hex, opts: TakeBytesOpts = {}): Hex => {
18
18
  const { offset, count } = opts;
@@ -1,79 +1,6 @@
1
- import { type Address, type Chain } from "viem";
2
- import {
3
- arbitrum,
4
- arbitrumGoerli,
5
- arbitrumSepolia,
6
- base,
7
- baseGoerli,
8
- baseSepolia,
9
- fraxtal,
10
- fraxtalSepolia,
11
- goerli,
12
- mainnet,
13
- optimism,
14
- optimismGoerli,
15
- optimismSepolia,
16
- polygon,
17
- polygonAmoy,
18
- polygonMumbai,
19
- sepolia,
20
- zora,
21
- zoraSepolia,
22
- } from "../chains/index.js";
23
- import { defaultEntryPointVersion } from "../entrypoint/index.js";
24
- import type { EntryPointVersion } from "../entrypoint/types.js";
25
- import { DefaultFactoryNotDefinedError } from "../errors/account.js";
26
- import type { UserOperationFeeOptions } from "../types";
27
-
28
- /**
29
- * Utility method returning the default simple account factory address given a {@link Chain} object
30
- *
31
- * @param chain - a {@link Chain} object
32
- * @param version - {@link EntryPointVersion} value that defaults to `defaultEntryPointVersion`
33
- * @returns a {@link abi.Address} for the given chain
34
- * @throws if the chain doesn't have an address currently deployed
35
- */
36
- export const getDefaultSimpleAccountFactoryAddress = (
37
- chain: Chain,
38
- version: EntryPointVersion = defaultEntryPointVersion
39
- ): Address => {
40
- switch (version) {
41
- case "0.6.0":
42
- switch (chain.id) {
43
- case mainnet.id:
44
- case polygon.id:
45
- case polygonAmoy.id:
46
- case optimism.id:
47
- case optimismSepolia.id:
48
- case arbitrum.id:
49
- case arbitrumSepolia.id:
50
- case base.id:
51
- case baseGoerli.id:
52
- case baseSepolia.id:
53
- case fraxtal.id:
54
- case fraxtalSepolia.id:
55
- case zora.id:
56
- case zoraSepolia.id:
57
- return "0x15Ba39375ee2Ab563E8873C8390be6f2E2F50232";
58
- case sepolia.id:
59
- case goerli.id:
60
- case polygonMumbai.id:
61
- case optimismGoerli.id:
62
- case arbitrumGoerli.id:
63
- return "0x9406Cc6185a346906296840746125a0E44976454";
64
- default:
65
- break;
66
- }
67
- break;
68
- case "0.7.0":
69
- switch (chain.id) {
70
- default:
71
- return "0x91E60e0613810449d098b0b5Ec8b51A0FE8c8985";
72
- }
73
- }
74
-
75
- throw new DefaultFactoryNotDefinedError("SimpleAccount", chain, version);
76
- };
1
+ import { type Chain } from "viem";
2
+ import { arbitrum, arbitrumGoerli, arbitrumSepolia } from "viem/chains";
3
+ import type { UserOperationFeeOptions } from "../types.js";
77
4
 
78
5
  export const minPriorityFeePerBidDefaults = new Map<number, bigint>([
79
6
  [arbitrum.id, 10_000_000n],
@@ -1,35 +1,12 @@
1
- import type { Chain } from "viem";
2
1
  import { toHex } from "viem";
3
- import * as chains from "viem/chains";
4
- import * as alchemyChains from "../chains/index.js";
5
2
  import type { PromiseOrValue } from "../types.js";
6
3
  import type { RecordableKeys } from "./types.js";
7
4
 
8
- export const AlchemyChainMap = new Map<number, Chain>(
9
- Object.values(alchemyChains).map((c) => [c.id, c])
10
- );
11
-
12
- /**
13
- * Utility method for converting a chainId to a {@link Chain} object
14
- *
15
- * @param chainId - the chainId to convert
16
- * @returns a {@link Chain} object for the given chainId
17
- * @throws if the chainId is not found
18
- */
19
- export const getChain = (chainId: number): Chain => {
20
- for (const chain of Object.values(chains)) {
21
- if (chain.id === chainId) {
22
- return AlchemyChainMap.get(chain.id) ?? chain;
23
- }
24
- }
25
- throw new Error("could not find chain");
26
- };
27
-
28
5
  /**
29
6
  * Utility function that allows for piping a series of async functions together
30
7
  *
31
- * @param fns - functions to pipe
32
- * @returns result of the pipe
8
+ * @param {((s: S, o?: O, f?: F) => Promise<S>)[]} fns - functions to pipe
9
+ * @returns {S} result of the pipe
33
10
  */
34
11
  export const asyncPipe =
35
12
  <S, O, F>(...fns: ((s: S, o?: O, f?: F) => Promise<S>)[]) =>
@@ -47,10 +24,10 @@ export type Deferrable<T> = {
47
24
  };
48
25
 
49
26
  /**
50
- * Await all of the properties of a {@link Deferrable} object
27
+ * Await all of the properties of a Deferrable object
51
28
  *
52
- * @param object - a {@link Deferrable} object
53
- * @returns the object with its properties resolved
29
+ * @param {Deferrable<T>} object - a Deferrable object
30
+ * @returns {Promise<T>} the object with its properties resolved
54
31
  */
55
32
  export async function resolveProperties<T>(object: Deferrable<T>): Promise<T> {
56
33
  const promises = Object.keys(object).map((key) => {
@@ -71,8 +48,8 @@ export async function resolveProperties<T>(object: Deferrable<T>): Promise<T> {
71
48
  /**
72
49
  * Recursively converts all values in an object to hex strings
73
50
  *
74
- * @param obj - obj to deep hexlify
75
- * @returns object with all of its values hexlified
51
+ * @param {any} obj - obj to deep hexlify
52
+ * @returns {any} object with all of its values hexlified
76
53
  */
77
54
  export function deepHexlify(obj: any): any {
78
55
  if (typeof obj === "function") {
@@ -149,8 +126,8 @@ export function pick(obj: Record<string, unknown>, keys: string | string[]) {
149
126
  /**
150
127
  * Utility method for checking if the passed in values are all equal (strictly)
151
128
  *
152
- * @param params - values to check
153
- * @returns a boolean indicating if all values are the same
129
+ * @param {...any[]} params - values to check
130
+ * @returns {boolean} a boolean indicating if all values are the same
154
131
  * @throws if no values are passed in
155
132
  */
156
133
  export const allEqual = (...params: any[]): boolean => {
@@ -163,9 +140,9 @@ export const allEqual = (...params: any[]): boolean => {
163
140
  /**
164
141
  * Utility method for checking the condition and return the value if condition holds true, undefined if not.
165
142
  *
166
- * @param condition - condition to check
167
- * @param value - value to return when condition holds true
168
- * @returns the value if condition holds true, undefined if not
143
+ * @param {Promise<boolean>} condition - condition to check
144
+ * @param {() => Promise<T>} value - value to return when condition holds true
145
+ * @returns {Promise<T | undefined>} the value if condition holds true, undefined if not
169
146
  */
170
147
  export const conditionalReturn = <T>(
171
148
  condition: Promise<boolean>,
@@ -10,7 +10,7 @@
10
10
  export type NoUndefined<T> = T extends undefined ? never : T;
11
11
  // borrowed from viem
12
12
  /**
13
- * @description Checks if {@link T} is `undefined`
13
+ * @description Checks if T is `undefined`
14
14
  * @param T - Type to check
15
15
  * @example
16
16
  * type Result = IsUndefined<undefined>
@@ -27,7 +27,7 @@ export type RequiredBy<TType, TKeys extends keyof TType> = Required<
27
27
  /**
28
28
  * @description Combines members of an intersection into a readable type.
29
29
  *
30
- * @see {@link https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg}
30
+ * @see https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg
31
31
  * @example
32
32
  * Prettify<{ a: string } & { b: string } & { c: number, d: bigint }>
33
33
  * => { a: string, b: string, c: number, d: bigint }
@@ -14,10 +14,10 @@ import { bigIntClamp, bigIntMultiply } from "./bigint.js";
14
14
  import { allEqual, isBigNumberish } from "./index.js";
15
15
 
16
16
  /**
17
- * Utility method for asserting a {@link UserOperationStruct} has valid fields for the given entry point version
17
+ * Utility method for asserting a UserOperationStruct has valid fields for the given entry point version
18
18
  *
19
- * @param request a {@link UserOperationStruct} to validate
20
- * @returns a type guard that asserts the {@link UserOperationRequest} is valid
19
+ * @param {UserOperationStruct} request a UserOperationStruct to validate
20
+ * @returns {boolean} a type guard that asserts the UserOperationRequest is valid
21
21
  */
22
22
  export function isValidRequest<
23
23
  TEntryPointVersion extends EntryPointVersion = EntryPointVersion
@@ -37,10 +37,10 @@ export function isValidRequest<
37
37
  }
38
38
 
39
39
  /**
40
- * Utility method for asserting a {@link UserOperationRequest} has valid fields for the paymaster data
40
+ * Utility method for asserting a UserOperationRequest has valid fields for the paymaster data
41
41
  *
42
- * @param request a {@link UserOperationRequest} to validate
43
- * @returns a type guard that asserts the {@link UserOperationRequest} is a {@link UserOperationRequest}
42
+ * @param {UserOperationRequest} request a UserOperationRequest to validate
43
+ * @returns {boolean} a type guard that asserts the UserOperationRequest is a UserOperationRequest
44
44
  */
45
45
  export function isValidPaymasterAndData<
46
46
  TEntryPointVersion extends EntryPointVersion = EntryPointVersion
@@ -59,10 +59,10 @@ export function isValidPaymasterAndData<
59
59
  }
60
60
 
61
61
  /**
62
- * Utility method for asserting a {@link UserOperationStruct} has valid fields for the paymaster data
62
+ * Utility method for asserting a UserOperationStruct has valid fields for the paymaster data
63
63
  *
64
- * @param request a {@link UserOperationRequest} to validate
65
- * @returns a type guard that asserts the {@link UserOperationStruct} is a {@link UserOperationRequest}
64
+ * @param {UserOperationRequest} request a UserOperationRequest to validate
65
+ * @returns {boolean} a type guard that asserts the UserOperationStruct is a UserOperationRequest
66
66
  */
67
67
  export function isValidFactoryAndData<
68
68
  TEntryPointVersion extends EntryPointVersion = EntryPointVersion
@@ -80,12 +80,12 @@ export function isValidFactoryAndData<
80
80
  }
81
81
 
82
82
  /**
83
- * Utility method for applying a {@link UserOperationOverrides} field value
83
+ * Utility method for applying a UserOperationOverrides field value
84
84
  * over the current value set for the field
85
85
  *
86
- * @param value the current value of the field
87
- * @param override the override value to apply
88
- * @returns the new value of the field after applying the override
86
+ * @param {BigNumberish} value the current value of the field
87
+ * @param {BigNumberish | Multiplier} override the override value to apply
88
+ * @returns {BigNumberish} the new value of the field after applying the override
89
89
  */
90
90
  export function applyUserOpOverride<TValue extends BigNumberish | undefined>(
91
91
  value: TValue,
@@ -106,12 +106,12 @@ export function applyUserOpOverride<TValue extends BigNumberish | undefined>(
106
106
  }
107
107
 
108
108
  /**
109
- * Utility method for applying a {@link UserOperationFeeOptionsField} value
109
+ * Utility method for applying a UserOperationFeeOptionsField value
110
110
  * over the current value set for the field
111
111
  *
112
- * @param value the current value of the field
113
- * @param feeOption the fee option field value to apply
114
- * @returns the new value of the field after applying the fee option
112
+ * @param {BigNumberish} value the current value of the field
113
+ * @param {UserOperationFeeOptionsField} feeOption the override value to apply
114
+ * @returns {BigNumberish} the new value of the field after applying the override
115
115
  */
116
116
  export function applyUserOpFeeOption<TValue extends BigNumberish | undefined>(
117
117
  value: TValue,
@@ -133,14 +133,14 @@ export function applyUserOpFeeOption<TValue extends BigNumberish | undefined>(
133
133
  }
134
134
 
135
135
  /**
136
- * Utility method for applying a {@link UserOperationOverrides} field value and
137
- * a {@link UserOperationFeeOptionsField} value over the current value set for the field,
136
+ * Utility method for applying a UserOperationOverrides field value and
137
+ * a UserOperationFeeOptionsField value over the current value set for the field,
138
138
  * with the override taking precedence over the fee option
139
139
  *
140
- * @param value the current value of the field
141
- * @param [override] the override value to apply
142
- * @param [feeOption] the fee option field value to apply
143
- * @returns the new value of the field after applying the override or fee option
140
+ * @param {BigNumberish} value the current value of the field
141
+ * @param {BigNumberish | Multiplier} [override] the override value to apply
142
+ * @param {UserOperationFeeOptionsField} [feeOption] the fee option field value to apply
143
+ * @returns {BigNumberish} the new value of the field after applying the override or fee option
144
144
  */
145
145
  export function applyUserOpOverrideOrFeeOption<
146
146
  TValue extends BigNumberish | undefined
@@ -160,8 +160,8 @@ export function applyUserOpOverrideOrFeeOption<
160
160
  * either because the UserOp is paying for its own gas, or passing a specific paymaster
161
161
  *
162
162
  * @template EntryPointVersion TEntryPointVersion
163
- * @param overrides the user operation overrides to check
164
- * @returns whether the paymaster middleware should be bypassed
163
+ * @param {UserOperationOverrides<TEntryPointVersion> | undefined} overrides the user operation overrides to check
164
+ * @returns {boolean} whether the paymaster middleware should be bypassed
165
165
  */
166
166
  export const bypassPaymasterAndData = <
167
167
  TEntryPointVersion extends EntryPointVersion = EntryPointVersion
@@ -177,8 +177,8 @@ export const bypassPaymasterAndData = <
177
177
  * pay for its own gas
178
178
  *
179
179
  * @template EntryPointVersion TEntryPointVersion
180
- * @param overrides the user operation overrides to check
181
- * @returns whether the paymaster middleware should be bypassed
180
+ * @param {UserOperationOverrides<TEntryPointVersion> | undefined} overrides the user operation overrides to check
181
+ * @returns {boolean} whether the paymaster middleware should be bypassed
182
182
  */
183
183
  export const bypassPaymasterAndDataEmptyHex = <
184
184
  TEntryPointVersion extends EntryPointVersion = EntryPointVersion
@@ -192,9 +192,9 @@ export const bypassPaymasterAndDataEmptyHex = <
192
192
  /**
193
193
  * Utility method for parsing the paymaster address and paymasterData from the paymasterAndData hex string
194
194
  *
195
- * @param paymasterAndData the paymaster and data hex string to parse.
195
+ * @param {Hex} paymasterAndData the paymaster and data hex string to parse.
196
196
  * The hex string refers to the paymasterAndData field of entrypoint v0.6 user operation request
197
- * @returns the parsed paymaster and paymasterData fields of entrypoint v0.7 user operation request paymaster and paymasterData field
197
+ * @returns {{ paymaster: Hex; paymasterData: Hex}} the parsed paymaster and paymasterData fields of entrypoint v0.7 user operation request paymaster and paymasterData field
198
198
  */
199
199
  export const parsePaymasterAndData = (
200
200
  paymasterAndData: Hex
@@ -207,11 +207,11 @@ export const parsePaymasterAndData = (
207
207
  * Utility method for converting the object containing the paymaster address and paymaster data
208
208
  * to the paymaster and data concatenated hex string
209
209
  *
210
- * @param paymasterAndData the object containing the picked paymaster and paymasterData fields of
210
+ * @param {{ paymaster: Hex; paymasterData: Hex}} paymasterAndData the object containing the picked paymaster and paymasterData fields of
211
211
  * entrypoint v0.7 user operation request
212
- * @param paymasterAndData.paymaster the paymaster address
213
- * @param paymasterAndData.paymasterData the paymaster data
214
- * @returns the paymasterAndData hex value of entrypoint v0.6 user operation request paymasterAndData field
212
+ * @param {Hex} paymasterAndData.paymaster the paymaster address
213
+ * @param {Hex} paymasterAndData.paymasterData the paymaster data
214
+ * @returns {Hex} the paymasterAndData hex value of entrypoint v0.6 user operation request paymasterAndData field
215
215
  */
216
216
  export const concatPaymasterAndData = ({
217
217
  paymaster = "0x",