import { CaatingaArtifacts } from '@caatinga/core/browser'; interface CaatingaNetwork { name: string; rpcUrl: string; networkPassphrase: string; } /** * Wallet integration for browser-side signing. * * Implementations must reject the returned promise when the user dismisses or * cancels signing (do not leave the promise pending indefinitely). Adapters may * apply their own timeout. Caatinga optionally enforces {@link CaatingaClientConfig.walletTimeout}. */ interface CaatingaWalletAdapter { getPublicKey(): Promise; signTransaction(input: { xdr: string; networkPassphrase: string; }): Promise; } interface CaatingaContractRegistration { binding: unknown; contractId?: string; } interface CaatingaClientConfig { network: CaatingaNetwork; artifacts: CaatingaArtifacts; wallet: CaatingaWalletAdapter; /** Optional timeout (ms) for wallet `getPublicKey` and `signTransaction`. No default when omitted. */ walletTimeout?: number; contracts: Record; } type CaatingaInvokeStatus = "built" | "prepared" | "signed" | "submitted" | "confirmed" | "failed"; interface CaatingaInvokeOptions { debugXdr?: boolean; debugRaw?: boolean; } interface CaatingaInvokeResult { status: CaatingaInvokeStatus; contract: string; method: string; contractId: string; transactionHash?: string; result?: T; xdr?: { unsigned?: string; prepared?: string; signed?: string; }; raw?: unknown; } interface CaatingaXdrBuildResult { contract: string; method: string; contractId: string; unsignedXdr?: string; preparedXdr: string; raw?: unknown; } interface CaatingaBindingAdapter { createClient(input: { contractId: string; publicKey: string; rpcUrl: string; networkPassphrase: string; }): unknown; callMethod(input: { client: unknown; method: string; args?: Record; }): Promise; } export type { CaatingaWalletAdapter as C, CaatingaBindingAdapter as a, CaatingaClientConfig as b, CaatingaContractRegistration as c, CaatingaXdrBuildResult as d, CaatingaInvokeOptions as e, CaatingaInvokeResult as f, CaatingaInvokeStatus as g, CaatingaNetwork as h };