send

fun send(msg: CapdMsg)
open suspend override fun send(ba: ByteArray)
suspend fun send(ba: ByteArray, msgPfx: ByteArray)


fun send(ba: ByteArray, tweakMsg: CapdMsg.() -> Unit)

Send some bytes over CAPD, allowing you to set CAPD-specific fields.

Parameters

ba

The unencrypted message to send. This function will encrypt it.

tweakMsg

A callback to change the CAPD message. This callback is called before the message POW is "solved", but AFTER the POW target is set. So the caller has the option of changing the POW target, rescindHash, and expiration fields.