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