Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
PaymentTransactionSubType,
Transaction,
TransactionType,
SignatureType,
} from '@/features/transactions/models'
import { cn } from '@/features/common/utils'
import { ColumnDef } from '@tanstack/react-table'
Expand Down Expand Up @@ -116,9 +117,26 @@ const toColumn: ColumnDef<Transaction | InnerTransaction> = {
}
const typeColumn: ColumnDef<Transaction | InnerTransaction> = {
header: 'Type',
accessorFn: (transaction) => transaction.type,
cell: (c) => <TransactionTypeBadge transactionType={c.getValue<TransactionType>()} />,
accessorFn: (transaction) => transaction,
cell: (c) => {
const transaction = c.getValue<Transaction>()
const lsigBase64Program = transaction.signature?.type === SignatureType.Logic ? transaction.signature?.logic : null
const isFalconPQSig =
lsigBase64Program !== null &&
(() => {
const bytes = atob(lsigBase64Program)
return bytes.length == 1805 && bytes.charCodeAt(bytes.length - 1) === 0x85
})()

return (
<div className="focus:ring-ring focus:outline-hidden' bg-secondary text-secondary-foreground inline-flex h-5 items-center truncate rounded-md border-transparent py-0.5 text-xs tracking-tighter transition-colors focus:ring-2 focus:ring-offset-2">
<TransactionTypeBadge transactionType={transaction.type} />
{isFalconPQSig && <span className="px-2">🦅PQ</span>}
</div>
)
},
}

const amountColumn: ColumnDef<Transaction | InnerTransaction> = {
header: transactionAmountLabel,
accessorFn: (transaction) => transaction,
Expand Down