Skip to content

Commit

Permalink
Merge pull request #802 from telosnetwork/798-make-external-links-in-…
Browse files Browse the repository at this point in the history
…telos-wallet-larger

#797, #798 | adding bridge external link and make them larger
  • Loading branch information
pmjanus authored Apr 30, 2024
2 parents 2ed6b9c + 53a516d commit ecded33
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/antelope/chains/EVMChainSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ export default abstract class EVMChainSettings implements ChainSettings {
abstract getWeiPrecision(): number;
abstract getExplorerUrl(): string;
abstract getEcosystemUrl(): string;
abstract getBridgeUrl(): string;
abstract getTrustedContractsBucket(): string;
abstract getSystemTokens(): TokenClass[];
abstract getIndexerApiEndpoint(): string;
Expand Down
6 changes: 6 additions & 0 deletions src/antelope/chains/evm/telos-evm-testnet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ const API_ENDPOINT = 'https://api-dev.telos.net/v1';
const WEI_PRECISION = 18;
const EXPLORER_URL = 'https://testnet.teloscan.io';
const ECOSYSTEM_URL = 'https://www.telos.net/ecosystem';
const BRIDGE_URL = 'https://telos-bridge-testnet.netlify.app/bridge';

const NETWORK_EVM_ENDPOINT = 'https://testnet.telos.net';
const INDEXER_ENDPOINT = 'https://api.testnet.teloscan.io';
const CONTRACTS_BUCKET = 'https://verified-evm-contracts-testnet.s3.amazonaws.com';
Expand Down Expand Up @@ -144,6 +146,10 @@ export default class TelosEVMTestnet extends EVMChainSettings {
return ECOSYSTEM_URL;
}

getBridgeUrl(): string {
return BRIDGE_URL;
}

getTrustedContractsBucket(): string {
return CONTRACTS_BUCKET;
}
Expand Down
5 changes: 5 additions & 0 deletions src/antelope/chains/evm/telos-evm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const API_ENDPOINT = 'https://api.telos.net/v1';
const WEI_PRECISION = 18;
const EXPLORER_URL = 'https://teloscan.io';
const ECOSYSTEM_URL = 'https://www.telos.net/ecosystem';
const BRIDGE_URL = 'https://bridge.telos.net/bridge';
const NETWORK_EVM_ENDPOINT = 'https://mainnet.telos.net';
const INDEXER_ENDPOINT = 'https://api.teloscan.io';
const CONTRACTS_BUCKET = 'https://verified-evm-contracts.s3.amazonaws.com';
Expand Down Expand Up @@ -140,6 +141,10 @@ export default class TelosEVMTestnet extends EVMChainSettings {
return ECOSYSTEM_URL;
}

getBridgeUrl(): string {
return BRIDGE_URL;
}

getTrustedContractsBucket(): string {
return CONTRACTS_BUCKET;
}
Expand Down
1 change: 1 addition & 0 deletions src/antelope/stores/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export const useChainStore = defineStore(store_name, {
// https://github.com/telosnetwork/telos-wallet/issues/246
getExplorerUrl: () => (network: string) => (settings[network] as EVMChainSettings).getExplorerUrl(),
getEcosystemUrl: () => (network: string) => (settings[network] as EVMChainSettings).getEcosystemUrl(),
getBridgeUrl: () => (network: string) => (settings[network] as EVMChainSettings).getBridgeUrl(),
getNetworkSettings: () => (network: string) => settings[network],
getStakedRatio: state => (label: string) => (state.__chains[label] as EvmChainModel).stakeRatio ?? ethers.constants.Zero,
getUnstakedRatio: state => (label: string) => (state.__chains[label] as EvmChainModel).unstakeRatio ?? ethers.constants.Zero,
Expand Down
16 changes: 15 additions & 1 deletion src/components/evm/AppNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ export default defineComponent({
const network = this.loggedAccount.network;
window.open(chainStore.getExplorerUrl(network), '_blank');
},
goToTelosBridge() {
const network = this.loggedAccount.network;
window.open(chainStore.getBridgeUrl(network), '_blank');
},
},
});
</script>
Expand Down Expand Up @@ -389,6 +393,16 @@ export default defineComponent({
{{ $t('nav.teloscan') }}
<q-icon size="16px" name="launch" />
</li>
<li
class="c-app-nav__menu-link"
role="menuitem"
:tabindex="menuItemTabIndex"
@click="goToTelosBridge()"
@keypress.space.enter="goToTelosBridge()"
>
{{ $t('nav.bridge') }}
<q-icon size="16px" name="launch" />
</li>
</ul>

<div v-if="!isProduction" class="c-app-nav__demos-link">
Expand Down Expand Up @@ -573,7 +587,7 @@ export default defineComponent({
}
&__menu-link {
@include text--small-bold;
@include text--paragraph-bold;
cursor: pointer;
display: flex;
Expand Down
1 change: 1 addition & 0 deletions src/i18n/en-us/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export default {
login: 'Connect Wallet',
teloscan: 'Teloscan',
ecosystem: 'Ecosystem',
bridge: 'Bridge',
nfts: 'Digital Collectibles',
allowances: 'Approvals',
},
Expand Down

0 comments on commit ecded33

Please sign in to comment.