Skip to content

Commit 6261d41

Browse files
committed
Merge branch 'main' into feat/keystone-bk
2 parents 4cdf388 + c2c5aba commit 6261d41

File tree

44 files changed

+1227
-374
lines changed

Some content is hidden

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

44 files changed

+1227
-374
lines changed

apps/legacy/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
"typecheck": "yarn tsc --skipLibCheck --noEmit"
1616
},
1717
"dependencies": {
18-
"@avalabs/avalanche-module": "1.9.0",
18+
"@avalabs/avalanche-module": "1.9.4",
1919
"@avalabs/avalanchejs": "4.2.0-alpha.1",
20-
"@avalabs/bitcoin-module": "1.9.0",
21-
"@avalabs/bridge-unified": "4.0.2",
20+
"@avalabs/bitcoin-module": "1.9.4",
21+
"@avalabs/bridge-unified": "4.0.3",
2222
"@avalabs/core-bridge-sdk": "3.1.0-alpha.51",
2323
"@avalabs/core-chains-sdk": "3.1.0-alpha.51",
2424
"@avalabs/core-coingecko-sdk": "3.1.0-alpha.51",
@@ -30,13 +30,13 @@
3030
"@avalabs/core-token-prices-sdk": "3.1.0-alpha.51",
3131
"@avalabs/core-utils-sdk": "3.1.0-alpha.51",
3232
"@avalabs/core-wallets-sdk": "3.1.0-alpha.51",
33-
"@avalabs/evm-module": "1.9.0",
33+
"@avalabs/evm-module": "1.9.4",
3434
"@avalabs/glacier-sdk": "3.1.0-alpha.51",
35-
"@avalabs/hvm-module": "1.9.0",
35+
"@avalabs/hvm-module": "1.9.4",
3636
"@avalabs/hw-app-avalanche": "0.14.1",
37-
"@avalabs/svm-module": "1.9.0",
37+
"@avalabs/svm-module": "1.9.4",
3838
"@avalabs/types": "3.1.0-alpha.51",
39-
"@avalabs/vm-module-types": "1.9.0",
39+
"@avalabs/vm-module-types": "1.9.4",
4040
"@blockaid/client": "0.10.0",
4141
"@coinbase/cbpay-js": "1.6.0",
4242
"@core/common": "workspace:*",

apps/next/manifest/manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"activeTab",
4242
"contextMenus",
4343
"notifications",
44-
"tabs",
4544
"scripting",
4645
"identity",
4746
"alarms",

apps/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"typecheck": "yarn tsc --skipLibCheck --noEmit"
1717
},
1818
"dependencies": {
19-
"@avalabs/k2-alpine": "1.199.0",
19+
"@avalabs/k2-alpine": "1.204.3-alpha.0",
2020
"@avalabs/types": "3.1.0-alpha.51",
2121
"@core/common": "workspace:*",
2222
"@core/messaging": "workspace:*",

apps/next/src/components/OnboardingModal/FullscreenModal.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ export const FullscreenModal = styled(Dialog)(({ theme }) => ({
77
maxWidth: '600px',
88
height: '80vh',
99
maxHeight: '720px',
10-
// @ts-expect-error - Broken Theme type in @avalabs/k2-alpine
1110
borderRadius: theme.shape.largeBorderRadius,
12-
// @ts-expect-error - Broken Theme type in @avalabs/k2-alpine
1311
backgroundColor: theme.palette.surface.secondary,
1412
borderStyle: 'solid',
1513
borderWidth: 1,

apps/next/src/components/PersonalAvatar/PersonalAvatar.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,7 @@ export const PersonalAvatar = ({
9090
)}
9191
{...props}
9292
>
93-
<AvatarHex
94-
alt={alt}
95-
size={size}
96-
src={src}
97-
// @ts-expect-error - Missing property in @avalabs/k2-alpine
98-
selected={selected}
99-
/>
93+
<AvatarHex alt={alt} size={size} src={src} selected={selected} />
10094
</Box>
10195
);
10296
};

apps/next/src/components/StandaloneField/StandaloneField.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export const StandaloneField = styled((props: StandaloneFieldProps) => (
3737
backgroundColor: getHexAlpha(theme.palette.primary.main, 30),
3838
},
3939
'&:focus-within': {
40-
// @ts-expect-error - Broken Theme type in @avalabs/k2-alpine
4140
color: theme.palette.neutral['850'],
4241
backgroundColor: theme.palette.common.white,
4342
boxShadow: `${alpha(theme.palette.common.black, 0.25)} 0 5px 15px 0`,

apps/next/src/components/Typography.tsx

Lines changed: 0 additions & 59 deletions
This file was deleted.

apps/next/src/localization/locales/en/translation.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"A few more details are needed before getting any further with your wallet creation": "A few more details are needed before getting any further with your wallet creation",
55
"Access an existing wallet with your recovery phrase. You can paste your entire phrase in the first field, or use the tab key to jump to the next field": "Access an existing wallet with your recovery phrase. You can paste your entire phrase in the first field, or use the tab key to jump to the next field",
66
"Access existing wallet": "Access existing wallet",
7+
"Account Id is not provided": "Account Id is not provided",
8+
"Account deleted": "Account deleted",
9+
"Account not found": "Account not found",
710
"Action was not approved. Please try again.": "Action was not approved. Please try again.",
811
"Add or connect a wallet": "Add or connect a wallet",
912
"Add using Keystone": "Add using Keystone",
@@ -34,13 +37,15 @@
3437
"Continue with Apple": "Continue with Apple",
3538
"Continue with Google": "Continue with Google",
3639
"Copied!": "Copied!",
40+
"Copy": "Copy",
3741
"Copy phrase": "Copy phrase",
3842
"Core has entered an unexpected state. Please restart the browser if the issue persists.": "Core has entered an unexpected state. Please restart the browser if the issue persists.",
3943
"Core is committed to protecting your privacy. We will never sell or share your data. If you wish, you can disable this at any time in the settings menu.": "Core is committed to protecting your privacy. We will never sell or share your data. If you wish, you can disable this at any time in the settings menu.",
4044
"Could not swap {{srcAmount}} {{srcToken}} to {{destAmount}} {{destToken}}": "Could not swap {{srcAmount}} {{srcToken}} to {{destAmount}} {{destToken}}",
4145
"Currently using {{name}}": "Currently using {{name}}",
4246
"Deposit": "Deposit",
4347
"Disconnected": "Disconnected",
48+
"Dismiss": "Dismiss",
4449
"Email address": "Email address",
4550
"English": "English",
4651
"Enjoy your wallet": "Enjoy your wallet",
@@ -65,6 +70,7 @@
6570
"How would you like to access your existing wallet?": "How would you like to access your existing wallet?",
6671
"I have read and agree to the <termLink>Terms of Use</termLink>": "I have read and agree to the <termLink>Terms of Use</termLink>",
6772
"Import Recovery Phrase": "Import Recovery Phrase",
73+
"Imported": "Imported",
6874
"Imported Accounts": "Imported Accounts",
6975
"Insufficient balance": "Insufficient balance",
7076
"Insufficient balance.": "Insufficient balance.",
@@ -106,6 +112,7 @@
106112
"Only keystore files exported from the Avalanche Wallet are supported.": "Only keystore files exported from the Avalanche Wallet are supported.",
107113
"Oops! It seems like you have no internet connection. Please try again later.": "Oops! It seems like you have no internet connection. Please try again later.",
108114
"Open wallet": "Open wallet",
115+
"Options": "Options",
109116
"Our team was made aware of this issue. Feel free to contact us for further information.": "Our team was made aware of this issue. Feel free to contact us for further information.",
110117
"Password must be at least 8 characters": "Password must be at least 8 characters",
111118
"Passwords do not match": "Passwords do not match",
@@ -121,12 +128,17 @@
121128
"Please try switching to a different network.": "Please try switching to a different network.",
122129
"Pricing provider did not respond with a valid transaction.": "Pricing provider did not respond with a valid transaction.",
123130
"Public key not found": "Public key not found",
131+
"Recovery Phrase": "Recovery Phrase",
124132
"Recovery Phrase {{number}}": "Recovery Phrase {{number}}",
133+
"Refresh": "Refresh",
134+
"Remove account": "Remove account",
135+
"Rename": "Rename",
125136
"Request timed out": "Request timed out",
126137
"Requested derivation path is too short": "Requested derivation path is too short",
127138
"Resource unavailable": "Resource unavailable",
128139
"Rewards": "Rewards",
129140
"Russian": "Russian",
141+
"Seedless": "Seedless",
130142
"Seedless login error": "Seedless login error",
131143
"Seedless {{number}}": "Seedless {{number}}",
132144
"Select the first word": "Select the first word",
@@ -136,6 +148,7 @@
136148
"Select your personal avatar": "Select your personal avatar",
137149
"Sending this type of token is not supported by Core": "Sending this type of token is not supported by Core",
138150
"Show password": "Show password",
151+
"Show private key": "Show private key",
139152
"Slippage tolerance exceeded, increase the slippage and try again.": "Slippage tolerance exceeded, increase the slippage and try again.",
140153
"Some of the required parameters are invalid.": "Some of the required parameters are invalid.",
141154
"Some of the required parameters are missing.": "Some of the required parameters are missing.",
@@ -179,12 +192,14 @@
179192
"Try swapping a different token or try again later.": "Try swapping a different token or try again later.",
180193
"Try swapping a different token.": "Try swapping a different token.",
181194
"Turkish": "Turkish",
195+
"Type": "Type",
182196
"Unable to estimate gas": "Unable to estimate gas",
183197
"Unable to load balances": "Unable to load balances",
184198
"Unable to set TOTP configuration": "Unable to set TOTP configuration",
185199
"Unable to sign or broadcast transaction": "Unable to sign or broadcast transaction",
186200
"Unauthorized": "Unauthorized",
187201
"Unexpected response from our pricing provider.": "Unexpected response from our pricing provider.",
202+
"Unknown": "Unknown",
188203
"Unknown error": "Unknown error",
189204
"Unknown error occurred, ": "Unknown error occurred, ",
190205
"Unknown network": "Unknown network",
@@ -204,6 +219,7 @@
204219
"Vesting": "Vesting",
205220
"View P-Chain Details": "View P-Chain Details",
206221
"View in Explorer": "View in Explorer",
222+
"Wallet": "Wallet",
207223
"Wallet name": "Wallet name",
208224
"Wallet secrets not found for the requested ID": "Wallet secrets not found for the requested ID",
209225
"We were not able to verify this code. Please try again.": "We were not able to verify this code. Please try again.",
@@ -213,6 +229,7 @@
213229
"You do not have enough funds to cover the network fees.": "You do not have enough funds to cover the network fees.",
214230
"You will be prompted {{remaining}} more time(s).": "You will be prompted {{remaining}} more time(s).",
215231
"You're about to terminate this session": "You're about to terminate this session",
232+
"Your account's private key is a fixed password for accessing the\n specific addresses above. Keep it secure, anyone with this private key\n can access the account associated with it.": "Your account's private key is a fixed password for accessing the\n specific addresses above. Keep it secure, anyone with this private key\n can access the account associated with it.",
216233
"paraswap error message while get rate: {{message}}": "paraswap error message while get rate: {{message}}",
217234
"your avatar": "your avatar",
218235
"{{length}}-word phrase": "{{length}}-word phrase"

apps/next/src/pages/AccountManagement/AccountManagement.tsx

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,14 @@ import {
55
DialogTitle,
66
IconButton,
77
Slide,
8-
Stack,
9-
styled,
108
} from '@avalabs/k2-alpine';
119
import { BalancesProvider, WalletTotalBalanceProvider } from '@core/ui';
1210
import { FC } from 'react';
1311
import { MdArrowBack } from 'react-icons/md';
14-
import { useHistory } from 'react-router-dom';
15-
import AddOrConnectWalletButton from './components/AddOrConnectWalletButton';
16-
import CurrentAccount from './components/CurrentAccount';
12+
import { Route, Switch, useHistory } from 'react-router-dom';
1713
import { Wallets } from './components/Wallets';
18-
19-
const PaddedEndStack = styled(Stack)(({ theme }) => ({
20-
gap: theme.spacing(1.5),
21-
'&:after': {
22-
content: '""',
23-
height: theme.spacing(4),
24-
},
25-
}));
14+
import { AccountDetails } from './components/AccountDetails';
15+
import { QRCode } from './components/QRCode';
2616

2717
const dialogSlots: Pick<DialogProps, 'slots' | 'slotProps'> = {
2818
slots: {
@@ -51,11 +41,14 @@ const AccountManagement: FC = () => {
5141
</IconButton>
5242
</DialogTitle>
5343
<DialogContent sx={{ paddingInline: 1.5 }}>
54-
<PaddedEndStack>
55-
<CurrentAccount />
56-
<Wallets />
57-
<AddOrConnectWalletButton />
58-
</PaddedEndStack>
44+
<Switch>
45+
<Route path="/account-management/qr-code" component={QRCode} />
46+
<Route
47+
path="/account-management/account"
48+
component={AccountDetails}
49+
/>
50+
<Route path="/account-management" component={Wallets} />
51+
</Switch>
5952
</DialogContent>
6053
</Dialog>
6154
</WalletTotalBalanceProvider>
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import {
2+
LinearProgress,
3+
styled,
4+
Stack,
5+
toast,
6+
ToastOptions,
7+
Typography,
8+
} from '@avalabs/k2-alpine';
9+
import { SecretType } from '@core/types';
10+
import { useAccountsContext, useWalletContext } from '@core/ui';
11+
import { FC } from 'react';
12+
import { useTranslation } from 'react-i18next';
13+
import { Redirect, useHistory, useLocation } from 'react-router-dom';
14+
import { ActionButtons } from './components/ActionButtons';
15+
import { AddressesCard } from './components/AddressesCard';
16+
import { AccountDetailsHeader } from './components/Header';
17+
import { MoreDetailsCard } from './components/MoreDetailsCard';
18+
19+
const toastOptions: ToastOptions = {
20+
id: 'account-details-guard',
21+
};
22+
23+
const Scroller = styled('div')({
24+
overflow: 'auto',
25+
});
26+
27+
export const AccountDetails: FC = () => {
28+
const { t } = useTranslation();
29+
const history = useHistory();
30+
const { search } = useLocation();
31+
const searchParams = new URLSearchParams(search);
32+
const accountId = searchParams.get('accountId');
33+
34+
const { getWallet, wallets } = useWalletContext();
35+
const { getAccountById, renameAccount, deleteAccounts } =
36+
useAccountsContext();
37+
38+
if (!accountId) {
39+
toast.error(t('Account Id is not provided'), toastOptions);
40+
return <Redirect to="/account-management" />;
41+
}
42+
43+
const account = getAccountById(accountId);
44+
45+
if (!account) {
46+
toast.error(t('Account not found'), toastOptions);
47+
return <Redirect to="/account-management" />;
48+
}
49+
50+
const isPrimaryAccount = account.type === 'primary';
51+
52+
if (isPrimaryAccount && wallets.length === 0) {
53+
return <LinearProgress />;
54+
}
55+
56+
const wallet = isPrimaryAccount ? getWallet(account.walletId) : undefined;
57+
58+
return (
59+
<Stack height={1} gap={2}>
60+
<AccountDetailsHeader account={account} />
61+
<Scroller>
62+
<Stack direction="column" gap={1.5}>
63+
<AddressesCard account={account} />
64+
<MoreDetailsCard
65+
walletName={wallet?.name ?? t('Imported Accounts')}
66+
walletType={wallet?.type ?? SecretType.PrivateKey}
67+
/>
68+
</Stack>
69+
</Scroller>
70+
<Typography variant="caption" px={1.5} mt={-1} color="text.secondary">
71+
{t(`Your account's private key is a fixed password for accessing the
72+
specific addresses above. Keep it secure, anyone with this private key
73+
can access the account associated with it.`)}
74+
</Typography>
75+
<ActionButtons
76+
onRename={() => {
77+
// TODO: Implement rename account screen
78+
const newName = prompt('Enter new account name');
79+
if (newName) {
80+
renameAccount(account.id, newName);
81+
}
82+
}}
83+
onRemove={async () => {
84+
// TODO: Implement proper delete account dialog
85+
const confirmed = confirm(
86+
'Are you sure you want to delete this account?',
87+
);
88+
if (confirmed) {
89+
deleteAccounts([account.id]).then(() => {
90+
history.push('/account-management');
91+
toast.success(t('Account deleted'), toastOptions);
92+
});
93+
}
94+
}}
95+
/>
96+
</Stack>
97+
);
98+
};

0 commit comments

Comments
 (0)