permissionless 0.0.2 → 0.0.4

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 (82) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/_cjs/actions/bundler.js +6 -5
  3. package/_cjs/actions/bundler.js.map +1 -1
  4. package/_cjs/actions/index.js +3 -2
  5. package/_cjs/actions/index.js.map +1 -1
  6. package/_cjs/actions/pimlico.js +55 -0
  7. package/_cjs/actions/pimlico.js.map +1 -0
  8. package/_cjs/actions/utils.js +5 -1
  9. package/_cjs/actions/utils.js.map +1 -1
  10. package/_cjs/clients/bundler.js +17 -0
  11. package/_cjs/clients/bundler.js.map +1 -0
  12. package/_cjs/clients/index.js +6 -0
  13. package/_cjs/clients/index.js.map +1 -0
  14. package/_cjs/clients/pimlico.js +29 -0
  15. package/_cjs/clients/pimlico.js.map +1 -0
  16. package/_cjs/index.js +2 -0
  17. package/_cjs/index.js.map +1 -1
  18. package/_cjs/types/pimlico.js +3 -0
  19. package/_cjs/types/pimlico.js.map +1 -0
  20. package/_cjs/utils/index.js +38 -0
  21. package/_cjs/utils/index.js.map +1 -0
  22. package/_esm/actions/bundler.js +14 -147
  23. package/_esm/actions/bundler.js.map +1 -1
  24. package/_esm/actions/index.js +2 -2
  25. package/_esm/actions/index.js.map +1 -1
  26. package/_esm/actions/pimlico.js +124 -0
  27. package/_esm/actions/pimlico.js.map +1 -0
  28. package/_esm/actions/utils.js +4 -0
  29. package/_esm/actions/utils.js.map +1 -1
  30. package/_esm/clients/bundler.js +32 -0
  31. package/_esm/clients/bundler.js.map +1 -0
  32. package/_esm/clients/index.js +3 -0
  33. package/_esm/clients/index.js.map +1 -0
  34. package/_esm/clients/pimlico.js +62 -0
  35. package/_esm/clients/pimlico.js.map +1 -0
  36. package/_esm/index.js +2 -0
  37. package/_esm/index.js.map +1 -1
  38. package/_esm/types/pimlico.js +2 -0
  39. package/_esm/types/pimlico.js.map +1 -0
  40. package/_esm/utils/index.js +56 -0
  41. package/_esm/utils/index.js.map +1 -0
  42. package/_types/actions/bundler.d.ts +116 -27
  43. package/_types/actions/bundler.d.ts.map +1 -1
  44. package/_types/actions/index.d.ts +4 -2
  45. package/_types/actions/index.d.ts.map +1 -1
  46. package/_types/actions/pimlico.d.ts +178 -0
  47. package/_types/actions/pimlico.d.ts.map +1 -0
  48. package/_types/actions/utils.d.ts +4 -0
  49. package/_types/actions/utils.d.ts.map +1 -1
  50. package/_types/clients/bundler.d.ts +38 -0
  51. package/_types/clients/bundler.d.ts.map +1 -0
  52. package/_types/clients/index.d.ts +3 -0
  53. package/_types/clients/index.d.ts.map +1 -0
  54. package/_types/clients/pimlico.d.ts +73 -0
  55. package/_types/clients/pimlico.d.ts.map +1 -0
  56. package/_types/index.d.ts +2 -0
  57. package/_types/index.d.ts.map +1 -1
  58. package/_types/types/bundler.d.ts +4 -37
  59. package/_types/types/bundler.d.ts.map +1 -1
  60. package/_types/types/index.d.ts +1 -2
  61. package/_types/types/index.d.ts.map +1 -1
  62. package/_types/types/pimlico.d.ts +50 -0
  63. package/_types/types/pimlico.d.ts.map +1 -0
  64. package/_types/types/userOperation.d.ts +1 -0
  65. package/_types/types/userOperation.d.ts.map +1 -1
  66. package/_types/utils/index.d.ts +31 -0
  67. package/_types/utils/index.d.ts.map +1 -0
  68. package/actions/bundler.ts +87 -35
  69. package/actions/index.ts +25 -8
  70. package/actions/pimlico.ts +252 -0
  71. package/actions/utils.ts +5 -0
  72. package/clients/bundler.ts +38 -0
  73. package/clients/index.ts +3 -0
  74. package/clients/pimlico.ts +91 -0
  75. package/index.ts +2 -0
  76. package/package.json +23 -3
  77. package/tsconfig.build.tsbuildinfo +1 -1
  78. package/types/bundler.ts +4 -39
  79. package/types/index.ts +1 -2
  80. package/types/pimlico.ts +55 -0
  81. package/types/userOperation.ts +2 -0
  82. package/utils/index.ts +70 -0
@@ -0,0 +1,124 @@
1
+ import { deepHexlify } from "./utils";
2
+ /**
3
+ * Returns the live gas prices that you can use to send a user operation.
4
+ *
5
+ * - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationGasPrice
6
+ *
7
+ * @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
8
+ * @returns slow, standard & fast values for maxFeePerGas & maxPriorityFeePerGas
9
+ *
10
+ *
11
+ * @example
12
+ * import { createClient } from "viem"
13
+ * import { getUserOperationGasPrice } from "permissionless/actions"
14
+ *
15
+ * const bundlerClient = createClient({
16
+ * chain: goerli,
17
+ * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
18
+ * })
19
+ *
20
+ * await getUserOperationGasPrice(bundlerClient)
21
+ *
22
+ */
23
+ export const getUserOperationGasPrice = async (client) => {
24
+ const gasPrices = await client.request({
25
+ method: "pimlico_getUserOperationGasPrice",
26
+ params: []
27
+ });
28
+ return {
29
+ slow: {
30
+ maxFeePerGas: BigInt(gasPrices.slow.maxFeePerGas),
31
+ maxPriorityFeePerGas: BigInt(gasPrices.slow.maxPriorityFeePerGas)
32
+ },
33
+ standard: {
34
+ maxFeePerGas: BigInt(gasPrices.standard.maxFeePerGas),
35
+ maxPriorityFeePerGas: BigInt(gasPrices.standard.maxPriorityFeePerGas)
36
+ },
37
+ fast: {
38
+ maxFeePerGas: BigInt(gasPrices.fast.maxFeePerGas),
39
+ maxPriorityFeePerGas: BigInt(gasPrices.fast.maxPriorityFeePerGas)
40
+ }
41
+ };
42
+ };
43
+ /**
44
+ * Returns the status of the userOperation that is pending in the mempool.
45
+ *
46
+ * - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationStatus
47
+ *
48
+ * @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
49
+ * @param hash {@link Hash} UserOpHash that you must have received from sendUserOperation.
50
+ * @returns status & transaction hash if included {@link GetUserOperationStatusReturnType}
51
+ *
52
+ *
53
+ * @example
54
+ * import { createClient } from "viem"
55
+ * import { getUserOperationStatus } from "permissionless/actions"
56
+ *
57
+ * const bundlerClient = createClient({
58
+ * chain: goerli,
59
+ * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
60
+ * })
61
+ *
62
+ * await getUserOperationStatus(bundlerClient, { hash: userOpHash })
63
+ *
64
+ */
65
+ export const getUserOperationStatus = async (client, { hash }) => {
66
+ return client.request({
67
+ method: "pimlico_getUserOperationStatus",
68
+ params: [hash]
69
+ });
70
+ };
71
+ export const pimlicoBundlerActions = (client) => ({
72
+ getUserOperationGasPrice: async () => getUserOperationGasPrice(client),
73
+ getUserOperationStatus: async (args) => getUserOperationStatus(client, args)
74
+ });
75
+ /**
76
+ * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
77
+ *
78
+ * - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/sponsorUserOperation
79
+ *
80
+ * @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
81
+ * @param args {@link sponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
82
+ * @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
83
+ *
84
+ *
85
+ * @example
86
+ * import { createClient } from "viem"
87
+ * import { sponsorUserOperation } from "permissionless/actions"
88
+ *
89
+ * const bundlerClient = createClient({
90
+ * chain: goerli,
91
+ * transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
92
+ * })
93
+ *
94
+ * await sponsorUserOperation(bundlerClient, {
95
+ * userOperation: userOperationWithDummySignature,
96
+ * entryPoint: entryPoint
97
+ * }})
98
+ *
99
+ */
100
+ export const sponsorUserOperation = async (client, args) => {
101
+ const response = await client.request({
102
+ method: "pm_sponsorUserOperation",
103
+ params: [deepHexlify(args.userOperation), args.entryPoint]
104
+ });
105
+ return {
106
+ paymasterAndData: response.paymasterAndData,
107
+ preVerificationGas: BigInt(response.preVerificationGas),
108
+ verificationGasLimit: BigInt(response.verificationGasLimit),
109
+ callGasLimit: BigInt(response.callGasLimit)
110
+ };
111
+ };
112
+ export const pimlicoPaymasterActions = (client) => ({
113
+ sponsorUserOperation: async (args) => sponsorUserOperation(client, args)
114
+ });
115
+ /**
116
+ * TODO: Add support for pimlicoActions after we support all the actions of v1 in v2 of the Pimlico API.
117
+ */
118
+ // export const pimlicoActions = (client: Client) => {
119
+ // return {
120
+ // ...pimlicoBundlerActions(client),
121
+ // ...pimlicoPaymasterActions(client)
122
+ // }
123
+ // }
124
+ //# sourceMappingURL=pimlico.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAsCrC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,EACzC,MAA4B,EACe,EAAE;IAC7C,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QACnC,MAAM,EAAE,kCAAkC;QAC1C,MAAM,EAAE,EAAE;KACb,CAAC,CAAA;IAEF,OAAO;QACH,IAAI,EAAE;YACF,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC;YACjD,oBAAoB,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB,CAAC;SACpE;QACD,QAAQ,EAAE;YACN,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC;YACrD,oBAAoB,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,oBAAoB,CAAC;SACxE;QACD,IAAI,EAAE;YACF,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC;YACjD,oBAAoB,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB,CAAC;SACpE;K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,KAAK,EAAE,IAAoC,EAAE,EAAE,CACjE,oBAAoB,CAAC,MAAgC,EAAE,IAAI,CAAC;CACnE,CAAC,CAAA;AAEF;;GAEG;AACH,sDAAsD;AACtD,eAAe;AACf,4CAA4C;AAC5C,6CAA6C;AAC7C,QAAQ;AACR,IAAI"}
@@ -1,4 +1,8 @@
1
1
  import { toHex } from "viem";
2
+ export const transactionReceiptStatus = {
3
+ "0x0": "reverted",
4
+ "0x1": "success"
5
+ };
2
6
  // biome-ignore lint/suspicious/noExplicitAny: it's a recursive function, so it's hard to type
3
7
  export function deepHexlify(obj) {
4
8
  if (typeof obj === "function") {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../actions/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAE5B,8FAA8F;AAC9F,MAAM,UAAU,WAAW,CAAC,GAAQ;IAChC,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;QAC3B,OAAO,SAAS,CAAA;KACnB;IACD,IAAI,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,SAAS,EAAE;QACpE,OAAO,GAAG,CAAA;KACb;SAAM,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAChC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAA;KACpB;SAAM,IAAI,GAAG,CAAC,YAAY,IAAI,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC5D,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;KAC1C;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACpB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAA;KAClD;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,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AG;QACN,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KAC/B,CAAC,EACF,EAAE,CACL,CAAA;AACL,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { createClient } from "viem";
2
+ import { bundlerActions } from "../actions";
3
+ /**
4
+ * Creates a EIP-4337 compliant Bundler Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
5
+ *
6
+ * - Docs: https://docs.pimlico.io/permissionless/reference/clients/bundlerClient
7
+ *
8
+ * A Bundler Client is an interface to "erc 4337" [JSON-RPC API](https://eips.ethereum.org/EIPS/eip-4337#rpc-methods-eth-namespace) methods such as sending user operation, estimating gas for a user operation, get user operation receipt, etc through Bundler Actions.
9
+ *
10
+ * @param config - {@link PublicClientConfig}
11
+ * @returns A Bundler Client. {@link BundlerClient}
12
+ *
13
+ * @example
14
+ * import { createPublicClient, http } from 'viem'
15
+ * import { mainnet } from 'viem/chains'
16
+ *
17
+ * const bundlerClient = createBundlerClient({
18
+ * chain: mainnet,
19
+ * transport: http(BUNDLER_URL),
20
+ * })
21
+ */
22
+ export const createBundlerClient = (parameters) => {
23
+ const { key = "public", name = "Bundler Client" } = parameters;
24
+ const client = createClient({
25
+ ...parameters,
26
+ key,
27
+ name,
28
+ type: "bundlerClient"
29
+ });
30
+ return client.extend(bundlerActions);
31
+ };
32
+ //# sourceMappingURL=bundler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../clients/bundler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAK3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAC/B,UAAgD,EACnC,EAAE;IACf,MAAM,EAAE,GAAG,GAAG,QAAQ,EAAE,IAAI,GAAG,gBAAgB,EAAE,GAAG,UAAU,CAAA;IAC9D,MAAM,MAAM,GAAG,YAAY,CAAC;QACxB,GAAG,UAAU;QACb,GAAG;QACH,IAAI;QACJ,IAAI,EAAE,eAAe;KACxB,CAAC,CAAA;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAA;AACxC,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { createBundlerClient } from "./bundler";
2
+ export { createBundlerClient };
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../clients/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAEnE,OAAO,EAAE,mBAAmB,EAAsB,CAAA"}
@@ -0,0 +1,62 @@
1
+ import { createClient } from "viem";
2
+ import { bundlerActions } from "../actions";
3
+ import { pimlicoBundlerActions, pimlicoPaymasterActions } from "../actions/pimlico";
4
+ /**
5
+ * Creates a pimlico specific Bundler Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
6
+ *
7
+ * - Docs: https://docs.pimlico.io/permissionless/reference/clients/pimlicoBundlerClient
8
+ *
9
+ * A Pimlico Client is an interface to "pimlico endpoints" [JSON-RPC API](https://docs.pimlico.io/reference/bundler/endpoints) methods such as getting current blockchain gas prices, getting user operation status, etc through [Pimlico Bundler Actions](TODO://Add bundler action documentation link).
10
+ *
11
+ * @param config - {@link PublicClientConfig}
12
+ * @returns A Pimlico Bundler Client. {@link PimlicoBundlerClient}
13
+ *
14
+ * @example
15
+ * import { createPublicClient, http } from 'viem'
16
+ * import { mainnet } from 'viem/chains'
17
+ *
18
+ * const pimlicoBundlerClient = createPimlicoBundlerClient({
19
+ * chain: mainnet,
20
+ * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE"),
21
+ * })
22
+ */
23
+ export const createPimlicoBundlerClient = (parameters) => {
24
+ const { key = "public", name = "Pimlico Bundler Client" } = parameters;
25
+ const client = createClient({
26
+ ...parameters,
27
+ key,
28
+ name,
29
+ type: "pimlicoBundlerClient"
30
+ });
31
+ return client.extend(bundlerActions).extend(pimlicoBundlerActions);
32
+ };
33
+ /**
34
+ * Creates a pimlico 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).
35
+ *
36
+ * - Docs: https://docs.pimlico.io/permissionless/reference/clients/pimlicoPaymasterClient
37
+ *
38
+ * A Pimlico Paymaster Client is an interface to "pimlico paymaster endpoints" [JSON-RPC API](https://docs.pimlico.io/reference/verifying-paymaster/endpoints) methods such as sponsoring user operation, etc through Pimlico Paymaster Actions.
39
+ *
40
+ * @param config - {@link PublicClientConfig}
41
+ * @returns A Pimlico Paymaster Client. {@link PimlicoPaymasterClient}
42
+ *
43
+ * @example
44
+ * import { createPublicClient, http } from 'viem'
45
+ * import { mainnet } from 'viem/chains'
46
+ *
47
+ * const pimlicoPaymasterClient = createPimlicoPaymasterClient({
48
+ * chain: mainnet,
49
+ * transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE"),
50
+ * })
51
+ */
52
+ export const createPimlicoPaymasterClient = (parameters) => {
53
+ const { key = "public", name = "Pimlico Paymaster Client" } = parameters;
54
+ const client = createClient({
55
+ ...parameters,
56
+ key,
57
+ name,
58
+ type: "pimlicoPaymasterClient"
59
+ });
60
+ return client.extend(pimlicoPaymasterActions);
61
+ };
62
+ //# sourceMappingURL=pimlico.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../clients/pimlico.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,EAGH,qBAAqB,EACrB,uBAAuB,EAC1B,MAAM,oBAAoB,CAAA;AAmB3B;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACtC,UAAgD,EAC5B,EAAE;IACtB,MAAM,EAAE,GAAG,GAAG,QAAQ,EAAE,IAAI,GAAG,wBAAwB,EAAE,GAAG,UAAU,CAAA;IACtE,MAAM,MAAM,GAAG,YAAY,CAAC;QACxB,GAAG,UAAU;QACb,GAAG;QACH,IAAI;QACJ,IAAI,EAAE,sBAAsB;KAC/B,CAAC,CAAA;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAA;AACtE,CAAC,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CACxC,UAAgD,EAC1B,EAAE;IACxB,MAAM,EAAE,GAAG,GAAG,QAAQ,EAAE,IAAI,GAAG,0BAA0B,EAAE,GAAG,UAAU,CAAA;IACxE,MAAM,MAAM,GAAG,YAAY,CAAC;QACxB,GAAG,UAAU;QACb,GAAG;QACH,IAAI;QACJ,IAAI,EAAE,wBAAwB;KACjC,CAAC,CAAA;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAA;AACjD,CAAC,CAAA"}
package/_esm/index.js CHANGED
@@ -1,3 +1,5 @@
1
1
  export * from "./actions";
2
+ export * from "./clients";
2
3
  export * from "./types";
4
+ export * from "./utils";
3
5
  //# sourceMappingURL=index.js.map
package/_esm/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=pimlico.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../types/pimlico.ts"],"names":[],"mappings":""}
@@ -0,0 +1,56 @@
1
+ import { encodeAbiParameters, keccak256 } from "viem";
2
+ function packUserOp({ userOperation }) {
3
+ const hashedInitCode = keccak256(userOperation.initCode);
4
+ const hashedCallData = keccak256(userOperation.callData);
5
+ const hashedPaymasterAndData = keccak256(userOperation.paymasterAndData);
6
+ return encodeAbiParameters([
7
+ { type: "address" },
8
+ { type: "uint256" },
9
+ { type: "bytes32" },
10
+ { type: "bytes32" },
11
+ { type: "uint256" },
12
+ { type: "uint256" },
13
+ { type: "uint256" },
14
+ { type: "uint256" },
15
+ { type: "uint256" },
16
+ { type: "bytes32" }
17
+ ], [
18
+ userOperation.sender,
19
+ userOperation.nonce,
20
+ hashedInitCode,
21
+ hashedCallData,
22
+ userOperation.callGasLimit,
23
+ userOperation.verificationGasLimit,
24
+ userOperation.preVerificationGas,
25
+ userOperation.maxFeePerGas,
26
+ userOperation.maxPriorityFeePerGas,
27
+ hashedPaymasterAndData
28
+ ]);
29
+ }
30
+ /**
31
+ *
32
+ * Returns user operation hash that is a unique identifier of the user operation.
33
+ *
34
+ * - Docs: https://docs.pimlico.io/permissionless/reference/utils/getUserOperationHash
35
+ *
36
+ * @param args: userOperation, entryPoint, chainId as {@link GetUserOperationHashParams}
37
+ * @returns userOperationHash as {@link Hash}
38
+ *
39
+ * @example
40
+ * import { getUserOperationHash } from "permissionless/utils"
41
+ *
42
+ * const userOperationHash = getUserOperationHash({
43
+ * userOperation,
44
+ * entryPoint,
45
+ * chainId
46
+ * })
47
+ *
48
+ * // Returns "0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34"
49
+ *
50
+ */
51
+ const getUserOperationHash = ({ userOperation, entryPoint, chainId }) => {
52
+ const encoded = encodeAbiParameters([{ type: "bytes32" }, { type: "address" }, { type: "uint256" }], [keccak256(packUserOp({ userOperation })), entryPoint, BigInt(chainId)]);
53
+ return keccak256(encoded);
54
+ };
55
+ export { getUserOperationHash };
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAGrD,SAAS,UAAU,CAAC,EAAE,aAAa,EAAoC;IACnE,MAAM,cAAc,GAAG,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;IACxD,MAAM,cAAc,GAAG,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;IACxD,MAAM,sBAAsB,GAAG,SAAS,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAA;IAExE,OAAO,mBAAmB,CACtB;QACI,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;KACtB,EACD;QACI,aAAa,CAAC,MAAiB;QAC/B,aAAa,CAAC,KAAK;QACnB,cAAc;QACd,cAAc;QACd,aAAa,CAAC,YAAY;QAC1B,aAAa,CAAC,oBAAoB;QAClC,aAAa,CAAC,kBAAkB;QAChC,aAAa,CAAC,YAAY;QAC1B,aAAa,CAAC,oBAAoB;QAClC,sBAAsB;KACzB,CACJ,CAAA;AACL,CAAC;AAID;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,oBAAoB,GAAG,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAA8B,EAAQ,EAAE;IACtG,MAAM,OAAO,GAAG,mBAAmB,CAC/B,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAC/D,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CACzD,CAAA;IAElB,OAAO,SAAS,CAAC,OAAO,CAAC,CAAA;AAC7B,CAAC,CAAA;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
@@ -1,8 +1,9 @@
1
1
  import type { Address } from "abitype";
2
- import type { Client, Hash } from "viem";
2
+ import type { Client, Hash, Hex } from "viem";
3
3
  import type { PartialBy } from "viem/types/utils";
4
- import type { UserOperation, UserOperationReceipt } from "../types";
5
- import type { BundlerClient } from "../types/bundler";
4
+ import type { BundlerClient } from "../clients/bundler";
5
+ import type { UserOperation } from "../types";
6
+ import type { TStatus } from "../types/userOperation";
6
7
  export type SendUserOperationParameters = {
7
8
  userOperation: UserOperation;
8
9
  entryPoint: Address;
@@ -16,12 +17,51 @@ export type EstimateUserOperationGasReturnType = {
16
17
  verificationGasLimit: bigint;
17
18
  callGasLimit: bigint;
18
19
  };
19
- export type GetUserOperationByHash = {
20
+ export type GetUserOperationByHashParameters = {
20
21
  hash: Hash;
21
22
  };
22
- export type GetUserOperationReceipt = {
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 = {
23
31
  hash: Hash;
24
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;
25
65
  /**
26
66
  * Sends user operation to the bundler
27
67
  *
@@ -62,7 +102,7 @@ export declare const sendUserOperation: (client: BundlerClient, args: SendUserOp
62
102
  *
63
103
  * @example
64
104
  * import { createClient } from "viem"
65
- * import { sendUserOperation } from "permissionless/actions"
105
+ * import { estimateUserOperationGas } from "permissionless/actions"
66
106
  *
67
107
  * const bundlerClient = createClient({
68
108
  * chain: goerli,
@@ -89,7 +129,7 @@ export declare const estimateUserOperationGas: (client: BundlerClient, args: Est
89
129
  *
90
130
  * @example
91
131
  * import { createClient } from "viem"
92
- * import { sendUserOperation } from "permissionless/actions"
132
+ * import { supportedEntryPoints } from "permissionless/actions"
93
133
  *
94
134
  * const bundlerClient = createClient({
95
135
  * chain: goerli,
@@ -112,31 +152,31 @@ export declare const supportedEntryPoints: (client: BundlerClient) => Promise<Ad
112
152
  *
113
153
  * @example
114
154
  * import { createClient } from "viem"
115
- * import { sendUserOperation } from "permissionless/actions"
155
+ * import { chainId } from "permissionless/actions"
116
156
  *
117
157
  * const bundlerClient = createClient({
118
158
  * chain: goerli,
119
159
  * transport: http(BUNDLER_URL)
120
160
  * })
121
161
  *
122
- * const chainId = chainId(bundlerClient)
162
+ * const bundlerChainId = chainId(bundlerClient)
123
163
  * // Return 5n for Goerli
124
164
  *
125
165
  */
126
- export declare const chainId: (client: BundlerClient) => Promise<bigint>;
166
+ export declare const chainId: (client: BundlerClient) => Promise<number>;
127
167
  /**
128
168
  * Returns the user operation from userOpHash
129
169
  *
130
170
  * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationByHash
131
171
  *
132
172
  * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
133
- * @param args {@link GetUserOperationByHash} UserOpHash that was returned by {@link sendUserOperation}
173
+ * @param args {@link GetUserOperationByHashParameters} UserOpHash that was returned by {@link sendUserOperation}
134
174
  * @returns userOperation along with entryPoint, transactionHash, blockHash, blockNumber if found or null
135
175
  *
136
176
  *
137
177
  * @example
138
178
  * import { createClient } from "viem"
139
- * import { sendUserOperation } from "permissionless/actions"
179
+ * import { getUserOperationByHash } from "permissionless/actions"
140
180
  *
141
181
  * const bundlerClient = createClient({
142
182
  * chain: goerli,
@@ -146,14 +186,68 @@ export declare const chainId: (client: BundlerClient) => Promise<bigint>;
146
186
  * getUserOperationByHash(bundlerClient, {hash: userOpHash})
147
187
  *
148
188
  */
149
- export declare const getUserOperationByHash: (client: BundlerClient, { hash }: GetUserOperationByHash) => Promise<{
189
+ export declare const getUserOperationByHash: (client: BundlerClient, { hash }: GetUserOperationByHashParameters) => Promise<{
150
190
  userOperation: UserOperation;
151
191
  entryPoint: Address;
152
192
  transactionHash: Hash;
153
193
  blockHash: Hash;
154
194
  blockNumber: bigint;
155
195
  } | null>;
156
- declare const bundlerActions: (client: Client) => {
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 = {
157
251
  /**
158
252
  *
159
253
  * Sends user operation to the bundler
@@ -169,7 +263,7 @@ declare const bundlerActions: (client: Client) => {
169
263
  *
170
264
  * const bundlerClient = createClient({
171
265
  * chain: goerli,
172
- * transport: http(BUNDLER_URL)
266
+ * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
173
267
  * }).extend(bundlerActions)
174
268
  *
175
269
  * const userOpHash = await bundlerClient.sendUserOperation({
@@ -248,7 +342,7 @@ declare const bundlerActions: (client: Client) => {
248
342
  * const chainId = await bundlerClient.chainId()
249
343
  * // Return 5n for Goerli
250
344
  */
251
- chainId: () => Promise<bigint>;
345
+ chainId: () => Promise<number>;
252
346
  /**
253
347
  *
254
348
  * Returns the user operation from userOpHash
@@ -270,21 +364,15 @@ declare const bundlerActions: (client: Client) => {
270
364
  * await bundlerClient.getUserOperationByHash(userOpHash)
271
365
  *
272
366
  */
273
- getUserOperationByHash: (args: GetUserOperationByHash) => Promise<{
274
- userOperation: UserOperation;
275
- entryPoint: Address;
276
- transactionHash: Hash;
277
- blockHash: Hash;
278
- blockNumber: bigint;
279
- } | null>;
367
+ getUserOperationByHash: (args: GetUserOperationByHashParameters) => Promise<GetUserOperationByHashReturnType>;
280
368
  /**
281
369
  *
282
370
  * Returns the user operation receipt from userOpHash
283
371
  *
284
372
  * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt
285
373
  *
286
- * @param args {@link GetUserOperationReceipt} UserOpHash that was returned by {@link sendUserOperation}
287
- * @returns user operation receipt {@link UserOperationReceipt} if found or null
374
+ * @param args {@link GetUserOperationReceiptParameters} UserOpHash that was returned by {@link sendUserOperation}
375
+ * @returns user operation receipt {@link GetUserOperationReceiptReturnType} if found or null
288
376
  *
289
377
  * @example
290
378
  * import { createClient } from "viem"
@@ -298,7 +386,8 @@ declare const bundlerActions: (client: Client) => {
298
386
  * await bundlerClient.getUserOperationReceipt({hash: userOpHash})
299
387
  *
300
388
  */
301
- getUserOperationReceipt: (args: GetUserOperationReceipt) => Promise<UserOperationReceipt | null>;
389
+ getUserOperationReceipt: (args: GetUserOperationReceiptParameters) => Promise<GetUserOperationReceiptReturnType>;
302
390
  };
303
- export default bundlerActions;
391
+ declare const bundlerActions: (client: Client) => BundlerActions;
392
+ export { bundlerActions };
304
393
  //# sourceMappingURL=bundler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../actions/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,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M,KAAG,cAWvC,CAAA;AAEF,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -1,3 +1,5 @@
1
- import bundlerActions, { type EstimateUserOperationGasParameters, type EstimateUserOperationGasReturnType, type SendUserOperationParameters, chainId, estimateUserOperationGas, getUserOperationByHash, sendUserOperation, supportedEntryPoints } from "./bundler";
2
- export { bundlerActions, type SendUserOperationParameters, type EstimateUserOperationGasParameters, type EstimateUserOperationGasReturnType, sendUserOperation, estimateUserOperationGas, supportedEntryPoints, chainId, getUserOperationByHash };
1
+ import type { EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType, GetUserOperationByHashParameters, GetUserOperationByHashReturnType, GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType, SendUserOperationParameters } from "./bundler";
2
+ import { bundlerActions, chainId, estimateUserOperationGas, getUserOperationByHash, getUserOperationReceipt, sendUserOperation, supportedEntryPoints } from "./bundler";
3
+ export type { SendUserOperationParameters, EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType, GetUserOperationByHashParameters, GetUserOperationByHashReturnType, GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType };
4
+ export { bundlerActions, sendUserOperation, estimateUserOperationGas, supportedEntryPoints, chainId, getUserOperationByHash, getUserOperationReceipt };
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,EAAE,EACnB,KAAK,kCAAkC,EACvC,KAAK,kCAAkC,EACvC,KAAK,2BAA2B,EAChC,OAAO,EACP,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,WAAW,CAAA;AAElB,OAAO,EACH,cAAc,EACd,KAAK,2BAA2B,EAChC,KAAK,kCAAkC,EACvC,KAAK,kCAAkC,EACvC,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,OAAO,EACP,sBAAsB,EACzB,CAAA"}
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,YAAY,EACR,2BAA2B,EAC3B,kCAAkC,EAClC,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,EACjC,iCAAiC,EACpC,CAAA;AAED,OAAO,EACH,cAAc,EACd,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,OAAO,EACP,sBAAsB,EACtB,uBAAuB,EAC1B,CAAA"}