@myx-trade/sdk 0.1.216 → 0.1.217

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.216",
1810
+ version: "0.1.217",
1811
1811
  private: false,
1812
1812
  publishConfig: {
1813
1813
  access: "public"
@@ -21948,7 +21948,7 @@ var Seamless = class {
21948
21948
  masterAddress,
21949
21949
  forwarderAddress,
21950
21950
  import_ethers27.ethers.MaxUint256.toString(),
21951
- (nonces + 1).toString(),
21951
+ (nonces + BigInt(1)).toString(),
21952
21952
  deadline.toString(),
21953
21953
  chainId
21954
21954
  );
@@ -21962,6 +21962,7 @@ var Seamless = class {
21962
21962
  r: brokerSignPermit.r,
21963
21963
  s: brokerSignPermit.s
21964
21964
  };
21965
+ this.logger.info("brokerSeamlessUSDPermitParams-->", brokerSeamlessUSDPermitParams);
21965
21966
  const forwarderPermitParams = {
21966
21967
  token: erc20Contract.target,
21967
21968
  owner: masterAddress,
@@ -21972,8 +21973,10 @@ var Seamless = class {
21972
21973
  r: forwarderSignPermit.r,
21973
21974
  s: forwarderSignPermit.s
21974
21975
  };
21976
+ this.logger.info("forwarderPermitParams-->", forwarderPermitParams);
21975
21977
  return [brokerSeamlessUSDPermitParams, forwarderPermitParams];
21976
21978
  } catch (error) {
21979
+ this.logger.error("error-->", error);
21977
21980
  throw new MyxSDKError("INVALID_PRIVATE_KEY" /* InvalidPrivateKey */, "Invalid private key generated");
21978
21981
  }
21979
21982
  }
@@ -22030,12 +22033,14 @@ var Seamless = class {
22030
22033
  try {
22031
22034
  permitParams = await this.getUSDPermitParams(deadline, chainId);
22032
22035
  } catch (error) {
22036
+ console.log("error-->", error);
22033
22037
  console.warn("Failed to get USD permit params, proceeding without permit:", error);
22034
22038
  permitParams = [];
22035
22039
  }
22036
22040
  }
22037
- const forwarderContract = await getForwarderContract(chainId);
22041
+ const forwarderContract = await getForwarderContract(chainId, 1 /* Signer */);
22038
22042
  const nonce = await forwarderContract.nonces(masterAddress);
22043
+ this.logger.info("permitParams-->", permitParams);
22039
22044
  const functionHash = forwarderContract.interface.encodeFunctionData("permitAndApproveForwarder", [
22040
22045
  seamlessAddress,
22041
22046
  approve2,
@@ -22133,12 +22138,11 @@ var Seamless = class {
22133
22138
  };
22134
22139
  }
22135
22140
  async importSeamlessPrivateKey({ privateKey, password, chainId }) {
22136
- const config = this.configManager.getConfig();
22137
22141
  if (!import_ethers27.ethers.isHexString(privateKey, 32)) {
22138
22142
  throw new MyxSDKError("INVALID_PRIVATE_KEY" /* InvalidPrivateKey */, "Invalid private key");
22139
22143
  }
22140
22144
  const wallet = new import_ethers27.ethers.Wallet(privateKey);
22141
- const forwarderContract = await getForwarderContract(config.chainId);
22145
+ const forwarderContract = await getForwarderContract(chainId);
22142
22146
  const masterAddress = await forwarderContract.originAccount(wallet.address);
22143
22147
  if (masterAddress === import_ethers27.ZeroAddress) {
22144
22148
  throw new MyxSDKError("INVALID_PRIVATE_KEY" /* InvalidPrivateKey */, "The private key is not a senseless account");
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.216",
1734
+ version: "0.1.217",
1735
1735
  private: false,
1736
1736
  publishConfig: {
1737
1737
  access: "public"
@@ -21872,7 +21872,7 @@ var Seamless = class {
21872
21872
  masterAddress,
21873
21873
  forwarderAddress,
21874
21874
  ethers9.MaxUint256.toString(),
21875
- (nonces + 1).toString(),
21875
+ (nonces + BigInt(1)).toString(),
21876
21876
  deadline.toString(),
21877
21877
  chainId
21878
21878
  );
@@ -21886,6 +21886,7 @@ var Seamless = class {
21886
21886
  r: brokerSignPermit.r,
21887
21887
  s: brokerSignPermit.s
21888
21888
  };
21889
+ this.logger.info("brokerSeamlessUSDPermitParams-->", brokerSeamlessUSDPermitParams);
21889
21890
  const forwarderPermitParams = {
21890
21891
  token: erc20Contract.target,
21891
21892
  owner: masterAddress,
@@ -21896,8 +21897,10 @@ var Seamless = class {
21896
21897
  r: forwarderSignPermit.r,
21897
21898
  s: forwarderSignPermit.s
21898
21899
  };
21900
+ this.logger.info("forwarderPermitParams-->", forwarderPermitParams);
21899
21901
  return [brokerSeamlessUSDPermitParams, forwarderPermitParams];
21900
21902
  } catch (error) {
21903
+ this.logger.error("error-->", error);
21901
21904
  throw new MyxSDKError("INVALID_PRIVATE_KEY" /* InvalidPrivateKey */, "Invalid private key generated");
21902
21905
  }
21903
21906
  }
@@ -21954,12 +21957,14 @@ var Seamless = class {
21954
21957
  try {
21955
21958
  permitParams = await this.getUSDPermitParams(deadline, chainId);
21956
21959
  } catch (error) {
21960
+ console.log("error-->", error);
21957
21961
  console.warn("Failed to get USD permit params, proceeding without permit:", error);
21958
21962
  permitParams = [];
21959
21963
  }
21960
21964
  }
21961
- const forwarderContract = await getForwarderContract(chainId);
21965
+ const forwarderContract = await getForwarderContract(chainId, 1 /* Signer */);
21962
21966
  const nonce = await forwarderContract.nonces(masterAddress);
21967
+ this.logger.info("permitParams-->", permitParams);
21963
21968
  const functionHash = forwarderContract.interface.encodeFunctionData("permitAndApproveForwarder", [
21964
21969
  seamlessAddress,
21965
21970
  approve2,
@@ -22057,12 +22062,11 @@ var Seamless = class {
22057
22062
  };
22058
22063
  }
22059
22064
  async importSeamlessPrivateKey({ privateKey, password, chainId }) {
22060
- const config = this.configManager.getConfig();
22061
22065
  if (!ethers9.isHexString(privateKey, 32)) {
22062
22066
  throw new MyxSDKError("INVALID_PRIVATE_KEY" /* InvalidPrivateKey */, "Invalid private key");
22063
22067
  }
22064
22068
  const wallet = new ethers9.Wallet(privateKey);
22065
- const forwarderContract = await getForwarderContract(config.chainId);
22069
+ const forwarderContract = await getForwarderContract(chainId);
22066
22070
  const masterAddress = await forwarderContract.originAccount(wallet.address);
22067
22071
  if (masterAddress === ZeroAddress2) {
22068
22072
  throw new MyxSDKError("INVALID_PRIVATE_KEY" /* InvalidPrivateKey */, "The private key is not a senseless account");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myx-trade/sdk",
3
- "version": "0.1.216",
3
+ "version": "0.1.217",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"