Class SingleAddressWallet

A simple, single-address wallet implementation for programmatic use.

SingleAddressWallet

This class provides a straightforward wallet interface that manages a single payment and staking key pair derived from a specific path. It is not a full Hierarchical Deterministic (HD) wallet and does not perform address discovery. Its simplicity makes it ideal for testing, scripting, or backend applications where interaction with a single, known address is required.

Implements

Constructors

Methods

  • Creates and initializes a new transaction builder with the wallet's current state.

    Returns Promise<TransactionBuilder>

    A promise that resolves to a pre-configured TransactionBuilder instance.

    This method simplifies transaction construction by automatically pre-populating the builder with:

    1. The wallet's available UTxOs as inputs.
    2. The wallet's change address to receive any leftover funds.
    3. The network parameters from the wallet's provider.

    The returned builder is ready for you to add outputs and other transaction details.

  • Fetches and deserializes the total balance of all assets controlled by the wallet.

    Returns Promise<Value>

    A promise that resolves to a Value object representing the wallet's complete balance.

  • Fetches and deserializes the wallet's collateral UTxOs.

    Returns Promise<UTxO[]>

    A promise that resolves to an array of collateral TxOut objects.

    This method is currently not supported and always returns an empty array.

  • Returns the wallet's active public DRep (Delegated Representative) key.

    Returns Promise<string>

    A promise that resolves to the hex-encoded public DRep key.

  • Returns public stake keys from the wallet that are currently registered for on-chain governance voting.

    Returns Promise<string[]>

    A promise that resolves to an array of hex-encoded public stake keys.

    This method is currently not supported and always returns an empty array.

  • Returns public stake keys from the wallet that are NOT yet registered for on-chain governance voting.

    Returns Promise<string[]>

    A promise that resolves to an array of hex-encoded public stake keys.

    This method is currently not supported and always returns an empty array.

  • Fetches and parses all unused addresses controlled by the wallet.

    Returns Promise<Address[]>

    A promise that resolves to an array of parsed Address objects.

    This method is currently not supported and always returns an empty array.

  • Requests a CIP-8 compliant data signature from the wallet.

    Parameters

    • address: string | Address

      The address to sign with (as an Address object or Bech32 string).

    • payload: string

      The hex-encoded data payload to be signed.

    Returns Promise<{ key: string; signature: string }>

    A promise that resolves to the signature and public key.

  • Requests a signature for a transaction using the wallet's keys.

    Parameters

    • txCbor: string

      The transaction to be signed, provided as a CBOR hex string.

    • _partialSign: boolean

      A flag to control which credentials are used for signing.

    Returns Promise<VkeyWitnessSet>

    A promise that resolves to the deserialized VkeyWitnessSet.

  • Submits a fully signed transaction to the blockchain via the wallet's provider.

    Parameters

    • txCbor: string

      The fully signed transaction as a CBOR hex string.

    Returns Promise<string>

    A promise that resolves to the transaction ID (hash).