@secretkeylabs/stacks-tools 0.7.0-3be878c → 0.7.0-61add66
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 +43 -0
- package/dist/index.d.cts +167 -97
- package/dist/index.d.ts +167 -97
- package/dist/index.js +43 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1131,8 +1131,51 @@ var pox = {
|
|
|
1131
1131
|
poxDetails
|
|
1132
1132
|
};
|
|
1133
1133
|
|
|
1134
|
+
// src/stacks-rpc-api/accounts/info.ts
|
|
1135
|
+
var info2 = async (args) => {
|
|
1136
|
+
const search = new URLSearchParams();
|
|
1137
|
+
if (args.proof === 0) search.append("proof", "0");
|
|
1138
|
+
if (args.tip) search.append("tip", args.tip);
|
|
1139
|
+
const init = {};
|
|
1140
|
+
if (args.apiKeyConfig) {
|
|
1141
|
+
init.headers = {
|
|
1142
|
+
[args.apiKeyConfig.header]: args.apiKeyConfig.key
|
|
1143
|
+
};
|
|
1144
|
+
}
|
|
1145
|
+
init.method = "GET";
|
|
1146
|
+
const endpoint = `${args.baseUrl}/v2/accounts/${args.principal}?${search}`;
|
|
1147
|
+
const res = await fetch(endpoint, init);
|
|
1148
|
+
if (!res.ok)
|
|
1149
|
+
return error({
|
|
1150
|
+
name: "InfoFetchError",
|
|
1151
|
+
message: "Failed to fetch info.",
|
|
1152
|
+
data: {
|
|
1153
|
+
init,
|
|
1154
|
+
status: res.status,
|
|
1155
|
+
statusText: res.statusText,
|
|
1156
|
+
endpoint,
|
|
1157
|
+
body: await safeExtractResponseBody(res)
|
|
1158
|
+
}
|
|
1159
|
+
});
|
|
1160
|
+
const [jsonError, data] = await safePromise(res.json());
|
|
1161
|
+
if (jsonError) {
|
|
1162
|
+
return error({
|
|
1163
|
+
name: "ParseBodyError",
|
|
1164
|
+
message: "Failed to parse response body as JSON.",
|
|
1165
|
+
data: jsonError
|
|
1166
|
+
});
|
|
1167
|
+
}
|
|
1168
|
+
return success(data);
|
|
1169
|
+
};
|
|
1170
|
+
|
|
1171
|
+
// src/stacks-rpc-api/accounts/index.ts
|
|
1172
|
+
var accounts2 = {
|
|
1173
|
+
info: info2
|
|
1174
|
+
};
|
|
1175
|
+
|
|
1134
1176
|
// src/stacks-rpc-api/index.ts
|
|
1135
1177
|
var stacksRpcApi = {
|
|
1178
|
+
accounts: accounts2,
|
|
1136
1179
|
pox,
|
|
1137
1180
|
smartContracts
|
|
1138
1181
|
};
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OperationResponse
|
|
1
|
+
import { OperationResponse } from '@stacks/blockchain-api-client';
|
|
2
2
|
import * as v from 'valibot';
|
|
3
3
|
import { ClarityAbi, OptionalCV, TupleCV, BufferCV, UIntCV, PrincipalCV, ListCV } from '@stacks/transactions';
|
|
4
4
|
|
|
@@ -18,7 +18,7 @@ type ProofAndTip = {
|
|
|
18
18
|
/**
|
|
19
19
|
* Returns object without the proof field when set to 0.
|
|
20
20
|
*/
|
|
21
|
-
proof?:
|
|
21
|
+
proof?: 0 | 1;
|
|
22
22
|
tip?: "latest" | string;
|
|
23
23
|
};
|
|
24
24
|
type ApiPaginationOptions = {
|
|
@@ -31,12 +31,6 @@ type ApiPaginationOptions = {
|
|
|
31
31
|
limit?: number;
|
|
32
32
|
offset?: number;
|
|
33
33
|
};
|
|
34
|
-
type ListResponse<T = unknown> = {
|
|
35
|
-
limit: number;
|
|
36
|
-
offset: number;
|
|
37
|
-
total: number;
|
|
38
|
-
results: T[];
|
|
39
|
-
};
|
|
40
34
|
|
|
41
35
|
type SafeError<TName extends string = string, TData = unknown> = {
|
|
42
36
|
readonly name: TName;
|
|
@@ -61,18 +55,18 @@ declare function flatResults<T>(results: Array<Result$1<T>>): Result$1<Array<T>>
|
|
|
61
55
|
*/
|
|
62
56
|
declare function safeExtractResponseBody(response: Response): Promise<unknown>;
|
|
63
57
|
|
|
64
|
-
type Args$
|
|
58
|
+
type Args$n = {
|
|
65
59
|
transactionId: string;
|
|
66
60
|
} & ApiRequestOptions;
|
|
67
61
|
type Response$8 = OperationResponse["get_raw_transaction_by_id"];
|
|
68
|
-
declare function getRawTransaction(args: Args$
|
|
62
|
+
declare function getRawTransaction(args: Args$n): Promise<Result$1<Response$8>>;
|
|
69
63
|
|
|
70
64
|
declare const getRawTransaction$1_getRawTransaction: typeof getRawTransaction;
|
|
71
65
|
declare namespace getRawTransaction$1 {
|
|
72
|
-
export { type Args$
|
|
66
|
+
export { type Args$n as Args, type Response$8 as Response, getRawTransaction$1_getRawTransaction as getRawTransaction };
|
|
73
67
|
}
|
|
74
68
|
|
|
75
|
-
type Args$
|
|
69
|
+
type Args$m = {
|
|
76
70
|
/**
|
|
77
71
|
* Filter to only return transactions with this sender address.
|
|
78
72
|
*/
|
|
@@ -96,8 +90,8 @@ type Args$l = {
|
|
|
96
90
|
*/
|
|
97
91
|
order?: "asc" | "desc";
|
|
98
92
|
} & ApiRequestOptions & ApiPaginationOptions;
|
|
99
|
-
type MempoolTransactionsResponse =
|
|
100
|
-
declare function mempoolTransactions(args: Args$
|
|
93
|
+
type MempoolTransactionsResponse = OperationResponse["/extended/v1/tx/mempool"];
|
|
94
|
+
declare function mempoolTransactions(args: Args$m): Promise<Result$1<MempoolTransactionsResponse, SafeError<"FetchMempoolTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
101
95
|
|
|
102
96
|
type mempoolTransactions$1_MempoolTransactionsResponse = MempoolTransactionsResponse;
|
|
103
97
|
declare const mempoolTransactions$1_mempoolTransactions: typeof mempoolTransactions;
|
|
@@ -105,34 +99,34 @@ declare namespace mempoolTransactions$1 {
|
|
|
105
99
|
export { type mempoolTransactions$1_MempoolTransactionsResponse as MempoolTransactionsResponse, mempoolTransactions$1_mempoolTransactions as mempoolTransactions };
|
|
106
100
|
}
|
|
107
101
|
|
|
108
|
-
type Args$
|
|
102
|
+
type Args$l = {
|
|
109
103
|
transactionId: string;
|
|
110
104
|
} & ApiRequestOptions;
|
|
111
105
|
type Response$7 = OperationResponse["get_transaction_by_id"];
|
|
112
|
-
declare function getTransaction(args: Args$
|
|
106
|
+
declare function getTransaction(args: Args$l): Promise<Result$1<Response$7>>;
|
|
113
107
|
|
|
114
108
|
declare const getTransaction$1_getTransaction: typeof getTransaction;
|
|
115
109
|
declare namespace getTransaction$1 {
|
|
116
110
|
export { getTransaction$1_getTransaction as getTransaction };
|
|
117
111
|
}
|
|
118
112
|
|
|
119
|
-
type Args$
|
|
113
|
+
type Args$k = {
|
|
120
114
|
address: string;
|
|
121
115
|
transactionId: string;
|
|
122
116
|
} & ApiRequestOptions & ApiPaginationOptions;
|
|
123
117
|
type Response$6 = OperationResponse["/extended/v2/addresses/{address}/transactions/{tx_id}/events"];
|
|
124
|
-
declare function eventsForAnAddressTransaction(args: Args$
|
|
118
|
+
declare function eventsForAnAddressTransaction(args: Args$k): Promise<Result$1<Response$6>>;
|
|
125
119
|
|
|
126
120
|
declare const eventsForAnAddressTransaction$1_eventsForAnAddressTransaction: typeof eventsForAnAddressTransaction;
|
|
127
121
|
declare namespace eventsForAnAddressTransaction$1 {
|
|
128
122
|
export { eventsForAnAddressTransaction$1_eventsForAnAddressTransaction as eventsForAnAddressTransaction };
|
|
129
123
|
}
|
|
130
124
|
|
|
131
|
-
type Args$
|
|
125
|
+
type Args$j = {
|
|
132
126
|
address: string;
|
|
133
127
|
} & ApiRequestOptions & ApiPaginationOptions;
|
|
134
128
|
type Result = OperationResponse["/extended/v2/addresses/{address}/transactions"];
|
|
135
|
-
declare function addressTransactions(args: Args$
|
|
129
|
+
declare function addressTransactions(args: Args$j): Promise<Result$1<Result, SafeError<"FetchAddressTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
136
130
|
|
|
137
131
|
type addressTransactions$1_Result = Result;
|
|
138
132
|
declare const addressTransactions$1_addressTransactions: typeof addressTransactions;
|
|
@@ -140,7 +134,7 @@ declare namespace addressTransactions$1 {
|
|
|
140
134
|
export { type addressTransactions$1_Result as Result, addressTransactions$1_addressTransactions as addressTransactions };
|
|
141
135
|
}
|
|
142
136
|
|
|
143
|
-
type Args$
|
|
137
|
+
type Args$i = {
|
|
144
138
|
poolPrincipal: string;
|
|
145
139
|
afterBlock?: string | number | bigint;
|
|
146
140
|
unanchored?: boolean;
|
|
@@ -148,26 +142,26 @@ type Args$h = {
|
|
|
148
142
|
offset?: number;
|
|
149
143
|
} & ApiRequestOptions & ApiPaginationOptions;
|
|
150
144
|
type Response$5 = OperationResponse["get_pool_delegations"];
|
|
151
|
-
declare function members(args: Args$
|
|
145
|
+
declare function members(args: Args$i): Promise<Result$1<Response$5>>;
|
|
152
146
|
|
|
153
147
|
declare const members$1_members: typeof members;
|
|
154
148
|
declare namespace members$1 {
|
|
155
|
-
export { type Args$
|
|
149
|
+
export { type Args$i as Args, type Response$5 as Response, members$1_members as members };
|
|
156
150
|
}
|
|
157
151
|
|
|
158
|
-
type Args$
|
|
152
|
+
type Args$h = {
|
|
159
153
|
cycleNumber: string | number | bigint;
|
|
160
154
|
signerPublicKey: string;
|
|
161
155
|
} & ApiRequestOptions & ApiPaginationOptions;
|
|
162
156
|
type Response$4 = OperationResponse["get_pox_cycle_signer_stackers"];
|
|
163
|
-
declare function stackersForSignerInCycle(opts: Args$
|
|
157
|
+
declare function stackersForSignerInCycle(opts: Args$h): Promise<Result$1<Response$4, SafeError<"FetchStackersForSignerInCycleError" | "ParseBodyError">>>;
|
|
164
158
|
|
|
165
159
|
declare const stackersForSignerInCycle$1_stackersForSignerInCycle: typeof stackersForSignerInCycle;
|
|
166
160
|
declare namespace stackersForSignerInCycle$1 {
|
|
167
|
-
export { type Args$
|
|
161
|
+
export { type Args$h as Args, type Response$4 as Response, stackersForSignerInCycle$1_stackersForSignerInCycle as stackersForSignerInCycle };
|
|
168
162
|
}
|
|
169
163
|
|
|
170
|
-
type Args$
|
|
164
|
+
type Args$g = {
|
|
171
165
|
cycleNumber: number;
|
|
172
166
|
} & ApiRequestOptions & ApiPaginationOptions;
|
|
173
167
|
declare const signerSchema: v.ObjectSchema<{
|
|
@@ -208,7 +202,7 @@ declare const signersResponseSchema: v.ObjectSchema<{
|
|
|
208
202
|
readonly total: v.NumberSchema<undefined>;
|
|
209
203
|
}, undefined>;
|
|
210
204
|
type SignersResponse = v.InferOutput<typeof signersResponseSchema>;
|
|
211
|
-
declare function signersInCycle(args: Args$
|
|
205
|
+
declare function signersInCycle(args: Args$g): Promise<Result$1<SignersResponse, SafeError<"FetchSignersError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
212
206
|
|
|
213
207
|
type signersInCycle$1_Signer = Signer;
|
|
214
208
|
type signersInCycle$1_SignersResponse = SignersResponse;
|
|
@@ -216,10 +210,10 @@ declare const signersInCycle$1_signerSchema: typeof signerSchema;
|
|
|
216
210
|
declare const signersInCycle$1_signersInCycle: typeof signersInCycle;
|
|
217
211
|
declare const signersInCycle$1_signersResponseSchema: typeof signersResponseSchema;
|
|
218
212
|
declare namespace signersInCycle$1 {
|
|
219
|
-
export { type Args$
|
|
213
|
+
export { type Args$g as Args, type Results$1 as Results, type signersInCycle$1_Signer as Signer, type signersInCycle$1_SignersResponse as SignersResponse, resultsSchema$1 as resultsSchema, signersInCycle$1_signerSchema as signerSchema, signersInCycle$1_signersInCycle as signersInCycle, signersInCycle$1_signersResponseSchema as signersResponseSchema };
|
|
220
214
|
}
|
|
221
215
|
|
|
222
|
-
type Args$
|
|
216
|
+
type Args$f = {
|
|
223
217
|
/**
|
|
224
218
|
* The signers public key as a hex string, with or without a '0x' prefix.
|
|
225
219
|
*/
|
|
@@ -237,16 +231,16 @@ declare const signerInCycleResponseSchema: v.ObjectSchema<{
|
|
|
237
231
|
readonly pooled_stacker_count: v.NumberSchema<undefined>;
|
|
238
232
|
}, undefined>;
|
|
239
233
|
type SignerInCycleResponse = v.InferOutput<typeof signerInCycleResponseSchema>;
|
|
240
|
-
declare function signerInCycle(args: Args$
|
|
234
|
+
declare function signerInCycle(args: Args$f): Promise<Result$1<SignerInCycleResponse>>;
|
|
241
235
|
|
|
242
236
|
type signerInCycle$1_SignerInCycleResponse = SignerInCycleResponse;
|
|
243
237
|
declare const signerInCycle$1_signerInCycle: typeof signerInCycle;
|
|
244
238
|
declare const signerInCycle$1_signerInCycleResponseSchema: typeof signerInCycleResponseSchema;
|
|
245
239
|
declare namespace signerInCycle$1 {
|
|
246
|
-
export { type Args$
|
|
240
|
+
export { type Args$f as Args, type signerInCycle$1_SignerInCycleResponse as SignerInCycleResponse, signerInCycle$1_signerInCycle as signerInCycle, signerInCycle$1_signerInCycleResponseSchema as signerInCycleResponseSchema };
|
|
247
241
|
}
|
|
248
242
|
|
|
249
|
-
type Args$
|
|
243
|
+
type Args$e = ApiRequestOptions & ApiPaginationOptions;
|
|
250
244
|
declare const cycleInfoSchema: v.ObjectSchema<{
|
|
251
245
|
readonly block_height: v.NumberSchema<undefined>;
|
|
252
246
|
readonly index_block_hash: v.StringSchema<undefined>;
|
|
@@ -279,7 +273,7 @@ declare const cyclesResponseSchema: v.ObjectSchema<{
|
|
|
279
273
|
readonly total: v.NumberSchema<undefined>;
|
|
280
274
|
}, undefined>;
|
|
281
275
|
type CyclesResponse = v.InferOutput<typeof cyclesResponseSchema>;
|
|
282
|
-
declare function cycles(args: Args$
|
|
276
|
+
declare function cycles(args: Args$e): Promise<Result$1<CyclesResponse>>;
|
|
283
277
|
|
|
284
278
|
type cycles$1_CycleInfo = CycleInfo;
|
|
285
279
|
type cycles$1_CyclesResponse = CyclesResponse;
|
|
@@ -289,10 +283,10 @@ declare const cycles$1_cycles: typeof cycles;
|
|
|
289
283
|
declare const cycles$1_cyclesResponseSchema: typeof cyclesResponseSchema;
|
|
290
284
|
declare const cycles$1_resultsSchema: typeof resultsSchema;
|
|
291
285
|
declare namespace cycles$1 {
|
|
292
|
-
export { type Args$
|
|
286
|
+
export { type Args$e as Args, type cycles$1_CycleInfo as CycleInfo, type cycles$1_CyclesResponse as CyclesResponse, type cycles$1_Results as Results, cycles$1_cycleInfoSchema as cycleInfoSchema, cycles$1_cycles as cycles, cycles$1_cyclesResponseSchema as cyclesResponseSchema, cycles$1_resultsSchema as resultsSchema };
|
|
293
287
|
}
|
|
294
288
|
|
|
295
|
-
type Args$
|
|
289
|
+
type Args$d = {
|
|
296
290
|
cycleNumber: number;
|
|
297
291
|
} & ApiRequestOptions;
|
|
298
292
|
declare const responseSchema$2: v.ObjectSchema<{
|
|
@@ -304,11 +298,11 @@ declare const responseSchema$2: v.ObjectSchema<{
|
|
|
304
298
|
readonly total_signers: v.NumberSchema<undefined>;
|
|
305
299
|
}, undefined>;
|
|
306
300
|
type Response$3 = v.InferOutput<typeof responseSchema$2>;
|
|
307
|
-
declare function cycle(opts: Args$
|
|
301
|
+
declare function cycle(opts: Args$d): Promise<Result$1<Response$3, SafeError<"FetchCycleError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
308
302
|
|
|
309
303
|
declare const cycle$1_cycle: typeof cycle;
|
|
310
304
|
declare namespace cycle$1 {
|
|
311
|
-
export { type Args$
|
|
305
|
+
export { type Args$d as Args, type Response$3 as Response, cycle$1_cycle as cycle, responseSchema$2 as responseSchema };
|
|
312
306
|
}
|
|
313
307
|
|
|
314
308
|
type FeePrioritiesResponse = {
|
|
@@ -370,18 +364,18 @@ declare namespace coreApi$1 {
|
|
|
370
364
|
export { type coreApi$1_CoreApiResponse as CoreApiResponse, coreApi$1_coreApi as coreApi };
|
|
371
365
|
}
|
|
372
366
|
|
|
373
|
-
type Args$
|
|
367
|
+
type Args$c = {
|
|
374
368
|
address: string;
|
|
375
369
|
stacking?: boolean;
|
|
376
370
|
} & ApiRequestOptions;
|
|
377
|
-
declare function stx(opts: Args$
|
|
371
|
+
declare function stx(opts: Args$c): Promise<Result$1<any>>;
|
|
378
372
|
|
|
379
373
|
declare const stx$1_stx: typeof stx;
|
|
380
374
|
declare namespace stx$1 {
|
|
381
|
-
export { type Args$
|
|
375
|
+
export { type Args$c as Args, stx$1_stx as stx };
|
|
382
376
|
}
|
|
383
377
|
|
|
384
|
-
type Args$
|
|
378
|
+
type Args$b = {
|
|
385
379
|
heightOrHash: string | number;
|
|
386
380
|
} & ApiRequestOptions;
|
|
387
381
|
declare const responseSchema$1: v.ObjectSchema<{
|
|
@@ -406,14 +400,14 @@ declare const responseSchema$1: v.ObjectSchema<{
|
|
|
406
400
|
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
407
401
|
}, undefined>;
|
|
408
402
|
type Response$2 = v.InferOutput<typeof responseSchema$1>;
|
|
409
|
-
declare function getBlock(opts: Args$
|
|
403
|
+
declare function getBlock(opts: Args$b): Promise<Result$1<Response$2, SafeError<"FetchBlockError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
410
404
|
|
|
411
405
|
declare const getBlock$1_getBlock: typeof getBlock;
|
|
412
406
|
declare namespace getBlock$1 {
|
|
413
|
-
export { type Args$
|
|
407
|
+
export { type Args$b as Args, type Response$2 as Response, getBlock$1_getBlock as getBlock, responseSchema$1 as responseSchema };
|
|
414
408
|
}
|
|
415
409
|
|
|
416
|
-
type Args$
|
|
410
|
+
type Args$a = {
|
|
417
411
|
principal: string;
|
|
418
412
|
} & ApiRequestOptions;
|
|
419
413
|
declare const responseSchema: v.ObjectSchema<{
|
|
@@ -424,61 +418,59 @@ declare const responseSchema: v.ObjectSchema<{
|
|
|
424
418
|
readonly detected_mempool_nonces: v.ArraySchema<v.NumberSchema<undefined>, undefined>;
|
|
425
419
|
}, undefined>;
|
|
426
420
|
type Response$1 = v.InferOutput<typeof responseSchema>;
|
|
427
|
-
declare function latestNonce(opts: Args$
|
|
421
|
+
declare function latestNonce(opts: Args$a): Promise<Result$1<Response$1, SafeError<"FetchLatestNonceError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
428
422
|
|
|
429
423
|
declare const latestNonce$1_latestNonce: typeof latestNonce;
|
|
430
424
|
declare const latestNonce$1_responseSchema: typeof responseSchema;
|
|
431
425
|
declare namespace latestNonce$1 {
|
|
432
|
-
export { type Args$
|
|
426
|
+
export { type Args$a as Args, type Response$1 as Response, latestNonce$1_latestNonce as latestNonce, latestNonce$1_responseSchema as responseSchema };
|
|
433
427
|
}
|
|
434
428
|
|
|
435
|
-
type Args$
|
|
429
|
+
type Args$9 = {
|
|
436
430
|
principal: string;
|
|
437
431
|
unanchored?: boolean;
|
|
438
432
|
untilBlock?: number;
|
|
439
433
|
} & ApiRequestOptions;
|
|
440
|
-
declare function balances(opts: Args$
|
|
434
|
+
declare function balances(opts: Args$9): Promise<Result$1<OperationResponse["get_account_balance"], SafeError<"FetchBalancesError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
441
435
|
|
|
442
436
|
declare const balances$1_balances: typeof balances;
|
|
443
437
|
declare namespace balances$1 {
|
|
444
|
-
export { type Args$
|
|
438
|
+
export { type Args$9 as Args, balances$1_balances as balances };
|
|
445
439
|
}
|
|
446
440
|
|
|
447
|
-
declare const accounts: {
|
|
441
|
+
declare const accounts$1: {
|
|
448
442
|
balances: typeof balances;
|
|
449
443
|
latestNonce: typeof latestNonce;
|
|
450
444
|
};
|
|
451
445
|
|
|
452
|
-
declare
|
|
453
|
-
|
|
454
|
-
export { balances$1 as Balances, latestNonce$1 as LatestNonce, index$e_accounts as accounts };
|
|
446
|
+
declare namespace index$f {
|
|
447
|
+
export { balances$1 as Balances, latestNonce$1 as LatestNonce, accounts$1 as accounts };
|
|
455
448
|
}
|
|
456
449
|
|
|
457
450
|
declare const blocks: {
|
|
458
451
|
getBlock: typeof getBlock;
|
|
459
452
|
};
|
|
460
453
|
|
|
461
|
-
declare const index$
|
|
462
|
-
declare namespace index$
|
|
463
|
-
export { getBlock$1 as GetBlock, index$
|
|
454
|
+
declare const index$e_blocks: typeof blocks;
|
|
455
|
+
declare namespace index$e {
|
|
456
|
+
export { getBlock$1 as GetBlock, index$e_blocks as blocks };
|
|
464
457
|
}
|
|
465
458
|
|
|
466
459
|
declare const faucets: {
|
|
467
460
|
stx: typeof stx;
|
|
468
461
|
};
|
|
469
462
|
|
|
470
|
-
declare const index$
|
|
471
|
-
declare namespace index$
|
|
472
|
-
export { stx$1 as Stx, index$
|
|
463
|
+
declare const index$d_faucets: typeof faucets;
|
|
464
|
+
declare namespace index$d {
|
|
465
|
+
export { stx$1 as Stx, index$d_faucets as faucets };
|
|
473
466
|
}
|
|
474
467
|
|
|
475
|
-
declare const info: {
|
|
468
|
+
declare const info$2: {
|
|
476
469
|
coreApi: typeof coreApi;
|
|
477
470
|
};
|
|
478
471
|
|
|
479
|
-
declare
|
|
480
|
-
|
|
481
|
-
export { coreApi$1 as CoreApi, index$b_info as info };
|
|
472
|
+
declare namespace index$c {
|
|
473
|
+
export { coreApi$1 as CoreApi, info$2 as info };
|
|
482
474
|
}
|
|
483
475
|
|
|
484
476
|
declare const proofOfTransfer: {
|
|
@@ -489,18 +481,18 @@ declare const proofOfTransfer: {
|
|
|
489
481
|
stackersForSignerInCycle: typeof stackersForSignerInCycle;
|
|
490
482
|
};
|
|
491
483
|
|
|
492
|
-
declare const index$
|
|
493
|
-
declare namespace index$
|
|
494
|
-
export { cycle$1 as Cycle, cycles$1 as Cycles, signerInCycle$1 as SignerInCycle, signersInCycle$1 as SignersInCycle, stackersForSignerInCycle$1 as StackersForSignerInCycle, index$
|
|
484
|
+
declare const index$b_proofOfTransfer: typeof proofOfTransfer;
|
|
485
|
+
declare namespace index$b {
|
|
486
|
+
export { cycle$1 as Cycle, cycles$1 as Cycles, signerInCycle$1 as SignerInCycle, signersInCycle$1 as SignersInCycle, stackersForSignerInCycle$1 as StackersForSignerInCycle, index$b_proofOfTransfer as proofOfTransfer };
|
|
495
487
|
}
|
|
496
488
|
|
|
497
489
|
declare const stackingPool: {
|
|
498
490
|
members: typeof members;
|
|
499
491
|
};
|
|
500
492
|
|
|
501
|
-
declare const index$
|
|
502
|
-
declare namespace index$
|
|
503
|
-
export { members$1 as Members, index$
|
|
493
|
+
declare const index$a_stackingPool: typeof stackingPool;
|
|
494
|
+
declare namespace index$a {
|
|
495
|
+
export { members$1 as Members, index$a_stackingPool as stackingPool };
|
|
504
496
|
}
|
|
505
497
|
|
|
506
498
|
declare const transactions: {
|
|
@@ -511,18 +503,18 @@ declare const transactions: {
|
|
|
511
503
|
getRawTransaction: typeof getRawTransaction;
|
|
512
504
|
};
|
|
513
505
|
|
|
514
|
-
declare const index$
|
|
515
|
-
declare namespace index$
|
|
516
|
-
export { addressTransactions$1 as AddressTransactions, eventsForAnAddressTransaction$1 as EventsForAnAddressTransaction, getRawTransaction$1 as GetRawTransaction, getTransaction$1 as GetTransaction, mempoolTransactions$1 as MempoolTransactions, index$
|
|
506
|
+
declare const index$9_transactions: typeof transactions;
|
|
507
|
+
declare namespace index$9 {
|
|
508
|
+
export { addressTransactions$1 as AddressTransactions, eventsForAnAddressTransaction$1 as EventsForAnAddressTransaction, getRawTransaction$1 as GetRawTransaction, getTransaction$1 as GetTransaction, mempoolTransactions$1 as MempoolTransactions, index$9_transactions as transactions };
|
|
517
509
|
}
|
|
518
510
|
|
|
519
511
|
declare const mempool: {
|
|
520
512
|
transactionFeePriorities: typeof transactionFeePriorities;
|
|
521
513
|
};
|
|
522
514
|
|
|
523
|
-
declare const index$
|
|
524
|
-
declare namespace index$
|
|
525
|
-
export { transactionFeePriorities$1 as TransactionFeePriorities, index$
|
|
515
|
+
declare const index$8_mempool: typeof mempool;
|
|
516
|
+
declare namespace index$8 {
|
|
517
|
+
export { transactionFeePriorities$1 as TransactionFeePriorities, index$8_mempool as mempool };
|
|
526
518
|
}
|
|
527
519
|
|
|
528
520
|
declare const stacksApi: {
|
|
@@ -561,12 +553,12 @@ declare const stacksApi: {
|
|
|
561
553
|
};
|
|
562
554
|
};
|
|
563
555
|
|
|
564
|
-
declare const index$
|
|
565
|
-
declare namespace index$
|
|
566
|
-
export { index$
|
|
556
|
+
declare const index$7_stacksApi: typeof stacksApi;
|
|
557
|
+
declare namespace index$7 {
|
|
558
|
+
export { index$f as Accounts, index$e as Blocks, index$d as Faucets, index$c as Info, index$8 as Mempool, index$b as ProofOfTransfer, index$a as StackingPool, index$9 as Transactions, index$7_stacksApi as stacksApi };
|
|
567
559
|
}
|
|
568
560
|
|
|
569
|
-
type Args$
|
|
561
|
+
type Args$8 = {
|
|
570
562
|
sender: string;
|
|
571
563
|
arguments: string[];
|
|
572
564
|
contractAddress: string;
|
|
@@ -583,15 +575,15 @@ interface ReadOnlyContractCallFailResponse {
|
|
|
583
575
|
}
|
|
584
576
|
type ReadOnlyContractCallResponse = ReadOnlyContractCallSuccessResponse | ReadOnlyContractCallFailResponse;
|
|
585
577
|
type ReadOnlyResponse = ReadOnlyContractCallResponse;
|
|
586
|
-
declare function readOnly$1(args: Args$
|
|
578
|
+
declare function readOnly$1(args: Args$8): Promise<Result$1<ReadOnlyResponse>>;
|
|
587
579
|
|
|
588
580
|
type readOnly$2_ReadOnlyContractCallResponse = ReadOnlyContractCallResponse;
|
|
589
581
|
type readOnly$2_ReadOnlyResponse = ReadOnlyResponse;
|
|
590
582
|
declare namespace readOnly$2 {
|
|
591
|
-
export { type Args$
|
|
583
|
+
export { type Args$8 as Args, type readOnly$2_ReadOnlyContractCallResponse as ReadOnlyContractCallResponse, type readOnly$2_ReadOnlyResponse as ReadOnlyResponse, readOnly$1 as readOnly };
|
|
592
584
|
}
|
|
593
585
|
|
|
594
|
-
type Args$
|
|
586
|
+
type Args$7 = {
|
|
595
587
|
contractAddress: string;
|
|
596
588
|
contractName: string;
|
|
597
589
|
mapName: string;
|
|
@@ -611,28 +603,28 @@ declare const mapEntryResponseSchema: v.ObjectSchema<{
|
|
|
611
603
|
readonly proof: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
612
604
|
}, undefined>;
|
|
613
605
|
type MapEntryResponse = v.InferOutput<typeof mapEntryResponseSchema>;
|
|
614
|
-
declare function mapEntry(args: Args$
|
|
606
|
+
declare function mapEntry(args: Args$7): Promise<Result$1<MapEntryResponse>>;
|
|
615
607
|
|
|
616
608
|
type mapEntry$1_MapEntryResponse = MapEntryResponse;
|
|
617
609
|
declare const mapEntry$1_mapEntry: typeof mapEntry;
|
|
618
610
|
declare namespace mapEntry$1 {
|
|
619
|
-
export { type Args$
|
|
611
|
+
export { type Args$7 as Args, type mapEntry$1_MapEntryResponse as MapEntryResponse, mapEntry$1_mapEntry as mapEntry };
|
|
620
612
|
}
|
|
621
613
|
|
|
622
|
-
type Args$
|
|
614
|
+
type Args$6 = {
|
|
623
615
|
contractAddress: string;
|
|
624
616
|
contractName: string;
|
|
625
617
|
} & ApiRequestOptions & ProofAndTip;
|
|
626
618
|
type InterfaceResponse = ClarityAbi;
|
|
627
|
-
declare function contractInterface(args: Args$
|
|
619
|
+
declare function contractInterface(args: Args$6): Promise<Result$1<InterfaceResponse>>;
|
|
628
620
|
|
|
629
621
|
type _interface_InterfaceResponse = InterfaceResponse;
|
|
630
622
|
declare const _interface_contractInterface: typeof contractInterface;
|
|
631
623
|
declare namespace _interface {
|
|
632
|
-
export { type Args$
|
|
624
|
+
export { type Args$6 as Args, type _interface_InterfaceResponse as InterfaceResponse, _interface_contractInterface as contractInterface };
|
|
633
625
|
}
|
|
634
626
|
|
|
635
|
-
type Args$
|
|
627
|
+
type Args$5 = ApiRequestOptions;
|
|
636
628
|
/**
|
|
637
629
|
* Get Proof of Transfer (PoX) information
|
|
638
630
|
*/
|
|
@@ -777,7 +769,7 @@ interface CoreNodePoxResponse {
|
|
|
777
769
|
}[];
|
|
778
770
|
}
|
|
779
771
|
type PoxDetailsResponse = CoreNodePoxResponse;
|
|
780
|
-
declare function poxDetails(args: Args$
|
|
772
|
+
declare function poxDetails(args: Args$5): Promise<Result$1<PoxDetailsResponse>>;
|
|
781
773
|
|
|
782
774
|
type poxDetails$1_CoreNodePoxResponse = CoreNodePoxResponse;
|
|
783
775
|
type poxDetails$1_PoxDetailsResponse = PoxDetailsResponse;
|
|
@@ -786,27 +778,105 @@ declare namespace poxDetails$1 {
|
|
|
786
778
|
export { type poxDetails$1_CoreNodePoxResponse as CoreNodePoxResponse, type poxDetails$1_PoxDetailsResponse as PoxDetailsResponse, poxDetails$1_poxDetails as poxDetails };
|
|
787
779
|
}
|
|
788
780
|
|
|
781
|
+
type Args$4 = {
|
|
782
|
+
/** Stacks principal. */
|
|
783
|
+
principal: string;
|
|
784
|
+
} & ApiRequestOptions & ProofAndTip;
|
|
785
|
+
type InfoResponse = {
|
|
786
|
+
/** Micro-STX as a hex-encoded string. */
|
|
787
|
+
balance: string;
|
|
788
|
+
/** Micro-STX as a hex-encoded string. */
|
|
789
|
+
locked: string;
|
|
790
|
+
unlock_height: number;
|
|
791
|
+
nonce: number;
|
|
792
|
+
balance_proof: string;
|
|
793
|
+
nonce_proof: string;
|
|
794
|
+
};
|
|
795
|
+
type InfoReturn = Promise<InfoResponse>;
|
|
796
|
+
declare const info: (args: Args$4) => Promise<[null, unknown] | [{
|
|
797
|
+
readonly name: "InfoFetchError";
|
|
798
|
+
readonly message: "Failed to fetch info.";
|
|
799
|
+
readonly data: {
|
|
800
|
+
readonly init: RequestInit;
|
|
801
|
+
readonly status: number;
|
|
802
|
+
readonly statusText: string;
|
|
803
|
+
readonly endpoint: string;
|
|
804
|
+
readonly body: unknown;
|
|
805
|
+
};
|
|
806
|
+
}, null] | [{
|
|
807
|
+
readonly name: "ParseBodyError";
|
|
808
|
+
readonly message: "Failed to parse response body as JSON.";
|
|
809
|
+
readonly data: SafeError<"SafeError", unknown>;
|
|
810
|
+
}, null]>;
|
|
811
|
+
|
|
812
|
+
type info$1_InfoResponse = InfoResponse;
|
|
813
|
+
type info$1_InfoReturn = InfoReturn;
|
|
814
|
+
declare const info$1_info: typeof info;
|
|
815
|
+
declare namespace info$1 {
|
|
816
|
+
export { type Args$4 as Args, type info$1_InfoResponse as InfoResponse, type info$1_InfoReturn as InfoReturn, info$1_info as info };
|
|
817
|
+
}
|
|
818
|
+
|
|
789
819
|
declare const smartContracts: {
|
|
790
820
|
contractInterface: typeof contractInterface;
|
|
791
821
|
mapEntry: typeof mapEntry;
|
|
792
822
|
readOnly: typeof readOnly$1;
|
|
793
823
|
};
|
|
794
824
|
|
|
795
|
-
declare const index$
|
|
796
|
-
declare namespace index$
|
|
797
|
-
export { _interface as ContractInterface, mapEntry$1 as MapEntry, readOnly$2 as ReadOnly, index$
|
|
825
|
+
declare const index$6_smartContracts: typeof smartContracts;
|
|
826
|
+
declare namespace index$6 {
|
|
827
|
+
export { _interface as ContractInterface, mapEntry$1 as MapEntry, readOnly$2 as ReadOnly, index$6_smartContracts as smartContracts };
|
|
798
828
|
}
|
|
799
829
|
|
|
800
830
|
declare const pox: {
|
|
801
831
|
poxDetails: typeof poxDetails;
|
|
802
832
|
};
|
|
803
833
|
|
|
804
|
-
declare const index$
|
|
834
|
+
declare const index$5_pox: typeof pox;
|
|
835
|
+
declare namespace index$5 {
|
|
836
|
+
export { poxDetails$1 as PoxDetails, index$5_pox as pox };
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
declare const accounts: {
|
|
840
|
+
info: (args: Args$4) => Promise<[null, unknown] | [{
|
|
841
|
+
readonly name: "InfoFetchError";
|
|
842
|
+
readonly message: "Failed to fetch info.";
|
|
843
|
+
readonly data: {
|
|
844
|
+
readonly init: RequestInit;
|
|
845
|
+
readonly status: number;
|
|
846
|
+
readonly statusText: string;
|
|
847
|
+
readonly endpoint: string;
|
|
848
|
+
readonly body: unknown;
|
|
849
|
+
};
|
|
850
|
+
}, null] | [{
|
|
851
|
+
readonly name: "ParseBodyError";
|
|
852
|
+
readonly message: "Failed to parse response body as JSON.";
|
|
853
|
+
readonly data: SafeError<"SafeError", unknown>;
|
|
854
|
+
}, null]>;
|
|
855
|
+
};
|
|
856
|
+
|
|
857
|
+
declare const index$4_accounts: typeof accounts;
|
|
805
858
|
declare namespace index$4 {
|
|
806
|
-
export {
|
|
859
|
+
export { info$1 as Info, index$4_accounts as accounts };
|
|
807
860
|
}
|
|
808
861
|
|
|
809
862
|
declare const stacksRpcApi: {
|
|
863
|
+
accounts: {
|
|
864
|
+
info: (args: Args$4) => Promise<[null, unknown] | [{
|
|
865
|
+
readonly name: "InfoFetchError";
|
|
866
|
+
readonly message: "Failed to fetch info.";
|
|
867
|
+
readonly data: {
|
|
868
|
+
readonly init: RequestInit;
|
|
869
|
+
readonly status: number;
|
|
870
|
+
readonly statusText: string;
|
|
871
|
+
readonly endpoint: string;
|
|
872
|
+
readonly body: unknown;
|
|
873
|
+
};
|
|
874
|
+
}, null] | [{
|
|
875
|
+
readonly name: "ParseBodyError";
|
|
876
|
+
readonly message: "Failed to parse response body as JSON.";
|
|
877
|
+
readonly data: SafeError<"SafeError", unknown>;
|
|
878
|
+
}, null]>;
|
|
879
|
+
};
|
|
810
880
|
pox: {
|
|
811
881
|
poxDetails: typeof poxDetails;
|
|
812
882
|
};
|
|
@@ -819,7 +889,7 @@ declare const stacksRpcApi: {
|
|
|
819
889
|
|
|
820
890
|
declare const index$3_stacksRpcApi: typeof stacksRpcApi;
|
|
821
891
|
declare namespace index$3 {
|
|
822
|
-
export { index$4 as
|
|
892
|
+
export { index$4 as Accounts, index$5 as Pox, index$6 as SmartContracts, index$3_stacksRpcApi as stacksRpcApi };
|
|
823
893
|
}
|
|
824
894
|
|
|
825
895
|
type Identifier = {
|
|
@@ -958,4 +1028,4 @@ declare namespace index {
|
|
|
958
1028
|
export { index$2 as Maps, index$1 as ReadOnly, index_pox4Api as pox4Api };
|
|
959
1029
|
}
|
|
960
1030
|
|
|
961
|
-
export { index as Pox4Api, type Result$1 as Result, type SafeError, index$
|
|
1031
|
+
export { index as Pox4Api, type Result$1 as Result, type SafeError, index$7 as StacksApi, index$3 as StacksRpcApi, callRateLimitedApi, error, flatResults, pox4Api, queries, safeBackOff, safeCall, safeCallRateLimitedApi, safeExtractResponseBody, safePromise, stacksApi, stacksRpcApi, success };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OperationResponse
|
|
1
|
+
import { OperationResponse } from '@stacks/blockchain-api-client';
|
|
2
2
|
import * as v from 'valibot';
|
|
3
3
|
import { ClarityAbi, OptionalCV, TupleCV, BufferCV, UIntCV, PrincipalCV, ListCV } from '@stacks/transactions';
|
|
4
4
|
|
|
@@ -18,7 +18,7 @@ type ProofAndTip = {
|
|
|
18
18
|
/**
|
|
19
19
|
* Returns object without the proof field when set to 0.
|
|
20
20
|
*/
|
|
21
|
-
proof?:
|
|
21
|
+
proof?: 0 | 1;
|
|
22
22
|
tip?: "latest" | string;
|
|
23
23
|
};
|
|
24
24
|
type ApiPaginationOptions = {
|
|
@@ -31,12 +31,6 @@ type ApiPaginationOptions = {
|
|
|
31
31
|
limit?: number;
|
|
32
32
|
offset?: number;
|
|
33
33
|
};
|
|
34
|
-
type ListResponse<T = unknown> = {
|
|
35
|
-
limit: number;
|
|
36
|
-
offset: number;
|
|
37
|
-
total: number;
|
|
38
|
-
results: T[];
|
|
39
|
-
};
|
|
40
34
|
|
|
41
35
|
type SafeError<TName extends string = string, TData = unknown> = {
|
|
42
36
|
readonly name: TName;
|
|
@@ -61,18 +55,18 @@ declare function flatResults<T>(results: Array<Result$1<T>>): Result$1<Array<T>>
|
|
|
61
55
|
*/
|
|
62
56
|
declare function safeExtractResponseBody(response: Response): Promise<unknown>;
|
|
63
57
|
|
|
64
|
-
type Args$
|
|
58
|
+
type Args$n = {
|
|
65
59
|
transactionId: string;
|
|
66
60
|
} & ApiRequestOptions;
|
|
67
61
|
type Response$8 = OperationResponse["get_raw_transaction_by_id"];
|
|
68
|
-
declare function getRawTransaction(args: Args$
|
|
62
|
+
declare function getRawTransaction(args: Args$n): Promise<Result$1<Response$8>>;
|
|
69
63
|
|
|
70
64
|
declare const getRawTransaction$1_getRawTransaction: typeof getRawTransaction;
|
|
71
65
|
declare namespace getRawTransaction$1 {
|
|
72
|
-
export { type Args$
|
|
66
|
+
export { type Args$n as Args, type Response$8 as Response, getRawTransaction$1_getRawTransaction as getRawTransaction };
|
|
73
67
|
}
|
|
74
68
|
|
|
75
|
-
type Args$
|
|
69
|
+
type Args$m = {
|
|
76
70
|
/**
|
|
77
71
|
* Filter to only return transactions with this sender address.
|
|
78
72
|
*/
|
|
@@ -96,8 +90,8 @@ type Args$l = {
|
|
|
96
90
|
*/
|
|
97
91
|
order?: "asc" | "desc";
|
|
98
92
|
} & ApiRequestOptions & ApiPaginationOptions;
|
|
99
|
-
type MempoolTransactionsResponse =
|
|
100
|
-
declare function mempoolTransactions(args: Args$
|
|
93
|
+
type MempoolTransactionsResponse = OperationResponse["/extended/v1/tx/mempool"];
|
|
94
|
+
declare function mempoolTransactions(args: Args$m): Promise<Result$1<MempoolTransactionsResponse, SafeError<"FetchMempoolTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
101
95
|
|
|
102
96
|
type mempoolTransactions$1_MempoolTransactionsResponse = MempoolTransactionsResponse;
|
|
103
97
|
declare const mempoolTransactions$1_mempoolTransactions: typeof mempoolTransactions;
|
|
@@ -105,34 +99,34 @@ declare namespace mempoolTransactions$1 {
|
|
|
105
99
|
export { type mempoolTransactions$1_MempoolTransactionsResponse as MempoolTransactionsResponse, mempoolTransactions$1_mempoolTransactions as mempoolTransactions };
|
|
106
100
|
}
|
|
107
101
|
|
|
108
|
-
type Args$
|
|
102
|
+
type Args$l = {
|
|
109
103
|
transactionId: string;
|
|
110
104
|
} & ApiRequestOptions;
|
|
111
105
|
type Response$7 = OperationResponse["get_transaction_by_id"];
|
|
112
|
-
declare function getTransaction(args: Args$
|
|
106
|
+
declare function getTransaction(args: Args$l): Promise<Result$1<Response$7>>;
|
|
113
107
|
|
|
114
108
|
declare const getTransaction$1_getTransaction: typeof getTransaction;
|
|
115
109
|
declare namespace getTransaction$1 {
|
|
116
110
|
export { getTransaction$1_getTransaction as getTransaction };
|
|
117
111
|
}
|
|
118
112
|
|
|
119
|
-
type Args$
|
|
113
|
+
type Args$k = {
|
|
120
114
|
address: string;
|
|
121
115
|
transactionId: string;
|
|
122
116
|
} & ApiRequestOptions & ApiPaginationOptions;
|
|
123
117
|
type Response$6 = OperationResponse["/extended/v2/addresses/{address}/transactions/{tx_id}/events"];
|
|
124
|
-
declare function eventsForAnAddressTransaction(args: Args$
|
|
118
|
+
declare function eventsForAnAddressTransaction(args: Args$k): Promise<Result$1<Response$6>>;
|
|
125
119
|
|
|
126
120
|
declare const eventsForAnAddressTransaction$1_eventsForAnAddressTransaction: typeof eventsForAnAddressTransaction;
|
|
127
121
|
declare namespace eventsForAnAddressTransaction$1 {
|
|
128
122
|
export { eventsForAnAddressTransaction$1_eventsForAnAddressTransaction as eventsForAnAddressTransaction };
|
|
129
123
|
}
|
|
130
124
|
|
|
131
|
-
type Args$
|
|
125
|
+
type Args$j = {
|
|
132
126
|
address: string;
|
|
133
127
|
} & ApiRequestOptions & ApiPaginationOptions;
|
|
134
128
|
type Result = OperationResponse["/extended/v2/addresses/{address}/transactions"];
|
|
135
|
-
declare function addressTransactions(args: Args$
|
|
129
|
+
declare function addressTransactions(args: Args$j): Promise<Result$1<Result, SafeError<"FetchAddressTransactionsError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
136
130
|
|
|
137
131
|
type addressTransactions$1_Result = Result;
|
|
138
132
|
declare const addressTransactions$1_addressTransactions: typeof addressTransactions;
|
|
@@ -140,7 +134,7 @@ declare namespace addressTransactions$1 {
|
|
|
140
134
|
export { type addressTransactions$1_Result as Result, addressTransactions$1_addressTransactions as addressTransactions };
|
|
141
135
|
}
|
|
142
136
|
|
|
143
|
-
type Args$
|
|
137
|
+
type Args$i = {
|
|
144
138
|
poolPrincipal: string;
|
|
145
139
|
afterBlock?: string | number | bigint;
|
|
146
140
|
unanchored?: boolean;
|
|
@@ -148,26 +142,26 @@ type Args$h = {
|
|
|
148
142
|
offset?: number;
|
|
149
143
|
} & ApiRequestOptions & ApiPaginationOptions;
|
|
150
144
|
type Response$5 = OperationResponse["get_pool_delegations"];
|
|
151
|
-
declare function members(args: Args$
|
|
145
|
+
declare function members(args: Args$i): Promise<Result$1<Response$5>>;
|
|
152
146
|
|
|
153
147
|
declare const members$1_members: typeof members;
|
|
154
148
|
declare namespace members$1 {
|
|
155
|
-
export { type Args$
|
|
149
|
+
export { type Args$i as Args, type Response$5 as Response, members$1_members as members };
|
|
156
150
|
}
|
|
157
151
|
|
|
158
|
-
type Args$
|
|
152
|
+
type Args$h = {
|
|
159
153
|
cycleNumber: string | number | bigint;
|
|
160
154
|
signerPublicKey: string;
|
|
161
155
|
} & ApiRequestOptions & ApiPaginationOptions;
|
|
162
156
|
type Response$4 = OperationResponse["get_pox_cycle_signer_stackers"];
|
|
163
|
-
declare function stackersForSignerInCycle(opts: Args$
|
|
157
|
+
declare function stackersForSignerInCycle(opts: Args$h): Promise<Result$1<Response$4, SafeError<"FetchStackersForSignerInCycleError" | "ParseBodyError">>>;
|
|
164
158
|
|
|
165
159
|
declare const stackersForSignerInCycle$1_stackersForSignerInCycle: typeof stackersForSignerInCycle;
|
|
166
160
|
declare namespace stackersForSignerInCycle$1 {
|
|
167
|
-
export { type Args$
|
|
161
|
+
export { type Args$h as Args, type Response$4 as Response, stackersForSignerInCycle$1_stackersForSignerInCycle as stackersForSignerInCycle };
|
|
168
162
|
}
|
|
169
163
|
|
|
170
|
-
type Args$
|
|
164
|
+
type Args$g = {
|
|
171
165
|
cycleNumber: number;
|
|
172
166
|
} & ApiRequestOptions & ApiPaginationOptions;
|
|
173
167
|
declare const signerSchema: v.ObjectSchema<{
|
|
@@ -208,7 +202,7 @@ declare const signersResponseSchema: v.ObjectSchema<{
|
|
|
208
202
|
readonly total: v.NumberSchema<undefined>;
|
|
209
203
|
}, undefined>;
|
|
210
204
|
type SignersResponse = v.InferOutput<typeof signersResponseSchema>;
|
|
211
|
-
declare function signersInCycle(args: Args$
|
|
205
|
+
declare function signersInCycle(args: Args$g): Promise<Result$1<SignersResponse, SafeError<"FetchSignersError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
212
206
|
|
|
213
207
|
type signersInCycle$1_Signer = Signer;
|
|
214
208
|
type signersInCycle$1_SignersResponse = SignersResponse;
|
|
@@ -216,10 +210,10 @@ declare const signersInCycle$1_signerSchema: typeof signerSchema;
|
|
|
216
210
|
declare const signersInCycle$1_signersInCycle: typeof signersInCycle;
|
|
217
211
|
declare const signersInCycle$1_signersResponseSchema: typeof signersResponseSchema;
|
|
218
212
|
declare namespace signersInCycle$1 {
|
|
219
|
-
export { type Args$
|
|
213
|
+
export { type Args$g as Args, type Results$1 as Results, type signersInCycle$1_Signer as Signer, type signersInCycle$1_SignersResponse as SignersResponse, resultsSchema$1 as resultsSchema, signersInCycle$1_signerSchema as signerSchema, signersInCycle$1_signersInCycle as signersInCycle, signersInCycle$1_signersResponseSchema as signersResponseSchema };
|
|
220
214
|
}
|
|
221
215
|
|
|
222
|
-
type Args$
|
|
216
|
+
type Args$f = {
|
|
223
217
|
/**
|
|
224
218
|
* The signers public key as a hex string, with or without a '0x' prefix.
|
|
225
219
|
*/
|
|
@@ -237,16 +231,16 @@ declare const signerInCycleResponseSchema: v.ObjectSchema<{
|
|
|
237
231
|
readonly pooled_stacker_count: v.NumberSchema<undefined>;
|
|
238
232
|
}, undefined>;
|
|
239
233
|
type SignerInCycleResponse = v.InferOutput<typeof signerInCycleResponseSchema>;
|
|
240
|
-
declare function signerInCycle(args: Args$
|
|
234
|
+
declare function signerInCycle(args: Args$f): Promise<Result$1<SignerInCycleResponse>>;
|
|
241
235
|
|
|
242
236
|
type signerInCycle$1_SignerInCycleResponse = SignerInCycleResponse;
|
|
243
237
|
declare const signerInCycle$1_signerInCycle: typeof signerInCycle;
|
|
244
238
|
declare const signerInCycle$1_signerInCycleResponseSchema: typeof signerInCycleResponseSchema;
|
|
245
239
|
declare namespace signerInCycle$1 {
|
|
246
|
-
export { type Args$
|
|
240
|
+
export { type Args$f as Args, type signerInCycle$1_SignerInCycleResponse as SignerInCycleResponse, signerInCycle$1_signerInCycle as signerInCycle, signerInCycle$1_signerInCycleResponseSchema as signerInCycleResponseSchema };
|
|
247
241
|
}
|
|
248
242
|
|
|
249
|
-
type Args$
|
|
243
|
+
type Args$e = ApiRequestOptions & ApiPaginationOptions;
|
|
250
244
|
declare const cycleInfoSchema: v.ObjectSchema<{
|
|
251
245
|
readonly block_height: v.NumberSchema<undefined>;
|
|
252
246
|
readonly index_block_hash: v.StringSchema<undefined>;
|
|
@@ -279,7 +273,7 @@ declare const cyclesResponseSchema: v.ObjectSchema<{
|
|
|
279
273
|
readonly total: v.NumberSchema<undefined>;
|
|
280
274
|
}, undefined>;
|
|
281
275
|
type CyclesResponse = v.InferOutput<typeof cyclesResponseSchema>;
|
|
282
|
-
declare function cycles(args: Args$
|
|
276
|
+
declare function cycles(args: Args$e): Promise<Result$1<CyclesResponse>>;
|
|
283
277
|
|
|
284
278
|
type cycles$1_CycleInfo = CycleInfo;
|
|
285
279
|
type cycles$1_CyclesResponse = CyclesResponse;
|
|
@@ -289,10 +283,10 @@ declare const cycles$1_cycles: typeof cycles;
|
|
|
289
283
|
declare const cycles$1_cyclesResponseSchema: typeof cyclesResponseSchema;
|
|
290
284
|
declare const cycles$1_resultsSchema: typeof resultsSchema;
|
|
291
285
|
declare namespace cycles$1 {
|
|
292
|
-
export { type Args$
|
|
286
|
+
export { type Args$e as Args, type cycles$1_CycleInfo as CycleInfo, type cycles$1_CyclesResponse as CyclesResponse, type cycles$1_Results as Results, cycles$1_cycleInfoSchema as cycleInfoSchema, cycles$1_cycles as cycles, cycles$1_cyclesResponseSchema as cyclesResponseSchema, cycles$1_resultsSchema as resultsSchema };
|
|
293
287
|
}
|
|
294
288
|
|
|
295
|
-
type Args$
|
|
289
|
+
type Args$d = {
|
|
296
290
|
cycleNumber: number;
|
|
297
291
|
} & ApiRequestOptions;
|
|
298
292
|
declare const responseSchema$2: v.ObjectSchema<{
|
|
@@ -304,11 +298,11 @@ declare const responseSchema$2: v.ObjectSchema<{
|
|
|
304
298
|
readonly total_signers: v.NumberSchema<undefined>;
|
|
305
299
|
}, undefined>;
|
|
306
300
|
type Response$3 = v.InferOutput<typeof responseSchema$2>;
|
|
307
|
-
declare function cycle(opts: Args$
|
|
301
|
+
declare function cycle(opts: Args$d): Promise<Result$1<Response$3, SafeError<"FetchCycleError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
308
302
|
|
|
309
303
|
declare const cycle$1_cycle: typeof cycle;
|
|
310
304
|
declare namespace cycle$1 {
|
|
311
|
-
export { type Args$
|
|
305
|
+
export { type Args$d as Args, type Response$3 as Response, cycle$1_cycle as cycle, responseSchema$2 as responseSchema };
|
|
312
306
|
}
|
|
313
307
|
|
|
314
308
|
type FeePrioritiesResponse = {
|
|
@@ -370,18 +364,18 @@ declare namespace coreApi$1 {
|
|
|
370
364
|
export { type coreApi$1_CoreApiResponse as CoreApiResponse, coreApi$1_coreApi as coreApi };
|
|
371
365
|
}
|
|
372
366
|
|
|
373
|
-
type Args$
|
|
367
|
+
type Args$c = {
|
|
374
368
|
address: string;
|
|
375
369
|
stacking?: boolean;
|
|
376
370
|
} & ApiRequestOptions;
|
|
377
|
-
declare function stx(opts: Args$
|
|
371
|
+
declare function stx(opts: Args$c): Promise<Result$1<any>>;
|
|
378
372
|
|
|
379
373
|
declare const stx$1_stx: typeof stx;
|
|
380
374
|
declare namespace stx$1 {
|
|
381
|
-
export { type Args$
|
|
375
|
+
export { type Args$c as Args, stx$1_stx as stx };
|
|
382
376
|
}
|
|
383
377
|
|
|
384
|
-
type Args$
|
|
378
|
+
type Args$b = {
|
|
385
379
|
heightOrHash: string | number;
|
|
386
380
|
} & ApiRequestOptions;
|
|
387
381
|
declare const responseSchema$1: v.ObjectSchema<{
|
|
@@ -406,14 +400,14 @@ declare const responseSchema$1: v.ObjectSchema<{
|
|
|
406
400
|
readonly execution_cost_write_length: v.NumberSchema<undefined>;
|
|
407
401
|
}, undefined>;
|
|
408
402
|
type Response$2 = v.InferOutput<typeof responseSchema$1>;
|
|
409
|
-
declare function getBlock(opts: Args$
|
|
403
|
+
declare function getBlock(opts: Args$b): Promise<Result$1<Response$2, SafeError<"FetchBlockError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
410
404
|
|
|
411
405
|
declare const getBlock$1_getBlock: typeof getBlock;
|
|
412
406
|
declare namespace getBlock$1 {
|
|
413
|
-
export { type Args$
|
|
407
|
+
export { type Args$b as Args, type Response$2 as Response, getBlock$1_getBlock as getBlock, responseSchema$1 as responseSchema };
|
|
414
408
|
}
|
|
415
409
|
|
|
416
|
-
type Args$
|
|
410
|
+
type Args$a = {
|
|
417
411
|
principal: string;
|
|
418
412
|
} & ApiRequestOptions;
|
|
419
413
|
declare const responseSchema: v.ObjectSchema<{
|
|
@@ -424,61 +418,59 @@ declare const responseSchema: v.ObjectSchema<{
|
|
|
424
418
|
readonly detected_mempool_nonces: v.ArraySchema<v.NumberSchema<undefined>, undefined>;
|
|
425
419
|
}, undefined>;
|
|
426
420
|
type Response$1 = v.InferOutput<typeof responseSchema>;
|
|
427
|
-
declare function latestNonce(opts: Args$
|
|
421
|
+
declare function latestNonce(opts: Args$a): Promise<Result$1<Response$1, SafeError<"FetchLatestNonceError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
428
422
|
|
|
429
423
|
declare const latestNonce$1_latestNonce: typeof latestNonce;
|
|
430
424
|
declare const latestNonce$1_responseSchema: typeof responseSchema;
|
|
431
425
|
declare namespace latestNonce$1 {
|
|
432
|
-
export { type Args$
|
|
426
|
+
export { type Args$a as Args, type Response$1 as Response, latestNonce$1_latestNonce as latestNonce, latestNonce$1_responseSchema as responseSchema };
|
|
433
427
|
}
|
|
434
428
|
|
|
435
|
-
type Args$
|
|
429
|
+
type Args$9 = {
|
|
436
430
|
principal: string;
|
|
437
431
|
unanchored?: boolean;
|
|
438
432
|
untilBlock?: number;
|
|
439
433
|
} & ApiRequestOptions;
|
|
440
|
-
declare function balances(opts: Args$
|
|
434
|
+
declare function balances(opts: Args$9): Promise<Result$1<OperationResponse["get_account_balance"], SafeError<"FetchBalancesError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
441
435
|
|
|
442
436
|
declare const balances$1_balances: typeof balances;
|
|
443
437
|
declare namespace balances$1 {
|
|
444
|
-
export { type Args$
|
|
438
|
+
export { type Args$9 as Args, balances$1_balances as balances };
|
|
445
439
|
}
|
|
446
440
|
|
|
447
|
-
declare const accounts: {
|
|
441
|
+
declare const accounts$1: {
|
|
448
442
|
balances: typeof balances;
|
|
449
443
|
latestNonce: typeof latestNonce;
|
|
450
444
|
};
|
|
451
445
|
|
|
452
|
-
declare
|
|
453
|
-
|
|
454
|
-
export { balances$1 as Balances, latestNonce$1 as LatestNonce, index$e_accounts as accounts };
|
|
446
|
+
declare namespace index$f {
|
|
447
|
+
export { balances$1 as Balances, latestNonce$1 as LatestNonce, accounts$1 as accounts };
|
|
455
448
|
}
|
|
456
449
|
|
|
457
450
|
declare const blocks: {
|
|
458
451
|
getBlock: typeof getBlock;
|
|
459
452
|
};
|
|
460
453
|
|
|
461
|
-
declare const index$
|
|
462
|
-
declare namespace index$
|
|
463
|
-
export { getBlock$1 as GetBlock, index$
|
|
454
|
+
declare const index$e_blocks: typeof blocks;
|
|
455
|
+
declare namespace index$e {
|
|
456
|
+
export { getBlock$1 as GetBlock, index$e_blocks as blocks };
|
|
464
457
|
}
|
|
465
458
|
|
|
466
459
|
declare const faucets: {
|
|
467
460
|
stx: typeof stx;
|
|
468
461
|
};
|
|
469
462
|
|
|
470
|
-
declare const index$
|
|
471
|
-
declare namespace index$
|
|
472
|
-
export { stx$1 as Stx, index$
|
|
463
|
+
declare const index$d_faucets: typeof faucets;
|
|
464
|
+
declare namespace index$d {
|
|
465
|
+
export { stx$1 as Stx, index$d_faucets as faucets };
|
|
473
466
|
}
|
|
474
467
|
|
|
475
|
-
declare const info: {
|
|
468
|
+
declare const info$2: {
|
|
476
469
|
coreApi: typeof coreApi;
|
|
477
470
|
};
|
|
478
471
|
|
|
479
|
-
declare
|
|
480
|
-
|
|
481
|
-
export { coreApi$1 as CoreApi, index$b_info as info };
|
|
472
|
+
declare namespace index$c {
|
|
473
|
+
export { coreApi$1 as CoreApi, info$2 as info };
|
|
482
474
|
}
|
|
483
475
|
|
|
484
476
|
declare const proofOfTransfer: {
|
|
@@ -489,18 +481,18 @@ declare const proofOfTransfer: {
|
|
|
489
481
|
stackersForSignerInCycle: typeof stackersForSignerInCycle;
|
|
490
482
|
};
|
|
491
483
|
|
|
492
|
-
declare const index$
|
|
493
|
-
declare namespace index$
|
|
494
|
-
export { cycle$1 as Cycle, cycles$1 as Cycles, signerInCycle$1 as SignerInCycle, signersInCycle$1 as SignersInCycle, stackersForSignerInCycle$1 as StackersForSignerInCycle, index$
|
|
484
|
+
declare const index$b_proofOfTransfer: typeof proofOfTransfer;
|
|
485
|
+
declare namespace index$b {
|
|
486
|
+
export { cycle$1 as Cycle, cycles$1 as Cycles, signerInCycle$1 as SignerInCycle, signersInCycle$1 as SignersInCycle, stackersForSignerInCycle$1 as StackersForSignerInCycle, index$b_proofOfTransfer as proofOfTransfer };
|
|
495
487
|
}
|
|
496
488
|
|
|
497
489
|
declare const stackingPool: {
|
|
498
490
|
members: typeof members;
|
|
499
491
|
};
|
|
500
492
|
|
|
501
|
-
declare const index$
|
|
502
|
-
declare namespace index$
|
|
503
|
-
export { members$1 as Members, index$
|
|
493
|
+
declare const index$a_stackingPool: typeof stackingPool;
|
|
494
|
+
declare namespace index$a {
|
|
495
|
+
export { members$1 as Members, index$a_stackingPool as stackingPool };
|
|
504
496
|
}
|
|
505
497
|
|
|
506
498
|
declare const transactions: {
|
|
@@ -511,18 +503,18 @@ declare const transactions: {
|
|
|
511
503
|
getRawTransaction: typeof getRawTransaction;
|
|
512
504
|
};
|
|
513
505
|
|
|
514
|
-
declare const index$
|
|
515
|
-
declare namespace index$
|
|
516
|
-
export { addressTransactions$1 as AddressTransactions, eventsForAnAddressTransaction$1 as EventsForAnAddressTransaction, getRawTransaction$1 as GetRawTransaction, getTransaction$1 as GetTransaction, mempoolTransactions$1 as MempoolTransactions, index$
|
|
506
|
+
declare const index$9_transactions: typeof transactions;
|
|
507
|
+
declare namespace index$9 {
|
|
508
|
+
export { addressTransactions$1 as AddressTransactions, eventsForAnAddressTransaction$1 as EventsForAnAddressTransaction, getRawTransaction$1 as GetRawTransaction, getTransaction$1 as GetTransaction, mempoolTransactions$1 as MempoolTransactions, index$9_transactions as transactions };
|
|
517
509
|
}
|
|
518
510
|
|
|
519
511
|
declare const mempool: {
|
|
520
512
|
transactionFeePriorities: typeof transactionFeePriorities;
|
|
521
513
|
};
|
|
522
514
|
|
|
523
|
-
declare const index$
|
|
524
|
-
declare namespace index$
|
|
525
|
-
export { transactionFeePriorities$1 as TransactionFeePriorities, index$
|
|
515
|
+
declare const index$8_mempool: typeof mempool;
|
|
516
|
+
declare namespace index$8 {
|
|
517
|
+
export { transactionFeePriorities$1 as TransactionFeePriorities, index$8_mempool as mempool };
|
|
526
518
|
}
|
|
527
519
|
|
|
528
520
|
declare const stacksApi: {
|
|
@@ -561,12 +553,12 @@ declare const stacksApi: {
|
|
|
561
553
|
};
|
|
562
554
|
};
|
|
563
555
|
|
|
564
|
-
declare const index$
|
|
565
|
-
declare namespace index$
|
|
566
|
-
export { index$
|
|
556
|
+
declare const index$7_stacksApi: typeof stacksApi;
|
|
557
|
+
declare namespace index$7 {
|
|
558
|
+
export { index$f as Accounts, index$e as Blocks, index$d as Faucets, index$c as Info, index$8 as Mempool, index$b as ProofOfTransfer, index$a as StackingPool, index$9 as Transactions, index$7_stacksApi as stacksApi };
|
|
567
559
|
}
|
|
568
560
|
|
|
569
|
-
type Args$
|
|
561
|
+
type Args$8 = {
|
|
570
562
|
sender: string;
|
|
571
563
|
arguments: string[];
|
|
572
564
|
contractAddress: string;
|
|
@@ -583,15 +575,15 @@ interface ReadOnlyContractCallFailResponse {
|
|
|
583
575
|
}
|
|
584
576
|
type ReadOnlyContractCallResponse = ReadOnlyContractCallSuccessResponse | ReadOnlyContractCallFailResponse;
|
|
585
577
|
type ReadOnlyResponse = ReadOnlyContractCallResponse;
|
|
586
|
-
declare function readOnly$1(args: Args$
|
|
578
|
+
declare function readOnly$1(args: Args$8): Promise<Result$1<ReadOnlyResponse>>;
|
|
587
579
|
|
|
588
580
|
type readOnly$2_ReadOnlyContractCallResponse = ReadOnlyContractCallResponse;
|
|
589
581
|
type readOnly$2_ReadOnlyResponse = ReadOnlyResponse;
|
|
590
582
|
declare namespace readOnly$2 {
|
|
591
|
-
export { type Args$
|
|
583
|
+
export { type Args$8 as Args, type readOnly$2_ReadOnlyContractCallResponse as ReadOnlyContractCallResponse, type readOnly$2_ReadOnlyResponse as ReadOnlyResponse, readOnly$1 as readOnly };
|
|
592
584
|
}
|
|
593
585
|
|
|
594
|
-
type Args$
|
|
586
|
+
type Args$7 = {
|
|
595
587
|
contractAddress: string;
|
|
596
588
|
contractName: string;
|
|
597
589
|
mapName: string;
|
|
@@ -611,28 +603,28 @@ declare const mapEntryResponseSchema: v.ObjectSchema<{
|
|
|
611
603
|
readonly proof: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
612
604
|
}, undefined>;
|
|
613
605
|
type MapEntryResponse = v.InferOutput<typeof mapEntryResponseSchema>;
|
|
614
|
-
declare function mapEntry(args: Args$
|
|
606
|
+
declare function mapEntry(args: Args$7): Promise<Result$1<MapEntryResponse>>;
|
|
615
607
|
|
|
616
608
|
type mapEntry$1_MapEntryResponse = MapEntryResponse;
|
|
617
609
|
declare const mapEntry$1_mapEntry: typeof mapEntry;
|
|
618
610
|
declare namespace mapEntry$1 {
|
|
619
|
-
export { type Args$
|
|
611
|
+
export { type Args$7 as Args, type mapEntry$1_MapEntryResponse as MapEntryResponse, mapEntry$1_mapEntry as mapEntry };
|
|
620
612
|
}
|
|
621
613
|
|
|
622
|
-
type Args$
|
|
614
|
+
type Args$6 = {
|
|
623
615
|
contractAddress: string;
|
|
624
616
|
contractName: string;
|
|
625
617
|
} & ApiRequestOptions & ProofAndTip;
|
|
626
618
|
type InterfaceResponse = ClarityAbi;
|
|
627
|
-
declare function contractInterface(args: Args$
|
|
619
|
+
declare function contractInterface(args: Args$6): Promise<Result$1<InterfaceResponse>>;
|
|
628
620
|
|
|
629
621
|
type _interface_InterfaceResponse = InterfaceResponse;
|
|
630
622
|
declare const _interface_contractInterface: typeof contractInterface;
|
|
631
623
|
declare namespace _interface {
|
|
632
|
-
export { type Args$
|
|
624
|
+
export { type Args$6 as Args, type _interface_InterfaceResponse as InterfaceResponse, _interface_contractInterface as contractInterface };
|
|
633
625
|
}
|
|
634
626
|
|
|
635
|
-
type Args$
|
|
627
|
+
type Args$5 = ApiRequestOptions;
|
|
636
628
|
/**
|
|
637
629
|
* Get Proof of Transfer (PoX) information
|
|
638
630
|
*/
|
|
@@ -777,7 +769,7 @@ interface CoreNodePoxResponse {
|
|
|
777
769
|
}[];
|
|
778
770
|
}
|
|
779
771
|
type PoxDetailsResponse = CoreNodePoxResponse;
|
|
780
|
-
declare function poxDetails(args: Args$
|
|
772
|
+
declare function poxDetails(args: Args$5): Promise<Result$1<PoxDetailsResponse>>;
|
|
781
773
|
|
|
782
774
|
type poxDetails$1_CoreNodePoxResponse = CoreNodePoxResponse;
|
|
783
775
|
type poxDetails$1_PoxDetailsResponse = PoxDetailsResponse;
|
|
@@ -786,27 +778,105 @@ declare namespace poxDetails$1 {
|
|
|
786
778
|
export { type poxDetails$1_CoreNodePoxResponse as CoreNodePoxResponse, type poxDetails$1_PoxDetailsResponse as PoxDetailsResponse, poxDetails$1_poxDetails as poxDetails };
|
|
787
779
|
}
|
|
788
780
|
|
|
781
|
+
type Args$4 = {
|
|
782
|
+
/** Stacks principal. */
|
|
783
|
+
principal: string;
|
|
784
|
+
} & ApiRequestOptions & ProofAndTip;
|
|
785
|
+
type InfoResponse = {
|
|
786
|
+
/** Micro-STX as a hex-encoded string. */
|
|
787
|
+
balance: string;
|
|
788
|
+
/** Micro-STX as a hex-encoded string. */
|
|
789
|
+
locked: string;
|
|
790
|
+
unlock_height: number;
|
|
791
|
+
nonce: number;
|
|
792
|
+
balance_proof: string;
|
|
793
|
+
nonce_proof: string;
|
|
794
|
+
};
|
|
795
|
+
type InfoReturn = Promise<InfoResponse>;
|
|
796
|
+
declare const info: (args: Args$4) => Promise<[null, unknown] | [{
|
|
797
|
+
readonly name: "InfoFetchError";
|
|
798
|
+
readonly message: "Failed to fetch info.";
|
|
799
|
+
readonly data: {
|
|
800
|
+
readonly init: RequestInit;
|
|
801
|
+
readonly status: number;
|
|
802
|
+
readonly statusText: string;
|
|
803
|
+
readonly endpoint: string;
|
|
804
|
+
readonly body: unknown;
|
|
805
|
+
};
|
|
806
|
+
}, null] | [{
|
|
807
|
+
readonly name: "ParseBodyError";
|
|
808
|
+
readonly message: "Failed to parse response body as JSON.";
|
|
809
|
+
readonly data: SafeError<"SafeError", unknown>;
|
|
810
|
+
}, null]>;
|
|
811
|
+
|
|
812
|
+
type info$1_InfoResponse = InfoResponse;
|
|
813
|
+
type info$1_InfoReturn = InfoReturn;
|
|
814
|
+
declare const info$1_info: typeof info;
|
|
815
|
+
declare namespace info$1 {
|
|
816
|
+
export { type Args$4 as Args, type info$1_InfoResponse as InfoResponse, type info$1_InfoReturn as InfoReturn, info$1_info as info };
|
|
817
|
+
}
|
|
818
|
+
|
|
789
819
|
declare const smartContracts: {
|
|
790
820
|
contractInterface: typeof contractInterface;
|
|
791
821
|
mapEntry: typeof mapEntry;
|
|
792
822
|
readOnly: typeof readOnly$1;
|
|
793
823
|
};
|
|
794
824
|
|
|
795
|
-
declare const index$
|
|
796
|
-
declare namespace index$
|
|
797
|
-
export { _interface as ContractInterface, mapEntry$1 as MapEntry, readOnly$2 as ReadOnly, index$
|
|
825
|
+
declare const index$6_smartContracts: typeof smartContracts;
|
|
826
|
+
declare namespace index$6 {
|
|
827
|
+
export { _interface as ContractInterface, mapEntry$1 as MapEntry, readOnly$2 as ReadOnly, index$6_smartContracts as smartContracts };
|
|
798
828
|
}
|
|
799
829
|
|
|
800
830
|
declare const pox: {
|
|
801
831
|
poxDetails: typeof poxDetails;
|
|
802
832
|
};
|
|
803
833
|
|
|
804
|
-
declare const index$
|
|
834
|
+
declare const index$5_pox: typeof pox;
|
|
835
|
+
declare namespace index$5 {
|
|
836
|
+
export { poxDetails$1 as PoxDetails, index$5_pox as pox };
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
declare const accounts: {
|
|
840
|
+
info: (args: Args$4) => Promise<[null, unknown] | [{
|
|
841
|
+
readonly name: "InfoFetchError";
|
|
842
|
+
readonly message: "Failed to fetch info.";
|
|
843
|
+
readonly data: {
|
|
844
|
+
readonly init: RequestInit;
|
|
845
|
+
readonly status: number;
|
|
846
|
+
readonly statusText: string;
|
|
847
|
+
readonly endpoint: string;
|
|
848
|
+
readonly body: unknown;
|
|
849
|
+
};
|
|
850
|
+
}, null] | [{
|
|
851
|
+
readonly name: "ParseBodyError";
|
|
852
|
+
readonly message: "Failed to parse response body as JSON.";
|
|
853
|
+
readonly data: SafeError<"SafeError", unknown>;
|
|
854
|
+
}, null]>;
|
|
855
|
+
};
|
|
856
|
+
|
|
857
|
+
declare const index$4_accounts: typeof accounts;
|
|
805
858
|
declare namespace index$4 {
|
|
806
|
-
export {
|
|
859
|
+
export { info$1 as Info, index$4_accounts as accounts };
|
|
807
860
|
}
|
|
808
861
|
|
|
809
862
|
declare const stacksRpcApi: {
|
|
863
|
+
accounts: {
|
|
864
|
+
info: (args: Args$4) => Promise<[null, unknown] | [{
|
|
865
|
+
readonly name: "InfoFetchError";
|
|
866
|
+
readonly message: "Failed to fetch info.";
|
|
867
|
+
readonly data: {
|
|
868
|
+
readonly init: RequestInit;
|
|
869
|
+
readonly status: number;
|
|
870
|
+
readonly statusText: string;
|
|
871
|
+
readonly endpoint: string;
|
|
872
|
+
readonly body: unknown;
|
|
873
|
+
};
|
|
874
|
+
}, null] | [{
|
|
875
|
+
readonly name: "ParseBodyError";
|
|
876
|
+
readonly message: "Failed to parse response body as JSON.";
|
|
877
|
+
readonly data: SafeError<"SafeError", unknown>;
|
|
878
|
+
}, null]>;
|
|
879
|
+
};
|
|
810
880
|
pox: {
|
|
811
881
|
poxDetails: typeof poxDetails;
|
|
812
882
|
};
|
|
@@ -819,7 +889,7 @@ declare const stacksRpcApi: {
|
|
|
819
889
|
|
|
820
890
|
declare const index$3_stacksRpcApi: typeof stacksRpcApi;
|
|
821
891
|
declare namespace index$3 {
|
|
822
|
-
export { index$4 as
|
|
892
|
+
export { index$4 as Accounts, index$5 as Pox, index$6 as SmartContracts, index$3_stacksRpcApi as stacksRpcApi };
|
|
823
893
|
}
|
|
824
894
|
|
|
825
895
|
type Identifier = {
|
|
@@ -958,4 +1028,4 @@ declare namespace index {
|
|
|
958
1028
|
export { index$2 as Maps, index$1 as ReadOnly, index_pox4Api as pox4Api };
|
|
959
1029
|
}
|
|
960
1030
|
|
|
961
|
-
export { index as Pox4Api, type Result$1 as Result, type SafeError, index$
|
|
1031
|
+
export { index as Pox4Api, type Result$1 as Result, type SafeError, index$7 as StacksApi, index$3 as StacksRpcApi, callRateLimitedApi, error, flatResults, pox4Api, queries, safeBackOff, safeCall, safeCallRateLimitedApi, safeExtractResponseBody, safePromise, stacksApi, stacksRpcApi, success };
|
package/dist/index.js
CHANGED
|
@@ -1083,8 +1083,51 @@ var pox = {
|
|
|
1083
1083
|
poxDetails
|
|
1084
1084
|
};
|
|
1085
1085
|
|
|
1086
|
+
// src/stacks-rpc-api/accounts/info.ts
|
|
1087
|
+
var info2 = async (args) => {
|
|
1088
|
+
const search = new URLSearchParams();
|
|
1089
|
+
if (args.proof === 0) search.append("proof", "0");
|
|
1090
|
+
if (args.tip) search.append("tip", args.tip);
|
|
1091
|
+
const init = {};
|
|
1092
|
+
if (args.apiKeyConfig) {
|
|
1093
|
+
init.headers = {
|
|
1094
|
+
[args.apiKeyConfig.header]: args.apiKeyConfig.key
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
init.method = "GET";
|
|
1098
|
+
const endpoint = `${args.baseUrl}/v2/accounts/${args.principal}?${search}`;
|
|
1099
|
+
const res = await fetch(endpoint, init);
|
|
1100
|
+
if (!res.ok)
|
|
1101
|
+
return error({
|
|
1102
|
+
name: "InfoFetchError",
|
|
1103
|
+
message: "Failed to fetch info.",
|
|
1104
|
+
data: {
|
|
1105
|
+
init,
|
|
1106
|
+
status: res.status,
|
|
1107
|
+
statusText: res.statusText,
|
|
1108
|
+
endpoint,
|
|
1109
|
+
body: await safeExtractResponseBody(res)
|
|
1110
|
+
}
|
|
1111
|
+
});
|
|
1112
|
+
const [jsonError, data] = await safePromise(res.json());
|
|
1113
|
+
if (jsonError) {
|
|
1114
|
+
return error({
|
|
1115
|
+
name: "ParseBodyError",
|
|
1116
|
+
message: "Failed to parse response body as JSON.",
|
|
1117
|
+
data: jsonError
|
|
1118
|
+
});
|
|
1119
|
+
}
|
|
1120
|
+
return success(data);
|
|
1121
|
+
};
|
|
1122
|
+
|
|
1123
|
+
// src/stacks-rpc-api/accounts/index.ts
|
|
1124
|
+
var accounts2 = {
|
|
1125
|
+
info: info2
|
|
1126
|
+
};
|
|
1127
|
+
|
|
1086
1128
|
// src/stacks-rpc-api/index.ts
|
|
1087
1129
|
var stacksRpcApi = {
|
|
1130
|
+
accounts: accounts2,
|
|
1088
1131
|
pox,
|
|
1089
1132
|
smartContracts
|
|
1090
1133
|
};
|