Harbor SDK
market
Leia os mercados em rt.market. Preços e quantidades são strings. Converta-os antes de comparar. Os timestamps são milissegundos.
| Método | Argumentos | Retorno |
|---|---|---|
| getTicker | symbol | last, bid, ask, timestamp |
| getKlines | symbol, timeframe, limit | time, open, high, low, close, volume |
| getOrderBook | symbol, limit opcional | bids e asks, cada nível [price, amount] |
| getTrades | symbol, limit opcional | price, amount, side, timestamp |
| getFundingRate | symbol | rate e timestamp, ou null quando não há funding |
| getFundingHistory | symbol, limit | as linhas de funding mais recentes |
| getSymbols | nenhum | símbolos que esta instância pode usar |
| getSocial | symbol, limit | time, galaxyScore, altRank, sentiment, posts |
| getServerTime | nenhum | hora do servidor da plataforma em milissegundos |
timeframe usa valores comuns de exchange, como 1m, 5m, 1h e 1d. getSocial devolve apenas pontos já armazenados. O array fica vazio quando nada está armazenado. Os métodos de funding são para perpétuos. Não os chame com um símbolo spot.
const bars = await rt.market.getKlines(symbol, "1h", 50); const funding = await rt.market.getFundingRate(symbol);
