message: feat(core): add parseOutputId to utxo/unspent.ts
  Issue:
diff: @@ -52,3 +52,23 @@ export function isReplayProtectionUnspent(u: Unspent, network: utxolib.Network):
  export function isWalletUnspent(u: Unspent): u is WalletUnspent {
  return u.chain !== undefined;
  }
  +
  +export function parseOutputId(id: string): { txid: string; vout: number } {
  + const parts = id.split(':');
  + if (parts.length !== 2) {
  + throw new Error(`invalid outputId, must have format txid:vout`);
  + }
  + const [txid, voutStr] = parts;
  + const vout = Number(voutStr);
  + if (txid.length !== 64) {
  + throw new Error(`invalid txid ${txid} ${txid.length}`);
  + }
  + if (Number.isNaN(vout) || vout < 0 || !Number.isSafeInteger(vout)) {
  + throw new Error(`invalid vout: must be integer >= 0`);
  + }
  + return { txid, vout };
  +}
  +
  +export function formatOutputId(txid: string, vout: number): string {
  + return `${txid}:${vout}`;
  +}
  