forked from fekt/hush-android-wallet-sdk
Hush SDK for Android lite wallets
https://hush.is
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.2 KiB
44 lines
1.2 KiB
@file:Suppress("ktlint:filename")
|
|
|
|
package cash.z.ecc.android.sdk.model
|
|
|
|
/*
|
|
* This is a set of extension functions currently, because we expect them to change in the future.
|
|
*/
|
|
|
|
fun LightWalletEndpoint.Companion.defaultForNetwork(zcashNetwork: ZcashNetwork): LightWalletEndpoint {
|
|
return when (zcashNetwork.id) {
|
|
ZcashNetwork.Mainnet.id -> LightWalletEndpoint.Mainnet
|
|
ZcashNetwork.Testnet.id -> LightWalletEndpoint.Testnet
|
|
else -> error("Unknown network id: ${zcashNetwork.id}")
|
|
}
|
|
}
|
|
|
|
/**
|
|
* This is a special localhost value on the Android emulator, which allows it to contact
|
|
* the localhost of the computer running the emulator.
|
|
*/
|
|
private const val COMPUTER_LOCALHOST = "10.0.2.2"
|
|
|
|
private const val DEFAULT_PORT = 443
|
|
|
|
val LightWalletEndpoint.Companion.Mainnet
|
|
get() = LightWalletEndpoint(
|
|
"lite2.hushpool.is",
|
|
DEFAULT_PORT,
|
|
isSecure = true
|
|
)
|
|
|
|
val LightWalletEndpoint.Companion.Testnet
|
|
get() = LightWalletEndpoint(
|
|
"lite2.hushpool.is",
|
|
DEFAULT_PORT,
|
|
isSecure = true
|
|
)
|
|
|
|
val LightWalletEndpoint.Companion.Darkside
|
|
get() = LightWalletEndpoint(
|
|
COMPUTER_LOCALHOST,
|
|
DEFAULT_PORT,
|
|
isSecure = true
|
|
)
|
|
|