Info API
The Info API handles all read operations — fetching orders, positions, market data, and account info.
Access via sdk.info.
Order Queries
INFO
Order queries require authentication. Use HundredX.create() to initialize an authenticated SDK.
getOrders()
Get all orders for the authenticated subaccount.
const result = await sdk.info.getOrders();
console.log('Orders:', result.orders);Returns: GetOrdersResponse
{
orders: [
{
id: 12345,
subaccountId: '1_0xABC..._1',
brokerId: 1,
marketType: 'PERPETUAL',
marketSymbol: 'ETH-USD',
type: 'LIMIT',
side: 'BUY',
amountx18: '1000000000000000000',
totalFilledx18: '0',
pricex18: '2500000000000000000000',
expiryTs: 1700000000000,
status: 'OPEN',
createdAt: '2024-01-01T00:00:00Z',
updatedAt: '2024-01-01T00:00:00Z',
}
]
}getOrder()
Get a specific order by ID.
const order = await sdk.info.getOrder(12345);Parameters:
| Parameter | Type | Description |
|---|---|---|
orderId | number | Order ID |
Returns: OrderResponse
User Queries
INFO
User queries require authentication. Use HundredX.create() to initialize an authenticated SDK.
getPositions()
Get all open positions and trade history.
const result = await sdk.info.getPositions();
for (const pos of result.positions) {
console.log(`Product ${pos.productID}: amount=${pos.vBalanceAmount}, leverage=${pos.leverage}`);
}
for (const trade of result.tradeHistory) {
console.log(`${trade.type}: ${trade.amountx18} @ ${trade.pricex18}, pnl=${trade.pnl}`);
}Returns: PositionsResponse
{
positions: [
{
productID: 1,
vQuoteBalance: '2500000000000000000000',
vBalanceAmount: '1000000000000000000',
leverage: 5,
InitialMarginFraction: '0.1',
MaintenanceMarginFraction: '0.05',
}
],
tradeHistory: [
{
productId: 1,
type: 'BUY',
amountx18: '1000000000000000000',
pricex18: '2500000000000000000000',
timestamp: 1700000000,
feex18: '2500000000000000',
pnl: '0',
feebonusx18: '0',
isLiquidation: false,
}
]
}getUserOrders()
Get open orders for the authenticated subaccount (from the user endpoint).
const result = await sdk.info.getUserOrders();
for (const order of result.orders) {
console.log(`[${order.OrderType}] ${order.operation} product=${order.productID}: ${order.amountx18} @ ${order.pricex18}`);
}Returns: UserOrdersResponse
{
orders: [
{
orderID: 12345,
productID: 1,
pricex18: '2500000000000000000000',
amountx18: '1000000000000000000',
operation: 'BUY',
OrderType: 'LIMIT',
filledAmountx18: '0',
isTPSL: false,
isReduce: false,
}
]
}getBuyingPower()
Get total buying power for the authenticated subaccount.
const result = await sdk.info.getBuyingPower();
console.log('Buying power:', result.totalBuyingPower);Returns: BuyingPowerResponse
{ totalBuyingPower: '50000000000000000000000' }getDeposits()
Get deposit history.
const result = await sdk.info.getDeposits();Returns: DepositsResponse — { deposits: DepositRecord[] }
getWithdrawals()
Get withdrawal history.
const result = await sdk.info.getWithdrawals();Returns: WithdrawalsResponse — { withdrawals: WithdrawalRecord[] }
getWithdrawableBalance()
Get withdrawable token balances by product ID.
const result = await sdk.info.getWithdrawableBalance();Returns: WithdrawableBalanceResponse — { withdrawableBalance: Record<string, string> }
getNonce()
Get the current sequential nonce for deposit/withdraw operations.
const nonce = await sdk.info.getNonce(sdk.subaccountId!);Parameters:
| Parameter | Type | Description |
|---|---|---|
subaccountId | string | Subaccount ID (e.g., "1_0xABC..._1") |
Returns: number — the current nonce value
Market Data (Public)
These endpoints do not require any credentials.
getMarkets()
Get all available markets.
const result = await sdk.info.getMarkets();
const perpetuals = await sdk.info.getMarkets('PERPETUAL');Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
type | MarketType | No | Filter by "SPOT" or "PERPETUAL" |
Returns: MarketsResponse — { markets: Market[] }
getMarketById()
Get a specific market by ID.
const result = await sdk.info.getMarketById(1);
console.log(result.market.Symbol); // 'ETH-USD'Returns: MarketByIdResponse — { market: Market }
getFundingRate()
Get the current funding rate for a market symbol.
const result = await sdk.info.getFundingRate('ETH-USD');
console.log('Funding rate:', result.fundingRateX18);Returns: FundingRate — { fundingRateX18: number }
getFundingRates()
Get funding rates for all active markets.
const result = await sdk.info.getFundingRates();
for (const rate of result.rates) {
console.log(`${rate.Symbol}: ${rate.Funding.fundingRate}`);
}Returns: FundingRatesResponse — { rates: FundingRateData[] }