import React, { useState } from 'react'; import { View } from 'react-native'; import { Button, Text, TextInput } from 'react-native-paper'; import { NativeStackScreenProps } from '@react-navigation/native-stack'; import { StackParamsList } from '../types'; import styles from '../styles/stylesheet'; import { signMessage } from '../utils/sign-message'; import AccountDetails from '../components/AccountDetails'; type SignProps = NativeStackScreenProps; const SignMessage = ({ route }: SignProps) => { const namespace = route.params.selectedNamespace; const chainId = route.params.selectedChainId; const account = route.params.accountInfo; const [message, setMessage] = useState(''); const signMessageHandler = async () => { const signedMessage = await signMessage({ message, namespace, chainId, accountId: account.index, }); alert(`Signature ${signedMessage}`); }; return ( {account && `Account ${account.index + 1}`} setMessage(text)} value={message} /> ); }; export default SignMessage;