General
Example context
import { createClientConfig, QuoteClient } from '@tigeropenapi/tigeropen';
const config = createClientConfig();
const quoteClient = QuoteClient.fromConfig(config);fromConfig
fromConfigSignature
static fromConfig(config: ClientConfig): QuoteClientPurpose
Creates a client from ClientConfig.
Parameters, defaults, and constraints
| Parameter | Type | Required | SDK default | Constraints |
|---|---|---|---|---|
config | ClientConfig | Yes | None | No client-side validation is declared. |
config.tigerId | string | Yes | None | No client-side validation is declared. |
config.privateKey | string | Yes | None | No client-side validation is declared. |
config.account | string | Yes | None | No client-side validation is declared. |
config.secretKey | string | undefined | No | None | Institution secret key for trade authentication (institution accounts only) |
config.license | string | undefined | No | None | No client-side validation is declared. |
config.language | string | Yes | None | No client-side validation is declared. |
config.timezone | string | undefined | No | None | No client-side validation is declared. |
config.timeout | number | Yes | None | No client-side validation is declared. |
config.token | string | undefined | No | None | No client-side validation is declared. |
config.tokenRefreshDuration | number | undefined | No | None | No client-side validation is declared. |
config.tokenCheckInterval | number | undefined | No | None | Background token check interval in milliseconds; active only when tokenRefreshDuration > 0; default 5 minutes |
config.tokenLoader | Optional function returning a string or a string Promise | No | None | Custom token loader replacing default file loading; see ClientConfig in the signature above for the exact type |
config.tokenWriter | ((token: string) => void) | undefined | No | None | Optional callback after writing a refreshed token |
config.serverUrl | string | Yes | None | No client-side validation is declared. |
config.quoteServerUrl | string | Yes | None | Quote server URL for quote-specific requests; falls back to serverUrl |
config.deviceId | string | Yes | None | Device identifier (auto-detected MAC address) |
config.tigerPublicKey | string | Yes | None | No client-side validation is declared. |
Returns
QuoteClient
Type-checked example
const result = await QuoteClient.fromConfig(config);
console.log(result);Response example
"QuoteClient instance (not an API response payload)"getMarketState
getMarketStateSignature
async getMarketState(market: string): Promise<MarketState[]>Purpose
Gets market state.
Parameters, defaults, and constraints
| Parameter | Type | Required | SDK default | Constraints |
|---|---|---|---|---|
market | string | Yes | None | No client-side validation is declared. |
Returns
Promise<MarketState[]>
| Field | Type | Description |
|---|---|---|
| market | string | Market |
| marketStatus | string | Market status |
| status | string | Trading status |
| openTime | string | Open time |
Type-checked example
const result = await quoteClient.getMarketState('US');
console.log(result);Response example
[
{
"market": "string",
"marketStatus": "string",
"status": "string",
"openTime": "string"
}
]getTradingCalendar
getTradingCalendarSignature
async getTradingCalendar(req: TradingCalendarRequest): Promise<TradingCalendarItem[]>Purpose
Gets trading calendar.
Parameters, defaults, and constraints
| Parameter | Type | Required | SDK default | Constraints |
|---|---|---|---|---|
req | TradingCalendarRequest | Yes | None | No client-side validation is declared. |
req.market | string | undefined | No | None | No client-side validation is declared. |
req.beginDate | string | undefined | No | None | yyyy-MM-dd |
req.endDate | string | undefined | No | None | No client-side validation is declared. |
req.lang | string | undefined | No | None | No client-side validation is declared. |
Returns
Promise<TradingCalendarItem[]>
| Field | Type | Description |
|---|---|---|
| market | string | Market |
| date | string | Date |
| isTrading | boolean | Whether trading day |
| sessionType | string | Session type |
Type-checked example
const result = await quoteClient.getTradingCalendar({ market: 'US', beginDate: '2026-01-01', endDate: '2026-01-31' });
console.log(result);Response example
[
{
"market": "string",
"date": "string",
"isTrading": true,
"sessionType": "string"
}
]grabQuotePermission
grabQuotePermissionSignature
async grabQuotePermission(): Promise<QuotePermission[]>Purpose
Requests market-data access for the current device.
Parameters, defaults, and constraints
No parameters.
Returns
Promise<QuotePermission[]>
| Field | Type | Description |
|---|---|---|
| name | string | Name |
| expireAt | number | Expiration timestamp |
Type-checked example
const result = await quoteClient.grabQuotePermission();
console.log(result);Response example
[
{
"name": "string",
"expireAt": 0
}
]getQuotePermission
getQuotePermissionSignature
async getQuotePermission(req: QuotePermissionRequest): Promise<QuotePermission[]>Purpose
Gets quote permission.
Parameters, defaults, and constraints
| Parameter | Type | Required | SDK default | Constraints |
|---|---|---|---|---|
req | QuotePermissionRequest | Yes | None | No client-side validation is declared. |
req.beginDate | string | undefined | No | None | No client-side validation is declared. |
req.endDate | string | undefined | No | None | No client-side validation is declared. |
req.lang | string | undefined | No | None | No client-side validation is declared. |
Returns
Promise<QuotePermission[]>
| Field | Type | Description |
|---|---|---|
| name | string | Name |
| expireAt | number | Expiration timestamp |
Type-checked example
const result = await quoteClient.getQuotePermission({ beginDate: '20260101', endDate: '20260131' });
console.log(result);Response example
[
{
"name": "string",
"expireAt": 0
}
]getKlineQuota
getKlineQuotaSignature
async getKlineQuota(req: KlineQuotaRequest): Promise<KlineQuota[]>Purpose
Gets kline quota.
Parameters, defaults, and constraints
| Parameter | Type | Required | SDK default | Constraints |
|---|---|---|---|---|
req | KlineQuotaRequest | Yes | None | No client-side validation is declared. |
req.withDetails | boolean | undefined | No | None | No client-side validation is declared. |
req.lang | string | undefined | No | None | No client-side validation is declared. |
Returns
Promise<KlineQuota[]>
| Field | Type | Description |
|---|---|---|
| method | string | API method |
| used | number | Used quota |
| quota | number | Total quota |
| detail | KlineQuotaDetail[] | Quota detail |
Type-checked example
const result = await quoteClient.getKlineQuota({ withDetails: true });
console.log(result);Response example
[
{
"method": "string",
"used": 0,
"quota": 0,
"detail": [
"KlineQuotaDetail"
]
}
]Updated about 13 hours ago
