import type { StellarCoinConfig, StellarContext } from '../config'; import type { NetworkInfo, RawOperation, Signer } from '../types'; import type { Operation, Page } from '@ledgerhq/coin-module-framework/api/types'; import type { CacheRes } from '@ledgerhq/live-network/cache'; import { Horizon } from '@stellar/stellar-sdk'; import { NetworkCongestionLevel } from '../types'; /** * Register logging and URL-fix interceptors on Horizon.AxiosClient. * Must be called once after a context is available (i.e. inside createApi). * * Logging is gated on context.config().enableNetworkLogs (driven by the ENABLE_NETWORK_LOGS env var). * Horizon.AxiosClient uses feaxios internally, so we type the callbacks via the inferred * InterceptorManager types rather than importing live-network's axios-typed interceptors. * * Note: Horizon.AxiosClient is a process-wide singleton, so interceptors are registered only once * and capture the context of the first {@link createApi} call. */ export declare function registerHorizonInterceptors(context: StellarContext): void; export declare function useConfigHostAndProtocol(config: StellarCoinConfig, url: string): string; export declare function getAccountSpendableBalance(config: StellarCoinConfig, balance: BigNumber, account: Horizon.ServerApi.AccountRecord): Promise; export declare function fetchBaseFee(config: StellarCoinConfig): Promise<{ baseFee: number; recommendedFee: number; networkCongestionLevel: NetworkCongestionLevel; }>; type NonNativeBalance = Horizon.HorizonApi.BalanceLineAsset | Horizon.HorizonApi.BalanceLineLiquidityPool; /** * Get all account-related data * * @async * @param {string} addr */ export declare function fetchAccount(config: StellarCoinConfig, addr: string): Promise<{ blockHeight: number; balance: BigNumber; spendableBalance: BigNumber; assets: NonNativeBalance[]; }>; /** * Fetch operations for a single account from indexer * * @param {string} accountId * @param {string} addr * @param {string} order - "desc" or "asc" order of returned records * @param {string} cursor - point to start fetching records * @param {number} maxOperations - maximum number of operations to return, stops fetching after reaching this threshold * * @return {Operation[]} */ export declare function fetchAllOperations(config: StellarCoinConfig, accountId: string, addr: string, order: 'asc' | 'desc', cursor?: string, maxOperations?: number): Promise; export declare function fetchOperations(config: StellarCoinConfig, { accountId, addr, minHeight, order, cursor, limit, }: { accountId: string; addr: string; minHeight: number; order: 'asc' | 'desc'; cursor: string | undefined; limit?: number | undefined; }): Promise>; export declare function fetchAccountNetworkInfo(config: StellarCoinConfig, account: string): Promise; export declare function fetchSequence(config: StellarCoinConfig, address: string): Promise; export declare function fetchSigners(config: StellarCoinConfig, account: string): Promise; export declare function broadcastTransaction(context: StellarContext, signedTransaction: string): Promise; export declare function loadAccount(config: StellarCoinConfig, addr: string): Promise; export declare function getLastBlock(config: StellarCoinConfig): Promise<{ height: number; hash: string; time: Date; }>; /** * Loads a single ledger (closed block) by sequence number. * * Horizon `GET /ledgers/{sequence}` returns one ledger resource, not a page with `records`; * do not read `records[0]` from this `.call()` result. * * @throws Error when the ledger does not exist (Horizon 404). */ export declare function fetchLedgerRecord(config: StellarCoinConfig, sequence: number): Promise; /** * Returns all operations included in `ledgerSequence`, ascending, including failed txs, * with joined transaction payloads (same pattern as account operation listing). * * @throws Error when the ledger does not exist (Horizon 404). */ export declare function fetchAllLedgerOperations(config: StellarCoinConfig, ledgerSequence: number): Promise; export declare const getRecipientAccount: CacheRes<[ StellarCoinConfig, { recipient: string; } ], { id: string | null; isMuxedAccount: boolean; assetIds: string[]; } | null>; export {}; //# sourceMappingURL=horizon.d.ts.map