All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.lightspark.sdk.wallet.model.PaymentRequestStatus.kt Maven / Gradle / Ivy

The newest version!
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
@file:Suppress("ktlint:standard:max-line-length")

package com.lightspark.sdk.wallet.model

import com.lightspark.sdk.core.util.EnumSerializer
import kotlinx.serialization.Serializable

/** This is an enum of the potential states that a payment request on the Lightning Network can take. **/
@Serializable(with = PaymentRequestStatusSerializer::class)
enum class PaymentRequestStatus(val rawValue: String) {
    OPEN("OPEN"),

    CLOSED("CLOSED"),

    /**
     * This is an enum value that represents values that could be added in the future.
     * Clients should support unknown values as more of them could be added without notice.
     */
    FUTURE_VALUE("FUTURE_VALUE"),
}

object PaymentRequestStatusSerializer :
    EnumSerializer(
        PaymentRequestStatus::class,
        { rawValue ->
            PaymentRequestStatus.values().firstOrNull { it.rawValue == rawValue } ?: PaymentRequestStatus.FUTURE_VALUE
        },
    )




© 2015 - 2024 Weber Informatics LLC | Privacy Policy