Add mint blockchain and fix issue with 1559 calc

dependabot/bundler/rexml-3.3.3
James Brown 4 months ago
parent 2748b19252
commit f1b9bd0e94
  1. 2
      app/src/main/java/com/alphawallet/app/C.java
  2. 10
      app/src/main/java/com/alphawallet/app/entity/SuggestEIP1559.kt
  3. 25
      app/src/main/java/com/alphawallet/app/repository/EthereumNetworkBase.java
  4. 2
      app/src/main/java/com/alphawallet/app/ui/GasSettingsActivity.java
  5. BIN
      app/src/main/res/drawable/ic_mint_logo.png
  6. BIN
      app/src/main/res/drawable/ic_mint_test_logo.png
  7. 1
      app/src/main/res/values/colors_misc.xml
  8. 9
      lib/src/main/java/com/alphawallet/ethereum/EthereumNetworkBase.java

@ -63,6 +63,8 @@ public abstract class C {
public static final String BASE_TESTNET_NAME = "Base Sepolia (Test)";
public static final String MANTLE_MAINNET_NAME = "Mantle";
public static final String MANTLE_TESTNET_NAME = "Mantle Sepolia (Test)";
public static final String MINT_MAINNET_NAME = "Mint";
public static final String MINT_TESTNET_NAME = "Mint Sepolia (Test)";
public static final String ETHEREUM_TICKER_NAME = "ethereum";
public static final String CLASSIC_TICKER_NAME = "ethereum-classic";

@ -161,7 +161,15 @@ internal fun suggestPriorityFee(firstBlock: Long, feeHistory: FeeHistory, gasSer
ptr -= blockCount + 1
}
if (rewards.isEmpty()) {
var isEmpty = true;
for (thisReward in rewards) {
if (thisReward > ZERO) {
isEmpty = false;
break;
}
}
if (isEmpty || rewards.isEmpty()) {
return@fromCallable calculatePriorityFee(feeHistory)
}
rewards.sort()

@ -59,6 +59,10 @@ import static com.alphawallet.ethereum.EthereumNetworkBase.MILKOMEDA_C1_ID;
import static com.alphawallet.ethereum.EthereumNetworkBase.MILKOMEDA_C1_RPC;
import static com.alphawallet.ethereum.EthereumNetworkBase.MILKOMEDA_C1_TEST_ID;
import static com.alphawallet.ethereum.EthereumNetworkBase.MILKOMEDA_C1_TEST_RPC;
import static com.alphawallet.ethereum.EthereumNetworkBase.MINT_ID;
import static com.alphawallet.ethereum.EthereumNetworkBase.MINT_MAINNET_RPC;
import static com.alphawallet.ethereum.EthereumNetworkBase.MINT_SEPOLIA_RPC;
import static com.alphawallet.ethereum.EthereumNetworkBase.MINT_SEPOLIA_TESTNET_ID;
import static com.alphawallet.ethereum.EthereumNetworkBase.OKX_ID;
import static com.alphawallet.ethereum.EthereumNetworkBase.OKX_RPC_URL;
import static com.alphawallet.ethereum.EthereumNetworkBase.OPTIMISM_GOERLI_TESTNET_FALLBACK_RPC_URL;
@ -175,6 +179,8 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy
: KLAYTN_BAOBAB_RPC;
public static final String CRONOS_MAIN_RPC_URL = "https://evm.cronos.org";
public static final String MINT_MAINNET_FALLBACK = "https://asia.rpc.mintchain.io";
// Use the "Free" routes as backup in order to diversify node usage; to avoid single point of failure
public static final String MAINNET_FALLBACK_RPC_URL = usesProductionKey ? FREE_MAINNET_RPC_URL : "https://mainnet.infura.io/v3/" + keyProvider.getSecondaryInfuraKey();
public static final String GOERLI_FALLBACK_RPC_URL = usesProductionKey ? FREE_GOERLI_RPC_URL : "https://goerli.infura.io/v3/" + keyProvider.getSecondaryInfuraKey();
@ -212,11 +218,11 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy
//If your wallet prioritises xDai for example, you may want to move the XDAI_ID to the front of this list,
//Then xDai would appear as the first token at the top of the wallet
private static final List<Long> hasValue = new ArrayList<>(Arrays.asList(
MAINNET_ID, GNOSIS_ID, POLYGON_ID, ROOTSTOCK_MAINNET_ID, CLASSIC_ID, LINEA_ID, BASE_MAINNET_ID, MANTLE_MAINNET_ID, BINANCE_MAIN_ID, HECO_ID, AVALANCHE_ID,
MAINNET_ID, GNOSIS_ID, POLYGON_ID, ROOTSTOCK_MAINNET_ID, CLASSIC_ID, LINEA_ID, BASE_MAINNET_ID, MANTLE_MAINNET_ID, MINT_ID, BINANCE_MAIN_ID, HECO_ID, AVALANCHE_ID,
FANTOM_ID, OPTIMISTIC_MAIN_ID, CRONOS_MAIN_ID, ARBITRUM_MAIN_ID, PALM_ID, KLAYTN_ID, IOTEX_MAINNET_ID, AURORA_MAINNET_ID, MILKOMEDA_C1_ID, OKX_ID));
private static final List<Long> testnetList = new ArrayList<>(Arrays.asList(
SEPOLIA_TESTNET_ID, POLYGON_AMOY_ID, HOLESKY_ID, BASE_TESTNET_ID, GOERLI_ID, BINANCE_TEST_ID,
SEPOLIA_TESTNET_ID, POLYGON_AMOY_ID, HOLESKY_ID, BASE_TESTNET_ID, MINT_SEPOLIA_TESTNET_ID, GOERLI_ID, BINANCE_TEST_ID,
ROOTSTOCK_TESTNET_ID, CRONOS_TEST_ID, MANTLE_TESTNET_ID, OPTIMISM_GOERLI_TEST_ID, POLYGON_TEST_ID, ARBITRUM_GOERLI_TEST_ID, LINEA_TEST_ID, KLAYTN_BAOBAB_ID,
FANTOM_TEST_ID, IOTEX_TESTNET_ID, FUJI_TEST_ID, MILKOMEDA_C1_TEST_ID,
AURORA_TESTNET_ID, PALM_TEST_ID));
@ -408,6 +414,15 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy
"https://explorer.sepolia.mantle.xyz/api?"));
// Add deprecated networks after this line
put(MINT_ID, new NetworkInfo(C.MINT_MAINNET_NAME, C.ETH_SYMBOL,
MINT_MAINNET_RPC,
"https://explorer.mintchain.io/tx/", MINT_ID, MINT_MAINNET_FALLBACK,
"https://explorer.mintchain.io/api/v2/"));
put(MINT_SEPOLIA_TESTNET_ID, new NetworkInfo(C.MINT_TESTNET_NAME, C.ETH_SYMBOL,
MINT_SEPOLIA_RPC,
"https://sepolia-testnet-explorer.mintchain.io/tx/", MINT_SEPOLIA_TESTNET_ID, MINT_SEPOLIA_RPC,
"https://sepolia-testnet-explorer.mintchain.io/api/v2/")); //https://sepolia-testnet-explorer.mintchain.io/api/v2/addresses/0x76626Fc07d050d59c9fc1Ac5b853a9952B5E9Afe/transactions?filter=to%20%7C%20from
}
};
@ -459,6 +474,8 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy
put(BASE_TESTNET_ID, R.drawable.ic_base_test_logo);
put(MANTLE_MAINNET_ID, R.drawable.ic_mantle_logo);
put(MANTLE_TESTNET_ID, R.drawable.ic_mantle_test_logo);
put(MINT_ID, R.drawable.ic_mint_logo);
put(MINT_SEPOLIA_TESTNET_ID, R.drawable.ic_mint_test_logo);
}
};
@ -506,6 +523,8 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy
put(BASE_TESTNET_ID, R.drawable.ic_base_test_logo);
put(MANTLE_MAINNET_ID, R.drawable.ic_mantle_logo);
put(MANTLE_TESTNET_ID, R.drawable.ic_mantle_test_logo);
put(MINT_ID, R.drawable.ic_mint_logo);
put(MINT_SEPOLIA_TESTNET_ID, R.drawable.ic_mint_test_logo);
}
};
@ -553,6 +572,8 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy
put(BASE_TESTNET_ID, R.color.base_logo);
put(MANTLE_MAINNET_ID, R.color.rootstock);
put(MANTLE_TESTNET_ID, R.color.rootstock);
put(MINT_ID, R.color.mint_chain);
put(MINT_SEPOLIA_TESTNET_ID, R.color.mint_chain);
}
};

@ -18,6 +18,7 @@ import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.content.ContextCompat;
@ -313,6 +314,7 @@ public class GasSettingsActivity extends BaseActivity implements GasSettingsCall
private final Token baseCurrency;
private final Context context;
@NonNull
@Override
public GasSpeedHolder onCreateViewHolder(ViewGroup parent, int viewType)
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@ -44,4 +44,5 @@
<color name="sepolia">#67b1d4</color>
<color name="okx">#000000</color>
<color name="rootstock">#000000</color>
<color name="mint_chain">#30BF54</color>
</resources>

@ -50,6 +50,8 @@ public abstract class EthereumNetworkBase
public static final long BASE_TESTNET_ID = 84532;
public static final long MANTLE_MAINNET_ID = 5000;
public static final long MANTLE_TESTNET_ID = 5003;
public static final long MINT_ID = 185;
public static final long MINT_SEPOLIA_TESTNET_ID = 1687;
public static final String MAINNET_RPC_URL = "https://mainnet.infura.io/v3/da3717f25f824cc1baa32d812386d93f";
@ -96,6 +98,8 @@ public abstract class EthereumNetworkBase
public static final String MANTLE_MAINNET_RPC = "https://rpc.mantle.xyz";
public static final String MANTLE_TESTNET_RPC = "https://rpc.sepolia.mantle.xyz";
public static final String MINT_MAINNET_RPC = "https://global.rpc.mintchain.io";
public static final String MINT_SEPOLIA_RPC = "https://sepolia-testnet-rpc.mintchain.io";
static Map<Long, NetworkInfo> networkMap = new LinkedHashMap<Long, NetworkInfo>()
@ -188,6 +192,11 @@ public abstract class EthereumNetworkBase
MANTLE_MAINNET_ID, false));
put(MANTLE_TESTNET_ID, new NetworkInfo("Mantle Sepolia (Test)", "ETH", BASE_FREE_TESTNET_RPC, "https://sepolia.basescan.org/tx/",
MANTLE_TESTNET_ID, false));
put(MINT_ID, new NetworkInfo("Mint", "ETH", MINT_MAINNET_RPC, "https://explorer.mintchain.io/tx/",
MINT_ID, false));
put(MINT_SEPOLIA_TESTNET_ID, new NetworkInfo("Mint Sepolia (Test)", "ETH", MINT_SEPOLIA_RPC, "https://sepolia-testnet-explorer.mintchain.io/tx/",
MINT_SEPOLIA_TESTNET_ID, false));
}
};

Loading…
Cancel
Save