Files
smom-dbis-138/metamask/QUICK_START.md
defiQUG 1fb7266469 Add Oracle Aggregator and CCIP Integration
- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control.
- Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities.
- Created .gitmodules to include OpenZeppelin contracts as a submodule.
- Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment.
- Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks.
- Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring.
- Created scripts for resource import and usage validation across non-US regions.
- Added tests for CCIP error handling and integration to ensure robust functionality.
- Included various new files and directories for the orchestration portal and deployment scripts.
2025-12-12 14:57:48 -08:00

2.7 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.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.d-bis.org
  • 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 */]
    });
  }
}