interface NodeKeyInfo { id: string; keyIndex?: number | null; key: string; userId: string; status: 'active' | 'inactive' | 'expired' | 'closed' | 'listed'; tokenBalance: number; maxTokens: number; createdAt: string; expiresAt?: string; label?: string; paperWork?: string; stackId?: string; stackName?: string; } interface LedgerEntry { id: string; keyId: string; type: 'credit' | 'debit' | 'mint' | 'reward'; amount: number; description: string; createdAt: string; metadata?: Record; } interface PricingInfo { priceUsd: number; priceCents: number; priceSol?: number; tokenAllocation: number; tokenAllocationFormatted: string; currentDay: number; currentEpoch: number; nextHalvingDate: number; daysUntilHalving: number; keysSold: number; saleActive: boolean; saleStartDate: number; } interface MintResult { success: boolean; key?: NodeKeyInfo; transactionId?: string; error?: string; } type PaymentMethod = 'solana' | 'stripe' | 'eth' | 'btc'; /** Every method this UI package knows how to render. Used to filter the * backend-supplied list so unknown/disabled rails never render. */ declare const KNOWN_PAYMENT_METHODS: readonly PaymentMethod[]; /** Presentational metadata for a payment method (label + lucide icon name). * Purely for display; carries no chain config. */ interface PaymentMethodMeta { method: PaymentMethod; label: string; /** Whether the rail is a credit-card (fiat) rail vs a crypto wallet rail. */ kind: 'card' | 'crypto'; } declare const PAYMENT_METHOD_META: Record; interface KeyListing { id: string; keyId: string; keyIndex?: number | null; sellerId: string; askPriceCents: number; currency: string; tokenBalance: number; maxTokens: number; paperWork?: string; stackId?: string; stackName?: string; status: 'active' | 'sold' | 'cancelled'; createdAt: number; } interface ListingResult { listingId: string; keyId: string; askPriceCents: number; currency: string; status: string; } interface DirectTransferResult { keyId: string; fromUserId: string; toUserId: string; transferredAt: number; } type FilingStatus = 'submitted' | 'validated' | 'paid' | 'failed'; type PayoutMethod = 'usdc' | 'stripe'; interface FilingResult { keyId: string; filingId: string; fileHash: string; txSignature?: string; paperAmount: number; status: FilingStatus; beneficiary: string; filedAt: string; payoutMethod?: PayoutMethod; } interface FilingHistoryEntry extends FilingResult { proofPda?: string; memo?: string; } /** A NodeKeyInfo that has a non-empty paperWork payload ready to file. */ type EligibleKey = NodeKeyInfo & { paperWork: string; }; type PayoutAccountMethod = 'stripe' | 'solana'; /** * The user's saved payout config in the context of one stack. * * Stripe Connect is per-(user, stack) — each stack runs its own platform * under its own secret, so a given user has independent connected accounts * across stacks. The `stripe` field reflects the connection for the SCOPE * stack only; query other stacks via `useUserStripeStacks()` or by passing * a different `stackId` to `usePayoutAccount`. * * The Solana wallet is global (one verified address services every stack). * * `method` records the user's preferred rail. The active filing flow * verifies the chosen rail is configured for the key's originating stack * and falls back to a clear error if not. */ interface PayoutAccount { /** Which method is currently configured. `null` when nothing is set up. */ method: PayoutAccountMethod | null; stripe?: { /** acct_*. Masked for display. */ accountIdMasked: string; /** Stripe-reported flags from `accounts.retrieve`. */ chargesEnabled: boolean; payoutsEnabled: boolean; detailsSubmitted: boolean; /** When non-null, the user needs to finish onboarding at this URL. */ pendingOnboardingUrl?: string | null; /** Stack whose Stripe platform credentials are driving this connection. */ stackId: string; updatedAt: string; }; solana?: { addressMasked: string; /** Full address — safe to expose since the proof of control is on the * server (we verified the signature). The client uses this to display. */ address: string; verifiedAt: string; }; } /** * One stack the user has a Stripe Connect account on. Returned by * `useUserStripeStacks()` for the multi-stack settings view. */ interface StripeStackPayout { stackId: string; accountIdMasked: string; chargesEnabled: boolean; payoutsEnabled: boolean; detailsSubmitted: boolean; pendingOnboardingUrl?: string | null; updatedAt: string; } interface CryptoNonceResponse { nonce: string; /** Canonical message the wallet must sign — includes the nonce. */ message: string; expiresAt: string; } interface StripeConnectStartResponse { accountIdMasked: string; /** Hosted Stripe AccountLink URL — redirect the user here. */ onboardingUrl: string; } /** * Per-stack payout configuration, as resolved by stacknet from the stack's * config + secrets. Drives the payout-method picker and locks the destination. */ interface StackPayoutCapabilities { stackId: string; stackName: string; stripe: { enabled: boolean; /** Human-readable reason when disabled (rendered as "disabled by {stackName} stack" UX). */ disabledReason?: string; /** Masked / display-only descriptor — never the raw account id. */ destinationLabel?: string; }; usdc: { enabled: boolean; disabledReason?: string; /** Resolved on-chain payout address from the stack config. */ defaultDestination: string; }; } type FilingTrackerStep = 'sent' | 'routed' | 'confirmed' | 'finalized' | 'filed'; type FilingTrackerStatus = 'pending' | 'current' | 'done' | 'failed'; interface FilingTrackerState { id: FilingTrackerStep; label: string; status: FilingTrackerStatus; timestampMs: number | null; detail: string | null; approvalsCount?: number; approvalsThreshold?: number; /** Optional outbound link (Solscan / Stripe dashboard). */ externalUrl?: string; } interface FilingDetail extends FilingResult { payoutMethod: PayoutMethod; /** Server-supplied; not editable from the client. */ memo: string; /** Server-supplied; not editable from the client. USDC raw units (string to avoid bigint loss). */ amountUsdc: string; tokensUsed: string; tracker: FilingTrackerState[]; proofPda?: string; intentHashHex?: string; stripePaymentIntentId?: string; failureReason?: string; /** * The Solana wallet recorded as the intent's beneficiary on-chain. For * usdc filings this matches `beneficiary`; for stripe filings the * `beneficiary` is the off-chain Stripe account id and this is the * wallet the resolver uses to look up the credentials mapping. */ onchainBeneficiary?: string; } type Platform = 'ios' | 'android' | 'windows' | 'mac' | 'linux'; interface PlatformDownload { platform: Platform; label: string; url: string; compatible: boolean; } type KeyWidgetTab = 'buy' | 'use' | 'keys'; interface KeyUtilsConfig { apiBaseUrl: string; stackId?: string; stackName?: string; paymentMethods?: PaymentMethod[]; merchantWallet?: string; protocolTreasuryWallet?: string; protocolFeeBps?: number; stripePublicKey?: string; theme?: 'light' | 'dark' | 'system'; maxQuantity?: number; keyImage?: string; keyImageClass?: string; aispImage?: string; termsUrl?: string; solanaRpcUrl?: string; } interface KeyUtilsCallbacks { onMintSuccess?: (result: MintResult) => void; onMintError?: (error: Error) => void; onPaymentStart?: (method: PaymentMethod) => void; onPaymentComplete?: (method: PaymentMethod, transactionId: string) => void; onListingCreated?: (listing: ListingResult) => void; onTransferComplete?: (result: DirectTransferResult) => void; onFilingComplete?: (result: FilingResult) => void; onFilingError?: (error: Error) => void; } export { type CryptoNonceResponse, type DirectTransferResult, type EligibleKey, type FilingDetail, type FilingHistoryEntry, type FilingResult, type FilingStatus, type FilingTrackerState, type FilingTrackerStatus, type FilingTrackerStep, KNOWN_PAYMENT_METHODS, type KeyListing, type KeyUtilsCallbacks, type KeyUtilsConfig, type KeyWidgetTab, type LedgerEntry, type ListingResult, type MintResult, type NodeKeyInfo, PAYMENT_METHOD_META, type PaymentMethod, type PaymentMethodMeta, type PayoutAccount, type PayoutAccountMethod, type PayoutMethod, type Platform, type PlatformDownload, type PricingInfo, type StackPayoutCapabilities, type StripeConnectStartResponse, type StripeStackPayout };