@brokerize/client 1.9.0 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/authorizedApiContext.js +2 -3
  2. package/dist/cjs/authorizedApiContext.js +1 -2
  3. package/dist/cjs/errors.d.ts +14 -0
  4. package/dist/cjs/errors.js +48 -1
  5. package/dist/cjs/index.d.ts +2 -2
  6. package/dist/cjs/index.js +3 -4
  7. package/dist/cjs/modelExports.d.ts +2 -0
  8. package/dist/cjs/modelExports.js +5 -1
  9. package/dist/cjs/swagger/models/BrokerClientCfg.d.ts +7 -0
  10. package/dist/cjs/swagger/models/BrokerClientCfg.js +5 -0
  11. package/dist/cjs/swagger/models/BrokerMeta.d.ts +15 -0
  12. package/dist/cjs/swagger/models/BrokerMeta.js +2 -0
  13. package/dist/cjs/swagger/models/ClientConfigUpdateOAuthLoginForm.d.ts +12 -1
  14. package/dist/cjs/swagger/models/ClientConfigUpdateOAuthLoginForm.js +2 -0
  15. package/dist/cjs/swagger/models/OAuthLoginFormConfig.d.ts +12 -1
  16. package/dist/cjs/swagger/models/OAuthLoginFormConfig.js +2 -0
  17. package/dist/cjs/swagger/models/Order.d.ts +9 -1
  18. package/dist/cjs/swagger/models/OrderCreate.d.ts +2 -1
  19. package/dist/cjs/swagger/models/PrepareOAuthRedirectParams.d.ts +15 -0
  20. package/dist/cjs/swagger/models/PrepareOAuthRedirectParams.js +11 -0
  21. package/dist/cjs/swagger/models/SmartbrokerClientCfg.d.ts +27 -0
  22. package/dist/cjs/swagger/models/SmartbrokerClientCfg.js +46 -0
  23. package/dist/cjs/swagger/models/SummarizedTrade.d.ts +14 -0
  24. package/dist/cjs/swagger/models/SummarizedTrade.js +4 -0
  25. package/dist/cjs/swagger/models/TradeWarning.d.ts +31 -1
  26. package/dist/cjs/swagger/models/TradeWarning.js +13 -0
  27. package/dist/cjs/swagger/models/TradeWarningReason.d.ts +45 -0
  28. package/dist/cjs/swagger/models/TradeWarningReason.js +58 -0
  29. package/dist/cjs/swagger/models/index.d.ts +2 -0
  30. package/dist/cjs/swagger/models/index.js +2 -0
  31. package/dist/client.d.ts +209 -15
  32. package/dist/errors.d.ts +14 -0
  33. package/dist/errors.js +45 -0
  34. package/dist/index.d.ts +2 -2
  35. package/dist/index.js +3 -5
  36. package/dist/modelExports.d.ts +2 -0
  37. package/dist/modelExports.js +2 -0
  38. package/dist/swagger/models/BrokerClientCfg.d.ts +7 -0
  39. package/dist/swagger/models/BrokerClientCfg.js +5 -0
  40. package/dist/swagger/models/BrokerMeta.d.ts +15 -0
  41. package/dist/swagger/models/BrokerMeta.js +2 -0
  42. package/dist/swagger/models/ClientConfigUpdateOAuthLoginForm.d.ts +12 -1
  43. package/dist/swagger/models/ClientConfigUpdateOAuthLoginForm.js +2 -0
  44. package/dist/swagger/models/OAuthLoginFormConfig.d.ts +12 -1
  45. package/dist/swagger/models/OAuthLoginFormConfig.js +2 -0
  46. package/dist/swagger/models/Order.d.ts +9 -1
  47. package/dist/swagger/models/OrderCreate.d.ts +2 -1
  48. package/dist/swagger/models/PrepareOAuthRedirectParams.d.ts +15 -0
  49. package/dist/swagger/models/PrepareOAuthRedirectParams.js +10 -0
  50. package/dist/swagger/models/SmartbrokerClientCfg.d.ts +27 -0
  51. package/dist/swagger/models/SmartbrokerClientCfg.js +40 -0
  52. package/dist/swagger/models/SummarizedTrade.d.ts +14 -0
  53. package/dist/swagger/models/SummarizedTrade.js +4 -0
  54. package/dist/swagger/models/TradeWarning.d.ts +31 -1
  55. package/dist/swagger/models/TradeWarning.js +13 -0
  56. package/dist/swagger/models/TradeWarningReason.d.ts +45 -0
  57. package/dist/swagger/models/TradeWarningReason.js +52 -0
  58. package/dist/swagger/models/index.d.ts +2 -0
  59. package/dist/swagger/models/index.js +2 -0
  60. package/package.json +4 -4
@@ -8,6 +8,8 @@
8
8
  * https://openapi-generator.tech
9
9
  * Do not edit the class manually.
10
10
  */
11
+ import { Security } from "./Security";
12
+ import { TradeWarningReason } from "./TradeWarningReason";
11
13
  /**
12
14
  *
13
15
  * @export
@@ -15,11 +17,39 @@
15
17
  */
16
18
  export interface TradeWarning {
17
19
  /**
18
- *
20
+ * Date in the format YYYY-MM-DD for validityType: 'GTD'
21
+ * Date in the format Date ISO string YYYY-MM-DDThh:mm:ss.fffZ for validityType: 'GTDT'
22
+ * @type {string}
23
+ * @memberof TradeWarning
24
+ */
25
+ fromDate?: string;
26
+ /**
27
+ * Human-readable description, currently German or English depending on where it originates. Meant
28
+ * as a fallback for displaying something at all — a client that knows `reason` should build its
29
+ * own text from the structured fields instead.
19
30
  * @type {string}
20
31
  * @memberof TradeWarning
21
32
  */
22
33
  message: string;
34
+ /**
35
+ *
36
+ * @type {TradeWarningReason}
37
+ * @memberof TradeWarning
38
+ */
39
+ reason: TradeWarningReason;
40
+ /**
41
+ *
42
+ * @type {Security}
43
+ * @memberof TradeWarning
44
+ */
45
+ security?: Security;
46
+ /**
47
+ * Date in the format YYYY-MM-DD for validityType: 'GTD'
48
+ * Date in the format Date ISO string YYYY-MM-DDThh:mm:ss.fffZ for validityType: 'GTDT'
49
+ * @type {string}
50
+ * @memberof TradeWarning
51
+ */
52
+ toDate?: string;
23
53
  }
24
54
  export declare function TradeWarningFromJSON(json: any): TradeWarning;
25
55
  export declare function TradeWarningFromJSONTyped(json: any, ignoreDiscriminator: boolean): TradeWarning;
@@ -16,6 +16,9 @@ exports.TradeWarningFromJSON = TradeWarningFromJSON;
16
16
  exports.TradeWarningFromJSONTyped = TradeWarningFromJSONTyped;
17
17
  exports.TradeWarningToJSONRecursive = TradeWarningToJSONRecursive;
18
18
  exports.TradeWarningToJSON = TradeWarningToJSON;
19
+ const runtime_1 = require("../runtime");
20
+ const Security_1 = require("./Security");
21
+ const TradeWarningReason_1 = require("./TradeWarningReason");
19
22
  function TradeWarningFromJSON(json) {
20
23
  return TradeWarningFromJSONTyped(json, false);
21
24
  }
@@ -24,7 +27,13 @@ function TradeWarningFromJSONTyped(json, ignoreDiscriminator) {
24
27
  return json;
25
28
  }
26
29
  return {
30
+ fromDate: !(0, runtime_1.exists)(json, "fromDate") ? undefined : json["fromDate"],
27
31
  message: json["message"],
32
+ reason: (0, TradeWarningReason_1.TradeWarningReasonFromJSON)(json["reason"]),
33
+ security: !(0, runtime_1.exists)(json, "security")
34
+ ? undefined
35
+ : (0, Security_1.SecurityFromJSON)(json["security"]),
36
+ toDate: !(0, runtime_1.exists)(json, "toDate") ? undefined : json["toDate"],
28
37
  };
29
38
  }
30
39
  function TradeWarningToJSONRecursive(value, ignoreParent = false) {
@@ -35,7 +44,11 @@ function TradeWarningToJSONRecursive(value, ignoreParent = false) {
35
44
  return null;
36
45
  }
37
46
  return {
47
+ fromDate: value.fromDate,
38
48
  message: value.message,
49
+ reason: (0, TradeWarningReason_1.TradeWarningReasonToJSON)(value.reason),
50
+ security: (0, Security_1.SecurityToJSON)(value.security),
51
+ toDate: value.toDate,
39
52
  };
40
53
  }
41
54
  function TradeWarningToJSON(value) {
@@ -0,0 +1,45 @@
1
+ /**
2
+ * brokerize
3
+ * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
4
+ *
5
+ *
6
+ *
7
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8
+ * https://openapi-generator.tech
9
+ * Do not edit the class manually.
10
+ */
11
+ /**
12
+ * Why a trade or portfolio-history computation could not give a complete answer. Clients switch on
13
+ * this instead of parsing `TradeWarning.message`, which is free text and may change at any time.
14
+ *
15
+ * - `executionsWithoutTimestamp`: order executions carry no execution time, so they cannot be placed
16
+ * on a timeline and were ignored altogether.
17
+ * - `inconsistentOrderHistory`: the executions of one security contradict each other or the reported
18
+ * holding (more sold than ever bought, a quantity that goes negative). Nothing can be reconstructed
19
+ * from them, so the security is left out of the value history and its trades are not reported.
20
+ * - `positionNotFullyExplained`: the order archive covers only part of a position — typical for
21
+ * brokers that return just the most recent weeks. What is held today is known, but its history
22
+ * reaches further back than the executions do.
23
+ * - `missingEodPrice`: no closing price was available for the security on some days; it was valued
24
+ * with the last price known before them.
25
+ * - `missingFxRate`: no exchange rate to the portfolio currency exists for the security's currency, so
26
+ * its amounts are *not* converted and the totals they enter are off by the conversion.
27
+ * - `unknownBuyPrice`: no purchase price could be determined for a position, so it is missing from the
28
+ * buy value (and from the profit it implies).
29
+ * - `realizedPnlUnavailable`: the completed trades could not be computed at all, which leaves the
30
+ * realized profit/loss empty rather than wrong.
31
+ * @export
32
+ */
33
+ export declare const TradeWarningReason: {
34
+ readonly ExecutionsWithoutTimestamp: "executionsWithoutTimestamp";
35
+ readonly InconsistentOrderHistory: "inconsistentOrderHistory";
36
+ readonly PositionNotFullyExplained: "positionNotFullyExplained";
37
+ readonly MissingEodPrice: "missingEodPrice";
38
+ readonly MissingFxRate: "missingFxRate";
39
+ readonly UnknownBuyPrice: "unknownBuyPrice";
40
+ readonly RealizedPnlUnavailable: "realizedPnlUnavailable";
41
+ };
42
+ export type TradeWarningReason = (typeof TradeWarningReason)[keyof typeof TradeWarningReason];
43
+ export declare function TradeWarningReasonFromJSON(json: any): TradeWarningReason;
44
+ export declare function TradeWarningReasonFromJSONTyped(json: any, ignoreDiscriminator: boolean): TradeWarningReason;
45
+ export declare function TradeWarningReasonToJSON(value?: TradeWarningReason | null): any;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * brokerize
6
+ * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
7
+ *
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.TradeWarningReason = void 0;
16
+ exports.TradeWarningReasonFromJSON = TradeWarningReasonFromJSON;
17
+ exports.TradeWarningReasonFromJSONTyped = TradeWarningReasonFromJSONTyped;
18
+ exports.TradeWarningReasonToJSON = TradeWarningReasonToJSON;
19
+ /**
20
+ * Why a trade or portfolio-history computation could not give a complete answer. Clients switch on
21
+ * this instead of parsing `TradeWarning.message`, which is free text and may change at any time.
22
+ *
23
+ * - `executionsWithoutTimestamp`: order executions carry no execution time, so they cannot be placed
24
+ * on a timeline and were ignored altogether.
25
+ * - `inconsistentOrderHistory`: the executions of one security contradict each other or the reported
26
+ * holding (more sold than ever bought, a quantity that goes negative). Nothing can be reconstructed
27
+ * from them, so the security is left out of the value history and its trades are not reported.
28
+ * - `positionNotFullyExplained`: the order archive covers only part of a position — typical for
29
+ * brokers that return just the most recent weeks. What is held today is known, but its history
30
+ * reaches further back than the executions do.
31
+ * - `missingEodPrice`: no closing price was available for the security on some days; it was valued
32
+ * with the last price known before them.
33
+ * - `missingFxRate`: no exchange rate to the portfolio currency exists for the security's currency, so
34
+ * its amounts are *not* converted and the totals they enter are off by the conversion.
35
+ * - `unknownBuyPrice`: no purchase price could be determined for a position, so it is missing from the
36
+ * buy value (and from the profit it implies).
37
+ * - `realizedPnlUnavailable`: the completed trades could not be computed at all, which leaves the
38
+ * realized profit/loss empty rather than wrong.
39
+ * @export
40
+ */
41
+ exports.TradeWarningReason = {
42
+ ExecutionsWithoutTimestamp: "executionsWithoutTimestamp",
43
+ InconsistentOrderHistory: "inconsistentOrderHistory",
44
+ PositionNotFullyExplained: "positionNotFullyExplained",
45
+ MissingEodPrice: "missingEodPrice",
46
+ MissingFxRate: "missingFxRate",
47
+ UnknownBuyPrice: "unknownBuyPrice",
48
+ RealizedPnlUnavailable: "realizedPnlUnavailable",
49
+ };
50
+ function TradeWarningReasonFromJSON(json) {
51
+ return TradeWarningReasonFromJSONTyped(json, false);
52
+ }
53
+ function TradeWarningReasonFromJSONTyped(json, ignoreDiscriminator) {
54
+ return json;
55
+ }
56
+ function TradeWarningReasonToJSON(value) {
57
+ return value;
58
+ }
@@ -230,6 +230,7 @@ export * from "./SessionSyncInfoSyncedAllOf";
230
230
  export * from "./SessionSyncInfoSyncedSpecifics";
231
231
  export * from "./SetClientConfigRequest";
232
232
  export * from "./SizeUnitConstraint";
233
+ export * from "./SmartbrokerClientCfg";
233
234
  export * from "./StringMapByOrderModel";
234
235
  export * from "./SummarizedTrade";
235
236
  export * from "./SyncError";
@@ -256,6 +257,7 @@ export * from "./TradeStatisticsDateRange";
256
257
  export * from "./TradeStatisticsHoldingPeriodInDays";
257
258
  export * from "./TradeStatisticsItem";
258
259
  export * from "./TradeWarning";
260
+ export * from "./TradeWarningReason";
259
261
  export * from "./TradingSessionLifetime";
260
262
  export * from "./TrailingDistance";
261
263
  export * from "./TriggerSync200Response";
@@ -248,6 +248,7 @@ __exportStar(require("./SessionSyncInfoSyncedAllOf"), exports);
248
248
  __exportStar(require("./SessionSyncInfoSyncedSpecifics"), exports);
249
249
  __exportStar(require("./SetClientConfigRequest"), exports);
250
250
  __exportStar(require("./SizeUnitConstraint"), exports);
251
+ __exportStar(require("./SmartbrokerClientCfg"), exports);
251
252
  __exportStar(require("./StringMapByOrderModel"), exports);
252
253
  __exportStar(require("./SummarizedTrade"), exports);
253
254
  __exportStar(require("./SyncError"), exports);
@@ -274,6 +275,7 @@ __exportStar(require("./TradeStatisticsDateRange"), exports);
274
275
  __exportStar(require("./TradeStatisticsHoldingPeriodInDays"), exports);
275
276
  __exportStar(require("./TradeStatisticsItem"), exports);
276
277
  __exportStar(require("./TradeWarning"), exports);
278
+ __exportStar(require("./TradeWarningReason"), exports);
277
279
  __exportStar(require("./TradingSessionLifetime"), exports);
278
280
  __exportStar(require("./TrailingDistance"), exports);
279
281
  __exportStar(require("./TriggerSync200Response"), exports);
package/dist/client.d.ts CHANGED
@@ -1370,6 +1370,12 @@ declare interface BrokerClientCfg {
1370
1370
  * @memberof BrokerClientCfg
1371
1371
  */
1372
1372
  coinbase?: CoinbaseClientCfg;
1373
+ /**
1374
+ *
1375
+ * @type {SmartbrokerClientCfg}
1376
+ * @memberof BrokerClientCfg
1377
+ */
1378
+ smartbroker?: SmartbrokerClientCfg;
1373
1379
  }
1374
1380
 
1375
1381
  declare function BrokerClientCfgFromJSON(json: any): BrokerClientCfg;
@@ -1562,6 +1568,15 @@ export declare class BrokerizeError extends Error {
1562
1568
  constructor(statusCode: number, body: ErrorResponse);
1563
1569
  }
1564
1570
 
1571
+ /**
1572
+ * Thrown if a request to the brokerize API timed out (HTTP status 504). This is typically sent by
1573
+ * a load balancer or gateway in front of the API, so the response body usually is not a regular
1574
+ * `ErrorResponse`.
1575
+ */
1576
+ export declare class BrokerizeTimeoutError extends BrokerizeError {
1577
+ constructor(body: ErrorResponse);
1578
+ }
1579
+
1565
1580
  export declare interface BrokerizeWebSocketClient {
1566
1581
  subscribeInvalidate: (subscribe: SubscribeInvalidateDetails, callback: Callback) => Subscription;
1567
1582
  subscribeDecoupledOperation: (subscribe: Pick<SubscribeDecoupledOperation, "sessionId" | "decoupledOperationId">, callback: Callback) => Subscription;
@@ -1696,6 +1711,21 @@ declare interface BrokerMeta {
1696
1711
  * @memberof BrokerMeta
1697
1712
  */
1698
1713
  loginForm?: BrokerLoginForm;
1714
+ /**
1715
+ * All brokerize exchange ids this broker's exchanges are mapped to, ascending. Use it to tell
1716
+ * upfront which brokers may be relevant for a given exchange, e.g. to preselect brokers for a
1717
+ * security that is traded there.
1718
+ *
1719
+ * This is a static, broker-wide list: it means that brokerize knows how to translate between
1720
+ * this broker's exchanges and the listed ids, not that every security can be traded at every
1721
+ * one of them. The authoritative, security-specific list of tradable exchanges remains the
1722
+ * `exchanges` field of a prepared trade.
1723
+ *
1724
+ * Every id is contained in the `GetExchanges` response, so it can always be resolved to a name.
1725
+ * @type {Array<number>}
1726
+ * @memberof BrokerMeta
1727
+ */
1728
+ supportedExchangeIds: Array<number>;
1699
1729
  /**
1700
1730
  * If true, the user can login at the broker via OAuth (this involves browser redirects). Use `prepareOAuthRedirect` to obtain a URL to redirect to.
1701
1731
  * @type {boolean}
@@ -2978,13 +3008,22 @@ declare interface ClientConfigUpdateOAuthLoginForm {
2978
3008
  */
2979
3009
  logoUrlLight?: string;
2980
3010
  /**
3011
+ * How the browser is sent back to the `returnTo` URL after a successful broker login.
3012
+ *
3013
+ * `meta`, `js` and `link` render the interstitial callback screen and redirect from there (via a
3014
+ * meta refresh, via JavaScript, or by revealing a link the user clicks). `http` skips the screen
3015
+ * and answers the callback with a plain HTTP 302 instead.
3016
+ *
3017
+ * `http` only applies to `http`/`https` `returnTo` URLs. A `returnTo` in a custom app scheme
3018
+ * still gets the interstitial, because browsers handle a 302 into an app scheme inconsistently.
2981
3019
  *
3020
+ * Default is `meta`.
2982
3021
  * @type {string}
2983
3022
  * @memberof ClientConfigUpdateOAuthLoginForm
2984
3023
  */
2985
3024
  redirectStyle?: ClientConfigUpdateOAuthLoginFormRedirectStyleEnum;
2986
3025
  /**
2987
- *
3026
+ * Overrides `redirectStyle` for logins at bitpanda.
2988
3027
  * @type {string}
2989
3028
  * @memberof ClientConfigUpdateOAuthLoginForm
2990
3029
  */
@@ -3002,6 +3041,7 @@ declare const ClientConfigUpdateOAuthLoginFormRedirectStyleBitpandaEnum: {
3002
3041
  readonly Meta: "meta";
3003
3042
  readonly Js: "js";
3004
3043
  readonly Link: "link";
3044
+ readonly Http: "http";
3005
3045
  };
3006
3046
 
3007
3047
  declare type ClientConfigUpdateOAuthLoginFormRedirectStyleBitpandaEnum = (typeof ClientConfigUpdateOAuthLoginFormRedirectStyleBitpandaEnum)[keyof typeof ClientConfigUpdateOAuthLoginFormRedirectStyleBitpandaEnum];
@@ -3013,6 +3053,7 @@ declare const ClientConfigUpdateOAuthLoginFormRedirectStyleEnum: {
3013
3053
  readonly Meta: "meta";
3014
3054
  readonly Js: "js";
3015
3055
  readonly Link: "link";
3056
+ readonly Http: "http";
3016
3057
  };
3017
3058
 
3018
3059
  declare type ClientConfigUpdateOAuthLoginFormRedirectStyleEnum = (typeof ClientConfigUpdateOAuthLoginFormRedirectStyleEnum)[keyof typeof ClientConfigUpdateOAuthLoginFormRedirectStyleEnum];
@@ -7894,6 +7935,7 @@ declare namespace Models {
7894
7935
  Position,
7895
7936
  PositionValuation,
7896
7937
  PrepareOAuthRedirectParams,
7938
+ PrepareOAuthRedirectParamsAppearanceEnum,
7897
7939
  PrepareOAuthRedirectResponse,
7898
7940
  PrepareTradeResponse,
7899
7941
  PreparedTrade,
@@ -7927,6 +7969,7 @@ declare namespace Models {
7927
7969
  OrderIntentAvailability,
7928
7970
  SummarizedTrade,
7929
7971
  TradeWarning,
7972
+ TradeWarningReason,
7930
7973
  GetPortfolioTradesResponse,
7931
7974
  GetPortfolioTradeStatisticsResponse,
7932
7975
  TradeStatisticsItem,
@@ -7981,13 +8024,22 @@ declare interface OAuthLoginFormConfig {
7981
8024
  */
7982
8025
  logoUrlLight?: string;
7983
8026
  /**
8027
+ * How the browser is sent back to the `returnTo` URL after a successful broker login.
8028
+ *
8029
+ * `meta`, `js` and `link` render the interstitial callback screen and redirect from there (via a
8030
+ * meta refresh, via JavaScript, or by revealing a link the user clicks). `http` skips the screen
8031
+ * and answers the callback with a plain HTTP 302 instead.
8032
+ *
8033
+ * `http` only applies to `http`/`https` `returnTo` URLs. A `returnTo` in a custom app scheme
8034
+ * still gets the interstitial, because browsers handle a 302 into an app scheme inconsistently.
7984
8035
  *
8036
+ * Default is `meta`.
7985
8037
  * @type {string}
7986
8038
  * @memberof OAuthLoginFormConfig
7987
8039
  */
7988
8040
  redirectStyle?: OAuthLoginFormConfigRedirectStyleEnum;
7989
8041
  /**
7990
- *
8042
+ * Overrides `redirectStyle` for logins at bitpanda.
7991
8043
  * @type {string}
7992
8044
  * @memberof OAuthLoginFormConfig
7993
8045
  */
@@ -8005,6 +8057,7 @@ declare const OAuthLoginFormConfigRedirectStyleBitpandaEnum: {
8005
8057
  readonly Meta: "meta";
8006
8058
  readonly Js: "js";
8007
8059
  readonly Link: "link";
8060
+ readonly Http: "http";
8008
8061
  };
8009
8062
 
8010
8063
  declare type OAuthLoginFormConfigRedirectStyleBitpandaEnum = (typeof OAuthLoginFormConfigRedirectStyleBitpandaEnum)[keyof typeof OAuthLoginFormConfigRedirectStyleBitpandaEnum];
@@ -8016,6 +8069,7 @@ declare const OAuthLoginFormConfigRedirectStyleEnum: {
8016
8069
  readonly Meta: "meta";
8017
8070
  readonly Js: "js";
8018
8071
  readonly Link: "link";
8072
+ readonly Http: "http";
8019
8073
  };
8020
8074
 
8021
8075
  declare type OAuthLoginFormConfigRedirectStyleEnum = (typeof OAuthLoginFormConfigRedirectStyleEnum)[keyof typeof OAuthLoginFormConfigRedirectStyleEnum];
@@ -9254,6 +9308,7 @@ declare namespace openApiClient {
9254
9308
  PrepareOAuthRedirectParamsToJSONRecursive,
9255
9309
  PrepareOAuthRedirectParamsToJSON,
9256
9310
  PrepareOAuthRedirectParams,
9311
+ PrepareOAuthRedirectParamsAppearanceEnum,
9257
9312
  PrepareOAuthRedirectResponseFromJSON,
9258
9313
  PrepareOAuthRedirectResponseFromJSONTyped,
9259
9314
  PrepareOAuthRedirectResponseToJSONRecursive,
@@ -9402,6 +9457,11 @@ declare namespace openApiClient {
9402
9457
  SizeUnitConstraintToJSONRecursive,
9403
9458
  SizeUnitConstraintToJSON,
9404
9459
  SizeUnitConstraint,
9460
+ SmartbrokerClientCfgFromJSON,
9461
+ SmartbrokerClientCfgFromJSONTyped,
9462
+ SmartbrokerClientCfgToJSONRecursive,
9463
+ SmartbrokerClientCfgToJSON,
9464
+ SmartbrokerClientCfg,
9405
9465
  StringMapByOrderModelFromJSON,
9406
9466
  StringMapByOrderModelFromJSONTyped,
9407
9467
  StringMapByOrderModelToJSONRecursive,
@@ -9536,6 +9596,10 @@ declare namespace openApiClient {
9536
9596
  TradeWarningToJSONRecursive,
9537
9597
  TradeWarningToJSON,
9538
9598
  TradeWarning,
9599
+ TradeWarningReasonFromJSON,
9600
+ TradeWarningReasonFromJSONTyped,
9601
+ TradeWarningReasonToJSON,
9602
+ TradeWarningReason,
9539
9603
  TradingSessionLifetimeFromJSON,
9540
9604
  TradingSessionLifetimeFromJSONTyped,
9541
9605
  TradingSessionLifetimeToJSON,
@@ -9637,7 +9701,14 @@ declare interface Order {
9637
9701
  */
9638
9702
  bondCurrencyIso?: string;
9639
9703
  /**
9704
+ * The id of the exchange, as defined by the *broker*.
9705
+ *
9706
+ * When reading an order this **can be an empty string**: not every order is traded on an exchange -- a securities
9707
+ * account transfer, for example, is booked into or out of the custody account and has no trading venue, so the
9708
+ * broker reports no exchange for it. Clients must handle the empty string.
9640
9709
  *
9710
+ * Note that this field will become optional in a future version of the API, so clients should not rely on it
9711
+ * being present at all. For creating an order it stays required, see `OrderCreate`.
9641
9712
  * @type {string}
9642
9713
  * @memberof Order
9643
9714
  */
@@ -9721,7 +9792,8 @@ declare interface Order {
9721
9792
  */
9722
9793
  exchangeName?: string;
9723
9794
  /**
9724
- * For fully executed orders: the timestamp of the *latest* execution.
9795
+ * For orders with at least one execution (`executed`, `open_executed`, `canceled_executed`):
9796
+ * the timestamp of the *latest* execution.
9725
9797
  * @type {Date}
9726
9798
  * @memberof Order
9727
9799
  */
@@ -10186,7 +10258,8 @@ declare function OrderCostEstimationToJSONRecursive(value?: OrderCostEstimation
10186
10258
  */
10187
10259
  declare interface OrderCreate {
10188
10260
  /**
10189
- *
10261
+ * The id of the exchange, as defined by the *broker*. Always required to create an order, and never empty --
10262
+ * unlike when reading an order, where the broker may report no exchange (see `OrderBase.brokerExchangeId`).
10190
10263
  * @type {string}
10191
10264
  * @memberof OrderCreate
10192
10265
  */
@@ -12109,6 +12182,13 @@ declare function PreparedTradeToJSONRecursive(value?: PreparedTrade | null, igno
12109
12182
  * @interface PrepareOAuthRedirectParams
12110
12183
  */
12111
12184
  declare interface PrepareOAuthRedirectParams {
12185
+ /**
12186
+ * Preferred appearance for login screens. Note that this can only be set explicitly for some selected brokers.
12187
+ * If the broker does not support it, this is silently ignored and the default broker appearance is used.
12188
+ * @type {string}
12189
+ * @memberof PrepareOAuthRedirectParams
12190
+ */
12191
+ appearance?: PrepareOAuthRedirectParamsAppearanceEnum;
12112
12192
  /**
12113
12193
  *
12114
12194
  * @type {string}
@@ -12129,6 +12209,16 @@ declare interface PrepareOAuthRedirectParams {
12129
12209
  returnToUrl: string;
12130
12210
  }
12131
12211
 
12212
+ /**
12213
+ * @export
12214
+ */
12215
+ declare const PrepareOAuthRedirectParamsAppearanceEnum: {
12216
+ readonly Light: "light";
12217
+ readonly Dark: "dark";
12218
+ };
12219
+
12220
+ declare type PrepareOAuthRedirectParamsAppearanceEnum = (typeof PrepareOAuthRedirectParamsAppearanceEnum)[keyof typeof PrepareOAuthRedirectParamsAppearanceEnum];
12221
+
12132
12222
  declare function PrepareOAuthRedirectParamsFromJSON(json: any): PrepareOAuthRedirectParams;
12133
12223
 
12134
12224
  declare function PrepareOAuthRedirectParamsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PrepareOAuthRedirectParams;
@@ -13590,6 +13680,38 @@ declare function SizeUnitConstraintToJSON(value?: SizeUnitConstraint | null): an
13590
13680
 
13591
13681
  declare function SizeUnitConstraintToJSONRecursive(value?: SizeUnitConstraint | null, ignoreParent?: boolean): any;
13592
13682
 
13683
+ /**
13684
+ * brokerize
13685
+ * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
13686
+ *
13687
+ *
13688
+ *
13689
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
13690
+ * https://openapi-generator.tech
13691
+ * Do not edit the class manually.
13692
+ */
13693
+ /**
13694
+ *
13695
+ * @export
13696
+ * @interface SmartbrokerClientCfg
13697
+ */
13698
+ declare interface SmartbrokerClientCfg {
13699
+ /**
13700
+ * If the client must use a different broker-provided clientId, it can be configured here.
13701
+ * @type {string}
13702
+ * @memberof SmartbrokerClientCfg
13703
+ */
13704
+ clientIdProd?: string;
13705
+ }
13706
+
13707
+ declare function SmartbrokerClientCfgFromJSON(json: any): SmartbrokerClientCfg;
13708
+
13709
+ declare function SmartbrokerClientCfgFromJSONTyped(json: any, ignoreDiscriminator: boolean): SmartbrokerClientCfg;
13710
+
13711
+ declare function SmartbrokerClientCfgToJSON(value?: SmartbrokerClientCfg | null): any;
13712
+
13713
+ declare function SmartbrokerClientCfgToJSONRecursive(value?: SmartbrokerClientCfg | null, ignoreParent?: boolean): any;
13714
+
13593
13715
  /**
13594
13716
  * brokerize
13595
13717
  * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
@@ -13734,6 +13856,20 @@ declare interface SummarizedTrade {
13734
13856
  * @memberof SummarizedTrade
13735
13857
  */
13736
13858
  closeDateTime: Date;
13859
+ /**
13860
+ * True if this trade was not closed by a sale but by the instrument being booked out — it knocked
13861
+ * out or expired, and the issuer removed the position from the depot without a sell order ever
13862
+ * reaching the order archive.
13863
+ *
13864
+ * The closing execution is therefore synthetic: brokerize derives it from the knock-out date and
13865
+ * prices it with the instrument's closing price on that day (0 where none is known, which is the
13866
+ * floor rather than a claim — the issuer's buy-back, if there was one, is not in the archive). The
13867
+ * P/L is otherwise computed exactly like any other trade's, FIFO-matched against the position's own
13868
+ * buys. Absent on an ordinary trade.
13869
+ * @type {boolean}
13870
+ * @memberof SummarizedTrade
13871
+ */
13872
+ closedByKnockOut?: boolean;
13737
13873
  /**
13738
13874
  *
13739
13875
  * @type {string}
@@ -15014,16 +15150,6 @@ declare function TradeStatisticsToJSON(value?: TradeStatistics | null): any;
15014
15150
 
15015
15151
  declare function TradeStatisticsToJSONRecursive(value?: TradeStatistics | null, ignoreParent?: boolean): any;
15016
15152
 
15017
- /**
15018
- * brokerize
15019
- * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
15020
- *
15021
- *
15022
- *
15023
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
15024
- * https://openapi-generator.tech
15025
- * Do not edit the class manually.
15026
- */
15027
15153
  /**
15028
15154
  *
15029
15155
  * @export
@@ -15031,17 +15157,85 @@ declare function TradeStatisticsToJSONRecursive(value?: TradeStatistics | null,
15031
15157
  */
15032
15158
  declare interface TradeWarning {
15033
15159
  /**
15034
- *
15160
+ * Date in the format YYYY-MM-DD for validityType: 'GTD'
15161
+ * Date in the format Date ISO string YYYY-MM-DDThh:mm:ss.fffZ for validityType: 'GTDT'
15162
+ * @type {string}
15163
+ * @memberof TradeWarning
15164
+ */
15165
+ fromDate?: string;
15166
+ /**
15167
+ * Human-readable description, currently German or English depending on where it originates. Meant
15168
+ * as a fallback for displaying something at all — a client that knows `reason` should build its
15169
+ * own text from the structured fields instead.
15035
15170
  * @type {string}
15036
15171
  * @memberof TradeWarning
15037
15172
  */
15038
15173
  message: string;
15174
+ /**
15175
+ *
15176
+ * @type {TradeWarningReason}
15177
+ * @memberof TradeWarning
15178
+ */
15179
+ reason: TradeWarningReason;
15180
+ /**
15181
+ *
15182
+ * @type {Security}
15183
+ * @memberof TradeWarning
15184
+ */
15185
+ security?: Security;
15186
+ /**
15187
+ * Date in the format YYYY-MM-DD for validityType: 'GTD'
15188
+ * Date in the format Date ISO string YYYY-MM-DDThh:mm:ss.fffZ for validityType: 'GTDT'
15189
+ * @type {string}
15190
+ * @memberof TradeWarning
15191
+ */
15192
+ toDate?: string;
15039
15193
  }
15040
15194
 
15041
15195
  declare function TradeWarningFromJSON(json: any): TradeWarning;
15042
15196
 
15043
15197
  declare function TradeWarningFromJSONTyped(json: any, ignoreDiscriminator: boolean): TradeWarning;
15044
15198
 
15199
+ /**
15200
+ * Why a trade or portfolio-history computation could not give a complete answer. Clients switch on
15201
+ * this instead of parsing `TradeWarning.message`, which is free text and may change at any time.
15202
+ *
15203
+ * - `executionsWithoutTimestamp`: order executions carry no execution time, so they cannot be placed
15204
+ * on a timeline and were ignored altogether.
15205
+ * - `inconsistentOrderHistory`: the executions of one security contradict each other or the reported
15206
+ * holding (more sold than ever bought, a quantity that goes negative). Nothing can be reconstructed
15207
+ * from them, so the security is left out of the value history and its trades are not reported.
15208
+ * - `positionNotFullyExplained`: the order archive covers only part of a position — typical for
15209
+ * brokers that return just the most recent weeks. What is held today is known, but its history
15210
+ * reaches further back than the executions do.
15211
+ * - `missingEodPrice`: no closing price was available for the security on some days; it was valued
15212
+ * with the last price known before them.
15213
+ * - `missingFxRate`: no exchange rate to the portfolio currency exists for the security's currency, so
15214
+ * its amounts are *not* converted and the totals they enter are off by the conversion.
15215
+ * - `unknownBuyPrice`: no purchase price could be determined for a position, so it is missing from the
15216
+ * buy value (and from the profit it implies).
15217
+ * - `realizedPnlUnavailable`: the completed trades could not be computed at all, which leaves the
15218
+ * realized profit/loss empty rather than wrong.
15219
+ * @export
15220
+ */
15221
+ declare const TradeWarningReason: {
15222
+ readonly ExecutionsWithoutTimestamp: "executionsWithoutTimestamp";
15223
+ readonly InconsistentOrderHistory: "inconsistentOrderHistory";
15224
+ readonly PositionNotFullyExplained: "positionNotFullyExplained";
15225
+ readonly MissingEodPrice: "missingEodPrice";
15226
+ readonly MissingFxRate: "missingFxRate";
15227
+ readonly UnknownBuyPrice: "unknownBuyPrice";
15228
+ readonly RealizedPnlUnavailable: "realizedPnlUnavailable";
15229
+ };
15230
+
15231
+ declare type TradeWarningReason = (typeof TradeWarningReason)[keyof typeof TradeWarningReason];
15232
+
15233
+ declare function TradeWarningReasonFromJSON(json: any): TradeWarningReason;
15234
+
15235
+ declare function TradeWarningReasonFromJSONTyped(json: any, ignoreDiscriminator: boolean): TradeWarningReason;
15236
+
15237
+ declare function TradeWarningReasonToJSON(value?: TradeWarningReason | null): any;
15238
+
15045
15239
  declare function TradeWarningToJSON(value?: TradeWarning | null): any;
15046
15240
 
15047
15241
  declare function TradeWarningToJSONRecursive(value?: TradeWarning | null, ignoreParent?: boolean): any;
package/dist/errors.d.ts CHANGED
@@ -65,3 +65,17 @@ export declare class BrokerizeError extends Error {
65
65
  httpStatusCode: number;
66
66
  constructor(statusCode: number, body: ErrorResponse);
67
67
  }
68
+ /**
69
+ * Thrown if a request to the brokerize API timed out (HTTP status 504). This is typically sent by
70
+ * a load balancer or gateway in front of the API, so the response body usually is not a regular
71
+ * `ErrorResponse`.
72
+ */
73
+ export declare class BrokerizeTimeoutError extends BrokerizeError {
74
+ constructor(body: ErrorResponse);
75
+ }
76
+ /**
77
+ * Create the error for a failed (status >= 400) API response. If the body is not a valid `ErrorResponse`
78
+ * (e.g. an HTML error page from a load balancer), a generic error body is used instead of failing with a
79
+ * JSON parse error.
80
+ */
81
+ export declare function createErrorFromResponse(response: Response): Promise<BrokerizeError>;