diff --git a/.env b/.env.example similarity index 96% rename from .env rename to .env.example index 9ee31bb..c039d12 100644 --- a/.env +++ b/.env.example @@ -1,2 +1 @@ WALLET_CONNECT_PROJECT_ID= - diff --git a/.gitignore b/.gitignore index 0cab2ac..3e7715f 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,5 @@ yarn-error.log # testing /coverage + +.env diff --git a/README.md b/README.md index f1dab0e..5027bd4 100644 --- a/README.md +++ b/README.md @@ -81,11 +81,18 @@ yarn ``` -4. In [.env](./.env) file add WalletConnect project id. You can generate your own ProjectId at https://cloud.walletconnect.com +4. Setup .env + - Copy and update [`.env`](./.env) - ``` - WALLET_CONNECT_PROJECT_ID=39bc93c... - ``` + ``` + cp .env.example .env + ``` + + - In [.env](./.env) file add WalletConnect project id. You can generate your own ProjectId at https://cloud.walletconnect.com + + ``` + WALLET_CONNECT_PROJECT_ID=39bc93c... + ``` 5. Set up the Android device: diff --git a/src/components/Accounts.tsx b/src/components/Accounts.tsx index f483b5b..e46f346 100644 --- a/src/components/Accounts.tsx +++ b/src/components/Accounts.tsx @@ -134,7 +134,8 @@ const Accounts = ({ currentIndex, updateIndex }: AccountsProps) => { diff --git a/src/components/CreateWallet.tsx b/src/components/CreateWallet.tsx index d3814e7..5ba0708 100644 --- a/src/components/CreateWallet.tsx +++ b/src/components/CreateWallet.tsx @@ -15,6 +15,7 @@ const CreateWallet = ({ diff --git a/src/components/HDPath.tsx b/src/components/HDPath.tsx index f9d6633..b590d1e 100644 --- a/src/components/HDPath.tsx +++ b/src/components/HDPath.tsx @@ -88,7 +88,8 @@ const HDPath = ({ diff --git a/src/components/PairingModal.tsx b/src/components/PairingModal.tsx index ae09041..a9b0b90 100644 --- a/src/components/PairingModal.tsx +++ b/src/components/PairingModal.tsx @@ -229,7 +229,11 @@ const PairingModal = ({ - diff --git a/src/screens/AddNetwork.tsx b/src/screens/AddNetwork.tsx index 823583c..3ddb10c 100644 --- a/src/screens/AddNetwork.tsx +++ b/src/screens/AddNetwork.tsx @@ -56,20 +56,19 @@ const AddNetwork = () => { chain => chain.chainId === Number(chainId), ); if (!ethChainDetails) { - reset({ chainId: chainId }); return; } setValue('networkName', ethChainDetails.name); setValue('rpcUrl', ethChainDetails.rpc[0]); - setValue('blockExplorerUrl', ethChainDetails.explorers![0].url); + setValue('blockExplorerUrl', ethChainDetails.explorers?.[0].url || ''); setValue('coinType', String(ethChainDetails.slip44)); setValue('currencySymbol', ethChainDetails.nativeCurrency.symbol); + return; } const cosmosChainDetails = chains.find( ({ chain_id }) => chain_id === chainId, ); if (!cosmosChainDetails) { - reset({ chainId: chainId }); return; } setValue('networkName', cosmosChainDetails.pretty_name); @@ -152,6 +151,10 @@ const AddNetwork = () => { fetchChainDetails(watchChainId); }, [watchChainId, fetchChainDetails]); + useEffect(() => { + reset(); + }, [namespace, reset]); + return ( // TODO: get form data from json file diff --git a/src/screens/SignRequest.tsx b/src/screens/SignRequest.tsx index 291c86f..9357145 100644 --- a/src/screens/SignRequest.tsx +++ b/src/screens/SignRequest.tsx @@ -282,7 +282,8 @@ const SignRequest = ({ route }: SignRequestProps) => {