public bool HasEnoughFundsForCycle(bool firstCycle, string originWalletName = null) { Money walletBalance = this.Services.WalletService.GetBalance(originWalletName); FeeRate networkFeeRate = this.Services.FeeService.GetFeeRateAsync().GetAwaiter().GetResult(); return(TumblerClientRuntime.HasEnoughFundsForCycle(firstCycle, walletBalance, networkFeeRate, TumblerParameters.Denomination, TumblerParameters.Fee)); }
public PaymentStateMachine( TumblerClientRuntime runtime) { if (runtime == null) { throw new ArgumentNullException("runtime"); } Runtime = runtime; }
public StateMachinesExecutor( TumblerClientRuntime runtime) { if (runtime == null) { throw new ArgumentNullException("runtime"); } Runtime = runtime; _ParametersHash = Runtime.TumblerParameters.GetHash(); }
public static async Task <TumblerClientRuntime> FromConfigurationAsync(TumblerClientConfigurationBase configuration, ClientInteraction interaction) { TumblerClientRuntime runtime = new TumblerClientRuntime(); try { await runtime.ConfigureAsync(configuration, interaction).ConfigureAwait(false); } catch { runtime.Dispose(); throw; } return(runtime); }
public static async Task <TumblerClientRuntime> FromConfigurationAsync(TumblerClientConfiguration configuration, ClientInteraction interaction) { TumblerClientRuntime runtime = new TumblerClientRuntime(); try { await runtime.ConfigureAsync(configuration, interaction).ConfigureAwait(false); } catch (Exception ex) { var message = ex.Message; runtime.Dispose(); throw; } return(runtime); }
public static async Task <TumblerClientRuntime> FromConfigurationAsync(TumblerClientConfigurationBase configuration, ClientInteraction interaction = null, bool connectionTest = false) { TumblerClientRuntime runtime = new TumblerClientRuntime(); try { await runtime.ConfigureAsync(configuration, interaction, connectionTest).ConfigureAwait(false); } catch (Exception e) { Console.WriteLine("Exception during runtime configuration: " + e); runtime?.Dispose(); throw; } return(runtime); }
public PaymentStateMachine( TumblerClientRuntime runtime, State state) : this(runtime) { if (state == null) { return; } if (state.NegotiationClientState != null) { StartCycle = state.NegotiationClientState.CycleStart; ClientChannelNegotiation = new ClientChannelNegotiation(runtime.TumblerParameters, state.NegotiationClientState); } if (state.PromiseClientState != null) { PromiseClientSession = new PromiseClientSession(runtime.TumblerParameters.CreatePromiseParamaters(), state.PromiseClientState); } if (state.SolverClientState != null) { SolverClientSession = new SolverClientSession(runtime.TumblerParameters.CreateSolverParamaters(), state.SolverClientState); } InvalidPhaseCount = state.InvalidPhaseCount; }
public PaymentStateMachine( TumblerClientRuntime runtime) { Runtime = runtime ?? throw new ArgumentNullException(nameof(runtime)); }