diff --git a/ui/txs/sortTxs.ts b/ui/txs/sortTxs.ts index 3993612e4c..a66afab633 100644 --- a/ui/txs/sortTxs.ts +++ b/ui/txs/sortTxs.ts @@ -13,6 +13,12 @@ export default function sortTxs(sorting: TransactionsSortingValue | undefined) { return compareBns(tx2.fee.value || 0, tx1.fee.value || 0); case 'fee-asc': return compareBns(tx1.fee.value || 0, tx2.fee.value || 0); + case 'block_number-asc': { + if (tx1.block_number && tx2.block_number) { + return tx1.block_number - tx2.block_number; + } + return 0; + } default: return 0; } diff --git a/ui/txs/useTxsSort.tsx b/ui/txs/useTxsSort.tsx index b3a77e5514..8999f3388c 100644 --- a/ui/txs/useTxsSort.tsx +++ b/ui/txs/useTxsSort.tsx @@ -15,6 +15,7 @@ export const SORT_OPTIONS: Array> = [ { label: 'Value descending', value: 'value-desc' }, { label: 'Fee ascending', value: 'fee-asc' }, { label: 'Fee descending', value: 'fee-desc' }, + { label: 'Block number ascending', value: 'block_number-asc' }, ]; type SortingValue = TransactionsSortingValue | undefined;