From 81ba81250ff029010e5f87b6f128b4738efca9c2 Mon Sep 17 00:00:00 2001 From: Azleal Date: Tue, 2 Apr 2024 03:31:28 +0800 Subject: [PATCH] feat: add `zetachain` metadata (#1897) * add zetachain icon * feat: add zetachain logo * chore: tweak * revert: add to site * fix: naming * fix: changeset --------- Co-authored-by: Magomed Khamidov <53529533+KosmosKey@users.noreply.github.com> Co-authored-by: Daniel Sinclair --- .changeset/flat-maps-clean.md | 6 ++++++ packages/example/pages/_app.tsx | 4 ++++ .../RainbowKitProvider/chainIcons/zetachain.svg | 1 + .../RainbowKitProvider/provideRainbowKitChains.ts | 13 +++++++++++++ 4 files changed, 24 insertions(+) create mode 100644 .changeset/flat-maps-clean.md create mode 100644 packages/rainbowkit/src/components/RainbowKitProvider/chainIcons/zetachain.svg diff --git a/.changeset/flat-maps-clean.md b/.changeset/flat-maps-clean.md new file mode 100644 index 0000000000..b305c7485e --- /dev/null +++ b/.changeset/flat-maps-clean.md @@ -0,0 +1,6 @@ +--- +"@rainbow-me/rainbowkit": patch +"example": patch +--- + +Added support for `zetachain` and `zetachainAthensTestnet` testnet chain diff --git a/packages/example/pages/_app.tsx b/packages/example/pages/_app.tsx index 462d435afe..508b55aba7 100644 --- a/packages/example/pages/_app.tsx +++ b/packages/example/pages/_app.tsx @@ -87,6 +87,8 @@ import { polygonMumbai, ronin, sepolia, + zetachain, + zetachainAthensTestnet, zkSync, zora, zoraSepolia, @@ -135,6 +137,7 @@ const config = getDefaultConfig({ zora, blast, zkSync, + zetachain, ronin, ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [ @@ -147,6 +150,7 @@ const config = getDefaultConfig({ zoraSepolia, blastSepolia, avalancheFuji, + zetachainAthensTestnet, ] : []), ], diff --git a/packages/rainbowkit/src/components/RainbowKitProvider/chainIcons/zetachain.svg b/packages/rainbowkit/src/components/RainbowKitProvider/chainIcons/zetachain.svg new file mode 100644 index 0000000000..dc50f3b12a --- /dev/null +++ b/packages/rainbowkit/src/components/RainbowKitProvider/chainIcons/zetachain.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/rainbowkit/src/components/RainbowKitProvider/provideRainbowKitChains.ts b/packages/rainbowkit/src/components/RainbowKitProvider/provideRainbowKitChains.ts index 0336bc49c4..e5250e5358 100644 --- a/packages/rainbowkit/src/components/RainbowKitProvider/provideRainbowKitChains.ts +++ b/packages/rainbowkit/src/components/RainbowKitProvider/provideRainbowKitChains.ts @@ -36,6 +36,8 @@ type ChainName = | 'sepolia' | 'xdc' | 'xdcTestnet' + | 'zetachain' + | 'zetachainAthensTestnet' | 'zkSync' | 'zkSyncTestnet' | 'zora' @@ -107,6 +109,11 @@ const xdcIcon: IconMetadata = { iconUrl: async () => (await import('./chainIcons/xdc.svg')).default, }; +const zetachainIcon: IconMetadata = { + iconBackground: '#000000', + iconUrl: async () => (await import('./chainIcons/zetachain.svg')).default, +}; + const zkSyncIcon: IconMetadata = { iconBackground: '#f9f7ec', iconUrl: async () => (await import('./chainIcons/zkSync.svg')).default, @@ -155,6 +162,12 @@ const chainMetadataByName: Record = { sepolia: { chainId: 11_155_111, ...ethereumIcon }, xdc: { chainId: 50, name: 'XinFin', ...xdcIcon }, xdcTestnet: { chainId: 51, ...xdcIcon }, + zetachain: { chainId: 7000, name: 'ZetaChain', ...zetachainIcon }, + zetachainAthensTestnet: { + chainId: 7001, + name: 'Zeta Athens', + ...zetachainIcon, + }, zkSync: { chainId: 324, name: 'zkSync', ...zkSyncIcon }, zkSyncTestnet: { chainId: 280, ...zkSyncIcon }, zora: { chainId: 7777777, name: 'Zora', ...zoraIcon },