@stacks/blockchain-api-client 7.8.0-beta.4 → 7.8.0
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 +4 -4
- package/lib/generated/apis/FeesApi.js +2 -2
- package/lib/generated/apis/SmartContractsApi.d.ts +35 -0
- package/lib/generated/apis/SmartContractsApi.js +29 -0
- package/lib/generated/apis/SmartContractsApi.js.map +1 -1
- package/lib/index.umd.js +52 -2
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/generated/apis/FeesApi.ts +4 -4
- package/src/generated/apis/SmartContractsApi.ts +56 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacks/blockchain-api-client",
|
|
3
|
-
"version": "7.8.0
|
|
3
|
+
"version": "7.8.0",
|
|
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",
|
|
@@ -76,7 +76,7 @@ export interface FeesApiInterface {
|
|
|
76
76
|
getFeeTransfer(initOverrides?: RequestInit): Promise<object>;
|
|
77
77
|
|
|
78
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
|
|
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
80
|
* @summary Get approximate fees for a given transaction
|
|
81
81
|
* @param {TransactionFeeEstimateRequest} [transactionFeeEstimateRequest]
|
|
82
82
|
* @param {*} [options] Override http request option.
|
|
@@ -86,7 +86,7 @@ export interface FeesApiInterface {
|
|
|
86
86
|
postFeeTransactionRaw(requestParameters: PostFeeTransactionRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<TransactionFeeEstimateResponse>>;
|
|
87
87
|
|
|
88
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
|
|
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
90
|
* Get approximate fees for a given transaction
|
|
91
91
|
*/
|
|
92
92
|
postFeeTransaction(requestParameters: PostFeeTransactionRequest, initOverrides?: RequestInit): Promise<TransactionFeeEstimateResponse>;
|
|
@@ -162,7 +162,7 @@ export class FeesApi extends runtime.BaseAPI implements FeesApiInterface {
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
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
|
|
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
166
|
* Get approximate fees for a given transaction
|
|
167
167
|
*/
|
|
168
168
|
async postFeeTransactionRaw(requestParameters: PostFeeTransactionRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<TransactionFeeEstimateResponse>> {
|
|
@@ -184,7 +184,7 @@ export class FeesApi extends runtime.BaseAPI implements FeesApiInterface {
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
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
|
|
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
188
|
* Get approximate fees for a given transaction
|
|
189
189
|
*/
|
|
190
190
|
async postFeeTransaction(requestParameters: PostFeeTransactionRequest, initOverrides?: RequestInit): Promise<TransactionFeeEstimateResponse> {
|
|
@@ -86,6 +86,10 @@ export interface GetContractsByTraitRequest {
|
|
|
86
86
|
offset?: number;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
export interface GetSmartContractsStatusRequest {
|
|
90
|
+
contractId: Array<string>;
|
|
91
|
+
}
|
|
92
|
+
|
|
89
93
|
/**
|
|
90
94
|
* SmartContractsApi - interface
|
|
91
95
|
*
|
|
@@ -225,6 +229,22 @@ export interface SmartContractsApiInterface {
|
|
|
225
229
|
*/
|
|
226
230
|
getContractsByTrait(requestParameters: GetContractsByTraitRequest, initOverrides?: RequestInit): Promise<ContractListResponse>;
|
|
227
231
|
|
|
232
|
+
/**
|
|
233
|
+
* Retrieves the deployment status of multiple smart contracts.
|
|
234
|
+
* @summary Get smart contracts status
|
|
235
|
+
* @param {Array<string>} contractId contract ids to fetch status for
|
|
236
|
+
* @param {*} [options] Override http request option.
|
|
237
|
+
* @throws {RequiredError}
|
|
238
|
+
* @memberof SmartContractsApiInterface
|
|
239
|
+
*/
|
|
240
|
+
getSmartContractsStatusRaw(requestParameters: GetSmartContractsStatusRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<{ [key: string]: object; }>>;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Retrieves the deployment status of multiple smart contracts.
|
|
244
|
+
* Get smart contracts status
|
|
245
|
+
*/
|
|
246
|
+
getSmartContractsStatus(requestParameters: GetSmartContractsStatusRequest, initOverrides?: RequestInit): Promise<{ [key: string]: object; }>;
|
|
247
|
+
|
|
228
248
|
}
|
|
229
249
|
|
|
230
250
|
/**
|
|
@@ -546,4 +566,40 @@ export class SmartContractsApi extends runtime.BaseAPI implements SmartContracts
|
|
|
546
566
|
return await response.value();
|
|
547
567
|
}
|
|
548
568
|
|
|
569
|
+
/**
|
|
570
|
+
* Retrieves the deployment status of multiple smart contracts.
|
|
571
|
+
* Get smart contracts status
|
|
572
|
+
*/
|
|
573
|
+
async getSmartContractsStatusRaw(requestParameters: GetSmartContractsStatusRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<{ [key: string]: object; }>> {
|
|
574
|
+
if (requestParameters.contractId === null || requestParameters.contractId === undefined) {
|
|
575
|
+
throw new runtime.RequiredError('contractId','Required parameter requestParameters.contractId was null or undefined when calling getSmartContractsStatus.');
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
const queryParameters: any = {};
|
|
579
|
+
|
|
580
|
+
if (requestParameters.contractId) {
|
|
581
|
+
queryParameters['contract_id'] = requestParameters.contractId;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
585
|
+
|
|
586
|
+
const response = await this.request({
|
|
587
|
+
path: `/extended/v2/smart-contracts/status`,
|
|
588
|
+
method: 'GET',
|
|
589
|
+
headers: headerParameters,
|
|
590
|
+
query: queryParameters,
|
|
591
|
+
}, initOverrides);
|
|
592
|
+
|
|
593
|
+
return new runtime.JSONApiResponse<any>(response);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Retrieves the deployment status of multiple smart contracts.
|
|
598
|
+
* Get smart contracts status
|
|
599
|
+
*/
|
|
600
|
+
async getSmartContractsStatus(requestParameters: GetSmartContractsStatusRequest, initOverrides?: RequestInit): Promise<{ [key: string]: object; }> {
|
|
601
|
+
const response = await this.getSmartContractsStatusRaw(requestParameters, initOverrides);
|
|
602
|
+
return await response.value();
|
|
603
|
+
}
|
|
604
|
+
|
|
549
605
|
}
|