Skip to main content

ScriptContext

scrypt-ts / ScriptContext

Interface: ScriptContext

ScriptContext contains all the information in the transaction's preimage. The preimage is automatically generated during the user's construction of the transaction, and the user does not need to calculate it explicitly.

Table of contents

Properties

Methods

Properties

hashOutputs

hashOutputs: ByteString

double-SHA256 hash of the serialization of some/all output amount with its locking script, see hashOutputs

Defined in

dist/smart-contract/contract.d.ts:61


hashPrevouts

hashPrevouts: ByteString

double-SHA256 hash of the serialization of some/all input outpoints, see [hashPrevouts][https://github.com/bitcoin-sv/bitcoin-sv/blob/master/doc/abc/replay-protected-sighash.md#hashprevouts](https://github.com/bitcoin-sv/bitcoin-sv/blob/master/doc/abc/replay-protected-sighash.md#hashprevouts)

Defined in

dist/smart-contract/contract.d.ts:55


hashSequence

hashSequence: ByteString

double-SHA256 hash of the serialization of some/all input sequence values, see [hashSequence][https://github.com/bitcoin-sv/bitcoin-sv/blob/master/doc/abc/replay-protected-sighash.md#hashsequence](https://github.com/bitcoin-sv/bitcoin-sv/blob/master/doc/abc/replay-protected-sighash.md#hashsequence)

Defined in

dist/smart-contract/contract.d.ts:57


locktime

locktime: bigint

locktime of [transaction][https://wiki.bitcoinsv.io/index.php/Bitcoin_Transactions#General_format_of_a_Bitcoin_transaction](https://wiki.bitcoinsv.io/index.php/Bitcoin_Transactions#General_format_of_a_Bitcoin_transaction)

Defined in

dist/smart-contract/contract.d.ts:63


sequence

sequence: bigint

sequence number of [transaction input][https://wiki.bitcoinsv.io/index.php/Bitcoin_Transactions#Format_of_a_Transaction_Input](https://wiki.bitcoinsv.io/index.php/Bitcoin_Transactions#Format_of_a_Transaction_Input)

Defined in

dist/smart-contract/contract.d.ts:59


sigHashType

sigHashType: SigHashType

[SIGHASH flag][https://wiki.bitcoinsv.io/index.php/SIGHASH_flags](https://wiki.bitcoinsv.io/index.php/SIGHASH_flags) used by this input

Defined in

dist/smart-contract/contract.d.ts:65


utxo

utxo: Object

the specific UTXO spent by this transaction input

Type declaration

NameTypeDescription
outpointOutpointoutpoint referenced by this UTXO
scriptByteStringlocking script
valuebigintamount in satoshis

Defined in

dist/smart-contract/contract.d.ts:46


version

version: ByteString

version number of [transaction][https://wiki.bitcoinsv.io/index.php/Bitcoin_Transactions#General_format_of_a_Bitcoin_transaction](https://wiki.bitcoinsv.io/index.php/Bitcoin_Transactions#General_format_of_a_Bitcoin_transaction)

Defined in

dist/smart-contract/contract.d.ts:44

Methods

serialize

serialize(): SigHashPreimage

get the whole serialized sighash preimage

Returns

SigHashPreimage

Defined in

dist/smart-contract/contract.d.ts:67