@secretkeylabs/stacks-tools 0.5.0-eb736d6 → 0.6.0-33dafd2
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 +38 -0
- package/dist/index.d.cts +67 -21
- package/dist/index.d.ts +67 -21
- package/dist/index.js +38 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -958,12 +958,50 @@ var transactions = {
|
|
|
958
958
|
mempoolTransactions
|
|
959
959
|
};
|
|
960
960
|
|
|
961
|
+
// src/stacks-api/mempool/transaction-fee-priorities.ts
|
|
962
|
+
async function transactionFeePriorities(opts) {
|
|
963
|
+
const init = {};
|
|
964
|
+
if (opts.apiKeyConfig) {
|
|
965
|
+
init.headers = {
|
|
966
|
+
[opts.apiKeyConfig.header]: opts.apiKeyConfig.key
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
const endpoint = `${opts.baseUrl}/extended/v2/mempool/fees`;
|
|
970
|
+
const res = await fetch(endpoint, init);
|
|
971
|
+
if (!res.ok) {
|
|
972
|
+
return error({
|
|
973
|
+
name: "FetchFeePrioritiesError",
|
|
974
|
+
message: "Failed to fetch transaction fee priorities.",
|
|
975
|
+
data: {
|
|
976
|
+
status: res.status,
|
|
977
|
+
statusText: res.statusText,
|
|
978
|
+
bodyParseResult: await safePromise(res.text())
|
|
979
|
+
}
|
|
980
|
+
});
|
|
981
|
+
}
|
|
982
|
+
const [jsonError, data] = await safePromise(res.json());
|
|
983
|
+
if (jsonError) {
|
|
984
|
+
return error({
|
|
985
|
+
name: "ParseBodyError",
|
|
986
|
+
message: "Failed to parse response body as JSON.",
|
|
987
|
+
data: jsonError
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
return success(data);
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
// src/stacks-api/mempool/index.ts
|
|
994
|
+
var mempool = {
|
|
995
|
+
transactionFeePriorities
|
|
996
|
+
};
|
|
997
|
+
|
|
961
998
|
// src/stacks-api/index.ts
|
|
962
999
|
var stacksApi = {
|
|
963
1000
|
accounts,
|
|
964
1001
|
blocks,
|
|
965
1002
|
faucets,
|
|
966
1003
|
info,
|
|
1004
|
+
mempool,
|
|
967
1005
|
proofOfTransfer,
|
|
968
1006
|
stackingPool,
|
|
969
1007
|
transactions
|
package/dist/index.d.cts
CHANGED
|
@@ -1148,6 +1148,40 @@ declare namespace cycle$1 {
|
|
|
1148
1148
|
export { type Args$b as Args, type Response$2 as Response, cycle$1_cycle as cycle, responseSchema$2 as responseSchema };
|
|
1149
1149
|
}
|
|
1150
1150
|
|
|
1151
|
+
type FeePrioritiesResponse = {
|
|
1152
|
+
all: {
|
|
1153
|
+
no_priority: number;
|
|
1154
|
+
low_priority: number;
|
|
1155
|
+
medium_priority: number;
|
|
1156
|
+
high_priority: number;
|
|
1157
|
+
};
|
|
1158
|
+
token_transfer: {
|
|
1159
|
+
no_priority: number;
|
|
1160
|
+
low_priority: number;
|
|
1161
|
+
medium_priority: number;
|
|
1162
|
+
high_priority: number;
|
|
1163
|
+
};
|
|
1164
|
+
smart_contract: {
|
|
1165
|
+
no_priority: number;
|
|
1166
|
+
low_priority: number;
|
|
1167
|
+
medium_priority: number;
|
|
1168
|
+
high_priority: number;
|
|
1169
|
+
};
|
|
1170
|
+
contract_call: {
|
|
1171
|
+
no_priority: number;
|
|
1172
|
+
low_priority: number;
|
|
1173
|
+
medium_priority: number;
|
|
1174
|
+
high_priority: number;
|
|
1175
|
+
};
|
|
1176
|
+
};
|
|
1177
|
+
declare function transactionFeePriorities(opts: ApiRequestOptions): Promise<Result$1<FeePrioritiesResponse, SafeError<"FetchFeePrioritiesError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
1178
|
+
|
|
1179
|
+
type transactionFeePriorities$1_FeePrioritiesResponse = FeePrioritiesResponse;
|
|
1180
|
+
declare const transactionFeePriorities$1_transactionFeePriorities: typeof transactionFeePriorities;
|
|
1181
|
+
declare namespace transactionFeePriorities$1 {
|
|
1182
|
+
export { type transactionFeePriorities$1_FeePrioritiesResponse as FeePrioritiesResponse, transactionFeePriorities$1_transactionFeePriorities as transactionFeePriorities };
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1151
1185
|
declare const CoreApiResponseSchema: v.ObjectSchema<{
|
|
1152
1186
|
readonly peer_version: v.NumberSchema<undefined>;
|
|
1153
1187
|
readonly pox_consensus: v.StringSchema<undefined>;
|
|
@@ -1253,36 +1287,36 @@ declare const accounts: {
|
|
|
1253
1287
|
latestNonce: typeof latestNonce;
|
|
1254
1288
|
};
|
|
1255
1289
|
|
|
1256
|
-
declare const index$
|
|
1257
|
-
declare namespace index$
|
|
1258
|
-
export { balances$1 as Balances, latestNonce$1 as LatestNonce, index$
|
|
1290
|
+
declare const index$e_accounts: typeof accounts;
|
|
1291
|
+
declare namespace index$e {
|
|
1292
|
+
export { balances$1 as Balances, latestNonce$1 as LatestNonce, index$e_accounts as accounts };
|
|
1259
1293
|
}
|
|
1260
1294
|
|
|
1261
1295
|
declare const blocks: {
|
|
1262
1296
|
getBlock: typeof getBlock;
|
|
1263
1297
|
};
|
|
1264
1298
|
|
|
1265
|
-
declare const index$
|
|
1266
|
-
declare namespace index$
|
|
1267
|
-
export { getBlock$1 as GetBlock, index$
|
|
1299
|
+
declare const index$d_blocks: typeof blocks;
|
|
1300
|
+
declare namespace index$d {
|
|
1301
|
+
export { getBlock$1 as GetBlock, index$d_blocks as blocks };
|
|
1268
1302
|
}
|
|
1269
1303
|
|
|
1270
1304
|
declare const faucets: {
|
|
1271
1305
|
stx: typeof stx;
|
|
1272
1306
|
};
|
|
1273
1307
|
|
|
1274
|
-
declare const index$
|
|
1275
|
-
declare namespace index$
|
|
1276
|
-
export { stx$1 as Stx, index$
|
|
1308
|
+
declare const index$c_faucets: typeof faucets;
|
|
1309
|
+
declare namespace index$c {
|
|
1310
|
+
export { stx$1 as Stx, index$c_faucets as faucets };
|
|
1277
1311
|
}
|
|
1278
1312
|
|
|
1279
1313
|
declare const info: {
|
|
1280
1314
|
coreApi: typeof coreApi;
|
|
1281
1315
|
};
|
|
1282
1316
|
|
|
1283
|
-
declare const index$
|
|
1284
|
-
declare namespace index$
|
|
1285
|
-
export { coreApi$1 as CoreApi, index$
|
|
1317
|
+
declare const index$b_info: typeof info;
|
|
1318
|
+
declare namespace index$b {
|
|
1319
|
+
export { coreApi$1 as CoreApi, index$b_info as info };
|
|
1286
1320
|
}
|
|
1287
1321
|
|
|
1288
1322
|
declare const proofOfTransfer: {
|
|
@@ -1293,18 +1327,18 @@ declare const proofOfTransfer: {
|
|
|
1293
1327
|
stackersForSignerInCycle: typeof stackersForSignerInCycle;
|
|
1294
1328
|
};
|
|
1295
1329
|
|
|
1296
|
-
declare const index$
|
|
1297
|
-
declare namespace index$
|
|
1298
|
-
export { cycle$1 as Cycle, cycles$1 as Cycles, signerInCycle$1 as SignerInCycle, signersInCycle$1 as SignersInCycle, stackersForSignerInCycle$1 as StackersForSignerInCycle, index$
|
|
1330
|
+
declare const index$a_proofOfTransfer: typeof proofOfTransfer;
|
|
1331
|
+
declare namespace index$a {
|
|
1332
|
+
export { cycle$1 as Cycle, cycles$1 as Cycles, signerInCycle$1 as SignerInCycle, signersInCycle$1 as SignersInCycle, stackersForSignerInCycle$1 as StackersForSignerInCycle, index$a_proofOfTransfer as proofOfTransfer };
|
|
1299
1333
|
}
|
|
1300
1334
|
|
|
1301
1335
|
declare const stackingPool: {
|
|
1302
1336
|
members: typeof members;
|
|
1303
1337
|
};
|
|
1304
1338
|
|
|
1305
|
-
declare const index$
|
|
1306
|
-
declare namespace index$
|
|
1307
|
-
export { members$1 as Members, index$
|
|
1339
|
+
declare const index$9_stackingPool: typeof stackingPool;
|
|
1340
|
+
declare namespace index$9 {
|
|
1341
|
+
export { members$1 as Members, index$9_stackingPool as stackingPool };
|
|
1308
1342
|
}
|
|
1309
1343
|
|
|
1310
1344
|
declare const transactions: {
|
|
@@ -1313,9 +1347,18 @@ declare const transactions: {
|
|
|
1313
1347
|
mempoolTransactions: typeof mempoolTransactions;
|
|
1314
1348
|
};
|
|
1315
1349
|
|
|
1316
|
-
declare const index$
|
|
1350
|
+
declare const index$8_transactions: typeof transactions;
|
|
1351
|
+
declare namespace index$8 {
|
|
1352
|
+
export { addressTransactions$1 as AddressTransactions, schemas as Common, getTransaction$1 as GetTransaction, mempoolTransactions$1 as MempoolTransactions, index$8_transactions as transactions };
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
declare const mempool: {
|
|
1356
|
+
transactionFeePriorities: typeof transactionFeePriorities;
|
|
1357
|
+
};
|
|
1358
|
+
|
|
1359
|
+
declare const index$7_mempool: typeof mempool;
|
|
1317
1360
|
declare namespace index$7 {
|
|
1318
|
-
export {
|
|
1361
|
+
export { transactionFeePriorities$1 as TransactionFeePriorities, index$7_mempool as mempool };
|
|
1319
1362
|
}
|
|
1320
1363
|
|
|
1321
1364
|
declare const stacksApi: {
|
|
@@ -1332,6 +1375,9 @@ declare const stacksApi: {
|
|
|
1332
1375
|
info: {
|
|
1333
1376
|
coreApi: typeof coreApi;
|
|
1334
1377
|
};
|
|
1378
|
+
mempool: {
|
|
1379
|
+
transactionFeePriorities: typeof transactionFeePriorities;
|
|
1380
|
+
};
|
|
1335
1381
|
proofOfTransfer: {
|
|
1336
1382
|
cycle: typeof cycle;
|
|
1337
1383
|
cycles: typeof cycles;
|
|
@@ -1351,7 +1397,7 @@ declare const stacksApi: {
|
|
|
1351
1397
|
|
|
1352
1398
|
declare const index$6_stacksApi: typeof stacksApi;
|
|
1353
1399
|
declare namespace index$6 {
|
|
1354
|
-
export { index$
|
|
1400
|
+
export { index$e as Accounts, index$d as Blocks, index$c as Faucets, index$b as Info, index$7 as Mempool, index$a as ProofOfTransfer, index$9 as StackingPool, index$8 as Transactions, index$6_stacksApi as stacksApi };
|
|
1355
1401
|
}
|
|
1356
1402
|
|
|
1357
1403
|
type Args$6 = {
|
package/dist/index.d.ts
CHANGED
|
@@ -1148,6 +1148,40 @@ declare namespace cycle$1 {
|
|
|
1148
1148
|
export { type Args$b as Args, type Response$2 as Response, cycle$1_cycle as cycle, responseSchema$2 as responseSchema };
|
|
1149
1149
|
}
|
|
1150
1150
|
|
|
1151
|
+
type FeePrioritiesResponse = {
|
|
1152
|
+
all: {
|
|
1153
|
+
no_priority: number;
|
|
1154
|
+
low_priority: number;
|
|
1155
|
+
medium_priority: number;
|
|
1156
|
+
high_priority: number;
|
|
1157
|
+
};
|
|
1158
|
+
token_transfer: {
|
|
1159
|
+
no_priority: number;
|
|
1160
|
+
low_priority: number;
|
|
1161
|
+
medium_priority: number;
|
|
1162
|
+
high_priority: number;
|
|
1163
|
+
};
|
|
1164
|
+
smart_contract: {
|
|
1165
|
+
no_priority: number;
|
|
1166
|
+
low_priority: number;
|
|
1167
|
+
medium_priority: number;
|
|
1168
|
+
high_priority: number;
|
|
1169
|
+
};
|
|
1170
|
+
contract_call: {
|
|
1171
|
+
no_priority: number;
|
|
1172
|
+
low_priority: number;
|
|
1173
|
+
medium_priority: number;
|
|
1174
|
+
high_priority: number;
|
|
1175
|
+
};
|
|
1176
|
+
};
|
|
1177
|
+
declare function transactionFeePriorities(opts: ApiRequestOptions): Promise<Result$1<FeePrioritiesResponse, SafeError<"FetchFeePrioritiesError" | "ParseBodyError" | "ValidateDataError">>>;
|
|
1178
|
+
|
|
1179
|
+
type transactionFeePriorities$1_FeePrioritiesResponse = FeePrioritiesResponse;
|
|
1180
|
+
declare const transactionFeePriorities$1_transactionFeePriorities: typeof transactionFeePriorities;
|
|
1181
|
+
declare namespace transactionFeePriorities$1 {
|
|
1182
|
+
export { type transactionFeePriorities$1_FeePrioritiesResponse as FeePrioritiesResponse, transactionFeePriorities$1_transactionFeePriorities as transactionFeePriorities };
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1151
1185
|
declare const CoreApiResponseSchema: v.ObjectSchema<{
|
|
1152
1186
|
readonly peer_version: v.NumberSchema<undefined>;
|
|
1153
1187
|
readonly pox_consensus: v.StringSchema<undefined>;
|
|
@@ -1253,36 +1287,36 @@ declare const accounts: {
|
|
|
1253
1287
|
latestNonce: typeof latestNonce;
|
|
1254
1288
|
};
|
|
1255
1289
|
|
|
1256
|
-
declare const index$
|
|
1257
|
-
declare namespace index$
|
|
1258
|
-
export { balances$1 as Balances, latestNonce$1 as LatestNonce, index$
|
|
1290
|
+
declare const index$e_accounts: typeof accounts;
|
|
1291
|
+
declare namespace index$e {
|
|
1292
|
+
export { balances$1 as Balances, latestNonce$1 as LatestNonce, index$e_accounts as accounts };
|
|
1259
1293
|
}
|
|
1260
1294
|
|
|
1261
1295
|
declare const blocks: {
|
|
1262
1296
|
getBlock: typeof getBlock;
|
|
1263
1297
|
};
|
|
1264
1298
|
|
|
1265
|
-
declare const index$
|
|
1266
|
-
declare namespace index$
|
|
1267
|
-
export { getBlock$1 as GetBlock, index$
|
|
1299
|
+
declare const index$d_blocks: typeof blocks;
|
|
1300
|
+
declare namespace index$d {
|
|
1301
|
+
export { getBlock$1 as GetBlock, index$d_blocks as blocks };
|
|
1268
1302
|
}
|
|
1269
1303
|
|
|
1270
1304
|
declare const faucets: {
|
|
1271
1305
|
stx: typeof stx;
|
|
1272
1306
|
};
|
|
1273
1307
|
|
|
1274
|
-
declare const index$
|
|
1275
|
-
declare namespace index$
|
|
1276
|
-
export { stx$1 as Stx, index$
|
|
1308
|
+
declare const index$c_faucets: typeof faucets;
|
|
1309
|
+
declare namespace index$c {
|
|
1310
|
+
export { stx$1 as Stx, index$c_faucets as faucets };
|
|
1277
1311
|
}
|
|
1278
1312
|
|
|
1279
1313
|
declare const info: {
|
|
1280
1314
|
coreApi: typeof coreApi;
|
|
1281
1315
|
};
|
|
1282
1316
|
|
|
1283
|
-
declare const index$
|
|
1284
|
-
declare namespace index$
|
|
1285
|
-
export { coreApi$1 as CoreApi, index$
|
|
1317
|
+
declare const index$b_info: typeof info;
|
|
1318
|
+
declare namespace index$b {
|
|
1319
|
+
export { coreApi$1 as CoreApi, index$b_info as info };
|
|
1286
1320
|
}
|
|
1287
1321
|
|
|
1288
1322
|
declare const proofOfTransfer: {
|
|
@@ -1293,18 +1327,18 @@ declare const proofOfTransfer: {
|
|
|
1293
1327
|
stackersForSignerInCycle: typeof stackersForSignerInCycle;
|
|
1294
1328
|
};
|
|
1295
1329
|
|
|
1296
|
-
declare const index$
|
|
1297
|
-
declare namespace index$
|
|
1298
|
-
export { cycle$1 as Cycle, cycles$1 as Cycles, signerInCycle$1 as SignerInCycle, signersInCycle$1 as SignersInCycle, stackersForSignerInCycle$1 as StackersForSignerInCycle, index$
|
|
1330
|
+
declare const index$a_proofOfTransfer: typeof proofOfTransfer;
|
|
1331
|
+
declare namespace index$a {
|
|
1332
|
+
export { cycle$1 as Cycle, cycles$1 as Cycles, signerInCycle$1 as SignerInCycle, signersInCycle$1 as SignersInCycle, stackersForSignerInCycle$1 as StackersForSignerInCycle, index$a_proofOfTransfer as proofOfTransfer };
|
|
1299
1333
|
}
|
|
1300
1334
|
|
|
1301
1335
|
declare const stackingPool: {
|
|
1302
1336
|
members: typeof members;
|
|
1303
1337
|
};
|
|
1304
1338
|
|
|
1305
|
-
declare const index$
|
|
1306
|
-
declare namespace index$
|
|
1307
|
-
export { members$1 as Members, index$
|
|
1339
|
+
declare const index$9_stackingPool: typeof stackingPool;
|
|
1340
|
+
declare namespace index$9 {
|
|
1341
|
+
export { members$1 as Members, index$9_stackingPool as stackingPool };
|
|
1308
1342
|
}
|
|
1309
1343
|
|
|
1310
1344
|
declare const transactions: {
|
|
@@ -1313,9 +1347,18 @@ declare const transactions: {
|
|
|
1313
1347
|
mempoolTransactions: typeof mempoolTransactions;
|
|
1314
1348
|
};
|
|
1315
1349
|
|
|
1316
|
-
declare const index$
|
|
1350
|
+
declare const index$8_transactions: typeof transactions;
|
|
1351
|
+
declare namespace index$8 {
|
|
1352
|
+
export { addressTransactions$1 as AddressTransactions, schemas as Common, getTransaction$1 as GetTransaction, mempoolTransactions$1 as MempoolTransactions, index$8_transactions as transactions };
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
declare const mempool: {
|
|
1356
|
+
transactionFeePriorities: typeof transactionFeePriorities;
|
|
1357
|
+
};
|
|
1358
|
+
|
|
1359
|
+
declare const index$7_mempool: typeof mempool;
|
|
1317
1360
|
declare namespace index$7 {
|
|
1318
|
-
export {
|
|
1361
|
+
export { transactionFeePriorities$1 as TransactionFeePriorities, index$7_mempool as mempool };
|
|
1319
1362
|
}
|
|
1320
1363
|
|
|
1321
1364
|
declare const stacksApi: {
|
|
@@ -1332,6 +1375,9 @@ declare const stacksApi: {
|
|
|
1332
1375
|
info: {
|
|
1333
1376
|
coreApi: typeof coreApi;
|
|
1334
1377
|
};
|
|
1378
|
+
mempool: {
|
|
1379
|
+
transactionFeePriorities: typeof transactionFeePriorities;
|
|
1380
|
+
};
|
|
1335
1381
|
proofOfTransfer: {
|
|
1336
1382
|
cycle: typeof cycle;
|
|
1337
1383
|
cycles: typeof cycles;
|
|
@@ -1351,7 +1397,7 @@ declare const stacksApi: {
|
|
|
1351
1397
|
|
|
1352
1398
|
declare const index$6_stacksApi: typeof stacksApi;
|
|
1353
1399
|
declare namespace index$6 {
|
|
1354
|
-
export { index$
|
|
1400
|
+
export { index$e as Accounts, index$d as Blocks, index$c as Faucets, index$b as Info, index$7 as Mempool, index$a as ProofOfTransfer, index$9 as StackingPool, index$8 as Transactions, index$6_stacksApi as stacksApi };
|
|
1355
1401
|
}
|
|
1356
1402
|
|
|
1357
1403
|
type Args$6 = {
|
package/dist/index.js
CHANGED
|
@@ -913,12 +913,50 @@ var transactions = {
|
|
|
913
913
|
mempoolTransactions
|
|
914
914
|
};
|
|
915
915
|
|
|
916
|
+
// src/stacks-api/mempool/transaction-fee-priorities.ts
|
|
917
|
+
async function transactionFeePriorities(opts) {
|
|
918
|
+
const init = {};
|
|
919
|
+
if (opts.apiKeyConfig) {
|
|
920
|
+
init.headers = {
|
|
921
|
+
[opts.apiKeyConfig.header]: opts.apiKeyConfig.key
|
|
922
|
+
};
|
|
923
|
+
}
|
|
924
|
+
const endpoint = `${opts.baseUrl}/extended/v2/mempool/fees`;
|
|
925
|
+
const res = await fetch(endpoint, init);
|
|
926
|
+
if (!res.ok) {
|
|
927
|
+
return error({
|
|
928
|
+
name: "FetchFeePrioritiesError",
|
|
929
|
+
message: "Failed to fetch transaction fee priorities.",
|
|
930
|
+
data: {
|
|
931
|
+
status: res.status,
|
|
932
|
+
statusText: res.statusText,
|
|
933
|
+
bodyParseResult: await safePromise(res.text())
|
|
934
|
+
}
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
const [jsonError, data] = await safePromise(res.json());
|
|
938
|
+
if (jsonError) {
|
|
939
|
+
return error({
|
|
940
|
+
name: "ParseBodyError",
|
|
941
|
+
message: "Failed to parse response body as JSON.",
|
|
942
|
+
data: jsonError
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
return success(data);
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
// src/stacks-api/mempool/index.ts
|
|
949
|
+
var mempool = {
|
|
950
|
+
transactionFeePriorities
|
|
951
|
+
};
|
|
952
|
+
|
|
916
953
|
// src/stacks-api/index.ts
|
|
917
954
|
var stacksApi = {
|
|
918
955
|
accounts,
|
|
919
956
|
blocks,
|
|
920
957
|
faucets,
|
|
921
958
|
info,
|
|
959
|
+
mempool,
|
|
922
960
|
proofOfTransfer,
|
|
923
961
|
stackingPool,
|
|
924
962
|
transactions
|