@secretkeylabs/stacks-tools 0.8.0-907b20e → 0.8.0-caef9a1

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,6 +223,28 @@ 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
+ });
226
248
  async function getBlock(opts) {
227
249
  const init = {};
228
250
  if (opts.apiKeyConfig) {
@@ -230,8 +252,10 @@ async function getBlock(opts) {
230
252
  [opts.apiKeyConfig.header]: opts.apiKeyConfig.key
231
253
  };
232
254
  }
233
- const endpoint = `${opts.baseUrl}/extended/v2/blocks/${opts.heightOrHash}`;
234
- const res = await fetch(endpoint, init);
255
+ const res = await fetch(
256
+ `${opts.baseUrl}/extended/v2/blocks/${opts.heightOrHash}`,
257
+ init
258
+ );
235
259
  if (!res.ok) {
236
260
  return error({
237
261
  name: "FetchBlockError",
@@ -251,50 +275,20 @@ async function getBlock(opts) {
251
275
  data: jsonError
252
276
  });
253
277
  }
254
- return success(data);
255
- }
256
-
257
- // src/stacks-api/blocks/index.ts
258
- var blocks = {
259
- getBlock
260
- };
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) {
278
+ const validationResult = v3.safeParse(responseSchema2, data);
279
+ if (!validationResult.success) {
286
280
  return error({
287
- name: "ParseBodyError",
288
- message: "Failed to parse response body as JSON.",
289
- data: jsonParseError
281
+ name: "ValidateDataError",
282
+ message: "Failed to validate data.",
283
+ data: validationResult
290
284
  });
291
285
  }
292
- return success(data);
286
+ return success(validationResult.output);
293
287
  }
294
288
 
295
- // src/stacks-api/burn-blocks/index.ts
296
- var burnBlocks = {
297
- getBurnBlock
289
+ // src/stacks-api/blocks/index.ts
290
+ var blocks = {
291
+ getBlock
298
292
  };
299
293
 
300
294
  // src/stacks-api/faucets/stx.ts
@@ -339,22 +333,22 @@ var faucets = {
339
333
  };
340
334
 
341
335
  // src/stacks-api/info/core-api.ts
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())
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())
358
352
  });
359
353
  async function coreApi(apiOpts) {
360
354
  const init = {};
@@ -383,7 +377,7 @@ async function coreApi(apiOpts) {
383
377
  data: parseBodyError
384
378
  });
385
379
  }
386
- const validationResult = v3.safeParse(CoreApiResponseSchema, data);
380
+ const validationResult = v4.safeParse(CoreApiResponseSchema, data);
387
381
  if (!validationResult.success) {
388
382
  return error({
389
383
  name: "ValidateDataError",
@@ -400,14 +394,14 @@ var info = {
400
394
  };
401
395
 
402
396
  // src/stacks-api/proof-of-transfer/cycle.ts
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()
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()
411
405
  });
412
406
  async function cycle(opts) {
413
407
  const init = {};
@@ -438,7 +432,7 @@ async function cycle(opts) {
438
432
  data: jsonError
439
433
  });
440
434
  }
441
- const validationResult = v4.safeParse(responseSchema2, data);
435
+ const validationResult = v5.safeParse(responseSchema3, data);
442
436
  if (!validationResult.success) {
443
437
  return error({
444
438
  name: "ValidateDataError",
@@ -450,17 +444,17 @@ async function cycle(opts) {
450
444
  }
451
445
 
452
446
  // src/stacks-api/proof-of-transfer/cycles.ts
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()
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()
461
455
  });
462
- var resultsSchema = v5.array(cycleInfoSchema);
463
- var cyclesResponseSchema = v5.object({
456
+ var resultsSchema = v6.array(cycleInfoSchema);
457
+ var cyclesResponseSchema = v6.object({
464
458
  ...baseListResponseSchema.entries,
465
459
  results: resultsSchema
466
460
  });
@@ -496,7 +490,7 @@ async function cycles(args) {
496
490
  data: jsonError
497
491
  });
498
492
  }
499
- const validationResult = v5.safeParse(cyclesResponseSchema, data);
493
+ const validationResult = v6.safeParse(cyclesResponseSchema, data);
500
494
  if (!validationResult.success) {
501
495
  return error({
502
496
  name: "ValidateDataError",
@@ -508,16 +502,16 @@ async function cycles(args) {
508
502
  }
509
503
 
510
504
  // src/stacks-api/proof-of-transfer/signer-in-cycle.ts
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()
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()
521
515
  });
522
516
  async function signerInCycle(args) {
523
517
  const init = {};
@@ -553,7 +547,7 @@ async function signerInCycle(args) {
553
547
  }
554
548
  });
555
549
  }
556
- const validationResult = v6.safeParse(signerInCycleResponseSchema, data);
550
+ const validationResult = v7.safeParse(signerInCycleResponseSchema, data);
557
551
  if (!validationResult.success) {
558
552
  return error({
559
553
  name: "ValidateDataError",
@@ -565,19 +559,19 @@ async function signerInCycle(args) {
565
559
  }
566
560
 
567
561
  // src/stacks-api/proof-of-transfer/signers-in-cycle.ts
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()
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()
578
572
  });
579
- var resultsSchema2 = v7.array(signerSchema);
580
- var signersResponseSchema = v7.object({
573
+ var resultsSchema2 = v8.array(signerSchema);
574
+ var signersResponseSchema = v8.object({
581
575
  ...baseListResponseSchema.entries,
582
576
  results: resultsSchema2
583
577
  });
@@ -616,7 +610,7 @@ async function signersInCycle(args) {
616
610
  }
617
611
  });
618
612
  }
619
- const validationResult = v7.safeParse(signersResponseSchema, data);
613
+ const validationResult = v8.safeParse(signersResponseSchema, data);
620
614
  if (!validationResult.success) {
621
615
  return error({
622
616
  name: "ValidateDataError",
@@ -948,7 +942,6 @@ var mempool = {
948
942
  var stacksApi = {
949
943
  accounts,
950
944
  blocks,
951
- burnBlocks,
952
945
  faucets,
953
946
  info,
954
947
  mempool,
@@ -958,16 +951,16 @@ var stacksApi = {
958
951
  };
959
952
 
960
953
  // src/stacks-rpc-api/smart-contracts/map-entry.ts
961
- var v8 = __toESM(require("valibot"), 1);
962
- var mapEntryResponseSchema = v8.object({
954
+ var v9 = __toESM(require("valibot"), 1);
955
+ var mapEntryResponseSchema = v9.object({
963
956
  /**
964
957
  * Hex-encoded string of clarity value. It is always an optional tuple.
965
958
  */
966
- data: v8.string(),
959
+ data: v9.string(),
967
960
  /**
968
961
  * Hex-encoded string of the MARF proof for the data
969
962
  */
970
- proof: v8.optional(v8.string())
963
+ proof: v9.optional(v9.string())
971
964
  });
972
965
  async function mapEntry(args) {
973
966
  const search = new URLSearchParams();
@@ -1007,7 +1000,7 @@ async function mapEntry(args) {
1007
1000
  data: jsonError
1008
1001
  });
1009
1002
  }
1010
- const validationResult = v8.safeParse(mapEntryResponseSchema, data);
1003
+ const validationResult = v9.safeParse(mapEntryResponseSchema, data);
1011
1004
  if (!validationResult.success) {
1012
1005
  return error({
1013
1006
  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$o = {
58
+ type Args$n = {
59
59
  transactionId: string;
60
60
  } & ApiRequestOptions;
61
- type Response$9 = OperationResponse["get_raw_transaction_by_id"];
62
- declare function getRawTransaction(args: Args$o): Promise<Result$1<Response$9>>;
61
+ type Response$8 = OperationResponse["get_raw_transaction_by_id"];
62
+ declare function getRawTransaction(args: Args$n): Promise<Result$1<Response$8>>;
63
63
 
64
64
  declare const getRawTransaction$1_getRawTransaction: typeof getRawTransaction;
65
65
  declare namespace getRawTransaction$1 {
66
- export { type Args$o as Args, type Response$9 as Response, getRawTransaction$1_getRawTransaction as getRawTransaction };
66
+ export { type Args$n as Args, type Response$8 as Response, getRawTransaction$1_getRawTransaction as getRawTransaction };
67
67
  }
68
68
 
69
- type Args$n = {
69
+ type Args$m = {
70
70
  /**
71
71
  * Filter to only return transactions with this sender address.
72
72
  */
@@ -91,7 +91,7 @@ type Args$n = {
91
91
  order?: "asc" | "desc";
92
92
  } & ApiRequestOptions & ApiPaginationOptions;
93
93
  type MempoolTransactionsResponse = OperationResponse["/extended/v1/tx/mempool"];
94
- declare function mempoolTransactions(args: Args$n): Promise<Result$1<MempoolTransactionsResponse, SafeError<"FetchMempoolTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
94
+ declare function mempoolTransactions(args: Args$m): 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$m = {
102
+ type Args$l = {
103
103
  transactionId: string;
104
104
  } & ApiRequestOptions;
105
- type Response$8 = OperationResponse["get_transaction_by_id"];
106
- declare function getTransaction(args: Args$m): Promise<Result$1<Response$8>>;
105
+ type Response$7 = OperationResponse["get_transaction_by_id"];
106
+ declare function getTransaction(args: Args$l): Promise<Result$1<Response$7>>;
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$l = {
113
+ type Args$k = {
114
114
  address: string;
115
115
  transactionId: string;
116
116
  } & ApiRequestOptions & ApiPaginationOptions;
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>>;
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>>;
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$k = {
125
+ type Args$j = {
126
126
  address: string;
127
127
  } & ApiRequestOptions & ApiPaginationOptions;
128
128
  type Result = OperationResponse["/extended/v2/addresses/{address}/transactions"];
129
- declare function addressTransactions(args: Args$k): Promise<Result$1<Result, SafeError<"FetchAddressTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
129
+ declare function addressTransactions(args: Args$j): 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$j = {
137
+ type Args$i = {
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$6 = OperationResponse["get_pool_delegations"];
145
- declare function members(args: Args$j): Promise<Result$1<Response$6>>;
144
+ type Response$5 = OperationResponse["get_pool_delegations"];
145
+ declare function members(args: Args$i): Promise<Result$1<Response$5>>;
146
146
 
147
147
  declare const members$1_members: typeof members;
148
148
  declare namespace members$1 {
149
- export { type Args$j as Args, type Response$6 as Response, members$1_members as members };
149
+ export { type Args$i as Args, type Response$5 as Response, members$1_members as members };
150
150
  }
151
151
 
152
- type Args$i = {
152
+ type Args$h = {
153
153
  cycleNumber: string | number | bigint;
154
154
  signerPublicKey: string;
155
155
  } & ApiRequestOptions & ApiPaginationOptions;
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">>>;
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">>>;
158
158
 
159
159
  declare const stackersForSignerInCycle$1_stackersForSignerInCycle: typeof stackersForSignerInCycle;
160
160
  declare namespace stackersForSignerInCycle$1 {
161
- export { type Args$i as Args, type Response$5 as Response, stackersForSignerInCycle$1_stackersForSignerInCycle as stackersForSignerInCycle };
161
+ export { type Args$h as Args, type Response$4 as Response, stackersForSignerInCycle$1_stackersForSignerInCycle as stackersForSignerInCycle };
162
162
  }
163
163
 
164
- type Args$h = {
164
+ type Args$g = {
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$h): Promise<Result$1<SignersResponse, SafeError<"FetchSignersError" | "ParseBodyError" | "ValidateDataError">>>;
205
+ declare function signersInCycle(args: Args$g): 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$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 };
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 };
214
214
  }
215
215
 
216
- type Args$g = {
216
+ type Args$f = {
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$g): Promise<Result$1<SignerInCycleResponse>>;
234
+ declare function signerInCycle(args: Args$f): 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$g as Args, type signerInCycle$1_SignerInCycleResponse as SignerInCycleResponse, signerInCycle$1_signerInCycle as signerInCycle, signerInCycle$1_signerInCycleResponseSchema as signerInCycleResponseSchema };
240
+ export { type Args$f 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$f = ApiRequestOptions & ApiPaginationOptions;
243
+ type Args$e = 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$f): Promise<Result$1<CyclesResponse>>;
276
+ declare function cycles(args: Args$e): 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$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 };
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 };
287
287
  }
288
288
 
289
- type Args$e = {
289
+ type Args$d = {
290
290
  cycleNumber: number;
291
291
  } & ApiRequestOptions;
292
- declare const responseSchema$1: v.ObjectSchema<{
292
+ declare const responseSchema$2: 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$1: 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$4 = v.InferOutput<typeof responseSchema$1>;
301
- declare function cycle(opts: Args$e): Promise<Result$1<Response$4, SafeError<"FetchCycleError" | "ParseBodyError" | "ValidateDataError">>>;
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">>>;
302
302
 
303
303
  declare const cycle$1_cycle: typeof cycle;
304
304
  declare namespace cycle$1 {
305
- export { type Args$e as Args, type Response$4 as Response, cycle$1_cycle as cycle, responseSchema$1 as responseSchema };
305
+ export { type Args$d as Args, type Response$3 as Response, cycle$1_cycle as cycle, responseSchema$2 as responseSchema };
306
306
  }
307
307
 
308
308
  type FeePrioritiesResponse = {
@@ -364,37 +364,47 @@ 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$d = {
367
+ type Args$c = {
368
368
  address: string;
369
369
  stacking?: boolean;
370
370
  } & ApiRequestOptions;
371
- declare function stx(opts: Args$d): Promise<Result$1<any>>;
371
+ declare function stx(opts: Args$c): 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$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 };
375
+ export { type Args$c as Args, stx$1_stx as stx };
387
376
  }
388
377
 
389
378
  type Args$b = {
390
379
  heightOrHash: string | number;
391
380
  } & ApiRequestOptions;
392
- type Response$2 = OperationResponse["get_block"];
393
- declare function getBlock(opts: Args$b): Promise<Result$1<Response$2>>;
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">>>;
394
404
 
395
405
  declare const getBlock$1_getBlock: typeof getBlock;
396
406
  declare namespace getBlock$1 {
397
- export { type Args$b as Args, type Response$2 as Response, getBlock$1_getBlock as getBlock };
407
+ export { type Args$b as Args, type Response$2 as Response, getBlock$1_getBlock as getBlock, responseSchema$1 as responseSchema };
398
408
  }
399
409
 
400
410
  type Args$a = {
@@ -433,7 +443,7 @@ declare const accounts$1: {
433
443
  latestNonce: typeof latestNonce;
434
444
  };
435
445
 
436
- declare namespace index$g {
446
+ declare namespace index$f {
437
447
  export { balances$1 as Balances, latestNonce$1 as LatestNonce, accounts$1 as accounts };
438
448
  }
439
449
 
@@ -441,18 +451,9 @@ declare const blocks: {
441
451
  getBlock: typeof getBlock;
442
452
  };
443
453
 
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;
454
+ declare const index$e_blocks: typeof blocks;
454
455
  declare namespace index$e {
455
- export { getBurnBlock$1 as GetBurnBlock, index$e_burnBlocks as burnBlocks };
456
+ export { getBlock$1 as GetBlock, index$e_blocks as blocks };
456
457
  }
457
458
 
458
459
  declare const faucets: {
@@ -524,9 +525,6 @@ declare const stacksApi: {
524
525
  blocks: {
525
526
  getBlock: typeof getBlock;
526
527
  };
527
- burnBlocks: {
528
- getBurnBlock: typeof getBurnBlock;
529
- };
530
528
  faucets: {
531
529
  stx: typeof stx;
532
530
  };
@@ -557,7 +555,7 @@ declare const stacksApi: {
557
555
 
558
556
  declare const index$7_stacksApi: typeof stacksApi;
559
557
  declare namespace index$7 {
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 };
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 };
561
559
  }
562
560
 
563
561
  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$o = {
58
+ type Args$n = {
59
59
  transactionId: string;
60
60
  } & ApiRequestOptions;
61
- type Response$9 = OperationResponse["get_raw_transaction_by_id"];
62
- declare function getRawTransaction(args: Args$o): Promise<Result$1<Response$9>>;
61
+ type Response$8 = OperationResponse["get_raw_transaction_by_id"];
62
+ declare function getRawTransaction(args: Args$n): Promise<Result$1<Response$8>>;
63
63
 
64
64
  declare const getRawTransaction$1_getRawTransaction: typeof getRawTransaction;
65
65
  declare namespace getRawTransaction$1 {
66
- export { type Args$o as Args, type Response$9 as Response, getRawTransaction$1_getRawTransaction as getRawTransaction };
66
+ export { type Args$n as Args, type Response$8 as Response, getRawTransaction$1_getRawTransaction as getRawTransaction };
67
67
  }
68
68
 
69
- type Args$n = {
69
+ type Args$m = {
70
70
  /**
71
71
  * Filter to only return transactions with this sender address.
72
72
  */
@@ -91,7 +91,7 @@ type Args$n = {
91
91
  order?: "asc" | "desc";
92
92
  } & ApiRequestOptions & ApiPaginationOptions;
93
93
  type MempoolTransactionsResponse = OperationResponse["/extended/v1/tx/mempool"];
94
- declare function mempoolTransactions(args: Args$n): Promise<Result$1<MempoolTransactionsResponse, SafeError<"FetchMempoolTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
94
+ declare function mempoolTransactions(args: Args$m): 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$m = {
102
+ type Args$l = {
103
103
  transactionId: string;
104
104
  } & ApiRequestOptions;
105
- type Response$8 = OperationResponse["get_transaction_by_id"];
106
- declare function getTransaction(args: Args$m): Promise<Result$1<Response$8>>;
105
+ type Response$7 = OperationResponse["get_transaction_by_id"];
106
+ declare function getTransaction(args: Args$l): Promise<Result$1<Response$7>>;
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$l = {
113
+ type Args$k = {
114
114
  address: string;
115
115
  transactionId: string;
116
116
  } & ApiRequestOptions & ApiPaginationOptions;
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>>;
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>>;
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$k = {
125
+ type Args$j = {
126
126
  address: string;
127
127
  } & ApiRequestOptions & ApiPaginationOptions;
128
128
  type Result = OperationResponse["/extended/v2/addresses/{address}/transactions"];
129
- declare function addressTransactions(args: Args$k): Promise<Result$1<Result, SafeError<"FetchAddressTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
129
+ declare function addressTransactions(args: Args$j): 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$j = {
137
+ type Args$i = {
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$6 = OperationResponse["get_pool_delegations"];
145
- declare function members(args: Args$j): Promise<Result$1<Response$6>>;
144
+ type Response$5 = OperationResponse["get_pool_delegations"];
145
+ declare function members(args: Args$i): Promise<Result$1<Response$5>>;
146
146
 
147
147
  declare const members$1_members: typeof members;
148
148
  declare namespace members$1 {
149
- export { type Args$j as Args, type Response$6 as Response, members$1_members as members };
149
+ export { type Args$i as Args, type Response$5 as Response, members$1_members as members };
150
150
  }
151
151
 
152
- type Args$i = {
152
+ type Args$h = {
153
153
  cycleNumber: string | number | bigint;
154
154
  signerPublicKey: string;
155
155
  } & ApiRequestOptions & ApiPaginationOptions;
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">>>;
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">>>;
158
158
 
159
159
  declare const stackersForSignerInCycle$1_stackersForSignerInCycle: typeof stackersForSignerInCycle;
160
160
  declare namespace stackersForSignerInCycle$1 {
161
- export { type Args$i as Args, type Response$5 as Response, stackersForSignerInCycle$1_stackersForSignerInCycle as stackersForSignerInCycle };
161
+ export { type Args$h as Args, type Response$4 as Response, stackersForSignerInCycle$1_stackersForSignerInCycle as stackersForSignerInCycle };
162
162
  }
163
163
 
164
- type Args$h = {
164
+ type Args$g = {
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$h): Promise<Result$1<SignersResponse, SafeError<"FetchSignersError" | "ParseBodyError" | "ValidateDataError">>>;
205
+ declare function signersInCycle(args: Args$g): 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$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 };
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 };
214
214
  }
215
215
 
216
- type Args$g = {
216
+ type Args$f = {
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$g): Promise<Result$1<SignerInCycleResponse>>;
234
+ declare function signerInCycle(args: Args$f): 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$g as Args, type signerInCycle$1_SignerInCycleResponse as SignerInCycleResponse, signerInCycle$1_signerInCycle as signerInCycle, signerInCycle$1_signerInCycleResponseSchema as signerInCycleResponseSchema };
240
+ export { type Args$f 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$f = ApiRequestOptions & ApiPaginationOptions;
243
+ type Args$e = 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$f): Promise<Result$1<CyclesResponse>>;
276
+ declare function cycles(args: Args$e): 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$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 };
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 };
287
287
  }
288
288
 
289
- type Args$e = {
289
+ type Args$d = {
290
290
  cycleNumber: number;
291
291
  } & ApiRequestOptions;
292
- declare const responseSchema$1: v.ObjectSchema<{
292
+ declare const responseSchema$2: 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$1: 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$4 = v.InferOutput<typeof responseSchema$1>;
301
- declare function cycle(opts: Args$e): Promise<Result$1<Response$4, SafeError<"FetchCycleError" | "ParseBodyError" | "ValidateDataError">>>;
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">>>;
302
302
 
303
303
  declare const cycle$1_cycle: typeof cycle;
304
304
  declare namespace cycle$1 {
305
- export { type Args$e as Args, type Response$4 as Response, cycle$1_cycle as cycle, responseSchema$1 as responseSchema };
305
+ export { type Args$d as Args, type Response$3 as Response, cycle$1_cycle as cycle, responseSchema$2 as responseSchema };
306
306
  }
307
307
 
308
308
  type FeePrioritiesResponse = {
@@ -364,37 +364,47 @@ 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$d = {
367
+ type Args$c = {
368
368
  address: string;
369
369
  stacking?: boolean;
370
370
  } & ApiRequestOptions;
371
- declare function stx(opts: Args$d): Promise<Result$1<any>>;
371
+ declare function stx(opts: Args$c): 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$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 };
375
+ export { type Args$c as Args, stx$1_stx as stx };
387
376
  }
388
377
 
389
378
  type Args$b = {
390
379
  heightOrHash: string | number;
391
380
  } & ApiRequestOptions;
392
- type Response$2 = OperationResponse["get_block"];
393
- declare function getBlock(opts: Args$b): Promise<Result$1<Response$2>>;
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">>>;
394
404
 
395
405
  declare const getBlock$1_getBlock: typeof getBlock;
396
406
  declare namespace getBlock$1 {
397
- export { type Args$b as Args, type Response$2 as Response, getBlock$1_getBlock as getBlock };
407
+ export { type Args$b as Args, type Response$2 as Response, getBlock$1_getBlock as getBlock, responseSchema$1 as responseSchema };
398
408
  }
399
409
 
400
410
  type Args$a = {
@@ -433,7 +443,7 @@ declare const accounts$1: {
433
443
  latestNonce: typeof latestNonce;
434
444
  };
435
445
 
436
- declare namespace index$g {
446
+ declare namespace index$f {
437
447
  export { balances$1 as Balances, latestNonce$1 as LatestNonce, accounts$1 as accounts };
438
448
  }
439
449
 
@@ -441,18 +451,9 @@ declare const blocks: {
441
451
  getBlock: typeof getBlock;
442
452
  };
443
453
 
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;
454
+ declare const index$e_blocks: typeof blocks;
454
455
  declare namespace index$e {
455
- export { getBurnBlock$1 as GetBurnBlock, index$e_burnBlocks as burnBlocks };
456
+ export { getBlock$1 as GetBlock, index$e_blocks as blocks };
456
457
  }
457
458
 
458
459
  declare const faucets: {
@@ -524,9 +525,6 @@ declare const stacksApi: {
524
525
  blocks: {
525
526
  getBlock: typeof getBlock;
526
527
  };
527
- burnBlocks: {
528
- getBurnBlock: typeof getBurnBlock;
529
- };
530
528
  faucets: {
531
529
  stx: typeof stx;
532
530
  };
@@ -557,7 +555,7 @@ declare const stacksApi: {
557
555
 
558
556
  declare const index$7_stacksApi: typeof stacksApi;
559
557
  declare namespace index$7 {
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 };
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 };
561
559
  }
562
560
 
563
561
  type Args$8 = {
package/dist/index.js CHANGED
@@ -175,6 +175,28 @@ 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
+ });
178
200
  async function getBlock(opts) {
179
201
  const init = {};
180
202
  if (opts.apiKeyConfig) {
@@ -182,8 +204,10 @@ async function getBlock(opts) {
182
204
  [opts.apiKeyConfig.header]: opts.apiKeyConfig.key
183
205
  };
184
206
  }
185
- const endpoint = `${opts.baseUrl}/extended/v2/blocks/${opts.heightOrHash}`;
186
- const res = await fetch(endpoint, init);
207
+ const res = await fetch(
208
+ `${opts.baseUrl}/extended/v2/blocks/${opts.heightOrHash}`,
209
+ init
210
+ );
187
211
  if (!res.ok) {
188
212
  return error({
189
213
  name: "FetchBlockError",
@@ -203,50 +227,20 @@ async function getBlock(opts) {
203
227
  data: jsonError
204
228
  });
205
229
  }
206
- return success(data);
207
- }
208
-
209
- // src/stacks-api/blocks/index.ts
210
- var blocks = {
211
- getBlock
212
- };
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) {
230
+ const validationResult = v3.safeParse(responseSchema2, data);
231
+ if (!validationResult.success) {
238
232
  return error({
239
- name: "ParseBodyError",
240
- message: "Failed to parse response body as JSON.",
241
- data: jsonParseError
233
+ name: "ValidateDataError",
234
+ message: "Failed to validate data.",
235
+ data: validationResult
242
236
  });
243
237
  }
244
- return success(data);
238
+ return success(validationResult.output);
245
239
  }
246
240
 
247
- // src/stacks-api/burn-blocks/index.ts
248
- var burnBlocks = {
249
- getBurnBlock
241
+ // src/stacks-api/blocks/index.ts
242
+ var blocks = {
243
+ getBlock
250
244
  };
251
245
 
252
246
  // src/stacks-api/faucets/stx.ts
@@ -291,22 +285,22 @@ var faucets = {
291
285
  };
292
286
 
293
287
  // src/stacks-api/info/core-api.ts
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())
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())
310
304
  });
311
305
  async function coreApi(apiOpts) {
312
306
  const init = {};
@@ -335,7 +329,7 @@ async function coreApi(apiOpts) {
335
329
  data: parseBodyError
336
330
  });
337
331
  }
338
- const validationResult = v3.safeParse(CoreApiResponseSchema, data);
332
+ const validationResult = v4.safeParse(CoreApiResponseSchema, data);
339
333
  if (!validationResult.success) {
340
334
  return error({
341
335
  name: "ValidateDataError",
@@ -352,14 +346,14 @@ var info = {
352
346
  };
353
347
 
354
348
  // src/stacks-api/proof-of-transfer/cycle.ts
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()
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()
363
357
  });
364
358
  async function cycle(opts) {
365
359
  const init = {};
@@ -390,7 +384,7 @@ async function cycle(opts) {
390
384
  data: jsonError
391
385
  });
392
386
  }
393
- const validationResult = v4.safeParse(responseSchema2, data);
387
+ const validationResult = v5.safeParse(responseSchema3, data);
394
388
  if (!validationResult.success) {
395
389
  return error({
396
390
  name: "ValidateDataError",
@@ -402,17 +396,17 @@ async function cycle(opts) {
402
396
  }
403
397
 
404
398
  // src/stacks-api/proof-of-transfer/cycles.ts
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()
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()
413
407
  });
414
- var resultsSchema = v5.array(cycleInfoSchema);
415
- var cyclesResponseSchema = v5.object({
408
+ var resultsSchema = v6.array(cycleInfoSchema);
409
+ var cyclesResponseSchema = v6.object({
416
410
  ...baseListResponseSchema.entries,
417
411
  results: resultsSchema
418
412
  });
@@ -448,7 +442,7 @@ async function cycles(args) {
448
442
  data: jsonError
449
443
  });
450
444
  }
451
- const validationResult = v5.safeParse(cyclesResponseSchema, data);
445
+ const validationResult = v6.safeParse(cyclesResponseSchema, data);
452
446
  if (!validationResult.success) {
453
447
  return error({
454
448
  name: "ValidateDataError",
@@ -460,16 +454,16 @@ async function cycles(args) {
460
454
  }
461
455
 
462
456
  // src/stacks-api/proof-of-transfer/signer-in-cycle.ts
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()
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()
473
467
  });
474
468
  async function signerInCycle(args) {
475
469
  const init = {};
@@ -505,7 +499,7 @@ async function signerInCycle(args) {
505
499
  }
506
500
  });
507
501
  }
508
- const validationResult = v6.safeParse(signerInCycleResponseSchema, data);
502
+ const validationResult = v7.safeParse(signerInCycleResponseSchema, data);
509
503
  if (!validationResult.success) {
510
504
  return error({
511
505
  name: "ValidateDataError",
@@ -517,19 +511,19 @@ async function signerInCycle(args) {
517
511
  }
518
512
 
519
513
  // src/stacks-api/proof-of-transfer/signers-in-cycle.ts
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()
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()
530
524
  });
531
- var resultsSchema2 = v7.array(signerSchema);
532
- var signersResponseSchema = v7.object({
525
+ var resultsSchema2 = v8.array(signerSchema);
526
+ var signersResponseSchema = v8.object({
533
527
  ...baseListResponseSchema.entries,
534
528
  results: resultsSchema2
535
529
  });
@@ -568,7 +562,7 @@ async function signersInCycle(args) {
568
562
  }
569
563
  });
570
564
  }
571
- const validationResult = v7.safeParse(signersResponseSchema, data);
565
+ const validationResult = v8.safeParse(signersResponseSchema, data);
572
566
  if (!validationResult.success) {
573
567
  return error({
574
568
  name: "ValidateDataError",
@@ -900,7 +894,6 @@ var mempool = {
900
894
  var stacksApi = {
901
895
  accounts,
902
896
  blocks,
903
- burnBlocks,
904
897
  faucets,
905
898
  info,
906
899
  mempool,
@@ -910,16 +903,16 @@ var stacksApi = {
910
903
  };
911
904
 
912
905
  // src/stacks-rpc-api/smart-contracts/map-entry.ts
913
- import * as v8 from "valibot";
914
- var mapEntryResponseSchema = v8.object({
906
+ import * as v9 from "valibot";
907
+ var mapEntryResponseSchema = v9.object({
915
908
  /**
916
909
  * Hex-encoded string of clarity value. It is always an optional tuple.
917
910
  */
918
- data: v8.string(),
911
+ data: v9.string(),
919
912
  /**
920
913
  * Hex-encoded string of the MARF proof for the data
921
914
  */
922
- proof: v8.optional(v8.string())
915
+ proof: v9.optional(v9.string())
923
916
  });
924
917
  async function mapEntry(args) {
925
918
  const search = new URLSearchParams();
@@ -959,7 +952,7 @@ async function mapEntry(args) {
959
952
  data: jsonError
960
953
  });
961
954
  }
962
- const validationResult = v8.safeParse(mapEntryResponseSchema, data);
955
+ const validationResult = v9.safeParse(mapEntryResponseSchema, data);
963
956
  if (!validationResult.success) {
964
957
  return error({
965
958
  name: "ValidateDataError",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secretkeylabs/stacks-tools",
3
- "version": "0.8.0-907b20e",
3
+ "version": "0.8.0-caef9a1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"