> For the complete documentation index, see [llms.txt](https://docs.coin98.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coin98.com/developer-guide/near-dapps-integration.md).

# 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:

```javascript
if(window.coin98 || window.coin98.near || window.near?.isCoin98){
    console.log('Coin98 Extension is installed!');›
}
```

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).

```javascript
// Connect DApps
window.coin98.near.connect(<Prefix: optional>,<Contract ID: optional>);
// Get Account
window.coin98.near.selectedAddress;
// Get Full Accounts State
window.coin98.near.request({ method: 'near_accountState' });
// Check if DApps connected
window.coin98.near.isConnected();
```

***

## To disconnect Coin98 Extension Wallet

To disconnect Coin98 Extension, please use:

```
window.coin98.near.disconnect()
```

## To experience functions

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

### Call View Method

```javascript
const params = {
    contractId: 'token.v2.ref-finance.near',
    method: 'ft_balance_of',
    args: {
        account_id: account
    }
}
const balance = await window.coin98?.near.request({method: 'near_view', params})
console.log("Your near wallet balance ", balance)
```

### SignAndSend Transaction

```javascript
const params = {
    transactions,
    receiver: account
}

const result = await window.coin98?.near.request({method: 'near_signAndSendTransaction', params})
const balance = await window.coin98?.near.request({method: 'near_view', params})
console.log("Your near wallet balance ", balance)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.coin98.com/developer-guide/near-dapps-integration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
