@stacks/blockchain-api-client 7.4.0-nakamoto.3 → 7.4.0-nakamoto.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stacks/blockchain-api-client",
3
- "version": "7.4.0-nakamoto.3",
3
+ "version": "7.4.0-nakamoto.5",
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
@@ -21,9 +21,15 @@ import {
21
21
  BlockListResponse,
22
22
  BlockListResponseFromJSON,
23
23
  BlockListResponseToJSON,
24
+ BurnBlock,
25
+ BurnBlockFromJSON,
26
+ BurnBlockToJSON,
24
27
  BurnBlockListResponse,
25
28
  BurnBlockListResponseFromJSON,
26
29
  BurnBlockListResponseToJSON,
30
+ NakamotoBlockListResponse,
31
+ NakamotoBlockListResponseFromJSON,
32
+ NakamotoBlockListResponseToJSON,
27
33
  } from '../models';
28
34
 
29
35
  export interface GetBlockByBurnBlockHashRequest {
@@ -47,11 +53,20 @@ export interface GetBlockListRequest {
47
53
  offset?: number;
48
54
  }
49
55
 
50
- export interface GetBurnBlockListRequest {
56
+ export interface GetBlocksRequest {
57
+ limit?: number;
58
+ offset?: number;
59
+ burnBlockHash?: string;
60
+ burnBlockHeight?: number;
61
+ }
62
+
63
+ export interface GetBurnBlockRequest {
64
+ heightOrHash: number | string;
65
+ }
66
+
67
+ export interface GetBurnBlocksRequest {
51
68
  limit?: number;
52
69
  offset?: number;
53
- height?: number;
54
- hash?: string;
55
70
  }
56
71
 
57
72
  /**
@@ -62,7 +77,7 @@ export interface GetBurnBlockListRequest {
62
77
  */
63
78
  export interface BlocksApiInterface {
64
79
  /**
65
- * Retrieves block details of a specific block for a given burnchain block hash
80
+ * **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
81
  * @summary Get block by burnchain block hash
67
82
  * @param {string} burnBlockHash Hash of the burnchain block
68
83
  * @param {*} [options] Override http request option.
@@ -72,13 +87,13 @@ export interface BlocksApiInterface {
72
87
  getBlockByBurnBlockHashRaw(requestParameters: GetBlockByBurnBlockHashRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Block>>;
73
88
 
74
89
  /**
75
- * Retrieves block details of a specific block for a given burnchain block hash
90
+ * **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
91
  * Get block by burnchain block hash
77
92
  */
78
93
  getBlockByBurnBlockHash(requestParameters: GetBlockByBurnBlockHashRequest, initOverrides?: RequestInit): Promise<Block>;
79
94
 
80
95
  /**
81
- * Retrieves block details of a specific block for a given burn chain height
96
+ * **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
97
  * @summary Get block by burnchain height
83
98
  * @param {number} burnBlockHeight Height of the burn chain block
84
99
  * @param {*} [options] Override http request option.
@@ -88,7 +103,7 @@ export interface BlocksApiInterface {
88
103
  getBlockByBurnBlockHeightRaw(requestParameters: GetBlockByBurnBlockHeightRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Block>>;
89
104
 
90
105
  /**
91
- * Retrieves block details of a specific block for a given burn chain height
106
+ * **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
107
  * Get block by burnchain height
93
108
  */
94
109
  getBlockByBurnBlockHeight(requestParameters: GetBlockByBurnBlockHeightRequest, initOverrides?: RequestInit): Promise<Block>;
@@ -126,7 +141,7 @@ export interface BlocksApiInterface {
126
141
  getBlockByHeight(requestParameters: GetBlockByHeightRequest, initOverrides?: RequestInit): Promise<Block>;
127
142
 
128
143
  /**
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.
144
+ * **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
145
  * @summary Get recent blocks
131
146
  * @param {number} [limit] max number of blocks to fetch
132
147
  * @param {number} [offset] index of first block to fetch
@@ -137,29 +152,62 @@ export interface BlocksApiInterface {
137
152
  getBlockListRaw(requestParameters: GetBlockListRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BlockListResponse>>;
138
153
 
139
154
  /**
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.
155
+ * **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
156
  * Get recent blocks
142
157
  */
143
158
  getBlockList(requestParameters: GetBlockListRequest, initOverrides?: RequestInit): Promise<BlockListResponse>;
144
159
 
160
+ /**
161
+ * Retrieves a list of recently mined blocks
162
+ * @summary Get blocks
163
+ * @param {number} [limit] max number of blocks to fetch
164
+ * @param {number} [offset] index of first burn block to fetch
165
+ * @param {string} [burnBlockHash] filter blocks by burn block hash
166
+ * @param {number} [burnBlockHeight] filter blocks by burn block height
167
+ * @param {*} [options] Override http request option.
168
+ * @throws {RequiredError}
169
+ * @memberof BlocksApiInterface
170
+ */
171
+ getBlocksRaw(requestParameters: GetBlocksRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NakamotoBlockListResponse>>;
172
+
173
+ /**
174
+ * Retrieves a list of recently mined blocks
175
+ * Get blocks
176
+ */
177
+ getBlocks(requestParameters: GetBlocksRequest, initOverrides?: RequestInit): Promise<NakamotoBlockListResponse>;
178
+
179
+ /**
180
+ * Retrieves a single burn block
181
+ * @summary Get burn block
182
+ * @param {number | string} heightOrHash filter by burn block height, hash, or the constant &#x60;latest&#x60; to filter for the most recent burn block
183
+ * @param {*} [options] Override http request option.
184
+ * @throws {RequiredError}
185
+ * @memberof BlocksApiInterface
186
+ */
187
+ getBurnBlockRaw(requestParameters: GetBurnBlockRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BurnBlock>>;
188
+
189
+ /**
190
+ * Retrieves a single burn block
191
+ * Get burn block
192
+ */
193
+ getBurnBlock(requestParameters: GetBurnBlockRequest, initOverrides?: RequestInit): Promise<BurnBlock>;
194
+
145
195
  /**
146
196
  * Retrieves a list of recent burn blocks
147
- * @summary Get recent burn blocks
197
+ * @summary Get burn blocks
148
198
  * @param {number} [limit] max number of burn blocks to fetch
149
199
  * @param {number} [offset] index of first burn block to fetch
150
- * @param {number} [height] filter by burn block height
151
- * @param {string} [hash] filter by burn block hash or the constant \&#39;latest\&#39; to filter for the most recent burn block
152
200
  * @param {*} [options] Override http request option.
153
201
  * @throws {RequiredError}
154
202
  * @memberof BlocksApiInterface
155
203
  */
156
- getBurnBlockListRaw(requestParameters: GetBurnBlockListRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BurnBlockListResponse>>;
204
+ getBurnBlocksRaw(requestParameters: GetBurnBlocksRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BurnBlockListResponse>>;
157
205
 
158
206
  /**
159
207
  * Retrieves a list of recent burn blocks
160
- * Get recent burn blocks
208
+ * Get burn blocks
161
209
  */
162
- getBurnBlockList(requestParameters: GetBurnBlockListRequest, initOverrides?: RequestInit): Promise<BurnBlockListResponse>;
210
+ getBurnBlocks(requestParameters: GetBurnBlocksRequest, initOverrides?: RequestInit): Promise<BurnBlockListResponse>;
163
211
 
164
212
  }
165
213
 
@@ -169,7 +217,7 @@ export interface BlocksApiInterface {
169
217
  export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
170
218
 
171
219
  /**
172
- * Retrieves block details of a specific block for a given burnchain block hash
220
+ * **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
221
  * Get block by burnchain block hash
174
222
  */
175
223
  async getBlockByBurnBlockHashRaw(requestParameters: GetBlockByBurnBlockHashRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Block>> {
@@ -192,7 +240,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
192
240
  }
193
241
 
194
242
  /**
195
- * Retrieves block details of a specific block for a given burnchain block hash
243
+ * **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
244
  * Get block by burnchain block hash
197
245
  */
198
246
  async getBlockByBurnBlockHash(requestParameters: GetBlockByBurnBlockHashRequest, initOverrides?: RequestInit): Promise<Block> {
@@ -201,7 +249,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
201
249
  }
202
250
 
203
251
  /**
204
- * Retrieves block details of a specific block for a given burn chain height
252
+ * **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
253
  * Get block by burnchain height
206
254
  */
207
255
  async getBlockByBurnBlockHeightRaw(requestParameters: GetBlockByBurnBlockHeightRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Block>> {
@@ -224,7 +272,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
224
272
  }
225
273
 
226
274
  /**
227
- * Retrieves block details of a specific block for a given burn chain height
275
+ * **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
276
  * Get block by burnchain height
229
277
  */
230
278
  async getBlockByBurnBlockHeight(requestParameters: GetBlockByBurnBlockHeightRequest, initOverrides?: RequestInit): Promise<Block> {
@@ -297,7 +345,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
297
345
  }
298
346
 
299
347
  /**
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.
348
+ * **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
349
  * Get recent blocks
302
350
  */
303
351
  async getBlockListRaw(requestParameters: GetBlockListRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BlockListResponse>> {
@@ -324,7 +372,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
324
372
  }
325
373
 
326
374
  /**
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.
375
+ * **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
376
  * Get recent blocks
329
377
  */
330
378
  async getBlockList(requestParameters: GetBlockListRequest, initOverrides?: RequestInit): Promise<BlockListResponse> {
@@ -333,10 +381,10 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
333
381
  }
334
382
 
335
383
  /**
336
- * Retrieves a list of recent burn blocks
337
- * Get recent burn blocks
384
+ * Retrieves a list of recently mined blocks
385
+ * Get blocks
338
386
  */
339
- async getBurnBlockListRaw(requestParameters: GetBurnBlockListRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BurnBlockListResponse>> {
387
+ async getBlocksRaw(requestParameters: GetBlocksRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NakamotoBlockListResponse>> {
340
388
  const queryParameters: any = {};
341
389
 
342
390
  if (requestParameters.limit !== undefined) {
@@ -347,18 +395,86 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
347
395
  queryParameters['offset'] = requestParameters.offset;
348
396
  }
349
397
 
350
- if (requestParameters.height !== undefined) {
351
- queryParameters['height'] = requestParameters.height;
398
+ if (requestParameters.burnBlockHash !== undefined) {
399
+ queryParameters['burn_block_hash'] = requestParameters.burnBlockHash;
400
+ }
401
+
402
+ if (requestParameters.burnBlockHeight !== undefined) {
403
+ queryParameters['burn_block_height'] = requestParameters.burnBlockHeight;
404
+ }
405
+
406
+ const headerParameters: runtime.HTTPHeaders = {};
407
+
408
+ const response = await this.request({
409
+ path: `/extended/v2/blocks`,
410
+ method: 'GET',
411
+ headers: headerParameters,
412
+ query: queryParameters,
413
+ }, initOverrides);
414
+
415
+ return new runtime.JSONApiResponse(response, (jsonValue) => NakamotoBlockListResponseFromJSON(jsonValue));
416
+ }
417
+
418
+ /**
419
+ * Retrieves a list of recently mined blocks
420
+ * Get blocks
421
+ */
422
+ async getBlocks(requestParameters: GetBlocksRequest, initOverrides?: RequestInit): Promise<NakamotoBlockListResponse> {
423
+ const response = await this.getBlocksRaw(requestParameters, initOverrides);
424
+ return await response.value();
425
+ }
426
+
427
+ /**
428
+ * Retrieves a single burn block
429
+ * Get burn block
430
+ */
431
+ async getBurnBlockRaw(requestParameters: GetBurnBlockRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BurnBlock>> {
432
+ if (requestParameters.heightOrHash === null || requestParameters.heightOrHash === undefined) {
433
+ throw new runtime.RequiredError('heightOrHash','Required parameter requestParameters.heightOrHash was null or undefined when calling getBurnBlock.');
434
+ }
435
+
436
+ const queryParameters: any = {};
437
+
438
+ const headerParameters: runtime.HTTPHeaders = {};
439
+
440
+ const response = await this.request({
441
+ path: `/extended/v2/burn-blocks/{height_or_hash}`.replace(`{${"height_or_hash"}}`, encodeURIComponent(String(requestParameters.heightOrHash))),
442
+ method: 'GET',
443
+ headers: headerParameters,
444
+ query: queryParameters,
445
+ }, initOverrides);
446
+
447
+ return new runtime.JSONApiResponse(response, (jsonValue) => BurnBlockFromJSON(jsonValue));
448
+ }
449
+
450
+ /**
451
+ * Retrieves a single burn block
452
+ * Get burn block
453
+ */
454
+ async getBurnBlock(requestParameters: GetBurnBlockRequest, initOverrides?: RequestInit): Promise<BurnBlock> {
455
+ const response = await this.getBurnBlockRaw(requestParameters, initOverrides);
456
+ return await response.value();
457
+ }
458
+
459
+ /**
460
+ * Retrieves a list of recent burn blocks
461
+ * Get burn blocks
462
+ */
463
+ async getBurnBlocksRaw(requestParameters: GetBurnBlocksRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BurnBlockListResponse>> {
464
+ const queryParameters: any = {};
465
+
466
+ if (requestParameters.limit !== undefined) {
467
+ queryParameters['limit'] = requestParameters.limit;
352
468
  }
353
469
 
354
- if (requestParameters.hash !== undefined) {
355
- queryParameters['hash'] = requestParameters.hash;
470
+ if (requestParameters.offset !== undefined) {
471
+ queryParameters['offset'] = requestParameters.offset;
356
472
  }
357
473
 
358
474
  const headerParameters: runtime.HTTPHeaders = {};
359
475
 
360
476
  const response = await this.request({
361
- path: `/extended/v1/burn_block`,
477
+ path: `/extended/v2/burn-blocks`,
362
478
  method: 'GET',
363
479
  headers: headerParameters,
364
480
  query: queryParameters,
@@ -369,10 +485,10 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
369
485
 
370
486
  /**
371
487
  * Retrieves a list of recent burn blocks
372
- * Get recent burn blocks
488
+ * Get burn blocks
373
489
  */
374
- async getBurnBlockList(requestParameters: GetBurnBlockListRequest, initOverrides?: RequestInit): Promise<BurnBlockListResponse> {
375
- const response = await this.getBurnBlockListRaw(requestParameters, initOverrides);
490
+ async getBurnBlocks(requestParameters: GetBurnBlocksRequest, initOverrides?: RequestInit): Promise<BurnBlockListResponse> {
491
+ const response = await this.getBurnBlocksRaw(requestParameters, initOverrides);
376
492
  return await response.value();
377
493
  }
378
494
 
@@ -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';