@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,224 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
export declare class WsPrivate extends APIResource {
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* WebSocket private client event — subscription request sent to server (JWT
|
|
6
|
+
* required)
|
|
7
|
+
*/
|
|
8
|
+
export type ConnectPrivateClientEvent = Array<ConnectPrivateClientEvent.WsTicketField | ConnectPrivateClientEvent.WsMyOrderTypeField | ConnectPrivateClientEvent.WsFormatField> | Array<ConnectPrivateClientEvent.WsTicketField | ConnectPrivateClientEvent.WsMyAssetTypeField | ConnectPrivateClientEvent.WsFormatField>;
|
|
9
|
+
export declare namespace ConnectPrivateClientEvent {
|
|
10
|
+
/**
|
|
11
|
+
* Ticket field that identifies the requester
|
|
12
|
+
*/
|
|
13
|
+
interface WsTicketField {
|
|
14
|
+
/**
|
|
15
|
+
* A value that uniquely identifies the requester (UUID recommended)
|
|
16
|
+
*/
|
|
17
|
+
ticket: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* MyOrder subscription type field
|
|
21
|
+
*/
|
|
22
|
+
interface WsMyOrderTypeField {
|
|
23
|
+
type: 'myOrder';
|
|
24
|
+
/**
|
|
25
|
+
* List of market codes. Omit or pass empty array for all markets.
|
|
26
|
+
*/
|
|
27
|
+
codes?: Array<string>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Response format specifier field
|
|
31
|
+
*/
|
|
32
|
+
interface WsFormatField {
|
|
33
|
+
/**
|
|
34
|
+
* Response format selector
|
|
35
|
+
*/
|
|
36
|
+
format?: 'DEFAULT' | 'SIMPLE' | 'JSON_LIST' | 'SIMPLE_LIST';
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* MyAsset subscription type field (codes field is not allowed)
|
|
40
|
+
*/
|
|
41
|
+
interface WsMyAssetTypeField {
|
|
42
|
+
type: 'myAsset';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* WebSocket private server event — stream message received from server (JWT
|
|
47
|
+
* required)
|
|
48
|
+
*/
|
|
49
|
+
export type ConnectPrivateServerEvent = ConnectPrivateServerEvent.MyOrder | ConnectPrivateServerEvent.MyAsset;
|
|
50
|
+
export declare namespace ConnectPrivateServerEvent {
|
|
51
|
+
/**
|
|
52
|
+
* My order (MyOrder) stream message payload
|
|
53
|
+
*/
|
|
54
|
+
interface MyOrder {
|
|
55
|
+
/**
|
|
56
|
+
* Data type
|
|
57
|
+
*/
|
|
58
|
+
type: 'myOrder';
|
|
59
|
+
/**
|
|
60
|
+
* Ask/bid side
|
|
61
|
+
*/
|
|
62
|
+
ask_bid?: 'ASK' | 'BID';
|
|
63
|
+
/**
|
|
64
|
+
* Average execution price
|
|
65
|
+
*/
|
|
66
|
+
avg_price?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Market code
|
|
69
|
+
*/
|
|
70
|
+
code?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Executed trade value
|
|
73
|
+
*/
|
|
74
|
+
executed_funds?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Executed quantity
|
|
77
|
+
*/
|
|
78
|
+
executed_volume?: string;
|
|
79
|
+
/**
|
|
80
|
+
* User-defined lookup value. Only provided for orders created after 2024-10-18.
|
|
81
|
+
*/
|
|
82
|
+
identifier?: string | null;
|
|
83
|
+
/**
|
|
84
|
+
* Whether the executed order is a maker order. Null when state is not trade.
|
|
85
|
+
*/
|
|
86
|
+
is_maker?: boolean | null;
|
|
87
|
+
/**
|
|
88
|
+
* Amount locked for this trade
|
|
89
|
+
*/
|
|
90
|
+
locked?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Order timestamp (ms)
|
|
93
|
+
*/
|
|
94
|
+
order_timestamp?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Order type
|
|
97
|
+
*/
|
|
98
|
+
order_type?: 'limit' | 'price' | 'market' | 'best';
|
|
99
|
+
/**
|
|
100
|
+
* Fee already paid
|
|
101
|
+
*/
|
|
102
|
+
paid_fee?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Amount (buy) or quantity (sell) cancelled by self-match prevention
|
|
105
|
+
*/
|
|
106
|
+
prevented_locked?: string | null;
|
|
107
|
+
/**
|
|
108
|
+
* Order quantity cancelled by self-match prevention
|
|
109
|
+
*/
|
|
110
|
+
prevented_volume?: string | null;
|
|
111
|
+
/**
|
|
112
|
+
* Order price. When state=trade, this is the execution price.
|
|
113
|
+
*/
|
|
114
|
+
price?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Remaining fee
|
|
117
|
+
*/
|
|
118
|
+
remaining_fee?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Remaining order quantity after execution
|
|
121
|
+
*/
|
|
122
|
+
remaining_volume?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Fee reserved for this order
|
|
125
|
+
*/
|
|
126
|
+
reserved_fee?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Self-match prevention type
|
|
129
|
+
*/
|
|
130
|
+
smp_type?: 'reduce' | 'cancel_maker' | 'cancel_taker' | null;
|
|
131
|
+
/**
|
|
132
|
+
* Order status
|
|
133
|
+
*/
|
|
134
|
+
state?: 'wait' | 'watch' | 'trade' | 'done' | 'cancel' | 'prevented';
|
|
135
|
+
/**
|
|
136
|
+
* Stream type (snapshot or realtime)
|
|
137
|
+
*/
|
|
138
|
+
stream_type?: 'SNAPSHOT' | 'REALTIME';
|
|
139
|
+
/**
|
|
140
|
+
* IOC/FOK/POST ONLY order condition
|
|
141
|
+
*/
|
|
142
|
+
time_in_force?: 'ioc' | 'fok' | 'post_only' | null;
|
|
143
|
+
/**
|
|
144
|
+
* Timestamp (ms)
|
|
145
|
+
*/
|
|
146
|
+
timestamp?: number;
|
|
147
|
+
/**
|
|
148
|
+
* Fee incurred on execution. Null when state is not trade.
|
|
149
|
+
*/
|
|
150
|
+
trade_fee?: string | null;
|
|
151
|
+
/**
|
|
152
|
+
* Trade timestamp (ms)
|
|
153
|
+
*/
|
|
154
|
+
trade_timestamp?: number | null;
|
|
155
|
+
/**
|
|
156
|
+
* Trade unique ID
|
|
157
|
+
*/
|
|
158
|
+
trade_uuid?: string | null;
|
|
159
|
+
/**
|
|
160
|
+
* Number of executions for this order
|
|
161
|
+
*/
|
|
162
|
+
trades_count?: number;
|
|
163
|
+
/**
|
|
164
|
+
* Order unique ID
|
|
165
|
+
*/
|
|
166
|
+
uuid?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Order quantity. When state=trade, this is the executed quantity.
|
|
169
|
+
*/
|
|
170
|
+
volume?: string;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* My asset (MyAsset) stream message payload
|
|
174
|
+
*/
|
|
175
|
+
interface MyAsset {
|
|
176
|
+
/**
|
|
177
|
+
* Data type
|
|
178
|
+
*/
|
|
179
|
+
type: 'myAsset';
|
|
180
|
+
/**
|
|
181
|
+
* Asset timestamp (ms)
|
|
182
|
+
*/
|
|
183
|
+
asset_timestamp?: number;
|
|
184
|
+
/**
|
|
185
|
+
* Asset unique ID
|
|
186
|
+
*/
|
|
187
|
+
asset_uuid?: string;
|
|
188
|
+
/**
|
|
189
|
+
* List of asset entries
|
|
190
|
+
*/
|
|
191
|
+
assets?: Array<MyAsset.Asset>;
|
|
192
|
+
/**
|
|
193
|
+
* Stream type (snapshot or realtime)
|
|
194
|
+
*/
|
|
195
|
+
stream_type?: 'SNAPSHOT' | 'REALTIME';
|
|
196
|
+
/**
|
|
197
|
+
* Timestamp (ms)
|
|
198
|
+
*/
|
|
199
|
+
timestamp?: number;
|
|
200
|
+
}
|
|
201
|
+
namespace MyAsset {
|
|
202
|
+
/**
|
|
203
|
+
* Asset entry
|
|
204
|
+
*/
|
|
205
|
+
interface Asset {
|
|
206
|
+
/**
|
|
207
|
+
* Available balance
|
|
208
|
+
*/
|
|
209
|
+
balance?: string;
|
|
210
|
+
/**
|
|
211
|
+
* Currency code (uppercase)
|
|
212
|
+
*/
|
|
213
|
+
currency?: string;
|
|
214
|
+
/**
|
|
215
|
+
* Balance locked in open orders
|
|
216
|
+
*/
|
|
217
|
+
locked?: string;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
export declare namespace WsPrivate {
|
|
222
|
+
export { type ConnectPrivateClientEvent as ConnectPrivateClientEvent, type ConnectPrivateServerEvent as ConnectPrivateServerEvent, };
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=ws-private.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ws-private.d.mts","sourceRoot":"","sources":["../../src/resources/ws-private/ws-private.ts"],"names":[],"mappings":"OACO,EAAE,WAAW,EAAE;AAEtB,qBAAa,SAAU,SAAQ,WAAW;CAAG;AAE7C;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GACjC,KAAK,CACD,yBAAyB,CAAC,aAAa,GACvC,yBAAyB,CAAC,kBAAkB,GAC5C,yBAAyB,CAAC,aAAa,CAC1C,GACD,KAAK,CACD,yBAAyB,CAAC,aAAa,GACvC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;QACH,eAAe,CAAC,EAAE,MAAM,CAAC;QAEzB;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,MAAM,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAE9B;;WAEG;QACH,WAAW,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;QAEtC;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;IAED,UAAiB,OAAO,CAAC;QACvB;;WAEG;QACH,UAAiB,KAAK;YACpB;;eAEG;YACH,OAAO,CAAC,EAAE,MAAM,CAAC;YAEjB;;eAEG;YACH,QAAQ,CAAC,EAAE,MAAM,CAAC;YAElB;;eAEG;YACH,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
export declare class WsPrivate extends APIResource {
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* WebSocket private client event — subscription request sent to server (JWT
|
|
6
|
+
* required)
|
|
7
|
+
*/
|
|
8
|
+
export type ConnectPrivateClientEvent = Array<ConnectPrivateClientEvent.WsTicketField | ConnectPrivateClientEvent.WsMyOrderTypeField | ConnectPrivateClientEvent.WsFormatField> | Array<ConnectPrivateClientEvent.WsTicketField | ConnectPrivateClientEvent.WsMyAssetTypeField | ConnectPrivateClientEvent.WsFormatField>;
|
|
9
|
+
export declare namespace ConnectPrivateClientEvent {
|
|
10
|
+
/**
|
|
11
|
+
* Ticket field that identifies the requester
|
|
12
|
+
*/
|
|
13
|
+
interface WsTicketField {
|
|
14
|
+
/**
|
|
15
|
+
* A value that uniquely identifies the requester (UUID recommended)
|
|
16
|
+
*/
|
|
17
|
+
ticket: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* MyOrder subscription type field
|
|
21
|
+
*/
|
|
22
|
+
interface WsMyOrderTypeField {
|
|
23
|
+
type: 'myOrder';
|
|
24
|
+
/**
|
|
25
|
+
* List of market codes. Omit or pass empty array for all markets.
|
|
26
|
+
*/
|
|
27
|
+
codes?: Array<string>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Response format specifier field
|
|
31
|
+
*/
|
|
32
|
+
interface WsFormatField {
|
|
33
|
+
/**
|
|
34
|
+
* Response format selector
|
|
35
|
+
*/
|
|
36
|
+
format?: 'DEFAULT' | 'SIMPLE' | 'JSON_LIST' | 'SIMPLE_LIST';
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* MyAsset subscription type field (codes field is not allowed)
|
|
40
|
+
*/
|
|
41
|
+
interface WsMyAssetTypeField {
|
|
42
|
+
type: 'myAsset';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* WebSocket private server event — stream message received from server (JWT
|
|
47
|
+
* required)
|
|
48
|
+
*/
|
|
49
|
+
export type ConnectPrivateServerEvent = ConnectPrivateServerEvent.MyOrder | ConnectPrivateServerEvent.MyAsset;
|
|
50
|
+
export declare namespace ConnectPrivateServerEvent {
|
|
51
|
+
/**
|
|
52
|
+
* My order (MyOrder) stream message payload
|
|
53
|
+
*/
|
|
54
|
+
interface MyOrder {
|
|
55
|
+
/**
|
|
56
|
+
* Data type
|
|
57
|
+
*/
|
|
58
|
+
type: 'myOrder';
|
|
59
|
+
/**
|
|
60
|
+
* Ask/bid side
|
|
61
|
+
*/
|
|
62
|
+
ask_bid?: 'ASK' | 'BID';
|
|
63
|
+
/**
|
|
64
|
+
* Average execution price
|
|
65
|
+
*/
|
|
66
|
+
avg_price?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Market code
|
|
69
|
+
*/
|
|
70
|
+
code?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Executed trade value
|
|
73
|
+
*/
|
|
74
|
+
executed_funds?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Executed quantity
|
|
77
|
+
*/
|
|
78
|
+
executed_volume?: string;
|
|
79
|
+
/**
|
|
80
|
+
* User-defined lookup value. Only provided for orders created after 2024-10-18.
|
|
81
|
+
*/
|
|
82
|
+
identifier?: string | null;
|
|
83
|
+
/**
|
|
84
|
+
* Whether the executed order is a maker order. Null when state is not trade.
|
|
85
|
+
*/
|
|
86
|
+
is_maker?: boolean | null;
|
|
87
|
+
/**
|
|
88
|
+
* Amount locked for this trade
|
|
89
|
+
*/
|
|
90
|
+
locked?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Order timestamp (ms)
|
|
93
|
+
*/
|
|
94
|
+
order_timestamp?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Order type
|
|
97
|
+
*/
|
|
98
|
+
order_type?: 'limit' | 'price' | 'market' | 'best';
|
|
99
|
+
/**
|
|
100
|
+
* Fee already paid
|
|
101
|
+
*/
|
|
102
|
+
paid_fee?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Amount (buy) or quantity (sell) cancelled by self-match prevention
|
|
105
|
+
*/
|
|
106
|
+
prevented_locked?: string | null;
|
|
107
|
+
/**
|
|
108
|
+
* Order quantity cancelled by self-match prevention
|
|
109
|
+
*/
|
|
110
|
+
prevented_volume?: string | null;
|
|
111
|
+
/**
|
|
112
|
+
* Order price. When state=trade, this is the execution price.
|
|
113
|
+
*/
|
|
114
|
+
price?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Remaining fee
|
|
117
|
+
*/
|
|
118
|
+
remaining_fee?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Remaining order quantity after execution
|
|
121
|
+
*/
|
|
122
|
+
remaining_volume?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Fee reserved for this order
|
|
125
|
+
*/
|
|
126
|
+
reserved_fee?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Self-match prevention type
|
|
129
|
+
*/
|
|
130
|
+
smp_type?: 'reduce' | 'cancel_maker' | 'cancel_taker' | null;
|
|
131
|
+
/**
|
|
132
|
+
* Order status
|
|
133
|
+
*/
|
|
134
|
+
state?: 'wait' | 'watch' | 'trade' | 'done' | 'cancel' | 'prevented';
|
|
135
|
+
/**
|
|
136
|
+
* Stream type (snapshot or realtime)
|
|
137
|
+
*/
|
|
138
|
+
stream_type?: 'SNAPSHOT' | 'REALTIME';
|
|
139
|
+
/**
|
|
140
|
+
* IOC/FOK/POST ONLY order condition
|
|
141
|
+
*/
|
|
142
|
+
time_in_force?: 'ioc' | 'fok' | 'post_only' | null;
|
|
143
|
+
/**
|
|
144
|
+
* Timestamp (ms)
|
|
145
|
+
*/
|
|
146
|
+
timestamp?: number;
|
|
147
|
+
/**
|
|
148
|
+
* Fee incurred on execution. Null when state is not trade.
|
|
149
|
+
*/
|
|
150
|
+
trade_fee?: string | null;
|
|
151
|
+
/**
|
|
152
|
+
* Trade timestamp (ms)
|
|
153
|
+
*/
|
|
154
|
+
trade_timestamp?: number | null;
|
|
155
|
+
/**
|
|
156
|
+
* Trade unique ID
|
|
157
|
+
*/
|
|
158
|
+
trade_uuid?: string | null;
|
|
159
|
+
/**
|
|
160
|
+
* Number of executions for this order
|
|
161
|
+
*/
|
|
162
|
+
trades_count?: number;
|
|
163
|
+
/**
|
|
164
|
+
* Order unique ID
|
|
165
|
+
*/
|
|
166
|
+
uuid?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Order quantity. When state=trade, this is the executed quantity.
|
|
169
|
+
*/
|
|
170
|
+
volume?: string;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* My asset (MyAsset) stream message payload
|
|
174
|
+
*/
|
|
175
|
+
interface MyAsset {
|
|
176
|
+
/**
|
|
177
|
+
* Data type
|
|
178
|
+
*/
|
|
179
|
+
type: 'myAsset';
|
|
180
|
+
/**
|
|
181
|
+
* Asset timestamp (ms)
|
|
182
|
+
*/
|
|
183
|
+
asset_timestamp?: number;
|
|
184
|
+
/**
|
|
185
|
+
* Asset unique ID
|
|
186
|
+
*/
|
|
187
|
+
asset_uuid?: string;
|
|
188
|
+
/**
|
|
189
|
+
* List of asset entries
|
|
190
|
+
*/
|
|
191
|
+
assets?: Array<MyAsset.Asset>;
|
|
192
|
+
/**
|
|
193
|
+
* Stream type (snapshot or realtime)
|
|
194
|
+
*/
|
|
195
|
+
stream_type?: 'SNAPSHOT' | 'REALTIME';
|
|
196
|
+
/**
|
|
197
|
+
* Timestamp (ms)
|
|
198
|
+
*/
|
|
199
|
+
timestamp?: number;
|
|
200
|
+
}
|
|
201
|
+
namespace MyAsset {
|
|
202
|
+
/**
|
|
203
|
+
* Asset entry
|
|
204
|
+
*/
|
|
205
|
+
interface Asset {
|
|
206
|
+
/**
|
|
207
|
+
* Available balance
|
|
208
|
+
*/
|
|
209
|
+
balance?: string;
|
|
210
|
+
/**
|
|
211
|
+
* Currency code (uppercase)
|
|
212
|
+
*/
|
|
213
|
+
currency?: string;
|
|
214
|
+
/**
|
|
215
|
+
* Balance locked in open orders
|
|
216
|
+
*/
|
|
217
|
+
locked?: string;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
export declare namespace WsPrivate {
|
|
222
|
+
export { type ConnectPrivateClientEvent as ConnectPrivateClientEvent, type ConnectPrivateServerEvent as ConnectPrivateServerEvent, };
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=ws-private.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ws-private.d.ts","sourceRoot":"","sources":["../../src/resources/ws-private/ws-private.ts"],"names":[],"mappings":"OACO,EAAE,WAAW,EAAE;AAEtB,qBAAa,SAAU,SAAQ,WAAW;CAAG;AAE7C;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GACjC,KAAK,CACD,yBAAyB,CAAC,aAAa,GACvC,yBAAyB,CAAC,kBAAkB,GAC5C,yBAAyB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OAAO;QACtB;;WAEG;QACH,IAAI,EAAE,SAAS,CAAC;QAEhB;;WAEG;QACH,eAAe,CAAC,EAAE,MAAM,CAAC;QAEzB;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,MAAM,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAE9B;;WAEG;QACH,WAAW,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;QAEtC;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;IAED,UAAiB,OAAO,CAAC;QACvB;;WAEG;QACH,UAAiB,KAAK;YACpB;;eAEG;YACH,OAAO,CAAC,EAAE,MAAM,CAAC;YAEjB;;eAEG;YACH,QAAQ,CAAC,EAAE,MAAM,CAAC;YAElB;;eAEG;YACH,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WsPrivate = void 0;
|
|
4
|
+
const resource_1 = require("../../core/resource.js");
|
|
5
|
+
class WsPrivate extends resource_1.APIResource {
|
|
6
|
+
}
|
|
7
|
+
exports.WsPrivate = WsPrivate;
|
|
8
|
+
//# sourceMappingURL=ws-private.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ws-private.js","sourceRoot":"","sources":["../../src/resources/ws-private/ws-private.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAElD,MAAa,SAAU,SAAQ,sBAAW;CAAG;AAA7C,8BAA6C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ws-private.mjs","sourceRoot":"","sources":["../../src/resources/ws-private/ws-private.ts"],"names":[],"mappings":"OACO,EAAE,WAAW,EAAE;AAEtB,MAAM,OAAO,SAAU,SAAQ,WAAW;CAAG"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as WS from 'ws';
|
|
2
|
+
import { WsPrivateEmitter, WsPrivateStreamMessage } from "./internal-base.mjs";
|
|
3
|
+
import { type ReconnectingEvent, type ReconnectingOverrides } from "../../internal/ws.mjs";
|
|
4
|
+
import * as WsPrivateAPI from "./ws-private.mjs";
|
|
5
|
+
import { Upbit } from "../../client.mjs";
|
|
6
|
+
export interface WsPrivateWSReconnectOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Called before each reconnect attempt. Return an object with
|
|
9
|
+
* `parameters` to override query parameters for the next connection.
|
|
10
|
+
*/
|
|
11
|
+
onReconnecting(event: ReconnectingEvent<Record<string, unknown>>): ReconnectingOverrides<Record<string, unknown>> | void;
|
|
12
|
+
/**
|
|
13
|
+
* Maximum number of reconnection attempts. Default: 5.
|
|
14
|
+
* Set to 0 to disable reconnection entirely.
|
|
15
|
+
*/
|
|
16
|
+
maxRetries?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Initial backoff delay in milliseconds. Default: 500.
|
|
19
|
+
*/
|
|
20
|
+
initialDelay?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Maximum backoff delay in milliseconds. Default: 8000.
|
|
23
|
+
*/
|
|
24
|
+
maxDelay?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface WsPrivateWSClientOptions extends WS.ClientOptions {
|
|
27
|
+
/**
|
|
28
|
+
* Options for automatic reconnection on recoverable close codes.
|
|
29
|
+
* Automatic reconnection is only enabled when this has a non-null value.
|
|
30
|
+
*/
|
|
31
|
+
reconnect?: WsPrivateWSReconnectOptions | null;
|
|
32
|
+
}
|
|
33
|
+
export declare class WsPrivateWS extends WsPrivateEmitter {
|
|
34
|
+
url: URL;
|
|
35
|
+
socket: WS.WebSocket;
|
|
36
|
+
private _client;
|
|
37
|
+
private _parameters;
|
|
38
|
+
private _wsOptions;
|
|
39
|
+
private _reconnectOptions;
|
|
40
|
+
private _sendQueue;
|
|
41
|
+
private _isReconnecting;
|
|
42
|
+
private _intentionallyClosed;
|
|
43
|
+
private _internalEvents;
|
|
44
|
+
constructor(client: Upbit, parameters?: Record<string, unknown> | undefined, options?: WsPrivateWSClientOptions | null | undefined);
|
|
45
|
+
send(event: WsPrivateAPI.ConnectPrivateClientEvent): void;
|
|
46
|
+
close(props?: {
|
|
47
|
+
code: number;
|
|
48
|
+
reason: string;
|
|
49
|
+
}): void;
|
|
50
|
+
/**
|
|
51
|
+
* Returns an async iterator over WebSocket lifecycle and message events,
|
|
52
|
+
* providing an alternative to the event-based `.on()` API.
|
|
53
|
+
* The iterator will exit if the socket closes but exiting the iterator
|
|
54
|
+
* does not close the socket.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* for await (const event of client.stream()) {
|
|
59
|
+
* switch (event.type) {
|
|
60
|
+
* case 'message':
|
|
61
|
+
* console.log('received:', event.message);
|
|
62
|
+
* break;
|
|
63
|
+
* case 'error':
|
|
64
|
+
* console.error(event.error);
|
|
65
|
+
* break;
|
|
66
|
+
* case 'close':
|
|
67
|
+
* console.log('connection closed');
|
|
68
|
+
* break;
|
|
69
|
+
* }
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
stream(): AsyncIterableIterator<WsPrivateStreamMessage>;
|
|
74
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<WsPrivateStreamMessage>;
|
|
75
|
+
private _connect;
|
|
76
|
+
private _canReconnect;
|
|
77
|
+
private _reconnect;
|
|
78
|
+
/**
|
|
79
|
+
* Resolves once the socket is open, rejects if it errors or closes first
|
|
80
|
+
*/
|
|
81
|
+
private _awaitOpen;
|
|
82
|
+
private _flushSendQueue;
|
|
83
|
+
private _authHeaders;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingUR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SAAS,EAChD,OAAO,CAAC,EAAE,wBAAwB,GAAG,IAAI,GAAG,SAAS;IAYvD,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,yBAAyB;IAgBlD,KAAK,CAAC,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAS9C;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAM,IAAI,qBAAqB,CAAC,sBAAsB,CAAC;IAIvD,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,qBAAqB,CAAC,sBAAsB,CAAC;IA0IvE,OAAO,CAAC,QAAQ;IA4DhB,OAAO,CAAC,aAAa;YAQP,UAAU;IAwIxB;;OAEG;IACH,OAAO,CAAC,UAAU;IAyBlB,OAAO,CAAC,eAAe;IAoBvB,OAAO,CAAC,YAAY;CAMrB"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as WS from 'ws';
|
|
2
|
+
import { WsPrivateEmitter, WsPrivateStreamMessage } from "./internal-base.js";
|
|
3
|
+
import { type ReconnectingEvent, type ReconnectingOverrides } from "../../internal/ws.js";
|
|
4
|
+
import * as WsPrivateAPI from "./ws-private.js";
|
|
5
|
+
import { Upbit } from "../../client.js";
|
|
6
|
+
export interface WsPrivateWSReconnectOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Called before each reconnect attempt. Return an object with
|
|
9
|
+
* `parameters` to override query parameters for the next connection.
|
|
10
|
+
*/
|
|
11
|
+
onReconnecting(event: ReconnectingEvent<Record<string, unknown>>): ReconnectingOverrides<Record<string, unknown>> | void;
|
|
12
|
+
/**
|
|
13
|
+
* Maximum number of reconnection attempts. Default: 5.
|
|
14
|
+
* Set to 0 to disable reconnection entirely.
|
|
15
|
+
*/
|
|
16
|
+
maxRetries?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Initial backoff delay in milliseconds. Default: 500.
|
|
19
|
+
*/
|
|
20
|
+
initialDelay?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Maximum backoff delay in milliseconds. Default: 8000.
|
|
23
|
+
*/
|
|
24
|
+
maxDelay?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface WsPrivateWSClientOptions extends WS.ClientOptions {
|
|
27
|
+
/**
|
|
28
|
+
* Options for automatic reconnection on recoverable close codes.
|
|
29
|
+
* Automatic reconnection is only enabled when this has a non-null value.
|
|
30
|
+
*/
|
|
31
|
+
reconnect?: WsPrivateWSReconnectOptions | null;
|
|
32
|
+
}
|
|
33
|
+
export declare class WsPrivateWS extends WsPrivateEmitter {
|
|
34
|
+
url: URL;
|
|
35
|
+
socket: WS.WebSocket;
|
|
36
|
+
private _client;
|
|
37
|
+
private _parameters;
|
|
38
|
+
private _wsOptions;
|
|
39
|
+
private _reconnectOptions;
|
|
40
|
+
private _sendQueue;
|
|
41
|
+
private _isReconnecting;
|
|
42
|
+
private _intentionallyClosed;
|
|
43
|
+
private _internalEvents;
|
|
44
|
+
constructor(client: Upbit, parameters?: Record<string, unknown> | undefined, options?: WsPrivateWSClientOptions | null | undefined);
|
|
45
|
+
send(event: WsPrivateAPI.ConnectPrivateClientEvent): void;
|
|
46
|
+
close(props?: {
|
|
47
|
+
code: number;
|
|
48
|
+
reason: string;
|
|
49
|
+
}): void;
|
|
50
|
+
/**
|
|
51
|
+
* Returns an async iterator over WebSocket lifecycle and message events,
|
|
52
|
+
* providing an alternative to the event-based `.on()` API.
|
|
53
|
+
* The iterator will exit if the socket closes but exiting the iterator
|
|
54
|
+
* does not close the socket.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* for await (const event of client.stream()) {
|
|
59
|
+
* switch (event.type) {
|
|
60
|
+
* case 'message':
|
|
61
|
+
* console.log('received:', event.message);
|
|
62
|
+
* break;
|
|
63
|
+
* case 'error':
|
|
64
|
+
* console.error(event.error);
|
|
65
|
+
* break;
|
|
66
|
+
* case 'close':
|
|
67
|
+
* console.log('connection closed');
|
|
68
|
+
* break;
|
|
69
|
+
* }
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
stream(): AsyncIterableIterator<WsPrivateStreamMessage>;
|
|
74
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<WsPrivateStreamMessage>;
|
|
75
|
+
private _connect;
|
|
76
|
+
private _canReconnect;
|
|
77
|
+
private _reconnect;
|
|
78
|
+
/**
|
|
79
|
+
* Resolves once the socket is open, rejects if it errors or closes first
|
|
80
|
+
*/
|
|
81
|
+
private _awaitOpen;
|
|
82
|
+
private _flushSendQueue;
|
|
83
|
+
private _authHeaders;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=ws.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ws.d.ts","sourceRoot":"","sources":["../../src/resources/ws-private/ws.ts"],"names":[],"mappings":"OACO,KAAK,EAAE,MAAM,IAAI;OACjB,EAAE,gBAAgB,EAAE,sBAAsB,EAA4B;OAGtE,EAAsB,KAAK,iBAAiB,EAAE,KAAK,qBAAqB,EAAE;OAC1E,KAAK,YAAY;OACjB,EAAE,KAAK,EAAE;AAIhB,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,cAAc,CACZ,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAChD,qBAAqB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAEzD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,wBAAyB,SAAQ,EAAE,CAAC,aAAa;IAChE;;;OAGG;IACH,SAAS,CAAC,EAAE,2BAA2B,GAAG,IAAI,CAAC;CAChD;AAED,qBAAa,WAAY,SAAQ,gB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