Use this file to discover all available pages before exploring further.
This guide shows how to install and initialize the official Presale Vault TypeScript SDK, @meteora-ag/presale-sdk.Before you begin, here are the main resources:
TypeScript SDK
Presale Vault TypeScript SDK Repository
Presale Vault NPM Package
Published package for transaction builders, PDAs, wrappers, and helpers.
import { Connection, PublicKey } from "@solana/web3.js";import Presale, { PRESALE_PROGRAM_ID, derivePresale } from "@meteora-ag/presale";const connection = new Connection(process.env.RPC_URL!, "confirmed");const baseMint = new PublicKey("BASE_MINT_ADDRESS");const quoteMint = new PublicKey("QUOTE_MINT_ADDRESS");const base = new PublicKey("BASE_KEY_ADDRESS");const presaleAddress = derivePresale( baseMint, quoteMint, base, PRESALE_PROGRAM_ID);const presale = await Presale.create( connection, presaleAddress, PRESALE_PROGRAM_ID);
The client caches the presale account, mint accounts, and Token 2022 transfer-hook remaining-account metadata. Call refetchState() before building transactions when your UI may be using stale state.
import BN from "bn.js";const tx = await presale.deposit({ owner: wallet.publicKey, amount: new BN("500000000"),});// Sign, simulate, send, and confirm with your wallet or backend signer.
By default, the SDK estimates compute units and prepends a compute-budget instruction. Disable this behavior if your integration manages compute budget instructions itself: