@brokerize/client 1.3.6 → 1.3.8

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/dist/apiCtx.js CHANGED
@@ -58,7 +58,7 @@ export function createAuth({ authCfg, cfg, options, tokenRefreshCallback, }) {
58
58
  tokenType: responseJson.token_type,
59
59
  refreshTokenExpiresIn: responseJson.refresh_token_expires_in,
60
60
  idToken: responseJson.access_token,
61
- refreshTokenWithoutTradingsession: responseJson.refresh_Token_without_tradingsession,
61
+ refreshTokenWithoutTradingsession: responseJson.refresh_token_without_tradingsession,
62
62
  refreshTokenWithoutTradingsessionExpiresIn: responseJson.refresh_token_without_tradingsession_expires_in,
63
63
  },
64
64
  };
@@ -53,6 +53,9 @@ export class AuthorizedApiContext {
53
53
  }
54
54
  this._abortController = cfg.createAbortController();
55
55
  this._wsClient = wsClient || this._initInternalWebSocketClient();
56
+ if (this._wsClient._setAuthorizedApiContext) {
57
+ this._wsClient._setAuthorizedApiContext(this);
58
+ }
56
59
  this._cache = {};
57
60
  }
58
61
  createChildContext() {
package/dist/client.d.ts CHANGED
@@ -2688,6 +2688,12 @@ declare interface ClientConfig {
2688
2688
  * @memberof ClientConfig
2689
2689
  */
2690
2690
  page: any | null;
2691
+ /**
2692
+ * If true, users of this client cannot create or change trades.
2693
+ * @type {boolean}
2694
+ * @memberof ClientConfig
2695
+ */
2696
+ readonly?: boolean;
2691
2697
  /**
2692
2698
  * These flags are used in supporting the reporting logic
2693
2699
  * @type {Array<string>}
@@ -2899,7 +2905,13 @@ declare interface ClientConfigUpdate {
2899
2905
  */
2900
2906
  rateLimitPointsToConsume?: ClientConfigUpdateRateLimitPointsToConsume;
2901
2907
  /**
2902
- * These flags are used in supporting the reporting logic
2908
+ * If true, users of this client cannot create or change trades.
2909
+ * @type {boolean}
2910
+ * @memberof ClientConfigUpdate
2911
+ */
2912
+ readonly?: boolean;
2913
+ /**
2914
+ * These flags are used in supporting the reporting logic.
2903
2915
  * @type {Array<string>}
2904
2916
  * @memberof ClientConfigUpdate
2905
2917
  */
@@ -4442,11 +4454,11 @@ declare function DemoAccountToJSONRecursive(value?: DemoAccount | null, ignorePa
4442
4454
  */
4443
4455
  declare class DemobrokerApi extends runtime.BaseAPI {
4444
4456
  /**
4445
- * Create an account at the demo broker for the logged-in user. The account will have a default set of two empty portfolios by default. If the setting `isSinglePortfolio` is set, only one portfolio is created. The account as well as the two portfolios have a randomly generated name. To log into an account, use the account\'s generated name as username (Account name) in `AddSession`. - with the password `42`, the login will succeed immediately - with the password `1337`, a challenge with type text will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - with the password `7`, a challenge with type base64png will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - other passwords will not allow to log in The demo broker implements the following pre-defined trade behaviors, so that different flows can be tested: - ISIN US0378331005 (Apple): - market buy order is executed after 10 seconds by the backend at a random quote - stop buy or stop loss order stays open forever (can be used for testing cancellation) - cost estimations contain a `costDetailsLink` and a `costAcceptancePrompt` - securityDetailedInfo is set, so a \"KID\" link should be displayed and linked to the corresponding table - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN LU0378438732 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - orders are rejected with code `ORDER_REJECTED` immediately - ISIN LU2611732046 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - two exchanges are available (\"xetra\" and \"quoteExchange\") - xetra allows market and limit orders for buying and has defaultValidityByOrderModel set to GFD for market and GTD 2030-01-01 for limit - orders are rejected with code `ORDER_REJECTED` immediately - ISIN DE000MD96WE8 (a knock out with DAX as underlying) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN DE000DTR0CK8 (Daimler Truck Holding) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN US4180561072 (Hasbro) - only quote orders on one exchange are supported - the quotes are valid for 45 seconds - quote value is always `42` - the order gets executed immediately - ISIN DE0005557508 (Deutsche Telekom) - only quote orders on two different exchanges are supported - the quotes do *NOT* have an expiration - quote value is always `42` - quote comes together with a costEstimation. Subsequent getCostEstimation calls are not allowed. - `noExchangeDefault` is true, so that exchange must be selected by the user - order will be canceled after 3 seconds - ISIN US98980L1017 (Zoom) - only market orders (both buy and sell) are suppored on one exchange - orders are executed immediately at a random quote - order creation requires the user to accept a hint (i.e. first try will result in a `MUST_ACCEPT_HINT` error) - default validity is set to `GTD` with a date of `2030-01-01` - ISIN US29786A1060 (Etsy) - the prepareTrade request takes 5 seconds - create challenge takes 5 seconds. for authMethod photoTAN, the challenge will return with an error after that period of time - only quote and market orders allowed - at exchange \"Slow exchange\" it takes 7 seconds to get a quote as well as 7 seconds to retrieve order costs - at exchange \"Exchange with quote and cost errors\" the quote request as well as cost estimation will end with an error after 3 seconds - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN XS2149280948 (bond from Bertelsmann) - quote, limit and market orders (both buy and sell) are supported on one exchange - limit orders are executed at exactly the limit price - market orders are executed at a random quote between 90 and 150 percent - for market orders, there is a legal message to confirm set (`legalMessagesToConfirmByOrderModel`) - ISIN US64110L1061 (Netflix Inc.) - one exchange with only quote order - creating the quote order will return an error (quote expired) - ISIN US67066G1040 (NVIDIA) - one exchange with only quote order, allowsQuoteModeLimit=true - quote orders are executed immediately. - if a quoteLimit is provided, execution happen at quoteLimit value - otherwise, a random execution quote will be used - ISIN DE000BAY0017 (Bayer AG) - one exchange with only market order - `costEstimationIsNotAvailable` is true, so no cost estimations should be linked/shown - orders will be canceled after 3 seconds - ISIN DE000PAH0038 (Porsche) - one exchange with only market order - all orders will be canceled - `GetCostEstimation` contains (only) a link to a PDF document. This can be used to test whether linking to a PDF works. - the instrument has both a `riskClassInfo.legalHint` as well as a `strikingHint`. Both should be visible in the order form. - ISIN DE0008404005 (Allianz) and some other hidden ISINs (can be requested from brokerize support) - one exchange with all available orderModels - orders are executed immediately - limit orders are executed at exactly the provided limit price - ISIN DE0008430026 (Munich Re) - one exchange (L&S) with all available orderModels - orders are executed immediately - ISIN FR0000120321 (L\'Oréal) - one exchange with all available orderModels - the exchange has a `securityQuotesToken` set - orders stay open - changesHaveCostEstimations is `true` for orders with this ISIN - ISIN US5949181045 (Microsoft) - one exchange with all available orderModels - if size is even, a partial execution with size 1 is executed, the remaining part stays open - if size is odd, a partial execution with size 1 is executed, the remaining part is canceled - ISIN US30303M1027 (Meta) - one exchange with all available orderModels - for each piece of the order size, there will be one execution with size 1 (so e.g. 10 executions for size 10) - sizes > 30 are not accepted - ISIN US2546871060 (Disney) - one exchange with all available orderModels - all orders are canceled after 3s - `costEstimationMustBeShown` is false and `costEstimationIsOnlyDetailedTable` is true (frontends must only show a link to the cost estimation table) - ISIN XX1234567890 (example of an ISIN that can never be mapped by frontends) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007100000 (Mercedes-Benz) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007472060 (Wirecard) - test instrument for `empty orderModelsBuy` / `onlySellAllowed` - ISIN BTC (Bitcoin/Euro) - has one exchange with support for quote, market and limit orders - orders will be executed right away (with the exception of limit orders with the limit 42. Those stay open!) - can be used to test frontend mapping of cryptos - when you prepare a trade in the *second* portfolio (which has two cash accounts), `sizeUnitsByCashAccountId` will be set, so that the frontend can let the user select a combination of `cashAccount` and `sizeUnit`. - positions of BTC/EUR will always have sizeDecimals=8 - ISIN DE0006231004 (Infineon Technologies AG) - one exchange with `orderModelsSell=[\'market\']` and `orderModelsBuy=[]` - ISIN DE0005552004 (Deutsche Post AG) - one exchange with `orderModelsSell=[]` and `orderModelsBuy=[\'market\']` - market buy orders are executed immediately - positions of DE0005552004 will always have sizeDecimals=undefined - ISIN US8740541094 (Take Two) - three exchanges are available. all have `market` and `limit` available - configuration for `takeProfitStopLoss` is different for the three exchanges. This can be used to test the implementation of takeProfit/stopLoss creation. - exchange_with_exclusive_tp_sl: `takeProfitStopLoss.exclusive` is `true`, so that only one of the two can be set. Also, both fields are limited to market buy orders - exchange_with_unlimited_tp_sl: `takeProfitStopLoss.exclusive` is `false`, so that both tp and sl may be set, for both sell and buy orders and both support orderModels - exchange_without_tp_sl: `takeProfitStopLoss` is not set, so that no tp/sl can be set - orders stay open forever - the order size can be changed (`allowsChangeSize=true`) - ISIN US5529531015 (MGM Resorts International) - one exchange with market and limit orders - orders are executed immediately - short selling is allowed, so `availableOrderIntents` as well as `availableOrderIntentsToken` is set. \"sell to open\" and \"buy to close\" can be tested here. - ISIN XAU (Gold) - only quote trading is allowed - depending on the selected portfolio, it is possible to select a cash account (e.g. EUR or USD) to trade with - users can chose between specifying the order size in the cash currency or in grams - quotes have the `totalAmount` field set - ISIN US88160R1014 (Tesla) - market, limit, stop buy trading is allowed - `GetCostEstimation` returns order fees - orders will be executed - order fees are saved for the order and returned in the order receipt - `CryptoPair` ADA-USD (Cardano - US Dollar) - `quote`, `market`, `limit` order models are available - One of the created demobroker portfolios does not have an USD cash account. For this portfolio an error will appear upon opening the order form - users can chose between specifying the order size in the cash currency (USD) or in ADA - validity types for limit orders are [`IOC`, `GTDT`]. With `GTDT` the user can specify a date AND time at which his order should be executed - the size input decimal places are limited per sizeUnit. For USD it\'s 2 and for ADA it is 4 decimal places - the orders will be executed after 10 seconds - all other orders will be canceled after 3 seconds When orders are created using a `decoupled` method, the order id is only returned if the order size is greater than `5`. This can be used to test if the order receipt is skipped correctly in UIs. Cost estimations for `buy` and `sell` return a different set of fields. This can be used to test proper UI behavior when fields are set or unavailable. Behavior of `PortfolioQuotes` in the demo broker: - portfolio 1 starts with 100.000€ cash. portfolio 2 has two cash accounts, one starts with 100.000€, one with 100.000$. - when cash account values are summed up, we just assume an exchange rate of 1:1 - each open buy order reserves 10€ cash from the availableCash - profit loss of the portfolio is the sum of the position\'s profit loss - if a EUR cashAccount has the value 0,00€, its `hideInOverviews` property is set to true. This can be used to test the frontend\'s behavior when a cash account is hidden.
4457
+ * Create an account at the demo broker for the logged-in user. The account will have a default set of two empty portfolios by default. If the setting `isSinglePortfolio` is set, only one portfolio is created. The account as well as the two portfolios have a randomly generated name. To log into an account, use the account\'s generated name as username (Account name) in `AddSession`. - with the password `42`, the login will succeed immediately - with the password `1337`, a challenge with type text will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - with the password `7`, a challenge with type base64png will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - other passwords will not allow to log in The demo broker implements the following pre-defined trade behaviors, so that different flows can be tested: - ISIN US0378331005 (Apple): - market buy order is executed after 10 seconds by the backend at a random quote - stop buy or stop loss order stays open forever (can be used for testing cancellation) - cost estimations contain a `costDetailsLink` and a `costAcceptancePrompt` - securityDetailedInfo is set, so a \"KID\" link should be displayed and linked to the corresponding table - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN LU0378438732 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - orders are rejected with code `ORDER_REJECTED` immediately - ISIN LU2611732046 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - two exchanges are available (\"xetra\" and \"quoteExchange\") - xetra allows market and limit orders for buying and has defaultValidityByOrderModel set to GFD for market and GTD 2030-01-01 for limit - orders are rejected with code `ORDER_REJECTED` immediately - ISIN DE000MD96WE8 (a knock out with DAX as underlying) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN DE000DTR0CK8 (Daimler Truck Holding) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN US4180561072 (Hasbro) - only quote orders on one exchange are supported - the quotes are valid for 45 seconds - quote value is always `42` - the order gets executed immediately - ISIN DE0005557508 (Deutsche Telekom) - only quote orders on two different exchanges are supported - the quotes do *NOT* have an expiration - quote value is always `42` - quote comes together with a costEstimation. Subsequent getCostEstimation calls are not allowed. - `noExchangeDefault` is true, so that exchange must be selected by the user - order will be canceled after 3 seconds - ISIN US98980L1017 (Zoom) - only market orders (both buy and sell) are suppored on one exchange - orders are executed immediately at a random quote - order creation requires the user to accept a hint (i.e. first try will result in a `MUST_ACCEPT_HINT` error) - default validity is set to `GTD` with a date of `2030-01-01` - ISIN US29786A1060 (Etsy) - the prepareTrade request takes 5 seconds - create challenge takes 5 seconds. for authMethod photoTAN, the challenge will return with an error after that period of time - only quote and market orders allowed - at exchange \"Slow exchange\" it takes 7 seconds to get a quote as well as 7 seconds to retrieve order costs - at exchange \"Exchange with quote and cost errors\" the quote request as well as cost estimation will end with an error after 3 seconds - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN XS2149280948 (bond from Bertelsmann) - quote, limit and market orders (both buy and sell) are supported on one exchange - limit orders are executed at exactly the limit price - market orders are executed at a random quote between 90 and 150 percent - for market orders, there is a legal message to confirm set (`legalMessagesToConfirmByOrderModel`) - ISIN US64110L1061 (Netflix Inc.) - one exchange with only quote order - creating the quote order will return an error (quote expired) - ISIN US67066G1040 (NVIDIA) - one exchange with only quote order, allowsQuoteModeLimit=true - quote orders are executed immediately. - if a quoteLimit is provided, execution happen at quoteLimit value - otherwise, a random execution quote will be used - ISIN DE000BAY0017 (Bayer AG) - one exchange with only market order - `costEstimationIsNotAvailable` is true, so no cost estimations should be linked/shown - orders will be canceled after 3 seconds - ISIN DE000PAH0038 (Porsche) - one exchange with only market order - all orders will be canceled - `GetCostEstimation` contains (only) a link to a PDF document. This can be used to test whether linking to a PDF works. - the instrument has both a `riskClassInfo.legalHint` as well as a `strikingHint`. Both should be visible in the order form. - ISIN DE0008404005 (Allianz) and some other hidden ISINs (can be requested from brokerize support) - one exchange with all available orderModels - orders are executed immediately - limit orders are executed at exactly the provided limit price - ISIN DE0008430026 (Munich Re) - one exchange (L&S) with all available orderModels - orders are executed immediately - ISIN FR0000120321 (L\'Oréal) - one exchange with all available orderModels - the exchange has a `securityQuotesToken` set - orders stay open - changesHaveCostEstimations is `true` for orders with this ISIN - ISIN US5949181045 (Microsoft) - one exchange with all available orderModels - if size is even, a partial execution with size 1 is executed, the remaining part stays open - if size is odd, a partial execution with size 1 is executed, the remaining part is canceled - ISIN US30303M1027 (Meta) - one exchange with all available orderModels - for each piece of the order size, there will be one execution with size 1 (so e.g. 10 executions for size 10) - sizes > 30 are not accepted - ISIN US2546871060 (Disney) - one exchange with all available orderModels - all orders are canceled after 3s - `costEstimationMustBeShown` is false and `costEstimationIsOnlyDetailedTable` is true (frontends must only show a link to the cost estimation table) - ISIN XX1234567890 (example of an ISIN that can never be mapped by frontends) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007100000 (Mercedes-Benz) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007472060 (Wirecard) - test instrument for `empty orderModelsBuy` / `onlySellAllowed` - ISIN BTC (Bitcoin/Euro) - has one exchange with support for quote, market and limit orders - orders will be executed right away (with the exception of limit orders with the limit 42. Those stay open!) - can be used to test frontend mapping of cryptos - when you prepare a trade in the *second* portfolio (which has two cash accounts), `sizeUnitsByCashAccountId` will be set, so that the frontend can let the user select a combination of `cashAccount` and `sizeUnit`. - positions of BTC/EUR will always have sizeDecimals=8 - ISIN DE0006231004 (Infineon Technologies AG) - one exchange with `orderModelsSell=[\'market\']` and `orderModelsBuy=[]` - ISIN DE0005552004 (Deutsche Post AG) - one exchange with `orderModelsSell=[]` and `orderModelsBuy=[\'market\']` - market buy orders are executed immediately - positions of DE0005552004 will always have sizeDecimals=undefined - ISIN US8740541094 (Take Two) - three exchanges are available. all have `market` and `limit` available - configuration for `takeProfitStopLoss` is different for the three exchanges. This can be used to test the implementation of takeProfit/stopLoss creation. - exchange_with_exclusive_tp_sl: `takeProfitStopLoss.exclusive` is `true`, so that only one of the two can be set. Also, both fields are limited to market buy orders - exchange_with_unlimited_tp_sl: `takeProfitStopLoss.exclusive` is `false`, so that both tp and sl may be set, for both sell and buy orders and both support orderModels - exchange_without_tp_sl: `takeProfitStopLoss` is not set, so that no tp/sl can be set - orders stay open forever - the order size can be changed (`allowsChangeSize=true`) - ISIN US5529531015 (MGM Resorts International) - one exchange with market and limit orders - orders are executed immediately - short selling is allowed, so `availableOrderIntents` as well as `availableOrderIntentsToken` is set. \"sell to open\" and \"buy to close\" can be tested here. - ISIN XAU (Gold) - only quote trading is allowed - depending on the selected portfolio, it is possible to select a cash account (e.g. EUR or USD) to trade with - users can chose between specifying the order size in the cash currency or in grams - quotes have the `totalAmount` field set - ISIN US88160R1014 (Tesla) - market, limit, stop buy trading is allowed - `GetCostEstimation` returns order fees - orders will be executed - order fees are saved for the order and returned in the order receipt - `CryptoPair` ADA-USD (Cardano - US Dollar) - `quote`, `market`, `limit` order models are available - One of the created demobroker portfolios does not have an USD cash account. For this portfolio an error will appear upon opening the order form - users can chose between specifying the order size in the cash currency (USD) or in ADA - validity types for limit orders are [`IOC`, `GTDT`]. With `GTDT` the user can specify a date AND time at which his order should be executed - the size input decimal places are limited per sizeUnit. For USD it\'s 2 and for ADA it is 4 decimal places - the orders will be executed after 10 seconds - ISIN US23804L1035 (Datadog Inc.) - only quote orders are available - in 80% of `CreateTrade` calls, a 400 error with the code `QUOTE_REJECTED_RETRYABLE` is returned. This can be used to test UIs which automatically retry `GetQuote` in this case. - all other orders will be canceled after 3 seconds When orders are created using a `decoupled` method, the order id is only returned if the order size is greater than `5`. This can be used to test if the order receipt is skipped correctly in UIs. Cost estimations for `buy` and `sell` return a different set of fields. This can be used to test proper UI behavior when fields are set or unavailable. Behavior of `PortfolioQuotes` in the demo broker: - portfolio 1 starts with 100.000€ cash. portfolio 2 has two cash accounts, one starts with 100.000€, one with 100.000$. - when cash account values are summed up, we just assume an exchange rate of 1:1 - each open buy order reserves 10€ cash from the availableCash - profit loss of the portfolio is the sum of the position\'s profit loss - if a EUR cashAccount has the value 0,00€, its `hideInOverviews` property is set to true. This can be used to test the frontend\'s behavior when a cash account is hidden.
4446
4458
  */
4447
4459
  createDemoAccountRaw(requestParameters: CreateDemoAccountRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<CreatedResponseBody>>;
4448
4460
  /**
4449
- * Create an account at the demo broker for the logged-in user. The account will have a default set of two empty portfolios by default. If the setting `isSinglePortfolio` is set, only one portfolio is created. The account as well as the two portfolios have a randomly generated name. To log into an account, use the account\'s generated name as username (Account name) in `AddSession`. - with the password `42`, the login will succeed immediately - with the password `1337`, a challenge with type text will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - with the password `7`, a challenge with type base64png will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - other passwords will not allow to log in The demo broker implements the following pre-defined trade behaviors, so that different flows can be tested: - ISIN US0378331005 (Apple): - market buy order is executed after 10 seconds by the backend at a random quote - stop buy or stop loss order stays open forever (can be used for testing cancellation) - cost estimations contain a `costDetailsLink` and a `costAcceptancePrompt` - securityDetailedInfo is set, so a \"KID\" link should be displayed and linked to the corresponding table - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN LU0378438732 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - orders are rejected with code `ORDER_REJECTED` immediately - ISIN LU2611732046 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - two exchanges are available (\"xetra\" and \"quoteExchange\") - xetra allows market and limit orders for buying and has defaultValidityByOrderModel set to GFD for market and GTD 2030-01-01 for limit - orders are rejected with code `ORDER_REJECTED` immediately - ISIN DE000MD96WE8 (a knock out with DAX as underlying) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN DE000DTR0CK8 (Daimler Truck Holding) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN US4180561072 (Hasbro) - only quote orders on one exchange are supported - the quotes are valid for 45 seconds - quote value is always `42` - the order gets executed immediately - ISIN DE0005557508 (Deutsche Telekom) - only quote orders on two different exchanges are supported - the quotes do *NOT* have an expiration - quote value is always `42` - quote comes together with a costEstimation. Subsequent getCostEstimation calls are not allowed. - `noExchangeDefault` is true, so that exchange must be selected by the user - order will be canceled after 3 seconds - ISIN US98980L1017 (Zoom) - only market orders (both buy and sell) are suppored on one exchange - orders are executed immediately at a random quote - order creation requires the user to accept a hint (i.e. first try will result in a `MUST_ACCEPT_HINT` error) - default validity is set to `GTD` with a date of `2030-01-01` - ISIN US29786A1060 (Etsy) - the prepareTrade request takes 5 seconds - create challenge takes 5 seconds. for authMethod photoTAN, the challenge will return with an error after that period of time - only quote and market orders allowed - at exchange \"Slow exchange\" it takes 7 seconds to get a quote as well as 7 seconds to retrieve order costs - at exchange \"Exchange with quote and cost errors\" the quote request as well as cost estimation will end with an error after 3 seconds - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN XS2149280948 (bond from Bertelsmann) - quote, limit and market orders (both buy and sell) are supported on one exchange - limit orders are executed at exactly the limit price - market orders are executed at a random quote between 90 and 150 percent - for market orders, there is a legal message to confirm set (`legalMessagesToConfirmByOrderModel`) - ISIN US64110L1061 (Netflix Inc.) - one exchange with only quote order - creating the quote order will return an error (quote expired) - ISIN US67066G1040 (NVIDIA) - one exchange with only quote order, allowsQuoteModeLimit=true - quote orders are executed immediately. - if a quoteLimit is provided, execution happen at quoteLimit value - otherwise, a random execution quote will be used - ISIN DE000BAY0017 (Bayer AG) - one exchange with only market order - `costEstimationIsNotAvailable` is true, so no cost estimations should be linked/shown - orders will be canceled after 3 seconds - ISIN DE000PAH0038 (Porsche) - one exchange with only market order - all orders will be canceled - `GetCostEstimation` contains (only) a link to a PDF document. This can be used to test whether linking to a PDF works. - the instrument has both a `riskClassInfo.legalHint` as well as a `strikingHint`. Both should be visible in the order form. - ISIN DE0008404005 (Allianz) and some other hidden ISINs (can be requested from brokerize support) - one exchange with all available orderModels - orders are executed immediately - limit orders are executed at exactly the provided limit price - ISIN DE0008430026 (Munich Re) - one exchange (L&S) with all available orderModels - orders are executed immediately - ISIN FR0000120321 (L\'Oréal) - one exchange with all available orderModels - the exchange has a `securityQuotesToken` set - orders stay open - changesHaveCostEstimations is `true` for orders with this ISIN - ISIN US5949181045 (Microsoft) - one exchange with all available orderModels - if size is even, a partial execution with size 1 is executed, the remaining part stays open - if size is odd, a partial execution with size 1 is executed, the remaining part is canceled - ISIN US30303M1027 (Meta) - one exchange with all available orderModels - for each piece of the order size, there will be one execution with size 1 (so e.g. 10 executions for size 10) - sizes > 30 are not accepted - ISIN US2546871060 (Disney) - one exchange with all available orderModels - all orders are canceled after 3s - `costEstimationMustBeShown` is false and `costEstimationIsOnlyDetailedTable` is true (frontends must only show a link to the cost estimation table) - ISIN XX1234567890 (example of an ISIN that can never be mapped by frontends) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007100000 (Mercedes-Benz) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007472060 (Wirecard) - test instrument for `empty orderModelsBuy` / `onlySellAllowed` - ISIN BTC (Bitcoin/Euro) - has one exchange with support for quote, market and limit orders - orders will be executed right away (with the exception of limit orders with the limit 42. Those stay open!) - can be used to test frontend mapping of cryptos - when you prepare a trade in the *second* portfolio (which has two cash accounts), `sizeUnitsByCashAccountId` will be set, so that the frontend can let the user select a combination of `cashAccount` and `sizeUnit`. - positions of BTC/EUR will always have sizeDecimals=8 - ISIN DE0006231004 (Infineon Technologies AG) - one exchange with `orderModelsSell=[\'market\']` and `orderModelsBuy=[]` - ISIN DE0005552004 (Deutsche Post AG) - one exchange with `orderModelsSell=[]` and `orderModelsBuy=[\'market\']` - market buy orders are executed immediately - positions of DE0005552004 will always have sizeDecimals=undefined - ISIN US8740541094 (Take Two) - three exchanges are available. all have `market` and `limit` available - configuration for `takeProfitStopLoss` is different for the three exchanges. This can be used to test the implementation of takeProfit/stopLoss creation. - exchange_with_exclusive_tp_sl: `takeProfitStopLoss.exclusive` is `true`, so that only one of the two can be set. Also, both fields are limited to market buy orders - exchange_with_unlimited_tp_sl: `takeProfitStopLoss.exclusive` is `false`, so that both tp and sl may be set, for both sell and buy orders and both support orderModels - exchange_without_tp_sl: `takeProfitStopLoss` is not set, so that no tp/sl can be set - orders stay open forever - the order size can be changed (`allowsChangeSize=true`) - ISIN US5529531015 (MGM Resorts International) - one exchange with market and limit orders - orders are executed immediately - short selling is allowed, so `availableOrderIntents` as well as `availableOrderIntentsToken` is set. \"sell to open\" and \"buy to close\" can be tested here. - ISIN XAU (Gold) - only quote trading is allowed - depending on the selected portfolio, it is possible to select a cash account (e.g. EUR or USD) to trade with - users can chose between specifying the order size in the cash currency or in grams - quotes have the `totalAmount` field set - ISIN US88160R1014 (Tesla) - market, limit, stop buy trading is allowed - `GetCostEstimation` returns order fees - orders will be executed - order fees are saved for the order and returned in the order receipt - `CryptoPair` ADA-USD (Cardano - US Dollar) - `quote`, `market`, `limit` order models are available - One of the created demobroker portfolios does not have an USD cash account. For this portfolio an error will appear upon opening the order form - users can chose between specifying the order size in the cash currency (USD) or in ADA - validity types for limit orders are [`IOC`, `GTDT`]. With `GTDT` the user can specify a date AND time at which his order should be executed - the size input decimal places are limited per sizeUnit. For USD it\'s 2 and for ADA it is 4 decimal places - the orders will be executed after 10 seconds - all other orders will be canceled after 3 seconds When orders are created using a `decoupled` method, the order id is only returned if the order size is greater than `5`. This can be used to test if the order receipt is skipped correctly in UIs. Cost estimations for `buy` and `sell` return a different set of fields. This can be used to test proper UI behavior when fields are set or unavailable. Behavior of `PortfolioQuotes` in the demo broker: - portfolio 1 starts with 100.000€ cash. portfolio 2 has two cash accounts, one starts with 100.000€, one with 100.000$. - when cash account values are summed up, we just assume an exchange rate of 1:1 - each open buy order reserves 10€ cash from the availableCash - profit loss of the portfolio is the sum of the position\'s profit loss - if a EUR cashAccount has the value 0,00€, its `hideInOverviews` property is set to true. This can be used to test the frontend\'s behavior when a cash account is hidden.
4461
+ * Create an account at the demo broker for the logged-in user. The account will have a default set of two empty portfolios by default. If the setting `isSinglePortfolio` is set, only one portfolio is created. The account as well as the two portfolios have a randomly generated name. To log into an account, use the account\'s generated name as username (Account name) in `AddSession`. - with the password `42`, the login will succeed immediately - with the password `1337`, a challenge with type text will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - with the password `7`, a challenge with type base64png will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - other passwords will not allow to log in The demo broker implements the following pre-defined trade behaviors, so that different flows can be tested: - ISIN US0378331005 (Apple): - market buy order is executed after 10 seconds by the backend at a random quote - stop buy or stop loss order stays open forever (can be used for testing cancellation) - cost estimations contain a `costDetailsLink` and a `costAcceptancePrompt` - securityDetailedInfo is set, so a \"KID\" link should be displayed and linked to the corresponding table - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN LU0378438732 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - orders are rejected with code `ORDER_REJECTED` immediately - ISIN LU2611732046 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - two exchanges are available (\"xetra\" and \"quoteExchange\") - xetra allows market and limit orders for buying and has defaultValidityByOrderModel set to GFD for market and GTD 2030-01-01 for limit - orders are rejected with code `ORDER_REJECTED` immediately - ISIN DE000MD96WE8 (a knock out with DAX as underlying) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN DE000DTR0CK8 (Daimler Truck Holding) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN US4180561072 (Hasbro) - only quote orders on one exchange are supported - the quotes are valid for 45 seconds - quote value is always `42` - the order gets executed immediately - ISIN DE0005557508 (Deutsche Telekom) - only quote orders on two different exchanges are supported - the quotes do *NOT* have an expiration - quote value is always `42` - quote comes together with a costEstimation. Subsequent getCostEstimation calls are not allowed. - `noExchangeDefault` is true, so that exchange must be selected by the user - order will be canceled after 3 seconds - ISIN US98980L1017 (Zoom) - only market orders (both buy and sell) are suppored on one exchange - orders are executed immediately at a random quote - order creation requires the user to accept a hint (i.e. first try will result in a `MUST_ACCEPT_HINT` error) - default validity is set to `GTD` with a date of `2030-01-01` - ISIN US29786A1060 (Etsy) - the prepareTrade request takes 5 seconds - create challenge takes 5 seconds. for authMethod photoTAN, the challenge will return with an error after that period of time - only quote and market orders allowed - at exchange \"Slow exchange\" it takes 7 seconds to get a quote as well as 7 seconds to retrieve order costs - at exchange \"Exchange with quote and cost errors\" the quote request as well as cost estimation will end with an error after 3 seconds - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN XS2149280948 (bond from Bertelsmann) - quote, limit and market orders (both buy and sell) are supported on one exchange - limit orders are executed at exactly the limit price - market orders are executed at a random quote between 90 and 150 percent - for market orders, there is a legal message to confirm set (`legalMessagesToConfirmByOrderModel`) - ISIN US64110L1061 (Netflix Inc.) - one exchange with only quote order - creating the quote order will return an error (quote expired) - ISIN US67066G1040 (NVIDIA) - one exchange with only quote order, allowsQuoteModeLimit=true - quote orders are executed immediately. - if a quoteLimit is provided, execution happen at quoteLimit value - otherwise, a random execution quote will be used - ISIN DE000BAY0017 (Bayer AG) - one exchange with only market order - `costEstimationIsNotAvailable` is true, so no cost estimations should be linked/shown - orders will be canceled after 3 seconds - ISIN DE000PAH0038 (Porsche) - one exchange with only market order - all orders will be canceled - `GetCostEstimation` contains (only) a link to a PDF document. This can be used to test whether linking to a PDF works. - the instrument has both a `riskClassInfo.legalHint` as well as a `strikingHint`. Both should be visible in the order form. - ISIN DE0008404005 (Allianz) and some other hidden ISINs (can be requested from brokerize support) - one exchange with all available orderModels - orders are executed immediately - limit orders are executed at exactly the provided limit price - ISIN DE0008430026 (Munich Re) - one exchange (L&S) with all available orderModels - orders are executed immediately - ISIN FR0000120321 (L\'Oréal) - one exchange with all available orderModels - the exchange has a `securityQuotesToken` set - orders stay open - changesHaveCostEstimations is `true` for orders with this ISIN - ISIN US5949181045 (Microsoft) - one exchange with all available orderModels - if size is even, a partial execution with size 1 is executed, the remaining part stays open - if size is odd, a partial execution with size 1 is executed, the remaining part is canceled - ISIN US30303M1027 (Meta) - one exchange with all available orderModels - for each piece of the order size, there will be one execution with size 1 (so e.g. 10 executions for size 10) - sizes > 30 are not accepted - ISIN US2546871060 (Disney) - one exchange with all available orderModels - all orders are canceled after 3s - `costEstimationMustBeShown` is false and `costEstimationIsOnlyDetailedTable` is true (frontends must only show a link to the cost estimation table) - ISIN XX1234567890 (example of an ISIN that can never be mapped by frontends) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007100000 (Mercedes-Benz) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007472060 (Wirecard) - test instrument for `empty orderModelsBuy` / `onlySellAllowed` - ISIN BTC (Bitcoin/Euro) - has one exchange with support for quote, market and limit orders - orders will be executed right away (with the exception of limit orders with the limit 42. Those stay open!) - can be used to test frontend mapping of cryptos - when you prepare a trade in the *second* portfolio (which has two cash accounts), `sizeUnitsByCashAccountId` will be set, so that the frontend can let the user select a combination of `cashAccount` and `sizeUnit`. - positions of BTC/EUR will always have sizeDecimals=8 - ISIN DE0006231004 (Infineon Technologies AG) - one exchange with `orderModelsSell=[\'market\']` and `orderModelsBuy=[]` - ISIN DE0005552004 (Deutsche Post AG) - one exchange with `orderModelsSell=[]` and `orderModelsBuy=[\'market\']` - market buy orders are executed immediately - positions of DE0005552004 will always have sizeDecimals=undefined - ISIN US8740541094 (Take Two) - three exchanges are available. all have `market` and `limit` available - configuration for `takeProfitStopLoss` is different for the three exchanges. This can be used to test the implementation of takeProfit/stopLoss creation. - exchange_with_exclusive_tp_sl: `takeProfitStopLoss.exclusive` is `true`, so that only one of the two can be set. Also, both fields are limited to market buy orders - exchange_with_unlimited_tp_sl: `takeProfitStopLoss.exclusive` is `false`, so that both tp and sl may be set, for both sell and buy orders and both support orderModels - exchange_without_tp_sl: `takeProfitStopLoss` is not set, so that no tp/sl can be set - orders stay open forever - the order size can be changed (`allowsChangeSize=true`) - ISIN US5529531015 (MGM Resorts International) - one exchange with market and limit orders - orders are executed immediately - short selling is allowed, so `availableOrderIntents` as well as `availableOrderIntentsToken` is set. \"sell to open\" and \"buy to close\" can be tested here. - ISIN XAU (Gold) - only quote trading is allowed - depending on the selected portfolio, it is possible to select a cash account (e.g. EUR or USD) to trade with - users can chose between specifying the order size in the cash currency or in grams - quotes have the `totalAmount` field set - ISIN US88160R1014 (Tesla) - market, limit, stop buy trading is allowed - `GetCostEstimation` returns order fees - orders will be executed - order fees are saved for the order and returned in the order receipt - `CryptoPair` ADA-USD (Cardano - US Dollar) - `quote`, `market`, `limit` order models are available - One of the created demobroker portfolios does not have an USD cash account. For this portfolio an error will appear upon opening the order form - users can chose between specifying the order size in the cash currency (USD) or in ADA - validity types for limit orders are [`IOC`, `GTDT`]. With `GTDT` the user can specify a date AND time at which his order should be executed - the size input decimal places are limited per sizeUnit. For USD it\'s 2 and for ADA it is 4 decimal places - the orders will be executed after 10 seconds - ISIN US23804L1035 (Datadog Inc.) - only quote orders are available - in 80% of `CreateTrade` calls, a 400 error with the code `QUOTE_REJECTED_RETRYABLE` is returned. This can be used to test UIs which automatically retry `GetQuote` in this case. - all other orders will be canceled after 3 seconds When orders are created using a `decoupled` method, the order id is only returned if the order size is greater than `5`. This can be used to test if the order receipt is skipped correctly in UIs. Cost estimations for `buy` and `sell` return a different set of fields. This can be used to test proper UI behavior when fields are set or unavailable. Behavior of `PortfolioQuotes` in the demo broker: - portfolio 1 starts with 100.000€ cash. portfolio 2 has two cash accounts, one starts with 100.000€, one with 100.000$. - when cash account values are summed up, we just assume an exchange rate of 1:1 - each open buy order reserves 10€ cash from the availableCash - profit loss of the portfolio is the sum of the position\'s profit loss - if a EUR cashAccount has the value 0,00€, its `hideInOverviews` property is set to true. This can be used to test the frontend\'s behavior when a cash account is hidden.
4450
4462
  */
4451
4463
  createDemoAccount(requestParameters?: CreateDemoAccountRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<CreatedResponseBody>;
4452
4464
  /**
@@ -5047,7 +5059,7 @@ declare interface ErrorResponse {
5047
5059
  * Currently the following codes are implemented:
5048
5060
  * 'TRADING_ERROR', 'AUTH', 'RATE_LIMITED', 'VALIDATION_FAILED', 'MUST_ACCEPT_HINT', 'NO_SESSION_AVAILABLE_FOR_PORTFOLIO',
5049
5061
  * 'SECURITY_NOT_FOUND', 'SECURITY_NOT_TRADABLE_AT_EXCHANGE', 'ORDER_REJECTED', 'INTERNAL_SERVER_ERROR', 'MAINTENANCE',
5050
- * 'INTERNAL_SERVER_ERROR_BROKER_API' | 'NOT_FOUND'
5062
+ * 'INTERNAL_SERVER_ERROR_BROKER_API' | 'NOT_FOUND' | 'QUOTE_REJECTED_RETRYABLE'
5051
5063
  * @type {string}
5052
5064
  * @memberof ErrorResponse
5053
5065
  */
package/dist/index.js CHANGED
@@ -66,7 +66,7 @@ export class Brokerize {
66
66
  tokenType: responseJson.token_type,
67
67
  refreshTokenExpiresIn: responseJson.refresh_token_expires_in,
68
68
  idToken: responseJson.access_token,
69
- refreshTokenWithoutTradingsession: responseJson.refresh_Token_without_tradingsession,
69
+ refreshTokenWithoutTradingsession: responseJson.refresh_token_without_tradingsession,
70
70
  refreshTokenWithoutTradingsessionExpiresIn: responseJson.refresh_token_without_tradingsession_expires_in,
71
71
  },
72
72
  },
@@ -24,11 +24,11 @@ export interface TriggerDemoSessionSyncErrorRequest {
24
24
  */
25
25
  export declare class DemobrokerApi extends runtime.BaseAPI {
26
26
  /**
27
- * Create an account at the demo broker for the logged-in user. The account will have a default set of two empty portfolios by default. If the setting `isSinglePortfolio` is set, only one portfolio is created. The account as well as the two portfolios have a randomly generated name. To log into an account, use the account\'s generated name as username (Account name) in `AddSession`. - with the password `42`, the login will succeed immediately - with the password `1337`, a challenge with type text will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - with the password `7`, a challenge with type base64png will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - other passwords will not allow to log in The demo broker implements the following pre-defined trade behaviors, so that different flows can be tested: - ISIN US0378331005 (Apple): - market buy order is executed after 10 seconds by the backend at a random quote - stop buy or stop loss order stays open forever (can be used for testing cancellation) - cost estimations contain a `costDetailsLink` and a `costAcceptancePrompt` - securityDetailedInfo is set, so a \"KID\" link should be displayed and linked to the corresponding table - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN LU0378438732 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - orders are rejected with code `ORDER_REJECTED` immediately - ISIN LU2611732046 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - two exchanges are available (\"xetra\" and \"quoteExchange\") - xetra allows market and limit orders for buying and has defaultValidityByOrderModel set to GFD for market and GTD 2030-01-01 for limit - orders are rejected with code `ORDER_REJECTED` immediately - ISIN DE000MD96WE8 (a knock out with DAX as underlying) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN DE000DTR0CK8 (Daimler Truck Holding) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN US4180561072 (Hasbro) - only quote orders on one exchange are supported - the quotes are valid for 45 seconds - quote value is always `42` - the order gets executed immediately - ISIN DE0005557508 (Deutsche Telekom) - only quote orders on two different exchanges are supported - the quotes do *NOT* have an expiration - quote value is always `42` - quote comes together with a costEstimation. Subsequent getCostEstimation calls are not allowed. - `noExchangeDefault` is true, so that exchange must be selected by the user - order will be canceled after 3 seconds - ISIN US98980L1017 (Zoom) - only market orders (both buy and sell) are suppored on one exchange - orders are executed immediately at a random quote - order creation requires the user to accept a hint (i.e. first try will result in a `MUST_ACCEPT_HINT` error) - default validity is set to `GTD` with a date of `2030-01-01` - ISIN US29786A1060 (Etsy) - the prepareTrade request takes 5 seconds - create challenge takes 5 seconds. for authMethod photoTAN, the challenge will return with an error after that period of time - only quote and market orders allowed - at exchange \"Slow exchange\" it takes 7 seconds to get a quote as well as 7 seconds to retrieve order costs - at exchange \"Exchange with quote and cost errors\" the quote request as well as cost estimation will end with an error after 3 seconds - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN XS2149280948 (bond from Bertelsmann) - quote, limit and market orders (both buy and sell) are supported on one exchange - limit orders are executed at exactly the limit price - market orders are executed at a random quote between 90 and 150 percent - for market orders, there is a legal message to confirm set (`legalMessagesToConfirmByOrderModel`) - ISIN US64110L1061 (Netflix Inc.) - one exchange with only quote order - creating the quote order will return an error (quote expired) - ISIN US67066G1040 (NVIDIA) - one exchange with only quote order, allowsQuoteModeLimit=true - quote orders are executed immediately. - if a quoteLimit is provided, execution happen at quoteLimit value - otherwise, a random execution quote will be used - ISIN DE000BAY0017 (Bayer AG) - one exchange with only market order - `costEstimationIsNotAvailable` is true, so no cost estimations should be linked/shown - orders will be canceled after 3 seconds - ISIN DE000PAH0038 (Porsche) - one exchange with only market order - all orders will be canceled - `GetCostEstimation` contains (only) a link to a PDF document. This can be used to test whether linking to a PDF works. - the instrument has both a `riskClassInfo.legalHint` as well as a `strikingHint`. Both should be visible in the order form. - ISIN DE0008404005 (Allianz) and some other hidden ISINs (can be requested from brokerize support) - one exchange with all available orderModels - orders are executed immediately - limit orders are executed at exactly the provided limit price - ISIN DE0008430026 (Munich Re) - one exchange (L&S) with all available orderModels - orders are executed immediately - ISIN FR0000120321 (L\'Oréal) - one exchange with all available orderModels - the exchange has a `securityQuotesToken` set - orders stay open - changesHaveCostEstimations is `true` for orders with this ISIN - ISIN US5949181045 (Microsoft) - one exchange with all available orderModels - if size is even, a partial execution with size 1 is executed, the remaining part stays open - if size is odd, a partial execution with size 1 is executed, the remaining part is canceled - ISIN US30303M1027 (Meta) - one exchange with all available orderModels - for each piece of the order size, there will be one execution with size 1 (so e.g. 10 executions for size 10) - sizes > 30 are not accepted - ISIN US2546871060 (Disney) - one exchange with all available orderModels - all orders are canceled after 3s - `costEstimationMustBeShown` is false and `costEstimationIsOnlyDetailedTable` is true (frontends must only show a link to the cost estimation table) - ISIN XX1234567890 (example of an ISIN that can never be mapped by frontends) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007100000 (Mercedes-Benz) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007472060 (Wirecard) - test instrument for `empty orderModelsBuy` / `onlySellAllowed` - ISIN BTC (Bitcoin/Euro) - has one exchange with support for quote, market and limit orders - orders will be executed right away (with the exception of limit orders with the limit 42. Those stay open!) - can be used to test frontend mapping of cryptos - when you prepare a trade in the *second* portfolio (which has two cash accounts), `sizeUnitsByCashAccountId` will be set, so that the frontend can let the user select a combination of `cashAccount` and `sizeUnit`. - positions of BTC/EUR will always have sizeDecimals=8 - ISIN DE0006231004 (Infineon Technologies AG) - one exchange with `orderModelsSell=[\'market\']` and `orderModelsBuy=[]` - ISIN DE0005552004 (Deutsche Post AG) - one exchange with `orderModelsSell=[]` and `orderModelsBuy=[\'market\']` - market buy orders are executed immediately - positions of DE0005552004 will always have sizeDecimals=undefined - ISIN US8740541094 (Take Two) - three exchanges are available. all have `market` and `limit` available - configuration for `takeProfitStopLoss` is different for the three exchanges. This can be used to test the implementation of takeProfit/stopLoss creation. - exchange_with_exclusive_tp_sl: `takeProfitStopLoss.exclusive` is `true`, so that only one of the two can be set. Also, both fields are limited to market buy orders - exchange_with_unlimited_tp_sl: `takeProfitStopLoss.exclusive` is `false`, so that both tp and sl may be set, for both sell and buy orders and both support orderModels - exchange_without_tp_sl: `takeProfitStopLoss` is not set, so that no tp/sl can be set - orders stay open forever - the order size can be changed (`allowsChangeSize=true`) - ISIN US5529531015 (MGM Resorts International) - one exchange with market and limit orders - orders are executed immediately - short selling is allowed, so `availableOrderIntents` as well as `availableOrderIntentsToken` is set. \"sell to open\" and \"buy to close\" can be tested here. - ISIN XAU (Gold) - only quote trading is allowed - depending on the selected portfolio, it is possible to select a cash account (e.g. EUR or USD) to trade with - users can chose between specifying the order size in the cash currency or in grams - quotes have the `totalAmount` field set - ISIN US88160R1014 (Tesla) - market, limit, stop buy trading is allowed - `GetCostEstimation` returns order fees - orders will be executed - order fees are saved for the order and returned in the order receipt - `CryptoPair` ADA-USD (Cardano - US Dollar) - `quote`, `market`, `limit` order models are available - One of the created demobroker portfolios does not have an USD cash account. For this portfolio an error will appear upon opening the order form - users can chose between specifying the order size in the cash currency (USD) or in ADA - validity types for limit orders are [`IOC`, `GTDT`]. With `GTDT` the user can specify a date AND time at which his order should be executed - the size input decimal places are limited per sizeUnit. For USD it\'s 2 and for ADA it is 4 decimal places - the orders will be executed after 10 seconds - all other orders will be canceled after 3 seconds When orders are created using a `decoupled` method, the order id is only returned if the order size is greater than `5`. This can be used to test if the order receipt is skipped correctly in UIs. Cost estimations for `buy` and `sell` return a different set of fields. This can be used to test proper UI behavior when fields are set or unavailable. Behavior of `PortfolioQuotes` in the demo broker: - portfolio 1 starts with 100.000€ cash. portfolio 2 has two cash accounts, one starts with 100.000€, one with 100.000$. - when cash account values are summed up, we just assume an exchange rate of 1:1 - each open buy order reserves 10€ cash from the availableCash - profit loss of the portfolio is the sum of the position\'s profit loss - if a EUR cashAccount has the value 0,00€, its `hideInOverviews` property is set to true. This can be used to test the frontend\'s behavior when a cash account is hidden.
27
+ * Create an account at the demo broker for the logged-in user. The account will have a default set of two empty portfolios by default. If the setting `isSinglePortfolio` is set, only one portfolio is created. The account as well as the two portfolios have a randomly generated name. To log into an account, use the account\'s generated name as username (Account name) in `AddSession`. - with the password `42`, the login will succeed immediately - with the password `1337`, a challenge with type text will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - with the password `7`, a challenge with type base64png will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - other passwords will not allow to log in The demo broker implements the following pre-defined trade behaviors, so that different flows can be tested: - ISIN US0378331005 (Apple): - market buy order is executed after 10 seconds by the backend at a random quote - stop buy or stop loss order stays open forever (can be used for testing cancellation) - cost estimations contain a `costDetailsLink` and a `costAcceptancePrompt` - securityDetailedInfo is set, so a \"KID\" link should be displayed and linked to the corresponding table - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN LU0378438732 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - orders are rejected with code `ORDER_REJECTED` immediately - ISIN LU2611732046 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - two exchanges are available (\"xetra\" and \"quoteExchange\") - xetra allows market and limit orders for buying and has defaultValidityByOrderModel set to GFD for market and GTD 2030-01-01 for limit - orders are rejected with code `ORDER_REJECTED` immediately - ISIN DE000MD96WE8 (a knock out with DAX as underlying) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN DE000DTR0CK8 (Daimler Truck Holding) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN US4180561072 (Hasbro) - only quote orders on one exchange are supported - the quotes are valid for 45 seconds - quote value is always `42` - the order gets executed immediately - ISIN DE0005557508 (Deutsche Telekom) - only quote orders on two different exchanges are supported - the quotes do *NOT* have an expiration - quote value is always `42` - quote comes together with a costEstimation. Subsequent getCostEstimation calls are not allowed. - `noExchangeDefault` is true, so that exchange must be selected by the user - order will be canceled after 3 seconds - ISIN US98980L1017 (Zoom) - only market orders (both buy and sell) are suppored on one exchange - orders are executed immediately at a random quote - order creation requires the user to accept a hint (i.e. first try will result in a `MUST_ACCEPT_HINT` error) - default validity is set to `GTD` with a date of `2030-01-01` - ISIN US29786A1060 (Etsy) - the prepareTrade request takes 5 seconds - create challenge takes 5 seconds. for authMethod photoTAN, the challenge will return with an error after that period of time - only quote and market orders allowed - at exchange \"Slow exchange\" it takes 7 seconds to get a quote as well as 7 seconds to retrieve order costs - at exchange \"Exchange with quote and cost errors\" the quote request as well as cost estimation will end with an error after 3 seconds - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN XS2149280948 (bond from Bertelsmann) - quote, limit and market orders (both buy and sell) are supported on one exchange - limit orders are executed at exactly the limit price - market orders are executed at a random quote between 90 and 150 percent - for market orders, there is a legal message to confirm set (`legalMessagesToConfirmByOrderModel`) - ISIN US64110L1061 (Netflix Inc.) - one exchange with only quote order - creating the quote order will return an error (quote expired) - ISIN US67066G1040 (NVIDIA) - one exchange with only quote order, allowsQuoteModeLimit=true - quote orders are executed immediately. - if a quoteLimit is provided, execution happen at quoteLimit value - otherwise, a random execution quote will be used - ISIN DE000BAY0017 (Bayer AG) - one exchange with only market order - `costEstimationIsNotAvailable` is true, so no cost estimations should be linked/shown - orders will be canceled after 3 seconds - ISIN DE000PAH0038 (Porsche) - one exchange with only market order - all orders will be canceled - `GetCostEstimation` contains (only) a link to a PDF document. This can be used to test whether linking to a PDF works. - the instrument has both a `riskClassInfo.legalHint` as well as a `strikingHint`. Both should be visible in the order form. - ISIN DE0008404005 (Allianz) and some other hidden ISINs (can be requested from brokerize support) - one exchange with all available orderModels - orders are executed immediately - limit orders are executed at exactly the provided limit price - ISIN DE0008430026 (Munich Re) - one exchange (L&S) with all available orderModels - orders are executed immediately - ISIN FR0000120321 (L\'Oréal) - one exchange with all available orderModels - the exchange has a `securityQuotesToken` set - orders stay open - changesHaveCostEstimations is `true` for orders with this ISIN - ISIN US5949181045 (Microsoft) - one exchange with all available orderModels - if size is even, a partial execution with size 1 is executed, the remaining part stays open - if size is odd, a partial execution with size 1 is executed, the remaining part is canceled - ISIN US30303M1027 (Meta) - one exchange with all available orderModels - for each piece of the order size, there will be one execution with size 1 (so e.g. 10 executions for size 10) - sizes > 30 are not accepted - ISIN US2546871060 (Disney) - one exchange with all available orderModels - all orders are canceled after 3s - `costEstimationMustBeShown` is false and `costEstimationIsOnlyDetailedTable` is true (frontends must only show a link to the cost estimation table) - ISIN XX1234567890 (example of an ISIN that can never be mapped by frontends) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007100000 (Mercedes-Benz) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007472060 (Wirecard) - test instrument for `empty orderModelsBuy` / `onlySellAllowed` - ISIN BTC (Bitcoin/Euro) - has one exchange with support for quote, market and limit orders - orders will be executed right away (with the exception of limit orders with the limit 42. Those stay open!) - can be used to test frontend mapping of cryptos - when you prepare a trade in the *second* portfolio (which has two cash accounts), `sizeUnitsByCashAccountId` will be set, so that the frontend can let the user select a combination of `cashAccount` and `sizeUnit`. - positions of BTC/EUR will always have sizeDecimals=8 - ISIN DE0006231004 (Infineon Technologies AG) - one exchange with `orderModelsSell=[\'market\']` and `orderModelsBuy=[]` - ISIN DE0005552004 (Deutsche Post AG) - one exchange with `orderModelsSell=[]` and `orderModelsBuy=[\'market\']` - market buy orders are executed immediately - positions of DE0005552004 will always have sizeDecimals=undefined - ISIN US8740541094 (Take Two) - three exchanges are available. all have `market` and `limit` available - configuration for `takeProfitStopLoss` is different for the three exchanges. This can be used to test the implementation of takeProfit/stopLoss creation. - exchange_with_exclusive_tp_sl: `takeProfitStopLoss.exclusive` is `true`, so that only one of the two can be set. Also, both fields are limited to market buy orders - exchange_with_unlimited_tp_sl: `takeProfitStopLoss.exclusive` is `false`, so that both tp and sl may be set, for both sell and buy orders and both support orderModels - exchange_without_tp_sl: `takeProfitStopLoss` is not set, so that no tp/sl can be set - orders stay open forever - the order size can be changed (`allowsChangeSize=true`) - ISIN US5529531015 (MGM Resorts International) - one exchange with market and limit orders - orders are executed immediately - short selling is allowed, so `availableOrderIntents` as well as `availableOrderIntentsToken` is set. \"sell to open\" and \"buy to close\" can be tested here. - ISIN XAU (Gold) - only quote trading is allowed - depending on the selected portfolio, it is possible to select a cash account (e.g. EUR or USD) to trade with - users can chose between specifying the order size in the cash currency or in grams - quotes have the `totalAmount` field set - ISIN US88160R1014 (Tesla) - market, limit, stop buy trading is allowed - `GetCostEstimation` returns order fees - orders will be executed - order fees are saved for the order and returned in the order receipt - `CryptoPair` ADA-USD (Cardano - US Dollar) - `quote`, `market`, `limit` order models are available - One of the created demobroker portfolios does not have an USD cash account. For this portfolio an error will appear upon opening the order form - users can chose between specifying the order size in the cash currency (USD) or in ADA - validity types for limit orders are [`IOC`, `GTDT`]. With `GTDT` the user can specify a date AND time at which his order should be executed - the size input decimal places are limited per sizeUnit. For USD it\'s 2 and for ADA it is 4 decimal places - the orders will be executed after 10 seconds - ISIN US23804L1035 (Datadog Inc.) - only quote orders are available - in 80% of `CreateTrade` calls, a 400 error with the code `QUOTE_REJECTED_RETRYABLE` is returned. This can be used to test UIs which automatically retry `GetQuote` in this case. - all other orders will be canceled after 3 seconds When orders are created using a `decoupled` method, the order id is only returned if the order size is greater than `5`. This can be used to test if the order receipt is skipped correctly in UIs. Cost estimations for `buy` and `sell` return a different set of fields. This can be used to test proper UI behavior when fields are set or unavailable. Behavior of `PortfolioQuotes` in the demo broker: - portfolio 1 starts with 100.000€ cash. portfolio 2 has two cash accounts, one starts with 100.000€, one with 100.000$. - when cash account values are summed up, we just assume an exchange rate of 1:1 - each open buy order reserves 10€ cash from the availableCash - profit loss of the portfolio is the sum of the position\'s profit loss - if a EUR cashAccount has the value 0,00€, its `hideInOverviews` property is set to true. This can be used to test the frontend\'s behavior when a cash account is hidden.
28
28
  */
29
29
  createDemoAccountRaw(requestParameters: CreateDemoAccountRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<CreatedResponseBody>>;
30
30
  /**
31
- * Create an account at the demo broker for the logged-in user. The account will have a default set of two empty portfolios by default. If the setting `isSinglePortfolio` is set, only one portfolio is created. The account as well as the two portfolios have a randomly generated name. To log into an account, use the account\'s generated name as username (Account name) in `AddSession`. - with the password `42`, the login will succeed immediately - with the password `1337`, a challenge with type text will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - with the password `7`, a challenge with type base64png will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - other passwords will not allow to log in The demo broker implements the following pre-defined trade behaviors, so that different flows can be tested: - ISIN US0378331005 (Apple): - market buy order is executed after 10 seconds by the backend at a random quote - stop buy or stop loss order stays open forever (can be used for testing cancellation) - cost estimations contain a `costDetailsLink` and a `costAcceptancePrompt` - securityDetailedInfo is set, so a \"KID\" link should be displayed and linked to the corresponding table - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN LU0378438732 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - orders are rejected with code `ORDER_REJECTED` immediately - ISIN LU2611732046 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - two exchanges are available (\"xetra\" and \"quoteExchange\") - xetra allows market and limit orders for buying and has defaultValidityByOrderModel set to GFD for market and GTD 2030-01-01 for limit - orders are rejected with code `ORDER_REJECTED` immediately - ISIN DE000MD96WE8 (a knock out with DAX as underlying) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN DE000DTR0CK8 (Daimler Truck Holding) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN US4180561072 (Hasbro) - only quote orders on one exchange are supported - the quotes are valid for 45 seconds - quote value is always `42` - the order gets executed immediately - ISIN DE0005557508 (Deutsche Telekom) - only quote orders on two different exchanges are supported - the quotes do *NOT* have an expiration - quote value is always `42` - quote comes together with a costEstimation. Subsequent getCostEstimation calls are not allowed. - `noExchangeDefault` is true, so that exchange must be selected by the user - order will be canceled after 3 seconds - ISIN US98980L1017 (Zoom) - only market orders (both buy and sell) are suppored on one exchange - orders are executed immediately at a random quote - order creation requires the user to accept a hint (i.e. first try will result in a `MUST_ACCEPT_HINT` error) - default validity is set to `GTD` with a date of `2030-01-01` - ISIN US29786A1060 (Etsy) - the prepareTrade request takes 5 seconds - create challenge takes 5 seconds. for authMethod photoTAN, the challenge will return with an error after that period of time - only quote and market orders allowed - at exchange \"Slow exchange\" it takes 7 seconds to get a quote as well as 7 seconds to retrieve order costs - at exchange \"Exchange with quote and cost errors\" the quote request as well as cost estimation will end with an error after 3 seconds - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN XS2149280948 (bond from Bertelsmann) - quote, limit and market orders (both buy and sell) are supported on one exchange - limit orders are executed at exactly the limit price - market orders are executed at a random quote between 90 and 150 percent - for market orders, there is a legal message to confirm set (`legalMessagesToConfirmByOrderModel`) - ISIN US64110L1061 (Netflix Inc.) - one exchange with only quote order - creating the quote order will return an error (quote expired) - ISIN US67066G1040 (NVIDIA) - one exchange with only quote order, allowsQuoteModeLimit=true - quote orders are executed immediately. - if a quoteLimit is provided, execution happen at quoteLimit value - otherwise, a random execution quote will be used - ISIN DE000BAY0017 (Bayer AG) - one exchange with only market order - `costEstimationIsNotAvailable` is true, so no cost estimations should be linked/shown - orders will be canceled after 3 seconds - ISIN DE000PAH0038 (Porsche) - one exchange with only market order - all orders will be canceled - `GetCostEstimation` contains (only) a link to a PDF document. This can be used to test whether linking to a PDF works. - the instrument has both a `riskClassInfo.legalHint` as well as a `strikingHint`. Both should be visible in the order form. - ISIN DE0008404005 (Allianz) and some other hidden ISINs (can be requested from brokerize support) - one exchange with all available orderModels - orders are executed immediately - limit orders are executed at exactly the provided limit price - ISIN DE0008430026 (Munich Re) - one exchange (L&S) with all available orderModels - orders are executed immediately - ISIN FR0000120321 (L\'Oréal) - one exchange with all available orderModels - the exchange has a `securityQuotesToken` set - orders stay open - changesHaveCostEstimations is `true` for orders with this ISIN - ISIN US5949181045 (Microsoft) - one exchange with all available orderModels - if size is even, a partial execution with size 1 is executed, the remaining part stays open - if size is odd, a partial execution with size 1 is executed, the remaining part is canceled - ISIN US30303M1027 (Meta) - one exchange with all available orderModels - for each piece of the order size, there will be one execution with size 1 (so e.g. 10 executions for size 10) - sizes > 30 are not accepted - ISIN US2546871060 (Disney) - one exchange with all available orderModels - all orders are canceled after 3s - `costEstimationMustBeShown` is false and `costEstimationIsOnlyDetailedTable` is true (frontends must only show a link to the cost estimation table) - ISIN XX1234567890 (example of an ISIN that can never be mapped by frontends) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007100000 (Mercedes-Benz) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007472060 (Wirecard) - test instrument for `empty orderModelsBuy` / `onlySellAllowed` - ISIN BTC (Bitcoin/Euro) - has one exchange with support for quote, market and limit orders - orders will be executed right away (with the exception of limit orders with the limit 42. Those stay open!) - can be used to test frontend mapping of cryptos - when you prepare a trade in the *second* portfolio (which has two cash accounts), `sizeUnitsByCashAccountId` will be set, so that the frontend can let the user select a combination of `cashAccount` and `sizeUnit`. - positions of BTC/EUR will always have sizeDecimals=8 - ISIN DE0006231004 (Infineon Technologies AG) - one exchange with `orderModelsSell=[\'market\']` and `orderModelsBuy=[]` - ISIN DE0005552004 (Deutsche Post AG) - one exchange with `orderModelsSell=[]` and `orderModelsBuy=[\'market\']` - market buy orders are executed immediately - positions of DE0005552004 will always have sizeDecimals=undefined - ISIN US8740541094 (Take Two) - three exchanges are available. all have `market` and `limit` available - configuration for `takeProfitStopLoss` is different for the three exchanges. This can be used to test the implementation of takeProfit/stopLoss creation. - exchange_with_exclusive_tp_sl: `takeProfitStopLoss.exclusive` is `true`, so that only one of the two can be set. Also, both fields are limited to market buy orders - exchange_with_unlimited_tp_sl: `takeProfitStopLoss.exclusive` is `false`, so that both tp and sl may be set, for both sell and buy orders and both support orderModels - exchange_without_tp_sl: `takeProfitStopLoss` is not set, so that no tp/sl can be set - orders stay open forever - the order size can be changed (`allowsChangeSize=true`) - ISIN US5529531015 (MGM Resorts International) - one exchange with market and limit orders - orders are executed immediately - short selling is allowed, so `availableOrderIntents` as well as `availableOrderIntentsToken` is set. \"sell to open\" and \"buy to close\" can be tested here. - ISIN XAU (Gold) - only quote trading is allowed - depending on the selected portfolio, it is possible to select a cash account (e.g. EUR or USD) to trade with - users can chose between specifying the order size in the cash currency or in grams - quotes have the `totalAmount` field set - ISIN US88160R1014 (Tesla) - market, limit, stop buy trading is allowed - `GetCostEstimation` returns order fees - orders will be executed - order fees are saved for the order and returned in the order receipt - `CryptoPair` ADA-USD (Cardano - US Dollar) - `quote`, `market`, `limit` order models are available - One of the created demobroker portfolios does not have an USD cash account. For this portfolio an error will appear upon opening the order form - users can chose between specifying the order size in the cash currency (USD) or in ADA - validity types for limit orders are [`IOC`, `GTDT`]. With `GTDT` the user can specify a date AND time at which his order should be executed - the size input decimal places are limited per sizeUnit. For USD it\'s 2 and for ADA it is 4 decimal places - the orders will be executed after 10 seconds - all other orders will be canceled after 3 seconds When orders are created using a `decoupled` method, the order id is only returned if the order size is greater than `5`. This can be used to test if the order receipt is skipped correctly in UIs. Cost estimations for `buy` and `sell` return a different set of fields. This can be used to test proper UI behavior when fields are set or unavailable. Behavior of `PortfolioQuotes` in the demo broker: - portfolio 1 starts with 100.000€ cash. portfolio 2 has two cash accounts, one starts with 100.000€, one with 100.000$. - when cash account values are summed up, we just assume an exchange rate of 1:1 - each open buy order reserves 10€ cash from the availableCash - profit loss of the portfolio is the sum of the position\'s profit loss - if a EUR cashAccount has the value 0,00€, its `hideInOverviews` property is set to true. This can be used to test the frontend\'s behavior when a cash account is hidden.
31
+ * Create an account at the demo broker for the logged-in user. The account will have a default set of two empty portfolios by default. If the setting `isSinglePortfolio` is set, only one portfolio is created. The account as well as the two portfolios have a randomly generated name. To log into an account, use the account\'s generated name as username (Account name) in `AddSession`. - with the password `42`, the login will succeed immediately - with the password `1337`, a challenge with type text will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - with the password `7`, a challenge with type base64png will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - other passwords will not allow to log in The demo broker implements the following pre-defined trade behaviors, so that different flows can be tested: - ISIN US0378331005 (Apple): - market buy order is executed after 10 seconds by the backend at a random quote - stop buy or stop loss order stays open forever (can be used for testing cancellation) - cost estimations contain a `costDetailsLink` and a `costAcceptancePrompt` - securityDetailedInfo is set, so a \"KID\" link should be displayed and linked to the corresponding table - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN LU0378438732 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - orders are rejected with code `ORDER_REJECTED` immediately - ISIN LU2611732046 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - two exchanges are available (\"xetra\" and \"quoteExchange\") - xetra allows market and limit orders for buying and has defaultValidityByOrderModel set to GFD for market and GTD 2030-01-01 for limit - orders are rejected with code `ORDER_REJECTED` immediately - ISIN DE000MD96WE8 (a knock out with DAX as underlying) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN DE000DTR0CK8 (Daimler Truck Holding) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN US4180561072 (Hasbro) - only quote orders on one exchange are supported - the quotes are valid for 45 seconds - quote value is always `42` - the order gets executed immediately - ISIN DE0005557508 (Deutsche Telekom) - only quote orders on two different exchanges are supported - the quotes do *NOT* have an expiration - quote value is always `42` - quote comes together with a costEstimation. Subsequent getCostEstimation calls are not allowed. - `noExchangeDefault` is true, so that exchange must be selected by the user - order will be canceled after 3 seconds - ISIN US98980L1017 (Zoom) - only market orders (both buy and sell) are suppored on one exchange - orders are executed immediately at a random quote - order creation requires the user to accept a hint (i.e. first try will result in a `MUST_ACCEPT_HINT` error) - default validity is set to `GTD` with a date of `2030-01-01` - ISIN US29786A1060 (Etsy) - the prepareTrade request takes 5 seconds - create challenge takes 5 seconds. for authMethod photoTAN, the challenge will return with an error after that period of time - only quote and market orders allowed - at exchange \"Slow exchange\" it takes 7 seconds to get a quote as well as 7 seconds to retrieve order costs - at exchange \"Exchange with quote and cost errors\" the quote request as well as cost estimation will end with an error after 3 seconds - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN XS2149280948 (bond from Bertelsmann) - quote, limit and market orders (both buy and sell) are supported on one exchange - limit orders are executed at exactly the limit price - market orders are executed at a random quote between 90 and 150 percent - for market orders, there is a legal message to confirm set (`legalMessagesToConfirmByOrderModel`) - ISIN US64110L1061 (Netflix Inc.) - one exchange with only quote order - creating the quote order will return an error (quote expired) - ISIN US67066G1040 (NVIDIA) - one exchange with only quote order, allowsQuoteModeLimit=true - quote orders are executed immediately. - if a quoteLimit is provided, execution happen at quoteLimit value - otherwise, a random execution quote will be used - ISIN DE000BAY0017 (Bayer AG) - one exchange with only market order - `costEstimationIsNotAvailable` is true, so no cost estimations should be linked/shown - orders will be canceled after 3 seconds - ISIN DE000PAH0038 (Porsche) - one exchange with only market order - all orders will be canceled - `GetCostEstimation` contains (only) a link to a PDF document. This can be used to test whether linking to a PDF works. - the instrument has both a `riskClassInfo.legalHint` as well as a `strikingHint`. Both should be visible in the order form. - ISIN DE0008404005 (Allianz) and some other hidden ISINs (can be requested from brokerize support) - one exchange with all available orderModels - orders are executed immediately - limit orders are executed at exactly the provided limit price - ISIN DE0008430026 (Munich Re) - one exchange (L&S) with all available orderModels - orders are executed immediately - ISIN FR0000120321 (L\'Oréal) - one exchange with all available orderModels - the exchange has a `securityQuotesToken` set - orders stay open - changesHaveCostEstimations is `true` for orders with this ISIN - ISIN US5949181045 (Microsoft) - one exchange with all available orderModels - if size is even, a partial execution with size 1 is executed, the remaining part stays open - if size is odd, a partial execution with size 1 is executed, the remaining part is canceled - ISIN US30303M1027 (Meta) - one exchange with all available orderModels - for each piece of the order size, there will be one execution with size 1 (so e.g. 10 executions for size 10) - sizes > 30 are not accepted - ISIN US2546871060 (Disney) - one exchange with all available orderModels - all orders are canceled after 3s - `costEstimationMustBeShown` is false and `costEstimationIsOnlyDetailedTable` is true (frontends must only show a link to the cost estimation table) - ISIN XX1234567890 (example of an ISIN that can never be mapped by frontends) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007100000 (Mercedes-Benz) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007472060 (Wirecard) - test instrument for `empty orderModelsBuy` / `onlySellAllowed` - ISIN BTC (Bitcoin/Euro) - has one exchange with support for quote, market and limit orders - orders will be executed right away (with the exception of limit orders with the limit 42. Those stay open!) - can be used to test frontend mapping of cryptos - when you prepare a trade in the *second* portfolio (which has two cash accounts), `sizeUnitsByCashAccountId` will be set, so that the frontend can let the user select a combination of `cashAccount` and `sizeUnit`. - positions of BTC/EUR will always have sizeDecimals=8 - ISIN DE0006231004 (Infineon Technologies AG) - one exchange with `orderModelsSell=[\'market\']` and `orderModelsBuy=[]` - ISIN DE0005552004 (Deutsche Post AG) - one exchange with `orderModelsSell=[]` and `orderModelsBuy=[\'market\']` - market buy orders are executed immediately - positions of DE0005552004 will always have sizeDecimals=undefined - ISIN US8740541094 (Take Two) - three exchanges are available. all have `market` and `limit` available - configuration for `takeProfitStopLoss` is different for the three exchanges. This can be used to test the implementation of takeProfit/stopLoss creation. - exchange_with_exclusive_tp_sl: `takeProfitStopLoss.exclusive` is `true`, so that only one of the two can be set. Also, both fields are limited to market buy orders - exchange_with_unlimited_tp_sl: `takeProfitStopLoss.exclusive` is `false`, so that both tp and sl may be set, for both sell and buy orders and both support orderModels - exchange_without_tp_sl: `takeProfitStopLoss` is not set, so that no tp/sl can be set - orders stay open forever - the order size can be changed (`allowsChangeSize=true`) - ISIN US5529531015 (MGM Resorts International) - one exchange with market and limit orders - orders are executed immediately - short selling is allowed, so `availableOrderIntents` as well as `availableOrderIntentsToken` is set. \"sell to open\" and \"buy to close\" can be tested here. - ISIN XAU (Gold) - only quote trading is allowed - depending on the selected portfolio, it is possible to select a cash account (e.g. EUR or USD) to trade with - users can chose between specifying the order size in the cash currency or in grams - quotes have the `totalAmount` field set - ISIN US88160R1014 (Tesla) - market, limit, stop buy trading is allowed - `GetCostEstimation` returns order fees - orders will be executed - order fees are saved for the order and returned in the order receipt - `CryptoPair` ADA-USD (Cardano - US Dollar) - `quote`, `market`, `limit` order models are available - One of the created demobroker portfolios does not have an USD cash account. For this portfolio an error will appear upon opening the order form - users can chose between specifying the order size in the cash currency (USD) or in ADA - validity types for limit orders are [`IOC`, `GTDT`]. With `GTDT` the user can specify a date AND time at which his order should be executed - the size input decimal places are limited per sizeUnit. For USD it\'s 2 and for ADA it is 4 decimal places - the orders will be executed after 10 seconds - ISIN US23804L1035 (Datadog Inc.) - only quote orders are available - in 80% of `CreateTrade` calls, a 400 error with the code `QUOTE_REJECTED_RETRYABLE` is returned. This can be used to test UIs which automatically retry `GetQuote` in this case. - all other orders will be canceled after 3 seconds When orders are created using a `decoupled` method, the order id is only returned if the order size is greater than `5`. This can be used to test if the order receipt is skipped correctly in UIs. Cost estimations for `buy` and `sell` return a different set of fields. This can be used to test proper UI behavior when fields are set or unavailable. Behavior of `PortfolioQuotes` in the demo broker: - portfolio 1 starts with 100.000€ cash. portfolio 2 has two cash accounts, one starts with 100.000€, one with 100.000$. - when cash account values are summed up, we just assume an exchange rate of 1:1 - each open buy order reserves 10€ cash from the availableCash - profit loss of the portfolio is the sum of the position\'s profit loss - if a EUR cashAccount has the value 0,00€, its `hideInOverviews` property is set to true. This can be used to test the frontend\'s behavior when a cash account is hidden.
32
32
  */
33
33
  createDemoAccount(requestParameters?: CreateDemoAccountRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<CreatedResponseBody>;
34
34
  /**
@@ -17,7 +17,7 @@ import { CreatedResponseBodyFromJSON, DemoAccountSettingsToJSON, DemoAccountsRes
17
17
  */
18
18
  export class DemobrokerApi extends runtime.BaseAPI {
19
19
  /**
20
- * Create an account at the demo broker for the logged-in user. The account will have a default set of two empty portfolios by default. If the setting `isSinglePortfolio` is set, only one portfolio is created. The account as well as the two portfolios have a randomly generated name. To log into an account, use the account\'s generated name as username (Account name) in `AddSession`. - with the password `42`, the login will succeed immediately - with the password `1337`, a challenge with type text will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - with the password `7`, a challenge with type base64png will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - other passwords will not allow to log in The demo broker implements the following pre-defined trade behaviors, so that different flows can be tested: - ISIN US0378331005 (Apple): - market buy order is executed after 10 seconds by the backend at a random quote - stop buy or stop loss order stays open forever (can be used for testing cancellation) - cost estimations contain a `costDetailsLink` and a `costAcceptancePrompt` - securityDetailedInfo is set, so a \"KID\" link should be displayed and linked to the corresponding table - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN LU0378438732 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - orders are rejected with code `ORDER_REJECTED` immediately - ISIN LU2611732046 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - two exchanges are available (\"xetra\" and \"quoteExchange\") - xetra allows market and limit orders for buying and has defaultValidityByOrderModel set to GFD for market and GTD 2030-01-01 for limit - orders are rejected with code `ORDER_REJECTED` immediately - ISIN DE000MD96WE8 (a knock out with DAX as underlying) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN DE000DTR0CK8 (Daimler Truck Holding) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN US4180561072 (Hasbro) - only quote orders on one exchange are supported - the quotes are valid for 45 seconds - quote value is always `42` - the order gets executed immediately - ISIN DE0005557508 (Deutsche Telekom) - only quote orders on two different exchanges are supported - the quotes do *NOT* have an expiration - quote value is always `42` - quote comes together with a costEstimation. Subsequent getCostEstimation calls are not allowed. - `noExchangeDefault` is true, so that exchange must be selected by the user - order will be canceled after 3 seconds - ISIN US98980L1017 (Zoom) - only market orders (both buy and sell) are suppored on one exchange - orders are executed immediately at a random quote - order creation requires the user to accept a hint (i.e. first try will result in a `MUST_ACCEPT_HINT` error) - default validity is set to `GTD` with a date of `2030-01-01` - ISIN US29786A1060 (Etsy) - the prepareTrade request takes 5 seconds - create challenge takes 5 seconds. for authMethod photoTAN, the challenge will return with an error after that period of time - only quote and market orders allowed - at exchange \"Slow exchange\" it takes 7 seconds to get a quote as well as 7 seconds to retrieve order costs - at exchange \"Exchange with quote and cost errors\" the quote request as well as cost estimation will end with an error after 3 seconds - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN XS2149280948 (bond from Bertelsmann) - quote, limit and market orders (both buy and sell) are supported on one exchange - limit orders are executed at exactly the limit price - market orders are executed at a random quote between 90 and 150 percent - for market orders, there is a legal message to confirm set (`legalMessagesToConfirmByOrderModel`) - ISIN US64110L1061 (Netflix Inc.) - one exchange with only quote order - creating the quote order will return an error (quote expired) - ISIN US67066G1040 (NVIDIA) - one exchange with only quote order, allowsQuoteModeLimit=true - quote orders are executed immediately. - if a quoteLimit is provided, execution happen at quoteLimit value - otherwise, a random execution quote will be used - ISIN DE000BAY0017 (Bayer AG) - one exchange with only market order - `costEstimationIsNotAvailable` is true, so no cost estimations should be linked/shown - orders will be canceled after 3 seconds - ISIN DE000PAH0038 (Porsche) - one exchange with only market order - all orders will be canceled - `GetCostEstimation` contains (only) a link to a PDF document. This can be used to test whether linking to a PDF works. - the instrument has both a `riskClassInfo.legalHint` as well as a `strikingHint`. Both should be visible in the order form. - ISIN DE0008404005 (Allianz) and some other hidden ISINs (can be requested from brokerize support) - one exchange with all available orderModels - orders are executed immediately - limit orders are executed at exactly the provided limit price - ISIN DE0008430026 (Munich Re) - one exchange (L&S) with all available orderModels - orders are executed immediately - ISIN FR0000120321 (L\'Oréal) - one exchange with all available orderModels - the exchange has a `securityQuotesToken` set - orders stay open - changesHaveCostEstimations is `true` for orders with this ISIN - ISIN US5949181045 (Microsoft) - one exchange with all available orderModels - if size is even, a partial execution with size 1 is executed, the remaining part stays open - if size is odd, a partial execution with size 1 is executed, the remaining part is canceled - ISIN US30303M1027 (Meta) - one exchange with all available orderModels - for each piece of the order size, there will be one execution with size 1 (so e.g. 10 executions for size 10) - sizes > 30 are not accepted - ISIN US2546871060 (Disney) - one exchange with all available orderModels - all orders are canceled after 3s - `costEstimationMustBeShown` is false and `costEstimationIsOnlyDetailedTable` is true (frontends must only show a link to the cost estimation table) - ISIN XX1234567890 (example of an ISIN that can never be mapped by frontends) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007100000 (Mercedes-Benz) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007472060 (Wirecard) - test instrument for `empty orderModelsBuy` / `onlySellAllowed` - ISIN BTC (Bitcoin/Euro) - has one exchange with support for quote, market and limit orders - orders will be executed right away (with the exception of limit orders with the limit 42. Those stay open!) - can be used to test frontend mapping of cryptos - when you prepare a trade in the *second* portfolio (which has two cash accounts), `sizeUnitsByCashAccountId` will be set, so that the frontend can let the user select a combination of `cashAccount` and `sizeUnit`. - positions of BTC/EUR will always have sizeDecimals=8 - ISIN DE0006231004 (Infineon Technologies AG) - one exchange with `orderModelsSell=[\'market\']` and `orderModelsBuy=[]` - ISIN DE0005552004 (Deutsche Post AG) - one exchange with `orderModelsSell=[]` and `orderModelsBuy=[\'market\']` - market buy orders are executed immediately - positions of DE0005552004 will always have sizeDecimals=undefined - ISIN US8740541094 (Take Two) - three exchanges are available. all have `market` and `limit` available - configuration for `takeProfitStopLoss` is different for the three exchanges. This can be used to test the implementation of takeProfit/stopLoss creation. - exchange_with_exclusive_tp_sl: `takeProfitStopLoss.exclusive` is `true`, so that only one of the two can be set. Also, both fields are limited to market buy orders - exchange_with_unlimited_tp_sl: `takeProfitStopLoss.exclusive` is `false`, so that both tp and sl may be set, for both sell and buy orders and both support orderModels - exchange_without_tp_sl: `takeProfitStopLoss` is not set, so that no tp/sl can be set - orders stay open forever - the order size can be changed (`allowsChangeSize=true`) - ISIN US5529531015 (MGM Resorts International) - one exchange with market and limit orders - orders are executed immediately - short selling is allowed, so `availableOrderIntents` as well as `availableOrderIntentsToken` is set. \"sell to open\" and \"buy to close\" can be tested here. - ISIN XAU (Gold) - only quote trading is allowed - depending on the selected portfolio, it is possible to select a cash account (e.g. EUR or USD) to trade with - users can chose between specifying the order size in the cash currency or in grams - quotes have the `totalAmount` field set - ISIN US88160R1014 (Tesla) - market, limit, stop buy trading is allowed - `GetCostEstimation` returns order fees - orders will be executed - order fees are saved for the order and returned in the order receipt - `CryptoPair` ADA-USD (Cardano - US Dollar) - `quote`, `market`, `limit` order models are available - One of the created demobroker portfolios does not have an USD cash account. For this portfolio an error will appear upon opening the order form - users can chose between specifying the order size in the cash currency (USD) or in ADA - validity types for limit orders are [`IOC`, `GTDT`]. With `GTDT` the user can specify a date AND time at which his order should be executed - the size input decimal places are limited per sizeUnit. For USD it\'s 2 and for ADA it is 4 decimal places - the orders will be executed after 10 seconds - all other orders will be canceled after 3 seconds When orders are created using a `decoupled` method, the order id is only returned if the order size is greater than `5`. This can be used to test if the order receipt is skipped correctly in UIs. Cost estimations for `buy` and `sell` return a different set of fields. This can be used to test proper UI behavior when fields are set or unavailable. Behavior of `PortfolioQuotes` in the demo broker: - portfolio 1 starts with 100.000€ cash. portfolio 2 has two cash accounts, one starts with 100.000€, one with 100.000$. - when cash account values are summed up, we just assume an exchange rate of 1:1 - each open buy order reserves 10€ cash from the availableCash - profit loss of the portfolio is the sum of the position\'s profit loss - if a EUR cashAccount has the value 0,00€, its `hideInOverviews` property is set to true. This can be used to test the frontend\'s behavior when a cash account is hidden.
20
+ * Create an account at the demo broker for the logged-in user. The account will have a default set of two empty portfolios by default. If the setting `isSinglePortfolio` is set, only one portfolio is created. The account as well as the two portfolios have a randomly generated name. To log into an account, use the account\'s generated name as username (Account name) in `AddSession`. - with the password `42`, the login will succeed immediately - with the password `1337`, a challenge with type text will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - with the password `7`, a challenge with type base64png will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - other passwords will not allow to log in The demo broker implements the following pre-defined trade behaviors, so that different flows can be tested: - ISIN US0378331005 (Apple): - market buy order is executed after 10 seconds by the backend at a random quote - stop buy or stop loss order stays open forever (can be used for testing cancellation) - cost estimations contain a `costDetailsLink` and a `costAcceptancePrompt` - securityDetailedInfo is set, so a \"KID\" link should be displayed and linked to the corresponding table - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN LU0378438732 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - orders are rejected with code `ORDER_REJECTED` immediately - ISIN LU2611732046 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - two exchanges are available (\"xetra\" and \"quoteExchange\") - xetra allows market and limit orders for buying and has defaultValidityByOrderModel set to GFD for market and GTD 2030-01-01 for limit - orders are rejected with code `ORDER_REJECTED` immediately - ISIN DE000MD96WE8 (a knock out with DAX as underlying) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN DE000DTR0CK8 (Daimler Truck Holding) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN US4180561072 (Hasbro) - only quote orders on one exchange are supported - the quotes are valid for 45 seconds - quote value is always `42` - the order gets executed immediately - ISIN DE0005557508 (Deutsche Telekom) - only quote orders on two different exchanges are supported - the quotes do *NOT* have an expiration - quote value is always `42` - quote comes together with a costEstimation. Subsequent getCostEstimation calls are not allowed. - `noExchangeDefault` is true, so that exchange must be selected by the user - order will be canceled after 3 seconds - ISIN US98980L1017 (Zoom) - only market orders (both buy and sell) are suppored on one exchange - orders are executed immediately at a random quote - order creation requires the user to accept a hint (i.e. first try will result in a `MUST_ACCEPT_HINT` error) - default validity is set to `GTD` with a date of `2030-01-01` - ISIN US29786A1060 (Etsy) - the prepareTrade request takes 5 seconds - create challenge takes 5 seconds. for authMethod photoTAN, the challenge will return with an error after that period of time - only quote and market orders allowed - at exchange \"Slow exchange\" it takes 7 seconds to get a quote as well as 7 seconds to retrieve order costs - at exchange \"Exchange with quote and cost errors\" the quote request as well as cost estimation will end with an error after 3 seconds - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN XS2149280948 (bond from Bertelsmann) - quote, limit and market orders (both buy and sell) are supported on one exchange - limit orders are executed at exactly the limit price - market orders are executed at a random quote between 90 and 150 percent - for market orders, there is a legal message to confirm set (`legalMessagesToConfirmByOrderModel`) - ISIN US64110L1061 (Netflix Inc.) - one exchange with only quote order - creating the quote order will return an error (quote expired) - ISIN US67066G1040 (NVIDIA) - one exchange with only quote order, allowsQuoteModeLimit=true - quote orders are executed immediately. - if a quoteLimit is provided, execution happen at quoteLimit value - otherwise, a random execution quote will be used - ISIN DE000BAY0017 (Bayer AG) - one exchange with only market order - `costEstimationIsNotAvailable` is true, so no cost estimations should be linked/shown - orders will be canceled after 3 seconds - ISIN DE000PAH0038 (Porsche) - one exchange with only market order - all orders will be canceled - `GetCostEstimation` contains (only) a link to a PDF document. This can be used to test whether linking to a PDF works. - the instrument has both a `riskClassInfo.legalHint` as well as a `strikingHint`. Both should be visible in the order form. - ISIN DE0008404005 (Allianz) and some other hidden ISINs (can be requested from brokerize support) - one exchange with all available orderModels - orders are executed immediately - limit orders are executed at exactly the provided limit price - ISIN DE0008430026 (Munich Re) - one exchange (L&S) with all available orderModels - orders are executed immediately - ISIN FR0000120321 (L\'Oréal) - one exchange with all available orderModels - the exchange has a `securityQuotesToken` set - orders stay open - changesHaveCostEstimations is `true` for orders with this ISIN - ISIN US5949181045 (Microsoft) - one exchange with all available orderModels - if size is even, a partial execution with size 1 is executed, the remaining part stays open - if size is odd, a partial execution with size 1 is executed, the remaining part is canceled - ISIN US30303M1027 (Meta) - one exchange with all available orderModels - for each piece of the order size, there will be one execution with size 1 (so e.g. 10 executions for size 10) - sizes > 30 are not accepted - ISIN US2546871060 (Disney) - one exchange with all available orderModels - all orders are canceled after 3s - `costEstimationMustBeShown` is false and `costEstimationIsOnlyDetailedTable` is true (frontends must only show a link to the cost estimation table) - ISIN XX1234567890 (example of an ISIN that can never be mapped by frontends) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007100000 (Mercedes-Benz) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007472060 (Wirecard) - test instrument for `empty orderModelsBuy` / `onlySellAllowed` - ISIN BTC (Bitcoin/Euro) - has one exchange with support for quote, market and limit orders - orders will be executed right away (with the exception of limit orders with the limit 42. Those stay open!) - can be used to test frontend mapping of cryptos - when you prepare a trade in the *second* portfolio (which has two cash accounts), `sizeUnitsByCashAccountId` will be set, so that the frontend can let the user select a combination of `cashAccount` and `sizeUnit`. - positions of BTC/EUR will always have sizeDecimals=8 - ISIN DE0006231004 (Infineon Technologies AG) - one exchange with `orderModelsSell=[\'market\']` and `orderModelsBuy=[]` - ISIN DE0005552004 (Deutsche Post AG) - one exchange with `orderModelsSell=[]` and `orderModelsBuy=[\'market\']` - market buy orders are executed immediately - positions of DE0005552004 will always have sizeDecimals=undefined - ISIN US8740541094 (Take Two) - three exchanges are available. all have `market` and `limit` available - configuration for `takeProfitStopLoss` is different for the three exchanges. This can be used to test the implementation of takeProfit/stopLoss creation. - exchange_with_exclusive_tp_sl: `takeProfitStopLoss.exclusive` is `true`, so that only one of the two can be set. Also, both fields are limited to market buy orders - exchange_with_unlimited_tp_sl: `takeProfitStopLoss.exclusive` is `false`, so that both tp and sl may be set, for both sell and buy orders and both support orderModels - exchange_without_tp_sl: `takeProfitStopLoss` is not set, so that no tp/sl can be set - orders stay open forever - the order size can be changed (`allowsChangeSize=true`) - ISIN US5529531015 (MGM Resorts International) - one exchange with market and limit orders - orders are executed immediately - short selling is allowed, so `availableOrderIntents` as well as `availableOrderIntentsToken` is set. \"sell to open\" and \"buy to close\" can be tested here. - ISIN XAU (Gold) - only quote trading is allowed - depending on the selected portfolio, it is possible to select a cash account (e.g. EUR or USD) to trade with - users can chose between specifying the order size in the cash currency or in grams - quotes have the `totalAmount` field set - ISIN US88160R1014 (Tesla) - market, limit, stop buy trading is allowed - `GetCostEstimation` returns order fees - orders will be executed - order fees are saved for the order and returned in the order receipt - `CryptoPair` ADA-USD (Cardano - US Dollar) - `quote`, `market`, `limit` order models are available - One of the created demobroker portfolios does not have an USD cash account. For this portfolio an error will appear upon opening the order form - users can chose between specifying the order size in the cash currency (USD) or in ADA - validity types for limit orders are [`IOC`, `GTDT`]. With `GTDT` the user can specify a date AND time at which his order should be executed - the size input decimal places are limited per sizeUnit. For USD it\'s 2 and for ADA it is 4 decimal places - the orders will be executed after 10 seconds - ISIN US23804L1035 (Datadog Inc.) - only quote orders are available - in 80% of `CreateTrade` calls, a 400 error with the code `QUOTE_REJECTED_RETRYABLE` is returned. This can be used to test UIs which automatically retry `GetQuote` in this case. - all other orders will be canceled after 3 seconds When orders are created using a `decoupled` method, the order id is only returned if the order size is greater than `5`. This can be used to test if the order receipt is skipped correctly in UIs. Cost estimations for `buy` and `sell` return a different set of fields. This can be used to test proper UI behavior when fields are set or unavailable. Behavior of `PortfolioQuotes` in the demo broker: - portfolio 1 starts with 100.000€ cash. portfolio 2 has two cash accounts, one starts with 100.000€, one with 100.000$. - when cash account values are summed up, we just assume an exchange rate of 1:1 - each open buy order reserves 10€ cash from the availableCash - profit loss of the portfolio is the sum of the position\'s profit loss - if a EUR cashAccount has the value 0,00€, its `hideInOverviews` property is set to true. This can be used to test the frontend\'s behavior when a cash account is hidden.
21
21
  */
22
22
  async createDemoAccountRaw(requestParameters, initOverrides) {
23
23
  const queryParameters = {};
@@ -44,7 +44,7 @@ export class DemobrokerApi extends runtime.BaseAPI {
44
44
  return new runtime.JSONApiResponse(response, (jsonValue) => CreatedResponseBodyFromJSON(jsonValue));
45
45
  }
46
46
  /**
47
- * Create an account at the demo broker for the logged-in user. The account will have a default set of two empty portfolios by default. If the setting `isSinglePortfolio` is set, only one portfolio is created. The account as well as the two portfolios have a randomly generated name. To log into an account, use the account\'s generated name as username (Account name) in `AddSession`. - with the password `42`, the login will succeed immediately - with the password `1337`, a challenge with type text will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - with the password `7`, a challenge with type base64png will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - other passwords will not allow to log in The demo broker implements the following pre-defined trade behaviors, so that different flows can be tested: - ISIN US0378331005 (Apple): - market buy order is executed after 10 seconds by the backend at a random quote - stop buy or stop loss order stays open forever (can be used for testing cancellation) - cost estimations contain a `costDetailsLink` and a `costAcceptancePrompt` - securityDetailedInfo is set, so a \"KID\" link should be displayed and linked to the corresponding table - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN LU0378438732 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - orders are rejected with code `ORDER_REJECTED` immediately - ISIN LU2611732046 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - two exchanges are available (\"xetra\" and \"quoteExchange\") - xetra allows market and limit orders for buying and has defaultValidityByOrderModel set to GFD for market and GTD 2030-01-01 for limit - orders are rejected with code `ORDER_REJECTED` immediately - ISIN DE000MD96WE8 (a knock out with DAX as underlying) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN DE000DTR0CK8 (Daimler Truck Holding) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN US4180561072 (Hasbro) - only quote orders on one exchange are supported - the quotes are valid for 45 seconds - quote value is always `42` - the order gets executed immediately - ISIN DE0005557508 (Deutsche Telekom) - only quote orders on two different exchanges are supported - the quotes do *NOT* have an expiration - quote value is always `42` - quote comes together with a costEstimation. Subsequent getCostEstimation calls are not allowed. - `noExchangeDefault` is true, so that exchange must be selected by the user - order will be canceled after 3 seconds - ISIN US98980L1017 (Zoom) - only market orders (both buy and sell) are suppored on one exchange - orders are executed immediately at a random quote - order creation requires the user to accept a hint (i.e. first try will result in a `MUST_ACCEPT_HINT` error) - default validity is set to `GTD` with a date of `2030-01-01` - ISIN US29786A1060 (Etsy) - the prepareTrade request takes 5 seconds - create challenge takes 5 seconds. for authMethod photoTAN, the challenge will return with an error after that period of time - only quote and market orders allowed - at exchange \"Slow exchange\" it takes 7 seconds to get a quote as well as 7 seconds to retrieve order costs - at exchange \"Exchange with quote and cost errors\" the quote request as well as cost estimation will end with an error after 3 seconds - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN XS2149280948 (bond from Bertelsmann) - quote, limit and market orders (both buy and sell) are supported on one exchange - limit orders are executed at exactly the limit price - market orders are executed at a random quote between 90 and 150 percent - for market orders, there is a legal message to confirm set (`legalMessagesToConfirmByOrderModel`) - ISIN US64110L1061 (Netflix Inc.) - one exchange with only quote order - creating the quote order will return an error (quote expired) - ISIN US67066G1040 (NVIDIA) - one exchange with only quote order, allowsQuoteModeLimit=true - quote orders are executed immediately. - if a quoteLimit is provided, execution happen at quoteLimit value - otherwise, a random execution quote will be used - ISIN DE000BAY0017 (Bayer AG) - one exchange with only market order - `costEstimationIsNotAvailable` is true, so no cost estimations should be linked/shown - orders will be canceled after 3 seconds - ISIN DE000PAH0038 (Porsche) - one exchange with only market order - all orders will be canceled - `GetCostEstimation` contains (only) a link to a PDF document. This can be used to test whether linking to a PDF works. - the instrument has both a `riskClassInfo.legalHint` as well as a `strikingHint`. Both should be visible in the order form. - ISIN DE0008404005 (Allianz) and some other hidden ISINs (can be requested from brokerize support) - one exchange with all available orderModels - orders are executed immediately - limit orders are executed at exactly the provided limit price - ISIN DE0008430026 (Munich Re) - one exchange (L&S) with all available orderModels - orders are executed immediately - ISIN FR0000120321 (L\'Oréal) - one exchange with all available orderModels - the exchange has a `securityQuotesToken` set - orders stay open - changesHaveCostEstimations is `true` for orders with this ISIN - ISIN US5949181045 (Microsoft) - one exchange with all available orderModels - if size is even, a partial execution with size 1 is executed, the remaining part stays open - if size is odd, a partial execution with size 1 is executed, the remaining part is canceled - ISIN US30303M1027 (Meta) - one exchange with all available orderModels - for each piece of the order size, there will be one execution with size 1 (so e.g. 10 executions for size 10) - sizes > 30 are not accepted - ISIN US2546871060 (Disney) - one exchange with all available orderModels - all orders are canceled after 3s - `costEstimationMustBeShown` is false and `costEstimationIsOnlyDetailedTable` is true (frontends must only show a link to the cost estimation table) - ISIN XX1234567890 (example of an ISIN that can never be mapped by frontends) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007100000 (Mercedes-Benz) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007472060 (Wirecard) - test instrument for `empty orderModelsBuy` / `onlySellAllowed` - ISIN BTC (Bitcoin/Euro) - has one exchange with support for quote, market and limit orders - orders will be executed right away (with the exception of limit orders with the limit 42. Those stay open!) - can be used to test frontend mapping of cryptos - when you prepare a trade in the *second* portfolio (which has two cash accounts), `sizeUnitsByCashAccountId` will be set, so that the frontend can let the user select a combination of `cashAccount` and `sizeUnit`. - positions of BTC/EUR will always have sizeDecimals=8 - ISIN DE0006231004 (Infineon Technologies AG) - one exchange with `orderModelsSell=[\'market\']` and `orderModelsBuy=[]` - ISIN DE0005552004 (Deutsche Post AG) - one exchange with `orderModelsSell=[]` and `orderModelsBuy=[\'market\']` - market buy orders are executed immediately - positions of DE0005552004 will always have sizeDecimals=undefined - ISIN US8740541094 (Take Two) - three exchanges are available. all have `market` and `limit` available - configuration for `takeProfitStopLoss` is different for the three exchanges. This can be used to test the implementation of takeProfit/stopLoss creation. - exchange_with_exclusive_tp_sl: `takeProfitStopLoss.exclusive` is `true`, so that only one of the two can be set. Also, both fields are limited to market buy orders - exchange_with_unlimited_tp_sl: `takeProfitStopLoss.exclusive` is `false`, so that both tp and sl may be set, for both sell and buy orders and both support orderModels - exchange_without_tp_sl: `takeProfitStopLoss` is not set, so that no tp/sl can be set - orders stay open forever - the order size can be changed (`allowsChangeSize=true`) - ISIN US5529531015 (MGM Resorts International) - one exchange with market and limit orders - orders are executed immediately - short selling is allowed, so `availableOrderIntents` as well as `availableOrderIntentsToken` is set. \"sell to open\" and \"buy to close\" can be tested here. - ISIN XAU (Gold) - only quote trading is allowed - depending on the selected portfolio, it is possible to select a cash account (e.g. EUR or USD) to trade with - users can chose between specifying the order size in the cash currency or in grams - quotes have the `totalAmount` field set - ISIN US88160R1014 (Tesla) - market, limit, stop buy trading is allowed - `GetCostEstimation` returns order fees - orders will be executed - order fees are saved for the order and returned in the order receipt - `CryptoPair` ADA-USD (Cardano - US Dollar) - `quote`, `market`, `limit` order models are available - One of the created demobroker portfolios does not have an USD cash account. For this portfolio an error will appear upon opening the order form - users can chose between specifying the order size in the cash currency (USD) or in ADA - validity types for limit orders are [`IOC`, `GTDT`]. With `GTDT` the user can specify a date AND time at which his order should be executed - the size input decimal places are limited per sizeUnit. For USD it\'s 2 and for ADA it is 4 decimal places - the orders will be executed after 10 seconds - all other orders will be canceled after 3 seconds When orders are created using a `decoupled` method, the order id is only returned if the order size is greater than `5`. This can be used to test if the order receipt is skipped correctly in UIs. Cost estimations for `buy` and `sell` return a different set of fields. This can be used to test proper UI behavior when fields are set or unavailable. Behavior of `PortfolioQuotes` in the demo broker: - portfolio 1 starts with 100.000€ cash. portfolio 2 has two cash accounts, one starts with 100.000€, one with 100.000$. - when cash account values are summed up, we just assume an exchange rate of 1:1 - each open buy order reserves 10€ cash from the availableCash - profit loss of the portfolio is the sum of the position\'s profit loss - if a EUR cashAccount has the value 0,00€, its `hideInOverviews` property is set to true. This can be used to test the frontend\'s behavior when a cash account is hidden.
47
+ * Create an account at the demo broker for the logged-in user. The account will have a default set of two empty portfolios by default. If the setting `isSinglePortfolio` is set, only one portfolio is created. The account as well as the two portfolios have a randomly generated name. To log into an account, use the account\'s generated name as username (Account name) in `AddSession`. - with the password `42`, the login will succeed immediately - with the password `1337`, a challenge with type text will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - with the password `7`, a challenge with type base64png will be returned which must be completed by using `addSessionCompleteChallenge` (with a challengeResponse `42`) - other passwords will not allow to log in The demo broker implements the following pre-defined trade behaviors, so that different flows can be tested: - ISIN US0378331005 (Apple): - market buy order is executed after 10 seconds by the backend at a random quote - stop buy or stop loss order stays open forever (can be used for testing cancellation) - cost estimations contain a `costDetailsLink` and a `costAcceptancePrompt` - securityDetailedInfo is set, so a \"KID\" link should be displayed and linked to the corresponding table - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN LU0378438732 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - orders are rejected with code `ORDER_REJECTED` immediately - ISIN LU2611732046 (a DAX ETF) - preparedTrade has `costEstimationIsOnlyDetailedTable` set to true, so that deviating order form behaviors can be tested - two exchanges are available (\"xetra\" and \"quoteExchange\") - xetra allows market and limit orders for buying and has defaultValidityByOrderModel set to GFD for market and GTD 2030-01-01 for limit - orders are rejected with code `ORDER_REJECTED` immediately - ISIN DE000MD96WE8 (a knock out with DAX as underlying) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN DE000DTR0CK8 (Daimler Truck Holding) - prepareTrade is rejected with a message that the user may not trade risky derivatives. - ISIN US4180561072 (Hasbro) - only quote orders on one exchange are supported - the quotes are valid for 45 seconds - quote value is always `42` - the order gets executed immediately - ISIN DE0005557508 (Deutsche Telekom) - only quote orders on two different exchanges are supported - the quotes do *NOT* have an expiration - quote value is always `42` - quote comes together with a costEstimation. Subsequent getCostEstimation calls are not allowed. - `noExchangeDefault` is true, so that exchange must be selected by the user - order will be canceled after 3 seconds - ISIN US98980L1017 (Zoom) - only market orders (both buy and sell) are suppored on one exchange - orders are executed immediately at a random quote - order creation requires the user to accept a hint (i.e. first try will result in a `MUST_ACCEPT_HINT` error) - default validity is set to `GTD` with a date of `2030-01-01` - ISIN US29786A1060 (Etsy) - the prepareTrade request takes 5 seconds - create challenge takes 5 seconds. for authMethod photoTAN, the challenge will return with an error after that period of time - only quote and market orders allowed - at exchange \"Slow exchange\" it takes 7 seconds to get a quote as well as 7 seconds to retrieve order costs - at exchange \"Exchange with quote and cost errors\" the quote request as well as cost estimation will end with an error after 3 seconds - the preparedTrade\'s `costEstimationMustBeShown` is true, so that the correct behavior (users cannot skip cost estimation in that case) can be tested. - ISIN XS2149280948 (bond from Bertelsmann) - quote, limit and market orders (both buy and sell) are supported on one exchange - limit orders are executed at exactly the limit price - market orders are executed at a random quote between 90 and 150 percent - for market orders, there is a legal message to confirm set (`legalMessagesToConfirmByOrderModel`) - ISIN US64110L1061 (Netflix Inc.) - one exchange with only quote order - creating the quote order will return an error (quote expired) - ISIN US67066G1040 (NVIDIA) - one exchange with only quote order, allowsQuoteModeLimit=true - quote orders are executed immediately. - if a quoteLimit is provided, execution happen at quoteLimit value - otherwise, a random execution quote will be used - ISIN DE000BAY0017 (Bayer AG) - one exchange with only market order - `costEstimationIsNotAvailable` is true, so no cost estimations should be linked/shown - orders will be canceled after 3 seconds - ISIN DE000PAH0038 (Porsche) - one exchange with only market order - all orders will be canceled - `GetCostEstimation` contains (only) a link to a PDF document. This can be used to test whether linking to a PDF works. - the instrument has both a `riskClassInfo.legalHint` as well as a `strikingHint`. Both should be visible in the order form. - ISIN DE0008404005 (Allianz) and some other hidden ISINs (can be requested from brokerize support) - one exchange with all available orderModels - orders are executed immediately - limit orders are executed at exactly the provided limit price - ISIN DE0008430026 (Munich Re) - one exchange (L&S) with all available orderModels - orders are executed immediately - ISIN FR0000120321 (L\'Oréal) - one exchange with all available orderModels - the exchange has a `securityQuotesToken` set - orders stay open - changesHaveCostEstimations is `true` for orders with this ISIN - ISIN US5949181045 (Microsoft) - one exchange with all available orderModels - if size is even, a partial execution with size 1 is executed, the remaining part stays open - if size is odd, a partial execution with size 1 is executed, the remaining part is canceled - ISIN US30303M1027 (Meta) - one exchange with all available orderModels - for each piece of the order size, there will be one execution with size 1 (so e.g. 10 executions for size 10) - sizes > 30 are not accepted - ISIN US2546871060 (Disney) - one exchange with all available orderModels - all orders are canceled after 3s - `costEstimationMustBeShown` is false and `costEstimationIsOnlyDetailedTable` is true (frontends must only show a link to the cost estimation table) - ISIN XX1234567890 (example of an ISIN that can never be mapped by frontends) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007100000 (Mercedes-Benz) - one exchange with all available orderModels - the instrument has two sellPositions to choose from (\"Sell Position A\" and \"Sell Position B\"). If no correct sell position is provided, trades will be rejected. - orders are executed immediately - ISIN DE0007472060 (Wirecard) - test instrument for `empty orderModelsBuy` / `onlySellAllowed` - ISIN BTC (Bitcoin/Euro) - has one exchange with support for quote, market and limit orders - orders will be executed right away (with the exception of limit orders with the limit 42. Those stay open!) - can be used to test frontend mapping of cryptos - when you prepare a trade in the *second* portfolio (which has two cash accounts), `sizeUnitsByCashAccountId` will be set, so that the frontend can let the user select a combination of `cashAccount` and `sizeUnit`. - positions of BTC/EUR will always have sizeDecimals=8 - ISIN DE0006231004 (Infineon Technologies AG) - one exchange with `orderModelsSell=[\'market\']` and `orderModelsBuy=[]` - ISIN DE0005552004 (Deutsche Post AG) - one exchange with `orderModelsSell=[]` and `orderModelsBuy=[\'market\']` - market buy orders are executed immediately - positions of DE0005552004 will always have sizeDecimals=undefined - ISIN US8740541094 (Take Two) - three exchanges are available. all have `market` and `limit` available - configuration for `takeProfitStopLoss` is different for the three exchanges. This can be used to test the implementation of takeProfit/stopLoss creation. - exchange_with_exclusive_tp_sl: `takeProfitStopLoss.exclusive` is `true`, so that only one of the two can be set. Also, both fields are limited to market buy orders - exchange_with_unlimited_tp_sl: `takeProfitStopLoss.exclusive` is `false`, so that both tp and sl may be set, for both sell and buy orders and both support orderModels - exchange_without_tp_sl: `takeProfitStopLoss` is not set, so that no tp/sl can be set - orders stay open forever - the order size can be changed (`allowsChangeSize=true`) - ISIN US5529531015 (MGM Resorts International) - one exchange with market and limit orders - orders are executed immediately - short selling is allowed, so `availableOrderIntents` as well as `availableOrderIntentsToken` is set. \"sell to open\" and \"buy to close\" can be tested here. - ISIN XAU (Gold) - only quote trading is allowed - depending on the selected portfolio, it is possible to select a cash account (e.g. EUR or USD) to trade with - users can chose between specifying the order size in the cash currency or in grams - quotes have the `totalAmount` field set - ISIN US88160R1014 (Tesla) - market, limit, stop buy trading is allowed - `GetCostEstimation` returns order fees - orders will be executed - order fees are saved for the order and returned in the order receipt - `CryptoPair` ADA-USD (Cardano - US Dollar) - `quote`, `market`, `limit` order models are available - One of the created demobroker portfolios does not have an USD cash account. For this portfolio an error will appear upon opening the order form - users can chose between specifying the order size in the cash currency (USD) or in ADA - validity types for limit orders are [`IOC`, `GTDT`]. With `GTDT` the user can specify a date AND time at which his order should be executed - the size input decimal places are limited per sizeUnit. For USD it\'s 2 and for ADA it is 4 decimal places - the orders will be executed after 10 seconds - ISIN US23804L1035 (Datadog Inc.) - only quote orders are available - in 80% of `CreateTrade` calls, a 400 error with the code `QUOTE_REJECTED_RETRYABLE` is returned. This can be used to test UIs which automatically retry `GetQuote` in this case. - all other orders will be canceled after 3 seconds When orders are created using a `decoupled` method, the order id is only returned if the order size is greater than `5`. This can be used to test if the order receipt is skipped correctly in UIs. Cost estimations for `buy` and `sell` return a different set of fields. This can be used to test proper UI behavior when fields are set or unavailable. Behavior of `PortfolioQuotes` in the demo broker: - portfolio 1 starts with 100.000€ cash. portfolio 2 has two cash accounts, one starts with 100.000€, one with 100.000$. - when cash account values are summed up, we just assume an exchange rate of 1:1 - each open buy order reserves 10€ cash from the availableCash - profit loss of the portfolio is the sum of the position\'s profit loss - if a EUR cashAccount has the value 0,00€, its `hideInOverviews` property is set to true. This can be used to test the frontend\'s behavior when a cash account is hidden.
48
48
  */
49
49
  async createDemoAccount(requestParameters = {}, initOverrides) {
50
50
  const response = await this.createDemoAccountRaw(requestParameters, initOverrides);
@@ -128,6 +128,12 @@ export interface ClientConfig {
128
128
  * @memberof ClientConfig
129
129
  */
130
130
  page: any | null;
131
+ /**
132
+ * If true, users of this client cannot create or change trades.
133
+ * @type {boolean}
134
+ * @memberof ClientConfig
135
+ */
136
+ readonly?: boolean;
131
137
  /**
132
138
  * These flags are used in supporting the reporting logic
133
139
  * @type {Array<string>}
@@ -55,6 +55,7 @@ export function ClientConfigFromJSONTyped(json, ignoreDiscriminator) {
55
55
  oAuthReturnToRegularExpressions: json["oAuthReturnToRegularExpressions"],
56
56
  oAuthReturnToUrls: json["oAuthReturnToUrls"],
57
57
  page: json["page"],
58
+ readonly: !exists(json, "readonly") ? undefined : json["readonly"],
58
59
  reportingFlags: !exists(json, "reportingFlags")
59
60
  ? undefined
60
61
  : json["reportingFlags"],
@@ -91,6 +92,7 @@ export function ClientConfigToJSONRecursive(value, ignoreParent = false) {
91
92
  oAuthReturnToRegularExpressions: value.oAuthReturnToRegularExpressions,
92
93
  oAuthReturnToUrls: value.oAuthReturnToUrls,
93
94
  page: value.page,
95
+ readonly: value.readonly,
94
96
  reportingFlags: value.reportingFlags,
95
97
  tradingSessionInactivityTimeoutSeconds: value.tradingSessionInactivityTimeoutSeconds,
96
98
  tradingSessionLifetime: TradingSessionLifetimeToJSON(value.tradingSessionLifetime),
@@ -161,7 +161,13 @@ export interface ClientConfigUpdate {
161
161
  */
162
162
  rateLimitPointsToConsume?: ClientConfigUpdateRateLimitPointsToConsume;
163
163
  /**
164
- * These flags are used in supporting the reporting logic
164
+ * If true, users of this client cannot create or change trades.
165
+ * @type {boolean}
166
+ * @memberof ClientConfigUpdate
167
+ */
168
+ readonly?: boolean;
169
+ /**
170
+ * These flags are used in supporting the reporting logic.
165
171
  * @type {Array<string>}
166
172
  * @memberof ClientConfigUpdate
167
173
  */
@@ -89,6 +89,7 @@ export function ClientConfigUpdateFromJSONTyped(json, ignoreDiscriminator) {
89
89
  rateLimitPointsToConsume: !exists(json, "rateLimitPointsToConsume")
90
90
  ? undefined
91
91
  : ClientConfigUpdateRateLimitPointsToConsumeFromJSON(json["rateLimitPointsToConsume"]),
92
+ readonly: !exists(json, "readonly") ? undefined : json["readonly"],
92
93
  reportingFlags: !exists(json, "reportingFlags")
93
94
  ? undefined
94
95
  : json["reportingFlags"],
@@ -132,6 +133,7 @@ export function ClientConfigUpdateToJSONRecursive(value, ignoreParent = false) {
132
133
  optionalClientSecrets: value.optionalClientSecrets,
133
134
  page: ClientConfigUpdatePageToJSON(value.page),
134
135
  rateLimitPointsToConsume: ClientConfigUpdateRateLimitPointsToConsumeToJSON(value.rateLimitPointsToConsume),
136
+ readonly: value.readonly,
135
137
  reportingFlags: value.reportingFlags,
136
138
  tradingSessionInactivityTimeoutSeconds: value.tradingSessionInactivityTimeoutSeconds,
137
139
  tradingSessionLifetime: TradingSessionLifetimeToJSON(value.tradingSessionLifetime),
@@ -22,7 +22,7 @@ export interface ErrorResponse {
22
22
  * Currently the following codes are implemented:
23
23
  * 'TRADING_ERROR', 'AUTH', 'RATE_LIMITED', 'VALIDATION_FAILED', 'MUST_ACCEPT_HINT', 'NO_SESSION_AVAILABLE_FOR_PORTFOLIO',
24
24
  * 'SECURITY_NOT_FOUND', 'SECURITY_NOT_TRADABLE_AT_EXCHANGE', 'ORDER_REJECTED', 'INTERNAL_SERVER_ERROR', 'MAINTENANCE',
25
- * 'INTERNAL_SERVER_ERROR_BROKER_API' | 'NOT_FOUND'
25
+ * 'INTERNAL_SERVER_ERROR_BROKER_API' | 'NOT_FOUND' | 'QUOTE_REJECTED_RETRYABLE'
26
26
  * @type {string}
27
27
  * @memberof ErrorResponse
28
28
  */
@@ -1,4 +1,5 @@
1
1
  import { Auth } from "./apiCtx";
2
+ import { AuthorizedApiContext } from "./authorizedApiContext";
2
3
  import { WebSocket } from "./dependencyDefinitions/webSocket";
3
4
  import type { SubscribeDecoupledOperation, SubscribeInvalidateDetails } from "./websocketTypes";
4
5
  export declare class BrokerizeWebSocketClientImpl implements BrokerizeWebSocketClient {
@@ -16,6 +17,7 @@ export declare class BrokerizeWebSocketClientImpl implements BrokerizeWebSocketC
16
17
  private _fatalError;
17
18
  private _lastNonFatalError;
18
19
  private _errorCount;
20
+ private _apiCtx;
19
21
  constructor(websocketUrl: string, auth: Auth, createWebSocket: (url: string) => WebSocket);
20
22
  private _updateReconnectInterval;
21
23
  /**
@@ -27,7 +29,13 @@ export declare class BrokerizeWebSocketClientImpl implements BrokerizeWebSocketC
27
29
  subscribeInvalidate(subscribe: SubscribeInvalidateDetails, callback: Callback): Subscription;
28
30
  subscribeDecoupledOperation(subscribe: Pick<SubscribeDecoupledOperation, "sessionId" | "decoupledOperationId">, callback: Callback): Subscription;
29
31
  private _startSubscription;
32
+ private _fillInMessagesAfterConnectionInterruption;
30
33
  private _endSubscription;
34
+ /**
35
+ * Internal method for setting a related AuthorizedApiContext. This is used to retrieve
36
+ * decoupled operation status on interrupted connections.
37
+ */
38
+ _setAuthorizedApiContext(ctx: AuthorizedApiContext): void;
31
39
  _startOrStopDisconnectTimeout(): void;
32
40
  private _sendWs;
33
41
  private _connect;
@@ -8,6 +8,7 @@ export class BrokerizeWebSocketClientImpl {
8
8
  this._fatalError = null;
9
9
  this._lastNonFatalError = null;
10
10
  this._errorCount = 0;
11
+ this._apiCtx = null;
11
12
  this._url = websocketUrl;
12
13
  this._id = 0;
13
14
  this._socket = null;
@@ -26,7 +27,6 @@ export class BrokerizeWebSocketClientImpl {
26
27
  this._reconnectIntvl = setInterval(() => {
27
28
  if (!this._socket && this._shouldConnect()) {
28
29
  if (this._errorCount > 0) {
29
- // eslint-disable-next-line no-console
30
30
  console.warn(LOG_PREFIX +
31
31
  "reconnecting. current error count is " +
32
32
  this._errorCount +
@@ -76,6 +76,7 @@ export class BrokerizeWebSocketClientImpl {
76
76
  this._map[key] = {
77
77
  callbacks: [wrappedCb],
78
78
  idOnSocket: null,
79
+ interrupted: false,
79
80
  };
80
81
  }
81
82
  else {
@@ -121,11 +122,47 @@ export class BrokerizeWebSocketClientImpl {
121
122
  const cmd = JSON.parse(key);
122
123
  cmd.subscriptionId = this._id;
123
124
  this._sendWs(cmd, true);
125
+ if (this._map[key].interrupted) {
126
+ this._map[key].interrupted = false;
127
+ this._fillInMessagesAfterConnectionInterruption(cmd, this._map[key].callbacks);
128
+ }
124
129
  }
125
130
  else if (!this._socket) {
126
131
  this._connect();
127
132
  }
128
133
  }
134
+ _fillInMessagesAfterConnectionInterruption(cmd, callbacks) {
135
+ if (cmd.type == "invalidate") {
136
+ const assumedInvalidate = {
137
+ cmd: "invalidate",
138
+ subscriptionId: cmd.subscriptionId,
139
+ }; // minimal invalidate
140
+ console.log(LOG_PREFIX +
141
+ "connection was interrupted. filling in assumed invalidates that may have happened while socket was not available.");
142
+ callbacks.forEach((cb) => cb(null, assumedInvalidate));
143
+ }
144
+ else if (cmd.type == "decoupledOperationStatus") {
145
+ if (this._apiCtx) {
146
+ this._apiCtx
147
+ .getDecoupledOperationStatus({
148
+ decoupledOperationId: cmd.decoupledOperationId,
149
+ })
150
+ .then((status) => {
151
+ const invMsg = {
152
+ cmd: "updateDecoupledOperationStatus",
153
+ status: status,
154
+ subscriptionId: cmd.subscriptionId,
155
+ };
156
+ console.log(LOG_PREFIX +
157
+ "sending virtual decoupled operation status updates to subscribers due to connection interruption.");
158
+ callbacks.forEach((cb) => cb(null, invMsg));
159
+ }, (err) => {
160
+ console.log(err, LOG_PREFIX +
161
+ "could not retrieve status of decoupledOperation. ignoring it.");
162
+ });
163
+ }
164
+ }
165
+ }
129
166
  _endSubscription(key) {
130
167
  if (this._map[key].idOnSocket != null) {
131
168
  this._sendWs({
@@ -135,6 +172,13 @@ export class BrokerizeWebSocketClientImpl {
135
172
  this._map[key].idOnSocket = null;
136
173
  }
137
174
  }
175
+ /**
176
+ * Internal method for setting a related AuthorizedApiContext. This is used to retrieve
177
+ * decoupled operation status on interrupted connections.
178
+ */
179
+ _setAuthorizedApiContext(ctx) {
180
+ this._apiCtx = ctx;
181
+ }
138
182
  _startOrStopDisconnectTimeout() {
139
183
  if (this._shouldConnect()) {
140
184
  if (this._disconnectTimeout) {
@@ -163,7 +207,6 @@ export class BrokerizeWebSocketClientImpl {
163
207
  (_b = this._socket) === null || _b === void 0 ? void 0 : _b.send(JSON.stringify(data));
164
208
  }
165
209
  else {
166
- // eslint-disable-next-line no-console
167
210
  console.log(LOG_PREFIX + "socket not ready, not sending message.", this._lastNonFatalError, this._fatalError);
168
211
  }
169
212
  }
@@ -237,15 +280,16 @@ export class BrokerizeWebSocketClientImpl {
237
280
  _authCb();
238
281
  }
239
282
  }, (err) => {
240
- // eslint-disable-next-line no-console
241
283
  console.error(LOG_PREFIX + " connection failed", err);
242
284
  });
243
285
  };
244
286
  this._socket.onclose = () => {
245
- this._socket = null;
287
+ // mark all subscriptions interrupted so they can issue synthetic messages on reconnect
246
288
  for (const k in this._map) {
289
+ this._map[k].interrupted = true;
247
290
  this._endSubscription(k);
248
291
  }
292
+ this._socket = null;
249
293
  };
250
294
  this._pingIntvl && clearInterval(this._pingIntvl);
251
295
  this._pingIntvl = setInterval(() => {
@@ -292,7 +336,6 @@ export class BrokerizeWebSocketClientImpl {
292
336
  cb(this._fatalError, null);
293
337
  }
294
338
  catch (err) {
295
- // eslint-disable-next-line no-console
296
339
  console.warn(LOG_PREFIX + "error in callback", err);
297
340
  }
298
341
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brokerize/client",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
4
4
  "description": "Client for the brokerize.com API",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/brokerize/client-js#readme",