tdex-network / tdex-daemon-alpha

💰 Alpha Daemon implementation to run automated market making strategies on top of TDEX
MIT License
0 stars 2 forks source link

[CLI] Change swap request behavior #40

Closed altafan closed 4 years ago

altafan commented 4 years ago

At the moment, when calling the swap request command, the very first question asks which asset of a market fetched from a provider the user wants to send. This command, thus, depends on the daemon! While its goal is to let the user create/accept/complete swaps of assets of his choice.

To fix this, we need to remove the toggle from the first question and let the user specify the hash of the assets that he wants to send and receive, so technically the question would change from:

Which asset do you want to send? LBTC / USDT

to:

Which asset do you want to send? <assetA> 
Which asset do you want to receive? <assetB>

To validate the assets provided by the user we would call the asset/:asset_id endpoint of the explorer to check that the asset exists (and eventually get its name and ticker if existing).