@@ -60,6 +60,7 @@ import { getError } from 'get-error';
6060import type { AddressAction } from 'src/modules/zerion-api/requests/wallet-get-actions' ;
6161import BigNumber from 'bignumber.js' ;
6262import { useAssetFullInfo } from 'src/modules/zerion-api/hooks/useAssetFullInfo' ;
63+ import { FormFieldset } from 'src/ui/ui-kit/FormFieldset' ;
6364import { TransactionConfiguration } from '../SendTransaction/TransactionConfiguration' ;
6465import { NetworkSelect } from '../Networks/NetworkSelect' ;
6566import { NetworkFeeLineInfo } from '../SendTransaction/TransactionConfiguration/TransactionConfiguration' ;
@@ -163,6 +164,8 @@ function SendFormComponent() {
163164 tokenChain = '' ,
164165 tokenValue = '' ,
165166 addressInputValue = '' ,
167+ data = '' ,
168+ tokenAssetCode = '' ,
166169 } = formState ;
167170 const chain = tokenChain ? createChain ( tokenChain ) : null ;
168171 const currentPosition = useCurrentPosition ( formState , currentPositions ) ;
@@ -210,6 +213,8 @@ function SendFormComponent() {
210213 supportsSponsoredTransactions : network ?. supports_sponsored_transactions ,
211214 } ) ;
212215
216+ const nativeAssetId = network ?. native_asset ?. id ;
217+ const isNativeAsset = tokenAssetCode === nativeAssetId ;
213218 const configuration = useMemo ( ( ) => toConfiguration ( formState ) , [ formState ] ) ;
214219
215220 const snapshotRef = useRef < { state : SendFormState } | null > ( null ) ;
@@ -461,7 +466,7 @@ function SendFormComponent() {
461466 value = { tokenValue }
462467 network = { network }
463468 onChange = { ( value ) => handleChange ( 'tokenValue' , value ) }
464- tokenAssetCode = { formState . tokenAssetCode || null }
469+ tokenAssetCode = { tokenAssetCode || null }
465470 currentItem = { currentPosition ?? null }
466471 items = { currentPositions }
467472 onAssetCodeChange = { ( value ) =>
@@ -478,6 +483,41 @@ function SendFormComponent() {
478483 networkId = { formState . tokenChain || null }
479484 />
480485 ) : null }
486+ { preferences ?. configurableTransactionData &&
487+ isNativeAsset &&
488+ addressType === 'evm' ? (
489+ < FormFieldset
490+ title = "Data"
491+ style = { { borderBottomRightRadius : 4 } }
492+ startInput = {
493+ < textarea
494+ name = "data"
495+ value = { data }
496+ onChange = { ( event ) => {
497+ handleChange ( 'data' , event . currentTarget . value ) ;
498+ } }
499+ style = { {
500+ border : 'none' ,
501+ outline : 'none' ,
502+ backgroundColor : 'transparent' ,
503+ fontSize : 'inherit' ,
504+ fontFamily : 'inherit' ,
505+ fontWeight : 'inherit' ,
506+ fontStyle : 'inherit' ,
507+ lineHeight : 'inherit' ,
508+ padding : 16 ,
509+ paddingTop : 0 ,
510+ width : 'calc(100% + 32px)' ,
511+ marginLeft : - 16 ,
512+ marginBottom : - 16 ,
513+ resize : 'vertical' ,
514+ } }
515+ rows = { 2 }
516+ placeholder = "0x..."
517+ />
518+ }
519+ />
520+ ) : null }
481521 </ VStack >
482522 </ VStack >
483523 </ form >
0 commit comments