@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,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль CLI-команды `stop-order place`.
|
|
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.formatPostStopOrder = exports.postStopOrderCommand = void 0;
|
|
14
|
+
exports.createPostStopOrderCommand = createPostStopOrderCommand;
|
|
15
|
+
exports.createPostStopOrderRequest = createPostStopOrderRequest;
|
|
16
|
+
const common_1 = require("../../../generated/common");
|
|
17
|
+
const stoporders_1 = require("../../../generated/stoporders");
|
|
18
|
+
const icore_1 = require("icore");
|
|
19
|
+
const contract_1 = require("../../cli/contract");
|
|
20
|
+
const args_1 = require("../../args");
|
|
21
|
+
const command_options_1 = require("../../args/command-options");
|
|
22
|
+
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
23
|
+
const side_effect_args_1 = require("../../args/side-effect-args");
|
|
24
|
+
const reporter_1 = require("./reporter");
|
|
25
|
+
Object.defineProperty(exports, "formatPostStopOrder", { enumerable: true, get: function () { return reporter_1.formatPostStopOrder; } });
|
|
26
|
+
const postStopOrderCommandPath = ['stop-order', 'place'];
|
|
27
|
+
const defaultPostStopOrderSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
28
|
+
const stopOrderDirections = {
|
|
29
|
+
buy: stoporders_1.StopOrderDirection.STOP_ORDER_DIRECTION_BUY,
|
|
30
|
+
sell: stoporders_1.StopOrderDirection.STOP_ORDER_DIRECTION_SELL
|
|
31
|
+
};
|
|
32
|
+
const stopOrderDirectionNames = Object.keys(stopOrderDirections);
|
|
33
|
+
const stopOrderExpirationTypes = {
|
|
34
|
+
'good-till-cancel': stoporders_1.StopOrderExpirationType.STOP_ORDER_EXPIRATION_TYPE_GOOD_TILL_CANCEL,
|
|
35
|
+
'good-till-date': stoporders_1.StopOrderExpirationType.STOP_ORDER_EXPIRATION_TYPE_GOOD_TILL_DATE
|
|
36
|
+
};
|
|
37
|
+
const stopOrderExpirationTypeNames = Object.keys(stopOrderExpirationTypes);
|
|
38
|
+
const stopOrderTypes = {
|
|
39
|
+
'take-profit': stoporders_1.StopOrderType.STOP_ORDER_TYPE_TAKE_PROFIT,
|
|
40
|
+
'stop-loss': stoporders_1.StopOrderType.STOP_ORDER_TYPE_STOP_LOSS,
|
|
41
|
+
'stop-limit': stoporders_1.StopOrderType.STOP_ORDER_TYPE_STOP_LIMIT
|
|
42
|
+
};
|
|
43
|
+
const stopOrderTypeNames = Object.keys(stopOrderTypes);
|
|
44
|
+
const postStopOrderRequestOptionsSchema = {
|
|
45
|
+
'account-id': {
|
|
46
|
+
type: 'string',
|
|
47
|
+
required: true
|
|
48
|
+
},
|
|
49
|
+
'instrument-id': {
|
|
50
|
+
type: 'string',
|
|
51
|
+
required: true
|
|
52
|
+
},
|
|
53
|
+
quantity: {
|
|
54
|
+
...command_options_1.positiveSafeIntegerOption,
|
|
55
|
+
required: true
|
|
56
|
+
},
|
|
57
|
+
price: {
|
|
58
|
+
type: 'string'
|
|
59
|
+
},
|
|
60
|
+
'stop-price': {
|
|
61
|
+
type: 'string',
|
|
62
|
+
required: true
|
|
63
|
+
},
|
|
64
|
+
direction: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
choices: stopOrderDirectionNames,
|
|
67
|
+
required: true
|
|
68
|
+
},
|
|
69
|
+
'expiration-type': {
|
|
70
|
+
type: 'string',
|
|
71
|
+
choices: stopOrderExpirationTypeNames,
|
|
72
|
+
required: true
|
|
73
|
+
},
|
|
74
|
+
'stop-order-type': {
|
|
75
|
+
type: 'string',
|
|
76
|
+
choices: stopOrderTypeNames,
|
|
77
|
+
required: true
|
|
78
|
+
},
|
|
79
|
+
'expire-date': {
|
|
80
|
+
type: 'string'
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const postStopOrderFormatOptionsSchema = {
|
|
84
|
+
format: {
|
|
85
|
+
type: 'string',
|
|
86
|
+
choices: reporter_1.postStopOrderFormats,
|
|
87
|
+
default: 'table'
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const postStopOrderOptionsSchema = (0, command_options_1.withSdkOptions)(postStopOrderRequestOptionsSchema, side_effect_args_1.sideEffectConfirmationOptionsSchema, postStopOrderFormatOptionsSchema);
|
|
91
|
+
function createPostStopOrderCommand(createSdk = defaultPostStopOrderSdkFactory) {
|
|
92
|
+
return contract_1.command.define({
|
|
93
|
+
path: postStopOrderCommandPath,
|
|
94
|
+
options: postStopOrderOptionsSchema,
|
|
95
|
+
handle({ options }) {
|
|
96
|
+
return runPostStopOrderCommand(options, createSdk);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
exports.postStopOrderCommand = createPostStopOrderCommand();
|
|
101
|
+
async function runPostStopOrderCommand(options, createSdk) {
|
|
102
|
+
(0, side_effect_args_1.assertSideEffectConfirmed)(options.confirm);
|
|
103
|
+
const request = createPostStopOrderRequest(options);
|
|
104
|
+
const { format } = options;
|
|
105
|
+
const sdk = createSdk((0, args_1.resolveSdkOptionsFromCommandOptions)(options));
|
|
106
|
+
try {
|
|
107
|
+
const response = await sdk.stoporders.postStopOrder(request);
|
|
108
|
+
return (0, reporter_1.formatPostStopOrder)(response, format);
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
sdk.close();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function createPostStopOrderRequest(options) {
|
|
115
|
+
const expirationType = stopOrderExpirationTypes[options['expiration-type']];
|
|
116
|
+
return stoporders_1.PostStopOrderRequest.create({
|
|
117
|
+
quantity: options.quantity,
|
|
118
|
+
price: (0, side_effect_args_1.parseOptionalPositiveQuotationOption)(options.price, 'price'),
|
|
119
|
+
stopPrice: (0, side_effect_args_1.parsePositiveQuotationOption)(options['stop-price'], 'stop-price'),
|
|
120
|
+
direction: stopOrderDirections[options.direction],
|
|
121
|
+
accountId: options['account-id'],
|
|
122
|
+
expirationType,
|
|
123
|
+
stopOrderType: stopOrderTypes[options['stop-order-type']],
|
|
124
|
+
expireDate: createStopOrderExpireDate(expirationType, options['expire-date']),
|
|
125
|
+
instrumentId: options['instrument-id'],
|
|
126
|
+
exchangeOrderType: stoporders_1.ExchangeOrderType.EXCHANGE_ORDER_TYPE_UNSPECIFIED,
|
|
127
|
+
takeProfitType: stoporders_1.TakeProfitType.TAKE_PROFIT_TYPE_UNSPECIFIED,
|
|
128
|
+
trailingData: undefined,
|
|
129
|
+
priceType: common_1.PriceType.PRICE_TYPE_UNSPECIFIED,
|
|
130
|
+
orderId: '',
|
|
131
|
+
confirmMarginTrade: false
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function createStopOrderExpireDate(expirationType, rawExpireDate) {
|
|
135
|
+
if (expirationType === stoporders_1.StopOrderExpirationType.STOP_ORDER_EXPIRATION_TYPE_GOOD_TILL_DATE) {
|
|
136
|
+
if (rawExpireDate === undefined) {
|
|
137
|
+
throw new icore_1.CliUsageError("Expected '--expire-date' when '--expiration-type=good-till-date'");
|
|
138
|
+
}
|
|
139
|
+
return (0, command_options_1.parseDateTimeOption)(rawExpireDate, 'expire-date');
|
|
140
|
+
}
|
|
141
|
+
if (rawExpireDate !== undefined) {
|
|
142
|
+
throw new icore_1.CliUsageError("Expected '--expire-date' only with '--expiration-type=good-till-date'");
|
|
143
|
+
}
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль CLI-репортинга команды `stop-order place`.
|
|
3
|
+
*
|
|
4
|
+
* Здесь допустимы mapping generated DTO в application report contract и
|
|
5
|
+
* presentation formatting. Разбор command options и запуск SDK остаются в `cli.ts`.
|
|
6
|
+
*/
|
|
7
|
+
import type { PostStopOrderReport } from '../../../application/reports';
|
|
8
|
+
import type { PostStopOrderResponse } from '../../../generated/stoporders';
|
|
9
|
+
export declare const postStopOrderFormats: readonly ['json', 'table'];
|
|
10
|
+
export type PostStopOrderFormat = typeof postStopOrderFormats[number];
|
|
11
|
+
export declare function createPostStopOrderReport(response: PostStopOrderResponse): PostStopOrderReport;
|
|
12
|
+
export declare function formatPostStopOrderReport(report: PostStopOrderReport, format: PostStopOrderFormat): string;
|
|
13
|
+
export declare function formatPostStopOrder(response: PostStopOrderResponse, format: PostStopOrderFormat): string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль CLI-репортинга команды `stop-order place`.
|
|
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.postStopOrderFormats = void 0;
|
|
10
|
+
exports.createPostStopOrderReport = createPostStopOrderReport;
|
|
11
|
+
exports.formatPostStopOrderReport = formatPostStopOrderReport;
|
|
12
|
+
exports.formatPostStopOrder = formatPostStopOrder;
|
|
13
|
+
const icore_1 = require("icore");
|
|
14
|
+
exports.postStopOrderFormats = ['json', 'table'];
|
|
15
|
+
function createPostStopOrderReport(response) {
|
|
16
|
+
return {
|
|
17
|
+
stopOrderId: response.stopOrderId
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function formatPostStopOrderReport(report, format) {
|
|
21
|
+
if (format === 'json') {
|
|
22
|
+
return (0, icore_1.renderJson)(report);
|
|
23
|
+
}
|
|
24
|
+
return (0, icore_1.renderTextTable)([
|
|
25
|
+
['stopOrderId'],
|
|
26
|
+
[report.stopOrderId]
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
function formatPostStopOrder(response, format) {
|
|
30
|
+
return formatPostStopOrderReport(createPostStopOrderReport(response), format);
|
|
31
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль CLI-команды `order replace`.
|
|
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 PostOrderResponse, type ReplaceOrderRequest } from '../../../generated/orders';
|
|
13
|
+
import type { InferOptions } from 'icore';
|
|
14
|
+
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
+
import { formatReplaceOrder } from './reporter';
|
|
16
|
+
type ReplaceOrderSdk = {
|
|
17
|
+
orders: {
|
|
18
|
+
replaceOrder(request: ReplaceOrderRequest): Promise<PostOrderResponse>;
|
|
19
|
+
};
|
|
20
|
+
close(): void;
|
|
21
|
+
};
|
|
22
|
+
type ReplaceOrderSdkFactory = (options: TInvestOptions) => ReplaceOrderSdk;
|
|
23
|
+
declare const replaceOrderOptionsSchema: {
|
|
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 'order-id': {
|
|
44
|
+
readonly type: 'string';
|
|
45
|
+
readonly required: true;
|
|
46
|
+
};
|
|
47
|
+
readonly 'idempotency-key': {
|
|
48
|
+
readonly type: 'string';
|
|
49
|
+
readonly required: true;
|
|
50
|
+
};
|
|
51
|
+
readonly quantity: {
|
|
52
|
+
readonly type: 'number';
|
|
53
|
+
readonly integer: true;
|
|
54
|
+
readonly min: 1;
|
|
55
|
+
readonly max: number;
|
|
56
|
+
readonly required: true;
|
|
57
|
+
};
|
|
58
|
+
readonly price: {
|
|
59
|
+
readonly type: 'string';
|
|
60
|
+
readonly required: true;
|
|
61
|
+
};
|
|
62
|
+
readonly 'price-type': {
|
|
63
|
+
readonly type: 'string';
|
|
64
|
+
readonly choices: ("currency" | "point")[];
|
|
65
|
+
readonly required: true;
|
|
66
|
+
};
|
|
67
|
+
readonly format: {
|
|
68
|
+
readonly type: 'string';
|
|
69
|
+
readonly choices: readonly ["json", "table"];
|
|
70
|
+
readonly default: 'table';
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
type ReplaceOrderOptions = InferOptions<typeof replaceOrderOptionsSchema>;
|
|
74
|
+
type ReplaceOrderRequestOptions = CommandRequestOptions<ReplaceOrderOptions, 'account-id' | 'order-id' | 'idempotency-key' | 'quantity' | 'price' | 'price-type'>;
|
|
75
|
+
export declare function createReplaceOrderCommand(createSdk?: ReplaceOrderSdkFactory): Omit<import("icore").CommandDefinition<{
|
|
76
|
+
readonly token: {
|
|
77
|
+
readonly type: 'string';
|
|
78
|
+
};
|
|
79
|
+
readonly endpoint: {
|
|
80
|
+
readonly type: 'string';
|
|
81
|
+
};
|
|
82
|
+
readonly 'app-name': {
|
|
83
|
+
readonly type: 'string';
|
|
84
|
+
};
|
|
85
|
+
readonly insecure: {
|
|
86
|
+
readonly type: 'boolean';
|
|
87
|
+
};
|
|
88
|
+
readonly confirm: {
|
|
89
|
+
readonly type: 'boolean';
|
|
90
|
+
};
|
|
91
|
+
readonly 'account-id': {
|
|
92
|
+
readonly type: 'string';
|
|
93
|
+
readonly required: true;
|
|
94
|
+
};
|
|
95
|
+
readonly 'order-id': {
|
|
96
|
+
readonly type: 'string';
|
|
97
|
+
readonly required: true;
|
|
98
|
+
};
|
|
99
|
+
readonly 'idempotency-key': {
|
|
100
|
+
readonly type: 'string';
|
|
101
|
+
readonly required: true;
|
|
102
|
+
};
|
|
103
|
+
readonly quantity: {
|
|
104
|
+
readonly type: 'number';
|
|
105
|
+
readonly integer: true;
|
|
106
|
+
readonly min: 1;
|
|
107
|
+
readonly max: number;
|
|
108
|
+
readonly required: true;
|
|
109
|
+
};
|
|
110
|
+
readonly price: {
|
|
111
|
+
readonly type: 'string';
|
|
112
|
+
readonly required: true;
|
|
113
|
+
};
|
|
114
|
+
readonly 'price-type': {
|
|
115
|
+
readonly type: 'string';
|
|
116
|
+
readonly choices: ("currency" | "point")[];
|
|
117
|
+
readonly required: true;
|
|
118
|
+
};
|
|
119
|
+
readonly format: {
|
|
120
|
+
readonly type: 'string';
|
|
121
|
+
readonly choices: readonly ["json", "table"];
|
|
122
|
+
readonly default: 'table';
|
|
123
|
+
};
|
|
124
|
+
}, undefined, string, readonly ["order", "replace"], undefined, void, readonly []>, "metadata"> & {
|
|
125
|
+
metadata?: undefined;
|
|
126
|
+
};
|
|
127
|
+
export declare const replaceOrderCommand: Omit<import("icore").CommandDefinition<{
|
|
128
|
+
readonly token: {
|
|
129
|
+
readonly type: 'string';
|
|
130
|
+
};
|
|
131
|
+
readonly endpoint: {
|
|
132
|
+
readonly type: 'string';
|
|
133
|
+
};
|
|
134
|
+
readonly 'app-name': {
|
|
135
|
+
readonly type: 'string';
|
|
136
|
+
};
|
|
137
|
+
readonly insecure: {
|
|
138
|
+
readonly type: 'boolean';
|
|
139
|
+
};
|
|
140
|
+
readonly confirm: {
|
|
141
|
+
readonly type: 'boolean';
|
|
142
|
+
};
|
|
143
|
+
readonly 'account-id': {
|
|
144
|
+
readonly type: 'string';
|
|
145
|
+
readonly required: true;
|
|
146
|
+
};
|
|
147
|
+
readonly 'order-id': {
|
|
148
|
+
readonly type: 'string';
|
|
149
|
+
readonly required: true;
|
|
150
|
+
};
|
|
151
|
+
readonly 'idempotency-key': {
|
|
152
|
+
readonly type: 'string';
|
|
153
|
+
readonly required: true;
|
|
154
|
+
};
|
|
155
|
+
readonly quantity: {
|
|
156
|
+
readonly type: 'number';
|
|
157
|
+
readonly integer: true;
|
|
158
|
+
readonly min: 1;
|
|
159
|
+
readonly max: number;
|
|
160
|
+
readonly required: true;
|
|
161
|
+
};
|
|
162
|
+
readonly price: {
|
|
163
|
+
readonly type: 'string';
|
|
164
|
+
readonly required: true;
|
|
165
|
+
};
|
|
166
|
+
readonly 'price-type': {
|
|
167
|
+
readonly type: 'string';
|
|
168
|
+
readonly choices: ("currency" | "point")[];
|
|
169
|
+
readonly required: true;
|
|
170
|
+
};
|
|
171
|
+
readonly format: {
|
|
172
|
+
readonly type: 'string';
|
|
173
|
+
readonly choices: readonly ["json", "table"];
|
|
174
|
+
readonly default: 'table';
|
|
175
|
+
};
|
|
176
|
+
}, undefined, string, readonly ["order", "replace"], undefined, void, readonly []>, "metadata"> & {
|
|
177
|
+
metadata?: undefined;
|
|
178
|
+
};
|
|
179
|
+
export { formatReplaceOrder };
|
|
180
|
+
export declare function createReplaceOrderRequest(options: ReplaceOrderRequestOptions): ReplaceOrderRequest;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль CLI-команды `order replace`.
|
|
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.formatReplaceOrder = exports.replaceOrderCommand = void 0;
|
|
14
|
+
exports.createReplaceOrderCommand = createReplaceOrderCommand;
|
|
15
|
+
exports.createReplaceOrderRequest = createReplaceOrderRequest;
|
|
16
|
+
const common_1 = require("../../../generated/common");
|
|
17
|
+
const contract_1 = require("../../cli/contract");
|
|
18
|
+
const args_1 = require("../../args");
|
|
19
|
+
const command_options_1 = require("../../args/command-options");
|
|
20
|
+
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
21
|
+
const side_effect_args_1 = require("../../args/side-effect-args");
|
|
22
|
+
const reporter_1 = require("./reporter");
|
|
23
|
+
Object.defineProperty(exports, "formatReplaceOrder", { enumerable: true, get: function () { return reporter_1.formatReplaceOrder; } });
|
|
24
|
+
const replaceOrderCommandPath = ['order', 'replace'];
|
|
25
|
+
const defaultReplaceOrderSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
26
|
+
const replaceOrderPriceTypes = {
|
|
27
|
+
point: common_1.PriceType.PRICE_TYPE_POINT,
|
|
28
|
+
currency: common_1.PriceType.PRICE_TYPE_CURRENCY
|
|
29
|
+
};
|
|
30
|
+
const replaceOrderPriceTypeNames = Object.keys(replaceOrderPriceTypes);
|
|
31
|
+
const replaceOrderRequestOptionsSchema = {
|
|
32
|
+
'account-id': {
|
|
33
|
+
type: 'string',
|
|
34
|
+
required: true
|
|
35
|
+
},
|
|
36
|
+
'order-id': {
|
|
37
|
+
type: 'string',
|
|
38
|
+
required: true
|
|
39
|
+
},
|
|
40
|
+
'idempotency-key': {
|
|
41
|
+
type: 'string',
|
|
42
|
+
required: true
|
|
43
|
+
},
|
|
44
|
+
quantity: {
|
|
45
|
+
...command_options_1.positiveSafeIntegerOption,
|
|
46
|
+
required: true
|
|
47
|
+
},
|
|
48
|
+
price: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
required: true
|
|
51
|
+
},
|
|
52
|
+
'price-type': {
|
|
53
|
+
type: 'string',
|
|
54
|
+
choices: replaceOrderPriceTypeNames,
|
|
55
|
+
required: true
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const replaceOrderFormatOptionsSchema = {
|
|
59
|
+
format: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
choices: reporter_1.replaceOrderFormats,
|
|
62
|
+
default: 'table'
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const replaceOrderOptionsSchema = (0, command_options_1.withSdkOptions)(replaceOrderRequestOptionsSchema, side_effect_args_1.sideEffectConfirmationOptionsSchema, replaceOrderFormatOptionsSchema);
|
|
66
|
+
function createReplaceOrderCommand(createSdk = defaultReplaceOrderSdkFactory) {
|
|
67
|
+
return contract_1.command.define({
|
|
68
|
+
path: replaceOrderCommandPath,
|
|
69
|
+
options: replaceOrderOptionsSchema,
|
|
70
|
+
handle({ options }) {
|
|
71
|
+
return runReplaceOrderCommand(options, createSdk);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
exports.replaceOrderCommand = createReplaceOrderCommand();
|
|
76
|
+
async function runReplaceOrderCommand(options, createSdk) {
|
|
77
|
+
(0, side_effect_args_1.assertSideEffectConfirmed)(options.confirm);
|
|
78
|
+
const request = createReplaceOrderRequest(options);
|
|
79
|
+
const { format } = options;
|
|
80
|
+
const sdk = createSdk((0, args_1.resolveSdkOptionsFromCommandOptions)(options));
|
|
81
|
+
try {
|
|
82
|
+
const response = await sdk.orders.replaceOrder(request);
|
|
83
|
+
return (0, reporter_1.formatReplaceOrder)(response, format);
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
sdk.close();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function createReplaceOrderRequest(options) {
|
|
90
|
+
return {
|
|
91
|
+
accountId: options['account-id'],
|
|
92
|
+
orderId: options['order-id'],
|
|
93
|
+
idempotencyKey: options['idempotency-key'],
|
|
94
|
+
quantity: options.quantity,
|
|
95
|
+
price: (0, side_effect_args_1.parsePositiveQuotationOption)(options.price, 'price'),
|
|
96
|
+
priceType: replaceOrderPriceTypes[options['price-type']],
|
|
97
|
+
confirmMarginTrade: false
|
|
98
|
+
};
|
|
99
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль CLI-репортинга команды `order replace`.
|
|
3
|
+
*
|
|
4
|
+
* `replaceOrder` возвращает тот же generated response, что и `postOrder`, поэтому
|
|
5
|
+
* команда переиспользует общий order mutation report.
|
|
6
|
+
*/
|
|
7
|
+
import type { PostOrderResponse } from '../../../generated/orders';
|
|
8
|
+
import { createOrderMutationReport, formatOrderMutationReport, type PostOrderFormat } from '../post-order/reporter';
|
|
9
|
+
export declare const replaceOrderFormats: readonly ["json", "table"];
|
|
10
|
+
export type ReplaceOrderFormat = PostOrderFormat;
|
|
11
|
+
export declare const createReplaceOrderReport: typeof createOrderMutationReport;
|
|
12
|
+
export declare const formatReplaceOrderReport: typeof formatOrderMutationReport;
|
|
13
|
+
export declare function formatReplaceOrder(response: PostOrderResponse, format: ReplaceOrderFormat): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль CLI-репортинга команды `order replace`.
|
|
4
|
+
*
|
|
5
|
+
* `replaceOrder` возвращает тот же generated response, что и `postOrder`, поэтому
|
|
6
|
+
* команда переиспользует общий order mutation report.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.formatReplaceOrderReport = exports.createReplaceOrderReport = exports.replaceOrderFormats = void 0;
|
|
10
|
+
exports.formatReplaceOrder = formatReplaceOrder;
|
|
11
|
+
const reporter_1 = require("../post-order/reporter");
|
|
12
|
+
exports.replaceOrderFormats = reporter_1.postOrderFormats;
|
|
13
|
+
exports.createReplaceOrderReport = reporter_1.createOrderMutationReport;
|
|
14
|
+
exports.formatReplaceOrderReport = reporter_1.formatOrderMutationReport;
|
|
15
|
+
function formatReplaceOrder(response, format) {
|
|
16
|
+
return (0, exports.formatReplaceOrderReport)((0, exports.createReplaceOrderReport)(response), format);
|
|
17
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль CLI-команды `sandbox account list`.
|
|
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 { GetAccountsRequest, GetAccountsResponse } from '../../../generated/users';
|
|
13
|
+
import { formatAccounts } from '../accounts/reporter';
|
|
14
|
+
type SandboxAccountsSdk = {
|
|
15
|
+
sandbox: {
|
|
16
|
+
getSandboxAccounts(request: GetAccountsRequest): Promise<GetAccountsResponse>;
|
|
17
|
+
};
|
|
18
|
+
close(): void;
|
|
19
|
+
};
|
|
20
|
+
type SandboxAccountsSdkFactory = (options: TInvestOptions) => SandboxAccountsSdk;
|
|
21
|
+
export declare function createSandboxAccountsCommand(createSdk?: SandboxAccountsSdkFactory): Omit<import("icore").CommandDefinition<{
|
|
22
|
+
readonly token: {
|
|
23
|
+
readonly type: 'string';
|
|
24
|
+
};
|
|
25
|
+
readonly endpoint: {
|
|
26
|
+
readonly type: 'string';
|
|
27
|
+
};
|
|
28
|
+
readonly 'app-name': {
|
|
29
|
+
readonly type: 'string';
|
|
30
|
+
};
|
|
31
|
+
readonly insecure: {
|
|
32
|
+
readonly type: 'boolean';
|
|
33
|
+
};
|
|
34
|
+
readonly format: {
|
|
35
|
+
readonly type: 'string';
|
|
36
|
+
readonly choices: readonly ["json", "table"];
|
|
37
|
+
readonly default: 'table';
|
|
38
|
+
};
|
|
39
|
+
}, undefined, string, readonly ["sandbox", "account", "list"], undefined, void, readonly []>, "metadata"> & {
|
|
40
|
+
metadata?: undefined;
|
|
41
|
+
};
|
|
42
|
+
export declare const sandboxAccountsCommand: Omit<import("icore").CommandDefinition<{
|
|
43
|
+
readonly token: {
|
|
44
|
+
readonly type: 'string';
|
|
45
|
+
};
|
|
46
|
+
readonly endpoint: {
|
|
47
|
+
readonly type: 'string';
|
|
48
|
+
};
|
|
49
|
+
readonly 'app-name': {
|
|
50
|
+
readonly type: 'string';
|
|
51
|
+
};
|
|
52
|
+
readonly insecure: {
|
|
53
|
+
readonly type: 'boolean';
|
|
54
|
+
};
|
|
55
|
+
readonly format: {
|
|
56
|
+
readonly type: 'string';
|
|
57
|
+
readonly choices: readonly ["json", "table"];
|
|
58
|
+
readonly default: 'table';
|
|
59
|
+
};
|
|
60
|
+
}, undefined, string, readonly ["sandbox", "account", "list"], undefined, void, readonly []>, "metadata"> & {
|
|
61
|
+
metadata?: undefined;
|
|
62
|
+
};
|
|
63
|
+
export { formatAccounts };
|
|
64
|
+
export declare function createSandboxAccountsRequest(): GetAccountsRequest;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль CLI-команды `sandbox account list`.
|
|
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.formatAccounts = exports.sandboxAccountsCommand = void 0;
|
|
14
|
+
exports.createSandboxAccountsCommand = createSandboxAccountsCommand;
|
|
15
|
+
exports.createSandboxAccountsRequest = createSandboxAccountsRequest;
|
|
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 reporter_1 = require("../accounts/reporter");
|
|
21
|
+
Object.defineProperty(exports, "formatAccounts", { enumerable: true, get: function () { return reporter_1.formatAccounts; } });
|
|
22
|
+
const sandboxAccountsCommandPath = ['sandbox', 'account', 'list'];
|
|
23
|
+
const defaultSandboxAccountsSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
24
|
+
const sandboxAccountsOptionsSchema = (0, command_options_1.withSdkOptions)({
|
|
25
|
+
format: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
choices: reporter_1.accountsFormats,
|
|
28
|
+
default: 'table'
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
function createSandboxAccountsCommand(createSdk = defaultSandboxAccountsSdkFactory) {
|
|
32
|
+
return contract_1.command.define({
|
|
33
|
+
path: sandboxAccountsCommandPath,
|
|
34
|
+
options: sandboxAccountsOptionsSchema,
|
|
35
|
+
handle({ options }) {
|
|
36
|
+
return runSandboxAccountsCommand(options, createSdk);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
exports.sandboxAccountsCommand = createSandboxAccountsCommand();
|
|
41
|
+
async function runSandboxAccountsCommand(options, createSdk) {
|
|
42
|
+
const { format } = options;
|
|
43
|
+
const sdk = createSdk((0, args_1.resolveSdkOptionsFromCommandOptions)(options));
|
|
44
|
+
try {
|
|
45
|
+
const response = await sdk.sandbox.getSandboxAccounts(createSandboxAccountsRequest());
|
|
46
|
+
return (0, reporter_1.formatAccounts)(response.accounts, format);
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
sdk.close();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function createSandboxAccountsRequest() {
|
|
53
|
+
return {};
|
|
54
|
+
}
|