fomo-deal-sdk v1.0.1
FomoDeal SDK
Overview
The FomoDeal SDK is a powerful tool designed to interact with Ethereum and Solana blockchains. It enables developers to manage projects, track VC investments, retrieve investor profiles, and perform token-related operations like vesting and distribution. The SDK simplifies interaction with blockchain data through GraphQL queries and smart contract functions.
Installation
Install the package via npm:
npm install fomodeal-sdk
Features
- GraphQL Integration: Fetch blockchain data using The Graph.
- Multi-Chain Support: Seamlessly switch between Ethereum and Solana.
- Project Management: Create, update, and fetch project details.
- VC Analytics: Access investment analytics, performance metrics, and ROI data.
- Token Operations: Manage token distribution and vesting schedules.
- Investor Profiles: Retrieve detailed investor statistics.
Usage
Initialization
import { FomoDeal } from "fomodeal-sdk";
const fomoDeal = new FomoDeal();
Functions
1. Get All Projects
Retrieve a list of all projects on a specific blockchain.
const projects = await fomoDeal.getAllProjects("ethereum");
2. Get Project By ID
Retrieve detailed information for a specific project.
const project = await fomoDeal.getProjectById("solana", "projectID123");
3. Get Projects By VC
Fetch all projects created by a specific VC.
const vcProjects = await fomoDeal.getProjectsByVC("ethereum", "vcAddress123");
4. Get Investor Profile
Fetch an investor's profile, including investment stats and projects.
const investorProfile = await fomoDeal.getInvestorProfile("ethereum", "investorAddress", {
ethereum: {
provider,
contractAddress,
abi,
},
});
5. Get VC Info
Retrieve detailed information about a VC, including recent projects.
const vcInfo = await fomoDeal.getVCInfo({
ethereum: {
provider,
contractAddress,
abi,
vcAddress: "vcAddress123",
},
solana: {
connection,
programId,
vcAddress: "vcAddress123",
},
});
6. Contribute to a Project
Contribute funds to a project on the blockchain.
await fomoDeal.contribute(
"ethereum",
{
ethereum: {
provider,
contractAddress,
abi,
},
},
{
vcAddress: "vcAddress123",
projectCount: 1,
paymentTokenAddress: "tokenAddress",
amount: "1000000000000000000", // 1 ETH in wei
proof: [],
},
);
7. Distribute Tokens
Distribute tokens to recipients for a specific project.
await fomoDeal.distributeTokens(
"solana",
{
solana: {
connection,
programId,
payer,
signTransaction,
},
},
{
batchId: "batchId123",
projectCount: 1,
recipients: ["recipient1", "recipient2"],
},
);
8. Set Vesting Batches
Set or update vesting schedules for a project.
await fomoDeal.setVestingBatches(
"ethereum",
{
ethereum: {
provider,
contractAddress,
abi,
},
},
{
batchIds: ["batch1", "batch2"],
releaseTimes: [1628190000, 1630790000],
releaseBps: [5000, 5000],
},
);
9. Get Supported Tokens
Fetch the list of supported payment tokens on the blockchain.
const tokens = await fomoDeal.getSupportedTokens("ethereum");
10. Get VC Analytics
Retrieve detailed analytics for a specific VC.
const analytics = await fomoDeal.getVCAnalytics({
ethereum: {
provider,
contractAddress,
abi,
vcAddress: "vcAddress123",
},
solana: {
connection,
programId,
vcAddress: "vcAddress123",
},
});
Dependencies
- GraphQL: Efficient blockchain data retrieval.
- Ethers.js: Ethereum blockchain interaction.
- Solana/web3.js: Solana blockchain interaction.
Contributing
We welcome contributions! To contribute:
- Fork the repository.
- Create a feature branch.
- Submit a pull request.
License
This project is licensed under the MIT License.
Support
For issues or questions, please open an issue.