Skip to content

Tsm final audit fixes#950

Merged
Ryang-21 merged 8 commits intotypescript-migrationfrom
tsm-final-audit-fixes
Mar 25, 2026
Merged

Tsm final audit fixes#950
Ryang-21 merged 8 commits intotypescript-migrationfrom
tsm-final-audit-fixes

Conversation

@Ryang-21
Copy link
Contributor

What

  • Refactored SetOptionsOpt.clearFlags, SetOptionsOpt.clearFlags and AllowTrustOpts.authorize to be type AuthFlag for alignment with manual type declarations
  • Reverted Asset.getAssetType to return just AssetType. The function now throws if the underlying asset is xdr.AssetType.assetTypePoolShare. Note that this should not be possible due to being unable to construct Asset from xdr.AssetType.assetTypePoolShare.
  • XdrLargeInt methods isType now properly typechecks and getType now truncates and returns ScIntType
  • Internal Transaction class fields starting with _ now are labeled private to prevent them from appearing in intellisense.

@github-actions
Copy link

github-actions bot commented Mar 24, 2026

Size Change: +2.11 kB (+0.12%)

Total Size: 1.76 MB

Filename Size Change
dist/stellar-base.cjs.js 696 kB +825 B (+0.12%)
dist/stellar-base.js 715 kB +848 B (+0.12%)
dist/stellar-base.min.js 346 kB +439 B (+0.13%)

compressed-size-action

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 private and updated transaction cloning to use the public tx accessor.
  • Refined Soroban integer type handling by improving XdrLargeInt type guards and making scValToBigInt reject invalid integer type derivations.
  • Adjusted operation option typings (auth/flags) and made Asset.getAssetType() strictly return AssetType (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.

@Ryang-21 Ryang-21 merged commit 0076d52 into typescript-migration Mar 25, 2026
7 checks passed
@Ryang-21 Ryang-21 deleted the tsm-final-audit-fixes branch March 25, 2026 17:07
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