@reyaxyz/common 0.238.2 → 0.240.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.
- package/README.md +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/trading-api-types.js +8 -0
- package/dist/trading-api-types.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/trading-api-types.d.ts +359 -0
- package/dist/types/trading-api-types.d.ts.map +1 -0
- package/package.json +4 -3
- package/src/index.ts +1 -0
- package/src/trading-api-types.ts +392 -0
package/README.md
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
|
|
7
7
|
| Statements | Branches | Functions | Lines |
|
|
8
8
|
| --------------------------- | ----------------------- | ------------------------- | ----------------- |
|
|
9
|
-
|  |  |  |  |
|
|
10
10
|
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./trading-api-types"), exports);
|
|
18
19
|
__exportStar(require("./commands"), exports);
|
|
19
20
|
__exportStar(require("./utils"), exports);
|
|
20
21
|
__exportStar(require("./services"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B;AAC3B,0CAAwB;AACxB,6CAA2B;AAC3B,4CAA0B;AAC1B,yCAAuB;AACvB,+CAA6B;AAC7B,iDAA+B","sourcesContent":["export * from './types';\nexport * from './commands';\nexport * from './utils';\nexport * from './services';\nexport * from './modules';\nexport * from './rest';\nexport * from './decorators';\nexport * from './transactions';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,sDAAoC;AACpC,6CAA2B;AAC3B,0CAAwB;AACxB,6CAA2B;AAC3B,4CAA0B;AAC1B,yCAAuB;AACvB,+CAA6B;AAC7B,iDAA+B","sourcesContent":["export * from './types';\nexport * from './trading-api-types';\nexport * from './commands';\nexport * from './utils';\nexport * from './services';\nexport * from './modules';\nexport * from './rest';\nexport * from './decorators';\nexport * from './transactions';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trading-api-types.js","sourceRoot":"/","sources":["trading-api-types.ts"],"names":[],"mappings":";;;AAwBa,QAAA,mBAAmB,GAAG;IACjC,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;CACjB,CAAC","sourcesContent":["import { ParamsDictionary, Query } from 'express-serve-static-core';\ntype Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';\ntype OnlyDigits<T extends string> = T extends `${Digit}${infer Rest}`\n ? Rest extends ''\n ? T\n : OnlyDigits<Rest>\n : never;\n\nexport type PaginatedQueryParams = {\n before: OnlyDigits<string>;\n after: OnlyDigits<string>;\n limit: OnlyDigits<string>;\n direction: 'asc' | 'desc';\n};\n\nexport type PaginatedQueryMeta = {\n limit: number;\n count: number;\n before: bigint | null | undefined;\n after: bigint | null | undefined;\n};\n\nexport type Decimal = 'fake-decimal';\n\nexport const AccountStatusValues = {\n OPEN: 'OPEN',\n CLOSED: 'CLOSED',\n};\n\nexport type AccountStatus =\n (typeof AccountStatusValues)[keyof typeof AccountStatusValues];\n\ntype Order = {\n id: string;\n market_id: Decimal | null;\n account_id: Decimal | null;\n order_base: Decimal | null;\n fee: Decimal | null;\n price: Decimal | null;\n type: string;\n processed: boolean;\n transaction_hash: string;\n r_pnl: Decimal | null;\n price_variation_pnl: Decimal | null;\n funding_pnl: Decimal | null;\n average_entry_price: Decimal | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n source: string | null;\n unique_id: bigint | null;\n created_at: Date;\n};\n\nexport type TradingApiSource = {\n Leverages: {\n params: {\n address: string;\n };\n query: never;\n response: {\n accountId: Decimal;\n marketId: Decimal;\n leverage: number;\n createdAt: Date;\n updatedAt: Date;\n }[];\n };\n MarketsConfiguration: {\n params: never;\n query: never;\n response: {\n market_id: Decimal;\n risk_matrix_index: Decimal | null;\n max_open_base: Decimal | null;\n velocity_multiplier: Decimal | null;\n minimum_order_base: Decimal | null;\n base_spacing: Decimal | null;\n price_spacing: Decimal | null;\n oracle_node_id: string | null;\n mtm_window: Decimal | null;\n dutch_config_lambda: Decimal | null;\n dutch_config_min_base: Decimal | null;\n slippage_params_phi: Decimal | null;\n slippage_params_beta: Decimal | null;\n depth_factor: Decimal | null;\n max_exposure_factor: Decimal | null;\n max_p_slippage: Decimal | null;\n price_spread: Decimal | null;\n volatility_index_multiplier: Decimal | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n }[];\n };\n MarketsStorage: {\n params: never;\n query: never;\n response: {\n market_id: Decimal;\n quote_collateral: string | null;\n instrument_address: string | null;\n name: string | null;\n risk_block_id: Decimal | null;\n collateral_pool_id: Decimal | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n }[];\n };\n MarketsTracker: {\n params: never;\n query: never;\n response: {\n market_data_id: Decimal;\n passive_pool_id: Decimal | null;\n pool_account_id: Decimal | null;\n quote_token: string | null;\n quote_token_decimals: Decimal | null;\n last_funding_velocity: Decimal | null;\n last_funding_timestamp: Decimal | null;\n last_mtm_price: Decimal | null;\n last_mtm_timestamp: Decimal | null;\n long_trackers_funding_value: Decimal | null;\n last_funding_rate: Decimal | null;\n long_trackers_base_multiplier: Decimal | null;\n long_trackers_adl_unwind_price: Decimal | null;\n short_trackers_funding_value: Decimal | null;\n short_trackers_base_multiplier: Decimal | null;\n short_trackers_adl_unwind_price: Decimal | null;\n open_interest: Decimal | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n }[];\n };\n Positions: {\n params: {\n address: string;\n };\n query: never;\n response: {\n market_id: Decimal;\n account_id: Decimal;\n base: Decimal | null;\n realized_pnl: Decimal | null;\n realized_pnl_latest_snapshot: Decimal | null;\n average_entry_price_off_chain_tracker: Decimal | null;\n funding_value_off_chain_tracker: Decimal | null;\n last_price: Decimal | null;\n position_data_last_price_data_timestamp: Decimal | null;\n funding_value: Decimal | null;\n base_multiplier: Decimal | null;\n adl_unwind_price: Decimal | null;\n transaction_hash: string;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n unique_id: bigint | null;\n }[];\n };\n ConditionalOrders: {\n params: {\n address: string;\n };\n query: never;\n response: {\n id: string;\n account_id: Decimal;\n market_id: Decimal;\n order_type: string;\n is_long: boolean;\n trigger_price: number;\n order_base: Decimal;\n exchange_id: bigint;\n inputs: string;\n counterparty_account_id: bigint;\n reya_chain_id: bigint;\n deadline: bigint;\n signer_address: string;\n nonce: Decimal;\n signature: string;\n status: string;\n creation_timestamp_ms: bigint;\n last_update_timestamp_ms: bigint;\n transaction_hash: string | null;\n }[];\n };\n Assets: {\n params: never;\n query: never;\n response: {\n address: string;\n name: string;\n short: string;\n createdAt: Date;\n updatedAt: Date;\n asset_price_contract_id: string | null;\n asset_price_usdc_contract_id: string | null;\n decimals: number;\n }[];\n };\n Prices: {\n params: never;\n query: never;\n response: {\n block_number: Decimal;\n unique_id: bigint | null;\n contract_id: string;\n price: Decimal | null;\n round_id: Decimal | null;\n timestamp: Decimal;\n }[];\n };\n Accounts: {\n params: {\n address: string;\n };\n query: never;\n response: {\n account_id: Decimal;\n name: string;\n status: AccountStatus;\n updated_timestamp_ms: Decimal;\n source: string | null;\n }[];\n };\n AccountsBalances: {\n params: {\n address: string;\n };\n query: never;\n response: {\n account_id: number;\n collateral: string;\n balance: string;\n }[];\n };\n AutoExchange: {\n params: {\n address: string;\n };\n query: PaginatedQueryParams;\n response: {\n data: {\n id: string;\n liquidated_account_id: Decimal | null;\n liquidator_account_id: Decimal | null;\n requested_quote_amount: Decimal | null;\n collateral_out_address: string | null;\n collateral_in_address: string | null;\n collateral_amount_to_liquidator: Decimal | null;\n quote_amount_to_insurance_fund: Decimal | null;\n quote_amount_to_account: Decimal | null;\n block_timestamp: Decimal | null;\n block_number: Decimal;\n transaction_hash: string;\n unique_id: bigint | null;\n }[];\n meta: PaginatedQueryMeta;\n };\n };\n Swaps: {\n params: {\n address: string;\n };\n query: PaginatedQueryParams;\n response: {\n data: {\n id: string;\n account_id: Decimal;\n token_in: string;\n token_out: string;\n amount_in: Decimal;\n amount_out: Decimal;\n executed_amount_out: Decimal;\n transaction_hash: string;\n block_timestamp: Decimal;\n block_number: Decimal;\n unique_id: bigint | null;\n }[];\n meta: PaginatedQueryMeta;\n };\n };\n MarketOrders: {\n params: {\n marketId: string;\n type?: string;\n };\n query: PaginatedQueryParams;\n response: {\n data: Order[];\n meta: PaginatedQueryMeta;\n };\n };\n AccountOrders: {\n params: {\n accountId: string;\n type?: string;\n };\n query: PaginatedQueryParams;\n response: {\n data: Order[];\n meta: PaginatedQueryMeta;\n };\n };\n WalletOrders: {\n params: {\n address: string;\n type?: string;\n };\n query: PaginatedQueryParams;\n response: {\n data: Order[];\n meta: PaginatedQueryMeta;\n };\n };\n RiskMatrices: {\n params: {\n poolId: string;\n };\n query: never;\n response: {\n blockId: Decimal;\n matrix: string[][];\n }[];\n };\n Markets: {\n params: never;\n query: never;\n response: {\n id: Decimal;\n ticker: string;\n markPrice: number;\n isActive: boolean;\n maxLeverage: number;\n volume24H: number;\n priceChange24H: number;\n longOI: number;\n shortOI: number;\n availableLong: number;\n availableShort: number;\n marketPriceDeviation: number;\n riskBlockId: number;\n rootCollateralPoolId: number;\n description: string;\n name: string;\n quoteTokenId: string;\n tickSizeDecimals: number;\n underlyingAssetId: string;\n priceChange24HPercentage: number;\n openInterest: number;\n fundingRate: number;\n priority: number;\n }[];\n };\n};\n\ntype Stringified<T> = T extends Decimal | bigint | Date\n ? string\n : T extends (infer U)[]\n ? Stringified<U>[]\n : { [K in keyof T]: Stringified<T[K]> };\n\nexport type Req<P = ParamsDictionary, ReqQuery = Query> = {\n params: P;\n query: ReqQuery;\n};\n\n/*\n\nSame as infered type \n\nexport type TradingApi = {\n [K in keyof typeof TradingQueries as K extends `get${infer R}` ? R : K]: {\n params: Parameters<ReturnType<(typeof TradingQueries)[K]>>[0] extends Req\n ? Parameters<ReturnType<(typeof TradingQueries)[K]>>[0]['params']\n : never;\n query: Parameters<ReturnType<(typeof TradingQueries)[K]>>[0] extends Req\n ? Parameters<ReturnType<(typeof TradingQueries)[K]>>[0]['query']\n : never;\n response: Stringified<\n Awaited<ReturnType<ReturnType<(typeof TradingQueries)[K]>>>\n >;\n\n*/\n\nexport type TradingApi = {\n [K in keyof TradingApiSource as K]: {\n params: TradingApiSource[K]['params'];\n query: TradingApiSource[K]['query'];\n response: Stringified<TradingApiSource[K]['response']>;\n };\n};\n"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { ParamsDictionary, Query } from 'express-serve-static-core';
|
|
2
|
+
type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
|
|
3
|
+
type OnlyDigits<T extends string> = T extends `${Digit}${infer Rest}` ? Rest extends '' ? T : OnlyDigits<Rest> : never;
|
|
4
|
+
export type PaginatedQueryParams = {
|
|
5
|
+
before: OnlyDigits<string>;
|
|
6
|
+
after: OnlyDigits<string>;
|
|
7
|
+
limit: OnlyDigits<string>;
|
|
8
|
+
direction: 'asc' | 'desc';
|
|
9
|
+
};
|
|
10
|
+
export type PaginatedQueryMeta = {
|
|
11
|
+
limit: number;
|
|
12
|
+
count: number;
|
|
13
|
+
before: bigint | null | undefined;
|
|
14
|
+
after: bigint | null | undefined;
|
|
15
|
+
};
|
|
16
|
+
export type Decimal = 'fake-decimal';
|
|
17
|
+
export declare const AccountStatusValues: {
|
|
18
|
+
OPEN: string;
|
|
19
|
+
CLOSED: string;
|
|
20
|
+
};
|
|
21
|
+
export type AccountStatus = (typeof AccountStatusValues)[keyof typeof AccountStatusValues];
|
|
22
|
+
type Order = {
|
|
23
|
+
id: string;
|
|
24
|
+
market_id: Decimal | null;
|
|
25
|
+
account_id: Decimal | null;
|
|
26
|
+
order_base: Decimal | null;
|
|
27
|
+
fee: Decimal | null;
|
|
28
|
+
price: Decimal | null;
|
|
29
|
+
type: string;
|
|
30
|
+
processed: boolean;
|
|
31
|
+
transaction_hash: string;
|
|
32
|
+
r_pnl: Decimal | null;
|
|
33
|
+
price_variation_pnl: Decimal | null;
|
|
34
|
+
funding_pnl: Decimal | null;
|
|
35
|
+
average_entry_price: Decimal | null;
|
|
36
|
+
block_timestamp: Decimal | null;
|
|
37
|
+
block_number: Decimal;
|
|
38
|
+
source: string | null;
|
|
39
|
+
unique_id: bigint | null;
|
|
40
|
+
created_at: Date;
|
|
41
|
+
};
|
|
42
|
+
export type TradingApiSource = {
|
|
43
|
+
Leverages: {
|
|
44
|
+
params: {
|
|
45
|
+
address: string;
|
|
46
|
+
};
|
|
47
|
+
query: never;
|
|
48
|
+
response: {
|
|
49
|
+
accountId: Decimal;
|
|
50
|
+
marketId: Decimal;
|
|
51
|
+
leverage: number;
|
|
52
|
+
createdAt: Date;
|
|
53
|
+
updatedAt: Date;
|
|
54
|
+
}[];
|
|
55
|
+
};
|
|
56
|
+
MarketsConfiguration: {
|
|
57
|
+
params: never;
|
|
58
|
+
query: never;
|
|
59
|
+
response: {
|
|
60
|
+
market_id: Decimal;
|
|
61
|
+
risk_matrix_index: Decimal | null;
|
|
62
|
+
max_open_base: Decimal | null;
|
|
63
|
+
velocity_multiplier: Decimal | null;
|
|
64
|
+
minimum_order_base: Decimal | null;
|
|
65
|
+
base_spacing: Decimal | null;
|
|
66
|
+
price_spacing: Decimal | null;
|
|
67
|
+
oracle_node_id: string | null;
|
|
68
|
+
mtm_window: Decimal | null;
|
|
69
|
+
dutch_config_lambda: Decimal | null;
|
|
70
|
+
dutch_config_min_base: Decimal | null;
|
|
71
|
+
slippage_params_phi: Decimal | null;
|
|
72
|
+
slippage_params_beta: Decimal | null;
|
|
73
|
+
depth_factor: Decimal | null;
|
|
74
|
+
max_exposure_factor: Decimal | null;
|
|
75
|
+
max_p_slippage: Decimal | null;
|
|
76
|
+
price_spread: Decimal | null;
|
|
77
|
+
volatility_index_multiplier: Decimal | null;
|
|
78
|
+
block_timestamp: Decimal | null;
|
|
79
|
+
block_number: Decimal;
|
|
80
|
+
unique_id: bigint | null;
|
|
81
|
+
}[];
|
|
82
|
+
};
|
|
83
|
+
MarketsStorage: {
|
|
84
|
+
params: never;
|
|
85
|
+
query: never;
|
|
86
|
+
response: {
|
|
87
|
+
market_id: Decimal;
|
|
88
|
+
quote_collateral: string | null;
|
|
89
|
+
instrument_address: string | null;
|
|
90
|
+
name: string | null;
|
|
91
|
+
risk_block_id: Decimal | null;
|
|
92
|
+
collateral_pool_id: Decimal | null;
|
|
93
|
+
block_timestamp: Decimal | null;
|
|
94
|
+
block_number: Decimal;
|
|
95
|
+
unique_id: bigint | null;
|
|
96
|
+
}[];
|
|
97
|
+
};
|
|
98
|
+
MarketsTracker: {
|
|
99
|
+
params: never;
|
|
100
|
+
query: never;
|
|
101
|
+
response: {
|
|
102
|
+
market_data_id: Decimal;
|
|
103
|
+
passive_pool_id: Decimal | null;
|
|
104
|
+
pool_account_id: Decimal | null;
|
|
105
|
+
quote_token: string | null;
|
|
106
|
+
quote_token_decimals: Decimal | null;
|
|
107
|
+
last_funding_velocity: Decimal | null;
|
|
108
|
+
last_funding_timestamp: Decimal | null;
|
|
109
|
+
last_mtm_price: Decimal | null;
|
|
110
|
+
last_mtm_timestamp: Decimal | null;
|
|
111
|
+
long_trackers_funding_value: Decimal | null;
|
|
112
|
+
last_funding_rate: Decimal | null;
|
|
113
|
+
long_trackers_base_multiplier: Decimal | null;
|
|
114
|
+
long_trackers_adl_unwind_price: Decimal | null;
|
|
115
|
+
short_trackers_funding_value: Decimal | null;
|
|
116
|
+
short_trackers_base_multiplier: Decimal | null;
|
|
117
|
+
short_trackers_adl_unwind_price: Decimal | null;
|
|
118
|
+
open_interest: Decimal | null;
|
|
119
|
+
block_timestamp: Decimal | null;
|
|
120
|
+
block_number: Decimal;
|
|
121
|
+
unique_id: bigint | null;
|
|
122
|
+
}[];
|
|
123
|
+
};
|
|
124
|
+
Positions: {
|
|
125
|
+
params: {
|
|
126
|
+
address: string;
|
|
127
|
+
};
|
|
128
|
+
query: never;
|
|
129
|
+
response: {
|
|
130
|
+
market_id: Decimal;
|
|
131
|
+
account_id: Decimal;
|
|
132
|
+
base: Decimal | null;
|
|
133
|
+
realized_pnl: Decimal | null;
|
|
134
|
+
realized_pnl_latest_snapshot: Decimal | null;
|
|
135
|
+
average_entry_price_off_chain_tracker: Decimal | null;
|
|
136
|
+
funding_value_off_chain_tracker: Decimal | null;
|
|
137
|
+
last_price: Decimal | null;
|
|
138
|
+
position_data_last_price_data_timestamp: Decimal | null;
|
|
139
|
+
funding_value: Decimal | null;
|
|
140
|
+
base_multiplier: Decimal | null;
|
|
141
|
+
adl_unwind_price: Decimal | null;
|
|
142
|
+
transaction_hash: string;
|
|
143
|
+
block_timestamp: Decimal | null;
|
|
144
|
+
block_number: Decimal;
|
|
145
|
+
unique_id: bigint | null;
|
|
146
|
+
}[];
|
|
147
|
+
};
|
|
148
|
+
ConditionalOrders: {
|
|
149
|
+
params: {
|
|
150
|
+
address: string;
|
|
151
|
+
};
|
|
152
|
+
query: never;
|
|
153
|
+
response: {
|
|
154
|
+
id: string;
|
|
155
|
+
account_id: Decimal;
|
|
156
|
+
market_id: Decimal;
|
|
157
|
+
order_type: string;
|
|
158
|
+
is_long: boolean;
|
|
159
|
+
trigger_price: number;
|
|
160
|
+
order_base: Decimal;
|
|
161
|
+
exchange_id: bigint;
|
|
162
|
+
inputs: string;
|
|
163
|
+
counterparty_account_id: bigint;
|
|
164
|
+
reya_chain_id: bigint;
|
|
165
|
+
deadline: bigint;
|
|
166
|
+
signer_address: string;
|
|
167
|
+
nonce: Decimal;
|
|
168
|
+
signature: string;
|
|
169
|
+
status: string;
|
|
170
|
+
creation_timestamp_ms: bigint;
|
|
171
|
+
last_update_timestamp_ms: bigint;
|
|
172
|
+
transaction_hash: string | null;
|
|
173
|
+
}[];
|
|
174
|
+
};
|
|
175
|
+
Assets: {
|
|
176
|
+
params: never;
|
|
177
|
+
query: never;
|
|
178
|
+
response: {
|
|
179
|
+
address: string;
|
|
180
|
+
name: string;
|
|
181
|
+
short: string;
|
|
182
|
+
createdAt: Date;
|
|
183
|
+
updatedAt: Date;
|
|
184
|
+
asset_price_contract_id: string | null;
|
|
185
|
+
asset_price_usdc_contract_id: string | null;
|
|
186
|
+
decimals: number;
|
|
187
|
+
}[];
|
|
188
|
+
};
|
|
189
|
+
Prices: {
|
|
190
|
+
params: never;
|
|
191
|
+
query: never;
|
|
192
|
+
response: {
|
|
193
|
+
block_number: Decimal;
|
|
194
|
+
unique_id: bigint | null;
|
|
195
|
+
contract_id: string;
|
|
196
|
+
price: Decimal | null;
|
|
197
|
+
round_id: Decimal | null;
|
|
198
|
+
timestamp: Decimal;
|
|
199
|
+
}[];
|
|
200
|
+
};
|
|
201
|
+
Accounts: {
|
|
202
|
+
params: {
|
|
203
|
+
address: string;
|
|
204
|
+
};
|
|
205
|
+
query: never;
|
|
206
|
+
response: {
|
|
207
|
+
account_id: Decimal;
|
|
208
|
+
name: string;
|
|
209
|
+
status: AccountStatus;
|
|
210
|
+
updated_timestamp_ms: Decimal;
|
|
211
|
+
source: string | null;
|
|
212
|
+
}[];
|
|
213
|
+
};
|
|
214
|
+
AccountsBalances: {
|
|
215
|
+
params: {
|
|
216
|
+
address: string;
|
|
217
|
+
};
|
|
218
|
+
query: never;
|
|
219
|
+
response: {
|
|
220
|
+
account_id: number;
|
|
221
|
+
collateral: string;
|
|
222
|
+
balance: string;
|
|
223
|
+
}[];
|
|
224
|
+
};
|
|
225
|
+
AutoExchange: {
|
|
226
|
+
params: {
|
|
227
|
+
address: string;
|
|
228
|
+
};
|
|
229
|
+
query: PaginatedQueryParams;
|
|
230
|
+
response: {
|
|
231
|
+
data: {
|
|
232
|
+
id: string;
|
|
233
|
+
liquidated_account_id: Decimal | null;
|
|
234
|
+
liquidator_account_id: Decimal | null;
|
|
235
|
+
requested_quote_amount: Decimal | null;
|
|
236
|
+
collateral_out_address: string | null;
|
|
237
|
+
collateral_in_address: string | null;
|
|
238
|
+
collateral_amount_to_liquidator: Decimal | null;
|
|
239
|
+
quote_amount_to_insurance_fund: Decimal | null;
|
|
240
|
+
quote_amount_to_account: Decimal | null;
|
|
241
|
+
block_timestamp: Decimal | null;
|
|
242
|
+
block_number: Decimal;
|
|
243
|
+
transaction_hash: string;
|
|
244
|
+
unique_id: bigint | null;
|
|
245
|
+
}[];
|
|
246
|
+
meta: PaginatedQueryMeta;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
Swaps: {
|
|
250
|
+
params: {
|
|
251
|
+
address: string;
|
|
252
|
+
};
|
|
253
|
+
query: PaginatedQueryParams;
|
|
254
|
+
response: {
|
|
255
|
+
data: {
|
|
256
|
+
id: string;
|
|
257
|
+
account_id: Decimal;
|
|
258
|
+
token_in: string;
|
|
259
|
+
token_out: string;
|
|
260
|
+
amount_in: Decimal;
|
|
261
|
+
amount_out: Decimal;
|
|
262
|
+
executed_amount_out: Decimal;
|
|
263
|
+
transaction_hash: string;
|
|
264
|
+
block_timestamp: Decimal;
|
|
265
|
+
block_number: Decimal;
|
|
266
|
+
unique_id: bigint | null;
|
|
267
|
+
}[];
|
|
268
|
+
meta: PaginatedQueryMeta;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
MarketOrders: {
|
|
272
|
+
params: {
|
|
273
|
+
marketId: string;
|
|
274
|
+
type?: string;
|
|
275
|
+
};
|
|
276
|
+
query: PaginatedQueryParams;
|
|
277
|
+
response: {
|
|
278
|
+
data: Order[];
|
|
279
|
+
meta: PaginatedQueryMeta;
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
AccountOrders: {
|
|
283
|
+
params: {
|
|
284
|
+
accountId: string;
|
|
285
|
+
type?: string;
|
|
286
|
+
};
|
|
287
|
+
query: PaginatedQueryParams;
|
|
288
|
+
response: {
|
|
289
|
+
data: Order[];
|
|
290
|
+
meta: PaginatedQueryMeta;
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
WalletOrders: {
|
|
294
|
+
params: {
|
|
295
|
+
address: string;
|
|
296
|
+
type?: string;
|
|
297
|
+
};
|
|
298
|
+
query: PaginatedQueryParams;
|
|
299
|
+
response: {
|
|
300
|
+
data: Order[];
|
|
301
|
+
meta: PaginatedQueryMeta;
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
RiskMatrices: {
|
|
305
|
+
params: {
|
|
306
|
+
poolId: string;
|
|
307
|
+
};
|
|
308
|
+
query: never;
|
|
309
|
+
response: {
|
|
310
|
+
blockId: Decimal;
|
|
311
|
+
matrix: string[][];
|
|
312
|
+
}[];
|
|
313
|
+
};
|
|
314
|
+
Markets: {
|
|
315
|
+
params: never;
|
|
316
|
+
query: never;
|
|
317
|
+
response: {
|
|
318
|
+
id: Decimal;
|
|
319
|
+
ticker: string;
|
|
320
|
+
markPrice: number;
|
|
321
|
+
isActive: boolean;
|
|
322
|
+
maxLeverage: number;
|
|
323
|
+
volume24H: number;
|
|
324
|
+
priceChange24H: number;
|
|
325
|
+
longOI: number;
|
|
326
|
+
shortOI: number;
|
|
327
|
+
availableLong: number;
|
|
328
|
+
availableShort: number;
|
|
329
|
+
marketPriceDeviation: number;
|
|
330
|
+
riskBlockId: number;
|
|
331
|
+
rootCollateralPoolId: number;
|
|
332
|
+
description: string;
|
|
333
|
+
name: string;
|
|
334
|
+
quoteTokenId: string;
|
|
335
|
+
tickSizeDecimals: number;
|
|
336
|
+
underlyingAssetId: string;
|
|
337
|
+
priceChange24HPercentage: number;
|
|
338
|
+
openInterest: number;
|
|
339
|
+
fundingRate: number;
|
|
340
|
+
priority: number;
|
|
341
|
+
}[];
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
type Stringified<T> = T extends Decimal | bigint | Date ? string : T extends (infer U)[] ? Stringified<U>[] : {
|
|
345
|
+
[K in keyof T]: Stringified<T[K]>;
|
|
346
|
+
};
|
|
347
|
+
export type Req<P = ParamsDictionary, ReqQuery = Query> = {
|
|
348
|
+
params: P;
|
|
349
|
+
query: ReqQuery;
|
|
350
|
+
};
|
|
351
|
+
export type TradingApi = {
|
|
352
|
+
[K in keyof TradingApiSource as K]: {
|
|
353
|
+
params: TradingApiSource[K]['params'];
|
|
354
|
+
query: TradingApiSource[K]['query'];
|
|
355
|
+
response: Stringified<TradingApiSource[K]['response']>;
|
|
356
|
+
};
|
|
357
|
+
};
|
|
358
|
+
export {};
|
|
359
|
+
//# sourceMappingURL=trading-api-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trading-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gBAAgB,IAAI,CAAC,GAAG;QAClC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QACtC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QACpC,QAAQ,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;KACxD;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.240.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"README.md"
|
|
19
19
|
],
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@types/
|
|
21
|
+
"@types/express-serve-static-core": "^5.0.4",
|
|
22
|
+
"@types/lodash.clonedeep": "^4.5.9"
|
|
22
23
|
},
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"axios": "^1.6.2",
|
|
@@ -43,5 +44,5 @@
|
|
|
43
44
|
"generate:coverage-badges": "npx istanbul-badges-readme --silent"
|
|
44
45
|
},
|
|
45
46
|
"packageManager": "pnpm@8.3.1",
|
|
46
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "81c0bd8750b48c8954bc07f8189f2eefe2d7018c"
|
|
47
48
|
}
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { ParamsDictionary, Query } from 'express-serve-static-core';
|
|
2
|
+
type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
|
|
3
|
+
type OnlyDigits<T extends string> = T extends `${Digit}${infer Rest}`
|
|
4
|
+
? Rest extends ''
|
|
5
|
+
? T
|
|
6
|
+
: OnlyDigits<Rest>
|
|
7
|
+
: never;
|
|
8
|
+
|
|
9
|
+
export type PaginatedQueryParams = {
|
|
10
|
+
before: OnlyDigits<string>;
|
|
11
|
+
after: OnlyDigits<string>;
|
|
12
|
+
limit: OnlyDigits<string>;
|
|
13
|
+
direction: 'asc' | 'desc';
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type PaginatedQueryMeta = {
|
|
17
|
+
limit: number;
|
|
18
|
+
count: number;
|
|
19
|
+
before: bigint | null | undefined;
|
|
20
|
+
after: bigint | null | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type Decimal = 'fake-decimal';
|
|
24
|
+
|
|
25
|
+
export const AccountStatusValues = {
|
|
26
|
+
OPEN: 'OPEN',
|
|
27
|
+
CLOSED: 'CLOSED',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type AccountStatus =
|
|
31
|
+
(typeof AccountStatusValues)[keyof typeof AccountStatusValues];
|
|
32
|
+
|
|
33
|
+
type Order = {
|
|
34
|
+
id: string;
|
|
35
|
+
market_id: Decimal | null;
|
|
36
|
+
account_id: Decimal | null;
|
|
37
|
+
order_base: Decimal | null;
|
|
38
|
+
fee: Decimal | null;
|
|
39
|
+
price: Decimal | null;
|
|
40
|
+
type: string;
|
|
41
|
+
processed: boolean;
|
|
42
|
+
transaction_hash: string;
|
|
43
|
+
r_pnl: Decimal | null;
|
|
44
|
+
price_variation_pnl: Decimal | null;
|
|
45
|
+
funding_pnl: Decimal | null;
|
|
46
|
+
average_entry_price: Decimal | null;
|
|
47
|
+
block_timestamp: Decimal | null;
|
|
48
|
+
block_number: Decimal;
|
|
49
|
+
source: string | null;
|
|
50
|
+
unique_id: bigint | null;
|
|
51
|
+
created_at: Date;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type TradingApiSource = {
|
|
55
|
+
Leverages: {
|
|
56
|
+
params: {
|
|
57
|
+
address: string;
|
|
58
|
+
};
|
|
59
|
+
query: never;
|
|
60
|
+
response: {
|
|
61
|
+
accountId: Decimal;
|
|
62
|
+
marketId: Decimal;
|
|
63
|
+
leverage: number;
|
|
64
|
+
createdAt: Date;
|
|
65
|
+
updatedAt: Date;
|
|
66
|
+
}[];
|
|
67
|
+
};
|
|
68
|
+
MarketsConfiguration: {
|
|
69
|
+
params: never;
|
|
70
|
+
query: never;
|
|
71
|
+
response: {
|
|
72
|
+
market_id: Decimal;
|
|
73
|
+
risk_matrix_index: Decimal | null;
|
|
74
|
+
max_open_base: Decimal | null;
|
|
75
|
+
velocity_multiplier: Decimal | null;
|
|
76
|
+
minimum_order_base: Decimal | null;
|
|
77
|
+
base_spacing: Decimal | null;
|
|
78
|
+
price_spacing: Decimal | null;
|
|
79
|
+
oracle_node_id: string | null;
|
|
80
|
+
mtm_window: Decimal | null;
|
|
81
|
+
dutch_config_lambda: Decimal | null;
|
|
82
|
+
dutch_config_min_base: Decimal | null;
|
|
83
|
+
slippage_params_phi: Decimal | null;
|
|
84
|
+
slippage_params_beta: Decimal | null;
|
|
85
|
+
depth_factor: Decimal | null;
|
|
86
|
+
max_exposure_factor: Decimal | null;
|
|
87
|
+
max_p_slippage: Decimal | null;
|
|
88
|
+
price_spread: Decimal | null;
|
|
89
|
+
volatility_index_multiplier: Decimal | null;
|
|
90
|
+
block_timestamp: Decimal | null;
|
|
91
|
+
block_number: Decimal;
|
|
92
|
+
unique_id: bigint | null;
|
|
93
|
+
}[];
|
|
94
|
+
};
|
|
95
|
+
MarketsStorage: {
|
|
96
|
+
params: never;
|
|
97
|
+
query: never;
|
|
98
|
+
response: {
|
|
99
|
+
market_id: Decimal;
|
|
100
|
+
quote_collateral: string | null;
|
|
101
|
+
instrument_address: string | null;
|
|
102
|
+
name: string | null;
|
|
103
|
+
risk_block_id: Decimal | null;
|
|
104
|
+
collateral_pool_id: Decimal | null;
|
|
105
|
+
block_timestamp: Decimal | null;
|
|
106
|
+
block_number: Decimal;
|
|
107
|
+
unique_id: bigint | null;
|
|
108
|
+
}[];
|
|
109
|
+
};
|
|
110
|
+
MarketsTracker: {
|
|
111
|
+
params: never;
|
|
112
|
+
query: never;
|
|
113
|
+
response: {
|
|
114
|
+
market_data_id: Decimal;
|
|
115
|
+
passive_pool_id: Decimal | null;
|
|
116
|
+
pool_account_id: Decimal | null;
|
|
117
|
+
quote_token: string | null;
|
|
118
|
+
quote_token_decimals: Decimal | null;
|
|
119
|
+
last_funding_velocity: Decimal | null;
|
|
120
|
+
last_funding_timestamp: Decimal | null;
|
|
121
|
+
last_mtm_price: Decimal | null;
|
|
122
|
+
last_mtm_timestamp: Decimal | null;
|
|
123
|
+
long_trackers_funding_value: Decimal | null;
|
|
124
|
+
last_funding_rate: Decimal | null;
|
|
125
|
+
long_trackers_base_multiplier: Decimal | null;
|
|
126
|
+
long_trackers_adl_unwind_price: Decimal | null;
|
|
127
|
+
short_trackers_funding_value: Decimal | null;
|
|
128
|
+
short_trackers_base_multiplier: Decimal | null;
|
|
129
|
+
short_trackers_adl_unwind_price: Decimal | null;
|
|
130
|
+
open_interest: Decimal | null;
|
|
131
|
+
block_timestamp: Decimal | null;
|
|
132
|
+
block_number: Decimal;
|
|
133
|
+
unique_id: bigint | null;
|
|
134
|
+
}[];
|
|
135
|
+
};
|
|
136
|
+
Positions: {
|
|
137
|
+
params: {
|
|
138
|
+
address: string;
|
|
139
|
+
};
|
|
140
|
+
query: never;
|
|
141
|
+
response: {
|
|
142
|
+
market_id: Decimal;
|
|
143
|
+
account_id: Decimal;
|
|
144
|
+
base: Decimal | null;
|
|
145
|
+
realized_pnl: Decimal | null;
|
|
146
|
+
realized_pnl_latest_snapshot: Decimal | null;
|
|
147
|
+
average_entry_price_off_chain_tracker: Decimal | null;
|
|
148
|
+
funding_value_off_chain_tracker: Decimal | null;
|
|
149
|
+
last_price: Decimal | null;
|
|
150
|
+
position_data_last_price_data_timestamp: Decimal | null;
|
|
151
|
+
funding_value: Decimal | null;
|
|
152
|
+
base_multiplier: Decimal | null;
|
|
153
|
+
adl_unwind_price: Decimal | null;
|
|
154
|
+
transaction_hash: string;
|
|
155
|
+
block_timestamp: Decimal | null;
|
|
156
|
+
block_number: Decimal;
|
|
157
|
+
unique_id: bigint | null;
|
|
158
|
+
}[];
|
|
159
|
+
};
|
|
160
|
+
ConditionalOrders: {
|
|
161
|
+
params: {
|
|
162
|
+
address: string;
|
|
163
|
+
};
|
|
164
|
+
query: never;
|
|
165
|
+
response: {
|
|
166
|
+
id: string;
|
|
167
|
+
account_id: Decimal;
|
|
168
|
+
market_id: Decimal;
|
|
169
|
+
order_type: string;
|
|
170
|
+
is_long: boolean;
|
|
171
|
+
trigger_price: number;
|
|
172
|
+
order_base: Decimal;
|
|
173
|
+
exchange_id: bigint;
|
|
174
|
+
inputs: string;
|
|
175
|
+
counterparty_account_id: bigint;
|
|
176
|
+
reya_chain_id: bigint;
|
|
177
|
+
deadline: bigint;
|
|
178
|
+
signer_address: string;
|
|
179
|
+
nonce: Decimal;
|
|
180
|
+
signature: string;
|
|
181
|
+
status: string;
|
|
182
|
+
creation_timestamp_ms: bigint;
|
|
183
|
+
last_update_timestamp_ms: bigint;
|
|
184
|
+
transaction_hash: string | null;
|
|
185
|
+
}[];
|
|
186
|
+
};
|
|
187
|
+
Assets: {
|
|
188
|
+
params: never;
|
|
189
|
+
query: never;
|
|
190
|
+
response: {
|
|
191
|
+
address: string;
|
|
192
|
+
name: string;
|
|
193
|
+
short: string;
|
|
194
|
+
createdAt: Date;
|
|
195
|
+
updatedAt: Date;
|
|
196
|
+
asset_price_contract_id: string | null;
|
|
197
|
+
asset_price_usdc_contract_id: string | null;
|
|
198
|
+
decimals: number;
|
|
199
|
+
}[];
|
|
200
|
+
};
|
|
201
|
+
Prices: {
|
|
202
|
+
params: never;
|
|
203
|
+
query: never;
|
|
204
|
+
response: {
|
|
205
|
+
block_number: Decimal;
|
|
206
|
+
unique_id: bigint | null;
|
|
207
|
+
contract_id: string;
|
|
208
|
+
price: Decimal | null;
|
|
209
|
+
round_id: Decimal | null;
|
|
210
|
+
timestamp: Decimal;
|
|
211
|
+
}[];
|
|
212
|
+
};
|
|
213
|
+
Accounts: {
|
|
214
|
+
params: {
|
|
215
|
+
address: string;
|
|
216
|
+
};
|
|
217
|
+
query: never;
|
|
218
|
+
response: {
|
|
219
|
+
account_id: Decimal;
|
|
220
|
+
name: string;
|
|
221
|
+
status: AccountStatus;
|
|
222
|
+
updated_timestamp_ms: Decimal;
|
|
223
|
+
source: string | null;
|
|
224
|
+
}[];
|
|
225
|
+
};
|
|
226
|
+
AccountsBalances: {
|
|
227
|
+
params: {
|
|
228
|
+
address: string;
|
|
229
|
+
};
|
|
230
|
+
query: never;
|
|
231
|
+
response: {
|
|
232
|
+
account_id: number;
|
|
233
|
+
collateral: string;
|
|
234
|
+
balance: string;
|
|
235
|
+
}[];
|
|
236
|
+
};
|
|
237
|
+
AutoExchange: {
|
|
238
|
+
params: {
|
|
239
|
+
address: string;
|
|
240
|
+
};
|
|
241
|
+
query: PaginatedQueryParams;
|
|
242
|
+
response: {
|
|
243
|
+
data: {
|
|
244
|
+
id: string;
|
|
245
|
+
liquidated_account_id: Decimal | null;
|
|
246
|
+
liquidator_account_id: Decimal | null;
|
|
247
|
+
requested_quote_amount: Decimal | null;
|
|
248
|
+
collateral_out_address: string | null;
|
|
249
|
+
collateral_in_address: string | null;
|
|
250
|
+
collateral_amount_to_liquidator: Decimal | null;
|
|
251
|
+
quote_amount_to_insurance_fund: Decimal | null;
|
|
252
|
+
quote_amount_to_account: Decimal | null;
|
|
253
|
+
block_timestamp: Decimal | null;
|
|
254
|
+
block_number: Decimal;
|
|
255
|
+
transaction_hash: string;
|
|
256
|
+
unique_id: bigint | null;
|
|
257
|
+
}[];
|
|
258
|
+
meta: PaginatedQueryMeta;
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
Swaps: {
|
|
262
|
+
params: {
|
|
263
|
+
address: string;
|
|
264
|
+
};
|
|
265
|
+
query: PaginatedQueryParams;
|
|
266
|
+
response: {
|
|
267
|
+
data: {
|
|
268
|
+
id: string;
|
|
269
|
+
account_id: Decimal;
|
|
270
|
+
token_in: string;
|
|
271
|
+
token_out: string;
|
|
272
|
+
amount_in: Decimal;
|
|
273
|
+
amount_out: Decimal;
|
|
274
|
+
executed_amount_out: Decimal;
|
|
275
|
+
transaction_hash: string;
|
|
276
|
+
block_timestamp: Decimal;
|
|
277
|
+
block_number: Decimal;
|
|
278
|
+
unique_id: bigint | null;
|
|
279
|
+
}[];
|
|
280
|
+
meta: PaginatedQueryMeta;
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
MarketOrders: {
|
|
284
|
+
params: {
|
|
285
|
+
marketId: string;
|
|
286
|
+
type?: string;
|
|
287
|
+
};
|
|
288
|
+
query: PaginatedQueryParams;
|
|
289
|
+
response: {
|
|
290
|
+
data: Order[];
|
|
291
|
+
meta: PaginatedQueryMeta;
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
AccountOrders: {
|
|
295
|
+
params: {
|
|
296
|
+
accountId: string;
|
|
297
|
+
type?: string;
|
|
298
|
+
};
|
|
299
|
+
query: PaginatedQueryParams;
|
|
300
|
+
response: {
|
|
301
|
+
data: Order[];
|
|
302
|
+
meta: PaginatedQueryMeta;
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
WalletOrders: {
|
|
306
|
+
params: {
|
|
307
|
+
address: string;
|
|
308
|
+
type?: string;
|
|
309
|
+
};
|
|
310
|
+
query: PaginatedQueryParams;
|
|
311
|
+
response: {
|
|
312
|
+
data: Order[];
|
|
313
|
+
meta: PaginatedQueryMeta;
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
RiskMatrices: {
|
|
317
|
+
params: {
|
|
318
|
+
poolId: string;
|
|
319
|
+
};
|
|
320
|
+
query: never;
|
|
321
|
+
response: {
|
|
322
|
+
blockId: Decimal;
|
|
323
|
+
matrix: string[][];
|
|
324
|
+
}[];
|
|
325
|
+
};
|
|
326
|
+
Markets: {
|
|
327
|
+
params: never;
|
|
328
|
+
query: never;
|
|
329
|
+
response: {
|
|
330
|
+
id: Decimal;
|
|
331
|
+
ticker: string;
|
|
332
|
+
markPrice: number;
|
|
333
|
+
isActive: boolean;
|
|
334
|
+
maxLeverage: number;
|
|
335
|
+
volume24H: number;
|
|
336
|
+
priceChange24H: number;
|
|
337
|
+
longOI: number;
|
|
338
|
+
shortOI: number;
|
|
339
|
+
availableLong: number;
|
|
340
|
+
availableShort: number;
|
|
341
|
+
marketPriceDeviation: number;
|
|
342
|
+
riskBlockId: number;
|
|
343
|
+
rootCollateralPoolId: number;
|
|
344
|
+
description: string;
|
|
345
|
+
name: string;
|
|
346
|
+
quoteTokenId: string;
|
|
347
|
+
tickSizeDecimals: number;
|
|
348
|
+
underlyingAssetId: string;
|
|
349
|
+
priceChange24HPercentage: number;
|
|
350
|
+
openInterest: number;
|
|
351
|
+
fundingRate: number;
|
|
352
|
+
priority: number;
|
|
353
|
+
}[];
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
type Stringified<T> = T extends Decimal | bigint | Date
|
|
358
|
+
? string
|
|
359
|
+
: T extends (infer U)[]
|
|
360
|
+
? Stringified<U>[]
|
|
361
|
+
: { [K in keyof T]: Stringified<T[K]> };
|
|
362
|
+
|
|
363
|
+
export type Req<P = ParamsDictionary, ReqQuery = Query> = {
|
|
364
|
+
params: P;
|
|
365
|
+
query: ReqQuery;
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
/*
|
|
369
|
+
|
|
370
|
+
Same as infered type
|
|
371
|
+
|
|
372
|
+
export type TradingApi = {
|
|
373
|
+
[K in keyof typeof TradingQueries as K extends `get${infer R}` ? R : K]: {
|
|
374
|
+
params: Parameters<ReturnType<(typeof TradingQueries)[K]>>[0] extends Req
|
|
375
|
+
? Parameters<ReturnType<(typeof TradingQueries)[K]>>[0]['params']
|
|
376
|
+
: never;
|
|
377
|
+
query: Parameters<ReturnType<(typeof TradingQueries)[K]>>[0] extends Req
|
|
378
|
+
? Parameters<ReturnType<(typeof TradingQueries)[K]>>[0]['query']
|
|
379
|
+
: never;
|
|
380
|
+
response: Stringified<
|
|
381
|
+
Awaited<ReturnType<ReturnType<(typeof TradingQueries)[K]>>>
|
|
382
|
+
>;
|
|
383
|
+
|
|
384
|
+
*/
|
|
385
|
+
|
|
386
|
+
export type TradingApi = {
|
|
387
|
+
[K in keyof TradingApiSource as K]: {
|
|
388
|
+
params: TradingApiSource[K]['params'];
|
|
389
|
+
query: TradingApiSource[K]['query'];
|
|
390
|
+
response: Stringified<TradingApiSource[K]['response']>;
|
|
391
|
+
};
|
|
392
|
+
};
|