-
Notifications
You must be signed in to change notification settings - Fork 43
[PAY-1753] Implements Withdrawals Page #4043
Conversation
|
|
||
| const apiData = await endpoint.fetch(fetchArgs, context) | ||
| if (!apiData) { | ||
| if (apiData == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line was breaking fetch endpoints which return falsey values, most notably count endpoints when they return 0.
| balance: StringUSDC | ||
| metadata?: Nullable<object> | string | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These types were originally added when the tech spec document was done, but they weren't in use yet. The actual types coming back from the API are a little different. And we don't really need the discriminated union.
|
Preview this change https://demo.audius.co/pay-1753-withdrawals-page |
|
Preview this change https://demo.audius.co/pay-1753-withdrawals-page |
rickyrombo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
| transactionDate: string | ||
| change: StringUSDC | ||
| balance: StringUSDC | ||
| metadata?: Nullable<object> | string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw this is probably always going to be a string
| display as a dollar amount. Note: will lose precision by rounding _up_ to nearest cent */ | ||
| export const formatUSDCWeiToUSDString = (amount: StringUSDC, precision = 2) => { | ||
| // remove negative sign if present. | ||
| const amountPos = amount.replace('-', '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a nice little hack for the AUDIO tx history, but it feels ripe for bugs in other potential (future?) usages... we should probably revisit both of these at some point.
| } | ||
|
|
||
| export const NoPurchasesContent = ({ | ||
| export const NoTransactionsContent = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All that's missing is an icon prop and I think this could be a super general NoRows or EmptyTable component 👀
[0ca58e7] [C-2994] Improve mobile image selection (#4041) Dylan Jeffers [5691cc6] [C-3060] Fix mobile outbound link experience (#4055) Dylan Jeffers [a72a9e1] [PAY-1833] Increase trending playlists fetch limit (#4066) Saliou Diallo [37bfd6d] Fixes solana-dapp-store ci with new node (#4060) Dylan Jeffers [093e863] [C-2548] Fix favorites table saved date filter (#4034) Dylan Jeffers [e810410] [C-3052] Fix playlist page theme (#4050) Dylan Jeffers [d152724] Revert library stuff for now (#4064) nicoback2 [0abfa97] Fix bad merge breaking main (#4063) nicoback2 [3343e29] Library Feature Branch (#4061) nicoback2 [92edb79] [PAY-1773] Add sorting by buyer name to sales table (#4059) Randy Schott [12519c1] [C-3056] Fix remix callout text overflow (#4049) Dylan Jeffers [0b0385b] Fix sdk:update command after node migration (#4058) Randy Schott [02d89fe] [C-3049] Fix upload type error where upload type is undefined (#4046) Kyle Shanks [d548f80] [PAY-1794] Check correct balance in withdrawal flow (#4056) Raymond Jacobson [6827827] Update dapp-store build artifacts audius-infra [4f6af2c] [PAY-1794] Math.min(withdrawalAmount, latestBalance) after using USDC to pay tx fee (#4054) Raymond Jacobson [e682483] Fix balance formatting on USDC card (#4053) Reed [3735666] [PAY-1814] Store USDC balances in wallet slice (#4052) Raymond Jacobson [8f20bdb] Fix mobile deleted track tile (#4051) Saliou Diallo [27089bd] [PAY-1753] Implements Withdrawals Page (#4043) Randy Schott [17284b7] Auto favorite tracks on purchase PAY-1772 (#4048) nicoback2 [91c49fa] Wire up withdraw USDC saga to modal state (#4045) Reed [72d8eaa] [C-3024] Fix solana dapp store ci (#4044) Dylan Jeffers [fb22ace] [PAY-1763][PAY-1810] Wire up links to Purchases/Sales pages (#4042) Randy Schott [c2b7bae] [PAY-1811] Fix default/empty profile picture in now playing bar/dashboard (#4040) Raymond Jacobson [52f0375] [PAY-1725] Display proper amount in track sold notification (#4039) Saliou Diallo [c56596b] [C-3044] Add preview functionality to new upload flow (#4038) Kyle Shanks [25eb54d] [PAY-1792] Add formik, zod, and proper inputs to USDC withdrawal modal (#4037) Raymond Jacobson [06b4b42] Symlink react-native for android release (#4023) Sebastian Klingler [33c5385] Fix Jupiter caching bad route info (#4036) Reed [60b99b5] [PAY-1510] Add pills and clean up artist dashboard (#4029) Raymond Jacobson [6447d2c] [C-2841] Use limit + offset for feed (#4032) Dylan Jeffers [5e8ce0d] [C-2924] Fix ArtistRecommendation description alignment (#4033) Dylan Jeffers [07bcc8b] [C-2862] Fix clipped repost message text (#4025) Dylan Jeffers [bed2631] [C-3038] Remove playlist updates feature flags (#4017) Dylan Jeffers [ae63e6c] [C-2792] Surface play count for hidden tracks (#4022) Dylan Jeffers [f462539] [PAY-1793] Use existing SOL to fund dest ATA (#4031) Reed [16c805e] [C-2536] Fix track name cutoff (#4019) Dylan Jeffers [92e8d52] Add guard to prevent attempted read of undefined queue items (#4030) Randy Schott [16b3d73] [C-2976] Fix upload form validation timing and display (#4026) Andrew Mendelsohn [a0e4c56] v1.5.40 (#4024) Sebastian Klingler [600cf52] [C-2645] Fix icon-info size (#4021) Dylan Jeffers [4469e92] [C-3039] Add icon to profile share button (#4018) Dylan Jeffers [f07a4f9] Install pip for android release (#4020) Sebastian Klingler [e3e2926] Fix support email (#4016) Raymond Jacobson [bd520f0] [C-2950 C-3033] Fix and simplify issues resulting from collection fetching (#4009) Dylan Jeffers [361d369] Fix release CI (#4013) Sebastian Klingler
Description
This change adds the Withdrawals page, api, and table. It follows the implementations of sales/purchases fairly closely, but uses a different API and column definitions.
There is some repeated code, but it's likely not enough to be worth trying to make the pages/tables generic across all three cases.
This is behind the USDC feature flag.
The metadata for usdc transactions currently returns as empty. So we don't show the wallet address yet. But that should be resolved automatically once the API starts returning values.
How Has This Been Tested?
Tested locally against staging