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 objectlet transaction =DcentWebConnector.getBitcoinTransactionObject(dcent.coinType.BITCOIN)// Set input parameter(previous tx) in Bitcoin Transaction objecttransaction =DcentWebConnector.addBitcoinTransactionInput(transaction,'0100000001e297417c46........293fce63b88ac00000000',// full of previous tx data1,// index of previous tx output to be sentdcent.bitcoinTxType.p2pkh,// bitcoin tx type for this UTXO"m/44'/0'/0'/1/0") // signing key pathtransaction =DcentWebConnector.addBitcoinTransactionInput(transaction,'0100000001e297417c46.........93fce63b88ac00000000',0,dcent.bitcoinTxType.p2pkh,"m/44'/0'/0'/0/7")// Set output parameter(spending information) in Bitcoin Transaction objecttransaction =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 =awaitDcentWebConnector.getBitcoinSignedTransaction(transaction)