Hercle
WebSocket

Create Instant Withdrawal

Sends an instant withdrawal request.

Auth:API Key
Tags:
Funding
Withdrawals
Command Name
WithdrawInstantFunds

Command Arguments

ClientId
Required
Type:
string
Description:

Custom client ID for tracking (max 36 characters)

Example: "my-client-123"
Asset
Required
Type:
string
Description:

Asset of the address (e.g.: "BTC" or "EUR")

Example: "USDT"
Amount
Required
Type:
number
Description:

Quantity of asset to be withdrawn

Example: 100
DestinationAddress
Required
Type:
string
Description:

Destination address, must be whitelisted

Example: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
Network
Required
Type:
string
Description:

Network of the address

Example: "Ethereum"

Command Invocation

Command Arguments Example:
[
  "my-client-123",
  "USDT",
  100,
  "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "Ethereum"
]
Invocation Example:
connection.invoke('WithdrawInstantFunds', 'my-client-123', 'USDT', 100.0, '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb', 'Ethereum')

Response Event

Event Name
executionEvents
Subject
account.withdraw.created
FieldTypeDescription
idstringWithdraw ID
clientIdstringClient ID
userIdstringUser ID
namestringUser first name
surnamestringUser last name
companystringCompany name
descriptionstringDescription
destinationstringDestination address
destinationParamsobjectDestination parameters
networkstringDestination address network
amountnumberAmount to be withdrawn
assetstringAsset name
feenumberFee
statusstring
Withdrawal status
CREATEDCreated
CONFIRMINGConfirming
CONFIRMEDConfirmed
refIdstringCro or Trx Id added after network submission
isInstantbooleanOption for instant withdraw (always true for this command)
timestampstringTimestamp of the withdraw

Example Response

{
  "data": {
    "id": "xxxx",
    "clientId": "68925acb-4f03-48ab-98a9-16b845f21017",
    "userId": "yyyy",
    "name": "Marco",
    "surname": "Rossi",
    "company": "",
    "description": "xyz",
    "destination": "xyzwallet",
    "destinationParams": {},
    "network": "ethereum",
    "amount": 1,
    "asset": "USDT",
    "fee": 5,
    "status": "CONFIRMING",
    "refId": "ab1234",
    "isInstant": true,
    "timestamp": "2024-03-27T16:03:12.456Z"
  }
}

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('WithdrawInstantFunds', "my-client-123", "USDT", 100, "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb", "Ethereum")
      .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.