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 { accountFromHDPath } from '../utils'; type HDPathProps = NativeStackScreenProps; const HDPath: React.FC = ({}) => { const [path, setPath] = useState(''); const [account, setAccount] = useState(null); const [isAccountCreating, setIsAccountCreating] = useState(false); const createFromHDPathHandler = async () => { setIsAccountCreating(true); const newAccount = await accountFromHDPath(path); setIsAccountCreating(false); setAccount(newAccount); Alert.alert('Account Created'); }; return ( Enter the HD Path: setPath(text)} value={path} /> {account && ( <> Address: {account.address} Public Key: {account.pubKey} )} ); }; export default HDPath;