[PAY-479] Check recipient wallet SOL before send#1779
Conversation
|
Preview this change https://demo.audius.co/rt-PAY-479 |
rickyrombo
left a comment
There was a problem hiding this comment.
Looking good! Only a few notes.
Biggest thing is I don't think we should throw errors in selectors, I would never expect one to throw. If there's an error, it should be represented in the state that's returned. For this case, I'm not sure it's meaningful. Maybe we should just return whatever the state is for that member regardless of the stage?
|
Preview this change https://demo.audius.co/rt-PAY-479 |
|
Preview this change https://demo.audius.co/rt-PAY-479 |
piazzatron
left a comment
There was a problem hiding this comment.
Looks great!! Good looks including the screen recording too 👍
|
@piazzatron @rickyrombo can you guys take another look at this plz? Ended up changing a few things - added a loading state since with the extra RPC call now there's enough of a lag that the error message was flickering in. |
rickyrombo
left a comment
There was a problem hiding this comment.
Concerned about putting deps on web env in common - maybe this is why we had the wallet client/audius backend split?
|
Preview this change https://demo.audius.co/rt-PAY-479 |
piazzatron
left a comment
There was a problem hiding this comment.
Generally don't want to only show spinners for a fraction of a second if we can avoid it – let's huddle and think of a way around this
|
Preview this change https://demo.audius.co/rt-PAY-479 |
piazzatron
left a comment
There was a problem hiding this comment.
Looks great! Only nits :), 🚢
|
Preview this change https://demo.audius.co/rt-PAY-479 |
|
Preview this change https://demo.audius.co/rt-PAY-479 |
When transferring WAudio to an external wallet, throw an error if the recipient wouldn't be able to receive it, ie. if the recipient doesn't have an associated WAudio token account AND doesn't have a SOL balance to fund the creation of one.
[6eeb9d4] [PAY-605][PAY-601][PAY-548] Buy Audio modal design changes (#1846) Marcus Pasell [436cd27] [C-963] Migrate wallet sagas (#1857) Sebastian Klingler [238d729] [C-959] Migrate tipping sagas (#1852) Sebastian Klingler [1561728] Bump SDK to v1.0.1 (#1842) Dheeraj Manjunath [a331f3d] Add reordering to new tables for playlists (#1845) Kyle Shanks [3c90d3f] [PAY-598] Prepopulate TransactionDetails after purchasing $AUDIO (#1832) Marcus Pasell [b11a686] [C-957] Fix autocomplete when signed out (#1844) Sebastian Klingler [3315c27] Make tooltips use updated colors when theme is applied (#1843) Sebastian Klingler [76395d5] [PAY-591] Improve supporter count visibility (#1841) Reed [779d9e9] [PAY-507] Fix feed tip tile tip button resizing (#1837) Reed [f4160e9] [C-939] Refactor discord modal (#1838) Dylan Jeffers [b76854f] Update deactivate copy (#1840) Raymond Jacobson [2085ffc] [Stems] Don't rewrite to /index.html on stems.audius.co (#1836) Marcus Pasell [14aa5ac] [C-836] Fix enter on search (#1835) Dylan Jeffers [d644cc1] [C-703] Fix segmented control font color (#1833) Dylan Jeffers [d2c0dca] [C-934] Migrate user-list sagas to common (#1829) Dylan Jeffers [1321a57] [C-919] Migrate profile sagas to common (#1826) Sebastian Klingler [aad5c6a] [PAY-594] Edit 'not enough SOL' error message (#1827) Reed [af61aab] [C-930] Move social sagas to common (#1822) Raymond Jacobson [33a1403] [C-928] Migrate saved sagas to common (#1821) Dylan Jeffers [64d45f3] [PAY-544] Add Transaction Details Modal (#1806) Marcus Pasell [20cfc9f] Add Transaction Details to Store (#1804) Marcus Pasell [5b8a4f0] [C-926] Migrate explore sagas to common (#1818) Dylan Jeffers [6047185] Follow up fix for track removal from playlist with entity manager (#1817) Isaac Solo [1b2638c] Fix track removal from playlist with entity manager (#1815) Isaac Solo [c854f66] [C-918] Move trending saga to common (#1814) Dylan Jeffers [6f24724] Fix lineup types in mobile build (#1812) Dylan Jeffers [27cf13a] Update @audius/sdk to 1.0.0 (#1813) Reed [c10ef33] Only enable external sourcemaps for prod builds (#1811) Sebastian Klingler [67e9c2d] [PAY-479] Check recipient wallet SOL before send (#1779) Reed
Description
When transferring WAudio to an external wallet, throw an error if the recipient wouldn't be able to receive it, ie. if the recipient doesn't have an associated WAudio token account AND doesn't have a SOL balance to fund the creation of one.
Dragons
I'm throwing an error in the selector for canRecipientReceiveWAudio on the assumption that if something is trying to access it from the incorrect state, then the caller probably depends on it in some incorrect way and so things should break. But open to suggestions!
Also in the selector and action, I am nesting the happy path but I think this is a case where it's necessary.
How Has This Been Tested?
Tested on local browser.
Screen.Recording.2022-08-26.at.4.07.15.PM.mov
Screen.Recording.2022-08-26.at.4.05.13.PM.mov