public class EthereumWalletService extends Object implements org.picocontainer.Startable
| Modifier and Type | Class and Description |
|---|---|
static interface |
EthereumWalletService.ServiceContext<V> |
| Constructor and Description |
|---|
EthereumWalletService(org.exoplatform.commons.api.settings.SettingService settingService,
org.exoplatform.social.core.space.spi.SpaceService spaceService,
org.exoplatform.commons.api.notification.service.storage.WebNotificationStorage webNotificationStorage,
org.exoplatform.social.core.manager.IdentityManager identityManager,
org.exoplatform.services.listener.ListenerService listenerService,
org.exoplatform.portal.config.UserACL userACL,
org.exoplatform.services.cache.CacheService cacheService,
org.exoplatform.container.ExoContainer exoContainer,
org.exoplatform.container.configuration.ConfigurationManager configurationManager,
org.exoplatform.container.xml.InitParams params) |
| Modifier and Type | Method and Description |
|---|---|
AccountDetail |
getAccountDetailsByAddress(String address)
Retrieve User or Space account details DTO by wallet address
|
List<org.json.JSONObject> |
getAccountTransactions(Long networkId,
String address)
Get list of transaction hashes per user
|
String |
getContract(String name,
String extension)
Retreive the ABI content of a contract
|
org.json.JSONArray |
getContractAbi()
Get Contract ABI
|
String |
getContractBinary()
Get Contract BINARY to deploy
|
ContractDetail |
getDefaultContractDetail(String address,
Long networkId)
Get default contract detail
|
Set<String> |
getDefaultContractsAddresses(Long networkId)
Retrieves the list of default contract addreses
|
long |
getLastWatchedBlockNumber(long networkId)
Returns last watched block
|
GlobalSettings |
getSettings()
Retrieves global stored settings used for all users.
|
GlobalSettings |
getSettings(Long networkId)
Retrieves global stored settings.
|
GlobalSettings |
getSettings(Long networkId,
String spaceId)
Retrieves global stored settings.
|
String |
getSpaceAddress(String id)
Get associated address to a space
|
AccountDetail |
getSpaceDetails(String id)
Retrieve Space account details DTO
|
TransactionDetail |
getTransactionDetailFromCache(String transactionHash)
Get temporary stored transaction details from cache
|
String |
getUserAddress(String id)
Get associated address to a user
|
AccountDetail |
getUserDetails(String id)
Retrieve User account details DTO
|
boolean |
isFundRequestSent(String notificationId,
String currentUser)
Get fund request status
|
Set<AccountDetail> |
listWallets()
Retrieves the list registered wallets
|
void |
markFundRequestAsSent(String notificationId,
String currentUser)
Mark a fund request web notification as sent
|
boolean |
removeDefaultContract(String address,
Long networkId)
Removes a contract address from default contracts displayed in wallet of
all users
|
TransactionDetail |
removeTransactionDetailFromCache(String hash)
Remove transaction message object
|
void |
requestFunds(FundsRequest fundsRequest)
Request funds
|
void |
saveAccountTransaction(Long networkId,
String address,
String hash,
boolean sender)
Save transaction hash for an account
|
void |
saveDefaultContract(ContractDetail contractDetail)
Save a new contract address to display it in wallet of all users and save
contract name and symbol
|
void |
saveLastWatchedBlockNumber(long networkId,
long lastWatchedBlockNumber)
Save last watched block
|
void |
saveSettings(GlobalSettings newGlobalSettings)
Save global settings
|
void |
saveTransactionDetail(TransactionDetail transactionMessage)
Save temporary transaction label and message and save transaction hash in
sender and receiver account
|
void |
saveUserPreferences(String userId,
UserPreferences userPreferences)
Save user preferences of Wallet
|
String |
saveWalletAddress(AccountDetail accountDetail)
Save wallet address to currentUser or to a space managed to current user,
switch details in accountDetail parameter
|
void |
start() |
void |
stop() |
public EthereumWalletService(org.exoplatform.commons.api.settings.SettingService settingService,
org.exoplatform.social.core.space.spi.SpaceService spaceService,
org.exoplatform.commons.api.notification.service.storage.WebNotificationStorage webNotificationStorage,
org.exoplatform.social.core.manager.IdentityManager identityManager,
org.exoplatform.services.listener.ListenerService listenerService,
org.exoplatform.portal.config.UserACL userACL,
org.exoplatform.services.cache.CacheService cacheService,
org.exoplatform.container.ExoContainer exoContainer,
org.exoplatform.container.configuration.ConfigurationManager configurationManager,
org.exoplatform.container.xml.InitParams params)
public void start()
start in interface org.picocontainer.Startablepublic void stop()
stop in interface org.picocontainer.Startablepublic org.json.JSONArray getContractAbi()
public String getContractBinary()
public void saveSettings(GlobalSettings newGlobalSettings)
newGlobalSettings - public GlobalSettings getSettings()
public GlobalSettings getSettings(Long networkId)
networkId - public GlobalSettings getSettings(Long networkId, String spaceId)
networkId - spaceId - public void saveDefaultContract(ContractDetail contractDetail)
contractDetail - public boolean removeDefaultContract(String address, Long networkId)
address - networkId - public ContractDetail getDefaultContractDetail(String address, Long networkId)
address - networkId - public Set<String> getDefaultContractsAddresses(Long networkId)
networkId - public void saveUserPreferences(String userId, UserPreferences userPreferences)
userPreferences - public AccountDetail getSpaceDetails(String id)
id - AccountDetailpublic AccountDetail getUserDetails(String id)
id - public AccountDetail getAccountDetailsByAddress(String address)
address - public String getSpaceAddress(String id)
id - public String getUserAddress(String id)
id - public String saveWalletAddress(AccountDetail accountDetail) throws Exception
accountDetail - IllegalAccessExceptionExceptionpublic long getLastWatchedBlockNumber(long networkId)
networkId - public void saveLastWatchedBlockNumber(long networkId,
long lastWatchedBlockNumber)
networkId - lastWatchedBlockNumber - public void saveAccountTransaction(Long networkId, String address, String hash, boolean sender)
networkId - address - hash - sender - public List<org.json.JSONObject> getAccountTransactions(Long networkId, String address)
networkId - address - public void requestFunds(FundsRequest fundsRequest) throws IllegalAccessException
fundsRequest - IllegalAccessExceptionpublic void markFundRequestAsSent(String notificationId, String currentUser) throws IllegalAccessException
notificationId - currentUser - IllegalAccessException - if current user is not the targetted user of
notificationpublic boolean isFundRequestSent(String notificationId, String currentUser) throws IllegalAccessException
notificationId - currentUser - IllegalAccessException - if current user is not the targetted user of
notificationpublic Set<AccountDetail> listWallets() throws Exception
Exceptionpublic void saveTransactionDetail(TransactionDetail transactionMessage)
transactionMessage - public TransactionDetail getTransactionDetailFromCache(String transactionHash)
transactionHash - public TransactionDetail removeTransactionDetailFromCache(String hash)
hash - Copyright © 2003–2018 eXo Platform SAS. All rights reserved.