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/failed deposit history #183

Merged
merged 85 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
8ab15ba
fix: show withdraw bridge
haymond-ZK Apr 10, 2024
b3e4bcb
fix: open withdraw
haymond-ZK Apr 10, 2024
4065b11
feat: Added okx and binance walletconnect support
Evan-zkLinkLabs Mar 17, 2024
7ec4121
feat: support wallet connect for more wallet
Evan-zkLinkLabs Mar 17, 2024
c6002d0
feat: add manifest
haymond-ZK Mar 18, 2024
fe1f439
feat: change short name
Evan-zkLinkLabs Mar 18, 2024
3a50406
add safe
zkcarter Mar 18, 2024
b4b6228
fix warning window
zkcarter Mar 18, 2024
f03f776
enable autoconnect
zkcarter Mar 18, 2024
3d6e431
fix: edit meta image
haymond-ZK Mar 19, 2024
f03af24
feat: Transform transfer
haymond-ZK Mar 19, 2024
f356c4b
fix conflicts
MickWang Apr 10, 2024
92513bb
feat: Display Third-Party Bridge Options on Withdrawals Page #53
MickWang Apr 10, 2024
7ec3180
fix: Correct the rate unit.
haymond-ZK Mar 19, 2024
5582448
fix: initial display shows as 'eth'.
haymond-ZK Mar 20, 2024
a989b36
fix:Adjust the estimated time.
haymond-ZK Mar 19, 2024
bb2c0aa
fix: Extraction method.
haymond-ZK Mar 20, 2024
99dfd3a
fix: Extraction method
haymond-ZK Mar 20, 2024
6a32850
feat: change walletconnect id
Evan-zkLinkLabs Mar 22, 2024
095ff91
fix: Adding other third-party chains
MickWang Apr 10, 2024
9ceec33
add op and base
zkcarter Mar 22, 2024
960a4a4
fix: delete okx wallet Close #56
haymond-ZK Mar 22, 2024
b0154b5
fix: temporary increase the /tokens api limit to 200
Evan-zkLinkLabs Mar 23, 2024
0fab043
fix: Reducing the height of each chain Close #61
haymond-ZK Mar 25, 2024
7b36bd2
feat: Modify note content and add navigation
haymond-ZK Mar 25, 2024
98cfa19
fix: add bridge when no balance
haymond-ZK Mar 19, 2024
f1c0084
fix: add all bridge when no balance
haymond-ZK Mar 20, 2024
5feaff3
fix: set icon with valid size
haymond-ZK Mar 25, 2024
3e9bd60
fix: set icon with valid size Close #58
haymond-ZK Mar 25, 2024
40ec9db
fix: Handling the misdirected issue of the label #59 #58
haymond-ZK Mar 26, 2024
a2faf6d
fix linea estimate gas error
MickWang Mar 31, 2024
dfda5ee
add preview branch Dockerfile
Mar 27, 2024
c630a65
Add gate.io wallet
ggg223399 Mar 27, 2024
80be7df
upgrade web3modal and deps
MickWang Apr 2, 2024
6482f4f
fix switch chain issue for wallet connect
MickWang Apr 2, 2024
3d4d73a
fix switch chain issue for wallet connect
MickWang Apr 2, 2024
fe73a48
add supported chains check for gate wallet
MickWang Apr 3, 2024
df08ecd
remove gate web3 wallet
MickWang Apr 3, 2024
d7b404c
fix check supported walelts
MickWang Apr 3, 2024
93c073e
fix: Adjust note based on route information
haymond-ZK Apr 3, 2024
b5168e7
fix: Adjust entrance image based on route information
haymond-ZK Apr 3, 2024
99e0685
fix: add okx tips
leochw Apr 4, 2024
bde6dcf
build: rm /bridge from base url
leochw Apr 4, 2024
ced197b
feat: update okx tips style
leochw Apr 4, 2024
750ad70
fix error when check l2 txhash
MickWang Apr 9, 2024
6ffc3d5
fix: update okx tips icon
MickWang Apr 10, 2024
66f4036
fix: Adding Page Elements
MickWang Apr 10, 2024
67f6737
update deposit for merge token
MickWang Apr 10, 2024
63fb1d8
add depositToMerge
MickWang Apr 3, 2024
0a66156
fix: reslove merge issues
MickWang Apr 10, 2024
28d735e
update ui for deposit merge
MickWang Apr 6, 2024
fb6d8a1
update estimate l2gaslimit for depost merge
MickWang Apr 6, 2024
15d7c80
fix depoist merge exceeds limit check
MickWang Apr 7, 2024
049ac0a
fix:refresh balance after deposit
MickWang Apr 7, 2024
d03fe83
fix: change merge switch style
MickWang Apr 10, 2024
d57cea6
fix: change switch style
haymond-ZK Apr 7, 2024
6ee6789
fix: change switch add limit
haymond-ZK Apr 7, 2024
8e8ca52
update ui for merge token
MickWang Apr 9, 2024
f7dd3e0
update text
MickWang Apr 9, 2024
51b968b
use multicall to getBalance
MickWang Apr 7, 2024
6c07c7e
update multicall for get balance
MickWang Apr 8, 2024
10a0b92
add exception catch for amount exceeds decimals
MickWang Apr 9, 2024
5e7d678
fix deposit merge
MickWang Apr 9, 2024
3222dd7
fix: add sepolia start command
haymond-ZK Apr 10, 2024
3cf4a70
update estiamte withdrawal time
MickWang Apr 10, 2024
f29b5e5
update sepolia network
zkcarter Apr 11, 2024
14c3867
update dev ci to sepolia
zkcarter Apr 11, 2024
8c8bb85
fix ui issue of deposit page
MickWang Apr 11, 2024
a28d141
add multicall3 contract for manta sepolia; update rpc for estiamte ga…
MickWang Apr 11, 2024
ea7e4b8
refactor github workflow
zkcarter Apr 12, 2024
a023880
update build ci branch logic
zkcarter Apr 12, 2024
90c14fb
update ci trigger action
zkcarter Apr 12, 2024
04842c6
update secrets_scanner trigger action
zkcarter Apr 12, 2024
d5f8568
fix ci build condition
zkcarter Apr 12, 2024
f09131f
Merge pull request #97 from zkLinkProtocol/ci
zkcarter Apr 12, 2024
dcb5d71
fix conflicts
MickWang Apr 15, 2024
972ece9
Merge pull request #112 from zkLinkProtocol/feat/merge_main_dev
haymond-ZK Apr 15, 2024
7d56e74
Merge branch 'main' into feat/merge_main_dev
MickWang Apr 18, 2024
3a049d2
fix conflicts
MickWang Apr 19, 2024
8978e89
Merge pull request #145 from zkLinkProtocol/feat/merge_main_dev
haymond-ZK Apr 19, 2024
b70db1b
add api for failed deposit history
MickWang Apr 19, 2024
7116684
update failed tx history ui
MickWang Apr 20, 2024
5f5e0cf
update ui for failed deposit tx history
MickWang Apr 21, 2024
3db0e5d
fix conflicts
MickWang Apr 24, 2024
5267ecb
update transfers ui
MickWang Apr 24, 2024
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
2 changes: 1 addition & 1 deletion Dockerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /dapp-portal

ADD . /dapp-portal

RUN npm install && npm run generate:node:nexus-goerli
RUN npm install && npm run generate:node:nexus-sepolia

FROM 475911326710.dkr.ecr.ap-northeast-1.amazonaws.com/nginx:alpine3.18

Expand Down
172 changes: 172 additions & 0 deletions components/transaction/FailedDepositLineItem.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
<template>
<CommonButtonLine class="transaction-withdrawal-line-item" @click="isModalOpen = true">
<div class="line-button-with-img-image">
<DestinationIconContainer class="p-0">
<img src="/img/icon-cross.svg" class="w-3 h-3" />
</DestinationIconContainer>
</div>
<div class="withdrawal-line-body">
<div class="withdrawal-line-top">
<div class="line-button-with-img-body">
<CommonButtonLineBodyInfo class="text-left">
<template #label> Failed Deposit </template>
<template #underline>
<template v-if="chainsLabel">
<div>
From:
<!-- <img v-if="chainIconUrl" class="chain-icon left" :src="chainIconUrl" /> -->
<span>{{ chainsLabel }}</span
>.
</div>
</template>
<span>{{ timeAgo }}</span>
</template>
</CommonButtonLineBodyInfo>
</div>
<div class="line-button-with-img-right">
<CommonButtonLineBodyInfo ref="el" class="hidden text-right sm:block">
<template #secondary>
<TokenAmount v-if="token" :token="token" :amount="computeAmount" />
</template>
<template #underline>
<div class="flex flex-col">
<span>Claim on source chain</span>
<CommonTimer format="human-readable" :future-date="expectedCompleteTimestamp" :only-days="true">
<template #default="{ timer, isTimerFinished }">
<span>{{ timer }} days left</span>
</template>
</CommonTimer>
</div>
</template>
</CommonButtonLineBodyInfo>
</div>
</div>
</div>
</CommonButtonLine>
<CommonModal v-model:opened="isModalOpen" title="Failed Deposit">
<div class="flex flex-col items-center text-left">
<p class="w-full text-left mb-8 mt-4">Your assets are SAFE!</p>

<p class="w-full text-left mb-8">
However, unfortunately, your deposit from Arbitrum failed to execute on Nova, resulting in your assets remaining
on the source chain.
</p>

<p class="w-full text-left mb-4">
After a 14-day period from the time of your deposit, your assets will be automatically returned to the deposit
address on the source chain.
</p>
<CommonButton type="submit" variant="primary" class="w-full" @click="isModalOpen = false"> Confirm </CommonButton>
<a class="mt-4">Contact for help</a>
</div>
</CommonModal>
</template>

<script lang="ts" setup>
import { computed, ref } from "vue";

import { ArrowRightIcon, MinusIcon } from "@heroicons/vue/24/outline";
import { useTimeAgo } from "@vueuse/core";
import { BigNumber } from "ethers";
import { storeToRefs } from "pinia";

import TokenAmount from "@/components/transaction/lineItem/TokenAmount.vue";

import useNetworks from "@/composables/useNetworks";

import type { NetworkLayer, Transaction } from "@/utils/mappers";
import type { PropType } from "vue";

import { useOnboardStore } from "@/store/onboard";
import { useZkSyncProviderStore } from "@/store/zksync/provider";
import { shortenAddress } from "@/utils/formatters";
import { ETH_ADDRESS } from "~/zksync-web3-nova/src/utils";

const props = defineProps({
transfer: {
type: Object as PropType<Transaction>,
required: true,
},
});

const isModalOpen = ref(false);

const { primaryNetwork, zkSyncNetworks } = useNetworks();
const getNetworkInfo = () => {
const newNetwork = zkSyncNetworks.find(
(item) => item.l1Gateway && item.l1Gateway.toLowerCase() === props.transfer.gateway?.toLowerCase()
);
return newNetwork ?? primaryNetwork;
};
const { account } = storeToRefs(useOnboardStore());
const eraNetwork = getNetworkInfo();

const formatAddress = (address: string) => {
if (address === account.value.address) {
return "your account";
}
return shortenAddress(address);
};

const chainsLabel = computed(() => {
const { networkKey } = props.transfer;
if (networkKey === "ethereum" && process.env.NODE_TYPE === "nexus-sepolia") {
// special handle for be
return "Sepolia";
} else {
const network = zkSyncNetworks.find((item) => item.key === networkKey);
return network?.l1Network?.name;
}
});

const expectedCompleteTimestamp = computed(() => {
console.log("transer: ", props.transfer);
return new Date(new Date(props.transfer.receivedAt).getTime() + 14 * 24 * 3600 * 1000).toISOString();
});
const computeAmount = computed(() => {
return BigNumber.from(props.transfer.token.amount || "0").toString();
});
const token = computed(() => {
return props.transfer.token;
});

const timeAgo = useTimeAgo(props.transfer.receivedAt);
</script>

<style lang="scss" scoped>
.transaction-withdrawal-line-item {
@apply flex items-center gap-4;

.line-button-with-img-image {
@apply mt-[1.5px] aspect-square h-auto w-9 flex-none self-start;
}

.withdrawal-line-body {
@apply w-full;

.withdrawal-line-separator {
@apply my-4 w-full border-t border-neutral-200 dark:border-neutral-800;
}

.withdrawal-line-top {
@apply flex w-full items-center gap-4;

.line-button-with-img-body {
@apply w-full overflow-hidden;
}

.line-button-with-img-right {
@apply w-max;
}
}

.withdrawal-line-bottom {
@apply flex flex-col items-center justify-between gap-4 xs:flex-row;

.withdrawal-claim-button {
@apply w-full whitespace-nowrap xs:w-auto;
}
}
}
}
</style>
5 changes: 4 additions & 1 deletion components/transaction/TransferWithdrawalLineItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ const { primaryNetwork, zkSyncNetworks,getNetworkInfo } = useNetworks();
const { account } = storeToRefs(useOnboardStore());
const eraNetwork = getNetworkInfo(props.transfer);
const label = computed(() => {
const article = "Withdraw";
if(props.transfer.status === 'failed') {
return 'Failed Deposit'
}
const article = 'Withdraw';
if (props.transfer.to === account.value.address) {
return article;
}
Expand Down
2 changes: 1 addition & 1 deletion composables/transaction/useMergeToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type SourceTokenInfo = {
balance: bigint;
depositLimit: bigint;
};
const NOVA_CHAIN_ID = nodeType === "nexus" ? 810180 : 810182;
const NOVA_CHAIN_ID = nodeType === "nexus" ? 810180 : 810181;
const MERGE_TOKEN_PORTAL_ADDRESSES =
nodeType === "nexus" ? "0x83FD59FD58C6A5E6eA449e5400D02803875e1104" : "0x83FD59FD58C6A5E6eA449e5400D02803875e1104";
export default (tokenL2Address: Ref<string | undefined>) => {
Expand Down
Loading
Loading