-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PE-7765: Add Balances Page #180
PE-7765: Add Balances Page #180
Conversation
Visit the preview URL for this PR (updated for commit 5be8153): https://ar-io-network-portal-a40ee--pr180-pe-7765-add-balances-5ktc171r.web.app (expires Fri, 21 Mar 2025 18:13:05 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 7abfae09c4446982a71cbb94b0cbf4688377a111 |
process.env.VITE_GATEWAY_HOST ?? 'arweave.net'; | ||
|
||
export const DEFAULT_ARWEAVE_GQL_ENDPOINT = |
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.
is this an available setting? may be good to add, but can be done in a separate PR
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.
Not a setting in the settings panel right now. Separate PR to add this sounds good to me.
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.
Went ahead and added this to settings
Co-authored-by: Dylan Fiedler <dtfiedler@users.noreply.github.com>
src/App.tsx
Outdated
const BalancesMain = React.lazy(() => import('./pages/Balances')); | ||
const Balances = React.lazy(() => import('./pages/Balances/Balances')); |
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.
Lil confusing, maybe like "AllBalances" and "UserBalances", or "Balances" and "BalancesForAddress" or something
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.
I couldn't figure out a good name yesterday but I like BalancesForAddress so have updated to that.
src/hooks/useReports.ts
Outdated
@@ -62,7 +62,7 @@ const useReports = (ownerId?: string, gateway?: AoGateway) => { | |||
if (keys.length > 0) { | |||
// Epoch pruning on contract means we have at most 14 reports. Retrieve as a batch here. | |||
const transactions = await arweaveGraphql( | |||
`https://${DEFAULT_ARWEAVE_HOST}/graphql`, | |||
DEFAULT_ARWEAVE_GQL_ENDPOINT, |
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.
recomment putting this in global state and using that var, then when we come back and may it adjustable these don't need to be updated again.
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.
Went ahead and added this to settings
src/hooks/useVaults.ts
Outdated
queryKey: ['vaults', arioReadSDK], | ||
queryFn: async () => { | ||
if (!arioReadSDK) | ||
throw new Error('arIOReadSDK or walletAddress is not initialized'); |
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.
nit: not using walletAddress here
src/pages/Balances/Balances.tsx
Outdated
const walletAddress = params?.walletAddress; | ||
|
||
const walletAddressData = useMemo(() => { | ||
return walletAddress == undefined |
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.
can simplify to !isAoAddress(walletAddress) ? undefined : ... eth/arweave logic
Or, might be worth have a util for new AoAddress() which handles this logic
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.
Could do that here since isAOAddress checks against ArweaveTransactionId and not string. It's a bit quirky and may try to get rid of ArweaveTransactionId in the future and replace with type guard that uses string.
src/pages/Balances/Balances.tsx
Outdated
<BalancesHeader walletAddress={walletAddress} /> | ||
{walletAddressData ? ( | ||
<> | ||
<Banner walletAddress={walletAddressData} /> | ||
<VaultsTable walletAddress={walletAddressData} /> |
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.
nit: inconsistent support of types on like named parameters
…ts' of github.com:ar-io/network-portal into PE-7765-add-balances-page-for-viewing-balances-and-vaults
No description provided.