mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Hex prefix newly fetched token balances in build-quote (#9586)
* Hex prefix newly fetched token balances in build-quote * Set balance to dec WEI string instead of hex when adding token via swap from select
This commit is contained in:
parent
c11b7cc5ea
commit
dfb722b6ed
@ -132,9 +132,8 @@ export default function BuildQuote ({
|
|||||||
.then((fetchedBalance) => {
|
.then((fetchedBalance) => {
|
||||||
if (fetchedBalance?.balance) {
|
if (fetchedBalance?.balance) {
|
||||||
const balanceAsDecString = fetchedBalance.balance.toString(10)
|
const balanceAsDecString = fetchedBalance.balance.toString(10)
|
||||||
const balanceAsHexString = fetchedBalance.balance.toString(16)
|
|
||||||
const userTokenBalance = calcTokenAmount(balanceAsDecString, token.decimals)
|
const userTokenBalance = calcTokenAmount(balanceAsDecString, token.decimals)
|
||||||
dispatch(setSwapsFromToken({ ...token, string: userTokenBalance.toString(10), balance: balanceAsHexString }))
|
dispatch(setSwapsFromToken({ ...token, string: userTokenBalance.toString(10), balance: balanceAsDecString }))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user