@brokerize/client 1.3.9 → 1.3.10

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 (38) hide show
  1. package/dist/authorizedApiContext.d.ts +20 -21
  2. package/dist/authorizedApiContext.js +36 -41
  3. package/dist/client.d.ts +689 -386
  4. package/dist/index.d.ts +2 -2
  5. package/dist/index.js +2 -2
  6. package/dist/swagger/apis/DecoupledOperationsApi.d.ts +35 -0
  7. package/dist/swagger/apis/DecoupledOperationsApi.js +86 -0
  8. package/dist/swagger/apis/{ChangeOrderApi.d.ts → OrderApi.d.ts} +35 -2
  9. package/dist/swagger/apis/{ChangeOrderApi.js → OrderApi.js} +117 -2
  10. package/dist/swagger/apis/{DefaultApi.d.ts → PortfolioApi.d.ts} +2 -160
  11. package/dist/swagger/apis/{DefaultApi.js → PortfolioApi.js} +2 -568
  12. package/dist/swagger/apis/SessionApi.d.ts +146 -0
  13. package/dist/swagger/apis/SessionApi.js +474 -0
  14. package/dist/swagger/apis/UserApi.d.ts +89 -1
  15. package/dist/swagger/apis/UserApi.js +309 -1
  16. package/dist/swagger/apis/WebsocketApi.d.ts +24 -0
  17. package/dist/swagger/apis/WebsocketApi.js +38 -0
  18. package/dist/swagger/apis/index.d.ts +5 -4
  19. package/dist/swagger/apis/index.js +5 -4
  20. package/dist/swagger/models/CheckRecoveryPhrase200Response.d.ts +27 -0
  21. package/dist/swagger/models/CheckRecoveryPhrase200Response.js +37 -0
  22. package/dist/swagger/models/CreateRecoveryPhraseParams.d.ts +28 -0
  23. package/dist/swagger/models/CreateRecoveryPhraseParams.js +37 -0
  24. package/dist/swagger/models/CreateRecoveryPhraseResult.d.ts +27 -0
  25. package/dist/swagger/models/CreateRecoveryPhraseResult.js +37 -0
  26. package/dist/swagger/models/GetRecoveryPhrasesResponse.d.ts +28 -0
  27. package/dist/swagger/models/GetRecoveryPhrasesResponse.js +38 -0
  28. package/dist/swagger/models/ObtainTokenByRecoveryPhraseParams.d.ts +27 -0
  29. package/dist/swagger/models/ObtainTokenByRecoveryPhraseParams.js +37 -0
  30. package/dist/swagger/models/RecoveryPhraseItem.d.ts +51 -0
  31. package/dist/swagger/models/RecoveryPhraseItem.js +45 -0
  32. package/dist/swagger/models/index.d.ts +6 -0
  33. package/dist/swagger/models/index.js +6 -0
  34. package/package.json +1 -1
  35. package/dist/swagger/apis/BrokerLoginApi.d.ts +0 -59
  36. package/dist/swagger/apis/BrokerLoginApi.js +0 -169
  37. package/dist/swagger/apis/CancelOrderApi.d.ts +0 -41
  38. 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;
@@ -1437,7 +1436,7 @@ declare function BrokerEnvironmentToJSONRecursive(value?: BrokerEnvironment | nu
1437
1436
 
1438
1437
  export declare class Brokerize {
1439
1438
  private _cfg;
1440
- private _defaultApi;
1439
+ private _userApi;
1441
1440
  constructor(cfg: BrokerizeConfig);
1442
1441
  refreshGuestUser(refreshToken: string): Promise<GuestAuthContextConfiguration>;
1443
1442
  createGuestUser(): Promise<AuthContextConfiguration>;
@@ -1550,42 +1549,6 @@ declare type BrokerizeWebSocketError = {
1550
1549
  message: string;
1551
1550
  };
1552
1551
 
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
1552
  /**
1590
1553
  * If a login form can be shown for the broker, describes the fields to show.
1591
1554
  * @export
@@ -1835,28 +1798,6 @@ declare interface CancelDecoupledOperationRequest {
1835
1798
  decoupledOperationId: string;
1836
1799
  }
1837
1800
 
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
1801
  /**
1861
1802
  * brokerize
1862
1803
  * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
@@ -2430,36 +2371,6 @@ declare function ChallengeToJSON(value?: Challenge | null): any;
2430
2371
 
2431
2372
  declare function ChallengeToJSONRecursive(value?: Challenge | null, ignoreParent?: boolean): any;
2432
2373
 
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
2374
  /**
2464
2375
  *
2465
2376
  * @export
@@ -2573,6 +2484,42 @@ declare function ChangeOrderResponseToJSON(value?: ChangeOrderResponse | null):
2573
2484
 
2574
2485
  declare function ChangeOrderResponseToJSONRecursive(value?: ChangeOrderResponse | null, ignoreParent?: boolean): any;
2575
2486
 
2487
+ /**
2488
+ * brokerize
2489
+ * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
2490
+ *
2491
+ *
2492
+ *
2493
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2494
+ * https://openapi-generator.tech
2495
+ * Do not edit the class manually.
2496
+ */
2497
+ /**
2498
+ *
2499
+ * @export
2500
+ * @interface CheckRecoveryPhrase200Response
2501
+ */
2502
+ declare interface CheckRecoveryPhrase200Response {
2503
+ /**
2504
+ *
2505
+ * @type {Date}
2506
+ * @memberof CheckRecoveryPhrase200Response
2507
+ */
2508
+ expiresAt: Date;
2509
+ }
2510
+
2511
+ declare function CheckRecoveryPhrase200ResponseFromJSON(json: any): CheckRecoveryPhrase200Response;
2512
+
2513
+ declare function CheckRecoveryPhrase200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CheckRecoveryPhrase200Response;
2514
+
2515
+ declare function CheckRecoveryPhrase200ResponseToJSON(value?: CheckRecoveryPhrase200Response | null): any;
2516
+
2517
+ declare function CheckRecoveryPhrase200ResponseToJSONRecursive(value?: CheckRecoveryPhrase200Response | null, ignoreParent?: boolean): any;
2518
+
2519
+ declare interface CheckRecoveryPhraseRequest {
2520
+ obtainTokenByRecoveryPhraseParams: ObtainTokenByRecoveryPhraseParams;
2521
+ }
2522
+
2576
2523
  /**
2577
2524
  * The client configuration as it appears in API endpoints.
2578
2525
  * @export
@@ -3807,6 +3754,75 @@ declare function CreateOrderParamsToJSON(value?: CreateOrderParams | null): any;
3807
3754
 
3808
3755
  declare function CreateOrderParamsToJSONRecursive(value?: CreateOrderParams | null, ignoreParent?: boolean): any;
3809
3756
 
3757
+ /**
3758
+ * brokerize
3759
+ * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
3760
+ *
3761
+ *
3762
+ *
3763
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
3764
+ * https://openapi-generator.tech
3765
+ * Do not edit the class manually.
3766
+ */
3767
+ /**
3768
+ *
3769
+ * @export
3770
+ * @interface CreateRecoveryPhraseParams
3771
+ */
3772
+ declare interface CreateRecoveryPhraseParams {
3773
+ /**
3774
+ * A name for the RecoveryPhrase. Must be unique for the user so that they can identify it in the list
3775
+ * of RecoveryPhrases.
3776
+ * @type {string}
3777
+ * @memberof CreateRecoveryPhraseParams
3778
+ */
3779
+ name: string;
3780
+ }
3781
+
3782
+ declare function CreateRecoveryPhraseParamsFromJSON(json: any): CreateRecoveryPhraseParams;
3783
+
3784
+ declare function CreateRecoveryPhraseParamsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateRecoveryPhraseParams;
3785
+
3786
+ declare function CreateRecoveryPhraseParamsToJSON(value?: CreateRecoveryPhraseParams | null): any;
3787
+
3788
+ declare function CreateRecoveryPhraseParamsToJSONRecursive(value?: CreateRecoveryPhraseParams | null, ignoreParent?: boolean): any;
3789
+
3790
+ declare interface CreateRecoveryPhraseRequest {
3791
+ createRecoveryPhraseParams: CreateRecoveryPhraseParams;
3792
+ }
3793
+
3794
+ /**
3795
+ * brokerize
3796
+ * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
3797
+ *
3798
+ *
3799
+ *
3800
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
3801
+ * https://openapi-generator.tech
3802
+ * Do not edit the class manually.
3803
+ */
3804
+ /**
3805
+ *
3806
+ * @export
3807
+ * @interface CreateRecoveryPhraseResult
3808
+ */
3809
+ declare interface CreateRecoveryPhraseResult {
3810
+ /**
3811
+ *
3812
+ * @type {string}
3813
+ * @memberof CreateRecoveryPhraseResult
3814
+ */
3815
+ recoveryPhrase: string;
3816
+ }
3817
+
3818
+ declare function CreateRecoveryPhraseResultFromJSON(json: any): CreateRecoveryPhraseResult;
3819
+
3820
+ declare function CreateRecoveryPhraseResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateRecoveryPhraseResult;
3821
+
3822
+ declare function CreateRecoveryPhraseResultToJSON(value?: CreateRecoveryPhraseResult | null): any;
3823
+
3824
+ declare function CreateRecoveryPhraseResultToJSONRecursive(value?: CreateRecoveryPhraseResult | null, ignoreParent?: boolean): any;
3825
+
3810
3826
  declare interface CreateSessionTanChallengeRequest {
3811
3827
  sessionId: string;
3812
3828
  createTanChallengeParams: CreateTanChallengeParams;
@@ -3932,6 +3948,24 @@ declare interface DeactivateTradeDraftRequest {
3932
3948
  id: string;
3933
3949
  }
3934
3950
 
3951
+ /**
3952
+ *
3953
+ */
3954
+ declare class DecoupledOperationsApi extends runtime.BaseAPI {
3955
+ /**
3956
+ */
3957
+ cancelDecoupledOperationRaw(requestParameters: CancelDecoupledOperationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
3958
+ /**
3959
+ */
3960
+ cancelDecoupledOperation(requestParameters: CancelDecoupledOperationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
3961
+ /**
3962
+ */
3963
+ getDecoupledOperationStatusRaw(requestParameters: GetDecoupledOperationStatusRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<DecoupledOperationStatus>>;
3964
+ /**
3965
+ */
3966
+ getDecoupledOperationStatus(requestParameters: GetDecoupledOperationStatusRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<DecoupledOperationStatus>;
3967
+ }
3968
+
3935
3969
  /**
3936
3970
  *
3937
3971
  * @export
@@ -4011,215 +4045,13 @@ declare type DecoupledOperationStatus_2 = {
4011
4045
  createdOrderId?: string;
4012
4046
  };
4013
4047
 
4014
- declare function DecoupledOperationStatusFromJSON(json: any): DecoupledOperationStatus;
4015
-
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
- }
4048
+ declare function DecoupledOperationStatusFromJSON(json: any): DecoupledOperationStatus;
4049
+
4050
+ declare function DecoupledOperationStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): DecoupledOperationStatus;
4051
+
4052
+ declare function DecoupledOperationStatusToJSON(value?: DecoupledOperationStatus | null): any;
4053
+
4054
+ declare function DecoupledOperationStatusToJSONRecursive(value?: DecoupledOperationStatus | null, ignoreParent?: boolean): any;
4223
4055
 
4224
4056
  declare const DefaultConfig: Configuration;
4225
4057
 
@@ -4323,6 +4155,10 @@ declare interface DeletePortfolioRequest {
4323
4155
  portfolioId: string;
4324
4156
  }
4325
4157
 
4158
+ declare interface DeleteRecoveryPhraseRequest {
4159
+ recoveryPhraseId: string;
4160
+ }
4161
+
4326
4162
  declare interface DeleteTradeDraftRequest {
4327
4163
  id: string;
4328
4164
  }
@@ -7158,6 +6994,28 @@ declare function GetQuoteResponseToJSON(value?: GetQuoteResponse | null): any;
7158
6994
 
7159
6995
  declare function GetQuoteResponseToJSONRecursive(value?: GetQuoteResponse | null, ignoreParent?: boolean): any;
7160
6996
 
6997
+ /**
6998
+ *
6999
+ * @export
7000
+ * @interface GetRecoveryPhrasesResponse
7001
+ */
7002
+ declare interface GetRecoveryPhrasesResponse {
7003
+ /**
7004
+ *
7005
+ * @type {Array<RecoveryPhraseItem>}
7006
+ * @memberof GetRecoveryPhrasesResponse
7007
+ */
7008
+ recoveryPhrases: Array<RecoveryPhraseItem>;
7009
+ }
7010
+
7011
+ declare function GetRecoveryPhrasesResponseFromJSON(json: any): GetRecoveryPhrasesResponse;
7012
+
7013
+ declare function GetRecoveryPhrasesResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRecoveryPhrasesResponse;
7014
+
7015
+ declare function GetRecoveryPhrasesResponseToJSON(value?: GetRecoveryPhrasesResponse | null): any;
7016
+
7017
+ declare function GetRecoveryPhrasesResponseToJSONRecursive(value?: GetRecoveryPhrasesResponse | null, ignoreParent?: boolean): any;
7018
+
7161
7019
  declare interface GetSecurityDetailedInfoRequest {
7162
7020
  token: string;
7163
7021
  }
@@ -8081,6 +7939,42 @@ declare function OAuthLoginFormConfigToJSON(value?: OAuthLoginFormConfig | null)
8081
7939
 
8082
7940
  declare function OAuthLoginFormConfigToJSONRecursive(value?: OAuthLoginFormConfig | null, ignoreParent?: boolean): any;
8083
7941
 
7942
+ /**
7943
+ * brokerize
7944
+ * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
7945
+ *
7946
+ *
7947
+ *
7948
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7949
+ * https://openapi-generator.tech
7950
+ * Do not edit the class manually.
7951
+ */
7952
+ /**
7953
+ *
7954
+ * @export
7955
+ * @interface ObtainTokenByRecoveryPhraseParams
7956
+ */
7957
+ declare interface ObtainTokenByRecoveryPhraseParams {
7958
+ /**
7959
+ *
7960
+ * @type {string}
7961
+ * @memberof ObtainTokenByRecoveryPhraseParams
7962
+ */
7963
+ recoveryPhrase: string;
7964
+ }
7965
+
7966
+ declare function ObtainTokenByRecoveryPhraseParamsFromJSON(json: any): ObtainTokenByRecoveryPhraseParams;
7967
+
7968
+ declare function ObtainTokenByRecoveryPhraseParamsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ObtainTokenByRecoveryPhraseParams;
7969
+
7970
+ declare function ObtainTokenByRecoveryPhraseParamsToJSON(value?: ObtainTokenByRecoveryPhraseParams | null): any;
7971
+
7972
+ declare function ObtainTokenByRecoveryPhraseParamsToJSONRecursive(value?: ObtainTokenByRecoveryPhraseParams | null, ignoreParent?: boolean): any;
7973
+
7974
+ declare interface ObtainTokenByRecoveryPhraseRequest {
7975
+ obtainTokenByRecoveryPhraseParams: ObtainTokenByRecoveryPhraseParams;
7976
+ }
7977
+
8084
7978
  declare interface ObtainTokenRequest {
8085
7979
  grantType: string;
8086
7980
  refreshToken: string;
@@ -8162,28 +8056,26 @@ declare namespace openApiClient {
8162
8056
  SetClientConfigOperationRequest,
8163
8057
  AdminApi,
8164
8058
  GetOrderReportFormatEnum,
8165
- AddSessionRequest,
8166
- AddSessionCompleteChallengeRequest,
8167
- ConfirmOAuthRequest,
8168
- PrepareOAuthRedirectRequest,
8169
- BrokerLoginApi,
8059
+ CancelDecoupledOperationRequest,
8060
+ GetDecoupledOperationStatusRequest,
8061
+ DecoupledOperationsApi,
8062
+ CreateDemoAccountRequest,
8063
+ DeleteDemoAccountRequest,
8064
+ TriggerDemoSessionSyncErrorRequest,
8065
+ DemobrokerApi,
8066
+ RenderGenericTableRequest,
8067
+ ExportApi,
8068
+ GetPagesConfigurationRequest,
8069
+ MetaApi,
8170
8070
  CancelOrderRequest,
8171
- CreateCancelOrderChallengeRequest,
8172
- CancelOrderApi,
8173
8071
  ChangeOrderRequest,
8072
+ CreateCancelOrderChallengeRequest,
8174
8073
  CreateChangeOrderChallengeRequest,
8175
8074
  GetChangeOrderCostEstimationRequest,
8176
- ChangeOrderApi,
8177
- CancelDecoupledOperationRequest,
8178
- CancelDecoupledOperationLegacyRequest,
8179
- CreateSessionTanChallengeRequest,
8075
+ GetOrderRequest,
8076
+ OrderApi,
8180
8077
  DeletePortfolioRequest,
8181
- EnableSessionTanRequest,
8182
- EndSessionTanRequest,
8183
8078
  GetAuthInfoRequest,
8184
- GetDecoupledOperationStatusRequest,
8185
- GetDecoupledOperationStatusLegacyRequest,
8186
- GetOrderRequest,
8187
8079
  GetPortfolioCalendarRequest,
8188
8080
  GetPortfolioOrdersRequest,
8189
8081
  GetPortfolioPositionsRequest,
@@ -8191,22 +8083,23 @@ declare namespace openApiClient {
8191
8083
  GetPortfolioTradeStatisticsRequest,
8192
8084
  GetPortfolioTradeWarningsRequest,
8193
8085
  GetPortfolioTradesRequest,
8194
- LogoutSessionRequest,
8195
- ObtainTokenRequest,
8196
8086
  RenamePortfolioOperationRequest,
8197
- TriggerSessionSyncRequest,
8198
- DefaultApi,
8199
- CreateDemoAccountRequest,
8200
- DeleteDemoAccountRequest,
8201
- TriggerDemoSessionSyncErrorRequest,
8202
- DemobrokerApi,
8203
- RenderGenericTableRequest,
8204
- ExportApi,
8205
- GetPagesConfigurationRequest,
8206
- MetaApi,
8087
+ PortfolioApi,
8207
8088
  GetSecurityQuotesRequest,
8208
8089
  GetSecurityQuotesMetaRequest,
8209
8090
  SecuritiesApi,
8091
+ AddSessionRequest,
8092
+ AddSessionCompleteChallengeRequest,
8093
+ CancelDecoupledOperationLegacyRequest,
8094
+ ConfirmOAuthRequest,
8095
+ CreateSessionTanChallengeRequest,
8096
+ EnableSessionTanRequest,
8097
+ EndSessionTanRequest,
8098
+ GetDecoupledOperationStatusLegacyRequest,
8099
+ LogoutSessionRequest,
8100
+ PrepareOAuthRedirectRequest,
8101
+ TriggerSessionSyncRequest,
8102
+ SessionApi,
8210
8103
  CreateTradeRequest,
8211
8104
  CreateTradeChallengeRequest,
8212
8105
  GetAvailableOrderIntentsRequest,
@@ -8221,9 +8114,15 @@ declare namespace openApiClient {
8221
8114
  GetTradeDraftsRequest,
8222
8115
  UpdateTradeDraftRequest,
8223
8116
  TradeDraftApi,
8117
+ CheckRecoveryPhraseRequest,
8224
8118
  CreateAccessTokenRequest,
8119
+ CreateRecoveryPhraseRequest,
8120
+ DeleteRecoveryPhraseRequest,
8121
+ ObtainTokenRequest,
8122
+ ObtainTokenByRecoveryPhraseRequest,
8225
8123
  RevokeAccessTokenRequest,
8226
8124
  UserApi,
8125
+ WebsocketApi,
8227
8126
  AccessTokenItemFromJSON,
8228
8127
  AccessTokenItemFromJSONTyped,
8229
8128
  AccessTokenItemToJSONRecursive,
@@ -8460,6 +8359,11 @@ declare namespace openApiClient {
8460
8359
  ChangeOrderResponseToJSONRecursive,
8461
8360
  ChangeOrderResponseToJSON,
8462
8361
  ChangeOrderResponse,
8362
+ CheckRecoveryPhrase200ResponseFromJSON,
8363
+ CheckRecoveryPhrase200ResponseFromJSONTyped,
8364
+ CheckRecoveryPhrase200ResponseToJSONRecursive,
8365
+ CheckRecoveryPhrase200ResponseToJSON,
8366
+ CheckRecoveryPhrase200Response,
8463
8367
  ClientConfigFromJSON,
8464
8368
  ClientConfigFromJSONTyped,
8465
8369
  ClientConfigToJSONRecursive,
@@ -8559,6 +8463,16 @@ declare namespace openApiClient {
8559
8463
  CreateOrderParamsToJSONRecursive,
8560
8464
  CreateOrderParamsToJSON,
8561
8465
  CreateOrderParams,
8466
+ CreateRecoveryPhraseParamsFromJSON,
8467
+ CreateRecoveryPhraseParamsFromJSONTyped,
8468
+ CreateRecoveryPhraseParamsToJSONRecursive,
8469
+ CreateRecoveryPhraseParamsToJSON,
8470
+ CreateRecoveryPhraseParams,
8471
+ CreateRecoveryPhraseResultFromJSON,
8472
+ CreateRecoveryPhraseResultFromJSONTyped,
8473
+ CreateRecoveryPhraseResultToJSONRecursive,
8474
+ CreateRecoveryPhraseResultToJSON,
8475
+ CreateRecoveryPhraseResult,
8562
8476
  CreateTanChallengeParamsFromJSON,
8563
8477
  CreateTanChallengeParamsFromJSONTyped,
8564
8478
  CreateTanChallengeParamsToJSONRecursive,
@@ -8962,6 +8876,11 @@ declare namespace openApiClient {
8962
8876
  GetQuoteResponseToJSONRecursive,
8963
8877
  GetQuoteResponseToJSON,
8964
8878
  GetQuoteResponse,
8879
+ GetRecoveryPhrasesResponseFromJSON,
8880
+ GetRecoveryPhrasesResponseFromJSONTyped,
8881
+ GetRecoveryPhrasesResponseToJSONRecursive,
8882
+ GetRecoveryPhrasesResponseToJSON,
8883
+ GetRecoveryPhrasesResponse,
8965
8884
  GetUserResponseFromJSON,
8966
8885
  GetUserResponseFromJSONTyped,
8967
8886
  GetUserResponseToJSONRecursive,
@@ -9045,6 +8964,11 @@ declare namespace openApiClient {
9045
8964
  OAuthLoginFormConfig,
9046
8965
  OAuthLoginFormConfigRedirectStyleEnum,
9047
8966
  OAuthLoginFormConfigRedirectStyleBitpandaEnum,
8967
+ ObtainTokenByRecoveryPhraseParamsFromJSON,
8968
+ ObtainTokenByRecoveryPhraseParamsFromJSONTyped,
8969
+ ObtainTokenByRecoveryPhraseParamsToJSONRecursive,
8970
+ ObtainTokenByRecoveryPhraseParamsToJSON,
8971
+ ObtainTokenByRecoveryPhraseParams,
9048
8972
  OkResponseBodyFromJSON,
9049
8973
  OkResponseBodyFromJSONTyped,
9050
8974
  OkResponseBodyToJSONRecursive,
@@ -9253,6 +9177,11 @@ declare namespace openApiClient {
9253
9177
  QuoteExpirationToJSONRecursive,
9254
9178
  QuoteExpirationToJSON,
9255
9179
  QuoteExpiration,
9180
+ RecoveryPhraseItemFromJSON,
9181
+ RecoveryPhraseItemFromJSONTyped,
9182
+ RecoveryPhraseItemToJSONRecursive,
9183
+ RecoveryPhraseItemToJSON,
9184
+ RecoveryPhraseItem,
9256
9185
  RenamePortfolioRequestFromJSON,
9257
9186
  RenamePortfolioRequestFromJSONTyped,
9258
9187
  RenamePortfolioRequestToJSONRecursive,
@@ -9865,6 +9794,58 @@ declare interface Order {
9865
9794
  validity?: OrderValidity;
9866
9795
  }
9867
9796
 
9797
+ /**
9798
+ *
9799
+ */
9800
+ declare class OrderApi extends runtime.BaseAPI {
9801
+ /**
9802
+ * 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).
9803
+ */
9804
+ cancelOrderRaw(requestParameters: CancelOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<CancelOrderResponse>>;
9805
+ /**
9806
+ * 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).
9807
+ */
9808
+ cancelOrder(requestParameters: CancelOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<CancelOrderResponse>;
9809
+ /**
9810
+ * Perform an order change.
9811
+ */
9812
+ changeOrderRaw(requestParameters: ChangeOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<ChangeOrderResponse>>;
9813
+ /**
9814
+ * Perform an order change.
9815
+ */
9816
+ changeOrder(requestParameters: ChangeOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<ChangeOrderResponse>;
9817
+ /**
9818
+ * 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.
9819
+ */
9820
+ createCancelOrderChallengeRaw(requestParameters: CreateCancelOrderChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<Challenge>>;
9821
+ /**
9822
+ * 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.
9823
+ */
9824
+ createCancelOrderChallenge(requestParameters: CreateCancelOrderChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<Challenge>;
9825
+ /**
9826
+ * 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.
9827
+ */
9828
+ createChangeOrderChallengeRaw(requestParameters: CreateChangeOrderChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<Challenge>>;
9829
+ /**
9830
+ * 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.
9831
+ */
9832
+ createChangeOrderChallenge(requestParameters: CreateChangeOrderChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<Challenge>;
9833
+ /**
9834
+ * Get an order cost estimation for an order change.
9835
+ */
9836
+ getChangeOrderCostEstimationRaw(requestParameters: GetChangeOrderCostEstimationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<OrderCostEstimation>>;
9837
+ /**
9838
+ * Get an order cost estimation for an order change.
9839
+ */
9840
+ getChangeOrderCostEstimation(requestParameters: GetChangeOrderCostEstimationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<OrderCostEstimation>;
9841
+ /**
9842
+ */
9843
+ getOrderRaw(requestParameters: GetOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetOrderResponse>>;
9844
+ /**
9845
+ */
9846
+ getOrder(requestParameters: GetOrderRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetOrderResponse>;
9847
+ }
9848
+
9868
9849
  /**
9869
9850
  *
9870
9851
  * @export
@@ -10705,58 +10686,140 @@ declare interface Portfolio {
10705
10686
  */
10706
10687
  cashAccountIds: Array<string>;
10707
10688
  /**
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
10689
+ * - ISO code (e.g. EUR for Euro), if it is a monetary amount
10690
+ * - or 'USDT' if its Tether (https://en.wikipedia.org/wiki/Tether_(cryptocurrency)
10691
+ * - or 'XXX' if it is pieces
10692
+ * - or 'PRC' if it is a percentage
10693
+ * - or 'PRM' if it is permil
10694
+ * - or 'XXP' if it is points (as for indices)
10695
+ * - or 'GRAMS' if it is grams (as for precious metals)
10696
+ * @type {string}
10697
+ * @memberof Portfolio
10698
+ */
10699
+ currency: string;
10700
+ /**
10701
+ *
10702
+ * @type {string}
10703
+ * @memberof Portfolio
10704
+ */
10705
+ id: string;
10706
+ /**
10707
+ * 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,
10708
+ * 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).
10709
+ * 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
10710
+ * the same even if the portfolio is synchronized into a new user account, whereas a new id will be assigned.
10711
+ *
10712
+ * 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.
10713
+ * @type {string}
10714
+ * @memberof Portfolio
10715
+ */
10716
+ idHash: string;
10717
+ /**
10718
+ *
10719
+ * @type {string}
10720
+ * @memberof Portfolio
10721
+ */
10722
+ portfolioName: string;
10723
+ /**
10724
+ *
10725
+ * @type {string}
10726
+ * @memberof Portfolio
10727
+ */
10728
+ portfolioNameOriginal: string;
10729
+ /**
10730
+ *
10731
+ * @type {Array<string>}
10732
+ * @memberof Portfolio
10733
+ */
10734
+ sessionIds: Array<string>;
10735
+ /**
10736
+ *
10737
+ * @type {PortfolioSyncInfo}
10738
+ * @memberof Portfolio
10739
+ */
10740
+ syncInfo: PortfolioSyncInfo;
10741
+ }
10742
+
10743
+ /**
10744
+ *
10745
+ */
10746
+ declare class PortfolioApi extends runtime.BaseAPI {
10747
+ /**
10748
+ */
10749
+ deletePortfolioRaw(requestParameters: DeletePortfolioRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<OkResponseBody>>;
10750
+ /**
10751
+ */
10752
+ deletePortfolio(requestParameters: DeletePortfolioRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<OkResponseBody>;
10753
+ /**
10754
+ * 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.
10755
+ */
10756
+ getAuthInfoRaw(requestParameters: GetAuthInfoRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetAuthInfoResponse>>;
10757
+ /**
10758
+ * 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.
10759
+ */
10760
+ getAuthInfo(requestParameters: GetAuthInfoRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetAuthInfoResponse>;
10761
+ /**
10762
+ * Retrieve \"by-day\" aggregated values for the selected date ranges.
10763
+ */
10764
+ getPortfolioCalendarRaw(requestParameters: GetPortfolioCalendarRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioCalendarResponse>>;
10765
+ /**
10766
+ * Retrieve \"by-day\" aggregated values for the selected date ranges.
10767
+ */
10768
+ getPortfolioCalendar(requestParameters: GetPortfolioCalendarRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioCalendarResponse>;
10769
+ /**
10770
+ */
10771
+ getPortfolioOrdersRaw(requestParameters: GetPortfolioOrdersRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioOrdersResponse>>;
10772
+ /**
10773
+ */
10774
+ getPortfolioOrders(requestParameters: GetPortfolioOrdersRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioOrdersResponse>;
10775
+ /**
10776
+ */
10777
+ getPortfolioPositionsRaw(requestParameters: GetPortfolioPositionsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioPositionsResponse>>;
10778
+ /**
10779
+ */
10780
+ getPortfolioPositions(requestParameters: GetPortfolioPositionsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioPositionsResponse>;
10781
+ /**
10782
+ */
10783
+ getPortfolioQuotesRaw(requestParameters: GetPortfolioQuotesRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioQuotesResponse>>;
10784
+ /**
10785
+ */
10786
+ getPortfolioQuotes(requestParameters: GetPortfolioQuotesRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioQuotesResponse>;
10787
+ /**
10788
+ * 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.
10789
+ */
10790
+ getPortfolioTradeStatisticsRaw(requestParameters: GetPortfolioTradeStatisticsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioTradeStatisticsResponse>>;
10791
+ /**
10792
+ * 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.
10793
+ */
10794
+ getPortfolioTradeStatistics(requestParameters: GetPortfolioTradeStatisticsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioTradeStatisticsResponse>;
10795
+ /**
10796
+ */
10797
+ getPortfolioTradeWarningsRaw(requestParameters: GetPortfolioTradeWarningsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<Array<TradeWarning>>>;
10798
+ /**
10717
10799
  */
10718
- currency: string;
10800
+ getPortfolioTradeWarnings(requestParameters: GetPortfolioTradeWarningsRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<Array<TradeWarning>>;
10719
10801
  /**
10720
- *
10721
- * @type {string}
10722
- * @memberof Portfolio
10802
+ * 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
10803
  */
10724
- id: string;
10804
+ getPortfolioTradesRaw(requestParameters: GetPortfolioTradesRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetPortfolioTradesResponse>>;
10725
10805
  /**
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
10806
+ * 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
10807
  */
10735
- idHash: string;
10808
+ getPortfolioTrades(requestParameters: GetPortfolioTradesRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetPortfolioTradesResponse>;
10736
10809
  /**
10737
- *
10738
- * @type {string}
10739
- * @memberof Portfolio
10740
10810
  */
10741
- portfolioName: string;
10811
+ getPortfoliosRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<PortfoliosResponse>>;
10742
10812
  /**
10743
- *
10744
- * @type {string}
10745
- * @memberof Portfolio
10746
10813
  */
10747
- portfolioNameOriginal: string;
10814
+ getPortfolios(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<PortfoliosResponse>;
10748
10815
  /**
10749
- *
10750
- * @type {Array<string>}
10751
- * @memberof Portfolio
10816
+ * 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
10817
  */
10753
- sessionIds: Array<string>;
10818
+ renamePortfolioRaw(requestParameters: RenamePortfolioOperationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
10754
10819
  /**
10755
- *
10756
- * @type {PortfolioSyncInfo}
10757
- * @memberof Portfolio
10820
+ * 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
10821
  */
10759
- syncInfo: PortfolioSyncInfo;
10822
+ renamePortfolio(requestParameters: RenamePortfolioOperationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
10760
10823
  }
10761
10824
 
10762
10825
  /**
@@ -11923,6 +11986,62 @@ declare function QuoteExpirationToJSON(value?: QuoteExpiration | null): any;
11923
11986
 
11924
11987
  declare function QuoteExpirationToJSONRecursive(value?: QuoteExpiration | null, ignoreParent?: boolean): any;
11925
11988
 
11989
+ /**
11990
+ * brokerize
11991
+ * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
11992
+ *
11993
+ *
11994
+ *
11995
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11996
+ * https://openapi-generator.tech
11997
+ * Do not edit the class manually.
11998
+ */
11999
+ /**
12000
+ *
12001
+ * @export
12002
+ * @interface RecoveryPhraseItem
12003
+ */
12004
+ declare interface RecoveryPhraseItem {
12005
+ /**
12006
+ *
12007
+ * @type {Date}
12008
+ * @memberof RecoveryPhraseItem
12009
+ */
12010
+ createdAt: Date;
12011
+ /**
12012
+ *
12013
+ * @type {Date}
12014
+ * @memberof RecoveryPhraseItem
12015
+ */
12016
+ expiresAt: Date;
12017
+ /**
12018
+ *
12019
+ * @type {string}
12020
+ * @memberof RecoveryPhraseItem
12021
+ */
12022
+ id: string;
12023
+ /**
12024
+ *
12025
+ * @type {Date}
12026
+ * @memberof RecoveryPhraseItem
12027
+ */
12028
+ lastUsedAt: Date;
12029
+ /**
12030
+ *
12031
+ * @type {string}
12032
+ * @memberof RecoveryPhraseItem
12033
+ */
12034
+ name: string;
12035
+ }
12036
+
12037
+ declare function RecoveryPhraseItemFromJSON(json: any): RecoveryPhraseItem;
12038
+
12039
+ declare function RecoveryPhraseItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecoveryPhraseItem;
12040
+
12041
+ declare function RecoveryPhraseItemToJSON(value?: RecoveryPhraseItem | null): any;
12042
+
12043
+ declare function RecoveryPhraseItemToJSONRecursive(value?: RecoveryPhraseItem | null, ignoreParent?: boolean): any;
12044
+
11926
12045
  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
12046
 
11928
12047
  export declare type RegisteredUserAuthContextConfiguration = {
@@ -12714,6 +12833,104 @@ declare interface Session {
12714
12833
  syncInfo: SessionSyncInfo;
12715
12834
  }
12716
12835
 
12836
+ /**
12837
+ *
12838
+ */
12839
+ declare class SessionApi extends runtime.BaseAPI {
12840
+ /**
12841
+ */
12842
+ addSessionRaw(requestParameters: AddSessionRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<LoginResponse>>;
12843
+ /**
12844
+ */
12845
+ addSession(requestParameters: AddSessionRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<LoginResponse>;
12846
+ /**
12847
+ * If login returns the state `challenge`, the login must be completed by providing a challenge response first.
12848
+ */
12849
+ addSessionCompleteChallengeRaw(requestParameters: AddSessionCompleteChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<LoginResponseReady>>;
12850
+ /**
12851
+ * If login returns the state `challenge`, the login must be completed by providing a challenge response first.
12852
+ */
12853
+ addSessionCompleteChallenge(requestParameters: AddSessionCompleteChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<LoginResponseReady>;
12854
+ /**
12855
+ * Cancel a decoupled operation. This is deprecated, use the new `CancelDecoupledOperation` instead (which does not require the sessionId anymore).
12856
+ */
12857
+ cancelDecoupledOperationLegacyRaw(requestParameters: CancelDecoupledOperationLegacyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
12858
+ /**
12859
+ * Cancel a decoupled operation. This is deprecated, use the new `CancelDecoupledOperation` instead (which does not require the sessionId anymore).
12860
+ */
12861
+ cancelDecoupledOperationLegacy(requestParameters: CancelDecoupledOperationLegacyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
12862
+ /**
12863
+ * 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.
12864
+ */
12865
+ confirmOAuthRaw(requestParameters: ConfirmOAuthRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<ConfirmOAuthResponse>>;
12866
+ /**
12867
+ * 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.
12868
+ */
12869
+ confirmOAuth(requestParameters: ConfirmOAuthRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<ConfirmOAuthResponse>;
12870
+ /**
12871
+ * If the user chose an auth method from `GetAuthInfo` with the flow `CHALLENGE_RESPONSE`, before enabling session TAN, a challenge must be requested first.
12872
+ */
12873
+ createSessionTanChallengeRaw(requestParameters: CreateSessionTanChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<Challenge>>;
12874
+ /**
12875
+ * If the user chose an auth method from `GetAuthInfo` with the flow `CHALLENGE_RESPONSE`, before enabling session TAN, a challenge must be requested first.
12876
+ */
12877
+ createSessionTanChallenge(requestParameters: CreateSessionTanChallengeRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<Challenge>;
12878
+ /**
12879
+ */
12880
+ enableSessionTanRaw(requestParameters: EnableSessionTanRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<EnableSessionTanResponse>>;
12881
+ /**
12882
+ */
12883
+ enableSessionTan(requestParameters: EnableSessionTanRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<EnableSessionTanResponse>;
12884
+ /**
12885
+ * 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.
12886
+ */
12887
+ endSessionTanRaw(requestParameters: EndSessionTanRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<EndSessionTanResponse>>;
12888
+ /**
12889
+ * 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.
12890
+ */
12891
+ endSessionTan(requestParameters: EndSessionTanRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<EndSessionTanResponse>;
12892
+ /**
12893
+ * Get the status of a decoupled operation. This is deprecated, use the new `GetDecoupledOperation` instead, which does not require the `sessionId` any more.
12894
+ */
12895
+ getDecoupledOperationStatusLegacyRaw(requestParameters: GetDecoupledOperationStatusLegacyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<DecoupledOperationStatus>>;
12896
+ /**
12897
+ * Get the status of a decoupled operation. This is deprecated, use the new `GetDecoupledOperation` instead, which does not require the `sessionId` any more.
12898
+ */
12899
+ getDecoupledOperationStatusLegacy(requestParameters: GetDecoupledOperationStatusLegacyRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<DecoupledOperationStatus>;
12900
+ /**
12901
+ * Get the currently active broker sessions of the user\'s account.
12902
+ */
12903
+ getSessionsRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<SessionResponse>>;
12904
+ /**
12905
+ * Get the currently active broker sessions of the user\'s account.
12906
+ */
12907
+ getSessions(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<SessionResponse>;
12908
+ /**
12909
+ * Log out from the given broker session.
12910
+ */
12911
+ logoutSessionRaw(requestParameters: LogoutSessionRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<LogoutOkResponseBody>>;
12912
+ /**
12913
+ * Log out from the given broker session.
12914
+ */
12915
+ logoutSession(requestParameters: LogoutSessionRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<LogoutOkResponseBody>;
12916
+ /**
12917
+ * 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
12918
+ */
12919
+ prepareOAuthRedirectRaw(requestParameters: PrepareOAuthRedirectRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<PrepareOAuthRedirectResponse>>;
12920
+ /**
12921
+ * 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
12922
+ */
12923
+ prepareOAuthRedirect(requestParameters: PrepareOAuthRedirectRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<PrepareOAuthRedirectResponse>;
12924
+ /**
12925
+ * 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.
12926
+ */
12927
+ triggerSessionSyncRaw(requestParameters: TriggerSessionSyncRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<OkResponseBody>>;
12928
+ /**
12929
+ * 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.
12930
+ */
12931
+ triggerSessionSync(requestParameters: TriggerSessionSyncRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<OkResponseBody>;
12932
+ }
12933
+
12717
12934
  declare function SessionFromJSON(json: any): Session;
12718
12935
 
12719
12936
  declare function SessionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Session;
@@ -14202,6 +14419,14 @@ declare interface UpdateTradeDraftRequest {
14202
14419
  *
14203
14420
  */
14204
14421
  declare class UserApi extends runtime.BaseAPI {
14422
+ /**
14423
+ * 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.
14424
+ */
14425
+ checkRecoveryPhraseRaw(requestParameters: CheckRecoveryPhraseRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<CheckRecoveryPhrase200Response>>;
14426
+ /**
14427
+ * 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.
14428
+ */
14429
+ checkRecoveryPhrase(requestParameters: CheckRecoveryPhraseRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<CheckRecoveryPhrase200Response>;
14205
14430
  /**
14206
14431
  * Create a token for the current user. The token can be used to access resources on behalf of the user.
14207
14432
  */
@@ -14210,6 +14435,38 @@ declare class UserApi extends runtime.BaseAPI {
14210
14435
  * Create a token for the current user. The token can be used to access resources on behalf of the user.
14211
14436
  */
14212
14437
  createAccessToken(requestParameters: CreateAccessTokenRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<AccessTokenResult>;
14438
+ /**
14439
+ * 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.
14440
+ */
14441
+ createGuestUserRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<CreateGuestUserResponse>>;
14442
+ /**
14443
+ * 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.
14444
+ */
14445
+ createGuestUser(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<CreateGuestUserResponse>;
14446
+ /**
14447
+ * 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`).
14448
+ */
14449
+ createRecoveryPhraseRaw(requestParameters: CreateRecoveryPhraseRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<CreateRecoveryPhraseResult>>;
14450
+ /**
14451
+ * 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`).
14452
+ */
14453
+ createRecoveryPhrase(requestParameters: CreateRecoveryPhraseRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<CreateRecoveryPhraseResult>;
14454
+ /**
14455
+ * Delete the current user (only allowed if it is a guest account). Also logs out all active broker sessions attached to the user.
14456
+ */
14457
+ deleteGuestUserRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
14458
+ /**
14459
+ * Delete the current user (only allowed if it is a guest account). Also logs out all active broker sessions attached to the user.
14460
+ */
14461
+ deleteGuestUser(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
14462
+ /**
14463
+ * Delete the RecoveryPhrase from the account.
14464
+ */
14465
+ deleteRecoveryPhraseRaw(requestParameters: DeleteRecoveryPhraseRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
14466
+ /**
14467
+ * Delete the RecoveryPhrase from the account.
14468
+ */
14469
+ deleteRecoveryPhrase(requestParameters: DeleteRecoveryPhraseRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
14213
14470
  /**
14214
14471
  */
14215
14472
  getAccessTokensRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetAccessTokensResponse>>;
@@ -14224,6 +14481,38 @@ declare class UserApi extends runtime.BaseAPI {
14224
14481
  * Figure out which permissions are available to select from for a new access token.
14225
14482
  */
14226
14483
  getAcessTokenAvailablePermissions(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetAcessTokenAvailablePermissions200Response>;
14484
+ /**
14485
+ * Lists all the recoveryPhrases metadata the user has in their account.
14486
+ */
14487
+ getRecoveryPhrasesRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetRecoveryPhrasesResponse>>;
14488
+ /**
14489
+ * Lists all the recoveryPhrases metadata the user has in their account.
14490
+ */
14491
+ getRecoveryPhrases(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetRecoveryPhrasesResponse>;
14492
+ /**
14493
+ * Checks the provided authentication and returns the logged-in user.
14494
+ */
14495
+ getUserRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<GetUserResponse>>;
14496
+ /**
14497
+ * Checks the provided authentication and returns the logged-in user.
14498
+ */
14499
+ getUser(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<GetUserResponse>;
14500
+ /**
14501
+ * 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.
14502
+ */
14503
+ obtainTokenRaw(requestParameters: ObtainTokenRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<TokenResponse>>;
14504
+ /**
14505
+ * 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.
14506
+ */
14507
+ obtainToken(requestParameters: ObtainTokenRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<TokenResponse>;
14508
+ /**
14509
+ * 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.
14510
+ */
14511
+ obtainTokenByRecoveryPhraseRaw(requestParameters: ObtainTokenByRecoveryPhraseRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<TokenResponse>>;
14512
+ /**
14513
+ * 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.
14514
+ */
14515
+ obtainTokenByRecoveryPhrase(requestParameters: ObtainTokenByRecoveryPhraseRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<TokenResponse>;
14227
14516
  /**
14228
14517
  */
14229
14518
  revokeAccessTokenRaw(requestParameters: RevokeAccessTokenRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
@@ -14333,6 +14622,20 @@ declare interface WebSocket_2 {
14333
14622
  removeEventListener<K extends keyof WebSocketEventMap_2>(type: K, listener: (this: WebSocket_2, ev: WebSocketEventMap_2[K]) => any, options?: boolean | EventListenerOptions_2): void;
14334
14623
  }
14335
14624
 
14625
+ /**
14626
+ *
14627
+ */
14628
+ declare class WebsocketApi extends runtime.BaseAPI {
14629
+ /**
14630
+ * 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> } ```
14631
+ */
14632
+ websocketRaw(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<void>>;
14633
+ /**
14634
+ * 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> } ```
14635
+ */
14636
+ websocket(initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<void>;
14637
+ }
14638
+
14336
14639
  declare type WebSocketAuthenticatedMessage = {
14337
14640
  cmd: "authenticated";
14338
14641
  };