Transaction
data class Transaction(var number: Long, var parentHash: String, var daemonHash: String, var timestamp: Long = Instant.now().epochSecond, var owner: Address, var linker: Address? = Address(ZERO_LTC_ADDR), val type: TxTypeEnum, var hub: Array<String> = emptyArray(), var code: String? = null, val codeHash: String? = null, var payload: String? = "0x", var amount: Long = 0, var income: Long? = null, var joule: Long = 0, var sign: String? = null, var proofOfWork: String? = null, var version: Int = TxVersionEnum.LATEST.version(), var difficulty: Int? = 0)
交易数据类
Constructors
Link copied to clipboard
constructor(number: Long, parentHash: String, daemonHash: String, timestamp: Long = Instant.now().epochSecond, owner: Address, linker: Address? = Address(ZERO_LTC_ADDR), type: TxTypeEnum, hub: Array<String> = emptyArray(), code: String? = null, codeHash: String? = null, payload: String? = "0x", amount: Long = 0, income: Long? = null, joule: Long = 0, sign: String? = null, proofOfWork: String? = null, version: Int = TxVersionEnum.LATEST.version(), difficulty: Int? = 0)
Properties
Link copied to clipboard
守护区块哈希
Link copied to clipboard
难度
Link copied to clipboard
父交易哈希
Link copied to clipboard
已废弃
Link copied to clipboard
交易类型 TxTypeEnum
Link copied to clipboard
交易版本 TxVersionEnum
Functions
Link copied to clipboard
fun Transaction.calculateTransactionHash(isGM: Boolean = true, useProofOfWork: Boolean = false): String
calculate transaction hash
Link copied to clipboard
fun Transaction.sign(privateKey: String, isGM: Boolean = true, chainId: Int = 1, useProofOfWork: Boolean = false): Pair<String, SignatureData>
签名交易
Link copied to clipboard
convert Transaction to SendTBlock