Skip to content

feat: integrate Soneium (chainId: 1868) via Relay#11930

Merged
gomesalexandre merged 71 commits intodevelopfrom
feat/integrate-soneium-relay
Feb 21, 2026
Merged

feat: integrate Soneium (chainId: 1868) via Relay#11930
gomesalexandre merged 71 commits intodevelopfrom
feat/integrate-soneium-relay

Conversation

@NeOMakinG
Copy link
Collaborator

@NeOMakinG NeOMakinG commented Feb 17, 2026

Description

Add Soneium (chainId: 1868) as a second-class EVM chain in ShapeShift Web with Relay bridge support.

This is PR 7 of 17 in a sequential chain integration series. These PRs must be reviewed and merged in order, as each builds on the previous one (stacked branches).

PR merge order:

  1. Mantle (feat: integrate Mantle (chainId 5000) as second-class EVM chain #11905)
  2. Cronos (feat: integrate Cronos (chainId 25) as second-class EVM chain #11910)
  3. Sonic (feat: integrate Sonic (eip155:146) as second-class EVM chain #11923)
  4. Unichain (feat: integrate Unichain (eip155:130) as second-class citizen via Relay #11924)
  5. BOB (feat: integrate BOB (eip155:60808) as second-class citizen #11925)
  6. Mode (feat: integrate Mode (eip155:34443) as second-class citizen #11926)
  7. Soneium (feat: integrate Soneium (chainId: 1868) via Relay #11930) ← this PR
  8. Hemi (feat: integrate Hemi (chainId: 43111) via Relay #11931)
  9. World Chain (feat: integrate World Chain (480) as second-class Relay chain #11932)
  10. Blast (feat: integrate Blast (81457) as second-class Relay chain #11933)
  11. zkSync Era (feat: integrate zkSync Era (324) as second-class Relay chain #11934)
  12. Story (feat: integrate Story (1514) as second-class Relay chain #11936)
  13. Plume (feat: integrate Plume (98866) as second-class Relay chain #11937)
  14. Flow EVM (feat: integrate Flow EVM (747) as second-class Relay chain #11938)
  15. Celo (feat: integrate Celo (42220) as second-class Relay chain #11939)
  16. Ethereal (feat: integrate Ethereal (5064014) as second-class Relay chain #11940)

Note: Linea (#11922) is already in develop.

Changes:

  • Plugin registration in src/plugins/soneium/
  • Feature flag Soneium in preferencesSlice
  • Relay swapper chain mapping in RelaySwapper/constant.ts
  • Across swapper chain mapping in AcrossSwapper/constant.ts
  • Asset data generation via CoinGecko (soneium)
  • Environment config for RPC URL

Chain details:

Issue (if applicable)

Part of #11902

Risk

Low risk — new chain behind feature flag (Soneium), no existing functionality affected.

New chain plugin + Relay bridge mapping. No modifications to existing chain logic.

Testing

Engineering

  1. Enable feature flag: set VITE_FEATURE_SONEIUM=true in .env
  2. Verify chain appears in supported chains list
  3. Verify native token balance loads (connect wallet with ETH on Soneium)
  4. Verify Relay bridge quote works: bridge ETH from Ethereum → Soneium
  5. Run yarn lint --fix && yarn type-check — must pass

Operations

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

Screenshots (if applicable)

N/A — chain integration, no UI changes.

Summary by CodeRabbit

  • New Features
    • Added Soneium network: selectable network, portfolio tracking, native ETH-like asset, fee asset, and explorer links.
    • Wallet & swapper support: major wallets and swap integrations can interact with Soneium assets and perform transactions.
    • Market & discovery: Soneium assets included in popular assets, market data, and price lookups when enabled.
  • Feature Flags
    • Soneium gated behind a feature flag and runtime node URL for opt-in activation.

…Relay bridge support

Add support for Mantle (MNT native gas) including CAIP constants, chain adapter,
plugin, feature flag, Relay swapper mapping, HDWallet support flags, CSP headers,
asset generation script, and all required shared-file entries.

Part of #11902
…lay bridge support

Add support for Cronos (CRO native gas) including CAIP constants, chain adapter,
plugin, feature flag, Relay swapper mapping, HDWallet support flags, CSP headers,
asset generation script, and all required shared-file entries.

Part of #11902
Add src/lib/utils/mantle.ts with getMantleTransactionStatus using
eth_getTransactionReceipt via the Mantle RPC.

Add KnownChainIds.MantleMainnet case to useSendActionSubscriber.tsx
so Mantle transactions resolve in the action center.
Add src/lib/utils/cronos.ts with getCronosTransactionStatus using
eth_getTransactionReceipt via the Cronos RPC.

Add KnownChainIds.CronosMainnet case to useSendActionSubscriber.tsx
so Cronos transactions resolve in the action center.

Add CHAIN_REFERENCE.CronosMainnet case to relayTokenToAssetId.ts
to prevent runtime crash on Relay swaps involving Cronos.
Address PR review feedback:
- Add mantleChainId to getCoingeckoSupportedChainIds (feature-flagged)
- Add mantle to ZERION_CHAINS array and ZERION_CHAINS_MAP
- Across does not support Mantle, skipped
Address PR review feedback:
- Add cronosChainId to getCoingeckoSupportedChainIds (feature-flagged)
- Add cronos to ZERION_CHAINS array and ZERION_CHAINS_MAP
- Across does not support Cronos, skipped
Adds full Unichain support including:
- CAIP constants, types, and chain adapter
- HDWallet support flags across all wallet implementations
- Relay and Across swapper mappings
- CoinGecko adapter with unichain platform
- Zerion chain mapping
- Feature flag, plugin, CSP headers
- Portfolio, account, asset service, and market integrations
- Asset generation scripts and related asset index (ETH-native)

Part of #11902
Mode (eip155:34443) sorts before MegaEth (eip155:4326) in coingeckoToAssetIds.
Add missing Mode entry to market-service test destructuring and expected array.
The BOB adapter.json (eip155_60808) was created but not imported/exported
from the generated index.ts, causing coingeckoToAssetIds to not return BOB.
Also fix ethereum assetId ordering and add BOB to market-service test.
The Unichain adapter.json (eip155_130) was created but not imported/exported
from the generated index.ts, causing coingeckoToAssetIds to not return Unichain.
The Sonic adapter.json (eip155_146) was created but not imported/exported
from the generated index.ts, preventing CoinGecko mapping for Sonic tokens.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 17, 2026

Warning

Rate limit exceeded

@gomesalexandre has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 1 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Adds Soneium (eip155:1868) as a second-class EVM chain across the codebase: env vars and feature flag, CAIP constants, adapters/clients, wallet capability flags, asset generation/mappings, swapper integration, CSP, plugin registration, feature-gated UI and tests.

Changes

Cohort / File(s) Summary
Environment & Config
\.env, \.env.development, src/vite-env.d.ts, src/config.ts
Add VITE_SONEIUM_NODE_URL and VITE_FEATURE_SONEIUM and expose them in config/types.
CAIP Constants & Types
packages/caip/src/constants.ts, packages/types/src/base.ts, packages/types/src/zerion.ts
Add soneiumAssetId, soneiumChainId (eip155:1868) and KnownChainIds.SoneiumMainnet; wire into Zerion map.
Chain Adapters & Clients
packages/chain-adapters/src/evm/..., packages/chain-adapters/src/evm/soneium/*, packages/contracts/src/viemClient.ts, packages/contracts/src/ethersProviderSingleton.ts
Add SoneiumChainAdapter, register exports, add viem/ethers clients, and include chainId in EVM adapters/provider mapping.
SecondClassEvm / Tx Status
packages/chain-adapters/src/evm/SecondClassEvmAdapter.ts, src/lib/utils/soneium.ts, src/hooks/useActionCenterSubscribers/useSendActionSubscriber.tsx, .claude/contracts/second-class-evm-chain.md
Expose generic getTransactionStatus on SecondClassEvmAdapter; add Soneium-specific tx status util and consolidate second-class EVM polling paths.
HDWallet Support & Guards
packages/hdwallet-core/src/*, various packages/hdwallet-*/src/*
Add _supportsSoneium flags, supportsSoneium guard, and update wallet implementations (true/false per wallet).
Assets / Asset Data Pipeline
packages/utils/src/assetData/*, scripts/generateAssetData/*, scripts/generateAssetData/soneium/index.ts
Add soneium base asset, include in generateAssetData pipeline, related-asset index, and coingecko generator.
Coingecko Adapter & Tests
packages/caip/src/adapters/coingecko/*, src/lib/market-service/coingecko/coingecko.test.ts
Add Coingecko platform mapping for Soneium and update parsing/tests to include Soneium assets.
Swapper Mappings
packages/swapper/src/swappers/.../constant.ts, .../relayTokenToAssetId.ts
Add Soneium to Across/Relay chain ID mappings and native asset resolution.
CSP Headers
headers/csps/chains/soneium.ts, headers/csps/index.ts
Add CSP connect-src entry for VITE_SONEIUM_NODE_URL and register it.
Plugin & Runtime Wiring
src/plugins/soneium/index.tsx, src/plugins/activePlugins.ts, src/context/PluginProvider/PluginProvider.tsx
Register Soneium plugin and adapter; gate chain inclusion by FeatureFlags.Soneium.
App Feature Flags, State & UI
src/state/..., src/pages/Markets/..., src/components/TradeAssetSearch/hooks/useGetPopularAssetsQuery.tsx, src/lib/asset-service/service/AssetService.ts
Add Soneium feature flag, preferences/state wiring, mock store flag, feature-gated filtering in UI and asset service; add migration entry.
Misc / Utilities
packages/caip/src/adapters/coingecko/utils.ts, src/lib/account/evm.ts, packages/utils/src/*, src/state/slices/*
Wire Soneium into token parsing, account wallet checks, fee-asset mapping, chain short name, portfolio utilities, and opportunities mapping.
Planning Artifact
.beads/ss-dx5.21.json, .beads/pr-context.jsonl
Add epic/task JSON documenting Soneium/OP-Stack L2 integration and update PR context entries.

Sequence Diagram(s)

sequenceDiagram
  participant UI as User/UI
  participant Plugin as PluginProvider (Soneium)
  participant Adapter as SoneiumChainAdapter
  participant Client as ViemClient
  participant RPC as Soneium RPC

  UI->>Plugin: register() (reads VITE_SONEIUM_NODE_URL, feature flag)
  Plugin->>Adapter: construct(adapter args, getKnownTokens)
  UI->>Adapter: submit tx / query status (txHash)
  Adapter->>Client: request tx receipt (public client)
  Client->>RPC: HTTP JSON-RPC eth_getTransactionReceipt
  RPC-->>Client: tx receipt
  Client-->>Adapter: return receipt/status
  Adapter-->>UI: TxStatus (Confirmed/Failed/Unknown)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

high risk

Suggested reviewers

  • NeOMakinG

Poem

🐰 A rabbit hops, new chain in paw,
Soneium springs to life — hurrah!
Adapters, flags, and assets align,
RPCs hum, transactions shine.
Hooray for hops and integration law!

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: integrating Soneium (chainId: 1868) via Relay, which directly matches the primary objective of this PR.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/integrate-soneium-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 8 commits February 19, 2026 12:27
…tle-relay

# Conflicts:
#	.env
#	.env.development
#	packages/caip/src/adapters/coingecko/generated/index.ts
#	packages/caip/src/adapters/coingecko/index.ts
#	packages/caip/src/adapters/coingecko/utils.test.ts
#	packages/caip/src/adapters/coingecko/utils.ts
#	packages/caip/src/constants.ts
#	packages/chain-adapters/src/evm/EvmBaseAdapter.ts
#	packages/chain-adapters/src/types.ts
#	packages/contracts/src/ethersProviderSingleton.ts
#	packages/contracts/src/viemClient.ts
#	packages/hdwallet-coinbase/src/coinbase.ts
#	packages/hdwallet-core/src/ethereum.ts
#	packages/hdwallet-core/src/wallet.ts
#	packages/hdwallet-gridplus/src/gridplus.ts
#	packages/hdwallet-keepkey/src/keepkey.ts
#	packages/hdwallet-ledger/src/ledger.ts
#	packages/hdwallet-metamask-multichain/src/shapeshift-multichain.ts
#	packages/hdwallet-native/src/ethereum.ts
#	packages/hdwallet-phantom/src/phantom.ts
#	packages/hdwallet-trezor/src/trezor.ts
#	packages/hdwallet-vultisig/src/vultisig.ts
#	packages/hdwallet-walletconnectv2/src/walletconnectV2.ts
#	packages/swapper/src/swappers/RelaySwapper/constant.ts
#	packages/swapper/src/swappers/RelaySwapper/utils/relayTokenToAssetId.ts
#	packages/types/src/base.ts
#	packages/types/src/zerion.ts
#	packages/utils/src/assetData/baseAssets.ts
#	packages/utils/src/assetData/getBaseAsset.ts
#	packages/utils/src/chainIdToFeeAssetId.ts
#	packages/utils/src/getAssetNamespaceFromChainId.ts
#	packages/utils/src/getChainShortName.ts
#	packages/utils/src/getNativeFeeAssetReference.ts
#	scripts/generateAssetData/coingecko.ts
#	scripts/generateAssetData/generateAssetData.ts
#	src/components/TradeAssetSearch/hooks/useGetPopularAssetsQuery.tsx
#	src/config.ts
#	src/constants/chains.ts
#	src/hooks/useActionCenterSubscribers/useSendActionSubscriber.tsx
#	src/hooks/useWalletSupportsChain/useWalletSupportsChain.ts
#	src/lib/account/evm.ts
#	src/lib/asset-service/service/AssetService.ts
#	src/lib/coingecko/utils.ts
#	src/pages/Markets/components/MarketsRow.tsx
#	src/state/slices/portfolioSlice/utils/index.ts
#	src/state/slices/preferencesSlice/preferencesSlice.ts
#	src/test/mocks/store.ts
#	src/vite-env.d.ts
gomesalexandre and others added 2 commits February 21, 2026 13:29
- Remove duplicate Sonic enum entries (sonic-3 vs sonic)
- Remove duplicate Sonic baseAsset icon/networkIcon
- Deduplicate ethAssetId related asset arrays
- Add soneiumAssetId to generateChainRelatedAssetIndex
- Fix coingecko index.test.ts assertion ordering (remove duplicate ethOnBob)
- Bump market service test counts (flatten=13, rate limited=12)
- Add migration 300 for Soneium
- Add VITE_SONEIUM_NODE_URL and VITE_FEATURE_SONEIUM to vite-env.d.ts
- Regenerate Soneium chain assets

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Merge all squash-merged chain PRs (Cronos, Sonic, Unichain, BOB, Mode)
- Fix duplicate market service test assertions
- Regenerate Soneium assets

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gomesalexandre gomesalexandre force-pushed the feat/integrate-soneium-relay branch from c399854 to 14bfdd7 Compare February 21, 2026 12:42
gomesalexandre and others added 2 commits February 21, 2026 14:16
…fallback

- fix BOB/Unichain/Mode broken network icons (CoinGecko 403s)
- rename Sonic to Sonic (S) for searchability
- collapse all EVM chain cases in useSendActionSubscriber into generic default
- add WETH9 Withdrawal event fallback in parseTx for chains where
  debug_traceTransaction is unsupported and WETH.withdraw() doesn't emit
  Transfer-to-zero (OP Stack L2s, Across bridge fills)
- regenerate compressed asset data with fixed icons

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gomesalexandre gomesalexandre marked this pull request as ready for review February 21, 2026 14:08
@gomesalexandre gomesalexandre requested a review from a team as a code owner February 21, 2026 14:08
The native tokens for Sonic (S) and Cronos (CRO) had relatedAssetKey
pointing to their Ethereum ERC20 counterparts (ETH FTM and ETH CRO),
making isPrimary=false. This caused them to be excluded from
selectPrimaryAssets and missing from "Popular Assets" when filtering
by chain.

Fix: flip the manual index entries so native chain tokens are the KEY
(primary) and ETH ERC20 tokens are values. This makes the native tokens
self-referencing (relatedAssetKey === assetId) → isPrimary=true.

ETH-native chains (Unichain, Optimism, etc.) are unaffected - they
correctly point to ethAssetId as their relatedAssetKey because they
ARE ETH, just on a different chain.

Also updates the second-class-evm-chain contract to reflect:
- Generic tx status handling (no per-chain util files needed)
- WETH9 Withdrawal event fallback in parseTx
- Critical note about native tokens needing to be KEYS in manual index

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/caip/src/adapters/coingecko/index.test.ts (1)

102-121: ⚠️ Potential issue | 🔴 Critical

CI failure: generated adapter data not regenerated.

The coingeckoToAssetIds('ethereum') test expects ethOnSoneium (eip155:1868/slip44:60) to be present but the generated file(s) under packages/caip/src/adapters/coingecko/generated/ haven't been updated, causing the assertion to receive only 10 items. The Soneium entry needs to be committed after running the CoinGecko adapter generation script.

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

In `@packages/caip/src/adapters/coingecko/index.test.ts` around lines 102 - 121,
The test failure is caused by missing regenerated adapter data: ensure the
CoinGecko adapter generation is re-run so the generated adapter files include
the ethOnSoneium entry referenced by the test (coingeckoToAssetIds('ethereum')
expecting ethOnSoneium/eip155:1868/slip44:60); run the repository's CoinGecko
generation script for the adapters, verify coingeckoToAssetIds now returns the
full list including ethOnSoneium, and commit the updated generated adapter files
(and any updated snapshots) to the PR.
🧹 Nitpick comments (3)
.env (1)

169-169: VITE_SONEIUM_* keys should precede their VITE_SONIC_* counterparts.

Alphabetically SONEIUM < SONIC (E < I at the 4th character). Both VITE_SONEIUM_NODE_URL (Line 169) and VITE_FEATURE_SONEIUM (Line 328) should be placed before VITE_SONIC_NODE_URL (Line 165) and VITE_FEATURE_SONIC (Line 324), respectively. This is flagged by dotenv-linter.

Also applies to: 328-328

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

In @.env at line 169, Reorder the environment variable entries so any
VITE_SONEIUM_* keys come before their VITE_SONIC_* counterparts: move
VITE_SONEIUM_NODE_URL so it appears before VITE_SONIC_NODE_URL and move
VITE_FEATURE_SONEIUM so it appears before VITE_FEATURE_SONIC; this resolves
dotenv-linter alphabetical ordering (ensure you only change the order of the
lines containing VITE_SONEIUM_NODE_URL, VITE_SONIC_NODE_URL,
VITE_FEATURE_SONEIUM, and VITE_FEATURE_SONIC and keep their values intact).
src/lib/utils/soneium.ts (1)

39-42: console.error instead of the project's structured logger.

Per coding guidelines, errors should use structured logging with relevant context rather than bare console.error.

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

In `@src/lib/utils/soneium.ts` around lines 39 - 42, Replace the bare
console.error in the catch block of the getTransactionStatus function with the
project's structured logger: call the shared logger instance (e.g., logger.error
or processLogger.error) and pass a descriptive message plus the caught error
object and any available context (transaction hash, network, etc.), then return
TxStatus.Unknown as before; update the import/use of the logger in
src/lib/utils/soneium.ts if necessary.
packages/chain-adapters/src/evm/soneium/SoneiumChainAdapter.ts (1)

40-46: Add explicit return type annotations to getDisplayName and getName.

Both methods lack return type annotations. Per coding guidelines, all functions must have explicit return types in TypeScript.

♻️ Proposed fix
-  getDisplayName() {
+  getDisplayName(): ChainAdapterDisplayName {
     return ChainAdapterDisplayName.Soneium
   }

-  getName() {
+  getName(): string {
     return 'Soneium'
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/chain-adapters/src/evm/soneium/SoneiumChainAdapter.ts` around lines
40 - 46, Add explicit TypeScript return type annotations to the two methods in
SoneiumChainAdapter: change getDisplayName to declare a return type of
ChainAdapterDisplayName and change getName to declare a return type of string;
update the method signatures (getDisplayName(): ChainAdapterDisplayName and
getName(): string) to satisfy the coding guideline and ensure the
ChainAdapterDisplayName symbol is available/imported if not already.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/chain-adapters/src/evm/soneium/SoneiumChainAdapter.ts`:
- Around line 18-20: The isSoneiumChainAdapter type-guard currently casts
adapter to ChainAdapter and calls getType(), which will throw for
null/undefined; update isSoneiumChainAdapter to first defensively check adapter
!= null and typeof (adapter as ChainAdapter).getType === 'function' before
calling getType(), then compare the returned value to
KnownChainIds.SoneiumMainnet so the function returns false for null/undefined or
non-adapter inputs instead of throwing.

---

Outside diff comments:
In `@packages/caip/src/adapters/coingecko/index.test.ts`:
- Around line 102-121: The test failure is caused by missing regenerated adapter
data: ensure the CoinGecko adapter generation is re-run so the generated adapter
files include the ethOnSoneium entry referenced by the test
(coingeckoToAssetIds('ethereum') expecting ethOnSoneium/eip155:1868/slip44:60);
run the repository's CoinGecko generation script for the adapters, verify
coingeckoToAssetIds now returns the full list including ethOnSoneium, and commit
the updated generated adapter files (and any updated snapshots) to the PR.

---

Nitpick comments:
In @.env:
- Line 169: Reorder the environment variable entries so any VITE_SONEIUM_* keys
come before their VITE_SONIC_* counterparts: move VITE_SONEIUM_NODE_URL so it
appears before VITE_SONIC_NODE_URL and move VITE_FEATURE_SONEIUM so it appears
before VITE_FEATURE_SONIC; this resolves dotenv-linter alphabetical ordering
(ensure you only change the order of the lines containing VITE_SONEIUM_NODE_URL,
VITE_SONIC_NODE_URL, VITE_FEATURE_SONEIUM, and VITE_FEATURE_SONIC and keep their
values intact).

In `@packages/chain-adapters/src/evm/soneium/SoneiumChainAdapter.ts`:
- Around line 40-46: Add explicit TypeScript return type annotations to the two
methods in SoneiumChainAdapter: change getDisplayName to declare a return type
of ChainAdapterDisplayName and change getName to declare a return type of
string; update the method signatures (getDisplayName(): ChainAdapterDisplayName
and getName(): string) to satisfy the coding guideline and ensure the
ChainAdapterDisplayName symbol is available/imported if not already.

In `@src/lib/utils/soneium.ts`:
- Around line 39-42: Replace the bare console.error in the catch block of the
getTransactionStatus function with the project's structured logger: call the
shared logger instance (e.g., logger.error or processLogger.error) and pass a
descriptive message plus the caught error object and any available context
(transaction hash, network, etc.), then return TxStatus.Unknown as before;
update the import/use of the logger in src/lib/utils/soneium.ts if necessary.

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.

Happy on all counts for all chains from Mantle through Soneium:

  • ✅ Execution price (cross-chain swap via Across/Relay)
  • ✅ Outbound native asset Tx history (parseTx with WETH9 Withdrawal fallback)
  • ✅ Network icons (BOB, Unichain, Mode fixed)
  • ✅ Popular assets initial set (Sonic (S) and CRO now primary)
  • ✅ Popular asset search
  • ✅ Related assets

https://jam.dev/c/2f6f70f2-9c78-44b5-b6cd-a4b59aa0d9e2

@gomesalexandre gomesalexandre enabled auto-merge (squash) February 21, 2026 14:25
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: 1

🧹 Nitpick comments (1)
packages/chain-adapters/src/evm/SecondClassEvmAdapter.ts (1)

476-495: WITHDRAWAL_TOPIC should live at module scope

Defining it inside parseTx (inside a nested if) buries it alongside executable logic. Moving it to module level makes it as discoverable as BATCH_SIZE and the ERC20_ABI constant above.

♻️ Proposed refactor
+const WETH9_WITHDRAWAL_TOPIC =
+  '0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65'
+
 const BATCH_SIZE = 500
-        // Fallback: WETH9 Withdrawal(address indexed src, uint256 wad) event
-        // On OP Stack L2s and other chains, WETH.withdraw() emits Withdrawal instead of Transfer-to-zero
         if (internalTxs.length === 0) {
-          const WITHDRAWAL_TOPIC =
-            '0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65'
           const withdrawalLogs = receipt.logs.filter(
             log =>
               log.address &&
               isAddressEqual(getAddress(log.address), getAddress(wrappedNativeContract)) &&
-              log.topics[0] === WITHDRAWAL_TOPIC,
+              log.topics[0] === WETH9_WITHDRAWAL_TOPIC,
           )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/chain-adapters/src/evm/SecondClassEvmAdapter.ts` around lines 476 -
495, The WITHDRAWAL_TOPIC constant is declared inside parseTx's fallback block
which buries a reusable ABI/topic constant in executable logic; lift the topic
declaration to module scope (alongside BATCH_SIZE and ERC20_ABI) as a top-level
constant (e.g., export or const WITHDRAWAL_TOPIC = '0x7fcf...b65') and update
the code inside SecondClassEvmAdapter.parseTx to reference that top-level
WITHDRAWAL_TOPIC when filtering receipt.logs (the logic that checks log.address
against wrappedNativeContract and compares log.topics[0] should remain
unchanged).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/hooks/useActionCenterSubscribers/useSendActionSubscriber.tsx`:
- Around line 262-271: The early return inside the default branch when
getSecondClassEvmTxStatus(chainId, txHash) returns undefined leaves the interval
running and the pollingKey in pollingIntervalsRef.current; update the default
branch in checkTxStatus to clear the interval and remove its entry from
pollingIntervalsRef.current before returning (use the existing pollingKey /
stored interval id), so the interval stops and the pollingKey is cleaned up to
avoid the Pending action being stuck; reference functions/vars:
getSecondClassEvmTxStatus, checkTxStatus, pollingKey,
pollingIntervalsRef.current.

---

Nitpick comments:
In `@packages/chain-adapters/src/evm/SecondClassEvmAdapter.ts`:
- Around line 476-495: The WITHDRAWAL_TOPIC constant is declared inside
parseTx's fallback block which buries a reusable ABI/topic constant in
executable logic; lift the topic declaration to module scope (alongside
BATCH_SIZE and ERC20_ABI) as a top-level constant (e.g., export or const
WITHDRAWAL_TOPIC = '0x7fcf...b65') and update the code inside
SecondClassEvmAdapter.parseTx to reference that top-level WITHDRAWAL_TOPIC when
filtering receipt.logs (the logic that checks log.address against
wrappedNativeContract and compares log.topics[0] should remain unchanged).

The adapter JSON existed but wasn't imported/exported from the generated
index.ts, causing coingeckoToAssetIds('ethereum') to not include
Soneium's ETH asset ID.

Also updates contract to explicitly call out the generated index file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gomesalexandre gomesalexandre merged commit 537e416 into develop Feb 21, 2026
6 checks passed
@gomesalexandre gomesalexandre deleted the feat/integrate-soneium-relay branch February 21, 2026 14:47
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.

2 participants