diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..efd718508 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +src/lib/core diff --git a/package.json b/package.json index 3012e8e7e..252b2768b 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "@react-navigation/native": "^6.0.4", "@react-navigation/stack": "^6.0.9", "@rsksmart/rif-id-ethr-did": "^0.1.0", - "@rsksmart/rif-id-mnemonic": "^0.1.0", + "@rsksmart/rif-id-mnemonic": "^0.1.1", + "@rsksmart/rlogin-dpath": "^1.0.1", "@rsksmart/rsk-contract-metadata": "^1.0.15", "@rsksmart/rsk-testnet-contract-metadata": "^1.0.11", "buffer": "^4.9.2", diff --git a/src/App.tsx b/src/App.tsx index 23db58544..2e30a7c7a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4,7 +4,7 @@ import { NavigationProp, ParamListBase } from '@react-navigation/native' import Button from './components/button' import { Header1, Header2, Paragraph } from './components/typography' -import { Account, Wallet } from './lib/core' +import { RIFWallet } from './lib/core/RIFWallet' import { WalletProviderContext } from './state/AppContext' import { removeStorage, StorageKeys } from './storage' @@ -19,17 +19,23 @@ const WalletApp: React.FC = ({ navigation }) => { // Temporary component state: interface componentStateI { confirmResponse?: string - wallet?: Wallet + wallet?: RIFWallet } - const [wallet, setWallet] = useState(undefined) - const [accounts, setAccounts] = useState([]) + const [wallet, setWallet] = useState([]) + const [mnemonic, setMnemonic] = useState('') const context = useContext(WalletProviderContext) useEffect(() => { - setWallet(context.wallet) - }, [context.wallet, wallet]) + context.wallets && setWallet(context.wallets) + }, [context.wallets]) + useEffect(() => { + console.log('setting Mnemonic', context.getMnemonic()) + setMnemonic(context.getMnemonic()) + }, [context.wallets]) + + /* const addAccount = () => { if (wallet) { wallet @@ -37,24 +43,26 @@ const WalletApp: React.FC = ({ navigation }) => { .then(account => setAccounts(accounts.concat(account))) } } + */ - const seeSmartWallet = (account: Account) => + const seeSmartWallet = (account: RIFWallet) => navigation.navigate('SmartWallet', { account }) return ( sWallet - Wallet: - {wallet && } + KMS: + - Accounts: - {accounts.map((account: Account, index: number) => { + RIF Wallets: + {wallet.map((account: RIFWallet, index: number) => { return ( - + EOA Address +