Sync Token 2022 IDL with the program interface#1210
Open
lorisleiva wants to merge 1 commit into
Open
Conversation
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 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.
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
transferAmountAuditorCiphertextLo/Hifields toconfidentialTransferandconfidentialTransferWithFee.configureConfidentialTransferAccountWithRegistryinstruction.recordaccount fromconfigureConfidentialTransferAccountandemptyConfidentialTransferAccount.confidentialWithdraw,confidentialTransferandconfidentialTransferWithFeeinstead of padding them with the program ID.Confidential Transfer Fee
withdrawWithheldAuthorityElGamalPubkeya required public key oninitializeConfidentialTransferFee.recordaccount fromwithdrawWithheldTokensFromMintForConfidentialTransferFeeandwithdrawWithheldTokensFromAccountsForConfidentialTransferFee.Confidential Mint Burn
initializeConfidentialMintBurn,rotateSupplyElgamalPubkey,updateConfidentialMintBurnDecryptableSupply,confidentialMint,confidentialBurnandapplyConfidentialPendingBurn.ConfidentialMintBurnextension account state.Permissioned Burn
permissionedConfidentialBurninstruction.Extension types
extensionTypeenum to match the program.confidentialMintBurnandpermissionedBurnvariants.Alignment with the Token program IDL
batchinstruction, modelled identically to the Token IDL.rentaccount tosyncNative.withdrawExcessLamportsaccounts tosource/destination.Misc
origin: "shank"field and set the version to3.0.1to match the interface crate.Client
The JS client was regenerated from the updated IDL. A few manual changes were also made: a new
ConfidentialMintBurncase ingetInitializeInstructionsForExtensions, an end-to-end test forinitializeConfidentialMintBurn, and updates to existing tests affected by the IDL changes.