Skip to content

Commit

Permalink
fix: update list of mainnet for QR generation (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
isaackps authored Apr 8, 2024
1 parent acd8b67 commit e8be055
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/hook/useQueue/utils/publish.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import {
} from "../../../../types";
import { getQueueNumber } from "../../../API/storageAPI";
import { encodeQrCode, getDataV3, getDocumentNetwork } from "../../../utils";
import { ChainInfo } from "../../../../constants/chainInfo";
import { ChainInfo, supportedMainnet } from "../../../../constants/chainInfo";

const redirectUrl = (network: Network) => {
if (network === "homestead" || network === "matic") return "https://tradetrust.io/";
if (supportedMainnet.includes(network)) return "https://tradetrust.io/";
return "https://dev.tradetrust.io/";
};

Expand Down
17 changes: 17 additions & 0 deletions src/constants/chainInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,23 @@ export const ChainInfo: ChainInfo = {
},
};

export const supportedMainnet = [
ChainInfo[ChainId.Ethereum].networkName,
ChainInfo[ChainId.Polygon].networkName,
ChainInfo[ChainId.XDC].networkName,
ChainInfo[ChainId.HederaMainnet].networkName,
ChainInfo[ChainId.Stability].networkName,
];

export const supportedTestnet = [
ChainInfo[ChainId.Sepolia].networkName,
ChainInfo[ChainId.PolygonMumbai].networkName,
ChainInfo[ChainId.Amoy].networkName,
ChainInfo[ChainId.XDCApothem].networkName,
ChainInfo[ChainId.HederaTestnet].networkName,
ChainInfo[ChainId.StabilityTestnet].networkName,
];

export const getSupportedNetworkNameFromId = (networkId: number): Network => {
const chainIndo = Object.values(ChainInfo).find((network) => network.chainId === networkId);
if (!chainIndo) {
Expand Down

0 comments on commit e8be055

Please sign in to comment.