@stacks/blockchain-api-client 7.4.0-nakamoto.1 → 7.4.0-nakamoto.3
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 +34 -1
- package/lib/generated/apis/BlocksApi.js +35 -0
- package/lib/generated/apis/BlocksApi.js.map +1 -1
- package/lib/generated/apis/TransactionsApi.d.ts +3 -2
- package/lib/generated/apis/TransactionsApi.js +1 -0
- package/lib/generated/apis/TransactionsApi.js.map +1 -1
- package/lib/generated/models/BurnBlock.d.ts +51 -0
- package/lib/generated/models/BurnBlock.js +50 -0
- package/lib/generated/models/BurnBlock.js.map +1 -0
- package/lib/generated/models/BurnBlockListResponse.d.ts +46 -0
- package/lib/generated/models/BurnBlockListResponse.js +49 -0
- package/lib/generated/models/BurnBlockListResponse.js.map +1 -0
- package/lib/generated/models/ServerStatusResponse.d.ts +6 -0
- package/lib/generated/models/ServerStatusResponse.js +2 -0
- package/lib/generated/models/ServerStatusResponse.js.map +1 -1
- 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 +151 -0
- 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 +73 -0
- package/src/generated/apis/TransactionsApi.ts +3 -2
- package/src/generated/models/BurnBlock.ts +88 -0
- package/src/generated/models/BurnBlockListResponse.ts +87 -0
- package/src/generated/models/ServerStatusResponse.ts +8 -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.3",
|
|
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",
|
|
@@ -40,6 +40,8 @@ models/BnsGetNameInfoResponse.ts
|
|
|
40
40
|
models/BnsGetNamePriceResponse.ts
|
|
41
41
|
models/BnsGetNamespacePriceResponse.ts
|
|
42
42
|
models/BnsNamesOwnByAddressResponse.ts
|
|
43
|
+
models/BurnBlock.ts
|
|
44
|
+
models/BurnBlockListResponse.ts
|
|
43
45
|
models/BurnchainReward.ts
|
|
44
46
|
models/BurnchainRewardListResponse.ts
|
|
45
47
|
models/BurnchainRewardSlotHolder.ts
|
|
@@ -21,6 +21,9 @@ import {
|
|
|
21
21
|
BlockListResponse,
|
|
22
22
|
BlockListResponseFromJSON,
|
|
23
23
|
BlockListResponseToJSON,
|
|
24
|
+
BurnBlockListResponse,
|
|
25
|
+
BurnBlockListResponseFromJSON,
|
|
26
|
+
BurnBlockListResponseToJSON,
|
|
24
27
|
} from '../models';
|
|
25
28
|
|
|
26
29
|
export interface GetBlockByBurnBlockHashRequest {
|
|
@@ -44,6 +47,13 @@ export interface GetBlockListRequest {
|
|
|
44
47
|
offset?: number;
|
|
45
48
|
}
|
|
46
49
|
|
|
50
|
+
export interface GetBurnBlockListRequest {
|
|
51
|
+
limit?: number;
|
|
52
|
+
offset?: number;
|
|
53
|
+
height?: number;
|
|
54
|
+
hash?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
47
57
|
/**
|
|
48
58
|
* BlocksApi - interface
|
|
49
59
|
*
|
|
@@ -132,6 +142,25 @@ export interface BlocksApiInterface {
|
|
|
132
142
|
*/
|
|
133
143
|
getBlockList(requestParameters: GetBlockListRequest, initOverrides?: RequestInit): Promise<BlockListResponse>;
|
|
134
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Retrieves a list of recent burn blocks
|
|
147
|
+
* @summary Get recent burn blocks
|
|
148
|
+
* @param {number} [limit] max number of burn blocks to fetch
|
|
149
|
+
* @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 \'latest\' to filter for the most recent burn block
|
|
152
|
+
* @param {*} [options] Override http request option.
|
|
153
|
+
* @throws {RequiredError}
|
|
154
|
+
* @memberof BlocksApiInterface
|
|
155
|
+
*/
|
|
156
|
+
getBurnBlockListRaw(requestParameters: GetBurnBlockListRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BurnBlockListResponse>>;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Retrieves a list of recent burn blocks
|
|
160
|
+
* Get recent burn blocks
|
|
161
|
+
*/
|
|
162
|
+
getBurnBlockList(requestParameters: GetBurnBlockListRequest, initOverrides?: RequestInit): Promise<BurnBlockListResponse>;
|
|
163
|
+
|
|
135
164
|
}
|
|
136
165
|
|
|
137
166
|
/**
|
|
@@ -303,4 +332,48 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
303
332
|
return await response.value();
|
|
304
333
|
}
|
|
305
334
|
|
|
335
|
+
/**
|
|
336
|
+
* Retrieves a list of recent burn blocks
|
|
337
|
+
* Get recent burn blocks
|
|
338
|
+
*/
|
|
339
|
+
async getBurnBlockListRaw(requestParameters: GetBurnBlockListRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BurnBlockListResponse>> {
|
|
340
|
+
const queryParameters: any = {};
|
|
341
|
+
|
|
342
|
+
if (requestParameters.limit !== undefined) {
|
|
343
|
+
queryParameters['limit'] = requestParameters.limit;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
if (requestParameters.offset !== undefined) {
|
|
347
|
+
queryParameters['offset'] = requestParameters.offset;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
if (requestParameters.height !== undefined) {
|
|
351
|
+
queryParameters['height'] = requestParameters.height;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
if (requestParameters.hash !== undefined) {
|
|
355
|
+
queryParameters['hash'] = requestParameters.hash;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
359
|
+
|
|
360
|
+
const response = await this.request({
|
|
361
|
+
path: `/extended/v1/burn_block`,
|
|
362
|
+
method: 'GET',
|
|
363
|
+
headers: headerParameters,
|
|
364
|
+
query: queryParameters,
|
|
365
|
+
}, initOverrides);
|
|
366
|
+
|
|
367
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => BurnBlockListResponseFromJSON(jsonValue));
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Retrieves a list of recent burn blocks
|
|
372
|
+
* Get recent burn blocks
|
|
373
|
+
*/
|
|
374
|
+
async getBurnBlockList(requestParameters: GetBurnBlockListRequest, initOverrides?: RequestInit): Promise<BurnBlockListResponse> {
|
|
375
|
+
const response = await this.getBurnBlockListRaw(requestParameters, initOverrides);
|
|
376
|
+
return await response.value();
|
|
377
|
+
}
|
|
378
|
+
|
|
306
379
|
}
|
|
@@ -245,7 +245,7 @@ export interface TransactionsApiInterface {
|
|
|
245
245
|
* @summary Get recent transactions
|
|
246
246
|
* @param {number} [limit] max number of transactions to fetch
|
|
247
247
|
* @param {number} [offset] index of first transaction to fetch
|
|
248
|
-
* @param {Array<'coinbase' | 'token_transfer' | 'smart_contract' | 'contract_call' | 'poison_microblock'>} [type] Filter by transaction type
|
|
248
|
+
* @param {Array<'coinbase' | 'token_transfer' | 'smart_contract' | 'contract_call' | 'poison_microblock' | 'tenure_change'>} [type] Filter by transaction type
|
|
249
249
|
* @param {boolean} [unanchored] Include transaction data from unanchored (i.e. unconfirmed) microblocks
|
|
250
250
|
* @param {*} [options] Override http request option.
|
|
251
251
|
* @throws {RequiredError}
|
|
@@ -851,5 +851,6 @@ export enum GetTransactionListTypeEnum {
|
|
|
851
851
|
token_transfer = 'token_transfer',
|
|
852
852
|
smart_contract = 'smart_contract',
|
|
853
853
|
contract_call = 'contract_call',
|
|
854
|
-
poison_microblock = 'poison_microblock'
|
|
854
|
+
poison_microblock = 'poison_microblock',
|
|
855
|
+
tenure_change = 'tenure_change'
|
|
855
856
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
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 burn block
|
|
18
|
+
* @export
|
|
19
|
+
* @interface BurnBlock
|
|
20
|
+
*/
|
|
21
|
+
export interface BurnBlock {
|
|
22
|
+
/**
|
|
23
|
+
* Unix timestamp (in seconds) indicating when this block was mined.
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof BurnBlock
|
|
26
|
+
*/
|
|
27
|
+
burn_block_time: number;
|
|
28
|
+
/**
|
|
29
|
+
* An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) indicating when this block was mined.
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof BurnBlock
|
|
32
|
+
*/
|
|
33
|
+
burn_block_time_iso: string;
|
|
34
|
+
/**
|
|
35
|
+
* Hash of the anchor chain block
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof BurnBlock
|
|
38
|
+
*/
|
|
39
|
+
burn_block_hash: string;
|
|
40
|
+
/**
|
|
41
|
+
* Height of the anchor chain block
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @memberof BurnBlock
|
|
44
|
+
*/
|
|
45
|
+
burn_block_height: number;
|
|
46
|
+
/**
|
|
47
|
+
* Hashes of the Stacks blocks included in the burn block
|
|
48
|
+
* @type {Array<string>}
|
|
49
|
+
* @memberof BurnBlock
|
|
50
|
+
*/
|
|
51
|
+
stacks_blocks: Array<string>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function BurnBlockFromJSON(json: any): BurnBlock {
|
|
55
|
+
return BurnBlockFromJSONTyped(json, false);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function BurnBlockFromJSONTyped(json: any, ignoreDiscriminator: boolean): BurnBlock {
|
|
59
|
+
if ((json === undefined) || (json === null)) {
|
|
60
|
+
return json;
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
|
|
64
|
+
'burn_block_time': json['burn_block_time'],
|
|
65
|
+
'burn_block_time_iso': json['burn_block_time_iso'],
|
|
66
|
+
'burn_block_hash': json['burn_block_hash'],
|
|
67
|
+
'burn_block_height': json['burn_block_height'],
|
|
68
|
+
'stacks_blocks': json['stacks_blocks'],
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function BurnBlockToJSON(value?: BurnBlock | null): any {
|
|
73
|
+
if (value === undefined) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
if (value === null) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
|
|
81
|
+
'burn_block_time': value.burn_block_time,
|
|
82
|
+
'burn_block_time_iso': value.burn_block_time_iso,
|
|
83
|
+
'burn_block_hash': value.burn_block_hash,
|
|
84
|
+
'burn_block_height': value.burn_block_height,
|
|
85
|
+
'stacks_blocks': value.stacks_blocks,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
@@ -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
|
+
BurnBlock,
|
|
18
|
+
BurnBlockFromJSON,
|
|
19
|
+
BurnBlockFromJSONTyped,
|
|
20
|
+
BurnBlockToJSON,
|
|
21
|
+
} from './';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* GET request that returns burn blocks
|
|
25
|
+
* @export
|
|
26
|
+
* @interface BurnBlockListResponse
|
|
27
|
+
*/
|
|
28
|
+
export interface BurnBlockListResponse {
|
|
29
|
+
/**
|
|
30
|
+
* The number of burn blocks to return
|
|
31
|
+
* @type {number}
|
|
32
|
+
* @memberof BurnBlockListResponse
|
|
33
|
+
*/
|
|
34
|
+
limit: number;
|
|
35
|
+
/**
|
|
36
|
+
* The number to burn blocks to skip (starting at `0`)
|
|
37
|
+
* @type {number}
|
|
38
|
+
* @memberof BurnBlockListResponse
|
|
39
|
+
*/
|
|
40
|
+
offset: number;
|
|
41
|
+
/**
|
|
42
|
+
* The number of burn blocks available (regardless of filter parameters)
|
|
43
|
+
* @type {number}
|
|
44
|
+
* @memberof BurnBlockListResponse
|
|
45
|
+
*/
|
|
46
|
+
total: number;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @type {Array<BurnBlock>}
|
|
50
|
+
* @memberof BurnBlockListResponse
|
|
51
|
+
*/
|
|
52
|
+
results: Array<BurnBlock>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function BurnBlockListResponseFromJSON(json: any): BurnBlockListResponse {
|
|
56
|
+
return BurnBlockListResponseFromJSONTyped(json, false);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function BurnBlockListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): BurnBlockListResponse {
|
|
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(BurnBlockFromJSON)),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function BurnBlockListResponseToJSON(value?: BurnBlockListResponse | 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(BurnBlockToJSON)),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
@@ -50,6 +50,12 @@ export interface ServerStatusResponse {
|
|
|
50
50
|
* @memberof ServerStatusResponse
|
|
51
51
|
*/
|
|
52
52
|
pox_v2_unlock_height?: number | null;
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @type {number}
|
|
56
|
+
* @memberof ServerStatusResponse
|
|
57
|
+
*/
|
|
58
|
+
pox_v3_unlock_height?: number | null;
|
|
53
59
|
/**
|
|
54
60
|
*
|
|
55
61
|
* @type {ChainTip}
|
|
@@ -72,6 +78,7 @@ export function ServerStatusResponseFromJSONTyped(json: any, ignoreDiscriminator
|
|
|
72
78
|
'status': json['status'],
|
|
73
79
|
'pox_v1_unlock_height': !exists(json, 'pox_v1_unlock_height') ? undefined : json['pox_v1_unlock_height'],
|
|
74
80
|
'pox_v2_unlock_height': !exists(json, 'pox_v2_unlock_height') ? undefined : json['pox_v2_unlock_height'],
|
|
81
|
+
'pox_v3_unlock_height': !exists(json, 'pox_v3_unlock_height') ? undefined : json['pox_v3_unlock_height'],
|
|
75
82
|
'chain_tip': !exists(json, 'chain_tip') ? undefined : ChainTipFromJSON(json['chain_tip']),
|
|
76
83
|
};
|
|
77
84
|
}
|
|
@@ -89,6 +96,7 @@ export function ServerStatusResponseToJSON(value?: ServerStatusResponse | null):
|
|
|
89
96
|
'status': value.status,
|
|
90
97
|
'pox_v1_unlock_height': value.pox_v1_unlock_height,
|
|
91
98
|
'pox_v2_unlock_height': value.pox_v2_unlock_height,
|
|
99
|
+
'pox_v3_unlock_height': value.pox_v3_unlock_height,
|
|
92
100
|
'chain_tip': ChainTipToJSON(value.chain_tip),
|
|
93
101
|
};
|
|
94
102
|
}
|
|
@@ -24,6 +24,8 @@ export * from './BnsGetNameInfoResponse';
|
|
|
24
24
|
export * from './BnsGetNamePriceResponse';
|
|
25
25
|
export * from './BnsGetNamespacePriceResponse';
|
|
26
26
|
export * from './BnsNamesOwnByAddressResponse';
|
|
27
|
+
export * from './BurnBlock';
|
|
28
|
+
export * from './BurnBlockListResponse';
|
|
27
29
|
export * from './BurnchainReward';
|
|
28
30
|
export * from './BurnchainRewardListResponse';
|
|
29
31
|
export * from './BurnchainRewardSlotHolder';
|