flipmeme-sdk 1.3.75 → 1.3.76

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
@@ -35065,8 +35065,11 @@ var EthereumConnector = class {
35065
35065
  throw new Error("Signer not initialized");
35066
35066
  }
35067
35067
  const usdWETHPrice = yield getUSDPriceInWETH();
35068
+ console.log(`Current USD price in WETH: ${usdWETHPrice}`);
35068
35069
  const amountInWei = new import_decimal2.default(usdWETHPrice).mul(params.amount).toFixed(0);
35069
- const tx = yield this.factory.buyCreditByEth(ETH_COMMON.ADMIN_FOR_CREDIT_BUY, params.amount, (_a = params.slippage) != null ? _a : 300, { value: amountInWei });
35070
+ console.log(`usdWETHPrice: ${usdWETHPrice}, amount: ${params.amount}, amountInWei: ${amountInWei}`);
35071
+ const usdAmountInWei = new import_decimal2.default(params.amount).mul(new import_decimal2.default(10).pow(6)).toFixed(0);
35072
+ const tx = yield this.factory.buyCreditByEth(ETH_COMMON.ADMIN_FOR_CREDIT_BUY, usdAmountInWei, (_a = params.slippage) != null ? _a : 300, { value: amountInWei });
35070
35073
  const receipt = yield tx.wait();
35071
35074
  return receipt.transactionHash;
35072
35075
  });