1.3.5 • Published 8 months ago
fomo-sdk v1.3.5
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
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
Method | Description | Parameters |
---|---|---|
buyToken() | Purchase tokens | wallet , tokenMint , amount , slippage , priorityFee , purchaseCurrency |
sellToken() | Sell tokens | wallet , tokenMint , amount , slippage , priorityFee , sellCurrency |
createToken() | Launch new token | wallet , name , symbol , uri , priorityFee , mintKeypair , requiredLiquidity |
getGlobalData() | Retrieve global contract data | - |
getBondingCurve() | Get bonding curve details | tokenMint |
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
Project Link: Repository URL
1.3.5
8 months ago
1.3.4
9 months ago
1.3.3
9 months ago
1.3.2
10 months ago
1.3.1
10 months ago
1.3.0
10 months ago
1.2.9
10 months ago
1.2.8
10 months ago
1.2.7
10 months ago
1.2.6
10 months ago
1.2.5
10 months ago
1.2.4
10 months ago
1.2.3
10 months ago
1.2.2
10 months ago
1.2.1
10 months ago
1.2.0
10 months ago
1.1.9
10 months ago
1.1.8
10 months ago
1.1.7
10 months ago
1.1.6
10 months ago
1.1.5
10 months ago
1.1.4
10 months ago
1.1.3
10 months ago
1.1.2
10 months ago
1.1.1
10 months ago
1.1.0
10 months ago
1.0.9
10 months ago
1.0.8
10 months ago
1.0.7
10 months ago
1.0.6
10 months ago
1.0.5
10 months ago
1.0.4
10 months ago
1.0.3
10 months ago
1.0.2
10 months ago
1.0.1
10 months ago
1.0.0
10 months ago