diff --git a/bridge_ui/src/components/NFT/Redeem.tsx b/bridge_ui/src/components/NFT/Redeem.tsx
index 94ad98f4..348cd642 100644
--- a/bridge_ui/src/components/NFT/Redeem.tsx
+++ b/bridge_ui/src/components/NFT/Redeem.tsx
@@ -1,10 +1,11 @@
-import { CHAIN_ID_TERRA } from "@certusone/wormhole-sdk";
+import { CHAIN_ID_SOLANA, CHAIN_ID_TERRA } from "@certusone/wormhole-sdk";
import { useSelector } from "react-redux";
import { useHandleNFTRedeem } from "../../hooks/useHandleNFTRedeem";
import useIsWalletReady from "../../hooks/useIsWalletReady";
import { selectNFTTargetChain } from "../../store/selectors";
import ButtonWithLoader from "../ButtonWithLoader";
import KeyAndBalance from "../KeyAndBalance";
+import SolanaTPSWarning from "../SolanaTPSWarning";
import StepDescription from "../StepDescription";
import TerraFeeDenomPicker from "../TerraFeeDenomPicker";
import WaitingForWalletMessage from "./WaitingForWalletMessage";
@@ -20,6 +21,7 @@ function Redeem() {
{targetChain === CHAIN_ID_TERRA && (
)}
+ {targetChain === CHAIN_ID_SOLANA && }
+ {sourceChain === CHAIN_ID_SOLANA && }
) : null}
+ {sourceChain === CHAIN_ID_SOLANA && }
({
@@ -136,6 +137,7 @@ function Target() {
)}
+ {targetChain === CHAIN_ID_SOLANA && }
({
+ alert: {
+ marginTop: theme.spacing(1),
+ marginBottom: theme.spacing(1),
+ },
+}));
+
+export default function SolanaTPSWarning() {
+ const classes = useStyles();
+ const [tps, setTps] = useState(null);
+ useEffect(() => {
+ let cancelled = false;
+ let interval = setInterval(() => {
+ (async () => {
+ try {
+ const connection = new Connection(SOLANA_HOST);
+ const samples = await connection.getRecentPerformanceSamples(1);
+ if (samples.length >= 1) {
+ let short = samples
+ .filter((sample) => sample.numTransactions !== 0)
+ .map(
+ (sample) => sample.numTransactions / sample.samplePeriodSecs
+ );
+ const avgTps = short[0];
+ if (!cancelled) {
+ setTps(avgTps);
+ }
+ }
+ } catch (e) {}
+ })();
+ }, 5000);
+ return () => {
+ cancelled = true;
+ clearInterval(interval);
+ };
+ }, []);
+ return tps !== null && tps < 1500 ? (
+ {`WARNING! The Solana Transactions Per Second (TPS) is below 1500. This is a sign of network congestion. Proceed with caution as you may have difficulty submitting transactions and the guardians may have difficulty witnessing them (this could lead to processing delays). Current TPS: ${numeral(
+ tps
+ ).format("0,0")}`}
+ ) : null;
+}
diff --git a/bridge_ui/src/components/Transfer/Redeem.tsx b/bridge_ui/src/components/Transfer/Redeem.tsx
index 82d80658..2d8daf24 100644
--- a/bridge_ui/src/components/Transfer/Redeem.tsx
+++ b/bridge_ui/src/components/Transfer/Redeem.tsx
@@ -41,6 +41,7 @@ import ButtonWithLoader from "../ButtonWithLoader";
import KeyAndBalance from "../KeyAndBalance";
import SmartAddress from "../SmartAddress";
import { SolanaCreateAssociatedAddressAlternate } from "../SolanaCreateAssociatedAddress";
+import SolanaTPSWarning from "../SolanaTPSWarning";
import StepDescription from "../StepDescription";
import TerraFeeDenomPicker from "../TerraFeeDenomPicker";
import AddToMetamask from "./AddToMetamask";
@@ -129,6 +130,7 @@ function Redeem() {
label="Automatically unwrap to native currency"
/>
)}
+ {targetChain === CHAIN_ID_SOLANA && }
{targetChain === CHAIN_ID_SOLANA ? (
) : null}
diff --git a/bridge_ui/src/components/Transfer/Send.tsx b/bridge_ui/src/components/Transfer/Send.tsx
index 68339f60..210b1844 100644
--- a/bridge_ui/src/components/Transfer/Send.tsx
+++ b/bridge_ui/src/components/Transfer/Send.tsx
@@ -1,4 +1,8 @@
-import { CHAIN_ID_TERRA, isEVMChain } from "@certusone/wormhole-sdk";
+import {
+ CHAIN_ID_SOLANA,
+ CHAIN_ID_TERRA,
+ isEVMChain,
+} from "@certusone/wormhole-sdk";
import { Checkbox, FormControlLabel } from "@material-ui/core";
import { Alert } from "@material-ui/lab";
import { ethers } from "ethers";
@@ -22,6 +26,7 @@ import { CHAINS_BY_ID } from "../../utils/consts";
import ButtonWithLoader from "../ButtonWithLoader";
import KeyAndBalance from "../KeyAndBalance";
import ShowTx from "../ShowTx";
+import SolanaTPSWarning from "../SolanaTPSWarning";
import StepDescription from "../StepDescription";
import TerraFeeDenomPicker from "../TerraFeeDenomPicker";
import TransactionProgress from "../TransactionProgress";
@@ -140,6 +145,7 @@ function Send() {
completing Step 4, you will have to perform the recovery workflow to
complete the transfer.
+ {sourceChain === CHAIN_ID_SOLANA && }
{approveButtonNeeded ? (
<>
+ {sourceChain === CHAIN_ID_SOLANA && }