Chuyển đến nội dung chính
POST
/
transaction
/
swap-base-in
Xây dựng giao dịch swap (đầu vào cơ sở)
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.

Nội dung

application/json
wallet
string
bắt buộc

Địa chỉ ví ký giao dịch (base58).

Ví dụ:

"11111111111111111111111111111111"

swapResponse
object
bắt buộc

Toàn bộ đối tượng phản hồi từ endpoint compute.

txVersion
enum<string>
bắt buộc

Phiên bản giao dịch Solana.

Tùy chọn có sẵn:
V0,
LEGACY
Ví dụ:

"V0"

computeUnitPriceMicroLamports
string
bắt buộc

Giá compute unit tính bằng micro-lamports (cho phí ưu tiên).

Ví dụ:

"1000"

wrapSol
boolean

Có nên wrap SOL nếu đầu vào là SOL gốc hay không.

Ví dụ:

false

unwrapSol
boolean

Có nên unwrap WSOL thành SOL ở đầu ra hay không.

Ví dụ:

false

inputAccount
string

Địa chỉ token account tùy chọn cho đầu vào. Bắt buộc nếu không wrap SOL.

Ví dụ:

"TokenAccount1111111111111111111111111111111111"

outputAccount
string

Địa chỉ token account tùy chọn cho đầu ra.

Ví dụ:

"TokenAccount2222222222222222222222222222222222"

jitoInfo
object

Tham số bundle Jito tùy chọn cho bảo vệ MEV.

referrerWallet
string

Địa chỉ ví referrer tùy chọn để thu thập phí.

Ví dụ:

"ReferrerWallet1111111111111111111111111111111111"

Phản hồi

Giao dịch được tuần tự hóa được xây dựng thành công.

id
string

Mã định danh yêu cầu duy nhất.

Ví dụ:

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

success
boolean

Liệu việc xây dựng giao dịch có thành công hay không.

Ví dụ:

true

version
string
Ví dụ:

"V1"

data
object

Dữ liệu giao dịch.