@n1xyz/nord-ts 0.3.6 → 0.4.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/dist/client/NordUser.d.ts +25 -5
- package/dist/gen/nord_pb.d.ts +59 -96
- package/dist/gen/openapi.d.ts +140 -0
- package/dist/index.browser.js +118 -103
- package/dist/index.common.js +118 -103
- package/package.json +1 -1
- package/dist/actions.js +0 -184
- package/dist/client/Nord.js +0 -759
- package/dist/client/NordAdmin.js +0 -362
- package/dist/client/NordUser.js +0 -752
- package/dist/const.js +0 -27
- package/dist/error.js +0 -51
- package/dist/gen/nord_pb.js +0 -1068
- package/dist/gen/openapi.js +0 -5
- package/dist/index.js +0 -10
- package/dist/nord/api/actions.d.ts +0 -128
- package/dist/nord/api/actions.js +0 -396
- package/dist/nord/api/core.d.ts +0 -16
- package/dist/nord/api/core.js +0 -81
- package/dist/nord/api/metrics.d.ts +0 -67
- package/dist/nord/api/metrics.js +0 -229
- package/dist/nord/api/triggers.d.ts +0 -7
- package/dist/nord/api/triggers.js +0 -38
- package/dist/nord/client/Nord.d.ts +0 -387
- package/dist/nord/client/Nord.js +0 -747
- package/dist/nord/client/NordAdmin.d.ts +0 -226
- package/dist/nord/client/NordAdmin.js +0 -410
- package/dist/nord/client/NordClient.d.ts +0 -16
- package/dist/nord/client/NordClient.js +0 -28
- package/dist/nord/client/NordUser.d.ts +0 -379
- package/dist/nord/client/NordUser.js +0 -787
- package/dist/nord/index.d.ts +0 -8
- package/dist/nord/index.js +0 -34
- package/dist/nord/models/Subscriber.d.ts +0 -37
- package/dist/nord/models/Subscriber.js +0 -25
- package/dist/nord/utils/NordError.d.ts +0 -35
- package/dist/nord/utils/NordError.js +0 -49
- package/dist/types.js +0 -92
- package/dist/utils.js +0 -193
- package/dist/websocket/NordWebSocketClient.js +0 -242
- package/dist/websocket/Subscriber.js +0 -24
- package/dist/websocket/events.js +0 -1
- package/dist/websocket/index.js +0 -80
|
@@ -291,20 +291,27 @@ export declare class NordUser {
|
|
|
291
291
|
* @param side - Order side for the trigger
|
|
292
292
|
* @param kind - Stop-loss or take-profit trigger type
|
|
293
293
|
* @param triggerPrice - Price that activates the trigger
|
|
294
|
-
* @param limitPrice -
|
|
294
|
+
* @param limitPrice - Optional limit price used once the trigger fires
|
|
295
|
+
* @param limitBaseSize - Optional base size limit used once the trigger fires
|
|
296
|
+
* @param limitQuoteSize - Optional quote size limit used once the trigger fires
|
|
295
297
|
* @param accountId - Account executing the trigger
|
|
296
298
|
* @returns Object containing the actionId of the submitted trigger
|
|
297
299
|
* @throws {NordError} If the operation fails
|
|
298
300
|
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
+
* Trigger identity is exact: (marketId, side, kind, triggerPrice, limits).
|
|
302
|
+
* If you add multiple triggers at the same triggerPrice, they must differ by limits.
|
|
303
|
+
* If both `limitBaseSize` and `limitQuoteSize` are omitted, trigger executes with max reduce size
|
|
304
|
+
*
|
|
305
|
+
* Max triggers per position: 16
|
|
301
306
|
*/
|
|
302
|
-
addTrigger({ marketId, side, kind, triggerPrice, limitPrice, accountId, }: Readonly<{
|
|
307
|
+
addTrigger({ marketId, side, kind, triggerPrice, limitPrice, limitBaseSize, limitQuoteSize, accountId, }: Readonly<{
|
|
303
308
|
marketId: number;
|
|
304
309
|
side: Side;
|
|
305
310
|
kind: TriggerKind;
|
|
306
311
|
triggerPrice: Decimal.Value;
|
|
307
312
|
limitPrice?: Decimal.Value;
|
|
313
|
+
limitBaseSize?: Decimal.Value;
|
|
314
|
+
limitQuoteSize?: Decimal.Value;
|
|
308
315
|
accountId?: number;
|
|
309
316
|
}>): Promise<{
|
|
310
317
|
actionId: bigint;
|
|
@@ -316,15 +323,26 @@ export declare class NordUser {
|
|
|
316
323
|
* @param side - Order side for the trigger
|
|
317
324
|
* @param kind - Stop-loss or take-profit trigger type
|
|
318
325
|
* @param triggerPrice - Trigger price of the trigger to remove
|
|
326
|
+
* @param limitPrice - Optional limit price of the trigger to remove
|
|
327
|
+
* @param limitBaseSize - Optional base size limit of the trigger to remove
|
|
328
|
+
* @param limitQuoteSize - Optional quote size limit of the trigger to remove
|
|
319
329
|
* @param accountId - Account executing the trigger
|
|
320
330
|
* @returns Object containing the actionId of the removal action
|
|
321
331
|
* @throws {NordError} If the operation fails
|
|
332
|
+
*
|
|
333
|
+
* Removal is exact-match by (marketId, side, kind, triggerPrice, limits).
|
|
334
|
+
* If the trigger was created with any limits, pass the same limit fields here.
|
|
335
|
+
* If trigger size limits were omitted (`NULL`) on add, keep `limitBaseSize` and `limitQuoteSize`
|
|
336
|
+
* omitted here as well.
|
|
322
337
|
*/
|
|
323
|
-
removeTrigger({ marketId, side, kind, triggerPrice, accountId, }: Readonly<{
|
|
338
|
+
removeTrigger({ marketId, side, kind, triggerPrice, limitPrice, limitBaseSize, limitQuoteSize, accountId, }: Readonly<{
|
|
324
339
|
marketId: number;
|
|
325
340
|
side: Side;
|
|
326
341
|
kind: TriggerKind;
|
|
327
342
|
triggerPrice: Decimal.Value;
|
|
343
|
+
limitPrice?: Decimal.Value;
|
|
344
|
+
limitBaseSize?: Decimal.Value;
|
|
345
|
+
limitQuoteSize?: Decimal.Value;
|
|
328
346
|
accountId?: number;
|
|
329
347
|
}>): Promise<{
|
|
330
348
|
actionId: bigint;
|
|
@@ -425,4 +443,6 @@ export declare class NordUser {
|
|
|
425
443
|
};
|
|
426
444
|
}>;
|
|
427
445
|
protected submitSignedAction(kind: proto.Action["kind"], makeSignedMessage: (message: Uint8Array) => Promise<Uint8Array>): Promise<proto.Receipt>;
|
|
446
|
+
private buildTriggerKey;
|
|
447
|
+
private buildLimits;
|
|
428
448
|
}
|
package/dist/gen/nord_pb.d.ts
CHANGED
|
@@ -510,39 +510,6 @@ export type AtomicJson = {
|
|
|
510
510
|
export declare const AtomicSchema: GenMessage<Atomic, {
|
|
511
511
|
jsonType: AtomicJson;
|
|
512
512
|
}>;
|
|
513
|
-
/**
|
|
514
|
-
* @generated from message nord.TriggerPrices
|
|
515
|
-
*/
|
|
516
|
-
export type TriggerPrices = Message<"nord.TriggerPrices"> & {
|
|
517
|
-
/**
|
|
518
|
-
* @generated from field: uint64 trigger_price = 1;
|
|
519
|
-
*/
|
|
520
|
-
triggerPrice: bigint;
|
|
521
|
-
/**
|
|
522
|
-
* @generated from field: optional uint64 limit_price = 2;
|
|
523
|
-
*/
|
|
524
|
-
limitPrice?: bigint;
|
|
525
|
-
};
|
|
526
|
-
/**
|
|
527
|
-
* @generated from message nord.TriggerPrices
|
|
528
|
-
*/
|
|
529
|
-
export type TriggerPricesJson = {
|
|
530
|
-
/**
|
|
531
|
-
* @generated from field: uint64 trigger_price = 1;
|
|
532
|
-
*/
|
|
533
|
-
triggerPrice?: string;
|
|
534
|
-
/**
|
|
535
|
-
* @generated from field: optional uint64 limit_price = 2;
|
|
536
|
-
*/
|
|
537
|
-
limitPrice?: string;
|
|
538
|
-
};
|
|
539
|
-
/**
|
|
540
|
-
* Describes the message nord.TriggerPrices.
|
|
541
|
-
* Use `create(TriggerPricesSchema)` to create a new message.
|
|
542
|
-
*/
|
|
543
|
-
export declare const TriggerPricesSchema: GenMessage<TriggerPrices, {
|
|
544
|
-
jsonType: TriggerPricesJson;
|
|
545
|
-
}>;
|
|
546
513
|
/**
|
|
547
514
|
* @generated from message nord.TriggerRecord
|
|
548
515
|
*/
|
|
@@ -552,13 +519,20 @@ export type TriggerRecord = Message<"nord.TriggerRecord"> & {
|
|
|
552
519
|
*/
|
|
553
520
|
key?: TriggerKey;
|
|
554
521
|
/**
|
|
555
|
-
* @generated from field:
|
|
522
|
+
* @generated from field: uint64 trigger_price = 2;
|
|
556
523
|
*/
|
|
557
|
-
|
|
524
|
+
triggerPrice: bigint;
|
|
558
525
|
/**
|
|
559
526
|
* @generated from field: uint32 market_id = 3;
|
|
560
527
|
*/
|
|
561
528
|
marketId: number;
|
|
529
|
+
/**
|
|
530
|
+
* Optional execution limits for delegated trigger order.
|
|
531
|
+
* If both `size` and `quote_size` are omitted, engine executes with max reduce size.
|
|
532
|
+
*
|
|
533
|
+
* @generated from field: nord.OrderLimit limits = 4;
|
|
534
|
+
*/
|
|
535
|
+
limits?: OrderLimit;
|
|
562
536
|
};
|
|
563
537
|
/**
|
|
564
538
|
* @generated from message nord.TriggerRecord
|
|
@@ -569,13 +543,20 @@ export type TriggerRecordJson = {
|
|
|
569
543
|
*/
|
|
570
544
|
key?: TriggerKeyJson;
|
|
571
545
|
/**
|
|
572
|
-
* @generated from field:
|
|
546
|
+
* @generated from field: uint64 trigger_price = 2;
|
|
573
547
|
*/
|
|
574
|
-
|
|
548
|
+
triggerPrice?: string;
|
|
575
549
|
/**
|
|
576
550
|
* @generated from field: uint32 market_id = 3;
|
|
577
551
|
*/
|
|
578
552
|
marketId?: number;
|
|
553
|
+
/**
|
|
554
|
+
* Optional execution limits for delegated trigger order.
|
|
555
|
+
* If both `size` and `quote_size` are omitted, engine executes with max reduce size.
|
|
556
|
+
*
|
|
557
|
+
* @generated from field: nord.OrderLimit limits = 4;
|
|
558
|
+
*/
|
|
559
|
+
limits?: OrderLimitJson;
|
|
579
560
|
};
|
|
580
561
|
/**
|
|
581
562
|
* Describes the message nord.TriggerRecord.
|
|
@@ -1273,33 +1254,12 @@ export type Action_PlaceOrder = Message<"nord.Action.PlaceOrder"> & {
|
|
|
1273
1254
|
*/
|
|
1274
1255
|
isReduceOnly: boolean;
|
|
1275
1256
|
/**
|
|
1276
|
-
*
|
|
1277
|
-
*
|
|
1278
|
-
* When used in token balances and reward computations, shifted by market's
|
|
1279
|
-
* `price_decimals`. Optional, treated as not set if 0.
|
|
1257
|
+
* Optional execution limits.
|
|
1258
|
+
* Must include at least one of: price, size, quote_size.
|
|
1280
1259
|
*
|
|
1281
|
-
* @generated from field:
|
|
1260
|
+
* @generated from field: nord.OrderLimit limits = 6;
|
|
1282
1261
|
*/
|
|
1283
|
-
|
|
1284
|
-
/**
|
|
1285
|
-
* Raw integral value of order size limit.
|
|
1286
|
-
* For spot markers measured in base size,
|
|
1287
|
-
* for perpetuals in contract token.
|
|
1288
|
-
* So using base as default naming in codebase.
|
|
1289
|
-
* `1` here equals to market's `10^-size_decimals`
|
|
1290
|
-
* When used in token balances and reward computations, shifted by market's
|
|
1291
|
-
* `size_decimals`. Optional, treated as not set if 0.
|
|
1292
|
-
*
|
|
1293
|
-
* @generated from field: uint64 size = 7;
|
|
1294
|
-
*/
|
|
1295
|
-
size: bigint;
|
|
1296
|
-
/**
|
|
1297
|
-
* Quote size limit aggregated in `price_decimals + size_decimals`.
|
|
1298
|
-
* Optional.
|
|
1299
|
-
*
|
|
1300
|
-
* @generated from field: nord.U128 quote_size = 8;
|
|
1301
|
-
*/
|
|
1302
|
-
quoteSize?: U128;
|
|
1262
|
+
limits?: OrderLimit;
|
|
1303
1263
|
/**
|
|
1304
1264
|
* Optional account on behalf of whom the order should be placed.
|
|
1305
1265
|
* Executed only if sender has delegated authority to do so,
|
|
@@ -1382,33 +1342,12 @@ export type Action_PlaceOrderJson = {
|
|
|
1382
1342
|
*/
|
|
1383
1343
|
isReduceOnly?: boolean;
|
|
1384
1344
|
/**
|
|
1385
|
-
*
|
|
1386
|
-
*
|
|
1387
|
-
* When used in token balances and reward computations, shifted by market's
|
|
1388
|
-
* `price_decimals`. Optional, treated as not set if 0.
|
|
1345
|
+
* Optional execution limits.
|
|
1346
|
+
* Must include at least one of: price, size, quote_size.
|
|
1389
1347
|
*
|
|
1390
|
-
* @generated from field:
|
|
1391
|
-
*/
|
|
1392
|
-
price?: string;
|
|
1393
|
-
/**
|
|
1394
|
-
* Raw integral value of order size limit.
|
|
1395
|
-
* For spot markers measured in base size,
|
|
1396
|
-
* for perpetuals in contract token.
|
|
1397
|
-
* So using base as default naming in codebase.
|
|
1398
|
-
* `1` here equals to market's `10^-size_decimals`
|
|
1399
|
-
* When used in token balances and reward computations, shifted by market's
|
|
1400
|
-
* `size_decimals`. Optional, treated as not set if 0.
|
|
1401
|
-
*
|
|
1402
|
-
* @generated from field: uint64 size = 7;
|
|
1403
|
-
*/
|
|
1404
|
-
size?: string;
|
|
1405
|
-
/**
|
|
1406
|
-
* Quote size limit aggregated in `price_decimals + size_decimals`.
|
|
1407
|
-
* Optional.
|
|
1408
|
-
*
|
|
1409
|
-
* @generated from field: nord.U128 quote_size = 8;
|
|
1348
|
+
* @generated from field: nord.OrderLimit limits = 6;
|
|
1410
1349
|
*/
|
|
1411
|
-
|
|
1350
|
+
limits?: OrderLimitJson;
|
|
1412
1351
|
/**
|
|
1413
1352
|
* Optional account on behalf of whom the order should be placed.
|
|
1414
1353
|
* Executed only if sender has delegated authority to do so,
|
|
@@ -2239,6 +2178,13 @@ export type Action_RemoveTrigger = Message<"nord.Action.RemoveTrigger"> & {
|
|
|
2239
2178
|
* @generated from field: nord.Intent intent = 5;
|
|
2240
2179
|
*/
|
|
2241
2180
|
intent: Intent;
|
|
2181
|
+
/**
|
|
2182
|
+
* Exact-match removal: pass the same limit fields as on add-trigger.
|
|
2183
|
+
* If trigger was added without size limits (NULL in history), keep them omitted here too.
|
|
2184
|
+
*
|
|
2185
|
+
* @generated from field: optional nord.OrderLimit limits = 6;
|
|
2186
|
+
*/
|
|
2187
|
+
limits?: OrderLimit;
|
|
2242
2188
|
/**
|
|
2243
2189
|
* @generated from field: optional uint32 account_id = 10;
|
|
2244
2190
|
*/
|
|
@@ -2268,6 +2214,13 @@ export type Action_RemoveTriggerJson = {
|
|
|
2268
2214
|
* @generated from field: nord.Intent intent = 5;
|
|
2269
2215
|
*/
|
|
2270
2216
|
intent?: IntentJson;
|
|
2217
|
+
/**
|
|
2218
|
+
* Exact-match removal: pass the same limit fields as on add-trigger.
|
|
2219
|
+
* If trigger was added without size limits (NULL in history), keep them omitted here too.
|
|
2220
|
+
*
|
|
2221
|
+
* @generated from field: optional nord.OrderLimit limits = 6;
|
|
2222
|
+
*/
|
|
2223
|
+
limits?: OrderLimitJson;
|
|
2271
2224
|
/**
|
|
2272
2225
|
* @generated from field: optional uint32 account_id = 10;
|
|
2273
2226
|
*/
|
|
@@ -2564,9 +2517,9 @@ export declare const Action_ExecuteTriggerSchema: GenMessage<Action_ExecuteTrigg
|
|
|
2564
2517
|
*/
|
|
2565
2518
|
export type Action_ExecuteTrigger_Trigger = Message<"nord.Action.ExecuteTrigger.Trigger"> & {
|
|
2566
2519
|
/**
|
|
2567
|
-
* @generated from field: uint64
|
|
2520
|
+
* @generated from field: uint64 trigger_price = 1;
|
|
2568
2521
|
*/
|
|
2569
|
-
|
|
2522
|
+
triggerPrice: bigint;
|
|
2570
2523
|
/**
|
|
2571
2524
|
* @generated from field: nord.TriggerKind kind = 2;
|
|
2572
2525
|
*/
|
|
@@ -2576,9 +2529,12 @@ export type Action_ExecuteTrigger_Trigger = Message<"nord.Action.ExecuteTrigger.
|
|
|
2576
2529
|
*/
|
|
2577
2530
|
side: Side;
|
|
2578
2531
|
/**
|
|
2579
|
-
*
|
|
2532
|
+
* Optional limits used during delegated execution.
|
|
2533
|
+
* If both `size` and `quote_size` are omitted, engine applies max reduce size.
|
|
2534
|
+
*
|
|
2535
|
+
* @generated from field: nord.OrderLimit limits = 4;
|
|
2580
2536
|
*/
|
|
2581
|
-
|
|
2537
|
+
limits?: OrderLimit;
|
|
2582
2538
|
/**
|
|
2583
2539
|
* @generated from field: nord.Intent intent = 5;
|
|
2584
2540
|
*/
|
|
@@ -2589,9 +2545,9 @@ export type Action_ExecuteTrigger_Trigger = Message<"nord.Action.ExecuteTrigger.
|
|
|
2589
2545
|
*/
|
|
2590
2546
|
export type Action_ExecuteTrigger_TriggerJson = {
|
|
2591
2547
|
/**
|
|
2592
|
-
* @generated from field: uint64
|
|
2548
|
+
* @generated from field: uint64 trigger_price = 1;
|
|
2593
2549
|
*/
|
|
2594
|
-
|
|
2550
|
+
triggerPrice?: string;
|
|
2595
2551
|
/**
|
|
2596
2552
|
* @generated from field: nord.TriggerKind kind = 2;
|
|
2597
2553
|
*/
|
|
@@ -2601,9 +2557,12 @@ export type Action_ExecuteTrigger_TriggerJson = {
|
|
|
2601
2557
|
*/
|
|
2602
2558
|
side?: SideJson;
|
|
2603
2559
|
/**
|
|
2604
|
-
*
|
|
2560
|
+
* Optional limits used during delegated execution.
|
|
2561
|
+
* If both `size` and `quote_size` are omitted, engine applies max reduce size.
|
|
2562
|
+
*
|
|
2563
|
+
* @generated from field: nord.OrderLimit limits = 4;
|
|
2605
2564
|
*/
|
|
2606
|
-
|
|
2565
|
+
limits?: OrderLimitJson;
|
|
2607
2566
|
/**
|
|
2608
2567
|
* @generated from field: nord.Intent intent = 5;
|
|
2609
2568
|
*/
|
|
@@ -4961,6 +4920,10 @@ export declare enum Error {
|
|
|
4961
4920
|
* @generated from enum value: TRIGGER_MAX_SIZE_PLACEMENT_EXCEEDED = 172;
|
|
4962
4921
|
*/
|
|
4963
4922
|
TRIGGER_MAX_SIZE_PLACEMENT_EXCEEDED = 172,
|
|
4923
|
+
/**
|
|
4924
|
+
* @generated from enum value: TRIGGER_ALREADY_EXISTS = 173;
|
|
4925
|
+
*/
|
|
4926
|
+
TRIGGER_ALREADY_EXISTS = 173,
|
|
4964
4927
|
/**
|
|
4965
4928
|
* 10110_000
|
|
4966
4929
|
* Prefix which says that timestamp used as part of action is is not allowed
|
|
@@ -5271,7 +5234,7 @@ export declare enum Error {
|
|
|
5271
5234
|
*
|
|
5272
5235
|
* @generated from enum nord.Error
|
|
5273
5236
|
*/
|
|
5274
|
-
export type ErrorJson = "DUPLICATE" | "INVALID_SIGNATURE" | "MARKET_NOT_FOUND" | "TOKEN_NOT_FOUND" | "USER_NOT_FOUND" | "SESSION_NOT_FOUND" | "ORDER_NOT_FOUND" | "ORDER_SIZE_ZERO" | "ARITHMETIC" | "ARITHMETIC_OVERFLOW" | "ARITHMETIC_UNDERFLOW" | "ARITHMETIC_DIVISION_BY_ZERO" | "KEY_ALREADY_REGISTERED" | "UPDATE_TIMESTAMP_IN_PAST" | "TOO_MANY_OPEN_ORDERS" | "WITHDRAW_AMOUNT_TOO_SMALL" | "INVALID_ORDER_OWNER" | "DECODE_FAILURE" | "DECODE_FAILURE_LENGTH_PREFIX" | "DECODE_FAILURE_RAW" | "DECODE_FAILURE_DOMAIN" | "UPDATE_PUBLISH_TIME_IN_PAST" | "PYTH_FEED_NOT_ADDED" | "PYTH_FEED_MISSING" | "PYTH_FEED_ALREADY_ADDED" | "PYTH_GUARDIAN_SET_UNINITIALIZED" | "PYTH_GUARDIAN_SET_INVALID" | "PYTH_FEED_DECIMALS_OUT_OF_RANGE" | "PYTH_FEED_PRICE_OUT_OF_RANGE" | "PYTH_FEED_VARIANCE_OUT_OF_RANGE" | "PYTH_GUARDIAN_SET_AND_PYTH_SIGNATURE_DO_NOT_MATCH" | "INVALID_TOKEN_PARAMETERS" | "INDEX_PRICE_OUT_OF_RANGE" | "INDEX_DECIMALS_OUT_OF_RANGE" | "INVALID_STATE_VERSION" | "TIER_FEE_OUT_OF_RANGE" | "TIER_ID_OUT_OF_RANGE" | "INVALID_MARGINS" | "MARKET_DECIMALS_EXCEED_LIMITS" | "TOO_MANY_TOKENS" | "FUNDING_OVERFLOW" | "CAN_REDUCE_POSITION_ONLY_IF_ALL_ORDERS_ARE_CANCELED" | "UNEXPECTED_TOKEN_ID" | "REPEATED_ORDER_ID" | "CLIENT_ORDER_ID_TOO_LARGE" | "TOKEN_NOT_READY" | "TOKEN_ALREADY_REGISTERED" | "IMMEDIATE_ORDER_GOT_NO_FILLS" | "FAILED_TO_FILL_LIMIT" | "POST_ONLY_MUST_NOT_FILL_ANY_OPPOSITE_ORDERS" | "INVALID" | "MAINTENANCE" | "MINIMUM_SIZE_DECIMALS" | "PARAMETERS_WILL_CREATE_NON_OPERATIONAL_MARKET" | "ONLY_IMMEDIATE_ORDERS_ALLOWED" | "TOO_MANY_USER_ACCOUNTS" | "ACCOUNT_NOT_FOUND" | "ACCOUNT_INVALID_OWNER" | "DUST_ACCOUNT" | "BALANCE" | "BALANCE_DEPOSIT_OVERFLOW" | "BALANCE_CHANGE_OVERFLOW" | "BALANCE_CHANGE_LIMIT_EXCEEDED" | "BALANCE_INSUFFICIENT" | "UNAUTHENTICATED_L1_ACTION" | "ENCODED_ACTION_TOO_LARGE" | "TRIGGER" | "TRIGGER_INVALID_PRICE" | "TRIGGER_NOT_FOUND" | "TRIGGER_ONLY_DECREASE_ORDERS_SUPPORTED" | "TRIGGER_MAX_SIZE_PLACEMENT_EXCEEDED" | "TIMESTAMP" | "TIMESTAMP_OUT_OF_THRESHOLD" | "TIMESTAMP_STALE" | "EXPIRY_TIMESTAMP_IN_PAST" | "BANKRUPTCY_INSUFFICIENT_COVERAGE" | "BANKRUPTCY_NOT_FOUND" | "BANKRUPTCY_NOT_ALLOWED" | "MARKET_NOT_READY" | "MARKET_FROZEN" | "MARKET_EMPTY" | "POSITION" | "POSITION_NOT_FOUND" | "POSITION_STATE_ORDER" | "POSITION_STATE_ORDER_PRICE" | "POSITION_STATE_ORDER_SIZE" | "POSITION_STATE_ORDER_SIDE" | "POSITION_SIZE_LIMIT" | "POSITION_STATE_PERP" | "POSITION_STATE_ORDER_DELEGATION" | "PRICE" | "SIGNATURE_VERIFICATION" | "SIGNATURE_VERIFICATION_MALFORMED_PUBLIC_KEY" | "SIGNATURE_VERIFICATION_INVALID_LENGTH" | "RISK" | "RISK_DELEGATION_MF_TO_BE_LESS_THAN_OR_EQUAL_MMF" | "RISK_OMF_LESS_THAN_OR_EQUAL_IMF" | "RISK_OMF_LESS_THAN_OR_EQUAL_CMF" | "RISK_TRADE_OMF_LESS_THAN_OR_EQUAL_CMF" | "RISK_UNHEALTHY_MF_AND_PON_AFTER_BETTER_OF_BEFORE" | "ORDER_EXECUTION" | "ORDER_EXECUTION_EMPTY" | "ORDER_EXECUTION_FILL_OR_KILL" | "ORDER_EXECUTION_MISSING_LIMITS" | "ORDER_EXECUTION_MISSING_PRICE" | "ORDER_EXECUTION_SIZE_LIMIT" | "ORDER_EXECUTION_LIMIT_PRICE" | "ORDER_REDUCE_IS_POST_ONLY" | "ORDER_EXECUTION_SELL_PRICE" | "ORDER_SIZE_EXCEEDS_POSITION_SIZE" | "ATOMICS" | "ATOMICS_TRADES_CANNOT_FOLLOW_PLACES" | "ATOMICS_CANCELS_CANNOT_FOLLOW_TRADES_PLACES" | "ACTION_POSITION_SHOULD_BE_COVERED" | "ACTION_INVALID_NONCE" | "ACTION_PROPOSED_PRICE_MUST_BE_HIGHER" | "ADMIN_ROLE_INSUFFICIENT" | "ADMIN_NOT_FOUND" | "UNIQUE_SUPER_ADMIN_CANNOT_BE_REMOVED" | "SUPER_ADMIN_ALREADY_EXISTS" | "TRANSFER" | "TRANSFER_TO_UNOWNED_ACCOUNT_IS_PROHIBITED" | "TRANSFER_TO_OWNED_ACCOUNT_WAS_REQUESTED" | "NOT_IMPLEMENTED" | "ACTION_NOT_ALLOWED" | "DROPPED";
|
|
5237
|
+
export type ErrorJson = "DUPLICATE" | "INVALID_SIGNATURE" | "MARKET_NOT_FOUND" | "TOKEN_NOT_FOUND" | "USER_NOT_FOUND" | "SESSION_NOT_FOUND" | "ORDER_NOT_FOUND" | "ORDER_SIZE_ZERO" | "ARITHMETIC" | "ARITHMETIC_OVERFLOW" | "ARITHMETIC_UNDERFLOW" | "ARITHMETIC_DIVISION_BY_ZERO" | "KEY_ALREADY_REGISTERED" | "UPDATE_TIMESTAMP_IN_PAST" | "TOO_MANY_OPEN_ORDERS" | "WITHDRAW_AMOUNT_TOO_SMALL" | "INVALID_ORDER_OWNER" | "DECODE_FAILURE" | "DECODE_FAILURE_LENGTH_PREFIX" | "DECODE_FAILURE_RAW" | "DECODE_FAILURE_DOMAIN" | "UPDATE_PUBLISH_TIME_IN_PAST" | "PYTH_FEED_NOT_ADDED" | "PYTH_FEED_MISSING" | "PYTH_FEED_ALREADY_ADDED" | "PYTH_GUARDIAN_SET_UNINITIALIZED" | "PYTH_GUARDIAN_SET_INVALID" | "PYTH_FEED_DECIMALS_OUT_OF_RANGE" | "PYTH_FEED_PRICE_OUT_OF_RANGE" | "PYTH_FEED_VARIANCE_OUT_OF_RANGE" | "PYTH_GUARDIAN_SET_AND_PYTH_SIGNATURE_DO_NOT_MATCH" | "INVALID_TOKEN_PARAMETERS" | "INDEX_PRICE_OUT_OF_RANGE" | "INDEX_DECIMALS_OUT_OF_RANGE" | "INVALID_STATE_VERSION" | "TIER_FEE_OUT_OF_RANGE" | "TIER_ID_OUT_OF_RANGE" | "INVALID_MARGINS" | "MARKET_DECIMALS_EXCEED_LIMITS" | "TOO_MANY_TOKENS" | "FUNDING_OVERFLOW" | "CAN_REDUCE_POSITION_ONLY_IF_ALL_ORDERS_ARE_CANCELED" | "UNEXPECTED_TOKEN_ID" | "REPEATED_ORDER_ID" | "CLIENT_ORDER_ID_TOO_LARGE" | "TOKEN_NOT_READY" | "TOKEN_ALREADY_REGISTERED" | "IMMEDIATE_ORDER_GOT_NO_FILLS" | "FAILED_TO_FILL_LIMIT" | "POST_ONLY_MUST_NOT_FILL_ANY_OPPOSITE_ORDERS" | "INVALID" | "MAINTENANCE" | "MINIMUM_SIZE_DECIMALS" | "PARAMETERS_WILL_CREATE_NON_OPERATIONAL_MARKET" | "ONLY_IMMEDIATE_ORDERS_ALLOWED" | "TOO_MANY_USER_ACCOUNTS" | "ACCOUNT_NOT_FOUND" | "ACCOUNT_INVALID_OWNER" | "DUST_ACCOUNT" | "BALANCE" | "BALANCE_DEPOSIT_OVERFLOW" | "BALANCE_CHANGE_OVERFLOW" | "BALANCE_CHANGE_LIMIT_EXCEEDED" | "BALANCE_INSUFFICIENT" | "UNAUTHENTICATED_L1_ACTION" | "ENCODED_ACTION_TOO_LARGE" | "TRIGGER" | "TRIGGER_INVALID_PRICE" | "TRIGGER_NOT_FOUND" | "TRIGGER_ONLY_DECREASE_ORDERS_SUPPORTED" | "TRIGGER_MAX_SIZE_PLACEMENT_EXCEEDED" | "TRIGGER_ALREADY_EXISTS" | "TIMESTAMP" | "TIMESTAMP_OUT_OF_THRESHOLD" | "TIMESTAMP_STALE" | "EXPIRY_TIMESTAMP_IN_PAST" | "BANKRUPTCY_INSUFFICIENT_COVERAGE" | "BANKRUPTCY_NOT_FOUND" | "BANKRUPTCY_NOT_ALLOWED" | "MARKET_NOT_READY" | "MARKET_FROZEN" | "MARKET_EMPTY" | "POSITION" | "POSITION_NOT_FOUND" | "POSITION_STATE_ORDER" | "POSITION_STATE_ORDER_PRICE" | "POSITION_STATE_ORDER_SIZE" | "POSITION_STATE_ORDER_SIDE" | "POSITION_SIZE_LIMIT" | "POSITION_STATE_PERP" | "POSITION_STATE_ORDER_DELEGATION" | "PRICE" | "SIGNATURE_VERIFICATION" | "SIGNATURE_VERIFICATION_MALFORMED_PUBLIC_KEY" | "SIGNATURE_VERIFICATION_INVALID_LENGTH" | "RISK" | "RISK_DELEGATION_MF_TO_BE_LESS_THAN_OR_EQUAL_MMF" | "RISK_OMF_LESS_THAN_OR_EQUAL_IMF" | "RISK_OMF_LESS_THAN_OR_EQUAL_CMF" | "RISK_TRADE_OMF_LESS_THAN_OR_EQUAL_CMF" | "RISK_UNHEALTHY_MF_AND_PON_AFTER_BETTER_OF_BEFORE" | "ORDER_EXECUTION" | "ORDER_EXECUTION_EMPTY" | "ORDER_EXECUTION_FILL_OR_KILL" | "ORDER_EXECUTION_MISSING_LIMITS" | "ORDER_EXECUTION_MISSING_PRICE" | "ORDER_EXECUTION_SIZE_LIMIT" | "ORDER_EXECUTION_LIMIT_PRICE" | "ORDER_REDUCE_IS_POST_ONLY" | "ORDER_EXECUTION_SELL_PRICE" | "ORDER_SIZE_EXCEEDS_POSITION_SIZE" | "ATOMICS" | "ATOMICS_TRADES_CANNOT_FOLLOW_PLACES" | "ATOMICS_CANCELS_CANNOT_FOLLOW_TRADES_PLACES" | "ACTION_POSITION_SHOULD_BE_COVERED" | "ACTION_INVALID_NONCE" | "ACTION_PROPOSED_PRICE_MUST_BE_HIGHER" | "ADMIN_ROLE_INSUFFICIENT" | "ADMIN_NOT_FOUND" | "UNIQUE_SUPER_ADMIN_CANNOT_BE_REMOVED" | "SUPER_ADMIN_ALREADY_EXISTS" | "TRANSFER" | "TRANSFER_TO_UNOWNED_ACCOUNT_IS_PROHIBITED" | "TRANSFER_TO_OWNED_ACCOUNT_WAS_REQUESTED" | "NOT_IMPLEMENTED" | "ACTION_NOT_ALLOWED" | "DROPPED";
|
|
5275
5238
|
/**
|
|
5276
5239
|
* Describes the enum nord.Error.
|
|
5277
5240
|
*/
|
package/dist/gen/openapi.d.ts
CHANGED
|
@@ -1669,6 +1669,105 @@ export interface paths {
|
|
|
1669
1669
|
patch?: never;
|
|
1670
1670
|
trace?: never;
|
|
1671
1671
|
};
|
|
1672
|
+
"/account/{account_id}/history/transfer": {
|
|
1673
|
+
parameters: {
|
|
1674
|
+
query?: never;
|
|
1675
|
+
header?: never;
|
|
1676
|
+
path?: never;
|
|
1677
|
+
cookie?: never;
|
|
1678
|
+
};
|
|
1679
|
+
/** @description Fetch full history of transfers for an account (both sent and received). */
|
|
1680
|
+
get: {
|
|
1681
|
+
parameters: {
|
|
1682
|
+
query?: {
|
|
1683
|
+
/** @description start with this timestamp (RFC3339); defaults to UNIX epoch start */
|
|
1684
|
+
since?: string;
|
|
1685
|
+
/** @description end with this timestamp (RFC3339); defaults to current date-time */
|
|
1686
|
+
until?: string;
|
|
1687
|
+
/** @description fetch results starting with this page; query starts with first entry if page isn't specified */
|
|
1688
|
+
startInclusive?: number | null;
|
|
1689
|
+
/** @description Query returns up to 50 trades in one go. */
|
|
1690
|
+
pageSize?: number | null;
|
|
1691
|
+
};
|
|
1692
|
+
header?: never;
|
|
1693
|
+
path: {
|
|
1694
|
+
/** @description Account ID for which to fetch transfer history. */
|
|
1695
|
+
account_id: number;
|
|
1696
|
+
};
|
|
1697
|
+
cookie?: never;
|
|
1698
|
+
};
|
|
1699
|
+
requestBody?: never;
|
|
1700
|
+
responses: {
|
|
1701
|
+
200: {
|
|
1702
|
+
headers: {
|
|
1703
|
+
[name: string]: unknown;
|
|
1704
|
+
};
|
|
1705
|
+
content: {
|
|
1706
|
+
"application/json": components["schemas"]["PageResult_for_uint64_and_Transfer"];
|
|
1707
|
+
};
|
|
1708
|
+
};
|
|
1709
|
+
404: {
|
|
1710
|
+
headers: {
|
|
1711
|
+
[name: string]: unknown;
|
|
1712
|
+
};
|
|
1713
|
+
content: {
|
|
1714
|
+
"application/json": components["schemas"]["UserNotFound"];
|
|
1715
|
+
};
|
|
1716
|
+
};
|
|
1717
|
+
};
|
|
1718
|
+
};
|
|
1719
|
+
put?: never;
|
|
1720
|
+
post?: never;
|
|
1721
|
+
delete?: never;
|
|
1722
|
+
options?: never;
|
|
1723
|
+
head?: never;
|
|
1724
|
+
patch?: never;
|
|
1725
|
+
trace?: never;
|
|
1726
|
+
};
|
|
1727
|
+
"/account/system/history/transfer": {
|
|
1728
|
+
parameters: {
|
|
1729
|
+
query?: never;
|
|
1730
|
+
header?: never;
|
|
1731
|
+
path?: never;
|
|
1732
|
+
cookie?: never;
|
|
1733
|
+
};
|
|
1734
|
+
/** @description Fetch full history of transfers involving the fee vault. */
|
|
1735
|
+
get: {
|
|
1736
|
+
parameters: {
|
|
1737
|
+
query?: {
|
|
1738
|
+
/** @description start with this timestamp (RFC3339); defaults to UNIX epoch start */
|
|
1739
|
+
since?: string;
|
|
1740
|
+
/** @description end with this timestamp (RFC3339); defaults to current date-time */
|
|
1741
|
+
until?: string;
|
|
1742
|
+
/** @description fetch results starting with this page; query starts with first entry if page isn't specified */
|
|
1743
|
+
startInclusive?: number | null;
|
|
1744
|
+
/** @description Query returns up to 50 trades in one go. */
|
|
1745
|
+
pageSize?: number | null;
|
|
1746
|
+
};
|
|
1747
|
+
header?: never;
|
|
1748
|
+
path?: never;
|
|
1749
|
+
cookie?: never;
|
|
1750
|
+
};
|
|
1751
|
+
requestBody?: never;
|
|
1752
|
+
responses: {
|
|
1753
|
+
200: {
|
|
1754
|
+
headers: {
|
|
1755
|
+
[name: string]: unknown;
|
|
1756
|
+
};
|
|
1757
|
+
content: {
|
|
1758
|
+
"application/json": components["schemas"]["PageResult_for_uint64_and_Transfer"];
|
|
1759
|
+
};
|
|
1760
|
+
};
|
|
1761
|
+
};
|
|
1762
|
+
};
|
|
1763
|
+
put?: never;
|
|
1764
|
+
post?: never;
|
|
1765
|
+
delete?: never;
|
|
1766
|
+
options?: never;
|
|
1767
|
+
head?: never;
|
|
1768
|
+
patch?: never;
|
|
1769
|
+
trace?: never;
|
|
1770
|
+
};
|
|
1672
1771
|
"/account/{account_id}/history/liquidation": {
|
|
1673
1772
|
parameters: {
|
|
1674
1773
|
query?: never;
|
|
@@ -3191,6 +3290,10 @@ export interface components {
|
|
|
3191
3290
|
marketId: number;
|
|
3192
3291
|
triggerPrice: components["schemas"]["PositivePriceMantissa"];
|
|
3193
3292
|
limitPrice?: components["schemas"]["PositivePriceMantissa"] | null;
|
|
3293
|
+
/** Format: uint64 */
|
|
3294
|
+
limitBaseSize?: number | null;
|
|
3295
|
+
/** Format: uint128 */
|
|
3296
|
+
limitQuoteSize?: number | null;
|
|
3194
3297
|
side: components["schemas"]["Side"];
|
|
3195
3298
|
kind: components["schemas"]["TriggerKind"];
|
|
3196
3299
|
intent: components["schemas"]["Intent"];
|
|
@@ -3224,6 +3327,10 @@ export interface components {
|
|
|
3224
3327
|
marketId: number;
|
|
3225
3328
|
triggerPrice: components["schemas"]["PositivePriceMantissa"];
|
|
3226
3329
|
limitPrice?: components["schemas"]["PositivePriceMantissa"] | null;
|
|
3330
|
+
/** Format: uint64 */
|
|
3331
|
+
limitBaseSize?: number | null;
|
|
3332
|
+
/** Format: uint128 */
|
|
3333
|
+
limitQuoteSize?: number | null;
|
|
3227
3334
|
side: components["schemas"]["Side"];
|
|
3228
3335
|
kind: components["schemas"]["TriggerKind"];
|
|
3229
3336
|
intent: components["schemas"]["Intent"];
|
|
@@ -3475,6 +3582,39 @@ export interface components {
|
|
|
3475
3582
|
/** Format: uint64 */
|
|
3476
3583
|
eventIndex: number;
|
|
3477
3584
|
};
|
|
3585
|
+
PageResult_for_uint64_and_Transfer: {
|
|
3586
|
+
/** @description Set of items for requested by query. */
|
|
3587
|
+
items: components["schemas"]["Transfer"][];
|
|
3588
|
+
/**
|
|
3589
|
+
* Format: uint64
|
|
3590
|
+
* @description If request contains more data, this is the id is set with which next request should be performed to get next page. If no more data, then it is undefined.
|
|
3591
|
+
*/
|
|
3592
|
+
nextStartInclusive?: number | null;
|
|
3593
|
+
};
|
|
3594
|
+
Transfer: {
|
|
3595
|
+
time: string;
|
|
3596
|
+
/** Format: uint64 */
|
|
3597
|
+
actionId: number;
|
|
3598
|
+
/**
|
|
3599
|
+
* Format: uint16
|
|
3600
|
+
* @description Transfer index within the action. Always `0` today since a single action produces at most one transfer; reserved for future multi-transfer scenarios (atomics, liquidations).
|
|
3601
|
+
*/
|
|
3602
|
+
idx: number;
|
|
3603
|
+
/**
|
|
3604
|
+
* Format: uint32
|
|
3605
|
+
* @description `None` when the origin is the fee vault (`FeeVaultTransferred` action).
|
|
3606
|
+
*/
|
|
3607
|
+
fromAccountId?: number | null;
|
|
3608
|
+
/**
|
|
3609
|
+
* Format: uint32
|
|
3610
|
+
* @description `None` when the destination is the fee vault (`Transfer` with `AccountRef::Special`).
|
|
3611
|
+
*/
|
|
3612
|
+
toAccountId?: number | null;
|
|
3613
|
+
/** Format: uint32 */
|
|
3614
|
+
tokenId: number;
|
|
3615
|
+
/** Format: uint64 */
|
|
3616
|
+
amount: number;
|
|
3617
|
+
};
|
|
3478
3618
|
PageResult_for_uint64_and_LiquidationInfo: {
|
|
3479
3619
|
/** @description Set of items for requested by query. */
|
|
3480
3620
|
items: components["schemas"]["LiquidationInfo"][];
|