Skip to content

Commit 9f09930

Browse files
[SDK] Fix hex value handling for smart wallet execution
1 parent 4c5fc83 commit 9f09930

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-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/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)