Array of instructions to include in the transaction
The signer that will pay for the transaction (must be the SAME instance used to build instructions)
OptionallookupTableAddresses: (string | Address)[]Optional array of address lookup table addresses to compress the transaction
// Node.js with KeyPairSigner - fully signed automatically
const { instructions } = await swapInstructions(rpc, params, pool, 100, keypairSigner);
const tx = await buildTransaction(instructions, keypairSigner);
await sendTransaction(tx);
// Browser with NoopSigner - partially signed, wallet signs separately
const noopSigner = createNoopSigner(walletAddress);
const { instructions } = await swapInstructions(rpc, params, pool, 100, noopSigner);
const partialTx = await buildTransaction(instructions, noopSigner); // Same instance!
const [signedTx] = await wallet.modifyAndSignTransactions([partialTx]);
await sendTransaction(signedTx);
Builds and signs a transaction from the given instructions and configuration.