@stacks/blockchain-api-client 7.4.0-nakamoto.3 → 7.4.0-nakamoto.4
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/lib/generated/apis/BlocksApi.d.ts +46 -13
- package/lib/generated/apis/BlocksApi.js +41 -6
- package/lib/generated/apis/BlocksApi.js.map +1 -1
- package/lib/generated/models/NakamotoBlock.d.ts +123 -0
- package/lib/generated/models/NakamotoBlock.js +74 -0
- package/lib/generated/models/NakamotoBlock.js.map +1 -0
- package/lib/generated/models/NakamotoBlockListResponse.d.ts +46 -0
- package/lib/generated/models/NakamotoBlockListResponse.js +49 -0
- package/lib/generated/models/NakamotoBlockListResponse.js.map +1 -0
- package/lib/generated/models/index.d.ts +2 -0
- package/lib/generated/models/index.js +2 -0
- package/lib/generated/models/index.js.map +1 -1
- package/lib/index.umd.js +182 -10
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/generated/.openapi-generator/FILES +2 -0
- package/src/generated/apis/BlocksApi.ts +85 -12
- package/src/generated/models/NakamotoBlock.ts +184 -0
- package/src/generated/models/NakamotoBlockListResponse.ts +87 -0
- package/src/generated/models/index.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacks/blockchain-api-client",
|
|
3
|
-
"version": "7.4.0-nakamoto.
|
|
3
|
+
"version": "7.4.0-nakamoto.4",
|
|
4
4
|
"access": "public",
|
|
5
5
|
"description": "Client for the Stacks Blockchain API",
|
|
6
6
|
"homepage": "https://github.com/hirosystems/stacks-blockchain-api/tree/master/client#readme",
|
|
@@ -74,6 +74,8 @@ models/MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransfer.ts
|
|
|
74
74
|
models/MempoolTransactionStatsResponseTxTypeCounts.ts
|
|
75
75
|
models/Microblock.ts
|
|
76
76
|
models/MicroblockListResponse.ts
|
|
77
|
+
models/NakamotoBlock.ts
|
|
78
|
+
models/NakamotoBlockListResponse.ts
|
|
77
79
|
models/NetworkBlockTimeResponse.ts
|
|
78
80
|
models/NetworkBlockTimesResponse.ts
|
|
79
81
|
models/NetworkIdentifier.ts
|
|
@@ -24,6 +24,9 @@ import {
|
|
|
24
24
|
BurnBlockListResponse,
|
|
25
25
|
BurnBlockListResponseFromJSON,
|
|
26
26
|
BurnBlockListResponseToJSON,
|
|
27
|
+
NakamotoBlockListResponse,
|
|
28
|
+
NakamotoBlockListResponseFromJSON,
|
|
29
|
+
NakamotoBlockListResponseToJSON,
|
|
27
30
|
} from '../models';
|
|
28
31
|
|
|
29
32
|
export interface GetBlockByBurnBlockHashRequest {
|
|
@@ -47,6 +50,13 @@ export interface GetBlockListRequest {
|
|
|
47
50
|
offset?: number;
|
|
48
51
|
}
|
|
49
52
|
|
|
53
|
+
export interface GetBlocksRequest {
|
|
54
|
+
limit?: number;
|
|
55
|
+
offset?: number;
|
|
56
|
+
burnBlockHash?: string;
|
|
57
|
+
burnBlockHeight?: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
50
60
|
export interface GetBurnBlockListRequest {
|
|
51
61
|
limit?: number;
|
|
52
62
|
offset?: number;
|
|
@@ -62,7 +72,7 @@ export interface GetBurnBlockListRequest {
|
|
|
62
72
|
*/
|
|
63
73
|
export interface BlocksApiInterface {
|
|
64
74
|
/**
|
|
65
|
-
* Retrieves block details of a specific block for a given burnchain block hash
|
|
75
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get blocks](#operation/get_blocks). Retrieves block details of a specific block for a given burnchain block hash
|
|
66
76
|
* @summary Get block by burnchain block hash
|
|
67
77
|
* @param {string} burnBlockHash Hash of the burnchain block
|
|
68
78
|
* @param {*} [options] Override http request option.
|
|
@@ -72,13 +82,13 @@ export interface BlocksApiInterface {
|
|
|
72
82
|
getBlockByBurnBlockHashRaw(requestParameters: GetBlockByBurnBlockHashRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Block>>;
|
|
73
83
|
|
|
74
84
|
/**
|
|
75
|
-
* Retrieves block details of a specific block for a given burnchain block hash
|
|
85
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get blocks](#operation/get_blocks). Retrieves block details of a specific block for a given burnchain block hash
|
|
76
86
|
* Get block by burnchain block hash
|
|
77
87
|
*/
|
|
78
88
|
getBlockByBurnBlockHash(requestParameters: GetBlockByBurnBlockHashRequest, initOverrides?: RequestInit): Promise<Block>;
|
|
79
89
|
|
|
80
90
|
/**
|
|
81
|
-
* Retrieves block details of a specific block for a given burn chain height
|
|
91
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get blocks](#operation/get_blocks). Retrieves block details of a specific block for a given burn chain height
|
|
82
92
|
* @summary Get block by burnchain height
|
|
83
93
|
* @param {number} burnBlockHeight Height of the burn chain block
|
|
84
94
|
* @param {*} [options] Override http request option.
|
|
@@ -88,7 +98,7 @@ export interface BlocksApiInterface {
|
|
|
88
98
|
getBlockByBurnBlockHeightRaw(requestParameters: GetBlockByBurnBlockHeightRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Block>>;
|
|
89
99
|
|
|
90
100
|
/**
|
|
91
|
-
* Retrieves block details of a specific block for a given burn chain height
|
|
101
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get blocks](#operation/get_blocks). Retrieves block details of a specific block for a given burn chain height
|
|
92
102
|
* Get block by burnchain height
|
|
93
103
|
*/
|
|
94
104
|
getBlockByBurnBlockHeight(requestParameters: GetBlockByBurnBlockHeightRequest, initOverrides?: RequestInit): Promise<Block>;
|
|
@@ -126,7 +136,7 @@ export interface BlocksApiInterface {
|
|
|
126
136
|
getBlockByHeight(requestParameters: GetBlockByHeightRequest, initOverrides?: RequestInit): Promise<Block>;
|
|
127
137
|
|
|
128
138
|
/**
|
|
129
|
-
* Retrieves a list of recently mined blocks If you need to actively monitor new blocks, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
|
|
139
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get blocks](#operation/get_blocks). Retrieves a list of recently mined blocks If you need to actively monitor new blocks, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
|
|
130
140
|
* @summary Get recent blocks
|
|
131
141
|
* @param {number} [limit] max number of blocks to fetch
|
|
132
142
|
* @param {number} [offset] index of first block to fetch
|
|
@@ -137,11 +147,30 @@ export interface BlocksApiInterface {
|
|
|
137
147
|
getBlockListRaw(requestParameters: GetBlockListRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BlockListResponse>>;
|
|
138
148
|
|
|
139
149
|
/**
|
|
140
|
-
* Retrieves a list of recently mined blocks If you need to actively monitor new blocks, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
|
|
150
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get blocks](#operation/get_blocks). Retrieves a list of recently mined blocks If you need to actively monitor new blocks, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
|
|
141
151
|
* Get recent blocks
|
|
142
152
|
*/
|
|
143
153
|
getBlockList(requestParameters: GetBlockListRequest, initOverrides?: RequestInit): Promise<BlockListResponse>;
|
|
144
154
|
|
|
155
|
+
/**
|
|
156
|
+
* Retrieves a list of recently mined blocks
|
|
157
|
+
* @summary Get blocks
|
|
158
|
+
* @param {number} [limit] max number of blocks to fetch
|
|
159
|
+
* @param {number} [offset] index of first burn block to fetch
|
|
160
|
+
* @param {string} [burnBlockHash] filter blocks by burn block hash
|
|
161
|
+
* @param {number} [burnBlockHeight] filter blocks by burn block height
|
|
162
|
+
* @param {*} [options] Override http request option.
|
|
163
|
+
* @throws {RequiredError}
|
|
164
|
+
* @memberof BlocksApiInterface
|
|
165
|
+
*/
|
|
166
|
+
getBlocksRaw(requestParameters: GetBlocksRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NakamotoBlockListResponse>>;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Retrieves a list of recently mined blocks
|
|
170
|
+
* Get blocks
|
|
171
|
+
*/
|
|
172
|
+
getBlocks(requestParameters: GetBlocksRequest, initOverrides?: RequestInit): Promise<NakamotoBlockListResponse>;
|
|
173
|
+
|
|
145
174
|
/**
|
|
146
175
|
* Retrieves a list of recent burn blocks
|
|
147
176
|
* @summary Get recent burn blocks
|
|
@@ -169,7 +198,7 @@ export interface BlocksApiInterface {
|
|
|
169
198
|
export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
170
199
|
|
|
171
200
|
/**
|
|
172
|
-
* Retrieves block details of a specific block for a given burnchain block hash
|
|
201
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get blocks](#operation/get_blocks). Retrieves block details of a specific block for a given burnchain block hash
|
|
173
202
|
* Get block by burnchain block hash
|
|
174
203
|
*/
|
|
175
204
|
async getBlockByBurnBlockHashRaw(requestParameters: GetBlockByBurnBlockHashRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Block>> {
|
|
@@ -192,7 +221,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
192
221
|
}
|
|
193
222
|
|
|
194
223
|
/**
|
|
195
|
-
* Retrieves block details of a specific block for a given burnchain block hash
|
|
224
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get blocks](#operation/get_blocks). Retrieves block details of a specific block for a given burnchain block hash
|
|
196
225
|
* Get block by burnchain block hash
|
|
197
226
|
*/
|
|
198
227
|
async getBlockByBurnBlockHash(requestParameters: GetBlockByBurnBlockHashRequest, initOverrides?: RequestInit): Promise<Block> {
|
|
@@ -201,7 +230,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
201
230
|
}
|
|
202
231
|
|
|
203
232
|
/**
|
|
204
|
-
* Retrieves block details of a specific block for a given burn chain height
|
|
233
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get blocks](#operation/get_blocks). Retrieves block details of a specific block for a given burn chain height
|
|
205
234
|
* Get block by burnchain height
|
|
206
235
|
*/
|
|
207
236
|
async getBlockByBurnBlockHeightRaw(requestParameters: GetBlockByBurnBlockHeightRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Block>> {
|
|
@@ -224,7 +253,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
224
253
|
}
|
|
225
254
|
|
|
226
255
|
/**
|
|
227
|
-
* Retrieves block details of a specific block for a given burn chain height
|
|
256
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get blocks](#operation/get_blocks). Retrieves block details of a specific block for a given burn chain height
|
|
228
257
|
* Get block by burnchain height
|
|
229
258
|
*/
|
|
230
259
|
async getBlockByBurnBlockHeight(requestParameters: GetBlockByBurnBlockHeightRequest, initOverrides?: RequestInit): Promise<Block> {
|
|
@@ -297,7 +326,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
297
326
|
}
|
|
298
327
|
|
|
299
328
|
/**
|
|
300
|
-
* Retrieves a list of recently mined blocks If you need to actively monitor new blocks, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
|
|
329
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get blocks](#operation/get_blocks). Retrieves a list of recently mined blocks If you need to actively monitor new blocks, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
|
|
301
330
|
* Get recent blocks
|
|
302
331
|
*/
|
|
303
332
|
async getBlockListRaw(requestParameters: GetBlockListRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BlockListResponse>> {
|
|
@@ -324,7 +353,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
324
353
|
}
|
|
325
354
|
|
|
326
355
|
/**
|
|
327
|
-
* Retrieves a list of recently mined blocks If you need to actively monitor new blocks, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
|
|
356
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get blocks](#operation/get_blocks). Retrieves a list of recently mined blocks If you need to actively monitor new blocks, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
|
|
328
357
|
* Get recent blocks
|
|
329
358
|
*/
|
|
330
359
|
async getBlockList(requestParameters: GetBlockListRequest, initOverrides?: RequestInit): Promise<BlockListResponse> {
|
|
@@ -332,6 +361,50 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
332
361
|
return await response.value();
|
|
333
362
|
}
|
|
334
363
|
|
|
364
|
+
/**
|
|
365
|
+
* Retrieves a list of recently mined blocks
|
|
366
|
+
* Get blocks
|
|
367
|
+
*/
|
|
368
|
+
async getBlocksRaw(requestParameters: GetBlocksRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NakamotoBlockListResponse>> {
|
|
369
|
+
const queryParameters: any = {};
|
|
370
|
+
|
|
371
|
+
if (requestParameters.limit !== undefined) {
|
|
372
|
+
queryParameters['limit'] = requestParameters.limit;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
if (requestParameters.offset !== undefined) {
|
|
376
|
+
queryParameters['offset'] = requestParameters.offset;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
if (requestParameters.burnBlockHash !== undefined) {
|
|
380
|
+
queryParameters['burn_block_hash'] = requestParameters.burnBlockHash;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
if (requestParameters.burnBlockHeight !== undefined) {
|
|
384
|
+
queryParameters['burn_block_height'] = requestParameters.burnBlockHeight;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
388
|
+
|
|
389
|
+
const response = await this.request({
|
|
390
|
+
path: `/extended/v2/blocks`,
|
|
391
|
+
method: 'GET',
|
|
392
|
+
headers: headerParameters,
|
|
393
|
+
query: queryParameters,
|
|
394
|
+
}, initOverrides);
|
|
395
|
+
|
|
396
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => NakamotoBlockListResponseFromJSON(jsonValue));
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Retrieves a list of recently mined blocks
|
|
401
|
+
* Get blocks
|
|
402
|
+
*/
|
|
403
|
+
async getBlocks(requestParameters: GetBlocksRequest, initOverrides?: RequestInit): Promise<NakamotoBlockListResponse> {
|
|
404
|
+
const response = await this.getBlocksRaw(requestParameters, initOverrides);
|
|
405
|
+
return await response.value();
|
|
406
|
+
}
|
|
407
|
+
|
|
335
408
|
/**
|
|
336
409
|
* Retrieves a list of recent burn blocks
|
|
337
410
|
* Get recent burn blocks
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Stacks Blockchain API
|
|
5
|
+
* Welcome to the API reference overview for the <a href=\"https://docs.hiro.so/get-started/stacks-blockchain-api\">Stacks Blockchain API</a>. <a href=\"https://hirosystems.github.io/stacks-blockchain-api/collection.json\" download=\"stacks-api-collection.json\">Download Postman collection</a>
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: STACKS_API_VERSION
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { exists, mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
* A block
|
|
18
|
+
* @export
|
|
19
|
+
* @interface NakamotoBlock
|
|
20
|
+
*/
|
|
21
|
+
export interface NakamotoBlock {
|
|
22
|
+
/**
|
|
23
|
+
* Set to `true` if block corresponds to the canonical chain tip
|
|
24
|
+
* @type {boolean}
|
|
25
|
+
* @memberof NakamotoBlock
|
|
26
|
+
*/
|
|
27
|
+
canonical: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Height of the block
|
|
30
|
+
* @type {number}
|
|
31
|
+
* @memberof NakamotoBlock
|
|
32
|
+
*/
|
|
33
|
+
height: number;
|
|
34
|
+
/**
|
|
35
|
+
* Hash representing the block
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof NakamotoBlock
|
|
38
|
+
*/
|
|
39
|
+
hash: string;
|
|
40
|
+
/**
|
|
41
|
+
* The only hash that can uniquely identify an anchored block or an unconfirmed state trie
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof NakamotoBlock
|
|
44
|
+
*/
|
|
45
|
+
index_block_hash: string;
|
|
46
|
+
/**
|
|
47
|
+
* Hash of the parent block
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof NakamotoBlock
|
|
50
|
+
*/
|
|
51
|
+
parent_block_hash: string;
|
|
52
|
+
/**
|
|
53
|
+
* Index block hash of the parent block
|
|
54
|
+
* @type {string}
|
|
55
|
+
* @memberof NakamotoBlock
|
|
56
|
+
*/
|
|
57
|
+
parent_index_block_hash: string;
|
|
58
|
+
/**
|
|
59
|
+
* Unix timestamp (in seconds) indicating when this block was mined.
|
|
60
|
+
* @type {number}
|
|
61
|
+
* @memberof NakamotoBlock
|
|
62
|
+
*/
|
|
63
|
+
burn_block_time: number;
|
|
64
|
+
/**
|
|
65
|
+
* An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) indicating when this block was mined.
|
|
66
|
+
* @type {string}
|
|
67
|
+
* @memberof NakamotoBlock
|
|
68
|
+
*/
|
|
69
|
+
burn_block_time_iso: string;
|
|
70
|
+
/**
|
|
71
|
+
* Hash of the anchor chain block
|
|
72
|
+
* @type {string}
|
|
73
|
+
* @memberof NakamotoBlock
|
|
74
|
+
*/
|
|
75
|
+
burn_block_hash: string;
|
|
76
|
+
/**
|
|
77
|
+
* Height of the anchor chain block
|
|
78
|
+
* @type {number}
|
|
79
|
+
* @memberof NakamotoBlock
|
|
80
|
+
*/
|
|
81
|
+
burn_block_height: number;
|
|
82
|
+
/**
|
|
83
|
+
* Anchor chain transaction ID
|
|
84
|
+
* @type {string}
|
|
85
|
+
* @memberof NakamotoBlock
|
|
86
|
+
*/
|
|
87
|
+
miner_txid: string;
|
|
88
|
+
/**
|
|
89
|
+
* List of transactions included in the block
|
|
90
|
+
* @type {Array<string>}
|
|
91
|
+
* @memberof NakamotoBlock
|
|
92
|
+
*/
|
|
93
|
+
txs: Array<string>;
|
|
94
|
+
/**
|
|
95
|
+
* Execution cost read count.
|
|
96
|
+
* @type {number}
|
|
97
|
+
* @memberof NakamotoBlock
|
|
98
|
+
*/
|
|
99
|
+
execution_cost_read_count: number;
|
|
100
|
+
/**
|
|
101
|
+
* Execution cost read length.
|
|
102
|
+
* @type {number}
|
|
103
|
+
* @memberof NakamotoBlock
|
|
104
|
+
*/
|
|
105
|
+
execution_cost_read_length: number;
|
|
106
|
+
/**
|
|
107
|
+
* Execution cost runtime.
|
|
108
|
+
* @type {number}
|
|
109
|
+
* @memberof NakamotoBlock
|
|
110
|
+
*/
|
|
111
|
+
execution_cost_runtime: number;
|
|
112
|
+
/**
|
|
113
|
+
* Execution cost write count.
|
|
114
|
+
* @type {number}
|
|
115
|
+
* @memberof NakamotoBlock
|
|
116
|
+
*/
|
|
117
|
+
execution_cost_write_count: number;
|
|
118
|
+
/**
|
|
119
|
+
* Execution cost write length.
|
|
120
|
+
* @type {number}
|
|
121
|
+
* @memberof NakamotoBlock
|
|
122
|
+
*/
|
|
123
|
+
execution_cost_write_length: number;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function NakamotoBlockFromJSON(json: any): NakamotoBlock {
|
|
127
|
+
return NakamotoBlockFromJSONTyped(json, false);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function NakamotoBlockFromJSONTyped(json: any, ignoreDiscriminator: boolean): NakamotoBlock {
|
|
131
|
+
if ((json === undefined) || (json === null)) {
|
|
132
|
+
return json;
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
|
|
136
|
+
'canonical': json['canonical'],
|
|
137
|
+
'height': json['height'],
|
|
138
|
+
'hash': json['hash'],
|
|
139
|
+
'index_block_hash': json['index_block_hash'],
|
|
140
|
+
'parent_block_hash': json['parent_block_hash'],
|
|
141
|
+
'parent_index_block_hash': json['parent_index_block_hash'],
|
|
142
|
+
'burn_block_time': json['burn_block_time'],
|
|
143
|
+
'burn_block_time_iso': json['burn_block_time_iso'],
|
|
144
|
+
'burn_block_hash': json['burn_block_hash'],
|
|
145
|
+
'burn_block_height': json['burn_block_height'],
|
|
146
|
+
'miner_txid': json['miner_txid'],
|
|
147
|
+
'txs': json['txs'],
|
|
148
|
+
'execution_cost_read_count': json['execution_cost_read_count'],
|
|
149
|
+
'execution_cost_read_length': json['execution_cost_read_length'],
|
|
150
|
+
'execution_cost_runtime': json['execution_cost_runtime'],
|
|
151
|
+
'execution_cost_write_count': json['execution_cost_write_count'],
|
|
152
|
+
'execution_cost_write_length': json['execution_cost_write_length'],
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export function NakamotoBlockToJSON(value?: NakamotoBlock | null): any {
|
|
157
|
+
if (value === undefined) {
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
if (value === null) {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
|
|
165
|
+
'canonical': value.canonical,
|
|
166
|
+
'height': value.height,
|
|
167
|
+
'hash': value.hash,
|
|
168
|
+
'index_block_hash': value.index_block_hash,
|
|
169
|
+
'parent_block_hash': value.parent_block_hash,
|
|
170
|
+
'parent_index_block_hash': value.parent_index_block_hash,
|
|
171
|
+
'burn_block_time': value.burn_block_time,
|
|
172
|
+
'burn_block_time_iso': value.burn_block_time_iso,
|
|
173
|
+
'burn_block_hash': value.burn_block_hash,
|
|
174
|
+
'burn_block_height': value.burn_block_height,
|
|
175
|
+
'miner_txid': value.miner_txid,
|
|
176
|
+
'txs': value.txs,
|
|
177
|
+
'execution_cost_read_count': value.execution_cost_read_count,
|
|
178
|
+
'execution_cost_read_length': value.execution_cost_read_length,
|
|
179
|
+
'execution_cost_runtime': value.execution_cost_runtime,
|
|
180
|
+
'execution_cost_write_count': value.execution_cost_write_count,
|
|
181
|
+
'execution_cost_write_length': value.execution_cost_write_length,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Stacks Blockchain API
|
|
5
|
+
* Welcome to the API reference overview for the <a href=\"https://docs.hiro.so/get-started/stacks-blockchain-api\">Stacks Blockchain API</a>. <a href=\"https://hirosystems.github.io/stacks-blockchain-api/collection.json\" download=\"stacks-api-collection.json\">Download Postman collection</a>
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: STACKS_API_VERSION
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { exists, mapValues } from '../runtime';
|
|
16
|
+
import {
|
|
17
|
+
NakamotoBlock,
|
|
18
|
+
NakamotoBlockFromJSON,
|
|
19
|
+
NakamotoBlockFromJSONTyped,
|
|
20
|
+
NakamotoBlockToJSON,
|
|
21
|
+
} from './';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* GET request that returns blocks
|
|
25
|
+
* @export
|
|
26
|
+
* @interface NakamotoBlockListResponse
|
|
27
|
+
*/
|
|
28
|
+
export interface NakamotoBlockListResponse {
|
|
29
|
+
/**
|
|
30
|
+
* The number of blocks to return
|
|
31
|
+
* @type {number}
|
|
32
|
+
* @memberof NakamotoBlockListResponse
|
|
33
|
+
*/
|
|
34
|
+
limit: number;
|
|
35
|
+
/**
|
|
36
|
+
* The number to blocks to skip (starting at `0`)
|
|
37
|
+
* @type {number}
|
|
38
|
+
* @memberof NakamotoBlockListResponse
|
|
39
|
+
*/
|
|
40
|
+
offset: number;
|
|
41
|
+
/**
|
|
42
|
+
* The number of blocks available
|
|
43
|
+
* @type {number}
|
|
44
|
+
* @memberof NakamotoBlockListResponse
|
|
45
|
+
*/
|
|
46
|
+
total: number;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @type {Array<NakamotoBlock>}
|
|
50
|
+
* @memberof NakamotoBlockListResponse
|
|
51
|
+
*/
|
|
52
|
+
results: Array<NakamotoBlock>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function NakamotoBlockListResponseFromJSON(json: any): NakamotoBlockListResponse {
|
|
56
|
+
return NakamotoBlockListResponseFromJSONTyped(json, false);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function NakamotoBlockListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): NakamotoBlockListResponse {
|
|
60
|
+
if ((json === undefined) || (json === null)) {
|
|
61
|
+
return json;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
|
|
65
|
+
'limit': json['limit'],
|
|
66
|
+
'offset': json['offset'],
|
|
67
|
+
'total': json['total'],
|
|
68
|
+
'results': ((json['results'] as Array<any>).map(NakamotoBlockFromJSON)),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function NakamotoBlockListResponseToJSON(value?: NakamotoBlockListResponse | null): any {
|
|
73
|
+
if (value === undefined) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
if (value === null) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
|
|
81
|
+
'limit': value.limit,
|
|
82
|
+
'offset': value.offset,
|
|
83
|
+
'total': value.total,
|
|
84
|
+
'results': ((value.results as Array<any>).map(NakamotoBlockToJSON)),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
@@ -58,6 +58,8 @@ export * from './MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransfer
|
|
|
58
58
|
export * from './MempoolTransactionStatsResponseTxTypeCounts';
|
|
59
59
|
export * from './Microblock';
|
|
60
60
|
export * from './MicroblockListResponse';
|
|
61
|
+
export * from './NakamotoBlock';
|
|
62
|
+
export * from './NakamotoBlockListResponse';
|
|
61
63
|
export * from './NetworkBlockTimeResponse';
|
|
62
64
|
export * from './NetworkBlockTimesResponse';
|
|
63
65
|
export * from './NetworkIdentifier';
|