Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hedera): added support for hedera network #845

Closed
wants to merge 12 commits into from
Binary file added public/static/images/networks/Hedera.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/config/chain-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ export const MAIN_NETWORKS = [
ChainId.Ethereum, //
ChainId.Polygon,
ChainId.XDC,
ChainId.HederaMainnet,
];

/**
* Supported networks in development environment
*/
export const TEST_NETWORKS = [ChainId.Sepolia, ChainId.PolygonMumbai, ChainId.APOTHEM];
export const TEST_NETWORKS = [ChainId.Sepolia, ChainId.PolygonMumbai, ChainId.APOTHEM, ChainId.HederaTestnet];
34 changes: 33 additions & 1 deletion src/constants/chain-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface ChainInfoObject {
export const InitialAddress = "0x0000000000000000000000000000000000000000";
export const BurnAddress = "0x000000000000000000000000000000000000dEaD";

export const AvailableBlockChains = ["ETH", "MATIC", "XDC"];
export const AvailableBlockChains = ["ETH", "MATIC", "XDC", "HBAR"];

type ChainInfo = Record<ChainId, ChainInfoObject>;

Expand All @@ -39,6 +39,10 @@ export enum ChainId {
// XDC Network
XDC = 50,
APOTHEM = 51,

//Hedera Network
HederaMainnet = 295,
HederaTestnet = 296,
}

export const ChainInfo: ChainInfo = {
Expand Down Expand Up @@ -129,4 +133,32 @@ export const ChainInfo: ChainInfo = {
decimals: 18,
},
},
[ChainId.HederaMainnet]: {
label: "Hedera Mainnet",
chainId: ChainId.HederaMainnet,
iconImage: "/static/images/networks/hedera.png",
networkName: "hederamainnet",
networkLabel: "Hedera Mainnet",
explorerUrl: "https://hashscan.io/mainnet",
rpcUrl: "https://mainnet.hashio.io/api",
nativeCurrency: {
name: "HBAR",
symbol: "HBAR",
decimals: 18,
},
},
[ChainId.HederaTestnet]: {
label: "Hedera Testnet",
chainId: ChainId.HederaTestnet,
iconImage: "/static/images/networks/hedera.png",
networkName: "hederatestnet",
networkLabel: "Hedera Testnet",
explorerUrl: "https://hashscan.io/testnet",
rpcUrl: "https://testnet.hashio.io/api",
nativeCurrency: {
name: "HBAR",
symbol: "HBAR",
decimals: 18,
},
},
};