UNPKG

necjs

Version:
41 lines (40 loc) 1.26 kB
import { type MlKemBrowser } from './webassembly/mlkem-browser'; import type { Provider } from './provider'; export interface TxParams { from: string; nonce: any; gasPrice: string; gasLimit?: string; gas?: string; to: string; value: string; data?: string; chainId?: number; } export declare class Wallet { mlkem: MlKemBrowser; privateKey: string; readonly address: string; private constructor(); static create(hexPrivateKey: string): Promise<Wallet>; connect(provider: Provider): Signer; /** * Unified connect: creates a Wallet, Provider, and Signer in one call (browser version). * @param hexPrivateKey The private key as a hex string. * @param providerUrl The RPC URL (optional, defaults to http://localhost:8545) * @returns { signer, provider, address } */ static connect(hexPrivateKey: string, providerUrl?: string): Promise<{ signer: Signer; provider: Provider; address: string; }>; } export declare class Signer { private provider; private wallet; constructor(provider: Provider, wallet: Wallet); get address(): string; getAddress(): Promise<string>; sendTransaction(txParams: TxParams): Promise<string>; }