Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/short-feet-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Handle hex value format for smart wallet execution
1 change: 1 addition & 0 deletions packages/thirdweb/src/react/web/ui/prebuilt/NFT/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export async function getNFTInfo(options: NFTProviderProps): Promise<NFT> {
}),
getNFT1155({
...options,
useIndexer: false, // TODO (insight): switch this call to only call insight once
}),
]).then(([possibleNFT721, possibleNFT1155]) => {
// getNFT extension always return an NFT object
Expand Down
4 changes: 2 additions & 2 deletions packages/thirdweb/src/wallets/smart/lib/calls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
let value = transaction.value || 0n;
// special handling of hedera chains, decimals for native value is 8 instead of 18 when passed as contract params
if (transaction.chainId === 295 || transaction.chainId === 296) {
value = value / BigInt(10 ** 10);
value = BigInt(value) / BigInt(10 ** 10);

Check warning on line 187 in packages/thirdweb/src/wallets/smart/lib/calls.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/wallets/smart/lib/calls.ts#L187

Added line #L187 was not covered by tests
}
return prepareContractCall({
contract: accountContract,
Expand Down Expand Up @@ -220,7 +220,7 @@
const chainId = transactions[0]?.chainId;
// special handling of hedera chains, decimals for native value is 8 instead of 18 when passed as contract params
if (chainId === 295 || chainId === 296) {
values = values.map((value) => value / BigInt(10 ** 10));
values = values.map((value) => BigInt(value) / BigInt(10 ** 10));

Check warning on line 223 in packages/thirdweb/src/wallets/smart/lib/calls.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/wallets/smart/lib/calls.ts#L223

Added line #L223 was not covered by tests
}
return prepareContractCall({
contract: accountContract,
Expand Down
Loading