Class MultiSignTransaction

Create a multi sign p2tr transaction MultiSignTransaction

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

Properties

_maximumFeeRate: number = 100000000

The maximum fee rate of the transaction

chalk: ChalkInstance
compiledTargetScript: Buffer
enableLogs: boolean
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'
minimumSignatures: number
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

originalInputCount: number = 0
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

publicKeys: Buffer[]
receiver: string
refundVault: string
regenerated: boolean = false
requestedAmount: bigint
scriptData: null | Payment = null

The script data of the transaction

scriptTree: Taptree
sequence: number = TransactionSequence.REPLACE_BY_FEE

The sequence of the transaction

sighashTypes: number[] = MultiSignTransaction.signHashTypesArray

Sign hash types

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: MULTI_SIG = TransactionType.MULTI_SIG
updateInputs: UpdateInput[] = []

Inputs to update later on.

utxos: UTXO[]

The utxos used in the transaction

LOCK_LEAF_SCRIPT: Buffer = ...
MINIMUM_DUST: bigint = 330n
numsPoint: Buffer = ...
signHashTypesArray: number[] = []

Methods

  • Parameters

    • Rest...args: string[]

    Returns void

  • Parameters

    • Rest...args: string[]

    Returns void

  • Returns void

  • 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

  • Returns string

  • 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

  • Pre-estimate the transaction fees

    Parameters

    • feeRate: bigint

      The fee rate

    • numInputs: bigint

      The number of inputs

    • numOutputs: bigint

      The number of outputs

    • numSignatures: bigint

      The number of signatures

    • numPubkeys: bigint

      The number of public keys

    Returns bigint

    • The estimated transaction fees
  • Parameters

    • Rest...args: string[]

    Returns void

  • Parameters

    • prefix: string

    Returns void

  • Protected

    Signs an input of the transaction.

    Parameters

    • transaction: Psbt

      The transaction to sign

    • input: PsbtInput

      The input to sign

    • i: number

      The index of the input

    • Optionalsigner: ECPairInterface | Signer

      The signer to use

    Returns Promise<void>

  • Parameters

    • Rest...args: string[]

    Returns void

  • Parameters

    • Rest...args: string[]

    Returns void

  • Parameters

    • Rest...args: string[]

    Returns void

  • Attempt to finalize the inputs

    Parameters

    • psbt: Psbt

      The psbt

    • startIndex: number

      The start index

    • orderedPubKeys: Buffer[][]

      The ordered public keys

    • isFinal: boolean

      If the transaction is final

    Returns boolean

    True if the inputs were finalized

  • Dedupe signatures

    Parameters

    • original: TapScriptSig[]

      The original signatures

    • partial: TapScriptSig[]

      The partial signatures

    Returns TapScriptSig[]

    The deduped signatures

  • Partially finalize a P2TR MS transaction

    Parameters

    • inputIndex: number

      The input index

    • input: PsbtInput

      The input

    • partialSignatures: Buffer[]

      The partial signatures

    • orderedPubKeys: Buffer[]

      The ordered public keys

    • isFinal: boolean

      If the transaction is final

    Returns {
        finalScriptWitness: Buffer;
    }

    • finalScriptWitness: Buffer
  • 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
  • Partially sign the transaction

    Parameters

    • psbt: Psbt
    • signer: ECPairInterface | Signer
    • originalInputCount: number
    • minimums: number[]

    Returns {
        final: boolean;
        signed: boolean;
    }

    True if the transaction was signed

    • final: boolean
    • signed: boolean
  • Verify if that public key already signed the transaction

    Parameters

    • psbt: Psbt

      The psbt

    • signerPubKey: Buffer

      The signer public key

    Returns boolean

    True if the public key signed the transaction