lbryio / lbry-desktop

A browser and wallet for LBRY, the decentralized, user-controlled content marketplace.
https://lbry.tech
MIT License
3.56k stars 413 forks source link

Add support for swapping into LBC #5503

Closed kauffj closed 3 years ago

kauffj commented 3 years ago

Views: This is the first view. Use Lbryio.call('btc', 'rate', { satoshis: amountFromInput }) to get the LBC estimate

Screen Shot 2021-03-09 at 3 04 58 PM

When users clicks "Start Swap" button, call `Lbryio.call('btc', 'swap', { lbc_satoshi_requested: lbcAmountFromRateCall, btc_satoshi_provided: btcAmountFromInput, pay_to_wallet_address: usersLbcWalletAddress })

After calling swap, call Lbryio.call('btc', 'status', { pay_to_address: usersLbcWalletAddress })

Screen Shot 2021-03-09 at 3 14 47 PM Screen Shot 2021-03-09 at 3 14 52 PM Screen Shot 2021-03-09 at 3 14 58 PM
kauffj commented 3 years ago

@seanyesmunt will flesh out this ticket and provide documentation, then hand to @infinite-persistence

neb-b commented 3 years ago

@infinite-persistence I updated this ticket with screenshots of the UI to build. Most of it should be able to be built just from using the same styles as the send/tip confirmation modal. https://github.com/lbryio/lbry-desktop/blob/master/ui/component/walletSendTip/view.jsx#L173-L197

There is also another response type from the status call. "error". I'm not sure how that should look yet, but probably just go back to the first view and trigger an error snack bar.

kauffj commented 3 years ago

@infinite-persistence the vendor we decided to use for processing supports multiple coins. Can you update this PR to support them? @tiger5226 has the details.