public class AccountService extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
Result<List<String>> |
createAccount(int count,
String password)
Create accounts
批量创建账户
|
Result |
createMultiSignAccount(List<String> pubKeys,
int minSigns) |
Result<List<AccountDto>> |
createOffLineAccount(int chainId,
int count,
String prefix,
String password) |
Result<List<AccountDto>> |
createOffLineAccount(int count,
String password)
Create encrypted off-line accounts
批量创建离线账户
|
Result |
exportKeyStore(String address,
String password,
String filePath) |
Result |
getAccountBalance(String address,
int chainId,
int assetsId)
获取账户余额
|
static byte[] |
getAddress(String addressString) |
Result |
getAddressByPriKey(String priKey) |
static AccountService |
getInstance() |
Result |
getPriKey(String address,
String password) |
Result |
getPriKeyOffline(String address,
String encryptedPriKey,
String password)
get unencrypted private-key
获取原始私钥
|
Result |
importKeystore(AccountKeyStoreDto keyStore,
String password) |
Result |
importPriKey(String priKey,
String password)
导入私钥
|
Result |
multiSign(int chainId,
String prefix,
String address,
String encryptedPrivateKey,
String password,
String txHex) |
Result |
multiSign(SignDto signDto,
String txHex) |
Result |
resetPassword(String address,
String oldPassword,
String newPassword) |
Result |
resetPasswordOffline(String address,
String encryptedPriKey,
String oldPassword,
String newPassword)
Change the off-line account password by encryptedPriKey and passowrd
|
Result |
setAlias(String address,
String alias,
String password) |
Result |
sign(int chainId,
String prefix,
List<SignDto> signDtoList,
String txHex) |
Result |
sign(List<SignDto> signDtoList,
String txHex)
sign the tx's digest
|
Result |
sign(String txHex,
int chainId,
String prefix,
String address,
String encryptedPrivateKey,
String password) |
Result |
validateAddress(int chainId,
String address) |
public static AccountService getInstance()
public Result<List<String>> createAccount(int count, String password)
count - The number of accounts you want to createpassword - The password of the accountpublic Result<List<AccountDto>> createOffLineAccount(int count, String password)
count - The number of accounts you want to createpassword - The password of the accountpublic Result<List<AccountDto>> createOffLineAccount(int chainId, int count, String prefix, String password)
public Result getPriKeyOffline(String address, String encryptedPriKey, String password)
address - 账户地址encryptedPriKey - 账户加密后的私钥password - 密码public Result importKeystore(AccountKeyStoreDto keyStore, String password)
public Result resetPasswordOffline(String address, String encryptedPriKey, String oldPassword, String newPassword)
address - The address of accountencryptedPriKey - The encrypted Private KeyoldPassword - The password to use when encrypting the private keynewPassword - The new passwordpublic Result sign(List<SignDto> signDtoList, String txHex)
signDtoList - 签名请求参数public Result sign(String txHex, int chainId, String prefix, String address, String encryptedPrivateKey, String password)
public Result multiSign(int chainId, String prefix, String address, String encryptedPrivateKey, String password, String txHex)
public Result getAccountBalance(String address, int chainId, int assetsId)
address - 地址public Result importPriKey(String priKey, String password)
priKey - 私钥password - 导入私钥后,给私钥设置的密码public static byte[] getAddress(String addressString)
Copyright © 2021. All rights reserved.