@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.
@@ -542,7 +542,7 @@ var MetaMaskAdapter = class extends BrowserWalletAdapter {
542
542
  value: transaction.value ? `0x${BigInt(transaction.value).toString(16)}` : void 0,
543
543
  data: transaction.data || "0x",
544
544
  gas: transaction.gas ? `0x${BigInt(transaction.gas).toString(16)}` : void 0,
545
- gasPrice: transaction.gasPrice ? `0x${BigInt(transaction.gasPrice).toString(16)}` : void 0,
545
+ gasPrice: transaction.gasPrice && transaction.gasPrice !== "auto" ? `0x${BigInt(transaction.gasPrice).toString(16)}` : void 0,
546
546
  maxFeePerGas: transaction.maxFeePerGas ? `0x${BigInt(transaction.maxFeePerGas).toString(16)}` : void 0,
547
547
  maxPriorityFeePerGas: transaction.maxPriorityFeePerGas ? `0x${BigInt(transaction.maxPriorityFeePerGas).toString(16)}` : void 0,
548
548
  nonce: transaction.nonce !== void 0 ? `0x${transaction.nonce.toString(16)}` : void 0,
@@ -640,6 +640,16 @@ var MetaMaskAdapter = class extends BrowserWalletAdapter {
640
640
  throw new Error("Wallet client not initialized");
641
641
  }
642
642
  try {
643
+ console.log("\u{1F50D} [MetaMask writeContract] params.gasPrice:", params.gasPrice, "type:", typeof params.gasPrice);
644
+ let processedGasPrice;
645
+ if (!params.gasPrice) {
646
+ processedGasPrice = void 0;
647
+ } else if (params.gasPrice === "auto") {
648
+ processedGasPrice = void 0;
649
+ } else {
650
+ processedGasPrice = BigInt(params.gasPrice);
651
+ }
652
+ console.log("\u{1F50D} [MetaMask writeContract] processedGasPrice:", processedGasPrice);
643
653
  const txHash = await this.walletClient.writeContract({
644
654
  address: params.address,
645
655
  abi: params.abi,
@@ -647,7 +657,7 @@ var MetaMaskAdapter = class extends BrowserWalletAdapter {
647
657
  ...params.args ? { args: params.args } : {},
648
658
  value: params.value ? BigInt(params.value) : void 0,
649
659
  gas: params.gas ? BigInt(params.gas) : void 0,
650
- gasPrice: params.gasPrice ? BigInt(params.gasPrice) : void 0
660
+ gasPrice: processedGasPrice
651
661
  });
652
662
  return txHash;
653
663
  } catch (error) {