Package fr.acinq.lightning.utils

Types

BitField
Link copied to clipboard
common
class BitField
BitStream
Link copied to clipboard
common
data class BitStream(bytes: List<Byte>, offstart: Int, offend: Int)

Bit stream that can be written to and read at both ends (i.e. you can read from the end or the beginning of the stream)

Connection
Link copied to clipboard
common
sealed class Connection
Either
Link copied to clipboard
common
sealed class Either<out A, out B>
JsonRPCDouble
Link copied to clipboard
common
data class JsonRPCDouble(value: Double) : JsonRPCParam
JsonRPCError
Link copied to clipboard
common
data class JsonRPCError(code: Int, message: String)
JsonRPCInt
Link copied to clipboard
common
data class JsonRPCInt(value: Int) : JsonRPCParam
JsonRPCParam
Link copied to clipboard
common
sealed class JsonRPCParam
JsonRPCRequest
Link copied to clipboard
common
data class JsonRPCRequest(jsonrpc: String, id: Int, method: String, params: List<JsonRPCParam>)

JSON-RPC request

JsonRPCResponse
Link copied to clipboard
common
data class JsonRPCResponse(id: Int?, result: JsonElement, error: JsonRPCError?)

JSON-RPC result / error

JsonRPCString
Link copied to clipboard
common
data class JsonRPCString(value: String) : JsonRPCParam
LightningLoggerDelegateProvider
Link copied to clipboard
common
class LightningLoggerDelegateProvider(of: KClass<*>) : PropertyDelegateProvider<Any, Lazy<Logger>>
SecureRandomJvm
Link copied to clipboard
class SecureRandomJvm : Random
SecureRandomPosix
Link copied to clipboard
native
object SecureRandomPosix
ServerAddress
Link copied to clipboard
common
data class ServerAddress(host: String, port: Int, tls: TcpSocket.TLS)
Try
Link copied to clipboard
common
sealed class Try<T>
UUID
Link copied to clipboard
common
class UUID(mostSignificantBits: Long, leastSignificantBits: Long) : Comparable<UUID>

Functions

and
Link copied to clipboard
common
infix fun ByteArray.and(other: ByteArray): ByteArray
asJsonRPCParameters
Link copied to clipboard
common
fun List<Any>.asJsonRPCParameters(): List<JsonRPCParam>
asParam
Link copied to clipboard
common
fun Double.asParam(): JsonRPCParam
fun Int.asParam(): JsonRPCParam
fun String.asParam(): JsonRPCParam
compareTo
Link copied to clipboard
common
operator fun MilliSatoshi.compareTo(other: Satoshi): Int
concat
Link copied to clipboard
common
infix fun ByteArray.concat(append: ByteArray): ByteArray
copyTo
Link copied to clipboard
native
fun <ERROR CLASS>.copyTo(buffer: ByteArray, offset: Int = 0)
currentTimestampMillis
Link copied to clipboard
common
fun currentTimestampMillis(): Long
currentTimestampSeconds
Link copied to clipboard
common
fun currentTimestampSeconds(): Long
decodeToString
Link copied to clipboard
common
fun Flow<ByteArray>.decodeToString(): Flow<String>
ensureNeverFrozen
Link copied to clipboard
common
fun <T : Any> T.ensureNeverFrozen()
flatMap
Link copied to clipboard
common
fun <L, R, T> Either<L, R>.flatMap(f: (R) -> Either<L, T>): Either<L, T>
getValue
Link copied to clipboard
common
operator fun <T> Lazy<T>.getValue(thisRef: Any?, property: KProperty<*>): T
@ExperimentalCoroutinesApi
operator fun <T : Any> MutableStateFlow<T>.getValue(thisRef: Any?, property: KProperty<*>): T
leftPaddedCopyOf
Link copied to clipboard
common
fun ByteArray.leftPaddedCopyOf(n: Int): ByteArray
lightningLogger
Link copied to clipboard
common
inline fun <T> lightningLogger(): LightningLoggerDelegateProvider
inline fun <T> T.lightningLogger(): LightningLoggerDelegateProvider
fun lightningLogger(of: KClass<*>): LightningLoggerDelegateProvider
map
Link copied to clipboard
common
fun <L, R, T> Either<L, R>.map(f: (R) -> T): Either<L, T>
or
Link copied to clipboard
common
infix fun ByteArray.or(other: ByteArray): ByteArray
runTrying
Link copied to clipboard
common
inline fun <R> runTrying(block: () -> R): Try<R>
inline fun <T, R> T.runTrying(block: T.() -> R): Try<R>
secure
Link copied to clipboard
common
fun Random.Default.secure(): Random
setLightningLoggerFactory
Link copied to clipboard
common
fun setLightningLoggerFactory(loggerFactory: LoggerFactory)
setValue
Link copied to clipboard
common
@ExperimentalCoroutinesApi
operator fun <T : Any> MutableStateFlow<T>.setValue(thisRef: Any?, property: KProperty<*>, value: T)
splitByLines
Link copied to clipboard
common
fun Flow<String>.splitByLines(): Flow<String>
startsWith
Link copied to clipboard
common
fun <T, R : T> List<T>.startsWith(prefix: List<R>): Boolean
subArray
Link copied to clipboard
common
fun ByteArray.subArray(newSize: Int): ByteArray
sum
Link copied to clipboard
common
fun Iterable<Satoshi>.sum(): Satoshi
fun Iterable<MilliSatoshi>.sum(): MilliSatoshi
toByteArray
Link copied to clipboard
native
fun <ERROR CLASS>.toByteArray(): ByteArray
toByteVector
Link copied to clipboard
common
fun ByteArray.toByteVector(): ByteVector
toByteVector32
Link copied to clipboard
common
fun ByteArray.toByteVector32(): ByteVector32
toByteVector64
Link copied to clipboard
common
fun ByteArray.toByteVector64(): ByteVector64
toMilliSatoshi
Link copied to clipboard
common
fun Satoshi.toMilliSatoshi(): MilliSatoshi
toNSData
Link copied to clipboard
native
fun ByteArray.toNSData(): <ERROR CLASS>
utf8ByteCount
Link copied to clipboard
common
fun utf8ByteCount(firstCodePoint: Byte): Int
xor
Link copied to clipboard
common
infix fun ByteArray.xor(other: ByteArray): ByteArray
zipped
Link copied to clipboard
common
fun <T1, T2, T3> Triple<Iterable<T1>, Iterable<T2>, Iterable<T3>>.zipped(): List<Triple<T1, T2, T3>>
zippedTo
Link copied to clipboard
common
fun <T1, T2, T3, C : MutableCollection<in Triple<T1, T2, T3>>> Triple<Iterable<T1>, Iterable<T2>, Iterable<T3>>.zippedTo(destination: C): C

Properties

btc
Link copied to clipboard
common
val Long.btc: Satoshi
btc
Link copied to clipboard
common
val Int.btc: Satoshi
mbtc
Link copied to clipboard
common
val Long.mbtc: Satoshi
mbtc
Link copied to clipboard
common
val Int.mbtc: Satoshi
msat
Link copied to clipboard
common
val Long.msat: MilliSatoshi
msat
Link copied to clipboard
common
val Int.msat: MilliSatoshi
sat
Link copied to clipboard
common
val Long.sat: Satoshi
sat
Link copied to clipboard
common
val Int.sat: Satoshi