/// <summary> /// Get the NetworkType observable /// </summary> /// <returns>IObservable<NetworkType></returns> protected IObservable <NetworkType> GetNetworkTypeObservable() { if (NetworkType != NetworkType.NOT_SUPPORT) { return(Observable.Return(NetworkType)); } var typeObservable = Observable.FromAsync(async ar => await NetworkHttp.GetNetworkType()); typeObservable.Subscribe(ar => { NetworkType = ar; }); return(typeObservable); }
/// <summary> /// Initializes a new instance of the <see cref="BaseHttp" /> class. /// </summary> /// <param name="host">The host.</param> /// <param name="networkHttp">The network HTTP.</param> protected BaseHttp(string host, NetworkHttp networkHttp) { Guard.NotNullOrEmpty(host, nameof(host), "Host could not be null or empty"); NetworkHttp = networkHttp ?? throw new ArgumentNullException(nameof(networkHttp)); BasePath = host; FlurlHttp.Configure(settings => { var jsonSettings = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, ObjectCreationHandling = ObjectCreationHandling.Replace }; settings.JsonSerializer = new NewtonsoftJsonSerializer(jsonSettings); }); }
/// <summary> /// Initializes a new instance of the <see cref="MetadataHttp" /> class. /// </summary> /// <param name="host">The host</param> /// <param name="networkHttp">The network http</param> public MetadataHttp(string host, NetworkHttp networkHttp) : base(host, networkHttp) { }
/// <summary> /// Initializes a new instance of the <see cref="_transactionHttp" /> class. /// </summary> /// <param name="host">The host</param> /// <param name="networkHttp">The network http</param> public TransactionHttp(string host, NetworkHttp networkHttp) : base(host, networkHttp) { }
/// <summary> /// Initializes a new instance of the <see cref="ChainHttp" /> class. /// </summary> /// <param name="host">The host</param> /// <param name="networkHttp">The network http</param> public ChainHttp(string host, NetworkHttp networkHttp) : base(host, networkHttp) { }
/// <summary> /// Initializes a new instance of the <see cref="BlockHttp" /> class. /// </summary> /// <param name="host">The host</param> /// <param name="networkHttp">The network http</param> public BlockHttp(string host, NetworkHttp networkHttp) : base(host, networkHttp) { }
/// <summary> /// Initializes a new instance of the <see cref="NamespaceHttp" /> class. /// </summary> /// <param name="host">The host</param> /// <param name="networkHttp">The network http</param> public NamespaceHttp(string host, NetworkHttp networkHttp) : base(host, networkHttp) { }
/// <summary> /// Initializes a new instance of the <see cref="MosaicHttp" /> class. /// </summary> /// <param name="host">The host</param> /// <param name="networkHttp">The network http</param> public MosaicHttp(string host, NetworkHttp networkHttp) : base(host, networkHttp) { }
/// <summary> /// Initializes a new instance of the <see cref="ExchangeHttp" /> class. /// </summary> /// <param name="host">The host</param> /// <param name="networkHttp">The network http</param> public ExchangeHttp(string host, NetworkHttp networkHttp) : base(host, networkHttp) { }
public NodeHttp(string host, NetworkHttp networkHttp) : base(host, networkHttp) { }
/// <summary> /// Initializes a new instance of the <see cref="AccountHttp" /> class. /// </summary> /// <param name="host">The host</param> /// <param name="networkHttp">The network http</param> public AccountHttp(string host, NetworkHttp networkHttp) : base(host, networkHttp) { }
/// <summary> /// Initializes a new instance of the <see cref="ChainHttp" /> class. /// </summary> /// <param name="host">The host</param> /// <param name="networkHttp">The network http</param> public DiagnosticHttp(string host, NetworkHttp networkHttp) : base(host, networkHttp) { }