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
  • getBitcoinSignedTransaction()

Was this helpful?

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

Bitcoin

Sign Transaction

The D'CENT Web SDK provides functions for signing transaction of coins.

getBitcoinSignedTransaction()

Supported Coin Type

  • BITCOIN

  • MONACOIN

Parameters :

  • transaction: this value generated by getBitcoinTransactionObject()

Usage:

// generate Bitcoin Transaction object
let transaction = DcentWebConnector.getBitcoinTransactionObject(dcent.coinType.BITCOIN)
// Set input parameter(previous tx) in Bitcoin Transaction object
transaction = DcentWebConnector.addBitcoinTransactionInput(transaction,
    '0100000001e297417c46........293fce63b88ac00000000', //  full of previous tx data
    1, // index of previous tx output to be sent
    dcent.bitcoinTxType.p2pkh, // bitcoin tx type for this UTXO
    "m/44'/0'/0'/1/0") // signing key path
transaction = DcentWebConnector.addBitcoinTransactionInput(transaction,
    '0100000001e297417c46.........93fce63b88ac00000000',
    0,
    dcent.bitcoinTxType.p2pkh,
    "m/44'/0'/0'/0/7")
// Set output parameter(spending information) in Bitcoin Transaction object
transaction = DcentWebConnector.addBitcoinTransactionOutput(transaction,
        dcent.bitcoinTxType.p2pkh, // transaction type or this field can indicate output as a “change”
        '10000', // amount of coin to spend. Satoshi unit.
        ['1traqiFvydVk2hWdCj3WGRJbe4CGtfyHA']) // Base58Check encoded address of the receiver.
    result = await DcentWebConnector.getBitcoinSignedTransaction(transaction)

Returned response object:

{
    "header": {
        "version": "1.0",
        "response_from": "erc20",
        "status": "success"
    },
    "body": {
        "command": "transaction",
        "parameter": {
            "signed": "0100000002233ee1fbcf.....71e088ac00000000"
        }
    }
}
PreviousKlaytnNextXRPL (XRP Ledger)

Last updated 2 years ago

Was this helpful?