Hercle
WebSocket

Get Withdrawals

Returns an array of the user's withdrawals with a 30 days limit.

Auth:API Key
Tags:
Funding
Withdrawals
Command Name
GetWithdrawals

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('GetWithdrawals', 'my-client-123')

Response Event

Event Name
executionEvents
Subject
account.withdrawals.snapshot
FieldTypeDescription
idstringWithdraw ID
clientIdstringClient ID
userIdstringUser ID
namestringUser first name
surnamestringUser last name
companystringUser company
descriptionstring | nullDescription
destinationstringDestination address
destinationParamsobjectDestination parameters, as key-value strings; {} when there are none. Keys depend on the asset and network, e.g. tag (XRP destination tag) or sortcode (GBP Faster Payments).
networkstringNetwork name
amountnumberWithdraw amount
assetstringAsset name
feenumberFee
statusstring
Withdrawal status
CREATED→ Created
CONFIRMING→ Confirming
CONFIRMED→ Confirmed
refIdstringCro or Trx Id added after network submission
isInstantbooleanOption for instant withdraw
timestampstringTimestamp of the withdraw

Example Response

{
  "data": [
    {
      "id": "withdraw-123",
      "clientId": "68925acb-4f03-48ab-98a9-16b845f21017",
      "userId": "user-456",
      "name": "Mario",
      "surname": "Rossi",
      "company": "Company",
      "description": null,
      "destination": "zzzz",
      "destinationParams": {},
      "network": "Ethereum",
      "amount": 0.05,
      "asset": "ETH",
      "fee": 5,
      "status": "CONFIRMING",
      "refId": "ab1234",
      "isInstant": false,
      "timestamp": "2023-11-10T15:26:10.586Z"
    }
  ]
}

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('GetWithdrawals', "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.