1
0
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:
Dan J Miller 2020-10-13 17:38:24 -02:30 committed by GitHub
parent c11b7cc5ea
commit dfb722b6ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,9 +132,8 @@ export default function BuildQuote ({
.then((fetchedBalance) => {
if (fetchedBalance?.balance) {
const balanceAsDecString = fetchedBalance.balance.toString(10)
const balanceAsHexString = fetchedBalance.balance.toString(16)
const userTokenBalance = calcTokenAmount(balanceAsDecString, token.decimals)
dispatch(setSwapsFromToken({ ...token, string: userTokenBalance.toString(10), balance: balanceAsHexString }))
dispatch(setSwapsFromToken({ ...token, string: userTokenBalance.toString(10), balance: balanceAsDecString }))
}
})
}