D'CENT developer guide
Official siteUser GuideBlogTwitter
  • Introduction
  • How to Connect Your DApp to D’CENT Mobile App
  • In-app browser (dapp browser)
    • Getting Started
    • EVM compatible networks
    • Klaytn network
    • Tron network
  • Dynamic Link
    • Dynamic Link to In-app Browser
    • EIP-681 : Transaction/Payment Request
  • D'CENT WalletConnect (DWC)
    • Introduction
    • Packages
    • D'CENT WalletConnect
    • Test Environment
    • WalletConnect monorepo
  • Collectibles
    • NFT list on Collectibles tab
  • D'CENT biometric wallet for PC
    • D'CENT SDK for PC Environment
    • dcent-web-connector
      • Configurations
      • Device & Accounts Info.
      • Address & XPUB
      • Ethereum & EVM compatible
      • Klaytn
      • Bitcoin
      • XRPL (XRP Ledger)
      • Hedera (HBAR & HTS)
      • Tron (TRX & TRC20)
      • Stellar
      • Tezos (XTZ & XTZ_FA)
      • Vechain
      • Near (NEAR & Near Token)
      • Havah
      • Polkadot
      • Polkadot Parachain
      • Cosmos & Cosmos compatible network
      • Algorand
    • dcent-cli-connector
      • Configurations
      • Device & Accounts Info.
      • Address & XPUB
      • Ethereum & EVM compatible
      • Hedera (HBAR & HTS)
    • dcent-provider
  • D'CENT BIOMETRIC WALLET FOR Mobile
    • D'CENT SDK for Mobile Environment
    • dcent-biometric-sdk-android
      • Setup
      • Initialize
      • Device & Accrouts Info
      • Address & XPUB
      • Bitcoin
      • Ethereum & EVM compatible
      • Klaytn
      • XRPL
      • Binance
      • Stellar
      • Tron
      • Cardano
      • Hedera
      • Stacks
      • Solana
      • Conflux
      • Polkadot
      • Cosmos
      • Tezos
      • Vechain
      • Near
      • Havah
      • Algorand
    • dcent-biometric-sdk-ios
      • Setup
      • Initialize
      • Device & Accrouts Info
      • Address & XPUB
      • Bitcoin
      • Ethereum & EVM compatible
      • Klaytn
      • XRPL
      • Binance
      • Stellar
      • Tron
      • Cardano
      • Hedera
      • Stacks
      • Solana
      • Conflux
      • Polkadot
      • Cosmos
      • Tezos
      • Vechain
      • Near
      • Havah
      • Algorand
  • D'CENT Integrated Packages
    • Web3Modal
    • web3-onboard
  • Misc.
    • Logo & Brand Guideline
Powered by GitBook
On this page
  • If your dapp is already integrated with Kaikas
  • How to detect in-app browser
  • How to check D'CENT provider
  • Connect to Wallet
  • Wallet Connection UI
  • Get the current network
  • Get the current account's address
  • Send Transaction

Was this helpful?

  1. In-app browser (dapp browser)

Klaytn network

How to integrate with D'CENT wallet for dapps on Klaytn network.

PreviousEVM compatible networksNextTron network

Last updated 3 years ago

Was this helpful?

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.

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

  • Kaikas Developer Guide :

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.

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.

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.

klaytn.enable()

Wallet Connection UI

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

Get the current network

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

klaytn.networkVersion

By checking the network ID, you can know which network is currently connected to.

Network ID

Network Name

8217

Klaytn Mainnet

1001

Klaytn Testnet Baobab

Get the current account's address

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

klaytn.selectedAddress

Send Transaction

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.

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 )

More Examples :

https://docs.kaikas.io/
Kaikas docs
https://docs.kaikas.io/01_getting_started/03_sending_transactions