import type { Account } from '../../accounts/types.js'; import { type ParseAccountErrorType } from '../../accounts/utils/parseAccount.js'; import { type EstimateFeesPerGasErrorType } from '../../actions/public/estimateFeesPerGas.js'; import { type EstimateGasErrorType } from '../../actions/public/estimateGas.js'; import { type GetBlockErrorType } from '../../actions/public/getBlock.js'; import { type GetTransactionCountErrorType } from '../../actions/public/getTransactionCount.js'; import type { Client } from '../../clients/createClient.js'; import type { Transport } from '../../clients/transports/createTransport.js'; import { type AccountNotFoundErrorType } from '../../errors/account.js'; import type { GetAccountParameter } from '../../types/account.js'; import type { Chain } from '../../types/chain.js'; import type { GetChain } from '../../types/chain.js'; import type { UnionOmit } from '../../types/utils.js'; import type { FormattedTransactionRequest } from '../../utils/formatters/transactionRequest.js'; import type { AssertRequestErrorType } from '../../utils/transaction/assertRequest.js'; export type PrepareTransactionRequestParameters = UnionOmit, 'from'> & GetAccountParameter & GetChain; export type PrepareTransactionRequestReturnType = FormattedTransactionRequest & GetAccountParameter & GetChain; export type PrepareTransactionRequestErrorType = AccountNotFoundErrorType | AssertRequestErrorType | ParseAccountErrorType | GetBlockErrorType | GetTransactionCountErrorType | EstimateGasErrorType | EstimateFeesPerGasErrorType; /** * Prepares a transaction request for signing. * * - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest.html * * @param args - {@link PrepareTransactionRequestParameters} * @returns The transaction request. {@link PrepareTransactionRequestReturnType} * * @example * import { createWalletClient, custom } from 'viem' * import { mainnet } from 'viem/chains' * import { prepareTransactionRequest } from 'viem/actions' * * const client = createWalletClient({ * chain: mainnet, * transport: custom(window.ethereum), * }) * const request = await prepareTransactionRequest(client, { * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', * to: '0x0000000000000000000000000000000000000000', * value: 1n, * }) * * @example * // Account Hoisting * import { createWalletClient, http } from 'viem' * import { privateKeyToAccount } from 'viem/accounts' * import { mainnet } from 'viem/chains' * import { prepareTransactionRequest } from 'viem/actions' * * const client = createWalletClient({ * account: privateKeyToAccount('0x…'), * chain: mainnet, * transport: custom(window.ethereum), * }) * const request = await prepareTransactionRequest(client, { * to: '0x0000000000000000000000000000000000000000', * value: 1n, * }) */ export declare function prepareTransactionRequest(client: Client, args: PrepareTransactionRequestParameters): Promise>; //# sourceMappingURL=prepareTransactionRequest.d.ts.map