示例#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 = ""
 });