From c55f02fa75a7f8959bbe69eac6cebfc7927ed865 Mon Sep 17 00:00:00 2001 From: ElasticBottle Date: Tue, 10 Dec 2024 01:16:26 +0000 Subject: [PATCH] fix: should always contain gas price info even if it's 0 (#5673) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://linear.app/thirdweb/issue/CNCT-2602/issue-signing-deploy-tx-on-saakura --- ## PR-Codex overview This PR focuses on ensuring that gas price information is always included for enclave wallets, even when it is 0. It modifies the condition for setting the `maxFeePerGas` to check for the type `bigint`. ### Detailed summary - Updated the condition to check if `tx.maxFeePerGas` is of type `bigint`. - Ensured that `transaction.maxFeePerGas` is set correctly when `tx.maxFeePerGas` is provided. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- .changeset/nervous-pots-smell.md | 5 +++++ .../src/wallets/in-app/core/wallet/enclave-wallet.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/nervous-pots-smell.md diff --git a/.changeset/nervous-pots-smell.md b/.changeset/nervous-pots-smell.md new file mode 100644 index 00000000000..564da2da1bc --- /dev/null +++ b/.changeset/nervous-pots-smell.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +always include gas price information even if it's 0 for enclave wallets diff --git a/packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts b/packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts index 76cc9f17314..aa6a174c312 100644 --- a/packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts +++ b/packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts @@ -162,7 +162,7 @@ export class EnclaveWallet implements IWebWallet { chainId: toHex(tx.chainId), }; - if (tx.maxFeePerGas) { + if (typeof tx.maxFeePerGas === "bigint") { transaction.maxFeePerGas = toHex(tx.maxFeePerGas); transaction.maxPriorityFeePerGas = typeof tx.maxPriorityFeePerGas === "bigint"