import { PricingInfo, NodeKeyInfo, LedgerEntry, PaymentMethod, MintResult, ListingResult, DirectTransferResult, PayoutMethod, FilingResult, FilingHistoryEntry, StackPayoutCapabilities, FilingDetail, PayoutAccount, StripeStackPayout } from '../types/index.js'; interface UsePricingReturn { pricing: PricingInfo | null; loading: boolean; error: string | null; refresh: () => Promise; } declare function usePricing(): UsePricingReturn; interface UseKeysReturn { keys: NodeKeyInfo[]; totalBalance: number; loading: boolean; error: string | null; refresh: () => Promise; } declare function useKeys(): UseKeysReturn; interface UseKeyLedgerReturn { entries: LedgerEntry[]; loading: boolean; error: string | null; refresh: () => Promise; } declare function useKeyLedger(keyId: string | null): UseKeyLedgerReturn; interface UseMintKeyReturn { mint: (paymentMethod: PaymentMethod, transactionId: string, quantity?: number) => Promise; minting: boolean; result: MintResult | null; error: string | null; } declare function useMintKey(): UseMintKeyReturn; interface UseListKeyReturn { listKey: (keyId: string, askPriceCents: number) => Promise; delistKey: (keyId: string) => Promise; listing: boolean; result: ListingResult | null; error: string | null; } declare function useListKey(): UseListKeyReturn; interface UseStripeCheckoutReturn { createSession: (priceCents: number, quantity: number) => Promise; loading: boolean; error: string | null; } declare function useStripeCheckout(): UseStripeCheckoutReturn; interface UseSolanaPaymentReturn { pay: (amountSol: number) => Promise; processing: boolean; error: string | null; } /** * Hook for programmatic SOL payments. * Builds a SOL transfer transaction with protocol fee splitting, * signs via connected Phantom wallet, and returns the tx signature. * * Uses merchantWallet and protocolTreasuryWallet from KeyUtilsConfig. */ declare function useSolanaPayment(): UseSolanaPaymentReturn; interface UseTransferKeyReturn { transferKey: (keyId: string, recipientId: string) => Promise; transferring: boolean; result: DirectTransferResult | null; error: string | null; } declare function useTransferKey(): UseTransferKeyReturn; interface UseFilePaperworkReturn { filePaperwork: (keyId: string, payoutMethod?: PayoutMethod | null) => Promise; filing: boolean; result: FilingResult | null; error: string | null; reset: () => void; } /** * File paperwork against an eligible NodeKey to redeem Paper. * * Backend contract: POST {apiBaseUrl}/api/keys/{keyId}/file * Request body: { stackId?, payoutMethod? } * - On stacknet versions that read from `user_payout_accounts`, the body * can omit everything user-controlled — the server derives the method * and destination from the user's saved earnings account. * - For backward compatibility with stacknet versions that still REQUIRE * `payoutMethod` in the body, callers can pass the method they read * from `usePayoutAccount()`. The server (new path) verifies the hint * matches the saved record and rejects mismatches with 400. * - Memo, amount, beneficiary are always server-derived. * Response: FilingResult JSON with `filingId` (used to look up the detail / * tracker view at /files/{filingId}). */ declare function useFilePaperwork(): UseFilePaperworkReturn; interface UseFilingHistoryReturn { entries: FilingHistoryEntry[]; loading: boolean; error: string | null; refresh: () => Promise; } /** * Fetch the current user's filing history (paperwork that has been filed). * * Backend contract: GET {apiBaseUrl}/api/keys/filings * Response: { filings: FilingHistoryEntry[] } | FilingHistoryEntry[] */ declare function useFilingHistory(): UseFilingHistoryReturn; interface UseStackPayoutCapabilitiesReturn { caps: StackPayoutCapabilities | null; loading: boolean; error: string | null; refresh: () => Promise; } /** * Fetch per-stack payout capabilities (which methods are configured + the * default destination address). Drives the payout-method picker — Stripe * tile is rendered disabled with "disabled by {stackName} stack" UX when * `caps.stripe.enabled === false`. * * Backend contract: GET {apiBaseUrl}/api/stacks/{stackId}/payout-capabilities * * Falls back gracefully when no stackId is configured — returns null caps. */ declare function useStackPayoutCapabilities(stackIdOverride?: string): UseStackPayoutCapabilitiesReturn; interface UseFilingDetailReturn { detail: FilingDetail | null; loading: boolean; error: string | null; refresh: () => Promise; } /** * Fetch a single filing's detail (status, tracker, tx sigs, etc.) and poll * every 5 s while non-terminal. Stops polling once status is `paid` or * `failed`. Used by both the inline post-submit tracker and the standalone * /files/{id} route. * * Backend contract: GET {apiBaseUrl}/api/keys/filings/{filingId} */ declare function useFilingDetail(filingId: string | null | undefined): UseFilingDetailReturn; interface UsePayoutAccountReturn { account: PayoutAccount | null; loading: boolean; error: string | null; refresh: () => Promise; /** * Disconnect the payout config. With no argument, disconnects everything * (Solana wallet + every Stripe stack). Pass a stackId to remove only the * Stripe Connect record for that stack while preserving the Solana wallet * and any other stacks' Stripe connections. */ disconnect: (stackId?: string) => Promise; disconnecting: boolean; } /** * Read + manage the user's payout config in the context of one stack. * * Stripe Connect is per-(user, stack) — each stack runs its own Stripe * platform, so the user has an independent connected account per stack * they file for. The Solana wallet is global (one address services every * stack). The returned `PayoutAccount` exposes both rails: `stripe` is the * connected account for `stackId` (if any), `solana` is the user-level * wallet (if verified). * * Backend contract: * GET {apiBaseUrl}/api/payout?stackId=stk_… → PayoutAccount * DELETE {apiBaseUrl}/api/payout → 204 (everything) * DELETE {apiBaseUrl}/api/payout?stackId=stk_… → 204 (this stripe only) */ declare function usePayoutAccount(stackIdOverride?: string): UsePayoutAccountReturn; interface UseUserStripeStacksReturn { stacks: StripeStackPayout[]; loading: boolean; error: string | null; refresh: () => Promise; } /** * List every stack the user has a Stripe Connect account on. * * Stripe Connect is per-(user, stack) — each stack runs its own platform — * so a multi-stack user has multiple connected accounts. This hook drives * the settings-page list view ("Stack A: payouts ✓, Stack B: pending…"). * * Backend contract: GET {apiBaseUrl}/api/payout/stripe-stacks * response: { stacks: StripeStackPayout[] } */ declare function useUserStripeStacks(): UseUserStripeStacksReturn; interface UseStripeConnectReturn { /** * Kick off Stripe Connect Express onboarding. Server creates an Express * connected account under the stack's platform Stripe credentials, * generates an AccountLink, and returns its URL. The browser is then * redirected to that URL — Stripe hosts the rest of the onboarding flow * (KYC, bank details, payouts opt-in) and bounces back to * `/settings?tab=account&stripe_return=1` when complete. */ startStripeConnect: () => Promise; starting: boolean; error: string | null; } /** * Stripe Connect is per-(user, stack) — each stack runs its own platform * under its own secret. Pass `stackIdOverride` to onboard against a stack * other than the provider's default; this is what callers use when filing * a key whose originating stack isn't the same as the host app's stack. * * Backend contract: POST {apiBaseUrl}/api/payout/stripe/start * body: { stackId } * response: StripeConnectStartResponse */ declare function useStripeConnect(stackIdOverride?: string): UseStripeConnectReturn; interface UseCryptoConnectReturn { /** * Connect Phantom, request a nonce from the server, sign it, and POST the * signature back for verification. On success the server saves the address * as the user's payout destination. */ connectAndVerify: () => Promise<{ address: string; } | null>; connecting: boolean; error: string | null; } declare function useCryptoConnect(): UseCryptoConnectReturn; export { useCryptoConnect, useFilePaperwork, useFilingDetail, useFilingHistory, useKeyLedger, useKeys, useListKey, useMintKey, usePayoutAccount, usePricing, useSolanaPayment, useStackPayoutCapabilities, useStripeCheckout, useStripeConnect, useTransferKey, useUserStripeStacks };