Hercle
WebSocket

Get Available Pairs

Retrieves a list of supported tradable pairs along with their minimum and maximum sizes.

Auth:API Key
Tags:
General Methods
Command Name
GetPairs

Command Arguments

ClientId
Required
Type:
string
Description:

Custom client ID for tracking (max 36 characters)

Example: "my-client-123"

Command Invocation

Command Arguments Example:
[
  "my-client-123"
]
Invocation Example:
connection.invoke('GetPairs', ['my-client-123'])

Response Event

Event Name
executionEvents
Subject
execution.pairs
FieldTypeDescription
namestringTrading pair name
assetstringBase asset
currencystringAsset currency
minSizenumberMinimum trade size for the pair
minQuoteSizenumberMinimum quote size for the pair
maxSizenumberMaximum trade size for the pair
maxQuoteSizenumberMaximum quote size for the pair

Example Response

{
  "data": [
    {
      "name": "BTCUSDT",
      "asset": "BTC",
      "currency": "USDT",
      "minSize": 0.0001,
      "minQuoteSize": 5,
      "maxSize": 100,
      "maxQuoteSize": 1000000
    },
    {
      "name": "ETHUSDT",
      "asset": "ETH",
      "currency": "USDT",
      "minSize": 0.001,
      "minQuoteSize": 5,
      "maxSize": 1000,
      "maxQuoteSize": 1000000
    }
  ]
}

Code Examples

const signalR = require('@microsoft/signalr');

const apiKey = 'YOUR_API_KEY_HERE';
const connection = new signalR.HubConnectionBuilder()
  .withUrl('https://publicapi.sandbox.hercle.financial/ExecutionLiveServer/v1', {
    accessTokenFactory: () => apiKey,
  })
  .build();

connection.start()
  .then(() => {
    console.log('Connected to WebSocket');
    
    // Invoke command
    connection.invoke('GetPairs', "my-client-123")
      .then(() => {
        console.log('Command sent successfully');
      })
      .catch(err => {
        console.error('Command failed:', err);
      });
  })
  .catch(err => {
    console.error('Connection failed:', err);
  });

// Listen for events
connection.on('executionEvents', (data) => {
  console.log('Received event:', data);
});

SignalR API Tester

Test this command in the sandbox environment

Disconnected

Your API key is only used locally and never stored

Event Log

No events yet. Connect and invoke a command to see events.