Avalanche SDK Client
    Preparing search index...

    Function buildUtxoBytes

    • Builds UTXO bytes from the given UTXO parameters.

      Parameters

      • txHash: string

        The transaction hash of the transaction which created this output.

      • outputIndex: number

        The index of the output in the transaction which created this output.

      • assetId: string

        The asset ID of the created output.

      • amount: string

        The amount of the asset held in this output.

      • addresses: string[]

        The addresses who can sign the transaction for consuming this output.

      • locktime: string

        The UNIX timestamp in seconds after which this output can be consumed.

      • threshold: number

        The threshold of the addresses who can sign the transaction for consuming this output.

      Returns `0x${string}`

      The UTXO hex string.

      import { buildUtxoBytes } from "@avalanche-sdk/client/utils";
      const utxoBytes = buildUtxoBytes(
      "mYxFK3CWs6iMFFaRx4wmVLDUtnktzm2o9Mhg9AG6JSzRijy5V",
      0,
      "U8iRqJoiJm8xZHAacmvYyZVwqQx6uDNtQeP3CQ6fcgQk3JqnK",
      "111947",
      ["P-fuji1nv6w7m6egkwhkcvz96ze3qmzyk5gt6csqz7ejq"],
      "0",
      1
      );