[JS] Add Pausable Extension to IDL & TS client#485
Merged
joncinque merged 3 commits intosolana-program:mainfrom Jun 6, 2025
Merged
[JS] Add Pausable Extension to IDL & TS client#485joncinque merged 3 commits intosolana-program:mainfrom
joncinque merged 3 commits intosolana-program:mainfrom
Conversation
joncinque
approved these changes
Jun 6, 2025
Contributor
joncinque
left a comment
There was a problem hiding this comment.
I mainly checked the IDL, and it looks great to me! A small nit on typing, which you can take or leave
Comment on lines
+7572
to
+7577
| "type": { | ||
| "kind": "zeroableOptionTypeNode", | ||
| "item": { | ||
| "kind": "publicKeyTypeNode" | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
Technically, this is just a public key, but it shouldn't make a difference -- the program will fail if provided a None
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.
Add Pausable Extension to IDL, TypeScript Client, and Tests
Summary
This PR adds the Pausable extension to the Token-2022 ts library. It updates the IDL, generates the relevant TypeScript client code, and adds tests to ensure correct behavior for initializing, pausing, and resuming mints with the pausable extension.
Changes
1. IDL Update
program/idl.jsonto include thePausableConfigextension, supporting new instructions for pausing and resuming mints.2. TypeScript Generated Client Code
initializePausableConfig.tspause.tsresume.tsindex.tsto export new instructions.programs/token2022.ts,types/extension.ts, andtypes/extensionType.tsto support the new extension.getInitializeInstructionsForExtensions.tsto handle pausable config initialization.3. Tests
clients/js/test/extensions/pausable/:initializePausable.test.ts: Verifies mint initialization with the pausable extension.pause.test.ts: Ensures a mint can be paused and the state is reflected on-chain.resume.test.ts: Ensures a paused mint can be resumed and the state is updated accordingly.