Skip to content

Commit 5f6403b

Browse files
[SDK] Fix hex value handling for smart wallet execution (#6974)
1 parent 4c5fc83 commit 5f6403b

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.changeset/short-feet-check.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Handle hex value format for smart wallet execution

packages/thirdweb/src/react/web/ui/prebuilt/NFT/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export async function getNFTInfo(options: NFTProviderProps): Promise<NFT> {
1717
}),
1818
getNFT1155({
1919
...options,
20+
useIndexer: false, // TODO (insight): switch this call to only call insight once
2021
}),
2122
]).then(([possibleNFT721, possibleNFT1155]) => {
2223
// getNFT extension always return an NFT object

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export function prepareExecute(args: {
184184
let value = transaction.value || 0n;
185185
// special handling of hedera chains, decimals for native value is 8 instead of 18 when passed as contract params
186186
if (transaction.chainId === 295 || transaction.chainId === 296) {
187-
value = value / BigInt(10 ** 10);
187+
value = BigInt(value) / BigInt(10 ** 10);
188188
}
189189
return prepareContractCall({
190190
contract: accountContract,
@@ -220,7 +220,7 @@ export function prepareBatchExecute(args: {
220220
const chainId = transactions[0]?.chainId;
221221
// special handling of hedera chains, decimals for native value is 8 instead of 18 when passed as contract params
222222
if (chainId === 295 || chainId === 296) {
223-
values = values.map((value) => value / BigInt(10 ** 10));
223+
values = values.map((value) => BigInt(value) / BigInt(10 ** 10));
224224
}
225225
return prepareContractCall({
226226
contract: accountContract,

0 commit comments

Comments
 (0)