-
Notifications
You must be signed in to change notification settings - Fork 149
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
feat: add runes fiat balance, closes #5300 #5656
Conversation
WalkthroughThis update enhances the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant RunesAssetList
participant RunesLoader
participant MarketData
User->>RunesAssetList: Load page
RunesAssetList->>RunesLoader: Request rune data with market data
RunesLoader->>MarketData: Fetch market data
MarketData-->>RunesLoader: Return market data
RunesLoader-->>RunesAssetList: Provide rune data with market data
RunesAssetList->>RunesAssetList: Calculate fiat balance using market data
RunesAssetList-->>User: Display rune data with fiat balance
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
4598d22
to
0ad95a7
Compare
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
src/app/features/asset-list/bitcoin/runes-asset-list/runes-asset-list.tsx (1)
Line range hint
17-34
: EnhancedRunesAssetList
function with fiat balance calculation.The integration of
convertAssetBalanceToFiat
to calculate fiat balances is correctly implemented. Consider monitoring performance to ensure that the additional computation does not impact the user experience, especially with a large number of runes.Consider implementing caching or other optimizations if performance issues are observed.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
Files selected for processing (2)
- package.json (1 hunks)
- src/app/features/asset-list/bitcoin/runes-asset-list/runes-asset-list.tsx (2 hunks)
Files skipped from review due to trivial changes (1)
- package.json
Additional comments not posted (2)
src/app/features/asset-list/bitcoin/runes-asset-list/runes-asset-list.tsx (2)
5-5
: Import ofconvertAssetBalanceToFiat
is correctly placed.This import is essential for the new functionality to calculate fiat balances and is used appropriately in the component.
11-11
: Interface update to includemarketData
is appropriate.The addition of
marketData
toRuneTokenAssetDetails
supports the new functionality. Ensure thatmarketData
is always provided or handled gracefully if null.Verification successful
Interface update to include
marketData
is appropriate.The addition of
marketData
toRuneTokenAssetDetails
supports the new functionality. The codebase includes checks to handle cases wheremarketData
might be null or undefined, ensuring robustness.
- Instances of null checks for
marketData
found in:
src/app/common/asset-utils.ts
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `marketData` is always provided or handled if null. # Test: Search for null checks on `marketData`. rg --type typescript -A 5 $'marketData'Length of output: 73
Script:
#!/bin/bash # Description: Verify that `marketData` is always provided or handled if null. # Test: Search for null checks on `marketData`. rg 'marketData' -A 5Length of output: 22072
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
Files selected for processing (2)
- package.json (1 hunks)
- src/app/features/asset-list/bitcoin/runes-asset-list/runes-asset-list.tsx (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- package.json
- src/app/features/asset-list/bitcoin/runes-asset-list/runes-asset-list.tsx
0ad95a7
to
947c6a5
Compare
947c6a5
to
77c63eb
Compare
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
Files selected for processing (3)
- package.json (1 hunks)
- src/app/components/loaders/runes-loader.tsx (1 hunks)
- src/app/features/asset-list/bitcoin/runes-asset-list/runes-asset-list.tsx (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- package.json
- src/app/features/asset-list/bitcoin/runes-asset-list/runes-asset-list.tsx
Additional comments not posted (2)
src/app/components/loaders/runes-loader.tsx (2)
Line range hint
6-12
: Function implementation is correct.The
RunesLoader
function correctly fetches the runes using theuseRuneTokens
hook and passes them to thechildren
function as expected.
6-8
: Interface change looks good, but verify the integration.The addition of
marketData
to therunes
array in theRunesLoaderProps
interface is approved as it aligns with the PR objectives.However, ensure that the
marketData
is properly integrated and utilized in the component and related components.Verification successful
The
marketData
property is properly integrated and utilized.The
marketData
property is consistently used in theRunesLoader
component and related components, indicating proper integration and utilization.
src/app/components/loaders/runes-loader.tsx
src/app/pages/swap/components/swap-asset-select/swap-asset-select-quote.tsx
src/app/pages/swap/components/swap-asset-select/swap-asset-select-base.tsx
src/app/components/loaders/brc20-tokens-loader.tsx
src/app/pages/send/send-crypto-asset-form/form/stx/stx-send-form.tsx
src/app/pages/send/send-crypto-asset-form/form/btc/btc-send-form.tsx
src/app/pages/send/send-crypto-asset-form/form/sip10/sip10-token-send-form.tsx
src/app/pages/send/send-crypto-asset-form/form/brc20/brc20-send-form.tsx
src/app/features/asset-list/stacks/sip10-token-asset-list/sip10-token-asset-list.tsx
src/app/features/asset-list/stacks/stx-crypo-asset-item/stx-crypto-asset-item.tsx
src/app/features/asset-list/bitcoin/runes-asset-list/runes-asset-list.tsx
src/app/features/asset-list/stacks/sip10-token-asset-list/sip10-token-asset-item.tsx
src/app/features/asset-list/bitcoin/brc20-token-asset-list/brc20-token-asset-list.tsx
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration of `marketData` in the `RunesLoader` component and related components. # Test: Search for usage of the `marketData` property in the component and related components. rg --type tsx -A 5 $'marketData'Length of output: 59
Script:
#!/bin/bash # Description: Verify the integration of `marketData` in the `RunesLoader` component and related components. # Test: Search for usage of the `marketData` property in the component and related components. rg --glob '*.tsx' -A 5 'marketData'Length of output: 21642
@brandonmarshall-tm yeah, makes sense re:sorting, but I'd prefer do such enhancements separately, and also we prob need this for other tokens as well, e.g. should we sort sip10 tokens? @markmhendrickson wdyt here? |
@brandonmarshall-tm view more section will be removed in favour of "manage tokens" feature from this pr #5627 |
Yep let's capture this need with #5404 or a new issue if preferred, and tackle separately
Ditto – let's get separate issue(s) for sorting needs |
This pr adds fiat balance to runes
Summary by CodeRabbit
New Features
RunesLoader
andRunesAssetList
components to include market data, providing more comprehensive asset information.RunesAssetList
, giving users a clearer understanding of the asset values in fiat currency.Dependencies
@leather.io/query
from version 0.10.2 to 0.11.1.