import React, { useState } from 'react'; import { ScrollView, View, Alert } from 'react-native'; import { Button, Text, TextInput } from 'react-native-paper'; import { NativeStackScreenProps } from '@react-navigation/native-stack'; import { StackParamsList } from '../types'; import { signMessage } from '../utils'; type SignProps = NativeStackScreenProps; const SignMessage = ({ route }: SignProps) => { const network = route.params?.selectedNetwork; const account = route.params?.accountInfo; const [message, setMessage] = useState(''); const signMessageHandler = async () => { if (network) { if (!account){ throw new Error("Account is not valid"); } const signedMessage = await signMessage(message, network, account.id); Alert.alert('Signature', signedMessage); } }; return ( Address: {account && account.address} Public Key: {account && account.pubKey} setMessage(text)} value={message} /> ); }; export default SignMessage;