permissionless 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/_cjs/actions/bundler/chainId.js +11 -0
  3. package/_cjs/actions/bundler/chainId.js.map +1 -0
  4. package/_cjs/actions/bundler/estimateUserOperationGas.js +18 -0
  5. package/_cjs/actions/bundler/estimateUserOperationGas.js.map +1 -0
  6. package/_cjs/actions/bundler/getUserOperationByHash.js +30 -0
  7. package/_cjs/actions/bundler/getUserOperationByHash.js.map +1 -0
  8. package/_cjs/actions/bundler/getUserOperationReceipt.js +48 -0
  9. package/_cjs/actions/bundler/getUserOperationReceipt.js.map +1 -0
  10. package/_cjs/actions/bundler/sendUserOperation.js +13 -0
  11. package/_cjs/actions/bundler/sendUserOperation.js.map +1 -0
  12. package/_cjs/actions/bundler/supportedEntryPoints.js +11 -0
  13. package/_cjs/actions/bundler/supportedEntryPoints.js.map +1 -0
  14. package/_cjs/actions/bundler/waitForUserOperationReceipt.js +46 -0
  15. package/_cjs/actions/bundler/waitForUserOperationReceipt.js.map +1 -0
  16. package/_cjs/actions/index.js +22 -12
  17. package/_cjs/actions/index.js.map +1 -1
  18. package/_cjs/actions/pimlico/getUserOperationGasPrice.js +25 -0
  19. package/_cjs/actions/pimlico/getUserOperationGasPrice.js.map +1 -0
  20. package/_cjs/actions/pimlico/getUserOperationStatus.js +11 -0
  21. package/_cjs/actions/pimlico/getUserOperationStatus.js.map +1 -0
  22. package/_cjs/actions/pimlico/sponsorUserOperation.js +18 -0
  23. package/_cjs/actions/pimlico/sponsorUserOperation.js.map +1 -0
  24. package/_cjs/actions/pimlico.js +10 -52
  25. package/_cjs/actions/pimlico.js.map +1 -1
  26. package/_cjs/actions/public/getAccountNonce.js +35 -0
  27. package/_cjs/actions/public/getAccountNonce.js.map +1 -0
  28. package/_cjs/actions/{public.js → public/getSenderAddress.js} +2 -33
  29. package/_cjs/actions/public/getSenderAddress.js.map +1 -0
  30. package/_cjs/actions/stackup/accounts.js +12 -0
  31. package/_cjs/actions/stackup/accounts.js.map +1 -0
  32. package/_cjs/actions/stackup/sponsorUserOperation.js +18 -0
  33. package/_cjs/actions/stackup/sponsorUserOperation.js.map +1 -0
  34. package/_cjs/actions/stackup.js +10 -0
  35. package/_cjs/actions/stackup.js.map +1 -0
  36. package/_cjs/clients/bundler.js +2 -2
  37. package/_cjs/clients/bundler.js.map +1 -1
  38. package/_cjs/clients/decorators/bundler.js +21 -0
  39. package/_cjs/clients/decorators/bundler.js.map +1 -0
  40. package/_cjs/clients/decorators/pimlico.js +16 -0
  41. package/_cjs/clients/decorators/pimlico.js.map +1 -0
  42. package/_cjs/clients/decorators/stackup.js +11 -0
  43. package/_cjs/clients/decorators/stackup.js.map +1 -0
  44. package/_cjs/clients/pimlico.js +4 -4
  45. package/_cjs/clients/pimlico.js.map +1 -1
  46. package/_cjs/clients/stackup.js +18 -0
  47. package/_cjs/clients/stackup.js.map +1 -0
  48. package/_cjs/index.js +28 -4
  49. package/_cjs/index.js.map +1 -1
  50. package/_cjs/types/stackup.js +3 -0
  51. package/_cjs/types/stackup.js.map +1 -0
  52. package/_cjs/{actions/utils.js → utils/deepHexlify.js} +1 -1
  53. package/_cjs/utils/deepHexlify.js.map +1 -0
  54. package/_cjs/utils/getUserOperationHash.js +38 -0
  55. package/_cjs/utils/getUserOperationHash.js.map +1 -0
  56. package/_cjs/utils/index.js +2 -34
  57. package/_cjs/utils/index.js.map +1 -1
  58. package/_cjs/utils/observe.js +39 -0
  59. package/_cjs/utils/observe.js.map +1 -0
  60. package/_esm/actions/bundler/chainId.js +29 -0
  61. package/_esm/actions/bundler/chainId.js.map +1 -0
  62. package/_esm/actions/bundler/estimateUserOperationGas.js +41 -0
  63. package/_esm/actions/bundler/estimateUserOperationGas.js.map +1 -0
  64. package/_esm/actions/bundler/getUserOperationByHash.js +48 -0
  65. package/_esm/actions/bundler/getUserOperationByHash.js.map +1 -0
  66. package/_esm/actions/bundler/getUserOperationReceipt.js +66 -0
  67. package/_esm/actions/bundler/getUserOperationReceipt.js.map +1 -0
  68. package/_esm/actions/bundler/sendUserOperation.js +36 -0
  69. package/_esm/actions/bundler/sendUserOperation.js.map +1 -0
  70. package/_esm/actions/bundler/supportedEntryPoints.js +29 -0
  71. package/_esm/actions/bundler/supportedEntryPoints.js.map +1 -0
  72. package/_esm/actions/bundler/waitForUserOperationReceipt.js +63 -0
  73. package/_esm/actions/bundler/waitForUserOperationReceipt.js.map +1 -0
  74. package/_esm/actions/index.js +11 -3
  75. package/_esm/actions/index.js.map +1 -1
  76. package/_esm/actions/pimlico/getUserOperationGasPrice.js +42 -0
  77. package/_esm/actions/pimlico/getUserOperationGasPrice.js.map +1 -0
  78. package/_esm/actions/pimlico/getUserOperationStatus.js +29 -0
  79. package/_esm/actions/pimlico/getUserOperationStatus.js.map +1 -0
  80. package/_esm/actions/pimlico/sponsorUserOperation.js +39 -0
  81. package/_esm/actions/pimlico/sponsorUserOperation.js.map +1 -0
  82. package/_esm/actions/pimlico.js +5 -123
  83. package/_esm/actions/pimlico.js.map +1 -1
  84. package/_esm/actions/public/getAccountNonce.js +57 -0
  85. package/_esm/actions/public/getAccountNonce.js.map +1 -0
  86. package/_esm/actions/{public.js → public/getSenderAddress.js} +1 -57
  87. package/_esm/actions/public/getSenderAddress.js.map +1 -0
  88. package/_esm/actions/stackup/accounts.js +30 -0
  89. package/_esm/actions/stackup/accounts.js.map +1 -0
  90. package/_esm/actions/stackup/sponsorUserOperation.js +40 -0
  91. package/_esm/actions/stackup/sponsorUserOperation.js.map +1 -0
  92. package/_esm/actions/stackup.js +5 -0
  93. package/_esm/actions/stackup.js.map +1 -0
  94. package/_esm/clients/bundler.js +1 -1
  95. package/_esm/clients/bundler.js.map +1 -1
  96. package/_esm/clients/decorators/bundler.js +18 -0
  97. package/_esm/clients/decorators/bundler.js.map +1 -0
  98. package/_esm/clients/decorators/pimlico.js +20 -0
  99. package/_esm/clients/decorators/pimlico.js.map +1 -0
  100. package/_esm/clients/decorators/stackup.js +8 -0
  101. package/_esm/clients/decorators/stackup.js.map +1 -0
  102. package/_esm/clients/pimlico.js +2 -2
  103. package/_esm/clients/pimlico.js.map +1 -1
  104. package/_esm/clients/stackup.js +33 -0
  105. package/_esm/clients/stackup.js.map +1 -0
  106. package/_esm/index.js +17 -4
  107. package/_esm/index.js.map +1 -1
  108. package/_esm/types/stackup.js +2 -0
  109. package/_esm/types/stackup.js.map +1 -0
  110. package/_esm/{actions/utils.js → utils/deepHexlify.js} +1 -1
  111. package/_esm/utils/deepHexlify.js.map +1 -0
  112. package/_esm/utils/getUserOperationHash.js +55 -0
  113. package/_esm/utils/getUserOperationHash.js.map +1 -0
  114. package/_esm/utils/index.js +1 -54
  115. package/_esm/utils/index.js.map +1 -1
  116. package/_esm/utils/observe.js +42 -0
  117. package/_esm/utils/observe.js.map +1 -0
  118. package/_types/actions/bundler/chainId.d.ts +25 -0
  119. package/_types/actions/bundler/chainId.d.ts.map +1 -0
  120. package/_types/actions/bundler/estimateUserOperationGas.d.ts +42 -0
  121. package/_types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -0
  122. package/_types/actions/bundler/getUserOperationByHash.d.ts +37 -0
  123. package/_types/actions/bundler/getUserOperationByHash.d.ts.map +1 -0
  124. package/_types/actions/bundler/getUserOperationReceipt.d.ts +62 -0
  125. package/_types/actions/bundler/getUserOperationReceipt.d.ts.map +1 -0
  126. package/_types/actions/bundler/sendUserOperation.d.ts +36 -0
  127. package/_types/actions/bundler/sendUserOperation.d.ts.map +1 -0
  128. package/_types/actions/bundler/supportedEntryPoints.d.ts +26 -0
  129. package/_types/actions/bundler/supportedEntryPoints.d.ts.map +1 -0
  130. package/_types/actions/bundler/waitForUserOperationReceipt.d.ts +43 -0
  131. package/_types/actions/bundler/waitForUserOperationReceipt.d.ts.map +1 -0
  132. package/_types/actions/index.d.ts +19 -6
  133. package/_types/actions/index.d.ts.map +1 -1
  134. package/_types/actions/pimlico/getUserOperationGasPrice.d.ts +38 -0
  135. package/_types/actions/pimlico/getUserOperationGasPrice.d.ts.map +1 -0
  136. package/_types/actions/pimlico/getUserOperationStatus.d.ts +31 -0
  137. package/_types/actions/pimlico/getUserOperationStatus.d.ts.map +1 -0
  138. package/_types/actions/pimlico/sponsorUserOperation.d.ts +41 -0
  139. package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -0
  140. package/_types/actions/pimlico.d.ts +7 -177
  141. package/_types/actions/pimlico.d.ts.map +1 -1
  142. package/_types/actions/public/getAccountNonce.d.ts +34 -0
  143. package/_types/actions/public/getAccountNonce.d.ts.map +1 -0
  144. package/_types/actions/{public.d.ts → public/getSenderAddress.d.ts} +2 -35
  145. package/_types/actions/public/getSenderAddress.d.ts.map +1 -0
  146. package/_types/actions/stackup/accounts.d.ts +29 -0
  147. package/_types/actions/stackup/accounts.d.ts.map +1 -0
  148. package/_types/actions/stackup/sponsorUserOperation.d.ts +43 -0
  149. package/_types/actions/stackup/sponsorUserOperation.d.ts.map +1 -0
  150. package/_types/actions/stackup.d.ts +7 -0
  151. package/_types/actions/stackup.d.ts.map +1 -0
  152. package/_types/clients/bundler.d.ts +3 -3
  153. package/_types/clients/bundler.d.ts.map +1 -1
  154. package/_types/clients/decorators/bundler.d.ts +173 -0
  155. package/_types/clients/decorators/bundler.d.ts.map +1 -0
  156. package/_types/clients/decorators/pimlico.d.ts +78 -0
  157. package/_types/clients/decorators/pimlico.d.ts.map +1 -0
  158. package/_types/clients/decorators/stackup.d.ts +54 -0
  159. package/_types/clients/decorators/stackup.d.ts.map +1 -0
  160. package/_types/clients/pimlico.d.ts +3 -3
  161. package/_types/clients/pimlico.d.ts.map +1 -1
  162. package/_types/clients/stackup.d.ts +39 -0
  163. package/_types/clients/stackup.d.ts.map +1 -0
  164. package/_types/index.d.ts +28 -4
  165. package/_types/index.d.ts.map +1 -1
  166. package/_types/types/bundler.d.ts +1 -1
  167. package/_types/types/bundler.d.ts.map +1 -1
  168. package/_types/types/index.d.ts +1 -1
  169. package/_types/types/index.d.ts.map +1 -1
  170. package/_types/types/pimlico.d.ts +1 -1
  171. package/_types/types/pimlico.d.ts.map +1 -1
  172. package/_types/types/stackup.d.ts +35 -0
  173. package/_types/types/stackup.d.ts.map +1 -0
  174. package/_types/{actions/utils.d.ts → utils/deepHexlify.d.ts} +1 -1
  175. package/_types/utils/deepHexlify.d.ts.map +1 -0
  176. package/_types/utils/getUserOperationHash.d.ts +30 -0
  177. package/_types/utils/getUserOperationHash.d.ts.map +1 -0
  178. package/_types/utils/index.d.ts +2 -30
  179. package/_types/utils/index.d.ts.map +1 -1
  180. package/_types/utils/observe.d.ts +17 -0
  181. package/_types/utils/observe.d.ts.map +1 -0
  182. package/actions/bundler/chainId.ts +32 -0
  183. package/actions/bundler/estimateUserOperationGas.ts +62 -0
  184. package/actions/bundler/getUserOperationByHash.ts +69 -0
  185. package/actions/bundler/getUserOperationReceipt.ts +112 -0
  186. package/actions/bundler/sendUserOperation.ts +45 -0
  187. package/actions/bundler/supportedEntryPoints.ts +31 -0
  188. package/actions/bundler/waitForUserOperationReceipt.ts +80 -0
  189. package/actions/index.ts +30 -21
  190. package/actions/pimlico/getUserOperationGasPrice.ts +61 -0
  191. package/actions/pimlico/getUserOperationStatus.ts +41 -0
  192. package/actions/pimlico/sponsorUserOperation.ts +62 -0
  193. package/actions/pimlico.ts +34 -251
  194. package/actions/public/getAccountNonce.ts +63 -0
  195. package/actions/{public.ts → public/getSenderAddress.ts} +7 -68
  196. package/actions/stackup/accounts.ts +40 -0
  197. package/actions/stackup/sponsorUserOperation.ts +64 -0
  198. package/actions/stackup.ts +17 -0
  199. package/clients/bundler.ts +9 -4
  200. package/clients/decorators/bundler.ts +211 -0
  201. package/clients/decorators/pimlico.ts +107 -0
  202. package/clients/decorators/stackup.ts +65 -0
  203. package/clients/pimlico.ts +3 -4
  204. package/clients/stackup.ts +44 -0
  205. package/index.ts +70 -4
  206. package/package.json +11 -1
  207. package/tsconfig.build.tsbuildinfo +1 -1
  208. package/types/bundler.ts +1 -1
  209. package/types/index.ts +1 -1
  210. package/types/pimlico.ts +1 -1
  211. package/types/stackup.ts +36 -0
  212. package/utils/getUserOperationHash.ts +68 -0
  213. package/utils/index.ts +2 -69
  214. package/utils/observe.ts +61 -0
  215. package/_cjs/actions/bundler.js +0 -118
  216. package/_cjs/actions/bundler.js.map +0 -1
  217. package/_cjs/actions/public.js.map +0 -1
  218. package/_cjs/actions/utils.js.map +0 -1
  219. package/_cjs/clients/index.js +0 -6
  220. package/_cjs/clients/index.js.map +0 -1
  221. package/_esm/actions/bundler.js +0 -251
  222. package/_esm/actions/bundler.js.map +0 -1
  223. package/_esm/actions/public.js.map +0 -1
  224. package/_esm/actions/utils.js.map +0 -1
  225. package/_esm/clients/index.js +0 -3
  226. package/_esm/clients/index.js.map +0 -1
  227. package/_types/actions/bundler.d.ts +0 -393
  228. package/_types/actions/bundler.d.ts.map +0 -1
  229. package/_types/actions/public.d.ts.map +0 -1
  230. package/_types/actions/utils.d.ts.map +0 -1
  231. package/_types/clients/index.d.ts +0 -3
  232. package/_types/clients/index.d.ts.map +0 -1
  233. package/actions/bundler.ts +0 -498
  234. package/clients/index.ts +0 -3
  235. /package/{actions/utils.ts → utils/deepHexlify.ts} +0 -0
@@ -1,393 +0,0 @@
1
- import type { Address } from "abitype";
2
- import type { Client, Hash, Hex } from "viem";
3
- import type { PartialBy } from "viem/types/utils";
4
- import type { BundlerClient } from "../clients/bundler";
5
- import type { UserOperation } from "../types";
6
- import type { TStatus } from "../types/userOperation";
7
- export type SendUserOperationParameters = {
8
- userOperation: UserOperation;
9
- entryPoint: Address;
10
- };
11
- export type EstimateUserOperationGasParameters = {
12
- userOperation: PartialBy<UserOperation, "callGasLimit" | "preVerificationGas" | "verificationGasLimit">;
13
- entryPoint: Address;
14
- };
15
- export type EstimateUserOperationGasReturnType = {
16
- preVerificationGas: bigint;
17
- verificationGasLimit: bigint;
18
- callGasLimit: bigint;
19
- };
20
- export type GetUserOperationByHashParameters = {
21
- hash: Hash;
22
- };
23
- export type GetUserOperationByHashReturnType = {
24
- userOperation: UserOperation;
25
- entryPoint: Address;
26
- transactionHash: Hash;
27
- blockHash: Hash;
28
- blockNumber: bigint;
29
- } | null;
30
- export type GetUserOperationReceiptParameters = {
31
- hash: Hash;
32
- };
33
- export type GetUserOperationReceiptReturnType = {
34
- userOpHash: Hash;
35
- sender: Address;
36
- nonce: bigint;
37
- actualGasUsed: bigint;
38
- actualGasCost: bigint;
39
- success: boolean;
40
- receipt: {
41
- transactionHash: Hex;
42
- transactionIndex: bigint;
43
- blockHash: Hash;
44
- blockNumber: bigint;
45
- from: Address;
46
- to: Address | null;
47
- cumulativeGasUsed: bigint;
48
- status: TStatus;
49
- gasUsed: bigint;
50
- contractAddress: Address | null;
51
- logsBloom: Hex;
52
- effectiveGasPrice: bigint;
53
- };
54
- logs: {
55
- data: Hex;
56
- blockNumber: bigint;
57
- blockHash: Hash;
58
- transactionHash: Hash;
59
- logIndex: bigint;
60
- transactionIndex: bigint;
61
- address: Address;
62
- topics: Hex[];
63
- }[];
64
- } | null;
65
- /**
66
- * Sends user operation to the bundler
67
- *
68
- * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/sendUserOperation
69
- *
70
- * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
71
- * @param args {@link SendUserOperationParameters}.
72
- * @returns UserOpHash that you can use to track user operation as {@link Hash}.
73
- *
74
- *
75
- * @example
76
- * import { createClient } from "viem"
77
- * import { sendUserOperation } from "permissionless/actions"
78
- *
79
- * const bundlerClient = createClient({
80
- * chain: goerli,
81
- * transport: http(BUNDLER_URL)
82
- * })
83
- *
84
- * const userOpHash = sendUserOperation(bundlerClient, {
85
- * userOperation: signedUserOperation,
86
- * entryPoint: entryPoint
87
- * })
88
- *
89
- * // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
90
- *
91
- */
92
- export declare const sendUserOperation: (client: BundlerClient, args: SendUserOperationParameters) => Promise<Hash>;
93
- /**
94
- * Estimates preVerificationGas, verificationGasLimit and callGasLimit for user operation
95
- *
96
- * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/estimateUserOperationGas
97
- *
98
- * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
99
- * @param args {@link EstimateUserOperationGasParameters}
100
- * @returns preVerificationGas, verificationGasLimit and callGasLimit as {@link EstimateUserOperationGasReturnType}
101
- *
102
- *
103
- * @example
104
- * import { createClient } from "viem"
105
- * import { estimateUserOperationGas } from "permissionless/actions"
106
- *
107
- * const bundlerClient = createClient({
108
- * chain: goerli,
109
- * transport: http(BUNDLER_URL)
110
- * })
111
- *
112
- * const gasParameters = estimateUserOperationGas(bundlerClient, {
113
- * serOperation: signedUserOperation,
114
- * entryPoint: entryPoint
115
- * })
116
- *
117
- * // Return {preVerificationGas: 43492n, verificationGasLimit: 59436n, callGasLimit: 9000n}
118
- *
119
- */
120
- export declare const estimateUserOperationGas: (client: BundlerClient, args: EstimateUserOperationGasParameters) => Promise<EstimateUserOperationGasReturnType>;
121
- /**
122
- * Returns the supported entrypoints by the bundler service
123
- *
124
- * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/supportedEntryPoints
125
- *
126
- * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
127
- * @returns Supported entryPoints
128
- *
129
- *
130
- * @example
131
- * import { createClient } from "viem"
132
- * import { supportedEntryPoints } from "permissionless/actions"
133
- *
134
- * const bundlerClient = createClient({
135
- * chain: goerli,
136
- * transport: http(BUNDLER_URL)
137
- * })
138
- *
139
- * const entryPointsSupported = supportedEntryPoints(bundlerClient)
140
- * // Return ['0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789']
141
- *
142
- */
143
- export declare const supportedEntryPoints: (client: BundlerClient) => Promise<Address[]>;
144
- /**
145
- * Returns the supported chain id by the bundler service
146
- *
147
- * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/chainId
148
- *
149
- * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
150
- * @returns Supported chain id
151
- *
152
- *
153
- * @example
154
- * import { createClient } from "viem"
155
- * import { chainId } from "permissionless/actions"
156
- *
157
- * const bundlerClient = createClient({
158
- * chain: goerli,
159
- * transport: http(BUNDLER_URL)
160
- * })
161
- *
162
- * const bundlerChainId = chainId(bundlerClient)
163
- * // Return 5n for Goerli
164
- *
165
- */
166
- export declare const chainId: (client: BundlerClient) => Promise<number>;
167
- /**
168
- * Returns the user operation from userOpHash
169
- *
170
- * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationByHash
171
- *
172
- * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
173
- * @param args {@link GetUserOperationByHashParameters} UserOpHash that was returned by {@link sendUserOperation}
174
- * @returns userOperation along with entryPoint, transactionHash, blockHash, blockNumber if found or null
175
- *
176
- *
177
- * @example
178
- * import { createClient } from "viem"
179
- * import { getUserOperationByHash } from "permissionless/actions"
180
- *
181
- * const bundlerClient = createClient({
182
- * chain: goerli,
183
- * transport: http(BUNDLER_URL)
184
- * })
185
- *
186
- * getUserOperationByHash(bundlerClient, {hash: userOpHash})
187
- *
188
- */
189
- export declare const getUserOperationByHash: (client: BundlerClient, { hash }: GetUserOperationByHashParameters) => Promise<{
190
- userOperation: UserOperation;
191
- entryPoint: Address;
192
- transactionHash: Hash;
193
- blockHash: Hash;
194
- blockNumber: bigint;
195
- } | null>;
196
- /**
197
- * Returns the user operation receipt from userOpHash
198
- *
199
- * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt
200
- *
201
- * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
202
- * @param args {@link GetUserOperationReceiptParameters} UserOpHash that was returned by {@link sendUserOperation}
203
- * @returns user operation receipt {@link GetUserOperationReceiptReturnType} if found or null
204
- *
205
- *
206
- * @example
207
- * import { createClient } from "viem"
208
- * import { getUserOperationReceipt } from "permissionless/actions"
209
- *
210
- * const bundlerClient = createClient({
211
- * chain: goerli,
212
- * transport: http(BUNDLER_URL)
213
- * })
214
- *
215
- * getUserOperationReceipt(bundlerClient, {hash: userOpHash})
216
- *
217
- */
218
- export declare const getUserOperationReceipt: (client: BundlerClient, { hash }: GetUserOperationReceiptParameters) => Promise<{
219
- userOpHash: Hash;
220
- sender: Address;
221
- nonce: bigint;
222
- actualGasUsed: bigint;
223
- actualGasCost: bigint;
224
- success: boolean;
225
- receipt: {
226
- transactionHash: Hex;
227
- transactionIndex: bigint;
228
- blockHash: Hash;
229
- blockNumber: bigint;
230
- from: Address;
231
- to: Address | null;
232
- cumulativeGasUsed: bigint;
233
- status: TStatus;
234
- gasUsed: bigint;
235
- contractAddress: Address | null;
236
- logsBloom: Hex;
237
- effectiveGasPrice: bigint;
238
- };
239
- logs: {
240
- data: Hex;
241
- blockNumber: bigint;
242
- blockHash: Hash;
243
- transactionHash: Hash;
244
- logIndex: bigint;
245
- transactionIndex: bigint;
246
- address: Address;
247
- topics: Hex[];
248
- }[];
249
- } | null>;
250
- export type BundlerActions = {
251
- /**
252
- *
253
- * Sends user operation to the bundler
254
- *
255
- * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/sendUserOperation
256
- *
257
- * @param args {@link SendUserOperationParameters}.
258
- * @returns UserOpHash that you can use to track user operation as {@link Hash}.
259
- *
260
- * @example
261
- * import { createClient } from "viem"
262
- * import { bundlerActions } from "permissionless"
263
- *
264
- * const bundlerClient = createClient({
265
- * chain: goerli,
266
- * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
267
- * }).extend(bundlerActions)
268
- *
269
- * const userOpHash = await bundlerClient.sendUserOperation({
270
- * userOperation: signedUserOperation,
271
- * entryPoint: entryPoint
272
- * })
273
- *
274
- * // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
275
- */
276
- sendUserOperation: (args: SendUserOperationParameters) => Promise<Hash>;
277
- /**
278
- *
279
- * Estimates preVerificationGas, verificationGasLimit and callGasLimit for user operation
280
- *
281
- * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/estimateUserOperationGas
282
- *
283
- * @param args {@link EstimateUserOperationGasParameters}
284
- * @returns preVerificationGas, verificationGasLimit and callGasLimit as {@link EstimateUserOperationGasReturnType}
285
- *
286
- * @example
287
- * import { createClient } from "viem"
288
- * import { bundlerActions } from "permissionless"
289
- *
290
- * const bundlerClient = createClient({
291
- * chain: goerli,
292
- * transport: http(BUNDLER_URL)
293
- * }).extend(bundlerActions)
294
- *
295
- * const gasParameters = await bundlerClient.estimateUserOperationGas({
296
- * userOperation: signedUserOperation,
297
- * entryPoint: entryPoint
298
- * })
299
- *
300
- * // Return {preVerificationGas: 43492n, verificationGasLimit: 59436n, callGasLimit: 9000n}
301
- */
302
- estimateUserOperationGas: (args: EstimateUserOperationGasParameters) => Promise<EstimateUserOperationGasReturnType>;
303
- /**
304
- *
305
- * Returns the supported entrypoints by the bundler service
306
- *
307
- * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/supportedEntryPoints
308
- *
309
- * @returns Supported entryPoints
310
- *
311
- * @example
312
- * import { createClient } from "viem"
313
- * import { bundlerActions } from "permissionless"
314
- *
315
- * const bundlerClient = createClient({
316
- * chain: goerli,
317
- * transport: http(BUNDLER_URL)
318
- * }).extend(bundlerActions)
319
- *
320
- * const supportedEntryPoints = await bundlerClient.supportedEntryPoints()
321
- *
322
- * // Return ['0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789']
323
- */
324
- supportedEntryPoints: () => Promise<Address[]>;
325
- /**
326
- *
327
- * Returns the supported chain id by the bundler service
328
- *
329
- * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/chainId
330
- *
331
- * @returns Supported chain id
332
- *
333
- * @example
334
- * import { createClient } from "viem"
335
- * import { bundlerActions } from "permissionless"
336
- *
337
- * const bundlerClient = createClient({
338
- * chain: goerli,
339
- * transport: http(BUNDLER_URL)
340
- * }).extend(bundlerActions)
341
- *
342
- * const chainId = await bundlerClient.chainId()
343
- * // Return 5n for Goerli
344
- */
345
- chainId: () => Promise<number>;
346
- /**
347
- *
348
- * Returns the user operation from userOpHash
349
- *
350
- * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationByHash
351
- *
352
- * @param args {@link GetUserOperationByHash} UserOpHash that was returned by {@link sendUserOperation}
353
- * @returns userOperation along with entryPoint, transactionHash, blockHash, blockNumber if found or null
354
- *
355
- * @example
356
- * import { createClient } from "viem"
357
- * import { bundlerActions } from "permissionless"
358
- *
359
- * const bundlerClient = createClient({
360
- * chain: goerli,
361
- * transport: http(BUNDLER_URL)
362
- * }).extend(bundlerActions)
363
- *
364
- * await bundlerClient.getUserOperationByHash(userOpHash)
365
- *
366
- */
367
- getUserOperationByHash: (args: GetUserOperationByHashParameters) => Promise<GetUserOperationByHashReturnType>;
368
- /**
369
- *
370
- * Returns the user operation receipt from userOpHash
371
- *
372
- * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt
373
- *
374
- * @param args {@link GetUserOperationReceiptParameters} UserOpHash that was returned by {@link sendUserOperation}
375
- * @returns user operation receipt {@link GetUserOperationReceiptReturnType} if found or null
376
- *
377
- * @example
378
- * import { createClient } from "viem"
379
- * import { bundlerActions } from "permissionless"
380
- *
381
- * const bundlerClient = createClient({
382
- * chain: goerli,
383
- * transport: http(BUNDLER_URL)
384
- * }).extend(bundlerActions)
385
- *
386
- * await bundlerClient.getUserOperationReceipt({hash: userOpHash})
387
- *
388
- */
389
- getUserOperationReceipt: (args: GetUserOperationReceiptParameters) => Promise<GetUserOperationReceiptReturnType>;
390
- };
391
- declare const bundlerActions: (client: Client) => BundlerActions;
392
- export { bundlerActions };
393
- //# sourceMappingURL=bundler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundler.d.ts","sourceRoot":"","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AAE,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;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,eAAe,iBACV,YAAY,gCACS,qBAAqB,KACzD,QAAQ,MAAM,CA6BhB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../actions/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB;;;CAG3B,CAAA;AAGV,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAqBzC"}
@@ -1,3 +0,0 @@
1
- import { type BundlerClient, createBundlerClient } from "./bundler";
2
- export { createBundlerClient, type BundlerClient };
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../clients/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAEnE,OAAO,EAAE,mBAAmB,EAAE,KAAK,aAAa,EAAE,CAAA"}