@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
|
@@ -0,0 +1,150 @@
|
|
|
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
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import {
|
|
18
|
+
BurnBlock,
|
|
19
|
+
BurnBlockFromJSON,
|
|
20
|
+
BurnBlockToJSON,
|
|
21
|
+
BurnBlockListResponse,
|
|
22
|
+
BurnBlockListResponseFromJSON,
|
|
23
|
+
BurnBlockListResponseToJSON,
|
|
24
|
+
} from '../models';
|
|
25
|
+
|
|
26
|
+
export interface GetBurnBlockRequest {
|
|
27
|
+
heightOrHash: number | string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface GetBurnBlocksRequest {
|
|
31
|
+
limit?: number;
|
|
32
|
+
offset?: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* BurnBlocksApi - interface
|
|
37
|
+
*
|
|
38
|
+
* @export
|
|
39
|
+
* @interface BurnBlocksApiInterface
|
|
40
|
+
*/
|
|
41
|
+
export interface BurnBlocksApiInterface {
|
|
42
|
+
/**
|
|
43
|
+
* Retrieves a single burn block
|
|
44
|
+
* @summary Get burn block
|
|
45
|
+
* @param {number | string} heightOrHash filter by burn block height, hash, or the constant `latest` to filter for the most recent burn block
|
|
46
|
+
* @param {*} [options] Override http request option.
|
|
47
|
+
* @throws {RequiredError}
|
|
48
|
+
* @memberof BurnBlocksApiInterface
|
|
49
|
+
*/
|
|
50
|
+
getBurnBlockRaw(requestParameters: GetBurnBlockRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BurnBlock>>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Retrieves a single burn block
|
|
54
|
+
* Get burn block
|
|
55
|
+
*/
|
|
56
|
+
getBurnBlock(requestParameters: GetBurnBlockRequest, initOverrides?: RequestInit): Promise<BurnBlock>;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Retrieves a list of recent burn blocks
|
|
60
|
+
* @summary Get burn blocks
|
|
61
|
+
* @param {number} [limit] max number of burn blocks to fetch
|
|
62
|
+
* @param {number} [offset] index of first burn block to fetch
|
|
63
|
+
* @param {*} [options] Override http request option.
|
|
64
|
+
* @throws {RequiredError}
|
|
65
|
+
* @memberof BurnBlocksApiInterface
|
|
66
|
+
*/
|
|
67
|
+
getBurnBlocksRaw(requestParameters: GetBurnBlocksRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BurnBlockListResponse>>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Retrieves a list of recent burn blocks
|
|
71
|
+
* Get burn blocks
|
|
72
|
+
*/
|
|
73
|
+
getBurnBlocks(requestParameters: GetBurnBlocksRequest, initOverrides?: RequestInit): Promise<BurnBlockListResponse>;
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
*/
|
|
80
|
+
export class BurnBlocksApi extends runtime.BaseAPI implements BurnBlocksApiInterface {
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Retrieves a single burn block
|
|
84
|
+
* Get burn block
|
|
85
|
+
*/
|
|
86
|
+
async getBurnBlockRaw(requestParameters: GetBurnBlockRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BurnBlock>> {
|
|
87
|
+
if (requestParameters.heightOrHash === null || requestParameters.heightOrHash === undefined) {
|
|
88
|
+
throw new runtime.RequiredError('heightOrHash','Required parameter requestParameters.heightOrHash was null or undefined when calling getBurnBlock.');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const queryParameters: any = {};
|
|
92
|
+
|
|
93
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
94
|
+
|
|
95
|
+
const response = await this.request({
|
|
96
|
+
path: `/extended/v2/burn-blocks/{height_or_hash}`.replace(`{${"height_or_hash"}}`, encodeURIComponent(String(requestParameters.heightOrHash))),
|
|
97
|
+
method: 'GET',
|
|
98
|
+
headers: headerParameters,
|
|
99
|
+
query: queryParameters,
|
|
100
|
+
}, initOverrides);
|
|
101
|
+
|
|
102
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => BurnBlockFromJSON(jsonValue));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Retrieves a single burn block
|
|
107
|
+
* Get burn block
|
|
108
|
+
*/
|
|
109
|
+
async getBurnBlock(requestParameters: GetBurnBlockRequest, initOverrides?: RequestInit): Promise<BurnBlock> {
|
|
110
|
+
const response = await this.getBurnBlockRaw(requestParameters, initOverrides);
|
|
111
|
+
return await response.value();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Retrieves a list of recent burn blocks
|
|
116
|
+
* Get burn blocks
|
|
117
|
+
*/
|
|
118
|
+
async getBurnBlocksRaw(requestParameters: GetBurnBlocksRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BurnBlockListResponse>> {
|
|
119
|
+
const queryParameters: any = {};
|
|
120
|
+
|
|
121
|
+
if (requestParameters.limit !== undefined) {
|
|
122
|
+
queryParameters['limit'] = requestParameters.limit;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (requestParameters.offset !== undefined) {
|
|
126
|
+
queryParameters['offset'] = requestParameters.offset;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
130
|
+
|
|
131
|
+
const response = await this.request({
|
|
132
|
+
path: `/extended/v2/burn-blocks`,
|
|
133
|
+
method: 'GET',
|
|
134
|
+
headers: headerParameters,
|
|
135
|
+
query: queryParameters,
|
|
136
|
+
}, initOverrides);
|
|
137
|
+
|
|
138
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => BurnBlockListResponseFromJSON(jsonValue));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Retrieves a list of recent burn blocks
|
|
143
|
+
* Get burn blocks
|
|
144
|
+
*/
|
|
145
|
+
async getBurnBlocks(requestParameters: GetBurnBlocksRequest, initOverrides?: RequestInit): Promise<BurnBlockListResponse> {
|
|
146
|
+
const response = await this.getBurnBlocksRaw(requestParameters, initOverrides);
|
|
147
|
+
return await response.value();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
}
|
|
@@ -21,21 +21,11 @@ import {
|
|
|
21
21
|
NonFungibleTokenHoldingsList,
|
|
22
22
|
NonFungibleTokenHoldingsListFromJSON,
|
|
23
23
|
NonFungibleTokenHoldingsListToJSON,
|
|
24
|
-
NonFungibleTokenMetadata,
|
|
25
|
-
NonFungibleTokenMetadataFromJSON,
|
|
26
|
-
NonFungibleTokenMetadataToJSON,
|
|
27
24
|
NonFungibleTokenMintList,
|
|
28
25
|
NonFungibleTokenMintListFromJSON,
|
|
29
26
|
NonFungibleTokenMintListToJSON,
|
|
30
|
-
NonFungibleTokensMetadataList,
|
|
31
|
-
NonFungibleTokensMetadataListFromJSON,
|
|
32
|
-
NonFungibleTokensMetadataListToJSON,
|
|
33
27
|
} from '../models';
|
|
34
28
|
|
|
35
|
-
export interface GetContractNftMetadataRequest {
|
|
36
|
-
contractId: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
29
|
export interface GetNftHistoryRequest {
|
|
40
30
|
assetIdentifier: string;
|
|
41
31
|
value: string;
|
|
@@ -54,11 +44,6 @@ export interface GetNftHoldingsRequest {
|
|
|
54
44
|
txMetadata?: boolean;
|
|
55
45
|
}
|
|
56
46
|
|
|
57
|
-
export interface GetNftMetadataListRequest {
|
|
58
|
-
limit?: number;
|
|
59
|
-
offset?: number;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
47
|
export interface GetNftMintsRequest {
|
|
63
48
|
assetIdentifier: string;
|
|
64
49
|
limit?: number;
|
|
@@ -74,22 +59,6 @@ export interface GetNftMintsRequest {
|
|
|
74
59
|
* @interface NonFungibleTokensApiInterface
|
|
75
60
|
*/
|
|
76
61
|
export interface NonFungibleTokensApiInterface {
|
|
77
|
-
/**
|
|
78
|
-
* **NOTE:** This endpoint is deprecated in favor of the [Token Metadata Service](https://github.com/hirosystems/token-metadata-service). Retrieves metadata for non fungible tokens for a given contract id. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
|
|
79
|
-
* @summary Non fungible tokens metadata for contract ID
|
|
80
|
-
* @param {string} contractId token\'s contract id
|
|
81
|
-
* @param {*} [options] Override http request option.
|
|
82
|
-
* @throws {RequiredError}
|
|
83
|
-
* @memberof NonFungibleTokensApiInterface
|
|
84
|
-
*/
|
|
85
|
-
getContractNftMetadataRaw(requestParameters: GetContractNftMetadataRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NonFungibleTokenMetadata>>;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* **NOTE:** This endpoint is deprecated in favor of the [Token Metadata Service](https://github.com/hirosystems/token-metadata-service). Retrieves metadata for non fungible tokens for a given contract id. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
|
|
89
|
-
* Non fungible tokens metadata for contract ID
|
|
90
|
-
*/
|
|
91
|
-
getContractNftMetadata(requestParameters: GetContractNftMetadataRequest, initOverrides?: RequestInit): Promise<NonFungibleTokenMetadata>;
|
|
92
|
-
|
|
93
62
|
/**
|
|
94
63
|
* Retrieves all events relevant to a Non-Fungible Token. Useful to determine the ownership history of a particular asset. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
|
|
95
64
|
* @summary Non-Fungible Token history
|
|
@@ -132,23 +101,6 @@ export interface NonFungibleTokensApiInterface {
|
|
|
132
101
|
*/
|
|
133
102
|
getNftHoldings(requestParameters: GetNftHoldingsRequest, initOverrides?: RequestInit): Promise<NonFungibleTokenHoldingsList>;
|
|
134
103
|
|
|
135
|
-
/**
|
|
136
|
-
* **NOTE:** This endpoint is deprecated in favor of the [Token Metadata Service](https://github.com/hirosystems/token-metadata-service). Retrieves a list of non fungible tokens with their metadata. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
|
|
137
|
-
* @summary Non fungible tokens metadata list
|
|
138
|
-
* @param {number} [limit] max number of tokens to fetch
|
|
139
|
-
* @param {number} [offset] index of first tokens to fetch
|
|
140
|
-
* @param {*} [options] Override http request option.
|
|
141
|
-
* @throws {RequiredError}
|
|
142
|
-
* @memberof NonFungibleTokensApiInterface
|
|
143
|
-
*/
|
|
144
|
-
getNftMetadataListRaw(requestParameters: GetNftMetadataListRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NonFungibleTokensMetadataList>>;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* **NOTE:** This endpoint is deprecated in favor of the [Token Metadata Service](https://github.com/hirosystems/token-metadata-service). Retrieves a list of non fungible tokens with their metadata. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
|
|
148
|
-
* Non fungible tokens metadata list
|
|
149
|
-
*/
|
|
150
|
-
getNftMetadataList(requestParameters: GetNftMetadataListRequest, initOverrides?: RequestInit): Promise<NonFungibleTokensMetadataList>;
|
|
151
|
-
|
|
152
104
|
/**
|
|
153
105
|
* Retrieves all mint events for a Non-Fungible Token asset class. Useful to determine which NFTs of a particular collection have been claimed. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
|
|
154
106
|
* @summary Non-Fungible Token mints
|
|
@@ -176,38 +128,6 @@ export interface NonFungibleTokensApiInterface {
|
|
|
176
128
|
*/
|
|
177
129
|
export class NonFungibleTokensApi extends runtime.BaseAPI implements NonFungibleTokensApiInterface {
|
|
178
130
|
|
|
179
|
-
/**
|
|
180
|
-
* **NOTE:** This endpoint is deprecated in favor of the [Token Metadata Service](https://github.com/hirosystems/token-metadata-service). Retrieves metadata for non fungible tokens for a given contract id. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
|
|
181
|
-
* Non fungible tokens metadata for contract ID
|
|
182
|
-
*/
|
|
183
|
-
async getContractNftMetadataRaw(requestParameters: GetContractNftMetadataRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NonFungibleTokenMetadata>> {
|
|
184
|
-
if (requestParameters.contractId === null || requestParameters.contractId === undefined) {
|
|
185
|
-
throw new runtime.RequiredError('contractId','Required parameter requestParameters.contractId was null or undefined when calling getContractNftMetadata.');
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
const queryParameters: any = {};
|
|
189
|
-
|
|
190
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
191
|
-
|
|
192
|
-
const response = await this.request({
|
|
193
|
-
path: `/extended/v1/tokens/{contractId}/nft/metadata`.replace(`{${"contractId"}}`, encodeURIComponent(String(requestParameters.contractId))),
|
|
194
|
-
method: 'GET',
|
|
195
|
-
headers: headerParameters,
|
|
196
|
-
query: queryParameters,
|
|
197
|
-
}, initOverrides);
|
|
198
|
-
|
|
199
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => NonFungibleTokenMetadataFromJSON(jsonValue));
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* **NOTE:** This endpoint is deprecated in favor of the [Token Metadata Service](https://github.com/hirosystems/token-metadata-service). Retrieves metadata for non fungible tokens for a given contract id. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
|
|
204
|
-
* Non fungible tokens metadata for contract ID
|
|
205
|
-
*/
|
|
206
|
-
async getContractNftMetadata(requestParameters: GetContractNftMetadataRequest, initOverrides?: RequestInit): Promise<NonFungibleTokenMetadata> {
|
|
207
|
-
const response = await this.getContractNftMetadataRaw(requestParameters, initOverrides);
|
|
208
|
-
return await response.value();
|
|
209
|
-
}
|
|
210
|
-
|
|
211
131
|
/**
|
|
212
132
|
* Retrieves all events relevant to a Non-Fungible Token. Useful to determine the ownership history of a particular asset. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
|
|
213
133
|
* Non-Fungible Token history
|
|
@@ -324,42 +244,6 @@ export class NonFungibleTokensApi extends runtime.BaseAPI implements NonFungible
|
|
|
324
244
|
return await response.value();
|
|
325
245
|
}
|
|
326
246
|
|
|
327
|
-
/**
|
|
328
|
-
* **NOTE:** This endpoint is deprecated in favor of the [Token Metadata Service](https://github.com/hirosystems/token-metadata-service). Retrieves a list of non fungible tokens with their metadata. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
|
|
329
|
-
* Non fungible tokens metadata list
|
|
330
|
-
*/
|
|
331
|
-
async getNftMetadataListRaw(requestParameters: GetNftMetadataListRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NonFungibleTokensMetadataList>> {
|
|
332
|
-
const queryParameters: any = {};
|
|
333
|
-
|
|
334
|
-
if (requestParameters.limit !== undefined) {
|
|
335
|
-
queryParameters['limit'] = requestParameters.limit;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
if (requestParameters.offset !== undefined) {
|
|
339
|
-
queryParameters['offset'] = requestParameters.offset;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
343
|
-
|
|
344
|
-
const response = await this.request({
|
|
345
|
-
path: `/extended/v1/tokens/nft/metadata`,
|
|
346
|
-
method: 'GET',
|
|
347
|
-
headers: headerParameters,
|
|
348
|
-
query: queryParameters,
|
|
349
|
-
}, initOverrides);
|
|
350
|
-
|
|
351
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => NonFungibleTokensMetadataListFromJSON(jsonValue));
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* **NOTE:** This endpoint is deprecated in favor of the [Token Metadata Service](https://github.com/hirosystems/token-metadata-service). Retrieves a list of non fungible tokens with their metadata. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
|
|
356
|
-
* Non fungible tokens metadata list
|
|
357
|
-
*/
|
|
358
|
-
async getNftMetadataList(requestParameters: GetNftMetadataListRequest, initOverrides?: RequestInit): Promise<NonFungibleTokensMetadataList> {
|
|
359
|
-
const response = await this.getNftMetadataListRaw(requestParameters, initOverrides);
|
|
360
|
-
return await response.value();
|
|
361
|
-
}
|
|
362
|
-
|
|
363
247
|
/**
|
|
364
248
|
* Retrieves all mint events for a Non-Fungible Token asset class. Useful to determine which NFTs of a particular collection have been claimed. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
|
|
365
249
|
* Non-Fungible Token mints
|
|
@@ -82,6 +82,10 @@ export interface GetTransactionListRequest {
|
|
|
82
82
|
unanchored?: boolean;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
export interface GetTransactionsByBlockRequest {
|
|
86
|
+
heightOrHash: number | string;
|
|
87
|
+
}
|
|
88
|
+
|
|
85
89
|
export interface GetTransactionsByBlockHashRequest {
|
|
86
90
|
blockHash: string;
|
|
87
91
|
limit?: number;
|
|
@@ -245,7 +249,7 @@ export interface TransactionsApiInterface {
|
|
|
245
249
|
* @summary Get recent transactions
|
|
246
250
|
* @param {number} [limit] max number of transactions to fetch
|
|
247
251
|
* @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
|
|
252
|
+
* @param {Array<'coinbase' | 'token_transfer' | 'smart_contract' | 'contract_call' | 'poison_microblock' | 'tenure_change'>} [type] Filter by transaction type
|
|
249
253
|
* @param {boolean} [unanchored] Include transaction data from unanchored (i.e. unconfirmed) microblocks
|
|
250
254
|
* @param {*} [options] Override http request option.
|
|
251
255
|
* @throws {RequiredError}
|
|
@@ -260,7 +264,23 @@ export interface TransactionsApiInterface {
|
|
|
260
264
|
getTransactionList(requestParameters: GetTransactionListRequest, initOverrides?: RequestInit): Promise<TransactionResults>;
|
|
261
265
|
|
|
262
266
|
/**
|
|
263
|
-
* Retrieves
|
|
267
|
+
* Retrieves transactions confirmed in a single block
|
|
268
|
+
* @summary Get transactions by block
|
|
269
|
+
* @param {number | string} heightOrHash filter by block height, hash, index block hash or the constant `latest` to filter for the most recent block
|
|
270
|
+
* @param {*} [options] Override http request option.
|
|
271
|
+
* @throws {RequiredError}
|
|
272
|
+
* @memberof TransactionsApiInterface
|
|
273
|
+
*/
|
|
274
|
+
getTransactionsByBlockRaw(requestParameters: GetTransactionsByBlockRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<TransactionResults>>;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Retrieves transactions confirmed in a single block
|
|
278
|
+
* Get transactions by block
|
|
279
|
+
*/
|
|
280
|
+
getTransactionsByBlock(requestParameters: GetTransactionsByBlockRequest, initOverrides?: RequestInit): Promise<TransactionResults>;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get transactions by block](#operation/get_transactions_by_block). Retrieves a list of all transactions within a block for a given block hash.
|
|
264
284
|
* @summary Transactions by block hash
|
|
265
285
|
* @param {string} blockHash Hash of block
|
|
266
286
|
* @param {number} [limit] max number of transactions to fetch
|
|
@@ -272,13 +292,13 @@ export interface TransactionsApiInterface {
|
|
|
272
292
|
getTransactionsByBlockHashRaw(requestParameters: GetTransactionsByBlockHashRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<TransactionResults>>;
|
|
273
293
|
|
|
274
294
|
/**
|
|
275
|
-
* Retrieves a list of all transactions within a block for a given block hash.
|
|
295
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get transactions by block](#operation/get_transactions_by_block). Retrieves a list of all transactions within a block for a given block hash.
|
|
276
296
|
* Transactions by block hash
|
|
277
297
|
*/
|
|
278
298
|
getTransactionsByBlockHash(requestParameters: GetTransactionsByBlockHashRequest, initOverrides?: RequestInit): Promise<TransactionResults>;
|
|
279
299
|
|
|
280
300
|
/**
|
|
281
|
-
* Retrieves all transactions within a block at a given height
|
|
301
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get transactions by block](#operation/get_transactions_by_block). Retrieves all transactions within a block at a given height
|
|
282
302
|
* @summary Transactions by block height
|
|
283
303
|
* @param {number} height Height of block
|
|
284
304
|
* @param {number} [limit] max number of transactions to fetch
|
|
@@ -291,7 +311,7 @@ export interface TransactionsApiInterface {
|
|
|
291
311
|
getTransactionsByBlockHeightRaw(requestParameters: GetTransactionsByBlockHeightRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<TransactionResults>>;
|
|
292
312
|
|
|
293
313
|
/**
|
|
294
|
-
* Retrieves all transactions within a block at a given height
|
|
314
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get transactions by block](#operation/get_transactions_by_block). Retrieves all transactions within a block at a given height
|
|
295
315
|
* Transactions by block height
|
|
296
316
|
*/
|
|
297
317
|
getTransactionsByBlockHeight(requestParameters: GetTransactionsByBlockHeightRequest, initOverrides?: RequestInit): Promise<TransactionResults>;
|
|
@@ -667,7 +687,39 @@ export class TransactionsApi extends runtime.BaseAPI implements TransactionsApiI
|
|
|
667
687
|
}
|
|
668
688
|
|
|
669
689
|
/**
|
|
670
|
-
* Retrieves
|
|
690
|
+
* Retrieves transactions confirmed in a single block
|
|
691
|
+
* Get transactions by block
|
|
692
|
+
*/
|
|
693
|
+
async getTransactionsByBlockRaw(requestParameters: GetTransactionsByBlockRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<TransactionResults>> {
|
|
694
|
+
if (requestParameters.heightOrHash === null || requestParameters.heightOrHash === undefined) {
|
|
695
|
+
throw new runtime.RequiredError('heightOrHash','Required parameter requestParameters.heightOrHash was null or undefined when calling getTransactionsByBlock.');
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
const queryParameters: any = {};
|
|
699
|
+
|
|
700
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
701
|
+
|
|
702
|
+
const response = await this.request({
|
|
703
|
+
path: `/extended/v2/blocks/{height_or_hash}/transactions`.replace(`{${"height_or_hash"}}`, encodeURIComponent(String(requestParameters.heightOrHash))),
|
|
704
|
+
method: 'GET',
|
|
705
|
+
headers: headerParameters,
|
|
706
|
+
query: queryParameters,
|
|
707
|
+
}, initOverrides);
|
|
708
|
+
|
|
709
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => TransactionResultsFromJSON(jsonValue));
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* Retrieves transactions confirmed in a single block
|
|
714
|
+
* Get transactions by block
|
|
715
|
+
*/
|
|
716
|
+
async getTransactionsByBlock(requestParameters: GetTransactionsByBlockRequest, initOverrides?: RequestInit): Promise<TransactionResults> {
|
|
717
|
+
const response = await this.getTransactionsByBlockRaw(requestParameters, initOverrides);
|
|
718
|
+
return await response.value();
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get transactions by block](#operation/get_transactions_by_block). Retrieves a list of all transactions within a block for a given block hash.
|
|
671
723
|
* Transactions by block hash
|
|
672
724
|
*/
|
|
673
725
|
async getTransactionsByBlockHashRaw(requestParameters: GetTransactionsByBlockHashRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<TransactionResults>> {
|
|
@@ -698,7 +750,7 @@ export class TransactionsApi extends runtime.BaseAPI implements TransactionsApiI
|
|
|
698
750
|
}
|
|
699
751
|
|
|
700
752
|
/**
|
|
701
|
-
* Retrieves a list of all transactions within a block for a given block hash.
|
|
753
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get transactions by block](#operation/get_transactions_by_block). Retrieves a list of all transactions within a block for a given block hash.
|
|
702
754
|
* Transactions by block hash
|
|
703
755
|
*/
|
|
704
756
|
async getTransactionsByBlockHash(requestParameters: GetTransactionsByBlockHashRequest, initOverrides?: RequestInit): Promise<TransactionResults> {
|
|
@@ -707,7 +759,7 @@ export class TransactionsApi extends runtime.BaseAPI implements TransactionsApiI
|
|
|
707
759
|
}
|
|
708
760
|
|
|
709
761
|
/**
|
|
710
|
-
* Retrieves all transactions within a block at a given height
|
|
762
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get transactions by block](#operation/get_transactions_by_block). Retrieves all transactions within a block at a given height
|
|
711
763
|
* Transactions by block height
|
|
712
764
|
*/
|
|
713
765
|
async getTransactionsByBlockHeightRaw(requestParameters: GetTransactionsByBlockHeightRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<TransactionResults>> {
|
|
@@ -742,7 +794,7 @@ export class TransactionsApi extends runtime.BaseAPI implements TransactionsApiI
|
|
|
742
794
|
}
|
|
743
795
|
|
|
744
796
|
/**
|
|
745
|
-
* Retrieves all transactions within a block at a given height
|
|
797
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get transactions by block](#operation/get_transactions_by_block). Retrieves all transactions within a block at a given height
|
|
746
798
|
* Transactions by block height
|
|
747
799
|
*/
|
|
748
800
|
async getTransactionsByBlockHeight(requestParameters: GetTransactionsByBlockHeightRequest, initOverrides?: RequestInit): Promise<TransactionResults> {
|
|
@@ -851,5 +903,6 @@ export enum GetTransactionListTypeEnum {
|
|
|
851
903
|
token_transfer = 'token_transfer',
|
|
852
904
|
smart_contract = 'smart_contract',
|
|
853
905
|
contract_call = 'contract_call',
|
|
854
|
-
poison_microblock = 'poison_microblock'
|
|
906
|
+
poison_microblock = 'poison_microblock',
|
|
907
|
+
tenure_change = 'tenure_change'
|
|
855
908
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export * from './AccountsApi';
|
|
4
4
|
export * from './BlocksApi';
|
|
5
|
+
export * from './BurnBlocksApi';
|
|
5
6
|
export * from './FaucetsApi';
|
|
6
7
|
export * from './FeesApi';
|
|
7
|
-
export * from './FungibleTokensApi';
|
|
8
8
|
export * from './InfoApi';
|
|
9
9
|
export * from './MempoolApi';
|
|
10
10
|
export * from './MicroblocksApi';
|
|
@@ -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
|
+
|
|
@@ -14,49 +14,49 @@
|
|
|
14
14
|
|
|
15
15
|
import { exists, mapValues } from '../runtime';
|
|
16
16
|
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
BurnBlock,
|
|
18
|
+
BurnBlockFromJSON,
|
|
19
|
+
BurnBlockFromJSONTyped,
|
|
20
|
+
BurnBlockToJSON,
|
|
21
21
|
} from './';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* GET request that returns burn blocks
|
|
25
25
|
* @export
|
|
26
|
-
* @interface
|
|
26
|
+
* @interface BurnBlockListResponse
|
|
27
27
|
*/
|
|
28
|
-
export interface
|
|
28
|
+
export interface BurnBlockListResponse {
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* The number of burn blocks to return
|
|
31
31
|
* @type {number}
|
|
32
|
-
* @memberof
|
|
32
|
+
* @memberof BurnBlockListResponse
|
|
33
33
|
*/
|
|
34
34
|
limit: number;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* The number to burn blocks to skip (starting at `0`)
|
|
37
37
|
* @type {number}
|
|
38
|
-
* @memberof
|
|
38
|
+
* @memberof BurnBlockListResponse
|
|
39
39
|
*/
|
|
40
40
|
offset: number;
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* The number of burn blocks available (regardless of filter parameters)
|
|
43
43
|
* @type {number}
|
|
44
|
-
* @memberof
|
|
44
|
+
* @memberof BurnBlockListResponse
|
|
45
45
|
*/
|
|
46
46
|
total: number;
|
|
47
47
|
/**
|
|
48
48
|
*
|
|
49
|
-
* @type {Array<
|
|
50
|
-
* @memberof
|
|
49
|
+
* @type {Array<BurnBlock>}
|
|
50
|
+
* @memberof BurnBlockListResponse
|
|
51
51
|
*/
|
|
52
|
-
|
|
52
|
+
results: Array<BurnBlock>;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
export function
|
|
56
|
-
return
|
|
55
|
+
export function BurnBlockListResponseFromJSON(json: any): BurnBlockListResponse {
|
|
56
|
+
return BurnBlockListResponseFromJSONTyped(json, false);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
export function
|
|
59
|
+
export function BurnBlockListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): BurnBlockListResponse {
|
|
60
60
|
if ((json === undefined) || (json === null)) {
|
|
61
61
|
return json;
|
|
62
62
|
}
|
|
@@ -65,11 +65,11 @@ export function AddressNftListResponseFromJSONTyped(json: any, ignoreDiscriminat
|
|
|
65
65
|
'limit': json['limit'],
|
|
66
66
|
'offset': json['offset'],
|
|
67
67
|
'total': json['total'],
|
|
68
|
-
'
|
|
68
|
+
'results': ((json['results'] as Array<any>).map(BurnBlockFromJSON)),
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
export function
|
|
72
|
+
export function BurnBlockListResponseToJSON(value?: BurnBlockListResponse | null): any {
|
|
73
73
|
if (value === undefined) {
|
|
74
74
|
return undefined;
|
|
75
75
|
}
|
|
@@ -81,7 +81,7 @@ export function AddressNftListResponseToJSON(value?: AddressNftListResponse | nu
|
|
|
81
81
|
'limit': value.limit,
|
|
82
82
|
'offset': value.offset,
|
|
83
83
|
'total': value.total,
|
|
84
|
-
'
|
|
84
|
+
'results': ((value.results as Array<any>).map(BurnBlockToJSON)),
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
|