mirror of
https://github.com/status-im/safe-react.git
synced 2025-01-10 18:15:37 +00:00
Revert "Add fix to swap symbol and name for sidechains"
This reverts commit 45d8157f9047ce5845caf130603810e0b719a907.
This commit is contained in:
parent
36ba59799f
commit
ad472f3d5f
@ -1,11 +1,9 @@
|
||||
import axios from 'axios'
|
||||
|
||||
import { getSafeClientGatewayBaseUrl, getNetworkInfo } from 'src/config'
|
||||
import { getSafeClientGatewayBaseUrl } from 'src/config'
|
||||
import { TokenProps } from 'src/logic/tokens/store/model/token'
|
||||
import { checksumAddress } from 'src/utils/checksumAddress'
|
||||
|
||||
import { ZERO_ADDRESS, sameAddress } from 'src/logic/wallets/ethAddresses'
|
||||
|
||||
export type TokenBalance = {
|
||||
tokenInfo: TokenProps
|
||||
balance: string
|
||||
@ -35,24 +33,5 @@ export const fetchTokenCurrenciesBalances = async ({
|
||||
checksumAddress(safeAddress),
|
||||
)}/balances/${selectedCurrency}/?trusted=${trustedTokens}&exclude_spam=${excludeSpamTokens}`
|
||||
|
||||
return axios.get(url).then(({ data }) => {
|
||||
// Currently the client-gateway is not returning the balance using network token symbol and name
|
||||
// FIXME remove this logic and return data directly once this is fixed
|
||||
const { nativeCoin } = getNetworkInfo()
|
||||
|
||||
if (data.items && data.items.length) {
|
||||
data.items = data.items.map((element) => {
|
||||
const { tokenInfo } = element
|
||||
if (sameAddress(ZERO_ADDRESS, tokenInfo.address)) {
|
||||
// If it's native coin we swap symbol and name
|
||||
tokenInfo.symbol = nativeCoin.symbol
|
||||
tokenInfo.name = nativeCoin.name
|
||||
}
|
||||
|
||||
return element
|
||||
})
|
||||
}
|
||||
|
||||
return data
|
||||
})
|
||||
return axios.get(url).then(({ data }) => data)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user