@reyaxyz/common 0.305.0 → 0.305.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/README.md CHANGED
@@ -6,5 +6,5 @@
6
6
 
7
7
  | Statements | Branches | Functions | Lines |
8
8
  | --------------------------- | ----------------------- | ------------------------- | ----------------- |
9
- | ![Statements](https://img.shields.io/badge/statements-19.76%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-16.44%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-9.29%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-21.38%25-red.svg?style=flat) |
9
+ | ![Statements](https://img.shields.io/badge/statements-19.88%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-16.89%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-9.54%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-21.53%25-red.svg?style=flat) |
10
10
 
package/dist/index.js CHANGED
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./types"), exports);
18
18
  __exportStar(require("./api-types"), exports);
19
19
  __exportStar(require("./trading-api-types"), exports);
20
- __exportStar(require("./trading-private-types"), exports);
21
20
  __exportStar(require("./incentives-api-types"), exports);
22
21
  __exportStar(require("./commands"), exports);
23
22
  __exportStar(require("./utils"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,8CAA4B;AAC5B,sDAAoC;AACpC,0DAAwC;AACxC,yDAAuC;AACvC,6CAA2B;AAC3B,0CAAwB;AACxB,6CAA2B;AAC3B,4CAA0B;AAC1B,yCAAuB;AACvB,+CAA6B;AAC7B,iDAA+B","sourcesContent":["export * from './types';\nexport * from './api-types';\nexport * from './trading-api-types';\nexport * from './trading-private-types';\nexport * from './incentives-api-types';\nexport * from './commands';\nexport * from './utils';\nexport * from './services';\nexport * from './modules';\nexport * from './rest';\nexport * from './decorators';\nexport * from './transactions';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,8CAA4B;AAC5B,sDAAoC;AACpC,yDAAuC;AACvC,6CAA2B;AAC3B,0CAAwB;AACxB,6CAA2B;AAC3B,4CAA0B;AAC1B,yCAAuB;AACvB,+CAA6B;AAC7B,iDAA+B","sourcesContent":["export * from './types';\nexport * from './api-types';\nexport * from './trading-api-types';\nexport * from './incentives-api-types';\nexport * from './commands';\nexport * from './utils';\nexport * from './services';\nexport * from './modules';\nexport * from './rest';\nexport * from './decorators';\nexport * from './transactions';\n"]}
@@ -1,7 +1,6 @@
1
1
  export * from './types';
2
2
  export * from './api-types';
3
3
  export * from './trading-api-types';
4
- export * from './trading-private-types';
5
4
  export * from './incentives-api-types';
6
5
  export * from './commands';
7
6
  export * from './utils';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/common",
3
- "version": "0.305.0",
3
+ "version": "0.305.1",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -44,5 +44,5 @@
44
44
  "generate:coverage-badges": "npx istanbul-badges-readme --silent"
45
45
  },
46
46
  "packageManager": "pnpm@8.3.1",
47
- "gitHead": "50889c5e771c392ca79306bbcdcec44d32eadc7d"
47
+ "gitHead": "3c98482294bdbc85ac19b8c8f5da5ecb3f8b6a41"
48
48
  }
package/src/index.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export * from './types';
2
2
  export * from './api-types';
3
3
  export * from './trading-api-types';
4
- export * from './trading-private-types';
5
4
  export * from './incentives-api-types';
6
5
  export * from './commands';
7
6
  export * from './utils';
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isGTCOrder = exports.isIOCOrder = exports.isTriggerOrder = exports.isLimitOrder = exports.TpslType = exports.TimeInForce = void 0;
4
- var TimeInForce;
5
- (function (TimeInForce) {
6
- TimeInForce["IOC"] = "IOC";
7
- TimeInForce["GTC"] = "GTC";
8
- })(TimeInForce || (exports.TimeInForce = TimeInForce = {}));
9
- var TpslType;
10
- (function (TpslType) {
11
- TpslType["TP"] = "TP";
12
- TpslType["SL"] = "SL";
13
- })(TpslType || (exports.TpslType = TpslType = {}));
14
- function isLimitOrder(type) {
15
- return 'limit' in type;
16
- }
17
- exports.isLimitOrder = isLimitOrder;
18
- function isTriggerOrder(type) {
19
- return 'trigger' in type;
20
- }
21
- exports.isTriggerOrder = isTriggerOrder;
22
- function isIOCOrder(type) {
23
- return isLimitOrder(type) && type.limit.timeInForce === TimeInForce.IOC;
24
- }
25
- exports.isIOCOrder = isIOCOrder;
26
- function isGTCOrder(type) {
27
- return isLimitOrder(type) && type.limit.timeInForce === TimeInForce.GTC;
28
- }
29
- exports.isGTCOrder = isGTCOrder;
30
- //# sourceMappingURL=trading-private-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trading-private-types.js","sourceRoot":"/","sources":["trading-private-types.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,0BAAW,CAAA;IACX,0BAAW,CAAA;AACb,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAED,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,qBAAS,CAAA;IACT,qBAAS,CAAA;AACX,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAkDD,SAAgB,YAAY,CAAC,IAAsB;IACjD,OAAO,OAAO,IAAI,IAAI,CAAC;AACzB,CAAC;AAFD,oCAEC;AAED,SAAgB,cAAc,CAC5B,IAAsB;IAEtB,OAAO,SAAS,IAAI,IAAI,CAAC;AAC3B,CAAC;AAJD,wCAIC;AAED,SAAgB,UAAU,CAAC,IAAsB;IAC/C,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,KAAK,WAAW,CAAC,GAAG,CAAC;AAC1E,CAAC;AAFD,gCAEC;AAED,SAAgB,UAAU,CAAC,IAAsB;IAC/C,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,KAAK,WAAW,CAAC,GAAG,CAAC;AAC1E,CAAC;AAFD,gCAEC","sourcesContent":["export enum TimeInForce {\n IOC = 'IOC', // Immediate or Cancel\n GTC = 'GTC', // Good Till Cancel\n}\n\nexport enum TpslType {\n TP = 'TP', // Take Profit\n SL = 'SL', // Stop Loss\n}\n\nexport type LimitOrderType = {\n limit: {\n timeInForce: TimeInForce;\n };\n};\n\nexport type TriggerOrderType = {\n trigger: {\n triggerPx: string;\n tpsl: TpslType;\n };\n};\n\nexport type UnifiedOrderType = LimitOrderType | TriggerOrderType;\n\nexport interface CreateOrderRequest {\n accountId: number;\n marketId: number;\n exchangeId: number;\n isBuy: boolean;\n price: string;\n size: string;\n reduceOnly: boolean;\n type: UnifiedOrderType;\n signature: string;\n nonce: string;\n signerWallet: string;\n expiresAfter?: number; // Required for IOC orders, forbidden for others - timestamp deadline\n}\n\nexport interface CreateOrderResponse {\n success: boolean;\n orderId?: string;\n transactionHash?: string;\n error?: string;\n}\n\nexport interface CancelOrderRequest {\n orderId: string;\n signature: string;\n}\n\nexport interface CancelOrderResponse {\n success: boolean;\n orderId: string;\n error?: string;\n}\n\nexport function isLimitOrder(type: UnifiedOrderType): type is LimitOrderType {\n return 'limit' in type;\n}\n\nexport function isTriggerOrder(\n type: UnifiedOrderType,\n): type is TriggerOrderType {\n return 'trigger' in type;\n}\n\nexport function isIOCOrder(type: UnifiedOrderType): boolean {\n return isLimitOrder(type) && type.limit.timeInForce === TimeInForce.IOC;\n}\n\nexport function isGTCOrder(type: UnifiedOrderType): boolean {\n return isLimitOrder(type) && type.limit.timeInForce === TimeInForce.GTC;\n}\n"]}
@@ -1,54 +0,0 @@
1
- export declare enum TimeInForce {
2
- IOC = "IOC",// Immediate or Cancel
3
- GTC = "GTC"
4
- }
5
- export declare enum TpslType {
6
- TP = "TP",// Take Profit
7
- SL = "SL"
8
- }
9
- export type LimitOrderType = {
10
- limit: {
11
- timeInForce: TimeInForce;
12
- };
13
- };
14
- export type TriggerOrderType = {
15
- trigger: {
16
- triggerPx: string;
17
- tpsl: TpslType;
18
- };
19
- };
20
- export type UnifiedOrderType = LimitOrderType | TriggerOrderType;
21
- export interface CreateOrderRequest {
22
- accountId: number;
23
- marketId: number;
24
- exchangeId: number;
25
- isBuy: boolean;
26
- price: string;
27
- size: string;
28
- reduceOnly: boolean;
29
- type: UnifiedOrderType;
30
- signature: string;
31
- nonce: string;
32
- signerWallet: string;
33
- expiresAfter?: number;
34
- }
35
- export interface CreateOrderResponse {
36
- success: boolean;
37
- orderId?: string;
38
- transactionHash?: string;
39
- error?: string;
40
- }
41
- export interface CancelOrderRequest {
42
- orderId: string;
43
- signature: string;
44
- }
45
- export interface CancelOrderResponse {
46
- success: boolean;
47
- orderId: string;
48
- error?: string;
49
- }
50
- export declare function isLimitOrder(type: UnifiedOrderType): type is LimitOrderType;
51
- export declare function isTriggerOrder(type: UnifiedOrderType): type is TriggerOrderType;
52
- export declare function isIOCOrder(type: UnifiedOrderType): boolean;
53
- export declare function isGTCOrder(type: UnifiedOrderType): boolean;
54
- //# sourceMappingURL=trading-private-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trading-private-types.d.ts","sourceRoot":"/","sources":["trading-private-types.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,GAAG,QAAQ,CAAE,sBAAsB;IACnC,GAAG,QAAQ;CACZ;AAED,oBAAY,QAAQ;IAClB,EAAE,OAAO,CAAE,cAAc;IACzB,EAAE,OAAO;CACV;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE;QACL,WAAW,EAAE,WAAW,CAAC;KAC1B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,QAAQ,CAAC;KAChB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAEjE,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,gBAAgB,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,IAAI,cAAc,CAE3E;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,gBAAgB,GACrB,IAAI,IAAI,gBAAgB,CAE1B;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAE1D;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAE1D"}
@@ -1,75 +0,0 @@
1
- export enum TimeInForce {
2
- IOC = 'IOC', // Immediate or Cancel
3
- GTC = 'GTC', // Good Till Cancel
4
- }
5
-
6
- export enum TpslType {
7
- TP = 'TP', // Take Profit
8
- SL = 'SL', // Stop Loss
9
- }
10
-
11
- export type LimitOrderType = {
12
- limit: {
13
- timeInForce: TimeInForce;
14
- };
15
- };
16
-
17
- export type TriggerOrderType = {
18
- trigger: {
19
- triggerPx: string;
20
- tpsl: TpslType;
21
- };
22
- };
23
-
24
- export type UnifiedOrderType = LimitOrderType | TriggerOrderType;
25
-
26
- export interface CreateOrderRequest {
27
- accountId: number;
28
- marketId: number;
29
- exchangeId: number;
30
- isBuy: boolean;
31
- price: string;
32
- size: string;
33
- reduceOnly: boolean;
34
- type: UnifiedOrderType;
35
- signature: string;
36
- nonce: string;
37
- signerWallet: string;
38
- expiresAfter?: number; // Required for IOC orders, forbidden for others - timestamp deadline
39
- }
40
-
41
- export interface CreateOrderResponse {
42
- success: boolean;
43
- orderId?: string;
44
- transactionHash?: string;
45
- error?: string;
46
- }
47
-
48
- export interface CancelOrderRequest {
49
- orderId: string;
50
- signature: string;
51
- }
52
-
53
- export interface CancelOrderResponse {
54
- success: boolean;
55
- orderId: string;
56
- error?: string;
57
- }
58
-
59
- export function isLimitOrder(type: UnifiedOrderType): type is LimitOrderType {
60
- return 'limit' in type;
61
- }
62
-
63
- export function isTriggerOrder(
64
- type: UnifiedOrderType,
65
- ): type is TriggerOrderType {
66
- return 'trigger' in type;
67
- }
68
-
69
- export function isIOCOrder(type: UnifiedOrderType): boolean {
70
- return isLimitOrder(type) && type.limit.timeInForce === TimeInForce.IOC;
71
- }
72
-
73
- export function isGTCOrder(type: UnifiedOrderType): boolean {
74
- return isLimitOrder(type) && type.limit.timeInForce === TimeInForce.GTC;
75
- }