-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
215 lines (195 loc) · 6.83 KB
/
Copy pathindex.d.ts
File metadata and controls
215 lines (195 loc) · 6.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
declare module 'node-antpool' {
export interface MiningType {
payMethod: string
percent: number
percentStr: string
}
export enum CoinType {
BTC = 'BTC',
BCH = 'BCH',
LTC = 'LTC',
ETH = 'ETH',
ZEC = 'ZEC',
DASH = 'DASH',
XMC = 'XMC',
BTM = 'BTM',
USDT = 'USDT'
}
export interface CoinInfo {
coinType: string
networkDiff: number
blockReward: number // 总奖励
coinPriceCny: number
coinPriceUsd: number
miningType: MiningType[]
blockIncentive: number // 矿工奖励
blockTxFee: number // 交易费奖励
}
export interface PoolStatsResponse {
poolHashrate: number // 矿池算力(单位为:MH/s)
activeWorkerNumber: number // 有效矿工数
poolStatus: string // 矿池状态
networkDiff: number // 当前网络难度
estimateTime: number // Block期望时间(单位:秒)
currentRound: number // 当前运行时间(单位:秒)
totalShareNumber: number // 总工作量
totalBlockNumber: number // 总Block数
}
export interface AccountResponse {
earn24Hours: string // 最近一日收益
earnTotal: string // 总收益
paidOut: string // 已支付收益
balance: string // 余额
settleTime: string // 最近一日收益日期
}
export interface HashrateResponse {
last10m: string // 十分钟算力
last30m: string // 三十分钟算力(废弃)
last1h: string // 一小时算力
last1d: string // 一天算力
prev10m: string // 前十分钟算力(废弃)
prev30m: string // 前三十分钟算力(废弃)
prev1h: string // 前一小时算力(废弃)
prev1d: string // 前一天算力(废弃)
accepted: string // 接收的算力
stale: string // 失效算力
dupelicate: string // 重复算力
other: string // 其他算力
totalWorkers: number // 总矿工数量
activeWorkers: number // 活跃矿工数量
}
export interface WorkersResponse {
rows: {
worker: string // 矿工名称
last10m: string // 十分钟算力
last30m: string // 三十分钟算力(废弃)
last1h: string // 小时算力
last1d: string // 天算力
prev10m: string // 前十分钟算力
prev30m: string // 前三十分钟算力(废弃)
prev1h: string // 前一小时算力
prev1d: string // 前一天算力
accepted: string // 接收的算力
stale: string // 无效算力
dupelicate: string // 重复算力
other: string // 其他算力
}[]
page: 1
totalPage: 1
pageSize: 10
totalRecord: 1
}
export enum PaymentType {
PAYOUT = 'payout',
RECV = 'recv'
}
interface PaymentHistoryPayout {
id: string // 记录id
timestamp: string // 支付时间
walletAddress: string // 钱包地址
txId: string // 交易哈希
amount: string // 支付额度
}
interface PaymentHistoryRecv {
timestamp: string // 时间
hashrate: string // 算力
hashrateUnit: string // 算力值
ppsAmount: string // pps收益
pplnsAmount: string // pplns收益
soloAmount: string // solo挖矿收益
ppappsAmount: string // ppapps挖矿收益
ppapplnsAmount: string // ppapplns挖矿收益
fppsBlockAmount: string // fpps挖矿区块奖励收益
fppsFeeAmount: string // fpps挖矿交易费收益
}
export interface PaymentHistoryV2Response {
rows: PaymentHistoryRecv[] | PaymentHistoryPayout[]
page: number
totalPage: number
pageSize: number
totalRecord: number
}
export interface ChangeMiningCoinResponse {
version: string
code: number
message: string
}
export interface AccountOverviewResponse {
hsLast10m: string // 十分钟算力
hsLast1d: string // 天算力
invalidWorkerNum: number // 失效矿工数量
totalAmount: string // 收益总金额
totalWorkerNum: number // 矿工总数量
unpaidAmount: string // 未支付金额
yesterdayAmount: string // 最近一日收益
inactiveWorkerNum: string // 掉线矿工数量
hsLast1h: string // 小时算力
userId: string // 用户id
activeWorkerNum: string // 活跃矿工数量
}
export enum WorkerStatus {
ALL = '0',
ONLINE = '1',
OFFLINE = '2',
INVALID = '3'
}
export interface UserWorkerListResponse {
result: {
page: number
totalPage: number
pageSize: number
totalRecord: number
rows: {
workerId: string // 矿工名称
hsLast1h: string // 一小时算力
hsLast1d: string // 一天算力
rejectRatio: string // 拒绝率
shareLastTime: string // 最近提交算力时间
}[]
}
coinType: string
userId: string
}
export interface CoinCalculatorResponse {
payMethod: string // 收益模式
coinType: string // 收益币种,例如当计算SHA256币种的收益时,收益币种为BTC
networkDiff: string // 网络难度
hashInput: string // 输入的算力值
feePercent: string // 手续费率
blockIncentiveVal: string // 区块奖励收益(收益以币结算)
blockTxFee: string // 区块交易费收益(收益以币结算)
coinMount: string // 每日收益币种的数量
resultMountCny: string // 每日收益人民币
resultMountUsd: string // 每日收益美元
coinPriceCny: string // 币价/人民币
coinPriceUsd: string // 币价/美元
}
export interface UserHashrateChartResponse {
poolSpeedBeanList: {
date: number // 时间戳
speed: number // 算力值
}
unit: string // 算力值单位
coin: string // 币种
}
export interface AntPool {
poolStats (): Promise<PoolStatsResponse>
account (options?: { userId: string }): Promise<AccountResponse>
hashrate (options?: { userId?: string }): Promise<HashrateResponse>
workers (options?: { clientUserId: string, groupId?: string, pageEnable?: boolean, page?: number, pageSize?: number }): Promise<WorkersResponse>
paymentHistoryV2 (options?: { pageEnable?: boolean, type: PaymentType, page?: number, pageSize?: number }): Promise<PaymentHistoryV2Response>
changeMiningCoin (coin: string): Promise<ChangeMiningCoinResponse>
accountOverview (options?: { userId: string }): Promise<AccountOverviewResponse>
userWorkerList (options?: { userId: string, workerStatus: WorkerStatus, page: number, pageSize: number }): Promise<UserWorkerListResponse>
coinCalculator (options?: { hashInput: number, networkDiff?: number, coinType: string, feePercent?: number }): Promise<CoinCalculatorResponse>
userHashrateChart (opitons?: { userId: string, userWorkerId: string, coinType: string, date: string, type: number }): Promise<UserHashrateChartResponse>
}
export interface AntPoolClientOptions {
key?: string
secret?: string
coin?: CoinType
userId?: string
timeout?: number
}
export default function (options?: AntPoolClientOptions): AntPool
}