@alephium/web3 0.5.0-rc.8 → 0.5.0
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/dist/alephium-web3.min.js +1 -1
- package/dist/alephium-web3.min.js.LICENSE.txt +2 -0
- package/dist/alephium-web3.min.js.map +1 -1
- package/dist/src/api/api-alephium.d.ts +56 -6
- package/dist/src/api/api-alephium.js +5 -3
- package/dist/src/api/api-explorer.d.ts +222 -52
- package/dist/src/api/api-explorer.js +17 -15
- package/dist/src/api/explorer-provider.d.ts +18 -0
- package/dist/src/api/explorer-provider.js +65 -0
- package/dist/src/api/index.d.ts +2 -42
- package/dist/src/api/index.js +6 -117
- package/dist/src/api/node-provider.d.ts +21 -0
- package/dist/src/api/node-provider.js +68 -0
- package/dist/src/api/types.d.ts +9 -1
- package/dist/src/api/types.js +17 -1
- package/dist/src/contract/contract.d.ts +6 -3
- package/dist/src/contract/contract.js +31 -28
- package/dist/src/signer/signer.d.ts +4 -8
- package/dist/src/signer/signer.js +26 -8
- package/dist/src/signer/types.d.ts +4 -16
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/index.js +1 -0
- package/dist/src/utils/number.d.ts +18 -0
- package/dist/src/utils/number.fixture.d.ts +12 -0
- package/dist/src/utils/number.fixture.js +189 -0
- package/dist/src/utils/number.js +148 -0
- package/dist/src/utils/sign.js +15 -3
- package/package.json +7 -5
- package/src/api/api-alephium.ts +177 -180
- package/src/api/api-explorer.ts +327 -126
- package/src/api/explorer-provider.ts +78 -0
- package/src/api/index.ts +2 -148
- package/src/api/node-provider.ts +84 -0
- package/src/api/types.ts +24 -1
- package/src/contract/contract.ts +31 -29
- package/src/signer/signer.ts +33 -26
- package/src/signer/types.ts +12 -9
- package/src/utils/index.ts +1 -0
- package/src/utils/number.fixture.ts +187 -0
- package/src/utils/number.ts +162 -0
- package/src/utils/sign.ts +16 -3
- package/dist/b7fcfab78f8ae7713cfe.module.wasm +0 -0
package/src/api/api-explorer.ts
CHANGED
|
@@ -9,10 +9,26 @@
|
|
|
9
9
|
* ---------------------------------------------------------------
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
export interface AcceptedTransaction {
|
|
13
|
+
/** @format 32-byte-hash */
|
|
14
|
+
hash: string
|
|
15
|
+
/** @format block-hash */
|
|
16
|
+
blockHash: string
|
|
17
|
+
/** @format int64 */
|
|
18
|
+
timestamp: number
|
|
19
|
+
inputs?: Input[]
|
|
20
|
+
outputs?: Output[]
|
|
21
|
+
/** @format int32 */
|
|
22
|
+
gasAmount: number
|
|
23
|
+
/** @format uint256 */
|
|
24
|
+
gasPrice: string
|
|
25
|
+
coinbase: boolean
|
|
26
|
+
type: string
|
|
27
|
+
}
|
|
28
|
+
|
|
12
29
|
export interface AddressBalance {
|
|
13
30
|
/** @format uint256 */
|
|
14
31
|
balance: string
|
|
15
|
-
|
|
16
32
|
/** @format uint256 */
|
|
17
33
|
lockedBalance: string
|
|
18
34
|
}
|
|
@@ -20,10 +36,8 @@ export interface AddressBalance {
|
|
|
20
36
|
export interface AddressInfo {
|
|
21
37
|
/** @format uint256 */
|
|
22
38
|
balance: string
|
|
23
|
-
|
|
24
39
|
/** @format uint256 */
|
|
25
40
|
lockedBalance: string
|
|
26
|
-
|
|
27
41
|
/** @format int32 */
|
|
28
42
|
txNumber: number
|
|
29
43
|
}
|
|
@@ -31,21 +45,17 @@ export interface AddressInfo {
|
|
|
31
45
|
export interface AssetOutput {
|
|
32
46
|
/** @format int32 */
|
|
33
47
|
hint: number
|
|
34
|
-
|
|
35
48
|
/** @format 32-byte-hash */
|
|
36
49
|
key: string
|
|
37
|
-
|
|
38
50
|
/** @format uint256 */
|
|
39
51
|
attoAlphAmount: string
|
|
52
|
+
/** @format address */
|
|
40
53
|
address: string
|
|
41
54
|
tokens?: Token[]
|
|
42
|
-
|
|
43
55
|
/** @format int64 */
|
|
44
56
|
lockTime?: number
|
|
45
|
-
|
|
46
57
|
/** @format hex-string */
|
|
47
58
|
message?: string
|
|
48
|
-
|
|
49
59
|
/** @format 32-byte-hash */
|
|
50
60
|
spent?: string
|
|
51
61
|
type: string
|
|
@@ -58,60 +68,31 @@ export interface BadRequest {
|
|
|
58
68
|
export interface BlockEntryLite {
|
|
59
69
|
/** @format block-hash */
|
|
60
70
|
hash: string
|
|
61
|
-
|
|
62
71
|
/** @format int64 */
|
|
63
72
|
timestamp: number
|
|
64
|
-
|
|
65
73
|
/** @format int32 */
|
|
66
74
|
chainFrom: number
|
|
67
|
-
|
|
68
75
|
/** @format int32 */
|
|
69
76
|
chainTo: number
|
|
70
|
-
|
|
71
77
|
/** @format int32 */
|
|
72
78
|
height: number
|
|
73
|
-
|
|
74
79
|
/** @format int32 */
|
|
75
80
|
txNumber: number
|
|
76
81
|
mainChain: boolean
|
|
77
|
-
|
|
78
82
|
/** @format bigint */
|
|
79
83
|
hashRate: string
|
|
80
84
|
}
|
|
81
85
|
|
|
82
|
-
export interface ConfirmedTransaction {
|
|
83
|
-
/** @format 32-byte-hash */
|
|
84
|
-
hash: string
|
|
85
|
-
|
|
86
|
-
/** @format block-hash */
|
|
87
|
-
blockHash: string
|
|
88
|
-
|
|
89
|
-
/** @format int64 */
|
|
90
|
-
timestamp: number
|
|
91
|
-
inputs?: Input[]
|
|
92
|
-
outputs?: Output[]
|
|
93
|
-
|
|
94
|
-
/** @format int32 */
|
|
95
|
-
gasAmount: number
|
|
96
|
-
|
|
97
|
-
/** @format uint256 */
|
|
98
|
-
gasPrice: string
|
|
99
|
-
coinbase: boolean
|
|
100
|
-
type: string
|
|
101
|
-
}
|
|
102
|
-
|
|
103
86
|
export interface ContractOutput {
|
|
104
87
|
/** @format int32 */
|
|
105
88
|
hint: number
|
|
106
|
-
|
|
107
89
|
/** @format 32-byte-hash */
|
|
108
90
|
key: string
|
|
109
|
-
|
|
110
91
|
/** @format uint256 */
|
|
111
92
|
attoAlphAmount: string
|
|
93
|
+
/** @format address */
|
|
112
94
|
address: string
|
|
113
95
|
tokens?: Token[]
|
|
114
|
-
|
|
115
96
|
/** @format 32-byte-hash */
|
|
116
97
|
spent?: string
|
|
117
98
|
type: string
|
|
@@ -120,12 +101,12 @@ export interface ContractOutput {
|
|
|
120
101
|
export interface Event {
|
|
121
102
|
/** @format block-hash */
|
|
122
103
|
blockHash: string
|
|
123
|
-
|
|
124
104
|
/** @format 32-byte-hash */
|
|
125
105
|
txHash: string
|
|
106
|
+
/** @format address */
|
|
126
107
|
contractAddress: string
|
|
108
|
+
/** @format address */
|
|
127
109
|
inputAddress?: string
|
|
128
|
-
|
|
129
110
|
/** @format int32 */
|
|
130
111
|
eventIndex: number
|
|
131
112
|
fields?: Val[]
|
|
@@ -145,14 +126,12 @@ export interface Hashrate {
|
|
|
145
126
|
|
|
146
127
|
export interface Input {
|
|
147
128
|
outputRef: OutputRef
|
|
148
|
-
|
|
149
129
|
/** @format hex-string */
|
|
150
130
|
unlockScript?: string
|
|
151
|
-
|
|
152
131
|
/** @format 32-byte-hash */
|
|
153
132
|
txHashRef?: string
|
|
133
|
+
/** @format address */
|
|
154
134
|
address?: string
|
|
155
|
-
|
|
156
135
|
/** @format uint256 */
|
|
157
136
|
attoAlphAmount?: string
|
|
158
137
|
tokens?: Token[]
|
|
@@ -178,6 +157,23 @@ export interface LogbackValue {
|
|
|
178
157
|
level: string
|
|
179
158
|
}
|
|
180
159
|
|
|
160
|
+
export interface MempoolTransaction {
|
|
161
|
+
/** @format 32-byte-hash */
|
|
162
|
+
hash: string
|
|
163
|
+
/** @format int32 */
|
|
164
|
+
chainFrom: number
|
|
165
|
+
/** @format int32 */
|
|
166
|
+
chainTo: number
|
|
167
|
+
inputs?: Input[]
|
|
168
|
+
outputs?: Output[]
|
|
169
|
+
/** @format int32 */
|
|
170
|
+
gasAmount: number
|
|
171
|
+
/** @format uint256 */
|
|
172
|
+
gasPrice: string
|
|
173
|
+
/** @format int64 */
|
|
174
|
+
lastSeen: number
|
|
175
|
+
}
|
|
176
|
+
|
|
181
177
|
export interface NotFound {
|
|
182
178
|
detail: string
|
|
183
179
|
resource: string
|
|
@@ -188,18 +184,33 @@ export type Output = AssetOutput | ContractOutput
|
|
|
188
184
|
export interface OutputRef {
|
|
189
185
|
/** @format int32 */
|
|
190
186
|
hint: number
|
|
191
|
-
|
|
192
187
|
/** @format 32-byte-hash */
|
|
193
188
|
key: string
|
|
194
189
|
}
|
|
195
190
|
|
|
196
|
-
export interface
|
|
191
|
+
export interface PendingTransaction {
|
|
192
|
+
/** @format 32-byte-hash */
|
|
193
|
+
hash: string
|
|
197
194
|
/** @format int32 */
|
|
198
195
|
chainFrom: number
|
|
199
|
-
|
|
200
196
|
/** @format int32 */
|
|
201
197
|
chainTo: number
|
|
198
|
+
inputs?: Input[]
|
|
199
|
+
outputs?: Output[]
|
|
200
|
+
/** @format int32 */
|
|
201
|
+
gasAmount: number
|
|
202
|
+
/** @format uint256 */
|
|
203
|
+
gasPrice: string
|
|
204
|
+
/** @format int64 */
|
|
205
|
+
lastSeen: number
|
|
206
|
+
type: string
|
|
207
|
+
}
|
|
202
208
|
|
|
209
|
+
export interface PerChainCount {
|
|
210
|
+
/** @format int32 */
|
|
211
|
+
chainFrom: number
|
|
212
|
+
/** @format int32 */
|
|
213
|
+
chainTo: number
|
|
203
214
|
/** @format int64 */
|
|
204
215
|
count: number
|
|
205
216
|
}
|
|
@@ -207,13 +218,10 @@ export interface PerChainCount {
|
|
|
207
218
|
export interface PerChainDuration {
|
|
208
219
|
/** @format int32 */
|
|
209
220
|
chainFrom: number
|
|
210
|
-
|
|
211
221
|
/** @format int32 */
|
|
212
222
|
chainTo: number
|
|
213
|
-
|
|
214
223
|
/** @format int64 */
|
|
215
224
|
duration: number
|
|
216
|
-
|
|
217
225
|
/** @format int64 */
|
|
218
226
|
value: number
|
|
219
227
|
}
|
|
@@ -221,13 +229,10 @@ export interface PerChainDuration {
|
|
|
221
229
|
export interface PerChainHeight {
|
|
222
230
|
/** @format int32 */
|
|
223
231
|
chainFrom: number
|
|
224
|
-
|
|
225
232
|
/** @format int32 */
|
|
226
233
|
chainTo: number
|
|
227
|
-
|
|
228
234
|
/** @format int64 */
|
|
229
235
|
height: number
|
|
230
|
-
|
|
231
236
|
/** @format int64 */
|
|
232
237
|
value: number
|
|
233
238
|
}
|
|
@@ -245,7 +250,6 @@ export interface ServiceUnavailable {
|
|
|
245
250
|
export interface TimedCount {
|
|
246
251
|
/** @format int64 */
|
|
247
252
|
timestamp: number
|
|
248
|
-
|
|
249
253
|
/** @format int64 */
|
|
250
254
|
totalCountAllChains: number
|
|
251
255
|
}
|
|
@@ -253,7 +257,6 @@ export interface TimedCount {
|
|
|
253
257
|
export interface Token {
|
|
254
258
|
/** @format 32-byte-hash */
|
|
255
259
|
id: string
|
|
256
|
-
|
|
257
260
|
/** @format uint256 */
|
|
258
261
|
amount: string
|
|
259
262
|
}
|
|
@@ -261,19 +264,14 @@ export interface Token {
|
|
|
261
264
|
export interface TokenSupply {
|
|
262
265
|
/** @format int64 */
|
|
263
266
|
timestamp: number
|
|
264
|
-
|
|
265
267
|
/** @format uint256 */
|
|
266
268
|
total: string
|
|
267
|
-
|
|
268
269
|
/** @format uint256 */
|
|
269
270
|
circulating: string
|
|
270
|
-
|
|
271
271
|
/** @format uint256 */
|
|
272
272
|
reserved: string
|
|
273
|
-
|
|
274
273
|
/** @format uint256 */
|
|
275
274
|
locked: string
|
|
276
|
-
|
|
277
275
|
/** @format uint256 */
|
|
278
276
|
maximum: string
|
|
279
277
|
}
|
|
@@ -281,52 +279,25 @@ export interface TokenSupply {
|
|
|
281
279
|
export interface Transaction {
|
|
282
280
|
/** @format 32-byte-hash */
|
|
283
281
|
hash: string
|
|
284
|
-
|
|
285
282
|
/** @format block-hash */
|
|
286
283
|
blockHash: string
|
|
287
|
-
|
|
288
284
|
/** @format int64 */
|
|
289
285
|
timestamp: number
|
|
290
286
|
inputs?: Input[]
|
|
291
287
|
outputs?: Output[]
|
|
292
|
-
|
|
293
288
|
/** @format int32 */
|
|
294
289
|
gasAmount: number
|
|
295
|
-
|
|
296
290
|
/** @format uint256 */
|
|
297
291
|
gasPrice: string
|
|
298
292
|
coinbase: boolean
|
|
299
293
|
}
|
|
300
294
|
|
|
301
|
-
export type TransactionLike =
|
|
295
|
+
export type TransactionLike = AcceptedTransaction | PendingTransaction
|
|
302
296
|
|
|
303
297
|
export interface Unauthorized {
|
|
304
298
|
detail: string
|
|
305
299
|
}
|
|
306
300
|
|
|
307
|
-
export interface UnconfirmedTransaction {
|
|
308
|
-
/** @format 32-byte-hash */
|
|
309
|
-
hash: string
|
|
310
|
-
|
|
311
|
-
/** @format int32 */
|
|
312
|
-
chainFrom: number
|
|
313
|
-
|
|
314
|
-
/** @format int32 */
|
|
315
|
-
chainTo: number
|
|
316
|
-
inputs?: Input[]
|
|
317
|
-
outputs?: Output[]
|
|
318
|
-
|
|
319
|
-
/** @format int32 */
|
|
320
|
-
gasAmount: number
|
|
321
|
-
|
|
322
|
-
/** @format uint256 */
|
|
323
|
-
gasPrice: string
|
|
324
|
-
|
|
325
|
-
/** @format int64 */
|
|
326
|
-
lastSeen: number
|
|
327
|
-
type: string
|
|
328
|
-
}
|
|
329
|
-
|
|
330
301
|
export type Val = ValAddress | ValArray | ValBool | ValByteVec | ValI256 | ValU256
|
|
331
302
|
|
|
332
303
|
export interface ValAddress {
|
|
@@ -407,7 +378,8 @@ type CancelToken = Symbol | string | number
|
|
|
407
378
|
export enum ContentType {
|
|
408
379
|
Json = 'application/json',
|
|
409
380
|
FormData = 'multipart/form-data',
|
|
410
|
-
UrlEncoded = 'application/x-www-form-urlencoded'
|
|
381
|
+
UrlEncoded = 'application/x-www-form-urlencoded',
|
|
382
|
+
Text = 'text/plain'
|
|
411
383
|
}
|
|
412
384
|
|
|
413
385
|
export class HttpClient<SecurityDataType = unknown> {
|
|
@@ -432,16 +404,16 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
432
404
|
this.securityData = data
|
|
433
405
|
}
|
|
434
406
|
|
|
435
|
-
|
|
407
|
+
protected encodeQueryParam(key: string, value: any) {
|
|
436
408
|
const encodedKey = encodeURIComponent(key)
|
|
437
409
|
return `${encodedKey}=${encodeURIComponent(typeof value === 'number' ? value : `${value}`)}`
|
|
438
410
|
}
|
|
439
411
|
|
|
440
|
-
|
|
412
|
+
protected addQueryParam(query: QueryParamsType, key: string) {
|
|
441
413
|
return this.encodeQueryParam(key, query[key])
|
|
442
414
|
}
|
|
443
415
|
|
|
444
|
-
|
|
416
|
+
protected addArrayQueryParam(query: QueryParamsType, key: string) {
|
|
445
417
|
const value = query[key]
|
|
446
418
|
return value.map((v: any) => this.encodeQueryParam(key, v)).join('&')
|
|
447
419
|
}
|
|
@@ -462,6 +434,7 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
462
434
|
private contentFormatters: Record<ContentType, (input: any) => any> = {
|
|
463
435
|
[ContentType.Json]: (input: any) =>
|
|
464
436
|
input !== null && (typeof input === 'object' || typeof input === 'string') ? JSON.stringify(input) : input,
|
|
437
|
+
[ContentType.Text]: (input: any) => (input !== null && typeof input !== 'string' ? JSON.stringify(input) : input),
|
|
465
438
|
[ContentType.FormData]: (input: any) =>
|
|
466
439
|
Object.keys(input || {}).reduce((formData, key) => {
|
|
467
440
|
const property = input[key]
|
|
@@ -478,7 +451,7 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
478
451
|
[ContentType.UrlEncoded]: (input: any) => this.toQueryString(input)
|
|
479
452
|
}
|
|
480
453
|
|
|
481
|
-
|
|
454
|
+
protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams {
|
|
482
455
|
return {
|
|
483
456
|
...this.baseApiParams,
|
|
484
457
|
...params1,
|
|
@@ -491,7 +464,7 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
491
464
|
}
|
|
492
465
|
}
|
|
493
466
|
|
|
494
|
-
|
|
467
|
+
protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => {
|
|
495
468
|
if (this.abortControllers.has(cancelToken)) {
|
|
496
469
|
const abortController = this.abortControllers.get(cancelToken)
|
|
497
470
|
if (abortController) {
|
|
@@ -538,10 +511,10 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
538
511
|
return this.customFetch(`${baseUrl || this.baseUrl || ''}${path}${queryString ? `?${queryString}` : ''}`, {
|
|
539
512
|
...requestParams,
|
|
540
513
|
headers: {
|
|
541
|
-
...(
|
|
542
|
-
...(
|
|
514
|
+
...(requestParams.headers || {}),
|
|
515
|
+
...(type && type !== ContentType.FormData ? { 'Content-Type': type } : {})
|
|
543
516
|
},
|
|
544
|
-
signal: cancelToken ? this.createAbortSignal(cancelToken) :
|
|
517
|
+
signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal,
|
|
545
518
|
body: typeof body === 'undefined' || body === null ? null : payloadFormatter(body)
|
|
546
519
|
}).then(async (response) => {
|
|
547
520
|
const r = response as HttpResponse<T, E>
|
|
@@ -586,7 +559,23 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
586
559
|
* @name GetBlocks
|
|
587
560
|
* @request GET:/blocks
|
|
588
561
|
*/
|
|
589
|
-
getBlocks: (
|
|
562
|
+
getBlocks: (
|
|
563
|
+
query?: {
|
|
564
|
+
/**
|
|
565
|
+
* Page number
|
|
566
|
+
* @format int32
|
|
567
|
+
*/
|
|
568
|
+
page?: number
|
|
569
|
+
/**
|
|
570
|
+
* Number of items per page
|
|
571
|
+
* @format int32
|
|
572
|
+
*/
|
|
573
|
+
limit?: number
|
|
574
|
+
/** Reverse pagination */
|
|
575
|
+
reverse?: boolean
|
|
576
|
+
},
|
|
577
|
+
params: RequestParams = {}
|
|
578
|
+
) =>
|
|
590
579
|
this.request<ListBlocks, BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|
|
591
580
|
path: `/blocks`,
|
|
592
581
|
method: 'GET',
|
|
@@ -619,7 +608,20 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
619
608
|
*/
|
|
620
609
|
getBlocksBlockHashTransactions: (
|
|
621
610
|
blockHash: string,
|
|
622
|
-
query?: {
|
|
611
|
+
query?: {
|
|
612
|
+
/**
|
|
613
|
+
* Page number
|
|
614
|
+
* @format int32
|
|
615
|
+
*/
|
|
616
|
+
page?: number
|
|
617
|
+
/**
|
|
618
|
+
* Number of items per page
|
|
619
|
+
* @format int32
|
|
620
|
+
*/
|
|
621
|
+
limit?: number
|
|
622
|
+
/** Reverse pagination */
|
|
623
|
+
reverse?: boolean
|
|
624
|
+
},
|
|
623
625
|
params: RequestParams = {}
|
|
624
626
|
) =>
|
|
625
627
|
this.request<Transaction[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|
|
@@ -671,7 +673,20 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
671
673
|
*/
|
|
672
674
|
getAddressesAddressTransactions: (
|
|
673
675
|
address: string,
|
|
674
|
-
query?: {
|
|
676
|
+
query?: {
|
|
677
|
+
/**
|
|
678
|
+
* Page number
|
|
679
|
+
* @format int32
|
|
680
|
+
*/
|
|
681
|
+
page?: number
|
|
682
|
+
/**
|
|
683
|
+
* Number of items per page
|
|
684
|
+
* @format int32
|
|
685
|
+
*/
|
|
686
|
+
limit?: number
|
|
687
|
+
/** Reverse pagination */
|
|
688
|
+
reverse?: boolean
|
|
689
|
+
},
|
|
675
690
|
params: RequestParams = {}
|
|
676
691
|
) =>
|
|
677
692
|
this.request<Transaction[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|
|
@@ -690,7 +705,20 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
690
705
|
* @request POST:/addresses/transactions
|
|
691
706
|
*/
|
|
692
707
|
postAddressesTransactions: (
|
|
693
|
-
query?: {
|
|
708
|
+
query?: {
|
|
709
|
+
/**
|
|
710
|
+
* Page number
|
|
711
|
+
* @format int32
|
|
712
|
+
*/
|
|
713
|
+
page?: number
|
|
714
|
+
/**
|
|
715
|
+
* Number of items per page
|
|
716
|
+
* @format int32
|
|
717
|
+
*/
|
|
718
|
+
limit?: number
|
|
719
|
+
/** Reverse pagination */
|
|
720
|
+
reverse?: boolean
|
|
721
|
+
},
|
|
694
722
|
data?: string[],
|
|
695
723
|
params: RequestParams = {}
|
|
696
724
|
) =>
|
|
@@ -713,7 +741,30 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
713
741
|
*/
|
|
714
742
|
getAddressesAddressTimerangedTransactions: (
|
|
715
743
|
address: string,
|
|
716
|
-
query: {
|
|
744
|
+
query: {
|
|
745
|
+
/**
|
|
746
|
+
* @format int64
|
|
747
|
+
* @min 0
|
|
748
|
+
*/
|
|
749
|
+
fromTs: number
|
|
750
|
+
/**
|
|
751
|
+
* @format int64
|
|
752
|
+
* @min 0
|
|
753
|
+
*/
|
|
754
|
+
toTs: number
|
|
755
|
+
/**
|
|
756
|
+
* Page number
|
|
757
|
+
* @format int32
|
|
758
|
+
*/
|
|
759
|
+
page?: number
|
|
760
|
+
/**
|
|
761
|
+
* Number of items per page
|
|
762
|
+
* @format int32
|
|
763
|
+
*/
|
|
764
|
+
limit?: number
|
|
765
|
+
/** Reverse pagination */
|
|
766
|
+
reverse?: boolean
|
|
767
|
+
},
|
|
717
768
|
params: RequestParams = {}
|
|
718
769
|
) =>
|
|
719
770
|
this.request<Transaction[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|
|
@@ -740,15 +791,18 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
740
791
|
}).then(convertHttpResponse),
|
|
741
792
|
|
|
742
793
|
/**
|
|
743
|
-
* @description List
|
|
794
|
+
* @description List mempool transactions of a given address
|
|
744
795
|
*
|
|
745
796
|
* @tags Addresses
|
|
746
|
-
* @name
|
|
747
|
-
* @request GET:/addresses/{address}/
|
|
797
|
+
* @name GetAddressesAddressMempoolTransactions
|
|
798
|
+
* @request GET:/addresses/{address}/mempool/transactions
|
|
748
799
|
*/
|
|
749
|
-
|
|
750
|
-
this.request<
|
|
751
|
-
|
|
800
|
+
getAddressesAddressMempoolTransactions: (address: string, params: RequestParams = {}) =>
|
|
801
|
+
this.request<
|
|
802
|
+
MempoolTransaction[],
|
|
803
|
+
BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable
|
|
804
|
+
>({
|
|
805
|
+
path: `/addresses/${address}/mempool/transactions`,
|
|
752
806
|
method: 'GET',
|
|
753
807
|
format: 'json',
|
|
754
808
|
...params
|
|
@@ -794,7 +848,20 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
794
848
|
getAddressesAddressTokensTokenIdTransactions: (
|
|
795
849
|
address: string,
|
|
796
850
|
tokenId: string,
|
|
797
|
-
query?: {
|
|
851
|
+
query?: {
|
|
852
|
+
/**
|
|
853
|
+
* Page number
|
|
854
|
+
* @format int32
|
|
855
|
+
*/
|
|
856
|
+
page?: number
|
|
857
|
+
/**
|
|
858
|
+
* Number of items per page
|
|
859
|
+
* @format int32
|
|
860
|
+
*/
|
|
861
|
+
limit?: number
|
|
862
|
+
/** Reverse pagination */
|
|
863
|
+
reverse?: boolean
|
|
864
|
+
},
|
|
798
865
|
params: RequestParams = {}
|
|
799
866
|
) =>
|
|
800
867
|
this.request<Transaction[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|
|
@@ -846,7 +913,18 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
846
913
|
*/
|
|
847
914
|
getAddressesAddressExportTransactionsCsv: (
|
|
848
915
|
address: string,
|
|
849
|
-
query: {
|
|
916
|
+
query: {
|
|
917
|
+
/**
|
|
918
|
+
* @format int64
|
|
919
|
+
* @min 0
|
|
920
|
+
*/
|
|
921
|
+
fromTs: number
|
|
922
|
+
/**
|
|
923
|
+
* @format int64
|
|
924
|
+
* @min 0
|
|
925
|
+
*/
|
|
926
|
+
toTs: number
|
|
927
|
+
},
|
|
850
928
|
params: RequestParams = {}
|
|
851
929
|
) =>
|
|
852
930
|
this.request<string, BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|
|
@@ -894,7 +972,23 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
894
972
|
* @name GetInfosSupply
|
|
895
973
|
* @request GET:/infos/supply
|
|
896
974
|
*/
|
|
897
|
-
getInfosSupply: (
|
|
975
|
+
getInfosSupply: (
|
|
976
|
+
query?: {
|
|
977
|
+
/**
|
|
978
|
+
* Page number
|
|
979
|
+
* @format int32
|
|
980
|
+
*/
|
|
981
|
+
page?: number
|
|
982
|
+
/**
|
|
983
|
+
* Number of items per page
|
|
984
|
+
* @format int32
|
|
985
|
+
*/
|
|
986
|
+
limit?: number
|
|
987
|
+
/** Reverse pagination */
|
|
988
|
+
reverse?: boolean
|
|
989
|
+
},
|
|
990
|
+
params: RequestParams = {}
|
|
991
|
+
) =>
|
|
898
992
|
this.request<TokenSupply[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|
|
899
993
|
path: `/infos/supply`,
|
|
900
994
|
method: 'GET',
|
|
@@ -990,20 +1084,36 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
990
1084
|
}
|
|
991
1085
|
).then(convertHttpResponse)
|
|
992
1086
|
}
|
|
993
|
-
|
|
1087
|
+
mempool = {
|
|
994
1088
|
/**
|
|
995
|
-
* @description list
|
|
1089
|
+
* @description list mempool transactions
|
|
996
1090
|
*
|
|
997
|
-
* @tags
|
|
998
|
-
* @name
|
|
999
|
-
* @request GET:/
|
|
1091
|
+
* @tags Mempool
|
|
1092
|
+
* @name GetMempoolTransactions
|
|
1093
|
+
* @request GET:/mempool/transactions
|
|
1000
1094
|
*/
|
|
1001
|
-
|
|
1002
|
-
query?: {
|
|
1095
|
+
getMempoolTransactions: (
|
|
1096
|
+
query?: {
|
|
1097
|
+
/**
|
|
1098
|
+
* Page number
|
|
1099
|
+
* @format int32
|
|
1100
|
+
*/
|
|
1101
|
+
page?: number
|
|
1102
|
+
/**
|
|
1103
|
+
* Number of items per page
|
|
1104
|
+
* @format int32
|
|
1105
|
+
*/
|
|
1106
|
+
limit?: number
|
|
1107
|
+
/** Reverse pagination */
|
|
1108
|
+
reverse?: boolean
|
|
1109
|
+
},
|
|
1003
1110
|
params: RequestParams = {}
|
|
1004
1111
|
) =>
|
|
1005
|
-
this.request<
|
|
1006
|
-
|
|
1112
|
+
this.request<
|
|
1113
|
+
MempoolTransaction[],
|
|
1114
|
+
BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable
|
|
1115
|
+
>({
|
|
1116
|
+
path: `/mempool/transactions`,
|
|
1007
1117
|
method: 'GET',
|
|
1008
1118
|
query: query,
|
|
1009
1119
|
format: 'json',
|
|
@@ -1018,7 +1128,23 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
1018
1128
|
* @name GetTokens
|
|
1019
1129
|
* @request GET:/tokens
|
|
1020
1130
|
*/
|
|
1021
|
-
getTokens: (
|
|
1131
|
+
getTokens: (
|
|
1132
|
+
query?: {
|
|
1133
|
+
/**
|
|
1134
|
+
* Page number
|
|
1135
|
+
* @format int32
|
|
1136
|
+
*/
|
|
1137
|
+
page?: number
|
|
1138
|
+
/**
|
|
1139
|
+
* Number of items per page
|
|
1140
|
+
* @format int32
|
|
1141
|
+
*/
|
|
1142
|
+
limit?: number
|
|
1143
|
+
/** Reverse pagination */
|
|
1144
|
+
reverse?: boolean
|
|
1145
|
+
},
|
|
1146
|
+
params: RequestParams = {}
|
|
1147
|
+
) =>
|
|
1022
1148
|
this.request<string[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|
|
1023
1149
|
path: `/tokens`,
|
|
1024
1150
|
method: 'GET',
|
|
@@ -1036,7 +1162,20 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
1036
1162
|
*/
|
|
1037
1163
|
getTokensTokenIdTransactions: (
|
|
1038
1164
|
tokenId: string,
|
|
1039
|
-
query?: {
|
|
1165
|
+
query?: {
|
|
1166
|
+
/**
|
|
1167
|
+
* Page number
|
|
1168
|
+
* @format int32
|
|
1169
|
+
*/
|
|
1170
|
+
page?: number
|
|
1171
|
+
/**
|
|
1172
|
+
* Number of items per page
|
|
1173
|
+
* @format int32
|
|
1174
|
+
*/
|
|
1175
|
+
limit?: number
|
|
1176
|
+
/** Reverse pagination */
|
|
1177
|
+
reverse?: boolean
|
|
1178
|
+
},
|
|
1040
1179
|
params: RequestParams = {}
|
|
1041
1180
|
) =>
|
|
1042
1181
|
this.request<Transaction[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|
|
@@ -1057,7 +1196,19 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
1057
1196
|
* @request GET:/charts/hashrates
|
|
1058
1197
|
*/
|
|
1059
1198
|
getChartsHashrates: (
|
|
1060
|
-
query: {
|
|
1199
|
+
query: {
|
|
1200
|
+
/**
|
|
1201
|
+
* @format int64
|
|
1202
|
+
* @min 0
|
|
1203
|
+
*/
|
|
1204
|
+
fromTs: number
|
|
1205
|
+
/**
|
|
1206
|
+
* @format int64
|
|
1207
|
+
* @min 0
|
|
1208
|
+
*/
|
|
1209
|
+
toTs: number
|
|
1210
|
+
'interval-type': IntervalType
|
|
1211
|
+
},
|
|
1061
1212
|
params: RequestParams = {}
|
|
1062
1213
|
) =>
|
|
1063
1214
|
this.request<Hashrate[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|
|
@@ -1077,7 +1228,19 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
1077
1228
|
* @request GET:/charts/transactions-count
|
|
1078
1229
|
*/
|
|
1079
1230
|
getChartsTransactionsCount: (
|
|
1080
|
-
query: {
|
|
1231
|
+
query: {
|
|
1232
|
+
/**
|
|
1233
|
+
* @format int64
|
|
1234
|
+
* @min 0
|
|
1235
|
+
*/
|
|
1236
|
+
fromTs: number
|
|
1237
|
+
/**
|
|
1238
|
+
* @format int64
|
|
1239
|
+
* @min 0
|
|
1240
|
+
*/
|
|
1241
|
+
toTs: number
|
|
1242
|
+
'interval-type': IntervalType
|
|
1243
|
+
},
|
|
1081
1244
|
params: RequestParams = {}
|
|
1082
1245
|
) =>
|
|
1083
1246
|
this.request<TimedCount[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|
|
@@ -1097,7 +1260,19 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
1097
1260
|
* @request GET:/charts/transactions-count-per-chain
|
|
1098
1261
|
*/
|
|
1099
1262
|
getChartsTransactionsCountPerChain: (
|
|
1100
|
-
query: {
|
|
1263
|
+
query: {
|
|
1264
|
+
/**
|
|
1265
|
+
* @format int64
|
|
1266
|
+
* @min 0
|
|
1267
|
+
*/
|
|
1268
|
+
fromTs: number
|
|
1269
|
+
/**
|
|
1270
|
+
* @format int64
|
|
1271
|
+
* @min 0
|
|
1272
|
+
*/
|
|
1273
|
+
toTs: number
|
|
1274
|
+
'interval-type': IntervalType
|
|
1275
|
+
},
|
|
1101
1276
|
params: RequestParams = {}
|
|
1102
1277
|
) =>
|
|
1103
1278
|
this.request<
|
|
@@ -1136,7 +1311,20 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
1136
1311
|
*/
|
|
1137
1312
|
getContractEventsContractAddressContractAddress: (
|
|
1138
1313
|
contractAddress: string,
|
|
1139
|
-
query?: {
|
|
1314
|
+
query?: {
|
|
1315
|
+
/**
|
|
1316
|
+
* Page number
|
|
1317
|
+
* @format int32
|
|
1318
|
+
*/
|
|
1319
|
+
page?: number
|
|
1320
|
+
/**
|
|
1321
|
+
* Number of items per page
|
|
1322
|
+
* @format int32
|
|
1323
|
+
*/
|
|
1324
|
+
limit?: number
|
|
1325
|
+
/** Reverse pagination */
|
|
1326
|
+
reverse?: boolean
|
|
1327
|
+
},
|
|
1140
1328
|
params: RequestParams = {}
|
|
1141
1329
|
) =>
|
|
1142
1330
|
this.request<Event[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|
|
@@ -1157,7 +1345,20 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
1157
1345
|
getContractEventsContractAddressContractAddressInputAddressInputAddress: (
|
|
1158
1346
|
contractAddress: string,
|
|
1159
1347
|
inputAddress: string,
|
|
1160
|
-
query?: {
|
|
1348
|
+
query?: {
|
|
1349
|
+
/**
|
|
1350
|
+
* Page number
|
|
1351
|
+
* @format int32
|
|
1352
|
+
*/
|
|
1353
|
+
page?: number
|
|
1354
|
+
/**
|
|
1355
|
+
* Number of items per page
|
|
1356
|
+
* @format int32
|
|
1357
|
+
*/
|
|
1358
|
+
limit?: number
|
|
1359
|
+
/** Reverse pagination */
|
|
1360
|
+
reverse?: boolean
|
|
1361
|
+
},
|
|
1161
1362
|
params: RequestParams = {}
|
|
1162
1363
|
) =>
|
|
1163
1364
|
this.request<Event[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|