btcpayserver/BTCPayServer/Controllers
Wouter Samaey 2abc35058b
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 22:42:50 +09:00
..
GreenField Custodian Account UI: CRUD (#3923) 2022-07-07 22:42:50 +09:00
BitpayAccessTokenController.cs Rename controllers Bitpay controllers 2022-01-14 12:21:06 +09:00
BitpayInvoiceController.cs Refactoring: Extract HttpRequest extensions 2022-03-08 08:17:39 +00:00
BitpayRateController.cs Refactoring: Bitpay Rate Controller 2022-06-06 10:34:52 +02:00
LightningAddressService.cs Transfer Processors (#3476) 2022-04-24 12:19:34 +09:00
LnurlAuthService.cs Custodian Account UI: CRUD (#3923) 2022-07-07 22:42:50 +09:00
Macaroons.cs Use ArgumentNullException.ThrowIfNull everywhere (#3239) 2021-12-28 17:39:54 +09:00
UIAccountController.cs Allow resolution of any settings via DI 2022-05-24 14:10:19 +09:00
UIAppsController.Crowdfund.cs Dashboard: Add Point Of Sale data (#3897) 2022-06-28 14:05:02 +09:00
UIAppsController.cs Crowdfund finetuning (#3488) 2022-06-28 12:03:13 +09:00
UIAppsController.Dashboard.cs Async dashboard (#3916) 2022-07-06 12:40:16 +09:00
UIAppsController.PointOfSale.cs Dashboard: Add Point Of Sale data (#3897) 2022-06-28 14:05:02 +09:00
UIAppsPublicController.cs Dashboard: Add Point Of Sale data (#3897) 2022-06-28 14:05:02 +09:00
UICustodianAccountsController.cs Custodian Account UI: CRUD (#3923) 2022-07-07 22:42:50 +09:00
UIErrorController.cs Rename UI controllers 2022-01-14 13:46:03 +09:00
UIHomeController.cs Allow resolution of any settings via DI 2022-05-24 14:10:19 +09:00
UIInvoiceController.cs Make LNURL enabled when only method (#3930) 2022-07-06 22:09:05 +09:00
UIInvoiceController.Testing.cs fix cheat mode when default payment is not onchain 2022-06-30 08:46:34 +02:00
UIInvoiceController.UI.cs Add link to the order id if there is a orderUrl 2022-07-07 21:55:00 +09:00
UILNURLAuthController.cs Rename LNUrlAuthController -> UILNAuthController (#3352) 2022-01-25 11:51:14 +09:00
UILNURLController.cs Make LNURL enabled when only method (#3930) 2022-07-06 22:09:05 +09:00
UIManageController.2FA.cs Rename LNUrlAuthController -> UILNAuthController (#3352) 2022-01-25 11:51:14 +09:00
UIManageController.APIKeys.cs Fix empty permissions case 2022-06-29 15:36:54 +02:00
UIManageController.cs Improve email settings validation and UX (#3891) 2022-06-23 13:41:52 +09:00
UIManageController.LoginCodes.cs Rename UI controllers 2022-01-14 13:46:03 +09:00
UIManageController.Notifications.cs Use nicer urls, part2 (Fix #921) 2022-01-15 14:54:06 +09:00
UINotificationsController.cs Notifications: Fix mark all as seen return URL 2022-06-10 08:17:06 +02:00
UIPaymentRequestController.cs Move View action to the Name column in Payouts & Payment Requests (#3873) 2022-06-20 11:52:12 +09:00
UIPublicController.cs Add spam rate limits for public invoice endpoints (Fix #3782) (#3889) 2022-06-21 12:33:20 +09:00
UIPublicLightningNodeInfoController.cs Rename UI controllers 2022-01-14 13:46:03 +09:00
UIPullPaymentController.cs Allow pull payments denominated in SATS to be claimed 2022-05-25 12:59:57 +02:00
UIServerController.cs Improve email settings validation and UX (#3891) 2022-06-23 13:41:52 +09:00
UIServerController.Plugins.cs UI: Fix cancel plugin command (#3903) 2022-06-28 17:38:47 +09:00
UIServerController.Storage.cs Server Settings: Consolidate Storage and Files (#3863) 2022-06-15 21:06:16 +09:00
UIServerController.Users.cs Improve email settings validation and UX (#3891) 2022-06-23 13:41:52 +09:00
UIStorageController.cs Fix possible NRE 2022-05-02 09:43:55 +09:00
UIStorePullPaymentsController.PullPayments.cs Support Lnurl Withdraw in pull payments (#3709) 2022-06-28 23:02:17 +09:00
UIStoresController.cs Public Invoice receipt (#3612) 2022-07-06 21:14:55 +09:00
UIStoresController.Dashboard.cs Don't show "Set up a Lightning node" when LN is not supported (#3935) 2022-07-07 10:38:51 +09:00
UIStoresController.Email.cs Fix email rule remove action (#3901) 2022-06-28 14:10:45 +09:00
UIStoresController.Integrations.cs Rewording: Integrations become (store) plugins 2022-05-12 13:32:40 +02:00
UIStoresController.LightningLike.cs Dashboard: Load Lightning balance async, display default currency (#3907) 2022-07-04 11:03:16 +09:00
UIStoresController.Onchain.cs Allow resolution of any settings via DI 2022-05-24 14:10:19 +09:00
UIUserStoresController.cs Create store: Add default currency and rate provider fields 2022-01-25 06:57:55 +01:00
UIVaultController.cs Rename UI controllers 2022-01-14 13:46:03 +09:00
UIWalletsController.cs Do not prefilter if label filter in transaction view 2022-07-06 13:00:41 +09:00
UIWalletsController.PSBT.cs Improve wallet nav (#3921) 2022-07-04 13:20:08 +09:00