@@ -25,6 +25,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'
25
25
import { useSelector } from 'react-redux'
26
26
import { selectSelectedCurrency } from 'store/settings/currency'
27
27
import { TRUNCATE_ADDRESS_LENGTH } from 'common/consts/text'
28
+ import { xpAddressWithoutPrefix } from 'common/utils/xpAddressWIthoutPrefix'
28
29
import { useSendContext } from '../context/sendContext'
29
30
import { useSendSelectedToken } from '../store'
30
31
@@ -98,6 +99,20 @@ export const SendToken = ({ onSend }: { onSend: () => void }): JSX.Element => {
98
99
)
99
100
} , [ network . networkToken . decimals , selectedToken ] )
100
101
102
+ const addressToSendWithoutPrefix = useMemo ( ( ) => {
103
+ if ( selectedToken === undefined ) {
104
+ return undefined
105
+ }
106
+ if (
107
+ addressToSend &&
108
+ ( isTokenWithBalancePVM ( selectedToken ) ||
109
+ isTokenWithBalanceAVM ( selectedToken ) )
110
+ ) {
111
+ return xpAddressWithoutPrefix ( addressToSend )
112
+ }
113
+ return addressToSend
114
+ } , [ addressToSend , selectedToken ] )
115
+
101
116
const canSubmit =
102
117
! isSending &&
103
118
amount &&
@@ -201,15 +216,18 @@ export const SendToken = ({ onSend }: { onSend: () => void }): JSX.Element => {
201
216
{ recipient . name }
202
217
</ Text >
203
218
) }
204
- { addressToSend && (
219
+ { addressToSendWithoutPrefix && (
205
220
< Text
206
221
variant = "mono"
207
222
numberOfLines = { 1 }
208
223
sx = { {
209
224
fontSize : 13 ,
210
225
color : colors . $textSecondary
211
226
} } >
212
- { truncateAddress ( addressToSend , TRUNCATE_ADDRESS_LENGTH ) }
227
+ { truncateAddress (
228
+ addressToSendWithoutPrefix ,
229
+ TRUNCATE_ADDRESS_LENGTH
230
+ ) }
213
231
</ Text >
214
232
) }
215
233
</ View >
0 commit comments