Пример #1
0
        public ActionResult UpdateWithdrawalRequest(TransactionQueryBO transactionQuery)
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserResponseBO        _apiResponse          = new UserResponseBO();
                TransactionAppService transactionAppService = new TransactionAppService();
                transactionAppService.UpdateWithdrawalRequest(transactionQuery);

                _apiResponse.HttpStatusCode = "200";
                _apiResponse.Message        = "Transaction successful";
                _apiResponse.Status         = "Success";

                return(Ok(_apiResponse));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }
Пример #2
0
        public ActionResult BackupFunds()
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserResponseBO _apiResponse = new UserResponseBO();

                _apiResponse.HttpStatusCode = "200";
                _apiResponse.Message        = "Transaction successful";
                _apiResponse.Status         = "Success";

                return(Ok(_apiResponse));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }
Пример #3
0
        public ActionResult Receive([FromBody] WalletRecieveBO walletRecieve)
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserAppService userAppService = new UserAppService();
                TblUserInfo    userInfo       = userAppService.Get(userAuth);

                WalletRecieveBO wallet = new WalletRecieveBO();
                wallet.AddressString = "Cardano wallet address";
                wallet.CallbackUrl   = "Your callback url";

                return(Ok(wallet));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }
Пример #4
0
        public ActionResult GetWallet([FromBody] WalletBO wallet)
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserAppService userAppService = new UserAppService();
                TblUserInfo    userInfo       = userAppService.Get(userAuth);

                List <WalletBO> walletBOs = new List <WalletBO>();
                WalletBO        walletBO  = new WalletBO();
                wallet.xPriv          = "Cardano private key";
                wallet.xPub           = "Cardano public key";
                wallet.Balance.Amount = 10m;

                walletBOs.Add(walletBO);

                return(Ok(walletBOs));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }
Пример #5
0
        public ActionResult Send([FromBody] WalletTransactionBO walletTransaction)
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserAppService userAppService = new UserAppService();
                TblUserInfo    userInfo       = userAppService.Get(userAuth);

                UserResponseBO _apiResponse = new UserResponseBO();

                TransactionAppService transactionAppService = new TransactionAppService();
                transactionAppService.CreateWithdrawalRequest(walletTransaction);

                _apiResponse.HttpStatusCode = "200";
                _apiResponse.Message        = "Transaction successful";
                _apiResponse.Status         = "Success";

                return(Ok(_apiResponse));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }
Пример #6
0
        public ActionResult Create()
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserAppService userAppService = new UserAppService();
                TblUserInfo    userInfo       = userAppService.Get(userAuth);

                WalletBO wallet = new WalletBO();
                wallet.xPriv = "Cardano private key";
                wallet.xPub  = "Cardano public key";

                return(Ok(wallet));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }
Пример #7
0
        public ActionResult Wallet()
        {
            UserWalletAppService userWalletAppService = new UserWalletAppService();
            UserResponseBO       _apiResponse         = new UserResponseBO();

            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                _apiResponse.UserWallet = userWalletAppService.GetBO(userAuth);

                _apiResponse.HttpStatusCode = "200";
                _apiResponse.Message        = "UserWallet GET";
                _apiResponse.Status         = "Success";
            }
            catch (Exception ex)
            {
                _apiResponse.HttpStatusCode = "500";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";
            }

            return(Ok(_apiResponse));
        }
Пример #8
0
        public ActionResult GetBalance([FromBody] AddressBO address)
        {
            try
            {
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserAppService userAppService = new UserAppService();
                TblUserInfo    userInfo       = userAppService.Get(userAuth);

                AddressBO addressBO = new AddressBO();
                addressBO.AddressString = address.AddressString;
                addressBO.Value.Amount  = 10m;

                return(Ok(addressBO));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #9
0
        public ActionResult GetServerBalance()
        {
            try
            {
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserAppService userAppService = new UserAppService();
                TblUserInfo    userInfo       = userAppService.Get(userAuth);

                ServerWalletBO serverWallet = new ServerWalletBO();
                serverWallet.ServerBalance          = 10000;
                serverWallet.ServerDeposit          = 2000;
                serverWallet.TransferedToColdWallet = 30m;

                return(Ok(serverWallet));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #10
0
        public ActionResult History([FromBody] WalletBO wallet)
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserAppService userAppService = new UserAppService();
                TblUserInfo    userInfo       = userAppService.Get(userAuth);

                List <WalletTransactionBO> walletTransactions = new List <WalletTransactionBO>();

                WalletTransactionBO walletTransaction = new WalletTransactionBO();
                walletTransaction.From   = "from wallet address..";
                walletTransaction.To     = "to wallet address..";
                walletTransaction.Amount = 100f;

                walletTransactions.Add(walletTransaction);

                walletTransaction.From   = "from wallet address..";
                walletTransaction.To     = "to wallet address..";
                walletTransaction.Amount = 100f;

                walletTransactions.Add(walletTransaction);

                return(Ok(walletTransactions));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }
Пример #11
0
        public ActionResult History([FromBody] TransactionQueryBO transactionQuery)
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                TransactionAppService           transactionAppService    = new TransactionAppService();
                List <UserTransactionHistoryBO> userTransactionHistories = transactionAppService.Get(transactionQuery);

                return(Ok(userTransactionHistories));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }