🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

fomo-sdk

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fomo-sdk

A TypeScript/JavaScript library for interacting with the Fomo Protocol on Solana.

latest
npmnpm
Version
1.3.5
Version published
Maintainers
1
Created
Source

Fomo Token Trading Class

Description

A Solana blockchain utility for token trading, creation, and interaction with a custom bonding curve mechanism.

Table of Contents

  • Installation
  • Usage
  • Methods
  • Configuration
  • Dependencies

Installation

Install the required dependencies:

npm install @solana/web3.js @coral-xyz/anchor

Usage

Initialization

const connection = new Connection(clusterApiUrl("devnet"), "confirmed");
const cluster = "devnet"; // or 'mainnet'
const authority = Keypair.generate(); // Optional

const fomo = new Fomo(connection, cluster, authority);

Buying Tokens

await fomo.buyToken(
  wallet.publicKey, // Buyer's wallet
  tokenMint, // Token mint address
  amount, // Amount to spend
  slippage, // Slippage tolerance
  priorityFee, // Network priority fee
  "sol" // Purchase currency
);

Selling Tokens

await fomo.sellToken(
  wallet.publicKey, // Seller's wallet
  tokenMint, // Token mint address
  amount, // Amount to sell
  slippage, // Slippage tolerance
  priorityFee, // Network priority fee
  "token" // Sell currency type
);

Creating a Token

await fomo.createToken(
  wallet.publicKey, // Creator's wallet
  "TokenName", // Token name
  "Symbol", // Token symbol
  "https://metadata.uri", // Metadata URI
  priorityFee, // Network priority fee
  mintKeypairSecret, // Mint keypair secret
  requiredLiquidity // Optional liquidity requirement
);

Methods

MethodDescriptionParameters
buyToken()Purchase tokenswallet, tokenMint, amount, slippage, priorityFee, purchaseCurrency
sellToken()Sell tokenswallet, tokenMint, amount, slippage, priorityFee, sellCurrency
createToken()Launch new tokenwallet, name, symbol, uri, priorityFee, mintKeypair, requiredLiquidity
getGlobalData()Retrieve global contract data-
getBondingCurve()Get bonding curve detailstokenMint

Configuration

  • Supports devnet and mainnet clusters
  • Configurable priority fees
  • Slippage control
  • Multiple purchase/sell currencies

Dependencies

  • @solana/web3.js
  • @coral-xyz/anchor
  • Solana Token Metadata Program

Error Handling

try {
  const transaction = await fomo.buyToken(...);
  // Send and confirm transaction
} catch (error) {
  console.error('Transaction failed:', error);
}

Contributing

  • Fork the repository
  • Create your feature branch (git checkout -b feature/AmazingFeature)
  • Commit your changes (git commit -m 'Add some AmazingFeature')
  • Push to the branch (git push origin feature/AmazingFeature)
  • Open a Pull Request

License

Distributed under the [Your License]. See LICENSE for more information.

Contact

[Your Name] - [Your Email]

Project Link: [Repository URL]

Keywords

fomo

FAQs

Package last updated on 24 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts