Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ export const TransferERC20 = memo<TransferERC20Props>(({ token }) => {
setSelectedToken(token)
}, [token])

// workaround: transferERC20 should support non-evm network
const isNativeToken = isSameAddress(selectedToken?.address, NATIVE_TOKEN_ADDRESS)
const tokenType = isNativeToken ? EthereumTokenType.Native : EthereumTokenType.ERC20

// balance
const { value: tokenBalance = '0', retry: tokenBalanceRetry } = useFungibleTokenBalance(
// workaround: transferERC20 should support non-evm network
isSameAddress(selectedToken?.address, NATIVE_TOKEN_ADDRESS)
? EthereumTokenType.Native
: EthereumTokenType.ERC20,
tokenType,
selectedToken?.address ?? '',
)
const nativeToken = useNativeTokenDetailed()
const nativeTokenPrice = useNativeTokenPrice()
const isNativeToken = selectedToken.type === EthereumTokenType.Native

//#region resolve ENS domain
const {
Expand Down Expand Up @@ -120,7 +120,7 @@ export const TransferERC20 = memo<TransferERC20Props>(({ token }) => {
}, [tokenBalance, gasPrice, selectedToken?.type, amount])

const [transferState, transferCallback, resetTransferCallback] = useTokenTransferCallback(
EthereumTokenType.ERC20,
tokenType,
selectedToken.address,
)

Expand Down