@arkade-os/sdk Documentation - v0.4.21
    Preparing search index...

    Class VtxoScript

    VtxoScript is a script that contains a list of tapleaf scripts. It is used to create virtual output scripts.

    ArkAddress

    const vtxoScript = new VtxoScript([new Uint8Array(32), new Uint8Array(32)]);
    

    Hierarchy (View Summary)

    Index

    Constructors

    • Create a virtual output script from its tapleaf scripts.

      Parameters

      • scripts: Bytes[]

        Raw tapscript bytes for each leaf

      Returns VtxoScript

      Error if the provided leaves cannot produce a valid Taproot tree

    Properties

    leaves: TapLeafScript[]
    scripts: Bytes[]

    Raw tapscript bytes for each leaf

    tweakedPublicKey: Bytes

    Accessors

    Methods

    • Build the Arkade address corresponding to this virtual output script.

      Parameters

      • prefix: string

        Bech32 human-readable prefix

      • serverPubKey: Bytes

        32-byte Arkade server public key

      Returns ArkAddress

      Arkade address for this script

      ArkAddress

    • Encode the virtual output script to a TapTree byte representation.

      Returns Bytes

      Encoded TapTree bytes

      decode

    • Look up a tapleaf script by its hex-encoded tapscript body.

      Parameters

      • scriptHex: string

        Hex-encoded tapscript body without the leaf version byte

      Returns TapLeafScript

      Matching tapleaf script

      Error if no matching leaf exists

    • Build the Taproot onchain address corresponding to this virtual output script.

      Parameters

      • network: BTC_NETWORK

        Bitcoin network descriptor

      Returns string

      Taproot onchain address

      address

    • Decode a virtual output script from an encoded TapTree.

      Parameters

      • tapTree: Bytes

        Encoded TapTree bytes

      Returns VtxoScript

      Decoded virtual output script

      Error if the TapTree cannot be decoded into a valid script set

      encode