1

Using React js i am trying to create a wallet

I want to implement few functionalities 1) display balances of all the accounts 2) Display tokens by providing smart contract address

how can i implement this wallet functionality using reactjs??

closed as too broad by Richard Horrocks, eth Nov 2 '17 at 9:48

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Your question is too broad. Could you be more specific? What kind of problem you have? – Зелёный Nov 2 '17 at 7:17
  • I want to develop ethereum wallet using reactjs. In 1st i want to display balances, import wallets... normal wallet functionalities. I am new to react please help me out to start proceeding. My first task is to display balances – user4498 Nov 2 '17 at 7:24
  • Did you tried npmjs.com/package/ethereumjs-wallet ? – Kaviyarasu Arasu Nov 2 '17 at 7:30
3

Basic JavaScript works perfectly fine in React. The most popular Ethereum JS library today seems to be the Web3 JavaScript API. Review their API to find your solutions and specifically balance requests.


Ethers.js is another fantastic library. Here is a snippet of code from our apps.

/* Import the ethers.js library. */
import ethers from 'ethers'

/* Initialize ethers classes. */
const _wallet    = ethers.Wallet
const _hdNode    = ethers.HDNode
const _providers = ethers.providers
const _utils     = ethers.utils

/* Connect to Ropsten (the test network). */
const TESTNET = false

/* Set the default provider. */
const PROVIDER = _providers.getDefaultProvider(TESTNET)

/* Retrieve the balance from a wallet address. */
const getBalanceByAddress = function (address) {
    return PROVIDER.getBalance(address)
        .then(balance => {
            /* Balance is a BigNumber (in wei). */
            let etherString = _utils.formatEther(balance)

            return etherString
        })
}

Importing / exporting wallets and building / sending transactions can be done from either library as well. Good luck!

Not the answer you're looking for? Browse other questions tagged or ask your own question.