Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions apps/legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"typecheck": "yarn tsc --skipLibCheck --noEmit"
},
"dependencies": {
"@avalabs/avalanche-module": "1.9.10",
"@avalabs/avalanche-module": "0.0.0-fix-nft-set-approval-for-all-20250829175304",
"@avalabs/avalanchejs": "5.1.0-alpha.2",
"@avalabs/bitcoin-module": "1.9.10",
"@avalabs/bitcoin-module": "0.0.0-fix-nft-set-approval-for-all-20250829175304",
"@avalabs/bridge-unified": "4.0.3",
"@avalabs/core-bridge-sdk": "3.1.0-alpha.60",
"@avalabs/core-chains-sdk": "3.1.0-alpha.60",
Expand All @@ -30,13 +30,13 @@
"@avalabs/core-token-prices-sdk": "3.1.0-alpha.60",
"@avalabs/core-utils-sdk": "3.1.0-alpha.60",
"@avalabs/core-wallets-sdk": "3.1.0-alpha.60",
"@avalabs/evm-module": "1.9.10",
"@avalabs/evm-module": "0.0.0-fix-nft-set-approval-for-all-20250829175304",
"@avalabs/glacier-sdk": "3.1.0-alpha.60",
"@avalabs/hvm-module": "1.9.10",
"@avalabs/hvm-module": "0.0.0-fix-nft-set-approval-for-all-20250829175304",
"@avalabs/hw-app-avalanche": "0.14.1",
"@avalabs/svm-module": "1.9.10",
"@avalabs/svm-module": "0.0.0-fix-nft-set-approval-for-all-20250829175304",
"@avalabs/types": "3.1.0-alpha.60",
"@avalabs/vm-module-types": "1.9.10",
"@avalabs/vm-module-types": "0.0.0-fix-nft-set-approval-for-all-20250829175304",
"@blockaid/client": "0.10.0",
"@coinbase/cbpay-js": "1.6.0",
"@core/common": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion apps/legacy/src/localization/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@
"Transaction has been cancelled": "Transaction has been cancelled",
"Transaction has been rejected": "Transaction has been rejected",
"Transaction has failed": "Transaction has failed",
"Transaction pre-exution is unavailable. The displayed token list might be incomplete.": "Transaction pre-exution is unavailable. The displayed token list might be incomplete.",
"Transaction pre-execution is unavailable. The displayed token list might be incomplete.": "Transaction pre-execution is unavailable. The displayed token list might be incomplete.",
"Transaction rejected": "Transaction rejected",
"Transaction timed out": "Transaction timed out",
"Transfer": "Transfer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const TxBalanceChange = ({
tooltip={
showNoPreExecWarning
? t(
'Transaction pre-exution is unavailable. The displayed token list might be incomplete.',
'Transaction pre-execution is unavailable. The displayed token list might be incomplete.',
)
: ''
}
Expand Down
2 changes: 1 addition & 1 deletion apps/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@avalabs/core-wallets-sdk": "3.1.0-alpha.60",
"@avalabs/k2-alpine": "1.228.0",
"@avalabs/types": "3.1.0-alpha.60",
"@avalabs/vm-module-types": "1.9.10",
"@avalabs/vm-module-types": "0.0.0-fix-nft-set-approval-for-all-20250829175304",
"@core/common": "workspace:*",
"@core/messaging": "workspace:*",
"@core/service-worker": "workspace:*",
Expand Down
5 changes: 5 additions & 0 deletions apps/next/src/config/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { TransactionPriority } from '@core/types';

export const CORE_WEB_BASE_URL =
process.env.CORE_WEB_BASE_URL ?? 'https://core.app';
export const BUG_BOUNTIES_URL =
Expand All @@ -9,3 +11,6 @@ export const CORE_FEEDBACK_URL =
'https://docs.google.com/forms/d/e/1FAIpQLSdUQiVnJoqQ1g_6XTREpkSB5vxKKK8ba5DRjhzQf1XVeET8Rw/viewform?usp=pp_url&entry.2070152111=Core%20browser%20extension&entry.903657115=${extensionVersion}&entry.1148340936=${os}';

export const DARK_THEME_SURFACE_COLOR = '#404046';

export const DEFAULT_FEE_PRESET: TransactionPriority = 'low';
export const DEFAULT_FEE_PRESET_C_CHAIN: TransactionPriority = 'high';
21 changes: 20 additions & 1 deletion apps/next/src/localization/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"All keys contained in this file are already imported.": "All keys contained in this file are already imported.",
"Allow Chrome to access your camera to scan the QR code.": "Allow Chrome to access your camera to scan the QR code.",
"Alternatively, open any authenticator app and enter this code:": "Alternatively, open any authenticator app and enter this code:",
"Amount": "Amount",
"Amount is too low": "Amount is too low",
"Amount is too small to proceed.": "Amount is too small to proceed.",
"An error occurred while computing the price.": "An error occurred while computing the price.",
Expand All @@ -47,6 +48,7 @@
"Anyone with this private key can access the account(s) associated with it": "Anyone with this private key can access the account(s) associated with it",
"Approval transaction failed": "Approval transaction failed",
"Approve": "Approve",
"Approves all {{token}}": "Approves all {{token}}",
"Approving will give this dApp access to your active account.": "Approving will give this dApp access to your active account.",
"Are you sure that you want to cancel this request?": "Are you sure that you want to cancel this request?",
"Are you sure you want to delete selected accounts?": "Are you sure you want to delete selected accounts?",
Expand All @@ -62,6 +64,7 @@
"Average password - this will do": "Average password - this will do",
"Awesome!": "Awesome!",
"Back": "Back",
"Balance change unavailable.": "Balance change unavailable.",
"Balances loading...": "Balances loading...",
"Bitcoin": "Bitcoin",
"Bridge initialization failed": "Bridge initialization failed",
Expand All @@ -75,6 +78,7 @@
"Cancel": "Cancel",
"Cancel Export": "Cancel Export",
"Cancel request": "Cancel request",
"Cancel transaction": "Cancel transaction",
"Cancellation Failed": "Cancellation Failed",
"Cancelling will require you to restart the 2 day waiting period": "Cancelling will require you to restart the 2 day waiting period",
"Cancelling...": "Cancelling...",
Expand All @@ -91,7 +95,6 @@
"Closing the settings menu will require you to restart the 2 day waiting period.": "Closing the settings menu will require you to restart the 2 day waiting period.",
"Code copied to clipboard": "Code copied to clipboard",
"Code verification error": "Code verification error",
"Coming soon!": "Coming soon!",
"Confirm": "Confirm",
"Confirm Bridge": "Confirm Bridge",
"Confirm addresses": "Confirm addresses",
Expand Down Expand Up @@ -133,6 +136,7 @@
"Dark": "Dark",
"Decide what default view works best for you, either a floating interface or a sidebar docked to the side to show more content": "Decide what default view works best for you, either a floating interface or a sidebar docked to the side to show more content",
"Decrypt Recovery Phrase": "Decrypt Recovery Phrase",
"Default": "Default",
"Delete": "Delete",
"Delete selected": "Delete selected",
"Deleting these accounts is permanent and cannot be undone": "Deleting these accounts is permanent and cannot be undone",
Expand All @@ -148,6 +152,7 @@
"Download Ledger Live to update": "Download Ledger Live to update",
"Drop your file here to upload": "Drop your file here to upload",
"Edit network fee": "Edit network fee",
"Edit spend limit": "Edit spend limit",
"Email address": "Email address",
"Enable a sandbox environment for testing without using real funds": "Enable a sandbox environment for testing without using real funds",
"English": "English",
Expand Down Expand Up @@ -196,6 +201,7 @@
"French": "French",
"Gas fees paid by Core": "Gas fees paid by Core",
"Gas limit": "Gas limit",
"Gasless funding failed": "Gasless funding failed",
"General": "General",
"Generate a new account in your active wallet": "Generate a new account in your active wallet",
"German": "German",
Expand Down Expand Up @@ -297,6 +303,7 @@
"Name this contact": "Name this contact",
"Name your Passkey": "Name your Passkey",
"Name your Yubikey": "Name your Yubikey",
"Network": "Network",
"Network error": "Network error",
"Network fee amount": "Network fee amount",
"New password": "New password",
Expand Down Expand Up @@ -364,11 +371,14 @@
"Private Key Import Failed": "Private Key Import Failed",
"Private Key Imported": "Private Key Imported",
"Private key copied!": "Private key copied!",
"Proceed anyway": "Proceed anyway",
"Proceed with caution.": "Proceed with caution.",
"Protect your data and ensure the highest level of security for your Core wallet.": "Protect your data and ensure the highest level of security for your Core wallet.",
"Public key not found": "Public key not found",
"Receive crypto": "Receive crypto",
"Recent": "Recent",
"Recents": "Recents",
"Recipient": "Recipient",
"Recovery Phrase": "Recovery Phrase",
"Recovery Phrase {{number}}": "Recovery Phrase {{number}}",
"Recovery methods": "Recovery methods",
Expand Down Expand Up @@ -423,6 +433,7 @@
"Send to": "Send to",
"Sending this token is not supported yet.": "Sending this token is not supported yet.",
"Sending this type of token is not supported by Core": "Sending this type of token is not supported by Core",
"Set a limit that you will allow to automatically spend.": "Set a limit that you will allow to automatically spend.",
"Settings": "Settings",
"Show me Trending Tokens": "Show me Trending Tokens",
"Show password": "Show password",
Expand All @@ -440,6 +451,7 @@
"Something went wrong. Please try again.": "Something went wrong. Please try again.",
"Sort": "Sort",
"Spanish": "Spanish",
"Spend limit": "Spend limit",
"Staked": "Staked",
"Stay updated on latest airdrops, events and more! You can unsubscribe anytime. For more details, see our <policyLink>Privacy Policy</policyLink>": "Stay updated on latest airdrops, events and more! You can unsubscribe anytime. For more details, see our <policyLink>Privacy Policy</policyLink>",
"Storage update failed": "Storage update failed",
Expand All @@ -456,6 +468,7 @@
"The amount cannot be lower than the bridging fee": "The amount cannot be lower than the bridging fee",
"The base fee is set by the network and changes frequently. Any difference between the set max base fee and the actual base fee will be refunded.": "The base fee is set by the network and changes frequently. Any difference between the set max base fee and the actual base fee will be refunded.",
"The bridging fee is unknown": "The bridging fee is unknown",
"The displayed token list might be incomplete.": "The displayed token list might be incomplete.",
"The export process could not be completed. Please try again.": "The export process could not be completed. Please try again.",
"The field is required": "The field is required",
"The key you entered is invalid. Please try again": "The key you entered is invalid. Please try again",
Expand All @@ -474,13 +487,15 @@
"This asset cannot be bridged": "This asset cannot be bridged",
"This email looks invalid": "This email looks invalid",
"This file requires a password. This password was set when the file was created.": "This file requires a password. This password was set when the file was created.",
"This is a placeholder screen just to allow us to reject/approve some wallet-specific interactions (i.e. chain switching).": "This is a placeholder screen just to allow us to reject/approve some wallet-specific interactions (i.e. chain switching).",
"This is taking longer than expected. Please try again later.": "This is taking longer than expected. Please try again later.",
"This key gives access to your account’s addresses": "This key gives access to your account’s addresses",
"This operation requires {{total}} approvals.": "This operation requires {{total}} approvals.",
"This phrase is your access key to your wallet.": "This phrase is your access key to your wallet.",
"This phrase is your access key to your wallet. Carefully write it down and store it in a safe location": "This phrase is your access key to your wallet. Carefully write it down and store it in a safe location",
"This recovery phrase is already imported.": "This recovery phrase is already imported.",
"This token contract is missing a required method.": "This token contract is missing a required method.",
"This transaction has been flagged as malicious. <span>I understand the risk and want to proceed anyway.</span>": "This transaction has been flagged as malicious. <span>I understand the risk and want to proceed anyway.</span>",
"This transaction would likely fail": "This transaction would likely fail",
"This wallet is already imported": "This wallet is already imported",
"This wallet is already imported.": "This wallet is already imported.",
Expand All @@ -497,6 +512,7 @@
"Transaction has been cancelled": "Transaction has been cancelled",
"Transaction has been rejected": "Transaction has been rejected",
"Transaction has failed": "Transaction has failed",
"Transaction pre-execution is unavailable.": "Transaction pre-execution is unavailable.",
"Transaction rejected": "Transaction rejected",
"Transaction successful": "Transaction successful",
"Transaction timed out": "Transaction timed out",
Expand Down Expand Up @@ -530,6 +546,8 @@
"Unknown network": "Unknown network",
"Unknown network fee": "Unknown network fee",
"Unknown transaction error": "Unknown transaction error",
"Unlimited": "Unlimited",
"Unlimited {{currency}}": "Unlimited {{currency}}",
"Unlock airdrops": "Unlock airdrops",
"Unnamed FIDO Device": "Unnamed FIDO Device",
"Unsupporetd secret type": "Unsupporetd secret type",
Expand Down Expand Up @@ -568,6 +586,7 @@
"Wallet renamed": "Wallet renamed",
"Wallet secrets not found for the requested ID": "Wallet secrets not found for the requested ID",
"We were not able to verify this code. Please try again.": "We were not able to verify this code. Please try again.",
"We're unable to cover the gas fees for your transaction at this time. As a result, this feature has been disabled.": "We're unable to cover the gas fees for your transaction at this time. As a result, this feature has been disabled.",
"Weak password! Try adding more characters": "Weak password! Try adding more characters",
"When you connect to a dApp, it will appear here": "When you connect to a dApp, it will appear here",
"Wrong quote provider": "Wrong quote provider",
Expand Down
52 changes: 52 additions & 0 deletions apps/next/src/pages/Approve/ExtensionActionApprovalScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { useCallback } from 'react';
import { Typography } from '@avalabs/k2-alpine';
import { useTranslation } from 'react-i18next';

import { ActionStatus } from '@core/types';
import { useApproveAction, useGetRequestId } from '@core/ui';

import {
ActionDrawer,
ApprovalScreenTitle,
LoadingScreen,
Styled,
} from './components';

export const ExtensionActionApprovalScreen = () => {
const { t } = useTranslation();

const requestId = useGetRequestId();
const { action, updateAction, cancelHandler } = useApproveAction(requestId);

const approve = useCallback(async () => {
updateAction({
status: ActionStatus.SUBMITTING,
id: requestId,
});
}, [updateAction, requestId]);

if (!action) {
return <LoadingScreen />;
}

return (
<Styled.ApprovalScreenPage>
<Styled.NoScrollStack>
<ApprovalScreenTitle
title={t('🚧 Placeholder - needs implementation 🚧')}
/>
<Typography variant="body3">
{t(
'This is a placeholder screen just to allow us to reject/approve some wallet-specific interactions (i.e. chain switching).',
)}
</Typography>
</Styled.NoScrollStack>
<ActionDrawer
open
approve={approve}
reject={cancelHandler}
action={action}
/>
</Styled.ApprovalScreenPage>
);
};
52 changes: 35 additions & 17 deletions apps/next/src/pages/Approve/GenericApprovalScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,41 @@ import {
LoadingScreen,
Styled,
UnsupportedNetworkScreen,
MaliciousTxOverlay,
NoteWarning,
} from './components';
import { hasNoteWarning, hasOverlayWarning } from './lib';
import { useGasless } from './hooks';

const POLLED_BALANCES = [TokenType.NATIVE, TokenType.ERC20]; // Approval screen should always have the latest balance

export const GenericApprovalScreen = () => {
useLiveBalance(POLLED_BALANCES);

const requestId = useGetRequestId();
const { getNetwork, networks } = useNetworkContext();

const { action, updateAction, cancelHandler, error } =
useApproveAction<DisplayData>(requestId);

// TODO: handle gasless
const { tryFunding, setGaslessDefaultValues } = useGasless({ action });

const approve = useCallback(async () => {
updateAction(
{
status: ActionStatus.SUBMITTING,
id: requestId,
},
false, // TODO: handle hardware wallets
);
}, [updateAction, requestId]);
tryFunding(() => {
updateAction(
{
status: ActionStatus.SUBMITTING,
id: requestId,
},
false, // TODO: handle hardware wallets
);
});
}, [updateAction, requestId, tryFunding]);

const cancel = useCallback(() => {
// Reset the gasless state
setGaslessDefaultValues();
cancelHandler();
}, [cancelHandler, setGaslessDefaultValues]);

const network = action ? getNetwork(action.scope) : undefined;

Expand All @@ -55,7 +68,7 @@ export const GenericApprovalScreen = () => {
// TODO: Should we still allow approvals?
return (
<UnsupportedNetworkScreen>
<ActionDrawer open reject={cancelHandler} action={action} />
<ActionDrawer open reject={cancel} action={action} />
</UnsupportedNetworkScreen>
);
}
Expand All @@ -64,6 +77,9 @@ export const GenericApprovalScreen = () => {
<Styled.ApprovalScreenPage>
<Styled.NoScrollStack>
<ApprovalScreenTitle title={action.displayData.title} />
{hasNoteWarning(action) && (
<NoteWarning alert={action.displayData.alert} />
)}
<Stack flexGrow={1} px={2}>
<ActionDetails
network={network}
Expand All @@ -72,13 +88,15 @@ export const GenericApprovalScreen = () => {
error={error}
/>
</Stack>
<ActionDrawer
open
approve={approve}
reject={cancelHandler}
action={action}
/>
<ActionDrawer open approve={approve} reject={cancel} action={action} />
</Styled.NoScrollStack>
{hasOverlayWarning(action) && (
<MaliciousTxOverlay
open={hasOverlayWarning(action)}
cancelHandler={cancelHandler}
alert={action.displayData.alert}
/>
)}
</Styled.ApprovalScreenPage>
);
};
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { isEvmNetwork } from '@core/types';
import { isBtcNetwork, isEvmNetwork } from '@core/types';

import { ActionDetailsProps } from '../../types';

import { EvmActionDetails } from './evm/EvmActionDetails';
import { UnknownActionDetails } from './UnknownActionDetails';
import { BtcActionDetails } from './btc';

export const ActionDetails = ({
network,
Expand All @@ -22,6 +23,17 @@ export const ActionDetails = ({
);
}

if (isBtcNetwork(network)) {
return (
<BtcActionDetails
network={network}
action={action}
updateAction={updateAction}
error={error}
/>
);
}

return (
<UnknownActionDetails
network={network}
Expand Down
Loading