get swap info
API details
This API returns market swap pool information. If a market ID is provided, it returns details for that specific market; otherwise, it returns data for all markets.
Query parameters
MarketIdstringOptional
Responses
200
OK
400
Bad Request
401
Unauthorized
403
Forbidden
404
Not Found
500
Internal Server Error
501
Not Implemented
get
GET /v1/markets/swap HTTP/1.1
Host: testnetopenapi.hibit.app
Accept: */*
{
"code": 1,
"message": "text",
"data": {
"items": [
{
"marketId": "text",
"poolAmount": "text",
"poolVolume": "text",
"poolLiquidity": "text"
}
]
}
}
Code example
import { hibitClient } from '@delandlabs/hibit-sdk';
const options = {
network: HibitNetwork.Testnet
};
hibitClient.setOptions(options);
const marketId = 10008n;
const swapInfos = await hibitClient.getMarketsSwapInfo(marketId);
SDK
Source code https://github.com/Deland-Labs/hibit-sdk
Last updated