Hercle
WebSocket

Get Transactions Paginated

Retrieves a paginated list of transactions within a 7 days range.

Auth:API Key
Tags:
Trading
Command Name
GetTransactionsPaginated

Command Arguments

ClientId
Required
Type:
string
Description:

Custom client ID for tracking (max 36 characters)

Example: "my-order-123"
StartDate
Required
Type:
string
Description:

Start date for the orders retrieval (ISO 8601 format)

Example: "2024-04-20T00:00:00Z"
EndDate
Required
Type:
string
Description:

End date for the orders retrieval (ISO 8601 format)

Example: "2024-04-27T00:00:00Z"
Page
Required
Type:
number
Description:

Page number for pagination (starting from 0)

0
PageSize
Required
Type:
number
Description:

Number of orders per page for pagination (min: 5, max: 50)

Example: 5

Command Invocation

Command Arguments Example:
[
  "my-client-123",
  "2024-04-20T00:00:00Z",
  "2024-04-27T00:00:00Z",
  0,
  5
]
Invocation Example:
connection.invoke('GetTransactionsPaginated', 'my-client-123', '2024-04-20T00:00:00Z', '2024-04-27T00:00:00Z', 0, 5)

Response Event

Event Name
executionEvents
Subject
account.transactions.snapshot
FieldTypeDescription
idstringUnique identifier for the transaction
userIdstringIdentifier of the user associated with the transaction
sequencenumberSequence number of the transaction
typenumber
Type of transaction
0Deposit
1Withdrawal
2Trade Fee
assetstringAsset involved in the transaction
amountnumberAmount of the asset transacted
timestampstringTimestamp of when the transaction occurred (ISO 8601 format)

Example Response

{
  "data": [
    {
      "id": "txn_123456789",
      "userId": "user_987654321",
      "sequence": 1001,
      "type": 0,
      "asset": "BTC",
      "amount": 0.5,
      "timestamp": "2024-04-21T10:15:30Z"
    }
  ]
}

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('GetTransactionsPaginated', "my-client-123", "2024-04-20T00:00:00Z", "2024-04-27T00:00:00Z", 0, 5)
      .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.