本文整理汇总了Java中org.ethereum.geth.Accounts类的典型用法代码示例。如果您正苦于以下问题:Java Accounts类的具体用法?Java Accounts怎么用?Java Accounts使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Accounts类属于org.ethereum.geth包,在下文中一共展示了Accounts类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getAccounts
import org.ethereum.geth.Accounts; //导入依赖的package包/类
public static List<Account> getAccounts() {
ArrayList<Account> list = new ArrayList<>();
Accounts accounts = keyStore.getAccounts();
if (accounts == null) {
return list;
}
for (int i = 0; i < accounts.size(); i++) {
try {
list.add(accounts.get(i));
} catch (Exception ignored) {
ignored.printStackTrace();
}
}
return list;
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:18,代码来源:CredentialManager.java
示例2: fetchAccounts
import org.ethereum.geth.Accounts; //导入依赖的package包/类
@Override
public Single<Wallet[]> fetchAccounts() {
return Single.fromCallable(() -> {
Accounts accounts = keyStore.getAccounts();
int len = (int) accounts.size();
Wallet[] result = new Wallet[len];
for (int i = 0; i < len; i++) {
org.ethereum.geth.Account gethAccount = accounts.get(i);
result[i] = new Wallet(gethAccount.getAddress().getHex().toLowerCase());
}
return result;
})
.subscribeOn(Schedulers.io());
}
开发者ID:TrustWallet,项目名称:trust-wallet-android,代码行数:16,代码来源:GethKeystoreAccountService.java
示例3: findAccount
import org.ethereum.geth.Accounts; //导入依赖的package包/类
private org.ethereum.geth.Account findAccount(String address) throws ServiceException {
Accounts accounts = keyStore.getAccounts();
int len = (int) accounts.size();
for (int i = 0; i < len; i++) {
try {
android.util.Log.d("ACCOUNT_FIND", "Address: " + accounts.get(i).getAddress().getHex());
if (accounts.get(i).getAddress().getHex().equalsIgnoreCase(address)) {
return accounts.get(i);
}
} catch (Exception ex) {
/* Quietly: interest only result, maybe next is ok. */
}
}
throw new ServiceException("Wallet with address: " + address + " not found");
}
开发者ID:TrustWallet,项目名称:trust-wallet-android,代码行数:16,代码来源:GethKeystoreAccountService.java
示例4: getAccounts
import org.ethereum.geth.Accounts; //导入依赖的package包/类
public List<Account> getAccounts() throws Exception {
List<Account> ret = new ArrayList<>();
Accounts accounts = keystore.getAccounts();
for (int i = 0; i < accounts.size(); i++) {
ret.add(accounts.get(i));
}
return ret;
}
开发者ID:ethmobile,项目名称:ethdroid,代码行数:9,代码来源:KeyManager.java
注:本文中的org.ethereum.geth.Accounts类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论