Skip to content

Sync Token 2022 IDL with the program interface#1210

Open
lorisleiva wants to merge 1 commit into
mainfrom
loris/fix-idl-program-interface-sync
Open

Sync Token 2022 IDL with the program interface#1210
lorisleiva wants to merge 1 commit into
mainfrom
loris/fix-idl-program-interface-sync

Conversation

@lorisleiva
Copy link
Copy Markdown
Member

This PR brings the hand-written Token 2022 IDL (interface/idl.json) back in sync with the actual program interface, including all extensions. It fixes incorrect instruction data layouts and account lists, adds missing instructions, and aligns the IDL with the original Token program IDL where they share instructions.

Confidential Transfer

  • Add the missing transferAmountAuditorCiphertextLo/Hi fields to confidentialTransfer and confidentialTransferWithFee.
  • Add the missing configureConfidentialTransferAccountWithRegistry instruction.
  • Remove the extraneous record account from configureConfidentialTransferAccount and emptyConfidentialTransferAccount.
  • Omit absent optional proof accounts on confidentialWithdraw, confidentialTransfer and confidentialTransferWithFee instead of padding them with the program ID.

Confidential Transfer Fee

  • Make withdrawWithheldAuthorityElGamalPubkey a required public key on initializeConfidentialTransferFee.
  • Remove the extraneous record account from withdrawWithheldTokensFromMintForConfidentialTransferFee and withdrawWithheldTokensFromAccountsForConfidentialTransferFee.

Confidential Mint Burn

  • Add the entire extension, previously missing: initializeConfidentialMintBurn, rotateSupplyElgamalPubkey, updateConfidentialMintBurnDecryptableSupply, confidentialMint, confidentialBurn and applyConfidentialPendingBurn.
  • Fill in the empty ConfidentialMintBurn extension account state.

Permissioned Burn

  • Add the missing permissionedConfidentialBurn instruction.

Extension types

  • Fix the order of the extensionType enum to match the program.
  • Add the missing confidentialMintBurn and permissionedBurn variants.

Alignment with the Token program IDL

  • Add the batch instruction, modelled identically to the Token IDL.
  • Add the optional rent account to syncNative.
  • Rename withdrawExcessLamports accounts to source/destination.

Misc

  • Remove the origin: "shank" field and set the version to 3.0.1 to match the interface crate.

Client

The JS client was regenerated from the updated IDL. A few manual changes were also made: a new ConfidentialMintBurn case in getInitializeInstructionsForExtensions, an end-to-end test for initializeConfidentialMintBurn, and updates to existing tests affected by the IDL changes.

This PR brings the hand-written Token 2022 IDL (`interface/idl.json`) back in sync with the actual program interface, including all extensions. It fixes incorrect instruction data layouts and account lists, adds missing instructions, and aligns the IDL with the original Token program IDL where they share instructions.

## Confidential Transfer

- Add the missing `transferAmountAuditorCiphertextLo`/`Hi` fields to `confidentialTransfer` and `confidentialTransferWithFee`.
- Add the missing `configureConfidentialTransferAccountWithRegistry` instruction.
- Remove the extraneous `record` account from `configureConfidentialTransferAccount` and `emptyConfidentialTransferAccount`.
- Omit absent optional proof accounts on `confidentialWithdraw`, `confidentialTransfer` and `confidentialTransferWithFee` instead of padding them with the program ID.

## Confidential Transfer Fee

- Make `withdrawWithheldAuthorityElGamalPubkey` a required public key on `initializeConfidentialTransferFee`.
- Remove the extraneous `record` account from `withdrawWithheldTokensFromMintForConfidentialTransferFee` and `withdrawWithheldTokensFromAccountsForConfidentialTransferFee`.

## Confidential Mint Burn

- Add the entire extension, previously missing: `initializeConfidentialMintBurn`, `rotateSupplyElgamalPubkey`, `updateConfidentialMintBurnDecryptableSupply`, `confidentialMint`, `confidentialBurn` and `applyConfidentialPendingBurn`.
- Fill in the empty `ConfidentialMintBurn` extension account state.

## Permissioned Burn

- Add the missing `permissionedConfidentialBurn` instruction.

## Extension types

- Fix the order of the `extensionType` enum to match the program.
- Add the missing `confidentialMintBurn` and `permissionedBurn` variants.

## Alignment with the Token program IDL

- Add the `batch` instruction, modelled identically to the Token IDL.
- Add the optional `rent` account to `syncNative`.
- Rename `withdrawExcessLamports` accounts to `source`/`destination`.

## Misc

- Remove the `origin: "shank"` field and set the version to `3.0.1` to match the interface crate.

## Client

The JS client was regenerated from the updated IDL. A few manual changes were also made: a new `ConfidentialMintBurn` case in `getInitializeInstructionsForExtensions`, an end-to-end test for `initializeConfidentialMintBurn`, and updates to existing tests affected by the IDL changes.
@lorisleiva lorisleiva marked this pull request as ready for review June 2, 2026 09:12
@lorisleiva lorisleiva requested a review from joncinque June 2, 2026 09:13
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.

1 participant