public class NerveSDKTool extends Object
| 构造器和说明 |
|---|
NerveSDKTool() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Result |
broadcast(String txHex) |
static Map<String,BigInteger> |
calcCrossTransferTxFee(CrossTransferTxFeeDto dto)
已过时。
|
static BigInteger |
calcMultiSignTransferTxFee(MultiSignTransferTxFeeDto dto) |
static BigInteger |
calcTransferTxFee(TransferTxFeeDto dto) |
static Result<List<String>> |
createAccount(int count,
String password) |
static Result |
createAliasTxOffline(AliasDto dto) |
static Result |
createCrossTransferTxOffline(TransferDto transferDto)
跨链交易
|
static Result |
createCrossTxSimpleTransferOfNonNvtNuls(String fromAddress,
String toAddress,
int assetChainId,
int assetId,
BigInteger amount)
跨链交易
便捷版 组装跨链转账非[NULS和NVT]资产的单账户对单账户普通跨链转账(不能用于转NULS和NVT),用于将资产转入NULS主网。
|
static Result |
createCrossTxSimpleTransferOfNonNvtNuls(String fromAddress,
String toAddress,
int assetChainId,
int assetId,
BigInteger amount,
long time,
String remark)
跨链交易
便捷版 组装跨链转账非[NULS和NVT]资产的单账户对单账户普通跨链转账(不能用于转NULS和NVT),用于将资产转入NULS主网。
|
static Result |
createCrossTxSimpleTransferOfNuls(String fromAddress,
String toAddress,
BigInteger amount)
跨链交易
便捷版 组装跨链转账NULS资产的单账户对单账户跨链转账,用于将NULS资产转入NULS主网(只能用于转NULS)。
|
static Result |
createCrossTxSimpleTransferOfNuls(String fromAddress,
String toAddress,
BigInteger amount,
long time,
String remark)
跨链交易
便捷版 组装跨链转账NULS资产的单账户对单账户跨链转账,用于将NULS资产转入NULS主网(只能用于转NULS)。
|
static Result |
createCrossTxSimpleTransferOfNvt(String fromAddress,
String toAddress,
BigInteger amount)
跨链交易
便捷版 组装跨链转账NVT资产的单账户对单账户跨链转账,用于将NVT资产转入NULS主网(只能用于转NVT)。
|
static Result |
createCrossTxSimpleTransferOfNvt(String fromAddress,
String toAddress,
BigInteger amount,
long time,
String remark)
跨链交易
便捷版 组装跨链转账NVT资产的单账户对单账户跨链转账,用于将NVT资产转入NULS主网(只能用于转NVT)。
|
static Result |
createMultiSignAccount(List<String> pubKeys,
int minSigns) |
static Result |
createMultiSignAliasTxOffline(MultiSignAliasDto dto) |
static Result |
createMultiSignTransferTxOffline(MultiSignTransferDto transferDto) |
static Result<List<AccountDto>> |
createOffLineAccount(int chainId,
int count,
String prefix,
String password) |
static Result<List<AccountDto>> |
createOffLineAccount(int count,
String password) |
static Result |
createTransferTxOffline(TransferDto transferDto)
转账交易
|
static Result |
createTxSimpleTransferOfNonNvt(String fromAddress,
String toAddress,
int assetChainId,
int assetId,
BigInteger amount)
便捷版 组装在NULS链内,转账非NVT资产的单账户对单账户普通转账(不能用于转NVT)。
|
static Result |
createTxSimpleTransferOfNonNvt(String fromAddress,
String toAddress,
int assetChainId,
int assetId,
BigInteger amount,
long time,
String remark)
便捷版 组装在NULS链内,转账非NVT资产的单账户对单账户普通转账(不能用于转NVT)。
|
static Result |
createTxSimpleTransferOfNvt(String fromAddress,
String toAddress,
BigInteger amount)
便捷版 组装在NULS链内,转账NVT资产的单账户对单账户普通转账(只能用于转NVT)。
|
static Result |
createTxSimpleTransferOfNvt(String fromAddress,
String toAddress,
BigInteger amount,
long time,
String remark)
便捷版 组装在NULS链内,转账NVT资产的单账户对单账户普通转账(只能用于转NVT)。
|
static Result |
createWithdrawalTx(WithdrawalTxDto withdrawalTxDto)
异构链提现交易
|
static Result |
createWithdrawalTx(WithdrawalTxDto withdrawalTxDto,
String withdrawalAssetNonce,
String nvtFeeAssetNonce)
异构链提现交易(完全离线状态)
|
static Result |
crossTransfer(CrossTransferForm transferForm) |
static Result |
deserializeTxHex(String txHex)
根据交易的hex ,反序列化成交易实体类
|
static Result |
exportKeyStore(String address,
String password,
String filePath) |
static Result |
getAccountBalance(String address,
int chainId,
int assetsId) |
static Result |
getAddressByPriKey(String priKey) |
static Result |
getBestBlock() |
static Result |
getBestBlockHeader() |
static Result |
getBlock(long height) |
static Result |
getBlock(String hash) |
static Result |
getBlockHeader(long height) |
static Result |
getBlockHeader(String hash) |
static Result<Map> |
getInfo() |
static Result |
getPriKey(String address,
String password) |
static Result |
getPriKeyOffline(String address,
String encryptedPriKey,
String password) |
static Result |
getSymbolInfo(int assetChainId,
int assetId) |
static Result |
getTransaction(String txHash) |
static Result |
getTx(String txHash) |
static BigDecimal |
getUsdPrice(int assetChainId,
int assetId) |
static Result |
importKeystore(AccountKeyStoreDto keyStore,
String password) |
static Result |
importPriKey(String priKey,
String password) |
Result |
multiSign(int chainId,
String prefix,
String address,
String encryptedPrivateKey,
String password,
String txHex) |
static Result |
multiSign(SignDto signDto,
String txHex) |
static Result |
resetPassword(String address,
String oldPassword,
String newPassword) |
static Result |
resetPasswordOffline(String address,
String encryptedPriKey,
String password,
String newPassword) |
static Result |
setAlias(String address,
String alias,
String password) |
static Result |
sign(int chainId,
String prefix,
List<SignDto> signDtoList,
String txHex) |
static Result |
sign(List<SignDto> signDtoList,
String txHex) |
static Result |
sign(String txHex,
int chainId,
String prefix,
String address,
String encryptedPrivateKey,
String password) |
static Result |
sign(String txHex,
String address,
String privateKey) |
static Result |
sign(String txHex,
String address,
String encryptedPrivateKey,
String password) |
static Result |
stableSwapTradeTx(String from,
String to,
NerveTokenAmount[] tokenAmountIns,
int tokenOutIndex,
String pairAddress,
String feeTo,
String remark)
Stable-Swap稳定币兑换交易
|
static Result |
transfer(TransferForm transferForm) |
static Result |
validateAddress(int chainId,
String address) |
static Result |
validateAddress(String address) |
static Result |
validateTx(String txHex) |
static Result |
withdrawalAdditionalFeeTx(String fromAddress,
String txHash,
BigInteger amount,
long time,
String remark)
追加异构提现手续费
1.不能为已完成的提现交易追加手续费
2.提现交易与追加手续费交易必须由相同的地址发起(相同私钥签名)
|
static Result |
withdrawalAdditionalFeeTx(String fromAddress,
String txHash,
BigInteger amount,
long time,
String remark,
String nonce)
追加异构提现手续费(完全离线状态)
1.不能为已完成的提现交易追加手续费
2.提现交易与追加手续费交易必须由相同的地址发起(相同私钥签名)
|
public static Result resetPassword(String address, String oldPassword, String newPassword)
public static Result importKeystore(AccountKeyStoreDto keyStore, String password)
public static Result exportKeyStore(String address, String password, String filePath)
public static Result<List<AccountDto>> createOffLineAccount(int count, String password)
public static Result<List<AccountDto>> createOffLineAccount(int chainId, int count, String prefix, String password)
public static Result resetPasswordOffline(String address, String encryptedPriKey, String password, String newPassword)
public static Result getPriKeyOffline(String address, String encryptedPriKey, String password)
public static Result sign(String txHex, String address, String encryptedPrivateKey, String password)
public static 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 static Result createMultiSignAccount(List<String> pubKeys, int minSigns)
public static Result getBlockHeader(long height)
public static Result getBlock(long height)
public static Result getBestBlockHeader()
public static Result getBestBlock()
public static Result transfer(TransferForm transferForm)
public static Result crossTransfer(CrossTransferForm transferForm)
public static Result createTransferTxOffline(TransferDto transferDto)
public static Result createTxSimpleTransferOfNonNvt(String fromAddress, String toAddress, int assetChainId, int assetId, BigInteger amount)
如果需要完整信息或结构更复杂的转账(比如多账户),请使用完全版的离线交易组装
fromAddress - 转出地址(NERVE地址)toAddress - 转入地址(NERVE地址)assetChainId - 转账资产链idassetId - 转账资产idamount - 到账数量public static Result createTxSimpleTransferOfNonNvt(String fromAddress, String toAddress, int assetChainId, int assetId, BigInteger amount, long time, String remark)
如果需要完整信息或结构更复杂的转账(比如多账户),请使用完全版的离线交易组装
fromAddress - 转出地址(NERVE地址)toAddress - 转入地址(NERVE地址)assetChainId - 转账资产链idassetId - 转账资产idamount - 到账数量time - 交易时间remark - 备注public static Result createTxSimpleTransferOfNvt(String fromAddress, String toAddress, BigInteger amount)
如果需要完整信息或结构更复杂的转账(比如多账户),请使用完全版的离线交易组装
fromAddress - 转出地址(NERVE地址)toAddress - 转入地址(NERVE地址)amount - 到账数量(不含手续费)public static Result createTxSimpleTransferOfNvt(String fromAddress, String toAddress, BigInteger amount, long time, String remark)
如果需要完整信息或结构更复杂的转账(比如多账户),请使用完全版的离线交易组装
fromAddress - 转出地址(NERVE地址)toAddress - 转入地址(NERVE地址)amount - 到账数量(不含手续费)time - 交易时间remark - 备注public static Result createCrossTransferTxOffline(TransferDto transferDto)
public static Result createCrossTxSimpleTransferOfNonNvtNuls(String fromAddress, String toAddress, int assetChainId, int assetId, BigInteger amount, long time, String remark)
如果需要完整信息或结构更复杂的转账(比如多账户),请使用完全版的离线交易组装
fromAddress - 转出地址(当前链地址)toAddress - 转入地址(NULS地址)assetChainId - 转账资产链idassetId - 转账资产idamount - 转账token数量time - 交易时间remark - 备注public static Result createCrossTxSimpleTransferOfNonNvtNuls(String fromAddress, String toAddress, int assetChainId, int assetId, BigInteger amount)
如果需要完整信息或结构更复杂的转账(比如多账户),请使用完全版的离线交易组装
fromAddress - 转出地址(当前链地址)toAddress - 转入地址(NULS地址)assetChainId - 转账资产链idassetId - 转账资产idamount - 转账token数量public static Result createCrossTxSimpleTransferOfNuls(String fromAddress, String toAddress, BigInteger amount, long time, String remark)
如果需要完整信息或结构更复杂的转账(比如多账户),请使用完全版的离线交易组装
fromAddress - 转出地址(当前链地址)toAddress - 转入地址(NULS地址)amount - time - remark - public static Result createCrossTxSimpleTransferOfNuls(String fromAddress, String toAddress, BigInteger amount)
如果需要完整信息或结构更复杂的转账(比如多账户),请使用完全版的离线交易组装
fromAddress - 转出地址(当前链地址)toAddress - 转入地址(NULS地址)amount - public static Result createCrossTxSimpleTransferOfNvt(String fromAddress, String toAddress, BigInteger amount, long time, String remark)
如果需要完整信息或结构更复杂的转账(比如多账户),请使用完全版的离线交易组装
fromAddress - 转出地址(当前链地址)toAddress - 转入地址(NULS地址)amount - time - remark - public static Result createCrossTxSimpleTransferOfNvt(String fromAddress, String toAddress, BigInteger amount)
如果需要完整信息或结构更复杂的转账(比如多账户),请使用完全版的离线交易组装
fromAddress - 转出地址(当前链地址)toAddress - 转入地址(NULS地址)amount - public static Result createWithdrawalTx(WithdrawalTxDto withdrawalTxDto)
withdrawalTxDto - public static Result withdrawalAdditionalFeeTx(String fromAddress, String txHash, BigInteger amount, long time, String remark)
fromAddress - 转出地址(支付手续费地址)txHash - 要追加手续费的提现交易hashamount - 追加手续费数量time - 时间remark - 备注public static Result createWithdrawalTx(WithdrawalTxDto withdrawalTxDto, String withdrawalAssetNonce, String nvtFeeAssetNonce)
public static Result withdrawalAdditionalFeeTx(String fromAddress, String txHash, BigInteger amount, long time, String remark, String nonce)
fromAddress - 转出地址(支付手续费地址)txHash - 要追加手续费的提现交易hashamount - 追加手续费数量time - 时间remark - 备注public static BigInteger calcTransferTxFee(TransferTxFeeDto dto)
@Deprecated public static Map<String,BigInteger> calcCrossTransferTxFee(CrossTransferTxFeeDto dto)
public static Result createMultiSignTransferTxOffline(MultiSignTransferDto transferDto)
public static BigInteger calcMultiSignTransferTxFee(MultiSignTransferTxFeeDto dto)
public static Result createMultiSignAliasTxOffline(MultiSignAliasDto dto)
public static Result deserializeTxHex(String txHex)
txHex - public static BigDecimal getUsdPrice(int assetChainId, int assetId)
public static Result getSymbolInfo(int assetChainId, int assetId)
Copyright © 2021. All rights reserved.