ExtPsbt
@opcat-labs/scrypt-ts-opcat v1.0.4
@opcat-labs/scrypt-ts-opcat / ExtPsbt
Class: ExtPsbt
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:99
Extends the standard Psbt class with additional functionality for OP_CAT transactions. Provides methods for:
- Managing contract inputs/outputs
- Handling UTXO spending
- Calculating transaction fees and sizes
- Finalizing and sealing transactions
- Backtrace information for contract inputs
- Change output management
Supports serialization to/from hex, base64 and buffer formats. Includes network-aware operations and signature handling.
Extends
Implements
Constructors
new ExtPsbt()
new ExtPsbt(
opts,data?):ExtPsbt
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:100
Parameters
opts
ExtPsbtOpts = {}
data?
Psbt
Returns
Overrides
Properties
data
readonlydata:Psbt
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:134
Implementation of
Inherited from
Accessors
hashSpentDatas
Get Signature
get hashSpentDatas():
ByteString
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:235
Computes the hash of all spent data hashes in the PSBT. Concatenates all non-empty spent data hashes and returns their double SHA-256 hash.
Returns
The hash256 of all spent data hashes concatenated together.
inputAmount
Get Signature
get inputAmount():
bigint
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:524
Gets the total input amount in satoshis as a bigint.
Returns
bigint
The sum of all input values in the PSBT.
inputCount
Get Signature
get inputCount():
number
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:180
Returns
number
Implementation of
Inherited from
isFinalized
Get Signature
get isFinalized():
boolean
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:739
Checks if all inputs in the PSBT are finalized.
Returns
boolean
True if all inputs are finalized, false otherwise.
Whether the PSBT is finalized.
Implementation of
isFinalizing
Get Signature
get isFinalizing():
boolean
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:672
Indicates whether the PSBT is currently in the process of being finalized.
Returns
boolean
True if the PSBT is being finalized, false otherwise.
Whether the PSBT starts finalizing.
Implementation of
isSealed
Get Signature
get isSealed():
boolean
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:680
Indicates whether the PSBT (Partially Signed Bitcoin Transaction) is sealed. A sealed PSBT cannot be modified further.
Returns
boolean
Whether the PSBT is sealed.
Implementation of
locktime
Get Signature
get locktime():
number
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:192
Returns
number
Set Signature
set locktime(
locktime):void
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:196
Parameters
locktime
number
Returns
void
Implementation of
Inherited from
outputAmount
Get Signature
get outputAmount():
bigint
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:535
Gets the total output amount of the PSBT transaction by summing up all output values.
Returns
bigint
The sum of all output values as a bigint.
txInputs
Get Signature
get txInputs():
PsbtTxInput[]
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:200
Returns
PsbtTxInput[]
Implementation of
Inherited from
txOutputs
Get Signature
get txOutputs():
PsbtTxOutput[]
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:208
Returns
PsbtTxOutput[]
Implementation of
Inherited from
unsignedTx
Get Signature
get unsignedTx():
Transaction
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:622
Gets the unsigned transaction from the PSBT's internal cache.
Returns
The raw unsigned transaction object.
The unsigned transaction when the PSBT is not finalized. note:
Implementation of
version
Get Signature
get version():
number
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:184
Returns
number
Set Signature
set version(
version):void
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:188
Parameters
version
number
Returns
void
Implementation of
Inherited from
Methods
addContractInput()
addContractInput\<
Contract>(contract,contractCall):this
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:393
Adds a contract input to the PSBT (Partially Signed Bitcoin Transaction).
Type Parameters
• Contract extends SmartContract\<StructObject>
Parameters
contract
Contract
The smart contract instance to add as input.
contractCall
ContractCall\<Contract>
The contract call containing the method and arguments.
Returns
this
The PSBT instance for method chaining.
Throws
Error if the contract does not have a bound UTXO.
Implementation of
addContractOutput()
addContractOutput\<
Contract>(contract,satoshis):this
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:502
Adds a contract output to the PSBT (Partially Signed Opcat Transaction).
Type Parameters
• Contract extends SmartContract\<StructObject>
Type parameter extending SmartContract<OpcatState>
Parameters
contract
Contract
The smart contract instance to add as output
satoshis
number
The amount in satoshis to lock in this output
Returns
this
The PSBT instance for method chaining
Implementation of
addInput()
addInput(
inputData):this
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:275
Adds an extended PSBT input with optional finalizer and signature requests.
- Calls parent class's
addInputmethod - Validates PSBT isn't sealed
- If input has a finalizer, caches the unlock script and sets the finalizer callback
- Processes any signature requests for the input
Parameters
inputData
PsbtInputExtended
Extended PSBT input data containing optional finalizer and sigRequests
Returns
this
PSBT instance for chaining
Implementation of
Overrides
addInputs()
addInputs(
inputDatas):this
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:279
Parameters
inputDatas
PsbtInputExtended[]
Returns
this
Implementation of
Inherited from
addOutput()
addOutput(
outputData):this
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:345
Adds an extended output to the PSBT.
Parameters
outputData
PsbtOutputExtended
The extended output data to add
Returns
this
The PSBT instance for chaining
Throws
Error if the PSBT is already sealed
Implementation of
Overrides
addOutputs()
addOutputs(
outputDatas):this
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:312
Parameters
outputDatas
PsbtOutputExtended[]
Returns
this
Implementation of
Inherited from
addUnknownKeyValToGlobal()
addUnknownKeyValToGlobal(
keyVal):this
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:805
Parameters
keyVal
KeyValue
Returns
this
Implementation of
IExtPsbt.addUnknownKeyValToGlobal
Inherited from
addUnknownKeyValToInput()
addUnknownKeyValToInput(
inputIndex,keyVal):this
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:810
Parameters
inputIndex
number
keyVal
KeyValue
Returns
this
Implementation of
IExtPsbt.addUnknownKeyValToInput
Inherited from
addUnknownKeyValToOutput()
addUnknownKeyValToOutput(
outputIndex,keyVal):this
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:815
Parameters
outputIndex
number
keyVal
KeyValue
Returns
this
Implementation of
IExtPsbt.addUnknownKeyValToOutput
Inherited from
calculateBacktraceInfo()
calculateBacktraceInfo(
provider,prevPrevTxFinder?):Promise\<void>
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:969
Calculates backtrace information for contract inputs in the PSBT.
Iterates through all inputs and collects backtrace info for contract inputs. Uses the provided provider to fetch previous transaction data when needed.
Parameters
provider
Provider interface for fetching UTXO and chain data
prevPrevTxFinder?
(prevTx, provider, inputIndex) => Promise\<string>
Optional function to find previous transactions
Returns
Promise\<void>
Promise that resolves when all backtrace info is calculated
change()
change(
toAddr,feeRate,data?):this
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:547
Adds or updates a change output to the PSBT.
Parameters
toAddr
string
The address to receive the change.
feeRate
number
The fee rate to use for the change output.
data?
Optional data to include in the output (hex string or Uint8Array).
string | Uint8Array
Returns
this
The PSBT instance for chaining.
Implementation of
clearFinalizedInput()
clearFinalizedInput(
inputIndex):this
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:820
Parameters
inputIndex
number
Returns
this
Implementation of
Inherited from
clone()
clone():
Psbt
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:237
Returns
Implementation of
Inherited from
combine()
combine(...
those):this
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:232
Parameters
those
...Psbt[]
Returns
this
Implementation of
Inherited from
estimateFee()
estimateFee(
feeRate):number
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:655
Estimates the transaction fee by multiplying the estimated size (in vbytes) by the given fee rate.
Parameters
feeRate
number
Fee rate in satoshis per virtual byte (sat/vbyte).
Returns
number
The estimated fee amount in satoshis.
Implementation of
estimateSize()
estimateSize():
number
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:646
Estimates the total size of the PSBT by summing the unsigned transaction size and the size of unfinalized call arguments.
Returns
number
The estimated size in bytes.
Implementation of
extractTransaction()
extractTransaction(
disableFeeCheck?):Transaction
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:348
Parameters
disableFeeCheck?
boolean
Returns
Implementation of
Inherited from
finalizeAllInputs()
finalizeAllInputs():
this
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:692
Finalizes all inputs in the PSBT by applying their respective finalizers. For each input, if a finalizer is present, it generates the unlocking script and creates a finalization function. After finalizing all inputs, it binds the contract UTXOs. Throws an error if any input fails to finalize.
Returns
this
The current PSBT instance for chaining.
Implementation of
Overrides
finalizeInput()
finalizeInput(
inputIndex,finalScriptsFunc?):this
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:384
Parameters
inputIndex
number
finalScriptsFunc?
FinalScriptsFunc
Returns
this
Implementation of
Inherited from
getB2GInputUtxo()
getB2GInputUtxo(
inputIndex):B2GUTXO
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:875
Retrieves the B2G UTXO (Unspent Transaction Output) for a specific input index.
Parameters
inputIndex
number
The index of the input to retrieve the UTXO for.
Returns
The B2G UTXO if found, otherwise undefined.
Implementation of
getBacktraceInfo()
getBacktraceInfo(
provider,inputIndex,prevPrevTxFinder):Promise\<BacktraceInfo>
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:938
Retrieves backtrace information for a PSBT input by fetching and analyzing previous transactions.
Parameters
provider
Provider interface for fetching UTXO and chain data
inputIndex
number
Index of the input to trace back from
prevPrevTxFinder
(prevTx, provider, inputIndex) => Promise\<string>
Async function to locate the transaction before the previous transaction
Returns
Promise\<BacktraceInfo>
Promise resolving to backtrace information including:
- Previous transaction input details
- Input index in current transaction
- Preimage of the transaction before previous transaction
getChangeInfo()
getChangeInfo():
TxOut
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:598
Gets the change output information from the PSBT transaction.
Returns
An object containing the script hash, satoshis value, and data hash of the change output. If no change output exists, returns an empty TxOut with default values (empty script/data hash and 0 satoshis).
Throws
If the change output index is set but the output is not found at that index.
Implementation of
getChangeUTXO()
getChangeUTXO():
UTXO
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:884
Gets the change UTXO (Unspent Transaction Output) if it exists.
Returns
The change UTXO if found, otherwise null.
Throws
If the change output index is defined but no output is found at that index.
getFee()
getFee():
bigint
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:369
Returns
bigint
Implementation of
Inherited from
getFeeRate()
getFeeRate():
number
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:360
Returns
number
Implementation of
Inherited from
getInputContract()
getInputContract(
inputIndex):SmartContract\<StructObject>
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:866
Gets the smart contract associated with a specific input index.
Parameters
inputIndex
number
The index of the input to retrieve the contract for
Returns
SmartContract\<StructObject>
The smart contract for the specified input, or undefined if not found
getInputCtx()
getInputCtx(
inputIndex):InputContext
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:210
Gets the input context for the specified input index.
Parameters
inputIndex
number
The index of the input to retrieve context for
Returns
InputContext
The InputContext object associated with the specified input index
Implementation of
getInputOutput()
getInputOutput(
inputIndex):OpcatUtxo
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:228
Parameters
inputIndex
number
The index of the input to get the output for.
Returns
The previous output of the input.
Implementation of
Inherited from
getInputType()
getInputType(
inputIndex):AllScriptType
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:421
Parameters
inputIndex
number
Returns
AllScriptType
Implementation of
Inherited from
getlockTime()
getlockTime():
number
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:132
Gets the lock time (nLockTime) value from the unsigned transaction.
Returns
number
The lock time value as a number.
Implementation of
getSequence()
getSequence(
inputIndex):number
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:125
Gets the sequence number for the specified input index.
Parameters
inputIndex
number
The index of the input in the transaction.
Returns
number
The sequence number of the input.
Implementation of
getSig()
getSig(
inputIndex,options):Sig
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:841
Retrieves a signature for a specific input in the PSBT.
Parameters
inputIndex
number
The index of the input to sign.
options
Omit\<ToSignInput, "index">
Signing options including address or public key.
Returns
The signature as a Sig object. If no signature is found, returns a default zero-filled signature.
Throws
May throw if the input index is invalid or if there are issues with public key conversion.
Implementation of
getSigHashType()
getSigHashType(
inputIndex):SigHashType
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:201
Gets the signature hash type for the specified input index.
Parameters
inputIndex
number
The index of the input to get the signature hash type for.
Returns
The signature hash type for the specified input index.
Implementation of
getSpentDataHashes()
getSpentDataHashes():
ByteString
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:219
Calculates and returns the concatenated SHA-256 hashes of all input OP_CAT UTXO data. Each input's data is hashed individually and the results are concatenated.
Returns
The combined hashes of all input data as a ByteString.
Implementation of
getUtxo()
getUtxo(
outputIndex):ExtUtxo
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:903
Retrieves the UTXO (Unspent Transaction Output) at the specified output index.
Parameters
outputIndex
number
The index of the output to retrieve
Returns
An ExtUtxo object containing the UTXO details
Throws
Error if the output at the specified index is not found
inputHasHDKey()
inputHasHDKey(
inputIndex,root):boolean
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:437
Parameters
inputIndex
number
root
HDSigner
Returns
boolean
Implementation of
Inherited from
inputHasPubkey()
inputHasPubkey(
inputIndex,pubkey):boolean
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:432
Parameters
inputIndex
number
pubkey
Uint8Array
Returns
boolean
Implementation of
Inherited from
isB2GUtxo()
isB2GUtxo(
utxo):boolean
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:989
Checks if a given UTXO is a B2G (Back to Genesis) UTXO. A B2G UTXO is identified by the presence of a 'txHashPreimage' property in the object.
Parameters
utxo
object
The UTXO object to check
Returns
boolean
boolean indicating if the UTXO is a B2G UTXO
isContractInput()
isContractInput(
inputIndex):boolean
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:762
Checks if the input at the specified index is a contract input.
Parameters
inputIndex
number
The index of the input to check.
Returns
boolean
True if the input is a contract input, false otherwise.
outputHasHDKey()
outputHasHDKey(
outputIndex,root):boolean
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:449
Parameters
outputIndex
number
root
HDSigner
Returns
boolean
Implementation of
Inherited from
outputHasPubkey()
outputHasPubkey(
outputIndex,pubkey):boolean
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:445
Parameters
outputIndex
number
pubkey
Uint8Array
Returns
boolean
Implementation of
Inherited from
psbtOptions()
psbtOptions(
autoFinalized):SignOptions
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:815
Generates PSBT signing options based on signature requests.
Parameters
autoFinalized
boolean = false
Whether to automatically finalize the PSBT after signing (default: false)
Returns
SignOptions object containing signing inputs, or undefined if no signatures are required
removeInput()
removeInput(
inputIndex):this
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:434
Removes an input from the PSBT at the specified index. This updates the unsigned transaction, input data, and clears related contract, UTXO, finalizer, and signature request mappings for the removed input.
Parameters
inputIndex
number
The index of the input to remove
Returns
this
The PSBT instance for method chaining
removeLastInput()
removeLastInput():
this
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:449
Removes the last input from the PSBT.
Returns
this
The modified PSBT instance for chaining.
Throws
If there are no inputs to remove.
seal()
seal():
this
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:1018
Finalizes the PSBT by calculating and caching input unlocking scripts, finalizing the change output if specified, and marking the transaction as sealed. Also calculates input contexts after sealing.
Returns
this
The sealed PSBT instance for method chaining.
setInputSequence()
setInputSequence(
inputIndex,sequence):this
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:380
Sets the sequence number for the specified input.
Parameters
inputIndex
number
The index of the input to modify
sequence
number
The sequence number to set
Returns
this
The PSBT instance for method chaining
Throws
If the PSBT is sealed (immutable)
Implementation of
Overrides
setLocktime()
setLocktime(
locktime):this
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:368
Sets the locktime for the PSBT (Partially Signed Opcat Transaction).
Parameters
locktime
number
The locktime value to set (in blocks or timestamp)
Returns
this
The PSBT instance for chaining
Throws
Error if the PSBT is already sealed
Implementation of
Overrides
setMaximumFeeRate()
setMaximumFeeRate(
satoshiPerByte):void
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:244
Parameters
satoshiPerByte
number
Returns
void
Implementation of
Inherited from
setSighashType()
setSighashType(
inputIndex,sigHashType):void
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:184
Sets the sighash type for a specific input index. Throws an error if attempting to set a different sighash type for the same input index.
Parameters
inputIndex
number
The index of the input to set the sighash type for.
sigHashType
The sighash type to set.
Returns
void
Throws
If the sighash type differs from the previously set type for the same input index.
Implementation of
setVersion()
setVersion(
version):this
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:357
Sets the version number of the PSBT.
Parameters
version
number
The version number to set.
Returns
this
The PSBT instance for chaining.
Throws
Error if the PSBT is sealed.
Implementation of
Overrides
signAllInputs()
signAllInputs(
keyPair,sighashTypes?):this
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:605
Parameters
keyPair
Signer
sighashTypes?
number[]
Returns
this
Implementation of
Inherited from
signAllInputsAsync()
signAllInputsAsync(
keyPair,sighashTypes?):Promise\<void>
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:627
Parameters
keyPair
Signer | SignerAsync
sighashTypes?
number[]
Returns
Promise\<void>
Implementation of
Inherited from
signAllInputsHD()
signAllInputsHD(
hdKeyPair,sighashTypes):this
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:512
Parameters
hdKeyPair
HDSigner
sighashTypes
number[] = ...
Returns
this
Implementation of
Inherited from
signAllInputsHDAsync()
signAllInputsHDAsync(
hdKeyPair,sighashTypes):Promise\<void>
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:535
Parameters
hdKeyPair
HDSigner | HDSignerAsync
sighashTypes
number[] = ...
Returns
Promise\<void>
Implementation of
Inherited from
signAndFinalize()
signAndFinalize(
signer):Promise\<void>
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:115
Signs the PSBT with the provided signer and finalizes all inputs.
Parameters
signer
The signer instance used to sign the PSBT.
Returns
Promise\<void>
A promise that resolves when signing and finalization are complete.
Implementation of
signInput()
signInput(
inputIndex,keyPair,sighashTypes?):this
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:661
Parameters
inputIndex
number
keyPair
Signer
sighashTypes?
number[]
Returns
this
Implementation of
Inherited from
signInputAsync()
signInputAsync(
inputIndex,keyPair,sighashTypes?):Promise\<void>
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:694
Parameters
inputIndex
number
keyPair
Signer | SignerAsync
sighashTypes?
number[]
Returns
Promise\<void>
Implementation of
Inherited from
signInputHD()
signInputHD(
inputIndex,hdKeyPair,sighashTypes):this
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:567
Parameters
inputIndex
number
hdKeyPair
HDSigner
sighashTypes
number[] = ...
Returns
this
Implementation of
Inherited from
signInputHDAsync()
signInputHDAsync(
inputIndex,hdKeyPair,sighashTypes):Promise\<void>
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:584
Parameters
inputIndex
number
hdKeyPair
HDSigner | HDSignerAsync
sighashTypes
number[] = ...
Returns
Promise\<void>
Implementation of
Inherited from
spendUTXO()
spendUTXO(
utxos):this
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:302
Add input(s) for current psbt to spend the utxos.
Parameters
utxos
the utxos to spend
Returns
this
this
toBase64()
toBase64():
string
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:1064
Converts the PSBT to Base64 string representation.
Returns
string
Base64 encoded PSBT data
Throws
If the PSBT is not sealed (must call seal() first)
Implementation of
Overrides
toBuffer()
toBuffer():
Uint8Array
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:1038
Converts the PSBT to a Uint8Array buffer.
Returns
Uint8Array
The serialized PSBT buffer.
Throws
If the PSBT is not sealed (must call seal() first).
Implementation of
Overrides
toHex()
toHex():
string
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:1052
Converts the PSBT to a hexadecimal string representation.
Returns
string
The hexadecimal string representation of the PSBT.
Throws
If the PSBT is not sealed (must call seal() first).
Implementation of
Overrides
txHashPreimage()
txHashPreimage():
string
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:1002
Generates the transaction hash preimage for the PSBT.
Returns
string
The transaction hash preimage as a hexadecimal string.
Throws
If the PSBT is not sealed (must call seal() first).
updateGlobal()
updateGlobal(
updateData):this
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:790
Parameters
updateData
PsbtGlobalUpdate
Returns
this
Implementation of
Inherited from
updateInput()
updateInput(
inputIndex,updateData):this
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:795
Parameters
inputIndex
number
updateData
PsbtInputUpdate
Returns
this
Implementation of
Inherited from
updateOutput()
updateOutput(
outputIndex,updateData):this
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:800
Parameters
outputIndex
number
updateData
PsbtOutputUpdate
Returns
this
Implementation of
Inherited from
validateSignaturesOfAllInputs()
validateSignaturesOfAllInputs(
validator):boolean
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:457
Parameters
validator
ValidateSigFunction
Returns
boolean
Implementation of
IExtPsbt.validateSignaturesOfAllInputs
Inherited from
Psbt.validateSignaturesOfAllInputs
validateSignaturesOfInput()
validateSignaturesOfInput(
inputIndex,validator,pubkey?):boolean
Defined in: packages/scrypt-ts-opcat/src/psbt/psbt.ts:465
Parameters
inputIndex
number
validator
ValidateSigFunction
pubkey?
Uint8Array
Returns
boolean
Implementation of
IExtPsbt.validateSignaturesOfInput
Inherited from
Psbt.validateSignaturesOfInput
fromBase64()
staticfromBase64(data,opts):ExtPsbt
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:142
Creates an ExtPsbt instance from a base64-encoded string.
Parameters
data
string
The base64-encoded PSBT data
opts
ExtPsbtOpts = {}
Optional configuration options for the ExtPsbt
Returns
A new ExtPsbt instance
Overrides
fromBuffer()
staticfromBuffer(buffer,opts):ExtPsbt
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:164
Creates an ExtPsbt instance from a buffer containing PSBT data.
Parameters
buffer
Uint8Array
The buffer containing the PSBT data.
opts
ExtPsbtOpts = {}
Optional parameters including network configuration.
Returns
A new ExtPsbt instance initialized with the PSBT data.
Overrides
fromHex()
staticfromHex(data,opts):ExtPsbt
Defined in: packages/scrypt-ts-opcat/src/psbt/extPsbt.ts:153
Creates an ExtPsbt instance from a hex string.
Parameters
data
string
Hex string representation of the PSBT data
opts
ExtPsbtOpts = {}
Optional configuration options for the ExtPsbt
Returns
A new ExtPsbt instance