Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@irresi
Copy link
Contributor

@irresi irresi commented Oct 25, 2025

This commit migrates Bithumb to its new private WebSocket system, enabling support for real-time private data feeds.

The implementation includes:

  • watchBalance and handleBalance for streaming user balances.
  • watchOrders and handleOrders for streaming user orders.
  • A new authenticate method to handle the required authentication flow.

Authentication is performed by generating a JWT token (HMAC-SHA256) using the apiKey, nonce, and timestamp. This token is then passed in the authorization header during the initial WebSocket connection handshake, aligning with the exchange's specification.

#26971

This commit migrates Bithumb to its new private WebSocket system, enabling support for real-time private data feeds.

The implementation includes:
- `watchBalance` and `handleBalance` for streaming user balances.
- `watchOrders` and `handleOrders` for streaming user orders.
- A new `authenticate` method to handle the required authentication flow.

Authentication is performed by generating a JWT token (HMAC-SHA256) using the `apiKey`, `nonce`, and `timestamp`. This token is then passed in the `authorization` header during the initial WebSocket connection handshake, aligning with the exchange's new specification.

Closes: ccxt#26971
@irresi irresi closed this Oct 25, 2025
@irresi irresi reopened this Oct 25, 2025
@irresi
Copy link
Contributor Author

irresi commented Oct 25, 2025

Tested by real transaction.

Output for watchBalance

{
  "KRW": {
    "free": 9308.56,
    "used": 0,
    "total": 9308.56
  },
  "info": {
    "type": "myAsset",
    "assets": [
      {
        "currency": "KRW",
        "balance": "9308.56",
        "locked": "0"
      }
    ],
    "asset_timestamp": 1761407594693,
    "timestamp": 1761407594696,
    "stream_type": "REALTIME"
  },
  "timestamp": 1761407594696,
  "datetime": "2025-10-25T15:53:14.696Z",
  "free": {
    "KRW": 9308.56
  },
  "used": {
    "KRW": 0
  },
  "total": {
    "KRW": 9308.56
  }
}

Output for watchOrders

[
  {
    "info": {
      "type": "myOrder",
      "code": "KRW-BTC",
      "uuid": "C0101000002528135742",
      "ask_bid": "ASK",
      "order_type": "limit",
      "state": "cancel",
      "trade_uuid": null,
      "price": 207598000,
      "volume": 0.00004433,
      "remaining_volume": 0.00004433,
      "executed_volume": 0,
      "trades_count": 0,
      "reserved_fee": 0,
      "remaining_fee": 0,
      "paid_fee": 0,
      "executed_funds": 0,
      "trade_timestamp": null,
      "order_timestamp": 1761411220517,
      "timestamp": 1761411248998,
      "stream_type": "REALTIME"
    },
    "id": "C0101000002528135742",
    "timestamp": 1761411220517,
    "datetime": "2025-10-25T16:53:40.517Z",
    "symbol": "KRW-BTC",
    "type": "limit",
    "side": "sell",
    "price": 207598000,
    "amount": 0.00004433,
    "cost": 0,
    "filled": 0,
    "remaining": 0.00004433,
    "status": "canceled",
    "fee": {
      "cost": "0"
    },
    "trades": [],
    "fees": [
      {
        "cost": 0
      }
    ]
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant