permissionless 0.0.6 → 0.0.8

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 (235) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/_cjs/actions/bundler/chainId.js +11 -0
  3. package/_cjs/actions/bundler/chainId.js.map +1 -0
  4. package/_cjs/actions/bundler/estimateUserOperationGas.js +18 -0
  5. package/_cjs/actions/bundler/estimateUserOperationGas.js.map +1 -0
  6. package/_cjs/actions/bundler/getUserOperationByHash.js +30 -0
  7. package/_cjs/actions/bundler/getUserOperationByHash.js.map +1 -0
  8. package/_cjs/actions/bundler/getUserOperationReceipt.js +48 -0
  9. package/_cjs/actions/bundler/getUserOperationReceipt.js.map +1 -0
  10. package/_cjs/actions/bundler/sendUserOperation.js +13 -0
  11. package/_cjs/actions/bundler/sendUserOperation.js.map +1 -0
  12. package/_cjs/actions/bundler/supportedEntryPoints.js +11 -0
  13. package/_cjs/actions/bundler/supportedEntryPoints.js.map +1 -0
  14. package/_cjs/actions/bundler/waitForUserOperationReceipt.js +46 -0
  15. package/_cjs/actions/bundler/waitForUserOperationReceipt.js.map +1 -0
  16. package/_cjs/actions/index.js +22 -12
  17. package/_cjs/actions/index.js.map +1 -1
  18. package/_cjs/actions/pimlico/getUserOperationGasPrice.js +25 -0
  19. package/_cjs/actions/pimlico/getUserOperationGasPrice.js.map +1 -0
  20. package/_cjs/actions/pimlico/getUserOperationStatus.js +11 -0
  21. package/_cjs/actions/pimlico/getUserOperationStatus.js.map +1 -0
  22. package/_cjs/actions/pimlico/sponsorUserOperation.js +18 -0
  23. package/_cjs/actions/pimlico/sponsorUserOperation.js.map +1 -0
  24. package/_cjs/actions/pimlico.js +10 -52
  25. package/_cjs/actions/pimlico.js.map +1 -1
  26. package/_cjs/actions/public/getAccountNonce.js +35 -0
  27. package/_cjs/actions/public/getAccountNonce.js.map +1 -0
  28. package/_cjs/actions/{public.js → public/getSenderAddress.js} +2 -33
  29. package/_cjs/actions/public/getSenderAddress.js.map +1 -0
  30. package/_cjs/actions/stackup/accounts.js +12 -0
  31. package/_cjs/actions/stackup/accounts.js.map +1 -0
  32. package/_cjs/actions/stackup/sponsorUserOperation.js +18 -0
  33. package/_cjs/actions/stackup/sponsorUserOperation.js.map +1 -0
  34. package/_cjs/actions/stackup.js +10 -0
  35. package/_cjs/actions/stackup.js.map +1 -0
  36. package/_cjs/clients/bundler.js +2 -2
  37. package/_cjs/clients/bundler.js.map +1 -1
  38. package/_cjs/clients/decorators/bundler.js +21 -0
  39. package/_cjs/clients/decorators/bundler.js.map +1 -0
  40. package/_cjs/clients/decorators/pimlico.js +16 -0
  41. package/_cjs/clients/decorators/pimlico.js.map +1 -0
  42. package/_cjs/clients/decorators/stackup.js +11 -0
  43. package/_cjs/clients/decorators/stackup.js.map +1 -0
  44. package/_cjs/clients/pimlico.js +4 -4
  45. package/_cjs/clients/pimlico.js.map +1 -1
  46. package/_cjs/clients/stackup.js +18 -0
  47. package/_cjs/clients/stackup.js.map +1 -0
  48. package/_cjs/index.js +28 -4
  49. package/_cjs/index.js.map +1 -1
  50. package/_cjs/types/stackup.js +3 -0
  51. package/_cjs/types/stackup.js.map +1 -0
  52. package/_cjs/{actions/utils.js → utils/deepHexlify.js} +1 -1
  53. package/_cjs/utils/deepHexlify.js.map +1 -0
  54. package/_cjs/utils/getUserOperationHash.js +38 -0
  55. package/_cjs/utils/getUserOperationHash.js.map +1 -0
  56. package/_cjs/utils/index.js +2 -34
  57. package/_cjs/utils/index.js.map +1 -1
  58. package/_cjs/utils/observe.js +39 -0
  59. package/_cjs/utils/observe.js.map +1 -0
  60. package/_esm/actions/bundler/chainId.js +29 -0
  61. package/_esm/actions/bundler/chainId.js.map +1 -0
  62. package/_esm/actions/bundler/estimateUserOperationGas.js +41 -0
  63. package/_esm/actions/bundler/estimateUserOperationGas.js.map +1 -0
  64. package/_esm/actions/bundler/getUserOperationByHash.js +48 -0
  65. package/_esm/actions/bundler/getUserOperationByHash.js.map +1 -0
  66. package/_esm/actions/bundler/getUserOperationReceipt.js +66 -0
  67. package/_esm/actions/bundler/getUserOperationReceipt.js.map +1 -0
  68. package/_esm/actions/bundler/sendUserOperation.js +36 -0
  69. package/_esm/actions/bundler/sendUserOperation.js.map +1 -0
  70. package/_esm/actions/bundler/supportedEntryPoints.js +29 -0
  71. package/_esm/actions/bundler/supportedEntryPoints.js.map +1 -0
  72. package/_esm/actions/bundler/waitForUserOperationReceipt.js +63 -0
  73. package/_esm/actions/bundler/waitForUserOperationReceipt.js.map +1 -0
  74. package/_esm/actions/index.js +11 -3
  75. package/_esm/actions/index.js.map +1 -1
  76. package/_esm/actions/pimlico/getUserOperationGasPrice.js +42 -0
  77. package/_esm/actions/pimlico/getUserOperationGasPrice.js.map +1 -0
  78. package/_esm/actions/pimlico/getUserOperationStatus.js +29 -0
  79. package/_esm/actions/pimlico/getUserOperationStatus.js.map +1 -0
  80. package/_esm/actions/pimlico/sponsorUserOperation.js +39 -0
  81. package/_esm/actions/pimlico/sponsorUserOperation.js.map +1 -0
  82. package/_esm/actions/pimlico.js +5 -123
  83. package/_esm/actions/pimlico.js.map +1 -1
  84. package/_esm/actions/public/getAccountNonce.js +57 -0
  85. package/_esm/actions/public/getAccountNonce.js.map +1 -0
  86. package/_esm/actions/{public.js → public/getSenderAddress.js} +1 -57
  87. package/_esm/actions/public/getSenderAddress.js.map +1 -0
  88. package/_esm/actions/stackup/accounts.js +30 -0
  89. package/_esm/actions/stackup/accounts.js.map +1 -0
  90. package/_esm/actions/stackup/sponsorUserOperation.js +40 -0
  91. package/_esm/actions/stackup/sponsorUserOperation.js.map +1 -0
  92. package/_esm/actions/stackup.js +5 -0
  93. package/_esm/actions/stackup.js.map +1 -0
  94. package/_esm/clients/bundler.js +1 -1
  95. package/_esm/clients/bundler.js.map +1 -1
  96. package/_esm/clients/decorators/bundler.js +18 -0
  97. package/_esm/clients/decorators/bundler.js.map +1 -0
  98. package/_esm/clients/decorators/pimlico.js +20 -0
  99. package/_esm/clients/decorators/pimlico.js.map +1 -0
  100. package/_esm/clients/decorators/stackup.js +8 -0
  101. package/_esm/clients/decorators/stackup.js.map +1 -0
  102. package/_esm/clients/pimlico.js +2 -2
  103. package/_esm/clients/pimlico.js.map +1 -1
  104. package/_esm/clients/stackup.js +33 -0
  105. package/_esm/clients/stackup.js.map +1 -0
  106. package/_esm/index.js +17 -4
  107. package/_esm/index.js.map +1 -1
  108. package/_esm/types/stackup.js +2 -0
  109. package/_esm/types/stackup.js.map +1 -0
  110. package/_esm/{actions/utils.js → utils/deepHexlify.js} +1 -1
  111. package/_esm/utils/deepHexlify.js.map +1 -0
  112. package/_esm/utils/getUserOperationHash.js +55 -0
  113. package/_esm/utils/getUserOperationHash.js.map +1 -0
  114. package/_esm/utils/index.js +1 -54
  115. package/_esm/utils/index.js.map +1 -1
  116. package/_esm/utils/observe.js +42 -0
  117. package/_esm/utils/observe.js.map +1 -0
  118. package/_types/actions/bundler/chainId.d.ts +25 -0
  119. package/_types/actions/bundler/chainId.d.ts.map +1 -0
  120. package/_types/actions/bundler/estimateUserOperationGas.d.ts +42 -0
  121. package/_types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -0
  122. package/_types/actions/bundler/getUserOperationByHash.d.ts +37 -0
  123. package/_types/actions/bundler/getUserOperationByHash.d.ts.map +1 -0
  124. package/_types/actions/bundler/getUserOperationReceipt.d.ts +62 -0
  125. package/_types/actions/bundler/getUserOperationReceipt.d.ts.map +1 -0
  126. package/_types/actions/bundler/sendUserOperation.d.ts +36 -0
  127. package/_types/actions/bundler/sendUserOperation.d.ts.map +1 -0
  128. package/_types/actions/bundler/supportedEntryPoints.d.ts +26 -0
  129. package/_types/actions/bundler/supportedEntryPoints.d.ts.map +1 -0
  130. package/_types/actions/bundler/waitForUserOperationReceipt.d.ts +43 -0
  131. package/_types/actions/bundler/waitForUserOperationReceipt.d.ts.map +1 -0
  132. package/_types/actions/index.d.ts +19 -6
  133. package/_types/actions/index.d.ts.map +1 -1
  134. package/_types/actions/pimlico/getUserOperationGasPrice.d.ts +38 -0
  135. package/_types/actions/pimlico/getUserOperationGasPrice.d.ts.map +1 -0
  136. package/_types/actions/pimlico/getUserOperationStatus.d.ts +31 -0
  137. package/_types/actions/pimlico/getUserOperationStatus.d.ts.map +1 -0
  138. package/_types/actions/pimlico/sponsorUserOperation.d.ts +41 -0
  139. package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -0
  140. package/_types/actions/pimlico.d.ts +7 -177
  141. package/_types/actions/pimlico.d.ts.map +1 -1
  142. package/_types/actions/public/getAccountNonce.d.ts +34 -0
  143. package/_types/actions/public/getAccountNonce.d.ts.map +1 -0
  144. package/_types/actions/{public.d.ts → public/getSenderAddress.d.ts} +2 -35
  145. package/_types/actions/public/getSenderAddress.d.ts.map +1 -0
  146. package/_types/actions/stackup/accounts.d.ts +29 -0
  147. package/_types/actions/stackup/accounts.d.ts.map +1 -0
  148. package/_types/actions/stackup/sponsorUserOperation.d.ts +43 -0
  149. package/_types/actions/stackup/sponsorUserOperation.d.ts.map +1 -0
  150. package/_types/actions/stackup.d.ts +7 -0
  151. package/_types/actions/stackup.d.ts.map +1 -0
  152. package/_types/clients/bundler.d.ts +3 -3
  153. package/_types/clients/bundler.d.ts.map +1 -1
  154. package/_types/clients/decorators/bundler.d.ts +173 -0
  155. package/_types/clients/decorators/bundler.d.ts.map +1 -0
  156. package/_types/clients/decorators/pimlico.d.ts +78 -0
  157. package/_types/clients/decorators/pimlico.d.ts.map +1 -0
  158. package/_types/clients/decorators/stackup.d.ts +54 -0
  159. package/_types/clients/decorators/stackup.d.ts.map +1 -0
  160. package/_types/clients/pimlico.d.ts +3 -3
  161. package/_types/clients/pimlico.d.ts.map +1 -1
  162. package/_types/clients/stackup.d.ts +39 -0
  163. package/_types/clients/stackup.d.ts.map +1 -0
  164. package/_types/index.d.ts +28 -4
  165. package/_types/index.d.ts.map +1 -1
  166. package/_types/types/bundler.d.ts +1 -1
  167. package/_types/types/bundler.d.ts.map +1 -1
  168. package/_types/types/index.d.ts +1 -1
  169. package/_types/types/index.d.ts.map +1 -1
  170. package/_types/types/pimlico.d.ts +1 -1
  171. package/_types/types/pimlico.d.ts.map +1 -1
  172. package/_types/types/stackup.d.ts +35 -0
  173. package/_types/types/stackup.d.ts.map +1 -0
  174. package/_types/{actions/utils.d.ts → utils/deepHexlify.d.ts} +1 -1
  175. package/_types/utils/deepHexlify.d.ts.map +1 -0
  176. package/_types/utils/getUserOperationHash.d.ts +30 -0
  177. package/_types/utils/getUserOperationHash.d.ts.map +1 -0
  178. package/_types/utils/index.d.ts +2 -30
  179. package/_types/utils/index.d.ts.map +1 -1
  180. package/_types/utils/observe.d.ts +17 -0
  181. package/_types/utils/observe.d.ts.map +1 -0
  182. package/actions/bundler/chainId.ts +32 -0
  183. package/actions/bundler/estimateUserOperationGas.ts +62 -0
  184. package/actions/bundler/getUserOperationByHash.ts +69 -0
  185. package/actions/bundler/getUserOperationReceipt.ts +112 -0
  186. package/actions/bundler/sendUserOperation.ts +45 -0
  187. package/actions/bundler/supportedEntryPoints.ts +31 -0
  188. package/actions/bundler/waitForUserOperationReceipt.ts +80 -0
  189. package/actions/index.ts +30 -21
  190. package/actions/pimlico/getUserOperationGasPrice.ts +61 -0
  191. package/actions/pimlico/getUserOperationStatus.ts +41 -0
  192. package/actions/pimlico/sponsorUserOperation.ts +62 -0
  193. package/actions/pimlico.ts +34 -251
  194. package/actions/public/getAccountNonce.ts +63 -0
  195. package/actions/{public.ts → public/getSenderAddress.ts} +7 -68
  196. package/actions/stackup/accounts.ts +40 -0
  197. package/actions/stackup/sponsorUserOperation.ts +64 -0
  198. package/actions/stackup.ts +17 -0
  199. package/clients/bundler.ts +9 -4
  200. package/clients/decorators/bundler.ts +211 -0
  201. package/clients/decorators/pimlico.ts +107 -0
  202. package/clients/decorators/stackup.ts +65 -0
  203. package/clients/pimlico.ts +3 -4
  204. package/clients/stackup.ts +44 -0
  205. package/index.ts +70 -4
  206. package/package.json +11 -1
  207. package/tsconfig.build.tsbuildinfo +1 -1
  208. package/types/bundler.ts +1 -1
  209. package/types/index.ts +1 -1
  210. package/types/pimlico.ts +1 -1
  211. package/types/stackup.ts +36 -0
  212. package/utils/getUserOperationHash.ts +68 -0
  213. package/utils/index.ts +2 -69
  214. package/utils/observe.ts +61 -0
  215. package/_cjs/actions/bundler.js +0 -118
  216. package/_cjs/actions/bundler.js.map +0 -1
  217. package/_cjs/actions/public.js.map +0 -1
  218. package/_cjs/actions/utils.js.map +0 -1
  219. package/_cjs/clients/index.js +0 -6
  220. package/_cjs/clients/index.js.map +0 -1
  221. package/_esm/actions/bundler.js +0 -251
  222. package/_esm/actions/bundler.js.map +0 -1
  223. package/_esm/actions/public.js.map +0 -1
  224. package/_esm/actions/utils.js.map +0 -1
  225. package/_esm/clients/index.js +0 -3
  226. package/_esm/clients/index.js.map +0 -1
  227. package/_types/actions/bundler.d.ts +0 -393
  228. package/_types/actions/bundler.d.ts.map +0 -1
  229. package/_types/actions/public.d.ts.map +0 -1
  230. package/_types/actions/utils.d.ts.map +0 -1
  231. package/_types/clients/index.d.ts +0 -3
  232. package/_types/clients/index.d.ts.map +0 -1
  233. package/actions/bundler.ts +0 -498
  234. package/clients/index.ts +0 -3
  235. /package/{actions/utils.ts → utils/deepHexlify.ts} +0 -0
@@ -0,0 +1,173 @@
1
+ import type { Address } from "abitype";
2
+ import type { Client, Hash } from "viem";
3
+ import { type EstimateUserOperationGasParameters, type EstimateUserOperationGasReturnType } from "../../actions/bundler/estimateUserOperationGas.js";
4
+ import { type GetUserOperationByHashParameters, type GetUserOperationByHashReturnType } from "../../actions/bundler/getUserOperationByHash.js";
5
+ import { type GetUserOperationReceiptParameters, type GetUserOperationReceiptReturnType } from "../../actions/bundler/getUserOperationReceipt.js";
6
+ import { type SendUserOperationParameters } from "../../actions/bundler/sendUserOperation.js";
7
+ import { type WaitForUserOperationReceiptParameters } from "../../actions/bundler/waitForUserOperationReceipt.js";
8
+ export type BundlerActions = {
9
+ /**
10
+ *
11
+ * Sends user operation to the bundler
12
+ *
13
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/sendUserOperation
14
+ *
15
+ * @param args {@link SendUserOperationParameters}.
16
+ * @returns UserOpHash that you can use to track user operation as {@link Hash}.
17
+ *
18
+ * @example
19
+ * import { createClient } from "viem"
20
+ * import { bundlerActions } from "permissionless"
21
+ *
22
+ * const bundlerClient = createClient({
23
+ * chain: goerli,
24
+ * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
25
+ * }).extend(bundlerActions)
26
+ *
27
+ * const userOpHash = await bundlerClient.sendUserOperation({
28
+ * userOperation: signedUserOperation,
29
+ * entryPoint: entryPoint
30
+ * })
31
+ *
32
+ * // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
33
+ */
34
+ sendUserOperation: (args: SendUserOperationParameters) => Promise<Hash>;
35
+ /**
36
+ *
37
+ * Estimates preVerificationGas, verificationGasLimit and callGasLimit for user operation
38
+ *
39
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/estimateUserOperationGas
40
+ *
41
+ * @param args {@link EstimateUserOperationGasParameters}
42
+ * @returns preVerificationGas, verificationGasLimit and callGasLimit as {@link EstimateUserOperationGasReturnType}
43
+ *
44
+ * @example
45
+ * import { createClient } from "viem"
46
+ * import { bundlerActions } from "permissionless"
47
+ *
48
+ * const bundlerClient = createClient({
49
+ * chain: goerli,
50
+ * transport: http(BUNDLER_URL)
51
+ * }).extend(bundlerActions)
52
+ *
53
+ * const gasParameters = await bundlerClient.estimateUserOperationGas({
54
+ * userOperation: signedUserOperation,
55
+ * entryPoint: entryPoint
56
+ * })
57
+ *
58
+ * // Return {preVerificationGas: 43492n, verificationGasLimit: 59436n, callGasLimit: 9000n}
59
+ */
60
+ estimateUserOperationGas: (args: EstimateUserOperationGasParameters) => Promise<EstimateUserOperationGasReturnType>;
61
+ /**
62
+ *
63
+ * Returns the supported entrypoints by the bundler service
64
+ *
65
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/supportedEntryPoints
66
+ *
67
+ * @returns Supported entryPoints
68
+ *
69
+ * @example
70
+ * import { createClient } from "viem"
71
+ * import { bundlerActions } from "permissionless"
72
+ *
73
+ * const bundlerClient = createClient({
74
+ * chain: goerli,
75
+ * transport: http(BUNDLER_URL)
76
+ * }).extend(bundlerActions)
77
+ *
78
+ * const supportedEntryPoints = await bundlerClient.supportedEntryPoints()
79
+ *
80
+ * // Return ['0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789']
81
+ */
82
+ supportedEntryPoints: () => Promise<Address[]>;
83
+ /**
84
+ *
85
+ * Returns the supported chain id by the bundler service
86
+ *
87
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/chainId
88
+ *
89
+ * @returns Supported chain id
90
+ *
91
+ * @example
92
+ * import { createClient } from "viem"
93
+ * import { bundlerActions } from "permissionless"
94
+ *
95
+ * const bundlerClient = createClient({
96
+ * chain: goerli,
97
+ * transport: http(BUNDLER_URL)
98
+ * }).extend(bundlerActions)
99
+ *
100
+ * const chainId = await bundlerClient.chainId()
101
+ * // Return 5n for Goerli
102
+ */
103
+ chainId: () => Promise<number>;
104
+ /**
105
+ *
106
+ * Returns the user operation from userOpHash
107
+ *
108
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationByHash
109
+ *
110
+ * @param args {@link GetUserOperationByHash} UserOpHash that was returned by {@link sendUserOperation}
111
+ * @returns userOperation along with entryPoint, transactionHash, blockHash, blockNumber if found or null
112
+ *
113
+ * @example
114
+ * import { createClient } from "viem"
115
+ * import { bundlerActions } from "permissionless"
116
+ *
117
+ * const bundlerClient = createClient({
118
+ * chain: goerli,
119
+ * transport: http(BUNDLER_URL)
120
+ * }).extend(bundlerActions)
121
+ *
122
+ * await bundlerClient.getUserOperationByHash(userOpHash)
123
+ *
124
+ */
125
+ getUserOperationByHash: (args: GetUserOperationByHashParameters) => Promise<GetUserOperationByHashReturnType>;
126
+ /**
127
+ *
128
+ * Returns the user operation receipt from userOpHash
129
+ *
130
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt
131
+ *
132
+ * @param args {@link GetUserOperationReceiptParameters} UserOpHash that was returned by {@link sendUserOperation}
133
+ * @returns user operation receipt {@link GetUserOperationReceiptReturnType} if found or null
134
+ *
135
+ * @example
136
+ * import { createClient } from "viem"
137
+ * import { bundlerActions } from "permissionless"
138
+ *
139
+ * const bundlerClient = createClient({
140
+ * chain: goerli,
141
+ * transport: http(BUNDLER_URL)
142
+ * }).extend(bundlerActions)
143
+ *
144
+ * await bundlerClient.getUserOperationReceipt({hash: userOpHash})
145
+ *
146
+ */
147
+ getUserOperationReceipt: (args: GetUserOperationReceiptParameters) => Promise<GetUserOperationReceiptReturnType | null>;
148
+ /**
149
+ * 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
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/waitForUserOperationReceipt
152
+ *
153
+ * @param client - Bundler Client to use
154
+ * @param parameters - {@link WaitForUserOperationReceiptParameters}
155
+ * @returns The transaction receipt. {@link GetUserOperationReceiptReturnType}
156
+ *
157
+ * @example
158
+ * import { createBundlerClient, waitForUserOperationReceipt, http } from 'viem'
159
+ * import { mainnet } from 'viem/chains'
160
+ *
161
+ * const bundlerClient = createBundlerClient({
162
+ * chain: mainnet,
163
+ * transport: http(),
164
+ * })
165
+ * const userOperationReceipt = await bundlerClient.waitForUserOperationReceipt({
166
+ * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
167
+ * })
168
+ */
169
+ waitForUserOperationReceipt: (args: WaitForUserOperationReceiptParameters) => Promise<GetUserOperationReceiptReturnType>;
170
+ };
171
+ declare const bundlerActions: (client: Client) => BundlerActions;
172
+ export { bundlerActions };
173
+ //# sourceMappingURL=bundler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../../clients/decorators/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAExC,OAAO,EACH,KAAK,kCAAkC,EACvC,KAAK,kCAAkC,EAE1C,MAAM,mDAAmD,CAAA;AAC1D,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EAExC,MAAM,iDAAiD,CAAA;AACxD,OAAO,EACH,KAAK,iCAAiC,EACtC,KAAK,iCAAiC,EAEzC,MAAM,kDAAkD,CAAA;AACzD,OAAO,EAAE,KAAK,2BAA2B,EAAqB,MAAM,4CAA4C,CAAA;AAEhH,OAAO,EACH,KAAK,qCAAqC,EAE7C,MAAM,sDAAsD,CAAA;AAG7D,MAAM,MAAM,cAAc,GAAG;IACzB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,iBAAiB,EAAE,CAAC,IAAI,EAAE,2BAA2B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACvE;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,wBAAwB,EAAE,CAAC,IAAI,EAAE,kCAAkC,KAAK,OAAO,CAAC,kCAAkC,CAAC,CAAA;IACnH;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,oBAAoB,EAAE,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;IAC9C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;IAC9B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,sBAAsB,EAAE,CAAC,IAAI,EAAE,gCAAgC,KAAK,OAAO,CAAC,gCAAgC,CAAC,CAAA;IAC7G;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,uBAAuB,EAAE,CACrB,IAAI,EAAE,iCAAiC,KACtC,OAAO,CAAC,iCAAiC,GAAG,IAAI,CAAC,CAAA;IAEtD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,2BAA2B,EAAE,CACzB,IAAI,EAAE,qCAAqC,KAC1C,OAAO,CAAC,iCAAiC,CAAC,CAAA;CAClD,CAAA;AAED,QAAA,MAAM,cAAc,WAAY,MAAM,KAAG,cAavC,CAAA;AAEF,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,78 @@
1
+ import type { Client } from "viem";
2
+ import { type GetUserOperationGasPriceReturnType } from "../../actions/pimlico/getUserOperationGasPrice.js";
3
+ import { type GetUserOperationStatusParameters, type GetUserOperationStatusReturnType } from "../../actions/pimlico/getUserOperationStatus.js";
4
+ import { type SponsorUserOperationParameters, type SponsorUserOperationReturnType } from "../../actions/pimlico/sponsorUserOperation.js";
5
+ export type PimlicoBundlerActions = {
6
+ /**
7
+ * Returns the live gas prices that you can use to send a user operation.
8
+ *
9
+ * - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationGasPrice
10
+ *
11
+ * @returns slow, standard & fast values for maxFeePerGas & maxPriorityFeePerGas {@link GetUserOperationGasPriceReturnType}
12
+ *
13
+ * @example
14
+ *
15
+ * import { createClient } from "viem"
16
+ * import { pimlicoBundlerActions } from "permissionless/actions/pimlico"
17
+ *
18
+ * const bundlerClient = createClient({
19
+ * chain: goerli,
20
+ * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
21
+ * }).extend(pimlicoBundlerActions)
22
+ *
23
+ * await bundlerClient.getUserOperationGasPrice()
24
+ */
25
+ getUserOperationGasPrice: () => Promise<GetUserOperationGasPriceReturnType>;
26
+ /**
27
+ * Returns the status of the userOperation that is pending in the mempool.
28
+ *
29
+ * - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationStatus
30
+ *
31
+ * @param hash {@link Hash} UserOpHash that you must have received from sendUserOperation.
32
+ * @returns status & transaction hash if included {@link GetUserOperationStatusReturnType}
33
+ *
34
+ * @example
35
+ * import { createClient } from "viem"
36
+ * import { pimlicoBundlerActions } from "permissionless/actions/pimlico"
37
+ *
38
+ * const bundlerClient = createClient({
39
+ * chain: goerli,
40
+ * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
41
+ * }).extend(pimlicoBundlerActions)
42
+ *
43
+ * await bundlerClient.getUserOperationStatus({ hash: userOpHash })
44
+ */
45
+ getUserOperationStatus: (args: GetUserOperationStatusParameters) => Promise<GetUserOperationStatusReturnType>;
46
+ };
47
+ export declare const pimlicoBundlerActions: (client: Client) => PimlicoBundlerActions;
48
+ export type PimlicoPaymasterClientActions = {
49
+ /**
50
+ * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
51
+ *
52
+ * https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/sponsorUserOperation
53
+ *
54
+ * @param args {@link SponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
55
+ * @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
56
+ *
57
+ * @example
58
+ * import { createClient } from "viem"
59
+ * import { sponsorUserOperation } from "permissionless/actions/pimlico"
60
+ *
61
+ * const bundlerClient = createClient({
62
+ * chain: goerli,
63
+ * transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
64
+ * }).extend(pimlicoPaymasterActions)
65
+ *
66
+ * await bundlerClient.sponsorUserOperation(bundlerClient, {
67
+ * userOperation: userOperationWithDummySignature,
68
+ * entryPoint: entryPoint
69
+ * }})
70
+ *
71
+ */
72
+ sponsorUserOperation: (args: SponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType>;
73
+ };
74
+ export declare const pimlicoPaymasterActions: (client: Client) => PimlicoPaymasterClientActions;
75
+ /**
76
+ * TODO: Add support for pimlicoActions after we support all the actions of v1 in v2 of the Pimlico API.
77
+ */
78
+ //# sourceMappingURL=pimlico.d.ts.map
@@ -0,0 +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,kCAAkC,EAE1C,MAAM,mDAAmD,CAAA;AAC1D,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EAExC,MAAM,iDAAiD,CAAA;AACxD,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EAEtC,MAAM,+CAA+C,CAAA;AAGtD,MAAM,MAAM,qBAAqB,GAAG;IAChC;;;;;;;;;;;;;;;;;;OAkBG;IACH,wBAAwB,EAAE,MAAM,OAAO,CAAC,kCAAkC,CAAC,CAAA;IAC3E;;;;;;;;;;;;;;;;;;OAkBG;IACH,sBAAsB,EAAE,CAAC,IAAI,EAAE,gCAAgC,KAAK,OAAO,CAAC,gCAAgC,CAAC,CAAA;CAChH,CAAA;AAED,eAAO,MAAM,qBAAqB,WAAY,MAAM,KAAG,qBAIrD,CAAA;AAEF,MAAM,MAAM,6BAA6B,GAAG;IACxC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,oBAAoB,EAAE,CAAC,IAAI,EAAE,8BAA8B,KAAK,OAAO,CAAC,8BAA8B,CAAC,CAAA;CAC1G,CAAA;AAED,eAAO,MAAM,uBAAuB,WAAY,MAAM,KAAG,6BAGvD,CAAA;AAEF;;GAEG"}
@@ -0,0 +1,54 @@
1
+ import type { Address, Client } from "viem";
2
+ import { type AccountsParameters } from "../../actions/stackup/accounts.js";
3
+ import { type SponsorUserOperationParameters, type SponsorUserOperationReturnType } from "../../actions/stackup/sponsorUserOperation.js";
4
+ export type StackupPaymasterClientActions = {
5
+ /**
6
+ * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
7
+ *
8
+ * https://docs.stackup.sh/docs/paymaster-api-rpc-methods#pm_sponsoruseroperation
9
+ *
10
+ * @param args {@link SponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
11
+ * @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
12
+ *
13
+ * @example
14
+ * import { createClient } from "viem"
15
+ * import { stackupPaymasterActions } from "permissionless/actions/stackup"
16
+ *
17
+ * const bundlerClient = createClient({
18
+ * chain: goerli,
19
+ * transport: http("https://api.stackup.sh/v1/paymaster/YOUR_API_KEY_HERE")
20
+ * }).extend(stackupPaymasterActions)
21
+ *
22
+ * await bundlerClient.sponsorUserOperation(bundlerClient, {
23
+ * userOperation: userOperationWithDummySignature,
24
+ * entryPoint: entryPoint
25
+ * }})
26
+ *
27
+ */
28
+ sponsorUserOperation: (args: SponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType>;
29
+ /**
30
+ * Returns all the Paymaster addresses associated with an EntryPoint that’s owned by this service.
31
+ *
32
+ * https://docs.stackup.sh/docs/paymaster-api-rpc-methods#pm_accounts
33
+ *
34
+ * @param args {@link AccountsParameters} entryPoint for which you want to get list of supported paymasters.
35
+ * @returns paymaster addresses
36
+ *
37
+ * @example
38
+ * import { createClient } from "viem"
39
+ * import { stackupPaymasterActions } from "permissionless/actions/stackup"
40
+ *
41
+ * const bundlerClient = createClient({
42
+ * chain: goerli,
43
+ * transport: http("https://api.stackup.sh/v1/paymaster/YOUR_API_KEY_HERE")
44
+ * }).extend(stackupPaymasterActions)
45
+ *
46
+ * await bundlerClient.accounts(bundlerClient, {
47
+ * entryPoint: entryPoint
48
+ * }})
49
+ *
50
+ */
51
+ accounts: (args: AccountsParameters) => Promise<Address[]>;
52
+ };
53
+ export declare const stackupPaymasterActions: (client: Client) => StackupPaymasterClientActions;
54
+ //# sourceMappingURL=stackup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stackup.d.ts","sourceRoot":"","sources":["../../../clients/decorators/stackup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC3C,OAAO,EAAE,KAAK,kBAAkB,EAAY,MAAM,mCAAmC,CAAA;AACrF,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EAEtC,MAAM,+CAA+C,CAAA;AAGtD,MAAM,MAAM,6BAA6B,GAAG;IACxC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,oBAAoB,EAAE,CAAC,IAAI,EAAE,8BAA8B,KAAK,OAAO,CAAC,8BAA8B,CAAC,CAAA;IAEvG;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;CAC7D,CAAA;AAED,eAAO,MAAM,uBAAuB,WAAY,MAAM,KAAG,6BAIvD,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import type { Account, Chain, Client, PublicClientConfig, Transport } from "viem";
2
- import type { BundlerActions } from "../actions/bundler";
3
- import { type PimlicoBundlerActions, type PimlicoPaymasterClientActions } from "../actions/pimlico";
4
- import type { PimlicoBundlerRpcSchema, PimlicoPaymasterRpcSchema } from "../types/pimlico";
2
+ import type { PimlicoBundlerRpcSchema, PimlicoPaymasterRpcSchema } from "../types/pimlico.js";
3
+ import { type BundlerActions } from "./decorators/bundler.js";
4
+ import { type PimlicoBundlerActions, type PimlicoPaymasterClientActions } from "./decorators/pimlico.js";
5
5
  export type PimlicoBundlerClient = Client<Transport, Chain | undefined, Account | undefined, PimlicoBundlerRpcSchema, PimlicoBundlerActions & BundlerActions>;
6
6
  export type PimlicoPaymasterClient = Client<Transport, Chain | undefined, Account | undefined, PimlicoPaymasterRpcSchema, PimlicoPaymasterClientActions>;
7
7
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../clients/pimlico.ts"],"names":[],"mappings":"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SAAS,EACT,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,SAAS,EACnB,uBAAuB,EACvB,qBAAqB,GAAG,cAAc,CACzC,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,CACvC,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,SAAS,EACnB,yBAAyB,EACzB,6BAA6B,CAChC,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;MAEpC,oBASF,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;MAEtC,sBASF,CAAA"}
@@ -0,0 +1,39 @@
1
+ import { type Account, type Chain, type Client, type PublicClientConfig, type Transport } from "viem";
2
+ import type { StackupPaymasterRpcSchema } from "../types/stackup.js";
3
+ import { type BundlerActions } from "./decorators/bundler.js";
4
+ import { type StackupPaymasterClientActions } from "./decorators/stackup.js";
5
+ export type StackupPaymasterClient = Client<Transport, Chain | undefined, Account | undefined, StackupPaymasterRpcSchema, StackupPaymasterClientActions & BundlerActions>;
6
+ /**
7
+ * Creates a Stackup specific Paymaster Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
8
+ *
9
+ * - Docs: https://docs.pimlico.io/permissionless/reference/clients/stackupPaymasterClient
10
+ *
11
+ * A Stackup Paymaster Client is an interface to "stackup paymaster endpoints" [JSON-RPC API](https://docs.stackup.sh/docs/paymaster-api-rpc-methods) methods such as sponsoring user operation, etc through Stackup Paymaster Actions.
12
+ *
13
+ * @param config - {@link PublicClientConfig}
14
+ * @returns A Stackup Paymaster Client. {@link StackupPaymasterClient}
15
+ *
16
+ * @example
17
+ * import { createPublicClient, http } from 'viem'
18
+ * import { mainnet } from 'viem/chains'
19
+ *
20
+ * const stackupPaymasterClient = createStackupPaymasterClient({
21
+ * chain: mainnet,
22
+ * transport: http("https://api.stackup.sh/v1/paymaster/YOUR_API_KEY_HERE"),
23
+ * })
24
+ */
25
+ export declare const createStackupPaymasterClient: <transport extends Transport, chain extends Chain | undefined = undefined>(parameters: {
26
+ batch?: {
27
+ multicall?: boolean | {
28
+ batchSize?: number | undefined;
29
+ wait?: number | undefined;
30
+ } | undefined;
31
+ } | undefined;
32
+ cacheTime?: number | undefined;
33
+ chain?: Chain | chain | undefined;
34
+ key?: string | undefined;
35
+ name?: string | undefined;
36
+ pollingInterval?: number | undefined;
37
+ transport: transport;
38
+ }) => StackupPaymasterClient;
39
+ //# sourceMappingURL=stackup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stackup.d.ts","sourceRoot":"","sources":["../../clients/stackup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAgB,MAAM,MAAM,CAAA;AACnH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,yBAAyB,CAAA;AAC7E,OAAO,EAAE,KAAK,6BAA6B,EAA2B,MAAM,yBAAyB,CAAA;AAErG,MAAM,MAAM,sBAAsB,GAAG,MAAM,CACvC,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,SAAS,EACnB,yBAAyB,EACzB,6BAA6B,GAAG,cAAc,CACjD,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;MAEtC,sBASF,CAAA"}
package/_types/index.d.ts CHANGED
@@ -1,5 +1,29 @@
1
- export * from "./actions";
2
- export * from "./clients";
3
- export * from "./types";
4
- export * from "./utils";
1
+ import type { EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType } from "./actions/bundler/estimateUserOperationGas.js";
2
+ import type { GetUserOperationByHashParameters } from "./actions/bundler/getUserOperationByHash.js";
3
+ import type { GetUserOperationByHashReturnType } from "./actions/bundler/getUserOperationByHash.js";
4
+ import type { GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType } from "./actions/bundler/getUserOperationReceipt.js";
5
+ import type { SendUserOperationParameters } from "./actions/bundler/sendUserOperation.js";
6
+ import type { GetSenderAddressParams } from "./actions/public/getSenderAddress.js";
7
+ import { getSenderAddress } from "./actions/public/getSenderAddress.js";
8
+ import { chainId } from "./actions/bundler/chainId.js";
9
+ import { estimateUserOperationGas } from "./actions/bundler/estimateUserOperationGas.js";
10
+ import { getUserOperationByHash } from "./actions/bundler/getUserOperationByHash.js";
11
+ import { getUserOperationReceipt } from "./actions/bundler/getUserOperationReceipt.js";
12
+ import { sendUserOperation } from "./actions/bundler/sendUserOperation.js";
13
+ import { supportedEntryPoints } from "./actions/bundler/supportedEntryPoints.js";
14
+ import { waitForUserOperationReceipt } from "./actions/bundler/waitForUserOperationReceipt.js";
15
+ import { type WaitForUserOperationReceiptParameters, WaitForUserOperationReceiptTimeoutError } from "./actions/bundler/waitForUserOperationReceipt.js";
16
+ import type { GetAccountNonceParams } from "./actions/public/getAccountNonce.js";
17
+ import { getAccountNonce } from "./actions/public/getAccountNonce.js";
18
+ import { type BundlerClient, createBundlerClient } from "./clients/bundler.js";
19
+ import type { BundlerActions } from "./clients/decorators/bundler.js";
20
+ import { bundlerActions } from "./clients/decorators/bundler.js";
21
+ export type { SendUserOperationParameters, EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType, GetUserOperationByHashParameters, GetUserOperationByHashReturnType, GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType, GetSenderAddressParams, GetAccountNonceParams, BundlerClient, BundlerActions, WaitForUserOperationReceiptParameters };
22
+ export { sendUserOperation, estimateUserOperationGas, supportedEntryPoints, chainId, getUserOperationByHash, getUserOperationReceipt, getSenderAddress, getAccountNonce, waitForUserOperationReceipt, createBundlerClient, bundlerActions, WaitForUserOperationReceiptTimeoutError };
23
+ import type { UserOperation } from "./types/userOperation.js";
24
+ export { type UserOperation };
25
+ import type { GetUserOperationHashParams } from "./utils/getUserOperationHash.js";
26
+ import { getUserOperationHash } from "./utils/getUserOperationHash.js";
27
+ export { getUserOperationHash, type GetUserOperationHashParams };
28
+ export * from "./utils/index.js";
5
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,kCAAkC,EAClC,kCAAkC,EACrC,MAAM,+CAA+C,CAAA;AACtD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAA;AACnG,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAA;AACnG,OAAO,KAAK,EACR,iCAAiC,EACjC,iCAAiC,EACpC,MAAM,8CAA8C,CAAA;AACrD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAA;AAEzF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAA;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAEvE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAA;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAA;AACpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAA;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAA;AAC9F,OAAO,EACH,KAAK,qCAAqC,EAC1C,uCAAuC,EAC1C,MAAM,kDAAkD,CAAA;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,EAAE,KAAK,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAEhE,YAAY,EACR,2BAA2B,EAC3B,kCAAkC,EAClC,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,EACjC,iCAAiC,EACjC,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,qCAAqC,EACxC,CAAA;AAED,OAAO,EACH,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,OAAO,EACP,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,2BAA2B,EAC3B,mBAAmB,EACnB,cAAc,EACd,uCAAuC,EAC1C,CAAA;AACD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D,OAAO,EAAE,KAAK,aAAa,EAAE,CAAA;AAE7B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAEtE,OAAO,EAAE,oBAAoB,EAAE,KAAK,0BAA0B,EAAE,CAAA;AAChE,cAAc,kBAAkB,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import type { Address, Hash, Hex } from "viem";
2
2
  import type { PartialBy } from "viem/types/utils";
3
- import type { UserOperationWithBigIntAsHex } from "./userOperation";
3
+ import type { UserOperationWithBigIntAsHex } from "./userOperation.js";
4
4
  export type BundlerRpcSchema = [
5
5
  {
6
6
  Method: "eth_sendUserOperation";
@@ -1 +1 @@
1
- {"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../types/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAA;AAEnE,MAAM,MAAM,gBAAgB,GAAG;IAC3B;QACI,MAAM,EAAE,uBAAuB,CAAA;QAC/B,UAAU,EAAE,CAAC,aAAa,EAAE,4BAA4B,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;QAC9E,UAAU,EAAE,IAAI,CAAA;KACnB;IACD;QACI,MAAM,EAAE,8BAA8B,CAAA;QACtC,UAAU,EAAE;YACR,aAAa,EAAE,SAAS,CACpB,4BAA4B,EAC5B,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,CACjE;YACD,UAAU,EAAE,OAAO;SACtB,CAAA;QACD,UAAU,EAAE;YACR,kBAAkB,EAAE,GAAG,CAAA;YACvB,oBAAoB,EAAE,GAAG,CAAA;YACzB,YAAY,EAAE,GAAG,CAAA;SACpB,CAAA;KACJ;IACD;QACI,MAAM,EAAE,0BAA0B,CAAA;QAClC,UAAU,EAAE,EAAE,CAAA;QACd,UAAU,EAAE,OAAO,EAAE,CAAA;KACxB;IACD;QACI,MAAM,EAAE,aAAa,CAAA;QACrB,UAAU,EAAE,EAAE,CAAA;QACd,UAAU,EAAE,GAAG,CAAA;KAClB;IACD;QACI,MAAM,EAAE,4BAA4B,CAAA;QACpC,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QACxB,UAAU,EAAE;YACR,aAAa,EAAE,4BAA4B,CAAA;YAC3C,UAAU,EAAE,OAAO,CAAA;YACnB,eAAe,EAAE,IAAI,CAAA;YACrB,SAAS,E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A;QACxB,UAAU,EAAE,mCAAmC,CAAA;KAClD;CACJ,CAAA;AAED,KAAK,mCAAmC,GAAG;IACvC,UAAU,EAAE,IAAI,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,GAAG,CAAA;IACV,aAAa,EAAE,GAAG,CAAA;IAClB,aAAa,EAAE,GAAG,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE;QACL,eAAe,EAAE,GAAG,CAAA;QACpB,gBAAgB,EAAE,GAAG,CAAA;QACrB,SAAS,EAAE,IAAI,CAAA;QACf,WAAW,EAAE,GAAG,CAAA;QAChB,IAAI,EAAE,OAAO,CAAA;QACb,EAAE,EAAE,OAAO,GAAG,IAAI,CAAA;QAClB,iBAAiB,EAAE,GAAG,CAAA;QACtB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAA;QACrB,OAAO,EAAE,GAAG,CAAA;QACZ,eAAe,EAAE,OAAO,GAAG,IAAI,CAAA;QAC/B,SAAS,EAAE,GAAG,CAAA;QACd,iBAAiB,EAAE,GAAG,CAAA;KACzB,CAAA;IACD,IAAI,EAAE;QACF,IAAI,EAAE,GAAG,CAAA;QACT,WAAW,EAAE,GAAG,CAAA;QAChB,SAAS,EAAE,IAAI,CAAA;QACf,eAAe,EAAE,IAAI,CAAA;QACrB,QAAQ,EAAE,GAAG,CAAA;QACb,gBAAgB,EAAE,GAAG,CAAA;QACrB,OAAO,EAAE,OAAO,CAAA;QAChB,MAAM,EAAE,GAAG,EAAE,CAAA;KAChB,EAAE,CAAA;CACN,CAAA"}
@@ -1,3 +1,3 @@
1
- import type { UserOperation } from "./userOperation";
1
+ import type { UserOperation } from "./userOperation.js";
2
2
  export type { UserOperation };
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD,YAAY,EAAE,aAAa,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,YAAY,EAAE,aAAa,EAAE,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import type { Address, Hash, Hex } from "viem";
2
2
  import type { PartialBy } from "viem/types/utils";
3
- import type { UserOperationWithBigIntAsHex } from "./userOperation";
3
+ import type { UserOperationWithBigIntAsHex } from "./userOperation.js";
4
4
  type PimlicoUserOperationGasPriceWithBigIntAsHex = {
5
5
  slow: {
6
6
  maxFeePerGas: Hex;
@@ -1 +1 @@
1
- {"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../types/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAA;AAEnE,KAAK,2CAA2C,GAAG;IAC/C,IAAI,EAAE;QACF,YAAY,EAAE,GAAG,CAAA;QACjB,oBAAoB,EAAE,GAAG,CAAA;KAC5B,CAAA;IACD,QAAQ,EAAE;QACN,YAAY,EAAE,GAAG,CAAA;QACjB,oBAAoB,EAAE,GAAG,CAAA;KAC5B,CAAA;IACD,IAAI,EAAE;QACF,YAAY,EAAE,GAAG,CAAA;QACjB,oBAAoB,EAAE,GAAG,CAAA;KAC5B,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACrC,MAAM,EAAE,WAAW,GAAG,eAAe,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAA;IACrG,eAAe,EAAE,IAAI,GAAG,IAAI,CAAA;CAC/B,CAAA;A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AA;KAC5B,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACrC,MAAM,EAAE,WAAW,GAAG,eAAe,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAA;IACrG,eAAe,EAAE,IAAI,GAAG,IAAI,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IAClC;QACI,MAAM,EAAE,kCAAkC,CAAA;QAC1C,UAAU,EAAE,EAAE,CAAA;QACd,UAAU,EAAE,2CAA2C,CAAA;KAC1D;IACD;QACI,MAAM,EAAE,gCAAgC,CAAA;QACxC,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QACxB,UAAU,EAAE,0BAA0B,CAAA;KACzC;CACJ,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACpC;QACI,MAAM,EAAE,yBAAyB,CAAA;QACjC,UAAU,EAAE;YACR,aAAa,EAAE,SAAS,CACpB,4BAA4B,EAC5B,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,kBAAkB,CACtF;YACD,UAAU,EAAE,OAAO;SACtB,CAAA;QACD,UAAU,EAAE;YACR,gBAAgB,EAAE,GAAG,CAAA;YACrB,kBAAkB,EAAE,GAAG,CAAA;YACvB,oBAAoB,EAAE,GAAG,CAAA;YACzB,YAAY,EAAE,GAAG,CAAA;SACpB,CAAA;KACJ;CACJ,CAAA"}
@@ -0,0 +1,35 @@
1
+ import type { Address, Hex } from "viem";
2
+ import type { PartialBy } from "viem/types/utils";
3
+ import type { UserOperationWithBigIntAsHex } from "./userOperation.js";
4
+ interface StackupPaymasterContextType {
5
+ type: "erc20token" | "payg";
6
+ }
7
+ export type StackupPaymasterContext = (StackupPaymasterContextType & {
8
+ type: "erc20token";
9
+ token: string;
10
+ }) | (StackupPaymasterContextType & {
11
+ type: "payg";
12
+ });
13
+ export type StackupPaymasterRpcSchema = [
14
+ {
15
+ Method: "pm_sponsorUserOperation";
16
+ Parameters: [
17
+ userOperation: PartialBy<UserOperationWithBigIntAsHex, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterAndData">,
18
+ entryPoint: Address,
19
+ context: StackupPaymasterContext
20
+ ];
21
+ ReturnType: {
22
+ paymasterAndData: Hex;
23
+ preVerificationGas: Hex;
24
+ verificationGasLimit: Hex;
25
+ callGasLimit: Hex;
26
+ };
27
+ },
28
+ {
29
+ Method: "pm_accounts";
30
+ Parameters: [entryPoint: Address];
31
+ ReturnType: Address[];
32
+ }
33
+ ];
34
+ export {};
35
+ //# sourceMappingURL=stackup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stackup.d.ts","sourceRoot":"","sources":["../../types/stackup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAA;AAEtE,UAAU,2BAA2B;IACjC,IAAI,EAAE,YAAY,GAAG,MAAM,CAAA;CAC9B;AAED,MAAM,MAAM,uBAAuB,GAC7B,CAAC,2BAA2B,GAAG;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GACrE,CAAC,2BAA2B,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAEtD,MAAM,MAAM,yBAAyB,GAAG;IACpC;QACI,MAAM,EAAE,yBAAyB,CAAA;QACjC,UAAU,EAAE;YACR,aAAa,EAAE,SAAS,CACpB,4BAA4B,EAC5B,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,kBAAkB,CACtF;YACD,UAAU,EAAE,OAAO;YACnB,OAAO,EAAE,uBAAuB;SACnC,CAAA;QACD,UAAU,EAAE;YACR,gBAAgB,EAAE,GAAG,CAAA;YACrB,kBAAkB,EAAE,GAAG,CAAA;YACvB,oBAAoB,EAAE,GAAG,CAAA;YACzB,YAAY,EAAE,GAAG,CAAA;SACpB,CAAA;KACJ;IACD;QACI,MAAM,EAAE,aAAa,CAAA;QACrB,UAAU,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;QACjC,UAAU,EAAE,OAAO,EAAE,CAAA;KACxB;CACJ,CAAA"}
@@ -3,4 +3,4 @@ export declare const transactionReceiptStatus: {
3
3
  readonly "0x1": "success";
4
4
  };
5
5
  export declare function deepHexlify(obj: any): any;
6
- //# sourceMappingURL=utils.d.ts.map
6
+ //# sourceMappingURL=deepHexlify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepHexlify.d.ts","sourceRoot":"","sources":["../../utils/deepHexlify.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB;;;CAG3B,CAAA;AAGV,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAqBzC"}
@@ -0,0 +1,30 @@
1
+ import type { Address, Hash } from "viem";
2
+ import type { UserOperation } from "../types/userOperation.js";
3
+ export type GetUserOperationHashParams = {
4
+ userOperation: UserOperation;
5
+ entryPoint: Address;
6
+ chainId: number;
7
+ };
8
+ /**
9
+ *
10
+ * Returns user operation hash that is a unique identifier of the user operation.
11
+ *
12
+ * - Docs: https://docs.pimlico.io/permissionless/reference/utils/getUserOperationHash
13
+ *
14
+ * @param args: userOperation, entryPoint, chainId as {@link GetUserOperationHashParams}
15
+ * @returns userOperationHash as {@link Hash}
16
+ *
17
+ * @example
18
+ * import { getUserOperationHash } from "permissionless/utils"
19
+ *
20
+ * const userOperationHash = getUserOperationHash({
21
+ * userOperation,
22
+ * entryPoint,
23
+ * chainId
24
+ * })
25
+ *
26
+ * // Returns "0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34"
27
+ *
28
+ */
29
+ export declare const getUserOperationHash: ({ userOperation, entryPoint, chainId }: GetUserOperationHashParams) => Hash;
30
+ //# sourceMappingURL=getUserOperationHash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUserOperationHash.d.ts","sourceRoot":"","sources":["../../utils/getUserOperationHash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAO,MAAM,MAAM,CAAA;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAmC9D,MAAM,MAAM,0BAA0B,GAAG;IAAE,aAAa,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAE/G;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,oBAAoB,2CAA4C,0BAA0B,KAAG,IAOzG,CAAA"}
@@ -1,31 +1,3 @@
1
- import type { Address, Hash } from "viem";
2
- import type { UserOperation } from "../types";
3
- export type GetUserOperationHashParams = {
4
- userOperation: UserOperation;
5
- entryPoint: Address;
6
- chainId: number;
7
- };
8
- /**
9
- *
10
- * Returns user operation hash that is a unique identifier of the user operation.
11
- *
12
- * - Docs: https://docs.pimlico.io/permissionless/reference/utils/getUserOperationHash
13
- *
14
- * @param args: userOperation, entryPoint, chainId as {@link GetUserOperationHashParams}
15
- * @returns userOperationHash as {@link Hash}
16
- *
17
- * @example
18
- * import { getUserOperationHash } from "permissionless/utils"
19
- *
20
- * const userOperationHash = getUserOperationHash({
21
- * userOperation,
22
- * entryPoint,
23
- * chainId
24
- * })
25
- *
26
- * // Returns "0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34"
27
- *
28
- */
29
- declare const getUserOperationHash: ({ userOperation, entryPoint, chainId }: GetUserOperationHashParams) => Hash;
30
- export { getUserOperationHash };
1
+ import { type GetUserOperationHashParams, getUserOperationHash } from "./getUserOperationHash.js";
2
+ export { getUserOperationHash, type GetUserOperationHashParams };
31
3
  //# 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,IAAI,EAAO,MAAM,MAAM,CAAA;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAmC7C,MAAM,MAAM,0BAA0B,GAAG;IAAE,aAAa,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAE/G;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,oBAAoB,2CAA4C,0BAA0B,KAAG,IAOlG,CAAA;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEjG,OAAO,EAAE,oBAAoB,EAAE,KAAK,0BAA0B,EAAE,CAAA"}
@@ -0,0 +1,17 @@
1
+ import type { MaybePromise } from "viem/types/utils";
2
+ type Callback = ((...args: any[]) => any) | undefined;
3
+ type Callbacks = Record<string, Callback>;
4
+ export declare const listenersCache: Map<string, {
5
+ id: number;
6
+ fns: Callbacks;
7
+ }[]>;
8
+ export declare const cleanupCache: Map<string, () => void>;
9
+ type EmitFunction<TCallbacks extends Callbacks> = (emit: TCallbacks) => MaybePromise<void | (() => void)>;
10
+ /**
11
+ * @description Sets up an observer for a given function. If another function
12
+ * is set up under the same observer id, the function will only be called once
13
+ * for both instances of the observer.
14
+ */
15
+ export declare function observe<TCallbacks extends Callbacks>(observerId: string, callbacks: TCallbacks, fn: EmitFunction<TCallbacks>): () => void;
16
+ export {};
17
+ //# sourceMappingURL=observe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"observe.d.ts","sourceRoot":"","sources":["../../utils/observe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAGpD,KAAK,QAAQ,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,GAAG,SAAS,CAAA;AACrD,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;AAEzC,eAAO,MAAM,cAAc;QAAuC,MAAM;SAAO,SAAS;IAAO,CAAA;AAC/F,eAAO,MAAM,YAAY,oBAAuC,IAAI,CAAG,CAAA;AAEvE,KAAK,YAAY,CAAC,UAAU,SAAS,SAAS,IAAI,CAAC,IAAI,EAAE,UAAU,KAAK,YAAY,CAAC,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,CAAA;AAIzG;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,UAAU,SAAS,SAAS,EAChD,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,UAAU,EACrB,EAAE,EAAE,YAAY,CAAC,UAAU,CAAC,cAuC/B"}