Skip to content

Commit

Permalink
Merge pull request #2 from pendulum-chain/sync-forked-repo
Browse files Browse the repository at this point in the history
Sync forked repo
  • Loading branch information
b-yap authored Aug 12, 2024
2 parents 3e7e676 + 9e89be7 commit 9b5c335
Show file tree
Hide file tree
Showing 57 changed files with 3,466 additions and 551 deletions.
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@
"@astar-network/metamask-astar-types": "^0.6.1",
"@ethersproject/bignumber": "^5.5.0",
"@layerzerolabs/scan-client": "^0.0.8",
"@polkadot/api": "^10.9.1",
"@polkadot/api-contract": "^10.9.1",
"@polkadot/extension-dapp": "0.46.5",
"@polkadot/hw-ledger": "^12.3.2",
"@polkadot/keyring": "^12.3.2",
"@polkadot/networks": "^12.3.2",
"@polkadot/rpc-provider": "^10.9.1",
"@polkadot/types": "^10.9.1",
"@polkadot/types-known": "^10.9.1",
"@polkadot/types-support": "^10.9.1",
"@polkadot/ui-keyring": "^3.5.1",
"@polkadot/util": "^12.3.2",
"@polkadot/util-crypto": "^12.3.2",
"@polkadot/vue-identicon": "^3.5.1",
"@polkadot/wasm-crypto": "^7.2.1",
"@polkadot/x-randomvalues": "^12.3.2",
"@polkadot/api": "^11.3.1",
"@polkadot/api-contract": "^11.3.1",
"@polkadot/extension-dapp": "0.47.5",
"@polkadot/hw-ledger": "^12.6.2",
"@polkadot/keyring": "^12.6.2",
"@polkadot/networks": "^12.6.2",
"@polkadot/rpc-provider": "^11.3.1",
"@polkadot/types": "^11.3.1",
"@polkadot/types-known": "^11.3.1",
"@polkadot/types-support": "^11.3.1",
"@polkadot/ui-keyring": "^3.6.6",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@polkadot/vue-identicon": "^3.6.6",
"@polkadot/wasm-crypto": "^7.3.2",
"@polkadot/x-randomvalues": "^12.6.2",
"@quasar/app-webpack": "^3.11.2",
"@quasar/extras": "^1.16.7",
"@vue/apollo-composable": "^4.0.0-beta.4",
Expand All @@ -72,7 +72,7 @@
"luxon": "^2.5.2",
"marked": "^4.0.15",
"path": "^0.12.7",
"polkasafe": "^1.1.10",
"polkasafe": "^1.4.2",
"quasar": "^2.12.7",
"query-string": "^7.1.0",
"reflect-metadata": "^0.1.13",
Expand Down
4 changes: 2 additions & 2 deletions src/components/assets/Account.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
width="24"
:src="iconWallet"
alt="wallet-icon"
:class="multisig && 'img--polkasafe'"
:class="multisig && 'img--polkasafe-account'"
/>
</div>

Expand Down Expand Up @@ -145,7 +145,7 @@
</template>
<script lang="ts">
import { getShortenAddress, isValidEvmAddress, wait } from '@astar-network/astar-sdk-core';
import { FrameSystemAccountInfo } from '@polkadot/types/lookup';
import { FrameSystemAccountInfo } from 'src/v2/repositories/implementations';
import copy from 'copy-to-clipboard';
import { ethers } from 'ethers';
import { $api } from 'src/boot/api';
Expand Down
37 changes: 22 additions & 15 deletions src/components/assets/Erc20Currency.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,41 +53,43 @@
</router-link>

<div v-if="token.isWrappedToken && !token.isXC20">
<a :href="token.bridgeUrl" target="_blank" rel="noopener noreferrer">
<custom-router-link
:to="token.bridgeUrl ?? ''"
:is-disabled="!token.bridgeUrl || !isBridgeEnabled(token.bridgeUrl)"
>
<button class="btn btn--icon">
<astar-icon-bridge class="icon--bridge" />
</button>
<span class="text--expand-menu">{{ $t('assets.wrap') }}</span>
<q-tooltip>
<span class="text--tooltip">{{ $t('assets.wrap') }}</span>
</q-tooltip>
</a>
</custom-router-link>
</div>

<div v-if="isZkEvm">
<a
<custom-router-link
v-if="token.bridgeUrl"
:href="token.bridgeUrl"
target="_blank"
rel="noopener noreferrer"
:to="token.bridgeUrl"
:is-disabled="!isBridgeEnabled(token.bridgeUrl)"
>
<button class="btn btn--icon">
<astar-icon-bridge class="icon--bridge" />
</button>
<button class="btn btn--icon"><astar-icon-bridge class="icon--bridge" /></button>
<span class="text--expand-menu">{{ $t('assets.bridge') }}</span>
<q-tooltip>
<span class="text--tooltip">{{ $t('assets.bridge') }}</span>
</q-tooltip>
</a>
<router-link v-else :to="buildEthereumBridgePageLink()">
<button class="btn btn--icon">
<astar-icon-bridge class="icon--bridge" />
</button>
</custom-router-link>
<custom-router-link
v-else
:to="buildEthereumBridgePageLink()"
:is-disabled="!nativeBridgeEnabled"
>
<button class="btn btn--icon"><astar-icon-bridge class="icon--bridge" /></button>
<span class="text--expand-menu">{{ $t('assets.bridge') }}</span>
<q-tooltip>
<span class="text--tooltip">{{ $t('assets.bridge') }}</span>
</q-tooltip>
</router-link>
</custom-router-link>
</div>

<a :href="explorerLink" target="_blank" rel="noopener noreferrer">
Expand Down Expand Up @@ -165,10 +167,13 @@ import { useStore } from 'src/store';
import { PropType, computed, defineComponent, ref } from 'vue';
import Jazzicon from 'vue3-jazzicon/src/components';
import { truncate } from '@astar-network/astar-sdk-core';
import { nativeBridgeEnabled, isBridgeEnabled } from 'src/features';
import CustomRouterLink from '../common/CustomRouterLink.vue';
export default defineComponent({
components: {
[Jazzicon.name]: Jazzicon,
CustomRouterLink,
},
props: {
token: {
Expand Down Expand Up @@ -225,11 +230,13 @@ export default defineComponent({
isTruncate,
isFavorite,
isZkEvm,
nativeBridgeEnabled,
truncate,
buildTransferPageLink,
addToEvmProvider,
handleDeleteStoredToken,
buildEthereumBridgePageLink,
isBridgeEnabled,
};
},
});
Expand Down
3 changes: 1 addition & 2 deletions src/components/assets/EvmAssetList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</div>
</template>
<script lang="ts">
import { cbridgeAppLink, checkIsCbridgeToken } from 'src/c-bridge';
import { checkIsCbridgeToken } from 'src/c-bridge';
import AssetSearchOption from 'src/components/assets/AssetSearchOption.vue';
import Erc20Currency from 'src/components/assets/Erc20Currency.vue';
import EvmCbridgeToken from 'src/components/assets/EvmCbridgeToken.vue';
Expand Down Expand Up @@ -141,7 +141,6 @@ export default defineComponent({
isSearch,
search,
filteredTokens,
cbridgeAppLink,
isHideSmallBalances,
isDarkTheme,
icon_img,
Expand Down
25 changes: 16 additions & 9 deletions src/components/assets/EvmCbridgeToken.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,27 @@

<q-slide-transition :duration="150">
<div v-show="isExpand || width >= screenSize.sm" class="row__right">
<router-link :to="buildTransferPageLink(token.symbol)">
<button class="btn btn--icon">
<astar-icon-transfer />
</button>
<custom-router-link :to="buildTransferPageLink(token.symbol)">
<button class="btn btn--icon"><astar-icon-transfer /></button>
<span class="text--expand-menu">{{ $t('assets.send') }}</span>
<q-tooltip>
<span class="text--tooltip">{{ $t('assets.send') }}</span>
</q-tooltip>
</router-link>
</custom-router-link>

<a :href="cbridgeAppLink" target="_blank" rel="noopener noreferrer">
<button class="btn btn--icon">
<div>
<button
class="btn btn--icon"
:disabled="!celerBridgeEnabled"
@click="navigateInNewTab(cbridgeAppLink)"
>
<astar-icon-bridge class="icon--bridge" />
</button>
<span class="text--expand-menu">{{ $t('assets.bridge') }}</span>
<q-tooltip>
<span class="text--tooltip">{{ $t('assets.bridge') }}</span>
</q-tooltip>
</a>
</div>

<a :href="explorerLink" target="_blank" rel="noopener noreferrer">
<button class="btn btn--icon">
Expand Down Expand Up @@ -118,12 +120,15 @@ import { computed, defineComponent, PropType, ref } from 'vue';
import { buildTransferPageLink } from 'src/router/routes';
import { useNetworkInfo, useBreakpoints } from 'src/hooks';
import Jazzicon from 'vue3-jazzicon/src/components';
import TokenBalance from 'src/components/common/TokenBalance.vue';
import { truncate } from '@astar-network/astar-sdk-core';
import { celerBridgeEnabled } from 'src/features';
import { navigateInNewTab } from 'src/util-general';
import CustomRouterLink from '../common/CustomRouterLink.vue';
export default defineComponent({
components: {
[Jazzicon.name]: Jazzicon,
CustomRouterLink,
},
props: {
token: {
Expand Down Expand Up @@ -176,10 +181,12 @@ export default defineComponent({
isExpand,
isTruncate,
isFavorite,
celerBridgeEnabled,
truncate,
buildTransferPageLink,
formatTokenName,
addToEvmProvider,
navigateInNewTab,
};
},
});
Expand Down
41 changes: 29 additions & 12 deletions src/components/assets/EvmNativeToken.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,32 @@
</q-tooltip>
</router-link>

<router-link v-if="isAstar" :to="buildLzBridgePageLink()">
<button class="btn btn--icon">
<astar-icon-bridge />
</button>
<custom-router-link
v-if="isAstar"
:to="buildLzBridgePageLink()"
:is-disabled="!layerZeroBridgeEnabled"
>
<button class="btn btn--icon"><astar-icon-bridge /></button>
<span class="text--mobile-menu">{{ $t('assets.bridge') }}</span>
<q-tooltip>
<span class="text--tooltip">{{ $t('assets.bridge') }}</span>
</q-tooltip>
</router-link>
</custom-router-link>

<router-link v-if="isZkEvm" :to="buildEthereumBridgePageLink()">
<button class="btn btn--icon">
<astar-icon-bridge />
</button>
<custom-router-link
v-if="isZkEvm"
:to="buildEthereumBridgePageLink()"
:is-disabled="!nativeBridgeEnabled"
>
<button class="btn btn--icon"><astar-icon-bridge /></button>
<span class="text--mobile-menu">{{ $t('assets.bridge') }}</span>
<q-tooltip>
<span class="text--tooltip">{{ $t('assets.bridge') }}</span>
</q-tooltip>
</router-link>
</custom-router-link>

<!-- Only SDN is able to bridge via cBridge at this moment -->
<a
<!-- <a
v-if="nativeTokenSymbol === 'SDN'"
:href="cbridgeAppLink"
target="_blank"
Expand All @@ -77,6 +81,15 @@
<q-tooltip>
<span class="text--tooltip">{{ $t('assets.bridge') }}</span>
</q-tooltip>
</a> -->
<a v-if="nativeTokenSymbol === 'SDN'">
<button class="btn btn--icon" disabled>
<astar-icon-bridge />
</button>
<span class="text--mobile-menu">{{ $t('assets.bridge') }}</span>
<q-tooltip>
<span class="text--tooltip">{{ $t('assets.bridge') }}</span>
</q-tooltip>
</a>

<a v-if="isZkyoto" :href="faucetSethLink" target="_blank" rel="noopener noreferrer">
Expand Down Expand Up @@ -120,9 +133,11 @@ import {
} from 'src/router/routes';
import { useStore } from 'src/store';
import { computed, defineComponent, ref, watchEffect } from 'vue';
import { nativeBridgeEnabled, layerZeroBridgeEnabled } from 'src/features';
import CustomRouterLink from '../common/CustomRouterLink.vue';
export default defineComponent({
components: { ModalFaucet },
components: { ModalFaucet, CustomRouterLink },
props: {
nativeTokenUsd: {
type: Number,
Expand Down Expand Up @@ -199,6 +214,8 @@ export default defineComponent({
screenSize,
isTruncate,
isAstar,
nativeBridgeEnabled,
layerZeroBridgeEnabled,
truncate,
handleModalFaucet,
buildTransferPageLink,
Expand Down
24 changes: 19 additions & 5 deletions src/components/assets/ZkAstr.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,35 @@
</q-tooltip>
</router-link>

<router-link v-if="t.symbol === 'ASTR'" :to="buildLzBridgePageLink()" class="box--icon">
<custom-router-link
v-if="t.symbol === 'ASTR'"
:to="buildLzBridgePageLink()"
:is-disabled="!layerZeroBridgeEnabled"
class="box--icon"
>
<button class="btn btn--icon">
<astar-icon-bridge />
</button>
<span class="text--mobile-menu">{{ $t('assets.bridge') }}</span>
<q-tooltip>
<span class="text--tooltip">{{ $t('assets.bridge') }}</span>
</q-tooltip>
</router-link>
</custom-router-link>

<a v-else :href="vAstrOmniLink" target="_blank" rel="noopener noreferrer" class="box--icon">
<custom-router-link
v-else
:to="vAstrOmniLink"
:is-disabled="!omniBridgeEnabled"
class="box--icon"
>
<button class="btn btn--icon">
<astar-icon-bridge />
</button>
<span class="text--mobile-menu">{{ $t('assets.swap') }}</span>
<q-tooltip>
<span class="text--tooltip">{{ $t('assets.swap') }}</span>
</q-tooltip>
</a>
</custom-router-link>

<a
:href="getExplorerLink(t.address)"
Expand Down Expand Up @@ -115,9 +125,11 @@ import { Erc20Token, getErc20Explorer } from 'src/modules/token';
import { buildTransferPageLink, buildLzBridgePageLink } from 'src/router/routes';
import { PropType, defineComponent } from 'vue';
import { vAstrOmniLink } from '../../modules/zk-evm-bridge';
import CustomRouterLink from 'src/components/common/CustomRouterLink.vue';
import { layerZeroBridgeEnabled, omniBridgeEnabled } from 'src/features';
export default defineComponent({
components: {},
components: { CustomRouterLink },
props: {
astrTokens: {
type: Array as PropType<Erc20Token[]>,
Expand All @@ -140,6 +152,8 @@ export default defineComponent({
addToEvmProvider,
buildTransferPageLink,
getExplorerLink,
layerZeroBridgeEnabled,
omniBridgeEnabled,
};
},
});
Expand Down
Loading

0 comments on commit 9b5c335

Please sign in to comment.