Skip to content

Conversation

@samholmes
Copy link
Contributor

@samholmes samholmes commented Oct 24, 2025

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

none

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementation has some vibes. I've tested it in the GUI and can confirm that the change-server is now detecting internal transactions in real-time using a localhost change-server against the GUI.

src/hub.ts Outdated
Comment on lines 206 to 209
logger.warn('Scan address failed: ' + String(error))
logger.warn(
'stack trace: ' + JSON.stringify(String(error.stack))
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the error.stack is a superset of error.message, you'll get double logs. How about:

logger.warn( 'Scan address failed: ' + stackify(error))

...
function stackify(error: unknown): string {
  if (error instanceof Error) return error.stack
  return JSON.stringify(error)
}

Comment on lines 173 to 176
try {
if (node.value != null) value = BigInt(node.value)
} catch {}
if (value > 0n) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we could just do node.value !== '0' here? Why do we even care about the value? All we need is some kind of action on the address - the engine can sort out the values.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, maybe be more noisy is a good idea.

)
)

const walk = (node: any): void => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, and do we really need all the any's in here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because viem doesn't support these RPC methods, the "any" cascades.

@samholmes
Copy link
Contributor Author

An alternative to this fix to try these RPC calls to detect internal transactions, we can opt to fix this more properly using etherscan: https://docs.etherscan.io/api-reference/endpoint/txlistinternal-blockrange

But this is an interim solution that when an RPC node supports these methods, will work at least from what I've tested. It's not the cleanest because it's using RPC methods that aren't typed by the library.

@samholmes samholmes merged commit 1eb4b94 into main Nov 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants