@madeinusmate/grvt-cli 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/README.md +1154 -0
- package/dist/chunk-I7C5KKUG.js +46 -0
- package/dist/chunk-I7C5KKUG.js.map +1 -0
- package/dist/cli.js +1880 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.cjs +771 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +462 -0
- package/dist/index.d.ts +462 -0
- package/dist/index.js +700 -0
- package/dist/index.js.map +1 -0
- package/dist/schema-LBUHKB7A.js +14 -0
- package/dist/schema-LBUHKB7A.js.map +1 -0
- package/package.json +59 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const configSchema: z.ZodObject<{
|
|
4
|
+
env: z.ZodDefault<z.ZodEnum<["dev", "staging", "testnet", "prod"]>>;
|
|
5
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
6
|
+
privateKey: z.ZodOptional<z.ZodString>;
|
|
7
|
+
subAccountId: z.ZodOptional<z.ZodString>;
|
|
8
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
9
|
+
cookie: z.ZodOptional<z.ZodString>;
|
|
10
|
+
outputDefaults: z.ZodDefault<z.ZodObject<{
|
|
11
|
+
output: z.ZodDefault<z.ZodEnum<["json", "ndjson", "table", "raw"]>>;
|
|
12
|
+
pretty: z.ZodDefault<z.ZodBoolean>;
|
|
13
|
+
silent: z.ZodDefault<z.ZodBoolean>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
output: "json" | "ndjson" | "table" | "raw";
|
|
16
|
+
pretty: boolean;
|
|
17
|
+
silent: boolean;
|
|
18
|
+
}, {
|
|
19
|
+
output?: "json" | "ndjson" | "table" | "raw" | undefined;
|
|
20
|
+
pretty?: boolean | undefined;
|
|
21
|
+
silent?: boolean | undefined;
|
|
22
|
+
}>>;
|
|
23
|
+
http: z.ZodDefault<z.ZodObject<{
|
|
24
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
25
|
+
retries: z.ZodDefault<z.ZodNumber>;
|
|
26
|
+
backoffMs: z.ZodDefault<z.ZodNumber>;
|
|
27
|
+
maxBackoffMs: z.ZodDefault<z.ZodNumber>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
timeoutMs: number;
|
|
30
|
+
retries: number;
|
|
31
|
+
backoffMs: number;
|
|
32
|
+
maxBackoffMs: number;
|
|
33
|
+
}, {
|
|
34
|
+
timeoutMs?: number | undefined;
|
|
35
|
+
retries?: number | undefined;
|
|
36
|
+
backoffMs?: number | undefined;
|
|
37
|
+
maxBackoffMs?: number | undefined;
|
|
38
|
+
}>>;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
env: "dev" | "staging" | "testnet" | "prod";
|
|
41
|
+
outputDefaults: {
|
|
42
|
+
output: "json" | "ndjson" | "table" | "raw";
|
|
43
|
+
pretty: boolean;
|
|
44
|
+
silent: boolean;
|
|
45
|
+
};
|
|
46
|
+
http: {
|
|
47
|
+
timeoutMs: number;
|
|
48
|
+
retries: number;
|
|
49
|
+
backoffMs: number;
|
|
50
|
+
maxBackoffMs: number;
|
|
51
|
+
};
|
|
52
|
+
apiKey?: string | undefined;
|
|
53
|
+
privateKey?: string | undefined;
|
|
54
|
+
subAccountId?: string | undefined;
|
|
55
|
+
accountId?: string | undefined;
|
|
56
|
+
cookie?: string | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
env?: "dev" | "staging" | "testnet" | "prod" | undefined;
|
|
59
|
+
apiKey?: string | undefined;
|
|
60
|
+
privateKey?: string | undefined;
|
|
61
|
+
subAccountId?: string | undefined;
|
|
62
|
+
accountId?: string | undefined;
|
|
63
|
+
cookie?: string | undefined;
|
|
64
|
+
outputDefaults?: {
|
|
65
|
+
output?: "json" | "ndjson" | "table" | "raw" | undefined;
|
|
66
|
+
pretty?: boolean | undefined;
|
|
67
|
+
silent?: boolean | undefined;
|
|
68
|
+
} | undefined;
|
|
69
|
+
http?: {
|
|
70
|
+
timeoutMs?: number | undefined;
|
|
71
|
+
retries?: number | undefined;
|
|
72
|
+
backoffMs?: number | undefined;
|
|
73
|
+
maxBackoffMs?: number | undefined;
|
|
74
|
+
} | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
type GrvtConfig = z.infer<typeof configSchema>;
|
|
77
|
+
|
|
78
|
+
declare const loadConfig: () => GrvtConfig;
|
|
79
|
+
declare const saveConfig: (config: GrvtConfig) => void;
|
|
80
|
+
|
|
81
|
+
type GrvtEnvironment = "dev" | "staging" | "testnet" | "prod";
|
|
82
|
+
declare const ENDPOINTS: {
|
|
83
|
+
readonly auth: {
|
|
84
|
+
readonly login: "/auth/api_key/login";
|
|
85
|
+
};
|
|
86
|
+
readonly marketData: {
|
|
87
|
+
readonly instrument: "/full/v1/instrument";
|
|
88
|
+
readonly allInstruments: "/full/v1/all_instruments";
|
|
89
|
+
readonly instruments: "/full/v1/instruments";
|
|
90
|
+
readonly currency: "/full/v1/currency";
|
|
91
|
+
readonly marginRules: "/full/v1/margin_rules";
|
|
92
|
+
readonly mini: "/full/v1/mini";
|
|
93
|
+
readonly ticker: "/full/v1/ticker";
|
|
94
|
+
readonly tradeHistory: "/full/v1/trade_history";
|
|
95
|
+
readonly kline: "/full/v1/kline";
|
|
96
|
+
readonly funding: "/full/v1/funding";
|
|
97
|
+
readonly book: "/full/v1/book";
|
|
98
|
+
};
|
|
99
|
+
readonly trading: {
|
|
100
|
+
readonly createOrder: "/full/v1/create_order";
|
|
101
|
+
readonly cancelOrder: "/full/v1/cancel_order";
|
|
102
|
+
readonly cancelAllOrders: "/full/v1/cancel_all_orders";
|
|
103
|
+
readonly getOrder: "/full/v1/order";
|
|
104
|
+
readonly openOrders: "/full/v1/open_orders";
|
|
105
|
+
readonly orderHistory: "/full/v1/order_history";
|
|
106
|
+
readonly cancelOnDisconnect: "/full/v1/cancel_on_disconnect";
|
|
107
|
+
readonly fillHistory: "/full/v1/fill_history";
|
|
108
|
+
readonly positions: "/full/v1/positions";
|
|
109
|
+
readonly fundingPaymentHistory: "/full/v1/funding_payment_history";
|
|
110
|
+
readonly getAllInitialLeverage: "/full/v1/get_all_initial_leverage";
|
|
111
|
+
readonly setInitialLeverage: "/full/v1/set_initial_leverage";
|
|
112
|
+
readonly setDeriskMmRatio: "/full/v1/set_derisk_mm_ratio";
|
|
113
|
+
};
|
|
114
|
+
readonly account: {
|
|
115
|
+
readonly accountSummary: "/full/v1/account_summary";
|
|
116
|
+
readonly accountHistory: "/full/v1/account_history";
|
|
117
|
+
readonly fundingAccountSummary: "/full/v1/funding_account_summary";
|
|
118
|
+
readonly aggregatedAccountSummary: "/full/v1/aggregated_account_summary";
|
|
119
|
+
};
|
|
120
|
+
readonly funds: {
|
|
121
|
+
readonly depositHistory: "/full/v1/deposit_history";
|
|
122
|
+
readonly transfer: "/full/v1/transfer";
|
|
123
|
+
readonly transferHistory: "/full/v1/transfer_history";
|
|
124
|
+
readonly withdrawal: "/full/v1/withdrawal";
|
|
125
|
+
readonly withdrawalHistory: "/full/v1/withdrawal_history";
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
interface HttpClientOptions {
|
|
130
|
+
env: GrvtEnvironment;
|
|
131
|
+
cookie?: string;
|
|
132
|
+
accountId?: string;
|
|
133
|
+
timeoutMs?: number;
|
|
134
|
+
retries?: number;
|
|
135
|
+
backoffMs?: number;
|
|
136
|
+
maxBackoffMs?: number;
|
|
137
|
+
}
|
|
138
|
+
interface HttpClient {
|
|
139
|
+
post: <T>(baseType: "edge" | "marketData" | "trading", path: string, body?: unknown) => Promise<T>;
|
|
140
|
+
}
|
|
141
|
+
declare const createHttpClient: (options: HttpClientOptions) => HttpClient;
|
|
142
|
+
|
|
143
|
+
interface LoginOptions {
|
|
144
|
+
apiKey: string;
|
|
145
|
+
env?: GrvtEnvironment;
|
|
146
|
+
privateKey?: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
declare const login: (options: LoginOptions) => Promise<{
|
|
150
|
+
accountId: string;
|
|
151
|
+
env: GrvtEnvironment;
|
|
152
|
+
}>;
|
|
153
|
+
declare const logout: () => void;
|
|
154
|
+
declare const verifySession: () => Promise<{
|
|
155
|
+
valid: boolean;
|
|
156
|
+
env: string;
|
|
157
|
+
accountId?: string;
|
|
158
|
+
}>;
|
|
159
|
+
|
|
160
|
+
type Kind = "PERPETUAL" | "FUTURE" | "CALL" | "PUT";
|
|
161
|
+
type Currency = string;
|
|
162
|
+
type TimeInForce = "GOOD_TILL_TIME" | "IMMEDIATE_OR_CANCEL" | "ALL_OR_NONE" | "FILL_OR_KILL";
|
|
163
|
+
interface OrderLeg {
|
|
164
|
+
instrument: string;
|
|
165
|
+
size: string;
|
|
166
|
+
limit_price?: string;
|
|
167
|
+
is_buying_asset: boolean;
|
|
168
|
+
}
|
|
169
|
+
interface OrderMetadata {
|
|
170
|
+
client_order_id: string;
|
|
171
|
+
create_time?: string;
|
|
172
|
+
}
|
|
173
|
+
interface OrderSignature {
|
|
174
|
+
signer: string;
|
|
175
|
+
r: string;
|
|
176
|
+
s: string;
|
|
177
|
+
v: number;
|
|
178
|
+
expiration: string;
|
|
179
|
+
nonce: number;
|
|
180
|
+
}
|
|
181
|
+
interface SignedOrder {
|
|
182
|
+
sub_account_id: string;
|
|
183
|
+
is_market: boolean;
|
|
184
|
+
time_in_force: TimeInForce;
|
|
185
|
+
post_only: boolean;
|
|
186
|
+
reduce_only: boolean;
|
|
187
|
+
legs: OrderLeg[];
|
|
188
|
+
signature: OrderSignature;
|
|
189
|
+
metadata: OrderMetadata;
|
|
190
|
+
}
|
|
191
|
+
interface CancelOrderRequest {
|
|
192
|
+
sub_account_id: string;
|
|
193
|
+
order_id?: string;
|
|
194
|
+
client_order_id?: string;
|
|
195
|
+
}
|
|
196
|
+
interface CancelAllOrdersRequest {
|
|
197
|
+
sub_account_id: string;
|
|
198
|
+
instrument?: string;
|
|
199
|
+
}
|
|
200
|
+
interface GetOrderRequest {
|
|
201
|
+
sub_account_id: string;
|
|
202
|
+
order_id?: string;
|
|
203
|
+
client_order_id?: string;
|
|
204
|
+
}
|
|
205
|
+
interface GetOpenOrdersRequest {
|
|
206
|
+
sub_account_id: string;
|
|
207
|
+
kind?: Kind[];
|
|
208
|
+
base?: Currency[];
|
|
209
|
+
quote?: Currency[];
|
|
210
|
+
}
|
|
211
|
+
interface PaginatedRequest {
|
|
212
|
+
sub_account_id: string;
|
|
213
|
+
kind?: Kind[];
|
|
214
|
+
base?: Currency[];
|
|
215
|
+
quote?: Currency[];
|
|
216
|
+
start_time?: string;
|
|
217
|
+
end_time?: string;
|
|
218
|
+
limit?: number;
|
|
219
|
+
cursor?: string;
|
|
220
|
+
}
|
|
221
|
+
interface GetPositionsRequest {
|
|
222
|
+
sub_account_id: string;
|
|
223
|
+
kind?: Kind[];
|
|
224
|
+
base?: Currency[];
|
|
225
|
+
quote?: Currency[];
|
|
226
|
+
}
|
|
227
|
+
interface TransferRequest {
|
|
228
|
+
from_sub_account_id: string;
|
|
229
|
+
to_sub_account_id: string;
|
|
230
|
+
currency: string;
|
|
231
|
+
num_tokens: string;
|
|
232
|
+
}
|
|
233
|
+
interface WithdrawalRequest {
|
|
234
|
+
main_account_id: string;
|
|
235
|
+
from_sub_account_id: string;
|
|
236
|
+
to_eth_address: string;
|
|
237
|
+
currency: string;
|
|
238
|
+
num_tokens: string;
|
|
239
|
+
}
|
|
240
|
+
interface HistoryRequest {
|
|
241
|
+
start_time?: string;
|
|
242
|
+
end_time?: string;
|
|
243
|
+
limit?: number;
|
|
244
|
+
cursor?: string;
|
|
245
|
+
}
|
|
246
|
+
interface ApiResponse<T = unknown> {
|
|
247
|
+
result: T;
|
|
248
|
+
next?: string;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
declare const createOrder: (client: HttpClient, order: SignedOrder) => Promise<unknown>;
|
|
252
|
+
declare const cancelOrder: (client: HttpClient, params: CancelOrderRequest) => Promise<unknown>;
|
|
253
|
+
declare const cancelAllOrders: (client: HttpClient, params: CancelAllOrdersRequest) => Promise<unknown>;
|
|
254
|
+
declare const getOrder: (client: HttpClient, params: GetOrderRequest) => Promise<unknown>;
|
|
255
|
+
declare const getOpenOrders: (client: HttpClient, params: GetOpenOrdersRequest) => Promise<unknown>;
|
|
256
|
+
declare const getOrderHistory: (client: HttpClient, params: PaginatedRequest) => Promise<ApiResponse<unknown[]>>;
|
|
257
|
+
|
|
258
|
+
declare const getFillHistory: (client: HttpClient, params: PaginatedRequest) => Promise<ApiResponse<unknown[]>>;
|
|
259
|
+
|
|
260
|
+
declare const getPositions: (client: HttpClient, params: GetPositionsRequest) => Promise<unknown>;
|
|
261
|
+
|
|
262
|
+
declare const getFundingPayments: (client: HttpClient, params: PaginatedRequest) => Promise<ApiResponse<unknown[]>>;
|
|
263
|
+
|
|
264
|
+
declare const getFundingAccountSummary: (client: {
|
|
265
|
+
post: <T>(base: "edge" | "marketData" | "trading", path: string, body?: unknown) => Promise<T>;
|
|
266
|
+
}) => Promise<unknown>;
|
|
267
|
+
declare const getSubAccountSummary: (client: {
|
|
268
|
+
post: <T>(base: "edge" | "marketData" | "trading", path: string, body?: unknown) => Promise<T>;
|
|
269
|
+
}, subAccountId: string) => Promise<unknown>;
|
|
270
|
+
declare const getSubAccountHistory: (client: {
|
|
271
|
+
post: <T>(base: "edge" | "marketData" | "trading", path: string, body?: unknown) => Promise<T>;
|
|
272
|
+
}, subAccountId: string) => Promise<unknown>;
|
|
273
|
+
declare const getAccountHistory: (client: {
|
|
274
|
+
post: <T>(base: "edge" | "marketData" | "trading", path: string, body?: unknown) => Promise<T>;
|
|
275
|
+
}, params: {
|
|
276
|
+
sub_account_id: string;
|
|
277
|
+
start_time?: string;
|
|
278
|
+
end_time?: string;
|
|
279
|
+
limit?: number;
|
|
280
|
+
cursor?: string;
|
|
281
|
+
}) => Promise<ApiResponse<unknown[]>>;
|
|
282
|
+
declare const getAggregatedAccountSummary: (client: {
|
|
283
|
+
post: <T>(base: "edge" | "marketData" | "trading", path: string, body?: unknown) => Promise<T>;
|
|
284
|
+
}) => Promise<unknown>;
|
|
285
|
+
|
|
286
|
+
declare const createDeposit: (_client: HttpClient, _params: unknown) => Promise<unknown>;
|
|
287
|
+
declare const getDepositHistory: (client: HttpClient, params: HistoryRequest) => Promise<ApiResponse<unknown[]>>;
|
|
288
|
+
|
|
289
|
+
declare const createTransfer: (client: HttpClient, params: TransferRequest) => Promise<unknown>;
|
|
290
|
+
declare const getTransferHistory: (client: HttpClient, params: HistoryRequest) => Promise<ApiResponse<unknown[]>>;
|
|
291
|
+
|
|
292
|
+
declare const createWithdrawal: (client: HttpClient, params: WithdrawalRequest) => Promise<unknown>;
|
|
293
|
+
declare const getWithdrawalHistory: (client: HttpClient, params: HistoryRequest) => Promise<ApiResponse<unknown[]>>;
|
|
294
|
+
|
|
295
|
+
type OutputFormat = "json" | "ndjson" | "table" | "raw";
|
|
296
|
+
interface OutputOptions {
|
|
297
|
+
output: OutputFormat;
|
|
298
|
+
pretty?: boolean;
|
|
299
|
+
silent?: boolean;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
interface PaginateOptions<T> {
|
|
303
|
+
fetchPage: (cursor?: string) => Promise<{
|
|
304
|
+
result: T[];
|
|
305
|
+
next?: string;
|
|
306
|
+
}>;
|
|
307
|
+
limit?: number;
|
|
308
|
+
cursor?: string;
|
|
309
|
+
all?: boolean;
|
|
310
|
+
outputOptions: OutputOptions;
|
|
311
|
+
}
|
|
312
|
+
declare const paginateCursor: <T>(options: PaginateOptions<T>) => Promise<T[]>;
|
|
313
|
+
|
|
314
|
+
interface CurrencyDetail {
|
|
315
|
+
id: number;
|
|
316
|
+
symbol: string;
|
|
317
|
+
balance_decimals: number;
|
|
318
|
+
quantity_multiplier: string;
|
|
319
|
+
}
|
|
320
|
+
declare const getCurrencies: (env: GrvtEnvironment, cookie?: string, accountId?: string) => Promise<Record<string, CurrencyDetail>>;
|
|
321
|
+
declare const getCurrencyId: (env: GrvtEnvironment, symbol: string, cookie?: string, accountId?: string) => Promise<number>;
|
|
322
|
+
declare const getCurrencyDecimals: (env: GrvtEnvironment, symbol: string, cookie?: string, accountId?: string) => Promise<number>;
|
|
323
|
+
|
|
324
|
+
interface TransferPayload {
|
|
325
|
+
fromAccount: string;
|
|
326
|
+
fromSubAccount: string;
|
|
327
|
+
toAccount: string;
|
|
328
|
+
toSubAccount: string;
|
|
329
|
+
tokenCurrency: number;
|
|
330
|
+
numTokens: string;
|
|
331
|
+
balanceDecimals: number;
|
|
332
|
+
expiration: string;
|
|
333
|
+
nonce: number;
|
|
334
|
+
}
|
|
335
|
+
declare const buildTransferTypedData: (payload: TransferPayload, env: GrvtEnvironment) => {
|
|
336
|
+
domain: {
|
|
337
|
+
readonly name: "GRVT Exchange";
|
|
338
|
+
readonly version: "0";
|
|
339
|
+
readonly chainId: bigint;
|
|
340
|
+
};
|
|
341
|
+
types: {
|
|
342
|
+
readonly Transfer: readonly [{
|
|
343
|
+
readonly name: "fromAccount";
|
|
344
|
+
readonly type: "address";
|
|
345
|
+
}, {
|
|
346
|
+
readonly name: "fromSubAccount";
|
|
347
|
+
readonly type: "uint64";
|
|
348
|
+
}, {
|
|
349
|
+
readonly name: "toAccount";
|
|
350
|
+
readonly type: "address";
|
|
351
|
+
}, {
|
|
352
|
+
readonly name: "toSubAccount";
|
|
353
|
+
readonly type: "uint64";
|
|
354
|
+
}, {
|
|
355
|
+
readonly name: "tokenCurrency";
|
|
356
|
+
readonly type: "uint8";
|
|
357
|
+
}, {
|
|
358
|
+
readonly name: "numTokens";
|
|
359
|
+
readonly type: "uint64";
|
|
360
|
+
}, {
|
|
361
|
+
readonly name: "nonce";
|
|
362
|
+
readonly type: "uint32";
|
|
363
|
+
}, {
|
|
364
|
+
readonly name: "expiration";
|
|
365
|
+
readonly type: "int64";
|
|
366
|
+
}];
|
|
367
|
+
};
|
|
368
|
+
primaryType: "Transfer";
|
|
369
|
+
message: {
|
|
370
|
+
fromAccount: `0x${string}`;
|
|
371
|
+
fromSubAccount: bigint;
|
|
372
|
+
toAccount: `0x${string}`;
|
|
373
|
+
toSubAccount: bigint;
|
|
374
|
+
tokenCurrency: number;
|
|
375
|
+
numTokens: bigint;
|
|
376
|
+
nonce: number;
|
|
377
|
+
expiration: bigint;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
interface WithdrawalPayload {
|
|
381
|
+
fromAccount: string;
|
|
382
|
+
toEthAddress: string;
|
|
383
|
+
tokenCurrency: number;
|
|
384
|
+
numTokens: string;
|
|
385
|
+
balanceDecimals: number;
|
|
386
|
+
expiration: string;
|
|
387
|
+
nonce: number;
|
|
388
|
+
}
|
|
389
|
+
declare const buildWithdrawalTypedData: (payload: WithdrawalPayload, env: GrvtEnvironment) => {
|
|
390
|
+
domain: {
|
|
391
|
+
readonly name: "GRVT Exchange";
|
|
392
|
+
readonly version: "0";
|
|
393
|
+
readonly chainId: bigint;
|
|
394
|
+
};
|
|
395
|
+
types: {
|
|
396
|
+
readonly Withdrawal: readonly [{
|
|
397
|
+
readonly name: "fromAccount";
|
|
398
|
+
readonly type: "address";
|
|
399
|
+
}, {
|
|
400
|
+
readonly name: "toEthAddress";
|
|
401
|
+
readonly type: "address";
|
|
402
|
+
}, {
|
|
403
|
+
readonly name: "tokenCurrency";
|
|
404
|
+
readonly type: "uint8";
|
|
405
|
+
}, {
|
|
406
|
+
readonly name: "numTokens";
|
|
407
|
+
readonly type: "uint64";
|
|
408
|
+
}, {
|
|
409
|
+
readonly name: "nonce";
|
|
410
|
+
readonly type: "uint32";
|
|
411
|
+
}, {
|
|
412
|
+
readonly name: "expiration";
|
|
413
|
+
readonly type: "int64";
|
|
414
|
+
}];
|
|
415
|
+
};
|
|
416
|
+
primaryType: "Withdrawal";
|
|
417
|
+
message: {
|
|
418
|
+
fromAccount: `0x${string}`;
|
|
419
|
+
toEthAddress: `0x${string}`;
|
|
420
|
+
tokenCurrency: number;
|
|
421
|
+
numTokens: bigint;
|
|
422
|
+
nonce: number;
|
|
423
|
+
expiration: bigint;
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
interface DeriskPayload {
|
|
427
|
+
subAccountId: string;
|
|
428
|
+
ratio: string;
|
|
429
|
+
expiration: string;
|
|
430
|
+
nonce: number;
|
|
431
|
+
}
|
|
432
|
+
declare const buildDeriskTypedData: (payload: DeriskPayload, env: GrvtEnvironment) => {
|
|
433
|
+
domain: {
|
|
434
|
+
readonly name: "GRVT Exchange";
|
|
435
|
+
readonly version: "0";
|
|
436
|
+
readonly chainId: bigint;
|
|
437
|
+
};
|
|
438
|
+
types: {
|
|
439
|
+
readonly SetDeriskMMRatio: readonly [{
|
|
440
|
+
readonly name: "subAccountID";
|
|
441
|
+
readonly type: "uint64";
|
|
442
|
+
}, {
|
|
443
|
+
readonly name: "ratio";
|
|
444
|
+
readonly type: "uint64";
|
|
445
|
+
}, {
|
|
446
|
+
readonly name: "nonce";
|
|
447
|
+
readonly type: "uint32";
|
|
448
|
+
}, {
|
|
449
|
+
readonly name: "expiration";
|
|
450
|
+
readonly type: "int64";
|
|
451
|
+
}];
|
|
452
|
+
};
|
|
453
|
+
primaryType: "SetDeriskMMRatio";
|
|
454
|
+
message: {
|
|
455
|
+
subAccountID: bigint;
|
|
456
|
+
ratio: bigint;
|
|
457
|
+
nonce: number;
|
|
458
|
+
expiration: bigint;
|
|
459
|
+
};
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
export { ENDPOINTS, type GrvtConfig, type GrvtEnvironment, buildDeriskTypedData, buildTransferTypedData, buildWithdrawalTypedData, cancelAllOrders, cancelOrder, configSchema, createDeposit, createHttpClient, createOrder, createTransfer, createWithdrawal, getAccountHistory, getAggregatedAccountSummary, getCurrencies, getCurrencyDecimals, getCurrencyId, getDepositHistory, getFillHistory, getFundingAccountSummary, getFundingPayments, getOpenOrders, getOrder, getOrderHistory, getPositions, getSubAccountHistory, getSubAccountSummary, getTransferHistory, getWithdrawalHistory, loadConfig, login, logout, paginateCursor, saveConfig, verifySession };
|