Skip to content

Commit

Permalink
fix: conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
impelcrypto committed Sep 13, 2024
2 parents 61a52bc + 8ece1cf commit 9e75b0d
Show file tree
Hide file tree
Showing 30 changed files with 246 additions and 353 deletions.
23 changes: 23 additions & 0 deletions src/assets/img/token/PEN.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions src/assets/img/token/XLM.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 1 addition & 7 deletions src/components/common/Balance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<script lang="ts">
import { defineComponent, watch, ref } from 'vue';
import { BN } from '@polkadot/util';
import { formatBalance } from '@polkadot/util';
import { balanceFormatter } from 'src/hooks/helper/plasmUtils';
export default defineComponent({
props: {
Expand All @@ -22,12 +21,7 @@ export default defineComponent({
() => props.balance,
(balance) => {
if (balance) {
const formatted = formatBalance(props.balance, {
withSiFull: true,
decimals: props.decimals,
});
formattedBalance.value = balanceFormatter(props.balance);
formattedBalance.value = balanceFormatter(props.balance, props.decimals, !!props.unit);
}
},
{ immediate: true }
Expand Down
13 changes: 9 additions & 4 deletions src/components/common/FormatBalance.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<balance :balance="balance" :decimals="decimal" :unit="defaultUnitToken" />
<balance :balance="balance" :decimals="decimal" :unit="tokenUnit" />
</template>
<script lang="ts">
import { defineComponent, toRefs } from 'vue';
import { defineComponent, computed } from 'vue';
import { useChainMetadata } from 'src/hooks';
import { BN } from '@polkadot/util';
Expand All @@ -15,14 +15,19 @@ export default defineComponent({
type: [BN, String],
required: true,
},
showTokenUnit: {
type: Boolean,
required: false,
default: true,
},
},
setup(props) {
const { defaultUnitToken, decimal } = useChainMetadata();
const tokenUnit = computed<string>(() => (props.showTokenUnit ? defaultUnitToken.value : ''));
return {
defaultUnitToken,
decimal,
...toRefs(props),
tokenUnit,
};
},
methods: {},
Expand Down
93 changes: 0 additions & 93 deletions src/components/header/ClaimWarningBanner.vue

This file was deleted.

4 changes: 0 additions & 4 deletions src/components/header/modals/SelectAccount.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ import {
wait,
} from '@astar-network/astar-sdk-core';
import { ApiPromise } from '@polkadot/api';
import { Ledger } from '@polkadot/hw-ledger';
import copy from 'copy-to-clipboard';
import { ethers } from 'ethers';
import { $api } from 'src/boot/api';
Expand Down Expand Up @@ -173,8 +172,6 @@ export default defineComponent({
() => store.getters['general/substrateAccounts']
);
const isLedger = computed<boolean>(() => store.getters['general/isLedger']);
const nativeTokenSymbol = computed<string>(() => {
const chainInfo = store.getters['general/chainInfo'];
return chainInfo ? chainInfo.tokenSymbol : '';
Expand Down Expand Up @@ -303,7 +300,6 @@ export default defineComponent({
isShowBalance,
currentNetworkChain,
astarChain,
isLedger,
displayBalance,
backModal,
isClosing,
Expand Down
16 changes: 0 additions & 16 deletions src/components/header/styles/select-account.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,6 @@
justify-content: flex-end;
}

.text--is-ledger {
font-weight: 600;
font-size: 13px;
color: $gray-5;
}

.row--ledger-check {
display: flex;
justify-content: space-between;
align-items: center;
}

.box--account {
width: 100%;
display: flex;
Expand Down Expand Up @@ -281,10 +269,6 @@
color: $gray-3;
}

.text--is-ledger {
color: $gray-1;
}

.wrapper--account-detail {
.account-name {
color: $gray-1;
Expand Down
1 change: 0 additions & 1 deletion src/config/localStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export enum LOCAL_STORAGE {
XVM_TX_HISTORIES = 'xvmTxHistories',
BALLOON_NATIVE_TOKEN = 'balloonNativeToken',
THEME_COLOR = 'themeColor',
IS_LEDGER = 'isLedger',
MULTISIG = 'multisig',
CLOSE_DAPP_STAKING_V3_ONBOARDING = 'closeDappStakingV3Onboarding',
DECOMMISSION = 'decommission',
Expand Down
8 changes: 6 additions & 2 deletions src/hooks/helper/plasmUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ import { LOCAL_STORAGE } from 'src/config/localStorage';
* @param decimal eg: 18
* @returns '0.244 SDN'
*/
export const balanceFormatter = (bal: BN | string, decimal = ASTAR_DECIMALS): string => {
export const balanceFormatter = (
bal: BN | string,
decimal = ASTAR_DECIMALS,
includeCurrency = true
): string => {
let amount;
amount = defaultAmountWithDecimals(bal.toString(), decimal);

const defaultCurrency = localStorage.getItem(LOCAL_STORAGE.DEFAULT_CURRENCY);
return `${nFormatter(Number(amount))} ${defaultCurrency}`;
return `${nFormatter(Number(amount))} ${includeCurrency ? defaultCurrency : ''}`;
};
18 changes: 2 additions & 16 deletions src/hooks/useConnectWallet.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
ASTAR_SS58_FORMAT,
astarChain,
checkSumEvmAddress,
hasProperty,
wait,
Expand Down Expand Up @@ -40,7 +39,7 @@ import { useRouter } from 'vue-router';
import * as utils from 'src/hooks/custom-signature/utils';

export const useConnectWallet = () => {
const { SELECTED_ADDRESS, IS_LEDGER, SELECTED_WALLET } = LOCAL_STORAGE;
const { SELECTED_ADDRESS, SELECTED_WALLET } = LOCAL_STORAGE;

const modalAccountSelect = ref<boolean>(false);
const modalPolkasafeSelect = ref<boolean>(false);
Expand All @@ -53,8 +52,7 @@ export const useConnectWallet = () => {
const { requestAccounts, requestSignature } = useEvmAccount();
const { currentAccount, currentAccountName, disconnectAccount } = useAccount();
const router = useRouter();
const { currentNetworkIdx, currentNetworkChain, evmNetworkIdx, currentNetworkName } =
useNetworkInfo();
const { evmNetworkIdx, currentNetworkName } = useNetworkInfo();

const currentRouter = computed(() => router.currentRoute.value.matched[0]);
const currentNetworkStatus = computed(() => store.getters['general/networkStatus']);
Expand Down Expand Up @@ -366,16 +364,6 @@ export const useConnectWallet = () => {
});
};

// Memo: Ledger accounts are available on Astar only
const handleCheckLedgerEnvironment = async (): Promise<void> => {
const isLedger = localStorage.getItem(IS_LEDGER) === 'true';
if (isLedger && currentNetworkChain.value && currentNetworkChain.value !== astarChain.ASTAR) {
localStorage.setItem(IS_LEDGER, 'false');
await disconnectAccount();
window.location.reload();
}
};

watch([selectedWallet, currentEcdsaAccount, currentAccount, isH160], changeEvmAccount);

watchEffect(async () => {
Expand All @@ -394,8 +382,6 @@ export const useConnectWallet = () => {
{ immediate: true }
);

watch([currentNetworkChain], handleCheckLedgerEnvironment);

// Memo: check the EVM wallet's connected chainId when users switch the page
watch(
[currentRouter, selectedWallet, isH160],
Expand Down
16 changes: 2 additions & 14 deletions src/i18n/en-US/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export default {
insufficientExistentialDeposit:
'Account balances in {network} network is below than the existential deposit amount',
withdrawalNotSupport: "The portal doesn't support withdrawing to {chain} at this moment",
ledgerNotOpened: 'Ledger has not opened Astar App. Please open it and refresh this page.',
claimRewards:
'DApp Staking V3 is coming early 2024! Make sure to claim your rewards and stay tuned for the release date.',
underDevelopmentShibuyaWarning:
Expand Down Expand Up @@ -202,7 +201,6 @@ export default {
"Switch your network to 'Shiden' in the Math Wallet extension and refresh this page",
},
showBalance: 'Show {token} balance',
isLedgerAccount: 'This is a Ledger account, connected and running Astar app',
switchWalletConnectNetwork: 'Please switch to {network} network in your wallet',
multisig: {
initPolkasafe: 'Initializing PolkaSafe SDK for signature request; this may take a while',
Expand Down Expand Up @@ -320,15 +318,6 @@ export default {
'The number of eras that is shown here is per dApp. You may need to claim multiple times if you have too many unclaimed eras.',
restakeTip:
'By turning on, your rewards will be automatically re-staked when you make a claim.',
claimable: {
limitation:
'There is a limitation on the number of eras that can be claimed in one transaction.',
nativeWallets: 'Native wallets: ≒56 eras',
ledgerX: 'Ledger Nano X: 6 eras',
ledgerSPlus: 'Ledger Nano S Plus: 6 eras',
ledgerS: 'Ledger Nano S: 2 eras',
dcentWallet: "D'CENT Wallet: ≒28 eras",
},
dappsOwners: 'DApps owners! We can now help to promote your campaign. Please check',
dappsOwnersLink: 'the details.',
},
Expand Down Expand Up @@ -580,8 +569,6 @@ export default {
notSendToEvmExchanges:
"I’m NOT sending tokens to Exchange's EVM deposit addresses. I understand that if I do so, the funds will likely be lost.",
understandWarning: 'I understand that if I do so, the funds will likely be lost',
notDestIsLedgerAccount:
'The destination address is neither a ledger native account nor an exchange address. I understand that if I do so, the funds will likely be lost.',
notDestIsExchangeAddress: 'Destination address is not an Exchange address',
youWillReceive: 'You will receive',
faucetNextRequest: 'Time left until the next request',
Expand Down Expand Up @@ -869,7 +856,7 @@ export default {
unlockingAmount: 'Unlocking amount',
withdraw: 'Withdraw',
relock: 'Re-lock',
currentTier: 'Current Tier',
currentTier: 'Current Tier / Rank',
numberOfStakers: 'Number of stakers',
totalEarned: 'Total Earned',
yourDashboard: 'Your Dashboard',
Expand Down Expand Up @@ -933,6 +920,7 @@ export default {
'Real time amount of tokens that are entitled to receive bonus rewards.',
bonusPool: 'Bonus pool',
bonusPoolDescription: 'Fixed bonus allocation from block rewards. Check our ',
dappTierDescription: 'dApp tier and rank. Check our ',
dAppsSlots: 'dApps slots',
dAppsSlotsDescription:
'Number of project rewards for the slots filled by projects in the current era.',
Expand Down
Loading

0 comments on commit 9e75b0d

Please sign in to comment.