zklighter-perps 1.0.120 → 1.0.122

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.
@@ -64,8 +64,9 @@ export interface BlockTxsRequest {
64
64
 
65
65
  export interface DepositHistoryRequest {
66
66
  account_index: number;
67
- auth: string;
68
67
  l1_address: string;
68
+ authorization?: string;
69
+ auth?: string;
69
70
  cursor?: string;
70
71
  filter?: DepositHistoryFilterEnum;
71
72
  }
@@ -97,6 +98,7 @@ export interface SetAccountMetadataRequest {
97
98
  api_key_index: number;
98
99
  metadata: string;
99
100
  auth: string;
101
+ authorization?: string;
100
102
  }
101
103
 
102
104
  export interface TxRequest {
@@ -115,7 +117,8 @@ export interface TxsRequest {
115
117
 
116
118
  export interface WithdrawHistoryRequest {
117
119
  account_index: number;
118
- auth: string;
120
+ authorizatio?: string;
121
+ auth?: string;
119
122
  cursor?: string;
120
123
  filter?: WithdrawHistoryFilterEnum;
121
124
  }
@@ -310,13 +313,6 @@ export class TransactionApi extends runtime.BaseAPI {
310
313
  );
311
314
  }
312
315
 
313
- if (requestParameters['auth'] == null) {
314
- throw new runtime.RequiredError(
315
- 'auth',
316
- 'Required parameter "auth" was null or undefined when calling depositHistory().'
317
- );
318
- }
319
-
320
316
  if (requestParameters['l1_address'] == null) {
321
317
  throw new runtime.RequiredError(
322
318
  'l1_address',
@@ -348,6 +344,10 @@ export class TransactionApi extends runtime.BaseAPI {
348
344
 
349
345
  const headerParameters: runtime.HTTPHeaders = {};
350
346
 
347
+ if (requestParameters['authorization'] != null) {
348
+ headerParameters['authorization'] = String(requestParameters['authorization']);
349
+ }
350
+
351
351
  const response = await this.request({
352
352
  path: `/api/v1/deposit/history`,
353
353
  method: 'GET',
@@ -638,6 +638,10 @@ export class TransactionApi extends runtime.BaseAPI {
638
638
 
639
639
  const headerParameters: runtime.HTTPHeaders = {};
640
640
 
641
+ if (requestParameters['authorization'] != null) {
642
+ headerParameters['authorization'] = String(requestParameters['authorization']);
643
+ }
644
+
641
645
  const consumes: runtime.Consume[] = [
642
646
  { contentType: 'multipart/form-data' },
643
647
  ];
@@ -836,13 +840,6 @@ export class TransactionApi extends runtime.BaseAPI {
836
840
  );
837
841
  }
838
842
 
839
- if (requestParameters['auth'] == null) {
840
- throw new runtime.RequiredError(
841
- 'auth',
842
- 'Required parameter "auth" was null or undefined when calling withdrawHistory().'
843
- );
844
- }
845
-
846
843
  const queryParameters: any = {};
847
844
 
848
845
  if (requestParameters['account_index'] != null) {
@@ -863,6 +860,10 @@ export class TransactionApi extends runtime.BaseAPI {
863
860
 
864
861
  const headerParameters: runtime.HTTPHeaders = {};
865
862
 
863
+ if (requestParameters['authorizatio'] != null) {
864
+ headerParameters['authorizatio'] = String(requestParameters['authorizatio']);
865
+ }
866
+
866
867
  const response = await this.request({
867
868
  path: `/api/v1/withdraw/history`,
868
869
  method: 'GET',
@@ -19,6 +19,12 @@ import { mapValues } from '../runtime';
19
19
  * @interface AccountMetadata
20
20
  */
21
21
  export interface AccountMetadata {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof AccountMetadata
26
+ */
27
+ account_index: number;
22
28
  /**
23
29
  *
24
30
  * @type {string}
@@ -32,34 +38,28 @@ export interface AccountMetadata {
32
38
  */
33
39
  description: string;
34
40
  /**
35
- *
41
+ * Remove After FE uses L1 meta endpoint
36
42
  * @type {boolean}
37
43
  * @memberof AccountMetadata
38
44
  */
39
45
  can_invite: boolean;
40
46
  /**
41
- *
47
+ * Remove After FE uses L1 meta endpoint
42
48
  * @type {string}
43
49
  * @memberof AccountMetadata
44
50
  */
45
51
  referral_points_percentage: string;
46
- /**
47
- *
48
- * @type {number}
49
- * @memberof AccountMetadata
50
- */
51
- max_referral_usage_limit: number;
52
52
  }
53
53
 
54
54
  /**
55
55
  * Check if a given object implements the AccountMetadata interface.
56
56
  */
57
57
  export function instanceOfAccountMetadata(value: object): value is AccountMetadata {
58
+ if (!('account_index' in value) || value['account_index'] === undefined) return false;
58
59
  if (!('name' in value) || value['name'] === undefined) return false;
59
60
  if (!('description' in value) || value['description'] === undefined) return false;
60
61
  if (!('can_invite' in value) || value['can_invite'] === undefined) return false;
61
62
  if (!('referral_points_percentage' in value) || value['referral_points_percentage'] === undefined) return false;
62
- if (!('max_referral_usage_limit' in value) || value['max_referral_usage_limit'] === undefined) return false;
63
63
  return true;
64
64
  }
65
65
 
@@ -73,11 +73,11 @@ export function AccountMetadataFromJSONTyped(json: any, ignoreDiscriminator: boo
73
73
  }
74
74
  return {
75
75
 
76
+ 'account_index': json['account_index'],
76
77
  'name': json['name'],
77
78
  'description': json['description'],
78
79
  'can_invite': json['can_invite'],
79
80
  'referral_points_percentage': json['referral_points_percentage'],
80
- 'max_referral_usage_limit': json['max_referral_usage_limit'],
81
81
  };
82
82
  }
83
83
 
@@ -87,11 +87,11 @@ export function AccountMetadataToJSON(value?: AccountMetadata | null): any {
87
87
  }
88
88
  return {
89
89
 
90
+ 'account_index': value['account_index'],
90
91
  'name': value['name'],
91
92
  'description': value['description'],
92
93
  'can_invite': value['can_invite'],
93
94
  'referral_points_percentage': value['referral_points_percentage'],
94
- 'max_referral_usage_limit': value['max_referral_usage_limit'],
95
95
  };
96
96
  }
97
97
 
@@ -13,12 +13,12 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
- import type { Mapint64AccountMetadata } from './Mapint64AccountMetadata';
16
+ import type { AccountMetadata } from './AccountMetadata';
17
17
  import {
18
- Mapint64AccountMetadataFromJSON,
19
- Mapint64AccountMetadataFromJSONTyped,
20
- Mapint64AccountMetadataToJSON,
21
- } from './Mapint64AccountMetadata';
18
+ AccountMetadataFromJSON,
19
+ AccountMetadataFromJSONTyped,
20
+ AccountMetadataToJSON,
21
+ } from './AccountMetadata';
22
22
 
23
23
  /**
24
24
  *
@@ -40,10 +40,10 @@ export interface AccountMetadatas {
40
40
  message?: string;
41
41
  /**
42
42
  *
43
- * @type {Mapint64AccountMetadata}
43
+ * @type {Array<AccountMetadata>}
44
44
  * @memberof AccountMetadatas
45
45
  */
46
- account_metadatas: Mapint64AccountMetadata;
46
+ account_metadatas: Array<AccountMetadata>;
47
47
  }
48
48
 
49
49
  /**
@@ -67,7 +67,7 @@ export function AccountMetadatasFromJSONTyped(json: any, ignoreDiscriminator: bo
67
67
 
68
68
  'code': json['code'],
69
69
  'message': json['message'] == null ? undefined : json['message'],
70
- 'account_metadatas': Mapint64AccountMetadataFromJSON(json['account_metadatas']),
70
+ 'account_metadatas': ((json['account_metadatas'] as Array<any>).map(AccountMetadataFromJSON)),
71
71
  };
72
72
  }
73
73
 
@@ -79,7 +79,7 @@ export function AccountMetadatasToJSON(value?: AccountMetadatas | null): any {
79
79
 
80
80
  'code': value['code'],
81
81
  'message': value['message'],
82
- 'account_metadatas': Mapint64AccountMetadataToJSON(value['account_metadatas']),
82
+ 'account_metadatas': ((value['account_metadatas'] as Array<any>).map(AccountMetadataToJSON)),
83
83
  };
84
84
  }
85
85
 
@@ -98,6 +98,12 @@ export interface DetailedAccount {
98
98
  * @memberof DetailedAccount
99
99
  */
100
100
  collateral: string;
101
+ /**
102
+ *
103
+ * @type {number}
104
+ * @memberof DetailedAccount
105
+ */
106
+ account_index: number;
101
107
  /**
102
108
  *
103
109
  * @type {string}
@@ -111,23 +117,17 @@ export interface DetailedAccount {
111
117
  */
112
118
  description: string;
113
119
  /**
114
- *
120
+ * Remove After FE uses L1 meta endpoint
115
121
  * @type {boolean}
116
122
  * @memberof DetailedAccount
117
123
  */
118
124
  can_invite: boolean;
119
125
  /**
120
- *
126
+ * Remove After FE uses L1 meta endpoint
121
127
  * @type {string}
122
128
  * @memberof DetailedAccount
123
129
  */
124
130
  referral_points_percentage: string;
125
- /**
126
- *
127
- * @type {number}
128
- * @memberof DetailedAccount
129
- */
130
- max_referral_usage_limit: number;
131
131
  /**
132
132
  *
133
133
  * @type {Array<AccountPosition>}
@@ -167,11 +167,11 @@ export function instanceOfDetailedAccount(value: object): value is DetailedAccou
167
167
  if (!('pending_order_count' in value) || value['pending_order_count'] === undefined) return false;
168
168
  if (!('status' in value) || value['status'] === undefined) return false;
169
169
  if (!('collateral' in value) || value['collateral'] === undefined) return false;
170
+ if (!('account_index' in value) || value['account_index'] === undefined) return false;
170
171
  if (!('name' in value) || value['name'] === undefined) return false;
171
172
  if (!('description' in value) || value['description'] === undefined) return false;
172
173
  if (!('can_invite' in value) || value['can_invite'] === undefined) return false;
173
174
  if (!('referral_points_percentage' in value) || value['referral_points_percentage'] === undefined) return false;
174
- if (!('max_referral_usage_limit' in value) || value['max_referral_usage_limit'] === undefined) return false;
175
175
  if (!('positions' in value) || value['positions'] === undefined) return false;
176
176
  if (!('total_asset_value' in value) || value['total_asset_value'] === undefined) return false;
177
177
  if (!('pool_info' in value) || value['pool_info'] === undefined) return false;
@@ -199,11 +199,11 @@ export function DetailedAccountFromJSONTyped(json: any, ignoreDiscriminator: boo
199
199
  'pending_order_count': json['pending_order_count'],
200
200
  'status': json['status'],
201
201
  'collateral': json['collateral'],
202
+ 'account_index': json['account_index'],
202
203
  'name': json['name'],
203
204
  'description': json['description'],
204
205
  'can_invite': json['can_invite'],
205
206
  'referral_points_percentage': json['referral_points_percentage'],
206
- 'max_referral_usage_limit': json['max_referral_usage_limit'],
207
207
  'positions': ((json['positions'] as Array<any>).map(AccountPositionFromJSON)),
208
208
  'total_asset_value': json['total_asset_value'],
209
209
  'pool_info': PublicPoolInfoFromJSON(json['pool_info']),
@@ -227,11 +227,11 @@ export function DetailedAccountToJSON(value?: DetailedAccount | null): any {
227
227
  'pending_order_count': value['pending_order_count'],
228
228
  'status': value['status'],
229
229
  'collateral': value['collateral'],
230
+ 'account_index': value['account_index'],
230
231
  'name': value['name'],
231
232
  'description': value['description'],
232
233
  'can_invite': value['can_invite'],
233
234
  'referral_points_percentage': value['referral_points_percentage'],
234
- 'max_referral_usage_limit': value['max_referral_usage_limit'],
235
235
  'positions': ((value['positions'] as Array<any>).map(AccountPositionToJSON)),
236
236
  'total_asset_value': value['total_asset_value'],
237
237
  'pool_info': PublicPoolInfoToJSON(value['pool_info']),
@@ -0,0 +1,79 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ *
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document:
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface L1Metadata
20
+ */
21
+ export interface L1Metadata {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof L1Metadata
26
+ */
27
+ l1_address: string;
28
+ /**
29
+ *
30
+ * @type {boolean}
31
+ * @memberof L1Metadata
32
+ */
33
+ can_invite: boolean;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof L1Metadata
38
+ */
39
+ referral_points_percentage: string;
40
+ }
41
+
42
+ /**
43
+ * Check if a given object implements the L1Metadata interface.
44
+ */
45
+ export function instanceOfL1Metadata(value: object): value is L1Metadata {
46
+ if (!('l1_address' in value) || value['l1_address'] === undefined) return false;
47
+ if (!('can_invite' in value) || value['can_invite'] === undefined) return false;
48
+ if (!('referral_points_percentage' in value) || value['referral_points_percentage'] === undefined) return false;
49
+ return true;
50
+ }
51
+
52
+ export function L1MetadataFromJSON(json: any): L1Metadata {
53
+ return L1MetadataFromJSONTyped(json, false);
54
+ }
55
+
56
+ export function L1MetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): L1Metadata {
57
+ if (json == null) {
58
+ return json;
59
+ }
60
+ return {
61
+
62
+ 'l1_address': json['l1_address'],
63
+ 'can_invite': json['can_invite'],
64
+ 'referral_points_percentage': json['referral_points_percentage'],
65
+ };
66
+ }
67
+
68
+ export function L1MetadataToJSON(value?: L1Metadata | null): any {
69
+ if (value == null) {
70
+ return value;
71
+ }
72
+ return {
73
+
74
+ 'l1_address': value['l1_address'],
75
+ 'can_invite': value['can_invite'],
76
+ 'referral_points_percentage': value['referral_points_percentage'],
77
+ };
78
+ }
79
+
@@ -0,0 +1,88 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ *
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document:
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface LiqTrade
20
+ */
21
+ export interface LiqTrade {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof LiqTrade
26
+ */
27
+ price: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof LiqTrade
32
+ */
33
+ size: string;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof LiqTrade
38
+ */
39
+ taker_fee: number;
40
+ /**
41
+ *
42
+ * @type {number}
43
+ * @memberof LiqTrade
44
+ */
45
+ maker_fee: number;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the LiqTrade interface.
50
+ */
51
+ export function instanceOfLiqTrade(value: object): value is LiqTrade {
52
+ if (!('price' in value) || value['price'] === undefined) return false;
53
+ if (!('size' in value) || value['size'] === undefined) return false;
54
+ if (!('taker_fee' in value) || value['taker_fee'] === undefined) return false;
55
+ if (!('maker_fee' in value) || value['maker_fee'] === undefined) return false;
56
+ return true;
57
+ }
58
+
59
+ export function LiqTradeFromJSON(json: any): LiqTrade {
60
+ return LiqTradeFromJSONTyped(json, false);
61
+ }
62
+
63
+ export function LiqTradeFromJSONTyped(json: any, ignoreDiscriminator: boolean): LiqTrade {
64
+ if (json == null) {
65
+ return json;
66
+ }
67
+ return {
68
+
69
+ 'price': json['price'],
70
+ 'size': json['size'],
71
+ 'taker_fee': json['taker_fee'],
72
+ 'maker_fee': json['maker_fee'],
73
+ };
74
+ }
75
+
76
+ export function LiqTradeToJSON(value?: LiqTrade | null): any {
77
+ if (value == null) {
78
+ return value;
79
+ }
80
+ return {
81
+
82
+ 'price': value['price'],
83
+ 'size': value['size'],
84
+ 'taker_fee': value['taker_fee'],
85
+ 'maker_fee': value['maker_fee'],
86
+ };
87
+ }
88
+
@@ -13,6 +13,19 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { LiqTrade } from './LiqTrade';
17
+ import {
18
+ LiqTradeFromJSON,
19
+ LiqTradeFromJSONTyped,
20
+ LiqTradeToJSON,
21
+ } from './LiqTrade';
22
+ import type { LiquidationInfo } from './LiquidationInfo';
23
+ import {
24
+ LiquidationInfoFromJSON,
25
+ LiquidationInfoFromJSONTyped,
26
+ LiquidationInfoToJSON,
27
+ } from './LiquidationInfo';
28
+
16
29
  /**
17
30
  *
18
31
  * @export
@@ -24,42 +37,60 @@ export interface Liquidation {
24
37
  * @type {number}
25
38
  * @memberof Liquidation
26
39
  */
27
- liquidation_id: number;
40
+ id: number;
28
41
  /**
29
42
  *
30
43
  * @type {number}
31
44
  * @memberof Liquidation
32
45
  */
33
- account_index: number;
46
+ market_id: number;
34
47
  /**
35
48
  *
36
- * @type {number}
49
+ * @type {string}
37
50
  * @memberof Liquidation
38
51
  */
39
- liquidation_type: number;
52
+ type: LiquidationTypeEnum;
40
53
  /**
41
54
  *
42
- * @type {string}
55
+ * @type {LiqTrade}
43
56
  * @memberof Liquidation
44
57
  */
45
- portfolio_value: string;
58
+ trade: LiqTrade;
46
59
  /**
47
60
  *
48
- * @type {string}
61
+ * @type {LiquidationInfo}
62
+ * @memberof Liquidation
63
+ */
64
+ info: LiquidationInfo;
65
+ /**
66
+ *
67
+ * @type {number}
49
68
  * @memberof Liquidation
50
69
  */
51
- margin_requirement: string;
70
+ executed_at: number;
52
71
  }
53
72
 
73
+
74
+ /**
75
+ * @export
76
+ */
77
+ export const LiquidationTypeEnum = {
78
+ Partial: 'partial',
79
+ Deleverage: 'deleverage'
80
+ } as const;
81
+ export type LiquidationTypeEnum = typeof LiquidationTypeEnum[keyof typeof LiquidationTypeEnum];
82
+
83
+
54
84
  /**
55
85
  * Check if a given object implements the Liquidation interface.
56
86
  */
57
87
  export function instanceOfLiquidation(value: object): value is Liquidation {
58
- if (!('liquidation_id' in value) || value['liquidation_id'] === undefined) return false;
59
- if (!('account_index' in value) || value['account_index'] === undefined) return false;
60
- if (!('liquidation_type' in value) || value['liquidation_type'] === undefined) return false;
61
- if (!('portfolio_value' in value) || value['portfolio_value'] === undefined) return false;
62
- if (!('margin_requirement' in value) || value['margin_requirement'] === undefined) return false;
88
+ if (!('id' in value) || value['id'] === undefined) return false;
89
+ if (!('market_id' in value) || value['market_id'] === undefined) return false;
90
+ if (!('type' in value) || value['type'] === undefined) return false;
91
+ if (!('trade' in value) || value['trade'] === undefined) return false;
92
+ if (!('info' in value) || value['info'] === undefined) return false;
93
+ if (!('executed_at' in value) || value['executed_at'] === undefined) return false;
63
94
  return true;
64
95
  }
65
96
 
@@ -73,11 +104,12 @@ export function LiquidationFromJSONTyped(json: any, ignoreDiscriminator: boolean
73
104
  }
74
105
  return {
75
106
 
76
- 'liquidation_id': json['liquidation_id'],
77
- 'account_index': json['account_index'],
78
- 'liquidation_type': json['liquidation_type'],
79
- 'portfolio_value': json['portfolio_value'],
80
- 'margin_requirement': json['margin_requirement'],
107
+ 'id': json['id'],
108
+ 'market_id': json['market_id'],
109
+ 'type': json['type'],
110
+ 'trade': LiqTradeFromJSON(json['trade']),
111
+ 'info': LiquidationInfoFromJSON(json['info']),
112
+ 'executed_at': json['executed_at'],
81
113
  };
82
114
  }
83
115
 
@@ -87,11 +119,12 @@ export function LiquidationToJSON(value?: Liquidation | null): any {
87
119
  }
88
120
  return {
89
121
 
90
- 'liquidation_id': value['liquidation_id'],
91
- 'account_index': value['account_index'],
92
- 'liquidation_type': value['liquidation_type'],
93
- 'portfolio_value': value['portfolio_value'],
94
- 'margin_requirement': value['margin_requirement'],
122
+ 'id': value['id'],
123
+ 'market_id': value['market_id'],
124
+ 'type': value['type'],
125
+ 'trade': LiqTradeToJSON(value['trade']),
126
+ 'info': LiquidationInfoToJSON(value['info']),
127
+ 'executed_at': value['executed_at'],
95
128
  };
96
129
  }
97
130
 
@@ -0,0 +1,107 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ *
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document:
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { Mapuint8AccountPosition } from './Mapuint8AccountPosition';
17
+ import {
18
+ Mapuint8AccountPositionFromJSON,
19
+ Mapuint8AccountPositionFromJSONTyped,
20
+ Mapuint8AccountPositionToJSON,
21
+ } from './Mapuint8AccountPosition';
22
+ import type { Mapuint8uint32 } from './Mapuint8uint32';
23
+ import {
24
+ Mapuint8uint32FromJSON,
25
+ Mapuint8uint32FromJSONTyped,
26
+ Mapuint8uint32ToJSON,
27
+ } from './Mapuint8uint32';
28
+ import type { RiskInfo } from './RiskInfo';
29
+ import {
30
+ RiskInfoFromJSON,
31
+ RiskInfoFromJSONTyped,
32
+ RiskInfoToJSON,
33
+ } from './RiskInfo';
34
+
35
+ /**
36
+ *
37
+ * @export
38
+ * @interface LiquidationInfo
39
+ */
40
+ export interface LiquidationInfo {
41
+ /**
42
+ *
43
+ * @type {Mapuint8AccountPosition}
44
+ * @memberof LiquidationInfo
45
+ */
46
+ positions: Mapuint8AccountPosition;
47
+ /**
48
+ *
49
+ * @type {RiskInfo}
50
+ * @memberof LiquidationInfo
51
+ */
52
+ risk_info_before: RiskInfo;
53
+ /**
54
+ *
55
+ * @type {RiskInfo}
56
+ * @memberof LiquidationInfo
57
+ */
58
+ risk_info_after: RiskInfo;
59
+ /**
60
+ *
61
+ * @type {Mapuint8uint32}
62
+ * @memberof LiquidationInfo
63
+ */
64
+ mark_prices: Mapuint8uint32;
65
+ }
66
+
67
+ /**
68
+ * Check if a given object implements the LiquidationInfo interface.
69
+ */
70
+ export function instanceOfLiquidationInfo(value: object): value is LiquidationInfo {
71
+ if (!('positions' in value) || value['positions'] === undefined) return false;
72
+ if (!('risk_info_before' in value) || value['risk_info_before'] === undefined) return false;
73
+ if (!('risk_info_after' in value) || value['risk_info_after'] === undefined) return false;
74
+ if (!('mark_prices' in value) || value['mark_prices'] === undefined) return false;
75
+ return true;
76
+ }
77
+
78
+ export function LiquidationInfoFromJSON(json: any): LiquidationInfo {
79
+ return LiquidationInfoFromJSONTyped(json, false);
80
+ }
81
+
82
+ export function LiquidationInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): LiquidationInfo {
83
+ if (json == null) {
84
+ return json;
85
+ }
86
+ return {
87
+
88
+ 'positions': Mapuint8AccountPositionFromJSON(json['positions']),
89
+ 'risk_info_before': RiskInfoFromJSON(json['risk_info_before']),
90
+ 'risk_info_after': RiskInfoFromJSON(json['risk_info_after']),
91
+ 'mark_prices': Mapuint8uint32FromJSON(json['mark_prices']),
92
+ };
93
+ }
94
+
95
+ export function LiquidationInfoToJSON(value?: LiquidationInfo | null): any {
96
+ if (value == null) {
97
+ return value;
98
+ }
99
+ return {
100
+
101
+ 'positions': Mapuint8AccountPositionToJSON(value['positions']),
102
+ 'risk_info_before': RiskInfoToJSON(value['risk_info_before']),
103
+ 'risk_info_after': RiskInfoToJSON(value['risk_info_after']),
104
+ 'mark_prices': Mapuint8uint32ToJSON(value['mark_prices']),
105
+ };
106
+ }
107
+