Last updated
Last updated
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.
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 :
In order to check if your dapp running on Klaytn is supported dapp-browser, you need to check whether window.klaytn
is defined.
You can check whether the dapp browser is D'CENT wallet's in-app browser with the following code.
You can use the following code in order to connect to D'CENT wallet's account.
If the connection to wallet is requested, you can see the popup like below.
To get the current network ID, you can use the following code.
By checking the network ID, you can know which network is currently connected to.
To get the address of the current account, you can use the following code.
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 :
Network ID
Network Name
8217
Klaytn Mainnet
1001
Klaytn Testnet Baobab
How to integrate with D'CENT wallet for dapps on Klaytn network.