permissionless 0.0.6 → 0.0.8
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 +13 -0
- package/_cjs/actions/bundler/chainId.js +11 -0
- package/_cjs/actions/bundler/chainId.js.map +1 -0
- package/_cjs/actions/bundler/estimateUserOperationGas.js +18 -0
- package/_cjs/actions/bundler/estimateUserOperationGas.js.map +1 -0
- package/_cjs/actions/bundler/getUserOperationByHash.js +30 -0
- package/_cjs/actions/bundler/getUserOperationByHash.js.map +1 -0
- package/_cjs/actions/bundler/getUserOperationReceipt.js +48 -0
- package/_cjs/actions/bundler/getUserOperationReceipt.js.map +1 -0
- package/_cjs/actions/bundler/sendUserOperation.js +13 -0
- package/_cjs/actions/bundler/sendUserOperation.js.map +1 -0
- package/_cjs/actions/bundler/supportedEntryPoints.js +11 -0
- package/_cjs/actions/bundler/supportedEntryPoints.js.map +1 -0
- package/_cjs/actions/bundler/waitForUserOperationReceipt.js +46 -0
- package/_cjs/actions/bundler/waitForUserOperationReceipt.js.map +1 -0
- package/_cjs/actions/index.js +22 -12
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/pimlico/getUserOperationGasPrice.js +25 -0
- package/_cjs/actions/pimlico/getUserOperationGasPrice.js.map +1 -0
- package/_cjs/actions/pimlico/getUserOperationStatus.js +11 -0
- package/_cjs/actions/pimlico/getUserOperationStatus.js.map +1 -0
- package/_cjs/actions/pimlico/sponsorUserOperation.js +18 -0
- package/_cjs/actions/pimlico/sponsorUserOperation.js.map +1 -0
- package/_cjs/actions/pimlico.js +10 -52
- package/_cjs/actions/pimlico.js.map +1 -1
- package/_cjs/actions/public/getAccountNonce.js +35 -0
- package/_cjs/actions/public/getAccountNonce.js.map +1 -0
- package/_cjs/actions/{public.js → public/getSenderAddress.js} +2 -33
- package/_cjs/actions/public/getSenderAddress.js.map +1 -0
- package/_cjs/actions/stackup/accounts.js +12 -0
- package/_cjs/actions/stackup/accounts.js.map +1 -0
- package/_cjs/actions/stackup/sponsorUserOperation.js +18 -0
- package/_cjs/actions/stackup/sponsorUserOperation.js.map +1 -0
- package/_cjs/actions/stackup.js +10 -0
- package/_cjs/actions/stackup.js.map +1 -0
- package/_cjs/clients/bundler.js +2 -2
- package/_cjs/clients/bundler.js.map +1 -1
- package/_cjs/clients/decorators/bundler.js +21 -0
- package/_cjs/clients/decorators/bundler.js.map +1 -0
- package/_cjs/clients/decorators/pimlico.js +16 -0
- package/_cjs/clients/decorators/pimlico.js.map +1 -0
- package/_cjs/clients/decorators/stackup.js +11 -0
- package/_cjs/clients/decorators/stackup.js.map +1 -0
- package/_cjs/clients/pimlico.js +4 -4
- package/_cjs/clients/pimlico.js.map +1 -1
- package/_cjs/clients/stackup.js +18 -0
- package/_cjs/clients/stackup.js.map +1 -0
- package/_cjs/index.js +28 -4
- package/_cjs/index.js.map +1 -1
- package/_cjs/types/stackup.js +3 -0
- package/_cjs/types/stackup.js.map +1 -0
- package/_cjs/{actions/utils.js → utils/deepHexlify.js} +1 -1
- package/_cjs/utils/deepHexlify.js.map +1 -0
- package/_cjs/utils/getUserOperationHash.js +38 -0
- package/_cjs/utils/getUserOperationHash.js.map +1 -0
- package/_cjs/utils/index.js +2 -34
- package/_cjs/utils/index.js.map +1 -1
- package/_cjs/utils/observe.js +39 -0
- package/_cjs/utils/observe.js.map +1 -0
- package/_esm/actions/bundler/chainId.js +29 -0
- package/_esm/actions/bundler/chainId.js.map +1 -0
- package/_esm/actions/bundler/estimateUserOperationGas.js +41 -0
- package/_esm/actions/bundler/estimateUserOperationGas.js.map +1 -0
- package/_esm/actions/bundler/getUserOperationByHash.js +48 -0
- package/_esm/actions/bundler/getUserOperationByHash.js.map +1 -0
- package/_esm/actions/bundler/getUserOperationReceipt.js +66 -0
- package/_esm/actions/bundler/getUserOperationReceipt.js.map +1 -0
- package/_esm/actions/bundler/sendUserOperation.js +36 -0
- package/_esm/actions/bundler/sendUserOperation.js.map +1 -0
- package/_esm/actions/bundler/supportedEntryPoints.js +29 -0
- package/_esm/actions/bundler/supportedEntryPoints.js.map +1 -0
- package/_esm/actions/bundler/waitForUserOperationReceipt.js +63 -0
- package/_esm/actions/bundler/waitForUserOperationReceipt.js.map +1 -0
- package/_esm/actions/index.js +11 -3
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/pimlico/getUserOperationGasPrice.js +42 -0
- package/_esm/actions/pimlico/getUserOperationGasPrice.js.map +1 -0
- package/_esm/actions/pimlico/getUserOperationStatus.js +29 -0
- package/_esm/actions/pimlico/getUserOperationStatus.js.map +1 -0
- package/_esm/actions/pimlico/sponsorUserOperation.js +39 -0
- package/_esm/actions/pimlico/sponsorUserOperation.js.map +1 -0
- package/_esm/actions/pimlico.js +5 -123
- package/_esm/actions/pimlico.js.map +1 -1
- package/_esm/actions/public/getAccountNonce.js +57 -0
- package/_esm/actions/public/getAccountNonce.js.map +1 -0
- package/_esm/actions/{public.js → public/getSenderAddress.js} +1 -57
- package/_esm/actions/public/getSenderAddress.js.map +1 -0
- package/_esm/actions/stackup/accounts.js +30 -0
- package/_esm/actions/stackup/accounts.js.map +1 -0
- package/_esm/actions/stackup/sponsorUserOperation.js +40 -0
- package/_esm/actions/stackup/sponsorUserOperation.js.map +1 -0
- package/_esm/actions/stackup.js +5 -0
- package/_esm/actions/stackup.js.map +1 -0
- package/_esm/clients/bundler.js +1 -1
- package/_esm/clients/bundler.js.map +1 -1
- package/_esm/clients/decorators/bundler.js +18 -0
- package/_esm/clients/decorators/bundler.js.map +1 -0
- package/_esm/clients/decorators/pimlico.js +20 -0
- package/_esm/clients/decorators/pimlico.js.map +1 -0
- package/_esm/clients/decorators/stackup.js +8 -0
- package/_esm/clients/decorators/stackup.js.map +1 -0
- package/_esm/clients/pimlico.js +2 -2
- package/_esm/clients/pimlico.js.map +1 -1
- package/_esm/clients/stackup.js +33 -0
- package/_esm/clients/stackup.js.map +1 -0
- package/_esm/index.js +17 -4
- package/_esm/index.js.map +1 -1
- package/_esm/types/stackup.js +2 -0
- package/_esm/types/stackup.js.map +1 -0
- package/_esm/{actions/utils.js → utils/deepHexlify.js} +1 -1
- package/_esm/utils/deepHexlify.js.map +1 -0
- package/_esm/utils/getUserOperationHash.js +55 -0
- package/_esm/utils/getUserOperationHash.js.map +1 -0
- package/_esm/utils/index.js +1 -54
- package/_esm/utils/index.js.map +1 -1
- package/_esm/utils/observe.js +42 -0
- package/_esm/utils/observe.js.map +1 -0
- package/_types/actions/bundler/chainId.d.ts +25 -0
- package/_types/actions/bundler/chainId.d.ts.map +1 -0
- package/_types/actions/bundler/estimateUserOperationGas.d.ts +42 -0
- package/_types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -0
- package/_types/actions/bundler/getUserOperationByHash.d.ts +37 -0
- package/_types/actions/bundler/getUserOperationByHash.d.ts.map +1 -0
- package/_types/actions/bundler/getUserOperationReceipt.d.ts +62 -0
- package/_types/actions/bundler/getUserOperationReceipt.d.ts.map +1 -0
- package/_types/actions/bundler/sendUserOperation.d.ts +36 -0
- package/_types/actions/bundler/sendUserOperation.d.ts.map +1 -0
- package/_types/actions/bundler/supportedEntryPoints.d.ts +26 -0
- package/_types/actions/bundler/supportedEntryPoints.d.ts.map +1 -0
- package/_types/actions/bundler/waitForUserOperationReceipt.d.ts +43 -0
- package/_types/actions/bundler/waitForUserOperationReceipt.d.ts.map +1 -0
- package/_types/actions/index.d.ts +19 -6
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts +38 -0
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts.map +1 -0
- package/_types/actions/pimlico/getUserOperationStatus.d.ts +31 -0
- package/_types/actions/pimlico/getUserOperationStatus.d.ts.map +1 -0
- package/_types/actions/pimlico/sponsorUserOperation.d.ts +41 -0
- package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -0
- package/_types/actions/pimlico.d.ts +7 -177
- package/_types/actions/pimlico.d.ts.map +1 -1
- package/_types/actions/public/getAccountNonce.d.ts +34 -0
- package/_types/actions/public/getAccountNonce.d.ts.map +1 -0
- package/_types/actions/{public.d.ts → public/getSenderAddress.d.ts} +2 -35
- package/_types/actions/public/getSenderAddress.d.ts.map +1 -0
- package/_types/actions/stackup/accounts.d.ts +29 -0
- package/_types/actions/stackup/accounts.d.ts.map +1 -0
- package/_types/actions/stackup/sponsorUserOperation.d.ts +43 -0
- package/_types/actions/stackup/sponsorUserOperation.d.ts.map +1 -0
- package/_types/actions/stackup.d.ts +7 -0
- package/_types/actions/stackup.d.ts.map +1 -0
- package/_types/clients/bundler.d.ts +3 -3
- package/_types/clients/bundler.d.ts.map +1 -1
- package/_types/clients/decorators/bundler.d.ts +173 -0
- package/_types/clients/decorators/bundler.d.ts.map +1 -0
- package/_types/clients/decorators/pimlico.d.ts +78 -0
- package/_types/clients/decorators/pimlico.d.ts.map +1 -0
- package/_types/clients/decorators/stackup.d.ts +54 -0
- package/_types/clients/decorators/stackup.d.ts.map +1 -0
- package/_types/clients/pimlico.d.ts +3 -3
- package/_types/clients/pimlico.d.ts.map +1 -1
- package/_types/clients/stackup.d.ts +39 -0
- package/_types/clients/stackup.d.ts.map +1 -0
- package/_types/index.d.ts +28 -4
- package/_types/index.d.ts.map +1 -1
- package/_types/types/bundler.d.ts +1 -1
- package/_types/types/bundler.d.ts.map +1 -1
- package/_types/types/index.d.ts +1 -1
- package/_types/types/index.d.ts.map +1 -1
- package/_types/types/pimlico.d.ts +1 -1
- package/_types/types/pimlico.d.ts.map +1 -1
- package/_types/types/stackup.d.ts +35 -0
- package/_types/types/stackup.d.ts.map +1 -0
- package/_types/{actions/utils.d.ts → utils/deepHexlify.d.ts} +1 -1
- package/_types/utils/deepHexlify.d.ts.map +1 -0
- package/_types/utils/getUserOperationHash.d.ts +30 -0
- package/_types/utils/getUserOperationHash.d.ts.map +1 -0
- package/_types/utils/index.d.ts +2 -30
- package/_types/utils/index.d.ts.map +1 -1
- package/_types/utils/observe.d.ts +17 -0
- package/_types/utils/observe.d.ts.map +1 -0
- package/actions/bundler/chainId.ts +32 -0
- package/actions/bundler/estimateUserOperationGas.ts +62 -0
- package/actions/bundler/getUserOperationByHash.ts +69 -0
- package/actions/bundler/getUserOperationReceipt.ts +112 -0
- package/actions/bundler/sendUserOperation.ts +45 -0
- package/actions/bundler/supportedEntryPoints.ts +31 -0
- package/actions/bundler/waitForUserOperationReceipt.ts +80 -0
- package/actions/index.ts +30 -21
- package/actions/pimlico/getUserOperationGasPrice.ts +61 -0
- package/actions/pimlico/getUserOperationStatus.ts +41 -0
- package/actions/pimlico/sponsorUserOperation.ts +62 -0
- package/actions/pimlico.ts +34 -251
- package/actions/public/getAccountNonce.ts +63 -0
- package/actions/{public.ts → public/getSenderAddress.ts} +7 -68
- package/actions/stackup/accounts.ts +40 -0
- package/actions/stackup/sponsorUserOperation.ts +64 -0
- package/actions/stackup.ts +17 -0
- package/clients/bundler.ts +9 -4
- package/clients/decorators/bundler.ts +211 -0
- package/clients/decorators/pimlico.ts +107 -0
- package/clients/decorators/stackup.ts +65 -0
- package/clients/pimlico.ts +3 -4
- package/clients/stackup.ts +44 -0
- package/index.ts +70 -4
- package/package.json +11 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/bundler.ts +1 -1
- package/types/index.ts +1 -1
- package/types/pimlico.ts +1 -1
- package/types/stackup.ts +36 -0
- package/utils/getUserOperationHash.ts +68 -0
- package/utils/index.ts +2 -69
- package/utils/observe.ts +61 -0
- package/_cjs/actions/bundler.js +0 -118
- package/_cjs/actions/bundler.js.map +0 -1
- package/_cjs/actions/public.js.map +0 -1
- package/_cjs/actions/utils.js.map +0 -1
- package/_cjs/clients/index.js +0 -6
- package/_cjs/clients/index.js.map +0 -1
- package/_esm/actions/bundler.js +0 -251
- package/_esm/actions/bundler.js.map +0 -1
- package/_esm/actions/public.js.map +0 -1
- package/_esm/actions/utils.js.map +0 -1
- package/_esm/clients/index.js +0 -3
- package/_esm/clients/index.js.map +0 -1
- package/_types/actions/bundler.d.ts +0 -393
- package/_types/actions/bundler.d.ts.map +0 -1
- package/_types/actions/public.d.ts.map +0 -1
- package/_types/actions/utils.d.ts.map +0 -1
- package/_types/clients/index.d.ts +0 -3
- package/_types/clients/index.d.ts.map +0 -1
- package/actions/bundler.ts +0 -498
- package/clients/index.ts +0 -3
- /package/{actions/utils.ts → utils/deepHexlify.ts} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bundlerActions = void 0;
|
|
4
|
+
const chainId_js_1 = require("../../actions/bundler/chainId.js");
|
|
5
|
+
const estimateUserOperationGas_js_1 = require("../../actions/bundler/estimateUserOperationGas.js");
|
|
6
|
+
const getUserOperationByHash_js_1 = require("../../actions/bundler/getUserOperationByHash.js");
|
|
7
|
+
const getUserOperationReceipt_js_1 = require("../../actions/bundler/getUserOperationReceipt.js");
|
|
8
|
+
const sendUserOperation_js_1 = require("../../actions/bundler/sendUserOperation.js");
|
|
9
|
+
const supportedEntryPoints_js_1 = require("../../actions/bundler/supportedEntryPoints.js");
|
|
10
|
+
const waitForUserOperationReceipt_js_1 = require("../../actions/bundler/waitForUserOperationReceipt.js");
|
|
11
|
+
const bundlerActions = (client) => ({
|
|
12
|
+
sendUserOperation: async (args) => (0, sendUserOperation_js_1.sendUserOperation)(client, args),
|
|
13
|
+
estimateUserOperationGas: (args) => (0, estimateUserOperationGas_js_1.estimateUserOperationGas)(client, args),
|
|
14
|
+
supportedEntryPoints: () => (0, supportedEntryPoints_js_1.supportedEntryPoints)(client),
|
|
15
|
+
chainId: () => (0, chainId_js_1.chainId)(client),
|
|
16
|
+
getUserOperationByHash: (args) => (0, getUserOperationByHash_js_1.getUserOperationByHash)(client, args),
|
|
17
|
+
getUserOperationReceipt: (args) => (0, getUserOperationReceipt_js_1.getUserOperationReceipt)(client, args),
|
|
18
|
+
waitForUserOperationReceipt: (args) => (0, waitForUserOperationReceipt_js_1.waitForUserOperationReceipt)(client, args)
|
|
19
|
+
});
|
|
20
|
+
exports.bundlerActions = bundlerActions;
|
|
21
|
+
//# sourceMappingURL=bundler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../../clients/decorators/bundler.ts"],"names":[],"mappings":";;;AAEA,iEAA0D;AAC1D,mGAI0D;AAC1D,+FAIwD;AACxD,iGAIyD;AACzD,qFAAgH;AAChH,2FAAoF;AACpF,yGAG6D;AA4K7D,MAAM,cAAc,GAAG,CAAC,MAAc,EAAkB,EAAE,CAAC,CAAC;IACxD,iBAAiB,EAAE,KAAK,EAAE,IAAiC,EAAiB,EAAE,CAC1E,IAAA,wCAAiB,EAAC,MAAuB,EAAE,IAAI,CAAC;IACpD,wBAAwB,EAAE,CAAC,IAAwC,EAAE,EAAE,CACnE,IAAA,sDAAwB,EAAC,MAAuB,EAAE,IAAI,CAAC;IAC3D,oBAAoB,EAAE,GAAuB,EAAE,CAAC,IAAA,8CAAoB,EAAC,MAAuB,CAAC;IAC7F,OAAO,EAAE,GAAG,EAAE,CAAC,IAAA,oBAAO,EAAC,MAAuB,CAAC;IAC/C,sBAAsB,EAAE,CAAC,IAAsC,EAAE,EAAE,CAC/D,IAAA,kDAAsB,EAAC,MAAuB,EAAE,IAAI,CAAC;IACzD,uBAAuB,EAAE,CAAC,IAAuC,EAAE,EAAE,CACjE,IAAA,oDAAuB,EAAC,MAAuB,EAAE,IAAI,CAAC;IAC1D,2BAA2B,EAAE,CAAC,IAA2C,EAAE,EAAE,CACzE,IAAA,4DAA2B,EAAC,MAAuB,EAAE,IAAI,CAAC;CACjE,CAAC,CAAA;AAEO,wCAAc"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pimlicoPaymasterActions = exports.pimlicoBundlerActions = void 0;
|
|
4
|
+
const getUserOperationGasPrice_js_1 = require("../../actions/pimlico/getUserOperationGasPrice.js");
|
|
5
|
+
const getUserOperationStatus_js_1 = require("../../actions/pimlico/getUserOperationStatus.js");
|
|
6
|
+
const sponsorUserOperation_js_1 = require("../../actions/pimlico/sponsorUserOperation.js");
|
|
7
|
+
const pimlicoBundlerActions = (client) => ({
|
|
8
|
+
getUserOperationGasPrice: async () => (0, getUserOperationGasPrice_js_1.getUserOperationGasPrice)(client),
|
|
9
|
+
getUserOperationStatus: async (args) => (0, getUserOperationStatus_js_1.getUserOperationStatus)(client, args)
|
|
10
|
+
});
|
|
11
|
+
exports.pimlicoBundlerActions = pimlicoBundlerActions;
|
|
12
|
+
const pimlicoPaymasterActions = (client) => ({
|
|
13
|
+
sponsorUserOperation: async (args) => (0, sponsorUserOperation_js_1.sponsorUserOperation)(client, args)
|
|
14
|
+
});
|
|
15
|
+
exports.pimlicoPaymasterActions = pimlicoPaymasterActions;
|
|
16
|
+
//# sourceMappingURL=pimlico.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":";;;AACA,mGAG0D;AAC1D,+FAIwD;AACxD,2FAIsD;AA8C/C,MAAM,qBAAqB,GAAG,CAAC,MAAc,EAAyB,EAAE,CAAC,CAAC;IAC7E,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAAC,IAAA,sDAAwB,EAAC,MAA8B,CAAC;IAC9F,sBAAsB,EAAE,KAAK,EAAE,IAAsC,EAAE,EAAE,CACrE,IAAA,kDAAsB,EAAC,MAA8B,EAAE,IAAI,CAAC;CACnE,CAAC,CAAA;AAJW,QAAA,qBAAqB,yBAIhC;AA6BK,MAAM,uBAAuB,GAAG,CAAC,MAAc,EAAiC,EAAE,CAAC,CAAC;IACvF,oBAAoB,EAAE,KAAK,EAAE,IAAoC,EAAE,EAAE,CACjE,IAAA,8CAAoB,EAAC,MAAgC,EAAE,IAAI,CAAC;CACnE,CAAC,CAAA;AAHW,QAAA,uBAAuB,2BAGlC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stackupPaymasterActions = void 0;
|
|
4
|
+
const accounts_js_1 = require("../../actions/stackup/accounts.js");
|
|
5
|
+
const sponsorUserOperation_js_1 = require("../../actions/stackup/sponsorUserOperation.js");
|
|
6
|
+
const stackupPaymasterActions = (client) => ({
|
|
7
|
+
sponsorUserOperation: async (args) => (0, sponsorUserOperation_js_1.sponsorUserOperation)(client, args),
|
|
8
|
+
accounts: async (args) => (0, accounts_js_1.accounts)(client, args)
|
|
9
|
+
});
|
|
10
|
+
exports.stackupPaymasterActions = stackupPaymasterActions;
|
|
11
|
+
//# sourceMappingURL=stackup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stackup.js","sourceRoot":"","sources":["../../../clients/decorators/stackup.ts"],"names":[],"mappings":";;;AACA,mEAAqF;AACrF,2FAIsD;AAsD/C,MAAM,uBAAuB,GAAG,CAAC,MAAc,EAAiC,EAAE,CAAC,CAAC;IACvF,oBAAoB,EAAE,KAAK,EAAE,IAAoC,EAAE,EAAE,CACjE,IAAA,8CAAoB,EAAC,MAAgC,EAAE,IAAI,CAAC;IAChE,QAAQ,EAAE,KAAK,EAAE,IAAwB,EAAE,EAAE,CAAC,IAAA,sBAAQ,EAAC,MAAgC,EAAE,IAAI,CAAC;CACjG,CAAC,CAAA;AAJW,QAAA,uBAAuB,2BAIlC"}
|
package/_cjs/clients/pimlico.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createPimlicoPaymasterClient = exports.createPimlicoBundlerClient = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const bundler_js_1 = require("./decorators/bundler.js");
|
|
6
|
+
const pimlico_js_1 = require("./decorators/pimlico.js");
|
|
7
7
|
const createPimlicoBundlerClient = (parameters) => {
|
|
8
8
|
const { key = "public", name = "Pimlico Bundler Client" } = parameters;
|
|
9
9
|
const client = (0, viem_1.createClient)({
|
|
@@ -12,7 +12,7 @@ const createPimlicoBundlerClient = (parameters) => {
|
|
|
12
12
|
name,
|
|
13
13
|
type: "pimlicoBundlerClient"
|
|
14
14
|
});
|
|
15
|
-
return client.extend(
|
|
15
|
+
return client.extend(bundler_js_1.bundlerActions).extend(pimlico_js_1.pimlicoBundlerActions);
|
|
16
16
|
};
|
|
17
17
|
exports.createPimlicoBundlerClient = createPimlicoBundlerClient;
|
|
18
18
|
const createPimlicoPaymasterClient = (parameters) => {
|
|
@@ -23,7 +23,7 @@ const createPimlicoPaymasterClient = (parameters) => {
|
|
|
23
23
|
name,
|
|
24
24
|
type: "pimlicoPaymasterClient"
|
|
25
25
|
});
|
|
26
|
-
return client.extend(
|
|
26
|
+
return client.extend(pimlico_js_1.pimlicoPaymasterActions);
|
|
27
27
|
};
|
|
28
28
|
exports.createPimlicoPaymasterClient = createPimlicoPaymasterClient;
|
|
29
29
|
//# sourceMappingURL=pimlico.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../clients/pimlico.ts"],"names":[],"mappings":";;;AACA,+BAAmC;
|
|
1
|
+
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../clients/pimlico.ts"],"names":[],"mappings":";;;AACA,+BAAmC;AAEnC,wDAA6E;AAC7E,wDAKgC;AAqCzB,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,2BAAc,CAAC,CAAC,MAAM,CAAC,kCAAqB,CAAC,CAAA;AACtE,CAAC,CAAA;AAXY,QAAA,0BAA0B,8BAWtC;AAqBM,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,oCAAuB,CAAC,CAAA;AACjD,CAAC,CAAA;AAXY,QAAA,4BAA4B,gCAWxC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createStackupPaymasterClient = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const bundler_js_1 = require("./decorators/bundler.js");
|
|
6
|
+
const stackup_js_1 = require("./decorators/stackup.js");
|
|
7
|
+
const createStackupPaymasterClient = (parameters) => {
|
|
8
|
+
const { key = "public", name = "Stackup Paymaster Client" } = parameters;
|
|
9
|
+
const client = (0, viem_1.createClient)({
|
|
10
|
+
...parameters,
|
|
11
|
+
key,
|
|
12
|
+
name,
|
|
13
|
+
type: "stackupPaymasterClient"
|
|
14
|
+
});
|
|
15
|
+
return client.extend(bundler_js_1.bundlerActions).extend(stackup_js_1.stackupPaymasterActions);
|
|
16
|
+
};
|
|
17
|
+
exports.createStackupPaymasterClient = createStackupPaymasterClient;
|
|
18
|
+
//# sourceMappingURL=stackup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stackup.js","sourceRoot":"","sources":["../../clients/stackup.ts"],"names":[],"mappings":";;;AAAA,+BAAmH;AAEnH,wDAA6E;AAC7E,wDAAqG;AA6B9F,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,2BAAc,CAAC,CAAC,MAAM,CAAC,oCAAuB,CAAC,CAAA;AACxE,CAAC,CAAA;AAXY,QAAA,4BAA4B,gCAWxC"}
|
package/_cjs/index.js
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUserOperationHash = exports.WaitForUserOperationReceiptTimeoutError = exports.bundlerActions = exports.createBundlerClient = exports.waitForUserOperationReceipt = exports.getAccountNonce = exports.getSenderAddress = exports.getUserOperationReceipt = exports.getUserOperationByHash = exports.chainId = exports.supportedEntryPoints = exports.estimateUserOperationGas = exports.sendUserOperation = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const getSenderAddress_js_1 = require("./actions/public/getSenderAddress.js");
|
|
6
|
+
Object.defineProperty(exports, "getSenderAddress", { enumerable: true, get: function () { return getSenderAddress_js_1.getSenderAddress; } });
|
|
7
|
+
const chainId_js_1 = require("./actions/bundler/chainId.js");
|
|
8
|
+
Object.defineProperty(exports, "chainId", { enumerable: true, get: function () { return chainId_js_1.chainId; } });
|
|
9
|
+
const estimateUserOperationGas_js_1 = require("./actions/bundler/estimateUserOperationGas.js");
|
|
10
|
+
Object.defineProperty(exports, "estimateUserOperationGas", { enumerable: true, get: function () { return estimateUserOperationGas_js_1.estimateUserOperationGas; } });
|
|
11
|
+
const getUserOperationByHash_js_1 = require("./actions/bundler/getUserOperationByHash.js");
|
|
12
|
+
Object.defineProperty(exports, "getUserOperationByHash", { enumerable: true, get: function () { return getUserOperationByHash_js_1.getUserOperationByHash; } });
|
|
13
|
+
const getUserOperationReceipt_js_1 = require("./actions/bundler/getUserOperationReceipt.js");
|
|
14
|
+
Object.defineProperty(exports, "getUserOperationReceipt", { enumerable: true, get: function () { return getUserOperationReceipt_js_1.getUserOperationReceipt; } });
|
|
15
|
+
const sendUserOperation_js_1 = require("./actions/bundler/sendUserOperation.js");
|
|
16
|
+
Object.defineProperty(exports, "sendUserOperation", { enumerable: true, get: function () { return sendUserOperation_js_1.sendUserOperation; } });
|
|
17
|
+
const supportedEntryPoints_js_1 = require("./actions/bundler/supportedEntryPoints.js");
|
|
18
|
+
Object.defineProperty(exports, "supportedEntryPoints", { enumerable: true, get: function () { return supportedEntryPoints_js_1.supportedEntryPoints; } });
|
|
19
|
+
const waitForUserOperationReceipt_js_1 = require("./actions/bundler/waitForUserOperationReceipt.js");
|
|
20
|
+
Object.defineProperty(exports, "waitForUserOperationReceipt", { enumerable: true, get: function () { return waitForUserOperationReceipt_js_1.waitForUserOperationReceipt; } });
|
|
21
|
+
const waitForUserOperationReceipt_js_2 = require("./actions/bundler/waitForUserOperationReceipt.js");
|
|
22
|
+
Object.defineProperty(exports, "WaitForUserOperationReceiptTimeoutError", { enumerable: true, get: function () { return waitForUserOperationReceipt_js_2.WaitForUserOperationReceiptTimeoutError; } });
|
|
23
|
+
const getAccountNonce_js_1 = require("./actions/public/getAccountNonce.js");
|
|
24
|
+
Object.defineProperty(exports, "getAccountNonce", { enumerable: true, get: function () { return getAccountNonce_js_1.getAccountNonce; } });
|
|
25
|
+
const bundler_js_1 = require("./clients/bundler.js");
|
|
26
|
+
Object.defineProperty(exports, "createBundlerClient", { enumerable: true, get: function () { return bundler_js_1.createBundlerClient; } });
|
|
27
|
+
const bundler_js_2 = require("./clients/decorators/bundler.js");
|
|
28
|
+
Object.defineProperty(exports, "bundlerActions", { enumerable: true, get: function () { return bundler_js_2.bundlerActions; } });
|
|
29
|
+
const getUserOperationHash_js_1 = require("./utils/getUserOperationHash.js");
|
|
30
|
+
Object.defineProperty(exports, "getUserOperationHash", { enumerable: true, get: function () { return getUserOperationHash_js_1.getUserOperationHash; } });
|
|
31
|
+
tslib_1.__exportStar(require("./utils/index.js"), exports);
|
|
8
32
|
//# sourceMappingURL=index.js.map
|
package/_cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;AAaA,8EAAuE;AAyCnE,iGAzCK,sCAAgB,OAyCL;AAvCpB,6DAAsD;AAoClD,wFApCK,oBAAO,OAoCL;AAnCX,+FAAwF;AAiCpF,yGAjCK,sDAAwB,OAiCL;AAhC5B,2FAAoF;AAmChF,uGAnCK,kDAAsB,OAmCL;AAlC1B,6FAAsF;AAmClF,wGAnCK,oDAAuB,OAmCL;AAlC3B,iFAA0E;AA6BtE,kGA7BK,wCAAiB,OA6BL;AA5BrB,uFAAgF;AA8B5E,qGA9BK,8CAAoB,OA8BL;AA7BxB,qGAA8F;AAmC1F,4GAnCK,4DAA2B,OAmCL;AAlC/B,qGAGyD;AAkCrD,wHAnCA,wEAAuC,OAmCA;AAhC3C,4EAAqE;AA4BjE,gGA5BK,oCAAe,OA4BL;AA3BnB,qDAA8E;AA6B1E,oGA7ByB,gCAAmB,OA6BzB;AA3BvB,gEAAgE;AA4B5D,+FA5BK,2BAAc,OA4BL;AAQlB,6EAAsE;AAE7D,qGAFA,8CAAoB,OAEA;AAC7B,2DAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stackup.js","sourceRoot":"","sources":["../../types/stackup.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepHexlify.js","sourceRoot":"","sources":["../../utils/deepHexlify.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,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUserOperationHash = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
function packUserOp({ userOperation }) {
|
|
6
|
+
const hashedInitCode = (0, viem_1.keccak256)(userOperation.initCode);
|
|
7
|
+
const hashedCallData = (0, viem_1.keccak256)(userOperation.callData);
|
|
8
|
+
const hashedPaymasterAndData = (0, viem_1.keccak256)(userOperation.paymasterAndData);
|
|
9
|
+
return (0, viem_1.encodeAbiParameters)([
|
|
10
|
+
{ type: "address" },
|
|
11
|
+
{ type: "uint256" },
|
|
12
|
+
{ type: "bytes32" },
|
|
13
|
+
{ type: "bytes32" },
|
|
14
|
+
{ type: "uint256" },
|
|
15
|
+
{ type: "uint256" },
|
|
16
|
+
{ type: "uint256" },
|
|
17
|
+
{ type: "uint256" },
|
|
18
|
+
{ type: "uint256" },
|
|
19
|
+
{ type: "bytes32" }
|
|
20
|
+
], [
|
|
21
|
+
userOperation.sender,
|
|
22
|
+
userOperation.nonce,
|
|
23
|
+
hashedInitCode,
|
|
24
|
+
hashedCallData,
|
|
25
|
+
userOperation.callGasLimit,
|
|
26
|
+
userOperation.verificationGasLimit,
|
|
27
|
+
userOperation.preVerificationGas,
|
|
28
|
+
userOperation.maxFeePerGas,
|
|
29
|
+
userOperation.maxPriorityFeePerGas,
|
|
30
|
+
hashedPaymasterAndData
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
const getUserOperationHash = ({ userOperation, entryPoint, chainId }) => {
|
|
34
|
+
const encoded = (0, viem_1.encodeAbiParameters)([{ type: "bytes32" }, { type: "address" }, { type: "uint256" }], [(0, viem_1.keccak256)(packUserOp({ userOperation })), entryPoint, BigInt(chainId)]);
|
|
35
|
+
return (0, viem_1.keccak256)(encoded);
|
|
36
|
+
};
|
|
37
|
+
exports.getUserOperationHash = getUserOperationHash;
|
|
38
|
+
//# sourceMappingURL=getUserOperationHash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserOperationHash.js","sourceRoot":"","sources":["../../utils/getUserOperationHash.ts"],"names":[],"mappings":";;;AACA,+BAAqD;AAGrD,SAAS,UAAU,CAAC,EAAE,aAAa,EAAoC;IACnE,MAAM,cAAc,GAAG,IAAA,gBAAS,EAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;IACxD,MAAM,cAAc,GAAG,IAAA,gBAAS,EAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;IACxD,MAAM,sBAAsB,GAAG,IAAA,gBAAS,EAAC,aAAa,CAAC,gBAAgB,CAAC,CAAA;IAExE,OAAO,IAAA,0BAAmB,EACtB;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;AAyBM,MAAM,oBAAoB,GAAG,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAA8B,EAAQ,EAAE;IAC7G,MAAM,OAAO,GAAG,IAAA,0BAAmB,EAC/B,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAC/D,CAAC,IAAA,gBAAS,EAAC,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CACzD,CAAA;IAElB,OAAO,IAAA,gBAAS,EAAC,OAAO,CAAC,CAAA;AAC7B,CAAC,CAAA;AAPY,QAAA,oBAAoB,wBAOhC"}
|
package/_cjs/utils/index.js
CHANGED
|
@@ -1,38 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getUserOperationHash = void 0;
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
const hashedInitCode = (0, viem_1.keccak256)(userOperation.initCode);
|
|
7
|
-
const hashedCallData = (0, viem_1.keccak256)(userOperation.callData);
|
|
8
|
-
const hashedPaymasterAndData = (0, viem_1.keccak256)(userOperation.paymasterAndData);
|
|
9
|
-
return (0, viem_1.encodeAbiParameters)([
|
|
10
|
-
{ type: "address" },
|
|
11
|
-
{ type: "uint256" },
|
|
12
|
-
{ type: "bytes32" },
|
|
13
|
-
{ type: "bytes32" },
|
|
14
|
-
{ type: "uint256" },
|
|
15
|
-
{ type: "uint256" },
|
|
16
|
-
{ type: "uint256" },
|
|
17
|
-
{ type: "uint256" },
|
|
18
|
-
{ type: "uint256" },
|
|
19
|
-
{ type: "bytes32" }
|
|
20
|
-
], [
|
|
21
|
-
userOperation.sender,
|
|
22
|
-
userOperation.nonce,
|
|
23
|
-
hashedInitCode,
|
|
24
|
-
hashedCallData,
|
|
25
|
-
userOperation.callGasLimit,
|
|
26
|
-
userOperation.verificationGasLimit,
|
|
27
|
-
userOperation.preVerificationGas,
|
|
28
|
-
userOperation.maxFeePerGas,
|
|
29
|
-
userOperation.maxPriorityFeePerGas,
|
|
30
|
-
hashedPaymasterAndData
|
|
31
|
-
]);
|
|
32
|
-
}
|
|
33
|
-
const getUserOperationHash = ({ userOperation, entryPoint, chainId }) => {
|
|
34
|
-
const encoded = (0, viem_1.encodeAbiParameters)([{ type: "bytes32" }, { type: "address" }, { type: "uint256" }], [(0, viem_1.keccak256)(packUserOp({ userOperation })), entryPoint, BigInt(chainId)]);
|
|
35
|
-
return (0, viem_1.keccak256)(encoded);
|
|
36
|
-
};
|
|
37
|
-
exports.getUserOperationHash = getUserOperationHash;
|
|
4
|
+
const getUserOperationHash_js_1 = require("./getUserOperationHash.js");
|
|
5
|
+
Object.defineProperty(exports, "getUserOperationHash", { enumerable: true, get: function () { return getUserOperationHash_js_1.getUserOperationHash; } });
|
|
38
6
|
//# sourceMappingURL=index.js.map
|
package/_cjs/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":";;;AAAA,uEAAiG;AAExF,qGAFiC,8CAAoB,OAEjC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.observe = exports.cleanupCache = exports.listenersCache = void 0;
|
|
4
|
+
exports.listenersCache = new Map();
|
|
5
|
+
exports.cleanupCache = new Map();
|
|
6
|
+
let callbackCount = 0;
|
|
7
|
+
function observe(observerId, callbacks, fn) {
|
|
8
|
+
const callbackId = ++callbackCount;
|
|
9
|
+
const getListeners = () => exports.listenersCache.get(observerId) || [];
|
|
10
|
+
const unsubscribe = () => {
|
|
11
|
+
const listeners = getListeners();
|
|
12
|
+
exports.listenersCache.set(observerId, listeners.filter((cb) => cb.id !== callbackId));
|
|
13
|
+
};
|
|
14
|
+
const unwatch = () => {
|
|
15
|
+
const cleanup = exports.cleanupCache.get(observerId);
|
|
16
|
+
if (getListeners().length === 1 && cleanup)
|
|
17
|
+
cleanup();
|
|
18
|
+
unsubscribe();
|
|
19
|
+
};
|
|
20
|
+
const listeners = getListeners();
|
|
21
|
+
exports.listenersCache.set(observerId, [...listeners, { id: callbackId, fns: callbacks }]);
|
|
22
|
+
if (listeners && listeners.length > 0)
|
|
23
|
+
return unwatch;
|
|
24
|
+
const emit = {};
|
|
25
|
+
for (const key in callbacks) {
|
|
26
|
+
emit[key] = ((...args) => {
|
|
27
|
+
const listeners = getListeners();
|
|
28
|
+
if (listeners.length === 0)
|
|
29
|
+
return;
|
|
30
|
+
listeners.forEach((listener) => listener.fns[key]?.(...args));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const cleanup = fn(emit);
|
|
34
|
+
if (typeof cleanup === "function")
|
|
35
|
+
exports.cleanupCache.set(observerId, cleanup);
|
|
36
|
+
return unwatch;
|
|
37
|
+
}
|
|
38
|
+
exports.observe = observe;
|
|
39
|
+
//# sourceMappingURL=observe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observe.js","sourceRoot":"","sources":["../../utils/observe.ts"],"names":[],"mappings":";;;AAMa,QAAA,cAAc,GAAiB,IAAI,GAAG,EAA4C,CAAA;AAClF,QAAA,YAAY,GAAiB,IAAI,GAAG,EAAsB,CAAA;AAIvE,IAAI,aAAa,GAAG,CAAC,CAAA;AAOrB,SAAgB,OAAO,CACnB,UAAkB,EAClB,SAAqB,EACrB,EAA4B;IAE5B,MAAM,UAAU,GAAG,EAAE,aAAa,CAAA;IAElC,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,sBAAc,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,CAAA;IAE/D,MAAM,WAAW,GAAG,GAAG,EAAE;QACrB,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;QAChC,sBAAc,CAAC,GAAG,CACd,UAAU,EAEV,SAAS,CAAC,MAAM,CAAC,CAAC,EAAO,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,UAAU,CAAC,CACtD,CAAA;IACL,CAAC,CAAA;IAED,MAAM,OAAO,GAAG,GAAG,EAAE;QACjB,MAAM,OAAO,GAAG,oBAAY,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;QAC5C,IAAI,YAAY,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO;YAAE,OAAO,EAAE,CAAA;QACrD,WAAW,EAAE,CAAA;IACjB,CAAC,CAAA;IAED,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,sBAAc,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,GAAG,SAAS,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;IAElF,IAAI,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,OAAO,CAAA;IAErD,MAAM,IAAI,GAAe,EAAgB,CAAA;IACzC,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE;QACzB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,IAA2D,EAAE,EAAE;YAC5E,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;YAChC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAM;YAClC,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAA;QACjE,CAAC,CAAkD,CAAA;KACtD;IAED,MAAM,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;IACxB,IAAI,OAAO,OAAO,KAAK,UAAU;QAAE,oBAAY,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IAExE,OAAO,OAAO,CAAA;AAClB,CAAC;AA1CD,0BA0CC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the supported chain id by the bundler service
|
|
3
|
+
*
|
|
4
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/chainId
|
|
5
|
+
*
|
|
6
|
+
* @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
|
|
7
|
+
* @returns Supported chain id
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* import { createClient } from "viem"
|
|
12
|
+
* import { chainId } from "permissionless/actions"
|
|
13
|
+
*
|
|
14
|
+
* const bundlerClient = createClient({
|
|
15
|
+
* chain: goerli,
|
|
16
|
+
* transport: http(BUNDLER_URL)
|
|
17
|
+
* })
|
|
18
|
+
*
|
|
19
|
+
* const bundlerChainId = chainId(bundlerClient)
|
|
20
|
+
* // Return 5n for Goerli
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
export const chainId = async (client) => {
|
|
24
|
+
return Number(await client.request({
|
|
25
|
+
method: "eth_chainId",
|
|
26
|
+
params: []
|
|
27
|
+
}));
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=chainId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chainId.js","sourceRoot":"","sources":["../../../actions/bundler/chainId.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,MAAqB,EAAE,EAAE;IACnD,OAAO,MAAM,CACT,MAAM,MAAM,CAAC,OAAO,CAAC;QACjB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,EAAE;KACb,CAAC,CACL,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { deepHexlify } from "../../utils/deepHexlify.js";
|
|
2
|
+
/**
|
|
3
|
+
* Estimates preVerificationGas, verificationGasLimit and callGasLimit for user operation
|
|
4
|
+
*
|
|
5
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/estimateUserOperationGas
|
|
6
|
+
*
|
|
7
|
+
* @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
|
|
8
|
+
* @param args {@link EstimateUserOperationGasParameters}
|
|
9
|
+
* @returns preVerificationGas, verificationGasLimit and callGasLimit as {@link EstimateUserOperationGasReturnType}
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { createClient } from "viem"
|
|
14
|
+
* import { estimateUserOperationGas } from "permissionless/actions"
|
|
15
|
+
*
|
|
16
|
+
* const bundlerClient = createClient({
|
|
17
|
+
* chain: goerli,
|
|
18
|
+
* transport: http(BUNDLER_URL)
|
|
19
|
+
* })
|
|
20
|
+
*
|
|
21
|
+
* const gasParameters = estimateUserOperationGas(bundlerClient, {
|
|
22
|
+
* serOperation: signedUserOperation,
|
|
23
|
+
* entryPoint: entryPoint
|
|
24
|
+
* })
|
|
25
|
+
*
|
|
26
|
+
* // Return {preVerificationGas: 43492n, verificationGasLimit: 59436n, callGasLimit: 9000n}
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
export const estimateUserOperationGas = async (client, args) => {
|
|
30
|
+
const { userOperation, entryPoint } = args;
|
|
31
|
+
const response = await client.request({
|
|
32
|
+
method: "eth_estimateUserOperationGas",
|
|
33
|
+
params: [deepHexlify(userOperation), entryPoint]
|
|
34
|
+
});
|
|
35
|
+
return {
|
|
36
|
+
preVerificationGas: BigInt(response.preVerificationGas || 0),
|
|
37
|
+
verificationGasLimit: BigInt(response.verificationGasLimit || 0),
|
|
38
|
+
callGasLimit: BigInt(response.callGasLimit || 0)
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=estimateUserOperationGas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimateUserOperationGas.js","sourceRoot":"","sources":["../../../actions/bundler/estimateUserOperationGas.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAaxD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,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,WAAW,CAAC,aAAa,CAAiC,EAAE,UAAqB,CAAC;KAC9F,CAAC,CAAA;IAEF,OAAO;QACH,kBAAkB,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,IAAI,CAAC,CAAC;QAC5D,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,oBAAoB,IAAI,CAAC,CAAC;QAChE,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,YAAY,IAAI,CAAC,CAAC;KACnD,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the user operation from userOpHash
|
|
3
|
+
*
|
|
4
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationByHash
|
|
5
|
+
*
|
|
6
|
+
* @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
|
|
7
|
+
* @param args {@link GetUserOperationByHashParameters} UserOpHash that was returned by {@link sendUserOperation}
|
|
8
|
+
* @returns userOperation along with entryPoint, transactionHash, blockHash, blockNumber if found or null
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import { createClient } from "viem"
|
|
13
|
+
* import { getUserOperationByHash } from "permissionless/actions"
|
|
14
|
+
*
|
|
15
|
+
* const bundlerClient = createClient({
|
|
16
|
+
* chain: goerli,
|
|
17
|
+
* transport: http(BUNDLER_URL)
|
|
18
|
+
* })
|
|
19
|
+
*
|
|
20
|
+
* getUserOperationByHash(bundlerClient, {hash: userOpHash})
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
export const getUserOperationByHash = async (client, { hash }) => {
|
|
24
|
+
const params = [hash];
|
|
25
|
+
const response = await client.request({
|
|
26
|
+
method: "eth_getUserOperationByHash",
|
|
27
|
+
params
|
|
28
|
+
});
|
|
29
|
+
if (!response)
|
|
30
|
+
return null;
|
|
31
|
+
const { userOperation, entryPoint, transactionHash, blockHash, blockNumber } = response;
|
|
32
|
+
return {
|
|
33
|
+
userOperation: {
|
|
34
|
+
...userOperation,
|
|
35
|
+
nonce: BigInt(userOperation.nonce),
|
|
36
|
+
callGasLimit: BigInt(userOperation.callGasLimit),
|
|
37
|
+
verificationGasLimit: BigInt(userOperation.verificationGasLimit),
|
|
38
|
+
preVerificationGas: BigInt(userOperation.preVerificationGas),
|
|
39
|
+
maxFeePerGas: BigInt(userOperation.maxFeePerGas),
|
|
40
|
+
maxPriorityFeePerGas: BigInt(userOperation.maxPriorityFeePerGas)
|
|
41
|
+
},
|
|
42
|
+
entryPoint: entryPoint,
|
|
43
|
+
transactionHash: transactionHash,
|
|
44
|
+
blockHash: blockHash,
|
|
45
|
+
blockNumber: BigInt(blockNumber)
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=getUserOperationByHash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserOperationByHash.js","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationByHash.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EACvC,MAAqB,EACrB,EAAE,IAAI,EAAoC,EACD,EAAE;IAC3C,MAAM,MAAM,GAAW,CAAC,IAAI,CAAC,CAAA;IAE7B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,4BAA4B;QACpC,MAAM;KACT,CAAC,CAAA;IAEF,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAA;IAE1B,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,QAAQ,CAAA;IAEvF,OAAO;QACH,aAAa,EAAE;YACX,GAAG,aAAa;YAChB,KAAK,EAAE,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC;YAClC,YAAY,EAAE,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC;YAChD,oBAAoB,EAAE,MAAM,CAAC,aAAa,CAAC,oBAAoB,CAAC;YAChE,kBAAkB,EAAE,MAAM,CAAC,aAAa,CAAC,kBAAkB,CAAC;YAC5D,YAAY,EAAE,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC;YAChD,oBAAoB,EAAE,MAAM,CAAC,aAAa,CAAC,oBAAoB,CAAC;SAClD;QAClB,UAAU,EAAE,UAAU;QACtB,eAAe,EAAE,eAAe;QAChC,SAAS,EAAE,SAAS;QACpB,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC;KACnC,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { transactionReceiptStatus } from "../../utils/deepHexlify.js";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the user operation receipt from userOpHash
|
|
4
|
+
*
|
|
5
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt
|
|
6
|
+
*
|
|
7
|
+
* @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
|
|
8
|
+
* @param args {@link GetUserOperationReceiptParameters} UserOpHash that was returned by {@link sendUserOperation}
|
|
9
|
+
* @returns user operation receipt {@link GetUserOperationReceiptReturnType} if found or null
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { createClient } from "viem"
|
|
14
|
+
* import { getUserOperationReceipt } from "permissionless/actions"
|
|
15
|
+
*
|
|
16
|
+
* const bundlerClient = createClient({
|
|
17
|
+
* chain: goerli,
|
|
18
|
+
* transport: http(BUNDLER_URL)
|
|
19
|
+
* })
|
|
20
|
+
*
|
|
21
|
+
* getUserOperationReceipt(bundlerClient, {hash: userOpHash})
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
export const getUserOperationReceipt = async (client, { hash }) => {
|
|
25
|
+
const params = [hash];
|
|
26
|
+
const response = await client.request({
|
|
27
|
+
method: "eth_getUserOperationReceipt",
|
|
28
|
+
params
|
|
29
|
+
});
|
|
30
|
+
if (!response)
|
|
31
|
+
return null;
|
|
32
|
+
const userOperationReceipt = {
|
|
33
|
+
userOpHash: response.userOpHash,
|
|
34
|
+
sender: response.sender,
|
|
35
|
+
nonce: BigInt(response.nonce),
|
|
36
|
+
actualGasUsed: BigInt(response.actualGasUsed),
|
|
37
|
+
actualGasCost: BigInt(response.actualGasCost),
|
|
38
|
+
success: response.success,
|
|
39
|
+
receipt: {
|
|
40
|
+
transactionHash: response.receipt.transactionHash,
|
|
41
|
+
transactionIndex: BigInt(response.receipt.transactionIndex),
|
|
42
|
+
blockHash: response.receipt.blockHash,
|
|
43
|
+
blockNumber: BigInt(response.receipt.blockNumber),
|
|
44
|
+
from: response.receipt.from,
|
|
45
|
+
to: response.receipt.to,
|
|
46
|
+
cumulativeGasUsed: BigInt(response.receipt.cumulativeGasUsed),
|
|
47
|
+
status: transactionReceiptStatus[response.receipt.status],
|
|
48
|
+
gasUsed: BigInt(response.receipt.gasUsed),
|
|
49
|
+
contractAddress: response.receipt.contractAddress,
|
|
50
|
+
logsBloom: response.receipt.logsBloom,
|
|
51
|
+
effectiveGasPrice: BigInt(response.receipt.effectiveGasPrice)
|
|
52
|
+
},
|
|
53
|
+
logs: response.logs.map((log) => ({
|
|
54
|
+
data: log.data,
|
|
55
|
+
blockNumber: BigInt(log.blockNumber),
|
|
56
|
+
blockHash: log.blockHash,
|
|
57
|
+
transactionHash: log.transactionHash,
|
|
58
|
+
logIndex: BigInt(log.logIndex),
|
|
59
|
+
transactionIndex: BigInt(log.transactionIndex),
|
|
60
|
+
address: log.address,
|
|
61
|
+
topics: log.topics
|
|
62
|
+
}))
|
|
63
|
+
};
|
|
64
|
+
return userOperationReceipt;
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=getUserOperationReceipt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserOperationReceipt.js","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationReceipt.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAuCrE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,EACxC,MAAqB,EACrB,EAAE,IAAI,EAAqC,EACM,EAAE;IACnD,MAAM,MAAM,GAAW,CAAC,IAAI,CAAC,CAAA;IAE7B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,6BAA6B;QACrC,MAAM;KACT,CAAC,CAAA;IAEF,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAA;IAE1B,MAAM,oBAAoB,GAAsC;QAC5D,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC7B,aAAa,EAAE,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC;QAC7C,aAAa,EAAE,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC;QAC7C,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,OAAO,EAAE;YACL,eAAe,EAAE,QAAQ,CAAC,OAAO,CAAC,eAAe;YACjD,gBAAgB,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC;YAC3D,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS;YACrC,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC;YACjD,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI;YAC3B,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE;YACvB,iBAAiB,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,iBAAiB,CAAC;YAC7D,MAAM,EAAE,wBAAwB,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;YACzD,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC;YACzC,eAAe,EAAE,QAAQ,CAAC,OAAO,CAAC,eAAe;YACjD,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS;YACrC,iBAAiB,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,iBAAiB,CAAC;SAChE;QACD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,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"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { deepHexlify } from "../../utils/deepHexlify.js";
|
|
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
|
+
//# sourceMappingURL=sendUserOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendUserOperation.js","sourceRoot":"","sources":["../../../actions/bundler/sendUserOperation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAOxD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,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,WAAW,CAAC,aAAa,CAAiC,EAAE,UAAqB,CAAC;KAC9F,CAAC,CAAA;AACN,CAAC,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the supported entrypoints by the bundler service
|
|
3
|
+
*
|
|
4
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/supportedEntryPoints
|
|
5
|
+
*
|
|
6
|
+
* @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
|
|
7
|
+
* @returns Supported entryPoints
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* import { createClient } from "viem"
|
|
12
|
+
* import { supportedEntryPoints } from "permissionless/actions"
|
|
13
|
+
*
|
|
14
|
+
* const bundlerClient = createClient({
|
|
15
|
+
* chain: goerli,
|
|
16
|
+
* transport: http(BUNDLER_URL)
|
|
17
|
+
* })
|
|
18
|
+
*
|
|
19
|
+
* const entryPointsSupported = supportedEntryPoints(bundlerClient)
|
|
20
|
+
* // Return ['0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789']
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
export const supportedEntryPoints = async (client) => {
|
|
24
|
+
return client.request({
|
|
25
|
+
method: "eth_supportedEntryPoints",
|
|
26
|
+
params: []
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=supportedEntryPoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supportedEntryPoints.js","sourceRoot":"","sources":["../../../actions/bundler/supportedEntryPoints.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EAAE,MAAqB,EAAsB,EAAE;IACpF,OAAO,MAAM,CAAC,OAAO,CAAC;QAClB,MAAM,EAAE,0BAA0B;QAClC,MAAM,EAAE,EAAE;KACb,CAAC,CAAA;AACN,CAAC,CAAA"}
|