@atefun/sdk
v0.1.6
Published
TypeScript SDK for interacting with the Ate on-chain program
Downloads
761
Maintainers
Readme
@atefun/sdk
TypeScript SDK for interacting with the Ate on-chain program.
Installation
npm install @atefun/sdkQuick Start
import { AteClient, PROGRAM_ID } from '@atefun/sdk';
import { Connection, PublicKey, Keypair } from '@solana/web3.js';
import { AnchorProvider, Wallet } from '@coral-xyz/anchor';
// Create provider
const connection = new Connection('https://api.devnet.solana.com');
const wallet = new Wallet(Keypair.generate());
const provider = new AnchorProvider(connection, wallet, {});
// Initialize client
const client = new AteClient(provider);
// Get token info
const tokenInfo = await client.getTokenInfo(new PublicKey('...'));
console.log('Market Cap:', tokenInfo.marketCap);API
Instructions
launchToken(user, params)- Launch a new token with bonding curvebuy(user, params)- Buy tokens with SOLsell(user, params)- Sell tokens for SOL
Account Fetchers
getBondingCurve(mint)- Get bonding curve datagetConfig()- Get program configurationgetDuel(pda)- Get duel matchmaking datagetTokenInfo(mint)- Get comprehensive token info
Helper Functions
import {
deriveBondingCurvePda,
deriveMatchKey,
mcapToBucket,
calculateBuyQuote,
calculateSellQuote,
getMarketCap,
} from '@atefun/sdk';Events
client.addEventListener('launchTokenEvent', (event, slot, sig) => {
console.log('Token launched:', event.mint.toString());
});
client.addEventListener('tradeEvent', (event, slot, sig) => {
console.log('Trade:', event.isBuy ? 'BUY' : 'SELL');
});License
MIT
