@stacks/blockchain-api-client 1.0.3 → 1.0.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stacks/blockchain-api-client",
3
- "version": "1.0.3",
3
+ "version": "1.0.7",
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",
@@ -83,6 +83,8 @@ export interface GetAccountNftRequest {
83
83
 
84
84
  export interface GetAccountNoncesRequest {
85
85
  principal: string;
86
+ blockHeight?: number;
87
+ blockHash?: string;
86
88
  }
87
89
 
88
90
  export interface GetAccountStxBalanceRequest {
@@ -222,6 +224,8 @@ export interface AccountsApiInterface {
222
224
  * Retrieves the latest nonce values used by an account by inspecting the mempool, microblock transactions, and anchored transactions.
223
225
  * @summary Get the latest nonce used by an account
224
226
  * @param {string} principal Stacks address (e.g. `SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0`)
227
+ * @param {number} [blockHeight] Optionally get the nonce at a given block height
228
+ * @param {string} [blockHash] Optionally get the nonce at a given block hash
225
229
  * @param {*} [options] Override http request option.
226
230
  * @throws {RequiredError}
227
231
  * @memberof AccountsApiInterface
@@ -557,6 +561,14 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface
557
561
 
558
562
  const queryParameters: any = {};
559
563
 
564
+ if (requestParameters.blockHeight !== undefined) {
565
+ queryParameters['block_height'] = requestParameters.blockHeight;
566
+ }
567
+
568
+ if (requestParameters.blockHash !== undefined) {
569
+ queryParameters['block_hash'] = requestParameters.blockHash;
570
+ }
571
+
560
572
  const headerParameters: runtime.HTTPHeaders = {};
561
573
 
562
574
  const response = await this.request({