Merged
Conversation
…to typecheck the input
|
Size Change: +2.11 kB (+0.12%) Total Size: 1.76 MB
|
There was a problem hiding this comment.
Pull request overview
This PR applies a set of audit-driven type-safety and API-surface refinements across transactions, operation option typings, integer handling, and asset typing.
Changes:
- Tightened transaction internals by marking underscore-prefixed fields
privateand updated transaction cloning to use the publictxaccessor. - Refined Soroban integer type handling by improving
XdrLargeInttype guards and makingscValToBigIntreject invalid integer type derivations. - Adjusted operation option typings (auth/flags) and made
Asset.getAssetType()strictly returnAssetType(throwing on unsupported raw types).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/transaction_builder.ts | Uses public tx accessor when cloning operations. |
| src/transaction_base.ts | Marks internal transaction fields private; exposes access via getters/setters. |
| src/transaction.ts | Marks internal cached transaction fields private. |
| src/fee_bump_transaction.ts | Marks fee bump internals private. |
| src/scval.ts | Relies on XdrLargeInt.isType narrowing to pass typed integer kinds. |
| src/operations/types.ts | Updates flag-related option types and defines AuthFlag as const/type union. |
| src/operations/set_options.ts | Adds runtime validation for signer key/weight before constructing XDR signer. |
| src/numbers/xdr_large_int.ts | Stronger typing for type, improved isType predicate, getType returns undefined when not integer. |
| src/numbers/index.ts | Adds runtime guards when scIntType cannot be derived for integer ScVals. |
| src/asset.ts | Makes getAssetType() return only AssetType and throws on unsupported raw types. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
quietbits
approved these changes
Mar 25, 2026
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.
What
SetOptionsOpt.clearFlags,SetOptionsOpt.clearFlagsandAllowTrustOpts.authorizeto be typeAuthFlagfor alignment with manual type declarationsAsset.getAssetTypeto return justAssetType. The function now throws if the underlying asset isxdr.AssetType.assetTypePoolShare. Note that this should not be possible due to being unable to constructAssetfromxdr.AssetType.assetTypePoolShare.XdrLargeIntmethodsisTypenow properly typechecks andgetTypenow truncates and returnsScIntType_now are labeled private to prevent them from appearing in intellisense.