@n1xyz/nord-ts 0.5.0 → 0.5.1

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/actions.d.ts CHANGED
@@ -2,7 +2,7 @@ import Decimal from "decimal.js";
2
2
  import * as proto from "./gen/nord_pb";
3
3
  import { paths } from "./gen/openapi";
4
4
  import { Client } from "openapi-fetch";
5
- import { FillMode, Side } from "./types";
5
+ import { FillMode, Side, TriggerKind } from "./types";
6
6
  import { BigIntValue } from "./utils";
7
7
  import { PublicKey, Transaction } from "@solana/web3.js";
8
8
  type ReceiptKind = NonNullable<proto.Receipt["kind"]>;
@@ -13,6 +13,7 @@ export declare function formatReceiptError(receipt: proto.Receipt): string;
13
13
  export declare function expectReceiptKind<K extends ReceiptKind["case"]>(receipt: proto.Receipt, expected: K, action: string): asserts receipt is proto.Receipt & {
14
14
  kind: ExtractReceiptKind<K>;
15
15
  };
16
+ export declare function buildLimits(marketPriceDecimals: number, marketSizeDecimals: number, limitPrice?: Decimal.Value, limitBaseSize?: Decimal.Value, limitQuoteSize?: Decimal.Value): proto.OrderLimit | undefined;
16
17
  export declare function createAction(currentTimestamp: bigint, nonce: number, kind: proto.Action["kind"]): proto.Action;
17
18
  export declare function sendAction(client: Client<paths>, makeSignedMessage: (message: Uint8Array) => Promise<Uint8Array>, action: proto.Action): Promise<proto.Receipt>;
18
19
  export declare function prepareAction(action: proto.Action, makeSignedMessage: (message: Uint8Array) => Promise<Uint8Array>): Promise<Uint8Array<ArrayBufferLike>>;
@@ -62,6 +63,33 @@ export type AtomicSubaction = {
62
63
  kind: "cancelByClientId";
63
64
  clientOrderId: BigIntValue;
64
65
  delegatorAccountId?: number;
66
+ } | {
67
+ kind: "addTrigger";
68
+ marketId: number;
69
+ side: Side;
70
+ triggerKind: TriggerKind;
71
+ triggerPrice: Decimal.Value;
72
+ priceDecimals: number;
73
+ sizeDecimals: number;
74
+ limitPrice?: Decimal.Value;
75
+ limitBaseSize?: Decimal.Value;
76
+ limitQuoteSize?: Decimal.Value;
77
+ } | {
78
+ kind: "editTrigger";
79
+ triggerId: BigIntValue;
80
+ marketId: number;
81
+ side: Side;
82
+ triggerKind: TriggerKind;
83
+ triggerPrice: Decimal.Value;
84
+ priceDecimals: number;
85
+ sizeDecimals: number;
86
+ limitPrice?: Decimal.Value;
87
+ limitBaseSize?: Decimal.Value;
88
+ limitQuoteSize?: Decimal.Value;
89
+ } | {
90
+ kind: "removeTrigger";
91
+ marketId: number;
92
+ triggerId: BigIntValue;
65
93
  };
66
94
  export declare function atomic(client: Client<paths>, signFn: (message: Uint8Array) => Promise<Uint8Array>, currentTimestamp: bigint, nonce: number, params: {
67
95
  sessionId: BigIntValue;
@@ -3,7 +3,7 @@ import { Connection, PublicKey } from "@solana/web3.js";
3
3
  import { EventEmitter } from "events";
4
4
  import { Client } from "openapi-fetch";
5
5
  import type { paths } from "../gen/openapi.ts";
6
- import { Account, AccountPnlInfoPage, AccountPositionInfoPage, AccountPnlSummaryResult, GetAccountPnlQuery, PagedQuery, ActionResponse, MarketsInfo, Market, MarketStats, NordConfig, OrderbookQuery, OrderbookResponse, FeeTierConfig, Token, TradesResponse, User, AccountTriggerInfo, TriggerPlaceHistoryPage, TriggerFinaliseHistoryPage, WithdrawalHistoryPage, FeeTierId, AccountFeeTierPage, PageResultStringOrderInfo, PageResultStringTrade, OrderInfoFromApi, TokenStats, FillRole, AdminInfo, AccountVolumeInfo, GetAccountVolumeQuery, CandleResolution, TakeAllInfo, MarketsLiveInfo, MarketLiveInfo } from "../types";
6
+ import { Account, AccountPnlInfoPage, AccountPositionInfoPage, AccountPnlSummaryResult, AtomicActionId, GetAccountPnlQuery, PagedQuery, ActionResponse, MarketsInfo, Market, MarketStats, NordConfig, OrderbookQuery, OrderbookResponse, FeeTierConfig, Token, TradesResponse, User, AccountTriggerInfo, TriggerPlaceHistoryPage, TriggerFinaliseHistoryPage, WithdrawalHistoryPage, FeeTierId, AccountFeeTierPage, PageResultStringOrderInfo, PageResultStringTrade, OrderInfoFromApi, TokenStats, FillRole, AdminInfo, AccountVolumeInfo, GetAccountVolumeQuery, CandleResolution, TakeAllInfo, MarketsLiveInfo, MarketLiveInfo } from "../types";
7
7
  import { NordWebSocketClient } from "../websocket/index";
8
8
  import { OrderbookSubscription, TradeSubscription, CandleSubscription } from "../websocket/Subscriber";
9
9
  /**
@@ -425,8 +425,9 @@ export declare class Nord {
425
425
  * @param startInclusive - Pagination cursor to resume from
426
426
  * @throws {NordError} If no account can be resolved or the request fails.
427
427
  */
428
- getAccountTriggerPlaceHistory({ accountId, since, until, pageSize, startInclusive, }: Readonly<PagedQuery & {
428
+ getAccountTriggerPlaceHistory({ accountId, since, until, pageSize, startInclusive, }: Readonly<Omit<PagedQuery, "startInclusive"> & {
429
429
  accountId?: number;
430
+ startInclusive?: AtomicActionId;
430
431
  }>): Promise<TriggerPlaceHistoryPage>;
431
432
  /**
432
433
  * Fetch trigger finalisation history for an account.
@@ -1,36 +1,52 @@
1
1
  import { PublicKey, Transaction, SendOptions } from "@solana/web3.js";
2
2
  import Decimal from "decimal.js";
3
- import { FillMode, Side, SPLTokenInfo, TriggerKind } from "../types";
3
+ import { FillMode, Side, SPLTokenInfo, TriggerKind, SelfTradePrevention } from "../types";
4
4
  import * as proto from "../gen/nord_pb";
5
5
  import { BigIntValue } from "../utils";
6
6
  import { Nord } from "./Nord";
7
- /**
8
- * Parameters for individual atomic subactions (user-friendly version)
9
- */
10
- export interface UserAtomicSubaction {
11
- /** The type of action to perform. */
12
- kind: "place" | "cancel" | "cancelByClientId";
13
- /** The market ID to place the order in. */
14
- marketId?: number;
15
- /** The order ID to cancel. */
16
- orderId?: BigIntValue;
17
- /** Order side (bid or ask) */
18
- side?: Side;
19
- /** Fill mode (limit, market, etc.) */
20
- fillMode?: FillMode;
21
- /** Whether the order is reduce-only. */
22
- isReduceOnly?: boolean;
23
- /** The size of the order. */
7
+ export type UserAtomicSubaction = {
8
+ kind: "place";
9
+ marketId: number;
10
+ side: Side;
11
+ fillMode: FillMode;
12
+ isReduceOnly: boolean;
24
13
  size?: Decimal.Value;
25
- /** Order price */
26
14
  price?: Decimal.Value;
27
- /** Quote size in `base_decimals` + `price_decimals` (for market-style placement) */
28
15
  quoteSize?: Decimal.Value;
29
- /** The client order ID of the order. */
30
16
  clientOrderId?: BigIntValue;
31
- /** Optional account to delegate this subaction to. */
32
17
  delegatorAccountId?: number;
33
- }
18
+ } | {
19
+ kind: "cancel";
20
+ orderId: BigIntValue;
21
+ delegatorAccountId?: number;
22
+ } | {
23
+ kind: "cancelByClientId";
24
+ clientOrderId: BigIntValue;
25
+ delegatorAccountId?: number;
26
+ } | {
27
+ kind: "addTrigger";
28
+ marketId: number;
29
+ side: Side;
30
+ triggerKind: TriggerKind;
31
+ triggerPrice: Decimal.Value;
32
+ limitPrice?: Decimal.Value;
33
+ limitBaseSize?: Decimal.Value;
34
+ limitQuoteSize?: Decimal.Value;
35
+ } | {
36
+ kind: "editTrigger";
37
+ triggerId: BigIntValue;
38
+ marketId: number;
39
+ side: Side;
40
+ triggerKind: TriggerKind;
41
+ triggerPrice: Decimal.Value;
42
+ limitPrice?: Decimal.Value;
43
+ limitBaseSize?: Decimal.Value;
44
+ limitQuoteSize?: Decimal.Value;
45
+ } | {
46
+ kind: "removeTrigger";
47
+ marketId: number;
48
+ triggerId: BigIntValue;
49
+ };
34
50
  export interface NormalizedReceiptTrade {
35
51
  orderId: bigint;
36
52
  price: number;
@@ -261,7 +277,7 @@ export declare class NordUser {
261
277
  * @returns Object containing actionId, orderId (if posted), fills, and reducedOrders (reduce-only orders fully or partially cancelled by maintenance)
262
278
  * @throws {NordError} If the operation fails
263
279
  */
264
- placeOrder({ marketId, side, fillMode, isReduceOnly, size, price, quoteSize, accountId, clientOrderId, }: Readonly<{
280
+ placeOrder({ marketId, side, fillMode, isReduceOnly, size, price, quoteSize, selfTradePrevention, accountId, clientOrderId, }: Readonly<{
265
281
  marketId: number;
266
282
  side: Side;
267
283
  fillMode: FillMode;
@@ -269,6 +285,7 @@ export declare class NordUser {
269
285
  size?: Decimal.Value;
270
286
  price?: Decimal.Value;
271
287
  quoteSize?: Decimal.Value;
288
+ selfTradePrevention?: SelfTradePrevention;
272
289
  accountId?: number;
273
290
  clientOrderId?: BigIntValue;
274
291
  }>): Promise<{
@@ -281,6 +298,12 @@ export declare class NordUser {
281
298
  cancelledSize: number;
282
299
  price: number;
283
300
  }[];
301
+ selfTradeCancels: {
302
+ orderId: bigint;
303
+ remainingSize: number;
304
+ cancelledSize: number;
305
+ price: number;
306
+ }[];
284
307
  }>;
285
308
  /**
286
309
  * Cancel an order
@@ -440,13 +463,25 @@ export declare class NordUser {
440
463
  */
441
464
  private transferToAccount;
442
465
  /**
443
- * Execute up to four place/cancel operations atomically.
444
- * Per Market:
445
- * 1. cancels can only be in the start (one cannot predict future order ids)
466
+ * Execute up to ten supported subactions atomically.
467
+ *
468
+ * Supported subactions:
469
+ * - place
470
+ * - cancel
471
+ * - cancelByClientId
472
+ * - addTrigger
473
+ * - editTrigger
474
+ * - removeTrigger
475
+ *
476
+ * Per market, market-scoped subactions are phase-validated:
477
+ * 1. cancels and trigger removals can only be at the start
446
478
  * 2. intermediate trades can trade only
447
- * 3. placements go last
479
+ * 3. placements and trigger adds/edits go last
480
+ *
481
+ * Across markets, market-scoped subactions can be in any order.
448
482
  *
449
- * Across Markets, order action can be any
483
+ * Trigger subactions are account-scoped. In one atomic sequence, the same
484
+ * trigger target cannot be added, edited, or removed more than once.
450
485
  *
451
486
  * @param userActions array of user-friendly subactions
452
487
  * @param providedAccountId optional account performing the action (defaults to first account)
@@ -489,5 +524,4 @@ export declare class NordUser {
489
524
  };
490
525
  }>;
491
526
  protected submitSignedAction(kind: proto.Action["kind"], makeSignedMessage: (message: Uint8Array) => Promise<Uint8Array>): Promise<proto.Receipt>;
492
- private buildLimits;
493
527
  }
@@ -433,6 +433,105 @@ export type AtomicCancelOrderByClientIdJson = {
433
433
  export declare const AtomicCancelOrderByClientIdSchema: GenMessage<AtomicCancelOrderByClientId, {
434
434
  jsonType: AtomicCancelOrderByClientIdJson;
435
435
  }>;
436
+ /**
437
+ * @generated from message nord.AtomicAddTrigger
438
+ */
439
+ export type AtomicAddTrigger = Message<"nord.AtomicAddTrigger"> & {
440
+ /**
441
+ * @generated from field: nord.TriggerRecord trigger = 1;
442
+ */
443
+ trigger?: TriggerRecord;
444
+ /**
445
+ * @generated from field: nord.Intent intent = 2;
446
+ */
447
+ intent: Intent;
448
+ };
449
+ /**
450
+ * @generated from message nord.AtomicAddTrigger
451
+ */
452
+ export type AtomicAddTriggerJson = {
453
+ /**
454
+ * @generated from field: nord.TriggerRecord trigger = 1;
455
+ */
456
+ trigger?: TriggerRecordJson;
457
+ /**
458
+ * @generated from field: nord.Intent intent = 2;
459
+ */
460
+ intent?: IntentJson;
461
+ };
462
+ /**
463
+ * Describes the message nord.AtomicAddTrigger.
464
+ * Use `create(AtomicAddTriggerSchema)` to create a new message.
465
+ */
466
+ export declare const AtomicAddTriggerSchema: GenMessage<AtomicAddTrigger, {
467
+ jsonType: AtomicAddTriggerJson;
468
+ }>;
469
+ /**
470
+ * @generated from message nord.AtomicEditTrigger
471
+ */
472
+ export type AtomicEditTrigger = Message<"nord.AtomicEditTrigger"> & {
473
+ /**
474
+ * @generated from field: uint64 trigger_id = 1;
475
+ */
476
+ triggerId: bigint;
477
+ /**
478
+ * @generated from field: nord.TriggerRecord new_trigger = 2;
479
+ */
480
+ newTrigger?: TriggerRecord;
481
+ };
482
+ /**
483
+ * @generated from message nord.AtomicEditTrigger
484
+ */
485
+ export type AtomicEditTriggerJson = {
486
+ /**
487
+ * @generated from field: uint64 trigger_id = 1;
488
+ */
489
+ triggerId?: string;
490
+ /**
491
+ * @generated from field: nord.TriggerRecord new_trigger = 2;
492
+ */
493
+ newTrigger?: TriggerRecordJson;
494
+ };
495
+ /**
496
+ * Describes the message nord.AtomicEditTrigger.
497
+ * Use `create(AtomicEditTriggerSchema)` to create a new message.
498
+ */
499
+ export declare const AtomicEditTriggerSchema: GenMessage<AtomicEditTrigger, {
500
+ jsonType: AtomicEditTriggerJson;
501
+ }>;
502
+ /**
503
+ * @generated from message nord.AtomicRemoveTrigger
504
+ */
505
+ export type AtomicRemoveTrigger = Message<"nord.AtomicRemoveTrigger"> & {
506
+ /**
507
+ * @generated from field: uint32 market_id = 1;
508
+ */
509
+ marketId: number;
510
+ /**
511
+ * @generated from field: uint64 trigger_id = 2;
512
+ */
513
+ triggerId: bigint;
514
+ };
515
+ /**
516
+ * @generated from message nord.AtomicRemoveTrigger
517
+ */
518
+ export type AtomicRemoveTriggerJson = {
519
+ /**
520
+ * @generated from field: uint32 market_id = 1;
521
+ */
522
+ marketId?: number;
523
+ /**
524
+ * @generated from field: uint64 trigger_id = 2;
525
+ */
526
+ triggerId?: string;
527
+ };
528
+ /**
529
+ * Describes the message nord.AtomicRemoveTrigger.
530
+ * Use `create(AtomicRemoveTriggerSchema)` to create a new message.
531
+ */
532
+ export declare const AtomicRemoveTriggerSchema: GenMessage<AtomicRemoveTrigger, {
533
+ jsonType: AtomicRemoveTriggerJson;
534
+ }>;
436
535
  /**
437
536
  * @generated from message nord.AtomicSubactionKindV1
438
537
  * @deprecated
@@ -575,6 +674,24 @@ export type AtomicSubaction = Message<"nord.AtomicSubaction"> & {
575
674
  */
576
675
  value: AtomicCancelOrderByClientId;
577
676
  case: "cancelOrderByClientId";
677
+ } | {
678
+ /**
679
+ * @generated from field: nord.AtomicAddTrigger add_trigger = 9;
680
+ */
681
+ value: AtomicAddTrigger;
682
+ case: "addTrigger";
683
+ } | {
684
+ /**
685
+ * @generated from field: nord.AtomicEditTrigger edit_trigger = 10;
686
+ */
687
+ value: AtomicEditTrigger;
688
+ case: "editTrigger";
689
+ } | {
690
+ /**
691
+ * @generated from field: nord.AtomicRemoveTrigger remove_trigger = 11;
692
+ */
693
+ value: AtomicRemoveTrigger;
694
+ case: "removeTrigger";
578
695
  } | {
579
696
  case: undefined;
580
697
  value?: undefined;
@@ -603,6 +720,18 @@ export type AtomicSubactionJson = {
603
720
  * @generated from field: nord.AtomicCancelOrderByClientId cancel_order_by_client_id = 8;
604
721
  */
605
722
  cancelOrderByClientId?: AtomicCancelOrderByClientIdJson;
723
+ /**
724
+ * @generated from field: nord.AtomicAddTrigger add_trigger = 9;
725
+ */
726
+ addTrigger?: AtomicAddTriggerJson;
727
+ /**
728
+ * @generated from field: nord.AtomicEditTrigger edit_trigger = 10;
729
+ */
730
+ editTrigger?: AtomicEditTriggerJson;
731
+ /**
732
+ * @generated from field: nord.AtomicRemoveTrigger remove_trigger = 11;
733
+ */
734
+ removeTrigger?: AtomicRemoveTriggerJson;
606
735
  };
607
736
  /**
608
737
  * Describes the message nord.AtomicSubaction.
@@ -802,7 +931,7 @@ export declare const TriggerSchema: GenMessage<Trigger, {
802
931
  */
803
932
  export type Action = Message<"nord.Action"> & {
804
933
  /**
805
- * Must be within 60s of the engine's current logical time, which
934
+ * Must be within seconds of the engine's current logical time, which
806
935
  * should be within a few seconds of real time.
807
936
  *
808
937
  * Ignored for the `PythPriceFeedUpdate` action as that action updates
@@ -1017,7 +1146,7 @@ export type Action = Message<"nord.Action"> & {
1017
1146
  */
1018
1147
  export type ActionJson = {
1019
1148
  /**
1020
- * Must be within 60s of the engine's current logical time, which
1149
+ * Must be within seconds of the engine's current logical time, which
1021
1150
  * should be within a few seconds of real time.
1022
1151
  *
1023
1152
  * Ignored for the `PythPriceFeedUpdate` action as that action updates
@@ -4820,6 +4949,24 @@ export type Receipt_AtomicSubactionResultKind = Message<"nord.Receipt.AtomicSuba
4820
4949
  */
4821
4950
  value: Receipt_CancelOrderResult;
4822
4951
  case: "cancelOrder";
4952
+ } | {
4953
+ /**
4954
+ * @generated from field: nord.Receipt.TriggerAdded trigger_added = 3;
4955
+ */
4956
+ value: Receipt_TriggerAdded;
4957
+ case: "triggerAdded";
4958
+ } | {
4959
+ /**
4960
+ * @generated from field: nord.Receipt.TriggerRemoved trigger_removed = 4;
4961
+ */
4962
+ value: Receipt_TriggerRemoved;
4963
+ case: "triggerRemoved";
4964
+ } | {
4965
+ /**
4966
+ * @generated from field: nord.Receipt.TriggerEdited trigger_edited = 5;
4967
+ */
4968
+ value: Receipt_TriggerEdited;
4969
+ case: "triggerEdited";
4823
4970
  } | {
4824
4971
  case: undefined;
4825
4972
  value?: undefined;
@@ -4841,6 +4988,18 @@ export type Receipt_AtomicSubactionResultKindJson = {
4841
4988
  * @generated from field: nord.Receipt.CancelOrderResult cancel_order = 2;
4842
4989
  */
4843
4990
  cancelOrder?: Receipt_CancelOrderResultJson;
4991
+ /**
4992
+ * @generated from field: nord.Receipt.TriggerAdded trigger_added = 3;
4993
+ */
4994
+ triggerAdded?: Receipt_TriggerAddedJson;
4995
+ /**
4996
+ * @generated from field: nord.Receipt.TriggerRemoved trigger_removed = 4;
4997
+ */
4998
+ triggerRemoved?: Receipt_TriggerRemovedJson;
4999
+ /**
5000
+ * @generated from field: nord.Receipt.TriggerEdited trigger_edited = 5;
5001
+ */
5002
+ triggerEdited?: Receipt_TriggerEditedJson;
4844
5003
  };
4845
5004
  /**
4846
5005
  * Describes the message nord.Receipt.AtomicSubactionResultKind.
@@ -5074,6 +5233,8 @@ export declare const SpecialAccountSchema: GenEnum<SpecialAccount, SpecialAccoun
5074
5233
  */
5075
5234
  export declare enum Error {
5076
5235
  /**
5236
+ * Action was attempted to be replayed and rejected
5237
+ *
5077
5238
  * @generated from enum value: DUPLICATE = 0;
5078
5239
  */
5079
5240
  DUPLICATE = 0,
@@ -5363,6 +5524,10 @@ export declare enum Error {
5363
5524
  * @generated from enum value: ACCOUNT_INVALID_OWNER = 143;
5364
5525
  */
5365
5526
  ACCOUNT_INVALID_OWNER = 143,
5527
+ /**
5528
+ * @generated from enum value: SUBACTION_OUT_OF_RANGE = 144;
5529
+ */
5530
+ SUBACTION_OUT_OF_RANGE = 144,
5366
5531
  /**
5367
5532
  * Operation cannot be made on account because to small amount will be
5368
5533
  * retained on account
@@ -5729,6 +5894,18 @@ export declare enum Error {
5729
5894
  * @generated from enum value: SUPER_ADMIN_ALREADY_EXISTS = 279;
5730
5895
  */
5731
5896
  SUPER_ADMIN_ALREADY_EXISTS = 279,
5897
+ /**
5898
+ * @generated from enum value: TRIGGER_CONFLICT = 280;
5899
+ */
5900
+ TRIGGER_CONFLICT = 280,
5901
+ /**
5902
+ * @generated from enum value: TRIGGER_EDIT_CONFLICT = 281;
5903
+ */
5904
+ TRIGGER_EDIT_CONFLICT = 281,
5905
+ /**
5906
+ * @generated from enum value: TRIGGER_REMOVE_CONFLICT = 282;
5907
+ */
5908
+ TRIGGER_REMOVE_CONFLICT = 282,
5732
5909
  /**
5733
5910
  * 10010_000
5734
5911
  *
@@ -5770,7 +5947,7 @@ export declare enum Error {
5770
5947
  *
5771
5948
  * @generated from enum nord.Error
5772
5949
  */
5773
- 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" | "SOURCE_AND_TARGET_SHOULD_NOT_BE_EQUAL" | "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" | "INVALID_MARGINS" | "MARKET_DECIMALS_EXCEED_LIMITS" | "TOO_MANY_TOKENS" | "TIER" | "TIER_FEE_OUT_OF_RANGE" | "TIER_ID_OUT_OF_RANGE" | "TIER_NOT_FOUND" | "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_NOT_CHANGED" | "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_UNHEALTHY_MF_AND_PON_AFTER_BETTER_OF_BEFORE" | "RISK_TRADE_OMF_LESS_THAN_OR_EQUAL_CMF" | "RISK_NOT_ENOUGH" | "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" | "ATOMICS_DUPLICATE_CANCEL" | "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";
5950
+ 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" | "SOURCE_AND_TARGET_SHOULD_NOT_BE_EQUAL" | "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" | "INVALID_MARGINS" | "MARKET_DECIMALS_EXCEED_LIMITS" | "TOO_MANY_TOKENS" | "TIER" | "TIER_FEE_OUT_OF_RANGE" | "TIER_ID_OUT_OF_RANGE" | "TIER_NOT_FOUND" | "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" | "SUBACTION_OUT_OF_RANGE" | "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_NOT_CHANGED" | "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_UNHEALTHY_MF_AND_PON_AFTER_BETTER_OF_BEFORE" | "RISK_TRADE_OMF_LESS_THAN_OR_EQUAL_CMF" | "RISK_NOT_ENOUGH" | "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" | "ATOMICS_DUPLICATE_CANCEL" | "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" | "TRIGGER_CONFLICT" | "TRIGGER_EDIT_CONFLICT" | "TRIGGER_REMOVE_CONFLICT" | "TRANSFER" | "TRANSFER_TO_UNOWNED_ACCOUNT_IS_PROHIBITED" | "TRANSFER_TO_OWNED_ACCOUNT_WAS_REQUESTED" | "NOT_IMPLEMENTED" | "ACTION_NOT_ALLOWED" | "DROPPED";
5774
5951
  /**
5775
5952
  * Describes the enum nord.Error.
5776
5953
  */
@@ -1201,7 +1201,7 @@ export interface paths {
1201
1201
  /** @description end with this timestamp (RFC3339); defaults to current date-time */
1202
1202
  until?: string;
1203
1203
  /** @description fetch results starting with this page; query starts with first entry if page isn't specified */
1204
- startInclusive?: number | null;
1204
+ startInclusive?: components["schemas"]["AtomicActionId"] | null;
1205
1205
  /** @description Query returns up to 50 trades in one go. */
1206
1206
  pageSize?: number | null;
1207
1207
  };
@@ -1218,7 +1218,15 @@ export interface paths {
1218
1218
  [name: string]: unknown;
1219
1219
  };
1220
1220
  content: {
1221
- "application/json": components["schemas"]["PageResult_for_uint64_and_PlaceTrigger"];
1221
+ "application/json": components["schemas"]["PageResult_for_AtomicActionId_and_PlaceTrigger"];
1222
+ };
1223
+ };
1224
+ 400: {
1225
+ headers: {
1226
+ [name: string]: unknown;
1227
+ };
1228
+ content: {
1229
+ "application/json": components["schemas"]["BadRequest"];
1222
1230
  };
1223
1231
  };
1224
1232
  };
@@ -3920,7 +3928,7 @@ export interface components {
3920
3928
  };
3921
3929
  /** Format: uint32 */
3922
3930
  FeeTierId: number;
3923
- PagedQuery: {
3931
+ GetAccountTriggerPlaceHistoryQuery: {
3924
3932
  /**
3925
3933
  * @description start with this timestamp (RFC3339); defaults to UNIX epoch start
3926
3934
  * @default null
@@ -3931,11 +3939,8 @@ export interface components {
3931
3939
  * @default null
3932
3940
  */
3933
3941
  until: string;
3934
- /**
3935
- * Format: uint64
3936
- * @description fetch results starting with this page; query starts with first entry if page isn't specified
3937
- */
3938
- startInclusive?: number | null;
3942
+ /** @description fetch results starting with this page; query starts with first entry if page isn't specified */
3943
+ startInclusive?: components["schemas"]["AtomicActionId"] | null;
3939
3944
  /**
3940
3945
  * Format: uint8
3941
3946
  * @description Query returns up to 50 trades in one go.
@@ -3943,14 +3948,17 @@ export interface components {
3943
3948
  */
3944
3949
  pageSize: number | null;
3945
3950
  };
3946
- PageResult_for_uint64_and_PlaceTrigger: {
3951
+ AtomicActionId: {
3952
+ /** Format: uint64 */
3953
+ action_id: number;
3954
+ /** Format: uint8 */
3955
+ sub_action_id: number;
3956
+ };
3957
+ PageResult_for_AtomicActionId_and_PlaceTrigger: {
3947
3958
  /** @description Set of items for requested by query. */
3948
3959
  items: components["schemas"]["PlaceTrigger"][];
3949
- /**
3950
- * Format: uint64
3951
- * @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.
3952
- */
3953
- nextStartInclusive?: number | null;
3960
+ /** @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. */
3961
+ nextStartInclusive?: components["schemas"]["AtomicActionId"] | null;
3954
3962
  };
3955
3963
  PlaceTrigger: {
3956
3964
  time: string;
@@ -3960,6 +3968,8 @@ export interface components {
3960
3968
  accountId: number;
3961
3969
  /** Format: uint64 */
3962
3970
  actionId: number;
3971
+ /** Format: uint8 */
3972
+ subActionId: number;
3963
3973
  /** Format: uint32 */
3964
3974
  marketId: number;
3965
3975
  triggerPrice: components["schemas"]["PositivePriceMantissa"];
@@ -4281,6 +4291,29 @@ export interface components {
4281
4291
  /** Format: double */
4282
4292
  volumeQuoteTaker: number;
4283
4293
  };
4294
+ PagedQuery: {
4295
+ /**
4296
+ * @description start with this timestamp (RFC3339); defaults to UNIX epoch start
4297
+ * @default null
4298
+ */
4299
+ since: string;
4300
+ /**
4301
+ * @description end with this timestamp (RFC3339); defaults to current date-time
4302
+ * @default null
4303
+ */
4304
+ until: string;
4305
+ /**
4306
+ * Format: uint64
4307
+ * @description fetch results starting with this page; query starts with first entry if page isn't specified
4308
+ */
4309
+ startInclusive?: number | null;
4310
+ /**
4311
+ * Format: uint8
4312
+ * @description Query returns up to 50 trades in one go.
4313
+ * @default null
4314
+ */
4315
+ pageSize: number | null;
4316
+ };
4284
4317
  PageResult_for_uint64_and_WithdrawalInfo: {
4285
4318
  /** @description Set of items for requested by query. */
4286
4319
  items: components["schemas"]["WithdrawalInfo"][];
@@ -4852,6 +4885,8 @@ export interface components {
4852
4885
  */
4853
4886
  v: number;
4854
4887
  };
4888
+ /** @enum {string} */
4889
+ SelfTradePrevention: "expireMaker";
4855
4890
  };
4856
4891
  responses: never;
4857
4892
  parameters: never;