permissionless 0.2.45 → 0.2.46
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/accounts/biconomy/toBiconomySmartAccount.js.map +1 -1
- package/_cjs/accounts/etherspot/toEtherspotSmartAccount.js.map +1 -1
- package/_cjs/accounts/kernel/toKernelSmartAccount.js.map +1 -1
- package/_cjs/accounts/light/toLightSmartAccount.js.map +1 -1
- package/_cjs/accounts/nexus/toNexusSmartAccount.js.map +1 -1
- package/_cjs/accounts/safe/toSafeSmartAccount.js.map +1 -1
- package/_cjs/accounts/simple/toSimpleSmartAccount.js +208 -178
- package/_cjs/accounts/simple/toSimpleSmartAccount.js.map +1 -1
- package/_cjs/accounts/thirdweb/toThirdwebSmartAccount.js.map +1 -1
- package/_cjs/accounts/trust/toTrustSmartAccount.js.map +1 -1
- package/_cjs/clients/decorators/pimlico.js.map +1 -1
- package/_cjs/clients/pimlico.js.map +1 -1
- package/_cjs/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js.map +1 -1
- package/_cjs/utils/getEstimationCallData.js +13 -0
- package/_cjs/utils/getEstimationCallData.js.map +1 -1
- package/_cjs/utils/getRequiredPrefund.js.map +1 -1
- package/_esm/accounts/biconomy/toBiconomySmartAccount.js.map +1 -1
- package/_esm/accounts/etherspot/toEtherspotSmartAccount.js.map +1 -1
- package/_esm/accounts/kernel/toKernelSmartAccount.js.map +1 -1
- package/_esm/accounts/light/toLightSmartAccount.js.map +1 -1
- package/_esm/accounts/nexus/toNexusSmartAccount.js.map +1 -1
- package/_esm/accounts/safe/toSafeSmartAccount.js.map +1 -1
- package/_esm/accounts/simple/toSimpleSmartAccount.js +211 -179
- package/_esm/accounts/simple/toSimpleSmartAccount.js.map +1 -1
- package/_esm/accounts/thirdweb/toThirdwebSmartAccount.js.map +1 -1
- package/_esm/accounts/trust/toTrustSmartAccount.js.map +1 -1
- package/_esm/clients/decorators/pimlico.js.map +1 -1
- package/_esm/clients/pimlico.js.map +1 -1
- package/_esm/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js.map +1 -1
- package/_esm/utils/getEstimationCallData.js +13 -0
- package/_esm/utils/getEstimationCallData.js.map +1 -1
- package/_esm/utils/getRequiredPrefund.js.map +1 -1
- package/_types/accounts/biconomy/toBiconomySmartAccount.d.ts +2 -2
- package/_types/accounts/biconomy/toBiconomySmartAccount.d.ts.map +1 -1
- package/_types/accounts/etherspot/toEtherspotSmartAccount.d.ts +2 -2
- package/_types/accounts/etherspot/toEtherspotSmartAccount.d.ts.map +1 -1
- package/_types/accounts/kernel/toKernelSmartAccount.d.ts +2 -2
- package/_types/accounts/kernel/toKernelSmartAccount.d.ts.map +1 -1
- package/_types/accounts/light/toLightSmartAccount.d.ts +2 -2
- package/_types/accounts/light/toLightSmartAccount.d.ts.map +1 -1
- package/_types/accounts/nexus/toNexusSmartAccount.d.ts +2 -2
- package/_types/accounts/nexus/toNexusSmartAccount.d.ts.map +1 -1
- package/_types/accounts/safe/toSafeSmartAccount.d.ts +2 -2
- package/_types/accounts/safe/toSafeSmartAccount.d.ts.map +1 -1
- package/_types/accounts/simple/toSimpleSmartAccount.d.ts +2303 -7
- package/_types/accounts/simple/toSimpleSmartAccount.d.ts.map +1 -1
- package/_types/accounts/thirdweb/toThirdwebSmartAccount.d.ts +2 -2
- package/_types/accounts/thirdweb/toThirdwebSmartAccount.d.ts.map +1 -1
- package/_types/accounts/trust/toTrustSmartAccount.d.ts +2 -2
- package/_types/accounts/trust/toTrustSmartAccount.d.ts.map +1 -1
- package/_types/actions/pimlico/sponsorUserOperation.d.ts +4 -4
- package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -1
- package/_types/clients/decorators/pimlico.d.ts +3 -2
- package/_types/clients/decorators/pimlico.d.ts.map +1 -1
- package/_types/clients/pimlico.d.ts +4 -4
- package/_types/clients/pimlico.d.ts.map +1 -1
- package/_types/types/pimlico.d.ts +3 -3
- package/_types/types/pimlico.d.ts.map +1 -1
- package/_types/utils/getEstimationCallData.d.ts +3 -3
- package/_types/utils/getEstimationCallData.d.ts.map +1 -1
- package/_types/utils/getRequiredPrefund.d.ts +3 -3
- package/_types/utils/getRequiredPrefund.d.ts.map +1 -1
- package/accounts/biconomy/toBiconomySmartAccount.ts +6 -1
- package/accounts/decodeCalls.test.ts +161 -0
- package/accounts/etherspot/toEtherspotSmartAccount.ts +6 -1
- package/accounts/kernel/toKernelSmartAccount.ts +6 -1
- package/accounts/light/toLightSmartAccount.ts +6 -1
- package/accounts/nexus/toNexusSmartAccount.ts +6 -1
- package/accounts/safe/toSafeSmartAccount.ts +6 -1
- package/accounts/simple/toSimpleSmartAccount.ts +243 -197
- package/accounts/thirdweb/toThirdwebSmartAccount.ts +6 -1
- package/accounts/trust/toTrustSmartAccount.ts +6 -1
- package/actions/pimlico/getTokenQuotes.test.ts +55 -1
- package/actions/pimlico/getUserOperationGasPrice.test.ts +50 -0
- package/actions/pimlico/getUserOperationStatus.test.ts +62 -0
- package/actions/pimlico/sponsorUserOperation.test.ts +51 -0
- package/actions/pimlico/sponsorUserOperation.ts +4 -4
- package/actions/pimlico/validateSponsorshipPolicies.test.ts +98 -2
- package/actions/public/getAccountNonce.test.ts +27 -0
- package/actions/public/getSenderAddress.test.ts +37 -1
- package/actions/smartAccount/sendTransaction.test.ts +121 -1
- package/actions/smartAccount/signMessage.test.ts +59 -0
- package/actions/smartAccount/signTypedData.test.ts +54 -0
- package/clients/decorators/pimlico.ts +3 -2
- package/clients/pimlico.ts +4 -3
- package/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.test.ts +208 -43
- package/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.ts +1 -1
- package/package.json +2 -2
- package/types/pimlico.ts +12 -2
- package/utils/getEstimationCallData.ts +25 -7
- package/utils/getRequiredPrefund.ts +6 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toSimpleSmartAccount.d.ts","sourceRoot":"","sources":["../../../accounts/simple/toSimpleSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,MAAM,EAEX,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,YAAY,EAGpB,MAAM,MAAM,CAAA;AACb,OAAO,EACH,KAAK,YAAY,EACjB,KAAK,0BAA0B,
|
|
1
|
+
{"version":3,"file":"toSimpleSmartAccount.d.ts","sourceRoot":"","sources":["../../../accounts/simple/toSimpleSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,MAAM,EAEX,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,YAAY,EAGpB,MAAM,MAAM,CAAA;AACb,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,0BAA0B,EASlC,MAAM,0BAA0B,CAAA;AAKjC,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,wBAAwB,CAAA;AAwCvE,MAAM,MAAM,8BAA8B,CACtC,iBAAiB,SAAS,iBAAiB,IAC3C;IACA,MAAM,EAAE,MAAM,CACV,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,cAAc,GAAG,YAAY,GAAG,SAAS,CAC5C,CAAA;IACD,KAAK,EAAE,KAAK,CACN,gBAAgB,GAChB,YAAY,CAAC,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,OAAO,CAAC,GACnD,YAAY,CACjB,CAAA;IACD,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,CAAC,EAAE;QACT,OAAO,EAAE,OAAO,CAAA;QAChB,OAAO,EAAE,iBAAiB,CAAA;KAC7B,CAAA;IACD,KAAK,CAAC,EAAE,MAAM,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS7D,CAAA;AAED,MAAM,MAAM,gCAAgC,CACxC,iBAAiB,SAAS,iBAAiB,GAAG,KAAK,IACnD,MAAM,CACN,0BAA0B,CACtB,UAAU,CAAC,OAAO,gBAAgB,CAAC,EACnC,iBAAiB,CACpB,EACD;IAAE,IAAI,EAAE,WAAW,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAA;CAAE,CAC5D,CAAA;AAED,MAAM,MAAM,8BAA8B,CACtC,iBAAiB,SAAS,iBAAiB,GAAG,KAAK,IACnD,YAAY,CAAC,gCAAgC,CAAC,iBAAiB,CAAC,CAAC,CAAA;AAErE;;;;GAIG;AACH,wBAAsB,oBAAoB,CACtC,iBAAiB,SAAS,iBAAiB,EAE3C,UAAU,EAAE,8BAA8B,CAAC,iBAAiB,CAAC,GAC9D,OAAO,CAAC,8BAA8B,CAAC,iBAAiB,CAAC,CAAC,CAgQ5D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Account, Address, Assign, Chain, Client, LocalAccount, OneOf, Transport, WalletClient } from "viem";
|
|
1
|
+
import type { Account, Address, Assign, Chain, Client, JsonRpcAccount, LocalAccount, OneOf, Transport, WalletClient } from "viem";
|
|
2
2
|
import { type SmartAccount, type SmartAccountImplementation, entryPoint06Abi, entryPoint07Abi } from "viem/account-abstraction";
|
|
3
3
|
import { type EthereumProvider } from "../../utils/toOwner.js";
|
|
4
4
|
/**
|
|
@@ -17,7 +17,7 @@ export declare const THIRDWEB_ADDRESSES: {
|
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
export type ToThirdwebSmartAccountParameters<entryPointVersion extends "0.6" | "0.7" = "0.7"> = {
|
|
20
|
-
client: Client
|
|
20
|
+
client: Client<Transport, Chain | undefined, JsonRpcAccount | LocalAccount | undefined>;
|
|
21
21
|
owner: OneOf<EthereumProvider | WalletClient<Transport, Chain | undefined, Account> | LocalAccount>;
|
|
22
22
|
factoryAddress?: Address;
|
|
23
23
|
entryPoint?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toThirdwebSmartAccount.d.ts","sourceRoot":"","sources":["../../../accounts/thirdweb/toThirdwebSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,EACL,MAAM,EACN,YAAY,EACZ,KAAK,EACL,SAAS,EAET,YAAY,EACf,MAAM,MAAM,CAAA;AAIb,OAAO,EACH,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAE/B,eAAe,EACf,eAAe,EAIlB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,wBAAwB,CAAA;AAQvE;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;4BAIiC,OAAO;;;;;4BAMP,OAAO;;;CAGtE,CAAA;AAED,MAAM,MAAM,gCAAgC,CACxC,iBAAiB,SAAS,KAAK,GAAG,KAAK,GAAG,KAAK,IAC/C;IACA,MAAM,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"toThirdwebSmartAccount.d.ts","sourceRoot":"","sources":["../../../accounts/thirdweb/toThirdwebSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAA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AAC,CAAC,CAAA;CAAE,CAC5D,CAAA;AAED,MAAM,MAAM,gCAAgC,CACxC,iBAAiB,SAAS,KAAK,GAAG,KAAK,GAAG,KAAK,IAC/C,YAAY,CAAC,kCAAkC,CAAC,iBAAiB,CAAC,CAAC,CAAA;AAEvE;;;;GAIG;AACH,wBAAsB,sBAAsB,CACxC,iBAAiB,SAAS,KAAK,GAAG,KAAK,GAAG,KAAK,EAE/C,UAAU,EAAE,gCAAgC,CAAC,iBAAiB,CAAC,GAChE,OAAO,CAAC,gCAAgC,CAAC,iBAAiB,CAAC,CAAC,CAqH9D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Account, type Address, type Assign, type Chain, type Client, type LocalAccount, type OneOf, type Transport, type WalletClient } from "viem";
|
|
1
|
+
import { type Account, type Address, type Assign, type Chain, type Client, type JsonRpcAccount, type LocalAccount, type OneOf, type Transport, type WalletClient } from "viem";
|
|
2
2
|
import { type SmartAccount, type SmartAccountImplementation, entryPoint06Abi } from "viem/account-abstraction";
|
|
3
3
|
import { type EthereumProvider } from "../../utils/toOwner.js";
|
|
4
4
|
/**
|
|
@@ -9,7 +9,7 @@ export declare const TRUST_ADDRESSES: {
|
|
|
9
9
|
factoryAddress: Address;
|
|
10
10
|
};
|
|
11
11
|
export type ToTrustSmartAccountParameters = {
|
|
12
|
-
client: Client
|
|
12
|
+
client: Client<Transport, Chain | undefined, JsonRpcAccount | LocalAccount | undefined>;
|
|
13
13
|
owner: OneOf<EthereumProvider | WalletClient<Transport, Chain | undefined, Account> | LocalAccount>;
|
|
14
14
|
factoryAddress?: Address;
|
|
15
15
|
entryPoint: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toTrustSmartAccount.d.ts","sourceRoot":"","sources":["../../../accounts/trust/toTrustSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,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K,GAAG,SAAS,EAAE,OAAO,CAAC,GACnD,YAAY,CACjB,CAAA;IACD,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,EAAE;QACR,OAAO,EAAE,OAAO,CAAA;QAChB,OAAO,EAAE,KAAK,CAAA;KACjB,CAAA;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,iCAAiC,CAAC,EAAE,OAAO,CAAA;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,+BAA+B,GAAG,MAAM,CAChD,0BAA0B,CACtB,OAAO,eAAe,EACtB,KAAK,CAMR,EACD;IAAE,IAAI,EAAE,WAAW,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAA;CAAE,CAC5D,CAAA;AAED,MAAM,MAAM,6BAA6B,GACrC,YAAY,CAAC,+BAA+B,CAAC,CAAA;AAEjD;;;;GAIG;AACH,wBAAsB,mBAAmB,CACrC,UAAU,EAAE,6BAA6B,GAC1C,OAAO,CAAC,6BAA6B,CAAC,CAqHxC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Account, Address, Chain, Client, Hex, OneOf, PartialBy, Transport } from "viem";
|
|
2
|
-
import type { UserOperation } from "viem/account-abstraction";
|
|
2
|
+
import type { EntryPointVersion, UserOperation } from "viem/account-abstraction";
|
|
3
3
|
import type { PimlicoRpcSchema } from "../../types/pimlico.js";
|
|
4
4
|
type PaymasterContext = {
|
|
5
5
|
sponsorshipPolicyId?: string;
|
|
@@ -7,7 +7,7 @@ type PaymasterContext = {
|
|
|
7
7
|
meta?: Record<string, string>;
|
|
8
8
|
[key: string]: unknown;
|
|
9
9
|
};
|
|
10
|
-
export type PimlicoSponsorUserOperationParameters<entryPointVersion extends
|
|
10
|
+
export type PimlicoSponsorUserOperationParameters<entryPointVersion extends EntryPointVersion> = {
|
|
11
11
|
userOperation: OneOf<(entryPointVersion extends "0.6" ? PartialBy<UserOperation<"0.6">, "callGasLimit" | "preVerificationGas" | "verificationGasLimit"> : never) | (entryPointVersion extends "0.7" ? PartialBy<UserOperation<"0.7">, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit"> : never)>;
|
|
12
12
|
entryPoint: {
|
|
13
13
|
address: Address;
|
|
@@ -16,7 +16,7 @@ export type PimlicoSponsorUserOperationParameters<entryPointVersion extends "0.6
|
|
|
16
16
|
sponsorshipPolicyId?: string;
|
|
17
17
|
paymasterContext?: PaymasterContext | unknown;
|
|
18
18
|
};
|
|
19
|
-
export type SponsorUserOperationReturnType<entryPointVersion extends
|
|
19
|
+
export type SponsorUserOperationReturnType<entryPointVersion extends EntryPointVersion = "0.7"> = OneOf<(entryPointVersion extends "0.6" ? {
|
|
20
20
|
callGasLimit: bigint;
|
|
21
21
|
verificationGasLimit: bigint;
|
|
22
22
|
preVerificationGas: bigint;
|
|
@@ -30,6 +30,6 @@ export type SponsorUserOperationReturnType<entryPointVersion extends "0.6" | "0.
|
|
|
30
30
|
paymasterPostOpGasLimit: bigint;
|
|
31
31
|
paymasterData: Hex;
|
|
32
32
|
} : never)>;
|
|
33
|
-
export declare const sponsorUserOperation: <entryPointVersion extends
|
|
33
|
+
export declare const sponsorUserOperation: <entryPointVersion extends EntryPointVersion = EntryPointVersion>(client: Client<Transport, Chain | undefined, Account | undefined, PimlicoRpcSchema<entryPointVersion>>, args: PimlicoSponsorUserOperationParameters<entryPointVersion>) => Promise<SponsorUserOperationReturnType<entryPointVersion>>;
|
|
34
34
|
export {};
|
|
35
35
|
//# 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,EACR,OAAO,EACP,OAAO,EACP,KAAK,EACL,MAAM,EACN,GAAG,EACH,KAAK,EACL,SAAS,EACT,SAAS,EACZ,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"sponsorUserOperation.d.ts","sourceRoot":"","sources":["../../../actions/pimlico/sponsorUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EACP,OAAO,EACP,KAAK,EACL,MAAM,EACN,GAAG,EACH,KAAK,EACL,SAAS,EACT,SAAS,EACZ,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAG9D,KAAK,gBAAgB,GAAG;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,qCAAqC,CAC7C,iBAAiB,SAAS,iBAAiB,IAC3C;IACA,aAAa,EAAE,KAAK,CACd,CAAC,iBAAiB,SAAS,KAAK,GAC1B,SAAS,CACL,aAAa,CAAC,KAAK,CAAC,EAClB,cAAc,GACd,oBAAoB,GACpB,sBAAsB,CAC3B,GACD,KAAK,CAAC,GACZ,CAAC,iBAAiB,SAAS,KAAK,GAC1B,SAAS,CACL,aAAa,CAAC,KAAK,CAAC,EAClB,cAAc,GACd,oBAAoB,GACpB,sBAAsB,GACtB,+BAA+B,GAC/B,yBAAyB,CAC9B,GACD,KAAK,CAAC,CACjB,CAAA;IACD,UAAU,EAAE;QACR,OAAO,EAAE,OAAO,CAAA;QAChB,OAAO,EAAE,iBAAiB,CAAA;KAC7B,CAAA;IACD,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAA;CAChD,CAAA;AAED,MAAM,MAAM,8BAA8B,CACtC,iBAAiB,SAAS,iBAAiB,GAAG,KAAK,IACnD,KAAK,CACH,CAAC,iBAAiB,SAAS,KAAK,GAC1B;IACI,YAAY,EAAE,MAAM,CAAA;IACpB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,gBAAgB,EAAE,GAAG,CAAA;CACxB,GACD,KAAK,CAAC,GACZ,CAAC,iBAAiB,SAAS,KAAK,GAC1B;IACI,YAAY,EAAE,MAAM,CAAA;IACpB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,SAAS,EAAE,OAAO,CAAA;IAClB,6BAA6B,EAAE,MAAM,CAAA;IACrC,uBAAuB,EAAE,MAAM,CAAA;IAC/B,aAAa,EAAE,GAAG,CAAA;CACrB,GACD,KAAK,CAAC,CACjB,CAAA;AAED,eAAO,MAAM,oBAAoB,GAC7B,iBAAiB,SAAS,iBAAiB,GAAG,iBAAiB,EAE/D,QAAQ,MAAM,CACV,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,SAAS,EACnB,gBAAgB,CAAC,iBAAiB,CAAC,CACtC,EACD,MAAM,qCAAqC,CAAC,iBAAiB,CAAC,KAC/D,OAAO,CAAC,8BAA8B,CAAC,iBAAiB,CAAC,CAgE3D,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Address, Chain, Client, Hash, Prettify, Transport } from "viem";
|
|
2
|
+
import type { EntryPointVersion } from "viem/account-abstraction";
|
|
2
3
|
import { type GetTokenQuotesParameters, type GetTokenQuotesReturnType, type SendCompressedUserOperationParameters, type ValidateSponsorshipPolicies, type ValidateSponsorshipPoliciesParameters } from "../../actions/pimlico.js";
|
|
3
4
|
import { type GetUserOperationGasPriceReturnType } from "../../actions/pimlico/getUserOperationGasPrice.js";
|
|
4
5
|
import { type GetUserOperationStatusParameters, type GetUserOperationStatusReturnType } from "../../actions/pimlico/getUserOperationStatus.js";
|
|
5
6
|
import { type PimlicoSponsorUserOperationParameters, type SponsorUserOperationReturnType } from "../../actions/pimlico/sponsorUserOperation.js";
|
|
6
|
-
export type PimlicoActions<TChain extends Chain | undefined, entryPointVersion extends
|
|
7
|
+
export type PimlicoActions<TChain extends Chain | undefined, entryPointVersion extends EntryPointVersion = EntryPointVersion> = {
|
|
7
8
|
/**
|
|
8
9
|
* Returns the live gas prices that you can use to send a user operation.
|
|
9
10
|
*
|
|
@@ -74,7 +75,7 @@ export type PimlicoActions<TChain extends Chain | undefined, entryPointVersion e
|
|
|
74
75
|
validateSponsorshipPolicies: (args: Prettify<Omit<ValidateSponsorshipPoliciesParameters, "entryPointAddress">>) => Promise<Prettify<ValidateSponsorshipPolicies>[]>;
|
|
75
76
|
getTokenQuotes: <TChainOverride extends Chain | undefined = Chain | undefined>(args: Prettify<Omit<GetTokenQuotesParameters<TChain, TChainOverride>, "entryPointAddress">>) => Promise<Prettify<GetTokenQuotesReturnType>>;
|
|
76
77
|
};
|
|
77
|
-
export declare const pimlicoActions: <entryPointVersion extends
|
|
78
|
+
export declare const pimlicoActions: <entryPointVersion extends EntryPointVersion>({ entryPoint }: {
|
|
78
79
|
entryPoint: {
|
|
79
80
|
address: Address;
|
|
80
81
|
version: entryPointVersion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAC7E,OAAO,EACH,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,qCAAqC,EAC1C,KAAK,2BAA2B,EAChC,KAAK,qCAAqC,EAI7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 @@
|
|
|
1
1
|
import type { Address, BundlerRpcSchema, Chain, Client, ClientConfig, Prettify, RpcSchema, Transport } from "viem";
|
|
2
|
-
import { type BundlerActions, type PaymasterActions, type SmartAccount } from "viem/account-abstraction";
|
|
2
|
+
import { type BundlerActions, type EntryPointVersion, type PaymasterActions, type SmartAccount } from "viem/account-abstraction";
|
|
3
3
|
import type { PimlicoRpcSchema } from "../types/pimlico.js";
|
|
4
4
|
import { type PimlicoActions } from "./decorators/pimlico.js";
|
|
5
|
-
export type PimlicoClient<entryPointVersion extends
|
|
6
|
-
export type PimlicoClientConfig<entryPointVersion extends
|
|
5
|
+
export type PimlicoClient<entryPointVersion extends EntryPointVersion = EntryPointVersion, transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartAccount | undefined = SmartAccount | undefined, client extends Client | undefined = Client | undefined, rpcSchema extends RpcSchema | undefined = undefined> = Prettify<Client<transport, chain extends Chain ? chain : client extends Client<any, infer chain> ? chain : undefined, account, rpcSchema extends RpcSchema ? [...BundlerRpcSchema, ...PimlicoRpcSchema, ...rpcSchema] : [...BundlerRpcSchema, ...PimlicoRpcSchema], BundlerActions<account> & PaymasterActions & PimlicoActions<chain, entryPointVersion>>>;
|
|
6
|
+
export type PimlicoClientConfig<entryPointVersion extends EntryPointVersion = EntryPointVersion, transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartAccount | undefined = SmartAccount | undefined, rpcSchema extends RpcSchema | undefined = undefined> = Prettify<Pick<ClientConfig<transport, chain, account, rpcSchema>, "account" | "cacheTime" | "chain" | "key" | "name" | "pollingInterval" | "rpcSchema" | "transport">> & {
|
|
7
7
|
entryPoint?: {
|
|
8
8
|
address: Address;
|
|
9
9
|
version: entryPointVersion;
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
|
-
export declare function createPimlicoClient<entryPointVersion extends
|
|
12
|
+
export declare function createPimlicoClient<entryPointVersion extends EntryPointVersion = "0.7", transport extends Transport = Transport, chain extends Chain | undefined = undefined, account extends SmartAccount | undefined = SmartAccount | undefined, client extends Client | undefined = undefined, rpcSchema extends RpcSchema | undefined = undefined>(parameters: PimlicoClientConfig<entryPointVersion, transport, chain, account, rpcSchema>): PimlicoClient<entryPointVersion, transport, chain, account, client, rpcSchema>;
|
|
13
13
|
//# sourceMappingURL=pimlico.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../clients/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EACP,gBAAgB,EAChB,KAAK,EACL,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,SAAS,EACZ,MAAM,MAAM,CAAA;AAEb,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAIpB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,yBAAyB,CAAA;AAE7E,MAAM,MAAM,aAAa,CACrB,iBAAiB,SAAS,
|
|
1
|
+
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../clients/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EACP,gBAAgB,EAChB,KAAK,EACL,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,SAAS,EACZ,MAAM,MAAM,CAAA;AAEb,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAIpB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,yBAAyB,CAAA;AAE7E,MAAM,MAAM,aAAa,CACrB,iBAAiB,SAAS,iBAAiB,GAAG,iBAAiB,EAC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,CAAA;KAC7B,CAAA;CACJ,CAAA;AAED,wBAAgB,mBAAmB,CAC/B,iBAAiB,SAAS,iBAAiB,GAAG,KAAK,EACnD,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,SAAS,EAC3C,OAAO,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,EACnE,MAAM,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EAC7C,SAAS,SAAS,SAAS,GAAG,SAAS,GAAG,SAAS,EAEnD,UAAU,EAAE,mBAAmB,CAC3B,iBAAiB,EACjB,SAAS,EACT,KAAK,EACL,OAAO,EACP,SAAS,CACZ,GACF,aAAa,CACZ,iBAAiB,EACjB,SAAS,EACT,KAAK,EACL,OAAO,EACP,MAAM,EACN,SAAS,CACZ,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Address, Hash, Hex, OneOf, PartialBy } from "viem";
|
|
2
|
-
import type { UserOperation } from "viem/account-abstraction";
|
|
2
|
+
import type { EntryPointVersion, UserOperation } from "viem/account-abstraction";
|
|
3
3
|
type PimlicoUserOperationGasPriceWithBigIntAsHex = {
|
|
4
4
|
slow: {
|
|
5
5
|
maxFeePerGas: Hex;
|
|
@@ -29,7 +29,7 @@ type GetTokenQuotesWithBigIntAsHex = {
|
|
|
29
29
|
allowanceSlot?: Hex;
|
|
30
30
|
}[];
|
|
31
31
|
};
|
|
32
|
-
export type PimlicoRpcSchema<entryPointVersion extends
|
|
32
|
+
export type PimlicoRpcSchema<entryPointVersion extends EntryPointVersion = EntryPointVersion> = [
|
|
33
33
|
{
|
|
34
34
|
Method: "pimlico_getUserOperationGasPrice";
|
|
35
35
|
Parameters: [];
|
|
@@ -52,7 +52,7 @@ export type PimlicoRpcSchema<entryPointVersion extends "0.6" | "0.7" = "0.6" | "
|
|
|
52
52
|
{
|
|
53
53
|
Method: "pm_sponsorUserOperation";
|
|
54
54
|
Parameters: [
|
|
55
|
-
userOperation: OneOf<(entryPointVersion extends "0.6" ? PartialBy<UserOperation<"0.6", Hex>, "callGasLimit" | "preVerificationGas" | "verificationGasLimit"> : never) | (entryPointVersion extends "0.7" ? PartialBy<UserOperation<"0.7", Hex>, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit"> : never)>,
|
|
55
|
+
userOperation: OneOf<(entryPointVersion extends "0.6" ? PartialBy<UserOperation<"0.6", Hex>, "callGasLimit" | "preVerificationGas" | "verificationGasLimit"> : never) | (entryPointVersion extends "0.7" ? PartialBy<UserOperation<"0.7", Hex>, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit"> : never) | (entryPointVersion extends "0.8" ? PartialBy<UserOperation<"0.7", Hex>, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit"> : never)>,
|
|
56
56
|
entryPoint: Address,
|
|
57
57
|
metadata?: {
|
|
58
58
|
sponsorshipPolicyId?: string;
|
|
@@ -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,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../types/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAEhF,KAAK,2CAA2C,GAAG;IAC/C,IA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AC5B,aAAa,EAAE,GAAG,CAAA;YAClB,gBAAgB,CAAC,EAAE,KAAK,CAAA;SAC3B,CAAA;KACV;IACD;QACI,MAAM,EAAE,gCAAgC,CAAA;QACxC,UAAU,EAAE;YACR,aAAa,EAAE,aAAa,CAAC,iBAAiB,EAAE,GAAG,CAAC;YACpD,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;IACD;QACI,MAAM,EAAE,wBAAwB,CAAA;QAChC,UAAU,EAAE;YACR,MAAM,EAAE;gBAAE,MAAM,EAAE,OAAO,EAAE,CAAA;aAAE;YAC7B,UAAU,EAAE,OAAO;YACnB,OAAO,EAAE,GAAG;SACf,CAAA;QACD,UAAU,EAAE,6BAA6B,CAAA;KAC5C;CACJ,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Address, type Hex } from "viem";
|
|
2
|
-
import { type UserOperation } from "viem/account-abstraction";
|
|
3
|
-
export type GetPimlicoEstimationCallDataParams<entryPointVersion extends
|
|
2
|
+
import { type EntryPointVersion, type UserOperation } from "viem/account-abstraction";
|
|
3
|
+
export type GetPimlicoEstimationCallDataParams<entryPointVersion extends EntryPointVersion> = {
|
|
4
4
|
userOperation: UserOperation<entryPointVersion>;
|
|
5
5
|
entrypoint: {
|
|
6
6
|
address: Address;
|
|
@@ -11,7 +11,7 @@ export type GetPimlicoEstimationCallDataParams<entryPointVersion extends "0.6" |
|
|
|
11
11
|
} : {
|
|
12
12
|
estimationAddress?: Address;
|
|
13
13
|
});
|
|
14
|
-
export declare function getPimlicoEstimationCallData<entryPointVersion extends
|
|
14
|
+
export declare function getPimlicoEstimationCallData<entryPointVersion extends EntryPointVersion>(args: GetPimlicoEstimationCallDataParams<entryPointVersion>): {
|
|
15
15
|
to: Address;
|
|
16
16
|
data: Hex;
|
|
17
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEstimationCallData.d.ts","sourceRoot":"","sources":["../../utils/getEstimationCallData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAsB,MAAM,MAAM,CAAA;AACjE,OAAO,EACH,KAAK,aAAa,EAGrB,MAAM,0BAA0B,CAAA;AA4NjC,MAAM,MAAM,kCAAkC,CAC1C,iBAAiB,SAAS,
|
|
1
|
+
{"version":3,"file":"getEstimationCallData.d.ts","sourceRoot":"","sources":["../../utils/getEstimationCallData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAsB,MAAM,MAAM,CAAA;AACjE,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAGrB,MAAM,0BAA0B,CAAA;AA4NjC,MAAM,MAAM,kCAAkC,CAC1C,iBAAiB,SAAS,iBAAiB,IAC3C;IACA,aAAa,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAA;IAC/C,UAAU,EAAE;QACR,OAAO,EAAE,OAAO,CAAA;QAChB,OAAO,EAAE,iBAAiB,CAAA;KAC7B,CAAA;CACJ,GAAG,CAAC,iBAAiB,SAAS,KAAK,GAC9B;IACI,iBAAiB,EAAE,KAAK,CAAA;CAC3B,GACD;IAAE,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAAA;AAoBtC,wBAAgB,4BAA4B,CACxC,iBAAiB,SAAS,iBAAiB,EAE3C,IAAI,EAAE,kCAAkC,CAAC,iBAAiB,CAAC,GAC5D;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE,CAkC5B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UserOperation } from "viem/account-abstraction";
|
|
2
|
-
export type GetRequiredPrefundReturnType<entryPointVersion extends
|
|
1
|
+
import type { EntryPointVersion, UserOperation } from "viem/account-abstraction";
|
|
2
|
+
export type GetRequiredPrefundReturnType<entryPointVersion extends EntryPointVersion = "0.7"> = {
|
|
3
3
|
userOperation: UserOperation<entryPointVersion>;
|
|
4
4
|
entryPointVersion: entryPointVersion;
|
|
5
5
|
};
|
|
@@ -17,5 +17,5 @@ export type GetRequiredPrefundReturnType<entryPointVersion extends "0.6" | "0.7"
|
|
|
17
17
|
* userOperation
|
|
18
18
|
* })
|
|
19
19
|
*/
|
|
20
|
-
export declare const getRequiredPrefund: <entryPointVersion extends
|
|
20
|
+
export declare const getRequiredPrefund: <entryPointVersion extends EntryPointVersion>({ userOperation, entryPointVersion }: GetRequiredPrefundReturnType<entryPointVersion>) => bigint;
|
|
21
21
|
//# sourceMappingURL=getRequiredPrefund.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRequiredPrefund.d.ts","sourceRoot":"","sources":["../../utils/getRequiredPrefund.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"getRequiredPrefund.d.ts","sourceRoot":"","sources":["../../utils/getRequiredPrefund.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAEhF,MAAM,MAAM,4BAA4B,CACpC,iBAAiB,SAAS,iBAAiB,GAAG,KAAK,IACnD;IACA,aAAa,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAA;IAC/C,iBAAiB,EAAE,iBAAiB,CAAA;CACvC,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,GAC3B,iBAAiB,SAAS,iBAAiB,EAC7C,sCAGC,4BAA4B,CAAC,iBAAiB,CAAC,KAAG,MA2BpD,CAAA"}
|
|
@@ -2,6 +2,7 @@ import type {
|
|
|
2
2
|
Account,
|
|
3
3
|
Assign,
|
|
4
4
|
Chain,
|
|
5
|
+
JsonRpcAccount,
|
|
5
6
|
OneOf,
|
|
6
7
|
Prettify,
|
|
7
8
|
Transport,
|
|
@@ -92,7 +93,11 @@ const getAccountInitCode = async ({
|
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
export type ToBiconomySmartAccountParameters = Prettify<{
|
|
95
|
-
client: Client
|
|
96
|
+
client: Client<
|
|
97
|
+
Transport,
|
|
98
|
+
Chain | undefined,
|
|
99
|
+
JsonRpcAccount | LocalAccount | undefined
|
|
100
|
+
>
|
|
96
101
|
owners: [
|
|
97
102
|
OneOf<
|
|
98
103
|
| EthereumProvider
|
|
@@ -336,5 +336,166 @@ describe.each(getCoreSmartAccounts())(
|
|
|
336
336
|
throw e
|
|
337
337
|
}
|
|
338
338
|
})
|
|
339
|
+
|
|
340
|
+
testWithRpc(
|
|
341
|
+
"decodeCalls v0.8 single call with no data",
|
|
342
|
+
async ({ rpc }) => {
|
|
343
|
+
try {
|
|
344
|
+
const smartClient = await getSmartAccountClient({
|
|
345
|
+
entryPoint: {
|
|
346
|
+
version: "0.8"
|
|
347
|
+
},
|
|
348
|
+
...rpc
|
|
349
|
+
})
|
|
350
|
+
|
|
351
|
+
const callData = await smartClient.account.encodeCalls([
|
|
352
|
+
{
|
|
353
|
+
to: zeroAddress,
|
|
354
|
+
data: "0x",
|
|
355
|
+
value: 0n
|
|
356
|
+
}
|
|
357
|
+
])
|
|
358
|
+
|
|
359
|
+
if (!smartClient.account.decodeCalls) {
|
|
360
|
+
throw new Error("decodeCalls is not supported")
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
const decoded =
|
|
364
|
+
await smartClient.account.decodeCalls(callData)
|
|
365
|
+
|
|
366
|
+
expect(decoded).toEqual([
|
|
367
|
+
{ to: zeroAddress, data: "0x", value: 0n }
|
|
368
|
+
])
|
|
369
|
+
} catch (e) {
|
|
370
|
+
if (
|
|
371
|
+
e instanceof Error &&
|
|
372
|
+
e.message === "Kernel ERC7579 is not supported for V06"
|
|
373
|
+
) {
|
|
374
|
+
return // Expected error for ERC7579 accounts with v0.6
|
|
375
|
+
}
|
|
376
|
+
throw e
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
testWithRpc(
|
|
382
|
+
"decodeCalls v0.8 single call with data",
|
|
383
|
+
async ({ rpc }) => {
|
|
384
|
+
try {
|
|
385
|
+
const smartClient = await getSmartAccountClient({
|
|
386
|
+
entryPoint: {
|
|
387
|
+
version: "0.8"
|
|
388
|
+
},
|
|
389
|
+
...rpc
|
|
390
|
+
})
|
|
391
|
+
|
|
392
|
+
const erc20TransactionData = encodeFunctionData({
|
|
393
|
+
abi: erc20Abi,
|
|
394
|
+
functionName: "transfer",
|
|
395
|
+
args: [zeroAddress, 1000000000000000000n]
|
|
396
|
+
})
|
|
397
|
+
|
|
398
|
+
const callData = await smartClient.account.encodeCalls([
|
|
399
|
+
{
|
|
400
|
+
to: zeroAddress,
|
|
401
|
+
data: erc20TransactionData,
|
|
402
|
+
value: 0n
|
|
403
|
+
}
|
|
404
|
+
])
|
|
405
|
+
|
|
406
|
+
if (!smartClient.account.decodeCalls) {
|
|
407
|
+
throw new Error("decodeCalls is not supported")
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
const decoded =
|
|
411
|
+
await smartClient.account.decodeCalls(callData)
|
|
412
|
+
|
|
413
|
+
expect(decoded).toEqual([
|
|
414
|
+
{
|
|
415
|
+
to: zeroAddress,
|
|
416
|
+
data: erc20TransactionData,
|
|
417
|
+
value: 0n
|
|
418
|
+
}
|
|
419
|
+
])
|
|
420
|
+
|
|
421
|
+
const decodeErc20TransactionData = decodeFunctionData({
|
|
422
|
+
abi: erc20Abi,
|
|
423
|
+
data: erc20TransactionData
|
|
424
|
+
})
|
|
425
|
+
|
|
426
|
+
expect(decodeErc20TransactionData.args).toEqual([
|
|
427
|
+
zeroAddress,
|
|
428
|
+
1000000000000000000n
|
|
429
|
+
])
|
|
430
|
+
} catch (e) {
|
|
431
|
+
if (
|
|
432
|
+
e instanceof Error &&
|
|
433
|
+
e.message === "Kernel ERC7579 is not supported for V06"
|
|
434
|
+
) {
|
|
435
|
+
return // Expected error for ERC7579 accounts with v0.6
|
|
436
|
+
}
|
|
437
|
+
throw e
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
)
|
|
441
|
+
|
|
442
|
+
testWithRpc("decodeCalls v0.8 multiple calls", async ({ rpc }) => {
|
|
443
|
+
try {
|
|
444
|
+
const smartClient = await getSmartAccountClient({
|
|
445
|
+
entryPoint: {
|
|
446
|
+
version: "0.8"
|
|
447
|
+
},
|
|
448
|
+
...rpc
|
|
449
|
+
})
|
|
450
|
+
|
|
451
|
+
const erc20TransactionData = encodeFunctionData({
|
|
452
|
+
abi: erc20Abi,
|
|
453
|
+
functionName: "transfer",
|
|
454
|
+
args: [zeroAddress, 1000000000000000000n]
|
|
455
|
+
})
|
|
456
|
+
|
|
457
|
+
const callData = await smartClient.account.encodeCalls([
|
|
458
|
+
{
|
|
459
|
+
to: zeroAddress,
|
|
460
|
+
data: "0x",
|
|
461
|
+
value: 0n
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
to: zeroAddress,
|
|
465
|
+
data: erc20TransactionData,
|
|
466
|
+
value: 10n
|
|
467
|
+
}
|
|
468
|
+
])
|
|
469
|
+
|
|
470
|
+
if (!smartClient.account.decodeCalls) {
|
|
471
|
+
throw new Error("decodeCalls is not supported")
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
const decoded = await smartClient.account.decodeCalls(callData)
|
|
475
|
+
|
|
476
|
+
expect(decoded).toEqual([
|
|
477
|
+
{ to: zeroAddress, data: "0x", value: 0n },
|
|
478
|
+
{ to: zeroAddress, data: erc20TransactionData, value: 10n }
|
|
479
|
+
])
|
|
480
|
+
|
|
481
|
+
const decodeErc20TransactionData = decodeFunctionData({
|
|
482
|
+
abi: erc20Abi,
|
|
483
|
+
data: erc20TransactionData
|
|
484
|
+
})
|
|
485
|
+
|
|
486
|
+
expect(decodeErc20TransactionData.args).toEqual([
|
|
487
|
+
zeroAddress,
|
|
488
|
+
1000000000000000000n
|
|
489
|
+
])
|
|
490
|
+
} catch (e) {
|
|
491
|
+
if (
|
|
492
|
+
e instanceof Error &&
|
|
493
|
+
e.message === "Kernel ERC7579 is not supported for V06"
|
|
494
|
+
) {
|
|
495
|
+
return // Expected error for ERC7579 accounts with v0.6
|
|
496
|
+
}
|
|
497
|
+
throw e
|
|
498
|
+
}
|
|
499
|
+
})
|
|
339
500
|
}
|
|
340
501
|
)
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
type Client,
|
|
7
7
|
type EIP1193Provider,
|
|
8
8
|
type Hex,
|
|
9
|
+
type JsonRpcAccount,
|
|
9
10
|
type LocalAccount,
|
|
10
11
|
type OneOf,
|
|
11
12
|
type Transport,
|
|
@@ -160,7 +161,11 @@ const getAccountInitCode = async ({
|
|
|
160
161
|
export type ToEtherspotSmartAccountParameters<
|
|
161
162
|
entryPointVersion extends "0.6" | "0.7"
|
|
162
163
|
> = {
|
|
163
|
-
client: Client
|
|
164
|
+
client: Client<
|
|
165
|
+
Transport,
|
|
166
|
+
Chain | undefined,
|
|
167
|
+
JsonRpcAccount | LocalAccount | undefined
|
|
168
|
+
>
|
|
164
169
|
owners: [
|
|
165
170
|
OneOf<
|
|
166
171
|
| EIP1193Provider
|
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
Account,
|
|
4
4
|
Assign,
|
|
5
5
|
Chain,
|
|
6
|
+
JsonRpcAccount,
|
|
6
7
|
OneOf,
|
|
7
8
|
Transport,
|
|
8
9
|
WalletClient
|
|
@@ -383,7 +384,11 @@ export type ToKernelSmartAccountParameters<
|
|
|
383
384
|
| WebAuthnAccount
|
|
384
385
|
>
|
|
385
386
|
> = {
|
|
386
|
-
client: Client
|
|
387
|
+
client: Client<
|
|
388
|
+
Transport,
|
|
389
|
+
Chain | undefined,
|
|
390
|
+
JsonRpcAccount | LocalAccount | undefined
|
|
391
|
+
>
|
|
387
392
|
owners: [owner]
|
|
388
393
|
entryPoint?: {
|
|
389
394
|
address: Address
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
type Chain,
|
|
6
6
|
type Client,
|
|
7
7
|
type Hex,
|
|
8
|
+
type JsonRpcAccount,
|
|
8
9
|
type LocalAccount,
|
|
9
10
|
type OneOf,
|
|
10
11
|
type Transport,
|
|
@@ -75,7 +76,11 @@ export type LightAccountVersion<entryPointVersion extends "0.6" | "0.7"> =
|
|
|
75
76
|
export type ToLightSmartAccountParameters<
|
|
76
77
|
entryPointVersion extends "0.6" | "0.7" = "0.7"
|
|
77
78
|
> = {
|
|
78
|
-
client: Client
|
|
79
|
+
client: Client<
|
|
80
|
+
Transport,
|
|
81
|
+
Chain | undefined,
|
|
82
|
+
JsonRpcAccount | LocalAccount | undefined
|
|
83
|
+
>
|
|
79
84
|
entryPoint?: {
|
|
80
85
|
address: Address
|
|
81
86
|
version: entryPointVersion
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
type Address,
|
|
13
13
|
type Client,
|
|
14
14
|
type Hex,
|
|
15
|
+
type JsonRpcAccount,
|
|
15
16
|
type LocalAccount,
|
|
16
17
|
concat,
|
|
17
18
|
concatHex,
|
|
@@ -90,7 +91,11 @@ const BICONOMY_ADDRESSES: {
|
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
export type ToNexusSmartAccountParameters = Prettify<{
|
|
93
|
-
client: Client
|
|
94
|
+
client: Client<
|
|
95
|
+
Transport,
|
|
96
|
+
Chain | undefined,
|
|
97
|
+
JsonRpcAccount | LocalAccount | undefined
|
|
98
|
+
>
|
|
94
99
|
owners: [
|
|
95
100
|
OneOf<
|
|
96
101
|
| EthereumProvider
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
type Chain,
|
|
6
6
|
type Client,
|
|
7
7
|
type Hex,
|
|
8
|
+
type JsonRpcAccount,
|
|
8
9
|
type LocalAccount,
|
|
9
10
|
type OneOf,
|
|
10
11
|
type SignableMessage,
|
|
@@ -954,7 +955,11 @@ export type ToSafeSmartAccountParameters<
|
|
|
954
955
|
entryPointVersion extends "0.6" | "0.7",
|
|
955
956
|
TErc7579 extends Address | undefined
|
|
956
957
|
> = {
|
|
957
|
-
client: Client
|
|
958
|
+
client: Client<
|
|
959
|
+
Transport,
|
|
960
|
+
Chain | undefined,
|
|
961
|
+
JsonRpcAccount | LocalAccount | undefined
|
|
962
|
+
>
|
|
958
963
|
owners: (
|
|
959
964
|
| Account
|
|
960
965
|
| WalletClient<Transport, Chain | undefined, Account>
|