/// <summary> /// Запрашиваем версию Electrum /// </summary> public SimpleStringResponseClass GetElectrumVersion() { VersionMethodClass versionMethodClass = new VersionMethodClass(this); SimpleStringResponseClass simpleStringResponseClass = (SimpleStringResponseClass)versionMethodClass.execute(); return(simpleStringResponseClass); }
private async void ConnectToJsonRpcAsync() { SetStatus("Проверка версии Electrum: " + GetType().Name); await Task.Run(() => { try { SimpleStringResponseClass electrum_version = ElectrumClient.GetElectrumVersion(); ElectrumVersion = electrum_version?.result; if (EnableFullRawTracert) { SetStatus("jsonrpc_response_raw: " + ElectrumClient.jsonrpc_response_raw, StatusTypes.DebugStatus); } } catch (Exception e) { SetStatus("Ошибка чтения данных Electrum JSONRPC: " + e.Message, StatusTypes.ErrorStatus); SetStatus("HttpStatusCode: " + ElectrumClient.CurrentHttpStatusCode, StatusTypes.ErrorStatus); SetStatus("HttpStatusDescription: " + ElectrumClient.CurrentStatusDescription, StatusTypes.ErrorStatus); SetStatus(null); return; } if (string.IsNullOrWhiteSpace(ElectrumVersion)) { SetStatus("Ошибка загрузки Electrum кошелька. ElectrumVersion is NULL", StatusTypes.ErrorStatus); SetStatus(null); return; } SetStatus("Electrum [ver." + ElectrumVersion + "] is ready...", StatusTypes.ErrorStatus); ScheduleBodyAsyncAction(); }); }
/// <summary> /// Создать новый Биткоин адрес /// </summary> public SimpleStringResponseClass CreateNewAddress() { CreateNewAddressMethodClass createNewAddressMethodClass = new CreateNewAddressMethodClass(this); SimpleStringResponseClass simpleStringResponseClass = (SimpleStringResponseClass)createNewAddressMethodClass.execute(); return(simpleStringResponseClass); }
public override object execute() { string jsonrpc_raw_data = Client.Execute(method, options); SimpleStringResponseClass result = new SimpleStringResponseClass(); return(result.ReadObject(jsonrpc_raw_data)); }