Client
Extends xchain_utxo_1.Client
Custom Litecoin client
Parameters
paramsUtxoClientParams (optional, defaultexports.defaultLtcParams)
getAddress
Parameters
index(optional, default0)
Meta
- deprecated: this function eventually will be removed use getAddressAsync instead
getAddressAsync
Get the current address.
Generates a network-specific key-pair by first converting the buffer to a Wallet-Import-Format (WIF) The address is then decoded into type P2WPKH and returned.
Parameters
-
walletIndex(optional, default0) - Throws
"Phrase must be provided"Thrown if phrase has not been set before. - Throws
"Address not defined"Thrown if failed creating account from phrase.
Returns Address The current address.
getAssetInfo
Returns any asset info
validateAddress
Validate the given address.
Parameters
addressAddress
Returns boolean true or false
transfer
Transfer LTC.
Parameters
paramsTxParams&FeeRate The transfer options.
Returns TxHash The transaction hash.
buildTx
Parameters
paramsBuildParams The transaction build options.params.amountparams.recipientparams.memoparams.feeRateparams.sender
Returns Transaction
Meta
- deprecated: This is deprecated.
prepareTx
Prepare transfer.
Parameters
paramsTxParams&Address&FeeRate&boolean The transfer options.params.senderparams.memoparams.amountparams.recipientparams.feeRate
Returns PreparedTx The raw unsigned transaction.
compileMemo
Compile memo.
Parameters
memostring The memo to be compiled.
Returns Buffer The compiled memo.
getFeeFromUtxos
Get the transaction fee.
Parameters
inputsArray<UTXO> The UTXOs.feeRateFeeRate The fee rate.dataBuffer The compiled memo (Optional). (optional, defaultnull)
Returns number The fee amount.