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

EthereumWallet

Jason Anton edited this page Aug 1, 2018 · 1 revision

EthereumWallet

Kind: global class Todo

  • Offer other network connections and host our own master node.

new EthereumWallet()

Sets our web3 connection to ganache

ethereumWallet.changeNetwork(network)

Sets the active web3 connection

Kind: instance method of EthereumWallet

Param Type Description
network String The type of connection.

ethereumWallet.createWallet() ⇒ Object

Sets the active crypto for use.

Kind: instance method of EthereumWallet Returns: Object - - The full wallet object.

ethereumWallet.importWallet(privateKey) ⇒ Object

Imports an existing wallet from the private key.

Kind: instance method of EthereumWallet Returns: Object - - The full wallet object.

Param Type Description
privateKey String The private key we're restoring.

ethereumWallet.getTransactionCount(addr) ⇒ Number

Gets the number of transactions based on address.

Kind: instance method of EthereumWallet Returns: Number - - The number of transactions.

Param Type Description
addr String The address to query.

ethereumWallet.getBalance(addr) ⇒ Promise.<Number>

Gets the balance of an address.

Kind: instance method of EthereumWallet Returns: Promise.<Number> - - The address balance.

Param Type Description
addr String The address to query.

ethereumWallet.createTransaction(toAddr, val, wallet) ⇒ Promise.<Object>

Creates and signs a new transaction.

Kind: instance method of EthereumWallet Returns: Promise.<Object> - - Confirmation of the set crypto type.

Param Type Description
toAddr String The recipient address
val Number The amount of ETH.
wallet Object The full wallet object.

ethereumWallet.sendTransaction(data) ⇒ String

Broadcasts a previously signed transaction to the blockchain.

Kind: instance method of EthereumWallet Returns: String - - The transaction hash returned from the blockchain.

Param Type Description
data String The raw transaction data hash.