@myx-trade/sdk 0.1.211 → 0.1.212

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
@@ -1807,7 +1807,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
1807
1807
  // package.json
1808
1808
  var package_default = {
1809
1809
  name: "@myx-trade/sdk",
1810
- version: "0.1.211",
1810
+ version: "0.1.212",
1811
1811
  private: false,
1812
1812
  publishConfig: {
1813
1813
  access: "public"
@@ -21324,7 +21324,6 @@ var Account = class {
21324
21324
  }
21325
21325
  async getAccountVipInfo(chainId, address) {
21326
21326
  const config = this.configManager.getConfig();
21327
- const contractAddress = getContractAddressByChainId(chainId);
21328
21327
  const provider = await getJSONProvider(chainId);
21329
21328
  const brokerContract = new import_ethers26.ethers.Contract(
21330
21329
  config.brokerAddress,
@@ -21333,9 +21332,14 @@ var Account = class {
21333
21332
  );
21334
21333
  const latestBlock = await provider.getBlock("latest");
21335
21334
  const deadline = (latestBlock?.timestamp ?? (0, import_dayjs3.default)().unix()) + 60 * 5;
21335
+ this.logger.info("deadline-->", deadline);
21336
21336
  try {
21337
+ this.logger.info("brokerContract-->", config.brokerAddress);
21338
+ this.logger.info("address-->", address);
21337
21339
  const accountVipInfo = await brokerContract.userFeeData(address);
21340
+ this.logger.info("accountVipInfo-->", accountVipInfo);
21338
21341
  const nonce = await brokerContract.userNonces(address);
21342
+ this.logger.info("nonce-->", nonce);
21339
21343
  return {
21340
21344
  code: 0,
21341
21345
  data: { ...accountVipInfo, nonce: nonce.toString(), deadline }
@@ -21382,7 +21386,7 @@ var Account = class {
21382
21386
  config.signer
21383
21387
  );
21384
21388
  const nonce = await brokerContract.userNonces(address);
21385
- if (nonce.toString() !== params.nonce.toString()) {
21389
+ if (parseInt(nonce.toString()) + 1 !== parseInt(params.nonce.toString())) {
21386
21390
  throw new MyxSDKError(
21387
21391
  "REQUEST_FAILED" /* RequestFailed */,
21388
21392
  "Invalid nonce, please try again"
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.211",
1734
+ version: "0.1.212",
1735
1735
  private: false,
1736
1736
  publishConfig: {
1737
1737
  access: "public"
@@ -21248,7 +21248,6 @@ var Account = class {
21248
21248
  }
21249
21249
  async getAccountVipInfo(chainId, address) {
21250
21250
  const config = this.configManager.getConfig();
21251
- const contractAddress = getContractAddressByChainId(chainId);
21252
21251
  const provider = await getJSONProvider(chainId);
21253
21252
  const brokerContract = new ethers8.Contract(
21254
21253
  config.brokerAddress,
@@ -21257,9 +21256,14 @@ var Account = class {
21257
21256
  );
21258
21257
  const latestBlock = await provider.getBlock("latest");
21259
21258
  const deadline = (latestBlock?.timestamp ?? dayjs3().unix()) + 60 * 5;
21259
+ this.logger.info("deadline-->", deadline);
21260
21260
  try {
21261
+ this.logger.info("brokerContract-->", config.brokerAddress);
21262
+ this.logger.info("address-->", address);
21261
21263
  const accountVipInfo = await brokerContract.userFeeData(address);
21264
+ this.logger.info("accountVipInfo-->", accountVipInfo);
21262
21265
  const nonce = await brokerContract.userNonces(address);
21266
+ this.logger.info("nonce-->", nonce);
21263
21267
  return {
21264
21268
  code: 0,
21265
21269
  data: { ...accountVipInfo, nonce: nonce.toString(), deadline }
@@ -21306,7 +21310,7 @@ var Account = class {
21306
21310
  config.signer
21307
21311
  );
21308
21312
  const nonce = await brokerContract.userNonces(address);
21309
- if (nonce.toString() !== params.nonce.toString()) {
21313
+ if (parseInt(nonce.toString()) + 1 !== parseInt(params.nonce.toString())) {
21310
21314
  throw new MyxSDKError(
21311
21315
  "REQUEST_FAILED" /* RequestFailed */,
21312
21316
  "Invalid nonce, please try again"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myx-trade/sdk",
3
- "version": "0.1.211",
3
+ "version": "0.1.212",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"