Open
Conversation
…st 30 Replace circular static import pattern with createRequire to get real TronWeb statics (address utilities, Trx, toBigNumber) from the CJS build. This avoids the factory referencing its own mocked module, which caused 'TronWeb is not a constructor' under Jest 30's ESM mock hoisting.
…y into seed-signer-tron.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new Tron signer architecture, updates dependencies, and refactors the Tron wallet account implementation to improve modularity and maintainability. The main changes include the addition of a dedicated signers module, refactoring account creation to use signers, and updating package exports and dependencies.
Signer Architecture and Wallet Refactor
Signers module introduction:
src/signersmodule with a Tron-specific signer interface (ISignerTron) and a BIP-39 seed-based signer implementation (SeedSignerTron). This modularizes key management and signing logic for Tron accounts. [1] [2] [3]Wallet account refactor:
WalletAccountTronto use a child signer instance for account creation and signing, replacing the previous direct HDKey and key derivation logic. A legacyfromSeedfactory method is provided for backward compatibility. [1] [2]Dependency and Package Updates
Dependency upgrades:
tronweb,@noble/curves,@noble/hashes,@scure/bip32, and@tetherto/wdk-wallet(now referencing a GitHub branch). Also updated dev dependencies and theaxiosoverride.Exports and testing configuration:
package.jsonto export the new signers module and improved Jest configuration for integration tests.TronWeb Usage and Typing
TronWeb import and typing improvements:
wallet-account-read-only-tron.jsto use named imports and more precise type annotations forTronWebandTrx, ensuring compatibility with newer TronWeb versions. [1] [2] [3] [4]Signers module introduction and interface design [1] [2] [3]
Wallet account refactor to use signers [1] [2]
Dependency upgrades for security and compatibility
Exports and Jest test configuration improvements
TronWeb import and type annotation updates [1] [2] [3] [4]# Description