Skip to content

Commit 4998522

Browse files
PaulRBerggavriliumircea
authored andcommitted
refactor(solana): reorganize IDL structure into modular directories
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.
1 parent 42d5a8c commit 4998522

File tree

22 files changed

+4374
-790
lines changed

22 files changed

+4374
-790
lines changed

biome.jsonc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
33
"extends": ["@sablier/devkit/biome"],
4+
"root": true,
45
"files": {
56
"includes": ["**/*.{js,json,jsonc,ts}", "!node_modules/**/*"]
67
},
@@ -16,7 +17,14 @@
1617
}
1718
},
1819
{
19-
"includes": ["src/evm/releases/**/abi/**/*.ts", "src/solana/idl/**/*.ts"],
20+
"includes": ["src/evm/releases/**/abi/**/*.ts"],
21+
"assist": {
22+
"actions": {
23+
"source": {
24+
"useSortedKeys": "off"
25+
}
26+
}
27+
},
2028
"javascript": {
2129
"formatter": {
2230
"expand": "never" // Never expand objects in the ABI to save number of lines

bun.lock

Lines changed: 117 additions & 1 deletion
Large diffs are not rendered by default.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@
1010
"url": "https://sablier.com"
1111
},
1212
"dependencies": {
13+
"@coral-xyz/anchor": "^0.32.1",
14+
"@solana/web3.js": "^1.98.4",
1315
"lodash": "^4.17.21",
1416
"viem": "^2.37.9"
1517
},
1618
"peerDependencies": {
19+
"@coral-xyz/anchor": "^0.30",
20+
"@solana/web3.js": "^1.98",
1721
"viem": "^2.32"
1822
},
1923
"devDependencies": {

src/solana/idl/airdrops/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export const errorCodes = {
2+
CampaignExpired: 6000,
3+
InvalidMerkleProof: 6001,
4+
CampaignNotStarted: 6002,
5+
ClawbackNotAllowed: 6003,
6+
CantCollectZeroFees: 6004,
7+
} as const;
8+
9+
export type ErrorNames = keyof typeof errorCodes;

src/solana/idl/airdrops/v1.0/SablierMerkleInstantType.ts renamed to src/solana/idl/airdrops/v1.0/SablierMerkleInstant/idl-type.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
/**
2-
* Program IDL in camelCase format in order to be used in JS/TS.
3-
*
4-
* Note that this is only a type helper and is not the actual IDL.
5-
*/
6-
export type Idl = {
1+
export type IDL = {
72
address: "7XrxoQejBoGouW4V3aozTSwub7xSDjYqB4Go7YLjF9rV";
83
metadata: { name: "sablierMerkleInstant"; version: "0.1.0"; spec: "0.1.0"; description: "Created with Anchor" };
94
docs: ["Sablier Merkle Instant program for creating and managing Merkle tree-based airdrop campaigns."];

0 commit comments

Comments
 (0)