Skip to content

feat: add SEI network support in @metamask/bridge-controller #5695

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

Draft
wants to merge 3 commits 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
5 changes: 5 additions & 0 deletions packages/bridge-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add `SEI` network support ([#5695](https://github.com/MetaMask/core/pull/5695))
- Add `SEI` into constants `ALLOWED_BRIDGE_CHAIN_IDS`, `SWAPS_TOKEN_OBJECT` and `NETWORK_TO_NAME_MAP`

### Changed

- Bump `@metamask/multichain-network-controller` dependency to `^0.5.1` ([#5678](https://github.com/MetaMask/core/pull/5678))
Expand Down
1 change: 1 addition & 0 deletions packages/bridge-controller/src/constants/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const ALLOWED_BRIDGE_CHAIN_IDS = [
CHAIN_IDS.ARBITRUM,
CHAIN_IDS.LINEA_MAINNET,
CHAIN_IDS.BASE,
CHAIN_IDS.SEI,
SolScope.Mainnet,
] as const;

Expand Down
2 changes: 2 additions & 0 deletions packages/bridge-controller/src/constants/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export const INK_DISPLAY_NAME = 'Ink Mainnet';
export const SONEIUM_DISPLAY_NAME = 'Soneium Mainnet';
export const MODE_SEPOLIA_DISPLAY_NAME = 'Mode Sepolia';
export const MODE_DISPLAY_NAME = 'Mode Mainnet';
export const SEI_DISPLAY_NAME = 'Sei Network';

export const NETWORK_TO_NAME_MAP = {
[NETWORK_TYPES.GOERLI]: GOERLI_DISPLAY_NAME,
Expand Down Expand Up @@ -154,4 +155,5 @@ export const NETWORK_TO_NAME_MAP = {
[CHAIN_IDS.METACHAIN_ONE]: METACHAIN_ONE_DISPLAY_NAME,
[CHAIN_IDS.LISK]: LISK_DISPLAY_NAME,
[CHAIN_IDS.LISK_SEPOLIA]: LISK_SEPOLIA_DISPLAY_NAME,
[CHAIN_IDS.SEI]: SEI_DISPLAY_NAME,
} as const;
11 changes: 11 additions & 0 deletions packages/bridge-controller/src/constants/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const CURRENCY_SYMBOLS = {
MOONRIVER: 'MOVR',
ONE: 'ONE',
SOL: 'SOL',
SEI: 'SEI',
} as const;

const ETH_SWAPS_TOKEN_OBJECT = {
Expand Down Expand Up @@ -139,6 +140,14 @@ const SOLANA_SWAPS_TOKEN_OBJECT = {
iconUrl: '',
} as const;

const SEI_SWAPS_TOKEN_OBJECT = {
symbol: CURRENCY_SYMBOLS.SEI,
name: 'Sei',
address: DEFAULT_TOKEN_ADDRESS,
decimals: 18,
iconUrl: '',
} as const;

const SWAPS_TESTNET_CHAIN_ID = '0x539';

export const SWAPS_CHAINID_DEFAULT_TOKEN_MAP = {
Expand All @@ -154,6 +163,7 @@ export const SWAPS_CHAINID_DEFAULT_TOKEN_MAP = {
[CHAIN_IDS.ZKSYNC_ERA]: ZKSYNC_ERA_SWAPS_TOKEN_OBJECT,
[CHAIN_IDS.LINEA_MAINNET]: LINEA_SWAPS_TOKEN_OBJECT,
[CHAIN_IDS.BASE]: BASE_SWAPS_TOKEN_OBJECT,
[CHAIN_IDS.SEI]: SEI_SWAPS_TOKEN_OBJECT,
[SolScope.Mainnet]: SOLANA_SWAPS_TOKEN_OBJECT,
} as const;

Expand All @@ -176,4 +186,5 @@ export const SYMBOL_TO_SLIP44_MAP: Record<
BNB: 'slip44:714',
AVAX: 'slip44:9000',
TESTETH: 'slip44:60',
SEI: 'slip44:19000118',
};