2022-09-14 04:48:50 -07:00
|
|
|
package co.electriccoin.lightwallet.client.model
|
|
|
|
|
2023-01-11 07:18:33 -08:00
|
|
|
import cash.z.wallet.sdk.internal.rpc.Service
|
2022-09-14 04:48:50 -07:00
|
|
|
|
2023-01-24 05:17:10 -08:00
|
|
|
/**
|
|
|
|
* A lightwalletd endpoint information, which has come from the Light Wallet server.
|
|
|
|
*
|
|
|
|
* It is marked as "unsafe" because it is not guaranteed to be valid.
|
|
|
|
*/
|
2022-09-14 04:48:50 -07:00
|
|
|
data class LightWalletEndpointInfoUnsafe(
|
|
|
|
val chainName: String,
|
|
|
|
val consensusBranchId: String,
|
|
|
|
val blockHeightUnsafe: BlockHeightUnsafe
|
|
|
|
) {
|
|
|
|
companion object {
|
|
|
|
internal fun new(lightdInfo: Service.LightdInfo) =
|
|
|
|
LightWalletEndpointInfoUnsafe(
|
|
|
|
lightdInfo.chainName,
|
|
|
|
lightdInfo.consensusBranchId,
|
|
|
|
BlockHeightUnsafe(lightdInfo.blockHeight)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|