feat: add TransferChecked (discriminator 12) to TypeScript SDK#2308
Open
feat: add TransferChecked (discriminator 12) to TypeScript SDK#2308
Conversation
Contributor
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (5)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Add checked transfer variant that validates decimals on-chain, matching SPL Token's transferChecked semantics. New instruction builders: - createLightTokenTransferCheckedInstruction: light-token specific (disc 12) - createTransferInterfaceInstruction: interface router for basic transfer - createTransferInterfaceCheckedInstruction: interface router for checked New action: - transferInterfaceChecked: high-level action with decimals validation TransferOptions gains checkedDecimals field used by createTransferInterfaceInstructions to select checked vs basic transfer.
fbe3f5c to
b908d37
Compare
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.
Summary
createLightTokenTransferCheckedInstruction(discriminator 12, 10-byte data: disc + u64 LE amount + u8 decimals, 4 accounts: source/mint/dest/authority)createTransferInterfaceInstructionandcreateTransferInterfaceCheckedInstructionas interface-level routers that dispatch to light-token, SPL, or T22transferInterfaceCheckedhigh-level action withdecimalsparametercheckedDecimalsoption toTransferOptionsfor instruction-level controlindex.tsandunified/index.tsBased on #2271 — TypeScript-only subset adapted to current naming (
LIGHT_TOKEN_PROGRAM_ID,createLightTokenTransferInstruction).Test plan
pnpm buildsucceeds injs/compressed-token.d.tsincludes all new exports