@n1xyz/nord-ts 0.0.21 → 0.0.22
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/api/client.d.ts +14 -0
- package/dist/api/client.js +45 -0
- package/dist/bridge/client.d.ts +151 -0
- package/dist/bridge/client.js +434 -0
- package/dist/bridge/const.d.ts +23 -0
- package/dist/bridge/const.js +47 -0
- package/dist/bridge/index.d.ts +4 -0
- package/dist/bridge/index.js +23 -0
- package/dist/bridge/types.d.ts +120 -0
- package/dist/bridge/types.js +18 -0
- package/dist/bridge/utils.d.ts +64 -0
- package/dist/bridge/utils.js +131 -0
- package/dist/gen/common.d.ts +68 -0
- package/dist/gen/common.js +215 -0
- package/dist/gen/nord_pb.d.ts +3651 -0
- package/dist/gen/nord_pb.js +892 -0
- package/dist/gen/openapi.d.ts +241 -2
- package/dist/idl/bridge.d.ts +569 -0
- package/dist/idl/bridge.js +8 -0
- package/dist/idl/bridge.json +1506 -0
- package/dist/idl/index.d.ts +607 -0
- package/dist/idl/index.js +8 -0
- package/dist/nord/api/actions.d.ts +30 -72
- package/dist/nord/api/actions.js +179 -200
- package/dist/nord/api/market.d.ts +36 -0
- package/dist/nord/api/market.js +96 -0
- package/dist/nord/api/queries.d.ts +46 -0
- package/dist/nord/api/queries.js +109 -0
- package/dist/nord/client/Nord.js +3 -3
- package/dist/nord/client/NordUser.d.ts +26 -13
- package/dist/nord/client/NordUser.js +13 -10
- package/dist/types.d.ts +12 -1
- package/dist/types.js +29 -2
- package/dist/utils.d.ts +6 -20
- package/dist/utils.js +17 -35
- package/dist/websocket/NordWebSocketClient.js +2 -6
- package/package.json +26 -23
- package/src/gen/nord_pb.ts +4172 -0
- package/src/gen/openapi.ts +241 -2
- package/src/nord/api/actions.ts +249 -370
- package/src/nord/client/Nord.ts +3 -3
- package/src/nord/client/NordUser.ts +40 -19
- package/src/types.ts +32 -1
- package/src/utils.ts +24 -43
- package/src/websocket/NordWebSocketClient.ts +2 -8
package/src/gen/openapi.ts
CHANGED
|
@@ -409,6 +409,14 @@ export interface paths {
|
|
|
409
409
|
"application/json": components["schemas"]["MarketStats"];
|
|
410
410
|
};
|
|
411
411
|
};
|
|
412
|
+
404: {
|
|
413
|
+
headers: {
|
|
414
|
+
[name: string]: unknown;
|
|
415
|
+
};
|
|
416
|
+
content: {
|
|
417
|
+
"application/json": components["schemas"]["MarketNotFound"];
|
|
418
|
+
};
|
|
419
|
+
};
|
|
412
420
|
};
|
|
413
421
|
};
|
|
414
422
|
put?: never;
|
|
@@ -637,6 +645,138 @@ export interface paths {
|
|
|
637
645
|
patch?: never;
|
|
638
646
|
trace?: never;
|
|
639
647
|
};
|
|
648
|
+
"/account/{account_id}/pnl": {
|
|
649
|
+
parameters: {
|
|
650
|
+
query?: never;
|
|
651
|
+
header?: never;
|
|
652
|
+
path?: never;
|
|
653
|
+
cookie?: never;
|
|
654
|
+
};
|
|
655
|
+
/** @description Get account's PnL (Profit and Loss) history, ordered from most recent to oldest.
|
|
656
|
+
*
|
|
657
|
+
* Pagination Results include account PnL records with timestamp, account_id, action_id, and pnl value. Use query parameters `since` and `until` for time-based filtering, and `startInclusive` for pagination.
|
|
658
|
+
*
|
|
659
|
+
* To fetch more data, use the same `since` and `until` parameters and set `startInclusive` to the `nextStartInclusive` value from the previous response. If `nextStartInclusive` is absent, it means there's no more data to fetch, even if the max number of entries were returned. */
|
|
660
|
+
get: {
|
|
661
|
+
parameters: {
|
|
662
|
+
query?: {
|
|
663
|
+
/** @description start with this timestamp (RFC3339); defaults to UNIX epoch start */
|
|
664
|
+
since?: string;
|
|
665
|
+
/** @description end with this timestamp (RFC3339); defaults to current date-time */
|
|
666
|
+
until?: string;
|
|
667
|
+
/** @description fetch results starting with this page; query starts with first entry if page isn't specified */
|
|
668
|
+
startInclusive?: number | null;
|
|
669
|
+
/** @description Query returns up to 50 trades in one go. */
|
|
670
|
+
pageSize?: number | null;
|
|
671
|
+
};
|
|
672
|
+
header?: never;
|
|
673
|
+
path: {
|
|
674
|
+
/** @description Account for which to retrieve PnL history */
|
|
675
|
+
account_id: number;
|
|
676
|
+
};
|
|
677
|
+
cookie?: never;
|
|
678
|
+
};
|
|
679
|
+
requestBody?: never;
|
|
680
|
+
responses: {
|
|
681
|
+
200: {
|
|
682
|
+
headers: {
|
|
683
|
+
[name: string]: unknown;
|
|
684
|
+
};
|
|
685
|
+
content: {
|
|
686
|
+
"application/json": components["schemas"]["PageResult_for_uint64_and_AccountPnl"];
|
|
687
|
+
};
|
|
688
|
+
};
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
put?: never;
|
|
692
|
+
post?: never;
|
|
693
|
+
delete?: never;
|
|
694
|
+
options?: never;
|
|
695
|
+
head?: never;
|
|
696
|
+
patch?: never;
|
|
697
|
+
trace?: never;
|
|
698
|
+
};
|
|
699
|
+
"/account/{account_id}/triggers/history": {
|
|
700
|
+
parameters: {
|
|
701
|
+
query?: never;
|
|
702
|
+
header?: never;
|
|
703
|
+
path?: never;
|
|
704
|
+
cookie?: never;
|
|
705
|
+
};
|
|
706
|
+
get: {
|
|
707
|
+
parameters: {
|
|
708
|
+
query?: {
|
|
709
|
+
/** @description start with this timestamp (RFC3339); defaults to UNIX epoch start */
|
|
710
|
+
since?: string;
|
|
711
|
+
/** @description end with this timestamp (RFC3339); defaults to current date-time */
|
|
712
|
+
until?: string;
|
|
713
|
+
/** @description fetch results starting with this page; query starts with first entry if page isn't specified */
|
|
714
|
+
startInclusive?: number | null;
|
|
715
|
+
/** @description Query returns up to 50 trades in one go. */
|
|
716
|
+
pageSize?: number | null;
|
|
717
|
+
};
|
|
718
|
+
header?: never;
|
|
719
|
+
path: {
|
|
720
|
+
account_id: number;
|
|
721
|
+
};
|
|
722
|
+
cookie?: never;
|
|
723
|
+
};
|
|
724
|
+
requestBody?: never;
|
|
725
|
+
responses: {
|
|
726
|
+
200: {
|
|
727
|
+
headers: {
|
|
728
|
+
[name: string]: unknown;
|
|
729
|
+
};
|
|
730
|
+
content: {
|
|
731
|
+
"application/json": components["schemas"]["PageResult_for_uint64_and_HistoryTriggerInfo"];
|
|
732
|
+
};
|
|
733
|
+
};
|
|
734
|
+
};
|
|
735
|
+
};
|
|
736
|
+
put?: never;
|
|
737
|
+
post?: never;
|
|
738
|
+
delete?: never;
|
|
739
|
+
options?: never;
|
|
740
|
+
head?: never;
|
|
741
|
+
patch?: never;
|
|
742
|
+
trace?: never;
|
|
743
|
+
};
|
|
744
|
+
"/account/{account_id}/triggers": {
|
|
745
|
+
parameters: {
|
|
746
|
+
query?: never;
|
|
747
|
+
header?: never;
|
|
748
|
+
path?: never;
|
|
749
|
+
cookie?: never;
|
|
750
|
+
};
|
|
751
|
+
get: {
|
|
752
|
+
parameters: {
|
|
753
|
+
query?: never;
|
|
754
|
+
header?: never;
|
|
755
|
+
path: {
|
|
756
|
+
account_id: number;
|
|
757
|
+
};
|
|
758
|
+
cookie?: never;
|
|
759
|
+
};
|
|
760
|
+
requestBody?: never;
|
|
761
|
+
responses: {
|
|
762
|
+
200: {
|
|
763
|
+
headers: {
|
|
764
|
+
[name: string]: unknown;
|
|
765
|
+
};
|
|
766
|
+
content: {
|
|
767
|
+
"application/json": components["schemas"]["TriggerInfo"][] | null;
|
|
768
|
+
};
|
|
769
|
+
};
|
|
770
|
+
};
|
|
771
|
+
};
|
|
772
|
+
put?: never;
|
|
773
|
+
post?: never;
|
|
774
|
+
delete?: never;
|
|
775
|
+
options?: never;
|
|
776
|
+
head?: never;
|
|
777
|
+
patch?: never;
|
|
778
|
+
trace?: never;
|
|
779
|
+
};
|
|
640
780
|
"/account/{account_id}/pubkey": {
|
|
641
781
|
parameters: {
|
|
642
782
|
query?: never;
|
|
@@ -1762,8 +1902,7 @@ export interface components {
|
|
|
1762
1902
|
ActionsItem: {
|
|
1763
1903
|
/** Format: uint64 */
|
|
1764
1904
|
actionId: number;
|
|
1765
|
-
|
|
1766
|
-
physicalTime: number;
|
|
1905
|
+
physicalTime: string;
|
|
1767
1906
|
payload: string;
|
|
1768
1907
|
};
|
|
1769
1908
|
RangeTooLarge: {
|
|
@@ -2009,6 +2148,106 @@ export interface components {
|
|
|
2009
2148
|
/** @description See `bankruptcy` in MARKETS.md. In general happens if account does not have enough weighted tokens to covert his debt and negative PnL. */
|
|
2010
2149
|
bankruptcy: boolean;
|
|
2011
2150
|
};
|
|
2151
|
+
AccountPnlQuery: {
|
|
2152
|
+
/**
|
|
2153
|
+
* @description start with this timestamp (RFC3339); defaults to UNIX epoch start
|
|
2154
|
+
* @default null
|
|
2155
|
+
*/
|
|
2156
|
+
since: string;
|
|
2157
|
+
/**
|
|
2158
|
+
* @description end with this timestamp (RFC3339); defaults to current date-time
|
|
2159
|
+
* @default null
|
|
2160
|
+
*/
|
|
2161
|
+
until: string;
|
|
2162
|
+
/**
|
|
2163
|
+
* Format: uint64
|
|
2164
|
+
* @description fetch results starting with this page; query starts with first entry if page isn't specified
|
|
2165
|
+
*/
|
|
2166
|
+
startInclusive?: number | null;
|
|
2167
|
+
/**
|
|
2168
|
+
* Format: uint8
|
|
2169
|
+
* @description Query returns up to 50 trades in one go.
|
|
2170
|
+
* @default null
|
|
2171
|
+
*/
|
|
2172
|
+
pageSize: number | null;
|
|
2173
|
+
};
|
|
2174
|
+
PageResult_for_uint64_and_AccountPnl: {
|
|
2175
|
+
/** @description Set of items for requested by query. */
|
|
2176
|
+
items: components["schemas"]["AccountPnl"][];
|
|
2177
|
+
/**
|
|
2178
|
+
* Format: uint64
|
|
2179
|
+
* @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.
|
|
2180
|
+
*/
|
|
2181
|
+
nextStartInclusive?: number | null;
|
|
2182
|
+
};
|
|
2183
|
+
AccountPnl: {
|
|
2184
|
+
time: string;
|
|
2185
|
+
/** Format: uint64 */
|
|
2186
|
+
actionId: number;
|
|
2187
|
+
/** Format: uint32 */
|
|
2188
|
+
accountId: number;
|
|
2189
|
+
/** Format: double */
|
|
2190
|
+
pnl: number;
|
|
2191
|
+
};
|
|
2192
|
+
AccountTriggersQuery: {
|
|
2193
|
+
/**
|
|
2194
|
+
* @description start with this timestamp (RFC3339); defaults to UNIX epoch start
|
|
2195
|
+
* @default null
|
|
2196
|
+
*/
|
|
2197
|
+
since: string;
|
|
2198
|
+
/**
|
|
2199
|
+
* @description end with this timestamp (RFC3339); defaults to current date-time
|
|
2200
|
+
* @default null
|
|
2201
|
+
*/
|
|
2202
|
+
until: string;
|
|
2203
|
+
/**
|
|
2204
|
+
* Format: uint64
|
|
2205
|
+
* @description fetch results starting with this page; query starts with first entry if page isn't specified
|
|
2206
|
+
*/
|
|
2207
|
+
startInclusive?: number | null;
|
|
2208
|
+
/**
|
|
2209
|
+
* Format: uint8
|
|
2210
|
+
* @description Query returns up to 50 trades in one go.
|
|
2211
|
+
* @default null
|
|
2212
|
+
*/
|
|
2213
|
+
pageSize: number | null;
|
|
2214
|
+
};
|
|
2215
|
+
PageResult_for_uint64_and_HistoryTriggerInfo: {
|
|
2216
|
+
/** @description Set of items for requested by query. */
|
|
2217
|
+
items: components["schemas"]["HistoryTriggerInfo"][];
|
|
2218
|
+
/**
|
|
2219
|
+
* Format: uint64
|
|
2220
|
+
* @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.
|
|
2221
|
+
*/
|
|
2222
|
+
nextStartInclusive?: number | null;
|
|
2223
|
+
};
|
|
2224
|
+
HistoryTriggerInfo: {
|
|
2225
|
+
/** Format: uint32 */
|
|
2226
|
+
accountId: number;
|
|
2227
|
+
/** Format: uint64 */
|
|
2228
|
+
actionId: number;
|
|
2229
|
+
/** Format: uint32 */
|
|
2230
|
+
marketId: number;
|
|
2231
|
+
/** Format: uint64 */
|
|
2232
|
+
price: number;
|
|
2233
|
+
side: components["schemas"]["Side"];
|
|
2234
|
+
kind: components["schemas"]["TriggerKind"];
|
|
2235
|
+
status: components["schemas"]["TriggerStatus"];
|
|
2236
|
+
createdAt: string;
|
|
2237
|
+
updatedAt: string;
|
|
2238
|
+
};
|
|
2239
|
+
/** @enum {string} */
|
|
2240
|
+
TriggerKind: "stopLoss" | "takeProfit";
|
|
2241
|
+
/** @enum {string} */
|
|
2242
|
+
TriggerStatus: "added" | "succeeded" | "failed" | "removed";
|
|
2243
|
+
TriggerInfo: {
|
|
2244
|
+
/** Format: uint32 */
|
|
2245
|
+
marketId: number;
|
|
2246
|
+
/** Format: uint64 */
|
|
2247
|
+
price: number;
|
|
2248
|
+
side: components["schemas"]["Side"];
|
|
2249
|
+
kind: components["schemas"]["TriggerKind"];
|
|
2250
|
+
};
|
|
2012
2251
|
OrderNotFound: null;
|
|
2013
2252
|
PageResult_for_String_and_Trade: {
|
|
2014
2253
|
/** @description Set of items for requested by query. */
|