permissionless 0.0.6 → 0.0.7
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 +7 -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/index.js +18 -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 +19 -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 +24 -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/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/_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/index.js +9 -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 +16 -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 +15 -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/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/_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 +93 -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/index.d.ts +17 -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 +2 -2
- package/_types/clients/bundler.d.ts.map +1 -1
- package/_types/clients/decorators/bundler.d.ts +150 -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 +26 -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/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/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 +109 -0
- package/actions/bundler/sendUserOperation.ts +45 -0
- package/actions/bundler/supportedEntryPoints.ts +31 -0
- package/actions/index.ts +22 -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 +2 -3
- package/clients/decorators/bundler.ts +178 -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 +62 -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/_cjs/actions/bundler.js +0 -118
- package/_cjs/actions/bundler.js.map +0 -1
- package/_cjs/actions/public.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/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/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/_esm/utils/index.js
CHANGED
|
@@ -1,56 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function packUserOp({ userOperation }) {
|
|
3
|
-
const hashedInitCode = keccak256(userOperation.initCode);
|
|
4
|
-
const hashedCallData = keccak256(userOperation.callData);
|
|
5
|
-
const hashedPaymasterAndData = keccak256(userOperation.paymasterAndData);
|
|
6
|
-
return encodeAbiParameters([
|
|
7
|
-
{ type: "address" },
|
|
8
|
-
{ type: "uint256" },
|
|
9
|
-
{ type: "bytes32" },
|
|
10
|
-
{ type: "bytes32" },
|
|
11
|
-
{ type: "uint256" },
|
|
12
|
-
{ type: "uint256" },
|
|
13
|
-
{ type: "uint256" },
|
|
14
|
-
{ type: "uint256" },
|
|
15
|
-
{ type: "uint256" },
|
|
16
|
-
{ type: "bytes32" }
|
|
17
|
-
], [
|
|
18
|
-
userOperation.sender,
|
|
19
|
-
userOperation.nonce,
|
|
20
|
-
hashedInitCode,
|
|
21
|
-
hashedCallData,
|
|
22
|
-
userOperation.callGasLimit,
|
|
23
|
-
userOperation.verificationGasLimit,
|
|
24
|
-
userOperation.preVerificationGas,
|
|
25
|
-
userOperation.maxFeePerGas,
|
|
26
|
-
userOperation.maxPriorityFeePerGas,
|
|
27
|
-
hashedPaymasterAndData
|
|
28
|
-
]);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* Returns user operation hash that is a unique identifier of the user operation.
|
|
33
|
-
*
|
|
34
|
-
* - Docs: https://docs.pimlico.io/permissionless/reference/utils/getUserOperationHash
|
|
35
|
-
*
|
|
36
|
-
* @param args: userOperation, entryPoint, chainId as {@link GetUserOperationHashParams}
|
|
37
|
-
* @returns userOperationHash as {@link Hash}
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* import { getUserOperationHash } from "permissionless/utils"
|
|
41
|
-
*
|
|
42
|
-
* const userOperationHash = getUserOperationHash({
|
|
43
|
-
* userOperation,
|
|
44
|
-
* entryPoint,
|
|
45
|
-
* chainId
|
|
46
|
-
* })
|
|
47
|
-
*
|
|
48
|
-
* // Returns "0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34"
|
|
49
|
-
*
|
|
50
|
-
*/
|
|
51
|
-
const getUserOperationHash = ({ userOperation, entryPoint, chainId }) => {
|
|
52
|
-
const encoded = encodeAbiParameters([{ type: "bytes32" }, { type: "address" }, { type: "uint256" }], [keccak256(packUserOp({ userOperation })), entryPoint, BigInt(chainId)]);
|
|
53
|
-
return keccak256(encoded);
|
|
54
|
-
};
|
|
1
|
+
import { getUserOperationHash } from "./getUserOperationHash.js";
|
|
55
2
|
export { getUserOperationHash };
|
|
56
3
|
//# sourceMappingURL=index.js.map
|
package/_esm/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,OAAO,EAAmC,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEjG,OAAO,EAAE,oBAAoB,EAAmC,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { BundlerClient } from "../../clients/bundler.js";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the supported chain id by the bundler service
|
|
4
|
+
*
|
|
5
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/chainId
|
|
6
|
+
*
|
|
7
|
+
* @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
|
|
8
|
+
* @returns Supported chain id
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import { createClient } from "viem"
|
|
13
|
+
* import { chainId } from "permissionless/actions"
|
|
14
|
+
*
|
|
15
|
+
* const bundlerClient = createClient({
|
|
16
|
+
* chain: goerli,
|
|
17
|
+
* transport: http(BUNDLER_URL)
|
|
18
|
+
* })
|
|
19
|
+
*
|
|
20
|
+
* const bundlerChainId = chainId(bundlerClient)
|
|
21
|
+
* // Return 5n for Goerli
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
export declare const chainId: (client: BundlerClient) => Promise<number>;
|
|
25
|
+
//# sourceMappingURL=chainId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chainId.d.ts","sourceRoot":"","sources":["../../../actions/bundler/chainId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,OAAO,WAAkB,aAAa,oBAOlD,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import type { PartialBy } from "viem/types/utils";
|
|
3
|
+
import type { BundlerClient } from "../../clients/bundler.js";
|
|
4
|
+
import type { UserOperation } from "../../types/userOperation.js";
|
|
5
|
+
export type EstimateUserOperationGasParameters = {
|
|
6
|
+
userOperation: PartialBy<UserOperation, "callGasLimit" | "preVerificationGas" | "verificationGasLimit">;
|
|
7
|
+
entryPoint: Address;
|
|
8
|
+
};
|
|
9
|
+
export type EstimateUserOperationGasReturnType = {
|
|
10
|
+
preVerificationGas: bigint;
|
|
11
|
+
verificationGasLimit: bigint;
|
|
12
|
+
callGasLimit: bigint;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Estimates preVerificationGas, verificationGasLimit and callGasLimit for user operation
|
|
16
|
+
*
|
|
17
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/estimateUserOperationGas
|
|
18
|
+
*
|
|
19
|
+
* @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
|
|
20
|
+
* @param args {@link EstimateUserOperationGasParameters}
|
|
21
|
+
* @returns preVerificationGas, verificationGasLimit and callGasLimit as {@link EstimateUserOperationGasReturnType}
|
|
22
|
+
*
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* import { createClient } from "viem"
|
|
26
|
+
* import { estimateUserOperationGas } from "permissionless/actions"
|
|
27
|
+
*
|
|
28
|
+
* const bundlerClient = createClient({
|
|
29
|
+
* chain: goerli,
|
|
30
|
+
* transport: http(BUNDLER_URL)
|
|
31
|
+
* })
|
|
32
|
+
*
|
|
33
|
+
* const gasParameters = estimateUserOperationGas(bundlerClient, {
|
|
34
|
+
* serOperation: signedUserOperation,
|
|
35
|
+
* entryPoint: entryPoint
|
|
36
|
+
* })
|
|
37
|
+
*
|
|
38
|
+
* // Return {preVerificationGas: 43492n, verificationGasLimit: 59436n, callGasLimit: 9000n}
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
export declare const estimateUserOperationGas: (client: BundlerClient, args: EstimateUserOperationGasParameters) => Promise<EstimateUserOperationGasReturnType>;
|
|
42
|
+
//# sourceMappingURL=estimateUserOperationGas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimateUserOperationGas.d.ts","sourceRoot":"","sources":["../../../actions/bundler/estimateUserOperationGas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAIjE,MAAM,MAAM,kCAAkC,GAAG;IAC7C,aAAa,EAAE,SAAS,CAAC,aAAa,EAAE,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,CAAC,CAAA;IACvG,UAAU,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,kCAAkC,GAAG;IAC7C,kBAAkB,EAAE,MAAM,CAAA;IAC1B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,YAAY,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,wBAAwB,WACzB,aAAa,QACf,kCAAkC,KACzC,QAAQ,kCAAkC,CAa5C,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Address, Hash } from "viem";
|
|
2
|
+
import type { BundlerClient } from "../../clients/bundler.js";
|
|
3
|
+
import type { UserOperation } from "../../types/userOperation.js";
|
|
4
|
+
export type GetUserOperationByHashParameters = {
|
|
5
|
+
hash: Hash;
|
|
6
|
+
};
|
|
7
|
+
export type GetUserOperationByHashReturnType = {
|
|
8
|
+
userOperation: UserOperation;
|
|
9
|
+
entryPoint: Address;
|
|
10
|
+
transactionHash: Hash;
|
|
11
|
+
blockHash: Hash;
|
|
12
|
+
blockNumber: bigint;
|
|
13
|
+
} | null;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the user operation from userOpHash
|
|
16
|
+
*
|
|
17
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationByHash
|
|
18
|
+
*
|
|
19
|
+
* @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
|
|
20
|
+
* @param args {@link GetUserOperationByHashParameters} UserOpHash that was returned by {@link sendUserOperation}
|
|
21
|
+
* @returns userOperation along with entryPoint, transactionHash, blockHash, blockNumber if found or null
|
|
22
|
+
*
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* import { createClient } from "viem"
|
|
26
|
+
* import { getUserOperationByHash } from "permissionless/actions"
|
|
27
|
+
*
|
|
28
|
+
* const bundlerClient = createClient({
|
|
29
|
+
* chain: goerli,
|
|
30
|
+
* transport: http(BUNDLER_URL)
|
|
31
|
+
* })
|
|
32
|
+
*
|
|
33
|
+
* getUserOperationByHash(bundlerClient, {hash: userOpHash})
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
export declare const getUserOperationByHash: (client: BundlerClient, { hash }: GetUserOperationByHashParameters) => Promise<GetUserOperationByHashReturnType>;
|
|
37
|
+
//# sourceMappingURL=getUserOperationByHash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserOperationByHash.d.ts","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationByHash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAEjE,MAAM,MAAM,gCAAgC,GAAG;IAC3C,IAAI,EAAE,IAAI,CAAA;CACb,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC3C,aAAa,EAAE,aAAa,CAAA;IAC5B,UAAU,EAAE,OAAO,CAAA;IACnB,eAAe,EAAE,IAAI,CAAA;IACrB,SAAS,EAAE,IAAI,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;CACtB,GAAG,IAAI,CAAA;AAER;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,sBAAsB,WACvB,aAAa,YACX,gCAAgC,KAC3C,QAAQ,gCAAgC,CA2B1C,CAAA"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { Address, Hash, Hex } from "viem";
|
|
2
|
+
import type { BundlerClient } from "../../clients/bundler.js";
|
|
3
|
+
import type { TStatus } from "../../types/userOperation.js";
|
|
4
|
+
export type GetUserOperationReceiptParameters = {
|
|
5
|
+
hash: Hash;
|
|
6
|
+
};
|
|
7
|
+
export type GetUserOperationReceiptReturnType = {
|
|
8
|
+
userOpHash: Hash;
|
|
9
|
+
sender: Address;
|
|
10
|
+
nonce: bigint;
|
|
11
|
+
actualGasUsed: bigint;
|
|
12
|
+
actualGasCost: bigint;
|
|
13
|
+
success: boolean;
|
|
14
|
+
receipt: {
|
|
15
|
+
transactionHash: Hex;
|
|
16
|
+
transactionIndex: bigint;
|
|
17
|
+
blockHash: Hash;
|
|
18
|
+
blockNumber: bigint;
|
|
19
|
+
from: Address;
|
|
20
|
+
to: Address | null;
|
|
21
|
+
cumulativeGasUsed: bigint;
|
|
22
|
+
status: TStatus;
|
|
23
|
+
gasUsed: bigint;
|
|
24
|
+
contractAddress: Address | null;
|
|
25
|
+
logsBloom: Hex;
|
|
26
|
+
effectiveGasPrice: bigint;
|
|
27
|
+
};
|
|
28
|
+
logs: {
|
|
29
|
+
data: Hex;
|
|
30
|
+
blockNumber: bigint;
|
|
31
|
+
blockHash: Hash;
|
|
32
|
+
transactionHash: Hash;
|
|
33
|
+
logIndex: bigint;
|
|
34
|
+
transactionIndex: bigint;
|
|
35
|
+
address: Address;
|
|
36
|
+
topics: Hex[];
|
|
37
|
+
}[];
|
|
38
|
+
} | null;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the user operation receipt from userOpHash
|
|
41
|
+
*
|
|
42
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt
|
|
43
|
+
*
|
|
44
|
+
* @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
|
|
45
|
+
* @param args {@link GetUserOperationReceiptParameters} UserOpHash that was returned by {@link sendUserOperation}
|
|
46
|
+
* @returns user operation receipt {@link GetUserOperationReceiptReturnType} if found or null
|
|
47
|
+
*
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* import { createClient } from "viem"
|
|
51
|
+
* import { getUserOperationReceipt } from "permissionless/actions"
|
|
52
|
+
*
|
|
53
|
+
* const bundlerClient = createClient({
|
|
54
|
+
* chain: goerli,
|
|
55
|
+
* transport: http(BUNDLER_URL)
|
|
56
|
+
* })
|
|
57
|
+
*
|
|
58
|
+
* getUserOperationReceipt(bundlerClient, {hash: userOpHash})
|
|
59
|
+
*
|
|
60
|
+
*/
|
|
61
|
+
export declare const getUserOperationReceipt: (client: BundlerClient, { hash }: GetUserOperationReceiptParameters) => Promise<{
|
|
62
|
+
userOpHash: Hash;
|
|
63
|
+
sender: Address;
|
|
64
|
+
nonce: bigint;
|
|
65
|
+
actualGasUsed: bigint;
|
|
66
|
+
actualGasCost: bigint;
|
|
67
|
+
success: boolean;
|
|
68
|
+
receipt: {
|
|
69
|
+
transactionHash: Hex;
|
|
70
|
+
transactionIndex: bigint;
|
|
71
|
+
blockHash: Hash;
|
|
72
|
+
blockNumber: bigint;
|
|
73
|
+
from: Address;
|
|
74
|
+
to: Address | null;
|
|
75
|
+
cumulativeGasUsed: bigint;
|
|
76
|
+
status: TStatus;
|
|
77
|
+
gasUsed: bigint;
|
|
78
|
+
contractAddress: Address | null;
|
|
79
|
+
logsBloom: Hex;
|
|
80
|
+
effectiveGasPrice: bigint;
|
|
81
|
+
};
|
|
82
|
+
logs: {
|
|
83
|
+
data: Hex;
|
|
84
|
+
blockNumber: bigint;
|
|
85
|
+
blockHash: Hash;
|
|
86
|
+
transactionHash: Hash;
|
|
87
|
+
logIndex: bigint;
|
|
88
|
+
transactionIndex: bigint;
|
|
89
|
+
address: Address;
|
|
90
|
+
topics: Hex[];
|
|
91
|
+
}[];
|
|
92
|
+
} | null>;
|
|
93
|
+
//# sourceMappingURL=getUserOperationReceipt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserOperationReceipt.d.ts","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAG3D,MAAM,MAAM,iCAAiC,GAAG;IAC5C,IAAI,EAAE,IAAI,CAAA;CACb,CAAA;AAED,MAAM,MAAM,iCAAiC,GAAG;IAC5C,UAAU,EAAE,IAAI,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE;QACL,eAAe,EAAE,GAAG,CAAA;QACpB,gBAAgB,EAAE,MAAM,CAAA;QACxB,SAAS,EAAE,IAAI,CAAA;QACf,WAAW,EAAE,MAAM,CAAA;QACnB,IAAI,EAAE,OAAO,CAAA;QACb,EAAE,EAAE,OAAO,GAAG,IAAI,CAAA;QAClB,iBAAiB,EAAE,MAAM,CAAA;QACzB,MAAM,EAAE,OAAO,CAAA;QACf,OAAO,EAAE,MAAM,CAAA;QACf,eAAe,EAAE,OAAO,GAAG,IAAI,CAAA;QAC/B,SAAS,EAAE,GAAG,CAAA;QACd,iBAAiB,EAAE,MAAM,CAAA;KAC5B,CAAA;IACD,IAAI,EAAE;QACF,IAAI,EAAE,GAAG,CAAA;QACT,WAAW,EAAE,MAAM,CAAA;QACnB,SAAS,EAAE,IAAI,CAAA;QACf,eAAe,EAAE,IAAI,CAAA;QACrB,QAAQ,EAAE,MAAM,CAAA;QAChB,gBAAgB,EAAE,MAAM,CAAA;QACxB,OAAO,EAAE,OAAO,CAAA;QAChB,MAAM,EAAE,GAAG,EAAE,CAAA;KAChB,EAAE,CAAA;CACN,GAAG,IAAI,CAAA;AAER;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,uBAAuB,WAAkB,aAAa,YAAY,iCAAiC;gBAtDhG,IAAI;YACR,OAAO;WACR,MAAM;mBACE,MAAM;mBACN,MAAM;aACZ,OAAO;aACP;QACL,eAAe,EAAE,GAAG,CAAA;QACpB,gBAAgB,EAAE,MAAM,CAAA;QACxB,SAAS,EAAE,IAAI,CAAA;QACf,WAAW,EAAE,MAAM,CAAA;QACnB,IAAI,EAAE,OAAO,CAAA;QACb,EAAE,EAAE,OAAO,GAAG,IAAI,CAAA;QAClB,iBAAiB,EAAE,MAAM,CAAA;QACzB,QAAQ,OAAO,CAAA;QACf,OAAO,EAAE,MAAM,CAAA;QACf,eAAe,EAAE,OAAO,GAAG,IAAI,CAAA;QAC/B,SAAS,EAAE,GAAG,CAAA;QACd,iBAAiB,EAAE,MAAM,CAAA;KAC5B;UACK;QACF,IAAI,EAAE,GAAG,CAAA;QACT,WAAW,EAAE,MAAM,CAAA;QACnB,SAAS,EAAE,IAAI,CAAA;QACf,eAAe,EAAE,IAAI,CAAA;QACrB,QAAQ,EAAE,MAAM,CAAA;QAChB,gBAAgB,EAAE,MAAM,CAAA;QACxB,OAAO,EAAE,OAAO,CAAA;QAChB,MAAM,EAAE,GAAG,EAAE,CAAA;KAChB,EAAE;SAqEN,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Address, Hash } from "viem";
|
|
2
|
+
import type { BundlerClient } from "../../clients/bundler.js";
|
|
3
|
+
import type { UserOperation } from "../../types/userOperation.js";
|
|
4
|
+
export type SendUserOperationParameters = {
|
|
5
|
+
userOperation: UserOperation;
|
|
6
|
+
entryPoint: Address;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Sends user operation to the bundler
|
|
10
|
+
*
|
|
11
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/sendUserOperation
|
|
12
|
+
*
|
|
13
|
+
* @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
|
|
14
|
+
* @param args {@link SendUserOperationParameters}.
|
|
15
|
+
* @returns UserOpHash that you can use to track user operation as {@link Hash}.
|
|
16
|
+
*
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* import { createClient } from "viem"
|
|
20
|
+
* import { sendUserOperation } from "permissionless/actions"
|
|
21
|
+
*
|
|
22
|
+
* const bundlerClient = createClient({
|
|
23
|
+
* chain: goerli,
|
|
24
|
+
* transport: http(BUNDLER_URL)
|
|
25
|
+
* })
|
|
26
|
+
*
|
|
27
|
+
* const userOpHash = sendUserOperation(bundlerClient, {
|
|
28
|
+
* userOperation: signedUserOperation,
|
|
29
|
+
* entryPoint: entryPoint
|
|
30
|
+
* })
|
|
31
|
+
*
|
|
32
|
+
* // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
export declare const sendUserOperation: (client: BundlerClient, args: SendUserOperationParameters) => Promise<Hash>;
|
|
36
|
+
//# sourceMappingURL=sendUserOperation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendUserOperation.d.ts","sourceRoot":"","sources":["../../../actions/bundler/sendUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAgC,MAAM,8BAA8B,CAAA;AAG/F,MAAM,MAAM,2BAA2B,GAAG;IACtC,aAAa,EAAE,aAAa,CAAA;IAC5B,UAAU,EAAE,OAAO,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,iBAAiB,WAAkB,aAAa,QAAQ,2BAA2B,KAAG,QAAQ,IAAI,CAO9G,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import type { BundlerClient } from "../../clients/bundler.js";
|
|
3
|
+
/**
|
|
4
|
+
* Returns the supported entrypoints by the bundler service
|
|
5
|
+
*
|
|
6
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/supportedEntryPoints
|
|
7
|
+
*
|
|
8
|
+
* @param client {@link BundlerClient} that you created using viem's createClient and extended it with bundlerActions.
|
|
9
|
+
* @returns Supported entryPoints
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { createClient } from "viem"
|
|
14
|
+
* import { supportedEntryPoints } from "permissionless/actions"
|
|
15
|
+
*
|
|
16
|
+
* const bundlerClient = createClient({
|
|
17
|
+
* chain: goerli,
|
|
18
|
+
* transport: http(BUNDLER_URL)
|
|
19
|
+
* })
|
|
20
|
+
*
|
|
21
|
+
* const entryPointsSupported = supportedEntryPoints(bundlerClient)
|
|
22
|
+
* // Return ['0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789']
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
export declare const supportedEntryPoints: (client: BundlerClient) => Promise<Address[]>;
|
|
26
|
+
//# sourceMappingURL=supportedEntryPoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supportedEntryPoints.d.ts","sourceRoot":"","sources":["../../../actions/bundler/supportedEntryPoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,oBAAoB,WAAkB,aAAa,KAAG,QAAQ,OAAO,EAAE,CAKnF,CAAA"}
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
import type { EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import type { EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType } from "./bundler/estimateUserOperationGas.js";
|
|
2
|
+
import type { GetUserOperationByHashParameters } from "./bundler/getUserOperationByHash.js";
|
|
3
|
+
import type { GetUserOperationByHashReturnType } from "./bundler/getUserOperationByHash.js";
|
|
4
|
+
import type { GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType } from "./bundler/getUserOperationReceipt.js";
|
|
5
|
+
import type { SendUserOperationParameters } from "./bundler/sendUserOperation.js";
|
|
6
|
+
import type { GetSenderAddressParams } from "./public/getSenderAddress.js";
|
|
7
|
+
import { InvalidEntryPointError, getSenderAddress } from "./public/getSenderAddress.js";
|
|
8
|
+
import { chainId } from "./bundler/chainId.js";
|
|
9
|
+
import { estimateUserOperationGas } from "./bundler/estimateUserOperationGas.js";
|
|
10
|
+
import { getUserOperationByHash } from "./bundler/getUserOperationByHash.js";
|
|
11
|
+
import { getUserOperationReceipt } from "./bundler/getUserOperationReceipt.js";
|
|
12
|
+
import { sendUserOperation } from "./bundler/sendUserOperation.js";
|
|
13
|
+
import { supportedEntryPoints } from "./bundler/supportedEntryPoints.js";
|
|
14
|
+
import type { GetAccountNonceParams } from "./public/getAccountNonce.js";
|
|
15
|
+
import { getAccountNonce } from "./public/getAccountNonce.js";
|
|
16
|
+
export type { SendUserOperationParameters, EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType, GetUserOperationByHashParameters, GetUserOperationByHashReturnType, GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType, GetSenderAddressParams, GetAccountNonceParams };
|
|
17
|
+
export { sendUserOperation, estimateUserOperationGas, supportedEntryPoints, chainId, getUserOperationByHash, getUserOperationReceipt, getSenderAddress, getAccountNonce, InvalidEntryPointError };
|
|
7
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,kCAAkC,EAClC,kCAAkC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,kCAAkC,EAClC,kCAAkC,EACrC,MAAM,uCAAuC,CAAA;AAC9C,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qCAAqC,CAAA;AAC3F,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qCAAqC,CAAA;AAC3F,OAAO,KAAK,EACR,iCAAiC,EACjC,iCAAiC,EACpC,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAA;AAEjF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAEvF,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAA;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAE7D,YAAY,EACR,2BAA2B,EAC3B,kCAAkC,EAClC,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,EACjC,iCAAiC,EACjC,sBAAsB,EACtB,qBAAqB,EACxB,CAAA;AAED,OAAO,EACH,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,OAAO,EACP,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACzB,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { PimlicoBundlerClient } from "../../clients/pimlico.js";
|
|
2
|
+
export type GetUserOperationGasPriceReturnType = {
|
|
3
|
+
slow: {
|
|
4
|
+
maxFeePerGas: bigint;
|
|
5
|
+
maxPriorityFeePerGas: bigint;
|
|
6
|
+
};
|
|
7
|
+
standard: {
|
|
8
|
+
maxFeePerGas: bigint;
|
|
9
|
+
maxPriorityFeePerGas: bigint;
|
|
10
|
+
};
|
|
11
|
+
fast: {
|
|
12
|
+
maxFeePerGas: bigint;
|
|
13
|
+
maxPriorityFeePerGas: bigint;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Returns the live gas prices that you can use to send a user operation.
|
|
18
|
+
*
|
|
19
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationGasPrice
|
|
20
|
+
*
|
|
21
|
+
* @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
|
|
22
|
+
* @returns slow, standard & fast values for maxFeePerGas & maxPriorityFeePerGas
|
|
23
|
+
*
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* import { createClient } from "viem"
|
|
27
|
+
* import { getUserOperationGasPrice } from "permissionless/actions/pimlico"
|
|
28
|
+
*
|
|
29
|
+
* const bundlerClient = createClient({
|
|
30
|
+
* chain: goerli,
|
|
31
|
+
* transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
32
|
+
* })
|
|
33
|
+
*
|
|
34
|
+
* await getUserOperationGasPrice(bundlerClient)
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
export declare const getUserOperationGasPrice: (client: PimlicoBundlerClient) => Promise<GetUserOperationGasPriceReturnType>;
|
|
38
|
+
//# sourceMappingURL=getUserOperationGasPrice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserOperationGasPrice.d.ts","sourceRoot":"","sources":["../../../actions/pimlico/getUserOperationGasPrice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAEpE,MAAM,MAAM,kCAAkC,GAAG;IAC7C,IAAI,EAAE;QACF,YAAY,EAAE,MAAM,CAAA;QACpB,oBAAoB,EAAE,MAAM,CAAA;KAC/B,CAAA;IACD,QAAQ,EAAE;QACN,YAAY,EAAE,MAAM,CAAA;QACpB,oBAAoB,EAAE,MAAM,CAAA;KAC/B,CAAA;IACD,IAAI,EAAE;QACF,YAAY,EAAE,MAAM,CAAA;QACpB,oBAAoB,EAAE,MAAM,CAAA;KAC/B,CAAA;CACJ,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,wBAAwB,WACzB,oBAAoB,KAC7B,QAAQ,kCAAkC,CAoB5C,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Hash } from "viem";
|
|
2
|
+
import type { PimlicoBundlerClient } from "../../clients/pimlico.js";
|
|
3
|
+
import type { PimlicoUserOperationStatus } from "../../types/pimlico.js";
|
|
4
|
+
export type GetUserOperationStatusParameters = {
|
|
5
|
+
hash: Hash;
|
|
6
|
+
};
|
|
7
|
+
export type GetUserOperationStatusReturnType = PimlicoUserOperationStatus;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the status of the userOperation that is pending in the mempool.
|
|
10
|
+
*
|
|
11
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationStatus
|
|
12
|
+
*
|
|
13
|
+
* @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
|
|
14
|
+
* @param hash {@link Hash} UserOpHash that you must have received from sendUserOperation.
|
|
15
|
+
* @returns status & transaction hash if included {@link GetUserOperationStatusReturnType}
|
|
16
|
+
*
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* import { createClient } from "viem"
|
|
20
|
+
* import { getUserOperationStatus } from "permissionless/actions/pimlico"
|
|
21
|
+
*
|
|
22
|
+
* const bundlerClient = createClient({
|
|
23
|
+
* chain: goerli,
|
|
24
|
+
* transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
25
|
+
* })
|
|
26
|
+
*
|
|
27
|
+
* await getUserOperationStatus(bundlerClient, { hash: userOpHash })
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
export declare const getUserOperationStatus: (client: PimlicoBundlerClient, { hash }: GetUserOperationStatusParameters) => Promise<GetUserOperationStatusReturnType>;
|
|
31
|
+
//# sourceMappingURL=getUserOperationStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserOperationStatus.d.ts","sourceRoot":"","sources":["../../../actions/pimlico/getUserOperationStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AAExE,MAAM,MAAM,gCAAgC,GAAG;IAC3C,IAAI,EAAE,IAAI,CAAA;CACb,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG,0BAA0B,CAAA;AAEzE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,sBAAsB,WACvB,oBAAoB,YAClB,gCAAgC,KAC3C,QAAQ,gCAAgC,CAK1C,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Address, Hex } from "viem";
|
|
2
|
+
import type { PartialBy } from "viem/types/utils";
|
|
3
|
+
import type { PimlicoPaymasterClient } from "../../clients/pimlico.js";
|
|
4
|
+
import type { UserOperation } from "../../types/userOperation.js";
|
|
5
|
+
export type SponsorUserOperationParameters = {
|
|
6
|
+
userOperation: PartialBy<UserOperation, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterAndData">;
|
|
7
|
+
entryPoint: Address;
|
|
8
|
+
};
|
|
9
|
+
export type SponsorUserOperationReturnType = {
|
|
10
|
+
paymasterAndData: Hex;
|
|
11
|
+
preVerificationGas: bigint;
|
|
12
|
+
verificationGasLimit: bigint;
|
|
13
|
+
callGasLimit: bigint;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
|
|
17
|
+
*
|
|
18
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/sponsorUserOperation
|
|
19
|
+
*
|
|
20
|
+
* @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
|
|
21
|
+
* @param args {@link sponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
|
|
22
|
+
* @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
|
|
23
|
+
*
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* import { createClient } from "viem"
|
|
27
|
+
* import { sponsorUserOperation } from "permissionless/actions/pimlico"
|
|
28
|
+
*
|
|
29
|
+
* const bundlerClient = createClient({
|
|
30
|
+
* chain: goerli,
|
|
31
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
32
|
+
* })
|
|
33
|
+
*
|
|
34
|
+
* await sponsorUserOperation(bundlerClient, {
|
|
35
|
+
* userOperation: userOperationWithDummySignature,
|
|
36
|
+
* entryPoint: entryPoint
|
|
37
|
+
* }})
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
export declare const sponsorUserOperation: (client: PimlicoPaymasterClient, args: SponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType>;
|
|
41
|
+
//# sourceMappingURL=sponsorUserOperation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sponsorUserOperation.d.ts","sourceRoot":"","sources":["../../../actions/pimlico/sponsorUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACtE,OAAO,KAAK,EAAE,aAAa,EAAgC,MAAM,8BAA8B,CAAA;AAG/F,MAAM,MAAM,8BAA8B,GAAG;IACzC,aAAa,EAAE,SAAS,CACpB,aAAa,EACb,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,kBAAkB,CACtF,CAAA;IACD,UAAU,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG;IACzC,gBAAgB,EAAE,GAAG,CAAA;IACrB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,YAAY,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,oBAAoB,WACrB,sBAAsB,QACxB,8BAA8B,KACrC,QAAQ,8BAA8B,CAYxC,CAAA"}
|