zklighter-perps 1.0.15 → 1.0.16
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.
- package/.openapi-generator/FILES +2 -4
- package/apis/AccountApi.ts +12 -24
- package/apis/OrderApi.ts +0 -24
- package/apis/TransactionApi.ts +6 -6
- package/models/Account.ts +104 -0
- package/models/Accounts.ts +93 -0
- package/models/DetailedAccount.ts +0 -32
- package/models/Order.ts +0 -8
- package/models/ReqGetAccountActiveOrders.ts +0 -9
- package/models/ReqGetAccountInactiveOrders.ts +0 -9
- package/models/ReqGetNextNonce.ts +4 -4
- package/models/SimpleOrder.ts +0 -9
- package/models/SubAccounts.ts +9 -27
- package/models/index.ts +2 -4
- package/openapi.json +80 -239
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -7,10 +7,12 @@ apis/RootApi.ts
|
|
|
7
7
|
apis/TransactionApi.ts
|
|
8
8
|
apis/index.ts
|
|
9
9
|
index.ts
|
|
10
|
+
models/Account.ts
|
|
10
11
|
models/AccountMarketStats.ts
|
|
11
12
|
models/AccountPnL.ts
|
|
12
13
|
models/AccountPosition.ts
|
|
13
14
|
models/AccountStats.ts
|
|
15
|
+
models/Accounts.ts
|
|
14
16
|
models/Block.ts
|
|
15
17
|
models/Blocks.ts
|
|
16
18
|
models/Candlestick.ts
|
|
@@ -27,8 +29,6 @@ models/Fundings.ts
|
|
|
27
29
|
models/L1ProviderInfo.ts
|
|
28
30
|
models/Layer1BasicInfo.ts
|
|
29
31
|
models/Layer2BasicInfo.ts
|
|
30
|
-
models/MainAccount.ts
|
|
31
|
-
models/MainAccounts.ts
|
|
32
32
|
models/MarketInfo.ts
|
|
33
33
|
models/NextNonce.ts
|
|
34
34
|
models/Order.ts
|
|
@@ -68,7 +68,6 @@ models/ReqGetRangeWithIndex.ts
|
|
|
68
68
|
models/ReqGetRangeWithIndexSortable.ts
|
|
69
69
|
models/ReqGetRecentTrades.ts
|
|
70
70
|
models/ReqGetRollbacks.ts
|
|
71
|
-
models/ReqGetSubAccount.ts
|
|
72
71
|
models/ReqGetTrades.ts
|
|
73
72
|
models/ReqGetTx.ts
|
|
74
73
|
models/ReqSearch.ts
|
|
@@ -79,7 +78,6 @@ models/Search.ts
|
|
|
79
78
|
models/SignBody.ts
|
|
80
79
|
models/SimpleOrder.ts
|
|
81
80
|
models/Status.ts
|
|
82
|
-
models/SubAccount.ts
|
|
83
81
|
models/SubAccounts.ts
|
|
84
82
|
models/Trade.ts
|
|
85
83
|
models/Trades.ts
|
package/apis/AccountApi.ts
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
AccountPnL,
|
|
19
|
+
Accounts,
|
|
19
20
|
DetailedAccounts,
|
|
20
|
-
MainAccounts,
|
|
21
21
|
Permission,
|
|
22
22
|
ResultCode,
|
|
23
23
|
SubAccounts,
|
|
@@ -25,10 +25,10 @@ import type {
|
|
|
25
25
|
import {
|
|
26
26
|
AccountPnLFromJSON,
|
|
27
27
|
AccountPnLToJSON,
|
|
28
|
+
AccountsFromJSON,
|
|
29
|
+
AccountsToJSON,
|
|
28
30
|
DetailedAccountsFromJSON,
|
|
29
31
|
DetailedAccountsToJSON,
|
|
30
|
-
MainAccountsFromJSON,
|
|
31
|
-
MainAccountsToJSON,
|
|
32
32
|
PermissionFromJSON,
|
|
33
33
|
PermissionToJSON,
|
|
34
34
|
ResultCodeFromJSON,
|
|
@@ -44,7 +44,6 @@ export interface DoFaucetRequest {
|
|
|
44
44
|
export interface GetAccountRequest {
|
|
45
45
|
by: GetAccountByEnum;
|
|
46
46
|
value: string;
|
|
47
|
-
sub_account_index: number;
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
export interface GetAccountPnlRequest {
|
|
@@ -117,7 +116,7 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
117
116
|
}
|
|
118
117
|
|
|
119
118
|
/**
|
|
120
|
-
* Get account by
|
|
119
|
+
* Get account by account\'s l1_address or index. Returns detailed account info
|
|
121
120
|
* GetAccount
|
|
122
121
|
*/
|
|
123
122
|
async getAccountRaw(requestParameters: GetAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DetailedAccounts>> {
|
|
@@ -135,13 +134,6 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
135
134
|
);
|
|
136
135
|
}
|
|
137
136
|
|
|
138
|
-
if (requestParameters['sub_account_index'] == null) {
|
|
139
|
-
throw new runtime.RequiredError(
|
|
140
|
-
'sub_account_index',
|
|
141
|
-
'Required parameter "sub_account_index" was null or undefined when calling getAccount().'
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
137
|
const queryParameters: any = {};
|
|
146
138
|
|
|
147
139
|
if (requestParameters['by'] != null) {
|
|
@@ -152,10 +144,6 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
152
144
|
queryParameters['value'] = requestParameters['value'];
|
|
153
145
|
}
|
|
154
146
|
|
|
155
|
-
if (requestParameters['sub_account_index'] != null) {
|
|
156
|
-
queryParameters['sub_account_index'] = requestParameters['sub_account_index'];
|
|
157
|
-
}
|
|
158
|
-
|
|
159
147
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
160
148
|
|
|
161
149
|
const response = await this.request({
|
|
@@ -169,7 +157,7 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
169
157
|
}
|
|
170
158
|
|
|
171
159
|
/**
|
|
172
|
-
* Get account by
|
|
160
|
+
* Get account by account\'s l1_address or index. Returns detailed account info
|
|
173
161
|
* GetAccount
|
|
174
162
|
*/
|
|
175
163
|
async getAccount(requestParameters: GetAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DetailedAccounts> {
|
|
@@ -272,10 +260,10 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
272
260
|
}
|
|
273
261
|
|
|
274
262
|
/**
|
|
275
|
-
* Get accounts returns
|
|
263
|
+
* Get accounts returns accounts by account index
|
|
276
264
|
* GetAccounts
|
|
277
265
|
*/
|
|
278
|
-
async getAccountsRaw(requestParameters: GetAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
266
|
+
async getAccountsRaw(requestParameters: GetAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Accounts>> {
|
|
279
267
|
if (requestParameters['limit'] == null) {
|
|
280
268
|
throw new runtime.RequiredError(
|
|
281
269
|
'limit',
|
|
@@ -306,20 +294,20 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
306
294
|
query: queryParameters,
|
|
307
295
|
}, initOverrides);
|
|
308
296
|
|
|
309
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
297
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AccountsFromJSON(jsonValue));
|
|
310
298
|
}
|
|
311
299
|
|
|
312
300
|
/**
|
|
313
|
-
* Get accounts returns
|
|
301
|
+
* Get accounts returns accounts by account index
|
|
314
302
|
* GetAccounts
|
|
315
303
|
*/
|
|
316
|
-
async getAccounts(requestParameters: GetAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
304
|
+
async getAccounts(requestParameters: GetAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Accounts> {
|
|
317
305
|
const response = await this.getAccountsRaw(requestParameters, initOverrides);
|
|
318
306
|
return await response.value();
|
|
319
307
|
}
|
|
320
308
|
|
|
321
309
|
/**
|
|
322
|
-
* Get accounts by l1_address returns
|
|
310
|
+
* Get accounts by l1_address returns all accounts associated with the given L1 address
|
|
323
311
|
* GetAccountsByL1Address
|
|
324
312
|
*/
|
|
325
313
|
async getAccountsByL1AddressRaw(requestParameters: GetAccountsByL1AddressRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SubAccounts>> {
|
|
@@ -349,7 +337,7 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
349
337
|
}
|
|
350
338
|
|
|
351
339
|
/**
|
|
352
|
-
* Get accounts by l1_address returns
|
|
340
|
+
* Get accounts by l1_address returns all accounts associated with the given L1 address
|
|
353
341
|
* GetAccountsByL1Address
|
|
354
342
|
*/
|
|
355
343
|
async getAccountsByL1Address(requestParameters: GetAccountsByL1AddressRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubAccounts> {
|
package/apis/OrderApi.ts
CHANGED
|
@@ -42,13 +42,11 @@ import {
|
|
|
42
42
|
|
|
43
43
|
export interface GetAccountActiveOrdersRequest {
|
|
44
44
|
account_index: number;
|
|
45
|
-
sub_account_index: number;
|
|
46
45
|
market_id: number;
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
export interface GetAccountInactiveOrdersRequest {
|
|
50
49
|
account_index: number;
|
|
51
|
-
sub_account_index: number;
|
|
52
50
|
filter: GetAccountInactiveOrdersFilterEnum;
|
|
53
51
|
limit: number;
|
|
54
52
|
market_id?: number;
|
|
@@ -107,13 +105,6 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
107
105
|
);
|
|
108
106
|
}
|
|
109
107
|
|
|
110
|
-
if (requestParameters['sub_account_index'] == null) {
|
|
111
|
-
throw new runtime.RequiredError(
|
|
112
|
-
'sub_account_index',
|
|
113
|
-
'Required parameter "sub_account_index" was null or undefined when calling getAccountActiveOrders().'
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
108
|
if (requestParameters['market_id'] == null) {
|
|
118
109
|
throw new runtime.RequiredError(
|
|
119
110
|
'market_id',
|
|
@@ -127,10 +118,6 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
127
118
|
queryParameters['account_index'] = requestParameters['account_index'];
|
|
128
119
|
}
|
|
129
120
|
|
|
130
|
-
if (requestParameters['sub_account_index'] != null) {
|
|
131
|
-
queryParameters['sub_account_index'] = requestParameters['sub_account_index'];
|
|
132
|
-
}
|
|
133
|
-
|
|
134
121
|
if (requestParameters['market_id'] != null) {
|
|
135
122
|
queryParameters['market_id'] = requestParameters['market_id'];
|
|
136
123
|
}
|
|
@@ -168,13 +155,6 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
168
155
|
);
|
|
169
156
|
}
|
|
170
157
|
|
|
171
|
-
if (requestParameters['sub_account_index'] == null) {
|
|
172
|
-
throw new runtime.RequiredError(
|
|
173
|
-
'sub_account_index',
|
|
174
|
-
'Required parameter "sub_account_index" was null or undefined when calling getAccountInactiveOrders().'
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
158
|
if (requestParameters['filter'] == null) {
|
|
179
159
|
throw new runtime.RequiredError(
|
|
180
160
|
'filter',
|
|
@@ -195,10 +175,6 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
195
175
|
queryParameters['account_index'] = requestParameters['account_index'];
|
|
196
176
|
}
|
|
197
177
|
|
|
198
|
-
if (requestParameters['sub_account_index'] != null) {
|
|
199
|
-
queryParameters['sub_account_index'] = requestParameters['sub_account_index'];
|
|
200
|
-
}
|
|
201
|
-
|
|
202
178
|
if (requestParameters['filter'] != null) {
|
|
203
179
|
queryParameters['filter'] = requestParameters['filter'];
|
|
204
180
|
}
|
package/apis/TransactionApi.ts
CHANGED
|
@@ -66,7 +66,7 @@ export interface GetL2SignatureBodyRequest {
|
|
|
66
66
|
|
|
67
67
|
export interface GetNextNonceRequest {
|
|
68
68
|
account_index: number;
|
|
69
|
-
|
|
69
|
+
api_key_index: number;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
export interface GetPendingTxsRequest {
|
|
@@ -353,10 +353,10 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
353
353
|
);
|
|
354
354
|
}
|
|
355
355
|
|
|
356
|
-
if (requestParameters['
|
|
356
|
+
if (requestParameters['api_key_index'] == null) {
|
|
357
357
|
throw new runtime.RequiredError(
|
|
358
|
-
'
|
|
359
|
-
'Required parameter "
|
|
358
|
+
'api_key_index',
|
|
359
|
+
'Required parameter "api_key_index" was null or undefined when calling getNextNonce().'
|
|
360
360
|
);
|
|
361
361
|
}
|
|
362
362
|
|
|
@@ -366,8 +366,8 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
366
366
|
queryParameters['account_index'] = requestParameters['account_index'];
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
-
if (requestParameters['
|
|
370
|
-
queryParameters['
|
|
369
|
+
if (requestParameters['api_key_index'] != null) {
|
|
370
|
+
queryParameters['api_key_index'] = requestParameters['api_key_index'];
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
@@ -0,0 +1,104 @@
|
|
|
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 Account
|
|
20
|
+
*/
|
|
21
|
+
export interface Account {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof Account
|
|
26
|
+
*/
|
|
27
|
+
code?: number;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof Account
|
|
32
|
+
*/
|
|
33
|
+
message?: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {number}
|
|
37
|
+
* @memberof Account
|
|
38
|
+
*/
|
|
39
|
+
index: number;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof Account
|
|
44
|
+
*/
|
|
45
|
+
l1_address: string;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @memberof Account
|
|
50
|
+
*/
|
|
51
|
+
status: number;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {string}
|
|
55
|
+
* @memberof Account
|
|
56
|
+
*/
|
|
57
|
+
collateral: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Check if a given object implements the Account interface.
|
|
62
|
+
*/
|
|
63
|
+
export function instanceOfAccount(value: object): value is Account {
|
|
64
|
+
if (!('index' in value) || value['index'] === undefined) return false;
|
|
65
|
+
if (!('l1_address' in value) || value['l1_address'] === undefined) return false;
|
|
66
|
+
if (!('status' in value) || value['status'] === undefined) return false;
|
|
67
|
+
if (!('collateral' in value) || value['collateral'] === undefined) return false;
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function AccountFromJSON(json: any): Account {
|
|
72
|
+
return AccountFromJSONTyped(json, false);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function AccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): Account {
|
|
76
|
+
if (json == null) {
|
|
77
|
+
return json;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
|
|
81
|
+
'code': json['code'] == null ? undefined : json['code'],
|
|
82
|
+
'message': json['message'] == null ? undefined : json['message'],
|
|
83
|
+
'index': json['index'],
|
|
84
|
+
'l1_address': json['l1_address'],
|
|
85
|
+
'status': json['status'],
|
|
86
|
+
'collateral': json['collateral'],
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function AccountToJSON(value?: Account | null): any {
|
|
91
|
+
if (value == null) {
|
|
92
|
+
return value;
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
|
|
96
|
+
'code': value['code'],
|
|
97
|
+
'message': value['message'],
|
|
98
|
+
'index': value['index'],
|
|
99
|
+
'l1_address': value['l1_address'],
|
|
100
|
+
'status': value['status'],
|
|
101
|
+
'collateral': value['collateral'],
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
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 { Account } from './Account';
|
|
17
|
+
import {
|
|
18
|
+
AccountFromJSON,
|
|
19
|
+
AccountFromJSONTyped,
|
|
20
|
+
AccountToJSON,
|
|
21
|
+
} from './Account';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @export
|
|
26
|
+
* @interface Accounts
|
|
27
|
+
*/
|
|
28
|
+
export interface Accounts {
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @type {number}
|
|
32
|
+
* @memberof Accounts
|
|
33
|
+
*/
|
|
34
|
+
code?: number;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @type {string}
|
|
38
|
+
* @memberof Accounts
|
|
39
|
+
*/
|
|
40
|
+
message?: string;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @type {number}
|
|
44
|
+
* @memberof Accounts
|
|
45
|
+
*/
|
|
46
|
+
total: number;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @type {Array<Account>}
|
|
50
|
+
* @memberof Accounts
|
|
51
|
+
*/
|
|
52
|
+
accounts: Array<Account>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Check if a given object implements the Accounts interface.
|
|
57
|
+
*/
|
|
58
|
+
export function instanceOfAccounts(value: object): value is Accounts {
|
|
59
|
+
if (!('total' in value) || value['total'] === undefined) return false;
|
|
60
|
+
if (!('accounts' in value) || value['accounts'] === undefined) return false;
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function AccountsFromJSON(json: any): Accounts {
|
|
65
|
+
return AccountsFromJSONTyped(json, false);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function AccountsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Accounts {
|
|
69
|
+
if (json == null) {
|
|
70
|
+
return json;
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
|
|
74
|
+
'code': json['code'] == null ? undefined : json['code'],
|
|
75
|
+
'message': json['message'] == null ? undefined : json['message'],
|
|
76
|
+
'total': json['total'],
|
|
77
|
+
'accounts': ((json['accounts'] as Array<any>).map(AccountFromJSON)),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function AccountsToJSON(value?: Accounts | null): any {
|
|
82
|
+
if (value == null) {
|
|
83
|
+
return value;
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
|
|
87
|
+
'code': value['code'],
|
|
88
|
+
'message': value['message'],
|
|
89
|
+
'total': value['total'],
|
|
90
|
+
'accounts': ((value['accounts'] as Array<any>).map(AccountToJSON)),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
@@ -50,30 +50,12 @@ export interface DetailedAccount {
|
|
|
50
50
|
* @memberof DetailedAccount
|
|
51
51
|
*/
|
|
52
52
|
index?: number;
|
|
53
|
-
/**
|
|
54
|
-
*
|
|
55
|
-
* @type {number}
|
|
56
|
-
* @memberof DetailedAccount
|
|
57
|
-
*/
|
|
58
|
-
sub_account_index?: number;
|
|
59
53
|
/**
|
|
60
54
|
*
|
|
61
55
|
* @type {string}
|
|
62
56
|
* @memberof DetailedAccount
|
|
63
57
|
*/
|
|
64
58
|
l1_address?: string;
|
|
65
|
-
/**
|
|
66
|
-
*
|
|
67
|
-
* @type {string}
|
|
68
|
-
* @memberof DetailedAccount
|
|
69
|
-
*/
|
|
70
|
-
pk?: string;
|
|
71
|
-
/**
|
|
72
|
-
*
|
|
73
|
-
* @type {number}
|
|
74
|
-
* @memberof DetailedAccount
|
|
75
|
-
*/
|
|
76
|
-
nonce?: number;
|
|
77
59
|
/**
|
|
78
60
|
*
|
|
79
61
|
* @type {number}
|
|
@@ -86,12 +68,6 @@ export interface DetailedAccount {
|
|
|
86
68
|
* @memberof DetailedAccount
|
|
87
69
|
*/
|
|
88
70
|
collateral?: string;
|
|
89
|
-
/**
|
|
90
|
-
*
|
|
91
|
-
* @type {number}
|
|
92
|
-
* @memberof DetailedAccount
|
|
93
|
-
*/
|
|
94
|
-
collateral_type?: number;
|
|
95
71
|
/**
|
|
96
72
|
*
|
|
97
73
|
* @type {Array<AccountPosition>}
|
|
@@ -135,13 +111,9 @@ export function DetailedAccountFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
135
111
|
'code': json['code'] == null ? undefined : json['code'],
|
|
136
112
|
'message': json['message'] == null ? undefined : json['message'],
|
|
137
113
|
'index': json['index'] == null ? undefined : json['index'],
|
|
138
|
-
'sub_account_index': json['sub_account_index'] == null ? undefined : json['sub_account_index'],
|
|
139
114
|
'l1_address': json['l1_address'] == null ? undefined : json['l1_address'],
|
|
140
|
-
'pk': json['pk'] == null ? undefined : json['pk'],
|
|
141
|
-
'nonce': json['nonce'] == null ? undefined : json['nonce'],
|
|
142
115
|
'status': json['status'] == null ? undefined : json['status'],
|
|
143
116
|
'collateral': json['collateral'] == null ? undefined : json['collateral'],
|
|
144
|
-
'collateral_type': json['collateral_type'] == null ? undefined : json['collateral_type'],
|
|
145
117
|
'positions': ((json['positions'] as Array<any>).map(AccountPositionFromJSON)),
|
|
146
118
|
'total_asset_value': json['total_asset_value'],
|
|
147
119
|
'market_stats': ((json['market_stats'] as Array<any>).map(AccountMarketStatsFromJSON)),
|
|
@@ -157,13 +129,9 @@ export function DetailedAccountToJSON(value?: DetailedAccount | null): any {
|
|
|
157
129
|
'code': value['code'],
|
|
158
130
|
'message': value['message'],
|
|
159
131
|
'index': value['index'],
|
|
160
|
-
'sub_account_index': value['sub_account_index'],
|
|
161
132
|
'l1_address': value['l1_address'],
|
|
162
|
-
'pk': value['pk'],
|
|
163
|
-
'nonce': value['nonce'],
|
|
164
133
|
'status': value['status'],
|
|
165
134
|
'collateral': value['collateral'],
|
|
166
|
-
'collateral_type': value['collateral_type'],
|
|
167
135
|
'positions': ((value['positions'] as Array<any>).map(AccountPositionToJSON)),
|
|
168
136
|
'total_asset_value': value['total_asset_value'],
|
|
169
137
|
'market_stats': ((value['market_stats'] as Array<any>).map(AccountMarketStatsToJSON)),
|
package/models/Order.ts
CHANGED
|
@@ -25,12 +25,6 @@ export interface Order {
|
|
|
25
25
|
* @memberof Order
|
|
26
26
|
*/
|
|
27
27
|
market_index: number;
|
|
28
|
-
/**
|
|
29
|
-
* TODO: should we return this?
|
|
30
|
-
* @type {number}
|
|
31
|
-
* @memberof Order
|
|
32
|
-
*/
|
|
33
|
-
ownerMainAccountIndex?: number;
|
|
34
28
|
/**
|
|
35
29
|
*
|
|
36
30
|
* @type {number}
|
|
@@ -178,7 +172,6 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord
|
|
|
178
172
|
return {
|
|
179
173
|
|
|
180
174
|
'market_index': json['market_index'],
|
|
181
|
-
'ownerMainAccountIndex': json['ownerMainAccountIndex'] == null ? undefined : json['ownerMainAccountIndex'],
|
|
182
175
|
'owner_account_index': json['owner_account_index'],
|
|
183
176
|
'initial_base_amount': json['initial_base_amount'],
|
|
184
177
|
'remaining_base_amount': json['remaining_base_amount'],
|
|
@@ -204,7 +197,6 @@ export function OrderToJSON(value?: Order | null): any {
|
|
|
204
197
|
return {
|
|
205
198
|
|
|
206
199
|
'market_index': value['market_index'],
|
|
207
|
-
'ownerMainAccountIndex': value['ownerMainAccountIndex'],
|
|
208
200
|
'owner_account_index': value['owner_account_index'],
|
|
209
201
|
'initial_base_amount': value['initial_base_amount'],
|
|
210
202
|
'remaining_base_amount': value['remaining_base_amount'],
|
|
@@ -25,12 +25,6 @@ export interface ReqGetAccountActiveOrders {
|
|
|
25
25
|
* @memberof ReqGetAccountActiveOrders
|
|
26
26
|
*/
|
|
27
27
|
account_index: number;
|
|
28
|
-
/**
|
|
29
|
-
* NilSubAccountIndex
|
|
30
|
-
* @type {number}
|
|
31
|
-
* @memberof ReqGetAccountActiveOrders
|
|
32
|
-
*/
|
|
33
|
-
sub_account_index: number;
|
|
34
28
|
/**
|
|
35
29
|
*
|
|
36
30
|
* @type {number}
|
|
@@ -44,7 +38,6 @@ export interface ReqGetAccountActiveOrders {
|
|
|
44
38
|
*/
|
|
45
39
|
export function instanceOfReqGetAccountActiveOrders(value: object): value is ReqGetAccountActiveOrders {
|
|
46
40
|
if (!('account_index' in value) || value['account_index'] === undefined) return false;
|
|
47
|
-
if (!('sub_account_index' in value) || value['sub_account_index'] === undefined) return false;
|
|
48
41
|
if (!('market_id' in value) || value['market_id'] === undefined) return false;
|
|
49
42
|
return true;
|
|
50
43
|
}
|
|
@@ -60,7 +53,6 @@ export function ReqGetAccountActiveOrdersFromJSONTyped(json: any, ignoreDiscrimi
|
|
|
60
53
|
return {
|
|
61
54
|
|
|
62
55
|
'account_index': json['account_index'],
|
|
63
|
-
'sub_account_index': json['sub_account_index'],
|
|
64
56
|
'market_id': json['market_id'],
|
|
65
57
|
};
|
|
66
58
|
}
|
|
@@ -72,7 +64,6 @@ export function ReqGetAccountActiveOrdersToJSON(value?: ReqGetAccountActiveOrder
|
|
|
72
64
|
return {
|
|
73
65
|
|
|
74
66
|
'account_index': value['account_index'],
|
|
75
|
-
'sub_account_index': value['sub_account_index'],
|
|
76
67
|
'market_id': value['market_id'],
|
|
77
68
|
};
|
|
78
69
|
}
|
|
@@ -25,12 +25,6 @@ export interface ReqGetAccountInactiveOrders {
|
|
|
25
25
|
* @memberof ReqGetAccountInactiveOrders
|
|
26
26
|
*/
|
|
27
27
|
account_index: number;
|
|
28
|
-
/**
|
|
29
|
-
* NilSubAccountIndex
|
|
30
|
-
* @type {number}
|
|
31
|
-
* @memberof ReqGetAccountInactiveOrders
|
|
32
|
-
*/
|
|
33
|
-
sub_account_index: number;
|
|
34
28
|
/**
|
|
35
29
|
*
|
|
36
30
|
* @type {string}
|
|
@@ -73,7 +67,6 @@ export type ReqGetAccountInactiveOrdersFilterEnum = typeof ReqGetAccountInactive
|
|
|
73
67
|
*/
|
|
74
68
|
export function instanceOfReqGetAccountInactiveOrders(value: object): value is ReqGetAccountInactiveOrders {
|
|
75
69
|
if (!('account_index' in value) || value['account_index'] === undefined) return false;
|
|
76
|
-
if (!('sub_account_index' in value) || value['sub_account_index'] === undefined) return false;
|
|
77
70
|
if (!('filter' in value) || value['filter'] === undefined) return false;
|
|
78
71
|
if (!('limit' in value) || value['limit'] === undefined) return false;
|
|
79
72
|
return true;
|
|
@@ -90,7 +83,6 @@ export function ReqGetAccountInactiveOrdersFromJSONTyped(json: any, ignoreDiscri
|
|
|
90
83
|
return {
|
|
91
84
|
|
|
92
85
|
'account_index': json['account_index'],
|
|
93
|
-
'sub_account_index': json['sub_account_index'],
|
|
94
86
|
'filter': json['filter'],
|
|
95
87
|
'market_id': json['market_id'] == null ? undefined : json['market_id'],
|
|
96
88
|
'cursor': json['cursor'] == null ? undefined : json['cursor'],
|
|
@@ -105,7 +97,6 @@ export function ReqGetAccountInactiveOrdersToJSON(value?: ReqGetAccountInactiveO
|
|
|
105
97
|
return {
|
|
106
98
|
|
|
107
99
|
'account_index': value['account_index'],
|
|
108
|
-
'sub_account_index': value['sub_account_index'],
|
|
109
100
|
'filter': value['filter'],
|
|
110
101
|
'market_id': value['market_id'],
|
|
111
102
|
'cursor': value['cursor'],
|
|
@@ -30,7 +30,7 @@ export interface ReqGetNextNonce {
|
|
|
30
30
|
* @type {number}
|
|
31
31
|
* @memberof ReqGetNextNonce
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
api_key_index: number;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -38,7 +38,7 @@ export interface ReqGetNextNonce {
|
|
|
38
38
|
*/
|
|
39
39
|
export function instanceOfReqGetNextNonce(value: object): value is ReqGetNextNonce {
|
|
40
40
|
if (!('account_index' in value) || value['account_index'] === undefined) return false;
|
|
41
|
-
if (!('
|
|
41
|
+
if (!('api_key_index' in value) || value['api_key_index'] === undefined) return false;
|
|
42
42
|
return true;
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -53,7 +53,7 @@ export function ReqGetNextNonceFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
53
53
|
return {
|
|
54
54
|
|
|
55
55
|
'account_index': json['account_index'],
|
|
56
|
-
'
|
|
56
|
+
'api_key_index': json['api_key_index'],
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -64,7 +64,7 @@ export function ReqGetNextNonceToJSON(value?: ReqGetNextNonce | null): any {
|
|
|
64
64
|
return {
|
|
65
65
|
|
|
66
66
|
'account_index': value['account_index'],
|
|
67
|
-
'
|
|
67
|
+
'api_key_index': value['api_key_index'],
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
|
package/models/SimpleOrder.ts
CHANGED
|
@@ -25,12 +25,6 @@ export interface SimpleOrder {
|
|
|
25
25
|
* @memberof SimpleOrder
|
|
26
26
|
*/
|
|
27
27
|
owner_account_index: number;
|
|
28
|
-
/**
|
|
29
|
-
*
|
|
30
|
-
* @type {number}
|
|
31
|
-
* @memberof SimpleOrder
|
|
32
|
-
*/
|
|
33
|
-
owner_sub_account_index: number;
|
|
34
28
|
/**
|
|
35
29
|
*
|
|
36
30
|
* @type {string}
|
|
@@ -62,7 +56,6 @@ export interface SimpleOrder {
|
|
|
62
56
|
*/
|
|
63
57
|
export function instanceOfSimpleOrder(value: object): value is SimpleOrder {
|
|
64
58
|
if (!('owner_account_index' in value) || value['owner_account_index'] === undefined) return false;
|
|
65
|
-
if (!('owner_sub_account_index' in value) || value['owner_sub_account_index'] === undefined) return false;
|
|
66
59
|
if (!('initial_base_amount' in value) || value['initial_base_amount'] === undefined) return false;
|
|
67
60
|
if (!('remaining_base_amount' in value) || value['remaining_base_amount'] === undefined) return false;
|
|
68
61
|
if (!('price' in value) || value['price'] === undefined) return false;
|
|
@@ -81,7 +74,6 @@ export function SimpleOrderFromJSONTyped(json: any, ignoreDiscriminator: boolean
|
|
|
81
74
|
return {
|
|
82
75
|
|
|
83
76
|
'owner_account_index': json['owner_account_index'],
|
|
84
|
-
'owner_sub_account_index': json['owner_sub_account_index'],
|
|
85
77
|
'initial_base_amount': json['initial_base_amount'],
|
|
86
78
|
'remaining_base_amount': json['remaining_base_amount'],
|
|
87
79
|
'price': json['price'],
|
|
@@ -96,7 +88,6 @@ export function SimpleOrderToJSON(value?: SimpleOrder | null): any {
|
|
|
96
88
|
return {
|
|
97
89
|
|
|
98
90
|
'owner_account_index': value['owner_account_index'],
|
|
99
|
-
'owner_sub_account_index': value['owner_sub_account_index'],
|
|
100
91
|
'initial_base_amount': value['initial_base_amount'],
|
|
101
92
|
'remaining_base_amount': value['remaining_base_amount'],
|
|
102
93
|
'price': value['price'],
|
package/models/SubAccounts.ts
CHANGED
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime';
|
|
16
|
-
import type {
|
|
16
|
+
import type { Account } from './Account';
|
|
17
17
|
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} from './
|
|
18
|
+
AccountFromJSON,
|
|
19
|
+
AccountFromJSONTyped,
|
|
20
|
+
AccountToJSON,
|
|
21
|
+
} from './Account';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
*
|
|
@@ -38,12 +38,6 @@ export interface SubAccounts {
|
|
|
38
38
|
* @memberof SubAccounts
|
|
39
39
|
*/
|
|
40
40
|
message?: string;
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
* @type {number}
|
|
44
|
-
* @memberof SubAccounts
|
|
45
|
-
*/
|
|
46
|
-
index: number;
|
|
47
41
|
/**
|
|
48
42
|
*
|
|
49
43
|
* @type {string}
|
|
@@ -52,25 +46,17 @@ export interface SubAccounts {
|
|
|
52
46
|
l1_address: string;
|
|
53
47
|
/**
|
|
54
48
|
*
|
|
55
|
-
* @type {
|
|
56
|
-
* @memberof SubAccounts
|
|
57
|
-
*/
|
|
58
|
-
status: number;
|
|
59
|
-
/**
|
|
60
|
-
*
|
|
61
|
-
* @type {Array<SubAccount>}
|
|
49
|
+
* @type {Array<Account>}
|
|
62
50
|
* @memberof SubAccounts
|
|
63
51
|
*/
|
|
64
|
-
sub_accounts: Array<
|
|
52
|
+
sub_accounts: Array<Account>;
|
|
65
53
|
}
|
|
66
54
|
|
|
67
55
|
/**
|
|
68
56
|
* Check if a given object implements the SubAccounts interface.
|
|
69
57
|
*/
|
|
70
58
|
export function instanceOfSubAccounts(value: object): value is SubAccounts {
|
|
71
|
-
if (!('index' in value) || value['index'] === undefined) return false;
|
|
72
59
|
if (!('l1_address' in value) || value['l1_address'] === undefined) return false;
|
|
73
|
-
if (!('status' in value) || value['status'] === undefined) return false;
|
|
74
60
|
if (!('sub_accounts' in value) || value['sub_accounts'] === undefined) return false;
|
|
75
61
|
return true;
|
|
76
62
|
}
|
|
@@ -87,10 +73,8 @@ export function SubAccountsFromJSONTyped(json: any, ignoreDiscriminator: boolean
|
|
|
87
73
|
|
|
88
74
|
'code': json['code'] == null ? undefined : json['code'],
|
|
89
75
|
'message': json['message'] == null ? undefined : json['message'],
|
|
90
|
-
'index': json['index'],
|
|
91
76
|
'l1_address': json['l1_address'],
|
|
92
|
-
'
|
|
93
|
-
'sub_accounts': ((json['sub_accounts'] as Array<any>).map(SubAccountFromJSON)),
|
|
77
|
+
'sub_accounts': ((json['sub_accounts'] as Array<any>).map(AccountFromJSON)),
|
|
94
78
|
};
|
|
95
79
|
}
|
|
96
80
|
|
|
@@ -102,10 +86,8 @@ export function SubAccountsToJSON(value?: SubAccounts | null): any {
|
|
|
102
86
|
|
|
103
87
|
'code': value['code'],
|
|
104
88
|
'message': value['message'],
|
|
105
|
-
'index': value['index'],
|
|
106
89
|
'l1_address': value['l1_address'],
|
|
107
|
-
'
|
|
108
|
-
'sub_accounts': ((value['sub_accounts'] as Array<any>).map(SubAccountToJSON)),
|
|
90
|
+
'sub_accounts': ((value['sub_accounts'] as Array<any>).map(AccountToJSON)),
|
|
109
91
|
};
|
|
110
92
|
}
|
|
111
93
|
|
package/models/index.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export * from './Account';
|
|
3
4
|
export * from './AccountMarketStats';
|
|
4
5
|
export * from './AccountPnL';
|
|
5
6
|
export * from './AccountPosition';
|
|
6
7
|
export * from './AccountStats';
|
|
8
|
+
export * from './Accounts';
|
|
7
9
|
export * from './Block';
|
|
8
10
|
export * from './Blocks';
|
|
9
11
|
export * from './Candlestick';
|
|
@@ -20,8 +22,6 @@ export * from './Fundings';
|
|
|
20
22
|
export * from './L1ProviderInfo';
|
|
21
23
|
export * from './Layer1BasicInfo';
|
|
22
24
|
export * from './Layer2BasicInfo';
|
|
23
|
-
export * from './MainAccount';
|
|
24
|
-
export * from './MainAccounts';
|
|
25
25
|
export * from './MarketInfo';
|
|
26
26
|
export * from './NextNonce';
|
|
27
27
|
export * from './Order';
|
|
@@ -61,7 +61,6 @@ export * from './ReqGetRangeWithIndex';
|
|
|
61
61
|
export * from './ReqGetRangeWithIndexSortable';
|
|
62
62
|
export * from './ReqGetRecentTrades';
|
|
63
63
|
export * from './ReqGetRollbacks';
|
|
64
|
-
export * from './ReqGetSubAccount';
|
|
65
64
|
export * from './ReqGetTrades';
|
|
66
65
|
export * from './ReqGetTx';
|
|
67
66
|
export * from './ReqSearch';
|
|
@@ -72,7 +71,6 @@ export * from './Search';
|
|
|
72
71
|
export * from './SignBody';
|
|
73
72
|
export * from './SimpleOrder';
|
|
74
73
|
export * from './Status';
|
|
75
|
-
export * from './SubAccount';
|
|
76
74
|
export * from './SubAccounts';
|
|
77
75
|
export * from './Trade';
|
|
78
76
|
export * from './Trades';
|
package/openapi.json
CHANGED
|
@@ -73,15 +73,6 @@
|
|
|
73
73
|
"in": "query",
|
|
74
74
|
"required": true,
|
|
75
75
|
"type": "string"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"name": "sub_account_index",
|
|
79
|
-
"description": " NilSubAccountIndex",
|
|
80
|
-
"in": "query",
|
|
81
|
-
"required": true,
|
|
82
|
-
"type": "integer",
|
|
83
|
-
"format": "uint8",
|
|
84
|
-
"default": "255"
|
|
85
76
|
}
|
|
86
77
|
],
|
|
87
78
|
"tags": [
|
|
@@ -90,7 +81,7 @@
|
|
|
90
81
|
"consumes": [
|
|
91
82
|
"multipart/form-data"
|
|
92
83
|
],
|
|
93
|
-
"description": "Get account by
|
|
84
|
+
"description": "Get account by account's l1_address or index. Returns detailed account info"
|
|
94
85
|
}
|
|
95
86
|
},
|
|
96
87
|
"/api/v1/accountActiveOrders": {
|
|
@@ -119,15 +110,6 @@
|
|
|
119
110
|
"type": "integer",
|
|
120
111
|
"format": "int32"
|
|
121
112
|
},
|
|
122
|
-
{
|
|
123
|
-
"name": "sub_account_index",
|
|
124
|
-
"description": " NilSubAccountIndex",
|
|
125
|
-
"in": "query",
|
|
126
|
-
"required": true,
|
|
127
|
-
"type": "integer",
|
|
128
|
-
"format": "uint8",
|
|
129
|
-
"default": "255"
|
|
130
|
-
},
|
|
131
113
|
{
|
|
132
114
|
"name": "market_id",
|
|
133
115
|
"in": "query",
|
|
@@ -171,15 +153,6 @@
|
|
|
171
153
|
"type": "integer",
|
|
172
154
|
"format": "int32"
|
|
173
155
|
},
|
|
174
|
-
{
|
|
175
|
-
"name": "sub_account_index",
|
|
176
|
-
"description": " NilSubAccountIndex",
|
|
177
|
-
"in": "query",
|
|
178
|
-
"required": true,
|
|
179
|
-
"type": "integer",
|
|
180
|
-
"format": "uint8",
|
|
181
|
-
"default": "255"
|
|
182
|
-
},
|
|
183
156
|
{
|
|
184
157
|
"name": "filter",
|
|
185
158
|
"in": "query",
|
|
@@ -408,7 +381,7 @@
|
|
|
408
381
|
"200": {
|
|
409
382
|
"description": "A successful response.",
|
|
410
383
|
"schema": {
|
|
411
|
-
"$ref": "#/definitions/
|
|
384
|
+
"$ref": "#/definitions/Accounts"
|
|
412
385
|
}
|
|
413
386
|
},
|
|
414
387
|
"400": {
|
|
@@ -453,7 +426,7 @@
|
|
|
453
426
|
"consumes": [
|
|
454
427
|
"multipart/form-data"
|
|
455
428
|
],
|
|
456
|
-
"description": "Get accounts returns
|
|
429
|
+
"description": "Get accounts returns accounts by account index"
|
|
457
430
|
}
|
|
458
431
|
},
|
|
459
432
|
"/api/v1/accountsByL1Address": {
|
|
@@ -488,7 +461,7 @@
|
|
|
488
461
|
"consumes": [
|
|
489
462
|
"multipart/form-data"
|
|
490
463
|
],
|
|
491
|
-
"description": "Get accounts by l1_address returns
|
|
464
|
+
"description": "Get accounts by l1_address returns all accounts associated with the given L1 address"
|
|
492
465
|
}
|
|
493
466
|
},
|
|
494
467
|
"/api/v1/block": {
|
|
@@ -968,7 +941,7 @@
|
|
|
968
941
|
"format": "int32"
|
|
969
942
|
},
|
|
970
943
|
{
|
|
971
|
-
"name": "
|
|
944
|
+
"name": "api_key_index",
|
|
972
945
|
"in": "query",
|
|
973
946
|
"required": true,
|
|
974
947
|
"type": "integer",
|
|
@@ -1703,6 +1676,44 @@
|
|
|
1703
1676
|
}
|
|
1704
1677
|
},
|
|
1705
1678
|
"definitions": {
|
|
1679
|
+
"Account": {
|
|
1680
|
+
"type": "object",
|
|
1681
|
+
"properties": {
|
|
1682
|
+
"code": {
|
|
1683
|
+
"type": "integer",
|
|
1684
|
+
"format": "int32",
|
|
1685
|
+
"example": "100"
|
|
1686
|
+
},
|
|
1687
|
+
"message": {
|
|
1688
|
+
"type": "string"
|
|
1689
|
+
},
|
|
1690
|
+
"index": {
|
|
1691
|
+
"type": "integer",
|
|
1692
|
+
"format": "int32",
|
|
1693
|
+
"example": "1"
|
|
1694
|
+
},
|
|
1695
|
+
"l1_address": {
|
|
1696
|
+
"type": "string",
|
|
1697
|
+
"example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
|
|
1698
|
+
},
|
|
1699
|
+
"status": {
|
|
1700
|
+
"type": "integer",
|
|
1701
|
+
"format": "int32",
|
|
1702
|
+
"example": "1"
|
|
1703
|
+
},
|
|
1704
|
+
"collateral": {
|
|
1705
|
+
"type": "string",
|
|
1706
|
+
"example": "46342"
|
|
1707
|
+
}
|
|
1708
|
+
},
|
|
1709
|
+
"title": "Account",
|
|
1710
|
+
"required": [
|
|
1711
|
+
"index",
|
|
1712
|
+
"l1_address",
|
|
1713
|
+
"status",
|
|
1714
|
+
"collateral"
|
|
1715
|
+
]
|
|
1716
|
+
},
|
|
1706
1717
|
"AccountMarketStats": {
|
|
1707
1718
|
"type": "object",
|
|
1708
1719
|
"properties": {
|
|
@@ -1873,6 +1884,35 @@
|
|
|
1873
1884
|
"buying_power"
|
|
1874
1885
|
]
|
|
1875
1886
|
},
|
|
1887
|
+
"Accounts": {
|
|
1888
|
+
"type": "object",
|
|
1889
|
+
"properties": {
|
|
1890
|
+
"code": {
|
|
1891
|
+
"type": "integer",
|
|
1892
|
+
"format": "int32",
|
|
1893
|
+
"example": "100"
|
|
1894
|
+
},
|
|
1895
|
+
"message": {
|
|
1896
|
+
"type": "string"
|
|
1897
|
+
},
|
|
1898
|
+
"total": {
|
|
1899
|
+
"type": "integer",
|
|
1900
|
+
"format": "int32",
|
|
1901
|
+
"example": "1"
|
|
1902
|
+
},
|
|
1903
|
+
"accounts": {
|
|
1904
|
+
"type": "array",
|
|
1905
|
+
"items": {
|
|
1906
|
+
"$ref": "#/definitions/Account"
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
},
|
|
1910
|
+
"title": "Accounts",
|
|
1911
|
+
"required": [
|
|
1912
|
+
"total",
|
|
1913
|
+
"accounts"
|
|
1914
|
+
]
|
|
1915
|
+
},
|
|
1876
1916
|
"Block": {
|
|
1877
1917
|
"type": "object",
|
|
1878
1918
|
"properties": {
|
|
@@ -2113,38 +2153,19 @@
|
|
|
2113
2153
|
"format": "int32",
|
|
2114
2154
|
"example": "1"
|
|
2115
2155
|
},
|
|
2116
|
-
"sub_account_index": {
|
|
2117
|
-
"type": "integer",
|
|
2118
|
-
"format": "uint8",
|
|
2119
|
-
"example": "1"
|
|
2120
|
-
},
|
|
2121
2156
|
"l1_address": {
|
|
2122
2157
|
"type": "string",
|
|
2123
2158
|
"example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
|
|
2124
2159
|
},
|
|
2125
|
-
"pk": {
|
|
2126
|
-
"type": "string",
|
|
2127
|
-
"example": "3ac126b0a0a3cc8cb367ef67a5c77389a85e08e20ce8da3edf34d022e9bf1ab8"
|
|
2128
|
-
},
|
|
2129
|
-
"nonce": {
|
|
2130
|
-
"type": "integer",
|
|
2131
|
-
"format": "int64",
|
|
2132
|
-
"example": "722"
|
|
2133
|
-
},
|
|
2134
2160
|
"status": {
|
|
2135
2161
|
"type": "integer",
|
|
2136
|
-
"format": "
|
|
2162
|
+
"format": "int32",
|
|
2137
2163
|
"example": "1"
|
|
2138
2164
|
},
|
|
2139
2165
|
"collateral": {
|
|
2140
2166
|
"type": "string",
|
|
2141
2167
|
"example": "46342"
|
|
2142
2168
|
},
|
|
2143
|
-
"collateral_type": {
|
|
2144
|
-
"type": "integer",
|
|
2145
|
-
"format": "uint8",
|
|
2146
|
-
"example": "1"
|
|
2147
|
-
},
|
|
2148
2169
|
"positions": {
|
|
2149
2170
|
"type": "array",
|
|
2150
2171
|
"items": {
|
|
@@ -2524,68 +2545,6 @@
|
|
|
2524
2545
|
"total_transaction_count"
|
|
2525
2546
|
]
|
|
2526
2547
|
},
|
|
2527
|
-
"MainAccount": {
|
|
2528
|
-
"type": "object",
|
|
2529
|
-
"properties": {
|
|
2530
|
-
"code": {
|
|
2531
|
-
"type": "integer",
|
|
2532
|
-
"format": "int32",
|
|
2533
|
-
"example": "100"
|
|
2534
|
-
},
|
|
2535
|
-
"message": {
|
|
2536
|
-
"type": "string"
|
|
2537
|
-
},
|
|
2538
|
-
"index": {
|
|
2539
|
-
"type": "integer",
|
|
2540
|
-
"format": "int32",
|
|
2541
|
-
"example": "1"
|
|
2542
|
-
},
|
|
2543
|
-
"l1_address": {
|
|
2544
|
-
"type": "string",
|
|
2545
|
-
"example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
|
|
2546
|
-
},
|
|
2547
|
-
"status": {
|
|
2548
|
-
"type": "integer",
|
|
2549
|
-
"format": "int32",
|
|
2550
|
-
"example": "1"
|
|
2551
|
-
}
|
|
2552
|
-
},
|
|
2553
|
-
"title": "MainAccount",
|
|
2554
|
-
"required": [
|
|
2555
|
-
"index",
|
|
2556
|
-
"l1_address",
|
|
2557
|
-
"status"
|
|
2558
|
-
]
|
|
2559
|
-
},
|
|
2560
|
-
"MainAccounts": {
|
|
2561
|
-
"type": "object",
|
|
2562
|
-
"properties": {
|
|
2563
|
-
"code": {
|
|
2564
|
-
"type": "integer",
|
|
2565
|
-
"format": "int32",
|
|
2566
|
-
"example": "100"
|
|
2567
|
-
},
|
|
2568
|
-
"message": {
|
|
2569
|
-
"type": "string"
|
|
2570
|
-
},
|
|
2571
|
-
"total": {
|
|
2572
|
-
"type": "integer",
|
|
2573
|
-
"format": "int32",
|
|
2574
|
-
"example": "1"
|
|
2575
|
-
},
|
|
2576
|
-
"accounts": {
|
|
2577
|
-
"type": "array",
|
|
2578
|
-
"items": {
|
|
2579
|
-
"$ref": "#/definitions/MainAccount"
|
|
2580
|
-
}
|
|
2581
|
-
}
|
|
2582
|
-
},
|
|
2583
|
-
"title": "MainAccounts",
|
|
2584
|
-
"required": [
|
|
2585
|
-
"total",
|
|
2586
|
-
"accounts"
|
|
2587
|
-
]
|
|
2588
|
-
},
|
|
2589
2548
|
"MarketInfo": {
|
|
2590
2549
|
"type": "object",
|
|
2591
2550
|
"properties": {
|
|
@@ -2686,14 +2645,9 @@
|
|
|
2686
2645
|
"format": "uin16",
|
|
2687
2646
|
"example": "1"
|
|
2688
2647
|
},
|
|
2689
|
-
"ownerMainAccountIndex": {
|
|
2690
|
-
"type": "integer",
|
|
2691
|
-
"format": "int64",
|
|
2692
|
-
"description": " TODO: should we return this?"
|
|
2693
|
-
},
|
|
2694
2648
|
"owner_account_index": {
|
|
2695
2649
|
"type": "integer",
|
|
2696
|
-
"format": "
|
|
2650
|
+
"format": "int32",
|
|
2697
2651
|
"example": "1"
|
|
2698
2652
|
},
|
|
2699
2653
|
"initial_base_amount": {
|
|
@@ -2772,7 +2726,6 @@
|
|
|
2772
2726
|
"title": "Order",
|
|
2773
2727
|
"required": [
|
|
2774
2728
|
"market_index",
|
|
2775
|
-
|
|
2776
2729
|
"owner_account_index",
|
|
2777
2730
|
"initial_base_amount",
|
|
2778
2731
|
"remaining_base_amount",
|
|
@@ -3039,7 +2992,7 @@
|
|
|
3039
2992
|
},
|
|
3040
2993
|
"daily_chart": {
|
|
3041
2994
|
"type": "object",
|
|
3042
|
-
"example": "{1640995200:
|
|
2995
|
+
"example": "{1640995200:3024.66}",
|
|
3043
2996
|
"additionalProperties": {
|
|
3044
2997
|
"type": "number",
|
|
3045
2998
|
"format": "double"
|
|
@@ -3324,12 +3277,6 @@
|
|
|
3324
3277
|
"type": "integer",
|
|
3325
3278
|
"format": "int32"
|
|
3326
3279
|
},
|
|
3327
|
-
"sub_account_index": {
|
|
3328
|
-
"type": "integer",
|
|
3329
|
-
"format": "uint8",
|
|
3330
|
-
"default": "255",
|
|
3331
|
-
"description": " NilSubAccountIndex"
|
|
3332
|
-
},
|
|
3333
3280
|
"market_id": {
|
|
3334
3281
|
"type": "integer",
|
|
3335
3282
|
"format": "uin16"
|
|
@@ -3338,7 +3285,6 @@
|
|
|
3338
3285
|
"title": "ReqGetAccountActiveOrders",
|
|
3339
3286
|
"required": [
|
|
3340
3287
|
"account_index",
|
|
3341
|
-
"sub_account_index",
|
|
3342
3288
|
"market_id"
|
|
3343
3289
|
]
|
|
3344
3290
|
},
|
|
@@ -3361,12 +3307,6 @@
|
|
|
3361
3307
|
"type": "integer",
|
|
3362
3308
|
"format": "int32"
|
|
3363
3309
|
},
|
|
3364
|
-
"sub_account_index": {
|
|
3365
|
-
"type": "integer",
|
|
3366
|
-
"format": "uint8",
|
|
3367
|
-
"default": "255",
|
|
3368
|
-
"description": " NilSubAccountIndex"
|
|
3369
|
-
},
|
|
3370
3310
|
"filter": {
|
|
3371
3311
|
"type": "string",
|
|
3372
3312
|
"enum": [
|
|
@@ -3391,7 +3331,6 @@
|
|
|
3391
3331
|
"title": "ReqGetAccountInactiveOrders",
|
|
3392
3332
|
"required": [
|
|
3393
3333
|
"account_index",
|
|
3394
|
-
"sub_account_index",
|
|
3395
3334
|
"filter",
|
|
3396
3335
|
"limit"
|
|
3397
3336
|
]
|
|
@@ -3685,7 +3624,7 @@
|
|
|
3685
3624
|
"type": "integer",
|
|
3686
3625
|
"format": "int32"
|
|
3687
3626
|
},
|
|
3688
|
-
"
|
|
3627
|
+
"api_key_index": {
|
|
3689
3628
|
"type": "integer",
|
|
3690
3629
|
"format": "uint8"
|
|
3691
3630
|
}
|
|
@@ -3693,7 +3632,7 @@
|
|
|
3693
3632
|
"title": "ReqGetNextNonce",
|
|
3694
3633
|
"required": [
|
|
3695
3634
|
"account_index",
|
|
3696
|
-
"
|
|
3635
|
+
"api_key_index"
|
|
3697
3636
|
]
|
|
3698
3637
|
},
|
|
3699
3638
|
"ReqGetOrderBookDetails": {
|
|
@@ -3888,33 +3827,6 @@
|
|
|
3888
3827
|
"limit"
|
|
3889
3828
|
]
|
|
3890
3829
|
},
|
|
3891
|
-
"ReqGetSubAccount": {
|
|
3892
|
-
"type": "object",
|
|
3893
|
-
"properties": {
|
|
3894
|
-
"by": {
|
|
3895
|
-
"type": "string",
|
|
3896
|
-
"enum": [
|
|
3897
|
-
"index",
|
|
3898
|
-
"l1_address"
|
|
3899
|
-
]
|
|
3900
|
-
},
|
|
3901
|
-
"value": {
|
|
3902
|
-
"type": "string"
|
|
3903
|
-
},
|
|
3904
|
-
"sub_account_index": {
|
|
3905
|
-
"type": "integer",
|
|
3906
|
-
"format": "uint8",
|
|
3907
|
-
"default": "255",
|
|
3908
|
-
"description": " NilSubAccountIndex"
|
|
3909
|
-
}
|
|
3910
|
-
},
|
|
3911
|
-
"title": "ReqGetSubAccount",
|
|
3912
|
-
"required": [
|
|
3913
|
-
"by",
|
|
3914
|
-
"value",
|
|
3915
|
-
"sub_account_index"
|
|
3916
|
-
]
|
|
3917
|
-
},
|
|
3918
3830
|
"ReqGetTrades": {
|
|
3919
3831
|
"type": "object",
|
|
3920
3832
|
"properties": {
|
|
@@ -4146,11 +4058,6 @@
|
|
|
4146
4058
|
"format": "int32",
|
|
4147
4059
|
"example": "1"
|
|
4148
4060
|
},
|
|
4149
|
-
"owner_sub_account_index": {
|
|
4150
|
-
"type": "integer",
|
|
4151
|
-
"format": "uint8",
|
|
4152
|
-
"example": "1"
|
|
4153
|
-
},
|
|
4154
4061
|
"initial_base_amount": {
|
|
4155
4062
|
"type": "string",
|
|
4156
4063
|
"example": "0.1"
|
|
@@ -4172,7 +4079,6 @@
|
|
|
4172
4079
|
"title": "SimpleOrder",
|
|
4173
4080
|
"required": [
|
|
4174
4081
|
"owner_account_index",
|
|
4175
|
-
"owner_sub_account_index",
|
|
4176
4082
|
"initial_base_amount",
|
|
4177
4083
|
"remaining_base_amount",
|
|
4178
4084
|
"price",
|
|
@@ -4199,59 +4105,6 @@
|
|
|
4199
4105
|
"network_id"
|
|
4200
4106
|
]
|
|
4201
4107
|
},
|
|
4202
|
-
"SubAccount": {
|
|
4203
|
-
"type": "object",
|
|
4204
|
-
"properties": {
|
|
4205
|
-
"index": {
|
|
4206
|
-
"type": "integer",
|
|
4207
|
-
"format": "int32",
|
|
4208
|
-
"example": "1"
|
|
4209
|
-
},
|
|
4210
|
-
"sub_account_index": {
|
|
4211
|
-
"type": "integer",
|
|
4212
|
-
"format": "uint8",
|
|
4213
|
-
"example": "1"
|
|
4214
|
-
},
|
|
4215
|
-
"l1_address": {
|
|
4216
|
-
"type": "string",
|
|
4217
|
-
"example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
|
|
4218
|
-
},
|
|
4219
|
-
"pk": {
|
|
4220
|
-
"type": "string",
|
|
4221
|
-
"example": "3ac126b0a0a3cc8cb367ef67a5c77389a85e08e20ce8da3edf34d022e9bf1ab8"
|
|
4222
|
-
},
|
|
4223
|
-
"nonce": {
|
|
4224
|
-
"type": "integer",
|
|
4225
|
-
"format": "int64",
|
|
4226
|
-
"example": "722"
|
|
4227
|
-
},
|
|
4228
|
-
"status": {
|
|
4229
|
-
"type": "integer",
|
|
4230
|
-
"format": "uint8",
|
|
4231
|
-
"example": "1"
|
|
4232
|
-
},
|
|
4233
|
-
"collateral": {
|
|
4234
|
-
"type": "string",
|
|
4235
|
-
"example": "46342"
|
|
4236
|
-
},
|
|
4237
|
-
"collateral_type": {
|
|
4238
|
-
"type": "integer",
|
|
4239
|
-
"format": "uint8",
|
|
4240
|
-
"example": "1"
|
|
4241
|
-
}
|
|
4242
|
-
},
|
|
4243
|
-
"title": "SubAccount",
|
|
4244
|
-
"required": [
|
|
4245
|
-
"index",
|
|
4246
|
-
"sub_account_index",
|
|
4247
|
-
"l1_address",
|
|
4248
|
-
"pk",
|
|
4249
|
-
"nonce",
|
|
4250
|
-
"status",
|
|
4251
|
-
"collateral",
|
|
4252
|
-
"collateral_type"
|
|
4253
|
-
]
|
|
4254
|
-
},
|
|
4255
4108
|
"SubAccounts": {
|
|
4256
4109
|
"type": "object",
|
|
4257
4110
|
"properties": {
|
|
@@ -4263,33 +4116,21 @@
|
|
|
4263
4116
|
"message": {
|
|
4264
4117
|
"type": "string"
|
|
4265
4118
|
},
|
|
4266
|
-
"index": {
|
|
4267
|
-
"type": "integer",
|
|
4268
|
-
"format": "int32",
|
|
4269
|
-
"example": "1"
|
|
4270
|
-
},
|
|
4271
4119
|
"l1_address": {
|
|
4272
4120
|
"type": "string",
|
|
4273
4121
|
"example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
|
|
4274
4122
|
},
|
|
4275
|
-
"status": {
|
|
4276
|
-
"type": "integer",
|
|
4277
|
-
"format": "uint8",
|
|
4278
|
-
"example": "1"
|
|
4279
|
-
},
|
|
4280
4123
|
"sub_accounts": {
|
|
4281
4124
|
"type": "array",
|
|
4282
4125
|
"example": "1",
|
|
4283
4126
|
"items": {
|
|
4284
|
-
"$ref": "#/definitions/
|
|
4127
|
+
"$ref": "#/definitions/Account"
|
|
4285
4128
|
}
|
|
4286
4129
|
}
|
|
4287
4130
|
},
|
|
4288
4131
|
"title": "SubAccounts",
|
|
4289
4132
|
"required": [
|
|
4290
|
-
"index",
|
|
4291
4133
|
"l1_address",
|
|
4292
|
-
"status",
|
|
4293
4134
|
"sub_accounts"
|
|
4294
4135
|
]
|
|
4295
4136
|
},
|
|
@@ -4330,12 +4171,12 @@
|
|
|
4330
4171
|
},
|
|
4331
4172
|
"maker_account_id": {
|
|
4332
4173
|
"type": "integer",
|
|
4333
|
-
"format": "
|
|
4174
|
+
"format": "int32",
|
|
4334
4175
|
"example": "1"
|
|
4335
4176
|
},
|
|
4336
4177
|
"taker_account_id": {
|
|
4337
4178
|
"type": "integer",
|
|
4338
|
-
"format": "
|
|
4179
|
+
"format": "int32",
|
|
4339
4180
|
"example": "3"
|
|
4340
4181
|
},
|
|
4341
4182
|
"is_maker_ask": {
|