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
  • Sign Transaction
  • Supported Transaction Types
  • getXrpSignedTransaction()
  • Send a Multi-Signed Transaction

Was this helpful?

  1. D'CENT biometric wallet for PC
  2. dcent-web-connector

XRPL (XRP Ledger)

Sign Transaction

Supported Transaction Types

The following transaction types are supported on D'CENT Biometric wallet.

Transaction Type
Supported

AccountSet

O

AccountDelete

O

CheckCancel

O

CheckCash

O

CheckCreate

O

DepositPreauth

O

EscrowCancel

O

EscrowCreate

O

EscrowFinish

O

NFTokenAcceptOffer

X

NFTokenBurn

X

NFTokenCancelOffer

X

NFTokenCreateOffer

X

NFTokenMint

X

OfferCancel

O

OfferCreate

O

Payment

O

PaymentChannelClaim

O

PaymentChannelCreate

O

PaymentChannelFund

O

SetRegularKey

O

SignerListSet

O

TicketCreate

X

TrustSet

O

For your reference, All transaction types for XRPL can be found here.

getXrpSignedTransaction()

Supported Coin Type

  • XRP(Ripple)

Parameters :

  • key: key path, wallet sign with that private key with a given key path (BIP32 ex) "m/44'/144'/0'/0/0").

Requirements:

  • D'CENT Bridge version 1.1.4 or higher is required.

  • D'CENT Biometric Wallet version 2.4.0. or higher is required.

Usage:

const transactionJson = {
    "TransactionType": "AccountSet", // or use defined value `dcent.xrpTxType.AccountSet`
    "Account": "rfQrsnD8ywrgSX457qshpBTDru7EDnM2Lb",
    "Fee": "10",
    "Sequence": 34,
    "MessageKey": "02000000000000000000000000415F8315C9948AD91E2CCE5B8583A36DA431FB61",
    "Flags": 2147483648, // if exist then D'Cent check that `tfFullyCanonicalSig` is set?
}

var result
try {
    result = await dcent.getXrpSignedTransaction(transactionJson, "m/44'/144'/0'/0/0");    
} catch (e) {
    console.log(e)
    result = e
}

Returned response object:

{
    "header": {
        "version": "1.0",
        "response_from": "ripple",
        "status": "success"
    },
    "body": {
        "command": "get_sign",
        "parameter": {
            "sign": "3045022100e81c9e2...8e373e30b8f5e0a33eb094ffc7c8d009ad71fd7581b6b89ef9",
            "pubkey": "02c65f2a496909123973282c47edbd0e760bb44bb0d87ec1b30115b2ce3072c766",
            "accountId": "462a5a061ebe03fb52e5bca443233bcc6d0e9699"
        }
    }
}

Send a Multi-Signed Transaction

  • Multi-signing a Transaction

    1. Get signature

Example

// You can use xrp library for encoding
//const api = require('ripple-binary-codec')
//const addrs = require('ripple-address-codec')

const transactionJson = {
    "TransactionType": "Payment",
    "Account": "rfQrsnD8ywrgSX457qshpBTDru7EDnM2Lb",
    "Fee": "30", // normal cost * (1 + N)
    "Sequence": 45,
    "Amount": "1234567",
    "Flags": 2147483648,
    "Destination": "rJZMdVmbqFPi5oMyzGKJhHW9mNHwpiYKpS",
    "SigningPubKey": "", // Must be blank
}

var result
var signer = {}
try {
    // Keypath is SignerEntry's key path
    result = await DcentWebConnector.getXrpSignedTransaction(transactionJson, "m/44'/144'/1'/0/0");
    signer = {
        "Account": "rBV2LGGm5XAc5KbL7hBaPnLnUJ5aTQzVj9", // addrs.encodeAccountID(Buffer.from(result.accountId,'hex'))
        "SigningPubKey": result.pubkey,
        "TxnSignature": result.sign
    }
} catch (e) {
    console.log(e)
    result = e
}

For broadcast the sign transaction, you must reconstruct transaction include TxnSignature & SigningPubKey for normal (single-signature) or Signers array for multi-signed-transaction

PreviousBitcoinNextHedera (HBAR & HTS)

Last updated 2 years ago

Was this helpful?

transaction: this value conforms JSON format of Transaction Types in .

Reference the

First, prepare by referring to (You can get address of account using getAddress() function.)

https://xrpl.org/transaction-types.html
XRP Doc
XRP Doc
Set Up Multi-Signing