Configurations

Developers can develop wallet application using our web sdk. Install the dcent-web-connector from npm repository.

npm install dcent-web-connector

Developer can access api through window.DcentWebConnector object or DcentWebConnector object.

const DcentWebConnector = require('dcent-web-connector')

Requirement

Basic structure

Functions

All API functions return a Promise. When function processing is completed, it is resolved. If an error occurs, it is rejected. In either case, respond with a JSON object.

Returned JSON object type

{
    "header": {
        "version": "1.0",
        "request_from": "",
        "status": ""
    },
    "body": {
        "command" : "",
        "parameter" : {}
    }
}

Common Errors

If D'CENT wallet isn't connected via USB, you'll get the following error:

When executing a function that requires user authentication, an error occurs if the user cancels the authentication. The following shows the user cancel error in the Ethereum signed Transaction.

If the bridge service popup window is closed while calling a function and waiting, the following error occurs:

Basic functions

DcentWebConnector initialize

dcent-web-connector provides functions for using D'CENT Biometric Wallet.

info() returns :

When the function is called from your web application, if D'CENT Bridge Service is not running as a pop-up, dcent-web-connector will automatically open a pop-up window and send a function request

Set TimeOut Time

All functions except setTimeOutMs function are called and then respond with JSON Object as below when timeout occurs.

You can set the timeout time by calling setTimeOutMs () as shown below.

Sets the maximum time the function will run. Once set the timeout Time, it is valid until the value is set again. The default value is 60 seconds.

Close pop-up window

dcent-web-connector will automatically open a pop-up window and send a function request. After each request to device is ended, it is recommended to close popup for enhancing user experience.

Set Device Connection Listener

Set listener for device connection state. Before processing a functions request, dcent-web-connector check the device connection state. If the state is changed, the device connection listener will be called.

Address Path

All address path in the API should follow BIP44 rules.

Coin Type

DcentWebConnector.coinType is defined in the source code below.

APIs

Wallet device and accounts info.

Device & Accounts Info.

Address & XPUB

You can get an address or XPUB for a specific private key with the APIs below.

Address & XPUB

Ethereum & EVM compatible network

You can find the APIs to generate signature for Ethereum, EVM compatible network.

Ethereum & EVM compatible

Klaytn

You can find the APIs to generate signature for Klaytn network.

Klaytn

Bitcoin & Bitcoin compatible network

You can find the APIs to generate signature for Bitcoin and Bitcoin compatible network.

Bitcoin

XRPL (XRP Ledger)

You can find the APIs to generate signature for XRPL transactions.

XRPL (XRP Ledger)

Hedera (HBAR & HTS)

You can find the APIs to generate signature for Hedera transactions.

Hedera (HBAR & HTS)

Last updated

Was this helpful?