礦池API
基礎信息
接口地址
● 密鑰獲取方式
a. 登錄官網在個人中心下面能看到"獲取API密鑰"入口,点击获取后请保存好您的私钥。
● 線上環境
a. 官網線上:https://api.spiderpool.com/
說明
● H、KH、MH、GH、TH、PH、EH,算力單位間相差1000
註意
● 所有接口采用私鑰簽名,公鑰驗簽的方式請求
● 統一請求格式
{
"dataJson": "",
"accessKey": "",
"timestamp": 1628381288000,
"sign": ""
}● 如訪問/v2/addUser接口
● 統一返回格式
code="SUCCESS" 為操作成功,其余失敗
● 請求示例
API
創建子賬號
備註:建立BTC子帳號會同時建立FB子帳號,但建立FB子帳號不會同時建立BTC子帳號
請求 AUTH
AUTHPOST /v2/subaccount/createSubaccount
參數
coin
String
true
-
幣種,如,btc、fb
subaccount
String
true
-
子賬號(5~20由小寫字母數字組成的)
walletAddress
String
false
-
錢包地址(請根據鏈環境填符合規則的地址)
正確響應:
錯誤響應:
修改子賬號
請求 AUTH
AUTHPOST /v2/subaccount/modifyWalletAddress
參數
coin
String
true
-
幣種縮寫,如,btc、fb
subaccount
String
true
-
子賬號名稱
newWalletAddress
String
true
-
新的錢包地址(請根據鏈環境填符合規則的地址)
正確響應:
錯誤響應:
觀察者模式
請求 AUTH
AUTHPOST /v2/subaccount/subAccountObserverLink
參數
coin
String
true
-
幣種縮寫,如,btc、fb
subaccount
String
true
-
子賬號名稱
type
String
true
-
類型:newSign 新增、resetSign 重置、deleteSign 刪除
正確響應:
錯誤響應:
獲取子賬號列表
請求 AUTH
AUTHPOST /v2/sp/subaccount/list
參數
coin
String
true
-
幣種縮寫,如,btc、ltc、etc
正確響應:
獲取子賬號分页列表-带算力
請求 AUTH
AUTHPOST /v2/sp/subaccount/pageWithHashRate
參數
coin
String
false
-
幣種縮寫,如btc、ltc
subaccount
String
false
-
子賬號,支持模糊查詢
showStatus
Integer
false
1
0:隱藏子賬號,1:顯示
pageNumber
Integer
false
1
頁數
pageSize
Integer
false
10
每頁數量
正確響應:
獲取子賬號收益詳細信息
請求 AUTH
AUTHPOST /v2/subaccount/getSubaccountProfitDetailInfo
參數
coin
String
true
-
幣種縮寫,如btc、ltc
subaccount
String
true
-
子賬號名稱
startTimestamp
Integer
false
0
查詢起始時間戳(秒)
endTimestamp
Integer
false
當前時間 查詢結束時間戳(秒)
pageNumber
Integer
false
1
頁號
pageSize
Integer
false
10
每頁展示條數
bizType
String
false
alone_mining
业务类型(fb币种使用)。alone_mining:单挖;join_mining:双挖
正確響應:
獲取子賬號支付記錄
請求 AUTH
AUTHPOST /v2/subaccount/getSubaccountPaymentRecord
參數
coin
String
true
-
幣種縮寫,如btc、ltc
subaccount
String
true
-
子賬號名稱
startTimestamp
Integer
false
0
查詢起始時間戳(毫秒)
endTimestamp
Integer
false
当前时间
查詢結束時間戳(毫秒)
pageNumber
Integer
false
1
頁號
pageSize
Integer
false
10
每頁展示條數
正確響應:
獲取子賬號收益信息
請求 AUTH
AUTHPOST /v2/subaccount/getSubaccountProfitInfo
參數
coin
String
true
-
幣種縮寫,如btc、ltc
subaccount
String
true
-
子賬號名稱
bizType
String
false
alone_mining
业务类型(fb币种使用)。alone_mining:单挖;join_mining:双挖
正確響應:
獲取子賬號日收益信息
請求 AUTH
AUTHPOST /v2/sp/subaccount/getDayProfitDetailInfo
參數
coin
String
true
-
幣種縮寫,如btc、ltc
subaccount
String
true
-
子賬號名稱
timeStamp
int
true
秒級時間戳 UTC+0
bizType
String
false
alone_mining
业务类型(fb币种使用)。alone_mining:单挖;join_mining:双挖
正確響應:
獲取子賬號小時收益信息
請求 AUTH
AUTHPOST /v2/sp/subaccount/getHourProfitDetailInfo
參數
coin
String
true
-
幣種縮寫,如btc、ltc
subaccount
String
true
-
子賬號名稱
timeStamp
int
true
秒級時間戳
正確響應:
獲取昨日BTC塊收益與手續費收益比例
請求
POST /v2/subaccount/getFPPSRate
參數
coin
String
true
-
幣種縮寫,如btc、ltc
day
Int
false
-
時間(秒)
正確響應:
獲取主賬號实时算力
請求
POST /v2/sp/hashrate/user/realHashRate
參數
coin
String
true
-
幣種縮寫,如btc、ltc
正確響應:
獲取子賬號實時算力
請求
POST /v2/sp/hashrate/subaccount/realHashRate
參數
coin
String
true
-
幣種縮寫,如btc、ltc
subaccount
String
true
-
子賬號名稱
正確響應:
獲取子賬號10分鐘、1小時、24小時算力
請求
POST /v2/sp/hashrate/subaccount/fullHashRate
參數
coin
String
true
-
幣種縮寫,如btc、ltc
subaccount
String
true
-
子賬號名稱
正確響應:
獲取子賬號算力圖
請求
POST /v2/sp/hashrate/subaccount/hashRateChart
參數
coin
String
true
-
幣種縮寫,如btc、ltc
subaccount
String
true
-
子賬號名稱
timeLevel
String
false
day_30
hour_24:24小時 10分鐘數據 day_7:7天 1小時級別數據 day_30:30天 天級別數據 day_90:90天 天級別數據
正確響應:
獲取子賬號歷史算力圖
請求
POST /v2/sp/hashrate/subaccount/timeRangeHashRateChart
參數
coin
String
true
-
幣種縮寫,如btc、ltc
subaccount
String
true
-
子賬號名稱
timeLevel
String
false
day
day:天級別數據,最近一年數據 hour:小時級別數據,最近30天數據
startTimestamp
Long
true
秒級時間戳
endTimestamp
Long
true
秒級時間戳
正確響應:
獲取子賬號在線/離線礦機數量
請求
POST /v2/sp/hashrate/subaccount/onOffLineWorkerCount
參數
coin
String
true
-
幣種縮寫,如btc、ltc
subaccount
String
true
-
子賬號名稱
正確響應:
獲取子賬號礦機列表
請求
POST /v2/sp/hashrate/worker/list
參數
coin
String
true
-
幣種縮寫,如btc、ltc
subaccount
String
true
-
子賬號名稱
workerName
String
false
-
礦機名稱,支持模糊查詢
sortField
String
false
worker_name
排序字段, worker_name:礦機名 minute_hash_rate:10分鐘算力 day_hash_rate:24小時算力 day_stale_rate:24小時延遲率 day_reject_rate:24小時拒絕率 share_time:share最後提交時間
sortRule
String
false
asc
asc:正序 desc:倒序
status
String
false
-
online:在線 offline:離線
pageNum
Integer
false
1
頁數
pageSize
Integer
false
10
每頁條數
正確響應:
獲取子賬號礦機算力圖
請求
POST /v2/sp/hashrate/worker/hashRateChart
參數
coin
String
true
-
幣種縮寫,如,btc
subaccount
String
true
-
子賬號名稱
workerName
String
true
礦機名稱
timeLevel
String
false
day_30
hour_24:24小時 10分鐘數據 day_7:7天 1小時級別數據 day_30:30天 天級別數據 day_90:90天 天級別數據
正確響應:
獲取優先上鏈費用
請求
POST /v2/sp/txPriorityChain/getChainingFee
參數
txHash
String
true
交易hash
informEmail
String
true
用戶郵箱
coin
String
true
btc
正確響應:
優先上鏈
請求
POST /v2/sp/txPriorityChain/submit
參數
coin
String
true
btc
txHash
String
true
交易hash
informEmail
String
true
用戶郵箱
curTxSize
Integer
true
當前交易體積
totalFee
BigDecimal
true
支付費用
正確響應:
優先上鏈訂單列表
請求
POST /v2/sp/txPriorityChain/queryOrderPage
參數
pageNumber
Integer
true
當前頁
pageSize
Integer
true
每頁數量
正確響應:
優先上鏈訂單詳情
請求
POST /v2/sp/txPriorityChain/orderDetail
參數
txHash
String
true
交易hash
正確響應:
優先上鏈賬戶信息
請求
POST /v2/sp/txPriorityChain/accountInfo
參數
正確響應:
交易廣播
請求
POST /v2/sp/txPriorityChain/submitRawTransaction
參數
coin
String
true
btc
rawTransactionList
List
true
原始交易list
isPrivate
bool
false
false
私有交易不會廣播給其他節點
正確響應:
子帳戶起付額設定
請求
POST /v2/subaccount/updateUserMinimumPayment
參數
coin
String
true
幣種
subaccount
String
true
子賬戶名
minimumPay
BigDecimal
true
起付額
正確響應:
取得子帳戶起付額
請求
POST /v2/subaccount/getUserMinimumPayment
參數
coin
String
true
幣種
subaccount
String
true
子賬戶名
正確響應:
查詢子賬號收益分配列表
請求
POST /v2/sp/incomeDistribute/userList
參數
coin
String
true
幣種
subaccount
String
true
子賬戶名
正確響應:
移除子賬號收益分配
請求
POST /v2/sp/incomeDistribute/delete
參數
coin
String
true
幣種
subaccount
String
true
子賬戶名
toSubAccount
String
true
接受收益的子賬戶
正確響應:
新增&更新子賬號收益分配
請求
POST /v2/sp/incomeDistribute/upsert
參數
coin
String
true
幣種
subaccount
String
true
子賬戶名
toSubAccount
String
true
接受收益的子賬戶
percentage
String
true
分成比例0.01-100
remark
String
false
最大長度20
正確響應:
查詢子賬號收益分配剩餘百分比
請求
POST /v2/sp/incomeDistribute/remainingPercent
參數
coin
String
true
幣種
subaccount
String
true
子賬戶名
正確響應:
查詢子賬號收益分配轉入記錄
請求
POST /v2/sp/incomeDistribute/transferIncome
參數
coin
String
true
幣種
subaccount
String
true
子賬戶名
timestamp
Integer
true
UTC+0 0點秒級時間戳
正確響應:
棄用API
以下API待棄用,如仍在使用,請按說明切換到對應新接口。
獲取子賬號信息
已棄用,請使用 獲取子賬號分頁列表-帶算力
請求 AUTH
AUTHPOST /v2/subaccount/getSubaccountInfo
參數
coin
String
false
-
幣種縮寫,如,btc
subaccount
String
false
-
子賬號名稱
isGetSubaccountDetailInfo
Boolean
false
-
是否查詳情
正確響應:
獲取子賬號算力詳細信息
已棄用,請使用 获取子账号算力图
請求 AUTH
AUTHPOST /v2/subaccount/getSubaccountHashrateDetailInfo
參數
coin
String
true
-
幣種縮寫,如,btc、eth
subaccount
String
true
-
子賬號名稱
mode
String
false
hourly
mode=hourly表示24小時圖,mode=daily表示30天圖
正確響應:
獲取子賬號礦工信息
已棄用,請使用 獲取子賬號矿机列表
請求 AUTH
AUTHPOST /v2/worker/getSubaccountWorkerDetailInfo
參數
coin
String
true
-
幣種縮寫,如,btc
subaccount
String
true
-
子賬號名稱
正確響應:
獲取子賬號礦機算力詳細信息
已棄用,請使用 獲取子賬號礦機算力圖
請求
POST /v2/worker/getSubaccountWorkerHashrateDetailInfo
參數
coin
String
true
-
幣種縮寫,如,btc
subaccount
String
true
-
子賬號名稱
worker
String
true
-
礦機名稱
mode
String
false
hourly mode=hourly表示24小時圖,mode=daily表示30天圖(僅BTC支持)
正確響應:
拉取歷史算力數據
已棄用,請使用 獲取子賬號歷史算力圖
請求
POST /v2/subaccount/getHashrate
參數
coin
String
true
幣種
subaccount
String
true
子賬戶名
mode
String
true
day/hour
startTimestamp
Integer
true
秒級時間戳
endTimestamp
Integer
false
秒級時間戳
正確響應:
最后更新于