@brokerize/client 1.1.3 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +1 -1
  2. package/dist/authorizedApiContext.d.ts +2 -2
  3. package/dist/client.d.ts +334 -15
  4. package/dist/swagger/apis/CancelOrderApi.d.ts +5 -5
  5. package/dist/swagger/apis/CancelOrderApi.js +6 -5
  6. package/dist/swagger/apis/ChangeOrderApi.d.ts +3 -3
  7. package/dist/swagger/apis/ChangeOrderApi.js +4 -3
  8. package/dist/swagger/apis/DefaultApi.d.ts +23 -0
  9. package/dist/swagger/apis/DefaultApi.js +82 -8
  10. package/dist/swagger/apis/TradeApi.d.ts +2 -2
  11. package/dist/swagger/apis/TradeApi.js +2 -2
  12. package/dist/swagger/models/AuthMethodDecoupled.d.ts +1 -2
  13. package/dist/swagger/models/CancelOrderDecoupled.d.ts +40 -0
  14. package/dist/swagger/models/CancelOrderDecoupled.js +46 -0
  15. package/dist/swagger/models/CancelOrderDecoupledAllOf.d.ts +34 -0
  16. package/dist/swagger/models/CancelOrderDecoupledAllOf.js +44 -0
  17. package/dist/swagger/models/CancelOrderDecoupledSpecifics.d.ts +27 -0
  18. package/dist/swagger/models/CancelOrderDecoupledSpecifics.js +38 -0
  19. package/dist/swagger/models/CancelOrderParams.d.ts +3 -0
  20. package/dist/swagger/models/CancelOrderParams.js +5 -0
  21. package/dist/swagger/models/CancelOrderParamsMode.d.ts +1 -0
  22. package/dist/swagger/models/CancelOrderParamsMode.js +1 -0
  23. package/dist/swagger/models/CancelOrderResponse.d.ts +28 -0
  24. package/dist/swagger/models/CancelOrderResponse.js +40 -0
  25. package/dist/swagger/models/ChangeOrderResponse.d.ts +28 -0
  26. package/dist/swagger/models/ChangeOrderResponse.js +40 -0
  27. package/dist/swagger/models/CreateTradeResponse.d.ts +9 -1
  28. package/dist/swagger/models/CreateTradeResponse.js +4 -0
  29. package/dist/swagger/models/DecoupledOperationStatus.d.ts +14 -0
  30. package/dist/swagger/models/DecoupledOperationStatus.js +4 -0
  31. package/dist/swagger/models/SummarizedTrade.d.ts +12 -0
  32. package/dist/swagger/models/SummarizedTrade.js +4 -0
  33. package/dist/swagger/models/TradeStatistics.d.ts +45 -0
  34. package/dist/swagger/models/TradeStatistics.js +31 -0
  35. package/dist/swagger/models/index.d.ts +5 -0
  36. package/dist/swagger/models/index.js +5 -0
  37. package/package.json +1 -1
@@ -0,0 +1,28 @@
1
+ /**
2
+ * brokerize
3
+ * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
4
+ *
5
+ *
6
+ *
7
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8
+ * https://openapi-generator.tech
9
+ * Do not edit the class manually.
10
+ */
11
+ /**
12
+ *
13
+ * @export
14
+ * @interface ChangeOrderResponse
15
+ */
16
+ export interface ChangeOrderResponse {
17
+ /**
18
+ * If a decoupled method is used to change the order, the cancellation process can be observed through the
19
+ * `decoupledOperationId`.
20
+ * @type {string}
21
+ * @memberof ChangeOrderResponse
22
+ */
23
+ decoupledOperationId?: string;
24
+ }
25
+ export declare function ChangeOrderResponseFromJSON(json: any): ChangeOrderResponse;
26
+ export declare function ChangeOrderResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChangeOrderResponse;
27
+ export declare function ChangeOrderResponseToJSONRecursive(value?: ChangeOrderResponse | null, ignoreParent?: boolean): any;
28
+ export declare function ChangeOrderResponseToJSON(value?: ChangeOrderResponse | null): any;
@@ -0,0 +1,40 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * brokerize
5
+ * The brokerize API allows clients to implement multi-brokerage with a unified interface. For more information, visit brokerize.com
6
+ *
7
+ *
8
+ *
9
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10
+ * https://openapi-generator.tech
11
+ * Do not edit the class manually.
12
+ */
13
+ import { exists } from "../runtime";
14
+ export function ChangeOrderResponseFromJSON(json) {
15
+ return ChangeOrderResponseFromJSONTyped(json, false);
16
+ }
17
+ export function ChangeOrderResponseFromJSONTyped(json, ignoreDiscriminator) {
18
+ if (json === undefined || json === null) {
19
+ return json;
20
+ }
21
+ return {
22
+ decoupledOperationId: !exists(json, "decoupledOperationId")
23
+ ? undefined
24
+ : json["decoupledOperationId"],
25
+ };
26
+ }
27
+ export function ChangeOrderResponseToJSONRecursive(value, ignoreParent = false) {
28
+ if (value === undefined) {
29
+ return undefined;
30
+ }
31
+ if (value === null) {
32
+ return null;
33
+ }
34
+ return {
35
+ decoupledOperationId: value.decoupledOperationId,
36
+ };
37
+ }
38
+ export function ChangeOrderResponseToJSON(value) {
39
+ return ChangeOrderResponseToJSONRecursive(value, false);
40
+ }
@@ -15,7 +15,15 @@
15
15
  */
16
16
  export interface CreateTradeResponse {
17
17
  /**
18
- *
18
+ * If a decoupled method is used to create the trade, the creation process can be observed through the
19
+ * `decoupledOperationId`. In this case, no `orderId` is returned.
20
+ * @type {string}
21
+ * @memberof CreateTradeResponse
22
+ */
23
+ decoupledOperationId?: string;
24
+ /**
25
+ * The id of the created order, if applicable. Some brokers don't return an orderId in all cases, so
26
+ * frontends should be able to just show a generic "order has been created" message in this case.
19
27
  * @type {string}
20
28
  * @memberof CreateTradeResponse
21
29
  */
@@ -19,6 +19,9 @@ export function CreateTradeResponseFromJSONTyped(json, ignoreDiscriminator) {
19
19
  return json;
20
20
  }
21
21
  return {
22
+ decoupledOperationId: !exists(json, "decoupledOperationId")
23
+ ? undefined
24
+ : json["decoupledOperationId"],
22
25
  orderId: !exists(json, "orderId") ? undefined : json["orderId"],
23
26
  };
24
27
  }
@@ -30,6 +33,7 @@ export function CreateTradeResponseToJSONRecursive(value, ignoreParent = false)
30
33
  return null;
31
34
  }
32
35
  return {
36
+ decoupledOperationId: value.decoupledOperationId,
33
37
  orderId: value.orderId,
34
38
  };
35
39
  }
@@ -15,6 +15,20 @@ import { DecoupledOperationState } from "./DecoupledOperationState";
15
15
  * @interface DecoupledOperationStatus
16
16
  */
17
17
  export interface DecoupledOperationStatus {
18
+ /**
19
+ * If:
20
+ * - the decoupled operation is an order creation
21
+ * - *AND* it is in the state `AUTHORIZATION_USER_ACCEPTED`
22
+ * - *AND* the broker supports retrieving this information
23
+ *
24
+ * This is the id of the created order. Note that depending on the broker, it is possible
25
+ * (as with non-decoupled order creations as well), that the broker does not return this id, but
26
+ * instead will add the order to the order book asynchronously. In this case it is not possible to directly
27
+ * show an order receipt, but just a message (e.g. "Order has been created successfully - check order list for updates").
28
+ * @type {string}
29
+ * @memberof DecoupledOperationStatus
30
+ */
31
+ createdOrderId?: string;
18
32
  /**
19
33
  *
20
34
  * @type {DecoupledOperationState}
@@ -20,6 +20,9 @@ export function DecoupledOperationStatusFromJSONTyped(json, ignoreDiscriminator)
20
20
  return json;
21
21
  }
22
22
  return {
23
+ createdOrderId: !exists(json, "createdOrderId")
24
+ ? undefined
25
+ : json["createdOrderId"],
23
26
  state: DecoupledOperationStateFromJSON(json["state"]),
24
27
  text: !exists(json, "text") ? undefined : json["text"],
25
28
  };
@@ -32,6 +35,7 @@ export function DecoupledOperationStatusToJSONRecursive(value, ignoreParent = fa
32
35
  return null;
33
36
  }
34
37
  return {
38
+ createdOrderId: value.createdOrderId,
35
39
  state: DecoupledOperationStateToJSON(value.state),
36
40
  text: value.text,
37
41
  };
@@ -16,6 +16,12 @@ import { Security } from "./Security";
16
16
  * @interface SummarizedTrade
17
17
  */
18
18
  export interface SummarizedTrade {
19
+ /**
20
+ *
21
+ * @type {Amount}
22
+ * @memberof SummarizedTrade
23
+ */
24
+ closeAvgQuotation: Amount;
19
25
  /**
20
26
  *
21
27
  * @type {Date}
@@ -40,6 +46,12 @@ export interface SummarizedTrade {
40
46
  * @memberof SummarizedTrade
41
47
  */
42
48
  id: string;
49
+ /**
50
+ *
51
+ * @type {Amount}
52
+ * @memberof SummarizedTrade
53
+ */
54
+ openAvgQuotation: Amount;
43
55
  /**
44
56
  *
45
57
  * @type {Date}
@@ -21,10 +21,12 @@ export function SummarizedTradeFromJSONTyped(json, ignoreDiscriminator) {
21
21
  return json;
22
22
  }
23
23
  return {
24
+ closeAvgQuotation: AmountFromJSON(json["closeAvgQuotation"]),
24
25
  closeDateTime: new Date(json["closeDateTime"]),
25
26
  details: json["details"],
26
27
  fees: !exists(json, "fees") ? undefined : AmountFromJSON(json["fees"]),
27
28
  id: json["id"],
29
+ openAvgQuotation: AmountFromJSON(json["openAvgQuotation"]),
28
30
  openDateTime: new Date(json["openDateTime"]),
29
31
  profitLossAbs: AmountFromJSON(json["profitLossAbs"]),
30
32
  profitLossRel: json["profitLossRel"],
@@ -40,10 +42,12 @@ export function SummarizedTradeToJSONRecursive(value, ignoreParent = false) {
40
42
  return null;
41
43
  }
42
44
  return {
45
+ closeAvgQuotation: AmountToJSON(value.closeAvgQuotation),
43
46
  closeDateTime: value.closeDateTime.toISOString(),
44
47
  details: value.details,
45
48
  fees: AmountToJSON(value.fees),
46
49
  id: value.id,
50
+ openAvgQuotation: AmountToJSON(value.openAvgQuotation),
47
51
  openDateTime: value.openDateTime.toISOString(),
48
52
  profitLossAbs: AmountToJSON(value.profitLossAbs),
49
53
  profitLossRel: value.profitLossRel,
@@ -8,6 +8,8 @@
8
8
  * https://openapi-generator.tech
9
9
  * Do not edit the class manually.
10
10
  */
11
+ import { Amount } from "./Amount";
12
+ import { SummarizedTrade } from "./SummarizedTrade";
11
13
  import { TradeStatisticsHoldingPeriodInDays } from "./TradeStatisticsHoldingPeriodInDays";
12
14
  /**
13
15
  *
@@ -15,6 +17,30 @@ import { TradeStatisticsHoldingPeriodInDays } from "./TradeStatisticsHoldingPeri
15
17
  * @interface TradeStatistics
16
18
  */
17
19
  export interface TradeStatistics {
20
+ /**
21
+ *
22
+ * @type {Amount}
23
+ * @memberof TradeStatistics
24
+ */
25
+ avgLossAbs?: Amount;
26
+ /**
27
+ *
28
+ * @type {Amount}
29
+ * @memberof TradeStatistics
30
+ */
31
+ avgProfitAbs?: Amount;
32
+ /**
33
+ *
34
+ * @type {Amount}
35
+ * @memberof TradeStatistics
36
+ */
37
+ avgProfitLossAbs?: Amount;
38
+ /**
39
+ *
40
+ * @type {SummarizedTrade}
41
+ * @memberof TradeStatistics
42
+ */
43
+ bestTrade?: SummarizedTrade;
18
44
  /**
19
45
  * Which fraction of the trades where winners. 1 is 100%, so a value of 1 would indicate
20
46
  * "all trades were winners".
@@ -46,6 +72,19 @@ export interface TradeStatistics {
46
72
  * @memberof TradeStatistics
47
73
  */
48
74
  loserCount: number;
75
+ /**
76
+ * Profits/Losses. E.g. if there were 2000€ profits in winning trades and 1000€ losses in losing trades,
77
+ * the profitFactor would be 2000€ / 1000€ = 2.
78
+ * @type {number}
79
+ * @memberof TradeStatistics
80
+ */
81
+ profitFactor?: number;
82
+ /**
83
+ *
84
+ * @type {Amount}
85
+ * @memberof TradeStatistics
86
+ */
87
+ profitLossAbs?: Amount;
49
88
  /**
50
89
  * How many trades are part of the calculation.
51
90
  * @type {number}
@@ -58,6 +97,12 @@ export interface TradeStatistics {
58
97
  * @memberof TradeStatistics
59
98
  */
60
99
  winnerCount: number;
100
+ /**
101
+ *
102
+ * @type {SummarizedTrade}
103
+ * @memberof TradeStatistics
104
+ */
105
+ worstTrade?: SummarizedTrade;
61
106
  }
62
107
  export declare function TradeStatisticsFromJSON(json: any): TradeStatistics;
63
108
  export declare function TradeStatisticsFromJSONTyped(json: any, ignoreDiscriminator: boolean): TradeStatistics;
@@ -10,6 +10,9 @@
10
10
  * https://openapi-generator.tech
11
11
  * Do not edit the class manually.
12
12
  */
13
+ import { exists } from "../runtime";
14
+ import { AmountFromJSON, AmountToJSON, } from "./Amount";
15
+ import { SummarizedTradeFromJSON, SummarizedTradeToJSON, } from "./SummarizedTrade";
13
16
  import { TradeStatisticsHoldingPeriodInDaysFromJSON, TradeStatisticsHoldingPeriodInDaysToJSON, } from "./TradeStatisticsHoldingPeriodInDays";
14
17
  export function TradeStatisticsFromJSON(json) {
15
18
  return TradeStatisticsFromJSONTyped(json, false);
@@ -19,13 +22,34 @@ export function TradeStatisticsFromJSONTyped(json, ignoreDiscriminator) {
19
22
  return json;
20
23
  }
21
24
  return {
25
+ avgLossAbs: !exists(json, "avgLossAbs")
26
+ ? undefined
27
+ : AmountFromJSON(json["avgLossAbs"]),
28
+ avgProfitAbs: !exists(json, "avgProfitAbs")
29
+ ? undefined
30
+ : AmountFromJSON(json["avgProfitAbs"]),
31
+ avgProfitLossAbs: !exists(json, "avgProfitLossAbs")
32
+ ? undefined
33
+ : AmountFromJSON(json["avgProfitLossAbs"]),
34
+ bestTrade: !exists(json, "bestTrade")
35
+ ? undefined
36
+ : SummarizedTradeFromJSON(json["bestTrade"]),
22
37
  hitRate: json["hitRate"],
23
38
  holdingPeriodInDays: TradeStatisticsHoldingPeriodInDaysFromJSON(json["holdingPeriodInDays"]),
24
39
  longestLosingStreak: json["longestLosingStreak"],
25
40
  longestWinningStreak: json["longestWinningStreak"],
26
41
  loserCount: json["loserCount"],
42
+ profitFactor: !exists(json, "profitFactor")
43
+ ? undefined
44
+ : json["profitFactor"],
45
+ profitLossAbs: !exists(json, "profitLossAbs")
46
+ ? undefined
47
+ : AmountFromJSON(json["profitLossAbs"]),
27
48
  tradeCount: json["tradeCount"],
28
49
  winnerCount: json["winnerCount"],
50
+ worstTrade: !exists(json, "worstTrade")
51
+ ? undefined
52
+ : SummarizedTradeFromJSON(json["worstTrade"]),
29
53
  };
30
54
  }
31
55
  export function TradeStatisticsToJSONRecursive(value, ignoreParent = false) {
@@ -36,13 +60,20 @@ export function TradeStatisticsToJSONRecursive(value, ignoreParent = false) {
36
60
  return null;
37
61
  }
38
62
  return {
63
+ avgLossAbs: AmountToJSON(value.avgLossAbs),
64
+ avgProfitAbs: AmountToJSON(value.avgProfitAbs),
65
+ avgProfitLossAbs: AmountToJSON(value.avgProfitLossAbs),
66
+ bestTrade: SummarizedTradeToJSON(value.bestTrade),
39
67
  hitRate: value.hitRate,
40
68
  holdingPeriodInDays: TradeStatisticsHoldingPeriodInDaysToJSON(value.holdingPeriodInDays),
41
69
  longestLosingStreak: value.longestLosingStreak,
42
70
  longestWinningStreak: value.longestWinningStreak,
43
71
  loserCount: value.loserCount,
72
+ profitFactor: value.profitFactor,
73
+ profitLossAbs: AmountToJSON(value.profitLossAbs),
44
74
  tradeCount: value.tradeCount,
45
75
  winnerCount: value.winnerCount,
76
+ worstTrade: SummarizedTradeToJSON(value.worstTrade),
46
77
  };
47
78
  }
48
79
  export function TradeStatisticsToJSON(value) {
@@ -31,14 +31,19 @@ export * from "./CancelOrderChallengeParams";
31
31
  export * from "./CancelOrderChallengeResponse";
32
32
  export * from "./CancelOrderChallengeResponseAllOf";
33
33
  export * from "./CancelOrderChallengeResponseSpecifics";
34
+ export * from "./CancelOrderDecoupled";
35
+ export * from "./CancelOrderDecoupledAllOf";
36
+ export * from "./CancelOrderDecoupledSpecifics";
34
37
  export * from "./CancelOrderParams";
35
38
  export * from "./CancelOrderParamsMode";
39
+ export * from "./CancelOrderResponse";
36
40
  export * from "./CashAccount";
37
41
  export * from "./CashAccountQuotes";
38
42
  export * from "./CashQuotation";
39
43
  export * from "./Challenge";
40
44
  export * from "./ChangeOrderChallengeParams";
41
45
  export * from "./ChangeOrderParams";
46
+ export * from "./ChangeOrderResponse";
42
47
  export * from "./ClientConfig";
43
48
  export * from "./ClientConfigMaintenanceStatus";
44
49
  export * from "./ClientConfigUpdate";
@@ -33,14 +33,19 @@ export * from "./CancelOrderChallengeParams";
33
33
  export * from "./CancelOrderChallengeResponse";
34
34
  export * from "./CancelOrderChallengeResponseAllOf";
35
35
  export * from "./CancelOrderChallengeResponseSpecifics";
36
+ export * from "./CancelOrderDecoupled";
37
+ export * from "./CancelOrderDecoupledAllOf";
38
+ export * from "./CancelOrderDecoupledSpecifics";
36
39
  export * from "./CancelOrderParams";
37
40
  export * from "./CancelOrderParamsMode";
41
+ export * from "./CancelOrderResponse";
38
42
  export * from "./CashAccount";
39
43
  export * from "./CashAccountQuotes";
40
44
  export * from "./CashQuotation";
41
45
  export * from "./Challenge";
42
46
  export * from "./ChangeOrderChallengeParams";
43
47
  export * from "./ChangeOrderParams";
48
+ export * from "./ChangeOrderResponse";
44
49
  export * from "./ClientConfig";
45
50
  export * from "./ClientConfigMaintenanceStatus";
46
51
  export * from "./ClientConfigUpdate";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brokerize/client",
3
- "version": "1.1.3",
3
+ "version": "1.2.0",
4
4
  "description": "Client for the brokerize.com API",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/brokerize/client-js#readme",