Package io.keyko.nevermined.api.impl
Class AccountsImpl
- java.lang.Object
-
- io.keyko.nevermined.api.impl.AccountsImpl
-
- All Implemented Interfaces:
AccountsAPI
public class AccountsImpl extends Object implements AccountsAPI
Implementation of AccountsAPI
-
-
Field Summary
Fields Modifier and Type Field Description private AccountsManageraccountsManager
-
Constructor Summary
Constructors Constructor Description AccountsImpl(AccountsManager accountsManager)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Balancebalance(Account account)Returns the Balance of an accountList<Account>list()Returns a list of the accounts registered in KeeperFaucetResponserequestEthFromFaucet(String address)Requests Ether to faucet for paying transactions gasorg.web3j.protocol.core.methods.response.TransactionReceiptrequestTokens(BigInteger amount)Requests Nevermined Tokens
-
-
-
Field Detail
-
accountsManager
private AccountsManager accountsManager
-
-
Constructor Detail
-
AccountsImpl
public AccountsImpl(AccountsManager accountsManager)
Constructor- Parameters:
accountsManager- the accountsManager
-
-
Method Detail
-
list
public List<Account> list() throws EthereumException
Description copied from interface:AccountsAPIReturns a list of the accounts registered in Keeper- Specified by:
listin interfaceAccountsAPI- Returns:
- a List of all Account registered in Keeper
- Throws:
EthereumException- EthereumException
-
balance
public Balance balance(Account account) throws EthereumException
Description copied from interface:AccountsAPIReturns the Balance of an account- Specified by:
balancein interfaceAccountsAPI- Parameters:
account- the account we want to get the balance- Returns:
- the Balance of the account
- Throws:
EthereumException- EthereumException
-
requestEthFromFaucet
public FaucetResponse requestEthFromFaucet(String address) throws ServiceException
Description copied from interface:AccountsAPIRequests Ether to faucet for paying transactions gas- Specified by:
requestEthFromFaucetin interfaceAccountsAPI- Parameters:
address- the account address requesting ETH- Returns:
- FaucetResponse response status and message
- Throws:
ServiceException- ServiceException
-
requestTokens
public org.web3j.protocol.core.methods.response.TransactionReceipt requestTokens(BigInteger amount) throws EthereumException
Description copied from interface:AccountsAPIRequests Nevermined Tokens- Specified by:
requestTokensin interfaceAccountsAPI- Parameters:
amount- the amount of tokens- Returns:
- a TransactionReceipt from the transaction sent to the smart contract
- Throws:
EthereumException- EthereumException
-
-