@reyaxyz/api-sdk 0.157.0 → 0.158.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 +0 -60
- package/dist/clients/api-client.js.map +1 -1
- package/dist/clients/modules/account/index.js +0 -89
- package/dist/clients/modules/account/index.js.map +1 -1
- package/dist/clients/modules/markets/index.js +0 -15
- package/dist/clients/modules/markets/index.js.map +1 -1
- package/dist/clients/modules/owner/index.js +0 -36
- package/dist/clients/modules/owner/index.js.map +1 -1
- package/dist/clients/types.js +0 -3
- package/dist/clients/types.js.map +1 -1
- package/dist/types/clients/api-client.d.ts +0 -42
- package/dist/types/clients/api-client.d.ts.map +1 -1
- package/dist/types/clients/modules/account/index.d.ts +2 -10
- package/dist/types/clients/modules/account/index.d.ts.map +1 -1
- package/dist/types/clients/modules/markets/index.d.ts +1 -2
- package/dist/types/clients/modules/markets/index.d.ts.map +1 -1
- package/dist/types/clients/modules/owner/index.d.ts +1 -5
- package/dist/types/clients/modules/owner/index.d.ts.map +1 -1
- package/dist/types/clients/socket-client.d.ts +1 -1
- package/dist/types/clients/types.d.ts +0 -3
- package/dist/types/clients/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/clients/api-client.ts +0 -58
- package/src/clients/modules/account/index.ts +1 -93
- package/src/clients/modules/markets/index.ts +1 -12
- package/src/clients/modules/owner/index.ts +0 -36
- package/src/clients/types.ts +0 -3
- package/dist/clients/modules/isolated-order.simulation/index.js +0 -302
- package/dist/clients/modules/isolated-order.simulation/index.js.map +0 -1
- package/dist/clients/modules/isolated-order.simulation/types.js +0 -3
- package/dist/clients/modules/isolated-order.simulation/types.js.map +0 -1
- package/dist/clients/modules/rage-trade/index.js +0 -99
- package/dist/clients/modules/rage-trade/index.js.map +0 -1
- package/dist/clients/modules/rage-trade/types.js +0 -3
- package/dist/clients/modules/rage-trade/types.js.map +0 -1
- package/dist/clients/modules/trade.simulation/index.js +0 -331
- package/dist/clients/modules/trade.simulation/index.js.map +0 -1
- package/dist/clients/modules/trade.simulation/types.js +0 -3
- package/dist/clients/modules/trade.simulation/types.js.map +0 -1
- package/dist/clients/modules/trade.simulation/utils.js +0 -35
- package/dist/clients/modules/trade.simulation/utils.js.map +0 -1
- package/dist/types/clients/modules/isolated-order.simulation/index.d.ts +0 -24
- package/dist/types/clients/modules/isolated-order.simulation/index.d.ts.map +0 -1
- package/dist/types/clients/modules/isolated-order.simulation/types.d.ts +0 -44
- package/dist/types/clients/modules/isolated-order.simulation/types.d.ts.map +0 -1
- package/dist/types/clients/modules/rage-trade/index.d.ts +0 -9
- package/dist/types/clients/modules/rage-trade/index.d.ts.map +0 -1
- package/dist/types/clients/modules/rage-trade/types.d.ts +0 -80
- package/dist/types/clients/modules/rage-trade/types.d.ts.map +0 -1
- package/dist/types/clients/modules/trade.simulation/index.d.ts +0 -22
- package/dist/types/clients/modules/trade.simulation/index.d.ts.map +0 -1
- package/dist/types/clients/modules/trade.simulation/types.d.ts +0 -85
- package/dist/types/clients/modules/trade.simulation/types.d.ts.map +0 -1
- package/dist/types/clients/modules/trade.simulation/utils.d.ts +0 -8
- package/dist/types/clients/modules/trade.simulation/utils.d.ts.map +0 -1
- package/src/clients/modules/isolated-order.simulation/index.ts +0 -490
- package/src/clients/modules/isolated-order.simulation/types.ts +0 -55
- package/src/clients/modules/rage-trade/index.ts +0 -38
- package/src/clients/modules/rage-trade/types.ts +0 -91
- package/src/clients/modules/trade.simulation/index.ts +0 -534
- package/src/clients/modules/trade.simulation/types.ts +0 -98
- package/src/clients/modules/trade.simulation/utils.ts +0 -52
|
@@ -7,7 +7,6 @@ exports.ApiClient = void 0;
|
|
|
7
7
|
var common_1 = require("@reyaxyz/common");
|
|
8
8
|
var markets_1 = __importDefault(require("./modules/markets"));
|
|
9
9
|
var account_1 = __importDefault(require("./modules/account"));
|
|
10
|
-
var trade_simulation_1 = __importDefault(require("./modules/trade.simulation"));
|
|
11
10
|
var lp_1 = __importDefault(require("./modules/lp"));
|
|
12
11
|
var tokens_1 = __importDefault(require("./modules/tokens"));
|
|
13
12
|
var owner_1 = __importDefault(require("./modules/owner"));
|
|
@@ -21,11 +20,9 @@ var transfer_margin_between_MAs_simulation_1 = __importDefault(require("./module
|
|
|
21
20
|
var transfer_MA_Pool_simulation_1 = __importDefault(require("./modules/transfer-MA-Pool.simulation"));
|
|
22
21
|
var depth_chart_simulation_1 = __importDefault(require("./modules/depth-chart.simulation"));
|
|
23
22
|
var funding_rate_1 = __importDefault(require("./modules/funding-rate"));
|
|
24
|
-
var isolated_order_simulation_1 = __importDefault(require("./modules/isolated-order.simulation"));
|
|
25
23
|
var conditional_orders_1 = __importDefault(require("./modules/conditional-orders"));
|
|
26
24
|
var referral_1 = __importDefault(require("./modules/referral"));
|
|
27
25
|
var auth_1 = __importDefault(require("./modules/auth"));
|
|
28
|
-
var rage_trade_1 = __importDefault(require("./modules/rage-trade"));
|
|
29
26
|
/**
|
|
30
27
|
* @description Client for API
|
|
31
28
|
*/
|
|
@@ -34,8 +31,6 @@ var ApiClient = /** @class */ (function () {
|
|
|
34
31
|
this._markets = new markets_1.default(ApiClient.config.apiEndpoint);
|
|
35
32
|
this._account = new account_1.default(ApiClient.config.apiEndpoint);
|
|
36
33
|
this._lp = new lp_1.default(ApiClient.config.apiEndpoint);
|
|
37
|
-
this._tradeSimulation = new trade_simulation_1.default(this._account);
|
|
38
|
-
this._isolatedOrderSimulation = new isolated_order_simulation_1.default(this._account);
|
|
39
34
|
this._fundingRateHistory = new funding_rate_1.default(this._markets);
|
|
40
35
|
this._editCollateralSimulation = new edit_collateral_simulation_1.default(ApiClient.network, this._account);
|
|
41
36
|
this._depositExistingMASimulation = new deposit_existing_MA_simulation_1.default(this._editCollateralSimulation, ApiClient.config.apiEndpoint);
|
|
@@ -52,7 +47,6 @@ var ApiClient = /** @class */ (function () {
|
|
|
52
47
|
this._owner = new owner_1.default(ApiClient.config.apiEndpoint);
|
|
53
48
|
this._conditionalOrders = new conditional_orders_1.default(ApiClient.network, ApiClient.config.apiEndpoint);
|
|
54
49
|
this._referral = new referral_1.default(ApiClient.config.apiEndpoint);
|
|
55
|
-
this._rageTrade = new rage_trade_1.default(ApiClient.config.apiEndpoint);
|
|
56
50
|
this._auth = new auth_1.default(ApiClient.config.apiEndpoint);
|
|
57
51
|
}
|
|
58
52
|
ApiClient.configure = function (environment) {
|
|
@@ -103,46 +97,6 @@ var ApiClient = /** @class */ (function () {
|
|
|
103
97
|
enumerable: false,
|
|
104
98
|
configurable: true
|
|
105
99
|
});
|
|
106
|
-
Object.defineProperty(ApiClient, "tradeSimulation", {
|
|
107
|
-
/**
|
|
108
|
-
* Provides access to the TradeSimulationClient instance.
|
|
109
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
110
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
111
|
-
* private `_tradeSimulation` property, ensuring that trade simulation operations
|
|
112
|
-
* use a consistent client configuration and state.
|
|
113
|
-
*
|
|
114
|
-
* @returns {TradeSimulationClient} An instance of TradeSimulationClient for trade simulation operations.
|
|
115
|
-
* @memberof ApiClient
|
|
116
|
-
* @example
|
|
117
|
-
* // Access the trade simulation client from the ApiClient
|
|
118
|
-
* const tradeSimulationClient = ApiClient.tradeSimulation;
|
|
119
|
-
*/
|
|
120
|
-
get: function () {
|
|
121
|
-
return ApiClient.getInstance()._tradeSimulation;
|
|
122
|
-
},
|
|
123
|
-
enumerable: false,
|
|
124
|
-
configurable: true
|
|
125
|
-
});
|
|
126
|
-
Object.defineProperty(ApiClient, "isolatedSimulation", {
|
|
127
|
-
/**
|
|
128
|
-
* Provides access to the IsolatedOrderSimulationClient instance.
|
|
129
|
-
* This getter allows for interacting with isolatedTrade simulation functionalities.
|
|
130
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
131
|
-
* private `_isolatedTradeSimulation` property, ensuring that isolatedTrade simulation operations
|
|
132
|
-
* use a consistent client configuration and state.
|
|
133
|
-
*
|
|
134
|
-
* @returns {IsolatedOrderSimulationClient} An instance of IsolatedOrderSimulationClient for isolatedTrade simulation operations.
|
|
135
|
-
* @memberof ApiClient
|
|
136
|
-
* @example
|
|
137
|
-
* // Access the isolatedTrade simulation client from the ApiClient
|
|
138
|
-
* const isolatedTradeSimulationClient = ApiClient.isolatedTradeSimulation;
|
|
139
|
-
*/
|
|
140
|
-
get: function () {
|
|
141
|
-
return ApiClient.getInstance()._isolatedOrderSimulation;
|
|
142
|
-
},
|
|
143
|
-
enumerable: false,
|
|
144
|
-
configurable: true
|
|
145
|
-
});
|
|
146
100
|
Object.defineProperty(ApiClient, "fundingRateHistory", {
|
|
147
101
|
get: function () {
|
|
148
102
|
return ApiClient.getInstance()._fundingRateHistory;
|
|
@@ -403,20 +357,6 @@ var ApiClient = /** @class */ (function () {
|
|
|
403
357
|
enumerable: false,
|
|
404
358
|
configurable: true
|
|
405
359
|
});
|
|
406
|
-
Object.defineProperty(ApiClient, "rageTrade", {
|
|
407
|
-
/**
|
|
408
|
-
* Gets the current instance of the RageTradeClient from the ApiClient.
|
|
409
|
-
*
|
|
410
|
-
* This static getter allows access to the RageTradeClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the RageTradeClient directly, bypassing the need to manually access the internal `_rageTrade` property of the ApiClient instance.
|
|
411
|
-
*
|
|
412
|
-
* @returns {RageTradeClient} The RageTradeClient instance currently held by the ApiClient.
|
|
413
|
-
*/
|
|
414
|
-
get: function () {
|
|
415
|
-
return ApiClient.getInstance()._rageTrade;
|
|
416
|
-
},
|
|
417
|
-
enumerable: false,
|
|
418
|
-
configurable: true
|
|
419
|
-
});
|
|
420
360
|
Object.defineProperty(ApiClient, "auth", {
|
|
421
361
|
/**
|
|
422
362
|
* Gets the current instance of the AuthClient from the ApiClient.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.js","sourceRoot":"/","sources":["clients/api-client.ts"],"names":[],"mappings":";;;;;;AAAA,0CAIyB;AACzB,8DAA8C;AAC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;;;;;;;;WASG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC;QACzC,CAAC;;;OAAA;IAYD,sBAAkB,kBAAK;QAVvB;;;;;;;;;WASG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC;QACxC,CAAC;;;OAAA;IASD,sBAAkB,8BAAiB;QAPnC;;;;;;WAMG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,kBAAkB,CAAC;QACpD,CAAC;;;OAAA;IASD,sBAAkB,qBAAQ;QAP1B;;;;;;WAMG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC;QAC3C,CAAC;;;OAAA;IAUD,sBAAkB,sBAAS;QAR3B;;;;;;WAMG;aAEH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC;QAC5C,CAAC;;;OAAA;IASD,sBAAkB,iBAAI;QAPtB;;;;;;WAMG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC;QACvC,CAAC;;;OAAA;IA9Yc,gBAAM,GAAkB,IAAA,2BAAkB,EAAC,MAAM,CAAC,CAAC;IA+YpE,gBAAC;CAAA,AAjZD,IAiZC;AAjZY,8BAAS","sourcesContent":["import {\n ServiceConfig,\n ReyaChainId,\n getApiClientConfig,\n} from '@reyaxyz/common';\nimport MarketsClient from './modules/markets';\nimport AccountClient from './modules/account';\nimport TradeSimulationClient from './modules/trade.simulation';\nimport LpClient from './modules/lp';\nimport TokensClient from './modules/tokens';\nimport OwnerClient from './modules/owner';\nimport EditCollateralSimulationClient from './modules/edit-collateral.simulation';\nimport DepositExistingMASimulationClient from './modules/deposit-existing-MA.simulation';\nimport DepositNewMASimulationClient from './modules/deposit-new-MA.simulation';\nimport DepositPassivePoolSimulationClient from './modules/deposit-passive-pool.simulation';\nimport WithdrawMASimulationClient from './modules/withdraw-MA.simulation';\nimport WithdrawPassivePoolSimulationClient from './modules/withdraw-passive-pool.simulation';\nimport TransferMarginBetweenMAsSimulationClient from './modules/transfer-margin-between-MAs.simulation';\nimport TransferMAPoolSimulationClient from './modules/transfer-MA-Pool.simulation';\nimport DepthChartSimulationClient from './modules/depth-chart.simulation';\nimport FundingRateClient from './modules/funding-rate';\nimport IsolatedOrderSimulationClient from './modules/isolated-order.simulation';\nimport ConditionalOrdersClient from './modules/conditional-orders';\nimport ReferralClient from './modules/referral';\nimport AuthClient from './modules/auth';\nimport RageTradeClient from './modules/rage-trade';\n\n/**\n * @description Client for API\n */\nexport class ApiClient {\n private static instance: ApiClient;\n private static config: ServiceConfig = getApiClientConfig('test');\n private readonly _markets: MarketsClient;\n private readonly _account: AccountClient;\n private readonly _lp: LpClient;\n private readonly _tradeSimulation: TradeSimulationClient;\n private readonly _fundingRateHistory: FundingRateClient;\n private readonly _editCollateralSimulation: EditCollateralSimulationClient;\n private readonly _depositExistingMASimulation: DepositExistingMASimulationClient;\n private readonly _depositNewMASimulation: DepositNewMASimulationClient;\n private readonly _depositPassivePoolSimulation: DepositPassivePoolSimulationClient;\n private readonly _withdrawMASimulation: WithdrawMASimulationClient;\n private readonly _withdrawPassivePoolSimulation: WithdrawPassivePoolSimulationClient;\n private readonly _transferMarginBetweenMAsSimulation: TransferMarginBetweenMAsSimulationClient;\n private readonly _transferMAPoolSimulation: TransferMAPoolSimulationClient;\n private readonly _depthSimulation: DepthChartSimulationClient;\n private readonly _isolatedOrderSimulation: IsolatedOrderSimulationClient;\n private readonly _tokens: TokensClient;\n private readonly _owner: OwnerClient;\n private readonly _conditionalOrders: ConditionalOrdersClient;\n private readonly _referral: ReferralClient;\n private readonly _rageTrade: RageTradeClient;\n private readonly _auth: AuthClient;\n\n private constructor() {\n this._markets = new MarketsClient(ApiClient.config.apiEndpoint);\n this._account = new AccountClient(ApiClient.config.apiEndpoint);\n this._lp = new LpClient(ApiClient.config.apiEndpoint);\n this._tradeSimulation = new TradeSimulationClient(this._account);\n this._isolatedOrderSimulation = new IsolatedOrderSimulationClient(\n this._account,\n );\n this._fundingRateHistory = new FundingRateClient(this._markets);\n this._editCollateralSimulation = new EditCollateralSimulationClient(\n ApiClient.network,\n this._account,\n );\n this._depositExistingMASimulation = new DepositExistingMASimulationClient(\n this._editCollateralSimulation,\n ApiClient.config.apiEndpoint,\n );\n this._depositNewMASimulation = new DepositNewMASimulationClient(\n this._depositExistingMASimulation,\n );\n this._depositPassivePoolSimulation = new DepositPassivePoolSimulationClient(\n ApiClient.config.apiEndpoint,\n );\n this._withdrawMASimulation = new WithdrawMASimulationClient(\n this._editCollateralSimulation,\n ApiClient.config.chain,\n ApiClient.config.apiEndpoint,\n );\n this._withdrawPassivePoolSimulation =\n new WithdrawPassivePoolSimulationClient(\n ApiClient.config.chain,\n ApiClient.config.apiEndpoint,\n );\n this._transferMarginBetweenMAsSimulation =\n new TransferMarginBetweenMAsSimulationClient(\n ApiClient.network,\n this._account,\n );\n this._transferMAPoolSimulation = new TransferMAPoolSimulationClient(\n this._editCollateralSimulation,\n );\n\n this._depthSimulation = new DepthChartSimulationClient(this._lp);\n this._tokens = new TokensClient(ApiClient.config.apiEndpoint);\n this._owner = new OwnerClient(ApiClient.config.apiEndpoint);\n this._conditionalOrders = new ConditionalOrdersClient(\n ApiClient.network,\n ApiClient.config.apiEndpoint,\n );\n this._referral = new ReferralClient(ApiClient.config.apiEndpoint);\n this._rageTrade = new RageTradeClient(ApiClient.config.apiEndpoint);\n this._auth = new AuthClient(ApiClient.config.apiEndpoint);\n }\n\n public static configure(environment: ServiceConfig['environment']): void {\n ApiClient.config = getApiClientConfig(environment);\n ApiClient.instance = new ApiClient();\n }\n\n private static getInstance(): ApiClient {\n if (!ApiClient.instance) {\n throw new Error(\n 'ApiClient is not configured. Please configure it before using.',\n );\n }\n return ApiClient.instance;\n }\n public static get network(): ReyaChainId {\n if (!ApiClient.config.chain) {\n throw new Error('ApiClient is not configured');\n }\n return ApiClient.config.chain;\n }\n\n /**\n * Provides access to the MarketsClient instance.\n * This getter allows for interacting with market-related API functionalities.\n *\n * @returns {MarketsClient} An instance of MarketsClient for market-related operations.\n * @memberof ApiClient\n */\n public static get markets(): MarketsClient {\n return ApiClient.getInstance()._markets;\n }\n\n /**\n * Provides access to the AccountClient instance.\n * This getter allows for interacting with account-related API functionalities.\n *\n * @returns {AccountClient} An instance of AccountClient for account-related operations.\n * @memberof ApiClient\n */\n public static get account(): AccountClient {\n return ApiClient.getInstance()._account;\n }\n\n /**\n * Provides access to the TradeSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_tradeSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {TradeSimulationClient} An instance of TradeSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the trade simulation client from the ApiClient\n * const tradeSimulationClient = ApiClient.tradeSimulation;\n */\n\n public static get tradeSimulation(): TradeSimulationClient {\n return ApiClient.getInstance()._tradeSimulation;\n }\n\n /**\n * Provides access to the IsolatedOrderSimulationClient instance.\n * This getter allows for interacting with isolatedTrade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_isolatedTradeSimulation` property, ensuring that isolatedTrade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {IsolatedOrderSimulationClient} An instance of IsolatedOrderSimulationClient for isolatedTrade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the isolatedTrade simulation client from the ApiClient\n * const isolatedTradeSimulationClient = ApiClient.isolatedTradeSimulation;\n */\n public static get isolatedSimulation(): IsolatedOrderSimulationClient {\n return ApiClient.getInstance()._isolatedOrderSimulation;\n }\n\n public static get fundingRateHistory(): FundingRateClient {\n return ApiClient.getInstance()._fundingRateHistory;\n }\n\n /**\n * Retrieves the DepthChartSimulationClient instance used for depth simulation.\n * This method provides access to the depth simulation client through the ApiClient.\n * @returns {DepthChartSimulationClient} The DepthChartSimulationClient instance.\n * @static\n * @public\n */\n public static get depthSimulation(): DepthChartSimulationClient {\n return ApiClient.getInstance()._depthSimulation;\n }\n\n /**\n * Provides access to the EditCollateralSimulationClient instance.\n * This getter allows for interacting with edit collateral simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_editCollateralSimulation` property, ensuring that edit collateral simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {EditCollateralSimulationClient} An instance of EditCollateralSimulationClient for edit collateral simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the edit collateral simulation client from the ApiClient\n * const editCollateralSimulationClient = ApiClient.editCollateralSimulation;\n */\n\n public static get editCollateralSimulationClient(): EditCollateralSimulationClient {\n return ApiClient.getInstance()._editCollateralSimulation;\n }\n\n /**\n * Provides access to the DepositExistingMASimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_depositExistingMASimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {DepositExistingMASimulationClient} An instance of DepositExistingMASimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the deposit existing Ma simulation client from the ApiClient\n * const depositExistingMASimulationClient = ApiClient.depositExistingMASimulation;\n */\n\n public static get depositExistingMASimulation(): DepositExistingMASimulationClient {\n return ApiClient.getInstance()._depositExistingMASimulation;\n }\n\n /**\n * Provides access to the DepositNewMASimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_depositNewMASimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {DepositNewMASimulationClient} An instance of DepositNewMASimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the deposit new MA simulation client from the ApiClient\n * const depositNewMASimulationClient = ApiClient.depositNewMASimulation;\n */\n\n public static get depositNewMASimulation(): DepositNewMASimulationClient {\n return ApiClient.getInstance()._depositNewMASimulation;\n }\n\n /**\n * Provides access to the DepositPassivePoolSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_depositPassivePoolSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {DepositPassivePoolSimulationClient} An instance of DepositPassivePoolSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the deposit existing Ma simulation client from the ApiClient\n * const depositPassivePoolSimulationClient = ApiClient.depositPassivePoolSimulation;\n */\n\n public static get depositPassivePoolSimulation(): DepositPassivePoolSimulationClient {\n return ApiClient.getInstance()._depositPassivePoolSimulation;\n }\n\n /**\n * Provides access to the WithdrawMASimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_withdrawMASimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {WithdrawMASimulationClient} An instance of WithdrawMASimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the withdraw MA simulation client from the ApiClient\n * const withdrawMASimulationClient = ApiClient.withdrawMASimulation;\n */\n\n public static get withdrawMASimulation(): WithdrawMASimulationClient {\n return ApiClient.getInstance()._withdrawMASimulation;\n }\n\n /**\n * Provides access to the WithdrawPassivePoolSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_withdrawPassivePoolSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {WithdrawPassivePoolSimulationClient} An instance of WithdrawPassivePoolSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the withdraw MA simulation client from the ApiClient\n * const withdrawPassivePoolSimulationClient = ApiClient.withdrawPassivePoolSimulation;\n */\n\n public static get withdrawPassivePoolSimulation(): WithdrawPassivePoolSimulationClient {\n return ApiClient.getInstance()._withdrawPassivePoolSimulation;\n }\n\n /**\n * Provides access to the TransferMarginBetweenMAsSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_transferMarginBetweenMAsSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {TransferMarginBetweenMAsSimulationClient} An instance of TransferMarginBetweenMAsSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the transfer margin between MAs simulation client from the ApiClient\n * const transferMarginBetweenMAsSimulationClient = ApiClient.transferMarginBetweenMAsSimulation;\n */\n\n public static get transferMarginBetweenMAsSimulation(): TransferMarginBetweenMAsSimulationClient {\n return ApiClient.getInstance()._transferMarginBetweenMAsSimulation;\n }\n\n /**\n * Provides access to the TransferMAPoolSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_TransferMAPoolSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {TransferMAPoolSimulationClient} An instance of TransferMAPoolSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the transfer from MA to Pool simulation client from the ApiClient\n * const transferMAPoolSimulationClient = ApiClient.transferMAPoolSimulation;\n */\n\n public static get transferMAPoolSimulation(): TransferMAPoolSimulationClient {\n return ApiClient.getInstance()._transferMAPoolSimulation;\n }\n\n /**\n * Gets the current instance of the LpClient from the ApiClient.\n *\n * This static getter allows access to the LpClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the LpClient directly, bypassing the need to manually access the internal `_lp` property of the ApiClient instance.\n *\n * @returns {LpClient} The LpClient instance currently held by the ApiClient.\n * @example\n * // Assuming ApiClient and LpClient are properly set up\n * const lpClient = ApiClient.lp;\n */\n public static get lp(): LpClient {\n return ApiClient.getInstance()._lp;\n }\n\n /**\n * Gets the current instance of the TokensClient from the ApiClient.\n *\n * This static getter allows access to the TokensClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the TokensClient directly, bypassing the need to manually access the internal `_tokens` property of the ApiClient instance.\n *\n * @returns {TokensClient} The TokensClient instance currently held by the ApiClient.\n * @example\n * // Assuming ApiClient and TokensClient are properly set up\n * const tokensClient = ApiClient.tokens;\n */\n public static get tokens(): TokensClient {\n return ApiClient.getInstance()._tokens;\n }\n\n /**\n * Gets the current instance of the OwnerClient from the ApiClient.\n *\n * This static getter allows access to the OwnerClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the OwnerClient directly, bypassing the need to manually access the internal `_owner` property of the ApiClient instance.\n *\n * @returns {OwnerClient} The OwnerClient instance currently held by the ApiClient.\n * @example\n * // Assuming ApiClient and OwnerClient are properly set up\n * const ownerClient = ApiClient.tokens;\n */\n public static get owner(): OwnerClient {\n return ApiClient.getInstance()._owner;\n }\n\n /**\n * Gets the current instance of the ConditionalOrdersClient from the ApiClient.\n *\n * This static getter allows access to the ConditionalOrdersClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the ConditionalOrdersClient directly, bypassing the need to manually access the internal `_conditionalOrders` property of the ApiClient instance.\n *\n * @returns {ConditionalOrdersClient} The ConditionalOrdersClient instance currently held by the ApiClient.\n */\n public static get conditionalOrders(): ConditionalOrdersClient {\n return ApiClient.getInstance()._conditionalOrders;\n }\n\n /**\n * Gets the current instance of the ReferralClient from the ApiClient.\n *\n * This static getter allows access to the ReferralClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the ReferralClient directly, bypassing the need to manually access the internal `_referral` property of the ApiClient instance.\n *\n * @returns {ReferralClient} The ReferralClient instance currently held by the ApiClient.\n */\n public static get referral(): ReferralClient {\n return ApiClient.getInstance()._referral;\n }\n\n /**\n * Gets the current instance of the RageTradeClient from the ApiClient.\n *\n * This static getter allows access to the RageTradeClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the RageTradeClient directly, bypassing the need to manually access the internal `_rageTrade` property of the ApiClient instance.\n *\n * @returns {RageTradeClient} The RageTradeClient instance currently held by the ApiClient.\n */\n\n public static get rageTrade(): RageTradeClient {\n return ApiClient.getInstance()._rageTrade;\n }\n\n /**\n * Gets the current instance of the AuthClient from the ApiClient.\n *\n * This static getter allows access to the AuthClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the AuthClient directly, bypassing the need to manually access the internal `_auth` property of the ApiClient instance.\n *\n * @returns {AuthClient} The AuthClient instance currently held by the ApiClient.\n */\n public static get auth(): AuthClient {\n return ApiClient.getInstance()._auth;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"/","sources":["clients/api-client.ts"],"names":[],"mappings":";;;;;;AAAA,0CAIyB;AACzB,8DAA8C;AAC9C,8DAA8C;AAC9C,oDAAoC;AACpC,4DAA4C;AAC5C,0DAA0C;AAC1C,oGAAkF;AAClF,4GAAyF;AACzF,kGAA+E;AAC/E,8GAA2F;AAC3F,4FAA0E;AAC1E,gHAA6F;AAC7F,4HAAwG;AACxG,sGAAmF;AACnF,4FAA0E;AAC1E,wEAAuD;AACvD,oFAAmE;AACnE,gEAAgD;AAChD,wDAAwC;AAExC;;GAEG;AACH;IAsBE;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAa,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAChE,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAa,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAChE,IAAI,CAAC,GAAG,GAAG,IAAI,YAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACtD,IAAI,CAAC,mBAAmB,GAAG,IAAI,sBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChE,IAAI,CAAC,yBAAyB,GAAG,IAAI,oCAA8B,CACjE,SAAS,CAAC,OAAO,EACjB,IAAI,CAAC,QAAQ,CACd,CAAC;QACF,IAAI,CAAC,4BAA4B,GAAG,IAAI,wCAAiC,CACvE,IAAI,CAAC,yBAAyB,EAC9B,SAAS,CAAC,MAAM,CAAC,WAAW,CAC7B,CAAC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AAC;;;OAAA;IASD,sBAAkB,8BAAiB;QAPnC;;;;;;WAMG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,kBAAkB,CAAC;QACpD,CAAC;;;OAAA;IASD,sBAAkB,qBAAQ;QAP1B;;;;;;WAMG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC;QAC3C,CAAC;;;OAAA;IASD,sBAAkB,iBAAI;QAPtB;;;;;;WAMG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC;QACvC,CAAC;;;OAAA;IAvVc,gBAAM,GAAkB,IAAA,2BAAkB,EAAC,MAAM,CAAC,CAAC;IAwVpE,gBAAC;CAAA,AA1VD,IA0VC;AA1VY,8BAAS","sourcesContent":["import {\n ServiceConfig,\n ReyaChainId,\n getApiClientConfig,\n} from '@reyaxyz/common';\nimport MarketsClient from './modules/markets';\nimport AccountClient from './modules/account';\nimport LpClient from './modules/lp';\nimport TokensClient from './modules/tokens';\nimport OwnerClient from './modules/owner';\nimport EditCollateralSimulationClient from './modules/edit-collateral.simulation';\nimport DepositExistingMASimulationClient from './modules/deposit-existing-MA.simulation';\nimport DepositNewMASimulationClient from './modules/deposit-new-MA.simulation';\nimport DepositPassivePoolSimulationClient from './modules/deposit-passive-pool.simulation';\nimport WithdrawMASimulationClient from './modules/withdraw-MA.simulation';\nimport WithdrawPassivePoolSimulationClient from './modules/withdraw-passive-pool.simulation';\nimport TransferMarginBetweenMAsSimulationClient from './modules/transfer-margin-between-MAs.simulation';\nimport TransferMAPoolSimulationClient from './modules/transfer-MA-Pool.simulation';\nimport DepthChartSimulationClient from './modules/depth-chart.simulation';\nimport FundingRateClient from './modules/funding-rate';\nimport ConditionalOrdersClient from './modules/conditional-orders';\nimport ReferralClient from './modules/referral';\nimport AuthClient from './modules/auth';\n\n/**\n * @description Client for API\n */\nexport class ApiClient {\n private static instance: ApiClient;\n private static config: ServiceConfig = getApiClientConfig('test');\n private readonly _markets: MarketsClient;\n private readonly _account: AccountClient;\n private readonly _lp: LpClient;\n private readonly _fundingRateHistory: FundingRateClient;\n private readonly _editCollateralSimulation: EditCollateralSimulationClient;\n private readonly _depositExistingMASimulation: DepositExistingMASimulationClient;\n private readonly _depositNewMASimulation: DepositNewMASimulationClient;\n private readonly _depositPassivePoolSimulation: DepositPassivePoolSimulationClient;\n private readonly _withdrawMASimulation: WithdrawMASimulationClient;\n private readonly _withdrawPassivePoolSimulation: WithdrawPassivePoolSimulationClient;\n private readonly _transferMarginBetweenMAsSimulation: TransferMarginBetweenMAsSimulationClient;\n private readonly _transferMAPoolSimulation: TransferMAPoolSimulationClient;\n private readonly _depthSimulation: DepthChartSimulationClient;\n private readonly _tokens: TokensClient;\n private readonly _owner: OwnerClient;\n private readonly _conditionalOrders: ConditionalOrdersClient;\n private readonly _referral: ReferralClient;\n private readonly _auth: AuthClient;\n\n private constructor() {\n this._markets = new MarketsClient(ApiClient.config.apiEndpoint);\n this._account = new AccountClient(ApiClient.config.apiEndpoint);\n this._lp = new LpClient(ApiClient.config.apiEndpoint);\n this._fundingRateHistory = new FundingRateClient(this._markets);\n this._editCollateralSimulation = new EditCollateralSimulationClient(\n ApiClient.network,\n this._account,\n );\n this._depositExistingMASimulation = new DepositExistingMASimulationClient(\n this._editCollateralSimulation,\n ApiClient.config.apiEndpoint,\n );\n this._depositNewMASimulation = new DepositNewMASimulationClient(\n this._depositExistingMASimulation,\n );\n this._depositPassivePoolSimulation = new DepositPassivePoolSimulationClient(\n ApiClient.config.apiEndpoint,\n );\n this._withdrawMASimulation = new WithdrawMASimulationClient(\n this._editCollateralSimulation,\n ApiClient.config.chain,\n ApiClient.config.apiEndpoint,\n );\n this._withdrawPassivePoolSimulation =\n new WithdrawPassivePoolSimulationClient(\n ApiClient.config.chain,\n ApiClient.config.apiEndpoint,\n );\n this._transferMarginBetweenMAsSimulation =\n new TransferMarginBetweenMAsSimulationClient(\n ApiClient.network,\n this._account,\n );\n this._transferMAPoolSimulation = new TransferMAPoolSimulationClient(\n this._editCollateralSimulation,\n );\n\n this._depthSimulation = new DepthChartSimulationClient(this._lp);\n this._tokens = new TokensClient(ApiClient.config.apiEndpoint);\n this._owner = new OwnerClient(ApiClient.config.apiEndpoint);\n this._conditionalOrders = new ConditionalOrdersClient(\n ApiClient.network,\n ApiClient.config.apiEndpoint,\n );\n this._referral = new ReferralClient(ApiClient.config.apiEndpoint);\n this._auth = new AuthClient(ApiClient.config.apiEndpoint);\n }\n\n public static configure(environment: ServiceConfig['environment']): void {\n ApiClient.config = getApiClientConfig(environment);\n ApiClient.instance = new ApiClient();\n }\n\n private static getInstance(): ApiClient {\n if (!ApiClient.instance) {\n throw new Error(\n 'ApiClient is not configured. Please configure it before using.',\n );\n }\n return ApiClient.instance;\n }\n public static get network(): ReyaChainId {\n if (!ApiClient.config.chain) {\n throw new Error('ApiClient is not configured');\n }\n return ApiClient.config.chain;\n }\n\n /**\n * Provides access to the MarketsClient instance.\n * This getter allows for interacting with market-related API functionalities.\n *\n * @returns {MarketsClient} An instance of MarketsClient for market-related operations.\n * @memberof ApiClient\n */\n public static get markets(): MarketsClient {\n return ApiClient.getInstance()._markets;\n }\n\n /**\n * Provides access to the AccountClient instance.\n * This getter allows for interacting with account-related API functionalities.\n *\n * @returns {AccountClient} An instance of AccountClient for account-related operations.\n * @memberof ApiClient\n */\n public static get account(): AccountClient {\n return ApiClient.getInstance()._account;\n }\n\n public static get fundingRateHistory(): FundingRateClient {\n return ApiClient.getInstance()._fundingRateHistory;\n }\n\n /**\n * Retrieves the DepthChartSimulationClient instance used for depth simulation.\n * This method provides access to the depth simulation client through the ApiClient.\n * @returns {DepthChartSimulationClient} The DepthChartSimulationClient instance.\n * @static\n * @public\n */\n public static get depthSimulation(): DepthChartSimulationClient {\n return ApiClient.getInstance()._depthSimulation;\n }\n\n /**\n * Provides access to the EditCollateralSimulationClient instance.\n * This getter allows for interacting with edit collateral simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_editCollateralSimulation` property, ensuring that edit collateral simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {EditCollateralSimulationClient} An instance of EditCollateralSimulationClient for edit collateral simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the edit collateral simulation client from the ApiClient\n * const editCollateralSimulationClient = ApiClient.editCollateralSimulation;\n */\n\n public static get editCollateralSimulationClient(): EditCollateralSimulationClient {\n return ApiClient.getInstance()._editCollateralSimulation;\n }\n\n /**\n * Provides access to the DepositExistingMASimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_depositExistingMASimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {DepositExistingMASimulationClient} An instance of DepositExistingMASimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the deposit existing Ma simulation client from the ApiClient\n * const depositExistingMASimulationClient = ApiClient.depositExistingMASimulation;\n */\n\n public static get depositExistingMASimulation(): DepositExistingMASimulationClient {\n return ApiClient.getInstance()._depositExistingMASimulation;\n }\n\n /**\n * Provides access to the DepositNewMASimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_depositNewMASimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {DepositNewMASimulationClient} An instance of DepositNewMASimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the deposit new MA simulation client from the ApiClient\n * const depositNewMASimulationClient = ApiClient.depositNewMASimulation;\n */\n\n public static get depositNewMASimulation(): DepositNewMASimulationClient {\n return ApiClient.getInstance()._depositNewMASimulation;\n }\n\n /**\n * Provides access to the DepositPassivePoolSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_depositPassivePoolSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {DepositPassivePoolSimulationClient} An instance of DepositPassivePoolSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the deposit existing Ma simulation client from the ApiClient\n * const depositPassivePoolSimulationClient = ApiClient.depositPassivePoolSimulation;\n */\n\n public static get depositPassivePoolSimulation(): DepositPassivePoolSimulationClient {\n return ApiClient.getInstance()._depositPassivePoolSimulation;\n }\n\n /**\n * Provides access to the WithdrawMASimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_withdrawMASimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {WithdrawMASimulationClient} An instance of WithdrawMASimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the withdraw MA simulation client from the ApiClient\n * const withdrawMASimulationClient = ApiClient.withdrawMASimulation;\n */\n\n public static get withdrawMASimulation(): WithdrawMASimulationClient {\n return ApiClient.getInstance()._withdrawMASimulation;\n }\n\n /**\n * Provides access to the WithdrawPassivePoolSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_withdrawPassivePoolSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {WithdrawPassivePoolSimulationClient} An instance of WithdrawPassivePoolSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the withdraw MA simulation client from the ApiClient\n * const withdrawPassivePoolSimulationClient = ApiClient.withdrawPassivePoolSimulation;\n */\n\n public static get withdrawPassivePoolSimulation(): WithdrawPassivePoolSimulationClient {\n return ApiClient.getInstance()._withdrawPassivePoolSimulation;\n }\n\n /**\n * Provides access to the TransferMarginBetweenMAsSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_transferMarginBetweenMAsSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {TransferMarginBetweenMAsSimulationClient} An instance of TransferMarginBetweenMAsSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the transfer margin between MAs simulation client from the ApiClient\n * const transferMarginBetweenMAsSimulationClient = ApiClient.transferMarginBetweenMAsSimulation;\n */\n\n public static get transferMarginBetweenMAsSimulation(): TransferMarginBetweenMAsSimulationClient {\n return ApiClient.getInstance()._transferMarginBetweenMAsSimulation;\n }\n\n /**\n * Provides access to the TransferMAPoolSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_TransferMAPoolSimulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {TransferMAPoolSimulationClient} An instance of TransferMAPoolSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the transfer from MA to Pool simulation client from the ApiClient\n * const transferMAPoolSimulationClient = ApiClient.transferMAPoolSimulation;\n */\n\n public static get transferMAPoolSimulation(): TransferMAPoolSimulationClient {\n return ApiClient.getInstance()._transferMAPoolSimulation;\n }\n\n /**\n * Gets the current instance of the LpClient from the ApiClient.\n *\n * This static getter allows access to the LpClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the LpClient directly, bypassing the need to manually access the internal `_lp` property of the ApiClient instance.\n *\n * @returns {LpClient} The LpClient instance currently held by the ApiClient.\n * @example\n * // Assuming ApiClient and LpClient are properly set up\n * const lpClient = ApiClient.lp;\n */\n public static get lp(): LpClient {\n return ApiClient.getInstance()._lp;\n }\n\n /**\n * Gets the current instance of the TokensClient from the ApiClient.\n *\n * This static getter allows access to the TokensClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the TokensClient directly, bypassing the need to manually access the internal `_tokens` property of the ApiClient instance.\n *\n * @returns {TokensClient} The TokensClient instance currently held by the ApiClient.\n * @example\n * // Assuming ApiClient and TokensClient are properly set up\n * const tokensClient = ApiClient.tokens;\n */\n public static get tokens(): TokensClient {\n return ApiClient.getInstance()._tokens;\n }\n\n /**\n * Gets the current instance of the OwnerClient from the ApiClient.\n *\n * This static getter allows access to the OwnerClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the OwnerClient directly, bypassing the need to manually access the internal `_owner` property of the ApiClient instance.\n *\n * @returns {OwnerClient} The OwnerClient instance currently held by the ApiClient.\n * @example\n * // Assuming ApiClient and OwnerClient are properly set up\n * const ownerClient = ApiClient.tokens;\n */\n public static get owner(): OwnerClient {\n return ApiClient.getInstance()._owner;\n }\n\n /**\n * Gets the current instance of the ConditionalOrdersClient from the ApiClient.\n *\n * This static getter allows access to the ConditionalOrdersClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the ConditionalOrdersClient directly, bypassing the need to manually access the internal `_conditionalOrders` property of the ApiClient instance.\n *\n * @returns {ConditionalOrdersClient} The ConditionalOrdersClient instance currently held by the ApiClient.\n */\n public static get conditionalOrders(): ConditionalOrdersClient {\n return ApiClient.getInstance()._conditionalOrders;\n }\n\n /**\n * Gets the current instance of the ReferralClient from the ApiClient.\n *\n * This static getter allows access to the ReferralClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the ReferralClient directly, bypassing the need to manually access the internal `_referral` property of the ApiClient instance.\n *\n * @returns {ReferralClient} The ReferralClient instance currently held by the ApiClient.\n */\n public static get referral(): ReferralClient {\n return ApiClient.getInstance()._referral;\n }\n\n /**\n * Gets the current instance of the AuthClient from the ApiClient.\n *\n * This static getter allows access to the AuthClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the AuthClient directly, bypassing the need to manually access the internal `_auth` property of the ApiClient instance.\n *\n * @returns {AuthClient} The AuthClient instance currently held by the ApiClient.\n */\n public static get auth(): AuthClient {\n return ApiClient.getInstance()._auth;\n }\n}\n"]}
|
|
@@ -107,15 +107,6 @@ var AccountClient = /** @class */ (function (_super) {
|
|
|
107
107
|
});
|
|
108
108
|
});
|
|
109
109
|
};
|
|
110
|
-
AccountClient.prototype.getPositionsForMarginAccount = function (params) {
|
|
111
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
112
|
-
var uri;
|
|
113
|
-
return __generator(this, function (_a) {
|
|
114
|
-
uri = "/api/accounts/".concat(params.address, "/marginAccount/").concat(params.marginAccountId, "/positions");
|
|
115
|
-
return [2 /*return*/, this.get(uri, { limit: params.limit })];
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
};
|
|
119
110
|
AccountClient.prototype.getMarginAccountOrderHistoryPaginated = function (params) {
|
|
120
111
|
return __awaiter(this, void 0, void 0, function () {
|
|
121
112
|
var uri;
|
|
@@ -151,41 +142,6 @@ var AccountClient = /** @class */ (function (_super) {
|
|
|
151
142
|
});
|
|
152
143
|
});
|
|
153
144
|
};
|
|
154
|
-
AccountClient.prototype.getMaxOrderSizeAvailable = function (params) {
|
|
155
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
156
|
-
var uri;
|
|
157
|
-
return __generator(this, function (_a) {
|
|
158
|
-
uri = "/api/accounts/".concat(params.marginAccountId, "/max-order-size");
|
|
159
|
-
return [2 /*return*/, this.get(uri, {
|
|
160
|
-
marketId: params.marketId,
|
|
161
|
-
direction: params.direction,
|
|
162
|
-
})];
|
|
163
|
-
});
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
|
-
AccountClient.prototype.getIsolatedOrderMaxSizeAvailable = function (params) {
|
|
167
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
168
|
-
var uri;
|
|
169
|
-
return __generator(this, function (_a) {
|
|
170
|
-
uri = "/api/accounts/".concat(params.marginAccountId, "/max-order-size-isolated");
|
|
171
|
-
return [2 /*return*/, this.get(uri, {
|
|
172
|
-
marketId: params.marketId,
|
|
173
|
-
direction: params.direction,
|
|
174
|
-
})];
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
};
|
|
178
|
-
AccountClient.prototype.getTransactionSimulationInitialData = function (params) {
|
|
179
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
180
|
-
var uri;
|
|
181
|
-
return __generator(this, function (_a) {
|
|
182
|
-
uri = "/api/accounts/".concat(params.marginAccountId, "/trade-simulation-data");
|
|
183
|
-
return [2 /*return*/, this.get(uri, {
|
|
184
|
-
marketId: params.marketId,
|
|
185
|
-
})];
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
|
-
};
|
|
189
145
|
AccountClient.prototype.getEditCollateralSimulationInitialData = function (params) {
|
|
190
146
|
return __awaiter(this, void 0, void 0, function () {
|
|
191
147
|
var uri;
|
|
@@ -228,51 +184,6 @@ var AccountClient = /** @class */ (function (_super) {
|
|
|
228
184
|
});
|
|
229
185
|
});
|
|
230
186
|
};
|
|
231
|
-
AccountClient.prototype.getMarginAccountBalanceChartData = function (params) {
|
|
232
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
233
|
-
var uri;
|
|
234
|
-
return __generator(this, function (_a) {
|
|
235
|
-
uri = "/api/accounts/".concat(params.marginAccountId, "/balance-chart-data");
|
|
236
|
-
return [2 /*return*/, this.get(uri, {
|
|
237
|
-
timeframeMs: params.filters.timeframeMs,
|
|
238
|
-
granularity: params.filters.granularity,
|
|
239
|
-
})];
|
|
240
|
-
});
|
|
241
|
-
});
|
|
242
|
-
};
|
|
243
|
-
AccountClient.prototype.getMarginAccountCollateralsBalanceChartData = function (params) {
|
|
244
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
245
|
-
var uri;
|
|
246
|
-
return __generator(this, function (_a) {
|
|
247
|
-
uri = "/api/accounts/".concat(params.marginAccountId, "/collaterals-balance-chart-data");
|
|
248
|
-
return [2 /*return*/, this.get(uri, {
|
|
249
|
-
timeframeMs: params.filters.timeframeMs,
|
|
250
|
-
granularity: params.filters.granularity,
|
|
251
|
-
})];
|
|
252
|
-
});
|
|
253
|
-
});
|
|
254
|
-
};
|
|
255
|
-
AccountClient.prototype.getAllMarginAccountsBalanceChart = function (params) {
|
|
256
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
257
|
-
var uri;
|
|
258
|
-
return __generator(this, function (_a) {
|
|
259
|
-
uri = "/api/accounts/owner/".concat(params.ownerAddress, "/balance");
|
|
260
|
-
return [2 /*return*/, this.get(uri, {
|
|
261
|
-
timeframeMs: params.filters.timeframeMs,
|
|
262
|
-
granularity: params.filters.granularity,
|
|
263
|
-
})];
|
|
264
|
-
});
|
|
265
|
-
});
|
|
266
|
-
};
|
|
267
|
-
AccountClient.prototype.getAllMarginAccountsSummary = function (params) {
|
|
268
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
269
|
-
var uri;
|
|
270
|
-
return __generator(this, function (_a) {
|
|
271
|
-
uri = "/api/accounts/owner/".concat(params.ownerAddress, "/summary");
|
|
272
|
-
return [2 /*return*/, this.get(uri)];
|
|
273
|
-
});
|
|
274
|
-
});
|
|
275
|
-
};
|
|
276
187
|
// TODO: Milan validate
|
|
277
188
|
AccountClient.prototype.editMarginAccount = function (params) {
|
|
278
189
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,0CAOyB;AAEzB;IAA2C,iCAAU;IAArD;;IAoOA,CAAC;IAnOC;;;;;;;;;;;SAWK;IAEC,yCAAiB,GAAvB,UACE,MAA+B;;;;;;wBAEzB,GAAG,GAAG,wBAAiB,MAAM,CAAC,OAAO,CAAE,CAAC;wBACJ,qBAAM,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;gCAC5D,KAAK,EAAE,MAAM,CAAC,KAAK;gCACnB,gBAAgB,EAAE,KAAK;6BACxB,CAAC,EAAA;;wBAHI,QAAQ,GAA4B,SAGxC;wBAEF,sBAAO,QAAQ,EAAC;;;;KACjB;IAED;;;;;;;;;;OAUG;IAEG,wCAAgB,GAAtB,UACE,MAA8B;;;;gBAExB,GAAG,GAAG,wBAAiB,MAAM,CAAC,OAAO,4BAAkB,MAAM,CAAC,eAAe,CAAE,C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CACF,EAAC;;;KACH;IACH,oBAAC;AAAD,CAAC,AApOD,CAA2C,mBAAU,GAoOpD","sourcesContent":["import {\n GetMarginAccountParams,\n GetMarginAccountResult,\n GetMarginAccountsParams,\n GetMarginAccountsResult,\n GetMarginAccountTransactionHistoryParams,\n GetMarginAccountTransactionHistoryResult,\n GetMaxOrderSizeAvailableParams,\n GetMaxOrderSizeAvailableResult,\n GetMaxWithdrawBalanceForAccountParams,\n GetMaxWithdrawBalanceForAccountResult,\n GetPositionsForMarginAccountParams,\n GetPositionsForMarginAccountResult,\n GetTransactionSimulationInitialDataParams,\n GetMarginAccountBalanceChartDataParams,\n GetMarginAccountCollateralsBalanceChartDataParams,\n GetAllMarginAccountsBalanceChartDataParams,\n EditMarginAccountParams,\n CloseMarginAccountParams,\n GetAllMarginAccountsSummaryResult,\n GetAllMarginAccountsSummaryParams,\n GetEditCollateralSimulationInitialDataParams,\n EditMarginAccountResult,\n CloseMarginAccountResult,\n GetIsolatedOrderMaxSizeAvailableParams,\n GetIsolatedOrderMaxSizeAvailableResult,\n GetMarginAccountOrderHistoryPaginatedParams,\n GetMarginAccountOrderHistoryPaginatedResult,\n GetLiquidationHistoryForOwnerAddressResult,\n GetLiquidationHistoryForOwnerAddressParams,\n GetAccountFeeRebatesHistoryParams,\n GetAccountFeeRebatesHistoryResult,\n GetAutoExchangeHistoryForOwnerAddressResult,\n GetAutoExchangeHistoryForOwnerAddressParams,\n UpdateLeverageForAccountAndMarketParams,\n UpdateLeverageForAccountAndMarketResult,\n} from './types';\nimport {\n EditCollateralSimulationState,\n TradeSimulationState,\n GetMarginAccountCollateralsBalanceChartDataResult,\n GetMarginAccountBalanceChartDataResult,\n GetAllMarginAccountsBalanceChartDataResult,\n RestClient,\n} from '@reyaxyz/common';\n\nexport default class AccountClient extends RestClient {\n /**\n * Asynchronously retrieves a list of margin accounts associated with a specific address.\n *\n * This method makes a request to the API endpoint to fetch collateral account data. The data is filtered\n * based on the provided Ethereum address. An optional limit can be specified to control the number of\n * collateral accounts returned in the response.\n *\n * @param {GetMarginAccountsParams} params\n * @returns {Promise<GetMarginAccountsResult>} A promise that resolves to the response containing the margin\n * account data.\n * @memberof account\n * */\n\n async getMarginAccounts(\n params: GetMarginAccountsParams,\n ): Promise<GetMarginAccountsResult> {\n const uri = `/api/accounts/${params.address}`;\n const response: GetMarginAccountsResult = await this.get(uri, {\n limit: params.limit,\n includePositions: false,\n });\n\n return response;\n }\n\n /**\n * Asynchronously retrieves details of a specific collateral account for a given Ethereum address.\n *\n * This method sends a request to the API to obtain detailed information about a specific collateral account\n * associated with the provided Ethereum address. The account is identified using the collateral account number.\n *\n * @param {GetMarginAccountParams} params\n * @returns {Promise<GetMarginAccountResult>} A promise that resolves to the response containing the detailed\n * information of the specified margin account.\n * @memberof account\n */\n\n async getMarginAccount(\n params: GetMarginAccountParams,\n ): Promise<GetMarginAccountResult> {\n const uri = `/api/accounts/${params.address}/marginAccount/${params.marginAccountId}`;\n return this.get(uri);\n }\n\n async getPositionsForMarginAccount(\n params: GetPositionsForMarginAccountParams,\n ): Promise<GetPositionsForMarginAccountResult> {\n const uri = `/api/accounts/${params.address}/marginAccount/${params.marginAccountId}/positions`;\n return this.get(uri, { limit: params.limit });\n }\n\n async getMarginAccountOrderHistoryPaginated(\n params: GetMarginAccountOrderHistoryPaginatedParams,\n ): Promise<GetMarginAccountOrderHistoryPaginatedResult> {\n const uri = `/api/accounts/${params.address}/marginAccount/${params.marginAccountId}/positions/history/paginated`;\n return this.get(uri, {\n type: params.type,\n page: params.page,\n perPage: params.perPage,\n });\n }\n\n async getLiquidationHistoryForOwnerAddress(\n params: GetLiquidationHistoryForOwnerAddressParams,\n ): Promise<GetLiquidationHistoryForOwnerAddressResult> {\n const uri = `/api/accounts/${params.address}/positions/liquidations`;\n return this.get(uri, {\n timestampFromMS: params.timestampFromMS,\n });\n }\n\n async getAutoExchangeHistoryForOwnerAddress(\n params: GetAutoExchangeHistoryForOwnerAddressParams,\n ): Promise<GetAutoExchangeHistoryForOwnerAddressResult> {\n const uri = `/api/accounts/${params.address}/positions/auto-exchange`;\n return this.get(uri, {\n timestampFromMS: params.timestampFromMS,\n });\n }\n\n async getMaxOrderSizeAvailable(\n params: GetMaxOrderSizeAvailableParams,\n ): Promise<GetMaxOrderSizeAvailableResult> {\n const uri = `/api/accounts/${params.marginAccountId}/max-order-size`;\n return this.get(uri, {\n marketId: params.marketId,\n direction: params.direction,\n });\n }\n\n async getIsolatedOrderMaxSizeAvailable(\n params: GetIsolatedOrderMaxSizeAvailableParams,\n ): Promise<GetIsolatedOrderMaxSizeAvailableResult> {\n const uri = `/api/accounts/${params.marginAccountId}/max-order-size-isolated`;\n return this.get(uri, {\n marketId: params.marketId,\n direction: params.direction,\n });\n }\n\n async getTransactionSimulationInitialData(\n params: GetTransactionSimulationInitialDataParams,\n ): Promise<TradeSimulationState> {\n const uri = `/api/accounts/${params.marginAccountId}/trade-simulation-data`;\n return this.get(uri, {\n marketId: params.marketId,\n });\n }\n\n async getEditCollateralSimulationInitialData(\n params: GetEditCollateralSimulationInitialDataParams,\n ): Promise<EditCollateralSimulationState> {\n const uri = `/api/accounts/${params.marginAccountId}/edit-collateral-simulation-data`;\n return this.get(uri);\n }\n\n async getMarginAccountTransactionHistory(\n params: GetMarginAccountTransactionHistoryParams,\n ): Promise<GetMarginAccountTransactionHistoryResult> {\n const uri = `/api/accounts/${params.marginAccountId}/transaction-history`;\n return this.get(uri, {\n limit: params.limit,\n });\n }\n\n async getAccountFeeRebatesHistory(\n params: GetAccountFeeRebatesHistoryParams,\n ): Promise<GetAccountFeeRebatesHistoryResult> {\n const uri = `/api/accounts/${params.marginAccountId}/referral-fee-history`;\n return this.get(uri, {\n limit: params.limit,\n });\n }\n\n async getMaxWithdrawBalanceForAccount(\n params: GetMaxWithdrawBalanceForAccountParams,\n ): Promise<GetMaxWithdrawBalanceForAccountResult> {\n const uri = `/api/accounts/${params.marginAccountId}/max-withdraw-amount`;\n return this.get(uri, {\n assetAddress: params.tokenAddress,\n });\n }\n\n async getMarginAccountBalanceChartData(\n params: GetMarginAccountBalanceChartDataParams,\n ): Promise<GetMarginAccountBalanceChartDataResult> {\n const uri = `/api/accounts/${params.marginAccountId}/balance-chart-data`;\n return this.get(uri, {\n timeframeMs: params.filters.timeframeMs,\n granularity: params.filters.granularity,\n });\n }\n\n async getMarginAccountCollateralsBalanceChartData(\n params: GetMarginAccountCollateralsBalanceChartDataParams,\n ): Promise<GetMarginAccountCollateralsBalanceChartDataResult> {\n const uri = `/api/accounts/${params.marginAccountId}/collaterals-balance-chart-data`;\n return this.get(uri, {\n timeframeMs: params.filters.timeframeMs,\n granularity: params.filters.granularity,\n });\n }\n\n async getAllMarginAccountsBalanceChart(\n params: GetAllMarginAccountsBalanceChartDataParams,\n ): Promise<GetAllMarginAccountsBalanceChartDataResult> {\n const uri = `/api/accounts/owner/${params.ownerAddress}/balance`;\n return this.get(uri, {\n timeframeMs: params.filters.timeframeMs,\n granularity: params.filters.granularity,\n });\n }\n\n async getAllMarginAccountsSummary(\n params: GetAllMarginAccountsSummaryParams,\n ): Promise<GetAllMarginAccountsSummaryResult> {\n const uri = `/api/accounts/owner/${params.ownerAddress}/summary`;\n return this.get(uri);\n }\n\n // TODO: Milan validate\n async editMarginAccount(\n params: EditMarginAccountParams,\n ): Promise<EditMarginAccountResult> {\n const name = (params.name || '').trim();\n if (!params.id) {\n throw new Error('Missing margin account id');\n }\n if (name.length === 0 || name.length > 25) {\n throw new Error('Max size 25 characters');\n }\n\n const uri = `/api/accounts/${params.id}/edit`;\n return this.put(uri, {\n id: params.id,\n name: params.name,\n });\n }\n async closeMarginAccount(\n params: CloseMarginAccountParams,\n ): Promise<CloseMarginAccountResult> {\n if (!params.id) {\n throw new Error('Missing margin account id');\n }\n\n const uri = `/api/accounts/${params.id}/close`;\n return this.delete(uri, {\n id: params.id,\n });\n }\n\n async updateLeverageForAccountAndMarket(\n params: UpdateLeverageForAccountAndMarketParams,\n ): Promise<UpdateLeverageForAccountAndMarketResult> {\n if (!params.accountId || !params.marketId || !params.leverage) {\n throw new Error('Missing required parameters');\n }\n\n const uri = `/api/accounts/${params.accountId}/marginAccount/${params.marketId}/set-max-leverage`;\n return this.post(\n uri,\n {},\n {\n leverage: params.leverage,\n },\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,0CAA4E;AAE5E;IAA2C,iCAAU;IAArD;;IA2JA,CAAC;IA1JC;;;;;;;;;;;SAWK;IAEC,yCAAiB,GAAvB,UACE,MAA+B;;;;;;wBAEzB,GAAG,GAAG,wBAAiB,MAAM,CAAC,OAAO,CAAE,CAAC;wBACJ,qBAAM,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;gCAC5D,KAAK,EAAE,MAAM,CAAC,KAAK;gCACnB,gBAAgB,EAAE,KAAK;6BACxB,CAAC,EAAA;;wBAHI,QAAQ,GAA4B,SAGxC;wBAEF,sBAAO,QAAQ,EAAC;;;;KACjB;IAED;;;;;;;;;;OAUG;IAEG,wCAAgB,GAAtB,UACE,MAA8B;;;;gBAExB,GAAG,GAAG,wBAAiB,MAAM,CAAC,OAAO,4BAAkB,MAAM,CAAC,eAAe,CAAE,CAAC;gBACtF,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAC;;;KACtB;IAEK,6DAAqC,GAA3C,UACE,MAAmD;;;;gBAE7C,GAAG,GAAG,wBAAiB,MAAM,CAAC,OAAO,4BAAkB,MAAM,CAAC,eAAe,iCAA8B,CAAC;gBAClH,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;wBACnB,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,OAAO,EAAE,MAAM,CAAC,OAAO;qBACxB,CAAC,EAAC;;;KACJ;IAEK,4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,sBAAmB,CAAC;gBAClG,sBAAO,IAAI,CAAC,IAAI,CACd,GAAG,EACH,EAAE,EACF;wBACE,QAAQ,EAAE,MAAM,CAAC,QAAQ;qBAC1B,CACF,EAAC;;;KACH;IACH,oBAAC;AAAD,CAAC,AA3JD,CAA2C,mBAAU,GA2JpD","sourcesContent":["import {\n GetMarginAccountParams,\n GetMarginAccountResult,\n GetMarginAccountsParams,\n GetMarginAccountsResult,\n GetMarginAccountTransactionHistoryParams,\n GetMarginAccountTransactionHistoryResult,\n GetMaxWithdrawBalanceForAccountParams,\n GetMaxWithdrawBalanceForAccountResult,\n EditMarginAccountParams,\n CloseMarginAccountParams,\n GetEditCollateralSimulationInitialDataParams,\n EditMarginAccountResult,\n CloseMarginAccountResult,\n GetMarginAccountOrderHistoryPaginatedParams,\n GetMarginAccountOrderHistoryPaginatedResult,\n GetLiquidationHistoryForOwnerAddressResult,\n GetLiquidationHistoryForOwnerAddressParams,\n GetAccountFeeRebatesHistoryParams,\n GetAccountFeeRebatesHistoryResult,\n GetAutoExchangeHistoryForOwnerAddressResult,\n GetAutoExchangeHistoryForOwnerAddressParams,\n UpdateLeverageForAccountAndMarketParams,\n UpdateLeverageForAccountAndMarketResult,\n} from './types';\nimport { EditCollateralSimulationState, RestClient } from '@reyaxyz/common';\n\nexport default class AccountClient extends RestClient {\n /**\n * Asynchronously retrieves a list of margin accounts associated with a specific address.\n *\n * This method makes a request to the API endpoint to fetch collateral account data. The data is filtered\n * based on the provided Ethereum address. An optional limit can be specified to control the number of\n * collateral accounts returned in the response.\n *\n * @param {GetMarginAccountsParams} params\n * @returns {Promise<GetMarginAccountsResult>} A promise that resolves to the response containing the margin\n * account data.\n * @memberof account\n * */\n\n async getMarginAccounts(\n params: GetMarginAccountsParams,\n ): Promise<GetMarginAccountsResult> {\n const uri = `/api/accounts/${params.address}`;\n const response: GetMarginAccountsResult = await this.get(uri, {\n limit: params.limit,\n includePositions: false,\n });\n\n return response;\n }\n\n /**\n * Asynchronously retrieves details of a specific collateral account for a given Ethereum address.\n *\n * This method sends a request to the API to obtain detailed information about a specific collateral account\n * associated with the provided Ethereum address. The account is identified using the collateral account number.\n *\n * @param {GetMarginAccountParams} params\n * @returns {Promise<GetMarginAccountResult>} A promise that resolves to the response containing the detailed\n * information of the specified margin account.\n * @memberof account\n */\n\n async getMarginAccount(\n params: GetMarginAccountParams,\n ): Promise<GetMarginAccountResult> {\n const uri = `/api/accounts/${params.address}/marginAccount/${params.marginAccountId}`;\n return this.get(uri);\n }\n\n async getMarginAccountOrderHistoryPaginated(\n params: GetMarginAccountOrderHistoryPaginatedParams,\n ): Promise<GetMarginAccountOrderHistoryPaginatedResult> {\n const uri = `/api/accounts/${params.address}/marginAccount/${params.marginAccountId}/positions/history/paginated`;\n return this.get(uri, {\n type: params.type,\n page: params.page,\n perPage: params.perPage,\n });\n }\n\n async getLiquidationHistoryForOwnerAddress(\n params: GetLiquidationHistoryForOwnerAddressParams,\n ): Promise<GetLiquidationHistoryForOwnerAddressResult> {\n const uri = `/api/accounts/${params.address}/positions/liquidations`;\n return this.get(uri, {\n timestampFromMS: params.timestampFromMS,\n });\n }\n\n async getAutoExchangeHistoryForOwnerAddress(\n params: GetAutoExchangeHistoryForOwnerAddressParams,\n ): Promise<GetAutoExchangeHistoryForOwnerAddressResult> {\n const uri = `/api/accounts/${params.address}/positions/auto-exchange`;\n return this.get(uri, {\n timestampFromMS: params.timestampFromMS,\n });\n }\n\n async getEditCollateralSimulationInitialData(\n params: GetEditCollateralSimulationInitialDataParams,\n ): Promise<EditCollateralSimulationState> {\n const uri = `/api/accounts/${params.marginAccountId}/edit-collateral-simulation-data`;\n return this.get(uri);\n }\n\n async getMarginAccountTransactionHistory(\n params: GetMarginAccountTransactionHistoryParams,\n ): Promise<GetMarginAccountTransactionHistoryResult> {\n const uri = `/api/accounts/${params.marginAccountId}/transaction-history`;\n return this.get(uri, {\n limit: params.limit,\n });\n }\n\n async getAccountFeeRebatesHistory(\n params: GetAccountFeeRebatesHistoryParams,\n ): Promise<GetAccountFeeRebatesHistoryResult> {\n const uri = `/api/accounts/${params.marginAccountId}/referral-fee-history`;\n return this.get(uri, {\n limit: params.limit,\n });\n }\n\n async getMaxWithdrawBalanceForAccount(\n params: GetMaxWithdrawBalanceForAccountParams,\n ): Promise<GetMaxWithdrawBalanceForAccountResult> {\n const uri = `/api/accounts/${params.marginAccountId}/max-withdraw-amount`;\n return this.get(uri, {\n assetAddress: params.tokenAddress,\n });\n }\n\n // TODO: Milan validate\n async editMarginAccount(\n params: EditMarginAccountParams,\n ): Promise<EditMarginAccountResult> {\n const name = (params.name || '').trim();\n if (!params.id) {\n throw new Error('Missing margin account id');\n }\n if (name.length === 0 || name.length > 25) {\n throw new Error('Max size 25 characters');\n }\n\n const uri = `/api/accounts/${params.id}/edit`;\n return this.put(uri, {\n id: params.id,\n name: params.name,\n });\n }\n async closeMarginAccount(\n params: CloseMarginAccountParams,\n ): Promise<CloseMarginAccountResult> {\n if (!params.id) {\n throw new Error('Missing margin account id');\n }\n\n const uri = `/api/accounts/${params.id}/close`;\n return this.delete(uri, {\n id: params.id,\n });\n }\n\n async updateLeverageForAccountAndMarket(\n params: UpdateLeverageForAccountAndMarketParams,\n ): Promise<UpdateLeverageForAccountAndMarketResult> {\n if (!params.accountId || !params.marketId || !params.leverage) {\n throw new Error('Missing required parameters');\n }\n\n const uri = `/api/accounts/${params.accountId}/marginAccount/${params.marketId}/set-max-leverage`;\n return this.post(\n uri,\n {},\n {\n leverage: params.leverage,\n },\n );\n }\n}\n"]}
|
|
@@ -92,21 +92,6 @@ var MarketsClient = /** @class */ (function (_super) {
|
|
|
92
92
|
});
|
|
93
93
|
});
|
|
94
94
|
};
|
|
95
|
-
MarketsClient.prototype.getPoolPrice = function (params) {
|
|
96
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
-
var uri, poolPriceInfo;
|
|
98
|
-
return __generator(this, function (_a) {
|
|
99
|
-
switch (_a.label) {
|
|
100
|
-
case 0:
|
|
101
|
-
uri = "/api/markets/".concat(params.id, "/pool-price/");
|
|
102
|
-
return [4 /*yield*/, this.get(uri)];
|
|
103
|
-
case 1:
|
|
104
|
-
poolPriceInfo = _a.sent();
|
|
105
|
-
return [2 /*return*/, { price: poolPriceInfo.poolPrice }];
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
95
|
/**
|
|
111
96
|
* Retrieves candlestick data for a specified market.
|
|
112
97
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/markets/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/markets/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,0CAA4E;AAE5E;IAA2C,iCAAU;IAArD;;IA0EA,CAAC;IAzEC;;;;;;;;;;;;;;;;OAgBG;IAEG,kCAAU,GAAhB;;;;gBACQ,GAAG,GAAG,cAAc,CAAC;gBAC3B,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAC;;;KACtB;IAEK,iCAAS,GAAf,UAAgB,MAAuB;;;;gBAC/B,GAAG,GAAG,uBAAgB,MAAM,CAAC,EAAE,CAAE,CAAC;gBACxC,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAC;;;KACtB;IAED;;;;;;;;;;;;OAYG;IAEG,wCAAgB,GAAtB,UACE,MAAwB;;;;gBAElB,GAAG,GAAG,+BAAwB,MAAM,CAAC,QAAQ,CAAE,CAAC;gBACtD,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;wBACnB,UAAU,EAAE,MAAM,CAAC,UAAU;wBAC7B,OAAO,EAAE,MAAM,CAAC,OAAO;wBACvB,KAAK,EAAE,MAAM,CAAC,KAAK;wBACnB,KAAK,EAAE,MAAM,CAAC,KAAK;qBACpB,CAAC,EAAC;;;KACJ;IAEK,+CAAuB,GAA7B,UACE,MAAqC;;;;gBAE/B,GAAG,GAAG,sBAAe,MAAM,CAAC,QAAQ,CAAE,CAAC;gBAC7C,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;wBACnB,KAAK,EAAE,MAAM,CAAC,KAAK;wBACnB,4BAA4B,EAAE,MAAM,CAAC,4BAA4B;qBAClE,CAAC,EAAC;;;KACJ;IAEK,+CAAuB,GAA7B,UACE,MAAqC;;;;gBAE/B,GAAG,GAAG,uBAAgB,MAAM,CAAC,QAAQ,0BAAuB,CAAC;gBACnE,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;wBACnB,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,WAAW;wBACvC,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,WAAW;qBACxC,CAAC,EAAC;;;KACJ;IACH,oBAAC;AAAD,CAAC,AA1ED,CAA2C,mBAAU,GA0EpD","sourcesContent":["import {\n GetCandlesParams,\n GetFundingRateChartDataParams,\n GetMarketParams,\n GetMarketResult,\n GetMarketsResult,\n GetMarketTradingHistoryParams,\n GetTradingHistoryResult,\n MarketCandlesResponse,\n} from './types';\nimport { GetFundingRateChartDataResult, RestClient } from '@reyaxyz/common';\n\nexport default class MarketsClient extends RestClient {\n /**\n * Asynchronously retrieves market data from the API.\n *\n * This method makes a request to the API to fetch data for markets. If a specific market is provided as a parameter,\n * it fetches data for that particular market; otherwise, it fetches data for all available markets.\n *\n * @returns {Promise<GetMarketsResult>} A promise that resolves to the response containing market data.\n * @memberof MarketsClient\n *\n * @example\n * // Fetch data for all markets\n * const allMarketsData = await market.getMarkets();\n *\n * @example\n * // Fetch data for a specific market\n * const specificMarketData = await market.getMarkets('ETH-USDC');\n */\n\n async getMarkets(): Promise<GetMarketsResult> {\n const uri = '/api/markets';\n return this.get(uri);\n }\n\n async getMarket(params: GetMarketParams): Promise<GetMarketResult> {\n const uri = `/api/markets/${params.id}`;\n return this.get(uri);\n }\n\n /**\n * Retrieves candlestick data for a specified market.\n *\n * This method fetches historical candlestick (or OHLC - Open, High, Low, Close) data for a given market.\n * The data can be filtered by time range (fromISO and toISO) and resolution.\n *\n * @param {GetCandlesParams} params\n * @returns {Promise<MarketCandlesResponse>} A promise that resolves to the market candlestick data.\n * @memberof MarketsClient\n *\n * @example\n * const marketCandles = await market.getMarketCandles('BTC-USD', '1HR', '2023-01-01T00:00:00Z', '2023-01-02T00:00:00Z');\n */\n\n async getMarketCandles(\n params: GetCandlesParams,\n ): Promise<MarketCandlesResponse> {\n const uri = `/api/markets/candles/${params.marketId}`;\n return this.get(uri, {\n resolution: params.resolution,\n fromISO: params.fromISO,\n toISO: params.toISO,\n limit: params.limit,\n });\n }\n\n async getMarketTradingHistory(\n params: GetMarketTradingHistoryParams,\n ): Promise<GetTradingHistoryResult> {\n const uri = `/api/trades/${params.marketId}`;\n return this.get(uri, {\n limit: params.limit,\n fromTimestampMillisecondsUTC: params.fromTimestampMillisecondsUTC,\n });\n }\n\n async getFundingRateChartData(\n params: GetFundingRateChartDataParams,\n ): Promise<GetFundingRateChartDataResult> {\n const uri = `/api/markets/${params.marketId}/funding-rate-history`;\n return this.get(uri, {\n timeframeMs: params.filters.timeframeMs,\n granularity: params.filters.granularity,\n });\n }\n}\n"]}
|
|
@@ -66,42 +66,6 @@ var OwnerClient = /** @class */ (function (_super) {
|
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
68
|
};
|
|
69
|
-
OwnerClient.prototype.getAccountOwnerMetadata = function (params) {
|
|
70
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
71
|
-
var uri;
|
|
72
|
-
return __generator(this, function (_a) {
|
|
73
|
-
uri = "/api/owner/".concat(params.accountId, "/account-owner-metadata");
|
|
74
|
-
return [2 /*return*/, this.get(uri)];
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
OwnerClient.prototype.getOwnerConfigurationSettings = function (params) {
|
|
79
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
80
|
-
var uri;
|
|
81
|
-
return __generator(this, function (_a) {
|
|
82
|
-
uri = "/api/owner/".concat(params.ownerAddress, "/configuration/settings");
|
|
83
|
-
return [2 /*return*/, this.get(uri)];
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
OwnerClient.prototype.addFavoriteMarket = function (params) {
|
|
88
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
89
|
-
var uri;
|
|
90
|
-
return __generator(this, function (_a) {
|
|
91
|
-
uri = "/api/owner/".concat(params.ownerAddress, "/configuration/favorite-market");
|
|
92
|
-
return [2 /*return*/, this.post(uri, undefined, params)];
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
OwnerClient.prototype.removeFavoriteMarket = function (params) {
|
|
97
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
98
|
-
var uri;
|
|
99
|
-
return __generator(this, function (_a) {
|
|
100
|
-
uri = "/api/owner/".concat(params.ownerAddress, "/configuration/favorite-market");
|
|
101
|
-
return [2 /*return*/, this.delete(uri, undefined, params)];
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
69
|
OwnerClient.prototype.getOwnerLastSeenNotificationTimestamp = function (params) {
|
|
106
70
|
return __awaiter(this, void 0, void 0, function () {
|
|
107
71
|
var uri;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/owner/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/owner/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,0CAA6C;AAE7C;IAAyC,+BAAU;IAAnD;;IA4BA,CAAC;IA3BO,sCAAgB,GAAtB,UACE,MAA8B;;;;gBAExB,GAAG,GAAG,qBAAc,MAAM,CAAC,YAAY,cAAW,CAAC;gBACzD,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAC;;;KACtB;IAEK,2DAAqC,GAA3C,UACE,MAAmD;;;;gBAE7C,GAAG,GAAG,qBAAc,MAAM,CAAC,YAAY,oDAAiD,CAAC;gBAC/F,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAC;;;KACtB;IAEK,2DAAqC,GAA3C,UACE,MAAmD;;;;gBAE7C,GAAG,GAAG,+DAA+D,CAAC;gBAC5E,sBAAO,IAAI,CAAC,GAAG,CACb,GAAG,EACH,EAAE,EACF;wBACE,OAAO,EAAE,MAAM,CAAC,YAAY;wBAC5B,WAAW,EAAE,MAAM,CAAC,WAAW;qBAChC,CACF,EAAC;;;KACH;IACH,kBAAC;AAAD,CAAC,AA5BD,CAAyC,mBAAU,GA4BlD","sourcesContent":["import {\n GetOwnerLastSeenNotificationTimestampParams,\n GetOwnerLastSeenNotificationTimestampResult,\n GetOwnerMetadataParams,\n GetOwnerMetadataResult,\n SetOwnerLastSeenNotificationTimestampParams,\n SetOwnerLastSeenNotificationTimestampResult,\n} from './types';\nimport { RestClient } from '@reyaxyz/common';\n\nexport default class OwnerClient extends RestClient {\n async getOwnerMetadata(\n params: GetOwnerMetadataParams,\n ): Promise<GetOwnerMetadataResult> {\n const uri = `/api/owner/${params.ownerAddress}/metadata`;\n return this.get(uri);\n }\n\n async getOwnerLastSeenNotificationTimestamp(\n params: GetOwnerLastSeenNotificationTimestampParams,\n ): Promise<GetOwnerLastSeenNotificationTimestampResult> {\n const uri = `/api/owner/${params.ownerAddress}/last-seen-notification-timestamp/auto-exchange`;\n return this.get(uri);\n }\n\n async setOwnerLastSeenNotificationTimestamp(\n params: SetOwnerLastSeenNotificationTimestampParams,\n ): Promise<SetOwnerLastSeenNotificationTimestampResult> {\n const uri = `/api/owner/set-last-seen-notification-timestamp/auto-exchange`;\n return this.put(\n uri,\n {},\n {\n address: params.ownerAddress,\n timestampMs: params.timestampMs,\n },\n );\n }\n}\n"]}
|
package/dist/clients/types.js
CHANGED
|
@@ -31,7 +31,6 @@ __exportStar(require("./modules/conditional-orders/types"), exports);
|
|
|
31
31
|
__exportStar(require("./modules/lp/types"), exports);
|
|
32
32
|
__exportStar(require("./modules/markets/types"), exports);
|
|
33
33
|
__exportStar(require("./modules/tokens/types"), exports);
|
|
34
|
-
__exportStar(require("./modules/trade.simulation/types"), exports);
|
|
35
34
|
__exportStar(require("./modules/owner/types"), exports);
|
|
36
35
|
__exportStar(require("./modules/deposit-existing-MA.simulation/types"), exports);
|
|
37
36
|
__exportStar(require("./modules/deposit-new-MA.simulation/types"), exports);
|
|
@@ -44,6 +43,4 @@ __exportStar(require("./modules/transfer-MA-Pool.simulation/types"), exports);
|
|
|
44
43
|
__exportStar(require("./modules/funding-rate/types"), exports);
|
|
45
44
|
__exportStar(require("./modules/depth-chart.simulation/types"), exports);
|
|
46
45
|
__exportStar(require("./modules/deposit-passive-pool.simulation/types"), exports);
|
|
47
|
-
__exportStar(require("./modules/isolated-order.simulation/types"), exports);
|
|
48
|
-
__exportStar(require("./modules/rage-trade/types"), exports);
|
|
49
46
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,0CA4ByB;AA1BvB,2GAAA,iBAAiB,OAAA;AAYjB,qGAAA,WAAW,OAAA;AACX,2GAAA,iBAAiB,OAAA;AACjB,8GAAA,oBAAoB,OAAA;AACpB,yHAAA,+BAA+B,OAAA;AAE/B,oIAAA,0CAA0C,OAAA;AAG1C,6HAAA,mCAAmC,OAAA;AAEnC,uHAAA,6BAA6B,OAAA;AAG7B,8GAAA,oBAAoB,OAAA;AAEtB,0DAAwC;AACxC,qEAAmD;AACnD,qDAAmC;AACnC,0DAAwC;AACxC,yDAAuC;AACvC,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,0CA4ByB;AA1BvB,2GAAA,iBAAiB,OAAA;AAYjB,qGAAA,WAAW,OAAA;AACX,2GAAA,iBAAiB,OAAA;AACjB,8GAAA,oBAAoB,OAAA;AACpB,yHAAA,+BAA+B,OAAA;AAE/B,oIAAA,0CAA0C,OAAA;AAG1C,6HAAA,mCAAmC,OAAA;AAEnC,uHAAA,6BAA6B,OAAA;AAG7B,8GAAA,oBAAoB,OAAA;AAEtB,0DAAwC;AACxC,qEAAmD;AACnD,qDAAmC;AACnC,0DAAwC;AACxC,yDAAuC;AACvC,wDAAsC;AACtC,iFAA+D;AAC/D,4EAA0D;AAC1D,kFAAgE;AAChE,6EAA2D;AAC3D,yEAAuD;AACvD,mFAAiE;AACjE,yFAAuE;AACvE,8EAA4D;AAC5D,+DAA6C;AAC7C,yEAAuD;AACvD,kFAAgE","sourcesContent":["// reexporting what we want to share with integrators\nexport {\n Candle,\n CandlesResolution,\n MarketEntity,\n LpTransactionHistoryEntity,\n TradingHistoryEntity,\n OrderHistoryEntity,\n PositionEntity,\n TransactionHistoryType,\n MarginAccountTransactionHistoryType,\n MarginAccountTransactionHistoryEntity,\n MarginAccountEntity,\n LpPositionEntity,\n LpPoolEntity,\n ReyaChainId,\n MoneyInOutChainId,\n LpBalanceGranularity,\n MarginAccountBalanceGranularity,\n GetMarginAccountBalanceChartDataResult,\n MarginAccountCollateralsBalanceGranularity,\n GetMarginAccountCollateralsBalanceChartDataResult,\n GetAllMarginAccountsBalanceChartDataResult,\n AllMarginAccountsBalanceGranularity,\n GetFundingRateChartDataResult,\n FundingRateHistoryGranularity,\n MoneyInOutConfigurationPerTokenName,\n UnifiedConditionalOrderType,\n ConditionalOrderType,\n} from '@reyaxyz/common';\nexport * from './modules/account/types';\nexport * from './modules/conditional-orders/types';\nexport * from './modules/lp/types';\nexport * from './modules/markets/types';\nexport * from './modules/tokens/types';\nexport * from './modules/owner/types';\nexport * from './modules/deposit-existing-MA.simulation/types';\nexport * from './modules/deposit-new-MA.simulation/types';\nexport * from './modules/deposit-passive-pool.simulation/types';\nexport * from './modules/edit-collateral.simulation/types';\nexport * from './modules/withdraw-MA.simulation/types';\nexport * from './modules/withdraw-passive-pool.simulation/types';\nexport * from './modules/transfer-margin-between-MAs.simulation/types';\nexport * from './modules/transfer-MA-Pool.simulation/types';\nexport * from './modules/funding-rate/types';\nexport * from './modules/depth-chart.simulation/types';\nexport * from './modules/deposit-passive-pool.simulation/types';\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ServiceConfig, ReyaChainId } from '@reyaxyz/common';
|
|
2
2
|
import MarketsClient from './modules/markets';
|
|
3
3
|
import AccountClient from './modules/account';
|
|
4
|
-
import TradeSimulationClient from './modules/trade.simulation';
|
|
5
4
|
import LpClient from './modules/lp';
|
|
6
5
|
import TokensClient from './modules/tokens';
|
|
7
6
|
import OwnerClient from './modules/owner';
|
|
@@ -15,11 +14,9 @@ import TransferMarginBetweenMAsSimulationClient from './modules/transfer-margin-
|
|
|
15
14
|
import TransferMAPoolSimulationClient from './modules/transfer-MA-Pool.simulation';
|
|
16
15
|
import DepthChartSimulationClient from './modules/depth-chart.simulation';
|
|
17
16
|
import FundingRateClient from './modules/funding-rate';
|
|
18
|
-
import IsolatedOrderSimulationClient from './modules/isolated-order.simulation';
|
|
19
17
|
import ConditionalOrdersClient from './modules/conditional-orders';
|
|
20
18
|
import ReferralClient from './modules/referral';
|
|
21
19
|
import AuthClient from './modules/auth';
|
|
22
|
-
import RageTradeClient from './modules/rage-trade';
|
|
23
20
|
/**
|
|
24
21
|
* @description Client for API
|
|
25
22
|
*/
|
|
@@ -29,7 +26,6 @@ export declare class ApiClient {
|
|
|
29
26
|
private readonly _markets;
|
|
30
27
|
private readonly _account;
|
|
31
28
|
private readonly _lp;
|
|
32
|
-
private readonly _tradeSimulation;
|
|
33
29
|
private readonly _fundingRateHistory;
|
|
34
30
|
private readonly _editCollateralSimulation;
|
|
35
31
|
private readonly _depositExistingMASimulation;
|
|
@@ -40,12 +36,10 @@ export declare class ApiClient {
|
|
|
40
36
|
private readonly _transferMarginBetweenMAsSimulation;
|
|
41
37
|
private readonly _transferMAPoolSimulation;
|
|
42
38
|
private readonly _depthSimulation;
|
|
43
|
-
private readonly _isolatedOrderSimulation;
|
|
44
39
|
private readonly _tokens;
|
|
45
40
|
private readonly _owner;
|
|
46
41
|
private readonly _conditionalOrders;
|
|
47
42
|
private readonly _referral;
|
|
48
|
-
private readonly _rageTrade;
|
|
49
43
|
private readonly _auth;
|
|
50
44
|
private constructor();
|
|
51
45
|
static configure(environment: ServiceConfig['environment']): void;
|
|
@@ -67,34 +61,6 @@ export declare class ApiClient {
|
|
|
67
61
|
* @memberof ApiClient
|
|
68
62
|
*/
|
|
69
63
|
static get account(): AccountClient;
|
|
70
|
-
/**
|
|
71
|
-
* Provides access to the TradeSimulationClient instance.
|
|
72
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
73
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
74
|
-
* private `_tradeSimulation` property, ensuring that trade simulation operations
|
|
75
|
-
* use a consistent client configuration and state.
|
|
76
|
-
*
|
|
77
|
-
* @returns {TradeSimulationClient} An instance of TradeSimulationClient for trade simulation operations.
|
|
78
|
-
* @memberof ApiClient
|
|
79
|
-
* @example
|
|
80
|
-
* // Access the trade simulation client from the ApiClient
|
|
81
|
-
* const tradeSimulationClient = ApiClient.tradeSimulation;
|
|
82
|
-
*/
|
|
83
|
-
static get tradeSimulation(): TradeSimulationClient;
|
|
84
|
-
/**
|
|
85
|
-
* Provides access to the IsolatedOrderSimulationClient instance.
|
|
86
|
-
* This getter allows for interacting with isolatedTrade simulation functionalities.
|
|
87
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
88
|
-
* private `_isolatedTradeSimulation` property, ensuring that isolatedTrade simulation operations
|
|
89
|
-
* use a consistent client configuration and state.
|
|
90
|
-
*
|
|
91
|
-
* @returns {IsolatedOrderSimulationClient} An instance of IsolatedOrderSimulationClient for isolatedTrade simulation operations.
|
|
92
|
-
* @memberof ApiClient
|
|
93
|
-
* @example
|
|
94
|
-
* // Access the isolatedTrade simulation client from the ApiClient
|
|
95
|
-
* const isolatedTradeSimulationClient = ApiClient.isolatedTradeSimulation;
|
|
96
|
-
*/
|
|
97
|
-
static get isolatedSimulation(): IsolatedOrderSimulationClient;
|
|
98
64
|
static get fundingRateHistory(): FundingRateClient;
|
|
99
65
|
/**
|
|
100
66
|
* Retrieves the DepthChartSimulationClient instance used for depth simulation.
|
|
@@ -265,14 +231,6 @@ export declare class ApiClient {
|
|
|
265
231
|
* @returns {ReferralClient} The ReferralClient instance currently held by the ApiClient.
|
|
266
232
|
*/
|
|
267
233
|
static get referral(): ReferralClient;
|
|
268
|
-
/**
|
|
269
|
-
* Gets the current instance of the RageTradeClient from the ApiClient.
|
|
270
|
-
*
|
|
271
|
-
* This static getter allows access to the RageTradeClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the RageTradeClient directly, bypassing the need to manually access the internal `_rageTrade` property of the ApiClient instance.
|
|
272
|
-
*
|
|
273
|
-
* @returns {RageTradeClient} The RageTradeClient instance currently held by the ApiClient.
|
|
274
|
-
*/
|
|
275
|
-
static get rageTrade(): RageTradeClient;
|
|
276
234
|
/**
|
|
277
235
|
* Gets the current instance of the AuthClient from the ApiClient.
|
|
278
236
|
*
|