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
@@ -0,0 +1,54 @@
1
+ import type { Address, Client } from "viem";
2
+ import { type AccountsParameters } from "../../actions/stackup/accounts.js";
3
+ import { type SponsorUserOperationParameters, type SponsorUserOperationReturnType } from "../../actions/stackup/sponsorUserOperation.js";
4
+ export type StackupPaymasterClientActions = {
5
+ /**
6
+ * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
7
+ *
8
+ * https://docs.stackup.sh/docs/paymaster-api-rpc-methods#pm_sponsoruseroperation
9
+ *
10
+ * @param args {@link SponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
11
+ * @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
12
+ *
13
+ * @example
14
+ * import { createClient } from "viem"
15
+ * import { stackupPaymasterActions } from "permissionless/actions/stackup"
16
+ *
17
+ * const bundlerClient = createClient({
18
+ * chain: goerli,
19
+ * transport: http("https://api.stackup.sh/v1/paymaster/YOUR_API_KEY_HERE")
20
+ * }).extend(stackupPaymasterActions)
21
+ *
22
+ * await bundlerClient.sponsorUserOperation(bundlerClient, {
23
+ * userOperation: userOperationWithDummySignature,
24
+ * entryPoint: entryPoint
25
+ * }})
26
+ *
27
+ */
28
+ sponsorUserOperation: (args: SponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType>;
29
+ /**
30
+ * Returns all the Paymaster addresses associated with an EntryPoint that’s owned by this service.
31
+ *
32
+ * https://docs.stackup.sh/docs/paymaster-api-rpc-methods#pm_accounts
33
+ *
34
+ * @param args {@link AccountsParameters} entryPoint for which you want to get list of supported paymasters.
35
+ * @returns paymaster addresses
36
+ *
37
+ * @example
38
+ * import { createClient } from "viem"
39
+ * import { stackupPaymasterActions } from "permissionless/actions/stackup"
40
+ *
41
+ * const bundlerClient = createClient({
42
+ * chain: goerli,
43
+ * transport: http("https://api.stackup.sh/v1/paymaster/YOUR_API_KEY_HERE")
44
+ * }).extend(stackupPaymasterActions)
45
+ *
46
+ * await bundlerClient.accounts(bundlerClient, {
47
+ * entryPoint: entryPoint
48
+ * }})
49
+ *
50
+ */
51
+ accounts: (args: AccountsParameters) => Promise<Address[]>;
52
+ };
53
+ export declare const stackupPaymasterActions: (client: Client) => StackupPaymasterClientActions;
54
+ //# sourceMappingURL=stackup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stackup.d.ts","sourceRoot":"","sources":["../../../clients/decorators/stackup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC3C,OAAO,EAAE,KAAK,kBAAkB,EAAY,MAAM,mCAAmC,CAAA;AACrF,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EAEtC,MAAM,+CAA+C,CAAA;AAGtD,MAAM,MAAM,6BAA6B,GAAG;IACxC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,oBAAoB,EAAE,CAAC,IAAI,EAAE,8BAA8B,KAAK,OAAO,CAAC,8BAA8B,CAAC,CAAA;IAEvG;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;CAC7D,CAAA;AAED,eAAO,MAAM,uBAAuB,WAAY,MAAM,KAAG,6BAIvD,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import type { Account, Chain, Client, PublicClientConfig, Transport } from "viem";
2
- import type { BundlerActions } from "../actions/bundler";
3
- import { type PimlicoBundlerActions, type PimlicoPaymasterClientActions } from "../actions/pimlico";
4
- import type { PimlicoBundlerRpcSchema, PimlicoPaymasterRpcSchema } from "../types/pimlico";
2
+ import type { PimlicoBundlerRpcSchema, PimlicoPaymasterRpcSchema } from "../types/pimlico.js";
3
+ import { type BundlerActions } from "./decorators/bundler.js";
4
+ import { type PimlicoBundlerActions, type PimlicoPaymasterClientActions } from "./decorators/pimlico.js";
5
5
  export type PimlicoBundlerClient = Client<Transport, Chain | undefined, Account | undefined, PimlicoBundlerRpcSchema, PimlicoBundlerActions & BundlerActions>;
6
6
  export type PimlicoPaymasterClient = Client<Transport, Chain | undefined, Account | undefined, PimlicoPaymasterRpcSchema, PimlicoPaymasterClientActions>;
7
7
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../clients/pimlico.ts"],"names":[],"mappings":"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,EACH,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EAGrC,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAE1F,MAAM,MAAM,oBAAoB,GAAG,MAAM,CACrC,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,SAAS,EACnB,uBAAuB,EACvB,qBAAqB,GAAG,cAAc,CACzC,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,CACvC,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,SAAS,EACnB,yBAAyB,EACzB,6BAA6B,CAChC,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;MAEpC,oBASF,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;MAEtC,sBASF,CAAA"}
1
+ {"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../clients/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAEjF,OAAO,KAAK,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC7F,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,yBAAyB,CAAA;AAC7E,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EAGrC,MAAM,yBAAyB,CAAA;AAEhC,MAAM,MAAM,oBAAoB,GAAG,MAAM,CACrC,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,SAAS,EACnB,uBAAuB,EACvB,qBAAqB,GAAG,cAAc,CACzC,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,CACvC,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,SAAS,EACnB,yBAAyB,EACzB,6BAA6B,CAChC,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;MAEpC,oBASF,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;MAEtC,sBASF,CAAA"}
@@ -0,0 +1,39 @@
1
+ import { type Account, type Chain, type Client, type PublicClientConfig, type Transport } from "viem";
2
+ import type { StackupPaymasterRpcSchema } from "../types/stackup.js";
3
+ import { type BundlerActions } from "./decorators/bundler.js";
4
+ import { type StackupPaymasterClientActions } from "./decorators/stackup.js";
5
+ export type StackupPaymasterClient = Client<Transport, Chain | undefined, Account | undefined, StackupPaymasterRpcSchema, StackupPaymasterClientActions & BundlerActions>;
6
+ /**
7
+ * Creates a Stackup specific Paymaster Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
8
+ *
9
+ * - Docs: https://docs.pimlico.io/permissionless/reference/clients/stackupPaymasterClient
10
+ *
11
+ * A Stackup Paymaster Client is an interface to "stackup paymaster endpoints" [JSON-RPC API](https://docs.stackup.sh/docs/paymaster-api-rpc-methods) methods such as sponsoring user operation, etc through Stackup Paymaster Actions.
12
+ *
13
+ * @param config - {@link PublicClientConfig}
14
+ * @returns A Stackup Paymaster Client. {@link StackupPaymasterClient}
15
+ *
16
+ * @example
17
+ * import { createPublicClient, http } from 'viem'
18
+ * import { mainnet } from 'viem/chains'
19
+ *
20
+ * const stackupPaymasterClient = createStackupPaymasterClient({
21
+ * chain: mainnet,
22
+ * transport: http("https://api.stackup.sh/v1/paymaster/YOUR_API_KEY_HERE"),
23
+ * })
24
+ */
25
+ export declare const createStackupPaymasterClient: <transport extends Transport, chain extends Chain | undefined = undefined>(parameters: {
26
+ batch?: {
27
+ multicall?: boolean | {
28
+ batchSize?: number | undefined;
29
+ wait?: number | undefined;
30
+ } | undefined;
31
+ } | undefined;
32
+ cacheTime?: number | undefined;
33
+ chain?: Chain | chain | undefined;
34
+ key?: string | undefined;
35
+ name?: string | undefined;
36
+ pollingInterval?: number | undefined;
37
+ transport: transport;
38
+ }) => StackupPaymasterClient;
39
+ //# sourceMappingURL=stackup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stackup.d.ts","sourceRoot":"","sources":["../../clients/stackup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAgB,MAAM,MAAM,CAAA;AACnH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,yBAAyB,CAAA;AAC7E,OAAO,EAAE,KAAK,6BAA6B,EAA2B,MAAM,yBAAyB,CAAA;AAErG,MAAM,MAAM,sBAAsB,GAAG,MAAM,CACvC,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,SAAS,EACnB,yBAAyB,EACzB,6BAA6B,GAAG,cAAc,CACjD,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;MAEtC,sBASF,CAAA"}
package/_types/index.d.ts CHANGED
@@ -1,5 +1,27 @@
1
- export * from "./actions";
2
- export * from "./clients";
3
- export * from "./types";
4
- export * from "./utils";
1
+ import type { EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType } from "./actions/bundler/estimateUserOperationGas.js";
2
+ import type { GetUserOperationByHashParameters } from "./actions/bundler/getUserOperationByHash.js";
3
+ import type { GetUserOperationByHashReturnType } from "./actions/bundler/getUserOperationByHash.js";
4
+ import type { GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType } from "./actions/bundler/getUserOperationReceipt.js";
5
+ import type { SendUserOperationParameters } from "./actions/bundler/sendUserOperation.js";
6
+ import type { GetSenderAddressParams } from "./actions/public/getSenderAddress.js";
7
+ import { getSenderAddress } from "./actions/public/getSenderAddress.js";
8
+ import { chainId } from "./actions/bundler/chainId.js";
9
+ import { estimateUserOperationGas } from "./actions/bundler/estimateUserOperationGas.js";
10
+ import { getUserOperationByHash } from "./actions/bundler/getUserOperationByHash.js";
11
+ import { getUserOperationReceipt } from "./actions/bundler/getUserOperationReceipt.js";
12
+ import { sendUserOperation } from "./actions/bundler/sendUserOperation.js";
13
+ import { supportedEntryPoints } from "./actions/bundler/supportedEntryPoints.js";
14
+ import type { GetAccountNonceParams } from "./actions/public/getAccountNonce.js";
15
+ import { getAccountNonce } from "./actions/public/getAccountNonce.js";
16
+ import { type BundlerClient, createBundlerClient } from "./clients/bundler.js";
17
+ import type { BundlerActions } from "./clients/decorators/bundler.js";
18
+ import { bundlerActions } from "./clients/decorators/bundler.js";
19
+ export type { SendUserOperationParameters, EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType, GetUserOperationByHashParameters, GetUserOperationByHashReturnType, GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType, GetSenderAddressParams, GetAccountNonceParams, BundlerClient, BundlerActions };
20
+ export { sendUserOperation, estimateUserOperationGas, supportedEntryPoints, chainId, getUserOperationByHash, getUserOperationReceipt, getSenderAddress, getAccountNonce, createBundlerClient, bundlerActions };
21
+ import type { UserOperation } from "./types/userOperation.js";
22
+ export { type UserOperation };
23
+ import type { GetUserOperationHashParams } from "./utils/getUserOperationHash.js";
24
+ import { getUserOperationHash } from "./utils/getUserOperationHash.js";
25
+ export { getUserOperationHash, type GetUserOperationHashParams };
26
+ export * from "./utils/index.js";
5
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,kCAAkC,EAClC,kCAAkC,EACrC,MAAM,+CAA+C,CAAA;AACtD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAA;AACnG,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAA;AACnG,OAAO,KAAK,EACR,iCAAiC,EACjC,iCAAiC,EACpC,MAAM,8CAA8C,CAAA;AACrD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAA;AAEzF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAA;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAEvE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAA;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAA;AACpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAA;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,EAAE,KAAK,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAEhE,YAAY,EACR,2BAA2B,EAC3B,kCAAkC,EAClC,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,EACjC,iCAAiC,EACjC,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACjB,CAAA;AAED,OAAO,EACH,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,OAAO,EACP,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACjB,CAAA;AACD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D,OAAO,EAAE,KAAK,aAAa,EAAE,CAAA;AAE7B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAEtE,OAAO,EAAE,oBAAoB,EAAE,KAAK,0BAA0B,EAAE,CAAA;AAChE,cAAc,kBAAkB,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import type { Address, Hash, Hex } from "viem";
2
2
  import type { PartialBy } from "viem/types/utils";
3
- import type { UserOperationWithBigIntAsHex } from "./userOperation";
3
+ import type { UserOperationWithBigIntAsHex } from "./userOperation.js";
4
4
  export type BundlerRpcSchema = [
5
5
  {
6
6
  Method: "eth_sendUserOperation";
@@ -1 +1 @@
1
- {"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../types/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC9C,OAAO,KAAK,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CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE;QACL,eAAe,EAAE,GAAG,CAAA;QACpB,gBAAgB,EAAE,GAAG,CAAA;QACrB,SAAS,EAAE,IAAI,CAAA;QACf,WAAW,EAAE,GAAG,CAAA;QAChB,IAAI,EAAE,OAAO,CAAA;QACb,EAAE,EAAE,OAAO,GAAG,IAAI,CAAA;QAClB,iBAAiB,EAAE,GAAG,CAAA;QACtB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAA;QACrB,OAAO,EAAE,GAAG,CAAA;QACZ,eAAe,EAAE,OAAO,GAAG,IAAI,CAAA;QAC/B,SAAS,EAAE,GAAG,CAAA;QACd,iBAAiB,EAAE,GAAG,CAAA;KACzB,CAAA;IACD,IAAI,EAAE;QACF,IAAI,EAAE,GAAG,CAAA;QACT,WAAW,EAAE,GAAG,CAAA;QAChB,SAAS,EAAE,IAAI,CAAA;QACf,eAAe,EAAE,IAAI,CAAA;QACrB,QAAQ,EAAE,GAAG,CAAA;QACb,gBAAgB,EAAE,GAAG,CAAA;QACrB,OAAO,EAAE,OAAO,CAAA;QAChB,MAAM,EAAE,GAAG,EAAE,CAAA;KAChB,EAAE,CAAA;CACN,CAAA"}
@@ -1,3 +1,3 @@
1
- import type { UserOperation } from "./userOperation";
1
+ import type { UserOperation } from "./userOperation.js";
2
2
  export type { UserOperation };
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD,YAAY,EAAE,aAAa,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,YAAY,EAAE,aAAa,EAAE,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import type { Address, Hash, Hex } from "viem";
2
2
  import type { PartialBy } from "viem/types/utils";
3
- import type { UserOperationWithBigIntAsHex } from "./userOperation";
3
+ import type { UserOperationWithBigIntAsHex } from "./userOperation.js";
4
4
  type PimlicoUserOperationGasPriceWithBigIntAsHex = {
5
5
  slow: {
6
6
  maxFeePerGas: Hex;
@@ -1 +1 @@
1
- {"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../types/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAA;AAEnE,KAAK,2CAA2C,GAAG;IAC/C,IAAI,EAAE;QACF,YAAY,EAAE,GAAG,CAAA;QACjB,oBAAoB,EAAE,GAAG,CAAA;KAC5B,CAAA;IACD,QAAQ,EAAE;QACN,YAAY,EAAE,GAAG,CAAA;QACjB,oBAAoB,EAAE,GAAG,CAAA;KAC5B,CAAA;IACD,IAAI,EAAE;QACF,YAAY,EAAE,GAAG,CAAA;QACjB,oBAAoB,EAAE,GAAG,CAAA;KAC5B,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACrC,MAAM,EAAE,WAAW,GAAG,eAAe,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAA;IACrG,eAAe,EAAE,IAAI,GAAG,IAAI,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IAClC;QACI,MAAM,EAAE,kCAAkC,CAAA;QAC1C,UAAU,EAAE,EAAE,CAAA;QACd,UAAU,EAAE,2CAA2C,CAAA;KAC1D;IACD;QACI,MAAM,EAAE,gCAAgC,CAAA;QACxC,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC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AED,MAAM,MAAM,uBAAuB,GAAG;IAClC;QACI,MAAM,EAAE,kCAAkC,CAAA;QAC1C,UAAU,EAAE,EAAE,CAAA;QACd,UAAU,EAAE,2CAA2C,CAAA;KAC1D;IACD;QACI,MAAM,EAAE,gCAAgC,CAAA;QACxC,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QACxB,UAAU,EAAE,0BAA0B,CAAA;KACzC;CACJ,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACpC;QACI,MAAM,EAAE,yBAAyB,CAAA;QACjC,UAAU,EAAE;YACR,aAAa,EAAE,SAAS,CACpB,4BAA4B,EAC5B,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,kBAAkB,CACtF;YACD,UAAU,EAAE,OAAO;SACtB,CAAA;QACD,UAAU,EAAE;YACR,gBAAgB,EAAE,GAAG,CAAA;YACrB,kBAAkB,EAAE,GAAG,CAAA;YACvB,oBAAoB,EAAE,GAAG,CAAA;YACzB,YAAY,EAAE,GAAG,CAAA;SACpB,CAAA;KACJ;CACJ,CAAA"}
@@ -0,0 +1,35 @@
1
+ import type { Address, Hex } from "viem";
2
+ import type { PartialBy } from "viem/types/utils";
3
+ import type { UserOperationWithBigIntAsHex } from "./userOperation.js";
4
+ interface StackupPaymasterContextType {
5
+ type: "erc20token" | "payg";
6
+ }
7
+ export type StackupPaymasterContext = (StackupPaymasterContextType & {
8
+ type: "erc20token";
9
+ token: string;
10
+ }) | (StackupPaymasterContextType & {
11
+ type: "payg";
12
+ });
13
+ export type StackupPaymasterRpcSchema = [
14
+ {
15
+ Method: "pm_sponsorUserOperation";
16
+ Parameters: [
17
+ userOperation: PartialBy<UserOperationWithBigIntAsHex, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterAndData">,
18
+ entryPoint: Address,
19
+ context: StackupPaymasterContext
20
+ ];
21
+ ReturnType: {
22
+ paymasterAndData: Hex;
23
+ preVerificationGas: Hex;
24
+ verificationGasLimit: Hex;
25
+ callGasLimit: Hex;
26
+ };
27
+ },
28
+ {
29
+ Method: "pm_accounts";
30
+ Parameters: [entryPoint: Address];
31
+ ReturnType: Address[];
32
+ }
33
+ ];
34
+ export {};
35
+ //# sourceMappingURL=stackup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stackup.d.ts","sourceRoot":"","sources":["../../types/stackup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAA;AAEtE,UAAU,2BAA2B;IACjC,IAAI,EAAE,YAAY,GAAG,MAAM,CAAA;CAC9B;AAED,MAAM,MAAM,uBAAuB,GAC7B,CAAC,2BAA2B,GAAG;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GACrE,CAAC,2BAA2B,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAEtD,MAAM,MAAM,yBAAyB,GAAG;IACpC;QACI,MAAM,EAAE,yBAAyB,CAAA;QACjC,UAAU,EAAE;YACR,aAAa,EAAE,SAAS,CACpB,4BAA4B,EAC5B,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,kBAAkB,CACtF;YACD,UAAU,EAAE,OAAO;YACnB,OAAO,EAAE,uBAAuB;SACnC,CAAA;QACD,UAAU,EAAE;YACR,gBAAgB,EAAE,GAAG,CAAA;YACrB,kBAAkB,EAAE,GAAG,CAAA;YACvB,oBAAoB,EAAE,GAAG,CAAA;YACzB,YAAY,EAAE,GAAG,CAAA;SACpB,CAAA;KACJ;IACD;QACI,MAAM,EAAE,aAAa,CAAA;QACrB,UAAU,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;QACjC,UAAU,EAAE,OAAO,EAAE,CAAA;KACxB;CACJ,CAAA"}
@@ -0,0 +1,30 @@
1
+ import type { Address, Hash } from "viem";
2
+ import type { UserOperation } from "../types/userOperation.js";
3
+ export type GetUserOperationHashParams = {
4
+ userOperation: UserOperation;
5
+ entryPoint: Address;
6
+ chainId: number;
7
+ };
8
+ /**
9
+ *
10
+ * Returns user operation hash that is a unique identifier of the user operation.
11
+ *
12
+ * - Docs: https://docs.pimlico.io/permissionless/reference/utils/getUserOperationHash
13
+ *
14
+ * @param args: userOperation, entryPoint, chainId as {@link GetUserOperationHashParams}
15
+ * @returns userOperationHash as {@link Hash}
16
+ *
17
+ * @example
18
+ * import { getUserOperationHash } from "permissionless/utils"
19
+ *
20
+ * const userOperationHash = getUserOperationHash({
21
+ * userOperation,
22
+ * entryPoint,
23
+ * chainId
24
+ * })
25
+ *
26
+ * // Returns "0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34"
27
+ *
28
+ */
29
+ export declare const getUserOperationHash: ({ userOperation, entryPoint, chainId }: GetUserOperationHashParams) => Hash;
30
+ //# sourceMappingURL=getUserOperationHash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUserOperationHash.d.ts","sourceRoot":"","sources":["../../utils/getUserOperationHash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAO,MAAM,MAAM,CAAA;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAmC9D,MAAM,MAAM,0BAA0B,GAAG;IAAE,aAAa,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAE/G;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,oBAAoB,2CAA4C,0BAA0B,KAAG,IAOzG,CAAA"}
@@ -1,31 +1,3 @@
1
- import type { Address, Hash } from "viem";
2
- import type { UserOperation } from "../types";
3
- export type GetUserOperationHashParams = {
4
- userOperation: UserOperation;
5
- entryPoint: Address;
6
- chainId: number;
7
- };
8
- /**
9
- *
10
- * Returns user operation hash that is a unique identifier of the user operation.
11
- *
12
- * - Docs: https://docs.pimlico.io/permissionless/reference/utils/getUserOperationHash
13
- *
14
- * @param args: userOperation, entryPoint, chainId as {@link GetUserOperationHashParams}
15
- * @returns userOperationHash as {@link Hash}
16
- *
17
- * @example
18
- * import { getUserOperationHash } from "permissionless/utils"
19
- *
20
- * const userOperationHash = getUserOperationHash({
21
- * userOperation,
22
- * entryPoint,
23
- * chainId
24
- * })
25
- *
26
- * // Returns "0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34"
27
- *
28
- */
29
- declare const getUserOperationHash: ({ userOperation, entryPoint, chainId }: GetUserOperationHashParams) => Hash;
30
- export { getUserOperationHash };
1
+ import { type GetUserOperationHashParams, getUserOperationHash } from "./getUserOperationHash.js";
2
+ export { getUserOperationHash, type GetUserOperationHashParams };
31
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAO,MAAM,MAAM,CAAA;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAmC7C,MAAM,MAAM,0BAA0B,GAAG;IAAE,aAAa,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAE/G;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,oBAAoB,2CAA4C,0BAA0B,KAAG,IAOlG,CAAA;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEjG,OAAO,EAAE,oBAAoB,EAAE,KAAK,0BAA0B,EAAE,CAAA"}
@@ -0,0 +1,32 @@
1
+ import type { BundlerClient } from "../../clients/bundler.js"
2
+
3
+ /**
4
+ * Returns the supported chain id by the bundler service
5
+ *
6
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/chainId
7
+ *
8
+ * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
9
+ * @returns Supported chain id
10
+ *
11
+ *
12
+ * @example
13
+ * import { createClient } from "viem"
14
+ * import { chainId } from "permissionless/actions"
15
+ *
16
+ * const bundlerClient = createClient({
17
+ * chain: goerli,
18
+ * transport: http(BUNDLER_URL)
19
+ * })
20
+ *
21
+ * const bundlerChainId = chainId(bundlerClient)
22
+ * // Return 5n for Goerli
23
+ *
24
+ */
25
+ export const chainId = async (client: BundlerClient) => {
26
+ return Number(
27
+ await client.request({
28
+ method: "eth_chainId",
29
+ params: []
30
+ })
31
+ )
32
+ }
@@ -0,0 +1,62 @@
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
+ import type { UserOperationWithBigIntAsHex } from "../../types/userOperation.js"
6
+ import { deepHexlify } from "../utils.js"
7
+
8
+ export type EstimateUserOperationGasParameters = {
9
+ userOperation: PartialBy<UserOperation, "callGasLimit" | "preVerificationGas" | "verificationGasLimit">
10
+ entryPoint: Address
11
+ }
12
+
13
+ export type EstimateUserOperationGasReturnType = {
14
+ preVerificationGas: bigint
15
+ verificationGasLimit: bigint
16
+ callGasLimit: bigint
17
+ }
18
+
19
+ /**
20
+ * Estimates preVerificationGas, verificationGasLimit and callGasLimit for user operation
21
+ *
22
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/estimateUserOperationGas
23
+ *
24
+ * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
25
+ * @param args {@link EstimateUserOperationGasParameters}
26
+ * @returns preVerificationGas, verificationGasLimit and callGasLimit as {@link EstimateUserOperationGasReturnType}
27
+ *
28
+ *
29
+ * @example
30
+ * import { createClient } from "viem"
31
+ * import { estimateUserOperationGas } from "permissionless/actions"
32
+ *
33
+ * const bundlerClient = createClient({
34
+ * chain: goerli,
35
+ * transport: http(BUNDLER_URL)
36
+ * })
37
+ *
38
+ * const gasParameters = estimateUserOperationGas(bundlerClient, {
39
+ * serOperation: signedUserOperation,
40
+ * entryPoint: entryPoint
41
+ * })
42
+ *
43
+ * // Return {preVerificationGas: 43492n, verificationGasLimit: 59436n, callGasLimit: 9000n}
44
+ *
45
+ */
46
+ export const estimateUserOperationGas = async (
47
+ client: BundlerClient,
48
+ args: EstimateUserOperationGasParameters
49
+ ): Promise<EstimateUserOperationGasReturnType> => {
50
+ const { userOperation, entryPoint } = args
51
+
52
+ const response = await client.request({
53
+ method: "eth_estimateUserOperationGas",
54
+ params: [deepHexlify(userOperation) as UserOperationWithBigIntAsHex, entryPoint as Address]
55
+ })
56
+
57
+ return {
58
+ preVerificationGas: BigInt(response.preVerificationGas || 0),
59
+ verificationGasLimit: BigInt(response.verificationGasLimit || 0),
60
+ callGasLimit: BigInt(response.callGasLimit || 0)
61
+ }
62
+ }
@@ -0,0 +1,69 @@
1
+ import type { Address, Hash } from "viem"
2
+ import type { BundlerClient } from "../../clients/bundler.js"
3
+ import type { UserOperation } from "../../types/userOperation.js"
4
+
5
+ export type GetUserOperationByHashParameters = {
6
+ hash: Hash
7
+ }
8
+
9
+ export type GetUserOperationByHashReturnType = {
10
+ userOperation: UserOperation
11
+ entryPoint: Address
12
+ transactionHash: Hash
13
+ blockHash: Hash
14
+ blockNumber: bigint
15
+ } | null
16
+
17
+ /**
18
+ * Returns the user operation from userOpHash
19
+ *
20
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationByHash
21
+ *
22
+ * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
23
+ * @param args {@link GetUserOperationByHashParameters} UserOpHash that was returned by {@link sendUserOperation}
24
+ * @returns userOperation along with entryPoint, transactionHash, blockHash, blockNumber if found or null
25
+ *
26
+ *
27
+ * @example
28
+ * import { createClient } from "viem"
29
+ * import { getUserOperationByHash } from "permissionless/actions"
30
+ *
31
+ * const bundlerClient = createClient({
32
+ * chain: goerli,
33
+ * transport: http(BUNDLER_URL)
34
+ * })
35
+ *
36
+ * getUserOperationByHash(bundlerClient, {hash: userOpHash})
37
+ *
38
+ */
39
+ export const getUserOperationByHash = async (
40
+ client: BundlerClient,
41
+ { hash }: GetUserOperationByHashParameters
42
+ ): Promise<GetUserOperationByHashReturnType> => {
43
+ const params: [Hash] = [hash]
44
+
45
+ const response = await client.request({
46
+ method: "eth_getUserOperationByHash",
47
+ params
48
+ })
49
+
50
+ if (!response) return null
51
+
52
+ const { userOperation, entryPoint, transactionHash, blockHash, blockNumber } = response
53
+
54
+ return {
55
+ userOperation: {
56
+ ...userOperation,
57
+ nonce: BigInt(userOperation.nonce),
58
+ callGasLimit: BigInt(userOperation.callGasLimit),
59
+ verificationGasLimit: BigInt(userOperation.verificationGasLimit),
60
+ preVerificationGas: BigInt(userOperation.preVerificationGas),
61
+ maxFeePerGas: BigInt(userOperation.maxFeePerGas),
62
+ maxPriorityFeePerGas: BigInt(userOperation.maxPriorityFeePerGas)
63
+ } as UserOperation,
64
+ entryPoint: entryPoint,
65
+ transactionHash: transactionHash,
66
+ blockHash: blockHash,
67
+ blockNumber: BigInt(blockNumber)
68
+ }
69
+ }
@@ -0,0 +1,109 @@
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
+ import { transactionReceiptStatus } from "../utils.js"
5
+
6
+ export type GetUserOperationReceiptParameters = {
7
+ hash: Hash
8
+ }
9
+
10
+ export type GetUserOperationReceiptReturnType = {
11
+ userOpHash: Hash
12
+ sender: Address
13
+ nonce: bigint
14
+ actualGasUsed: bigint
15
+ actualGasCost: bigint
16
+ success: boolean
17
+ receipt: {
18
+ transactionHash: Hex
19
+ transactionIndex: bigint
20
+ blockHash: Hash
21
+ blockNumber: bigint
22
+ from: Address
23
+ to: Address | null
24
+ cumulativeGasUsed: bigint
25
+ status: TStatus
26
+ gasUsed: bigint
27
+ contractAddress: Address | null
28
+ logsBloom: Hex
29
+ effectiveGasPrice: bigint
30
+ }
31
+ logs: {
32
+ data: Hex
33
+ blockNumber: bigint
34
+ blockHash: Hash
35
+ transactionHash: Hash
36
+ logIndex: bigint
37
+ transactionIndex: bigint
38
+ address: Address
39
+ topics: Hex[]
40
+ }[]
41
+ } | null
42
+
43
+ /**
44
+ * Returns the user operation receipt from userOpHash
45
+ *
46
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt
47
+ *
48
+ * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
49
+ * @param args {@link GetUserOperationReceiptParameters} UserOpHash that was returned by {@link sendUserOperation}
50
+ * @returns user operation receipt {@link GetUserOperationReceiptReturnType} if found or null
51
+ *
52
+ *
53
+ * @example
54
+ * import { createClient } from "viem"
55
+ * import { getUserOperationReceipt } from "permissionless/actions"
56
+ *
57
+ * const bundlerClient = createClient({
58
+ * chain: goerli,
59
+ * transport: http(BUNDLER_URL)
60
+ * })
61
+ *
62
+ * getUserOperationReceipt(bundlerClient, {hash: userOpHash})
63
+ *
64
+ */
65
+ export const getUserOperationReceipt = async (client: BundlerClient, { hash }: GetUserOperationReceiptParameters) => {
66
+ const params: [Hash] = [hash]
67
+
68
+ const response = await client.request({
69
+ method: "eth_getUserOperationReceipt",
70
+ params
71
+ })
72
+
73
+ if (!response) return null
74
+
75
+ const userOperationReceipt: GetUserOperationReceiptReturnType = {
76
+ userOpHash: response.userOpHash,
77
+ sender: response.sender,
78
+ nonce: BigInt(response.nonce),
79
+ actualGasUsed: BigInt(response.actualGasUsed),
80
+ actualGasCost: BigInt(response.actualGasCost),
81
+ success: response.success,
82
+ receipt: {
83
+ transactionHash: response.receipt.transactionHash,
84
+ transactionIndex: BigInt(response.receipt.transactionIndex),
85
+ blockHash: response.receipt.blockHash,
86
+ blockNumber: BigInt(response.receipt.blockNumber),
87
+ from: response.receipt.from,
88
+ to: response.receipt.to,
89
+ cumulativeGasUsed: BigInt(response.receipt.cumulativeGasUsed),
90
+ status: transactionReceiptStatus[response.receipt.status],
91
+ gasUsed: BigInt(response.receipt.gasUsed),
92
+ contractAddress: response.receipt.contractAddress,
93
+ logsBloom: response.receipt.logsBloom,
94
+ effectiveGasPrice: BigInt(response.receipt.effectiveGasPrice)
95
+ },
96
+ logs: response.logs.map((log) => ({
97
+ data: log.data,
98
+ blockNumber: BigInt(log.blockNumber),
99
+ blockHash: log.blockHash,
100
+ transactionHash: log.transactionHash,
101
+ logIndex: BigInt(log.logIndex),
102
+ transactionIndex: BigInt(log.transactionIndex),
103
+ address: log.address,
104
+ topics: log.topics
105
+ }))
106
+ }
107
+
108
+ return userOperationReceipt
109
+ }