Skip to content

Commit 4667bc9

Browse files
committed
fixes5
1 parent 6d2df71 commit 4667bc9

File tree

48 files changed

+585
-169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+585
-169
lines changed

configs/envs/.env.pw

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ NEXT_PUBLIC_REWARDS_SERVICE_API_HOST=http://localhost:3009
5555
NEXT_PUBLIC_MULTICHAIN_AGGREGATOR_API_HOST=http://localhost:3010
5656
NEXT_PUBLIC_TAC_OPERATION_LIFECYCLE_API_HOST=http://localhost:3100
5757
NEXT_PUBLIC_USER_OPS_INDEXER_API_HOST=http://localhost:3110
58+
NEXT_PUBLIC_ZETACHAIN_SERVICE_API_HOST=http://localhost:3111
5859
NEXT_PUBLIC_RE_CAPTCHA_APP_SITE_KEY=xxx
5960
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=xxx
6061
NEXT_PUBLIC_VIEWS_ADDRESS_FORMAT=['base16','bech32']

deploy/tools/envs-validator/schema.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,8 @@ const zetaChainCCTXConfigSchema: yup.ObjectSchema<ChainInfo> = yup.object({
668668
chain_name: yup.string().required(),
669669
chain_logo: yup.string(),
670670
instance_url: yup.string(),
671+
address_url_template: yup.string(),
672+
tx_url_template: yup.string(),
671673
});
672674

673675
const zetaChainSchema = yup

mocks/zetaChain/zetaChainCCTX.ts

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,170 @@ export const zetaChainCCTX: ZetaChainCCTXResponse = {
102102
},
103103
],
104104
};
105+
106+
export const zetaChainCCTXFailed: ZetaChainCCTXResponse = {
107+
creator: 'zeta18pksjzclks34qkqyaahf2rakss80mnusju77cm',
108+
index: '0x004d60b58cbbead6ddc0a100e17b88484f72e4f47b10c4b560a41cadd3315c4c',
109+
zeta_fees: '0',
110+
// eslint-disable-next-line max-len
111+
relayed_message: '00000000000000000000000000000000000000000000000000000000000000400000000000000000000000006b513b40ebc0b4d7b197730476ed3324346f28220000000000000000000000000000000000000000000000000000000000000014dcbfa87533a478743b3f507e76170ea6f26fa69a000000000000000000000000',
112+
cctx_status_reduced: 'FAILED',
113+
token_symbol: 'UPKRW.SEPOLIA',
114+
token_name: 'ZetaChain ZRC20 UPKRW on Sepolia',
115+
zrc20_contract_address: '0xA614Aebf7924A3Eb4D066aDCA5595E4980407f1d',
116+
icon_url: null,
117+
decimals: 6,
118+
cctx_status: {
119+
status: 'REVERTED',
120+
status_message: '',
121+
// eslint-disable-next-line max-len
122+
error_message: '{"type":"contract_call_error","message":"contract call failed when calling EVM with data","error":"execution reverted: ret 0x: evm transaction execution failed","method":"depositAndCall0","contract":"0x6c533f7fE93fAE114d0954697069Df33C9B74fD7","args":"[{[220 191 168 117 51 164 120 116 59 63 80 126 118 23 14 166 242 111 166 154] 0xDCbFA87533A478743B3f507e76170eA6F26FA69a 43113} 0xE8d7796535F1cd63F0fe8D631E68eACe6839869B 10000000 0xDCbFA87533A478743B3f507e76170eA6F26FA69a [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 64 0 0 0 0 0 0 0 0 0 0 0 0 107 81 59 64 235 192 180 215 177 151 115 4 118 237 51 36 52 111 40 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 220 191 168 117 51 164 120 116 59 63 80 126 118 23 14 166 242 111 166 154 0 0 0 0 0 0 0 0 0 0 0 0]]"}',
123+
last_update_timestamp: '1756174106',
124+
is_abort_refunded: false,
125+
created_timestamp: '1756173994',
126+
error_message_revert: '',
127+
error_message_abort: '',
128+
status_reduced: 'FAILED',
129+
},
130+
inbound_params: {
131+
sender: '0xDCbFA87533A478743B3f507e76170eA6F26FA69a',
132+
sender_chain_id: 43113,
133+
tx_origin: '0xDCbFA87533A478743B3f507e76170eA6F26FA69a',
134+
coin_type: 'ERC20',
135+
asset: '0x6B513B40eBc0B4D7B197730476ed3324346F2822',
136+
amount: '10000000',
137+
observed_hash: '0x8ecc5913b637b2756258e8155e2b22dc5afa820698163c1627d372e187e6e65b',
138+
observed_external_height: '45237981',
139+
ballot_index: '0x004d60b58cbbead6ddc0a100e17b88484f72e4f47b10c4b560a41cadd3315c4c',
140+
finalized_zeta_height: '12324831',
141+
tx_finalization_status: 'EXECUTED',
142+
is_cross_chain_call: true,
143+
status: 'SUCCESS',
144+
confirmation_mode: 'SAFE',
145+
},
146+
outbound_params: [
147+
{
148+
receiver: '0xDCbFA87533A478743B3f507e76170eA6F26FA69a',
149+
receiver_chain_id: 7001,
150+
coin_type: 'ERC20',
151+
amount: '0',
152+
tss_nonce: '0',
153+
gas_limit: '0',
154+
gas_price: '',
155+
gas_priority_fee: '',
156+
hash: '0x3c426a57742fb55338fbb79318298cc18ca1778ba83196993548921badbe40bb',
157+
ballot_index: '',
158+
observed_external_height: '12324831',
159+
gas_used: '0',
160+
effective_gas_price: '0',
161+
effective_gas_limit: '0',
162+
tss_pubkey: 'zetapub1addwnpepq28c57cvcs0a2htsem5zxr6qnlvq9mzhmm76z3jncsnzz32rclangr2g35p',
163+
tx_finalization_status: 'EXECUTED',
164+
call_options: {
165+
gas_limit: '1500000',
166+
is_arbitrary_call: false,
167+
},
168+
confirmation_mode: 'SAFE',
169+
},
170+
{
171+
receiver: '0xDCbFA87533A478743B3f507e76170eA6F26FA69a',
172+
receiver_chain_id: 43113,
173+
coin_type: 'ERC20',
174+
amount: '9999999',
175+
tss_nonce: '842',
176+
gas_limit: '0',
177+
gas_price: '2',
178+
gas_priority_fee: '0',
179+
hash: '0xa17a2ecf87ac2527f49751d487ef20cb44de8965a6bc3817cd188705744a2041',
180+
ballot_index: '',
181+
observed_external_height: '0',
182+
gas_used: '61955',
183+
effective_gas_price: '2',
184+
effective_gas_limit: '100000',
185+
tss_pubkey: 'zetapub1addwnpepq28c57cvcs0a2htsem5zxr6qnlvq9mzhmm76z3jncsnzz32rclangr2g35p',
186+
tx_finalization_status: 'EXECUTED',
187+
call_options: {
188+
gas_limit: '21000',
189+
is_arbitrary_call: false,
190+
},
191+
confirmation_mode: 'SAFE',
192+
},
193+
],
194+
protocol_contract_version: 'V2',
195+
revert_options: {
196+
revert_address: '0x0000000000000000000000000000000000000000',
197+
call_on_revert: false,
198+
abort_address: '0x0000000000000000000000000000000000000000',
199+
revert_message: '',
200+
revert_gas_limit: '0',
201+
},
202+
related_cctxs: [
203+
{
204+
index: '0x004d60b58cbbead6ddc0a100e17b88484f72e4f47b10c4b560a41cadd3315c4c',
205+
depth: 0,
206+
source_chain_id: 43113,
207+
status: 'REVERTED',
208+
status_reduced: 'FAILED',
209+
inbound_amount: '10000000',
210+
inbound_coin_type: 'ERC20',
211+
outbound_params: [
212+
{
213+
amount: '0',
214+
chain_id: 7001,
215+
coin_type: 'ERC20',
216+
gas_used: '0',
217+
},
218+
{
219+
amount: '9999999',
220+
chain_id: 43113,
221+
coin_type: 'ERC20',
222+
gas_used: '61955',
223+
},
224+
],
225+
token_symbol: 'UPKRW.SEPOLIA',
226+
token_name: 'ZetaChain ZRC20 UPKRW on Sepolia',
227+
token_decimals: 6,
228+
token_zrc20_contract_address: '0xA614Aebf7924A3Eb4D066aDCA5595E4980407f1d',
229+
token_icon_url: null,
230+
created_timestamp: '1756173994',
231+
},
232+
],
233+
};
234+
235+
export const zetaChainCCTXPending: ZetaChainCCTXResponse = {
236+
...zetaChainCCTX,
237+
index: '0x5f5f7410d7dfefe6173cc11efa47221e85587d3831c69108121198e0b2a86661',
238+
cctx_status_reduced: 'PENDING',
239+
cctx_status: {
240+
...zetaChainCCTX.cctx_status,
241+
status: 'PENDING_INBOUND',
242+
status_message: 'Waiting for inbound confirmation',
243+
status_reduced: 'PENDING',
244+
},
245+
outbound_params: [],
246+
};
247+
248+
export const zetaChainCCTXList = {
249+
items: [
250+
zetaChainCCTXItem,
251+
{
252+
...zetaChainCCTXItem,
253+
index: '0x2d2e7410d7dfefe6173cc11efa47221e85587d3831c69108121198e0b2a86658',
254+
status: 'OUTBOUND_MINED' as const,
255+
status_reduced: 'SUCCESS' as const,
256+
amount: '500000000000000000',
257+
sender_address: '0x1234567890123456789012345678901234567890',
258+
receiver_address: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd',
259+
},
260+
{
261+
...zetaChainCCTXItem,
262+
index: '0x3f3f7410d7dfefe6173cc11efa47221e85587d3831c69108121198e0b2a86659',
263+
status: 'PENDING_INBOUND' as const,
264+
status_reduced: 'PENDING' as const,
265+
amount: '750000000000000000',
266+
sender_address: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd',
267+
receiver_address: '0x9876543210987654321098765432109876543210',
268+
},
269+
],
270+
next_page_params: { page_index: 1, offset: 50, direction: 'DESC' as const },
271+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
export const zetaChainCCTXConfig = [
2+
{
3+
chain_id: 7000,
4+
chain_name: 'ZetaChain Athens',
5+
chain_logo: 'https://example.com/zetachain-logo.svg',
6+
instance_url: 'https://zetachain-indexer.duckdns.org',
7+
},
8+
{
9+
chain_id: 7001,
10+
chain_name: 'ZetaChain Athens Testnet',
11+
chain_logo: 'https://example.com/zetachain-testnet-logo.svg',
12+
instance_url: 'https://zetachain-testnet-indexer.duckdns.org',
13+
},
14+
{
15+
chain_id: 11155111,
16+
chain_name: 'Sepolia Testnet',
17+
chain_logo: 'https://example.com/sepolia-logo.svg',
18+
instance_url: 'https://sepolia.etherscan.io',
19+
},
20+
{
21+
chain_id: 97,
22+
chain_name: 'BSC Testnet',
23+
chain_logo: 'https://example.com/bsc-testnet-logo.svg',
24+
instance_url: 'https://testnet.bscscan.com',
25+
},
26+
];

playwright/fixtures/mockEnvs.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ export const ENVS_MAP: Record<string, Array<[string, string]>> = {
116116
opSuperchain: [
117117
[ 'NEXT_PUBLIC_OP_SUPERCHAIN_ENABLED', 'true' ],
118118
],
119+
zetaChain: [
120+
[ 'NEXT_PUBLIC_ZETACHAIN_SERVICE_API_HOST', 'http://localhost:3111' ],
121+
[ 'NEXT_PUBLIC_ZETACHAIN_SERVICE_CHAINS_CONFIG_URL', 'http://localhost:3000/zeta-config.json' ],
122+
[ 'NEXT_PUBLIC_ZETACHAIN_COSMOS_TX_URL_TEMPLATE', 'https://example.com/cosmos/tx/{hash}' ],
123+
[ 'NEXT_PUBLIC_ZETACHAIN_COSMOS_ADDRESS_URL_TEMPLATE', 'https://example.com/cosmos/address/{hash}' ],
124+
],
119125
navigationPromoBannerText: [
120126
[ 'NEXT_PUBLIC_NAVIGATION_PROMO_BANNER_CONFIG', '{"img_url": "http://localhost:3000/image.svg", "text": "Try the DUCK!", "bg_color": {"light": "rgb(150, 211, 255)", "dark": "rgb(68, 51, 122)"}, "text_color": {"light": "rgb(69, 69, 69)", "dark": "rgb(233, 216, 253)"}, "link_url": "https://example.com"}' ],
121127
],

types/api/zetaChain.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export type ZetaChainCCTX = {
1414
index: string;
1515
amount: string;
1616
coin_type: ZetaChainCCTXCoinType;
17-
created_timestamp: string;
17+
created_timestamp?: string;
1818
last_update_timestamp: string;
1919
receiver_address: string;
2020
sender_address: string;
@@ -40,7 +40,7 @@ export type ZetaChainCCTXResponse = {
4040
error_message: string;
4141
last_update_timestamp: string;
4242
is_abort_refunded: boolean;
43-
created_timestamp: string;
43+
created_timestamp?: string;
4444
error_message_revert: string;
4545
error_message_abort: string;
4646
};
@@ -72,6 +72,10 @@ export type ZetaChainCCTXResponse = {
7272
related_cctxs: Array<ZetaChainRelatedCCTX>;
7373
token_symbol?: string;
7474
token_name?: string;
75+
token_decimals?: number;
76+
token_zrc20_contract_address?: string;
77+
token_icon_url?: string | null;
78+
created_timestamp?: string;
7579
zrc20_contract_address?: string;
7680
icon_url?: string | null;
7781
decimals?: number;
@@ -89,9 +93,14 @@ export type ZetaChainRelatedCCTX = {
8993
amount: string;
9094
chain_id: number;
9195
coin_type: ZetaChainCCTXCoinType;
96+
gas_used?: string;
9297
}>;
9398
token_symbol?: string;
9499
token_name?: string;
100+
token_decimals?: number;
101+
token_zrc20_contract_address?: string;
102+
token_icon_url?: string | null;
103+
created_timestamp?: string;
95104
zrc20_contract_address?: string;
96105
icon_url?: string | null;
97106
decimals?: number;
@@ -107,7 +116,7 @@ export type ZetaChainCCTXStatusReducedFilter = typeof ZETA_CHAIN_CCTX_STATUS_RED
107116

108117
export type ZetaChainCCTXCoinType = 'ZETA' | 'GAS' | 'ERC20' | 'CMD' | 'NO_ASSET_CALL';
109118

110-
export type ZetaChainCCTXFinalizationStatus = 'FINALIZED' | 'NOT_FINALIZED';
119+
export type ZetaChainCCTXFinalizationStatus = 'EXECUTED' | 'NOT_FINALIZED';
111120

112121
export type ZetaChainCCTXConfirmationMode = 'SAFE' | 'FAST';
113122

types/client/chainInfo.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ export type ChainInfo = {
55
chain_name: string | null;
66
chain_logo?: string | null;
77
instance_url?: string;
8+
address_url_template?: string;
9+
tx_url_template?: string;
810
};

ui/home/latestZetaChainCCTX/LatestZetaChainCCTXItem.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import React from 'react';
33

44
import type { ZetaChainCCTX } from 'types/api/zetaChain';
55

6-
import TxEntityZetaChainCC from 'ui/shared/entities/tx/TxEntityZetaChainCC';
6+
import AddressFromTo from 'ui/shared/address/AddressFromTo';
7+
import CCTxEntityZetaChain from 'ui/shared/entities/tx/CCTxEntityZetaChain';
78
import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
8-
import ZetaChainAddressFromTo from 'ui/shared/zetaChain/ZetaChainAddressFromTo';
99
import ZetaChainCCTXReducedStatus from 'ui/shared/zetaChain/ZetaChainCCTXReducedStatus';
1010
import ZetaChainCCTXValue from 'ui/shared/zetaChain/ZetaChainCCTXValue';
1111

@@ -18,7 +18,7 @@ type Props = {
1818
const LatestZetaChainCCTXItem = ({ tx, isLoading, animation }: Props) => {
1919
return (
2020
<Grid
21-
gridTemplateColumns="18px 120px 80px 330px auto"
21+
gridTemplateColumns="18px 120px 80px 350px auto"
2222
gridGap={ 3 }
2323
width="100%"
2424
minW="740px"
@@ -30,9 +30,15 @@ const LatestZetaChainCCTXItem = ({ tx, isLoading, animation }: Props) => {
3030
animation={ animation }
3131
>
3232
<ZetaChainCCTXReducedStatus status={ tx.status_reduced } isLoading={ isLoading }/>
33-
<TxEntityZetaChainCC hash={ tx.index } isLoading={ isLoading } truncation="constant" fontWeight={ 600 }/>
33+
<CCTxEntityZetaChain hash={ tx.index } isLoading={ isLoading } truncation="constant" fontWeight={ 600 }/>
3434
<TimeWithTooltip color="text.secondary" timestamp={ Number(tx.last_update_timestamp) * 1000 } isLoading={ isLoading } timeFormat="relative"/>
35-
<ZetaChainAddressFromTo tx={ tx } isLoading={ isLoading }/>
35+
<AddressFromTo
36+
from={{ hash: tx.sender_address }}
37+
to={{ hash: tx.receiver_address }}
38+
isLoading={ isLoading }
39+
zetaChainFromChainId={ tx.source_chain_id.toString() }
40+
zetaChainToChainId={ tx.target_chain_id.toString() }
41+
/>
3642
<ZetaChainCCTXValue
3743
coinType={ tx.coin_type }
3844
tokenSymbol={ tx.token_symbol }

ui/interopMessages/InteropMessageDestinationTx.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { ChainInfo } from 'types/api/interop';
44

55
import TxEntity from 'ui/shared/entities/tx/TxEntity';
66
import type { EntityProps } from 'ui/shared/entities/tx/TxEntity';
7-
import TxEntityInterop from 'ui/shared/entities/tx/TxEntityWithExternalChain';
7+
import TxEntityInterop from 'ui/shared/entities/tx/TxEntityInterop';
88

99
type Props = {
1010
relay_transaction_hash?: string | null;

ui/interopMessages/InteropMessageSourceTx.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { ChainInfo } from 'types/api/interop';
44

55
import type { EntityProps } from 'ui/shared/entities/tx/TxEntity';
66
import TxEntity from 'ui/shared/entities/tx/TxEntity';
7-
import TxEntityInterop from 'ui/shared/entities/tx/TxEntityWithExternalChain';
7+
import TxEntityInterop from 'ui/shared/entities/tx/TxEntityInterop';
88

99
type Props = {
1010
init_transaction_hash?: string | null;

0 commit comments

Comments
 (0)