Class UnwrapTransaction

Unwrap transaction UnwrapTransaction

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

Properties

_maximumFeeRate: number = 100000000

The maximum fee rate of the transaction

calldata: Buffer

Calldata for the interaction

calldataGenerator: CalldataGenerator
chalk: ChalkInstance
compiledTargetScript: Buffer

The compiled target script

contractSecret: Buffer

Contract secret for the interaction

disableAutoRefund: boolean

Disable auto refund

enableLogs: boolean
estimatedFeeLoss: bigint = 0n

Estimated unwrap loss due to bitcoin fees in satoshis.

estimatedFees: bigint = 0n

The estimated fees of the transaction

feeOutput: null | PsbtOutputExtended = null

Output that will be used to pay the fees

feeRate: number

The fee rate of the transaction

finalized: boolean = false
from: string

The address where the transaction is sent from

hideLogs: boolean
ignoreSignatureErrors: boolean = false
inputs: PsbtInputExtended[] = []

The inputs of the transaction

isBrowser: boolean = false

Is the transaction being generated inside a browser?

isPubKeyDestination: boolean

Is the destionation P2PK

leftOverFundsScriptRedeem: null | Payment = null
logColor: string = '#785def'
moduleName: string
network: Network

The network where the transaction will be broadcasted

nonWitnessUtxo?: Buffer

Add a non-witness utxo to the transaction

optionalOutputs: undefined | PsbtOutputExtended[]

The transaction parameters

outputs: PsbtOutputExtended[] = []

The outputs of the transaction

overflowFees: bigint = 0n

The overflow fees of the transaction

priorityFee: bigint

The opnet priority fee of the transaction

randomBytes: Buffer

Random salt for the interaction

regenerated: boolean = false
scriptData: null | Payment = null

The script data of the transaction

scriptSigner: ECPairInterface | Signer

Script signer for the interaction

scriptTree: Taptree

The script tree

sequence: number = TransactionSequence.REPLACE_BY_FEE

The sequence of the transaction

sighashTypes: number[] = []

The sighash types for the transaction

signed: boolean = false

Was the transaction signed?

signer: ECPairInterface | Signer

The signer of the transaction

tapData: null | Payment = null

The tap data of the transaction

tapLeafScript: null | TapLeafScript = null

The tap leaf script

targetScriptRedeem: null | Payment = null
to: undefined | string

The address where the transaction is sent to

totalInputAmount: bigint

The total amount of satoshis in the inputs

transaction: Psbt

The transaction itself.

transactionFee: bigint = 0n

Cost in satoshis of the transaction fee

tweakedSigner?: ECPairInterface

Tweaked signer

type: WBTC_UNWRAP = TransactionType.WBTC_UNWRAP
updateInputs: UpdateInput[] = []

Inputs to update later on.

utxos: UTXO[]

The utxos used in the transaction

vaultUTXOs: VaultUTXOs[]

The vault UTXOs

LOCK_LEAF_SCRIPT: Buffer = ...
MAXIMUM_CALLDATA_SIZE: number = ...
MINIMUM_DUST: bigint = 330n

Methods

  • Parameters

    • Rest...args: string[]

    Returns void

  • Parameters

    • Rest...args: string[]

    Returns void

  • Parameters

    • Rest...args: string[]

    Returns void

  • Parameters

    • Rest...args: string[]

    Returns void

  • Parameters

    • msg1: string
    • highlight1: string
    • msg2: string
    • highlight2: string
    • msg3: string

    Returns void

  • Protected

    Generate an input for a vault UTXO

    Parameters

    • pubkeys: Buffer[]

      The public keys

    • minimumSignatures: number

      The minimum number of signatures

    Returns {
        internalPubkey: Buffer;
        network: Network;
        redeem: Payment;
        scriptTree: Taptree;
    }

    The tap tree

    • internalPubkey: Buffer
    • network: Network
    • redeem: Payment
    • scriptTree: Taptree

    If something went wrong

  • Returns bigint

    • The estimated fee loss or refund

    Get the estimated unwrap loss due to bitcoin fees in satoshis.

    If the number is negative, it means the user will get a refund.

    If the number is positive, it means the user will lose that amount.

  • Parameters

    • Rest...args: string[]

    Returns void

  • Parameters

    • Rest...args: string[]

    Returns void

  • Parameters

    • Rest...args: string[]

    Returns void

  • Parameters

    • Rest...args: string[]

    Returns void

  • Parameters

    • Rest...args: string[]

    Returns void

  • Parameters

    • Rest...args: string[]

    Returns void

  • Parameters

    • prefix: string

    Returns void

  • Parameters

    • Rest...args: string[]

    Returns void

  • Parameters

    • Rest...args: string[]

    Returns void

  • Parameters

    • Rest...args: string[]

    Returns void

  • Pre-estimate the transaction fees for a Taproot transaction

    Parameters

    • feeRate: bigint

      The fee rate in satoshis per virtual byte

    • numInputs: bigint

      The number of inputs

    • numOutputs: bigint

      The number of outputs

    • numWitnessElements: bigint

      The number of witness elements (e.g., number of control blocks and witnesses)

    • witnessElementSize: bigint

      The average size of each witness element in bytes

    • emptyWitness: bigint

      The amount of empty witnesses

    • OptionaltaprootControlWitnessSize: bigint = 32n

      The size of the control block witness in bytes

    • OptionaltaprootScriptSize: bigint = 139n

      The size of the taproot script in bytes

    Returns bigint

    • The estimated transaction fees