@secretkeylabs/stacks-tools 0.2.0 → 0.3.0-05c5288

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.
Files changed (96) hide show
  1. package/dist/index.cjs +1090 -0
  2. package/dist/index.d.cts +661 -0
  3. package/dist/index.d.ts +661 -2
  4. package/dist/index.js +1052 -3
  5. package/package.json +13 -5
  6. package/dist/index.js.map +0 -1
  7. package/dist/pox4-api/burn-height-to-reward-cycle.d.ts +0 -7
  8. package/dist/pox4-api/burn-height-to-reward-cycle.js +0 -6
  9. package/dist/pox4-api/burn-height-to-reward-cycle.js.map +0 -1
  10. package/dist/pox4-api/current-pox-reward-cycle.d.ts +0 -1
  11. package/dist/pox4-api/current-pox-reward-cycle.js +0 -3
  12. package/dist/pox4-api/current-pox-reward-cycle.js.map +0 -1
  13. package/dist/pox4-api/get-stacker-info.d.ts +0 -1
  14. package/dist/pox4-api/get-stacker-info.js +0 -3
  15. package/dist/pox4-api/get-stacker-info.js.map +0 -1
  16. package/dist/pox4-api/reward-cycle-to-burn-height.d.ts +0 -1
  17. package/dist/pox4-api/reward-cycle-to-burn-height.js +0 -3
  18. package/dist/pox4-api/reward-cycle-to-burn-height.js.map +0 -1
  19. package/dist/queries/get-signer-total-locked.d.ts +0 -18
  20. package/dist/queries/get-signer-total-locked.js +0 -59
  21. package/dist/queries/get-signer-total-locked.js.map +0 -1
  22. package/dist/queries/index.d.ts +0 -4
  23. package/dist/queries/index.js +0 -5
  24. package/dist/queries/index.js.map +0 -1
  25. package/dist/stacks-api/accounts/balances.d.ts +0 -34
  26. package/dist/stacks-api/accounts/balances.js +0 -70
  27. package/dist/stacks-api/accounts/balances.js.map +0 -1
  28. package/dist/stacks-api/accounts/index.d.ts +0 -4
  29. package/dist/stacks-api/accounts/index.js +0 -5
  30. package/dist/stacks-api/accounts/index.js.map +0 -1
  31. package/dist/stacks-api/blocks/get-block.d.ts +0 -29
  32. package/dist/stacks-api/blocks/get-block.js +0 -62
  33. package/dist/stacks-api/blocks/get-block.js.map +0 -1
  34. package/dist/stacks-api/blocks/index.d.ts +0 -4
  35. package/dist/stacks-api/blocks/index.js +0 -5
  36. package/dist/stacks-api/blocks/index.js.map +0 -1
  37. package/dist/stacks-api/index.d.ts +0 -28
  38. package/dist/stacks-api/index.js +0 -17
  39. package/dist/stacks-api/index.js.map +0 -1
  40. package/dist/stacks-api/info/core-api.d.ts +0 -21
  41. package/dist/stacks-api/info/core-api.js +0 -55
  42. package/dist/stacks-api/info/core-api.js.map +0 -1
  43. package/dist/stacks-api/info/index.d.ts +0 -6
  44. package/dist/stacks-api/info/index.js +0 -7
  45. package/dist/stacks-api/info/index.js.map +0 -1
  46. package/dist/stacks-api/info/pox-details.d.ts +0 -59
  47. package/dist/stacks-api/info/pox-details.js +0 -92
  48. package/dist/stacks-api/info/pox-details.js.map +0 -1
  49. package/dist/stacks-api/proof-of-transfer/cycle.d.ts +0 -16
  50. package/dist/stacks-api/proof-of-transfer/cycle.js +0 -50
  51. package/dist/stacks-api/proof-of-transfer/cycle.js.map +0 -1
  52. package/dist/stacks-api/proof-of-transfer/cycles.d.ts +0 -37
  53. package/dist/stacks-api/proof-of-transfer/cycles.js +0 -61
  54. package/dist/stacks-api/proof-of-transfer/cycles.js.map +0 -1
  55. package/dist/stacks-api/proof-of-transfer/index.d.ts +0 -10
  56. package/dist/stacks-api/proof-of-transfer/index.js +0 -11
  57. package/dist/stacks-api/proof-of-transfer/index.js.map +0 -1
  58. package/dist/stacks-api/proof-of-transfer/signers-in-cycle.d.ts +0 -45
  59. package/dist/stacks-api/proof-of-transfer/signers-in-cycle.js +0 -66
  60. package/dist/stacks-api/proof-of-transfer/signers-in-cycle.js.map +0 -1
  61. package/dist/stacks-api/proof-of-transfer/stackers-for-signer-in-cycle.d.ts +0 -34
  62. package/dist/stacks-api/proof-of-transfer/stackers-for-signer-in-cycle.js +0 -59
  63. package/dist/stacks-api/proof-of-transfer/stackers-for-signer-in-cycle.js.map +0 -1
  64. package/dist/stacks-api/smart-contracts/index.d.ts +0 -4
  65. package/dist/stacks-api/smart-contracts/index.js +0 -5
  66. package/dist/stacks-api/smart-contracts/index.js.map +0 -1
  67. package/dist/stacks-api/smart-contracts/read-only.d.ts +0 -19
  68. package/dist/stacks-api/smart-contracts/read-only.js +0 -50
  69. package/dist/stacks-api/smart-contracts/read-only.js.map +0 -1
  70. package/dist/stacks-api/stacking-pool/index.d.ts +0 -4
  71. package/dist/stacks-api/stacking-pool/index.js +0 -5
  72. package/dist/stacks-api/stacking-pool/index.js.map +0 -1
  73. package/dist/stacks-api/stacking-pool/members.d.ts +0 -34
  74. package/dist/stacks-api/stacking-pool/members.js +0 -64
  75. package/dist/stacks-api/stacking-pool/members.js.map +0 -1
  76. package/dist/stacks-api/transactions/address-transactions.d.ts +0 -487
  77. package/dist/stacks-api/transactions/address-transactions.js +0 -75
  78. package/dist/stacks-api/transactions/address-transactions.js.map +0 -1
  79. package/dist/stacks-api/transactions/get-transaction.d.ts +0 -8
  80. package/dist/stacks-api/transactions/get-transaction.js +0 -42
  81. package/dist/stacks-api/transactions/get-transaction.js.map +0 -1
  82. package/dist/stacks-api/transactions/index.d.ts +0 -6
  83. package/dist/stacks-api/transactions/index.js +0 -7
  84. package/dist/stacks-api/transactions/index.js.map +0 -1
  85. package/dist/stacks-api/transactions/schemas.d.ts +0 -327
  86. package/dist/stacks-api/transactions/schemas.js +0 -85
  87. package/dist/stacks-api/transactions/schemas.js.map +0 -1
  88. package/dist/stacks-api/types.d.ts +0 -26
  89. package/dist/stacks-api/types.js +0 -8
  90. package/dist/stacks-api/types.js.map +0 -1
  91. package/dist/utils/call-rate-limited-api.d.ts +0 -8
  92. package/dist/utils/call-rate-limited-api.js +0 -28
  93. package/dist/utils/call-rate-limited-api.js.map +0 -1
  94. package/dist/utils/safe.d.ts +0 -10
  95. package/dist/utils/safe.js +0 -31
  96. package/dist/utils/safe.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,2 +1,661 @@
1
- export { stacksApi } from "./stacks-api/index.js";
2
- export { queries } from "./queries/index.js";
1
+ import * as v from 'valibot';
2
+
3
+ type SafeError<TName extends string = string, TData = unknown> = {
4
+ readonly name: TName;
5
+ readonly message: string;
6
+ readonly data?: TData;
7
+ };
8
+ type Result<TData = unknown, E extends SafeError = SafeError> = [E, null] | [null, TData];
9
+
10
+ type ApiKeyConfig = {
11
+ key: string;
12
+ header: string;
13
+ };
14
+ type ApiRequestOptions = {
15
+ baseUrl: string;
16
+ apiKeyConfig?: ApiKeyConfig;
17
+ };
18
+ type ApiPaginationOptions = {
19
+ /**
20
+ * The number of items to return. Each endpoint has its own maximum allowed
21
+ * limit, although many support at least 50 items. The [Hiro
22
+ * docs](https://docs.hiro.so/stacks/api) include the allowed maximum for each
23
+ * endpoint.
24
+ */
25
+ limit?: number;
26
+ offset?: number;
27
+ };
28
+
29
+ /**
30
+ * Incomplete schema of some transaction types.
31
+ */
32
+ declare const transactionSchema: v.VariantSchema<"tx_type", [v.ObjectSchema<{
33
+ readonly tx_id: v.StringSchema<undefined>;
34
+ readonly nonce: v.NumberSchema<undefined>;
35
+ readonly fee_rate: v.StringSchema<undefined>;
36
+ readonly sender_address: v.StringSchema<undefined>;
37
+ readonly sponsored: v.BooleanSchema<undefined>;
38
+ readonly post_condition_mode: v.StringSchema<undefined>;
39
+ readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
40
+ readonly anchor_mode: v.StringSchema<undefined>;
41
+ readonly is_unanchored: v.BooleanSchema<undefined>;
42
+ readonly block_hash: v.StringSchema<undefined>;
43
+ readonly parent_block_hash: v.StringSchema<undefined>;
44
+ readonly block_height: v.NumberSchema<undefined>;
45
+ readonly block_time: v.NumberSchema<undefined>;
46
+ readonly block_time_iso: v.StringSchema<undefined>;
47
+ readonly burn_block_height: v.NumberSchema<undefined>;
48
+ readonly burn_block_time: v.NumberSchema<undefined>;
49
+ readonly burn_block_time_iso: v.StringSchema<undefined>;
50
+ readonly parent_burn_block_time: v.NumberSchema<undefined>;
51
+ readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
52
+ readonly canonical: v.BooleanSchema<undefined>;
53
+ readonly tx_index: v.NumberSchema<undefined>;
54
+ readonly tx_status: v.StringSchema<undefined>;
55
+ readonly tx_result: v.ObjectSchema<{
56
+ readonly hex: v.StringSchema<undefined>;
57
+ readonly repr: v.StringSchema<undefined>;
58
+ }, undefined>;
59
+ readonly microblock_hash: v.StringSchema<undefined>;
60
+ readonly microblock_sequence: v.NumberSchema<undefined>;
61
+ readonly microblock_canonical: v.BooleanSchema<undefined>;
62
+ readonly event_count: v.NumberSchema<undefined>;
63
+ readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
64
+ readonly execution_cost_read_count: v.NumberSchema<undefined>;
65
+ readonly execution_cost_read_length: v.NumberSchema<undefined>;
66
+ readonly execution_cost_runtime: v.NumberSchema<undefined>;
67
+ readonly execution_cost_write_count: v.NumberSchema<undefined>;
68
+ readonly execution_cost_write_length: v.NumberSchema<undefined>;
69
+ readonly tx_type: v.LiteralSchema<"contract_call", undefined>;
70
+ readonly contract_call: v.ObjectSchema<{
71
+ readonly contract_id: v.StringSchema<undefined>;
72
+ readonly function_name: v.StringSchema<undefined>;
73
+ readonly function_signature: v.StringSchema<undefined>;
74
+ readonly function_args: v.ArraySchema<v.ObjectSchema<{
75
+ readonly hex: v.StringSchema<undefined>;
76
+ readonly repr: v.StringSchema<undefined>;
77
+ readonly name: v.StringSchema<undefined>;
78
+ readonly type: v.StringSchema<undefined>;
79
+ }, undefined>, undefined>;
80
+ }, undefined>;
81
+ }, undefined>, v.ObjectSchema<{
82
+ readonly tx_id: v.StringSchema<undefined>;
83
+ readonly nonce: v.NumberSchema<undefined>;
84
+ readonly fee_rate: v.StringSchema<undefined>;
85
+ readonly sender_address: v.StringSchema<undefined>;
86
+ readonly sponsored: v.BooleanSchema<undefined>;
87
+ readonly post_condition_mode: v.StringSchema<undefined>;
88
+ readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
89
+ readonly anchor_mode: v.StringSchema<undefined>;
90
+ readonly is_unanchored: v.BooleanSchema<undefined>;
91
+ readonly block_hash: v.StringSchema<undefined>;
92
+ readonly parent_block_hash: v.StringSchema<undefined>;
93
+ readonly block_height: v.NumberSchema<undefined>;
94
+ readonly block_time: v.NumberSchema<undefined>;
95
+ readonly block_time_iso: v.StringSchema<undefined>;
96
+ readonly burn_block_height: v.NumberSchema<undefined>;
97
+ readonly burn_block_time: v.NumberSchema<undefined>;
98
+ readonly burn_block_time_iso: v.StringSchema<undefined>;
99
+ readonly parent_burn_block_time: v.NumberSchema<undefined>;
100
+ readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
101
+ readonly canonical: v.BooleanSchema<undefined>;
102
+ readonly tx_index: v.NumberSchema<undefined>;
103
+ readonly tx_status: v.StringSchema<undefined>;
104
+ readonly tx_result: v.ObjectSchema<{
105
+ readonly hex: v.StringSchema<undefined>;
106
+ readonly repr: v.StringSchema<undefined>;
107
+ }, undefined>;
108
+ readonly microblock_hash: v.StringSchema<undefined>;
109
+ readonly microblock_sequence: v.NumberSchema<undefined>;
110
+ readonly microblock_canonical: v.BooleanSchema<undefined>;
111
+ readonly event_count: v.NumberSchema<undefined>;
112
+ readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
113
+ readonly execution_cost_read_count: v.NumberSchema<undefined>;
114
+ readonly execution_cost_read_length: v.NumberSchema<undefined>;
115
+ readonly execution_cost_runtime: v.NumberSchema<undefined>;
116
+ readonly execution_cost_write_count: v.NumberSchema<undefined>;
117
+ readonly execution_cost_write_length: v.NumberSchema<undefined>;
118
+ readonly tx_type: v.LiteralSchema<"smart_contract", undefined>;
119
+ readonly smart_contract: v.ObjectSchema<{
120
+ /**
121
+ * NOTE: The types may be wrong, not sure what type of value is used when
122
+ * the version is not `null`.
123
+ */
124
+ readonly clarity_version: v.UnionSchema<[v.NullSchema<undefined>, v.NumberSchema<undefined>], undefined>;
125
+ readonly contract_id: v.StringSchema<undefined>;
126
+ readonly source_code: v.StringSchema<undefined>;
127
+ }, undefined>;
128
+ }, undefined>, v.ObjectSchema<{
129
+ readonly tx_id: v.StringSchema<undefined>;
130
+ readonly nonce: v.NumberSchema<undefined>;
131
+ readonly fee_rate: v.StringSchema<undefined>;
132
+ readonly sender_address: v.StringSchema<undefined>;
133
+ readonly sponsored: v.BooleanSchema<undefined>;
134
+ readonly post_condition_mode: v.StringSchema<undefined>;
135
+ readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
136
+ readonly anchor_mode: v.StringSchema<undefined>;
137
+ readonly is_unanchored: v.BooleanSchema<undefined>;
138
+ readonly block_hash: v.StringSchema<undefined>;
139
+ readonly parent_block_hash: v.StringSchema<undefined>;
140
+ readonly block_height: v.NumberSchema<undefined>;
141
+ readonly block_time: v.NumberSchema<undefined>;
142
+ readonly block_time_iso: v.StringSchema<undefined>;
143
+ readonly burn_block_height: v.NumberSchema<undefined>;
144
+ readonly burn_block_time: v.NumberSchema<undefined>;
145
+ readonly burn_block_time_iso: v.StringSchema<undefined>;
146
+ readonly parent_burn_block_time: v.NumberSchema<undefined>;
147
+ readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
148
+ readonly canonical: v.BooleanSchema<undefined>;
149
+ readonly tx_index: v.NumberSchema<undefined>;
150
+ readonly tx_status: v.StringSchema<undefined>;
151
+ readonly tx_result: v.ObjectSchema<{
152
+ readonly hex: v.StringSchema<undefined>;
153
+ readonly repr: v.StringSchema<undefined>;
154
+ }, undefined>;
155
+ readonly microblock_hash: v.StringSchema<undefined>;
156
+ readonly microblock_sequence: v.NumberSchema<undefined>;
157
+ readonly microblock_canonical: v.BooleanSchema<undefined>;
158
+ readonly event_count: v.NumberSchema<undefined>;
159
+ readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
160
+ readonly execution_cost_read_count: v.NumberSchema<undefined>;
161
+ readonly execution_cost_read_length: v.NumberSchema<undefined>;
162
+ readonly execution_cost_runtime: v.NumberSchema<undefined>;
163
+ readonly execution_cost_write_count: v.NumberSchema<undefined>;
164
+ readonly execution_cost_write_length: v.NumberSchema<undefined>;
165
+ readonly tx_type: v.LiteralSchema<"token_transfer", undefined>;
166
+ readonly token_transfer: v.ObjectSchema<{
167
+ readonly recipient_address: v.StringSchema<undefined>;
168
+ readonly amount: v.StringSchema<undefined>;
169
+ readonly memo: v.StringSchema<undefined>;
170
+ }, undefined>;
171
+ }, undefined>], undefined>;
172
+ type Transaction = v.InferOutput<typeof transactionSchema>;
173
+
174
+ type Args$a = {
175
+ transactionId: string;
176
+ } & ApiRequestOptions;
177
+ declare function getTransaction(args: Args$a): Promise<Result<Transaction>>;
178
+
179
+ type Args$9 = {
180
+ address: string;
181
+ } & ApiRequestOptions & ApiPaginationOptions;
182
+ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
183
+ readonly results: v.ArraySchema<v.ObjectSchema<{
184
+ readonly tx: v.VariantSchema<"tx_type", [v.ObjectSchema<{
185
+ readonly tx_id: v.StringSchema<undefined>;
186
+ readonly nonce: v.NumberSchema<undefined>;
187
+ readonly fee_rate: v.StringSchema<undefined>;
188
+ readonly sender_address: v.StringSchema<undefined>;
189
+ readonly sponsored: v.BooleanSchema<undefined>;
190
+ readonly post_condition_mode: v.StringSchema<undefined>;
191
+ readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
192
+ readonly anchor_mode: v.StringSchema<undefined>;
193
+ readonly is_unanchored: v.BooleanSchema<undefined>;
194
+ readonly block_hash: v.StringSchema<undefined>;
195
+ readonly parent_block_hash: v.StringSchema<undefined>;
196
+ readonly block_height: v.NumberSchema<undefined>;
197
+ readonly block_time: v.NumberSchema<undefined>;
198
+ readonly block_time_iso: v.StringSchema<undefined>;
199
+ readonly burn_block_height: v.NumberSchema<undefined>;
200
+ readonly burn_block_time: v.NumberSchema<undefined>;
201
+ readonly burn_block_time_iso: v.StringSchema<undefined>;
202
+ readonly parent_burn_block_time: v.NumberSchema<undefined>;
203
+ readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
204
+ readonly canonical: v.BooleanSchema<undefined>;
205
+ readonly tx_index: v.NumberSchema<undefined>;
206
+ readonly tx_status: v.StringSchema<undefined>;
207
+ readonly tx_result: v.ObjectSchema<{
208
+ readonly hex: v.StringSchema<undefined>;
209
+ readonly repr: v.StringSchema<undefined>;
210
+ }, undefined>;
211
+ readonly microblock_hash: v.StringSchema<undefined>;
212
+ readonly microblock_sequence: v.NumberSchema<undefined>;
213
+ readonly microblock_canonical: v.BooleanSchema<undefined>;
214
+ readonly event_count: v.NumberSchema<undefined>;
215
+ readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
216
+ readonly execution_cost_read_count: v.NumberSchema<undefined>;
217
+ readonly execution_cost_read_length: v.NumberSchema<undefined>;
218
+ readonly execution_cost_runtime: v.NumberSchema<undefined>;
219
+ readonly execution_cost_write_count: v.NumberSchema<undefined>;
220
+ readonly execution_cost_write_length: v.NumberSchema<undefined>;
221
+ readonly tx_type: v.LiteralSchema<"contract_call", undefined>;
222
+ readonly contract_call: v.ObjectSchema<{
223
+ readonly contract_id: v.StringSchema<undefined>;
224
+ readonly function_name: v.StringSchema<undefined>;
225
+ readonly function_signature: v.StringSchema<undefined>;
226
+ readonly function_args: v.ArraySchema<v.ObjectSchema<{
227
+ readonly hex: v.StringSchema<undefined>;
228
+ readonly repr: v.StringSchema<undefined>;
229
+ readonly name: v.StringSchema<undefined>;
230
+ readonly type: v.StringSchema<undefined>;
231
+ }, undefined>, undefined>;
232
+ }, undefined>;
233
+ }, undefined>, v.ObjectSchema<{
234
+ readonly tx_id: v.StringSchema<undefined>;
235
+ readonly nonce: v.NumberSchema<undefined>;
236
+ readonly fee_rate: v.StringSchema<undefined>;
237
+ readonly sender_address: v.StringSchema<undefined>;
238
+ readonly sponsored: v.BooleanSchema<undefined>;
239
+ readonly post_condition_mode: v.StringSchema<undefined>;
240
+ readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
241
+ readonly anchor_mode: v.StringSchema<undefined>;
242
+ readonly is_unanchored: v.BooleanSchema<undefined>;
243
+ readonly block_hash: v.StringSchema<undefined>;
244
+ readonly parent_block_hash: v.StringSchema<undefined>;
245
+ readonly block_height: v.NumberSchema<undefined>;
246
+ readonly block_time: v.NumberSchema<undefined>;
247
+ readonly block_time_iso: v.StringSchema<undefined>;
248
+ readonly burn_block_height: v.NumberSchema<undefined>;
249
+ readonly burn_block_time: v.NumberSchema<undefined>;
250
+ readonly burn_block_time_iso: v.StringSchema<undefined>;
251
+ readonly parent_burn_block_time: v.NumberSchema<undefined>;
252
+ readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
253
+ readonly canonical: v.BooleanSchema<undefined>;
254
+ readonly tx_index: v.NumberSchema<undefined>;
255
+ readonly tx_status: v.StringSchema<undefined>;
256
+ readonly tx_result: v.ObjectSchema<{
257
+ readonly hex: v.StringSchema<undefined>;
258
+ readonly repr: v.StringSchema<undefined>;
259
+ }, undefined>;
260
+ readonly microblock_hash: v.StringSchema<undefined>;
261
+ readonly microblock_sequence: v.NumberSchema<undefined>;
262
+ readonly microblock_canonical: v.BooleanSchema<undefined>;
263
+ readonly event_count: v.NumberSchema<undefined>;
264
+ readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
265
+ readonly execution_cost_read_count: v.NumberSchema<undefined>;
266
+ readonly execution_cost_read_length: v.NumberSchema<undefined>;
267
+ readonly execution_cost_runtime: v.NumberSchema<undefined>;
268
+ readonly execution_cost_write_count: v.NumberSchema<undefined>;
269
+ readonly execution_cost_write_length: v.NumberSchema<undefined>;
270
+ readonly tx_type: v.LiteralSchema<"smart_contract", undefined>;
271
+ readonly smart_contract: v.ObjectSchema<{
272
+ readonly clarity_version: v.UnionSchema<[v.NullSchema<undefined>, v.NumberSchema<undefined>], undefined>;
273
+ readonly contract_id: v.StringSchema<undefined>;
274
+ readonly source_code: v.StringSchema<undefined>;
275
+ }, undefined>;
276
+ }, undefined>, v.ObjectSchema<{
277
+ readonly tx_id: v.StringSchema<undefined>;
278
+ readonly nonce: v.NumberSchema<undefined>;
279
+ readonly fee_rate: v.StringSchema<undefined>;
280
+ readonly sender_address: v.StringSchema<undefined>;
281
+ readonly sponsored: v.BooleanSchema<undefined>;
282
+ readonly post_condition_mode: v.StringSchema<undefined>;
283
+ readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
284
+ readonly anchor_mode: v.StringSchema<undefined>;
285
+ readonly is_unanchored: v.BooleanSchema<undefined>;
286
+ readonly block_hash: v.StringSchema<undefined>;
287
+ readonly parent_block_hash: v.StringSchema<undefined>;
288
+ readonly block_height: v.NumberSchema<undefined>;
289
+ readonly block_time: v.NumberSchema<undefined>;
290
+ readonly block_time_iso: v.StringSchema<undefined>;
291
+ readonly burn_block_height: v.NumberSchema<undefined>;
292
+ readonly burn_block_time: v.NumberSchema<undefined>;
293
+ readonly burn_block_time_iso: v.StringSchema<undefined>;
294
+ readonly parent_burn_block_time: v.NumberSchema<undefined>;
295
+ readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
296
+ readonly canonical: v.BooleanSchema<undefined>;
297
+ readonly tx_index: v.NumberSchema<undefined>;
298
+ readonly tx_status: v.StringSchema<undefined>;
299
+ readonly tx_result: v.ObjectSchema<{
300
+ readonly hex: v.StringSchema<undefined>;
301
+ readonly repr: v.StringSchema<undefined>;
302
+ }, undefined>;
303
+ readonly microblock_hash: v.StringSchema<undefined>;
304
+ readonly microblock_sequence: v.NumberSchema<undefined>;
305
+ readonly microblock_canonical: v.BooleanSchema<undefined>;
306
+ readonly event_count: v.NumberSchema<undefined>;
307
+ readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
308
+ readonly execution_cost_read_count: v.NumberSchema<undefined>;
309
+ readonly execution_cost_read_length: v.NumberSchema<undefined>;
310
+ readonly execution_cost_runtime: v.NumberSchema<undefined>;
311
+ readonly execution_cost_write_count: v.NumberSchema<undefined>;
312
+ readonly execution_cost_write_length: v.NumberSchema<undefined>;
313
+ readonly tx_type: v.LiteralSchema<"token_transfer", undefined>;
314
+ readonly token_transfer: v.ObjectSchema<{
315
+ readonly recipient_address: v.StringSchema<undefined>;
316
+ readonly amount: v.StringSchema<undefined>;
317
+ readonly memo: v.StringSchema<undefined>;
318
+ }, undefined>;
319
+ }, undefined>], undefined>;
320
+ readonly stx_sent: v.StringSchema<undefined>;
321
+ readonly stx_received: v.StringSchema<undefined>;
322
+ readonly events: v.ObjectSchema<{
323
+ readonly stx: v.ObjectSchema<{
324
+ readonly transfer: v.NumberSchema<undefined>;
325
+ readonly mint: v.NumberSchema<undefined>;
326
+ readonly burn: v.NumberSchema<undefined>;
327
+ }, undefined>;
328
+ readonly ft: v.ObjectSchema<{
329
+ readonly transfer: v.NumberSchema<undefined>;
330
+ readonly mint: v.NumberSchema<undefined>;
331
+ readonly burn: v.NumberSchema<undefined>;
332
+ }, undefined>;
333
+ readonly nft: v.ObjectSchema<{
334
+ readonly transfer: v.NumberSchema<undefined>;
335
+ readonly mint: v.NumberSchema<undefined>;
336
+ readonly burn: v.NumberSchema<undefined>;
337
+ }, undefined>;
338
+ }, undefined>;
339
+ }, undefined>, undefined>;
340
+ readonly limit: v.NumberSchema<undefined>;
341
+ readonly offset: v.NumberSchema<undefined>;
342
+ readonly total: v.NumberSchema<undefined>;
343
+ }, undefined>;
344
+ type AddressTransactionsResponse = v.InferOutput<typeof addressTransactionsResponseSchema>;
345
+ declare function addressTransactions(args: Args$9): Promise<Result<AddressTransactionsResponse, SafeError<"FetchAddressTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
346
+
347
+ type Options$1 = {
348
+ poolPrincipal: string;
349
+ afterBlock?: number;
350
+ unanchored?: boolean;
351
+ limit?: number;
352
+ offset?: number;
353
+ };
354
+ declare const membersResponseSchema: v.ObjectSchema<{
355
+ readonly limit: v.NumberSchema<undefined>;
356
+ readonly offset: v.NumberSchema<undefined>;
357
+ readonly total: v.NumberSchema<undefined>;
358
+ readonly results: v.ArraySchema<v.ObjectSchema<{
359
+ readonly stacker: v.StringSchema<undefined>;
360
+ readonly pox_addr: v.OptionalSchema<v.StringSchema<undefined>, never>;
361
+ readonly amount_ustx: v.StringSchema<undefined>;
362
+ readonly burn_block_unlock_height: v.OptionalSchema<v.NumberSchema<undefined>, never>;
363
+ readonly block_height: v.NumberSchema<undefined>;
364
+ readonly tx_id: v.StringSchema<undefined>;
365
+ }, undefined>, undefined>;
366
+ }, undefined>;
367
+ type MembersResponse = v.InferOutput<typeof membersResponseSchema>;
368
+ declare function members(opts: Options$1, apiOpts: ApiRequestOptions): Promise<Result<MembersResponse>>;
369
+
370
+ type Options = {
371
+ sender: string;
372
+ arguments: string[];
373
+ contractAddress: string;
374
+ contractName: string;
375
+ functionName: string;
376
+ };
377
+ declare const readOnlyResponseSchema: v.VariantSchema<"okay", [v.ObjectSchema<{
378
+ readonly okay: v.LiteralSchema<true, undefined>;
379
+ readonly result: v.StringSchema<undefined>;
380
+ }, undefined>, v.ObjectSchema<{
381
+ readonly okay: v.LiteralSchema<false, undefined>;
382
+ readonly cause: v.UnknownSchema;
383
+ }, undefined>], undefined>;
384
+ type ReadOnlyResponse = v.InferOutput<typeof readOnlyResponseSchema>;
385
+ declare function readOnly(opts: Options, apiOpts: ApiRequestOptions): Promise<Result<ReadOnlyResponse>>;
386
+
387
+ type Args$8 = {
388
+ cycleNumber: number;
389
+ signerPublicKey: string;
390
+ } & ApiRequestOptions & ApiPaginationOptions;
391
+ declare const stackersForSignerInCycleResponseSchema: v.ObjectSchema<{
392
+ readonly results: v.ArraySchema<v.ObjectSchema<{
393
+ readonly stacker_address: v.StringSchema<undefined>;
394
+ readonly stacked_amount: v.StringSchema<undefined>;
395
+ readonly pox_address: v.StringSchema<undefined>;
396
+ readonly stacker_type: v.UnionSchema<[v.LiteralSchema<"pooled", undefined>, v.LiteralSchema<"solo", undefined>], undefined>;
397
+ }, undefined>, undefined>;
398
+ readonly limit: v.NumberSchema<undefined>;
399
+ readonly offset: v.NumberSchema<undefined>;
400
+ readonly total: v.NumberSchema<undefined>;
401
+ }, undefined>;
402
+ type StackersForSignerInCycleResponse = v.InferOutput<typeof stackersForSignerInCycleResponseSchema>;
403
+ declare function stackersForSignerInCycle(opts: Args$8): Promise<Result<StackersForSignerInCycleResponse, SafeError<"FetchStackersForSignerInCycleError" | "ParseBodyError" | "ValidateDataError">>>;
404
+
405
+ type Args$7 = {
406
+ cycleNumber: number;
407
+ } & ApiRequestOptions & ApiPaginationOptions;
408
+ declare const signersResponseSchema: v.ObjectSchema<{
409
+ readonly results: v.ArraySchema<v.ObjectSchema<{
410
+ readonly signing_key: v.StringSchema<undefined>;
411
+ readonly signer_address: v.StringSchema<undefined>;
412
+ readonly weight: v.NumberSchema<undefined>;
413
+ readonly stacked_amount: v.StringSchema<undefined>;
414
+ readonly weight_percent: v.NumberSchema<undefined>;
415
+ readonly stacked_amount_percent: v.NumberSchema<undefined>;
416
+ readonly pooled_stacker_count: v.NumberSchema<undefined>;
417
+ readonly solo_stacker_count: v.NumberSchema<undefined>;
418
+ }, undefined>, undefined>;
419
+ readonly limit: v.NumberSchema<undefined>;
420
+ readonly offset: v.NumberSchema<undefined>;
421
+ readonly total: v.NumberSchema<undefined>;
422
+ }, undefined>;
423
+ type SignersResponse = v.InferOutput<typeof signersResponseSchema>;
424
+ declare function signersInCycle(args: Args$7): Promise<Result<SignersResponse, SafeError<"FetchSignersError" | "ParseBodyError" | "ValidateDataError">>>;
425
+
426
+ type Args$6 = {
427
+ /**
428
+ * The signers public key as a hex string, with or without a '0x' prefix.
429
+ */
430
+ signerPublicKey: string;
431
+ cycleId: number;
432
+ } & ApiRequestOptions;
433
+ declare const signerInCycleResponseSchema: v.ObjectSchema<{
434
+ readonly signing_key: v.StringSchema<undefined>;
435
+ readonly signer_address: v.StringSchema<undefined>;
436
+ readonly weight: v.NumberSchema<undefined>;
437
+ readonly stacked_amount: v.StringSchema<undefined>;
438
+ readonly weight_percent: v.NumberSchema<undefined>;
439
+ readonly stacked_amount_percent: v.NumberSchema<undefined>;
440
+ readonly solo_stacker_count: v.NumberSchema<undefined>;
441
+ readonly pooled_stacker_count: v.NumberSchema<undefined>;
442
+ }, undefined>;
443
+ type SignerInCycleResponse = v.InferOutput<typeof signerInCycleResponseSchema>;
444
+ declare function signerInCycle(args: Args$6): Promise<Result<SignerInCycleResponse>>;
445
+
446
+ type Args$5 = ApiRequestOptions & ApiPaginationOptions;
447
+ declare const cyclesResponseSchema: v.ObjectSchema<{
448
+ readonly results: v.ArraySchema<v.ObjectSchema<{
449
+ readonly block_height: v.NumberSchema<undefined>;
450
+ readonly index_block_hash: v.StringSchema<undefined>;
451
+ readonly cycle_number: v.NumberSchema<undefined>;
452
+ readonly total_weight: v.NumberSchema<undefined>;
453
+ readonly total_stacked_amount: v.StringSchema<undefined>;
454
+ readonly total_signers: v.NumberSchema<undefined>;
455
+ }, undefined>, undefined>;
456
+ readonly limit: v.NumberSchema<undefined>;
457
+ readonly offset: v.NumberSchema<undefined>;
458
+ readonly total: v.NumberSchema<undefined>;
459
+ }, undefined>;
460
+ type CyclesResponse = v.InferOutput<typeof cyclesResponseSchema>;
461
+ declare function cycles(args: Args$5): Promise<Result<CyclesResponse>>;
462
+
463
+ type Args$4 = {
464
+ cycleNumber: number;
465
+ } & ApiRequestOptions;
466
+ declare const responseSchema$2: v.ObjectSchema<{
467
+ readonly block_height: v.NumberSchema<undefined>;
468
+ readonly index_block_hash: v.StringSchema<undefined>;
469
+ readonly cycle_number: v.NumberSchema<undefined>;
470
+ readonly total_weight: v.NumberSchema<undefined>;
471
+ readonly total_stacked_amount: v.StringSchema<undefined>;
472
+ readonly total_signers: v.NumberSchema<undefined>;
473
+ }, undefined>;
474
+ type Response$2 = v.InferOutput<typeof responseSchema$2>;
475
+ declare function cycle(opts: Args$4): Promise<Result<Response$2, SafeError<"FetchCycleError" | "ParseBodyError" | "ValidateDataError">>>;
476
+
477
+ type Args$3 = ApiRequestOptions;
478
+ declare const poxDetailsResponseSchema: v.ObjectSchema<{
479
+ readonly contract_id: v.StringSchema<undefined>;
480
+ readonly pox_activation_threshold_ustx: v.NumberSchema<undefined>;
481
+ readonly first_burnchain_block_height: v.NumberSchema<undefined>;
482
+ readonly current_burnchain_block_height: v.NumberSchema<undefined>;
483
+ readonly prepare_phase_block_length: v.NumberSchema<undefined>;
484
+ readonly reward_phase_block_length: v.NumberSchema<undefined>;
485
+ readonly reward_slots: v.NumberSchema<undefined>;
486
+ readonly rejection_fraction: v.NullSchema<undefined>;
487
+ readonly total_liquid_supply_ustx: v.NumberSchema<undefined>;
488
+ readonly current_cycle: v.ObjectSchema<{
489
+ readonly id: v.NumberSchema<undefined>;
490
+ readonly min_threshold_ustx: v.NumberSchema<undefined>;
491
+ readonly stacked_ustx: v.NumberSchema<undefined>;
492
+ readonly is_pox_active: v.BooleanSchema<undefined>;
493
+ }, undefined>;
494
+ readonly next_cycle: v.ObjectSchema<{
495
+ readonly id: v.NumberSchema<undefined>;
496
+ readonly min_threshold_ustx: v.NumberSchema<undefined>;
497
+ readonly min_increment_ustx: v.NumberSchema<undefined>;
498
+ readonly stacked_ustx: v.NumberSchema<undefined>;
499
+ readonly prepare_phase_start_block_height: v.NumberSchema<undefined>;
500
+ readonly blocks_until_prepare_phase: v.NumberSchema<undefined>;
501
+ readonly reward_phase_start_block_height: v.NumberSchema<undefined>;
502
+ readonly blocks_until_reward_phase: v.NumberSchema<undefined>;
503
+ readonly ustx_until_pox_rejection: v.NullSchema<undefined>;
504
+ }, undefined>;
505
+ readonly epochs: v.ArraySchema<v.ObjectSchema<{
506
+ readonly epoch_id: v.StringSchema<undefined>;
507
+ readonly start_height: v.NumberSchema<undefined>;
508
+ readonly end_height: v.NumberSchema<undefined>;
509
+ readonly block_limit: v.ObjectSchema<{
510
+ readonly write_length: v.NumberSchema<undefined>;
511
+ readonly write_count: v.NumberSchema<undefined>;
512
+ readonly read_length: v.NumberSchema<undefined>;
513
+ readonly read_count: v.NumberSchema<undefined>;
514
+ readonly runtime: v.NumberSchema<undefined>;
515
+ }, undefined>;
516
+ readonly network_epoch: v.NumberSchema<undefined>;
517
+ }, undefined>, undefined>;
518
+ readonly min_amount_ustx: v.NumberSchema<undefined>;
519
+ readonly prepare_cycle_length: v.NumberSchema<undefined>;
520
+ readonly reward_cycle_id: v.NumberSchema<undefined>;
521
+ readonly reward_cycle_length: v.NumberSchema<undefined>;
522
+ readonly rejection_votes_left_required: v.NullSchema<undefined>;
523
+ readonly next_reward_cycle_in: v.NumberSchema<undefined>;
524
+ readonly contract_versions: v.ArraySchema<v.ObjectSchema<{
525
+ readonly contract_id: v.StringSchema<undefined>;
526
+ readonly activation_burnchain_block_height: v.NumberSchema<undefined>;
527
+ readonly first_reward_cycle_id: v.NumberSchema<undefined>;
528
+ }, undefined>, undefined>;
529
+ }, undefined>;
530
+ type PoxDetailsResponse = v.InferOutput<typeof poxDetailsResponseSchema>;
531
+ declare function poxDetails(args: Args$3): Promise<Result<PoxDetailsResponse>>;
532
+
533
+ declare const CoreApiResponseSchema: v.ObjectSchema<{
534
+ readonly peer_version: v.NumberSchema<undefined>;
535
+ readonly pox_consensus: v.StringSchema<undefined>;
536
+ readonly burn_block_height: v.NumberSchema<undefined>;
537
+ readonly stable_pox_consensus: v.StringSchema<undefined>;
538
+ readonly stable_burn_block_height: v.NumberSchema<undefined>;
539
+ readonly server_version: v.StringSchema<undefined>;
540
+ readonly network_id: v.NumberSchema<undefined>;
541
+ readonly parent_network_id: v.NumberSchema<undefined>;
542
+ readonly stacks_tip_height: v.NumberSchema<undefined>;
543
+ readonly stacks_tip: v.StringSchema<undefined>;
544
+ readonly stacks_tip_consensus_hash: v.StringSchema<undefined>;
545
+ readonly unanchored_tip: v.StringSchema<undefined>;
546
+ readonly exit_at_block_height: v.NumberSchema<undefined>;
547
+ }, undefined>;
548
+ type CoreApiResponse = v.InferOutput<typeof CoreApiResponseSchema>;
549
+ declare function coreApi(apiOpts: ApiRequestOptions): Promise<Result<CoreApiResponse>>;
550
+
551
+ type Args$2 = {
552
+ heightOrHash: string | number;
553
+ } & ApiRequestOptions;
554
+ declare const responseSchema$1: v.ObjectSchema<{
555
+ readonly canonical: v.BooleanSchema<undefined>;
556
+ readonly height: v.NumberSchema<undefined>;
557
+ readonly hash: v.StringSchema<undefined>;
558
+ readonly block_time: v.NumberSchema<undefined>;
559
+ readonly block_time_iso: v.StringSchema<undefined>;
560
+ readonly index_block_hash: v.StringSchema<undefined>;
561
+ readonly parent_block_hash: v.StringSchema<undefined>;
562
+ readonly parent_index_block_hash: v.StringSchema<undefined>;
563
+ readonly burn_block_time: v.NumberSchema<undefined>;
564
+ readonly burn_block_time_iso: v.StringSchema<undefined>;
565
+ readonly burn_block_hash: v.StringSchema<undefined>;
566
+ readonly burn_block_height: v.NumberSchema<undefined>;
567
+ readonly miner_txid: v.StringSchema<undefined>;
568
+ readonly tx_count: v.NumberSchema<undefined>;
569
+ readonly execution_cost_read_count: v.NumberSchema<undefined>;
570
+ readonly execution_cost_read_length: v.NumberSchema<undefined>;
571
+ readonly execution_cost_runtime: v.NumberSchema<undefined>;
572
+ readonly execution_cost_write_count: v.NumberSchema<undefined>;
573
+ readonly execution_cost_write_length: v.NumberSchema<undefined>;
574
+ }, undefined>;
575
+ type Response$1 = v.InferOutput<typeof responseSchema$1>;
576
+ declare function getBlock(opts: Args$2): Promise<Result<Response$1, SafeError<"FetchBlockError" | "ParseBodyError" | "ValidateDataError">>>;
577
+
578
+ type Args$1 = {
579
+ principal: string;
580
+ unanchored?: boolean;
581
+ untilBlock?: number;
582
+ } & ApiRequestOptions;
583
+ declare const responseSchema: v.ObjectSchema<{
584
+ readonly stx: v.ObjectSchema<{
585
+ readonly balance: v.StringSchema<undefined>;
586
+ readonly total_sent: v.StringSchema<undefined>;
587
+ readonly total_received: v.StringSchema<undefined>;
588
+ readonly total_fees_sent: v.StringSchema<undefined>;
589
+ readonly total_miner_rewards_received: v.StringSchema<undefined>;
590
+ readonly lock_tx_id: v.StringSchema<undefined>;
591
+ readonly locked: v.StringSchema<undefined>;
592
+ readonly lock_height: v.NumberSchema<undefined>;
593
+ readonly burnchain_lock_height: v.NumberSchema<undefined>;
594
+ readonly burnchain_unlock_height: v.NumberSchema<undefined>;
595
+ }, undefined>;
596
+ readonly fungible_tokens: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
597
+ readonly balance: v.StringSchema<undefined>;
598
+ readonly total_sent: v.StringSchema<undefined>;
599
+ readonly total_received: v.StringSchema<undefined>;
600
+ }, undefined>, undefined>;
601
+ readonly non_fungible_tokens: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
602
+ readonly count: v.StringSchema<undefined>;
603
+ readonly total_sent: v.StringSchema<undefined>;
604
+ readonly total_received: v.StringSchema<undefined>;
605
+ }, undefined>, undefined>;
606
+ }, undefined>;
607
+ type Response = v.InferOutput<typeof responseSchema>;
608
+ declare function balances(opts: Args$1): Promise<Result<Response, SafeError<"FetchBalancesError" | "ParseBodyError" | "ValidateDataError">>>;
609
+
610
+ declare const stacksApi: {
611
+ accounts: {
612
+ balances: typeof balances;
613
+ };
614
+ blocks: {
615
+ getBlock: typeof getBlock;
616
+ };
617
+ info: {
618
+ coreApi: typeof coreApi;
619
+ poxDetails: typeof poxDetails;
620
+ };
621
+ proofOfTransfer: {
622
+ cycle: typeof cycle;
623
+ cycles: typeof cycles;
624
+ signerInCycle: typeof signerInCycle;
625
+ signersInCycle: typeof signersInCycle;
626
+ stackersForSignerInCycle: typeof stackersForSignerInCycle;
627
+ };
628
+ smartContracts: {
629
+ readOnly: typeof readOnly;
630
+ };
631
+ stackingPool: {
632
+ members: typeof members;
633
+ };
634
+ transactions: {
635
+ addressTransactions: typeof addressTransactions;
636
+ getTransaction: typeof getTransaction;
637
+ };
638
+ };
639
+
640
+ type Identifier = {
641
+ type: "address";
642
+ signerAddress: string;
643
+ } | {
644
+ type: "publicKey";
645
+ signerPublicKey: string;
646
+ };
647
+ type Args = {
648
+ identifier: Identifier;
649
+ } & {
650
+ cycleNumber: number;
651
+ } & ApiRequestOptions;
652
+ /**
653
+ * Return the total locked amount for a signer in a PoX cycle.
654
+ */
655
+ declare function getSignerStackedAmount(args: Args): Promise<Result<bigint, SafeError<"SignerNotFound" | string>>>;
656
+
657
+ declare const queries: {
658
+ getSignerStackedAmount: typeof getSignerStackedAmount;
659
+ };
660
+
661
+ export { queries, stacksApi };