Appearance
useWalletCompletedTransactionSummary
Success-screen data after a completed wallet deposit. summary is null until that happens. Does not require WalletsProvider.
The hook calls getCompletedTransactionSummary(), then fills fees and fiat the same way as the core client. Use isLoadingFees / isLoadingRates so the receipt does not flash empty fee / fiat values.
Primary receipt fields: send, receive, destination, tx hash + explorer, fees. Backend IDs (swapRequestId, bridgeOrderId, sessionId) are support / debug only.
Example
tsx
import { useWalletCompletedTransactionSummary } from '@swapped/connect-sdk/react'
function WalletSuccess({ onRestart }: { onRestart: () => void }) {
const { summary, isLoadingFees, isLoadingRates } =
useWalletCompletedTransactionSummary()
if (!summary) return null
return (
<div>
<p>
{summary.flow} · {summary.provider}
{summary.isSponsored ? ' · sponsored' : ''}
</p>
<p>
Sent {summary.send.formatted.amount} {summary.send.currency}
{summary.send.formatted.fiatValue
? ` ($${summary.send.formatted.fiatValue})`
: isLoadingRates
? ' (estimating…)'
: ''}{' '}
on {summary.send.network}
</p>
<p>
Received {summary.receive.formatted.amount} {summary.receive.currency}
{summary.receive.formatted.fiatValue
? ` ($${summary.receive.formatted.fiatValue})`
: isLoadingRates
? ' (estimating…)'
: ''}{' '}
on {summary.receive.network}
</p>
{isLoadingFees ? (
<p>Estimating fees…</p>
) : (
summary.fees.map(fee => (
<p key={`${fee.type}-${fee.currency}`}>
{fee.type} {fee.formatted.amount} {fee.currency}
{fee.formatted.fiatValue ? ` ($${fee.formatted.fiatValue})` : ''}
</p>
))
)}
<p>
From {summary.from.formatted}
{summary.from.explorerUrl ? (
<a href={summary.from.explorerUrl}>Explorer</a>
) : null}
</p>
<p>
To {summary.to.formatted}
{summary.to.explorerUrl ? (
<a href={summary.to.explorerUrl}>Explorer</a>
) : null}
</p>
<p>Destination {summary.destination.formatted}</p>
<p>
{summary.transaction.formatted}
{summary.transaction.explorerUrl ? (
<a href={summary.transaction.explorerUrl}>Explorer</a>
) : null}
</p>
<button type="button" onClick={onRestart}>
New payment
</button>
</div>
)
}Returns
| Field | Meaning |
|---|---|
summary | WalletCompletedTransactionSummary or null |
isLoading | Summary, fees, or rates still loading |
isLoadingSummary | Summary still loading |
isLoadingFees | Fees still loading — show a skeleton / “Estimating fees…” |
isLoadingRates | Rates still loading — fiat on send / receive may still be empty |
summary fields: flow, provider, send, receive, destination, transaction, from, to, fees, isSponsored. Amounts include formatted.amount and formatted.fiatValue. Full table: Summary (Core).
After a completed payment, call restartSession() before starting another one.