CapdMsg

class CapdMsg(var data: ByteArray? = null) : BCHserializable

A CAPD message (see https://spec.nexa.org/network/capd/)

Constructors

Link copied to clipboard
constructor(serialized: BCHserialized)

Create from network-serialized bytes

constructor(data: ByteArray? = null)

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Properties

Link copied to clipboard

When this message was created (seconds since epoch)

Link copied to clipboard

The message contents

Link copied to clipboard

the message's proof of work target. This should be adjusted based on your node's capd info

Link copied to clipboard

When this message expires (seconds since createTime) max_int means never

Link copied to clipboard
Link copied to clipboard

needed to prove this message's POW

Link copied to clipboard

When the preimage of this is published, this message expires, null means no preimage

Functions

Link copied to clipboard
open override fun BCHdeserialize(stream: BCHserialized): BCHserialized
Link copied to clipboard
open override fun BCHserialize(format: SerializationType): BCHserialized
Link copied to clipboard
fun check(): Boolean

Check whether this capd message is solved

Link copied to clipboard
fun hash(): ByteArray?
Link copied to clipboard
fun setWork(work: Long)
Link copied to clipboard
fun solve(time: Long? = null): Boolean

Solve this capd message (in preparation for sending) with the provided valid time

Link copied to clipboard
open fun toByteArray(format: SerializationType = SerializationType.UNKNOWN): ByteArray
Link copied to clipboard
Link copied to clipboard
fun work(): BigInteger
Link copied to clipboard