Skip to content

transactions - new page #498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
Aug 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c9a3762
init transaction page
pandablue0809 Jul 7, 2025
e8c0286
add token type
pandablue0809 Jul 11, 2025
edb52b9
fix fee
pandablue0809 Jul 14, 2025
95f6c06
add memo
pandablue0809 Jul 15, 2025
8f91116
add transactionBlock
pandablue0809 Jul 21, 2025
ce57982
add orderDetails
pandablue0809 Jul 22, 2025
6ed8c6d
Merge remote-tracking branch 'upstream/main' into feat/445/transactio…
pandablue0809 Jul 22, 2025
811ed0d
Merge remote-tracking branch 'upstream/main' into feat/445/transactio…
pandablue0809 Jul 24, 2025
4f58f74
fix seachblock
pandablue0809 Jul 24, 2025
11962f1
Merge remote-tracking branch 'upstream/main' into feat/445/transactio…
pandablue0809 Jul 25, 2025
00548c4
add datepicker
pandablue0809 Jul 28, 2025
dbf2736
Merge remote-tracking branch 'upstream/main' into feat/445/transactio…
pandablue0809 Jul 28, 2025
0062f51
add dropdwon css
pandablue0809 Jul 28, 2025
5a17d74
add amm
pandablue0809 Jul 28, 2025
a84edc8
add order
pandablue0809 Jul 28, 2025
68bbe8c
add check
pandablue0809 Jul 28, 2025
3bd6904
accountset
pandablue0809 Jul 28, 2025
4924f87
add accountdelet
pandablue0809 Jul 28, 2025
67b3021
remove console
pandablue0809 Jul 28, 2025
ab124f3
Merge remote-tracking branch 'upstream/main' into feat/445/transactio…
pandablue0809 Jul 31, 2025
8e40889
change router
pandablue0809 Aug 1, 2025
650f542
revert recent transaction
pandablue0809 Aug 6, 2025
3477c57
remove txtypetotext
pandablue0809 Aug 6, 2025
3de0d2c
remove transactionblock
pandablue0809 Aug 6, 2025
42e855f
change structure
pandablue0809 Aug 6, 2025
2ff4ac1
fix lint error
pandablue0809 Aug 6, 2025
7bcc075
add fiatRate
pandablue0809 Aug 6, 2025
e5ebe8d
add balanceChage
pandablue0809 Aug 6, 2025
0f527db
add payment
pandablue0809 Aug 6, 2025
b1abfde
Merge remote-tracking branch 'upstream/main' into feat/445/transactio…
pandablue0809 Aug 7, 2025
804c4b1
fix payment and add accountdelet
pandablue0809 Aug 7, 2025
48d9878
add nft
pandablue0809 Aug 7, 2025
58fad91
add offer
pandablue0809 Aug 7, 2025
62cb81f
add check type
pandablue0809 Aug 7, 2025
711469a
add openEmailLogin
pandablue0809 Aug 7, 2025
6d10c01
ass accountset
pandablue0809 Aug 7, 2025
6764ac1
fix checkapi
pandablue0809 Aug 7, 2025
e300ab1
suppressHydrationWarning
ihomp Aug 8, 2025
6113dc2
add comment
pandablue0809 Aug 8, 2025
3221c68
Merge branch 'feat/445/transactions-page' of github.com:pandablue0809…
pandablue0809 Aug 8, 2025
5a1fdec
Merge remote-tracking branch 'upstream/main' into feat/445/transactio…
pandablue0809 Aug 12, 2025
4de6c44
remove pageFiatRate in each tx card
pandablue0809 Aug 12, 2025
5a9b7b7
fix lint
pandablue0809 Aug 12, 2025
816577b
Merge remote-tracking branch 'upstream/main' into feat/445/transactio…
pandablue0809 Aug 14, 2025
9ba62d4
Merge branch 'main' into pr/498
ihomp Aug 20, 2025
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
2 changes: 1 addition & 1 deletion components/Layout/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default function Header({

const signinWithWallet = (wallet) => {
//redirect to account, if user is on the account page
setSignRequest(router.pathname === '/account/[[...id]]' ? { wallet, redirect: 'account' } : { wallet })
setSignRequest(router.pathname.startsWith('/account') ? { wallet, redirect: 'account' } : { wallet })
}

const bithomp = server.includes('bithomp')
Expand Down
7 changes: 7 additions & 0 deletions components/Layout/SearchBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ export default function SearchBlock({ searchPlaceholderText, tab = null, userDat
return
}

if (tab === 'transactions') {
router.push('/account/' + encodeURI(searchFor) + '/transactions' + addParams)
return
}

router.push('/account/' + encodeURI(searchFor) + addParams)
return
}
Expand Down Expand Up @@ -337,6 +342,8 @@ export default function SearchBlock({ searchPlaceholderText, tab = null, userDat
['amm', 'account', 'nft', 'nfts', 'nft-offer', 'nft-offers', 'transaction', 'nft-volumes', 'object'].includes(tab)
) {
return t('explorer.header.' + tab)
} else if (tab === 'transactions') {
return t("explorer.menu.transactions")
}
return ''
}
Expand Down
9 changes: 9 additions & 0 deletions components/Transactions/FiatRateContext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { createContext, useContext } from 'react'

export const TxFiatRateContext = createContext(0)

export const useTxFiatRate = () => {
return useContext(TxFiatRateContext)
}


15 changes: 15 additions & 0 deletions components/Transactions/TransactionRowAMM.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { TransactionRowCard } from './TransactionRowCard'

export const TransactionRowAMM = ({ tx, address, index, selectedCurrency}) => {

return (
<TransactionRowCard
data={tx}
address={address}
index={index}
selectedCurrency={selectedCurrency}
>
{/* AMM */}
</TransactionRowCard>
)
}
47 changes: 47 additions & 0 deletions components/Transactions/TransactionRowAccountDelete.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { TransactionRowCard } from './TransactionRowCard'
import { addressUsernameOrServiceLink, amountFormat, nativeCurrencyToFiat } from '../../utils/format'
import { FiDownload, FiUpload } from 'react-icons/fi'
import { useTxFiatRate } from './FiatRateContext'

export const TransactionRowAccountDelete = ({ tx, address, index, selectedCurrency}) => {
const pageFiatRate = useTxFiatRate()

const { outcome, specification } = tx

return (
<TransactionRowCard
data={tx}
address={address}
index={index}
selectedCurrency={selectedCurrency}
>
<div className="flex items-center gap-1">
{specification?.destination?.address === address ? (
<>
<FiDownload style={{ stroke: 'green', fontSize: 16 }}/>
<span>
{addressUsernameOrServiceLink(specification?.source, 'address')}
</span>
</>
) : (
<>
<FiUpload style={{ stroke: 'red', fontSize: 16 }}/>
<span>
{addressUsernameOrServiceLink(specification?.destination, 'address')}
</span>
</>
)}
</div>
{outcome?.deliveredAmount && (
<div>
<span className="bold">Delivered amount: </span>
<span className="green">{amountFormat(outcome?.deliveredAmount, { precise: 'nice' })}</span>
{nativeCurrencyToFiat({
amount: outcome?.deliveredAmount,
selectedCurrency,
fiatRate: pageFiatRate
})}
</div>)}
</TransactionRowCard>
)
}
119 changes: 119 additions & 0 deletions components/Transactions/TransactionRowAccountSet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
import { TransactionRowCard } from './TransactionRowCard'
import { nativeCurrency } from '../../utils'

export const TransactionRowAccountSet = ({ tx, address, index, selectedCurrency}) => {

const { specification } = tx

return (
<TransactionRowCard
data={tx}
address={address}
index={index}
selectedCurrency={selectedCurrency}
>
{specification.defaultRipple !== undefined && (
<div>
<span>Default ripple: </span>
<span className="bold orange">{specification.defaultRipple ? 'enabled' : 'disabled'}</span>
</div>
)}
{specification.disallowXRP !== undefined && (
<div>
<span>Incoming {nativeCurrency}: </span>
<span className="bold">{specification.disallowXRP ? 'disallow' : 'allow'}</span>
</div>
)}
{specification.requireDestTag !== undefined && (
<div>
<span>Destination tag: </span>
<span className="bold orange">{specification.requireDestTag ? 'require' : "don't require"}</span>
</div>
)}
{specification.disableMaster !== undefined && (
<div>
<span>Master key: </span>
<span className="bold red">{specification.disableMaster ? 'disabled' : 'enabled'}</span>
</div>
)}
{specification.noFreeze && (
<div>
<span>No freeze: </span>
<span className="bold">enabled</span>
</div>
)}
{specification.depositAuth !== undefined && (
<div>
<span>Deposit authorization: </span>
<span className="bold">{specification.depositAuth ? 'enabled' : 'disabled'}</span>
</div>
)}
{specification.requireAuth !== undefined && (
<div>
<span>Require authorization: </span>
<span className="bold">{specification.requireAuth ? 'enabled' : 'disabled'}</span>
</div>
)}
{specification.disallowIncomingCheck !== undefined && (
<div>
<span>Incoming check: </span>
<span className="bold">{specification.disallowIncomingCheck ? 'disallow' : 'allow'}</span>
</div>
)}
{specification.disallowIncomingPayChan !== undefined && (
<div>
<span>Incoming payment channel: </span>
<span className="bold">{specification.disallowIncomingPayChan ? 'disallow' : 'allow'}</span>
</div>
)}
{specification.disallowIncomingNFTokenOffer !== undefined && (
<div>
<span>Incoming NFT offer: </span>
<span className="bold">{specification.disallowIncomingNFTokenOffer ? 'disallow' : 'allow'}</span>
</div>
)}
{specification.disallowIncomingTrustline !== undefined && (
<div>
<span>Incoming trust line: </span>
<span className="bold">{specification.disallowIncomingTrustline ? 'disallow' : 'allow'}</span>
</div>
)}
{specification.enableTransactionIDTracking !== undefined && (
<div>
<span>Transaction ID tracking: </span>
<span className="bold">{specification.enableTransactionIDTracking ? 'enabled' : 'disabled'}</span>
</div>
)}
{specification.globalFreeze !== undefined && (
<div>
<span>Global freeze: </span>
<span className="bold">{specification.globalFreeze ? 'enabled' : 'disabled'}</span>
</div>
)}
{specification.authorizedMinter !== undefined && (
<div>
<span>Authorized minter: </span>
<span className="bold">{specification.authorizedMinter ? 'enabled' : 'disabled'}</span>
</div>
)}
{tx.NFTokenMinter !== undefined && (
<div>
<span>NFT minter: </span>
<span className="bold">{specification.nftokenMinter || <span className="orange">removed</span>}</span>
</div>
)}
{specification.allowTrustLineClawback !== undefined && (
<div>
<span>Trust line Clawback: </span>
<span className="bold">{specification.allowTrustLineClawback ? 'allowed' : 'disallow'}</span>
</div>
)}
{specification.disallowIncomingRemit !== undefined && (
<div>
<span>Incoming Remit: </span>
<span className="bold">{specification.disallowIncomingRemit ? 'disallow' : 'allow'}</span>
</div>
)}
</TransactionRowCard>
)
}
111 changes: 111 additions & 0 deletions components/Transactions/TransactionRowCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import { amountFormat, dateFormat, nativeCurrencyToFiat, timeFormat } from '../../utils/format'
import { useEffect, useState } from 'react'
import { fetchHistoricalRate } from '../../utils/common'
import { TxFiatRateContext } from './FiatRateContext'
import { LinkTx } from '../../utils/links'
import { errorCodeDescription, shortErrorCode } from '../../utils/transaction'
import { useWidth } from '../../utils'
import { FiCalendar, FiClock } from 'react-icons/fi'
import { FaArrowRightArrowLeft } from 'react-icons/fa6'

export const TransactionRowCard = ({ data, index, txTypeSpecial, children, selectedCurrency }) => {
const width = useWidth()
const { specification, tx, outcome } = data
const date = dateFormat(tx.date + 946684800)
const time = timeFormat(tx.date + 946684800)
const memos = specification?.memos
const isSuccessful = outcome?.result == 'tesSUCCESS'

const [pageFiatRate, setPageFiatRate] = useState(0)

useEffect(() => {
if (!selectedCurrency || !outcome?.ledgerTimestamp) return
fetchHistoricalRate({
timestamp: outcome.ledgerTimestamp * 1000,
selectedCurrency,
setPageFiatRate
})
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [selectedCurrency, outcome?.ledgerTimestamp])

return (
<tr
index={index}
style={{
background: !isSuccessful ? 'repeating-linear-gradient(45deg, #f9e3b9, #f9e3b9 10px, #fff 10px, #fff 20px)' : ''
}}
>
<td className="bold center" style={{ width: 10 }}>
{index + 1}
</td>
<td className="left" style={{ width: 70 }}>
<span className="flex items-center gap-1" suppressHydrationWarning>
<FiCalendar style={{ stroke: '#666' }} /> {date}
</span>
<span className="flex items-center gap-1" suppressHydrationWarning>
<FiClock style={{ stroke: '#666' }} /> {time}
</span>
</td>
<td className="left" style={{ maxWidth: width > 600 ? 600 : '100%', wordBreak: 'break-word' }}>
<span className="flex items-center gap-1">
<FaArrowRightArrowLeft style={{ stroke: '#666', color: '#666' }} />
{width > 600 ? <LinkTx tx={tx.hash}>{tx.hash}</LinkTx> : <LinkTx tx={tx.hash} short={10} />}
</span>
<span>Type: </span>
<span className="bold">{txTypeSpecial || tx?.TransactionType}</span>
<br />
<TxFiatRateContext.Provider value={pageFiatRate}>{children}</TxFiatRateContext.Provider>
{outcome && !isSuccessful && (
<>
<span className="bold">Failure: </span>
<span className="red bold">{shortErrorCode(outcome.result)}</span>
<br />
<span className="bold">Description: </span>
<span className="orange bold">{errorCodeDescription(outcome.result)}</span>
<br />
</>
)}
<span>Fee:</span>
<span className="bold">{amountFormat(tx.Fee)}</span>
<span>
{nativeCurrencyToFiat({ amount: tx.Fee, selectedCurrency, fiatRate: pageFiatRate })}
</span>
<br />
{tx.DestinationTag && (
<>
<span className="gray">Destination tag: {tx.DestinationTag}</span>
<br />
</>
)}
{tx.SourceTag && (
<>
<span className="gray">Source tag: {tx.SourceTag}</span>
<br />
</>
)}
{memos && memos.length > 0 && (
<>
{memos.map((memo, idx) => (
<div key={idx}>
{memo.data ? (
<>
<span className="bold">Memo{memos.length > 1 ? ` (${idx + 1})` : ''}:</span>
<span className="gray"> {memo.data}</span>
</>
) : (
<>
<span className="bold">
{memo.type}
{memos.length > 1 ? ` (${idx + 1})` : ''}:
</span>
<span className="gray"> {memo.format}</span>
</>
)}
</div>
))}
</>
)}
</td>
</tr>
)
}
37 changes: 37 additions & 0 deletions components/Transactions/TransactionRowCheck.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { TransactionRowCard } from './TransactionRowCard'
import { amountFormat, nativeCurrencyToFiat, addressUsernameOrServiceLink } from '../../utils/format'
import { useTxFiatRate } from './FiatRateContext'

export const TransactionRowCheck = ({ tx, address, index, selectedCurrency}) => {
const pageFiatRate = useTxFiatRate()

const { outcome } = tx

const checkChanges = outcome?.checkChanges

return (
<TransactionRowCard
data={tx}
address={address}
index={index}
selectedCurrency={selectedCurrency}
>
{checkChanges.sendMax && (
<div>
<span>Max amount: </span>
<span>
<span className="bold orange">{amountFormat(checkChanges.sendMax)}</span>
{checkChanges.sendMax?.issuer && (
<>({addressUsernameOrServiceLink(checkChanges.sendMax, 'issuer', { short: true })})</>
)}
{nativeCurrencyToFiat({
amount: checkChanges.sendMax,
selectedCurrency,
fiatRate: pageFiatRate
})}
</span>
</div>
)}
</TransactionRowCard>
)
}
10 changes: 10 additions & 0 deletions components/Transactions/TransactionRowDID.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { TransactionRowCard } from './TransactionRowCard'

export const TransactionRowDID = ({ tx, address, index, selectedCurrency}) => {

return (
<TransactionRowCard data={tx} address={address} index={index} selectedCurrency={selectedCurrency}>
{/* DID */}
</TransactionRowCard>
)
}
Loading