@stacks/blockchain-api-client 7.4.0-nakamoto.4 → 7.4.0-nakamoto.6
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/index.umd.js
CHANGED
|
@@ -7296,13 +7296,60 @@
|
|
|
7296
7296
|
|
|
7297
7297
|
var _proto = BlocksApi.prototype;
|
|
7298
7298
|
|
|
7299
|
+
/**
|
|
7300
|
+
* Retrieves a single block
|
|
7301
|
+
* Get block
|
|
7302
|
+
*/
|
|
7303
|
+
_proto.getBlockRaw = function getBlockRaw(requestParameters, initOverrides) {
|
|
7304
|
+
try {
|
|
7305
|
+
var _this2 = this;
|
|
7306
|
+
|
|
7307
|
+
if (requestParameters.heightOrHash === null || requestParameters.heightOrHash === undefined) {
|
|
7308
|
+
throw new RequiredError('heightOrHash', 'Required parameter requestParameters.heightOrHash was null or undefined when calling getBlock.');
|
|
7309
|
+
}
|
|
7310
|
+
|
|
7311
|
+
var queryParameters = {};
|
|
7312
|
+
var headerParameters = {};
|
|
7313
|
+
return Promise.resolve(_this2.request({
|
|
7314
|
+
path: "/extended/v2/blocks/{height_or_hash}".replace("{" + "height_or_hash" + "}", encodeURIComponent(String(requestParameters.heightOrHash))),
|
|
7315
|
+
method: 'GET',
|
|
7316
|
+
headers: headerParameters,
|
|
7317
|
+
query: queryParameters
|
|
7318
|
+
}, initOverrides)).then(function (response) {
|
|
7319
|
+
return new JSONApiResponse(response, function (jsonValue) {
|
|
7320
|
+
return NakamotoBlockFromJSON(jsonValue);
|
|
7321
|
+
});
|
|
7322
|
+
});
|
|
7323
|
+
} catch (e) {
|
|
7324
|
+
return Promise.reject(e);
|
|
7325
|
+
}
|
|
7326
|
+
}
|
|
7327
|
+
/**
|
|
7328
|
+
* Retrieves a single block
|
|
7329
|
+
* Get block
|
|
7330
|
+
*/
|
|
7331
|
+
;
|
|
7332
|
+
|
|
7333
|
+
_proto.getBlock = function getBlock(requestParameters, initOverrides) {
|
|
7334
|
+
try {
|
|
7335
|
+
var _this4 = this;
|
|
7336
|
+
|
|
7337
|
+
return Promise.resolve(_this4.getBlockRaw(requestParameters, initOverrides)).then(function (response) {
|
|
7338
|
+
return Promise.resolve(response.value());
|
|
7339
|
+
});
|
|
7340
|
+
} catch (e) {
|
|
7341
|
+
return Promise.reject(e);
|
|
7342
|
+
}
|
|
7343
|
+
}
|
|
7299
7344
|
/**
|
|
7300
7345
|
* **NOTE:** This endpoint is deprecated in favor of [Get blocks](#operation/get_blocks). Retrieves block details of a specific block for a given burnchain block hash
|
|
7301
7346
|
* Get block by burnchain block hash
|
|
7302
7347
|
*/
|
|
7348
|
+
;
|
|
7349
|
+
|
|
7303
7350
|
_proto.getBlockByBurnBlockHashRaw = function getBlockByBurnBlockHashRaw(requestParameters, initOverrides) {
|
|
7304
7351
|
try {
|
|
7305
|
-
var
|
|
7352
|
+
var _this6 = this;
|
|
7306
7353
|
|
|
7307
7354
|
if (requestParameters.burnBlockHash === null || requestParameters.burnBlockHash === undefined) {
|
|
7308
7355
|
throw new RequiredError('burnBlockHash', 'Required parameter requestParameters.burnBlockHash was null or undefined when calling getBlockByBurnBlockHash.');
|
|
@@ -7310,7 +7357,7 @@
|
|
|
7310
7357
|
|
|
7311
7358
|
var queryParameters = {};
|
|
7312
7359
|
var headerParameters = {};
|
|
7313
|
-
return Promise.resolve(
|
|
7360
|
+
return Promise.resolve(_this6.request({
|
|
7314
7361
|
path: "/extended/v1/block/by_burn_block_hash/{burn_block_hash}".replace("{" + "burn_block_hash" + "}", encodeURIComponent(String(requestParameters.burnBlockHash))),
|
|
7315
7362
|
method: 'GET',
|
|
7316
7363
|
headers: headerParameters,
|
|
@@ -7332,9 +7379,9 @@
|
|
|
7332
7379
|
|
|
7333
7380
|
_proto.getBlockByBurnBlockHash = function getBlockByBurnBlockHash(requestParameters, initOverrides) {
|
|
7334
7381
|
try {
|
|
7335
|
-
var
|
|
7382
|
+
var _this8 = this;
|
|
7336
7383
|
|
|
7337
|
-
return Promise.resolve(
|
|
7384
|
+
return Promise.resolve(_this8.getBlockByBurnBlockHashRaw(requestParameters, initOverrides)).then(function (response) {
|
|
7338
7385
|
return Promise.resolve(response.value());
|
|
7339
7386
|
});
|
|
7340
7387
|
} catch (e) {
|
|
@@ -7349,7 +7396,7 @@
|
|
|
7349
7396
|
|
|
7350
7397
|
_proto.getBlockByBurnBlockHeightRaw = function getBlockByBurnBlockHeightRaw(requestParameters, initOverrides) {
|
|
7351
7398
|
try {
|
|
7352
|
-
var
|
|
7399
|
+
var _this10 = this;
|
|
7353
7400
|
|
|
7354
7401
|
if (requestParameters.burnBlockHeight === null || requestParameters.burnBlockHeight === undefined) {
|
|
7355
7402
|
throw new RequiredError('burnBlockHeight', 'Required parameter requestParameters.burnBlockHeight was null or undefined when calling getBlockByBurnBlockHeight.');
|
|
@@ -7357,7 +7404,7 @@
|
|
|
7357
7404
|
|
|
7358
7405
|
var queryParameters = {};
|
|
7359
7406
|
var headerParameters = {};
|
|
7360
|
-
return Promise.resolve(
|
|
7407
|
+
return Promise.resolve(_this10.request({
|
|
7361
7408
|
path: "/extended/v1/block/by_burn_block_height/{burn_block_height}".replace("{" + "burn_block_height" + "}", encodeURIComponent(String(requestParameters.burnBlockHeight))),
|
|
7362
7409
|
method: 'GET',
|
|
7363
7410
|
headers: headerParameters,
|
|
@@ -7379,9 +7426,9 @@
|
|
|
7379
7426
|
|
|
7380
7427
|
_proto.getBlockByBurnBlockHeight = function getBlockByBurnBlockHeight(requestParameters, initOverrides) {
|
|
7381
7428
|
try {
|
|
7382
|
-
var
|
|
7429
|
+
var _this12 = this;
|
|
7383
7430
|
|
|
7384
|
-
return Promise.resolve(
|
|
7431
|
+
return Promise.resolve(_this12.getBlockByBurnBlockHeightRaw(requestParameters, initOverrides)).then(function (response) {
|
|
7385
7432
|
return Promise.resolve(response.value());
|
|
7386
7433
|
});
|
|
7387
7434
|
} catch (e) {
|
|
@@ -7389,14 +7436,14 @@
|
|
|
7389
7436
|
}
|
|
7390
7437
|
}
|
|
7391
7438
|
/**
|
|
7392
|
-
* Retrieves block details of a specific block for a given chain height. You can use the hash from your latest block (\'get_block_list\' API) to get your block details.
|
|
7439
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get block](#operation/get_block). Retrieves block details of a specific block for a given chain height. You can use the hash from your latest block (\'get_block_list\' API) to get your block details.
|
|
7393
7440
|
* Get block by hash
|
|
7394
7441
|
*/
|
|
7395
7442
|
;
|
|
7396
7443
|
|
|
7397
7444
|
_proto.getBlockByHashRaw = function getBlockByHashRaw(requestParameters, initOverrides) {
|
|
7398
7445
|
try {
|
|
7399
|
-
var
|
|
7446
|
+
var _this14 = this;
|
|
7400
7447
|
|
|
7401
7448
|
if (requestParameters.hash === null || requestParameters.hash === undefined) {
|
|
7402
7449
|
throw new RequiredError('hash', 'Required parameter requestParameters.hash was null or undefined when calling getBlockByHash.');
|
|
@@ -7404,7 +7451,7 @@
|
|
|
7404
7451
|
|
|
7405
7452
|
var queryParameters = {};
|
|
7406
7453
|
var headerParameters = {};
|
|
7407
|
-
return Promise.resolve(
|
|
7454
|
+
return Promise.resolve(_this14.request({
|
|
7408
7455
|
path: "/extended/v1/block/{hash}".replace("{" + "hash" + "}", encodeURIComponent(String(requestParameters.hash))),
|
|
7409
7456
|
method: 'GET',
|
|
7410
7457
|
headers: headerParameters,
|
|
@@ -7419,16 +7466,16 @@
|
|
|
7419
7466
|
}
|
|
7420
7467
|
}
|
|
7421
7468
|
/**
|
|
7422
|
-
* Retrieves block details of a specific block for a given chain height. You can use the hash from your latest block (\'get_block_list\' API) to get your block details.
|
|
7469
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get block](#operation/get_block). Retrieves block details of a specific block for a given chain height. You can use the hash from your latest block (\'get_block_list\' API) to get your block details.
|
|
7423
7470
|
* Get block by hash
|
|
7424
7471
|
*/
|
|
7425
7472
|
;
|
|
7426
7473
|
|
|
7427
7474
|
_proto.getBlockByHash = function getBlockByHash(requestParameters, initOverrides) {
|
|
7428
7475
|
try {
|
|
7429
|
-
var
|
|
7476
|
+
var _this16 = this;
|
|
7430
7477
|
|
|
7431
|
-
return Promise.resolve(
|
|
7478
|
+
return Promise.resolve(_this16.getBlockByHashRaw(requestParameters, initOverrides)).then(function (response) {
|
|
7432
7479
|
return Promise.resolve(response.value());
|
|
7433
7480
|
});
|
|
7434
7481
|
} catch (e) {
|
|
@@ -7436,14 +7483,14 @@
|
|
|
7436
7483
|
}
|
|
7437
7484
|
}
|
|
7438
7485
|
/**
|
|
7439
|
-
* Retrieves block details of a specific block at a given block height
|
|
7486
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get block](#operation/get_block). Retrieves block details of a specific block at a given block height
|
|
7440
7487
|
* Get block by height
|
|
7441
7488
|
*/
|
|
7442
7489
|
;
|
|
7443
7490
|
|
|
7444
7491
|
_proto.getBlockByHeightRaw = function getBlockByHeightRaw(requestParameters, initOverrides) {
|
|
7445
7492
|
try {
|
|
7446
|
-
var
|
|
7493
|
+
var _this18 = this;
|
|
7447
7494
|
|
|
7448
7495
|
if (requestParameters.height === null || requestParameters.height === undefined) {
|
|
7449
7496
|
throw new RequiredError('height', 'Required parameter requestParameters.height was null or undefined when calling getBlockByHeight.');
|
|
@@ -7451,7 +7498,7 @@
|
|
|
7451
7498
|
|
|
7452
7499
|
var queryParameters = {};
|
|
7453
7500
|
var headerParameters = {};
|
|
7454
|
-
return Promise.resolve(
|
|
7501
|
+
return Promise.resolve(_this18.request({
|
|
7455
7502
|
path: "/extended/v1/block/by_height/{height}".replace("{" + "height" + "}", encodeURIComponent(String(requestParameters.height))),
|
|
7456
7503
|
method: 'GET',
|
|
7457
7504
|
headers: headerParameters,
|
|
@@ -7466,16 +7513,16 @@
|
|
|
7466
7513
|
}
|
|
7467
7514
|
}
|
|
7468
7515
|
/**
|
|
7469
|
-
* Retrieves block details of a specific block at a given block height
|
|
7516
|
+
* **NOTE:** This endpoint is deprecated in favor of [Get block](#operation/get_block). Retrieves block details of a specific block at a given block height
|
|
7470
7517
|
* Get block by height
|
|
7471
7518
|
*/
|
|
7472
7519
|
;
|
|
7473
7520
|
|
|
7474
7521
|
_proto.getBlockByHeight = function getBlockByHeight(requestParameters, initOverrides) {
|
|
7475
7522
|
try {
|
|
7476
|
-
var
|
|
7523
|
+
var _this20 = this;
|
|
7477
7524
|
|
|
7478
|
-
return Promise.resolve(
|
|
7525
|
+
return Promise.resolve(_this20.getBlockByHeightRaw(requestParameters, initOverrides)).then(function (response) {
|
|
7479
7526
|
return Promise.resolve(response.value());
|
|
7480
7527
|
});
|
|
7481
7528
|
} catch (e) {
|
|
@@ -7490,7 +7537,7 @@
|
|
|
7490
7537
|
|
|
7491
7538
|
_proto.getBlockListRaw = function getBlockListRaw(requestParameters, initOverrides) {
|
|
7492
7539
|
try {
|
|
7493
|
-
var
|
|
7540
|
+
var _this22 = this;
|
|
7494
7541
|
|
|
7495
7542
|
var queryParameters = {};
|
|
7496
7543
|
|
|
@@ -7503,7 +7550,7 @@
|
|
|
7503
7550
|
}
|
|
7504
7551
|
|
|
7505
7552
|
var headerParameters = {};
|
|
7506
|
-
return Promise.resolve(
|
|
7553
|
+
return Promise.resolve(_this22.request({
|
|
7507
7554
|
path: "/extended/v1/block",
|
|
7508
7555
|
method: 'GET',
|
|
7509
7556
|
headers: headerParameters,
|
|
@@ -7525,9 +7572,9 @@
|
|
|
7525
7572
|
|
|
7526
7573
|
_proto.getBlockList = function getBlockList(requestParameters, initOverrides) {
|
|
7527
7574
|
try {
|
|
7528
|
-
var
|
|
7575
|
+
var _this24 = this;
|
|
7529
7576
|
|
|
7530
|
-
return Promise.resolve(
|
|
7577
|
+
return Promise.resolve(_this24.getBlockListRaw(requestParameters, initOverrides)).then(function (response) {
|
|
7531
7578
|
return Promise.resolve(response.value());
|
|
7532
7579
|
});
|
|
7533
7580
|
} catch (e) {
|
|
@@ -7542,7 +7589,7 @@
|
|
|
7542
7589
|
|
|
7543
7590
|
_proto.getBlocksRaw = function getBlocksRaw(requestParameters, initOverrides) {
|
|
7544
7591
|
try {
|
|
7545
|
-
var
|
|
7592
|
+
var _this26 = this;
|
|
7546
7593
|
|
|
7547
7594
|
var queryParameters = {};
|
|
7548
7595
|
|
|
@@ -7563,7 +7610,7 @@
|
|
|
7563
7610
|
}
|
|
7564
7611
|
|
|
7565
7612
|
var headerParameters = {};
|
|
7566
|
-
return Promise.resolve(
|
|
7613
|
+
return Promise.resolve(_this26.request({
|
|
7567
7614
|
path: "/extended/v2/blocks",
|
|
7568
7615
|
method: 'GET',
|
|
7569
7616
|
headers: headerParameters,
|
|
@@ -7585,9 +7632,56 @@
|
|
|
7585
7632
|
|
|
7586
7633
|
_proto.getBlocks = function getBlocks(requestParameters, initOverrides) {
|
|
7587
7634
|
try {
|
|
7588
|
-
var
|
|
7635
|
+
var _this28 = this;
|
|
7636
|
+
|
|
7637
|
+
return Promise.resolve(_this28.getBlocksRaw(requestParameters, initOverrides)).then(function (response) {
|
|
7638
|
+
return Promise.resolve(response.value());
|
|
7639
|
+
});
|
|
7640
|
+
} catch (e) {
|
|
7641
|
+
return Promise.reject(e);
|
|
7642
|
+
}
|
|
7643
|
+
}
|
|
7644
|
+
/**
|
|
7645
|
+
* Retrieves a single burn block
|
|
7646
|
+
* Get burn block
|
|
7647
|
+
*/
|
|
7648
|
+
;
|
|
7649
|
+
|
|
7650
|
+
_proto.getBurnBlockRaw = function getBurnBlockRaw(requestParameters, initOverrides) {
|
|
7651
|
+
try {
|
|
7652
|
+
var _this30 = this;
|
|
7653
|
+
|
|
7654
|
+
if (requestParameters.heightOrHash === null || requestParameters.heightOrHash === undefined) {
|
|
7655
|
+
throw new RequiredError('heightOrHash', 'Required parameter requestParameters.heightOrHash was null or undefined when calling getBurnBlock.');
|
|
7656
|
+
}
|
|
7657
|
+
|
|
7658
|
+
var queryParameters = {};
|
|
7659
|
+
var headerParameters = {};
|
|
7660
|
+
return Promise.resolve(_this30.request({
|
|
7661
|
+
path: "/extended/v2/burn-blocks/{height_or_hash}".replace("{" + "height_or_hash" + "}", encodeURIComponent(String(requestParameters.heightOrHash))),
|
|
7662
|
+
method: 'GET',
|
|
7663
|
+
headers: headerParameters,
|
|
7664
|
+
query: queryParameters
|
|
7665
|
+
}, initOverrides)).then(function (response) {
|
|
7666
|
+
return new JSONApiResponse(response, function (jsonValue) {
|
|
7667
|
+
return BurnBlockFromJSON(jsonValue);
|
|
7668
|
+
});
|
|
7669
|
+
});
|
|
7670
|
+
} catch (e) {
|
|
7671
|
+
return Promise.reject(e);
|
|
7672
|
+
}
|
|
7673
|
+
}
|
|
7674
|
+
/**
|
|
7675
|
+
* Retrieves a single burn block
|
|
7676
|
+
* Get burn block
|
|
7677
|
+
*/
|
|
7678
|
+
;
|
|
7589
7679
|
|
|
7590
|
-
|
|
7680
|
+
_proto.getBurnBlock = function getBurnBlock(requestParameters, initOverrides) {
|
|
7681
|
+
try {
|
|
7682
|
+
var _this32 = this;
|
|
7683
|
+
|
|
7684
|
+
return Promise.resolve(_this32.getBurnBlockRaw(requestParameters, initOverrides)).then(function (response) {
|
|
7591
7685
|
return Promise.resolve(response.value());
|
|
7592
7686
|
});
|
|
7593
7687
|
} catch (e) {
|
|
@@ -7596,13 +7690,13 @@
|
|
|
7596
7690
|
}
|
|
7597
7691
|
/**
|
|
7598
7692
|
* Retrieves a list of recent burn blocks
|
|
7599
|
-
* Get
|
|
7693
|
+
* Get burn blocks
|
|
7600
7694
|
*/
|
|
7601
7695
|
;
|
|
7602
7696
|
|
|
7603
|
-
_proto.
|
|
7697
|
+
_proto.getBurnBlocksRaw = function getBurnBlocksRaw(requestParameters, initOverrides) {
|
|
7604
7698
|
try {
|
|
7605
|
-
var
|
|
7699
|
+
var _this34 = this;
|
|
7606
7700
|
|
|
7607
7701
|
var queryParameters = {};
|
|
7608
7702
|
|
|
@@ -7614,17 +7708,9 @@
|
|
|
7614
7708
|
queryParameters['offset'] = requestParameters.offset;
|
|
7615
7709
|
}
|
|
7616
7710
|
|
|
7617
|
-
if (requestParameters.height !== undefined) {
|
|
7618
|
-
queryParameters['height'] = requestParameters.height;
|
|
7619
|
-
}
|
|
7620
|
-
|
|
7621
|
-
if (requestParameters.hash !== undefined) {
|
|
7622
|
-
queryParameters['hash'] = requestParameters.hash;
|
|
7623
|
-
}
|
|
7624
|
-
|
|
7625
7711
|
var headerParameters = {};
|
|
7626
|
-
return Promise.resolve(
|
|
7627
|
-
path: "/extended/
|
|
7712
|
+
return Promise.resolve(_this34.request({
|
|
7713
|
+
path: "/extended/v2/burn-blocks",
|
|
7628
7714
|
method: 'GET',
|
|
7629
7715
|
headers: headerParameters,
|
|
7630
7716
|
query: queryParameters
|
|
@@ -7639,15 +7725,15 @@
|
|
|
7639
7725
|
}
|
|
7640
7726
|
/**
|
|
7641
7727
|
* Retrieves a list of recent burn blocks
|
|
7642
|
-
* Get
|
|
7728
|
+
* Get burn blocks
|
|
7643
7729
|
*/
|
|
7644
7730
|
;
|
|
7645
7731
|
|
|
7646
|
-
_proto.
|
|
7732
|
+
_proto.getBurnBlocks = function getBurnBlocks(requestParameters, initOverrides) {
|
|
7647
7733
|
try {
|
|
7648
|
-
var
|
|
7734
|
+
var _this36 = this;
|
|
7649
7735
|
|
|
7650
|
-
return Promise.resolve(
|
|
7736
|
+
return Promise.resolve(_this36.getBurnBlocksRaw(requestParameters, initOverrides)).then(function (response) {
|
|
7651
7737
|
return Promise.resolve(response.value());
|
|
7652
7738
|
});
|
|
7653
7739
|
} catch (e) {
|