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

    Class Script

    DelegateVtxo.Script extends DefaultVtxo.Script and adds a delegate path.

    const vtxoScript = new DelegateVtxo.Script({
    pubKey: new Uint8Array(32),
    serverPubKey: new Uint8Array(32),
    delegatePubKey: new Uint8Array(32),
    });

    console.log("script pub key:", vtxoScript.pkScript)

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    defaultVtxo: DefaultVtxo.Script
    delegateScript: string
    leaves: TapLeafScript[]
    scripts: Bytes[]

    Raw tapscript bytes for each leaf

    tweakedPublicKey: Bytes

    Accessors

    • get pkScript(): Bytes

      Returns Bytes

    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