示例#1
0
        public async Task <IActionResult> ListCustodianAccount(string storeId, [FromQuery] bool assetBalances = false, CancellationToken cancellationToken = default)
        {
            var custodianAccounts = await _custodianAccountRepository.FindByStoreId(storeId);

            CustodianAccountDataClient[] responses = new CustodianAccountDataClient[custodianAccounts.Length];

            for (int i = 0; i < custodianAccounts.Length; i++)
            {
                var custodianAccountData = custodianAccounts[i];
                responses[i] = await ToModel(custodianAccountData, assetBalances, cancellationToken);
            }

            return(Ok(responses));
        }
示例#2
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var store = ViewContext.HttpContext.GetStoreData();
            var vm    = new MainNavViewModel {
                Store = store
            };

#if ALTCOINS
            vm.AltcoinsBuild = true;
#endif
            if (store != null)
            {
                var storeBlob = store.GetStoreBlob();

                // Wallets
                _storesController.AddPaymentMethods(store, storeBlob,
                                                    out var derivationSchemes, out var lightningNodes);
                vm.DerivationSchemes = derivationSchemes;
                vm.LightningNodes    = lightningNodes;

                // Apps
                var apps = await _appService.GetAllApps(UserId, false, store.Id);

                vm.Apps = apps.Select(a => new StoreApp
                {
                    Id      = a.Id,
                    AppName = a.AppName,
                    AppType = a.AppType,
                    IsOwner = a.IsOwner
                }).ToList();


                if (PoliciesSettings.Experimental)
                {
                    // Custodian Accounts
                    var custodianAccounts = await _custodianAccountRepository.FindByStoreId(store.Id);

                    vm.CustodianAccounts = custodianAccounts;
                }
            }

            return(View(vm));
        }