import { NodeKeyInfo, LedgerEntry, PricingInfo, PaymentMethod, MintResult, ListingResult, DirectTransferResult } from '../types/index.cjs'; /** * Optional header provider for auth and CSRF. * On web, cookies handle auth automatically — pass csrfHeaders for mutations. * On native, pass the auth client's getHeaders for Bearer token injection. */ type HeaderProvider = () => Promise> | Record; interface KeyClientConfig { /** API base URL (e.g. http://localhost:3000 or https://app.example.com) */ apiBaseUrl: string; /** Stack identifier */ stackId?: string; stackName?: string; /** Provides auth + CSRF headers for requests */ getHeaders?: HeaderProvider; } interface KeyClient { /** Fetch all keys for the authenticated user */ getKeys(): Promise; /** Fetch ledger entries for a specific key */ getLedger(keyId: string): Promise; /** Fetch current pricing info */ getPricing(): Promise; /** Mint a new key after payment */ mint(paymentMethod: PaymentMethod, transactionId: string, quantity?: number): Promise; /** List a key on the marketplace */ listKey(keyId: string, askPriceCents: number): Promise; /** Delist a key from the marketplace */ delistKey(keyId: string): Promise; /** Transfer a key to another user */ transferKey(keyId: string, recipientId: string): Promise; /** Create a Stripe checkout session */ createStripeSession(priceCents: number, quantity: number, referrerUrl: string): Promise<{ url: string; }>; } /** * Platform-agnostic key client. * * Extracts all HTTP logic from React hooks so it can be used from * any environment (React Native, Node, tests, etc.). * * Usage: * const keys = createKeyClient({ * apiBaseUrl: 'https://app.example.com', * getHeaders: () => auth.getHeaders(), // inject auth * }); * const myKeys = await keys.getKeys(); */ declare function createKeyClient(config: KeyClientConfig): KeyClient; export { type HeaderProvider, type KeyClient, type KeyClientConfig, createKeyClient };