Closed Kodylow closed 4 months ago
apps/guardian-ui/src/admin/FederationAdmin.tsx (4)
1-1: The default import is only used as a type. --- 2-7: All these imports are only used as types. --- 31-31: Use Number.parseInt instead of the equivalent global. --- 34-34: Use Number.parseInt instead of the equivalent global.apps/guardian-ui/src/components/BalanceCard.tsx (2)
1-1: The default import is only used as a type. --- 10-11: All these imports are only used as types.apps/guardian-ui/src/components/BalanceTable.tsx (2)
1-1: All these imports are only used as types. --- 17-18: Some named imports are only used as types.apps/guardian-ui/src/components/FederationInfoCard.tsx (2)
1-1: The default import is only used as a type. --- 2-3: All these imports are only used as types.packages/types/src/modules.ts (2)
1-1: All these imports are only used as types. --- 1-2: All these imports are only used as types.packages/utils/src/format.tsx (1)
1-1: All these imports are only used as types.
packages/types/src/modules.ts (1)
`8-8`: Ensure integration of new `ModuleKind` values. The new `ModuleKind.Unknown` and configurations for `Meta` and `Unknown` are added. Verify their usage across the application to ensure proper integration. Also applies to: 48-49Verification successful
--- The new `ModuleKind.Unknown` and `ModuleKind.Meta` values are integrated into the application logic. - `ModuleKind.Unknown` is used in `apps/guardian-ui/src/components/BalanceTable.tsx`. - `ModuleKind.Meta` is used in `apps/guardian-ui/src/components/FederationConfigCard.tsx`.Scripts Executed
The following scripts were executed for the analysis: --- Script: ```shell #!/bin/bash # Description: Verify the integration of new module kinds `Meta` and `Unknown`. # Test: Search for the usage of `ModuleKind.Meta` and `ModuleKind.Unknown`. Expect: Proper handling in the application logic. rg --type typescript $'ModuleKind.Meta|ModuleKind.Unknown' ``` Length of output: 94 --- --- Script: ```shell #!/bin/bash # Description: Verify the integration of new module kinds `Meta` and `Unknown`. # Test: Search for the usage of `ModuleKind.Meta` and `ModuleKind.Unknown`. Expect: Proper handling in the application logic. rg --type ts $'ModuleKind.Meta|ModuleKind.Unknown' ``` Length of output: 459apps/guardian-ui/src/components/BalanceTable.tsx (1)
`30-32`: Filter out the `Unknown` module to avoid confusion. The logic to filter out the `Unknown` module is correctly implemented, ensuring it does not appear in the balance calculations.
Added a filter to now put the "unknown" module in the balance sheet, that's just there to test if it'll break clients and it doesn't have any assets/liabilities
~That unknown
module would be confusing to users imo, but it's only present in test environments afaik, so this should be fine.~
Missed your last comment.
Okay added an Equity (Guardian Fees) column and adjusted the check to "Is Full Reserve" checking that assets > liabilities and equity is > 0
Actually that took up a lot of real estate, moved into separate cards for Full reserve and fees calculations, if there's no fees it just doesn't show that card:
Adds a balance sheet view of all modules.
Summary by CodeRabbit
New Features
BalanceCard
component to switch betweenmsats
,sats
, andbtc
.BalanceTable
component to display balance information based on the selected unit.Enhancements
FederationAdmin
andFederationInfoCard
components for improved visual presentation.Bug Fixes
BalanceTable
to ensure accurate representation of total equity.Documentation
formatValue
function to handle unit conversions.Refactor
BalanceCard
component for better performance and readability.