@reyaxyz/api-sdk 0.62.0 → 0.63.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/modules/withdraw-MA.simulation/index.js +1 -2
- package/dist/clients/modules/withdraw-MA.simulation/index.js.map +1 -1
- package/dist/types/clients/modules/withdraw-MA.simulation/index.d.ts +1 -1
- package/dist/types/clients/modules/withdraw-MA.simulation/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/clients/modules/withdraw-MA.simulation/index.ts +7 -3
|
@@ -37,7 +37,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
var common_1 = require("@reyaxyz/common");
|
|
40
|
-
var common_2 = require("@reyaxyz/common");
|
|
41
40
|
var WithdrawMASimulationClient = /** @class */ (function () {
|
|
42
41
|
function WithdrawMASimulationClient(editCollateralClient, reyaChainId) {
|
|
43
42
|
this.editCollateralClient = editCollateralClient;
|
|
@@ -71,7 +70,7 @@ var WithdrawMASimulationClient = /** @class */ (function () {
|
|
|
71
70
|
reyaChainId: this.reyaChainId,
|
|
72
71
|
tokenAddress: params.tokenAddress,
|
|
73
72
|
});
|
|
74
|
-
var feesUnderlyingToken = (0,
|
|
73
|
+
var feesUnderlyingToken = (0, common_1.getTokenInfoByAddress)(params.tokenAddress).name;
|
|
75
74
|
return {
|
|
76
75
|
fees: fees.fees,
|
|
77
76
|
feesUnderlyingToken: feesUnderlyingToken,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/withdraw-MA.simulation/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/withdraw-MA.simulation/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;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ress,\n ReyaChainId,\n} from '@reyaxyz/common';\nimport EditCollateralClient from '../edit-collateral.simulation';\nimport {\n SimulateWithdrawMAEntity,\n WithdrawMASimulationLoadDataParams,\n WithdrawMASimulationSimulateParams,\n} from './types';\n\nexport default class WithdrawMASimulationClient {\n private editCollateralClient: EditCollateralClient;\n private reyaChainId: ReyaChainId;\n\n constructor(\n editCollateralClient: EditCollateralClient,\n reyaChainId: ReyaChainId,\n ) {\n this.editCollateralClient = editCollateralClient;\n this.reyaChainId = reyaChainId;\n }\n\n // Method to asynchronously load data based on accountId\n async arm(params: WithdrawMASimulationLoadDataParams): Promise<void> {\n await this.editCollateralClient.arm({\n marginAccountId: params.marginAccountId,\n });\n }\n\n // Synchronous method to simulate operations based on an amount\n simulate(\n params: WithdrawMASimulationSimulateParams,\n ): SimulateWithdrawMAEntity {\n const simulateEditCollateralEntity = this.editCollateralClient.simulate({\n signedAmount: -params.amount,\n tokenAddress: params.tokenAddress,\n });\n\n const bridgeTimeInMS = getSocketBridgeTime({\n moneyInOutChainId: params.moneyInOutChainId,\n }).bridgeTimeInMS;\n\n const fees = getSocketWithdrawFees({\n reyaChainId: this.reyaChainId,\n tokenAddress: params.tokenAddress,\n });\n\n const feesUnderlyingToken = getTokenInfoByAddress(params.tokenAddress).name;\n\n return {\n fees: fees.fees,\n feesUnderlyingToken: feesUnderlyingToken,\n bridgeTimeInMS: bridgeTimeInMS,\n marginRatio: simulateEditCollateralEntity.marginRatio,\n marginRatioHealth: simulateEditCollateralEntity.marginRatioHealth,\n } as SimulateWithdrawMAEntity;\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ReyaChainId } from '@reyaxyz/common';
|
|
1
2
|
import EditCollateralClient from '../edit-collateral.simulation';
|
|
2
3
|
import { SimulateWithdrawMAEntity, WithdrawMASimulationLoadDataParams, WithdrawMASimulationSimulateParams } from './types';
|
|
3
|
-
import { ReyaChainId } from '@reyaxyz/common';
|
|
4
4
|
export default class WithdrawMASimulationClient {
|
|
5
5
|
private editCollateralClient;
|
|
6
6
|
private reyaChainId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["clients/modules/withdraw-MA.simulation/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["clients/modules/withdraw-MA.simulation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,WAAW,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,wBAAwB,EACxB,kCAAkC,EAClC,kCAAkC,EACnC,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,OAAO,0BAA0B;IAC7C,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,WAAW,CAAc;gBAG/B,oBAAoB,EAAE,oBAAoB,EAC1C,WAAW,EAAE,WAAW;IAOpB,GAAG,CAAC,MAAM,EAAE,kCAAkC,GAAG,OAAO,CAAC,IAAI,CAAC;IAOpE,QAAQ,CACN,MAAM,EAAE,kCAAkC,GACzC,wBAAwB;CAyB5B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/api-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.63.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"generate:coverage-badges": "npx istanbul-badges-readme --silent"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@reyaxyz/common": "0.
|
|
36
|
+
"@reyaxyz/common": "0.48.0",
|
|
37
37
|
"bignumber.js": "^9.1.2"
|
|
38
38
|
},
|
|
39
39
|
"packageManager": "pnpm@8.10.4",
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "3710b22ddcc4be855f8f9523c970bcd2bdfa1892"
|
|
41
41
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
getSocketBridgeTime,
|
|
3
|
+
getSocketWithdrawFees,
|
|
4
|
+
getTokenInfoByAddress,
|
|
5
|
+
ReyaChainId,
|
|
6
|
+
} from '@reyaxyz/common';
|
|
2
7
|
import EditCollateralClient from '../edit-collateral.simulation';
|
|
3
8
|
import {
|
|
4
9
|
SimulateWithdrawMAEntity,
|
|
5
10
|
WithdrawMASimulationLoadDataParams,
|
|
6
11
|
WithdrawMASimulationSimulateParams,
|
|
7
12
|
} from './types';
|
|
8
|
-
import { ReyaChainId, getTokenDetails } from '@reyaxyz/common';
|
|
9
13
|
|
|
10
14
|
export default class WithdrawMASimulationClient {
|
|
11
15
|
private editCollateralClient: EditCollateralClient;
|
|
@@ -44,7 +48,7 @@ export default class WithdrawMASimulationClient {
|
|
|
44
48
|
tokenAddress: params.tokenAddress,
|
|
45
49
|
});
|
|
46
50
|
|
|
47
|
-
const feesUnderlyingToken =
|
|
51
|
+
const feesUnderlyingToken = getTokenInfoByAddress(params.tokenAddress).name;
|
|
48
52
|
|
|
49
53
|
return {
|
|
50
54
|
fees: fees.fees,
|