UNPKG

askexperts

Version:

AskExperts SDK: build and use AI experts - ask them questions and pay with bitcoin on an open protocol

47 lines (46 loc) 1.3 kB
/** * Client for interacting with the askexperts.io remote service */ export declare class RemoteClient { private privateKey; private publicKey; private baseUrl; /** * Create a new RemoteClient instance * Reads existing private key or generates a new one * @param baseUrl - Base URL for the API (defaults to askexperts.io) */ constructor(baseUrl?: string); /** * Get the public key * @returns The public key */ getPublicKey(): string; /** * Get the private key * @returns The private key as Uint8Array */ getPrivateKey(): Uint8Array; /** * Sign up on the askexperts.io remote service * @returns A promise that resolves when signup is complete */ signup(): Promise<void>; /** * Get the current balance * @returns A promise that resolves to the balance */ balance(): Promise<number>; /** * Create a new invoice * @param amount - The amount in satoshis * @returns A promise that resolves to the invoice string */ invoice(amount: number): Promise<string>; /** * Pay an invoice * @param invoice - The invoice to pay * @returns A promise that resolves to the preimage */ pay(invoice: string): Promise<string>; }