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: add scroll layer2 chains and icons #777

Merged
merged 4 commits into from
Apr 9, 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
7 changes: 7 additions & 0 deletions .changeset/long-cups-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@ant-design/web3-assets": patch
"@ant-design/web3-common": patch
"@ant-design/web3-icons": patch
---

feat: add scoll icons and chains
37 changes: 37 additions & 0 deletions packages/assets/src/chains/ethereum.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
OkxWalletColorful,
OptimismCircleColorful,
PolygonCircleColorful,
ScrollColorful,
} from '@ant-design/web3-icons';

export const Mainnet: Chain = {
Expand All @@ -22,6 +23,9 @@ export const Mainnet: Chain = {
nativeCurrency: { icon: <EthereumFilled />, name: 'Ether', symbol: 'ETH', decimals: 18 },
};

/**
* @deprecated use sepolia or holesky instead
*/
export const Goerli: Chain = {
id: ChainIds.Goerli,
name: 'Goerli',
Expand All @@ -44,6 +48,17 @@ export const Sepolia: Chain = {
nativeCurrency: { name: 'Sepolia Ether', symbol: 'ETH', decimals: 18 },
};

export const Holesky: Chain = {
id: ChainIds.Holesky,
name: 'Holesky',
icon: <EthereumCircleColorful />,
browser: {
icon: <EthereumCircleColorful />,
getBrowserLink: createGetBrowserLink('https://holesky.etherscan.io'),
},
nativeCurrency: { name: 'Holesky Ether', symbol: 'ETH', decimals: 18 },
};

export const Polygon: Chain = {
id: ChainIds.Polygon,
name: 'Polygon',
Expand Down Expand Up @@ -110,3 +125,25 @@ export const X1Testnet: Chain = {
},
nativeCurrency: { name: 'OKB', symbol: 'OKB', decimals: 18 },
};

export const Scroll: Chain = {
id: ChainIds.Scroll,
name: 'Scroll',
icon: <ScrollColorful />,
browser: {
icon: <ScrollColorful />,
getBrowserLink: createGetBrowserLink('https://scrollscan.com/'),
},
nativeCurrency: { name: 'Scroll ETH', symbol: 'ETH', decimals: 18 },
};

export const ScrollSepolia: Chain = {
id: ChainIds.ScrollSepolia,
name: 'Scroll Sepolia Testnet',
icon: <ScrollColorful />,
browser: {
icon: <ScrollColorful />,
getBrowserLink: createGetBrowserLink('https://sepolia.scrollscan.com/'),
},
nativeCurrency: { name: 'Scroll ETH', symbol: 'ETH', decimals: 18 },
};
3 changes: 3 additions & 0 deletions packages/common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export enum ChainIds {
Avalanche = 43_114,
X1Testnet = 195,
Sepolia = 11_155_111,
Holesky = 17_000,
Scroll = 534_352,
ScrollSepolia = 534_351,
}

export enum SolanaChainIds {
Expand Down
Loading
Loading