XRPL network

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

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

Injection Method

When the in-app browser loads a webpage, it must inject the following provider object

// Injected into window on page load
window.xrpl = {
  getWalletInfo: function () {
    // Return wallet information
  },
  request: function (args) {
    // [IoTrust]
    // 1. Return XRPL account information
    // 2. Switch XRPL networks
    // 3. Handle transaction signing/submission
  },
};

⚠️ Important Notes

  • The window.xrpl object must be injected before or immediately after the page loads.

  • The Doppler WebApp can recognize the wallet only if the window.xrpl object exists.

  • It must be injected before the DOM is ready for Doppler to detect it properly.

  • Both methods (getWalletInfo and request) are required.

Interface Definition

Required Implementation Methods

  • Chain ID definition

Chain ID
Network
Endpoint

xrpl:0

Mainnet

wss://xrplcluster.com

xrpl:1

Testnet

wss://s.altnet.rippletest.net

xrpl:2

Devnet

wss://s.devnet.rippletest.net

Method Details

Request Method

  • xrpl_accounts

Returns the addresses of the currently connected wallet as an array.

  • xrpl_switchChain

Changes the active XRPL chain by specifying a chain ID.

  • xrpl_signTransaction

Requests the wallet to sign (and optionally submit) an XRPL transaction.

Request Parameters for xrpl_signTransaction

Transction Types

  • Payment Transaction

    Used for sending XRP or tokens.

  • TrustSet Transaction

    Used for setting a trustline.

  • OfferCreate Transaction(DEX Order)

    Used for creating an order on the XRPL decentralized exchange.

Response Format

Last updated

Was this helpful?