Skip to content

BTC does not transfer #975

@Bensigo

Description

@Bensigo

my code run smooth without any error but the bitcoin does not transfer to toAddress . code

     sendTestnetBTC (paperWallet, toAddress, amount, txID) {
        const address = bitcoin.ECPair.fromWIF(paperWallet.privateKey, bitcoin.networks.testnet)
        const txb = new bitcoin.TransactionBuilder(bitcoin.networks.testnet)
        txb.addInput(txID , 0) // previous transactionId from the address at index 0
        txb.addOutput(toAddress, amount) 
        txb.sign(0, address)
        txb.build().toHex() 
  }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions