Function listExchanges

  • Returns a list of all registered exchange schemas.

    Retrieves all exchanges that have been registered via addExchange(). Useful for debugging, documentation, or building dynamic UIs.

    Returns Promise<IExchangeSchema[]>

    Array of exchange schemas with their configurations

    import { listExchanges, addExchange } from "backtest-kit";

    addExchange({
    exchangeName: "binance",
    note: "Binance cryptocurrency exchange",
    getCandles: async (symbol, interval, since, limit) => [...],
    formatPrice: async (symbol, price) => price.toFixed(2),
    formatQuantity: async (symbol, quantity) => quantity.toFixed(8),
    });

    const exchanges = listExchanges();
    console.log(exchanges);
    // [{ exchangeName: "binance", note: "Binance cryptocurrency exchange", ... }]