查詢質押/贖回訂單歷史
信息
API key需要"理財""權限
HTTP 請求
GET /v5/earn/order
請求參數
參數 | 是否必需 | 類型 | 說明 |
---|---|---|---|
category | true | string | FlexibleSaving ,OnChain 備註: 本期僅支持活期理財和鏈上賺幣 |
orderId | false | string | 系統生成的訂單ID |
orderLinkId | false | string | 自定義訂單ID 備註: 如果orderLinkId有復用, 則僅用orderLinkId查詢時, 總是返回最近的那筆訂單 |
響應參數
參數 | 類型 | 說明 |
---|---|---|
list | array | Object |
> coin | string | 幣種名稱 |
> orderValue | string | 質押/贖回數量 |
> orderType | string | Redeem , Stake |
> orderId | string | 系統生成的訂單ID |
> orderLinkId | string | 自定義訂單ID |
> status | string | 訂單狀態 Success , Fail , Pending |
> createdAt | string | 訂單創建時間 (毫秒) |
> productId | string | 產品ID |
> updatedAt | string | 訂單更新時間 (毫秒) |
> swapOrderValue | string | 到手金額. 僅適用於 LST OnChain |
> estimateRedeemTime | string | 預計贖回時間 毫秒級(只有贖回訂單展示). 僅適用於 OnChain |
> estimateStakeTime | string | 預計質押時間 毫秒級(只有質押訂單展示).僅適用於 OnChain |
請求示例
- HTTP
- Python
- Node.js
GET /v5/earn/order?orderId=0572b030-6a0b-423f-88c4-b6ce31c0c82d&category=FlexibleSaving HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1739937044221
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json
from pybit.unified_trading import HTTP
session = HTTP(
testnet=True,
api_key="xxxxxxxxxxxxxxxxxx",
api_secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
)
print(session.get_stake_or_redemption_history(
category="FlexibleSaving",
orderId="0572b030-6a0b-423f-88c4-b6ce31c0c82d",
))
響應示例
{
"retCode": 0,
"retMsg": "",
"result": {
"list": [
{
"coin": "BTC",
"orderValue": "1",
"orderType": "Stake",
"orderId": "9640dc23-df1a-448a-ad24-e1a48028a51f",
"orderLinkId": "cjm2",
"status": "Success",
"createdAt": "1744166831000",
"productId": "8",
"updatedAt": "1744166832000",
"swapOrderValue": "",
"estimateRedeemTime": "",
"estimateStakeTime": ""
}
]
},
"retExtInfo": {},
"time": 1739937045520
}