Skip to content

Commit

Permalink
[SDK] Fix: pass gasPrice to injected provider (#4935)
Browse files Browse the repository at this point in the history
<!-- start pr-codex -->

## PR-Codex overview
This PR introduces the handling of `gasPrice` in the transaction object within the `injected` wallet module.

### Detailed summary
- Added a new line to handle `gasPrice` in the transaction object.
- The `gasPrice` is conditionally converted to hexadecimal format using `numberToHex` if it exists.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
  • Loading branch information
gregfromstl committed Oct 7, 2024
1 parent 8e80113 commit c6fbd60
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/thirdweb/src/wallets/injected/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ function createAccount(provider: Ethereum, _address: string) {
accessList: tx.accessList,
value: tx.value ? numberToHex(tx.value) : undefined,
gas: tx.gas ? numberToHex(tx.gas) : undefined,
gasPrice: tx.gasPrice ? numberToHex(tx.gasPrice) : undefined,

Check warning on line 123 in packages/thirdweb/src/wallets/injected/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/wallets/injected/index.ts#L123

Added line #L123 was not covered by tests
from: this.address,
to: tx.to as Address,
data: tx.data,
Expand Down

0 comments on commit c6fbd60

Please sign in to comment.