fix: use xDAI and xBZZ on Gnosis chain (#454)
* fix: use xDAI on Gnosis chain * fix: rename BZZ to xBZZ when on Gnosis chain * fix: replace MINIMUM_xDAI with MINIMUM_XDAI * fix: update xdai links to correct gnosis chain urls
This commit is contained in:
@@ -79,7 +79,7 @@ export default function CheckoutModal({ peerId, uncashedAmount }: Props): ReactE
|
||||
)}
|
||||
{!loadingCashout && (
|
||||
<span>
|
||||
Are you sure you want to cashout <strong>{uncashedAmount} BZZ</strong> from Peer{' '}
|
||||
Are you sure you want to cashout <strong>{uncashedAmount} xBZZ</strong> from Peer{' '}
|
||||
<strong>{peerId}</strong>?
|
||||
</span>
|
||||
)}
|
||||
|
||||
@@ -96,7 +96,7 @@ export default function WithdrawDepositModal({
|
||||
/>
|
||||
{amountError && (
|
||||
<FormHelperText error>
|
||||
Please provide valid BZZ amount (max 16 decimals). Error: {amountError.message}
|
||||
Please provide valid xBZZ amount (max 16 decimals). Error: {amountError.message}
|
||||
</FormHelperText>
|
||||
)}
|
||||
</DialogContent>
|
||||
|
||||
@@ -12,7 +12,7 @@ export default function DepositModal(): ReactElement {
|
||||
<WithdrawDepositModal
|
||||
successMessage="Successful deposit."
|
||||
errorMessage="Error with depositing"
|
||||
dialogMessage="Specify the amount of BZZ you would like to deposit to your node."
|
||||
dialogMessage="Specify the amount of xBZZ you would like to deposit to your node."
|
||||
label="Deposit"
|
||||
icon={<Download size="1rem" />}
|
||||
min={new BigNumber(0)}
|
||||
|
||||
@@ -11,7 +11,7 @@ export default function WithdrawModal(): ReactElement {
|
||||
<WithdrawDepositModal
|
||||
successMessage="Successful withdrawal."
|
||||
errorMessage="Error with withdrawing."
|
||||
dialogMessage="Specify the amount of BZZ you would like to withdraw from your node."
|
||||
dialogMessage="Specify the amount of xBZZ you would like to withdraw from your node."
|
||||
label="Withdraw"
|
||||
icon={<Upload size="1rem" />}
|
||||
min={new BigNumber(0)}
|
||||
|
||||
@@ -33,19 +33,19 @@ export function AccountChequebook(): ReactElement {
|
||||
<ExpandableList label="Chequebook" defaultOpen>
|
||||
<ExpandableListItem
|
||||
label="Total Balance"
|
||||
value={`${chequebookBalance?.totalBalance.toFixedDecimal()} BZZ`}
|
||||
value={`${chequebookBalance?.totalBalance.toFixedDecimal()} xBZZ`}
|
||||
/>
|
||||
<ExpandableListItem
|
||||
label="Available Uncommitted Balance"
|
||||
value={`${chequebookBalance?.availableBalance.toFixedDecimal()} BZZ`}
|
||||
value={`${chequebookBalance?.availableBalance.toFixedDecimal()} xBZZ`}
|
||||
/>
|
||||
<ExpandableListItem
|
||||
label="Total Cheques Amount Sent"
|
||||
value={`${settlements?.totalSent.toFixedDecimal()} BZZ`}
|
||||
value={`${settlements?.totalSent.toFixedDecimal()} xBZZ`}
|
||||
/>
|
||||
<ExpandableListItem
|
||||
label="Total Cheques Amount Received"
|
||||
value={`${settlements?.totalReceived.toFixedDecimal()} BZZ`}
|
||||
value={`${settlements?.totalReceived.toFixedDecimal()} xBZZ`}
|
||||
/>
|
||||
<ExpandableListItemActions>
|
||||
<WithdrawModal />
|
||||
|
||||
@@ -50,10 +50,10 @@ export function AccountWallet(): ReactElement {
|
||||
<ExpandableListItemKey label="Node wallet address" value={nodeAddresses.ethereum} expanded />
|
||||
</Box>
|
||||
<Box mb={0.25}>
|
||||
<ExpandableListItem label="XDAI balance" value={`${balance.dai.toSignificantDigits(4)} XDAI`} />
|
||||
<ExpandableListItem label="xDAI balance" value={`${balance.dai.toSignificantDigits(4)} xDAI`} />
|
||||
</Box>
|
||||
<Box mb={2}>
|
||||
<ExpandableListItem label="BZZ balance" value={`${balance.bzz.toSignificantDigits(4)} BZZ`} />
|
||||
<ExpandableListItem label="xBZZ balance" value={`${balance.bzz.toSignificantDigits(4)} xBZZ`} />
|
||||
</Box>
|
||||
</>
|
||||
) : (
|
||||
|
||||
@@ -17,26 +17,26 @@ export default function PeerBalances({ accounting, isLoadingUncashed, totalUncas
|
||||
return (
|
||||
<ExpandableList
|
||||
label={`Peers (${accounting?.length || 0})`}
|
||||
info={`${totalUncashed.toFixedDecimal()} BZZ (uncashed)`}
|
||||
info={`${totalUncashed.toFixedDecimal()} xBZZ (uncashed)`}
|
||||
>
|
||||
<ExpandableListItem label="Uncashed Amount Total" value={`${totalUncashed.toFixedDecimal()} BZZ`} />
|
||||
<ExpandableListItem label="Uncashed Amount Total" value={`${totalUncashed.toFixedDecimal()} xBZZ`} />
|
||||
{accounting?.map(({ peer, balance, received, sent, uncashedAmount, total }) => (
|
||||
<ExpandableList
|
||||
key={peer}
|
||||
label={`Peer ${peer.slice(0, 8)}[…]`}
|
||||
level={1}
|
||||
info={`${uncashedAmount.toFixedDecimal()} BZZ (uncashed)`}
|
||||
info={`${uncashedAmount.toFixedDecimal()} xBZZ (uncashed)`}
|
||||
>
|
||||
<ExpandableListItemKey label="Peer ID" value={peer} />
|
||||
<ExpandableListItem label="Outstanding Balance" value={`${balance.toFixedDecimal()} BZZ`} />
|
||||
<ExpandableListItem label="Outstanding Balance" value={`${balance.toFixedDecimal()} xBZZ`} />
|
||||
<ExpandableListItem
|
||||
label="Settlements Sent / Received"
|
||||
value={`-${sent.toFixedDecimal()} / ${received.toFixedDecimal()} BZZ`}
|
||||
value={`-${sent.toFixedDecimal()} / ${received.toFixedDecimal()} xBZZ`}
|
||||
/>
|
||||
<ExpandableListItem label="Total" value={`${total.toFixedDecimal()} BZZ`} />
|
||||
<ExpandableListItem label="Total" value={`${total.toFixedDecimal()} xBZZ`} />
|
||||
<ExpandableListItem
|
||||
label="Uncashed Amount"
|
||||
value={isLoadingUncashed ? 'loading…' : `${uncashedAmount.toFixedDecimal()} BZZ`}
|
||||
value={isLoadingUncashed ? 'loading…' : `${uncashedAmount.toFixedDecimal()} xBZZ`}
|
||||
/>
|
||||
{uncashedAmount.toBigNumber.isGreaterThan('0') && (
|
||||
<ExpandableListItemActions>
|
||||
|
||||
@@ -76,23 +76,23 @@ export default function Index(): ReactElement {
|
||||
<Box mb={4}>
|
||||
<Typography>
|
||||
Generate and share a gift wallet that anyone can use to set-up their light node with Swarm Desktop. This will
|
||||
use {GIFT_WALLET_FUND_DAI_AMOUNT.toSignificantDigits(2)} XDAI and{' '}
|
||||
{GIFT_WALLET_FUND_BZZ_AMOUNT.toSignificantDigits(2)} BZZ from your node wallet.
|
||||
use {GIFT_WALLET_FUND_DAI_AMOUNT.toSignificantDigits(2)} xDAI and{' '}
|
||||
{GIFT_WALLET_FUND_BZZ_AMOUNT.toSignificantDigits(2)} xBZZ from your node wallet.
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box mb={0.25}>
|
||||
<ExpandableListItem label="XDAI balance" value={`${balance.dai.toSignificantDigits(4)} XDAI`} />
|
||||
<ExpandableListItem label="xDAI balance" value={`${balance.dai.toSignificantDigits(4)} xDAI`} />
|
||||
</Box>
|
||||
<Box mb={2}>
|
||||
<ExpandableListItem label="BZZ balance" value={`${balance.bzz.toSignificantDigits(4)} BZZ`} />
|
||||
<ExpandableListItem label="xBZZ balance" value={`${balance.bzz.toSignificantDigits(4)} xBZZ`} />
|
||||
</Box>
|
||||
<Box mb={4}>
|
||||
{balances.map((x, i) => (
|
||||
<Box mb={2} key={i}>
|
||||
<ExpandableListItemKey label={`swarm${String(i).padStart(3, '0')}`} value={x.privateKey} />
|
||||
<ExpandableListItemKey label="Address" value={x.address} />
|
||||
<ExpandableListItem label="XDAI balance" value={`${x.dai.toSignificantDigits(4)} XDAI`} />
|
||||
<ExpandableListItem label="BZZ balance" value={`${x.bzz.toSignificantDigits(4)} BZZ`} />
|
||||
<ExpandableListItem label="xDAI balance" value={`${x.dai.toSignificantDigits(4)} xDAI`} />
|
||||
<ExpandableListItem label="xBZZ balance" value={`${x.bzz.toSignificantDigits(4)} xBZZ`} />
|
||||
</Box>
|
||||
))}
|
||||
</Box>
|
||||
|
||||
@@ -66,7 +66,7 @@ export function PostageStampCreation({ onFinished }: Props): ReactElement {
|
||||
|
||||
const price = calculateStampPrice(depth, amount)
|
||||
|
||||
return `${price.toSignificantDigits()} BZZ`
|
||||
return `${price.toSignificantDigits()} xBZZ`
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -24,23 +24,23 @@ const ChequebookDeployFund = (): ReactElement | null => {
|
||||
text = (
|
||||
<>
|
||||
Your chequebook is not funded. Please deposit some xBZZ to your chequebook address. You may need to aquire BZZ
|
||||
(e.g. <a href="https://bzz.exchange/">bzz.exchange</a>) and bridge it to the xDai network through the{' '}
|
||||
<a href="https://omni.xdaichain.com/bridge">omni bridge</a>. To pay the transaction fees, you will also need
|
||||
xDAI token. You can purchase DAI on the network and bridge it to xDai network through the{' '}
|
||||
<a href="https://bridge.xdaichain.com/">xDai Bridge</a>. See the{' '}
|
||||
<a href="https://www.xdaichain.com/#xdai-stable-chain">official xDai website</a> for more information.
|
||||
(e.g. <a href="https://bzz.exchange/">bzz.exchange</a>) and bridge it to the Gnosis Chain network through the{' '}
|
||||
<a href="https://omni.gnosischain.com/bridge">omni bridge</a>. To pay the transaction fees, you will also need
|
||||
xDAI token. You can purchase DAI on the Ethereum mainnet network and bridge it to Gnosis Chain network through
|
||||
the <a href="https://bridge.gnosischain.com">xDai Bridge</a>. See the{' '}
|
||||
<a href="https://www.gnosischain.com">official Gnosis Chain website</a> for more information.
|
||||
</>
|
||||
)
|
||||
break
|
||||
default:
|
||||
text = (
|
||||
<>
|
||||
Your chequebook is either not deployed nor funded. To run the node you will need xDAI and xBZZ on the xDai
|
||||
network. You may need to aquire BZZ (e.g. <a href="https://bzz.exchange/">bzz.exchange</a>) and bridge it to
|
||||
the xDai network through the <a href="https://omni.xdaichain.com/bridge">omni bridge</a>. To pay the
|
||||
transaction fees, you will also need xDAI token. You can purchase DAI on the network and bridge it to xDai
|
||||
network through the <a href="https://bridge.xdaichain.com/">xDai Bridge</a>. See the{' '}
|
||||
<a href="https://www.xdaichain.com/#xdai-stable-chain">official xDai website</a> for more information.
|
||||
Your chequebook is either not deployed nor funded. To run the node you will need xDAI and xBZZ on the Gnosis
|
||||
chain network. You may need to aquire BZZ (e.g. <a href="https://bzz.exchange/">bzz.exchange</a>) and bridge
|
||||
it to the Gnosis Chain network through the <a href="https://omni.gnosischain.com/bridge">omni bridge</a>. To
|
||||
pay the transaction fees, you will also need xDAI token. You can purchase DAI on the Ethereum mainnet network
|
||||
and bridge it to Gnosis Chain network through the <a href="https://bridge.gnosischain.com">xDai Bridge</a>.
|
||||
See the <a href="https://www.gnosischain.com">official Gnosis Chain website</a> for more information.
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ export function CryptoTopUpIndex(): ReactElement {
|
||||
p={
|
||||
<Typography>
|
||||
For security reasons it is recommended to send maximum 5 to 10 xDAI. To get xDAI from DAI you may use{' '}
|
||||
<a href="https://bridge.xdaichain.com/" rel="noreferrer" target="_blank">
|
||||
https://bridge.xdaichain.com/
|
||||
<a href="https://bridge.gnosischain.com" rel="noreferrer" target="_blank">
|
||||
https://bridge.gnosischain.com
|
||||
</a>
|
||||
.
|
||||
</Typography>
|
||||
|
||||
@@ -83,10 +83,10 @@ export function GiftCardFund(): ReactElement {
|
||||
<ExpandableListItemKey label="Gift wallet address" value={wallet.address || 'N/A'} />
|
||||
</Box>
|
||||
<Box mb={0.25}>
|
||||
<ExpandableListItem label="XDAI balance" value={`${wallet.dai.toSignificantDigits(4)} XDAI`} />
|
||||
<ExpandableListItem label="xDAI balance" value={`${wallet.dai.toSignificantDigits(4)} xDAI`} />
|
||||
</Box>
|
||||
<Box mb={4}>
|
||||
<ExpandableListItem label="BZZ balance" value={`${wallet.bzz.toSignificantDigits(4)} BZZ`} />
|
||||
<ExpandableListItem label="xBZZ balance" value={`${wallet.bzz.toSignificantDigits(4)} xBZZ`} />
|
||||
</Box>
|
||||
<Box mb={4}>
|
||||
<ArrowDown size={24} color="#aaaaaa" />
|
||||
@@ -95,10 +95,10 @@ export function GiftCardFund(): ReactElement {
|
||||
<ExpandableListItemKey label="Node wallet address" value={nodeAddresses?.ethereum || 'N/A'} expanded />
|
||||
</Box>
|
||||
<Box mb={0.25}>
|
||||
<ExpandableListItem label="XDAI balance" value={`${balance.dai.toSignificantDigits(4)} XDAI`} />
|
||||
<ExpandableListItem label="xDAI balance" value={`${balance.dai.toSignificantDigits(4)} xDAI`} />
|
||||
</Box>
|
||||
<Box mb={2}>
|
||||
<ExpandableListItem label="BZZ balance" value={`${balance.bzz.toSignificantDigits(4)} BZZ`} />
|
||||
<ExpandableListItem label="xBZZ balance" value={`${balance.bzz.toSignificantDigits(4)} xBZZ`} />
|
||||
</Box>
|
||||
<SwarmButton iconType={Check} onClick={onFund} disabled={loading} loading={loading}>
|
||||
Send all funds to your node
|
||||
|
||||
+10
-10
@@ -95,26 +95,26 @@ export function Swap({ header }: Props): ReactElement {
|
||||
<TopUpProgressIndicator index={1} />
|
||||
</Box>
|
||||
<Box mb={2}>
|
||||
<Typography style={{ fontWeight: 'bold' }}>Swap some xDAI to BZZ</Typography>
|
||||
<Typography style={{ fontWeight: 'bold' }}>Swap some xDAI to xBZZ</Typography>
|
||||
</Box>
|
||||
<Box mb={4}>
|
||||
<Typography>
|
||||
You need to swap xDAI to BZZ in order to use Swarm. Make sure to keep at least {MINIMUM_XDAI} xDAI in order to
|
||||
pay for transaction costs on the network.
|
||||
You need to swap xDAI to xBZZ in order to use Swarm. Make sure to keep at least {MINIMUM_XDAI} xDAI in order
|
||||
to pay for transaction costs on the network.
|
||||
</Typography>
|
||||
</Box>
|
||||
<SwarmDivider mb={4} />
|
||||
<Box mb={4}>
|
||||
<Typography>
|
||||
Your current balance is {balance.dai.toSignificantDigits(4)} xDAI and {balance.bzz.toSignificantDigits(4)}{' '}
|
||||
BZZ.
|
||||
xBZZ.
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box mb={4}>
|
||||
<SwarmTextInput
|
||||
label="Amount to swap"
|
||||
defaultValue={`${daiToSwap.toSignificantDigits(4)} XDAI`}
|
||||
placeholder={`${daiToSwap.toSignificantDigits(4)} XDAI`}
|
||||
defaultValue={`${daiToSwap.toSignificantDigits(4)} xDAI`}
|
||||
placeholder={`${daiToSwap.toSignificantDigits(4)} xDAI`}
|
||||
name="x"
|
||||
onChange={event => setUserInputSwap(event.target.value)}
|
||||
/>
|
||||
@@ -133,14 +133,14 @@ export function Swap({ header }: Props): ReactElement {
|
||||
</Box>
|
||||
<Box mb={0.25}>
|
||||
<ExpandableListItem
|
||||
label="Resulting XDAI balance after swap"
|
||||
value={`${daiAfterSwap.toSignificantDigits(4)} XDAI`}
|
||||
label="Resulting xDAI balance after swap"
|
||||
value={`${daiAfterSwap.toSignificantDigits(4)} xDAI`}
|
||||
/>
|
||||
</Box>
|
||||
<Box mb={2}>
|
||||
<ExpandableListItem
|
||||
label="Resulting BZZ balance after swap"
|
||||
value={`${bzzAfterSwap.toSignificantDigits(4)} BZZ`}
|
||||
label="Resulting xBZZ balance after swap"
|
||||
value={`${bzzAfterSwap.toSignificantDigits(4)} xBZZ`}
|
||||
/>
|
||||
</Box>
|
||||
<ExpandableListItemActions>
|
||||
|
||||
@@ -6,5 +6,5 @@ interface Props {
|
||||
}
|
||||
|
||||
export function TopUpProgressIndicator({ index }: Props): ReactElement {
|
||||
return <ProgressIndicator index={index} steps={['Buy xDAI', 'Swap BZZ']} />
|
||||
return <ProgressIndicator index={index} steps={['Buy xDAI', 'Swap xBZZ']} />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user