The FluxBeam Pool API allows developers to quickly and easily integrate the creation of pools within their platform.
Create Pool
Example
import { Connection, Keypair, VersionedTransaction } from'@solana/web3.js';constform= { payer:"",// Wallet address of the payer tokenA:"",// Token A Mint tokenB:"",// Token B Mint tokenAAmount:"",// Token A Liquidity Amount tokenBAmount:""// Token B Liquidity Amount}constresp=await (awaitfetch(`https://api.fluxbeam.xyz/v1/token_pools`, { method:'POST', headers: {'Content-Type':'application/json'}, body:JSON.stringify({"payer":form.payer,"token_a":form.tokenA,"token_b": .form.tokenB,"token_a_amount":form.tokenAAmount,"token_b_amount":form.tokenBAmount }) })).json()console.log("Pool Address:",resp.pool)//Decode the transaction from base64constswapTransactionBuf=Buffer.from(resp.transaction,'base64');consttransaction=VersionedTransaction.deserialize(swapTransactionBuf);console.log("Transaction",transaction);//Sign the transaction with the payer wallettransaction.sign([wallet.payer]);//Execute the transactionconstclient=newConnection('{RPC_URL}');constsig=client.sendRawTransaction(transaction.serialize(), {maxRetries:3, skipPreflight:true})console.log("Transaction Signature:", sig)