类 AccountService
- java.lang.Object
-
- network.nerve.kit.service.AccountService
-
public class AccountService extends Object
-
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 Result<List<String>>createAccount(int count, String password)Create accounts 批量创建账户ResultcreateMultiSignAccount(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 批量创建离线账户ResultexportKeyStore(String address, String password, String filePath)ResultgetAccountBalance(String address, int chainId, int assetsId)获取账户余额static byte[]getAddress(String addressString)ResultgetAddressByPriKey(String priKey)static AccountServicegetInstance()ResultgetPriKey(String address, String password)ResultgetPriKeyOffline(String address, String encryptedPriKey, String password)get unencrypted private-key 获取原始私钥ResultimportKeystore(AccountKeyStoreDto keyStore, String password)ResultimportPriKey(String priKey, String password)导入私钥ResultmultiSign(int chainId, String prefix, String address, String encryptedPrivateKey, String password, String txHex)ResultmultiSign(SignDto signDto, String txHex)ResultresetPassword(String address, String oldPassword, String newPassword)ResultresetPasswordOffline(String address, String encryptedPriKey, String oldPassword, String newPassword)Change the off-line account password by encryptedPriKey and passowrdResultsetAlias(String address, String alias, String password)Resultsign(int chainId, String prefix, List<SignDto> signDtoList, String txHex)Resultsign(String txHex, int chainId, String prefix, String address, String encryptedPrivateKey, String password)Resultsign(List<SignDto> signDtoList, String txHex)sign the tx's digestResultvalidateAddress(int chainId, String address)
-
-
-
方法详细资料
-
getInstance
public static AccountService getInstance()
-
createAccount
public Result<List<String>> createAccount(int count, String password)
Create accounts 批量创建账户- 参数:
count- The number of accounts you want to createpassword- The password of the account- 返回:
- result
-
createOffLineAccount
public Result<List<AccountDto>> createOffLineAccount(int count, String password)
Create encrypted off-line accounts 批量创建离线账户- 参数:
count- The number of accounts you want to createpassword- The password of the account- 返回:
- result
-
createOffLineAccount
public Result<List<AccountDto>> createOffLineAccount(int chainId, int count, String prefix, String password)
-
getPriKeyOffline
public Result getPriKeyOffline(String address, String encryptedPriKey, String password)
get unencrypted private-key 获取原始私钥- 参数:
address- 账户地址encryptedPriKey- 账户加密后的私钥password- 密码- 返回:
- Result
-
importKeystore
public Result importKeystore(AccountKeyStoreDto keyStore, String password)
-
resetPasswordOffline
public Result resetPasswordOffline(String address, String encryptedPriKey, String oldPassword, String newPassword)
Change the off-line account password by encryptedPriKey and passowrd- 参数:
address- The address of accountencryptedPriKey- The encrypted Private KeyoldPassword- The password to use when encrypting the private keynewPassword- The new password- 返回:
- Result
-
sign
public Result sign(List<SignDto> signDtoList, String txHex)
sign the tx's digest- 参数:
signDtoList- 签名请求参数- 返回:
- result
-
sign
public Result sign(String txHex, int chainId, String prefix, String address, String encryptedPrivateKey, String password)
-
multiSign
public Result multiSign(int chainId, String prefix, String address, String encryptedPrivateKey, String password, String txHex)
-
getAccountBalance
public Result getAccountBalance(String address, int chainId, int assetsId)
获取账户余额- 参数:
address- 地址- 返回:
- result
-
importPriKey
public Result importPriKey(String priKey, String password)
导入私钥- 参数:
priKey- 私钥password- 导入私钥后,给私钥设置的密码- 返回:
- result
-
getAddress
public static byte[] getAddress(String addressString)
-
-