-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add solana idls #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis PR introduces complete Solana IDL (Interface Definition Language) definitions for two programs: SablierMerkleInstant (airdrops v0.1) and SablierLockupLinear (lockup v0.1). Each program IDL includes instruction schemas, account definitions, event types, error codes, and corresponding data structures. Additionally, TypeScript type definitions, error mappings, and index modules are created for both programs. The PR updates package.json with Anchor and Solana web3.js dependencies, and adds Biome configuration files to control formatting behavior for IDL files. Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ 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 |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Merge activity
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (15)
biome.jsonc(1 hunks)package.json(1 hunks)src/solana/idl/airdrops/v0.1/SablierMerkleInstant/errors.ts(1 hunks)src/solana/idl/airdrops/v0.1/SablierMerkleInstant/idl-type.ts(1 hunks)src/solana/idl/airdrops/v0.1/SablierMerkleInstant/idl.json(1 hunks)src/solana/idl/airdrops/v0.1/SablierMerkleInstant/idl.ts(1 hunks)src/solana/idl/airdrops/v0.1/SablierMerkleInstant/index.ts(1 hunks)src/solana/idl/airdrops/v0.1/SablierMerkleInstant/structs.ts(1 hunks)src/solana/idl/biome.jsonc(1 hunks)src/solana/idl/lockup/v0.1/SablierLockupLinear/errors.ts(1 hunks)src/solana/idl/lockup/v0.1/SablierLockupLinear/idl-type.ts(1 hunks)src/solana/idl/lockup/v0.1/SablierLockupLinear/idl.json(1 hunks)src/solana/idl/lockup/v0.1/SablierLockupLinear/idl.ts(1 hunks)src/solana/idl/lockup/v0.1/SablierLockupLinear/index.ts(1 hunks)src/solana/idl/lockup/v0.1/SablierLockupLinear/structs.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: gavriliumircea
Repo: sablier-labs/sdk PR: 59
File: src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.ts:729-741
Timestamp: 2025-11-06T12:56:58.843Z
Learning: IDL files under src/solana/idl/ in the sablier-labs/sdk repository are auto-generated from the Solana Anchor programs and should not be manually edited. Any documentation or structural issues should be addressed in the source Rust program code, not in the generated TypeScript IDL files.
📚 Learning: 2025-11-06T12:56:58.843Z
Learnt from: gavriliumircea
Repo: sablier-labs/sdk PR: 59
File: src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.ts:729-741
Timestamp: 2025-11-06T12:56:58.843Z
Learning: IDL files under src/solana/idl/ in the sablier-labs/sdk repository are auto-generated from the Solana Anchor programs and should not be manually edited. Any documentation or structural issues should be addressed in the source Rust program code, not in the generated TypeScript IDL files.
Applied to files:
src/solana/idl/airdrops/v0.1/SablierMerkleInstant/idl.tssrc/solana/idl/lockup/v0.1/SablierLockupLinear/index.tssrc/solana/idl/airdrops/v0.1/SablierMerkleInstant/idl.jsonsrc/solana/idl/airdrops/v0.1/SablierMerkleInstant/index.tssrc/solana/idl/lockup/v0.1/SablierLockupLinear/idl.tssrc/solana/idl/airdrops/v0.1/SablierMerkleInstant/structs.tssrc/solana/idl/lockup/v0.1/SablierLockupLinear/idl-type.tssrc/solana/idl/lockup/v0.1/SablierLockupLinear/structs.tssrc/solana/idl/lockup/v0.1/SablierLockupLinear/errors.tssrc/solana/idl/lockup/v0.1/SablierLockupLinear/idl.jsonsrc/solana/idl/airdrops/v0.1/SablierMerkleInstant/idl-type.ts
🧬 Code graph analysis (10)
src/solana/idl/airdrops/v0.1/SablierMerkleInstant/idl.ts (1)
src/solana/idl/lockup/v0.1/SablierLockupLinear/idl.ts (1)
idl(1-1396)
src/solana/idl/lockup/v0.1/SablierLockupLinear/index.ts (2)
src/solana/idl/lockup/v0.1/SablierLockupLinear/idl-type.ts (1)
IDL(1-1833)src/solana/idl/lockup/v0.1/SablierLockupLinear/errors.ts (1)
ErrorNames(20-20)
src/solana/idl/airdrops/v0.1/SablierMerkleInstant/errors.ts (1)
src/solana/idl/lockup/v0.1/SablierLockupLinear/errors.ts (2)
errorCodes(2-18)ErrorNames(20-20)
src/solana/idl/airdrops/v0.1/SablierMerkleInstant/index.ts (2)
src/solana/idl/airdrops/v0.1/SablierMerkleInstant/idl-type.ts (1)
IDL(1-781)src/solana/idl/airdrops/v0.1/SablierMerkleInstant/errors.ts (1)
ErrorNames(9-9)
src/solana/idl/lockup/v0.1/SablierLockupLinear/idl.ts (1)
src/solana/idl/airdrops/v0.1/SablierMerkleInstant/idl.ts (1)
idl(1-631)
src/solana/idl/airdrops/v0.1/SablierMerkleInstant/structs.ts (1)
src/solana/idl/lockup/v0.1/SablierLockupLinear/structs.ts (2)
FeesCollected(23-23)Treasury(45-50)
src/solana/idl/lockup/v0.1/SablierLockupLinear/idl-type.ts (1)
src/solana/idl/airdrops/v0.1/SablierMerkleInstant/idl-type.ts (1)
IDL(1-781)
src/solana/idl/lockup/v0.1/SablierLockupLinear/structs.ts (1)
src/solana/idl/airdrops/v0.1/SablierMerkleInstant/structs.ts (2)
FeesCollected(42-42)Treasury(44-49)
src/solana/idl/lockup/v0.1/SablierLockupLinear/errors.ts (1)
src/solana/idl/airdrops/v0.1/SablierMerkleInstant/errors.ts (2)
errorCodes(1-7)ErrorNames(9-9)
src/solana/idl/airdrops/v0.1/SablierMerkleInstant/idl-type.ts (1)
src/solana/idl/lockup/v0.1/SablierLockupLinear/idl-type.ts (1)
IDL(1-1833)
| "@coral-xyz/anchor": "^0.30", | ||
| "@solana/web3.js": "^1.98", | ||
| "viem": "^2.32" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align Anchor peer range with runtime dependency.
We now depend on @coral-xyz/anchor@^0.32.1, but the peer range still advertises ^0.30. That mismatch will either force downstream projects to install two divergent majors or block installation altogether. Please bump the peer dependency to the same major (^0.32) so consumers resolve a single compatible copy. (classic.yarnpkg.com)
"peerDependencies": {
- "@coral-xyz/anchor": "^0.30",
+ "@coral-xyz/anchor": "^0.32",
"@solana/web3.js": "^1.98",
"viem": "^2.32"
},📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "@coral-xyz/anchor": "^0.30", | |
| "@solana/web3.js": "^1.98", | |
| "viem": "^2.32" | |
| "peerDependencies": { | |
| "@coral-xyz/anchor": "^0.32", | |
| "@solana/web3.js": "^1.98", | |
| "viem": "^2.32" | |
| }, |
🤖 Prompt for AI Agents
In package.json around lines 19 to 21, the peer dependency range for
@coral-xyz/anchor is ^0.30 which conflicts with the runtime dependency
@coral-xyz/anchor@^0.32.1; update the peerDependencies entry to use the
compatible major range ^0.32 so consumers resolve a single compatible copy
(replace ^0.30 with ^0.32).
| name: "refundable_amount_of", | ||
| docs: [ | ||
| "Calculates the amount that the sender would be refunded if the stream were canceled, denoted in units of the", | ||
| "token's decimals.", | ||
| "", | ||
| "# Accounts Expected", | ||
| "", | ||
| "- `stream_nft_mint` The stream NFT mint uniquely identifying the stream.", | ||
| "", | ||
| "# Requirements", | ||
| "", | ||
| "- The stream does not exist.", | ||
| ], | ||
| discriminator: [160, 136, 114, 120, 234, 178, 146, 58], | ||
| accounts: [ | ||
| { | ||
| name: "stream_data", | ||
| docs: ["Read account: the account storing stream details."], | ||
| pda: { | ||
| seeds: [ | ||
| { kind: "const", value: [115, 116, 114, 101, 97, 109, 95, 100, 97, 116, 97] }, | ||
| { kind: "account", path: "stream_nft_mint" }, | ||
| ], | ||
| }, | ||
| }, | ||
| { name: "stream_nft_mint", docs: ["Read account: the mint account for the stream NFT."] }, | ||
| ], | ||
| args: [], | ||
| returns: "u64", | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix inverted requirement in view docs.
The docstring for refundable_amount_of (and likewise status_of, streamed_amount_of, and withdrawable_amount_of) claims “The stream does not exist.” under Requirements, but each instruction explicitly loads the stream_data PDA and therefore requires the stream to exist. That inverted wording will mislead integrators. Please correct the Rust doc comments so the regenerated IDL states that the stream must exist, then refresh these generated artifacts. Based on learnings
🤖 Prompt for AI Agents
In src/solana/idl/lockup/v0.1/SablierLockupLinear/idl.ts around lines 729 to
758, the Requirements docstring is inverted ("The stream does not exist.");
update the original Rust source doc comments for refundable_amount_of (and the
similarly affected functions status_of, streamed_amount_of,
withdrawable_amount_of) to state that the stream must exist (e.g., "The stream
must exist."), then regenerate the IDL and refresh the generated artifacts so
the corrected wording is reflected in this file.

This pr replaces #59. This is need because of a merge order mistake that I did.