permissionless 0.0.1 → 0.0.3

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 (92) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/_cjs/actions/bundler.js +118 -0
  3. package/_cjs/actions/bundler.js.map +1 -0
  4. package/_cjs/actions/index.js +12 -0
  5. package/_cjs/actions/index.js.map +1 -0
  6. package/_cjs/actions/pimlico.js +55 -0
  7. package/_cjs/actions/pimlico.js.map +1 -0
  8. package/_cjs/actions/utils.js +31 -0
  9. package/_cjs/actions/utils.js.map +1 -0
  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 +7 -0
  17. package/_cjs/index.js.map +1 -0
  18. package/_cjs/package.json +1 -0
  19. package/_cjs/types/bundler.js +3 -0
  20. package/_cjs/types/bundler.js.map +1 -0
  21. package/_cjs/types/index.js +3 -0
  22. package/_cjs/types/index.js.map +1 -0
  23. package/_cjs/types/pimlico.js +3 -0
  24. package/_cjs/types/pimlico.js.map +1 -0
  25. package/_cjs/types/userOperation.js +3 -0
  26. package/_cjs/types/userOperation.js.map +1 -0
  27. package/_esm/actions/bundler.js +251 -0
  28. package/_esm/actions/bundler.js.map +1 -0
  29. package/_esm/actions/index.js +3 -0
  30. package/_esm/actions/index.js.map +1 -0
  31. package/_esm/actions/pimlico.js +127 -0
  32. package/_esm/actions/pimlico.js.map +1 -0
  33. package/_esm/actions/utils.js +28 -0
  34. package/_esm/actions/utils.js.map +1 -0
  35. package/_esm/clients/bundler.js +33 -0
  36. package/_esm/clients/bundler.js.map +1 -0
  37. package/_esm/clients/index.js +3 -0
  38. package/_esm/clients/index.js.map +1 -0
  39. package/_esm/clients/pimlico.js +64 -0
  40. package/_esm/clients/pimlico.js.map +1 -0
  41. package/_esm/index.js +4 -0
  42. package/_esm/index.js.map +1 -0
  43. package/_esm/package.json +1 -0
  44. package/_esm/types/bundler.js +2 -0
  45. package/_esm/types/bundler.js.map +1 -0
  46. package/_esm/types/index.js +2 -0
  47. package/_esm/types/index.js.map +1 -0
  48. package/_esm/types/pimlico.js +2 -0
  49. package/_esm/types/pimlico.js.map +1 -0
  50. package/_esm/types/userOperation.js +2 -0
  51. package/_esm/types/userOperation.js.map +1 -0
  52. package/_types/actions/bundler.d.ts +393 -0
  53. package/_types/actions/bundler.d.ts.map +1 -0
  54. package/_types/actions/index.d.ts +5 -0
  55. package/_types/actions/index.d.ts.map +1 -0
  56. package/_types/actions/pimlico.d.ts +184 -0
  57. package/_types/actions/pimlico.d.ts.map +1 -0
  58. package/_types/actions/utils.d.ts +6 -0
  59. package/_types/actions/utils.d.ts.map +1 -0
  60. package/_types/clients/bundler.d.ts +39 -0
  61. package/_types/clients/bundler.d.ts.map +1 -0
  62. package/_types/clients/index.d.ts +3 -0
  63. package/_types/clients/index.d.ts.map +1 -0
  64. package/_types/clients/pimlico.d.ts +75 -0
  65. package/_types/clients/pimlico.d.ts.map +1 -0
  66. package/_types/index.d.ts +4 -0
  67. package/_types/index.d.ts.map +1 -0
  68. package/_types/types/bundler.d.ts +82 -0
  69. package/_types/types/bundler.d.ts.map +1 -0
  70. package/_types/types/index.d.ts +3 -0
  71. package/_types/types/index.d.ts.map +1 -0
  72. package/_types/types/pimlico.d.ts +50 -0
  73. package/_types/types/pimlico.d.ts.map +1 -0
  74. package/_types/types/userOperation.d.ts +30 -0
  75. package/_types/types/userOperation.d.ts.map +1 -0
  76. package/actions/bundler.ts +498 -0
  77. package/actions/index.ts +38 -0
  78. package/actions/package.json +6 -0
  79. package/actions/pimlico.ts +258 -0
  80. package/actions/utils.ts +30 -0
  81. package/clients/bundler.ts +39 -0
  82. package/clients/index.ts +3 -0
  83. package/clients/pimlico.ts +93 -0
  84. package/index.ts +3 -0
  85. package/package.json +49 -11
  86. package/tsconfig.build.tsbuildinfo +1 -0
  87. package/types/bundler.ts +85 -0
  88. package/types/index.ts +3 -0
  89. package/types/package.json +6 -0
  90. package/types/pimlico.ts +55 -0
  91. package/types/userOperation.ts +32 -0
  92. package/LICENSE +0 -21
@@ -0,0 +1,127 @@
1
+ import { deepHexlify } from "./utils";
2
+ /**
3
+ * Returns the live gas prices that you can use to send a user operation.
4
+ *
5
+ * - Docs: [TODO://add link]
6
+ * - Example: [TODO://add link]
7
+ *
8
+ * @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
9
+ * @returns slow, standard & fast values for maxFeePerGas & maxPriorityFeePerGas
10
+ *
11
+ *
12
+ * @example
13
+ * import { createClient } from "viem"
14
+ * import { getUserOperationGasPrice } from "permissionless/actions"
15
+ *
16
+ * const bundlerClient = createClient({
17
+ * chain: goerli,
18
+ * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
19
+ * })
20
+ *
21
+ * await getUserOperationGasPrice(bundlerClient)
22
+ *
23
+ */
24
+ export const getUserOperationGasPrice = async (client) => {
25
+ const gasPrices = await client.request({
26
+ method: "pimlico_getUserOperationGasPrice",
27
+ params: []
28
+ });
29
+ return {
30
+ slow: {
31
+ maxFeePerGas: BigInt(gasPrices.slow.maxFeePerGas),
32
+ maxPriorityFeePerGas: BigInt(gasPrices.slow.maxPriorityFeePerGas)
33
+ },
34
+ standard: {
35
+ maxFeePerGas: BigInt(gasPrices.standard.maxFeePerGas),
36
+ maxPriorityFeePerGas: BigInt(gasPrices.standard.maxPriorityFeePerGas)
37
+ },
38
+ fast: {
39
+ maxFeePerGas: BigInt(gasPrices.fast.maxFeePerGas),
40
+ maxPriorityFeePerGas: BigInt(gasPrices.fast.maxPriorityFeePerGas)
41
+ }
42
+ };
43
+ };
44
+ /**
45
+ * Returns the status of the userOperation that is pending in the mempool.
46
+ *
47
+ * - Docs: [TODO://add link]
48
+ * - Example: [TODO://add link]
49
+ *
50
+ * @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
51
+ * @param hash {@link Hash} UserOpHash that you must have received from sendUserOperation.
52
+ * @returns status & transaction hash if included {@link GetUserOperationStatusReturnType}
53
+ *
54
+ *
55
+ * @example
56
+ * import { createClient } from "viem"
57
+ * import { getUserOperationStatus } from "permissionless/actions"
58
+ *
59
+ * const bundlerClient = createClient({
60
+ * chain: goerli,
61
+ * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
62
+ * })
63
+ *
64
+ * await getUserOperationStatus(bundlerClient, { hash: userOpHash })
65
+ *
66
+ */
67
+ export const getUserOperationStatus = async (client, { hash }) => {
68
+ return client.request({
69
+ method: "pimlico_getUserOperationStatus",
70
+ params: [hash]
71
+ });
72
+ };
73
+ export const pimlicoBundlerActions = (client) => ({
74
+ getUserOperationGasPrice: async () => getUserOperationGasPrice(client),
75
+ getUserOperationStatus: async (args) => getUserOperationStatus(client, args)
76
+ });
77
+ /**
78
+ * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
79
+ *
80
+ * - Docs: [TODO://add link]
81
+ * - Example: [TODO://add link]
82
+ *
83
+ * @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
84
+ * @param args {@link sponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
85
+ * @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
86
+ *
87
+ *
88
+ * @example
89
+ * import { createClient } from "viem"
90
+ * import { sponsorUserOperation } from "permissionless/actions"
91
+ *
92
+ * const bundlerClient = createClient({
93
+ * chain: goerli,
94
+ * transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
95
+ * })
96
+ *
97
+ * await sponsorUserOperation(bundlerClient, {
98
+ * userOperation: userOperationWithDummySignature,
99
+ * entryPoint: entryPoint
100
+ * }})
101
+ *
102
+ */
103
+ export const sponsorUserOperation = async (client, args) => {
104
+ const response = await client.request({
105
+ method: "pm_sponsorUserOperation",
106
+ params: [deepHexlify(args.userOperation), args.entryPoint]
107
+ });
108
+ return {
109
+ paymasterAndData: response.paymasterAndData,
110
+ preVerificationGas: BigInt(response.preVerificationGas),
111
+ verificationGasLimit: BigInt(response.verificationGasLimit),
112
+ callGasLimit: BigInt(response.callGasLimit)
113
+ };
114
+ };
115
+ export const pimlicoPaymasterActions = (client) => ({
116
+ sponsorUserOperation: async (args) => sponsorUserOperation(client, args)
117
+ });
118
+ /**
119
+ * TODO: Add support for pimlicoActions after we support all the actions of v1 in v2 of the Pimlico API.
120
+ */
121
+ // export const pimlicoActions = (client: Client) => {
122
+ // return {
123
+ // ...pimlicoBundlerActions(client),
124
+ // ...pimlicoPaymasterActions(client)
125
+ // }
126
+ // }
127
+ //# 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;;;;;;;;;;;;;;;;;;;;;GAqBG;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;KACJ,CAAA;AACL,CAAC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EACvC,MAA4B,EAC5B,EAAE,IAAI,EAAoC,EACD,EAAE;IAC3C,OAAO,MAAM,CAAC,OAAO,CAAC;QAClB,MAAM,EAAE,gCAAgC;QACxC,MAAM,EAAE,CAAC,IAAI,CAAC;KACjB,CAAC,CAAA;AACN,CAAC,CAAA;AA+CD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAc,EAAyB,EAAE,CAAC,CAAC;IAC7E,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAAC,wBAAwB,CAAC,MAA8B,CAAC;IAC9F,sBAAsB,EAAE,KAAK,EAAE,IAAsC,EAAE,EAAE,CACrE,sBAAsB,CAAC,MAA8B,EAAE,IAAI,CAAC;CACnE,CAAC,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EACrC,MAA8B,EAC9B,IAAoC,EACG,EAAE;IACzC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,yBAAyB;QACjC,MAAM,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAiC,EAAE,IAAI,CAAC,UAAU,CAAC;KAC7F,CAAC,CAAA;IAEF,OAAO;QACH,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;QAC3C,kBAAkB,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QACvD,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAC3D,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;KAC9C,CAAA;AACL,CAAC,CAAA;AA8BD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAc,EAAiC,EAAE,CAAC,CAAC;IACvF,oBAAoB,EAAE,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"}
@@ -0,0 +1,28 @@
1
+ import { toHex } from "viem";
2
+ export const transactionReceiptStatus = {
3
+ "0x0": "reverted",
4
+ "0x1": "success"
5
+ };
6
+ // biome-ignore lint/suspicious/noExplicitAny: it's a recursive function, so it's hard to type
7
+ export function deepHexlify(obj) {
8
+ if (typeof obj === "function") {
9
+ return undefined;
10
+ }
11
+ if (obj == null || typeof obj === "string" || typeof obj === "boolean") {
12
+ return obj;
13
+ }
14
+ else if (typeof obj === "bigint") {
15
+ return toHex(obj);
16
+ }
17
+ else if (obj._isBigNumber != null || typeof obj !== "object") {
18
+ return toHex(obj).replace(/^0x0/, "0x");
19
+ }
20
+ if (Array.isArray(obj)) {
21
+ return obj.map((member) => deepHexlify(member));
22
+ }
23
+ return Object.keys(obj).reduce((set, key) => ({
24
+ ...set,
25
+ [key]: deepHexlify(obj[key])
26
+ }), {});
27
+ }
28
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../actions/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAE5B,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACpC,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,SAAS;CACV,CAAA;AAEV,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,GAAG,CAAC,CAAC,MAAM,CAC1B,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACX,GAAG,GAAG;QACN,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KAC/B,CAAC,EACF,EAAE,CACL,CAAA;AACL,CAAC"}
@@ -0,0 +1,33 @@
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: [TODO://add link]
7
+ * - Example: [TODO://add link]
8
+ *
9
+ * 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](TODO://Add bundler action documentation link).
10
+ *
11
+ * @param config - {@link PublicClientConfig}
12
+ * @returns A Bundler Client. {@link BundlerClient}
13
+ *
14
+ * @example
15
+ * import { createPublicClient, http } from 'viem'
16
+ * import { mainnet } from 'viem/chains'
17
+ *
18
+ * const bundlerClient = createBundlerClient({
19
+ * chain: mainnet,
20
+ * transport: http(BUNDLER_URL),
21
+ * })
22
+ */
23
+ export const createBundlerClient = (parameters) => {
24
+ const { key = "public", name = "Bundler Client" } = parameters;
25
+ const client = createClient({
26
+ ...parameters,
27
+ key,
28
+ name,
29
+ type: "bundlerClient"
30
+ });
31
+ return client.extend(bundlerActions);
32
+ };
33
+ //# 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;;;;;;;;;;;;;;;;;;;GAmBG;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,64 @@
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: [TODO://add link]
8
+ * - Example: [TODO://add link]
9
+ *
10
+ * 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).
11
+ *
12
+ * @param config - {@link PublicClientConfig}
13
+ * @returns A Pimlico Bundler Client. {@link PimlicoBundlerClient}
14
+ *
15
+ * @example
16
+ * import { createPublicClient, http } from 'viem'
17
+ * import { mainnet } from 'viem/chains'
18
+ *
19
+ * const pimlicoBundlerClient = createPimlicoBundlerClient({
20
+ * chain: mainnet,
21
+ * transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE"),
22
+ * })
23
+ */
24
+ export const createPimlicoBundlerClient = (parameters) => {
25
+ const { key = "public", name = "Pimlico Bundler Client" } = parameters;
26
+ const client = createClient({
27
+ ...parameters,
28
+ key,
29
+ name,
30
+ type: "pimlicoBundlerClient"
31
+ });
32
+ return client.extend(bundlerActions).extend(pimlicoBundlerActions);
33
+ };
34
+ /**
35
+ * 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).
36
+ *
37
+ * - Docs: [TODO://add link]
38
+ * - Example: [TODO://add link]
39
+ *
40
+ * 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](TODO://Add bundler action documentation link).
41
+ *
42
+ * @param config - {@link PublicClientConfig}
43
+ * @returns A Pimlico Paymaster Client. {@link PimlicoPaymasterClient}
44
+ *
45
+ * @example
46
+ * import { createPublicClient, http } from 'viem'
47
+ * import { mainnet } from 'viem/chains'
48
+ *
49
+ * const pimlicoPaymasterClient = createPimlicoPaymasterClient({
50
+ * chain: mainnet,
51
+ * transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE"),
52
+ * })
53
+ */
54
+ export const createPimlicoPaymasterClient = (parameters) => {
55
+ const { key = "public", name = "Pimlico Paymaster Client" } = parameters;
56
+ const client = createClient({
57
+ ...parameters,
58
+ key,
59
+ name,
60
+ type: "pimlicoPaymasterClient"
61
+ });
62
+ return client.extend(pimlicoPaymasterActions);
63
+ };
64
+ //# 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;;;;;;;;;;;;;;;;;;;GAmBG;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;;;;;;;;;;;;;;;;;;;GAmBG;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 ADDED
@@ -0,0 +1,4 @@
1
+ export * from "./actions";
2
+ export * from "./clients";
3
+ export * from "./types";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA"}
@@ -0,0 +1 @@
1
+ {"type": "module","sideEffects":false}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=bundler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../types/bundler.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":""}
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=userOperation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userOperation.js","sourceRoot":"","sources":["../../types/userOperation.ts"],"names":[],"mappings":""}