-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add solana idls #59
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
This stack of pull requests is managed by Graphite. Learn more about stacking. |
d331a7c to
2992554
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
2992554 to
e3cb44d
Compare
|
Note Other AI code review bot(s) detectedCodeRabbit 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. WalkthroughAdds 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 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 |
85bddfe to
d4fa8b7
Compare
e3cb44d to
ad91f01
Compare
d4fa8b7 to
b26fe27
Compare
ad91f01 to
f57e65d
Compare
b26fe27 to
1bf1818
Compare
2fbe97c to
f14b382
Compare
79d0a5f to
82c9bb0
Compare
f14b382 to
7970c81
Compare
82c9bb0 to
100e2a5
Compare
e31ad15 to
a522645
Compare
c8394d7 to
08f5a00
Compare
a522645 to
3fe6fab
Compare
08f5a00 to
72e5beb
Compare
3fe6fab to
4edaa74
Compare
72e5beb to
24c6085
Compare
4edaa74 to
406efce
Compare
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: 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
Idlis 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 undertsc --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
📒 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 goodForwarding 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 solidRe-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 pointSurfacing 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 alignsThis 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 correctlyRe-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 tidyThe runtime IDL and type helper are both exposed cleanly. Nice work.
PaulRBerg
left a comment
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.
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.
a86e8bb to
1e8cbc4
Compare
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.
I pushed a commit:
- Added
errors.tsandstructs.ts - Add
@solana/web3.jsand@coral-xyz/anchoras peer dependencies (needed forstructs.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.
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
🧹 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_lamportsandwithdrawboth reference Chainlink oracles for SOL/USD price feeds. Verify that:
- Chainlink integration is documented at the SDK or program level
- The program and feed account addresses are configurable or well-documented for different networks (devnet, testnet, mainnet)
- Chainlink program address is not hardcoded incorrectly anywhere
📜 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(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.0in the directory but the metadata specifies version0.1.0. Clarify whether this is intentional (different versioning schemes) or if the metadata version should be1.0.0to match the directory structure. This inconsistency may cause confusion in SDK versioning and documentation.
2131-2151: StreamStatus enum provides clear state management.The
StreamStatusenum 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.
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.
ed3bd2a to
4998522
Compare
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: 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.tsconstant 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.idlwill 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
⛔ Files ignored due to path filters (1)
bun.lockis 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 constassertion correctly preserves literal types, and the structure aligns with the JSON representation inidl.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.
This pr replaces #59. This is need because of a merge order mistake that I did.

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