Skip to content

feat: add support for MegaETH network#1893

Closed
Vinicius-Fiorio wants to merge 1 commit intoProjectOpenSea:mainfrom
Vinicius-Fiorio:feat/add-megaeth
Closed

feat: add support for MegaETH network#1893
Vinicius-Fiorio wants to merge 1 commit intoProjectOpenSea:mainfrom
Vinicius-Fiorio:feat/add-megaeth

Conversation

@Vinicius-Fiorio
Copy link
Contributor

Add Support for MegaETH

This PR adds full support for MegaETH (Chain.MegaETH) to the opensea-js

The integration follows the existing multi-chain architecture and mirrors the implementation pattern used for other alternate-protocol chains such as Gunzilla and Somnia.

No breaking changes were introduced.


Changes Included

1. Chain Integration

  • Added Chain.MegaETH
  • Added chain ID mapping:
case Chain.MegaETH:
  return "4326";

2. Alternate Protocol Routing

MegaETH uses the alternate Seaport deployment.

Updated:

export const usesAlternateProtocol = (chain: Chain): boolean =>
  chain === Chain.Gunzilla || chain === Chain.Somnia || chain === Chain.MegaETH;

As a result, MegaETH now correctly resolves to:

  • ALTERNATE_SEAPORT_V1_6_ADDRESS
  • ALTERNATE_CONDUIT_ADDRESS
  • ALTERNATE_SIGNED_ZONE_V2_ADDRESS

via:

  • getSeaportAddress
  • getDefaultConduit
  • getSignedZone

3. Fee Recipient

Added a dedicated fee recipient constant:

export const MEGAETH_FEE_RECIPIENT =
  "0x07D3A100c3880830dD43FE5C938B5144721Ce9D6";

Integrated inside getFeeRecipient into:

case Chain.MegaETH:
  return MEGAETH_FEE_RECIPIENT;

4. Offer Payment Token

MegaETH uses the standard OP-stack wrapped ETH address:

0x4200000000000000000000000000000000000006

Added to:

  • getOfferPaymentToken
  • getNativeWrapTokenAddress (via default flow)

5. Listing Payment Token

Listings on MegaETH use native ETH:

0x0000000000000000000000000000000000000000

Integrated into getListingPaymentToken.


6. Test Coverage

Added basic test cases in chain.spec.ts covering:

  • Chain ID resolution
  • Alternate protocol detection
  • Fee recipient selection
  • Default offer and listing token behavior

All tests pass successfully.


Architectural Consistency

The implementation:

  • Follows the existing switch-case structure
  • Reuses shared alternate protocol constants
  • Keeps fee logic isolated per chain
  • Maintains backward compatibility

@ryanio ryanio mentioned this pull request Feb 11, 2026
2 tasks
@ryanio
Copy link
Collaborator

ryanio commented Feb 11, 2026

Thanks for the contribution! We've incorporated your changes with some cleanup in #1896 (renamed the fee recipient constant, fixed a test bug, and adjusted the chain grouping). Closing this in favor of that PR.

@ryanio
Copy link
Collaborator

ryanio commented Feb 11, 2026

#1896

@ryanio ryanio closed this Feb 11, 2026
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