2019-10-31 15:43:09 -07:00
|
|
|
//
|
|
|
|
// DemoAppConfig.swift
|
|
|
|
// ZcashLightClientSample
|
|
|
|
//
|
|
|
|
// Created by Francisco Gindre on 10/31/19.
|
|
|
|
// Copyright © 2019 Electric Coin Company. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import ZcashLightClientKit
|
2020-06-09 07:27:10 -07:00
|
|
|
import MnemonicSwift
|
2021-09-15 05:21:29 -07:00
|
|
|
// swiftlint:disable line_length force_try
|
|
|
|
enum DemoAppConfig {
|
2021-02-17 15:02:25 -08:00
|
|
|
static var host = ZcashSDK.isMainnet ? "lightwalletd.electriccoin.co" : "lightwalletd.testnet.electriccoin.co"
|
2020-04-09 15:25:43 -07:00
|
|
|
static var port: Int = 9067
|
2021-06-20 07:59:00 -07:00
|
|
|
static var birthdayHeight: BlockHeight = ZcashSDK.isMainnet ? 935000 : 1386000
|
2021-07-28 11:46:45 -07:00
|
|
|
|
2021-06-20 07:59:00 -07:00
|
|
|
static var seed = try! Mnemonic.deterministicSeedBytes(from: "live combine flight accident slow soda mind bright absent bid hen shy decade biology amazing mix enlist ensure biology rhythm snap duty soap armor")
|
2019-10-31 15:43:09 -07:00
|
|
|
static var address: String {
|
|
|
|
"\(host):\(port)"
|
|
|
|
}
|
2019-11-04 15:18:07 -08:00
|
|
|
|
2021-07-28 11:46:45 -07:00
|
|
|
static var processorConfig: CompactBlockProcessor.Configuration = {
|
2021-09-15 05:21:29 -07:00
|
|
|
CompactBlockProcessor.Configuration(cacheDb: try! cacheDbURLHelper(), dataDb: try! dataDbURLHelper(), walletBirthday: Self.birthdayHeight, network: kZcashNetwork)
|
2021-07-28 11:46:45 -07:00
|
|
|
}()
|
2019-11-14 06:38:54 -08:00
|
|
|
|
|
|
|
static var endpoint: LightWalletEndpoint {
|
2020-01-14 14:25:14 -08:00
|
|
|
return LightWalletEndpoint(address: self.host, port: self.port, secure: true)
|
2019-11-14 06:38:54 -08:00
|
|
|
}
|
2019-10-31 15:43:09 -07:00
|
|
|
}
|
|
|
|
|
2019-11-04 15:18:07 -08:00
|
|
|
|
2021-07-28 11:46:45 -07:00
|
|
|
extension ZcashSDK {
|
|
|
|
static var isMainnet: Bool {
|
2021-09-15 05:21:29 -07:00
|
|
|
switch kZcashNetwork.networkType {
|
2021-07-28 11:46:45 -07:00
|
|
|
case .mainnet:
|
|
|
|
return true
|
|
|
|
case .testnet:
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
2019-10-31 15:43:09 -07:00
|
|
|
}
|