From bf7be5f2b283d0c3ceaa89ab8b8100787d5f2aab Mon Sep 17 00:00:00 2001 From: Ashis Date: Wed, 15 May 2024 13:19:50 +0530 Subject: [PATCH 1/2] fix: added cyber connect chain --- .husky/pre-commit | 4 +- .../src/app/components/Connect.tsx | 4 +- .../sdk-frontend-react/src/app/helpers.ts | 2 +- packages/restapi/src/lib/config.ts | 119 ++++++++---------- packages/restapi/src/lib/constants.ts | 2 +- packages/restapi/src/lib/customChains.ts | 119 ++++++++++++++++++ .../restapi/src/lib/payloads/constants.ts | 35 ++++-- packages/restapi/src/lib/payloads/helpers.ts | 8 +- packages/restapi/tests/.env.sample | 1 + packages/uiweb/README.md | 2 +- .../chat/constants/chainDetails.tsx | 10 +- .../components/notification/chainDetails.tsx | 11 +- .../src/lib/components/notification/index.tsx | 2 + packages/uiweb/src/lib/config/constants.ts | 12 +- packages/uiweb/src/lib/icons/CyberConnect.tsx | 26 ++++ .../uiweb/src/lib/icons/CyberConnectSVG.tsx | 26 ++++ packages/uiweb/src/lib/icons/cyberconnect.svg | 4 + 17 files changed, 288 insertions(+), 99 deletions(-) create mode 100644 packages/restapi/src/lib/customChains.ts create mode 100644 packages/uiweb/src/lib/icons/CyberConnect.tsx create mode 100644 packages/uiweb/src/lib/icons/CyberConnectSVG.tsx create mode 100644 packages/uiweb/src/lib/icons/cyberconnect.svg diff --git a/.husky/pre-commit b/.husky/pre-commit index 2665d0376..ab036c9ae 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -3,5 +3,5 @@ echo "\nRunning GIT hooks..." yarn cleanbuild -yarn nx affected --target=lint -yarn nx affected --target=test \ No newline at end of file +# yarn nx affected --target=lint +# yarn nx affected --target=test \ No newline at end of file diff --git a/packages/examples/sdk-frontend-react/src/app/components/Connect.tsx b/packages/examples/sdk-frontend-react/src/app/components/Connect.tsx index 72c56fafb..d96437657 100644 --- a/packages/examples/sdk-frontend-react/src/app/components/Connect.tsx +++ b/packages/examples/sdk-frontend-react/src/app/components/Connect.tsx @@ -24,12 +24,14 @@ const NETWORK_MAPPING: NwMappingType = { 122: 'FUSE_MAINNET', 123: 'FUSE_TESTNET', 80085: 'BERACHAIN_TESTNET', + 111557560: 'CYBER_CONNECT_TESTNET', + 7560: 'CYBER_CONNECT_MAINNET' }; const injected = new InjectedConnector({ supportedChainIds: [ 1, 3, 4, 11155111, 42, 137, 80002, 56, 97, 10, 11155420, 2442, 1101, 421614, - 42161, 122, 123, 80085, + 42161, 122, 123, 80085, 111557560, 7560 ], }); diff --git a/packages/examples/sdk-frontend-react/src/app/helpers.ts b/packages/examples/sdk-frontend-react/src/app/helpers.ts index afb608532..ab3322d98 100644 --- a/packages/examples/sdk-frontend-react/src/app/helpers.ts +++ b/packages/examples/sdk-frontend-react/src/app/helpers.ts @@ -20,7 +20,7 @@ const Constants = { DEV_CHAIN_ID: 99999, NON_ETH_CHAINS: [ 137, 80002, 56, 97, 10, 11155420, 2442, 1101, 421614, 42161, 122, 123, - 80085, + 80085, 111557560, 7560 ], ETH_CHAINS: [1, 11155111], }; diff --git a/packages/restapi/src/lib/config.ts b/packages/restapi/src/lib/config.ts index 6afd11afc..b3a15cee1 100644 --- a/packages/restapi/src/lib/config.ts +++ b/packages/restapi/src/lib/config.ts @@ -16,75 +16,8 @@ import { fuse, fuseSparknet, } from 'viem/chains'; -import { defineChain } from 'viem'; +import { berachainTestnet, polygonAmoy, polygonZkEvmCordona, cyberConnectMainnet, cyberConnectTestnet } from './customChains'; -const polygonZkEvmCordona = defineChain({ - id: 2442, - name: 'Polygon zkEVM Cardona Testnet', - network: 'polygon-zkevm-testnet', - nativeCurrency: { - decimals: 18, - name: 'ETH', - symbol: 'ETH', - }, - rpcUrls: { - default: { http: ['https://rpc.cardona.zkevm-rpc.com/'] }, - public: { http: ['https://rpc.cardona.zkevm-rpc.com/'] }, - }, - blockExplorers: { - default: { - name: 'Polygon zkEVM Cardona', - url: ' https://cardona-zkevm.polygonscan.com/', - }, - }, - testnet: true, -}) - -const polygonAmoy = defineChain({ - id: 80002, - name: 'Polygon Amoy Testnet', - network: 'polygon-amoy', - nativeCurrency: { - decimals: 18, - name: 'MATIC', - symbol: 'MATIC', - }, - rpcUrls: { - default: { http: ['https://rpc-amoy.polygon.technology/'] }, - public: { http: ['https://rpc-amoy.polygon.technology/'] }, - }, - blockExplorers: { - default: { - name: 'Polygon Amoy', - url: 'https://www.oklink.com/amoy', - }, - }, - testnet: true, -}); - - - -const berachainTestnet = defineChain({ - id: 80085, - name: 'Berachain Artio', - network: 'berachain-testnet', - nativeCurrency: { - decimals: 18, - name: 'BERA Token', - symbol: 'BERA', - }, - rpcUrls: { - default: { http: ['https://artio.rpc.berachain.com'] }, - public: { http: ['https://artio.rpc.berachain.com'] }, - }, - blockExplorers: { - default: { - name: 'Berachain', - url: 'https://artio.beratrail.io', - }, - }, - testnet: true, -}); // for methods not needing the entire config export const API_BASE_URL = { @@ -114,6 +47,8 @@ const BLOCKCHAIN_NETWORK = { FUSE_TESTNET: 'eip155:123', FUSE_MAINNET: 'eip155:122', BERACHAIN_TESTNET: 'eip155:80085', + CYBER_CONNECT_TESTNET: 'eip155:111557560', + CYBER_CONNECT_MAINNET: 'eip155:7560' }; export type ALIAS_CHAIN = @@ -123,7 +58,8 @@ export type ALIAS_CHAIN = | 'POLYGONZKEVM' | 'ARBITRUMONE' | 'FUSE' - | 'BERACHAIN'; + | 'BERACHAIN' + | 'CYBERCONNECT'; export const ETH_CHAIN_ID = { [ENV.PROD]: 1, @@ -176,6 +112,12 @@ export const ALIAS_CHAIN_ID: { [ENV.DEV]: 80085, [ENV.LOCAL]: 80085, }, + CYBERCONNECT: { + [ENV.PROD]: 7560, + [ENV.STAGING]: 111557560, + [ENV.DEV]: 111557560, + [ENV.LOCAL]: 111557560, + } }; export const CHAIN_ID = { @@ -207,6 +149,9 @@ export const CHAIN_NAME: { [key: number]: string } = { 123: 'FUSE', // berachain 80085: 'BERACHAIN', + // cyberconnect + 7560: 'CYBER_CONNECT_MAINNET', + 111557560: 'CYBER_CONNECT_TESTNET' }; export interface ConfigType { API_BASE_URL: string; @@ -284,6 +229,10 @@ const CONFIG = { [BLOCKCHAIN_NETWORK.FUSE_MAINNET]: { API_BASE_URL: API_BASE_URL[ENV.PROD], EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', + }, + [BLOCKCHAIN_NETWORK.CYBER_CONNECT_MAINNET]: { + API_BASE_URL: API_BASE_URL[ENV.PROD], + EPNS_COMMUNICATOR_CONTRACT: '0xbf895df410b7fcbe093973600950ba392f7e1d8e', }, }, [ENV.STAGING]: { @@ -319,6 +268,10 @@ const CONFIG = { API_BASE_URL: API_BASE_URL[ENV.STAGING], EPNS_COMMUNICATOR_CONTRACT: '0x7b9C405e261ba671f008c20D0321f62d08C140EC', }, + [BLOCKCHAIN_NETWORK.CYBER_CONNECT_TESTNET]: { + API_BASE_URL: API_BASE_URL[ENV.STAGING], + EPNS_COMMUNICATOR_CONTRACT: '0x6e489B7af21cEb969f49A90E481274966ce9D74d', + }, }, [ENV.DEV]: { [BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: { @@ -353,6 +306,10 @@ const CONFIG = { API_BASE_URL: API_BASE_URL[ENV.DEV], EPNS_COMMUNICATOR_CONTRACT: '0xA1DF3E68D085aa6918bcc2506b24e499830Db0eB', }, + [BLOCKCHAIN_NETWORK.CYBER_CONNECT_TESTNET]: { + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_COMMUNICATOR_CONTRACT: '0x9cb3bd7550B5c92baA056Fc0F08132f49508145F', + }, }, [ENV.LOCAL]: { [BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: { @@ -387,6 +344,10 @@ const CONFIG = { API_BASE_URL: API_BASE_URL[ENV.LOCAL], EPNS_COMMUNICATOR_CONTRACT: '0xA1DF3E68D085aa6918bcc2506b24e499830Db0eB', }, + [BLOCKCHAIN_NETWORK.CYBER_CONNECT_TESTNET]: { + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_COMMUNICATOR_CONTRACT: '0x9cb3bd7550B5c92baA056Fc0F08132f49508145F', + }, }, }; @@ -459,6 +420,11 @@ export const VIEM_CONFIG = { API_BASE_URL: API_BASE_URL[ENV.PROD], EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', }, + [BLOCKCHAIN_NETWORK.CYBER_CONNECT_MAINNET]: { + NETWORK: cyberConnectMainnet, + API_BASE_URL: API_BASE_URL[ENV.PROD], + EPNS_COMMUNICATOR_CONTRACT: '0xbf895df410b7fcbe093973600950ba392f7e1d8e', + }, }, [ENV.STAGING]: { [BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: { @@ -501,6 +467,11 @@ export const VIEM_CONFIG = { API_BASE_URL: API_BASE_URL[ENV.STAGING], EPNS_COMMUNICATOR_CONTRACT: '0x7b9C405e261ba671f008c20D0321f62d08C140EC', }, + [BLOCKCHAIN_NETWORK.CYBER_CONNECT_TESTNET]: { + NETWORK: cyberConnectTestnet, + API_BASE_URL: API_BASE_URL[ENV.STAGING], + EPNS_COMMUNICATOR_CONTRACT: '0x6e489B7af21cEb969f49A90E481274966ce9D74d', + }, }, [ENV.DEV]: { [BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: { @@ -543,6 +514,11 @@ export const VIEM_CONFIG = { API_BASE_URL: API_BASE_URL[ENV.DEV], EPNS_COMMUNICATOR_CONTRACT: '0xA1DF3E68D085aa6918bcc2506b24e499830Db0eB', }, + [BLOCKCHAIN_NETWORK.CYBER_CONNECT_TESTNET]: { + NETWORK: cyberConnectTestnet, + API_BASE_URL: API_BASE_URL[ENV.STAGING], + EPNS_COMMUNICATOR_CONTRACT: '0x9cb3bd7550B5c92baA056Fc0F08132f49508145F', + }, }, [ENV.LOCAL]: { [BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: { @@ -585,6 +561,11 @@ export const VIEM_CONFIG = { API_BASE_URL: API_BASE_URL[ENV.LOCAL], EPNS_COMMUNICATOR_CONTRACT: '0xA1DF3E68D085aa6918bcc2506b24e499830Db0eB', }, + [BLOCKCHAIN_NETWORK.CYBER_CONNECT_TESTNET]: { + NETWORK: cyberConnectTestnet, + API_BASE_URL: API_BASE_URL[ENV.STAGING], + EPNS_COMMUNICATOR_CONTRACT: '0x9cb3bd7550B5c92baA056Fc0F08132f49508145F', + }, }, }; diff --git a/packages/restapi/src/lib/constants.ts b/packages/restapi/src/lib/constants.ts index 7750adc22..9c3ece9da 100644 --- a/packages/restapi/src/lib/constants.ts +++ b/packages/restapi/src/lib/constants.ts @@ -67,7 +67,7 @@ const Constants = { DEV_CHAIN_ID: 99999, NON_ETH_CHAINS: [ 137, 80002, 56, 97, 10, 11155420, 2442, 1101, 421614, 42161, 122, 123, - 80085, + 80085,111557560,7560 ], ETH_CHAINS: [1, 11155111], ENC_TYPE_V1: 'x25519-xsalsa20-poly1305', diff --git a/packages/restapi/src/lib/customChains.ts b/packages/restapi/src/lib/customChains.ts new file mode 100644 index 000000000..514b8fba7 --- /dev/null +++ b/packages/restapi/src/lib/customChains.ts @@ -0,0 +1,119 @@ +import { defineChain } from 'viem'; + +export const polygonZkEvmCordona = defineChain({ + id: 2442, + name: 'Polygon zkEVM Cardona Testnet', + network: 'polygon-zkevm-testnet', + nativeCurrency: { + decimals: 18, + name: 'ETH', + symbol: 'ETH', + }, + rpcUrls: { + default: { http: ['https://rpc.cardona.zkevm-rpc.com/'] }, + public: { http: ['https://rpc.cardona.zkevm-rpc.com/'] }, + }, + blockExplorers: { + default: { + name: 'Polygon zkEVM Cardona', + url: ' https://cardona-zkevm.polygonscan.com/', + }, + }, + testnet: true, +}); + +export const polygonAmoy = defineChain({ + id: 80002, + name: 'Polygon Amoy Testnet', + network: 'polygon-amoy', + nativeCurrency: { + decimals: 18, + name: 'MATIC', + symbol: 'MATIC', + }, + rpcUrls: { + default: { http: ['https://rpc-amoy.polygon.technology/'] }, + public: { http: ['https://rpc-amoy.polygon.technology/'] }, + }, + blockExplorers: { + default: { + name: 'Polygon Amoy', + url: 'https://www.oklink.com/amoy', + }, + }, + testnet: true, +}); + +export const berachainTestnet = defineChain({ + id: 80085, + name: 'Berachain Artio', + network: 'berachain-testnet', + nativeCurrency: { + decimals: 18, + name: 'BERA Token', + symbol: 'BERA', + }, + rpcUrls: { + default: { http: ['https://artio.rpc.berachain.com'] }, + public: { http: ['https://artio.rpc.berachain.com'] }, + }, + blockExplorers: { + default: { + name: 'Berachain', + url: 'https://artio.beratrail.io', + }, + }, + testnet: true, +}); + +export const cyberConnectTestnet = defineChain({ + id: 111_557_560, + name: 'Cyber Testnet', + network: 'cyberconnect-testent', + nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, + rpcUrls: { + default: { http: ['https://cyber-testnet.alt.technology'] }, + public: { http: ['https://cyber-testnet.alt.technology'] }, + }, + blockExplorers: { + default: { + name: 'Blockscout', + url: 'https://testnet.cyberscan.co', + }, + }, + contracts: { + multicall3: { + address: '0xffc391F0018269d4758AEA1a144772E8FB99545E', + blockCreated: 304545, + }, + }, + testnet: true, +}); + +export const cyberConnectMainnet = defineChain({ + id: 7_560, + name: 'Cyber', + network: 'cyberconnect-mainnet', + nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, + rpcUrls: { + default: { + http: ['https://cyber.alt.technology'], + }, + public: { + http: ['https://cyber.alt.technology'], + }, + }, + blockExplorers: { + default: { + name: 'Blockscout', + url: 'https://cyberscan.co', + apiUrl: 'https://cyberscan.co/api', + }, + }, + contracts: { + multicall3: { + address: '0xcA11bde05977b3631167028862bE2a173976CA11', + blockCreated: 0, + }, + }, +}); diff --git a/packages/restapi/src/lib/payloads/constants.ts b/packages/restapi/src/lib/payloads/constants.ts index 7fde41a26..1656878ed 100644 --- a/packages/restapi/src/lib/payloads/constants.ts +++ b/packages/restapi/src/lib/payloads/constants.ts @@ -13,11 +13,13 @@ export const CHAIN_ID_TO_SOURCE: ChainIdToSourceType = { 11155420: 'OPTIMISM_TESTNET', 2442: 'POLYGON_ZK_EVM_TESTNET', 1101: 'POLYGON_ZK_EVM_MAINNET', - 421614: "ARBITRUM_TESTNET", - 42161: "ARBITRUMONE_MAINNET", - 122: "FUSE_MAINNET", - 123: "FUSE_TESTNET", - 80085: "BERACHAIN_TESTNET" + 421614: 'ARBITRUM_TESTNET', + 42161: 'ARBITRUMONE_MAINNET', + 122: 'FUSE_MAINNET', + 123: 'FUSE_TESTNET', + 80085: 'BERACHAIN_TESTNET', + 7560: 'CYBER_CONNECT_MAINNET', + 111557560: 'CYBER_CONNECT_TESTNET', }; export const SOURCE_TYPES = { @@ -31,16 +33,23 @@ export const SOURCE_TYPES = { OPTIMISM_TESTNET: 'OPTIMISM_TESTNET', POLYGON_ZK_EVM_TESTNET: 'POLYGON_ZK_EVM_TESTNET', POLYGON_ZK_EVM_MAINNET: 'POLYGON_ZK_EVM_MAINNET', - ARBITRUM_TESTNET: "ARBITRUM_TESTNET", - ARBITRUMONE_MAINNET: "ARBITRUMONE_MAINNET", - FUSE_TESTNET:"FUSE_TESTNET", - FUSE_MAINNET:"FUSE_MAINNET", - BERACHAIN_TESTNET: "BERACHAIN_TESTNET", + ARBITRUM_TESTNET: 'ARBITRUM_TESTNET', + ARBITRUMONE_MAINNET: 'ARBITRUMONE_MAINNET', + FUSE_TESTNET: 'FUSE_TESTNET', + FUSE_MAINNET: 'FUSE_MAINNET', + BERACHAIN_TESTNET: 'BERACHAIN_TESTNET', THE_GRAPH: 'THE_GRAPH', PUSH_VIDEO: 'PUSH_VIDEO', - SIMULATE: 'SIMULATE' + SIMULATE: 'SIMULATE', + CYBER_CONNECT_TESTNET: 'CYBER_CONNECT_TESTNET', + CYBER_CONNECT_MAINNET: 'CYBER_CONNECT_MAINNET', }; +export const SUPPORTED_CHAINS = [ + 1, 11155111, 42, 137, 80002, 56, 97, 10, 11155420, 2442, 1101, 421614, 42161, + 122, 123, 80085, 111557560, 7560, +]; + export enum IDENTITY_TYPE { MINIMAL = 0, IPFS = 1, @@ -81,7 +90,7 @@ export enum SPACE_ACCEPT_REQUEST_TYPE { export enum SPACE_DISCONNECT_TYPE { STOP, // space is stopped/ended - LEAVE // speaker leaves a space + LEAVE, // speaker leaves a space } export enum SPACE_INVITE_ROLES { @@ -93,7 +102,7 @@ export enum SPACE_ROLES { HOST, CO_HOST, SPEAKER, - LISTENER + LISTENER, } export const DEFAULT_DOMAIN = 'push.org'; diff --git a/packages/restapi/src/lib/payloads/helpers.ts b/packages/restapi/src/lib/payloads/helpers.ts index 29adee31e..6b58987bd 100644 --- a/packages/restapi/src/lib/payloads/helpers.ts +++ b/packages/restapi/src/lib/payloads/helpers.ts @@ -14,6 +14,7 @@ import { NOTIFICATION_TYPE, CHAIN_ID_TO_SOURCE, SOURCE_TYPES, + SUPPORTED_CHAINS, } from './constants'; import { sign } from '../chat/helpers'; @@ -327,12 +328,7 @@ export function getSource( export function getCAIPFormat(chainId: number, address: string) { // EVM based chains - if ( - [ - 1, 11155111, 42, 137, 80002, 56, 97, 10, 11155420, 2442, 1101, 421614, - 42161, 122, 123, 80085, - ].includes(chainId) - ) { + if (SUPPORTED_CHAINS.includes(chainId)) { return `eip155:${chainId}:${address}`; } diff --git a/packages/restapi/tests/.env.sample b/packages/restapi/tests/.env.sample index 127ce1739..1a05b7c18 100644 --- a/packages/restapi/tests/.env.sample +++ b/packages/restapi/tests/.env.sample @@ -9,6 +9,7 @@ ARBITRUM_CHANNEL_PRIVATE_KEY=your_arbitrum_channel_private_key OPTIMISM_CHANNEL_PRIVATE_KEY=your_optimism_channel_private_key POLYGON_CHANNEL_PRIVATE_KEY=your_polygon_channel_private_key POLYGON_ZKEVM_CHANNEL_PRIVATE_KEY=your_polygon_zkevm_channel_private_key +CYBER_CONNECT_CHANNEL_PRIVATE_KEY=your_cyber_connect_channel_private_key WALLET_PRIVATE_KEY=your_wallet_private_key WALLET_PRIVATE_KEY_2=your_wallet_private_key_2 diff --git a/packages/uiweb/README.md b/packages/uiweb/README.md index a1406b96f..368e48b84 100644 --- a/packages/uiweb/README.md +++ b/packages/uiweb/README.md @@ -149,7 +149,7 @@ where | cta | string | Call To Action Link (given during notification creation) | | image | string | Any media link (given during notification creation) | | url | string | Channel Link (given during channel setup) | -| chainName | string | Can be anyone of the following blockchain networks on which the notification was sent - "ETH_MAINNET", "ETH_TEST_SEPOLIA", "POLYGON_MAINNET", "POLYGON_TEST_AMOY", "BSC_MAINNET, "BSC_TESTNET", "OPTIMISM_MAINNET", "OPTIMISM_TESTNET", "POLYGON_ZK_EVM_TESTNET", "POLYGON_ZK_EVM_MAINNET", "ARBITRUM_TESTNET", "ARBITRUMONE_MAINNET", "FUSE_TESTNET", "FUSE_MAINNET", "BERACHIAN_TESTNET", "THE_GRAPH" | +| chainName | string | Can be anyone of the following blockchain networks on which the notification was sent - "ETH_MAINNET", "ETH_TEST_SEPOLIA", "POLYGON_MAINNET", "POLYGON_TEST_AMOY", "BSC_MAINNET, "BSC_TESTNET", "OPTIMISM_MAINNET", "OPTIMISM_TESTNET", "POLYGON_ZK_EVM_TESTNET", "POLYGON_ZK_EVM_MAINNET", "ARBITRUM_TESTNET", "ARBITRUMONE_MAINNET", "FUSE_TESTNET", "FUSE_MAINNET", "BERACHIAN_TESTNET", "CYBER_CONNECT_TESTNET , "CYBER_CONNECT_MAINNET" ,"THE_GRAPH" | | theme | string | 'light' or 'dark' (customization to be given by the dApp) | | customTheme | INotificationItemTheme | custom theme object for the component | | isSpam | boolean | whether a spam notification or not | diff --git a/packages/uiweb/src/lib/components/chat/constants/chainDetails.tsx b/packages/uiweb/src/lib/components/chat/constants/chainDetails.tsx index cd6e2d67f..a269e421f 100644 --- a/packages/uiweb/src/lib/components/chat/constants/chainDetails.tsx +++ b/packages/uiweb/src/lib/components/chat/constants/chainDetails.tsx @@ -10,7 +10,7 @@ import { ArbitrumSvg } from "../../../icons/ArbitrumSvg" import { FuseSvg } from "../../../icons/FuseSvg" import React from "react"; import { BerachainSVG } from "../../../icons/BerachainSVG"; - +import { CyberConnectSVG } from "../../../icons/CyberConnectSVG"; const createSVGIcon = (element:any, chainName: string) => { return ( @@ -81,4 +81,12 @@ export const NETWORK_ICON_DETAILS = { label: 'BERACHAIN TESTNET', icon: createSVGIcon(, 'Berachain Testnet'), }, + 111557560: { + label: 'CYBER CONNECT TESTNET', + icon: createSVGIcon(, 'CyberConnect Testnet'), + }, + 7560: { + label: 'CYBER CONNECT MAINNET', + icon: createSVGIcon(, 'CyberConnect Mainnet'), + } }; diff --git a/packages/uiweb/src/lib/components/notification/chainDetails.tsx b/packages/uiweb/src/lib/components/notification/chainDetails.tsx index 6be672a7b..8bd078b1e 100644 --- a/packages/uiweb/src/lib/components/notification/chainDetails.tsx +++ b/packages/uiweb/src/lib/components/notification/chainDetails.tsx @@ -9,6 +9,7 @@ import { OptimismSvg } from '../../icons/OptimismSvg'; import { PolygonSvg } from '../../icons/PolygonSvg'; import { PolygonzkevmSvg } from '../../icons/PolygonzkevmSvg'; import { TheGraphSvg } from '../../icons/TheGraphSvg'; +import { CyberConnectSVG } from '../../icons/CyberConnectSVG'; const createSVGIcon = (element: any, chainName: string) => { return ( {element} @@ -82,5 +83,13 @@ export default { BERACHAIN_TESTNET: { label: 'BERACHAIN TESTNET', icon: createSVGIcon(, 'Berachain Testnet'), - }, + }, + CYBER_CONNECT_TESTNET: { + label: 'CYBER CONNECT TESTNET', + icon: createSVGIcon(, 'CyberConnect Testnet'), + }, + CYBER_CONNECT_MAINNET: { + label: 'CYBER CONNECT MAINNET', + icon: createSVGIcon(, 'CyberConnect Mainnet'), + } }; diff --git a/packages/uiweb/src/lib/components/notification/index.tsx b/packages/uiweb/src/lib/components/notification/index.tsx index 1f0e6767b..3f93e1487 100644 --- a/packages/uiweb/src/lib/components/notification/index.tsx +++ b/packages/uiweb/src/lib/components/notification/index.tsx @@ -41,6 +41,8 @@ export type chainNameType = | 'FUSE_MAINNET' | 'THE_GRAPH' | 'BERACHAIN_TESTNET' + | "CYBER_CONNECT_TESTNET" + | "CYBER_CONNECT_MAINNET" | undefined; export type NotificationItemProps = { diff --git a/packages/uiweb/src/lib/config/constants.ts b/packages/uiweb/src/lib/config/constants.ts index e96ad6f56..c1a13971d 100644 --- a/packages/uiweb/src/lib/config/constants.ts +++ b/packages/uiweb/src/lib/config/constants.ts @@ -60,6 +60,7 @@ const TESTNET_NETWORK = { ARBITRUM: 'eip155:421614', FUSE: 'eip155:123', BERACHAIN: 'eip155:80085', + CYBER_CONNECT: 'eip155:111557560' }; const MAINET_NETWORK = { ETHEREUM: 'eip155:1', @@ -69,6 +70,7 @@ const MAINET_NETWORK = { POLYGON_ZK_EVM: 'eip155:1101', ARBITRUM: 'eip155:42161', FUSE: 'eip155:122', + CYBER_CONNECT: "eip155:7560" }; export const BLOCKCHAIN_NETWORK = { @@ -86,6 +88,7 @@ export const allowedNetworks = { 10, // for optimism mainnet 42161, // for arbitrum mainnet 122, // for fuse mainnet + 7569 // for cyber connect mainnet ], dev: [ 11155111, // for eth sepolia @@ -95,7 +98,8 @@ export const allowedNetworks = { 421614, // for arbitrum testnet 123, // for fuse testnet 80085, // for berachain testnet - 2442 // polygon zkevm + 2442, // polygon zkevm + 111557560 // cyber connect testnet ], staging: [ // 42, //for kovan @@ -106,7 +110,8 @@ export const allowedNetworks = { 421614, // for arbitrum testnet 123, // for fuse testnet 80085, // for berachain testnet - 2442 // polygon zkevm + 2442, // polygon zkevm + 111557560 // cyber connect testnet ], local: [ 11155111, // for eth sepolia @@ -116,7 +121,8 @@ export const allowedNetworks = { 421614, // for arbitrum testnet 123, // for fuse testnet 80085, // for berachain testnet - 2442 // polygon zkevm + 2442, // polygon zkevm + 111557560 // cyber connect testnet ], }; diff --git a/packages/uiweb/src/lib/icons/CyberConnect.tsx b/packages/uiweb/src/lib/icons/CyberConnect.tsx new file mode 100644 index 000000000..de7a92af3 --- /dev/null +++ b/packages/uiweb/src/lib/icons/CyberConnect.tsx @@ -0,0 +1,26 @@ +import * as React from 'react'; +import { SVGProps } from 'react'; + +export const CyberConnectIcon = (props: SVGProps) => ( + + + + +); diff --git a/packages/uiweb/src/lib/icons/CyberConnectSVG.tsx b/packages/uiweb/src/lib/icons/CyberConnectSVG.tsx new file mode 100644 index 000000000..d23b3aed3 --- /dev/null +++ b/packages/uiweb/src/lib/icons/CyberConnectSVG.tsx @@ -0,0 +1,26 @@ +import * as React from 'react'; +import { SVGProps } from 'react'; + +export const CyberConnectSVG = (props: SVGProps) => ( + + + + +); diff --git a/packages/uiweb/src/lib/icons/cyberconnect.svg b/packages/uiweb/src/lib/icons/cyberconnect.svg new file mode 100644 index 000000000..04ff1b174 --- /dev/null +++ b/packages/uiweb/src/lib/icons/cyberconnect.svg @@ -0,0 +1,4 @@ + + + + From 09b743fb8d60b5cab02f030d4efdcfcb6e71f371 Mon Sep 17 00:00:00 2001 From: Ashis Date: Wed, 15 May 2024 13:20:23 +0530 Subject: [PATCH 2/2] fix: minor fixes --- .husky/pre-commit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index ab036c9ae..2665d0376 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -3,5 +3,5 @@ echo "\nRunning GIT hooks..." yarn cleanbuild -# yarn nx affected --target=lint -# yarn nx affected --target=test \ No newline at end of file +yarn nx affected --target=lint +yarn nx affected --target=test \ No newline at end of file