TxHashPreimageUtils
scrypt-ts-opcat / TxHashPreimageUtils
Class: TxHashPreimageUtils
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/txHashPreimageUtils.ts:15
Utility class for working with transaction hash preimages in Bitcoin smart contracts. Provides methods to:
- Calculate transaction hash from preimage data
- Extract individual input/output byte strings from preimage
Extends
Constructors
new TxHashPreimageUtils()
new TxHashPreimageUtils(...
args
):TxHashPreimageUtils
Defined in: packages/scrypt-ts-opcat/src/smart-contract/smartContractLib.ts:32
Parameters
args
...SupportedParamType
[]
Returns
Inherited from
Properties
args
args:
any
[] =[]
Defined in: packages/scrypt-ts-opcat/src/smart-contract/smartContractLib.ts:31
Inherited from
artifact
static
artifact:Artifact
Defined in: packages/scrypt-ts-opcat/src/smart-contract/smartContractLib.ts:16
Inherited from
stateType?
static
optional
stateType:string
Defined in: packages/scrypt-ts-opcat/src/smart-contract/smartContractLib.ts:17
Inherited from
Methods
getInputByteString()
static
getInputByteString(txHashPreimage
,inputIndex
):ByteString
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/txHashPreimageUtils.ts:37
Extracts the byte string of a specific input from the transaction hash preimage.
Parameters
txHashPreimage
The transaction hash preimage containing input data.
inputIndex
bigint
The index of the input to extract.
Returns
The byte string representing the specified input.
getOutputByteString()
static
getOutputByteString(txHashPreimage
,outputIndex
):ByteString
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/txHashPreimageUtils.ts:48
Extracts the byte string of a specific output from the transaction hash preimage.
Parameters
txHashPreimage
The transaction hash preimage containing output list.
outputIndex
bigint
The index of the output to extract.
Returns
The byte string of the specified output.
getTxHashFromTxHashPreimage()
static
getTxHashFromTxHashPreimage(txHashPreimage
):ByteString
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/txHashPreimageUtils.ts:17
Parameters
txHashPreimage
Returns
loadArtifact()
static
loadArtifact(artifact
): typeofSmartContractLib
Defined in: packages/scrypt-ts-opcat/src/smart-contract/smartContractLib.ts:19
Parameters
artifact
Returns
typeof SmartContractLib