Skip to content

Commit

Permalink
[TG] Copy update (#1791)
Browse files Browse the repository at this point in the history
* update gateway copy to `Ten`
  • Loading branch information
Jennievon authored Feb 14, 2024
1 parent 4d79eea commit a506163
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tools/walletextension/frontend/src/services/useGatewayService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,39 +34,39 @@ const useGatewayService = () => {
};

const connectToTenTestnet = async () => {
showToast(ToastType.INFO, "Connecting to Obscuro Testnet...");
showToast(ToastType.INFO, "Connecting to Ten Testnet...");
setLoading(true);
try {
if (await isTenChain()) {
if (!token || !isValidTokenFormat(token)) {
showToast(
ToastType.DESTRUCTIVE,
"Existing Obscuro Testnet detected in MetaMask. Please remove before hitting begin"
"Existing Ten Testnet detected in MetaMask. Please remove before hitting begin"
);
return;
}
}
showToast(ToastType.INFO, "Switching to Obscuro Testnet...");
showToast(ToastType.INFO, "Switching to Ten Testnet...");
const switched = await switchToTenNetwork();
showToast(ToastType.SUCCESS, `Switched to Obscuro Testnet: ${switched}`);
showToast(ToastType.SUCCESS, `Switched to Ten Testnet: ${switched}`);
// SWITCHED_CODE=4902; error 4902 means that the chain does not exist
if (
switched === SWITCHED_CODE ||
!isValidTokenFormat(await getToken(provider))
) {
showToast(ToastType.INFO, "Adding Obscuro Testnet...");
showToast(ToastType.INFO, "Adding Ten Testnet...");
const user = await joinTestnet();
const rpcUrls = [
`${tenGatewayAddress}/${tenGatewayVersion}/?token=${user}`,
];
await addNetworkToMetaMask(rpcUrls);
showToast(ToastType.SUCCESS, "Added Obscuro Testnet");
showToast(ToastType.SUCCESS, "Added Ten Testnet");
}

if (!(await isMetamaskConnected())) {
showToast(ToastType.INFO, "No accounts found, connecting...");
await connectAccounts();
showToast(ToastType.SUCCESS, "Connected to Obscuro Testnet");
showToast(ToastType.SUCCESS, "Connected to Ten Testnet");
}
await fetchUserAccounts();
} catch (error: any) {
Expand All @@ -81,7 +81,7 @@ const useGatewayService = () => {
try {
return await fetchTestnetStatus();
} catch (error) {
showToast(ToastType.DESTRUCTIVE, "Unable to connect to Obscuro Testnet");
showToast(ToastType.DESTRUCTIVE, "Unable to connect to Ten Testnet");
throw error;
}
};
Expand Down

0 comments on commit a506163

Please sign in to comment.