Options
All
  • Public
  • Public/Protected
  • All
Menu

Module bitcoin-utils/lib

Index

Type aliases

CoinSelectTarget

CoinSelectTarget: { id?: string; script?: Buffer; value: number }

Type declaration

  • Optional id?: string
  • Optional script?: Buffer
  • value: number

Variables

Const AddressTypes

AddressTypes: string[] = ...

Functions

calculateFee

  • calculateFee(numInputs: number, numOutputs: number, feePerByte: number): number

compressPubKey

  • compressPubKey(pubKey: string): string
  • Get compressed pubKey from pubKey.

    Parameters

    • pubKey: string

      65 byte string with prefix, x, y.

    Returns string

    Returns the compressed pubKey of uncompressed pubKey.

decodeRawTransaction

  • decodeRawTransaction(hex: string, network: BitcoinNetwork): bT.Transaction

getAddressNetwork

  • getAddressNetwork(address: string): BitcoinNetwork

getPubKeyHash

  • getPubKeyHash(address: string, network: BitcoinNetwork): Buffer

normalizeTransactionObject

  • normalizeTransactionObject(tx: bT.Transaction, fee: number, block?: { hash: string; number: number }): Transaction<bT.Transaction>
  • Parameters

    • tx: bT.Transaction
    • fee: number
    • Optional block: { hash: string; number: number }
      • hash: string
      • number: number

    Returns Transaction<bT.Transaction>

selectCoins

validateAddress

  • validateAddress(_address: Address | string, network: BitcoinNetwork): void

witnessStackToScriptWitness

  • witnessStackToScriptWitness(witness: Buffer[]): Buffer

Generated using TypeDoc