From 440101ac4011bd220335cfd77aab56ad5eeab266 Mon Sep 17 00:00:00 2001 From: isstuev Date: Thu, 4 Apr 2024 13:47:28 +0200 Subject: [PATCH] add 404 tokens to watchlist --- stubs/account.ts | 4 ++++ types/api/account.ts | 1 + ui/watchlist/AddressModal/AddressForm.tsx | 10 ++++++++-- ui/watchlist/AddressModal/AddressFormNotifications.tsx | 4 ++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/stubs/account.ts b/stubs/account.ts index cdb1bab556..92bd0861ce 100644 --- a/stubs/account.ts +++ b/stubs/account.ts @@ -48,6 +48,10 @@ export const WATCH_LIST_ITEM_WITH_TOKEN_INFO: WatchlistAddress = { incoming: true, outcoming: true, }, + 'ERC-404': { + incoming: true, + outcoming: true, + }, 'native': { incoming: true, outcoming: true, diff --git a/types/api/account.ts b/types/api/account.ts index 0ae2eeb664..4279884406 100644 --- a/types/api/account.ts +++ b/types/api/account.ts @@ -36,6 +36,7 @@ export interface NotificationSettings { 'native': NotificationDirection; 'ERC-20': NotificationDirection; 'ERC-721': NotificationDirection; + 'ERC-404': NotificationDirection; } export interface NotificationMethods { diff --git a/ui/watchlist/AddressModal/AddressForm.tsx b/ui/watchlist/AddressModal/AddressForm.tsx index 613d4029ae..f5db08aef4 100644 --- a/ui/watchlist/AddressModal/AddressForm.tsx +++ b/ui/watchlist/AddressModal/AddressForm.tsx @@ -22,7 +22,7 @@ import TagInput from 'ui/shared/TagInput'; import AddressFormNotifications from './AddressFormNotifications'; // does it depend on the network? -const NOTIFICATIONS = [ 'native', 'ERC-20', 'ERC-721' ] as const; +const NOTIFICATIONS = [ 'native', 'ERC-20', 'ERC-721', 'ERC-404' ] as const; const TAG_MAX_LENGTH = 35; @@ -50,6 +50,10 @@ type Inputs = { outcoming: boolean; incoming: boolean; }; + 'ERC-404': { + outcoming: boolean; + incoming: boolean; + }; }; } @@ -59,7 +63,9 @@ type Checkboxes = 'notification' | 'notification_settings.ERC-20.outcoming' | 'notification_settings.ERC-20.incoming' | 'notification_settings.ERC-721.outcoming' | -'notification_settings.ERC-721.incoming'; +'notification_settings.ERC-721.incoming' | +'notification_settings.ERC-404.outcoming' | +'notification_settings.ERC-404.incoming'; const AddressForm: React.FC = ({ data, onSuccess, setAlertVisible, isAdd }) => { const [ pending, setPending ] = useState(false); diff --git a/ui/watchlist/AddressModal/AddressFormNotifications.tsx b/ui/watchlist/AddressModal/AddressFormNotifications.tsx index f8db8b18a7..23ca3d9ff9 100644 --- a/ui/watchlist/AddressModal/AddressFormNotifications.tsx +++ b/ui/watchlist/AddressModal/AddressFormNotifications.tsx @@ -7,8 +7,8 @@ import config from 'configs/app'; import CheckboxInput from 'ui/shared/CheckboxInput'; // does it depend on the network? -const NOTIFICATIONS = [ 'native', 'ERC-20', 'ERC-721' ] as const; -const NOTIFICATIONS_NAMES = [ config.chain.currency.symbol, 'ERC-20', 'ERC-721, ERC-1155, ERC-404 (NFT)' ]; +const NOTIFICATIONS = [ 'native', 'ERC-20', 'ERC-721', 'ERC-404' ] as const; +const NOTIFICATIONS_NAMES = [ config.chain.currency.symbol, 'ERC-20', 'ERC-721, ERC-1155 (NFT)', 'ERC-404' ]; type Props = { control: Control;