@upbit-official/upbit-sdk 0.9.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +36 -16
- package/client.d.mts +13 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +13 -4
- package/client.d.ts.map +1 -1
- package/client.js +26 -4
- package/client.js.map +1 -1
- package/client.mjs +26 -4
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts.map +1 -1
- package/core/error.js.map +1 -1
- package/core/error.mjs.map +1 -1
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs.map +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/resource.js.map +1 -1
- package/core/resource.mjs.map +1 -1
- package/index.d.mts +3 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts +3 -1
- package/index.d.ts.map +1 -1
- package/index.js +2 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/internal/builtin-types.d.mts.map +1 -1
- package/internal/builtin-types.d.ts.map +1 -1
- package/internal/errors.d.mts.map +1 -1
- package/internal/errors.d.ts.map +1 -1
- package/internal/errors.js.map +1 -1
- package/internal/errors.mjs.map +1 -1
- package/internal/headers.d.mts.map +1 -1
- package/internal/headers.d.ts.map +1 -1
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs.map +1 -1
- package/internal/shim-types.d.mts.map +1 -1
- package/internal/shim-types.d.ts.map +1 -1
- package/internal/shim-types.js.map +1 -1
- package/internal/shim-types.mjs.map +1 -1
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts.map +1 -1
- package/internal/shims.js.map +1 -1
- package/internal/shims.mjs.map +1 -1
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts.map +1 -1
- package/internal/utils/base64.d.mts.map +1 -1
- package/internal/utils/base64.d.ts.map +1 -1
- package/internal/utils/base64.js.map +1 -1
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/env.d.mts.map +1 -1
- package/internal/utils/env.d.ts.map +1 -1
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/query.d.mts.map +1 -1
- package/internal/utils/query.d.ts.map +1 -1
- package/internal/utils/query.js.map +1 -1
- package/internal/utils/query.mjs.map +1 -1
- package/internal/utils/sleep.d.mts.map +1 -1
- package/internal/utils/sleep.d.ts.map +1 -1
- package/internal/utils/sleep.js.map +1 -1
- package/internal/utils/sleep.mjs.map +1 -1
- package/internal/utils/uuid.d.mts.map +1 -1
- package/internal/utils/uuid.d.ts.map +1 -1
- package/internal/utils/uuid.js.map +1 -1
- package/internal/utils/uuid.mjs.map +1 -1
- package/internal/utils/values.d.mts.map +1 -1
- package/internal/utils/values.d.ts.map +1 -1
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.js.map +1 -1
- package/internal/ws-parser.d.mts +40 -0
- package/internal/ws-parser.d.mts.map +1 -0
- package/internal/ws-parser.d.ts +40 -0
- package/internal/ws-parser.d.ts.map +1 -0
- package/internal/ws-parser.js +125 -0
- package/internal/ws-parser.js.map +1 -0
- package/internal/ws-parser.mjs +118 -0
- package/internal/ws-parser.mjs.map +1 -0
- package/internal/ws-simple-types.d.mts +8 -0
- package/internal/ws-simple-types.d.mts.map +1 -0
- package/internal/ws-simple-types.d.ts +8 -0
- package/internal/ws-simple-types.d.ts.map +1 -0
- package/internal/ws-simple-types.js +3 -0
- package/internal/ws-simple-types.js.map +1 -0
- package/internal/ws-simple-types.mjs +2 -0
- package/internal/ws-simple-types.mjs.map +1 -0
- package/internal/ws.d.mts +1 -0
- package/internal/ws.d.mts.map +1 -1
- package/internal/ws.d.ts +1 -0
- package/internal/ws.d.ts.map +1 -1
- package/internal/ws.js.map +1 -1
- package/internal/ws.mjs.map +1 -1
- package/lib/index.d.mts +4 -2
- package/lib/index.d.mts.map +1 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +1 -1
- package/lib/index.mjs.map +1 -1
- package/lib/jsonParseFloat.d.mts +5 -5
- package/lib/jsonParseFloat.d.mts.map +1 -1
- package/lib/jsonParseFloat.d.ts +5 -5
- package/lib/jsonParseFloat.d.ts.map +1 -1
- package/lib/jsonParseFloat.js +31 -12
- package/lib/jsonParseFloat.js.map +1 -1
- package/lib/jsonParseFloat.mjs +31 -12
- package/lib/jsonParseFloat.mjs.map +1 -1
- package/lib/ws.d.mts +102 -15
- package/lib/ws.d.mts.map +1 -1
- package/lib/ws.d.ts +102 -15
- package/lib/ws.d.ts.map +1 -1
- package/lib/ws.js +208 -34
- package/lib/ws.js.map +1 -1
- package/lib/ws.mjs +204 -33
- package/lib/ws.mjs.map +1 -1
- package/package.json +15 -9
- package/resources/accounts.d.mts +2 -0
- package/resources/accounts.d.mts.map +1 -1
- package/resources/accounts.d.ts +2 -0
- package/resources/accounts.d.ts.map +1 -1
- package/resources/accounts.js +2 -0
- package/resources/accounts.js.map +1 -1
- package/resources/accounts.mjs +2 -0
- package/resources/accounts.mjs.map +1 -1
- package/resources/api-keys.d.mts +3 -1
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts +3 -1
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/api-keys.js +3 -1
- package/resources/api-keys.js.map +1 -1
- package/resources/api-keys.mjs +3 -1
- package/resources/api-keys.mjs.map +1 -1
- package/resources/candles.d.mts +21 -1
- package/resources/candles.d.mts.map +1 -1
- package/resources/candles.d.ts +21 -1
- package/resources/candles.d.ts.map +1 -1
- package/resources/candles.js +12 -0
- package/resources/candles.js.map +1 -1
- package/resources/candles.mjs +12 -0
- package/resources/candles.mjs.map +1 -1
- package/resources/deposits.d.mts +18 -1
- package/resources/deposits.d.mts.map +1 -1
- package/resources/deposits.d.ts +18 -1
- package/resources/deposits.d.ts.map +1 -1
- package/resources/deposits.js +18 -1
- package/resources/deposits.js.map +1 -1
- package/resources/deposits.mjs +18 -1
- package/resources/deposits.mjs.map +1 -1
- package/resources/index.d.mts +4 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +4 -2
- package/resources/index.mjs.map +1 -1
- package/resources/orderbooks.d.mts +4 -0
- package/resources/orderbooks.d.mts.map +1 -1
- package/resources/orderbooks.d.ts +4 -0
- package/resources/orderbooks.d.ts.map +1 -1
- package/resources/orderbooks.js +4 -0
- package/resources/orderbooks.js.map +1 -1
- package/resources/orderbooks.mjs +4 -0
- package/resources/orderbooks.mjs.map +1 -1
- package/resources/orders.d.mts +12 -2
- package/resources/orders.d.mts.map +1 -1
- package/resources/orders.d.ts +12 -2
- package/resources/orders.d.ts.map +1 -1
- package/resources/orders.js +12 -2
- package/resources/orders.js.map +1 -1
- package/resources/orders.mjs +12 -2
- package/resources/orders.mjs.map +1 -1
- package/resources/pockets.d.mts +509 -0
- package/resources/pockets.d.mts.map +1 -0
- package/resources/pockets.d.ts +509 -0
- package/resources/pockets.d.ts.map +1 -0
- package/resources/pockets.js +157 -0
- package/resources/pockets.js.map +1 -0
- package/resources/pockets.mjs +153 -0
- package/resources/pockets.mjs.map +1 -0
- package/resources/tickers.d.mts +6 -0
- package/resources/tickers.d.mts.map +1 -1
- package/resources/tickers.d.ts +6 -0
- package/resources/tickers.d.ts.map +1 -1
- package/resources/tickers.js +6 -0
- package/resources/tickers.js.map +1 -1
- package/resources/tickers.mjs +6 -0
- package/resources/tickers.mjs.map +1 -1
- package/resources/trades.d.mts +5 -3
- package/resources/trades.d.mts.map +1 -1
- package/resources/trades.d.ts +5 -3
- package/resources/trades.d.ts.map +1 -1
- package/resources/trades.js +5 -3
- package/resources/trades.js.map +1 -1
- package/resources/trades.mjs +5 -3
- package/resources/trades.mjs.map +1 -1
- package/resources/trading-pairs.d.mts +2 -0
- package/resources/trading-pairs.d.mts.map +1 -1
- package/resources/trading-pairs.d.ts +2 -0
- package/resources/trading-pairs.d.ts.map +1 -1
- package/resources/trading-pairs.js +2 -0
- package/resources/trading-pairs.js.map +1 -1
- package/resources/trading-pairs.mjs +2 -0
- package/resources/trading-pairs.mjs.map +1 -1
- package/resources/travel-rule.d.mts +6 -0
- package/resources/travel-rule.d.mts.map +1 -1
- package/resources/travel-rule.d.ts +6 -0
- package/resources/travel-rule.d.ts.map +1 -1
- package/resources/travel-rule.js +6 -0
- package/resources/travel-rule.js.map +1 -1
- package/resources/travel-rule.mjs +6 -0
- package/resources/travel-rule.mjs.map +1 -1
- package/resources/wallet-status.d.mts +2 -0
- package/resources/wallet-status.d.mts.map +1 -1
- package/resources/wallet-status.d.ts +2 -0
- package/resources/wallet-status.d.ts.map +1 -1
- package/resources/wallet-status.js +2 -0
- package/resources/wallet-status.js.map +1 -1
- package/resources/wallet-status.mjs +2 -0
- package/resources/wallet-status.mjs.map +1 -1
- package/resources/withdraws.d.mts +18 -1
- package/resources/withdraws.d.mts.map +1 -1
- package/resources/withdraws.d.ts +18 -1
- package/resources/withdraws.d.ts.map +1 -1
- package/resources/withdraws.js +18 -1
- package/resources/withdraws.js.map +1 -1
- package/resources/withdraws.mjs +18 -1
- package/resources/withdraws.mjs.map +1 -1
- package/resources/ws-info/index.d.mts +6 -0
- package/resources/ws-info/index.d.mts.map +1 -0
- package/resources/ws-info/index.d.ts +6 -0
- package/resources/ws-info/index.d.ts.map +1 -0
- package/resources/ws-info/index.js +6 -0
- package/resources/ws-info/index.js.map +1 -0
- package/resources/ws-info/index.mjs +2 -0
- package/resources/ws-info/index.mjs.map +1 -0
- package/resources/ws-info/internal-base.d.mts +63 -0
- package/resources/ws-info/internal-base.d.mts.map +1 -0
- package/resources/ws-info/internal-base.d.ts +63 -0
- package/resources/ws-info/internal-base.d.ts.map +1 -0
- package/resources/ws-info/internal-base.js +47 -0
- package/resources/ws-info/internal-base.js.map +1 -0
- package/resources/ws-info/internal-base.mjs +41 -0
- package/resources/ws-info/internal-base.mjs.map +1 -0
- package/resources/ws-info/ws-info.d.mts +1180 -0
- package/resources/ws-info/ws-info.d.mts.map +1 -0
- package/resources/ws-info/ws-info.d.ts +1180 -0
- package/resources/ws-info/ws-info.d.ts.map +1 -0
- package/resources/ws-info/ws-info.js +8 -0
- package/resources/ws-info/ws-info.js.map +1 -0
- package/resources/ws-info/ws-info.mjs +4 -0
- package/resources/ws-info/ws-info.mjs.map +1 -0
- package/resources/ws-info/ws.d.mts +91 -0
- package/resources/ws-info/ws.d.mts.map +1 -0
- package/resources/ws-info/ws.d.ts +91 -0
- package/resources/ws-info/ws.d.ts.map +1 -0
- package/resources/ws-info/ws.js +463 -0
- package/resources/ws-info/ws.js.map +1 -0
- package/resources/ws-info/ws.mjs +458 -0
- package/resources/ws-info/ws.mjs.map +1 -0
- package/resources/ws-info.d.mts +2 -0
- package/resources/ws-info.d.mts.map +1 -0
- package/resources/ws-info.d.ts +2 -0
- package/resources/ws-info.d.ts.map +1 -0
- package/resources/ws-info.js +5 -0
- package/resources/ws-info.js.map +1 -0
- package/resources/ws-info.mjs +2 -0
- package/resources/ws-info.mjs.map +1 -0
- package/resources/ws-private/index.d.mts +3 -1
- package/resources/ws-private/index.d.mts.map +1 -1
- package/resources/ws-private/index.d.ts +3 -1
- package/resources/ws-private/index.d.ts.map +1 -1
- package/resources/ws-private/index.js.map +1 -1
- package/resources/ws-private/index.mjs +1 -1
- package/resources/ws-private/index.mjs.map +1 -1
- package/resources/ws-private/internal-base.d.mts.map +1 -1
- package/resources/ws-private/internal-base.d.ts.map +1 -1
- package/resources/ws-private/internal-base.js.map +1 -1
- package/resources/ws-private/internal-base.mjs.map +1 -1
- package/resources/ws-private/ws-private.d.mts +301 -9
- package/resources/ws-private/ws-private.d.mts.map +1 -1
- package/resources/ws-private/ws-private.d.ts +301 -9
- package/resources/ws-private/ws-private.d.ts.map +1 -1
- package/resources/ws-private/ws-private.js.map +1 -1
- package/resources/ws-private/ws-private.mjs.map +1 -1
- package/resources/ws-private/ws.d.mts +2 -2
- package/resources/ws-private/ws.d.mts.map +1 -1
- package/resources/ws-private/ws.d.ts +2 -2
- package/resources/ws-private/ws.d.ts.map +1 -1
- package/resources/ws-private/ws.js +15 -20
- package/resources/ws-private/ws.js.map +1 -1
- package/resources/ws-private/ws.mjs +15 -20
- package/resources/ws-private/ws.mjs.map +1 -1
- package/resources/ws-private.js.map +1 -1
- package/resources/ws-public/index.d.mts +3 -1
- package/resources/ws-public/index.d.mts.map +1 -1
- package/resources/ws-public/index.d.ts +3 -1
- package/resources/ws-public/index.d.ts.map +1 -1
- package/resources/ws-public/index.js.map +1 -1
- package/resources/ws-public/index.mjs +1 -1
- package/resources/ws-public/index.mjs.map +1 -1
- package/resources/ws-public/internal-base.d.mts.map +1 -1
- package/resources/ws-public/internal-base.d.ts.map +1 -1
- package/resources/ws-public/internal-base.js.map +1 -1
- package/resources/ws-public/internal-base.mjs.map +1 -1
- package/resources/ws-public/ws-public.d.mts +355 -5
- package/resources/ws-public/ws-public.d.mts.map +1 -1
- package/resources/ws-public/ws-public.d.ts +355 -5
- package/resources/ws-public/ws-public.d.ts.map +1 -1
- package/resources/ws-public/ws-public.js.map +1 -1
- package/resources/ws-public/ws-public.mjs.map +1 -1
- package/resources/ws-public/ws.d.mts +2 -2
- package/resources/ws-public/ws.d.mts.map +1 -1
- package/resources/ws-public/ws.d.ts +2 -2
- package/resources/ws-public/ws.d.ts.map +1 -1
- package/resources/ws-public/ws.js +15 -20
- package/resources/ws-public/ws.js.map +1 -1
- package/resources/ws-public/ws.mjs +15 -20
- package/resources/ws-public/ws.mjs.map +1 -1
- package/resources/ws-public.js.map +1 -1
- package/src/client.ts +141 -5
- package/src/core/api-promise.ts +0 -1
- package/src/core/error.ts +0 -1
- package/src/core/pagination.ts +0 -1
- package/src/core/resource.ts +0 -1
- package/src/index.ts +24 -2
- package/src/internal/builtin-types.ts +0 -1
- package/src/internal/errors.ts +0 -1
- package/src/internal/headers.ts +0 -1
- package/src/internal/parse.ts +0 -1
- package/src/internal/request-options.ts +0 -1
- package/src/internal/shim-types.ts +0 -1
- package/src/internal/shims.ts +0 -1
- package/src/internal/types.ts +0 -1
- package/src/internal/utils/base64.ts +0 -1
- package/src/internal/utils/env.ts +0 -1
- package/src/internal/utils/log.ts +0 -1
- package/src/internal/utils/query.ts +0 -1
- package/src/internal/utils/sleep.ts +0 -1
- package/src/internal/utils/uuid.ts +0 -1
- package/src/internal/utils/values.ts +0 -1
- package/src/internal/utils.ts +0 -1
- package/src/internal/ws-parser.ts +164 -0
- package/src/internal/ws-simple-types.ts +34 -0
- package/src/internal/ws.ts +1 -0
- package/src/lib/index.ts +17 -2
- package/src/lib/jsonParseFloat.ts +38 -12
- package/src/lib/ws.ts +367 -55
- package/src/resources/accounts.ts +2 -1
- package/src/resources/api-keys.ts +3 -2
- package/src/resources/candles.ts +22 -2
- package/src/resources/deposits.ts +18 -2
- package/src/resources/index.ts +65 -3
- package/src/resources/orderbooks.ts +4 -1
- package/src/resources/orders.ts +12 -3
- package/src/resources/pockets.ts +639 -0
- package/src/resources/tickers.ts +6 -1
- package/src/resources/trades.ts +5 -4
- package/src/resources/trading-pairs.ts +2 -1
- package/src/resources/travel-rule.ts +6 -1
- package/src/resources/wallet-status.ts +2 -1
- package/src/resources/withdraws.ts +18 -2
- package/src/resources/ws-info/index.ts +44 -0
- package/src/resources/ws-info/internal-base.ts +96 -0
- package/src/resources/ws-info/ws-info.ts +1855 -0
- package/src/resources/ws-info/ws.ts +574 -0
- package/src/resources/ws-info.ts +1 -0
- package/src/resources/ws-private/index.ts +12 -2
- package/src/resources/ws-private/internal-base.ts +0 -2
- package/src/resources/ws-private/ws-private.ts +419 -18
- package/src/resources/ws-private/ws.ts +16 -24
- package/src/resources/ws-private.ts +0 -1
- package/src/resources/ws-public/index.ts +16 -2
- package/src/resources/ws-public/internal-base.ts +0 -2
- package/src/resources/ws-public/ws-public.ts +459 -5
- package/src/resources/ws-public/ws.ts +16 -24
- package/src/resources/ws-public.ts +0 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
package/lib/jsonParseFloat.mjs
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
const NUMBER_FIELDS = new Set([
|
|
7
7
|
'timestamp',
|
|
8
|
+
'tms',
|
|
8
9
|
'trade_timestamp',
|
|
9
10
|
'sequential_id',
|
|
10
11
|
'trades_count',
|
|
@@ -14,57 +15,75 @@ const NUMBER_FIELDS = new Set([
|
|
|
14
15
|
'block_elapsed_minutes',
|
|
15
16
|
'fee_level',
|
|
16
17
|
'security_level',
|
|
18
|
+
'unit',
|
|
17
19
|
]);
|
|
18
20
|
/**
|
|
19
21
|
* Parses a JSON string with type-aware coercion.
|
|
20
22
|
*
|
|
21
|
-
* 1st pass (JSON.parse reviver):
|
|
22
|
-
*
|
|
23
|
-
* Uses the reviver's third argument `context.source` (TypeScript 5.2+ / modern runtimes).
|
|
23
|
+
* 1st pass (JSON.parse reviver): numeric tokens retain their original source
|
|
24
|
+
* alongside the parsed number. Uses the runtime's reviver `context.source`.
|
|
24
25
|
* Falls back to standard number parsing when `context.source` is unavailable.
|
|
25
26
|
*
|
|
26
27
|
* 2nd pass (constructType): coerces values to match SDK declared types.
|
|
27
28
|
* - `string`-declared fields: `number` → `string` (e.g. balance `0` → `"0"`)
|
|
28
29
|
* - `number`-declared fields: `string` → `number` (e.g. timestamp `"123.45"` → `123.45`)
|
|
29
30
|
*
|
|
30
|
-
*
|
|
31
|
+
* Integer scalars and integer array elements keep their existing number contract;
|
|
32
|
+
* decimal/exponent scalars and array elements keep their existing source strings.
|
|
31
33
|
*/
|
|
32
|
-
export function jsonParseFloat(text) {
|
|
34
|
+
export function jsonParseFloat(text, numberField) {
|
|
33
35
|
const parsed = JSON.parse(text, (key, value, context) => {
|
|
34
36
|
if (typeof value !== 'number')
|
|
35
37
|
return value;
|
|
36
38
|
const src = context?.source;
|
|
37
39
|
if (!src)
|
|
38
40
|
return value;
|
|
39
|
-
return
|
|
41
|
+
return new NumericToken(src, value);
|
|
40
42
|
});
|
|
41
|
-
return constructType(parsed);
|
|
43
|
+
return constructType(parsed, numberField);
|
|
42
44
|
}
|
|
43
|
-
|
|
45
|
+
/** Internal only: distinguish numeric wire tokens from JSON string values. */
|
|
46
|
+
class NumericToken {
|
|
47
|
+
constructor(source, value) {
|
|
48
|
+
this.source = source;
|
|
49
|
+
this.value = value;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function constructType(data, numberField, path = [], root) {
|
|
53
|
+
if (data instanceof NumericToken) {
|
|
54
|
+
return /[.eE]/.test(data.source) ? data.source : data.value;
|
|
55
|
+
}
|
|
44
56
|
if (Array.isArray(data)) {
|
|
45
|
-
return data.map(constructType);
|
|
57
|
+
return data.map((item) => constructType(item, numberField, path, root));
|
|
46
58
|
}
|
|
47
59
|
if (data !== null && typeof data === 'object') {
|
|
48
60
|
const obj = data;
|
|
61
|
+
root ?? (root = obj);
|
|
49
62
|
const result = {};
|
|
50
63
|
for (const key of Object.keys(obj)) {
|
|
51
64
|
const value = obj[key];
|
|
52
|
-
if (NUMBER_FIELDS.has(key)) {
|
|
65
|
+
if (NUMBER_FIELDS.has(key) || numberField?.(key, path, root)) {
|
|
53
66
|
// number-declared field: coerce string → number
|
|
54
|
-
if (
|
|
67
|
+
if (value instanceof NumericToken) {
|
|
68
|
+
result[key] = value.value;
|
|
69
|
+
}
|
|
70
|
+
else if (typeof value === 'string') {
|
|
55
71
|
result[key] = Number(value);
|
|
56
72
|
}
|
|
57
73
|
else {
|
|
58
74
|
result[key] = value;
|
|
59
75
|
}
|
|
60
76
|
}
|
|
77
|
+
else if (value instanceof NumericToken) {
|
|
78
|
+
result[key] = value.source;
|
|
79
|
+
}
|
|
61
80
|
else if (typeof value === 'number') {
|
|
62
81
|
// string-declared field: coerce number → string
|
|
63
82
|
result[key] = String(value);
|
|
64
83
|
}
|
|
65
84
|
else {
|
|
66
85
|
// recurse into nested objects and arrays
|
|
67
|
-
result[key] = constructType(value);
|
|
86
|
+
result[key] = constructType(value, numberField, [...path, key], root);
|
|
68
87
|
}
|
|
69
88
|
}
|
|
70
89
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonParseFloat.mjs","sourceRoot":"","sources":["../src/lib/jsonParseFloat.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,aAAa,GAAgB,IAAI,GAAG,CAAC;IACzC,WAAW;IACX,iBAAiB;IACjB,eAAe;IACf,cAAc;IACd,OAAO;IACP,mBAAmB;IACnB,+BAA+B;IAC/B,uBAAuB;IACvB,WAAW;IACX,gBAAgB;
|
|
1
|
+
{"version":3,"file":"jsonParseFloat.mjs","sourceRoot":"","sources":["../src/lib/jsonParseFloat.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,aAAa,GAAgB,IAAI,GAAG,CAAC;IACzC,WAAW;IACX,KAAK;IACL,iBAAiB;IACjB,eAAe;IACf,cAA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H,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/lib/ws.d.mts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import type { ConnectPublicServerEvent } from "../resources/ws-public/ws-public.mjs";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ListSubscriptionsResponse, ListSubscriptionsServerResponse, SimpleListSubscriptionsResponse } from "../resources/ws-public/ws-public.mjs";
|
|
3
|
+
import type { AnnouncementCategory, ConnectPrivateServerEvent } from "../resources/ws-private/ws-private.mjs";
|
|
4
|
+
import type { ConnectInfoServerEvent } from "../resources/ws-info/ws-info.mjs";
|
|
5
|
+
import type { ConnectInfoClientEvent } from "../resources/ws-info/ws-info.mjs";
|
|
6
|
+
import { type InfoWebSocketUnknownMessage, type WebSocketMessage } from "../internal/ws-parser.mjs";
|
|
7
|
+
import type { SimpleWebSocketEvent } from "../internal/ws-simple-types.mjs";
|
|
8
|
+
import type { SimpleWebSocketEvent as ExtensibleSimpleEvent } from "../internal/ws-parser.mjs";
|
|
3
9
|
import type { Upbit } from "../client.mjs";
|
|
4
10
|
export interface WsStreamOptions {
|
|
11
|
+
/** Response format (default: DEFAULT). Preserved for queries and reconnects. */
|
|
12
|
+
format?: WsStreamFormat;
|
|
5
13
|
/** Maximum number of reconnection attempts (default: 5) */
|
|
6
14
|
maxRetries?: number;
|
|
7
15
|
/** Reconnection delay in ms (default: 1000) */
|
|
@@ -11,6 +19,35 @@ export interface WsStreamOptions {
|
|
|
11
19
|
/** Callback invoked on successful reconnection */
|
|
12
20
|
onReconnect?: () => void;
|
|
13
21
|
}
|
|
22
|
+
export type WsStreamFormat = 'DEFAULT' | 'SIMPLE' | 'JSON_LIST' | 'SIMPLE_LIST';
|
|
23
|
+
export declare enum WsEndpoint {
|
|
24
|
+
Public = "public",
|
|
25
|
+
Private = "private",
|
|
26
|
+
Info = "info"
|
|
27
|
+
}
|
|
28
|
+
export type WsDefaultListSubscriptionsResponse = ListSubscriptionsResponse;
|
|
29
|
+
export type WsSimpleListSubscriptionsResponse = SimpleListSubscriptionsResponse;
|
|
30
|
+
export type WsListSubscriptionsResponse = ListSubscriptionsServerResponse;
|
|
31
|
+
export interface WsAnnouncementOptions extends WsStreamOptions {
|
|
32
|
+
/** Response format (default: DEFAULT). */
|
|
33
|
+
format?: WsStreamFormat;
|
|
34
|
+
/** Announcement categories to receive. Omit to receive all categories. */
|
|
35
|
+
categories?: AnnouncementCategory[];
|
|
36
|
+
/** Whether to include the announcement body in stream messages. */
|
|
37
|
+
includeBody?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export type WsIndicatorSubscription = Omit<Extract<InfoSubscription, {
|
|
40
|
+
type: 'indicator';
|
|
41
|
+
}>, 'type'>;
|
|
42
|
+
export interface WsIndicatorOptions extends Omit<WsIndicatorSubscription, 'codes'>, WsStreamOptions {
|
|
43
|
+
format?: WsStreamFormat;
|
|
44
|
+
}
|
|
45
|
+
export type WsIndicatorSignalSubscription = Omit<Extract<InfoSubscription, {
|
|
46
|
+
type: 'indicator_signal';
|
|
47
|
+
}>, 'type'>;
|
|
48
|
+
export interface WsIndicatorSignalOptions extends Omit<WsIndicatorSignalSubscription, 'codes'>, WsStreamOptions {
|
|
49
|
+
format?: WsStreamFormat;
|
|
50
|
+
}
|
|
14
51
|
type PublicSubscriptionType = {
|
|
15
52
|
type: 'ticker';
|
|
16
53
|
codes: string[];
|
|
@@ -24,33 +61,71 @@ type PublicSubscriptionType = {
|
|
|
24
61
|
type: string;
|
|
25
62
|
codes: string[];
|
|
26
63
|
};
|
|
27
|
-
type
|
|
64
|
+
type AnnouncementSubscriptionType = {
|
|
65
|
+
type: 'announcement';
|
|
66
|
+
categories?: AnnouncementCategory[];
|
|
67
|
+
include_body?: boolean;
|
|
68
|
+
};
|
|
69
|
+
type PrivateSubscriptionType = AnnouncementSubscriptionType | {
|
|
28
70
|
type: 'myOrder';
|
|
29
71
|
codes?: string[];
|
|
30
72
|
} | {
|
|
31
73
|
type: 'myAsset';
|
|
32
74
|
};
|
|
33
|
-
type
|
|
75
|
+
export type InfoSubscription = Extract<ConnectInfoClientEvent[number], {
|
|
76
|
+
type: 'indicator' | 'indicator_signal';
|
|
77
|
+
}>;
|
|
78
|
+
type AnySubscriptionType = PublicSubscriptionType | PrivateSubscriptionType | InfoSubscription;
|
|
79
|
+
type WsServerEvent = ConnectPublicServerEvent | ConnectPrivateServerEvent | ConnectInfoServerEvent | InfoWebSocketUnknownMessage;
|
|
80
|
+
export type WsSimpleEvent = SimpleWebSocketEvent;
|
|
81
|
+
export type WsStreamEvent = WebSocketMessage<WsServerEvent | WsSimpleEvent | ExtensibleSimpleEvent> | WsListSubscriptionsResponse | Array<WebSocketMessage<WsServerEvent | WsSimpleEvent | ExtensibleSimpleEvent> | WsListSubscriptionsResponse>;
|
|
82
|
+
type PublicEvent<Type extends ConnectPublicServerEvent['type']> = Extract<ConnectPublicServerEvent, {
|
|
83
|
+
type: Type;
|
|
84
|
+
}>;
|
|
85
|
+
type CandleEvent = Exclude<ConnectPublicServerEvent, PublicEvent<'ticker' | 'trade' | 'orderbook'>>;
|
|
86
|
+
type PrivateEvent<Type extends ConnectPrivateServerEvent['type']> = Extract<ConnectPrivateServerEvent, {
|
|
87
|
+
type: Type;
|
|
88
|
+
}>;
|
|
89
|
+
type InfoEvent<Type extends ConnectInfoServerEvent['type']> = Extract<ConnectInfoServerEvent, {
|
|
90
|
+
type: Type;
|
|
91
|
+
}>;
|
|
92
|
+
export declare function buildSubscriptionMessage(types: AnySubscriptionType[], format?: WsStreamFormat): string;
|
|
93
|
+
export declare function buildListSubscriptionsMessage(format?: WsStreamFormat): string;
|
|
94
|
+
export declare function parseWsMessage(data: string): unknown;
|
|
34
95
|
/**
|
|
35
96
|
* Manages a WebSocket stream as an AsyncIterable.
|
|
36
97
|
*
|
|
37
98
|
* Use with `for await (const event of manager) { ... }`.
|
|
38
99
|
*/
|
|
39
|
-
export declare class WsStreamManager
|
|
100
|
+
export declare class WsStreamManager<Event = ConnectPublicServerEvent | ConnectPrivateServerEvent> implements AsyncIterable<Event> {
|
|
40
101
|
private readonly client;
|
|
41
102
|
private readonly types;
|
|
42
|
-
private readonly
|
|
103
|
+
private readonly endpoint;
|
|
104
|
+
private readonly format;
|
|
43
105
|
private readonly maxRetries;
|
|
44
106
|
private readonly retryDelayMs;
|
|
45
107
|
private readonly onDisconnect;
|
|
46
108
|
private readonly onReconnect;
|
|
47
109
|
private _currentWs;
|
|
48
|
-
|
|
110
|
+
private _pendingListSubscriptions;
|
|
111
|
+
constructor(client: Upbit, types: AnySubscriptionType[], privateConnection: boolean, opts?: WsStreamOptions & {
|
|
112
|
+
format?: WsStreamFormat;
|
|
113
|
+
});
|
|
114
|
+
constructor(client: Upbit, types: AnySubscriptionType[], endpoint: WsEndpoint, opts?: WsStreamOptions & {
|
|
115
|
+
format?: WsStreamFormat;
|
|
116
|
+
});
|
|
117
|
+
/**
|
|
118
|
+
* Returns subscriptions for this stream's currently open connection.
|
|
119
|
+
* Start consuming the iterator before calling; calls before connection reject.
|
|
120
|
+
* The response format is unchanged. Responses are matched by request ticket.
|
|
121
|
+
*/
|
|
122
|
+
listSubscriptions(timeoutMs?: number): Promise<WsListSubscriptionsResponse>;
|
|
49
123
|
/** Closes the current WebSocket connection. */
|
|
50
124
|
close(): void;
|
|
51
|
-
[Symbol.asyncIterator](): AsyncGenerator<
|
|
125
|
+
[Symbol.asyncIterator](): AsyncGenerator<Event>;
|
|
52
126
|
private _iterate;
|
|
53
127
|
private _connect;
|
|
128
|
+
private _settlePendingListSubscriptions;
|
|
54
129
|
}
|
|
55
130
|
/**
|
|
56
131
|
* Convenience API for WebSocket streams.
|
|
@@ -62,19 +137,25 @@ export declare class WsStream {
|
|
|
62
137
|
private readonly client;
|
|
63
138
|
constructor(client: Upbit);
|
|
64
139
|
/** Subscribe to the ticker (current price) stream. */
|
|
65
|
-
ticker(codes: string[], opts?: WsStreamOptions): WsStreamManager
|
|
140
|
+
ticker(codes: string[], opts?: WsStreamOptions): WsStreamManager<PublicEvent<'ticker'>>;
|
|
66
141
|
/** Subscribe to the trade (executed order) stream. */
|
|
67
|
-
trade(codes: string[], opts?: WsStreamOptions): WsStreamManager
|
|
142
|
+
trade(codes: string[], opts?: WsStreamOptions): WsStreamManager<PublicEvent<'trade'>>;
|
|
68
143
|
/** Subscribe to the orderbook stream. */
|
|
69
|
-
orderbook(codes: string[], opts?: WsStreamOptions): WsStreamManager
|
|
144
|
+
orderbook(codes: string[], opts?: WsStreamOptions): WsStreamManager<PublicEvent<'orderbook'>>;
|
|
70
145
|
/** Subscribe to the candle stream. */
|
|
71
146
|
candle(codes: string[], opts?: {
|
|
72
147
|
interval?: string;
|
|
73
|
-
} & WsStreamOptions): WsStreamManager
|
|
148
|
+
} & WsStreamOptions): WsStreamManager<CandleEvent>;
|
|
74
149
|
/** Subscribe to the myOrder (my orders) stream. Requires authentication. */
|
|
75
|
-
myOrder(codes: string[], opts?: WsStreamOptions): WsStreamManager
|
|
150
|
+
myOrder(codes: string[], opts?: WsStreamOptions): WsStreamManager<PrivateEvent<'myOrder'>>;
|
|
76
151
|
/** Subscribe to the myAsset (my assets) stream. Requires authentication. */
|
|
77
|
-
myAsset(opts?: WsStreamOptions): WsStreamManager
|
|
152
|
+
myAsset(opts?: WsStreamOptions): WsStreamManager<PrivateEvent<'myAsset'>>;
|
|
153
|
+
/** Subscribe to the announcement stream. Requires authentication. */
|
|
154
|
+
announcement(opts?: WsAnnouncementOptions): WsStreamManager<PrivateEvent<'announcement'>>;
|
|
155
|
+
/** Subscribe to calculated indicator values. Requires authentication. */
|
|
156
|
+
indicator(codes: string[], opts: WsIndicatorOptions): WsStreamManager<InfoEvent<'indicator'>>;
|
|
157
|
+
/** Subscribe to technical indicator condition transitions. Requires authentication. */
|
|
158
|
+
indicatorSignal(codes: string[], opts: WsIndicatorSignalOptions): WsStreamManager<InfoEvent<'indicator_signal'>>;
|
|
78
159
|
/** Subscribe to multiple public streams at once. */
|
|
79
160
|
subscribe(opts: {
|
|
80
161
|
ticker?: string[];
|
|
@@ -84,12 +165,18 @@ export declare class WsStream {
|
|
|
84
165
|
codes: string[];
|
|
85
166
|
interval?: string;
|
|
86
167
|
};
|
|
87
|
-
} & WsStreamOptions): WsStreamManager
|
|
168
|
+
} & WsStreamOptions): WsStreamManager<ConnectPublicServerEvent>;
|
|
88
169
|
/** Subscribe to multiple private streams at once. Requires authentication. */
|
|
89
170
|
subscribePrivate(opts: {
|
|
171
|
+
announcement?: boolean | Pick<WsAnnouncementOptions, 'categories' | 'includeBody'>;
|
|
90
172
|
myOrder?: string[];
|
|
91
173
|
myAsset?: boolean;
|
|
92
|
-
} & WsStreamOptions): WsStreamManager
|
|
174
|
+
} & WsStreamOptions): WsStreamManager<ConnectPrivateServerEvent>;
|
|
175
|
+
/** Subscribe to multiple info streams at once. Requires authentication. */
|
|
176
|
+
subscribeInfo(opts: {
|
|
177
|
+
indicator?: WsIndicatorSubscription | WsIndicatorSubscription[];
|
|
178
|
+
indicatorSignal?: WsIndicatorSignalSubscription | WsIndicatorSignalSubscription[];
|
|
179
|
+
} & WsStreamOptions): WsStreamManager<ConnectInfoServerEvent>;
|
|
93
180
|
}
|
|
94
181
|
export {};
|
|
95
182
|
//# sourceMappingURL=ws.d.mts.map
|
package/lib/ws.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws.d.mts","sourceRoot":"","sources":["../src/lib/ws.ts"],"names":[],"mappings":"OAMO,KAAK,EAAE,wBAAwB,EAAE;OACjC,KAAK,EAAE,yBAAyB,EAAE;
|
|
1
|
+
{"version":3,"file":"ws.d.mts","sourceRoot":"","sources":["../src/lib/ws.ts"],"names":[],"mappings":"OAMO,KAAK,EAAE,wBAAwB,EAAE;OACjC,KAAK,EACV,yBAAyB,EACzB,+BAA+B,EAC/B,+BAA+B,EAChC;OACM,KAAK,EAAE,oBAAoB,EAAE,yBAAyB,EAAE;OACxD,KAAK,E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CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,EAAE,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KACjD,GAAG,eAAe,GAClB,eAAe,CAAC,wBAAwB,CAAC;IAiB5C,8EAA8E;IAC9E,gBAAgB,CACd,IAAI,EAAE;QACJ,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,qBAAqB,EAAE,YAAY,GAAG,aAAa,CAAC,CAAC;QACnF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,GAAG,eAAe,GAClB,eAAe,CAAC,yBAAyB,CAAC;IAuB7C,2EAA2E;IAC3E,aAAa,CACX,IAAI,EAAE;QACJ,SAAS,CAAC,EAAE,uBAAuB,GAAG,uBAAuB,EAAE,CAAC;QAChE,eAAe,CAAC,EAAE,6BAA6B,GAAG,6BAA6B,EAAE,CAAC;KACnF,GAAG,eAAe,GAClB,eAAe,CAAC,sBAAsB,CAAC;CA2B3C"}
|
package/lib/ws.d.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import type { ConnectPublicServerEvent } from "../resources/ws-public/ws-public.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ListSubscriptionsResponse, ListSubscriptionsServerResponse, SimpleListSubscriptionsResponse } from "../resources/ws-public/ws-public.js";
|
|
3
|
+
import type { AnnouncementCategory, ConnectPrivateServerEvent } from "../resources/ws-private/ws-private.js";
|
|
4
|
+
import type { ConnectInfoServerEvent } from "../resources/ws-info/ws-info.js";
|
|
5
|
+
import type { ConnectInfoClientEvent } from "../resources/ws-info/ws-info.js";
|
|
6
|
+
import { type InfoWebSocketUnknownMessage, type WebSocketMessage } from "../internal/ws-parser.js";
|
|
7
|
+
import type { SimpleWebSocketEvent } from "../internal/ws-simple-types.js";
|
|
8
|
+
import type { SimpleWebSocketEvent as ExtensibleSimpleEvent } from "../internal/ws-parser.js";
|
|
3
9
|
import type { Upbit } from "../client.js";
|
|
4
10
|
export interface WsStreamOptions {
|
|
11
|
+
/** Response format (default: DEFAULT). Preserved for queries and reconnects. */
|
|
12
|
+
format?: WsStreamFormat;
|
|
5
13
|
/** Maximum number of reconnection attempts (default: 5) */
|
|
6
14
|
maxRetries?: number;
|
|
7
15
|
/** Reconnection delay in ms (default: 1000) */
|
|
@@ -11,6 +19,35 @@ export interface WsStreamOptions {
|
|
|
11
19
|
/** Callback invoked on successful reconnection */
|
|
12
20
|
onReconnect?: () => void;
|
|
13
21
|
}
|
|
22
|
+
export type WsStreamFormat = 'DEFAULT' | 'SIMPLE' | 'JSON_LIST' | 'SIMPLE_LIST';
|
|
23
|
+
export declare enum WsEndpoint {
|
|
24
|
+
Public = "public",
|
|
25
|
+
Private = "private",
|
|
26
|
+
Info = "info"
|
|
27
|
+
}
|
|
28
|
+
export type WsDefaultListSubscriptionsResponse = ListSubscriptionsResponse;
|
|
29
|
+
export type WsSimpleListSubscriptionsResponse = SimpleListSubscriptionsResponse;
|
|
30
|
+
export type WsListSubscriptionsResponse = ListSubscriptionsServerResponse;
|
|
31
|
+
export interface WsAnnouncementOptions extends WsStreamOptions {
|
|
32
|
+
/** Response format (default: DEFAULT). */
|
|
33
|
+
format?: WsStreamFormat;
|
|
34
|
+
/** Announcement categories to receive. Omit to receive all categories. */
|
|
35
|
+
categories?: AnnouncementCategory[];
|
|
36
|
+
/** Whether to include the announcement body in stream messages. */
|
|
37
|
+
includeBody?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export type WsIndicatorSubscription = Omit<Extract<InfoSubscription, {
|
|
40
|
+
type: 'indicator';
|
|
41
|
+
}>, 'type'>;
|
|
42
|
+
export interface WsIndicatorOptions extends Omit<WsIndicatorSubscription, 'codes'>, WsStreamOptions {
|
|
43
|
+
format?: WsStreamFormat;
|
|
44
|
+
}
|
|
45
|
+
export type WsIndicatorSignalSubscription = Omit<Extract<InfoSubscription, {
|
|
46
|
+
type: 'indicator_signal';
|
|
47
|
+
}>, 'type'>;
|
|
48
|
+
export interface WsIndicatorSignalOptions extends Omit<WsIndicatorSignalSubscription, 'codes'>, WsStreamOptions {
|
|
49
|
+
format?: WsStreamFormat;
|
|
50
|
+
}
|
|
14
51
|
type PublicSubscriptionType = {
|
|
15
52
|
type: 'ticker';
|
|
16
53
|
codes: string[];
|
|
@@ -24,33 +61,71 @@ type PublicSubscriptionType = {
|
|
|
24
61
|
type: string;
|
|
25
62
|
codes: string[];
|
|
26
63
|
};
|
|
27
|
-
type
|
|
64
|
+
type AnnouncementSubscriptionType = {
|
|
65
|
+
type: 'announcement';
|
|
66
|
+
categories?: AnnouncementCategory[];
|
|
67
|
+
include_body?: boolean;
|
|
68
|
+
};
|
|
69
|
+
type PrivateSubscriptionType = AnnouncementSubscriptionType | {
|
|
28
70
|
type: 'myOrder';
|
|
29
71
|
codes?: string[];
|
|
30
72
|
} | {
|
|
31
73
|
type: 'myAsset';
|
|
32
74
|
};
|
|
33
|
-
type
|
|
75
|
+
export type InfoSubscription = Extract<ConnectInfoClientEvent[number], {
|
|
76
|
+
type: 'indicator' | 'indicator_signal';
|
|
77
|
+
}>;
|
|
78
|
+
type AnySubscriptionType = PublicSubscriptionType | PrivateSubscriptionType | InfoSubscription;
|
|
79
|
+
type WsServerEvent = ConnectPublicServerEvent | ConnectPrivateServerEvent | ConnectInfoServerEvent | InfoWebSocketUnknownMessage;
|
|
80
|
+
export type WsSimpleEvent = SimpleWebSocketEvent;
|
|
81
|
+
export type WsStreamEvent = WebSocketMessage<WsServerEvent | WsSimpleEvent | ExtensibleSimpleEvent> | WsListSubscriptionsResponse | Array<WebSocketMessage<WsServerEvent | WsSimpleEvent | ExtensibleSimpleEvent> | WsListSubscriptionsResponse>;
|
|
82
|
+
type PublicEvent<Type extends ConnectPublicServerEvent['type']> = Extract<ConnectPublicServerEvent, {
|
|
83
|
+
type: Type;
|
|
84
|
+
}>;
|
|
85
|
+
type CandleEvent = Exclude<ConnectPublicServerEvent, PublicEvent<'ticker' | 'trade' | 'orderbook'>>;
|
|
86
|
+
type PrivateEvent<Type extends ConnectPrivateServerEvent['type']> = Extract<ConnectPrivateServerEvent, {
|
|
87
|
+
type: Type;
|
|
88
|
+
}>;
|
|
89
|
+
type InfoEvent<Type extends ConnectInfoServerEvent['type']> = Extract<ConnectInfoServerEvent, {
|
|
90
|
+
type: Type;
|
|
91
|
+
}>;
|
|
92
|
+
export declare function buildSubscriptionMessage(types: AnySubscriptionType[], format?: WsStreamFormat): string;
|
|
93
|
+
export declare function buildListSubscriptionsMessage(format?: WsStreamFormat): string;
|
|
94
|
+
export declare function parseWsMessage(data: string): unknown;
|
|
34
95
|
/**
|
|
35
96
|
* Manages a WebSocket stream as an AsyncIterable.
|
|
36
97
|
*
|
|
37
98
|
* Use with `for await (const event of manager) { ... }`.
|
|
38
99
|
*/
|
|
39
|
-
export declare class WsStreamManager
|
|
100
|
+
export declare class WsStreamManager<Event = ConnectPublicServerEvent | ConnectPrivateServerEvent> implements AsyncIterable<Event> {
|
|
40
101
|
private readonly client;
|
|
41
102
|
private readonly types;
|
|
42
|
-
private readonly
|
|
103
|
+
private readonly endpoint;
|
|
104
|
+
private readonly format;
|
|
43
105
|
private readonly maxRetries;
|
|
44
106
|
private readonly retryDelayMs;
|
|
45
107
|
private readonly onDisconnect;
|
|
46
108
|
private readonly onReconnect;
|
|
47
109
|
private _currentWs;
|
|
48
|
-
|
|
110
|
+
private _pendingListSubscriptions;
|
|
111
|
+
constructor(client: Upbit, types: AnySubscriptionType[], privateConnection: boolean, opts?: WsStreamOptions & {
|
|
112
|
+
format?: WsStreamFormat;
|
|
113
|
+
});
|
|
114
|
+
constructor(client: Upbit, types: AnySubscriptionType[], endpoint: WsEndpoint, opts?: WsStreamOptions & {
|
|
115
|
+
format?: WsStreamFormat;
|
|
116
|
+
});
|
|
117
|
+
/**
|
|
118
|
+
* Returns subscriptions for this stream's currently open connection.
|
|
119
|
+
* Start consuming the iterator before calling; calls before connection reject.
|
|
120
|
+
* The response format is unchanged. Responses are matched by request ticket.
|
|
121
|
+
*/
|
|
122
|
+
listSubscriptions(timeoutMs?: number): Promise<WsListSubscriptionsResponse>;
|
|
49
123
|
/** Closes the current WebSocket connection. */
|
|
50
124
|
close(): void;
|
|
51
|
-
[Symbol.asyncIterator](): AsyncGenerator<
|
|
125
|
+
[Symbol.asyncIterator](): AsyncGenerator<Event>;
|
|
52
126
|
private _iterate;
|
|
53
127
|
private _connect;
|
|
128
|
+
private _settlePendingListSubscriptions;
|
|
54
129
|
}
|
|
55
130
|
/**
|
|
56
131
|
* Convenience API for WebSocket streams.
|
|
@@ -62,19 +137,25 @@ export declare class WsStream {
|
|
|
62
137
|
private readonly client;
|
|
63
138
|
constructor(client: Upbit);
|
|
64
139
|
/** Subscribe to the ticker (current price) stream. */
|
|
65
|
-
ticker(codes: string[], opts?: WsStreamOptions): WsStreamManager
|
|
140
|
+
ticker(codes: string[], opts?: WsStreamOptions): WsStreamManager<PublicEvent<'ticker'>>;
|
|
66
141
|
/** Subscribe to the trade (executed order) stream. */
|
|
67
|
-
trade(codes: string[], opts?: WsStreamOptions): WsStreamManager
|
|
142
|
+
trade(codes: string[], opts?: WsStreamOptions): WsStreamManager<PublicEvent<'trade'>>;
|
|
68
143
|
/** Subscribe to the orderbook stream. */
|
|
69
|
-
orderbook(codes: string[], opts?: WsStreamOptions): WsStreamManager
|
|
144
|
+
orderbook(codes: string[], opts?: WsStreamOptions): WsStreamManager<PublicEvent<'orderbook'>>;
|
|
70
145
|
/** Subscribe to the candle stream. */
|
|
71
146
|
candle(codes: string[], opts?: {
|
|
72
147
|
interval?: string;
|
|
73
|
-
} & WsStreamOptions): WsStreamManager
|
|
148
|
+
} & WsStreamOptions): WsStreamManager<CandleEvent>;
|
|
74
149
|
/** Subscribe to the myOrder (my orders) stream. Requires authentication. */
|
|
75
|
-
myOrder(codes: string[], opts?: WsStreamOptions): WsStreamManager
|
|
150
|
+
myOrder(codes: string[], opts?: WsStreamOptions): WsStreamManager<PrivateEvent<'myOrder'>>;
|
|
76
151
|
/** Subscribe to the myAsset (my assets) stream. Requires authentication. */
|
|
77
|
-
myAsset(opts?: WsStreamOptions): WsStreamManager
|
|
152
|
+
myAsset(opts?: WsStreamOptions): WsStreamManager<PrivateEvent<'myAsset'>>;
|
|
153
|
+
/** Subscribe to the announcement stream. Requires authentication. */
|
|
154
|
+
announcement(opts?: WsAnnouncementOptions): WsStreamManager<PrivateEvent<'announcement'>>;
|
|
155
|
+
/** Subscribe to calculated indicator values. Requires authentication. */
|
|
156
|
+
indicator(codes: string[], opts: WsIndicatorOptions): WsStreamManager<InfoEvent<'indicator'>>;
|
|
157
|
+
/** Subscribe to technical indicator condition transitions. Requires authentication. */
|
|
158
|
+
indicatorSignal(codes: string[], opts: WsIndicatorSignalOptions): WsStreamManager<InfoEvent<'indicator_signal'>>;
|
|
78
159
|
/** Subscribe to multiple public streams at once. */
|
|
79
160
|
subscribe(opts: {
|
|
80
161
|
ticker?: string[];
|
|
@@ -84,12 +165,18 @@ export declare class WsStream {
|
|
|
84
165
|
codes: string[];
|
|
85
166
|
interval?: string;
|
|
86
167
|
};
|
|
87
|
-
} & WsStreamOptions): WsStreamManager
|
|
168
|
+
} & WsStreamOptions): WsStreamManager<ConnectPublicServerEvent>;
|
|
88
169
|
/** Subscribe to multiple private streams at once. Requires authentication. */
|
|
89
170
|
subscribePrivate(opts: {
|
|
171
|
+
announcement?: boolean | Pick<WsAnnouncementOptions, 'categories' | 'includeBody'>;
|
|
90
172
|
myOrder?: string[];
|
|
91
173
|
myAsset?: boolean;
|
|
92
|
-
} & WsStreamOptions): WsStreamManager
|
|
174
|
+
} & WsStreamOptions): WsStreamManager<ConnectPrivateServerEvent>;
|
|
175
|
+
/** Subscribe to multiple info streams at once. Requires authentication. */
|
|
176
|
+
subscribeInfo(opts: {
|
|
177
|
+
indicator?: WsIndicatorSubscription | WsIndicatorSubscription[];
|
|
178
|
+
indicatorSignal?: WsIndicatorSignalSubscription | WsIndicatorSignalSubscription[];
|
|
179
|
+
} & WsStreamOptions): WsStreamManager<ConnectInfoServerEvent>;
|
|
93
180
|
}
|
|
94
181
|
export {};
|
|
95
182
|
//# sourceMappingURL=ws.d.ts.map
|
package/lib/ws.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws.d.ts","sourceRoot":"","sources":["../src/lib/ws.ts"],"names":[],"mappings":"OAMO,KAAK,EAAE,wBAAwB,EAAE;OACjC,KAAK,EAAE,yBAAyB,EAAE;
|
|
1
|
+
{"version":3,"file":"ws.d.ts","sourceRoot":"","sources":["../src/lib/ws.ts"],"names":[],"mappings":"OAMO,KAAK,EAAE,wBAAwB,EAAE;OACjC,KAAK,EACV,yBAAyB,EACzB,+BAA+B,EAC/B,+BAA+B,EAChC;OACM,KAAK,EAAE,oBAAoB,EAAE,yBAAyB,EAAE;OACxD,KAAK,EAAE,sBAAsB,EAAE;OAC/B,KAAK,EAAE,sBAAsB,EAAE;OAC/B,EAGL,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACtB;OACM,KAAK,EAAE,oBAAoB,EAAE;OAC7B,KAAK,EAAE,oBAAoB,IAAI,qBAAqB,EAAE;OACtD,KAAK,EAAE,KAAK,EAAE;AAErB,MAAM,WAAW,eAAe;IAC9B,gFAAgF;IAChF,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wCAAwC;IACxC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,aAAa,CAAC;AAEhF,oBAAY,UAAU;IACpB,MAAM,WAAW;IACjB,O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