BarkVtxo currently represents two different things:
- Wallet-owned VTXOs returned from wallet state APIs, where Bark exposes
WalletVtxo.state.
- 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';
};
BarkVtxocurrently represents two different things:WalletVtxo.state.sendArkoorPayment(), where Bark only returnsVtxoand no wallet state exists.This forced NitroArk to preserve the old
state: "unknown"fallback for bare VTXOs when restoringBarkVtxo.state.We should split the types so the API models this correctly: