This document guides user how to integrate EVM-compatible Blockchains for DApps. This will apply to all the EVM-compatible Blockchains currently supported in Coin98 Wallet.
Supported EVM-compatible Blockchains
Ethereum
Viction
BNB Smart Chain
Polygon
Avalanche C-Chain
Arbitrum
Aurora
Base
Bittorrent Chain
Boba Network
Celo
Chiliz
Conflux
Core
Cronos
Ethereum PoW
f(x) Core EVM
Fantom
GateChain
Gnosis Chain
Harmony
HECO Chain
Humanode
KardiaChain
Klaytn
Kroma
KuCoin Commnunity Chain
Linea
Mantle
Moonbeam
Nautilus
Oasis Network
OKXChain
opBNB
Optimism
PlatON Network
Polygon zkEVM
Ronin
Scroll
StarkNet Theta Network
Theta Network EVM
zkSync Era
Ancient8 (Testnet)
Base (Testnet)
Taiko Jolnir (Testnet)
Mantle (Testnet)
Scroll (Testnet)
ZetaChain (Testnet)
To detect Coin98 Wallet with EVM-compatible Blockchains
To detect whether your browser is running Coin98 Wallet, please use:
Notice: The Coin98 Wallet on EVM JavaScript provider API is specified by EIP-1193 and EIP-6963. Support window.ethereum or window.coin98.provider only (window.web3is unsupported)
To connect Coin98 Wallet
To connect Coin98 Wallet means to access the user's [blockchain - like Ethereum] account(s).
// Connect & get accountswindow.coin98.provider.request({method:'eth_accounts'});// Alias for connectionwindow.coin98.provider.request({method:'eth_requestAccounts'});//Check if dapp connectedwindow.coin98.provider.isConnected();//Check if the caller's current permissionswindow.coin98.provider.request({method:'wallet_getPermissions'});//Check if request the given permissions window.coin98.provider.request({method:'wallet_requestPermissions'});
To disconnect Coin98 Wallet
To disconnect Coin98 Wallet, please use:
window.coin98.provider.disconnect()
To experience functions
Once your account is connected, let's start experiencing more functions.
Get Current Account
return Promise<Array[String]>
If wallet can not be found, return [] instead of throw Error
window.coin98.provider.request({ method:'eth_accounts' }).then(accounts => {if (accounts[0]) {// Do something with accounts } else {// Wallet not found }})
return Promise<string>- The public encryption key of the Ethereum account whose encryption key should be retrieved
let encryptionPublicKeywindow.coin98.provider.request({ method:'eth_getEncryptionPublicKey', params: [accounts[0]],// you must have access to the specified account }).then((result) => { encryptionPublicKey = result; }).catch((error) => {if (error.code ===4001) {// EIP-1193 userRejectedRequest errorconsole.log("We can't encrypt anything without the key."); } else {console.error(error); } });
You can connect and receive multiChain address at the same time by using the following methods
asyncfunctionconnect(){if(!window.coin98){thrownewError('Coin98 Wallet is required'); }constaccounts=awaitwindow.coin98.connect([<chain 1>, <chain 2>, ...]); if(!accounts){thrownew Error('Connect Error | Usercancelyour request'); }// Do anything with accounts:[<address of chain 1>, <address of chain 2>]}
When your connection is successful, chain's properties will be available for your next request. For example:
// For example | connect ether & solanaasyncfunctionconnect(){constconn=awaitwindow.coin98.connect(['ether','solana']);// If user accept the request, those properties will available at window.coin98;// window.solana || Checkout document of solana connection guide for more methods;// window.ether || Checkout document of ether connection guide for more methods;}
Chain's Name can be found at
const { CHAIN_NAME } =window.coin98
Subscription
Support subscribe using JSON-RPC notifications. This allows clients to wait for events instead of polling for them. All results will be released at data event.
Methods
// For Subscribewindow.coin98.provider.request({ method:'eth_subscribe', params: ['<type>','<options>']})// Its result will be subscription ID which can be used for unsubscribe// For Unsubscribewindow.coin98.provider.request({ method:'eth_unsubscribe', params: ['<Subscription ID>']});
Example
// Subscribe for eventconstsubscriptionID=window.coin98.provider.request({ method:'eth_subscribe', params: ["logs", { address:"0x8320fe7702b96808f7bbc0d4a888ed1468216cfd", topics: ["0xd78a0cb8bb633d06981248b816e7bd33c2a35a6089241d099fa519e361cab902"]}]})// You can listen for incoming notifications bywindow.coin98.provider.on("data", data => {// Do the rest of your work with data})
To handle events
List of events
Currently we only support some action events from Wallet