-
Notifications
You must be signed in to change notification settings - Fork 0
EthereumWallet
Kind: global class Todo
- Offer other network connections and host our own master node.
-
EthereumWallet
- new EthereumWallet()
- .changeNetwork(network)
-
.createWallet() ⇒
Object
-
.importWallet(privateKey) ⇒
Object
-
.getTransactionCount(addr) ⇒
Number
-
.getBalance(addr) ⇒
Promise.<Number>
-
.createTransaction(toAddr, val, wallet) ⇒
Promise.<Object>
-
.sendTransaction(data) ⇒
String
Sets our web3 connection to ganache
Sets the active web3 connection
Kind: instance method of EthereumWallet
Param | Type | Description |
---|---|---|
network | String |
The type of connection. |
Sets the active crypto for use.
Kind: instance method of EthereumWallet
Returns: Object
- - The full wallet 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. |
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. |
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. |
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. |
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. |