Skip to content

ts: export all IDL types from main entry point#3948

Merged
acheroncrypto merged 6 commits into
otter-sec:masterfrom
dvrvsimi:idl-export
Jan 14, 2026
Merged

ts: export all IDL types from main entry point#3948
acheroncrypto merged 6 commits into
otter-sec:masterfrom
dvrvsimi:idl-export

Conversation

@dvrvsimi

@dvrvsimi dvrvsimi commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

Fixes #3793 by exporting all IDL types (IdlErrorCode, IdlEvent, IdlField, etc.) from the main @coral-xyz/anchor entry point, eliminating the need for deep imports from /dist/cjs/idl paths.

@vercel

vercel Bot commented Sep 17, 2025

Copy link
Copy Markdown

@dvrvsimi is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@0x4ka5h 0x4ka5h left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@acheroncrypto acheroncrypto left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original reason for why the IDL types weren't exported from the root was to allow us to make breaking changes (e.g. renaming of the types) without having to bump breaking versions. However, now that the IDL spec has been stable for quite a while, I don't see a problem exporting all of its types.

We can merge this once you remove the test file. It would also be helpful to mention this in the CHANGELOG to make people know that they can update their dist/cjs/idl imports.

Comment thread ts/packages/anchor/test-idl-exports.ts Outdated
Comment thread CHANGELOG.md Outdated

@acheroncrypto acheroncrypto left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@acheroncrypto acheroncrypto merged commit 702d2ef into otter-sec:master Jan 14, 2026
1 check failed
Otter-0x4ka5h pushed a commit to Otter-0x4ka5h/anchor that referenced this pull request Mar 25, 2026
Co-authored-by: acheron <98934430+acheroncrypto@users.noreply.github.com>
Co-authored-by: acheron <acheroncrypto@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export all IDL types so we don't have to import them from /dist/cjs/* paths

6 participants