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 fuse mainnet and sparknet config changes #1364

Merged
merged 4 commits into from
Jan 17, 2024
Merged
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"@mui/icons-material": "^5.8.4",
"@mui/lab": "^5.0.0-alpha.72",
"@mui/material": "^5.5.0",
"@pushprotocol/restapi": "1.4.45",
"@pushprotocol/restapi": "1.6.1",
"@pushprotocol/socket": "0.5.3",
"@pushprotocol/uiweb": "1.2.0",
"@pushprotocol/uiweb": "1.2.3",
"@reduxjs/toolkit": "^1.7.1",
"@testing-library/dom": "^9.0.1",
"@testing-library/jest-dom": "^4.2.4",
Expand Down
6 changes: 6 additions & 0 deletions public/svg/Fuse.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 @@ -63,6 +63,13 @@ const Faucets = () => {
title: "Arbitrum Testnet Faucet",
function: () => {},
link: "https://faucet.quicknode.com/arbitrum/goerli"
},
{
id: "123",
value: "Fuse",
title: "Fuse Sparknet Faucet",
function: () => {},
link: "https://chaindrop.org/?chainid=123&token=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
}
];

Expand Down
2 changes: 1 addition & 1 deletion src/components/InitState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const InitState = () => {
channelInformationPromise = [...delegateeList].map(({ channel }) => {
return getAliasDetails({account,chainId}).then(
(data) => PushAPI.channels.getChannel({
channel: convertAddressToAddrCaip(data.channel, appConfig.coreContractChain),
channel: convertAddressToAddrCaip(channel, appConfig.coreContractChain),
env: appConfig.appEnv
}));
});
Expand Down
4 changes: 4 additions & 0 deletions src/components/VerifyAlias.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const VerifyAlias = ({ aliasEthAccount, setAliasVerified }) => {
421613: {
label: "Goerli ArbETH",
url: "https://faucet.quicknode.com/arbitrum/goerli"
},
123: {
label: "Fuse SPARK",
url: "https://chaindrop.org/?chainid=123&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 @@ -28,7 +28,8 @@ export const config = {
97, // bnb testnet
420, // optimism goerli testnet
1442, // polygon zkevm testnet
421613 // arbitrum testnet
421613, // arbitrum testnet
123 // fuse testnet
],

/**
Expand Down Expand Up @@ -168,5 +169,12 @@ export const CHAIN_DETAILS = {
chainId: 421613,
rpcUrl: '',
commAddress: '0x2f6aE0907116A2c50D712e78b48D874fadeB6850'
},
123: {
label: "Fuse Testnet",
name: "FUSE_TESTNET",
chainId: 123,
rpcUrl: 'https://rpc.fusespark.io',
commAddress: '0x7eBb54D86CF928115965DB596a3E600404dD8039'
}
}
12 changes: 10 additions & 2 deletions src/config/config-prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export const config = {
56, // for bnb mainnet
// 10, // for optimism mainnet
42161, // arbitrum mainnet
1101 // polygon zkevm mainnet
1101, // polygon zkevm mainnet
// 122 // fuse mainnet
],

/**
Expand Down Expand Up @@ -157,5 +158,12 @@ export const CHAIN_DETAILS = {
chainId: 42161,
rpcUrl: 'https://arb1.arbitrum.io/rpc',
commAddress: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa'
}
},
122: {
label: "Fuse Mainnet",
name: "FUSE_MAINNET",
chainId: 122,
rpcUrl: 'https://rpc.fuse.io',
commAddress: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa'
},
}
10 changes: 9 additions & 1 deletion src/config/config-staging.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export const config = {
97, // bnb testnet
420, // optimism goerli testnet
1442, // polygon zkevm testnet
421613 // arbitrum testnet
421613, // arbitrum testnet
// 123 // fuse testnet
],

/**
Expand Down Expand Up @@ -159,5 +160,12 @@ export const CHAIN_DETAILS = {
chainId: 421613,
rpcUrl: '',
commAddress: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa'
},
123: {
label: "Fuse Testnet",
name: "FUSE_TESTNET",
chainId: 123,
rpcUrl: 'https://rpc.fusespark.io',
commAddress: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa'
}
}
24 changes: 24 additions & 0 deletions src/connectors/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ const BNB: AddEthereumChainParameter['nativeCurrency'] = {
decimals: 18,
}

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

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

interface BasicChainInformation {
urls: string[]
name: string
Expand Down Expand Up @@ -106,6 +118,12 @@ export const MAINNET_CHAINS: ChainConfig = {
nativeCurrency: CELO,
blockExplorerUrls: ['https://explorer.celo.org'],
},
122: {
urls: ['https://rpc.fuse.io'],
name: "Fuse Mainnet",
nativeCurrency: FUSE,
blockExplorerUrls: ['https://explorer.fuse.io/']
}
}

export const TESTNET_CHAINS: ChainConfig = {
Expand Down Expand Up @@ -155,6 +173,12 @@ export const TESTNET_CHAINS: ChainConfig = {
urls: ['https://rpc.public.zkevm-test.net'],
nativeCurrency: MATIC,
blockExplorerUrls: [],
},
123: {
name: "Fuse Testnet",
urls: ['https://rpc.fusespark.io'],
nativeCurrency: SPARK,
blockExplorerUrls: ['https://explorer.fusespark.io/'],
}
}

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];
export const Eip155EnabledIds: Array<Number> = [1, 56, 137, 10, 1101, 42161, 11155111, 97, 80001, 420, 1442, 421613, 122, 123];

// Types
type CAIPProps = {
Expand Down
34 changes: 28 additions & 6 deletions src/helpers/UtilityHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { appConfig } from '../config';
// Utility Helper Functions
const UtilityHelper = {
isMainnet: (chainId: number):boolean => {
if (chainId === 1 || chainId === 137 || chainId === 56 || chainId === 1101 || chainId === 10 || chainId === 42161) {
if (chainId === 1 || chainId === 137 || chainId === 56 || chainId === 1101 || chainId === 10 || chainId === 42161 || chainId === 122) {
return true;
}
return false;
Expand Down Expand Up @@ -50,7 +50,9 @@ export const MaskedAliasChannels:{
1442: {},
1101: {},
42161: {},
421613: {}
421613: {},
122: {},
123: {}
}

export const findObject = (data: any,parentArray: any[],property: string ): boolean => {
Expand Down Expand Up @@ -112,7 +114,9 @@ export const networkName = {
1442: "Polygon zkEVM Testnet",
1101: "Polygon zkEVM Mainnet",
42161: "ArbitrumOne Mainnet",
421613: "Arbitrum Testnet"
421613: "Arbitrum Testnet",
122: "Fuse Mainnet",
123: "Fuse Testnet"
};

export const chainNameBackendStandard = {
Expand All @@ -133,7 +137,9 @@ export const aliasChainIdToChainName={
42161: 'ARBITRUMONE',
421613: 'ARBITRUMONE',
1101: "POLYGONZKEVM",
1442: "POLYGONZKEVM"
1442: "POLYGONZKEVM",
122: "FUSE",
123: "FUSE"
}

export const aliasChainIdsMapping = {
Expand Down Expand Up @@ -203,7 +209,7 @@ export const NETWORK_DETAILS = {
ARBITRUM_TESTNET: {
chainId: utils.hexValue(421613),
chainName: 'Arbitrum Testnet',
nativeCurrency: {name: 'ETH', symbol: 'ETH', decimals: 18},
nativeCurrency: {name: 'AGOR', symbol: 'AGOR', decimals: 18},
rpcUrls: ['https://goerli-rollup.arbitrum.io/rpc'],
blockExplorerUrls: ['https://testnet.arbiscan.io/']
},
Expand All @@ -213,6 +219,20 @@ export const NETWORK_DETAILS = {
nativeCurrency: {name: 'ETH', symbol: 'ETH', decimals: 18},
rpcUrls: ['https://arb1.arbitrum.io/rpc'],
blockExplorerUrls: ['https://arbiscan.io/']
},
FUSE_TESTNET: {
chainId: utils.hexValue(123),
chainName: 'Fuse Testnet',
nativeCurrency: {name: 'SPARK', symbol: 'SPARK', decimals: 18},
rpcUrls: ['https://rpc.fusespark.io'],
blockExplorerUrls: [' https://explorer.fusespark.io/']
},
FUSE_MAINNET: {
chainId: utils.hexValue(122),
chainName: 'Fuse Mainnet',
nativeCurrency: {name: 'Fuse', symbol: 'Fuse', decimals: 18},
rpcUrls: ['https://rpc.fuse.io'],
blockExplorerUrls: [' https://explorer.fuse.io/']
}
};

Expand All @@ -233,7 +253,9 @@ export const LOGO_FROM_CHAIN_ID: {
1101: "PolygonZkEVM.svg",
42161: "Arbitrum.svg",
421613: "Arbitrum.svg",
11155111: "Ethereum.svg"
11155111: "Ethereum.svg",
122: "Fuse.svg",
123: "Fuse.svg"
}

export type getAliasResponseType = {
Expand Down