Skip to content

Commit

Permalink
Merge branch 'main' into fix_path_to_hyperchain_env_config
Browse files Browse the repository at this point in the history
  • Loading branch information
ilitteri authored Jun 5, 2024
2 parents bf3b665 + f6313b0 commit 3ea05b9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 20 deletions.
7 changes: 5 additions & 2 deletions store/ethereumBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ export const useEthereumBalanceStore = defineStore("ethereumBalance", () => {
if (!portalRuntimeConfig.ankrToken) throw new Error("Ankr token is not available");

const ankrProvider = new AnkrProvider(`https://rpc.ankr.com/multichain/${portalRuntimeConfig.ankrToken}`);
const networkIdToAnkr = new Map<number, AnkrSupportedChains>([[l1Networks.mainnet.id, "eth"]]);
const networkIdToAnkr = new Map<number, AnkrSupportedChains | "eth_sepolia">([
[l1Networks.mainnet.id, "eth"],
[l1Networks.sepolia.id, "eth_sepolia"],
]);
if (!networkIdToAnkr.has(eraNetwork.value.l1Network.id)) {
throw new Error(`Ankr does not support ${eraNetwork.value.l1Network.name}`);
}
const balances = await ankrProvider.getAccountBalance({
blockchain: [networkIdToAnkr.get(eraNetwork.value.l1Network.id)!],
blockchain: [networkIdToAnkr.get(eraNetwork.value.l1Network.id)!] as AnkrSupportedChains[],
walletAddress: account.value.address,
onlyWhitelisted: false,
});
Expand Down
5 changes: 4 additions & 1 deletion store/zksync/ethereumBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ export const useZkSyncEthereumBalanceStore = defineStore("zkSyncEthereumBalances
async () => {
if (!l1Network.value) throw new Error(`L1 network is not available on ${selectedNetwork.value.name}`);

if (([l1Networks.mainnet.id] as number[]).includes(l1Network.value?.id) && portalRuntimeConfig.ankrToken) {
if (
([l1Networks.mainnet.id, l1Networks.sepolia.id] as number[]).includes(l1Network.value?.id) &&
portalRuntimeConfig.ankrToken
) {
return await getBalancesFromApi();
} else {
return await getBalancesFromRPC();
Expand Down
9 changes: 1 addition & 8 deletions views/transactions/Deposit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,7 @@
<CommonButton type="submit" variant="primary" class="mt-block-gap w-full gap-1" @click="buttonContinue()">
I understand, proceed to bridge
</CommonButton>
<CommonButton
as="a"
href="https://zksync.dappradar.com/ecosystem?category=defi_bridge"
target="_blank"
size="sm"
class="mx-auto mt-block-gap w-max"
@click="disableWalletWarning()"
>
<CommonButton size="sm" class="mx-auto mt-block-gap w-max" @click="disableWalletWarning()">
Don't show again
</CommonButton>
</template>
Expand Down
3 changes: 1 addition & 2 deletions views/transactions/Transfer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,7 @@ const withdrawalManualFinalizationRequired = computed(() => {
if (!transaction.value) return false;
return (
props.type === "withdrawal" &&
(isCustomNode ||
isWithdrawalManualFinalizationRequired(transaction.value.token, eraNetwork.value.l1Network?.id || -1))
isWithdrawalManualFinalizationRequired(transaction.value.token, eraNetwork.value.l1Network?.id || -1)
);
});
Expand Down
8 changes: 1 addition & 7 deletions views/transactions/WithdrawalSubmitted.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@
<script lang="ts" setup>
import { ExclamationTriangleIcon } from "@heroicons/vue/24/outline";
import { isWithdrawalManualFinalizationRequired } from "@/composables/zksync/useTransaction";
import useWithdrawalFinalization from "@/composables/zksync/useWithdrawalFinalization";
import { isCustomNode } from "@/data/networks";
const props = defineProps({
transaction: {
Expand All @@ -172,11 +170,7 @@ const { connectorName, isCorrectNetworkSet } = storeToRefs(onboardStore);
const isCustomBridgeToken = computed(() => !props.transaction.token.l1Address);
const withdrawalManualFinalizationRequired = computed(() => {
return (
!props.transaction.info.completed &&
(isCustomNode ||
isWithdrawalManualFinalizationRequired(props.transaction.token, eraNetwork.value.l1Network?.id || -1))
);
return !props.transaction.info.completed;
});
const withdrawalFinalizationAvailable = computed(() => {
return (
Expand Down

0 comments on commit 3ea05b9

Please sign in to comment.