/** @implements {IWalletAccount} */ export default class WalletAccountEvm extends WalletAccountReadOnlyEvm implements IWalletAccount { /** * Creates a new evm wallet account from a raw private key. * * @param {string | Uint8Array} privateKey - The raw private key (hex string with or without 0x, or 32 bytes). * @param {EvmWalletConfig} [config] - The configuration object. * @returns {WalletAccountEvm} The wallet account. */ static fromPrivateKey(privateKey: string | Uint8Array, config?: EvmWalletConfig): WalletAccountEvm; /** * Creates a new evm wallet account from a BIP-39 seed, deriving the account's key at the * given BIP-44 path. * * @param {string | Uint8Array} seed - The wallet's BIP-39 seed phrase or seed bytes. * @param {string} path - The BIP-44 derivation path (e.g. "0'/0/0"). * @param {EvmWalletConfig} [config] - The configuration object. */ constructor(seed: string | Uint8Array, path: string, config?: EvmWalletConfig); /** * Creates a new evm wallet account using a signer. * * @param {ISignerEvm} signer - A signer implementing the EVM signer interface. * @param {EvmWalletConfig} [config] - The configuration object. */ constructor(signer: ISignerEvm, config?: EvmWalletConfig); /** * The wallet account configuration. * * @protected * @type {EvmWalletConfig} */ protected _config: EvmWalletConfig; /** @private */ private _signer; /** * The derivation path's index of this account. * * @type {number} */ get index(): number; /** * The derivation path of this account (see [BIP-44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki)). * * @type {string} */ get path(): string; /** * The account's key pair. * * The uint8 arrays are bound to the wallet account, so any external change will reflect to the internal representation. For this reason, * it's strongly recommended to treat the key pair as a read-only view of the keys. While it's still technically possible to alter their * content, client code should never do so. * * @type {KeyPair} */ get keyPair(): KeyPair; /** * Returns the account's address. If it wasn't resolved at construction time (e.g hardware signers), it asks the * underlying signer to resolve it, then caches it locally. * * @returns {Promise} The account's address. */ getAddress(): Promise; /** * Signs a message. * * @param {string} message - The message to sign. * @returns {Promise} The message's signature. */ sign(message: string): Promise; /** * Signs typed data according to EIP-712. * * @param {TypedData} typedData - The typed data to sign. * @returns {Promise} The typed data signature. */ signTypedData({ domain, types, message }: TypedData): Promise; /** * Signs a transaction. * * If a provider is set, it also estimates the transaction's costs and checks them against the transaction max. fee option. * * @param {EvmTransaction} tx - The transaction to sign. * @returns {Promise} The signed transaction as a hex string. * @throws {Error} If a provider is set, and the transaction's cost surpasses the transaction max. fee option. */ signTransaction(tx: EvmTransaction): Promise; /** * Sends a transaction. * * @param {EvmTransaction | string} tx - The transaction. * @returns {Promise} The transaction's result. * @throws {Error} If the transaction's cost exceeds the maximum transaction fee option. */ sendTransaction(tx: EvmTransaction | string): Promise; /** * Quotes the costs of a send transaction operation. * * @param {EvmTransaction | string} tx - The transaction. * @returns {Promise>} The transaction's quotes. */ quoteSendTransaction(tx: EvmTransaction | string): Promise>; /** * Transfers a token to another address. * * @param {EvmTransferOptions} options - The transfer's options. * @returns {Promise} The transfer's result. * @throws {Error} If the transfer's cost exceeds the maximum transfer fee option. */ transfer(options: EvmTransferOptions): Promise; /** * Approves a specific amount of tokens to a spender. * * @param {ApproveOptions} options The approve options. * @returns {Promise} The transaction's result. * @throws {Error} If trying to approve usdts on ethereum with allowance not equal to zero (due to the usdt allowance reset requirement). */ approve(options: ApproveOptions): Promise; /** * Returns a read-only copy of the account. * * @returns {Promise} The read-only account. */ toReadOnlyAccount(): Promise; /** * Signs an ERC-7702 authorization tuple. * * @param {AuthorizationRequest} auth - The authorization request. * @returns {Promise} The signed authorization. */ signAuthorization(auth: AuthorizationRequest): Promise; /** * Delegates this EOA to a smart contract via an ERC-7702 type 4 transaction. * * The transaction is sent to the EOA itself with zero value and no data. * A fixed gas limit is used because `eth_estimateGas` may revert when * the delegate contract lacks a `receive`/`fallback` function. * * @param {string} delegateAddress - The address of the contract to delegate to. * @returns {Promise} The transaction result. */ delegate(delegateAddress: string): Promise; /** * Revokes any active ERC-7702 delegation by delegating to the zero address. * * @returns {Promise} The transaction result. */ revokeDelegation(): Promise; /** * Disposes the wallet account, erasing the private key from the memory. */ dispose(): void; } export type ISignerEvm = import("./signers/seed-signer-evm.js").ISignerEvm; export type HDNodeWallet = import("ethers").HDNodeWallet; export type AuthorizationRequest = import("ethers").AuthorizationRequest; export type Authorization = import("ethers").Authorization; export type AuthorizationLike = import("ethers").AuthorizationLike; export type IWalletAccount = import("@tetherto/wdk-wallet").IWalletAccount; export type KeyPair = import("@tetherto/wdk-wallet").KeyPair; export type TransactionResult = import("@tetherto/wdk-wallet").TransactionResult; export type TransferResult = import("@tetherto/wdk-wallet").TransferResult; export type TypedData = import("./wallet-account-read-only-evm.js").TypedData; export type EvmTransaction = import("./wallet-account-read-only-evm.js").EvmTransaction; export type EvmTransferOptions = import("./wallet-account-read-only-evm.js").EvmTransferOptions; export type EvmWalletConfig = import("./wallet-account-read-only-evm.js").EvmWalletConfig; export type ApproveOptions = { /** * - The address of the token to approve. */ token: string; /** * - The spender's address. */ spender: string; /** * - The amount of tokens to approve to the spender. */ amount: number | bigint; }; import WalletAccountReadOnlyEvm from './wallet-account-read-only-evm.js';