-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add value field to RuneUtxoBalance #61
feat: add value field to RuneUtxoBalance #61
Conversation
src/indexer/types.ts
Outdated
@@ -101,6 +101,7 @@ export type RuneSpentUtxoBalance = RuneUtxoBalance & { spentTxid: string }; | |||
export type RuneUtxoBalance = { | |||
txid: string; | |||
vout: number; | |||
value?: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be optional, there is always a value associated. Also, please rename to satValue
, just to further disambiguate from amount
that represents the rune count.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice suggestion
src/indexer/updater.ts
Outdated
@@ -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 }[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note UpdaterTx is just a view of Tx from rpcclient of the fields needed, and value is a required field. Thus I'd make value required here too.
* feat: add value field to RuneUtxoBalance * fix: fix value to satValue in RuneUtxoBalance * fix: fix test/updater.test.ts for utxoBalance * fix: make value is a required field * fix: fix update.test.ts for value --------- Co-authored-by: KyleO_O <>
Add value field to RuneUtxoBalance