permissionless 0.0.2 → 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.
- package/CHANGELOG.md +10 -0
- package/_cjs/actions/bundler.js +4 -3
- package/_cjs/actions/bundler.js.map +1 -1
- package/_cjs/actions/index.js +2 -1
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/pimlico.js +55 -0
- package/_cjs/actions/pimlico.js.map +1 -0
- package/_cjs/actions/utils.js +5 -1
- package/_cjs/actions/utils.js.map +1 -1
- package/_cjs/clients/bundler.js +17 -0
- package/_cjs/clients/bundler.js.map +1 -0
- package/_cjs/clients/index.js +6 -0
- package/_cjs/clients/index.js.map +1 -0
- package/_cjs/clients/pimlico.js +29 -0
- package/_cjs/clients/pimlico.js.map +1 -0
- package/_cjs/index.js +1 -0
- package/_cjs/index.js.map +1 -1
- package/_cjs/types/pimlico.js +3 -0
- package/_cjs/types/pimlico.js.map +1 -0
- package/_esm/actions/bundler.js +12 -145
- package/_esm/actions/bundler.js.map +1 -1
- package/_esm/actions/index.js +2 -2
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/pimlico.js +127 -0
- package/_esm/actions/pimlico.js.map +1 -0
- package/_esm/actions/utils.js +4 -0
- package/_esm/actions/utils.js.map +1 -1
- package/_esm/clients/bundler.js +33 -0
- package/_esm/clients/bundler.js.map +1 -0
- package/_esm/clients/index.js +3 -0
- package/_esm/clients/index.js.map +1 -0
- package/_esm/clients/pimlico.js +64 -0
- package/_esm/clients/pimlico.js.map +1 -0
- package/_esm/index.js +1 -0
- package/_esm/index.js.map +1 -1
- package/_esm/types/pimlico.js +2 -0
- package/_esm/types/pimlico.js.map +1 -0
- package/_types/actions/bundler.d.ts +113 -24
- package/_types/actions/bundler.d.ts.map +1 -1
- package/_types/actions/index.d.ts +4 -2
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/pimlico.d.ts +184 -0
- package/_types/actions/pimlico.d.ts.map +1 -0
- package/_types/actions/utils.d.ts +4 -0
- package/_types/actions/utils.d.ts.map +1 -1
- package/_types/clients/bundler.d.ts +39 -0
- package/_types/clients/bundler.d.ts.map +1 -0
- package/_types/clients/index.d.ts +3 -0
- package/_types/clients/index.d.ts.map +1 -0
- package/_types/clients/pimlico.d.ts +75 -0
- package/_types/clients/pimlico.d.ts.map +1 -0
- package/_types/index.d.ts +1 -0
- package/_types/index.d.ts.map +1 -1
- package/_types/types/bundler.d.ts +4 -37
- package/_types/types/bundler.d.ts.map +1 -1
- package/_types/types/index.d.ts +1 -2
- package/_types/types/index.d.ts.map +1 -1
- package/_types/types/pimlico.d.ts +50 -0
- package/_types/types/pimlico.d.ts.map +1 -0
- package/_types/types/userOperation.d.ts +1 -0
- package/_types/types/userOperation.d.ts.map +1 -1
- package/actions/bundler.ts +85 -33
- package/actions/index.ts +23 -7
- package/actions/pimlico.ts +258 -0
- package/actions/utils.ts +5 -0
- package/clients/bundler.ts +39 -0
- package/clients/index.ts +3 -0
- package/clients/pimlico.ts +93 -0
- package/index.ts +1 -0
- package/package.json +18 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/bundler.ts +4 -39
- package/types/index.ts +1 -2
- package/types/pimlico.ts +55 -0
- package/types/userOperation.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# permissionless
|
|
2
2
|
|
|
3
|
+
## 0.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 80e7fad: Added Pimlico Bundler Actions (pimlico_getUserOperationStatus, pimlico_getUserOperationGasPrice)
|
|
8
|
+
Added Pimlico Paymaster Actions (pm_sponsorUserOperation)
|
|
9
|
+
Added types for BundlerClient, GetUserOperationByHashParameters, GetUserOperationByHashReturnType, GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType
|
|
10
|
+
Added createBundlerClient, createPimlicoBundlerClient, createPimlicoPaymasterClient
|
|
11
|
+
- 3bbc6d3: Fix JSDoc for Bundler Actions, move viem to peerDependencies, and export getUserOperationReceipt
|
|
12
|
+
|
|
3
13
|
## 0.0.2
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/_cjs/actions/bundler.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getUserOperationByHash = exports.chainId = exports.supportedEntryPoints = exports.estimateUserOperationGas = exports.sendUserOperation = void 0;
|
|
3
|
+
exports.getUserOperationReceipt = exports.getUserOperationByHash = exports.chainId = exports.supportedEntryPoints = exports.estimateUserOperationGas = exports.sendUserOperation = void 0;
|
|
4
4
|
const utils_1 = require("./utils");
|
|
5
5
|
const sendUserOperation = async (client, args) => {
|
|
6
6
|
const { userOperation, entryPoint } = args;
|
|
@@ -86,7 +86,7 @@ const getUserOperationReceipt = async (client, { hash }) => {
|
|
|
86
86
|
from: response.receipt.from,
|
|
87
87
|
to: response.receipt.to,
|
|
88
88
|
cumulativeGasUsed: BigInt(response.receipt.cumulativeGasUsed),
|
|
89
|
-
status:
|
|
89
|
+
status: utils_1.transactionReceiptStatus[response.receipt.status],
|
|
90
90
|
gasUsed: BigInt(response.receipt.gasUsed),
|
|
91
91
|
contractAddress: response.receipt.contractAddress,
|
|
92
92
|
logsBloom: response.receipt.logsBloom,
|
|
@@ -105,13 +105,14 @@ const getUserOperationReceipt = async (client, { hash }) => {
|
|
|
105
105
|
};
|
|
106
106
|
return userOperationReceipt;
|
|
107
107
|
};
|
|
108
|
+
exports.getUserOperationReceipt = getUserOperationReceipt;
|
|
108
109
|
const bundlerActions = (client) => ({
|
|
109
110
|
sendUserOperation: async (args) => (0, exports.sendUserOperation)(client, args),
|
|
110
111
|
estimateUserOperationGas: (args) => (0, exports.estimateUserOperationGas)(client, args),
|
|
111
112
|
supportedEntryPoints: () => (0, exports.supportedEntryPoints)(client),
|
|
112
113
|
chainId: () => (0, exports.chainId)(client),
|
|
113
114
|
getUserOperationByHash: (args) => (0, exports.getUserOperationByHash)(client, args),
|
|
114
|
-
getUserOperationReceipt: (args) => getUserOperationReceipt(client, args)
|
|
115
|
+
getUserOperationReceipt: (args) => (0, exports.getUserOperationReceipt)(client, args)
|
|
115
116
|
});
|
|
116
117
|
exports.default = bundlerActions;
|
|
117
118
|
//# sourceMappingURL=bundler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../actions/bundler.ts"],"names":[],"mappings":";;;AAMA,
|
|
1
|
+
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../actions/bundler.ts"],"names":[],"mappings":";;;AAMA,mCAA+D;AA8FxD,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,wBAAwB,GAAG,KAAK,EACzC,MAAqB,EACrB,IAAwC,EACG,EAAE;IAC7C,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAE1C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,8BAA8B;QACtC,MAAM,EAAE,CAAC,IAAA,mBAAW,EAAC,aAAa,CAAiC,EAAE,UAAqB,CAAC;KAC9F,CAAC,CAAA;IAEF,OAAO;QACH,kBAAkB,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,IAAI,EAAE,CAAC;QAC7D,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,oBAAoB,IAAI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D,oBAAoB,EAAE,GAAuB,EAAE,CAAC,IAAA,4BAAoB,EAAC,MAAuB,CAAC;IAC7F,OAAO,EAAE,GAAG,EAAE,CAAC,IAAA,eAAO,EAAC,MAAuB,CAAC;IAC/C,sBAAsB,EAAE,CAAC,IAAsC,EAAE,EAAE,CAC/D,IAAA,8BAAsB,EAAC,MAAuB,EAAE,IAAI,CAAC;IACzD,uBAAuB,EAAE,CAAC,IAAuC,EAAE,EAAE,CACjE,IAAA,+BAAuB,EAAC,MAAuB,EAAE,IAAI,CAAC;CAC7D,CAAC,CAAA;AAEF,kBAAe,cAAc,CAAA"}
|
package/_cjs/actions/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getUserOperationByHash = exports.chainId = exports.supportedEntryPoints = exports.estimateUserOperationGas = exports.sendUserOperation = exports.bundlerActions = void 0;
|
|
3
|
+
exports.getUserOperationReceipt = exports.getUserOperationByHash = exports.chainId = exports.supportedEntryPoints = exports.estimateUserOperationGas = exports.sendUserOperation = exports.bundlerActions = void 0;
|
|
4
4
|
const bundler_1 = require("./bundler");
|
|
5
5
|
exports.bundlerActions = bundler_1.default;
|
|
6
6
|
Object.defineProperty(exports, "chainId", { enumerable: true, get: function () { return bundler_1.chainId; } });
|
|
7
7
|
Object.defineProperty(exports, "estimateUserOperationGas", { enumerable: true, get: function () { return bundler_1.estimateUserOperationGas; } });
|
|
8
8
|
Object.defineProperty(exports, "getUserOperationByHash", { enumerable: true, get: function () { return bundler_1.getUserOperationByHash; } });
|
|
9
|
+
Object.defineProperty(exports, "getUserOperationReceipt", { enumerable: true, get: function () { return bundler_1.getUserOperationReceipt; } });
|
|
9
10
|
Object.defineProperty(exports, "sendUserOperation", { enumerable: true, get: function () { return bundler_1.sendUserOperation; } });
|
|
10
11
|
Object.defineProperty(exports, "supportedEntryPoints", { enumerable: true, get: function () { return bundler_1.supportedEntryPoints; } });
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":";;;AAUA,uCAOkB;AAad,yBApBG,iBAAc,CAoBH;AAId,wFAvBA,iBAAO,OAuBA;AAFP,yGApBA,kCAAwB,OAoBA;AAGxB,uGAtBA,gCAAsB,OAsBA;AACtB,wGAtBA,iCAAuB,OAsBA;AALvB,kGAhBA,2BAAiB,OAgBA;AAEjB,qGAjBA,8BAAoB,OAiBA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pimlicoPaymasterActions = exports.sponsorUserOperation = exports.pimlicoBundlerActions = exports.getUserOperationStatus = exports.getUserOperationGasPrice = void 0;
|
|
4
|
+
const utils_1 = require("./utils");
|
|
5
|
+
const getUserOperationGasPrice = async (client) => {
|
|
6
|
+
const gasPrices = await client.request({
|
|
7
|
+
method: "pimlico_getUserOperationGasPrice",
|
|
8
|
+
params: []
|
|
9
|
+
});
|
|
10
|
+
return {
|
|
11
|
+
slow: {
|
|
12
|
+
maxFeePerGas: BigInt(gasPrices.slow.maxFeePerGas),
|
|
13
|
+
maxPriorityFeePerGas: BigInt(gasPrices.slow.maxPriorityFeePerGas)
|
|
14
|
+
},
|
|
15
|
+
standard: {
|
|
16
|
+
maxFeePerGas: BigInt(gasPrices.standard.maxFeePerGas),
|
|
17
|
+
maxPriorityFeePerGas: BigInt(gasPrices.standard.maxPriorityFeePerGas)
|
|
18
|
+
},
|
|
19
|
+
fast: {
|
|
20
|
+
maxFeePerGas: BigInt(gasPrices.fast.maxFeePerGas),
|
|
21
|
+
maxPriorityFeePerGas: BigInt(gasPrices.fast.maxPriorityFeePerGas)
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
exports.getUserOperationGasPrice = getUserOperationGasPrice;
|
|
26
|
+
const getUserOperationStatus = async (client, { hash }) => {
|
|
27
|
+
return client.request({
|
|
28
|
+
method: "pimlico_getUserOperationStatus",
|
|
29
|
+
params: [hash]
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
exports.getUserOperationStatus = getUserOperationStatus;
|
|
33
|
+
const pimlicoBundlerActions = (client) => ({
|
|
34
|
+
getUserOperationGasPrice: async () => (0, exports.getUserOperationGasPrice)(client),
|
|
35
|
+
getUserOperationStatus: async (args) => (0, exports.getUserOperationStatus)(client, args)
|
|
36
|
+
});
|
|
37
|
+
exports.pimlicoBundlerActions = pimlicoBundlerActions;
|
|
38
|
+
const sponsorUserOperation = async (client, args) => {
|
|
39
|
+
const response = await client.request({
|
|
40
|
+
method: "pm_sponsorUserOperation",
|
|
41
|
+
params: [(0, utils_1.deepHexlify)(args.userOperation), args.entryPoint]
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
paymasterAndData: response.paymasterAndData,
|
|
45
|
+
preVerificationGas: BigInt(response.preVerificationGas),
|
|
46
|
+
verificationGasLimit: BigInt(response.verificationGasLimit),
|
|
47
|
+
callGasLimit: BigInt(response.callGasLimit)
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
exports.sponsorUserOperation = sponsorUserOperation;
|
|
51
|
+
const pimlicoPaymasterActions = (client) => ({
|
|
52
|
+
sponsorUserOperation: async (args) => (0, exports.sponsorUserOperation)(client, args)
|
|
53
|
+
});
|
|
54
|
+
exports.pimlicoPaymasterActions = pimlicoPaymasterActions;
|
|
55
|
+
//# sourceMappingURL=pimlico.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":";;;AAKA,mCAAqC;AA4D9B,MAAM,wBAAwB,GAAG,KAAK,EACzC,MAA4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AA4BK,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,IAAA,mBAAW,EAAC,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;AAfY,QAAA,oBAAoB,wBAehC;AA8BM,MAAM,uBAAuB,GAAG,CAAC,MAAc,EAAiC,EAAE,CAAC,CAAC;IACvF,oBAAoB,EAAE,KAAK,EAAE,IAAoC,EAAE,EAAE,CACjE,IAAA,4BAAoB,EAAC,MAAgC,EAAE,IAAI,CAAC;CACnE,CAAC,CAAA;AAHW,QAAA,uBAAuB,2BAGlC"}
|
package/_cjs/actions/utils.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deepHexlify = void 0;
|
|
3
|
+
exports.deepHexlify = exports.transactionReceiptStatus = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
|
+
exports.transactionReceiptStatus = {
|
|
6
|
+
"0x0": "reverted",
|
|
7
|
+
"0x1": "success"
|
|
8
|
+
};
|
|
5
9
|
function deepHexlify(obj) {
|
|
6
10
|
if (typeof obj === "function") {
|
|
7
11
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../actions/utils.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../actions/utils.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAEf,QAAA,wBAAwB,GAAG;IACpC,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,SAAS;CACV,CAAA;AAGV,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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createBundlerClient = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const actions_1 = require("../actions");
|
|
6
|
+
const createBundlerClient = (parameters) => {
|
|
7
|
+
const { key = "public", name = "Bundler Client" } = parameters;
|
|
8
|
+
const client = (0, viem_1.createClient)({
|
|
9
|
+
...parameters,
|
|
10
|
+
key,
|
|
11
|
+
name,
|
|
12
|
+
type: "bundlerClient"
|
|
13
|
+
});
|
|
14
|
+
return client.extend(actions_1.bundlerActions);
|
|
15
|
+
};
|
|
16
|
+
exports.createBundlerClient = createBundlerClient;
|
|
17
|
+
//# sourceMappingURL=bundler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../clients/bundler.ts"],"names":[],"mappings":";;;AACA,+BAAmC;AACnC,wCAA2C;AAyBpC,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,IAAA,mBAAY,EAAC;QACxB,GAAG,UAAU;QACb,GAAG;QACH,IAAI;QACJ,IAAI,EAAE,eAAe;KACxB,CAAC,CAAA;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,wBAAc,CAAC,CAAA;AACxC,CAAC,CAAA;AAXY,QAAA,mBAAmB,uBAW/B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createBundlerClient = void 0;
|
|
4
|
+
const bundler_1 = require("./bundler");
|
|
5
|
+
Object.defineProperty(exports, "createBundlerClient", { enumerable: true, get: function () { return bundler_1.createBundlerClient; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../clients/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmE;AAE1D,oGAFoB,6BAAmB,OAEpB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPimlicoPaymasterClient = exports.createPimlicoBundlerClient = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const actions_1 = require("../actions");
|
|
6
|
+
const pimlico_1 = require("../actions/pimlico");
|
|
7
|
+
const createPimlicoBundlerClient = (parameters) => {
|
|
8
|
+
const { key = "public", name = "Pimlico Bundler Client" } = parameters;
|
|
9
|
+
const client = (0, viem_1.createClient)({
|
|
10
|
+
...parameters,
|
|
11
|
+
key,
|
|
12
|
+
name,
|
|
13
|
+
type: "pimlicoBundlerClient"
|
|
14
|
+
});
|
|
15
|
+
return client.extend(actions_1.bundlerActions).extend(pimlico_1.pimlicoBundlerActions);
|
|
16
|
+
};
|
|
17
|
+
exports.createPimlicoBundlerClient = createPimlicoBundlerClient;
|
|
18
|
+
const createPimlicoPaymasterClient = (parameters) => {
|
|
19
|
+
const { key = "public", name = "Pimlico Paymaster Client" } = parameters;
|
|
20
|
+
const client = (0, viem_1.createClient)({
|
|
21
|
+
...parameters,
|
|
22
|
+
key,
|
|
23
|
+
name,
|
|
24
|
+
type: "pimlicoPaymasterClient"
|
|
25
|
+
});
|
|
26
|
+
return client.extend(pimlico_1.pimlicoPaymasterActions);
|
|
27
|
+
};
|
|
28
|
+
exports.createPimlicoPaymasterClient = createPimlicoPaymasterClient;
|
|
29
|
+
//# sourceMappingURL=pimlico.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../clients/pimlico.ts"],"names":[],"mappings":";;;AACA,+BAAmC;AACnC,wCAA2C;AAE3C,gDAK2B;AAuCpB,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,IAAA,mBAAY,EAAC;QACxB,GAAG,UAAU;QACb,GAAG;QACH,IAAI;QACJ,IAAI,EAAE,sBAAsB;KAC/B,CAAC,CAAA;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,wBAAc,CAAC,CAAC,MAAM,CAAC,+BAAqB,CAAC,CAAA;AACtE,CAAC,CAAA;AAXY,QAAA,0BAA0B,8BAWtC;AAsBM,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,IAAA,mBAAY,EAAC;QACxB,GAAG,UAAU;QACb,GAAG;QACH,IAAI;QACJ,IAAI,EAAE,wBAAwB;KACjC,CAAC,CAAA;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,iCAAuB,CAAC,CAAA;AACjD,CAAC,CAAA;AAXY,QAAA,4BAA4B,gCAWxC"}
|
package/_cjs/index.js
CHANGED
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./actions"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./clients"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./types"), exports);
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
package/_cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,oDAAyB;AACzB,kDAAuB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,oDAAyB;AACzB,oDAAyB;AACzB,kDAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../types/pimlico.ts"],"names":[],"mappings":""}
|
package/_esm/actions/bundler.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { deepHexlify } from "./utils";
|
|
1
|
+
import { deepHexlify, transactionReceiptStatus } from "./utils";
|
|
2
2
|
/**
|
|
3
3
|
* Sends user operation to the bundler
|
|
4
4
|
*
|
|
@@ -45,7 +45,7 @@ export const sendUserOperation = async (client, args) => {
|
|
|
45
45
|
*
|
|
46
46
|
* @example
|
|
47
47
|
* import { createClient } from "viem"
|
|
48
|
-
* import {
|
|
48
|
+
* import { estimateUserOperationGas } from "permissionless/actions"
|
|
49
49
|
*
|
|
50
50
|
* const bundlerClient = createClient({
|
|
51
51
|
* chain: goerli,
|
|
@@ -83,7 +83,7 @@ export const estimateUserOperationGas = async (client, args) => {
|
|
|
83
83
|
*
|
|
84
84
|
* @example
|
|
85
85
|
* import { createClient } from "viem"
|
|
86
|
-
* import {
|
|
86
|
+
* import { supportedEntryPoints } from "permissionless/actions"
|
|
87
87
|
*
|
|
88
88
|
* const bundlerClient = createClient({
|
|
89
89
|
* chain: goerli,
|
|
@@ -111,14 +111,14 @@ export const supportedEntryPoints = async (client) => {
|
|
|
111
111
|
*
|
|
112
112
|
* @example
|
|
113
113
|
* import { createClient } from "viem"
|
|
114
|
-
* import {
|
|
114
|
+
* import { chainId } from "permissionless/actions"
|
|
115
115
|
*
|
|
116
116
|
* const bundlerClient = createClient({
|
|
117
117
|
* chain: goerli,
|
|
118
118
|
* transport: http(BUNDLER_URL)
|
|
119
119
|
* })
|
|
120
120
|
*
|
|
121
|
-
* const
|
|
121
|
+
* const bundlerChainId = chainId(bundlerClient)
|
|
122
122
|
* // Return 5n for Goerli
|
|
123
123
|
*
|
|
124
124
|
*/
|
|
@@ -134,13 +134,13 @@ export const chainId = async (client) => {
|
|
|
134
134
|
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationByHash
|
|
135
135
|
*
|
|
136
136
|
* @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
|
|
137
|
-
* @param args {@link
|
|
137
|
+
* @param args {@link GetUserOperationByHashParameters} UserOpHash that was returned by {@link sendUserOperation}
|
|
138
138
|
* @returns userOperation along with entryPoint, transactionHash, blockHash, blockNumber if found or null
|
|
139
139
|
*
|
|
140
140
|
*
|
|
141
141
|
* @example
|
|
142
142
|
* import { createClient } from "viem"
|
|
143
|
-
* import {
|
|
143
|
+
* import { getUserOperationByHash } from "permissionless/actions"
|
|
144
144
|
*
|
|
145
145
|
* const bundlerClient = createClient({
|
|
146
146
|
* chain: goerli,
|
|
@@ -181,13 +181,13 @@ export const getUserOperationByHash = async (client, { hash }) => {
|
|
|
181
181
|
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt
|
|
182
182
|
*
|
|
183
183
|
* @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
|
|
184
|
-
* @param args {@link
|
|
185
|
-
* @returns user operation receipt {@link
|
|
184
|
+
* @param args {@link GetUserOperationReceiptParameters} UserOpHash that was returned by {@link sendUserOperation}
|
|
185
|
+
* @returns user operation receipt {@link GetUserOperationReceiptReturnType} if found or null
|
|
186
186
|
*
|
|
187
187
|
*
|
|
188
188
|
* @example
|
|
189
189
|
* import { createClient } from "viem"
|
|
190
|
-
* import {
|
|
190
|
+
* import { getUserOperationReceipt } from "permissionless/actions"
|
|
191
191
|
*
|
|
192
192
|
* const bundlerClient = createClient({
|
|
193
193
|
* chain: goerli,
|
|
@@ -197,7 +197,7 @@ export const getUserOperationByHash = async (client, { hash }) => {
|
|
|
197
197
|
* getUserOperationReceipt(bundlerClient, {hash: userOpHash})
|
|
198
198
|
*
|
|
199
199
|
*/
|
|
200
|
-
const getUserOperationReceipt = async (client, { hash }) => {
|
|
200
|
+
export const getUserOperationReceipt = async (client, { hash }) => {
|
|
201
201
|
const params = [hash];
|
|
202
202
|
const response = await client.request({
|
|
203
203
|
method: "eth_getUserOperationReceipt",
|
|
@@ -220,7 +220,7 @@ const getUserOperationReceipt = async (client, { hash }) => {
|
|
|
220
220
|
from: response.receipt.from,
|
|
221
221
|
to: response.receipt.to,
|
|
222
222
|
cumulativeGasUsed: BigInt(response.receipt.cumulativeGasUsed),
|
|
223
|
-
status: response.receipt.status
|
|
223
|
+
status: transactionReceiptStatus[response.receipt.status],
|
|
224
224
|
gasUsed: BigInt(response.receipt.gasUsed),
|
|
225
225
|
contractAddress: response.receipt.contractAddress,
|
|
226
226
|
logsBloom: response.receipt.logsBloom,
|
|
@@ -240,144 +240,11 @@ const getUserOperationReceipt = async (client, { hash }) => {
|
|
|
240
240
|
return userOperationReceipt;
|
|
241
241
|
};
|
|
242
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
243
|
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
244
|
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
245
|
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
246
|
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
247
|
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
248
|
getUserOperationReceipt: (args) => getUserOperationReceipt(client, args)
|
|
382
249
|
});
|
|
383
250
|
export default bundlerActions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../actions/bundler.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../actions/bundler.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAmE/D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,MAAqB,EAAE,IAAiC,EAAiB,EAAE;IAC/G,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,IAAI,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AE,CAAC,CAAC;YAC9B,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC;YACpC,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,eAAe,EAAE,GAAG,CAAC,eAAe;YACpC,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;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;AAgJD,MAAM,cAAc,GAAG,CAAC,MAAc,EAAkB,EAAE,CAAC,CAAC;IACxD,iBAAiB,EAAE,KAAK,EAAE,IAAiC,EAAiB,EAAE,CAC1E,iBAAiB,CAAC,MAAuB,EAAE,IAAI,CAAC;IACpD,wBAAwB,EAAE,CAAC,IAAwC,EAAE,EAAE,CACnE,wBAAwB,CAAC,MAAuB,EAAE,IAAI,CAAC;IAC3D,oBAAoB,EAAE,GAAuB,EAAE,CAAC,oBAAoB,CAAC,MAAuB,CAAC;IAC7F,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAuB,CAAC;IAC/C,sBAAsB,EAAE,CAAC,IAAsC,EAAE,EAAE,CAC/D,sBAAsB,CAAC,MAAuB,EAAE,IAAI,CAAC;IACzD,uBAAuB,EAAE,CAAC,IAAuC,EAAE,EAAE,CACjE,uBAAuB,CAAC,MAAuB,EAAE,IAAI,CAAC;CAC7D,CAAC,CAAA;AAEF,eAAe,cAAc,CAAA"}
|
package/_esm/actions/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import bundlerActions, { chainId, estimateUserOperationGas, getUserOperationByHash, sendUserOperation, supportedEntryPoints } from "./bundler";
|
|
2
|
-
export { bundlerActions, sendUserOperation, estimateUserOperationGas, supportedEntryPoints, chainId, getUserOperationByHash };
|
|
1
|
+
import bundlerActions, { chainId, estimateUserOperationGas, getUserOperationByHash, getUserOperationReceipt, sendUserOperation, supportedEntryPoints } from "./bundler";
|
|
2
|
+
export { bundlerActions, sendUserOperation, estimateUserOperationGas, supportedEntryPoints, chainId, getUserOperationByHash, getUserOperationReceipt };
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAUA,OAAO,cAAc,EAAE,EACnB,OAAO,EACP,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,WAAW,CAAA;AAYlB,OAAO,EACH,cAAc,EACd,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,OAAO,EACP,sBAAsB,EACtB,uBAAuB,EAC1B,CAAA"}
|