@burningflames/inj-exchange-sdk 0.0.0-stage → 0.1.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/LICENSE +202 -0
- package/NOTICE +7 -0
- package/README.md +198 -2
- package/dist/ApiManager-BcwRSg4p.cjs +14 -0
- package/dist/ApiManager-VsZ_7GMj.js +9 -0
- package/dist/MsgIncreasePositionMargin-7_g04vle.d.ts +2285 -0
- package/dist/MsgIncreasePositionMargin-UQn6vCje.d.cts +2284 -0
- package/dist/bank-c5iv-fbg.cjs +480 -0
- package/dist/bank-xWl_W05K.js +451 -0
- package/dist/chain-CgjV0b1c.js +5868 -0
- package/dist/chain-LTb0TjXc.cjs +5903 -0
- package/dist/clients/chain.cjs +8 -0
- package/dist/clients/chain.d.cts +2 -0
- package/dist/clients/chain.d.ts +2 -0
- package/dist/clients/chain.js +1 -0
- package/dist/clients/indexer.cjs +14 -0
- package/dist/clients/indexer.d.cts +2 -0
- package/dist/clients/indexer.d.ts +2 -0
- package/dist/clients/indexer.js +1 -0
- package/dist/coin-8_Vn0T8-.cjs +73 -0
- package/dist/coin-CowdNxVV.js +68 -0
- package/dist/decimal-CIFXn110.js +27 -0
- package/dist/decimal-DJMaLHQO.cjs +38 -0
- package/dist/eip712-88KVCEnw.d.cts +21 -0
- package/dist/eip712-88KVCEnw.d.ts +21 -0
- package/dist/errors-CKG7zTvs.cjs +36 -0
- package/dist/errors-MWG_E5zA.js +25 -0
- package/dist/exchange-BPRx-kFI.js +4637 -0
- package/dist/exchange-CTLbPuA7.cjs +4966 -0
- package/dist/index-B3bDzB4S.d.cts +2169 -0
- package/dist/index-BHLUinQA.d.ts +220 -0
- package/dist/index-BPpDV6JA.d.cts +182 -0
- package/dist/index-BT_zyZW9.d.cts +220 -0
- package/dist/index-DcQT-y4U.d.ts +2169 -0
- package/dist/index-DfoLUPEo.d.ts +183 -0
- package/dist/index.cjs +73 -0
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +13 -0
- package/dist/indexer-D7XfYsAZ.js +21699 -0
- package/dist/indexer-DI7-gHOA.cjs +21770 -0
- package/dist/msgs-Bi5b52-R.js +11359 -0
- package/dist/msgs-DNyc0UtV.cjs +11442 -0
- package/dist/msgs.cjs +16 -0
- package/dist/msgs.d.cts +2 -0
- package/dist/msgs.d.ts +2 -0
- package/dist/msgs.js +1 -0
- package/dist/query-DGTA8Lz_.js +13375 -0
- package/dist/query-L1m6tP9I.cjs +13530 -0
- package/dist/stream-BgKRWG60.d.cts +46 -0
- package/dist/stream-BgKRWG60.d.ts +46 -0
- package/dist/stream-D8ZvUQFy.cjs +29 -0
- package/dist/stream-RhVNTED5.js +18 -0
- package/dist/tendermint-CF_W9U6D.d.ts +49 -0
- package/dist/tendermint-zj8c-dVM.d.cts +49 -0
- package/dist/tx-BRaw1C6e.d.ts +66 -0
- package/dist/tx-BgpasOOk.cjs +464 -0
- package/dist/tx-CCt0zqng.d.cts +66 -0
- package/dist/tx-COcDYlg3.js +411 -0
- package/dist/tx-DIg8nbnn.cjs +1091 -0
- package/dist/tx-GN0SFql2.js +1026 -0
- package/dist/types.cjs +38 -0
- package/dist/types.d.cts +13 -0
- package/dist/types.d.ts +13 -0
- package/dist/types.js +26 -0
- package/dist/utils.cjs +131 -0
- package/dist/utils.d.cts +2 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +115 -0
- package/package.json +124 -4
|
@@ -0,0 +1,2169 @@
|
|
|
1
|
+
import { ChannelCredentials, ChannelOptions, ClientReadableStream } from "@grpc/grpc-js";
|
|
2
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
3
|
+
import { EventEmitter } from "eventemitter3";
|
|
4
|
+
import { r as StreamManagerRetryConfig, t as EventTypes } from "./stream-BgKRWG60.cjs";
|
|
5
|
+
interface OrderStatesRequest {
|
|
6
|
+
spotOrderHashes: string[];
|
|
7
|
+
derivativeOrderHashes: string[];
|
|
8
|
+
}
|
|
9
|
+
interface OrderStatesResponse {
|
|
10
|
+
/** List of the spot order state records */
|
|
11
|
+
spotOrderStates: OrderStateRecord[];
|
|
12
|
+
/** List of the derivative order state records */
|
|
13
|
+
derivativeOrderStates: OrderStateRecord[];
|
|
14
|
+
}
|
|
15
|
+
interface OrderStateRecord {
|
|
16
|
+
/** Hash of the order */
|
|
17
|
+
orderHash: string;
|
|
18
|
+
/** The subaccountId that this order belongs to */
|
|
19
|
+
subaccountId: string;
|
|
20
|
+
/** The Market ID of the order */
|
|
21
|
+
marketId: string;
|
|
22
|
+
/** The type of the order */
|
|
23
|
+
orderType: string;
|
|
24
|
+
/** The side of the order */
|
|
25
|
+
orderSide: string;
|
|
26
|
+
/** The state (status) of the order */
|
|
27
|
+
state: string;
|
|
28
|
+
/** The filled quantity of the order */
|
|
29
|
+
quantityFilled: string;
|
|
30
|
+
/** The filled quantity of the order */
|
|
31
|
+
quantityRemaining: string;
|
|
32
|
+
/** Order committed timestamp in UNIX millis. */
|
|
33
|
+
createdAt: number;
|
|
34
|
+
/** Order updated timestamp in UNIX millis. */
|
|
35
|
+
updatedAt: number;
|
|
36
|
+
/** Order prices */
|
|
37
|
+
price: string;
|
|
38
|
+
/** Margin for derivative order */
|
|
39
|
+
margin: string;
|
|
40
|
+
}
|
|
41
|
+
interface SubaccountsListResponse {
|
|
42
|
+
subaccounts: string[];
|
|
43
|
+
}
|
|
44
|
+
interface SubaccountBalancesListResponse {
|
|
45
|
+
/** List of subaccount balances */
|
|
46
|
+
balances: SubaccountBalance[];
|
|
47
|
+
}
|
|
48
|
+
interface SubaccountBalance {
|
|
49
|
+
/** Related subaccount ID */
|
|
50
|
+
subaccountId: string;
|
|
51
|
+
/** Account address, owner of this subaccount */
|
|
52
|
+
accountAddress: string;
|
|
53
|
+
/** Coin denom on the chain. */
|
|
54
|
+
denom: string;
|
|
55
|
+
deposit: SubaccountDeposit$1 | undefined;
|
|
56
|
+
}
|
|
57
|
+
interface SubaccountDeposit$1 {
|
|
58
|
+
totalBalance: string;
|
|
59
|
+
availableBalance: string;
|
|
60
|
+
totalBalanceUsd: string;
|
|
61
|
+
availableBalanceUsd: string;
|
|
62
|
+
}
|
|
63
|
+
interface SubaccountBalanceEndpointRequest {
|
|
64
|
+
/** SubaccountId of the trader we want to get the trades from */
|
|
65
|
+
subaccountId: string;
|
|
66
|
+
/** Specify denom to get balance */
|
|
67
|
+
denom: string;
|
|
68
|
+
}
|
|
69
|
+
interface SubaccountBalanceEndpointResponse {
|
|
70
|
+
/** Subaccount balance */
|
|
71
|
+
balance: SubaccountBalance | undefined;
|
|
72
|
+
}
|
|
73
|
+
interface StreamSubaccountBalanceRequest {
|
|
74
|
+
/** SubaccountId of the trader we want to get the trades from */
|
|
75
|
+
subaccountId: string;
|
|
76
|
+
/**
|
|
77
|
+
* Filter balances by denoms. If not set, the balances of all the denoms for
|
|
78
|
+
* the subaccount are provided.
|
|
79
|
+
*/
|
|
80
|
+
denoms: string[];
|
|
81
|
+
}
|
|
82
|
+
interface StreamSubaccountBalanceResponse {
|
|
83
|
+
/** Subaccount balance */
|
|
84
|
+
balance: SubaccountBalance | undefined;
|
|
85
|
+
/** Operation timestamp in UNIX millis. */
|
|
86
|
+
timestamp: number;
|
|
87
|
+
}
|
|
88
|
+
interface SubaccountHistoryRequest {
|
|
89
|
+
/** SubaccountId of the trader we want to get the history from */
|
|
90
|
+
subaccountId: string;
|
|
91
|
+
/** Filter history by denom */
|
|
92
|
+
denom: string;
|
|
93
|
+
/** Filter history by transfer type */
|
|
94
|
+
transferTypes: string[];
|
|
95
|
+
/** Skip will skip the first n item from the result */
|
|
96
|
+
skip: number;
|
|
97
|
+
/** Limit is used to specify the maximum number of items to be returned */
|
|
98
|
+
limit: number;
|
|
99
|
+
/** Upper bound of account transfer history's executedAt */
|
|
100
|
+
endTime: number;
|
|
101
|
+
}
|
|
102
|
+
interface SubaccountHistoryResponse {
|
|
103
|
+
/** List of subaccount transfers */
|
|
104
|
+
transfers: SubaccountBalanceTransfer[];
|
|
105
|
+
paging: Paging$2 | undefined;
|
|
106
|
+
}
|
|
107
|
+
interface SubaccountBalanceTransfer {
|
|
108
|
+
/** Type of the subaccount balance transfer */
|
|
109
|
+
transferType: string;
|
|
110
|
+
/** Subaccount ID of the sending side */
|
|
111
|
+
srcSubaccountId: string;
|
|
112
|
+
/** Account address of the sending side */
|
|
113
|
+
srcAccountAddress: string;
|
|
114
|
+
/** Subaccount ID of the receiving side */
|
|
115
|
+
dstSubaccountId: string;
|
|
116
|
+
/** Account address of the receiving side */
|
|
117
|
+
dstAccountAddress: string;
|
|
118
|
+
/** Coin amount of the transfer */
|
|
119
|
+
amount: CosmosCoin | undefined;
|
|
120
|
+
/** Timestamp of the transfer in UNIX millis */
|
|
121
|
+
executedAt: number;
|
|
122
|
+
}
|
|
123
|
+
interface CosmosCoin {
|
|
124
|
+
/** Coin denominator */
|
|
125
|
+
denom: string;
|
|
126
|
+
/** Coin amount (big int) */
|
|
127
|
+
amount: string;
|
|
128
|
+
}
|
|
129
|
+
/** Paging defines the structure for required params for handling pagination */
|
|
130
|
+
interface Paging$2 {
|
|
131
|
+
/** total number of txs saved in database */
|
|
132
|
+
total: number;
|
|
133
|
+
/** can be either block height or index num */
|
|
134
|
+
from: number;
|
|
135
|
+
/** can be either block height or index num */
|
|
136
|
+
to: number;
|
|
137
|
+
/** count entries by subaccount, serving some places on helix */
|
|
138
|
+
countBySubaccount: number;
|
|
139
|
+
/** array of tokens to navigate to the next pages */
|
|
140
|
+
next: string[];
|
|
141
|
+
}
|
|
142
|
+
interface SubaccountOrderSummaryRequest {
|
|
143
|
+
/** SubaccountId of the trader we want to get the summary from */
|
|
144
|
+
subaccountId: string;
|
|
145
|
+
/** MarketId is limiting order summary to specific market only */
|
|
146
|
+
marketId: string;
|
|
147
|
+
/** Filter by direction of the orders */
|
|
148
|
+
orderDirection: string;
|
|
149
|
+
}
|
|
150
|
+
interface SubaccountOrderSummaryResponse {
|
|
151
|
+
/** Total count of subaccount's spot orders in given market and direction */
|
|
152
|
+
spotOrdersTotal: number;
|
|
153
|
+
/** Total count of subaccount's derivative orders in given market and direction */
|
|
154
|
+
derivativeOrdersTotal: number;
|
|
155
|
+
}
|
|
156
|
+
declare const OrderStatesRequest: MessageFns$5<OrderStatesRequest>;
|
|
157
|
+
declare const OrderStatesResponse: MessageFns$5<OrderStatesResponse>;
|
|
158
|
+
declare const OrderStateRecord: MessageFns$5<OrderStateRecord>;
|
|
159
|
+
declare const SubaccountsListResponse: MessageFns$5<SubaccountsListResponse>;
|
|
160
|
+
declare const SubaccountBalancesListResponse: MessageFns$5<SubaccountBalancesListResponse>;
|
|
161
|
+
declare const SubaccountBalance: MessageFns$5<SubaccountBalance>;
|
|
162
|
+
declare const SubaccountDeposit$1: MessageFns$5<SubaccountDeposit$1>;
|
|
163
|
+
declare const SubaccountBalanceEndpointRequest: MessageFns$5<SubaccountBalanceEndpointRequest>;
|
|
164
|
+
declare const SubaccountBalanceEndpointResponse: MessageFns$5<SubaccountBalanceEndpointResponse>;
|
|
165
|
+
declare const StreamSubaccountBalanceRequest: MessageFns$5<StreamSubaccountBalanceRequest>;
|
|
166
|
+
declare const StreamSubaccountBalanceResponse: MessageFns$5<StreamSubaccountBalanceResponse>;
|
|
167
|
+
declare const SubaccountHistoryRequest: MessageFns$5<SubaccountHistoryRequest>;
|
|
168
|
+
declare const SubaccountHistoryResponse: MessageFns$5<SubaccountHistoryResponse>;
|
|
169
|
+
declare const SubaccountBalanceTransfer: MessageFns$5<SubaccountBalanceTransfer>;
|
|
170
|
+
declare const CosmosCoin: MessageFns$5<CosmosCoin>;
|
|
171
|
+
declare const Paging$2: MessageFns$5<Paging$2>;
|
|
172
|
+
declare const SubaccountOrderSummaryRequest: MessageFns$5<SubaccountOrderSummaryRequest>;
|
|
173
|
+
declare const SubaccountOrderSummaryResponse: MessageFns$5<SubaccountOrderSummaryResponse>;
|
|
174
|
+
type Builtin$5 = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
175
|
+
type DeepPartial$5<T> = T extends Builtin$5 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$5<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$5<U>> : T extends {} ? { [K in keyof T]?: DeepPartial$5<T[K]>; } : Partial<T>;
|
|
176
|
+
type KeysOfUnion$5<T> = T extends T ? keyof T : never;
|
|
177
|
+
type Exact$5<P, I> = P extends Builtin$5 ? P : P & { [K in keyof P as Extract<K, keyof I>]: Exact$5<P[K], I[K & keyof I]>; } & { [K in Exclude<keyof I, KeysOfUnion$5<P>>]: never; };
|
|
178
|
+
interface MessageFns$5<T> {
|
|
179
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
180
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
181
|
+
fromJSON(object: any): T;
|
|
182
|
+
toJSON(message: T): unknown;
|
|
183
|
+
create<I extends Exact$5<DeepPartial$5<T>, I>>(base?: I): T;
|
|
184
|
+
fromPartial<I extends Exact$5<DeepPartial$5<T>, I>>(object: I): T;
|
|
185
|
+
}
|
|
186
|
+
declare class IndexerAccountsApiClient {
|
|
187
|
+
private client;
|
|
188
|
+
constructor(address: string, serverCredentials?: ChannelCredentials, options?: ChannelOptions);
|
|
189
|
+
fetchOrderStates(params: Partial<OrderStatesRequest>): Promise<OrderStatesResponse>;
|
|
190
|
+
fetchSubaccountsList(accountAddress: string): Promise<SubaccountsListResponse["subaccounts"]>;
|
|
191
|
+
fetchSubaccountBalancesList(subaccountId: string): Promise<SubaccountBalancesListResponse["balances"]>;
|
|
192
|
+
fetchSubaccountBalance(params: SubaccountBalanceEndpointRequest): Promise<SubaccountBalanceEndpointResponse["balance"]>;
|
|
193
|
+
fetchSubaccountHistory(params: Partial<SubaccountHistoryRequest> & Pick<SubaccountHistoryRequest, "subaccountId">): Promise<SubaccountHistoryResponse>;
|
|
194
|
+
fetchSubaccountOrderSummary(params: Partial<SubaccountOrderSummaryRequest> & Pick<SubaccountOrderSummaryRequest, "subaccountId">): Promise<SubaccountOrderSummaryResponse>;
|
|
195
|
+
}
|
|
196
|
+
interface BalanceResponse {
|
|
197
|
+
historicalBalance: HistoricalBalance | undefined;
|
|
198
|
+
}
|
|
199
|
+
interface HistoricalBalance {
|
|
200
|
+
/** Time, Unix timestamp (UTC) */
|
|
201
|
+
t: number[];
|
|
202
|
+
/** Balance value */
|
|
203
|
+
v: number[];
|
|
204
|
+
/** Detailed Balance value */
|
|
205
|
+
dv: HistoricalDetailedBalance[];
|
|
206
|
+
}
|
|
207
|
+
interface HistoricalDetailedBalance {
|
|
208
|
+
/** Spot amount value */
|
|
209
|
+
spot: number;
|
|
210
|
+
/** Perpetual amount value */
|
|
211
|
+
perp: number;
|
|
212
|
+
/** Staking amount value */
|
|
213
|
+
staking: number;
|
|
214
|
+
}
|
|
215
|
+
interface AccountStatsResponse {
|
|
216
|
+
/** Account address */
|
|
217
|
+
account: string;
|
|
218
|
+
/** Realized profit and loss (USD) */
|
|
219
|
+
pnl: number;
|
|
220
|
+
/** Trade volume (USD) */
|
|
221
|
+
volume: number;
|
|
222
|
+
/** Staking amount (INJ) */
|
|
223
|
+
stake: string;
|
|
224
|
+
}
|
|
225
|
+
interface RpnlResponse {
|
|
226
|
+
historicalRpnl: HistoricalRPNL | undefined;
|
|
227
|
+
}
|
|
228
|
+
interface HistoricalRPNL {
|
|
229
|
+
/** Time, Unix timestamp (UTC) */
|
|
230
|
+
t: number[];
|
|
231
|
+
/** Realized Profit and Loss value */
|
|
232
|
+
v: number[];
|
|
233
|
+
/** Detailed Profit and Loss value */
|
|
234
|
+
dv: HistoricalDetailedPNL[];
|
|
235
|
+
}
|
|
236
|
+
interface HistoricalDetailedPNL {
|
|
237
|
+
/** Realized Profit and Loss value */
|
|
238
|
+
rpnl: number;
|
|
239
|
+
/** Unrealized Profit and Loss value */
|
|
240
|
+
upnl: number;
|
|
241
|
+
}
|
|
242
|
+
interface VolumesResponse {
|
|
243
|
+
historicalVolumes: HistoricalVolumes | undefined;
|
|
244
|
+
}
|
|
245
|
+
interface HistoricalVolumes {
|
|
246
|
+
/** Time, Unix timestamp (UTC) */
|
|
247
|
+
t: number[];
|
|
248
|
+
/** Volume value */
|
|
249
|
+
v: number[];
|
|
250
|
+
}
|
|
251
|
+
interface PnlLeaderboardResponse {
|
|
252
|
+
/** First date of snapshots used for the leaderboard period */
|
|
253
|
+
firstDate: string;
|
|
254
|
+
/** Last date of snapshots used for the leaderboard period */
|
|
255
|
+
lastDate: string;
|
|
256
|
+
/** Leaderboard entries */
|
|
257
|
+
leaders: LeaderboardRow[];
|
|
258
|
+
/** Leaderboard entry for the querying account */
|
|
259
|
+
accountRow: LeaderboardRow | undefined;
|
|
260
|
+
}
|
|
261
|
+
interface LeaderboardRow {
|
|
262
|
+
/** Account address */
|
|
263
|
+
account: string;
|
|
264
|
+
/** Realized profit and loss (USD) */
|
|
265
|
+
pnl: number;
|
|
266
|
+
/** Trade volume (USD) */
|
|
267
|
+
volume: number;
|
|
268
|
+
/** Rank in leaderboard */
|
|
269
|
+
rank: number;
|
|
270
|
+
}
|
|
271
|
+
interface VolLeaderboardResponse {
|
|
272
|
+
/** First date of snapshots used for the leaderboard period */
|
|
273
|
+
firstDate: string;
|
|
274
|
+
/** Last date of snapshots used for the leaderboard period */
|
|
275
|
+
lastDate: string;
|
|
276
|
+
/** Leaderboard entries */
|
|
277
|
+
leaders: LeaderboardRow[];
|
|
278
|
+
/** Leaderboard entry for the querying account */
|
|
279
|
+
accountRow: LeaderboardRow | undefined;
|
|
280
|
+
}
|
|
281
|
+
interface PnlLeaderboardFixedResolutionResponse {
|
|
282
|
+
/** First date of snapshots used for the leaderboard period */
|
|
283
|
+
firstDate: string;
|
|
284
|
+
/** Last date of snapshots used for the leaderboard period */
|
|
285
|
+
lastDate: string;
|
|
286
|
+
/** Leaderboard entries */
|
|
287
|
+
leaders: LeaderboardRow[];
|
|
288
|
+
/** Leaderboard entry for the querying account */
|
|
289
|
+
accountRow: LeaderboardRow | undefined;
|
|
290
|
+
}
|
|
291
|
+
interface VolLeaderboardFixedResolutionResponse {
|
|
292
|
+
/** First date of snapshots used for the leaderboard period */
|
|
293
|
+
firstDate: string;
|
|
294
|
+
/** Last date of snapshots used for the leaderboard period */
|
|
295
|
+
lastDate: string;
|
|
296
|
+
/** Leaderboard entries */
|
|
297
|
+
leaders: LeaderboardRow[];
|
|
298
|
+
/** Leaderboard entry for the querying account */
|
|
299
|
+
accountRow: LeaderboardRow | undefined;
|
|
300
|
+
}
|
|
301
|
+
interface DenomHoldersResponse {
|
|
302
|
+
holders: Holder[];
|
|
303
|
+
/** Next tokens for pagination */
|
|
304
|
+
next: string[];
|
|
305
|
+
/** Total number of holders */
|
|
306
|
+
total: number;
|
|
307
|
+
}
|
|
308
|
+
interface Holder {
|
|
309
|
+
/** Account address for the holder */
|
|
310
|
+
accountAddress: string;
|
|
311
|
+
/** The balance of the holder */
|
|
312
|
+
balance: string;
|
|
313
|
+
}
|
|
314
|
+
declare const BalanceResponse: MessageFns$4<BalanceResponse>;
|
|
315
|
+
declare const HistoricalBalance: MessageFns$4<HistoricalBalance>;
|
|
316
|
+
declare const HistoricalDetailedBalance: MessageFns$4<HistoricalDetailedBalance>;
|
|
317
|
+
declare const AccountStatsResponse: MessageFns$4<AccountStatsResponse>;
|
|
318
|
+
declare const RpnlResponse: MessageFns$4<RpnlResponse>;
|
|
319
|
+
declare const HistoricalRPNL: MessageFns$4<HistoricalRPNL>;
|
|
320
|
+
declare const HistoricalDetailedPNL: MessageFns$4<HistoricalDetailedPNL>;
|
|
321
|
+
declare const VolumesResponse: MessageFns$4<VolumesResponse>;
|
|
322
|
+
declare const HistoricalVolumes: MessageFns$4<HistoricalVolumes>;
|
|
323
|
+
declare const PnlLeaderboardResponse: MessageFns$4<PnlLeaderboardResponse>;
|
|
324
|
+
declare const LeaderboardRow: MessageFns$4<LeaderboardRow>;
|
|
325
|
+
declare const VolLeaderboardResponse: MessageFns$4<VolLeaderboardResponse>;
|
|
326
|
+
declare const PnlLeaderboardFixedResolutionResponse: MessageFns$4<PnlLeaderboardFixedResolutionResponse>;
|
|
327
|
+
declare const VolLeaderboardFixedResolutionResponse: MessageFns$4<VolLeaderboardFixedResolutionResponse>;
|
|
328
|
+
declare const DenomHoldersResponse: MessageFns$4<DenomHoldersResponse>;
|
|
329
|
+
declare const Holder: MessageFns$4<Holder>;
|
|
330
|
+
type Builtin$4 = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
331
|
+
type DeepPartial$4<T> = T extends Builtin$4 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$4<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$4<U>> : T extends {} ? { [K in keyof T]?: DeepPartial$4<T[K]>; } : Partial<T>;
|
|
332
|
+
type KeysOfUnion$4<T> = T extends T ? keyof T : never;
|
|
333
|
+
type Exact$4<P, I> = P extends Builtin$4 ? P : P & { [K in keyof P as Extract<K, keyof I>]: Exact$4<P[K], I[K & keyof I]>; } & { [K in Exclude<keyof I, KeysOfUnion$4<P>>]: never; };
|
|
334
|
+
interface MessageFns$4<T> {
|
|
335
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
336
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
337
|
+
fromJSON(object: any): T;
|
|
338
|
+
toJSON(message: T): unknown;
|
|
339
|
+
create<I extends Exact$4<DeepPartial$4<T>, I>>(base?: I): T;
|
|
340
|
+
fromPartial<I extends Exact$4<DeepPartial$4<T>, I>>(object: I): T;
|
|
341
|
+
}
|
|
342
|
+
declare class IndexerArchiverApiClient {
|
|
343
|
+
private client;
|
|
344
|
+
constructor(address: string, serverCredentials?: ChannelCredentials, options?: ChannelOptions);
|
|
345
|
+
fetchPnlLeaderboard(params: {
|
|
346
|
+
startDate: number;
|
|
347
|
+
endDate: number;
|
|
348
|
+
limit?: number;
|
|
349
|
+
account?: string;
|
|
350
|
+
}): Promise<PnlLeaderboardResponse>;
|
|
351
|
+
fetchVolLeaderboard(params: {
|
|
352
|
+
startDate: number;
|
|
353
|
+
endDate: number;
|
|
354
|
+
limit?: number;
|
|
355
|
+
account?: string;
|
|
356
|
+
}): Promise<VolLeaderboardResponse>;
|
|
357
|
+
fetchPnlLeaderboardFixedResolution(params: {
|
|
358
|
+
resolution: string;
|
|
359
|
+
limit?: number;
|
|
360
|
+
account?: string;
|
|
361
|
+
}): Promise<PnlLeaderboardFixedResolutionResponse>;
|
|
362
|
+
fetchVolLeaderboardFixedResolution(params: {
|
|
363
|
+
resolution: string;
|
|
364
|
+
limit?: number;
|
|
365
|
+
account?: string;
|
|
366
|
+
}): Promise<VolLeaderboardFixedResolutionResponse>;
|
|
367
|
+
fetchHistoricalBalance(params: {
|
|
368
|
+
account: string;
|
|
369
|
+
resolution: string;
|
|
370
|
+
}): Promise<BalanceResponse>;
|
|
371
|
+
fetchHistoricalRpnl(params: {
|
|
372
|
+
account: string;
|
|
373
|
+
resolution: string;
|
|
374
|
+
}): Promise<RpnlResponse>;
|
|
375
|
+
fetchHistoricalVolumes(params: {
|
|
376
|
+
account: string;
|
|
377
|
+
resolution: string;
|
|
378
|
+
}): Promise<VolumesResponse>;
|
|
379
|
+
fetchAccountStats(params: {
|
|
380
|
+
account: string;
|
|
381
|
+
period?: string;
|
|
382
|
+
}): Promise<AccountStatsResponse>;
|
|
383
|
+
fetchDenomHolders(params: {
|
|
384
|
+
denom: string;
|
|
385
|
+
token?: string;
|
|
386
|
+
limit?: number;
|
|
387
|
+
}): Promise<DenomHoldersResponse>;
|
|
388
|
+
}
|
|
389
|
+
interface MarketsRequest$1 {
|
|
390
|
+
/** Filter by market status */
|
|
391
|
+
marketStatus: string;
|
|
392
|
+
/** Filter by the Coin denomination of the quote currency */
|
|
393
|
+
quoteDenom: string;
|
|
394
|
+
marketStatuses: string[];
|
|
395
|
+
}
|
|
396
|
+
interface MarketsResponse$1 {
|
|
397
|
+
/** Derivative Markets list */
|
|
398
|
+
markets: DerivativeMarketInfo[];
|
|
399
|
+
}
|
|
400
|
+
interface DerivativeMarketInfo {
|
|
401
|
+
/**
|
|
402
|
+
* DerivativeMarket ID is crypto.Keccak256Hash([]byte((oracleType.String() +
|
|
403
|
+
* ticker + quoteDenom + oracleBase + oracleQuote))) for perpetual markets and
|
|
404
|
+
* crypto.Keccak256Hash([]byte((oracleType.String() + ticker + quoteDenom +
|
|
405
|
+
* oracleBase + oracleQuote + strconv.Itoa(int(expiry))))) for expiry futures
|
|
406
|
+
* markets
|
|
407
|
+
*/
|
|
408
|
+
marketId: string;
|
|
409
|
+
/** The status of the market */
|
|
410
|
+
marketStatus: string;
|
|
411
|
+
/**
|
|
412
|
+
* A name of the pair in format AAA/BBB, where AAA is base asset, BBB is quote
|
|
413
|
+
* asset.
|
|
414
|
+
*/
|
|
415
|
+
ticker: string;
|
|
416
|
+
/** Oracle base currency */
|
|
417
|
+
oracleBase: string;
|
|
418
|
+
/** Oracle quote currency */
|
|
419
|
+
oracleQuote: string;
|
|
420
|
+
/** Oracle Type */
|
|
421
|
+
oracleType: string;
|
|
422
|
+
/** OracleScaleFactor */
|
|
423
|
+
oracleScaleFactor: number;
|
|
424
|
+
/** Defines the initial margin ratio of a derivative market */
|
|
425
|
+
initialMarginRatio: string;
|
|
426
|
+
/** Defines the maintenance margin ratio of a derivative market */
|
|
427
|
+
maintenanceMarginRatio: string;
|
|
428
|
+
/** Coin denom used for the quote asset. */
|
|
429
|
+
quoteDenom: string;
|
|
430
|
+
/** Token metadata for quote asset */
|
|
431
|
+
quoteTokenMeta: TokenMeta$1 | undefined;
|
|
432
|
+
/** Defines the fee percentage makers pay when trading (in quote asset) */
|
|
433
|
+
makerFeeRate: string;
|
|
434
|
+
/** Defines the fee percentage takers pay when trading (in quote asset) */
|
|
435
|
+
takerFeeRate: string;
|
|
436
|
+
/** Percentage of the transaction fee shared with the service provider */
|
|
437
|
+
serviceProviderFee: string;
|
|
438
|
+
/** True if the market is a perpetual swap market */
|
|
439
|
+
isPerpetual: boolean;
|
|
440
|
+
/** Defines the minimum required tick size for the order's price */
|
|
441
|
+
minPriceTickSize: string;
|
|
442
|
+
/** Defines the minimum required tick size for the order's quantity */
|
|
443
|
+
minQuantityTickSize: string;
|
|
444
|
+
perpetualMarketInfo: PerpetualMarketInfo | undefined;
|
|
445
|
+
perpetualMarketFunding: PerpetualMarketFunding | undefined;
|
|
446
|
+
expiryFuturesMarketInfo: ExpiryFuturesMarketInfo | undefined;
|
|
447
|
+
/** Minimum notional value for the order */
|
|
448
|
+
minNotional: string;
|
|
449
|
+
/** Defines the reduce margin ratio of a derivative market */
|
|
450
|
+
reduceMarginRatio: string;
|
|
451
|
+
/** The open notional cap of the market, if any */
|
|
452
|
+
openNotionalCap: OpenNotionalCap | undefined;
|
|
453
|
+
}
|
|
454
|
+
interface TokenMeta$1 {
|
|
455
|
+
/** Token full name */
|
|
456
|
+
name: string;
|
|
457
|
+
/** Token contract address (native or not) */
|
|
458
|
+
address: string;
|
|
459
|
+
/** Token symbol short name */
|
|
460
|
+
symbol: string;
|
|
461
|
+
/** URL to the logo image */
|
|
462
|
+
logo: string;
|
|
463
|
+
/** Token decimals */
|
|
464
|
+
decimals: number;
|
|
465
|
+
/** Token metadata fetched timestamp in UNIX millis. */
|
|
466
|
+
updatedAt: number;
|
|
467
|
+
}
|
|
468
|
+
interface PerpetualMarketInfo {
|
|
469
|
+
/**
|
|
470
|
+
* Defines the default maximum absolute value of the hourly funding rate of the
|
|
471
|
+
* perpetual market.
|
|
472
|
+
*/
|
|
473
|
+
hourlyFundingRateCap: string;
|
|
474
|
+
/** Defines the hourly interest rate of the perpetual market. */
|
|
475
|
+
hourlyInterestRate: string;
|
|
476
|
+
/**
|
|
477
|
+
* Defines the next funding timestamp in seconds of a perpetual market in UNIX
|
|
478
|
+
* seconds.
|
|
479
|
+
*/
|
|
480
|
+
nextFundingTimestamp: number;
|
|
481
|
+
/** Defines the funding interval in seconds of a perpetual market in seconds. */
|
|
482
|
+
fundingInterval: number;
|
|
483
|
+
}
|
|
484
|
+
interface PerpetualMarketFunding {
|
|
485
|
+
/** Defines the cumulative funding of a perpetual market. */
|
|
486
|
+
cumulativeFunding: string;
|
|
487
|
+
/**
|
|
488
|
+
* Defines defines the cumulative price for the current hour up to the last
|
|
489
|
+
* timestamp.
|
|
490
|
+
*/
|
|
491
|
+
cumulativePrice: string;
|
|
492
|
+
/**
|
|
493
|
+
* Defines the last funding timestamp in seconds of a perpetual market in UNIX
|
|
494
|
+
* seconds.
|
|
495
|
+
*/
|
|
496
|
+
lastTimestamp: number;
|
|
497
|
+
/** Defines the last funding rate of a perpetual market. */
|
|
498
|
+
lastFundingRate: string;
|
|
499
|
+
}
|
|
500
|
+
interface ExpiryFuturesMarketInfo {
|
|
501
|
+
/** Defines the expiration time for a time expiry futures market in UNIX seconds. */
|
|
502
|
+
expirationTimestamp: number;
|
|
503
|
+
/** Defines the settlement price for a time expiry futures market. */
|
|
504
|
+
settlementPrice: string;
|
|
505
|
+
}
|
|
506
|
+
interface OpenNotionalCap {
|
|
507
|
+
/** The open notional cap of the market */
|
|
508
|
+
cap: string;
|
|
509
|
+
}
|
|
510
|
+
interface MarketResponse$1 {
|
|
511
|
+
/** Info about particular derivative market */
|
|
512
|
+
market: DerivativeMarketInfo | undefined;
|
|
513
|
+
}
|
|
514
|
+
interface StreamMarketRequest {
|
|
515
|
+
/**
|
|
516
|
+
* List of market IDs for updates streaming, empty means 'ALL' derivative
|
|
517
|
+
* markets
|
|
518
|
+
*/
|
|
519
|
+
marketIds: string[];
|
|
520
|
+
}
|
|
521
|
+
interface StreamMarketResponse {
|
|
522
|
+
/** Info about particular derivative market */
|
|
523
|
+
market: DerivativeMarketInfo | undefined;
|
|
524
|
+
/** Update type */
|
|
525
|
+
operationType: string;
|
|
526
|
+
/** Operation timestamp in UNIX millis. */
|
|
527
|
+
timestamp: number;
|
|
528
|
+
}
|
|
529
|
+
/** Paging defines the structure for required params for handling pagination */
|
|
530
|
+
interface Paging$1 {
|
|
531
|
+
/** total number of txs saved in database */
|
|
532
|
+
total: number;
|
|
533
|
+
/** can be either block height or index num */
|
|
534
|
+
from: number;
|
|
535
|
+
/** can be either block height or index num */
|
|
536
|
+
to: number;
|
|
537
|
+
/** count entries by subaccount, serving some places on helix */
|
|
538
|
+
countBySubaccount: number;
|
|
539
|
+
/** array of tokens to navigate to the next pages */
|
|
540
|
+
next: string[];
|
|
541
|
+
}
|
|
542
|
+
interface OrderbookV2Request$1 {
|
|
543
|
+
/** MarketId of the market's orderbook we want to fetch */
|
|
544
|
+
marketId: string;
|
|
545
|
+
/** Depth of the orderbook */
|
|
546
|
+
depth: number;
|
|
547
|
+
}
|
|
548
|
+
interface OrderbookV2Response$1 {
|
|
549
|
+
/** Orderbook of a particular derivative market */
|
|
550
|
+
orderbook: DerivativeLimitOrderbookV2 | undefined;
|
|
551
|
+
}
|
|
552
|
+
interface DerivativeLimitOrderbookV2 {
|
|
553
|
+
/** Array of price levels for buys */
|
|
554
|
+
buys: PriceLevel$1[];
|
|
555
|
+
/** Array of price levels for sells */
|
|
556
|
+
sells: PriceLevel$1[];
|
|
557
|
+
/** market orderbook sequence */
|
|
558
|
+
sequence: number;
|
|
559
|
+
/** Last update timestamp in UNIX millis. */
|
|
560
|
+
timestamp: number;
|
|
561
|
+
/** Block height at which the orderbook was last updated. */
|
|
562
|
+
height: number;
|
|
563
|
+
}
|
|
564
|
+
interface PriceLevel$1 {
|
|
565
|
+
/** Price number of the price level. */
|
|
566
|
+
price: string;
|
|
567
|
+
/** Quantity of the price level. */
|
|
568
|
+
quantity: string;
|
|
569
|
+
/** Price level last updated timestamp in UNIX millis. */
|
|
570
|
+
timestamp: number;
|
|
571
|
+
}
|
|
572
|
+
interface OrderbooksV2Request$1 {
|
|
573
|
+
/** MarketIds of the markets */
|
|
574
|
+
marketIds: string[];
|
|
575
|
+
/** Depth of the orderbook */
|
|
576
|
+
depth: number;
|
|
577
|
+
}
|
|
578
|
+
interface OrderbooksV2Response$1 {
|
|
579
|
+
orderbooks: SingleDerivativeLimitOrderbookV2[];
|
|
580
|
+
}
|
|
581
|
+
interface SingleDerivativeLimitOrderbookV2 {
|
|
582
|
+
/** market's ID */
|
|
583
|
+
marketId: string;
|
|
584
|
+
/** Orderbook of the market */
|
|
585
|
+
orderbook: DerivativeLimitOrderbookV2 | undefined;
|
|
586
|
+
}
|
|
587
|
+
interface StreamOrderbookV2Request$1 {
|
|
588
|
+
/**
|
|
589
|
+
* List of market IDs for orderbook streaming, empty means 'ALL' derivative
|
|
590
|
+
* markets
|
|
591
|
+
*/
|
|
592
|
+
marketIds: string[];
|
|
593
|
+
}
|
|
594
|
+
interface StreamOrderbookV2Response$1 {
|
|
595
|
+
/** Orderbook of a Derivative Market */
|
|
596
|
+
orderbook: DerivativeLimitOrderbookV2 | undefined;
|
|
597
|
+
/** Order update type */
|
|
598
|
+
operationType: string;
|
|
599
|
+
/** Operation timestamp in UNIX millis. */
|
|
600
|
+
timestamp: number;
|
|
601
|
+
/** MarketId of the market's orderbook */
|
|
602
|
+
marketId: string;
|
|
603
|
+
}
|
|
604
|
+
interface StreamOrderbookUpdateRequest$1 {
|
|
605
|
+
/**
|
|
606
|
+
* List of market IDs for orderbook streaming, empty means 'ALL' derivative
|
|
607
|
+
* markets
|
|
608
|
+
*/
|
|
609
|
+
marketIds: string[];
|
|
610
|
+
}
|
|
611
|
+
interface StreamOrderbookUpdateResponse$1 {
|
|
612
|
+
/** Orderbook level updates of a Derivative Market */
|
|
613
|
+
orderbookLevelUpdates: OrderbookLevelUpdates$1 | undefined;
|
|
614
|
+
/** Order update type */
|
|
615
|
+
operationType: string;
|
|
616
|
+
/** Operation timestamp in UNIX millis. */
|
|
617
|
+
timestamp: number;
|
|
618
|
+
/** MarketId of the market's orderbook */
|
|
619
|
+
marketId: string;
|
|
620
|
+
}
|
|
621
|
+
interface OrderbookLevelUpdates$1 {
|
|
622
|
+
/** market's ID */
|
|
623
|
+
marketId: string;
|
|
624
|
+
/** orderbook update sequence */
|
|
625
|
+
sequence: number;
|
|
626
|
+
/** buy levels */
|
|
627
|
+
buys: PriceLevelUpdate$1[];
|
|
628
|
+
/** sell levels */
|
|
629
|
+
sells: PriceLevelUpdate$1[];
|
|
630
|
+
/** updates timestamp */
|
|
631
|
+
updatedAt: number;
|
|
632
|
+
}
|
|
633
|
+
interface PriceLevelUpdate$1 {
|
|
634
|
+
/** Price number of the price level. */
|
|
635
|
+
price: string;
|
|
636
|
+
/** Quantity of the price level. */
|
|
637
|
+
quantity: string;
|
|
638
|
+
/** Price level status. */
|
|
639
|
+
isActive: boolean;
|
|
640
|
+
/** Price level last updated timestamp in UNIX millis. */
|
|
641
|
+
timestamp: number;
|
|
642
|
+
}
|
|
643
|
+
interface OrdersRequest$1 {
|
|
644
|
+
/**
|
|
645
|
+
* MarketId of market we want to fetch orders from. Using this field for one
|
|
646
|
+
* single marketId
|
|
647
|
+
*/
|
|
648
|
+
marketId: string;
|
|
649
|
+
/** Look for specific order side */
|
|
650
|
+
orderSide: string;
|
|
651
|
+
/** Look for specific subaccountId of an order */
|
|
652
|
+
subaccountId: string;
|
|
653
|
+
/** Skip will skip the first n item from the result */
|
|
654
|
+
skip: number;
|
|
655
|
+
/** Limit is used to specify the maximum number of items to be returned */
|
|
656
|
+
limit: number;
|
|
657
|
+
/**
|
|
658
|
+
* The starting timestamp in UNIX milliseconds that the trades must be equal or
|
|
659
|
+
* older than
|
|
660
|
+
*/
|
|
661
|
+
startTime: number;
|
|
662
|
+
/**
|
|
663
|
+
* The ending timestamp in UNIX milliseconds that the trades must be equal or
|
|
664
|
+
* younger than
|
|
665
|
+
*/
|
|
666
|
+
endTime: number;
|
|
667
|
+
/**
|
|
668
|
+
* MarketIds of the markets of which we want to get order from, use this field
|
|
669
|
+
* for fetching orders from multiple markets
|
|
670
|
+
*/
|
|
671
|
+
marketIds: string[];
|
|
672
|
+
/** Only search for conditional/non-conditional orders */
|
|
673
|
+
isConditional: string;
|
|
674
|
+
/** Search for specific order type */
|
|
675
|
+
orderType: string;
|
|
676
|
+
/** Should include inactive orders */
|
|
677
|
+
includeInactive: boolean;
|
|
678
|
+
/** Choose to return subaccount total orders */
|
|
679
|
+
subaccountTotalOrders: boolean;
|
|
680
|
+
/** TradeId of the order we want to fetch */
|
|
681
|
+
tradeId: string;
|
|
682
|
+
/** Client order ID */
|
|
683
|
+
cid: string;
|
|
684
|
+
}
|
|
685
|
+
interface OrdersResponse$1 {
|
|
686
|
+
orders: DerivativeLimitOrder[];
|
|
687
|
+
paging: Paging$1 | undefined;
|
|
688
|
+
}
|
|
689
|
+
interface DerivativeLimitOrder {
|
|
690
|
+
/** Hash of the order */
|
|
691
|
+
orderHash: string;
|
|
692
|
+
/** The side of the order */
|
|
693
|
+
orderSide: string;
|
|
694
|
+
/** Derivative Market ID */
|
|
695
|
+
marketId: string;
|
|
696
|
+
/** The subaccountId that this order belongs to */
|
|
697
|
+
subaccountId: string;
|
|
698
|
+
/** True if the order is a reduce-only order */
|
|
699
|
+
isReduceOnly: boolean;
|
|
700
|
+
/** Margin of the order */
|
|
701
|
+
margin: string;
|
|
702
|
+
/** Price of the order */
|
|
703
|
+
price: string;
|
|
704
|
+
/** Quantity of the order */
|
|
705
|
+
quantity: string;
|
|
706
|
+
/** The amount of the quantity remaining unfilled */
|
|
707
|
+
unfilledQuantity: string;
|
|
708
|
+
/** Trigger price is the trigger price used by stop/take orders */
|
|
709
|
+
triggerPrice: string;
|
|
710
|
+
/** Fee recipient address */
|
|
711
|
+
feeRecipient: string;
|
|
712
|
+
/** Order state */
|
|
713
|
+
state: string;
|
|
714
|
+
/** Order committed timestamp in UNIX millis. */
|
|
715
|
+
createdAt: number;
|
|
716
|
+
/** Order updated timestamp in UNIX millis. */
|
|
717
|
+
updatedAt: number;
|
|
718
|
+
/** Order number of subaccount */
|
|
719
|
+
orderNumber: number;
|
|
720
|
+
/** Order type */
|
|
721
|
+
orderType: string;
|
|
722
|
+
/** Order type */
|
|
723
|
+
isConditional: boolean;
|
|
724
|
+
/** Trigger timestamp, only exists for conditional orders */
|
|
725
|
+
triggerAt: number;
|
|
726
|
+
/** OrderHash of order that is triggered by this conditional order */
|
|
727
|
+
placedOrderHash: string;
|
|
728
|
+
/** Execution type of conditional order */
|
|
729
|
+
executionType: string;
|
|
730
|
+
/** Transaction Hash where order is created. Not all orders have this field */
|
|
731
|
+
txHash: string;
|
|
732
|
+
/** Custom client order ID */
|
|
733
|
+
cid: string;
|
|
734
|
+
/** Account address that owns the subaccount which placed this order */
|
|
735
|
+
accountAddress: string;
|
|
736
|
+
}
|
|
737
|
+
interface PositionsV2Request {
|
|
738
|
+
/** SubaccountId of the trader we want to get the positions from */
|
|
739
|
+
subaccountId: string;
|
|
740
|
+
/**
|
|
741
|
+
* MarketId of the position we want to fetch. Use this field for fetching from
|
|
742
|
+
* single market
|
|
743
|
+
*/
|
|
744
|
+
marketId: string;
|
|
745
|
+
/** Skip will skip the first n item from the result */
|
|
746
|
+
skip: number;
|
|
747
|
+
/** Limit is used to specify the maximum number of items to be returned */
|
|
748
|
+
limit: number;
|
|
749
|
+
/**
|
|
750
|
+
* The starting timestamp in UNIX milliseconds that the trades must be equal or
|
|
751
|
+
* older than
|
|
752
|
+
*/
|
|
753
|
+
startTime: number;
|
|
754
|
+
/**
|
|
755
|
+
* The ending timestamp in UNIX milliseconds that the trades must be equal or
|
|
756
|
+
* younger than
|
|
757
|
+
*/
|
|
758
|
+
endTime: number;
|
|
759
|
+
/**
|
|
760
|
+
* MarketIds of the markets we want to filter. Use this field for fetching from
|
|
761
|
+
* multiple markets
|
|
762
|
+
*/
|
|
763
|
+
marketIds: string[];
|
|
764
|
+
/** filter by direction of the position */
|
|
765
|
+
direction: string;
|
|
766
|
+
/** set to True to return subaccount total positions */
|
|
767
|
+
subaccountTotalPositions: boolean;
|
|
768
|
+
/** filter by account address */
|
|
769
|
+
accountAddress: string;
|
|
770
|
+
}
|
|
771
|
+
interface PositionsV2Response {
|
|
772
|
+
positions: DerivativePositionV2[];
|
|
773
|
+
paging: Paging$1 | undefined;
|
|
774
|
+
}
|
|
775
|
+
interface DerivativePositionV2 {
|
|
776
|
+
/** Ticker of the derivative market */
|
|
777
|
+
ticker: string;
|
|
778
|
+
/** Derivative Market ID */
|
|
779
|
+
marketId: string;
|
|
780
|
+
/** The subaccountId that the position belongs to */
|
|
781
|
+
subaccountId: string;
|
|
782
|
+
/** Direction of the position */
|
|
783
|
+
direction: string;
|
|
784
|
+
/** Quantity of the position */
|
|
785
|
+
quantity: string;
|
|
786
|
+
/** Price of the position */
|
|
787
|
+
entryPrice: string;
|
|
788
|
+
/** Margin of the position */
|
|
789
|
+
margin: string;
|
|
790
|
+
/** LiquidationPrice of the position */
|
|
791
|
+
liquidationPrice: string;
|
|
792
|
+
/** MarkPrice of the position */
|
|
793
|
+
markPrice: string;
|
|
794
|
+
/** Position updated timestamp in UNIX millis. */
|
|
795
|
+
updatedAt: number;
|
|
796
|
+
/** Market quote denom */
|
|
797
|
+
denom: string;
|
|
798
|
+
/** Last funding fees since position opened */
|
|
799
|
+
fundingLast: string;
|
|
800
|
+
/** Net funding fees since position opened */
|
|
801
|
+
fundingSum: string;
|
|
802
|
+
/** Cumulative funding entry of the position */
|
|
803
|
+
cumulativeFundingEntry: string;
|
|
804
|
+
/** Effective cumulative funding entry of the position */
|
|
805
|
+
effectiveCumulativeFundingEntry: string;
|
|
806
|
+
/**
|
|
807
|
+
* Unrealized profit and loss of the position (only present when requested with
|
|
808
|
+
* with_upnl=true)
|
|
809
|
+
*/
|
|
810
|
+
upnl: string;
|
|
811
|
+
}
|
|
812
|
+
interface FundingPaymentsRequest {
|
|
813
|
+
/** SubaccountId of the trader we want to get the positions from */
|
|
814
|
+
subaccountId: string;
|
|
815
|
+
/**
|
|
816
|
+
* MarketIds of the funding payment we want to fetch. Using this for only one
|
|
817
|
+
* market id. This field is prioritized
|
|
818
|
+
*/
|
|
819
|
+
marketId: string;
|
|
820
|
+
/** Skip will skip the first n item from the result */
|
|
821
|
+
skip: number;
|
|
822
|
+
/** Limit is used to specify the maximum number of items to be returned. */
|
|
823
|
+
limit: number;
|
|
824
|
+
/** Upper bound of funding payment updatedAt */
|
|
825
|
+
endTime: number;
|
|
826
|
+
/**
|
|
827
|
+
* Filter by market ids. Using this field for fetching funding payments from
|
|
828
|
+
* multiple market ids
|
|
829
|
+
*/
|
|
830
|
+
marketIds: string[];
|
|
831
|
+
}
|
|
832
|
+
interface FundingPaymentsResponse {
|
|
833
|
+
/** List of funding payments */
|
|
834
|
+
payments: FundingPayment[];
|
|
835
|
+
paging: Paging$1 | undefined;
|
|
836
|
+
}
|
|
837
|
+
interface FundingPayment {
|
|
838
|
+
/** Derivative Market ID */
|
|
839
|
+
marketId: string;
|
|
840
|
+
/** The subaccountId that the position belongs to */
|
|
841
|
+
subaccountId: string;
|
|
842
|
+
/** Amount of the funding payment */
|
|
843
|
+
amount: string;
|
|
844
|
+
/** Timestamp of funding payment in UNIX millis */
|
|
845
|
+
timestamp: number;
|
|
846
|
+
}
|
|
847
|
+
interface FundingRatesRequest {
|
|
848
|
+
/** MarketId of the position we want to fetch */
|
|
849
|
+
marketId: string;
|
|
850
|
+
/** Skip will skip the first n item from the result */
|
|
851
|
+
skip: number;
|
|
852
|
+
/** Limit is used to specify the maximum number of items to be returned. */
|
|
853
|
+
limit: number;
|
|
854
|
+
/** Upper bound of funding timestamp */
|
|
855
|
+
endTime: number;
|
|
856
|
+
}
|
|
857
|
+
interface FundingRatesResponse {
|
|
858
|
+
/** List of funding rates */
|
|
859
|
+
fundingRates: FundingRate[];
|
|
860
|
+
paging: Paging$1 | undefined;
|
|
861
|
+
}
|
|
862
|
+
interface FundingRate {
|
|
863
|
+
/** Derivative Market ID */
|
|
864
|
+
marketId: string;
|
|
865
|
+
/** Value of the funding rate */
|
|
866
|
+
rate: string;
|
|
867
|
+
/** Timestamp of funding rate in UNIX millis */
|
|
868
|
+
timestamp: number;
|
|
869
|
+
}
|
|
870
|
+
interface StreamPositionsV2Request {
|
|
871
|
+
/** SubaccountId of the trader we want to get the positions from */
|
|
872
|
+
subaccountId: string;
|
|
873
|
+
/** Backward compat single market ID of position we want to stream */
|
|
874
|
+
marketId: string;
|
|
875
|
+
/** List of market IDs of the positions we want to stream */
|
|
876
|
+
marketIds: string[];
|
|
877
|
+
/** Subaccount ids of traders we want to get positions */
|
|
878
|
+
subaccountIds: string[];
|
|
879
|
+
/** filter by account address */
|
|
880
|
+
accountAddress: string;
|
|
881
|
+
}
|
|
882
|
+
interface StreamPositionsV2Response {
|
|
883
|
+
/** Updated derivative Position */
|
|
884
|
+
position: DerivativePositionV2 | undefined;
|
|
885
|
+
/** Operation timestamp in UNIX millis. */
|
|
886
|
+
timestamp: number;
|
|
887
|
+
/** Position update type */
|
|
888
|
+
operationType: string;
|
|
889
|
+
}
|
|
890
|
+
interface StreamOrdersRequest$1 {
|
|
891
|
+
/**
|
|
892
|
+
* MarketId of market we want to fetch orders from. Using this field for one
|
|
893
|
+
* single marketId
|
|
894
|
+
*/
|
|
895
|
+
marketId: string;
|
|
896
|
+
/** Look for specific order side */
|
|
897
|
+
orderSide: string;
|
|
898
|
+
/** Look for specific subaccountId of an order */
|
|
899
|
+
subaccountId: string;
|
|
900
|
+
/** Skip will skip the first n item from the result */
|
|
901
|
+
skip: number;
|
|
902
|
+
/** Limit is used to specify the maximum number of items to be returned */
|
|
903
|
+
limit: number;
|
|
904
|
+
/**
|
|
905
|
+
* The starting timestamp in UNIX milliseconds that the trades must be equal or
|
|
906
|
+
* older than
|
|
907
|
+
*/
|
|
908
|
+
startTime: number;
|
|
909
|
+
/**
|
|
910
|
+
* The ending timestamp in UNIX milliseconds that the trades must be equal or
|
|
911
|
+
* younger than
|
|
912
|
+
*/
|
|
913
|
+
endTime: number;
|
|
914
|
+
/**
|
|
915
|
+
* MarketIds of the markets of which we want to get order from, use this field
|
|
916
|
+
* for fetching orders from multiple markets
|
|
917
|
+
*/
|
|
918
|
+
marketIds: string[];
|
|
919
|
+
/** Only search for conditional/non-conditional orders */
|
|
920
|
+
isConditional: string;
|
|
921
|
+
/** Search for specific order type */
|
|
922
|
+
orderType: string;
|
|
923
|
+
/** Should include inactive orders */
|
|
924
|
+
includeInactive: boolean;
|
|
925
|
+
/** Choose to return subaccount total orders */
|
|
926
|
+
subaccountTotalOrders: boolean;
|
|
927
|
+
/** TradeId of the order we want to fetch */
|
|
928
|
+
tradeId: string;
|
|
929
|
+
/** Client order ID */
|
|
930
|
+
cid: string;
|
|
931
|
+
}
|
|
932
|
+
interface StreamOrdersResponse$1 {
|
|
933
|
+
/** Updated market order */
|
|
934
|
+
order: DerivativeLimitOrder | undefined;
|
|
935
|
+
/** Order update type */
|
|
936
|
+
operationType: string;
|
|
937
|
+
/** Operation timestamp in UNIX millis. */
|
|
938
|
+
timestamp: number;
|
|
939
|
+
}
|
|
940
|
+
interface DerivativeTrade {
|
|
941
|
+
/** Order hash. */
|
|
942
|
+
orderHash: string;
|
|
943
|
+
/** The subaccountId that executed the trade */
|
|
944
|
+
subaccountId: string;
|
|
945
|
+
/** The ID of the market that this trade is in */
|
|
946
|
+
marketId: string;
|
|
947
|
+
/** The execution type of the trade */
|
|
948
|
+
tradeExecutionType: string;
|
|
949
|
+
/** True if the trade is a liquidation */
|
|
950
|
+
isLiquidation: boolean;
|
|
951
|
+
/** Position Delta from the trade */
|
|
952
|
+
positionDelta: PositionDelta | undefined;
|
|
953
|
+
/** The payout associated with the trade */
|
|
954
|
+
payout: string;
|
|
955
|
+
/** The fee associated with the trade */
|
|
956
|
+
fee: string;
|
|
957
|
+
/** Timestamp of trade execution in UNIX millis */
|
|
958
|
+
executedAt: number;
|
|
959
|
+
/** Fee recipient address */
|
|
960
|
+
feeRecipient: string;
|
|
961
|
+
/** A unique string that helps differentiate between trades */
|
|
962
|
+
tradeId: string;
|
|
963
|
+
/** Trade's execution side, maker,taker,n/a (n/a = not applicable) */
|
|
964
|
+
executionSide: string;
|
|
965
|
+
/** Custom client order ID */
|
|
966
|
+
cid: string;
|
|
967
|
+
/** Profit and loss of the trade */
|
|
968
|
+
pnl: string;
|
|
969
|
+
}
|
|
970
|
+
interface PositionDelta {
|
|
971
|
+
/** The direction the trade */
|
|
972
|
+
tradeDirection: string;
|
|
973
|
+
/** Execution Price of the trade. */
|
|
974
|
+
executionPrice: string;
|
|
975
|
+
/** Execution Quantity of the trade. */
|
|
976
|
+
executionQuantity: string;
|
|
977
|
+
/** Execution Margin of the trade. */
|
|
978
|
+
executionMargin: string;
|
|
979
|
+
}
|
|
980
|
+
interface TradesV2Request$1 {
|
|
981
|
+
/** MarketId of the market's orderbook we want to fetch */
|
|
982
|
+
marketId: string;
|
|
983
|
+
/** Filter by execution side of the trade */
|
|
984
|
+
executionSide: string;
|
|
985
|
+
/** Filter by direction the trade */
|
|
986
|
+
direction: string;
|
|
987
|
+
/** SubaccountId of the trader we want to get the trades from */
|
|
988
|
+
subaccountId: string;
|
|
989
|
+
/** Skip will skip the first n item from the result */
|
|
990
|
+
skip: number;
|
|
991
|
+
/** Limit is used to specify the maximum number of items to be returned. */
|
|
992
|
+
limit: number;
|
|
993
|
+
/**
|
|
994
|
+
* The starting timestamp in UNIX milliseconds that the trades must be equal or
|
|
995
|
+
* older than
|
|
996
|
+
*/
|
|
997
|
+
startTime: number;
|
|
998
|
+
/**
|
|
999
|
+
* The ending timestamp in UNIX milliseconds that the trades must be equal or
|
|
1000
|
+
* younger than
|
|
1001
|
+
*/
|
|
1002
|
+
endTime: number;
|
|
1003
|
+
/** MarketIds of the markets of which we want to get trades */
|
|
1004
|
+
marketIds: string[];
|
|
1005
|
+
/**
|
|
1006
|
+
* Subaccount ids of traders we want to get trades. Use this field for fetching
|
|
1007
|
+
* trades from multiple subaccounts
|
|
1008
|
+
*/
|
|
1009
|
+
subaccountIds: string[];
|
|
1010
|
+
executionTypes: string[];
|
|
1011
|
+
/** Filter by the tradeId of the trade */
|
|
1012
|
+
tradeId: string;
|
|
1013
|
+
/** Account address */
|
|
1014
|
+
accountAddress: string;
|
|
1015
|
+
/** Client order ID */
|
|
1016
|
+
cid: string;
|
|
1017
|
+
/** Filter by fee recipient */
|
|
1018
|
+
feeRecipient: string;
|
|
1019
|
+
}
|
|
1020
|
+
interface TradesV2Response$1 {
|
|
1021
|
+
/** Trades of a Derivative Market */
|
|
1022
|
+
trades: DerivativeTrade[];
|
|
1023
|
+
paging: Paging$1 | undefined;
|
|
1024
|
+
}
|
|
1025
|
+
interface StreamTradesV2Request$1 {
|
|
1026
|
+
/** MarketId of the market's orderbook we want to fetch */
|
|
1027
|
+
marketId: string;
|
|
1028
|
+
/** Filter by execution side of the trade */
|
|
1029
|
+
executionSide: string;
|
|
1030
|
+
/** Filter by direction the trade */
|
|
1031
|
+
direction: string;
|
|
1032
|
+
/** SubaccountId of the trader we want to get the trades from */
|
|
1033
|
+
subaccountId: string;
|
|
1034
|
+
/** Skip will skip the first n item from the result */
|
|
1035
|
+
skip: number;
|
|
1036
|
+
/** Limit is used to specify the maximum number of items to be returned. */
|
|
1037
|
+
limit: number;
|
|
1038
|
+
/**
|
|
1039
|
+
* The starting timestamp in UNIX milliseconds that the trades must be equal or
|
|
1040
|
+
* older than
|
|
1041
|
+
*/
|
|
1042
|
+
startTime: number;
|
|
1043
|
+
/**
|
|
1044
|
+
* The ending timestamp in UNIX milliseconds that the trades must be equal or
|
|
1045
|
+
* younger than
|
|
1046
|
+
*/
|
|
1047
|
+
endTime: number;
|
|
1048
|
+
/** MarketIds of the markets of which we want to get trades */
|
|
1049
|
+
marketIds: string[];
|
|
1050
|
+
/**
|
|
1051
|
+
* Subaccount ids of traders we want to get trades. Use this field for fetching
|
|
1052
|
+
* trades from multiple subaccounts
|
|
1053
|
+
*/
|
|
1054
|
+
subaccountIds: string[];
|
|
1055
|
+
executionTypes: string[];
|
|
1056
|
+
/** Filter by the tradeId of the trade */
|
|
1057
|
+
tradeId: string;
|
|
1058
|
+
/** Account address */
|
|
1059
|
+
accountAddress: string;
|
|
1060
|
+
/** Client order ID */
|
|
1061
|
+
cid: string;
|
|
1062
|
+
/** Filter by fee recipient */
|
|
1063
|
+
feeRecipient: string;
|
|
1064
|
+
}
|
|
1065
|
+
interface StreamTradesV2Response$1 {
|
|
1066
|
+
/** New derivative market trade */
|
|
1067
|
+
trade: DerivativeTrade | undefined;
|
|
1068
|
+
/** Executed trades update type */
|
|
1069
|
+
operationType: string;
|
|
1070
|
+
/** Operation timestamp in UNIX millis. */
|
|
1071
|
+
timestamp: number;
|
|
1072
|
+
}
|
|
1073
|
+
interface SubaccountOrdersListRequest$1 {
|
|
1074
|
+
/** subaccount ID to filter orders for specific subaccount */
|
|
1075
|
+
subaccountId: string;
|
|
1076
|
+
/** Market ID to filter orders for specific market */
|
|
1077
|
+
marketId: string;
|
|
1078
|
+
/** Skip will skip the first n item from the result */
|
|
1079
|
+
skip: number;
|
|
1080
|
+
/** Limit is used to specify the maximum number of items to be returned */
|
|
1081
|
+
limit: number;
|
|
1082
|
+
}
|
|
1083
|
+
interface SubaccountOrdersListResponse$1 {
|
|
1084
|
+
/** List of derivative orders */
|
|
1085
|
+
orders: DerivativeLimitOrder[];
|
|
1086
|
+
paging: Paging$1 | undefined;
|
|
1087
|
+
}
|
|
1088
|
+
interface SubaccountTradesListRequest$1 {
|
|
1089
|
+
/** SubaccountId of the trader we want to get the trades from */
|
|
1090
|
+
subaccountId: string;
|
|
1091
|
+
/** Filter trades by market ID */
|
|
1092
|
+
marketId: string;
|
|
1093
|
+
/** Filter by execution type of trades */
|
|
1094
|
+
executionType: string;
|
|
1095
|
+
/** Filter by direction trades */
|
|
1096
|
+
direction: string;
|
|
1097
|
+
/** Skip will skip the first n item from the result */
|
|
1098
|
+
skip: number;
|
|
1099
|
+
/** Limit is used to specify the maximum number of items to be returned */
|
|
1100
|
+
limit: number;
|
|
1101
|
+
}
|
|
1102
|
+
interface SubaccountTradesListResponse$1 {
|
|
1103
|
+
/** List of derivative market trades */
|
|
1104
|
+
trades: DerivativeTrade[];
|
|
1105
|
+
}
|
|
1106
|
+
interface OrdersHistoryRequest$1 {
|
|
1107
|
+
/** subaccount ID to filter orders for specific subaccount */
|
|
1108
|
+
subaccountId: string;
|
|
1109
|
+
/** Market ID to filter orders for specific market */
|
|
1110
|
+
marketId: string;
|
|
1111
|
+
/** Skip will skip the first n item from the result */
|
|
1112
|
+
skip: number;
|
|
1113
|
+
/** Limit is used to specify the maximum number of items to be returned */
|
|
1114
|
+
limit: number;
|
|
1115
|
+
/** filter by order types */
|
|
1116
|
+
orderTypes: string[];
|
|
1117
|
+
/** order side filter */
|
|
1118
|
+
direction: string;
|
|
1119
|
+
/** Search for orders which createdAt >= startTime, time in millisecond */
|
|
1120
|
+
startTime: number;
|
|
1121
|
+
/** Search for orders which createdAt <= endTime, time in millisecond */
|
|
1122
|
+
endTime: number;
|
|
1123
|
+
/** Only search for conditional/non-conditional orders */
|
|
1124
|
+
isConditional: string;
|
|
1125
|
+
/** filter by order type */
|
|
1126
|
+
orderType: string;
|
|
1127
|
+
/** Filter by order state */
|
|
1128
|
+
state: string;
|
|
1129
|
+
executionTypes: string[];
|
|
1130
|
+
marketIds: string[];
|
|
1131
|
+
/** TradeId of the order we want to fetch */
|
|
1132
|
+
tradeId: string;
|
|
1133
|
+
/** Return only orders for active markets */
|
|
1134
|
+
activeMarketsOnly: boolean;
|
|
1135
|
+
/** Client order ID */
|
|
1136
|
+
cid: string;
|
|
1137
|
+
}
|
|
1138
|
+
interface OrdersHistoryResponse$1 {
|
|
1139
|
+
/** List of historical derivative orders */
|
|
1140
|
+
orders: DerivativeOrderHistory[];
|
|
1141
|
+
paging: Paging$1 | undefined;
|
|
1142
|
+
}
|
|
1143
|
+
interface DerivativeOrderHistory {
|
|
1144
|
+
/** Hash of the order */
|
|
1145
|
+
orderHash: string;
|
|
1146
|
+
/** Spot Market ID is keccak265(baseDenom + quoteDenom) */
|
|
1147
|
+
marketId: string;
|
|
1148
|
+
/** active state of the order */
|
|
1149
|
+
isActive: boolean;
|
|
1150
|
+
/** The subaccountId that this order belongs to */
|
|
1151
|
+
subaccountId: string;
|
|
1152
|
+
/** The execution type */
|
|
1153
|
+
executionType: string;
|
|
1154
|
+
/** The side of the order */
|
|
1155
|
+
orderType: string;
|
|
1156
|
+
/** Price of the order */
|
|
1157
|
+
price: string;
|
|
1158
|
+
/** Trigger price */
|
|
1159
|
+
triggerPrice: string;
|
|
1160
|
+
/** Quantity of the order */
|
|
1161
|
+
quantity: string;
|
|
1162
|
+
/** Filled amount */
|
|
1163
|
+
filledQuantity: string;
|
|
1164
|
+
/** Order state */
|
|
1165
|
+
state: string;
|
|
1166
|
+
/** Order committed timestamp in UNIX millis. */
|
|
1167
|
+
createdAt: number;
|
|
1168
|
+
/** Order updated timestamp in UNIX millis. */
|
|
1169
|
+
updatedAt: number;
|
|
1170
|
+
/** True if an order is reduce only */
|
|
1171
|
+
isReduceOnly: boolean;
|
|
1172
|
+
/** Order direction (order side) */
|
|
1173
|
+
direction: string;
|
|
1174
|
+
/** True if this is conditional order, otherwise false */
|
|
1175
|
+
isConditional: boolean;
|
|
1176
|
+
/** Trigger timestamp in unix milli */
|
|
1177
|
+
triggerAt: number;
|
|
1178
|
+
/** Order hash placed when this triggers */
|
|
1179
|
+
placedOrderHash: string;
|
|
1180
|
+
/** Order's margin */
|
|
1181
|
+
margin: string;
|
|
1182
|
+
/** Transaction Hash where order is created. Not all orders have this field */
|
|
1183
|
+
txHash: string;
|
|
1184
|
+
/** Custom client order ID */
|
|
1185
|
+
cid: string;
|
|
1186
|
+
}
|
|
1187
|
+
interface StreamOrdersHistoryRequest$1 {
|
|
1188
|
+
/** subaccount ID to filter orders for specific subaccount */
|
|
1189
|
+
subaccountId: string;
|
|
1190
|
+
/** Market ID to filter orders for specific market */
|
|
1191
|
+
marketId: string;
|
|
1192
|
+
/** filter by order types */
|
|
1193
|
+
orderTypes: string[];
|
|
1194
|
+
/** order side filter */
|
|
1195
|
+
direction: string;
|
|
1196
|
+
/** Filter by order state */
|
|
1197
|
+
state: string;
|
|
1198
|
+
executionTypes: string[];
|
|
1199
|
+
}
|
|
1200
|
+
interface StreamOrdersHistoryResponse$1 {
|
|
1201
|
+
/** Updated order */
|
|
1202
|
+
order: DerivativeOrderHistory | undefined;
|
|
1203
|
+
/** Order update type */
|
|
1204
|
+
operationType: string;
|
|
1205
|
+
/** Operation timestamp in UNIX millis. */
|
|
1206
|
+
timestamp: number;
|
|
1207
|
+
}
|
|
1208
|
+
declare const MarketsRequest$1: MessageFns$3<MarketsRequest$1>;
|
|
1209
|
+
declare const MarketsResponse$1: MessageFns$3<MarketsResponse$1>;
|
|
1210
|
+
declare const DerivativeMarketInfo: MessageFns$3<DerivativeMarketInfo>;
|
|
1211
|
+
declare const TokenMeta$1: MessageFns$3<TokenMeta$1>;
|
|
1212
|
+
declare const PerpetualMarketInfo: MessageFns$3<PerpetualMarketInfo>;
|
|
1213
|
+
declare const PerpetualMarketFunding: MessageFns$3<PerpetualMarketFunding>;
|
|
1214
|
+
declare const ExpiryFuturesMarketInfo: MessageFns$3<ExpiryFuturesMarketInfo>;
|
|
1215
|
+
declare const OpenNotionalCap: MessageFns$3<OpenNotionalCap>;
|
|
1216
|
+
declare const MarketResponse$1: MessageFns$3<MarketResponse$1>;
|
|
1217
|
+
declare const StreamMarketRequest: MessageFns$3<StreamMarketRequest>;
|
|
1218
|
+
declare const StreamMarketResponse: MessageFns$3<StreamMarketResponse>;
|
|
1219
|
+
declare const Paging$1: MessageFns$3<Paging$1>;
|
|
1220
|
+
declare const OrderbookV2Request$1: MessageFns$3<OrderbookV2Request$1>;
|
|
1221
|
+
declare const OrderbookV2Response$1: MessageFns$3<OrderbookV2Response$1>;
|
|
1222
|
+
declare const DerivativeLimitOrderbookV2: MessageFns$3<DerivativeLimitOrderbookV2>;
|
|
1223
|
+
declare const PriceLevel$1: MessageFns$3<PriceLevel$1>;
|
|
1224
|
+
declare const OrderbooksV2Request$1: MessageFns$3<OrderbooksV2Request$1>;
|
|
1225
|
+
declare const OrderbooksV2Response$1: MessageFns$3<OrderbooksV2Response$1>;
|
|
1226
|
+
declare const SingleDerivativeLimitOrderbookV2: MessageFns$3<SingleDerivativeLimitOrderbookV2>;
|
|
1227
|
+
declare const StreamOrderbookV2Request$1: MessageFns$3<StreamOrderbookV2Request$1>;
|
|
1228
|
+
declare const StreamOrderbookV2Response$1: MessageFns$3<StreamOrderbookV2Response$1>;
|
|
1229
|
+
declare const StreamOrderbookUpdateRequest$1: MessageFns$3<StreamOrderbookUpdateRequest$1>;
|
|
1230
|
+
declare const StreamOrderbookUpdateResponse$1: MessageFns$3<StreamOrderbookUpdateResponse$1>;
|
|
1231
|
+
declare const OrderbookLevelUpdates$1: MessageFns$3<OrderbookLevelUpdates$1>;
|
|
1232
|
+
declare const PriceLevelUpdate$1: MessageFns$3<PriceLevelUpdate$1>;
|
|
1233
|
+
declare const OrdersRequest$1: MessageFns$3<OrdersRequest$1>;
|
|
1234
|
+
declare const OrdersResponse$1: MessageFns$3<OrdersResponse$1>;
|
|
1235
|
+
declare const DerivativeLimitOrder: MessageFns$3<DerivativeLimitOrder>;
|
|
1236
|
+
declare const PositionsV2Request: MessageFns$3<PositionsV2Request>;
|
|
1237
|
+
declare const PositionsV2Response: MessageFns$3<PositionsV2Response>;
|
|
1238
|
+
declare const DerivativePositionV2: MessageFns$3<DerivativePositionV2>;
|
|
1239
|
+
declare const FundingPaymentsRequest: MessageFns$3<FundingPaymentsRequest>;
|
|
1240
|
+
declare const FundingPaymentsResponse: MessageFns$3<FundingPaymentsResponse>;
|
|
1241
|
+
declare const FundingPayment: MessageFns$3<FundingPayment>;
|
|
1242
|
+
declare const FundingRatesRequest: MessageFns$3<FundingRatesRequest>;
|
|
1243
|
+
declare const FundingRatesResponse: MessageFns$3<FundingRatesResponse>;
|
|
1244
|
+
declare const FundingRate: MessageFns$3<FundingRate>;
|
|
1245
|
+
declare const StreamPositionsV2Request: MessageFns$3<StreamPositionsV2Request>;
|
|
1246
|
+
declare const StreamPositionsV2Response: MessageFns$3<StreamPositionsV2Response>;
|
|
1247
|
+
declare const StreamOrdersRequest$1: MessageFns$3<StreamOrdersRequest$1>;
|
|
1248
|
+
declare const StreamOrdersResponse$1: MessageFns$3<StreamOrdersResponse$1>;
|
|
1249
|
+
declare const DerivativeTrade: MessageFns$3<DerivativeTrade>;
|
|
1250
|
+
declare const PositionDelta: MessageFns$3<PositionDelta>;
|
|
1251
|
+
declare const TradesV2Request$1: MessageFns$3<TradesV2Request$1>;
|
|
1252
|
+
declare const TradesV2Response$1: MessageFns$3<TradesV2Response$1>;
|
|
1253
|
+
declare const StreamTradesV2Request$1: MessageFns$3<StreamTradesV2Request$1>;
|
|
1254
|
+
declare const StreamTradesV2Response$1: MessageFns$3<StreamTradesV2Response$1>;
|
|
1255
|
+
declare const SubaccountOrdersListRequest$1: MessageFns$3<SubaccountOrdersListRequest$1>;
|
|
1256
|
+
declare const SubaccountOrdersListResponse$1: MessageFns$3<SubaccountOrdersListResponse$1>;
|
|
1257
|
+
declare const SubaccountTradesListRequest$1: MessageFns$3<SubaccountTradesListRequest$1>;
|
|
1258
|
+
declare const SubaccountTradesListResponse$1: MessageFns$3<SubaccountTradesListResponse$1>;
|
|
1259
|
+
declare const OrdersHistoryRequest$1: MessageFns$3<OrdersHistoryRequest$1>;
|
|
1260
|
+
declare const OrdersHistoryResponse$1: MessageFns$3<OrdersHistoryResponse$1>;
|
|
1261
|
+
declare const DerivativeOrderHistory: MessageFns$3<DerivativeOrderHistory>;
|
|
1262
|
+
declare const StreamOrdersHistoryRequest$1: MessageFns$3<StreamOrdersHistoryRequest$1>;
|
|
1263
|
+
declare const StreamOrdersHistoryResponse$1: MessageFns$3<StreamOrdersHistoryResponse$1>;
|
|
1264
|
+
type Builtin$3 = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
1265
|
+
type DeepPartial$3<T> = T extends Builtin$3 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$3<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$3<U>> : T extends {} ? { [K in keyof T]?: DeepPartial$3<T[K]>; } : Partial<T>;
|
|
1266
|
+
type KeysOfUnion$3<T> = T extends T ? keyof T : never;
|
|
1267
|
+
type Exact$3<P, I> = P extends Builtin$3 ? P : P & { [K in keyof P as Extract<K, keyof I>]: Exact$3<P[K], I[K & keyof I]>; } & { [K in Exclude<keyof I, KeysOfUnion$3<P>>]: never; };
|
|
1268
|
+
interface MessageFns$3<T> {
|
|
1269
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
1270
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
1271
|
+
fromJSON(object: any): T;
|
|
1272
|
+
toJSON(message: T): unknown;
|
|
1273
|
+
create<I extends Exact$3<DeepPartial$3<T>, I>>(base?: I): T;
|
|
1274
|
+
fromPartial<I extends Exact$3<DeepPartial$3<T>, I>>(object: I): T;
|
|
1275
|
+
}
|
|
1276
|
+
declare class IndexerDerivativesApiClient {
|
|
1277
|
+
private client;
|
|
1278
|
+
constructor(address: string, serverCredentials?: ChannelCredentials, options?: ChannelOptions);
|
|
1279
|
+
fetchMarkets(params?: Partial<MarketsRequest$1>): Promise<MarketsResponse$1["markets"]>;
|
|
1280
|
+
fetchMarket(marketId: string): Promise<MarketResponse$1["market"]>;
|
|
1281
|
+
fetchOrderbookV2(params: Partial<OrderbookV2Request$1> & Pick<OrderbookV2Request$1, "marketId">): Promise<OrderbookV2Response$1["orderbook"]>;
|
|
1282
|
+
fetchOrderbooksV2(params: Partial<OrderbooksV2Request$1> & Pick<OrderbooksV2Request$1, "marketIds">): Promise<OrderbooksV2Response$1["orderbooks"]>;
|
|
1283
|
+
fetchOrders(params?: Partial<OrdersRequest$1>): Promise<OrdersResponse$1>;
|
|
1284
|
+
fetchPositionsV2(params?: Partial<PositionsV2Request>): Promise<PositionsV2Response>;
|
|
1285
|
+
fetchFundingPayments(params?: Partial<FundingPaymentsRequest>): Promise<FundingPaymentsResponse>;
|
|
1286
|
+
fetchFundingRates(params?: Partial<FundingRatesRequest>): Promise<FundingRatesResponse>;
|
|
1287
|
+
fetchTradesV2(params?: Partial<TradesV2Request$1>): Promise<TradesV2Response$1>;
|
|
1288
|
+
fetchSubaccountOrdersList(params: Partial<SubaccountOrdersListRequest$1> & Pick<SubaccountOrdersListRequest$1, "subaccountId">): Promise<SubaccountOrdersListResponse$1>;
|
|
1289
|
+
fetchSubaccountTradesList(params: Partial<SubaccountTradesListRequest$1> & Pick<SubaccountTradesListRequest$1, "subaccountId">): Promise<SubaccountTradesListResponse$1>;
|
|
1290
|
+
fetchOrdersHistory(params?: Partial<OrdersHistoryRequest$1>): Promise<OrdersHistoryResponse$1>;
|
|
1291
|
+
}
|
|
1292
|
+
interface OracleListRequest {
|
|
1293
|
+
/** Filter by oracle symbol */
|
|
1294
|
+
symbol: string;
|
|
1295
|
+
/** Filter by oracle type */
|
|
1296
|
+
oracleType: string;
|
|
1297
|
+
/** Number of results per page */
|
|
1298
|
+
perPage: number;
|
|
1299
|
+
/** Pagination token from previous response */
|
|
1300
|
+
token: string;
|
|
1301
|
+
}
|
|
1302
|
+
interface OracleListResponse {
|
|
1303
|
+
/** List of oracles */
|
|
1304
|
+
oracles: Oracle[];
|
|
1305
|
+
/** Next tokens for pagination */
|
|
1306
|
+
next: string[];
|
|
1307
|
+
}
|
|
1308
|
+
interface Oracle {
|
|
1309
|
+
/** The symbol of the oracle asset. */
|
|
1310
|
+
symbol: string;
|
|
1311
|
+
/** Oracle base currency */
|
|
1312
|
+
baseSymbol: string;
|
|
1313
|
+
/** Oracle quote currency */
|
|
1314
|
+
quoteSymbol: string;
|
|
1315
|
+
/** Oracle Type */
|
|
1316
|
+
oracleType: string;
|
|
1317
|
+
/** The price of the oracle asset */
|
|
1318
|
+
price: string;
|
|
1319
|
+
}
|
|
1320
|
+
interface PricePayloadV2 {
|
|
1321
|
+
/** Oracle base currency */
|
|
1322
|
+
baseSymbol: string;
|
|
1323
|
+
/** Oracle quote currency */
|
|
1324
|
+
quoteSymbol: string;
|
|
1325
|
+
/** Oracle Type */
|
|
1326
|
+
oracleType: string;
|
|
1327
|
+
/** OracleScaleFactor */
|
|
1328
|
+
oracleScaleFactor: number;
|
|
1329
|
+
}
|
|
1330
|
+
interface PriceV2Response {
|
|
1331
|
+
prices: PriceV2Result[];
|
|
1332
|
+
}
|
|
1333
|
+
interface PriceV2Result {
|
|
1334
|
+
/** Oracle base currency */
|
|
1335
|
+
baseSymbol: string;
|
|
1336
|
+
/** Oracle quote currency */
|
|
1337
|
+
quoteSymbol: string;
|
|
1338
|
+
/** Oracle Type */
|
|
1339
|
+
oracleType: string;
|
|
1340
|
+
/** OracleScaleFactor */
|
|
1341
|
+
oracleScaleFactor: number;
|
|
1342
|
+
/** The price of the oracle asset */
|
|
1343
|
+
price: string;
|
|
1344
|
+
/** marketID */
|
|
1345
|
+
marketId: string;
|
|
1346
|
+
}
|
|
1347
|
+
interface StreamPricesByMarketsRequest {
|
|
1348
|
+
/** marketIDs to stream price for, empty to listen for all prices */
|
|
1349
|
+
marketIds: string[];
|
|
1350
|
+
}
|
|
1351
|
+
interface StreamPricesByMarketsResponse {
|
|
1352
|
+
/** The price of the oracle asset */
|
|
1353
|
+
price: string;
|
|
1354
|
+
/** Operation timestamp in UNIX millis. */
|
|
1355
|
+
timestamp: number;
|
|
1356
|
+
/** marketID that the price has been updated */
|
|
1357
|
+
marketId: string;
|
|
1358
|
+
}
|
|
1359
|
+
declare const OracleListRequest: MessageFns$2<OracleListRequest>;
|
|
1360
|
+
declare const OracleListResponse: MessageFns$2<OracleListResponse>;
|
|
1361
|
+
declare const Oracle: MessageFns$2<Oracle>;
|
|
1362
|
+
declare const PricePayloadV2: MessageFns$2<PricePayloadV2>;
|
|
1363
|
+
declare const PriceV2Response: MessageFns$2<PriceV2Response>;
|
|
1364
|
+
declare const PriceV2Result: MessageFns$2<PriceV2Result>;
|
|
1365
|
+
declare const StreamPricesByMarketsRequest: MessageFns$2<StreamPricesByMarketsRequest>;
|
|
1366
|
+
declare const StreamPricesByMarketsResponse: MessageFns$2<StreamPricesByMarketsResponse>;
|
|
1367
|
+
type Builtin$2 = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
1368
|
+
type DeepPartial$2<T> = T extends Builtin$2 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$2<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$2<U>> : T extends {} ? { [K in keyof T]?: DeepPartial$2<T[K]>; } : Partial<T>;
|
|
1369
|
+
type KeysOfUnion$2<T> = T extends T ? keyof T : never;
|
|
1370
|
+
type Exact$2<P, I> = P extends Builtin$2 ? P : P & { [K in keyof P as Extract<K, keyof I>]: Exact$2<P[K], I[K & keyof I]>; } & { [K in Exclude<keyof I, KeysOfUnion$2<P>>]: never; };
|
|
1371
|
+
interface MessageFns$2<T> {
|
|
1372
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
1373
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
1374
|
+
fromJSON(object: any): T;
|
|
1375
|
+
toJSON(message: T): unknown;
|
|
1376
|
+
create<I extends Exact$2<DeepPartial$2<T>, I>>(base?: I): T;
|
|
1377
|
+
fromPartial<I extends Exact$2<DeepPartial$2<T>, I>>(object: I): T;
|
|
1378
|
+
}
|
|
1379
|
+
declare class IndexerOracleApiClient {
|
|
1380
|
+
private client;
|
|
1381
|
+
constructor(address: string, serverCredentials?: ChannelCredentials, options?: ChannelOptions);
|
|
1382
|
+
fetchOracleList(params?: Partial<OracleListRequest>): Promise<OracleListResponse>;
|
|
1383
|
+
fetchPriceV2(params: PricePayloadV2[]): Promise<PriceV2Response["prices"]>;
|
|
1384
|
+
}
|
|
1385
|
+
interface AccountPortfolioResponse {
|
|
1386
|
+
/** The portfolio of this account */
|
|
1387
|
+
portfolio: Portfolio | undefined;
|
|
1388
|
+
}
|
|
1389
|
+
interface Portfolio {
|
|
1390
|
+
/** The account's portfolio address */
|
|
1391
|
+
accountAddress: string;
|
|
1392
|
+
/** Account available bank balances */
|
|
1393
|
+
bankBalances: Coin[];
|
|
1394
|
+
/** Subaccounts list */
|
|
1395
|
+
subaccounts: SubaccountBalanceV2[];
|
|
1396
|
+
/** All positions for all subaccounts, with unrealized PNL */
|
|
1397
|
+
positionsWithUpnl: PositionsWithUPNL[];
|
|
1398
|
+
}
|
|
1399
|
+
interface Coin {
|
|
1400
|
+
/** Denom of the coin */
|
|
1401
|
+
denom: string;
|
|
1402
|
+
amount: string;
|
|
1403
|
+
usdValue: string;
|
|
1404
|
+
}
|
|
1405
|
+
interface SubaccountBalanceV2 {
|
|
1406
|
+
/** Related subaccount ID */
|
|
1407
|
+
subaccountId: string;
|
|
1408
|
+
/** Coin denom on the chain. */
|
|
1409
|
+
denom: string;
|
|
1410
|
+
deposit: SubaccountDeposit | undefined;
|
|
1411
|
+
}
|
|
1412
|
+
interface SubaccountDeposit {
|
|
1413
|
+
totalBalance: string;
|
|
1414
|
+
availableBalance: string;
|
|
1415
|
+
totalBalanceUsd: string;
|
|
1416
|
+
availableBalanceUsd: string;
|
|
1417
|
+
}
|
|
1418
|
+
interface PositionsWithUPNL {
|
|
1419
|
+
position: DerivativePosition | undefined;
|
|
1420
|
+
/** Unrealized PNL */
|
|
1421
|
+
unrealizedPnl: string;
|
|
1422
|
+
}
|
|
1423
|
+
interface DerivativePosition {
|
|
1424
|
+
/** Ticker of the derivative market */
|
|
1425
|
+
ticker: string;
|
|
1426
|
+
/** Derivative Market ID */
|
|
1427
|
+
marketId: string;
|
|
1428
|
+
/** The subaccountId that the position belongs to */
|
|
1429
|
+
subaccountId: string;
|
|
1430
|
+
/** Direction of the position */
|
|
1431
|
+
direction: string;
|
|
1432
|
+
/** Quantity of the position */
|
|
1433
|
+
quantity: string;
|
|
1434
|
+
/** Price of the position */
|
|
1435
|
+
entryPrice: string;
|
|
1436
|
+
/** Margin of the position */
|
|
1437
|
+
margin: string;
|
|
1438
|
+
/** LiquidationPrice of the position */
|
|
1439
|
+
liquidationPrice: string;
|
|
1440
|
+
/** MarkPrice of the position */
|
|
1441
|
+
markPrice: string;
|
|
1442
|
+
/** Aggregate Quantity of the Reduce Only orders associated with the position */
|
|
1443
|
+
aggregateReduceOnlyQuantity: string;
|
|
1444
|
+
/** Position updated timestamp in UNIX millis. */
|
|
1445
|
+
updatedAt: number;
|
|
1446
|
+
/** Position created timestamp in UNIX millis. */
|
|
1447
|
+
createdAt: number;
|
|
1448
|
+
/** Last funding fees since position opened */
|
|
1449
|
+
fundingLast: string;
|
|
1450
|
+
/** Net funding fees since position opened */
|
|
1451
|
+
fundingSum: string;
|
|
1452
|
+
/** Cumulative funding entry of the position */
|
|
1453
|
+
cumulativeFundingEntry: string;
|
|
1454
|
+
/** Effective cumulative funding entry of the position */
|
|
1455
|
+
effectiveCumulativeFundingEntry: string;
|
|
1456
|
+
}
|
|
1457
|
+
interface AccountPortfolioBalancesResponse {
|
|
1458
|
+
/** The portfolio balances of this account */
|
|
1459
|
+
portfolio: PortfolioBalances | undefined;
|
|
1460
|
+
}
|
|
1461
|
+
interface PortfolioBalances {
|
|
1462
|
+
/** The account's portfolio address */
|
|
1463
|
+
accountAddress: string;
|
|
1464
|
+
/** Account available bank balances */
|
|
1465
|
+
bankBalances: Coin[];
|
|
1466
|
+
/** Subaccounts list */
|
|
1467
|
+
subaccounts: SubaccountBalanceV2[];
|
|
1468
|
+
/** USD value of the portfolio */
|
|
1469
|
+
totalUsd: string;
|
|
1470
|
+
}
|
|
1471
|
+
interface StreamAccountPortfolioRequest {
|
|
1472
|
+
/** The account's portfolio address */
|
|
1473
|
+
accountAddress: string;
|
|
1474
|
+
/** Related subaccount ID */
|
|
1475
|
+
subaccountId: string;
|
|
1476
|
+
type: string;
|
|
1477
|
+
}
|
|
1478
|
+
interface StreamAccountPortfolioResponse {
|
|
1479
|
+
/** type of portfolio entry */
|
|
1480
|
+
type: string;
|
|
1481
|
+
/** denom of portfolio entry */
|
|
1482
|
+
denom: string;
|
|
1483
|
+
/** amount of portfolio entry */
|
|
1484
|
+
amount: string;
|
|
1485
|
+
/** subaccount id of portfolio entry */
|
|
1486
|
+
subaccountId: string;
|
|
1487
|
+
/** Operation timestamp in UNIX millis. */
|
|
1488
|
+
timestamp: number;
|
|
1489
|
+
}
|
|
1490
|
+
declare const AccountPortfolioResponse: MessageFns$1<AccountPortfolioResponse>;
|
|
1491
|
+
declare const Portfolio: MessageFns$1<Portfolio>;
|
|
1492
|
+
declare const Coin: MessageFns$1<Coin>;
|
|
1493
|
+
declare const SubaccountBalanceV2: MessageFns$1<SubaccountBalanceV2>;
|
|
1494
|
+
declare const SubaccountDeposit: MessageFns$1<SubaccountDeposit>;
|
|
1495
|
+
declare const PositionsWithUPNL: MessageFns$1<PositionsWithUPNL>;
|
|
1496
|
+
declare const DerivativePosition: MessageFns$1<DerivativePosition>;
|
|
1497
|
+
declare const AccountPortfolioBalancesResponse: MessageFns$1<AccountPortfolioBalancesResponse>;
|
|
1498
|
+
declare const PortfolioBalances: MessageFns$1<PortfolioBalances>;
|
|
1499
|
+
declare const StreamAccountPortfolioRequest: MessageFns$1<StreamAccountPortfolioRequest>;
|
|
1500
|
+
declare const StreamAccountPortfolioResponse: MessageFns$1<StreamAccountPortfolioResponse>;
|
|
1501
|
+
type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
1502
|
+
type DeepPartial$1<T> = T extends Builtin$1 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$1<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$1<U>> : T extends {} ? { [K in keyof T]?: DeepPartial$1<T[K]>; } : Partial<T>;
|
|
1503
|
+
type KeysOfUnion$1<T> = T extends T ? keyof T : never;
|
|
1504
|
+
type Exact$1<P, I> = P extends Builtin$1 ? P : P & { [K in keyof P as Extract<K, keyof I>]: Exact$1<P[K], I[K & keyof I]>; } & { [K in Exclude<keyof I, KeysOfUnion$1<P>>]: never; };
|
|
1505
|
+
interface MessageFns$1<T> {
|
|
1506
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
1507
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
1508
|
+
fromJSON(object: any): T;
|
|
1509
|
+
toJSON(message: T): unknown;
|
|
1510
|
+
create<I extends Exact$1<DeepPartial$1<T>, I>>(base?: I): T;
|
|
1511
|
+
fromPartial<I extends Exact$1<DeepPartial$1<T>, I>>(object: I): T;
|
|
1512
|
+
}
|
|
1513
|
+
declare class IndexerPortfolioApiClient {
|
|
1514
|
+
private client;
|
|
1515
|
+
constructor(address: string, serverCredentials?: ChannelCredentials, options?: ChannelOptions);
|
|
1516
|
+
fetchAccountPortfolio(accountAddress: string): Promise<AccountPortfolioResponse["portfolio"]>;
|
|
1517
|
+
fetchAccountPortfolioBalances(accountAddress: string): Promise<AccountPortfolioBalancesResponse["portfolio"]>;
|
|
1518
|
+
}
|
|
1519
|
+
interface MarketsRequest {
|
|
1520
|
+
/** Filter by market status */
|
|
1521
|
+
marketStatus: string;
|
|
1522
|
+
/** Filter by the Coin denomination of the base currency */
|
|
1523
|
+
baseDenom: string;
|
|
1524
|
+
/** Filter by the Coin denomination of the quote currency */
|
|
1525
|
+
quoteDenom: string;
|
|
1526
|
+
marketStatuses: string[];
|
|
1527
|
+
}
|
|
1528
|
+
interface MarketsResponse {
|
|
1529
|
+
/** Spot Markets list */
|
|
1530
|
+
markets: SpotMarketInfo[];
|
|
1531
|
+
}
|
|
1532
|
+
interface SpotMarketInfo {
|
|
1533
|
+
/** SpotMarket ID is keccak265(baseDenom || quoteDenom) */
|
|
1534
|
+
marketId: string;
|
|
1535
|
+
/** The status of the market */
|
|
1536
|
+
marketStatus: string;
|
|
1537
|
+
/**
|
|
1538
|
+
* A name of the pair in format AAA/BBB, where AAA is base asset, BBB is quote
|
|
1539
|
+
* asset.
|
|
1540
|
+
*/
|
|
1541
|
+
ticker: string;
|
|
1542
|
+
/** Coin denom used for the base asset. */
|
|
1543
|
+
baseDenom: string;
|
|
1544
|
+
/** Token metadata for base asset */
|
|
1545
|
+
baseTokenMeta: TokenMeta | undefined;
|
|
1546
|
+
/** Coin denom used for the quote asset. */
|
|
1547
|
+
quoteDenom: string;
|
|
1548
|
+
/** Token metadata for quote asset */
|
|
1549
|
+
quoteTokenMeta: TokenMeta | undefined;
|
|
1550
|
+
/** Defines the fee percentage makers pay when trading (in quote asset) */
|
|
1551
|
+
makerFeeRate: string;
|
|
1552
|
+
/** Defines the fee percentage takers pay when trading (in quote asset) */
|
|
1553
|
+
takerFeeRate: string;
|
|
1554
|
+
/** Percentage of the transaction fee shared with the service provider */
|
|
1555
|
+
serviceProviderFee: string;
|
|
1556
|
+
/** Defines the minimum required tick size for the order's price */
|
|
1557
|
+
minPriceTickSize: string;
|
|
1558
|
+
/** Defines the minimum required tick size for the order's quantity */
|
|
1559
|
+
minQuantityTickSize: string;
|
|
1560
|
+
/** Minimum notional value for the market */
|
|
1561
|
+
minNotional: string;
|
|
1562
|
+
}
|
|
1563
|
+
interface TokenMeta {
|
|
1564
|
+
/** Token full name */
|
|
1565
|
+
name: string;
|
|
1566
|
+
/** Token contract address (native or not) */
|
|
1567
|
+
address: string;
|
|
1568
|
+
/** Token symbol short name */
|
|
1569
|
+
symbol: string;
|
|
1570
|
+
/** URL to the logo image */
|
|
1571
|
+
logo: string;
|
|
1572
|
+
/** Token decimals */
|
|
1573
|
+
decimals: number;
|
|
1574
|
+
/** Token metadata fetched timestamp in UNIX millis. */
|
|
1575
|
+
updatedAt: number;
|
|
1576
|
+
}
|
|
1577
|
+
interface MarketResponse {
|
|
1578
|
+
/** Info about particular spot market */
|
|
1579
|
+
market: SpotMarketInfo | undefined;
|
|
1580
|
+
}
|
|
1581
|
+
interface StreamMarketsRequest {
|
|
1582
|
+
/** List of market IDs for updates streaming, empty means 'ALL' spot markets */
|
|
1583
|
+
marketIds: string[];
|
|
1584
|
+
}
|
|
1585
|
+
interface StreamMarketsResponse {
|
|
1586
|
+
/** Info about particular spot market */
|
|
1587
|
+
market: SpotMarketInfo | undefined;
|
|
1588
|
+
/** Update type */
|
|
1589
|
+
operationType: string;
|
|
1590
|
+
/** Operation timestamp in UNIX millis. */
|
|
1591
|
+
timestamp: number;
|
|
1592
|
+
}
|
|
1593
|
+
interface OrderbookV2Request {
|
|
1594
|
+
/** MarketId of the market's orderbook we want to fetch */
|
|
1595
|
+
marketId: string;
|
|
1596
|
+
/** Depth of the orderbook */
|
|
1597
|
+
depth: number;
|
|
1598
|
+
}
|
|
1599
|
+
interface OrderbookV2Response {
|
|
1600
|
+
/** Orderbook of a particular spot market */
|
|
1601
|
+
orderbook: SpotLimitOrderbookV2 | undefined;
|
|
1602
|
+
}
|
|
1603
|
+
interface SpotLimitOrderbookV2 {
|
|
1604
|
+
/** Array of price levels for buys */
|
|
1605
|
+
buys: PriceLevel[];
|
|
1606
|
+
/** Array of price levels for sells */
|
|
1607
|
+
sells: PriceLevel[];
|
|
1608
|
+
/** market orderbook sequence */
|
|
1609
|
+
sequence: number;
|
|
1610
|
+
/** Last update timestamp in UNIX millis. */
|
|
1611
|
+
timestamp: number;
|
|
1612
|
+
/** Block height at which the orderbook was last updated. */
|
|
1613
|
+
height: number;
|
|
1614
|
+
}
|
|
1615
|
+
interface PriceLevel {
|
|
1616
|
+
/** Price number of the price level. */
|
|
1617
|
+
price: string;
|
|
1618
|
+
/** Quantity of the price level. */
|
|
1619
|
+
quantity: string;
|
|
1620
|
+
/** Price level last updated timestamp in UNIX millis. */
|
|
1621
|
+
timestamp: number;
|
|
1622
|
+
}
|
|
1623
|
+
interface OrderbooksV2Request {
|
|
1624
|
+
/** MarketIds of the markets */
|
|
1625
|
+
marketIds: string[];
|
|
1626
|
+
/** Depth of the orderbook */
|
|
1627
|
+
depth: number;
|
|
1628
|
+
}
|
|
1629
|
+
interface OrderbooksV2Response {
|
|
1630
|
+
orderbooks: SingleSpotLimitOrderbookV2[];
|
|
1631
|
+
}
|
|
1632
|
+
interface SingleSpotLimitOrderbookV2 {
|
|
1633
|
+
/** market's ID */
|
|
1634
|
+
marketId: string;
|
|
1635
|
+
/** Orderbook of the market */
|
|
1636
|
+
orderbook: SpotLimitOrderbookV2 | undefined;
|
|
1637
|
+
}
|
|
1638
|
+
interface StreamOrderbookV2Request {
|
|
1639
|
+
/** List of market IDs for orderbook streaming, empty means 'ALL' spot markets */
|
|
1640
|
+
marketIds: string[];
|
|
1641
|
+
}
|
|
1642
|
+
interface StreamOrderbookV2Response {
|
|
1643
|
+
/** Orderbook of a Spot Market */
|
|
1644
|
+
orderbook: SpotLimitOrderbookV2 | undefined;
|
|
1645
|
+
/** Order update type */
|
|
1646
|
+
operationType: string;
|
|
1647
|
+
/** Operation timestamp in UNIX millis. */
|
|
1648
|
+
timestamp: number;
|
|
1649
|
+
/** MarketId of the market's orderbook */
|
|
1650
|
+
marketId: string;
|
|
1651
|
+
}
|
|
1652
|
+
interface StreamOrderbookUpdateRequest {
|
|
1653
|
+
/** List of market IDs for orderbook streaming, empty means 'ALL' spot markets */
|
|
1654
|
+
marketIds: string[];
|
|
1655
|
+
}
|
|
1656
|
+
interface StreamOrderbookUpdateResponse {
|
|
1657
|
+
/** Orderbook level updates of a Spot Market */
|
|
1658
|
+
orderbookLevelUpdates: OrderbookLevelUpdates | undefined;
|
|
1659
|
+
/** Order update type */
|
|
1660
|
+
operationType: string;
|
|
1661
|
+
/** Operation timestamp in UNIX millis. */
|
|
1662
|
+
timestamp: number;
|
|
1663
|
+
/** MarketId of the market's orderbook */
|
|
1664
|
+
marketId: string;
|
|
1665
|
+
}
|
|
1666
|
+
interface OrderbookLevelUpdates {
|
|
1667
|
+
/** market's ID */
|
|
1668
|
+
marketId: string;
|
|
1669
|
+
/** orderbook update sequence */
|
|
1670
|
+
sequence: number;
|
|
1671
|
+
/** buy levels */
|
|
1672
|
+
buys: PriceLevelUpdate[];
|
|
1673
|
+
/** sell levels */
|
|
1674
|
+
sells: PriceLevelUpdate[];
|
|
1675
|
+
/** updates timestamp */
|
|
1676
|
+
updatedAt: number;
|
|
1677
|
+
}
|
|
1678
|
+
interface PriceLevelUpdate {
|
|
1679
|
+
/** Price number of the price level. */
|
|
1680
|
+
price: string;
|
|
1681
|
+
/** Quantity of the price level. */
|
|
1682
|
+
quantity: string;
|
|
1683
|
+
/** Price level status. */
|
|
1684
|
+
isActive: boolean;
|
|
1685
|
+
/** Price level last updated timestamp in UNIX millis. */
|
|
1686
|
+
timestamp: number;
|
|
1687
|
+
}
|
|
1688
|
+
interface OrdersRequest {
|
|
1689
|
+
/** MarketId of the market's orderbook we want to fetch */
|
|
1690
|
+
marketId: string;
|
|
1691
|
+
/** Look for specific order side */
|
|
1692
|
+
orderSide: string;
|
|
1693
|
+
/** Look for specific subaccountId of an order */
|
|
1694
|
+
subaccountId: string;
|
|
1695
|
+
/** Skip will skip the first n item from the result */
|
|
1696
|
+
skip: number;
|
|
1697
|
+
/** Limit is used to specify the maximum number of items to be returned. */
|
|
1698
|
+
limit: number;
|
|
1699
|
+
/**
|
|
1700
|
+
* The starting timestamp in UNIX milliseconds that the trades must be equal or
|
|
1701
|
+
* older than
|
|
1702
|
+
*/
|
|
1703
|
+
startTime: number;
|
|
1704
|
+
/**
|
|
1705
|
+
* The ending timestamp in UNIX milliseconds that the trades must be equal or
|
|
1706
|
+
* younger than
|
|
1707
|
+
*/
|
|
1708
|
+
endTime: number;
|
|
1709
|
+
/** MarketIds of the markets of which we want to get trades */
|
|
1710
|
+
marketIds: string[];
|
|
1711
|
+
/** Should include inactive orders */
|
|
1712
|
+
includeInactive: boolean;
|
|
1713
|
+
/** Choose to return subaccount total orders */
|
|
1714
|
+
subaccountTotalOrders: boolean;
|
|
1715
|
+
/** TradeId of the order we want to fetch */
|
|
1716
|
+
tradeId: string;
|
|
1717
|
+
/** Client order ID */
|
|
1718
|
+
cid: string;
|
|
1719
|
+
}
|
|
1720
|
+
interface OrdersResponse {
|
|
1721
|
+
orders: SpotLimitOrder[];
|
|
1722
|
+
paging: Paging | undefined;
|
|
1723
|
+
}
|
|
1724
|
+
interface SpotLimitOrder {
|
|
1725
|
+
/** Hash of the order */
|
|
1726
|
+
orderHash: string;
|
|
1727
|
+
/** The side of the order */
|
|
1728
|
+
orderSide: string;
|
|
1729
|
+
/** Spot Market ID is keccak265(baseDenom + quoteDenom) */
|
|
1730
|
+
marketId: string;
|
|
1731
|
+
/** The subaccountId that this order belongs to */
|
|
1732
|
+
subaccountId: string;
|
|
1733
|
+
/** Price of the order */
|
|
1734
|
+
price: string;
|
|
1735
|
+
/** Quantity of the order */
|
|
1736
|
+
quantity: string;
|
|
1737
|
+
/** The amount of the quantity remaining unfilled */
|
|
1738
|
+
unfilledQuantity: string;
|
|
1739
|
+
/**
|
|
1740
|
+
* Trigger price is the trigger price used by stop/take orders. 0 if the
|
|
1741
|
+
* trigger price is not set.
|
|
1742
|
+
*/
|
|
1743
|
+
triggerPrice: string;
|
|
1744
|
+
/** Fee recipient address */
|
|
1745
|
+
feeRecipient: string;
|
|
1746
|
+
/** Order state */
|
|
1747
|
+
state: string;
|
|
1748
|
+
/** Order committed timestamp in UNIX millis. */
|
|
1749
|
+
createdAt: number;
|
|
1750
|
+
/** Order updated timestamp in UNIX millis. */
|
|
1751
|
+
updatedAt: number;
|
|
1752
|
+
/** Transaction Hash where order is created. Not all orders have this field */
|
|
1753
|
+
txHash: string;
|
|
1754
|
+
/** Custom client order ID */
|
|
1755
|
+
cid: string;
|
|
1756
|
+
}
|
|
1757
|
+
/** Paging defines the structure for required params for handling pagination */
|
|
1758
|
+
interface Paging {
|
|
1759
|
+
/** total number of txs saved in database */
|
|
1760
|
+
total: number;
|
|
1761
|
+
/** can be either block height or index num */
|
|
1762
|
+
from: number;
|
|
1763
|
+
/** can be either block height or index num */
|
|
1764
|
+
to: number;
|
|
1765
|
+
/** count entries by subaccount, serving some places on helix */
|
|
1766
|
+
countBySubaccount: number;
|
|
1767
|
+
/** array of tokens to navigate to the next pages */
|
|
1768
|
+
next: string[];
|
|
1769
|
+
}
|
|
1770
|
+
interface StreamOrdersRequest {
|
|
1771
|
+
/** MarketId of the market's orderbook we want to fetch */
|
|
1772
|
+
marketId: string;
|
|
1773
|
+
/** Look for specific order side */
|
|
1774
|
+
orderSide: string;
|
|
1775
|
+
/** Look for specific subaccountId of an order */
|
|
1776
|
+
subaccountId: string;
|
|
1777
|
+
/** Skip will skip the first n item from the result */
|
|
1778
|
+
skip: number;
|
|
1779
|
+
/** Limit is used to specify the maximum number of items to be returned. */
|
|
1780
|
+
limit: number;
|
|
1781
|
+
/**
|
|
1782
|
+
* The starting timestamp in UNIX milliseconds that the trades must be equal or
|
|
1783
|
+
* older than
|
|
1784
|
+
*/
|
|
1785
|
+
startTime: number;
|
|
1786
|
+
/**
|
|
1787
|
+
* The ending timestamp in UNIX milliseconds that the trades must be equal or
|
|
1788
|
+
* younger than
|
|
1789
|
+
*/
|
|
1790
|
+
endTime: number;
|
|
1791
|
+
/** MarketIds of the markets of which we want to get trades */
|
|
1792
|
+
marketIds: string[];
|
|
1793
|
+
/** Should include inactive orders */
|
|
1794
|
+
includeInactive: boolean;
|
|
1795
|
+
/** Choose to return subaccount total orders */
|
|
1796
|
+
subaccountTotalOrders: boolean;
|
|
1797
|
+
/** TradeId of the order we want to fetch */
|
|
1798
|
+
tradeId: string;
|
|
1799
|
+
/** Client order ID */
|
|
1800
|
+
cid: string;
|
|
1801
|
+
}
|
|
1802
|
+
interface StreamOrdersResponse {
|
|
1803
|
+
/** Updated market order */
|
|
1804
|
+
order: SpotLimitOrder | undefined;
|
|
1805
|
+
/** Order update type */
|
|
1806
|
+
operationType: string;
|
|
1807
|
+
/** Operation timestamp in UNIX millis. */
|
|
1808
|
+
timestamp: number;
|
|
1809
|
+
}
|
|
1810
|
+
interface SpotTrade {
|
|
1811
|
+
/** Maker order hash. */
|
|
1812
|
+
orderHash: string;
|
|
1813
|
+
/** The subaccountId that executed the trade */
|
|
1814
|
+
subaccountId: string;
|
|
1815
|
+
/** The ID of the market that this trade is in */
|
|
1816
|
+
marketId: string;
|
|
1817
|
+
/** The execution type of the trade */
|
|
1818
|
+
tradeExecutionType: string;
|
|
1819
|
+
/** The direction the trade */
|
|
1820
|
+
tradeDirection: string;
|
|
1821
|
+
/** Price level at which trade has been executed */
|
|
1822
|
+
price: PriceLevel | undefined;
|
|
1823
|
+
/** The fee associated with the trade (quote asset denom) */
|
|
1824
|
+
fee: string;
|
|
1825
|
+
/** Timestamp of trade execution in UNIX millis */
|
|
1826
|
+
executedAt: number;
|
|
1827
|
+
/** Fee recipient address */
|
|
1828
|
+
feeRecipient: string;
|
|
1829
|
+
/** A unique string that helps differentiate between trades */
|
|
1830
|
+
tradeId: string;
|
|
1831
|
+
/** Trade's execution side, maker,taker,n/a (n/a = not applicable) */
|
|
1832
|
+
executionSide: string;
|
|
1833
|
+
/** Custom client order ID */
|
|
1834
|
+
cid: string;
|
|
1835
|
+
}
|
|
1836
|
+
interface TradesV2Request {
|
|
1837
|
+
/** MarketId of the market's orderbook we want to fetch */
|
|
1838
|
+
marketId: string;
|
|
1839
|
+
/** Filter by execution side of the trade */
|
|
1840
|
+
executionSide: string;
|
|
1841
|
+
/** Filter by direction the trade */
|
|
1842
|
+
direction: string;
|
|
1843
|
+
/** SubaccountId of the trader we want to get the trades from */
|
|
1844
|
+
subaccountId: string;
|
|
1845
|
+
/** Skip will skip the first n item from the item result */
|
|
1846
|
+
skip: number;
|
|
1847
|
+
/** Limit is used to specify the maximum number of items to be returned. */
|
|
1848
|
+
limit: number;
|
|
1849
|
+
/**
|
|
1850
|
+
* The starting timestamp in UNIX milliseconds that the trades must be equal or
|
|
1851
|
+
* older than
|
|
1852
|
+
*/
|
|
1853
|
+
startTime: number;
|
|
1854
|
+
/**
|
|
1855
|
+
* The ending timestamp in UNIX milliseconds that the trades must be equal or
|
|
1856
|
+
* younger than
|
|
1857
|
+
*/
|
|
1858
|
+
endTime: number;
|
|
1859
|
+
/** MarketIds of the markets of which we want to get trades */
|
|
1860
|
+
marketIds: string[];
|
|
1861
|
+
/** Subaccount ids of traders we want to get trades */
|
|
1862
|
+
subaccountIds: string[];
|
|
1863
|
+
executionTypes: string[];
|
|
1864
|
+
/** Filter by the tradeId of the trade */
|
|
1865
|
+
tradeId: string;
|
|
1866
|
+
/** Account address */
|
|
1867
|
+
accountAddress: string;
|
|
1868
|
+
/** Client order ID */
|
|
1869
|
+
cid: string;
|
|
1870
|
+
/** Fee recipient address */
|
|
1871
|
+
feeRecipient: string;
|
|
1872
|
+
}
|
|
1873
|
+
interface TradesV2Response {
|
|
1874
|
+
/** Trades of a Spot Market */
|
|
1875
|
+
trades: SpotTrade[];
|
|
1876
|
+
/** Paging indicates pages response is on */
|
|
1877
|
+
paging: Paging | undefined;
|
|
1878
|
+
}
|
|
1879
|
+
interface StreamTradesV2Request {
|
|
1880
|
+
/** MarketId of the market's orderbook we want to fetch */
|
|
1881
|
+
marketId: string;
|
|
1882
|
+
/** Filter by execution side of the trade */
|
|
1883
|
+
executionSide: string;
|
|
1884
|
+
/** Filter by direction the trade */
|
|
1885
|
+
direction: string;
|
|
1886
|
+
/** SubaccountId of the trader we want to get the trades from */
|
|
1887
|
+
subaccountId: string;
|
|
1888
|
+
/** Skip will skip the first n item from the item result */
|
|
1889
|
+
skip: number;
|
|
1890
|
+
/** Limit is used to specify the maximum number of items to be returned. */
|
|
1891
|
+
limit: number;
|
|
1892
|
+
/**
|
|
1893
|
+
* The starting timestamp in UNIX milliseconds that the trades must be equal or
|
|
1894
|
+
* older than
|
|
1895
|
+
*/
|
|
1896
|
+
startTime: number;
|
|
1897
|
+
/**
|
|
1898
|
+
* The ending timestamp in UNIX milliseconds that the trades must be equal or
|
|
1899
|
+
* younger than
|
|
1900
|
+
*/
|
|
1901
|
+
endTime: number;
|
|
1902
|
+
/** MarketIds of the markets of which we want to get trades */
|
|
1903
|
+
marketIds: string[];
|
|
1904
|
+
/** Subaccount ids of traders we want to get trades */
|
|
1905
|
+
subaccountIds: string[];
|
|
1906
|
+
executionTypes: string[];
|
|
1907
|
+
/** Filter by the tradeId of the trade */
|
|
1908
|
+
tradeId: string;
|
|
1909
|
+
/** Account address */
|
|
1910
|
+
accountAddress: string;
|
|
1911
|
+
/** Client order ID */
|
|
1912
|
+
cid: string;
|
|
1913
|
+
/** Fee recipient address */
|
|
1914
|
+
feeRecipient: string;
|
|
1915
|
+
}
|
|
1916
|
+
interface StreamTradesV2Response {
|
|
1917
|
+
/** New spot market trade */
|
|
1918
|
+
trade: SpotTrade | undefined;
|
|
1919
|
+
/** Executed trades update type */
|
|
1920
|
+
operationType: string;
|
|
1921
|
+
/** Operation timestamp in UNIX millis. */
|
|
1922
|
+
timestamp: number;
|
|
1923
|
+
}
|
|
1924
|
+
interface SubaccountOrdersListRequest {
|
|
1925
|
+
/** subaccount ID to filter orders for specific subaccount */
|
|
1926
|
+
subaccountId: string;
|
|
1927
|
+
/** Market ID to filter orders for specific market */
|
|
1928
|
+
marketId: string;
|
|
1929
|
+
/** Skip will skip the first n item from the result */
|
|
1930
|
+
skip: number;
|
|
1931
|
+
/** Limit is used to specify the maximum number of items to be returned */
|
|
1932
|
+
limit: number;
|
|
1933
|
+
}
|
|
1934
|
+
interface SubaccountOrdersListResponse {
|
|
1935
|
+
orders: SpotLimitOrder[];
|
|
1936
|
+
paging: Paging | undefined;
|
|
1937
|
+
}
|
|
1938
|
+
interface SubaccountTradesListRequest {
|
|
1939
|
+
/** SubaccountId of the trader we want to get the trades from */
|
|
1940
|
+
subaccountId: string;
|
|
1941
|
+
/** Filter trades by market ID */
|
|
1942
|
+
marketId: string;
|
|
1943
|
+
/** Filter by execution type of trades */
|
|
1944
|
+
executionType: string;
|
|
1945
|
+
/** Filter by direction trades */
|
|
1946
|
+
direction: string;
|
|
1947
|
+
/** Skip will skip the first n item from the result */
|
|
1948
|
+
skip: number;
|
|
1949
|
+
/** Limit is used to specify the maximum number of items to be returned */
|
|
1950
|
+
limit: number;
|
|
1951
|
+
}
|
|
1952
|
+
interface SubaccountTradesListResponse {
|
|
1953
|
+
/** List of spot market trades */
|
|
1954
|
+
trades: SpotTrade[];
|
|
1955
|
+
}
|
|
1956
|
+
interface OrdersHistoryRequest {
|
|
1957
|
+
/** subaccount ID to filter orders for specific subaccount */
|
|
1958
|
+
subaccountId: string;
|
|
1959
|
+
/** Market ID to filter orders for specific market */
|
|
1960
|
+
marketId: string;
|
|
1961
|
+
/** Skip will skip the first n item from the result */
|
|
1962
|
+
skip: number;
|
|
1963
|
+
/** Limit is used to specify the maximum number of items to be returned */
|
|
1964
|
+
limit: number;
|
|
1965
|
+
/** filter by order types */
|
|
1966
|
+
orderTypes: string[];
|
|
1967
|
+
/** order side filter */
|
|
1968
|
+
direction: string;
|
|
1969
|
+
/** Search for orders which createdAt >= startTime, time in millisecond */
|
|
1970
|
+
startTime: number;
|
|
1971
|
+
/** Search for orders which createdAt <= endTime, time in millisecond */
|
|
1972
|
+
endTime: number;
|
|
1973
|
+
/** Filter by order state */
|
|
1974
|
+
state: string;
|
|
1975
|
+
executionTypes: string[];
|
|
1976
|
+
marketIds: string[];
|
|
1977
|
+
/** TradeId of the order we want to fetch */
|
|
1978
|
+
tradeId: string;
|
|
1979
|
+
/** Return only orders for active markets */
|
|
1980
|
+
activeMarketsOnly: boolean;
|
|
1981
|
+
/** Client order ID */
|
|
1982
|
+
cid: string;
|
|
1983
|
+
}
|
|
1984
|
+
interface OrdersHistoryResponse {
|
|
1985
|
+
/** List of history spot orders */
|
|
1986
|
+
orders: SpotOrderHistory[];
|
|
1987
|
+
paging: Paging | undefined;
|
|
1988
|
+
}
|
|
1989
|
+
interface SpotOrderHistory {
|
|
1990
|
+
/** Hash of the order */
|
|
1991
|
+
orderHash: string;
|
|
1992
|
+
/** Spot Market ID is keccak265(baseDenom + quoteDenom) */
|
|
1993
|
+
marketId: string;
|
|
1994
|
+
/** active state of the order */
|
|
1995
|
+
isActive: boolean;
|
|
1996
|
+
/** The subaccountId that this order belongs to */
|
|
1997
|
+
subaccountId: string;
|
|
1998
|
+
/** The execution type */
|
|
1999
|
+
executionType: string;
|
|
2000
|
+
/** The side of the order */
|
|
2001
|
+
orderType: string;
|
|
2002
|
+
/** Price of the order */
|
|
2003
|
+
price: string;
|
|
2004
|
+
/** Trigger price */
|
|
2005
|
+
triggerPrice: string;
|
|
2006
|
+
/** Quantity of the order */
|
|
2007
|
+
quantity: string;
|
|
2008
|
+
/** Filled amount */
|
|
2009
|
+
filledQuantity: string;
|
|
2010
|
+
/** Order state */
|
|
2011
|
+
state: string;
|
|
2012
|
+
/** Order committed timestamp in UNIX millis. */
|
|
2013
|
+
createdAt: number;
|
|
2014
|
+
/** Order updated timestamp in UNIX millis. */
|
|
2015
|
+
updatedAt: number;
|
|
2016
|
+
/** Order direction (order side) */
|
|
2017
|
+
direction: string;
|
|
2018
|
+
/** Transaction Hash where order is created. Not all orders have this field */
|
|
2019
|
+
txHash: string;
|
|
2020
|
+
/** Custom client order ID */
|
|
2021
|
+
cid: string;
|
|
2022
|
+
}
|
|
2023
|
+
interface StreamOrdersHistoryRequest {
|
|
2024
|
+
/** subaccount ID to filter orders for specific subaccount */
|
|
2025
|
+
subaccountId: string;
|
|
2026
|
+
/** Market ID to filter orders for specific market */
|
|
2027
|
+
marketId: string;
|
|
2028
|
+
/** filter by order types */
|
|
2029
|
+
orderTypes: string[];
|
|
2030
|
+
/** order side filter */
|
|
2031
|
+
direction: string;
|
|
2032
|
+
/** Filter by order state */
|
|
2033
|
+
state: string;
|
|
2034
|
+
executionTypes: string[];
|
|
2035
|
+
}
|
|
2036
|
+
interface StreamOrdersHistoryResponse {
|
|
2037
|
+
/** Updated order */
|
|
2038
|
+
order: SpotOrderHistory | undefined;
|
|
2039
|
+
/** Order update type */
|
|
2040
|
+
operationType: string;
|
|
2041
|
+
/** Operation timestamp in UNIX millis. */
|
|
2042
|
+
timestamp: number;
|
|
2043
|
+
}
|
|
2044
|
+
declare const MarketsRequest: MessageFns<MarketsRequest>;
|
|
2045
|
+
declare const MarketsResponse: MessageFns<MarketsResponse>;
|
|
2046
|
+
declare const SpotMarketInfo: MessageFns<SpotMarketInfo>;
|
|
2047
|
+
declare const TokenMeta: MessageFns<TokenMeta>;
|
|
2048
|
+
declare const MarketResponse: MessageFns<MarketResponse>;
|
|
2049
|
+
declare const StreamMarketsRequest: MessageFns<StreamMarketsRequest>;
|
|
2050
|
+
declare const StreamMarketsResponse: MessageFns<StreamMarketsResponse>;
|
|
2051
|
+
declare const OrderbookV2Request: MessageFns<OrderbookV2Request>;
|
|
2052
|
+
declare const OrderbookV2Response: MessageFns<OrderbookV2Response>;
|
|
2053
|
+
declare const SpotLimitOrderbookV2: MessageFns<SpotLimitOrderbookV2>;
|
|
2054
|
+
declare const PriceLevel: MessageFns<PriceLevel>;
|
|
2055
|
+
declare const OrderbooksV2Request: MessageFns<OrderbooksV2Request>;
|
|
2056
|
+
declare const OrderbooksV2Response: MessageFns<OrderbooksV2Response>;
|
|
2057
|
+
declare const SingleSpotLimitOrderbookV2: MessageFns<SingleSpotLimitOrderbookV2>;
|
|
2058
|
+
declare const StreamOrderbookV2Request: MessageFns<StreamOrderbookV2Request>;
|
|
2059
|
+
declare const StreamOrderbookV2Response: MessageFns<StreamOrderbookV2Response>;
|
|
2060
|
+
declare const StreamOrderbookUpdateRequest: MessageFns<StreamOrderbookUpdateRequest>;
|
|
2061
|
+
declare const StreamOrderbookUpdateResponse: MessageFns<StreamOrderbookUpdateResponse>;
|
|
2062
|
+
declare const OrderbookLevelUpdates: MessageFns<OrderbookLevelUpdates>;
|
|
2063
|
+
declare const PriceLevelUpdate: MessageFns<PriceLevelUpdate>;
|
|
2064
|
+
declare const OrdersRequest: MessageFns<OrdersRequest>;
|
|
2065
|
+
declare const OrdersResponse: MessageFns<OrdersResponse>;
|
|
2066
|
+
declare const SpotLimitOrder: MessageFns<SpotLimitOrder>;
|
|
2067
|
+
declare const Paging: MessageFns<Paging>;
|
|
2068
|
+
declare const StreamOrdersRequest: MessageFns<StreamOrdersRequest>;
|
|
2069
|
+
declare const StreamOrdersResponse: MessageFns<StreamOrdersResponse>;
|
|
2070
|
+
declare const SpotTrade: MessageFns<SpotTrade>;
|
|
2071
|
+
declare const TradesV2Request: MessageFns<TradesV2Request>;
|
|
2072
|
+
declare const TradesV2Response: MessageFns<TradesV2Response>;
|
|
2073
|
+
declare const StreamTradesV2Request: MessageFns<StreamTradesV2Request>;
|
|
2074
|
+
declare const StreamTradesV2Response: MessageFns<StreamTradesV2Response>;
|
|
2075
|
+
declare const SubaccountOrdersListRequest: MessageFns<SubaccountOrdersListRequest>;
|
|
2076
|
+
declare const SubaccountOrdersListResponse: MessageFns<SubaccountOrdersListResponse>;
|
|
2077
|
+
declare const SubaccountTradesListRequest: MessageFns<SubaccountTradesListRequest>;
|
|
2078
|
+
declare const SubaccountTradesListResponse: MessageFns<SubaccountTradesListResponse>;
|
|
2079
|
+
declare const OrdersHistoryRequest: MessageFns<OrdersHistoryRequest>;
|
|
2080
|
+
declare const OrdersHistoryResponse: MessageFns<OrdersHistoryResponse>;
|
|
2081
|
+
declare const SpotOrderHistory: MessageFns<SpotOrderHistory>;
|
|
2082
|
+
declare const StreamOrdersHistoryRequest: MessageFns<StreamOrdersHistoryRequest>;
|
|
2083
|
+
declare const StreamOrdersHistoryResponse: MessageFns<StreamOrdersHistoryResponse>;
|
|
2084
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
2085
|
+
type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]>; } : Partial<T>;
|
|
2086
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
2087
|
+
type Exact<P, I> = P extends Builtin ? P : P & { [K in keyof P as Extract<K, keyof I>]: Exact<P[K], I[K & keyof I]>; } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never; };
|
|
2088
|
+
interface MessageFns<T> {
|
|
2089
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
2090
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
2091
|
+
fromJSON(object: any): T;
|
|
2092
|
+
toJSON(message: T): unknown;
|
|
2093
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
2094
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
2095
|
+
}
|
|
2096
|
+
declare class IndexerSpotApiClient {
|
|
2097
|
+
private client;
|
|
2098
|
+
constructor(address: string, serverCredentials?: ChannelCredentials, options?: ChannelOptions);
|
|
2099
|
+
fetchMarkets(params?: Partial<MarketsRequest>): Promise<MarketsResponse["markets"]>;
|
|
2100
|
+
fetchMarket(marketId: string): Promise<MarketResponse["market"]>;
|
|
2101
|
+
fetchOrderbookV2(params: Partial<OrderbookV2Request> & Pick<OrderbookV2Request, "marketId">): Promise<OrderbookV2Response["orderbook"]>;
|
|
2102
|
+
fetchOrderbooksV2(params: Partial<OrderbooksV2Request> & Pick<OrderbooksV2Request, "marketIds">): Promise<OrderbooksV2Response["orderbooks"]>;
|
|
2103
|
+
fetchOrders(params?: Partial<OrdersRequest>): Promise<OrdersResponse>;
|
|
2104
|
+
fetchTradesV2(params?: Partial<TradesV2Request>): Promise<TradesV2Response>;
|
|
2105
|
+
fetchSubaccountOrdersList(params: Partial<SubaccountOrdersListRequest> & Pick<SubaccountOrdersListRequest, "subaccountId">): Promise<SubaccountOrdersListResponse>;
|
|
2106
|
+
fetchSubaccountTradesList(params: Partial<SubaccountTradesListRequest> & Pick<SubaccountTradesListRequest, "subaccountId">): Promise<SubaccountTradesListResponse["trades"]>;
|
|
2107
|
+
fetchOrdersHistory(params?: Partial<OrdersHistoryRequest>): Promise<OrdersHistoryResponse>;
|
|
2108
|
+
}
|
|
2109
|
+
declare class StreamManager<StreamResponse> extends EventEmitter<EventTypes<StreamResponse>> {
|
|
2110
|
+
private streamFactory;
|
|
2111
|
+
private subscription;
|
|
2112
|
+
private state;
|
|
2113
|
+
private retryConfig;
|
|
2114
|
+
private streamError;
|
|
2115
|
+
private retryAttempts;
|
|
2116
|
+
private reconnectionTimeout;
|
|
2117
|
+
private stableConnectionTimeout;
|
|
2118
|
+
private path;
|
|
2119
|
+
constructor(streamFactory: () => ClientReadableStream<StreamResponse>, path: string, retryConfig?: Partial<StreamManagerRetryConfig>);
|
|
2120
|
+
start(): void;
|
|
2121
|
+
stop(): void;
|
|
2122
|
+
destroy(): void;
|
|
2123
|
+
private get isDestroyed();
|
|
2124
|
+
private updateState;
|
|
2125
|
+
private handleReconnection;
|
|
2126
|
+
private scheduleConnectionStable;
|
|
2127
|
+
private clearStableConnectionTimeout;
|
|
2128
|
+
private markConnectionStable;
|
|
2129
|
+
private clearReconnectionTimeout;
|
|
2130
|
+
private clearSubscription;
|
|
2131
|
+
private calculateBackoff;
|
|
2132
|
+
}
|
|
2133
|
+
declare class IndexerAccountsStreamClient {
|
|
2134
|
+
private client;
|
|
2135
|
+
constructor(address: string, serverCredentials?: ChannelCredentials, options?: ChannelOptions);
|
|
2136
|
+
streamSubaccountBalance(params: Pick<StreamSubaccountBalanceRequest, "subaccountId"> & Partial<StreamSubaccountBalanceRequest>): StreamManager<StreamSubaccountBalanceResponse>;
|
|
2137
|
+
}
|
|
2138
|
+
declare class IndexerDerivativesStreamClient {
|
|
2139
|
+
private client;
|
|
2140
|
+
constructor(address: string, serverCredentials?: ChannelCredentials, options?: ChannelOptions);
|
|
2141
|
+
streamMarket(params?: Partial<StreamMarketRequest>): StreamManager<StreamMarketResponse>;
|
|
2142
|
+
streamOrderbookV2(params?: Partial<StreamOrderbookV2Request$1>): StreamManager<StreamOrderbookV2Response$1>;
|
|
2143
|
+
streamOrderbookUpdate(params?: Partial<StreamOrderbookUpdateRequest$1>): StreamManager<StreamOrderbookUpdateResponse$1>;
|
|
2144
|
+
streamPositionsV2(params?: Partial<StreamPositionsV2Request>): StreamManager<StreamPositionsV2Response>;
|
|
2145
|
+
streamTradesV2(params?: Partial<StreamTradesV2Request$1>): StreamManager<StreamTradesV2Response$1>;
|
|
2146
|
+
streamOrders(params?: Partial<StreamOrdersRequest$1>): StreamManager<StreamOrdersResponse$1>;
|
|
2147
|
+
streamOrdersHistory(params?: Partial<StreamOrdersHistoryRequest$1>): StreamManager<StreamOrdersHistoryResponse$1>;
|
|
2148
|
+
}
|
|
2149
|
+
declare class IndexerOracleStreamClient {
|
|
2150
|
+
private client;
|
|
2151
|
+
constructor(address: string, serverCredentials?: ChannelCredentials, options?: ChannelOptions);
|
|
2152
|
+
streamPricesByMarkets(params?: Partial<StreamPricesByMarketsRequest>): StreamManager<StreamPricesByMarketsResponse>;
|
|
2153
|
+
}
|
|
2154
|
+
declare class IndexerPortfolioStreamClient {
|
|
2155
|
+
private client;
|
|
2156
|
+
constructor(address: string, serverCredentials?: ChannelCredentials, options?: ChannelOptions);
|
|
2157
|
+
streamAccountPortfolio(params: Partial<StreamAccountPortfolioRequest> & Pick<StreamAccountPortfolioRequest, "accountAddress">): StreamManager<StreamAccountPortfolioResponse>;
|
|
2158
|
+
}
|
|
2159
|
+
declare class IndexerSpotStreamClient {
|
|
2160
|
+
private client;
|
|
2161
|
+
constructor(address: string, serverCredentials?: ChannelCredentials, options?: ChannelOptions);
|
|
2162
|
+
streamMarkets(params?: Partial<StreamMarketsRequest>): StreamManager<StreamMarketsResponse>;
|
|
2163
|
+
streamOrderbookV2(params?: Partial<StreamOrderbookV2Request>): StreamManager<StreamOrderbookV2Response>;
|
|
2164
|
+
streamOrderbookUpdates(params?: Partial<StreamOrderbookUpdateRequest>): StreamManager<StreamOrderbookUpdateResponse>;
|
|
2165
|
+
streamOrders(params?: Partial<StreamOrdersRequest>): StreamManager<StreamOrdersResponse>;
|
|
2166
|
+
streamTradesV2(params?: Partial<StreamTradesV2Request>): StreamManager<StreamTradesV2Response>;
|
|
2167
|
+
streamOrdersHistory(params?: Partial<StreamOrdersHistoryRequest>): StreamManager<StreamOrdersHistoryResponse>;
|
|
2168
|
+
}
|
|
2169
|
+
export { IndexerAccountsStreamClient as a, IndexerPortfolioApiClient as c, IndexerArchiverApiClient as d, IndexerAccountsApiClient as f, IndexerDerivativesStreamClient as i, IndexerOracleApiClient as l, IndexerPortfolioStreamClient as n, StreamManager as o, IndexerOracleStreamClient as r, IndexerSpotApiClient as s, IndexerSpotStreamClient as t, IndexerDerivativesApiClient as u };
|