web/storagenode: zksync era compatible links wallet/transactions

Change-Id: I9079ca20e4d95abedbcf04c0d8529a0f2c6ac938
This commit is contained in:
Márton Elek 2023-06-06 12:03:30 +02:00 committed by Storj Robot
parent df53914faa
commit 3e3ec2358d
2 changed files with 33 additions and 6 deletions

View File

@ -12,7 +12,7 @@
<p class="wallet-area__wallet-address-section__bold-text">{{ walletAddress }}</p>
</div>
<a
v-if="!isZkSyncEnabled"
v-if="(!isZkSyncEnabled && !isZkSyncEraEnabled)"
class="wallet-area__button"
:href="`https://etherscan.io/address/${walletAddress}#tokentxns`"
target="_blank"
@ -20,7 +20,7 @@
>
<b class="wallet-area-button-label">View on Etherscan</b>
</a>
<div v-else class="wallet-area__buttons-area">
<div v-else-if="isZkSyncEnabled" class="wallet-area__buttons-area">
<a
class="wallet-area__button"
:href="`https://zkscan.io/explorer/accounts/${walletAddress}`"
@ -42,6 +42,28 @@
<p class="wallet-area__buttons-area__active-wallet-area__label">zkSync is opted-in</p>
</div>
</div>
<div v-else-if="isZkSyncEraEnabled" class="wallet-area__buttons-area">
<a
class="wallet-area__button"
:href="`https://explorer.zksync.io/address/${walletAddress}`"
target="_blank"
rel="noopener noreferrer"
>
<b class="wallet-area-button-label">View on ZkSync Era explorer</b>
</a>
<a
class="wallet-area__button"
:href="`https://etherscan.io/address/${walletAddress}#tokentxns`"
target="_blank"
rel="noopener noreferrer"
>
<b class="wallet-area-button-label">View on Etherscan</b>
</a>
<div class="wallet-area__buttons-area__active-wallet-area">
<CheckIcon class="wallet-area__buttons-area__active-wallet-area__icon" />
<p class="wallet-area__buttons-area__active-wallet-area__label">zkSync Era is opted-in</p>
</div>
</div>
</div>
</template>
@ -67,7 +89,11 @@ export default class WalletArea extends Vue {
private readonly walletFeatures: string[];
public get isZkSyncEnabled(): boolean {
return this.walletFeatures.includes('zksync');
return this.walletFeatures.includes('zksync') && !this.isZkSyncEraEnabled;
}
public get isZkSyncEraEnabled(): boolean {
return this.walletFeatures.includes('zksync-era');
}
}
</script>

View File

@ -307,10 +307,11 @@ export class SatellitePayoutForPeriod {
{
const zkScanUrl = 'https://zkscan.io/explorer/transactions';
if (this.receipt.indexOf('zksync') !== -1) {
if (this.receipt.indexOf('zksync-era') !== -1) {
return `https://explorer.zksync.io/tx/${prefixed(this.receipt.slice(11))}`;
} else if (this.receipt.indexOf('zksync') !== -1) {
return `${zkScanUrl}/${prefixed(this.receipt.slice(7))}`;
}
if (this.receipt.indexOf('zkwithdraw') !== -1) {
} else if (this.receipt.indexOf('zkwithdraw') !== -1) {
return `${zkScanUrl}/${prefixed(this.receipt.slice(11))}`;
}
}