permissionless 0.0.13 → 0.0.15
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 +15 -0
- package/_cjs/accounts/index.js +3 -1
- package/_cjs/accounts/index.js.map +1 -1
- package/_cjs/accounts/kernel/abi/KernelAccountAbi.js +84 -0
- package/_cjs/accounts/kernel/abi/KernelAccountAbi.js.map +1 -0
- package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js +211 -0
- package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -0
- package/_cjs/accounts/signerToSafeSmartAccount.js +2 -2
- package/_cjs/actions/pimlico/sponsorUserOperation.js +12 -4
- package/_cjs/actions/pimlico/sponsorUserOperation.js.map +1 -1
- package/_cjs/actions/pimlico/validateSponsorshipPolicies.js +16 -0
- package/_cjs/actions/pimlico/validateSponsorshipPolicies.js.map +1 -0
- package/_cjs/actions/pimlico.js +3 -1
- package/_cjs/actions/pimlico.js.map +1 -1
- package/_cjs/clients/createSmartAccountClient.js.map +1 -1
- package/_cjs/clients/decorators/pimlico.js +3 -1
- package/_cjs/clients/decorators/pimlico.js.map +1 -1
- package/_cjs/utils/getRequiredPrefund.js +12 -0
- package/_cjs/utils/getRequiredPrefund.js.map +1 -0
- package/_cjs/utils/index.js +3 -1
- package/_cjs/utils/index.js.map +1 -1
- package/_esm/accounts/index.js +2 -1
- package/_esm/accounts/index.js.map +1 -1
- package/_esm/accounts/kernel/abi/KernelAccountAbi.js +87 -0
- package/_esm/accounts/kernel/abi/KernelAccountAbi.js.map +1 -0
- package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js +262 -0
- package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -0
- package/_esm/accounts/signerToSafeSmartAccount.js +2 -2
- package/_esm/actions/pimlico/sponsorUserOperation.js +13 -5
- package/_esm/actions/pimlico/sponsorUserOperation.js.map +1 -1
- package/_esm/actions/pimlico/validateSponsorshipPolicies.js +47 -0
- package/_esm/actions/pimlico/validateSponsorshipPolicies.js.map +1 -0
- package/_esm/actions/pimlico.js +2 -1
- package/_esm/actions/pimlico.js.map +1 -1
- package/_esm/clients/createSmartAccountClient.js +1 -1
- package/_esm/clients/createSmartAccountClient.js.map +1 -1
- package/_esm/clients/decorators/pimlico.js +38 -1
- package/_esm/clients/decorators/pimlico.js.map +1 -1
- package/_esm/utils/getRequiredPrefund.js +22 -0
- package/_esm/utils/getRequiredPrefund.js.map +1 -0
- package/_esm/utils/index.js +2 -1
- package/_esm/utils/index.js.map +1 -1
- package/_types/accounts/index.d.ts +2 -1
- package/_types/accounts/index.d.ts.map +1 -1
- package/_types/accounts/kernel/abi/KernelAccountAbi.d.ts +68 -0
- package/_types/accounts/kernel/abi/KernelAccountAbi.d.ts.map +1 -0
- package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts +25 -0
- package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts.map +1 -0
- package/_types/actions/pimlico/sponsorUserOperation.d.ts +4 -3
- package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -1
- package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts +54 -0
- package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts.map +1 -0
- package/_types/actions/pimlico.d.ts +4 -3
- package/_types/actions/pimlico.d.ts.map +1 -1
- package/_types/clients/createSmartAccountClient.d.ts +6 -1
- package/_types/clients/createSmartAccountClient.d.ts.map +1 -1
- package/_types/clients/decorators/pimlico.d.ts +40 -3
- package/_types/clients/decorators/pimlico.d.ts.map +1 -1
- package/_types/types/pimlico.d.ts +21 -1
- package/_types/types/pimlico.d.ts.map +1 -1
- package/_types/utils/getRequiredPrefund.d.ts +20 -0
- package/_types/utils/getRequiredPrefund.d.ts.map +1 -0
- package/_types/utils/index.d.ts +2 -1
- package/_types/utils/index.d.ts.map +1 -1
- package/accounts/index.ts +8 -1
- package/accounts/kernel/abi/KernelAccountAbi.ts +87 -0
- package/accounts/kernel/signerToEcdsaKernelSmartAccount.ts +363 -0
- package/accounts/signerToSafeSmartAccount.ts +2 -2
- package/actions/pimlico/sponsorUserOperation.ts +20 -7
- package/actions/pimlico/validateSponsorshipPolicies.ts +76 -0
- package/actions/pimlico.ts +13 -4
- package/clients/createSmartAccountClient.ts +6 -1
- package/clients/decorators/pimlico.ts +52 -5
- package/package.json +1 -1
- package/types/pimlico.ts +21 -1
- package/utils/getRequiredPrefund.ts +31 -0
- package/utils/index.ts +6 -0
|
@@ -2,9 +2,10 @@ import type { Account, Address, Chain, Client, Hex, Transport } from "viem";
|
|
|
2
2
|
import type { PartialBy } from "viem/types/utils";
|
|
3
3
|
import type { PimlicoPaymasterRpcSchema } from "../../types/pimlico.js";
|
|
4
4
|
import type { UserOperation } from "../../types/userOperation.js";
|
|
5
|
-
export type
|
|
5
|
+
export type PimlocoSponsorUserOperationParameters = {
|
|
6
6
|
userOperation: PartialBy<UserOperation, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterAndData">;
|
|
7
7
|
entryPoint: Address;
|
|
8
|
+
sponsorshipPolicyId?: string;
|
|
8
9
|
};
|
|
9
10
|
export type SponsorUserOperationReturnType = {
|
|
10
11
|
paymasterAndData: Hex;
|
|
@@ -18,7 +19,7 @@ export type SponsorUserOperationReturnType = {
|
|
|
18
19
|
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/sponsorUserOperation
|
|
19
20
|
*
|
|
20
21
|
* @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
|
|
22
|
+
* @param args {@link PimlocoSponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
|
|
22
23
|
* @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
|
|
23
24
|
*
|
|
24
25
|
*
|
|
@@ -37,5 +38,5 @@ export type SponsorUserOperationReturnType = {
|
|
|
37
38
|
* }})
|
|
38
39
|
*
|
|
39
40
|
*/
|
|
40
|
-
export declare const sponsorUserOperation: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined>(client: Client<TTransport, TChain, TAccount, PimlicoPaymasterRpcSchema>, args:
|
|
41
|
+
export declare const sponsorUserOperation: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined>(client: Client<TTransport, TChain, TAccount, PimlicoPaymasterRpcSchema>, args: PimlocoSponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType>;
|
|
41
42
|
//# sourceMappingURL=sponsorUserOperation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sponsorUserOperation.d.ts","sourceRoot":"","sources":["../../../actions/pimlico/sponsorUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AACvE,OAAO,KAAK,EACR,aAAa,EAEhB,MAAM,8BAA8B,CAAA;AAGrC,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"sponsorUserOperation.d.ts","sourceRoot":"","sources":["../../../actions/pimlico/sponsorUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AACvE,OAAO,KAAK,EACR,aAAa,EAEhB,MAAM,8BAA8B,CAAA;AAGrC,MAAM,MAAM,qCAAqC,GAAG;IAChD,aAAa,EAAE,SAAS,CACpB,aAAa,EACX,cAAc,GACd,oBAAoB,GACpB,sBAAsB,GACtB,kBAAkB,CACvB,CAAA;IACD,UAAU,EAAE,OAAO,CAAA;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC/B,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,8OAMvB,qCAAqC,KAC5C,QAAQ,8BAA8B,CA2BxC,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Account, Address, Chain, Client, Transport } from "viem";
|
|
2
|
+
import type { PimlicoPaymasterRpcSchema } from "../../types/pimlico.js";
|
|
3
|
+
import type { UserOperation } from "../../types/userOperation.js";
|
|
4
|
+
export type ValidateSponsorshipPoliciesParameters = {
|
|
5
|
+
userOperation: UserOperation;
|
|
6
|
+
entryPoint: Address;
|
|
7
|
+
sponsorshipPolicyIds: string[];
|
|
8
|
+
};
|
|
9
|
+
export type ValidateSponsorshipPoliciesReturnType = {
|
|
10
|
+
sponsorshipPolicyId: string;
|
|
11
|
+
data: {
|
|
12
|
+
name: string | null;
|
|
13
|
+
author: string | null;
|
|
14
|
+
icon: string | null;
|
|
15
|
+
description: string | null;
|
|
16
|
+
};
|
|
17
|
+
}[];
|
|
18
|
+
/**
|
|
19
|
+
* Returns valid sponsorship policies for a userOperation from the list of ids passed
|
|
20
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/ValidateSponsorshipPolicies
|
|
21
|
+
*
|
|
22
|
+
* @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
|
|
23
|
+
* @param args {@link ValidateSponsorshipPoliciesParameters} UserOperation you want to sponsor & entryPoint.
|
|
24
|
+
* @returns valid sponsorship policies, see {@link ValidateSponsorshipPoliciesReturnType}
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* import { createClient } from "viem"
|
|
28
|
+
* import { validateSponsorshipPolicies } from "permissionless/actions/pimlico"
|
|
29
|
+
*
|
|
30
|
+
* const bundlerClient = createClient({
|
|
31
|
+
* chain: goerli,
|
|
32
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
33
|
+
* })
|
|
34
|
+
*
|
|
35
|
+
* await validateSponsorshipPolicies(bundlerClient, {
|
|
36
|
+
* userOperation: userOperationWithDummySignature,
|
|
37
|
+
* entryPoint: entryPoint,
|
|
38
|
+
* sponsorshipPolicyIds: ["sp_shiny_puma"]
|
|
39
|
+
* })
|
|
40
|
+
* Returns
|
|
41
|
+
* [
|
|
42
|
+
* {
|
|
43
|
+
* sponsorshipPolicyId: "sp_shiny_puma",
|
|
44
|
+
* data: {
|
|
45
|
+
* name: "Shiny Puma",
|
|
46
|
+
* author: "Pimlico",
|
|
47
|
+
* icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4...",
|
|
48
|
+
* description: "This policy is for testing purposes only"
|
|
49
|
+
* }
|
|
50
|
+
* }
|
|
51
|
+
* ]
|
|
52
|
+
*/
|
|
53
|
+
export declare const validateSponsorshipPolicies: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined>(client: Client<TTransport, TChain, TAccount, PimlicoPaymasterRpcSchema>, args: ValidateSponsorshipPoliciesParameters) => Promise<ValidateSponsorshipPoliciesReturnType>;
|
|
54
|
+
//# sourceMappingURL=validateSponsorshipPolicies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateSponsorshipPolicies.d.ts","sourceRoot":"","sources":["../../../actions/pimlico/validateSponsorshipPolicies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AACtE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AACvE,OAAO,KAAK,EACR,aAAa,EAEhB,MAAM,8BAA8B,CAAA;AAGrC,MAAM,MAAM,qCAAqC,GAAG;IAChD,aAAa,EAAE,aAAa,CAAA;IAC5B,UAAU,EAAE,OAAO,CAAA;IACnB,oBAAoB,EAAE,MAAM,EAAE,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,qCAAqC,GAAG;IAChD,mBAAmB,EAAE,MAAM,CAAA;IAC3B,IAAI,EAAE;QACF,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;QACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;QACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;QACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;KAC7B,CAAA;CACJ,EAAE,CAAA;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,2BAA2B,8OAM9B,qCAAqC,KAC5C,QAAQ,qCAAqC,CAS/C,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
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
|
|
3
|
+
import { type PimlocoSponsorUserOperationParameters, type SponsorUserOperationReturnType, sponsorUserOperation } from "./pimlico/sponsorUserOperation.js";
|
|
4
4
|
import type { PimlicoBundlerActions, PimlicoPaymasterClientActions } from "../clients/decorators/pimlico.js";
|
|
5
5
|
import { pimlicoBundlerActions, pimlicoPaymasterActions } from "../clients/decorators/pimlico.js";
|
|
6
|
-
|
|
7
|
-
export {
|
|
6
|
+
import { type ValidateSponsorshipPoliciesParameters, type ValidateSponsorshipPoliciesReturnType, validateSponsorshipPolicies } from "./pimlico/validateSponsorshipPolicies.js";
|
|
7
|
+
export type { GetUserOperationGasPriceReturnType, GetUserOperationStatusParameters, GetUserOperationStatusReturnType, PimlocoSponsorUserOperationParameters, SponsorUserOperationReturnType, PimlicoBundlerActions, PimlicoPaymasterClientActions, ValidateSponsorshipPoliciesParameters, ValidateSponsorshipPoliciesReturnType };
|
|
8
|
+
export { getUserOperationGasPrice, getUserOperationStatus, sponsorUserOperation, pimlicoBundlerActions, pimlicoPaymasterActions, validateSponsorshipPolicies };
|
|
8
9
|
//# 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,
|
|
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,qCAAqC,EAC1C,KAAK,qCAAqC,EAC1C,2BAA2B,EAC9B,MAAM,0CAA0C,CAAA;AAEjD,YAAY,EACR,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,qCAAqC,EACrC,8BAA8B,EAC9B,qBAAqB,EACrB,6BAA6B,EAC7B,qCAAqC,EACrC,qCAAqC,EACxC,CAAA;AAED,OAAO,EACH,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,EAC9B,CAAA"}
|
|
@@ -4,6 +4,11 @@ import { type SponsorUserOperationMiddleware } from "../actions/smartAccount/pre
|
|
|
4
4
|
import { type BundlerRpcSchema } from "../types/bundler.js";
|
|
5
5
|
import type { Prettify } from "../types/index.js";
|
|
6
6
|
import { type SmartAccountActions } from "./decorators/smartAccount.js";
|
|
7
|
+
/**
|
|
8
|
+
* TODO:
|
|
9
|
+
* - Add docs
|
|
10
|
+
* - Fix typing, 'accounts' is required to signMessage, signTypedData, signTransaction, but not needed here, since account is embedded in the client
|
|
11
|
+
*/
|
|
7
12
|
export type SmartAccountClient<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartAccount | undefined = SmartAccount | undefined> = Prettify<Client<transport, chain, account, BundlerRpcSchema, SmartAccountActions<chain, account>>>;
|
|
8
13
|
export type SmartAccountClientConfig<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, TAccount extends SmartAccount | undefined = SmartAccount | undefined> = Prettify<Pick<ClientConfig<transport, chain, TAccount>, "account" | "cacheTime" | "chain" | "key" | "name" | "pollingInterval" | "transport">>;
|
|
9
14
|
/**
|
|
@@ -13,7 +18,7 @@ export type SmartAccountClientConfig<transport extends Transport = Transport, ch
|
|
|
13
18
|
*
|
|
14
19
|
* A Bundler Client is an interface to "erc 4337" [JSON-RPC API](https://eips.ethereum.org/EIPS/eip-4337#rpc-methods-eth-namespace) methods such as sending user operation, estimating gas for a user operation, get user operation receipt, etc through Bundler Actions.
|
|
15
20
|
*
|
|
16
|
-
* @param
|
|
21
|
+
* @param parameters - {@link WalletClientConfig}
|
|
17
22
|
* @returns A Bundler Client. {@link SmartAccountClient}
|
|
18
23
|
*
|
|
19
24
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSmartAccountClient.d.ts","sourceRoot":"","sources":["../../clients/createSmartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,KAAK,EACL,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,SAAS,EAEZ,MAAM,MAAM,CAAA;AAEb,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,wDAAwD,CAAA;AAC5G,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EACH,KAAK,mBAAmB,EAE3B,MAAM,8BAA8B,CAAA;AAErC,MAAM,MAAM,kBAAkB,CAC1B,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACnD,OAAO,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,IACnE,QAAQ,CACR,MAAM,CACF,SAAS,EACT,KAAK,EACL,OAAO,EACP,gBAAgB,EAChB,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,CACtC,CACJ,CAAA;AAED,MAAM,MAAM,wBAAwB,CAChC,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACnD,QAAQ,SAAS,YAAY,GAAG,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Y,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,IACnE,QAAQ,CACR,MAAM,CACF,SAAS,EACT,KAAK,EACL,OAAO,EACP,gBAAgB,EAChB,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,CACtC,CACJ,CAAA;AAED,MAAM,MAAM,wBAAwB,CAChC,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACnD,QAAQ,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,IACpE,QAAQ,CACR,IAAI,CACA,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,EACtC,SAAS,GACT,WAAW,GACX,OAAO,GACP,KAAK,GACL,MAAM,GACN,iBAAiB,GACjB,WAAW,CAChB,CACJ,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BpC,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Client } from "viem";
|
|
2
|
+
import { type ValidateSponsorshipPoliciesParameters, type ValidateSponsorshipPoliciesReturnType } from "../../actions/pimlico.js";
|
|
2
3
|
import { type GetUserOperationGasPriceReturnType } from "../../actions/pimlico/getUserOperationGasPrice.js";
|
|
3
4
|
import { type GetUserOperationStatusParameters, type GetUserOperationStatusReturnType } from "../../actions/pimlico/getUserOperationStatus.js";
|
|
4
|
-
import { type
|
|
5
|
+
import { type PimlocoSponsorUserOperationParameters, type SponsorUserOperationReturnType } from "../../actions/pimlico/sponsorUserOperation.js";
|
|
5
6
|
export type PimlicoBundlerActions = {
|
|
6
7
|
/**
|
|
7
8
|
* Returns the live gas prices that you can use to send a user operation.
|
|
@@ -51,7 +52,7 @@ export type PimlicoPaymasterClientActions = {
|
|
|
51
52
|
*
|
|
52
53
|
* https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/sponsorUserOperation
|
|
53
54
|
*
|
|
54
|
-
* @param args {@link
|
|
55
|
+
* @param args {@link PimlocoSponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
|
|
55
56
|
* @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
|
|
56
57
|
*
|
|
57
58
|
* @example
|
|
@@ -69,8 +70,44 @@ export type PimlicoPaymasterClientActions = {
|
|
|
69
70
|
* }})
|
|
70
71
|
*
|
|
71
72
|
*/
|
|
72
|
-
sponsorUserOperation: (args:
|
|
73
|
+
sponsorUserOperation: (args: PimlocoSponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType>;
|
|
74
|
+
validateSponsorshipPolicies: (args: ValidateSponsorshipPoliciesParameters) => Promise<ValidateSponsorshipPoliciesReturnType>;
|
|
73
75
|
};
|
|
76
|
+
/**
|
|
77
|
+
* Returns valid sponsorship policies for a userOperation from the list of ids passed
|
|
78
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/ValidateSponsorshipPolicies
|
|
79
|
+
*
|
|
80
|
+
* @param args {@link ValidateSponsorshipPoliciesParameters} UserOperation you want to sponsor & entryPoint.
|
|
81
|
+
* @returns valid sponsorship policies, see {@link ValidateSponsorshipPoliciesReturnType}
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* import { createClient } from "viem"
|
|
85
|
+
* import { validateSponsorshipPolicies } from "permissionless/actions/pimlico"
|
|
86
|
+
*
|
|
87
|
+
* const bundlerClient = createClient({
|
|
88
|
+
* chain: goerli,
|
|
89
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
90
|
+
* }).extend(pimlicoPaymasterActions)
|
|
91
|
+
|
|
92
|
+
*
|
|
93
|
+
* await bundlerClient.validateSponsorshipPolicies({
|
|
94
|
+
* userOperation: userOperationWithDummySignature,
|
|
95
|
+
* entryPoint: entryPoint,
|
|
96
|
+
* sponsorshipPolicyIds: ["sp_shiny_puma"]
|
|
97
|
+
* })
|
|
98
|
+
* Returns
|
|
99
|
+
* [
|
|
100
|
+
* {
|
|
101
|
+
* sponsorshipPolicyId: "sp_shiny_puma",
|
|
102
|
+
* data: {
|
|
103
|
+
* name: "Shiny Puma",
|
|
104
|
+
* author: "Pimlico",
|
|
105
|
+
* icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4...",
|
|
106
|
+
* description: "This policy is for testing purposes only"
|
|
107
|
+
* }
|
|
108
|
+
* }
|
|
109
|
+
* ]
|
|
110
|
+
*/
|
|
74
111
|
export declare const pimlicoPaymasterActions: (client: Client) => PimlicoPaymasterClientActions;
|
|
75
112
|
/**
|
|
76
113
|
* TODO: Add support for pimlicoActions after we support all the actions of v2 of the Pimlico API.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAQ,MAAM,MAAM,CAAA;AACxC,OAAO,EACH,KAAK,kCAAkC,EAE1C,MAAM,mDAAmD,CAAA;AAC1D,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EAExC,MAAM,iDAAiD,CAAA;AACxD,OAAO,EACH,KAAK,
|
|
1
|
+
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAQ,MAAM,MAAM,CAAA;AACxC,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,qCAAqC,EAE7C,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACH,KAAK,kCAAkC,EAE1C,MAAM,mDAAmD,CAAA;AAC1D,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EAExC,MAAM,iDAAiD,CAAA;AACxD,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,8BAA8B,EAEtC,MAAM,+CAA+C,CAAA;AAMtD,MAAM,MAAM,qBAAqB,GAAG;IAChC;;;;;;;;;;;;;;;;;;OAkBG;IACH,wBAAwB,EAAE,MAAM,OAAO,CAAC,kCAAkC,CAAC,CAAA;IAC3E;;;;;;;;;;;;;;;;;;OAkBG;IACH,sBAAsB,EAAE,CACpB,IAAI,EAAE,gCAAgC,KACrC,OAAO,CAAC,gCAAgC,CAAC,CAAA;CACjD,CAAA;AAED,eAAO,MAAM,qBAAqB,WACtB,MAAM,KACf,qBAKD,CAAA;AAEF,MAAM,MAAM,6BAA6B,GAAG;IACxC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,oBAAoB,EAAE,CAClB,IAAI,EAAE,qCAAqC,KAC1C,OAAO,CAAC,8BAA8B,CAAC,CAAA;IAE5C,2BAA2B,EAAE,CACzB,IAAI,EAAE,qCAAqC,KAC1C,OAAO,CAAC,qCAAqC,CAAC,CAAA;CACtD,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,uBAAuB,WACxB,MAAM,KACf,6BAMD,CAAA;AAEF;;GAEG"}
|
|
@@ -36,7 +36,10 @@ export type PimlicoPaymasterRpcSchema = [
|
|
|
36
36
|
Method: "pm_sponsorUserOperation";
|
|
37
37
|
Parameters: [
|
|
38
38
|
userOperation: PartialBy<UserOperationWithBigIntAsHex, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterAndData">,
|
|
39
|
-
entryPoint: Address
|
|
39
|
+
entryPoint: Address,
|
|
40
|
+
metadata?: {
|
|
41
|
+
sponsorshipPolicyId?: string;
|
|
42
|
+
}
|
|
40
43
|
];
|
|
41
44
|
ReturnType: {
|
|
42
45
|
paymasterAndData: Hex;
|
|
@@ -44,6 +47,23 @@ export type PimlicoPaymasterRpcSchema = [
|
|
|
44
47
|
verificationGasLimit: Hex;
|
|
45
48
|
callGasLimit: Hex;
|
|
46
49
|
};
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
Method: "pm_validateSponsorshipPolicies";
|
|
53
|
+
Parameters: [
|
|
54
|
+
userOperation: UserOperationWithBigIntAsHex,
|
|
55
|
+
entryPoint: Address,
|
|
56
|
+
sponsorshipPolicyIds: string[]
|
|
57
|
+
];
|
|
58
|
+
ReturnType: {
|
|
59
|
+
sponsorshipPolicyId: string;
|
|
60
|
+
data: {
|
|
61
|
+
name: string | null;
|
|
62
|
+
author: string | null;
|
|
63
|
+
icon: string | null;
|
|
64
|
+
description: string | null;
|
|
65
|
+
};
|
|
66
|
+
}[];
|
|
47
67
|
}
|
|
48
68
|
];
|
|
49
69
|
export {};
|
|
@@ -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,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I,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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { UserOperation } from "../types";
|
|
2
|
+
export type GetRequiredPrefundReturnType = {
|
|
3
|
+
userOperation: UserOperation;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* Returns the minimum required funds in the senders's smart account to execute the user operation.
|
|
8
|
+
*
|
|
9
|
+
* @param arags: {userOperation} as {@link UserOperation}
|
|
10
|
+
* @returns requiredPrefund as {@link bigint}
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { getRequiredPrefund } from "permissionless/utils"
|
|
14
|
+
*
|
|
15
|
+
* const requiredPrefund = getRequiredPrefund({
|
|
16
|
+
* userOperation
|
|
17
|
+
* })
|
|
18
|
+
*/
|
|
19
|
+
export declare const getRequiredPrefund: ({ userOperation }: GetRequiredPrefundReturnType) => bigint;
|
|
20
|
+
//# sourceMappingURL=getRequiredPrefund.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRequiredPrefund.d.ts","sourceRoot":"","sources":["../../utils/getRequiredPrefund.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7C,MAAM,MAAM,4BAA4B,GAAG;IACvC,aAAa,EAAE,aAAa,CAAA;CAC/B,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,sBAE5B,4BAA4B,KAAG,MAQjC,CAAA"}
|
package/_types/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Account, Address } from "viem";
|
|
2
|
+
import { type GetRequiredPrefundReturnType, getRequiredPrefund } from "./getRequiredPrefund.js";
|
|
2
3
|
import { type GetUserOperationHashParams, getUserOperationHash } from "./getUserOperationHash.js";
|
|
3
4
|
import { AccountOrClientNotFoundError, signUserOperationHashWithECDSA } from "./signUserOperationHashWithECDSA.js";
|
|
4
5
|
export declare function parseAccount(account: Address | Account): Account;
|
|
5
|
-
export { getUserOperationHash, type GetUserOperationHashParams, signUserOperationHashWithECDSA, AccountOrClientNotFoundError };
|
|
6
|
+
export { getUserOperationHash, getRequiredPrefund, type GetRequiredPrefundReturnType, type GetUserOperationHashParams, signUserOperationHashWithECDSA, AccountOrClientNotFoundError };
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC5C,OAAO,EACH,KAAK,0BAA0B,EAC/B,oBAAoB,EACvB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACH,4BAA4B,EAC5B,8BAA8B,EACjC,MAAM,qCAAqC,CAAA;AAE5C,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAIhE;AAED,OAAO,EACH,oBAAoB,EACpB,KAAK,0BAA0B,EAC/B,8BAA8B,EAC9B,4BAA4B,EAC/B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC5C,OAAO,EACH,KAAK,4BAA4B,EACjC,kBAAkB,EACrB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACH,KAAK,0BAA0B,EAC/B,oBAAoB,EACvB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACH,4BAA4B,EAC5B,8BAA8B,EACjC,MAAM,qCAAqC,CAAA;AAE5C,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAIhE;AAED,OAAO,EACH,oBAAoB,EACpB,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,8BAA8B,EAC9B,4BAA4B,EAC/B,CAAA"}
|
package/accounts/index.ts
CHANGED
|
@@ -13,6 +13,11 @@ import {
|
|
|
13
13
|
signerToSafeSmartAccount
|
|
14
14
|
} from "./signerToSafeSmartAccount.js"
|
|
15
15
|
|
|
16
|
+
import {
|
|
17
|
+
type KernelEcdsaSmartAccount,
|
|
18
|
+
signerToEcdsaKernelSmartAccount
|
|
19
|
+
} from "./kernel/signerToEcdsaKernelSmartAccount.js"
|
|
20
|
+
|
|
16
21
|
import {
|
|
17
22
|
SignTransactionNotSupportedBySmartAccount,
|
|
18
23
|
type SmartAccount,
|
|
@@ -29,5 +34,7 @@ export {
|
|
|
29
34
|
SignTransactionNotSupportedBySmartAccount,
|
|
30
35
|
privateKeyToSimpleSmartAccount,
|
|
31
36
|
type SmartAccount,
|
|
32
|
-
privateKeyToSafeSmartAccount
|
|
37
|
+
privateKeyToSafeSmartAccount,
|
|
38
|
+
type KernelEcdsaSmartAccount,
|
|
39
|
+
signerToEcdsaKernelSmartAccount
|
|
33
40
|
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The exeute abi, used to execute a transaction on the kernel smart account
|
|
3
|
+
*/
|
|
4
|
+
export const KernelExecuteAbi = [
|
|
5
|
+
{
|
|
6
|
+
inputs: [
|
|
7
|
+
{
|
|
8
|
+
internalType: "address",
|
|
9
|
+
name: "to",
|
|
10
|
+
type: "address"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
internalType: "uint256",
|
|
14
|
+
name: "value",
|
|
15
|
+
type: "uint256"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
internalType: "bytes",
|
|
19
|
+
name: "data",
|
|
20
|
+
type: "bytes"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
internalType: "enum Operation",
|
|
24
|
+
name: "",
|
|
25
|
+
type: "uint8"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
name: "execute",
|
|
29
|
+
outputs: [],
|
|
30
|
+
stateMutability: "payable",
|
|
31
|
+
type: "function"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
inputs: [
|
|
35
|
+
{
|
|
36
|
+
components: [
|
|
37
|
+
{
|
|
38
|
+
internalType: "address",
|
|
39
|
+
name: "to",
|
|
40
|
+
type: "address"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
internalType: "uint256",
|
|
44
|
+
name: "value",
|
|
45
|
+
type: "uint256"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
internalType: "bytes",
|
|
49
|
+
name: "data",
|
|
50
|
+
type: "bytes"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
internalType: "struct Call[]",
|
|
54
|
+
name: "calls",
|
|
55
|
+
type: "tuple[]"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
name: "executeBatch",
|
|
59
|
+
outputs: [],
|
|
60
|
+
stateMutability: "payable",
|
|
61
|
+
type: "function"
|
|
62
|
+
}
|
|
63
|
+
] as const
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The init abi, used to initialise kernel account
|
|
67
|
+
*/
|
|
68
|
+
export const KernelInitAbi = [
|
|
69
|
+
{
|
|
70
|
+
inputs: [
|
|
71
|
+
{
|
|
72
|
+
internalType: "contract IKernelValidator",
|
|
73
|
+
name: "_defaultValidator",
|
|
74
|
+
type: "address"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
internalType: "bytes",
|
|
78
|
+
name: "_data",
|
|
79
|
+
type: "bytes"
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
name: "initialize",
|
|
83
|
+
outputs: [],
|
|
84
|
+
stateMutability: "payable",
|
|
85
|
+
type: "function"
|
|
86
|
+
}
|
|
87
|
+
] as const
|