permissionless 0.0.6 → 0.0.7

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 (211) hide show
  1. package/CHANGELOG.md +7 -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/index.js +18 -12
  15. package/_cjs/actions/index.js.map +1 -1
  16. package/_cjs/actions/pimlico/getUserOperationGasPrice.js +25 -0
  17. package/_cjs/actions/pimlico/getUserOperationGasPrice.js.map +1 -0
  18. package/_cjs/actions/pimlico/getUserOperationStatus.js +11 -0
  19. package/_cjs/actions/pimlico/getUserOperationStatus.js.map +1 -0
  20. package/_cjs/actions/pimlico/sponsorUserOperation.js +18 -0
  21. package/_cjs/actions/pimlico/sponsorUserOperation.js.map +1 -0
  22. package/_cjs/actions/pimlico.js +10 -52
  23. package/_cjs/actions/pimlico.js.map +1 -1
  24. package/_cjs/actions/public/getAccountNonce.js +35 -0
  25. package/_cjs/actions/public/getAccountNonce.js.map +1 -0
  26. package/_cjs/actions/{public.js → public/getSenderAddress.js} +2 -33
  27. package/_cjs/actions/public/getSenderAddress.js.map +1 -0
  28. package/_cjs/actions/stackup/accounts.js +12 -0
  29. package/_cjs/actions/stackup/accounts.js.map +1 -0
  30. package/_cjs/actions/stackup/sponsorUserOperation.js +18 -0
  31. package/_cjs/actions/stackup/sponsorUserOperation.js.map +1 -0
  32. package/_cjs/actions/stackup.js +10 -0
  33. package/_cjs/actions/stackup.js.map +1 -0
  34. package/_cjs/clients/bundler.js +2 -2
  35. package/_cjs/clients/bundler.js.map +1 -1
  36. package/_cjs/clients/decorators/bundler.js +19 -0
  37. package/_cjs/clients/decorators/bundler.js.map +1 -0
  38. package/_cjs/clients/decorators/pimlico.js +16 -0
  39. package/_cjs/clients/decorators/pimlico.js.map +1 -0
  40. package/_cjs/clients/decorators/stackup.js +11 -0
  41. package/_cjs/clients/decorators/stackup.js.map +1 -0
  42. package/_cjs/clients/pimlico.js +4 -4
  43. package/_cjs/clients/pimlico.js.map +1 -1
  44. package/_cjs/clients/stackup.js +18 -0
  45. package/_cjs/clients/stackup.js.map +1 -0
  46. package/_cjs/index.js +24 -4
  47. package/_cjs/index.js.map +1 -1
  48. package/_cjs/types/stackup.js +3 -0
  49. package/_cjs/types/stackup.js.map +1 -0
  50. package/_cjs/utils/getUserOperationHash.js +38 -0
  51. package/_cjs/utils/getUserOperationHash.js.map +1 -0
  52. package/_cjs/utils/index.js +2 -34
  53. package/_cjs/utils/index.js.map +1 -1
  54. package/_esm/actions/bundler/chainId.js +29 -0
  55. package/_esm/actions/bundler/chainId.js.map +1 -0
  56. package/_esm/actions/bundler/estimateUserOperationGas.js +41 -0
  57. package/_esm/actions/bundler/estimateUserOperationGas.js.map +1 -0
  58. package/_esm/actions/bundler/getUserOperationByHash.js +48 -0
  59. package/_esm/actions/bundler/getUserOperationByHash.js.map +1 -0
  60. package/_esm/actions/bundler/getUserOperationReceipt.js +66 -0
  61. package/_esm/actions/bundler/getUserOperationReceipt.js.map +1 -0
  62. package/_esm/actions/bundler/sendUserOperation.js +36 -0
  63. package/_esm/actions/bundler/sendUserOperation.js.map +1 -0
  64. package/_esm/actions/bundler/supportedEntryPoints.js +29 -0
  65. package/_esm/actions/bundler/supportedEntryPoints.js.map +1 -0
  66. package/_esm/actions/index.js +9 -3
  67. package/_esm/actions/index.js.map +1 -1
  68. package/_esm/actions/pimlico/getUserOperationGasPrice.js +42 -0
  69. package/_esm/actions/pimlico/getUserOperationGasPrice.js.map +1 -0
  70. package/_esm/actions/pimlico/getUserOperationStatus.js +29 -0
  71. package/_esm/actions/pimlico/getUserOperationStatus.js.map +1 -0
  72. package/_esm/actions/pimlico/sponsorUserOperation.js +39 -0
  73. package/_esm/actions/pimlico/sponsorUserOperation.js.map +1 -0
  74. package/_esm/actions/pimlico.js +5 -123
  75. package/_esm/actions/pimlico.js.map +1 -1
  76. package/_esm/actions/public/getAccountNonce.js +57 -0
  77. package/_esm/actions/public/getAccountNonce.js.map +1 -0
  78. package/_esm/actions/{public.js → public/getSenderAddress.js} +1 -57
  79. package/_esm/actions/public/getSenderAddress.js.map +1 -0
  80. package/_esm/actions/stackup/accounts.js +30 -0
  81. package/_esm/actions/stackup/accounts.js.map +1 -0
  82. package/_esm/actions/stackup/sponsorUserOperation.js +40 -0
  83. package/_esm/actions/stackup/sponsorUserOperation.js.map +1 -0
  84. package/_esm/actions/stackup.js +5 -0
  85. package/_esm/actions/stackup.js.map +1 -0
  86. package/_esm/clients/bundler.js +1 -1
  87. package/_esm/clients/bundler.js.map +1 -1
  88. package/_esm/clients/decorators/bundler.js +16 -0
  89. package/_esm/clients/decorators/bundler.js.map +1 -0
  90. package/_esm/clients/decorators/pimlico.js +20 -0
  91. package/_esm/clients/decorators/pimlico.js.map +1 -0
  92. package/_esm/clients/decorators/stackup.js +8 -0
  93. package/_esm/clients/decorators/stackup.js.map +1 -0
  94. package/_esm/clients/pimlico.js +2 -2
  95. package/_esm/clients/pimlico.js.map +1 -1
  96. package/_esm/clients/stackup.js +33 -0
  97. package/_esm/clients/stackup.js.map +1 -0
  98. package/_esm/index.js +15 -4
  99. package/_esm/index.js.map +1 -1
  100. package/_esm/types/stackup.js +2 -0
  101. package/_esm/types/stackup.js.map +1 -0
  102. package/_esm/utils/getUserOperationHash.js +55 -0
  103. package/_esm/utils/getUserOperationHash.js.map +1 -0
  104. package/_esm/utils/index.js +1 -54
  105. package/_esm/utils/index.js.map +1 -1
  106. package/_types/actions/bundler/chainId.d.ts +25 -0
  107. package/_types/actions/bundler/chainId.d.ts.map +1 -0
  108. package/_types/actions/bundler/estimateUserOperationGas.d.ts +42 -0
  109. package/_types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -0
  110. package/_types/actions/bundler/getUserOperationByHash.d.ts +37 -0
  111. package/_types/actions/bundler/getUserOperationByHash.d.ts.map +1 -0
  112. package/_types/actions/bundler/getUserOperationReceipt.d.ts +93 -0
  113. package/_types/actions/bundler/getUserOperationReceipt.d.ts.map +1 -0
  114. package/_types/actions/bundler/sendUserOperation.d.ts +36 -0
  115. package/_types/actions/bundler/sendUserOperation.d.ts.map +1 -0
  116. package/_types/actions/bundler/supportedEntryPoints.d.ts +26 -0
  117. package/_types/actions/bundler/supportedEntryPoints.d.ts.map +1 -0
  118. package/_types/actions/index.d.ts +17 -6
  119. package/_types/actions/index.d.ts.map +1 -1
  120. package/_types/actions/pimlico/getUserOperationGasPrice.d.ts +38 -0
  121. package/_types/actions/pimlico/getUserOperationGasPrice.d.ts.map +1 -0
  122. package/_types/actions/pimlico/getUserOperationStatus.d.ts +31 -0
  123. package/_types/actions/pimlico/getUserOperationStatus.d.ts.map +1 -0
  124. package/_types/actions/pimlico/sponsorUserOperation.d.ts +41 -0
  125. package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -0
  126. package/_types/actions/pimlico.d.ts +7 -177
  127. package/_types/actions/pimlico.d.ts.map +1 -1
  128. package/_types/actions/public/getAccountNonce.d.ts +34 -0
  129. package/_types/actions/public/getAccountNonce.d.ts.map +1 -0
  130. package/_types/actions/{public.d.ts → public/getSenderAddress.d.ts} +2 -35
  131. package/_types/actions/public/getSenderAddress.d.ts.map +1 -0
  132. package/_types/actions/stackup/accounts.d.ts +29 -0
  133. package/_types/actions/stackup/accounts.d.ts.map +1 -0
  134. package/_types/actions/stackup/sponsorUserOperation.d.ts +43 -0
  135. package/_types/actions/stackup/sponsorUserOperation.d.ts.map +1 -0
  136. package/_types/actions/stackup.d.ts +7 -0
  137. package/_types/actions/stackup.d.ts.map +1 -0
  138. package/_types/clients/bundler.d.ts +2 -2
  139. package/_types/clients/bundler.d.ts.map +1 -1
  140. package/_types/clients/decorators/bundler.d.ts +150 -0
  141. package/_types/clients/decorators/bundler.d.ts.map +1 -0
  142. package/_types/clients/decorators/pimlico.d.ts +78 -0
  143. package/_types/clients/decorators/pimlico.d.ts.map +1 -0
  144. package/_types/clients/decorators/stackup.d.ts +54 -0
  145. package/_types/clients/decorators/stackup.d.ts.map +1 -0
  146. package/_types/clients/pimlico.d.ts +3 -3
  147. package/_types/clients/pimlico.d.ts.map +1 -1
  148. package/_types/clients/stackup.d.ts +39 -0
  149. package/_types/clients/stackup.d.ts.map +1 -0
  150. package/_types/index.d.ts +26 -4
  151. package/_types/index.d.ts.map +1 -1
  152. package/_types/types/bundler.d.ts +1 -1
  153. package/_types/types/bundler.d.ts.map +1 -1
  154. package/_types/types/index.d.ts +1 -1
  155. package/_types/types/index.d.ts.map +1 -1
  156. package/_types/types/pimlico.d.ts +1 -1
  157. package/_types/types/pimlico.d.ts.map +1 -1
  158. package/_types/types/stackup.d.ts +35 -0
  159. package/_types/types/stackup.d.ts.map +1 -0
  160. package/_types/utils/getUserOperationHash.d.ts +30 -0
  161. package/_types/utils/getUserOperationHash.d.ts.map +1 -0
  162. package/_types/utils/index.d.ts +2 -30
  163. package/_types/utils/index.d.ts.map +1 -1
  164. package/actions/bundler/chainId.ts +32 -0
  165. package/actions/bundler/estimateUserOperationGas.ts +62 -0
  166. package/actions/bundler/getUserOperationByHash.ts +69 -0
  167. package/actions/bundler/getUserOperationReceipt.ts +109 -0
  168. package/actions/bundler/sendUserOperation.ts +45 -0
  169. package/actions/bundler/supportedEntryPoints.ts +31 -0
  170. package/actions/index.ts +22 -21
  171. package/actions/pimlico/getUserOperationGasPrice.ts +61 -0
  172. package/actions/pimlico/getUserOperationStatus.ts +41 -0
  173. package/actions/pimlico/sponsorUserOperation.ts +62 -0
  174. package/actions/pimlico.ts +34 -251
  175. package/actions/public/getAccountNonce.ts +63 -0
  176. package/actions/{public.ts → public/getSenderAddress.ts} +7 -68
  177. package/actions/stackup/accounts.ts +40 -0
  178. package/actions/stackup/sponsorUserOperation.ts +64 -0
  179. package/actions/stackup.ts +17 -0
  180. package/clients/bundler.ts +2 -3
  181. package/clients/decorators/bundler.ts +178 -0
  182. package/clients/decorators/pimlico.ts +107 -0
  183. package/clients/decorators/stackup.ts +65 -0
  184. package/clients/pimlico.ts +3 -4
  185. package/clients/stackup.ts +44 -0
  186. package/index.ts +62 -4
  187. package/package.json +11 -1
  188. package/tsconfig.build.tsbuildinfo +1 -1
  189. package/types/bundler.ts +1 -1
  190. package/types/index.ts +1 -1
  191. package/types/pimlico.ts +1 -1
  192. package/types/stackup.ts +36 -0
  193. package/utils/getUserOperationHash.ts +68 -0
  194. package/utils/index.ts +2 -69
  195. package/_cjs/actions/bundler.js +0 -118
  196. package/_cjs/actions/bundler.js.map +0 -1
  197. package/_cjs/actions/public.js.map +0 -1
  198. package/_cjs/clients/index.js +0 -6
  199. package/_cjs/clients/index.js.map +0 -1
  200. package/_esm/actions/bundler.js +0 -251
  201. package/_esm/actions/bundler.js.map +0 -1
  202. package/_esm/actions/public.js.map +0 -1
  203. package/_esm/clients/index.js +0 -3
  204. package/_esm/clients/index.js.map +0 -1
  205. package/_types/actions/bundler.d.ts +0 -393
  206. package/_types/actions/bundler.d.ts.map +0 -1
  207. package/_types/actions/public.d.ts.map +0 -1
  208. package/_types/clients/index.d.ts +0 -3
  209. package/_types/clients/index.d.ts.map +0 -1
  210. package/actions/bundler.ts +0 -498
  211. package/clients/index.ts +0 -3
@@ -1,178 +1,8 @@
1
- import type { Address, Client, Hash, Hex } from "viem";
2
- import type { PartialBy } from "viem/types/utils";
3
- import type { PimlicoBundlerClient, PimlicoPaymasterClient } from "../clients/pimlico";
4
- import type { PimlicoUserOperationStatus } from "../types/pimlico";
5
- import type { UserOperation } from "../types/userOperation";
6
- export type SponsorUserOperationParameters = {
7
- userOperation: PartialBy<UserOperation, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterAndData">;
8
- entryPoint: Address;
9
- };
10
- export type SponsorUserOperationReturnType = {
11
- paymasterAndData: Hex;
12
- preVerificationGas: bigint;
13
- verificationGasLimit: bigint;
14
- callGasLimit: bigint;
15
- };
16
- export type GetUserOperationGasPriceReturnType = {
17
- slow: {
18
- maxFeePerGas: bigint;
19
- maxPriorityFeePerGas: bigint;
20
- };
21
- standard: {
22
- maxFeePerGas: bigint;
23
- maxPriorityFeePerGas: bigint;
24
- };
25
- fast: {
26
- maxFeePerGas: bigint;
27
- maxPriorityFeePerGas: bigint;
28
- };
29
- };
30
- export type GetUserOperationStatusParameters = {
31
- hash: Hash;
32
- };
33
- export type GetUserOperationStatusReturnType = PimlicoUserOperationStatus;
34
- /**
35
- * Returns the live gas prices that you can use to send a user operation.
36
- *
37
- * - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationGasPrice
38
- *
39
- * @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
40
- * @returns slow, standard & fast values for maxFeePerGas & maxPriorityFeePerGas
41
- *
42
- *
43
- * @example
44
- * import { createClient } from "viem"
45
- * import { getUserOperationGasPrice } from "permissionless/actions"
46
- *
47
- * const bundlerClient = createClient({
48
- * chain: goerli,
49
- * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
50
- * })
51
- *
52
- * await getUserOperationGasPrice(bundlerClient)
53
- *
54
- */
55
- export declare const getUserOperationGasPrice: (client: PimlicoBundlerClient) => Promise<GetUserOperationGasPriceReturnType>;
56
- /**
57
- * Returns the status of the userOperation that is pending in the mempool.
58
- *
59
- * - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationStatus
60
- *
61
- * @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
62
- * @param hash {@link Hash} UserOpHash that you must have received from sendUserOperation.
63
- * @returns status & transaction hash if included {@link GetUserOperationStatusReturnType}
64
- *
65
- *
66
- * @example
67
- * import { createClient } from "viem"
68
- * import { getUserOperationStatus } from "permissionless/actions"
69
- *
70
- * const bundlerClient = createClient({
71
- * chain: goerli,
72
- * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
73
- * })
74
- *
75
- * await getUserOperationStatus(bundlerClient, { hash: userOpHash })
76
- *
77
- */
78
- export declare const getUserOperationStatus: (client: PimlicoBundlerClient, { hash }: GetUserOperationStatusParameters) => Promise<GetUserOperationStatusReturnType>;
79
- export type PimlicoBundlerActions = {
80
- /**
81
- * Returns the live gas prices that you can use to send a user operation.
82
- *
83
- * - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationGasPrice
84
- *
85
- * @returns slow, standard & fast values for maxFeePerGas & maxPriorityFeePerGas {@link GetUserOperationGasPriceReturnType}
86
- *
87
- * @example
88
- *
89
- * import { createClient } from "viem"
90
- * import { pimlicoBundlerActions } from "permissionless/actions"
91
- *
92
- * const bundlerClient = createClient({
93
- * chain: goerli,
94
- * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
95
- * }).extend(pimlicoBundlerActions)
96
- *
97
- * await bundlerClient.getUserOperationGasPrice()
98
- */
99
- getUserOperationGasPrice: () => Promise<GetUserOperationGasPriceReturnType>;
100
- /**
101
- * Returns the status of the userOperation that is pending in the mempool.
102
- *
103
- * - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationStatus
104
- *
105
- * @param hash {@link Hash} UserOpHash that you must have received from sendUserOperation.
106
- * @returns status & transaction hash if included {@link GetUserOperationStatusReturnType}
107
- *
108
- * @example
109
- * import { createClient } from "viem"
110
- * import { pimlicoBundlerActions } from "permissionless/actions"
111
- *
112
- * const bundlerClient = createClient({
113
- * chain: goerli,
114
- * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
115
- * }).extend(pimlicoBundlerActions)
116
- *
117
- * await bundlerClient.getUserOperationStatus({ hash: userOpHash })
118
- */
119
- getUserOperationStatus: (args: GetUserOperationStatusParameters) => Promise<GetUserOperationStatusReturnType>;
120
- };
121
- export declare const pimlicoBundlerActions: (client: Client) => PimlicoBundlerActions;
122
- /**
123
- * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
124
- *
125
- * - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/sponsorUserOperation
126
- *
127
- * @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
128
- * @param args {@link sponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
129
- * @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
130
- *
131
- *
132
- * @example
133
- * import { createClient } from "viem"
134
- * import { sponsorUserOperation } from "permissionless/actions"
135
- *
136
- * const bundlerClient = createClient({
137
- * chain: goerli,
138
- * transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
139
- * })
140
- *
141
- * await sponsorUserOperation(bundlerClient, {
142
- * userOperation: userOperationWithDummySignature,
143
- * entryPoint: entryPoint
144
- * }})
145
- *
146
- */
147
- export declare const sponsorUserOperation: (client: PimlicoPaymasterClient, args: SponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType>;
148
- export type PimlicoPaymasterClientActions = {
149
- /**
150
- * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
151
- *
152
- * https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/sponsorUserOperation
153
- *
154
- * @param args {@link SponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
155
- * @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
156
- *
157
- * @example
158
- * import { createClient } from "viem"
159
- * import { sponsorUserOperation } from "permissionless/actions"
160
- *
161
- * const bundlerClient = createClient({
162
- * chain: goerli,
163
- * transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
164
- * }).extend(pimlicoPaymasterActions)
165
- *
166
- * await bundlerClient.sponsorUserOperation(bundlerClient, {
167
- * userOperation: userOperationWithDummySignature,
168
- * entryPoint: entryPoint
169
- * }})
170
- *
171
- */
172
- sponsorUserOperation: (args: SponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType>;
173
- };
174
- export declare const pimlicoPaymasterActions: (client: Client) => PimlicoPaymasterClientActions;
175
- /**
176
- * TODO: Add support for pimlicoActions after we support all the actions of v1 in v2 of the Pimlico API.
177
- */
1
+ import { type GetUserOperationGasPriceReturnType, getUserOperationGasPrice } from "./pimlico/getUserOperationGasPrice.js";
2
+ import { type GetUserOperationStatusParameters, type GetUserOperationStatusReturnType, getUserOperationStatus } from "./pimlico/getUserOperationStatus.js";
3
+ import { type SponsorUserOperationParameters, type SponsorUserOperationReturnType, sponsorUserOperation } from "./pimlico/sponsorUserOperation.js";
4
+ import type { PimlicoBundlerActions, PimlicoPaymasterClientActions } from "../clients/decorators/pimlico.js";
5
+ import { pimlicoBundlerActions, pimlicoPaymasterActions } from "../clients/decorators/pimlico.js";
6
+ export type { GetUserOperationGasPriceReturnType, GetUserOperationStatusParameters, GetUserOperationStatusReturnType, SponsorUserOperationParameters, SponsorUserOperationReturnType, PimlicoBundlerActions, PimlicoPaymasterClientActions };
7
+ export { getUserOperationGasPrice, getUserOperationStatus, sponsorUserOperation, pimlicoBundlerActions, pimlicoPaymasterActions };
178
8
  //# sourceMappingURL=pimlico.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AACtF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAA;AAClE,OAAO,KAAK,EAAE,aAAa,EAAgC,MAAM,wBAAwB,CAAA;AAGzF,MAAM,MAAM,8BAA8B,GAAG;IACzC,aAAa,EAAE,SAAS,CACpB,aAAa,EACb,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,kBAAkB,CACtF,CAAA;IACD,UAAU,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG;IACzC,gBAAgB,EAAE,GAAG,CAAA;IACrB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,YAAY,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,kCAAkC,GAAG;IAC7C,IAAI,EAAE;QACF,YAAY,EAAE,MAAM,CAAA;QACpB,oBAAoB,EAAE,MAAM,CAAA;KAC/B,CAAA;IACD,QAAQ,EAAE;QACN,YAAY,EAAE,MAAM,CAAA;QACpB,oBAAoB,EAAE,MAAM,CAAA;KAC/B,CAAA;IACD,IAAI,EAAE;QACF,YAAY,EAAE,MAAM,CAAA;QACpB,oBAAoB,EAAE,MAAM,CAAA;KAC/B,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC3C,IAAI,EAAE,IAAI,CAAA;CACb,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG,0BAA0B,CAAA;AAEzE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,wBAAwB,WACzB,oBAAoB,KAC7B,QAAQ,kCAAkC,CAoB5C,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,sBAAsB,WACvB,oBAAoB,YAClB,gCAAgC,KAC3C,QAAQ,gCAAgC,CAK1C,CAAA;AAED,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;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,oBAAoB,WACrB,sBAAsB,QACxB,8BAA8B,KACrC,QAAQ,8BAA8B,CAYxC,CAAA;AAED,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"}
1
+ {"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,kCAAkC,EACvC,wBAAwB,EAC3B,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EACrC,sBAAsB,EACzB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,oBAAoB,EACvB,MAAM,mCAAmC,CAAA;AAE1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAA;AAC5G,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAA;AAEjG,YAAY,EACR,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,8BAA8B,EAC9B,8BAA8B,EAC9B,qBAAqB,EACrB,6BAA6B,EAChC,CAAA;AAED,OAAO,EACH,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EAC1B,CAAA"}
@@ -0,0 +1,34 @@
1
+ import type { Address, PublicClient } from "viem";
2
+ export type GetAccountNonceParams = {
3
+ sender: Address;
4
+ entryPoint: Address;
5
+ key?: bigint;
6
+ };
7
+ /**
8
+ * Returns the nonce of the account with the entry point.
9
+ *
10
+ * - Docs: https://docs.pimlico.io/permissionless/reference/public-actions/getAccountNonce
11
+ *
12
+ * @param publicClient {@link PublicClient} that you created using viem's createPublicClient.
13
+ * @param args {@link GetAccountNonceParams} address, entryPoint & key
14
+ * @returns bigint nonce
15
+ *
16
+ * @example
17
+ * import { createPublicClient } from "viem"
18
+ * import { getAccountNonce } from "permissionless/actions"
19
+ *
20
+ * const publicClient = createPublicClient({
21
+ * chain: goerli,
22
+ * transport: http("https://goerli.infura.io/v3/your-infura-key")
23
+ * })
24
+ *
25
+ * const nonce = await getAccountNonce(publicClient, {
26
+ * address,
27
+ * entryPoint,
28
+ * key
29
+ * })
30
+ *
31
+ * // Return 0n
32
+ */
33
+ export declare const getAccountNonce: (publicClient: PublicClient, { sender, entryPoint, key }: GetAccountNonceParams) => Promise<bigint>;
34
+ //# sourceMappingURL=getAccountNonce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAccountNonce.d.ts","sourceRoot":"","sources":["../../../actions/public/getAccountNonce.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAEjD,MAAM,MAAM,qBAAqB,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAE1F;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,eAAe,iBACV,YAAY,+BACe,qBAAqB,KAC/D,QAAQ,MAAM,CA6BhB,CAAA"}
@@ -1,14 +1,8 @@
1
- import type { Address, Hex, PublicClient } from "viem";
2
- import { BaseError } from "viem";
1
+ import { type Address, BaseError, type Hex, type PublicClient } from "viem";
3
2
  export type GetSenderAddressParams = {
4
3
  initCode: Hex;
5
4
  entryPoint: Address;
6
5
  };
7
- export type GetAccountNonceParams = {
8
- address: Address;
9
- entryPoint: Address;
10
- key?: bigint;
11
- };
12
6
  export declare class InvalidEntryPointError extends BaseError {
13
7
  name: string;
14
8
  constructor({ cause, entryPoint }?: {
@@ -43,31 +37,4 @@ export declare class InvalidEntryPointError extends BaseError {
43
37
  * // Return '0x7a88a206ba40b37a8c07a2b5688cf8b287318b63'
44
38
  */
45
39
  export declare const getSenderAddress: (publicClient: PublicClient, { initCode, entryPoint }: GetSenderAddressParams) => Promise<Address>;
46
- /**
47
- * Returns the nonce of the account with the entry point.
48
- *
49
- * - Docs: https://docs.pimlico.io/permissionless/reference/public-actions/getAccountNonce
50
- *
51
- * @param publicClient {@link PublicClient} that you created using viem's createPublicClient.
52
- * @param args {@link GetAccountNonceParams} address, entryPoint & key
53
- * @returns bigint nonce
54
- *
55
- * @example
56
- * import { createPublicClient } from "viem"
57
- * import { getAccountNonce } from "permissionless/actions"
58
- *
59
- * const publicClient = createPublicClient({
60
- * chain: goerli,
61
- * transport: http("https://goerli.infura.io/v3/your-infura-key")
62
- * })
63
- *
64
- * const nonce = await getAccountNonce(publicClient, {
65
- * address,
66
- * entryPoint,
67
- * key
68
- * })
69
- *
70
- * // Return 0n
71
- */
72
- export declare const getAccountNonce: (publicClient: PublicClient, { address, entryPoint, key }: GetAccountNonceParams) => Promise<bigint>;
73
- //# sourceMappingURL=public.d.ts.map
40
+ //# sourceMappingURL=getSenderAddress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSenderAddress.d.ts","sourceRoot":"","sources":["../../../actions/public/getSenderAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,SAAS,EAGT,KAAK,GAAG,EACR,KAAK,YAAY,EACpB,MAAM,MAAM,CAAA;AAEb,MAAM,MAAM,sBAAsB,GAAG;IAAE,QAAQ,EAAE,GAAG,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAAA;AAE3E,qBAAa,sBAAuB,SAAQ,SAAS;IACxC,IAAI,SAA2B;gBAE5B,EAAE,KAAK,EAAE,UAAU,EAAE,GAAE;QAAE,KAAK,CAAC,EAAE,SAAS,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAO;CAUtF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,gBAAgB,iBACX,YAAY,4BACA,sBAAsB,KACjD,QAAQ,OAAO,CAgDjB,CAAA"}
@@ -0,0 +1,29 @@
1
+ import type { Address } from "viem";
2
+ import type { StackupPaymasterClient } from "../../clients/stackup.js";
3
+ export type AccountsParameters = {
4
+ entryPoint: Address;
5
+ };
6
+ /**
7
+ * Returns all the Paymaster addresses associated with an EntryPoint that’s owned by this service.
8
+ *
9
+ * https://docs.stackup.sh/docs/paymaster-api-rpc-methods#pm_accounts
10
+ *
11
+ * @param args {@link AccountsParameters} entryPoint for which you want to get list of supported paymasters.
12
+ * @returns paymaster addresses
13
+ *
14
+ * @example
15
+ * import { createClient } from "viem"
16
+ * import { accounts } from "permissionless/actions/stackup"
17
+ *
18
+ * const bundlerClient = createClient({
19
+ * chain: goerli,
20
+ * transport: http("https://api.stackup.sh/v1/paymaster/YOUR_API_KEY_HERE")
21
+ * })
22
+ *
23
+ * await accounts(bundlerClient, {
24
+ * entryPoint: entryPoint
25
+ * }})
26
+ *
27
+ */
28
+ export declare const accounts: (client: StackupPaymasterClient, { entryPoint }: AccountsParameters) => Promise<Address[]>;
29
+ //# sourceMappingURL=accounts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../../actions/stackup/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEtE,MAAM,MAAM,kBAAkB,GAAG;IAC7B,UAAU,EAAE,OAAO,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,QAAQ,WACT,sBAAsB,kBACd,kBAAkB,KACnC,QAAQ,OAAO,EAAE,CAOnB,CAAA"}
@@ -0,0 +1,43 @@
1
+ import type { Address, Hex } from "viem";
2
+ import type { PartialBy } from "viem/types/utils";
3
+ import { type StackupPaymasterClient } from "../../clients/stackup.js";
4
+ import type { StackupPaymasterContext } from "../../types/stackup.js";
5
+ import type { UserOperation } from "../../types/userOperation.js";
6
+ export type SponsorUserOperationParameters = {
7
+ userOperation: PartialBy<UserOperation, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterAndData">;
8
+ entryPoint: Address;
9
+ context: StackupPaymasterContext;
10
+ };
11
+ export type SponsorUserOperationReturnType = {
12
+ paymasterAndData: Hex;
13
+ preVerificationGas: bigint;
14
+ verificationGasLimit: bigint;
15
+ callGasLimit: bigint;
16
+ };
17
+ /**
18
+ * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
19
+ *
20
+ * - Docs: https://docs.pimlico.io/permissionless/reference/stackup-paymaster-actions/sponsorUserOperation
21
+ *
22
+ * @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
23
+ * @param args {@link sponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
24
+ * @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
25
+ *
26
+ *
27
+ * @example
28
+ * import { createClient } from "viem"
29
+ * import { sponsorUserOperation } from "permissionless/actions/stackup"
30
+ *
31
+ * const bundlerClient = createClient({
32
+ * chain: goerli,
33
+ * transport: http("https://api.stackup.sh/v1/paymaster/YOUR_API_KEY_HERE")
34
+ * })
35
+ *
36
+ * await sponsorUserOperation(bundlerClient, {
37
+ * userOperation: userOperationWithDummySignature,
38
+ * entryPoint: entryPoint
39
+ * }})
40
+ *
41
+ */
42
+ export declare const sponsorUserOperation: (client: StackupPaymasterClient, args: SponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType>;
43
+ //# sourceMappingURL=sponsorUserOperation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sponsorUserOperation.d.ts","sourceRoot":"","sources":["../../../actions/stackup/sponsorUserOperation.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,EAAE,KAAK,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACtE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,KAAK,EAAE,aAAa,EAAgC,MAAM,8BAA8B,CAAA;AAG/F,MAAM,MAAM,8BAA8B,GAAG;IACzC,aAAa,EAAE,SAAS,CACpB,aAAa,EACb,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,kBAAkB,CACtF,CAAA;IACD,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,uBAAuB,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG;IACzC,gBAAgB,EAAE,GAAG,CAAA;IACrB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,YAAY,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,oBAAoB,WACrB,sBAAsB,QACxB,8BAA8B,KACrC,QAAQ,8BAA8B,CAYxC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type { StackupPaymasterClientActions } from "../clients/decorators/stackup.js";
2
+ import { stackupPaymasterActions } from "../clients/decorators/stackup.js";
3
+ import { type AccountsParameters, accounts } from "./stackup/accounts.js";
4
+ import { type SponsorUserOperationParameters, type SponsorUserOperationReturnType, sponsorUserOperation } from "./stackup/sponsorUserOperation.js";
5
+ export type { SponsorUserOperationParameters, SponsorUserOperationReturnType, AccountsParameters, StackupPaymasterClientActions };
6
+ export { sponsorUserOperation, accounts, stackupPaymasterActions };
7
+ //# sourceMappingURL=stackup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stackup.d.ts","sourceRoot":"","sources":["../../actions/stackup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAA;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAA;AAC1E,OAAO,EAAE,KAAK,kBAAkB,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACzE,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,oBAAoB,EACvB,MAAM,mCAAmC,CAAA;AAE1C,YAAY,EACR,8BAA8B,EAC9B,8BAA8B,EAC9B,kBAAkB,EAClB,6BAA6B,EAChC,CAAA;AAED,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,uBAAuB,EAAE,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import type { Account, Chain, Client, PublicClientConfig, Transport } from "viem";
2
- import type { BundlerActions } from "../actions/bundler";
3
- import type { BundlerRpcSchema } from "../types/bundler";
2
+ import type { BundlerRpcSchema } from "../types/bundler.js";
3
+ import { type BundlerActions } from "./decorators/bundler.js";
4
4
  export type BundlerClient = Client<Transport, Chain | undefined, Account | undefined, BundlerRpcSchema, BundlerActions>;
5
5
  /**
6
6
  * Creates a EIP-4337 compliant Bundler Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
@@ -1 +1 @@
1
- {"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../clients/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAGjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAExD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAA;AACvH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;MAE7B,aASF,CAAA"}
1
+ {"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../clients/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAEjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,yBAAyB,CAAA;AAE7E,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAA;AACvH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;MAE7B,aASF,CAAA"}
@@ -0,0 +1,150 @@
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
+ export type BundlerActions = {
8
+ /**
9
+ *
10
+ * Sends user operation to the bundler
11
+ *
12
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/sendUserOperation
13
+ *
14
+ * @param args {@link SendUserOperationParameters}.
15
+ * @returns UserOpHash that you can use to track user operation as {@link Hash}.
16
+ *
17
+ * @example
18
+ * import { createClient } from "viem"
19
+ * import { bundlerActions } from "permissionless"
20
+ *
21
+ * const bundlerClient = createClient({
22
+ * chain: goerli,
23
+ * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
24
+ * }).extend(bundlerActions)
25
+ *
26
+ * const userOpHash = await bundlerClient.sendUserOperation({
27
+ * userOperation: signedUserOperation,
28
+ * entryPoint: entryPoint
29
+ * })
30
+ *
31
+ * // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
32
+ */
33
+ sendUserOperation: (args: SendUserOperationParameters) => Promise<Hash>;
34
+ /**
35
+ *
36
+ * Estimates preVerificationGas, verificationGasLimit and callGasLimit for user operation
37
+ *
38
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/estimateUserOperationGas
39
+ *
40
+ * @param args {@link EstimateUserOperationGasParameters}
41
+ * @returns preVerificationGas, verificationGasLimit and callGasLimit as {@link EstimateUserOperationGasReturnType}
42
+ *
43
+ * @example
44
+ * import { createClient } from "viem"
45
+ * import { bundlerActions } from "permissionless"
46
+ *
47
+ * const bundlerClient = createClient({
48
+ * chain: goerli,
49
+ * transport: http(BUNDLER_URL)
50
+ * }).extend(bundlerActions)
51
+ *
52
+ * const gasParameters = await bundlerClient.estimateUserOperationGas({
53
+ * userOperation: signedUserOperation,
54
+ * entryPoint: entryPoint
55
+ * })
56
+ *
57
+ * // Return {preVerificationGas: 43492n, verificationGasLimit: 59436n, callGasLimit: 9000n}
58
+ */
59
+ estimateUserOperationGas: (args: EstimateUserOperationGasParameters) => Promise<EstimateUserOperationGasReturnType>;
60
+ /**
61
+ *
62
+ * Returns the supported entrypoints by the bundler service
63
+ *
64
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/supportedEntryPoints
65
+ *
66
+ * @returns Supported entryPoints
67
+ *
68
+ * @example
69
+ * import { createClient } from "viem"
70
+ * import { bundlerActions } from "permissionless"
71
+ *
72
+ * const bundlerClient = createClient({
73
+ * chain: goerli,
74
+ * transport: http(BUNDLER_URL)
75
+ * }).extend(bundlerActions)
76
+ *
77
+ * const supportedEntryPoints = await bundlerClient.supportedEntryPoints()
78
+ *
79
+ * // Return ['0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789']
80
+ */
81
+ supportedEntryPoints: () => Promise<Address[]>;
82
+ /**
83
+ *
84
+ * Returns the supported chain id by the bundler service
85
+ *
86
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/chainId
87
+ *
88
+ * @returns Supported chain id
89
+ *
90
+ * @example
91
+ * import { createClient } from "viem"
92
+ * import { bundlerActions } from "permissionless"
93
+ *
94
+ * const bundlerClient = createClient({
95
+ * chain: goerli,
96
+ * transport: http(BUNDLER_URL)
97
+ * }).extend(bundlerActions)
98
+ *
99
+ * const chainId = await bundlerClient.chainId()
100
+ * // Return 5n for Goerli
101
+ */
102
+ chainId: () => Promise<number>;
103
+ /**
104
+ *
105
+ * Returns the user operation from userOpHash
106
+ *
107
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationByHash
108
+ *
109
+ * @param args {@link GetUserOperationByHash} UserOpHash that was returned by {@link sendUserOperation}
110
+ * @returns userOperation along with entryPoint, transactionHash, blockHash, blockNumber if found or null
111
+ *
112
+ * @example
113
+ * import { createClient } from "viem"
114
+ * import { bundlerActions } from "permissionless"
115
+ *
116
+ * const bundlerClient = createClient({
117
+ * chain: goerli,
118
+ * transport: http(BUNDLER_URL)
119
+ * }).extend(bundlerActions)
120
+ *
121
+ * await bundlerClient.getUserOperationByHash(userOpHash)
122
+ *
123
+ */
124
+ getUserOperationByHash: (args: GetUserOperationByHashParameters) => Promise<GetUserOperationByHashReturnType>;
125
+ /**
126
+ *
127
+ * Returns the user operation receipt from userOpHash
128
+ *
129
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt
130
+ *
131
+ * @param args {@link GetUserOperationReceiptParameters} UserOpHash that was returned by {@link sendUserOperation}
132
+ * @returns user operation receipt {@link GetUserOperationReceiptReturnType} if found or null
133
+ *
134
+ * @example
135
+ * import { createClient } from "viem"
136
+ * import { bundlerActions } from "permissionless"
137
+ *
138
+ * const bundlerClient = createClient({
139
+ * chain: goerli,
140
+ * transport: http(BUNDLER_URL)
141
+ * }).extend(bundlerActions)
142
+ *
143
+ * await bundlerClient.getUserOperationReceipt({hash: userOpHash})
144
+ *
145
+ */
146
+ getUserOperationReceipt: (args: GetUserOperationReceiptParameters) => Promise<GetUserOperationReceiptReturnType>;
147
+ };
148
+ declare const bundlerActions: (client: Client) => BundlerActions;
149
+ export { bundlerActions };
150
+ //# 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;AAIhH,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,CAAC,IAAI,EAAE,iCAAiC,KAAK,OAAO,CAAC,iCAAiC,CAAC,CAAA;CACnH,CAAA;AAED,QAAA,MAAM,cAAc,WAAY,MAAM,KAAG,cAWvC,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"}