2021-12-11 04:32:23 +01:00
|
|
|
@using BTCPayServer.Views.Server
|
|
|
|
@using BTCPayServer.Views.Stores
|
|
|
|
@using BTCPayServer.Views.Apps
|
|
|
|
@using BTCPayServer.Views.Invoice
|
|
|
|
@using BTCPayServer.Views.Manage
|
|
|
|
@using BTCPayServer.Views.PaymentRequest
|
|
|
|
@using BTCPayServer.Views.Wallets
|
|
|
|
@using BTCPayServer.Abstractions.Extensions
|
2021-12-16 15:17:51 +01:00
|
|
|
@using BTCPayServer.Client
|
2022-05-24 13:18:16 +09:00
|
|
|
@using BTCPayServer.Services
|
Custodian Account UI: CRUD (#3923)
* WIP New APIs for dealing with custodians/exchanges
* Simplified things
* More API refinements + index.html file for quick viewing
* Finishing touches on spec
* Switched cryptoCode to paymentMethod as this allows us to differentiate between onchain and lightning
* Moved draft API docs to "/docs-draft"
* WIP baby steps
* Added DB migration for CustodianAccountData
* Rough but working POST /v1/api/custodian-account + GET /v1/api/custodian
* WIP + early Kraken API client
* Moved service registration to proper location
* Working create + list custodian accounts + permissions + WIP Kraken client
* Kraken API Balances call is working
* Added asset balances to response
* List Custodian Accounts call does not load assetBalances by default, because it can fail. Can be requested when needed.
* Call to get the details of 1 specific custodian account
* Added permissions to swagger
* Added "tradableAssetPairs" to Kraken custodian response + cache the tradable pairs in memory for 24 hours
* Removed unused file
* WIP + Moved files to better locations
* Updated docs
* Working API endpoint to get info on a trade (same response as creating a new trade)
* Working API endpoints for Deposit + Trade + untested Withdraw
* Delete custodian account
* Trading works, better error handling, cleanup
* Working withdrawals + New endpoint for getting bid/ask prices
* Completed withdrawals + new endpoint for getting info on a past withdrawal to simplify testing, Enums are output as strings,
* Better error handling when withdrawing to a wrong destination
* WithdrawalAddressName in config is now a string per currency (dictionary)
* Added TODOs
* Only show the custodian account "config" to users who are allowed
* Added the new permissions to the API Keys UI
* Renamed KrakenClient to KrakenExchange
* WIP Kraken Config Form
* Removed files for UI again, will make separate PR later
* Fixed docs + Refactored to use PaymentMethod more + Added "name" to custodian account + Using cancelationToken everywhere
* Updated withdrawal info docs
* First unit test
* Complete tests for /api/v1/custodians and /api/v1/custodian-accounts endpoints + Various improvements and fixes
* Mock custodian and more exceptions
* Many more tests + cleanup, moved files to better locations
* More tests
* WIP more tests
* Greenfield API tests complete
* Added missing "Name" column
* Cleanup, TODOs and beginning of Kraken Tests
* Added Kraken tests using public endpoints + handling of "SATS" currency
* Added 1st mocked Kraken API call: GetAssetBalancesAsync
* Added assert for bad config
* Mocked more Kraken API responses + added CreationDate to withdrawal response
* pr review club changes
* Make Kraken Custodian a plugin
* Re-added User-Agent header as it is required
* Fixed bug in market trade on Kraken using a percentage as qty
* A short delay so Kraken has the time to execute the market order and we don't fetch the details too quickly.
* Merged the draft swagger into the main swagger since it didn't work anymore
* Fixed API permissions test
* Removed 2 TODOs
* Fixed unit test
* After a utxo rescan, the cached balance should be invalidated
* Fixed Kraken plugin build issues
* Added Kraken plugin to build
* WIP UI + config form
* Create custodian account almost working - only need to add in the config form
* Working form, but lacks refinement
* Viewing balances + Editing custodian account works, but cannot change the withdrawal destination config because that is an object using a name with [] in it
* cleanup
* Minor cleanup, comments
* Working: Delete custodian account
* Moved the MockCustodian used in tests to a new plugin + linked it to the tests
* WIP viewing custodian account balances
* Split the Mock custodian into a Mock + Fake, various UI improvements and minor fixes
* Minor UI fixes
* Removed broken link
* Removed links to anchors as they cannot pass the tests since they use JavaScript
* Removed non-existing link. Even though it was commented out, the test still broke?
* Added TODOs
* Now throwing BadConfigException if API key is invalid
* UI improvements
* Commented out unfinished API endpoints. Can be finished later.
* Show fiat value for fiat assets
* Removed Kraken plugin so I can make a PR
Removed more Kraken files
* Add experimental route on UICustodianAccountsControllre
* Removed unneeded code
* Cleanup code
* Processed Nicolas' feedback
Co-authored-by: Kukks <evilkukka@gmail.com>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-07-07 15:42:50 +02:00
|
|
|
@using BTCPayServer.Views.CustodianAccounts
|
2022-11-22 03:32:19 +09:00
|
|
|
@inject Microsoft.AspNetCore.Http.IHttpContextAccessor HttpContext;
|
2022-07-22 14:58:25 +02:00
|
|
|
@inject BTCPayServerEnvironment Env
|
2021-12-11 04:32:23 +01:00
|
|
|
@inject SignInManager<ApplicationUser> SignInManager
|
2022-05-24 13:18:16 +09:00
|
|
|
@inject PoliciesSettings PoliciesSettings
|
|
|
|
@inject ThemeSettings Theme
|
2021-12-11 04:32:23 +01:00
|
|
|
|
|
|
|
@model BTCPayServer.Components.MainNav.MainNavViewModel
|
|
|
|
|
|
|
|
<nav id="mainNav" class="d-flex flex-column justify-content-between">
|
|
|
|
<div class="accordion px-3 px-lg-4">
|
|
|
|
@if (SignInManager.IsSignedIn(User))
|
|
|
|
{
|
2021-12-31 08:36:38 +01:00
|
|
|
@if (Model.Store != null)
|
2021-12-11 04:32:23 +01:00
|
|
|
{
|
2021-12-16 15:17:51 +01:00
|
|
|
<div class="accordion-item" permission="@Policies.CanModifyStoreSettings">
|
2021-12-11 04:32:23 +01:00
|
|
|
<div class="accordion-body">
|
|
|
|
<ul class="navbar-nav">
|
2022-01-13 09:08:15 +01:00
|
|
|
<li class="nav-item">
|
2022-12-22 07:09:12 +01:00
|
|
|
<a asp-area="" asp-controller="UIStores" asp-action="Dashboard" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.Dashboard)" id="StoreNav-Dashboard">
|
2022-01-13 09:08:15 +01:00
|
|
|
<vc:icon symbol="home"/>
|
|
|
|
<span>Dashboard</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item">
|
2023-04-05 15:09:42 +02:00
|
|
|
<a asp-area="" asp-controller="UIStores" asp-action="GeneralSettings" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(new [] {StoreNavPages.Rates, StoreNavPages.CheckoutAppearance, StoreNavPages.General, StoreNavPages.Tokens, StoreNavPages.Users, StoreNavPages.Webhooks, StoreNavPages.PayoutProcessors, StoreNavPages.Emails})" id="StoreNav-StoreSettings">
|
2022-01-13 09:08:15 +01:00
|
|
|
<vc:icon symbol="settings"/>
|
|
|
|
<span>Settings</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
2021-12-11 04:32:23 +01:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-01-18 02:20:59 +01:00
|
|
|
<div class="accordion-item">
|
|
|
|
<header class="accordion-header" id="Nav-Wallets-Header" permission="@Policies.CanModifyStoreSettings">
|
2022-01-13 09:08:15 +01:00
|
|
|
<div class="accordion-button">
|
|
|
|
Wallets
|
|
|
|
</div>
|
2021-12-11 04:32:23 +01:00
|
|
|
</header>
|
2022-01-18 02:20:59 +01:00
|
|
|
<div id="Nav-Wallets" class="accordion-collapse" aria-labelledby="Nav-Wallets-Header" permission="@Policies.CanModifyStoreSettings">
|
2021-12-11 04:32:23 +01:00
|
|
|
<div class="accordion-body">
|
|
|
|
<ul class="navbar-nav">
|
2022-01-13 09:08:15 +01:00
|
|
|
@foreach (var scheme in Model.DerivationSchemes.OrderBy(scheme => scheme.Collapsed))
|
|
|
|
{
|
|
|
|
var isSetUp = !string.IsNullOrWhiteSpace(scheme.Value);
|
|
|
|
<li class="nav-item">
|
|
|
|
@if (isSetUp && scheme.WalletSupported)
|
|
|
|
{
|
2022-12-22 07:09:12 +01:00
|
|
|
<a asp-area="" asp-controller="UIWallets" asp-action="WalletTransactions" asp-route-walletId="@scheme.WalletId" class="nav-link @ViewData.IsActiveCategory(typeof(WalletsNavPages), scheme.WalletId.ToString()) @ViewData.IsActivePage(StoreNavPages.OnchainSettings)" id="@($"StoreNav-Wallet{scheme.Crypto}")">
|
2022-01-24 18:07:52 -08:00
|
|
|
<span class="me-2 btcpay-status btcpay-status--@(scheme.Enabled ? "enabled" : "pending")"></span>
|
2022-03-25 10:45:11 +00:00
|
|
|
<span>@(Model.AltcoinsBuild ? $"{scheme.Crypto} Wallet" : "Bitcoin")</span>
|
2022-01-13 09:08:15 +01:00
|
|
|
</a>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-01-19 12:58:02 +01:00
|
|
|
<a asp-area="" asp-controller="UIStores" asp-action="SetupWallet" asp-route-cryptoCode="@scheme.Crypto" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.OnchainSettings)" id="@($"StoreNav-Wallet{scheme.Crypto}")">
|
2022-01-24 18:07:52 -08:00
|
|
|
<span class="me-2 btcpay-status btcpay-status--@(scheme.Enabled ? "enabled" : "pending")"></span>
|
2022-03-25 10:45:11 +00:00
|
|
|
<span>@(Model.AltcoinsBuild ? $"{scheme.Crypto} Wallet" : "Bitcoin")</span>
|
2022-01-13 09:08:15 +01:00
|
|
|
</a>
|
|
|
|
}
|
|
|
|
</li>
|
|
|
|
}
|
|
|
|
@foreach (var scheme in Model.LightningNodes)
|
|
|
|
{
|
|
|
|
var isSetUp = !string.IsNullOrWhiteSpace(scheme.Address);
|
|
|
|
<li class="nav-item">
|
|
|
|
@if (isSetUp)
|
|
|
|
{
|
2022-01-19 03:52:05 +01:00
|
|
|
<a asp-area="" asp-controller="UIStores" asp-action="Lightning" asp-route-cryptoCode="@scheme.CryptoCode" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.Lightning) @ViewData.IsActivePage(StoreNavPages.LightningSettings)" id="@($"StoreNav-Lightning{scheme.CryptoCode}")">
|
2022-01-24 18:07:52 -08:00
|
|
|
<span class="me-2 btcpay-status btcpay-status--@(scheme.Enabled ? "enabled" : "pending")"></span>
|
2022-01-13 09:08:15 +01:00
|
|
|
<span>@(Model.AltcoinsBuild ? $"{scheme.CryptoCode} " : "")Lightning</span>
|
|
|
|
</a>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-01-07 12:32:00 +09:00
|
|
|
<a asp-area="" asp-controller="UIStores" asp-action="SetupLightningNode" asp-route-cryptoCode="@scheme.CryptoCode" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.LightningSettings)" id="@($"StoreNav-Lightning{scheme.CryptoCode}")">
|
2022-01-24 18:07:52 -08:00
|
|
|
<span class="me-2 btcpay-status btcpay-status--@(scheme.Enabled ? "enabled" : "pending")"></span>
|
2022-01-13 09:08:15 +01:00
|
|
|
<span>@(Model.AltcoinsBuild ? $"{scheme.CryptoCode} " : "")Lightning</span>
|
|
|
|
</a>
|
|
|
|
}
|
|
|
|
|
|
|
|
</li>
|
|
|
|
}
|
2022-08-15 20:21:20 +02:00
|
|
|
<vc:ui-extension-point location="store-wallets-nav" model="@Model"/>
|
Custodian Account UI: CRUD (#3923)
* WIP New APIs for dealing with custodians/exchanges
* Simplified things
* More API refinements + index.html file for quick viewing
* Finishing touches on spec
* Switched cryptoCode to paymentMethod as this allows us to differentiate between onchain and lightning
* Moved draft API docs to "/docs-draft"
* WIP baby steps
* Added DB migration for CustodianAccountData
* Rough but working POST /v1/api/custodian-account + GET /v1/api/custodian
* WIP + early Kraken API client
* Moved service registration to proper location
* Working create + list custodian accounts + permissions + WIP Kraken client
* Kraken API Balances call is working
* Added asset balances to response
* List Custodian Accounts call does not load assetBalances by default, because it can fail. Can be requested when needed.
* Call to get the details of 1 specific custodian account
* Added permissions to swagger
* Added "tradableAssetPairs" to Kraken custodian response + cache the tradable pairs in memory for 24 hours
* Removed unused file
* WIP + Moved files to better locations
* Updated docs
* Working API endpoint to get info on a trade (same response as creating a new trade)
* Working API endpoints for Deposit + Trade + untested Withdraw
* Delete custodian account
* Trading works, better error handling, cleanup
* Working withdrawals + New endpoint for getting bid/ask prices
* Completed withdrawals + new endpoint for getting info on a past withdrawal to simplify testing, Enums are output as strings,
* Better error handling when withdrawing to a wrong destination
* WithdrawalAddressName in config is now a string per currency (dictionary)
* Added TODOs
* Only show the custodian account "config" to users who are allowed
* Added the new permissions to the API Keys UI
* Renamed KrakenClient to KrakenExchange
* WIP Kraken Config Form
* Removed files for UI again, will make separate PR later
* Fixed docs + Refactored to use PaymentMethod more + Added "name" to custodian account + Using cancelationToken everywhere
* Updated withdrawal info docs
* First unit test
* Complete tests for /api/v1/custodians and /api/v1/custodian-accounts endpoints + Various improvements and fixes
* Mock custodian and more exceptions
* Many more tests + cleanup, moved files to better locations
* More tests
* WIP more tests
* Greenfield API tests complete
* Added missing "Name" column
* Cleanup, TODOs and beginning of Kraken Tests
* Added Kraken tests using public endpoints + handling of "SATS" currency
* Added 1st mocked Kraken API call: GetAssetBalancesAsync
* Added assert for bad config
* Mocked more Kraken API responses + added CreationDate to withdrawal response
* pr review club changes
* Make Kraken Custodian a plugin
* Re-added User-Agent header as it is required
* Fixed bug in market trade on Kraken using a percentage as qty
* A short delay so Kraken has the time to execute the market order and we don't fetch the details too quickly.
* Merged the draft swagger into the main swagger since it didn't work anymore
* Fixed API permissions test
* Removed 2 TODOs
* Fixed unit test
* After a utxo rescan, the cached balance should be invalidated
* Fixed Kraken plugin build issues
* Added Kraken plugin to build
* WIP UI + config form
* Create custodian account almost working - only need to add in the config form
* Working form, but lacks refinement
* Viewing balances + Editing custodian account works, but cannot change the withdrawal destination config because that is an object using a name with [] in it
* cleanup
* Minor cleanup, comments
* Working: Delete custodian account
* Moved the MockCustodian used in tests to a new plugin + linked it to the tests
* WIP viewing custodian account balances
* Split the Mock custodian into a Mock + Fake, various UI improvements and minor fixes
* Minor UI fixes
* Removed broken link
* Removed links to anchors as they cannot pass the tests since they use JavaScript
* Removed non-existing link. Even though it was commented out, the test still broke?
* Added TODOs
* Now throwing BadConfigException if API key is invalid
* UI improvements
* Commented out unfinished API endpoints. Can be finished later.
* Show fiat value for fiat assets
* Removed Kraken plugin so I can make a PR
Removed more Kraken files
* Add experimental route on UICustodianAccountsControllre
* Removed unneeded code
* Cleanup code
* Processed Nicolas' feedback
Co-authored-by: Kukks <evilkukka@gmail.com>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-07-07 15:42:50 +02:00
|
|
|
@if (PoliciesSettings.Experimental)
|
|
|
|
{
|
|
|
|
@foreach (var custodianAccount in Model.CustodianAccounts)
|
|
|
|
{
|
|
|
|
<li class="nav-item">
|
2022-12-22 07:09:12 +01:00
|
|
|
<a asp-area="" asp-controller="UICustodianAccounts" asp-action="ViewCustodianAccount" asp-route-storeId="@custodianAccount.StoreId" asp-route-accountId="@custodianAccount.Id" class="nav-link @ViewData.IsActivePage(CustodianAccountsNavPages.View, custodianAccount.Id)" id="@($"StoreNav-CustodianAccount-{custodianAccount.Id}")">
|
2022-07-18 20:51:53 +02:00
|
|
|
@* TODO which icon should we use? *@
|
Custodian Account UI: CRUD (#3923)
* WIP New APIs for dealing with custodians/exchanges
* Simplified things
* More API refinements + index.html file for quick viewing
* Finishing touches on spec
* Switched cryptoCode to paymentMethod as this allows us to differentiate between onchain and lightning
* Moved draft API docs to "/docs-draft"
* WIP baby steps
* Added DB migration for CustodianAccountData
* Rough but working POST /v1/api/custodian-account + GET /v1/api/custodian
* WIP + early Kraken API client
* Moved service registration to proper location
* Working create + list custodian accounts + permissions + WIP Kraken client
* Kraken API Balances call is working
* Added asset balances to response
* List Custodian Accounts call does not load assetBalances by default, because it can fail. Can be requested when needed.
* Call to get the details of 1 specific custodian account
* Added permissions to swagger
* Added "tradableAssetPairs" to Kraken custodian response + cache the tradable pairs in memory for 24 hours
* Removed unused file
* WIP + Moved files to better locations
* Updated docs
* Working API endpoint to get info on a trade (same response as creating a new trade)
* Working API endpoints for Deposit + Trade + untested Withdraw
* Delete custodian account
* Trading works, better error handling, cleanup
* Working withdrawals + New endpoint for getting bid/ask prices
* Completed withdrawals + new endpoint for getting info on a past withdrawal to simplify testing, Enums are output as strings,
* Better error handling when withdrawing to a wrong destination
* WithdrawalAddressName in config is now a string per currency (dictionary)
* Added TODOs
* Only show the custodian account "config" to users who are allowed
* Added the new permissions to the API Keys UI
* Renamed KrakenClient to KrakenExchange
* WIP Kraken Config Form
* Removed files for UI again, will make separate PR later
* Fixed docs + Refactored to use PaymentMethod more + Added "name" to custodian account + Using cancelationToken everywhere
* Updated withdrawal info docs
* First unit test
* Complete tests for /api/v1/custodians and /api/v1/custodian-accounts endpoints + Various improvements and fixes
* Mock custodian and more exceptions
* Many more tests + cleanup, moved files to better locations
* More tests
* WIP more tests
* Greenfield API tests complete
* Added missing "Name" column
* Cleanup, TODOs and beginning of Kraken Tests
* Added Kraken tests using public endpoints + handling of "SATS" currency
* Added 1st mocked Kraken API call: GetAssetBalancesAsync
* Added assert for bad config
* Mocked more Kraken API responses + added CreationDate to withdrawal response
* pr review club changes
* Make Kraken Custodian a plugin
* Re-added User-Agent header as it is required
* Fixed bug in market trade on Kraken using a percentage as qty
* A short delay so Kraken has the time to execute the market order and we don't fetch the details too quickly.
* Merged the draft swagger into the main swagger since it didn't work anymore
* Fixed API permissions test
* Removed 2 TODOs
* Fixed unit test
* After a utxo rescan, the cached balance should be invalidated
* Fixed Kraken plugin build issues
* Added Kraken plugin to build
* WIP UI + config form
* Create custodian account almost working - only need to add in the config form
* Working form, but lacks refinement
* Viewing balances + Editing custodian account works, but cannot change the withdrawal destination config because that is an object using a name with [] in it
* cleanup
* Minor cleanup, comments
* Working: Delete custodian account
* Moved the MockCustodian used in tests to a new plugin + linked it to the tests
* WIP viewing custodian account balances
* Split the Mock custodian into a Mock + Fake, various UI improvements and minor fixes
* Minor UI fixes
* Removed broken link
* Removed links to anchors as they cannot pass the tests since they use JavaScript
* Removed non-existing link. Even though it was commented out, the test still broke?
* Added TODOs
* Now throwing BadConfigException if API key is invalid
* UI improvements
* Commented out unfinished API endpoints. Can be finished later.
* Show fiat value for fiat assets
* Removed Kraken plugin so I can make a PR
Removed more Kraken files
* Add experimental route on UICustodianAccountsControllre
* Removed unneeded code
* Cleanup code
* Processed Nicolas' feedback
Co-authored-by: Kukks <evilkukka@gmail.com>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-07-07 15:42:50 +02:00
|
|
|
<span>@custodianAccount.Name</span>
|
|
|
|
<span class="badge bg-warning ms-1" style="font-size:10px;">Experimental</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
}
|
|
|
|
<li class="nav-item">
|
2022-12-22 07:09:12 +01:00
|
|
|
<a asp-area="" asp-controller="UICustodianAccounts" asp-action="CreateCustodianAccount" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(CustodianAccountsNavPages.Create)" id="StoreNav-CreateCustodianAccount">
|
Custodian Account UI: CRUD (#3923)
* WIP New APIs for dealing with custodians/exchanges
* Simplified things
* More API refinements + index.html file for quick viewing
* Finishing touches on spec
* Switched cryptoCode to paymentMethod as this allows us to differentiate between onchain and lightning
* Moved draft API docs to "/docs-draft"
* WIP baby steps
* Added DB migration for CustodianAccountData
* Rough but working POST /v1/api/custodian-account + GET /v1/api/custodian
* WIP + early Kraken API client
* Moved service registration to proper location
* Working create + list custodian accounts + permissions + WIP Kraken client
* Kraken API Balances call is working
* Added asset balances to response
* List Custodian Accounts call does not load assetBalances by default, because it can fail. Can be requested when needed.
* Call to get the details of 1 specific custodian account
* Added permissions to swagger
* Added "tradableAssetPairs" to Kraken custodian response + cache the tradable pairs in memory for 24 hours
* Removed unused file
* WIP + Moved files to better locations
* Updated docs
* Working API endpoint to get info on a trade (same response as creating a new trade)
* Working API endpoints for Deposit + Trade + untested Withdraw
* Delete custodian account
* Trading works, better error handling, cleanup
* Working withdrawals + New endpoint for getting bid/ask prices
* Completed withdrawals + new endpoint for getting info on a past withdrawal to simplify testing, Enums are output as strings,
* Better error handling when withdrawing to a wrong destination
* WithdrawalAddressName in config is now a string per currency (dictionary)
* Added TODOs
* Only show the custodian account "config" to users who are allowed
* Added the new permissions to the API Keys UI
* Renamed KrakenClient to KrakenExchange
* WIP Kraken Config Form
* Removed files for UI again, will make separate PR later
* Fixed docs + Refactored to use PaymentMethod more + Added "name" to custodian account + Using cancelationToken everywhere
* Updated withdrawal info docs
* First unit test
* Complete tests for /api/v1/custodians and /api/v1/custodian-accounts endpoints + Various improvements and fixes
* Mock custodian and more exceptions
* Many more tests + cleanup, moved files to better locations
* More tests
* WIP more tests
* Greenfield API tests complete
* Added missing "Name" column
* Cleanup, TODOs and beginning of Kraken Tests
* Added Kraken tests using public endpoints + handling of "SATS" currency
* Added 1st mocked Kraken API call: GetAssetBalancesAsync
* Added assert for bad config
* Mocked more Kraken API responses + added CreationDate to withdrawal response
* pr review club changes
* Make Kraken Custodian a plugin
* Re-added User-Agent header as it is required
* Fixed bug in market trade on Kraken using a percentage as qty
* A short delay so Kraken has the time to execute the market order and we don't fetch the details too quickly.
* Merged the draft swagger into the main swagger since it didn't work anymore
* Fixed API permissions test
* Removed 2 TODOs
* Fixed unit test
* After a utxo rescan, the cached balance should be invalidated
* Fixed Kraken plugin build issues
* Added Kraken plugin to build
* WIP UI + config form
* Create custodian account almost working - only need to add in the config form
* Working form, but lacks refinement
* Viewing balances + Editing custodian account works, but cannot change the withdrawal destination config because that is an object using a name with [] in it
* cleanup
* Minor cleanup, comments
* Working: Delete custodian account
* Moved the MockCustodian used in tests to a new plugin + linked it to the tests
* WIP viewing custodian account balances
* Split the Mock custodian into a Mock + Fake, various UI improvements and minor fixes
* Minor UI fixes
* Removed broken link
* Removed links to anchors as they cannot pass the tests since they use JavaScript
* Removed non-existing link. Even though it was commented out, the test still broke?
* Added TODOs
* Now throwing BadConfigException if API key is invalid
* UI improvements
* Commented out unfinished API endpoints. Can be finished later.
* Show fiat value for fiat assets
* Removed Kraken plugin so I can make a PR
Removed more Kraken files
* Add experimental route on UICustodianAccountsControllre
* Removed unneeded code
* Cleanup code
* Processed Nicolas' feedback
Co-authored-by: Kukks <evilkukka@gmail.com>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2022-07-07 15:42:50 +02:00
|
|
|
<vc:icon symbol="new"/>
|
|
|
|
<span>Add Custodian</span>
|
|
|
|
<span class="badge bg-warning ms-1" style="font-size:10px;">Experimental</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
}
|
|
|
|
|
2021-12-11 04:32:23 +01:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-01-13 09:08:15 +01:00
|
|
|
<div class="accordion-item">
|
|
|
|
<header class="accordion-header" id="Nav-Payments-Header">
|
|
|
|
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#Nav-Payments" aria-expanded="true" aria-controls="Nav-Payments">
|
|
|
|
Payments
|
|
|
|
<vc:icon symbol="caret-down"/>
|
|
|
|
</button>
|
|
|
|
</header>
|
|
|
|
<div id="Nav-Payments" class="accordion-collapse collapse show" aria-labelledby="Nav-Payments-Header">
|
|
|
|
<div class="accordion-body">
|
|
|
|
<ul class="navbar-nav">
|
2022-01-18 02:20:59 +01:00
|
|
|
<li class="nav-item" permission="@Policies.CanViewInvoices">
|
2022-12-22 07:09:12 +01:00
|
|
|
<a asp-area="" asp-controller="UIInvoice" asp-action="ListInvoices" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActiveCategory(typeof(InvoiceNavPages))" id="StoreNav-Invoices">
|
2022-01-13 09:08:15 +01:00
|
|
|
<vc:icon symbol="invoice"/>
|
|
|
|
<span>Invoices</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item" permission="@Policies.CanModifyStoreSettings">
|
2022-12-22 07:09:12 +01:00
|
|
|
<a asp-area="" asp-controller="UIPaymentRequest" asp-action="GetPaymentRequests" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActiveCategory(typeof(PaymentRequestsNavPages))" id="StoreNav-PaymentRequests">
|
2022-01-24 18:07:52 -08:00
|
|
|
<vc:icon symbol="payment-requests"/>
|
2022-01-13 09:08:15 +01:00
|
|
|
<span>Requests</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
2022-01-18 02:20:59 +01:00
|
|
|
<li class="nav-item" permission="@Policies.CanViewStoreSettings">
|
2022-01-07 12:32:00 +09:00
|
|
|
<a asp-area="" asp-controller="UIStorePullPayments" asp-action="PullPayments" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.PullPayments)" id="StoreNav-PullPayments">
|
2022-01-24 18:07:52 -08:00
|
|
|
<vc:icon symbol="pull-payments"/>
|
2022-01-13 09:08:15 +01:00
|
|
|
<span>Pull Payments</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
2022-01-28 17:49:21 +09:00
|
|
|
<li class="nav-item" permission="@Policies.CanModifyStoreSettings">
|
2023-04-26 09:45:35 +02:00
|
|
|
<a asp-area=""
|
|
|
|
asp-controller="UIStorePullPayments" asp-action="Payouts"
|
|
|
|
asp-route-pullPaymentId=""
|
|
|
|
asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.Payouts)" id="StoreNav-Payouts">
|
2022-01-24 18:07:52 -08:00
|
|
|
<vc:icon symbol="payouts"/>
|
2022-01-13 09:08:15 +01:00
|
|
|
<span>Payouts</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-12-11 04:32:23 +01:00
|
|
|
</div>
|
2022-01-25 04:15:59 +01:00
|
|
|
}
|
|
|
|
<div class="accordion-item">
|
|
|
|
<header class="accordion-header" id="Nav-Plugins-Header">
|
|
|
|
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#Nav-Plugins" aria-expanded="true" aria-controls="Nav-Plugins">
|
|
|
|
Plugins
|
|
|
|
<vc:icon symbol="caret-down"/>
|
|
|
|
</button>
|
|
|
|
</header>
|
|
|
|
<div id="Nav-Plugins" class="accordion-collapse collapse show" aria-labelledby="Nav-Plugins-Header">
|
|
|
|
<div class="accordion-body">
|
|
|
|
<ul class="navbar-nav">
|
|
|
|
<vc:ui-extension-point location="header-nav" model="@Model"/>
|
|
|
|
@if (Model.Store != null)
|
|
|
|
{
|
|
|
|
<vc:ui-extension-point location="store-integrations-nav" model="@Model"/>
|
|
|
|
}
|
2023-03-18 22:36:26 +01:00
|
|
|
</ul>
|
|
|
|
<ul class="navbar-nav">
|
2022-01-25 04:15:59 +01:00
|
|
|
<li class="nav-item" permission="@Policies.CanModifyServerSettings">
|
2022-12-22 07:09:12 +01:00
|
|
|
<a asp-area="" asp-controller="UIServer" asp-action="ListPlugins" class="nav-link @ViewData.IsActivePage(ServerNavPages.Plugins)" id="Nav-ManagePlugins">
|
2023-03-18 22:36:26 +01:00
|
|
|
<vc:icon symbol="plugin"/>
|
2022-03-08 08:04:15 +01:00
|
|
|
<span>Manage Plugins</span>
|
2022-01-25 04:15:59 +01:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2021-12-11 04:32:23 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-01-25 04:15:59 +01:00
|
|
|
</div>
|
2021-12-11 04:32:23 +01:00
|
|
|
<script>
|
2022-04-18 03:25:00 +02:00
|
|
|
(() => {
|
|
|
|
// apply collapse settings
|
|
|
|
const navCollapsed = window.localStorage.getItem('btcpay-nav-collapsed')
|
|
|
|
const collapsed = navCollapsed ? JSON.parse(navCollapsed) : []
|
|
|
|
collapsed.forEach(id => {
|
|
|
|
const el = document.getElementById(id)
|
|
|
|
const btn = el && el.previousElementSibling.querySelector(`[aria-controls="${id}"]`)
|
|
|
|
if (el && btn) {
|
|
|
|
el.classList.remove('show')
|
|
|
|
btn.classList.add('collapsed')
|
|
|
|
btn.setAttribute('aria-expanded', 'false')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
// hide empty plugins drawer
|
|
|
|
const pluginsItem = document.getElementById('Nav-Plugins').closest('.accordion-item')
|
|
|
|
const pluginsContent = pluginsItem.querySelector('.navbar-nav').innerHTML.trim()
|
|
|
|
if (pluginsContent === '') {
|
|
|
|
pluginsItem.setAttribute('hidden', true)
|
2021-12-11 04:32:23 +01:00
|
|
|
}
|
2022-04-18 03:25:00 +02:00
|
|
|
})()
|
2021-12-11 04:32:23 +01:00
|
|
|
</script>
|
|
|
|
}
|
2022-11-22 03:32:19 +09:00
|
|
|
else if (Env.IsSecure(HttpContext.HttpContext))
|
2021-12-11 04:32:23 +01:00
|
|
|
{
|
|
|
|
<ul class="navbar-nav">
|
2022-05-24 13:18:16 +09:00
|
|
|
@if (!PoliciesSettings.LockSubscription)
|
2021-12-11 04:32:23 +01:00
|
|
|
{
|
|
|
|
<li class="nav-item">
|
2022-12-22 07:09:12 +01:00
|
|
|
<a asp-area="" asp-controller="UIAccount" asp-action="Register" class="nav-link" id="Nav-Register">Register</a>
|
2021-12-11 04:32:23 +01:00
|
|
|
</li>
|
|
|
|
}
|
|
|
|
<li class="nav-item">
|
2022-12-22 07:09:12 +01:00
|
|
|
<a asp-area="" asp-controller="UIAccount" asp-action="Login" class="nav-link" id="Nav-Login">Log in</a>
|
2021-12-11 04:32:23 +01:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
}
|
|
|
|
</div>
|
2022-01-07 17:25:28 +01:00
|
|
|
@if (SignInManager.IsSignedIn(User))
|
|
|
|
{
|
|
|
|
<ul id="mainNavSettings" class="navbar-nav border-top p-3 px-lg-4">
|
|
|
|
<li class="nav-item" permission="@Policies.CanModifyServerSettings">
|
2022-12-22 07:09:12 +01:00
|
|
|
<a asp-area="" asp-controller="UIServer" asp-action="ListUsers" class="nav-link @ViewData.IsActivePage(ServerNavPages.Users) @ViewData.IsActivePage(ServerNavPages.Emails) @ViewData.IsActivePage(ServerNavPages.Policies) @ViewData.IsActivePage(ServerNavPages.Services) @ViewData.IsActivePage(ServerNavPages.Theme) @ViewData.IsActivePage(ServerNavPages.Maintenance) @ViewData.IsActivePage(ServerNavPages.Logs) @ViewData.IsActivePage(ServerNavPages.Files)" id="Nav-ServerSettings">
|
2022-01-07 17:25:28 +01:00
|
|
|
<vc:icon symbol="server-settings"/>
|
|
|
|
<span>Server Settings</span>
|
|
|
|
</a>
|
2021-12-11 04:32:23 +01:00
|
|
|
</li>
|
2022-01-07 17:25:28 +01:00
|
|
|
<li class="nav-item dropup">
|
2022-12-22 07:09:12 +01:00
|
|
|
<a class="nav-link @ViewData.IsActiveCategory(typeof(ManageNavPages))" role="button" data-bs-toggle="dropdown" aria-expanded="false" id="Nav-Account">
|
2022-01-07 17:25:28 +01:00
|
|
|
<vc:icon symbol="account"/>
|
|
|
|
<span>Account</span>
|
|
|
|
</a>
|
|
|
|
<ul class="dropdown-menu py-0 w-100" aria-labelledby="Nav-Account">
|
|
|
|
<li class="p-3">
|
|
|
|
<strong class="d-block text-truncate" style="max-width:195px">@User.Identity.Name</strong>
|
|
|
|
@if (User.IsInRole(Roles.ServerAdmin))
|
|
|
|
{
|
|
|
|
<div class="text-secondary">Administrator</div>
|
|
|
|
}
|
|
|
|
</li>
|
2022-05-24 13:18:16 +09:00
|
|
|
@if (!Theme.CustomTheme)
|
2022-01-07 17:25:28 +01:00
|
|
|
{
|
|
|
|
<li class="border-top py-1 px-3">
|
|
|
|
<vc:theme-switch css-class="nav-link"/>
|
|
|
|
</li>
|
|
|
|
}
|
|
|
|
<li class="border-top py-1 px-3">
|
2022-01-07 12:32:00 +09:00
|
|
|
<a asp-area="" asp-controller="UIManage" asp-action="Index" class="nav-link @ViewData.IsActiveCategory(typeof(ManageNavPages))" id="Nav-ManageAccount">
|
2022-01-24 18:07:52 -08:00
|
|
|
<span>Manage Account</span>
|
2022-01-07 17:25:28 +01:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="border-top py-1 px-3">
|
2022-01-07 12:32:00 +09:00
|
|
|
<a asp-area="" asp-controller="UIAccount" asp-action="Logout" class="nav-link text-danger" id="Nav-Logout">
|
2022-01-07 17:25:28 +01:00
|
|
|
<span>Logout</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
}
|
2021-12-11 04:32:23 +01:00
|
|
|
</nav>
|