Utils

arrayAverage

Get the average value of an array.

Parameters

Returns number The average value.

ltcNetwork

Get Litecoin network to be used with bitcoinjs.

Parameters

  • network Network

Returns Litecoin.Network The LTC network.

getBalance

Get the balances of an address.

Parameters

  • params AddressParams

Returns Array<Balance> The balances of the given address.

validateAddress

Validate the LTC address.

Parameters

  • address string
  • network Network

Returns boolean true or false.

scanUTXOs

Scan UTXOs from sochain.

Parameters

  • params ScanUTXOParam
    • params.apiKey
    • params.sochainUrl
    • params.network
    • params.address

Returns Array<UTXO> The UTXOs of the given address.

broadcastTx

Broadcast the transaction.

Parameters

  • params BroadcastTxParams The transaction broadcast options.

Returns TxHash The transaction hash.

getPrefix

Get address prefix based on the network.

Parameters

  • network Network

Returns string The address prefix based on the network.*