예제 #1
0
 public static WebWalletState ReduceFreeTokenAction(WebWalletState state, WebWalletFreeTokenResultAction action) =>
 state.With(new {
     stage               = UIStage.FreeToken,
     faucetBalance       = action.faucetBalance,
     ValidReCAPTCHA      = false,
     ServerVerificatiing = false
 });
예제 #2
0
        public static WebWalletState ReduceSaveSettingsAction(WebWalletState state, WebWalletSaveSettingsAction action)
        {
            var state2 = state.With(new
            {
                stage = UIStage.Main,
            });

            state2.wallet.VoteFor = action.VoteFor;
            return(state2);
        }
예제 #3
0
        public static WebWalletState ReduceSwapTLYRResultAction(WebWalletState state, WebWalletSwapTLYRResultAction action)
        {
            var stt = state.With(new
            {
                IsLoading = false,
                LastOperationIsSuccess = action.Success,
                Message = action.errMessage
            });

            return(stt);
        }
예제 #4
0
        public static WebWalletState ReduceLyraSwapResultAction(WebWalletState state, WebWalletTokenSwapResultAction action)
        {
            var stt = state.With(new
            {
                IsLoading = false,
                LastOperationIsSuccess = action.Success,
                Message = action.Success ? "Swapping is succeed!" : "Swapping is failed."
            });

            return(stt);
        }
예제 #5
0
        public static WebWalletState ReduceSendMeFreeTokenAction(WebWalletState state, WebWalletSendMeFreeTokenResultAction action)
        {
            var stt = state.With(new {
                stage = UIStage.Main,
                LastOperationIsSuccess = action.Success
            });

            if (action.Success)
            {
                stt.freeTokenSent = true;
                stt.freeTokenTimes++;
            }
            return(stt);
        }
예제 #6
0
        public static WebWalletState RefreshBalanceAction(WebWalletState state, WebWalletResultAction action)
        {
            var bs = "<empty>";

            if (action.wallet == null)
            {
            }
            else
            {
                var bst = action.wallet.GetDisplayBalancesAsync().ContinueWith(a => bs = a.Result);
                bst.Wait();
            }

            return(state.With(new
            {
                IsLoading = false,
                stage = action.stage,
                IsOpening = action.IsOpening,
                wallet = action.wallet,
                balanceString = bs
            }));
        }
예제 #7
0
 public static WebWalletState ReduceOpenSettingsAction(WebWalletState state, WebWalletSettingsAction action) => state.With(new { stage = UIStage.Settings });
예제 #8
0
 public static WebWalletState CancelSendAction(WebWalletState state, WebWalletCancelSendAction action) => state.With(new { stage = UIStage.Main });
예제 #9
0
 public static WebWalletState SendTokenActionHandler(WebWalletState state, WebWalletSendTokenAction action) => state.With(new { IsLoading = true });
예제 #10
0
 public static WebWalletState ReductLyraSwapHandler(WebWalletState state, WebWalletBeginTokenSwapAction action) => state.With(new { IsLoading = true });
예제 #11
0
 public static WebWalletState GetTransactionActionHandler(WebWalletState state, WebWalletTransactionsAction action) => state.With(new { IsLoading = true });
예제 #12
0
 public static WebWalletState ReduceRCServerAction(WebWalletState state, WebWalletReCAPTCHAServerAction action) => state.With(new { ServerVerificatiing = action.ServerVerificatiing });
예제 #13
0
 public static WebWalletState ReduceRCValidAction(WebWalletState state, WebWalletReCAPTCHAValidAction action) => state.With(new { ValidReCAPTCHA = action.ValidReCAPTCHA });
예제 #14
0
 public static WebWalletState RestoreWalletActionHandler(WebWalletState state, WebWalletRestoreAction action) => state.With(new { IsLoading = true });
예제 #15
0
 public static WebWalletState ReductSwapTLYRHandler(WebWalletState state, WebWalletBeginSwapTLYRAction action) => state.With(new { IsLoading = true });
예제 #16
0
 public static WebWalletState ReduceSwapTLYRAction(WebWalletState state, WebWalletSwapTLYRAction action) => state.With(new { stage = UIStage.SwapTLYR, Message = "" });
예제 #17
0
 public static WebWalletState ReduceCancelSaveSettingsAction(WebWalletState state, WebWalletCancelSaveSettingsAction action) => state.With(new { stage = UIStage.Main });
예제 #18
0
 public static WebWalletState RefreshBalanceActionHandler(WebWalletState state, WebWalletRefreshBalanceAction action) => state.With(new { IsLoading = true });
예제 #19
0
 public static WebWalletState ReduceTransactionsAction(WebWalletState state, WebWalletTransactionsResultAction action) =>
 state.With(new {
     IsLoading = false,
     stage     = UIStage.Transactions,
     txs       = action.transactions
 });
예제 #20
0
 public static WebWalletState CloseAction(WebWalletState state, WebWalletCloseAction action) => new WebWalletState();
예제 #21
0
 public static WebWalletState SendAction(WebWalletState state, WebWalletSendAction action) => state.With(new { stage = UIStage.Send });
예제 #22
0
 public static WebWalletState ReduceLyraSwapAction(WebWalletState state, WebWalletSwapTokenAction action) => state.With(new
 {
     stage   = UIStage.SwapToken,
     Message = ""
 });