public class EthereumWalletService extends Object implements org.picocontainer.Startable
| Modifier and Type | Field and Description |
|---|---|
static String |
ABI_PATH_PARAMETER |
static String |
ADDRESS_KEY_NAME |
static String |
BIN_PATH_PARAMETER |
static String |
DEFAULT_ACCESS_PERMISSION |
static String |
DEFAULT_BLOCKS_TO_RETRIEVE |
static String |
DEFAULT_CONTRACTS_ADDRESSES |
static String |
DEFAULT_GAS |
static String |
DEFAULT_NETWORK_ID |
static String |
DEFAULT_NETWORK_URL |
static String |
DEFAULT_NETWORK_WS_URL |
static String |
GLOBAL_SETTINGS_KEY_NAME |
static String |
LAST_BLOCK_NUMBER_KEY_NAME |
static String |
SCOPE_NAME |
static String |
SETTINGS_KEY_NAME |
static String |
WALLET_BROWSER_PHRASE_NAME |
static org.exoplatform.commons.api.settings.data.Context |
WALLET_CONTEXT |
static String |
WALLET_DEFAULT_CONTRACTS_NAME |
static org.exoplatform.commons.api.settings.data.Scope |
WALLET_SCOPE |
static String |
WALLET_USER_TRANSACTION_NAME |
| Constructor and Description |
|---|
EthereumWalletService(org.exoplatform.commons.api.settings.SettingService settingService,
org.exoplatform.social.core.space.spi.SpaceService spaceService,
org.exoplatform.social.core.manager.IdentityManager identityManager,
org.exoplatform.services.listener.ListenerService listenerService,
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<String> |
getAccountTransactions(Long networkId,
String address)
Get list of transaction hashes per user
|
org.json.JSONArray |
getContractAbi()
Get Contract ABI
|
String |
getContractBinary()
Get Contract BINARY to deploy
|
ContractDetail |
getDefaultContractDetail(String address,
Long networkId)
Get default contract detail
|
List<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
|
String |
getUserAddress(String id)
Get associated address to a user
|
AccountDetail |
getUserDetails(String id)
Retrieve User account details DTO
|
boolean |
removeDefaultContract(String address,
Long networkId)
Removes a contract address from default contracts displayed in wallet of
all users
|
void |
requestFunds(FundsRequest fundsRequest)
Request funds
|
void |
saveAccountTransaction(Long networkId,
String address,
String hash)
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 |
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 static final String DEFAULT_NETWORK_ID
public static final String DEFAULT_NETWORK_URL
public static final String DEFAULT_NETWORK_WS_URL
public static final String DEFAULT_ACCESS_PERMISSION
public static final String DEFAULT_GAS
public static final String DEFAULT_BLOCKS_TO_RETRIEVE
public static final String DEFAULT_CONTRACTS_ADDRESSES
public static final String SCOPE_NAME
public static final String GLOBAL_SETTINGS_KEY_NAME
public static final String ADDRESS_KEY_NAME
public static final String LAST_BLOCK_NUMBER_KEY_NAME
public static final String SETTINGS_KEY_NAME
public static final org.exoplatform.commons.api.settings.data.Context WALLET_CONTEXT
public static final org.exoplatform.commons.api.settings.data.Scope WALLET_SCOPE
public static final String WALLET_DEFAULT_CONTRACTS_NAME
public static final String WALLET_USER_TRANSACTION_NAME
public static final String WALLET_BROWSER_PHRASE_NAME
public static final String ABI_PATH_PARAMETER
public static final String BIN_PATH_PARAMETER
public EthereumWalletService(org.exoplatform.commons.api.settings.SettingService settingService,
org.exoplatform.social.core.space.spi.SpaceService spaceService,
org.exoplatform.social.core.manager.IdentityManager identityManager,
org.exoplatform.services.listener.ListenerService listenerService,
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 List<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)
networkId - address - hash - public List<String> getAccountTransactions(Long networkId, String address)
networkId - address - public void requestFunds(FundsRequest fundsRequest) throws IllegalAccessException
fundsRequest - IllegalAccessExceptionCopyright © 2003–2018 eXo Platform SAS. All rights reserved.