v1

latestOpenAPI 3.0.32026-07-22693462.7 KB
Transaction

Build swap transaction (base input)

Generate a serialized swap transaction for a fixed input amount. Requires a successful compute response from /compute/swap-base-in.

post/transaction/swap-base-in

Request body

walletstring required

Signer wallet address (base58).

txVersion'V0' | 'LEGACY' required

Solana transaction version.

computeUnitPriceMicroLamportsstring required

Compute unit price in micro-lamports (for priority fees).

wrapSolboolean

Whether to wrap SOL if the input is native SOL.

unwrapSolboolean

Whether to unwrap WSOL to SOL in the output.

inputAccountstring

Optional token account address for input. Required if not wrapping SOL.

outputAccountstring

Optional token account address for output.

referrerWalletstring

Optional referrer wallet address for fee collection.

Example request

{
  "wallet": "11111111111111111111111111111111",
  "txVersion": "V0",
  "computeUnitPriceMicroLamports": "1000",
  "inputAccount": "TokenAccount1111111111111111111111111111111111",
  "outputAccount": "TokenAccount2222222222222222222222222222222222",
  "referrerWallet": "ReferrerWallet1111111111111111111111111111111111"
}

Response

Serialized transaction built successfully.

idstring

Unique request identifier.

successboolean

Whether transaction building succeeded.

versionstring

Example response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "success": true,
  "version": "V1"
}