Skip to content

feat: integrate Berachain (chainId 80094) as second-class EVM chain#11918

Merged
gomesalexandre merged 10 commits intodevelopfrom
feat/integrate-berachain-relay
Feb 20, 2026
Merged

feat: integrate Berachain (chainId 80094) as second-class EVM chain#11918
gomesalexandre merged 10 commits intodevelopfrom
feat/integrate-berachain-relay

Conversation

@NeOMakinG
Copy link
Collaborator

@NeOMakinG NeOMakinG commented Feb 17, 2026

Description

Integrate Berachain (eip155:80094) as a second-class EVM citizen via the Relay bridge swapper.

Changes include:

  • CAIP identifiers (berachainChainId, berachainAssetId) and KnownChainIds.BerachainMainnet
  • BerachainChainAdapter extending SecondClassEvmAdapter with BERA as native token
  • HDWallet support flags on all 12 wallet implementations
  • Viem (viemBerachainClient) and ethers provider singletons
  • CoinGecko adapter integration (berachain-bera platform)
  • Relay swapper chain mapping and token mapping
  • TX status polling via eth_getTransactionReceipt in useSendActionSubscriber
  • Plugin registration with Berachain feature flag
  • CSP headers for Berachain RPC
  • Base asset definition, popular assets, portfolio utils
  • Chain-integration skill documentation updates (Steps 5.6 + 7.0)

Not yet included (requires Zerion API key):

  • Generated asset data (yarn generate:asset-data)
  • Generated CAIP adapters beyond the base adapter
  • Color map updates

Issue (if applicable)

closes #11902 (partial — Berachain only)

Risk

Low risk — behind VITE_FEATURE_BERACHAIN feature flag (default: false). No impact to existing chains.

Relay bridge/swap for Berachain native token (BERA).

Testing

Engineering

  1. Enable feature flag: set VITE_FEATURE_BERACHAIN=true in .env.development
  2. yarn build:packages && yarn dev
  3. Connect Native wallet
  4. Verify Berachain appears in chain selector
  5. Verify BERA native asset displays correctly
  6. Test send BERA to another address
  7. Test swap to/from BERA via Relay

Operations

  • 🏁 My feature is behind a flag and doesn't require operations testing (yet)

Summary by CodeRabbit

  • New Features

    • Added support for Berachain network integration with feature flag enablement.
    • Enabled Berachain compatibility across wallet implementations (Ledger, Trezor, GridPlus, MetaMask, WalletConnect, and others).
    • Integrated Berachain assets and tokens for trading and portfolio management.
    • Added transaction status monitoring for Berachain network.
  • Chores

    • Updated environment configuration for Berachain RPC endpoints and feature flags.

…fix steps

Add Step 5.6 documenting the ETH related asset index addition needed
for chains where ETH is the native gas token.

Add Step 7.0 documenting common test fixes required after chain
integration (parseData, coingeckoToAssetIds, targetNetwork).
Add Berachain mainnet support via Relay bridge swapper:
- CAIP identifiers, chain adapter, HDWallet support (all 12 wallets)
- Viem/ethers clients, CSP headers, feature flag
- CoinGecko adapter (berachain-bera), base asset (BERA)
- Plugin registration, account derivation, portfolio utils
- Relay swapper chain mapping and token mapping
- TX status polling via eth_getTransactionReceipt

Asset generation scripts not yet run (requires Zerion API key).
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 17, 2026

📝 Walkthrough

Walkthrough

This PR implements comprehensive support for Berachain (chainID 80094), a new EVM chain, across the ShapeShift web application. Changes include environment configuration, CAIP constants, chain adapters, wallet support declarations, asset definitions, CoinGecko integration, viem clients, plugin registration, feature flagging, state management, and utilities for transaction status handling.

Changes

Cohort / File(s) Summary
Configuration & Environment
.env, .env.development, src/config.ts, src/vite-env.d.ts, headers/csps/chains/berachain.ts, headers/csps/index.ts
Added Berachain RPC URL env variables, feature flag validators, CSP security headers, and viem-env type declarations to enable configurable Berachain support.
CAIP Constants & Core Types
packages/caip/src/constants.ts, packages/types/src/base.ts, packages/types/src/zerion.ts
Defined berachainAssetId, berachainChainId, CHAIN_REFERENCE.BerachainMainnet (80094), and updated VALID_CHAIN_IDS and EvmChainId unions. Added Berachain to Zerion chain mappings.
Chain Adapters - Core
packages/chain-adapters/src/evm/EvmBaseAdapter.ts, packages/chain-adapters/src/evm/SecondClassEvmAdapter.ts, packages/chain-adapters/src/evm/berachain/BerachainChainAdapter.ts, packages/chain-adapters/src/evm/berachain/index.ts, packages/chain-adapters/src/evm/index.ts, packages/chain-adapters/src/types.ts
Introduced Berachain-specific ChainAdapter extending SecondClassEvmAdapter with BIP44 params, display names, and fee asset handling. Added support checks, chain-ID mappings, and type discriminants for Berachain accounts and transactions.
Viem & RPC Clients
packages/contracts/src/ethersProviderSingleton.ts, packages/contracts/src/viemClient.ts
Wired Berachain RPC endpoint into viem client factory, added viemBerachainClient, and mapped chain/network IDs to appropriate client instances.
HDWallet Support Flags
packages/hdwallet-core/src/ethereum.ts, packages/hdwallet-core/src/wallet.ts, packages/hdwallet-*/src/*.ts (coinbase, gridplus, keepkey, ledger, metamask-multichain, native, phantom, trezor, vultisig, walletconnectv2)
Added _supportsBerachain property to all HDWallet implementations (true/false per wallet type) and exported supportsBerachain type guard function.
CoinGecko Adapter & Asset Mappings
packages/caip/src/adapters/coingecko/index.ts, packages/caip/src/adapters/coingecko/utils.ts, packages/caip/src/adapters/coingecko/utils.test.ts
Extended CoingeckoAssetPlatform enum with Berachain entry, added chainId↔platform mappings, and updated token-parsing logic to construct ERC20 assetIds for Berachain tokens from CoinGecko data.
Asset Data Generation & Definitions
packages/utils/src/assetData/baseAssets.ts, packages/utils/src/assetData/getBaseAsset.ts, scripts/generateAssetData/berachain/index.ts, scripts/generateAssetData/coingecko.ts, scripts/generateAssetData/generateAssetData.ts
Defined berachain base asset with metadata (color, icon, explorer), added Berachain case to asset-getters, introduced berachain asset-generation script, and integrated Berachain assets into main asset pipeline.
Asset Utility Functions
packages/utils/src/chainIdToFeeAssetId.ts, packages/utils/src/getAssetNamespaceFromChainId.ts, packages/utils/src/getChainShortName.ts, packages/utils/src/getNativeFeeAssetReference.ts
Added Berachain case to fee-asset mapping, ERC20 namespace classification, short-name resolution ('BERA'), and native asset reference lookups.
Swapper Relay Integration
packages/swapper/src/swappers/RelaySwapper/constant.ts, packages/swapper/src/swappers/RelaySwapper/utils/relayTokenToAssetId.ts
Mapped berachainChainId to relay chain ID and added Berachain case to native-token-to-assetId resolver.
Plugin & State Management
src/plugins/berachain/index.tsx, src/plugins/activePlugins.ts, src/state/slices/preferencesSlice/preferencesSlice.ts, src/state/migrations/index.ts, src/state/slices/opportunitiesSlice/mappings.ts
Registered Berachain plugin that creates ChainAdapter with RPC config and known-tokens callback. Added Berachain feature flag to preferences, migration entry 294, and empty DeFi-opportunities list for Berachain.
Chain & Wallet Support Hooks
src/constants/chains.ts, src/context/PluginProvider/PluginProvider.tsx, src/hooks/useWalletSupportsChain/useWalletSupportsChain.ts, src/lib/account/evm.ts, src/lib/utils/berachain.ts
Gated Berachain in knownChainIds filter by feature flag. Added Berachain checks to wallet-support detection and EVM account derivation. Implemented isBerachainChainAdapter guard and getBerachainTransactionStatus utility using JSON-RPC eth_getTransactionReceipt.
Asset Service & Feature Filtering
src/lib/asset-service/service/AssetService.ts, src/lib/coingecko/utils.ts, src/state/slices/portfolioSlice/utils/index.ts
Gated asset filtering by Berachain feature flag, conditionally included berachainChainId in CoinGecko chain list, and added Berachain support checks in portfolio utilities.
UI Components & Transactions
src/components/TradeAssetSearch/hooks/useGetPopularAssetsQuery.tsx, src/hooks/useActionCenterSubscribers/useSendActionSubscriber.tsx, src/hooks/useActualBuyAmountCryptoPrecision.ts, src/pages/Markets/components/MarketsRow.tsx
Added berachainAssetId to popular assets list when feature-flagged. Integrated Berachain tx-status polling in action center. Refactored hook to return null consistently. Gated Berachain mainnet in market-row chain filtering.
Data Files & Documentation
.beads/ss-dx5.5.json, .claude/skills/chain-integration/SKILL.md, scripts/generateAssetData/color-map.json
Added project task tracking entry ss-dx5.5 with parent epic reference. Updated chain-integration skill documentation with Steps 5.6 and 7.0 (CoinGecko test fixes). Updated asset color mappings JSON with new token addresses.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

The changes span 50+ files across multiple package boundaries with heterogeneous modifications: CAIP constants and types, chain-adapter architecture, hdwallet flag declarations (repetitive but distinct per wallet), asset generation pipelines, viem/ethers client wiring, feature-flag gating logic, transaction-status utilities, and state management. While individual changes are straightforward (mostly following established patterns), the breadth, density of chain-integration touch points, new adapter implementation, and varying logical branches (feature flags, wallet support checks, asset filtering) demand careful cross-file validation and understanding of the integration architecture.

Possibly related PRs

  • shapeshift/web#11426: Introduces the SecondClassEvmAdapter architecture that Berachain's ChainAdapter extends, establishing the foundational EVM second-class chain adapter pattern.
  • shapeshift/web#11904: Implements near-identical Ink chain integration using the same code-level changes across CAIP, adapters, viem clients, hdwallet flags, coingecko, plugins, and transaction-status utilities.
  • shapeshift/web#11887: Adds MegaEth chain support using the same integration pattern, modifying identical files and symbols (constants, clients, adapters, flags, plugins, asset generation, feature flags).

Suggested labels

capy, chain-support, berachain


🐰 Hops across a shimmering bridge,
Berachain blooms from code's grand ridge,
New wallets whisper, adapters dance,
Feature flags flip with DeFi's chance,
One chain more in the ecosystem's song! 🏗️✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: integrating Berachain as a second-class EVM chain with chainId 80094.
Linked Issues check ✅ Passed The PR implements core Berachain integration requirements from #11902: chain adapter, CAIP definitions, HDWallet support, viem/ethers clients, CoinGecko adapter, Relay mappings, feature flag, plugin registration, RPC config, and base asset definition. Missing non-coding items (Zerion integration, some asset generation) are noted as requiring API keys or post-merge work.
Out of Scope Changes check ✅ Passed All changes align with Berachain integration scope. Included are CAIP constants, chain adapters, HDWallet flags, client integrations, CoinGecko/Relay support, feature gating, and documentation. Minor changes to color-map.json and a React Query refactor (null return) are incidental to the core objective.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/integrate-berachain-relay

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

NeOMakinG and others added 6 commits February 17, 2026 19:49
Address PR review feedback:
- Add berachainChainId to getCoingeckoSupportedChainIds (feature-flagged)
- Add berachain to ZERION_CHAINS array and ZERION_CHAINS_MAP
- Across does not support Berachain, skipped
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…d trailing slash

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested most flows and everything looks good — happy with the integration overall 👍

One issue found: Relay cross-chain swaps to Berachain (e.g. ETH → BERA) are missing execution price in the action center and BERA receive in tx history. Root cause: Berachain's public RPC doesn't support debug_traceTransaction, so internal transaction tracing fails silently, making native BERA receives via internal calls invisible.

Jam: https://jam.dev/c/11f18a1b-7950-4017-a1a3-d5fafa3df9d4

Working on a fix — parsing WBERA Withdrawal events as a fallback for native receive detection on Berachain.

gomesalexandre and others added 2 commits February 20, 2026 12:52
…ilable

Berachain's public RPC doesn't support debug_traceTransaction, causing
SecondClassEvmAdapter.parseTx() to miss native BERA receives via internal
calls (e.g. cross-chain Relay fills). This adds a Berachain-specific fallback
that parses WBERA burn events (ERC20 Transfer to zero address) from the tx
receipt as synthetic internal transactions, enabling correct execution price
display and tx history entries.

Also fixes React Query "data cannot be undefined" warning in
useActualBuyAmountCryptoPrecision by returning null instead of undefined.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cross-chain swaps to BERA are now fixed — native BERA receive detection works via WBERA burn event fallback when debug_traceTransaction is unavailable on the public RPC. Execution price and tx history entries display correctly.

Also confirmed cross-chain swaps from BERA are happy (tx history + execution price).

https://jam.dev/c/dcb03401-96cd-4929-a102-eb4f53efb1c7

@gomesalexandre gomesalexandre marked this pull request as ready for review February 20, 2026 11:53
@gomesalexandre gomesalexandre requested a review from a team as a code owner February 20, 2026 11:53
@gomesalexandre gomesalexandre enabled auto-merge (squash) February 20, 2026 11:54
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (4)
.beads/ss-dx5.5.json (1)

7-7: status and checklist in notes don't reflect actual work completed in this PR.

The task status remains "open" and all checklist items in notes are still unchecked ([ ]), but this PR implements the majority of them (chain-adapters, caip, feature-flag, plugin, env-config, Relay constant/token mappings). If the beads system uses this file for progress tracking, both the status and the checklist markers should be updated to reflect what's done vs. what's explicitly deferred (generated asset data, color-map).

📋 Suggested status and checklist update
-    "status": "open",
+    "status": "in_progress",

And in notes, mark completed items with [x]:

Checklist: [x] chain-adapters [x] caip [ ] asset-service [x] feature-flag [x] plugin [x] env-config [ ] icon/logo [x] fee-asset-config

--- RELAY ACTIVATION ---
[x] Add to chainIdToRelayChainId in packages/swapper/src/swappers/RelaySwapper/constant.ts
[x] Add native asset case in packages/swapper/src/swappers/RelaySwapper/utils/relayTokenToAssetId.ts

Also applies to: 6-6

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.beads/ss-dx5.5.json at line 7, Update the "status" value in the JSON from
"open" to "closed" (or an appropriate completed state) and edit the "notes"
checklist so items implemented in this PR are checked ([x]) while leaving
deferred items unchecked; specifically mark chain-adapters, caip, feature-flag,
plugin, env-config, fee-asset-config and the two RELAY ACTIVATION lines (Add to
chainIdToRelayChainId and Add native asset case) as completed [x], and leave
asset-service and icon/logo unchecked. Ensure the "notes" string preserves
formatting and only the checklist markers are changed.
.env.development (1)

67-67: dotenv-linter ordering warnings — both VITE_BERACHAIN_NODE_URL (line 67) and VITE_FEATURE_BERACHAIN (line 102) are flagged as UnorderedKey (should precede VITE_BNBSMARTCHAIN_NODE_URL and VITE_FEATURE_CETUS_SWAP respectively in strict alphabetical order). Both values are functionally correct; the ordering is consistent with how other recent second-class chains (MegaEth, Ink) were added in-place at the bottom of their sections rather than re-sorted alphabetically. Resolve only if you want to keep the linter clean.

🔧 Proposed fix: move keys to their alphabetical positions
 VITE_BASE_NODE_URL=...
+VITE_BERACHAIN_NODE_URL=https://rpc.berachain.com
 VITE_BNBSMARTCHAIN_NODE_URL=...
 ...
-VITE_MEGAETH_NODE_URL=...
-VITE_BERACHAIN_NODE_URL=https://rpc.berachain.com
-VITE_SCROLL_NODE_URL=...
+VITE_MEGAETH_NODE_URL=...
+VITE_SCROLL_NODE_URL=...
+VITE_FEATURE_BERACHAIN=true
 VITE_FEATURE_CETUS_SWAP=true
 ...
-VITE_FEATURE_MEGAETH=true
-VITE_FEATURE_BERACHAIN=true
-VITE_FEATURE_SCROLL=true
+VITE_FEATURE_MEGAETH=true
+VITE_FEATURE_SCROLL=true

Also applies to: 102-102

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.env.development at line 67, Lint flags indicate two .env keys are out of
alphabetical order: VITE_BERACHAIN_NODE_URL and VITE_FEATURE_BERACHAIN; to fix,
move VITE_BERACHAIN_NODE_URL so it appears alphabetically before
VITE_BNBSMARTCHAIN_NODE_URL and move VITE_FEATURE_BERACHAIN so it appears
alphabetically before VITE_FEATURE_CETUS_SWAP (or reorder the surrounding
section alphabetically), ensuring the variable names and their values remain
unchanged.
src/vite-env.d.ts (1)

119-120: Minor grouping inconsistencyVITE_FEATURE_BERACHAIN is a feature flag but is placed in the "URLs and API keys from base .env" section, whereas the comparable VITE_FEATURE_INK (Line 64) lives in the "Feature flags – present in all envs" section. Functionally harmless (the interface is flat), but for consistency both entries could move up to the feature-flags block alongside VITE_INK_NODE_URL.

♻️ Suggested placement (move to feature flags section)
   readonly VITE_FEATURE_INK: string
   readonly VITE_INK_NODE_URL: string
+  readonly VITE_BERACHAIN_NODE_URL: string
+  readonly VITE_FEATURE_BERACHAIN: string

   // URLs and API keys from base .env (always defined)
   ...
   readonly VITE_NEAR_INTENTS_API_KEY: string
   readonly VITE_FEATURE_NEAR_INTENTS_SWAP: string
-  readonly VITE_BERACHAIN_NODE_URL: string
-  readonly VITE_FEATURE_BERACHAIN: string
   readonly VITE_RELAY_API_URL: string
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/vite-env.d.ts` around lines 119 - 120, The VITE_FEATURE_BERACHAIN
declaration is grouped under "URLs and API keys" but should be with other
feature flags for consistency; move the line declaring readonly
VITE_FEATURE_BERACHAIN into the "Feature flags – present in all envs" block
alongside VITE_FEATURE_INK and VITE_INK_NODE_URL, updating the surrounding
comment blocks so feature flags are grouped together while leaving the interface
flat and unchanged otherwise.
src/plugins/berachain/index.tsx (1)

25-35: fromAssetId called twice per asset — minor optional refactor.

fromAssetId(asset.assetId) is parsed in the filter callback (Line 26) and then parsed again in map for contractAddress (Line 31). Combining into a single pass with reduce or capturing the parsed result avoids the redundant parse.

♻️ Proposed refactor (single-pass)
-                  return assetService.assets
-                    .filter(asset => {
-                      const { chainId, assetNamespace } = fromAssetId(asset.assetId)
-                      return chainId === berachainChainId && assetNamespace === 'erc20'
-                    })
-                    .map(asset => ({
-                      assetId: asset.assetId,
-                      contractAddress: fromAssetId(asset.assetId).assetReference,
-                      symbol: asset.symbol,
-                      name: asset.name,
-                      precision: asset.precision,
-                    }))
+                  return assetService.assets.reduce<ReturnType<typeof getKnownTokens>>((acc, asset) => {
+                    const { chainId, assetNamespace, assetReference } = fromAssetId(asset.assetId)
+                    if (chainId === berachainChainId && assetNamespace === 'erc20') {
+                      acc.push({
+                        assetId: asset.assetId,
+                        contractAddress: assetReference,
+                        symbol: asset.symbol,
+                        name: asset.name,
+                        precision: asset.precision,
+                      })
+                    }
+                    return acc
+                  }, [])
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/plugins/berachain/index.tsx` around lines 25 - 35, The code calls
fromAssetId(asset.assetId) twice — once in the filter and again in the map —
causing redundant parsing; change the pipeline to parse once per asset (e.g.,
replace the filter+map with a single pass that extracts parsed =
fromAssetId(asset.assetId) and uses parsed.chainId/parsed.assetNamespace to
filter and parsed.assetReference for contractAddress) so functions like
fromAssetId, filter, and map operate on the parsed result for each asset rather
than re-parsing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/skills/chain-integration/SKILL.md:
- Around line 1797-1801: Add a blank line immediately before the Markdown table
that begins with "| Native Token | CoinGecko ID | Update index.test.ts? | Update
utils.test.ts? |" in .claude/skills/chain-integration/SKILL.md to satisfy MD058;
locate the table header and insert a single empty line above it so the table is
separated from the preceding paragraph or content.
- Line 1766: The markdown fenced code block on SKILL.md is missing a language
specifier (MD040); update the triple-backtick fence that contains the TypeScript
compiler message (the block starting with "error TS2339: Property
'eip155:XXX'...") to include a language tag such as ```ts or ```text so the
block becomes ```ts (or ```text) followed by the error lines and a closing ```,
which will resolve the lint error and enable proper syntax highlighting.

In `@packages/hdwallet-trezor/src/trezor.ts`:
- Line 302: The repo shows inconsistent presence of the _supportsBerachain flag
across wallet implementations; add a readonly _supportsBerachain = true property
to each wallet class that otherwise supports EVM signing (e.g., KeepKeyHDWallet,
LedgerHDWallet and their subpackage variants, NativeHDWallet/NativeVault,
TrezorConnectWallet, Keplr/Seeker implementations) so they match the pattern
used in TrezorHDWallet and other EVM second-class chains; update the class
definitions where missing, ensure exports/types compile, and run unit/build
checks to confirm no breaking changes.

---

Nitpick comments:
In @.beads/ss-dx5.5.json:
- Line 7: Update the "status" value in the JSON from "open" to "closed" (or an
appropriate completed state) and edit the "notes" checklist so items implemented
in this PR are checked ([x]) while leaving deferred items unchecked;
specifically mark chain-adapters, caip, feature-flag, plugin, env-config,
fee-asset-config and the two RELAY ACTIVATION lines (Add to
chainIdToRelayChainId and Add native asset case) as completed [x], and leave
asset-service and icon/logo unchecked. Ensure the "notes" string preserves
formatting and only the checklist markers are changed.

In @.env.development:
- Line 67: Lint flags indicate two .env keys are out of alphabetical order:
VITE_BERACHAIN_NODE_URL and VITE_FEATURE_BERACHAIN; to fix, move
VITE_BERACHAIN_NODE_URL so it appears alphabetically before
VITE_BNBSMARTCHAIN_NODE_URL and move VITE_FEATURE_BERACHAIN so it appears
alphabetically before VITE_FEATURE_CETUS_SWAP (or reorder the surrounding
section alphabetically), ensuring the variable names and their values remain
unchanged.

In `@src/plugins/berachain/index.tsx`:
- Around line 25-35: The code calls fromAssetId(asset.assetId) twice — once in
the filter and again in the map — causing redundant parsing; change the pipeline
to parse once per asset (e.g., replace the filter+map with a single pass that
extracts parsed = fromAssetId(asset.assetId) and uses
parsed.chainId/parsed.assetNamespace to filter and parsed.assetReference for
contractAddress) so functions like fromAssetId, filter, and map operate on the
parsed result for each asset rather than re-parsing.

In `@src/vite-env.d.ts`:
- Around line 119-120: The VITE_FEATURE_BERACHAIN declaration is grouped under
"URLs and API keys" but should be with other feature flags for consistency; move
the line declaring readonly VITE_FEATURE_BERACHAIN into the "Feature flags –
present in all envs" block alongside VITE_FEATURE_INK and VITE_INK_NODE_URL,
updating the surrounding comment blocks so feature flags are grouped together
while leaving the interface flat and unchanged otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for missing Relay.link EVM chains

2 participants