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

Added support for Shardeum Testnet #1411

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions public/svg/Shardeum.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/components/Faucets.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ const Faucets = () => {
title: "Fuse Sparknet Faucet",
function: () => {},
link: "https://chaindrop.org/?chainid=123&token=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
},
{
id: "8082",
value: "Shardeum",
title: "Shardeum Testnet",
function: () => {},
link: "https://chaindrop.org/?chainid=8082&token=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
}
];

Expand Down
4 changes: 4 additions & 0 deletions src/components/VerifyAlias.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ const VerifyAlias = ({ aliasEthAccount, setAliasVerified }) => {
123: {
label: "Fuse SPARK",
url: "https://chaindrop.org/?chainid=123&token=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
},
8082: {
label: "Testnet SHM",
url: "https://chaindrop.org/?chainid=8082&token=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
}
}

Expand Down
10 changes: 9 additions & 1 deletion src/config/config-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export const config = {
420, // optimism goerli testnet
1442, // polygon zkevm testnet
421613, // arbitrum testnet
123 // fuse testnet
123, // fuse testnet
8082 // shardeum testnet
],

/**
Expand Down Expand Up @@ -177,5 +178,12 @@ export const CHAIN_DETAILS = {
chainId: 123,
rpcUrl: 'https://rpc.fusespark.io',
commAddress: '0x7eBb54D86CF928115965DB596a3E600404dD8039'
},
8082: {
label: "Shardeum Testnet",
name: "SHARDEUM_TESTNET",
chainId: 8082,
rpcUrl: 'https://sphinx.shardeum.org/',
commAddress: '0x9cb3bd7550b5c92baa056fc0f08132f49508145f'
}
}
10 changes: 9 additions & 1 deletion src/config/config-staging.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export const config = {
420, // optimism goerli testnet
1442, // polygon zkevm testnet
421613, // arbitrum testnet
123 // fuse testnet
123, // fuse testnet
8082 // shardeum testnet
],

/**
Expand Down Expand Up @@ -168,5 +169,12 @@ export const CHAIN_DETAILS = {
chainId: 123,
rpcUrl: 'https://rpc.fusespark.io',
commAddress: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa'
},
8082: {
label: "Shardeum Testnet",
name: "SHARDEUM_TESTNET",
chainId: 8082,
rpcUrl: 'https://sphinx.shardeum.org/',
commAddress: '0x3a680290a18f3000973d04d6d1c6f91a7294f27a'
}
}
12 changes: 12 additions & 0 deletions src/connectors/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ const SPARK: AddEthereumChainParameter['nativeCurrency'] = {
decimals: 18,
}

const SHM: AddEthereumChainParameter['nativeCurrency'] = {
name: 'SHM',
symbol: 'SHM',
decimals: 18,
}

interface BasicChainInformation {
urls: string[]
name: string
Expand Down Expand Up @@ -179,6 +185,12 @@ export const TESTNET_CHAINS: ChainConfig = {
urls: ['https://rpc.fusespark.io'],
nativeCurrency: SPARK,
blockExplorerUrls: ['https://explorer.fusespark.io/'],
},
8082: {
name: "Shardeum Testnet",
urls: ['https://sphinx.shardeum.org/'],
nativeCurrency: SHM,
blockExplorerUrls: ['https://explorer-sphinx.shardeum.org/'],
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/CaipHelper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Internal Configs
import { appConfig } from '../config';

export const Eip155EnabledIds: Array<Number> = [1, 56, 137, 10, 1101, 42161, 11155111, 97, 80001, 420, 1442, 421613, 122, 123];
export const Eip155EnabledIds: Array<Number> = [1, 56, 137, 10, 1101, 42161, 11155111, 97, 80001, 420, 1442, 421613, 122, 123, 8082];

// Types
type CAIPProps = {
Expand Down
19 changes: 15 additions & 4 deletions src/helpers/UtilityHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export const MaskedAliasChannels:{
42161: {},
421613: {},
122: {},
123: {}
123: {},
8082: {}
}

export const findObject = (data: any,parentArray: any[],property: string ): boolean => {
Expand Down Expand Up @@ -116,7 +117,8 @@ export const networkName = {
42161: "ArbitrumOne Mainnet",
421613: "Arbitrum Testnet",
122: "Fuse Mainnet",
123: "Fuse Testnet"
123: "Fuse Testnet",
8082: "Shardeum Testnet"
};

export const chainNameBackendStandard = {
Expand All @@ -139,7 +141,8 @@ export const aliasChainIdToChainName={
1101: "POLYGONZKEVM",
1442: "POLYGONZKEVM",
122: "FUSE",
123: "FUSE"
123: "FUSE",
8082: "SHARDEUM"
}

export const aliasChainIdsMapping = {
Expand Down Expand Up @@ -233,6 +236,13 @@ export const NETWORK_DETAILS = {
nativeCurrency: {name: 'Fuse', symbol: 'Fuse', decimals: 18},
rpcUrls: ['https://rpc.fuse.io'],
blockExplorerUrls: [' https://explorer.fuse.io/']
},
SHARDEUM_TESTNET: {
chainId: utils.hexValue(8082),
chainName: 'Shardeum Testnet',
nativeCurrency: {name: 'SHM', symbol: 'SHM', decimals: 18},
rpcUrls: ['https://sphinx.shardeum.org/'],
blockExplorerUrls: ['https://explorer-sphinx.shardeum.org/']
}
};

Expand All @@ -255,7 +265,8 @@ export const LOGO_FROM_CHAIN_ID: {
421613: "Arbitrum.svg",
11155111: "Ethereum.svg",
122: "Fuse.svg",
123: "Fuse.svg"
123: "Fuse.svg",
8082: "Shardeum.svg"
}

export type getAliasResponseType = {
Expand Down
Loading