crossr
Build on crossr

Solana program

  • Anchor 0.31 IDL and types ship in @crossr/shared (launchpadIdl, CrossrLaunchpad); PDAs via configPda, curvePda(programId, launchId), mintPda, ata. Build a Program with the deployment's programId from deployment(501).
  • create_leg(launchId, manifest, legIndex, creatorSig?) from the Solana wallet, with manifestArgs(manifest). The signature is personal_sign by manifest.creator over creatorBindingMessage(launchId, pubkey), or null when manifest.creator == derivedEvmAddress(pubkey). Pass treasury from the Config account; other accounts resolve from the IDL. Set a 400k compute-unit limit.
  • SPL quotes: create_leg_spl(launchId, quoteTag, manifest, legIndex, sig?) with quoteTag = solanaQuoteTag(mint), then buy_spl / sell_spl / swap_spl with the trader's quote token account; the treasury and creator quote ATAs are created on demand. NEXT_PUBLIC_QUOTES lists the mints for the UI.
  • buy(lamports, minTokensOut, deadline), sell(tokens, minLamportsOut, deadline), swap(amountIn, minOut, isBuy, deadline) after graduation. Pass curve, mint, treasury and the curve's creator explicitly (accountsPartial). Quote with the same quoteBuy / quoteSell over curveState(curve), plus solanaSnipeTaxBps and quotePoolSwap.
  • Events (LaunchManifest, LegCreated, Trade, Graduated, PoolSwap, …) are Anchor events in the transaction logs; the indexer follows the program's signatures. Token amounts are 9-decimal base units; the API reports token_decimals per leg and stores Solana prices as lamports per whole token with 18 fractional digits.