fix: send nft in other network than mainnet

This commit is contained in:
Anthony Laibe 2023-09-12 15:54:32 +02:00
parent 01babe3632
commit 1b07ecaaf7
1 changed files with 4 additions and 2 deletions

View File

@ -117,7 +117,7 @@ func (s SendType) canUseBridge(b bridge.Bridge) bool {
} }
func (s SendType) isAvailableFor(network *params.Network) bool { func (s SendType) isAvailableFor(network *params.Network) bool {
if s == Transfer || s == Bridge { if s == Transfer || s == Bridge || s == ERC721Transfer {
return true return true
} }
@ -544,6 +544,7 @@ func (r *Router) suggestedRoutes(
if network.IsTest != areTestNetworksEnabled { if network.IsTest != areTestNetworksEnabled {
continue continue
} }
if containsNetworkChainID(network, disabledFromChainIDs) { if containsNetworkChainID(network, disabledFromChainIDs) {
continue continue
} }
@ -556,10 +557,12 @@ func (r *Router) suggestedRoutes(
if token == nil { if token == nil {
continue continue
} }
nativeToken := r.s.tokenManager.FindToken(network, network.NativeCurrencySymbol) nativeToken := r.s.tokenManager.FindToken(network, network.NativeCurrencySymbol)
if nativeToken == nil { if nativeToken == nil {
continue continue
} }
group.Add(func(c context.Context) error { group.Add(func(c context.Context) error {
gasFees, err := r.s.feesManager.suggestedFees(ctx, network.ChainID) gasFees, err := r.s.feesManager.suggestedFees(ctx, network.ChainID)
if err != nil { if err != nil {
@ -590,7 +593,6 @@ func (r *Router) suggestedRoutes(
maxFees := gasFees.feeFor(gasFeeMode) maxFees := gasFees.feeFor(gasFeeMode)
estimatedTime := r.s.feesManager.transactionEstimatedTime(ctx, network.ChainID, maxFees) estimatedTime := r.s.feesManager.transactionEstimatedTime(ctx, network.ChainID, maxFees)
for _, bridge := range r.bridges { for _, bridge := range r.bridges {
if !sendType.canUseBridge(bridge) { if !sendType.canUseBridge(bridge) {
continue continue