Class BrowserExtensionWallet

This class acts as an adapter, consuming the raw, CBOR-based API of a CIP-30 wallet and exposing methods that return deserialized, object types from Cometa.

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 wallet's collateral UTxOs.

    Returns Promise<UTxO[]>

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

    Collateral is required for transactions involving Plutus smart contracts.

  • 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.

  • 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 transaction signature from the wallet and deserializes the resulting witness set.

    Parameters

    • txCbor: string

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

    • partialSign: boolean

      If true, the wallet will only add its witness for multi-signature transactions.

    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).