0.2.2 • Published 5 months ago

fomo-deal-sdk-v1 v0.2.2

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

FomoDeal SDK

Overview

The FomoDeal SDK provides developers with a powerful toolset for interacting with Ethereum and Solana blockchains. It simplifies blockchain operations, such as fetching data, managing VC-backed projects, tracking investments, and executing token-related operations like distribution and vesting.

Installation

Install the package via npm:

npm install fomo-deal-sdk

Features

  • GraphQL Integration: Utilize The Graph for efficient querying of blockchain data.
  • Multi-Chain Support: Seamlessly interact with Ethereum and Solana.
  • VC & Project Management: Easily retrieve and manage VC and project data.
  • Investment Tracking: Analyze and track investments across supported chains.
  • Token Operations: Execute token distribution and vesting schedules effortlessly.

Usage

Initialization

Start by initializing the SDK.

import { FomoDeal, Network } from "fomo-deal-sdk";

const fomoDeal = new FomoDeal();

Functions

1. Fetch All Projects

Retrieve all projects on a specific blockchain network.

const projects = await fomoDeal.getAllProjects(Network.ETHEREUM);

2. Fetch Project by ID

Get detailed information about a specific project using its ID.

const project = await fomoDeal.getProjectById(Network.SOLANA, "projectId123");

3. Retrieve VC Information

Fetch details of a VC from Ethereum or Solana.

const vcInfo = await fomoDeal.getVCInfo({
  ethereum: {
    provider, // Ethereum provider
    contractAddress, // VC registry contract address
    abi, // Contract ABI
    vcAddress: "vcAddress123", // VC wallet address
  },
  solana: {
    connection, // Solana connection object
    programId, // Solana program ID
    vcAddress: "vcAddress123", // VC wallet address
  },
});

4. Contribute to a Project

Make a contribution to a project on Ethereum or Solana.

await fomoDeal.contribute(
  Network.ETHEREUM,
  {
    ethereum: {
      provider, // Ethereum provider
      contractAddress, // Project registry contract address
      abi, // Contract ABI
    },
  },
  {
    vcAddress: "vcAddress123", // VC managing the project
    projectCount: 1, // Project identifier
    paymentTokenAddress: "tokenAddress", // Token used for payment
    amount: "1000000000000000000", // Contribution amount (1 ETH in wei)
    proof: [], // Optional Merkle proof
  },
);

5. Distribute Tokens

Distribute tokens in batches for a project.

await fomoDeal.distributeTokens(
  Network.SOLANA,
  {
    solana: {
      connection, // Solana connection object
      programId, // Solana program ID
      payer, // Payer object for signing transactions
      signTransaction, // Function to sign transactions
    },
  },
  {
    batchId: "batchId123", // Batch identifier
    projectCount: 1, // Project identifier
    recipients: ["recipient1", "recipient2"], // List of recipient addresses
  },
);

6. Fetch Supported Tokens

Retrieve a list of supported payment tokens for a specific blockchain.

const supportedTokens = await fomoDeal.getSupportedTokens(Network.ETHEREUM);

7. Retrieve Investor Profile

Fetch investment details of a specific investor.

const investorProfile = await fomoDeal.getInvestorProfile(Network.SOLANA, "investorAddress", {
  solana: {
    connection, // Solana connection object
    programId, // Solana program ID
  },
});

Dependencies

The SDK leverages the following dependencies:

  • Ethers.js: For seamless Ethereum blockchain interaction.
  • Solana/web3.js: For managing Solana blockchain operations.
  • GraphQL: To query data using The Graph.

Contributing

We welcome community contributions to improve the SDK! Follow these steps to contribute:

  1. Fork the repository.
  2. Create a new feature branch.
  3. Submit a pull request for review.

License

This project is licensed under the MIT License.


Support

For issues, suggestions, or questions, please visit our GitHub Issues page.


Next Steps

  1. Verify Functionalities: Thoroughly test the SDK for accurate real-time interactions across Ethereum and Solana.
  2. Deployment on NPM: Publish and verify the package for public use.
  3. Documentation Updates: Continuously improve the documentation based on user feedback.

This updated README.md ensures clarity, completeness, and ease of use for developers integrating the FomoDeal SDK. Let me know if further refinements are needed!

0.2.1

5 months ago

0.2.0

5 months ago

0.1.8

5 months ago

0.1.9

5 months ago

0.2.2

5 months ago

0.1.7

5 months ago

0.1.6

5 months ago

0.1.4

6 months ago

0.1.5

6 months ago

0.1.2

6 months ago

0.1.3

6 months ago

0.1.0

7 months ago

0.1.1

7 months ago

0.0.9

7 months ago

0.0.8

7 months ago

0.0.3

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.7

7 months ago

0.0.6

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago