You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
recipient is initialized with publicKeyToAddress(props.item?.owners?.[0] ?? ''), but other parts of this PR (e.g., DTOTokenFactory) appear to already convert owners into addresses. Double-conversion (address passed into publicKeyToAddress) can yield an invalid recipient. Verify whether owners contains public keys or already-normalized addresses across all call sites and keep the representation consistent.
owners is built via token.accounts.edges.map(...) without guarding for missing/undefined accounts or edges. If the API can return accounts as null/empty (or edges omitted), this will throw at runtime. Consider defaulting to an empty array or using optional chaining with a fallback.
Supply rendering uses loose equality and doesn’t handle undefined supply cleanly (token.supply == '-1' ? '0' : token.supply), which can render undefined. Also, sorting by owner now uses the first element of owners; confirm that sorting behavior is intentional when multiple owners exist and that sortTable/column keys align with the updated UI.
token.accounts/token.accounts.edges being null/undefined will cause a runtime crash on .map(). Default to an empty array (and optionally filter falsy values) to keep token building resilient to partial API responses.
Why: token.accounts.edges.map(...) will throw if token.accounts or edges is null/undefined, so defaulting to [] improves runtime resilience to partial API responses. The change is localized to DTOTokenFactory.buildToken and preserves behavior when data is present.
Medium
Guard address conversion on empty input
Avoid calling publicKeyToAddress with an empty string when no owners are present, as that can throw or produce an invalid address. Initialize recipient conditionally so it stays empty until a valid public key exists.
Why: Calling publicKeyToAddress with '' (when props.item?.owners?.[0] is missing) can produce an invalid value or throw depending on implementation. The proposed conditional initialization keeps recipient safely empty until a real public key is available.
Low
Normalize and strictly compare supply
Using loose equality and mixing string/number semantics for supply can lead to incorrect display and sorting. Normalize supply to a number and use strict comparison so -1 is handled consistently across UI and sorting.
Why: Replacing loose equality on token.supply with numeric normalization and strict comparison avoids edge cases from string/number mixing (especially with the sentinel -1). This is a minor correctness/readability improvement since sorting already parses supply numerically elsewhere.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.