@woodger/t-invest-node-sdk 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +611 -0
- package/LICENSE +21 -0
- package/THIRD_PARTY_NOTICES.md +307 -0
- package/certificates/russian-trusted-root-ca.pem +33 -0
- package/dist/application/dto/t-invest-options.d.ts +30 -0
- package/dist/application/dto/t-invest-options.js +11 -0
- package/dist/application/dto/t-invest-services.d.ts +168 -0
- package/dist/application/dto/t-invest-services.js +12 -0
- package/dist/application/errors/sdk-error.d.ts +47 -0
- package/dist/application/errors/sdk-error.js +84 -0
- package/dist/application/reports/accounts.report.d.ts +26 -0
- package/dist/application/reports/accounts.report.js +11 -0
- package/dist/application/reports/accrued-interests.report.d.ts +22 -0
- package/dist/application/reports/accrued-interests.report.js +11 -0
- package/dist/application/reports/asset.report.d.ts +72 -0
- package/dist/application/reports/asset.report.js +11 -0
- package/dist/application/reports/bond-coupons.report.d.ts +31 -0
- package/dist/application/reports/bond-coupons.report.js +11 -0
- package/dist/application/reports/bond.report.d.ts +82 -0
- package/dist/application/reports/bond.report.js +11 -0
- package/dist/application/reports/brands.report.d.ts +24 -0
- package/dist/application/reports/brands.report.js +11 -0
- package/dist/application/reports/broker-report.report.d.ts +74 -0
- package/dist/application/reports/broker-report.report.js +11 -0
- package/dist/application/reports/cancel-order.report.d.ts +14 -0
- package/dist/application/reports/cancel-order.report.js +11 -0
- package/dist/application/reports/cancel-stop-order.report.d.ts +14 -0
- package/dist/application/reports/cancel-stop-order.report.js +11 -0
- package/dist/application/reports/candles.report.d.ts +26 -0
- package/dist/application/reports/candles.report.js +11 -0
- package/dist/application/reports/close-prices.report.d.ts +20 -0
- package/dist/application/reports/close-prices.report.js +11 -0
- package/dist/application/reports/countries.report.d.ts +20 -0
- package/dist/application/reports/countries.report.js +11 -0
- package/dist/application/reports/currency.report.d.ts +58 -0
- package/dist/application/reports/currency.report.js +11 -0
- package/dist/application/reports/dividends-foreign-issuer.report.d.ts +51 -0
- package/dist/application/reports/dividends-foreign-issuer.report.js +11 -0
- package/dist/application/reports/dividends.report.d.ts +33 -0
- package/dist/application/reports/dividends.report.js +11 -0
- package/dist/application/reports/etf.report.d.ts +62 -0
- package/dist/application/reports/etf.report.js +11 -0
- package/dist/application/reports/favorites.report.d.ts +24 -0
- package/dist/application/reports/favorites.report.js +11 -0
- package/dist/application/reports/find-instrument.report.d.ts +34 -0
- package/dist/application/reports/find-instrument.report.js +11 -0
- package/dist/application/reports/future.report.d.ts +66 -0
- package/dist/application/reports/future.report.js +11 -0
- package/dist/application/reports/futures-margin.report.d.ts +21 -0
- package/dist/application/reports/futures-margin.report.js +11 -0
- package/dist/application/reports/index.d.ts +50 -0
- package/dist/application/reports/index.js +66 -0
- package/dist/application/reports/instrument.report.d.ts +47 -0
- package/dist/application/reports/instrument.report.js +11 -0
- package/dist/application/reports/last-prices.report.d.ts +20 -0
- package/dist/application/reports/last-prices.report.js +11 -0
- package/dist/application/reports/last-trades.report.d.ts +24 -0
- package/dist/application/reports/last-trades.report.js +11 -0
- package/dist/application/reports/margin-attributes.report.d.ts +25 -0
- package/dist/application/reports/margin-attributes.report.js +11 -0
- package/dist/application/reports/money.report.d.ts +15 -0
- package/dist/application/reports/money.report.js +11 -0
- package/dist/application/reports/operations-by-cursor.report.d.ts +65 -0
- package/dist/application/reports/operations-by-cursor.report.js +11 -0
- package/dist/application/reports/operations.report.d.ts +40 -0
- package/dist/application/reports/operations.report.js +11 -0
- package/dist/application/reports/option.report.d.ts +76 -0
- package/dist/application/reports/option.report.js +11 -0
- package/dist/application/reports/order-book.report.d.ts +38 -0
- package/dist/application/reports/order-book.report.js +11 -0
- package/dist/application/reports/order-mutation.report.d.ts +45 -0
- package/dist/application/reports/order-mutation.report.js +11 -0
- package/dist/application/reports/order-state.report.d.ts +12 -0
- package/dist/application/reports/order-state.report.js +11 -0
- package/dist/application/reports/orders.report.d.ts +53 -0
- package/dist/application/reports/orders.report.js +11 -0
- package/dist/application/reports/portfolio.report.d.ts +54 -0
- package/dist/application/reports/portfolio.report.js +11 -0
- package/dist/application/reports/positions.report.d.ts +45 -0
- package/dist/application/reports/positions.report.js +11 -0
- package/dist/application/reports/post-stop-order.report.d.ts +14 -0
- package/dist/application/reports/post-stop-order.report.js +11 -0
- package/dist/application/reports/sandbox-account.report.d.ts +20 -0
- package/dist/application/reports/sandbox-account.report.js +11 -0
- package/dist/application/reports/share.report.d.ts +66 -0
- package/dist/application/reports/share.report.js +11 -0
- package/dist/application/reports/stop-orders.report.d.ts +34 -0
- package/dist/application/reports/stop-orders.report.js +11 -0
- package/dist/application/reports/trading-schedules.report.d.ts +44 -0
- package/dist/application/reports/trading-schedules.report.js +11 -0
- package/dist/application/reports/trading-status.report.d.ts +19 -0
- package/dist/application/reports/trading-status.report.js +11 -0
- package/dist/application/reports/trading-statuses.report.d.ts +12 -0
- package/dist/application/reports/trading-statuses.report.js +11 -0
- package/dist/application/reports/user-info.report.d.ts +16 -0
- package/dist/application/reports/user-info.report.js +11 -0
- package/dist/application/reports/user-tariff.report.d.ts +28 -0
- package/dist/application/reports/user-tariff.report.js +11 -0
- package/dist/application/reports/withdraw-limits.report.d.ts +16 -0
- package/dist/application/reports/withdraw-limits.report.js +11 -0
- package/dist/application/services/unary-limiter.d.ts +44 -0
- package/dist/application/services/unary-limiter.js +138 -0
- package/dist/bootstrap/args/command-options.d.ts +43 -0
- package/dist/bootstrap/args/command-options.js +125 -0
- package/dist/bootstrap/args/index.d.ts +1 -0
- package/dist/bootstrap/args/index.js +5 -0
- package/dist/bootstrap/args/instrument-id-options.d.ts +24 -0
- package/dist/bootstrap/args/instrument-id-options.js +47 -0
- package/dist/bootstrap/args/instruments-args.d.ts +49 -0
- package/dist/bootstrap/args/instruments-args.js +89 -0
- package/dist/bootstrap/args/sdk-options.d.ts +19 -0
- package/dist/bootstrap/args/sdk-options.js +40 -0
- package/dist/bootstrap/args/side-effect-args.d.ts +20 -0
- package/dist/bootstrap/args/side-effect-args.js +50 -0
- package/dist/bootstrap/cli/contract.d.ts +16 -0
- package/dist/bootstrap/cli/contract.js +15 -0
- package/dist/bootstrap/cli/domains.d.ts +260 -0
- package/dist/bootstrap/cli/domains.js +631 -0
- package/dist/bootstrap/cli/error.d.ts +15 -0
- package/dist/bootstrap/cli/error.js +40 -0
- package/dist/bootstrap/cli/help.d.ts +751 -0
- package/dist/bootstrap/cli/help.js +1789 -0
- package/dist/bootstrap/cli/registry.d.ts +2102 -0
- package/dist/bootstrap/cli/registry.js +186 -0
- package/dist/bootstrap/cli/runner.d.ts +10 -0
- package/dist/bootstrap/cli/runner.js +151 -0
- package/dist/bootstrap/cli/version.d.ts +17 -0
- package/dist/bootstrap/cli/version.js +26 -0
- package/dist/bootstrap/commands/accounts/cli.d.ts +63 -0
- package/dist/bootstrap/commands/accounts/cli.js +50 -0
- package/dist/bootstrap/commands/accounts/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/accounts/reporter.js +50 -0
- package/dist/bootstrap/commands/accrued-interests/cli.d.ts +129 -0
- package/dist/bootstrap/commands/accrued-interests/cli.js +80 -0
- package/dist/bootstrap/commands/accrued-interests/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/accrued-interests/reporter.js +43 -0
- package/dist/bootstrap/commands/asset/cli.d.ts +99 -0
- package/dist/bootstrap/commands/asset/cli.js +64 -0
- package/dist/bootstrap/commands/asset/reporter.d.ts +16 -0
- package/dist/bootstrap/commands/asset/reporter.js +122 -0
- package/dist/bootstrap/commands/assets/cli.d.ts +102 -0
- package/dist/bootstrap/commands/assets/cli.js +78 -0
- package/dist/bootstrap/commands/assets/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/assets/reporter.js +27 -0
- package/dist/bootstrap/commands/bond/cli.d.ts +83 -0
- package/dist/bootstrap/commands/bond/cli.js +53 -0
- package/dist/bootstrap/commands/bond/reporter.d.ts +15 -0
- package/dist/bootstrap/commands/bond/reporter.js +123 -0
- package/dist/bootstrap/commands/bond-coupons/cli.d.ts +129 -0
- package/dist/bootstrap/commands/bond-coupons/cli.js +80 -0
- package/dist/bootstrap/commands/bond-coupons/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/bond-coupons/reporter.js +64 -0
- package/dist/bootstrap/commands/bonds/cli.d.ts +73 -0
- package/dist/bootstrap/commands/bonds/cli.js +53 -0
- package/dist/bootstrap/commands/bonds/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/bonds/reporter.js +27 -0
- package/dist/bootstrap/commands/brand/cli.d.ts +99 -0
- package/dist/bootstrap/commands/brand/cli.js +64 -0
- package/dist/bootstrap/commands/brand/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/brand/reporter.js +37 -0
- package/dist/bootstrap/commands/brands/cli.d.ts +63 -0
- package/dist/bootstrap/commands/brands/cli.js +50 -0
- package/dist/bootstrap/commands/brands/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/brands/reporter.js +49 -0
- package/dist/bootstrap/commands/broker-report/cli.d.ts +132 -0
- package/dist/bootstrap/commands/broker-report/cli.js +105 -0
- package/dist/bootstrap/commands/broker-report/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/broker-report/reporter.js +123 -0
- package/dist/bootstrap/commands/cancel-order/cli.d.ts +120 -0
- package/dist/bootstrap/commands/cancel-order/cli.js +71 -0
- package/dist/bootstrap/commands/cancel-order/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/cancel-order/reporter.js +32 -0
- package/dist/bootstrap/commands/cancel-stop-order/cli.d.ts +120 -0
- package/dist/bootstrap/commands/cancel-stop-order/cli.js +71 -0
- package/dist/bootstrap/commands/cancel-stop-order/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/cancel-stop-order/reporter.js +32 -0
- package/dist/bootstrap/commands/candles/cli.d.ts +138 -0
- package/dist/bootstrap/commands/candles/cli.js +104 -0
- package/dist/bootstrap/commands/candles/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/candles/reporter.js +49 -0
- package/dist/bootstrap/commands/close-prices/cli.d.ts +99 -0
- package/dist/bootstrap/commands/close-prices/cli.js +66 -0
- package/dist/bootstrap/commands/close-prices/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/close-prices/reporter.js +43 -0
- package/dist/bootstrap/commands/compile-proto/cli.d.ts +12 -0
- package/dist/bootstrap/commands/compile-proto/cli.js +22 -0
- package/dist/bootstrap/commands/countries/cli.d.ts +63 -0
- package/dist/bootstrap/commands/countries/cli.js +50 -0
- package/dist/bootstrap/commands/countries/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/countries/reporter.js +42 -0
- package/dist/bootstrap/commands/currencies/cli.d.ts +73 -0
- package/dist/bootstrap/commands/currencies/cli.js +53 -0
- package/dist/bootstrap/commands/currencies/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/currencies/reporter.js +27 -0
- package/dist/bootstrap/commands/currency/cli.d.ts +83 -0
- package/dist/bootstrap/commands/currency/cli.js +53 -0
- package/dist/bootstrap/commands/currency/reporter.d.ts +15 -0
- package/dist/bootstrap/commands/currency/reporter.js +104 -0
- package/dist/bootstrap/commands/dividends/cli.d.ts +129 -0
- package/dist/bootstrap/commands/dividends/cli.js +80 -0
- package/dist/bootstrap/commands/dividends/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/dividends/reporter.js +62 -0
- package/dist/bootstrap/commands/dividends-foreign-issuer/cli.d.ts +132 -0
- package/dist/bootstrap/commands/dividends-foreign-issuer/cli.js +105 -0
- package/dist/bootstrap/commands/dividends-foreign-issuer/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/dividends-foreign-issuer/reporter.js +108 -0
- package/dist/bootstrap/commands/edit-favorites/cli.d.ts +129 -0
- package/dist/bootstrap/commands/edit-favorites/cli.js +78 -0
- package/dist/bootstrap/commands/edit-favorites/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/edit-favorites/reporter.js +23 -0
- package/dist/bootstrap/commands/etf/cli.d.ts +83 -0
- package/dist/bootstrap/commands/etf/cli.js +53 -0
- package/dist/bootstrap/commands/etf/reporter.d.ts +15 -0
- package/dist/bootstrap/commands/etf/reporter.js +109 -0
- package/dist/bootstrap/commands/etfs/cli.d.ts +73 -0
- package/dist/bootstrap/commands/etfs/cli.js +53 -0
- package/dist/bootstrap/commands/etfs/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/etfs/reporter.js +27 -0
- package/dist/bootstrap/commands/favorites/cli.d.ts +63 -0
- package/dist/bootstrap/commands/favorites/cli.js +50 -0
- package/dist/bootstrap/commands/favorites/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/favorites/reporter.js +60 -0
- package/dist/bootstrap/commands/find-instrument/cli.d.ts +126 -0
- package/dist/bootstrap/commands/find-instrument/cli.js +88 -0
- package/dist/bootstrap/commands/find-instrument/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/find-instrument/reporter.js +71 -0
- package/dist/bootstrap/commands/future/cli.d.ts +83 -0
- package/dist/bootstrap/commands/future/cli.js +53 -0
- package/dist/bootstrap/commands/future/reporter.d.ts +15 -0
- package/dist/bootstrap/commands/future/reporter.js +116 -0
- package/dist/bootstrap/commands/futures/cli.d.ts +73 -0
- package/dist/bootstrap/commands/futures/cli.js +53 -0
- package/dist/bootstrap/commands/futures/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/futures/reporter.js +27 -0
- package/dist/bootstrap/commands/futures-margin/cli.d.ts +105 -0
- package/dist/bootstrap/commands/futures-margin/cli.js +64 -0
- package/dist/bootstrap/commands/futures-margin/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/futures-margin/reporter.js +40 -0
- package/dist/bootstrap/commands/help/cli.d.ts +13 -0
- package/dist/bootstrap/commands/help/cli.js +26 -0
- package/dist/bootstrap/commands/instrument/cli.d.ts +83 -0
- package/dist/bootstrap/commands/instrument/cli.js +53 -0
- package/dist/bootstrap/commands/instrument/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/instrument/reporter.js +91 -0
- package/dist/bootstrap/commands/last-prices/cli.d.ts +99 -0
- package/dist/bootstrap/commands/last-prices/cli.js +66 -0
- package/dist/bootstrap/commands/last-prices/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/last-prices/reporter.js +43 -0
- package/dist/bootstrap/commands/last-trades/cli.d.ts +123 -0
- package/dist/bootstrap/commands/last-trades/cli.js +82 -0
- package/dist/bootstrap/commands/last-trades/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/last-trades/reporter.js +48 -0
- package/dist/bootstrap/commands/margin-attributes/cli.d.ts +99 -0
- package/dist/bootstrap/commands/margin-attributes/cli.js +64 -0
- package/dist/bootstrap/commands/margin-attributes/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/margin-attributes/reporter.js +51 -0
- package/dist/bootstrap/commands/operations/cli.d.ts +156 -0
- package/dist/bootstrap/commands/operations/cli.js +99 -0
- package/dist/bootstrap/commands/operations/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/operations/reporter.js +78 -0
- package/dist/bootstrap/commands/operations-by-cursor/cli.d.ts +204 -0
- package/dist/bootstrap/commands/operations-by-cursor/cli.js +164 -0
- package/dist/bootstrap/commands/operations-by-cursor/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/operations-by-cursor/reporter.js +107 -0
- package/dist/bootstrap/commands/option/cli.d.ts +83 -0
- package/dist/bootstrap/commands/option/cli.js +53 -0
- package/dist/bootstrap/commands/option/reporter.d.ts +15 -0
- package/dist/bootstrap/commands/option/reporter.js +125 -0
- package/dist/bootstrap/commands/options-by/cli.d.ts +108 -0
- package/dist/bootstrap/commands/options-by/cli.js +68 -0
- package/dist/bootstrap/commands/options-by/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/options-by/reporter.js +27 -0
- package/dist/bootstrap/commands/order-book/cli.d.ts +120 -0
- package/dist/bootstrap/commands/order-book/cli.js +73 -0
- package/dist/bootstrap/commands/order-book/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/order-book/reporter.js +60 -0
- package/dist/bootstrap/commands/order-state/cli.d.ts +111 -0
- package/dist/bootstrap/commands/order-state/cli.js +71 -0
- package/dist/bootstrap/commands/order-state/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/order-state/reporter.js +57 -0
- package/dist/bootstrap/commands/orders/cli.d.ts +99 -0
- package/dist/bootstrap/commands/orders/cli.js +64 -0
- package/dist/bootstrap/commands/orders/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/orders/reporter.js +88 -0
- package/dist/bootstrap/commands/portfolio/cli.d.ts +114 -0
- package/dist/bootstrap/commands/portfolio/cli.js +77 -0
- package/dist/bootstrap/commands/portfolio/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/portfolio/reporter.js +95 -0
- package/dist/bootstrap/commands/positions/cli.d.ts +99 -0
- package/dist/bootstrap/commands/positions/cli.js +64 -0
- package/dist/bootstrap/commands/positions/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/positions/reporter.js +116 -0
- package/dist/bootstrap/commands/post-order/cli.d.ts +192 -0
- package/dist/bootstrap/commands/post-order/cli.js +113 -0
- package/dist/bootstrap/commands/post-order/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/post-order/reporter.js +77 -0
- package/dist/bootstrap/commands/post-stop-order/cli.d.ts +216 -0
- package/dist/bootstrap/commands/post-stop-order/cli.js +145 -0
- package/dist/bootstrap/commands/post-stop-order/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/post-stop-order/reporter.js +31 -0
- package/dist/bootstrap/commands/replace-order/cli.d.ts +180 -0
- package/dist/bootstrap/commands/replace-order/cli.js +99 -0
- package/dist/bootstrap/commands/replace-order/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/replace-order/reporter.js +17 -0
- package/dist/bootstrap/commands/sandbox-accounts/cli.d.ts +64 -0
- package/dist/bootstrap/commands/sandbox-accounts/cli.js +54 -0
- package/dist/bootstrap/commands/sandbox-cancel-order/cli.d.ts +120 -0
- package/dist/bootstrap/commands/sandbox-cancel-order/cli.js +69 -0
- package/dist/bootstrap/commands/sandbox-close-account/cli.d.ts +108 -0
- package/dist/bootstrap/commands/sandbox-close-account/cli.js +66 -0
- package/dist/bootstrap/commands/sandbox-close-account/reporter.d.ts +12 -0
- package/dist/bootstrap/commands/sandbox-close-account/reporter.js +32 -0
- package/dist/bootstrap/commands/sandbox-open-account/cli.d.ts +70 -0
- package/dist/bootstrap/commands/sandbox-open-account/cli.js +57 -0
- package/dist/bootstrap/commands/sandbox-open-account/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/sandbox-open-account/reporter.js +31 -0
- package/dist/bootstrap/commands/sandbox-operations/cli.d.ts +156 -0
- package/dist/bootstrap/commands/sandbox-operations/cli.js +78 -0
- package/dist/bootstrap/commands/sandbox-operations-by-cursor/cli.d.ts +204 -0
- package/dist/bootstrap/commands/sandbox-operations-by-cursor/cli.js +98 -0
- package/dist/bootstrap/commands/sandbox-order-state/cli.d.ts +111 -0
- package/dist/bootstrap/commands/sandbox-order-state/cli.js +67 -0
- package/dist/bootstrap/commands/sandbox-orders/cli.d.ts +99 -0
- package/dist/bootstrap/commands/sandbox-orders/cli.js +63 -0
- package/dist/bootstrap/commands/sandbox-pay-in/cli.d.ts +135 -0
- package/dist/bootstrap/commands/sandbox-pay-in/cli.js +86 -0
- package/dist/bootstrap/commands/sandbox-pay-in/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/sandbox-pay-in/reporter.js +32 -0
- package/dist/bootstrap/commands/sandbox-portfolio/cli.d.ts +114 -0
- package/dist/bootstrap/commands/sandbox-portfolio/cli.js +68 -0
- package/dist/bootstrap/commands/sandbox-positions/cli.d.ts +99 -0
- package/dist/bootstrap/commands/sandbox-positions/cli.js +63 -0
- package/dist/bootstrap/commands/sandbox-post-order/cli.d.ts +192 -0
- package/dist/bootstrap/commands/sandbox-post-order/cli.js +90 -0
- package/dist/bootstrap/commands/sandbox-replace-order/cli.d.ts +180 -0
- package/dist/bootstrap/commands/sandbox-replace-order/cli.js +86 -0
- package/dist/bootstrap/commands/sandbox-withdraw-limits/cli.d.ts +99 -0
- package/dist/bootstrap/commands/sandbox-withdraw-limits/cli.js +63 -0
- package/dist/bootstrap/commands/share/cli.d.ts +83 -0
- package/dist/bootstrap/commands/share/cli.js +53 -0
- package/dist/bootstrap/commands/share/reporter.d.ts +15 -0
- package/dist/bootstrap/commands/share/reporter.js +111 -0
- package/dist/bootstrap/commands/shares/cli.d.ts +73 -0
- package/dist/bootstrap/commands/shares/cli.js +53 -0
- package/dist/bootstrap/commands/shares/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/shares/reporter.js +27 -0
- package/dist/bootstrap/commands/stop-orders/cli.d.ts +99 -0
- package/dist/bootstrap/commands/stop-orders/cli.js +68 -0
- package/dist/bootstrap/commands/stop-orders/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/stop-orders/reporter.js +69 -0
- package/dist/bootstrap/commands/stream-run/cli.d.ts +138 -0
- package/dist/bootstrap/commands/stream-run/cli.js +229 -0
- package/dist/bootstrap/commands/stream-run/config.d.ts +56 -0
- package/dist/bootstrap/commands/stream-run/config.js +468 -0
- package/dist/bootstrap/commands/stream-run/reporter.d.ts +30 -0
- package/dist/bootstrap/commands/stream-run/reporter.js +76 -0
- package/dist/bootstrap/commands/trading-schedules/cli.d.ts +120 -0
- package/dist/bootstrap/commands/trading-schedules/cli.js +79 -0
- package/dist/bootstrap/commands/trading-schedules/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/trading-schedules/reporter.js +58 -0
- package/dist/bootstrap/commands/trading-status/cli.d.ts +99 -0
- package/dist/bootstrap/commands/trading-status/cli.js +65 -0
- package/dist/bootstrap/commands/trading-status/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/trading-status/reporter.js +51 -0
- package/dist/bootstrap/commands/trading-statuses/cli.d.ts +99 -0
- package/dist/bootstrap/commands/trading-statuses/cli.js +64 -0
- package/dist/bootstrap/commands/trading-statuses/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/trading-statuses/reporter.js +44 -0
- package/dist/bootstrap/commands/user-info/cli.d.ts +63 -0
- package/dist/bootstrap/commands/user-info/cli.js +50 -0
- package/dist/bootstrap/commands/user-info/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/user-info/reporter.js +39 -0
- package/dist/bootstrap/commands/user-tariff/cli.d.ts +63 -0
- package/dist/bootstrap/commands/user-tariff/cli.js +50 -0
- package/dist/bootstrap/commands/user-tariff/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/user-tariff/reporter.js +50 -0
- package/dist/bootstrap/commands/version/cli.d.ts +13 -0
- package/dist/bootstrap/commands/version/cli.js +22 -0
- package/dist/bootstrap/commands/withdraw-limits/cli.d.ts +99 -0
- package/dist/bootstrap/commands/withdraw-limits/cli.js +64 -0
- package/dist/bootstrap/commands/withdraw-limits/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/withdraw-limits/reporter.js +59 -0
- package/dist/bootstrap/generated-exports.d.ts +29 -0
- package/dist/bootstrap/generated-exports.js +590 -0
- package/dist/bootstrap/index.d.ts +6 -0
- package/dist/bootstrap/index.js +22 -0
- package/dist/bootstrap/proto/compile-proto.d.ts +18 -0
- package/dist/bootstrap/proto/compile-proto.js +122 -0
- package/dist/bootstrap/sdk-config.d.ts +21 -0
- package/dist/bootstrap/sdk-config.js +152 -0
- package/dist/bootstrap/t-invest-node-sdk.d.ts +42 -0
- package/dist/bootstrap/t-invest-node-sdk.js +115 -0
- package/dist/bootstrap/unary-limit-config.d.ts +38 -0
- package/dist/bootstrap/unary-limit-config.js +130 -0
- package/dist/config.d.ts +160 -0
- package/dist/config.js +173 -0
- package/dist/config.types.d.ts +89 -0
- package/dist/config.types.js +13 -0
- package/dist/generated/common.d.ts +214 -0
- package/dist/generated/common.js +1336 -0
- package/dist/generated/google/api/field_behavior.d.ts +61 -0
- package/dist/generated/google/api/field_behavior.js +126 -0
- package/dist/generated/google/protobuf/descriptor.d.ts +1330 -0
- package/dist/generated/google/protobuf/descriptor.js +5984 -0
- package/dist/generated/google/protobuf/timestamp.d.ts +122 -0
- package/dist/generated/google/protobuf/timestamp.js +102 -0
- package/dist/generated/instruments.d.ts +3230 -0
- package/dist/generated/instruments.js +24246 -0
- package/dist/generated/marketdata.d.ts +1268 -0
- package/dist/generated/marketdata.js +8922 -0
- package/dist/generated/operations.d.ts +1165 -0
- package/dist/generated/operations.js +8625 -0
- package/dist/generated/orders.d.ts +806 -0
- package/dist/generated/orders.js +5639 -0
- package/dist/generated/sandbox.d.ts +356 -0
- package/dist/generated/sandbox.js +603 -0
- package/dist/generated/signals.d.ts +196 -0
- package/dist/generated/signals.js +1261 -0
- package/dist/generated/stoporders.d.ts +328 -0
- package/dist/generated/stoporders.js +1990 -0
- package/dist/generated/users.d.ts +453 -0
- package/dist/generated/users.js +2334 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +30 -0
- package/dist/infrastructure/interceptor/index.d.ts +1 -0
- package/dist/infrastructure/interceptor/index.js +17 -0
- package/dist/infrastructure/interceptor/warning-interceptor.d.ts +23 -0
- package/dist/infrastructure/interceptor/warning-interceptor.js +38 -0
- package/dist/infrastructure/report-values.d.ts +19 -0
- package/dist/infrastructure/report-values.js +50 -0
- package/dist/infrastructure/transport/grpc/index.d.ts +5 -0
- package/dist/infrastructure/transport/grpc/index.js +13 -0
- package/dist/infrastructure/transport/grpc/sdk-channel.d.ts +12 -0
- package/dist/infrastructure/transport/grpc/sdk-channel.js +23 -0
- package/dist/infrastructure/transport/grpc/sdk-client.d.ts +16 -0
- package/dist/infrastructure/transport/grpc/sdk-client.js +33 -0
- package/dist/infrastructure/transport/grpc/sdk-metadata.d.ts +12 -0
- package/dist/infrastructure/transport/grpc/sdk-metadata.js +22 -0
- package/dist/infrastructure/transport/grpc/sdk-middleware.d.ts +22 -0
- package/dist/infrastructure/transport/grpc/sdk-middleware.js +312 -0
- package/dist/infrastructure/transport/grpc/tls-root-certificates.d.ts +10 -0
- package/dist/infrastructure/transport/grpc/tls-root-certificates.js +20 -0
- package/dist/infrastructure/transport/grpc/unary-limit-resolver.d.ts +22 -0
- package/dist/infrastructure/transport/grpc/unary-limit-resolver.js +60 -0
- package/dist/infrastructure/transport/grpc/unary-limits.d.ts +1 -0
- package/dist/infrastructure/transport/grpc/unary-limits.js +7 -0
- package/docs/architecture.md +378 -0
- package/docs/bundled-ca.md +157 -0
- package/docs/clean-architecture/adapters.md +173 -0
- package/docs/clean-architecture/api-commands.md +487 -0
- package/docs/clean-architecture/application.md +137 -0
- package/docs/clean-architecture/cli-output-boundaries.md +256 -0
- package/docs/clean-architecture/dto.md +153 -0
- package/docs/clean-architecture/index.md +89 -0
- package/docs/cli-stream-configuration.md +305 -0
- package/docs/cli-stream-reference.md +195 -0
- package/docs/guides/custom-unary-limiter.md +552 -0
- package/docs/guides/errors-and-lifecycle.md +196 -0
- package/docs/guides/getting-started.md +100 -0
- package/docs/guides/index.md +43 -0
- package/docs/guides/streams-and-cancellation.md +177 -0
- package/docs/guides/testing-with-service-definitions.md +110 -0
- package/docs/guides/unary-calls.md +216 -0
- package/docs/index.md +86 -0
- package/docs/limits-policy.md +201 -0
- package/docs/roadmap.md +204 -0
- package/docs/tls-policy.md +62 -0
- package/package.json +62 -0
- package/readme.md +472 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль CLI-команды `stop-order cancel`.
|
|
3
|
+
*
|
|
4
|
+
* Здесь допустимы:
|
|
5
|
+
* - объявление command path и option schema;
|
|
6
|
+
* - преобразование CLI options в generated request;
|
|
7
|
+
* - создание SDK через bootstrap factory и закрытие SDK resource;
|
|
8
|
+
*
|
|
9
|
+
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
10
|
+
*/
|
|
11
|
+
import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
12
|
+
import type { CancelStopOrderRequest, CancelStopOrderResponse } from '../../../generated/stoporders';
|
|
13
|
+
import type { InferOptions } from 'icore';
|
|
14
|
+
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
+
import { formatCancelStopOrder } from './reporter';
|
|
16
|
+
type CancelStopOrderSdk = {
|
|
17
|
+
stoporders: {
|
|
18
|
+
cancelStopOrder(request: CancelStopOrderRequest): Promise<CancelStopOrderResponse>;
|
|
19
|
+
};
|
|
20
|
+
close(): void;
|
|
21
|
+
};
|
|
22
|
+
type CancelStopOrderSdkFactory = (options: TInvestOptions) => CancelStopOrderSdk;
|
|
23
|
+
declare const cancelStopOrderOptionsSchema: {
|
|
24
|
+
readonly token: {
|
|
25
|
+
readonly type: 'string';
|
|
26
|
+
};
|
|
27
|
+
readonly endpoint: {
|
|
28
|
+
readonly type: 'string';
|
|
29
|
+
};
|
|
30
|
+
readonly 'app-name': {
|
|
31
|
+
readonly type: 'string';
|
|
32
|
+
};
|
|
33
|
+
readonly insecure: {
|
|
34
|
+
readonly type: 'boolean';
|
|
35
|
+
};
|
|
36
|
+
readonly confirm: {
|
|
37
|
+
readonly type: 'boolean';
|
|
38
|
+
};
|
|
39
|
+
readonly 'account-id': {
|
|
40
|
+
readonly type: 'string';
|
|
41
|
+
readonly required: true;
|
|
42
|
+
};
|
|
43
|
+
readonly 'stop-order-id': {
|
|
44
|
+
readonly type: 'string';
|
|
45
|
+
readonly required: true;
|
|
46
|
+
};
|
|
47
|
+
readonly format: {
|
|
48
|
+
readonly type: 'string';
|
|
49
|
+
readonly choices: readonly ["json", "table"];
|
|
50
|
+
readonly default: 'table';
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
type CancelStopOrderOptions = InferOptions<typeof cancelStopOrderOptionsSchema>;
|
|
54
|
+
type CancelStopOrderRequestOptions = CommandRequestOptions<CancelStopOrderOptions, 'account-id' | 'stop-order-id'>;
|
|
55
|
+
export declare function createCancelStopOrderCommand(createSdk?: CancelStopOrderSdkFactory): Omit<import("icore").CommandDefinition<{
|
|
56
|
+
readonly token: {
|
|
57
|
+
readonly type: 'string';
|
|
58
|
+
};
|
|
59
|
+
readonly endpoint: {
|
|
60
|
+
readonly type: 'string';
|
|
61
|
+
};
|
|
62
|
+
readonly 'app-name': {
|
|
63
|
+
readonly type: 'string';
|
|
64
|
+
};
|
|
65
|
+
readonly insecure: {
|
|
66
|
+
readonly type: 'boolean';
|
|
67
|
+
};
|
|
68
|
+
readonly confirm: {
|
|
69
|
+
readonly type: 'boolean';
|
|
70
|
+
};
|
|
71
|
+
readonly 'account-id': {
|
|
72
|
+
readonly type: 'string';
|
|
73
|
+
readonly required: true;
|
|
74
|
+
};
|
|
75
|
+
readonly 'stop-order-id': {
|
|
76
|
+
readonly type: 'string';
|
|
77
|
+
readonly required: true;
|
|
78
|
+
};
|
|
79
|
+
readonly format: {
|
|
80
|
+
readonly type: 'string';
|
|
81
|
+
readonly choices: readonly ["json", "table"];
|
|
82
|
+
readonly default: 'table';
|
|
83
|
+
};
|
|
84
|
+
}, undefined, string, readonly ["stop-order", "cancel"], undefined, void, readonly []>, "metadata"> & {
|
|
85
|
+
metadata?: undefined;
|
|
86
|
+
};
|
|
87
|
+
export declare const cancelStopOrderCommand: Omit<import("icore").CommandDefinition<{
|
|
88
|
+
readonly token: {
|
|
89
|
+
readonly type: 'string';
|
|
90
|
+
};
|
|
91
|
+
readonly endpoint: {
|
|
92
|
+
readonly type: 'string';
|
|
93
|
+
};
|
|
94
|
+
readonly 'app-name': {
|
|
95
|
+
readonly type: 'string';
|
|
96
|
+
};
|
|
97
|
+
readonly insecure: {
|
|
98
|
+
readonly type: 'boolean';
|
|
99
|
+
};
|
|
100
|
+
readonly confirm: {
|
|
101
|
+
readonly type: 'boolean';
|
|
102
|
+
};
|
|
103
|
+
readonly 'account-id': {
|
|
104
|
+
readonly type: 'string';
|
|
105
|
+
readonly required: true;
|
|
106
|
+
};
|
|
107
|
+
readonly 'stop-order-id': {
|
|
108
|
+
readonly type: 'string';
|
|
109
|
+
readonly required: true;
|
|
110
|
+
};
|
|
111
|
+
readonly format: {
|
|
112
|
+
readonly type: 'string';
|
|
113
|
+
readonly choices: readonly ["json", "table"];
|
|
114
|
+
readonly default: 'table';
|
|
115
|
+
};
|
|
116
|
+
}, undefined, string, readonly ["stop-order", "cancel"], undefined, void, readonly []>, "metadata"> & {
|
|
117
|
+
metadata?: undefined;
|
|
118
|
+
};
|
|
119
|
+
export { formatCancelStopOrder };
|
|
120
|
+
export declare function createCancelStopOrderRequest(options: CancelStopOrderRequestOptions): CancelStopOrderRequest;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль CLI-команды `stop-order cancel`.
|
|
4
|
+
*
|
|
5
|
+
* Здесь допустимы:
|
|
6
|
+
* - объявление command path и option schema;
|
|
7
|
+
* - преобразование CLI options в generated request;
|
|
8
|
+
* - создание SDK через bootstrap factory и закрытие SDK resource;
|
|
9
|
+
*
|
|
10
|
+
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.formatCancelStopOrder = exports.cancelStopOrderCommand = void 0;
|
|
14
|
+
exports.createCancelStopOrderCommand = createCancelStopOrderCommand;
|
|
15
|
+
exports.createCancelStopOrderRequest = createCancelStopOrderRequest;
|
|
16
|
+
const contract_1 = require("../../cli/contract");
|
|
17
|
+
const args_1 = require("../../args");
|
|
18
|
+
const command_options_1 = require("../../args/command-options");
|
|
19
|
+
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
20
|
+
const side_effect_args_1 = require("../../args/side-effect-args");
|
|
21
|
+
const reporter_1 = require("./reporter");
|
|
22
|
+
Object.defineProperty(exports, "formatCancelStopOrder", { enumerable: true, get: function () { return reporter_1.formatCancelStopOrder; } });
|
|
23
|
+
const cancelStopOrderCommandPath = ['stop-order', 'cancel'];
|
|
24
|
+
const defaultCancelStopOrderSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
25
|
+
const cancelStopOrderRequestOptionsSchema = {
|
|
26
|
+
'account-id': {
|
|
27
|
+
type: 'string',
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
'stop-order-id': {
|
|
31
|
+
type: 'string',
|
|
32
|
+
required: true
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const cancelStopOrderFormatOptionsSchema = {
|
|
36
|
+
format: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
choices: reporter_1.cancelStopOrderFormats,
|
|
39
|
+
default: 'table'
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const cancelStopOrderOptionsSchema = (0, command_options_1.withSdkOptions)(cancelStopOrderRequestOptionsSchema, side_effect_args_1.sideEffectConfirmationOptionsSchema, cancelStopOrderFormatOptionsSchema);
|
|
43
|
+
function createCancelStopOrderCommand(createSdk = defaultCancelStopOrderSdkFactory) {
|
|
44
|
+
return contract_1.command.define({
|
|
45
|
+
path: cancelStopOrderCommandPath,
|
|
46
|
+
options: cancelStopOrderOptionsSchema,
|
|
47
|
+
handle({ options }) {
|
|
48
|
+
return runCancelStopOrderCommand(options, createSdk);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
exports.cancelStopOrderCommand = createCancelStopOrderCommand();
|
|
53
|
+
async function runCancelStopOrderCommand(options, createSdk) {
|
|
54
|
+
(0, side_effect_args_1.assertSideEffectConfirmed)(options.confirm);
|
|
55
|
+
const request = createCancelStopOrderRequest(options);
|
|
56
|
+
const { format } = options;
|
|
57
|
+
const sdk = createSdk((0, args_1.resolveSdkOptionsFromCommandOptions)(options));
|
|
58
|
+
try {
|
|
59
|
+
const response = await sdk.stoporders.cancelStopOrder(request);
|
|
60
|
+
return (0, reporter_1.formatCancelStopOrder)(response, format);
|
|
61
|
+
}
|
|
62
|
+
finally {
|
|
63
|
+
sdk.close();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function createCancelStopOrderRequest(options) {
|
|
67
|
+
return {
|
|
68
|
+
accountId: options['account-id'],
|
|
69
|
+
stopOrderId: options['stop-order-id']
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль CLI-репортинга команды `stop-order cancel`.
|
|
3
|
+
*
|
|
4
|
+
* Здесь допустимы mapping generated DTO в application report contract и
|
|
5
|
+
* presentation formatting. Разбор command options и запуск SDK остаются в `cli.ts`.
|
|
6
|
+
*/
|
|
7
|
+
import type { CancelStopOrderReport } from '../../../application/reports';
|
|
8
|
+
import type { CancelStopOrderResponse } from '../../../generated/stoporders';
|
|
9
|
+
export declare const cancelStopOrderFormats: readonly ['json', 'table'];
|
|
10
|
+
export type CancelStopOrderFormat = typeof cancelStopOrderFormats[number];
|
|
11
|
+
export declare function createCancelStopOrderReport(response: CancelStopOrderResponse): CancelStopOrderReport;
|
|
12
|
+
export declare function formatCancelStopOrderReport(report: CancelStopOrderReport, format: CancelStopOrderFormat): string;
|
|
13
|
+
export declare function formatCancelStopOrder(response: CancelStopOrderResponse, format: CancelStopOrderFormat): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль CLI-репортинга команды `stop-order cancel`.
|
|
4
|
+
*
|
|
5
|
+
* Здесь допустимы mapping generated DTO в application report contract и
|
|
6
|
+
* presentation formatting. Разбор command options и запуск SDK остаются в `cli.ts`.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.cancelStopOrderFormats = void 0;
|
|
10
|
+
exports.createCancelStopOrderReport = createCancelStopOrderReport;
|
|
11
|
+
exports.formatCancelStopOrderReport = formatCancelStopOrderReport;
|
|
12
|
+
exports.formatCancelStopOrder = formatCancelStopOrder;
|
|
13
|
+
const report_values_1 = require("../../../infrastructure/report-values");
|
|
14
|
+
const icore_1 = require("icore");
|
|
15
|
+
exports.cancelStopOrderFormats = ['json', 'table'];
|
|
16
|
+
function createCancelStopOrderReport(response) {
|
|
17
|
+
return {
|
|
18
|
+
time: (0, report_values_1.formatReportDate)(response.time)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function formatCancelStopOrderReport(report, format) {
|
|
22
|
+
if (format === 'json') {
|
|
23
|
+
return (0, icore_1.renderJson)(report);
|
|
24
|
+
}
|
|
25
|
+
return (0, icore_1.renderTextTable)([
|
|
26
|
+
['time'],
|
|
27
|
+
[report.time]
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
function formatCancelStopOrder(response, format) {
|
|
31
|
+
return formatCancelStopOrderReport(createCancelStopOrderReport(response), format);
|
|
32
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль CLI-команды `market candles`.
|
|
3
|
+
*
|
|
4
|
+
* Здесь допустимы:
|
|
5
|
+
* - объявление command path и option schema;
|
|
6
|
+
* - преобразование CLI options в generated request;
|
|
7
|
+
* - создание SDK через bootstrap factory и закрытие SDK resource;
|
|
8
|
+
*
|
|
9
|
+
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
10
|
+
*/
|
|
11
|
+
import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
12
|
+
import { GetCandlesRequest, type GetCandlesResponse } from '../../../generated/marketdata';
|
|
13
|
+
import { type InferOptions } from 'icore';
|
|
14
|
+
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
+
import { formatCandles } from './reporter';
|
|
16
|
+
type CandlesSdk = {
|
|
17
|
+
marketdata: {
|
|
18
|
+
getCandles(request: GetCandlesRequest): Promise<GetCandlesResponse>;
|
|
19
|
+
};
|
|
20
|
+
close(): void;
|
|
21
|
+
};
|
|
22
|
+
type CandlesSdkFactory = (options: TInvestOptions) => CandlesSdk;
|
|
23
|
+
declare const candlesOptionsSchema: {
|
|
24
|
+
readonly token: {
|
|
25
|
+
readonly type: 'string';
|
|
26
|
+
};
|
|
27
|
+
readonly endpoint: {
|
|
28
|
+
readonly type: 'string';
|
|
29
|
+
};
|
|
30
|
+
readonly 'app-name': {
|
|
31
|
+
readonly type: 'string';
|
|
32
|
+
};
|
|
33
|
+
readonly insecure: {
|
|
34
|
+
readonly type: 'boolean';
|
|
35
|
+
};
|
|
36
|
+
readonly 'instrument-id': {
|
|
37
|
+
readonly type: 'string';
|
|
38
|
+
readonly required: true;
|
|
39
|
+
};
|
|
40
|
+
readonly from: {
|
|
41
|
+
readonly type: 'string';
|
|
42
|
+
readonly required: true;
|
|
43
|
+
};
|
|
44
|
+
readonly to: {
|
|
45
|
+
readonly type: 'string';
|
|
46
|
+
readonly required: true;
|
|
47
|
+
};
|
|
48
|
+
readonly interval: {
|
|
49
|
+
readonly type: 'string';
|
|
50
|
+
readonly choices: ("10min" | "15min" | "1hour" | "1min" | "2hour" | "2min" | "30min" | "3min" | "4hour" | "5min" | "day" | "hour" | "month" | "week")[];
|
|
51
|
+
readonly required: true;
|
|
52
|
+
};
|
|
53
|
+
readonly format: {
|
|
54
|
+
readonly type: 'string';
|
|
55
|
+
readonly choices: readonly ["json", "csv"];
|
|
56
|
+
readonly default: 'json';
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
type CandlesOptions = InferOptions<typeof candlesOptionsSchema>;
|
|
60
|
+
type CandlesRequestOptions = CommandRequestOptions<CandlesOptions, 'instrument-id' | 'from' | 'to' | 'interval'>;
|
|
61
|
+
export declare function createCandlesCommand(createSdk?: CandlesSdkFactory): Omit<import("icore").CommandDefinition<{
|
|
62
|
+
readonly token: {
|
|
63
|
+
readonly type: 'string';
|
|
64
|
+
};
|
|
65
|
+
readonly endpoint: {
|
|
66
|
+
readonly type: 'string';
|
|
67
|
+
};
|
|
68
|
+
readonly 'app-name': {
|
|
69
|
+
readonly type: 'string';
|
|
70
|
+
};
|
|
71
|
+
readonly insecure: {
|
|
72
|
+
readonly type: 'boolean';
|
|
73
|
+
};
|
|
74
|
+
readonly 'instrument-id': {
|
|
75
|
+
readonly type: 'string';
|
|
76
|
+
readonly required: true;
|
|
77
|
+
};
|
|
78
|
+
readonly from: {
|
|
79
|
+
readonly type: 'string';
|
|
80
|
+
readonly required: true;
|
|
81
|
+
};
|
|
82
|
+
readonly to: {
|
|
83
|
+
readonly type: 'string';
|
|
84
|
+
readonly required: true;
|
|
85
|
+
};
|
|
86
|
+
readonly interval: {
|
|
87
|
+
readonly type: 'string';
|
|
88
|
+
readonly choices: ("10min" | "15min" | "1hour" | "1min" | "2hour" | "2min" | "30min" | "3min" | "4hour" | "5min" | "day" | "hour" | "month" | "week")[];
|
|
89
|
+
readonly required: true;
|
|
90
|
+
};
|
|
91
|
+
readonly format: {
|
|
92
|
+
readonly type: 'string';
|
|
93
|
+
readonly choices: readonly ["json", "csv"];
|
|
94
|
+
readonly default: 'json';
|
|
95
|
+
};
|
|
96
|
+
}, undefined, string, readonly ["market", "candles"], undefined, void, readonly []>, "metadata"> & {
|
|
97
|
+
metadata?: undefined;
|
|
98
|
+
};
|
|
99
|
+
export declare const candlesCommand: Omit<import("icore").CommandDefinition<{
|
|
100
|
+
readonly token: {
|
|
101
|
+
readonly type: 'string';
|
|
102
|
+
};
|
|
103
|
+
readonly endpoint: {
|
|
104
|
+
readonly type: 'string';
|
|
105
|
+
};
|
|
106
|
+
readonly 'app-name': {
|
|
107
|
+
readonly type: 'string';
|
|
108
|
+
};
|
|
109
|
+
readonly insecure: {
|
|
110
|
+
readonly type: 'boolean';
|
|
111
|
+
};
|
|
112
|
+
readonly 'instrument-id': {
|
|
113
|
+
readonly type: 'string';
|
|
114
|
+
readonly required: true;
|
|
115
|
+
};
|
|
116
|
+
readonly from: {
|
|
117
|
+
readonly type: 'string';
|
|
118
|
+
readonly required: true;
|
|
119
|
+
};
|
|
120
|
+
readonly to: {
|
|
121
|
+
readonly type: 'string';
|
|
122
|
+
readonly required: true;
|
|
123
|
+
};
|
|
124
|
+
readonly interval: {
|
|
125
|
+
readonly type: 'string';
|
|
126
|
+
readonly choices: ("10min" | "15min" | "1hour" | "1min" | "2hour" | "2min" | "30min" | "3min" | "4hour" | "5min" | "day" | "hour" | "month" | "week")[];
|
|
127
|
+
readonly required: true;
|
|
128
|
+
};
|
|
129
|
+
readonly format: {
|
|
130
|
+
readonly type: 'string';
|
|
131
|
+
readonly choices: readonly ["json", "csv"];
|
|
132
|
+
readonly default: 'json';
|
|
133
|
+
};
|
|
134
|
+
}, undefined, string, readonly ["market", "candles"], undefined, void, readonly []>, "metadata"> & {
|
|
135
|
+
metadata?: undefined;
|
|
136
|
+
};
|
|
137
|
+
export { formatCandles };
|
|
138
|
+
export declare function createCandlesRequest(options: CandlesRequestOptions): GetCandlesRequest;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль CLI-команды `market candles`.
|
|
4
|
+
*
|
|
5
|
+
* Здесь допустимы:
|
|
6
|
+
* - объявление command path и option schema;
|
|
7
|
+
* - преобразование CLI options в generated request;
|
|
8
|
+
* - создание SDK через bootstrap factory и закрытие SDK resource;
|
|
9
|
+
*
|
|
10
|
+
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.formatCandles = exports.candlesCommand = void 0;
|
|
14
|
+
exports.createCandlesCommand = createCandlesCommand;
|
|
15
|
+
exports.createCandlesRequest = createCandlesRequest;
|
|
16
|
+
const marketdata_1 = require("../../../generated/marketdata");
|
|
17
|
+
const icore_1 = require("icore");
|
|
18
|
+
const contract_1 = require("../../cli/contract");
|
|
19
|
+
const args_1 = require("../../args");
|
|
20
|
+
const command_options_1 = require("../../args/command-options");
|
|
21
|
+
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
22
|
+
const reporter_1 = require("./reporter");
|
|
23
|
+
Object.defineProperty(exports, "formatCandles", { enumerable: true, get: function () { return reporter_1.formatCandles; } });
|
|
24
|
+
const candlesCommandPath = ['market', 'candles'];
|
|
25
|
+
const defaultCandlesSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
26
|
+
const candleIntervals = {
|
|
27
|
+
'1min': marketdata_1.CandleInterval.CANDLE_INTERVAL_1_MIN,
|
|
28
|
+
'2min': marketdata_1.CandleInterval.CANDLE_INTERVAL_2_MIN,
|
|
29
|
+
'3min': marketdata_1.CandleInterval.CANDLE_INTERVAL_3_MIN,
|
|
30
|
+
'5min': marketdata_1.CandleInterval.CANDLE_INTERVAL_5_MIN,
|
|
31
|
+
'10min': marketdata_1.CandleInterval.CANDLE_INTERVAL_10_MIN,
|
|
32
|
+
'15min': marketdata_1.CandleInterval.CANDLE_INTERVAL_15_MIN,
|
|
33
|
+
'30min': marketdata_1.CandleInterval.CANDLE_INTERVAL_30_MIN,
|
|
34
|
+
hour: marketdata_1.CandleInterval.CANDLE_INTERVAL_HOUR,
|
|
35
|
+
'1hour': marketdata_1.CandleInterval.CANDLE_INTERVAL_HOUR,
|
|
36
|
+
'2hour': marketdata_1.CandleInterval.CANDLE_INTERVAL_2_HOUR,
|
|
37
|
+
'4hour': marketdata_1.CandleInterval.CANDLE_INTERVAL_4_HOUR,
|
|
38
|
+
day: marketdata_1.CandleInterval.CANDLE_INTERVAL_DAY,
|
|
39
|
+
week: marketdata_1.CandleInterval.CANDLE_INTERVAL_WEEK,
|
|
40
|
+
month: marketdata_1.CandleInterval.CANDLE_INTERVAL_MONTH
|
|
41
|
+
};
|
|
42
|
+
const candleIntervalNames = Object.keys(candleIntervals);
|
|
43
|
+
const candlesRequestOptionsSchema = {
|
|
44
|
+
'instrument-id': {
|
|
45
|
+
type: 'string',
|
|
46
|
+
required: true
|
|
47
|
+
},
|
|
48
|
+
from: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
required: true
|
|
51
|
+
},
|
|
52
|
+
to: {
|
|
53
|
+
type: 'string',
|
|
54
|
+
required: true
|
|
55
|
+
},
|
|
56
|
+
interval: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
choices: candleIntervalNames,
|
|
59
|
+
required: true
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const candlesFormatOptionsSchema = {
|
|
63
|
+
format: {
|
|
64
|
+
type: 'string',
|
|
65
|
+
choices: reporter_1.candlesFormats,
|
|
66
|
+
default: 'json'
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const candlesOptionsSchema = (0, command_options_1.withSdkOptions)(candlesRequestOptionsSchema, candlesFormatOptionsSchema);
|
|
70
|
+
function createCandlesCommand(createSdk = defaultCandlesSdkFactory) {
|
|
71
|
+
return contract_1.command.define({
|
|
72
|
+
path: candlesCommandPath,
|
|
73
|
+
options: candlesOptionsSchema,
|
|
74
|
+
handle({ options }) {
|
|
75
|
+
return runCandlesCommand(options, createSdk);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
exports.candlesCommand = createCandlesCommand();
|
|
80
|
+
async function runCandlesCommand(options, createSdk) {
|
|
81
|
+
const request = createCandlesRequest(options);
|
|
82
|
+
const { format } = options;
|
|
83
|
+
const sdk = createSdk((0, args_1.resolveSdkOptionsFromCommandOptions)(options));
|
|
84
|
+
try {
|
|
85
|
+
const response = await sdk.marketdata.getCandles(request);
|
|
86
|
+
return (0, reporter_1.formatCandles)(response.candles, format);
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
sdk.close();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function createCandlesRequest(options) {
|
|
93
|
+
const from = (0, command_options_1.parseDateTimeOption)(options.from, 'from');
|
|
94
|
+
const to = (0, command_options_1.parseDateTimeOption)(options.to, 'to');
|
|
95
|
+
if (from.getTime() > to.getTime()) {
|
|
96
|
+
throw new icore_1.CliUsageError("Expected '--from' to be earlier than or equal to '--to'");
|
|
97
|
+
}
|
|
98
|
+
return marketdata_1.GetCandlesRequest.create({
|
|
99
|
+
instrumentId: options['instrument-id'],
|
|
100
|
+
from,
|
|
101
|
+
to,
|
|
102
|
+
interval: candleIntervals[options.interval]
|
|
103
|
+
});
|
|
104
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль CLI-репортинга команды `market candles`.
|
|
3
|
+
*
|
|
4
|
+
* Здесь допустимы mapping generated DTO в application report contract и
|
|
5
|
+
* presentation formatting. Разбор command options и запуск SDK остаются в `cli.ts`.
|
|
6
|
+
*/
|
|
7
|
+
import type { CandlesReport } from '../../../application/reports';
|
|
8
|
+
import type { HistoricCandle } from '../../../generated/marketdata';
|
|
9
|
+
export declare const candlesFormats: readonly ['json', 'csv'];
|
|
10
|
+
export type CandlesFormat = typeof candlesFormats[number];
|
|
11
|
+
export declare function createCandlesReport(candles: HistoricCandle[]): CandlesReport;
|
|
12
|
+
export declare function formatCandlesReport(report: CandlesReport, format: CandlesFormat): string;
|
|
13
|
+
export declare function formatCandles(candles: HistoricCandle[], format: CandlesFormat): string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль CLI-репортинга команды `market candles`.
|
|
4
|
+
*
|
|
5
|
+
* Здесь допустимы mapping generated DTO в application report contract и
|
|
6
|
+
* presentation formatting. Разбор command options и запуск SDK остаются в `cli.ts`.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.candlesFormats = void 0;
|
|
10
|
+
exports.createCandlesReport = createCandlesReport;
|
|
11
|
+
exports.formatCandlesReport = formatCandlesReport;
|
|
12
|
+
exports.formatCandles = formatCandles;
|
|
13
|
+
const report_values_1 = require("../../../infrastructure/report-values");
|
|
14
|
+
const icore_1 = require("icore");
|
|
15
|
+
exports.candlesFormats = ['json', 'csv'];
|
|
16
|
+
function toReportCandle(candle) {
|
|
17
|
+
return {
|
|
18
|
+
time: (0, report_values_1.formatReportDate)(candle.time),
|
|
19
|
+
open: (0, report_values_1.formatReportQuotation)(candle.open),
|
|
20
|
+
high: (0, report_values_1.formatReportQuotation)(candle.high),
|
|
21
|
+
low: (0, report_values_1.formatReportQuotation)(candle.low),
|
|
22
|
+
close: (0, report_values_1.formatReportQuotation)(candle.close),
|
|
23
|
+
volume: candle.volume,
|
|
24
|
+
isComplete: candle.isComplete
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function createCandlesReport(candles) {
|
|
28
|
+
return candles.map(toReportCandle);
|
|
29
|
+
}
|
|
30
|
+
function formatCandlesReport(report, format) {
|
|
31
|
+
if (format === 'json') {
|
|
32
|
+
return (0, icore_1.renderJson)(report);
|
|
33
|
+
}
|
|
34
|
+
return (0, icore_1.renderCsv)([
|
|
35
|
+
['time', 'open', 'high', 'low', 'close', 'volume', 'isComplete'],
|
|
36
|
+
...report.map((candle) => [
|
|
37
|
+
candle.time,
|
|
38
|
+
candle.open,
|
|
39
|
+
candle.high,
|
|
40
|
+
candle.low,
|
|
41
|
+
candle.close,
|
|
42
|
+
candle.volume,
|
|
43
|
+
candle.isComplete
|
|
44
|
+
])
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
47
|
+
function formatCandles(candles, format) {
|
|
48
|
+
return formatCandlesReport(createCandlesReport(candles), format);
|
|
49
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль CLI-команды `market close-prices`.
|
|
3
|
+
*
|
|
4
|
+
* Здесь допустимы:
|
|
5
|
+
* - объявление command path и option schema;
|
|
6
|
+
* - преобразование CLI options в generated request;
|
|
7
|
+
* - создание SDK через bootstrap factory и закрытие SDK resource;
|
|
8
|
+
*
|
|
9
|
+
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
10
|
+
*/
|
|
11
|
+
import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
12
|
+
import type { GetClosePricesRequest, GetClosePricesResponse } from '../../../generated/marketdata';
|
|
13
|
+
import type { InferOptions } from 'icore';
|
|
14
|
+
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
+
import { formatClosePrices } from './reporter';
|
|
16
|
+
type ClosePricesSdk = {
|
|
17
|
+
marketdata: {
|
|
18
|
+
getClosePrices(request: GetClosePricesRequest): Promise<GetClosePricesResponse>;
|
|
19
|
+
};
|
|
20
|
+
close(): void;
|
|
21
|
+
};
|
|
22
|
+
type ClosePricesSdkFactory = (options: TInvestOptions) => ClosePricesSdk;
|
|
23
|
+
declare const closePricesOptionsSchema: {
|
|
24
|
+
readonly token: {
|
|
25
|
+
readonly type: 'string';
|
|
26
|
+
};
|
|
27
|
+
readonly endpoint: {
|
|
28
|
+
readonly type: 'string';
|
|
29
|
+
};
|
|
30
|
+
readonly 'app-name': {
|
|
31
|
+
readonly type: 'string';
|
|
32
|
+
};
|
|
33
|
+
readonly insecure: {
|
|
34
|
+
readonly type: 'boolean';
|
|
35
|
+
};
|
|
36
|
+
readonly 'instrument-id': {
|
|
37
|
+
readonly type: 'string';
|
|
38
|
+
readonly required: true;
|
|
39
|
+
};
|
|
40
|
+
readonly format: {
|
|
41
|
+
readonly type: 'string';
|
|
42
|
+
readonly choices: readonly ["json", "table"];
|
|
43
|
+
readonly default: 'table';
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
type ClosePricesOptions = InferOptions<typeof closePricesOptionsSchema>;
|
|
47
|
+
type ClosePricesRequestOptions = CommandRequestOptions<ClosePricesOptions, 'instrument-id'>;
|
|
48
|
+
export declare function createClosePricesCommand(createSdk?: ClosePricesSdkFactory): Omit<import("icore").CommandDefinition<{
|
|
49
|
+
readonly token: {
|
|
50
|
+
readonly type: 'string';
|
|
51
|
+
};
|
|
52
|
+
readonly endpoint: {
|
|
53
|
+
readonly type: 'string';
|
|
54
|
+
};
|
|
55
|
+
readonly 'app-name': {
|
|
56
|
+
readonly type: 'string';
|
|
57
|
+
};
|
|
58
|
+
readonly insecure: {
|
|
59
|
+
readonly type: 'boolean';
|
|
60
|
+
};
|
|
61
|
+
readonly 'instrument-id': {
|
|
62
|
+
readonly type: 'string';
|
|
63
|
+
readonly required: true;
|
|
64
|
+
};
|
|
65
|
+
readonly format: {
|
|
66
|
+
readonly type: 'string';
|
|
67
|
+
readonly choices: readonly ["json", "table"];
|
|
68
|
+
readonly default: 'table';
|
|
69
|
+
};
|
|
70
|
+
}, undefined, string, readonly ["market", "close-prices"], undefined, void, readonly []>, "metadata"> & {
|
|
71
|
+
metadata?: undefined;
|
|
72
|
+
};
|
|
73
|
+
export declare const closePricesCommand: Omit<import("icore").CommandDefinition<{
|
|
74
|
+
readonly token: {
|
|
75
|
+
readonly type: 'string';
|
|
76
|
+
};
|
|
77
|
+
readonly endpoint: {
|
|
78
|
+
readonly type: 'string';
|
|
79
|
+
};
|
|
80
|
+
readonly 'app-name': {
|
|
81
|
+
readonly type: 'string';
|
|
82
|
+
};
|
|
83
|
+
readonly insecure: {
|
|
84
|
+
readonly type: 'boolean';
|
|
85
|
+
};
|
|
86
|
+
readonly 'instrument-id': {
|
|
87
|
+
readonly type: 'string';
|
|
88
|
+
readonly required: true;
|
|
89
|
+
};
|
|
90
|
+
readonly format: {
|
|
91
|
+
readonly type: 'string';
|
|
92
|
+
readonly choices: readonly ["json", "table"];
|
|
93
|
+
readonly default: 'table';
|
|
94
|
+
};
|
|
95
|
+
}, undefined, string, readonly ["market", "close-prices"], undefined, void, readonly []>, "metadata"> & {
|
|
96
|
+
metadata?: undefined;
|
|
97
|
+
};
|
|
98
|
+
export { formatClosePrices };
|
|
99
|
+
export declare function createClosePricesRequest(options: ClosePricesRequestOptions): GetClosePricesRequest;
|