@secretkeylabs/stacks-tools 0.4.0-47d10ad → 0.4.0-afcaa14
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 +6 -10
- package/dist/index.d.cts +24 -222
- package/dist/index.d.ts +24 -222
- package/dist/index.js +6 -10
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -667,15 +667,15 @@ var readOnlyResponseSchema = v11.variant("okay", [
|
|
|
667
667
|
cause: v11.unknown()
|
|
668
668
|
})
|
|
669
669
|
]);
|
|
670
|
-
async function readOnly(
|
|
671
|
-
const init = {
|
|
672
|
-
if (
|
|
670
|
+
async function readOnly(opts, apiOpts) {
|
|
671
|
+
const init = {};
|
|
672
|
+
if (apiOpts.apiKeyConfig) {
|
|
673
673
|
init.headers = {
|
|
674
|
-
[
|
|
674
|
+
[apiOpts.apiKeyConfig.header]: apiOpts.apiKeyConfig.key
|
|
675
675
|
};
|
|
676
676
|
}
|
|
677
677
|
const res = await fetch(
|
|
678
|
-
`${
|
|
678
|
+
`${apiOpts.baseUrl}/v2/contracts/call-read/${opts.contractAddress}/${opts.contractName}/${opts.functionName}`,
|
|
679
679
|
init
|
|
680
680
|
);
|
|
681
681
|
if (!res.ok) {
|
|
@@ -794,11 +794,7 @@ var baseTransactionSchema = v13.object({
|
|
|
794
794
|
parent_burn_block_time_iso: v13.string(),
|
|
795
795
|
canonical: v13.boolean(),
|
|
796
796
|
tx_index: v13.number(),
|
|
797
|
-
tx_status: v13.
|
|
798
|
-
v13.literal("success"),
|
|
799
|
-
v13.literal("abort_by_response"),
|
|
800
|
-
v13.literal("abort_by_post_condition")
|
|
801
|
-
]),
|
|
797
|
+
tx_status: v13.string(),
|
|
802
798
|
tx_result: v13.object({
|
|
803
799
|
hex: v13.string(),
|
|
804
800
|
repr: v13.string()
|
package/dist/index.d.cts
CHANGED
|
@@ -13,10 +13,6 @@ declare function safeCall<Return>(fn: () => Return): Result$1<Return, SafeError<
|
|
|
13
13
|
|
|
14
14
|
type ApiKeyConfig = {
|
|
15
15
|
key: string;
|
|
16
|
-
/**
|
|
17
|
-
* The header to use for the API key. For example, the Hiro API uses the
|
|
18
|
-
* header `x-api-key`.
|
|
19
|
-
*/
|
|
20
16
|
header: string;
|
|
21
17
|
};
|
|
22
18
|
type ApiRequestOptions = {
|
|
@@ -34,188 +30,6 @@ type ApiPaginationOptions = {
|
|
|
34
30
|
offset?: number;
|
|
35
31
|
};
|
|
36
32
|
|
|
37
|
-
declare const baseTransactionSchema: v.ObjectSchema<{
|
|
38
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
39
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
40
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
41
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
42
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
43
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
44
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
45
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
46
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
47
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
48
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
49
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
50
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
51
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
52
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
53
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
54
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
55
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
56
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
57
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
58
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
59
|
-
readonly tx_status: v.UnionSchema<[v.LiteralSchema<"success", undefined>, v.LiteralSchema<"abort_by_response", undefined>, v.LiteralSchema<"abort_by_post_condition", undefined>], undefined>;
|
|
60
|
-
readonly tx_result: v.ObjectSchema<{
|
|
61
|
-
readonly hex: v.StringSchema<undefined>;
|
|
62
|
-
readonly repr: v.StringSchema<undefined>;
|
|
63
|
-
}, undefined>;
|
|
64
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
65
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
66
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
67
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
68
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
69
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
70
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
71
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
72
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
73
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
74
|
-
}, undefined>;
|
|
75
|
-
declare const contractCallTransactionSchema: v.ObjectSchema<{
|
|
76
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
77
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
78
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
79
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
80
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
81
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
82
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
83
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
84
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
85
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
86
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
87
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
88
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
89
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
90
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
91
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
92
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
93
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
94
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
95
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
96
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
97
|
-
readonly tx_status: v.UnionSchema<[v.LiteralSchema<"success", undefined>, v.LiteralSchema<"abort_by_response", undefined>, v.LiteralSchema<"abort_by_post_condition", undefined>], undefined>;
|
|
98
|
-
readonly tx_result: v.ObjectSchema<{
|
|
99
|
-
readonly hex: v.StringSchema<undefined>;
|
|
100
|
-
readonly repr: v.StringSchema<undefined>;
|
|
101
|
-
}, undefined>;
|
|
102
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
103
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
104
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
105
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
106
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
107
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
108
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
109
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
110
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
111
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
112
|
-
readonly tx_type: v.LiteralSchema<"contract_call", undefined>;
|
|
113
|
-
readonly contract_call: v.ObjectSchema<{
|
|
114
|
-
readonly contract_id: v.StringSchema<undefined>;
|
|
115
|
-
readonly function_name: v.StringSchema<undefined>;
|
|
116
|
-
readonly function_signature: v.StringSchema<undefined>;
|
|
117
|
-
readonly function_args: v.ArraySchema<v.ObjectSchema<{
|
|
118
|
-
readonly hex: v.StringSchema<undefined>;
|
|
119
|
-
readonly repr: v.StringSchema<undefined>;
|
|
120
|
-
readonly name: v.StringSchema<undefined>;
|
|
121
|
-
readonly type: v.StringSchema<undefined>;
|
|
122
|
-
}, undefined>, undefined>;
|
|
123
|
-
}, undefined>;
|
|
124
|
-
}, undefined>;
|
|
125
|
-
type ContractCallTransaction = v.InferOutput<typeof contractCallTransactionSchema>;
|
|
126
|
-
declare const smartContractTransactionSchema: v.ObjectSchema<{
|
|
127
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
128
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
129
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
130
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
131
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
132
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
133
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
134
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
135
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
136
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
137
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
138
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
139
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
140
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
141
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
142
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
143
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
144
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
145
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
146
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
147
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
148
|
-
readonly tx_status: v.UnionSchema<[v.LiteralSchema<"success", undefined>, v.LiteralSchema<"abort_by_response", undefined>, v.LiteralSchema<"abort_by_post_condition", undefined>], undefined>;
|
|
149
|
-
readonly tx_result: v.ObjectSchema<{
|
|
150
|
-
readonly hex: v.StringSchema<undefined>;
|
|
151
|
-
readonly repr: v.StringSchema<undefined>;
|
|
152
|
-
}, undefined>;
|
|
153
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
154
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
155
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
156
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
157
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
158
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
159
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
160
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
161
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
162
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
163
|
-
readonly tx_type: v.LiteralSchema<"smart_contract", undefined>;
|
|
164
|
-
readonly smart_contract: v.ObjectSchema<{
|
|
165
|
-
/**
|
|
166
|
-
* NOTE: The types may be wrong, not sure what type of value is used when
|
|
167
|
-
* the version is not `null`.
|
|
168
|
-
*/
|
|
169
|
-
readonly clarity_version: v.UnionSchema<[v.NullSchema<undefined>, v.NumberSchema<undefined>], undefined>;
|
|
170
|
-
readonly contract_id: v.StringSchema<undefined>;
|
|
171
|
-
readonly source_code: v.StringSchema<undefined>;
|
|
172
|
-
}, undefined>;
|
|
173
|
-
}, undefined>;
|
|
174
|
-
type SmartContractTransaction = v.InferOutput<typeof smartContractTransactionSchema>;
|
|
175
|
-
declare const tokenTransferSchema: v.ObjectSchema<{
|
|
176
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
177
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
178
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
179
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
180
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
181
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
182
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
183
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
184
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
185
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
186
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
187
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
188
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
189
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
190
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
191
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
192
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
193
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
194
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
195
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
196
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
197
|
-
readonly tx_status: v.UnionSchema<[v.LiteralSchema<"success", undefined>, v.LiteralSchema<"abort_by_response", undefined>, v.LiteralSchema<"abort_by_post_condition", undefined>], undefined>;
|
|
198
|
-
readonly tx_result: v.ObjectSchema<{
|
|
199
|
-
readonly hex: v.StringSchema<undefined>;
|
|
200
|
-
readonly repr: v.StringSchema<undefined>;
|
|
201
|
-
}, undefined>;
|
|
202
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
203
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
204
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
205
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
206
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
207
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
208
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
209
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
210
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
211
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
212
|
-
readonly tx_type: v.LiteralSchema<"token_transfer", undefined>;
|
|
213
|
-
readonly token_transfer: v.ObjectSchema<{
|
|
214
|
-
readonly recipient_address: v.StringSchema<undefined>;
|
|
215
|
-
readonly amount: v.StringSchema<undefined>;
|
|
216
|
-
readonly memo: v.StringSchema<undefined>;
|
|
217
|
-
}, undefined>;
|
|
218
|
-
}, undefined>;
|
|
219
33
|
/**
|
|
220
34
|
* Incomplete schema of some transaction types.
|
|
221
35
|
*/
|
|
@@ -241,7 +55,7 @@ declare const transactionSchema: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
|
241
55
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
242
56
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
243
57
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
244
|
-
readonly tx_status: v.
|
|
58
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
245
59
|
readonly tx_result: v.ObjectSchema<{
|
|
246
60
|
readonly hex: v.StringSchema<undefined>;
|
|
247
61
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -290,7 +104,7 @@ declare const transactionSchema: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
|
290
104
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
291
105
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
292
106
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
293
|
-
readonly tx_status: v.
|
|
107
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
294
108
|
readonly tx_result: v.ObjectSchema<{
|
|
295
109
|
readonly hex: v.StringSchema<undefined>;
|
|
296
110
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -337,7 +151,7 @@ declare const transactionSchema: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
|
337
151
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
338
152
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
339
153
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
340
|
-
readonly tx_status: v.
|
|
154
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
341
155
|
readonly tx_result: v.ObjectSchema<{
|
|
342
156
|
readonly hex: v.StringSchema<undefined>;
|
|
343
157
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -361,29 +175,17 @@ declare const transactionSchema: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
|
361
175
|
}, undefined>], undefined>;
|
|
362
176
|
type Transaction = v.InferOutput<typeof transactionSchema>;
|
|
363
177
|
|
|
364
|
-
type
|
|
365
|
-
type schemas_SmartContractTransaction = SmartContractTransaction;
|
|
366
|
-
type schemas_Transaction = Transaction;
|
|
367
|
-
declare const schemas_baseTransactionSchema: typeof baseTransactionSchema;
|
|
368
|
-
declare const schemas_contractCallTransactionSchema: typeof contractCallTransactionSchema;
|
|
369
|
-
declare const schemas_smartContractTransactionSchema: typeof smartContractTransactionSchema;
|
|
370
|
-
declare const schemas_tokenTransferSchema: typeof tokenTransferSchema;
|
|
371
|
-
declare const schemas_transactionSchema: typeof transactionSchema;
|
|
372
|
-
declare namespace schemas {
|
|
373
|
-
export { type schemas_ContractCallTransaction as ContractCallTransaction, type schemas_SmartContractTransaction as SmartContractTransaction, type schemas_Transaction as Transaction, schemas_baseTransactionSchema as baseTransactionSchema, schemas_contractCallTransactionSchema as contractCallTransactionSchema, schemas_smartContractTransactionSchema as smartContractTransactionSchema, schemas_tokenTransferSchema as tokenTransferSchema, schemas_transactionSchema as transactionSchema };
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
type Args$a = {
|
|
178
|
+
type Args$9 = {
|
|
377
179
|
transactionId: string;
|
|
378
180
|
} & ApiRequestOptions;
|
|
379
|
-
declare function getTransaction(args: Args$
|
|
181
|
+
declare function getTransaction(args: Args$9): Promise<Result$1<Transaction>>;
|
|
380
182
|
|
|
381
183
|
declare const getTransaction$1_getTransaction: typeof getTransaction;
|
|
382
184
|
declare namespace getTransaction$1 {
|
|
383
185
|
export { getTransaction$1_getTransaction as getTransaction };
|
|
384
186
|
}
|
|
385
187
|
|
|
386
|
-
type Args$
|
|
188
|
+
type Args$8 = {
|
|
387
189
|
address: string;
|
|
388
190
|
} & ApiRequestOptions & ApiPaginationOptions;
|
|
389
191
|
declare const resultSchema: v.ObjectSchema<{
|
|
@@ -409,7 +211,7 @@ declare const resultSchema: v.ObjectSchema<{
|
|
|
409
211
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
410
212
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
411
213
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
412
|
-
readonly tx_status: v.
|
|
214
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
413
215
|
readonly tx_result: v.ObjectSchema<{
|
|
414
216
|
readonly hex: v.StringSchema<undefined>;
|
|
415
217
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -458,7 +260,7 @@ declare const resultSchema: v.ObjectSchema<{
|
|
|
458
260
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
459
261
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
460
262
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
461
|
-
readonly tx_status: v.
|
|
263
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
462
264
|
readonly tx_result: v.ObjectSchema<{
|
|
463
265
|
readonly hex: v.StringSchema<undefined>;
|
|
464
266
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -501,7 +303,7 @@ declare const resultSchema: v.ObjectSchema<{
|
|
|
501
303
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
502
304
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
503
305
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
504
|
-
readonly tx_status: v.
|
|
306
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
505
307
|
readonly tx_result: v.ObjectSchema<{
|
|
506
308
|
readonly hex: v.StringSchema<undefined>;
|
|
507
309
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -567,7 +369,7 @@ declare const resultsSchema$3: v.ArraySchema<v.ObjectSchema<{
|
|
|
567
369
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
568
370
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
569
371
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
570
|
-
readonly tx_status: v.
|
|
372
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
571
373
|
readonly tx_result: v.ObjectSchema<{
|
|
572
374
|
readonly hex: v.StringSchema<undefined>;
|
|
573
375
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -616,7 +418,7 @@ declare const resultsSchema$3: v.ArraySchema<v.ObjectSchema<{
|
|
|
616
418
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
617
419
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
618
420
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
619
|
-
readonly tx_status: v.
|
|
421
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
620
422
|
readonly tx_result: v.ObjectSchema<{
|
|
621
423
|
readonly hex: v.StringSchema<undefined>;
|
|
622
424
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -659,7 +461,7 @@ declare const resultsSchema$3: v.ArraySchema<v.ObjectSchema<{
|
|
|
659
461
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
660
462
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
661
463
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
662
|
-
readonly tx_status: v.
|
|
464
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
663
465
|
readonly tx_result: v.ObjectSchema<{
|
|
664
466
|
readonly hex: v.StringSchema<undefined>;
|
|
665
467
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -726,7 +528,7 @@ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
|
726
528
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
727
529
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
728
530
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
729
|
-
readonly tx_status: v.
|
|
531
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
730
532
|
readonly tx_result: v.ObjectSchema<{
|
|
731
533
|
readonly hex: v.StringSchema<undefined>;
|
|
732
534
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -775,7 +577,7 @@ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
|
775
577
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
776
578
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
777
579
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
778
|
-
readonly tx_status: v.
|
|
580
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
779
581
|
readonly tx_result: v.ObjectSchema<{
|
|
780
582
|
readonly hex: v.StringSchema<undefined>;
|
|
781
583
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -818,7 +620,7 @@ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
|
818
620
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
819
621
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
820
622
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
821
|
-
readonly tx_status: v.
|
|
623
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
822
624
|
readonly tx_result: v.ObjectSchema<{
|
|
823
625
|
readonly hex: v.StringSchema<undefined>;
|
|
824
626
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -865,7 +667,7 @@ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
|
865
667
|
readonly total: v.NumberSchema<undefined>;
|
|
866
668
|
}, undefined>;
|
|
867
669
|
type AddressTransactionsResponse = v.InferOutput<typeof addressTransactionsResponseSchema>;
|
|
868
|
-
declare function addressTransactions(args: Args$
|
|
670
|
+
declare function addressTransactions(args: Args$8): Promise<Result$1<AddressTransactionsResponse, SafeError<"FetchAddressTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
869
671
|
|
|
870
672
|
type addressTransactions$1_AddressTransactionsResponse = AddressTransactionsResponse;
|
|
871
673
|
type addressTransactions$1_Result = Result;
|
|
@@ -874,7 +676,7 @@ declare namespace addressTransactions$1 {
|
|
|
874
676
|
export { type addressTransactions$1_AddressTransactionsResponse as AddressTransactionsResponse, type addressTransactions$1_Result as Result, type Results$3 as Results, addressTransactions$1_addressTransactions as addressTransactions };
|
|
875
677
|
}
|
|
876
678
|
|
|
877
|
-
type Options$
|
|
679
|
+
type Options$2 = {
|
|
878
680
|
poolPrincipal: string;
|
|
879
681
|
afterBlock?: number;
|
|
880
682
|
unanchored?: boolean;
|
|
@@ -904,7 +706,7 @@ declare const membersResponseSchema: v.ObjectSchema<{
|
|
|
904
706
|
}, undefined>, undefined>;
|
|
905
707
|
}, undefined>;
|
|
906
708
|
type MembersResponse = v.InferOutput<typeof membersResponseSchema>;
|
|
907
|
-
declare function members(opts: Options$
|
|
709
|
+
declare function members(opts: Options$2, apiOpts: ApiRequestOptions): Promise<Result$1<MembersResponse>>;
|
|
908
710
|
|
|
909
711
|
type members$1_Member = Member;
|
|
910
712
|
type members$1_MembersResponse = MembersResponse;
|
|
@@ -912,16 +714,16 @@ declare const members$1_memberSchema: typeof memberSchema;
|
|
|
912
714
|
declare const members$1_members: typeof members;
|
|
913
715
|
declare const members$1_membersResponseSchema: typeof membersResponseSchema;
|
|
914
716
|
declare namespace members$1 {
|
|
915
|
-
export { type members$1_Member as Member, type members$1_MembersResponse as MembersResponse, type Options$
|
|
717
|
+
export { type members$1_Member as Member, type members$1_MembersResponse as MembersResponse, type Options$2 as Options, members$1_memberSchema as memberSchema, members$1_members as members, members$1_membersResponseSchema as membersResponseSchema };
|
|
916
718
|
}
|
|
917
719
|
|
|
918
|
-
type
|
|
720
|
+
type Options$1 = {
|
|
919
721
|
sender: string;
|
|
920
722
|
arguments: string[];
|
|
921
723
|
contractAddress: string;
|
|
922
724
|
contractName: string;
|
|
923
725
|
functionName: string;
|
|
924
|
-
}
|
|
726
|
+
};
|
|
925
727
|
declare const readOnlyResponseSchema: v.VariantSchema<"okay", [v.ObjectSchema<{
|
|
926
728
|
readonly okay: v.LiteralSchema<true, undefined>;
|
|
927
729
|
readonly result: v.StringSchema<undefined>;
|
|
@@ -930,13 +732,13 @@ declare const readOnlyResponseSchema: v.VariantSchema<"okay", [v.ObjectSchema<{
|
|
|
930
732
|
readonly cause: v.UnknownSchema;
|
|
931
733
|
}, undefined>], undefined>;
|
|
932
734
|
type ReadOnlyResponse = v.InferOutput<typeof readOnlyResponseSchema>;
|
|
933
|
-
declare function readOnly(
|
|
735
|
+
declare function readOnly(opts: Options$1, apiOpts: ApiRequestOptions): Promise<Result$1<ReadOnlyResponse>>;
|
|
934
736
|
|
|
935
737
|
type readOnly$1_ReadOnlyResponse = ReadOnlyResponse;
|
|
936
738
|
declare const readOnly$1_readOnly: typeof readOnly;
|
|
937
739
|
declare const readOnly$1_readOnlyResponseSchema: typeof readOnlyResponseSchema;
|
|
938
740
|
declare namespace readOnly$1 {
|
|
939
|
-
export { type
|
|
741
|
+
export { type Options$1 as Options, type readOnly$1_ReadOnlyResponse as ReadOnlyResponse, readOnly$1_readOnly as readOnly, readOnly$1_readOnlyResponseSchema as readOnlyResponseSchema };
|
|
940
742
|
}
|
|
941
743
|
|
|
942
744
|
type Args$7 = {
|
|
@@ -1319,7 +1121,7 @@ declare namespace index$2 {
|
|
|
1319
1121
|
declare const index$1_addressTransactions: typeof addressTransactions;
|
|
1320
1122
|
declare const index$1_getTransaction: typeof getTransaction;
|
|
1321
1123
|
declare namespace index$1 {
|
|
1322
|
-
export { addressTransactions$1 as AddressTransactions,
|
|
1124
|
+
export { addressTransactions$1 as AddressTransactions, getTransaction$1 as GetTransaction, index$1_addressTransactions as addressTransactions, index$1_getTransaction as getTransaction };
|
|
1323
1125
|
}
|
|
1324
1126
|
|
|
1325
1127
|
declare const accounts: {
|
package/dist/index.d.ts
CHANGED
|
@@ -13,10 +13,6 @@ declare function safeCall<Return>(fn: () => Return): Result$1<Return, SafeError<
|
|
|
13
13
|
|
|
14
14
|
type ApiKeyConfig = {
|
|
15
15
|
key: string;
|
|
16
|
-
/**
|
|
17
|
-
* The header to use for the API key. For example, the Hiro API uses the
|
|
18
|
-
* header `x-api-key`.
|
|
19
|
-
*/
|
|
20
16
|
header: string;
|
|
21
17
|
};
|
|
22
18
|
type ApiRequestOptions = {
|
|
@@ -34,188 +30,6 @@ type ApiPaginationOptions = {
|
|
|
34
30
|
offset?: number;
|
|
35
31
|
};
|
|
36
32
|
|
|
37
|
-
declare const baseTransactionSchema: v.ObjectSchema<{
|
|
38
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
39
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
40
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
41
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
42
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
43
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
44
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
45
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
46
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
47
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
48
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
49
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
50
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
51
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
52
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
53
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
54
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
55
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
56
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
57
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
58
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
59
|
-
readonly tx_status: v.UnionSchema<[v.LiteralSchema<"success", undefined>, v.LiteralSchema<"abort_by_response", undefined>, v.LiteralSchema<"abort_by_post_condition", undefined>], undefined>;
|
|
60
|
-
readonly tx_result: v.ObjectSchema<{
|
|
61
|
-
readonly hex: v.StringSchema<undefined>;
|
|
62
|
-
readonly repr: v.StringSchema<undefined>;
|
|
63
|
-
}, undefined>;
|
|
64
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
65
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
66
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
67
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
68
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
69
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
70
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
71
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
72
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
73
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
74
|
-
}, undefined>;
|
|
75
|
-
declare const contractCallTransactionSchema: v.ObjectSchema<{
|
|
76
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
77
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
78
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
79
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
80
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
81
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
82
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
83
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
84
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
85
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
86
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
87
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
88
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
89
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
90
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
91
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
92
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
93
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
94
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
95
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
96
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
97
|
-
readonly tx_status: v.UnionSchema<[v.LiteralSchema<"success", undefined>, v.LiteralSchema<"abort_by_response", undefined>, v.LiteralSchema<"abort_by_post_condition", undefined>], undefined>;
|
|
98
|
-
readonly tx_result: v.ObjectSchema<{
|
|
99
|
-
readonly hex: v.StringSchema<undefined>;
|
|
100
|
-
readonly repr: v.StringSchema<undefined>;
|
|
101
|
-
}, undefined>;
|
|
102
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
103
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
104
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
105
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
106
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
107
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
108
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
109
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
110
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
111
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
112
|
-
readonly tx_type: v.LiteralSchema<"contract_call", undefined>;
|
|
113
|
-
readonly contract_call: v.ObjectSchema<{
|
|
114
|
-
readonly contract_id: v.StringSchema<undefined>;
|
|
115
|
-
readonly function_name: v.StringSchema<undefined>;
|
|
116
|
-
readonly function_signature: v.StringSchema<undefined>;
|
|
117
|
-
readonly function_args: v.ArraySchema<v.ObjectSchema<{
|
|
118
|
-
readonly hex: v.StringSchema<undefined>;
|
|
119
|
-
readonly repr: v.StringSchema<undefined>;
|
|
120
|
-
readonly name: v.StringSchema<undefined>;
|
|
121
|
-
readonly type: v.StringSchema<undefined>;
|
|
122
|
-
}, undefined>, undefined>;
|
|
123
|
-
}, undefined>;
|
|
124
|
-
}, undefined>;
|
|
125
|
-
type ContractCallTransaction = v.InferOutput<typeof contractCallTransactionSchema>;
|
|
126
|
-
declare const smartContractTransactionSchema: v.ObjectSchema<{
|
|
127
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
128
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
129
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
130
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
131
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
132
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
133
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
134
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
135
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
136
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
137
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
138
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
139
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
140
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
141
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
142
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
143
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
144
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
145
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
146
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
147
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
148
|
-
readonly tx_status: v.UnionSchema<[v.LiteralSchema<"success", undefined>, v.LiteralSchema<"abort_by_response", undefined>, v.LiteralSchema<"abort_by_post_condition", undefined>], undefined>;
|
|
149
|
-
readonly tx_result: v.ObjectSchema<{
|
|
150
|
-
readonly hex: v.StringSchema<undefined>;
|
|
151
|
-
readonly repr: v.StringSchema<undefined>;
|
|
152
|
-
}, undefined>;
|
|
153
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
154
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
155
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
156
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
157
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
158
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
159
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
160
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
161
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
162
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
163
|
-
readonly tx_type: v.LiteralSchema<"smart_contract", undefined>;
|
|
164
|
-
readonly smart_contract: v.ObjectSchema<{
|
|
165
|
-
/**
|
|
166
|
-
* NOTE: The types may be wrong, not sure what type of value is used when
|
|
167
|
-
* the version is not `null`.
|
|
168
|
-
*/
|
|
169
|
-
readonly clarity_version: v.UnionSchema<[v.NullSchema<undefined>, v.NumberSchema<undefined>], undefined>;
|
|
170
|
-
readonly contract_id: v.StringSchema<undefined>;
|
|
171
|
-
readonly source_code: v.StringSchema<undefined>;
|
|
172
|
-
}, undefined>;
|
|
173
|
-
}, undefined>;
|
|
174
|
-
type SmartContractTransaction = v.InferOutput<typeof smartContractTransactionSchema>;
|
|
175
|
-
declare const tokenTransferSchema: v.ObjectSchema<{
|
|
176
|
-
readonly tx_id: v.StringSchema<undefined>;
|
|
177
|
-
readonly nonce: v.NumberSchema<undefined>;
|
|
178
|
-
readonly fee_rate: v.StringSchema<undefined>;
|
|
179
|
-
readonly sender_address: v.StringSchema<undefined>;
|
|
180
|
-
readonly sponsored: v.BooleanSchema<undefined>;
|
|
181
|
-
readonly post_condition_mode: v.StringSchema<undefined>;
|
|
182
|
-
readonly post_conditions: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
183
|
-
readonly anchor_mode: v.StringSchema<undefined>;
|
|
184
|
-
readonly is_unanchored: v.BooleanSchema<undefined>;
|
|
185
|
-
readonly block_hash: v.StringSchema<undefined>;
|
|
186
|
-
readonly parent_block_hash: v.StringSchema<undefined>;
|
|
187
|
-
readonly block_height: v.NumberSchema<undefined>;
|
|
188
|
-
readonly block_time: v.NumberSchema<undefined>;
|
|
189
|
-
readonly block_time_iso: v.StringSchema<undefined>;
|
|
190
|
-
readonly burn_block_height: v.NumberSchema<undefined>;
|
|
191
|
-
readonly burn_block_time: v.NumberSchema<undefined>;
|
|
192
|
-
readonly burn_block_time_iso: v.StringSchema<undefined>;
|
|
193
|
-
readonly parent_burn_block_time: v.NumberSchema<undefined>;
|
|
194
|
-
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
195
|
-
readonly canonical: v.BooleanSchema<undefined>;
|
|
196
|
-
readonly tx_index: v.NumberSchema<undefined>;
|
|
197
|
-
readonly tx_status: v.UnionSchema<[v.LiteralSchema<"success", undefined>, v.LiteralSchema<"abort_by_response", undefined>, v.LiteralSchema<"abort_by_post_condition", undefined>], undefined>;
|
|
198
|
-
readonly tx_result: v.ObjectSchema<{
|
|
199
|
-
readonly hex: v.StringSchema<undefined>;
|
|
200
|
-
readonly repr: v.StringSchema<undefined>;
|
|
201
|
-
}, undefined>;
|
|
202
|
-
readonly microblock_hash: v.StringSchema<undefined>;
|
|
203
|
-
readonly microblock_sequence: v.NumberSchema<undefined>;
|
|
204
|
-
readonly microblock_canonical: v.BooleanSchema<undefined>;
|
|
205
|
-
readonly event_count: v.NumberSchema<undefined>;
|
|
206
|
-
readonly events: v.ArraySchema<v.UnknownSchema, undefined>;
|
|
207
|
-
readonly execution_cost_read_count: v.NumberSchema<undefined>;
|
|
208
|
-
readonly execution_cost_read_length: v.NumberSchema<undefined>;
|
|
209
|
-
readonly execution_cost_runtime: v.NumberSchema<undefined>;
|
|
210
|
-
readonly execution_cost_write_count: v.NumberSchema<undefined>;
|
|
211
|
-
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
212
|
-
readonly tx_type: v.LiteralSchema<"token_transfer", undefined>;
|
|
213
|
-
readonly token_transfer: v.ObjectSchema<{
|
|
214
|
-
readonly recipient_address: v.StringSchema<undefined>;
|
|
215
|
-
readonly amount: v.StringSchema<undefined>;
|
|
216
|
-
readonly memo: v.StringSchema<undefined>;
|
|
217
|
-
}, undefined>;
|
|
218
|
-
}, undefined>;
|
|
219
33
|
/**
|
|
220
34
|
* Incomplete schema of some transaction types.
|
|
221
35
|
*/
|
|
@@ -241,7 +55,7 @@ declare const transactionSchema: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
|
241
55
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
242
56
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
243
57
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
244
|
-
readonly tx_status: v.
|
|
58
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
245
59
|
readonly tx_result: v.ObjectSchema<{
|
|
246
60
|
readonly hex: v.StringSchema<undefined>;
|
|
247
61
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -290,7 +104,7 @@ declare const transactionSchema: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
|
290
104
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
291
105
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
292
106
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
293
|
-
readonly tx_status: v.
|
|
107
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
294
108
|
readonly tx_result: v.ObjectSchema<{
|
|
295
109
|
readonly hex: v.StringSchema<undefined>;
|
|
296
110
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -337,7 +151,7 @@ declare const transactionSchema: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
|
337
151
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
338
152
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
339
153
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
340
|
-
readonly tx_status: v.
|
|
154
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
341
155
|
readonly tx_result: v.ObjectSchema<{
|
|
342
156
|
readonly hex: v.StringSchema<undefined>;
|
|
343
157
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -361,29 +175,17 @@ declare const transactionSchema: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
|
361
175
|
}, undefined>], undefined>;
|
|
362
176
|
type Transaction = v.InferOutput<typeof transactionSchema>;
|
|
363
177
|
|
|
364
|
-
type
|
|
365
|
-
type schemas_SmartContractTransaction = SmartContractTransaction;
|
|
366
|
-
type schemas_Transaction = Transaction;
|
|
367
|
-
declare const schemas_baseTransactionSchema: typeof baseTransactionSchema;
|
|
368
|
-
declare const schemas_contractCallTransactionSchema: typeof contractCallTransactionSchema;
|
|
369
|
-
declare const schemas_smartContractTransactionSchema: typeof smartContractTransactionSchema;
|
|
370
|
-
declare const schemas_tokenTransferSchema: typeof tokenTransferSchema;
|
|
371
|
-
declare const schemas_transactionSchema: typeof transactionSchema;
|
|
372
|
-
declare namespace schemas {
|
|
373
|
-
export { type schemas_ContractCallTransaction as ContractCallTransaction, type schemas_SmartContractTransaction as SmartContractTransaction, type schemas_Transaction as Transaction, schemas_baseTransactionSchema as baseTransactionSchema, schemas_contractCallTransactionSchema as contractCallTransactionSchema, schemas_smartContractTransactionSchema as smartContractTransactionSchema, schemas_tokenTransferSchema as tokenTransferSchema, schemas_transactionSchema as transactionSchema };
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
type Args$a = {
|
|
178
|
+
type Args$9 = {
|
|
377
179
|
transactionId: string;
|
|
378
180
|
} & ApiRequestOptions;
|
|
379
|
-
declare function getTransaction(args: Args$
|
|
181
|
+
declare function getTransaction(args: Args$9): Promise<Result$1<Transaction>>;
|
|
380
182
|
|
|
381
183
|
declare const getTransaction$1_getTransaction: typeof getTransaction;
|
|
382
184
|
declare namespace getTransaction$1 {
|
|
383
185
|
export { getTransaction$1_getTransaction as getTransaction };
|
|
384
186
|
}
|
|
385
187
|
|
|
386
|
-
type Args$
|
|
188
|
+
type Args$8 = {
|
|
387
189
|
address: string;
|
|
388
190
|
} & ApiRequestOptions & ApiPaginationOptions;
|
|
389
191
|
declare const resultSchema: v.ObjectSchema<{
|
|
@@ -409,7 +211,7 @@ declare const resultSchema: v.ObjectSchema<{
|
|
|
409
211
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
410
212
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
411
213
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
412
|
-
readonly tx_status: v.
|
|
214
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
413
215
|
readonly tx_result: v.ObjectSchema<{
|
|
414
216
|
readonly hex: v.StringSchema<undefined>;
|
|
415
217
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -458,7 +260,7 @@ declare const resultSchema: v.ObjectSchema<{
|
|
|
458
260
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
459
261
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
460
262
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
461
|
-
readonly tx_status: v.
|
|
263
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
462
264
|
readonly tx_result: v.ObjectSchema<{
|
|
463
265
|
readonly hex: v.StringSchema<undefined>;
|
|
464
266
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -501,7 +303,7 @@ declare const resultSchema: v.ObjectSchema<{
|
|
|
501
303
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
502
304
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
503
305
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
504
|
-
readonly tx_status: v.
|
|
306
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
505
307
|
readonly tx_result: v.ObjectSchema<{
|
|
506
308
|
readonly hex: v.StringSchema<undefined>;
|
|
507
309
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -567,7 +369,7 @@ declare const resultsSchema$3: v.ArraySchema<v.ObjectSchema<{
|
|
|
567
369
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
568
370
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
569
371
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
570
|
-
readonly tx_status: v.
|
|
372
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
571
373
|
readonly tx_result: v.ObjectSchema<{
|
|
572
374
|
readonly hex: v.StringSchema<undefined>;
|
|
573
375
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -616,7 +418,7 @@ declare const resultsSchema$3: v.ArraySchema<v.ObjectSchema<{
|
|
|
616
418
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
617
419
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
618
420
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
619
|
-
readonly tx_status: v.
|
|
421
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
620
422
|
readonly tx_result: v.ObjectSchema<{
|
|
621
423
|
readonly hex: v.StringSchema<undefined>;
|
|
622
424
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -659,7 +461,7 @@ declare const resultsSchema$3: v.ArraySchema<v.ObjectSchema<{
|
|
|
659
461
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
660
462
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
661
463
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
662
|
-
readonly tx_status: v.
|
|
464
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
663
465
|
readonly tx_result: v.ObjectSchema<{
|
|
664
466
|
readonly hex: v.StringSchema<undefined>;
|
|
665
467
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -726,7 +528,7 @@ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
|
726
528
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
727
529
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
728
530
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
729
|
-
readonly tx_status: v.
|
|
531
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
730
532
|
readonly tx_result: v.ObjectSchema<{
|
|
731
533
|
readonly hex: v.StringSchema<undefined>;
|
|
732
534
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -775,7 +577,7 @@ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
|
775
577
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
776
578
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
777
579
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
778
|
-
readonly tx_status: v.
|
|
580
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
779
581
|
readonly tx_result: v.ObjectSchema<{
|
|
780
582
|
readonly hex: v.StringSchema<undefined>;
|
|
781
583
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -818,7 +620,7 @@ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
|
818
620
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
819
621
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
820
622
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
821
|
-
readonly tx_status: v.
|
|
623
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
822
624
|
readonly tx_result: v.ObjectSchema<{
|
|
823
625
|
readonly hex: v.StringSchema<undefined>;
|
|
824
626
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -865,7 +667,7 @@ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
|
865
667
|
readonly total: v.NumberSchema<undefined>;
|
|
866
668
|
}, undefined>;
|
|
867
669
|
type AddressTransactionsResponse = v.InferOutput<typeof addressTransactionsResponseSchema>;
|
|
868
|
-
declare function addressTransactions(args: Args$
|
|
670
|
+
declare function addressTransactions(args: Args$8): Promise<Result$1<AddressTransactionsResponse, SafeError<"FetchAddressTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
869
671
|
|
|
870
672
|
type addressTransactions$1_AddressTransactionsResponse = AddressTransactionsResponse;
|
|
871
673
|
type addressTransactions$1_Result = Result;
|
|
@@ -874,7 +676,7 @@ declare namespace addressTransactions$1 {
|
|
|
874
676
|
export { type addressTransactions$1_AddressTransactionsResponse as AddressTransactionsResponse, type addressTransactions$1_Result as Result, type Results$3 as Results, addressTransactions$1_addressTransactions as addressTransactions };
|
|
875
677
|
}
|
|
876
678
|
|
|
877
|
-
type Options$
|
|
679
|
+
type Options$2 = {
|
|
878
680
|
poolPrincipal: string;
|
|
879
681
|
afterBlock?: number;
|
|
880
682
|
unanchored?: boolean;
|
|
@@ -904,7 +706,7 @@ declare const membersResponseSchema: v.ObjectSchema<{
|
|
|
904
706
|
}, undefined>, undefined>;
|
|
905
707
|
}, undefined>;
|
|
906
708
|
type MembersResponse = v.InferOutput<typeof membersResponseSchema>;
|
|
907
|
-
declare function members(opts: Options$
|
|
709
|
+
declare function members(opts: Options$2, apiOpts: ApiRequestOptions): Promise<Result$1<MembersResponse>>;
|
|
908
710
|
|
|
909
711
|
type members$1_Member = Member;
|
|
910
712
|
type members$1_MembersResponse = MembersResponse;
|
|
@@ -912,16 +714,16 @@ declare const members$1_memberSchema: typeof memberSchema;
|
|
|
912
714
|
declare const members$1_members: typeof members;
|
|
913
715
|
declare const members$1_membersResponseSchema: typeof membersResponseSchema;
|
|
914
716
|
declare namespace members$1 {
|
|
915
|
-
export { type members$1_Member as Member, type members$1_MembersResponse as MembersResponse, type Options$
|
|
717
|
+
export { type members$1_Member as Member, type members$1_MembersResponse as MembersResponse, type Options$2 as Options, members$1_memberSchema as memberSchema, members$1_members as members, members$1_membersResponseSchema as membersResponseSchema };
|
|
916
718
|
}
|
|
917
719
|
|
|
918
|
-
type
|
|
720
|
+
type Options$1 = {
|
|
919
721
|
sender: string;
|
|
920
722
|
arguments: string[];
|
|
921
723
|
contractAddress: string;
|
|
922
724
|
contractName: string;
|
|
923
725
|
functionName: string;
|
|
924
|
-
}
|
|
726
|
+
};
|
|
925
727
|
declare const readOnlyResponseSchema: v.VariantSchema<"okay", [v.ObjectSchema<{
|
|
926
728
|
readonly okay: v.LiteralSchema<true, undefined>;
|
|
927
729
|
readonly result: v.StringSchema<undefined>;
|
|
@@ -930,13 +732,13 @@ declare const readOnlyResponseSchema: v.VariantSchema<"okay", [v.ObjectSchema<{
|
|
|
930
732
|
readonly cause: v.UnknownSchema;
|
|
931
733
|
}, undefined>], undefined>;
|
|
932
734
|
type ReadOnlyResponse = v.InferOutput<typeof readOnlyResponseSchema>;
|
|
933
|
-
declare function readOnly(
|
|
735
|
+
declare function readOnly(opts: Options$1, apiOpts: ApiRequestOptions): Promise<Result$1<ReadOnlyResponse>>;
|
|
934
736
|
|
|
935
737
|
type readOnly$1_ReadOnlyResponse = ReadOnlyResponse;
|
|
936
738
|
declare const readOnly$1_readOnly: typeof readOnly;
|
|
937
739
|
declare const readOnly$1_readOnlyResponseSchema: typeof readOnlyResponseSchema;
|
|
938
740
|
declare namespace readOnly$1 {
|
|
939
|
-
export { type
|
|
741
|
+
export { type Options$1 as Options, type readOnly$1_ReadOnlyResponse as ReadOnlyResponse, readOnly$1_readOnly as readOnly, readOnly$1_readOnlyResponseSchema as readOnlyResponseSchema };
|
|
940
742
|
}
|
|
941
743
|
|
|
942
744
|
type Args$7 = {
|
|
@@ -1319,7 +1121,7 @@ declare namespace index$2 {
|
|
|
1319
1121
|
declare const index$1_addressTransactions: typeof addressTransactions;
|
|
1320
1122
|
declare const index$1_getTransaction: typeof getTransaction;
|
|
1321
1123
|
declare namespace index$1 {
|
|
1322
|
-
export { addressTransactions$1 as AddressTransactions,
|
|
1124
|
+
export { addressTransactions$1 as AddressTransactions, getTransaction$1 as GetTransaction, index$1_addressTransactions as addressTransactions, index$1_getTransaction as getTransaction };
|
|
1323
1125
|
}
|
|
1324
1126
|
|
|
1325
1127
|
declare const accounts: {
|
package/dist/index.js
CHANGED
|
@@ -625,15 +625,15 @@ var readOnlyResponseSchema = v11.variant("okay", [
|
|
|
625
625
|
cause: v11.unknown()
|
|
626
626
|
})
|
|
627
627
|
]);
|
|
628
|
-
async function readOnly(
|
|
629
|
-
const init = {
|
|
630
|
-
if (
|
|
628
|
+
async function readOnly(opts, apiOpts) {
|
|
629
|
+
const init = {};
|
|
630
|
+
if (apiOpts.apiKeyConfig) {
|
|
631
631
|
init.headers = {
|
|
632
|
-
[
|
|
632
|
+
[apiOpts.apiKeyConfig.header]: apiOpts.apiKeyConfig.key
|
|
633
633
|
};
|
|
634
634
|
}
|
|
635
635
|
const res = await fetch(
|
|
636
|
-
`${
|
|
636
|
+
`${apiOpts.baseUrl}/v2/contracts/call-read/${opts.contractAddress}/${opts.contractName}/${opts.functionName}`,
|
|
637
637
|
init
|
|
638
638
|
);
|
|
639
639
|
if (!res.ok) {
|
|
@@ -752,11 +752,7 @@ var baseTransactionSchema = v13.object({
|
|
|
752
752
|
parent_burn_block_time_iso: v13.string(),
|
|
753
753
|
canonical: v13.boolean(),
|
|
754
754
|
tx_index: v13.number(),
|
|
755
|
-
tx_status: v13.
|
|
756
|
-
v13.literal("success"),
|
|
757
|
-
v13.literal("abort_by_response"),
|
|
758
|
-
v13.literal("abort_by_post_condition")
|
|
759
|
-
]),
|
|
755
|
+
tx_status: v13.string(),
|
|
760
756
|
tx_result: v13.object({
|
|
761
757
|
hex: v13.string(),
|
|
762
758
|
repr: v13.string()
|