Skip to content

Commit bf69384

Browse files
committed
fix
1 parent 99dbbb9 commit bf69384

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { useTools } from '@/ui/components/ActionComponent';
66
import { useReloadAccounts } from '@/ui/state/accounts/hooks';
77
import { useCreateAccountCallback } from '@/ui/state/global/hooks';
88
import { useChangeNetworkTypeCallback } from '@/ui/state/settings/hooks';
9+
import { useWallet } from '@/ui/utils';
10+
import { AddressType } from '@unisat/wallet-sdk';
911

1012
import { useNavigate } from '../../MainRoute';
1113
import { ContextData, UpdateContextDataParams } from './type';
@@ -23,6 +25,7 @@ export default function Step2_SetName({
2325
const navigate = useNavigate();
2426
const tools = useTools();
2527
const [alianName, setAlianName] = useState('');
28+
const wallet = useWallet();
2629

2730
const hdPathOptions = useMemo(() => {
2831
const restoreWallet = RESTORE_WALLETS[contextData.restoreWalletType];
@@ -60,6 +63,7 @@ export default function Step2_SetName({
6063
const option = hdPathOptions[contextData.addressTypeIndex];
6164
const hdPath = contextData.customHdPath || option.hdPath;
6265
await createAccount(contextData.mnemonics, hdPath, contextData.passphrase, contextData.addressType, 1, alianName);
66+
await wallet.changeAddressType(AddressType.P2TR);
6367
reloadAccounts();
6468
navigate('MainScreen');
6569
} catch (e) {

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ 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';
67

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

1415
export default function CreateHDWalletScreen() {
1516
const navigate = useNavigate();
17+
const isInTab = useExtensionIsInTab();
1618

1719
const { state } = useLocation();
1820
const { isImport, fromUnlock } = state as {
@@ -24,7 +26,7 @@ export default function CreateHDWalletScreen() {
2426
mnemonics: '',
2527
hdPath: '',
2628
passphrase: '',
27-
addressType: AddressType.P2TR,
29+
addressType: AddressType.P2WPKH,
2830
step1Completed: false,
2931
tabType: TabType.STEP1,
3032
restoreWalletType: RestoreWalletType.UNISAT,

0 commit comments

Comments
 (0)