permissionless 0.0.1 → 0.0.2

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 (57) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/_cjs/actions/bundler.js +117 -0
  3. package/_cjs/actions/bundler.js.map +1 -0
  4. package/_cjs/actions/index.js +11 -0
  5. package/_cjs/actions/index.js.map +1 -0
  6. package/_cjs/actions/utils.js +27 -0
  7. package/_cjs/actions/utils.js.map +1 -0
  8. package/_cjs/index.js +6 -0
  9. package/_cjs/index.js.map +1 -0
  10. package/_cjs/package.json +1 -0
  11. package/_cjs/types/bundler.js +3 -0
  12. package/_cjs/types/bundler.js.map +1 -0
  13. package/_cjs/types/index.js +3 -0
  14. package/_cjs/types/index.js.map +1 -0
  15. package/_cjs/types/userOperation.js +3 -0
  16. package/_cjs/types/userOperation.js.map +1 -0
  17. package/_esm/actions/bundler.js +384 -0
  18. package/_esm/actions/bundler.js.map +1 -0
  19. package/_esm/actions/index.js +3 -0
  20. package/_esm/actions/index.js.map +1 -0
  21. package/_esm/actions/utils.js +24 -0
  22. package/_esm/actions/utils.js.map +1 -0
  23. package/_esm/index.js +3 -0
  24. package/_esm/index.js.map +1 -0
  25. package/_esm/package.json +1 -0
  26. package/_esm/types/bundler.js +2 -0
  27. package/_esm/types/bundler.js.map +1 -0
  28. package/_esm/types/index.js +2 -0
  29. package/_esm/types/index.js.map +1 -0
  30. package/_esm/types/userOperation.js +2 -0
  31. package/_esm/types/userOperation.js.map +1 -0
  32. package/_types/actions/bundler.d.ts +304 -0
  33. package/_types/actions/bundler.d.ts.map +1 -0
  34. package/_types/actions/index.d.ts +3 -0
  35. package/_types/actions/index.d.ts.map +1 -0
  36. package/_types/actions/utils.d.ts +2 -0
  37. package/_types/actions/utils.d.ts.map +1 -0
  38. package/_types/index.d.ts +3 -0
  39. package/_types/index.d.ts.map +1 -0
  40. package/_types/types/bundler.d.ts +115 -0
  41. package/_types/types/bundler.d.ts.map +1 -0
  42. package/_types/types/index.d.ts +4 -0
  43. package/_types/types/index.d.ts.map +1 -0
  44. package/_types/types/userOperation.d.ts +29 -0
  45. package/_types/types/userOperation.d.ts.map +1 -0
  46. package/actions/bundler.ts +446 -0
  47. package/actions/index.ts +22 -0
  48. package/actions/package.json +6 -0
  49. package/actions/utils.ts +25 -0
  50. package/index.ts +2 -0
  51. package/package.json +34 -11
  52. package/tsconfig.build.tsbuildinfo +1 -0
  53. package/types/bundler.ts +120 -0
  54. package/types/index.ts +4 -0
  55. package/types/package.json +6 -0
  56. package/types/userOperation.ts +30 -0
  57. package/LICENSE +0 -21
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # permissionless
2
+
3
+ ## 0.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 05a12f9: Added Bundler Actions and standard bundler methods support
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getUserOperationByHash = exports.chainId = exports.supportedEntryPoints = exports.estimateUserOperationGas = exports.sendUserOperation = void 0;
4
+ const utils_1 = require("./utils");
5
+ const sendUserOperation = async (client, args) => {
6
+ const { userOperation, entryPoint } = args;
7
+ return client.request({
8
+ method: "eth_sendUserOperation",
9
+ params: [(0, utils_1.deepHexlify)(userOperation), entryPoint]
10
+ });
11
+ };
12
+ exports.sendUserOperation = sendUserOperation;
13
+ const estimateUserOperationGas = async (client, args) => {
14
+ const { userOperation, entryPoint } = args;
15
+ const response = await client.request({
16
+ method: "eth_estimateUserOperationGas",
17
+ params: [(0, utils_1.deepHexlify)(userOperation), entryPoint]
18
+ });
19
+ return {
20
+ preVerificationGas: BigInt(response.preVerificationGas || 0n),
21
+ verificationGasLimit: BigInt(response.verificationGasLimit || 0n),
22
+ callGasLimit: BigInt(response.callGasLimit || 0n)
23
+ };
24
+ };
25
+ exports.estimateUserOperationGas = estimateUserOperationGas;
26
+ const supportedEntryPoints = async (client) => {
27
+ return client.request({
28
+ method: "eth_supportedEntryPoints",
29
+ params: []
30
+ });
31
+ };
32
+ exports.supportedEntryPoints = supportedEntryPoints;
33
+ const chainId = async (client) => {
34
+ return BigInt(await client.request({
35
+ method: "eth_chainId",
36
+ params: []
37
+ }));
38
+ };
39
+ exports.chainId = chainId;
40
+ const getUserOperationByHash = async (client, { hash }) => {
41
+ const params = [hash];
42
+ const response = await client.request({
43
+ method: "eth_getUserOperationByHash",
44
+ params
45
+ });
46
+ if (!response)
47
+ return null;
48
+ const { userOperation, entryPoint, transactionHash, blockHash, blockNumber } = response;
49
+ return {
50
+ userOperation: {
51
+ ...userOperation,
52
+ nonce: BigInt(userOperation.nonce),
53
+ callGasLimit: BigInt(userOperation.callGasLimit),
54
+ verificationGasLimit: BigInt(userOperation.verificationGasLimit),
55
+ preVerificationGas: BigInt(userOperation.preVerificationGas),
56
+ maxFeePerGas: BigInt(userOperation.maxFeePerGas),
57
+ maxPriorityFeePerGas: BigInt(userOperation.maxPriorityFeePerGas)
58
+ },
59
+ entryPoint: entryPoint,
60
+ transactionHash: transactionHash,
61
+ blockHash: blockHash,
62
+ blockNumber: BigInt(blockNumber)
63
+ };
64
+ };
65
+ exports.getUserOperationByHash = getUserOperationByHash;
66
+ const getUserOperationReceipt = async (client, { hash }) => {
67
+ const params = [hash];
68
+ const response = await client.request({
69
+ method: "eth_getUserOperationReceipt",
70
+ params
71
+ });
72
+ if (!response)
73
+ return null;
74
+ const userOperationReceipt = {
75
+ userOpHash: response.userOpHash,
76
+ sender: response.sender,
77
+ nonce: BigInt(response.nonce),
78
+ actualGasUsed: BigInt(response.actualGasUsed),
79
+ actualGasCost: BigInt(response.actualGasCost),
80
+ success: response.success,
81
+ receipt: {
82
+ transactionHash: response.receipt.transactionHash,
83
+ transactionIndex: BigInt(response.receipt.transactionIndex),
84
+ blockHash: response.receipt.blockHash,
85
+ blockNumber: BigInt(response.receipt.blockNumber),
86
+ from: response.receipt.from,
87
+ to: response.receipt.to,
88
+ cumulativeGasUsed: BigInt(response.receipt.cumulativeGasUsed),
89
+ status: response.receipt.status ? BigInt(response.receipt.status) : null,
90
+ gasUsed: BigInt(response.receipt.gasUsed),
91
+ contractAddress: response.receipt.contractAddress,
92
+ logsBloom: response.receipt.logsBloom,
93
+ effectiveGasPrice: BigInt(response.receipt.effectiveGasPrice)
94
+ },
95
+ logs: response.logs.map((log) => ({
96
+ data: log.data,
97
+ blockNumber: BigInt(log.blockNumber),
98
+ blockHash: log.blockHash,
99
+ transactionHash: log.transactionHash,
100
+ logIndex: BigInt(log.logIndex),
101
+ transactionIndex: BigInt(log.transactionIndex),
102
+ address: log.address,
103
+ topics: log.topics
104
+ }))
105
+ };
106
+ return userOperationReceipt;
107
+ };
108
+ const bundlerActions = (client) => ({
109
+ sendUserOperation: async (args) => (0, exports.sendUserOperation)(client, args),
110
+ estimateUserOperationGas: (args) => (0, exports.estimateUserOperationGas)(client, args),
111
+ supportedEntryPoints: () => (0, exports.supportedEntryPoints)(client),
112
+ chainId: () => (0, exports.chainId)(client),
113
+ getUserOperationByHash: (args) => (0, exports.getUserOperationByHash)(client, args),
114
+ getUserOperationReceipt: (args) => getUserOperationReceipt(client, args)
115
+ });
116
+ exports.default = bundlerActions;
117
+ //# sourceMappingURL=bundler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../actions/bundler.ts"],"names":[],"mappings":";;;AAMA,mCAAqC;AAqD9B,MAAM,iBAAiB,GAAG,KAAK,EAAE,MAAqB,EAAE,IAAiC,EAAiB,EAAE;IAC/G,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAE1C,OAAO,MAAM,CAAC,OAAO,CAAC;QAClB,MAAM,EAAE,uBAAuB;QAC/B,MAAM,EAAE,CAAC,IAAA,mBAAW,EAAC,aAAa,CAAiC,EAAE,UAAqB,CAAC;KAC9F,CAAC,CAAA;AACN,CAAC,CAAA;AAPY,QAAA,iBAAiB,qBAO7B;AA6BM,MAAM,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AAC;YAC9B,gBAAgB,EAAE,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;YAC9C,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,MAAM,EAAE,GAAG,CAAC,MAAM;SACrB,CAAC,CAAC;KACN,CAAA;IAED,OAAO,oBAAoB,CAAA;AAC/B,CAAC,CAAA;AAED,MAAM,cAAc,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IA0BxC,iBAAiB,EAAE,KAAK,EAAE,IAAiC,EAAiB,EAAE,CAC1E,IAAA,yBAAiB,EAAC,MAAuB,EAAE,IAAI,CAAC;IA0BpD,wBAAwB,EAAE,CAAC,IAAwC,EAAE,EAAE,CACnE,IAAA,gCAAwB,EAAC,MAAuB,EAAE,IAAI,CAAC;IAsB3D,oBAAoB,EAAE,GAAuB,EAAE,CAAC,IAAA,4BAAoB,EAAC,MAAuB,CAAC;IAqB7F,OAAO,EAAE,GAAG,EAAE,CAAC,IAAA,eAAO,EAAC,MAAuB,CAAC;IAsB/C,sBAAsB,EAAE,CAAC,IAA4B,EAAE,EAAE,CAAC,IAAA,8BAAsB,EAAC,MAAuB,EAAE,IAAI,CAAC;IAsB/G,uBAAuB,EAAE,CAAC,IAA6B,EAAE,EAAE,CAAC,uBAAuB,CAAC,MAAuB,EAAE,IAAI,CAAC;CACrH,CAAC,CAAA;AAEF,kBAAe,cAAc,CAAA"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getUserOperationByHash = exports.chainId = exports.supportedEntryPoints = exports.estimateUserOperationGas = exports.sendUserOperation = exports.bundlerActions = void 0;
4
+ const bundler_1 = require("./bundler");
5
+ exports.bundlerActions = bundler_1.default;
6
+ Object.defineProperty(exports, "chainId", { enumerable: true, get: function () { return bundler_1.chainId; } });
7
+ Object.defineProperty(exports, "estimateUserOperationGas", { enumerable: true, get: function () { return bundler_1.estimateUserOperationGas; } });
8
+ Object.defineProperty(exports, "getUserOperationByHash", { enumerable: true, get: function () { return bundler_1.getUserOperationByHash; } });
9
+ Object.defineProperty(exports, "sendUserOperation", { enumerable: true, get: function () { return bundler_1.sendUserOperation; } });
10
+ Object.defineProperty(exports, "supportedEntryPoints", { enumerable: true, get: function () { return bundler_1.supportedEntryPoints; } });
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":";;;AAAA,uCASkB;AAGd,yBAZG,iBAAc,CAYH;AAOd,wFAfA,iBAAO,OAeA;AAFP,yGAZA,kCAAwB,OAYA;AAGxB,uGAdA,gCAAsB,OAcA;AAJtB,kGATA,2BAAiB,OASA;AAEjB,qGAVA,8BAAoB,OAUA"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deepHexlify = void 0;
4
+ const viem_1 = require("viem");
5
+ function deepHexlify(obj) {
6
+ if (typeof obj === "function") {
7
+ return undefined;
8
+ }
9
+ if (obj == null || typeof obj === "string" || typeof obj === "boolean") {
10
+ return obj;
11
+ }
12
+ else if (typeof obj === "bigint") {
13
+ return (0, viem_1.toHex)(obj);
14
+ }
15
+ else if (obj._isBigNumber != null || typeof obj !== "object") {
16
+ return (0, viem_1.toHex)(obj).replace(/^0x0/, "0x");
17
+ }
18
+ if (Array.isArray(obj)) {
19
+ return obj.map((member) => deepHexlify(member));
20
+ }
21
+ return Object.keys(obj).reduce((set, key) => ({
22
+ ...set,
23
+ [key]: deepHexlify(obj[key])
24
+ }), {});
25
+ }
26
+ exports.deepHexlify = deepHexlify;
27
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../actions/utils.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAG5B,SAAgB,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,IAAA,YAAK,EAAC,GAAG,CAAC,CAAA;KACpB;SAAM,IAAI,GAAG,CAAC,YAAY,IAAI,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC5D,OAAO,IAAA,YAAK,EAAC,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;AArBD,kCAqBC"}
package/_cjs/index.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./actions"), exports);
5
+ tslib_1.__exportStar(require("./types"), exports);
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,oDAAyB;AACzB,kDAAuB"}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=bundler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../types/bundler.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=userOperation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userOperation.js","sourceRoot":"","sources":["../../types/userOperation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,384 @@
1
+ import { deepHexlify } from "./utils";
2
+ /**
3
+ * Sends user operation to the bundler
4
+ *
5
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/sendUserOperation
6
+ *
7
+ * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
8
+ * @param args {@link SendUserOperationParameters}.
9
+ * @returns UserOpHash that you can use to track user operation as {@link Hash}.
10
+ *
11
+ *
12
+ * @example
13
+ * import { createClient } from "viem"
14
+ * import { sendUserOperation } from "permissionless/actions"
15
+ *
16
+ * const bundlerClient = createClient({
17
+ * chain: goerli,
18
+ * transport: http(BUNDLER_URL)
19
+ * })
20
+ *
21
+ * const userOpHash = sendUserOperation(bundlerClient, {
22
+ * userOperation: signedUserOperation,
23
+ * entryPoint: entryPoint
24
+ * })
25
+ *
26
+ * // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
27
+ *
28
+ */
29
+ export const sendUserOperation = async (client, args) => {
30
+ const { userOperation, entryPoint } = args;
31
+ return client.request({
32
+ method: "eth_sendUserOperation",
33
+ params: [deepHexlify(userOperation), entryPoint]
34
+ });
35
+ };
36
+ /**
37
+ * Estimates preVerificationGas, verificationGasLimit and callGasLimit for user operation
38
+ *
39
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/estimateUserOperationGas
40
+ *
41
+ * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
42
+ * @param args {@link EstimateUserOperationGasParameters}
43
+ * @returns preVerificationGas, verificationGasLimit and callGasLimit as {@link EstimateUserOperationGasReturnType}
44
+ *
45
+ *
46
+ * @example
47
+ * import { createClient } from "viem"
48
+ * import { sendUserOperation } from "permissionless/actions"
49
+ *
50
+ * const bundlerClient = createClient({
51
+ * chain: goerli,
52
+ * transport: http(BUNDLER_URL)
53
+ * })
54
+ *
55
+ * const gasParameters = estimateUserOperationGas(bundlerClient, {
56
+ * serOperation: signedUserOperation,
57
+ * entryPoint: entryPoint
58
+ * })
59
+ *
60
+ * // Return {preVerificationGas: 43492n, verificationGasLimit: 59436n, callGasLimit: 9000n}
61
+ *
62
+ */
63
+ export const estimateUserOperationGas = async (client, args) => {
64
+ const { userOperation, entryPoint } = args;
65
+ const response = await client.request({
66
+ method: "eth_estimateUserOperationGas",
67
+ params: [deepHexlify(userOperation), entryPoint]
68
+ });
69
+ return {
70
+ preVerificationGas: BigInt(response.preVerificationGas || 0n),
71
+ verificationGasLimit: BigInt(response.verificationGasLimit || 0n),
72
+ callGasLimit: BigInt(response.callGasLimit || 0n)
73
+ };
74
+ };
75
+ /**
76
+ * Returns the supported entrypoints by the bundler service
77
+ *
78
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/supportedEntryPoints
79
+ *
80
+ * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
81
+ * @returns Supported entryPoints
82
+ *
83
+ *
84
+ * @example
85
+ * import { createClient } from "viem"
86
+ * import { sendUserOperation } from "permissionless/actions"
87
+ *
88
+ * const bundlerClient = createClient({
89
+ * chain: goerli,
90
+ * transport: http(BUNDLER_URL)
91
+ * })
92
+ *
93
+ * const entryPointsSupported = supportedEntryPoints(bundlerClient)
94
+ * // Return ['0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789']
95
+ *
96
+ */
97
+ export const supportedEntryPoints = async (client) => {
98
+ return client.request({
99
+ method: "eth_supportedEntryPoints",
100
+ params: []
101
+ });
102
+ };
103
+ /**
104
+ * Returns the supported chain id by the bundler service
105
+ *
106
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/chainId
107
+ *
108
+ * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
109
+ * @returns Supported chain id
110
+ *
111
+ *
112
+ * @example
113
+ * import { createClient } from "viem"
114
+ * import { sendUserOperation } from "permissionless/actions"
115
+ *
116
+ * const bundlerClient = createClient({
117
+ * chain: goerli,
118
+ * transport: http(BUNDLER_URL)
119
+ * })
120
+ *
121
+ * const chainId = chainId(bundlerClient)
122
+ * // Return 5n for Goerli
123
+ *
124
+ */
125
+ export const chainId = async (client) => {
126
+ return BigInt(await client.request({
127
+ method: "eth_chainId",
128
+ params: []
129
+ }));
130
+ };
131
+ /**
132
+ * Returns the user operation from userOpHash
133
+ *
134
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationByHash
135
+ *
136
+ * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
137
+ * @param args {@link GetUserOperationByHash} UserOpHash that was returned by {@link sendUserOperation}
138
+ * @returns userOperation along with entryPoint, transactionHash, blockHash, blockNumber if found or null
139
+ *
140
+ *
141
+ * @example
142
+ * import { createClient } from "viem"
143
+ * import { sendUserOperation } from "permissionless/actions"
144
+ *
145
+ * const bundlerClient = createClient({
146
+ * chain: goerli,
147
+ * transport: http(BUNDLER_URL)
148
+ * })
149
+ *
150
+ * getUserOperationByHash(bundlerClient, {hash: userOpHash})
151
+ *
152
+ */
153
+ export const getUserOperationByHash = async (client, { hash }) => {
154
+ const params = [hash];
155
+ const response = await client.request({
156
+ method: "eth_getUserOperationByHash",
157
+ params
158
+ });
159
+ if (!response)
160
+ return null;
161
+ const { userOperation, entryPoint, transactionHash, blockHash, blockNumber } = response;
162
+ return {
163
+ userOperation: {
164
+ ...userOperation,
165
+ nonce: BigInt(userOperation.nonce),
166
+ callGasLimit: BigInt(userOperation.callGasLimit),
167
+ verificationGasLimit: BigInt(userOperation.verificationGasLimit),
168
+ preVerificationGas: BigInt(userOperation.preVerificationGas),
169
+ maxFeePerGas: BigInt(userOperation.maxFeePerGas),
170
+ maxPriorityFeePerGas: BigInt(userOperation.maxPriorityFeePerGas)
171
+ },
172
+ entryPoint: entryPoint,
173
+ transactionHash: transactionHash,
174
+ blockHash: blockHash,
175
+ blockNumber: BigInt(blockNumber)
176
+ };
177
+ };
178
+ /**
179
+ * Returns the user operation receipt from userOpHash
180
+ *
181
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt
182
+ *
183
+ * @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
184
+ * @param args {@link GetUserOperationReceipt} UserOpHash that was returned by {@link sendUserOperation}
185
+ * @returns user operation receipt {@link UserOperationReceipt} if found or null
186
+ *
187
+ *
188
+ * @example
189
+ * import { createClient } from "viem"
190
+ * import { sendUserOperation } from "permissionless/actions"
191
+ *
192
+ * const bundlerClient = createClient({
193
+ * chain: goerli,
194
+ * transport: http(BUNDLER_URL)
195
+ * })
196
+ *
197
+ * getUserOperationReceipt(bundlerClient, {hash: userOpHash})
198
+ *
199
+ */
200
+ const getUserOperationReceipt = async (client, { hash }) => {
201
+ const params = [hash];
202
+ const response = await client.request({
203
+ method: "eth_getUserOperationReceipt",
204
+ params
205
+ });
206
+ if (!response)
207
+ return null;
208
+ const userOperationReceipt = {
209
+ userOpHash: response.userOpHash,
210
+ sender: response.sender,
211
+ nonce: BigInt(response.nonce),
212
+ actualGasUsed: BigInt(response.actualGasUsed),
213
+ actualGasCost: BigInt(response.actualGasCost),
214
+ success: response.success,
215
+ receipt: {
216
+ transactionHash: response.receipt.transactionHash,
217
+ transactionIndex: BigInt(response.receipt.transactionIndex),
218
+ blockHash: response.receipt.blockHash,
219
+ blockNumber: BigInt(response.receipt.blockNumber),
220
+ from: response.receipt.from,
221
+ to: response.receipt.to,
222
+ cumulativeGasUsed: BigInt(response.receipt.cumulativeGasUsed),
223
+ status: response.receipt.status ? BigInt(response.receipt.status) : null,
224
+ gasUsed: BigInt(response.receipt.gasUsed),
225
+ contractAddress: response.receipt.contractAddress,
226
+ logsBloom: response.receipt.logsBloom,
227
+ effectiveGasPrice: BigInt(response.receipt.effectiveGasPrice)
228
+ },
229
+ logs: response.logs.map((log) => ({
230
+ data: log.data,
231
+ blockNumber: BigInt(log.blockNumber),
232
+ blockHash: log.blockHash,
233
+ transactionHash: log.transactionHash,
234
+ logIndex: BigInt(log.logIndex),
235
+ transactionIndex: BigInt(log.transactionIndex),
236
+ address: log.address,
237
+ topics: log.topics
238
+ }))
239
+ };
240
+ return userOperationReceipt;
241
+ };
242
+ const bundlerActions = (client) => ({
243
+ /**
244
+ *
245
+ * Sends user operation to the bundler
246
+ *
247
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/sendUserOperation
248
+ *
249
+ * @param args {@link SendUserOperationParameters}.
250
+ * @returns UserOpHash that you can use to track user operation as {@link Hash}.
251
+ *
252
+ * @example
253
+ * import { createClient } from "viem"
254
+ * import { bundlerActions } from "permissionless"
255
+ *
256
+ * const bundlerClient = createClient({
257
+ * chain: goerli,
258
+ * transport: http(BUNDLER_URL)
259
+ * }).extend(bundlerActions)
260
+ *
261
+ * const userOpHash = await bundlerClient.sendUserOperation({
262
+ * userOperation: signedUserOperation,
263
+ * entryPoint: entryPoint
264
+ * })
265
+ *
266
+ * // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
267
+ */
268
+ sendUserOperation: async (args) => sendUserOperation(client, args),
269
+ /**
270
+ *
271
+ * Estimates preVerificationGas, verificationGasLimit and callGasLimit for user operation
272
+ *
273
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/estimateUserOperationGas
274
+ *
275
+ * @param args {@link EstimateUserOperationGasParameters}
276
+ * @returns preVerificationGas, verificationGasLimit and callGasLimit as {@link EstimateUserOperationGasReturnType}
277
+ *
278
+ * @example
279
+ * import { createClient } from "viem"
280
+ * import { bundlerActions } from "permissionless"
281
+ *
282
+ * const bundlerClient = createClient({
283
+ * chain: goerli,
284
+ * transport: http(BUNDLER_URL)
285
+ * }).extend(bundlerActions)
286
+ *
287
+ * const gasParameters = await bundlerClient.estimateUserOperationGas({
288
+ * userOperation: signedUserOperation,
289
+ * entryPoint: entryPoint
290
+ * })
291
+ *
292
+ * // Return {preVerificationGas: 43492n, verificationGasLimit: 59436n, callGasLimit: 9000n}
293
+ */
294
+ estimateUserOperationGas: (args) => estimateUserOperationGas(client, args),
295
+ /**
296
+ *
297
+ * Returns the supported entrypoints by the bundler service
298
+ *
299
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/supportedEntryPoints
300
+ *
301
+ * @returns Supported entryPoints
302
+ *
303
+ * @example
304
+ * import { createClient } from "viem"
305
+ * import { bundlerActions } from "permissionless"
306
+ *
307
+ * const bundlerClient = createClient({
308
+ * chain: goerli,
309
+ * transport: http(BUNDLER_URL)
310
+ * }).extend(bundlerActions)
311
+ *
312
+ * const supportedEntryPoints = await bundlerClient.supportedEntryPoints()
313
+ *
314
+ * // Return ['0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789']
315
+ */
316
+ supportedEntryPoints: () => supportedEntryPoints(client),
317
+ /**
318
+ *
319
+ * Returns the supported chain id by the bundler service
320
+ *
321
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/chainId
322
+ *
323
+ * @returns Supported chain id
324
+ *
325
+ * @example
326
+ * import { createClient } from "viem"
327
+ * import { bundlerActions } from "permissionless"
328
+ *
329
+ * const bundlerClient = createClient({
330
+ * chain: goerli,
331
+ * transport: http(BUNDLER_URL)
332
+ * }).extend(bundlerActions)
333
+ *
334
+ * const chainId = await bundlerClient.chainId()
335
+ * // Return 5n for Goerli
336
+ */
337
+ chainId: () => chainId(client),
338
+ /**
339
+ *
340
+ * Returns the user operation from userOpHash
341
+ *
342
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationByHash
343
+ *
344
+ * @param args {@link GetUserOperationByHash} UserOpHash that was returned by {@link sendUserOperation}
345
+ * @returns userOperation along with entryPoint, transactionHash, blockHash, blockNumber if found or null
346
+ *
347
+ * @example
348
+ * import { createClient } from "viem"
349
+ * import { bundlerActions } from "permissionless"
350
+ *
351
+ * const bundlerClient = createClient({
352
+ * chain: goerli,
353
+ * transport: http(BUNDLER_URL)
354
+ * }).extend(bundlerActions)
355
+ *
356
+ * await bundlerClient.getUserOperationByHash(userOpHash)
357
+ *
358
+ */
359
+ getUserOperationByHash: (args) => getUserOperationByHash(client, args),
360
+ /**
361
+ *
362
+ * Returns the user operation receipt from userOpHash
363
+ *
364
+ * - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt
365
+ *
366
+ * @param args {@link GetUserOperationReceipt} UserOpHash that was returned by {@link sendUserOperation}
367
+ * @returns user operation receipt {@link UserOperationReceipt} if found or null
368
+ *
369
+ * @example
370
+ * import { createClient } from "viem"
371
+ * import { bundlerActions } from "permissionless"
372
+ *
373
+ * const bundlerClient = createClient({
374
+ * chain: goerli,
375
+ * transport: http(BUNDLER_URL)
376
+ * }).extend(bundlerActions)
377
+ *
378
+ * await bundlerClient.getUserOperationReceipt({hash: userOpHash})
379
+ *
380
+ */
381
+ getUserOperationReceipt: (args) => getUserOperationReceipt(client, args)
382
+ });
383
+ export default bundlerActions;
384
+ //# sourceMappingURL=bundler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../actions/bundler.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AA0BrC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG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C,IAA4B,EAAE,EAAE,CAAC,sBAAsB,CAAC,MAAuB,EAAE,IAAI,CAAC;IAC/G;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,uBAAuB,EAAE,CAAC,IAA6B,EAAE,EAAE,CAAC,uBAAuB,CAAC,MAAuB,EAAE,IAAI,CAAC;CACrH,CAAC,CAAA;AAEF,eAAe,cAAc,CAAA"}
@@ -0,0 +1,3 @@
1
+ import bundlerActions, { chainId, estimateUserOperationGas, getUserOperationByHash, sendUserOperation, supportedEntryPoints } from "./bundler";
2
+ export { bundlerActions, sendUserOperation, estimateUserOperationGas, supportedEntryPoints, chainId, getUserOperationByHash };
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,EAAE,EAInB,OAAO,EACP,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,WAAW,CAAA;AAElB,OAAO,EACH,cAAc,EAId,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,OAAO,EACP,sBAAsB,EACzB,CAAA"}
@@ -0,0 +1,24 @@
1
+ import { toHex } from "viem";
2
+ // biome-ignore lint/suspicious/noExplicitAny: it's a recursive function, so it's hard to type
3
+ export function deepHexlify(obj) {
4
+ if (typeof obj === "function") {
5
+ return undefined;
6
+ }
7
+ if (obj == null || typeof obj === "string" || typeof obj === "boolean") {
8
+ return obj;
9
+ }
10
+ else if (typeof obj === "bigint") {
11
+ return toHex(obj);
12
+ }
13
+ else if (obj._isBigNumber != null || typeof obj !== "object") {
14
+ return toHex(obj).replace(/^0x0/, "0x");
15
+ }
16
+ if (Array.isArray(obj)) {
17
+ return obj.map((member) => deepHexlify(member));
18
+ }
19
+ return Object.keys(obj).reduce((set, key) => ({
20
+ ...set,
21
+ [key]: deepHexlify(obj[key])
22
+ }), {});
23
+ }
24
+ //# 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,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"}
package/_esm/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./actions";
2
+ export * from "./types";
3
+ //# 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,SAAS,CAAA"}