Skip to content

fix(sdk): set maxTopUp to u16::MAX in all instruction builders#2291

Open
tilo-14 wants to merge 1 commit intomainfrom
fix/wrap-max-top-up
Open

fix(sdk): set maxTopUp to u16::MAX in all instruction builders#2291
tilo-14 wants to merge 1 commit intomainfrom
fix/wrap-max-top-up

Conversation

@tilo-14
Copy link
Contributor

@tilo-14 tilo-14 commented Feb 15, 2026

Summary

  • 7 TS instruction builders hardcoded maxTopUp: 0 (no top-ups allowed), causing MaxTopUpExceeded (0x467b) when writing to accounts with compressible extensions
  • PR refactor: max top to be u16::MAX #2279 fixed mint-to.ts but missed the rest
  • Set all to 65535 (u16::MAX = no limit), matching the Rust SDK default (Transfer2Config::default(), MintActionCompressedInstructionData::new())

Files changed

File Format
wrap.ts Transfer2
unwrap.ts Transfer2
create-decompress-interface-instruction.ts Transfer2
create-mint.ts MintAction
decompress-mint.ts MintAction
mint-to-compressed.ts MintAction
update-mint.ts MintAction
update-metadata.ts MintAction

Test plan

  • SDK builds (LIGHT_PROTOCOL_VERSION=V2 pnpm run build)
  • 197/197 unit tests pass (vitest run tests/unit)
  • e2e: wrap (11/11), unwrap (10/10), create-mint (2/2), mint-to-compressed (4/4), update-mint (5/5), update-metadata (9/9)

PR #2279 fixed mint-to but missed 7 other instruction builders that
hardcoded maxTopUp: 0 (no top-ups allowed). The on-chain program
rejects any rent top-up with MaxTopUpExceeded (0x467b) when maxTopUp
is 0. Set to 65535 (u16::MAX = no limit) to match the Rust SDK default.

Files changed:
- wrap.ts, unwrap.ts, create-decompress-interface-instruction.ts
- create-mint.ts, decompress-mint.ts, mint-to-compressed.ts
- update-mint.ts, update-metadata.ts
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 15, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (8)
  • js/compressed-token/src/v3/instructions/create-decompress-interface-instruction.ts is excluded by none and included by none
  • js/compressed-token/src/v3/instructions/create-mint.ts is excluded by none and included by none
  • js/compressed-token/src/v3/instructions/decompress-mint.ts is excluded by none and included by none
  • js/compressed-token/src/v3/instructions/mint-to-compressed.ts is excluded by none and included by none
  • js/compressed-token/src/v3/instructions/unwrap.ts is excluded by none and included by none
  • js/compressed-token/src/v3/instructions/update-metadata.ts is excluded by none and included by none
  • js/compressed-token/src/v3/instructions/update-mint.ts is excluded by none and included by none
  • js/compressed-token/src/v3/instructions/wrap.ts is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/wrap-max-top-up

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tilo-14 tilo-14 changed the title fix(ts-sdk): set maxTopUp to u16::MAX in all instruction builders fix(sdk): set maxTopUp to u16::MAX in all instruction builders Feb 15, 2026
@ananas-block
Copy link
Contributor

looks correct to me

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.

2 participants