Conversation
services/chronikService.ts
Outdated
| console.log(`${this.CHRONIK_MSG_PREFIX}: [${msg.msgType}] ${msg.txid}`) | ||
| const transaction = await this.chronik.tx(msg.txid) | ||
| const addressesWithTransactions = await this.getAddressesForTransaction(transaction) | ||
| const inputAddresses = transaction.inputs.map(inp => outputScriptToAddress(this.networkSlug, inp.outputScript)) |
There was a problem hiding this comment.
Can we sort this by amount contributed by each address?
Also, if 2 or more inputs use the same address, does this already consolidate them to only show them in the addressInput list once?
ws-service/types.ts
Outdated
| timestamp: number | ||
| address: string | ||
| rawMessage: string | ||
| inputAddresses?: Array<string | undefined> |
There was a problem hiding this comment.
I don't get this typing (here and in the other parts of this PR where this same type appears): Array<string | undefined> . The function you created, getInputAddresses, returns string[], so why this undefined?
services/chronikService.ts
Outdated
| } | ||
| } | ||
|
|
||
| private getInputAddresses (transaction: Tx_InNode): string[] { |
There was a problem hiding this comment.
maybe call this getSortedInputAddresses since is does that
services/chronikService.ts
Outdated
| } | ||
| for (const transaction of blockTxsToSync) { | ||
| const addressesWithTransactions = await this.getAddressesForTransaction(transaction) | ||
| const inputAddresses = transaction.inputs.map(inp => outputScriptToAddress(this.networkSlug, inp.outputScript)) |
There was a problem hiding this comment.
why not use the function you created here? Why sorted input addresses elsewhere but not here?
|
Tested and it works as expected (checked a few edge cases just to be sure) but I'll wait to approve until @chedieck has done so. |
|
Conflicts. |
db5c50c to
9c0c7df
Compare
|
resolved |
Related to #916
Description
Send input addresses in broadcast incoming tx data, this will be used in paybutton client, this will make input addresses available on client callbacks
Test plan