Client

Extends xchain_utxo_1.Client

Custom Bitcoin client

Parameters

  • params UtxoClientParams (optional, default exports.defaultBTCParams)

getAssetInfo

Returns any BTC asset info

validateAddress

Validate the given address.

Parameters

  • address Address

Returns boolean true or false

compileMemo

Compile memo.

Parameters

  • memo string The memo to be compiled.

Returns Buffer The compiled memo.

getFeeFromUtxos

Get the transaction fee.

Parameters

  • inputs Array<UTXO> The UTXOs.
  • feeRate FeeRate The fee rate.
  • data Buffer The compiled memo (Optional). (optional, default null)

Returns number The fee amount.

buildTx

Parameters

  • param0 Object
    • param0.amount
    • param0.recipient
    • param0.memo
    • param0.feeRate
    • param0.sender
    • param0.spendPendingUTXO (optional, default true)

Meta

  • deprecated: This is deprecated.

prepareTx

Prepare transfer.

Parameters

  • params TxParams&Address&FeeRate&boolean The transfer options.
    • params.sender
    • params.memo
    • params.amount
    • params.recipient
    • params.spendPendingUTXO (optional, default true)
    • params.feeRate

Returns PreparedTx The raw unsigned transaction.