@reyaxyz/api-sdk 0.169.4 → 0.169.6
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
|
@@ -10,15 +10,8 @@ var account_1 = __importDefault(require("./modules/account"));
|
|
|
10
10
|
var lp_1 = __importDefault(require("./modules/lp"));
|
|
11
11
|
var tokens_1 = __importDefault(require("./modules/tokens"));
|
|
12
12
|
var owner_1 = __importDefault(require("./modules/owner"));
|
|
13
|
-
var edit_collateral_simulation_1 = __importDefault(require("./modules/edit-collateral.simulation"));
|
|
14
|
-
var deposit_existing_MA_simulation_1 = __importDefault(require("./modules/deposit-existing-MA.simulation"));
|
|
15
|
-
var deposit_new_MA_simulation_1 = __importDefault(require("./modules/deposit-new-MA.simulation"));
|
|
16
13
|
var deposit_passive_pool_simulation_1 = __importDefault(require("./modules/deposit-passive-pool.simulation"));
|
|
17
|
-
var withdraw_MA_simulation_1 = __importDefault(require("./modules/withdraw-MA.simulation"));
|
|
18
14
|
var withdraw_passive_pool_simulation_1 = __importDefault(require("./modules/withdraw-passive-pool.simulation"));
|
|
19
|
-
var transfer_margin_between_MAs_simulation_1 = __importDefault(require("./modules/transfer-margin-between-MAs.simulation"));
|
|
20
|
-
var transfer_MA_Pool_simulation_1 = __importDefault(require("./modules/transfer-MA-Pool.simulation"));
|
|
21
|
-
var depth_chart_simulation_1 = __importDefault(require("./modules/depth-chart.simulation"));
|
|
22
15
|
var funding_rate_1 = __importDefault(require("./modules/funding-rate"));
|
|
23
16
|
/**
|
|
24
17
|
* @description Client for API
|
|
@@ -32,17 +25,9 @@ var ApiClient = /** @class */ (function () {
|
|
|
32
25
|
this._account = new account_1.default(ApiClient.config.apiEndpoint);
|
|
33
26
|
this._lp = new lp_1.default(ApiClient.config.apiEndpoint);
|
|
34
27
|
this._fundingRateHistory = new funding_rate_1.default(this._markets);
|
|
35
|
-
this._editCollateralSimulation = new edit_collateral_simulation_1.default(ApiClient.network, this._account);
|
|
36
|
-
this._depositExistingMASimulation = new deposit_existing_MA_simulation_1.default(this._editCollateralSimulation, ApiClient.config.apiEndpoint);
|
|
37
|
-
this._depositNewMASimulation = new deposit_new_MA_simulation_1.default(this._depositExistingMASimulation);
|
|
38
28
|
this._depositPassivePoolSimulation = new deposit_passive_pool_simulation_1.default(ApiClient.config.apiEndpoint);
|
|
39
|
-
this._withdrawMASimulation = new withdraw_MA_simulation_1.default(this._editCollateralSimulation, ApiClient.config.chain, ApiClient.config.apiEndpoint);
|
|
40
29
|
this._withdrawPassivePoolSimulation =
|
|
41
30
|
new withdraw_passive_pool_simulation_1.default(ApiClient.config.chain, ApiClient.config.apiEndpoint);
|
|
42
|
-
this._transferMarginBetweenMAsSimulation =
|
|
43
|
-
new transfer_margin_between_MAs_simulation_1.default(ApiClient.network, this._account);
|
|
44
|
-
this._transferMAPoolSimulation = new transfer_MA_Pool_simulation_1.default(this._editCollateralSimulation);
|
|
45
|
-
this._depthSimulation = new depth_chart_simulation_1.default(this._lp);
|
|
46
31
|
this._tokens = new tokens_1.default(ApiClient.config.apiEndpoint);
|
|
47
32
|
this._owner = new owner_1.default(ApiClient.config.apiEndpoint);
|
|
48
33
|
}
|
|
@@ -105,80 +90,6 @@ var ApiClient = /** @class */ (function () {
|
|
|
105
90
|
enumerable: false,
|
|
106
91
|
configurable: true
|
|
107
92
|
});
|
|
108
|
-
Object.defineProperty(ApiClient, "depthSimulation", {
|
|
109
|
-
/**
|
|
110
|
-
* Retrieves the DepthChartSimulationClient instance used for depth simulation.
|
|
111
|
-
* This method provides access to the depth simulation client through the ApiClient.
|
|
112
|
-
* @returns {DepthChartSimulationClient} The DepthChartSimulationClient instance.
|
|
113
|
-
* @static
|
|
114
|
-
* @public
|
|
115
|
-
*/
|
|
116
|
-
get: function () {
|
|
117
|
-
return ApiClient.getInstance()._depthSimulation;
|
|
118
|
-
},
|
|
119
|
-
enumerable: false,
|
|
120
|
-
configurable: true
|
|
121
|
-
});
|
|
122
|
-
Object.defineProperty(ApiClient, "editCollateralSimulationClient", {
|
|
123
|
-
/**
|
|
124
|
-
* Provides access to the EditCollateralSimulationClient instance.
|
|
125
|
-
* This getter allows for interacting with edit collateral simulation functionalities.
|
|
126
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
127
|
-
* private `_editCollateralSimulation` property, ensuring that edit collateral simulation operations
|
|
128
|
-
* use a consistent client configuration and state.
|
|
129
|
-
*
|
|
130
|
-
* @returns {EditCollateralSimulationClient} An instance of EditCollateralSimulationClient for edit collateral simulation operations.
|
|
131
|
-
* @memberof ApiClient
|
|
132
|
-
* @example
|
|
133
|
-
* // Access the edit collateral simulation client from the ApiClient
|
|
134
|
-
* const editCollateralSimulationClient = ApiClient.editCollateralSimulation;
|
|
135
|
-
*/
|
|
136
|
-
get: function () {
|
|
137
|
-
return ApiClient.getInstance()._editCollateralSimulation;
|
|
138
|
-
},
|
|
139
|
-
enumerable: false,
|
|
140
|
-
configurable: true
|
|
141
|
-
});
|
|
142
|
-
Object.defineProperty(ApiClient, "depositExistingMASimulation", {
|
|
143
|
-
/**
|
|
144
|
-
* Provides access to the DepositExistingMASimulationClient instance.
|
|
145
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
146
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
147
|
-
* private `_depositExistingMASimulation` property, ensuring that trade simulation operations
|
|
148
|
-
* use a consistent client configuration and state.
|
|
149
|
-
*
|
|
150
|
-
* @returns {DepositExistingMASimulationClient} An instance of DepositExistingMASimulationClient for trade simulation operations.
|
|
151
|
-
* @memberof ApiClient
|
|
152
|
-
* @example
|
|
153
|
-
* // Access the deposit existing Ma simulation client from the ApiClient
|
|
154
|
-
* const depositExistingMASimulationClient = ApiClient.depositExistingMASimulation;
|
|
155
|
-
*/
|
|
156
|
-
get: function () {
|
|
157
|
-
return ApiClient.getInstance()._depositExistingMASimulation;
|
|
158
|
-
},
|
|
159
|
-
enumerable: false,
|
|
160
|
-
configurable: true
|
|
161
|
-
});
|
|
162
|
-
Object.defineProperty(ApiClient, "depositNewMASimulation", {
|
|
163
|
-
/**
|
|
164
|
-
* Provides access to the DepositNewMASimulationClient instance.
|
|
165
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
166
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
167
|
-
* private `_depositNewMASimulation` property, ensuring that trade simulation operations
|
|
168
|
-
* use a consistent client configuration and state.
|
|
169
|
-
*
|
|
170
|
-
* @returns {DepositNewMASimulationClient} An instance of DepositNewMASimulationClient for trade simulation operations.
|
|
171
|
-
* @memberof ApiClient
|
|
172
|
-
* @example
|
|
173
|
-
* // Access the deposit new MA simulation client from the ApiClient
|
|
174
|
-
* const depositNewMASimulationClient = ApiClient.depositNewMASimulation;
|
|
175
|
-
*/
|
|
176
|
-
get: function () {
|
|
177
|
-
return ApiClient.getInstance()._depositNewMASimulation;
|
|
178
|
-
},
|
|
179
|
-
enumerable: false,
|
|
180
|
-
configurable: true
|
|
181
|
-
});
|
|
182
93
|
Object.defineProperty(ApiClient, "depositPassivePoolSimulation", {
|
|
183
94
|
/**
|
|
184
95
|
* Provides access to the DepositPassivePoolSimulationClient instance.
|
|
@@ -199,26 +110,6 @@ var ApiClient = /** @class */ (function () {
|
|
|
199
110
|
enumerable: false,
|
|
200
111
|
configurable: true
|
|
201
112
|
});
|
|
202
|
-
Object.defineProperty(ApiClient, "withdrawMASimulation", {
|
|
203
|
-
/**
|
|
204
|
-
* Provides access to the WithdrawMASimulationClient instance.
|
|
205
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
206
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
207
|
-
* private `_withdrawMASimulation` property, ensuring that trade simulation operations
|
|
208
|
-
* use a consistent client configuration and state.
|
|
209
|
-
*
|
|
210
|
-
* @returns {WithdrawMASimulationClient} An instance of WithdrawMASimulationClient for trade simulation operations.
|
|
211
|
-
* @memberof ApiClient
|
|
212
|
-
* @example
|
|
213
|
-
* // Access the withdraw MA simulation client from the ApiClient
|
|
214
|
-
* const withdrawMASimulationClient = ApiClient.withdrawMASimulation;
|
|
215
|
-
*/
|
|
216
|
-
get: function () {
|
|
217
|
-
return ApiClient.getInstance()._withdrawMASimulation;
|
|
218
|
-
},
|
|
219
|
-
enumerable: false,
|
|
220
|
-
configurable: true
|
|
221
|
-
});
|
|
222
113
|
Object.defineProperty(ApiClient, "withdrawPassivePoolSimulation", {
|
|
223
114
|
/**
|
|
224
115
|
* Provides access to the WithdrawPassivePoolSimulationClient instance.
|
|
@@ -239,46 +130,6 @@ var ApiClient = /** @class */ (function () {
|
|
|
239
130
|
enumerable: false,
|
|
240
131
|
configurable: true
|
|
241
132
|
});
|
|
242
|
-
Object.defineProperty(ApiClient, "transferMarginBetweenMAsSimulation", {
|
|
243
|
-
/**
|
|
244
|
-
* Provides access to the TransferMarginBetweenMAsSimulationClient instance.
|
|
245
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
246
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
247
|
-
* private `_transferMarginBetweenMAsSimulation` property, ensuring that trade simulation operations
|
|
248
|
-
* use a consistent client configuration and state.
|
|
249
|
-
*
|
|
250
|
-
* @returns {TransferMarginBetweenMAsSimulationClient} An instance of TransferMarginBetweenMAsSimulationClient for trade simulation operations.
|
|
251
|
-
* @memberof ApiClient
|
|
252
|
-
* @example
|
|
253
|
-
* // Access the transfer margin between MAs simulation client from the ApiClient
|
|
254
|
-
* const transferMarginBetweenMAsSimulationClient = ApiClient.transferMarginBetweenMAsSimulation;
|
|
255
|
-
*/
|
|
256
|
-
get: function () {
|
|
257
|
-
return ApiClient.getInstance()._transferMarginBetweenMAsSimulation;
|
|
258
|
-
},
|
|
259
|
-
enumerable: false,
|
|
260
|
-
configurable: true
|
|
261
|
-
});
|
|
262
|
-
Object.defineProperty(ApiClient, "transferMAPoolSimulation", {
|
|
263
|
-
/**
|
|
264
|
-
* Provides access to the TransferMAPoolSimulationClient instance.
|
|
265
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
266
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
267
|
-
* private `_TransferMAPoolSimulation` property, ensuring that trade simulation operations
|
|
268
|
-
* use a consistent client configuration and state.
|
|
269
|
-
*
|
|
270
|
-
* @returns {TransferMAPoolSimulationClient} An instance of TransferMAPoolSimulationClient for trade simulation operations.
|
|
271
|
-
* @memberof ApiClient
|
|
272
|
-
* @example
|
|
273
|
-
* // Access the transfer from MA to Pool simulation client from the ApiClient
|
|
274
|
-
* const transferMAPoolSimulationClient = ApiClient.transferMAPoolSimulation;
|
|
275
|
-
*/
|
|
276
|
-
get: function () {
|
|
277
|
-
return ApiClient.getInstance()._transferMAPoolSimulation;
|
|
278
|
-
},
|
|
279
|
-
enumerable: false,
|
|
280
|
-
configurable: true
|
|
281
|
-
});
|
|
282
133
|
Object.defineProperty(ApiClient, "lp", {
|
|
283
134
|
/**
|
|
284
135
|
* Gets the current instance of the LpClient from the ApiClient.
|
|
@@ -1 +1 @@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;;;;;;WAYG;aAEH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,qBAAqB,CAAC;QACvD,CAAC;;;OAAA;IAgBD,sBAAkB,0CAA6B;QAd/C;;;;;;;;;;;;WAYG;aAEH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,8BAA8B,CAAC;QAChE,CAAC;;;OAAA;IAgBD,sBAAkB,+CAAkC;QAdpD;;;;;;;;;;;;WAYG;aAEH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,mCAAmC,CAAC;QACrE,CAAC;;;OAAA;IAgBD,sBAAkB,qCAAwB;QAd1C;;;;;;;;;;;;WAYG;aAEH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,yBAAyB,CAAC;QAC3D,CAAC;;;OAAA;IAYD,sBAAkB,eAAE;QAVpB;;;;;;;;;WASG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC;QACrC,CAAC;;;OAAA;IAYD,sBAAkB,mBAAM;QAVxB;;;;;;;;;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;IACH,gBAAC;AAAD,CAAC,AA5TD,IA4TC;AA5TY,8BAAS","sourcesContent":["import type { ReyaChainId } from '@reyaxyz/common';\nimport type { ServiceConfig } from './api-client-config';\nimport { getApiClientConfig } from './api-client-config';\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';\n\n/**\n * @description Client for API\n */\nexport class ApiClient {\n private static instance: ApiClient;\n private static config?: ServiceConfig;\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\n private constructor() {\n if (!ApiClient.config) {\n throw new Error(\n 'ApiClient is not configured. Please configure it before using.',\n );\n }\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 }\n\n public static configure(environment: ServiceConfig['environment']): void;\n public static configure(config: ServiceConfig): void;\n public static configure(\n configOrEnvironment: ServiceConfig['environment'] | ServiceConfig,\n ): void {\n ApiClient.config =\n typeof configOrEnvironment === 'string'\n ? getApiClientConfig(configOrEnvironment)\n : configOrEnvironment;\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"]}
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"/","sources":["clients/api-client.ts"],"names":[],"mappings":";;;;;;AAEA,yDAAyD;AACzD,8DAA8C;AAC9C,8DAA8C;AAC9C,oDAAoC;AACpC,4DAA4C;AAC5C,0DAA0C;AAC1C,8GAA2F;AAC3F,gHAA6F;AAC7F,wEAAuD;AAEvD;;GAEG;AACH;IAYE;QACE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;QACJ,CAAC;QACD,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,CA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zB;;;;;;WAMG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;QAC1C,CAAC;;;OAAA;IASD,sBAAkB,oBAAO;QAPzB;;;;;;WAMG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;QAC1C,CAAC;;;OAAA;IAED,sBAAkB,+BAAkB;aAApC;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,mBAAmB,CAAC;QACrD,CAAC;;;OAAA;IAgBD,sBAAkB,yCAA4B;QAd9C;;;;;;;;;;;;WAYG;aAEH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,6BAA6B,CAAC;QAC/D,CAAC;;;OAAA;IAgBD,sBAAkB,0CAA6B;QAd/C;;;;;;;;;;;;WAYG;aAEH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,8BAA8B,CAAC;QAChE,CAAC;;;OAAA;IAYD,sBAAkB,eAAE;QAVpB;;;;;;;;;WASG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC;QACrC,CAAC;;;OAAA;IAYD,sBAAkB,mBAAM;QAVxB;;;;;;;;;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;IACH,gBAAC;AAAD,CAAC,AApKD,IAoKC;AApKY,8BAAS","sourcesContent":["import type { ReyaChainId } from '@reyaxyz/common';\nimport type { ServiceConfig } from './api-client-config';\nimport { getApiClientConfig } from './api-client-config';\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 DepositPassivePoolSimulationClient from './modules/deposit-passive-pool.simulation';\nimport WithdrawPassivePoolSimulationClient from './modules/withdraw-passive-pool.simulation';\nimport FundingRateClient from './modules/funding-rate';\n\n/**\n * @description Client for API\n */\nexport class ApiClient {\n private static instance: ApiClient;\n private static config?: ServiceConfig;\n private readonly _markets: MarketsClient;\n private readonly _account: AccountClient;\n private readonly _lp: LpClient;\n private readonly _fundingRateHistory: FundingRateClient;\n private readonly _depositPassivePoolSimulation: DepositPassivePoolSimulationClient;\n private readonly _withdrawPassivePoolSimulation: WithdrawPassivePoolSimulationClient;\n private readonly _tokens: TokensClient;\n private readonly _owner: OwnerClient;\n\n private constructor() {\n if (!ApiClient.config) {\n throw new Error(\n 'ApiClient is not configured. Please configure it before using.',\n );\n }\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._depositPassivePoolSimulation = new DepositPassivePoolSimulationClient(\n ApiClient.config.apiEndpoint,\n );\n this._withdrawPassivePoolSimulation =\n new WithdrawPassivePoolSimulationClient(\n ApiClient.config.chain,\n ApiClient.config.apiEndpoint,\n );\n this._tokens = new TokensClient(ApiClient.config.apiEndpoint);\n this._owner = new OwnerClient(ApiClient.config.apiEndpoint);\n }\n\n public static configure(environment: ServiceConfig['environment']): void;\n public static configure(config: ServiceConfig): void;\n public static configure(\n configOrEnvironment: ServiceConfig['environment'] | ServiceConfig,\n ): void {\n ApiClient.config =\n typeof configOrEnvironment === 'string'\n ? getApiClientConfig(configOrEnvironment)\n : configOrEnvironment;\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 * 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 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 * 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"]}
|
|
@@ -147,26 +147,6 @@ var AccountClient = /** @class */ (function (_super) {
|
|
|
147
147
|
});
|
|
148
148
|
});
|
|
149
149
|
};
|
|
150
|
-
AccountClient.prototype.getEditCollateralSimulationInitialData = function (params) {
|
|
151
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
152
|
-
var uri;
|
|
153
|
-
return __generator(this, function (_a) {
|
|
154
|
-
uri = "/api/accounts/".concat(params.marginAccountId, "/edit-collateral-simulation-data");
|
|
155
|
-
return [2 /*return*/, this.get(uri)];
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
AccountClient.prototype.getMaxWithdrawBalanceForAccount = function (params) {
|
|
160
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
161
|
-
var uri;
|
|
162
|
-
return __generator(this, function (_a) {
|
|
163
|
-
uri = "/api/accounts/".concat(params.marginAccountId, "/max-withdraw-amount");
|
|
164
|
-
return [2 /*return*/, this.get(uri, {
|
|
165
|
-
assetAddress: params.tokenAddress,
|
|
166
|
-
})];
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
};
|
|
170
150
|
// TODO: Milan validate
|
|
171
151
|
AccountClient.prototype.editMarginAccount = function (params) {
|
|
172
152
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,0CAA0E;AAE1E;IAA2C,iCAAU;IAArD;;IA+GA,CAAC;IA9GC;;;;;;;;;;;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;wBAEI,gBAAgB,GAAG,QAAQ,CAAC,GAAG,CACnC,UAAC,OAAO;4BACN,OAAO;gCACL,EAAE,EAAE,OAAO,CAAC,EAAE;gCACd,IAAI,EAAE,OAAO,CAAC,IAAI;6BACnB,CAAC;wBACJ,CAAC,CACF,CAAC;wBAE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AK,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;oBAC1C,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;gBAC5C,CAAC;gBAEK,GAAG,GAAG,wBAAiB,MAAM,CAAC,EAAE,UAAO,CAAC;gBAC9C,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;wBACnB,EAAE,EAAE,MAAM,CAAC,EAAE;wBACb,IAAI,EAAE,MAAM,CAAC,IAAI;qBAClB,CAAC,EAAC;;;KACJ;IACK,0CAAkB,GAAxB,UACE,MAAgC;;;;gBAEhC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;oBACf,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;gBAC/C,CAAC;gBAEK,GAAG,GAAG,wBAAiB,MAAM,CAAC,EAAE,WAAQ,CAAC;gBAC/C,sBAAO,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;wBACtB,EAAE,EAAE,MAAM,CAAC,EAAE;qBACd,CAAC,EAAC;;;KACJ;IACH,oBAAC;AAAD,CAAC,AA/GD,CAA2C,mBAAU,GA+GpD","sourcesContent":["import {\n GetMarginAccountParams,\n GetMarginAccountResult,\n GetMarginAccountsParams,\n GetMarginAccountsResult,\n EditMarginAccountParams,\n CloseMarginAccountParams,\n EditMarginAccountResult,\n CloseMarginAccountResult,\n GetMarginAccountOrderHistoryPaginatedParams,\n GetMarginAccountOrderHistoryPaginatedResult,\n GetLiquidationHistoryForOwnerAddressResult,\n GetLiquidationHistoryForOwnerAddressParams,\n} from './types';\nimport { RestClient, StrippedMarginAccountEntity } 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 const strippedResponse = response.map(\n (account): StrippedMarginAccountEntity => {\n return {\n id: account.id,\n name: account.name,\n };\n },\n );\n\n return strippedResponse;\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 const response: GetMarginAccountResult = await this.get(uri);\n\n const strippedResponse = {\n id: response.id,\n name: response.name,\n };\n\n return strippedResponse;\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 // 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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/account/types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n MarketEntity,\n PositionEntity,\n OrderHistoryEntity,\n MarginRatioHealth,\n StrippedMarginAccountEntity,\n} from '@reyaxyz/common';\nimport {\n MarginAccountBalanceGranularity,\n MarginAccountCollateralsBalanceGranularity,\n AllMarginAccountsBalanceGranularity,\n} from '@reyaxyz/common';\nimport { Address } from '@reyaxyz/common';\n\nexport type GetMarginAccountsParams = {\n address: string;\n limit?: number;\n};\n\nexport type GetMarginAccountParams = {\n address: string;\n marginAccountId: number;\n};\n\nexport type GetPositionsForMarginAccountParams = {\n address: string;\n marginAccountId: number;\n limit?: number;\n};\n\nexport type GetMarginAccountsResult = StrippedMarginAccountEntity[];\n\nexport type GetMarginAccountResult = StrippedMarginAccountEntity;\n\n// -- Max Order Size --\n\nexport type GetMaxOrderSizeAvailableParams = {\n marketId: MarketEntity['id'];\n marginAccountId: number;\n direction: 'long' | 'short';\n};\n\nexport type GetMaxOrderSizeAvailableResult = {\n maxAmountBase: number;\n maxAmountSize: number;\n};\n\
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/account/types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n MarketEntity,\n PositionEntity,\n OrderHistoryEntity,\n MarginRatioHealth,\n StrippedMarginAccountEntity,\n} from '@reyaxyz/common';\nimport {\n MarginAccountBalanceGranularity,\n MarginAccountCollateralsBalanceGranularity,\n AllMarginAccountsBalanceGranularity,\n} from '@reyaxyz/common';\nimport { Address } from '@reyaxyz/common';\n\nexport type GetMarginAccountsParams = {\n address: string;\n limit?: number;\n};\n\nexport type GetMarginAccountParams = {\n address: string;\n marginAccountId: number;\n};\n\nexport type GetPositionsForMarginAccountParams = {\n address: string;\n marginAccountId: number;\n limit?: number;\n};\n\nexport type GetMarginAccountsResult = StrippedMarginAccountEntity[];\n\nexport type GetMarginAccountResult = StrippedMarginAccountEntity;\n\n// -- Max Order Size --\n\nexport type GetMaxOrderSizeAvailableParams = {\n marketId: MarketEntity['id'];\n marginAccountId: number;\n direction: 'long' | 'short';\n};\n\nexport type GetMaxOrderSizeAvailableResult = {\n maxAmountBase: number;\n maxAmountSize: number;\n};\n\nexport type GetPositionsForMarginAccountResult = {\n positions: PositionEntity[];\n totalUnrealizedPNL: number;\n};\n\n// --- Order History ---\n\nexport type GetMarginAccountOrderHistoryParams = {\n address: string;\n marginAccountId: number;\n limit?: number;\n};\nexport type GetMarginAccountOrderHistoryPaginatedParams = {\n address: string;\n marginAccountId: number;\n page: number;\n perPage: number;\n type?: 'order' | 'liquidation';\n};\nexport type GetMarginAccountOrderHistoryResult = OrderHistoryEntity[];\nexport type GetMarginAccountOrderHistoryPaginatedResult = {\n data: OrderHistoryEntity[];\n totalCount: number;\n};\n\n//--- Liquidation History ---\nexport type GetLiquidationHistoryForOwnerAddressParams = {\n address: Address;\n timestampFromMS: number;\n};\nexport type GetLiquidationHistoryForOwnerAddressResult = {\n data: LiquidationHistoryEntity[];\n};\n\nexport type LiquidationHistoryEntity = {\n id: string;\n action: 'long-liquidation' | 'short-liquidation';\n executionPrice: number;\n fees: number;\n base: number;\n size: number; // price * base (liquidation size)\n timestamp: number;\n baseUnderlyingToken: string;\n marginAccount: {\n id: number;\n name: string;\n marginRatioPercentage: number;\n marginRatioHealth: MarginRatioHealth;\n };\n};\n\n// ---- Transaction Simulation ----\n\nexport type GetTransactionSimulationInitialDataParams = {\n marketId: MarketEntity['id'];\n marginAccountId: number;\n};\n\nexport type GetMarginAccountBalanceChartDataParams = {\n marginAccountId: number;\n filters: {\n timeframeMs: number;\n granularity: MarginAccountBalanceGranularity;\n };\n};\n\nexport type GetMarginAccountCollateralsBalanceChartDataParams = {\n marginAccountId: number;\n filters: {\n timeframeMs: number;\n granularity: MarginAccountCollateralsBalanceGranularity;\n };\n};\n\nexport type GetAllMarginAccountsBalanceChartDataParams = {\n ownerAddress: string;\n filters: {\n timeframeMs: number;\n granularity: AllMarginAccountsBalanceGranularity;\n };\n};\n\nexport type EditMarginAccountParams = {\n id: number;\n name: string;\n};\n\nexport type EditMarginAccountResult = { success: boolean };\n\nexport type CloseMarginAccountParams = {\n id: number;\n};\n\nexport type CloseMarginAccountResult = { success: boolean };\n\nexport type GetAllMarginAccountsSummaryParams = {\n ownerAddress: string;\n};\n\nexport type GetAllMarginAccountsSummaryResult = {\n totalAccountsCount: number;\n totalBalance: number;\n totalBalanceChangePercentage: number;\n totalBalanceUnderlyingAsset: string;\n};\n\nexport type GetIsolatedOrderMaxSizeAvailableParams = {\n marketId: MarketEntity['id'];\n marginAccountId: number;\n direction: 'long' | 'short';\n};\n\nexport type GetIsolatedOrderMaxSizeAvailableResult = {\n maxAmountBase: number;\n maxAmountSize: number;\n};\n"]}
|
|
@@ -88,15 +88,6 @@ var LpClient = /** @class */ (function (_super) {
|
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
90
|
};
|
|
91
|
-
LpClient.prototype.getLpPoolDepthChartSimulationData = function (params) {
|
|
92
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
93
|
-
var uri;
|
|
94
|
-
return __generator(this, function (_a) {
|
|
95
|
-
uri = "/api/lp-pools/".concat(params.marketId, "/depth-simulation-data");
|
|
96
|
-
return [2 /*return*/, this.get(uri)];
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
91
|
LpClient.prototype.pushBridgeTransaction = function (params) {
|
|
101
92
|
return __awaiter(this, void 0, void 0, function () {
|
|
102
93
|
var uri;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/lp/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/lp/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,0CAA2E;AAC3E;IAAsC,4BAAU;IAAhD;;IAgDA,CAAC;IA/CO,6BAAU,GAAhB;;;;gBACQ,GAAG,GAAG,eAAe,CAAC;gBAC5B,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAC;;;KACtB;IAEK,mCAAgB,GAAtB,UACE,MAA8B;;;;gBAExB,GAAG,GAAG,wBAAiB,MAAM,CAAC,EAAE,cAAW,CAAC;gBAClD,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;wBACnB,OAAO,EAAE,MAAM,CAAC,OAAO;qBACxB,CAAC,EAAC;;;KACJ;IAEK,2CAAwB,GAA9B,UACE,MAAsC;;;;gBAEhC,GAAG,GAAG,wBAAiB,MAAM,CAAC,EAAE,sBAAmB,CAAC;gBAC1D,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;wBACnB,OAAO,EAAE,MAAM,CAAC,OAAO;qBACxB,CAAC,EAAC;;;KACJ;IAEK,wCAAqB,GAA3B,UACE,MAAmC;;;;gBAE7B,GAAG,GAAG,+CAA+C,CAAC;gBAC5D,sBAAO,IAAI,CAAC,IAAI,CACd,GAAG,EACH,EAAE,EACF;wBACE,OAAO,EAAE,MAAM,CAAC,eAAe;wBAC/B,cAAc,EAAE,MAAM,CAAC,aAAa;wBACpC,eAAe,EAAE,MAAM,CAAC,aAAa;wBACrC,MAAM,EAAE,MAAM,CAAC,MAAM;qBACtB,CACF,EAAC;;;KACH;IAEK,+CAA4B,GAAlC,UACE,MAA0C;;;;gBAEpC,GAAG,GAAG,+CAA+C,CAAC;gBAC5D,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;wBACnB,cAAc,EAAE,MAAM,CAAC,aAAa;qBACrC,CAAC,EAAC;;;KACJ;IACH,eAAC;AAAD,CAAC,AAhDD,CAAsC,mBAAU,GAgD/C","sourcesContent":["import {\n GetLpPoolsResult,\n GetLpPoolWithdrawBalanceParams,\n GetLpPoolWithdrawBalanceResult,\n PushBridgeTransactionParams,\n PushBridgeTransactionResult,\n GetPendingBridgeTransactionsParams,\n GetPendingBridgeTransactionsResult,\n GetLpPoolDataRPCParams,\n} from './types';\nimport { RestClient, GetLpPoolPositionRPCResponse } from '@reyaxyz/common';\nexport default class LpClient extends RestClient {\n async getLpPools(): Promise<GetLpPoolsResult> {\n const uri = '/api/lp-pools';\n return this.get(uri);\n }\n\n async getLpPoolDataRPC(\n params: GetLpPoolDataRPCParams,\n ): Promise<GetLpPoolPositionRPCResponse> {\n const uri = `/api/lp-pools/${params.id}/data-rpc`;\n return this.get(uri, {\n address: params.address,\n });\n }\n\n async getLpPoolWithdrawBalance(\n params: GetLpPoolWithdrawBalanceParams,\n ): Promise<GetLpPoolWithdrawBalanceResult> {\n const uri = `/api/lp-pools/${params.id}/withdraw-balance`;\n return this.get(uri, {\n address: params.address,\n });\n }\n\n async pushBridgeTransaction(\n params: PushBridgeTransactionParams,\n ): Promise<PushBridgeTransactionResult> {\n const uri = `/api/lp-pools/push-pending-transaction/bridge`;\n return this.post(\n uri,\n {},\n {\n tx_hash: params.transactionHash,\n wallet_address: params.walletAddress,\n source_chain_id: params.sourceChainId,\n amount: params.amount,\n },\n );\n }\n\n async getPendingBridgeTransactions(\n params: GetPendingBridgeTransactionsParams,\n ): Promise<GetPendingBridgeTransactionsResult> {\n const uri = `/api/lp-pools/get-pending-transactions/bridge`;\n return this.get(uri, {\n wallet_address: params.walletAddress,\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/lp/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/lp/types.ts"],"names":[],"mappings":";;;AAmBA,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAChC,mFAAsB,CAAA;IACtB,iFAAyB,CAAA;IACzB,gFAA6B,CAAA;IAC7B,mFAAkC,CAAA;IAClC,sFAAoC,CAAA;IACpC,qFAAoC,CAAA;AACtC,CAAC,EAPW,sBAAsB,sCAAtB,sBAAsB,QAOjC","sourcesContent":["import {\n LpPoolEntity,\n LpWithdrawBalanceEntity,\n MoneyInOutChainId,\n ReyaChainId,\n Address,\n} from '@reyaxyz/common';\n\nimport { SocketBridgeTransactionPoolStatus } from '@reyaxyz/common';\n\nexport type GetLpPoolsResult = LpPoolEntity[];\n\nexport type GetLpPoolWithdrawBalanceParams = {\n id: LpPoolEntity['id'];\n address: string; // wallet address\n};\n\nexport type GetLpPoolWithdrawBalanceResult = LpWithdrawBalanceEntity;\n\nexport enum PerformanceGranularity {\n ONE_MINUTE = 60 * 1000,\n ONE_HOUR = 60 * 60 * 1000,\n ONE_DAY = 24 * 60 * 60 * 1000,\n ONE_WEEK = 7 * 24 * 60 * 60 * 1000,\n ONE_MONTH = 30 * 24 * 60 * 60 * 1000,\n ONE_YEAR = 365 * 24 * 60 * 60 * 1000,\n}\n\nexport type PushBridgeTransactionParams = {\n transactionHash: string;\n walletAddress: string;\n sourceChainId: MoneyInOutChainId | ReyaChainId;\n amount: number; // amount from bridge input\n};\n\nexport type BridgeTransactionPool = {\n sourceTxHash: string;\n sourceTxExplorerLink: string;\n destinationTxHash?: string;\n destinationTxExplorerLink?: string;\n sourceChainId: MoneyInOutChainId | ReyaChainId;\n destinationChainId: MoneyInOutChainId | ReyaChainId;\n walletAddress: string;\n status: SocketBridgeTransactionPoolStatus;\n amount: number;\n};\n\nexport type PushBridgeTransactionResult = BridgeTransactionPool;\n\nexport type GetPendingBridgeTransactionsParams = {\n walletAddress: string;\n};\n\nexport type GetPendingBridgeTransactionsResult = BridgeTransactionPool[];\n\nexport type GetLpPoolDataRPCParams = {\n id: LpPoolEntity['id'];\n address: Address;\n};\n"]}
|
package/dist/clients/types.js
CHANGED
|
@@ -30,15 +30,8 @@ __exportStar(require("./modules/lp/types"), exports);
|
|
|
30
30
|
__exportStar(require("./modules/markets/types"), exports);
|
|
31
31
|
__exportStar(require("./modules/tokens/types"), exports);
|
|
32
32
|
__exportStar(require("./modules/owner/types"), exports);
|
|
33
|
-
__exportStar(require("./modules/deposit-existing-MA.simulation/types"), exports);
|
|
34
|
-
__exportStar(require("./modules/deposit-new-MA.simulation/types"), exports);
|
|
35
33
|
__exportStar(require("./modules/deposit-passive-pool.simulation/types"), exports);
|
|
36
|
-
__exportStar(require("./modules/edit-collateral.simulation/types"), exports);
|
|
37
|
-
__exportStar(require("./modules/withdraw-MA.simulation/types"), exports);
|
|
38
34
|
__exportStar(require("./modules/withdraw-passive-pool.simulation/types"), exports);
|
|
39
|
-
__exportStar(require("./modules/transfer-margin-between-MAs.simulation/types"), exports);
|
|
40
|
-
__exportStar(require("./modules/transfer-MA-Pool.simulation/types"), exports);
|
|
41
35
|
__exportStar(require("./modules/funding-rate/types"), exports);
|
|
42
|
-
__exportStar(require("./modules/depth-chart.simulation/types"), exports);
|
|
43
36
|
__exportStar(require("./modules/deposit-passive-pool.simulation/types"), exports);
|
|
44
37
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,0CAsByB;AApBvB,2GAAA,iBAAiB,OAAA;AAQjB,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;AAG/B,0DAAwC;AACxC,qDAAmC;AACnC,0DAAwC;AACxC,yDAAuC;AACvC,wDAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,0CAsByB;AApBvB,2GAAA,iBAAiB,OAAA;AAQjB,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;AAG/B,0DAAwC;AACxC,qDAAmC;AACnC,0DAAwC;AACxC,yDAAuC;AACvC,wDAAsC;AACtC,kFAAgE;AAChE,mFAAiE;AACjE,+DAA6C;AAC7C,kFAAgE","sourcesContent":["// reexporting what we want to share with integrators\nexport {\n Candle,\n CandlesResolution,\n MarketEntity,\n LpTransactionHistoryEntity,\n OrderHistoryEntity,\n PositionEntity,\n TransactionHistoryType,\n StrippedMarginAccountEntity,\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} from '@reyaxyz/common';\nexport * from './modules/account/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-passive-pool.simulation/types';\nexport * from './modules/withdraw-passive-pool.simulation/types';\nexport * from './modules/funding-rate/types';\nexport * from './modules/deposit-passive-pool.simulation/types';\n"]}
|
|
@@ -5,15 +5,8 @@ import AccountClient from './modules/account';
|
|
|
5
5
|
import LpClient from './modules/lp';
|
|
6
6
|
import TokensClient from './modules/tokens';
|
|
7
7
|
import OwnerClient from './modules/owner';
|
|
8
|
-
import EditCollateralSimulationClient from './modules/edit-collateral.simulation';
|
|
9
|
-
import DepositExistingMASimulationClient from './modules/deposit-existing-MA.simulation';
|
|
10
|
-
import DepositNewMASimulationClient from './modules/deposit-new-MA.simulation';
|
|
11
8
|
import DepositPassivePoolSimulationClient from './modules/deposit-passive-pool.simulation';
|
|
12
|
-
import WithdrawMASimulationClient from './modules/withdraw-MA.simulation';
|
|
13
9
|
import WithdrawPassivePoolSimulationClient from './modules/withdraw-passive-pool.simulation';
|
|
14
|
-
import TransferMarginBetweenMAsSimulationClient from './modules/transfer-margin-between-MAs.simulation';
|
|
15
|
-
import TransferMAPoolSimulationClient from './modules/transfer-MA-Pool.simulation';
|
|
16
|
-
import DepthChartSimulationClient from './modules/depth-chart.simulation';
|
|
17
10
|
import FundingRateClient from './modules/funding-rate';
|
|
18
11
|
/**
|
|
19
12
|
* @description Client for API
|
|
@@ -25,15 +18,8 @@ export declare class ApiClient {
|
|
|
25
18
|
private readonly _account;
|
|
26
19
|
private readonly _lp;
|
|
27
20
|
private readonly _fundingRateHistory;
|
|
28
|
-
private readonly _editCollateralSimulation;
|
|
29
|
-
private readonly _depositExistingMASimulation;
|
|
30
|
-
private readonly _depositNewMASimulation;
|
|
31
21
|
private readonly _depositPassivePoolSimulation;
|
|
32
|
-
private readonly _withdrawMASimulation;
|
|
33
22
|
private readonly _withdrawPassivePoolSimulation;
|
|
34
|
-
private readonly _transferMarginBetweenMAsSimulation;
|
|
35
|
-
private readonly _transferMAPoolSimulation;
|
|
36
|
-
private readonly _depthSimulation;
|
|
37
23
|
private readonly _tokens;
|
|
38
24
|
private readonly _owner;
|
|
39
25
|
private constructor();
|
|
@@ -58,56 +44,6 @@ export declare class ApiClient {
|
|
|
58
44
|
*/
|
|
59
45
|
static get account(): AccountClient;
|
|
60
46
|
static get fundingRateHistory(): FundingRateClient;
|
|
61
|
-
/**
|
|
62
|
-
* Retrieves the DepthChartSimulationClient instance used for depth simulation.
|
|
63
|
-
* This method provides access to the depth simulation client through the ApiClient.
|
|
64
|
-
* @returns {DepthChartSimulationClient} The DepthChartSimulationClient instance.
|
|
65
|
-
* @static
|
|
66
|
-
* @public
|
|
67
|
-
*/
|
|
68
|
-
static get depthSimulation(): DepthChartSimulationClient;
|
|
69
|
-
/**
|
|
70
|
-
* Provides access to the EditCollateralSimulationClient instance.
|
|
71
|
-
* This getter allows for interacting with edit collateral simulation functionalities.
|
|
72
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
73
|
-
* private `_editCollateralSimulation` property, ensuring that edit collateral simulation operations
|
|
74
|
-
* use a consistent client configuration and state.
|
|
75
|
-
*
|
|
76
|
-
* @returns {EditCollateralSimulationClient} An instance of EditCollateralSimulationClient for edit collateral simulation operations.
|
|
77
|
-
* @memberof ApiClient
|
|
78
|
-
* @example
|
|
79
|
-
* // Access the edit collateral simulation client from the ApiClient
|
|
80
|
-
* const editCollateralSimulationClient = ApiClient.editCollateralSimulation;
|
|
81
|
-
*/
|
|
82
|
-
static get editCollateralSimulationClient(): EditCollateralSimulationClient;
|
|
83
|
-
/**
|
|
84
|
-
* Provides access to the DepositExistingMASimulationClient instance.
|
|
85
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
86
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
87
|
-
* private `_depositExistingMASimulation` property, ensuring that trade simulation operations
|
|
88
|
-
* use a consistent client configuration and state.
|
|
89
|
-
*
|
|
90
|
-
* @returns {DepositExistingMASimulationClient} An instance of DepositExistingMASimulationClient for trade simulation operations.
|
|
91
|
-
* @memberof ApiClient
|
|
92
|
-
* @example
|
|
93
|
-
* // Access the deposit existing Ma simulation client from the ApiClient
|
|
94
|
-
* const depositExistingMASimulationClient = ApiClient.depositExistingMASimulation;
|
|
95
|
-
*/
|
|
96
|
-
static get depositExistingMASimulation(): DepositExistingMASimulationClient;
|
|
97
|
-
/**
|
|
98
|
-
* Provides access to the DepositNewMASimulationClient instance.
|
|
99
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
100
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
101
|
-
* private `_depositNewMASimulation` property, ensuring that trade simulation operations
|
|
102
|
-
* use a consistent client configuration and state.
|
|
103
|
-
*
|
|
104
|
-
* @returns {DepositNewMASimulationClient} An instance of DepositNewMASimulationClient for trade simulation operations.
|
|
105
|
-
* @memberof ApiClient
|
|
106
|
-
* @example
|
|
107
|
-
* // Access the deposit new MA simulation client from the ApiClient
|
|
108
|
-
* const depositNewMASimulationClient = ApiClient.depositNewMASimulation;
|
|
109
|
-
*/
|
|
110
|
-
static get depositNewMASimulation(): DepositNewMASimulationClient;
|
|
111
47
|
/**
|
|
112
48
|
* Provides access to the DepositPassivePoolSimulationClient instance.
|
|
113
49
|
* This getter allows for interacting with trade simulation functionalities.
|
|
@@ -122,20 +58,6 @@ export declare class ApiClient {
|
|
|
122
58
|
* const depositPassivePoolSimulationClient = ApiClient.depositPassivePoolSimulation;
|
|
123
59
|
*/
|
|
124
60
|
static get depositPassivePoolSimulation(): DepositPassivePoolSimulationClient;
|
|
125
|
-
/**
|
|
126
|
-
* Provides access to the WithdrawMASimulationClient instance.
|
|
127
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
128
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
129
|
-
* private `_withdrawMASimulation` property, ensuring that trade simulation operations
|
|
130
|
-
* use a consistent client configuration and state.
|
|
131
|
-
*
|
|
132
|
-
* @returns {WithdrawMASimulationClient} An instance of WithdrawMASimulationClient for trade simulation operations.
|
|
133
|
-
* @memberof ApiClient
|
|
134
|
-
* @example
|
|
135
|
-
* // Access the withdraw MA simulation client from the ApiClient
|
|
136
|
-
* const withdrawMASimulationClient = ApiClient.withdrawMASimulation;
|
|
137
|
-
*/
|
|
138
|
-
static get withdrawMASimulation(): WithdrawMASimulationClient;
|
|
139
61
|
/**
|
|
140
62
|
* Provides access to the WithdrawPassivePoolSimulationClient instance.
|
|
141
63
|
* This getter allows for interacting with trade simulation functionalities.
|
|
@@ -150,34 +72,6 @@ export declare class ApiClient {
|
|
|
150
72
|
* const withdrawPassivePoolSimulationClient = ApiClient.withdrawPassivePoolSimulation;
|
|
151
73
|
*/
|
|
152
74
|
static get withdrawPassivePoolSimulation(): WithdrawPassivePoolSimulationClient;
|
|
153
|
-
/**
|
|
154
|
-
* Provides access to the TransferMarginBetweenMAsSimulationClient instance.
|
|
155
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
156
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
157
|
-
* private `_transferMarginBetweenMAsSimulation` property, ensuring that trade simulation operations
|
|
158
|
-
* use a consistent client configuration and state.
|
|
159
|
-
*
|
|
160
|
-
* @returns {TransferMarginBetweenMAsSimulationClient} An instance of TransferMarginBetweenMAsSimulationClient for trade simulation operations.
|
|
161
|
-
* @memberof ApiClient
|
|
162
|
-
* @example
|
|
163
|
-
* // Access the transfer margin between MAs simulation client from the ApiClient
|
|
164
|
-
* const transferMarginBetweenMAsSimulationClient = ApiClient.transferMarginBetweenMAsSimulation;
|
|
165
|
-
*/
|
|
166
|
-
static get transferMarginBetweenMAsSimulation(): TransferMarginBetweenMAsSimulationClient;
|
|
167
|
-
/**
|
|
168
|
-
* Provides access to the TransferMAPoolSimulationClient instance.
|
|
169
|
-
* This getter allows for interacting with trade simulation functionalities.
|
|
170
|
-
* It ensures a singleton pattern by fetching the instance from the ApiClient's
|
|
171
|
-
* private `_TransferMAPoolSimulation` property, ensuring that trade simulation operations
|
|
172
|
-
* use a consistent client configuration and state.
|
|
173
|
-
*
|
|
174
|
-
* @returns {TransferMAPoolSimulationClient} An instance of TransferMAPoolSimulationClient for trade simulation operations.
|
|
175
|
-
* @memberof ApiClient
|
|
176
|
-
* @example
|
|
177
|
-
* // Access the transfer from MA to Pool simulation client from the ApiClient
|
|
178
|
-
* const transferMAPoolSimulationClient = ApiClient.transferMAPoolSimulation;
|
|
179
|
-
*/
|
|
180
|
-
static get transferMAPoolSimulation(): TransferMAPoolSimulationClient;
|
|
181
75
|
/**
|
|
182
76
|
* Gets the current instance of the LpClient from the ApiClient.
|
|
183
77
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.d.ts","sourceRoot":"/","sources":["clients/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,QAAQ,MAAM,cAAc,CAAC;AACpC,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"api-client.d.ts","sourceRoot":"/","sources":["clients/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,QAAQ,MAAM,cAAc,CAAC;AACpC,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,kCAAkC,MAAM,2CAA2C,CAAC;AAC3F,OAAO,mCAAmC,MAAM,4CAA4C,CAAC;AAC7F,OAAO,iBAAiB,MAAM,wBAAwB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MarginAccountsParams, GetMarginAccountsResult,
|
|
2
|
-
import {
|
|
1
|
+
import { GetMarginAccountParams, GetMarginAccountResult, GetMarginAccountsParams, GetMarginAccountsResult, EditMarginAccountParams, CloseMarginAccountParams, EditMarginAccountResult, CloseMarginAccountResult, GetMarginAccountOrderHistoryPaginatedParams, GetMarginAccountOrderHistoryPaginatedResult, GetLiquidationHistoryForOwnerAddressResult, GetLiquidationHistoryForOwnerAddressParams } from './types';
|
|
2
|
+
import { RestClient } from '@reyaxyz/common';
|
|
3
3
|
export default class AccountClient extends RestClient {
|
|
4
4
|
/**
|
|
5
5
|
* Asynchronously retrieves a list of margin accounts associated with a specific address.
|
|
@@ -28,8 +28,6 @@ export default class AccountClient extends RestClient {
|
|
|
28
28
|
getMarginAccount(params: GetMarginAccountParams): Promise<GetMarginAccountResult>;
|
|
29
29
|
getMarginAccountOrderHistoryPaginated(params: GetMarginAccountOrderHistoryPaginatedParams): Promise<GetMarginAccountOrderHistoryPaginatedResult>;
|
|
30
30
|
getLiquidationHistoryForOwnerAddress(params: GetLiquidationHistoryForOwnerAddressParams): Promise<GetLiquidationHistoryForOwnerAddressResult>;
|
|
31
|
-
getEditCollateralSimulationInitialData(params: GetEditCollateralSimulationInitialDataParams): Promise<EditCollateralSimulationState>;
|
|
32
|
-
getMaxWithdrawBalanceForAccount(params: GetMaxWithdrawBalanceForAccountParams): Promise<GetMaxWithdrawBalanceForAccountResult>;
|
|
33
31
|
editMarginAccount(params: EditMarginAccountParams): Promise<EditMarginAccountResult>;
|
|
34
32
|
closeMarginAccount(params: CloseMarginAccountParams): Promise<CloseMarginAccountResult>;
|
|
35
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["clients/modules/account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["clients/modules/account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,2CAA2C,EAC3C,2CAA2C,EAC3C,0CAA0C,EAC1C,0CAA0C,EAC3C,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAA+B,MAAM,iBAAiB,CAAC;AAE1E,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU;IACnD;;;;;;;;;;;SAWK;IAEC,iBAAiB,CACrB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC;IAmBnC;;;;;;;;;;OAUG;IAEG,gBAAgB,CACpB,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAY5B,qCAAqC,CACzC,MAAM,EAAE,2CAA2C,GAClD,OAAO,CAAC,2CAA2C,CAAC;IASjD,oCAAoC,CACxC,MAAM,EAAE,0CAA0C,GACjD,OAAO,CAAC,0CAA0C,CAAC;IAQhD,iBAAiB,CACrB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC;IAe7B,kBAAkB,CACtB,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,wBAAwB,CAAC;CAUrC"}
|