Bitcoin
getBitcoinSignedTransaction
The D'CENT Android SDK provides functions for signing transaction of coins.
This function for :
.BITCOIN
- bitcoin (BTC).BITCOIN_SV
- bitcoin sv (BSV).BTC_SEGWIT
- bitcoin segwit (BTC).MONACOIN
- monacoin (MONA).LITECOIN
- litecoin (LTC).LTC_SEGWIT
- litecoin segwit (LTC).ZCASH
- zcash (ZEC).HORIZEN
- horizen (ZEN).BITCOINCASH
- bitcoin cash (BCH).DOGECOIN
- dogecoin (DOGE).BCH_ABC
- bitcoin cash abc (BCHA).ECASH
- ecash (XEC).DASH
- dash (DASH).BITCOIN_GOLD
- bitcoin gold (BTG).DIGIBYTE
- digibyte (DGB).DGB_SEGWIT
- digibyte segwit (DGB).RAVENCOIN
- ravencoin (RVN).BTC_TESTNET
- bitcoin testnet (BTCt).BTC_SEGWIT_TESTNET
- bitcoin segwit testnet (BTCt).MONA_TESTNET
- monacoin testnet (MONAt).LITE_TESTNET
- litecoin testnet (tLTC).LTC_SEGWIT_TESTNET
- litecoin segwit testnet (tLTC).ZCASH_TESTNET
- zcash testnet (TAZ).BCH_TESTNET
- bitcoin cash testnet (tBCH).DASH_TESTNET
- dash testnet (tDASH).BTG_TESTNET
- bitcoin gold testnet (tBTG).DIGIBYTE_TESTNET
- digibyte testnet (tDGB).DGB_SEGWIT_TESTNET
- digibyte segwit testnet (tDGB).RVN_TESTNET
- ravencoin testnet (tRVN)
Parameters
coinType: bitcoin networks coin type
bitcoinTransaction: (BitcoinTransation)bitcoin transaction parameter
class BitCoinTransaction
This class to be used for bitcoin transaction.
version
UInt32
version of bitcoin transaction. Currently 1
- BCH
/Dash
/BTG
: 2
- ZCASH
: 4
input
previous transaction output information to be used
output
coin spending information
locktime
UInt32
locktime for this transaction
optionParam
String
(optional)option parameter for this transaction in case ZCASH
class UnspentTransactionOutput
The class for previous transaction output information to be used for bitcoin network transaction.
prev_tx
String
full of previous transaction data
utxo_idx
UInt32
index of previous transaction output to be sent
type
bitcoin transaction type for this UTXO
key
String
BIP44 key path for unlocking UTX
class TransactionOutput
The class for coin spending information of Bitcoin network Transaction
value
UInt64
amount of coin to spend. Satoshi unit.
to
[String]
if type
is p2pkh
or p2sh
, Base58Check encoded address of the receiver.
The value of the field may follow the rule of version prefix.(BITCOIN_BASE58CHECK
)
if the type is p2pk
, Base58Check encoded non-compressed public key without version prefix.
if the type is multisig
, Base58Check encoded non-compressed public key (without version prefix) list.
if the type is change
, BIP44 formatted PATH to get change address. In this case, the transaction type is assumed as p2pkh
type
bitcoin network transaction type or this field can indicate output as a change
enum BtcTxtype
p2Pkh
: pay to public key hashp2Pk
: pay to public keyp2Sh
: pay to script hashchange
: indicate output as a change
Returns
result: (Bool)
true
if successful,false
if error occurredtxData: signed transaction
Example
Last updated