-
Notifications
You must be signed in to change notification settings - Fork 22
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
ihomp
merged 45 commits into
Bithomp:main
from
pandablue0809:feat/445/transactions-page
Aug 20, 2025
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
c9a3762
init transaction page
pandablue0809 e8c0286
add token type
pandablue0809 edb52b9
fix fee
pandablue0809 95f6c06
add memo
pandablue0809 8f91116
add transactionBlock
pandablue0809 ce57982
add orderDetails
pandablue0809 6ed8c6d
Merge remote-tracking branch 'upstream/main' into feat/445/transactio…
pandablue0809 811ed0d
Merge remote-tracking branch 'upstream/main' into feat/445/transactio…
pandablue0809 4f58f74
fix seachblock
pandablue0809 11962f1
Merge remote-tracking branch 'upstream/main' into feat/445/transactio…
pandablue0809 00548c4
add datepicker
pandablue0809 dbf2736
Merge remote-tracking branch 'upstream/main' into feat/445/transactio…
pandablue0809 0062f51
add dropdwon css
pandablue0809 5a17d74
add amm
pandablue0809 a84edc8
add order
pandablue0809 68bbe8c
add check
pandablue0809 3bd6904
accountset
pandablue0809 4924f87
add accountdelet
pandablue0809 67b3021
remove console
pandablue0809 ab124f3
Merge remote-tracking branch 'upstream/main' into feat/445/transactio…
pandablue0809 8e40889
change router
pandablue0809 650f542
revert recent transaction
pandablue0809 3477c57
remove txtypetotext
pandablue0809 3de0d2c
remove transactionblock
pandablue0809 42e855f
change structure
pandablue0809 2ff4ac1
fix lint error
pandablue0809 7bcc075
add fiatRate
pandablue0809 e5ebe8d
add balanceChage
pandablue0809 0f527db
add payment
pandablue0809 b1abfde
Merge remote-tracking branch 'upstream/main' into feat/445/transactio…
pandablue0809 804c4b1
fix payment and add accountdelet
pandablue0809 48d9878
add nft
pandablue0809 58fad91
add offer
pandablue0809 62cb81f
add check type
pandablue0809 711469a
add openEmailLogin
pandablue0809 6d10c01
ass accountset
pandablue0809 6764ac1
fix checkapi
pandablue0809 e300ab1
suppressHydrationWarning
ihomp 6113dc2
add comment
pandablue0809 3221c68
Merge branch 'feat/445/transactions-page' of github.com:pandablue0809…
pandablue0809 5a1fdec
Merge remote-tracking branch 'upstream/main' into feat/445/transactio…
pandablue0809 4de6c44
remove pageFiatRate in each tx card
pandablue0809 5a9b7b7
fix lint
pandablue0809 816577b
Merge remote-tracking branch 'upstream/main' into feat/445/transactio…
pandablue0809 9ba62d4
Merge branch 'main' into pr/498
ihomp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.