@myx-trade/sdk 0.1.164 → 0.1.165

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/index.js CHANGED
@@ -1821,7 +1821,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
1821
1821
  // package.json
1822
1822
  var package_default = {
1823
1823
  name: "@myx-trade/sdk",
1824
- version: "0.1.164",
1824
+ version: "0.1.165",
1825
1825
  private: false,
1826
1826
  publishConfig: {
1827
1827
  access: "public"
@@ -21110,8 +21110,8 @@ var Account = class {
21110
21110
  const orders = orderRes.data;
21111
21111
  const openOrders = orders?.filter((order) => order.poolId === poolId);
21112
21112
  const used = openOrders?.reduce((acc, order) => {
21113
- const prev = BigInt(acc);
21114
- const curr = BigInt(order.collateralAmount ?? 0) + prev;
21113
+ const prev = BigInt(import_ethers26.ethers.parseUnits(acc, pool?.quoteDecimals ?? 6));
21114
+ const curr = BigInt(import_ethers26.ethers.parseUnits(order.collateralAmount ?? "0", pool?.quoteDecimals ?? 6)) + prev;
21115
21115
  return curr.toString();
21116
21116
  }, "0");
21117
21117
  const marginAccountBalanceRes = await this.getAccountInfo(chainId, address, poolId);
@@ -21122,7 +21122,7 @@ var Account = class {
21122
21122
  );
21123
21123
  }
21124
21124
  const marginAccountBalance = marginAccountBalanceRes.data;
21125
- const usedMargin = import_ethers26.ethers.parseUnits(used ?? "0", pool?.quoteDecimals ?? 6);
21125
+ const usedMargin = BigInt(used ?? "0");
21126
21126
  const quoteProfit = BigInt(marginAccountBalance.quoteProfit ?? 0);
21127
21127
  const freeAmount = BigInt(marginAccountBalance?.freeAmount ?? 0);
21128
21128
  const accountMargin = freeAmount + quoteProfit;
package/dist/index.mjs CHANGED
@@ -1731,7 +1731,7 @@ var RotationProvider = class extends BaseProvider {
1731
1731
  // package.json
1732
1732
  var package_default = {
1733
1733
  name: "@myx-trade/sdk",
1734
- version: "0.1.164",
1734
+ version: "0.1.165",
1735
1735
  private: false,
1736
1736
  publishConfig: {
1737
1737
  access: "public"
@@ -21020,8 +21020,8 @@ var Account = class {
21020
21020
  const orders = orderRes.data;
21021
21021
  const openOrders = orders?.filter((order) => order.poolId === poolId);
21022
21022
  const used = openOrders?.reduce((acc, order) => {
21023
- const prev = BigInt(acc);
21024
- const curr = BigInt(order.collateralAmount ?? 0) + prev;
21023
+ const prev = BigInt(ethers8.parseUnits(acc, pool?.quoteDecimals ?? 6));
21024
+ const curr = BigInt(ethers8.parseUnits(order.collateralAmount ?? "0", pool?.quoteDecimals ?? 6)) + prev;
21025
21025
  return curr.toString();
21026
21026
  }, "0");
21027
21027
  const marginAccountBalanceRes = await this.getAccountInfo(chainId, address, poolId);
@@ -21032,7 +21032,7 @@ var Account = class {
21032
21032
  );
21033
21033
  }
21034
21034
  const marginAccountBalance = marginAccountBalanceRes.data;
21035
- const usedMargin = ethers8.parseUnits(used ?? "0", pool?.quoteDecimals ?? 6);
21035
+ const usedMargin = BigInt(used ?? "0");
21036
21036
  const quoteProfit = BigInt(marginAccountBalance.quoteProfit ?? 0);
21037
21037
  const freeAmount = BigInt(marginAccountBalance?.freeAmount ?? 0);
21038
21038
  const accountMargin = freeAmount + quoteProfit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myx-trade/sdk",
3
- "version": "0.1.164",
3
+ "version": "0.1.165",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"