public async Task <IActionResult> GetOnChainWalletReceiveAddress(string storeId, string cryptoCode, bool forceGenerate = false)
        {
            if (IsInvalidWalletRequest(cryptoCode, out var network,
                                       out var derivationScheme, out var actionResult))
            {
                return(actionResult);
            }

            var kpi = await _walletReceiveService.GetOrGenerate(new WalletId(storeId, cryptoCode), forceGenerate);

            if (kpi is null)
            {
                return(BadRequest());
            }

            var bip21          = network.GenerateBIP21(kpi.Address?.ToString(), null);
            var allowedPayjoin = derivationScheme.IsHotWallet && Store.GetStoreBlob().PayJoinEnabled;

            if (allowedPayjoin)
            {
                bip21.QueryParams.Add(PayjoinClient.BIP21EndpointKey, Request.GetAbsoluteUri(Url.Action(nameof(PayJoinEndpointController.Submit), "PayJoinEndpoint", new { cryptoCode })));
            }
            return(Ok(new OnChainWalletAddressData()
            {
                Address = kpi.Address?.ToString(),
                PaymentLink = bip21.ToString(),
                KeyPath = kpi.KeyPath
            }));
        }
        public async Task <IActionResult> GetOnChainWalletReceiveAddress(string storeId, string cryptoCode, bool forceGenerate = false)
        {
            if (IsInvalidWalletRequest(cryptoCode, out BTCPayNetwork network,
                                       out DerivationSchemeSettings derivationScheme, out IActionResult actionResult))
            {
                return(actionResult);
            }

            var kpi = await _walletReceiveService.GetOrGenerate(new WalletId(storeId, cryptoCode), forceGenerate);

            if (kpi is null)
            {
                return(BadRequest());
            }
            return(Ok(new OnChainWalletAddressData()
            {
                Address = kpi.Address.ToString(),
                KeyPath = kpi.KeyPath
            }));
        }