@stacks/blockchain-api-client 7.5.0-beta.2 → 7.6.0-nakamoto.1
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/AccountsApi.d.ts +1 -36
- package/lib/generated/apis/AccountsApi.js +0 -38
- package/lib/generated/apis/AccountsApi.js.map +1 -1
- package/lib/generated/apis/BlocksApi.d.ts +108 -21
- package/lib/generated/apis/BlocksApi.js +97 -10
- package/lib/generated/apis/BlocksApi.js.map +1 -1
- package/lib/generated/apis/BurnBlocksApi.d.ts +82 -0
- package/lib/generated/apis/BurnBlocksApi.js +80 -0
- package/lib/generated/apis/BurnBlocksApi.js.map +1 -0
- package/lib/generated/apis/NonFungibleTokensApi.d.ts +1 -57
- package/lib/generated/apis/NonFungibleTokensApi.js +0 -55
- package/lib/generated/apis/NonFungibleTokensApi.js.map +1 -1
- package/lib/generated/apis/TransactionsApi.d.ts +38 -10
- package/lib/generated/apis/TransactionsApi.js +31 -4
- package/lib/generated/apis/TransactionsApi.js.map +1 -1
- package/lib/generated/apis/index.d.ts +1 -1
- package/lib/generated/apis/index.js +1 -1
- package/lib/generated/apis/index.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/{AddressNftListResponse.js → BurnBlockListResponse.js} +11 -11
- package/lib/generated/models/BurnBlockListResponse.js.map +1 -0
- 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/{FungibleTokensMetadataList.js → NakamotoBlockListResponse.js} +11 -11
- package/lib/generated/models/NakamotoBlockListResponse.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 +4 -7
- package/lib/generated/models/index.js +4 -7
- package/lib/generated/models/index.js.map +1 -1
- package/lib/index.umd.js +605 -679
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/generated/.openapi-generator/FILES +5 -8
- package/src/generated/apis/AccountsApi.ts +0 -79
- package/src/generated/apis/BlocksApi.ts +200 -20
- package/src/generated/apis/BurnBlocksApi.ts +150 -0
- package/src/generated/apis/NonFungibleTokensApi.ts +0 -116
- package/src/generated/apis/TransactionsApi.ts +63 -10
- package/src/generated/apis/index.ts +1 -1
- package/src/generated/models/BurnBlock.ts +88 -0
- package/src/generated/models/{AddressNftListResponse.ts → BurnBlockListResponse.ts} +22 -22
- package/src/generated/models/NakamotoBlock.ts +184 -0
- package/src/generated/models/{FungibleTokensMetadataList.ts → NakamotoBlockListResponse.ts} +22 -22
- package/src/generated/models/ServerStatusResponse.ts +8 -0
- package/src/generated/models/index.ts +4 -7
- package/lib/generated/apis/FungibleTokensApi.d.ts +0 -82
- package/lib/generated/apis/FungibleTokensApi.js +0 -80
- package/lib/generated/apis/FungibleTokensApi.js.map +0 -1
- package/lib/generated/models/AddressNftListResponse.d.ts +0 -46
- package/lib/generated/models/AddressNftListResponse.js.map +0 -1
- package/lib/generated/models/AddressNftListResponseValue.d.ts +0 -33
- package/lib/generated/models/AddressNftListResponseValue.js +0 -44
- package/lib/generated/models/AddressNftListResponseValue.js.map +0 -1
- package/lib/generated/models/FungibleTokenMetadata.d.ts +0 -75
- package/lib/generated/models/FungibleTokenMetadata.js +0 -58
- package/lib/generated/models/FungibleTokenMetadata.js.map +0 -1
- package/lib/generated/models/FungibleTokensMetadataList.d.ts +0 -46
- package/lib/generated/models/FungibleTokensMetadataList.js.map +0 -1
- package/lib/generated/models/NftEvent.d.ts +0 -76
- package/lib/generated/models/NftEvent.js +0 -60
- package/lib/generated/models/NftEvent.js.map +0 -1
- package/lib/generated/models/NonFungibleTokenMetadata.d.ts +0 -63
- package/lib/generated/models/NonFungibleTokenMetadata.js +0 -54
- package/lib/generated/models/NonFungibleTokenMetadata.js.map +0 -1
- package/lib/generated/models/NonFungibleTokensMetadataList.d.ts +0 -46
- package/lib/generated/models/NonFungibleTokensMetadataList.js +0 -49
- package/lib/generated/models/NonFungibleTokensMetadataList.js.map +0 -1
- package/src/generated/apis/FungibleTokensApi.ts +0 -150
- package/src/generated/models/AddressNftListResponseValue.ts +0 -64
- package/src/generated/models/FungibleTokenMetadata.ts +0 -120
- package/src/generated/models/NftEvent.ts +0 -127
- package/src/generated/models/NonFungibleTokenMetadata.ts +0 -104
- package/src/generated/models/NonFungibleTokensMetadataList.ts +0 -87
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacks/blockchain-api-client",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.6.0-nakamoto.1",
|
|
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",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
.openapi-generator-ignore
|
|
2
2
|
apis/AccountsApi.ts
|
|
3
3
|
apis/BlocksApi.ts
|
|
4
|
+
apis/BurnBlocksApi.ts
|
|
4
5
|
apis/FaucetsApi.ts
|
|
5
6
|
apis/FeesApi.ts
|
|
6
|
-
apis/FungibleTokensApi.ts
|
|
7
7
|
apis/InfoApi.ts
|
|
8
8
|
apis/MempoolApi.ts
|
|
9
9
|
apis/MicroblocksApi.ts
|
|
@@ -20,8 +20,6 @@ index.ts
|
|
|
20
20
|
models/AccountDataResponse.ts
|
|
21
21
|
models/AddressAssetsListResponse.ts
|
|
22
22
|
models/AddressBalanceResponse.ts
|
|
23
|
-
models/AddressNftListResponse.ts
|
|
24
|
-
models/AddressNftListResponseValue.ts
|
|
25
23
|
models/AddressNonces.ts
|
|
26
24
|
models/AddressStxInboundListResponse.ts
|
|
27
25
|
models/AddressTokenOfferingLocked.ts
|
|
@@ -41,6 +39,8 @@ models/BnsGetNameInfoResponse.ts
|
|
|
41
39
|
models/BnsGetNamePriceResponse.ts
|
|
42
40
|
models/BnsGetNamespacePriceResponse.ts
|
|
43
41
|
models/BnsNamesOwnByAddressResponse.ts
|
|
42
|
+
models/BurnBlock.ts
|
|
43
|
+
models/BurnBlockListResponse.ts
|
|
44
44
|
models/BurnchainReward.ts
|
|
45
45
|
models/BurnchainRewardListResponse.ts
|
|
46
46
|
models/BurnchainRewardSlotHolder.ts
|
|
@@ -54,8 +54,6 @@ models/CoreNodeInfoResponse.ts
|
|
|
54
54
|
models/CoreNodePoxResponse.ts
|
|
55
55
|
models/FeeRate.ts
|
|
56
56
|
models/FeeRateRequest.ts
|
|
57
|
-
models/FungibleTokenMetadata.ts
|
|
58
|
-
models/FungibleTokensMetadataList.ts
|
|
59
57
|
models/GetRawTransactionResult.ts
|
|
60
58
|
models/GetStxSupplyLegacyFormatResponse.ts
|
|
61
59
|
models/GetStxSupplyResponse.ts
|
|
@@ -74,15 +72,14 @@ models/MempoolTransactionStatsResponseTxSimpleFeeAveragesTokenTransfer.ts
|
|
|
74
72
|
models/MempoolTransactionStatsResponseTxTypeCounts.ts
|
|
75
73
|
models/Microblock.ts
|
|
76
74
|
models/MicroblockListResponse.ts
|
|
75
|
+
models/NakamotoBlock.ts
|
|
76
|
+
models/NakamotoBlockListResponse.ts
|
|
77
77
|
models/NetworkBlockTimeResponse.ts
|
|
78
78
|
models/NetworkBlockTimesResponse.ts
|
|
79
79
|
models/NetworkIdentifier.ts
|
|
80
|
-
models/NftEvent.ts
|
|
81
80
|
models/NonFungibleTokenHistoryEventList.ts
|
|
82
81
|
models/NonFungibleTokenHoldingsList.ts
|
|
83
|
-
models/NonFungibleTokenMetadata.ts
|
|
84
82
|
models/NonFungibleTokenMintList.ts
|
|
85
|
-
models/NonFungibleTokensMetadataList.ts
|
|
86
83
|
models/OtherTransactionIdentifier.ts
|
|
87
84
|
models/PoolDelegation.ts
|
|
88
85
|
models/PoolDelegationsResponse.ts
|
|
@@ -24,9 +24,6 @@ import {
|
|
|
24
24
|
AddressBalanceResponse,
|
|
25
25
|
AddressBalanceResponseFromJSON,
|
|
26
26
|
AddressBalanceResponseToJSON,
|
|
27
|
-
AddressNftListResponse,
|
|
28
|
-
AddressNftListResponseFromJSON,
|
|
29
|
-
AddressNftListResponseToJSON,
|
|
30
27
|
AddressNonces,
|
|
31
28
|
AddressNoncesFromJSON,
|
|
32
29
|
AddressNoncesToJSON,
|
|
@@ -73,14 +70,6 @@ export interface GetAccountInfoRequest {
|
|
|
73
70
|
tip?: string;
|
|
74
71
|
}
|
|
75
72
|
|
|
76
|
-
export interface GetAccountNftRequest {
|
|
77
|
-
principal: string;
|
|
78
|
-
limit?: number;
|
|
79
|
-
offset?: number;
|
|
80
|
-
unanchored?: boolean;
|
|
81
|
-
untilBlock?: string;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
73
|
export interface GetAccountNoncesRequest {
|
|
85
74
|
principal: string;
|
|
86
75
|
blockHeight?: number;
|
|
@@ -200,26 +189,6 @@ export interface AccountsApiInterface {
|
|
|
200
189
|
*/
|
|
201
190
|
getAccountInfo(requestParameters: GetAccountInfoRequest, initOverrides?: RequestInit): Promise<AccountDataResponse>;
|
|
202
191
|
|
|
203
|
-
/**
|
|
204
|
-
* **NOTE:** This endpoint is deprecated in favor of [Non-Fungible Token holdings](#operation/get_nft_holdings). Retrieves a list of all nfts owned by an address, contains the clarity value of the identifier of the nft.
|
|
205
|
-
* @summary Get nft events
|
|
206
|
-
* @param {string} principal Stacks address or a Contract identifier
|
|
207
|
-
* @param {number} [limit] number of items to return
|
|
208
|
-
* @param {number} [offset] number of items to skip
|
|
209
|
-
* @param {boolean} [unanchored] Include transaction data from unanchored (i.e. unconfirmed) microblocks
|
|
210
|
-
* @param {string} [untilBlock] returned data representing the state up until that point in time, rather than the current block. Note - Use either of the query parameters but not both at a time.
|
|
211
|
-
* @param {*} [options] Override http request option.
|
|
212
|
-
* @throws {RequiredError}
|
|
213
|
-
* @memberof AccountsApiInterface
|
|
214
|
-
*/
|
|
215
|
-
getAccountNftRaw(requestParameters: GetAccountNftRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<AddressNftListResponse>>;
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* **NOTE:** This endpoint is deprecated in favor of [Non-Fungible Token holdings](#operation/get_nft_holdings). Retrieves a list of all nfts owned by an address, contains the clarity value of the identifier of the nft.
|
|
219
|
-
* Get nft events
|
|
220
|
-
*/
|
|
221
|
-
getAccountNft(requestParameters: GetAccountNftRequest, initOverrides?: RequestInit): Promise<AddressNftListResponse>;
|
|
222
|
-
|
|
223
192
|
/**
|
|
224
193
|
* Retrieves the latest nonce values used by an account by inspecting the mempool, microblock transactions, and anchored transactions.
|
|
225
194
|
* @summary Get the latest nonce used by an account
|
|
@@ -502,54 +471,6 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface
|
|
|
502
471
|
return await response.value();
|
|
503
472
|
}
|
|
504
473
|
|
|
505
|
-
/**
|
|
506
|
-
* **NOTE:** This endpoint is deprecated in favor of [Non-Fungible Token holdings](#operation/get_nft_holdings). Retrieves a list of all nfts owned by an address, contains the clarity value of the identifier of the nft.
|
|
507
|
-
* Get nft events
|
|
508
|
-
*/
|
|
509
|
-
async getAccountNftRaw(requestParameters: GetAccountNftRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<AddressNftListResponse>> {
|
|
510
|
-
if (requestParameters.principal === null || requestParameters.principal === undefined) {
|
|
511
|
-
throw new runtime.RequiredError('principal','Required parameter requestParameters.principal was null or undefined when calling getAccountNft.');
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
const queryParameters: any = {};
|
|
515
|
-
|
|
516
|
-
if (requestParameters.limit !== undefined) {
|
|
517
|
-
queryParameters['limit'] = requestParameters.limit;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
if (requestParameters.offset !== undefined) {
|
|
521
|
-
queryParameters['offset'] = requestParameters.offset;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
if (requestParameters.unanchored !== undefined) {
|
|
525
|
-
queryParameters['unanchored'] = requestParameters.unanchored;
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
if (requestParameters.untilBlock !== undefined) {
|
|
529
|
-
queryParameters['until_block'] = requestParameters.untilBlock;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
533
|
-
|
|
534
|
-
const response = await this.request({
|
|
535
|
-
path: `/extended/v1/address/{principal}/nft_events`.replace(`{${"principal"}}`, encodeURIComponent(String(requestParameters.principal))),
|
|
536
|
-
method: 'GET',
|
|
537
|
-
headers: headerParameters,
|
|
538
|
-
query: queryParameters,
|
|
539
|
-
}, initOverrides);
|
|
540
|
-
|
|
541
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => AddressNftListResponseFromJSON(jsonValue));
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
/**
|
|
545
|
-
* **NOTE:** This endpoint is deprecated in favor of [Non-Fungible Token holdings](#operation/get_nft_holdings). Retrieves a list of all nfts owned by an address, contains the clarity value of the identifier of the nft.
|
|
546
|
-
* Get nft events
|
|
547
|
-
*/
|
|
548
|
-
async getAccountNft(requestParameters: GetAccountNftRequest, initOverrides?: RequestInit): Promise<AddressNftListResponse> {
|
|
549
|
-
const response = await this.getAccountNftRaw(requestParameters, initOverrides);
|
|
550
|
-
return await response.value();
|
|
551
|
-
}
|
|
552
|
-
|
|
553
474
|
/**
|
|
554
475
|
* Retrieves the latest nonce values used by an account by inspecting the mempool, microblock transactions, and anchored transactions.
|
|
555
476
|
* Get the latest nonce used by an account
|
|
@@ -21,8 +21,18 @@ import {
|
|
|
21
21
|
BlockListResponse,
|
|
22
22
|
BlockListResponseFromJSON,
|
|
23
23
|
BlockListResponseToJSON,
|
|
24
|
+
NakamotoBlock,
|
|
25
|
+
NakamotoBlockFromJSON,
|
|
26
|
+
NakamotoBlockToJSON,
|
|
27
|
+
NakamotoBlockListResponse,
|
|
28
|
+
NakamotoBlockListResponseFromJSON,
|
|
29
|
+
NakamotoBlockListResponseToJSON,
|
|
24
30
|
} from '../models';
|
|
25
31
|
|
|
32
|
+
export interface GetBlockRequest {
|
|
33
|
+
heightOrHash: number | string;
|
|
34
|
+
}
|
|
35
|
+
|
|
26
36
|
export interface GetBlockByBurnBlockHashRequest {
|
|
27
37
|
burnBlockHash: string;
|
|
28
38
|
}
|
|
@@ -44,6 +54,17 @@ export interface GetBlockListRequest {
|
|
|
44
54
|
offset?: number;
|
|
45
55
|
}
|
|
46
56
|
|
|
57
|
+
export interface GetBlocksRequest {
|
|
58
|
+
limit?: number;
|
|
59
|
+
offset?: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface GetBlocksByBurnBlockRequest {
|
|
63
|
+
heightOrHash: number | string;
|
|
64
|
+
limit?: number;
|
|
65
|
+
offset?: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
47
68
|
/**
|
|
48
69
|
* BlocksApi - interface
|
|
49
70
|
*
|
|
@@ -52,7 +73,23 @@ export interface GetBlockListRequest {
|
|
|
52
73
|
*/
|
|
53
74
|
export interface BlocksApiInterface {
|
|
54
75
|
/**
|
|
55
|
-
* Retrieves
|
|
76
|
+
* Retrieves a single block
|
|
77
|
+
* @summary Get block
|
|
78
|
+
* @param {number | string} heightOrHash filter by block height, hash, index block hash or the constant `latest` to filter for the most recent block
|
|
79
|
+
* @param {*} [options] Override http request option.
|
|
80
|
+
* @throws {RequiredError}
|
|
81
|
+
* @memberof BlocksApiInterface
|
|
82
|
+
*/
|
|
83
|
+
getBlockRaw(requestParameters: GetBlockRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NakamotoBlock>>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Retrieves a single block
|
|
87
|
+
* Get block
|
|
88
|
+
*/
|
|
89
|
+
getBlock(requestParameters: GetBlockRequest, initOverrides?: RequestInit): Promise<NakamotoBlock>;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* **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
|
|
56
93
|
* @summary Get block by burnchain block hash
|
|
57
94
|
* @param {string} burnBlockHash Hash of the burnchain block
|
|
58
95
|
* @param {*} [options] Override http request option.
|
|
@@ -62,13 +99,13 @@ export interface BlocksApiInterface {
|
|
|
62
99
|
getBlockByBurnBlockHashRaw(requestParameters: GetBlockByBurnBlockHashRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Block>>;
|
|
63
100
|
|
|
64
101
|
/**
|
|
65
|
-
* Retrieves block details of a specific block for a given burnchain block hash
|
|
102
|
+
* **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
103
|
* Get block by burnchain block hash
|
|
67
104
|
*/
|
|
68
105
|
getBlockByBurnBlockHash(requestParameters: GetBlockByBurnBlockHashRequest, initOverrides?: RequestInit): Promise<Block>;
|
|
69
106
|
|
|
70
107
|
/**
|
|
71
|
-
* Retrieves block details of a specific block for a given burn chain height
|
|
108
|
+
* **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
|
|
72
109
|
* @summary Get block by burnchain height
|
|
73
110
|
* @param {number} burnBlockHeight Height of the burn chain block
|
|
74
111
|
* @param {*} [options] Override http request option.
|
|
@@ -78,13 +115,13 @@ export interface BlocksApiInterface {
|
|
|
78
115
|
getBlockByBurnBlockHeightRaw(requestParameters: GetBlockByBurnBlockHeightRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Block>>;
|
|
79
116
|
|
|
80
117
|
/**
|
|
81
|
-
* Retrieves block details of a specific block for a given burn chain height
|
|
118
|
+
* **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
119
|
* Get block by burnchain height
|
|
83
120
|
*/
|
|
84
121
|
getBlockByBurnBlockHeight(requestParameters: GetBlockByBurnBlockHeightRequest, initOverrides?: RequestInit): Promise<Block>;
|
|
85
122
|
|
|
86
123
|
/**
|
|
87
|
-
* Retrieves block details of a specific block for a given chain height. You can use the hash from your latest block (\'get_block_list\' API) to get your block details.
|
|
124
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get block](#operation/get_block). Retrieves block details of a specific block for a given chain height. You can use the hash from your latest block (\'get_block_list\' API) to get your block details.
|
|
88
125
|
* @summary Get block by hash
|
|
89
126
|
* @param {string} hash Hash of the block
|
|
90
127
|
* @param {*} [options] Override http request option.
|
|
@@ -94,13 +131,13 @@ export interface BlocksApiInterface {
|
|
|
94
131
|
getBlockByHashRaw(requestParameters: GetBlockByHashRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Block>>;
|
|
95
132
|
|
|
96
133
|
/**
|
|
97
|
-
* Retrieves block details of a specific block for a given chain height. You can use the hash from your latest block (\'get_block_list\' API) to get your block details.
|
|
134
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get block](#operation/get_block). Retrieves block details of a specific block for a given chain height. You can use the hash from your latest block (\'get_block_list\' API) to get your block details.
|
|
98
135
|
* Get block by hash
|
|
99
136
|
*/
|
|
100
137
|
getBlockByHash(requestParameters: GetBlockByHashRequest, initOverrides?: RequestInit): Promise<Block>;
|
|
101
138
|
|
|
102
139
|
/**
|
|
103
|
-
* Retrieves block details of a specific block at a given block height
|
|
140
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get block](#operation/get_block). Retrieves block details of a specific block at a given block height
|
|
104
141
|
* @summary Get block by height
|
|
105
142
|
* @param {number} height Height of the block
|
|
106
143
|
* @param {*} [options] Override http request option.
|
|
@@ -110,13 +147,13 @@ export interface BlocksApiInterface {
|
|
|
110
147
|
getBlockByHeightRaw(requestParameters: GetBlockByHeightRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Block>>;
|
|
111
148
|
|
|
112
149
|
/**
|
|
113
|
-
* Retrieves block details of a specific block at a given block height
|
|
150
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get block](#operation/get_block). Retrieves block details of a specific block at a given block height
|
|
114
151
|
* Get block by height
|
|
115
152
|
*/
|
|
116
153
|
getBlockByHeight(requestParameters: GetBlockByHeightRequest, initOverrides?: RequestInit): Promise<Block>;
|
|
117
154
|
|
|
118
155
|
/**
|
|
119
|
-
* 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.
|
|
156
|
+
* **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.
|
|
120
157
|
* @summary Get recent blocks
|
|
121
158
|
* @param {number} [limit] max number of blocks to fetch
|
|
122
159
|
* @param {number} [offset] index of first block to fetch
|
|
@@ -127,11 +164,46 @@ export interface BlocksApiInterface {
|
|
|
127
164
|
getBlockListRaw(requestParameters: GetBlockListRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BlockListResponse>>;
|
|
128
165
|
|
|
129
166
|
/**
|
|
130
|
-
* 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.
|
|
167
|
+
* **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.
|
|
131
168
|
* Get recent blocks
|
|
132
169
|
*/
|
|
133
170
|
getBlockList(requestParameters: GetBlockListRequest, initOverrides?: RequestInit): Promise<BlockListResponse>;
|
|
134
171
|
|
|
172
|
+
/**
|
|
173
|
+
* Retrieves a list of recently mined blocks
|
|
174
|
+
* @summary Get blocks
|
|
175
|
+
* @param {number} [limit] max number of blocks to fetch
|
|
176
|
+
* @param {number} [offset] index of first burn block to fetch
|
|
177
|
+
* @param {*} [options] Override http request option.
|
|
178
|
+
* @throws {RequiredError}
|
|
179
|
+
* @memberof BlocksApiInterface
|
|
180
|
+
*/
|
|
181
|
+
getBlocksRaw(requestParameters: GetBlocksRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NakamotoBlockListResponse>>;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Retrieves a list of recently mined blocks
|
|
185
|
+
* Get blocks
|
|
186
|
+
*/
|
|
187
|
+
getBlocks(requestParameters: GetBlocksRequest, initOverrides?: RequestInit): Promise<NakamotoBlockListResponse>;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Retrieves a list of blocks confirmed by a specific burn block
|
|
191
|
+
* @summary Get blocks by burn block
|
|
192
|
+
* @param {number | string} heightOrHash filter by burn block height, hash, or the constant `latest` to filter for the most recent burn block
|
|
193
|
+
* @param {number} [limit] max number of blocks to fetch
|
|
194
|
+
* @param {number} [offset] index of first burn block to fetch
|
|
195
|
+
* @param {*} [options] Override http request option.
|
|
196
|
+
* @throws {RequiredError}
|
|
197
|
+
* @memberof BlocksApiInterface
|
|
198
|
+
*/
|
|
199
|
+
getBlocksByBurnBlockRaw(requestParameters: GetBlocksByBurnBlockRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NakamotoBlockListResponse>>;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Retrieves a list of blocks confirmed by a specific burn block
|
|
203
|
+
* Get blocks by burn block
|
|
204
|
+
*/
|
|
205
|
+
getBlocksByBurnBlock(requestParameters: GetBlocksByBurnBlockRequest, initOverrides?: RequestInit): Promise<NakamotoBlockListResponse>;
|
|
206
|
+
|
|
135
207
|
}
|
|
136
208
|
|
|
137
209
|
/**
|
|
@@ -140,7 +212,39 @@ export interface BlocksApiInterface {
|
|
|
140
212
|
export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
141
213
|
|
|
142
214
|
/**
|
|
143
|
-
* Retrieves
|
|
215
|
+
* Retrieves a single block
|
|
216
|
+
* Get block
|
|
217
|
+
*/
|
|
218
|
+
async getBlockRaw(requestParameters: GetBlockRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NakamotoBlock>> {
|
|
219
|
+
if (requestParameters.heightOrHash === null || requestParameters.heightOrHash === undefined) {
|
|
220
|
+
throw new runtime.RequiredError('heightOrHash','Required parameter requestParameters.heightOrHash was null or undefined when calling getBlock.');
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const queryParameters: any = {};
|
|
224
|
+
|
|
225
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
226
|
+
|
|
227
|
+
const response = await this.request({
|
|
228
|
+
path: `/extended/v2/blocks/{height_or_hash}`.replace(`{${"height_or_hash"}}`, encodeURIComponent(String(requestParameters.heightOrHash))),
|
|
229
|
+
method: 'GET',
|
|
230
|
+
headers: headerParameters,
|
|
231
|
+
query: queryParameters,
|
|
232
|
+
}, initOverrides);
|
|
233
|
+
|
|
234
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => NakamotoBlockFromJSON(jsonValue));
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Retrieves a single block
|
|
239
|
+
* Get block
|
|
240
|
+
*/
|
|
241
|
+
async getBlock(requestParameters: GetBlockRequest, initOverrides?: RequestInit): Promise<NakamotoBlock> {
|
|
242
|
+
const response = await this.getBlockRaw(requestParameters, initOverrides);
|
|
243
|
+
return await response.value();
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* **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
|
|
144
248
|
* Get block by burnchain block hash
|
|
145
249
|
*/
|
|
146
250
|
async getBlockByBurnBlockHashRaw(requestParameters: GetBlockByBurnBlockHashRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Block>> {
|
|
@@ -163,7 +267,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
163
267
|
}
|
|
164
268
|
|
|
165
269
|
/**
|
|
166
|
-
* Retrieves block details of a specific block for a given burnchain block hash
|
|
270
|
+
* **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
|
|
167
271
|
* Get block by burnchain block hash
|
|
168
272
|
*/
|
|
169
273
|
async getBlockByBurnBlockHash(requestParameters: GetBlockByBurnBlockHashRequest, initOverrides?: RequestInit): Promise<Block> {
|
|
@@ -172,7 +276,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
172
276
|
}
|
|
173
277
|
|
|
174
278
|
/**
|
|
175
|
-
* Retrieves block details of a specific block for a given burn chain height
|
|
279
|
+
* **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
|
|
176
280
|
* Get block by burnchain height
|
|
177
281
|
*/
|
|
178
282
|
async getBlockByBurnBlockHeightRaw(requestParameters: GetBlockByBurnBlockHeightRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Block>> {
|
|
@@ -195,7 +299,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
195
299
|
}
|
|
196
300
|
|
|
197
301
|
/**
|
|
198
|
-
* Retrieves block details of a specific block for a given burn chain height
|
|
302
|
+
* **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
|
|
199
303
|
* Get block by burnchain height
|
|
200
304
|
*/
|
|
201
305
|
async getBlockByBurnBlockHeight(requestParameters: GetBlockByBurnBlockHeightRequest, initOverrides?: RequestInit): Promise<Block> {
|
|
@@ -204,7 +308,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
204
308
|
}
|
|
205
309
|
|
|
206
310
|
/**
|
|
207
|
-
* Retrieves block details of a specific block for a given chain height. You can use the hash from your latest block (\'get_block_list\' API) to get your block details.
|
|
311
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get block](#operation/get_block). Retrieves block details of a specific block for a given chain height. You can use the hash from your latest block (\'get_block_list\' API) to get your block details.
|
|
208
312
|
* Get block by hash
|
|
209
313
|
*/
|
|
210
314
|
async getBlockByHashRaw(requestParameters: GetBlockByHashRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Block>> {
|
|
@@ -227,7 +331,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
227
331
|
}
|
|
228
332
|
|
|
229
333
|
/**
|
|
230
|
-
* Retrieves block details of a specific block for a given chain height. You can use the hash from your latest block (\'get_block_list\' API) to get your block details.
|
|
334
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get block](#operation/get_block). Retrieves block details of a specific block for a given chain height. You can use the hash from your latest block (\'get_block_list\' API) to get your block details.
|
|
231
335
|
* Get block by hash
|
|
232
336
|
*/
|
|
233
337
|
async getBlockByHash(requestParameters: GetBlockByHashRequest, initOverrides?: RequestInit): Promise<Block> {
|
|
@@ -236,7 +340,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
236
340
|
}
|
|
237
341
|
|
|
238
342
|
/**
|
|
239
|
-
* Retrieves block details of a specific block at a given block height
|
|
343
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get block](#operation/get_block). Retrieves block details of a specific block at a given block height
|
|
240
344
|
* Get block by height
|
|
241
345
|
*/
|
|
242
346
|
async getBlockByHeightRaw(requestParameters: GetBlockByHeightRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Block>> {
|
|
@@ -259,7 +363,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
259
363
|
}
|
|
260
364
|
|
|
261
365
|
/**
|
|
262
|
-
* Retrieves block details of a specific block at a given block height
|
|
366
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get block](#operation/get_block). Retrieves block details of a specific block at a given block height
|
|
263
367
|
* Get block by height
|
|
264
368
|
*/
|
|
265
369
|
async getBlockByHeight(requestParameters: GetBlockByHeightRequest, initOverrides?: RequestInit): Promise<Block> {
|
|
@@ -268,7 +372,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
268
372
|
}
|
|
269
373
|
|
|
270
374
|
/**
|
|
271
|
-
* 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.
|
|
272
376
|
* Get recent blocks
|
|
273
377
|
*/
|
|
274
378
|
async getBlockListRaw(requestParameters: GetBlockListRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BlockListResponse>> {
|
|
@@ -295,7 +399,7 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
295
399
|
}
|
|
296
400
|
|
|
297
401
|
/**
|
|
298
|
-
* 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.
|
|
402
|
+
* **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.
|
|
299
403
|
* Get recent blocks
|
|
300
404
|
*/
|
|
301
405
|
async getBlockList(requestParameters: GetBlockListRequest, initOverrides?: RequestInit): Promise<BlockListResponse> {
|
|
@@ -303,4 +407,80 @@ export class BlocksApi extends runtime.BaseAPI implements BlocksApiInterface {
|
|
|
303
407
|
return await response.value();
|
|
304
408
|
}
|
|
305
409
|
|
|
410
|
+
/**
|
|
411
|
+
* Retrieves a list of recently mined blocks
|
|
412
|
+
* Get blocks
|
|
413
|
+
*/
|
|
414
|
+
async getBlocksRaw(requestParameters: GetBlocksRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NakamotoBlockListResponse>> {
|
|
415
|
+
const queryParameters: any = {};
|
|
416
|
+
|
|
417
|
+
if (requestParameters.limit !== undefined) {
|
|
418
|
+
queryParameters['limit'] = requestParameters.limit;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
if (requestParameters.offset !== undefined) {
|
|
422
|
+
queryParameters['offset'] = requestParameters.offset;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
426
|
+
|
|
427
|
+
const response = await this.request({
|
|
428
|
+
path: `/extended/v2/blocks`,
|
|
429
|
+
method: 'GET',
|
|
430
|
+
headers: headerParameters,
|
|
431
|
+
query: queryParameters,
|
|
432
|
+
}, initOverrides);
|
|
433
|
+
|
|
434
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => NakamotoBlockListResponseFromJSON(jsonValue));
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Retrieves a list of recently mined blocks
|
|
439
|
+
* Get blocks
|
|
440
|
+
*/
|
|
441
|
+
async getBlocks(requestParameters: GetBlocksRequest, initOverrides?: RequestInit): Promise<NakamotoBlockListResponse> {
|
|
442
|
+
const response = await this.getBlocksRaw(requestParameters, initOverrides);
|
|
443
|
+
return await response.value();
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Retrieves a list of blocks confirmed by a specific burn block
|
|
448
|
+
* Get blocks by burn block
|
|
449
|
+
*/
|
|
450
|
+
async getBlocksByBurnBlockRaw(requestParameters: GetBlocksByBurnBlockRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NakamotoBlockListResponse>> {
|
|
451
|
+
if (requestParameters.heightOrHash === null || requestParameters.heightOrHash === undefined) {
|
|
452
|
+
throw new runtime.RequiredError('heightOrHash','Required parameter requestParameters.heightOrHash was null or undefined when calling getBlocksByBurnBlock.');
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
const queryParameters: any = {};
|
|
456
|
+
|
|
457
|
+
if (requestParameters.limit !== undefined) {
|
|
458
|
+
queryParameters['limit'] = requestParameters.limit;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
if (requestParameters.offset !== undefined) {
|
|
462
|
+
queryParameters['offset'] = requestParameters.offset;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
466
|
+
|
|
467
|
+
const response = await this.request({
|
|
468
|
+
path: `/extended/v2/burn-blocks/{height_or_hash}/blocks`.replace(`{${"height_or_hash"}}`, encodeURIComponent(String(requestParameters.heightOrHash))),
|
|
469
|
+
method: 'GET',
|
|
470
|
+
headers: headerParameters,
|
|
471
|
+
query: queryParameters,
|
|
472
|
+
}, initOverrides);
|
|
473
|
+
|
|
474
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => NakamotoBlockListResponseFromJSON(jsonValue));
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Retrieves a list of blocks confirmed by a specific burn block
|
|
479
|
+
* Get blocks by burn block
|
|
480
|
+
*/
|
|
481
|
+
async getBlocksByBurnBlock(requestParameters: GetBlocksByBurnBlockRequest, initOverrides?: RequestInit): Promise<NakamotoBlockListResponse> {
|
|
482
|
+
const response = await this.getBlocksByBurnBlockRaw(requestParameters, initOverrides);
|
|
483
|
+
return await response.value();
|
|
484
|
+
}
|
|
485
|
+
|
|
306
486
|
}
|