Account Fetching
Load the exact workflow state your next curve, AMM, migration, or fee action needs.
SDK
Load workflow state, not random accounts
The account surface is organized around the next action you want to perform. Instead of manually fetching and decoding several accounts, load the state bundle that already matches the builder or preview you plan to use next.
import { DumpsterClient } from '@dumpster-cash/dumpster-sdk';
const client = new DumpsterClient(connection);Shared config
These calls return the shared protocol config objects:
const global = await client.accounts.fetchGlobal();
const feeConfig = await client.accounts.fetchFeeConfig();
const globalConfig = await client.accounts.fetchGlobalConfig();Curve trading state
Load this bundle before a curve preview or a curve trade:
const state = await client.accounts.fetchCurveTradeState(mint, wallet.publicKey);It returns:
globalfeeConfigbondingCurvebondingCurveAccountInfouserAtaassociatedUserAccountInfo
That state is immediately usable by:
client.preview.curveBuy(...)client.preview.curveSell(...)client.curve.buildBuyExactOut(...)
Migration state
Load this bundle when all you need is migration readiness plus the accounts required for migrate.
const state = await client.accounts.fetchMigrationState(mint);AMM trade state
Load this bundle before DumpsterSwap buys and sells:
const state = await client.accounts.fetchSwapTradeState(pool, wallet.publicKey);It already resolves:
- base and quote token programs
- protocol fee recipient
- protocol fee ATA
- user base and quote ATAs
AMM liquidity state
Load this bundle before LP deposits and withdrawals:
const state = await client.accounts.fetchPoolLiquidityState(pool, wallet.publicKey);It adds the user's LP ATA to the rest of the pool state.
Creator fee state
Load this when you need current claimable creator balances:
const curveOnly = await client.accounts.fetchCreatorFeeState(wallet.publicKey);
const curveAndSwap = await client.accounts.fetchCreatorFeeState(
wallet.publicKey,
quoteMint,
);Pass the quote mint when you want both the curve-side GOR balance and the AMM-side quote-token balance.