Skip to content

Commit

Permalink
web/storagenode: zksync era compatible links wallet/transactions
Browse files Browse the repository at this point in the history
Change-Id: I9079ca20e4d95abedbcf04c0d8529a0f2c6ac938
  • Loading branch information
elek authored and Storj Robot committed Jun 8, 2023
1 parent df53914 commit 3e3ec23
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
32 changes: 29 additions & 3 deletions web/storagenode/src/app/components/WalletArea.vue
Expand Up @@ -12,15 +12,15 @@
<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"
rel="noopener noreferrer"
>
<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}`"
Expand All @@ -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>

Expand All @@ -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>
Expand Down
7 changes: 4 additions & 3 deletions web/storagenode/src/storagenode/payouts/payouts.ts
Expand Up @@ -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))}`;
}
}
Expand Down

0 comments on commit 3e3ec23

Please sign in to comment.