@secretkeylabs/stacks-tools 0.8.0-caef9a1 → 0.9.0-5deee01

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/dist/index.cjs CHANGED
@@ -223,28 +223,6 @@ var baseListResponseSchema = v2.object({
223
223
  });
224
224
 
225
225
  // src/stacks-api/blocks/get-block.ts
226
- var v3 = __toESM(require("valibot"), 1);
227
- var responseSchema2 = v3.object({
228
- canonical: v3.boolean(),
229
- height: v3.number(),
230
- hash: v3.string(),
231
- block_time: v3.number(),
232
- block_time_iso: v3.string(),
233
- index_block_hash: v3.string(),
234
- parent_block_hash: v3.string(),
235
- parent_index_block_hash: v3.string(),
236
- burn_block_time: v3.number(),
237
- burn_block_time_iso: v3.string(),
238
- burn_block_hash: v3.string(),
239
- burn_block_height: v3.number(),
240
- miner_txid: v3.string(),
241
- tx_count: v3.number(),
242
- execution_cost_read_count: v3.number(),
243
- execution_cost_read_length: v3.number(),
244
- execution_cost_runtime: v3.number(),
245
- execution_cost_write_count: v3.number(),
246
- execution_cost_write_length: v3.number()
247
- });
248
226
  async function getBlock(opts) {
249
227
  const init = {};
250
228
  if (opts.apiKeyConfig) {
@@ -252,10 +230,8 @@ async function getBlock(opts) {
252
230
  [opts.apiKeyConfig.header]: opts.apiKeyConfig.key
253
231
  };
254
232
  }
255
- const res = await fetch(
256
- `${opts.baseUrl}/extended/v2/blocks/${opts.heightOrHash}`,
257
- init
258
- );
233
+ const endpoint = `${opts.baseUrl}/extended/v2/blocks/${opts.heightOrHash}`;
234
+ const res = await fetch(endpoint, init);
259
235
  if (!res.ok) {
260
236
  return error({
261
237
  name: "FetchBlockError",
@@ -275,15 +251,7 @@ async function getBlock(opts) {
275
251
  data: jsonError
276
252
  });
277
253
  }
278
- const validationResult = v3.safeParse(responseSchema2, data);
279
- if (!validationResult.success) {
280
- return error({
281
- name: "ValidateDataError",
282
- message: "Failed to validate data.",
283
- data: validationResult
284
- });
285
- }
286
- return success(validationResult.output);
254
+ return success(data);
287
255
  }
288
256
 
289
257
  // src/stacks-api/blocks/index.ts
@@ -291,6 +259,44 @@ var blocks = {
291
259
  getBlock
292
260
  };
293
261
 
262
+ // src/stacks-api/burn-blocks/get-burn-block.ts
263
+ async function getBurnBlock(args) {
264
+ const init = {};
265
+ if (args.apiKeyConfig) {
266
+ init.headers = {
267
+ [args.apiKeyConfig.header]: args.apiKeyConfig.key
268
+ };
269
+ }
270
+ const endpoint = `${args.baseUrl}/extended/v2/burn-blocks/${args.heightOrHash}`;
271
+ const res = await fetch(endpoint, init);
272
+ if (!res.ok) {
273
+ return error({
274
+ name: "BurnBlockGetError",
275
+ message: "Failed to get burn block.",
276
+ data: {
277
+ heightOrHash: args.heightOrHash,
278
+ status: res.status,
279
+ statusText: res.statusText,
280
+ body: await safeExtractResponseBody(res)
281
+ }
282
+ });
283
+ }
284
+ const [jsonParseError, data] = await safePromise(res.json());
285
+ if (jsonParseError) {
286
+ return error({
287
+ name: "ParseBodyError",
288
+ message: "Failed to parse response body as JSON.",
289
+ data: jsonParseError
290
+ });
291
+ }
292
+ return success(data);
293
+ }
294
+
295
+ // src/stacks-api/burn-blocks/index.ts
296
+ var burnBlocks = {
297
+ getBurnBlock
298
+ };
299
+
294
300
  // src/stacks-api/faucets/stx.ts
295
301
  async function stx(opts) {
296
302
  const search = new URLSearchParams();
@@ -333,22 +339,22 @@ var faucets = {
333
339
  };
334
340
 
335
341
  // src/stacks-api/info/core-api.ts
336
- var v4 = __toESM(require("valibot"), 1);
337
- var CoreApiResponseSchema = v4.object({
338
- peer_version: v4.number(),
339
- pox_consensus: v4.string(),
340
- burn_block_height: v4.number(),
341
- stable_pox_consensus: v4.string(),
342
- stable_burn_block_height: v4.number(),
343
- server_version: v4.string(),
344
- network_id: v4.number(),
345
- parent_network_id: v4.number(),
346
- stacks_tip_height: v4.number(),
347
- stacks_tip: v4.string(),
348
- stacks_tip_consensus_hash: v4.string(),
349
- unanchored_tip: v4.nullable(v4.string()),
350
- unanchored_seq: v4.nullable(v4.string()),
351
- exit_at_block_height: v4.nullable(v4.number())
342
+ var v3 = __toESM(require("valibot"), 1);
343
+ var CoreApiResponseSchema = v3.object({
344
+ peer_version: v3.number(),
345
+ pox_consensus: v3.string(),
346
+ burn_block_height: v3.number(),
347
+ stable_pox_consensus: v3.string(),
348
+ stable_burn_block_height: v3.number(),
349
+ server_version: v3.string(),
350
+ network_id: v3.number(),
351
+ parent_network_id: v3.number(),
352
+ stacks_tip_height: v3.number(),
353
+ stacks_tip: v3.string(),
354
+ stacks_tip_consensus_hash: v3.string(),
355
+ unanchored_tip: v3.nullable(v3.string()),
356
+ unanchored_seq: v3.nullable(v3.string()),
357
+ exit_at_block_height: v3.nullable(v3.number())
352
358
  });
353
359
  async function coreApi(apiOpts) {
354
360
  const init = {};
@@ -377,7 +383,7 @@ async function coreApi(apiOpts) {
377
383
  data: parseBodyError
378
384
  });
379
385
  }
380
- const validationResult = v4.safeParse(CoreApiResponseSchema, data);
386
+ const validationResult = v3.safeParse(CoreApiResponseSchema, data);
381
387
  if (!validationResult.success) {
382
388
  return error({
383
389
  name: "ValidateDataError",
@@ -394,14 +400,14 @@ var info = {
394
400
  };
395
401
 
396
402
  // src/stacks-api/proof-of-transfer/cycle.ts
397
- var v5 = __toESM(require("valibot"), 1);
398
- var responseSchema3 = v5.object({
399
- block_height: v5.number(),
400
- index_block_hash: v5.string(),
401
- cycle_number: v5.number(),
402
- total_weight: v5.number(),
403
- total_stacked_amount: v5.string(),
404
- total_signers: v5.number()
403
+ var v4 = __toESM(require("valibot"), 1);
404
+ var responseSchema2 = v4.object({
405
+ block_height: v4.number(),
406
+ index_block_hash: v4.string(),
407
+ cycle_number: v4.number(),
408
+ total_weight: v4.number(),
409
+ total_stacked_amount: v4.string(),
410
+ total_signers: v4.number()
405
411
  });
406
412
  async function cycle(opts) {
407
413
  const init = {};
@@ -432,7 +438,7 @@ async function cycle(opts) {
432
438
  data: jsonError
433
439
  });
434
440
  }
435
- const validationResult = v5.safeParse(responseSchema3, data);
441
+ const validationResult = v4.safeParse(responseSchema2, data);
436
442
  if (!validationResult.success) {
437
443
  return error({
438
444
  name: "ValidateDataError",
@@ -444,17 +450,17 @@ async function cycle(opts) {
444
450
  }
445
451
 
446
452
  // src/stacks-api/proof-of-transfer/cycles.ts
447
- var v6 = __toESM(require("valibot"), 1);
448
- var cycleInfoSchema = v6.object({
449
- block_height: v6.number(),
450
- index_block_hash: v6.string(),
451
- cycle_number: v6.number(),
452
- total_weight: v6.number(),
453
- total_stacked_amount: v6.string(),
454
- total_signers: v6.number()
453
+ var v5 = __toESM(require("valibot"), 1);
454
+ var cycleInfoSchema = v5.object({
455
+ block_height: v5.number(),
456
+ index_block_hash: v5.string(),
457
+ cycle_number: v5.number(),
458
+ total_weight: v5.number(),
459
+ total_stacked_amount: v5.string(),
460
+ total_signers: v5.number()
455
461
  });
456
- var resultsSchema = v6.array(cycleInfoSchema);
457
- var cyclesResponseSchema = v6.object({
462
+ var resultsSchema = v5.array(cycleInfoSchema);
463
+ var cyclesResponseSchema = v5.object({
458
464
  ...baseListResponseSchema.entries,
459
465
  results: resultsSchema
460
466
  });
@@ -490,7 +496,7 @@ async function cycles(args) {
490
496
  data: jsonError
491
497
  });
492
498
  }
493
- const validationResult = v6.safeParse(cyclesResponseSchema, data);
499
+ const validationResult = v5.safeParse(cyclesResponseSchema, data);
494
500
  if (!validationResult.success) {
495
501
  return error({
496
502
  name: "ValidateDataError",
@@ -502,16 +508,16 @@ async function cycles(args) {
502
508
  }
503
509
 
504
510
  // src/stacks-api/proof-of-transfer/signer-in-cycle.ts
505
- var v7 = __toESM(require("valibot"), 1);
506
- var signerInCycleResponseSchema = v7.object({
507
- signing_key: v7.string(),
508
- signer_address: v7.string(),
509
- weight: v7.number(),
510
- stacked_amount: v7.string(),
511
- weight_percent: v7.number(),
512
- stacked_amount_percent: v7.number(),
513
- solo_stacker_count: v7.number(),
514
- pooled_stacker_count: v7.number()
511
+ var v6 = __toESM(require("valibot"), 1);
512
+ var signerInCycleResponseSchema = v6.object({
513
+ signing_key: v6.string(),
514
+ signer_address: v6.string(),
515
+ weight: v6.number(),
516
+ stacked_amount: v6.string(),
517
+ weight_percent: v6.number(),
518
+ stacked_amount_percent: v6.number(),
519
+ solo_stacker_count: v6.number(),
520
+ pooled_stacker_count: v6.number()
515
521
  });
516
522
  async function signerInCycle(args) {
517
523
  const init = {};
@@ -547,7 +553,7 @@ async function signerInCycle(args) {
547
553
  }
548
554
  });
549
555
  }
550
- const validationResult = v7.safeParse(signerInCycleResponseSchema, data);
556
+ const validationResult = v6.safeParse(signerInCycleResponseSchema, data);
551
557
  if (!validationResult.success) {
552
558
  return error({
553
559
  name: "ValidateDataError",
@@ -559,19 +565,19 @@ async function signerInCycle(args) {
559
565
  }
560
566
 
561
567
  // src/stacks-api/proof-of-transfer/signers-in-cycle.ts
562
- var v8 = __toESM(require("valibot"), 1);
563
- var signerSchema = v8.object({
564
- signing_key: v8.string(),
565
- signer_address: v8.string(),
566
- weight: v8.number(),
567
- stacked_amount: v8.string(),
568
- weight_percent: v8.number(),
569
- stacked_amount_percent: v8.number(),
570
- pooled_stacker_count: v8.number(),
571
- solo_stacker_count: v8.number()
568
+ var v7 = __toESM(require("valibot"), 1);
569
+ var signerSchema = v7.object({
570
+ signing_key: v7.string(),
571
+ signer_address: v7.string(),
572
+ weight: v7.number(),
573
+ stacked_amount: v7.string(),
574
+ weight_percent: v7.number(),
575
+ stacked_amount_percent: v7.number(),
576
+ pooled_stacker_count: v7.number(),
577
+ solo_stacker_count: v7.number()
572
578
  });
573
- var resultsSchema2 = v8.array(signerSchema);
574
- var signersResponseSchema = v8.object({
579
+ var resultsSchema2 = v7.array(signerSchema);
580
+ var signersResponseSchema = v7.object({
575
581
  ...baseListResponseSchema.entries,
576
582
  results: resultsSchema2
577
583
  });
@@ -610,7 +616,7 @@ async function signersInCycle(args) {
610
616
  }
611
617
  });
612
618
  }
613
- const validationResult = v8.safeParse(signersResponseSchema, data);
619
+ const validationResult = v7.safeParse(signersResponseSchema, data);
614
620
  if (!validationResult.success) {
615
621
  return error({
616
622
  name: "ValidateDataError",
@@ -942,6 +948,7 @@ var mempool = {
942
948
  var stacksApi = {
943
949
  accounts,
944
950
  blocks,
951
+ burnBlocks,
945
952
  faucets,
946
953
  info,
947
954
  mempool,
@@ -951,16 +958,16 @@ var stacksApi = {
951
958
  };
952
959
 
953
960
  // src/stacks-rpc-api/smart-contracts/map-entry.ts
954
- var v9 = __toESM(require("valibot"), 1);
955
- var mapEntryResponseSchema = v9.object({
961
+ var v8 = __toESM(require("valibot"), 1);
962
+ var mapEntryResponseSchema = v8.object({
956
963
  /**
957
964
  * Hex-encoded string of clarity value. It is always an optional tuple.
958
965
  */
959
- data: v9.string(),
966
+ data: v8.string(),
960
967
  /**
961
968
  * Hex-encoded string of the MARF proof for the data
962
969
  */
963
- proof: v9.optional(v9.string())
970
+ proof: v8.optional(v8.string())
964
971
  });
965
972
  async function mapEntry(args) {
966
973
  const search = new URLSearchParams();
@@ -1000,7 +1007,7 @@ async function mapEntry(args) {
1000
1007
  data: jsonError
1001
1008
  });
1002
1009
  }
1003
- const validationResult = v9.safeParse(mapEntryResponseSchema, data);
1010
+ const validationResult = v8.safeParse(mapEntryResponseSchema, data);
1004
1011
  if (!validationResult.success) {
1005
1012
  return error({
1006
1013
  name: "ValidateDataError",
package/dist/index.d.cts CHANGED
@@ -55,18 +55,18 @@ declare function flatResults<T>(results: Array<Result$1<T>>): Result$1<Array<T>>
55
55
  */
56
56
  declare function safeExtractResponseBody(response: Response): Promise<unknown>;
57
57
 
58
- type Args$n = {
58
+ type Args$o = {
59
59
  transactionId: string;
60
60
  } & ApiRequestOptions;
61
- type Response$8 = OperationResponse["get_raw_transaction_by_id"];
62
- declare function getRawTransaction(args: Args$n): Promise<Result$1<Response$8>>;
61
+ type Response$9 = OperationResponse["get_raw_transaction_by_id"];
62
+ declare function getRawTransaction(args: Args$o): Promise<Result$1<Response$9>>;
63
63
 
64
64
  declare const getRawTransaction$1_getRawTransaction: typeof getRawTransaction;
65
65
  declare namespace getRawTransaction$1 {
66
- export { type Args$n as Args, type Response$8 as Response, getRawTransaction$1_getRawTransaction as getRawTransaction };
66
+ export { type Args$o as Args, type Response$9 as Response, getRawTransaction$1_getRawTransaction as getRawTransaction };
67
67
  }
68
68
 
69
- type Args$m = {
69
+ type Args$n = {
70
70
  /**
71
71
  * Filter to only return transactions with this sender address.
72
72
  */
@@ -91,7 +91,7 @@ type Args$m = {
91
91
  order?: "asc" | "desc";
92
92
  } & ApiRequestOptions & ApiPaginationOptions;
93
93
  type MempoolTransactionsResponse = OperationResponse["/extended/v1/tx/mempool"];
94
- declare function mempoolTransactions(args: Args$m): Promise<Result$1<MempoolTransactionsResponse, SafeError<"FetchMempoolTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
94
+ declare function mempoolTransactions(args: Args$n): Promise<Result$1<MempoolTransactionsResponse, SafeError<"FetchMempoolTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
95
95
 
96
96
  type mempoolTransactions$1_MempoolTransactionsResponse = MempoolTransactionsResponse;
97
97
  declare const mempoolTransactions$1_mempoolTransactions: typeof mempoolTransactions;
@@ -99,34 +99,34 @@ declare namespace mempoolTransactions$1 {
99
99
  export { type mempoolTransactions$1_MempoolTransactionsResponse as MempoolTransactionsResponse, mempoolTransactions$1_mempoolTransactions as mempoolTransactions };
100
100
  }
101
101
 
102
- type Args$l = {
102
+ type Args$m = {
103
103
  transactionId: string;
104
104
  } & ApiRequestOptions;
105
- type Response$7 = OperationResponse["get_transaction_by_id"];
106
- declare function getTransaction(args: Args$l): Promise<Result$1<Response$7>>;
105
+ type Response$8 = OperationResponse["get_transaction_by_id"];
106
+ declare function getTransaction(args: Args$m): Promise<Result$1<Response$8>>;
107
107
 
108
108
  declare const getTransaction$1_getTransaction: typeof getTransaction;
109
109
  declare namespace getTransaction$1 {
110
110
  export { getTransaction$1_getTransaction as getTransaction };
111
111
  }
112
112
 
113
- type Args$k = {
113
+ type Args$l = {
114
114
  address: string;
115
115
  transactionId: string;
116
116
  } & ApiRequestOptions & ApiPaginationOptions;
117
- type Response$6 = OperationResponse["/extended/v2/addresses/{address}/transactions/{tx_id}/events"];
118
- declare function eventsForAnAddressTransaction(args: Args$k): Promise<Result$1<Response$6>>;
117
+ type Response$7 = OperationResponse["/extended/v2/addresses/{address}/transactions/{tx_id}/events"];
118
+ declare function eventsForAnAddressTransaction(args: Args$l): Promise<Result$1<Response$7>>;
119
119
 
120
120
  declare const eventsForAnAddressTransaction$1_eventsForAnAddressTransaction: typeof eventsForAnAddressTransaction;
121
121
  declare namespace eventsForAnAddressTransaction$1 {
122
122
  export { eventsForAnAddressTransaction$1_eventsForAnAddressTransaction as eventsForAnAddressTransaction };
123
123
  }
124
124
 
125
- type Args$j = {
125
+ type Args$k = {
126
126
  address: string;
127
127
  } & ApiRequestOptions & ApiPaginationOptions;
128
128
  type Result = OperationResponse["/extended/v2/addresses/{address}/transactions"];
129
- declare function addressTransactions(args: Args$j): Promise<Result$1<Result, SafeError<"FetchAddressTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
129
+ declare function addressTransactions(args: Args$k): Promise<Result$1<Result, SafeError<"FetchAddressTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
130
130
 
131
131
  type addressTransactions$1_Result = Result;
132
132
  declare const addressTransactions$1_addressTransactions: typeof addressTransactions;
@@ -134,34 +134,34 @@ declare namespace addressTransactions$1 {
134
134
  export { type addressTransactions$1_Result as Result, addressTransactions$1_addressTransactions as addressTransactions };
135
135
  }
136
136
 
137
- type Args$i = {
137
+ type Args$j = {
138
138
  poolPrincipal: string;
139
139
  afterBlock?: string | number | bigint;
140
140
  unanchored?: boolean;
141
141
  limit?: number;
142
142
  offset?: number;
143
143
  } & ApiRequestOptions & ApiPaginationOptions;
144
- type Response$5 = OperationResponse["get_pool_delegations"];
145
- declare function members(args: Args$i): Promise<Result$1<Response$5>>;
144
+ type Response$6 = OperationResponse["get_pool_delegations"];
145
+ declare function members(args: Args$j): Promise<Result$1<Response$6>>;
146
146
 
147
147
  declare const members$1_members: typeof members;
148
148
  declare namespace members$1 {
149
- export { type Args$i as Args, type Response$5 as Response, members$1_members as members };
149
+ export { type Args$j as Args, type Response$6 as Response, members$1_members as members };
150
150
  }
151
151
 
152
- type Args$h = {
152
+ type Args$i = {
153
153
  cycleNumber: string | number | bigint;
154
154
  signerPublicKey: string;
155
155
  } & ApiRequestOptions & ApiPaginationOptions;
156
- type Response$4 = OperationResponse["get_pox_cycle_signer_stackers"];
157
- declare function stackersForSignerInCycle(opts: Args$h): Promise<Result$1<Response$4, SafeError<"FetchStackersForSignerInCycleError" | "ParseBodyError">>>;
156
+ type Response$5 = OperationResponse["get_pox_cycle_signer_stackers"];
157
+ declare function stackersForSignerInCycle(opts: Args$i): Promise<Result$1<Response$5, SafeError<"FetchStackersForSignerInCycleError" | "ParseBodyError">>>;
158
158
 
159
159
  declare const stackersForSignerInCycle$1_stackersForSignerInCycle: typeof stackersForSignerInCycle;
160
160
  declare namespace stackersForSignerInCycle$1 {
161
- export { type Args$h as Args, type Response$4 as Response, stackersForSignerInCycle$1_stackersForSignerInCycle as stackersForSignerInCycle };
161
+ export { type Args$i as Args, type Response$5 as Response, stackersForSignerInCycle$1_stackersForSignerInCycle as stackersForSignerInCycle };
162
162
  }
163
163
 
164
- type Args$g = {
164
+ type Args$h = {
165
165
  cycleNumber: number;
166
166
  } & ApiRequestOptions & ApiPaginationOptions;
167
167
  declare const signerSchema: v.ObjectSchema<{
@@ -202,7 +202,7 @@ declare const signersResponseSchema: v.ObjectSchema<{
202
202
  readonly total: v.NumberSchema<undefined>;
203
203
  }, undefined>;
204
204
  type SignersResponse = v.InferOutput<typeof signersResponseSchema>;
205
- declare function signersInCycle(args: Args$g): Promise<Result$1<SignersResponse, SafeError<"FetchSignersError" | "ParseBodyError" | "ValidateDataError">>>;
205
+ declare function signersInCycle(args: Args$h): Promise<Result$1<SignersResponse, SafeError<"FetchSignersError" | "ParseBodyError" | "ValidateDataError">>>;
206
206
 
207
207
  type signersInCycle$1_Signer = Signer;
208
208
  type signersInCycle$1_SignersResponse = SignersResponse;
@@ -210,10 +210,10 @@ declare const signersInCycle$1_signerSchema: typeof signerSchema;
210
210
  declare const signersInCycle$1_signersInCycle: typeof signersInCycle;
211
211
  declare const signersInCycle$1_signersResponseSchema: typeof signersResponseSchema;
212
212
  declare namespace signersInCycle$1 {
213
- export { type Args$g as Args, type Results$1 as Results, type signersInCycle$1_Signer as Signer, type signersInCycle$1_SignersResponse as SignersResponse, resultsSchema$1 as resultsSchema, signersInCycle$1_signerSchema as signerSchema, signersInCycle$1_signersInCycle as signersInCycle, signersInCycle$1_signersResponseSchema as signersResponseSchema };
213
+ export { type Args$h as Args, type Results$1 as Results, type signersInCycle$1_Signer as Signer, type signersInCycle$1_SignersResponse as SignersResponse, resultsSchema$1 as resultsSchema, signersInCycle$1_signerSchema as signerSchema, signersInCycle$1_signersInCycle as signersInCycle, signersInCycle$1_signersResponseSchema as signersResponseSchema };
214
214
  }
215
215
 
216
- type Args$f = {
216
+ type Args$g = {
217
217
  /**
218
218
  * The signers public key as a hex string, with or without a '0x' prefix.
219
219
  */
@@ -231,16 +231,16 @@ declare const signerInCycleResponseSchema: v.ObjectSchema<{
231
231
  readonly pooled_stacker_count: v.NumberSchema<undefined>;
232
232
  }, undefined>;
233
233
  type SignerInCycleResponse = v.InferOutput<typeof signerInCycleResponseSchema>;
234
- declare function signerInCycle(args: Args$f): Promise<Result$1<SignerInCycleResponse>>;
234
+ declare function signerInCycle(args: Args$g): Promise<Result$1<SignerInCycleResponse>>;
235
235
 
236
236
  type signerInCycle$1_SignerInCycleResponse = SignerInCycleResponse;
237
237
  declare const signerInCycle$1_signerInCycle: typeof signerInCycle;
238
238
  declare const signerInCycle$1_signerInCycleResponseSchema: typeof signerInCycleResponseSchema;
239
239
  declare namespace signerInCycle$1 {
240
- export { type Args$f as Args, type signerInCycle$1_SignerInCycleResponse as SignerInCycleResponse, signerInCycle$1_signerInCycle as signerInCycle, signerInCycle$1_signerInCycleResponseSchema as signerInCycleResponseSchema };
240
+ export { type Args$g as Args, type signerInCycle$1_SignerInCycleResponse as SignerInCycleResponse, signerInCycle$1_signerInCycle as signerInCycle, signerInCycle$1_signerInCycleResponseSchema as signerInCycleResponseSchema };
241
241
  }
242
242
 
243
- type Args$e = ApiRequestOptions & ApiPaginationOptions;
243
+ type Args$f = ApiRequestOptions & ApiPaginationOptions;
244
244
  declare const cycleInfoSchema: v.ObjectSchema<{
245
245
  readonly block_height: v.NumberSchema<undefined>;
246
246
  readonly index_block_hash: v.StringSchema<undefined>;
@@ -273,7 +273,7 @@ declare const cyclesResponseSchema: v.ObjectSchema<{
273
273
  readonly total: v.NumberSchema<undefined>;
274
274
  }, undefined>;
275
275
  type CyclesResponse = v.InferOutput<typeof cyclesResponseSchema>;
276
- declare function cycles(args: Args$e): Promise<Result$1<CyclesResponse>>;
276
+ declare function cycles(args: Args$f): Promise<Result$1<CyclesResponse>>;
277
277
 
278
278
  type cycles$1_CycleInfo = CycleInfo;
279
279
  type cycles$1_CyclesResponse = CyclesResponse;
@@ -283,13 +283,13 @@ declare const cycles$1_cycles: typeof cycles;
283
283
  declare const cycles$1_cyclesResponseSchema: typeof cyclesResponseSchema;
284
284
  declare const cycles$1_resultsSchema: typeof resultsSchema;
285
285
  declare namespace cycles$1 {
286
- export { type Args$e as Args, type cycles$1_CycleInfo as CycleInfo, type cycles$1_CyclesResponse as CyclesResponse, type cycles$1_Results as Results, cycles$1_cycleInfoSchema as cycleInfoSchema, cycles$1_cycles as cycles, cycles$1_cyclesResponseSchema as cyclesResponseSchema, cycles$1_resultsSchema as resultsSchema };
286
+ export { type Args$f as Args, type cycles$1_CycleInfo as CycleInfo, type cycles$1_CyclesResponse as CyclesResponse, type cycles$1_Results as Results, cycles$1_cycleInfoSchema as cycleInfoSchema, cycles$1_cycles as cycles, cycles$1_cyclesResponseSchema as cyclesResponseSchema, cycles$1_resultsSchema as resultsSchema };
287
287
  }
288
288
 
289
- type Args$d = {
289
+ type Args$e = {
290
290
  cycleNumber: number;
291
291
  } & ApiRequestOptions;
292
- declare const responseSchema$2: v.ObjectSchema<{
292
+ declare const responseSchema$1: v.ObjectSchema<{
293
293
  readonly block_height: v.NumberSchema<undefined>;
294
294
  readonly index_block_hash: v.StringSchema<undefined>;
295
295
  readonly cycle_number: v.NumberSchema<undefined>;
@@ -297,12 +297,12 @@ declare const responseSchema$2: v.ObjectSchema<{
297
297
  readonly total_stacked_amount: v.StringSchema<undefined>;
298
298
  readonly total_signers: v.NumberSchema<undefined>;
299
299
  }, undefined>;
300
- type Response$3 = v.InferOutput<typeof responseSchema$2>;
301
- declare function cycle(opts: Args$d): Promise<Result$1<Response$3, SafeError<"FetchCycleError" | "ParseBodyError" | "ValidateDataError">>>;
300
+ type Response$4 = v.InferOutput<typeof responseSchema$1>;
301
+ declare function cycle(opts: Args$e): Promise<Result$1<Response$4, SafeError<"FetchCycleError" | "ParseBodyError" | "ValidateDataError">>>;
302
302
 
303
303
  declare const cycle$1_cycle: typeof cycle;
304
304
  declare namespace cycle$1 {
305
- export { type Args$d as Args, type Response$3 as Response, cycle$1_cycle as cycle, responseSchema$2 as responseSchema };
305
+ export { type Args$e as Args, type Response$4 as Response, cycle$1_cycle as cycle, responseSchema$1 as responseSchema };
306
306
  }
307
307
 
308
308
  type FeePrioritiesResponse = {
@@ -364,47 +364,37 @@ declare namespace coreApi$1 {
364
364
  export { type coreApi$1_CoreApiResponse as CoreApiResponse, coreApi$1_coreApi as coreApi };
365
365
  }
366
366
 
367
- type Args$c = {
367
+ type Args$d = {
368
368
  address: string;
369
369
  stacking?: boolean;
370
370
  } & ApiRequestOptions;
371
- declare function stx(opts: Args$c): Promise<Result$1<any>>;
371
+ declare function stx(opts: Args$d): Promise<Result$1<any>>;
372
372
 
373
373
  declare const stx$1_stx: typeof stx;
374
374
  declare namespace stx$1 {
375
- export { type Args$c as Args, stx$1_stx as stx };
375
+ export { type Args$d as Args, stx$1_stx as stx };
376
+ }
377
+
378
+ type Args$c = {
379
+ heightOrHash: string | number | bigint;
380
+ } & ApiRequestOptions;
381
+ type Response$3 = OperationResponse["get_burn_block"];
382
+ declare function getBurnBlock(args: Args$c): Promise<Result$1<Response$3>>;
383
+
384
+ declare const getBurnBlock$1_getBurnBlock: typeof getBurnBlock;
385
+ declare namespace getBurnBlock$1 {
386
+ export { type Args$c as Args, type Response$3 as Response, getBurnBlock$1_getBurnBlock as getBurnBlock };
376
387
  }
377
388
 
378
389
  type Args$b = {
379
390
  heightOrHash: string | number;
380
391
  } & ApiRequestOptions;
381
- declare const responseSchema$1: v.ObjectSchema<{
382
- readonly canonical: v.BooleanSchema<undefined>;
383
- readonly height: v.NumberSchema<undefined>;
384
- readonly hash: v.StringSchema<undefined>;
385
- readonly block_time: v.NumberSchema<undefined>;
386
- readonly block_time_iso: v.StringSchema<undefined>;
387
- readonly index_block_hash: v.StringSchema<undefined>;
388
- readonly parent_block_hash: v.StringSchema<undefined>;
389
- readonly parent_index_block_hash: v.StringSchema<undefined>;
390
- readonly burn_block_time: v.NumberSchema<undefined>;
391
- readonly burn_block_time_iso: v.StringSchema<undefined>;
392
- readonly burn_block_hash: v.StringSchema<undefined>;
393
- readonly burn_block_height: v.NumberSchema<undefined>;
394
- readonly miner_txid: v.StringSchema<undefined>;
395
- readonly tx_count: v.NumberSchema<undefined>;
396
- readonly execution_cost_read_count: v.NumberSchema<undefined>;
397
- readonly execution_cost_read_length: v.NumberSchema<undefined>;
398
- readonly execution_cost_runtime: v.NumberSchema<undefined>;
399
- readonly execution_cost_write_count: v.NumberSchema<undefined>;
400
- readonly execution_cost_write_length: v.NumberSchema<undefined>;
401
- }, undefined>;
402
- type Response$2 = v.InferOutput<typeof responseSchema$1>;
403
- declare function getBlock(opts: Args$b): Promise<Result$1<Response$2, SafeError<"FetchBlockError" | "ParseBodyError" | "ValidateDataError">>>;
392
+ type Response$2 = OperationResponse["get_block"];
393
+ declare function getBlock(opts: Args$b): Promise<Result$1<Response$2>>;
404
394
 
405
395
  declare const getBlock$1_getBlock: typeof getBlock;
406
396
  declare namespace getBlock$1 {
407
- export { type Args$b as Args, type Response$2 as Response, getBlock$1_getBlock as getBlock, responseSchema$1 as responseSchema };
397
+ export { type Args$b as Args, type Response$2 as Response, getBlock$1_getBlock as getBlock };
408
398
  }
409
399
 
410
400
  type Args$a = {
@@ -443,7 +433,7 @@ declare const accounts$1: {
443
433
  latestNonce: typeof latestNonce;
444
434
  };
445
435
 
446
- declare namespace index$f {
436
+ declare namespace index$g {
447
437
  export { balances$1 as Balances, latestNonce$1 as LatestNonce, accounts$1 as accounts };
448
438
  }
449
439
 
@@ -451,9 +441,18 @@ declare const blocks: {
451
441
  getBlock: typeof getBlock;
452
442
  };
453
443
 
454
- declare const index$e_blocks: typeof blocks;
444
+ declare const index$f_blocks: typeof blocks;
445
+ declare namespace index$f {
446
+ export { getBlock$1 as GetBlock, index$f_blocks as blocks };
447
+ }
448
+
449
+ declare const burnBlocks: {
450
+ getBurnBlock: typeof getBurnBlock;
451
+ };
452
+
453
+ declare const index$e_burnBlocks: typeof burnBlocks;
455
454
  declare namespace index$e {
456
- export { getBlock$1 as GetBlock, index$e_blocks as blocks };
455
+ export { getBurnBlock$1 as GetBurnBlock, index$e_burnBlocks as burnBlocks };
457
456
  }
458
457
 
459
458
  declare const faucets: {
@@ -525,6 +524,9 @@ declare const stacksApi: {
525
524
  blocks: {
526
525
  getBlock: typeof getBlock;
527
526
  };
527
+ burnBlocks: {
528
+ getBurnBlock: typeof getBurnBlock;
529
+ };
528
530
  faucets: {
529
531
  stx: typeof stx;
530
532
  };
@@ -555,7 +557,7 @@ declare const stacksApi: {
555
557
 
556
558
  declare const index$7_stacksApi: typeof stacksApi;
557
559
  declare namespace index$7 {
558
- export { index$f as Accounts, index$e as Blocks, index$d as Faucets, index$c as Info, index$8 as Mempool, index$b as ProofOfTransfer, index$a as StackingPool, index$9 as Transactions, index$7_stacksApi as stacksApi };
560
+ export { index$g as Accounts, index$f as Blocks, index$e as BurnBlocks, index$d as Faucets, index$c as Info, index$8 as Mempool, index$b as ProofOfTransfer, index$a as StackingPool, index$9 as Transactions, index$7_stacksApi as stacksApi };
559
561
  }
560
562
 
561
563
  type Args$8 = {
package/dist/index.d.ts CHANGED
@@ -55,18 +55,18 @@ declare function flatResults<T>(results: Array<Result$1<T>>): Result$1<Array<T>>
55
55
  */
56
56
  declare function safeExtractResponseBody(response: Response): Promise<unknown>;
57
57
 
58
- type Args$n = {
58
+ type Args$o = {
59
59
  transactionId: string;
60
60
  } & ApiRequestOptions;
61
- type Response$8 = OperationResponse["get_raw_transaction_by_id"];
62
- declare function getRawTransaction(args: Args$n): Promise<Result$1<Response$8>>;
61
+ type Response$9 = OperationResponse["get_raw_transaction_by_id"];
62
+ declare function getRawTransaction(args: Args$o): Promise<Result$1<Response$9>>;
63
63
 
64
64
  declare const getRawTransaction$1_getRawTransaction: typeof getRawTransaction;
65
65
  declare namespace getRawTransaction$1 {
66
- export { type Args$n as Args, type Response$8 as Response, getRawTransaction$1_getRawTransaction as getRawTransaction };
66
+ export { type Args$o as Args, type Response$9 as Response, getRawTransaction$1_getRawTransaction as getRawTransaction };
67
67
  }
68
68
 
69
- type Args$m = {
69
+ type Args$n = {
70
70
  /**
71
71
  * Filter to only return transactions with this sender address.
72
72
  */
@@ -91,7 +91,7 @@ type Args$m = {
91
91
  order?: "asc" | "desc";
92
92
  } & ApiRequestOptions & ApiPaginationOptions;
93
93
  type MempoolTransactionsResponse = OperationResponse["/extended/v1/tx/mempool"];
94
- declare function mempoolTransactions(args: Args$m): Promise<Result$1<MempoolTransactionsResponse, SafeError<"FetchMempoolTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
94
+ declare function mempoolTransactions(args: Args$n): Promise<Result$1<MempoolTransactionsResponse, SafeError<"FetchMempoolTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
95
95
 
96
96
  type mempoolTransactions$1_MempoolTransactionsResponse = MempoolTransactionsResponse;
97
97
  declare const mempoolTransactions$1_mempoolTransactions: typeof mempoolTransactions;
@@ -99,34 +99,34 @@ declare namespace mempoolTransactions$1 {
99
99
  export { type mempoolTransactions$1_MempoolTransactionsResponse as MempoolTransactionsResponse, mempoolTransactions$1_mempoolTransactions as mempoolTransactions };
100
100
  }
101
101
 
102
- type Args$l = {
102
+ type Args$m = {
103
103
  transactionId: string;
104
104
  } & ApiRequestOptions;
105
- type Response$7 = OperationResponse["get_transaction_by_id"];
106
- declare function getTransaction(args: Args$l): Promise<Result$1<Response$7>>;
105
+ type Response$8 = OperationResponse["get_transaction_by_id"];
106
+ declare function getTransaction(args: Args$m): Promise<Result$1<Response$8>>;
107
107
 
108
108
  declare const getTransaction$1_getTransaction: typeof getTransaction;
109
109
  declare namespace getTransaction$1 {
110
110
  export { getTransaction$1_getTransaction as getTransaction };
111
111
  }
112
112
 
113
- type Args$k = {
113
+ type Args$l = {
114
114
  address: string;
115
115
  transactionId: string;
116
116
  } & ApiRequestOptions & ApiPaginationOptions;
117
- type Response$6 = OperationResponse["/extended/v2/addresses/{address}/transactions/{tx_id}/events"];
118
- declare function eventsForAnAddressTransaction(args: Args$k): Promise<Result$1<Response$6>>;
117
+ type Response$7 = OperationResponse["/extended/v2/addresses/{address}/transactions/{tx_id}/events"];
118
+ declare function eventsForAnAddressTransaction(args: Args$l): Promise<Result$1<Response$7>>;
119
119
 
120
120
  declare const eventsForAnAddressTransaction$1_eventsForAnAddressTransaction: typeof eventsForAnAddressTransaction;
121
121
  declare namespace eventsForAnAddressTransaction$1 {
122
122
  export { eventsForAnAddressTransaction$1_eventsForAnAddressTransaction as eventsForAnAddressTransaction };
123
123
  }
124
124
 
125
- type Args$j = {
125
+ type Args$k = {
126
126
  address: string;
127
127
  } & ApiRequestOptions & ApiPaginationOptions;
128
128
  type Result = OperationResponse["/extended/v2/addresses/{address}/transactions"];
129
- declare function addressTransactions(args: Args$j): Promise<Result$1<Result, SafeError<"FetchAddressTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
129
+ declare function addressTransactions(args: Args$k): Promise<Result$1<Result, SafeError<"FetchAddressTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
130
130
 
131
131
  type addressTransactions$1_Result = Result;
132
132
  declare const addressTransactions$1_addressTransactions: typeof addressTransactions;
@@ -134,34 +134,34 @@ declare namespace addressTransactions$1 {
134
134
  export { type addressTransactions$1_Result as Result, addressTransactions$1_addressTransactions as addressTransactions };
135
135
  }
136
136
 
137
- type Args$i = {
137
+ type Args$j = {
138
138
  poolPrincipal: string;
139
139
  afterBlock?: string | number | bigint;
140
140
  unanchored?: boolean;
141
141
  limit?: number;
142
142
  offset?: number;
143
143
  } & ApiRequestOptions & ApiPaginationOptions;
144
- type Response$5 = OperationResponse["get_pool_delegations"];
145
- declare function members(args: Args$i): Promise<Result$1<Response$5>>;
144
+ type Response$6 = OperationResponse["get_pool_delegations"];
145
+ declare function members(args: Args$j): Promise<Result$1<Response$6>>;
146
146
 
147
147
  declare const members$1_members: typeof members;
148
148
  declare namespace members$1 {
149
- export { type Args$i as Args, type Response$5 as Response, members$1_members as members };
149
+ export { type Args$j as Args, type Response$6 as Response, members$1_members as members };
150
150
  }
151
151
 
152
- type Args$h = {
152
+ type Args$i = {
153
153
  cycleNumber: string | number | bigint;
154
154
  signerPublicKey: string;
155
155
  } & ApiRequestOptions & ApiPaginationOptions;
156
- type Response$4 = OperationResponse["get_pox_cycle_signer_stackers"];
157
- declare function stackersForSignerInCycle(opts: Args$h): Promise<Result$1<Response$4, SafeError<"FetchStackersForSignerInCycleError" | "ParseBodyError">>>;
156
+ type Response$5 = OperationResponse["get_pox_cycle_signer_stackers"];
157
+ declare function stackersForSignerInCycle(opts: Args$i): Promise<Result$1<Response$5, SafeError<"FetchStackersForSignerInCycleError" | "ParseBodyError">>>;
158
158
 
159
159
  declare const stackersForSignerInCycle$1_stackersForSignerInCycle: typeof stackersForSignerInCycle;
160
160
  declare namespace stackersForSignerInCycle$1 {
161
- export { type Args$h as Args, type Response$4 as Response, stackersForSignerInCycle$1_stackersForSignerInCycle as stackersForSignerInCycle };
161
+ export { type Args$i as Args, type Response$5 as Response, stackersForSignerInCycle$1_stackersForSignerInCycle as stackersForSignerInCycle };
162
162
  }
163
163
 
164
- type Args$g = {
164
+ type Args$h = {
165
165
  cycleNumber: number;
166
166
  } & ApiRequestOptions & ApiPaginationOptions;
167
167
  declare const signerSchema: v.ObjectSchema<{
@@ -202,7 +202,7 @@ declare const signersResponseSchema: v.ObjectSchema<{
202
202
  readonly total: v.NumberSchema<undefined>;
203
203
  }, undefined>;
204
204
  type SignersResponse = v.InferOutput<typeof signersResponseSchema>;
205
- declare function signersInCycle(args: Args$g): Promise<Result$1<SignersResponse, SafeError<"FetchSignersError" | "ParseBodyError" | "ValidateDataError">>>;
205
+ declare function signersInCycle(args: Args$h): Promise<Result$1<SignersResponse, SafeError<"FetchSignersError" | "ParseBodyError" | "ValidateDataError">>>;
206
206
 
207
207
  type signersInCycle$1_Signer = Signer;
208
208
  type signersInCycle$1_SignersResponse = SignersResponse;
@@ -210,10 +210,10 @@ declare const signersInCycle$1_signerSchema: typeof signerSchema;
210
210
  declare const signersInCycle$1_signersInCycle: typeof signersInCycle;
211
211
  declare const signersInCycle$1_signersResponseSchema: typeof signersResponseSchema;
212
212
  declare namespace signersInCycle$1 {
213
- export { type Args$g as Args, type Results$1 as Results, type signersInCycle$1_Signer as Signer, type signersInCycle$1_SignersResponse as SignersResponse, resultsSchema$1 as resultsSchema, signersInCycle$1_signerSchema as signerSchema, signersInCycle$1_signersInCycle as signersInCycle, signersInCycle$1_signersResponseSchema as signersResponseSchema };
213
+ export { type Args$h as Args, type Results$1 as Results, type signersInCycle$1_Signer as Signer, type signersInCycle$1_SignersResponse as SignersResponse, resultsSchema$1 as resultsSchema, signersInCycle$1_signerSchema as signerSchema, signersInCycle$1_signersInCycle as signersInCycle, signersInCycle$1_signersResponseSchema as signersResponseSchema };
214
214
  }
215
215
 
216
- type Args$f = {
216
+ type Args$g = {
217
217
  /**
218
218
  * The signers public key as a hex string, with or without a '0x' prefix.
219
219
  */
@@ -231,16 +231,16 @@ declare const signerInCycleResponseSchema: v.ObjectSchema<{
231
231
  readonly pooled_stacker_count: v.NumberSchema<undefined>;
232
232
  }, undefined>;
233
233
  type SignerInCycleResponse = v.InferOutput<typeof signerInCycleResponseSchema>;
234
- declare function signerInCycle(args: Args$f): Promise<Result$1<SignerInCycleResponse>>;
234
+ declare function signerInCycle(args: Args$g): Promise<Result$1<SignerInCycleResponse>>;
235
235
 
236
236
  type signerInCycle$1_SignerInCycleResponse = SignerInCycleResponse;
237
237
  declare const signerInCycle$1_signerInCycle: typeof signerInCycle;
238
238
  declare const signerInCycle$1_signerInCycleResponseSchema: typeof signerInCycleResponseSchema;
239
239
  declare namespace signerInCycle$1 {
240
- export { type Args$f as Args, type signerInCycle$1_SignerInCycleResponse as SignerInCycleResponse, signerInCycle$1_signerInCycle as signerInCycle, signerInCycle$1_signerInCycleResponseSchema as signerInCycleResponseSchema };
240
+ export { type Args$g as Args, type signerInCycle$1_SignerInCycleResponse as SignerInCycleResponse, signerInCycle$1_signerInCycle as signerInCycle, signerInCycle$1_signerInCycleResponseSchema as signerInCycleResponseSchema };
241
241
  }
242
242
 
243
- type Args$e = ApiRequestOptions & ApiPaginationOptions;
243
+ type Args$f = ApiRequestOptions & ApiPaginationOptions;
244
244
  declare const cycleInfoSchema: v.ObjectSchema<{
245
245
  readonly block_height: v.NumberSchema<undefined>;
246
246
  readonly index_block_hash: v.StringSchema<undefined>;
@@ -273,7 +273,7 @@ declare const cyclesResponseSchema: v.ObjectSchema<{
273
273
  readonly total: v.NumberSchema<undefined>;
274
274
  }, undefined>;
275
275
  type CyclesResponse = v.InferOutput<typeof cyclesResponseSchema>;
276
- declare function cycles(args: Args$e): Promise<Result$1<CyclesResponse>>;
276
+ declare function cycles(args: Args$f): Promise<Result$1<CyclesResponse>>;
277
277
 
278
278
  type cycles$1_CycleInfo = CycleInfo;
279
279
  type cycles$1_CyclesResponse = CyclesResponse;
@@ -283,13 +283,13 @@ declare const cycles$1_cycles: typeof cycles;
283
283
  declare const cycles$1_cyclesResponseSchema: typeof cyclesResponseSchema;
284
284
  declare const cycles$1_resultsSchema: typeof resultsSchema;
285
285
  declare namespace cycles$1 {
286
- export { type Args$e as Args, type cycles$1_CycleInfo as CycleInfo, type cycles$1_CyclesResponse as CyclesResponse, type cycles$1_Results as Results, cycles$1_cycleInfoSchema as cycleInfoSchema, cycles$1_cycles as cycles, cycles$1_cyclesResponseSchema as cyclesResponseSchema, cycles$1_resultsSchema as resultsSchema };
286
+ export { type Args$f as Args, type cycles$1_CycleInfo as CycleInfo, type cycles$1_CyclesResponse as CyclesResponse, type cycles$1_Results as Results, cycles$1_cycleInfoSchema as cycleInfoSchema, cycles$1_cycles as cycles, cycles$1_cyclesResponseSchema as cyclesResponseSchema, cycles$1_resultsSchema as resultsSchema };
287
287
  }
288
288
 
289
- type Args$d = {
289
+ type Args$e = {
290
290
  cycleNumber: number;
291
291
  } & ApiRequestOptions;
292
- declare const responseSchema$2: v.ObjectSchema<{
292
+ declare const responseSchema$1: v.ObjectSchema<{
293
293
  readonly block_height: v.NumberSchema<undefined>;
294
294
  readonly index_block_hash: v.StringSchema<undefined>;
295
295
  readonly cycle_number: v.NumberSchema<undefined>;
@@ -297,12 +297,12 @@ declare const responseSchema$2: v.ObjectSchema<{
297
297
  readonly total_stacked_amount: v.StringSchema<undefined>;
298
298
  readonly total_signers: v.NumberSchema<undefined>;
299
299
  }, undefined>;
300
- type Response$3 = v.InferOutput<typeof responseSchema$2>;
301
- declare function cycle(opts: Args$d): Promise<Result$1<Response$3, SafeError<"FetchCycleError" | "ParseBodyError" | "ValidateDataError">>>;
300
+ type Response$4 = v.InferOutput<typeof responseSchema$1>;
301
+ declare function cycle(opts: Args$e): Promise<Result$1<Response$4, SafeError<"FetchCycleError" | "ParseBodyError" | "ValidateDataError">>>;
302
302
 
303
303
  declare const cycle$1_cycle: typeof cycle;
304
304
  declare namespace cycle$1 {
305
- export { type Args$d as Args, type Response$3 as Response, cycle$1_cycle as cycle, responseSchema$2 as responseSchema };
305
+ export { type Args$e as Args, type Response$4 as Response, cycle$1_cycle as cycle, responseSchema$1 as responseSchema };
306
306
  }
307
307
 
308
308
  type FeePrioritiesResponse = {
@@ -364,47 +364,37 @@ declare namespace coreApi$1 {
364
364
  export { type coreApi$1_CoreApiResponse as CoreApiResponse, coreApi$1_coreApi as coreApi };
365
365
  }
366
366
 
367
- type Args$c = {
367
+ type Args$d = {
368
368
  address: string;
369
369
  stacking?: boolean;
370
370
  } & ApiRequestOptions;
371
- declare function stx(opts: Args$c): Promise<Result$1<any>>;
371
+ declare function stx(opts: Args$d): Promise<Result$1<any>>;
372
372
 
373
373
  declare const stx$1_stx: typeof stx;
374
374
  declare namespace stx$1 {
375
- export { type Args$c as Args, stx$1_stx as stx };
375
+ export { type Args$d as Args, stx$1_stx as stx };
376
+ }
377
+
378
+ type Args$c = {
379
+ heightOrHash: string | number | bigint;
380
+ } & ApiRequestOptions;
381
+ type Response$3 = OperationResponse["get_burn_block"];
382
+ declare function getBurnBlock(args: Args$c): Promise<Result$1<Response$3>>;
383
+
384
+ declare const getBurnBlock$1_getBurnBlock: typeof getBurnBlock;
385
+ declare namespace getBurnBlock$1 {
386
+ export { type Args$c as Args, type Response$3 as Response, getBurnBlock$1_getBurnBlock as getBurnBlock };
376
387
  }
377
388
 
378
389
  type Args$b = {
379
390
  heightOrHash: string | number;
380
391
  } & ApiRequestOptions;
381
- declare const responseSchema$1: v.ObjectSchema<{
382
- readonly canonical: v.BooleanSchema<undefined>;
383
- readonly height: v.NumberSchema<undefined>;
384
- readonly hash: v.StringSchema<undefined>;
385
- readonly block_time: v.NumberSchema<undefined>;
386
- readonly block_time_iso: v.StringSchema<undefined>;
387
- readonly index_block_hash: v.StringSchema<undefined>;
388
- readonly parent_block_hash: v.StringSchema<undefined>;
389
- readonly parent_index_block_hash: v.StringSchema<undefined>;
390
- readonly burn_block_time: v.NumberSchema<undefined>;
391
- readonly burn_block_time_iso: v.StringSchema<undefined>;
392
- readonly burn_block_hash: v.StringSchema<undefined>;
393
- readonly burn_block_height: v.NumberSchema<undefined>;
394
- readonly miner_txid: v.StringSchema<undefined>;
395
- readonly tx_count: v.NumberSchema<undefined>;
396
- readonly execution_cost_read_count: v.NumberSchema<undefined>;
397
- readonly execution_cost_read_length: v.NumberSchema<undefined>;
398
- readonly execution_cost_runtime: v.NumberSchema<undefined>;
399
- readonly execution_cost_write_count: v.NumberSchema<undefined>;
400
- readonly execution_cost_write_length: v.NumberSchema<undefined>;
401
- }, undefined>;
402
- type Response$2 = v.InferOutput<typeof responseSchema$1>;
403
- declare function getBlock(opts: Args$b): Promise<Result$1<Response$2, SafeError<"FetchBlockError" | "ParseBodyError" | "ValidateDataError">>>;
392
+ type Response$2 = OperationResponse["get_block"];
393
+ declare function getBlock(opts: Args$b): Promise<Result$1<Response$2>>;
404
394
 
405
395
  declare const getBlock$1_getBlock: typeof getBlock;
406
396
  declare namespace getBlock$1 {
407
- export { type Args$b as Args, type Response$2 as Response, getBlock$1_getBlock as getBlock, responseSchema$1 as responseSchema };
397
+ export { type Args$b as Args, type Response$2 as Response, getBlock$1_getBlock as getBlock };
408
398
  }
409
399
 
410
400
  type Args$a = {
@@ -443,7 +433,7 @@ declare const accounts$1: {
443
433
  latestNonce: typeof latestNonce;
444
434
  };
445
435
 
446
- declare namespace index$f {
436
+ declare namespace index$g {
447
437
  export { balances$1 as Balances, latestNonce$1 as LatestNonce, accounts$1 as accounts };
448
438
  }
449
439
 
@@ -451,9 +441,18 @@ declare const blocks: {
451
441
  getBlock: typeof getBlock;
452
442
  };
453
443
 
454
- declare const index$e_blocks: typeof blocks;
444
+ declare const index$f_blocks: typeof blocks;
445
+ declare namespace index$f {
446
+ export { getBlock$1 as GetBlock, index$f_blocks as blocks };
447
+ }
448
+
449
+ declare const burnBlocks: {
450
+ getBurnBlock: typeof getBurnBlock;
451
+ };
452
+
453
+ declare const index$e_burnBlocks: typeof burnBlocks;
455
454
  declare namespace index$e {
456
- export { getBlock$1 as GetBlock, index$e_blocks as blocks };
455
+ export { getBurnBlock$1 as GetBurnBlock, index$e_burnBlocks as burnBlocks };
457
456
  }
458
457
 
459
458
  declare const faucets: {
@@ -525,6 +524,9 @@ declare const stacksApi: {
525
524
  blocks: {
526
525
  getBlock: typeof getBlock;
527
526
  };
527
+ burnBlocks: {
528
+ getBurnBlock: typeof getBurnBlock;
529
+ };
528
530
  faucets: {
529
531
  stx: typeof stx;
530
532
  };
@@ -555,7 +557,7 @@ declare const stacksApi: {
555
557
 
556
558
  declare const index$7_stacksApi: typeof stacksApi;
557
559
  declare namespace index$7 {
558
- export { index$f as Accounts, index$e as Blocks, index$d as Faucets, index$c as Info, index$8 as Mempool, index$b as ProofOfTransfer, index$a as StackingPool, index$9 as Transactions, index$7_stacksApi as stacksApi };
560
+ export { index$g as Accounts, index$f as Blocks, index$e as BurnBlocks, index$d as Faucets, index$c as Info, index$8 as Mempool, index$b as ProofOfTransfer, index$a as StackingPool, index$9 as Transactions, index$7_stacksApi as stacksApi };
559
561
  }
560
562
 
561
563
  type Args$8 = {
package/dist/index.js CHANGED
@@ -175,28 +175,6 @@ var baseListResponseSchema = v2.object({
175
175
  });
176
176
 
177
177
  // src/stacks-api/blocks/get-block.ts
178
- import * as v3 from "valibot";
179
- var responseSchema2 = v3.object({
180
- canonical: v3.boolean(),
181
- height: v3.number(),
182
- hash: v3.string(),
183
- block_time: v3.number(),
184
- block_time_iso: v3.string(),
185
- index_block_hash: v3.string(),
186
- parent_block_hash: v3.string(),
187
- parent_index_block_hash: v3.string(),
188
- burn_block_time: v3.number(),
189
- burn_block_time_iso: v3.string(),
190
- burn_block_hash: v3.string(),
191
- burn_block_height: v3.number(),
192
- miner_txid: v3.string(),
193
- tx_count: v3.number(),
194
- execution_cost_read_count: v3.number(),
195
- execution_cost_read_length: v3.number(),
196
- execution_cost_runtime: v3.number(),
197
- execution_cost_write_count: v3.number(),
198
- execution_cost_write_length: v3.number()
199
- });
200
178
  async function getBlock(opts) {
201
179
  const init = {};
202
180
  if (opts.apiKeyConfig) {
@@ -204,10 +182,8 @@ async function getBlock(opts) {
204
182
  [opts.apiKeyConfig.header]: opts.apiKeyConfig.key
205
183
  };
206
184
  }
207
- const res = await fetch(
208
- `${opts.baseUrl}/extended/v2/blocks/${opts.heightOrHash}`,
209
- init
210
- );
185
+ const endpoint = `${opts.baseUrl}/extended/v2/blocks/${opts.heightOrHash}`;
186
+ const res = await fetch(endpoint, init);
211
187
  if (!res.ok) {
212
188
  return error({
213
189
  name: "FetchBlockError",
@@ -227,15 +203,7 @@ async function getBlock(opts) {
227
203
  data: jsonError
228
204
  });
229
205
  }
230
- const validationResult = v3.safeParse(responseSchema2, data);
231
- if (!validationResult.success) {
232
- return error({
233
- name: "ValidateDataError",
234
- message: "Failed to validate data.",
235
- data: validationResult
236
- });
237
- }
238
- return success(validationResult.output);
206
+ return success(data);
239
207
  }
240
208
 
241
209
  // src/stacks-api/blocks/index.ts
@@ -243,6 +211,44 @@ var blocks = {
243
211
  getBlock
244
212
  };
245
213
 
214
+ // src/stacks-api/burn-blocks/get-burn-block.ts
215
+ async function getBurnBlock(args) {
216
+ const init = {};
217
+ if (args.apiKeyConfig) {
218
+ init.headers = {
219
+ [args.apiKeyConfig.header]: args.apiKeyConfig.key
220
+ };
221
+ }
222
+ const endpoint = `${args.baseUrl}/extended/v2/burn-blocks/${args.heightOrHash}`;
223
+ const res = await fetch(endpoint, init);
224
+ if (!res.ok) {
225
+ return error({
226
+ name: "BurnBlockGetError",
227
+ message: "Failed to get burn block.",
228
+ data: {
229
+ heightOrHash: args.heightOrHash,
230
+ status: res.status,
231
+ statusText: res.statusText,
232
+ body: await safeExtractResponseBody(res)
233
+ }
234
+ });
235
+ }
236
+ const [jsonParseError, data] = await safePromise(res.json());
237
+ if (jsonParseError) {
238
+ return error({
239
+ name: "ParseBodyError",
240
+ message: "Failed to parse response body as JSON.",
241
+ data: jsonParseError
242
+ });
243
+ }
244
+ return success(data);
245
+ }
246
+
247
+ // src/stacks-api/burn-blocks/index.ts
248
+ var burnBlocks = {
249
+ getBurnBlock
250
+ };
251
+
246
252
  // src/stacks-api/faucets/stx.ts
247
253
  async function stx(opts) {
248
254
  const search = new URLSearchParams();
@@ -285,22 +291,22 @@ var faucets = {
285
291
  };
286
292
 
287
293
  // src/stacks-api/info/core-api.ts
288
- import * as v4 from "valibot";
289
- var CoreApiResponseSchema = v4.object({
290
- peer_version: v4.number(),
291
- pox_consensus: v4.string(),
292
- burn_block_height: v4.number(),
293
- stable_pox_consensus: v4.string(),
294
- stable_burn_block_height: v4.number(),
295
- server_version: v4.string(),
296
- network_id: v4.number(),
297
- parent_network_id: v4.number(),
298
- stacks_tip_height: v4.number(),
299
- stacks_tip: v4.string(),
300
- stacks_tip_consensus_hash: v4.string(),
301
- unanchored_tip: v4.nullable(v4.string()),
302
- unanchored_seq: v4.nullable(v4.string()),
303
- exit_at_block_height: v4.nullable(v4.number())
294
+ import * as v3 from "valibot";
295
+ var CoreApiResponseSchema = v3.object({
296
+ peer_version: v3.number(),
297
+ pox_consensus: v3.string(),
298
+ burn_block_height: v3.number(),
299
+ stable_pox_consensus: v3.string(),
300
+ stable_burn_block_height: v3.number(),
301
+ server_version: v3.string(),
302
+ network_id: v3.number(),
303
+ parent_network_id: v3.number(),
304
+ stacks_tip_height: v3.number(),
305
+ stacks_tip: v3.string(),
306
+ stacks_tip_consensus_hash: v3.string(),
307
+ unanchored_tip: v3.nullable(v3.string()),
308
+ unanchored_seq: v3.nullable(v3.string()),
309
+ exit_at_block_height: v3.nullable(v3.number())
304
310
  });
305
311
  async function coreApi(apiOpts) {
306
312
  const init = {};
@@ -329,7 +335,7 @@ async function coreApi(apiOpts) {
329
335
  data: parseBodyError
330
336
  });
331
337
  }
332
- const validationResult = v4.safeParse(CoreApiResponseSchema, data);
338
+ const validationResult = v3.safeParse(CoreApiResponseSchema, data);
333
339
  if (!validationResult.success) {
334
340
  return error({
335
341
  name: "ValidateDataError",
@@ -346,14 +352,14 @@ var info = {
346
352
  };
347
353
 
348
354
  // src/stacks-api/proof-of-transfer/cycle.ts
349
- import * as v5 from "valibot";
350
- var responseSchema3 = v5.object({
351
- block_height: v5.number(),
352
- index_block_hash: v5.string(),
353
- cycle_number: v5.number(),
354
- total_weight: v5.number(),
355
- total_stacked_amount: v5.string(),
356
- total_signers: v5.number()
355
+ import * as v4 from "valibot";
356
+ var responseSchema2 = v4.object({
357
+ block_height: v4.number(),
358
+ index_block_hash: v4.string(),
359
+ cycle_number: v4.number(),
360
+ total_weight: v4.number(),
361
+ total_stacked_amount: v4.string(),
362
+ total_signers: v4.number()
357
363
  });
358
364
  async function cycle(opts) {
359
365
  const init = {};
@@ -384,7 +390,7 @@ async function cycle(opts) {
384
390
  data: jsonError
385
391
  });
386
392
  }
387
- const validationResult = v5.safeParse(responseSchema3, data);
393
+ const validationResult = v4.safeParse(responseSchema2, data);
388
394
  if (!validationResult.success) {
389
395
  return error({
390
396
  name: "ValidateDataError",
@@ -396,17 +402,17 @@ async function cycle(opts) {
396
402
  }
397
403
 
398
404
  // src/stacks-api/proof-of-transfer/cycles.ts
399
- import * as v6 from "valibot";
400
- var cycleInfoSchema = v6.object({
401
- block_height: v6.number(),
402
- index_block_hash: v6.string(),
403
- cycle_number: v6.number(),
404
- total_weight: v6.number(),
405
- total_stacked_amount: v6.string(),
406
- total_signers: v6.number()
405
+ import * as v5 from "valibot";
406
+ var cycleInfoSchema = v5.object({
407
+ block_height: v5.number(),
408
+ index_block_hash: v5.string(),
409
+ cycle_number: v5.number(),
410
+ total_weight: v5.number(),
411
+ total_stacked_amount: v5.string(),
412
+ total_signers: v5.number()
407
413
  });
408
- var resultsSchema = v6.array(cycleInfoSchema);
409
- var cyclesResponseSchema = v6.object({
414
+ var resultsSchema = v5.array(cycleInfoSchema);
415
+ var cyclesResponseSchema = v5.object({
410
416
  ...baseListResponseSchema.entries,
411
417
  results: resultsSchema
412
418
  });
@@ -442,7 +448,7 @@ async function cycles(args) {
442
448
  data: jsonError
443
449
  });
444
450
  }
445
- const validationResult = v6.safeParse(cyclesResponseSchema, data);
451
+ const validationResult = v5.safeParse(cyclesResponseSchema, data);
446
452
  if (!validationResult.success) {
447
453
  return error({
448
454
  name: "ValidateDataError",
@@ -454,16 +460,16 @@ async function cycles(args) {
454
460
  }
455
461
 
456
462
  // src/stacks-api/proof-of-transfer/signer-in-cycle.ts
457
- import * as v7 from "valibot";
458
- var signerInCycleResponseSchema = v7.object({
459
- signing_key: v7.string(),
460
- signer_address: v7.string(),
461
- weight: v7.number(),
462
- stacked_amount: v7.string(),
463
- weight_percent: v7.number(),
464
- stacked_amount_percent: v7.number(),
465
- solo_stacker_count: v7.number(),
466
- pooled_stacker_count: v7.number()
463
+ import * as v6 from "valibot";
464
+ var signerInCycleResponseSchema = v6.object({
465
+ signing_key: v6.string(),
466
+ signer_address: v6.string(),
467
+ weight: v6.number(),
468
+ stacked_amount: v6.string(),
469
+ weight_percent: v6.number(),
470
+ stacked_amount_percent: v6.number(),
471
+ solo_stacker_count: v6.number(),
472
+ pooled_stacker_count: v6.number()
467
473
  });
468
474
  async function signerInCycle(args) {
469
475
  const init = {};
@@ -499,7 +505,7 @@ async function signerInCycle(args) {
499
505
  }
500
506
  });
501
507
  }
502
- const validationResult = v7.safeParse(signerInCycleResponseSchema, data);
508
+ const validationResult = v6.safeParse(signerInCycleResponseSchema, data);
503
509
  if (!validationResult.success) {
504
510
  return error({
505
511
  name: "ValidateDataError",
@@ -511,19 +517,19 @@ async function signerInCycle(args) {
511
517
  }
512
518
 
513
519
  // src/stacks-api/proof-of-transfer/signers-in-cycle.ts
514
- import * as v8 from "valibot";
515
- var signerSchema = v8.object({
516
- signing_key: v8.string(),
517
- signer_address: v8.string(),
518
- weight: v8.number(),
519
- stacked_amount: v8.string(),
520
- weight_percent: v8.number(),
521
- stacked_amount_percent: v8.number(),
522
- pooled_stacker_count: v8.number(),
523
- solo_stacker_count: v8.number()
520
+ import * as v7 from "valibot";
521
+ var signerSchema = v7.object({
522
+ signing_key: v7.string(),
523
+ signer_address: v7.string(),
524
+ weight: v7.number(),
525
+ stacked_amount: v7.string(),
526
+ weight_percent: v7.number(),
527
+ stacked_amount_percent: v7.number(),
528
+ pooled_stacker_count: v7.number(),
529
+ solo_stacker_count: v7.number()
524
530
  });
525
- var resultsSchema2 = v8.array(signerSchema);
526
- var signersResponseSchema = v8.object({
531
+ var resultsSchema2 = v7.array(signerSchema);
532
+ var signersResponseSchema = v7.object({
527
533
  ...baseListResponseSchema.entries,
528
534
  results: resultsSchema2
529
535
  });
@@ -562,7 +568,7 @@ async function signersInCycle(args) {
562
568
  }
563
569
  });
564
570
  }
565
- const validationResult = v8.safeParse(signersResponseSchema, data);
571
+ const validationResult = v7.safeParse(signersResponseSchema, data);
566
572
  if (!validationResult.success) {
567
573
  return error({
568
574
  name: "ValidateDataError",
@@ -894,6 +900,7 @@ var mempool = {
894
900
  var stacksApi = {
895
901
  accounts,
896
902
  blocks,
903
+ burnBlocks,
897
904
  faucets,
898
905
  info,
899
906
  mempool,
@@ -903,16 +910,16 @@ var stacksApi = {
903
910
  };
904
911
 
905
912
  // src/stacks-rpc-api/smart-contracts/map-entry.ts
906
- import * as v9 from "valibot";
907
- var mapEntryResponseSchema = v9.object({
913
+ import * as v8 from "valibot";
914
+ var mapEntryResponseSchema = v8.object({
908
915
  /**
909
916
  * Hex-encoded string of clarity value. It is always an optional tuple.
910
917
  */
911
- data: v9.string(),
918
+ data: v8.string(),
912
919
  /**
913
920
  * Hex-encoded string of the MARF proof for the data
914
921
  */
915
- proof: v9.optional(v9.string())
922
+ proof: v8.optional(v8.string())
916
923
  });
917
924
  async function mapEntry(args) {
918
925
  const search = new URLSearchParams();
@@ -952,7 +959,7 @@ async function mapEntry(args) {
952
959
  data: jsonError
953
960
  });
954
961
  }
955
- const validationResult = v9.safeParse(mapEntryResponseSchema, data);
962
+ const validationResult = v8.safeParse(mapEntryResponseSchema, data);
956
963
  if (!validationResult.success) {
957
964
  return error({
958
965
  name: "ValidateDataError",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secretkeylabs/stacks-tools",
3
- "version": "0.8.0-caef9a1",
3
+ "version": "0.9.0-5deee01",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"