public ExplorerClient(NBXplorerNetwork network, Uri serverAddress = null) { serverAddress = serverAddress ?? network.DefaultSettings.DefaultUrl; if (network == null) { throw new ArgumentNullException(nameof(network)); } _Address = serverAddress; _Network = network; Serializer = new Serializer(network.NBitcoinNetwork); _CryptoCode = _Network.CryptoCode; _Factory = new DerivationStrategy.DerivationStrategyFactory(Network.NBitcoinNetwork); SetCookieAuth(network.DefaultSettings.DefaultCookieFile); }
public static DerivationStrategy Parse(string derivationStrategy, BTCPayNetwork network) { if (network == null) { throw new ArgumentNullException(nameof(network)); } if (derivationStrategy == null) { throw new ArgumentNullException(nameof(derivationStrategy)); } var result = new NBXplorer.DerivationStrategy.DerivationStrategyFactory(network.NBitcoinNetwork).Parse(derivationStrategy); return(new DerivationStrategy(result, network)); }
public static DerivationSchemeSettings Parse(string derivationStrategy, BTCPayNetwork network) { if (network == null) { throw new ArgumentNullException(nameof(network)); } if (derivationStrategy == null) { throw new ArgumentNullException(nameof(derivationStrategy)); } var result = new NBXplorer.DerivationStrategy.DerivationStrategyFactory(network.NBitcoinNetwork).Parse(derivationStrategy); return(new DerivationSchemeSettings(result, network) { AccountOriginal = derivationStrategy.Trim() }); }
public ExplorerClient(Network network, Uri serverAddress) { if (serverAddress == null) { throw new ArgumentNullException(nameof(serverAddress)); } if (network == null) { throw new ArgumentNullException(nameof(network)); } _Address = serverAddress; _Network = network; _Serializer = new Serializer(network); _Factory = new DerivationStrategy.DerivationStrategyFactory(Network); var auth = new CookieAuthentication(NBXplorer.Client.Utils.GetDefaultCookieFilePath(network)); if (auth.RefreshCache()) { _Auth = auth; } }