Giter Site home page Giter Site logo

fantom-foundation / fantom-mobile-app Goto Github PK

View Code? Open in Web Editor NEW
15.0 10.0 15.0 64.51 MB

Mobile wallet and payments application for Fantom Opera chain. Deprecated in favour of Fantom-PWA-Wallet.

License: MIT License

JavaScript 94.74% Python 0.96% Java 1.66% Objective-C 2.64%

fantom-mobile-app's Introduction

Fantom Wallet

Introduction

This is the repository for the Fantom Wallet mobile application.

Technology Stack

  • React v16.4.1
  • React-Native v0.56.0
  • Redux v4.0.0
  • react-navigation v2.11.2

Installation

You will need Node.js, Watchman, the React Native command line interface, and Xcode.

Node, Watchman We recommend installing Node and Watchman using Homebrew. Run the following commands in a Terminal after installing Homebrew:

brew install node@10
brew install watchman

The React Native CLI Node.js comes with npm, which lets you install the React Native command line interface.

npm i react-native

Alternatively, you can use yarn:

yarn global add react-native-cli

Setup

npm install
npm run jetify

Alternatively, use yarn:

yarn install
yarn run jetify

iOS SETUP

Xcode

The easiest way to install Xcode is via the Mac App Store. Installing Xcode will also install the iOS Simulator and all the necessary tools to build your iOS app.

run on iOS using command

react-native run-ios

or you can run directly from xcode.

ANDROID SETUP

  1. Download and install Android Studio

Android Studio provides the Android SDK and AVD (emulator) required to run and test your React Native apps.

  • Android Studio requires the Java SE Development Kit(JDK), version 8. You can type javac -version in a terminal to see what version you have, if any.
$ javac -version
javac 1.8.0_111
  • The version string 1.8.x_xxx corresponds to JDK 8.
  1. Install the AVD and HAXM

Choose Custom installation when running Android Studio for the first time. Make sure the boxes next to all of the following are checked:

> Android SDK
> Android SDK Platform
> Performance (Intel ® HAXM)
> Android Virtual Device
> Then, click "Next" to install all of these components.
  • If you've already installed Android Studio before, you can still install HAXM without performing a custom installation.
  1. Install the Android 6.0 (Marshmallow) SDK

Android Studio installs the most recent Android SDK by default. React Native, however, requires the Android 6.0 (Marshmallow) SDK. To install it, launch the SDK Manager, click on "Configure" in the "Welcome to Android Studio" screen.

For more detail visit: https://facebook.github.io/react-native/docs/getting-started

  1. run using command
react-native run-android

Running on Device

To run the app on device, please follow instructions here

fantom-mobile-app's People

Contributors

abhardwaj-innow8 avatar dependabot[bot] avatar kapilbindal1 avatar komal0508 avatar komal3794 avatar ksinnow8 avatar maninder-kaur7 avatar mkong avatar neeraj0007 avatar sameekshajn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fantom-mobile-app's Issues

Test transfers on Testnet and wallet functionality

Here is the genesis account for the testnet with some existing FTM testnet coin:

Pub: 0xFD00A5fE03CB4672e4380046938cFe5A18456Df4
Priv: 50c4bf4dde1f383a172f52cb4624f089f685e67e00c6741a3ae03826c99cf082

You should first go through wallet creation process (which already exists) then transfer coin from the account above to that address (testing the transfer function) then you can test transferring between different wallets on different phones.

Thus, you should have working:

  1. Testnet transfers, and

  2. Ability to add wallet accounts to the testnet.

Is there anything else I'm missing?

Address Book Functionality

On the "Address Book" screen, i.e:

screenshot 2018-08-26 19 44 41

After payment is send to an address, save that address in the address book (i.e use AsyncStorage, so save the data onto the phone itself). You save a name to be associated with that particular address, but the name won't be save onto the blockchain, but into the phone itself.

You can also manually add to the address book:

screenshot 2018-08-26 19 47 41

And save to AsyncStorage too.

redirect to create wallet screen if not wallet is present

if no wallet private key can be found ie.

  getMasterKey() {
    const masterKeyTest = AsyncStorage.getItem('masterPrivateKey');
    console.log('getMasterKey');
    console.log(masterKeyTest);
  }

Returns False , the redirect to createWallet screen to create a new wallet.

If it returns True, redirect to home screen.

Add validation for checking wallet address (EIP-55)

Integrate the following check from the EIP-55 standard:

https://ethereum.stackexchange.com/questions/1374/how-can-i-check-if-an-ethereum-address-is-valid

/**
 * Checks if the given string is an address
 *
 * @method isAddress
 * @param {String} address the given HEX adress
 * @return {Boolean}
*/
var isAddress = function (address) {
    if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) {
        // check if it has the basic requirements of an address
        return false;
    } else if (/^(0x)?[0-9a-f]{40}$/.test(address) || /^(0x)?[0-9A-F]{40}$/.test(address)) {
        // If it's all small caps or all all caps, return true
        return true;
    } else {
        // Otherwise check each case
        return isChecksumAddress(address);
    }
};

/**
 * Checks if the given string is a checksummed address
 *
 * @method isChecksumAddress
 * @param {String} address the given HEX adress
 * @return {Boolean}
*/
var isChecksumAddress = function (address) {
    // Check each case
    address = address.replace('0x','');
    var addressHash = sha3(address.toLowerCase());
    for (var i = 0; i < 40; i++ ) {
        // the nth letter should be uppercase if the nth digit of casemap is 1
        if ((parseInt(addressHash[i], 16) > 7 && address[i].toUpperCase() !== address[i]) || (parseInt(addressHash[i], 16) <= 7 && address[i].toLowerCase() !== address[i])) {
            return false;
        }
    }
    return true;
};

Fix `npm install` warnings and errors (running node v = 10.9.0)

> [email protected] install /Users/michaelkong/dev/fantom_final_app/wallet/app/node_modules/fsevents
> node install

[fsevents] Success: "/Users/michaelkong/dev/fantom_final_app/wallet/app/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> [email protected] install /Users/michaelkong/dev/fantom_final_app/wallet/app/node_modules/node-sass
> node scripts/install.js

Cached binary found at /Users/michaelkong/.npm/node-sass/4.9.3/darwin-x64-64_binding.node

> [email protected] postinstall /Users/michaelkong/dev/fantom_final_app/wallet/app/node_modules/node-sass
> node scripts/build.js

Binary found at /Users/michaelkong/dev/fantom_final_app/wallet/app/node_modules/node-sass/vendor/darwin-x64-64/binding.node
Testing binary
Binary is fine

> [email protected] postinstall /Users/michaelkong/dev/fantom_final_app/wallet/app
> yarn electron-rebuild

yarn run v1.9.4
$ node -r babel-register ../internals/scripts/ElectronRebuild.js
internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module 'babel-register'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at Module._preloadModules (internal/modules/cjs/loader.js:805:12)
    at preloadModules (internal/bootstrap/node.js:575:7)
    at startup (internal/bootstrap/node.js:256:9)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `yarn electron-rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/michaelkong/.npm/_logs/2018-09-07T16_07_01_093Z-debug.log
Michaels-MacBook-Pro:app michaelkong$ cd ..
Michaels-MacBook-Pro:wallet michaelkong$ clear
Michaels-MacBook-Pro:wallet michaelkong$ npm install
npm WARN deprecated [email protected]: Switch to the `bfj` package for fixes and new features!
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.

> [email protected] install /Users/michaelkong/dev/fantom_final_app/wallet/node_modules/fsevents
> node install

[fsevents] Success: "/Users/michaelkong/dev/fantom_final_app/wallet/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> [email protected] install /Users/michaelkong/dev/fantom_final_app/wallet/node_modules/electron-chromedriver
> node ./download-chromedriver.js

successfully dowloaded and extracted!

> [email protected] install /Users/michaelkong/dev/fantom_final_app/wallet/node_modules/husky
> node ./bin/install.js

husky
setting up Git hooks
done


> [email protected] install /Users/michaelkong/dev/fantom_final_app/wallet/node_modules/node-sass
> node scripts/install.js

Cached binary found at /Users/michaelkong/.npm/node-sass/4.9.3/darwin-x64-64_binding.node

> [email protected] postinstall /Users/michaelkong/dev/fantom_final_app/wallet/node_modules/electron
> node install.js


> [email protected] postinstall /Users/michaelkong/dev/fantom_final_app/wallet/node_modules/node-sass
> node scripts/build.js

Binary found at /Users/michaelkong/dev/fantom_final_app/wallet/node_modules/node-sass/vendor/darwin-x64-64/binding.node
Testing binary
Binary is fine

> [email protected] postinstall /Users/michaelkong/dev/fantom_final_app/wallet
> node -r babel-register internals/scripts/CheckNativeDep.js && yarn flow-typed && yarn build-dll && electron-builder install-app-deps package.json

yarn run v1.9.4
$ rimraf flow-typed/npm && flow-typed install --overwrite || true
• Found 89 dependencies in package.json to install libdefs for. Searching...
• rebasing flow-typed cache...
ERROR: Unable to rebase the local cache repo. Error rebasing the `master` branch of the following repo:
/Users/michaelkong/.flow-typed/repo

undefined

NOTE: Unable to rebase local cache! If you don't currently have internet connectivity, no worries -- we'll update the local cache the next time you do.

• Installing 16 libDefs...
  • babel-register_v6.x.x.js
    └> ./flow-typed/npm/babel-register_v6.x.x.js
babel-register
/Users/michaelkong/dev/fantom_final_app/wallet/flow-typed/npm
  • chalk_v2.x.x.js
    └> ./flow-typed/npm/chalk_v2.x.x.js
chalk
/Users/michaelkong/dev/fantom_final_app/wallet/flow-typed/npm
  • history_v4.x.x.js
    └> ./flow-typed/npm/history_v4.x.x.js
history
/Users/michaelkong/dev/fantom_final_app/wallet/flow-typed/npm
  • classnames_v2.x.x.js
    └> ./flow-typed/npm/classnames_v2.x.x.js
classnames
/Users/michaelkong/dev/fantom_final_app/wallet/flow-typed/npm
  • enzyme_v3.x.x.js
    └> ./flow-typed/npm/enzyme_v3.x.x.js
enzyme
/Users/michaelkong/dev/fantom_final_app/wallet/flow-typed/npm
  • flow-bin_v0.x.x.js
    └> ./flow-typed/npm/flow-bin_v0.x.x.js
flow-bin
/Users/michaelkong/dev/fantom_final_app/wallet/flow-typed/npm
  • express_v4.16.x.js
    └> ./flow-typed/npm/express_v4.16.x.js
express
/Users/michaelkong/dev/fantom_final_app/wallet/flow-typed/npm
  • jest_v23.x.x.js
    └> ./flow-typed/npm/jest_v23.x.x.js
jest
/Users/michaelkong/dev/fantom_final_app/wallet/flow-typed/npm
  • react-router_v4.x.x.js
    └> ./flow-typed/npm/react-router_v4.x.x.js
react-router
/Users/michaelkong/dev/fantom_final_app/wallet/flow-typed/npm
  • react-router-dom_v4.x.x.js
    └> ./flow-typed/npm/react-router-dom_v4.x.x.js
react-router-dom
/Users/michaelkong/dev/fantom_final_app/wallet/flow-typed/npm
  • minimist_v1.x.x.js
    └> ./flow-typed/npm/minimist_v1.x.x.js
minimist
/Users/michaelkong/dev/fantom_final_app/wallet/flow-typed/npm
  • react-redux_v5.x.x.js
    └> ./flow-typed/npm/react-redux_v5.x.x.js
react-redux
/Users/michaelkong/dev/fantom_final_app/wallet/flow-typed/npm
  • redux_v4.x.x.js
    └> ./flow-typed/npm/redux_v4.x.x.js
redux
/Users/michaelkong/dev/fantom_final_app/wallet/flow-typed/npm
  • prettier_v1.x.x.js
    └> ./flow-typed/npm/prettier_v1.x.x.js
prettier
/Users/michaelkong/dev/fantom_final_app/wallet/flow-typed/npm
  • react-test-renderer_v16.x.x.js
    └> ./flow-typed/npm/react-test-renderer_v16.x.x.js
react-test-renderer
/Users/michaelkong/dev/fantom_final_app/wallet/flow-typed/npm
  • rimraf_v2.x.x.js
    └> ./flow-typed/npm/rimraf_v2.x.x.js
rimraf
/Users/michaelkong/dev/fantom_final_app/wallet/flow-typed/npm
• Generating stubs for untyped dependencies...
  • electron-debug@^2.0.0
    └> flow-typed/npm/electron-debug_vx.x.x.js
  • source-map-support@^0.5.6
    └> flow-typed/npm/source-map-support_vx.x.x.js
  • babel-plugin-dev-expression@^0.2.1
    └> flow-typed/npm/babel-plugin-dev-expression_vx.x.x.js
  • enzyme-to-json@^3.3.4
    └> flow-typed/npm/enzyme-to-json_vx.x.x.js
  • eslint-formatter-pretty@^1.3.0
    └> flow-typed/npm/eslint-formatter-pretty_vx.x.x.js
  • eslint-import-resolver-webpack@^0.10.1
    └> flow-typed/npm/eslint-import-resolver-webpack_vx.x.x.js
  • stylelint-config-standard@^18.2.0
    └> flow-typed/npm/stylelint-config-standard_vx.x.x.js
  • npm-logical-tree@^1.2.1
    └> flow-typed/npm/npm-logical-tree_vx.x.x.js
  • react-hot-loader@^4.3.4
    └> flow-typed/npm/react-hot-loader_vx.x.x.js
  • redux-thunk@^2.3.0
    └> flow-typed/npm/redux-thunk_vx.x.x.js
  • react-router-redux@^5.0.0-alpha.6
    └> flow-typed/npm/react-router-redux_vx.x.x.js
  • babel-jest@^23.4.2
    └> flow-typed/npm/babel-jest_vx.x.x.js
  • babel-plugin-add-module-exports@^0.2.1
    └> flow-typed/npm/babel-plugin-add-module-exports_vx.x.x.js
  • babel-preset-env@^1.7.0
    └> flow-typed/npm/babel-preset-env_vx.x.x.js
  • babel-plugin-transform-class-properties@^6.24.1
    └> flow-typed/npm/babel-plugin-transform-class-properties_vx.x.x.js
  • babel-preset-react@^6.24.1
    └> flow-typed/npm/babel-preset-react_vx.x.x.js
  • babel-preset-stage-0@^6.24.1
    └> flow-typed/npm/babel-preset-stage-0_vx.x.x.js
  • babel-preset-react-optimize@^1.0.1
    └> flow-typed/npm/babel-preset-react-optimize_vx.x.x.js
  • detect-port@^1.2.3
    └> flow-typed/npm/detect-port_vx.x.x.js
  • enzyme-adapter-react-16@^1.1.1
    └> flow-typed/npm/enzyme-adapter-react-16_vx.x.x.js
  • electron-devtools-installer@^2.2.4
    └> flow-typed/npm/electron-devtools-installer_vx.x.x.js
  • eslint-config-prettier@^2.9.0
    └> flow-typed/npm/eslint-config-prettier_vx.x.x.js
  • file-loader@^1.1.11
    └> flow-typed/npm/file-loader_vx.x.x.js
  • eslint-config-airbnb@^17.0.0
    └> flow-typed/npm/eslint-config-airbnb_vx.x.x.js
  • redux-logger@^3.0.6
    └> flow-typed/npm/redux-logger_vx.x.x.js
  • lint-staged@^7.2.0
    └> flow-typed/npm/lint-staged_vx.x.x.js
  • mini-css-extract-plugin@^0.4.1
    └> flow-typed/npm/mini-css-extract-plugin_vx.x.x.js
  • webpack-cli@^3.1.0
    └> flow-typed/npm/webpack-cli_vx.x.x.js
  • sass-loader@^7.0.3
    └> flow-typed/npm/sass-loader_vx.x.x.js
  • spectron@^3.8.0
    └> flow-typed/npm/spectron_vx.x.x.js
  • style-loader@^0.21.0
    └> flow-typed/npm/style-loader_vx.x.x.js
  • webpack-merge@^4.1.3
    └> flow-typed/npm/webpack-merge_vx.x.x.js
  • yarn@^1.9.2
    └> flow-typed/npm/yarn_vx.x.x.js
  • @fortawesome/fontawesome-free@^5.2.0
    └> flow-typed/npm/@fortawesome/fontawesome-free_vx.x.x.js
  • babel-eslint@^8.2.6
    └> flow-typed/npm/babel-eslint_vx.x.x.js
  • babel-loader@^7.1.5
    └> flow-typed/npm/babel-loader_vx.x.x.js
  • bootstrap@^4.1.3
    └> flow-typed/npm/bootstrap_vx.x.x.js
  • babel-plugin-transform-es2015-classes@^6.24.1
    └> flow-typed/npm/babel-plugin-transform-es2015-classes_vx.x.x.js
  • cross-env@^5.2.0
    └> flow-typed/npm/cross-env_vx.x.x.js
  • reactstrap@^6.4.0
    └> flow-typed/npm/reactstrap_vx.x.x.js
  • concurrently@^3.6.1
    └> flow-typed/npm/concurrently_vx.x.x.js
  • cross-spawn@^6.0.5
    └> flow-typed/npm/cross-spawn_vx.x.x.js
  • css-loader@^1.0.0
    └> flow-typed/npm/css-loader_vx.x.x.js
  • electron-builder@^20.26.0
    └> flow-typed/npm/electron-builder_vx.x.x.js
  • eslint-plugin-compat@^2.5.1
    └> flow-typed/npm/eslint-plugin-compat_vx.x.x.js
  • fbjs-scripts@^0.8.3
    └> flow-typed/npm/fbjs-scripts_vx.x.x.js
  • eslint-plugin-react@^7.10.0
    └> flow-typed/npm/eslint-plugin-react_vx.x.x.js
  • husky@^0.14.3
    └> flow-typed/npm/husky_vx.x.x.js
  • eslint-plugin-promise@^3.8.0
    └> flow-typed/npm/eslint-plugin-promise_vx.x.x.js
  • [email protected]
    └> flow-typed/npm/uglifyjs-webpack-plugin_vx.x.x.js
  • identity-obj-proxy@^3.0.0
    └> flow-typed/npm/identity-obj-proxy_vx.x.x.js
  • eslint-plugin-import@^2.13.0
    └> flow-typed/npm/eslint-plugin-import_vx.x.x.js
  • url-loader@^1.0.1
    └> flow-typed/npm/url-loader_vx.x.x.js
  • webpack-bundle-analyzer@^2.13.1
    └> flow-typed/npm/webpack-bundle-analyzer_vx.x.x.js
  • webpack-dev-server@^3.1.5
    └> flow-typed/npm/webpack-dev-server_vx.x.x.js
  • eslint@^5.2.0
    └> flow-typed/npm/eslint_vx.x.x.js
  • devtron@^1.4.0
    └> flow-typed/npm/devtron_vx.x.x.js
  • electron-rebuild@^1.8.2
    └> flow-typed/npm/electron-rebuild_vx.x.x.js
  • eslint-plugin-flowtype@^2.50.0
    └> flow-typed/npm/eslint-plugin-flowtype_vx.x.x.js
  • flow-typed@^2.5.1
    └> flow-typed/npm/flow-typed_vx.x.x.js
  • eslint-plugin-jest@^21.18.0
    └> flow-typed/npm/eslint-plugin-jest_vx.x.x.js
  • webpack@^4.16.3
    └> flow-typed/npm/webpack_vx.x.x.js
  • stylelint@^9.4.0
    └> flow-typed/npm/stylelint_vx.x.x.js
  • optimize-css-assets-webpack-plugin@^5.0.0
    └> flow-typed/npm/optimize-css-assets-webpack-plugin_vx.x.x.js
  • babel-core@^6.26.3
    └> flow-typed/npm/babel-core_vx.x.x.js
  • flow-runtime@^0.17.0
    └> flow-typed/npm/flow-runtime_vx.x.x.js
  • [email protected]
    └> flow-typed/npm/eslint-plugin-jsx-a11y_vx.x.x.js
  • sinon@^6.1.4
    └> flow-typed/npm/sinon_vx.x.x.js
  • babel-plugin-flow-runtime@^0.17.0
    └> flow-typed/npm/babel-plugin-flow-runtime_vx.x.x.js
  • node-sass@^4.9.2
    └> flow-typed/npm/node-sass_vx.x.x.js
  • electron@^2.0.6
    └> flow-typed/npm/electron_vx.x.x.js

!! No [email protected] libdefs found in flow-typed for the above untyped dependencies !!

I've generated `any`-typed stubs for these packages, but consider submitting
libdefs for them to https://github.com/flowtype/flow-typed/

✨  Done in 11.17s.
yarn run v1.9.4
$ cross-env NODE_ENV=development node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.renderer.dev.dll.js --colors
Hash: 807d894989b06d3b6712
Version: webpack 4.17.2
Time: 957ms
Built at: 09/08/2018 1:08:09 AM
              Asset      Size    Chunks             Chunk Names
renderer.dev.dll.js  1.41 MiB  renderer  [emitted]  renderer
Entrypoint renderer = renderer.dev.dll.js
[./node_modules/electron-debug sync recursive] ./node_modules/electron-debug sync 160 bytes {renderer} [built]
[./node_modules/webpack/buildin/harmony-module.js] (webpack)/buildin/harmony-module.js 573 bytes {renderer} [built]
[classnames] external "classnames" 42 bytes {renderer} [built]
[electron] external "electron" 42 bytes {renderer} [built]
[fs] external "fs" 42 bytes {renderer} [built]
[module] external "module" 42 bytes {renderer} [built]
[path] external "path" 42 bytes {renderer} [built]
[reactstrap] external "reactstrap" 42 bytes {renderer} [built]
[0] dll renderer 12 bytes {renderer} [built]
    + 118 hidden modules

WARNING in ./node_modules/electron-debug/index.js 101:45-58
Critical dependency: the request of a dependency is an expression
 @ dll renderer

WARNING in ./node_modules/electron-debug/index.js 102:61-74
Critical dependency: the request of a dependency is an expression
 @ dll renderer

ERROR in ./node_modules/bootstrap/dist/js/bootstrap.js
Module not found: Error: Can't resolve 'jquery' in '/Users/michaelkong/dev/fantom_final_app/wallet/node_modules/bootstrap/dist/js'
 @ ./node_modules/bootstrap/dist/js/bootstrap.js 7:82-99
 @ dll renderer
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node -r babel-register internals/scripts/CheckNativeDep.js && yarn flow-typed && yarn build-dll && electron-builder install-app-deps package.json`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/michaelkong/.npm/_logs/2018-09-07T16_08_09_399Z-debug.log

Implement endpoints to new testnet

I need you to connect the app also to the new testnet endpoints.

Please see the following documentation:

// node.js
const axios = require('axios');

const EthereumTx = require('ethereumjs-tx')
const privateKey = Buffer.from('50c4bf4dde1f383a172f52cb4624f089f685e67e00c6741a3ae03826c99cf082', 'hex')

const txParams = {
  nonce: '0x00',
  gasPrice: '0x09184e72a000',
  gasLimit: '0x27100',
  to: '0xFD00A5fE03CB4672e4380046938cFe5A18456Df4',
  value: '0x00',
  data: '0x',
  // EIP 155 chainId - mainnet: 1, ropsten: 3
  chainId: 1
}

const tx = new EthereumTx(txParams)
tx.sign(privateKey)
const serializedTx = tx.serialize()
const hexTx = '0x' + serializedTx.toString('hex')

axios.post('http://18.221.128.6:8080/sendRawTransaction', hexTx)
.then(function (response) {
  console.log(response.data);
})
.catch(function (error) {
  console.log(error);
});

//50c4bf4dde1f383a172f52cb4624f089f685e67e00c6741a3ae03826c99cf082:0xFD00A5fE03CB4672e4380046938cFe5A18456Df4
//7c9d2f34f5869204fe8232442bc2280a613601783fab2b936cf91a054668537a:0xfd9AB87eCEdC912A63f5B8fa3b8d7667d33Fd981

// http://18.221.128.6:8080/account/629007eb99ff5c3539ada8a5800847eacfc25727
// http://18.221.128.6:8080/sendRawTransaction
// http://18.221.128.6:8080/transactions
// http://18.221.128.6:8080/accounts
// http://18.221.128.6:8080/transaction/{}
// http://18.221.128.6:8080/account/{}

http://18.221.128.6:8080/account/0xFD00A5fE03CB4672e4380046938cFe5A18456Df4
{"address":"0xFD00A5fE03CB4672e4380046938cFe5A18456Df4","balance":9999790000000000000000,"nonce":1}

http://18.221.128.6:8080/transaction/0x68a07a9dc6ff0052e42f4e7afa117e90fb896eda168211f040da69606a2aeddc
{"root":"0x7ed3e21533e05c18ded09e02d7bf6bf812c218a3a7af8c6b5cc23b5cb4951069","transactionHash":"0x68a07a9dc6ff0052e42f4e7afa117e90fb896eda168211f040da69606a2aeddc","from":"0xfd00a5fe03cb4672e4380046938cfe5a18456df4","to":"0xfd00a5fe03cb4672e4380046938cfe5a18456df4","gasUsed":21000,"cumulativeGasUsed":21000,"contractAddress":"0x0000000000000000000000000000000000000000","logs":[],"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","failed":false}

function getNonce(tx) {
  axios.get('http://18.221.128.6:8080/account/'+tx.from)
  .then(function (response) {
    tx.nonce = response.data.nonce
    generateRawTx(tx, priv)
  })
  .catch(function (error) {
    console.log(error);
  });
}

I need you to implement for transfers.

Thanks,
Michael

Add recovery wallet functionality from seeds

  1. Create a new screen based on existing designs that requires you to input 12 words in order (the mnenomic phrases).

  2. Take the inputted words, and generate a new seed:

        menmonicPromise.then((mnemonic) => {
            const seed = Bip39.mnemonicToSeed(mnemonic); //creates seed buffer
            const mnemonicWords = mnemonic.split(' ');
            this.setState({
                mnemonicWords,
                seed: seed,
                loading: false
            })
        });
  1. Follow the HD wallet creation process as before, i.e:
  walletSetup() {
    if(!this.checkValidation()){
      return;
    }
    const root = Hdkey.fromMasterSeed(this.state.seed);
    const masterPrivateKey = root.privateKey.toString('hex');
    const addrNode = root.derive("m/44'/60'/0'/0/0"); //line 1
    const pubKey = EthUtil.privateToPublic(addrNode._privateKey);
    const addr = EthUtil.publicToAddress(pubKey).toString('hex');
    const address = EthUtil.toChecksumAddress(addr);
    const key = {
      'root': root,
      'masterPrivateKey': masterPrivateKey,
      'addrNode': addrNode,
      'pubKey': pubKey,
      'addr': addr,
      'address': address
    };

    const hexPublicKey = EthUtil.bufferToHex(pubKey)
    // Save masterPrivateKey to device DO NOT USE IN PRODUCTION
    this.saveMasterKey(masterPrivateKey, hexPublicKey);
    this.props.setMasterPublicKey(masterPrivateKey, hexPublicKey);
    // Save pubKey generation
    // this.savePublicKey(pubKey);

    this.props.navigation.navigate('HomeScreen');
    /*
       If using ethereumjs-wallet instead do after line 1:
       const address = addrNode.getWallet().getChecksumAddressString();
    */
  };

Remove "122,000\", change text

On the screen below:

img_1981

Remove "122,000"

Change text from "(The wallet will show you recent transactions)" to "(Your recent transactions will be displayed here)"

Fix `estlint app` errors

Please fix all lining errors identified by running eslint app:

✖ 545 problems (545 errors, 0 warnings)
  314 errors and 0 warnings potentially fixable with the `--fix` option.

all field text should be lower case

When I type into each text field, the first letter is already capitalised, and hence the phrase does not pass.

screenshot 2018-08-28 16 11 09

It should always be lower case by default.

Change text for "Secret Mnemonic" screen

"Please write down this new mnemonic, and keep it secret."

Remove "All previous mnemonic will become invalid."

"You may lose your account if your mnemonic is known by others."

45913527-7a79fa00-be77-11e8-9435-e1fc95255698

Add "sendTransction" Functionality to "send" screen

For the "Send" screen:

screenshot 2018-08-26 20 37 59

Please get the following to work with it:

  transferMoney (from, to, value){
    Web3.eth.sendTransaction({
    from: from,
    to: to,
    value: Web3.toWei(value, "ether"),
    }, function(err, transactionHash) {
        if (err) {
            console.log(err);
        } else {
            console.log(transactionHash);
        }
    });
  };

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.