@@ -23,6 +23,7 @@ import { useAppConfig, useClipboard, useTransactionSeenState } from "@app/hooks"
2323import { useDisplayCurrency } from "@app/hooks/use-display-currency"
2424import { useI18nContext } from "@app/i18n/i18n-react"
2525import { toWalletAmount } from "@app/types/amounts"
26+ import { PaymentType } from "@app/types/transaction.types"
2627import { RouteProp , useNavigation } from "@react-navigation/native"
2728import { StackNavigationProp } from "@react-navigation/stack"
2829import { makeStyles , Text , useTheme } from "@rn-vui/themed"
@@ -72,7 +73,12 @@ const Row = ({
7273 )
7374}
7475
75- const typeDisplay = ( instance ?: SettlementVia | DeepPartialObject < SettlementVia > ) => {
76+ export const typeDisplay = (
77+ instance ?: SettlementVia | DeepPartialObject < SettlementVia > ,
78+ selfCustodialPaymentType ?: PaymentType ,
79+ ) => {
80+ if ( selfCustodialPaymentType === PaymentType . Spark ) return "Spark"
81+
7682 if ( ! instance || ! instance . __typename ) {
7783 return "Unknown"
7884 }
@@ -130,10 +136,19 @@ export const TransactionDetailScreen: React.FC<Props> = ({ route }) => {
130136 const [ timer , setTimer ] = React . useState < number > ( 0 )
131137
132138 const { LL , locale } = useI18nContext ( )
133- const { isSelfCustodial } = useActiveWallet ( )
139+ const { isSelfCustodial, wallets } = useActiveWallet ( )
134140 const { copyToClipboard } = useClipboard ( )
135141 const { formatCurrency } = useDisplayCurrency ( )
136142
143+ const selfCustodialPaymentType = React . useMemo ( ( ) => {
144+ if ( ! isSelfCustodial ) return undefined
145+ for ( const wallet of wallets ) {
146+ const match = wallet . transactions . find ( ( t ) => t . id === txid )
147+ if ( match ) return match . paymentType
148+ }
149+ return undefined
150+ } , [ isSelfCustodial , wallets , txid ] )
151+
137152 const description = useDescriptionDisplay ( {
138153 tx,
139154 bankName : galoyInstance . name ,
@@ -429,7 +444,10 @@ export const TransactionDetailScreen: React.FC<Props> = ({ route }) => {
429444 value = { settlementVia . counterPartyUsername || galoyInstance . name }
430445 />
431446 ) }
432- < Row entry = { LL . common . type ( ) } value = { typeDisplay ( settlementVia ) } />
447+ < Row
448+ entry = { LL . common . type ( ) }
449+ value = { typeDisplay ( settlementVia , selfCustodialPaymentType ) }
450+ />
433451 { initiationVia ?. __typename === "InitiationViaLn" &&
434452 initiationVia ?. paymentHash && (
435453 < Row
0 commit comments