/** * BlockRun phone API client. * * Thin wrapper over `/v1/phone/numbers/{list,buy,renew,release}` that * handles the x402 payment handshake using the wallet Franklin already * loads at startup. Pattern mirrors `src/tools/modal.ts` — first POST * returns 402 with payment requirements, we sign with the local wallet, * retry once with X-PAYMENT. * * Used by: * - panel server (renew button, buy flow, refresh button) * - phone cache refresh (background) * - future Phone/Call tools surfaced to the agent */ import { type Chain } from '../config.js'; import { type PhoneNumberRecord } from './cache.js'; export interface ListNumbersResult { numbers: PhoneNumberRecord[]; count: number; /** $0.001 was paid for this list call. UI can show it. */ paid: number; } /** * Fetch the wallet's owned numbers from BlockRun. Refreshes the local * cache on success so the terminal status bar picks up the same data. */ export declare function listNumbers(opts: { walletAddress: string; }): Promise; export interface RenewResult { phone_number: string; expires_at: string; paid: number; } export declare function renewNumber(phoneNumber: string): Promise; export interface BuyResult { phone_number: string; expires_at: string; chain: Chain; paid: number; } export declare function buyNumber(opts: { country?: string; areaCode?: string; }): Promise; export interface ReleaseResult { released: boolean; phone_number: string; } export declare function releaseNumber(phoneNumber: string): Promise;