-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:switchboard-xyz/ecosystem
- Loading branch information
Showing
8 changed files
with
204 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import fs from "fs"; | ||
import Joi from "joi"; | ||
import { parse } from "jsonc-parser"; | ||
import path from "path"; | ||
|
||
const IN_DIR = path.join(__dirname, "../projects"); | ||
const OUT_PATH = path.join(__dirname, "projects.json"); | ||
|
||
/** | ||
* The data schema for an "Ecosystem Project". | ||
*/ | ||
const projectSchema = Joi.object({ | ||
date: Joi.string().min(1).required(), | ||
name: Joi.string().min(1).required(), | ||
brief: Joi.string().min(1).required(), | ||
img: Joi.string().min(1).required(), | ||
website: Joi.string().min(1).required(), | ||
x: Joi.string().optional(), | ||
github: Joi.string().optional(), | ||
telegram: Joi.string().optional(), | ||
discord: Joi.string().optional(), | ||
}); | ||
|
||
console.log(); | ||
const projectList = []; | ||
fs.readdirSync(IN_DIR).forEach((file, idx) => { | ||
if (file.endsWith(".json") || file.endsWith(".jsonc")) { | ||
try { | ||
// Iterate each project file and load the content to be checked. | ||
const filePath = path.join(IN_DIR, file); | ||
const fileContent = fs.readFileSync(filePath, "utf8"); | ||
|
||
// Step 1: Convert JSONC data into JSON. | ||
const parsedData = parse(fileContent); | ||
|
||
// Step 2: Validate the JSON against our Joi schema. | ||
const validated = projectSchema.validate(parsedData, { | ||
stripUnknown: true, | ||
}); | ||
if (validated.error) throw validated.error; | ||
else if (validated.warning) throw validated.warning; | ||
|
||
// Step 3: The json has been validated. Transform the `img` path into a complete url. | ||
validated.value.img = path.join( | ||
`https://raw.githubusercontent.com/switchboard-xyz/ecosystem/main`, | ||
validated.value.img | ||
); | ||
|
||
console.log(`Successfully validated: ${file}`); | ||
projectList.push(validated.value); | ||
} catch (error) { | ||
console.error(`Error parsing ${file}:`, error); | ||
} | ||
} else { | ||
console.error(`File ${idx} is not of type .json or .jsonc: ${file}`); | ||
} | ||
}); | ||
|
||
fs.rmSync(OUT_PATH, { force: true }); | ||
fs.writeFileSync(OUT_PATH, JSON.stringify(projectList, null, 2)); | ||
console.log(); | ||
console.log("---"); | ||
console.log("Consolidated JSON file created successfully."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
[ | ||
{ | ||
"date": "2024-05-22", | ||
"name": "Kamino", | ||
"brief": "Automated concentrated liquidity (CLMM) position management.", | ||
"img": "https:/raw.githubusercontent.com/switchboard-xyz/ecosystem/main/img/kamino.jpg", | ||
"website": "https://kamino.finance/", | ||
"x": "https://x.com/KaminoFinance", | ||
"github": "https://github.com/Kamino-Finance", | ||
"discord": "https://discord.com/invite/kaminofinance" | ||
}, | ||
{ | ||
"date": "2024-05-23", | ||
"name": "Lulo", | ||
"brief": "Your DeFi Savings Account.", | ||
"img": "https:/raw.githubusercontent.com/switchboard-xyz/ecosystem/main/img/lulo.jpg", | ||
"website": "https://lulo.fi/", | ||
"x": "https://x.com/uselulo", | ||
"github": "https://github.com/lulo-labs", | ||
"discord": "https://discord.gg/lulo" | ||
}, | ||
{ | ||
"date": "2024-05-24", | ||
"name": "Rain.fi", | ||
"brief": "Borrow, lend and long tokens and NFTs in the simplest way. No price liquidations.", | ||
"img": "https:/raw.githubusercontent.com/switchboard-xyz/ecosystem/main/img/rainfi.jpg", | ||
"website": "https://rain.fi/", | ||
"x": "https://x.com/RainFi_", | ||
"discord": "https://discord.gg/rainfi" | ||
}, | ||
{ | ||
"date": "2024-05-23", | ||
"name": "AllDomains", | ||
"brief": "The web3 identity asset layer to create and trade web3 domains", | ||
"img": "https:/raw.githubusercontent.com/switchboard-xyz/ecosystem/main/img/alldomains.jpg", | ||
"website": "https://alldomains.id/", | ||
"x": "https://x.com/AllDomains_", | ||
"github": "https://github.com/onsol-labs", | ||
"discord": "https://discord.gg/Rcrqhs7Bja" | ||
}, | ||
{ | ||
"date": "2024-05-22", | ||
"name": "GooseFX", | ||
"brief": "A Complete DeFi Experience.", | ||
"img": "https:/raw.githubusercontent.com/switchboard-xyz/ecosystem/main/img/goosefx.jpg", | ||
"website": "https://goosefx.io/", | ||
"x": "https://x.com/GooseFX1", | ||
"github": "https://github.com/GooseFX1", | ||
"discord": "https://discord.com/invite/cDEPXpY26q" | ||
}, | ||
{ | ||
"date": "2024-05-22", | ||
"name": "Solend", | ||
"brief": "Solend is the autonomous interest rate machine for lending on Solana.", | ||
"img": "https:/raw.githubusercontent.com/switchboard-xyz/ecosystem/main/img/solend.jpg", | ||
"website": "https://solend.fi", | ||
"x": "https://x.com/solendprotocol", | ||
"github": "https://github.com/solendprotocol", | ||
"discord": "https://discord.gg/solend" | ||
}, | ||
{ | ||
"date": "2024-05-22", | ||
"name": "Hubble Protocol", | ||
"brief": "Borrowing platform that issues the USDH stablecoin against your crypto assets.", | ||
"img": "https:/raw.githubusercontent.com/switchboard-xyz/ecosystem/main/img/hubble.jpg", | ||
"website": "https://hubbleprotocol.io/", | ||
"x": "https://x.com/hubbleprotocol", | ||
"github": "https://github.com/hubbleprotocol/", | ||
"discord": "https://discord.gg/MGujjftKTY" | ||
}, | ||
{ | ||
"date": "2024-05-22", | ||
"name": "Marginfi", | ||
"brief": "The liquidity layer for Solana.", | ||
"img": "https:/raw.githubusercontent.com/switchboard-xyz/ecosystem/main/img/marginfi.jpg", | ||
"website": "https://www.marginfi.com/", | ||
"x": "https://x.com/marginfi", | ||
"github": "https://github.com/mrgnlabs/", | ||
"discord": "https://discord.gg/mrgn" | ||
}, | ||
{ | ||
"date": "2024-05-23", | ||
"name": "Symmetry", | ||
"brief": "On-chain asset management infrastructure", | ||
"img": "https:/raw.githubusercontent.com/switchboard-xyz/ecosystem/main/img/symmetry.jpeg", | ||
"website": "https://symmetry.fi/", | ||
"x": "https://x.com/symmetry_fi", | ||
"github": "https://github.com/symmetry-protocol", | ||
"discord": "https://discord.symmetry.fi" | ||
}, | ||
{ | ||
"date": "2024-05-20", | ||
"name": "Drift Protocol", | ||
"brief": "Drift brings on-chain, cross-margined perpetual swaps to Solana.", | ||
"img": "https:/raw.githubusercontent.com/switchboard-xyz/ecosystem/main/img/drift.jpg", | ||
"website": "https://www.drift.trade", | ||
"x": "https://x.com/driftprotocol", | ||
"github": "https://github.com/drift-labs", | ||
"discord": "https://discord.com/invite/fMcZBH8ErM" | ||
}, | ||
{ | ||
"date": "2024-05-22", | ||
"name": "Mango Markets", | ||
"brief": "Lend, borrow, swap, and leverage-trade crypto assets - permissionless and all on-chain.", | ||
"img": "https:/raw.githubusercontent.com/switchboard-xyz/ecosystem/main/img/mango.jpg", | ||
"website": "https://mango.markets/", | ||
"x": "https://x.com/mangomarkets", | ||
"github": "https://github.com/blockworks-foundation/", | ||
"discord": "https://discord.com/invite/mangomarkets" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"date": "2024-05-23", | ||
"name": "AllDomains", | ||
"brief": "The web3 identity asset layer to create and trade web3 domains", | ||
"img": "/img/alldomains.jpg", | ||
"website": "https://alldomains.id/", | ||
"x": "https://x.com/AllDomains_", | ||
"github": "https://github.com/onsol-labs", | ||
"discord": "https://discord.gg/Rcrqhs7Bja" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"date": "2024-05-24", | ||
"name": "Rain.fi", | ||
"brief": "Borrow, lend and long tokens and NFTs in the simplest way. No price liquidations.", | ||
"img": "/img/rainfi.jpg", | ||
"website": "https://rain.fi/", | ||
"x": "https://x.com/RainFi_", | ||
"discord": "https://discord.gg/rainfi" | ||
} |