permissionless 0.0.5 → 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 +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/index.js +18 -11
  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} +1 -1
  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} +3 -3
  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} +4 -5
  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 +23 -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} +9 -9
  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
@@ -0,0 +1,25 @@
1
+ import type { BundlerClient } from "../../clients/bundler.js";
2
+ /**
3
+ * Returns the supported chain id by the bundler service
4
+ *
5
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/chainId
6
+ *
7
+ * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
8
+ * @returns Supported chain id
9
+ *
10
+ *
11
+ * @example
12
+ * import { createClient } from "viem"
13
+ * import { chainId } from "permissionless/actions"
14
+ *
15
+ * const bundlerClient = createClient({
16
+ * chain: goerli,
17
+ * transport: http(BUNDLER_URL)
18
+ * })
19
+ *
20
+ * const bundlerChainId = chainId(bundlerClient)
21
+ * // Return 5n for Goerli
22
+ *
23
+ */
24
+ export declare const chainId: (client: BundlerClient) => Promise<number>;
25
+ //# sourceMappingURL=chainId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chainId.d.ts","sourceRoot":"","sources":["../../../actions/bundler/chainId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,OAAO,WAAkB,aAAa,oBAOlD,CAAA"}
@@ -0,0 +1,42 @@
1
+ import type { Address } from "viem";
2
+ import type { PartialBy } from "viem/types/utils";
3
+ import type { BundlerClient } from "../../clients/bundler.js";
4
+ import type { UserOperation } from "../../types/userOperation.js";
5
+ export type EstimateUserOperationGasParameters = {
6
+ userOperation: PartialBy<UserOperation, "callGasLimit" | "preVerificationGas" | "verificationGasLimit">;
7
+ entryPoint: Address;
8
+ };
9
+ export type EstimateUserOperationGasReturnType = {
10
+ preVerificationGas: bigint;
11
+ verificationGasLimit: bigint;
12
+ callGasLimit: bigint;
13
+ };
14
+ /**
15
+ * Estimates preVerificationGas, verificationGasLimit and callGasLimit for user operation
16
+ *
17
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/estimateUserOperationGas
18
+ *
19
+ * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
20
+ * @param args {@link EstimateUserOperationGasParameters}
21
+ * @returns preVerificationGas, verificationGasLimit and callGasLimit as {@link EstimateUserOperationGasReturnType}
22
+ *
23
+ *
24
+ * @example
25
+ * import { createClient } from "viem"
26
+ * import { estimateUserOperationGas } from "permissionless/actions"
27
+ *
28
+ * const bundlerClient = createClient({
29
+ * chain: goerli,
30
+ * transport: http(BUNDLER_URL)
31
+ * })
32
+ *
33
+ * const gasParameters = estimateUserOperationGas(bundlerClient, {
34
+ * serOperation: signedUserOperation,
35
+ * entryPoint: entryPoint
36
+ * })
37
+ *
38
+ * // Return {preVerificationGas: 43492n, verificationGasLimit: 59436n, callGasLimit: 9000n}
39
+ *
40
+ */
41
+ export declare const estimateUserOperationGas: (client: BundlerClient, args: EstimateUserOperationGasParameters) => Promise<EstimateUserOperationGasReturnType>;
42
+ //# sourceMappingURL=estimateUserOperationGas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"estimateUserOperationGas.d.ts","sourceRoot":"","sources":["../../../actions/bundler/estimateUserOperationGas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAIjE,MAAM,MAAM,kCAAkC,GAAG;IAC7C,aAAa,EAAE,SAAS,CAAC,aAAa,EAAE,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,CAAC,CAAA;IACvG,UAAU,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,kCAAkC,GAAG;IAC7C,kBAAkB,EAAE,MAAM,CAAA;IAC1B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,YAAY,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,wBAAwB,WACzB,aAAa,QACf,kCAAkC,KACzC,QAAQ,kCAAkC,CAa5C,CAAA"}
@@ -0,0 +1,37 @@
1
+ import type { Address, Hash } from "viem";
2
+ import type { BundlerClient } from "../../clients/bundler.js";
3
+ import type { UserOperation } from "../../types/userOperation.js";
4
+ export type GetUserOperationByHashParameters = {
5
+ hash: Hash;
6
+ };
7
+ export type GetUserOperationByHashReturnType = {
8
+ userOperation: UserOperation;
9
+ entryPoint: Address;
10
+ transactionHash: Hash;
11
+ blockHash: Hash;
12
+ blockNumber: bigint;
13
+ } | null;
14
+ /**
15
+ * Returns the user operation from userOpHash
16
+ *
17
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationByHash
18
+ *
19
+ * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
20
+ * @param args {@link GetUserOperationByHashParameters} UserOpHash that was returned by {@link sendUserOperation}
21
+ * @returns userOperation along with entryPoint, transactionHash, blockHash, blockNumber if found or null
22
+ *
23
+ *
24
+ * @example
25
+ * import { createClient } from "viem"
26
+ * import { getUserOperationByHash } from "permissionless/actions"
27
+ *
28
+ * const bundlerClient = createClient({
29
+ * chain: goerli,
30
+ * transport: http(BUNDLER_URL)
31
+ * })
32
+ *
33
+ * getUserOperationByHash(bundlerClient, {hash: userOpHash})
34
+ *
35
+ */
36
+ export declare const getUserOperationByHash: (client: BundlerClient, { hash }: GetUserOperationByHashParameters) => Promise<GetUserOperationByHashReturnType>;
37
+ //# sourceMappingURL=getUserOperationByHash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUserOperationByHash.d.ts","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationByHash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAEjE,MAAM,MAAM,gCAAgC,GAAG;IAC3C,IAAI,EAAE,IAAI,CAAA;CACb,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC3C,aAAa,EAAE,aAAa,CAAA;IAC5B,UAAU,EAAE,OAAO,CAAA;IACnB,eAAe,EAAE,IAAI,CAAA;IACrB,SAAS,EAAE,IAAI,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;CACtB,GAAG,IAAI,CAAA;AAER;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,sBAAsB,WACvB,aAAa,YACX,gCAAgC,KAC3C,QAAQ,gCAAgC,CA2B1C,CAAA"}
@@ -0,0 +1,93 @@
1
+ import type { Address, Hash, Hex } from "viem";
2
+ import type { BundlerClient } from "../../clients/bundler.js";
3
+ import type { TStatus } from "../../types/userOperation.js";
4
+ export type GetUserOperationReceiptParameters = {
5
+ hash: Hash;
6
+ };
7
+ export type GetUserOperationReceiptReturnType = {
8
+ userOpHash: Hash;
9
+ sender: Address;
10
+ nonce: bigint;
11
+ actualGasUsed: bigint;
12
+ actualGasCost: bigint;
13
+ success: boolean;
14
+ receipt: {
15
+ transactionHash: Hex;
16
+ transactionIndex: bigint;
17
+ blockHash: Hash;
18
+ blockNumber: bigint;
19
+ from: Address;
20
+ to: Address | null;
21
+ cumulativeGasUsed: bigint;
22
+ status: TStatus;
23
+ gasUsed: bigint;
24
+ contractAddress: Address | null;
25
+ logsBloom: Hex;
26
+ effectiveGasPrice: bigint;
27
+ };
28
+ logs: {
29
+ data: Hex;
30
+ blockNumber: bigint;
31
+ blockHash: Hash;
32
+ transactionHash: Hash;
33
+ logIndex: bigint;
34
+ transactionIndex: bigint;
35
+ address: Address;
36
+ topics: Hex[];
37
+ }[];
38
+ } | null;
39
+ /**
40
+ * Returns the user operation receipt from userOpHash
41
+ *
42
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt
43
+ *
44
+ * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
45
+ * @param args {@link GetUserOperationReceiptParameters} UserOpHash that was returned by {@link sendUserOperation}
46
+ * @returns user operation receipt {@link GetUserOperationReceiptReturnType} if found or null
47
+ *
48
+ *
49
+ * @example
50
+ * import { createClient } from "viem"
51
+ * import { getUserOperationReceipt } from "permissionless/actions"
52
+ *
53
+ * const bundlerClient = createClient({
54
+ * chain: goerli,
55
+ * transport: http(BUNDLER_URL)
56
+ * })
57
+ *
58
+ * getUserOperationReceipt(bundlerClient, {hash: userOpHash})
59
+ *
60
+ */
61
+ export declare const getUserOperationReceipt: (client: BundlerClient, { hash }: GetUserOperationReceiptParameters) => Promise<{
62
+ userOpHash: Hash;
63
+ sender: Address;
64
+ nonce: bigint;
65
+ actualGasUsed: bigint;
66
+ actualGasCost: bigint;
67
+ success: boolean;
68
+ receipt: {
69
+ transactionHash: Hex;
70
+ transactionIndex: bigint;
71
+ blockHash: Hash;
72
+ blockNumber: bigint;
73
+ from: Address;
74
+ to: Address | null;
75
+ cumulativeGasUsed: bigint;
76
+ status: TStatus;
77
+ gasUsed: bigint;
78
+ contractAddress: Address | null;
79
+ logsBloom: Hex;
80
+ effectiveGasPrice: bigint;
81
+ };
82
+ logs: {
83
+ data: Hex;
84
+ blockNumber: bigint;
85
+ blockHash: Hash;
86
+ transactionHash: Hash;
87
+ logIndex: bigint;
88
+ transactionIndex: bigint;
89
+ address: Address;
90
+ topics: Hex[];
91
+ }[];
92
+ } | null>;
93
+ //# sourceMappingURL=getUserOperationReceipt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUserOperationReceipt.d.ts","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAG3D,MAAM,MAAM,iCAAiC,GAAG;IAC5C,IAAI,EAAE,IAAI,CAAA;CACb,CAAA;AAED,MAAM,MAAM,iCAAiC,GAAG;IAC5C,UAAU,EAAE,IAAI,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE;QACL,eAAe,EAAE,GAAG,CAAA;QACpB,gBAAgB,EAAE,MAAM,CAAA;QACxB,SAAS,EAAE,IAAI,CAAA;QACf,WAAW,EAAE,MAAM,CAAA;QACnB,IAAI,EAAE,OAAO,CAAA;QACb,EAAE,EAAE,OAAO,GAAG,IAAI,CAAA;QAClB,iBAAiB,EAAE,MAAM,CAAA;QACzB,MAAM,EAAE,OAAO,CAAA;QACf,OAAO,EAAE,MAAM,CAAA;QACf,eAAe,EAAE,OAAO,GAAG,IAAI,CAAA;QAC/B,SAAS,EAAE,GAAG,CAAA;QACd,iBAAiB,EAAE,MAAM,CAAA;KAC5B,CAAA;IACD,IAAI,EAAE;QACF,IAAI,EAAE,GAAG,CAAA;QACT,WAAW,EAAE,MAAM,CAAA;QACnB,SAAS,EAAE,IAAI,CAAA;QACf,eAAe,EAAE,IAAI,CAAA;QACrB,QAAQ,EAAE,MAAM,CAAA;QAChB,gBAAgB,EAAE,MAAM,CAAA;QACxB,OAAO,EAAE,OAAO,CAAA;QAChB,MAAM,EAAE,GAAG,EAAE,CAAA;KAChB,EAAE,CAAA;CACN,GAAG,IAAI,CAAA;AAER;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,uBAAuB,WAAkB,aAAa,YAAY,iCAAiC;gBAtDhG,IAAI;YACR,OAAO;WACR,MAAM;mBACE,MAAM;mBACN,MAAM;aACZ,OAAO;aACP;QACL,eAAe,EAAE,GAAG,CAAA;QACpB,gBAAgB,EAAE,MAAM,CAAA;QACxB,SAAS,EAAE,IAAI,CAAA;QACf,WAAW,EAAE,MAAM,CAAA;QACnB,IAAI,EAAE,OAAO,CAAA;QACb,EAAE,EAAE,OAAO,GAAG,IAAI,CAAA;QAClB,iBAAiB,EAAE,MAAM,CAAA;QACzB,QAAQ,OAAO,CAAA;QACf,OAAO,EAAE,MAAM,CAAA;QACf,eAAe,EAAE,OAAO,GAAG,IAAI,CAAA;QAC/B,SAAS,EAAE,GAAG,CAAA;QACd,iBAAiB,EAAE,MAAM,CAAA;KAC5B;UACK;QACF,IAAI,EAAE,GAAG,CAAA;QACT,WAAW,EAAE,MAAM,CAAA;QACnB,SAAS,EAAE,IAAI,CAAA;QACf,eAAe,EAAE,IAAI,CAAA;QACrB,QAAQ,EAAE,MAAM,CAAA;QAChB,gBAAgB,EAAE,MAAM,CAAA;QACxB,OAAO,EAAE,OAAO,CAAA;QAChB,MAAM,EAAE,GAAG,EAAE,CAAA;KAChB,EAAE;SAqEN,CAAA"}
@@ -0,0 +1,36 @@
1
+ import type { Address, Hash } from "viem";
2
+ import type { BundlerClient } from "../../clients/bundler.js";
3
+ import type { UserOperation } from "../../types/userOperation.js";
4
+ export type SendUserOperationParameters = {
5
+ userOperation: UserOperation;
6
+ entryPoint: Address;
7
+ };
8
+ /**
9
+ * Sends user operation to the bundler
10
+ *
11
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/sendUserOperation
12
+ *
13
+ * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
14
+ * @param args {@link SendUserOperationParameters}.
15
+ * @returns UserOpHash that you can use to track user operation as {@link Hash}.
16
+ *
17
+ *
18
+ * @example
19
+ * import { createClient } from "viem"
20
+ * import { sendUserOperation } from "permissionless/actions"
21
+ *
22
+ * const bundlerClient = createClient({
23
+ * chain: goerli,
24
+ * transport: http(BUNDLER_URL)
25
+ * })
26
+ *
27
+ * const userOpHash = sendUserOperation(bundlerClient, {
28
+ * userOperation: signedUserOperation,
29
+ * entryPoint: entryPoint
30
+ * })
31
+ *
32
+ * // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
33
+ *
34
+ */
35
+ export declare const sendUserOperation: (client: BundlerClient, args: SendUserOperationParameters) => Promise<Hash>;
36
+ //# sourceMappingURL=sendUserOperation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendUserOperation.d.ts","sourceRoot":"","sources":["../../../actions/bundler/sendUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAgC,MAAM,8BAA8B,CAAA;AAG/F,MAAM,MAAM,2BAA2B,GAAG;IACtC,aAAa,EAAE,aAAa,CAAA;IAC5B,UAAU,EAAE,OAAO,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,iBAAiB,WAAkB,aAAa,QAAQ,2BAA2B,KAAG,QAAQ,IAAI,CAO9G,CAAA"}
@@ -0,0 +1,26 @@
1
+ import type { Address } from "viem";
2
+ import type { BundlerClient } from "../../clients/bundler.js";
3
+ /**
4
+ * Returns the supported entrypoints by the bundler service
5
+ *
6
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/supportedEntryPoints
7
+ *
8
+ * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
9
+ * @returns Supported entryPoints
10
+ *
11
+ *
12
+ * @example
13
+ * import { createClient } from "viem"
14
+ * import { supportedEntryPoints } from "permissionless/actions"
15
+ *
16
+ * const bundlerClient = createClient({
17
+ * chain: goerli,
18
+ * transport: http(BUNDLER_URL)
19
+ * })
20
+ *
21
+ * const entryPointsSupported = supportedEntryPoints(bundlerClient)
22
+ * // Return ['0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789']
23
+ *
24
+ */
25
+ export declare const supportedEntryPoints: (client: BundlerClient) => Promise<Address[]>;
26
+ //# sourceMappingURL=supportedEntryPoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supportedEntryPoints.d.ts","sourceRoot":"","sources":["../../../actions/bundler/supportedEntryPoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,oBAAoB,WAAkB,aAAa,KAAG,QAAQ,OAAO,EAAE,CAKnF,CAAA"}
@@ -1,7 +1,18 @@
1
- import type { EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType, GetUserOperationByHashParameters, GetUserOperationByHashReturnType, GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType, SendUserOperationParameters } from "./bundler";
2
- import { bundlerActions, chainId, estimateUserOperationGas, getUserOperationByHash, getUserOperationReceipt, sendUserOperation, supportedEntryPoints } from "./bundler";
3
- import type { GetSenderAddressParams } from "./public";
4
- import { getSenderAddress } from "./public";
5
- export type { SendUserOperationParameters, EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType, GetUserOperationByHashParameters, GetUserOperationByHashReturnType, GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType, GetSenderAddressParams };
6
- export { bundlerActions, sendUserOperation, estimateUserOperationGas, supportedEntryPoints, chainId, getUserOperationByHash, getUserOperationReceipt, getSenderAddress };
1
+ import type { EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType } from "./bundler/estimateUserOperationGas.js";
2
+ import type { GetUserOperationByHashParameters } from "./bundler/getUserOperationByHash.js";
3
+ import type { GetUserOperationByHashReturnType } from "./bundler/getUserOperationByHash.js";
4
+ import type { GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType } from "./bundler/getUserOperationReceipt.js";
5
+ import type { SendUserOperationParameters } from "./bundler/sendUserOperation.js";
6
+ import type { GetSenderAddressParams } from "./public/getSenderAddress.js";
7
+ import { InvalidEntryPointError, getSenderAddress } from "./public/getSenderAddress.js";
8
+ import { chainId } from "./bundler/chainId.js";
9
+ import { estimateUserOperationGas } from "./bundler/estimateUserOperationGas.js";
10
+ import { getUserOperationByHash } from "./bundler/getUserOperationByHash.js";
11
+ import { getUserOperationReceipt } from "./bundler/getUserOperationReceipt.js";
12
+ import { sendUserOperation } from "./bundler/sendUserOperation.js";
13
+ import { supportedEntryPoints } from "./bundler/supportedEntryPoints.js";
14
+ import type { GetAccountNonceParams } from "./public/getAccountNonce.js";
15
+ import { getAccountNonce } from "./public/getAccountNonce.js";
16
+ export type { SendUserOperationParameters, EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType, GetUserOperationByHashParameters, GetUserOperationByHashReturnType, GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType, GetSenderAddressParams, GetAccountNonceParams };
17
+ export { sendUserOperation, estimateUserOperationGas, supportedEntryPoints, chainId, getUserOperationByHash, getUserOperationReceipt, getSenderAddress, getAccountNonce, InvalidEntryPointError };
7
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,kCAAkC,EAClC,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,EACjC,iCAAiC,EACjC,2BAA2B,EAC9B,MAAM,WAAW,CAAA;AAElB,OAAO,EACH,cAAc,EACd,OAAO,EACP,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,WAAW,CAAA;AAElB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAE3C,YAAY,EACR,2BAA2B,EAC3B,kCAAkC,EAClC,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,EACjC,iCAAiC,EACjC,sBAAsB,EACzB,CAAA;AAED,OAAO,EACH,cAAc,EACd,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,OAAO,EACP,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EACnB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,kCAAkC,EAClC,kCAAkC,EACrC,MAAM,uCAAuC,CAAA;AAC9C,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qCAAqC,CAAA;AAC3F,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qCAAqC,CAAA;AAC3F,OAAO,KAAK,EACR,iCAAiC,EACjC,iCAAiC,EACpC,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAA;AAEjF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAEvF,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAA;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAE7D,YAAY,EACR,2BAA2B,EAC3B,kCAAkC,EAClC,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,EACjC,iCAAiC,EACjC,sBAAsB,EACtB,qBAAqB,EACxB,CAAA;AAED,OAAO,EACH,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,OAAO,EACP,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACzB,CAAA"}
@@ -0,0 +1,38 @@
1
+ import type { PimlicoBundlerClient } from "../../clients/pimlico.js";
2
+ export type GetUserOperationGasPriceReturnType = {
3
+ slow: {
4
+ maxFeePerGas: bigint;
5
+ maxPriorityFeePerGas: bigint;
6
+ };
7
+ standard: {
8
+ maxFeePerGas: bigint;
9
+ maxPriorityFeePerGas: bigint;
10
+ };
11
+ fast: {
12
+ maxFeePerGas: bigint;
13
+ maxPriorityFeePerGas: bigint;
14
+ };
15
+ };
16
+ /**
17
+ * Returns the live gas prices that you can use to send a user operation.
18
+ *
19
+ * - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationGasPrice
20
+ *
21
+ * @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
22
+ * @returns slow, standard & fast values for maxFeePerGas & maxPriorityFeePerGas
23
+ *
24
+ *
25
+ * @example
26
+ * import { createClient } from "viem"
27
+ * import { getUserOperationGasPrice } from "permissionless/actions/pimlico"
28
+ *
29
+ * const bundlerClient = createClient({
30
+ * chain: goerli,
31
+ * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
32
+ * })
33
+ *
34
+ * await getUserOperationGasPrice(bundlerClient)
35
+ *
36
+ */
37
+ export declare const getUserOperationGasPrice: (client: PimlicoBundlerClient) => Promise<GetUserOperationGasPriceReturnType>;
38
+ //# sourceMappingURL=getUserOperationGasPrice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUserOperationGasPrice.d.ts","sourceRoot":"","sources":["../../../actions/pimlico/getUserOperationGasPrice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAEpE,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;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,wBAAwB,WACzB,oBAAoB,KAC7B,QAAQ,kCAAkC,CAoB5C,CAAA"}
@@ -0,0 +1,31 @@
1
+ import type { Hash } from "viem";
2
+ import type { PimlicoBundlerClient } from "../../clients/pimlico.js";
3
+ import type { PimlicoUserOperationStatus } from "../../types/pimlico.js";
4
+ export type GetUserOperationStatusParameters = {
5
+ hash: Hash;
6
+ };
7
+ export type GetUserOperationStatusReturnType = PimlicoUserOperationStatus;
8
+ /**
9
+ * Returns the status of the userOperation that is pending in the mempool.
10
+ *
11
+ * - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationStatus
12
+ *
13
+ * @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
14
+ * @param hash {@link Hash} UserOpHash that you must have received from sendUserOperation.
15
+ * @returns status & transaction hash if included {@link GetUserOperationStatusReturnType}
16
+ *
17
+ *
18
+ * @example
19
+ * import { createClient } from "viem"
20
+ * import { getUserOperationStatus } from "permissionless/actions/pimlico"
21
+ *
22
+ * const bundlerClient = createClient({
23
+ * chain: goerli,
24
+ * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
25
+ * })
26
+ *
27
+ * await getUserOperationStatus(bundlerClient, { hash: userOpHash })
28
+ *
29
+ */
30
+ export declare const getUserOperationStatus: (client: PimlicoBundlerClient, { hash }: GetUserOperationStatusParameters) => Promise<GetUserOperationStatusReturnType>;
31
+ //# sourceMappingURL=getUserOperationStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUserOperationStatus.d.ts","sourceRoot":"","sources":["../../../actions/pimlico/getUserOperationStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AAExE,MAAM,MAAM,gCAAgC,GAAG;IAC3C,IAAI,EAAE,IAAI,CAAA;CACb,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG,0BAA0B,CAAA;AAEzE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,sBAAsB,WACvB,oBAAoB,YAClB,gCAAgC,KAC3C,QAAQ,gCAAgC,CAK1C,CAAA"}
@@ -0,0 +1,41 @@
1
+ import type { Address, Hex } from "viem";
2
+ import type { PartialBy } from "viem/types/utils";
3
+ import type { PimlicoPaymasterClient } from "../../clients/pimlico.js";
4
+ import type { UserOperation } from "../../types/userOperation.js";
5
+ export type SponsorUserOperationParameters = {
6
+ userOperation: PartialBy<UserOperation, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterAndData">;
7
+ entryPoint: Address;
8
+ };
9
+ export type SponsorUserOperationReturnType = {
10
+ paymasterAndData: Hex;
11
+ preVerificationGas: bigint;
12
+ verificationGasLimit: bigint;
13
+ callGasLimit: bigint;
14
+ };
15
+ /**
16
+ * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
17
+ *
18
+ * - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/sponsorUserOperation
19
+ *
20
+ * @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
21
+ * @param args {@link sponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
22
+ * @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
23
+ *
24
+ *
25
+ * @example
26
+ * import { createClient } from "viem"
27
+ * import { sponsorUserOperation } from "permissionless/actions/pimlico"
28
+ *
29
+ * const bundlerClient = createClient({
30
+ * chain: goerli,
31
+ * transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
32
+ * })
33
+ *
34
+ * await sponsorUserOperation(bundlerClient, {
35
+ * userOperation: userOperationWithDummySignature,
36
+ * entryPoint: entryPoint
37
+ * }})
38
+ *
39
+ */
40
+ export declare const sponsorUserOperation: (client: PimlicoPaymasterClient, args: SponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType>;
41
+ //# sourceMappingURL=sponsorUserOperation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sponsorUserOperation.d.ts","sourceRoot":"","sources":["../../../actions/pimlico/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,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACtE,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;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;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,oBAAoB,WACrB,sBAAsB,QACxB,8BAA8B,KACrC,QAAQ,8BAA8B,CAYxC,CAAA"}
@@ -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