import type { TypedTransaction } from "@ethereumjs/tx"; import type { MessageTypes, TypedMessage } from "@metamask/eth-sig-util"; import { SignTypedDataVersion } from "@metamask/eth-sig-util"; import type { ConnectSettings } from "@onekeyfe/hd-core"; import type OldEthJsTransaction from "ethereumjs-tx"; import { EventEmitter } from "events"; import HDKey from "hdkey"; import type { OneKeyBridge } from "./onekey-bridge.mjs"; declare enum NetworkApiUrls { Ropsten = "https://api-ropsten.etherscan.io", Kovan = "https://api-kovan.etherscan.io", Rinkeby = "https://api-rinkeby.etherscan.io", Mainnet = "https://api.etherscan.io" } export type AccountDetails = { index?: number; hdPath: string; passphraseState?: string | undefined; }; export type AccountPageEntry = { address: string; balance: number | null; index: number; }; export type AccountPage = AccountPageEntry[]; export type OneKeyControllerOptions = { hdPath?: string; accounts?: string[]; accountDetails?: Readonly>; page?: number; passphraseState?: string; }; export type OneKeyControllerState = { hdPath: string; accounts: readonly string[]; accountDetails: Readonly>; page: number; passphraseState?: string; }; export declare class OneKeyKeyring extends EventEmitter { #private; readonly type: string; static type: string; page: number; perPage: number; unlockedAccount: number; hdk: HDKey; accounts: readonly string[]; accountDetails: Record; passphraseState: string | undefined; hdPath: string; network: NetworkApiUrls; implementFullBIP44: boolean; bridge: OneKeyBridge; constructor({ bridge }: { bridge: OneKeyBridge; }); init(settings: Partial): Promise; destroy(): Promise; serialize(): Promise; deserialize(opts?: OneKeyControllerOptions): Promise; getModel(): string | undefined; setAccountToUnlock(index: number): void; setHdPath(hdPath: string): void; lock(): void; isUnlocked(): boolean; unlock(): Promise; addAccounts(numberOfAccounts?: number): Promise; getName(): string; getFirstPage(): Promise; getNextPage(): Promise; getPreviousPage(): Promise; getAccounts(): Promise; removeAccount(address: string): void; updateTransportMethod(transportType: ConnectSettings['env']): Promise; /** * Signs a transaction using OneKey. * * Accepts either an ethereumjs-tx or @ethereumjs/tx transaction, and returns * the same type. * * @param address - Hex string address. * @param tx - Instance of either new-style or old-style ethereumjs transaction. * @returns The signed transaction, an instance of either new-style or old-style * ethereumjs transaction. */ signTransaction(address: string, tx: TypedTransaction | OldEthJsTransaction): Promise; signMessage(withAccount: string, data: string): Promise; signPersonalMessage(withAccount: string, message: string): Promise; signTypedData(address: string, data: TypedMessage, { version }: { version?: SignTypedDataVersion; }): Promise; exportAccount(): never; forgetDevice(): void; getPassphraseState(_index: number, _hdPath: string): Promise; } export {}; //# sourceMappingURL=onekey-keyring.d.mts.map