# Kaia network

D'CENT mobile app's in-app browser injects `window.klaytn` & `window.caver` as providers. If your dapp is based on Klaytn network, you can interact with D'CENT wallet through `window.klaytn` & `window.caver` providers.

## If your dapp is already integrated with Kaikas

D'CENT wallet's provider uses the same provider interface with Kaikas. It means if your dapp is already integrated with Kaikas, it's very easy to integrate with D'CENT wallet.&#x20;

For your reference, you can also find the Kaikas' developer guide in the below link.

* Kaikas Developer Guide : <https://docs.kaikas.io/>

## How to detect in-app browser

In order to check if your dapp running on Klaytn is supported dapp-browser, you need to check whether `window.klaytn` is defined.

```javascript
if (typeof window.klaytn !== 'undefined') {
    console.log("It's in-app browser");
}
```

### How to check D'CENT provider

You can check whether the dapp browser is D'CENT wallet's in-app browser with the following code.

```javascript
if (window.klaytn.isDcentWallet === true) {
    console.log("It's D'CENT wallet's in-app browser")
}
```

## Connect to Wallet

You can use the following code in order to connect to D'CENT wallet's account.

```javascript
klaytn.enable()
```

### Wallet Connection UI

If the connection to wallet is requested, you can see the popup like below.

<figure><img src="/files/msN6NccK4en5JOGhJ3wR" alt="" width="188"><figcaption></figcaption></figure>

## Get the current network

To get the current network ID, you can use the following code.

```javascript
klaytn.networkVersion
```

By checking the network ID, you can know which network is currently connected to.&#x20;

| Network ID | Network Name |
| ---------- | ------------ |
| 8217       | Kaia Mainnet |
| 1001       | Kaia Kairos  |

## Get the current account's address

To get the address of the current account, you can use the following code.

```javascript
klaytn.selectedAddress
```

## Send Transaction

By using `ethereum.sendAsync` method to call `klay_sendTransaction`, you can send the transaction. The following is the example code to show how to send the transaction. (This example is copied from [Kaikas docs](https://docs.kaikas.io/01_getting_started/03_sending_transactions))

```javascript
const transactionParameters = {
  gas: '0x2710',
  to: '0x0000000000000000000000000000000000000000',
  from: klaytn.selectedAddress,
  value: '0xff'
}

klaytn.sendAsync(
  {
    method: 'klay_sendTransaction',
    params: [transactionParameters],
    from: klaytn.selectedAddress
  },
  callback
)
```

You can also see more examples on the Kaikas Developer Guide.

* More Examples : <https://docs.kaikas.io/01_getting_started/03_sending_transactions>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev-docs.dcentwallet.com/in-app-browser/kaia-network.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
