跳转到主要内容
POST
/
transaction
/
swap-base-in
构建 swap 交易(固定输入)
curl --request POST \
  --url https://transaction-v1.raydium.io/transaction/swap-base-in \
  --header 'Content-Type: application/json' \
  --data '
{
  "wallet": "11111111111111111111111111111111",
  "swapResponse": {
    "id": "<string>",
    "success": true,
    "version": "<string>",
    "data": {}
  },
  "txVersion": "V0",
  "computeUnitPriceMicroLamports": "1000",
  "wrapSol": false,
  "unwrapSol": false,
  "inputAccount": "TokenAccount1111111111111111111111111111111111",
  "outputAccount": "TokenAccount2222222222222222222222222222222222",
  "jitoInfo": {
    "address": "<string>",
    "amount": "<string>"
  },
  "referrerWallet": "ReferrerWallet1111111111111111111111111111111111"
}
'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "success": true,
  "version": "V1",
  "data": {
    "transaction": "<string>",
    "addressLookupTableAddresses": [
      "<string>"
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.raydium.io/llms.txt

Use this file to discover all available pages before exploring further.

请求体

application/json
wallet
string
必填

签名者钱包地址(base58)。

示例:

"11111111111111111111111111111111"

swapResponse
object
必填

来自 compute 端点的完整响应对象。

txVersion
enum<string>
必填

Solana 交易版本。

可用选项:
V0,
LEGACY
示例:

"V0"

computeUnitPriceMicroLamports
string
必填

计算单元价格,单位为 micro-lamports(用于优先费用)。

示例:

"1000"

wrapSol
boolean

若输入为原生 SOL,是否自动 wrap SOL。

示例:

false

unwrapSol
boolean

是否将输出中的 WSOL 解包为 SOL。

示例:

false

inputAccount
string

输入代币账户地址(可选)。若不 wrap SOL 则必填。

示例:

"TokenAccount1111111111111111111111111111111111"

outputAccount
string

输出代币账户地址(可选)。

示例:

"TokenAccount2222222222222222222222222222222222"

jitoInfo
object

用于 MEV 保护的 Jito bundle 参数(可选)。

referrerWallet
string

用于手续费归集的推荐人钱包地址(可选)。

示例:

"ReferrerWallet1111111111111111111111111111111111"

响应

序列化交易构建成功。

id
string

唯一请求标识符。

示例:

"550e8400-e29b-41d4-a716-446655440000"

success
boolean

交易构建是否成功。

示例:

true

version
string
示例:

"V1"

data
object

交易数据。