Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
3.0 KiB
3.0 KiB
Multi-Chain MetaMask Provider (Chain 138 + Ethereum Mainnet + ALL Mainnet)
Last Updated: 2026-01-31
Document Version: 1.0
Status: Active Documentation
Purpose: Single provider for MetaMask and other Web3 wallets to connect to ChainID 138 (DeFi Oracle Meta Mainnet), Ethereum Mainnet (1), and ALL Mainnet (651940), with a combined token list and oracle support so tokens and price feeds work across chains.
Overview
| Item | Chain 138 | Ethereum Mainnet | ALL Mainnet |
|---|---|---|---|
| Chain ID | 138 (0x8a) |
1 (0x1) |
651940 (0x9f2c4) |
| Name | DeFi Oracle Meta Mainnet | Ethereum Mainnet | ALL Mainnet |
| RPC | https://rpc-http-pub.d-bis.org, etc. |
https://eth.llamarpc.com, etc. |
https://mainnet-rpc.alltra.global |
| Explorer | https://explorer.d-bis.org | https://etherscan.io | https://alltra.global |
| ETH/USD Oracle | 0x3304b747e565a97ec8ac220b0b6a1f6ffdb837e6 |
0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419 (Chainlink) |
— |
Files
| File | Description |
|---|---|
| DUAL_CHAIN_NETWORKS.json | Chain params for Chain 138, Ethereum Mainnet, and ALL Mainnet (wallet_addEthereumChain). |
| DUAL_CHAIN_TOKEN_LIST.tokenlist.json | Combined token list for Chain 138, Mainnet, and ALL Mainnet (Uniswap token list format). |
| Provider module | metamask-integration/provider/ — JS module with addChainsToWallet, switchChain, getEthUsdPrice, getTokensByChain, etc. |
| Token-aggregation API | GET /api/v1/networks, GET /api/v1/config — dynamic chain params and oracles for the MetaMask Snap. Token list URL: {apiBase}/api/v1/report/token-list. |
Usage in dApps
-
Add chains to MetaMask
- Use
addChainsToWallet(window.ethereum)from the provider (optionally pass{ chains: [138, 1, 651940] }), or - Call
wallet_addEthereumChainfor each chain usingDUAL_CHAIN_NETWORKS.json.
- Use
-
Token list
- Use the provider’s
getTokensByChain(138)andgetTokensByChain(1)for UI andwallet_watchAsset, or - Point MetaMask/dApp token list URL to the hosted DUAL_CHAIN_TOKEN_LIST.tokenlist.json.
- Use the provider’s
-
Oracles
- Chain 138: Oracle Publisher service should be running so the ETH/USD feed at
0x3304b747e565a97ec8ac220b0b6a1f6ffdb837e6is updated. - Mainnet: Chainlink ETH/USD is maintained by Chainlink.
- In your dApp, use the provider’s
getEthUsdPrice(provider, chainId)to read the active chain’s ETH/USD and display USD values (MetaMask does not read these oracles automatically).
- Chain 138: Oracle Publisher service should be running so the ETH/USD feed at
Token list contents
- Chain 138: ETH/USD oracle, WETH, WETH10, cUSDT, cUSDC.
- Ethereum Mainnet: WETH, USDT, USDC, DAI, ETH/USD (Chainlink).
See DUAL_CHAIN_TOKEN_LIST.tokenlist.json for full list and tags.
Related docs
- Oracle setup:
ORACLE_PRICE_FEED_SETUP.md - WETH/Oracle quick ref:
WETH_ORACLE_QUICK_REFERENCE.md - Provider API:
metamask-integration/provider/README.md
Last updated: 2026-01-30