@hiveio/wax-api-balance-tracker 1.27.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +7 -0
- package/README.md +26 -0
- package/index.d.ts +558 -0
- package/index.js +47 -0
- package/package.json +29 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright (c) 2025 Hive community
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# balance-api API definitions
|
|
2
|
+
|
|
3
|
+
Wax REST API definitions for balance-api
|
|
4
|
+
|
|
5
|
+
> This package has been auto-generated by the @hiveio/wax-spec-generator script
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
In order to use this package, you have to install it:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @hiveio/wax-api-balance-tracker
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
And import into your Wax project:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import WaxExtendedData from '@hiveio/wax-api-balance-tracker';
|
|
19
|
+
import { createHiveChain } from '@hiveio/wax';
|
|
20
|
+
|
|
21
|
+
const chainExtended = (await createHiveChain()).extendRest(WaxExtendedData);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
See the license in the [LICENSE.md](LICENSE.md) file
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,558 @@
|
|
|
1
|
+
type TEmptyReq = {}
|
|
2
|
+
export enum BtrackerBackendGranularity {
|
|
3
|
+
Daily = "daily",
|
|
4
|
+
Monthly = "monthly",
|
|
5
|
+
Yearly = "yearly",
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export enum BtrackerBackendGranularityHourly {
|
|
9
|
+
Hourly = "hourly",
|
|
10
|
+
Daily = "daily",
|
|
11
|
+
Monthly = "monthly",
|
|
12
|
+
Yearly = "yearly",
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export enum BtrackerBackendNaiType {
|
|
16
|
+
HBD = "HBD",
|
|
17
|
+
HIVE = "HIVE",
|
|
18
|
+
VESTS = "VESTS",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export enum BtrackerBackendLiquidNaiType {
|
|
22
|
+
HBD = "HBD",
|
|
23
|
+
HIVE = "HIVE",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export enum BtrackerBackendBalanceType {
|
|
27
|
+
Balance = "balance",
|
|
28
|
+
SavingsBalance = "savings_balance",
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export enum BtrackerBackendSortDirection {
|
|
32
|
+
Asc = "asc",
|
|
33
|
+
Desc = "desc",
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface BtrackerBackendBalance {
|
|
37
|
+
/** number of HIVE backed dollars the account has */
|
|
38
|
+
hbd_balance?: number;
|
|
39
|
+
/** account''s HIVE balance */
|
|
40
|
+
hive_balance?: number;
|
|
41
|
+
/** account''s VEST balance */
|
|
42
|
+
vesting_shares?: string;
|
|
43
|
+
/** the VEST balance, presented in HIVE, is calculated based on the current HIVE price */
|
|
44
|
+
vesting_balance_hive?: number;
|
|
45
|
+
/** account''s VEST balance - delegated VESTs + reveived VESTs, presented in HIVE,calculated based on the current HIVE price */
|
|
46
|
+
post_voting_power_vests?: string;
|
|
47
|
+
/** VESTS delegated to another user, account''s power is lowered by delegated VESTS */
|
|
48
|
+
delegated_vests?: string;
|
|
49
|
+
/** VESTS received from another user, account''s power is increased by received VESTS */
|
|
50
|
+
received_vests?: string;
|
|
51
|
+
/** rewards obtained by posting and commenting expressed in VEST */
|
|
52
|
+
curation_rewards?: string;
|
|
53
|
+
/** curator''s reward expressed in VEST */
|
|
54
|
+
posting_rewards?: string;
|
|
55
|
+
/** not yet claimed HIVE backed dollars stored in hbd reward balance */
|
|
56
|
+
hbd_rewards?: number;
|
|
57
|
+
/** not yet claimed HIVE stored in hive reward balance */
|
|
58
|
+
hive_rewards?: number;
|
|
59
|
+
/** not yet claimed VESTS stored in vest reward balance */
|
|
60
|
+
vests_rewards?: string;
|
|
61
|
+
/** the reward vesting balance, denominated in HIVE, is determined by the prevailing HIVE price at the time of reward reception */
|
|
62
|
+
hive_vesting_rewards?: number;
|
|
63
|
+
/** saving balance of HIVE backed dollars */
|
|
64
|
+
hbd_savings?: number;
|
|
65
|
+
/** HIVE saving balance */
|
|
66
|
+
hive_savings?: number;
|
|
67
|
+
/** number representing how many payouts are pending from user''s saving balance */
|
|
68
|
+
savings_withdraw_requests?: number;
|
|
69
|
+
/** received until the withdrawal is complete, with each installment amounting to 1/13 of the withdrawn total */
|
|
70
|
+
vesting_withdraw_rate?: string;
|
|
71
|
+
/** the remaining total VESTS needed to complete withdrawals */
|
|
72
|
+
to_withdraw?: string;
|
|
73
|
+
/** the total VESTS already withdrawn from active withdrawals */
|
|
74
|
+
withdrawn?: string;
|
|
75
|
+
/** list of account receiving the part of a withdrawal */
|
|
76
|
+
withdraw_routes?: number;
|
|
77
|
+
/** blocked VESTS by a withdrawal */
|
|
78
|
+
delayed_vests?: string;
|
|
79
|
+
/** total HBD currently pending conversion */
|
|
80
|
+
conversion_pending_amount_hbd?: number;
|
|
81
|
+
/** number of HBD conversion requests */
|
|
82
|
+
conversion_pending_count_hbd?: number;
|
|
83
|
+
/** total HIVE currently pending conversion */
|
|
84
|
+
conversion_pending_amount_hive?: number;
|
|
85
|
+
/** number of HIVE conversion requests */
|
|
86
|
+
conversion_pending_count_hive?: number;
|
|
87
|
+
/** count of open HBD orders */
|
|
88
|
+
open_orders_hbd_count?: number;
|
|
89
|
+
/** count of open HIVE orders */
|
|
90
|
+
open_orders_hive_count?: number;
|
|
91
|
+
/** total amount of HIVE in open orders */
|
|
92
|
+
open_orders_hive_amount?: number;
|
|
93
|
+
/** total amount of HBD in open orders */
|
|
94
|
+
open_orders_hbd_amount?: number;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface BtrackerBackendBalances {
|
|
98
|
+
/** aggregated account''s balance */
|
|
99
|
+
balance?: string;
|
|
100
|
+
/** aggregated account''s savings balance */
|
|
101
|
+
savings_balance?: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface BtrackerBackendAggregatedHistory {
|
|
105
|
+
/**
|
|
106
|
+
* date of the balance aggregation
|
|
107
|
+
* @format date-time
|
|
108
|
+
*/
|
|
109
|
+
date?: string;
|
|
110
|
+
/** aggregated account''s balance */
|
|
111
|
+
balance?: BtrackerBackendBalances;
|
|
112
|
+
/** aggregated account''s balance from the previous day/month/year */
|
|
113
|
+
prev_balance?: BtrackerBackendBalances;
|
|
114
|
+
/** minimum account''s balance in the aggregation period */
|
|
115
|
+
min_balance?: BtrackerBackendBalances;
|
|
116
|
+
/** maximum account''s balance in the aggregation period */
|
|
117
|
+
max_balance?: BtrackerBackendBalances;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface BtrackerBackendBalanceHistory {
|
|
121
|
+
/** block number */
|
|
122
|
+
block_num?: number;
|
|
123
|
+
/** unique operation identifier with an encoded block number and operation type id */
|
|
124
|
+
operation_id?: string;
|
|
125
|
+
/** operation type identifier */
|
|
126
|
+
op_type_id?: number;
|
|
127
|
+
/** The closing balance */
|
|
128
|
+
balance?: string;
|
|
129
|
+
/** Balance in previous day/month/year */
|
|
130
|
+
prev_balance?: string;
|
|
131
|
+
/** Diffrence between balance and prev_balance */
|
|
132
|
+
balance_change?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Creation date
|
|
135
|
+
* @format date-time
|
|
136
|
+
*/
|
|
137
|
+
timestamp?: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface BtrackerBackendOperationHistory {
|
|
141
|
+
/** Total number of operations */
|
|
142
|
+
total_operations?: number;
|
|
143
|
+
/** Total number of pages */
|
|
144
|
+
total_pages?: number;
|
|
145
|
+
/** List of operation results */
|
|
146
|
+
operations_result?: BtrackerBackendBalanceHistory[];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface BtrackerBackendIncomingDelegations {
|
|
150
|
+
/** account name of the delegator */
|
|
151
|
+
delegator?: string;
|
|
152
|
+
/** amount of vests delegated */
|
|
153
|
+
amount?: string;
|
|
154
|
+
/** unique operation identifier with an encoded block number and operation type id */
|
|
155
|
+
operation_id?: string;
|
|
156
|
+
/** block number */
|
|
157
|
+
block_num?: number;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface BtrackerBackendOutgoingDelegations {
|
|
161
|
+
/** account name of the delegatee */
|
|
162
|
+
delegatee?: string;
|
|
163
|
+
/** amount of vests delegated */
|
|
164
|
+
amount?: string;
|
|
165
|
+
/** unique operation identifier with an encoded block number and operation type id */
|
|
166
|
+
operation_id?: string;
|
|
167
|
+
/** block number */
|
|
168
|
+
block_num?: number;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export interface BtrackerBackendDelegations {
|
|
172
|
+
/** List of outgoing delegations from the account */
|
|
173
|
+
outgoing_delegations?: BtrackerBackendOutgoingDelegations[];
|
|
174
|
+
/** List of incoming delegations to the account */
|
|
175
|
+
incoming_delegations?: BtrackerBackendIncomingDelegations[];
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface BtrackerBackendAmount {
|
|
179
|
+
nai?: string;
|
|
180
|
+
amount?: string;
|
|
181
|
+
precision?: number;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface BtrackerBackendIncomingRecurrentTransfers {
|
|
185
|
+
/** Account name of the sender */
|
|
186
|
+
from?: string;
|
|
187
|
+
/** ID of the pair of accounts */
|
|
188
|
+
pair_id?: number;
|
|
189
|
+
/** Amount of the transfer with NAI and precision */
|
|
190
|
+
amount?: BtrackerBackendAmount;
|
|
191
|
+
/** amount of consecutive failures */
|
|
192
|
+
consecutive_failures?: number;
|
|
193
|
+
/** Remaining executions */
|
|
194
|
+
remaining_executions?: number;
|
|
195
|
+
/** Recurrence in hours */
|
|
196
|
+
recurrence?: number;
|
|
197
|
+
/** Memo message */
|
|
198
|
+
memo?: string;
|
|
199
|
+
/**
|
|
200
|
+
* Date of the next trigger of the transfer
|
|
201
|
+
* @format date-time
|
|
202
|
+
*/
|
|
203
|
+
trigger_date?: string;
|
|
204
|
+
/** Unique operation identifier with an encoded block number and operation type id */
|
|
205
|
+
operation_id?: string;
|
|
206
|
+
/** Block number */
|
|
207
|
+
block_num?: number;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface BtrackerBackendOutgoingRecurrentTransfers {
|
|
211
|
+
/** Account name of the receiver */
|
|
212
|
+
to?: string;
|
|
213
|
+
/** ID of the pair of accounts */
|
|
214
|
+
pair_id?: number;
|
|
215
|
+
/** Amount of the transfer with NAI and precision */
|
|
216
|
+
amount?: BtrackerBackendAmount;
|
|
217
|
+
/** amount of consecutive failures */
|
|
218
|
+
consecutive_failures?: number;
|
|
219
|
+
/** Remaining executions */
|
|
220
|
+
remaining_executions?: number;
|
|
221
|
+
/** Recurrence in hours */
|
|
222
|
+
recurrence?: number;
|
|
223
|
+
/** Memo message */
|
|
224
|
+
memo?: string;
|
|
225
|
+
/**
|
|
226
|
+
* Date of the next trigger of the transfer
|
|
227
|
+
* @format date-time
|
|
228
|
+
*/
|
|
229
|
+
trigger_date?: string;
|
|
230
|
+
/** Unique operation identifier with an encoded block number and operation type id */
|
|
231
|
+
operation_id?: string;
|
|
232
|
+
/** Block number */
|
|
233
|
+
block_num?: number;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface BtrackerBackendRecurrentTransfers {
|
|
237
|
+
/** List of outgoing recurrent transfers from the account */
|
|
238
|
+
outgoing_recurrent_transfers?: BtrackerBackendOutgoingRecurrentTransfers[];
|
|
239
|
+
/** List of incoming recurrent transfers to the account */
|
|
240
|
+
incoming_recurrent_transfers?: BtrackerBackendIncomingRecurrentTransfers[];
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface BtrackerBackendTransferStats {
|
|
244
|
+
/**
|
|
245
|
+
* the time transfers were included in the blockchain
|
|
246
|
+
* @format date-time
|
|
247
|
+
*/
|
|
248
|
+
date?: string;
|
|
249
|
+
/** sum of a amount of transfered tokens in the period */
|
|
250
|
+
total_transfer_amount?: string;
|
|
251
|
+
/** average amount of transfered tokens in the period */
|
|
252
|
+
average_transfer_amount?: string;
|
|
253
|
+
/** maximum amount of transfered tokens in the period */
|
|
254
|
+
maximum_transfer_amount?: string;
|
|
255
|
+
/** minimum amount of transfered tokens in the period */
|
|
256
|
+
minimum_transfer_amount?: string;
|
|
257
|
+
/** number of transfers in the period */
|
|
258
|
+
transfer_count?: number;
|
|
259
|
+
/** last block number in time range */
|
|
260
|
+
last_block_num?: number;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export type BtrackerBackendArrayOfTransferStats = BtrackerBackendTransferStats[];
|
|
264
|
+
|
|
265
|
+
export interface BtrackerBackendRankedHolder {
|
|
266
|
+
/** Position in the ranking */
|
|
267
|
+
rank?: number;
|
|
268
|
+
/** Account name */
|
|
269
|
+
account?: string;
|
|
270
|
+
/** Asset balance for that account */
|
|
271
|
+
value?: string;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export type BtrackerBackendArrayOfAggregatedHistory = BtrackerBackendAggregatedHistory[];
|
|
275
|
+
|
|
276
|
+
export type BtrackerBackendArrayOfRankedHolder = BtrackerBackendRankedHolder[];
|
|
277
|
+
|
|
278
|
+
export interface BtrackerEndpointsGetBalanceHistoryParams {
|
|
279
|
+
/**
|
|
280
|
+
* Coin types:
|
|
281
|
+
*
|
|
282
|
+
* * HBD
|
|
283
|
+
*
|
|
284
|
+
* * HIVE
|
|
285
|
+
*
|
|
286
|
+
* * VESTS
|
|
287
|
+
*/
|
|
288
|
+
"coin-type": BtrackerBackendNaiType;
|
|
289
|
+
/**
|
|
290
|
+
* Balance types:
|
|
291
|
+
*
|
|
292
|
+
* * balance
|
|
293
|
+
*
|
|
294
|
+
* * savings_balance
|
|
295
|
+
* @default "balance"
|
|
296
|
+
*/
|
|
297
|
+
"balance-type"?: BtrackerBackendBalanceType;
|
|
298
|
+
/**
|
|
299
|
+
* Return page on `page` number, default null due to reversed order of pages,
|
|
300
|
+
* the first page is the oldest,
|
|
301
|
+
* example: first call returns the newest page and total_pages is 100 - the newest page is number 100, next 99 etc.
|
|
302
|
+
* @default null
|
|
303
|
+
*/
|
|
304
|
+
page?: number;
|
|
305
|
+
/**
|
|
306
|
+
* Return max `page-size` operations per page, defaults to `100`
|
|
307
|
+
* @default 100
|
|
308
|
+
*/
|
|
309
|
+
"page-size"?: number;
|
|
310
|
+
/**
|
|
311
|
+
* Sort order:
|
|
312
|
+
*
|
|
313
|
+
* * `asc` - Ascending, from oldest to newest
|
|
314
|
+
*
|
|
315
|
+
* * `desc` - Descending, from newest to oldest
|
|
316
|
+
* @default "desc"
|
|
317
|
+
*/
|
|
318
|
+
direction?: BtrackerBackendSortDirection;
|
|
319
|
+
/**
|
|
320
|
+
* Lower limit of the block range, can be represented either by a block-number (integer) or a timestamp (in the format YYYY-MM-DD HH:MI:SS).
|
|
321
|
+
*
|
|
322
|
+
* The provided `timestamp` will be converted to a `block-num` by finding the first block
|
|
323
|
+
* where the block''s `created_at` is more than or equal to the given `timestamp` (i.e. `block''s created_at >= timestamp`).
|
|
324
|
+
*
|
|
325
|
+
* The function will interpret and convert the input based on its format, example input:
|
|
326
|
+
*
|
|
327
|
+
* * `2016-09-15 19:47:21`
|
|
328
|
+
*
|
|
329
|
+
* * `5000000`
|
|
330
|
+
* @default null
|
|
331
|
+
*/
|
|
332
|
+
"from-block"?: string;
|
|
333
|
+
/**
|
|
334
|
+
* Similar to the from-block parameter, can either be a block-number (integer) or a timestamp (formatted as YYYY-MM-DD HH:MI:SS).
|
|
335
|
+
*
|
|
336
|
+
* The provided `timestamp` will be converted to a `block-num` by finding the first block
|
|
337
|
+
* where the block''s `created_at` is less than or equal to the given `timestamp` (i.e. `block''s created_at <= timestamp`).
|
|
338
|
+
*
|
|
339
|
+
* The function will convert the value depending on its format, example input:
|
|
340
|
+
*
|
|
341
|
+
* * `2016-09-15 19:47:21`
|
|
342
|
+
*
|
|
343
|
+
* * `5000000`
|
|
344
|
+
* @default null
|
|
345
|
+
*/
|
|
346
|
+
"to-block"?: string;
|
|
347
|
+
/** Name of the account */
|
|
348
|
+
accountName: string;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export interface BtrackerEndpointsGetBalanceAggregationParams {
|
|
352
|
+
/**
|
|
353
|
+
* Coin types:
|
|
354
|
+
*
|
|
355
|
+
* * HBD
|
|
356
|
+
*
|
|
357
|
+
* * HIVE
|
|
358
|
+
*
|
|
359
|
+
* * VESTS
|
|
360
|
+
*/
|
|
361
|
+
"coin-type": BtrackerBackendNaiType;
|
|
362
|
+
/**
|
|
363
|
+
* granularity types:
|
|
364
|
+
*
|
|
365
|
+
* * daily
|
|
366
|
+
*
|
|
367
|
+
* * monthly
|
|
368
|
+
*
|
|
369
|
+
* * yearly
|
|
370
|
+
* @default "yearly"
|
|
371
|
+
*/
|
|
372
|
+
granularity?: BtrackerBackendGranularity;
|
|
373
|
+
/**
|
|
374
|
+
* Sort order:
|
|
375
|
+
*
|
|
376
|
+
* * `asc` - Ascending, from oldest to newest
|
|
377
|
+
*
|
|
378
|
+
* * `desc` - Descending, from newest to oldest
|
|
379
|
+
* @default "desc"
|
|
380
|
+
*/
|
|
381
|
+
direction?: BtrackerBackendSortDirection;
|
|
382
|
+
/**
|
|
383
|
+
* Lower limit of the block range, can be represented either by a block-number (integer) or a timestamp (in the format YYYY-MM-DD HH:MI:SS).
|
|
384
|
+
*
|
|
385
|
+
* The provided `timestamp` will be converted to a `block-num` by finding the first block
|
|
386
|
+
* where the block''s `created_at` is more than or equal to the given `timestamp` (i.e. `block''s created_at >= timestamp`).
|
|
387
|
+
*
|
|
388
|
+
* The function will interpret and convert the input based on its format, example input:
|
|
389
|
+
*
|
|
390
|
+
* * `2016-09-15 19:47:21`
|
|
391
|
+
*
|
|
392
|
+
* * `5000000`
|
|
393
|
+
* @default null
|
|
394
|
+
*/
|
|
395
|
+
"from-block"?: string;
|
|
396
|
+
/**
|
|
397
|
+
* Similar to the from-block parameter, can either be a block-number (integer) or a timestamp (formatted as YYYY-MM-DD HH:MI:SS).
|
|
398
|
+
*
|
|
399
|
+
* The provided `timestamp` will be converted to a `block-num` by finding the first block
|
|
400
|
+
* where the block''s `created_at` is less than or equal to the given `timestamp` (i.e. `block''s created_at <= timestamp`).
|
|
401
|
+
*
|
|
402
|
+
* The function will convert the value depending on its format, example input:
|
|
403
|
+
*
|
|
404
|
+
* * `2016-09-15 19:47:21`
|
|
405
|
+
*
|
|
406
|
+
* * `5000000`
|
|
407
|
+
* @default null
|
|
408
|
+
*/
|
|
409
|
+
"to-block"?: string;
|
|
410
|
+
/** Name of the account */
|
|
411
|
+
accountName: string;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
export interface BtrackerEndpointsGetTopHoldersParams {
|
|
415
|
+
/**
|
|
416
|
+
* * HBD
|
|
417
|
+
* * HIVE
|
|
418
|
+
* * VESTS
|
|
419
|
+
*/
|
|
420
|
+
"coin-type": BtrackerBackendNaiType;
|
|
421
|
+
/**
|
|
422
|
+
* `balance` or `savings_balance`
|
|
423
|
+
* (`savings_balance` not allowed with `VESTS`).
|
|
424
|
+
* @default "balance"
|
|
425
|
+
*/
|
|
426
|
+
"balance-type"?: BtrackerBackendBalanceType;
|
|
427
|
+
/**
|
|
428
|
+
* 100 results per page (default `1`).
|
|
429
|
+
* @min 1
|
|
430
|
+
* @default 1
|
|
431
|
+
*/
|
|
432
|
+
page?: number;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
export interface BtrackerEndpointsGetTransferStatisticsParams {
|
|
436
|
+
/**
|
|
437
|
+
* Coin types:
|
|
438
|
+
*
|
|
439
|
+
* * HBD
|
|
440
|
+
*
|
|
441
|
+
* * HIVE
|
|
442
|
+
*/
|
|
443
|
+
"coin-type": BtrackerBackendLiquidNaiType;
|
|
444
|
+
/**
|
|
445
|
+
* granularity types:
|
|
446
|
+
*
|
|
447
|
+
* * hourly
|
|
448
|
+
*
|
|
449
|
+
* * daily
|
|
450
|
+
*
|
|
451
|
+
* * monthly
|
|
452
|
+
*
|
|
453
|
+
* * yearly
|
|
454
|
+
* @default "yearly"
|
|
455
|
+
*/
|
|
456
|
+
granularity?: BtrackerBackendGranularityHourly;
|
|
457
|
+
/**
|
|
458
|
+
* Sort order:
|
|
459
|
+
*
|
|
460
|
+
* * `asc` - Ascending, from oldest to newest
|
|
461
|
+
*
|
|
462
|
+
* * `desc` - Descending, from newest to oldest
|
|
463
|
+
* @default "desc"
|
|
464
|
+
*/
|
|
465
|
+
direction?: BtrackerBackendSortDirection;
|
|
466
|
+
/**
|
|
467
|
+
* Lower limit of the block range, can be represented either by a block-number (integer) or a timestamp (in the format YYYY-MM-DD HH:MI:SS).
|
|
468
|
+
*
|
|
469
|
+
* The provided `timestamp` will be converted to a `block-num` by finding the first block
|
|
470
|
+
* where the block''s `created_at` is more than or equal to the given `timestamp` (i.e. `block''s created_at >= timestamp`).
|
|
471
|
+
*
|
|
472
|
+
* The function will interpret and convert the input based on its format, example input:
|
|
473
|
+
*
|
|
474
|
+
* * `2016-09-15 19:47:21`
|
|
475
|
+
*
|
|
476
|
+
* * `5000000`
|
|
477
|
+
* @default null
|
|
478
|
+
*/
|
|
479
|
+
"from-block"?: string;
|
|
480
|
+
/**
|
|
481
|
+
* Similar to the from-block parameter, can either be a block-number (integer) or a timestamp (formatted as YYYY-MM-DD HH:MI:SS).
|
|
482
|
+
*
|
|
483
|
+
* The provided `timestamp` will be converted to a `block-num` by finding the first block
|
|
484
|
+
* where the block''s `created_at` is less than or equal to the given `timestamp` (i.e. `block''s created_at <= timestamp`).
|
|
485
|
+
*
|
|
486
|
+
* The function will convert the value depending on its format, example input:
|
|
487
|
+
*
|
|
488
|
+
* * `2016-09-15 19:47:21`
|
|
489
|
+
*
|
|
490
|
+
* * `5000000`
|
|
491
|
+
* @default null
|
|
492
|
+
*/
|
|
493
|
+
"to-block"?: string;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
type TWaxRestAPiExtended = {
|
|
497
|
+
balanceApi: {
|
|
498
|
+
accounts: {
|
|
499
|
+
accountName: {
|
|
500
|
+
balances: {
|
|
501
|
+
result: BtrackerBackendBalance,
|
|
502
|
+
params: TEmptyReq & {
|
|
503
|
+
/** Name of the account */
|
|
504
|
+
accountName: string;
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
balanceHistory: {
|
|
508
|
+
result: BtrackerBackendOperationHistory,
|
|
509
|
+
params: BtrackerEndpointsGetBalanceHistoryParams & {
|
|
510
|
+
/** Name of the account */
|
|
511
|
+
accountName: string;
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
aggregatedHistory: {
|
|
515
|
+
result: BtrackerBackendArrayOfAggregatedHistory,
|
|
516
|
+
params: BtrackerEndpointsGetBalanceAggregationParams & {
|
|
517
|
+
/** Name of the account */
|
|
518
|
+
accountName: string;
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
delegations: {
|
|
522
|
+
result: BtrackerBackendDelegations,
|
|
523
|
+
params: TEmptyReq & {
|
|
524
|
+
/** Name of the account */
|
|
525
|
+
accountName: string;
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
recurrentTransfers: {
|
|
529
|
+
result: BtrackerBackendRecurrentTransfers,
|
|
530
|
+
params: TEmptyReq & {
|
|
531
|
+
/** Name of the account */
|
|
532
|
+
accountName: string;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
},
|
|
537
|
+
topHolders: {
|
|
538
|
+
result: BtrackerBackendArrayOfRankedHolder,
|
|
539
|
+
params: BtrackerEndpointsGetTopHoldersParams & {
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
transferStatistics: {
|
|
543
|
+
result: BtrackerBackendArrayOfTransferStats,
|
|
544
|
+
params: BtrackerEndpointsGetTransferStatisticsParams & {
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
version: {
|
|
548
|
+
result: string,
|
|
549
|
+
params: undefined
|
|
550
|
+
},
|
|
551
|
+
lastSyncedBlock: {
|
|
552
|
+
result: number,
|
|
553
|
+
params: undefined
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
declare var WaxExtendedData: TWaxRestAPiExtended
|
|
558
|
+
export default WaxExtendedData
|
package/index.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
balanceApi: {
|
|
3
|
+
accounts: {
|
|
4
|
+
urlPath: "accounts",
|
|
5
|
+
accountName: {
|
|
6
|
+
urlPath: "{accountName}",
|
|
7
|
+
balances: {
|
|
8
|
+
urlPath: "balances",
|
|
9
|
+
method: "GET"
|
|
10
|
+
},
|
|
11
|
+
balanceHistory: {
|
|
12
|
+
urlPath: "balance-history",
|
|
13
|
+
method: "GET"
|
|
14
|
+
},
|
|
15
|
+
aggregatedHistory: {
|
|
16
|
+
urlPath: "aggregated-history",
|
|
17
|
+
method: "GET"
|
|
18
|
+
},
|
|
19
|
+
delegations: {
|
|
20
|
+
urlPath: "delegations",
|
|
21
|
+
method: "GET"
|
|
22
|
+
},
|
|
23
|
+
recurrentTransfers: {
|
|
24
|
+
urlPath: "recurrent-transfers",
|
|
25
|
+
method: "GET"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
topHolders: {
|
|
30
|
+
urlPath: "top-holders",
|
|
31
|
+
method: "GET"
|
|
32
|
+
},
|
|
33
|
+
transferStatistics: {
|
|
34
|
+
urlPath: "transfer-statistics",
|
|
35
|
+
method: "GET"
|
|
36
|
+
},
|
|
37
|
+
version: {
|
|
38
|
+
urlPath: "version",
|
|
39
|
+
method: "GET"
|
|
40
|
+
},
|
|
41
|
+
lastSyncedBlock: {
|
|
42
|
+
urlPath: "last-synced-block",
|
|
43
|
+
method: "GET"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
urlPath: "balance-api"
|
|
47
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hiveio/wax-api-balance-tracker",
|
|
3
|
+
"version": "1.27.12",
|
|
4
|
+
"description": "Wax REST API definitions for balance-api",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"types": "./index.d.ts",
|
|
7
|
+
"private": false,
|
|
8
|
+
"type": "module",
|
|
9
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"default": {
|
|
13
|
+
"import": {
|
|
14
|
+
"types": "./index.d.ts",
|
|
15
|
+
"default": "./index.js"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"index.js",
|
|
23
|
+
"index.d.ts"
|
|
24
|
+
],
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"registry": "https://registry.npmjs.org/",
|
|
27
|
+
"tag": "latest"
|
|
28
|
+
}
|
|
29
|
+
}
|