@reyaxyz/api-sdk 0.26.0 → 0.28.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/clients/api-client.js +19 -0
- package/dist/clients/api-client.js.map +1 -1
- package/dist/clients/modules/{account.js → account/index.js} +2 -2
- package/dist/clients/modules/account/index.js.map +1 -0
- package/dist/clients/{helpers/trade.simulation.types.js → modules/account/types.js} +1 -1
- package/dist/clients/modules/account/types.js.map +1 -0
- package/dist/clients/modules/{lp.js → lp/index.js} +2 -2
- package/dist/clients/modules/lp/index.js.map +1 -0
- package/dist/clients/modules/lp/types.js +13 -0
- package/dist/clients/modules/lp/types.js.map +1 -0
- package/dist/clients/modules/{markets.js → markets/index.js} +2 -2
- package/dist/clients/modules/markets/index.js.map +1 -0
- package/dist/clients/modules/markets/types.js +3 -0
- package/dist/clients/modules/markets/types.js.map +1 -0
- package/dist/clients/modules/{rest.js → rest/index.js} +4 -4
- package/dist/clients/modules/rest/index.js.map +1 -0
- package/dist/clients/modules/tokens/index.js +75 -0
- package/dist/clients/modules/tokens/index.js.map +1 -0
- package/dist/clients/modules/tokens/types.js +3 -0
- package/dist/clients/modules/tokens/types.js.map +1 -0
- package/dist/clients/modules/{trade.simulation.js → trade.simulation/index.js} +10 -10
- package/dist/clients/modules/trade.simulation/index.js.map +1 -0
- package/dist/clients/modules/trade.simulation/types.js +3 -0
- package/dist/clients/modules/trade.simulation/types.js.map +1 -0
- package/dist/clients/types.js +4 -36
- package/dist/clients/types.js.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/types/clients/api-client.d.ts +13 -0
- package/dist/types/clients/api-client.d.ts.map +1 -1
- package/dist/types/clients/modules/{account.d.ts → account/index.d.ts} +4 -4
- package/dist/types/clients/modules/account/index.d.ts.map +1 -0
- package/dist/types/clients/modules/account/types.d.ts +47 -0
- package/dist/types/clients/modules/account/types.d.ts.map +1 -0
- package/dist/types/clients/modules/{lp.d.ts → lp/index.d.ts} +4 -3
- package/dist/types/clients/modules/lp/index.d.ts.map +1 -0
- package/dist/types/clients/modules/lp/types.d.ts +46 -0
- package/dist/types/clients/modules/lp/types.d.ts.map +1 -0
- package/dist/types/clients/modules/{markets.d.ts → markets/index.d.ts} +3 -3
- package/dist/types/clients/modules/markets/index.d.ts.map +1 -0
- package/dist/types/clients/modules/markets/types.d.ts +23 -0
- package/dist/types/clients/modules/markets/types.d.ts.map +1 -0
- package/dist/types/clients/modules/{rest.d.ts → rest/index.d.ts} +2 -2
- package/dist/types/clients/modules/rest/index.d.ts.map +1 -0
- package/dist/types/clients/modules/tokens/index.d.ts +6 -0
- package/dist/types/clients/modules/tokens/index.d.ts.map +1 -0
- package/dist/types/clients/modules/tokens/types.d.ts +8 -0
- package/dist/types/clients/modules/tokens/types.d.ts.map +1 -0
- package/dist/types/clients/modules/{trade.simulation.d.ts → trade.simulation/index.d.ts} +3 -3
- package/dist/types/clients/modules/trade.simulation/index.d.ts.map +1 -0
- package/dist/types/clients/modules/trade.simulation/types.d.ts +19 -0
- package/dist/types/clients/modules/trade.simulation/types.d.ts.map +1 -0
- package/dist/types/clients/types.d.ts +1 -300
- package/dist/types/clients/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +6 -7
- package/src/clients/api-client.ts +17 -0
- package/src/clients/modules/{account.ts → account/index.ts} +3 -3
- package/src/clients/modules/account/types.ts +74 -0
- package/src/clients/modules/{lp.ts → lp/index.ts} +5 -3
- package/src/clients/modules/lp/types.ts +62 -0
- package/src/clients/modules/{markets.ts → markets/index.ts} +2 -2
- package/src/clients/modules/markets/types.ts +33 -0
- package/src/clients/modules/{rest.ts → rest/index.ts} +8 -3
- package/src/clients/modules/tokens/index.ts +11 -0
- package/src/clients/modules/tokens/types.ts +9 -0
- package/src/clients/modules/{trade.simulation.ts → trade.simulation/index.ts} +3 -4
- package/src/clients/modules/trade.simulation/types.ts +21 -0
- package/src/clients/types.ts +16 -388
- package/src/index.ts +0 -2
- package/dist/clients/helpers/exposure.calculator.js +0 -448
- package/dist/clients/helpers/exposure.calculator.js.map +0 -1
- package/dist/clients/helpers/number.js +0 -13
- package/dist/clients/helpers/number.js.map +0 -1
- package/dist/clients/helpers/trade.simulation.types.js.map +0 -1
- package/dist/clients/modules/account.js.map +0 -1
- package/dist/clients/modules/lp.js.map +0 -1
- package/dist/clients/modules/markets.js.map +0 -1
- package/dist/clients/modules/rest.js.map +0 -1
- package/dist/clients/modules/trade.simulation.js.map +0 -1
- package/dist/types/clients/helpers/exposure.calculator.d.ts +0 -58
- package/dist/types/clients/helpers/exposure.calculator.d.ts.map +0 -1
- package/dist/types/clients/helpers/number.d.ts +0 -3
- package/dist/types/clients/helpers/number.d.ts.map +0 -1
- package/dist/types/clients/helpers/trade.simulation.types.d.ts +0 -113
- package/dist/types/clients/helpers/trade.simulation.types.d.ts.map +0 -1
- package/dist/types/clients/modules/account.d.ts.map +0 -1
- package/dist/types/clients/modules/lp.d.ts.map +0 -1
- package/dist/types/clients/modules/markets.d.ts.map +0 -1
- package/dist/types/clients/modules/rest.d.ts.map +0 -1
- package/dist/types/clients/modules/trade.simulation.d.ts.map +0 -1
- package/src/clients/helpers/exposure.calculator.ts +0 -799
- package/src/clients/helpers/number.ts +0 -8
- package/src/clients/helpers/trade.simulation.types.ts +0 -125
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { MarginAccountEntity, MarginAccountTransactionHistoryEntity, MarketEntity, PositionEntity, PositionHistoryEntity } from '@reyaxyz/common';
|
|
2
|
+
export type GetMarginAccountsParams = {
|
|
3
|
+
address: string;
|
|
4
|
+
limit?: number;
|
|
5
|
+
};
|
|
6
|
+
export type GetMarginAccountParams = {
|
|
7
|
+
address: string;
|
|
8
|
+
marginAccountId: MarginAccountEntity['id'];
|
|
9
|
+
};
|
|
10
|
+
export type GetPositionsForMarginAccountParams = {
|
|
11
|
+
address: string;
|
|
12
|
+
marginAccountId: MarginAccountEntity['id'];
|
|
13
|
+
limit?: number;
|
|
14
|
+
};
|
|
15
|
+
export type GetMarginAccountsResult = MarginAccountEntity[];
|
|
16
|
+
export type GetMarginAccountResult = MarginAccountEntity;
|
|
17
|
+
export type GetMarginAccountTransactionHistoryParams = {
|
|
18
|
+
marginAccountId: MarginAccountEntity['id'];
|
|
19
|
+
limit?: number;
|
|
20
|
+
};
|
|
21
|
+
export type GetMarginAccountTransactionHistoryResult = MarginAccountTransactionHistoryEntity[];
|
|
22
|
+
export type GetMaxOrderSizeAvailableParams = {
|
|
23
|
+
marketId: MarketEntity['id'];
|
|
24
|
+
marginAccountId: MarginAccountEntity['id'];
|
|
25
|
+
direction: 'long' | 'short';
|
|
26
|
+
};
|
|
27
|
+
export type GetMaxOrderSizeAvailableResult = number;
|
|
28
|
+
export type GetMaxWithdrawBalanceForAccountParams = {
|
|
29
|
+
marginAccountId: MarginAccountEntity['id'];
|
|
30
|
+
tokenAddress: string;
|
|
31
|
+
};
|
|
32
|
+
export type GetMaxWithdrawBalanceForAccountResult = number;
|
|
33
|
+
export type GetPositionsForMarginAccountResult = {
|
|
34
|
+
positions: PositionEntity[];
|
|
35
|
+
totalUnrealizedPNL: number;
|
|
36
|
+
};
|
|
37
|
+
export type GetPositionsHistoryForMarginAccountParams = {
|
|
38
|
+
address: string;
|
|
39
|
+
marginAccountId: MarginAccountEntity['id'];
|
|
40
|
+
limit?: number;
|
|
41
|
+
};
|
|
42
|
+
export type GetPositionsHistoryForMarginAccountResult = PositionHistoryEntity[];
|
|
43
|
+
export type GetTransactionSimulationInitialDataParams = {
|
|
44
|
+
marketId: MarketEntity['id'];
|
|
45
|
+
marginAccountId: MarginAccountEntity['id'];
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/account/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,qCAAqC,EACrC,YAAY,EACZ,cAAc,EACd,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,EAAE,CAAC;AAE5D,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAGzD,MAAM,MAAM,wCAAwC,GAAG;IACrD,eAAe,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,wCAAwC,GAClD,qCAAqC,EAAE,CAAC;AAG1C,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAC7B,eAAe,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC3C,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,MAAM,CAAC;AAGpD,MAAM,MAAM,qCAAqC,GAAG;IAClD,eAAe,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC3C,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAAG,MAAM,CAAC;AAE3D,MAAM,MAAM,kCAAkC,GAAG;IAC/C,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAIF,MAAM,MAAM,yCAAyC,GAAG;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,yCAAyC,GAAG,qBAAqB,EAAE,CAAC;AAIhF,MAAM,MAAM,yCAAyC,GAAG;IACtD,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAC7B,eAAe,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;CAC5C,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { GetLpPoolParams, GetLpPositionsParams, GetLpPoolResult, GetLpPoolsResult, GetLpPoolTransactionHistoryParams, GetLpPoolTransactionHistoryResult, GetLpPositionsResult, GetLpPoolWithdrawBalanceParams, GetLpPoolWithdrawBalanceResult, GetLpPoolBalanceChartDataParams,
|
|
2
|
-
import
|
|
1
|
+
import { GetLpPoolParams, GetLpPositionsParams, GetLpPoolResult, GetLpPoolsResult, GetLpPoolTransactionHistoryParams, GetLpPoolTransactionHistoryResult, GetLpPositionsResult, GetLpPoolWithdrawBalanceParams, GetLpPoolWithdrawBalanceResult, GetLpPoolBalanceChartDataParams, GetLpPoolPerformanceChartDataParams } from './types';
|
|
2
|
+
import { GetLpPoolPerformanceChartDataResult, GetLpPoolBalanceChartDataResult } from '@reyaxyz/common';
|
|
3
|
+
import RestClient from '../rest';
|
|
3
4
|
export default class LpClient extends RestClient {
|
|
4
5
|
getLpPools(): Promise<GetLpPoolsResult>;
|
|
5
6
|
getLpPool(params: GetLpPoolParams): Promise<GetLpPoolResult>;
|
|
@@ -9,4 +10,4 @@ export default class LpClient extends RestClient {
|
|
|
9
10
|
getLpPoolBalanceChartData(params: GetLpPoolBalanceChartDataParams): Promise<GetLpPoolBalanceChartDataResult>;
|
|
10
11
|
getLpPoolPerformanceChartData(params: GetLpPoolPerformanceChartDataParams): Promise<GetLpPoolPerformanceChartDataResult>;
|
|
11
12
|
}
|
|
12
|
-
//# sourceMappingURL=
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["clients/modules/lp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,iCAAiC,EACjC,iCAAiC,EACjC,oBAAoB,EACpB,8BAA8B,EAC9B,8BAA8B,EAC9B,+BAA+B,EAC/B,mCAAmC,EACpC,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,mCAAmC,EACnC,+BAA+B,EAChC,MAAM,iBAAiB,CAAC;AACzB,OAAO,UAAU,MAAM,SAAS,CAAC;AAEjC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,UAAU;IACxC,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAKvC,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAK5D,2BAA2B,CAC/B,MAAM,EAAE,iCAAiC,GACxC,OAAO,CAAC,iCAAiC,CAAC;IAQvC,cAAc,CAClB,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,oBAAoB,CAAC;IAO1B,wBAAwB,CAC5B,MAAM,EAAE,8BAA8B,GACrC,OAAO,CAAC,8BAA8B,CAAC;IAOpC,yBAAyB,CAC7B,MAAM,EAAE,+BAA+B,GACtC,OAAO,CAAC,+BAA+B,CAAC;IAQrC,6BAA6B,CACjC,MAAM,EAAE,mCAAmC,GAC1C,OAAO,CAAC,mCAAmC,CAAC;CAQhD"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { LpPoolEntity, LpPositionEntity, LpTransactionHistoryEntity, BalanceGranularity } from '@reyaxyz/common';
|
|
2
|
+
export type GetLpPoolsResult = LpPoolEntity[];
|
|
3
|
+
export type GetLpPoolResult = LpPoolEntity;
|
|
4
|
+
export type GetLpPoolParams = {
|
|
5
|
+
id: LpPoolEntity['id'];
|
|
6
|
+
};
|
|
7
|
+
export type GetLpPoolTransactionHistoryResult = LpTransactionHistoryEntity[];
|
|
8
|
+
export type GetLpPositionsParams = {
|
|
9
|
+
id: LpPoolEntity['id'];
|
|
10
|
+
address: string;
|
|
11
|
+
};
|
|
12
|
+
export type GetLpPositionsResult = LpPositionEntity[];
|
|
13
|
+
export type GetLpPoolWithdrawBalanceParams = {
|
|
14
|
+
id: LpPoolEntity['id'];
|
|
15
|
+
address: string;
|
|
16
|
+
};
|
|
17
|
+
export type GetLpPoolWithdrawBalanceResult = number;
|
|
18
|
+
export type GetLpPoolTransactionHistoryParams = {
|
|
19
|
+
id: LpPoolEntity['id'];
|
|
20
|
+
address: string;
|
|
21
|
+
limit?: number;
|
|
22
|
+
};
|
|
23
|
+
export type GetLpPoolBalanceChartDataParams = {
|
|
24
|
+
poolId: LpPoolEntity['id'];
|
|
25
|
+
filters: {
|
|
26
|
+
timeframeMs: number;
|
|
27
|
+
granularity: BalanceGranularity;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare enum PerformanceGranularity {
|
|
31
|
+
ONE_MINUTE = 60000,
|
|
32
|
+
ONE_HOUR = 3600000,
|
|
33
|
+
ONE_DAY = 86400000,
|
|
34
|
+
ONE_WEEK = 604800000,
|
|
35
|
+
ONE_MONTH = 2592000000,
|
|
36
|
+
ONE_YEAR = 31536000000
|
|
37
|
+
}
|
|
38
|
+
export type GetLpPoolPerformanceChartDataParams = {
|
|
39
|
+
poolId: LpPoolEntity['id'];
|
|
40
|
+
address: string;
|
|
41
|
+
filters: {
|
|
42
|
+
timeframeMs: number;
|
|
43
|
+
granularity: PerformanceGranularity;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/lp/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,0BAA0B,EAC1B,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GAAG,YAAY,EAAE,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,0BAA0B,EAAE,CAAC;AAE7E,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,EAAE,CAAC;AAEtD,MAAM,MAAM,8BAA8B,GAAG;IAC3C,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,MAAM,CAAC;AAEpD,MAAM,MAAM,iCAAiC,GAAG;IAC9C,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,kBAAkB,CAAC;KACjC,CAAC;CACH,CAAC;AAEF,oBAAY,sBAAsB;IAChC,UAAU,QAAY;IACtB,QAAQ,UAAiB;IACzB,OAAO,WAAsB;IAC7B,QAAQ,YAA0B;IAClC,SAAS,aAA2B;IACpC,QAAQ,cAA4B;CACrC;AAED,MAAM,MAAM,mCAAmC,GAAG;IAChD,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,sBAAsB,CAAC;KACrC,CAAC;CACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GetCandlesParams, GetMarketParams, GetMarketResult, GetMarketsResult, GetMarketTradingHistoryParams, GetTradingHistoryResult, MarketCandlesResponse } from '
|
|
2
|
-
import RestClient from '
|
|
1
|
+
import { GetCandlesParams, GetMarketParams, GetMarketResult, GetMarketsResult, GetMarketTradingHistoryParams, GetTradingHistoryResult, MarketCandlesResponse } from './types';
|
|
2
|
+
import RestClient from '../rest';
|
|
3
3
|
export default class MarketsClient extends RestClient {
|
|
4
4
|
/**
|
|
5
5
|
* Asynchronously retrieves market data from the API.
|
|
@@ -36,4 +36,4 @@ export default class MarketsClient extends RestClient {
|
|
|
36
36
|
getMarketCandles(params: GetCandlesParams): Promise<MarketCandlesResponse>;
|
|
37
37
|
getMarketTradingHistory(params: GetMarketTradingHistoryParams): Promise<GetTradingHistoryResult>;
|
|
38
38
|
}
|
|
39
|
-
//# sourceMappingURL=
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["clients/modules/markets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,6BAA6B,EAC7B,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AACjB,OAAO,UAAU,MAAM,SAAS,CAAC;AAEjC,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU;IACnD;;;;;;;;;;;;;;;;OAgBG;IAEG,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAKvC,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAKlE;;;;;;;;;;;;OAYG;IAEG,gBAAgB,CACpB,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,qBAAqB,CAAC;IAU3B,uBAAuB,CAC3B,MAAM,EAAE,6BAA6B,GACpC,OAAO,CAAC,uBAAuB,CAAC;CAOpC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CandlesResolution, MarketEntity, TradingHistoryEntity, Candle } from '@reyaxyz/common';
|
|
2
|
+
export type GetMarketsResult = MarketEntity[];
|
|
3
|
+
export type GetMarketResult = MarketEntity;
|
|
4
|
+
export type GetMarketParams = {
|
|
5
|
+
id: MarketEntity['id'];
|
|
6
|
+
};
|
|
7
|
+
export type GetCandlesParams = {
|
|
8
|
+
marketId: MarketEntity['id'];
|
|
9
|
+
resolution: CandlesResolution;
|
|
10
|
+
fromISO?: string | null;
|
|
11
|
+
toISO?: string | null;
|
|
12
|
+
limit?: number | null;
|
|
13
|
+
};
|
|
14
|
+
export type GetMarketTradingHistoryParams = {
|
|
15
|
+
marketId: number;
|
|
16
|
+
limit?: number;
|
|
17
|
+
fromTimestampMillisecondsUTC?: number;
|
|
18
|
+
};
|
|
19
|
+
export type GetTradingHistoryResult = TradingHistoryEntity[];
|
|
20
|
+
export interface MarketCandlesResponse {
|
|
21
|
+
candles: Candle[];
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/markets/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,oBAAoB,EACpB,MAAM,EACP,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GAAG,YAAY,EAAE,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAC7B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,EAAE,CAAC;AAE7D,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Response, ResponseData } from '
|
|
1
|
+
import { Response, ResponseData } from '../../lib/axios';
|
|
2
2
|
export default class RestClient {
|
|
3
3
|
readonly host: string;
|
|
4
4
|
readonly apiTimeout: number;
|
|
@@ -6,4 +6,4 @@ export default class RestClient {
|
|
|
6
6
|
get(requestPath: string, params?: NonNullable<unknown>): Promise<ResponseData>;
|
|
7
7
|
post(requestPath: string, params?: NonNullable<unknown>, body?: unknown | null, headers?: NonNullable<unknown>): Promise<Response>;
|
|
8
8
|
}
|
|
9
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["clients/modules/rest/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,QAAQ,EAER,YAAY,EACb,MAAM,iBAAiB,CAAC;AACzB,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;gBAEhB,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI;IAK9C,GAAG,CACP,WAAW,EAAE,MAAM,EACnB,MAAM,GAAE,WAAW,CAAC,OAAO,CAAM,GAChC,OAAO,CAAC,YAAY,CAAC;IAMlB,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,MAAM,GAAE,WAAW,CAAC,OAAO,CAAM,EACjC,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,EACrB,OAAO,GAAE,WAAW,CAAC,OAAO,CAAM,GACjC,OAAO,CAAC,QAAQ,CAAC;CAIrB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GetAllowedTokensParams, GetAllowedTokenResult } from './types';
|
|
2
|
+
import RestClient from '../rest';
|
|
3
|
+
export default class TokensClient extends RestClient {
|
|
4
|
+
getAllowedTokens(params: GetAllowedTokensParams): Promise<GetAllowedTokenResult>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["clients/modules/tokens/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,UAAU,MAAM,SAAS,CAAC;AAEjC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,UAAU;IAC5C,gBAAgB,CACpB,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,qBAAqB,CAAC;CAIlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/tokens/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEhE,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,gBAAgB,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SimulateTradeEntity, TradeSimulationLoadDataParams, TradeSimulationSimulateParams } from '
|
|
2
|
-
import AccountClient from '
|
|
1
|
+
import { SimulateTradeEntity, TradeSimulationLoadDataParams, TradeSimulationSimulateParams } from './types';
|
|
2
|
+
import AccountClient from '../account';
|
|
3
3
|
export default class TradeSimulationClient {
|
|
4
4
|
private marketId;
|
|
5
5
|
private accountId;
|
|
@@ -10,4 +10,4 @@ export default class TradeSimulationClient {
|
|
|
10
10
|
private fetchMarketData;
|
|
11
11
|
simulate(params: TradeSimulationSimulateParams): SimulateTradeEntity;
|
|
12
12
|
}
|
|
13
|
-
//# sourceMappingURL=
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["clients/modules/trade.simulation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,6BAA6B,EAC7B,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AACjB,OAAO,aAAa,MAAM,YAAY,CAAC;AAIvC,MAAM,CAAC,OAAO,OAAO,qBAAqB;IACxC,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,UAAU,CAAqC;IACvD,OAAO,CAAC,aAAa,CAAgB;gBACzB,aAAa,EAAE,aAAa;IAMlC,GAAG,CAAC,MAAM,EAAE,6BAA6B,GAAG,OAAO,CAAC,IAAI,CAAC;YAOjD,eAAe;IAW7B,QAAQ,CAAC,MAAM,EAAE,6BAA6B,GAAG,mBAAmB;CA2GrE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MarginAccountEntity, MarketEntity } from '@reyaxyz/common';
|
|
2
|
+
export type TradeSimulationLoadDataParams = {
|
|
3
|
+
marketId: MarketEntity['id'];
|
|
4
|
+
marginAccountId: MarginAccountEntity['id'];
|
|
5
|
+
};
|
|
6
|
+
export type TradeSimulationSimulateParams = {
|
|
7
|
+
amount: number;
|
|
8
|
+
};
|
|
9
|
+
export type SimulateTradeEntity = {
|
|
10
|
+
liquidationPrice: number;
|
|
11
|
+
fees: number;
|
|
12
|
+
estimatedPrice: number;
|
|
13
|
+
estimatedSlippage: number;
|
|
14
|
+
imr: number;
|
|
15
|
+
impliedLeverage: number;
|
|
16
|
+
marginRatio: MarginAccountEntity['marginRatioPercentage'];
|
|
17
|
+
marginRatioHealth: MarginAccountEntity['marginRatioHealth'];
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/trade.simulation/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpE,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAC7B,eAAe,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,mBAAmB,CAAC,uBAAuB,CAAC,CAAC;IAC1D,iBAAiB,EAAE,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;CAC7D,CAAC"}
|
|
@@ -1,301 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
ONE_MINUTE = "1MIN",
|
|
3
|
-
FIVE_MINUTES = "5MINS",
|
|
4
|
-
FIFTEEN_MINUTES = "15MINS",
|
|
5
|
-
THIRTY_MINUTES = "30MINS",
|
|
6
|
-
ONE_HOUR = "1HOUR",
|
|
7
|
-
FOUR_HOURS = "4HOURS",
|
|
8
|
-
ONE_DAY = "1DAY"
|
|
9
|
-
}
|
|
10
|
-
export interface Candle {
|
|
11
|
-
id: string;
|
|
12
|
-
startedAt: string;
|
|
13
|
-
ticker: string;
|
|
14
|
-
resolution: CandlesResolution;
|
|
15
|
-
low: string;
|
|
16
|
-
high: string;
|
|
17
|
-
open: string;
|
|
18
|
-
close: string;
|
|
19
|
-
baseTokenVolume: string;
|
|
20
|
-
usdVolume: string;
|
|
21
|
-
trades: number;
|
|
22
|
-
startingOpenInterest: string;
|
|
23
|
-
}
|
|
24
|
-
export interface MarketCandlesResponse {
|
|
25
|
-
candles: Candle[];
|
|
26
|
-
}
|
|
27
|
-
export type MarketOrderInfo = {
|
|
28
|
-
counterpartyAccountIds: number[];
|
|
29
|
-
exchangeId: number;
|
|
30
|
-
};
|
|
31
|
-
export type MarketEntity = {
|
|
32
|
-
id: number;
|
|
33
|
-
ticker: string;
|
|
34
|
-
underlyingAsset: string;
|
|
35
|
-
quoteToken: string;
|
|
36
|
-
markPrice: number;
|
|
37
|
-
isActive: boolean;
|
|
38
|
-
maxLeverage: number;
|
|
39
|
-
volume24H: number;
|
|
40
|
-
priceChange24H: number;
|
|
41
|
-
priceChange24HPercentage: number;
|
|
42
|
-
openInterest: number;
|
|
43
|
-
fundingRate: number;
|
|
44
|
-
description: string;
|
|
45
|
-
orderInfo: MarketOrderInfo;
|
|
46
|
-
tickSizeDecimals: number;
|
|
47
|
-
chainId: SupportedChainId;
|
|
48
|
-
};
|
|
49
|
-
export type GetMarketsResult = MarketEntity[];
|
|
50
|
-
export type GetMarketResult = MarketEntity;
|
|
51
|
-
export type GetMarketParams = {
|
|
52
|
-
id: MarketEntity['id'];
|
|
53
|
-
};
|
|
54
|
-
export type GetCandlesParams = {
|
|
55
|
-
marketId: MarketEntity['id'];
|
|
56
|
-
resolution: CandlesResolution;
|
|
57
|
-
fromISO?: string | null;
|
|
58
|
-
toISO?: string | null;
|
|
59
|
-
limit?: number | null;
|
|
60
|
-
};
|
|
61
|
-
export type Status = 'OPEN' | 'CLOSED' | 'LIQUIDATED' | 'FILLED';
|
|
62
|
-
export type Side = 'long' | 'short';
|
|
63
|
-
export type GetMarginAccountsParams = {
|
|
64
|
-
address: string;
|
|
65
|
-
limit?: number;
|
|
66
|
-
};
|
|
67
|
-
export type GetMarginAccountParams = {
|
|
68
|
-
address: string;
|
|
69
|
-
marginAccountId: MarginAccountEntity['id'];
|
|
70
|
-
};
|
|
71
|
-
export type GetPositionsForMarginAccountParams = {
|
|
72
|
-
address: string;
|
|
73
|
-
marginAccountId: MarginAccountEntity['id'];
|
|
74
|
-
limit?: number;
|
|
75
|
-
};
|
|
76
|
-
export type MarginAccountEntity = {
|
|
77
|
-
id: number;
|
|
78
|
-
name: string;
|
|
79
|
-
marginRatioHealth: 'danger' | 'healthy' | 'warning';
|
|
80
|
-
marginRatioPercentage: number;
|
|
81
|
-
totalBalance: number;
|
|
82
|
-
totalBalanceUnderlyingAsset: string;
|
|
83
|
-
collaterals: {
|
|
84
|
-
token: string;
|
|
85
|
-
percentage: number;
|
|
86
|
-
balance: number;
|
|
87
|
-
balanceRUSD: number;
|
|
88
|
-
}[];
|
|
89
|
-
};
|
|
90
|
-
export type GetMarginAccountsResult = MarginAccountEntity[];
|
|
91
|
-
export type GetMarginAccountResult = MarginAccountEntity;
|
|
92
|
-
export type PositionEntity = {
|
|
93
|
-
id: number;
|
|
94
|
-
side: Side;
|
|
95
|
-
size: number;
|
|
96
|
-
base: number;
|
|
97
|
-
price: number;
|
|
98
|
-
markPrice: number;
|
|
99
|
-
orderStatus: Status;
|
|
100
|
-
realisedPnl?: number | null;
|
|
101
|
-
unrealisedPnl?: number | null;
|
|
102
|
-
liquidationPrice: number;
|
|
103
|
-
fundingRate: number;
|
|
104
|
-
market: MarketEntity;
|
|
105
|
-
date: Date;
|
|
106
|
-
};
|
|
107
|
-
export type GetPositionsForMarginAccountResult = {
|
|
108
|
-
positions: PositionEntity[];
|
|
109
|
-
totalUnrealizedPNL: number;
|
|
110
|
-
};
|
|
111
|
-
export type GetMarketTradingHistoryParams = {
|
|
112
|
-
marketId: number;
|
|
113
|
-
limit?: number;
|
|
114
|
-
fromTimestampMillisecondsUTC?: number;
|
|
115
|
-
};
|
|
116
|
-
export type TradingHistoryEntity = {
|
|
117
|
-
id: number;
|
|
118
|
-
price: number;
|
|
119
|
-
priceUnderlyingToken: string;
|
|
120
|
-
size: number;
|
|
121
|
-
sizeUnderlyingToken: string;
|
|
122
|
-
timestampMillisecondsUTC: number;
|
|
123
|
-
};
|
|
124
|
-
export type GetTradingHistoryResult = TradingHistoryEntity[];
|
|
125
|
-
export type GetPositionsHistoryForMarginAccountParams = {
|
|
126
|
-
address: string;
|
|
127
|
-
marginAccountId: MarginAccountEntity['id'];
|
|
128
|
-
limit?: number;
|
|
129
|
-
};
|
|
130
|
-
export type OrderType = 'market';
|
|
131
|
-
export type PositionHistoryType = 'long-trade' | 'short-trade' | 'long-liquidation' | 'short-liquidation';
|
|
132
|
-
export type PositionHistoryEntity = {
|
|
133
|
-
id: number;
|
|
134
|
-
action: PositionHistoryType;
|
|
135
|
-
orderType: OrderType;
|
|
136
|
-
size: number;
|
|
137
|
-
executionPrice: number;
|
|
138
|
-
realisedPnl?: number | null;
|
|
139
|
-
fees: number;
|
|
140
|
-
timestamp: number;
|
|
141
|
-
market: MarketEntity;
|
|
142
|
-
};
|
|
143
|
-
export type GetPositionsHistoryForMarginAccountResult = PositionHistoryEntity[];
|
|
144
|
-
export type GetMaxOrderSizeAvailableParams = {
|
|
145
|
-
marketId: MarketEntity['id'];
|
|
146
|
-
marginAccountId: MarginAccountEntity['id'];
|
|
147
|
-
direction: 'long' | 'short';
|
|
148
|
-
};
|
|
149
|
-
export type GetMaxOrderSizeAvailableResult = number;
|
|
150
|
-
export type SimulateTradeEntity = {
|
|
151
|
-
liquidationPrice: number;
|
|
152
|
-
fees: number;
|
|
153
|
-
estimatedPrice: number;
|
|
154
|
-
estimatedSlippage: number;
|
|
155
|
-
imr: number;
|
|
156
|
-
impliedLeverage: number;
|
|
157
|
-
marginRatio: MarginAccountEntity['marginRatioPercentage'];
|
|
158
|
-
marginRatioHealth: MarginAccountEntity['marginRatioHealth'];
|
|
159
|
-
};
|
|
160
|
-
export type TradeSimulationLoadDataParams = {
|
|
161
|
-
marketId: MarketEntity['id'];
|
|
162
|
-
marginAccountId: MarginAccountEntity['id'];
|
|
163
|
-
};
|
|
164
|
-
export type TradeSimulationSimulateParams = {
|
|
165
|
-
amount: number;
|
|
166
|
-
};
|
|
167
|
-
export declare enum SupportedChainId {
|
|
168
|
-
polygonMumbai = 80001,
|
|
169
|
-
reyaCronos = 1729
|
|
170
|
-
}
|
|
171
|
-
export type LpPoolEntity = {
|
|
172
|
-
id: number;
|
|
173
|
-
name: string;
|
|
174
|
-
description: string;
|
|
175
|
-
longDescription: string;
|
|
176
|
-
readMoreLink: string;
|
|
177
|
-
currentAPY: number;
|
|
178
|
-
balanceSupplied?: number | null;
|
|
179
|
-
apyChange24H: number;
|
|
180
|
-
tokenAddress: string;
|
|
181
|
-
token: string;
|
|
182
|
-
allowedChainsForLiquidity: number[];
|
|
183
|
-
chainId: SupportedChainId;
|
|
184
|
-
};
|
|
185
|
-
export type GetLpPoolsResult = LpPoolEntity[];
|
|
186
|
-
export type GetLpPoolResult = LpPoolEntity;
|
|
187
|
-
export type GetLpPoolParams = {
|
|
188
|
-
id: LpPoolEntity['id'];
|
|
189
|
-
};
|
|
190
|
-
export type TransactionHistoryType = 'deposit' | 'withdrawal';
|
|
191
|
-
export type LpTransactionHistoryEntity = {
|
|
192
|
-
id: number;
|
|
193
|
-
type: TransactionHistoryType;
|
|
194
|
-
token: string;
|
|
195
|
-
amount: number;
|
|
196
|
-
transactionHash: string;
|
|
197
|
-
timestamp: number;
|
|
198
|
-
};
|
|
199
|
-
export type GetLpPoolTransactionHistoryParams = {
|
|
200
|
-
id: LpPoolEntity['id'];
|
|
201
|
-
address: string;
|
|
202
|
-
limit?: number;
|
|
203
|
-
};
|
|
204
|
-
export type GetLpPoolTransactionHistoryResult = LpTransactionHistoryEntity[];
|
|
205
|
-
export type GetLpPositionsParams = {
|
|
206
|
-
id: LpPoolEntity['id'];
|
|
207
|
-
address: string;
|
|
208
|
-
};
|
|
209
|
-
export type LpPositionEntity = {
|
|
210
|
-
id: number;
|
|
211
|
-
deposited: number;
|
|
212
|
-
currentBalance: number;
|
|
213
|
-
pnl: number;
|
|
214
|
-
fundingRate: number;
|
|
215
|
-
lpPool: LpPoolEntity;
|
|
216
|
-
};
|
|
217
|
-
export type GetLpPositionsResult = LpPositionEntity[];
|
|
218
|
-
export type GetLpPoolWithdrawBalanceParams = {
|
|
219
|
-
id: LpPoolEntity['id'];
|
|
220
|
-
address: string;
|
|
221
|
-
};
|
|
222
|
-
export type GetLpPoolWithdrawBalanceResult = number;
|
|
223
|
-
export type GetTransactionSimulationInitialDataParams = {
|
|
224
|
-
marketId: MarketEntity['id'];
|
|
225
|
-
marginAccountId: MarginAccountEntity['id'];
|
|
226
|
-
};
|
|
227
|
-
export type GetMarginAccountTransactionHistoryParams = {
|
|
228
|
-
marginAccountId: MarginAccountEntity['id'];
|
|
229
|
-
limit?: number;
|
|
230
|
-
};
|
|
231
|
-
export type MarginAccountTransactionHistoryType = 'deposit' | 'withdrawal' | 'transfer' | 'auto_exchange';
|
|
232
|
-
export type MarginAccountTransactionHistoryEntity = {
|
|
233
|
-
id: number;
|
|
234
|
-
type: MarginAccountTransactionHistoryType;
|
|
235
|
-
token: string;
|
|
236
|
-
amount: number;
|
|
237
|
-
transactionHash: string;
|
|
238
|
-
timestamp: number;
|
|
239
|
-
};
|
|
240
|
-
export type GetMarginAccountTransactionHistoryResult = MarginAccountTransactionHistoryEntity[];
|
|
241
|
-
export declare enum BalanceGranularity {
|
|
242
|
-
ONE_MINUTE = 60000,
|
|
243
|
-
ONE_HOUR = 3600000,
|
|
244
|
-
ONE_DAY = 86400000,
|
|
245
|
-
ONE_WEEK = 604800000,
|
|
246
|
-
ONE_MONTH = 2592000000,
|
|
247
|
-
ONE_YEAR = 31536000000
|
|
248
|
-
}
|
|
249
|
-
export type GetLpPoolBalanceChartDataParams = {
|
|
250
|
-
poolId: LpPoolEntity['id'];
|
|
251
|
-
filters: {
|
|
252
|
-
timeframeMs: number;
|
|
253
|
-
granularity: BalanceGranularity;
|
|
254
|
-
};
|
|
255
|
-
};
|
|
256
|
-
export type GetLpPoolBalanceChartDataResult = {
|
|
257
|
-
data: {
|
|
258
|
-
timestampInMs: number;
|
|
259
|
-
value: number;
|
|
260
|
-
}[];
|
|
261
|
-
tvl: number;
|
|
262
|
-
tvlChangePercentage: number;
|
|
263
|
-
apy: number;
|
|
264
|
-
apyChangePercentage: number;
|
|
265
|
-
};
|
|
266
|
-
export type GetLpPoolPerformanceChartDataResult = {
|
|
267
|
-
capitalInvestedData: {
|
|
268
|
-
timestampInMs: number;
|
|
269
|
-
value: number;
|
|
270
|
-
}[];
|
|
271
|
-
balanceData: {
|
|
272
|
-
timestampInMs: number;
|
|
273
|
-
value: number;
|
|
274
|
-
}[];
|
|
275
|
-
balance: number;
|
|
276
|
-
balanceChangePercentage: number;
|
|
277
|
-
capitalInvested: number;
|
|
278
|
-
capitalInvestedChangePercentage: number;
|
|
279
|
-
};
|
|
280
|
-
export declare enum PerformanceGranularity {
|
|
281
|
-
ONE_MINUTE = 60000,
|
|
282
|
-
ONE_HOUR = 3600000,
|
|
283
|
-
ONE_DAY = 86400000,
|
|
284
|
-
ONE_WEEK = 604800000,
|
|
285
|
-
ONE_MONTH = 2592000000,
|
|
286
|
-
ONE_YEAR = 31536000000
|
|
287
|
-
}
|
|
288
|
-
export type GetLpPoolPerformanceChartDataParams = {
|
|
289
|
-
poolId: LpPoolEntity['id'];
|
|
290
|
-
address: string;
|
|
291
|
-
filters: {
|
|
292
|
-
timeframeMs: number;
|
|
293
|
-
granularity: PerformanceGranularity;
|
|
294
|
-
};
|
|
295
|
-
};
|
|
296
|
-
export type GetMaxWithdrawBalanceForAccountParams = {
|
|
297
|
-
marginAccountId: MarginAccountEntity['id'];
|
|
298
|
-
tokenAddress: string;
|
|
299
|
-
};
|
|
300
|
-
export type GetMaxWithdrawBalanceForAccountResult = number;
|
|
1
|
+
export { Candle, CandlesResolution, MarketEntity, LpTransactionHistoryEntity, TradingHistoryEntity, PositionHistoryEntity, PositionEntity, TransactionHistoryType, MarginAccountTransactionHistoryType, MarginAccountTransactionHistoryEntity, MarginAccountEntity, LpPositionEntity, LpPoolEntity, } from '@reyaxyz/common';
|
|
301
2
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/types.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,sBAAsB,EACtB,mCAAmC,EACnC,qCAAqC,EACrC,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,GACb,MAAM,iBAAiB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,cAAc,iBAAiB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,cAAc,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/api-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -24,20 +24,19 @@
|
|
|
24
24
|
"ts:circular-check": "dpdm --no-output --no-tree --no-warning --exit-code circular:1 -T src/index.ts",
|
|
25
25
|
"ts:check": "pnpm ts:check-types && pnpm ts:circular-check",
|
|
26
26
|
"lint:check": "eslint '{src,demo,tests}/**/*.{ts,tsx}'",
|
|
27
|
-
"prettier:check": "npx prettier --
|
|
27
|
+
"prettier:check": "npx prettier --log-level silent --check './{src,demo,tests}/**/*.{ts,tsx}'",
|
|
28
28
|
"code-quality:check": "npx concurrently 'pnpm ts:check' 'pnpm prettier:check' 'pnpm lint:check --quiet'",
|
|
29
29
|
"lint:fix": "npx eslint --fix '{src,demo,tests}/**/*.{ts,tsx}'",
|
|
30
|
-
"prettier:fix": "npx prettier --
|
|
30
|
+
"prettier:fix": "npx prettier --log-level silent --write './{src,demo,tests}/**/*.{ts,tsx}'",
|
|
31
31
|
"test": "npx jest --silent",
|
|
32
32
|
"test:coverage": "npx jest test --coverage",
|
|
33
33
|
"generate:coverage-badges": "npx istanbul-badges-readme --silent"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@
|
|
36
|
+
"@reyaxyz/common": "0.1.0",
|
|
37
37
|
"axios": "^1.6.2",
|
|
38
|
-
"bignumber.js": "^9.1.2"
|
|
39
|
-
"lodash": "^4.17.21"
|
|
38
|
+
"bignumber.js": "^9.1.2"
|
|
40
39
|
},
|
|
41
40
|
"packageManager": "pnpm@8.10.4",
|
|
42
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "d62614e48bb530169bacfc0e359a5cf63d73a86b"
|
|
43
42
|
}
|