Skip to content

Commit

Permalink
feat: add value field to RuneUtxoBalance
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleO_O committed May 8, 2024
1 parent d30d6b6 commit 5423fa1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/indexer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export type RuneSpentUtxoBalance = RuneUtxoBalance & { spentTxid: string };
export type RuneUtxoBalance = {
txid: string;
vout: number;
value?: number;
address?: string;
scriptPubKey: Buffer;
runeId: RuneLocation;
Expand Down
4 changes: 3 additions & 1 deletion src/indexer/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function isScriptPubKeyHexOpReturn(scriptPubKeyHex: string) {
export type UpdaterTx = {
txid: string;
vin: ({ txid: string; vout: number; txinwitness: string[] } | { coinbase: string })[];
vout: { scriptPubKey: { hex: string; address?: string } }[];
vout: { scriptPubKey: { hex: string; address?: string }, value?: number }[];
};

export class RuneUpdater implements RuneBlockIndex {
Expand Down Expand Up @@ -298,6 +298,7 @@ export class RuneUpdater implements RuneBlockIndex {
txid: tx.txid,
vout,
address: output.scriptPubKey.address,
value: output.value,
});
}
}
Expand Down Expand Up @@ -466,6 +467,7 @@ export class RuneUpdater implements RuneBlockIndex {
runeTicker: additionalBalance.runeTicker,
amount: additionalBalance.amount,
spentTxid: tx.txid,
value: additionalBalance.value,
});
}
}
Expand Down

0 comments on commit 5423fa1

Please sign in to comment.