Skip to content

Conversation

@gavriliumircea
Copy link
Contributor

@gavriliumircea gavriliumircea commented Nov 6, 2025

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

@coderabbitai
Copy link

coderabbitai bot commented Nov 6, 2025

Walkthrough

This 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

  • feat: add solana idls #59: Adds identical Solana IDL definitions, associated structs/errors/index modules, Biome formatting configuration, and Solana package dependencies in parallel implementation.

Suggested reviewers

  • PaulRBerg
  • razgraf

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'feat: add solana idls' clearly and specifically describes the main change—adding Solana IDL (Interface Definition Language) files and related configurations.
Description check ✅ Passed The pull request description relates to the changeset by explaining the reason for the PR (replacing a previous PR due to merge order issues), providing context for the additions.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/add-solana-idls

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor Author

gavriliumircea commented Nov 6, 2025

Copy link
Contributor Author

gavriliumircea commented Nov 6, 2025

Merge activity

  • Nov 6, 3:51 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Nov 6, 3:51 PM UTC: @gavriliumircea merged this pull request with Graphite.

@gavriliumircea gavriliumircea merged commit 2ae777d into main Nov 6, 2025
2 of 3 checks passed
Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between a8f5c8d and 0f011b8.

⛔ Files ignored due to path filters (1)
  • bun.lock is 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.ts
  • src/solana/idl/lockup/v0.1/SablierLockupLinear/index.ts
  • src/solana/idl/airdrops/v0.1/SablierMerkleInstant/idl.json
  • src/solana/idl/airdrops/v0.1/SablierMerkleInstant/index.ts
  • src/solana/idl/lockup/v0.1/SablierLockupLinear/idl.ts
  • src/solana/idl/airdrops/v0.1/SablierMerkleInstant/structs.ts
  • src/solana/idl/lockup/v0.1/SablierLockupLinear/idl-type.ts
  • src/solana/idl/lockup/v0.1/SablierLockupLinear/structs.ts
  • src/solana/idl/lockup/v0.1/SablierLockupLinear/errors.ts
  • src/solana/idl/lockup/v0.1/SablierLockupLinear/idl.json
  • src/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)

Comment on lines +19 to 21
"@coral-xyz/anchor": "^0.30",
"@solana/web3.js": "^1.98",
"viem": "^2.32"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

Suggested change
"@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).

Comment on lines +729 to +758
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",
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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.

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.

2 participants