Skip to content

Commit 99dbbb9

Browse files
committed
update text
1 parent 8946f4a commit 99dbbb9

13 files changed

Lines changed: 108 additions & 83 deletions

File tree

build/_raw/js/remove_console.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
var fn = function () {
22
// do nothing
33
};
4-
// window.console = {
5-
// log: fn,
6-
// dir: fn,
7-
// error: fn
8-
// };
4+
window.console = {
5+
log: fn,
6+
dir: fn,
7+
error: fn
8+
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "side-wallet",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"private": true,
55
"scripts": {
66
"clean": "mkdir -p dist && rm -rf dist/* && cp -r build/_raw/* dist",

src/background/controller/wallet.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ export class WalletController extends BaseController {
436436
ADDRESS_TYPES.filter((v) => v.displayIndex >= 0).forEach((v) => {
437437
let pubkey = pathPubkey[v.hdPath];
438438
if (!pubkey && _keyring.getAccountByHdPath) {
439-
console.log(1111);
440439
pubkey = _keyring.getAccountByHdPath(v.hdPath, index);
441440
}
442441
const address = publicKeyToAddress(pubkey, v.value, networkType);

src/ui/hooks/lending/useCreateLoan.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import { useState } from 'react';
22
import toast from 'react-hot-toast';
33

44
import { sideLendingMessageComposer } from '@/codegen/src';
5+
import { NetworkType } from '@/shared/types';
56
import ToastView from '@/ui/components/ToastView';
67
import { useNavigate } from '@/ui/pages/MainRoute';
78
import services from '@/ui/services';
89
import { GetTxByHashResponse } from '@/ui/services/tx/types';
910
import { useCurrentAccount } from '@/ui/state/accounts/hooks';
1011
import { useEnvironment } from '@/ui/state/environment/hooks';
12+
import { useNetworkType } from '@/ui/state/settings/hooks';
1113
import { useSignAndBroadcastTxRaw } from '@/ui/state/transactions/hooks/cosmos';
1214
import { toXOnly } from '@/ui/wallet-sdk/utils';
1315
import { Coin } from '@cosmjs/amino';
@@ -16,6 +18,7 @@ import { Box } from '@mui/material';
1618

1719
export function useCreateLoan() {
1820
const { sideChain, SERVICE_BASE_URL } = useEnvironment();
21+
const networkType = useNetworkType();
1922

2023
const [loading, setLoading] = useState(false);
2124

@@ -27,6 +30,8 @@ export function useCreateLoan() {
2730

2831
const navigate = useNavigate();
2932

33+
const referralCode = networkType === NetworkType.TESTNET ? 'SIDE1234' : '';
34+
3035
const createLoan = async ({
3136
borrowAmount,
3237
maturityTime,
@@ -53,7 +58,7 @@ export function useCreateLoan() {
5358
borrowerPubkey: toXOnly(Buffer.from(fromHex(currentAccount.pubkey))).toString('hex'),
5459
maturity: BigInt(maturityTime),
5560
poolId: poolId,
56-
referralCode: '',
61+
referralCode,
5762
borrowerAuthPubkey: toXOnly(Buffer.from(fromHex(currentAccount.pubkey))).toString('hex')
5863
});
5964
const result = await signAndBroadcastTxRaw({
@@ -145,6 +150,7 @@ export function useCreateLoan() {
145150
createLoan,
146151
loading,
147152
visible,
148-
setVisible
153+
setVisible,
154+
referralCode
149155
};
150156
}

src/ui/hooks/useSend.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function useSend() {
6262
});
6363
}
6464

65-
const handleSubmit = async (successText?: string) => {
65+
const handleSubmit = async (options?: { text?: string; title?: string }) => {
6666
try {
6767
if (!curToken) {
6868
throw new Error('Token not found');
@@ -88,7 +88,12 @@ export function useSend() {
8888
feeDenom: feeDenom,
8989
memo
9090
});
91-
navigate('TxSuccessScreen', { txid: result.tx_response.txhash, chain: CHAINS_ENUM.SIDE, text: successText });
91+
navigate('TxSuccessScreen', {
92+
txid: result.tx_response.txhash,
93+
chain: CHAINS_ENUM.SIDE,
94+
text: options?.text,
95+
title: options?.title
96+
});
9297
} catch (err) {
9398
const errorString = err instanceof Error ? err.message : typeof err == 'string' ? err : '';
9499

src/ui/pages/Account/CreateHDWalletScreen/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { useLocation } from 'react-router-dom';
33

44
import { AddressType, RestoreWalletType } from '@/shared/types';
55
import { Column, Header, Layout, StepBar } from '@/ui/components';
6-
import { useExtensionIsInTab } from '@/ui/features/browser/tabs';
76

87
import { useNavigate } from '../../MainRoute';
98
import Step1_Create from './Step1_Create';
@@ -14,7 +13,6 @@ import { ContextData, TabType, UpdateContextDataParams, WordsType } from './type
1413

1514
export default function CreateHDWalletScreen() {
1615
const navigate = useNavigate();
17-
const isInTab = useExtensionIsInTab();
1816

1917
const { state } = useLocation();
2018
const { isImport, fromUnlock } = state as {
@@ -26,7 +24,7 @@ export default function CreateHDWalletScreen() {
2624
mnemonics: '',
2725
hdPath: '',
2826
passphrase: '',
29-
addressType: AddressType.P2WPKH,
27+
addressType: AddressType.P2TR,
3028
step1Completed: false,
3129
tabType: TabType.STEP1,
3230
restoreWalletType: RestoreWalletType.UNISAT,

src/ui/pages/Lending/EarnTabScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ export default function EarnTabScreen() {
346346
}}
347347
onClick={(event) => {
348348
event.stopPropagation();
349-
window.open(`${SIDE_STATION_URL}/lendingPool/${item.baseData.id}`, '_blank');
349+
window.open(`${SIDE_STATION_URL}/markets/pool/${item.baseData.id}`, '_blank');
350350
}}>
351351
Details
352352
</Typography>

src/ui/pages/Lending/LendingTabScreen.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,12 @@ export default function LendingTanScreen() {
135135
[borrowAmount, collateralAmount, dlcPrice]
136136
);
137137

138+
const { loading, createLoan, referralCode } = useCreateLoan();
139+
138140
const data = [
139141
{
140142
label: 'Referral Code',
141-
value: '-',
143+
value: referralCode,
142144
tips: ''
143145
},
144146
{
@@ -306,8 +308,6 @@ export default function LendingTanScreen() {
306308
}
307309
];
308310

309-
const { loading, createLoan } = useCreateLoan();
310-
311311
const [isChecked, setIsChecked] = useState(false);
312312
const [isHoverMaturity, setIsHoverMaturity] = useState(false);
313313

@@ -343,7 +343,7 @@ export default function LendingTanScreen() {
343343
)}`;
344344
} else if (+(requestFeeToken?.amount || '0') < +(poolData?.baseData.config.request_fee.amount || '0')) {
345345
isDisabled = true;
346-
buttonText = 'No enough balance';
346+
buttonText = 'Insufficient SIDE Balance';
347347
}
348348
return {
349349
isDisabled,

src/ui/pages/Lending/LoanClaimScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default function LoanClaimScreen() {
8282
return (
8383
<Layout>
8484
<Header
85-
title="Claim BTC"
85+
title="Claim & Cancel"
8686
onBack={() => {
8787
window.history.go(-1);
8888
}}

src/ui/pages/Main/RegisterEvmAddress.tsx

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ import BigNumber from 'bignumber.js';
22
import { ethers } from 'ethers';
33
import { useEffect, useMemo } from 'react';
44

5-
import { Button, Column, Content, Footer, Header, Icon, Input, Layout, Row, Text } from '@/ui/components';
5+
import { Button, Column, Content, Footer, Header, Icon, Input, Layout, LightTooltip, Row, Text } from '@/ui/components';
66
import ImageIcon from '@/ui/components/ImageIcon';
77
import { useSend } from '@/ui/hooks/useSend';
8-
import { useCurrentAccount } from '@/ui/state/accounts/hooks';
98
import { useEnvironment } from '@/ui/state/environment/hooks';
109
import { useResetUiTxCreateScreen, useUpdateUiTxCreateSendSideScreen } from '@/ui/state/ui/hooks';
10+
import { colors } from '@/ui/theme/colors';
1111
import { isValidAddress } from '@/ui/utils';
12+
import { Stack, Typography } from '@mui/material';
1213

1314
export default function RegisterEvmAddress() {
14-
const currentAccount = useCurrentAccount();
1515
const setUiState = useUpdateUiTxCreateSendSideScreen();
1616
const reset = useResetUiTxCreateScreen();
17-
const { EVM_COLLECTOR } = useEnvironment();
17+
const { EVM_COLLECTOR, sideChain } = useEnvironment();
1818

1919
useEffect(() => {
2020
setUiState({ base: 'uside', toInfo: { address: EVM_COLLECTOR, domain: '' } });
@@ -62,16 +62,48 @@ export default function RegisterEvmAddress() {
6262
borderRadius: '10px',
6363
padding: '16px'
6464
}}>
65-
<Text text="Burn Address" color="white" size="xs" />
66-
<Text
67-
text={currentAccount.address}
68-
color="white"
69-
size="sm"
70-
style={{
71-
fontWeight: 500,
72-
overflowWrap: 'break-word'
65+
<Stack direction="row">
66+
<LightTooltip
67+
title={
68+
'Any SIDE sent to this address will be reserved for future token burns and cannot be recovered. This is a permanent and irreversible action. '
69+
}
70+
arrow
71+
placement="top">
72+
<Typography
73+
sx={{
74+
fontSize: '12px',
75+
color: colors.grey12,
76+
textDecoration: 'dotted underline',
77+
textUnderlineOffset: '2px',
78+
cursor: 'pointer',
79+
transition: '.4s',
80+
':hover': {
81+
color: colors.white
82+
}
83+
}}>
84+
Burn Address
85+
</Typography>
86+
</LightTooltip>
87+
</Stack>
88+
<Typography
89+
sx={{
90+
fontSize: '12px',
91+
fontWeight: 400,
92+
color: colors.white,
93+
overflowWrap: 'break-word',
94+
textDecoration: 'dotted underline',
95+
textUnderlineOffset: '2px',
96+
cursor: 'pointer',
97+
transition: '.4s',
98+
':hover': {
99+
color: colors.main
100+
}
73101
}}
74-
/>
102+
onClick={() => {
103+
window.open(`${sideChain.explorerUrl}/address/${toInfo.address}`, '_blank');
104+
}}>
105+
{toInfo.address}
106+
</Typography>
75107
</Column>
76108

77109
<Row
@@ -152,10 +184,13 @@ export default function RegisterEvmAddress() {
152184
<Footer px="zero" py="zero">
153185
<Button
154186
preset="primary"
155-
text={+inputAmount > +available ? 'Insufficient Balance' : 'Next'}
187+
text={+inputAmount > +available ? 'Insufficient Balance' : 'Confirm'}
156188
disabled={disabled}
157189
onClick={() => {
158-
handleSubmit('Please follow us on X and stay tuned for further announcements regarding the TGE.');
190+
handleSubmit({
191+
text: 'Please follow us on X and stay tuned for further announcements regarding the TGE.',
192+
title: 'Registration completed!'
193+
});
159194
}}
160195
/>
161196
</Footer>

0 commit comments

Comments
 (0)