@secretkeylabs/stacks-tools 0.4.0-47d10ad → 0.4.0-80a0ce6
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 +27 -31
- package/dist/index.d.ts +27 -31
- 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 = {
|
|
@@ -56,7 +52,7 @@ declare const baseTransactionSchema: v.ObjectSchema<{
|
|
|
56
52
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
57
53
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
58
54
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
59
|
-
readonly tx_status: v.
|
|
55
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
60
56
|
readonly tx_result: v.ObjectSchema<{
|
|
61
57
|
readonly hex: v.StringSchema<undefined>;
|
|
62
58
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -94,7 +90,7 @@ declare const contractCallTransactionSchema: v.ObjectSchema<{
|
|
|
94
90
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
95
91
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
96
92
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
97
|
-
readonly tx_status: v.
|
|
93
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
98
94
|
readonly tx_result: v.ObjectSchema<{
|
|
99
95
|
readonly hex: v.StringSchema<undefined>;
|
|
100
96
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -145,7 +141,7 @@ declare const smartContractTransactionSchema: v.ObjectSchema<{
|
|
|
145
141
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
146
142
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
147
143
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
148
|
-
readonly tx_status: v.
|
|
144
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
149
145
|
readonly tx_result: v.ObjectSchema<{
|
|
150
146
|
readonly hex: v.StringSchema<undefined>;
|
|
151
147
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -194,7 +190,7 @@ declare const tokenTransferSchema: v.ObjectSchema<{
|
|
|
194
190
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
195
191
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
196
192
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
197
|
-
readonly tx_status: v.
|
|
193
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
198
194
|
readonly tx_result: v.ObjectSchema<{
|
|
199
195
|
readonly hex: v.StringSchema<undefined>;
|
|
200
196
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -241,7 +237,7 @@ declare const transactionSchema: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
|
241
237
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
242
238
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
243
239
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
244
|
-
readonly tx_status: v.
|
|
240
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
245
241
|
readonly tx_result: v.ObjectSchema<{
|
|
246
242
|
readonly hex: v.StringSchema<undefined>;
|
|
247
243
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -290,7 +286,7 @@ declare const transactionSchema: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
|
290
286
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
291
287
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
292
288
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
293
|
-
readonly tx_status: v.
|
|
289
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
294
290
|
readonly tx_result: v.ObjectSchema<{
|
|
295
291
|
readonly hex: v.StringSchema<undefined>;
|
|
296
292
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -337,7 +333,7 @@ declare const transactionSchema: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
|
337
333
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
338
334
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
339
335
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
340
|
-
readonly tx_status: v.
|
|
336
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
341
337
|
readonly tx_result: v.ObjectSchema<{
|
|
342
338
|
readonly hex: v.StringSchema<undefined>;
|
|
343
339
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -373,17 +369,17 @@ declare namespace schemas {
|
|
|
373
369
|
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
370
|
}
|
|
375
371
|
|
|
376
|
-
type Args$
|
|
372
|
+
type Args$9 = {
|
|
377
373
|
transactionId: string;
|
|
378
374
|
} & ApiRequestOptions;
|
|
379
|
-
declare function getTransaction(args: Args$
|
|
375
|
+
declare function getTransaction(args: Args$9): Promise<Result$1<Transaction>>;
|
|
380
376
|
|
|
381
377
|
declare const getTransaction$1_getTransaction: typeof getTransaction;
|
|
382
378
|
declare namespace getTransaction$1 {
|
|
383
379
|
export { getTransaction$1_getTransaction as getTransaction };
|
|
384
380
|
}
|
|
385
381
|
|
|
386
|
-
type Args$
|
|
382
|
+
type Args$8 = {
|
|
387
383
|
address: string;
|
|
388
384
|
} & ApiRequestOptions & ApiPaginationOptions;
|
|
389
385
|
declare const resultSchema: v.ObjectSchema<{
|
|
@@ -409,7 +405,7 @@ declare const resultSchema: v.ObjectSchema<{
|
|
|
409
405
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
410
406
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
411
407
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
412
|
-
readonly tx_status: v.
|
|
408
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
413
409
|
readonly tx_result: v.ObjectSchema<{
|
|
414
410
|
readonly hex: v.StringSchema<undefined>;
|
|
415
411
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -458,7 +454,7 @@ declare const resultSchema: v.ObjectSchema<{
|
|
|
458
454
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
459
455
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
460
456
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
461
|
-
readonly tx_status: v.
|
|
457
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
462
458
|
readonly tx_result: v.ObjectSchema<{
|
|
463
459
|
readonly hex: v.StringSchema<undefined>;
|
|
464
460
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -501,7 +497,7 @@ declare const resultSchema: v.ObjectSchema<{
|
|
|
501
497
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
502
498
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
503
499
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
504
|
-
readonly tx_status: v.
|
|
500
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
505
501
|
readonly tx_result: v.ObjectSchema<{
|
|
506
502
|
readonly hex: v.StringSchema<undefined>;
|
|
507
503
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -567,7 +563,7 @@ declare const resultsSchema$3: v.ArraySchema<v.ObjectSchema<{
|
|
|
567
563
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
568
564
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
569
565
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
570
|
-
readonly tx_status: v.
|
|
566
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
571
567
|
readonly tx_result: v.ObjectSchema<{
|
|
572
568
|
readonly hex: v.StringSchema<undefined>;
|
|
573
569
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -616,7 +612,7 @@ declare const resultsSchema$3: v.ArraySchema<v.ObjectSchema<{
|
|
|
616
612
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
617
613
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
618
614
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
619
|
-
readonly tx_status: v.
|
|
615
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
620
616
|
readonly tx_result: v.ObjectSchema<{
|
|
621
617
|
readonly hex: v.StringSchema<undefined>;
|
|
622
618
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -659,7 +655,7 @@ declare const resultsSchema$3: v.ArraySchema<v.ObjectSchema<{
|
|
|
659
655
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
660
656
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
661
657
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
662
|
-
readonly tx_status: v.
|
|
658
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
663
659
|
readonly tx_result: v.ObjectSchema<{
|
|
664
660
|
readonly hex: v.StringSchema<undefined>;
|
|
665
661
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -726,7 +722,7 @@ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
|
726
722
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
727
723
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
728
724
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
729
|
-
readonly tx_status: v.
|
|
725
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
730
726
|
readonly tx_result: v.ObjectSchema<{
|
|
731
727
|
readonly hex: v.StringSchema<undefined>;
|
|
732
728
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -775,7 +771,7 @@ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
|
775
771
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
776
772
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
777
773
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
778
|
-
readonly tx_status: v.
|
|
774
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
779
775
|
readonly tx_result: v.ObjectSchema<{
|
|
780
776
|
readonly hex: v.StringSchema<undefined>;
|
|
781
777
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -818,7 +814,7 @@ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
|
818
814
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
819
815
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
820
816
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
821
|
-
readonly tx_status: v.
|
|
817
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
822
818
|
readonly tx_result: v.ObjectSchema<{
|
|
823
819
|
readonly hex: v.StringSchema<undefined>;
|
|
824
820
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -865,7 +861,7 @@ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
|
865
861
|
readonly total: v.NumberSchema<undefined>;
|
|
866
862
|
}, undefined>;
|
|
867
863
|
type AddressTransactionsResponse = v.InferOutput<typeof addressTransactionsResponseSchema>;
|
|
868
|
-
declare function addressTransactions(args: Args$
|
|
864
|
+
declare function addressTransactions(args: Args$8): Promise<Result$1<AddressTransactionsResponse, SafeError<"FetchAddressTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
869
865
|
|
|
870
866
|
type addressTransactions$1_AddressTransactionsResponse = AddressTransactionsResponse;
|
|
871
867
|
type addressTransactions$1_Result = Result;
|
|
@@ -874,7 +870,7 @@ declare namespace addressTransactions$1 {
|
|
|
874
870
|
export { type addressTransactions$1_AddressTransactionsResponse as AddressTransactionsResponse, type addressTransactions$1_Result as Result, type Results$3 as Results, addressTransactions$1_addressTransactions as addressTransactions };
|
|
875
871
|
}
|
|
876
872
|
|
|
877
|
-
type Options$
|
|
873
|
+
type Options$2 = {
|
|
878
874
|
poolPrincipal: string;
|
|
879
875
|
afterBlock?: number;
|
|
880
876
|
unanchored?: boolean;
|
|
@@ -904,7 +900,7 @@ declare const membersResponseSchema: v.ObjectSchema<{
|
|
|
904
900
|
}, undefined>, undefined>;
|
|
905
901
|
}, undefined>;
|
|
906
902
|
type MembersResponse = v.InferOutput<typeof membersResponseSchema>;
|
|
907
|
-
declare function members(opts: Options$
|
|
903
|
+
declare function members(opts: Options$2, apiOpts: ApiRequestOptions): Promise<Result$1<MembersResponse>>;
|
|
908
904
|
|
|
909
905
|
type members$1_Member = Member;
|
|
910
906
|
type members$1_MembersResponse = MembersResponse;
|
|
@@ -912,16 +908,16 @@ declare const members$1_memberSchema: typeof memberSchema;
|
|
|
912
908
|
declare const members$1_members: typeof members;
|
|
913
909
|
declare const members$1_membersResponseSchema: typeof membersResponseSchema;
|
|
914
910
|
declare namespace members$1 {
|
|
915
|
-
export { type members$1_Member as Member, type members$1_MembersResponse as MembersResponse, type Options$
|
|
911
|
+
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
912
|
}
|
|
917
913
|
|
|
918
|
-
type
|
|
914
|
+
type Options$1 = {
|
|
919
915
|
sender: string;
|
|
920
916
|
arguments: string[];
|
|
921
917
|
contractAddress: string;
|
|
922
918
|
contractName: string;
|
|
923
919
|
functionName: string;
|
|
924
|
-
}
|
|
920
|
+
};
|
|
925
921
|
declare const readOnlyResponseSchema: v.VariantSchema<"okay", [v.ObjectSchema<{
|
|
926
922
|
readonly okay: v.LiteralSchema<true, undefined>;
|
|
927
923
|
readonly result: v.StringSchema<undefined>;
|
|
@@ -930,13 +926,13 @@ declare const readOnlyResponseSchema: v.VariantSchema<"okay", [v.ObjectSchema<{
|
|
|
930
926
|
readonly cause: v.UnknownSchema;
|
|
931
927
|
}, undefined>], undefined>;
|
|
932
928
|
type ReadOnlyResponse = v.InferOutput<typeof readOnlyResponseSchema>;
|
|
933
|
-
declare function readOnly(
|
|
929
|
+
declare function readOnly(opts: Options$1, apiOpts: ApiRequestOptions): Promise<Result$1<ReadOnlyResponse>>;
|
|
934
930
|
|
|
935
931
|
type readOnly$1_ReadOnlyResponse = ReadOnlyResponse;
|
|
936
932
|
declare const readOnly$1_readOnly: typeof readOnly;
|
|
937
933
|
declare const readOnly$1_readOnlyResponseSchema: typeof readOnlyResponseSchema;
|
|
938
934
|
declare namespace readOnly$1 {
|
|
939
|
-
export { type
|
|
935
|
+
export { type Options$1 as Options, type readOnly$1_ReadOnlyResponse as ReadOnlyResponse, readOnly$1_readOnly as readOnly, readOnly$1_readOnlyResponseSchema as readOnlyResponseSchema };
|
|
940
936
|
}
|
|
941
937
|
|
|
942
938
|
type Args$7 = {
|
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 = {
|
|
@@ -56,7 +52,7 @@ declare const baseTransactionSchema: v.ObjectSchema<{
|
|
|
56
52
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
57
53
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
58
54
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
59
|
-
readonly tx_status: v.
|
|
55
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
60
56
|
readonly tx_result: v.ObjectSchema<{
|
|
61
57
|
readonly hex: v.StringSchema<undefined>;
|
|
62
58
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -94,7 +90,7 @@ declare const contractCallTransactionSchema: v.ObjectSchema<{
|
|
|
94
90
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
95
91
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
96
92
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
97
|
-
readonly tx_status: v.
|
|
93
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
98
94
|
readonly tx_result: v.ObjectSchema<{
|
|
99
95
|
readonly hex: v.StringSchema<undefined>;
|
|
100
96
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -145,7 +141,7 @@ declare const smartContractTransactionSchema: v.ObjectSchema<{
|
|
|
145
141
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
146
142
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
147
143
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
148
|
-
readonly tx_status: v.
|
|
144
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
149
145
|
readonly tx_result: v.ObjectSchema<{
|
|
150
146
|
readonly hex: v.StringSchema<undefined>;
|
|
151
147
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -194,7 +190,7 @@ declare const tokenTransferSchema: v.ObjectSchema<{
|
|
|
194
190
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
195
191
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
196
192
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
197
|
-
readonly tx_status: v.
|
|
193
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
198
194
|
readonly tx_result: v.ObjectSchema<{
|
|
199
195
|
readonly hex: v.StringSchema<undefined>;
|
|
200
196
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -241,7 +237,7 @@ declare const transactionSchema: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
|
241
237
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
242
238
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
243
239
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
244
|
-
readonly tx_status: v.
|
|
240
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
245
241
|
readonly tx_result: v.ObjectSchema<{
|
|
246
242
|
readonly hex: v.StringSchema<undefined>;
|
|
247
243
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -290,7 +286,7 @@ declare const transactionSchema: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
|
290
286
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
291
287
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
292
288
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
293
|
-
readonly tx_status: v.
|
|
289
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
294
290
|
readonly tx_result: v.ObjectSchema<{
|
|
295
291
|
readonly hex: v.StringSchema<undefined>;
|
|
296
292
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -337,7 +333,7 @@ declare const transactionSchema: v.VariantSchema<"tx_type", [v.ObjectSchema<{
|
|
|
337
333
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
338
334
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
339
335
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
340
|
-
readonly tx_status: v.
|
|
336
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
341
337
|
readonly tx_result: v.ObjectSchema<{
|
|
342
338
|
readonly hex: v.StringSchema<undefined>;
|
|
343
339
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -373,17 +369,17 @@ declare namespace schemas {
|
|
|
373
369
|
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
370
|
}
|
|
375
371
|
|
|
376
|
-
type Args$
|
|
372
|
+
type Args$9 = {
|
|
377
373
|
transactionId: string;
|
|
378
374
|
} & ApiRequestOptions;
|
|
379
|
-
declare function getTransaction(args: Args$
|
|
375
|
+
declare function getTransaction(args: Args$9): Promise<Result$1<Transaction>>;
|
|
380
376
|
|
|
381
377
|
declare const getTransaction$1_getTransaction: typeof getTransaction;
|
|
382
378
|
declare namespace getTransaction$1 {
|
|
383
379
|
export { getTransaction$1_getTransaction as getTransaction };
|
|
384
380
|
}
|
|
385
381
|
|
|
386
|
-
type Args$
|
|
382
|
+
type Args$8 = {
|
|
387
383
|
address: string;
|
|
388
384
|
} & ApiRequestOptions & ApiPaginationOptions;
|
|
389
385
|
declare const resultSchema: v.ObjectSchema<{
|
|
@@ -409,7 +405,7 @@ declare const resultSchema: v.ObjectSchema<{
|
|
|
409
405
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
410
406
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
411
407
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
412
|
-
readonly tx_status: v.
|
|
408
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
413
409
|
readonly tx_result: v.ObjectSchema<{
|
|
414
410
|
readonly hex: v.StringSchema<undefined>;
|
|
415
411
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -458,7 +454,7 @@ declare const resultSchema: v.ObjectSchema<{
|
|
|
458
454
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
459
455
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
460
456
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
461
|
-
readonly tx_status: v.
|
|
457
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
462
458
|
readonly tx_result: v.ObjectSchema<{
|
|
463
459
|
readonly hex: v.StringSchema<undefined>;
|
|
464
460
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -501,7 +497,7 @@ declare const resultSchema: v.ObjectSchema<{
|
|
|
501
497
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
502
498
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
503
499
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
504
|
-
readonly tx_status: v.
|
|
500
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
505
501
|
readonly tx_result: v.ObjectSchema<{
|
|
506
502
|
readonly hex: v.StringSchema<undefined>;
|
|
507
503
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -567,7 +563,7 @@ declare const resultsSchema$3: v.ArraySchema<v.ObjectSchema<{
|
|
|
567
563
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
568
564
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
569
565
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
570
|
-
readonly tx_status: v.
|
|
566
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
571
567
|
readonly tx_result: v.ObjectSchema<{
|
|
572
568
|
readonly hex: v.StringSchema<undefined>;
|
|
573
569
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -616,7 +612,7 @@ declare const resultsSchema$3: v.ArraySchema<v.ObjectSchema<{
|
|
|
616
612
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
617
613
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
618
614
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
619
|
-
readonly tx_status: v.
|
|
615
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
620
616
|
readonly tx_result: v.ObjectSchema<{
|
|
621
617
|
readonly hex: v.StringSchema<undefined>;
|
|
622
618
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -659,7 +655,7 @@ declare const resultsSchema$3: v.ArraySchema<v.ObjectSchema<{
|
|
|
659
655
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
660
656
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
661
657
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
662
|
-
readonly tx_status: v.
|
|
658
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
663
659
|
readonly tx_result: v.ObjectSchema<{
|
|
664
660
|
readonly hex: v.StringSchema<undefined>;
|
|
665
661
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -726,7 +722,7 @@ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
|
726
722
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
727
723
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
728
724
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
729
|
-
readonly tx_status: v.
|
|
725
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
730
726
|
readonly tx_result: v.ObjectSchema<{
|
|
731
727
|
readonly hex: v.StringSchema<undefined>;
|
|
732
728
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -775,7 +771,7 @@ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
|
775
771
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
776
772
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
777
773
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
778
|
-
readonly tx_status: v.
|
|
774
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
779
775
|
readonly tx_result: v.ObjectSchema<{
|
|
780
776
|
readonly hex: v.StringSchema<undefined>;
|
|
781
777
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -818,7 +814,7 @@ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
|
818
814
|
readonly parent_burn_block_time_iso: v.StringSchema<undefined>;
|
|
819
815
|
readonly canonical: v.BooleanSchema<undefined>;
|
|
820
816
|
readonly tx_index: v.NumberSchema<undefined>;
|
|
821
|
-
readonly tx_status: v.
|
|
817
|
+
readonly tx_status: v.StringSchema<undefined>;
|
|
822
818
|
readonly tx_result: v.ObjectSchema<{
|
|
823
819
|
readonly hex: v.StringSchema<undefined>;
|
|
824
820
|
readonly repr: v.StringSchema<undefined>;
|
|
@@ -865,7 +861,7 @@ declare const addressTransactionsResponseSchema: v.ObjectSchema<{
|
|
|
865
861
|
readonly total: v.NumberSchema<undefined>;
|
|
866
862
|
}, undefined>;
|
|
867
863
|
type AddressTransactionsResponse = v.InferOutput<typeof addressTransactionsResponseSchema>;
|
|
868
|
-
declare function addressTransactions(args: Args$
|
|
864
|
+
declare function addressTransactions(args: Args$8): Promise<Result$1<AddressTransactionsResponse, SafeError<"FetchAddressTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
869
865
|
|
|
870
866
|
type addressTransactions$1_AddressTransactionsResponse = AddressTransactionsResponse;
|
|
871
867
|
type addressTransactions$1_Result = Result;
|
|
@@ -874,7 +870,7 @@ declare namespace addressTransactions$1 {
|
|
|
874
870
|
export { type addressTransactions$1_AddressTransactionsResponse as AddressTransactionsResponse, type addressTransactions$1_Result as Result, type Results$3 as Results, addressTransactions$1_addressTransactions as addressTransactions };
|
|
875
871
|
}
|
|
876
872
|
|
|
877
|
-
type Options$
|
|
873
|
+
type Options$2 = {
|
|
878
874
|
poolPrincipal: string;
|
|
879
875
|
afterBlock?: number;
|
|
880
876
|
unanchored?: boolean;
|
|
@@ -904,7 +900,7 @@ declare const membersResponseSchema: v.ObjectSchema<{
|
|
|
904
900
|
}, undefined>, undefined>;
|
|
905
901
|
}, undefined>;
|
|
906
902
|
type MembersResponse = v.InferOutput<typeof membersResponseSchema>;
|
|
907
|
-
declare function members(opts: Options$
|
|
903
|
+
declare function members(opts: Options$2, apiOpts: ApiRequestOptions): Promise<Result$1<MembersResponse>>;
|
|
908
904
|
|
|
909
905
|
type members$1_Member = Member;
|
|
910
906
|
type members$1_MembersResponse = MembersResponse;
|
|
@@ -912,16 +908,16 @@ declare const members$1_memberSchema: typeof memberSchema;
|
|
|
912
908
|
declare const members$1_members: typeof members;
|
|
913
909
|
declare const members$1_membersResponseSchema: typeof membersResponseSchema;
|
|
914
910
|
declare namespace members$1 {
|
|
915
|
-
export { type members$1_Member as Member, type members$1_MembersResponse as MembersResponse, type Options$
|
|
911
|
+
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
912
|
}
|
|
917
913
|
|
|
918
|
-
type
|
|
914
|
+
type Options$1 = {
|
|
919
915
|
sender: string;
|
|
920
916
|
arguments: string[];
|
|
921
917
|
contractAddress: string;
|
|
922
918
|
contractName: string;
|
|
923
919
|
functionName: string;
|
|
924
|
-
}
|
|
920
|
+
};
|
|
925
921
|
declare const readOnlyResponseSchema: v.VariantSchema<"okay", [v.ObjectSchema<{
|
|
926
922
|
readonly okay: v.LiteralSchema<true, undefined>;
|
|
927
923
|
readonly result: v.StringSchema<undefined>;
|
|
@@ -930,13 +926,13 @@ declare const readOnlyResponseSchema: v.VariantSchema<"okay", [v.ObjectSchema<{
|
|
|
930
926
|
readonly cause: v.UnknownSchema;
|
|
931
927
|
}, undefined>], undefined>;
|
|
932
928
|
type ReadOnlyResponse = v.InferOutput<typeof readOnlyResponseSchema>;
|
|
933
|
-
declare function readOnly(
|
|
929
|
+
declare function readOnly(opts: Options$1, apiOpts: ApiRequestOptions): Promise<Result$1<ReadOnlyResponse>>;
|
|
934
930
|
|
|
935
931
|
type readOnly$1_ReadOnlyResponse = ReadOnlyResponse;
|
|
936
932
|
declare const readOnly$1_readOnly: typeof readOnly;
|
|
937
933
|
declare const readOnly$1_readOnlyResponseSchema: typeof readOnlyResponseSchema;
|
|
938
934
|
declare namespace readOnly$1 {
|
|
939
|
-
export { type
|
|
935
|
+
export { type Options$1 as Options, type readOnly$1_ReadOnlyResponse as ReadOnlyResponse, readOnly$1_readOnly as readOnly, readOnly$1_readOnlyResponseSchema as readOnlyResponseSchema };
|
|
940
936
|
}
|
|
941
937
|
|
|
942
938
|
type Args$7 = {
|
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()
|