permissionless 0.3.6 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/_cjs/accounts/biconomy/toBiconomySmartAccount.js +9 -5
- package/_cjs/accounts/biconomy/toBiconomySmartAccount.js.map +1 -1
- package/_cjs/accounts/kernel/toKernelSmartAccount.js +4 -0
- package/_cjs/accounts/kernel/toKernelSmartAccount.js.map +1 -1
- package/_cjs/accounts/light/toLightSmartAccount.js +9 -5
- package/_cjs/accounts/light/toLightSmartAccount.js.map +1 -1
- package/_cjs/accounts/nexus/toNexusSmartAccount.js +3 -2
- package/_cjs/accounts/nexus/toNexusSmartAccount.js.map +1 -1
- package/_cjs/accounts/safe/signUserOperation.js +14 -1
- package/_cjs/accounts/safe/signUserOperation.js.map +1 -1
- package/_cjs/accounts/safe/toSafeSmartAccount.js +6 -4
- package/_cjs/accounts/safe/toSafeSmartAccount.js.map +1 -1
- package/_cjs/accounts/simple/toSimpleSmartAccount.js +15 -10
- package/_cjs/accounts/simple/toSimpleSmartAccount.js.map +1 -1
- package/_cjs/accounts/thirdweb/utils/decodeCallData.js +7 -5
- package/_cjs/accounts/thirdweb/utils/decodeCallData.js.map +1 -1
- package/_cjs/accounts/trust/utils/decodeCallData.js +7 -5
- package/_cjs/accounts/trust/utils/decodeCallData.js.map +1 -1
- package/_cjs/actions/{erc7579.js → erc7579/index.js} +9 -9
- package/_cjs/actions/erc7579/index.js.map +1 -0
- package/_cjs/actions/{etherspot.js → etherspot/index.js} +2 -2
- package/_cjs/actions/etherspot/index.js.map +1 -0
- package/_cjs/actions/{passkeyServer.js → passkeyServer/index.js} +4 -4
- package/_cjs/actions/passkeyServer/index.js.map +1 -0
- package/_cjs/actions/pimlico/estimateErc20PaymasterCost.js +7 -3
- package/_cjs/actions/pimlico/estimateErc20PaymasterCost.js.map +1 -1
- package/_cjs/actions/{pimlico.js → pimlico/index.js} +8 -8
- package/_cjs/actions/pimlico/index.js.map +1 -0
- package/_cjs/actions/{smartAccount.js → smartAccount/index.js} +5 -5
- package/_cjs/actions/smartAccount/index.js.map +1 -0
- package/_cjs/clients/createSmartAccountClient.js.map +1 -1
- package/_cjs/clients/decorators/pimlico.js +4 -4
- package/_cjs/clients/decorators/pimlico.js.map +1 -1
- package/_cjs/clients/{passkeyServer.js → passkeyServer/index.js} +2 -2
- package/_cjs/clients/passkeyServer/index.js.map +1 -0
- package/_cjs/clients/{pimlico.js → pimlico/index.js} +2 -2
- package/_cjs/clients/pimlico/index.js.map +1 -0
- package/_cjs/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js +6 -5
- package/_cjs/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js.map +1 -1
- package/_cjs/utils/index.js +3 -1
- package/_cjs/utils/index.js.map +1 -1
- package/_cjs/utils/sortAddresses.js +16 -0
- package/_cjs/utils/sortAddresses.js.map +1 -0
- package/_esm/accounts/biconomy/toBiconomySmartAccount.js +9 -5
- package/_esm/accounts/biconomy/toBiconomySmartAccount.js.map +1 -1
- package/_esm/accounts/kernel/toKernelSmartAccount.js +4 -0
- package/_esm/accounts/kernel/toKernelSmartAccount.js.map +1 -1
- package/_esm/accounts/light/toLightSmartAccount.js +9 -5
- package/_esm/accounts/light/toLightSmartAccount.js.map +1 -1
- package/_esm/accounts/nexus/toNexusSmartAccount.js +3 -2
- package/_esm/accounts/nexus/toNexusSmartAccount.js.map +1 -1
- package/_esm/accounts/safe/signUserOperation.js +14 -1
- package/_esm/accounts/safe/signUserOperation.js.map +1 -1
- package/_esm/accounts/safe/toSafeSmartAccount.js +6 -4
- package/_esm/accounts/safe/toSafeSmartAccount.js.map +1 -1
- package/_esm/accounts/simple/toSimpleSmartAccount.js +15 -10
- package/_esm/accounts/simple/toSimpleSmartAccount.js.map +1 -1
- package/_esm/accounts/thirdweb/utils/decodeCallData.js +7 -5
- package/_esm/accounts/thirdweb/utils/decodeCallData.js.map +1 -1
- package/_esm/accounts/trust/utils/decodeCallData.js +7 -5
- package/_esm/accounts/trust/utils/decodeCallData.js.map +1 -1
- package/_esm/actions/{erc7579.js → erc7579/index.js} +9 -9
- package/_esm/actions/erc7579/index.js.map +1 -0
- package/_esm/actions/etherspot/index.js +2 -0
- package/_esm/actions/etherspot/index.js.map +1 -0
- package/_esm/actions/passkeyServer/index.js +4 -0
- package/_esm/actions/passkeyServer/index.js.map +1 -0
- package/_esm/actions/pimlico/estimateErc20PaymasterCost.js +7 -3
- package/_esm/actions/pimlico/estimateErc20PaymasterCost.js.map +1 -1
- package/_esm/actions/pimlico/index.js +8 -0
- package/_esm/actions/pimlico/index.js.map +1 -0
- package/_esm/actions/smartAccount/index.js +5 -0
- package/_esm/actions/smartAccount/index.js.map +1 -0
- package/_esm/clients/createSmartAccountClient.js.map +1 -1
- package/_esm/clients/decorators/pimlico.js +1 -1
- package/_esm/clients/decorators/pimlico.js.map +1 -1
- package/_esm/clients/{passkeyServer.js → passkeyServer/index.js} +2 -2
- package/_esm/clients/passkeyServer/index.js.map +1 -0
- package/_esm/clients/{pimlico.js → pimlico/index.js} +2 -2
- package/_esm/clients/pimlico/index.js.map +1 -0
- package/_esm/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js +5 -4
- package/_esm/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js.map +1 -1
- package/_esm/utils/index.js +1 -0
- package/_esm/utils/index.js.map +1 -1
- package/_esm/utils/sortAddresses.js +19 -0
- package/_esm/utils/sortAddresses.js.map +1 -0
- package/_types/accounts/biconomy/toBiconomySmartAccount.d.ts.map +1 -1
- package/_types/accounts/kernel/toKernelSmartAccount.d.ts.map +1 -1
- package/_types/accounts/light/toLightSmartAccount.d.ts.map +1 -1
- package/_types/accounts/nexus/toNexusSmartAccount.d.ts.map +1 -1
- package/_types/accounts/safe/signUserOperation.d.ts.map +1 -1
- package/_types/accounts/safe/toSafeSmartAccount.d.ts.map +1 -1
- package/_types/accounts/simple/toSimpleSmartAccount.d.ts.map +1 -1
- package/_types/accounts/thirdweb/utils/decodeCallData.d.ts.map +1 -1
- package/_types/accounts/trust/utils/decodeCallData.d.ts.map +1 -1
- package/_types/actions/{erc7579.d.ts → erc7579/index.d.ts} +11 -11
- package/_types/actions/erc7579/index.d.ts.map +1 -0
- package/_types/actions/etherspot/index.d.ts +2 -0
- package/_types/actions/etherspot/index.d.ts.map +1 -0
- package/_types/actions/passkeyServer/index.d.ts +4 -0
- package/_types/actions/passkeyServer/index.d.ts.map +1 -0
- package/_types/actions/pimlico/estimateErc20PaymasterCost.d.ts.map +1 -1
- package/_types/actions/pimlico/index.d.ts +8 -0
- package/_types/actions/pimlico/index.d.ts.map +1 -0
- package/_types/actions/smartAccount/index.d.ts +5 -0
- package/_types/actions/smartAccount/index.d.ts.map +1 -0
- package/_types/clients/createSmartAccountClient.d.ts +9 -1
- package/_types/clients/createSmartAccountClient.d.ts.map +1 -1
- package/_types/clients/decorators/pimlico.d.ts +1 -1
- package/_types/clients/decorators/pimlico.d.ts.map +1 -1
- package/_types/clients/{passkeyServer.d.ts → passkeyServer/index.d.ts} +8 -4
- package/_types/clients/passkeyServer/index.d.ts.map +1 -0
- package/_types/clients/pimlico/index.d.ts +21 -0
- package/_types/clients/pimlico/index.d.ts.map +1 -0
- package/_types/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.d.ts.map +1 -1
- package/_types/utils/index.d.ts +1 -0
- package/_types/utils/index.d.ts.map +1 -1
- package/_types/utils/sortAddresses.d.ts +9 -0
- package/_types/utils/sortAddresses.d.ts.map +1 -0
- package/accounts/biconomy/package.json +6 -0
- package/accounts/biconomy/toBiconomySmartAccount.ts +13 -5
- package/accounts/etherspot/package.json +6 -0
- package/accounts/kernel/package.json +6 -0
- package/accounts/kernel/toKernelSmartAccount.ts +7 -0
- package/accounts/light/package.json +6 -0
- package/accounts/light/toLightSmartAccount.ts +13 -5
- package/accounts/nexus/package.json +6 -0
- package/accounts/nexus/toNexusSmartAccount.ts +3 -6
- package/accounts/package.json +6 -0
- package/accounts/safe/package.json +6 -0
- package/accounts/safe/signUserOperation.ts +15 -3
- package/accounts/safe/toSafeSmartAccount.ts +7 -6
- package/accounts/simple/package.json +6 -0
- package/accounts/simple/toSimpleSmartAccount.ts +21 -10
- package/accounts/thirdweb/package.json +6 -0
- package/accounts/thirdweb/utils/decodeCallData.ts +9 -5
- package/accounts/trust/package.json +6 -0
- package/accounts/trust/utils/decodeCallData.ts +9 -5
- package/actions/{erc7579.ts → erc7579/index.ts} +10 -16
- package/actions/erc7579/package.json +6 -0
- package/actions/{etherspot.ts → etherspot/index.ts} +1 -1
- package/actions/etherspot/package.json +6 -0
- package/actions/{passkeyServer.ts → passkeyServer/index.ts} +3 -3
- package/actions/passkeyServer/package.json +6 -0
- package/actions/pimlico/estimateErc20PaymasterCost.ts +9 -3
- package/actions/{pimlico.ts → pimlico/index.ts} +7 -7
- package/actions/pimlico/package.json +6 -0
- package/actions/smartAccount/index.ts +7 -0
- package/actions/smartAccount/package.json +6 -0
- package/clients/createSmartAccountClient.ts +45 -20
- package/clients/decorators/pimlico.ts +10 -10
- package/clients/package.json +6 -0
- package/clients/{passkeyServer.ts → passkeyServer/index.ts} +15 -13
- package/clients/passkeyServer/package.json +6 -0
- package/clients/{pimlico.ts → pimlico/index.ts} +50 -23
- package/clients/pimlico/package.json +6 -0
- package/errors/package.json +6 -0
- package/experimental/pimlico/package.json +6 -0
- package/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.ts +6 -4
- package/package.json +34 -29
- package/utils/index.ts +1 -0
- package/utils/package.json +6 -0
- package/utils/sortAddresses.ts +21 -0
- package/_cjs/actions/erc7579.js.map +0 -1
- package/_cjs/actions/etherspot.js.map +0 -1
- package/_cjs/actions/passkeyServer.js.map +0 -1
- package/_cjs/actions/pimlico.js.map +0 -1
- package/_cjs/actions/smartAccount.js.map +0 -1
- package/_cjs/clients/passkeyServer.js.map +0 -1
- package/_cjs/clients/pimlico.js.map +0 -1
- package/_esm/actions/erc7579.js.map +0 -1
- package/_esm/actions/etherspot.js +0 -2
- package/_esm/actions/etherspot.js.map +0 -1
- package/_esm/actions/passkeyServer.js +0 -4
- package/_esm/actions/passkeyServer.js.map +0 -1
- package/_esm/actions/pimlico.js +0 -8
- package/_esm/actions/pimlico.js.map +0 -1
- package/_esm/actions/smartAccount.js +0 -5
- package/_esm/actions/smartAccount.js.map +0 -1
- package/_esm/clients/passkeyServer.js.map +0 -1
- package/_esm/clients/pimlico.js.map +0 -1
- package/_types/actions/erc7579.d.ts.map +0 -1
- package/_types/actions/etherspot.d.ts +0 -2
- package/_types/actions/etherspot.d.ts.map +0 -1
- package/_types/actions/passkeyServer.d.ts +0 -4
- package/_types/actions/passkeyServer.d.ts.map +0 -1
- package/_types/actions/pimlico.d.ts +0 -8
- package/_types/actions/pimlico.d.ts.map +0 -1
- package/_types/actions/smartAccount.d.ts +0 -5
- package/_types/actions/smartAccount.d.ts.map +0 -1
- package/_types/clients/passkeyServer.d.ts.map +0 -1
- package/_types/clients/pimlico.d.ts +0 -13
- package/_types/clients/pimlico.d.ts.map +0 -1
- package/accounts/decodeCalls.test.ts +0 -505
- package/accounts/safe/signUserOperation.test.ts +0 -275
- package/actions/erc7579/accountId.test.ts +0 -39
- package/actions/erc7579/installModule.test.ts +0 -214
- package/actions/erc7579/installModules.test.ts +0 -235
- package/actions/erc7579/isModuleInstalled.test.ts +0 -72
- package/actions/erc7579/supportsExecutionMode.test.ts +0 -108
- package/actions/erc7579/supportsModule.test.ts +0 -35
- package/actions/erc7579/uninstallModule.test.ts +0 -128
- package/actions/erc7579/uninstallModules.test.ts +0 -117
- package/actions/pimlico/getTokenQuotes.test.ts +0 -90
- package/actions/pimlico/getUserOperationGasPrice.test.ts +0 -82
- package/actions/pimlico/getUserOperationStatus.test.ts +0 -223
- package/actions/pimlico/sponsorUserOperation.test.ts +0 -236
- package/actions/pimlico/validateSponsorshipPolicies.test.ts +0 -153
- package/actions/public/getAccountNonce.test.ts +0 -96
- package/actions/public/getSenderAddress.test.ts +0 -154
- package/actions/smartAccount/getCallsStatus.test.ts +0 -253
- package/actions/smartAccount/sendCalls.test.ts +0 -569
- package/actions/smartAccount/sendTransaction.test.ts +0 -414
- package/actions/smartAccount/signMessage.test.ts +0 -217
- package/actions/smartAccount/signTypedData.test.ts +0 -226
- package/actions/smartAccount.ts +0 -7
- package/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.test.ts +0 -574
- package/types/package.json +0 -6
- package/utils/decodeNonce.test.ts +0 -40
- package/utils/deepHexlify.test.ts +0 -57
- package/utils/encode7579Calls.test.ts +0 -69
- package/utils/encodeNonce.test.ts +0 -38
- package/utils/erc20AllowanceOverride.test.ts +0 -59
- package/utils/erc20BalanceOverride.test.ts +0 -57
- package/utils/getAddressFromInitCodeOrPaymasterAndData.test.ts +0 -31
- package/utils/getPackedUserOperation.test.ts +0 -204
- package/utils/getRequiredPrefund.test.ts +0 -90
- package/vitest.config.ts +0 -41
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Chain, Client, Hash, Prettify, Transport } from "viem";
|
|
2
2
|
import type { EntryPointVersion } from "viem/account-abstraction";
|
|
3
|
-
import { type GetTokenQuotesParameters, type GetTokenQuotesReturnType, type SendCompressedUserOperationParameters, type ValidateSponsorshipPolicies, type ValidateSponsorshipPoliciesParameters } from "../../actions/pimlico.js";
|
|
4
3
|
import { type EstimateErc20PaymasterCostParameters, type EstimateErc20PaymasterCostReturnType } from "../../actions/pimlico/estimateErc20PaymasterCost.js";
|
|
5
4
|
import { type GetUserOperationGasPriceReturnType } from "../../actions/pimlico/getUserOperationGasPrice.js";
|
|
6
5
|
import { type GetUserOperationStatusParameters, type GetUserOperationStatusReturnType } from "../../actions/pimlico/getUserOperationStatus.js";
|
|
6
|
+
import { type GetTokenQuotesParameters, type GetTokenQuotesReturnType, type SendCompressedUserOperationParameters, type ValidateSponsorshipPolicies, type ValidateSponsorshipPoliciesParameters } from "../../actions/pimlico/index.js";
|
|
7
7
|
import { type PimlicoSponsorUserOperationParameters, type SponsorUserOperationReturnType } from "../../actions/pimlico/sponsorUserOperation.js";
|
|
8
8
|
export type PimlicoActions<TChain extends Chain | undefined, entryPointVersion extends EntryPointVersion = EntryPointVersion> = {
|
|
9
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EACH,KAAK,
|
|
1
|
+
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EACH,KAAK,oCAAoC,EACzC,KAAK,oCAAoC,EAE5C,MAAM,qDAAqD,CAAA;AAC5D,OAAO,EACH,KAAK,kCAAkC,EAE1C,MAAM,mDAAmD,CAAA;AAC1D,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EAExC,MAAM,iDAAiD,CAAA;AACxD,OAAO,EACH,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,qCAAqC,EAC1C,KAAK,2BAA2B,EAChC,KAAK,qCAAqC,EAI7C,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,8BAA8B,EAEtC,MAAM,+CAA+C,CAAA;AAEtD,MAAM,MAAM,cAAc,CACtB,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,iBAAiB,SA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AO,CAAC,QAAQ,CAAC,oCAAoC,CAAC,CAAC,CAAA;CAC/D,CAAA;AAED,eAAO,MAAM,cAAc,GACtB,iBAAiB;;;;;OAMd,UAAU,oBACV,MAAM,gIAmCR,CAAA"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { Account, Chain, Client, ClientConfig, Prettify, RpcSchema, Transport } from "viem";
|
|
2
|
-
import type { PasskeyServerRpcSchema } from "
|
|
3
|
-
import { type PasskeyServerActions } from "
|
|
4
|
-
|
|
2
|
+
import type { PasskeyServerRpcSchema } from "../../types/passkeyServer.js";
|
|
3
|
+
import { type PasskeyServerActions } from "../decorators/passkeyServer.js";
|
|
4
|
+
type PasskeyServerClientInner<rpcSchema extends RpcSchema | undefined> = Client<Transport, Chain | undefined, Account | undefined, rpcSchema extends RpcSchema ? [...PasskeyServerRpcSchema, ...rpcSchema] : [...PasskeyServerRpcSchema], PasskeyServerActions>;
|
|
5
|
+
export type PasskeyServerClient<rpcSchema extends RpcSchema | undefined = undefined> = {
|
|
6
|
+
[key in keyof PasskeyServerClientInner<rpcSchema>]: PasskeyServerClientInner<rpcSchema>[key];
|
|
7
|
+
};
|
|
5
8
|
export type PasskeyServerClientConfig<rpcSchema extends RpcSchema | undefined = undefined> = Prettify<Pick<ClientConfig<Transport, Chain | undefined, Account | undefined, rpcSchema>, "account" | "cacheTime" | "chain" | "key" | "name" | "pollingInterval" | "rpcSchema" | "transport">>;
|
|
6
9
|
export declare function createPasskeyServerClient<rpcSchema extends RpcSchema | undefined = undefined>(parameters: PasskeyServerClientConfig<rpcSchema>): PasskeyServerClient<rpcSchema>;
|
|
7
|
-
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../clients/passkeyServer/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EACP,KAAK,EACL,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,SAAS,EACZ,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,EACH,KAAK,oBAAoB,EAE5B,MAAM,gCAAgC,CAAA;AAEvC,KAAK,wBAAwB,CAAC,SAAS,SAAS,SAAS,GAAG,SAAS,IAAI,MAAM,CAC3E,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,SAAS,EACnB,SAAS,SAAS,SAAS,GACrB,CAAC,GAAG,sBAAsB,EAAE,GAAG,SAAS,CAAC,GACzC,CAAC,GAAG,sBAAsB,CAAC,EACjC,oBAAoB,CACvB,CAAA;AAED,MAAM,MAAM,mBAAmB,CAC3B,SAAS,SAAS,SAAS,GAAG,SAAS,GAAG,SAAS,IACnD;KACC,GAAG,IAAI,MAAM,wBAAwB,CAAC,SAAS,CAAC,GAAG,wBAAwB,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC;CAC/F,CAAA;AAED,MAAM,MAAM,yBAAyB,CACjC,SAAS,SAAS,SAAS,GAAG,SAAS,GAAG,SAAS,IACnD,QAAQ,CACR,IAAI,CACA,YAAY,CACR,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,SAAS,EACnB,SAAS,CACZ,EACC,SAAS,GACT,WAAW,GACX,OAAO,GACP,KAAK,GACL,MAAM,GACN,iBAAiB,GACjB,WAAW,GACX,WAAW,CAChB,CACJ,CAAA;AAED,wBAAgB,yBAAyB,CACrC,SAAS,SAAS,SAAS,GAAG,SAAS,GAAG,SAAS,EAEnD,UAAU,EAAE,yBAAyB,CAAC,SAAS,CAAC,GACjD,mBAAmB,CAAC,SAAS,CAAC,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Address, BundlerRpcSchema, Chain, Client, ClientConfig, Prettify, RpcSchema, Transport } from "viem";
|
|
2
|
+
import { type BundlerActions, type EntryPointVersion, type PaymasterActions, type SmartAccount } from "viem/account-abstraction";
|
|
3
|
+
import type { PimlicoRpcSchema } from "../../types/pimlico.js";
|
|
4
|
+
import { type PimlicoActions } from "../decorators/pimlico.js";
|
|
5
|
+
type PimlicoClientInner<entryPointVersion extends EntryPointVersion, transport extends Transport, chain extends Chain | undefined, account extends SmartAccount | undefined, client extends Client | undefined, rpcSchema extends RpcSchema | undefined> = 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 PimlicoClient<
|
|
7
|
+
/** @ts-expect-error cast variance */
|
|
8
|
+
out entryPointVersion extends EntryPointVersion = EntryPointVersion, out transport extends Transport = Transport,
|
|
9
|
+
/** @ts-expect-error cast variance */
|
|
10
|
+
out chain extends Chain | undefined = Chain | undefined, out account extends SmartAccount | undefined = SmartAccount | undefined, out client extends Client | undefined = Client | undefined, rpcSchema extends RpcSchema | undefined = undefined> = {
|
|
11
|
+
[key in keyof PimlicoClientInner<entryPointVersion, transport, chain, account, client, rpcSchema>]: PimlicoClientInner<entryPointVersion, transport, chain, account, client, rpcSchema>[key];
|
|
12
|
+
};
|
|
13
|
+
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">> & {
|
|
14
|
+
entryPoint?: {
|
|
15
|
+
address: Address;
|
|
16
|
+
version: entryPointVersion;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
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>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../clients/pimlico/index.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,wBAAwB,CAAA;AAC9D,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,0BAA0B,CAAA;AAE9E,KAAK,kBAAkB,CACnB,iBAAiB,SAAS,iBAAiB,EAC3C,SAAS,SAAS,SAAS,EAC3B,KAAK,SAAS,KAAK,GAAG,SAAS,EAC/B,OAAO,SAAS,YAAY,GAAG,SAAS,EACxC,MAAM,SAAS,MAAM,GAAG,SAAS,EACjC,SAAS,SAAS,SAAS,GAAG,SAAS,IACvC,MAAM,CACN,SAAS,EACT,KAAK,SAAS,KAAK,GACb,KAAK,GAEL,MAAM,SAAS,MAAM,CAAC,GAAG,EAAE,MAAM,KAAK,CAAC,GACrC,KAAK,GACL,SAAS,EACjB,OAAO,EACP,SAAS,SAAS,SAAS,GACrB,CAAC,GAAG,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,GAAG,SAAS,CAAC,GACxD,CAAC,GAAG,gBAA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,GACX,WAAW,CAChB,CACJ,GAAG;IACA,UAAU,CAAC,EAAE;QACT,OAAO,EAAE,OAAO,CAAA;QAChB,OAAO,EAAE,iBAAiB,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareUserOperationForErc20Paymaster.d.ts","sourceRoot":"","sources":["../../../../experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,KAAK,EACV,KAAK,MAAM,EAIX,KAAK,SAAS,EAKjB,MAAM,MAAM,CAAA;AACb,OAAO,EAIH,KAAK,8BAA8B,EACnC,KAAK,2BAA2B,EAEhC,KAAK,YAAY,EAIpB,MAAM,0BAA0B,CAAA;AAUjC,eAAO,MAAM,qCAAqC;;;OAY1C,OAAO,yCACD,KAAK,mCACL,OAAO,uEAKb,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"prepareUserOperationForErc20Paymaster.d.ts","sourceRoot":"","sources":["../../../../experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,KAAK,EACV,KAAK,MAAM,EAIX,KAAK,SAAS,EAKjB,MAAM,MAAM,CAAA;AACb,OAAO,EAIH,KAAK,8BAA8B,EACnC,KAAK,2BAA2B,EAEhC,KAAK,YAAY,EAIpB,MAAM,0BAA0B,CAAA;AAUjC,eAAO,MAAM,qCAAqC;;;OAY1C,OAAO,yCACD,KAAK,mCACL,OAAO,uEAKb,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDA6TlB,CAAA"}
|
package/_types/utils/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { deepHexlify, transactionReceiptStatus } from "./deepHexlify.js";
|
|
|
2
2
|
export { getAddressFromInitCodeOrPaymasterAndData } from "./getAddressFromInitCodeOrPaymasterAndData.js";
|
|
3
3
|
export { type GetRequiredPrefundReturnType, getRequiredPrefund } from "./getRequiredPrefund.js";
|
|
4
4
|
export { isSmartAccountDeployed } from "./isSmartAccountDeployed.js";
|
|
5
|
+
export { sortAddresses } from "./sortAddresses.js";
|
|
5
6
|
export { toOwner } from "./toOwner.js";
|
|
6
7
|
export { decodeNonce } from "./decodeNonce.js";
|
|
7
8
|
export { encodeNonce } from "./encodeNonce.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,wCAAwC,EAAE,MAAM,+CAA+C,CAAA;AACxG,OAAO,EACH,KAAK,4BAA4B,EACjC,kBAAkB,EACrB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,EAAE,WAAW,EAA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ACH,KAAK,+BAA+B,EACpC,qBAAqB,EACxB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEpE,OAAO,EACH,KAAK,oBAAoB,EACzB,eAAe,EAClB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACH,KAAK,wBAAwB,EAC7B,eAAe,EAClB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACH,KAAK,gCAAgC,EACrC,sBAAsB,EACzB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACH,KAAK,8BAA8B,EACnC,oBAAoB,EACvB,MAAM,2BAA2B,CAAA;AAGlC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sorts addresses in ascending byte-wise (code unit) order, independent of
|
|
3
|
+
* the host's locale. Using String.prototype.localeCompare without an explicit
|
|
4
|
+
* locale makes the order depend on the ICU default locale (e.g. under
|
|
5
|
+
* da_DK the "aa" digraph sorts after "z"), which would make CREATE2
|
|
6
|
+
* counterfactual address derivation non-deterministic across hosts.
|
|
7
|
+
*/
|
|
8
|
+
export declare const sortAddresses: (addresses: `0x${string}`[]) => `0x${string}`[];
|
|
9
|
+
//# sourceMappingURL=sortAddresses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortAddresses.d.ts","sourceRoot":"","sources":["../../utils/sortAddresses.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,iDAWpB,CAAA"}
|
|
@@ -288,11 +288,19 @@ export async function toBiconomySmartAccount(
|
|
|
288
288
|
const calls: { to: Address; value: bigint; data: Hex }[] = []
|
|
289
289
|
|
|
290
290
|
for (let i = 0; i < decoded.args[0].length; i++) {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
291
|
+
const to = decoded.args[0][i]
|
|
292
|
+
const value = decoded.args[1][i]
|
|
293
|
+
const data = decoded.args[2][i]
|
|
294
|
+
|
|
295
|
+
if (
|
|
296
|
+
to === undefined ||
|
|
297
|
+
value === undefined ||
|
|
298
|
+
data === undefined
|
|
299
|
+
) {
|
|
300
|
+
throw new Error("Invalid batch call data")
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
calls.push({ to, value, data })
|
|
296
304
|
}
|
|
297
305
|
|
|
298
306
|
return calls
|
|
@@ -774,6 +774,13 @@ export async function toKernelSmartAccount<
|
|
|
774
774
|
]
|
|
775
775
|
})
|
|
776
776
|
|
|
777
|
+
if (
|
|
778
|
+
installFallbackCall === undefined ||
|
|
779
|
+
uninstallFallbackCall === undefined
|
|
780
|
+
) {
|
|
781
|
+
throw new Error("Failed to encode fallback module calls")
|
|
782
|
+
}
|
|
783
|
+
|
|
777
784
|
const executeCallData = encodeCallData({
|
|
778
785
|
calls,
|
|
779
786
|
kernelVersion
|
|
@@ -355,11 +355,19 @@ export async function toLightSmartAccount<
|
|
|
355
355
|
}[] = []
|
|
356
356
|
|
|
357
357
|
for (let i = 0; i < decoded.args[0].length; i++) {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
358
|
+
const to = decoded.args[0][i]
|
|
359
|
+
const value = decoded.args[1][i]
|
|
360
|
+
const data = decoded.args[2][i]
|
|
361
|
+
|
|
362
|
+
if (
|
|
363
|
+
to === undefined ||
|
|
364
|
+
value === undefined ||
|
|
365
|
+
data === undefined
|
|
366
|
+
) {
|
|
367
|
+
throw new Error("Invalid batch call data")
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
calls.push({ to, value, data })
|
|
363
371
|
}
|
|
364
372
|
|
|
365
373
|
return calls
|
|
@@ -39,6 +39,7 @@ import { getAction } from "viem/utils"
|
|
|
39
39
|
import { getAccountNonce } from "../../actions/public/getAccountNonce.js"
|
|
40
40
|
import { decode7579Calls } from "../../utils/decode7579Calls.js"
|
|
41
41
|
import { encode7579Calls } from "../../utils/encode7579Calls.js"
|
|
42
|
+
import { sortAddresses } from "../../utils/sortAddresses.js"
|
|
42
43
|
import { type EthereumProvider, toOwner } from "../../utils/toOwner.js"
|
|
43
44
|
|
|
44
45
|
const wrapMessageHash = (
|
|
@@ -170,9 +171,7 @@ export async function toNexusSmartAccount(
|
|
|
170
171
|
args: [
|
|
171
172
|
localOwner.address,
|
|
172
173
|
index,
|
|
173
|
-
attesters
|
|
174
|
-
left.toLowerCase().localeCompare(right.toLowerCase())
|
|
175
|
-
),
|
|
174
|
+
sortAddresses(attesters),
|
|
176
175
|
threshold
|
|
177
176
|
]
|
|
178
177
|
})
|
|
@@ -215,9 +214,7 @@ export async function toNexusSmartAccount(
|
|
|
215
214
|
args: [
|
|
216
215
|
localOwner.address,
|
|
217
216
|
index,
|
|
218
|
-
attesters
|
|
219
|
-
left.toLowerCase().localeCompare(right.toLowerCase())
|
|
220
|
-
),
|
|
217
|
+
sortAddresses(attesters),
|
|
221
218
|
threshold
|
|
222
219
|
]
|
|
223
220
|
})
|
|
@@ -30,9 +30,17 @@ import {
|
|
|
30
30
|
export const concatSignatures = (
|
|
31
31
|
signatures: { signer: Address; data: Hex; dynamic: boolean }[]
|
|
32
32
|
) => {
|
|
33
|
-
signatures.sort((left, right) =>
|
|
34
|
-
left.signer.toLowerCase()
|
|
35
|
-
|
|
33
|
+
signatures.sort((left, right) => {
|
|
34
|
+
const leftSigner = left.signer.toLowerCase()
|
|
35
|
+
const rightSigner = right.signer.toLowerCase()
|
|
36
|
+
if (leftSigner < rightSigner) {
|
|
37
|
+
return -1
|
|
38
|
+
}
|
|
39
|
+
if (leftSigner > rightSigner) {
|
|
40
|
+
return 1
|
|
41
|
+
}
|
|
42
|
+
return 0
|
|
43
|
+
})
|
|
36
44
|
|
|
37
45
|
const SIGNATURE_LENGTH_BYTES = 65
|
|
38
46
|
let signatureBytes = "0x"
|
|
@@ -97,6 +105,10 @@ export const getWebAuthnSignature = async ({
|
|
|
97
105
|
|
|
98
106
|
const [, fields] = match
|
|
99
107
|
|
|
108
|
+
if (fields === undefined) {
|
|
109
|
+
throw new Error("challenge not found in client data JSON")
|
|
110
|
+
}
|
|
111
|
+
|
|
100
112
|
return encodeAbiParameters(
|
|
101
113
|
[
|
|
102
114
|
{ name: "authenticatorData", type: "bytes" },
|
|
@@ -48,6 +48,7 @@ import { decode7579Calls } from "../../utils/decode7579Calls.js"
|
|
|
48
48
|
import { encode7579Calls } from "../../utils/encode7579Calls.js"
|
|
49
49
|
import { isSmartAccountDeployed } from "../../utils/isSmartAccountDeployed.js"
|
|
50
50
|
import { getOxExports } from "../../utils/ox.js"
|
|
51
|
+
import { sortAddresses } from "../../utils/sortAddresses.js"
|
|
51
52
|
import { type EthereumProvider, toOwner } from "../../utils/toOwner.js"
|
|
52
53
|
import {
|
|
53
54
|
concatSignatures,
|
|
@@ -673,9 +674,7 @@ const get7579LaunchPadInitData = ({
|
|
|
673
674
|
module: hook.address,
|
|
674
675
|
initData: hook.context
|
|
675
676
|
})),
|
|
676
|
-
attesters
|
|
677
|
-
left.toLowerCase().localeCompare(right.toLowerCase())
|
|
678
|
-
),
|
|
677
|
+
sortAddresses(attesters),
|
|
679
678
|
attestersThreshold
|
|
680
679
|
]
|
|
681
680
|
}),
|
|
@@ -904,15 +903,17 @@ const getInitializerCode = async ({
|
|
|
904
903
|
})
|
|
905
904
|
}
|
|
906
905
|
|
|
907
|
-
|
|
906
|
+
const firstMultiCall = multiCalls[0]
|
|
907
|
+
|
|
908
|
+
if (!useMultiSendForSetup && multiCalls.length === 1 && firstMultiCall) {
|
|
908
909
|
return encodeFunctionData({
|
|
909
910
|
abi: setupAbi,
|
|
910
911
|
functionName: "setup",
|
|
911
912
|
args: [
|
|
912
913
|
ownerAddresses,
|
|
913
914
|
threshold,
|
|
914
|
-
|
|
915
|
-
|
|
915
|
+
firstMultiCall.to,
|
|
916
|
+
firstMultiCall.data,
|
|
916
917
|
safe4337ModuleAddress,
|
|
917
918
|
paymentToken,
|
|
918
919
|
payment,
|
|
@@ -374,11 +374,19 @@ export async function toSimpleSmartAccount<
|
|
|
374
374
|
const datas = decodedV7.args[2]
|
|
375
375
|
|
|
376
376
|
for (let i = 0; i < destinations.length; i++) {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
377
|
+
const to = destinations[i]
|
|
378
|
+
const data = datas[i]
|
|
379
|
+
const value = values[i]
|
|
380
|
+
|
|
381
|
+
if (
|
|
382
|
+
to === undefined ||
|
|
383
|
+
data === undefined ||
|
|
384
|
+
value === undefined
|
|
385
|
+
) {
|
|
386
|
+
throw new Error("Invalid batch call data")
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
calls.push({ to, data, value })
|
|
382
390
|
}
|
|
383
391
|
|
|
384
392
|
return calls
|
|
@@ -394,11 +402,14 @@ export async function toSimpleSmartAccount<
|
|
|
394
402
|
const datas = decodedV6.args[1]
|
|
395
403
|
|
|
396
404
|
for (let i = 0; i < destinations.length; i++) {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
405
|
+
const to = destinations[i]
|
|
406
|
+
const data = datas[i]
|
|
407
|
+
|
|
408
|
+
if (to === undefined || data === undefined) {
|
|
409
|
+
throw new Error("Invalid batch call data")
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
calls.push({ to, data, value: 0n })
|
|
402
413
|
}
|
|
403
414
|
|
|
404
415
|
return calls
|
|
@@ -38,11 +38,15 @@ export const decodeCallData = async (callData: Hex) => {
|
|
|
38
38
|
}[] = []
|
|
39
39
|
|
|
40
40
|
for (let i = 0; i < decodedBatch.args[0].length; i++) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
const to = decodedBatch.args[0][i]
|
|
42
|
+
const value = decodedBatch.args[1][i]
|
|
43
|
+
const data = decodedBatch.args[2][i]
|
|
44
|
+
|
|
45
|
+
if (to === undefined || data === undefined) {
|
|
46
|
+
throw new Error("Invalid batch call data")
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
calls.push({ to, value, data })
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
return calls
|
|
@@ -38,11 +38,15 @@ export const decodeCallData = async (callData: Hex) => {
|
|
|
38
38
|
}[] = []
|
|
39
39
|
|
|
40
40
|
for (let i = 0; i < decodedBatch.args[0].length; i++) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
const to = decodedBatch.args[0][i]
|
|
42
|
+
const value = decodedBatch.args[1][i]
|
|
43
|
+
const data = decodedBatch.args[2][i]
|
|
44
|
+
|
|
45
|
+
if (to === undefined || data === undefined) {
|
|
46
|
+
throw new Error("Invalid batch call data")
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
calls.push({ to, value, data })
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
return calls
|
|
@@ -3,40 +3,34 @@ import type {
|
|
|
3
3
|
GetSmartAccountParameter,
|
|
4
4
|
SmartAccount
|
|
5
5
|
} from "viem/account-abstraction"
|
|
6
|
-
import { accountId } from "./
|
|
7
|
-
import {
|
|
8
|
-
type InstallModuleParameters,
|
|
9
|
-
installModule
|
|
10
|
-
} from "./erc7579/installModule.js"
|
|
6
|
+
import { accountId } from "./accountId.js"
|
|
7
|
+
import { type InstallModuleParameters, installModule } from "./installModule.js"
|
|
11
8
|
import {
|
|
12
9
|
type InstallModulesParameters,
|
|
13
10
|
installModules
|
|
14
|
-
} from "./
|
|
11
|
+
} from "./installModules.js"
|
|
15
12
|
import {
|
|
16
13
|
type IsModuleInstalledParameters,
|
|
17
14
|
isModuleInstalled
|
|
18
|
-
} from "./
|
|
15
|
+
} from "./isModuleInstalled.js"
|
|
19
16
|
import {
|
|
20
17
|
type SupportsExecutionModeParameters,
|
|
21
18
|
supportsExecutionMode
|
|
22
|
-
} from "./
|
|
23
|
-
import type {
|
|
24
|
-
CallType,
|
|
25
|
-
ExecutionMode
|
|
26
|
-
} from "./erc7579/supportsExecutionMode.js"
|
|
19
|
+
} from "./supportsExecutionMode.js"
|
|
20
|
+
import type { CallType, ExecutionMode } from "./supportsExecutionMode.js"
|
|
27
21
|
import {
|
|
28
22
|
type SupportsModuleParameters,
|
|
29
23
|
supportsModule
|
|
30
|
-
} from "./
|
|
31
|
-
import type { ModuleType } from "./
|
|
24
|
+
} from "./supportsModule.js"
|
|
25
|
+
import type { ModuleType } from "./supportsModule.js"
|
|
32
26
|
import {
|
|
33
27
|
type UninstallModuleParameters,
|
|
34
28
|
uninstallModule
|
|
35
|
-
} from "./
|
|
29
|
+
} from "./uninstallModule.js"
|
|
36
30
|
import {
|
|
37
31
|
type UninstallModulesParameters,
|
|
38
32
|
uninstallModules
|
|
39
|
-
} from "./
|
|
33
|
+
} from "./uninstallModules.js"
|
|
40
34
|
|
|
41
35
|
export type Erc7579Actions<TSmartAccount extends SmartAccount | undefined> = {
|
|
42
36
|
accountId: (
|
|
@@ -2,16 +2,16 @@ export {
|
|
|
2
2
|
type StartRegistrationParameters,
|
|
3
3
|
type StartRegistrationReturnType,
|
|
4
4
|
startRegistration
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./startRegistration.js"
|
|
6
6
|
|
|
7
7
|
export {
|
|
8
8
|
type VerifyRegistrationParameters,
|
|
9
9
|
type VerifyRegistrationReturnType,
|
|
10
10
|
verifyRegistration
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./verifyRegistration.js"
|
|
12
12
|
|
|
13
13
|
export {
|
|
14
14
|
type GetCredentialsParameters,
|
|
15
15
|
type GetCredentialsReturnType,
|
|
16
16
|
getCredentials
|
|
17
|
-
} from "./
|
|
17
|
+
} from "./getCredentials.js"
|
|
@@ -76,9 +76,15 @@ export const estimateErc20PaymasterCost = async <
|
|
|
76
76
|
chain
|
|
77
77
|
})
|
|
78
78
|
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
const quote = quotes[0]
|
|
80
|
+
|
|
81
|
+
if (quote === undefined) {
|
|
82
|
+
throw new Error(`No token quote found for ${token}`)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const postOpGas = quote.postOpGas
|
|
86
|
+
const exchangeRate = quote.exchangeRate
|
|
87
|
+
const exchangeRateNativeToUsd = quote.exchangeRateNativeToUsd
|
|
82
88
|
|
|
83
89
|
const userOperationMaxCost = getRequiredPrefund({
|
|
84
90
|
userOperation,
|
|
@@ -2,37 +2,37 @@ export {
|
|
|
2
2
|
type GetTokenQuotesParameters,
|
|
3
3
|
type GetTokenQuotesReturnType,
|
|
4
4
|
getTokenQuotes
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./getTokenQuotes.js"
|
|
6
6
|
|
|
7
7
|
export {
|
|
8
8
|
type GetUserOperationGasPriceReturnType,
|
|
9
9
|
getUserOperationGasPrice
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./getUserOperationGasPrice.js"
|
|
11
11
|
|
|
12
12
|
export {
|
|
13
13
|
type GetUserOperationStatusParameters,
|
|
14
14
|
type GetUserOperationStatusReturnType,
|
|
15
15
|
getUserOperationStatus
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./getUserOperationStatus.js"
|
|
17
17
|
|
|
18
18
|
export {
|
|
19
19
|
type SendCompressedUserOperationParameters,
|
|
20
20
|
sendCompressedUserOperation
|
|
21
|
-
} from "./
|
|
21
|
+
} from "./sendCompressedUserOperation.js"
|
|
22
22
|
|
|
23
23
|
export {
|
|
24
24
|
type PimlicoSponsorUserOperationParameters,
|
|
25
25
|
type SponsorUserOperationReturnType,
|
|
26
26
|
sponsorUserOperation
|
|
27
|
-
} from "./
|
|
27
|
+
} from "./sponsorUserOperation.js"
|
|
28
28
|
|
|
29
29
|
export {
|
|
30
30
|
type PimlicoActions,
|
|
31
31
|
pimlicoActions
|
|
32
|
-
} from "
|
|
32
|
+
} from "../../clients/decorators/pimlico.js"
|
|
33
33
|
|
|
34
34
|
export {
|
|
35
35
|
type ValidateSponsorshipPolicies,
|
|
36
36
|
type ValidateSponsorshipPoliciesParameters,
|
|
37
37
|
validateSponsorshipPolicies
|
|
38
|
-
} from "./
|
|
38
|
+
} from "./validateSponsorshipPolicies.js"
|