Coin98 Labs
Search…
Near DApps Integration
Welcome to Coin98 Extension Wallet Developer Guide. This documentation contains guides for developers to get started developing on Coin98 Extension Wallet.‌

To detect Coin98 Extension with Near

To detect whether your browser is running Coin98 Extension, please use:
1
if(window.coin98 || window.coin98.near || window.near?.isCoin98){
2
console.log('Coin98 Extension is installed!');
3
}
Copied!
Notice: Coin98 Extension Testnet is under development and not available now.
Support window.near only and removal window.web3

To connect Coin98 Extension Wallet

To connect Coin98 Extension means to access the user's [blockchain - like Near] account(s).
1
// Connect DApps
2
window.coin98.near.connect(<Prefix: optional>,<Contract ID: optional>);
3
// Get Account
4
window.coin98.near.selectedAddress;
5
// Get Full Accounts State
6
window.coin98.near.request({ method: 'near_accountState' });
7
// Check if DApps connected
8
window.coin98.near.isConnected();
Copied!

To disconnect Coin98 Extension Wallet

To disconnect Coin98 Extension, please use:
1
window.coin98.near.disconnect()
Copied!

To experience functions

Once your account is connected, let's start experiencing more functions.‌

Call View Method

1
const params = {
2
contractId: 'token.v2.ref-finance.near',
3
method: 'ft_balance_of',
4
args: {
5
account_id: account
6
}
7
}
8
const balance = await window.coin98?.near.request({method: 'near_view', params})
9
console.log("Your near wallet balance ", balance)
Copied!

SignAndSend Transaction

import {utilis} from 'near-api-js'
1
const params = {
2
transactions,
3
receiver: account
4
}
5
6
const result = await window.coin98?.near.request({method: 'near_signAndSendTransaction', params})
7
const balance = await window.coin98?.near.request({method: 'near_view', params})
8
console.log("Your near wallet balance ", balance)
Copied!
Last modified 6d ago