Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Commit

Permalink
feature
Browse files Browse the repository at this point in the history
  • Loading branch information
EDY authored and EDY committed Nov 2, 2021
1 parent 5913183 commit 7ff2757
Show file tree
Hide file tree
Showing 284 changed files with 68,369 additions and 10,456 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Getting Started

- Make sure you have a [GitHub account](https://github.com/signup/free).
- Submit an issue to [Clover-wallet's Github issues](https://github.com/clover-network/clover-wallet/issues)
- Submit an issue to [fusotao-wallet's Github issues](https://github.com/uinb/fusotao-wallet/issues)
- If the issue is a bug, clearly describe the issue including steps to reproduce.
- If you have a feature request, specify why it's requested and how the feature should work.
- Fork the repository on GitHub and create a pull request.
6 changes: 3 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@

In accordance with Section 7(b) of the GNU Affero General Public License,
a covered work must retain the producer line in every User Interface that is
created or manipulated using clover wallet.
created or manipulated using fusotao wallet.

You can be released from the requirements of the license by purchasing
a commercial license. Buying such a license is mandatory as soon as you
develop commercial activities involving clover wallet without disclosing the source
develop commercial activities involving fusotao wallet without disclosing the source
code of your own applications.

These activities include: offering paid services to customers as an ASP,
signing transactions, account balances, transaction management on the fly
in a web application, HTML5 components, Web Extensions for any blockchain
shipping clover wallet codebase or part of codebase with a closed source product.
shipping fusotao wallet codebase or part of codebase with a closed source product.

For more information, please contact BlockX Labs at [email protected]
90 changes: 16 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Clover Wallet

Clover Wallet is a wallet for for [Polkadot blockchain.](https://polkadot.network/)

Clover Wallet is currently a work in progress, so changes will occur.
# TokenKeeper

TokenKeeper is a wallet browser extension for [FUSOTAO](https://github.com/uinb/fusotao) and other blockchains(in the future).

## Prerequisites

Expand All @@ -12,86 +9,31 @@ Clover Wallet is currently a work in progress, so changes will occur.

## Get It

Once published Clover Wallet will be installable from the Chrome Web Store. Until then, it can be run via yarn by cloning this repo. Unpacked builds will be made available at [https://github.com/clover-network/clover-wallet](https://github.com/clover-network/clover-wallet) shortly.
Once published, TokenKeeper would be available in the Chrome and Firefox Web Store. Until then, it can be run via yarn by cloning this repo. Unpacked builds will be made available at [https://github.com/uinb/token-keeper](https://github.com/uinb/token-keeper) shortly.

### Installation

Execute the following to clone, install dependencies, and run a development server:

git clone https://github.com/clover-network/clover-wallet.git
cd clover-wallet
yarn install
yarn run dev
```
git clone https://github.com/uinb/token-keeper.git
cd token-keeper
yarn install
yarn run dev
```

Once running Chrome:
Launch Chrome and do the following steps:

- Go to chrome://extensions
- Enable 'Developer Mode' (top right corner of window)
- Click "Load Unpacked" and select the clover-wallet/dev/chrome directory
- Navigate to : https://localhost:3000 and accept the https connection
- Click "Load Unpacked" and select the token-keeper/dev/chrome directory
- Navigate to: https://localhost:3001 and accept the https connection

The Clover Wallet icon should show up in your Chrome toolbar.
The TokenKeeper icon should show up in your Chrome toolbar.

Once running Firefox:
If you prefer Firefox, refer to the following steps:

- Go to about:debugging#/runtime/this-firefox
- Click 'Load Temporary Addon'
- select the clover-wallet/dev/firefox directory
- Navigate to : https://localhost:3000 and accept the https connection

The Clover Wallet icon should show up in your Firefox toolbar.

## Getting Started

### Initial Setup

After agreeing to the Terms of Use, create a strong password. This is used to encrypt your data so that other Chrome extensions can't read it.

<img src="./docs/images/password.png" width="300">

If you want to start fresh, use the newly-generated account. Copy the seed phrase and save it somewhere safe (as it is required to send DOTs and sign transactions).

<img src="./docs/images/generate.png" width="300">

If you have an existing account you want to use, click the Import tab and paste your existing seed phrase in.

<img src="./docs/images/import.png" width="300">

## Usage

### Dashboard
See labels on screenshot.

<img src="./docs/images/1-fresh-annotated.png" width="300">


### Receive
Just click Receive from the main screen to get here.

Either scan the QR code, or copy and paste the account address by clicking it.

<img src="./docs/images/2-receive.png" width="300">


### Send

Input the details

<img src="./docs/images/4-send-1-annotated.png" width="300">

Verify the details

<img src="./docs/images/5-send-2-annotated.png" width="300">

Once sent, wait for it to confirm.

<img src="./docs/images/6-pending-annotated.png" width="300">

It has confirmed.

<img src="./docs/images/7-success.png" width="300">


## Links

License: [AGPL v3](https://github.com/clover-network/clover-wallet/blob/master/LICENSE.md)
- select the token-keeper/dev/firefox directory
- Navigate to : https://localhost:3001 and accept the https connection
38 changes: 19 additions & 19 deletions app/actions/account.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
import * as AccountActionTypes from '../constants/account';
import * as AddressBookActionTypes from '../constants/address-book';
import { Account } from '../api';
import { getDummyBalanceObject } from '../utils/helper';
import * as AccountActionTypes from "../constants/account";
import * as AddressBookActionTypes from "../constants/address-book";
import { Account } from "../api";
import { getDummyBalanceObject } from "../utils/helper";

export const selectTokenAction = selectedToken => ({
export const selectTokenAction = (selectedToken) => ({
type: AccountActionTypes.SELECT_TOKEN,
selectedToken,
});

export const updateAccountList = accounts => ({
export const updateAccountList = (accounts) => ({
type: AccountActionTypes.ADD_ACCOUNT,
accounts,
});

export const updateFullChainAccountList = fullChainAccounts => ({
export const updateFullChainAccountList = (fullChainAccounts) => ({
type: AccountActionTypes.ADD_FULL_CHAIN_ACCOUNT,
fullChainAccounts,
});

export const updateContactList = addressBook => ({
export const updateContactList = (addressBook) => ({
type: AddressBookActionTypes.UPDATE_ADDRESS_BOOK_LIST,
addressBook,
});

export const changeSelectedAccount = account => ({
export const changeSelectedAccount = (account) => ({
type: AccountActionTypes.SELECT_ACCOUNT,
account,
});

export const updateAccountBalance = balances => ({
export const updateAccountBalance = (balances) => ({
type: AccountActionTypes.UPDATE_ACCOUNT_BALANCE,
balances,
});

export const updateSelectedAccountBalance = balance => ({
export const updateSelectedAccountBalance = (balance) => ({
type: AccountActionTypes.UPDATE_SELECTED_ACCOUNT_BALANCE,
balance,
});

export const updateIsLinkToBlockxLabFaucet = isLinkToFaucet => ({
export const updateIsLinkToBlockxLabFaucet = (isLinkToFaucet) => ({
type: AccountActionTypes.UPDATE_IS_LINK_TO_BLOCKXLABS_FAUCET,
isLinkToFaucet,
});

export const setSeedWords = seedWords => ({
export const setSeedWords = (seedWords) => ({
type: AccountActionTypes.SET_SEED_WORDS,
seedWords,
});
Expand All @@ -52,7 +52,7 @@ export const resetSeedWords = () => ({
type: AccountActionTypes.RESET_SEED_WORDS,
});

export const fetchAndSetAccounts = async dispatch => {
export const fetchAndSetAccounts = async (dispatch) => {
const {
result: { accounts, currentAccount, fullChainAccounts },
} = await Account.getAccounts();
Expand All @@ -65,10 +65,10 @@ export const fetchAndSetBalances = async (dispatch, getState) => {
const { accounts, account } = getState().accountReducer;
const addrArray = accounts.map(({ address }) => address);
const { result: balances } = await Account.getCurrentBalance(addrArray);
const balObj = balances.find(acc => acc.address === account.address);
const balObj = balances.find((acc) => acc.address === account.address);
// Link Faucets with No Transaction yet.
const { network } = getState().networkReducer;
const isLinkToFaucet = network.faucetUrl && balObj.balance === '0';
const isLinkToFaucet = network.faucetUrl && balObj.balance === "0";
dispatch(updateAccountBalance(balances));
dispatch(updateSelectedAccountBalance(balObj));
dispatch(updateIsLinkToBlockxLabFaucet(isLinkToFaucet));
Expand All @@ -81,20 +81,20 @@ export const setInitialBalance = async (dispatch, getState) => {
dispatch(updateSelectedAccountBalance(balance));
};

export const getSeedWords = () => async dispatch => {
export const getSeedWords = () => async (dispatch) => {
const seedWords = await Account.getSeedWords();
if (seedWords !== undefined) {
dispatch(setSeedWords(seedWords));
}
};

export const fetchAndSetContacts = async dispatch => {
export const fetchAndSetContacts = async (dispatch) => {
const {
result: { addressBook },
} = await Account.getContacts();
dispatch(updateContactList(addressBook));
};

export const selectToken = selectedToken => async dispatch => {
export const selectToken = (selectedToken) => async (dispatch) => {
dispatch(selectTokenAction(selectedToken));
};
3 changes: 3 additions & 0 deletions app/actions/dapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export const navigateAndServiceIfDappRequest = () => async dispatch => {
if (enableRequest) {
dispatch(setEnableRequest(enableRequest));
dispatch(AppActions.changePage(NavConstants.CONNECT_REQUEST_PAGE));
} else if (requests.find(r => r.request.opts.method === 'eth_sendTransaction')) {
dispatch(setDAppRequests(requests));
dispatch(AppActions.changePage(NavConstants.DAPP_WEB3_REQUESTS_PAGE));
} else {
dispatch(setDAppRequests(requests));
dispatch(AppActions.changePage(NavConstants.DAPP_REQUESTS_PAGE));
Expand Down
6 changes: 4 additions & 2 deletions app/actions/initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ export const onBoard = () => async dispatch => {
const { isAgree } = await dispatch(verifyTermsVersion());
if (!isAgree) {
dispatch(AppActions.updateAppLoading(false));
dispatch(AppActions.changePage(NavConstants.ENTRY_PAGE));
// dispatch(AppActions.changePage(NavConstants.TERMS_PAGE));
dispatch(AppActions.changePage(NavConstants.TERMS_PAGE));
} else {
await dispatch(AccountActions.fetchAndSetAccounts);
const { result } = await OnBoarding.getIsAppOnBoarded();
Expand All @@ -30,6 +29,9 @@ export const onBoard = () => async dispatch => {
case APIConstants.UNAUTHORIZED:
dispatch(AppActions.changePage(NavConstants.SIGN_IN_PAGE));
break;
case APIConstants.FAILURE:
dispatch(AppActions.changePage(NavConstants.SIGN_IN_PAGE));
break;
case APIConstants.BAD_REQUEST:
dispatch(AppActions.changePage(NavConstants.SIGN_UP_PAGE));
break;
Expand Down
24 changes: 15 additions & 9 deletions app/api/account.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as MessageTypes from '../../lib/constants/message-types';
import { sendMessage } from '../../lib/services/extension/messages';
import { throwIfNoSuccess } from './helper';
import * as MessageTypes from "../../lib/constants/message-types";
import { sendMessage } from "../../lib/services/extension/messages";
import { throwIfNoSuccess } from "./helper";

export const getSeedWords = async () => {
const { message, status, result } = await sendMessage({
Expand All @@ -10,7 +10,12 @@ export const getSeedWords = async () => {
return result;
};

export const createAccount = async (seedWords, isOnBoarding = false, keypairType, alias) => {
export const createAccount = async (
seedWords,
isOnBoarding = false,
keypairType,
alias
) => {
const { message, status, result } = await sendMessage({
type: MessageTypes.BG_ACCOUNTS_CREATE_ACCOUNT,
seedWords,
Expand Down Expand Up @@ -38,7 +43,7 @@ export const getAccounts = async () => {
return { result };
};

export const getCurrentBalance = async addresses => {
export const getCurrentBalance = async (addresses) => {
const { message, status, result } = await sendMessage({
type: MessageTypes.BG_ACCOUNT_BALANCE,
addresses,
Expand All @@ -57,7 +62,7 @@ export const updateAccountAlias = async (alias, address) => {
return { result };
};

export const updateCurrentAccount = async address => {
export const updateCurrentAccount = async (address) => {
const { message, status, result } = await sendMessage({
type: MessageTypes.BG_CURRENT_ACCOUNTS_UPDATE,
address,
Expand All @@ -66,16 +71,17 @@ export const updateCurrentAccount = async address => {
return result;
};

export const removeAccount = async address => {
export const removeAccount = async (address, alias) => {
const { message, status, result } = await sendMessage({
type: MessageTypes.BG_ACCOUNTS_REMOVE_ACCOUNT,
address,
alias,
});
throwIfNoSuccess({ message, status });
return { result };
};

export const submitContact = async contact => {
export const submitContact = async (contact) => {
const { message, status, result } = await sendMessage({
type: MessageTypes.BG_ADDRESS_BOOK_ADD,
contact,
Expand All @@ -92,7 +98,7 @@ export const getContacts = async () => {
return { result };
};

export const removeContact = async contact => {
export const removeContact = async (contact) => {
const { message, status, result } = await sendMessage({
type: MessageTypes.BG_ADDRESS_BOOK_REMOVE,
contact,
Expand Down
Loading

0 comments on commit 7ff2757

Please sign in to comment.