@reyaxyz/api-sdk 0.61.1 → 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.
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/tokens/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReyaChainId, TokenEntity } from '@reyaxyz/common';\n\nexport type GetAllowedTokensParams = {\n chainId: ReyaChainId;\n};\n\nexport type GetAllowedTokenResult = {\n tokens: (TokenEntity & {\n minDepositAmount: number;\n minWithdrawAmount: number;\n stepSize: number;\n })[]; // Extend TokenEntity with minDepositAmount, minWithdrawAmount, stepSize\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/tokens/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReyaChainId, TokenEntityWithMinValue } from '@reyaxyz/common';\n\nexport type GetAllowedTokensParams = {\n chainId: ReyaChainId;\n};\n\nexport type GetAllowedTokenResult = {\n tokens: TokenEntityWithMinValue[]; // Extend TokenEntity with minDepositAmount, minWithdrawAmount, stepSize\n};\n"]}
@@ -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, common_2.getTokenDetails)(params.tokenAddress).tokenName;
73
+ var feesUnderlyingToken = (0, common_1.getTokenInfoByAddress)(params.tokenAddress).name;
75
74
  return {
76
75
  fees: fees.fees,
77
76
  feesUnderlyingToken: fees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B,CAAC,iBAAiB;SACtC,CAAC;IAChC,CAAC;IACH,iCAAC;AAAD,CAAC,AA/CD,IA+CC","sourcesContent":["import { getSocketBridgeTime, getSocketWithdrawFees } from '@reyaxyz/common';\nimport EditCollateralClient from '../edit-collateral.simulation';\nimport {\n SimulateWithdrawMAEntity,\n WithdrawMASimulationLoadDataParams,\n WithdrawMASimulationSimulateParams,\n} from './types';\nimport { ReyaChainId, getTokenDetails } from '@reyaxyz/common';\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 = getTokenDetails(params.tokenAddress).tokenName;\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
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/withdraw-MA.simulation/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;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Id,\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,12 +1,8 @@
1
- import { ReyaChainId, TokenEntity } from '@reyaxyz/common';
1
+ import { ReyaChainId, TokenEntityWithMinValue } from '@reyaxyz/common';
2
2
  export type GetAllowedTokensParams = {
3
3
  chainId: ReyaChainId;
4
4
  };
5
5
  export type GetAllowedTokenResult = {
6
- tokens: (TokenEntity & {
7
- minDepositAmount: number;
8
- minWithdrawAmount: number;
9
- stepSize: number;
10
- })[];
6
+ tokens: TokenEntityWithMinValue[];
11
7
  };
12
8
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/tokens/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,CAAC,WAAW,GAAG;QACrB,gBAAgB,EAAE,MAAM,CAAC;QACzB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,EAAE,CAAC;CACN,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/tokens/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAEvE,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,uBAAuB,EAAE,CAAC;CACnC,CAAC"}
@@ -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":"AACA,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,wBAAwB,EACxB,kCAAkC,EAClC,kCAAkC,EACnC,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,WAAW,EAAmB,MAAM,iBAAiB,CAAC;AAE/D,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"}
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.61.1",
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.46.1",
36
+ "@reyaxyz/common": "0.48.0",
37
37
  "bignumber.js": "^9.1.2"
38
38
  },
39
39
  "packageManager": "pnpm@8.10.4",
40
- "gitHead": "83f7cb08208032055d2050b3cc4da26b07510c36"
40
+ "gitHead": "3710b22ddcc4be855f8f9523c970bcd2bdfa1892"
41
41
  }
@@ -1,13 +1,9 @@
1
- import { ReyaChainId, TokenEntity } from '@reyaxyz/common';
1
+ import { ReyaChainId, TokenEntityWithMinValue } from '@reyaxyz/common';
2
2
 
3
3
  export type GetAllowedTokensParams = {
4
4
  chainId: ReyaChainId;
5
5
  };
6
6
 
7
7
  export type GetAllowedTokenResult = {
8
- tokens: (TokenEntity & {
9
- minDepositAmount: number;
10
- minWithdrawAmount: number;
11
- stepSize: number;
12
- })[]; // Extend TokenEntity with minDepositAmount, minWithdrawAmount, stepSize
8
+ tokens: TokenEntityWithMinValue[]; // Extend TokenEntity with minDepositAmount, minWithdrawAmount, stepSize
13
9
  };
@@ -1,11 +1,15 @@
1
- import { getSocketBridgeTime, getSocketWithdrawFees } from '@reyaxyz/common';
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 = getTokenDetails(params.tokenAddress).tokenName;
51
+ const feesUnderlyingToken = getTokenInfoByAddress(params.tokenAddress).name;
48
52
 
49
53
  return {
50
54
  fees: fees.fees,