Skip to content
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

Merged

Conversation

kunstmusik
Copy link
Collaborator

No description provided.

Copy link

github-actions bot commented Mar 5, 2025

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

@kunstmusik kunstmusik marked this pull request as ready for review March 6, 2025 22:11
@kunstmusik kunstmusik requested a review from a team as a code owner March 6, 2025 22:11
process.env.VITE_GATEWAY_HOST ?? 'arweave.net';

export const DEFAULT_ARWEAVE_GQL_ENDPOINT =
Copy link
Collaborator

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

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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
Comment on lines 30 to 31
const BalancesMain = React.lazy(() => import('./pages/Balances'));
const Balances = React.lazy(() => import('./pages/Balances/Balances'));
Copy link
Contributor

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

Copy link
Collaborator Author

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.

@@ -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,
Copy link
Contributor

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.

Copy link
Collaborator Author

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

queryKey: ['vaults', arioReadSDK],
queryFn: async () => {
if (!arioReadSDK)
throw new Error('arIOReadSDK or walletAddress is not initialized');
Copy link
Contributor

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

const walletAddress = params?.walletAddress;

const walletAddressData = useMemo(() => {
return walletAddress == undefined
Copy link
Contributor

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

Copy link
Collaborator Author

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.

Comment on lines 25 to 29
<BalancesHeader walletAddress={walletAddress} />
{walletAddressData ? (
<>
<Banner walletAddress={walletAddressData} />
<VaultsTable walletAddress={walletAddressData} />
Copy link
Contributor

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
@kunstmusik kunstmusik merged commit b4d270c into develop Mar 7, 2025
5 checks passed
@kunstmusik kunstmusik deleted the PE-7765-add-balances-page-for-viewing-balances-and-vaults branch March 7, 2025 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants