import { EVMWallet } from "../interfaces"; import type { Signer } from "ethers"; import { Bytes, BigNumber } from "ethers"; import EventEmitter from "eventemitter3"; import { Ecosystem, GenericAuthWallet } from "../../core/interfaces/auth"; import { Price, TransactionResult } from "@thirdweb-dev/sdk"; export declare function chainIdToThirdwebRpc(chainId: number, clientId?: string): string; export type WalletData = { address?: string; chainId?: number; }; export interface WalletEvents { connect(data: WalletData): void; change(data: WalletData): void; message({ type, data }: { type: string; data?: unknown; }): void; disconnect(): void; error(error: Error): void; display_uri(uri: string): void; wc_session_request_sent(): void; request(): void; } /** * The base class for any wallet in the Wallet SDK, including backend wallets. It contains the functionality common to all wallets. * * This wallet is not meant to be used directly, but instead be extended to [build your own wallet](https://portal.thirdweb.com/wallet-sdk/v2/build) * * @abstractWallet */ export declare abstract class AbstractWallet extends EventEmitter implements GenericAuthWallet, EVMWallet { /** * @internal */ type: Ecosystem; /** * Returns an [ethers Signer](https://docs.ethers.org/v5/api/signer/) object of the connected wallet */ abstract getSigner(): Promise; /** * Returns the account address of the connected wallet */ getAddress(): Promise; /** * Returns the balance of the connected wallet for the specified token address. If no token address is specified, it returns the balance of the native token * * @param tokenAddress - The contract address of the token */ getBalance(tokenAddress?: string): Promise<{ symbol: string; value: BigNumber; name: string; decimals: number; displayValue: string; }>; /** * Returns the chain id of the network that the wallet is connected to */ getChainId(): Promise; /** * Transfers some amount of tokens to the specified address * @param to - The address to transfer the amount to * @param amount - The amount to transfer * @param currencyAddress - The contract address of the token to transfer. If not specified, it defaults to the native token * @returns The transaction result */ transfer(to: string, amount: Price, currencyAddress?: string): Promise; /** * Sign a message with the connected wallet and return the signature * @param message - The message to sign * @returns - The signature */ signMessage(message: Bytes | string): Promise; /** * Verify the signature of a message. It returns `true` if the signature is valid, `false` otherwise * @param message - The message to verify * @param signature - The signature to verify * @param address - The address to verify the signature against * @param chainId - The chain id of the network to verify the signature against, If not specified, it defaults to 1 ( Ethereum mainnet ) */ verifySignature(message: string, signature: string, address: string, _chainId?: number): Promise; } //# sourceMappingURL=abstract.d.ts.map