import * as AbiError from 'ox/AbiError'; import type * as Address from 'ox/Address'; import * as Errors from 'ox/Errors'; import * as Hex from 'ox/Hex'; import * as TypedData from 'ox/TypedData'; import { type Account as Account_viem, type Authorization as Authorization_viem, BaseError, type Chain, type Client, type Transport } from 'viem'; import { type EncodeExecuteDataParameters } from 'viem/experimental/erc7821'; import type { OneOf } from '../core/internal/types.js'; import type * as Storage from '../core/Storage.js'; import * as Account from './Account.js'; import type { GetAccountParameter } from './internal/utils.js'; import * as Key from './Key.js'; export { abi, code, } from '../core/internal/_generated/contracts/IthacaAccount.js'; /** * Executes a set of calls on a delegated account. * * @example * TODO * * @param client - Client. * @param parameters - Execution parameters. * @returns Transaction hash. */ export declare function execute(client: Client, parameters: execute.Parameters): Promise; export declare namespace execute { type Parameters = Pick, 'calls'> & GetAccountParameter & { /** * Contract address to delegate to. */ delegation?: Address.Address | undefined; /** * The executor of the execute transaction. * * - `Account`: execution will be attempted with the specified account. * - `undefined`: the transaction will be filled by the JSON-RPC server. */ executor?: Account_viem | undefined; /** * Storage to use for keytype-specific caching (e.g. WebAuthn user verification). */ storage?: Storage.Storage | undefined; } & OneOf<{ /** * EIP-7702 Authorization to use for delegation. */ authorization?: Authorization_viem | undefined; /** * Nonce to use for execution that will be invalidated by the delegated account. */ nonce: bigint; /** * Signature for execution. Required if the `executor` is not the EOA. */ signatures: { auth?: Hex.Hex | undefined; exec: Hex.Hex; }; } | { /** * Key to use for execution. */ key?: number | Key.Key | undefined; } | {}>; type ReturnType = Hex.Hex; } /** * Returns the EIP-712 domain for a delegated account. Used for the execution * signing payload. * * @param client - Client. * @param parameters - Parameters. * @returns EIP-712 domain. */ export declare function getEip712Domain(client: Client, parameters: getEip712Domain.Parameters): Promise; export declare namespace getEip712Domain { type Parameters = GetAccountParameter; } /** * Returns the key at the given index. * * @param client - Client. * @param parameters - Parameters. * @returns Key. */ export declare function keyAt(client: Client, parameters: keyAt.Parameters): Promise; export declare namespace keyAt { type Parameters = GetAccountParameter & { /** * Index of the key to extract. */ index: number; }; } /** * Prepares the payloads to sign over and fills the request to execute a set of calls. * * @example * TODO * * @param client - Client. * @param parameters - Parameters. * @returns Prepared properties. */ export declare function prepareExecute(client: Client, parameters: prepareExecute.Parameters): Promise>; export declare namespace prepareExecute { type Parameters = Pick, 'calls'> & GetAccountParameter & { /** * Contract address to delegate to. */ delegation?: Address.Address | undefined; /** * The executor of the execute transaction. * * - `Account`: execution will be attempted with the specified account. * - `undefined`: the transaction will be filled by the JSON-RPC server. */ executor?: Account_viem | undefined; }; type ReturnType = { digests: { auth?: Hex.Hex | undefined; exec: Hex.Hex; }; request: Omit, 'account' | 'delegation'> & { account: Account.Account; authorization?: Authorization_viem | undefined; nonce: bigint; }; typedData: TypedData.Definition; }; } export declare function parseExecutionError(e: unknown, { calls }?: { calls?: execute.Parameters['calls'] | undefined; }): void; export declare namespace parseExecutionError { type ErrorType = ExecutionError | Errors.GlobalErrorType; } /** Thrown when the execution fails. */ export declare class ExecutionError extends Errors.BaseError { readonly name = "AccountContract.ExecutionError"; abiError?: AbiError.AbiError | undefined; constructor(cause: BaseError & { abiError?: AbiError.AbiError | undefined; }); } export type Decorator = { /** * Executes a set of calls on a delegated account. * * @example * TODO * * @param client - Client. * @param parameters - Execution parameters. * @returns Transaction hash. */ execute: (parameters: execute.Parameters) => Promise; /** * Returns the EIP-712 domain for a delegated account. Used for the execution * signing payload. * * @param client - Client. * @param parameters - Parameters. * @returns EIP-712 domain. */ getEip712Domain: (parameters: getEip712Domain.Parameters) => Promise; /** * Returns the key at the given index. * * @param client - Client. * @param parameters - Parameters. * @returns Key. */ keyAt: (parameters: keyAt.Parameters) => Promise; /** * Prepares the payloads to sign over and fills the request to execute a set of calls. * * @param client - Client. * @param parameters - Parameters. * @returns Prepared properties. */ prepareExecute: (parameters: prepareExecute.Parameters) => Promise>; }; export declare function decorator(client: Client): Decorator; export declare namespace getExecuteDigest { type Parameters = { /** * The delegated account to execute the calls on. */ account: Account.Account; /** * Contract address to delegate to. */ delegation?: Address.Address | undefined; /** * Calls to execute. */ calls: calls; /** * Nonce to use for execution that will be invalidated by the delegated account. */ nonce: bigint; /** * Nonce salt. */ nonceSalt?: bigint | undefined; }; } //# sourceMappingURL=ContractActions.d.ts.map