@upbit-official/upbit-sdk 0.9.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/LICENSE +201 -0
- package/README.md +390 -0
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +261 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +261 -0
- package/client.d.ts.map +1 -0
- package/client.js +557 -0
- package/client.js.map +1 -0
- package/client.mjs +553 -0
- package/client.mjs.map +1 -0
- package/core/EventEmitter.d.mts +56 -0
- package/core/EventEmitter.d.mts.map +1 -0
- package/core/EventEmitter.d.ts +56 -0
- package/core/EventEmitter.d.ts.map +1 -0
- package/core/EventEmitter.js +93 -0
- package/core/EventEmitter.js.map +1 -0
- package/core/EventEmitter.mjs +88 -0
- package/core/EventEmitter.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +73 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +69 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +51 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +51 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +150 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +133 -0
- package/core/error.mjs.map +1 -0
- package/core/pagination.d.mts +63 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +63 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +125 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +118 -0
- package/core/pagination.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +10 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +6 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +8 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +8 -0
- package/index.d.ts.map +1 -0
- package/index.js +36 -0
- package/index.js.map +1 -0
- package/index.mjs +8 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +3 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +2 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +40 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +35 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +78 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +73 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +40 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +37 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/request-options.d.mts +78 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +78 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +13 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +9 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +9 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +8 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +26 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +26 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +97 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +90 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +3 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +2 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +37 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +32 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +21 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +17 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +84 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +78 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +9 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +5 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +6 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +2 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +21 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +17 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +111 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +93 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +8 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +8 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/internal/ws.d.mts +31 -0
- package/internal/ws.d.mts.map +1 -0
- package/internal/ws.d.ts +31 -0
- package/internal/ws.d.ts.map +1 -0
- package/internal/ws.js +39 -0
- package/internal/ws.js.map +1 -0
- package/internal/ws.mjs +36 -0
- package/internal/ws.mjs.map +1 -0
- package/lib/index.d.mts +5 -0
- package/lib/index.d.mts.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +11 -0
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +4 -0
- package/lib/index.mjs.map +1 -0
- package/lib/jsonParseFloat.d.mts +16 -0
- package/lib/jsonParseFloat.d.mts.map +1 -0
- package/lib/jsonParseFloat.d.ts +16 -0
- package/lib/jsonParseFloat.d.ts.map +1 -0
- package/lib/jsonParseFloat.js +77 -0
- package/lib/jsonParseFloat.js.map +1 -0
- package/lib/jsonParseFloat.mjs +74 -0
- package/lib/jsonParseFloat.mjs.map +1 -0
- package/lib/jwtAuth.d.mts +7 -0
- package/lib/jwtAuth.d.mts.map +1 -0
- package/lib/jwtAuth.d.ts +7 -0
- package/lib/jwtAuth.d.ts.map +1 -0
- package/lib/jwtAuth.js +33 -0
- package/lib/jwtAuth.js.map +1 -0
- package/lib/jwtAuth.mjs +30 -0
- package/lib/jwtAuth.mjs.map +1 -0
- package/lib/ws.d.mts +95 -0
- package/lib/ws.d.mts.map +1 -0
- package/lib/ws.d.ts +95 -0
- package/lib/ws.d.ts.map +1 -0
- package/lib/ws.js +229 -0
- package/lib/ws.js.map +1 -0
- package/lib/ws.mjs +223 -0
- package/lib/ws.mjs.map +1 -0
- package/package.json +169 -0
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/accounts.d.mts +48 -0
- package/resources/accounts.d.mts.map +1 -0
- package/resources/accounts.d.ts +48 -0
- package/resources/accounts.d.ts.map +1 -0
- package/resources/accounts.js +19 -0
- package/resources/accounts.js.map +1 -0
- package/resources/accounts.mjs +15 -0
- package/resources/accounts.mjs.map +1 -0
- package/resources/api-keys.d.mts +33 -0
- package/resources/api-keys.d.mts.map +1 -0
- package/resources/api-keys.d.ts +33 -0
- package/resources/api-keys.d.ts.map +1 -0
- package/resources/api-keys.js +19 -0
- package/resources/api-keys.js.map +1 -0
- package/resources/api-keys.mjs +15 -0
- package/resources/api-keys.mjs.map +1 -0
- package/resources/candles.d.mts +310 -0
- package/resources/candles.d.mts.map +1 -0
- package/resources/candles.d.ts +310 -0
- package/resources/candles.d.ts.map +1 -0
- package/resources/candles.js +117 -0
- package/resources/candles.js.map +1 -0
- package/resources/candles.mjs +113 -0
- package/resources/candles.mjs.map +1 -0
- package/resources/deposits.d.mts +373 -0
- package/resources/deposits.d.mts.map +1 -0
- package/resources/deposits.d.ts +373 -0
- package/resources/deposits.d.ts.map +1 -0
- package/resources/deposits.js +139 -0
- package/resources/deposits.js.map +1 -0
- package/resources/deposits.mjs +135 -0
- package/resources/deposits.mjs.map +1 -0
- package/resources/index.d.mts +15 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +15 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +32 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +15 -0
- package/resources/index.mjs.map +1 -0
- package/resources/orderbooks.d.mts +134 -0
- package/resources/orderbooks.d.mts.map +1 -0
- package/resources/orderbooks.d.ts +134 -0
- package/resources/orderbooks.d.ts.map +1 -0
- package/resources/orderbooks.js +31 -0
- package/resources/orderbooks.js.map +1 -0
- package/resources/orderbooks.mjs +27 -0
- package/resources/orderbooks.mjs.map +1 -0
- package/resources/orders.d.mts +886 -0
- package/resources/orders.d.mts.map +1 -0
- package/resources/orders.d.ts +886 -0
- package/resources/orders.d.ts.map +1 -0
- package/resources/orders.js +250 -0
- package/resources/orders.js.map +1 -0
- package/resources/orders.mjs +246 -0
- package/resources/orders.mjs.map +1 -0
- package/resources/tickers.d.mts +184 -0
- package/resources/tickers.d.mts.map +1 -0
- package/resources/tickers.d.ts +184 -0
- package/resources/tickers.d.ts.map +1 -0
- package/resources/tickers.js +30 -0
- package/resources/tickers.js.map +1 -0
- package/resources/tickers.mjs +26 -0
- package/resources/tickers.mjs.map +1 -0
- package/resources/trades.d.mts +107 -0
- package/resources/trades.d.mts.map +1 -0
- package/resources/trades.d.ts +107 -0
- package/resources/trades.d.ts.map +1 -0
- package/resources/trades.js +19 -0
- package/resources/trades.js.map +1 -0
- package/resources/trades.mjs +15 -0
- package/resources/trades.mjs.map +1 -0
- package/resources/trading-pairs.d.mts +96 -0
- package/resources/trading-pairs.d.mts.map +1 -0
- package/resources/trading-pairs.d.ts +96 -0
- package/resources/trading-pairs.d.ts.map +1 -0
- package/resources/trading-pairs.js +19 -0
- package/resources/trading-pairs.js.map +1 -0
- package/resources/trading-pairs.mjs +15 -0
- package/resources/trading-pairs.mjs.map +1 -0
- package/resources/travel-rule.d.mts +139 -0
- package/resources/travel-rule.d.mts.map +1 -0
- package/resources/travel-rule.d.ts +139 -0
- package/resources/travel-rule.d.ts.map +1 -0
- package/resources/travel-rule.js +68 -0
- package/resources/travel-rule.js.map +1 -0
- package/resources/travel-rule.mjs +64 -0
- package/resources/travel-rule.mjs.map +1 -0
- package/resources/wallet-status.d.mts +74 -0
- package/resources/wallet-status.d.mts.map +1 -0
- package/resources/wallet-status.d.ts +74 -0
- package/resources/wallet-status.d.ts.map +1 -0
- package/resources/wallet-status.js +19 -0
- package/resources/wallet-status.js.map +1 -0
- package/resources/wallet-status.mjs +15 -0
- package/resources/wallet-status.mjs.map +1 -0
- package/resources/withdraws.d.mts +599 -0
- package/resources/withdraws.d.mts.map +1 -0
- package/resources/withdraws.d.ts +599 -0
- package/resources/withdraws.d.ts.map +1 -0
- package/resources/withdraws.js +139 -0
- package/resources/withdraws.js.map +1 -0
- package/resources/withdraws.mjs +135 -0
- package/resources/withdraws.mjs.map +1 -0
- package/resources/ws-private/index.d.mts +3 -0
- package/resources/ws-private/index.d.mts.map +1 -0
- package/resources/ws-private/index.d.ts +3 -0
- package/resources/ws-private/index.d.ts.map +1 -0
- package/resources/ws-private/index.js +6 -0
- package/resources/ws-private/index.js.map +1 -0
- package/resources/ws-private/index.mjs +2 -0
- package/resources/ws-private/index.mjs.map +1 -0
- package/resources/ws-private/internal-base.d.mts +58 -0
- package/resources/ws-private/internal-base.d.mts.map +1 -0
- package/resources/ws-private/internal-base.d.ts +58 -0
- package/resources/ws-private/internal-base.d.ts.map +1 -0
- package/resources/ws-private/internal-base.js +51 -0
- package/resources/ws-private/internal-base.js.map +1 -0
- package/resources/ws-private/internal-base.mjs +45 -0
- package/resources/ws-private/internal-base.mjs.map +1 -0
- package/resources/ws-private/ws-private.d.mts +224 -0
- package/resources/ws-private/ws-private.d.mts.map +1 -0
- package/resources/ws-private/ws-private.d.ts +224 -0
- package/resources/ws-private/ws-private.d.ts.map +1 -0
- package/resources/ws-private/ws-private.js +8 -0
- package/resources/ws-private/ws-private.js.map +1 -0
- package/resources/ws-private/ws-private.mjs +4 -0
- package/resources/ws-private/ws-private.mjs.map +1 -0
- package/resources/ws-private/ws.d.mts +85 -0
- package/resources/ws-private/ws.d.mts.map +1 -0
- package/resources/ws-private/ws.d.ts +85 -0
- package/resources/ws-private/ws.d.ts.map +1 -0
- package/resources/ws-private/ws.js +433 -0
- package/resources/ws-private/ws.js.map +1 -0
- package/resources/ws-private/ws.mjs +428 -0
- package/resources/ws-private/ws.mjs.map +1 -0
- package/resources/ws-private.d.mts +2 -0
- package/resources/ws-private.d.mts.map +1 -0
- package/resources/ws-private.d.ts +2 -0
- package/resources/ws-private.d.ts.map +1 -0
- package/resources/ws-private.js +5 -0
- package/resources/ws-private.js.map +1 -0
- package/resources/ws-private.mjs +2 -0
- package/resources/ws-private.mjs.map +1 -0
- package/resources/ws-public/index.d.mts +3 -0
- package/resources/ws-public/index.d.mts.map +1 -0
- package/resources/ws-public/index.d.ts +3 -0
- package/resources/ws-public/index.d.ts.map +1 -0
- package/resources/ws-public/index.js +6 -0
- package/resources/ws-public/index.js.map +1 -0
- package/resources/ws-public/index.mjs +2 -0
- package/resources/ws-public/index.mjs.map +1 -0
- package/resources/ws-public/internal-base.d.mts +58 -0
- package/resources/ws-public/internal-base.d.mts.map +1 -0
- package/resources/ws-public/internal-base.d.ts +58 -0
- package/resources/ws-public/internal-base.d.ts.map +1 -0
- package/resources/ws-public/internal-base.js +51 -0
- package/resources/ws-public/internal-base.js.map +1 -0
- package/resources/ws-public/internal-base.mjs +45 -0
- package/resources/ws-public/internal-base.mjs.map +1 -0
- package/resources/ws-public/ws-public.d.mts +427 -0
- package/resources/ws-public/ws-public.d.mts.map +1 -0
- package/resources/ws-public/ws-public.d.ts +427 -0
- package/resources/ws-public/ws-public.d.ts.map +1 -0
- package/resources/ws-public/ws-public.js +8 -0
- package/resources/ws-public/ws-public.js.map +1 -0
- package/resources/ws-public/ws-public.mjs +4 -0
- package/resources/ws-public/ws-public.mjs.map +1 -0
- package/resources/ws-public/ws.d.mts +85 -0
- package/resources/ws-public/ws.d.mts.map +1 -0
- package/resources/ws-public/ws.d.ts +85 -0
- package/resources/ws-public/ws.d.ts.map +1 -0
- package/resources/ws-public/ws.js +428 -0
- package/resources/ws-public/ws.js.map +1 -0
- package/resources/ws-public/ws.mjs +423 -0
- package/resources/ws-public/ws.mjs.map +1 -0
- package/resources/ws-public.d.mts +2 -0
- package/resources/ws-public.d.mts.map +1 -0
- package/resources/ws-public.d.ts +2 -0
- package/resources/ws-public.d.ts.map +1 -0
- package/resources/ws-public.js +5 -0
- package/resources/ws-public.js.map +1 -0
- package/resources/ws-public.mjs +2 -0
- package/resources/ws-public.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +1112 -0
- package/src/core/EventEmitter.ts +114 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +91 -0
- package/src/core/error.ts +182 -0
- package/src/core/pagination.ts +195 -0
- package/src/core/resource.ts +10 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +24 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +92 -0
- package/src/internal/errors.ts +32 -0
- package/src/internal/headers.ts +96 -0
- package/src/internal/parse.ts +56 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/request-options.ts +92 -0
- package/src/internal/shim-types.ts +25 -0
- package/src/internal/shims.ts +106 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +94 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +39 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +17 -0
- package/src/internal/utils/log.ts +125 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/query.ts +6 -0
- package/src/internal/utils/sleep.ts +2 -0
- package/src/internal/utils/uuid.ts +19 -0
- package/src/internal/utils/values.ts +104 -0
- package/src/internal/utils.ts +8 -0
- package/src/internal/ws.ts +68 -0
- package/src/lib/index.ts +4 -0
- package/src/lib/jsonParseFloat.ts +73 -0
- package/src/lib/jwtAuth.ts +39 -0
- package/src/lib/ws.ts +282 -0
- package/src/pagination.ts +2 -0
- package/src/resource.ts +2 -0
- package/src/resources/accounts.ts +59 -0
- package/src/resources/api-keys.ts +40 -0
- package/src/resources/candles.ts +392 -0
- package/src/resources/deposits.ts +484 -0
- package/src/resources/index.ts +102 -0
- package/src/resources/orderbooks.ts +170 -0
- package/src/resources/orders.ts +1102 -0
- package/src/resources/tickers.ts +233 -0
- package/src/resources/trades.ts +127 -0
- package/src/resources/trading-pairs.ts +120 -0
- package/src/resources/travel-rule.ts +181 -0
- package/src/resources/wallet-status.ts +87 -0
- package/src/resources/withdraws.ts +734 -0
- package/src/resources/ws-private/index.ts +3 -0
- package/src/resources/ws-private/internal-base.ts +99 -0
- package/src/resources/ws-private/ws-private.ts +283 -0
- package/src/resources/ws-private/ws.ts +529 -0
- package/src/resources/ws-private.ts +2 -0
- package/src/resources/ws-public/index.ts +3 -0
- package/src/resources/ws-public/internal-base.ts +99 -0
- package/src/resources/ws-public/ws-public.ts +561 -0
- package/src/resources/ws-public/ws.ts +525 -0
- package/src/resources/ws-public.ts +2 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fields declared as `number` in the SDK response interfaces.
|
|
3
|
+
* All other fields with `typeof value === 'number'` at runtime
|
|
4
|
+
* are assumed to be `string`-typed and will be coerced to strings.
|
|
5
|
+
*/
|
|
6
|
+
const NUMBER_FIELDS = new Set([
|
|
7
|
+
'timestamp',
|
|
8
|
+
'trade_timestamp',
|
|
9
|
+
'sequential_id',
|
|
10
|
+
'trades_count',
|
|
11
|
+
'count',
|
|
12
|
+
'decimal_precision',
|
|
13
|
+
'minimum_deposit_confirmations',
|
|
14
|
+
'block_elapsed_minutes',
|
|
15
|
+
'fee_level',
|
|
16
|
+
'security_level',
|
|
17
|
+
]);
|
|
18
|
+
/**
|
|
19
|
+
* Parses a JSON string with type-aware coercion.
|
|
20
|
+
*
|
|
21
|
+
* 1st pass (JSON.parse reviver): float tokens (containing `.`, `e`, `E`) are
|
|
22
|
+
* preserved as their original string representation to avoid precision loss.
|
|
23
|
+
* Uses the reviver's third argument `context.source` (TypeScript 5.2+ / modern runtimes).
|
|
24
|
+
* Falls back to standard number parsing when `context.source` is unavailable.
|
|
25
|
+
*
|
|
26
|
+
* 2nd pass (constructType): coerces values to match SDK declared types.
|
|
27
|
+
* - `string`-declared fields: `number` → `string` (e.g. balance `0` → `"0"`)
|
|
28
|
+
* - `number`-declared fields: `string` → `number` (e.g. timestamp `"123.45"` → `123.45`)
|
|
29
|
+
*
|
|
30
|
+
* Mirrors the behavior of Python SDK's `json.loads(parse_float=str)` + `construct_type()`.
|
|
31
|
+
*/
|
|
32
|
+
export function jsonParseFloat(text) {
|
|
33
|
+
const parsed = JSON.parse(text, (key, value, context) => {
|
|
34
|
+
if (typeof value !== 'number')
|
|
35
|
+
return value;
|
|
36
|
+
const src = context?.source;
|
|
37
|
+
if (!src)
|
|
38
|
+
return value;
|
|
39
|
+
return /[.eE]/.test(src) ? src : value;
|
|
40
|
+
});
|
|
41
|
+
return constructType(parsed);
|
|
42
|
+
}
|
|
43
|
+
function constructType(data) {
|
|
44
|
+
if (Array.isArray(data)) {
|
|
45
|
+
return data.map(constructType);
|
|
46
|
+
}
|
|
47
|
+
if (data !== null && typeof data === 'object') {
|
|
48
|
+
const obj = data;
|
|
49
|
+
const result = {};
|
|
50
|
+
for (const key of Object.keys(obj)) {
|
|
51
|
+
const value = obj[key];
|
|
52
|
+
if (NUMBER_FIELDS.has(key)) {
|
|
53
|
+
// number-declared field: coerce string → number
|
|
54
|
+
if (typeof value === 'string') {
|
|
55
|
+
result[key] = Number(value);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
result[key] = value;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else if (typeof value === 'number') {
|
|
62
|
+
// string-declared field: coerce number → string
|
|
63
|
+
result[key] = String(value);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
// recurse into nested objects and arrays
|
|
67
|
+
result[key] = constructType(value);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
return data;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=jsonParseFloat.mjs.map
|
|
@@ -0,0 +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;CACjB,CAAC,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,GAAW,EAAE,KAAc,EAAE,OAA6B,EAAE,EAAE;QAC7F,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QAC5C,MAAM,GAAG,GAAG,OAAO,EAAE,MAAM,CAAC;QAC5B,IAAI,CAAC,GAAG;YAAE,OAAO,KAAK,CAAC;QACvB,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;IACzC,CAAC,CAAC,CAAC;IACH,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,aAAa,CAAC,IAAa;IAClC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACjC,CAAC;IAED,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC9C,MAAM,GAAG,GAAG,IAA+B,CAAC;QAC5C,MAAM,MAAM,GAA4B,EAAE,CAAC;QAC3C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACnC,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;YAEvB,IAAI,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC3B,gDAAgD;gBAChD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;oBAC9B,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC9B,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;gBACtB,CAAC;YACH,CAAC;iBAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACrC,gDAAgD;gBAChD,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YAC9B,CAAC;iBAAM,CAAC;gBACN,yCAAyC;gBACzC,MAAM,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;YACrC,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a JWT token for Upbit API authentication (HS256).
|
|
3
|
+
*
|
|
4
|
+
* If query parameters are provided, their SHA512 hash is included in the payload.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createJwtToken(accessKey: string, secretKey: string, queryParams?: Record<string, unknown> | null): string;
|
|
7
|
+
//# sourceMappingURL=jwtAuth.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwtAuth.d.mts","sourceRoot":"","sources":["../src/lib/jwtAuth.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAC3C,MAAM,CAqBR"}
|
package/lib/jwtAuth.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a JWT token for Upbit API authentication (HS256).
|
|
3
|
+
*
|
|
4
|
+
* If query parameters are provided, their SHA512 hash is included in the payload.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createJwtToken(accessKey: string, secretKey: string, queryParams?: Record<string, unknown> | null): string;
|
|
7
|
+
//# sourceMappingURL=jwtAuth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwtAuth.d.ts","sourceRoot":"","sources":["../src/lib/jwtAuth.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAC3C,MAAM,CAqBR"}
|
package/lib/jwtAuth.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createJwtToken = createJwtToken;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
const uuid_1 = require("../internal/utils/uuid.js");
|
|
6
|
+
const query_1 = require("../internal/utils/query.js");
|
|
7
|
+
function base64url(buf) {
|
|
8
|
+
return buf.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Creates a JWT token for Upbit API authentication (HS256).
|
|
12
|
+
*
|
|
13
|
+
* If query parameters are provided, their SHA512 hash is included in the payload.
|
|
14
|
+
*/
|
|
15
|
+
function createJwtToken(accessKey, secretKey, queryParams) {
|
|
16
|
+
const header = { alg: 'HS256', typ: 'JWT' };
|
|
17
|
+
const payload = {
|
|
18
|
+
access_key: accessKey,
|
|
19
|
+
nonce: (0, uuid_1.uuid4)(),
|
|
20
|
+
};
|
|
21
|
+
if (queryParams && Object.keys(queryParams).length > 0) {
|
|
22
|
+
const queryString = decodeURIComponent((0, query_1.stringifyQuery)(queryParams));
|
|
23
|
+
const queryHash = (0, crypto_1.createHash)('sha512').update(queryString, 'utf8').digest('hex');
|
|
24
|
+
payload['query_hash'] = queryHash;
|
|
25
|
+
payload['query_hash_alg'] = 'SHA512';
|
|
26
|
+
}
|
|
27
|
+
const encodedHeader = base64url(Buffer.from(JSON.stringify(header)));
|
|
28
|
+
const encodedPayload = base64url(Buffer.from(JSON.stringify(payload)));
|
|
29
|
+
const signingInput = `${encodedHeader}.${encodedPayload}`;
|
|
30
|
+
const signature = base64url((0, crypto_1.createHmac)('sha256', secretKey).update(signingInput).digest());
|
|
31
|
+
return `${signingInput}.${signature}`;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=jwtAuth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwtAuth.js","sourceRoot":"","sources":["../src/lib/jwtAuth.ts"],"names":[],"mappings":";;AAaA,wCAyBC;AAtCD,mCAAgD;AAChD,oDAA+C;AAC/C,sDAAyD;AAEzD,SAAS,SAAS,CAAC,GAAW;IAC5B,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC1F,CAAC;AAED;;;;GAIG;AACH,SAAgB,cAAc,CAC5B,SAAiB,EACjB,SAAiB,EACjB,WAA4C;IAE5C,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;IAE5C,MAAM,OAAO,GAA4B;QACvC,UAAU,EAAE,SAAS;QACrB,KAAK,EAAE,IAAA,YAAK,GAAE;KACf,CAAC;IAEF,IAAI,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvD,MAAM,WAAW,GAAG,kBAAkB,CAAC,IAAA,sBAAc,EAAC,WAAW,CAAC,CAAC,CAAC;QACpE,MAAM,SAAS,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACjF,OAAO,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC;QAClC,OAAO,CAAC,gBAAgB,CAAC,GAAG,QAAQ,CAAC;IACvC,CAAC;IAED,MAAM,aAAa,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACrE,MAAM,cAAc,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACvE,MAAM,YAAY,GAAG,GAAG,aAAa,IAAI,cAAc,EAAE,CAAC;IAC1D,MAAM,SAAS,GAAG,SAAS,CAAC,IAAA,mBAAU,EAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAE3F,OAAO,GAAG,YAAY,IAAI,SAAS,EAAE,CAAC;AACxC,CAAC"}
|
package/lib/jwtAuth.mjs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createHmac, createHash } from 'crypto';
|
|
2
|
+
import { uuid4 } from "../internal/utils/uuid.mjs";
|
|
3
|
+
import { stringifyQuery } from "../internal/utils/query.mjs";
|
|
4
|
+
function base64url(buf) {
|
|
5
|
+
return buf.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Creates a JWT token for Upbit API authentication (HS256).
|
|
9
|
+
*
|
|
10
|
+
* If query parameters are provided, their SHA512 hash is included in the payload.
|
|
11
|
+
*/
|
|
12
|
+
export function createJwtToken(accessKey, secretKey, queryParams) {
|
|
13
|
+
const header = { alg: 'HS256', typ: 'JWT' };
|
|
14
|
+
const payload = {
|
|
15
|
+
access_key: accessKey,
|
|
16
|
+
nonce: uuid4(),
|
|
17
|
+
};
|
|
18
|
+
if (queryParams && Object.keys(queryParams).length > 0) {
|
|
19
|
+
const queryString = decodeURIComponent(stringifyQuery(queryParams));
|
|
20
|
+
const queryHash = createHash('sha512').update(queryString, 'utf8').digest('hex');
|
|
21
|
+
payload['query_hash'] = queryHash;
|
|
22
|
+
payload['query_hash_alg'] = 'SHA512';
|
|
23
|
+
}
|
|
24
|
+
const encodedHeader = base64url(Buffer.from(JSON.stringify(header)));
|
|
25
|
+
const encodedPayload = base64url(Buffer.from(JSON.stringify(payload)));
|
|
26
|
+
const signingInput = `${encodedHeader}.${encodedPayload}`;
|
|
27
|
+
const signature = base64url(createHmac('sha256', secretKey).update(signingInput).digest());
|
|
28
|
+
return `${signingInput}.${signature}`;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=jwtAuth.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwtAuth.mjs","sourceRoot":"","sources":["../src/lib/jwtAuth.ts"],"names":[],"mappings":"OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,QAAQ;OACxC,EAAE,KAAK,EAAE;OACT,EAAE,cAAc,EAAE;AAEzB,SAAS,SAAS,CAAC,GAAW;IAC5B,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC1F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erEvent } from "../resources/ws-public/ws-public.mjs";
|
|
2
|
+
import type { ConnectPrivateServerEvent } from "../resources/ws-private/ws-private.mjs";
|
|
3
|
+
import type { Upbit } from "../client.mjs";
|
|
4
|
+
export interface WsStreamOptions {
|
|
5
|
+
/** Maximum number of reconnection attempts (default: 5) */
|
|
6
|
+
maxRetries?: number;
|
|
7
|
+
/** Reconnection delay in ms (default: 1000) */
|
|
8
|
+
retryDelayMs?: number;
|
|
9
|
+
/** Callback invoked on disconnection */
|
|
10
|
+
onDisconnect?: (code: number, reason: string) => void;
|
|
11
|
+
/** Callback invoked on successful reconnection */
|
|
12
|
+
onReconnect?: () => void;
|
|
13
|
+
}
|
|
14
|
+
type PublicSubscriptionType = {
|
|
15
|
+
type: 'ticker';
|
|
16
|
+
codes: string[];
|
|
17
|
+
} | {
|
|
18
|
+
type: 'trade';
|
|
19
|
+
codes: string[];
|
|
20
|
+
} | {
|
|
21
|
+
type: 'orderbook';
|
|
22
|
+
codes: string[];
|
|
23
|
+
} | {
|
|
24
|
+
type: string;
|
|
25
|
+
codes: string[];
|
|
26
|
+
};
|
|
27
|
+
type PrivateSubscriptionType = {
|
|
28
|
+
type: 'myOrder';
|
|
29
|
+
codes?: string[];
|
|
30
|
+
} | {
|
|
31
|
+
type: 'myAsset';
|
|
32
|
+
};
|
|
33
|
+
type AnySubscriptionType = PublicSubscriptionType | PrivateSubscriptionType;
|
|
34
|
+
/**
|
|
35
|
+
* Manages a WebSocket stream as an AsyncIterable.
|
|
36
|
+
*
|
|
37
|
+
* Use with `for await (const event of manager) { ... }`.
|
|
38
|
+
*/
|
|
39
|
+
export declare class WsStreamManager implements AsyncIterable<ConnectPublicServerEvent | ConnectPrivateServerEvent> {
|
|
40
|
+
private readonly client;
|
|
41
|
+
private readonly types;
|
|
42
|
+
private readonly isPrivate;
|
|
43
|
+
private readonly maxRetries;
|
|
44
|
+
private readonly retryDelayMs;
|
|
45
|
+
private readonly onDisconnect;
|
|
46
|
+
private readonly onReconnect;
|
|
47
|
+
private _currentWs;
|
|
48
|
+
constructor(client: Upbit, types: AnySubscriptionType[], isPrivate: boolean, opts?: WsStreamOptions);
|
|
49
|
+
/** Closes the current WebSocket connection. */
|
|
50
|
+
close(): void;
|
|
51
|
+
[Symbol.asyncIterator](): AsyncGenerator<ConnectPublicServerEvent | ConnectPrivateServerEvent>;
|
|
52
|
+
private _iterate;
|
|
53
|
+
private _connect;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Convenience API for WebSocket streams.
|
|
57
|
+
*
|
|
58
|
+
* Start a stream with `client.wsStream.ticker(['KRW-BTC'])` and
|
|
59
|
+
* receive events using `for await (const event of ...)`.
|
|
60
|
+
*/
|
|
61
|
+
export declare class WsStream {
|
|
62
|
+
private readonly client;
|
|
63
|
+
constructor(client: Upbit);
|
|
64
|
+
/** Subscribe to the ticker (current price) stream. */
|
|
65
|
+
ticker(codes: string[], opts?: WsStreamOptions): WsStreamManager;
|
|
66
|
+
/** Subscribe to the trade (executed order) stream. */
|
|
67
|
+
trade(codes: string[], opts?: WsStreamOptions): WsStreamManager;
|
|
68
|
+
/** Subscribe to the orderbook stream. */
|
|
69
|
+
orderbook(codes: string[], opts?: WsStreamOptions): WsStreamManager;
|
|
70
|
+
/** Subscribe to the candle stream. */
|
|
71
|
+
candle(codes: string[], opts?: {
|
|
72
|
+
interval?: string;
|
|
73
|
+
} & WsStreamOptions): WsStreamManager;
|
|
74
|
+
/** Subscribe to the myOrder (my orders) stream. Requires authentication. */
|
|
75
|
+
myOrder(codes: string[], opts?: WsStreamOptions): WsStreamManager;
|
|
76
|
+
/** Subscribe to the myAsset (my assets) stream. Requires authentication. */
|
|
77
|
+
myAsset(opts?: WsStreamOptions): WsStreamManager;
|
|
78
|
+
/** Subscribe to multiple public streams at once. */
|
|
79
|
+
subscribe(opts: {
|
|
80
|
+
ticker?: string[];
|
|
81
|
+
trade?: string[];
|
|
82
|
+
orderbook?: string[];
|
|
83
|
+
candle?: {
|
|
84
|
+
codes: string[];
|
|
85
|
+
interval?: string;
|
|
86
|
+
};
|
|
87
|
+
} & WsStreamOptions): WsStreamManager;
|
|
88
|
+
/** Subscribe to multiple private streams at once. Requires authentication. */
|
|
89
|
+
subscribePrivate(opts: {
|
|
90
|
+
myOrder?: string[];
|
|
91
|
+
myAsset?: boolean;
|
|
92
|
+
} & WsStreamOptions): WsStreamManager;
|
|
93
|
+
}
|
|
94
|
+
export {};
|
|
95
|
+
//# sourceMappingURL=ws.d.mts.map
|
package/lib/ws.d.mts.map
ADDED
|
@@ -0,0 +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;OAClC,KAAK,EAAE,KAAK,EAAE;AAErB,MAAM,WAAW,eAAe;IAC9B,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,KAAK,sBAAsB,GACvB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEtC,KAAK,uBAAuB,GAAG;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAA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Ae;IAInE,sCAAsC;IACtC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,eAAe,GAAG,eAAe;IAKxF,4EAA4E;IAC5E,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,eAAe;IAIjE,4EAA4E;IAC5E,OAAO,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,eAAe;IAIhD,oDAAoD;IACpD,SAAS,CACP,IAAI,EAAE;QACJ,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,MAAM,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,EAAE,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KACjD,GAAG,eAAe,GAClB,eAAe;IAelB,8EAA8E;IAC9E,gBAAgB,CACd,IAAI,EAAE;QACJ,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,GAAG,eAAe,GAClB,eAAe;CAYnB"}
|
package/lib/ws.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { ConnectPublicServerEvent } from "../resources/ws-public/ws-public.js";
|
|
2
|
+
import type { ConnectPrivateServerEvent } from "../resources/ws-private/ws-private.js";
|
|
3
|
+
import type { Upbit } from "../client.js";
|
|
4
|
+
export interface WsStreamOptions {
|
|
5
|
+
/** Maximum number of reconnection attempts (default: 5) */
|
|
6
|
+
maxRetries?: number;
|
|
7
|
+
/** Reconnection delay in ms (default: 1000) */
|
|
8
|
+
retryDelayMs?: number;
|
|
9
|
+
/** Callback invoked on disconnection */
|
|
10
|
+
onDisconnect?: (code: number, reason: string) => void;
|
|
11
|
+
/** Callback invoked on successful reconnection */
|
|
12
|
+
onReconnect?: () => void;
|
|
13
|
+
}
|
|
14
|
+
type PublicSubscriptionType = {
|
|
15
|
+
type: 'ticker';
|
|
16
|
+
codes: string[];
|
|
17
|
+
} | {
|
|
18
|
+
type: 'trade';
|
|
19
|
+
codes: string[];
|
|
20
|
+
} | {
|
|
21
|
+
type: 'orderbook';
|
|
22
|
+
codes: string[];
|
|
23
|
+
} | {
|
|
24
|
+
type: string;
|
|
25
|
+
codes: string[];
|
|
26
|
+
};
|
|
27
|
+
type PrivateSubscriptionType = {
|
|
28
|
+
type: 'myOrder';
|
|
29
|
+
codes?: string[];
|
|
30
|
+
} | {
|
|
31
|
+
type: 'myAsset';
|
|
32
|
+
};
|
|
33
|
+
type AnySubscriptionType = PublicSubscriptionType | PrivateSubscriptionType;
|
|
34
|
+
/**
|
|
35
|
+
* Manages a WebSocket stream as an AsyncIterable.
|
|
36
|
+
*
|
|
37
|
+
* Use with `for await (const event of manager) { ... }`.
|
|
38
|
+
*/
|
|
39
|
+
export declare class WsStreamManager implements AsyncIterable<ConnectPublicServerEvent | ConnectPrivateServerEvent> {
|
|
40
|
+
private readonly client;
|
|
41
|
+
private readonly types;
|
|
42
|
+
private readonly isPrivate;
|
|
43
|
+
private readonly maxRetries;
|
|
44
|
+
private readonly retryDelayMs;
|
|
45
|
+
private readonly onDisconnect;
|
|
46
|
+
private readonly onReconnect;
|
|
47
|
+
private _currentWs;
|
|
48
|
+
constructor(client: Upbit, types: AnySubscriptionType[], isPrivate: boolean, opts?: WsStreamOptions);
|
|
49
|
+
/** Closes the current WebSocket connection. */
|
|
50
|
+
close(): void;
|
|
51
|
+
[Symbol.asyncIterator](): AsyncGenerator<ConnectPublicServerEvent | ConnectPrivateServerEvent>;
|
|
52
|
+
private _iterate;
|
|
53
|
+
private _connect;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Convenience API for WebSocket streams.
|
|
57
|
+
*
|
|
58
|
+
* Start a stream with `client.wsStream.ticker(['KRW-BTC'])` and
|
|
59
|
+
* receive events using `for await (const event of ...)`.
|
|
60
|
+
*/
|
|
61
|
+
export declare class WsStream {
|
|
62
|
+
private readonly client;
|
|
63
|
+
constructor(client: Upbit);
|
|
64
|
+
/** Subscribe to the ticker (current price) stream. */
|
|
65
|
+
ticker(codes: string[], opts?: WsStreamOptions): WsStreamManager;
|
|
66
|
+
/** Subscribe to the trade (executed order) stream. */
|
|
67
|
+
trade(codes: string[], opts?: WsStreamOptions): WsStreamManager;
|
|
68
|
+
/** Subscribe to the orderbook stream. */
|
|
69
|
+
orderbook(codes: string[], opts?: WsStreamOptions): WsStreamManager;
|
|
70
|
+
/** Subscribe to the candle stream. */
|
|
71
|
+
candle(codes: string[], opts?: {
|
|
72
|
+
interval?: string;
|
|
73
|
+
} & WsStreamOptions): WsStreamManager;
|
|
74
|
+
/** Subscribe to the myOrder (my orders) stream. Requires authentication. */
|
|
75
|
+
myOrder(codes: string[], opts?: WsStreamOptions): WsStreamManager;
|
|
76
|
+
/** Subscribe to the myAsset (my assets) stream. Requires authentication. */
|
|
77
|
+
myAsset(opts?: WsStreamOptions): WsStreamManager;
|
|
78
|
+
/** Subscribe to multiple public streams at once. */
|
|
79
|
+
subscribe(opts: {
|
|
80
|
+
ticker?: string[];
|
|
81
|
+
trade?: string[];
|
|
82
|
+
orderbook?: string[];
|
|
83
|
+
candle?: {
|
|
84
|
+
codes: string[];
|
|
85
|
+
interval?: string;
|
|
86
|
+
};
|
|
87
|
+
} & WsStreamOptions): WsStreamManager;
|
|
88
|
+
/** Subscribe to multiple private streams at once. Requires authentication. */
|
|
89
|
+
subscribePrivate(opts: {
|
|
90
|
+
myOrder?: string[];
|
|
91
|
+
myAsset?: boolean;
|
|
92
|
+
} & WsStreamOptions): WsStreamManager;
|
|
93
|
+
}
|
|
94
|
+
export {};
|
|
95
|
+
//# sourceMappingURL=ws.d.ts.map
|
package/lib/ws.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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;QACJ,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,MAAM,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,EAAE,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KACjD,GAAG,eAAe,GAClB,eAAe;IAelB,8EAA8E;IAC9E,gBAAgB,CACd,IAAI,EAAE;QACJ,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,GAAG,eAAe,GAClB,eAAe;CAYnB"}
|
package/lib/ws.js
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WsStream = exports.WsStreamManager = void 0;
|
|
4
|
+
const tslib_1 = require("../internal/tslib.js");
|
|
5
|
+
const WS = tslib_1.__importStar(require("ws"));
|
|
6
|
+
const uuid_1 = require("../internal/utils/uuid.js");
|
|
7
|
+
const jwtAuth_1 = require("./jwtAuth.js");
|
|
8
|
+
const jsonParseFloat_1 = require("./jsonParseFloat.js");
|
|
9
|
+
const internal_base_1 = require("../resources/ws-public/internal-base.js");
|
|
10
|
+
const internal_base_2 = require("../resources/ws-private/internal-base.js");
|
|
11
|
+
function buildSubscriptionMessage(types) {
|
|
12
|
+
const fields = [{ ticket: (0, uuid_1.uuid4)() }];
|
|
13
|
+
for (const t of types) {
|
|
14
|
+
if ('codes' in t && t.codes) {
|
|
15
|
+
fields.push({ type: t.type, codes: t.codes });
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
fields.push({ type: t.type });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return JSON.stringify(fields);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Manages a WebSocket stream as an AsyncIterable.
|
|
25
|
+
*
|
|
26
|
+
* Use with `for await (const event of manager) { ... }`.
|
|
27
|
+
*/
|
|
28
|
+
class WsStreamManager {
|
|
29
|
+
constructor(client, types, isPrivate, opts = {}) {
|
|
30
|
+
this._currentWs = null;
|
|
31
|
+
this.client = client;
|
|
32
|
+
this.types = types;
|
|
33
|
+
this.isPrivate = isPrivate;
|
|
34
|
+
this.maxRetries = opts.maxRetries ?? 5;
|
|
35
|
+
this.retryDelayMs = opts.retryDelayMs ?? 1000;
|
|
36
|
+
if (opts.onDisconnect)
|
|
37
|
+
this.onDisconnect = opts.onDisconnect;
|
|
38
|
+
if (opts.onReconnect)
|
|
39
|
+
this.onReconnect = opts.onReconnect;
|
|
40
|
+
}
|
|
41
|
+
/** Closes the current WebSocket connection. */
|
|
42
|
+
close() {
|
|
43
|
+
if (this._currentWs &&
|
|
44
|
+
(this._currentWs.readyState === WS.WebSocket.OPEN ||
|
|
45
|
+
this._currentWs.readyState === WS.WebSocket.CONNECTING)) {
|
|
46
|
+
this._currentWs.close(1000, 'close() called');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
[Symbol.asyncIterator]() {
|
|
50
|
+
return this._iterate();
|
|
51
|
+
}
|
|
52
|
+
async *_iterate() {
|
|
53
|
+
let retries = 0;
|
|
54
|
+
while (true) {
|
|
55
|
+
const queue = [];
|
|
56
|
+
let resolve = null;
|
|
57
|
+
let reject = null;
|
|
58
|
+
let done = false;
|
|
59
|
+
let closeCode = 1000;
|
|
60
|
+
let closeReason = '';
|
|
61
|
+
const ws = await this._connect();
|
|
62
|
+
this._currentWs = ws;
|
|
63
|
+
ws.on('message', (data) => {
|
|
64
|
+
try {
|
|
65
|
+
const parsed = (0, jsonParseFloat_1.jsonParseFloat)(data.toString());
|
|
66
|
+
queue.push(parsed);
|
|
67
|
+
resolve?.();
|
|
68
|
+
resolve = null;
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
// ignore JSON parse errors
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
ws.on('close', (code, reason) => {
|
|
75
|
+
done = true;
|
|
76
|
+
closeCode = code;
|
|
77
|
+
closeReason = reason.toString();
|
|
78
|
+
resolve?.();
|
|
79
|
+
resolve = null;
|
|
80
|
+
});
|
|
81
|
+
ws.on('error', (err) => {
|
|
82
|
+
done = true;
|
|
83
|
+
reject?.(err);
|
|
84
|
+
reject = null;
|
|
85
|
+
resolve?.();
|
|
86
|
+
resolve = null;
|
|
87
|
+
});
|
|
88
|
+
try {
|
|
89
|
+
while (!done || queue.length > 0) {
|
|
90
|
+
if (queue.length === 0) {
|
|
91
|
+
await new Promise((res, rej) => {
|
|
92
|
+
resolve = res;
|
|
93
|
+
reject = rej;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
while (queue.length > 0) {
|
|
97
|
+
yield queue.shift();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
finally {
|
|
102
|
+
this._currentWs = null;
|
|
103
|
+
if (ws.readyState === WS.WebSocket.OPEN || ws.readyState === WS.WebSocket.CONNECTING) {
|
|
104
|
+
ws.close();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// normal close (1000, 1001) — end the stream
|
|
108
|
+
if (closeCode === 1000 || closeCode === 1001) {
|
|
109
|
+
this.onDisconnect?.(closeCode, closeReason);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
// attempt reconnect
|
|
113
|
+
this.onDisconnect?.(closeCode, closeReason);
|
|
114
|
+
if (retries >= this.maxRetries) {
|
|
115
|
+
throw new Error(`WebSocket disconnected (code=${closeCode}, reason=${closeReason}) after ${retries} retries`);
|
|
116
|
+
}
|
|
117
|
+
retries++;
|
|
118
|
+
await new Promise((r) => setTimeout(r, this.retryDelayMs));
|
|
119
|
+
this.onReconnect?.();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async _connect() {
|
|
123
|
+
const url = this.isPrivate ? (0, internal_base_2.buildURL)(this.client) : (0, internal_base_1.buildURL)(this.client);
|
|
124
|
+
const headers = {};
|
|
125
|
+
if (this.isPrivate) {
|
|
126
|
+
const { accessKey, secretKey } = this.client;
|
|
127
|
+
if (!accessKey || !secretKey) {
|
|
128
|
+
throw new Error('Private WebSocket requires accessKey and secretKey');
|
|
129
|
+
}
|
|
130
|
+
const token = (0, jwtAuth_1.createJwtToken)(accessKey, secretKey);
|
|
131
|
+
headers['Authorization'] = `Bearer ${token}`;
|
|
132
|
+
}
|
|
133
|
+
return new Promise((resolve, reject) => {
|
|
134
|
+
const ws = new WS.WebSocket(url.toString(), { headers });
|
|
135
|
+
const onOpen = () => {
|
|
136
|
+
ws.removeListener('error', onError);
|
|
137
|
+
ws.send(buildSubscriptionMessage(this.types));
|
|
138
|
+
resolve(ws);
|
|
139
|
+
};
|
|
140
|
+
const onError = (err) => {
|
|
141
|
+
ws.removeListener('open', onOpen);
|
|
142
|
+
reject(err);
|
|
143
|
+
};
|
|
144
|
+
ws.once('open', onOpen);
|
|
145
|
+
ws.once('error', onError);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
exports.WsStreamManager = WsStreamManager;
|
|
150
|
+
/**
|
|
151
|
+
* Convenience API for WebSocket streams.
|
|
152
|
+
*
|
|
153
|
+
* Start a stream with `client.wsStream.ticker(['KRW-BTC'])` and
|
|
154
|
+
* receive events using `for await (const event of ...)`.
|
|
155
|
+
*/
|
|
156
|
+
class WsStream {
|
|
157
|
+
constructor(client) {
|
|
158
|
+
this.client = client;
|
|
159
|
+
}
|
|
160
|
+
/** Subscribe to the ticker (current price) stream. */
|
|
161
|
+
ticker(codes, opts) {
|
|
162
|
+
return new WsStreamManager(this.client, [{ type: 'ticker', codes }], false, opts);
|
|
163
|
+
}
|
|
164
|
+
/** Subscribe to the trade (executed order) stream. */
|
|
165
|
+
trade(codes, opts) {
|
|
166
|
+
return new WsStreamManager(this.client, [{ type: 'trade', codes }], false, opts);
|
|
167
|
+
}
|
|
168
|
+
/** Subscribe to the orderbook stream. */
|
|
169
|
+
orderbook(codes, opts) {
|
|
170
|
+
return new WsStreamManager(this.client, [{ type: 'orderbook', codes }], false, opts);
|
|
171
|
+
}
|
|
172
|
+
/** Subscribe to the candle stream. */
|
|
173
|
+
candle(codes, opts) {
|
|
174
|
+
const { interval = '1m', ...streamOpts } = opts ?? {};
|
|
175
|
+
return new WsStreamManager(this.client, [{ type: `candle.${interval}`, codes }], false, streamOpts);
|
|
176
|
+
}
|
|
177
|
+
/** Subscribe to the myOrder (my orders) stream. Requires authentication. */
|
|
178
|
+
myOrder(codes, opts) {
|
|
179
|
+
return new WsStreamManager(this.client, [{ type: 'myOrder', codes }], true, opts);
|
|
180
|
+
}
|
|
181
|
+
/** Subscribe to the myAsset (my assets) stream. Requires authentication. */
|
|
182
|
+
myAsset(opts) {
|
|
183
|
+
return new WsStreamManager(this.client, [{ type: 'myAsset' }], true, opts);
|
|
184
|
+
}
|
|
185
|
+
/** Subscribe to multiple public streams at once. */
|
|
186
|
+
subscribe(opts) {
|
|
187
|
+
const { ticker, trade, orderbook, candle, maxRetries, retryDelayMs, onDisconnect, onReconnect } = opts;
|
|
188
|
+
const types = [];
|
|
189
|
+
if (ticker)
|
|
190
|
+
types.push({ type: 'ticker', codes: ticker });
|
|
191
|
+
if (trade)
|
|
192
|
+
types.push({ type: 'trade', codes: trade });
|
|
193
|
+
if (orderbook)
|
|
194
|
+
types.push({ type: 'orderbook', codes: orderbook });
|
|
195
|
+
if (candle)
|
|
196
|
+
types.push({ type: `candle.${candle.interval ?? '1m'}`, codes: candle.codes });
|
|
197
|
+
const streamOpts = {};
|
|
198
|
+
if (maxRetries !== undefined)
|
|
199
|
+
streamOpts.maxRetries = maxRetries;
|
|
200
|
+
if (retryDelayMs !== undefined)
|
|
201
|
+
streamOpts.retryDelayMs = retryDelayMs;
|
|
202
|
+
if (onDisconnect)
|
|
203
|
+
streamOpts.onDisconnect = onDisconnect;
|
|
204
|
+
if (onReconnect)
|
|
205
|
+
streamOpts.onReconnect = onReconnect;
|
|
206
|
+
return new WsStreamManager(this.client, types, false, streamOpts);
|
|
207
|
+
}
|
|
208
|
+
/** Subscribe to multiple private streams at once. Requires authentication. */
|
|
209
|
+
subscribePrivate(opts) {
|
|
210
|
+
const { myOrder, myAsset, maxRetries, retryDelayMs, onDisconnect, onReconnect } = opts;
|
|
211
|
+
const types = [];
|
|
212
|
+
if (myOrder)
|
|
213
|
+
types.push({ type: 'myOrder', codes: myOrder });
|
|
214
|
+
if (myAsset)
|
|
215
|
+
types.push({ type: 'myAsset' });
|
|
216
|
+
const streamOpts = {};
|
|
217
|
+
if (maxRetries !== undefined)
|
|
218
|
+
streamOpts.maxRetries = maxRetries;
|
|
219
|
+
if (retryDelayMs !== undefined)
|
|
220
|
+
streamOpts.retryDelayMs = retryDelayMs;
|
|
221
|
+
if (onDisconnect)
|
|
222
|
+
streamOpts.onDisconnect = onDisconnect;
|
|
223
|
+
if (onReconnect)
|
|
224
|
+
streamOpts.onReconnect = onReconnect;
|
|
225
|
+
return new WsStreamManager(this.client, types, true, streamOpts);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
exports.WsStream = WsStream;
|
|
229
|
+
//# sourceMappingURL=ws.js.map
|
package/lib/ws.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ws.js","sourceRoot":"","sources":["../src/lib/ws.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,oDAA+C;AAC/C,0CAA2C;AAC3C,wDAAkD;AAClD,2EAAkF;AAClF,4EAAoF;AA0BpF,SAAS,wBAAwB,CAAC,KAA4B;IAC5D,MAAM,MAAM,GAAa,CAAC,EAAE,MAAM,EAAE,IAAA,YAAK,GAAE,EAAE,CAAC,CAAC;IAC/C,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,IAAI,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;YAC5B,MAAM,CAAC,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