@secretkeylabs/stacks-tools 0.5.0-5d800c5 → 0.5.0-68aaf2e

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 CHANGED
@@ -93,7 +93,7 @@ async function balances(opts) {
93
93
  data: {
94
94
  status: res.status,
95
95
  statusText: res.statusText,
96
- bodyParseResult: await safePromise(res.json())
96
+ bodyText: await safePromise(res.text())
97
97
  }
98
98
  });
99
99
  }
@@ -134,7 +134,7 @@ async function latestNonce(opts) {
134
134
  endpoint,
135
135
  status: res.status,
136
136
  statusText: res.statusText,
137
- bodyParseResult: await safePromise(res.json())
137
+ bodyText: await safePromise(res.text())
138
138
  }
139
139
  });
140
140
  }
@@ -213,7 +213,7 @@ async function getBlock(opts) {
213
213
  data: {
214
214
  status: res.status,
215
215
  statusText: res.statusText,
216
- bodyParseResult: await safePromise(res.json())
216
+ bodyText: await safePromise(res.text())
217
217
  }
218
218
  });
219
219
  }
@@ -262,7 +262,7 @@ async function stx(opts) {
262
262
  data: {
263
263
  status: res.status,
264
264
  statusText: res.statusText,
265
- bodyParseResult: await safePromise(res.json())
265
+ bodyText: await safePromise(res.text())
266
266
  }
267
267
  });
268
268
  }
@@ -315,7 +315,7 @@ async function coreApi(apiOpts) {
315
315
  data: {
316
316
  status: res.status,
317
317
  statusText: res.statusText,
318
- bodyParseResult: await safePromise(res.json())
318
+ bodyText: await safePromise(res.text())
319
319
  }
320
320
  });
321
321
  }
@@ -370,7 +370,7 @@ async function cycle(opts) {
370
370
  endpoint,
371
371
  status: res.status,
372
372
  statusText: res.statusText,
373
- bodyParseResult: await safePromise(res.json())
373
+ bodyText: await safePromise(res.text())
374
374
  }
375
375
  });
376
376
  }
@@ -428,7 +428,7 @@ async function cycles(args) {
428
428
  endpoint,
429
429
  status: res.status,
430
430
  statusText: res.statusText,
431
- bodyParseResult: await safePromise(res.json())
431
+ bodyText: await safePromise(res.text())
432
432
  }
433
433
  });
434
434
  }
@@ -545,7 +545,7 @@ async function signersInCycle(args) {
545
545
  endpoint,
546
546
  status: res.status,
547
547
  statusText: res.statusText,
548
- bodyParseResult: await safePromise(res.json())
548
+ bodyText: await safePromise(res.text())
549
549
  }
550
550
  });
551
551
  }
@@ -605,7 +605,7 @@ async function stackersForSignerInCycle(opts) {
605
605
  endpoint,
606
606
  status: res.status,
607
607
  statusText: res.statusText,
608
- bodyParseResult: await safePromise(res.json())
608
+ bodyText: await safePromise(res.text())
609
609
  }
610
610
  });
611
611
  }
@@ -677,7 +677,7 @@ async function members(args) {
677
677
  data: {
678
678
  status: res.status,
679
679
  statusText: res.statusText,
680
- bodyParseResult: await safePromise(res.json())
680
+ bodyText: await safePromise(res.text())
681
681
  }
682
682
  });
683
683
  }
@@ -844,7 +844,7 @@ async function addressTransactions(args) {
844
844
  data: {
845
845
  status: res.status,
846
846
  statusText: res.statusText,
847
- bodyParseResult: await safePromise(res.json())
847
+ bodyText: await safePromise(res.text())
848
848
  }
849
849
  });
850
850
  }
@@ -885,7 +885,7 @@ async function getTransaction(args) {
885
885
  response: {
886
886
  status: res.status,
887
887
  statusText: res.statusText,
888
- body: await safePromise(res.json())
888
+ bodyText: await safePromise(res.text())
889
889
  }
890
890
  });
891
891
  }
@@ -936,7 +936,7 @@ async function mempoolTransactions(args) {
936
936
  data: {
937
937
  status: res.status,
938
938
  statusText: res.statusText,
939
- bodyParseResult: await safePromise(res.json())
939
+ bodyText: await safePromise(res.text())
940
940
  }
941
941
  });
942
942
  }
@@ -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
@@ -1007,7 +1045,7 @@ async function mapEntry(args) {
1007
1045
  status: res.status,
1008
1046
  statusText: res.statusText,
1009
1047
  endpoint,
1010
- bodyParseResult: await safePromise(res.text())
1048
+ bodyText: await safePromise(res.text())
1011
1049
  }
1012
1050
  });
1013
1051
  }
@@ -1055,7 +1093,7 @@ async function readOnly(args) {
1055
1093
  data: {
1056
1094
  status: res.status,
1057
1095
  statusText: res.statusText,
1058
- bodyParseResult: await safePromise(res.json())
1096
+ bodyText: await safePromise(res.text())
1059
1097
  }
1060
1098
  });
1061
1099
  }
@@ -1092,7 +1130,7 @@ async function poxDetails(args) {
1092
1130
  data: {
1093
1131
  status: res.status,
1094
1132
  statusText: res.statusText,
1095
- bodyParseResult: await safePromise(res.json())
1133
+ bodyText: await safePromise(res.text())
1096
1134
  }
1097
1135
  });
1098
1136
  }
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$d_accounts: typeof accounts;
1257
- declare namespace index$d {
1258
- export { balances$1 as Balances, latestNonce$1 as LatestNonce, index$d_accounts as accounts };
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$c_blocks: typeof blocks;
1266
- declare namespace index$c {
1267
- export { getBlock$1 as GetBlock, index$c_blocks as blocks };
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$b_faucets: typeof faucets;
1275
- declare namespace index$b {
1276
- export { stx$1 as Stx, index$b_faucets as faucets };
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$a_info: typeof info;
1284
- declare namespace index$a {
1285
- export { coreApi$1 as CoreApi, index$a_info as info };
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$9_proofOfTransfer: typeof proofOfTransfer;
1297
- declare namespace index$9 {
1298
- export { cycle$1 as Cycle, cycles$1 as Cycles, signerInCycle$1 as SignerInCycle, signersInCycle$1 as SignersInCycle, stackersForSignerInCycle$1 as StackersForSignerInCycle, index$9_proofOfTransfer as proofOfTransfer };
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$8_stackingPool: typeof stackingPool;
1306
- declare namespace index$8 {
1307
- export { members$1 as Members, index$8_stackingPool as stackingPool };
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$7_transactions: typeof transactions;
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 { addressTransactions$1 as AddressTransactions, schemas as Common, getTransaction$1 as GetTransaction, mempoolTransactions$1 as MempoolTransactions, index$7_transactions as transactions };
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$d as Accounts, index$c as Blocks, index$b as Faucets, index$a as Info, index$9 as ProofOfTransfer, index$8 as StackingPool, index$7 as Transactions, index$6_stacksApi as stacksApi };
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$d_accounts: typeof accounts;
1257
- declare namespace index$d {
1258
- export { balances$1 as Balances, latestNonce$1 as LatestNonce, index$d_accounts as accounts };
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$c_blocks: typeof blocks;
1266
- declare namespace index$c {
1267
- export { getBlock$1 as GetBlock, index$c_blocks as blocks };
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$b_faucets: typeof faucets;
1275
- declare namespace index$b {
1276
- export { stx$1 as Stx, index$b_faucets as faucets };
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$a_info: typeof info;
1284
- declare namespace index$a {
1285
- export { coreApi$1 as CoreApi, index$a_info as info };
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$9_proofOfTransfer: typeof proofOfTransfer;
1297
- declare namespace index$9 {
1298
- export { cycle$1 as Cycle, cycles$1 as Cycles, signerInCycle$1 as SignerInCycle, signersInCycle$1 as SignersInCycle, stackersForSignerInCycle$1 as StackersForSignerInCycle, index$9_proofOfTransfer as proofOfTransfer };
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$8_stackingPool: typeof stackingPool;
1306
- declare namespace index$8 {
1307
- export { members$1 as Members, index$8_stackingPool as stackingPool };
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$7_transactions: typeof transactions;
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 { addressTransactions$1 as AddressTransactions, schemas as Common, getTransaction$1 as GetTransaction, mempoolTransactions$1 as MempoolTransactions, index$7_transactions as transactions };
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$d as Accounts, index$c as Blocks, index$b as Faucets, index$a as Info, index$9 as ProofOfTransfer, index$8 as StackingPool, index$7 as Transactions, index$6_stacksApi as stacksApi };
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
@@ -48,7 +48,7 @@ async function balances(opts) {
48
48
  data: {
49
49
  status: res.status,
50
50
  statusText: res.statusText,
51
- bodyParseResult: await safePromise(res.json())
51
+ bodyText: await safePromise(res.text())
52
52
  }
53
53
  });
54
54
  }
@@ -89,7 +89,7 @@ async function latestNonce(opts) {
89
89
  endpoint,
90
90
  status: res.status,
91
91
  statusText: res.statusText,
92
- bodyParseResult: await safePromise(res.json())
92
+ bodyText: await safePromise(res.text())
93
93
  }
94
94
  });
95
95
  }
@@ -168,7 +168,7 @@ async function getBlock(opts) {
168
168
  data: {
169
169
  status: res.status,
170
170
  statusText: res.statusText,
171
- bodyParseResult: await safePromise(res.json())
171
+ bodyText: await safePromise(res.text())
172
172
  }
173
173
  });
174
174
  }
@@ -217,7 +217,7 @@ async function stx(opts) {
217
217
  data: {
218
218
  status: res.status,
219
219
  statusText: res.statusText,
220
- bodyParseResult: await safePromise(res.json())
220
+ bodyText: await safePromise(res.text())
221
221
  }
222
222
  });
223
223
  }
@@ -270,7 +270,7 @@ async function coreApi(apiOpts) {
270
270
  data: {
271
271
  status: res.status,
272
272
  statusText: res.statusText,
273
- bodyParseResult: await safePromise(res.json())
273
+ bodyText: await safePromise(res.text())
274
274
  }
275
275
  });
276
276
  }
@@ -325,7 +325,7 @@ async function cycle(opts) {
325
325
  endpoint,
326
326
  status: res.status,
327
327
  statusText: res.statusText,
328
- bodyParseResult: await safePromise(res.json())
328
+ bodyText: await safePromise(res.text())
329
329
  }
330
330
  });
331
331
  }
@@ -383,7 +383,7 @@ async function cycles(args) {
383
383
  endpoint,
384
384
  status: res.status,
385
385
  statusText: res.statusText,
386
- bodyParseResult: await safePromise(res.json())
386
+ bodyText: await safePromise(res.text())
387
387
  }
388
388
  });
389
389
  }
@@ -500,7 +500,7 @@ async function signersInCycle(args) {
500
500
  endpoint,
501
501
  status: res.status,
502
502
  statusText: res.statusText,
503
- bodyParseResult: await safePromise(res.json())
503
+ bodyText: await safePromise(res.text())
504
504
  }
505
505
  });
506
506
  }
@@ -560,7 +560,7 @@ async function stackersForSignerInCycle(opts) {
560
560
  endpoint,
561
561
  status: res.status,
562
562
  statusText: res.statusText,
563
- bodyParseResult: await safePromise(res.json())
563
+ bodyText: await safePromise(res.text())
564
564
  }
565
565
  });
566
566
  }
@@ -632,7 +632,7 @@ async function members(args) {
632
632
  data: {
633
633
  status: res.status,
634
634
  statusText: res.statusText,
635
- bodyParseResult: await safePromise(res.json())
635
+ bodyText: await safePromise(res.text())
636
636
  }
637
637
  });
638
638
  }
@@ -799,7 +799,7 @@ async function addressTransactions(args) {
799
799
  data: {
800
800
  status: res.status,
801
801
  statusText: res.statusText,
802
- bodyParseResult: await safePromise(res.json())
802
+ bodyText: await safePromise(res.text())
803
803
  }
804
804
  });
805
805
  }
@@ -840,7 +840,7 @@ async function getTransaction(args) {
840
840
  response: {
841
841
  status: res.status,
842
842
  statusText: res.statusText,
843
- body: await safePromise(res.json())
843
+ bodyText: await safePromise(res.text())
844
844
  }
845
845
  });
846
846
  }
@@ -891,7 +891,7 @@ async function mempoolTransactions(args) {
891
891
  data: {
892
892
  status: res.status,
893
893
  statusText: res.statusText,
894
- bodyParseResult: await safePromise(res.json())
894
+ bodyText: await safePromise(res.text())
895
895
  }
896
896
  });
897
897
  }
@@ -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
@@ -962,7 +1000,7 @@ async function mapEntry(args) {
962
1000
  status: res.status,
963
1001
  statusText: res.statusText,
964
1002
  endpoint,
965
- bodyParseResult: await safePromise(res.text())
1003
+ bodyText: await safePromise(res.text())
966
1004
  }
967
1005
  });
968
1006
  }
@@ -1010,7 +1048,7 @@ async function readOnly(args) {
1010
1048
  data: {
1011
1049
  status: res.status,
1012
1050
  statusText: res.statusText,
1013
- bodyParseResult: await safePromise(res.json())
1051
+ bodyText: await safePromise(res.text())
1014
1052
  }
1015
1053
  });
1016
1054
  }
@@ -1047,7 +1085,7 @@ async function poxDetails(args) {
1047
1085
  data: {
1048
1086
  status: res.status,
1049
1087
  statusText: res.statusText,
1050
- bodyParseResult: await safePromise(res.json())
1088
+ bodyText: await safePromise(res.text())
1051
1089
  }
1052
1090
  });
1053
1091
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secretkeylabs/stacks-tools",
3
- "version": "0.5.0-5d800c5",
3
+ "version": "0.5.0-68aaf2e",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -25,10 +25,10 @@
25
25
  "@arethetypeswrong/cli": "0.15.4",
26
26
  "@types/bun": "latest",
27
27
  "prettier": "^3.3.3",
28
- "tsup": "^8.3.5"
28
+ "tsup": "^8.3.5",
29
+ "typescript": "^5.0.0"
29
30
  },
30
31
  "peerDependencies": {
31
- "typescript": "^5.0.0",
32
32
  "@stacks/blockchain-api-client": "^8.2.1",
33
33
  "@stacks/transactions": "^7.0.0",
34
34
  "valibot": "^0.42.1"