-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: renterd hostd wallet balance details
- Loading branch information
1 parent
e04a35c
commit 16b7df4
Showing
12 changed files
with
207 additions
and
72 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'hostd': minor | ||
'renterd': minor | ||
--- | ||
|
||
The wallet balance tooltip now shows spendable confirmed and unconfirmed values. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import { Text } from '../core/Text' | ||
import { humanSiacoin } from '@siafoundation/sia-js' | ||
import BigNumber from 'bignumber.js' | ||
import { Tooltip } from '../core/Tooltip' | ||
import { ValueSc } from '../components/ValueSc' | ||
|
||
export function WalletBalanceSideNav({ | ||
balanceSc, | ||
isSynced, | ||
syncingMessage, | ||
}: { | ||
balanceSc?: { | ||
unconfirmed: BigNumber | ||
confirmed: BigNumber | ||
spendable: BigNumber | ||
} | ||
isSynced: boolean | ||
syncingMessage?: string | ||
}) { | ||
if (!balanceSc) { | ||
return null | ||
} | ||
|
||
if (!isSynced) { | ||
return ( | ||
<Tooltip | ||
side="right" | ||
content={ | ||
syncingMessage || 'Blockchain is syncing, balance may be incorrect.' | ||
} | ||
> | ||
<Text size="12" weight="medium"> | ||
{humanSiacoin(balanceSc.spendable.plus(balanceSc.unconfirmed), { | ||
fixed: 0, | ||
})} | ||
</Text> | ||
</Tooltip> | ||
) | ||
} | ||
|
||
return ( | ||
<Tooltip | ||
side="right" | ||
content={ | ||
<div className="flex flex-col gap-1"> | ||
<div className="flex gap-2"> | ||
<div className="flex flex-col flex-1"> | ||
<Text>spendable</Text> | ||
<Text color="subtle">All confirmed outputs not in-use.</Text> | ||
</div> | ||
<div className="flex justify-end"> | ||
<ValueSc variant="value" value={balanceSc.spendable} /> | ||
</div> | ||
</div> | ||
<div className="flex gap-2"> | ||
<div className="flex flex-col flex-1"> | ||
<Text>confirmed</Text> | ||
<Text color="subtle">All confirmed outputs.</Text> | ||
</div> | ||
<div className="flex justify-end"> | ||
<ValueSc variant="value" value={balanceSc.confirmed} /> | ||
</div> | ||
</div> | ||
<div className="flex gap-2"> | ||
<div className="flex flex-col flex-1"> | ||
<Text>unconfirmed</Text> | ||
<Text color="subtle">All unconfirmed outputs not in-use.</Text> | ||
</div> | ||
<div className="flex justify-end"> | ||
<ValueSc variant="value" value={balanceSc.unconfirmed} /> | ||
</div> | ||
</div> | ||
</div> | ||
} | ||
> | ||
<Text size="12" weight="medium"> | ||
{humanSiacoin(balanceSc.spendable.plus(balanceSc.unconfirmed), { | ||
fixed: 0, | ||
})} | ||
</Text> | ||
</Tooltip> | ||
) | ||
} |
Oops, something went wrong.