Transaction Building
Fetch state, preview the action, build instructions, and assemble an unsigned transaction with compute budget controls.
SDK
Build unsigned transactions explicitly
The SDK helps you assemble instructions and unsigned transactions. It does not try to own wallet sending. That keeps the SDK useful in apps, scripts, bots, and backends.
Recommended sequence
Load the state you need
Fetch the exact curve or pool state for the action.
Preview the action
Preview the action to compute outputs, fees, and price impact.
Build the instructions
Build the protocol instructions from the fresh state and preview result.
Assemble the unsigned transaction
Assemble the unsigned transaction with the fee payer and compute settings you want.
Sign and submit with your wallet layer
The SDK intentionally stops at unsigned transaction assembly.
Example: build a curve buy transaction
import { DumpsterClient } from '@dumpster-cash/dumpster-sdk';
import BN from 'bn.js';
const client = new DumpsterClient(connection);
const gorAmount = new BN(1_000_000_000);
const state = await client.accounts.fetchCurveTradeState(mint, wallet.publicKey);
const preview = client.preview.curveBuy({
feeConfig: state.feeConfig,
bondingCurve: state.bondingCurve,
amountInGor: gorAmount,
});
const instructions = await client.curve.buildBuyExactOut({
global: state.global,
bondingCurve: state.bondingCurve,
associatedUserAccountInfo: state.associatedUserAccountInfo ?? null,
mint,
user: wallet.publicKey,
amount: preview.amountOutTokens,
gorAmount,
slippage: 1,
});
const tx = await client.tx.buildTransaction(instructions, {
feePayer: wallet.publicKey,
computeUnits: 300_000,
priorityFeeMicrolamports: 10_000,
});Add compute budget without building the transaction yet
If you only want to prepend compute budget instructions:
const instructionsWithBudget = client.tx.withComputeBudget(instructions, {
computeUnits: 300_000,
priorityFeeMicrolamports: 10_000,
});Extra signers
Two important flows return or require extra signers:
- token creation -> the mint keypair must sign
- migration -> the returned temporary LP keypair must sign
Make sure your wallet or signing layer receives those signers when you submit.