permissionless 0.0.29 → 0.0.30
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 +6 -0
- package/_cjs/actions/pimlico/getUserOperationStatus.js.map +1 -1
- package/_cjs/actions/pimlico/sendCompressedUserOperation.js +16 -0
- package/_cjs/actions/pimlico/sendCompressedUserOperation.js.map +1 -0
- package/_cjs/actions/pimlico.js +3 -1
- package/_cjs/actions/pimlico.js.map +1 -1
- package/_cjs/clients/decorators/pimlico.js +2 -1
- package/_cjs/clients/decorators/pimlico.js.map +1 -1
- package/_esm/actions/pimlico/getUserOperationStatus.js +2 -1
- package/_esm/actions/pimlico/getUserOperationStatus.js.map +1 -1
- package/_esm/actions/pimlico/sendCompressedUserOperation.js +38 -0
- package/_esm/actions/pimlico/sendCompressedUserOperation.js.map +1 -0
- package/_esm/actions/pimlico.js +2 -1
- package/_esm/actions/pimlico.js.map +1 -1
- package/_esm/clients/decorators/pimlico.js +3 -2
- package/_esm/clients/decorators/pimlico.js.map +1 -1
- package/_types/actions/pimlico/getUserOperationStatus.d.ts +2 -1
- package/_types/actions/pimlico/getUserOperationStatus.d.ts.map +1 -1
- package/_types/actions/pimlico/sendCompressedUserOperation.d.ts +35 -0
- package/_types/actions/pimlico/sendCompressedUserOperation.d.ts.map +1 -0
- package/_types/actions/pimlico.d.ts +3 -2
- package/_types/actions/pimlico.d.ts.map +1 -1
- package/_types/clients/decorators/pimlico.d.ts +27 -2
- package/_types/clients/decorators/pimlico.d.ts.map +1 -1
- package/_types/types/pimlico.d.ts +9 -0
- package/_types/types/pimlico.d.ts.map +1 -1
- package/actions/pimlico/getUserOperationStatus.ts +2 -1
- package/actions/pimlico/sendCompressedUserOperation.ts +62 -0
- package/actions/pimlico.ts +11 -5
- package/clients/decorators/pimlico.ts +33 -1
- package/package.json +1 -1
- package/types/pimlico.ts +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserOperationStatus.js","sourceRoot":"","sources":["../../../actions/pimlico/getUserOperationStatus.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"getUserOperationStatus.js","sourceRoot":"","sources":["../../../actions/pimlico/getUserOperationStatus.ts"],"names":[],"mappings":";;;AAqCO,MAAM,sBAAsB,GAAG,KAAK,EAKvC,MAAqE,EACrE,EAAE,IAAI,EAA8C,EACD,EAAE;IACrD,OAAO,MAAM,CAAC,OAAO,CAAC;QAClB,MAAM,EAAE,gCAAgC;QACxC,MAAM,EAAE,CAAC,IAAI,CAAC;KACjB,CAAC,CAAA;AACN,CAAC,CAAA;AAZY,QAAA,sBAAsB,0BAYlC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendCompressedUserOperation = void 0;
|
|
4
|
+
const sendCompressedUserOperation = async (client, args) => {
|
|
5
|
+
const { compressedUserOperation, inflatorAddress, entryPoint } = args;
|
|
6
|
+
return client.request({
|
|
7
|
+
method: "pimlico_sendCompressedUserOperation",
|
|
8
|
+
params: [
|
|
9
|
+
compressedUserOperation,
|
|
10
|
+
inflatorAddress,
|
|
11
|
+
entryPoint
|
|
12
|
+
]
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
exports.sendCompressedUserOperation = sendCompressedUserOperation;
|
|
16
|
+
//# sourceMappingURL=sendCompressedUserOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendCompressedUserOperation.js","sourceRoot":"","sources":["../../../actions/pimlico/sendCompressedUserOperation.ts"],"names":[],"mappings":";;;AA2CO,MAAM,2BAA2B,GAAG,KAAK,EAK5C,MAAqE,EACrE,IAAqD,EACxC,EAAE;IACf,MAAM,EAAE,uBAAuB,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAErE,OAAO,MAAM,CAAC,OAAO,CAAC;QAClB,MAAM,EAAE,qCAAqC;QAC7C,MAAM,EAAE;YACJ,uBAA8B;YAC9B,eAA0B;YAC1B,UAAqB;SACxB;KACJ,CAAC,CAAA;AACN,CAAC,CAAA;AAlBY,QAAA,2BAA2B,+BAkBvC"}
|
package/_cjs/actions/pimlico.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateSponsorshipPolicies = exports.
|
|
3
|
+
exports.validateSponsorshipPolicies = exports.sponsorUserOperation = exports.sendCompressedUserOperation = exports.pimlicoPaymasterActions = exports.pimlicoBundlerActions = exports.getUserOperationStatus = exports.getUserOperationGasPrice = void 0;
|
|
4
4
|
const getUserOperationGasPrice_js_1 = require("./pimlico/getUserOperationGasPrice.js");
|
|
5
5
|
Object.defineProperty(exports, "getUserOperationGasPrice", { enumerable: true, get: function () { return getUserOperationGasPrice_js_1.getUserOperationGasPrice; } });
|
|
6
6
|
const getUserOperationStatus_js_1 = require("./pimlico/getUserOperationStatus.js");
|
|
7
7
|
Object.defineProperty(exports, "getUserOperationStatus", { enumerable: true, get: function () { return getUserOperationStatus_js_1.getUserOperationStatus; } });
|
|
8
|
+
const sendCompressedUserOperation_js_1 = require("./pimlico/sendCompressedUserOperation.js");
|
|
9
|
+
Object.defineProperty(exports, "sendCompressedUserOperation", { enumerable: true, get: function () { return sendCompressedUserOperation_js_1.sendCompressedUserOperation; } });
|
|
8
10
|
const sponsorUserOperation_js_1 = require("./pimlico/sponsorUserOperation.js");
|
|
9
11
|
Object.defineProperty(exports, "sponsorUserOperation", { enumerable: true, get: function () { return sponsorUserOperation_js_1.sponsorUserOperation; } });
|
|
10
12
|
const pimlico_js_1 = require("../clients/decorators/pimlico.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":";;;AAAA,uFAG8C;
|
|
1
|
+
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":";;;AAAA,uFAG8C;AA6C1C,yGA9CA,sDAAwB,OA8CA;AA5C5B,mFAI4C;AAyCxC,uGA1CA,kDAAsB,OA0CA;AAxC1B,6FAGiD;AAwC7C,4GAzCA,4DAA2B,OAyCA;AAvC/B,+EAI0C;AAoCtC,qGArCA,8CAAoB,OAqCA;AA9BxB,iEAGyC;AAwBrC,sGA1BA,kCAAqB,OA0BA;AACrB,wGA1BA,oCAAuB,OA0BA;AAvB3B,6FAIiD;AAsB7C,4GAvBA,4DAA2B,OAuBA"}
|
|
@@ -7,7 +7,8 @@ const getUserOperationStatus_js_1 = require("../../actions/pimlico/getUserOperat
|
|
|
7
7
|
const sponsorUserOperation_js_1 = require("../../actions/pimlico/sponsorUserOperation.js");
|
|
8
8
|
const pimlicoBundlerActions = (client) => ({
|
|
9
9
|
getUserOperationGasPrice: async () => (0, getUserOperationGasPrice_js_1.getUserOperationGasPrice)(client),
|
|
10
|
-
getUserOperationStatus: async (args) => (0, getUserOperationStatus_js_1.getUserOperationStatus)(client, args)
|
|
10
|
+
getUserOperationStatus: async (args) => (0, getUserOperationStatus_js_1.getUserOperationStatus)(client, args),
|
|
11
|
+
sendCompressedUserOperation: async (args) => (0, pimlico_js_1.sendCompressedUserOperation)(client, args)
|
|
11
12
|
});
|
|
12
13
|
exports.pimlicoBundlerActions = pimlicoBundlerActions;
|
|
13
14
|
const pimlicoPaymasterActions = (client) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":";;;AACA,yDAMiC;AACjC,mGAG0D;AAC1D,+FAIwD;AACxD,2FAIsD;AAiF/C,MAAM,qBAAqB,GAAG,CACjC,MAAc,EACO,EAAE,CAAC,CAAC;IACzB,wBAAwB,EAAE,KAAK,IAAI,EAAE,CACjC,IAAA,sDAAwB,EAAC,MAA8B,CAAC;IAC5D,sBAAsB,EAAE,KAAK,EAAE,IAAsC,EAAE,EAAE,CACrE,IAAA,kDAAsB,EAAC,MAA8B,EAAE,IAAI,CAAC;IAChE,2BAA2B,EAAE,KAAK,EAC9B,IAA2C,EAC7C,EAAE,CAAC,IAAA,wCAA2B,EAAC,MAA8B,EAAE,IAAI,CAAC;CACzE,CAAC,CAAA;AAVW,QAAA,qBAAqB,yBAUhC;AAsEK,MAAM,uBAAuB,GAAG,CACnC,MAAc,EACe,EAAE,CAAC,CAAC;IACjC,oBAAoB,EAAE,KAAK,EAAE,IAA2C,EAAE,EAAE,CACxE,IAAA,8CAAoB,EAAC,MAAgC,EAAE,IAAI,CAAC;IAChE,2BAA2B,EAAE,KAAK,EAC9B,IAA2C,EAC7C,EAAE,CAAC,IAAA,wCAA2B,EAAC,MAAgC,EAAE,IAAI,CAAC;CAC3E,CAAC,CAAA;AARW,QAAA,uBAAuB,2BAQlC"}
|
|
@@ -11,11 +11,12 @@
|
|
|
11
11
|
* @example
|
|
12
12
|
* import { createClient } from "viem"
|
|
13
13
|
* import { getUserOperationStatus } from "permissionless/actions/pimlico"
|
|
14
|
+
* import { pimlicoBundlerActions } from 'permissionless/actions/pimlico'
|
|
14
15
|
*
|
|
15
16
|
* const bundlerClient = createClient({
|
|
16
17
|
* chain: goerli,
|
|
17
18
|
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
18
|
-
* })
|
|
19
|
+
* }).extend(pimlicoBundlerActions)
|
|
19
20
|
*
|
|
20
21
|
* await getUserOperationStatus(bundlerClient, { hash: userOpHash })
|
|
21
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserOperationStatus.js","sourceRoot":"","sources":["../../../actions/pimlico/getUserOperationStatus.ts"],"names":[],"mappings":"AAcA
|
|
1
|
+
{"version":3,"file":"getUserOperationStatus.js","sourceRoot":"","sources":["../../../actions/pimlico/getUserOperationStatus.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EAKvC,MAAqE,EACrE,EAAE,IAAI,EAA8C,EACD,EAAE;IACrD,OAAO,MAAM,CAAC,OAAO,CAAC;QAClB,MAAM,EAAE,gCAAgC;QACxC,MAAM,EAAE,CAAC,IAAI,CAAC;KACjB,CAAC,CAAA;AACN,CAAC,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {} from "../../types/pimlico.js";
|
|
2
|
+
/**
|
|
3
|
+
* Sends a compressed user operation to the bundler
|
|
4
|
+
*
|
|
5
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/sendCompressedUserOperation
|
|
6
|
+
*
|
|
7
|
+
* @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
|
|
8
|
+
* @param args {@link SendCompressedUserOperationParameters}.
|
|
9
|
+
* @returns UserOpHash that you can use to track user operation as {@link Hash}.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import { pimlicoBundlerActions, sendCompressedUserOperation } from 'permissionless/actions/pimlico'
|
|
13
|
+
* import { createClient } from "viem"
|
|
14
|
+
*
|
|
15
|
+
* const bundlerClient = createClient({
|
|
16
|
+
* chain: goerli,
|
|
17
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
18
|
+
* }).extend(pimlicoBundlerActions)
|
|
19
|
+
*
|
|
20
|
+
* const userOpHash = await sendCompressedUserOperation(bundlerClient, {
|
|
21
|
+
* compressedUserOperation,
|
|
22
|
+
* inflatorAddress,
|
|
23
|
+
* entryPoint
|
|
24
|
+
* })
|
|
25
|
+
* // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
|
|
26
|
+
*/
|
|
27
|
+
export const sendCompressedUserOperation = async (client, args) => {
|
|
28
|
+
const { compressedUserOperation, inflatorAddress, entryPoint } = args;
|
|
29
|
+
return client.request({
|
|
30
|
+
method: "pimlico_sendCompressedUserOperation",
|
|
31
|
+
params: [
|
|
32
|
+
compressedUserOperation,
|
|
33
|
+
inflatorAddress,
|
|
34
|
+
entryPoint
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=sendCompressedUserOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendCompressedUserOperation.js","sourceRoot":"","sources":["../../../actions/pimlico/sendCompressedUserOperation.ts"],"names":[],"mappings":"AAUA,OAAO,EAAgC,MAAM,wBAAwB,CAAA;AAQrE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,EAK5C,MAAqE,EACrE,IAAqD,EACxC,EAAE;IACf,MAAM,EAAE,uBAAuB,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAErE,OAAO,MAAM,CAAC,OAAO,CAAC;QAClB,MAAM,EAAE,qCAAqC;QAC7C,MAAM,EAAE;YACJ,uBAA8B;YAC9B,eAA0B;YAC1B,UAAqB;SACxB;KACJ,CAAC,CAAA;AACN,CAAC,CAAA"}
|
package/_esm/actions/pimlico.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getUserOperationGasPrice } from "./pimlico/getUserOperationGasPrice.js";
|
|
2
2
|
import { getUserOperationStatus } from "./pimlico/getUserOperationStatus.js";
|
|
3
|
+
import { sendCompressedUserOperation } from "./pimlico/sendCompressedUserOperation.js";
|
|
3
4
|
import { sponsorUserOperation } from "./pimlico/sponsorUserOperation.js";
|
|
4
5
|
import { pimlicoBundlerActions, pimlicoPaymasterActions } from "../clients/decorators/pimlico.js";
|
|
5
6
|
import { validateSponsorshipPolicies } from "./pimlico/validateSponsorshipPolicies.js";
|
|
6
|
-
export { getUserOperationGasPrice, getUserOperationStatus,
|
|
7
|
+
export { getUserOperationGasPrice, getUserOperationStatus, pimlicoBundlerActions, pimlicoPaymasterActions, sendCompressedUserOperation, sponsorUserOperation, validateSponsorshipPolicies };
|
|
7
8
|
//# sourceMappingURL=pimlico.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,wBAAwB,EAC3B,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAGH,sBAAsB,EACzB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAGH,oBAAoB,EACvB,MAAM,mCAAmC,CAAA;AAM1C,OAAO,EACH,qBAAqB,EACrB,uBAAuB,EAC1B,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EAGH,2BAA2B,EAC9B,MAAM,0CAA0C,CAAA;
|
|
1
|
+
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,wBAAwB,EAC3B,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAGH,sBAAsB,EACzB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAEH,2BAA2B,EAC9B,MAAM,0CAA0C,CAAA;AACjD,OAAO,EAGH,oBAAoB,EACvB,MAAM,mCAAmC,CAAA;AAM1C,OAAO,EACH,qBAAqB,EACrB,uBAAuB,EAC1B,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EAGH,2BAA2B,EAC9B,MAAM,0CAA0C,CAAA;AAejD,OAAO,EACH,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,EAC3B,oBAAoB,EACpB,2BAA2B,EAC9B,CAAA"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { validateSponsorshipPolicies } from "../../actions/pimlico.js";
|
|
1
|
+
import { sendCompressedUserOperation, validateSponsorshipPolicies } from "../../actions/pimlico.js";
|
|
2
2
|
import { getUserOperationGasPrice } from "../../actions/pimlico/getUserOperationGasPrice.js";
|
|
3
3
|
import { getUserOperationStatus } from "../../actions/pimlico/getUserOperationStatus.js";
|
|
4
4
|
import { sponsorUserOperation } from "../../actions/pimlico/sponsorUserOperation.js";
|
|
5
5
|
export const pimlicoBundlerActions = (client) => ({
|
|
6
6
|
getUserOperationGasPrice: async () => getUserOperationGasPrice(client),
|
|
7
|
-
getUserOperationStatus: async (args) => getUserOperationStatus(client, args)
|
|
7
|
+
getUserOperationStatus: async (args) => getUserOperationStatus(client, args),
|
|
8
|
+
sendCompressedUserOperation: async (args) => sendCompressedUserOperation(client, args)
|
|
8
9
|
});
|
|
9
10
|
/**
|
|
10
11
|
* Returns valid sponsorship policies for a userOperation from the list of ids passed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":"AACA,OAAO,EAIH,2BAA2B,EAC3B,2BAA2B,EAC9B,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAEH,wBAAwB,EAC3B,MAAM,mDAAmD,CAAA;AAC1D,OAAO,EAGH,sBAAsB,EACzB,MAAM,iDAAiD,CAAA;AACxD,OAAO,EAGH,oBAAoB,EACvB,MAAM,+CAA+C,CAAA;AAiFtD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACjC,MAAc,EACO,EAAE,CAAC,CAAC;IACzB,wBAAwB,EAAE,KAAK,IAAI,EAAE,CACjC,wBAAwB,CAAC,MAA8B,CAAC;IAC5D,sBAAsB,EAAE,KAAK,EAAE,IAAsC,EAAE,EAAE,CACrE,sBAAsB,CAAC,MAA8B,EAAE,IAAI,CAAC;IAChE,2BAA2B,EAAE,KAAK,EAC9B,IAA2C,EAC7C,EAAE,CAAC,2BAA2B,CAAC,MAA8B,EAAE,IAAI,CAAC;CACzE,CAAC,CAAA;AAmCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACnC,MAAc,EACe,EAAE,CAAC,CAAC;IACjC,oBAAoB,EAAE,KAAK,EAAE,IAA2C,EAAE,EAAE,CACxE,oBAAoB,CAAC,MAAgC,EAAE,IAAI,CAAC;IAChE,2BAA2B,EAAE,KAAK,EAC9B,IAA2C,EAC7C,EAAE,CAAC,2BAA2B,CAAC,MAAgC,EAAE,IAAI,CAAC;CAC3E,CAAC,CAAA;AAEF;;GAEG;AACH,sDAAsD;AACtD,eAAe;AACf,4CAA4C;AAC5C,6CAA6C;AAC7C,QAAQ;AACR,IAAI"}
|
|
@@ -18,11 +18,12 @@ export type GetUserOperationStatusReturnType = PimlicoUserOperationStatus;
|
|
|
18
18
|
* @example
|
|
19
19
|
* import { createClient } from "viem"
|
|
20
20
|
* import { getUserOperationStatus } from "permissionless/actions/pimlico"
|
|
21
|
+
* import { pimlicoBundlerActions } from 'permissionless/actions/pimlico'
|
|
21
22
|
*
|
|
22
23
|
* const bundlerClient = createClient({
|
|
23
24
|
* chain: goerli,
|
|
24
25
|
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
25
|
-
* })
|
|
26
|
+
* }).extend(pimlicoBundlerActions)
|
|
26
27
|
*
|
|
27
28
|
* await getUserOperationStatus(bundlerClient, { hash: userOpHash })
|
|
28
29
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserOperationStatus.d.ts","sourceRoot":"","sources":["../../../actions/pimlico/getUserOperationStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EACR,uBAAuB,EACvB,0BAA0B,EAC7B,MAAM,wBAAwB,CAAA;AAE/B,MAAM,MAAM,gCAAgC,GAAG;IAC3C,IAAI,EAAE,IAAI,CAAA;CACb,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG,0BAA0B,CAAA;AAEzE
|
|
1
|
+
{"version":3,"file":"getUserOperationStatus.d.ts","sourceRoot":"","sources":["../../../actions/pimlico/getUserOperationStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EACR,uBAAuB,EACvB,0BAA0B,EAC7B,MAAM,wBAAwB,CAAA;AAE/B,MAAM,MAAM,gCAAgC,GAAG;IAC3C,IAAI,EAAE,IAAI,CAAA;CACb,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG,0BAA0B,CAAA;AAEzE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,sBAAsB,gPAMrB,SAAS,gCAAgC,CAAC,KACrD,QAAQ,SAAS,gCAAgC,CAAC,CAKpD,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Account, Address, Chain, Client, Hash, Hex, Transport } from "viem";
|
|
2
|
+
import type { Prettify } from "../../types/index.js";
|
|
3
|
+
import { type PimlicoBundlerRpcSchema } from "../../types/pimlico.js";
|
|
4
|
+
export type SendCompressedUserOperationParameters = {
|
|
5
|
+
compressedUserOperation: Hex;
|
|
6
|
+
inflatorAddress: Address;
|
|
7
|
+
entryPoint: Address;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Sends a compressed user operation to the bundler
|
|
11
|
+
*
|
|
12
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/sendCompressedUserOperation
|
|
13
|
+
*
|
|
14
|
+
* @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
|
|
15
|
+
* @param args {@link SendCompressedUserOperationParameters}.
|
|
16
|
+
* @returns UserOpHash that you can use to track user operation as {@link Hash}.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* import { pimlicoBundlerActions, sendCompressedUserOperation } from 'permissionless/actions/pimlico'
|
|
20
|
+
* import { createClient } from "viem"
|
|
21
|
+
*
|
|
22
|
+
* const bundlerClient = createClient({
|
|
23
|
+
* chain: goerli,
|
|
24
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
25
|
+
* }).extend(pimlicoBundlerActions)
|
|
26
|
+
*
|
|
27
|
+
* const userOpHash = await sendCompressedUserOperation(bundlerClient, {
|
|
28
|
+
* compressedUserOperation,
|
|
29
|
+
* inflatorAddress,
|
|
30
|
+
* entryPoint
|
|
31
|
+
* })
|
|
32
|
+
* // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
|
|
33
|
+
*/
|
|
34
|
+
export declare const sendCompressedUserOperation: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined>(client: Client<TTransport, TChain, TAccount, PimlicoBundlerRpcSchema>, args: Prettify<SendCompressedUserOperationParameters>) => Promise<Hash>;
|
|
35
|
+
//# sourceMappingURL=sendCompressedUserOperation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendCompressedUserOperation.d.ts","sourceRoot":"","sources":["../../../actions/pimlico/sendCompressedUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EACP,OAAO,EACP,KAAK,EACL,MAAM,EACN,IAAI,EACJ,GAAG,EACH,SAAS,EACZ,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAErE,MAAM,MAAM,qCAAqC,GAAG;IAChD,uBAAuB,EAAE,GAAG,CAAA;IAC5B,eAAe,EAAE,OAAO,CAAA;IACxB,UAAU,EAAE,OAAO,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,2BAA2B,4OAM9B,SAAS,qCAAqC,CAAC,KACtD,QAAQ,IAAI,CAWd,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type GetUserOperationGasPriceReturnType, getUserOperationGasPrice } from "./pimlico/getUserOperationGasPrice.js";
|
|
2
2
|
import { type GetUserOperationStatusParameters, type GetUserOperationStatusReturnType, getUserOperationStatus } from "./pimlico/getUserOperationStatus.js";
|
|
3
|
+
import { type SendCompressedUserOperationParameters, sendCompressedUserOperation } from "./pimlico/sendCompressedUserOperation.js";
|
|
3
4
|
import { type PimlicoSponsorUserOperationParameters, type SponsorUserOperationReturnType, sponsorUserOperation } from "./pimlico/sponsorUserOperation.js";
|
|
4
5
|
import type { PimlicoBundlerActions, PimlicoPaymasterClientActions } from "../clients/decorators/pimlico.js";
|
|
5
6
|
import { pimlicoBundlerActions, pimlicoPaymasterActions } from "../clients/decorators/pimlico.js";
|
|
6
7
|
import { type ValidateSponsorshipPolicies, type ValidateSponsorshipPoliciesParameters, validateSponsorshipPolicies } from "./pimlico/validateSponsorshipPolicies.js";
|
|
7
|
-
export type { GetUserOperationGasPriceReturnType, GetUserOperationStatusParameters, GetUserOperationStatusReturnType,
|
|
8
|
-
export { getUserOperationGasPrice, getUserOperationStatus,
|
|
8
|
+
export type { GetUserOperationGasPriceReturnType, GetUserOperationStatusParameters, GetUserOperationStatusReturnType, PimlicoBundlerActions, PimlicoPaymasterClientActions, PimlicoSponsorUserOperationParameters, SendCompressedUserOperationParameters, SponsorUserOperationReturnType, ValidateSponsorshipPolicies, ValidateSponsorshipPoliciesParameters };
|
|
9
|
+
export { getUserOperationGasPrice, getUserOperationStatus, pimlicoBundlerActions, pimlicoPaymasterActions, sendCompressedUserOperation, sponsorUserOperation, validateSponsorshipPolicies };
|
|
9
10
|
//# sourceMappingURL=pimlico.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,kCAAkC,EACvC,wBAAwB,EAC3B,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EACrC,sBAAsB,EACzB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,8BAA8B,EACnC,oBAAoB,EACvB,MAAM,mCAAmC,CAAA;AAE1C,OAAO,KAAK,EACR,qBAAqB,EACrB,6BAA6B,EAChC,MAAM,kCAAkC,CAAA;AACzC,OAAO,EACH,qBAAqB,EACrB,uBAAuB,EAC1B,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EACH,KAAK,2BAA2B,EAChC,KAAK,qCAAqC,EAC1C,2BAA2B,EAC9B,MAAM,0CAA0C,CAAA;AAEjD,YAAY,EACR,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,
|
|
1
|
+
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,kCAAkC,EACvC,wBAAwB,EAC3B,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EACrC,sBAAsB,EACzB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACH,KAAK,qCAAqC,EAC1C,2BAA2B,EAC9B,MAAM,0CAA0C,CAAA;AACjD,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,8BAA8B,EACnC,oBAAoB,EACvB,MAAM,mCAAmC,CAAA;AAE1C,OAAO,KAAK,EACR,qBAAqB,EACrB,6BAA6B,EAChC,MAAM,kCAAkC,CAAA;AACzC,OAAO,EACH,qBAAqB,EACrB,uBAAuB,EAC1B,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EACH,KAAK,2BAA2B,EAChC,KAAK,qCAAqC,EAC1C,2BAA2B,EAC9B,MAAM,0CAA0C,CAAA;AAEjD,YAAY,EACR,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,qBAAqB,EACrB,6BAA6B,EAC7B,qCAAqC,EACrC,qCAAqC,EACrC,8BAA8B,EAC9B,2BAA2B,EAC3B,qCAAqC,EACxC,CAAA;AAED,OAAO,EACH,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,EAC3B,oBAAoB,EACpB,2BAA2B,EAC9B,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Client } from "viem";
|
|
2
|
-
import { type ValidateSponsorshipPolicies, type ValidateSponsorshipPoliciesParameters } from "../../actions/pimlico.js";
|
|
1
|
+
import type { Client, Hash } from "viem";
|
|
2
|
+
import { type SendCompressedUserOperationParameters, type ValidateSponsorshipPolicies, type ValidateSponsorshipPoliciesParameters } from "../../actions/pimlico.js";
|
|
3
3
|
import { type GetUserOperationGasPriceReturnType } from "../../actions/pimlico/getUserOperationGasPrice.js";
|
|
4
4
|
import { type GetUserOperationStatusParameters, type GetUserOperationStatusReturnType } from "../../actions/pimlico/getUserOperationStatus.js";
|
|
5
5
|
import { type PimlicoSponsorUserOperationParameters, type SponsorUserOperationReturnType } from "../../actions/pimlico/sponsorUserOperation.js";
|
|
@@ -45,6 +45,31 @@ export type PimlicoBundlerActions = {
|
|
|
45
45
|
* await bundlerClient.getUserOperationStatus({ hash: userOpHash })
|
|
46
46
|
*/
|
|
47
47
|
getUserOperationStatus: (args: Prettify<GetUserOperationStatusParameters>) => Promise<Prettify<GetUserOperationStatusReturnType>>;
|
|
48
|
+
/**
|
|
49
|
+
* Sends a compressed user operation to the bundler
|
|
50
|
+
*
|
|
51
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/sendCompressedUserOperation
|
|
52
|
+
*
|
|
53
|
+
* @param args {@link SendCompressedUserOperationParameters}.
|
|
54
|
+
* @returns UserOpHash that you can use to track user operation as {@link Hash}.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* import { createClient } from "viem"
|
|
58
|
+
* import { pimlicoBundlerActions } from "permissionless/actions/pimlico"
|
|
59
|
+
*
|
|
60
|
+
* const bundlerClient = createClient({
|
|
61
|
+
* chain: goerli,
|
|
62
|
+
* transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
63
|
+
* }).extend(pimlicoBundlerActions)
|
|
64
|
+
*
|
|
65
|
+
* const userOpHash = await bundlerClient.sendCompressedUserOperation({
|
|
66
|
+
* compressedUserOperation,
|
|
67
|
+
* inflatorAddress,
|
|
68
|
+
* entryPoint
|
|
69
|
+
* })
|
|
70
|
+
* // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
|
|
71
|
+
*/
|
|
72
|
+
sendCompressedUserOperation: (args: Prettify<SendCompressedUserOperationParameters>) => Promise<Hash>;
|
|
48
73
|
};
|
|
49
74
|
export declare const pimlicoBundlerActions: (client: Client) => PimlicoBundlerActions;
|
|
50
75
|
export type PimlicoPaymasterClientActions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"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,CACzB,IAAI,EAAE,QAAQ,CAAC,qCAAqC,CAAC,KACpD,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAA;CACxD,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,uBAAuB,WACxB,MAAM,KACf,6BAMD,CAAA;AAEF;;GAEG"}
|
|
@@ -29,6 +29,15 @@ export type PimlicoBundlerRpcSchema = [
|
|
|
29
29
|
Method: "pimlico_getUserOperationStatus";
|
|
30
30
|
Parameters: [hash: Hash];
|
|
31
31
|
ReturnType: PimlicoUserOperationStatus;
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
Method: "pimlico_sendCompressedUserOperation";
|
|
35
|
+
Parameters: [
|
|
36
|
+
compressedUserOperation: Hex,
|
|
37
|
+
inflatorAddress: Address,
|
|
38
|
+
entryPoint: Address
|
|
39
|
+
];
|
|
40
|
+
ReturnType: Hash;
|
|
32
41
|
}
|
|
33
42
|
];
|
|
34
43
|
export type PimlicoPaymasterRpcSchema = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../types/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAA;AAEtE,KAAK,2CAA2C,GAAG;IAC/C,IAAI,EAAE;QACF,YAAY,EAAE,GAAG,CAAA;QACjB,oBAAoB,EAAE,GAAG,CAAA;KAC5B,CAAA;IACD,QAAQ,EAAE;QACN,YAAY,EAAE,GAAG,CAAA;QACjB,oBAAoB,EAAE,GAAG,CAAA;KAC5B,CAAA;IACD,IAAI,EAAE;QACF,YAAY,EAAE,GAAG,CAAA;QACjB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E,qCAAqC,CAAA;QAC7C,UAAU,EAAE;YACR,uBAAuB,EAAE,GAAG;YAC5B,eAAe,EAAE,OAAO;YACxB,UAAU,EAAE,OAAO;SACtB,CAAA;QACD,UAAU,EAAE,IAAI,CAAA;KACnB;CACJ,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACpC;QACI,MAAM,EAAE,yBAAyB,CAAA;QACjC,UAAU,EAAE;YACR,aAAa,EAAE,SAAS,CACpB,4BAA4B,EAC1B,cAAc,GACd,oBAAoB,GACpB,sBAAsB,GACtB,kBAAkB,CACvB;YACD,UAAU,EAAE,OAAO;YACnB,QAAQ,CAAC,EAAE;gBACP,mBAAmB,CAAC,EAAE,MAAM,CAAA;aAC/B;SACJ,CAAA;QACD,UAAU,EAAE;YACR,gBAAgB,EAAE,GAAG,CAAA;YACrB,kBAAkB,EAAE,GAAG,CAAA;YACvB,oBAAoB,EAAE,GAAG,CAAA;YACzB,YAAY,EAAE,GAAG,CAAA;SACpB,CAAA;KACJ;IACD;QACI,MAAM,EAAE,gCAAgC,CAAA;QACxC,UAAU,EAAE;YACR,aAAa,EAAE,4BAA4B;YAC3C,UAAU,EAAE,OAAO;YACnB,oBAAoB,EAAE,MAAM,EAAE;SACjC,CAAA;QACD,UAAU,EAAE;YACR,mBAAmB,EAAE,MAAM,CAAA;YAC3B,IAAI,EAAE;gBACF,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;gBACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;gBACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;gBACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;aAC7B,CAAA;SACJ,EAAE,CAAA;KACN;CACJ,CAAA"}
|
|
@@ -25,11 +25,12 @@ export type GetUserOperationStatusReturnType = PimlicoUserOperationStatus
|
|
|
25
25
|
* @example
|
|
26
26
|
* import { createClient } from "viem"
|
|
27
27
|
* import { getUserOperationStatus } from "permissionless/actions/pimlico"
|
|
28
|
+
* import { pimlicoBundlerActions } from 'permissionless/actions/pimlico'
|
|
28
29
|
*
|
|
29
30
|
* const bundlerClient = createClient({
|
|
30
31
|
* chain: goerli,
|
|
31
32
|
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
32
|
-
* })
|
|
33
|
+
* }).extend(pimlicoBundlerActions)
|
|
33
34
|
*
|
|
34
35
|
* await getUserOperationStatus(bundlerClient, { hash: userOpHash })
|
|
35
36
|
*
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Account,
|
|
3
|
+
Address,
|
|
4
|
+
Chain,
|
|
5
|
+
Client,
|
|
6
|
+
Hash,
|
|
7
|
+
Hex,
|
|
8
|
+
Transport
|
|
9
|
+
} from "viem"
|
|
10
|
+
import type { Prettify } from "../../types/index.js"
|
|
11
|
+
import { type PimlicoBundlerRpcSchema } from "../../types/pimlico.js"
|
|
12
|
+
|
|
13
|
+
export type SendCompressedUserOperationParameters = {
|
|
14
|
+
compressedUserOperation: Hex
|
|
15
|
+
inflatorAddress: Address
|
|
16
|
+
entryPoint: Address
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Sends a compressed user operation to the bundler
|
|
21
|
+
*
|
|
22
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/sendCompressedUserOperation
|
|
23
|
+
*
|
|
24
|
+
* @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
|
|
25
|
+
* @param args {@link SendCompressedUserOperationParameters}.
|
|
26
|
+
* @returns UserOpHash that you can use to track user operation as {@link Hash}.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* import { pimlicoBundlerActions, sendCompressedUserOperation } from 'permissionless/actions/pimlico'
|
|
30
|
+
* import { createClient } from "viem"
|
|
31
|
+
*
|
|
32
|
+
* const bundlerClient = createClient({
|
|
33
|
+
* chain: goerli,
|
|
34
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
35
|
+
* }).extend(pimlicoBundlerActions)
|
|
36
|
+
*
|
|
37
|
+
* const userOpHash = await sendCompressedUserOperation(bundlerClient, {
|
|
38
|
+
* compressedUserOperation,
|
|
39
|
+
* inflatorAddress,
|
|
40
|
+
* entryPoint
|
|
41
|
+
* })
|
|
42
|
+
* // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
|
|
43
|
+
*/
|
|
44
|
+
export const sendCompressedUserOperation = async <
|
|
45
|
+
TTransport extends Transport = Transport,
|
|
46
|
+
TChain extends Chain | undefined = Chain | undefined,
|
|
47
|
+
TAccount extends Account | undefined = Account | undefined
|
|
48
|
+
>(
|
|
49
|
+
client: Client<TTransport, TChain, TAccount, PimlicoBundlerRpcSchema>,
|
|
50
|
+
args: Prettify<SendCompressedUserOperationParameters>
|
|
51
|
+
): Promise<Hash> => {
|
|
52
|
+
const { compressedUserOperation, inflatorAddress, entryPoint } = args
|
|
53
|
+
|
|
54
|
+
return client.request({
|
|
55
|
+
method: "pimlico_sendCompressedUserOperation",
|
|
56
|
+
params: [
|
|
57
|
+
compressedUserOperation as Hex,
|
|
58
|
+
inflatorAddress as Address,
|
|
59
|
+
entryPoint as Address
|
|
60
|
+
]
|
|
61
|
+
})
|
|
62
|
+
}
|
package/actions/pimlico.ts
CHANGED
|
@@ -7,6 +7,10 @@ import {
|
|
|
7
7
|
type GetUserOperationStatusReturnType,
|
|
8
8
|
getUserOperationStatus
|
|
9
9
|
} from "./pimlico/getUserOperationStatus.js"
|
|
10
|
+
import {
|
|
11
|
+
type SendCompressedUserOperationParameters,
|
|
12
|
+
sendCompressedUserOperation
|
|
13
|
+
} from "./pimlico/sendCompressedUserOperation.js"
|
|
10
14
|
import {
|
|
11
15
|
type PimlicoSponsorUserOperationParameters,
|
|
12
16
|
type SponsorUserOperationReturnType,
|
|
@@ -32,19 +36,21 @@ export type {
|
|
|
32
36
|
GetUserOperationGasPriceReturnType,
|
|
33
37
|
GetUserOperationStatusParameters,
|
|
34
38
|
GetUserOperationStatusReturnType,
|
|
35
|
-
PimlicoSponsorUserOperationParameters,
|
|
36
|
-
SponsorUserOperationReturnType,
|
|
37
39
|
PimlicoBundlerActions,
|
|
38
40
|
PimlicoPaymasterClientActions,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
PimlicoSponsorUserOperationParameters,
|
|
42
|
+
SendCompressedUserOperationParameters,
|
|
43
|
+
SponsorUserOperationReturnType,
|
|
44
|
+
ValidateSponsorshipPolicies,
|
|
45
|
+
ValidateSponsorshipPoliciesParameters
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
export {
|
|
44
49
|
getUserOperationGasPrice,
|
|
45
50
|
getUserOperationStatus,
|
|
46
|
-
sponsorUserOperation,
|
|
47
51
|
pimlicoBundlerActions,
|
|
48
52
|
pimlicoPaymasterActions,
|
|
53
|
+
sendCompressedUserOperation,
|
|
54
|
+
sponsorUserOperation,
|
|
49
55
|
validateSponsorshipPolicies
|
|
50
56
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Client, Hash } from "viem"
|
|
2
2
|
import {
|
|
3
|
+
type SendCompressedUserOperationParameters,
|
|
3
4
|
type ValidateSponsorshipPolicies,
|
|
4
5
|
type ValidateSponsorshipPoliciesParameters,
|
|
6
|
+
sendCompressedUserOperation,
|
|
5
7
|
validateSponsorshipPolicies
|
|
6
8
|
} from "../../actions/pimlico.js"
|
|
7
9
|
import {
|
|
@@ -69,6 +71,33 @@ export type PimlicoBundlerActions = {
|
|
|
69
71
|
getUserOperationStatus: (
|
|
70
72
|
args: Prettify<GetUserOperationStatusParameters>
|
|
71
73
|
) => Promise<Prettify<GetUserOperationStatusReturnType>>
|
|
74
|
+
/**
|
|
75
|
+
* Sends a compressed user operation to the bundler
|
|
76
|
+
*
|
|
77
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/sendCompressedUserOperation
|
|
78
|
+
*
|
|
79
|
+
* @param args {@link SendCompressedUserOperationParameters}.
|
|
80
|
+
* @returns UserOpHash that you can use to track user operation as {@link Hash}.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* import { createClient } from "viem"
|
|
84
|
+
* import { pimlicoBundlerActions } from "permissionless/actions/pimlico"
|
|
85
|
+
*
|
|
86
|
+
* const bundlerClient = createClient({
|
|
87
|
+
* chain: goerli,
|
|
88
|
+
* transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
89
|
+
* }).extend(pimlicoBundlerActions)
|
|
90
|
+
*
|
|
91
|
+
* const userOpHash = await bundlerClient.sendCompressedUserOperation({
|
|
92
|
+
* compressedUserOperation,
|
|
93
|
+
* inflatorAddress,
|
|
94
|
+
* entryPoint
|
|
95
|
+
* })
|
|
96
|
+
* // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
|
|
97
|
+
*/
|
|
98
|
+
sendCompressedUserOperation: (
|
|
99
|
+
args: Prettify<SendCompressedUserOperationParameters>
|
|
100
|
+
) => Promise<Hash>
|
|
72
101
|
}
|
|
73
102
|
|
|
74
103
|
export const pimlicoBundlerActions = (
|
|
@@ -77,7 +106,10 @@ export const pimlicoBundlerActions = (
|
|
|
77
106
|
getUserOperationGasPrice: async () =>
|
|
78
107
|
getUserOperationGasPrice(client as PimlicoBundlerClient),
|
|
79
108
|
getUserOperationStatus: async (args: GetUserOperationStatusParameters) =>
|
|
80
|
-
getUserOperationStatus(client as PimlicoBundlerClient, args)
|
|
109
|
+
getUserOperationStatus(client as PimlicoBundlerClient, args),
|
|
110
|
+
sendCompressedUserOperation: async (
|
|
111
|
+
args: SendCompressedUserOperationParameters
|
|
112
|
+
) => sendCompressedUserOperation(client as PimlicoBundlerClient, args)
|
|
81
113
|
})
|
|
82
114
|
|
|
83
115
|
export type PimlicoPaymasterClientActions = {
|
package/package.json
CHANGED
package/types/pimlico.ts
CHANGED
|
@@ -39,6 +39,15 @@ export type PimlicoBundlerRpcSchema = [
|
|
|
39
39
|
Method: "pimlico_getUserOperationStatus"
|
|
40
40
|
Parameters: [hash: Hash]
|
|
41
41
|
ReturnType: PimlicoUserOperationStatus
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
Method: "pimlico_sendCompressedUserOperation"
|
|
45
|
+
Parameters: [
|
|
46
|
+
compressedUserOperation: Hex,
|
|
47
|
+
inflatorAddress: Address,
|
|
48
|
+
entryPoint: Address
|
|
49
|
+
]
|
|
50
|
+
ReturnType: Hash
|
|
42
51
|
}
|
|
43
52
|
]
|
|
44
53
|
|