Skip to content

Conversation

@gavriliumircea
Copy link
Contributor

@gavriliumircea gavriliumircea commented Oct 20, 2025

This pr aims to add support for the Solana idls for the Sablier contracts

Copy link
Contributor Author

gavriliumircea commented Oct 20, 2025

razgraf
razgraf previously approved these changes Oct 20, 2025
@gavriliumircea gavriliumircea force-pushed the 10-20-feat_add_solana_idls branch from d331a7c to 2992554 Compare October 21, 2025 07:35
PaulRBerg

This comment was marked as outdated.

@gavriliumircea

This comment was marked as outdated.

@gavriliumircea

This comment was marked as resolved.

@PaulRBerg

This comment was marked as resolved.

@gavriliumircea gavriliumircea changed the base branch from 10-20-feat_add_package.json_exports to graphite-base/59 October 22, 2025 14:29
@gavriliumircea gavriliumircea force-pushed the 10-20-feat_add_solana_idls branch from 2992554 to e3cb44d Compare October 22, 2025 14:29
@coderabbitai
Copy link

coderabbitai bot commented Oct 22, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds comprehensive Solana Anchor IDLs, TypeScript IDL types, structs, and error code modules for two programs: SablierMerkleInstant (airdrops/v1.0) and SablierLockupLinear (lockup/v1.0). Introduces index aggregators exposing idl, structs, and errorCodes, along with new biome.jsonc and src/solana/idl/biome.jsonc formatting rules. Adds @coral-xyz/anchor and @solana/web3.js to package.json (also mirrored in peerDependencies). No runtime logic changes beyond new IDL/type/error declarations.

Suggested reviewers

  • razgraf

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add solana idls' directly and clearly summarizes the main change—adding Solana IDL artifacts to the repository.
Description check ✅ Passed The description states the PR aims to add support for Solana IDLs for Sablier contracts, which aligns with the changeset containing multiple Solana IDL files and configurations.
✨ 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 10-20-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.

@gavriliumircea gavriliumircea changed the base branch from graphite-base/59 to refactor/extract-evm-directory October 22, 2025 14:30
@gavriliumircea gavriliumircea force-pushed the refactor/extract-evm-directory branch from 85bddfe to d4fa8b7 Compare October 22, 2025 14:33
@gavriliumircea gavriliumircea force-pushed the 10-20-feat_add_solana_idls branch from e3cb44d to ad91f01 Compare October 22, 2025 14:33
@gavriliumircea gavriliumircea force-pushed the refactor/extract-evm-directory branch from d4fa8b7 to b26fe27 Compare October 22, 2025 15:35
@gavriliumircea gavriliumircea force-pushed the 10-20-feat_add_solana_idls branch from ad91f01 to f57e65d Compare October 22, 2025 15:35
@gavriliumircea gavriliumircea force-pushed the refactor/extract-evm-directory branch from b26fe27 to 1bf1818 Compare October 23, 2025 13:47
@gavriliumircea gavriliumircea force-pushed the 10-20-feat_add_solana_idls branch 2 times, most recently from 2fbe97c to f14b382 Compare October 23, 2025 17:35
@gavriliumircea gavriliumircea force-pushed the refactor/extract-evm-directory branch 2 times, most recently from 79d0a5f to 82c9bb0 Compare October 23, 2025 18:08
@gavriliumircea gavriliumircea force-pushed the 10-20-feat_add_solana_idls branch from f14b382 to 7970c81 Compare October 23, 2025 18:09
@gavriliumircea gavriliumircea force-pushed the refactor/extract-evm-directory branch from 82c9bb0 to 100e2a5 Compare October 28, 2025 12:30
@gavriliumircea gavriliumircea force-pushed the 10-20-feat_add_solana_idls branch from e31ad15 to a522645 Compare October 29, 2025 17:46
@gavriliumircea gavriliumircea force-pushed the refactor/extract-evm-directory branch from c8394d7 to 08f5a00 Compare October 29, 2025 17:46
@gavriliumircea gavriliumircea force-pushed the 10-20-feat_add_solana_idls branch from a522645 to 3fe6fab Compare October 29, 2025 17:48
@gavriliumircea gavriliumircea force-pushed the refactor/extract-evm-directory branch from 08f5a00 to 72e5beb Compare October 29, 2025 17:48
@gavriliumircea gavriliumircea force-pushed the 10-20-feat_add_solana_idls branch from 3fe6fab to 4edaa74 Compare November 3, 2025 08:07
@gavriliumircea gavriliumircea force-pushed the refactor/extract-evm-directory branch from 72e5beb to 24c6085 Compare November 3, 2025 08:07
Base automatically changed from refactor/extract-evm-directory to main November 3, 2025 11:55
@PaulRBerg PaulRBerg dismissed razgraf’s stale review November 3, 2025 11:55

The base branch was changed.

@gavriliumircea gavriliumircea force-pushed the 10-20-feat_add_solana_idls branch from 4edaa74 to 406efce Compare November 4, 2025 13:42
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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/solana/idl/lockup/v1.0/SablierLockupLinearV10Type.ts (1)

2685-2686: Default-exporting a type alias triggers a compile error

Idl is declared as a type alias only; export default Idl; tries to emit it as a runtime value and TypeScript rejects that ('Idl' only refers to a type, but is being used as a value here.). Please switch to a type-only export so the file compiles under tsc --isolatedModules.

-type Idl = {
+type Idl = {
   … // unchanged
-};
-
-export default Idl;
+};
+
+export type { Idl as default };
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e3d6759 and 406efce.

📒 Files selected for processing (10)
  • src/solana/idl/airdrops/index.ts (1 hunks)
  • src/solana/idl/airdrops/v1.0/SablierMerkleInstantV10.ts (1 hunks)
  • src/solana/idl/airdrops/v1.0/SablierMerkleInstantV10Type.ts (1 hunks)
  • src/solana/idl/airdrops/v1.0/index.ts (1 hunks)
  • src/solana/idl/index.ts (1 hunks)
  • src/solana/idl/lockup/index.ts (1 hunks)
  • src/solana/idl/lockup/v1.0/SablierLockupLinearV10.ts (1 hunks)
  • src/solana/idl/lockup/v1.0/SablierLockupLinearV10Type.ts (1 hunks)
  • src/solana/idl/lockup/v1.0/index.ts (1 hunks)
  • src/solana/index.ts (1 hunks)
🔇 Additional comments (6)
src/solana/idl/lockup/index.ts (1)

1-1: Lockup barrel wiring looks good

Forwarding the lockup v1.0 exports keeps the Solana IDL surface consistent with the rest of the stack. Nicely done.

src/solana/idl/index.ts (1)

1-2: Top-level IDL aggregation looks solid

Re-exporting both airdrops and lockup from the package root keeps the new Solana IDLs easy to consume. All good here.

src/solana/index.ts (1)

1-1: Entry-point export is on point

Surfacing the IDL barrel from the Solana root keeps the public API coherent. Looks great.

src/solana/idl/airdrops/index.ts (1)

1-1: Airdrops barrel export aligns

This re-export neatly exposes the v1.0 module and matches the rest of the layout. No issues.

src/solana/idl/airdrops/v1.0/index.ts (1)

1-2: Scoped exports wired correctly

Re-exporting both the runtime IDL and its type helper keeps consumers covered. Looks good.

src/solana/idl/lockup/v1.0/index.ts (1)

1-2: Lockup v1 exports are tidy

The runtime IDL and type helper are both exposed cleanly. Nice work.

Copy link
Member

@PaulRBerg PaulRBerg left a comment

Choose a reason for hiding this comment

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

I will push a commit to include the file pattern in the src/solana/idl/**/*.ts in the overrides in biome.jsonc so that we lower the number of lines of code in the code-generated IDL files.

Now that we have a CLAUDE.md file, could you please add a nested CLAUDE.md file under src/solana (or maybe src/solana/idl) to document how the IDLs are generated, and from what repository?

Tip: use my /create-agent-context slash command.

@gavriliumircea gavriliumircea force-pushed the 10-20-feat_add_solana_idls branch from a86e8bb to 1e8cbc4 Compare November 5, 2025 14:58
Copy link
Member

@PaulRBerg PaulRBerg left a comment

Choose a reason for hiding this comment

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

I pushed a commit:

  • Added errors.ts and structs.ts
  • Add @solana/web3.js and @coral-xyz/anchor as peer dependencies (needed for structs.ts)
  • Group the files under a new directory that bears the program name
  • Better file name and variable name and organization overall
  • Remove superfluous barrel files (not needed under src/solana/idl)
  • Biome rule to not sort the keys alphabetically in src/solana/idl

Note

The *.ts files shouldn't have been placed under src/solana/idl. The idl directory is the mirror of the src/evm/abi directory, which contains only JSON files. Thus, everything under src/solana/idl that is NOT JSON should be moved underneath the idl directory of each release I will let you handle this refactor @gavriliumircea in a future PR.

The PR is good to be merged now! Pending your approval/review @gavriliumircea.

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

🧹 Nitpick comments (2)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.json (1)

808-833: Error code overlap between SablierMerkleInstant and SablierLockupLinear programs.

Both programs define error codes starting at 6000 and potentially overlapping ranges (6000-6004 vs 6000-6014). If both programs are imported or used together in the SDK, this overlap could cause ambiguity when decoding errors. Verify whether error codes should be namespaced or allocated to non-overlapping ranges across the two programs.

src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.json (1)

1784-1818: Chainlink integration referenced without corresponding documentation.

Instructions withdrawal_fee_in_lamports and withdraw both reference Chainlink oracles for SOL/USD price feeds. Verify that:

  1. Chainlink integration is documented at the SDK or program level
  2. The program and feed account addresses are configurable or well-documented for different networks (devnet, testnet, mainnet)
  3. Chainlink program address is not hardcoded incorrectly anywhere
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1e8cbc4 and ed3bd2a.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (15)
  • biome.jsonc (2 hunks)
  • package.json (1 hunks)
  • src/solana/idl/airdrops/v1.0/SablierMerkleInstant/errors.ts (1 hunks)
  • src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl-type.ts (1 hunks)
  • src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.json (1 hunks)
  • src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.ts (1 hunks)
  • src/solana/idl/airdrops/v1.0/SablierMerkleInstant/index.ts (1 hunks)
  • src/solana/idl/airdrops/v1.0/SablierMerkleInstant/structs.ts (1 hunks)
  • src/solana/idl/biome.jsonc (1 hunks)
  • src/solana/idl/lockup/v1.0/SablierLockupLinear/errors.ts (1 hunks)
  • src/solana/idl/lockup/v1.0/SablierLockupLinear/idl-type.ts (1 hunks)
  • src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.json (1 hunks)
  • src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.ts (1 hunks)
  • src/solana/idl/lockup/v1.0/SablierLockupLinear/index.ts (1 hunks)
  • src/solana/idl/lockup/v1.0/SablierLockupLinear/structs.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • biome.jsonc
🧰 Additional context used
🧬 Code graph analysis (9)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.ts (1)
src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.ts (1)
  • idl (1-1396)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/index.ts (2)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl-type.ts (1)
  • IDL (1-781)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/errors.ts (1)
  • ErrorNames (9-9)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/errors.ts (1)
src/solana/idl/lockup/v1.0/SablierLockupLinear/errors.ts (2)
  • errorCodes (2-18)
  • ErrorNames (20-20)
src/solana/idl/lockup/v1.0/SablierLockupLinear/index.ts (2)
src/solana/idl/lockup/v1.0/SablierLockupLinear/idl-type.ts (1)
  • IDL (1-1833)
src/solana/idl/lockup/v1.0/SablierLockupLinear/errors.ts (1)
  • ErrorNames (20-20)
src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.ts (1)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.ts (1)
  • idl (1-631)
src/solana/idl/lockup/v1.0/SablierLockupLinear/structs.ts (1)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/structs.ts (2)
  • FeesCollected (42-42)
  • Treasury (44-49)
src/solana/idl/lockup/v1.0/SablierLockupLinear/idl-type.ts (1)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl-type.ts (1)
  • IDL (1-781)
src/solana/idl/lockup/v1.0/SablierLockupLinear/errors.ts (1)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/errors.ts (2)
  • errorCodes (1-7)
  • ErrorNames (9-9)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/structs.ts (1)
src/solana/idl/lockup/v1.0/SablierLockupLinear/structs.ts (2)
  • FeesCollected (23-23)
  • Treasury (45-50)
🔇 Additional comments (3)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.json (1)

1-9: Verify program version consistency across IDL releases.

The metadata specifies version "0.1.0" for both SablierMerkleInstant and SablierLockupLinear. Confirm this versioning strategy aligns with the SDK's release process and that these versions are tracked consistently with on-chain program deployments.

src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.json (2)

1-9: Verify directory structure and version naming consistency.

The file path indicates v1.0 in the directory but the metadata specifies version 0.1.0. Clarify whether this is intentional (different versioning schemes) or if the metadata version should be 1.0.0 to match the directory structure. This inconsistency may cause confusion in SDK versioning and documentation.


2131-2151: StreamStatus enum provides clear state management.

The StreamStatus enum correctly defines the five possible stream states (Pending, Streaming, Settled, Canceled, Depleted), which maps well to the error codes and instruction constraints documented. This is well-designed.

gavriliumircea and others added 3 commits November 6, 2025 10:00
Split flat IDL files into organized directory structure with separate
concerns (types, errors, structs, JSON artifacts). Add IDL-specific
Biome config and update tooling dependencies.
@gavriliumircea gavriliumircea force-pushed the 10-20-feat_add_solana_idls branch from ed3bd2a to 4998522 Compare November 6, 2025 11:11
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: 3

♻️ Duplicate comments (1)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl-type.ts (1)

1-781: Type casing still mismatches runtime IDL.

The systematic casing discrepancy between this type definition and the actual idl.ts constant persists (e.g., "sablierMerkleInstant" vs "sablier_merkle_instant", "campaignView" vs "campaign_view", { name: "campaign" } vs { name: "Campaign" }). This prevents type-safe usage: const typedIdl: SablierMerkleInstant.IDL = sablierMerkleInstant.idl will fail at compile time.

As previously noted, this appears to be a limitation of the IDL generation tooling.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed3bd2a and 4998522.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (15)
  • biome.jsonc (2 hunks)
  • package.json (1 hunks)
  • src/solana/idl/airdrops/v1.0/SablierMerkleInstant/errors.ts (1 hunks)
  • src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl-type.ts (1 hunks)
  • src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.json (1 hunks)
  • src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.ts (1 hunks)
  • src/solana/idl/airdrops/v1.0/SablierMerkleInstant/index.ts (1 hunks)
  • src/solana/idl/airdrops/v1.0/SablierMerkleInstant/structs.ts (1 hunks)
  • src/solana/idl/biome.jsonc (1 hunks)
  • src/solana/idl/lockup/v1.0/SablierLockupLinear/errors.ts (1 hunks)
  • src/solana/idl/lockup/v1.0/SablierLockupLinear/idl-type.ts (1 hunks)
  • src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.json (1 hunks)
  • src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.ts (1 hunks)
  • src/solana/idl/lockup/v1.0/SablierLockupLinear/index.ts (1 hunks)
  • src/solana/idl/lockup/v1.0/SablierLockupLinear/structs.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (9)
  • src/solana/idl/biome.jsonc
  • src/solana/idl/lockup/v1.0/SablierLockupLinear/errors.ts
  • biome.jsonc
  • package.json
  • src/solana/idl/airdrops/v1.0/SablierMerkleInstant/structs.ts
  • src/solana/idl/lockup/v1.0/SablierLockupLinear/index.ts
  • src/solana/idl/lockup/v1.0/SablierLockupLinear/structs.ts
  • src/solana/idl/airdrops/v1.0/SablierMerkleInstant/errors.ts
  • src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.json
🧰 Additional context used
🧬 Code graph analysis (3)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/index.ts (2)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl-type.ts (1)
  • IDL (1-781)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/errors.ts (1)
  • ErrorNames (9-9)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.ts (1)
src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.ts (1)
  • idl (1-1396)
src/solana/idl/lockup/v1.0/SablierLockupLinear/idl.ts (1)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.ts (1)
  • idl (1-631)
🔇 Additional comments (3)
src/solana/idl/airdrops/v1.0/SablierMerkleInstant/index.ts (1)

1-21: LGTM! Clean aggregator structure.

The file effectively consolidates the IDL surface into a cohesive public API. The separation between runtime objects (errorCodes, idl, structs) and type exports (namespace) follows best practices.

src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.ts (1)

1-631: LGTM! IDL structure is correct and consistent.

The exported IDL constant properly defines the complete program surface with consistent casing (snake_case for instructions/fields, PascalCase for types). The as const assertion correctly preserves literal types, and the structure aligns with the JSON representation in idl.json.

src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl.json (1)

1-1049: LGTM! Standard Anchor IDL JSON.

The JSON IDL correctly represents the complete program interface and maintains consistency with the TypeScript constant in idl.ts. All sections (instructions, accounts, events, errors, types) are properly structured.

@gavriliumircea gavriliumircea merged commit a73f35a into main Nov 6, 2025
3 checks passed
gavriliumircea added a commit that referenced this pull request Nov 6, 2025
This pr replaces #59. This is need because of a merge order mistake that I did.
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.

4 participants