Skip to content

Split stateful and raw VTXO types #42

Description

@hsjoberg

BarkVtxo currently represents two different things:

  1. Wallet-owned VTXOs returned from wallet state APIs, where Bark exposes WalletVtxo.state.
  2. Bare/raw VTXOs returned from APIs like sendArkoorPayment(), where Bark only returns Vtxo and no wallet state exists.

This forced NitroArk to preserve the old state: "unknown" fallback for bare VTXOs when restoring BarkVtxo.state.

We should split the types so the API models this correctly:

export type BarkRawVtxo = {
  amount: number;
  expiry_height: number;
  server_pubkey: string;
  exit_delta: number;
  anchor_point: string;
  point: string;
};

export type BarkVtxo = BarkRawVtxo & {
  state: 'Spendable' | 'Spent' | 'Locked';
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions