Files
brk/website_next/explore/block/preview/fees.js
T
2026-07-08 11:24:39 +02:00

28 lines
712 B
JavaScript

import { createFeeRateRange } from "../fee-rates.js";
/**
* @param {BlockPreviewTransaction[]} transactions
*/
export function createPreviewFeeRange(transactions) {
return createFeeRateRange(transactions.map(({ feeRate }) => feeRate));
}
/**
* @param {BlockPreviewTransaction[]} transactions
*/
export function orderTransactions(transactions) {
return transactions
.toSorted((a, b) => b.feeRate - a.feeRate || b.weight - a.weight);
}
/**
* @typedef {Object} BlockPreviewTransaction
* @property {string} txid
* @property {number} version
* @property {number} weight
* @property {number} feeRate
* @property {boolean} rbf
* @property {number} inputCount
* @property {number} outputCount
*/