Endpoint: https://rpc.spectre.exchange
Blocks
spectre_blockNumber
Returns the height of the most recent block.
Returns: string (Hex, e.g., “0x1a4”)
spectre_getBlockByNumber
Fetch a block by its height.
Parameters:
block_number(string): Hex string, “latest”, or “earliest”.full_transactions(boolean): Iftrue, returns full transaction objects. Iffalse, returns only hashes.
spectre_getBlockByHash
Fetch a block by its hash.
Parameters:
block_hash(string): The 32-byte block hash.full_transactions(boolean)
Transactions
spectre_getTransactionByHash
Get details of a specific transaction.
Parameters:
tx_hash(string)
hash,blockNumber,market,type(LIMIT, MARKET, etc.),price,quantity,timestamp.
spectre_getTransactionsByMarket
Get a list of recent transactions for a specific market (e.g., Trade History).
Parameters:
market(string): e.g., “BTC-USDC”limit(int): default 100offset(int): default 0sort(string): “desc” or “asc”
spectre_getTransactionsByType
Filter transactions by their type across the network or for a specific market.
Parameters:
market(string, optional)tx_type(string, optional): “TRADE”, “CLOSE_POSITION”, “OPEN_POSITION”limit,offset,sort
Market Statistics & Charts
spectre_getOHLC
Get candlestick data formatted for charts (TradingView).
Parameters:
market(string): “BTC-USDC”timeframe(string): “1m”, “5m”, “15m”, “1h”, “4h”, “1d”start(int, optional): Start timestamp (ms)end(int, optional): End timestamp (ms)limit(int): Max candles
{ time, open, high, low, close, volume }
spectre_getStatistics
Get 24-hour rolling statistics.
Parameters:
market(string)
high,low,volume,last_price,price_change_percent.
spectre_getPositions
Get all currently open positions.
Parameters:
market(string, optional)