@aa-sdk/core 4.0.0-alpha.5 → 4.0.0-alpha.6
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/dist/cjs/account/smartContractAccount.d.ts +9 -3
- package/dist/cjs/account/smartContractAccount.js +11 -6
- package/dist/cjs/account/smartContractAccount.js.map +1 -1
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.js.map +1 -1
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.js.map +1 -1
- package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -1
- package/dist/cjs/actions/smartAccount/estimateUserOperationGas.js.map +1 -1
- package/dist/cjs/actions/smartAccount/internal/initUserOperation.js.map +1 -1
- package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.js.map +1 -1
- package/dist/cjs/actions/smartAccount/internal/sendUserOperation.js.map +1 -1
- package/dist/cjs/actions/smartAccount/sendUserOperation.js.map +1 -1
- package/dist/cjs/client/bundlerClient.js.map +1 -1
- package/dist/cjs/client/decorators/bundlerClient.js.map +1 -1
- package/dist/cjs/client/isSmartAccountClient.js.map +1 -1
- package/dist/cjs/client/types.d.ts +2 -7
- package/dist/cjs/client/types.js.map +1 -1
- package/dist/cjs/errors/account.js.map +1 -1
- package/dist/cjs/errors/client.js.map +1 -1
- package/dist/cjs/errors/entrypoint.js.map +1 -1
- package/dist/cjs/errors/signer.js.map +1 -1
- package/dist/cjs/errors/transaction.js.map +1 -1
- package/dist/cjs/errors/useroperation.js.map +1 -1
- package/dist/cjs/index.d.ts +3 -5
- package/dist/cjs/index.js +6 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/logger.js.map +1 -1
- package/dist/cjs/middleware/actions.js +2 -18
- package/dist/cjs/middleware/actions.js.map +1 -1
- package/dist/cjs/middleware/defaults/gasEstimator.js +3 -2
- package/dist/cjs/middleware/defaults/gasEstimator.js.map +1 -1
- package/dist/cjs/middleware/erc7677middleware.d.ts +40 -0
- package/dist/cjs/middleware/erc7677middleware.js +77 -0
- package/dist/cjs/middleware/erc7677middleware.js.map +1 -0
- package/dist/cjs/middleware/noopMiddleware.d.ts +2 -1
- package/dist/cjs/middleware/noopMiddleware.js.map +1 -1
- package/dist/cjs/middleware/types.d.ts +3 -2
- package/dist/cjs/middleware/types.js.map +1 -1
- package/dist/cjs/signer/local-account.d.ts +46 -46
- package/dist/cjs/signer/local-account.js.map +1 -1
- package/dist/cjs/signer/wallet-client.d.ts +46 -46
- package/dist/cjs/signer/wallet-client.js.map +1 -1
- package/dist/cjs/transport/split.js.map +1 -1
- package/dist/cjs/utils/bigint.js.map +1 -1
- package/dist/cjs/utils/bytes.js.map +1 -1
- package/dist/cjs/utils/defaults.d.ts +1 -3
- package/dist/cjs/utils/defaults.js +1 -41
- package/dist/cjs/utils/defaults.js.map +1 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/types.js.map +1 -1
- package/dist/cjs/utils/userop.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/account/smartContractAccount.d.ts +9 -3
- package/dist/esm/account/smartContractAccount.js +6 -1
- package/dist/esm/account/smartContractAccount.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperationFromTx.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.js.map +1 -1
- package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -1
- package/dist/esm/actions/smartAccount/estimateUserOperationGas.js.map +1 -1
- package/dist/esm/actions/smartAccount/internal/initUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/internal/runMiddlewareStack.js.map +1 -1
- package/dist/esm/actions/smartAccount/internal/sendUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendUserOperation.js.map +1 -1
- package/dist/esm/client/bundlerClient.js.map +1 -1
- package/dist/esm/client/decorators/bundlerClient.js.map +1 -1
- package/dist/esm/client/isSmartAccountClient.js.map +1 -1
- package/dist/esm/client/types.d.ts +2 -7
- package/dist/esm/client/types.js.map +1 -1
- package/dist/esm/errors/account.js.map +1 -1
- package/dist/esm/errors/client.js.map +1 -1
- package/dist/esm/errors/entrypoint.js.map +1 -1
- package/dist/esm/errors/signer.js.map +1 -1
- package/dist/esm/errors/transaction.js.map +1 -1
- package/dist/esm/errors/useroperation.js.map +1 -1
- package/dist/esm/index.d.ts +3 -5
- package/dist/esm/index.js +2 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/logger.js.map +1 -1
- package/dist/esm/middleware/actions.js +3 -18
- package/dist/esm/middleware/actions.js.map +1 -1
- package/dist/esm/middleware/defaults/gasEstimator.js +3 -2
- package/dist/esm/middleware/defaults/gasEstimator.js.map +1 -1
- package/dist/esm/middleware/erc7677middleware.d.ts +40 -0
- package/dist/esm/middleware/erc7677middleware.js +73 -0
- package/dist/esm/middleware/erc7677middleware.js.map +1 -0
- package/dist/esm/middleware/noopMiddleware.d.ts +2 -1
- package/dist/esm/middleware/noopMiddleware.js.map +1 -1
- package/dist/esm/middleware/types.d.ts +3 -2
- package/dist/esm/middleware/types.js.map +1 -1
- package/dist/esm/signer/local-account.d.ts +46 -46
- package/dist/esm/signer/local-account.js.map +1 -1
- package/dist/esm/signer/wallet-client.d.ts +46 -46
- package/dist/esm/signer/wallet-client.js.map +1 -1
- package/dist/esm/transport/split.js.map +1 -1
- package/dist/esm/utils/bigint.js.map +1 -1
- package/dist/esm/utils/bytes.js.map +1 -1
- package/dist/esm/utils/defaults.d.ts +1 -3
- package/dist/esm/utils/defaults.js +1 -40
- package/dist/esm/utils/defaults.js.map +1 -1
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/types.js.map +1 -1
- package/dist/esm/utils/userop.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/account/smartContractAccount.d.ts +17 -11
- package/dist/types/account/smartContractAccount.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/buildUserOperationFromTx.d.ts +33 -33
- package/dist/types/actions/smartAccount/buildUserOperationFromTxs.d.ts +43 -59
- package/dist/types/actions/smartAccount/buildUserOperationFromTxs.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/checkGasSponsorshipEligibility.d.ts +18 -18
- package/dist/types/actions/smartAccount/estimateUserOperationGas.d.ts +3 -3
- package/dist/types/actions/smartAccount/internal/initUserOperation.d.ts +3 -4
- package/dist/types/actions/smartAccount/internal/initUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/internal/runMiddlewareStack.d.ts +0 -14
- package/dist/types/actions/smartAccount/internal/runMiddlewareStack.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/internal/sendUserOperation.d.ts +0 -7
- package/dist/types/actions/smartAccount/internal/sendUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/sendUserOperation.d.ts +17 -3
- package/dist/types/actions/smartAccount/sendUserOperation.d.ts.map +1 -1
- package/dist/types/client/bundlerClient.d.ts +2 -2
- package/dist/types/client/decorators/bundlerClient.d.ts +8 -8
- package/dist/types/client/isSmartAccountClient.d.ts +4 -4
- package/dist/types/client/types.d.ts +2 -7
- package/dist/types/client/types.d.ts.map +1 -1
- package/dist/types/errors/account.d.ts +53 -4
- package/dist/types/errors/account.d.ts.map +1 -1
- package/dist/types/errors/client.d.ts +15 -0
- package/dist/types/errors/client.d.ts.map +1 -1
- package/dist/types/errors/entrypoint.d.ts +12 -0
- package/dist/types/errors/entrypoint.d.ts.map +1 -1
- package/dist/types/errors/signer.d.ts +5 -0
- package/dist/types/errors/signer.d.ts.map +1 -1
- package/dist/types/errors/transaction.d.ts +8 -1
- package/dist/types/errors/transaction.d.ts.map +1 -1
- package/dist/types/errors/useroperation.d.ts +5 -5
- package/dist/types/errors/useroperation.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logger.d.ts +88 -0
- package/dist/types/logger.d.ts.map +1 -1
- package/dist/types/middleware/actions.d.ts +3 -3
- package/dist/types/middleware/actions.d.ts.map +1 -1
- package/dist/types/middleware/defaults/gasEstimator.d.ts +2 -2
- package/dist/types/middleware/defaults/gasEstimator.d.ts.map +1 -1
- package/dist/types/middleware/erc7677middleware.d.ts +62 -0
- package/dist/types/middleware/erc7677middleware.d.ts.map +1 -0
- package/dist/types/middleware/noopMiddleware.d.ts +4 -4
- package/dist/types/middleware/noopMiddleware.d.ts.map +1 -1
- package/dist/types/middleware/types.d.ts +3 -2
- package/dist/types/middleware/types.d.ts.map +1 -1
- package/dist/types/signer/local-account.d.ts +139 -47
- package/dist/types/signer/local-account.d.ts.map +1 -1
- package/dist/types/signer/wallet-client.d.ts +135 -46
- package/dist/types/signer/wallet-client.d.ts.map +1 -1
- package/dist/types/transport/split.d.ts +2 -2
- package/dist/types/utils/bigint.d.ts +14 -14
- package/dist/types/utils/bigint.d.ts.map +1 -1
- package/dist/types/utils/bytes.d.ts +5 -5
- package/dist/types/utils/defaults.d.ts +1 -11
- package/dist/types/utils/defaults.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +12 -12
- package/dist/types/utils/types.d.ts +2 -2
- package/dist/types/utils/userop.d.ts +33 -33
- package/dist/types/version.d.ts +1 -1
- package/package.json +3 -2
- package/src/account/smartContractAccount.ts +19 -12
- package/src/actions/smartAccount/buildUserOperationFromTx.ts +35 -35
- package/src/actions/smartAccount/buildUserOperationFromTxs.ts +44 -60
- package/src/actions/smartAccount/checkGasSponsorshipEligibility.ts +19 -19
- package/src/actions/smartAccount/estimateUserOperationGas.ts +3 -3
- package/src/actions/smartAccount/internal/initUserOperation.ts +3 -4
- package/src/actions/smartAccount/internal/runMiddlewareStack.ts +0 -22
- package/src/actions/smartAccount/internal/sendUserOperation.ts +0 -7
- package/src/actions/smartAccount/sendUserOperation.ts +17 -3
- package/src/client/bundlerClient.ts +2 -2
- package/src/client/decorators/bundlerClient.ts +8 -8
- package/src/client/isSmartAccountClient.ts +4 -4
- package/src/client/types.ts +2 -15
- package/src/errors/account.ts +64 -4
- package/src/errors/client.ts +18 -0
- package/src/errors/entrypoint.ts +12 -0
- package/src/errors/signer.ts +6 -0
- package/src/errors/transaction.ts +10 -1
- package/src/errors/useroperation.ts +5 -6
- package/src/index.ts +2 -8
- package/src/logger.ts +88 -0
- package/src/middleware/actions.ts +6 -27
- package/src/middleware/defaults/gasEstimator.ts +8 -5
- package/src/middleware/erc7677middleware.ts +201 -0
- package/src/middleware/noopMiddleware.ts +6 -4
- package/src/middleware/types.ts +16 -7
- package/src/signer/local-account.ts +94 -2
- package/src/signer/wallet-client.ts +89 -0
- package/src/transport/split.ts +2 -2
- package/src/utils/bigint.ts +15 -15
- package/src/utils/bytes.ts +5 -5
- package/src/utils/defaults.ts +2 -74
- package/src/utils/index.ts +12 -12
- package/src/utils/types.ts +2 -2
- package/src/utils/userop.ts +33 -33
- package/src/version.ts +1 -1
- package/dist/cjs/account/base.d.ts +0 -49
- package/dist/cjs/account/base.js +0 -257
- package/dist/cjs/account/base.js.map +0 -1
- package/dist/cjs/account/schema.d.ts +0 -100
- package/dist/cjs/account/schema.js +0 -43
- package/dist/cjs/account/schema.js.map +0 -1
- package/dist/cjs/account/simple.d.ts +0 -14
- package/dist/cjs/account/simple.js +0 -119
- package/dist/cjs/account/simple.js.map +0 -1
- package/dist/cjs/account/types.d.ts +0 -30
- package/dist/cjs/account/types.js +0 -3
- package/dist/cjs/account/types.js.map +0 -1
- package/dist/esm/account/base.d.ts +0 -49
- package/dist/esm/account/base.js +0 -253
- package/dist/esm/account/base.js.map +0 -1
- package/dist/esm/account/schema.d.ts +0 -100
- package/dist/esm/account/schema.js +0 -35
- package/dist/esm/account/schema.js.map +0 -1
- package/dist/esm/account/simple.d.ts +0 -14
- package/dist/esm/account/simple.js +0 -115
- package/dist/esm/account/simple.js.map +0 -1
- package/dist/esm/account/types.d.ts +0 -30
- package/dist/esm/account/types.js +0 -2
- package/dist/esm/account/types.js.map +0 -1
- package/dist/types/account/base.d.ts +0 -128
- package/dist/types/account/base.d.ts.map +0 -1
- package/dist/types/account/schema.d.ts +0 -101
- package/dist/types/account/schema.d.ts.map +0 -1
- package/dist/types/account/simple.d.ts +0 -15
- package/dist/types/account/simple.d.ts.map +0 -1
- package/dist/types/account/types.d.ts +0 -144
- package/dist/types/account/types.d.ts.map +0 -1
- package/src/account/base.ts +0 -415
- package/src/account/schema.ts +0 -51
- package/src/account/simple.ts +0 -221
- package/src/account/types.ts +0 -184
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/account/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Address } from \"abitype\";\nimport type { Hash, Hex, HttpTransport, Transport } from \"viem\";\nimport type { SignTypedDataParameters } from \"viem/accounts\";\nimport type { z } from \"zod\";\nimport type { BundlerClient } from \"../client/bundlerClient\";\nimport type { SmartAccountSigner } from \"../signer/types\";\nimport type { BatchUserOperationCallData } from \"../types\";\nimport type {\n SimpleSmartAccountParamsSchema,\n createBaseSmartAccountParamsSchema,\n} from \"./schema\";\n\n/** @deprecated */\nexport type SignTypedDataParams = Omit<SignTypedDataParameters, \"privateKey\">;\n\n/**\n * @deprecated don't use base smart account anymore, migrate to using toSmartContractAccount instead\n */\nexport type BaseSmartAccountParams<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = z.input<\n ReturnType<typeof createBaseSmartAccountParamsSchema<TTransport, TSigner>>\n>;\n\nexport type SimpleSmartAccountParams<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = z.input<\n ReturnType<typeof SimpleSmartAccountParamsSchema<TTransport, TSigner>>\n>;\n\n/**\n * @deprecated use `toSmartContractAccount` instead for creating instances of smart accounts\n */\nexport interface ISmartContractAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> {\n /**\n * The RPC provider the account uses to make RPC calls\n */\n readonly rpcProvider:\n | BundlerClient<TTransport>\n | BundlerClient<HttpTransport>;\n\n /**\n * @returns the init code for the account\n */\n getInitCode(): Promise<Hex>;\n\n /**\n * This is useful for estimating gas costs. It should return a signature that doesn't cause the account to revert\n * when validation is run during estimation.\n *\n * @returns a dummy signature that doesn't cause the account to revert during estimation\n */\n getDummySignature(): Hex | Promise<Hex>;\n\n /**\n * Encodes a call to the account's execute function.\n *\n * @param target - the address receiving the call data\n * @param value - optionally the amount of native token to send\n * @param data - the call data or \"0x\" if empty\n */\n encodeExecute(target: string, value: bigint, data: string): Promise<Hex>;\n\n /**\n * Encodes a batch of transactions to the account's batch execute function.\n * NOTE: not all accounts support batching.\n *\n * @param txs - An Array of objects containing the target, value, and data for each transaction\n * @returns the encoded callData for a UserOperation\n */\n encodeBatchExecute(txs: BatchUserOperationCallData): Promise<Hex>;\n\n /**\n * @returns the nonce of the account\n */\n getNonce(): Promise<bigint>;\n\n /**\n * If your account handles 1271 signatures of personal_sign differently\n * than it does UserOperations, you can implement two different approaches to signing\n *\n * @param uoHash -- The hash of the UserOperation to sign\n * @returns the signature of the UserOperation\n */\n signUserOperationHash(uoHash: Hash): Promise<Hash>;\n\n /**\n * Returns a signed and prefixed message.\n *\n * @param msg - the message to sign\n * @returns the signature of the message\n */\n signMessage(msg: string | Uint8Array | Hex): Promise<Hex>;\n\n /**\n * Signs a typed data object as per ERC-712\n *\n * @param params - {@link SignTypedDataParams}\n * @returns the signed hash for the message passed\n */\n signTypedData(params: SignTypedDataParams): Promise<Hash>;\n\n /**\n * If the account is not deployed, it will sign the message and then wrap it in 6492 format\n *\n * @param msg - the message to sign\n * @returns ths signature wrapped in 6492 format\n */\n signMessageWith6492(msg: string | Uint8Array | Hex): Promise<Hex>;\n\n /**\n * If the account is not deployed, it will sign the typed data blob and then wrap it in 6492 format\n *\n * @param params - {@link SignTypedDataParams}\n * @returns the signed hash for the params passed in wrapped in 6492 format\n */\n signTypedDataWith6492(params: SignTypedDataParams): Promise<Hash>;\n\n /**\n * @returns the address of the account\n */\n getAddress(): Promise<Address>;\n\n /**\n * @returns the current account signer instance that the smart account client\n * operations are being signed with.\n *\n * The signer is expected to be the owner or one of the owners of the account\n * for the signatures to be valid for the acting account.\n */\n getSigner(): TSigner;\n\n /**\n * The factory address of the smart account created by the factory\n *\n * @returns the address of the factory contract for the smart account\n */\n getFactoryAddress(): Address;\n\n /**\n * The entrypoint address is the address ERC 4337 entrypoint singleton contract\n * that this smart account and the connected bundler client use\n *\n * @returns the address of the entry point contract for the smart account\n */\n getEntryPointAddress(): Address;\n\n /**\n * Allows you to add additional functionality and utility methods to this account\n * via a decorator pattern.\n *\n * NOTE: this method does not allow you to override existing methods on the account.\n *\n * @example\n * ```ts\n * const account = new BaseSmartCobntractAccount(...).extend((account) => ({\n * readAccountState: async (...args) => {\n * return this.rpcProvider.readContract({\n * address: await this.getAddress(),\n * abi: ThisContractsAbi\n * args: args\n * });\n * }\n * }));\n *\n * account.debugSendUserOperation(...);\n * ```\n *\n * @param extendFn -- this function gives you access to the created account instance and returns an object\n * with the extension methods\n * @returns -- the account with the extension methods added\n */\n extend: <R>(extendFn: (self: this) => R) => this & R;\n\n encodeUpgradeToAndCall: (\n upgradeToImplAddress: Address,\n upgradeToInitData: Hex\n ) => Promise<Hex>;\n}\n"]}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import type { Address } from "abitype";
|
|
2
|
-
import { type GetContractReturnType, type Hash, type Hex, type HttpTransport, type PublicClient, type Transport } from "viem";
|
|
3
|
-
import { EntryPointAbi_v6 as EntryPointAbi } from "../abis/EntryPointAbi_v6.js";
|
|
4
|
-
import { type BundlerClient } from "../client/bundlerClient.js";
|
|
5
|
-
import type { SmartAccountSigner } from "../signer/types.js";
|
|
6
|
-
import type { BatchUserOperationCallData, NullAddress } from "../types.js";
|
|
7
|
-
import type { BaseSmartAccountParams, ISmartContractAccount, SignTypedDataParams } from "./types.js";
|
|
8
|
-
export declare enum DeploymentState {
|
|
9
|
-
UNDEFINED = "0x0",
|
|
10
|
-
NOT_DEPLOYED = "0x1",
|
|
11
|
-
DEPLOYED = "0x2"
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated use `toSmartContractAccount` instead for creating SmartAccountInstances
|
|
15
|
-
*/
|
|
16
|
-
export declare abstract class BaseSmartContractAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner> implements ISmartContractAccount<TTransport, TSigner> {
|
|
17
|
-
protected factoryAddress: Address;
|
|
18
|
-
protected deploymentState: DeploymentState;
|
|
19
|
-
protected accountAddress?: Address;
|
|
20
|
-
protected accountInitCode?: Hex;
|
|
21
|
-
protected signer: TSigner;
|
|
22
|
-
protected entryPoint: GetContractReturnType<typeof EntryPointAbi, PublicClient>;
|
|
23
|
-
protected entryPointAddress: Address;
|
|
24
|
-
readonly rpcProvider: BundlerClient<TTransport> | BundlerClient<HttpTransport>;
|
|
25
|
-
constructor(params_: BaseSmartAccountParams<TTransport, TSigner>);
|
|
26
|
-
/**
|
|
27
|
-
* This method should return a signature that will not `revert` during validation.
|
|
28
|
-
* It does not have to pass validation, just not cause the contract to revert.
|
|
29
|
-
* This is required for gas estimation so that the gas estimate are accurate.
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
|
-
abstract getDummySignature(): Hex | Promise<Hex>;
|
|
33
|
-
/**
|
|
34
|
-
* this method should return the abi encoded function data for a call to your contract's `execute` method
|
|
35
|
-
*
|
|
36
|
-
* @param target -- equivalent to `to` in a normal transaction
|
|
37
|
-
* @param value -- equivalent to `value` in a normal transaction
|
|
38
|
-
* @param data -- equivalent to `data` in a normal transaction
|
|
39
|
-
* @returns abi encoded function data for a call to your contract's `execute` method
|
|
40
|
-
*/
|
|
41
|
-
abstract encodeExecute(target: string, value: bigint, data: string): Promise<Hash>;
|
|
42
|
-
/**
|
|
43
|
-
* this should return an ERC-191 compliant message and is used to sign UO Hashes
|
|
44
|
-
*
|
|
45
|
-
* @param msg -- the message to sign
|
|
46
|
-
*/
|
|
47
|
-
abstract signMessage(msg: string | Uint8Array): Promise<Hash>;
|
|
48
|
-
/**
|
|
49
|
-
* this should return the init code that will be used to create an account if one does not exist.
|
|
50
|
-
* This is the concatenation of the account's factory address and the abi encoded function data of the account factory's `createAccount` method.
|
|
51
|
-
* https://github.com/eth-infinitism/account-abstraction/blob/abff2aca61a8f0934e533d0d352978055fddbd96/contracts/core/SenderCreator.sol#L12
|
|
52
|
-
*/
|
|
53
|
-
protected abstract getAccountInitCode(): Promise<Hash>;
|
|
54
|
-
/**
|
|
55
|
-
* If your account handles 1271 signatures of personal_sign differently
|
|
56
|
-
* than it does UserOperations, you can implement two different approaches to signing
|
|
57
|
-
*
|
|
58
|
-
* @param uoHash -- The hash of the UserOperation to sign
|
|
59
|
-
* @returns the signature of the UserOperation
|
|
60
|
-
*/
|
|
61
|
-
signUserOperationHash(uoHash: Hash): Promise<Hash>;
|
|
62
|
-
/**
|
|
63
|
-
* If your contract supports signing and verifying typed data,
|
|
64
|
-
* you should implement this method.
|
|
65
|
-
*
|
|
66
|
-
* @param _params -- Typed Data params to sign
|
|
67
|
-
*/
|
|
68
|
-
signTypedData(_params: SignTypedDataParams): Promise<`0x${string}`>;
|
|
69
|
-
/**
|
|
70
|
-
* This method should wrap the result of `signMessage` as per
|
|
71
|
-
* [EIP-6492](https://eips.ethereum.org/EIPS/eip-6492)
|
|
72
|
-
*
|
|
73
|
-
* @param msg -- the message to sign
|
|
74
|
-
* @returns the signature wrapped in 6492 format
|
|
75
|
-
*/
|
|
76
|
-
signMessageWith6492(msg: string | Uint8Array): Promise<`0x${string}`>;
|
|
77
|
-
/**
|
|
78
|
-
* Similar to the signMessageWith6492 method above,
|
|
79
|
-
* this method should wrap the result of `signTypedData` as per
|
|
80
|
-
* [EIP-6492](https://eips.ethereum.org/EIPS/eip-6492)
|
|
81
|
-
*
|
|
82
|
-
* @param params -- Typed Data params to sign
|
|
83
|
-
* @returns the signature wrapped in 6492 format
|
|
84
|
-
*/
|
|
85
|
-
signTypedDataWith6492(params: SignTypedDataParams): Promise<`0x${string}`>;
|
|
86
|
-
/**
|
|
87
|
-
* Not all contracts support batch execution.
|
|
88
|
-
* If your contract does, this method should encode a list of
|
|
89
|
-
* transactions into the call data that will be passed to your
|
|
90
|
-
* contract's batch execution method.
|
|
91
|
-
*
|
|
92
|
-
* @param _txs -- the transactions to batch execute
|
|
93
|
-
*/
|
|
94
|
-
encodeBatchExecute(_txs: BatchUserOperationCallData): Promise<`0x${string}`>;
|
|
95
|
-
/**
|
|
96
|
-
* If your contract supports UUPS, you can implement this method which can be
|
|
97
|
-
* used to upgrade the implementation of the account.
|
|
98
|
-
*
|
|
99
|
-
* @param _upgradeToImplAddress -- the implementation address of the contract you want to upgrade to
|
|
100
|
-
* @param _upgradeToInitData -- the initialization data required by that account
|
|
101
|
-
*/
|
|
102
|
-
encodeUpgradeToAndCall: (_upgradeToImplAddress: Address, _upgradeToInitData: Hex) => Promise<Hex>;
|
|
103
|
-
getNonce(): Promise<bigint>;
|
|
104
|
-
getInitCode(): Promise<Hex>;
|
|
105
|
-
getAddress(): Promise<Address>;
|
|
106
|
-
extend: <R>(fn: (self: this) => R) => this & R;
|
|
107
|
-
getSigner(): TSigner;
|
|
108
|
-
getFactoryAddress(): Address;
|
|
109
|
-
getEntryPointAddress(): Address;
|
|
110
|
-
isAccountDeployed(): Promise<boolean>;
|
|
111
|
-
getDeploymentState(): Promise<DeploymentState>;
|
|
112
|
-
/**
|
|
113
|
-
* https://eips.ethereum.org/EIPS/eip-4337#first-time-account-creation
|
|
114
|
-
* The initCode field (if non-zero length) is parsed as a 20-byte address,
|
|
115
|
-
* followed by calldata to pass to this address.
|
|
116
|
-
* The factory address is the first 40 char after the 0x, and the callData is the rest.
|
|
117
|
-
*
|
|
118
|
-
* @returns [factoryAddress, factoryCalldata]
|
|
119
|
-
*/
|
|
120
|
-
protected parseFactoryAddressFromAccountInitCode(): Promise<[
|
|
121
|
-
Address,
|
|
122
|
-
Hex
|
|
123
|
-
]>;
|
|
124
|
-
protected getImplementationAddress(): Promise<NullAddress | Address>;
|
|
125
|
-
private _getAccountInitCode;
|
|
126
|
-
private create6492Signature;
|
|
127
|
-
}
|
|
128
|
-
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/account/base.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { type Transport } from "viem";
|
|
2
|
-
import z from "zod";
|
|
3
|
-
import type { SmartAccountSigner } from "../signer/types.js";
|
|
4
|
-
export declare const createBaseSmartAccountParamsSchema: <TTransport extends Transport = Transport, TSigner extends SmartAccountSigner<any> = SmartAccountSigner<any>>() => z.ZodObject<{
|
|
5
|
-
rpcClient: z.ZodUnion<[z.ZodString, z.ZodType<import("../index.js").BundlerClient<TTransport>, z.ZodTypeDef, import("../index.js").BundlerClient<TTransport>>]>;
|
|
6
|
-
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
7
|
-
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
8
|
-
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
9
|
-
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
10
|
-
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
11
|
-
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
12
|
-
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
13
|
-
}, "strip", z.ZodTypeAny, { [k_1 in keyof z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
14
|
-
rpcClient: z.ZodUnion<[z.ZodString, z.ZodType<import("../index.js").BundlerClient<TTransport>, z.ZodTypeDef, import("../index.js").BundlerClient<TTransport>>]>;
|
|
15
|
-
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
16
|
-
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
17
|
-
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
18
|
-
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
19
|
-
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
20
|
-
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
21
|
-
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
22
|
-
}>, "chain" | "factoryAddress" | "rpcClient" | (undefined extends TSigner ? never : "signer")>]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
23
|
-
rpcClient: z.ZodUnion<[z.ZodString, z.ZodType<import("../index.js").BundlerClient<TTransport>, z.ZodTypeDef, import("../index.js").BundlerClient<TTransport>>]>;
|
|
24
|
-
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
25
|
-
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
26
|
-
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
27
|
-
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
28
|
-
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
29
|
-
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
30
|
-
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
31
|
-
}>, "chain" | "factoryAddress" | "rpcClient" | (undefined extends TSigner ? never : "signer")>[k_1]; }, { [k_2 in keyof z.baseObjectInputType<{
|
|
32
|
-
rpcClient: z.ZodUnion<[z.ZodString, z.ZodType<import("../index.js").BundlerClient<TTransport>, z.ZodTypeDef, import("../index.js").BundlerClient<TTransport>>]>;
|
|
33
|
-
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
34
|
-
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
35
|
-
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
36
|
-
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
37
|
-
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
38
|
-
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
39
|
-
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
40
|
-
}>]: z.baseObjectInputType<{
|
|
41
|
-
rpcClient: z.ZodUnion<[z.ZodString, z.ZodType<import("../index.js").BundlerClient<TTransport>, z.ZodTypeDef, import("../index.js").BundlerClient<TTransport>>]>;
|
|
42
|
-
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
43
|
-
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
44
|
-
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
45
|
-
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
46
|
-
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
47
|
-
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
48
|
-
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
49
|
-
}>[k_2]; }>;
|
|
50
|
-
export declare const SimpleSmartAccountParamsSchema: <TTransport extends Transport = Transport, TSigner extends SmartAccountSigner<any> = SmartAccountSigner<any>>() => z.ZodObject<{
|
|
51
|
-
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
52
|
-
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
53
|
-
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
54
|
-
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
55
|
-
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
56
|
-
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
57
|
-
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
58
|
-
transport: z.ZodType<TTransport, z.ZodTypeDef, TTransport>;
|
|
59
|
-
salt: z.ZodOptional<z.ZodBigInt>;
|
|
60
|
-
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
61
|
-
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
62
|
-
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
63
|
-
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
64
|
-
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
65
|
-
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
66
|
-
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
67
|
-
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
68
|
-
transport: z.ZodType<TTransport, z.ZodTypeDef, TTransport>;
|
|
69
|
-
salt: z.ZodOptional<z.ZodBigInt>;
|
|
70
|
-
}>, "chain" | "factoryAddress" | (undefined extends TTransport ? never : "transport") | (undefined extends TSigner ? never : "signer")> extends infer T ? { [k in keyof T]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
71
|
-
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
72
|
-
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
73
|
-
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
74
|
-
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
75
|
-
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
76
|
-
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
77
|
-
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
78
|
-
transport: z.ZodType<TTransport, z.ZodTypeDef, TTransport>;
|
|
79
|
-
salt: z.ZodOptional<z.ZodBigInt>;
|
|
80
|
-
}>, "chain" | "factoryAddress" | (undefined extends TTransport ? never : "transport") | (undefined extends TSigner ? never : "signer")>[k]; } : never, z.baseObjectInputType<{
|
|
81
|
-
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
82
|
-
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
83
|
-
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
84
|
-
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
85
|
-
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
86
|
-
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
87
|
-
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
88
|
-
transport: z.ZodType<TTransport, z.ZodTypeDef, TTransport>;
|
|
89
|
-
salt: z.ZodOptional<z.ZodBigInt>;
|
|
90
|
-
}> extends infer T_1 ? { [k_1 in keyof T_1]: z.baseObjectInputType<{
|
|
91
|
-
initCode: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
92
|
-
chain: z.ZodType<import("viem").Chain, z.ZodTypeDef, import("viem").Chain>;
|
|
93
|
-
factoryAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
94
|
-
signer: z.ZodType<TSigner, z.ZodTypeDef, TSigner>;
|
|
95
|
-
entryPointAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
96
|
-
accountAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
97
|
-
entryPointVersion: z.ZodOptional<z.ZodType<keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>, z.ZodTypeDef, keyof import("../entrypoint/types.js").EntryPointRegistryBase<unknown>>>;
|
|
98
|
-
transport: z.ZodType<TTransport, z.ZodTypeDef, TTransport>;
|
|
99
|
-
salt: z.ZodOptional<z.ZodBigInt>;
|
|
100
|
-
}>[k_1]; } : never>;
|
|
101
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/account/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AAC7C,OAAO,CAAC,MAAM,KAAK,CAAC;AAKpB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA2B3C,CAAC;AAEL,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAWrC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Address } from "abitype";
|
|
2
|
-
import { type Chain, type Hex, type Transport } from "viem";
|
|
3
|
-
import type { DefaultEntryPointVersion, EntryPointParameter, EntryPointVersion } from "../entrypoint/types.js";
|
|
4
|
-
import type { SmartAccountSigner } from "../signer/types.js";
|
|
5
|
-
import { type SmartContractAccountWithSigner, type ToSmartContractAccountParams } from "./smartContractAccount.js";
|
|
6
|
-
export type SimpleSmartAccount<TSigner extends SmartAccountSigner = SmartAccountSigner, TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = SmartContractAccountWithSigner<"SimpleAccount", TSigner, TEntryPointVersion>;
|
|
7
|
-
export type CreateSimpleAccountParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TEntryPointVersion extends EntryPointVersion = DefaultEntryPointVersion> = Pick<ToSmartContractAccountParams<"SimpleAccount", TTransport, Chain, TEntryPointVersion>, "chain" | "transport"> & {
|
|
8
|
-
signer: TSigner;
|
|
9
|
-
salt?: bigint;
|
|
10
|
-
accountAddress?: Address;
|
|
11
|
-
factoryAddress?: Address;
|
|
12
|
-
initCode?: Hex;
|
|
13
|
-
} & EntryPointParameter<TEntryPointVersion, Chain>;
|
|
14
|
-
export declare function createSimpleSmartAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TEntryPointVersion extends EntryPointVersion = DefaultEntryPointVersion>(config: CreateSimpleAccountParams<TTransport, TSigner, TEntryPointVersion>): Promise<SimpleSmartAccount<TSigner, TEntryPointVersion>>;
|
|
15
|
-
//# sourceMappingURL=simple.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../../src/account/simple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAIL,KAAK,KAAK,EAEV,KAAK,GAAG,EACR,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AASd,OAAO,KAAK,EACV,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAK7D,OAAO,EAEL,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EAClC,MAAM,2BAA2B,CAAC;AAuFnC,MAAM,MAAM,kBAAkB,CAC5B,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,kBAAkB,SAAS,iBAAiB,GAAG,iBAAiB,IAC9D,8BAA8B,CAChC,eAAe,EACf,OAAO,EACP,kBAAkB,CACnB,CAAC;AAEF,MAAM,MAAM,yBAAyB,CACnC,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,kBAAkB,SAAS,iBAAiB,GAAG,wBAAwB,IACrE,IAAI,CACN,4BAA4B,CAC1B,eAAe,EACf,UAAU,EACV,KAAK,EACL,kBAAkB,CACnB,EACD,OAAO,GAAG,WAAW,CACtB,GAAG;IACF,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,GAAG,mBAAmB,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;AAEnD,wBAAsB,wBAAwB,CAC5C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,OAAO,SAAS,kBAAkB,GAAG,kBAAkB,EACvD,kBAAkB,SAAS,iBAAiB,GAAG,wBAAwB,EAEvE,MAAM,EAAE,yBAAyB,CAAC,UAAU,EAAE,OAAO,EAAE,kBAAkB,CAAC,GACzE,OAAO,CAAC,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC"}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import type { Address } from "abitype";
|
|
2
|
-
import type { Hash, Hex, HttpTransport, Transport } from "viem";
|
|
3
|
-
import type { SignTypedDataParameters } from "viem/accounts";
|
|
4
|
-
import type { z } from "zod";
|
|
5
|
-
import type { BundlerClient } from "../client/bundlerClient";
|
|
6
|
-
import type { SmartAccountSigner } from "../signer/types";
|
|
7
|
-
import type { BatchUserOperationCallData } from "../types";
|
|
8
|
-
import type { SimpleSmartAccountParamsSchema, createBaseSmartAccountParamsSchema } from "./schema";
|
|
9
|
-
/** @deprecated */
|
|
10
|
-
export type SignTypedDataParams = Omit<SignTypedDataParameters, "privateKey">;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated don't use base smart account anymore, migrate to using toSmartContractAccount instead
|
|
13
|
-
*/
|
|
14
|
-
export type BaseSmartAccountParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner> = z.input<ReturnType<typeof createBaseSmartAccountParamsSchema<TTransport, TSigner>>>;
|
|
15
|
-
export type SimpleSmartAccountParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner> = z.input<ReturnType<typeof SimpleSmartAccountParamsSchema<TTransport, TSigner>>>;
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated use `toSmartContractAccount` instead for creating instances of smart accounts
|
|
18
|
-
*/
|
|
19
|
-
export interface ISmartContractAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner> {
|
|
20
|
-
/**
|
|
21
|
-
* The RPC provider the account uses to make RPC calls
|
|
22
|
-
*/
|
|
23
|
-
readonly rpcProvider: BundlerClient<TTransport> | BundlerClient<HttpTransport>;
|
|
24
|
-
/**
|
|
25
|
-
* @returns the init code for the account
|
|
26
|
-
*/
|
|
27
|
-
getInitCode(): Promise<Hex>;
|
|
28
|
-
/**
|
|
29
|
-
* This is useful for estimating gas costs. It should return a signature that doesn't cause the account to revert
|
|
30
|
-
* when validation is run during estimation.
|
|
31
|
-
*
|
|
32
|
-
* @returns a dummy signature that doesn't cause the account to revert during estimation
|
|
33
|
-
*/
|
|
34
|
-
getDummySignature(): Hex | Promise<Hex>;
|
|
35
|
-
/**
|
|
36
|
-
* Encodes a call to the account's execute function.
|
|
37
|
-
*
|
|
38
|
-
* @param target - the address receiving the call data
|
|
39
|
-
* @param value - optionally the amount of native token to send
|
|
40
|
-
* @param data - the call data or "0x" if empty
|
|
41
|
-
*/
|
|
42
|
-
encodeExecute(target: string, value: bigint, data: string): Promise<Hex>;
|
|
43
|
-
/**
|
|
44
|
-
* Encodes a batch of transactions to the account's batch execute function.
|
|
45
|
-
* NOTE: not all accounts support batching.
|
|
46
|
-
*
|
|
47
|
-
* @param txs - An Array of objects containing the target, value, and data for each transaction
|
|
48
|
-
* @returns the encoded callData for a UserOperation
|
|
49
|
-
*/
|
|
50
|
-
encodeBatchExecute(txs: BatchUserOperationCallData): Promise<Hex>;
|
|
51
|
-
/**
|
|
52
|
-
* @returns the nonce of the account
|
|
53
|
-
*/
|
|
54
|
-
getNonce(): Promise<bigint>;
|
|
55
|
-
/**
|
|
56
|
-
* If your account handles 1271 signatures of personal_sign differently
|
|
57
|
-
* than it does UserOperations, you can implement two different approaches to signing
|
|
58
|
-
*
|
|
59
|
-
* @param uoHash -- The hash of the UserOperation to sign
|
|
60
|
-
* @returns the signature of the UserOperation
|
|
61
|
-
*/
|
|
62
|
-
signUserOperationHash(uoHash: Hash): Promise<Hash>;
|
|
63
|
-
/**
|
|
64
|
-
* Returns a signed and prefixed message.
|
|
65
|
-
*
|
|
66
|
-
* @param msg - the message to sign
|
|
67
|
-
* @returns the signature of the message
|
|
68
|
-
*/
|
|
69
|
-
signMessage(msg: string | Uint8Array | Hex): Promise<Hex>;
|
|
70
|
-
/**
|
|
71
|
-
* Signs a typed data object as per ERC-712
|
|
72
|
-
*
|
|
73
|
-
* @param params - {@link SignTypedDataParams}
|
|
74
|
-
* @returns the signed hash for the message passed
|
|
75
|
-
*/
|
|
76
|
-
signTypedData(params: SignTypedDataParams): Promise<Hash>;
|
|
77
|
-
/**
|
|
78
|
-
* If the account is not deployed, it will sign the message and then wrap it in 6492 format
|
|
79
|
-
*
|
|
80
|
-
* @param msg - the message to sign
|
|
81
|
-
* @returns ths signature wrapped in 6492 format
|
|
82
|
-
*/
|
|
83
|
-
signMessageWith6492(msg: string | Uint8Array | Hex): Promise<Hex>;
|
|
84
|
-
/**
|
|
85
|
-
* If the account is not deployed, it will sign the typed data blob and then wrap it in 6492 format
|
|
86
|
-
*
|
|
87
|
-
* @param params - {@link SignTypedDataParams}
|
|
88
|
-
* @returns the signed hash for the params passed in wrapped in 6492 format
|
|
89
|
-
*/
|
|
90
|
-
signTypedDataWith6492(params: SignTypedDataParams): Promise<Hash>;
|
|
91
|
-
/**
|
|
92
|
-
* @returns the address of the account
|
|
93
|
-
*/
|
|
94
|
-
getAddress(): Promise<Address>;
|
|
95
|
-
/**
|
|
96
|
-
* @returns the current account signer instance that the smart account client
|
|
97
|
-
* operations are being signed with.
|
|
98
|
-
*
|
|
99
|
-
* The signer is expected to be the owner or one of the owners of the account
|
|
100
|
-
* for the signatures to be valid for the acting account.
|
|
101
|
-
*/
|
|
102
|
-
getSigner(): TSigner;
|
|
103
|
-
/**
|
|
104
|
-
* The factory address of the smart account created by the factory
|
|
105
|
-
*
|
|
106
|
-
* @returns the address of the factory contract for the smart account
|
|
107
|
-
*/
|
|
108
|
-
getFactoryAddress(): Address;
|
|
109
|
-
/**
|
|
110
|
-
* The entrypoint address is the address ERC 4337 entrypoint singleton contract
|
|
111
|
-
* that this smart account and the connected bundler client use
|
|
112
|
-
*
|
|
113
|
-
* @returns the address of the entry point contract for the smart account
|
|
114
|
-
*/
|
|
115
|
-
getEntryPointAddress(): Address;
|
|
116
|
-
/**
|
|
117
|
-
* Allows you to add additional functionality and utility methods to this account
|
|
118
|
-
* via a decorator pattern.
|
|
119
|
-
*
|
|
120
|
-
* NOTE: this method does not allow you to override existing methods on the account.
|
|
121
|
-
*
|
|
122
|
-
* @example
|
|
123
|
-
* ```ts
|
|
124
|
-
* const account = new BaseSmartCobntractAccount(...).extend((account) => ({
|
|
125
|
-
* readAccountState: async (...args) => {
|
|
126
|
-
* return this.rpcProvider.readContract({
|
|
127
|
-
* address: await this.getAddress(),
|
|
128
|
-
* abi: ThisContractsAbi
|
|
129
|
-
* args: args
|
|
130
|
-
* });
|
|
131
|
-
* }
|
|
132
|
-
* }));
|
|
133
|
-
*
|
|
134
|
-
* account.debugSendUserOperation(...);
|
|
135
|
-
* ```
|
|
136
|
-
*
|
|
137
|
-
* @param extendFn -- this function gives you access to the created account instance and returns an object
|
|
138
|
-
* with the extension methods
|
|
139
|
-
* @returns -- the account with the extension methods added
|
|
140
|
-
*/
|
|
141
|
-
extend: <R>(extendFn: (self: this) => R) => this & R;
|
|
142
|
-
encodeUpgradeToAndCall: (upgradeToImplAddress: Address, upgradeToInitData: Hex) => Promise<Hex>;
|
|
143
|
-
}
|
|
144
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/account/types.ts"],"names":[],"mappings":"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"}
|