Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/open withdraw #103

Merged
merged 2 commits into from
Apr 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions components/transaction/TransactionFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
</CommonButton>
</div>
<div v-if="buttonStep === 'network'" class="transaction-footer-row">
<CommonButtonTopInfo>Incorrect network selected in your wallet</CommonButtonTopInfo>
<CommonButtonTopInfo>222Incorrect network selected in your wallet</CommonButtonTopInfo>
<CommonButton
v-if="connectorName !== 'WalletConnect'"
v-if="
connectorName !== 'WalletConnect' ||
(connectorName === 'WalletConnect' && (walletName?.includes('OKX') || walletName?.includes('MetaMask')))
"
type="submit"
:disabled="switchingNetworkInProgress"
variant="primary"
Expand Down
7 changes: 3 additions & 4 deletions store/zksync/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,10 @@ export const useZkSyncWalletStore = defineStore("zkSyncWallet", () => {
return [...knownTokens, ...otherTokens];
});

const balanceRef = reactive(balance);

const deductBalance = (tokenAddress: string, amount: BigNumberish) => {
if (!balance.value) return;
const tokenBalance = balanceRef.value.find((balance) => balance.address === tokenAddress);
const index = balance.value.findIndex((balance) => balance.address === tokenAddress);
const tokenBalance = balance.value[index];
if (!tokenBalance) return;
const newBalance = BigNumber.from(tokenBalance.amount).sub(amount);
tokenBalance.amount = newBalance.isNegative() ? "0" : newBalance.toString();
Expand Down Expand Up @@ -221,7 +220,7 @@ export const useZkSyncWalletStore = defineStore("zkSyncWallet", () => {
getL1VoidSigner,
getPrimaryL1VoidSigner,

balance: balanceRef,
balance,
balanceInProgress: computed(() => balanceInProgress.value),
balanceError: computed(() => balanceError.value),
requestBalance,
Expand Down
2 changes: 1 addition & 1 deletion views/transactions/Withdraw.vue
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ const availableBalances = computed(() => {
}
return balance.value;
});
console.log('availableTokens: ',availableTokens.value)

const routeTokenAddress = computed(() => {
if (!route.query.token || Array.isArray(route.query.token) || !isAddress(route.query.token)) {
return;
Expand Down
Loading