Configuration
Initialization
The SDK has two initialization modes:
Read-only (public data)
typescript
const sdk = new HundredX({ brokerId: 1 });Full access (trading + deposits)
typescript
const sdk = await HundredX.create({
privateKey: process.env.PRIVATE_KEY!,
brokerId: 1,
});HundredX.create() automatically registers a session key with the backend and configures all authenticated operations.
Available Operations
| Initialization | Available operations |
|---|---|
new HundredX({ brokerId }) | Markets, funding rates, WebSocket streams |
HundredX.create({ privateKey, brokerId }) | + Orders, positions, deposits, withdrawals, balance queries |
Instance Properties
After HundredX.create(), the following properties are available:
| Property | Type | Description |
|---|---|---|
sdk.ethAddress | string | Your ETH address (derived from private key) |
sdk.signingAddress | string | Signing key public address |
sdk.subaccountId | string | Subaccount ID (e.g., "1_0xABC..._1") |
With logging
typescript
import { HundredX, LogLevel } from '100x-sdk';
const sdk = new HundredX({
brokerId: 1,
logLevel: LogLevel.DEBUG,
});Log Levels
NODE_ENV | Default Level |
|---|---|
development | DEBUG |
production | NONE |
test | WARN |
| (not set) | INFO |
Override with the logLevel config option:
typescript
import { LogLevel } from '100x-sdk';
// Available levels: DEBUG, INFO, WARN, ERROR, NONEValidation
| Field | Validation | Error |
|---|---|---|
brokerId | Must be provided | AuthenticationError |
privateKey | 64 hex characters (with or without 0x prefix) | AuthenticationError |
Base URL
The SDK connects to https://api.hundred.exchange by default. WebSocket connections are derived automatically (wss://api.hundred.exchange/ws/v1).