Skip to main content
The built-in helpers cover common flows. Use wallet.buildTransaction(...) or wallet.build_transaction(...) when you still want hosted preparation but need your own instruction set.

What it does

The custom transaction builder prepares a transaction for an existing Swig wallet from a list of Solana instructions you provide. Use it when:
  • the transfer and swap helpers are not enough
  • you already know the exact instruction bundle you want to run
  • you still want the backend to prepare the final wallet transaction

Example

TypeScript
The SDK normalizes the instruction input and sends it to POST /transaction/prepare/custom. The API returns the prepared transaction for your application-owned signing and submission flow.

What still applies

This is still a prepared transaction result. Your application must inspect the serialized transaction’s required signer set and process every signatureRequests / signature_requests record. The array covers embedded secp256r1 and secp256k1 signatures; an Ed25519 requirement appears in the Solana transaction instead. Your application then chooses direct or sponsored submission.

Full protocol control

Use the Protocol SDK for full protocol control, custom role or action construction, or instruction-by-instruction authoring.