interface WalletProvider { request(method: string, params?: any): Promise; disconnect?(): void; } interface AddressEntry { symbol?: string; address: string; publicKey: string; } interface AddressesResult { addresses: AddressEntry[]; } interface TransferStxParams { recipient: string; amount: string; memo?: string; network?: string; } interface CallContractParams { contract: string; functionName: string; functionArgs: any[]; network?: string; postConditions?: any[]; attachment?: string; } interface DeployContractParams { name: string; clarityCode: string; network?: string; } interface SignMessageParams { message: string; network?: string; } interface SignTransactionParams { transaction: string; network?: string; } interface Methods { getAddresses: { params: undefined result: AddressesResult }; stx_getAddresses: { params: undefined result: AddressesResult }; stx_transferStx: { params: TransferStxParams result: any }; stx_callContract: { params: CallContractParams result: any }; stx_deployContract: { params: DeployContractParams result: any }; stx_signMessage: { params: SignMessageParams result: any }; stx_signTransaction: { params: SignTransactionParams result: any }; } type MethodParams = Methods[M]["params"]; type MethodResult = Methods[M]["result"]; declare function request(method: M, ...args: MethodParams extends undefined ? [] : [params: MethodParams]): Promise>; declare function connect(): Promise; declare function disconnect(): void; declare function isConnected(): boolean; /** Set a custom provider (e.g. WalletConnectProvider). Pass null to clear. */ declare function setProvider(provider: WalletProvider | null): void; declare function getProvider(): WalletProvider; declare function isWalletInstalled(): boolean; declare class BaseError extends Error { private; name: string; shortMessage: string; details?: string; constructor(shortMessage: string, options?: { cause?: Error details?: string code?: string }); /** * Stable identifier for programmatic handling; survives message * rewording and minification. An explicit `code` option wins, else it * is derived from `name` (`TimeoutError` gives `TIMEOUT_ERROR`). */ get code(): string; set code(value: string); toJSON(): { name: string code: string message: string shortMessage: string details: string | undefined cause: string | undefined }; } declare class ConnectError extends BaseError { name: string; } declare enum JsonRpcErrorCode { ParseError = -32700, InvalidRequest = -32600, MethodNotFound = -32601, InvalidParams = -32602, InternalError = -32603, UserRejection = -31001 } /** * A wallet's JSON-RPC error. `rpcCode` is the wallet's numeric code (see * {@link JsonRpcErrorCode}); `code` is the package-wide string identifier * every `BaseError` carries. */ declare class JsonRpcError extends ConnectError { name: string; rpcCode: number; data?: unknown; constructor(message: string, code: number, options?: { data?: unknown cause?: Error }); } export { setProvider, request, isWalletInstalled, isConnected, getProvider, disconnect, connect, WalletProvider, TransferStxParams, SignTransactionParams, SignMessageParams, Methods, MethodResult, MethodParams, JsonRpcErrorCode, JsonRpcError, DeployContractParams, ConnectError, CallContractParams, AddressesResult, AddressEntry };