@stacks/blockchain-api-client 3.0.1 → 4.0.0-beta.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/FeesApi.d.ts +36 -9
- package/lib/generated/apis/FeesApi.js +29 -4
- package/lib/generated/apis/FeesApi.js.map +1 -1
- package/lib/generated/apis/NamesApi.d.ts +27 -0
- package/lib/generated/apis/NamesApi.js +26 -0
- package/lib/generated/apis/NamesApi.js.map +1 -1
- package/lib/generated/apis/TransactionsApi.d.ts +47 -1
- package/lib/generated/apis/TransactionsApi.js +51 -1
- package/lib/generated/apis/TransactionsApi.js.map +1 -1
- package/lib/generated/models/TransactionEventsResponse.d.ts +39 -0
- package/lib/generated/models/TransactionEventsResponse.js +46 -0
- package/lib/generated/models/TransactionEventsResponse.js.map +1 -0
- package/lib/generated/models/TransactionFeeEstimateRequest.d.ts +33 -0
- package/lib/generated/models/TransactionFeeEstimateRequest.js +45 -0
- package/lib/generated/models/TransactionFeeEstimateRequest.js.map +1 -0
- package/lib/generated/models/TransactionFeeEstimateResponse.d.ts +46 -0
- package/lib/generated/models/TransactionFeeEstimateResponse.js +50 -0
- package/lib/generated/models/TransactionFeeEstimateResponse.js.map +1 -0
- package/lib/generated/models/TransactionFeeEstimateResponseEstimatedCost.d.ts +51 -0
- package/lib/generated/models/TransactionFeeEstimateResponseEstimatedCost.js +50 -0
- package/lib/generated/models/TransactionFeeEstimateResponseEstimatedCost.js.map +1 -0
- package/lib/generated/models/TransactionFeeEstimateResponseEstimations.d.ts +33 -0
- package/lib/generated/models/TransactionFeeEstimateResponseEstimations.js +45 -0
- package/lib/generated/models/TransactionFeeEstimateResponseEstimations.js.map +1 -0
- package/lib/generated/models/index.d.ts +5 -0
- package/lib/generated/models/index.js +5 -0
- package/lib/generated/models/index.js.map +1 -1
- package/lib/index.umd.js +445 -76
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/generated/.openapi-generator/FILES +5 -0
- package/src/generated/apis/FeesApi.ts +65 -8
- package/src/generated/apis/NamesApi.ts +52 -0
- package/src/generated/apis/TransactionsApi.ts +90 -0
- package/src/generated/models/TransactionEventsResponse.ts +72 -0
- package/src/generated/models/TransactionFeeEstimateRequest.ts +64 -0
- package/src/generated/models/TransactionFeeEstimateResponse.ts +91 -0
- package/src/generated/models/TransactionFeeEstimateResponseEstimatedCost.ts +88 -0
- package/src/generated/models/TransactionFeeEstimateResponseEstimations.ts +64 -0
- package/src/generated/models/index.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacks/blockchain-api-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-beta.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",
|
|
@@ -143,6 +143,11 @@ models/RunFaucetResponse.ts
|
|
|
143
143
|
models/ServerStatusResponse.ts
|
|
144
144
|
models/SigningPayload.ts
|
|
145
145
|
models/SmartContract.ts
|
|
146
|
+
models/TransactionEventsResponse.ts
|
|
147
|
+
models/TransactionFeeEstimateRequest.ts
|
|
148
|
+
models/TransactionFeeEstimateResponse.ts
|
|
149
|
+
models/TransactionFeeEstimateResponseEstimatedCost.ts
|
|
150
|
+
models/TransactionFeeEstimateResponseEstimations.ts
|
|
146
151
|
models/TransactionIdentifier.ts
|
|
147
152
|
models/TransactionResults.ts
|
|
148
153
|
models/UnanchoredTransactionListResponse.ts
|
|
@@ -21,12 +21,22 @@ import {
|
|
|
21
21
|
FeeRateRequest,
|
|
22
22
|
FeeRateRequestFromJSON,
|
|
23
23
|
FeeRateRequestToJSON,
|
|
24
|
+
TransactionFeeEstimateRequest,
|
|
25
|
+
TransactionFeeEstimateRequestFromJSON,
|
|
26
|
+
TransactionFeeEstimateRequestToJSON,
|
|
27
|
+
TransactionFeeEstimateResponse,
|
|
28
|
+
TransactionFeeEstimateResponseFromJSON,
|
|
29
|
+
TransactionFeeEstimateResponseToJSON,
|
|
24
30
|
} from '../models';
|
|
25
31
|
|
|
26
32
|
export interface FetchFeeRateRequest {
|
|
27
33
|
feeRateRequest: FeeRateRequest;
|
|
28
34
|
}
|
|
29
35
|
|
|
36
|
+
export interface PostFeeTransactionRequest {
|
|
37
|
+
transactionFeeEstimateRequest?: TransactionFeeEstimateRequest;
|
|
38
|
+
}
|
|
39
|
+
|
|
30
40
|
/**
|
|
31
41
|
* FeesApi - interface
|
|
32
42
|
*
|
|
@@ -35,8 +45,8 @@ export interface FetchFeeRateRequest {
|
|
|
35
45
|
*/
|
|
36
46
|
export interface FeesApiInterface {
|
|
37
47
|
/**
|
|
38
|
-
* Retrieves estimated fee rate.
|
|
39
|
-
* @summary
|
|
48
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get approximate fees for the given transaction](#operation/post_fee_transaction). Retrieves estimated fee rate.
|
|
49
|
+
* @summary Fetch fee rate
|
|
40
50
|
* @param {FeeRateRequest} feeRateRequest
|
|
41
51
|
* @param {*} [options] Override http request option.
|
|
42
52
|
* @throws {RequiredError}
|
|
@@ -45,8 +55,8 @@ export interface FeesApiInterface {
|
|
|
45
55
|
fetchFeeRateRaw(requestParameters: FetchFeeRateRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<FeeRate>>;
|
|
46
56
|
|
|
47
57
|
/**
|
|
48
|
-
* Retrieves estimated fee rate.
|
|
49
|
-
*
|
|
58
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get approximate fees for the given transaction](#operation/post_fee_transaction). Retrieves estimated fee rate.
|
|
59
|
+
* Fetch fee rate
|
|
50
60
|
*/
|
|
51
61
|
fetchFeeRate(requestParameters: FetchFeeRateRequest, initOverrides?: RequestInit): Promise<FeeRate>;
|
|
52
62
|
|
|
@@ -65,6 +75,22 @@ export interface FeesApiInterface {
|
|
|
65
75
|
*/
|
|
66
76
|
getFeeTransfer(initOverrides?: RequestInit): Promise<object>;
|
|
67
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Get an estimated fee for the supplied transaction. This estimates the execution cost of the transaction, the current fee rate of the network, and returns estimates for fee amounts. * `transaction_payload` is a hex-encoded serialization of the TransactionPayload for the transaction. * `estimated_len` is an optional argument that provides the endpoint with an estimation of the final length (in bytes) of the transaction, including any post-conditions and signatures If the node cannot provide an estimate for the transaction (e.g., if the node has never seen a contract-call for the given contract and function) or if estimation is not configured on this node, a 400 response is returned. The 400 response will be a JSON error containing a `reason` field which can be one of the following: * `DatabaseError` - this Stacks node has had an internal database error while trying to estimate the costs of the supplied transaction. * `NoEstimateAvailable` - this Stacks node has not seen this kind of contract-call before, and it cannot provide an estimate yet. * `CostEstimationDisabled` - this Stacks node does not perform fee or cost estimation, and it cannot respond on this endpoint. The 200 response contains the following data: * `estimated_cost` - the estimated multi-dimensional cost of executing the Clarity VM on the provided transaction. * `estimated_cost_scalar` - a unitless integer that the Stacks node uses to compare how much of the block limit is consumed by different transactions. This value incorporates the estimated length of the transaction and the estimated execution cost of the transaction. The range of this integer may vary between different Stacks nodes. In order to compute an estimate of total fee amount for the transaction, this value is multiplied by the same Stacks node\'s estimated fee rate. * `cost_scalar_change_by_byte` - a float value that indicates how much the `estimated_cost_scalar` value would increase for every additional byte in the final transaction. * `estimations` - an array of estimated fee rates and total fees to pay in microSTX for the transaction. This array provides a range of estimates (default: 3) that may be used. Each element of the array contains the following fields: * `fee_rate` - the estimated value for the current fee rates in the network * `fee` - the estimated value for the total fee in microSTX that the given transaction should pay. These values are the result of computing: `fee_rate` x `estimated_cost_scalar`. If the estimated fees are less than the minimum relay fee `(1 ustx x estimated_len)`, then that minimum relay fee will be returned here instead. Note: If the final transaction\'s byte size is larger than supplied to `estimated_len`, then applications should increase this fee amount by: `fee_rate` x `cost_scalar_change_by_byte` x (`final_size` - `estimated_size`)
|
|
80
|
+
* @summary Get approximate fees for the given transaction
|
|
81
|
+
* @param {TransactionFeeEstimateRequest} [transactionFeeEstimateRequest]
|
|
82
|
+
* @param {*} [options] Override http request option.
|
|
83
|
+
* @throws {RequiredError}
|
|
84
|
+
* @memberof FeesApiInterface
|
|
85
|
+
*/
|
|
86
|
+
postFeeTransactionRaw(requestParameters: PostFeeTransactionRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<TransactionFeeEstimateResponse>>;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Get an estimated fee for the supplied transaction. This estimates the execution cost of the transaction, the current fee rate of the network, and returns estimates for fee amounts. * `transaction_payload` is a hex-encoded serialization of the TransactionPayload for the transaction. * `estimated_len` is an optional argument that provides the endpoint with an estimation of the final length (in bytes) of the transaction, including any post-conditions and signatures If the node cannot provide an estimate for the transaction (e.g., if the node has never seen a contract-call for the given contract and function) or if estimation is not configured on this node, a 400 response is returned. The 400 response will be a JSON error containing a `reason` field which can be one of the following: * `DatabaseError` - this Stacks node has had an internal database error while trying to estimate the costs of the supplied transaction. * `NoEstimateAvailable` - this Stacks node has not seen this kind of contract-call before, and it cannot provide an estimate yet. * `CostEstimationDisabled` - this Stacks node does not perform fee or cost estimation, and it cannot respond on this endpoint. The 200 response contains the following data: * `estimated_cost` - the estimated multi-dimensional cost of executing the Clarity VM on the provided transaction. * `estimated_cost_scalar` - a unitless integer that the Stacks node uses to compare how much of the block limit is consumed by different transactions. This value incorporates the estimated length of the transaction and the estimated execution cost of the transaction. The range of this integer may vary between different Stacks nodes. In order to compute an estimate of total fee amount for the transaction, this value is multiplied by the same Stacks node\'s estimated fee rate. * `cost_scalar_change_by_byte` - a float value that indicates how much the `estimated_cost_scalar` value would increase for every additional byte in the final transaction. * `estimations` - an array of estimated fee rates and total fees to pay in microSTX for the transaction. This array provides a range of estimates (default: 3) that may be used. Each element of the array contains the following fields: * `fee_rate` - the estimated value for the current fee rates in the network * `fee` - the estimated value for the total fee in microSTX that the given transaction should pay. These values are the result of computing: `fee_rate` x `estimated_cost_scalar`. If the estimated fees are less than the minimum relay fee `(1 ustx x estimated_len)`, then that minimum relay fee will be returned here instead. Note: If the final transaction\'s byte size is larger than supplied to `estimated_len`, then applications should increase this fee amount by: `fee_rate` x `cost_scalar_change_by_byte` x (`final_size` - `estimated_size`)
|
|
90
|
+
* Get approximate fees for the given transaction
|
|
91
|
+
*/
|
|
92
|
+
postFeeTransaction(requestParameters: PostFeeTransactionRequest, initOverrides?: RequestInit): Promise<TransactionFeeEstimateResponse>;
|
|
93
|
+
|
|
68
94
|
}
|
|
69
95
|
|
|
70
96
|
/**
|
|
@@ -73,8 +99,8 @@ export interface FeesApiInterface {
|
|
|
73
99
|
export class FeesApi extends runtime.BaseAPI implements FeesApiInterface {
|
|
74
100
|
|
|
75
101
|
/**
|
|
76
|
-
* Retrieves estimated fee rate.
|
|
77
|
-
*
|
|
102
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get approximate fees for the given transaction](#operation/post_fee_transaction). Retrieves estimated fee rate.
|
|
103
|
+
* Fetch fee rate
|
|
78
104
|
*/
|
|
79
105
|
async fetchFeeRateRaw(requestParameters: FetchFeeRateRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<FeeRate>> {
|
|
80
106
|
if (requestParameters.feeRateRequest === null || requestParameters.feeRateRequest === undefined) {
|
|
@@ -99,8 +125,8 @@ export class FeesApi extends runtime.BaseAPI implements FeesApiInterface {
|
|
|
99
125
|
}
|
|
100
126
|
|
|
101
127
|
/**
|
|
102
|
-
* Retrieves estimated fee rate.
|
|
103
|
-
*
|
|
128
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get approximate fees for the given transaction](#operation/post_fee_transaction). Retrieves estimated fee rate.
|
|
129
|
+
* Fetch fee rate
|
|
104
130
|
*/
|
|
105
131
|
async fetchFeeRate(requestParameters: FetchFeeRateRequest, initOverrides?: RequestInit): Promise<FeeRate> {
|
|
106
132
|
const response = await this.fetchFeeRateRaw(requestParameters, initOverrides);
|
|
@@ -135,4 +161,35 @@ export class FeesApi extends runtime.BaseAPI implements FeesApiInterface {
|
|
|
135
161
|
return await response.value();
|
|
136
162
|
}
|
|
137
163
|
|
|
164
|
+
/**
|
|
165
|
+
* Get an estimated fee for the supplied transaction. This estimates the execution cost of the transaction, the current fee rate of the network, and returns estimates for fee amounts. * `transaction_payload` is a hex-encoded serialization of the TransactionPayload for the transaction. * `estimated_len` is an optional argument that provides the endpoint with an estimation of the final length (in bytes) of the transaction, including any post-conditions and signatures If the node cannot provide an estimate for the transaction (e.g., if the node has never seen a contract-call for the given contract and function) or if estimation is not configured on this node, a 400 response is returned. The 400 response will be a JSON error containing a `reason` field which can be one of the following: * `DatabaseError` - this Stacks node has had an internal database error while trying to estimate the costs of the supplied transaction. * `NoEstimateAvailable` - this Stacks node has not seen this kind of contract-call before, and it cannot provide an estimate yet. * `CostEstimationDisabled` - this Stacks node does not perform fee or cost estimation, and it cannot respond on this endpoint. The 200 response contains the following data: * `estimated_cost` - the estimated multi-dimensional cost of executing the Clarity VM on the provided transaction. * `estimated_cost_scalar` - a unitless integer that the Stacks node uses to compare how much of the block limit is consumed by different transactions. This value incorporates the estimated length of the transaction and the estimated execution cost of the transaction. The range of this integer may vary between different Stacks nodes. In order to compute an estimate of total fee amount for the transaction, this value is multiplied by the same Stacks node\'s estimated fee rate. * `cost_scalar_change_by_byte` - a float value that indicates how much the `estimated_cost_scalar` value would increase for every additional byte in the final transaction. * `estimations` - an array of estimated fee rates and total fees to pay in microSTX for the transaction. This array provides a range of estimates (default: 3) that may be used. Each element of the array contains the following fields: * `fee_rate` - the estimated value for the current fee rates in the network * `fee` - the estimated value for the total fee in microSTX that the given transaction should pay. These values are the result of computing: `fee_rate` x `estimated_cost_scalar`. If the estimated fees are less than the minimum relay fee `(1 ustx x estimated_len)`, then that minimum relay fee will be returned here instead. Note: If the final transaction\'s byte size is larger than supplied to `estimated_len`, then applications should increase this fee amount by: `fee_rate` x `cost_scalar_change_by_byte` x (`final_size` - `estimated_size`)
|
|
166
|
+
* Get approximate fees for the given transaction
|
|
167
|
+
*/
|
|
168
|
+
async postFeeTransactionRaw(requestParameters: PostFeeTransactionRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<TransactionFeeEstimateResponse>> {
|
|
169
|
+
const queryParameters: any = {};
|
|
170
|
+
|
|
171
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
172
|
+
|
|
173
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
174
|
+
|
|
175
|
+
const response = await this.request({
|
|
176
|
+
path: `/v2/fees/transaction`,
|
|
177
|
+
method: 'POST',
|
|
178
|
+
headers: headerParameters,
|
|
179
|
+
query: queryParameters,
|
|
180
|
+
body: TransactionFeeEstimateRequestToJSON(requestParameters.transactionFeeEstimateRequest),
|
|
181
|
+
}, initOverrides);
|
|
182
|
+
|
|
183
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => TransactionFeeEstimateResponseFromJSON(jsonValue));
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Get an estimated fee for the supplied transaction. This estimates the execution cost of the transaction, the current fee rate of the network, and returns estimates for fee amounts. * `transaction_payload` is a hex-encoded serialization of the TransactionPayload for the transaction. * `estimated_len` is an optional argument that provides the endpoint with an estimation of the final length (in bytes) of the transaction, including any post-conditions and signatures If the node cannot provide an estimate for the transaction (e.g., if the node has never seen a contract-call for the given contract and function) or if estimation is not configured on this node, a 400 response is returned. The 400 response will be a JSON error containing a `reason` field which can be one of the following: * `DatabaseError` - this Stacks node has had an internal database error while trying to estimate the costs of the supplied transaction. * `NoEstimateAvailable` - this Stacks node has not seen this kind of contract-call before, and it cannot provide an estimate yet. * `CostEstimationDisabled` - this Stacks node does not perform fee or cost estimation, and it cannot respond on this endpoint. The 200 response contains the following data: * `estimated_cost` - the estimated multi-dimensional cost of executing the Clarity VM on the provided transaction. * `estimated_cost_scalar` - a unitless integer that the Stacks node uses to compare how much of the block limit is consumed by different transactions. This value incorporates the estimated length of the transaction and the estimated execution cost of the transaction. The range of this integer may vary between different Stacks nodes. In order to compute an estimate of total fee amount for the transaction, this value is multiplied by the same Stacks node\'s estimated fee rate. * `cost_scalar_change_by_byte` - a float value that indicates how much the `estimated_cost_scalar` value would increase for every additional byte in the final transaction. * `estimations` - an array of estimated fee rates and total fees to pay in microSTX for the transaction. This array provides a range of estimates (default: 3) that may be used. Each element of the array contains the following fields: * `fee_rate` - the estimated value for the current fee rates in the network * `fee` - the estimated value for the total fee in microSTX that the given transaction should pay. These values are the result of computing: `fee_rate` x `estimated_cost_scalar`. If the estimated fees are less than the minimum relay fee `(1 ustx x estimated_len)`, then that minimum relay fee will be returned here instead. Note: If the final transaction\'s byte size is larger than supplied to `estimated_len`, then applications should increase this fee amount by: `fee_rate` x `cost_scalar_change_by_byte` x (`final_size` - `estimated_size`)
|
|
188
|
+
* Get approximate fees for the given transaction
|
|
189
|
+
*/
|
|
190
|
+
async postFeeTransaction(requestParameters: PostFeeTransactionRequest, initOverrides?: RequestInit): Promise<TransactionFeeEstimateResponse> {
|
|
191
|
+
const response = await this.postFeeTransactionRaw(requestParameters, initOverrides);
|
|
192
|
+
return await response.value();
|
|
193
|
+
}
|
|
194
|
+
|
|
138
195
|
}
|
|
@@ -35,6 +35,10 @@ import {
|
|
|
35
35
|
BnsNamesOwnByAddressResponseToJSON,
|
|
36
36
|
} from '../models';
|
|
37
37
|
|
|
38
|
+
export interface FetchSubdomainsListForNameRequest {
|
|
39
|
+
name: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
38
42
|
export interface FetchZoneFileRequest {
|
|
39
43
|
name: string;
|
|
40
44
|
}
|
|
@@ -82,6 +86,22 @@ export interface GetNamespacePriceRequest {
|
|
|
82
86
|
* @interface NamesApiInterface
|
|
83
87
|
*/
|
|
84
88
|
export interface NamesApiInterface {
|
|
89
|
+
/**
|
|
90
|
+
* Retrieves the list of subdomains for a specific name
|
|
91
|
+
* @summary Get Name Subdomains
|
|
92
|
+
* @param {string} name fully-qualified name
|
|
93
|
+
* @param {*} [options] Override http request option.
|
|
94
|
+
* @throws {RequiredError}
|
|
95
|
+
* @memberof NamesApiInterface
|
|
96
|
+
*/
|
|
97
|
+
fetchSubdomainsListForNameRaw(requestParameters: FetchSubdomainsListForNameRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Array<string>>>;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Retrieves the list of subdomains for a specific name
|
|
101
|
+
* Get Name Subdomains
|
|
102
|
+
*/
|
|
103
|
+
fetchSubdomainsListForName(requestParameters: FetchSubdomainsListForNameRequest, initOverrides?: RequestInit): Promise<Array<string>>;
|
|
104
|
+
|
|
85
105
|
/**
|
|
86
106
|
* Retrieves a user’s raw zone file. This only works for RFC-compliant zone files. This method returns an error for names that have non-standard zone files.
|
|
87
107
|
* @summary Get Zone File
|
|
@@ -252,6 +272,38 @@ export interface NamesApiInterface {
|
|
|
252
272
|
*/
|
|
253
273
|
export class NamesApi extends runtime.BaseAPI implements NamesApiInterface {
|
|
254
274
|
|
|
275
|
+
/**
|
|
276
|
+
* Retrieves the list of subdomains for a specific name
|
|
277
|
+
* Get Name Subdomains
|
|
278
|
+
*/
|
|
279
|
+
async fetchSubdomainsListForNameRaw(requestParameters: FetchSubdomainsListForNameRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Array<string>>> {
|
|
280
|
+
if (requestParameters.name === null || requestParameters.name === undefined) {
|
|
281
|
+
throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling fetchSubdomainsListForName.');
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
const queryParameters: any = {};
|
|
285
|
+
|
|
286
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
287
|
+
|
|
288
|
+
const response = await this.request({
|
|
289
|
+
path: `/v1/names/{name}/subdomains`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))),
|
|
290
|
+
method: 'GET',
|
|
291
|
+
headers: headerParameters,
|
|
292
|
+
query: queryParameters,
|
|
293
|
+
}, initOverrides);
|
|
294
|
+
|
|
295
|
+
return new runtime.JSONApiResponse<any>(response);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Retrieves the list of subdomains for a specific name
|
|
300
|
+
* Get Name Subdomains
|
|
301
|
+
*/
|
|
302
|
+
async fetchSubdomainsListForName(requestParameters: FetchSubdomainsListForNameRequest, initOverrides?: RequestInit): Promise<Array<string>> {
|
|
303
|
+
const response = await this.fetchSubdomainsListForNameRaw(requestParameters, initOverrides);
|
|
304
|
+
return await response.value();
|
|
305
|
+
}
|
|
306
|
+
|
|
255
307
|
/**
|
|
256
308
|
* Retrieves a user’s raw zone file. This only works for RFC-compliant zone files. This method returns an error for names that have non-standard zone files.
|
|
257
309
|
* Get Zone File
|
|
@@ -24,6 +24,9 @@ import {
|
|
|
24
24
|
PostCoreNodeTransactionsError,
|
|
25
25
|
PostCoreNodeTransactionsErrorFromJSON,
|
|
26
26
|
PostCoreNodeTransactionsErrorToJSON,
|
|
27
|
+
TransactionEventsResponse,
|
|
28
|
+
TransactionEventsResponseFromJSON,
|
|
29
|
+
TransactionEventsResponseToJSON,
|
|
27
30
|
TransactionResults,
|
|
28
31
|
TransactionResultsFromJSON,
|
|
29
32
|
TransactionResultsToJSON,
|
|
@@ -41,6 +44,14 @@ export interface GetDroppedMempoolTransactionListRequest {
|
|
|
41
44
|
offset?: number;
|
|
42
45
|
}
|
|
43
46
|
|
|
47
|
+
export interface GetFilteredEventsRequest {
|
|
48
|
+
txId?: string;
|
|
49
|
+
address?: string;
|
|
50
|
+
limit?: number;
|
|
51
|
+
offset?: number;
|
|
52
|
+
type?: Array<GetFilteredEventsTypeEnum>;
|
|
53
|
+
}
|
|
54
|
+
|
|
44
55
|
export interface GetMempoolTransactionListRequest {
|
|
45
56
|
senderAddress?: string;
|
|
46
57
|
recipientAddress?: string;
|
|
@@ -135,6 +146,26 @@ export interface TransactionsApiInterface {
|
|
|
135
146
|
*/
|
|
136
147
|
getDroppedMempoolTransactionList(requestParameters: GetDroppedMempoolTransactionListRequest, initOverrides?: RequestInit): Promise<MempoolTransactionListResponse>;
|
|
137
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Retrieves the list of events filtered by principal (STX address or Smart Contract ID), transaction id or event types. The list of event types is (\'smart_contract_log\', \'stx_lock\', \'stx_asset\', \'fungible_token_asset\', \'non_fungible_token_asset\').
|
|
151
|
+
* @summary Transaction Events
|
|
152
|
+
* @param {string} [txId] Hash of transaction
|
|
153
|
+
* @param {string} [address] Stacks address or a Contract identifier
|
|
154
|
+
* @param {number} [limit] number of items to return
|
|
155
|
+
* @param {number} [offset] number of items to skip
|
|
156
|
+
* @param {Array<'smart_contract_log' | 'stx_lock' | 'stx_asset' | 'fungible_token_asset' | 'non_fungible_token_asset'>} [type] Filter the events on event type
|
|
157
|
+
* @param {*} [options] Override http request option.
|
|
158
|
+
* @throws {RequiredError}
|
|
159
|
+
* @memberof TransactionsApiInterface
|
|
160
|
+
*/
|
|
161
|
+
getFilteredEventsRaw(requestParameters: GetFilteredEventsRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<TransactionEventsResponse>>;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Retrieves the list of events filtered by principal (STX address or Smart Contract ID), transaction id or event types. The list of event types is (\'smart_contract_log\', \'stx_lock\', \'stx_asset\', \'fungible_token_asset\', \'non_fungible_token_asset\').
|
|
165
|
+
* Transaction Events
|
|
166
|
+
*/
|
|
167
|
+
getFilteredEvents(requestParameters: GetFilteredEventsRequest, initOverrides?: RequestInit): Promise<TransactionEventsResponse>;
|
|
168
|
+
|
|
138
169
|
/**
|
|
139
170
|
* Retrieves all transactions that have been recently broadcast to the mempool. These are pending transactions awaiting confirmation. If you need to monitor new transactions, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
|
|
140
171
|
* @summary Get mempool transactions
|
|
@@ -369,6 +400,54 @@ export class TransactionsApi extends runtime.BaseAPI implements TransactionsApiI
|
|
|
369
400
|
return await response.value();
|
|
370
401
|
}
|
|
371
402
|
|
|
403
|
+
/**
|
|
404
|
+
* Retrieves the list of events filtered by principal (STX address or Smart Contract ID), transaction id or event types. The list of event types is (\'smart_contract_log\', \'stx_lock\', \'stx_asset\', \'fungible_token_asset\', \'non_fungible_token_asset\').
|
|
405
|
+
* Transaction Events
|
|
406
|
+
*/
|
|
407
|
+
async getFilteredEventsRaw(requestParameters: GetFilteredEventsRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<TransactionEventsResponse>> {
|
|
408
|
+
const queryParameters: any = {};
|
|
409
|
+
|
|
410
|
+
if (requestParameters.txId !== undefined) {
|
|
411
|
+
queryParameters['tx_id'] = requestParameters.txId;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
if (requestParameters.address !== undefined) {
|
|
415
|
+
queryParameters['address'] = requestParameters.address;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
if (requestParameters.limit !== undefined) {
|
|
419
|
+
queryParameters['limit'] = requestParameters.limit;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (requestParameters.offset !== undefined) {
|
|
423
|
+
queryParameters['offset'] = requestParameters.offset;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
if (requestParameters.type) {
|
|
427
|
+
queryParameters['type'] = requestParameters.type;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
431
|
+
|
|
432
|
+
const response = await this.request({
|
|
433
|
+
path: `/extended/v1/tx/events`,
|
|
434
|
+
method: 'GET',
|
|
435
|
+
headers: headerParameters,
|
|
436
|
+
query: queryParameters,
|
|
437
|
+
}, initOverrides);
|
|
438
|
+
|
|
439
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => TransactionEventsResponseFromJSON(jsonValue));
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Retrieves the list of events filtered by principal (STX address or Smart Contract ID), transaction id or event types. The list of event types is (\'smart_contract_log\', \'stx_lock\', \'stx_asset\', \'fungible_token_asset\', \'non_fungible_token_asset\').
|
|
444
|
+
* Transaction Events
|
|
445
|
+
*/
|
|
446
|
+
async getFilteredEvents(requestParameters: GetFilteredEventsRequest, initOverrides?: RequestInit): Promise<TransactionEventsResponse> {
|
|
447
|
+
const response = await this.getFilteredEventsRaw(requestParameters, initOverrides);
|
|
448
|
+
return await response.value();
|
|
449
|
+
}
|
|
450
|
+
|
|
372
451
|
/**
|
|
373
452
|
* Retrieves all transactions that have been recently broadcast to the mempool. These are pending transactions awaiting confirmation. If you need to monitor new transactions, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
|
|
374
453
|
* Get mempool transactions
|
|
@@ -706,6 +785,17 @@ export class TransactionsApi extends runtime.BaseAPI implements TransactionsApiI
|
|
|
706
785
|
|
|
707
786
|
}
|
|
708
787
|
|
|
788
|
+
/**
|
|
789
|
+
* @export
|
|
790
|
+
* @enum {string}
|
|
791
|
+
*/
|
|
792
|
+
export enum GetFilteredEventsTypeEnum {
|
|
793
|
+
smart_contract_log = 'smart_contract_log',
|
|
794
|
+
stx_lock = 'stx_lock',
|
|
795
|
+
stx_asset = 'stx_asset',
|
|
796
|
+
fungible_token_asset = 'fungible_token_asset',
|
|
797
|
+
non_fungible_token_asset = 'non_fungible_token_asset'
|
|
798
|
+
}
|
|
709
799
|
/**
|
|
710
800
|
* @export
|
|
711
801
|
* @enum {string}
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
* GET event for the given transaction
|
|
18
|
+
* @export
|
|
19
|
+
* @interface TransactionEventsResponse
|
|
20
|
+
*/
|
|
21
|
+
export interface TransactionEventsResponse {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof TransactionEventsResponse
|
|
26
|
+
*/
|
|
27
|
+
limit: number;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {number}
|
|
31
|
+
* @memberof TransactionEventsResponse
|
|
32
|
+
*/
|
|
33
|
+
offset: number;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {Array<object>}
|
|
37
|
+
* @memberof TransactionEventsResponse
|
|
38
|
+
*/
|
|
39
|
+
results: Array<object>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function TransactionEventsResponseFromJSON(json: any): TransactionEventsResponse {
|
|
43
|
+
return TransactionEventsResponseFromJSONTyped(json, false);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function TransactionEventsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionEventsResponse {
|
|
47
|
+
if ((json === undefined) || (json === null)) {
|
|
48
|
+
return json;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
|
|
52
|
+
'limit': json['limit'],
|
|
53
|
+
'offset': json['offset'],
|
|
54
|
+
'results': json['results'],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function TransactionEventsResponseToJSON(value?: TransactionEventsResponse | null): any {
|
|
59
|
+
if (value === undefined) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
if (value === null) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
|
|
67
|
+
'limit': value.limit,
|
|
68
|
+
'offset': value.offset,
|
|
69
|
+
'results': value.results,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
* POST request for estimated fee
|
|
18
|
+
* @export
|
|
19
|
+
* @interface TransactionFeeEstimateRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface TransactionFeeEstimateRequest {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof TransactionFeeEstimateRequest
|
|
26
|
+
*/
|
|
27
|
+
transaction_payload: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {number}
|
|
31
|
+
* @memberof TransactionFeeEstimateRequest
|
|
32
|
+
*/
|
|
33
|
+
estimated_len?: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function TransactionFeeEstimateRequestFromJSON(json: any): TransactionFeeEstimateRequest {
|
|
37
|
+
return TransactionFeeEstimateRequestFromJSONTyped(json, false);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function TransactionFeeEstimateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionFeeEstimateRequest {
|
|
41
|
+
if ((json === undefined) || (json === null)) {
|
|
42
|
+
return json;
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
|
|
46
|
+
'transaction_payload': json['transaction_payload'],
|
|
47
|
+
'estimated_len': !exists(json, 'estimated_len') ? undefined : json['estimated_len'],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function TransactionFeeEstimateRequestToJSON(value?: TransactionFeeEstimateRequest | null): any {
|
|
52
|
+
if (value === undefined) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
if (value === null) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
|
|
60
|
+
'transaction_payload': value.transaction_payload,
|
|
61
|
+
'estimated_len': value.estimated_len,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
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
|
+
TransactionFeeEstimateResponseEstimatedCost,
|
|
18
|
+
TransactionFeeEstimateResponseEstimatedCostFromJSON,
|
|
19
|
+
TransactionFeeEstimateResponseEstimatedCostFromJSONTyped,
|
|
20
|
+
TransactionFeeEstimateResponseEstimatedCostToJSON,
|
|
21
|
+
TransactionFeeEstimateResponseEstimations,
|
|
22
|
+
TransactionFeeEstimateResponseEstimationsFromJSON,
|
|
23
|
+
TransactionFeeEstimateResponseEstimationsFromJSONTyped,
|
|
24
|
+
TransactionFeeEstimateResponseEstimationsToJSON,
|
|
25
|
+
} from './';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* POST response for estimated fee
|
|
29
|
+
* @export
|
|
30
|
+
* @interface TransactionFeeEstimateResponse
|
|
31
|
+
*/
|
|
32
|
+
export interface TransactionFeeEstimateResponse {
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @type {number}
|
|
36
|
+
* @memberof TransactionFeeEstimateResponse
|
|
37
|
+
*/
|
|
38
|
+
estimated_cost_scalar: number;
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @type {number}
|
|
42
|
+
* @memberof TransactionFeeEstimateResponse
|
|
43
|
+
*/
|
|
44
|
+
cost_scalar_change_by_byte?: number;
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @type {TransactionFeeEstimateResponseEstimatedCost}
|
|
48
|
+
* @memberof TransactionFeeEstimateResponse
|
|
49
|
+
*/
|
|
50
|
+
estimated_cost: TransactionFeeEstimateResponseEstimatedCost;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @type {Array<TransactionFeeEstimateResponseEstimations>}
|
|
54
|
+
* @memberof TransactionFeeEstimateResponse
|
|
55
|
+
*/
|
|
56
|
+
estimations?: Array<TransactionFeeEstimateResponseEstimations>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function TransactionFeeEstimateResponseFromJSON(json: any): TransactionFeeEstimateResponse {
|
|
60
|
+
return TransactionFeeEstimateResponseFromJSONTyped(json, false);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function TransactionFeeEstimateResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionFeeEstimateResponse {
|
|
64
|
+
if ((json === undefined) || (json === null)) {
|
|
65
|
+
return json;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
|
|
69
|
+
'estimated_cost_scalar': json['estimated_cost_scalar'],
|
|
70
|
+
'cost_scalar_change_by_byte': !exists(json, 'cost_scalar_change_by_byte') ? undefined : json['cost_scalar_change_by_byte'],
|
|
71
|
+
'estimated_cost': TransactionFeeEstimateResponseEstimatedCostFromJSON(json['estimated_cost']),
|
|
72
|
+
'estimations': !exists(json, 'estimations') ? undefined : ((json['estimations'] as Array<any>).map(TransactionFeeEstimateResponseEstimationsFromJSON)),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function TransactionFeeEstimateResponseToJSON(value?: TransactionFeeEstimateResponse | null): any {
|
|
77
|
+
if (value === undefined) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
if (value === null) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
|
|
85
|
+
'estimated_cost_scalar': value.estimated_cost_scalar,
|
|
86
|
+
'cost_scalar_change_by_byte': value.cost_scalar_change_by_byte,
|
|
87
|
+
'estimated_cost': TransactionFeeEstimateResponseEstimatedCostToJSON(value.estimated_cost),
|
|
88
|
+
'estimations': value.estimations === undefined ? undefined : ((value.estimations as Array<any>).map(TransactionFeeEstimateResponseEstimationsToJSON)),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|