@enclave-hq/wallet-sdk 1.0.1 → 1.0.2

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.
@@ -549,7 +549,7 @@ var MetaMaskAdapter = class extends BrowserWalletAdapter {
549
549
  value: transaction.value ? `0x${BigInt(transaction.value).toString(16)}` : void 0,
550
550
  data: transaction.data || "0x",
551
551
  gas: transaction.gas ? `0x${BigInt(transaction.gas).toString(16)}` : void 0,
552
- gasPrice: transaction.gasPrice ? `0x${BigInt(transaction.gasPrice).toString(16)}` : void 0,
552
+ gasPrice: transaction.gasPrice && transaction.gasPrice !== "auto" ? `0x${BigInt(transaction.gasPrice).toString(16)}` : void 0,
553
553
  maxFeePerGas: transaction.maxFeePerGas ? `0x${BigInt(transaction.maxFeePerGas).toString(16)}` : void 0,
554
554
  maxPriorityFeePerGas: transaction.maxPriorityFeePerGas ? `0x${BigInt(transaction.maxPriorityFeePerGas).toString(16)}` : void 0,
555
555
  nonce: transaction.nonce !== void 0 ? `0x${transaction.nonce.toString(16)}` : void 0,
@@ -647,6 +647,16 @@ var MetaMaskAdapter = class extends BrowserWalletAdapter {
647
647
  throw new Error("Wallet client not initialized");
648
648
  }
649
649
  try {
650
+ console.log("\u{1F50D} [MetaMask writeContract] params.gasPrice:", params.gasPrice, "type:", typeof params.gasPrice);
651
+ let processedGasPrice;
652
+ if (!params.gasPrice) {
653
+ processedGasPrice = void 0;
654
+ } else if (params.gasPrice === "auto") {
655
+ processedGasPrice = void 0;
656
+ } else {
657
+ processedGasPrice = BigInt(params.gasPrice);
658
+ }
659
+ console.log("\u{1F50D} [MetaMask writeContract] processedGasPrice:", processedGasPrice);
650
660
  const txHash = await this.walletClient.writeContract({
651
661
  address: params.address,
652
662
  abi: params.abi,
@@ -654,7 +664,7 @@ var MetaMaskAdapter = class extends BrowserWalletAdapter {
654
664
  ...params.args ? { args: params.args } : {},
655
665
  value: params.value ? BigInt(params.value) : void 0,
656
666
  gas: params.gas ? BigInt(params.gas) : void 0,
657
- gasPrice: params.gasPrice ? BigInt(params.gasPrice) : void 0
667
+ gasPrice: processedGasPrice
658
668
  });
659
669
  return txHash;
660
670
  } catch (error) {