Files
smom-dbis-138/metamask/QUICK_START.md
defiQUG 304b3b4377
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m45s
CI/CD Pipeline / Security Scanning (push) Successful in 2m41s
CI/CD Pipeline / Lint and Format (push) Failing after 52s
CI/CD Pipeline / Terraform Validation (push) Failing after 30s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 28s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 32s
Validation / validate-genesis (push) Successful in 29s
Validation / validate-terraform (push) Failing after 31s
Validation / validate-kubernetes (push) Failing after 14s
Validation / validate-smart-contracts (push) Failing after 12s
Validation / validate-security (push) Failing after 1m28s
Validation / validate-documentation (push) Failing after 20s
Align Chain 138 public RPC URLs for wallets and token-aggregation API.
Use rpc.public-0138.defi-oracle.io as canonical MetaMask addEthereumChain RPC; expand tokenDetection tokenListUrls; update tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 19:13:03 -07:00

2.9 KiB

MetaMask Quick Start for ChainID 138

Quick reference for adding ChainID 138 to MetaMask and adding tokens.

Add Network to MetaMask

Method 1: Using the SDK

import { addOrSwitchNetwork } from '@defi-oracle/metamask-sdk';

await addOrSwitchNetwork();

Method 2: Using wallet_addEthereumChain

await window.ethereum.request({
  method: 'wallet_addEthereumChain',
  params: [{
    chainId: '0x8a',
    chainName: 'DeFi Oracle Meta Mainnet',
    nativeCurrency: {
      name: 'Ether',
      symbol: 'ETH',
      decimals: 18
    },
    rpcUrls: ['https://rpc-http-pub.d-bis.org'],
    blockExplorerUrls: ['https://explorer.d-bis.org']
  }]
});

Method 3: Using Chainlist

  1. Visit chainlist.org
  2. Search for "ChainID 138" or "DeFi Oracle Meta"
  3. Click "Add to MetaMask"

Method 4: Switch to ChainID 138

await window.ethereum.request({
  method: 'wallet_switchEthereumChain',
  params: [{ chainId: '0x8a' }]
});

Add Token to MetaMask

Using the SDK

import { addToken } from '@defi-oracle/metamask-sdk';

await addToken(
  '0xYourTokenAddress',
  'WETH',
  18,
  'https://explorer.d-bis.org/images/tokens/weth.png'
);

Using wallet_watchAsset (EIP-747)

await window.ethereum.request({
  method: 'wallet_watchAsset',
  params: {
    type: 'ERC20',
    options: {
      address: '0xYourTokenAddress',
      symbol: 'WETH',
      decimals: 18,
      image: 'https://explorer.d-bis.org/images/tokens/weth.png'
    }
  }
});

Network Information

  • ChainID: 138 (0x8a)
  • Chain Name: DeFi Oracle Meta Mainnet
  • Native Currency: ETH (18 decimals)
  • RPC URL: https://rpc-http-pub.d-bis.org (aliases: rpc.d-bis.org, rpc2.d-bis.org)
  • Token list (Chain 138): https://explorer.d-bis.org/api/config/token-list or https://tokens.d-bis.org/config/token-list.json
  • Block Explorer: https://explorer.d-bis.org

Common Tokens

WETH (Wrapped Ether)

  • Address: 0x... (Update after deployment)
  • Symbol: WETH
  • Decimals: 18

Troubleshooting

MetaMask not detected

if (typeof window.ethereum === 'undefined') {
  alert('Please install MetaMask');
  window.open('https://metamask.io/download/', '_blank');
}

Network already added

If the network is already added, use wallet_switchEthereumChain instead:

try {
  await window.ethereum.request({
    method: 'wallet_switchEthereumChain',
    params: [{ chainId: '0x8a' }]
  });
} catch (error) {
  // Network not added, add it
  if (error.code === 4902) {
    await window.ethereum.request({
      method: 'wallet_addEthereumChain',
      params: [/* network metadata */]
    });
  }
}