Bitcoin

getBitcoinSignedTransaction

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

This function for :

  • BITCOIN (BTC) - bitcoin

  • BITCOIN_SV (BSV) - bitcoin sv

  • BTC_SEGWIT (BTC) - bitcoin segwit

  • MONACOIN (MONA) - monacoin

  • LITECOIN (LTC) - litecoin

  • LTC_SEGWIT (LTC) - litecoin segwit

  • ZCASH (ZEC) - zcash

  • HORIZEN (ZEN) - horizen

  • BITCOINCASH (BCH) - bitcoin cash

  • DOGECOIN (DOGE) - dogecoin

  • BITCOINABC (BCHA) - bitcoin cash abc

  • ECASH (XEC) - ecash

  • DASH (DASH) - dash

  • BITCOIN_GOLD (BTG) - bitcoin gold

  • DIGIBYTE (DGB) - digibyte

  • DGB_SEGWIT (DGB)- digibyte segwit

  • RAVENCOIN (RVN) - ravencoin

  • BITCOIN_TESTNET (BTCt) - bitcoin testnset

  • BTC_SEGWIT_TESTNET (BTCt) - bitcoin segwit testnet

  • MONACOIN_TESTNET (MONAt) - monacoin testnet

  • LITE_TESTNET (tLTC) - litecoin testnet

  • LTC_SEGWIT_TESTNET (tLTC) - litecoin segwit testnet

  • ZCASH_TESTNET (TAZ) - zcash testnet

  • BCH_TESTNET (tBCH)- bitocin cash testnet

  • DASH_TESTENET (tDASH) - dash testnet

  • BTG_TESTNET (tBTG) - bitcoin gold testnet

  • DIGIBYTE_TESTNET (tDGB) - digibyte testnet

  • DGB_SEGWIT_TESTNET (tDGB) - digibyte segwit testnet

  • RVN_TESTNET (tRVN) - ravencoin testnet

Parameters

class BitCoinTransaction

This class to be used for bitcoin transaction.

class UnspentTransactionOutput

The class for previous transaction output information to be used for bitcoin network transaction.

class TransactionOutput

The class for coin spending information of Bitcoin network Transaction

Returns

String - signed transaction.j

Requirements

Example

UnspentTransactionOutput utxo = new UnspentTransactionOutput("01000000012b09bd990adc6792588225486c336fb2090890341fcbc6ae92c440c3bd266b98010000006a47304402201df6bd2294f9d51496c1be7ea09431fcfee4b0ca9359712c2c381aff9b2d6f070220595a5bb4e9f0f0d1f5fb9a800224c01ac99058d9b491cd7e6a60145bbd26ddca0121028cbb73e589f81937784eaf728cd14ad27984e5415766c04408211af8d9e30ee7ffffffff0127810000000000001976a9141c7254fac600ef7371664a613f0323c6c641cbd288ac00000000", 0, BitCoinTransaction.TxType.p2pkh, Bip44KeyPath.valueOf("m/44'/0'/0'/0/0")) ;

List<UnspentTransactionOutput> input = new ArrayList<>();
input.add(utxo) ;

TransactionOutput txo = new TransactionOutput(10000, Arrays.asList(new String[]{"1Ckii7MpiquSxcmo2ch1UTfQMConz31rpB"}), BitCoinTransaction.TxType.p2pkh  ) ;
List<TransactionOutput> output = new ArrayList<>();
output.add(txo) ;

BitCoinTransaction bitCoinTransaction = new BitCoinTransaction.Builder()
                .version(1)
                .input(input)
                .output(output)
                .locktime(0)
                .build();

String response = mDcentManager.getBitcoinSignedTransaction(CoinType.BITCOIN, bitCoinTransaction);

Last updated