Skip to content

Commit

Permalink
batch transfer native token
Browse files Browse the repository at this point in the history
  • Loading branch information
brtkx committed Sep 10, 2024
1 parent f465c71 commit f3f646a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ export function SourceNetworkBox({
decimals={nativeCurrency.decimals}
/>
<p className="mt-1 text-xs font-light text-white">
You can transfer ETH in the same transaction if you wish to.
You can transfer {nativeCurrency.symbol} in the same transaction
if you wish to.
</p>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,9 @@ export function useMaxAmount() {
if (!isDepositMode) {
return undefined
}
if (nativeCurrency.isCustom) {
return undefined
}

return nativeCurrencyMaxAmount
}, [isDepositMode, nativeCurrency.isCustom, nativeCurrencyMaxAmount])
}, [isDepositMode, nativeCurrencyMaxAmount])

return {
maxAmount,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import { useAppState } from '../../state'
import { isExperimentalFeatureEnabled } from '../../util'
import { isTokenNativeUSDC } from '../../util/TokenUtils'
import { useNativeCurrency } from '../useNativeCurrency'
import { useNetworks } from '../useNetworks'
import { useNetworksRelationship } from '../useNetworksRelationship'

export const useIsBatchTransferSupported = () => {
const [networks] = useNetworks()
const { isDepositMode, isTeleportMode, childChainProvider } =
useNetworksRelationship(networks)
const { isDepositMode, isTeleportMode } = useNetworksRelationship(networks)
const {
app: { selectedToken }
} = useAppState()
const nativeCurrency = useNativeCurrency({ provider: childChainProvider })

if (!isExperimentalFeatureEnabled('batch')) {
return false
Expand All @@ -30,10 +27,6 @@ export const useIsBatchTransferSupported = () => {
if (isTeleportMode) {
return false
}
// TODO: disable custom native currency for now, check if this works
if (nativeCurrency.isCustom) {
return false
}

return true
}

0 comments on commit f3f646a

Please sign in to comment.