@reyaxyz/api-sdk 0.169.5 → 0.169.7
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 +0 -149
- package/dist/clients/api-client.js.map +1 -1
- package/dist/clients/modules/account/index.js +0 -20
- package/dist/clients/modules/account/index.js.map +1 -1
- package/dist/clients/modules/account/types.js.map +1 -1
- package/dist/clients/modules/lp/index.js +0 -9
- package/dist/clients/modules/lp/index.js.map +1 -1
- package/dist/clients/modules/lp/types.js.map +1 -1
- package/dist/clients/types.js +0 -7
- package/dist/clients/types.js.map +1 -1
- package/dist/types/clients/api-client.d.ts +0 -106
- package/dist/types/clients/api-client.d.ts.map +1 -1
- package/dist/types/clients/modules/account/index.d.ts +2 -4
- package/dist/types/clients/modules/account/index.d.ts.map +1 -1
- package/dist/types/clients/modules/account/types.d.ts +0 -8
- package/dist/types/clients/modules/account/types.d.ts.map +1 -1
- package/dist/types/clients/modules/lp/index.d.ts +2 -3
- package/dist/types/clients/modules/lp/index.d.ts.map +1 -1
- package/dist/types/clients/modules/lp/types.d.ts +1 -4
- package/dist/types/clients/modules/lp/types.d.ts.map +1 -1
- package/dist/types/clients/types.d.ts +0 -7
- package/dist/types/clients/types.d.ts.map +1 -1
- package/package.json +4 -5
- package/src/clients/api-client.ts +0 -159
- package/src/clients/modules/account/index.ts +1 -24
- package/src/clients/modules/account/types.ts +0 -14
- package/src/clients/modules/lp/index.ts +1 -13
- package/src/clients/modules/lp/types.ts +0 -5
- package/src/clients/types.ts +0 -7
- package/dist/clients/modules/binance/index.js +0 -104
- package/dist/clients/modules/binance/index.js.map +0 -1
- package/dist/clients/modules/binance/types.js +0 -3
- package/dist/clients/modules/binance/types.js.map +0 -1
- package/dist/clients/modules/deposit-existing-MA.simulation/index.js +0 -117
- package/dist/clients/modules/deposit-existing-MA.simulation/index.js.map +0 -1
- package/dist/clients/modules/deposit-existing-MA.simulation/types.js +0 -3
- package/dist/clients/modules/deposit-existing-MA.simulation/types.js.map +0 -1
- package/dist/clients/modules/deposit-new-MA.simulation/index.js +0 -67
- package/dist/clients/modules/deposit-new-MA.simulation/index.js.map +0 -1
- package/dist/clients/modules/deposit-new-MA.simulation/types.js +0 -3
- package/dist/clients/modules/deposit-new-MA.simulation/types.js.map +0 -1
- package/dist/clients/modules/depth-chart.simulation/index.js +0 -142
- package/dist/clients/modules/depth-chart.simulation/index.js.map +0 -1
- package/dist/clients/modules/depth-chart.simulation/types.js +0 -3
- package/dist/clients/modules/depth-chart.simulation/types.js.map +0 -1
- package/dist/clients/modules/edit-collateral.simulation/index.js +0 -92
- package/dist/clients/modules/edit-collateral.simulation/index.js.map +0 -1
- package/dist/clients/modules/edit-collateral.simulation/types.js +0 -3
- package/dist/clients/modules/edit-collateral.simulation/types.js.map +0 -1
- package/dist/clients/modules/transfer-MA-Pool.simulation/index.js +0 -74
- package/dist/clients/modules/transfer-MA-Pool.simulation/index.js.map +0 -1
- package/dist/clients/modules/transfer-MA-Pool.simulation/types.js +0 -3
- package/dist/clients/modules/transfer-MA-Pool.simulation/types.js.map +0 -1
- package/dist/clients/modules/transfer-margin-between-MAs.simulation/index.js +0 -90
- package/dist/clients/modules/transfer-margin-between-MAs.simulation/index.js.map +0 -1
- package/dist/clients/modules/transfer-margin-between-MAs.simulation/types.js +0 -3
- package/dist/clients/modules/transfer-margin-between-MAs.simulation/types.js.map +0 -1
- package/dist/clients/modules/withdraw-MA.simulation/index.js +0 -120
- package/dist/clients/modules/withdraw-MA.simulation/index.js.map +0 -1
- package/dist/clients/modules/withdraw-MA.simulation/types.js +0 -3
- package/dist/clients/modules/withdraw-MA.simulation/types.js.map +0 -1
- package/dist/types/clients/modules/binance/index.d.ts +0 -7
- package/dist/types/clients/modules/binance/index.d.ts.map +0 -1
- package/dist/types/clients/modules/binance/types.d.ts +0 -10
- package/dist/types/clients/modules/binance/types.d.ts.map +0 -1
- package/dist/types/clients/modules/deposit-existing-MA.simulation/index.d.ts +0 -11
- package/dist/types/clients/modules/deposit-existing-MA.simulation/index.d.ts.map +0 -1
- package/dist/types/clients/modules/deposit-existing-MA.simulation/types.d.ts +0 -15
- package/dist/types/clients/modules/deposit-existing-MA.simulation/types.d.ts.map +0 -1
- package/dist/types/clients/modules/deposit-new-MA.simulation/index.d.ts +0 -9
- package/dist/types/clients/modules/deposit-new-MA.simulation/index.d.ts.map +0 -1
- package/dist/types/clients/modules/deposit-new-MA.simulation/types.d.ts +0 -4
- package/dist/types/clients/modules/deposit-new-MA.simulation/types.d.ts.map +0 -1
- package/dist/types/clients/modules/depth-chart.simulation/index.d.ts +0 -14
- package/dist/types/clients/modules/depth-chart.simulation/index.d.ts.map +0 -1
- package/dist/types/clients/modules/depth-chart.simulation/types.d.ts +0 -22
- package/dist/types/clients/modules/depth-chart.simulation/types.d.ts.map +0 -1
- package/dist/types/clients/modules/edit-collateral.simulation/index.d.ts +0 -13
- package/dist/types/clients/modules/edit-collateral.simulation/index.d.ts.map +0 -1
- package/dist/types/clients/modules/edit-collateral.simulation/types.d.ts +0 -13
- package/dist/types/clients/modules/edit-collateral.simulation/types.d.ts.map +0 -1
- package/dist/types/clients/modules/transfer-MA-Pool.simulation/index.d.ts +0 -9
- package/dist/types/clients/modules/transfer-MA-Pool.simulation/index.d.ts.map +0 -1
- package/dist/types/clients/modules/transfer-MA-Pool.simulation/types.d.ts +0 -12
- package/dist/types/clients/modules/transfer-MA-Pool.simulation/types.d.ts.map +0 -1
- package/dist/types/clients/modules/transfer-margin-between-MAs.simulation/index.d.ts +0 -11
- package/dist/types/clients/modules/transfer-margin-between-MAs.simulation/index.d.ts.map +0 -1
- package/dist/types/clients/modules/transfer-margin-between-MAs.simulation/types.d.ts +0 -16
- package/dist/types/clients/modules/transfer-margin-between-MAs.simulation/types.d.ts.map +0 -1
- package/dist/types/clients/modules/withdraw-MA.simulation/index.d.ts +0 -12
- package/dist/types/clients/modules/withdraw-MA.simulation/index.d.ts.map +0 -1
- package/dist/types/clients/modules/withdraw-MA.simulation/types.d.ts +0 -16
- package/dist/types/clients/modules/withdraw-MA.simulation/types.d.ts.map +0 -1
- package/src/clients/modules/binance/index.ts +0 -50
- package/src/clients/modules/binance/types.ts +0 -25
- package/src/clients/modules/deposit-existing-MA.simulation/index.ts +0 -82
- package/src/clients/modules/deposit-existing-MA.simulation/types.ts +0 -23
- package/src/clients/modules/deposit-new-MA.simulation/index.ts +0 -30
- package/src/clients/modules/deposit-new-MA.simulation/types.ts +0 -9
- package/src/clients/modules/depth-chart.simulation/index.ts +0 -131
- package/src/clients/modules/depth-chart.simulation/types.ts +0 -25
- package/src/clients/modules/edit-collateral.simulation/index.ts +0 -86
- package/src/clients/modules/edit-collateral.simulation/types.ts +0 -15
- package/src/clients/modules/transfer-MA-Pool.simulation/index.ts +0 -38
- package/src/clients/modules/transfer-MA-Pool.simulation/types.ts +0 -15
- package/src/clients/modules/transfer-margin-between-MAs.simulation/index.ts +0 -65
- package/src/clients/modules/transfer-margin-between-MAs.simulation/types.ts +0 -18
- package/src/clients/modules/withdraw-MA.simulation/index.ts +0 -94
- package/src/clients/modules/withdraw-MA.simulation/types.ts +0 -23
|
@@ -25,11 +25,6 @@ export type GetMaxOrderSizeAvailableResult = {
|
|
|
25
25
|
maxAmountBase: number;
|
|
26
26
|
maxAmountSize: number;
|
|
27
27
|
};
|
|
28
|
-
export type GetMaxWithdrawBalanceForAccountParams = {
|
|
29
|
-
marginAccountId: number;
|
|
30
|
-
tokenAddress: string;
|
|
31
|
-
};
|
|
32
|
-
export type GetMaxWithdrawBalanceForAccountResult = number;
|
|
33
28
|
export type GetPositionsForMarginAccountResult = {
|
|
34
29
|
positions: PositionEntity[];
|
|
35
30
|
totalUnrealizedPNL: number;
|
|
@@ -78,9 +73,6 @@ export type GetTransactionSimulationInitialDataParams = {
|
|
|
78
73
|
marketId: MarketEntity['id'];
|
|
79
74
|
marginAccountId: number;
|
|
80
75
|
};
|
|
81
|
-
export type GetEditCollateralSimulationInitialDataParams = {
|
|
82
|
-
marginAccountId: number;
|
|
83
|
-
};
|
|
84
76
|
export type GetMarginAccountBalanceChartDataParams = {
|
|
85
77
|
marginAccountId: number;
|
|
86
78
|
filters: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/account/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,2BAA2B,EAC5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,+BAA+B,EAC/B,0CAA0C,EAC1C,mCAAmC,EACpC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,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,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,2BAA2B,EAAE,CAAC;AAEpE,MAAM,MAAM,sBAAsB,GAAG,2BAA2B,CAAC;AAIjE,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":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,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { GetLpPoolsResult, GetLpPoolWithdrawBalanceParams, GetLpPoolWithdrawBalanceResult, PushBridgeTransactionParams, PushBridgeTransactionResult, GetPendingBridgeTransactionsParams, GetPendingBridgeTransactionsResult, GetLpPoolDataRPCParams
|
|
2
|
-
import { RestClient, GetLpPoolPositionRPCResponse
|
|
1
|
+
import { GetLpPoolsResult, GetLpPoolWithdrawBalanceParams, GetLpPoolWithdrawBalanceResult, PushBridgeTransactionParams, PushBridgeTransactionResult, GetPendingBridgeTransactionsParams, GetPendingBridgeTransactionsResult, GetLpPoolDataRPCParams } from './types';
|
|
2
|
+
import { RestClient, GetLpPoolPositionRPCResponse } from '@reyaxyz/common';
|
|
3
3
|
export default class LpClient extends RestClient {
|
|
4
4
|
getLpPools(): Promise<GetLpPoolsResult>;
|
|
5
5
|
getLpPoolDataRPC(params: GetLpPoolDataRPCParams): Promise<GetLpPoolPositionRPCResponse>;
|
|
6
6
|
getLpPoolWithdrawBalance(params: GetLpPoolWithdrawBalanceParams): Promise<GetLpPoolWithdrawBalanceResult>;
|
|
7
|
-
getLpPoolDepthChartSimulationData(params: getLpPoolDepthChartSimulationDataParams): Promise<GetLpPoolDepthChartSimulationDataResult>;
|
|
8
7
|
pushBridgeTransaction(params: PushBridgeTransactionParams): Promise<PushBridgeTransactionResult>;
|
|
9
8
|
getPendingBridgeTransactions(params: GetPendingBridgeTransactionsParams): Promise<GetPendingBridgeTransactionsResult>;
|
|
10
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["clients/modules/lp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,8BAA8B,EAC9B,8BAA8B,EAC9B,2BAA2B,EAC3B,2BAA2B,EAC3B,kCAAkC,EAClC,kCAAkC,EAClC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["clients/modules/lp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,8BAA8B,EAC9B,8BAA8B,EAC9B,2BAA2B,EAC3B,2BAA2B,EAC3B,kCAAkC,EAClC,kCAAkC,EAClC,sBAAsB,EACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAC3E,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,UAAU;IACxC,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAKvC,gBAAgB,CACpB,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,4BAA4B,CAAC;IAOlC,wBAAwB,CAC5B,MAAM,EAAE,8BAA8B,GACrC,OAAO,CAAC,8BAA8B,CAAC;IAOpC,qBAAqB,CACzB,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,2BAA2B,CAAC;IAcjC,4BAA4B,CAChC,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,kCAAkC,CAAC;CAM/C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LpPoolEntity, LpWithdrawBalanceEntity,
|
|
1
|
+
import { LpPoolEntity, LpWithdrawBalanceEntity, MoneyInOutChainId, ReyaChainId, Address } from '@reyaxyz/common';
|
|
2
2
|
import { SocketBridgeTransactionPoolStatus } from '@reyaxyz/common';
|
|
3
3
|
export type GetLpPoolsResult = LpPoolEntity[];
|
|
4
4
|
export type GetLpPoolWithdrawBalanceParams = {
|
|
@@ -14,9 +14,6 @@ export declare enum PerformanceGranularity {
|
|
|
14
14
|
ONE_MONTH = 2592000000,
|
|
15
15
|
ONE_YEAR = 31536000000
|
|
16
16
|
}
|
|
17
|
-
export type getLpPoolDepthChartSimulationDataParams = {
|
|
18
|
-
marketId: MarketEntity['id'];
|
|
19
|
-
};
|
|
20
17
|
export type PushBridgeTransactionParams = {
|
|
21
18
|
transactionHash: string;
|
|
22
19
|
walletAddress: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/lp/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/lp/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,EACjB,WAAW,EACX,OAAO,EACR,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AAEpE,MAAM,MAAM,gBAAgB,GAAG,YAAY,EAAE,CAAC;AAE9C,MAAM,MAAM,8BAA8B,GAAG;IAC3C,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,uBAAuB,CAAC;AAErE,oBAAY,sBAAsB;IAChC,UAAU,QAAY;IACtB,QAAQ,UAAiB;IACzB,OAAO,WAAsB;IAC7B,QAAQ,YAA0B;IAClC,SAAS,aAA2B;IACpC,QAAQ,cAA4B;CACrC;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,iBAAiB,GAAG,WAAW,CAAC;IAC/C,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,aAAa,EAAE,iBAAiB,GAAG,WAAW,CAAC;IAC/C,kBAAkB,EAAE,iBAAiB,GAAG,WAAW,CAAC;IACpD,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,iCAAiC,CAAC;IAC1C,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,qBAAqB,CAAC;AAEhE,MAAM,MAAM,kCAAkC,GAAG;IAC/C,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG,qBAAqB,EAAE,CAAC;AAEzE,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC"}
|
|
@@ -4,15 +4,8 @@ export * from './modules/lp/types';
|
|
|
4
4
|
export * from './modules/markets/types';
|
|
5
5
|
export * from './modules/tokens/types';
|
|
6
6
|
export * from './modules/owner/types';
|
|
7
|
-
export * from './modules/deposit-existing-MA.simulation/types';
|
|
8
|
-
export * from './modules/deposit-new-MA.simulation/types';
|
|
9
7
|
export * from './modules/deposit-passive-pool.simulation/types';
|
|
10
|
-
export * from './modules/edit-collateral.simulation/types';
|
|
11
|
-
export * from './modules/withdraw-MA.simulation/types';
|
|
12
8
|
export * from './modules/withdraw-passive-pool.simulation/types';
|
|
13
|
-
export * from './modules/transfer-margin-between-MAs.simulation/types';
|
|
14
|
-
export * from './modules/transfer-MA-Pool.simulation/types';
|
|
15
9
|
export * from './modules/funding-rate/types';
|
|
16
|
-
export * from './modules/depth-chart.simulation/types';
|
|
17
10
|
export * from './modules/deposit-passive-pool.simulation/types';
|
|
18
11
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,2BAA2B,EAC3B,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,+BAA+B,EAC/B,sCAAsC,EACtC,0CAA0C,EAC1C,iDAAiD,EACjD,0CAA0C,EAC1C,mCAAmC,EACnC,6BAA6B,EAC7B,6BAA6B,EAC7B,mCAAmC,GACpC,MAAM,iBAAiB,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,
|
|
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,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,2BAA2B,EAC3B,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,+BAA+B,EAC/B,sCAAsC,EACtC,0CAA0C,EAC1C,iDAAiD,EACjD,0CAA0C,EAC1C,mCAAmC,EACnC,6BAA6B,EAC7B,6BAA6B,EAC7B,mCAAmC,GACpC,MAAM,iBAAiB,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iDAAiD,CAAC;AAChE,cAAc,kDAAkD,CAAC;AACjE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iDAAiD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/api-sdk",
|
|
3
|
-
"version": "0.169.
|
|
3
|
+
"version": "0.169.7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -33,15 +33,14 @@
|
|
|
33
33
|
"generate:coverage-badges": "npx istanbul-badges-readme --silent"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@reyaxyz/common": "0.364.
|
|
36
|
+
"@reyaxyz/common": "0.364.3",
|
|
37
37
|
"@simplewebauthn/types": "10.0.0",
|
|
38
|
-
"bignumber.js": "9.1.2",
|
|
39
38
|
"ethers": "6.17.0",
|
|
40
39
|
"isomorphic-ws": "5.0.0"
|
|
41
40
|
},
|
|
42
41
|
"packageManager": "pnpm@8.3.1",
|
|
43
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "1c6277272f43eec3dc346d85fd81cc6f459bc9d5",
|
|
44
43
|
"devDependencies": {
|
|
45
|
-
"@reyaxyz/database": "0.174.
|
|
44
|
+
"@reyaxyz/database": "0.174.4"
|
|
46
45
|
}
|
|
47
46
|
}
|
|
@@ -6,15 +6,8 @@ import AccountClient from './modules/account';
|
|
|
6
6
|
import LpClient from './modules/lp';
|
|
7
7
|
import TokensClient from './modules/tokens';
|
|
8
8
|
import OwnerClient from './modules/owner';
|
|
9
|
-
import EditCollateralSimulationClient from './modules/edit-collateral.simulation';
|
|
10
|
-
import DepositExistingMASimulationClient from './modules/deposit-existing-MA.simulation';
|
|
11
|
-
import DepositNewMASimulationClient from './modules/deposit-new-MA.simulation';
|
|
12
9
|
import DepositPassivePoolSimulationClient from './modules/deposit-passive-pool.simulation';
|
|
13
|
-
import WithdrawMASimulationClient from './modules/withdraw-MA.simulation';
|
|
14
10
|
import WithdrawPassivePoolSimulationClient from './modules/withdraw-passive-pool.simulation';
|
|
15
|
-
import TransferMarginBetweenMAsSimulationClient from './modules/transfer-margin-between-MAs.simulation';
|
|
16
|
-
import TransferMAPoolSimulationClient from './modules/transfer-MA-Pool.simulation';
|
|
17
|
-
import DepthChartSimulationClient from './modules/depth-chart.simulation';
|
|
18
11
|
import FundingRateClient from './modules/funding-rate';
|
|
19
12
|
|
|
20
13
|
/**
|
|
@@ -27,15 +20,8 @@ export class ApiClient {
|
|
|
27
20
|
private readonly _account: AccountClient;
|
|
28
21
|
private readonly _lp: LpClient;
|
|
29
22
|
private readonly _fundingRateHistory: FundingRateClient;
|
|
30
|
-
private readonly _editCollateralSimulation: EditCollateralSimulationClient;
|
|
31
|
-
private readonly _depositExistingMASimulation: DepositExistingMASimulationClient;
|
|
32
|
-
private readonly _depositNewMASimulation: DepositNewMASimulationClient;
|
|
33
23
|
private readonly _depositPassivePoolSimulation: DepositPassivePoolSimulationClient;
|
|
34
|
-
private readonly _withdrawMASimulation: WithdrawMASimulationClient;
|
|
35
24
|
private readonly _withdrawPassivePoolSimulation: WithdrawPassivePoolSimulationClient;
|
|
36
|
-
private readonly _transferMarginBetweenMAsSimulation: TransferMarginBetweenMAsSimulationClient;
|
|
37
|
-
private readonly _transferMAPoolSimulation: TransferMAPoolSimulationClient;
|
|
38
|
-
private readonly _depthSimulation: DepthChartSimulationClient;
|
|
39
25
|
private readonly _tokens: TokensClient;
|
|
40
26
|
private readonly _owner: OwnerClient;
|
|
41
27
|
|
|
@@ -49,40 +35,14 @@ export class ApiClient {
|
|
|
49
35
|
this._account = new AccountClient(ApiClient.config.apiEndpoint);
|
|
50
36
|
this._lp = new LpClient(ApiClient.config.apiEndpoint);
|
|
51
37
|
this._fundingRateHistory = new FundingRateClient(this._markets);
|
|
52
|
-
this._editCollateralSimulation = new EditCollateralSimulationClient(
|
|
53
|
-
ApiClient.network,
|
|
54
|
-
this._account,
|
|
55
|
-
);
|
|
56
|
-
this._depositExistingMASimulation = new DepositExistingMASimulationClient(
|
|
57
|
-
this._editCollateralSimulation,
|
|
58
|
-
ApiClient.config.apiEndpoint,
|
|
59
|
-
);
|
|
60
|
-
this._depositNewMASimulation = new DepositNewMASimulationClient(
|
|
61
|
-
this._depositExistingMASimulation,
|
|
62
|
-
);
|
|
63
38
|
this._depositPassivePoolSimulation = new DepositPassivePoolSimulationClient(
|
|
64
39
|
ApiClient.config.apiEndpoint,
|
|
65
40
|
);
|
|
66
|
-
this._withdrawMASimulation = new WithdrawMASimulationClient(
|
|
67
|
-
this._editCollateralSimulation,
|
|
68
|
-
ApiClient.config.chain,
|
|
69
|
-
ApiClient.config.apiEndpoint,
|
|
70
|
-
);
|
|
71
41
|
this._withdrawPassivePoolSimulation =
|
|
72
42
|
new WithdrawPassivePoolSimulationClient(
|
|
73
43
|
ApiClient.config.chain,
|
|
74
44
|
ApiClient.config.apiEndpoint,
|
|
75
45
|
);
|
|
76
|
-
this._transferMarginBetweenMAsSimulation =
|
|
77
|
-
new TransferMarginBetweenMAsSimulationClient(
|
|
78
|
-
ApiClient.network,
|
|
79
|
-
this._account,
|
|
80
|
-
);
|
|
81
|
-
this._transferMAPoolSimulation = new TransferMAPoolSimulationClient(
|
|
82
|
-
this._editCollateralSimulation,
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
this._depthSimulation = new DepthChartSimulationClient(this._lp);
|
|
86
46
|
this._tokens = new TokensClient(ApiClient.config.apiEndpoint);
|
|
87
47
|
this._owner = new OwnerClient(ApiClient.config.apiEndpoint);
|
|
88
48
|
}
|
|
@@ -140,71 +100,6 @@ export class ApiClient {
|
|
|
140
100
|
return ApiClient.getInstance()._fundingRateHistory;
|
|
141
101
|
}
|
|
142
102
|
|
|
143
|
-
/**
|
|
144
|
-
* Retrieves the DepthChartSimulationClient instance used for depth simulation.
|
|
145
|
-
* This method provides access to the depth simulation client through the ApiClient.
|
|
146
|
-
* @returns {DepthChartSimulationClient} The DepthChartSimulationClient instance.
|
|
147
|
-
* @static
|
|
148
|
-
* @public
|
|
149
|
-
*/
|
|
150
|
-
public static get depthSimulation(): DepthChartSimulationClient {
|
|
151
|
-
return ApiClient.getInstance()._depthSimulation;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Provides access to the EditCollateralSimulationClient instance.
|
|
156
|
-
* This getter allows for interacting with edit collateral simulation functionalities.
|
|
157
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
158
|
-
* private `_editCollateralSimulation` property, ensuring that edit collateral simulation operations
|
|
159
|
-
* use a consistent client configuration and state.
|
|
160
|
-
*
|
|
161
|
-
* @returns {EditCollateralSimulationClient} An instance of EditCollateralSimulationClient for edit collateral simulation operations.
|
|
162
|
-
* @memberof ApiClient
|
|
163
|
-
* @example
|
|
164
|
-
* // Access the edit collateral simulation client from the ApiClient
|
|
165
|
-
* const editCollateralSimulationClient = ApiClient.editCollateralSimulation;
|
|
166
|
-
*/
|
|
167
|
-
|
|
168
|
-
public static get editCollateralSimulationClient(): EditCollateralSimulationClient {
|
|
169
|
-
return ApiClient.getInstance()._editCollateralSimulation;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Provides access to the DepositExistingMASimulationClient instance.
|
|
174
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
175
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
176
|
-
* private `_depositExistingMASimulation` property, ensuring that trade simulation operations
|
|
177
|
-
* use a consistent client configuration and state.
|
|
178
|
-
*
|
|
179
|
-
* @returns {DepositExistingMASimulationClient} An instance of DepositExistingMASimulationClient for trade simulation operations.
|
|
180
|
-
* @memberof ApiClient
|
|
181
|
-
* @example
|
|
182
|
-
* // Access the deposit existing Ma simulation client from the ApiClient
|
|
183
|
-
* const depositExistingMASimulationClient = ApiClient.depositExistingMASimulation;
|
|
184
|
-
*/
|
|
185
|
-
|
|
186
|
-
public static get depositExistingMASimulation(): DepositExistingMASimulationClient {
|
|
187
|
-
return ApiClient.getInstance()._depositExistingMASimulation;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Provides access to the DepositNewMASimulationClient instance.
|
|
192
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
193
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
194
|
-
* private `_depositNewMASimulation` property, ensuring that trade simulation operations
|
|
195
|
-
* use a consistent client configuration and state.
|
|
196
|
-
*
|
|
197
|
-
* @returns {DepositNewMASimulationClient} An instance of DepositNewMASimulationClient for trade simulation operations.
|
|
198
|
-
* @memberof ApiClient
|
|
199
|
-
* @example
|
|
200
|
-
* // Access the deposit new MA simulation client from the ApiClient
|
|
201
|
-
* const depositNewMASimulationClient = ApiClient.depositNewMASimulation;
|
|
202
|
-
*/
|
|
203
|
-
|
|
204
|
-
public static get depositNewMASimulation(): DepositNewMASimulationClient {
|
|
205
|
-
return ApiClient.getInstance()._depositNewMASimulation;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
103
|
/**
|
|
209
104
|
* Provides access to the DepositPassivePoolSimulationClient instance.
|
|
210
105
|
* This getter allows for interacting with trade simulation functionalities.
|
|
@@ -223,24 +118,6 @@ export class ApiClient {
|
|
|
223
118
|
return ApiClient.getInstance()._depositPassivePoolSimulation;
|
|
224
119
|
}
|
|
225
120
|
|
|
226
|
-
/**
|
|
227
|
-
* Provides access to the WithdrawMASimulationClient instance.
|
|
228
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
229
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
230
|
-
* private `_withdrawMASimulation` property, ensuring that trade simulation operations
|
|
231
|
-
* use a consistent client configuration and state.
|
|
232
|
-
*
|
|
233
|
-
* @returns {WithdrawMASimulationClient} An instance of WithdrawMASimulationClient for trade simulation operations.
|
|
234
|
-
* @memberof ApiClient
|
|
235
|
-
* @example
|
|
236
|
-
* // Access the withdraw MA simulation client from the ApiClient
|
|
237
|
-
* const withdrawMASimulationClient = ApiClient.withdrawMASimulation;
|
|
238
|
-
*/
|
|
239
|
-
|
|
240
|
-
public static get withdrawMASimulation(): WithdrawMASimulationClient {
|
|
241
|
-
return ApiClient.getInstance()._withdrawMASimulation;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
121
|
/**
|
|
245
122
|
* Provides access to the WithdrawPassivePoolSimulationClient instance.
|
|
246
123
|
* This getter allows for interacting with trade simulation functionalities.
|
|
@@ -259,42 +136,6 @@ export class ApiClient {
|
|
|
259
136
|
return ApiClient.getInstance()._withdrawPassivePoolSimulation;
|
|
260
137
|
}
|
|
261
138
|
|
|
262
|
-
/**
|
|
263
|
-
* Provides access to the TransferMarginBetweenMAsSimulationClient instance.
|
|
264
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
265
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
266
|
-
* private `_transferMarginBetweenMAsSimulation` property, ensuring that trade simulation operations
|
|
267
|
-
* use a consistent client configuration and state.
|
|
268
|
-
*
|
|
269
|
-
* @returns {TransferMarginBetweenMAsSimulationClient} An instance of TransferMarginBetweenMAsSimulationClient for trade simulation operations.
|
|
270
|
-
* @memberof ApiClient
|
|
271
|
-
* @example
|
|
272
|
-
* // Access the transfer margin between MAs simulation client from the ApiClient
|
|
273
|
-
* const transferMarginBetweenMAsSimulationClient = ApiClient.transferMarginBetweenMAsSimulation;
|
|
274
|
-
*/
|
|
275
|
-
|
|
276
|
-
public static get transferMarginBetweenMAsSimulation(): TransferMarginBetweenMAsSimulationClient {
|
|
277
|
-
return ApiClient.getInstance()._transferMarginBetweenMAsSimulation;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Provides access to the TransferMAPoolSimulationClient instance.
|
|
282
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
283
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
284
|
-
* private `_TransferMAPoolSimulation` property, ensuring that trade simulation operations
|
|
285
|
-
* use a consistent client configuration and state.
|
|
286
|
-
*
|
|
287
|
-
* @returns {TransferMAPoolSimulationClient} An instance of TransferMAPoolSimulationClient for trade simulation operations.
|
|
288
|
-
* @memberof ApiClient
|
|
289
|
-
* @example
|
|
290
|
-
* // Access the transfer from MA to Pool simulation client from the ApiClient
|
|
291
|
-
* const transferMAPoolSimulationClient = ApiClient.transferMAPoolSimulation;
|
|
292
|
-
*/
|
|
293
|
-
|
|
294
|
-
public static get transferMAPoolSimulation(): TransferMAPoolSimulationClient {
|
|
295
|
-
return ApiClient.getInstance()._transferMAPoolSimulation;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
139
|
/**
|
|
299
140
|
* Gets the current instance of the LpClient from the ApiClient.
|
|
300
141
|
*
|
|
@@ -3,11 +3,8 @@ import {
|
|
|
3
3
|
GetMarginAccountResult,
|
|
4
4
|
GetMarginAccountsParams,
|
|
5
5
|
GetMarginAccountsResult,
|
|
6
|
-
GetMaxWithdrawBalanceForAccountParams,
|
|
7
|
-
GetMaxWithdrawBalanceForAccountResult,
|
|
8
6
|
EditMarginAccountParams,
|
|
9
7
|
CloseMarginAccountParams,
|
|
10
|
-
GetEditCollateralSimulationInitialDataParams,
|
|
11
8
|
EditMarginAccountResult,
|
|
12
9
|
CloseMarginAccountResult,
|
|
13
10
|
GetMarginAccountOrderHistoryPaginatedParams,
|
|
@@ -15,11 +12,7 @@ import {
|
|
|
15
12
|
GetLiquidationHistoryForOwnerAddressResult,
|
|
16
13
|
GetLiquidationHistoryForOwnerAddressParams,
|
|
17
14
|
} from './types';
|
|
18
|
-
import {
|
|
19
|
-
EditCollateralSimulationState,
|
|
20
|
-
RestClient,
|
|
21
|
-
StrippedMarginAccountEntity,
|
|
22
|
-
} from '@reyaxyz/common';
|
|
15
|
+
import { RestClient, StrippedMarginAccountEntity } from '@reyaxyz/common';
|
|
23
16
|
|
|
24
17
|
export default class AccountClient extends RestClient {
|
|
25
18
|
/**
|
|
@@ -102,22 +95,6 @@ export default class AccountClient extends RestClient {
|
|
|
102
95
|
});
|
|
103
96
|
}
|
|
104
97
|
|
|
105
|
-
async getEditCollateralSimulationInitialData(
|
|
106
|
-
params: GetEditCollateralSimulationInitialDataParams,
|
|
107
|
-
): Promise<EditCollateralSimulationState> {
|
|
108
|
-
const uri = `/api/accounts/${params.marginAccountId}/edit-collateral-simulation-data`;
|
|
109
|
-
return this.get(uri);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
async getMaxWithdrawBalanceForAccount(
|
|
113
|
-
params: GetMaxWithdrawBalanceForAccountParams,
|
|
114
|
-
): Promise<GetMaxWithdrawBalanceForAccountResult> {
|
|
115
|
-
const uri = `/api/accounts/${params.marginAccountId}/max-withdraw-amount`;
|
|
116
|
-
return this.get(uri, {
|
|
117
|
-
assetAddress: params.tokenAddress,
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
|
|
121
98
|
// TODO: Milan validate
|
|
122
99
|
async editMarginAccount(
|
|
123
100
|
params: EditMarginAccountParams,
|
|
@@ -45,14 +45,6 @@ export type GetMaxOrderSizeAvailableResult = {
|
|
|
45
45
|
maxAmountSize: number;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
// --- Max Withdraw Balance for Margin Account ---
|
|
49
|
-
export type GetMaxWithdrawBalanceForAccountParams = {
|
|
50
|
-
marginAccountId: number;
|
|
51
|
-
tokenAddress: string;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export type GetMaxWithdrawBalanceForAccountResult = number;
|
|
55
|
-
|
|
56
48
|
export type GetPositionsForMarginAccountResult = {
|
|
57
49
|
positions: PositionEntity[];
|
|
58
50
|
totalUnrealizedPNL: number;
|
|
@@ -111,12 +103,6 @@ export type GetTransactionSimulationInitialDataParams = {
|
|
|
111
103
|
marginAccountId: number;
|
|
112
104
|
};
|
|
113
105
|
|
|
114
|
-
// ---- Edit Collateral Simulation ----
|
|
115
|
-
|
|
116
|
-
export type GetEditCollateralSimulationInitialDataParams = {
|
|
117
|
-
marginAccountId: number;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
106
|
export type GetMarginAccountBalanceChartDataParams = {
|
|
121
107
|
marginAccountId: number;
|
|
122
108
|
filters: {
|
|
@@ -7,13 +7,8 @@ import {
|
|
|
7
7
|
GetPendingBridgeTransactionsParams,
|
|
8
8
|
GetPendingBridgeTransactionsResult,
|
|
9
9
|
GetLpPoolDataRPCParams,
|
|
10
|
-
getLpPoolDepthChartSimulationDataParams,
|
|
11
10
|
} from './types';
|
|
12
|
-
import {
|
|
13
|
-
RestClient,
|
|
14
|
-
GetLpPoolPositionRPCResponse,
|
|
15
|
-
GetLpPoolDepthChartSimulationDataResult,
|
|
16
|
-
} from '@reyaxyz/common';
|
|
11
|
+
import { RestClient, GetLpPoolPositionRPCResponse } from '@reyaxyz/common';
|
|
17
12
|
export default class LpClient extends RestClient {
|
|
18
13
|
async getLpPools(): Promise<GetLpPoolsResult> {
|
|
19
14
|
const uri = '/api/lp-pools';
|
|
@@ -38,13 +33,6 @@ export default class LpClient extends RestClient {
|
|
|
38
33
|
});
|
|
39
34
|
}
|
|
40
35
|
|
|
41
|
-
async getLpPoolDepthChartSimulationData(
|
|
42
|
-
params: getLpPoolDepthChartSimulationDataParams,
|
|
43
|
-
): Promise<GetLpPoolDepthChartSimulationDataResult> {
|
|
44
|
-
const uri = `/api/lp-pools/${params.marketId}/depth-simulation-data`;
|
|
45
|
-
return this.get(uri);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
36
|
async pushBridgeTransaction(
|
|
49
37
|
params: PushBridgeTransactionParams,
|
|
50
38
|
): Promise<PushBridgeTransactionResult> {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LpPoolEntity,
|
|
3
3
|
LpWithdrawBalanceEntity,
|
|
4
|
-
MarketEntity,
|
|
5
4
|
MoneyInOutChainId,
|
|
6
5
|
ReyaChainId,
|
|
7
6
|
Address,
|
|
@@ -27,10 +26,6 @@ export enum PerformanceGranularity {
|
|
|
27
26
|
ONE_YEAR = 365 * 24 * 60 * 60 * 1000,
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
export type getLpPoolDepthChartSimulationDataParams = {
|
|
31
|
-
marketId: MarketEntity['id'];
|
|
32
|
-
};
|
|
33
|
-
|
|
34
29
|
export type PushBridgeTransactionParams = {
|
|
35
30
|
transactionHash: string;
|
|
36
31
|
walletAddress: string;
|
package/src/clients/types.ts
CHANGED
|
@@ -27,14 +27,7 @@ export * from './modules/lp/types';
|
|
|
27
27
|
export * from './modules/markets/types';
|
|
28
28
|
export * from './modules/tokens/types';
|
|
29
29
|
export * from './modules/owner/types';
|
|
30
|
-
export * from './modules/deposit-existing-MA.simulation/types';
|
|
31
|
-
export * from './modules/deposit-new-MA.simulation/types';
|
|
32
30
|
export * from './modules/deposit-passive-pool.simulation/types';
|
|
33
|
-
export * from './modules/edit-collateral.simulation/types';
|
|
34
|
-
export * from './modules/withdraw-MA.simulation/types';
|
|
35
31
|
export * from './modules/withdraw-passive-pool.simulation/types';
|
|
36
|
-
export * from './modules/transfer-margin-between-MAs.simulation/types';
|
|
37
|
-
export * from './modules/transfer-MA-Pool.simulation/types';
|
|
38
32
|
export * from './modules/funding-rate/types';
|
|
39
|
-
export * from './modules/depth-chart.simulation/types';
|
|
40
33
|
export * from './modules/deposit-passive-pool.simulation/types';
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
exports.BinanceFuturesClient = void 0;
|
|
55
|
-
var common_1 = require("@reyaxyz/common");
|
|
56
|
-
// docs: https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api
|
|
57
|
-
var BinanceFuturesClient = /** @class */ (function (_super) {
|
|
58
|
-
__extends(BinanceFuturesClient, _super);
|
|
59
|
-
function BinanceFuturesClient() {
|
|
60
|
-
return _super.call(this, 'https://fapi.binance.com/fapi/v1/', 10000) || this;
|
|
61
|
-
}
|
|
62
|
-
BinanceFuturesClient.prototype.getCandles = function (symbol, interval, startTimeMS, endTimeMS) {
|
|
63
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
64
|
-
var timeMS, response, batchAPI, batch;
|
|
65
|
-
return __generator(this, function (_a) {
|
|
66
|
-
switch (_a.label) {
|
|
67
|
-
case 0:
|
|
68
|
-
timeMS = startTimeMS;
|
|
69
|
-
response = [];
|
|
70
|
-
_a.label = 1;
|
|
71
|
-
case 1:
|
|
72
|
-
if (!(timeMS < endTimeMS)) return [3 /*break*/, 3];
|
|
73
|
-
return [4 /*yield*/, this.get("markPriceKlines", {
|
|
74
|
-
symbol: symbol,
|
|
75
|
-
interval: interval,
|
|
76
|
-
startTime: timeMS,
|
|
77
|
-
endTime: endTimeMS - 1,
|
|
78
|
-
limit: 1500,
|
|
79
|
-
})];
|
|
80
|
-
case 2:
|
|
81
|
-
batchAPI = _a.sent();
|
|
82
|
-
if (batchAPI.length === 0) {
|
|
83
|
-
return [3 /*break*/, 3];
|
|
84
|
-
}
|
|
85
|
-
batch = batchAPI.map(function (e) { return ({
|
|
86
|
-
openTimeMS: Number(e[0]),
|
|
87
|
-
open: Number(e[1]),
|
|
88
|
-
high: Number(e[2]),
|
|
89
|
-
low: Number(e[3]),
|
|
90
|
-
close: Number(e[4]),
|
|
91
|
-
closeTimeMS: Number(e[6]),
|
|
92
|
-
}); });
|
|
93
|
-
response.push.apply(response, batch);
|
|
94
|
-
timeMS = batch[batch.length - 1].closeTimeMS + 1;
|
|
95
|
-
return [3 /*break*/, 1];
|
|
96
|
-
case 3: return [2 /*return*/, response];
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
};
|
|
101
|
-
return BinanceFuturesClient;
|
|
102
|
-
}(common_1.RestClient));
|
|
103
|
-
exports.BinanceFuturesClient = BinanceFuturesClient;
|
|
104
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/binance/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA6C;AAG7C,mGAAmG;AAEnG;IAA0C,wCAAU;IAClD;QACE,OAAA,MAAK,YAAC,mCAAmC,EAAE,KAAM,CAAC,SAAC;IACrD,CAAC;IAEK,yCAAU,GAAhB,UACE,MAAc,EACd,QAA+B,EAC/B,WAAmB,EACnB,SAAiB;;;;;;wBAEb,MAAM,GAAG,WAAW,CAAC;wBACnB,QAAQ,GAAoB,EAAE,CAAC;;;6BAE9B,CAAA,MAAM,GAAG,SAAS,CAAA;wBACN,qBAAM,IAAI,CAAC,GAAG,CAAa,iBAAiB,EAAE;gCAC7D,MAAM,QAAA;gCACN,QAAQ,UAAA;gCACR,SAAS,EAAE,MAAM;gCACjB,OAAO,EAAE,SAAS,GAAG,CAAC;gCACtB,KAAK,EAAE,IAAI;6BACZ,CAAC,EAAA;;wBANI,QAAQ,GAAG,SAMf;wBAEF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;4BAC1B,wBAAM;wBACR,CAAC;wBAEK,KAAK,GAAG,QAAQ,CAAC,GAAG,CACxB,UAAC,CAAC,IAAoB,OAAA,CAAC;4BACrB,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;4BACxB,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;4BAClB,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;4BAClB,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;4BACjB,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;4BACnB,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;yBAC1B,CAAC,EAPoB,CAOpB,CACH,CAAC;wBAEF,QAAQ,CAAC,IAAI,OAAb,QAAQ,EAAS,KAAK,EAAE;wBACxB,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC;;4BAGnD,sBAAO,QAAQ,EAAC;;;;KACjB;IACH,2BAAC;AAAD,CAAC,AA5CD,CAA0C,mBAAU,GA4CnD;AA5CY,oDAAoB","sourcesContent":["import { RestClient } from '@reyaxyz/common';\nimport { BinanceCandle, BinanceCandleInterval } from './types';\n\n// docs: https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api\n\nexport class BinanceFuturesClient extends RestClient {\n constructor() {\n super('https://fapi.binance.com/fapi/v1/', 10_000);\n }\n\n async getCandles(\n symbol: string,\n interval: BinanceCandleInterval,\n startTimeMS: number,\n endTimeMS: number,\n ): Promise<BinanceCandle[]> {\n let timeMS = startTimeMS;\n const response: BinanceCandle[] = [];\n\n while (timeMS < endTimeMS) {\n const batchAPI = await this.get<number[][]>(`markPriceKlines`, {\n symbol,\n interval,\n startTime: timeMS,\n endTime: endTimeMS - 1,\n limit: 1500,\n });\n\n if (batchAPI.length === 0) {\n break;\n }\n\n const batch = batchAPI.map(\n (e): BinanceCandle => ({\n openTimeMS: Number(e[0]),\n open: Number(e[1]),\n high: Number(e[2]),\n low: Number(e[3]),\n close: Number(e[4]),\n closeTimeMS: Number(e[6]),\n }),\n );\n\n response.push(...batch);\n timeMS = batch[batch.length - 1].closeTimeMS + 1;\n }\n\n return response;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/binance/types.ts"],"names":[],"mappings":"","sourcesContent":["export type BinanceCandle = {\n openTimeMS: number;\n open: number;\n high: number;\n low: number;\n close: number;\n closeTimeMS: number;\n};\n\nexport type BinanceCandleInterval =\n | '1m'\n | '3m'\n | '5m'\n | '15m'\n | '30m'\n | '1h'\n | '2h'\n | '4h'\n | '6h'\n | '8h'\n | '12h'\n | '1d'\n | '3d'\n | '1w'\n | '1M';\n"]}
|