dcrdex icon indicating copy to clipboard operation
dcrdex copied to clipboard

core,ui: need asset-specific settings that are not wallet settings

Open chappjc opened this issue 2 years ago • 1 comments

I had started looking at asset-specific settings to be used by Core but not the wallets, such as a min swap conf setting, but didn't find an nice solution. We should do this soon though. Related to a min confs setting per asset, I was looking into a swap conf override (i.e. used to swap or redeem earlier than server requires, at your own discretion). I think we should do that too. The user should be able to decide to e.g. redeem taker's BTC swap tx after 1 conf instead of maybe a higher server setting of 3, if they want to.

https://github.com/decred/dcrdex/pull/1866/commits/a37e6ff3eec7804b77555a8e8fc606d0f8cf868c

Originally posted by @chappjc in https://github.com/decred/dcrdex/pull/1866#discussion_r992561844

There are other possible settings that we don't want as part of the ConfigOpts that are defined by the wallet's package, yet are still only specific to a certain asset.

I think these settings are most logically shown on the UI with or near the wallet settings since the user doesn't care about the distinction as we understand it under-the-hood. They just want to change a setting that applies to a given "wallet" when it's really how they wish to handle certain things pertaining to that asset.

This has been something of a TODO ever since the introduction of the feeRateLimit, since at the time I argued that it was best for Core to handle this by simply blocking new orders when MaxFeeRate for that asset/market was higher than the setting, but we ended up giving it to the wallet and letting it error on FundOrder. We have since applied that setting in a range of other context, so I think that's fine now.

These settings should be part of the xcWallet struct, at the level of core. Some initial hacking: bdb379f6ca343ce5768b7d374920272795a2da57

chappjc avatar Oct 12 '22 16:10 chappjc

I think this initial hacking is a great start. I'd like to take this one

vctt94 avatar Oct 12 '22 19:10 vctt94