bitcoin-sv / ts-sdk

Other
51 stars 12 forks source link

[FEATURE] Add default value for sequence in Transaction #125

Closed swierzbicki closed 1 month ago

swierzbicki commented 2 months ago

Summary

Currently when we built and input for new transaction:

    const input = {
        sourceTransaction,
        sourceOutputIndex: 0,
        unlockingScriptTemplate: new P2PKH().unlock(privKey),
        sequence: 0xffffffff
    }

We need to always give a sequence value. As far as i know. In the most of the cases it will be a one, fixed value 0xffffffff.

Motivation

It would be easier to use ts-sdk for someone who just starts the journey with the ts-sdk/bsv.

sirdeggen commented 1 month ago

Please use:

tx.addInput(input)

https://github.com/bitcoin-sv/ts-sdk/blob/a0f73a71b42f1bcea409f83a243b3f66bc524a57/src/transaction/Transaction.ts#L328

Or provide more context for which method you'd like to set a default for?