@brokerize/client 1.3.9 → 1.4.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 (41) hide show
  1. package/dist/authorizedApiContext.d.ts +25 -21
  2. package/dist/authorizedApiContext.js +49 -41
  3. package/dist/client.d.ts +707 -388
  4. package/dist/index.d.ts +5 -2
  5. package/dist/index.js +39 -2
  6. package/dist/modelExports.d.ts +3 -0
  7. package/dist/swagger/apis/DecoupledOperationsApi.d.ts +35 -0
  8. package/dist/swagger/apis/DecoupledOperationsApi.js +86 -0
  9. package/dist/swagger/apis/DemobrokerApi.d.ts +2 -2
  10. package/dist/swagger/apis/DemobrokerApi.js +2 -2
  11. package/dist/swagger/apis/{ChangeOrderApi.d.ts → OrderApi.d.ts} +35 -2
  12. package/dist/swagger/apis/{ChangeOrderApi.js → OrderApi.js} +117 -2
  13. package/dist/swagger/apis/{DefaultApi.d.ts → PortfolioApi.d.ts} +2 -160
  14. package/dist/swagger/apis/{DefaultApi.js → PortfolioApi.js} +2 -568
  15. package/dist/swagger/apis/SessionApi.d.ts +146 -0
  16. package/dist/swagger/apis/SessionApi.js +474 -0
  17. package/dist/swagger/apis/UserApi.d.ts +89 -1
  18. package/dist/swagger/apis/UserApi.js +309 -1
  19. package/dist/swagger/apis/WebsocketApi.d.ts +24 -0
  20. package/dist/swagger/apis/WebsocketApi.js +38 -0
  21. package/dist/swagger/apis/index.d.ts +5 -4
  22. package/dist/swagger/apis/index.js +5 -4
  23. package/dist/swagger/models/CheckRecoveryPhrase200Response.d.ts +33 -0
  24. package/dist/swagger/models/CheckRecoveryPhrase200Response.js +39 -0
  25. package/dist/swagger/models/CreateRecoveryPhraseParams.d.ts +28 -0
  26. package/dist/swagger/models/CreateRecoveryPhraseParams.js +37 -0
  27. package/dist/swagger/models/CreateRecoveryPhraseResult.d.ts +27 -0
  28. package/dist/swagger/models/CreateRecoveryPhraseResult.js +37 -0
  29. package/dist/swagger/models/GetRecoveryPhrasesResponse.d.ts +28 -0
  30. package/dist/swagger/models/GetRecoveryPhrasesResponse.js +38 -0
  31. package/dist/swagger/models/ObtainTokenByRecoveryPhraseParams.d.ts +27 -0
  32. package/dist/swagger/models/ObtainTokenByRecoveryPhraseParams.js +37 -0
  33. package/dist/swagger/models/RecoveryPhraseItem.d.ts +51 -0
  34. package/dist/swagger/models/RecoveryPhraseItem.js +45 -0
  35. package/dist/swagger/models/index.d.ts +6 -0
  36. package/dist/swagger/models/index.js +6 -0
  37. package/package.json +1 -1
  38. package/dist/swagger/apis/BrokerLoginApi.d.ts +0 -59
  39. package/dist/swagger/apis/BrokerLoginApi.js +0 -169
  40. package/dist/swagger/apis/CancelOrderApi.d.ts +0 -41
  41. package/dist/swagger/apis/CancelOrderApi.js +0 -101
package/dist/client.d.ts CHANGED
@@ -1075,29 +1075,28 @@ declare function AuthMethodTanToJSONRecursive(value?: AuthMethodTan | null, igno
1075
1075
  declare function AuthMethodToJSON(value?: AuthMethod | null): any;
1076
1076
 
1077
1077
  export declare class AuthorizedApiContext {
1078
- private _cfg;
1079
- private _auth;
1080
- private _defaultApi;
1081
- private _demoBrokerApi;
1082
- private _tradeApi;
1083
- private _tradeApiCryptoService;
1084
1078
  private _isDestroyed;
1085
- private _abortController;
1086
- private _metaApi;
1087
- private _brokerLoginApi;
1088
- private _tradeDraftApi;
1089
- private _cancelOrderApi;
1090
- private _cancelOrderApiCryptoService;
1091
- private _changeOrderApi;
1092
- private _changeOrderApiCryptoService;
1093
- private _logoutSubject;
1094
1079
  private _childContexts;
1095
- private _wsClient;
1096
- private _cache;
1097
- private _exportApi;
1098
- private _adminApi;
1099
- private _userApi;
1100
- private _securitiesApi;
1080
+ private readonly _cfg;
1081
+ private readonly _auth;
1082
+ private readonly _demoBrokerApi;
1083
+ private readonly _tradeApi;
1084
+ private readonly _tradeApiCryptoService;
1085
+ private readonly _abortController;
1086
+ private readonly _metaApi;
1087
+ private readonly _sessionApi;
1088
+ private readonly _tradeDraftApi;
1089
+ private readonly _orderApi;
1090
+ private readonly _orderApiCryptoService;
1091
+ private readonly _logoutSubject;
1092
+ private readonly _wsClient;
1093
+ private readonly _cache;
1094
+ private readonly _exportApi;
1095
+ private readonly _adminApi;
1096
+ private readonly _userApi;
1097
+ private readonly _securitiesApi;
1098
+ private readonly _portfolioApi;
1099
+ private readonly _decoupledOperationsApi;
1101
1100
  constructor(cfg: BrokerizeConfig, auth: Auth, wsClient?: BrokerizeWebSocketClient);
1102
1101
  createChildContext(): AuthorizedApiContext;
1103
1102
  private _initRequestInit;
@@ -1178,6 +1177,11 @@ export declare class AuthorizedApiContext {
1178
1177
  securityQuotesToken: string;
1179
1178
  }): Promise<openApiClient.SecurityQuotesResponse>;
1180
1179
  getSecurityQuotesMeta(securityQuotesToken: string): Promise<openApiClient.SecurityQuotesMeta>;
1180
+ getRecoveryPhrases(): Promise<openApiClient.GetRecoveryPhrasesResponse>;
1181
+ createRecoveryPhrase(opts: {
1182
+ name: string;
1183
+ }): Promise<openApiClient.CreateRecoveryPhraseResult>;
1184
+ deleteRecoveryPhrase(recoveryPhraseId: string): Promise<void>;
1181
1185
  /**
1182
1186
  * Subscribe to security quotes. Note that this currently uses polling to load the quotes from the
1183
1187
  * API. This will be replaced with a websocket-based solution in the future, but we can keep this
@@ -1437,7 +1441,7 @@ declare function BrokerEnvironmentToJSONRecursive(value?: BrokerEnvironment | nu
1437
1441
 
1438
1442
  export declare class Brokerize {
1439
1443
  private _cfg;
1440
- private _defaultApi;
1444
+ private _userApi;
1441
1445
  constructor(cfg: BrokerizeConfig);
1442
1446
  refreshGuestUser(refreshToken: string): Promise<GuestAuthContextConfiguration>;
1443
1447
  createGuestUser(): Promise<AuthContextConfiguration>;
@@ -1461,6 +1465,8 @@ export declare class Brokerize {
1461
1465
  * @returns
1462
1466
  */
1463
1467
  createAuth(authCtxCfg: AuthContextConfiguration, tokenRefreshCallback?: TokenRefreshCallback): Auth;
1468
+ checkRecoveryPhrase(recoveryPhrase: string): Promise<openApiClient.CheckRecoveryPhrase200Response>;
1469
+ obtainTokenByRecoveryPhrase(recoveryPhrase: string): Promise<AuthContextConfiguration>;
1464
1470
  /**
1465
1471
  * Create a customized WebSocket client. You can override the WebSocket connection URL and the Auth implementation
1466
1472
  * for a custom token retrieval behavior.
@@ -1550,42 +1556,6 @@ declare type BrokerizeWebSocketError = {
1550
1556
  message: string;
1551
1557
  };
1552
1558
 
1553
- /**
1554
- *
1555
- */
1556
- declare class BrokerLoginApi extends runtime.BaseAPI {
1557
- /**
1558
- */
1559
- addSessionRaw(requestParameters: AddSessionRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<LoginResponse>>;
1560
- /**
1561
- */
1562
- addSession(requestParameters: AddSessionRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<LoginResponse>;
1563
- /**
1564
- * If login returns the state `challenge`, the login must be completed by providing a challenge response first.
1565
- */
1566
- addSessionCompleteChallengeRaw(requestParameters: AddSessionCompleteChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<LoginResponseReady>>;
1567
- /**
1568
- * If login returns the state `challenge`, the login must be completed by providing a challenge response first.
1569
- */
1570
- addSessionCompleteChallenge(requestParameters: AddSessionCompleteChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<LoginResponseReady>;
1571
- /**
1572
- * For brokers with OAuth login processes, this adds the session to the user\'s account after redirects happen. Only the user that is redirected from the broker login in the browser will receive the `code`. This step ensures that the logged-in user at brokerize is actually the one that has gone through the broker OAuth steps.
1573
- */
1574
- confirmOAuthRaw(requestParameters: ConfirmOAuthRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<ConfirmOAuthResponse>>;
1575
- /**
1576
- * For brokers with OAuth login processes, this adds the session to the user\'s account after redirects happen. Only the user that is redirected from the broker login in the browser will receive the `code`. This step ensures that the logged-in user at brokerize is actually the one that has gone through the broker OAuth steps.
1577
- */
1578
- confirmOAuth(requestParameters: ConfirmOAuthRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<ConfirmOAuthResponse>;
1579
- /**
1580
- * For brokers with `isOAuth`, sessions can not be created using `AddSession`. This is how a session can be added for an OAuth-based login process: 1. use `prepareOAuthRedirect` to obtain a URL to redirect to. You can provide a `returnTo` URL which will be redirected to later. Note that a list of allowed URLs has to be configured for the client. 2. redirect the user\'s browser to the `redirectTo` URL 3. after the user has logged in at the broker\'s interface, a redirect to `returnTo` with the URL query parameters `verifysession=1`, `code` and `ticketId` will happen 4. the `returnTo` page must call `confirmOAuth` with the given `ticketId` and `code` to finally add the session to the user\'s account
1581
- */
1582
- prepareOAuthRedirectRaw(requestParameters: PrepareOAuthRedirectRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<PrepareOAuthRedirectResponse>>;
1583
- /**
1584
- * For brokers with `isOAuth`, sessions can not be created using `AddSession`. This is how a session can be added for an OAuth-based login process: 1. use `prepareOAuthRedirect` to obtain a URL to redirect to. You can provide a `returnTo` URL which will be redirected to later. Note that a list of allowed URLs has to be configured for the client. 2. redirect the user\'s browser to the `redirectTo` URL 3. after the user has logged in at the broker\'s interface, a redirect to `returnTo` with the URL query parameters `verifysession=1`, `code` and `ticketId` will happen 4. the `returnTo` page must call `confirmOAuth` with the given `ticketId` and `code` to finally add the session to the user\'s account
1585
- */
1586
- prepareOAuthRedirect(requestParameters: PrepareOAuthRedirectRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<PrepareOAuthRedirectResponse>;
1587
- }
1588
-
1589
1559
  /**
1590
1560
  * If a login form can be shown for the broker, describes the fields to show.
1591
1561
  * @export
@@ -1835,28 +1805,6 @@ declare interface CancelDecoupledOperationRequest {
1835
1805
  decoupledOperationId: string;
1836
1806
  }
1837
1807
 
1838
- /**
1839
- *
1840
- */
1841
- declare class CancelOrderApi extends runtime.BaseAPI {
1842
- /**
1843
- * Cancel the given order (or in the case of decoupled authMethods: send the order cancellation to the user for confirmation. In this case, a decoupledOperationId is returned).
1844
- */
1845
- cancelOrderRaw(requestParameters: CancelOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<CancelOrderResponse>>;
1846
- /**
1847
- * Cancel the given order (or in the case of decoupled authMethods: send the order cancellation to the user for confirmation. In this case, a decoupledOperationId is returned).
1848
- */
1849
- cancelOrder(requestParameters: CancelOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<CancelOrderResponse>;
1850
- /**
1851
- * If the user chose an auth method from `GetAuthInfo` with the flow `CHALLENGE_RESPONSE`, before cancelling an order, a challenge must be requested first. If any other flow is used, a challenge *must not* be requested and `CancelOrder` is used right away.
1852
- */
1853
- createCancelOrderChallengeRaw(requestParameters: CreateCancelOrderChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<Challenge>>;
1854
- /**
1855
- * If the user chose an auth method from `GetAuthInfo` with the flow `CHALLENGE_RESPONSE`, before cancelling an order, a challenge must be requested first. If any other flow is used, a challenge *must not* be requested and `CancelOrder` is used right away.
1856
- */
1857
- createCancelOrderChallenge(requestParameters: CreateCancelOrderChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<Challenge>;
1858
- }
1859
-
1860
1808
  /**
1861
1809
  * brokerize
1862
1810
  * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
@@ -2430,36 +2378,6 @@ declare function ChallengeToJSON(value?: Challenge | null): any;
2430
2378
 
2431
2379
  declare function ChallengeToJSONRecursive(value?: Challenge | null, ignoreParent?: boolean): any;
2432
2380
 
2433
- /**
2434
- *
2435
- */
2436
- declare class ChangeOrderApi extends runtime.BaseAPI {
2437
- /**
2438
- * Perform an order change.
2439
- */
2440
- changeOrderRaw(requestParameters: ChangeOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<ChangeOrderResponse>>;
2441
- /**
2442
- * Perform an order change.
2443
- */
2444
- changeOrder(requestParameters: ChangeOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<ChangeOrderResponse>;
2445
- /**
2446
- * If the user chose an auth method from `GetAuthInfo` with the flow `CHALLENGE_RESPONSE`, before changing an order, a challenge must be requested first. If any other flow is used, a challenge *must not* be requested and `ChangeOrder` is used right away.
2447
- */
2448
- createChangeOrderChallengeRaw(requestParameters: CreateChangeOrderChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<Challenge>>;
2449
- /**
2450
- * If the user chose an auth method from `GetAuthInfo` with the flow `CHALLENGE_RESPONSE`, before changing an order, a challenge must be requested first. If any other flow is used, a challenge *must not* be requested and `ChangeOrder` is used right away.
2451
- */
2452
- createChangeOrderChallenge(requestParameters: CreateChangeOrderChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<Challenge>;
2453
- /**
2454
- * Get an order cost estimation for an order change.
2455
- */
2456
- getChangeOrderCostEstimationRaw(requestParameters: GetChangeOrderCostEstimationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<OrderCostEstimation>>;
2457
- /**
2458
- * Get an order cost estimation for an order change.
2459
- */
2460
- getChangeOrderCostEstimation(requestParameters: GetChangeOrderCostEstimationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<OrderCostEstimation>;
2461
- }
2462
-
2463
2381
  /**
2464
2382
  *
2465
2383
  * @export
@@ -2573,6 +2491,48 @@ declare function ChangeOrderResponseToJSON(value?: ChangeOrderResponse | null):
2573
2491
 
2574
2492
  declare function ChangeOrderResponseToJSONRecursive(value?: ChangeOrderResponse | null, ignoreParent?: boolean): any;
2575
2493
 
2494
+ /**
2495
+ * brokerize
2496
+ * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
2497
+ *
2498
+ *
2499
+ *
2500
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2501
+ * https://openapi-generator.tech
2502
+ * Do not edit the class manually.
2503
+ */
2504
+ /**
2505
+ *
2506
+ * @export
2507
+ * @interface CheckRecoveryPhrase200Response
2508
+ */
2509
+ declare interface CheckRecoveryPhrase200Response {
2510
+ /**
2511
+ *
2512
+ * @type {Date}
2513
+ * @memberof CheckRecoveryPhrase200Response
2514
+ */
2515
+ expiresAt: Date;
2516
+ /**
2517
+ *
2518
+ * @type {string}
2519
+ * @memberof CheckRecoveryPhrase200Response
2520
+ */
2521
+ userId: string;
2522
+ }
2523
+
2524
+ declare function CheckRecoveryPhrase200ResponseFromJSON(json: any): CheckRecoveryPhrase200Response;
2525
+
2526
+ declare function CheckRecoveryPhrase200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CheckRecoveryPhrase200Response;
2527
+
2528
+ declare function CheckRecoveryPhrase200ResponseToJSON(value?: CheckRecoveryPhrase200Response | null): any;
2529
+
2530
+ declare function CheckRecoveryPhrase200ResponseToJSONRecursive(value?: CheckRecoveryPhrase200Response | null, ignoreParent?: boolean): any;
2531
+
2532
+ declare interface CheckRecoveryPhraseRequest {
2533
+ obtainTokenByRecoveryPhraseParams: ObtainTokenByRecoveryPhraseParams;
2534
+ }
2535
+
2576
2536
  /**
2577
2537
  * The client configuration as it appears in API endpoints.
2578
2538
  * @export
@@ -3807,6 +3767,75 @@ declare function CreateOrderParamsToJSON(value?: CreateOrderParams | null): any;
3807
3767
 
3808
3768
  declare function CreateOrderParamsToJSONRecursive(value?: CreateOrderParams | null, ignoreParent?: boolean): any;
3809
3769
 
3770
+ /**
3771
+ * brokerize
3772
+ * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
3773
+ *
3774
+ *
3775
+ *
3776
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
3777
+ * https://openapi-generator.tech
3778
+ * Do not edit the class manually.
3779
+ */
3780
+ /**
3781
+ *
3782
+ * @export
3783
+ * @interface CreateRecoveryPhraseParams
3784
+ */
3785
+ declare interface CreateRecoveryPhraseParams {
3786
+ /**
3787
+ * A name for the RecoveryPhrase. Must be unique for the user so that they can identify it in the list
3788
+ * of RecoveryPhrases.
3789
+ * @type {string}
3790
+ * @memberof CreateRecoveryPhraseParams
3791
+ */
3792
+ name: string;
3793
+ }
3794
+
3795
+ declare function CreateRecoveryPhraseParamsFromJSON(json: any): CreateRecoveryPhraseParams;
3796
+
3797
+ declare function CreateRecoveryPhraseParamsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateRecoveryPhraseParams;
3798
+
3799
+ declare function CreateRecoveryPhraseParamsToJSON(value?: CreateRecoveryPhraseParams | null): any;
3800
+
3801
+ declare function CreateRecoveryPhraseParamsToJSONRecursive(value?: CreateRecoveryPhraseParams | null, ignoreParent?: boolean): any;
3802
+
3803
+ declare interface CreateRecoveryPhraseRequest {
3804
+ createRecoveryPhraseParams: CreateRecoveryPhraseParams;
3805
+ }
3806
+
3807
+ /**
3808
+ * brokerize
3809
+ * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
3810
+ *
3811
+ *
3812
+ *
3813
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
3814
+ * https://openapi-generator.tech
3815
+ * Do not edit the class manually.
3816
+ */
3817
+ /**
3818
+ *
3819
+ * @export
3820
+ * @interface CreateRecoveryPhraseResult
3821
+ */
3822
+ declare interface CreateRecoveryPhraseResult {
3823
+ /**
3824
+ *
3825
+ * @type {string}
3826
+ * @memberof CreateRecoveryPhraseResult
3827
+ */
3828
+ recoveryPhrase: string;
3829
+ }
3830
+
3831
+ declare function CreateRecoveryPhraseResultFromJSON(json: any): CreateRecoveryPhraseResult;
3832
+
3833
+ declare function CreateRecoveryPhraseResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateRecoveryPhraseResult;
3834
+
3835
+ declare function CreateRecoveryPhraseResultToJSON(value?: CreateRecoveryPhraseResult | null): any;
3836
+
3837
+ declare function CreateRecoveryPhraseResultToJSONRecursive(value?: CreateRecoveryPhraseResult | null, ignoreParent?: boolean): any;
3838
+
3810
3839
  declare interface CreateSessionTanChallengeRequest {
3811
3840
  sessionId: string;
3812
3841
  createTanChallengeParams: CreateTanChallengeParams;
@@ -3932,6 +3961,24 @@ declare interface DeactivateTradeDraftRequest {
3932
3961
  id: string;
3933
3962
  }
3934
3963
 
3964
+ /**
3965
+ *
3966
+ */
3967
+ declare class DecoupledOperationsApi extends runtime.BaseAPI {
3968
+ /**
3969
+ */
3970
+ cancelDecoupledOperationRaw(requestParameters: CancelDecoupledOperationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
3971
+ /**
3972
+ */
3973
+ cancelDecoupledOperation(requestParameters: CancelDecoupledOperationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
3974
+ /**
3975
+ */
3976
+ getDecoupledOperationStatusRaw(requestParameters: GetDecoupledOperationStatusRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<DecoupledOperationStatus>>;
3977
+ /**
3978
+ */
3979
+ getDecoupledOperationStatus(requestParameters: GetDecoupledOperationStatusRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<DecoupledOperationStatus>;
3980
+ }
3981
+
3935
3982
  /**
3936
3983
  *
3937
3984
  * @export
@@ -4013,214 +4060,12 @@ declare type DecoupledOperationStatus_2 = {
4013
4060
 
4014
4061
  declare function DecoupledOperationStatusFromJSON(json: any): DecoupledOperationStatus;
4015
4062
 
4016
- declare function DecoupledOperationStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): DecoupledOperationStatus;
4017
-
4018
- declare function DecoupledOperationStatusToJSON(value?: DecoupledOperationStatus | null): any;
4019
-
4020
- declare function DecoupledOperationStatusToJSONRecursive(value?: DecoupledOperationStatus | null, ignoreParent?: boolean): any;
4021
-
4022
- /**
4023
- *
4024
- */
4025
- declare class DefaultApi extends runtime.BaseAPI {
4026
- /**
4027
- */
4028
- cancelDecoupledOperationRaw(requestParameters: CancelDecoupledOperationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
4029
- /**
4030
- */
4031
- cancelDecoupledOperation(requestParameters: CancelDecoupledOperationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
4032
- /**
4033
- * Cancel a decoupled operation. This is deprecated, use the new `CancelDecoupledOperation` instead (which does not require the sessionId anymore).
4034
- */
4035
- cancelDecoupledOperationLegacyRaw(requestParameters: CancelDecoupledOperationLegacyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
4036
- /**
4037
- * Cancel a decoupled operation. This is deprecated, use the new `CancelDecoupledOperation` instead (which does not require the sessionId anymore).
4038
- */
4039
- cancelDecoupledOperationLegacy(requestParameters: CancelDecoupledOperationLegacyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
4040
- /**
4041
- * Create a guest user and return a token which can be used to access resources. The lifetime of the generated temporary user as well as the returned `access_token` depend on the client configuration. It is usually around 24 hours. For some clients, tokens can be expired earlier based on inactivity. If the client has configured a longer lifetime for their guest users, a `refresh_token` is included in the response. This token can be used to renew the `access_token` after it has expired. The `refresh_token` can be used to obtain a new `access_token` after the original token has expired using the `/user/token` endpoint.
4042
- */
4043
- createGuestUserRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<CreateGuestUserResponse>>;
4044
- /**
4045
- * Create a guest user and return a token which can be used to access resources. The lifetime of the generated temporary user as well as the returned `access_token` depend on the client configuration. It is usually around 24 hours. For some clients, tokens can be expired earlier based on inactivity. If the client has configured a longer lifetime for their guest users, a `refresh_token` is included in the response. This token can be used to renew the `access_token` after it has expired. The `refresh_token` can be used to obtain a new `access_token` after the original token has expired using the `/user/token` endpoint.
4046
- */
4047
- createGuestUser(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<CreateGuestUserResponse>;
4048
- /**
4049
- * If the user chose an auth method from `GetAuthInfo` with the flow `CHALLENGE_RESPONSE`, before enabling session TAN, a challenge must be requested first.
4050
- */
4051
- createSessionTanChallengeRaw(requestParameters: CreateSessionTanChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<Challenge>>;
4052
- /**
4053
- * If the user chose an auth method from `GetAuthInfo` with the flow `CHALLENGE_RESPONSE`, before enabling session TAN, a challenge must be requested first.
4054
- */
4055
- createSessionTanChallenge(requestParameters: CreateSessionTanChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<Challenge>;
4056
- /**
4057
- * Delete the current user (only allowed if it is a guest account). Also logs out all active broker sessions attached to the user.
4058
- */
4059
- deleteGuestUserRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
4060
- /**
4061
- * Delete the current user (only allowed if it is a guest account). Also logs out all active broker sessions attached to the user.
4062
- */
4063
- deleteGuestUser(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
4064
- /**
4065
- */
4066
- deletePortfolioRaw(requestParameters: DeletePortfolioRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<OkResponseBody>>;
4067
- /**
4068
- */
4069
- deletePortfolio(requestParameters: DeletePortfolioRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<OkResponseBody>;
4070
- /**
4071
- */
4072
- enableSessionTanRaw(requestParameters: EnableSessionTanRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<EnableSessionTanResponse>>;
4073
- /**
4074
- */
4075
- enableSessionTan(requestParameters: EnableSessionTanRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<EnableSessionTanResponse>;
4076
- /**
4077
- * End Session TAN for the given broker session. If applicable, the broker may return a message with a confirmation code which can be looked up in the initial activation SMS. If message is present in the response, it should be displayed to the user.
4078
- */
4079
- endSessionTanRaw(requestParameters: EndSessionTanRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<EndSessionTanResponse>>;
4080
- /**
4081
- * End Session TAN for the given broker session. If applicable, the broker may return a message with a confirmation code which can be looked up in the initial activation SMS. If message is present in the response, it should be displayed to the user.
4082
- */
4083
- endSessionTan(requestParameters: EndSessionTanRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<EndSessionTanResponse>;
4084
- /**
4085
- * Get the AuthInfo for the given portfolio. If the portfolio does not have an online session, this will return a 400 status code. If it does, the response describes whether session TAN is available or active and which auth methods are available for the given portfolio (this information depends on the broker and the user\'s account settings). The response determines which of the following operations can be used and which are required to successfully perform an operation in a portfolio: - Session TAN handling (for performing other actions in portfolios without further per-case authorization) - [CreateSessionTanChallenge](#operation/CreateSessionTanChallenge) to request a challenge for s TAN activation. - [EnableSessionTan](#operation/EnableSessionTan) to enable the session TAN. - [EndSessionTan](#operation/EndSessionTan) to end the session TAN. - Create a trade - [PrepareTrade](#operation/PrepareTrade) to figure out how a given security can be traded in a portfolio. - [CreateTradeChallenge](#operation/CreateTradeChallenge) to (for example) request a TAN for a trade. - [CreateTrade](#operation/CreateTrade) to perform the trade. - Edit an order - [CreateChangeOrderChallenge](#operation/CreateChangeOrderChallenge) to request a challenge for an order change. - [ChangeOrder](#operation/ChangeOrder) to change an order. - Cancel an order - [CreateCancelOrderChallenge](#operation/CreateCancelOrderChallenge) to request a Challenge for an order cancellation. - [CancelOrder](#operation/CancelOrder) to cancel an order. The list of available AuthMethods should only be presented to the user if session TAN is not active (yet). The list and names are defined by our partner brokers. All auth methods are generally categorized using the `flow` attribute: | `flow` | requires challenge? | Description | | -------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `TAN` | no | the simplest flow: no challenge is required to perform the operation. the TAN is simply sent as parameter `tan` | | `CHALLENGE_RESPONSE` | yes | a challenge must be created using the `createXYZChallenge` operations and the challenge must be presented to the user. The user can then execute the action using the `challengeId` and `challengeResponse` parameters. If the auth method has `challengeResponseIsOnlyConfirmation=true`, that challengeResponse is always an empty string and users do not enter a TAN. Otherwise, a text field labelled with `tanFieldLabel` must be displayed where the user enteirs their challengeResponse. | | `DECOUPLED` | no | the operation is executed without any TAN, but returns a `decoupledOperationId` which can be used to read the action\'s status. Users will authorize the action in another frontend (usually in their broker\'s app). Note that currently `DECOUPLED` auth methods only work for enabling session TAN. | - If `sessionTanActive` is `true`: Session TAN has been enabled for the session that currently backs the portfolio. In this case, all operations like `CreateTrade` can be executed right away without an `authMethod`. The UI should *not* show a dropdown with the auth methods in this case. - If `sessionTanActive` is `false` but `sessionTanSupported` is `true`: the user can enable session TAN using `CreateSessionTanChallenge` / `EnableSessionTan`. - If `allOperationsRequireSessionTan` is `true`, the auth methods can *ONLY* be used for enabling session TAN. - Otherwise, the `authMethods` can be used to perform individual operations. | sessionTanActive | sessionTanSupported | allOperationsRequireSessionTan | Description | | ---------------- | ------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `true` | `true` | - | Session TAN has been enabled for the session that currently backs the portfolio. In this case, all operations like `CreateTrade`, `ChangeOrder`, `CancelOrder` can be executed right away without an `authMethod`. The UI should _not_ show a dropdown with the auth methods in this case. | | `false` | `true` | `true` | the user can enable session TAN using the provided auth methods via `CreateSessionTanChallenge` / `EnableSessionTan`. All other operations can only take place after session TAN has been enabled. | | `false` | `true` | `false` | the user can enable any operation (enable session tan, create trade, cancel order, change order) using the provided auth methods | Note that it is possible that brokers only reveal all details about the available auth methods *TOGETHER* with the first `GetChallenge` request. This special behavior can be simulated with our demo broker when the flag `lazyAuthMethods=true` is specified upon creation of a demo account. In those accounts, the `GetAuthInfo` endpoint will initially return a single \"placeholder\" method with `{flow: \"CHALLENGE_RESPONSE\", isDefaultMethod: true, ...}`. In the situation where there is *exactly one* auth method like this, frontends may immediately request the challenge for the desired operation without waiting for the user to click the get challenge button (for Session TAN, this means that as soon as the user opens the dialog for enabling session TAN, `CreateSessionTanChallenge` can be called). In the case described here, `AuthInfo` will be populated with the actual list of auth methods when the create challenge request returns (also, the corresponding WebSocket event is published to notify about this change). `GetAuthInfo` must be called again in this case and repopulate the corresponding frontend (e.g. the name of the auth method will become available etc.). So what is done in this case is: request a challenge for the *unknown* default method in order to get both a challenge and an update of the auth methods. Note that usually challenges have effects like an SMS or some broker app notification for the end user, so it is important to keep the requested challenge info, *even when auth info is refreshed*. For example, if there is a select box with the auth method list, that box must keep its selected `id` while updating the now-available `label`. This way, the user can use the first requested challenge, as the frontend will still be in the right state.
4086
- */
4087
- getAuthInfoRaw(requestParameters: GetAuthInfoRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetAuthInfoResponse>>;
4088
- /**
4089
- * Get the AuthInfo for the given portfolio. If the portfolio does not have an online session, this will return a 400 status code. If it does, the response describes whether session TAN is available or active and which auth methods are available for the given portfolio (this information depends on the broker and the user\'s account settings). The response determines which of the following operations can be used and which are required to successfully perform an operation in a portfolio: - Session TAN handling (for performing other actions in portfolios without further per-case authorization) - [CreateSessionTanChallenge](#operation/CreateSessionTanChallenge) to request a challenge for s TAN activation. - [EnableSessionTan](#operation/EnableSessionTan) to enable the session TAN. - [EndSessionTan](#operation/EndSessionTan) to end the session TAN. - Create a trade - [PrepareTrade](#operation/PrepareTrade) to figure out how a given security can be traded in a portfolio. - [CreateTradeChallenge](#operation/CreateTradeChallenge) to (for example) request a TAN for a trade. - [CreateTrade](#operation/CreateTrade) to perform the trade. - Edit an order - [CreateChangeOrderChallenge](#operation/CreateChangeOrderChallenge) to request a challenge for an order change. - [ChangeOrder](#operation/ChangeOrder) to change an order. - Cancel an order - [CreateCancelOrderChallenge](#operation/CreateCancelOrderChallenge) to request a Challenge for an order cancellation. - [CancelOrder](#operation/CancelOrder) to cancel an order. The list of available AuthMethods should only be presented to the user if session TAN is not active (yet). The list and names are defined by our partner brokers. All auth methods are generally categorized using the `flow` attribute: | `flow` | requires challenge? | Description | | -------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `TAN` | no | the simplest flow: no challenge is required to perform the operation. the TAN is simply sent as parameter `tan` | | `CHALLENGE_RESPONSE` | yes | a challenge must be created using the `createXYZChallenge` operations and the challenge must be presented to the user. The user can then execute the action using the `challengeId` and `challengeResponse` parameters. If the auth method has `challengeResponseIsOnlyConfirmation=true`, that challengeResponse is always an empty string and users do not enter a TAN. Otherwise, a text field labelled with `tanFieldLabel` must be displayed where the user enteirs their challengeResponse. | | `DECOUPLED` | no | the operation is executed without any TAN, but returns a `decoupledOperationId` which can be used to read the action\'s status. Users will authorize the action in another frontend (usually in their broker\'s app). Note that currently `DECOUPLED` auth methods only work for enabling session TAN. | - If `sessionTanActive` is `true`: Session TAN has been enabled for the session that currently backs the portfolio. In this case, all operations like `CreateTrade` can be executed right away without an `authMethod`. The UI should *not* show a dropdown with the auth methods in this case. - If `sessionTanActive` is `false` but `sessionTanSupported` is `true`: the user can enable session TAN using `CreateSessionTanChallenge` / `EnableSessionTan`. - If `allOperationsRequireSessionTan` is `true`, the auth methods can *ONLY* be used for enabling session TAN. - Otherwise, the `authMethods` can be used to perform individual operations. | sessionTanActive | sessionTanSupported | allOperationsRequireSessionTan | Description | | ---------------- | ------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `true` | `true` | - | Session TAN has been enabled for the session that currently backs the portfolio. In this case, all operations like `CreateTrade`, `ChangeOrder`, `CancelOrder` can be executed right away without an `authMethod`. The UI should _not_ show a dropdown with the auth methods in this case. | | `false` | `true` | `true` | the user can enable session TAN using the provided auth methods via `CreateSessionTanChallenge` / `EnableSessionTan`. All other operations can only take place after session TAN has been enabled. | | `false` | `true` | `false` | the user can enable any operation (enable session tan, create trade, cancel order, change order) using the provided auth methods | Note that it is possible that brokers only reveal all details about the available auth methods *TOGETHER* with the first `GetChallenge` request. This special behavior can be simulated with our demo broker when the flag `lazyAuthMethods=true` is specified upon creation of a demo account. In those accounts, the `GetAuthInfo` endpoint will initially return a single \"placeholder\" method with `{flow: \"CHALLENGE_RESPONSE\", isDefaultMethod: true, ...}`. In the situation where there is *exactly one* auth method like this, frontends may immediately request the challenge for the desired operation without waiting for the user to click the get challenge button (for Session TAN, this means that as soon as the user opens the dialog for enabling session TAN, `CreateSessionTanChallenge` can be called). In the case described here, `AuthInfo` will be populated with the actual list of auth methods when the create challenge request returns (also, the corresponding WebSocket event is published to notify about this change). `GetAuthInfo` must be called again in this case and repopulate the corresponding frontend (e.g. the name of the auth method will become available etc.). So what is done in this case is: request a challenge for the *unknown* default method in order to get both a challenge and an update of the auth methods. Note that usually challenges have effects like an SMS or some broker app notification for the end user, so it is important to keep the requested challenge info, *even when auth info is refreshed*. For example, if there is a select box with the auth method list, that box must keep its selected `id` while updating the now-available `label`. This way, the user can use the first requested challenge, as the frontend will still be in the right state.
4090
- */
4091
- getAuthInfo(requestParameters: GetAuthInfoRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetAuthInfoResponse>;
4092
- /**
4093
- */
4094
- getDecoupledOperationStatusRaw(requestParameters: GetDecoupledOperationStatusRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<DecoupledOperationStatus>>;
4095
- /**
4096
- */
4097
- getDecoupledOperationStatus(requestParameters: GetDecoupledOperationStatusRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<DecoupledOperationStatus>;
4098
- /**
4099
- * Get the status of a decoupled operation. This is deprecated, use the new `GetDecoupledOperation` instead, which does not require the `sessionId` any more.
4100
- */
4101
- getDecoupledOperationStatusLegacyRaw(requestParameters: GetDecoupledOperationStatusLegacyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<DecoupledOperationStatus>>;
4102
- /**
4103
- * Get the status of a decoupled operation. This is deprecated, use the new `GetDecoupledOperation` instead, which does not require the `sessionId` any more.
4104
- */
4105
- getDecoupledOperationStatusLegacy(requestParameters: GetDecoupledOperationStatusLegacyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<DecoupledOperationStatus>;
4106
- /**
4107
- */
4108
- getOrderRaw(requestParameters: GetOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetOrderResponse>>;
4109
- /**
4110
- */
4111
- getOrder(requestParameters: GetOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetOrderResponse>;
4112
- /**
4113
- * Retrieve \"by-day\" aggregated values for the selected date ranges.
4114
- */
4115
- getPortfolioCalendarRaw(requestParameters: GetPortfolioCalendarRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioCalendarResponse>>;
4116
- /**
4117
- * Retrieve \"by-day\" aggregated values for the selected date ranges.
4118
- */
4119
- getPortfolioCalendar(requestParameters: GetPortfolioCalendarRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioCalendarResponse>;
4120
- /**
4121
- */
4122
- getPortfolioOrdersRaw(requestParameters: GetPortfolioOrdersRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioOrdersResponse>>;
4123
- /**
4124
- */
4125
- getPortfolioOrders(requestParameters: GetPortfolioOrdersRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioOrdersResponse>;
4126
- /**
4127
- */
4128
- getPortfolioPositionsRaw(requestParameters: GetPortfolioPositionsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioPositionsResponse>>;
4129
- /**
4130
- */
4131
- getPortfolioPositions(requestParameters: GetPortfolioPositionsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioPositionsResponse>;
4132
- /**
4133
- */
4134
- getPortfolioQuotesRaw(requestParameters: GetPortfolioQuotesRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioQuotesResponse>>;
4135
- /**
4136
- */
4137
- getPortfolioQuotes(requestParameters: GetPortfolioQuotesRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioQuotesResponse>;
4138
- /**
4139
- * Load statistics based on the trade list for selected date ranges. The statistics (such as `longestWinningStreak` or `tradeCount`) are computed for each of the requested date ranges.
4140
- */
4141
- getPortfolioTradeStatisticsRaw(requestParameters: GetPortfolioTradeStatisticsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioTradeStatisticsResponse>>;
4142
- /**
4143
- * Load statistics based on the trade list for selected date ranges. The statistics (such as `longestWinningStreak` or `tradeCount`) are computed for each of the requested date ranges.
4144
- */
4145
- getPortfolioTradeStatistics(requestParameters: GetPortfolioTradeStatisticsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioTradeStatisticsResponse>;
4146
- /**
4147
- */
4148
- getPortfolioTradeWarningsRaw(requestParameters: GetPortfolioTradeWarningsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<Array<TradeWarning>>>;
4149
- /**
4150
- */
4151
- getPortfolioTradeWarnings(requestParameters: GetPortfolioTradeWarningsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<Array<TradeWarning>>;
4152
- /**
4153
- * Load a list of completed trades in a portfolio. A completed trade corresponds to *one* closing of a position. Technically each closing of a position corresponds to one execution of an order with `intent=close` (usually those are sell orders, but in the case of short selling, opening a position is a sell order with intent=open). The analysis follows the FIFO (First In, First Out) principle to accurately summarize trades. Each time a position is closed (note that partial executions are possible. In this case, each individual execution is regarded as a transaction), the system identifies the earliest corresponding \"open position execution\" that contributed to that closing. The result includes a single entry for each closing transaction, detailing key metrics such as profit/loss and holding period, based on the matched opening transactions. This could be a real world example: - 2020-01-01: buy 5 stock1 for 100 USD each - 2021-06-01: buy 3 stock1 for 200 USD each - 2021-06-06: sell 6 stock1 for 300 USD each In this case, the result would be one completed trade (corresponding to the last sell) with a profit of `(300*6)-(100*5+1*200)=1800-700=1100 USD`. There is an open position remaining (2 units of stock1, which correspond to the second buy transaction). When we add this sell: - 2021-06-07: sell 2 stock1 for 400 USD each It would add a second complete trade with a profit of `(400*2)-(200*2)=800-400=400 USD`. For some brokers, the order history may be incomplete (e.g. only reveals the latest 90 days), so that we do not know if there could be older transactions. Thus, our implementation might detect (given the current set of open positions together with the list of order executions) that we cannot figure out the corresponding opening transactions for a closing transaction. Affected trades will be ignored for this analysis and might appear as warning items in the `/warnings` endpoint. Frontends should show those warnings so that users can understand why the analysis is incomplete.
4154
- */
4155
- getPortfolioTradesRaw(requestParameters: GetPortfolioTradesRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioTradesResponse>>;
4156
- /**
4157
- * Load a list of completed trades in a portfolio. A completed trade corresponds to *one* closing of a position. Technically each closing of a position corresponds to one execution of an order with `intent=close` (usually those are sell orders, but in the case of short selling, opening a position is a sell order with intent=open). The analysis follows the FIFO (First In, First Out) principle to accurately summarize trades. Each time a position is closed (note that partial executions are possible. In this case, each individual execution is regarded as a transaction), the system identifies the earliest corresponding \"open position execution\" that contributed to that closing. The result includes a single entry for each closing transaction, detailing key metrics such as profit/loss and holding period, based on the matched opening transactions. This could be a real world example: - 2020-01-01: buy 5 stock1 for 100 USD each - 2021-06-01: buy 3 stock1 for 200 USD each - 2021-06-06: sell 6 stock1 for 300 USD each In this case, the result would be one completed trade (corresponding to the last sell) with a profit of `(300*6)-(100*5+1*200)=1800-700=1100 USD`. There is an open position remaining (2 units of stock1, which correspond to the second buy transaction). When we add this sell: - 2021-06-07: sell 2 stock1 for 400 USD each It would add a second complete trade with a profit of `(400*2)-(200*2)=800-400=400 USD`. For some brokers, the order history may be incomplete (e.g. only reveals the latest 90 days), so that we do not know if there could be older transactions. Thus, our implementation might detect (given the current set of open positions together with the list of order executions) that we cannot figure out the corresponding opening transactions for a closing transaction. Affected trades will be ignored for this analysis and might appear as warning items in the `/warnings` endpoint. Frontends should show those warnings so that users can understand why the analysis is incomplete.
4158
- */
4159
- getPortfolioTrades(requestParameters: GetPortfolioTradesRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioTradesResponse>;
4160
- /**
4161
- */
4162
- getPortfoliosRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<PortfoliosResponse>>;
4163
- /**
4164
- */
4165
- getPortfolios(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<PortfoliosResponse>;
4166
- /**
4167
- * Get the currently active broker sessions of the user\'s account.
4168
- */
4169
- getSessionsRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<SessionResponse>>;
4170
- /**
4171
- * Get the currently active broker sessions of the user\'s account.
4172
- */
4173
- getSessions(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<SessionResponse>;
4174
- /**
4175
- * Checks the provided authentication and returns the logged-in user.
4176
- */
4177
- getUserRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetUserResponse>>;
4178
- /**
4179
- * Checks the provided authentication and returns the logged-in user.
4180
- */
4181
- getUser(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetUserResponse>;
4182
- /**
4183
- * Log out from the given broker session.
4184
- */
4185
- logoutSessionRaw(requestParameters: LogoutSessionRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<LogoutOkResponseBody>>;
4186
- /**
4187
- * Log out from the given broker session.
4188
- */
4189
- logoutSession(requestParameters: LogoutSessionRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<LogoutOkResponseBody>;
4190
- /**
4191
- * Obtain a new access token using a refresh token as specified in https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.4. If `CreateGuestUser` has provided a `refresh_token`, this endpoint may be used to obtain a new `access_token` after the original token has expired.
4192
- */
4193
- obtainTokenRaw(requestParameters: ObtainTokenRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<TokenResponse>>;
4194
- /**
4195
- * Obtain a new access token using a refresh token as specified in https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.4. If `CreateGuestUser` has provided a `refresh_token`, this endpoint may be used to obtain a new `access_token` after the original token has expired.
4196
- */
4197
- obtainToken(requestParameters: ObtainTokenRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<TokenResponse>;
4198
- /**
4199
- * This endpoint can be used to rename the display name of a specified portfolio. To restore the original portfolio name, send a rename request with an empty string as the new name. **Note**: This does not change the original portfolio name at your broker.
4200
- */
4201
- renamePortfolioRaw(requestParameters: RenamePortfolioOperationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
4202
- /**
4203
- * This endpoint can be used to rename the display name of a specified portfolio. To restore the original portfolio name, send a rename request with an empty string as the new name. **Note**: This does not change the original portfolio name at your broker.
4204
- */
4205
- renamePortfolio(requestParameters: RenamePortfolioOperationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
4206
- /**
4207
- * Trigger a background sync process for the given broker session. This means that a sync will be scheduled as soon as possible. All data related to the portfolio (e.g. positions and orders) will be loaded into the brokerize database.
4208
- */
4209
- triggerSessionSyncRaw(requestParameters: TriggerSessionSyncRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<OkResponseBody>>;
4210
- /**
4211
- * Trigger a background sync process for the given broker session. This means that a sync will be scheduled as soon as possible. All data related to the portfolio (e.g. positions and orders) will be loaded into the brokerize database.
4212
- */
4213
- triggerSessionSync(requestParameters: TriggerSessionSyncRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<OkResponseBody>;
4214
- /**
4215
- * Most operations at brokerize have asynchronous effects. For example, consider the flow of an order: when the user creates an order, it will not immediately appear in order list endpoints, because usually brokers take a few seconds until they are retrievable in those lists. Also, after a while, the order may be executed or cancelled asynchronously by the stock exchange. A common solution for frontends would be to reload the order list regularly. However data is then either delayed or there will be many more requests than needed. The brokerize websocket endpoint allows getting updates via web sockets. Generally speaking, clients can subscribe by assigning a subscription id and will then receive updates on that subscription. In this documentation, ⬆️ denotes messages from the client to the server, whereas messages from server to client are marked with ⬇️. ## authentication When using cookies for authorization, the WebSocket connection is authenticated with the HTTP upgrade request. If token headers are used, the _first_ message from client to server must be: ``` ⬆️ { \"cmd\": \"authorize\", \"idToken\": <string> } ``` In all cases, clients must wait for the welcome message before sending other messages: ``` ⬇️ { \"cmd\": \"authenticated\" } ``` ## ping After 1 minute of inactivity of a client, the WebSocket connection will be considered stale and will automatically terminated. To prevent this, a ping message can be sent: ``` ⬆️ {\"cmd\": \"ping\"} ``` The server also sends this message regularly. If no message has been received on a WebSocket connection for more than 1 minute, it should be terminated by the client. ``` ⬇️ {\"cmd\": \"ping\"} ``` ## subscriptions Subscriptions can be used to get invalidate events or updates for selected resources. ### invalidate subscriptions Invalidation events can be used for the frontend to know when reload requests via the HTTP endpoints are appropriate. Currently only invalidate events can be subscribed, the actual data must then be reloaded using the HTTP endpoints. To set up a subscription for an invalidate event, use: ``` ⬆️ { \"cmd\": \"subscribe\", \"type\": \"invalidate\", \"subscriptionId\": 1, \"entity: \"brokersessions\" /_* \"positions\" | \"orders\" *_/, \"portfolioId\": 42 /_* required for \"positions\" or \"orders\" *_/ } ``` If the subscription failed to be set up on the server, an error will be sent for the subscription. This also automatically ends the subscription on the server side: ``` ⬇️ { \"subscriptionId\": 1, \"error\": { \"message\": \"Could not set up invalidation event due to...\" } } ``` If an invalid `subscriptionId` is provided (or the subscription id is already in use by the connection), an error like this will be sent: ``` ⬇️ { \"error\": { \"message\": \"Could not add subscription due to invalid subscriptionId\" } } ``` ⚠️ _the connection will then be terminated immediately_. If the subscription is sucessfuly set up, whenever an invalidation happens, the server will send a message like this: ``` ⬇️ { \"cmd\": \"invalidate\", \"subscriptionId\": 1 } ``` When that invalidation event is received, the client should reload the data using the corresponding endpoints. Clients can end their subscription with the `unsubscribe` command: ``` ⬆️ { \"cmd\": \"unsubscribe\", \"subscriptionId\": 1 } ``` ### subscribe to the state of a decoupled operation For decoupled operations (e.g. authorizing a session TAN using a second factor device), the state of the operation can be subscribed: ``` ⬆️ { \"cmd\": \"subscribe\", \"type\": \"decoupledOperationStatus\", \"subscriptionId\": 1, \"sessionId\": string, \"decoupledOperationId\": string } ``` Error handling as well as unsubscribing works as described for invalidate subscriptions. Example message from the server for updating the state: ``` ⬇️ { \"cmd\": \"updateDecoupledOperationStatus\", \"subscriptionId\": number, \"state\": <DecoupledOperationStatus> } ```
4216
- */
4217
- websocketRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
4218
- /**
4219
- * Most operations at brokerize have asynchronous effects. For example, consider the flow of an order: when the user creates an order, it will not immediately appear in order list endpoints, because usually brokers take a few seconds until they are retrievable in those lists. Also, after a while, the order may be executed or cancelled asynchronously by the stock exchange. A common solution for frontends would be to reload the order list regularly. However data is then either delayed or there will be many more requests than needed. The brokerize websocket endpoint allows getting updates via web sockets. Generally speaking, clients can subscribe by assigning a subscription id and will then receive updates on that subscription. In this documentation, ⬆️ denotes messages from the client to the server, whereas messages from server to client are marked with ⬇️. ## authentication When using cookies for authorization, the WebSocket connection is authenticated with the HTTP upgrade request. If token headers are used, the _first_ message from client to server must be: ``` ⬆️ { \"cmd\": \"authorize\", \"idToken\": <string> } ``` In all cases, clients must wait for the welcome message before sending other messages: ``` ⬇️ { \"cmd\": \"authenticated\" } ``` ## ping After 1 minute of inactivity of a client, the WebSocket connection will be considered stale and will automatically terminated. To prevent this, a ping message can be sent: ``` ⬆️ {\"cmd\": \"ping\"} ``` The server also sends this message regularly. If no message has been received on a WebSocket connection for more than 1 minute, it should be terminated by the client. ``` ⬇️ {\"cmd\": \"ping\"} ``` ## subscriptions Subscriptions can be used to get invalidate events or updates for selected resources. ### invalidate subscriptions Invalidation events can be used for the frontend to know when reload requests via the HTTP endpoints are appropriate. Currently only invalidate events can be subscribed, the actual data must then be reloaded using the HTTP endpoints. To set up a subscription for an invalidate event, use: ``` ⬆️ { \"cmd\": \"subscribe\", \"type\": \"invalidate\", \"subscriptionId\": 1, \"entity: \"brokersessions\" /_* \"positions\" | \"orders\" *_/, \"portfolioId\": 42 /_* required for \"positions\" or \"orders\" *_/ } ``` If the subscription failed to be set up on the server, an error will be sent for the subscription. This also automatically ends the subscription on the server side: ``` ⬇️ { \"subscriptionId\": 1, \"error\": { \"message\": \"Could not set up invalidation event due to...\" } } ``` If an invalid `subscriptionId` is provided (or the subscription id is already in use by the connection), an error like this will be sent: ``` ⬇️ { \"error\": { \"message\": \"Could not add subscription due to invalid subscriptionId\" } } ``` ⚠️ _the connection will then be terminated immediately_. If the subscription is sucessfuly set up, whenever an invalidation happens, the server will send a message like this: ``` ⬇️ { \"cmd\": \"invalidate\", \"subscriptionId\": 1 } ``` When that invalidation event is received, the client should reload the data using the corresponding endpoints. Clients can end their subscription with the `unsubscribe` command: ``` ⬆️ { \"cmd\": \"unsubscribe\", \"subscriptionId\": 1 } ``` ### subscribe to the state of a decoupled operation For decoupled operations (e.g. authorizing a session TAN using a second factor device), the state of the operation can be subscribed: ``` ⬆️ { \"cmd\": \"subscribe\", \"type\": \"decoupledOperationStatus\", \"subscriptionId\": 1, \"sessionId\": string, \"decoupledOperationId\": string } ``` Error handling as well as unsubscribing works as described for invalidate subscriptions. Example message from the server for updating the state: ``` ⬇️ { \"cmd\": \"updateDecoupledOperationStatus\", \"subscriptionId\": number, \"state\": <DecoupledOperationStatus> } ```
4220
- */
4221
- websocket(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
4222
- }
4223
-
4063
+ declare function DecoupledOperationStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): DecoupledOperationStatus;
4064
+
4065
+ declare function DecoupledOperationStatusToJSON(value?: DecoupledOperationStatus | null): any;
4066
+
4067
+ declare function DecoupledOperationStatusToJSONRecursive(value?: DecoupledOperationStatus | null, ignoreParent?: boolean): any;
4068
+
4224
4069
  declare const DefaultConfig: Configuration;
4225
4070
 
4226
4071
  /**
@@ -4323,6 +4168,10 @@ declare interface DeletePortfolioRequest {
4323
4168
  portfolioId: string;
4324
4169
  }
4325
4170
 
4171
+ declare interface DeleteRecoveryPhraseRequest {
4172
+ recoveryPhraseId: string;
4173
+ }
4174
+
4326
4175
  declare interface DeleteTradeDraftRequest {
4327
4176
  id: string;
4328
4177
  }
@@ -4454,11 +4303,11 @@ declare function DemoAccountToJSONRecursive(value?: DemoAccount | null, ignorePa
4454
4303
  */
4455
4304
  declare class DemobrokerApi extends runtime.BaseAPI {
4456
4305
  /**
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. - ISIN DE0006969603 (Puma SE) - one exchange with all orderModels - orders stay open forever - `allowsChangeValidityTypes` is empty, so it is not possible to change the order validity - `changesHaveCostEstimations=false`, so it is not possible to receive cost estimations for order changes) - 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.
4306
+ * 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 simulates different market scenarios for various ISINs (e.g., partial executions, error cases, or specific cost structures). A complete overview of these test ISINs and their behavior can be found in the guide [Demo Broker Test Scenarios](https://developer.brokerize.com/docs/demobroker-isins). 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.
4458
4307
  */
4459
4308
  createDemoAccountRaw(requestParameters: CreateDemoAccountRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<CreatedResponseBody>>;
4460
4309
  /**
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. - ISIN DE0006969603 (Puma SE) - one exchange with all orderModels - orders stay open forever - `allowsChangeValidityTypes` is empty, so it is not possible to change the order validity - `changesHaveCostEstimations=false`, so it is not possible to receive cost estimations for order changes) - 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.
4310
+ * 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 simulates different market scenarios for various ISINs (e.g., partial executions, error cases, or specific cost structures). A complete overview of these test ISINs and their behavior can be found in the guide [Demo Broker Test Scenarios](https://developer.brokerize.com/docs/demobroker-isins). 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.
4462
4311
  */
4463
4312
  createDemoAccount(requestParameters?: CreateDemoAccountRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<CreatedResponseBody>;
4464
4313
  /**
@@ -7158,6 +7007,28 @@ declare function GetQuoteResponseToJSON(value?: GetQuoteResponse | null): any;
7158
7007
 
7159
7008
  declare function GetQuoteResponseToJSONRecursive(value?: GetQuoteResponse | null, ignoreParent?: boolean): any;
7160
7009
 
7010
+ /**
7011
+ *
7012
+ * @export
7013
+ * @interface GetRecoveryPhrasesResponse
7014
+ */
7015
+ declare interface GetRecoveryPhrasesResponse {
7016
+ /**
7017
+ *
7018
+ * @type {Array<RecoveryPhraseItem>}
7019
+ * @memberof GetRecoveryPhrasesResponse
7020
+ */
7021
+ recoveryPhrases: Array<RecoveryPhraseItem>;
7022
+ }
7023
+
7024
+ declare function GetRecoveryPhrasesResponseFromJSON(json: any): GetRecoveryPhrasesResponse;
7025
+
7026
+ declare function GetRecoveryPhrasesResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRecoveryPhrasesResponse;
7027
+
7028
+ declare function GetRecoveryPhrasesResponseToJSON(value?: GetRecoveryPhrasesResponse | null): any;
7029
+
7030
+ declare function GetRecoveryPhrasesResponseToJSONRecursive(value?: GetRecoveryPhrasesResponse | null, ignoreParent?: boolean): any;
7031
+
7161
7032
  declare interface GetSecurityDetailedInfoRequest {
7162
7033
  token: string;
7163
7034
  }
@@ -7998,7 +7869,10 @@ declare namespace Models {
7998
7869
  TradeStatistics,
7999
7870
  GetPortfolioCalendarResponse,
8000
7871
  PortfolioCalendarDateRange,
8001
- PortfolioCalendarItem
7872
+ PortfolioCalendarItem,
7873
+ GetRecoveryPhrasesResponse,
7874
+ CreateRecoveryPhraseResult,
7875
+ CheckRecoveryPhrase200Response
8002
7876
  }
8003
7877
  }
8004
7878
  export { Models }
@@ -8081,6 +7955,42 @@ declare function OAuthLoginFormConfigToJSON(value?: OAuthLoginFormConfig | null)
8081
7955
 
8082
7956
  declare function OAuthLoginFormConfigToJSONRecursive(value?: OAuthLoginFormConfig | null, ignoreParent?: boolean): any;
8083
7957
 
7958
+ /**
7959
+ * brokerize
7960
+ * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
7961
+ *
7962
+ *
7963
+ *
7964
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7965
+ * https://openapi-generator.tech
7966
+ * Do not edit the class manually.
7967
+ */
7968
+ /**
7969
+ *
7970
+ * @export
7971
+ * @interface ObtainTokenByRecoveryPhraseParams
7972
+ */
7973
+ declare interface ObtainTokenByRecoveryPhraseParams {
7974
+ /**
7975
+ *
7976
+ * @type {string}
7977
+ * @memberof ObtainTokenByRecoveryPhraseParams
7978
+ */
7979
+ recoveryPhrase: string;
7980
+ }
7981
+
7982
+ declare function ObtainTokenByRecoveryPhraseParamsFromJSON(json: any): ObtainTokenByRecoveryPhraseParams;
7983
+
7984
+ declare function ObtainTokenByRecoveryPhraseParamsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ObtainTokenByRecoveryPhraseParams;
7985
+
7986
+ declare function ObtainTokenByRecoveryPhraseParamsToJSON(value?: ObtainTokenByRecoveryPhraseParams | null): any;
7987
+
7988
+ declare function ObtainTokenByRecoveryPhraseParamsToJSONRecursive(value?: ObtainTokenByRecoveryPhraseParams | null, ignoreParent?: boolean): any;
7989
+
7990
+ declare interface ObtainTokenByRecoveryPhraseRequest {
7991
+ obtainTokenByRecoveryPhraseParams: ObtainTokenByRecoveryPhraseParams;
7992
+ }
7993
+
8084
7994
  declare interface ObtainTokenRequest {
8085
7995
  grantType: string;
8086
7996
  refreshToken: string;
@@ -8162,28 +8072,26 @@ declare namespace openApiClient {
8162
8072
  SetClientConfigOperationRequest,
8163
8073
  AdminApi,
8164
8074
  GetOrderReportFormatEnum,
8165
- AddSessionRequest,
8166
- AddSessionCompleteChallengeRequest,
8167
- ConfirmOAuthRequest,
8168
- PrepareOAuthRedirectRequest,
8169
- BrokerLoginApi,
8075
+ CancelDecoupledOperationRequest,
8076
+ GetDecoupledOperationStatusRequest,
8077
+ DecoupledOperationsApi,
8078
+ CreateDemoAccountRequest,
8079
+ DeleteDemoAccountRequest,
8080
+ TriggerDemoSessionSyncErrorRequest,
8081
+ DemobrokerApi,
8082
+ RenderGenericTableRequest,
8083
+ ExportApi,
8084
+ GetPagesConfigurationRequest,
8085
+ MetaApi,
8170
8086
  CancelOrderRequest,
8171
- CreateCancelOrderChallengeRequest,
8172
- CancelOrderApi,
8173
8087
  ChangeOrderRequest,
8088
+ CreateCancelOrderChallengeRequest,
8174
8089
  CreateChangeOrderChallengeRequest,
8175
8090
  GetChangeOrderCostEstimationRequest,
8176
- ChangeOrderApi,
8177
- CancelDecoupledOperationRequest,
8178
- CancelDecoupledOperationLegacyRequest,
8179
- CreateSessionTanChallengeRequest,
8091
+ GetOrderRequest,
8092
+ OrderApi,
8180
8093
  DeletePortfolioRequest,
8181
- EnableSessionTanRequest,
8182
- EndSessionTanRequest,
8183
8094
  GetAuthInfoRequest,
8184
- GetDecoupledOperationStatusRequest,
8185
- GetDecoupledOperationStatusLegacyRequest,
8186
- GetOrderRequest,
8187
8095
  GetPortfolioCalendarRequest,
8188
8096
  GetPortfolioOrdersRequest,
8189
8097
  GetPortfolioPositionsRequest,
@@ -8191,22 +8099,23 @@ declare namespace openApiClient {
8191
8099
  GetPortfolioTradeStatisticsRequest,
8192
8100
  GetPortfolioTradeWarningsRequest,
8193
8101
  GetPortfolioTradesRequest,
8194
- LogoutSessionRequest,
8195
- ObtainTokenRequest,
8196
8102
  RenamePortfolioOperationRequest,
8197
- TriggerSessionSyncRequest,
8198
- DefaultApi,
8199
- CreateDemoAccountRequest,
8200
- DeleteDemoAccountRequest,
8201
- TriggerDemoSessionSyncErrorRequest,
8202
- DemobrokerApi,
8203
- RenderGenericTableRequest,
8204
- ExportApi,
8205
- GetPagesConfigurationRequest,
8206
- MetaApi,
8103
+ PortfolioApi,
8207
8104
  GetSecurityQuotesRequest,
8208
8105
  GetSecurityQuotesMetaRequest,
8209
8106
  SecuritiesApi,
8107
+ AddSessionRequest,
8108
+ AddSessionCompleteChallengeRequest,
8109
+ CancelDecoupledOperationLegacyRequest,
8110
+ ConfirmOAuthRequest,
8111
+ CreateSessionTanChallengeRequest,
8112
+ EnableSessionTanRequest,
8113
+ EndSessionTanRequest,
8114
+ GetDecoupledOperationStatusLegacyRequest,
8115
+ LogoutSessionRequest,
8116
+ PrepareOAuthRedirectRequest,
8117
+ TriggerSessionSyncRequest,
8118
+ SessionApi,
8210
8119
  CreateTradeRequest,
8211
8120
  CreateTradeChallengeRequest,
8212
8121
  GetAvailableOrderIntentsRequest,
@@ -8221,9 +8130,15 @@ declare namespace openApiClient {
8221
8130
  GetTradeDraftsRequest,
8222
8131
  UpdateTradeDraftRequest,
8223
8132
  TradeDraftApi,
8133
+ CheckRecoveryPhraseRequest,
8224
8134
  CreateAccessTokenRequest,
8135
+ CreateRecoveryPhraseRequest,
8136
+ DeleteRecoveryPhraseRequest,
8137
+ ObtainTokenRequest,
8138
+ ObtainTokenByRecoveryPhraseRequest,
8225
8139
  RevokeAccessTokenRequest,
8226
8140
  UserApi,
8141
+ WebsocketApi,
8227
8142
  AccessTokenItemFromJSON,
8228
8143
  AccessTokenItemFromJSONTyped,
8229
8144
  AccessTokenItemToJSONRecursive,
@@ -8460,6 +8375,11 @@ declare namespace openApiClient {
8460
8375
  ChangeOrderResponseToJSONRecursive,
8461
8376
  ChangeOrderResponseToJSON,
8462
8377
  ChangeOrderResponse,
8378
+ CheckRecoveryPhrase200ResponseFromJSON,
8379
+ CheckRecoveryPhrase200ResponseFromJSONTyped,
8380
+ CheckRecoveryPhrase200ResponseToJSONRecursive,
8381
+ CheckRecoveryPhrase200ResponseToJSON,
8382
+ CheckRecoveryPhrase200Response,
8463
8383
  ClientConfigFromJSON,
8464
8384
  ClientConfigFromJSONTyped,
8465
8385
  ClientConfigToJSONRecursive,
@@ -8559,6 +8479,16 @@ declare namespace openApiClient {
8559
8479
  CreateOrderParamsToJSONRecursive,
8560
8480
  CreateOrderParamsToJSON,
8561
8481
  CreateOrderParams,
8482
+ CreateRecoveryPhraseParamsFromJSON,
8483
+ CreateRecoveryPhraseParamsFromJSONTyped,
8484
+ CreateRecoveryPhraseParamsToJSONRecursive,
8485
+ CreateRecoveryPhraseParamsToJSON,
8486
+ CreateRecoveryPhraseParams,
8487
+ CreateRecoveryPhraseResultFromJSON,
8488
+ CreateRecoveryPhraseResultFromJSONTyped,
8489
+ CreateRecoveryPhraseResultToJSONRecursive,
8490
+ CreateRecoveryPhraseResultToJSON,
8491
+ CreateRecoveryPhraseResult,
8562
8492
  CreateTanChallengeParamsFromJSON,
8563
8493
  CreateTanChallengeParamsFromJSONTyped,
8564
8494
  CreateTanChallengeParamsToJSONRecursive,
@@ -8962,6 +8892,11 @@ declare namespace openApiClient {
8962
8892
  GetQuoteResponseToJSONRecursive,
8963
8893
  GetQuoteResponseToJSON,
8964
8894
  GetQuoteResponse,
8895
+ GetRecoveryPhrasesResponseFromJSON,
8896
+ GetRecoveryPhrasesResponseFromJSONTyped,
8897
+ GetRecoveryPhrasesResponseToJSONRecursive,
8898
+ GetRecoveryPhrasesResponseToJSON,
8899
+ GetRecoveryPhrasesResponse,
8965
8900
  GetUserResponseFromJSON,
8966
8901
  GetUserResponseFromJSONTyped,
8967
8902
  GetUserResponseToJSONRecursive,
@@ -9045,6 +8980,11 @@ declare namespace openApiClient {
9045
8980
  OAuthLoginFormConfig,
9046
8981
  OAuthLoginFormConfigRedirectStyleEnum,
9047
8982
  OAuthLoginFormConfigRedirectStyleBitpandaEnum,
8983
+ ObtainTokenByRecoveryPhraseParamsFromJSON,
8984
+ ObtainTokenByRecoveryPhraseParamsFromJSONTyped,
8985
+ ObtainTokenByRecoveryPhraseParamsToJSONRecursive,
8986
+ ObtainTokenByRecoveryPhraseParamsToJSON,
8987
+ ObtainTokenByRecoveryPhraseParams,
9048
8988
  OkResponseBodyFromJSON,
9049
8989
  OkResponseBodyFromJSONTyped,
9050
8990
  OkResponseBodyToJSONRecursive,
@@ -9253,6 +9193,11 @@ declare namespace openApiClient {
9253
9193
  QuoteExpirationToJSONRecursive,
9254
9194
  QuoteExpirationToJSON,
9255
9195
  QuoteExpiration,
9196
+ RecoveryPhraseItemFromJSON,
9197
+ RecoveryPhraseItemFromJSONTyped,
9198
+ RecoveryPhraseItemToJSONRecursive,
9199
+ RecoveryPhraseItemToJSON,
9200
+ RecoveryPhraseItem,
9256
9201
  RenamePortfolioRequestFromJSON,
9257
9202
  RenamePortfolioRequestFromJSONTyped,
9258
9203
  RenamePortfolioRequestToJSONRecursive,
@@ -9865,6 +9810,58 @@ declare interface Order {
9865
9810
  validity?: OrderValidity;
9866
9811
  }
9867
9812
 
9813
+ /**
9814
+ *
9815
+ */
9816
+ declare class OrderApi extends runtime.BaseAPI {
9817
+ /**
9818
+ * Cancel the given order (or in the case of decoupled authMethods: send the order cancellation to the user for confirmation. In this case, a decoupledOperationId is returned).
9819
+ */
9820
+ cancelOrderRaw(requestParameters: CancelOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<CancelOrderResponse>>;
9821
+ /**
9822
+ * Cancel the given order (or in the case of decoupled authMethods: send the order cancellation to the user for confirmation. In this case, a decoupledOperationId is returned).
9823
+ */
9824
+ cancelOrder(requestParameters: CancelOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<CancelOrderResponse>;
9825
+ /**
9826
+ * Perform an order change.
9827
+ */
9828
+ changeOrderRaw(requestParameters: ChangeOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<ChangeOrderResponse>>;
9829
+ /**
9830
+ * Perform an order change.
9831
+ */
9832
+ changeOrder(requestParameters: ChangeOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<ChangeOrderResponse>;
9833
+ /**
9834
+ * If the user chose an auth method from `GetAuthInfo` with the flow `CHALLENGE_RESPONSE`, before cancelling an order, a challenge must be requested first. If any other flow is used, a challenge *must not* be requested and `CancelOrder` is used right away.
9835
+ */
9836
+ createCancelOrderChallengeRaw(requestParameters: CreateCancelOrderChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<Challenge>>;
9837
+ /**
9838
+ * If the user chose an auth method from `GetAuthInfo` with the flow `CHALLENGE_RESPONSE`, before cancelling an order, a challenge must be requested first. If any other flow is used, a challenge *must not* be requested and `CancelOrder` is used right away.
9839
+ */
9840
+ createCancelOrderChallenge(requestParameters: CreateCancelOrderChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<Challenge>;
9841
+ /**
9842
+ * If the user chose an auth method from `GetAuthInfo` with the flow `CHALLENGE_RESPONSE`, before changing an order, a challenge must be requested first. If any other flow is used, a challenge *must not* be requested and `ChangeOrder` is used right away.
9843
+ */
9844
+ createChangeOrderChallengeRaw(requestParameters: CreateChangeOrderChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<Challenge>>;
9845
+ /**
9846
+ * If the user chose an auth method from `GetAuthInfo` with the flow `CHALLENGE_RESPONSE`, before changing an order, a challenge must be requested first. If any other flow is used, a challenge *must not* be requested and `ChangeOrder` is used right away.
9847
+ */
9848
+ createChangeOrderChallenge(requestParameters: CreateChangeOrderChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<Challenge>;
9849
+ /**
9850
+ * Get an order cost estimation for an order change.
9851
+ */
9852
+ getChangeOrderCostEstimationRaw(requestParameters: GetChangeOrderCostEstimationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<OrderCostEstimation>>;
9853
+ /**
9854
+ * Get an order cost estimation for an order change.
9855
+ */
9856
+ getChangeOrderCostEstimation(requestParameters: GetChangeOrderCostEstimationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<OrderCostEstimation>;
9857
+ /**
9858
+ */
9859
+ getOrderRaw(requestParameters: GetOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetOrderResponse>>;
9860
+ /**
9861
+ */
9862
+ getOrder(requestParameters: GetOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetOrderResponse>;
9863
+ }
9864
+
9868
9865
  /**
9869
9866
  *
9870
9867
  * @export
@@ -10705,58 +10702,140 @@ declare interface Portfolio {
10705
10702
  */
10706
10703
  cashAccountIds: Array<string>;
10707
10704
  /**
10708
- * - ISO code (e.g. EUR for Euro), if it is a monetary amount
10709
- * - or 'USDT' if its Tether (https://en.wikipedia.org/wiki/Tether_(cryptocurrency)
10710
- * - or 'XXX' if it is pieces
10711
- * - or 'PRC' if it is a percentage
10712
- * - or 'PRM' if it is permil
10713
- * - or 'XXP' if it is points (as for indices)
10714
- * - or 'GRAMS' if it is grams (as for precious metals)
10715
- * @type {string}
10716
- * @memberof Portfolio
10705
+ * - ISO code (e.g. EUR for Euro), if it is a monetary amount
10706
+ * - or 'USDT' if its Tether (https://en.wikipedia.org/wiki/Tether_(cryptocurrency)
10707
+ * - or 'XXX' if it is pieces
10708
+ * - or 'PRC' if it is a percentage
10709
+ * - or 'PRM' if it is permil
10710
+ * - or 'XXP' if it is points (as for indices)
10711
+ * - or 'GRAMS' if it is grams (as for precious metals)
10712
+ * @type {string}
10713
+ * @memberof Portfolio
10714
+ */
10715
+ currency: string;
10716
+ /**
10717
+ *
10718
+ * @type {string}
10719
+ * @memberof Portfolio
10720
+ */
10721
+ id: string;
10722
+ /**
10723
+ * A portfolio idHash is a unique identifier used to represent a portfolio within a user account. The idHash is automatically generated based on the original broker id of the portfolio,
10724
+ * meaning that if a portfolio is synchronized into a new user account, it will usually retain the same idHash as in the old account (although it will be assigned a new globally unique id).
10725
+ * When applications use temporary or guest user accounts, it makes sense to use the idHash instead of the id to implement features like "last used portfolio" etc. This is because the idHash remains
10726
+ * the same even if the portfolio is synchronized into a new user account, whereas a new id will be assigned.
10727
+ *
10728
+ * It's important to note that the `idHash` is unique within a user account, meaning that no two portfolios within the same account can have the same idHash.
10729
+ * @type {string}
10730
+ * @memberof Portfolio
10731
+ */
10732
+ idHash: string;
10733
+ /**
10734
+ *
10735
+ * @type {string}
10736
+ * @memberof Portfolio
10737
+ */
10738
+ portfolioName: string;
10739
+ /**
10740
+ *
10741
+ * @type {string}
10742
+ * @memberof Portfolio
10743
+ */
10744
+ portfolioNameOriginal: string;
10745
+ /**
10746
+ *
10747
+ * @type {Array<string>}
10748
+ * @memberof Portfolio
10749
+ */
10750
+ sessionIds: Array<string>;
10751
+ /**
10752
+ *
10753
+ * @type {PortfolioSyncInfo}
10754
+ * @memberof Portfolio
10755
+ */
10756
+ syncInfo: PortfolioSyncInfo;
10757
+ }
10758
+
10759
+ /**
10760
+ *
10761
+ */
10762
+ declare class PortfolioApi extends runtime.BaseAPI {
10763
+ /**
10764
+ */
10765
+ deletePortfolioRaw(requestParameters: DeletePortfolioRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<OkResponseBody>>;
10766
+ /**
10767
+ */
10768
+ deletePortfolio(requestParameters: DeletePortfolioRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<OkResponseBody>;
10769
+ /**
10770
+ * Get the AuthInfo for the given portfolio. If the portfolio does not have an online session, this will return a 400 status code. If it does, the response describes whether session TAN is available or active and which auth methods are available for the given portfolio (this information depends on the broker and the user\'s account settings). The response determines which of the following operations can be used and which are required to successfully perform an operation in a portfolio: - Session TAN handling (for performing other actions in portfolios without further per-case authorization) - [CreateSessionTanChallenge](#operation/CreateSessionTanChallenge) to request a challenge for s TAN activation. - [EnableSessionTan](#operation/EnableSessionTan) to enable the session TAN. - [EndSessionTan](#operation/EndSessionTan) to end the session TAN. - Create a trade - [PrepareTrade](#operation/PrepareTrade) to figure out how a given security can be traded in a portfolio. - [CreateTradeChallenge](#operation/CreateTradeChallenge) to (for example) request a TAN for a trade. - [CreateTrade](#operation/CreateTrade) to perform the trade. - Edit an order - [CreateChangeOrderChallenge](#operation/CreateChangeOrderChallenge) to request a challenge for an order change. - [ChangeOrder](#operation/ChangeOrder) to change an order. - Cancel an order - [CreateCancelOrderChallenge](#operation/CreateCancelOrderChallenge) to request a Challenge for an order cancellation. - [CancelOrder](#operation/CancelOrder) to cancel an order. The list of available AuthMethods should only be presented to the user if session TAN is not active (yet). The list and names are defined by our partner brokers. All auth methods are generally categorized using the `flow` attribute: | `flow` | requires challenge? | Description | | -------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `TAN` | no | the simplest flow: no challenge is required to perform the operation. the TAN is simply sent as parameter `tan` | | `CHALLENGE_RESPONSE` | yes | a challenge must be created using the `createXYZChallenge` operations and the challenge must be presented to the user. The user can then execute the action using the `challengeId` and `challengeResponse` parameters. If the auth method has `challengeResponseIsOnlyConfirmation=true`, that challengeResponse is always an empty string and users do not enter a TAN. Otherwise, a text field labelled with `tanFieldLabel` must be displayed where the user enteirs their challengeResponse. | | `DECOUPLED` | no | the operation is executed without any TAN, but returns a `decoupledOperationId` which can be used to read the action\'s status. Users will authorize the action in another frontend (usually in their broker\'s app). Note that currently `DECOUPLED` auth methods only work for enabling session TAN. | - If `sessionTanActive` is `true`: Session TAN has been enabled for the session that currently backs the portfolio. In this case, all operations like `CreateTrade` can be executed right away without an `authMethod`. The UI should *not* show a dropdown with the auth methods in this case. - If `sessionTanActive` is `false` but `sessionTanSupported` is `true`: the user can enable session TAN using `CreateSessionTanChallenge` / `EnableSessionTan`. - If `allOperationsRequireSessionTan` is `true`, the auth methods can *ONLY* be used for enabling session TAN. - Otherwise, the `authMethods` can be used to perform individual operations. | sessionTanActive | sessionTanSupported | allOperationsRequireSessionTan | Description | | ---------------- | ------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `true` | `true` | - | Session TAN has been enabled for the session that currently backs the portfolio. In this case, all operations like `CreateTrade`, `ChangeOrder`, `CancelOrder` can be executed right away without an `authMethod`. The UI should _not_ show a dropdown with the auth methods in this case. | | `false` | `true` | `true` | the user can enable session TAN using the provided auth methods via `CreateSessionTanChallenge` / `EnableSessionTan`. All other operations can only take place after session TAN has been enabled. | | `false` | `true` | `false` | the user can enable any operation (enable session tan, create trade, cancel order, change order) using the provided auth methods | Note that it is possible that brokers only reveal all details about the available auth methods *TOGETHER* with the first `GetChallenge` request. This special behavior can be simulated with our demo broker when the flag `lazyAuthMethods=true` is specified upon creation of a demo account. In those accounts, the `GetAuthInfo` endpoint will initially return a single \"placeholder\" method with `{flow: \"CHALLENGE_RESPONSE\", isDefaultMethod: true, ...}`. In the situation where there is *exactly one* auth method like this, frontends may immediately request the challenge for the desired operation without waiting for the user to click the get challenge button (for Session TAN, this means that as soon as the user opens the dialog for enabling session TAN, `CreateSessionTanChallenge` can be called). In the case described here, `AuthInfo` will be populated with the actual list of auth methods when the create challenge request returns (also, the corresponding WebSocket event is published to notify about this change). `GetAuthInfo` must be called again in this case and repopulate the corresponding frontend (e.g. the name of the auth method will become available etc.). So what is done in this case is: request a challenge for the *unknown* default method in order to get both a challenge and an update of the auth methods. Note that usually challenges have effects like an SMS or some broker app notification for the end user, so it is important to keep the requested challenge info, *even when auth info is refreshed*. For example, if there is a select box with the auth method list, that box must keep its selected `id` while updating the now-available `label`. This way, the user can use the first requested challenge, as the frontend will still be in the right state.
10771
+ */
10772
+ getAuthInfoRaw(requestParameters: GetAuthInfoRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetAuthInfoResponse>>;
10773
+ /**
10774
+ * Get the AuthInfo for the given portfolio. If the portfolio does not have an online session, this will return a 400 status code. If it does, the response describes whether session TAN is available or active and which auth methods are available for the given portfolio (this information depends on the broker and the user\'s account settings). The response determines which of the following operations can be used and which are required to successfully perform an operation in a portfolio: - Session TAN handling (for performing other actions in portfolios without further per-case authorization) - [CreateSessionTanChallenge](#operation/CreateSessionTanChallenge) to request a challenge for s TAN activation. - [EnableSessionTan](#operation/EnableSessionTan) to enable the session TAN. - [EndSessionTan](#operation/EndSessionTan) to end the session TAN. - Create a trade - [PrepareTrade](#operation/PrepareTrade) to figure out how a given security can be traded in a portfolio. - [CreateTradeChallenge](#operation/CreateTradeChallenge) to (for example) request a TAN for a trade. - [CreateTrade](#operation/CreateTrade) to perform the trade. - Edit an order - [CreateChangeOrderChallenge](#operation/CreateChangeOrderChallenge) to request a challenge for an order change. - [ChangeOrder](#operation/ChangeOrder) to change an order. - Cancel an order - [CreateCancelOrderChallenge](#operation/CreateCancelOrderChallenge) to request a Challenge for an order cancellation. - [CancelOrder](#operation/CancelOrder) to cancel an order. The list of available AuthMethods should only be presented to the user if session TAN is not active (yet). The list and names are defined by our partner brokers. All auth methods are generally categorized using the `flow` attribute: | `flow` | requires challenge? | Description | | -------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `TAN` | no | the simplest flow: no challenge is required to perform the operation. the TAN is simply sent as parameter `tan` | | `CHALLENGE_RESPONSE` | yes | a challenge must be created using the `createXYZChallenge` operations and the challenge must be presented to the user. The user can then execute the action using the `challengeId` and `challengeResponse` parameters. If the auth method has `challengeResponseIsOnlyConfirmation=true`, that challengeResponse is always an empty string and users do not enter a TAN. Otherwise, a text field labelled with `tanFieldLabel` must be displayed where the user enteirs their challengeResponse. | | `DECOUPLED` | no | the operation is executed without any TAN, but returns a `decoupledOperationId` which can be used to read the action\'s status. Users will authorize the action in another frontend (usually in their broker\'s app). Note that currently `DECOUPLED` auth methods only work for enabling session TAN. | - If `sessionTanActive` is `true`: Session TAN has been enabled for the session that currently backs the portfolio. In this case, all operations like `CreateTrade` can be executed right away without an `authMethod`. The UI should *not* show a dropdown with the auth methods in this case. - If `sessionTanActive` is `false` but `sessionTanSupported` is `true`: the user can enable session TAN using `CreateSessionTanChallenge` / `EnableSessionTan`. - If `allOperationsRequireSessionTan` is `true`, the auth methods can *ONLY* be used for enabling session TAN. - Otherwise, the `authMethods` can be used to perform individual operations. | sessionTanActive | sessionTanSupported | allOperationsRequireSessionTan | Description | | ---------------- | ------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `true` | `true` | - | Session TAN has been enabled for the session that currently backs the portfolio. In this case, all operations like `CreateTrade`, `ChangeOrder`, `CancelOrder` can be executed right away without an `authMethod`. The UI should _not_ show a dropdown with the auth methods in this case. | | `false` | `true` | `true` | the user can enable session TAN using the provided auth methods via `CreateSessionTanChallenge` / `EnableSessionTan`. All other operations can only take place after session TAN has been enabled. | | `false` | `true` | `false` | the user can enable any operation (enable session tan, create trade, cancel order, change order) using the provided auth methods | Note that it is possible that brokers only reveal all details about the available auth methods *TOGETHER* with the first `GetChallenge` request. This special behavior can be simulated with our demo broker when the flag `lazyAuthMethods=true` is specified upon creation of a demo account. In those accounts, the `GetAuthInfo` endpoint will initially return a single \"placeholder\" method with `{flow: \"CHALLENGE_RESPONSE\", isDefaultMethod: true, ...}`. In the situation where there is *exactly one* auth method like this, frontends may immediately request the challenge for the desired operation without waiting for the user to click the get challenge button (for Session TAN, this means that as soon as the user opens the dialog for enabling session TAN, `CreateSessionTanChallenge` can be called). In the case described here, `AuthInfo` will be populated with the actual list of auth methods when the create challenge request returns (also, the corresponding WebSocket event is published to notify about this change). `GetAuthInfo` must be called again in this case and repopulate the corresponding frontend (e.g. the name of the auth method will become available etc.). So what is done in this case is: request a challenge for the *unknown* default method in order to get both a challenge and an update of the auth methods. Note that usually challenges have effects like an SMS or some broker app notification for the end user, so it is important to keep the requested challenge info, *even when auth info is refreshed*. For example, if there is a select box with the auth method list, that box must keep its selected `id` while updating the now-available `label`. This way, the user can use the first requested challenge, as the frontend will still be in the right state.
10775
+ */
10776
+ getAuthInfo(requestParameters: GetAuthInfoRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetAuthInfoResponse>;
10777
+ /**
10778
+ * Retrieve \"by-day\" aggregated values for the selected date ranges.
10779
+ */
10780
+ getPortfolioCalendarRaw(requestParameters: GetPortfolioCalendarRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioCalendarResponse>>;
10781
+ /**
10782
+ * Retrieve \"by-day\" aggregated values for the selected date ranges.
10783
+ */
10784
+ getPortfolioCalendar(requestParameters: GetPortfolioCalendarRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioCalendarResponse>;
10785
+ /**
10786
+ */
10787
+ getPortfolioOrdersRaw(requestParameters: GetPortfolioOrdersRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioOrdersResponse>>;
10788
+ /**
10789
+ */
10790
+ getPortfolioOrders(requestParameters: GetPortfolioOrdersRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioOrdersResponse>;
10791
+ /**
10792
+ */
10793
+ getPortfolioPositionsRaw(requestParameters: GetPortfolioPositionsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioPositionsResponse>>;
10794
+ /**
10795
+ */
10796
+ getPortfolioPositions(requestParameters: GetPortfolioPositionsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioPositionsResponse>;
10797
+ /**
10798
+ */
10799
+ getPortfolioQuotesRaw(requestParameters: GetPortfolioQuotesRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioQuotesResponse>>;
10800
+ /**
10801
+ */
10802
+ getPortfolioQuotes(requestParameters: GetPortfolioQuotesRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioQuotesResponse>;
10803
+ /**
10804
+ * Load statistics based on the trade list for selected date ranges. The statistics (such as `longestWinningStreak` or `tradeCount`) are computed for each of the requested date ranges.
10805
+ */
10806
+ getPortfolioTradeStatisticsRaw(requestParameters: GetPortfolioTradeStatisticsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioTradeStatisticsResponse>>;
10807
+ /**
10808
+ * Load statistics based on the trade list for selected date ranges. The statistics (such as `longestWinningStreak` or `tradeCount`) are computed for each of the requested date ranges.
10809
+ */
10810
+ getPortfolioTradeStatistics(requestParameters: GetPortfolioTradeStatisticsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioTradeStatisticsResponse>;
10811
+ /**
10812
+ */
10813
+ getPortfolioTradeWarningsRaw(requestParameters: GetPortfolioTradeWarningsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<Array<TradeWarning>>>;
10814
+ /**
10717
10815
  */
10718
- currency: string;
10816
+ getPortfolioTradeWarnings(requestParameters: GetPortfolioTradeWarningsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<Array<TradeWarning>>;
10719
10817
  /**
10720
- *
10721
- * @type {string}
10722
- * @memberof Portfolio
10818
+ * Load a list of completed trades in a portfolio. A completed trade corresponds to *one* closing of a position. Technically each closing of a position corresponds to one execution of an order with `intent=close` (usually those are sell orders, but in the case of short selling, opening a position is a sell order with intent=open). The analysis follows the FIFO (First In, First Out) principle to accurately summarize trades. Each time a position is closed (note that partial executions are possible. In this case, each individual execution is regarded as a transaction), the system identifies the earliest corresponding \"open position execution\" that contributed to that closing. The result includes a single entry for each closing transaction, detailing key metrics such as profit/loss and holding period, based on the matched opening transactions. This could be a real world example: - 2020-01-01: buy 5 stock1 for 100 USD each - 2021-06-01: buy 3 stock1 for 200 USD each - 2021-06-06: sell 6 stock1 for 300 USD each In this case, the result would be one completed trade (corresponding to the last sell) with a profit of `(300*6)-(100*5+1*200)=1800-700=1100 USD`. There is an open position remaining (2 units of stock1, which correspond to the second buy transaction). When we add this sell: - 2021-06-07: sell 2 stock1 for 400 USD each It would add a second complete trade with a profit of `(400*2)-(200*2)=800-400=400 USD`. For some brokers, the order history may be incomplete (e.g. only reveals the latest 90 days), so that we do not know if there could be older transactions. Thus, our implementation might detect (given the current set of open positions together with the list of order executions) that we cannot figure out the corresponding opening transactions for a closing transaction. Affected trades will be ignored for this analysis and might appear as warning items in the `/warnings` endpoint. Frontends should show those warnings so that users can understand why the analysis is incomplete.
10723
10819
  */
10724
- id: string;
10820
+ getPortfolioTradesRaw(requestParameters: GetPortfolioTradesRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioTradesResponse>>;
10725
10821
  /**
10726
- * A portfolio idHash is a unique identifier used to represent a portfolio within a user account. The idHash is automatically generated based on the original broker id of the portfolio,
10727
- * meaning that if a portfolio is synchronized into a new user account, it will usually retain the same idHash as in the old account (although it will be assigned a new globally unique id).
10728
- * When applications use temporary or guest user accounts, it makes sense to use the idHash instead of the id to implement features like "last used portfolio" etc. This is because the idHash remains
10729
- * the same even if the portfolio is synchronized into a new user account, whereas a new id will be assigned.
10730
- *
10731
- * It's important to note that the `idHash` is unique within a user account, meaning that no two portfolios within the same account can have the same idHash.
10732
- * @type {string}
10733
- * @memberof Portfolio
10822
+ * Load a list of completed trades in a portfolio. A completed trade corresponds to *one* closing of a position. Technically each closing of a position corresponds to one execution of an order with `intent=close` (usually those are sell orders, but in the case of short selling, opening a position is a sell order with intent=open). The analysis follows the FIFO (First In, First Out) principle to accurately summarize trades. Each time a position is closed (note that partial executions are possible. In this case, each individual execution is regarded as a transaction), the system identifies the earliest corresponding \"open position execution\" that contributed to that closing. The result includes a single entry for each closing transaction, detailing key metrics such as profit/loss and holding period, based on the matched opening transactions. This could be a real world example: - 2020-01-01: buy 5 stock1 for 100 USD each - 2021-06-01: buy 3 stock1 for 200 USD each - 2021-06-06: sell 6 stock1 for 300 USD each In this case, the result would be one completed trade (corresponding to the last sell) with a profit of `(300*6)-(100*5+1*200)=1800-700=1100 USD`. There is an open position remaining (2 units of stock1, which correspond to the second buy transaction). When we add this sell: - 2021-06-07: sell 2 stock1 for 400 USD each It would add a second complete trade with a profit of `(400*2)-(200*2)=800-400=400 USD`. For some brokers, the order history may be incomplete (e.g. only reveals the latest 90 days), so that we do not know if there could be older transactions. Thus, our implementation might detect (given the current set of open positions together with the list of order executions) that we cannot figure out the corresponding opening transactions for a closing transaction. Affected trades will be ignored for this analysis and might appear as warning items in the `/warnings` endpoint. Frontends should show those warnings so that users can understand why the analysis is incomplete.
10734
10823
  */
10735
- idHash: string;
10824
+ getPortfolioTrades(requestParameters: GetPortfolioTradesRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioTradesResponse>;
10736
10825
  /**
10737
- *
10738
- * @type {string}
10739
- * @memberof Portfolio
10740
10826
  */
10741
- portfolioName: string;
10827
+ getPortfoliosRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<PortfoliosResponse>>;
10742
10828
  /**
10743
- *
10744
- * @type {string}
10745
- * @memberof Portfolio
10746
10829
  */
10747
- portfolioNameOriginal: string;
10830
+ getPortfolios(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<PortfoliosResponse>;
10748
10831
  /**
10749
- *
10750
- * @type {Array<string>}
10751
- * @memberof Portfolio
10832
+ * This endpoint can be used to rename the display name of a specified portfolio. To restore the original portfolio name, send a rename request with an empty string as the new name. **Note**: This does not change the original portfolio name at your broker.
10752
10833
  */
10753
- sessionIds: Array<string>;
10834
+ renamePortfolioRaw(requestParameters: RenamePortfolioOperationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
10754
10835
  /**
10755
- *
10756
- * @type {PortfolioSyncInfo}
10757
- * @memberof Portfolio
10836
+ * This endpoint can be used to rename the display name of a specified portfolio. To restore the original portfolio name, send a rename request with an empty string as the new name. **Note**: This does not change the original portfolio name at your broker.
10758
10837
  */
10759
- syncInfo: PortfolioSyncInfo;
10838
+ renamePortfolio(requestParameters: RenamePortfolioOperationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
10760
10839
  }
10761
10840
 
10762
10841
  /**
@@ -11923,6 +12002,62 @@ declare function QuoteExpirationToJSON(value?: QuoteExpiration | null): any;
11923
12002
 
11924
12003
  declare function QuoteExpirationToJSONRecursive(value?: QuoteExpiration | null, ignoreParent?: boolean): any;
11925
12004
 
12005
+ /**
12006
+ * brokerize
12007
+ * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
12008
+ *
12009
+ *
12010
+ *
12011
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12012
+ * https://openapi-generator.tech
12013
+ * Do not edit the class manually.
12014
+ */
12015
+ /**
12016
+ *
12017
+ * @export
12018
+ * @interface RecoveryPhraseItem
12019
+ */
12020
+ declare interface RecoveryPhraseItem {
12021
+ /**
12022
+ *
12023
+ * @type {Date}
12024
+ * @memberof RecoveryPhraseItem
12025
+ */
12026
+ createdAt: Date;
12027
+ /**
12028
+ *
12029
+ * @type {Date}
12030
+ * @memberof RecoveryPhraseItem
12031
+ */
12032
+ expiresAt: Date;
12033
+ /**
12034
+ *
12035
+ * @type {string}
12036
+ * @memberof RecoveryPhraseItem
12037
+ */
12038
+ id: string;
12039
+ /**
12040
+ *
12041
+ * @type {Date}
12042
+ * @memberof RecoveryPhraseItem
12043
+ */
12044
+ lastUsedAt: Date;
12045
+ /**
12046
+ *
12047
+ * @type {string}
12048
+ * @memberof RecoveryPhraseItem
12049
+ */
12050
+ name: string;
12051
+ }
12052
+
12053
+ declare function RecoveryPhraseItemFromJSON(json: any): RecoveryPhraseItem;
12054
+
12055
+ declare function RecoveryPhraseItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecoveryPhraseItem;
12056
+
12057
+ declare function RecoveryPhraseItemToJSON(value?: RecoveryPhraseItem | null): any;
12058
+
12059
+ declare function RecoveryPhraseItemToJSONRecursive(value?: RecoveryPhraseItem | null, ignoreParent?: boolean): any;
12060
+
11926
12061
  declare type ReferrerPolicy_2 = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
11927
12062
 
11928
12063
  export declare type RegisteredUserAuthContextConfiguration = {
@@ -12714,6 +12849,104 @@ declare interface Session {
12714
12849
  syncInfo: SessionSyncInfo;
12715
12850
  }
12716
12851
 
12852
+ /**
12853
+ *
12854
+ */
12855
+ declare class SessionApi extends runtime.BaseAPI {
12856
+ /**
12857
+ */
12858
+ addSessionRaw(requestParameters: AddSessionRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<LoginResponse>>;
12859
+ /**
12860
+ */
12861
+ addSession(requestParameters: AddSessionRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<LoginResponse>;
12862
+ /**
12863
+ * If login returns the state `challenge`, the login must be completed by providing a challenge response first.
12864
+ */
12865
+ addSessionCompleteChallengeRaw(requestParameters: AddSessionCompleteChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<LoginResponseReady>>;
12866
+ /**
12867
+ * If login returns the state `challenge`, the login must be completed by providing a challenge response first.
12868
+ */
12869
+ addSessionCompleteChallenge(requestParameters: AddSessionCompleteChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<LoginResponseReady>;
12870
+ /**
12871
+ * Cancel a decoupled operation. This is deprecated, use the new `CancelDecoupledOperation` instead (which does not require the sessionId anymore).
12872
+ */
12873
+ cancelDecoupledOperationLegacyRaw(requestParameters: CancelDecoupledOperationLegacyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
12874
+ /**
12875
+ * Cancel a decoupled operation. This is deprecated, use the new `CancelDecoupledOperation` instead (which does not require the sessionId anymore).
12876
+ */
12877
+ cancelDecoupledOperationLegacy(requestParameters: CancelDecoupledOperationLegacyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
12878
+ /**
12879
+ * For brokers with OAuth login processes, this adds the session to the user\'s account after redirects happen. Only the user that is redirected from the broker login in the browser will receive the `code`. This step ensures that the logged-in user at brokerize is actually the one that has gone through the broker OAuth steps.
12880
+ */
12881
+ confirmOAuthRaw(requestParameters: ConfirmOAuthRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<ConfirmOAuthResponse>>;
12882
+ /**
12883
+ * For brokers with OAuth login processes, this adds the session to the user\'s account after redirects happen. Only the user that is redirected from the broker login in the browser will receive the `code`. This step ensures that the logged-in user at brokerize is actually the one that has gone through the broker OAuth steps.
12884
+ */
12885
+ confirmOAuth(requestParameters: ConfirmOAuthRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<ConfirmOAuthResponse>;
12886
+ /**
12887
+ * If the user chose an auth method from `GetAuthInfo` with the flow `CHALLENGE_RESPONSE`, before enabling session TAN, a challenge must be requested first.
12888
+ */
12889
+ createSessionTanChallengeRaw(requestParameters: CreateSessionTanChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<Challenge>>;
12890
+ /**
12891
+ * If the user chose an auth method from `GetAuthInfo` with the flow `CHALLENGE_RESPONSE`, before enabling session TAN, a challenge must be requested first.
12892
+ */
12893
+ createSessionTanChallenge(requestParameters: CreateSessionTanChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<Challenge>;
12894
+ /**
12895
+ */
12896
+ enableSessionTanRaw(requestParameters: EnableSessionTanRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<EnableSessionTanResponse>>;
12897
+ /**
12898
+ */
12899
+ enableSessionTan(requestParameters: EnableSessionTanRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<EnableSessionTanResponse>;
12900
+ /**
12901
+ * End Session TAN for the given broker session. If applicable, the broker may return a message with a confirmation code which can be looked up in the initial activation SMS. If message is present in the response, it should be displayed to the user.
12902
+ */
12903
+ endSessionTanRaw(requestParameters: EndSessionTanRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<EndSessionTanResponse>>;
12904
+ /**
12905
+ * End Session TAN for the given broker session. If applicable, the broker may return a message with a confirmation code which can be looked up in the initial activation SMS. If message is present in the response, it should be displayed to the user.
12906
+ */
12907
+ endSessionTan(requestParameters: EndSessionTanRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<EndSessionTanResponse>;
12908
+ /**
12909
+ * Get the status of a decoupled operation. This is deprecated, use the new `GetDecoupledOperation` instead, which does not require the `sessionId` any more.
12910
+ */
12911
+ getDecoupledOperationStatusLegacyRaw(requestParameters: GetDecoupledOperationStatusLegacyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<DecoupledOperationStatus>>;
12912
+ /**
12913
+ * Get the status of a decoupled operation. This is deprecated, use the new `GetDecoupledOperation` instead, which does not require the `sessionId` any more.
12914
+ */
12915
+ getDecoupledOperationStatusLegacy(requestParameters: GetDecoupledOperationStatusLegacyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<DecoupledOperationStatus>;
12916
+ /**
12917
+ * Get the currently active broker sessions of the user\'s account.
12918
+ */
12919
+ getSessionsRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<SessionResponse>>;
12920
+ /**
12921
+ * Get the currently active broker sessions of the user\'s account.
12922
+ */
12923
+ getSessions(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<SessionResponse>;
12924
+ /**
12925
+ * Log out from the given broker session.
12926
+ */
12927
+ logoutSessionRaw(requestParameters: LogoutSessionRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<LogoutOkResponseBody>>;
12928
+ /**
12929
+ * Log out from the given broker session.
12930
+ */
12931
+ logoutSession(requestParameters: LogoutSessionRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<LogoutOkResponseBody>;
12932
+ /**
12933
+ * For brokers with `isOAuth`, sessions can not be created using `AddSession`. This is how a session can be added for an OAuth-based login process: 1. use `prepareOAuthRedirect` to obtain a URL to redirect to. You can provide a `returnTo` URL which will be redirected to later. Note that a list of allowed URLs has to be configured for the client. 2. redirect the user\'s browser to the `redirectTo` URL 3. after the user has logged in at the broker\'s interface, a redirect to `returnTo` with the URL query parameters `verifysession=1`, `code` and `ticketId` will happen 4. the `returnTo` page must call `confirmOAuth` with the given `ticketId` and `code` to finally add the session to the user\'s account
12934
+ */
12935
+ prepareOAuthRedirectRaw(requestParameters: PrepareOAuthRedirectRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<PrepareOAuthRedirectResponse>>;
12936
+ /**
12937
+ * For brokers with `isOAuth`, sessions can not be created using `AddSession`. This is how a session can be added for an OAuth-based login process: 1. use `prepareOAuthRedirect` to obtain a URL to redirect to. You can provide a `returnTo` URL which will be redirected to later. Note that a list of allowed URLs has to be configured for the client. 2. redirect the user\'s browser to the `redirectTo` URL 3. after the user has logged in at the broker\'s interface, a redirect to `returnTo` with the URL query parameters `verifysession=1`, `code` and `ticketId` will happen 4. the `returnTo` page must call `confirmOAuth` with the given `ticketId` and `code` to finally add the session to the user\'s account
12938
+ */
12939
+ prepareOAuthRedirect(requestParameters: PrepareOAuthRedirectRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<PrepareOAuthRedirectResponse>;
12940
+ /**
12941
+ * Trigger a background sync process for the given broker session. This means that a sync will be scheduled as soon as possible. All data related to the portfolio (e.g. positions and orders) will be loaded into the brokerize database.
12942
+ */
12943
+ triggerSessionSyncRaw(requestParameters: TriggerSessionSyncRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<OkResponseBody>>;
12944
+ /**
12945
+ * Trigger a background sync process for the given broker session. This means that a sync will be scheduled as soon as possible. All data related to the portfolio (e.g. positions and orders) will be loaded into the brokerize database.
12946
+ */
12947
+ triggerSessionSync(requestParameters: TriggerSessionSyncRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<OkResponseBody>;
12948
+ }
12949
+
12717
12950
  declare function SessionFromJSON(json: any): Session;
12718
12951
 
12719
12952
  declare function SessionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Session;
@@ -14202,6 +14435,14 @@ declare interface UpdateTradeDraftRequest {
14202
14435
  *
14203
14436
  */
14204
14437
  declare class UserApi extends runtime.BaseAPI {
14438
+ /**
14439
+ * Check if the RecoveryPhrase is still valid without obtaining a new token set. This can be used in frontends when users are asked if they still have their RecoveryPhrase.
14440
+ */
14441
+ checkRecoveryPhraseRaw(requestParameters: CheckRecoveryPhraseRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<CheckRecoveryPhrase200Response>>;
14442
+ /**
14443
+ * Check if the RecoveryPhrase is still valid without obtaining a new token set. This can be used in frontends when users are asked if they still have their RecoveryPhrase.
14444
+ */
14445
+ checkRecoveryPhrase(requestParameters: CheckRecoveryPhraseRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<CheckRecoveryPhrase200Response>;
14205
14446
  /**
14206
14447
  * Create a token for the current user. The token can be used to access resources on behalf of the user.
14207
14448
  */
@@ -14210,6 +14451,38 @@ declare class UserApi extends runtime.BaseAPI {
14210
14451
  * Create a token for the current user. The token can be used to access resources on behalf of the user.
14211
14452
  */
14212
14453
  createAccessToken(requestParameters: CreateAccessTokenRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<AccessTokenResult>;
14454
+ /**
14455
+ * Create a guest user and return a token which can be used to access resources. The lifetime of the generated temporary user as well as the returned `access_token` depend on the client configuration. It is usually around 24 hours. For some clients, tokens can be expired earlier based on inactivity. If the client has configured a longer lifetime for their guest users, a `refresh_token` is included in the response. This token can be used to renew the `access_token` after it has expired. The `refresh_token` can be used to obtain a new `access_token` after the original token has expired using the `/user/token` endpoint.
14456
+ */
14457
+ createGuestUserRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<CreateGuestUserResponse>>;
14458
+ /**
14459
+ * Create a guest user and return a token which can be used to access resources. The lifetime of the generated temporary user as well as the returned `access_token` depend on the client configuration. It is usually around 24 hours. For some clients, tokens can be expired earlier based on inactivity. If the client has configured a longer lifetime for their guest users, a `refresh_token` is included in the response. This token can be used to renew the `access_token` after it has expired. The `refresh_token` can be used to obtain a new `access_token` after the original token has expired using the `/user/token` endpoint.
14460
+ */
14461
+ createGuestUser(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<CreateGuestUserResponse>;
14462
+ /**
14463
+ * Create a RecoveryPhrase for the current guest user. The brokerize backend uses RecoveryPhrases instead of email + password registration or similar approaches, which can never be guaranteed to be anonymous. Users can simply generate a RecoveryPhrase and save it in a password manager, memorize it or write it down in a safe location. The BIP39 word list known from Bitcoins is used to encode a cryptographically safe random token and allows access to the account later (see endpoint `ObtainTokenFromRecoveryPhrase`).
14464
+ */
14465
+ createRecoveryPhraseRaw(requestParameters: CreateRecoveryPhraseRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<CreateRecoveryPhraseResult>>;
14466
+ /**
14467
+ * Create a RecoveryPhrase for the current guest user. The brokerize backend uses RecoveryPhrases instead of email + password registration or similar approaches, which can never be guaranteed to be anonymous. Users can simply generate a RecoveryPhrase and save it in a password manager, memorize it or write it down in a safe location. The BIP39 word list known from Bitcoins is used to encode a cryptographically safe random token and allows access to the account later (see endpoint `ObtainTokenFromRecoveryPhrase`).
14468
+ */
14469
+ createRecoveryPhrase(requestParameters: CreateRecoveryPhraseRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<CreateRecoveryPhraseResult>;
14470
+ /**
14471
+ * Delete the current user (only allowed if it is a guest account). Also logs out all active broker sessions attached to the user.
14472
+ */
14473
+ deleteGuestUserRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
14474
+ /**
14475
+ * Delete the current user (only allowed if it is a guest account). Also logs out all active broker sessions attached to the user.
14476
+ */
14477
+ deleteGuestUser(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
14478
+ /**
14479
+ * Delete the RecoveryPhrase from the account.
14480
+ */
14481
+ deleteRecoveryPhraseRaw(requestParameters: DeleteRecoveryPhraseRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
14482
+ /**
14483
+ * Delete the RecoveryPhrase from the account.
14484
+ */
14485
+ deleteRecoveryPhrase(requestParameters: DeleteRecoveryPhraseRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
14213
14486
  /**
14214
14487
  */
14215
14488
  getAccessTokensRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetAccessTokensResponse>>;
@@ -14224,6 +14497,38 @@ declare class UserApi extends runtime.BaseAPI {
14224
14497
  * Figure out which permissions are available to select from for a new access token.
14225
14498
  */
14226
14499
  getAcessTokenAvailablePermissions(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetAcessTokenAvailablePermissions200Response>;
14500
+ /**
14501
+ * Lists all the recoveryPhrases metadata the user has in their account.
14502
+ */
14503
+ getRecoveryPhrasesRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetRecoveryPhrasesResponse>>;
14504
+ /**
14505
+ * Lists all the recoveryPhrases metadata the user has in their account.
14506
+ */
14507
+ getRecoveryPhrases(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetRecoveryPhrasesResponse>;
14508
+ /**
14509
+ * Checks the provided authentication and returns the logged-in user.
14510
+ */
14511
+ getUserRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetUserResponse>>;
14512
+ /**
14513
+ * Checks the provided authentication and returns the logged-in user.
14514
+ */
14515
+ getUser(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetUserResponse>;
14516
+ /**
14517
+ * Obtain a new access token using a refresh token as specified in https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.4. If `CreateGuestUser` has provided a `refresh_token`, this endpoint may be used to obtain a new `access_token` after the original token has expired.
14518
+ */
14519
+ obtainTokenRaw(requestParameters: ObtainTokenRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<TokenResponse>>;
14520
+ /**
14521
+ * Obtain a new access token using a refresh token as specified in https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.4. If `CreateGuestUser` has provided a `refresh_token`, this endpoint may be used to obtain a new `access_token` after the original token has expired.
14522
+ */
14523
+ obtainToken(requestParameters: ObtainTokenRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<TokenResponse>;
14524
+ /**
14525
+ * Obtain a new access and refresh token set by a RecoveryPhrase. The new set also contains a refresh_token etc, so it can then be used just like the tokens obtained from the `ObtainToken` endpoint. This also creates a new `trading_session`, as RecoveryPhrases never allow access to an existing trading_session.
14526
+ */
14527
+ obtainTokenByRecoveryPhraseRaw(requestParameters: ObtainTokenByRecoveryPhraseRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<TokenResponse>>;
14528
+ /**
14529
+ * Obtain a new access and refresh token set by a RecoveryPhrase. The new set also contains a refresh_token etc, so it can then be used just like the tokens obtained from the `ObtainToken` endpoint. This also creates a new `trading_session`, as RecoveryPhrases never allow access to an existing trading_session.
14530
+ */
14531
+ obtainTokenByRecoveryPhrase(requestParameters: ObtainTokenByRecoveryPhraseRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<TokenResponse>;
14227
14532
  /**
14228
14533
  */
14229
14534
  revokeAccessTokenRaw(requestParameters: RevokeAccessTokenRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
@@ -14333,6 +14638,20 @@ declare interface WebSocket_2 {
14333
14638
  removeEventListener<K extends keyof WebSocketEventMap_2>(type: K, listener: (this: WebSocket_2, ev: WebSocketEventMap_2[K]) => any, options?: boolean | EventListenerOptions_2): void;
14334
14639
  }
14335
14640
 
14641
+ /**
14642
+ *
14643
+ */
14644
+ declare class WebsocketApi extends runtime.BaseAPI {
14645
+ /**
14646
+ * Most operations at brokerize have asynchronous effects. For example, consider the flow of an order: when the user creates an order, it will not immediately appear in order list endpoints, because usually brokers take a few seconds until they are retrievable in those lists. Also, after a while, the order may be executed or cancelled asynchronously by the stock exchange. A common solution for frontends would be to reload the order list regularly. However data is then either delayed or there will be many more requests than needed. The brokerize websocket endpoint allows getting updates via web sockets. Generally speaking, clients can subscribe by assigning a subscription id and will then receive updates on that subscription. In this documentation, ⬆️ denotes messages from the client to the server, whereas messages from server to client are marked with ⬇️. ## authentication When using cookies for authorization, the WebSocket connection is authenticated with the HTTP upgrade request. If token headers are used, the _first_ message from client to server must be: ``` ⬆️ { \"cmd\": \"authorize\", \"idToken\": <string> } ``` In all cases, clients must wait for the welcome message before sending other messages: ``` ⬇️ { \"cmd\": \"authenticated\" } ``` ## ping After 1 minute of inactivity of a client, the WebSocket connection will be considered stale and will automatically terminated. To prevent this, a ping message can be sent: ``` ⬆️ {\"cmd\": \"ping\"} ``` The server also sends this message regularly. If no message has been received on a WebSocket connection for more than 1 minute, it should be terminated by the client. ``` ⬇️ {\"cmd\": \"ping\"} ``` ## subscriptions Subscriptions can be used to get invalidate events or updates for selected resources. ### invalidate subscriptions Invalidation events can be used for the frontend to know when reload requests via the HTTP endpoints are appropriate. Currently only invalidate events can be subscribed, the actual data must then be reloaded using the HTTP endpoints. To set up a subscription for an invalidate event, use: ``` ⬆️ { \"cmd\": \"subscribe\", \"type\": \"invalidate\", \"subscriptionId\": 1, \"entity: \"brokersessions\" /_* \"positions\" | \"orders\" *_/, \"portfolioId\": 42 /_* required for \"positions\" or \"orders\" *_/ } ``` If the subscription failed to be set up on the server, an error will be sent for the subscription. This also automatically ends the subscription on the server side: ``` ⬇️ { \"subscriptionId\": 1, \"error\": { \"message\": \"Could not set up invalidation event due to...\" } } ``` If an invalid `subscriptionId` is provided (or the subscription id is already in use by the connection), an error like this will be sent: ``` ⬇️ { \"error\": { \"message\": \"Could not add subscription due to invalid subscriptionId\" } } ``` ⚠️ _the connection will then be terminated immediately_. If the subscription is sucessfuly set up, whenever an invalidation happens, the server will send a message like this: ``` ⬇️ { \"cmd\": \"invalidate\", \"subscriptionId\": 1 } ``` When that invalidation event is received, the client should reload the data using the corresponding endpoints. Clients can end their subscription with the `unsubscribe` command: ``` ⬆️ { \"cmd\": \"unsubscribe\", \"subscriptionId\": 1 } ``` ### subscribe to the state of a decoupled operation For decoupled operations (e.g. authorizing a session TAN using a second factor device), the state of the operation can be subscribed: ``` ⬆️ { \"cmd\": \"subscribe\", \"type\": \"decoupledOperationStatus\", \"subscriptionId\": 1, \"sessionId\": string, \"decoupledOperationId\": string } ``` Error handling as well as unsubscribing works as described for invalidate subscriptions. Example message from the server for updating the state: ``` ⬇️ { \"cmd\": \"updateDecoupledOperationStatus\", \"subscriptionId\": number, \"state\": <DecoupledOperationStatus> } ```
14647
+ */
14648
+ websocketRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
14649
+ /**
14650
+ * Most operations at brokerize have asynchronous effects. For example, consider the flow of an order: when the user creates an order, it will not immediately appear in order list endpoints, because usually brokers take a few seconds until they are retrievable in those lists. Also, after a while, the order may be executed or cancelled asynchronously by the stock exchange. A common solution for frontends would be to reload the order list regularly. However data is then either delayed or there will be many more requests than needed. The brokerize websocket endpoint allows getting updates via web sockets. Generally speaking, clients can subscribe by assigning a subscription id and will then receive updates on that subscription. In this documentation, ⬆️ denotes messages from the client to the server, whereas messages from server to client are marked with ⬇️. ## authentication When using cookies for authorization, the WebSocket connection is authenticated with the HTTP upgrade request. If token headers are used, the _first_ message from client to server must be: ``` ⬆️ { \"cmd\": \"authorize\", \"idToken\": <string> } ``` In all cases, clients must wait for the welcome message before sending other messages: ``` ⬇️ { \"cmd\": \"authenticated\" } ``` ## ping After 1 minute of inactivity of a client, the WebSocket connection will be considered stale and will automatically terminated. To prevent this, a ping message can be sent: ``` ⬆️ {\"cmd\": \"ping\"} ``` The server also sends this message regularly. If no message has been received on a WebSocket connection for more than 1 minute, it should be terminated by the client. ``` ⬇️ {\"cmd\": \"ping\"} ``` ## subscriptions Subscriptions can be used to get invalidate events or updates for selected resources. ### invalidate subscriptions Invalidation events can be used for the frontend to know when reload requests via the HTTP endpoints are appropriate. Currently only invalidate events can be subscribed, the actual data must then be reloaded using the HTTP endpoints. To set up a subscription for an invalidate event, use: ``` ⬆️ { \"cmd\": \"subscribe\", \"type\": \"invalidate\", \"subscriptionId\": 1, \"entity: \"brokersessions\" /_* \"positions\" | \"orders\" *_/, \"portfolioId\": 42 /_* required for \"positions\" or \"orders\" *_/ } ``` If the subscription failed to be set up on the server, an error will be sent for the subscription. This also automatically ends the subscription on the server side: ``` ⬇️ { \"subscriptionId\": 1, \"error\": { \"message\": \"Could not set up invalidation event due to...\" } } ``` If an invalid `subscriptionId` is provided (or the subscription id is already in use by the connection), an error like this will be sent: ``` ⬇️ { \"error\": { \"message\": \"Could not add subscription due to invalid subscriptionId\" } } ``` ⚠️ _the connection will then be terminated immediately_. If the subscription is sucessfuly set up, whenever an invalidation happens, the server will send a message like this: ``` ⬇️ { \"cmd\": \"invalidate\", \"subscriptionId\": 1 } ``` When that invalidation event is received, the client should reload the data using the corresponding endpoints. Clients can end their subscription with the `unsubscribe` command: ``` ⬆️ { \"cmd\": \"unsubscribe\", \"subscriptionId\": 1 } ``` ### subscribe to the state of a decoupled operation For decoupled operations (e.g. authorizing a session TAN using a second factor device), the state of the operation can be subscribed: ``` ⬆️ { \"cmd\": \"subscribe\", \"type\": \"decoupledOperationStatus\", \"subscriptionId\": 1, \"sessionId\": string, \"decoupledOperationId\": string } ``` Error handling as well as unsubscribing works as described for invalidate subscriptions. Example message from the server for updating the state: ``` ⬇️ { \"cmd\": \"updateDecoupledOperationStatus\", \"subscriptionId\": number, \"state\": <DecoupledOperationStatus> } ```
14651
+ */
14652
+ websocket(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
14653
+ }
14654
+
14336
14655
  declare type WebSocketAuthenticatedMessage = {
14337
14656
  cmd: "authenticated";
14338
14657
  };