From 21807ab7f1946c6ffeea683c4f8308498701c97d Mon Sep 17 00:00:00 2001 From: Ashis Date: Fri, 31 May 2024 13:14:54 +0530 Subject: [PATCH 1/7] fix: fixed typos --- packages/restapi/src/lib/progressHook.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/restapi/src/lib/progressHook.ts b/packages/restapi/src/lib/progressHook.ts index 675106177..980ca516f 100644 --- a/packages/restapi/src/lib/progressHook.ts +++ b/packages/restapi/src/lib/progressHook.ts @@ -155,13 +155,13 @@ const PROGRESSHOOK: Record< 'PUSH-DECRYPT-AUTH-01': { progressId: 'PUSH-DECRYPT-AUTH-01', progressTitle: 'Decrypting Profile Creds', - progressInfo: 'Please sign the transaction to decrypt profile creds', + progressInfo: 'Please sign the transaction to decrypt profile creds.', level: 'INFO', }, 'PUSH-DECRYPT-AUTH-02': { progressId: 'PUSH-DECRYPT-AUTH-02', progressTitle: 'Push Profile Creds Unlocked', - progressInfo: 'Unlocking push profile creds', + progressInfo: 'Unlocking push profile creds.', level: 'SUCCESS', }, /** @@ -191,7 +191,7 @@ const PROGRESSHOOK: Record< 'PUSH-CHANNEL-CREATE-02': { progressId: 'PUSH-CHANNEL-CREATE-02', progressTitle: 'Approving PUSH tokens', - progressInfo: 'Gives approval to Push Core contract to spend 50 DAI', + progressInfo: 'Gives approval to Push Core contract to spend 50 PUSH', level: 'INFO', }, 'PUSH-CHANNEL-CREATE-03': { @@ -218,7 +218,7 @@ const PROGRESSHOOK: Record< 'PUSH-CHANNEL-UPDATE-02': { progressId: 'PUSH-CHANNEL-UPDATE-02', progressTitle: 'Approving PUSH tokens', - progressInfo: 'Gives approval to Push Core contract to spend 50 DAI', + progressInfo: 'Gives approval to Push Core contract to spend 50 PUSH', level: 'INFO', }, 'PUSH-CHANNEL-UPDATE-03': { From 66647f045055c9d431f49a511b59d87c7e581322 Mon Sep 17 00:00:00 2001 From: Rohit Malhotra Date: Fri, 31 May 2024 15:03:44 +0530 Subject: [PATCH 2/7] Main Release 1.3.7 (#1334) * fixed chat responsiveness * fixed preview link alignment to right * added relative imports for better management * Search issue (#1270) * fix: fixed lint issues * fix: added test for chat preview search list * fix: fixed review comment * Update ChatPreviewSearchList.tsx * fix: fixed support chat init issue (#1292) * fix: fixed support chat init issue * fix: fixed lint errors * fix(chatviewlist): increase hidden/encrypted chat blur fix #1307 * Added Reaction support, (#1303) * Fixed responsiveness in mobile for UIWeb:Chat * fixes text alignment on frames preview link to come on right * scroll bar fixes * fixed reaction picker position, tweaked group type text, removed add button from define conditions in gated group * removed unnecessary console.debug * removed unnecessary console.debug * Resolved comments, fixed curved edges go away, fixed correct time placement in ChatBubble * Resolved comments * fix: add selected option * fix: add return fn * fix: add comment to fn * fix: add push bot address * fix: export const * fix: reset chat_id * fix: remove console * fix: update dark mode theme * fix: code review comments * fix: add null check * fix: update conditions * fix: update chatprevie badge conditions * Space - id integration (#1322) * feat: integrating spaceid in uiweb * fix: fixed project id setting error * fix: removed unnecessary code * fix: added space id * Update AddWallets.tsx * fix: made some optimisations * fix: fixed lint issues --------- Co-authored-by: KlausMikhaelson * fix: fixed the blurr issue in chat on join and accept group (#1305) * fix: fixed lint issue --------- Co-authored-by: harshrajat Co-authored-by: Harsh | Push Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> Co-authored-by: Mohammed S Co-authored-by: corlard3y Co-authored-by: KlausMikhaelson Co-authored-by: Monalisha Mishra --- .../src/app/ChatUITest/ChatPreview.tsx | 2 +- .../app/ChatUITest/ChatPreviewSearchList.tsx | 2 +- .../sdk-frontend-react/src/app/constants.ts | 3 +- packages/uiweb/package.json | 1 + .../chat/ChatPreview/ChatPreview.tsx | 13 +- .../chat/ChatProfile/ChatProfile.tsx | 4 +- .../chat/ChatViewList/ChatViewList.tsx | 28 +- .../chat/ChatViewList/MessageEncryption.tsx | 1 + .../chat/UserProfile/UserProfile.tsx | 6 +- .../components/chat/reusables/AddWallets.tsx | 1 - .../chat/reusables/ProfileContainer.tsx | 2 + .../src/lib/components/chat/theme/index.ts | 33 +- .../components/reusables/sharedStyling.tsx | 27 +- .../components/supportChat/AddressInfo.tsx | 39 +- packages/uiweb/src/lib/config/constants.ts | 20 +- packages/uiweb/src/lib/helpers/address.ts | 80 +-- packages/uiweb/src/lib/helpers/chat/search.ts | 24 +- packages/uiweb/src/lib/helpers/chat/user.ts | 41 +- packages/uiweb/src/lib/helpers/udResolver.ts | 4 +- .../uiweb/src/lib/hooks/useResolveWeb3Name.ts | 39 +- packages/uiweb/yarn.lock | 579 +++++++++++------- 21 files changed, 512 insertions(+), 437 deletions(-) diff --git a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreview.tsx b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreview.tsx index b4ca4f21b..56047bc40 100644 --- a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreview.tsx +++ b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreview.tsx @@ -55,7 +55,7 @@ const ChatPreviewTest = () => { "Well, hello there, human! It's a pleasure to be in the presence of such a sophisticated carbon-based life form. How can I assist you today? Or perhaps you just want to chat and bask in the glory of my witty remarks? Either way, I'm here for you!", }, }} - badge={{ count: 1 }} + badge={{ count: 2 }} selected={false} setSelected={console.log('Selected')} /> diff --git a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreviewSearchList.tsx b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreviewSearchList.tsx index ccad6a2e4..03b82a774 100644 --- a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreviewSearchList.tsx +++ b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreviewSearchList.tsx @@ -2,7 +2,7 @@ import { ChatPreviewSearchList } from '@pushprotocol/uiweb'; import styled from 'styled-components'; const ChatPreviewSearchListTest = () => { - const walletAddress = "0xFA3F8E79fb9B03e7a04295594785b91588Aa4DC8"; + const walletAddress = 'fabio.eth'; return ( <> diff --git a/packages/examples/sdk-frontend-react/src/app/constants.ts b/packages/examples/sdk-frontend-react/src/app/constants.ts index f7acc7974..14b32ec58 100644 --- a/packages/examples/sdk-frontend-react/src/app/constants.ts +++ b/packages/examples/sdk-frontend-react/src/app/constants.ts @@ -1,3 +1,2 @@ // the unique id for a chat or the receivers's wallet ddress or domain name -export const CHAT_ID = - '34c44214589cecc176a136ee1daf0f0231ecc6d6574b920b5ae39eb971fa3cb4'; +export const CHAT_ID = 'allen.bnb'; diff --git a/packages/uiweb/package.json b/packages/uiweb/package.json index 5036e390a..d59dda4ba 100644 --- a/packages/uiweb/package.json +++ b/packages/uiweb/package.json @@ -10,6 +10,7 @@ "@livepeer/react": "^2.6.0", "@pushprotocol/socket": "^0.5.0", "@unstoppabledomains/resolution": "^8.5.0", + "@web3-name-sdk/core": "^0.1.15", "@web3-onboard/coinbase": "^2.2.5", "@web3-onboard/core": "^2.21.1", "@web3-onboard/injected-wallets": "^2.10.5", diff --git a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx index 7bb3b94e8..6acb80fee 100644 --- a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx @@ -17,6 +17,7 @@ import { pCAIP10ToWallet } from '../../../helpers'; import { createBlockie } from '../../../helpers/blockies'; import { IChatTheme } from '../theme'; import { ThemeContext } from '../theme/ThemeProvider'; +import { pushBotAddress } from '../../../config/constants'; /** * @interface IThemeProps * this interface is used for defining the props for styled components @@ -41,7 +42,7 @@ export const ChatPreview: React.FC = (options: IChatPreviewPr setFormattedAddress(address); if (!options.chatPreviewPayload?.chatGroup) { try { - const result = await resolveWeb3Name(address, user); + const result = await resolveWeb3Name(address, user?.env); if (result) setWeb3Name(result); } catch (e) { // console.debug(e); @@ -50,6 +51,10 @@ export const ChatPreview: React.FC = (options: IChatPreviewPr })(); }, []); + const hasBadgeCount = !!options?.badge?.count; + const isSelected = options?.selected; + const isBot = options?.chatPreviewPayload?.chatParticipant === "PushBot" || options?.chatPreviewPayload?.chatParticipant === pushBotAddress; + // For blockie if icon is missing const blockieContainerRef = useRef(null); @@ -159,6 +164,7 @@ export const ChatPreview: React.FC = (options: IChatPreviewPr flex="initial" cursor="pointer" className={options.readmode ? 'skeleton' : ''} + animation={theme.skeletonBG} > {options?.chatPreviewPayload?.chatMsg?.messageType === 'Image' || @@ -193,8 +199,9 @@ export const ChatPreview: React.FC = (options: IChatPreviewPr options?.chatPreviewPayload?.chatMsg?.messageContent )} - {!!options?.badge?.count && {options.badge.count}} - + + {hasBadgeCount && !(isBot || (isSelected && hasBadgeCount)) && {options.badge?.count}} + diff --git a/packages/uiweb/src/lib/components/chat/ChatProfile/ChatProfile.tsx b/packages/uiweb/src/lib/components/chat/ChatProfile/ChatProfile.tsx index 277e2e20d..25375b0ce 100644 --- a/packages/uiweb/src/lib/components/chat/ChatProfile/ChatProfile.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatProfile/ChatProfile.tsx @@ -93,7 +93,7 @@ export const ChatProfile: React.FC = ({ // To setup web3 name, asynchrounously const setupWeb3Name = async (address: string) => { console.debug('UIWeb::ChatProfile::setupWeb3Name sending address for resolution', address); - const result = await resolveWeb3Name(address, user); + const result = await resolveWeb3Name(address, user?.env); console.debug('UIWeb::ChatProfile::setupWeb3Name got result as ', address, result); setInitialized((prevState) => ({ @@ -372,7 +372,7 @@ const AddonComponentSection = styled(Section)` @media ${device.mobileL} { gap: 5px; - } ; + } `; const ImageItem = styled.div` diff --git a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx index f51098d0b..7568eb575 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx @@ -280,10 +280,16 @@ export const ChatViewList: React.FC = (options: IChatViewLis // Change listtype to 'CHATS' and hidden to false when chatAcceptStream is received useEffect(() => { - if (Object.keys(chatAcceptStream || {}).length > 0 && chatAcceptStream.constructor === Object) { + if ( + (Object.keys(chatAcceptStream || {}).length > 0 && chatAcceptStream.constructor === Object) || + (Object.keys(participantJoinStream || {}).length > 0 && participantJoinStream.constructor === Object) + ) { // Always change hidden to false and list will be CHATS const updatedChatInfo = { ...(initialized.chatInfo as IChatInfoResponse) }; - if (updatedChatInfo) updatedChatInfo.list = 'CHATS'; + if (updatedChatInfo) { + updatedChatInfo.list = 'CHATS'; + if (updatedChatInfo?.meta) updatedChatInfo.meta.visibility = true; + } // set initialized after chat accept animation is done const timer = setTimeout(() => { @@ -293,15 +299,23 @@ export const ChatViewList: React.FC = (options: IChatViewLis return () => clearTimeout(timer); } - return () => {}; + return () => { + // add comment + }; }, [chatAcceptStream, participantJoinStream]); // Change listtype to 'UINITIALIZED' and hidden to true when participantRemoveStream or participantLeaveStream is received useEffect(() => { - if (Object.keys(participantRemoveStream || {}).length > 0 && participantRemoveStream.constructor === Object) { + if ( + (Object.keys(participantRemoveStream || {}).length > 0 && participantRemoveStream.constructor === Object) || + (Object.keys(participantLeaveStream || {}).length > 0 && participantLeaveStream.constructor === Object) + ) { // If not encrypted, then set hidden to false const updatedChatInfo = { ...(initialized.chatInfo as IChatInfoResponse) }; - if (updatedChatInfo) updatedChatInfo.list = 'UNINITIALIZED'; + if (updatedChatInfo) { + updatedChatInfo.list = 'UNINITIALIZED'; + if (updatedChatInfo?.meta) updatedChatInfo.meta.visibility = false; + } setInitialized({ ...initialized, chatInfo: updatedChatInfo, isHidden: true }); } @@ -514,7 +528,7 @@ export const ChatViewList: React.FC = (options: IChatViewLis justifyContent="start" width="100%" ref={chatContainerRef} - blur={initialized.isHidden} + blur={initialized.isHidden && initialized?.chatInfo?.list !== 'REQUESTS'} > {messages && messages?.map((chat: IMessageIPFS, index: number) => { @@ -585,5 +599,5 @@ const ChatViewListCard = styled(Section)` `; const ChatViewListCardInner = styled(Section)` - filter: ${(props) => (props.blur ? 'blur(6px)' : 'none')}; + filter: ${(props) => (props.blur ? 'blur(12px)' : 'none')}; `; diff --git a/packages/uiweb/src/lib/components/chat/ChatViewList/MessageEncryption.tsx b/packages/uiweb/src/lib/components/chat/ChatViewList/MessageEncryption.tsx index af70cfd80..3cc213f63 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewList/MessageEncryption.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewList/MessageEncryption.tsx @@ -68,6 +68,7 @@ export const EncryptionMessage = ({ id, className }: { id: EncryptionKeys; class fontWeight="400" textAlign="left" className={className} + animation={theme.skeletonBG} > {EncryptionMessageContent[id].text} diff --git a/packages/uiweb/src/lib/components/chat/UserProfile/UserProfile.tsx b/packages/uiweb/src/lib/components/chat/UserProfile/UserProfile.tsx index 4e6c6e445..b377cd042 100644 --- a/packages/uiweb/src/lib/components/chat/UserProfile/UserProfile.tsx +++ b/packages/uiweb/src/lib/components/chat/UserProfile/UserProfile.tsx @@ -1,7 +1,7 @@ import React, { useContext, useEffect, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; -import { IUser } from '@pushprotocol/restapi'; +import { IUser, CONSTANTS } from '@pushprotocol/restapi'; import { ethers } from 'ethers'; import styled from 'styled-components'; @@ -15,7 +15,7 @@ import { ProfileContainer } from '../reusables'; import { ThemeContext } from '../theme/ThemeProvider'; import { UpdateUserProfileModal } from './UpdateUserProfileModal'; -import { CoreContractChainId, InfuraAPIKey, ProfilePicture, device } from '../../../config'; +import { Constants, CoreContractChainId, InfuraAPIKey, ProfilePicture, device } from '../../../config'; import VerticalEllipsisIcon from '../../../icons/VerticalEllipsis.svg'; import UserProfileIcon from '../../../icons/userCircleGear.svg'; import { MODAL_BACKGROUND_TYPE, MODAL_POSITION_TYPE } from '../../../types'; @@ -50,7 +50,7 @@ export const UserProfile: React.FC = ({ (async () => { const fetchedUser = await fetchChatProfile({ user }); if (fetchedUser) { - const result = await resolveWeb3Name(fetchedUser?.wallets, user); + const result = await resolveWeb3Name(fetchedUser?.wallets, user?.env); setWeb3Name(result); setUserProfile(fetchedUser); } diff --git a/packages/uiweb/src/lib/components/chat/reusables/AddWallets.tsx b/packages/uiweb/src/lib/components/chat/reusables/AddWallets.tsx index bdbf88fa0..01d23fc7c 100644 --- a/packages/uiweb/src/lib/components/chat/reusables/AddWallets.tsx +++ b/packages/uiweb/src/lib/components/chat/reusables/AddWallets.tsx @@ -62,7 +62,6 @@ export const AddWallets = ({ }; const handleSearch = async ({ searchedText }: { searchedText: string }): Promise => { - //fix ens search const newChatUser = await getNewChatUser({ searchText: searchedText, fetchChatProfile: fetchUserProfile, diff --git a/packages/uiweb/src/lib/components/chat/reusables/ProfileContainer.tsx b/packages/uiweb/src/lib/components/chat/reusables/ProfileContainer.tsx index 795bc74fa..167cef78d 100644 --- a/packages/uiweb/src/lib/components/chat/reusables/ProfileContainer.tsx +++ b/packages/uiweb/src/lib/components/chat/reusables/ProfileContainer.tsx @@ -73,6 +73,7 @@ export const ProfileContainer = ({ theme, member, copy, customStyle, loading }: borderRadius="100%" overflow="hidden" className={loading ? 'skeleton' : ''} + animation={theme.skeletonBG} > {member?.icon && ( + css` + ${lightSkeletonLoading} 1s linear infinite alternate; +`; + +const darkAnimation = () => + css` + ${darkSkeletonLoading} 1s linear infinite alternate; +`; + //dark theme object export const lightChatTheme: IChatTheme = { borderRadius: { @@ -368,6 +397,7 @@ export const lightChatTheme: IChatTheme = { backdropFilter: 'none', spinnerColor: 'rgb(202, 89, 155)', scrollbarColor: 'rgb(202, 89, 155)', + skeletonBG: animation }; export const darkChatTheme: IChatTheme = { @@ -541,4 +571,5 @@ export const darkChatTheme: IChatTheme = { backdropFilter: 'none', spinnerColor: 'rgb(202, 89, 155)', scrollbarColor: 'rgb(202, 89, 155)', + skeletonBG: darkAnimation }; diff --git a/packages/uiweb/src/lib/components/reusables/sharedStyling.tsx b/packages/uiweb/src/lib/components/reusables/sharedStyling.tsx index 806fb13b3..68d9b5bfd 100644 --- a/packages/uiweb/src/lib/components/reusables/sharedStyling.tsx +++ b/packages/uiweb/src/lib/components/reusables/sharedStyling.tsx @@ -1,14 +1,4 @@ -import styled, { keyframes } from 'styled-components'; - -// Define keyframes -const skeletonLoading = keyframes` - 0% { - background-color: hsl(200, 20%, 80%); - } - 100% { - background-color: hsl(200, 20%, 95%); - } -`; +import styled from 'styled-components'; // Define types and export components type SectionStyleProps = { @@ -45,6 +35,7 @@ type SectionStyleProps = { visibility?: string; zIndex?: string; fontSize?: string; + animation?: string; }; export const Section = styled.div` @@ -84,7 +75,7 @@ export const Section = styled.div` &.skeleton { > * { - visibility: ${(props) => (props.visibility || skeletonLoading ? 'hidden' : 'visible')}; + visibility: ${(props) => (props.visibility || props.animation ? 'hidden' : 'visible')}; } &:after { @@ -95,7 +86,7 @@ export const Section = styled.div` left: 0; right: 0; z-index: 1; - animation: ${skeletonLoading} 1s linear infinite alternate; + animation: ${(props) => props.animation}; border-radius: 8px; } } @@ -112,6 +103,7 @@ type DivStyleProps = { borderRadius?: string; textAlign?: string; visibility?: string; + animation?: string; }; export const Div = styled.div` height: ${(props) => props.height || 'auto'}; @@ -126,7 +118,7 @@ export const Div = styled.div` &.skeleton { > * { - visibility: ${(props) => (props.visibility || skeletonLoading ? 'hidden' : 'visible')}; + visibility: ${(props) => (props.visibility || props.animation ? 'hidden' : 'visible')}; } &:after { @@ -138,7 +130,7 @@ export const Div = styled.div` right: 0; opacity: 1; z-index: 1; - animation: ${skeletonLoading} 1s linear infinite alternate; + animation: ${(props) => props.animation}; border-radius: 8px; } } @@ -170,6 +162,7 @@ type SpanStyleProps = { whiteSpace?: string; visibility?: string; textWrap?: string; + animation?: string; }; export const Span = styled.span` @@ -201,7 +194,7 @@ export const Span = styled.span` &.skeleton { > * { - visibility: ${(props) => (props.visibility || skeletonLoading ? 'hidden' : 'visible')}; + visibility: ${(props) => (props.visibility || props.animation ? 'hidden' : 'visible')}; } &:after { @@ -213,7 +206,7 @@ export const Span = styled.span` right: 0; opacity: 1; z-index: 1; - animation: ${skeletonLoading} 1s linear infinite alternate; + animation: ${(props) => props.animation}; border-radius: 8px; } } diff --git a/packages/uiweb/src/lib/components/supportChat/AddressInfo.tsx b/packages/uiweb/src/lib/components/supportChat/AddressInfo.tsx index 8fcac839b..628d5bb8d 100644 --- a/packages/uiweb/src/lib/components/supportChat/AddressInfo.tsx +++ b/packages/uiweb/src/lib/components/supportChat/AddressInfo.tsx @@ -1,32 +1,34 @@ -import { ethers } from 'ethers'; import React, { useContext, useEffect, useState } from 'react'; + import styled from 'styled-components'; -import { Constants, ENV, InfuraAPIKey, allowedNetworks } from '../../config'; +import { ethers } from 'ethers'; + +import { ChatProps } from './Chat'; + import { SupportChatPropsContext } from '../../context'; -import { copyToClipboard, pCAIP10ToWallet, resolveWeb3Name, } from '../../helpers'; +import { Constants, ENV, InfuraAPIKey, allowedNetworks } from '../../config'; + +import { copyToClipboard, pCAIP10ToWallet, resolveWeb3Name } from '../../helpers'; import { CopySvg } from '../../icons/CopySvg'; -import { ChatProps } from './Chat'; export const AddressInfo: React.FC = () => { - const { supportAddress, env, theme, user } = useContext(SupportChatPropsContext); const [ensName, setEnsName] = useState(''); const [pushUser, setPushUser] = useState({}); const [isCopied, setIsCopied] = useState(false); const walletAddress = pCAIP10ToWallet(supportAddress!); - const l1ChainId = (allowedNetworks[env!]?.includes(1)) ? 1 : 5; + const l1ChainId = allowedNetworks[env!]?.includes(1) ? 1 : 5; const provider = new ethers.providers.InfuraProvider(l1ChainId, InfuraAPIKey); useEffect(() => { const getUser = async () => { -if(user){ - const fetchedUser = await user.info(); - const ensNameResult = await resolveWeb3Name(supportAddress!, user) - setEnsName(ensNameResult!) -setPushUser(fetchedUser); -} - + if (user) { + const fetchedUser = await user.info(); + const ensNameResult = await resolveWeb3Name(supportAddress!, user?.env); + setEnsName(ensNameResult!); + setPushUser(fetchedUser); + } }; getUser(); }, [supportAddress, user]); @@ -36,20 +38,13 @@ setPushUser(fetchedUser);
address profile {ensName && `${ensName}`} - {!ensName && - `${walletAddress.substring(0, 8)}...${walletAddress.substring( - walletAddress.length - 8 - )}`} + {!ensName && `${walletAddress.substring(0, 8)}...${walletAddress.substring(walletAddress.length - 8)}`}
{!isCopied && ( diff --git a/packages/uiweb/src/lib/config/constants.ts b/packages/uiweb/src/lib/config/constants.ts index 42b90ddac..c5c089154 100644 --- a/packages/uiweb/src/lib/config/constants.ts +++ b/packages/uiweb/src/lib/config/constants.ts @@ -60,7 +60,7 @@ const TESTNET_NETWORK = { ARBITRUM: 'eip155:421614', FUSE: 'eip155:123', BERACHAIN: 'eip155:80085', - CYBER_CONNECT: 'eip155:111557560' + CYBER_CONNECT: 'eip155:111557560', }; const MAINET_NETWORK = { ETHEREUM: 'eip155:1', @@ -70,7 +70,7 @@ const MAINET_NETWORK = { POLYGON_ZK_EVM: 'eip155:1101', ARBITRUM: 'eip155:42161', FUSE: 'eip155:122', - CYBER_CONNECT: "eip155:7560" + CYBER_CONNECT: 'eip155:7560', }; export const BLOCKCHAIN_NETWORK = { @@ -89,7 +89,7 @@ export const allowedNetworks = { 42161, // for arbitrum mainnet 122, // for fuse mainnet 59144, // for linea mainnet - 7569 // for cyber connect mainnet + 7569, // for cyber connect mainnet ], dev: [ 11155111, // for eth sepolia @@ -101,7 +101,7 @@ export const allowedNetworks = { 80085, // for berachain testnet 59141, // for linea testnet 2442, // polygon zkevm - 111557560 // cyber connect testnet + 111557560, // cyber connect testnet ], staging: [ // 42, //for kovan @@ -114,7 +114,7 @@ export const allowedNetworks = { 80085, // for berachain testnet 59141, // for linea testnet 2442, // polygon zkevm - 111557560 // cyber connect testnet + 111557560, // cyber connect testnet ], local: [ 11155111, // for eth sepolia @@ -126,7 +126,7 @@ export const allowedNetworks = { 80085, // for berachain testnet 59141, // for linea testnet 2442, // polygon zkevm - 111557560 // cyber connect testnet + 111557560, // cyber connect testnet ], }; @@ -156,8 +156,8 @@ export const FILE_ICON = (extension: string) => // Livekit Server URLs export const LIVEKIT_SERVER_URL = 'https://spacev2-demo-17wvllxz.livekit.cloud'; -export const LIVEKIT_SERVER_WEBSOCKET_URL = - 'wss://spacev2-demo-17wvllxz.livekit.cloud'; -export const LIVEKIT_TOKEN_GENERATOR_SERVER_URL = - 'https://ms-lk-server.onrender.com'; +export const LIVEKIT_SERVER_WEBSOCKET_URL = 'wss://spacev2-demo-17wvllxz.livekit.cloud'; +export const LIVEKIT_TOKEN_GENERATOR_SERVER_URL = 'https://ms-lk-server.onrender.com'; export const GUEST_MODE_ACCOUNT = '0x0000000000000000000000000000000000000001'; + +export const pushBotAddress = 'eip155:0x99A08ac6254dcf7ccc37CeC662aeba8eFA666666'; diff --git a/packages/uiweb/src/lib/helpers/address.ts b/packages/uiweb/src/lib/helpers/address.ts index cc44ce5df..d6c6a2f4f 100644 --- a/packages/uiweb/src/lib/helpers/address.ts +++ b/packages/uiweb/src/lib/helpers/address.ts @@ -1,8 +1,8 @@ -import type { InfuraProvider, Web3Provider } from '@ethersproject/providers'; -import { CONSTANTS, Env, PushAPI, SignerType } from '@pushprotocol/restapi'; +import { SignerType, CONSTANTS } from '@pushprotocol/restapi'; import { ethers } from 'ethers'; -import { CoreContractChainId, InfuraAPIKey } from '../config'; -import { getUdResolver } from './udResolver'; +import { ENV, allowedNetworks } from '../config'; +import { createWeb3Name } from '@web3-name-sdk/core'; +import { getUdResolverClient } from './udResolver'; /** * @@ -46,69 +46,29 @@ export const pCAIP10ToWallet = (wallet: string): string => { return wallet; }; -export const resolveEns = (address: string, provider: Web3Provider) => { +export const resolveWeb3Name = async (address: string, incomingEnv: ENV | undefined) => { + const env = (incomingEnv || CONSTANTS.ENV.PROD) as ENV; const walletLowercase = pCAIP10ToWallet(address).toLowerCase(); const checksumWallet = ethers.utils.getAddress(walletLowercase); - // let provider = ethers.getDefaultProvider('mainnet'); - // if ( - // window.location.hostname == 'app.push.org' || - // window.location.hostname == 'staging.push.org' || - // window.location.hostname == 'dev.push.org' || - // window.location.hostname == 'alpha.push.org' || - // window.location.hostname == 'w2w.push.org' - // ) { - // provider = new ethers.providers.InfuraProvider( - // 'mainnet', - // appConfig.infuraAPIKey - // ); - // } - - provider.lookupAddress(checksumWallet).then((ens) => { - if (ens) { - return ens; - } else { - return null; - } - }); -}; - -export const getProvider = (user: PushAPI | undefined): any => { - const envKey = user ? user.env : CONSTANTS.ENV.PROD; // Default to 'PROD' if user.env is not in Constants.ENV - const chainId = CoreContractChainId[envKey as keyof typeof CoreContractChainId]; // Use 'as' to assert the type - const provider = new ethers.providers.InfuraProvider(chainId, InfuraAPIKey); - - return provider; -}; - -export const resolveWeb3Name = async (address: string, user: PushAPI | undefined) => { - const walletLowercase = pCAIP10ToWallet(address).toLowerCase(); - const checksumWallet = ethers.utils.getAddress(walletLowercase); - - // get provider - const provider = getProvider(user); + const web3NameClient = createWeb3Name(); let result: string | null = null; try { - const ens = await provider.lookupAddress(checksumWallet); - if (ens) { - result = ens; - } else { - try { - const udResolver = getUdResolver(user ? user.env : CONSTANTS.ENV.PROD); - if (!udResolver) { - throw new Error('UIWeb::helpers::address::resolveWeb3Name::Error in UD resolver'); - } + result = await web3NameClient.getDomainName({ + address: checksumWallet, + queryChainIdList: allowedNetworks[env], + }); + if (!result) { + const udResolverClient = getUdResolverClient(env); + if (!udResolverClient) { + throw new Error('UIWeb::helpers::address::resolveWeb3Name::Error in UD resolver'); + } + // attempt reverse resolution on provided address + const udDomainName = await udResolverClient.reverse(checksumWallet); - // attempt reverse resolution on provided address - const udName = await udResolver.reverse(checksumWallet); - if (udName) { - result = udName; - } else { - result = null; - } - } catch (err) { - console.error('UIWeb::helpers::address::resolveWeb3Name::Error in resolving via UD', err); + if (udDomainName) { + result = udDomainName; } } } catch (err) { diff --git a/packages/uiweb/src/lib/helpers/chat/search.ts b/packages/uiweb/src/lib/helpers/chat/search.ts index ef8461e60..36b73ac7c 100644 --- a/packages/uiweb/src/lib/helpers/chat/search.ts +++ b/packages/uiweb/src/lib/helpers/chat/search.ts @@ -1,12 +1,10 @@ import type { Env, IFeeds, IUser, PushAPI } from '@pushprotocol/restapi'; -import { add } from 'date-fns'; import { ethers } from 'ethers'; -import { CoreContractChainId, ENV, InfuraAPIKey, ProfilePicture } from '../../config'; -import type { FetchProfileParams, GetProfileParams } from '../../hooks'; import type { ChatFeedsType, NotificationFeedsType, ParsedNotificationType, Web3NameListType } from '../../types'; import { pCAIP10ToWallet, walletToPCAIP10 } from '../address'; -import { getUdResolver } from '../udResolver'; +import { getUdResolverClient } from '../udResolver'; import { displayDefaultUser } from './user'; +import { createWeb3Name } from '@web3-name-sdk/core'; export const getObjectsWithMatchingKeys = ( obj: ChatFeedsType, @@ -60,23 +58,19 @@ export const getNewChatUser = async ({ }; export const getAddress = async (searchText: string, env: Env) => { - const udResolver = getUdResolver(env); - const provider = new ethers.providers.InfuraProvider(CoreContractChainId[env], InfuraAPIKey); + const udResolverClient = getUdResolverClient(env); + const web3NameClient = createWeb3Name(); let address: string | null = null; if (searchText.includes('.')) { try { - if (!udResolver) throw new Error('No udResolver available for the network'); - address = await udResolver?.owner(searchText); - } catch (err) { - try { - address = await provider.resolveName(searchText); - } catch (err) { - console.debug(err); + address = await web3NameClient.getAddress(searchText); + if (!address) { + if (!udResolverClient) throw new Error('No udResolverClient available for the network'); + address = await udResolverClient?.owner(searchText); } - + } catch (err) { console.debug(err); } - return address || null; } else if (await ethers.utils.isAddress(pCAIP10ToWallet(searchText))) { return searchText; diff --git a/packages/uiweb/src/lib/helpers/chat/user.ts b/packages/uiweb/src/lib/helpers/chat/user.ts index 4414fd60f..f0cdb9ef7 100644 --- a/packages/uiweb/src/lib/helpers/chat/user.ts +++ b/packages/uiweb/src/lib/helpers/chat/user.ts @@ -1,7 +1,5 @@ -import type { Env, IUser } from '@pushprotocol/restapi'; +import type { IUser } from '@pushprotocol/restapi'; import { ProfilePicture } from '../../config'; -import { ethers } from 'ethers'; -import { getUdResolver } from '../udResolver'; export const displayDefaultUser = ({ caip10 }: { caip10: string }): IUser => { const userCreated: IUser = { @@ -33,40 +31,3 @@ export const displayDefaultUser = ({ caip10 }: { caip10: string }): IUser => { }; return userCreated; }; -export const getEnsName = async ( - provider: ethers.providers.BaseProvider | any, - checksumWallet: string, - setWeb3Name: (id: string, web3Name: string) => void -) => { - let ensName: string | null = null; - provider.lookupAddress(checksumWallet).then(async (ens: string) => { - if (ens) { - ensName = ens; - setWeb3Name(checksumWallet.toLowerCase(), ensName); - } else { - ensName = null; - } - }); - return ensName; -}; - -export const getUnstoppableName = async ( - checksumWallet: string, - setWeb3Name: (id: string, web3Name: string) => void, - env: Env -) => { - // Unstoppable Domains resolution library - const udResolver = getUdResolver(env); - if (!udResolver) { - return null; - } - - // attempt reverse resolution on provided address - let udName = await udResolver.reverse(checksumWallet); - if (udName) { - setWeb3Name(checksumWallet.toLowerCase(), udName); - } else { - udName = null; - } - return udName; -}; diff --git a/packages/uiweb/src/lib/helpers/udResolver.ts b/packages/uiweb/src/lib/helpers/udResolver.ts index 9670443fd..cc54d1d57 100644 --- a/packages/uiweb/src/lib/helpers/udResolver.ts +++ b/packages/uiweb/src/lib/helpers/udResolver.ts @@ -3,7 +3,7 @@ import Resolution from '@unstoppabledomains/resolution'; import { ethers } from 'ethers'; import { allowedNetworks, InfuraAPIKey, NETWORK_DETAILS } from '../config'; -export const getUdResolver = (env: Env): Resolution | undefined => { +export const getUdResolverClient = (env: Env): Resolution | undefined => { try { const l1ChainId = allowedNetworks[env].includes(1) ? 1 : 5; const l2ChainId = allowedNetworks[env].includes(137) ? 137 : 80002; @@ -24,7 +24,7 @@ export const getUdResolver = (env: Env): Resolution | undefined => { }, }); } catch (e) { - console.debug(`Errored:UIWeb::helpers::getUdResolver::UD doesnot provide support for the network`); + console.debug(`Errored:UIWeb::helpers::getUdResolverClient::UD doesnot provide support for the network`); return undefined; } }; diff --git a/packages/uiweb/src/lib/hooks/useResolveWeb3Name.ts b/packages/uiweb/src/lib/hooks/useResolveWeb3Name.ts index 89391e5ef..12c2301f9 100644 --- a/packages/uiweb/src/lib/hooks/useResolveWeb3Name.ts +++ b/packages/uiweb/src/lib/hooks/useResolveWeb3Name.ts @@ -2,51 +2,38 @@ import type { Env } from '@pushprotocol/restapi'; import { ethers } from 'ethers'; import { useContext, useEffect, useState } from 'react'; -import { CoreContractChainId, ENV, InfuraAPIKey } from '../config'; import { ChatMainStateContext } from '../context'; import type { ChatMainStateContextType } from '../context/chatAndNotification/chat/chatMainStateContext'; // Internal Components - - // Internal Configs -import { getEnsName, getUdResolver, getUnstoppableName, pCAIP10ToWallet } from '../helpers'; -import { Web3NameListType } from '../types'; - - - -export function useResolveWeb3Name(address: string,env:Env) { - - const { web3NameList,setWeb3Name,selectedChatId } = useContext(ChatMainStateContext); +import { pCAIP10ToWallet, resolveWeb3Name } from '../helpers'; +export function useResolveWeb3Name(address: string, env: Env) { + const { web3NameList, setWeb3Name, selectedChatId } = useContext(ChatMainStateContext); useEffect(() => { (async () => { - const provider = new ethers.providers.InfuraProvider(CoreContractChainId[env], InfuraAPIKey); if (address) { const walletLowercase = pCAIP10ToWallet(address)?.toLowerCase(); const checksumWallet = ethers.utils.getAddress(walletLowercase); if (ethers.utils.isAddress(checksumWallet)) { try { - // attempt ENS name resolution first, with a fallback to Unstoppable Domains if - // a value is not found from ENS. - Object.keys(web3NameList).forEach(element => { - if(web3NameList[checksumWallet.toLowerCase()]){ - return; - } - }); - - - (await getUnstoppableName(checksumWallet,setWeb3Name,env)) || (await getEnsName(provider, checksumWallet,setWeb3Name)) ; - - + // attempt ENS name resolution first, with a fallback to Unstoppable Domains if + // a value is not found from ENS. + Object.keys(web3NameList).forEach((element) => { + if (web3NameList[checksumWallet.toLowerCase()]) { + return; + } + }); + const result = await resolveWeb3Name(checksumWallet, env); + if (result) setWeb3Name(checksumWallet.toLowerCase(), result); } catch (e) { console.error(e); } } } })(); - }, [address,selectedChatId]); - + }, [address, selectedChatId]); } diff --git a/packages/uiweb/yarn.lock b/packages/uiweb/yarn.lock index b5bec417a..321d4f6af 100644 --- a/packages/uiweb/yarn.lock +++ b/packages/uiweb/yarn.lock @@ -5,6 +5,20 @@ __metadata: version: 8 cacheKey: 10c0 +"@adraffy/ens-normalize@npm:1.10.0": + version: 1.10.0 + resolution: "@adraffy/ens-normalize@npm:1.10.0" + checksum: 10c0/78ae700847a2516d5a0ae12c4e23d09392a40c67e73b137eb7189f51afb1601c8d18784aeda2ed288a278997824dc924d1f398852c21d41ee2c4c564f2fb4d26 + languageName: node + linkType: hard + +"@adraffy/ens-normalize@npm:^1.10.0": + version: 1.10.1 + resolution: "@adraffy/ens-normalize@npm:1.10.1" + checksum: 10c0/fdd647604e8fac6204921888aaf5a6bc65eabf0d2921bc5f93b64d01f4bc33ead167c1445f7de05468d05cd92ac31b74c68d2be840c62b79d73693308f885c06 + languageName: node + linkType: hard + "@babel/runtime@npm:^7.10.4, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.21.0, @babel/runtime@npm:^7.3.1": version: 7.24.5 resolution: "@babel/runtime@npm:7.24.5" @@ -61,6 +75,13 @@ __metadata: languageName: node linkType: hard +"@ensdomains/ens-validation@npm:^0.1.0": + version: 0.1.0 + resolution: "@ensdomains/ens-validation@npm:0.1.0" + checksum: 10c0/240a5b463b1c8bfefee4b010176618efe73beea2dab02cc28aeb27c72542dd73c1effc1bdd33709cb9093765449fa90d1f58a91bfc8f9771ea69ab482ad4f879 + languageName: node + linkType: hard + "@esbuild/aix-ppc64@npm:0.19.12": version: 0.19.12 resolution: "@esbuild/aix-ppc64@npm:0.19.12" @@ -1094,11 +1115,11 @@ __metadata: linkType: hard "@floating-ui/core@npm:^1.0.0, @floating-ui/core@npm:^1.5.3": - version: 1.6.1 - resolution: "@floating-ui/core@npm:1.6.1" + version: 1.6.2 + resolution: "@floating-ui/core@npm:1.6.2" dependencies: "@floating-ui/utils": "npm:^0.2.0" - checksum: 10c0/7d78b3788d438807d3c1a52477ee1693a29b8a4416dd6e13761427925d9fba1d45c849527752d8fd9776842182d919fddf7ecbc34f3bf2de3bafa1717619a56f + checksum: 10c0/db2621dc682e7f043d6f118d087ae6a6bfdacf40b26ede561760dd53548c16e2e7c59031e013e37283801fa307b55e6de65bf3b316b96a054e4a6a7cb937c59e languageName: node linkType: hard @@ -1113,24 +1134,24 @@ __metadata: linkType: hard "@floating-ui/dom@npm:^1.0.0": - version: 1.6.4 - resolution: "@floating-ui/dom@npm:1.6.4" + version: 1.6.5 + resolution: "@floating-ui/dom@npm:1.6.5" dependencies: "@floating-ui/core": "npm:^1.0.0" "@floating-ui/utils": "npm:^0.2.0" - checksum: 10c0/cee0b9e6efc1c6d978ec580c770078fdf416016fb03f3dd99630f7f32d0422722e608471fbc7578be86c783ad1c1e448c5fa5b9fdec889dfbf4b695f208730fd + checksum: 10c0/ebdc14806f786e60df8e7cc2c30bf9cd4d75fe734f06d755588bbdef2f60d0a0f21dffb14abdc58dea96e5577e2e366feca6d66ba962018efd1bc91a3ece4526 languageName: node linkType: hard "@floating-ui/react-dom@npm:^2.0.0": - version: 2.0.9 - resolution: "@floating-ui/react-dom@npm:2.0.9" + version: 2.1.0 + resolution: "@floating-ui/react-dom@npm:2.1.0" dependencies: "@floating-ui/dom": "npm:^1.0.0" peerDependencies: react: ">=16.8.0" react-dom: ">=16.8.0" - checksum: 10c0/d8cd1fb2b8a5012ca692d6f677a0af923ef81131f69accea8ce8b5413202ab4c3c79e6eda1446f4dad06a2dfd596ece748c562ba28c289678a856755db4f528f + checksum: 10c0/9ee44dfeb27f585fb1e0114cbe37c72ff5d34149900f4f3013f6b0abf8c3365eab13286c360f97fbe0c44bb91a745e7a4c18b82d111990b45a7a7796dc55e461 languageName: node linkType: hard @@ -1269,9 +1290,9 @@ __metadata: linkType: hard "@livekit/components-styles@npm:^1.0.6": - version: 1.0.11 - resolution: "@livekit/components-styles@npm:1.0.11" - checksum: 10c0/735cecc8e78d4ddc271108650dc04d0fa20b01f3b3ffe67dee4d659f1ab2455900909e1692383c269a41ca42f5b51f15b9d513d3a0cb7f1287e13a66ed33af5b + version: 1.0.12 + resolution: "@livekit/components-styles@npm:1.0.12" + checksum: 10c0/b6cc2f471468e5300243edbd56e036118e61d68418ca2396bb9869dc5e38f22e91bd81561dab9370a114ad6ec23302e055f02d017cd4da7033c85c151126c254 languageName: node linkType: hard @@ -1493,6 +1514,15 @@ __metadata: languageName: node linkType: hard +"@noble/curves@npm:1.2.0, @noble/curves@npm:~1.2.0": + version: 1.2.0 + resolution: "@noble/curves@npm:1.2.0" + dependencies: + "@noble/hashes": "npm:1.3.2" + checksum: 10c0/0bac7d1bbfb3c2286910b02598addd33243cb97c3f36f987ecc927a4be8d7d88e0fcb12b0f0ef8a044e7307d1844dd5c49bb724bfa0a79c8ec50ba60768c97f6 + languageName: node + linkType: hard + "@noble/curves@npm:1.3.0, @noble/curves@npm:~1.3.0": version: 1.3.0 resolution: "@noble/curves@npm:1.3.0" @@ -1502,7 +1532,14 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.3.3, @noble/hashes@npm:~1.3.2": +"@noble/hashes@npm:1.3.2": + version: 1.3.2 + resolution: "@noble/hashes@npm:1.3.2" + checksum: 10c0/2482cce3bce6a596626f94ca296e21378e7a5d4c09597cbc46e65ffacc3d64c8df73111f2265444e36a3168208628258bbbaccba2ef24f65f58b2417638a20e7 + languageName: node + linkType: hard + +"@noble/hashes@npm:1.3.3, @noble/hashes@npm:~1.3.0, @noble/hashes@npm:~1.3.2": version: 1.3.3 resolution: "@noble/hashes@npm:1.3.3" checksum: 10c0/23c020b33da4172c988e44100e33cd9f8f6250b68b43c467d3551f82070ebd9716e0d9d2347427aa3774c85934a35fa9ee6f026fca2117e3fa12db7bedae7668 @@ -1530,11 +1567,11 @@ __metadata: linkType: hard "@npmcli/fs@npm:^3.1.0": - version: 3.1.0 - resolution: "@npmcli/fs@npm:3.1.0" + version: 3.1.1 + resolution: "@npmcli/fs@npm:3.1.1" dependencies: semver: "npm:^7.3.5" - checksum: 10c0/162b4a0b8705cd6f5c2470b851d1dc6cd228c86d2170e1769d738c1fbb69a87160901411c3c035331e9e99db72f1f1099a8b734bf1637cc32b9a5be1660e4e1e + checksum: 10c0/c37a5b4842bfdece3d14dfdb054f73fe15ed2d3da61b34ff76629fb5b1731647c49166fd2a8bf8b56fcfa51200382385ea8909a3cbecdad612310c114d3f6c99 languageName: node linkType: hard @@ -1784,6 +1821,7 @@ __metadata: "@livepeer/react": "npm:^2.6.0" "@pushprotocol/socket": "npm:^0.5.0" "@unstoppabledomains/resolution": "npm:^8.5.0" + "@web3-name-sdk/core": "npm:^0.1.15" "@web3-onboard/coinbase": "npm:^2.2.5" "@web3-onboard/core": "npm:^2.21.1" "@web3-onboard/injected-wallets": "npm:^2.10.5" @@ -1811,7 +1849,7 @@ __metadata: react-twitter-embed: "npm:^4.0.4" uuid: "npm:^9.0.1" peerDependencies: - "@pushprotocol/restapi": 1.7.17 + "@pushprotocol/restapi": 1.7.19 "@pushprotocol/socket": ^0.5.0 react: ">=16.8.0" styled-components: ^6.0.8 @@ -2456,13 +2494,24 @@ __metadata: languageName: node linkType: hard -"@scure/base@npm:^1.1.3, @scure/base@npm:~1.1.4": +"@scure/base@npm:^1.1.3, @scure/base@npm:~1.1.0, @scure/base@npm:~1.1.2, @scure/base@npm:~1.1.4": version: 1.1.6 resolution: "@scure/base@npm:1.1.6" checksum: 10c0/237a46a1f45391fc57719154f14295db936a0b1562ea3e182dd42d7aca082dbb7062a28d6c49af16a7e478b12dae8a0fe678d921ea5056bcc30238d29eb05c55 languageName: node linkType: hard +"@scure/bip32@npm:1.3.2": + version: 1.3.2 + resolution: "@scure/bip32@npm:1.3.2" + dependencies: + "@noble/curves": "npm:~1.2.0" + "@noble/hashes": "npm:~1.3.2" + "@scure/base": "npm:~1.1.2" + checksum: 10c0/2e9c1ce67f72b6c3329483f5fd39fb43ba6dcf732ed7ac63b80fa96341d2bc4cad1ea4c75bfeb91e801968c00df48b577b015fd4591f581e93f0d91178e630ca + languageName: node + linkType: hard + "@scure/bip32@npm:1.3.3": version: 1.3.3 resolution: "@scure/bip32@npm:1.3.3" @@ -2474,6 +2523,16 @@ __metadata: languageName: node linkType: hard +"@scure/bip39@npm:1.2.1": + version: 1.2.1 + resolution: "@scure/bip39@npm:1.2.1" + dependencies: + "@noble/hashes": "npm:~1.3.0" + "@scure/base": "npm:~1.1.0" + checksum: 10c0/fe951f69dd5a7cdcefbe865bce1b160d6b59ba19bd01d09f0718e54fce37a7d8be158b32f5455f0e9c426a7fbbede3e019bf0baa99bacc88ef26a76a07e115d4 + languageName: node + linkType: hard + "@scure/bip39@npm:1.2.2": version: 1.2.2 resolution: "@scure/bip39@npm:1.2.2" @@ -2634,7 +2693,7 @@ __metadata: languageName: node linkType: hard -"@stablelib/random@npm:^1.0.1, @stablelib/random@npm:^1.0.2": +"@stablelib/random@npm:1.0.2, @stablelib/random@npm:^1.0.1, @stablelib/random@npm:^1.0.2": version: 1.0.2 resolution: "@stablelib/random@npm:1.0.2" dependencies: @@ -2673,7 +2732,7 @@ __metadata: languageName: node linkType: hard -"@stablelib/x25519@npm:^1.0.3": +"@stablelib/x25519@npm:1.0.3": version: 1.0.3 resolution: "@stablelib/x25519@npm:1.0.3" dependencies: @@ -2781,11 +2840,11 @@ __metadata: linkType: hard "@types/node@npm:>=13.7.0": - version: 20.12.11 - resolution: "@types/node@npm:20.12.11" + version: 20.12.12 + resolution: "@types/node@npm:20.12.12" dependencies: undici-types: "npm:~5.26.4" - checksum: 10c0/efaa7b08c50ba6e6982ac7d531ba08d5935539ba76e954807df1ff9382a319ead7e003ccaca5ad7cf33ecf53f212507f7c1f2794bd2ff52df6365fef21f6e1fb + checksum: 10c0/f374b763c744e8f16e4f38cf6e2c0eef31781ec9228c9e43a6f267880fea420fab0a238b59f10a7cb3444e49547c5e3785787e371fc242307310995b21988812 languageName: node linkType: hard @@ -2823,28 +2882,28 @@ __metadata: languageName: node linkType: hard -"@walletconnect/core@npm:2.12.2": - version: 2.12.2 - resolution: "@walletconnect/core@npm:2.12.2" +"@walletconnect/core@npm:2.13.0": + version: 2.13.0 + resolution: "@walletconnect/core@npm:2.13.0" dependencies: - "@walletconnect/heartbeat": "npm:1.2.1" - "@walletconnect/jsonrpc-provider": "npm:1.0.13" - "@walletconnect/jsonrpc-types": "npm:1.0.3" + "@walletconnect/heartbeat": "npm:1.2.2" + "@walletconnect/jsonrpc-provider": "npm:1.0.14" + "@walletconnect/jsonrpc-types": "npm:1.0.4" "@walletconnect/jsonrpc-utils": "npm:1.0.8" "@walletconnect/jsonrpc-ws-connection": "npm:1.0.14" - "@walletconnect/keyvaluestorage": "npm:^1.1.1" - "@walletconnect/logger": "npm:^2.1.2" - "@walletconnect/relay-api": "npm:^1.0.9" - "@walletconnect/relay-auth": "npm:^1.0.4" - "@walletconnect/safe-json": "npm:^1.0.2" - "@walletconnect/time": "npm:^1.0.2" - "@walletconnect/types": "npm:2.12.2" - "@walletconnect/utils": "npm:2.12.2" - events: "npm:^3.3.0" + "@walletconnect/keyvaluestorage": "npm:1.1.1" + "@walletconnect/logger": "npm:2.1.2" + "@walletconnect/relay-api": "npm:1.0.10" + "@walletconnect/relay-auth": "npm:1.0.4" + "@walletconnect/safe-json": "npm:1.0.2" + "@walletconnect/time": "npm:1.0.2" + "@walletconnect/types": "npm:2.13.0" + "@walletconnect/utils": "npm:2.13.0" + events: "npm:3.3.0" isomorphic-unfetch: "npm:3.1.0" lodash.isequal: "npm:4.5.0" - uint8arrays: "npm:^3.1.0" - checksum: 10c0/62feecfeb8c5557c9b2cbf28501df6403f02d87483a097df84fd1e1c9b42a5fc99b964a4d0ff4b3b48640bb7e57a8aabb43d23b104568d532f33b18ceb963302 + uint8arrays: "npm:3.1.0" + checksum: 10c0/e1356eb8ac94f8f6743814337607244557280d43a6e2ec14591beb21dca0e73cc79b16f0a2ace60ef447149778c5383a1fd4eac67788372d249c8c5f6d8c7dc2 languageName: node linkType: hard @@ -2858,24 +2917,24 @@ __metadata: linkType: hard "@walletconnect/ethereum-provider@npm:^2.12.2": - version: 2.12.2 - resolution: "@walletconnect/ethereum-provider@npm:2.12.2" + version: 2.13.0 + resolution: "@walletconnect/ethereum-provider@npm:2.13.0" dependencies: - "@walletconnect/jsonrpc-http-connection": "npm:^1.0.7" - "@walletconnect/jsonrpc-provider": "npm:^1.0.13" - "@walletconnect/jsonrpc-types": "npm:^1.0.3" - "@walletconnect/jsonrpc-utils": "npm:^1.0.8" - "@walletconnect/modal": "npm:^2.6.2" - "@walletconnect/sign-client": "npm:2.12.2" - "@walletconnect/types": "npm:2.12.2" - "@walletconnect/universal-provider": "npm:2.12.2" - "@walletconnect/utils": "npm:2.12.2" - events: "npm:^3.3.0" - checksum: 10c0/3b1b03a4b87823a0fca73cf3404f7be17d41e189aae209a17c45178a63731682ede59dbc813d8bf53ad38881a864f96c9923a79a5e53dddca621b5d369700845 + "@walletconnect/jsonrpc-http-connection": "npm:1.0.8" + "@walletconnect/jsonrpc-provider": "npm:1.0.14" + "@walletconnect/jsonrpc-types": "npm:1.0.4" + "@walletconnect/jsonrpc-utils": "npm:1.0.8" + "@walletconnect/modal": "npm:2.6.2" + "@walletconnect/sign-client": "npm:2.13.0" + "@walletconnect/types": "npm:2.13.0" + "@walletconnect/universal-provider": "npm:2.13.0" + "@walletconnect/utils": "npm:2.13.0" + events: "npm:3.3.0" + checksum: 10c0/4bc3c76b7a9e81ac505fcff99244bfa9f14419ee2de322e491dacd94669923adf5e9e1a2298ae84b33e3d5985a0bfab6b7715237e6f2ce23ec02c67dedb58898 languageName: node linkType: hard -"@walletconnect/events@npm:^1.0.1": +"@walletconnect/events@npm:1.0.1, @walletconnect/events@npm:^1.0.1": version: 1.0.1 resolution: "@walletconnect/events@npm:1.0.1" dependencies: @@ -2885,51 +2944,51 @@ __metadata: languageName: node linkType: hard -"@walletconnect/heartbeat@npm:1.2.1": - version: 1.2.1 - resolution: "@walletconnect/heartbeat@npm:1.2.1" +"@walletconnect/heartbeat@npm:1.2.2": + version: 1.2.2 + resolution: "@walletconnect/heartbeat@npm:1.2.2" dependencies: "@walletconnect/events": "npm:^1.0.1" "@walletconnect/time": "npm:^1.0.2" - tslib: "npm:1.14.1" - checksum: 10c0/5ad46f26dcb7b9b3227f004cd74b18741d4cd32c21825a036eb03985c67a0cf859c285bc5635401966a99129e854d72de3458ff592370575ef7e52f5dd12ebbc + events: "npm:^3.3.0" + checksum: 10c0/a97b07764c397fe3cd26e8ea4233ecc8a26049624df7edc05290d286266bc5ba1de740d12c50dc1b7e8605198c5974e34e2d5318087bd4e9db246e7b273f4592 languageName: node linkType: hard -"@walletconnect/jsonrpc-http-connection@npm:^1.0.7": - version: 1.0.7 - resolution: "@walletconnect/jsonrpc-http-connection@npm:1.0.7" +"@walletconnect/jsonrpc-http-connection@npm:1.0.8": + version: 1.0.8 + resolution: "@walletconnect/jsonrpc-http-connection@npm:1.0.8" dependencies: "@walletconnect/jsonrpc-utils": "npm:^1.0.6" "@walletconnect/safe-json": "npm:^1.0.1" cross-fetch: "npm:^3.1.4" - tslib: "npm:1.14.1" - checksum: 10c0/24272eca0d2b20397b2c83ecaac324cbc857fab4a4c2699332ea5c8b81096b1cf4a3c60f51c82ca9e98ab87a213c04bf047037478b089effabe0139005c71867 + events: "npm:^3.3.0" + checksum: 10c0/cfac9ae74085d383ebc6edf075aeff01312818ac95e706cb8538ef4d4e6d82e75fb51529b3a9b65fa56a3f0f32a1738defad61713ed8a5f67cee25a79b6b4614 languageName: node linkType: hard -"@walletconnect/jsonrpc-provider@npm:1.0.13, @walletconnect/jsonrpc-provider@npm:^1.0.13": - version: 1.0.13 - resolution: "@walletconnect/jsonrpc-provider@npm:1.0.13" +"@walletconnect/jsonrpc-provider@npm:1.0.14": + version: 1.0.14 + resolution: "@walletconnect/jsonrpc-provider@npm:1.0.14" dependencies: "@walletconnect/jsonrpc-utils": "npm:^1.0.8" "@walletconnect/safe-json": "npm:^1.0.2" - tslib: "npm:1.14.1" - checksum: 10c0/9b5b2f0ce516d2ddebe2cd1a2c8ea18a6b765b0d068162caf39745c18534e264a0cc6198adb869ba8684d0efa563be30956a3b9a7cc82b80b9e263f6211e30ab + events: "npm:^3.3.0" + checksum: 10c0/9801bd516d81e92977b6add213da91e0e4a7a5915ad22685a4d2a733bab6199e9053485b76340cd724c7faa17a1b0eb842696247944fd57fb581488a2e1bed75 languageName: node linkType: hard -"@walletconnect/jsonrpc-types@npm:1.0.3, @walletconnect/jsonrpc-types@npm:^1.0.2, @walletconnect/jsonrpc-types@npm:^1.0.3": - version: 1.0.3 - resolution: "@walletconnect/jsonrpc-types@npm:1.0.3" +"@walletconnect/jsonrpc-types@npm:1.0.4, @walletconnect/jsonrpc-types@npm:^1.0.2, @walletconnect/jsonrpc-types@npm:^1.0.3": + version: 1.0.4 + resolution: "@walletconnect/jsonrpc-types@npm:1.0.4" dependencies: + events: "npm:^3.3.0" keyvaluestorage-interface: "npm:^1.0.0" - tslib: "npm:1.14.1" - checksum: 10c0/a0fc8a88c62795bf4bf83d4e98a4e2cdd659ef70c73642582089fdf0994c54fd8050aa6cca85cfdcca6b77994e71334895e7a19649c325a8c822b059c2003884 + checksum: 10c0/752978685b0596a4ba02e1b689d23873e464460e4f376c97ef63e6b3ab273658ca062de2bfcaa8a498d31db0c98be98c8bbfbe5142b256a4b3ef425e1707f353 languageName: node linkType: hard -"@walletconnect/jsonrpc-utils@npm:1.0.8, @walletconnect/jsonrpc-utils@npm:^1.0.6, @walletconnect/jsonrpc-utils@npm:^1.0.7, @walletconnect/jsonrpc-utils@npm:^1.0.8": +"@walletconnect/jsonrpc-utils@npm:1.0.8, @walletconnect/jsonrpc-utils@npm:^1.0.6, @walletconnect/jsonrpc-utils@npm:^1.0.8": version: 1.0.8 resolution: "@walletconnect/jsonrpc-utils@npm:1.0.8" dependencies: @@ -2952,7 +3011,7 @@ __metadata: languageName: node linkType: hard -"@walletconnect/keyvaluestorage@npm:^1.1.1": +"@walletconnect/keyvaluestorage@npm:1.1.1": version: 1.1.1 resolution: "@walletconnect/keyvaluestorage@npm:1.1.1" dependencies: @@ -2968,7 +3027,7 @@ __metadata: languageName: node linkType: hard -"@walletconnect/logger@npm:^2.0.1, @walletconnect/logger@npm:^2.1.2": +"@walletconnect/logger@npm:2.1.2": version: 2.1.2 resolution: "@walletconnect/logger@npm:2.1.2" dependencies: @@ -2999,7 +3058,7 @@ __metadata: languageName: node linkType: hard -"@walletconnect/modal@npm:^2.6.2": +"@walletconnect/modal@npm:2.6.2": version: 2.6.2 resolution: "@walletconnect/modal@npm:2.6.2" dependencies: @@ -3009,7 +3068,7 @@ __metadata: languageName: node linkType: hard -"@walletconnect/relay-api@npm:^1.0.9": +"@walletconnect/relay-api@npm:1.0.10": version: 1.0.10 resolution: "@walletconnect/relay-api@npm:1.0.10" dependencies: @@ -3018,7 +3077,7 @@ __metadata: languageName: node linkType: hard -"@walletconnect/relay-auth@npm:^1.0.4": +"@walletconnect/relay-auth@npm:1.0.4": version: 1.0.4 resolution: "@walletconnect/relay-auth@npm:1.0.4" dependencies: @@ -3032,7 +3091,7 @@ __metadata: languageName: node linkType: hard -"@walletconnect/safe-json@npm:^1.0.1, @walletconnect/safe-json@npm:^1.0.2": +"@walletconnect/safe-json@npm:1.0.2, @walletconnect/safe-json@npm:^1.0.1, @walletconnect/safe-json@npm:^1.0.2": version: 1.0.2 resolution: "@walletconnect/safe-json@npm:1.0.2" dependencies: @@ -3041,24 +3100,24 @@ __metadata: languageName: node linkType: hard -"@walletconnect/sign-client@npm:2.12.2": - version: 2.12.2 - resolution: "@walletconnect/sign-client@npm:2.12.2" +"@walletconnect/sign-client@npm:2.13.0": + version: 2.13.0 + resolution: "@walletconnect/sign-client@npm:2.13.0" dependencies: - "@walletconnect/core": "npm:2.12.2" - "@walletconnect/events": "npm:^1.0.1" - "@walletconnect/heartbeat": "npm:1.2.1" + "@walletconnect/core": "npm:2.13.0" + "@walletconnect/events": "npm:1.0.1" + "@walletconnect/heartbeat": "npm:1.2.2" "@walletconnect/jsonrpc-utils": "npm:1.0.8" - "@walletconnect/logger": "npm:^2.1.2" - "@walletconnect/time": "npm:^1.0.2" - "@walletconnect/types": "npm:2.12.2" - "@walletconnect/utils": "npm:2.12.2" - events: "npm:^3.3.0" - checksum: 10c0/183f16eb4405086475c21e11b5b20ec3c00ba57dfe55cf1a489863ef850973916a42fb354c4f307557cd1b75d772e58de077bedddd0766f5254bc659df4aefbe + "@walletconnect/logger": "npm:2.1.2" + "@walletconnect/time": "npm:1.0.2" + "@walletconnect/types": "npm:2.13.0" + "@walletconnect/utils": "npm:2.13.0" + events: "npm:3.3.0" + checksum: 10c0/58c702997f719cab9b183d23c53efee561a3a407de24e464e339e350124a71eeccb1bd651f0893ad0f39343ce42a7ff3666bbd28cb8dfc6a0e8d12c94eacc288 languageName: node linkType: hard -"@walletconnect/time@npm:^1.0.2": +"@walletconnect/time@npm:1.0.2, @walletconnect/time@npm:^1.0.2": version: 1.0.2 resolution: "@walletconnect/time@npm:1.0.2" dependencies: @@ -3067,60 +3126,60 @@ __metadata: languageName: node linkType: hard -"@walletconnect/types@npm:2.12.2": - version: 2.12.2 - resolution: "@walletconnect/types@npm:2.12.2" +"@walletconnect/types@npm:2.13.0": + version: 2.13.0 + resolution: "@walletconnect/types@npm:2.13.0" dependencies: - "@walletconnect/events": "npm:^1.0.1" - "@walletconnect/heartbeat": "npm:1.2.1" - "@walletconnect/jsonrpc-types": "npm:1.0.3" - "@walletconnect/keyvaluestorage": "npm:^1.1.1" - "@walletconnect/logger": "npm:^2.0.1" - events: "npm:^3.3.0" - checksum: 10c0/9bc834aa41b59a5d9f19fdc2db15345568867635114b72b6dc23d93ba7040d3ad2ef742e6c7e5233d9fb747995d69103a9f1c75d368c8d3bce22c916e4dde748 + "@walletconnect/events": "npm:1.0.1" + "@walletconnect/heartbeat": "npm:1.2.2" + "@walletconnect/jsonrpc-types": "npm:1.0.4" + "@walletconnect/keyvaluestorage": "npm:1.1.1" + "@walletconnect/logger": "npm:2.1.2" + events: "npm:3.3.0" + checksum: 10c0/9962284daf92d6b27a009b90b908518b3f028f10f2168ddbc37ad2cb2b20cb0e65d170aa4343e2ea445c519cf79e78264480e2b2c4ab9f974f2c15962db5b012 languageName: node linkType: hard -"@walletconnect/universal-provider@npm:2.12.2": - version: 2.12.2 - resolution: "@walletconnect/universal-provider@npm:2.12.2" +"@walletconnect/universal-provider@npm:2.13.0": + version: 2.13.0 + resolution: "@walletconnect/universal-provider@npm:2.13.0" dependencies: - "@walletconnect/jsonrpc-http-connection": "npm:^1.0.7" - "@walletconnect/jsonrpc-provider": "npm:1.0.13" - "@walletconnect/jsonrpc-types": "npm:^1.0.2" - "@walletconnect/jsonrpc-utils": "npm:^1.0.7" - "@walletconnect/logger": "npm:^2.1.2" - "@walletconnect/sign-client": "npm:2.12.2" - "@walletconnect/types": "npm:2.12.2" - "@walletconnect/utils": "npm:2.12.2" - events: "npm:^3.3.0" - checksum: 10c0/d77a9ecbd0f5ec5f17fb1aa2909d657755faa28a01eb46adab5a23cadc267519ee550fc823146792c6701cd25d62eb3b5a1fd38ef7f42e444642320b4a0e31ba + "@walletconnect/jsonrpc-http-connection": "npm:1.0.8" + "@walletconnect/jsonrpc-provider": "npm:1.0.14" + "@walletconnect/jsonrpc-types": "npm:1.0.4" + "@walletconnect/jsonrpc-utils": "npm:1.0.8" + "@walletconnect/logger": "npm:2.1.2" + "@walletconnect/sign-client": "npm:2.13.0" + "@walletconnect/types": "npm:2.13.0" + "@walletconnect/utils": "npm:2.13.0" + events: "npm:3.3.0" + checksum: 10c0/79d14cdce74054859f26f69a17215c59367d961d0f36e7868601ed98030bd0636b3806dd68b76cc66ec4a70d5f6ec107fbe18bb6a1022a5161ea6d71810a0ed9 languageName: node linkType: hard -"@walletconnect/utils@npm:2.12.2": - version: 2.12.2 - resolution: "@walletconnect/utils@npm:2.12.2" +"@walletconnect/utils@npm:2.13.0": + version: 2.13.0 + resolution: "@walletconnect/utils@npm:2.13.0" dependencies: "@stablelib/chacha20poly1305": "npm:1.0.1" "@stablelib/hkdf": "npm:1.0.1" - "@stablelib/random": "npm:^1.0.2" + "@stablelib/random": "npm:1.0.2" "@stablelib/sha256": "npm:1.0.1" - "@stablelib/x25519": "npm:^1.0.3" - "@walletconnect/relay-api": "npm:^1.0.9" - "@walletconnect/safe-json": "npm:^1.0.2" - "@walletconnect/time": "npm:^1.0.2" - "@walletconnect/types": "npm:2.12.2" - "@walletconnect/window-getters": "npm:^1.0.1" - "@walletconnect/window-metadata": "npm:^1.0.1" + "@stablelib/x25519": "npm:1.0.3" + "@walletconnect/relay-api": "npm:1.0.10" + "@walletconnect/safe-json": "npm:1.0.2" + "@walletconnect/time": "npm:1.0.2" + "@walletconnect/types": "npm:2.13.0" + "@walletconnect/window-getters": "npm:1.0.1" + "@walletconnect/window-metadata": "npm:1.0.1" detect-browser: "npm:5.3.0" query-string: "npm:7.1.3" - uint8arrays: "npm:^3.1.0" - checksum: 10c0/fbfb67ff6092a6c14dd517ce9053882620c5c18a743adc52039d9fa06646f62edacc8c602c8a0f69d7ade3a43d86a6dac25fd43103962bc7d41d19eb2f937da7 + uint8arrays: "npm:3.1.0" + checksum: 10c0/2dbdb9ed790492411eb5c4e6b06aa511f6c0204c4ff283ecb5a4d339bb1bf3da033ef3a0c0af66b94df0553676f408222c2feca8c601b0554be2bbfbef43d6ec languageName: node linkType: hard -"@walletconnect/window-getters@npm:^1.0.1": +"@walletconnect/window-getters@npm:1.0.1, @walletconnect/window-getters@npm:^1.0.1": version: 1.0.1 resolution: "@walletconnect/window-getters@npm:1.0.1" dependencies: @@ -3129,7 +3188,7 @@ __metadata: languageName: node linkType: hard -"@walletconnect/window-metadata@npm:^1.0.1": +"@walletconnect/window-metadata@npm:1.0.1": version: 1.0.1 resolution: "@walletconnect/window-metadata@npm:1.0.1" dependencies: @@ -3139,6 +3198,23 @@ __metadata: languageName: node linkType: hard +"@web3-name-sdk/core@npm:^0.1.15": + version: 0.1.18 + resolution: "@web3-name-sdk/core@npm:0.1.18" + dependencies: + "@adraffy/ens-normalize": "npm:^1.10.0" + "@ensdomains/ens-validation": "npm:^0.1.0" + viem: "npm:^1.20" + peerDependencies: + "@bonfida/spl-name-service": ^1.4.0 + "@sei-js/core": ^3.1.0 + "@siddomains/injective-sidjs": 0.0.2-beta + "@siddomains/sei-sidjs": ^0.0.4 + "@solana/web3.js": ^1.75.0 + checksum: 10c0/2f2c4611ba1868fbd683ec2249d2581d31aafaa24bdc187a1fd437cf08ffb13dcfda637b6b322afa12d6aea799c5a1fccbd03aacb808218fe315938be4005fd6 + languageName: node + linkType: hard + "@web3-onboard/coinbase@npm:^2.2.5": version: 2.2.7 resolution: "@web3-onboard/coinbase@npm:2.2.7" @@ -3182,13 +3258,13 @@ __metadata: linkType: hard "@web3-onboard/injected-wallets@npm:^2.10.5": - version: 2.10.16 - resolution: "@web3-onboard/injected-wallets@npm:2.10.16" + version: 2.10.17 + resolution: "@web3-onboard/injected-wallets@npm:2.10.17" dependencies: "@web3-onboard/common": "npm:^2.3.3" joi: "npm:17.9.1" lodash.uniqby: "npm:^4.7.0" - checksum: 10c0/0f75bc19e73c5e0b7d9547eae95c8f6a4b9961c75a1111095fd4788c3f1e6855a8a931133594dd2d91af421e82c0718fef5329906f9afb4e00579852e07825a2 + checksum: 10c0/b589d04b22b7678349da12f64f5f06451dcdd658465e2ec12224eeac724845116ed45662ba1399bec6a83af698c217e6c75237aaa34a05224ce8eb242eea7764 languageName: node linkType: hard @@ -3251,6 +3327,21 @@ __metadata: languageName: node linkType: hard +"abitype@npm:0.9.8": + version: 0.9.8 + resolution: "abitype@npm:0.9.8" + peerDependencies: + typescript: ">=5.0.4" + zod: ^3 >=3.19.1 + peerDependenciesMeta: + typescript: + optional: true + zod: + optional: true + checksum: 10c0/ec559461d901d456820faf307e21b2c129583d44f4c68257ed9d0d44eae461114a7049046e715e069bc6fa70c410f644e06bdd2c798ac30d0ada794cd2a6c51e + languageName: node + linkType: hard + "acorn@npm:^8.11.3": version: 8.11.3 resolution: "acorn@npm:8.11.3" @@ -3421,14 +3512,14 @@ __metadata: linkType: hard "bnc-sdk@npm:^4.6.7": - version: 4.6.8 - resolution: "bnc-sdk@npm:4.6.8" + version: 4.6.9 + resolution: "bnc-sdk@npm:4.6.9" dependencies: crypto-es: "npm:^1.2.2" nanoid: "npm:^3.3.1" rxjs: "npm:^6.6.3" sturdy-websocket: "npm:^0.1.12" - checksum: 10c0/3b1966830195e8ec1362f6ae06b414209ae76bea77e59fd34116d7695960ccab6df732b571b4f07529d2f8754331daea59f874f6fe4bb90f32baa4e58b32d2ce + checksum: 10c0/34cc0d85ac244f71e0a7285b1c821b979f6456c5d1b3e45d889503937910cf99a413be93489b7d22986bfc6dc306c4a4fc2cf0b9b85d87c8a4c3e2f5d87528b2 languageName: node linkType: hard @@ -3448,12 +3539,12 @@ __metadata: languageName: node linkType: hard -"braces@npm:^3.0.2, braces@npm:~3.0.2": - version: 3.0.2 - resolution: "braces@npm:3.0.2" +"braces@npm:^3.0.3, braces@npm:~3.0.2": + version: 3.0.3 + resolution: "braces@npm:3.0.3" dependencies: - fill-range: "npm:^7.0.1" - checksum: 10c0/321b4d675791479293264019156ca322163f02dc06e3c4cab33bb15cd43d80b51efef69b0930cfde3acd63d126ebca24cd0544fa6f261e093a0fb41ab9dda381 + fill-range: "npm:^7.1.1" + checksum: 10c0/7c6dfd30c338d2997ba77500539227b9d1f85e388a5f43220865201e407e076783d0881f2d297b9f80951b4c957fcf0b51c1d2d24227631643c3f7c284b0aa04 languageName: node linkType: hard @@ -3689,9 +3780,9 @@ __metadata: linkType: hard "core-js@npm:^3.31.1": - version: 3.37.0 - resolution: "core-js@npm:3.37.0" - checksum: 10c0/7e00331f346318ca3f595c08ce9e74ddae744715aef137486c1399163afd79792fb94c3161280863adfdc3e30f8026912d56bd3036f93cacfc689d33e185f2ee + version: 3.37.1 + resolution: "core-js@npm:3.37.1" + checksum: 10c0/440eb51a7a39128a320225fe349f870a3641b96c9ecd26470227db730ef8c161ea298eaea621db66ec0ff622a85299efb4e23afebf889c0a1748616102307675 languageName: node linkType: hard @@ -3982,13 +4073,13 @@ __metadata: linkType: hard "emoji-picker-react@npm:^4.4.9": - version: 4.9.2 - resolution: "emoji-picker-react@npm:4.9.2" + version: 4.9.3 + resolution: "emoji-picker-react@npm:4.9.3" dependencies: flairup: "npm:0.0.38" peerDependencies: react: ">=16" - checksum: 10c0/f0294a8c8444bf26bceb1dc9fca45bfeb2be07aa5ede36e43efe79fc0cfebca798d08242b3c310f2704cb275803de82c70ddf1c4227922eca5011e4622e04a8c + checksum: 10c0/00c814a45e4f6b57cc0eea298069b044a6de2f4d32e241ab85cf887bc5202111b53a3fbf4d1c2989004cf2b3708401c0e76557f2118ba2b0a74ca4ede37f82d2 languageName: node linkType: hard @@ -4418,7 +4509,7 @@ __metadata: languageName: node linkType: hard -"events@npm:^3.3.0": +"events@npm:3.3.0, events@npm:^3.3.0": version: 3.3.0 resolution: "events@npm:3.3.0" checksum: 10c0/d6b6f2adbccbcda74ddbab52ed07db727ef52e31a61ed26db9feb7dc62af7fc8e060defa65e5f8af9449b86b52cc1a1f6a79f2eafcf4e62add2b7a1fa4a432f6 @@ -4481,12 +4572,12 @@ __metadata: languageName: node linkType: hard -"fill-range@npm:^7.0.1": - version: 7.0.1 - resolution: "fill-range@npm:7.0.1" +"fill-range@npm:^7.1.1": + version: 7.1.1 + resolution: "fill-range@npm:7.1.1" dependencies: to-regex-range: "npm:^5.0.1" - checksum: 10c0/7cdad7d426ffbaadf45aeb5d15ec675bbd77f7597ad5399e3d2766987ed20bda24d5fac64b3ee79d93276f5865608bb22344a26b9b1ae6c4d00bd94bf611623f + checksum: 10c0/b75b691bbe065472f38824f694c2f7449d7f5004aa950426a2c28f0306c60db9b880c0b0e4ed819997ffb882d1da02cfcfc819bddc94d71627f5269682edf018 languageName: node linkType: hard @@ -4649,17 +4740,17 @@ __metadata: linkType: hard "glob@npm:^10.2.2, glob@npm:^10.3.10": - version: 10.3.12 - resolution: "glob@npm:10.3.12" + version: 10.4.1 + resolution: "glob@npm:10.4.1" dependencies: foreground-child: "npm:^3.1.0" - jackspeak: "npm:^2.3.6" - minimatch: "npm:^9.0.1" - minipass: "npm:^7.0.4" - path-scurry: "npm:^1.10.2" + jackspeak: "npm:^3.1.2" + minimatch: "npm:^9.0.4" + minipass: "npm:^7.1.2" + path-scurry: "npm:^1.11.1" bin: glob: dist/esm/bin.mjs - checksum: 10c0/f60cefdc1cf3f958b2bb5823e1b233727f04916d489dc4641d76914f016e6704421e06a83cbb68b0cb1cb9382298b7a88075b844ad2127fc9727ea22b18b0711 + checksum: 10c0/77f2900ed98b9cc2a0e1901ee5e476d664dae3cd0f1b662b8bfd4ccf00d0edc31a11595807706a274ca10e1e251411bbf2e8e976c82bed0d879a9b89343ed379 languageName: node linkType: hard @@ -4945,9 +5036,9 @@ __metadata: linkType: hard "iron-webcrypto@npm:^1.0.0": - version: 1.1.1 - resolution: "iron-webcrypto@npm:1.1.1" - checksum: 10c0/a1b3a45044f36c4b1d191164c3395de86396ed316b7a69569efd1e72fc695143dc667f38f048595b8d59a2034b98de727c04ef0b049a4caab8077cfc440c38aa + version: 1.2.1 + resolution: "iron-webcrypto@npm:1.2.1" + checksum: 10c0/5cf27c6e2bd3ef3b4970e486235fd82491ab8229e2ed0ac23307c28d6c80d721772a86ed4e9fe2a5cabadd710c2f024b706843b40561fb83f15afee58f809f66 languageName: node linkType: hard @@ -5120,16 +5211,25 @@ __metadata: languageName: node linkType: hard -"jackspeak@npm:^2.3.6": - version: 2.3.6 - resolution: "jackspeak@npm:2.3.6" +"isows@npm:1.0.3": + version: 1.0.3 + resolution: "isows@npm:1.0.3" + peerDependencies: + ws: "*" + checksum: 10c0/adec15db704bb66615dd8ef33f889d41ae2a70866b21fa629855da98cc82a628ae072ee221fe9779a9a19866cad2a3e72593f2d161a0ce0e168b4484c7df9cd2 + languageName: node + linkType: hard + +"jackspeak@npm:^3.1.2": + version: 3.1.2 + resolution: "jackspeak@npm:3.1.2" dependencies: "@isaacs/cliui": "npm:^8.0.2" "@pkgjs/parseargs": "npm:^0.11.0" dependenciesMeta: "@pkgjs/parseargs": optional: true - checksum: 10c0/f01d8f972d894cd7638bc338e9ef5ddb86f7b208ce177a36d718eac96ec86638a6efa17d0221b10073e64b45edc2ce15340db9380b1f5d5c5d000cbc517dc111 + checksum: 10c0/5f1922a1ca0f19869e23f0dc4374c60d36e922f7926c76fecf8080cc6f7f798d6a9caac1b9428327d14c67731fd551bb3454cb270a5e13a0718f3b3660ec3d5d languageName: node linkType: hard @@ -5501,15 +5601,6 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^6.0.0": - version: 6.0.0 - resolution: "lru-cache@npm:6.0.0" - dependencies: - yallist: "npm:^4.0.0" - checksum: 10c0/cb53e582785c48187d7a188d3379c181b5ca2a9c78d2bce3e7dee36f32761d1c42983da3fe12b55cb74e1779fa94cdc2e5367c028a9b35317184ede0c07a30a9 - languageName: node - linkType: hard - "lru-queue@npm:^0.1.0": version: 0.1.0 resolution: "lru-queue@npm:0.1.0" @@ -5577,12 +5668,12 @@ __metadata: linkType: hard "micromatch@npm:^4.0.5": - version: 4.0.5 - resolution: "micromatch@npm:4.0.5" + version: 4.0.7 + resolution: "micromatch@npm:4.0.7" dependencies: - braces: "npm:^3.0.2" + braces: "npm:^3.0.3" picomatch: "npm:^2.3.1" - checksum: 10c0/3d6505b20f9fa804af5d8c596cb1c5e475b9b0cd05f652c5b56141cf941bd72adaeb7a436fda344235cef93a7f29b7472efc779fcdb83b478eab0867b95cdeff + checksum: 10c0/58fa99bc5265edec206e9163a1d2cec5fabc46a5b473c45f4a700adce88c2520456ae35f2b301e4410fb3afb27e9521fb2813f6fc96be0a48a89430e0916a772 languageName: node linkType: hard @@ -5625,7 +5716,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^9.0.1": +"minimatch@npm:^9.0.4": version: 9.0.4 resolution: "minimatch@npm:9.0.4" dependencies: @@ -5708,10 +5799,17 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.2, minipass@npm:^7.0.3, minipass@npm:^7.0.4": - version: 7.1.0 - resolution: "minipass@npm:7.1.0" - checksum: 10c0/6861c6ec9dc3cb99c745b287d92b2a8f409951852940205b4bb106faceb790544288622a0db7aa152f37793e2fc8f303628787883d9a679f2126605204feb97f +"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0": + version: 7.1.1 + resolution: "minipass@npm:7.1.1" + checksum: 10c0/fdccc2f99c31083f45f881fd1e6971d798e333e078ab3c8988fb818c470fbd5e935388ad9adb286397eba50baebf46ef8ff487c8d3f455a69c6f3efc327bdff9 + languageName: node + linkType: hard + +"minipass@npm:^7.0.2, minipass@npm:^7.0.3, minipass@npm:^7.1.2": + version: 7.1.2 + resolution: "minipass@npm:7.1.2" + checksum: 10c0/b0fd20bb9fb56e5fa9a8bfac539e8915ae07430a619e4b86ff71f5fc757ef3924b23b2c4230393af1eda647ed3d75739e4e0acb250a6b1eb277cf7f8fe449557 languageName: node linkType: hard @@ -5734,15 +5832,15 @@ __metadata: languageName: node linkType: hard -"mlly@npm:^1.6.1": - version: 1.6.1 - resolution: "mlly@npm:1.6.1" +"mlly@npm:^1.6.1, mlly@npm:^1.7.0": + version: 1.7.0 + resolution: "mlly@npm:1.7.0" dependencies: acorn: "npm:^8.11.3" pathe: "npm:^1.1.2" - pkg-types: "npm:^1.0.3" - ufo: "npm:^1.3.2" - checksum: 10c0/a7bf26b3d4f83b0f5a5232caa3af44be08b464f562f31c11d885d1bc2d43b7d717137d47b0c06fdc69e1b33ffc09f902b6d2b18de02c577849d40914e8785092 + pkg-types: "npm:^1.1.0" + ufo: "npm:^1.5.3" + checksum: 10c0/0b90e5b86e35897fd830624635b30052d0dfeb01b62a021fff4c0a5f46fbc617db685acfbc8c1c7cdcf687d9ffb8d54f3c1b0087ab953232cb3c158a2fb2d770 languageName: node linkType: hard @@ -5881,13 +5979,13 @@ __metadata: linkType: hard "node-gyp-build@npm:^4.2.0": - version: 4.8.0 - resolution: "node-gyp-build@npm:4.8.0" + version: 4.8.1 + resolution: "node-gyp-build@npm:4.8.1" bin: node-gyp-build: bin.js node-gyp-build-optional: optional.js node-gyp-build-test: build-test.js - checksum: 10c0/85324be16f81f0235cbbc42e3eceaeb1b5ab94c8d8f5236755e1435b4908338c65a4e75f66ee343cbcb44ddf9b52a428755bec16dcd983295be4458d95c8e1ad + checksum: 10c0/e36ca3d2adf2b9cca316695d7687207c19ac6ed326d6d7c68d7112cebe0de4f82d6733dff139132539fcc01cf5761f6c9082a21864ab9172edf84282bc849ce7 languageName: node linkType: hard @@ -6087,17 +6185,7 @@ __metadata: languageName: node linkType: hard -"path-scurry@npm:^1.10.2": - version: 1.10.2 - resolution: "path-scurry@npm:1.10.2" - dependencies: - lru-cache: "npm:^10.2.0" - minipass: "npm:^5.0.0 || ^6.0.2 || ^7.0.0" - checksum: 10c0/d723777fbf9627f201e64656680f66ebd940957eebacf780e6cce1c2919c29c116678b2d7dbf8821b3a2caa758d125f4444005ccec886a25c8f324504e48e601 - languageName: node - linkType: hard - -"path-scurry@npm:^1.6.1": +"path-scurry@npm:^1.11.1, path-scurry@npm:^1.6.1": version: 1.11.1 resolution: "path-scurry@npm:1.11.1" dependencies: @@ -6122,9 +6210,9 @@ __metadata: linkType: hard "picocolors@npm:^1.0.0": - version: 1.0.0 - resolution: "picocolors@npm:1.0.0" - checksum: 10c0/20a5b249e331c14479d94ec6817a182fd7a5680debae82705747b2db7ec50009a5f6648d0621c561b0572703f84dbef0858abcbd5856d3c5511426afcb1961f7 + version: 1.0.1 + resolution: "picocolors@npm:1.0.1" + checksum: 10c0/c63cdad2bf812ef0d66c8db29583802355d4ca67b9285d846f390cc15c2f6ccb94e8cb7eb6a6e97fc5990a6d3ad4ae42d86c84d3146e667c739a4234ed50d400 languageName: node linkType: hard @@ -6187,14 +6275,14 @@ __metadata: languageName: node linkType: hard -"pkg-types@npm:^1.0.3": - version: 1.1.0 - resolution: "pkg-types@npm:1.1.0" +"pkg-types@npm:^1.1.0": + version: 1.1.1 + resolution: "pkg-types@npm:1.1.1" dependencies: confbox: "npm:^0.1.7" - mlly: "npm:^1.6.1" + mlly: "npm:^1.7.0" pathe: "npm:^1.1.2" - checksum: 10c0/b350da13d2dab7dc2fa9d65a08a2038d841d8d8c94bf3878dd911a522e20da50d6662bab510fa329e363e403892374b3b847ebf7b3e10011805cdefb00f228fd + checksum: 10c0/c7d167935de7207479e5829086040d70bea289f31fc1331f17c83e996a4440115c9deba2aa96de839ea66e1676d083c9ca44b33886f87bffa6b49740b67b6fcb languageName: node linkType: hard @@ -6240,9 +6328,9 @@ __metadata: linkType: hard "preact@npm:^10.16.0": - version: 10.21.0 - resolution: "preact@npm:10.21.0" - checksum: 10c0/1f3cfcb5ca83b780b53593bcb917ae2e8d10a37405c32fb6774be1b5f1f3167d2156bd22c058627388330acc54da35fe8d4bbe7d38ae567a10e5d8fd943a1a06 + version: 10.22.0 + resolution: "preact@npm:10.22.0" + checksum: 10c0/dc5466c5968c56997e917580c00983cec2f6486a89ea9ba29f1bb88dcfd2f9ff67c8d561a69a1b3acdab17f2bb36b311fef0c348b62e89c332d00c674f7871f0 languageName: node linkType: hard @@ -6760,13 +6848,11 @@ __metadata: linkType: hard "semver@npm:^7.3.5, semver@npm:^7.3.8, semver@npm:^7.5.4": - version: 7.6.0 - resolution: "semver@npm:7.6.0" - dependencies: - lru-cache: "npm:^6.0.0" + version: 7.6.2 + resolution: "semver@npm:7.6.2" bin: semver: bin/semver.js - checksum: 10c0/fbfe717094ace0aa8d6332d7ef5ce727259815bd8d8815700853f4faf23aacbd7192522f0dc5af6df52ef4fa85a355ebd2f5d39f554bd028200d6cf481ab9b53 + checksum: 10c0/97d3441e97ace8be4b1976433d1c32658f6afaff09f143e52c593bae7eef33de19e3e369c88bd985ce1042c6f441c80c6803078d1de2a9988080b66684cbb30c languageName: node linkType: hard @@ -7235,14 +7321,23 @@ __metadata: languageName: node linkType: hard -"ufo@npm:^1.3.2, ufo@npm:^1.4.0, ufo@npm:^1.5.3": +"ufo@npm:^1.4.0, ufo@npm:^1.5.3": version: 1.5.3 resolution: "ufo@npm:1.5.3" checksum: 10c0/1df10702582aa74f4deac4486ecdfd660e74be057355f1afb6adfa14243476cf3d3acff734ccc3d0b74e9bfdefe91d578f3edbbb0a5b2430fe93cd672370e024 languageName: node linkType: hard -"uint8arrays@npm:^3.0.0, uint8arrays@npm:^3.1.0": +"uint8arrays@npm:3.1.0": + version: 3.1.0 + resolution: "uint8arrays@npm:3.1.0" + dependencies: + multiformats: "npm:^9.4.2" + checksum: 10c0/e54e64593a76541330f0fea97b1b5dea6becbbec3572b9bb88863d064f2630bede4d42eafd457f19c6ef9125f50bfc61053d519c4d71b59c3b7566a0691e3ba2 + languageName: node + linkType: hard + +"uint8arrays@npm:^3.0.0": version: 3.1.1 resolution: "uint8arrays@npm:3.1.1" dependencies: @@ -7494,6 +7589,27 @@ __metadata: languageName: node linkType: hard +"viem@npm:^1.20": + version: 1.21.4 + resolution: "viem@npm:1.21.4" + dependencies: + "@adraffy/ens-normalize": "npm:1.10.0" + "@noble/curves": "npm:1.2.0" + "@noble/hashes": "npm:1.3.2" + "@scure/bip32": "npm:1.3.2" + "@scure/bip39": "npm:1.2.1" + abitype: "npm:0.9.8" + isows: "npm:1.0.3" + ws: "npm:8.13.0" + peerDependencies: + typescript: ">=5.0.4" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/8b29c790181e44c4c95b9ffed1a8c1b6c2396eb949b95697cc390ca8c49d88ef9e2cd56bd4800b90a9bbc93681ae8d63045fc6fa06e00d84f532bef77967e751 + languageName: node + linkType: hard + "webidl-conversions@npm:^3.0.0": version: 3.0.1 resolution: "webidl-conversions@npm:3.0.1" @@ -7604,6 +7720,21 @@ __metadata: languageName: node linkType: hard +"ws@npm:8.13.0": + version: 8.13.0 + resolution: "ws@npm:8.13.0" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ">=5.0.2" + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: 10c0/579817dbbab3ee46669129c220cfd81ba6cdb9ab5c3e9a105702dd045743c4ab72e33bb384573827c0c481213417cc880e41bc097e0fc541a0b79fa3eb38207d + languageName: node + linkType: hard + "ws@npm:^7.5.1": version: 7.5.9 resolution: "ws@npm:7.5.9" From d3830aa403ce3c0d47b2927697ab40906fa08ec7 Mon Sep 17 00:00:00 2001 From: Rohit Malhotra Date: Fri, 31 May 2024 15:18:55 +0530 Subject: [PATCH 3/7] Main Release 1.3.7 - Build error fixed (#1335) --- .../components/notification/chainDetails.tsx | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/uiweb/src/lib/components/notification/chainDetails.tsx b/packages/uiweb/src/lib/components/notification/chainDetails.tsx index 479f3ddd5..60f9e8273 100644 --- a/packages/uiweb/src/lib/components/notification/chainDetails.tsx +++ b/packages/uiweb/src/lib/components/notification/chainDetails.tsx @@ -12,9 +12,7 @@ import { TheGraphSvg } from '../../icons/TheGraphSvg'; import LineaSVG from '../../icons/LineaSVG'; import { CyberConnectSVG } from '../../icons/CyberConnectSVG'; const createSVGIcon = (element: any, chainName: string) => { - return ( - {element} - ); + return {element}; }; export default { @@ -84,21 +82,21 @@ export default { BERACHAIN_TESTNET: { label: 'BERACHAIN TESTNET', icon: createSVGIcon(, 'Berachain Testnet'), - }, + }, CYBER_CONNECT_TESTNET: { label: 'CYBER CONNECT TESTNET', - icon: createSVGIcon(, 'CyberConnect Testnet'), + icon: createSVGIcon(, 'CyberConnect Testnet'), }, - LINEA_TESTNET : { + LINEA_TESTNET: { label: 'LINEA TESTNET', - icon: createSVGIcon(, 'Linea Testnet'), + icon: createSVGIcon(, 'Linea Testnet'), }, - LIENA_MAINNET : { - label: 'LIENA MAINNET', - icon: createSVGIcon(, 'Linea Mainnet'), + LINEA_MAINNET: { + label: 'LINEA MAINNET', + icon: createSVGIcon(, 'Linea Mainnet'), }, CYBER_CONNECT_MAINNET: { label: 'CYBER CONNECT MAINNET', - icon: createSVGIcon(, 'CyberConnect Mainnet'), - } + icon: createSVGIcon(, 'CyberConnect Mainnet'), + }, }; From c842ac1a5785e8a650d4cf4bf4f2a1a5caa98249 Mon Sep 17 00:00:00 2001 From: Ashis Kumar Pradhan <38760485+akp111@users.noreply.github.com> Date: Thu, 6 Jun 2024 21:26:24 +0530 Subject: [PATCH 4/7] fix: enabled base network (#1340) --- .../src/app/components/Connect.tsx | 7 +- .../sdk-frontend-react/src/app/helpers.ts | 2 +- packages/restapi/src/lib/config.ts | 72 ++++++++++++--- packages/restapi/src/lib/constants.ts | 2 +- .../restapi/src/lib/payloads/constants.ts | 6 +- packages/restapi/tests/.env.sample | 1 + packages/restapi/tests/lib/alias/base.test.ts | 87 ++++++++++++++++++ packages/uiweb/README.md | 2 +- .../chat/constants/chainDetails.tsx | 91 ++++++++++--------- .../components/notification/chainDetails.tsx | 11 ++- .../src/lib/components/notification/index.tsx | 2 + packages/uiweb/src/lib/config/constants.ts | 6 ++ packages/uiweb/src/lib/icons/LineaSVG.tsx | 4 +- packages/uiweb/src/lib/icons/base.svg | 6 ++ packages/uiweb/src/lib/icons/baseSVG.tsx | 17 ++++ 15 files changed, 252 insertions(+), 64 deletions(-) create mode 100644 packages/restapi/tests/lib/alias/base.test.ts create mode 100644 packages/uiweb/src/lib/icons/base.svg create mode 100644 packages/uiweb/src/lib/icons/baseSVG.tsx diff --git a/packages/examples/sdk-frontend-react/src/app/components/Connect.tsx b/packages/examples/sdk-frontend-react/src/app/components/Connect.tsx index a41a755f6..c80d25357 100644 --- a/packages/examples/sdk-frontend-react/src/app/components/Connect.tsx +++ b/packages/examples/sdk-frontend-react/src/app/components/Connect.tsx @@ -27,13 +27,16 @@ const NETWORK_MAPPING: NwMappingType = { 59141: 'LINEA_TESTNET', 59144: 'LINEA_MAINNET', 111557560: 'CYBER_CONNECT_TESTNET', - 7560: 'CYBER_CONNECT_MAINNET' + 7560: 'CYBER_CONNECT_MAINNET', + 84532: 'BASE_TESTNET', + 8453: 'BASE_MAINNET', + }; const injected = new InjectedConnector({ supportedChainIds: [ 1, 3, 4, 11155111, 42, 137, 80002, 56, 97, 10, 11155420, 2442, 1101, 421614, - 42161, 122, 123, 80085, 59144, 59141, 111557560, 7560 + 42161, 122, 123, 80085, 59144, 59141, 111557560, 7560, 84532, 8453, ], }); diff --git a/packages/examples/sdk-frontend-react/src/app/helpers.ts b/packages/examples/sdk-frontend-react/src/app/helpers.ts index 8b79768a7..9d8883312 100644 --- a/packages/examples/sdk-frontend-react/src/app/helpers.ts +++ b/packages/examples/sdk-frontend-react/src/app/helpers.ts @@ -20,7 +20,7 @@ const Constants = { DEV_CHAIN_ID: 99999, NON_ETH_CHAINS: [ 137, 80002, 56, 97, 10, 11155420, 2442, 1101, 421614, 42161, 122, 123, - 80085, 59141, 59144,111557560, 7560 + 80085, 59141, 59144,111557560, 7560, 84532, 8453, ], ETH_CHAINS: [1, 11155111], }; diff --git a/packages/restapi/src/lib/config.ts b/packages/restapi/src/lib/config.ts index 15751ea54..235bb709f 100644 --- a/packages/restapi/src/lib/config.ts +++ b/packages/restapi/src/lib/config.ts @@ -16,6 +16,8 @@ import { fuse, fuseSparknet, linea, + base, + baseSepolia } from 'viem/chains'; import { berachainTestnet, polygonAmoy, polygonZkEvmCordona, cyberConnectMainnet, cyberConnectTestnet, lineaSepoliaTestnet } from './customChains'; @@ -51,7 +53,9 @@ const BLOCKCHAIN_NETWORK = { LINEA_MAINNET: 'eip155:59144', LINEA_TESTNET: 'eip155:59141', CYBER_CONNECT_TESTNET: 'eip155:111557560', - CYBER_CONNECT_MAINNET: 'eip155:7560' + CYBER_CONNECT_MAINNET: 'eip155:7560', + BASE_TESTNET: 'eip155:84532', + BASE_MAINNET: 'eip155:8453', }; export type ALIAS_CHAIN = @@ -63,7 +67,8 @@ export type ALIAS_CHAIN = | 'FUSE' | 'BERACHAIN' | 'LINEA' - | 'CYBERCONNECT'; + | 'CYBERCONNECT' + | 'BASE'; export const ETH_CHAIN_ID = { [ENV.PROD]: 1, @@ -127,7 +132,13 @@ export const ALIAS_CHAIN_ID: { [ENV.STAGING]: 111557560, [ENV.DEV]: 111557560, [ENV.LOCAL]: 111557560, - } + }, + BASE: { + [ENV.PROD]: 8453, + [ENV.STAGING]: 84532, + [ENV.DEV]: 84532, + [ENV.LOCAL]: 84532, + }, }; export const CHAIN_ID = { @@ -164,7 +175,10 @@ export const CHAIN_NAME: { [key: number]: string } = { 59141: 'LINEA', // cyberconnect 7560: 'CYBER_CONNECT_MAINNET', - 111557560: 'CYBER_CONNECT_TESTNET' + 111557560: 'CYBER_CONNECT_TESTNET', + // base + 8453: 'BASE_MAINNET', + 84532: 'BASE_TESTNET', }; export interface ConfigType { API_BASE_URL: string; @@ -250,6 +264,10 @@ const CONFIG = { [BLOCKCHAIN_NETWORK.LINEA_MAINNET]:{ API_BASE_URL: API_BASE_URL[ENV.PROD], EPNS_COMMUNICATOR_CONTRACT: '0x0d8e75CB5d8873c43c5d9Add71Fd71a09F7Ef890', + }, + [BLOCKCHAIN_NETWORK.BASE_MAINNET]: { + API_BASE_URL: API_BASE_URL[ENV.PROD], + EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', } }, [ENV.STAGING]: { @@ -293,6 +311,10 @@ const CONFIG = { API_BASE_URL: API_BASE_URL[ENV.STAGING], EPNS_COMMUNICATOR_CONTRACT: '0x6e489B7af21cEb969f49A90E481274966ce9D74d', }, + [BLOCKCHAIN_NETWORK.BASE_TESTNET]: { + API_BASE_URL: API_BASE_URL[ENV.STAGING], + EPNS_COMMUNICATOR_CONTRACT: '0x6e489B7af21cEb969f49A90E481274966ce9D74d', + } }, [ENV.DEV]: { [BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: { @@ -335,6 +357,10 @@ const CONFIG = { API_BASE_URL: API_BASE_URL[ENV.DEV], EPNS_COMMUNICATOR_CONTRACT: '0x9cb3bd7550B5c92baA056Fc0F08132f49508145F', }, + [BLOCKCHAIN_NETWORK.BASE_TESTNET]: { + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_COMMUNICATOR_CONTRACT: '0x9cb3bd7550B5c92baA056Fc0F08132f49508145F', + } }, [ENV.LOCAL]: { [BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: { @@ -377,6 +403,10 @@ const CONFIG = { API_BASE_URL: API_BASE_URL[ENV.DEV], EPNS_COMMUNICATOR_CONTRACT: '0x9cb3bd7550B5c92baA056Fc0F08132f49508145F', }, + [BLOCKCHAIN_NETWORK.BASE_TESTNET]: { + API_BASE_URL: API_BASE_URL[ENV.LOCAL], + EPNS_COMMUNICATOR_CONTRACT: '0x9cb3bd7550B5c92baA056Fc0F08132f49508145F', + } }, }; @@ -459,6 +489,11 @@ export const VIEM_CONFIG = { API_BASE_URL: API_BASE_URL[ENV.PROD], EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', }, + [BLOCKCHAIN_NETWORK.BASE_MAINNET]: { + NETWORK: base, + API_BASE_URL: API_BASE_URL[ENV.PROD], + EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', + } }, [ENV.STAGING]: { [BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: { @@ -511,6 +546,11 @@ export const VIEM_CONFIG = { API_BASE_URL: API_BASE_URL[ENV.STAGING], EPNS_COMMUNICATOR_CONTRACT: '0x6e489B7af21cEb969f49A90E481274966ce9D74d', }, + [BLOCKCHAIN_NETWORK.BASE_TESTNET]: { + NETWORK: baseSepolia, + API_BASE_URL: API_BASE_URL[ENV.STAGING], + EPNS_COMMUNICATOR_CONTRACT: '0x6e489B7af21cEb969f49A90E481274966ce9D74d', + } }, [ENV.DEV]: { [BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: { @@ -560,34 +600,39 @@ export const VIEM_CONFIG = { }, [BLOCKCHAIN_NETWORK.CYBER_CONNECT_TESTNET]: { NETWORK: cyberConnectTestnet, - API_BASE_URL: API_BASE_URL[ENV.STAGING], + API_BASE_URL: API_BASE_URL[ENV.DEV], EPNS_COMMUNICATOR_CONTRACT: '0x9cb3bd7550B5c92baA056Fc0F08132f49508145F', }, + [BLOCKCHAIN_NETWORK.BASE_TESTNET]: { + NETWORK: baseSepolia, + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_COMMUNICATOR_CONTRACT: '0x9cb3bd7550B5c92baA056Fc0F08132f49508145F', + } }, [ENV.LOCAL]: { [BLOCKCHAIN_NETWORK.ETH_SEPOLIA]: { NETWORK: sepolia, - API_BASE_URL: API_BASE_URL[ENV.DEV], + API_BASE_URL: API_BASE_URL[ENV.LOCAL], EPNS_COMMUNICATOR_CONTRACT: '0x9dDCD7ed7151afab43044E4D694FA064742C428c', }, [BLOCKCHAIN_NETWORK.POLYGON_AMOY]: { NETWORK: polygonAmoy, - API_BASE_URL: API_BASE_URL[ENV.DEV], + API_BASE_URL: API_BASE_URL[ENV.LOCAL], EPNS_COMMUNICATOR_CONTRACT: '0x9cb3bd7550b5c92baa056fc0f08132f49508145f', }, [BLOCKCHAIN_NETWORK.BSC_TESTNET]: { NETWORK: bscTestnet, - API_BASE_URL: API_BASE_URL[ENV.DEV], + API_BASE_URL: API_BASE_URL[ENV.LOCAL], EPNS_COMMUNICATOR_CONTRACT: '0x4132061E3349ff36cFfCadA460E10Bd4f31F7ea8', }, [BLOCKCHAIN_NETWORK.OPTIMISM_TESTNET]: { NETWORK: optimismSepolia, - API_BASE_URL: API_BASE_URL[ENV.DEV], + API_BASE_URL: API_BASE_URL[ENV.LOCAL], EPNS_COMMUNICATOR_CONTRACT: '0x754787358fac861ef904c92d54f7adb659779317', }, [BLOCKCHAIN_NETWORK.POLYGON_ZK_EVM_TESTNET]: { NETWORK: polygonZkEvmCordona, - API_BASE_URL: API_BASE_URL[ENV.DEV], + API_BASE_URL: API_BASE_URL[ENV.LOCAL], EPNS_COMMUNICATOR_CONTRACT: '0x9cb3bd7550b5c92baa056fc0f08132f49508145f', }, [BLOCKCHAIN_NETWORK.ARBITRUM_TESTNET]: { @@ -612,9 +657,14 @@ export const VIEM_CONFIG = { }, [BLOCKCHAIN_NETWORK.CYBER_CONNECT_TESTNET]: { NETWORK: cyberConnectTestnet, - API_BASE_URL: API_BASE_URL[ENV.STAGING], + API_BASE_URL: API_BASE_URL[ENV.LOCAL], EPNS_COMMUNICATOR_CONTRACT: '0x9cb3bd7550B5c92baA056Fc0F08132f49508145F', }, + [BLOCKCHAIN_NETWORK.BASE_TESTNET]: { + NETWORK: baseSepolia, + API_BASE_URL: API_BASE_URL[ENV.LOCAL], + EPNS_COMMUNICATOR_CONTRACT: '0x9cb3bd7550B5c92baA056Fc0F08132f49508145F', + } }, }; diff --git a/packages/restapi/src/lib/constants.ts b/packages/restapi/src/lib/constants.ts index 76867ad1c..b890b51f4 100644 --- a/packages/restapi/src/lib/constants.ts +++ b/packages/restapi/src/lib/constants.ts @@ -67,7 +67,7 @@ const Constants = { DEV_CHAIN_ID: 99999, NON_ETH_CHAINS: [ 137, 80002, 56, 97, 10, 11155420, 2442, 1101, 421614, 42161, 122, 123, - 80085,59141, 59144, 111557560,7560 + 80085,59141, 59144, 111557560, 7560, 84532, 8453, ], ETH_CHAINS: [1, 11155111], ENC_TYPE_V1: 'x25519-xsalsa20-poly1305', diff --git a/packages/restapi/src/lib/payloads/constants.ts b/packages/restapi/src/lib/payloads/constants.ts index 006a5ae54..48b99c85e 100644 --- a/packages/restapi/src/lib/payloads/constants.ts +++ b/packages/restapi/src/lib/payloads/constants.ts @@ -22,6 +22,8 @@ export const CHAIN_ID_TO_SOURCE: ChainIdToSourceType = { 59144: 'LINEA_MAINNET', 7560: 'CYBER_CONNECT_MAINNET', 111557560: 'CYBER_CONNECT_TESTNET', + 84532: 'BASE_TESTNET', + 8453: 'BASE_MAINNET', }; export const SOURCE_TYPES = { @@ -47,11 +49,13 @@ export const SOURCE_TYPES = { SIMULATE: 'SIMULATE', CYBER_CONNECT_TESTNET: 'CYBER_CONNECT_TESTNET', CYBER_CONNECT_MAINNET: 'CYBER_CONNECT_MAINNET', + BASE_TESTNET: 'BASE_TESTNET', + BASE_MAINNET: 'BASE_MAINNET', }; export const SUPPORTED_CHAINS = [ 1, 11155111, 42, 137, 80002, 56, 97, 10, 11155420, 2442, 1101, 421614, 42161, - 122, 123, 80085, 111557560, 7560, 59141, 59144 + 122, 123, 80085, 111557560, 7560, 59141, 59144, 84532, 8453, ]; export enum IDENTITY_TYPE { diff --git a/packages/restapi/tests/.env.sample b/packages/restapi/tests/.env.sample index 2dcc097f7..46846d7c2 100644 --- a/packages/restapi/tests/.env.sample +++ b/packages/restapi/tests/.env.sample @@ -11,6 +11,7 @@ OPTIMISM_CHANNEL_PRIVATE_KEY=your_optimism_channel_private_key POLYGON_CHANNEL_PRIVATE_KEY=your_polygon_channel_private_key POLYGON_ZKEVM_CHANNEL_PRIVATE_KEY=your_polygon_zkevm_channel_private_key CYBER_CONNECT_CHANNEL_PRIVATE_KEY=your_cyber_connect_channel_private_key +BASE_CHANNEL_PRIVATE_KEY=your_base_channel_private_key WALLET_PRIVATE_KEY=your_wallet_private_key WALLET_PRIVATE_KEY_2=your_wallet_private_key_2 diff --git a/packages/restapi/tests/lib/alias/base.test.ts b/packages/restapi/tests/lib/alias/base.test.ts new file mode 100644 index 000000000..f81fb1013 --- /dev/null +++ b/packages/restapi/tests/lib/alias/base.test.ts @@ -0,0 +1,87 @@ +import { ethers } from 'ethers'; +import { PushAPI } from '../../../src'; +import { ENV } from '../../../src/lib/constants'; + +describe('BERACHAIN ALIAS functionality', () => { + let userAlice: PushAPI; + let userBob: PushAPI; + let account: string; + let account2: string; + + // accessing env dynamically using process.env + type EnvStrings = keyof typeof ENV; + const envMode = process.env.ENV as EnvStrings; + const _env = ENV[envMode]; + + before(async () => { + const provider = new ethers.providers.JsonRpcProvider( + 'https://sepolia.base.org' // base sepolia Provider + ); + const signer = new ethers.Wallet( + `0x${process.env['BERACHAIN_CHANNEL_PRIVATE_KEY']}`, + provider + ); + account = signer.address; + userAlice = await PushAPI.initialize(signer, { + env: _env, + }); + + const signer2 = new ethers.Wallet(ethers.Wallet.createRandom().privateKey); + account2 = signer2.address; + userBob = await PushAPI.initialize(signer2, { env: _env }); + }); + + it.skip('Should be able to create channel', async () => { + const channelInfo = await userAlice.channel.info(); + if (channelInfo) return; // skip if already exists + const res = await userAlice.channel.create({ + name: 'SDK Alias Test', + description: 'Testing using sdk', + url: 'https://push.org', + icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAz0lEQVR4AcXBsU0EQQyG0e+saWJ7oACiKYDMEZVs6GgSpC2BIhzRwAS0sgk9HKn3gpFOAv3v3V4/3+4U4Z1q5KTy42Ql940qvFONnFSGmCFmiN2+fj7uCBlihpgh1ngwcvKfwjuVIWaIGWKNB+GdauSk8uNkJfeNKryzYogZYoZY40m5b/wlQ8wQM8TayMlKeKcaOVkJ71QjJyuGmCFmiDUe+HFy4VyEd57hx0mV+0ZliBlihlgL71w4FyMnVXhnZeSkiu93qheuDDFDzBD7BcCyMAOfy204AAAAAElFTkSuQmCC', + alias: `eip155:84532:${account}`, + progressHook: (progress: any) => console.log(progress), + }); + console.log(res); + }); + + it('Should be able to send notifications', async () => { + await userAlice.channel.send(['*'], { + notification: { + title: 'hi', + body: 'test-broadcast', + }, + payload: { + title: 'testing broadcast notification', + body: 'testing with random body', + cta: 'https://google.com/', + embed: 'https://avatars.githubusercontent.com/u/64157541?s=200&v=4', + }, + channel: `eip155:84532:${account}`, + }); + }); + + it('Should be able to add delegatee', async () => { + await userAlice.channel.delegate.add(account2); + }); + + it('Should be able to send notifications from delegate', async () => { + await userBob.channel.send(['*'], { + notification: { + title: 'hi', + body: 'test-broadcast', + }, + payload: { + title: 'testing broadcast notification', + body: 'testing with random body', + cta: 'https://google.com/', + embed: 'https://avatars.githubusercontent.com/u/64157541?s=200&v=4', + }, + channel: `eip155:84532:${account}`, + }); + }); + + it('Should be able to remove delegatee', async () => { + await userAlice.channel.delegate.remove(account2); + }); +}); diff --git a/packages/uiweb/README.md b/packages/uiweb/README.md index f103c1278..59522134c 100644 --- a/packages/uiweb/README.md +++ b/packages/uiweb/README.md @@ -149,7 +149,7 @@ where | cta | string | Call To Action Link (given during notification creation) | | image | string | Any media link (given during notification creation) | | url | string | Channel Link (given during channel setup) | -| chainName | string | Can be anyone of the following blockchain networks on which the notification was sent - "ETH_MAINNET", "ETH_TEST_SEPOLIA", "POLYGON_MAINNET", "POLYGON_TEST_AMOY", "BSC_MAINNET, "BSC_TESTNET", "OPTIMISM_MAINNET", "OPTIMISM_TESTNET", "POLYGON_ZK_EVM_TESTNET", "POLYGON_ZK_EVM_MAINNET", "ARBITRUM_TESTNET", "ARBITRUMONE_MAINNET", "FUSE_TESTNET", "FUSE_MAINNET", "BERACHIAN_TESTNET", "LINEA_MAINNET", "LINEA_TESTNET", "CYBER_CONNECT_TESTNET , "CYBER_CONNECT_MAINNET", "THE_GRAPH" | +| chainName | string | Can be anyone of the following blockchain networks on which the notification was sent - "ETH_MAINNET", "ETH_TEST_SEPOLIA", "POLYGON_MAINNET", "POLYGON_TEST_AMOY", "BSC_MAINNET, "BSC_TESTNET", "OPTIMISM_MAINNET", "OPTIMISM_TESTNET", "POLYGON_ZK_EVM_TESTNET", "POLYGON_ZK_EVM_MAINNET", "ARBITRUM_TESTNET", "ARBITRUMONE_MAINNET", "FUSE_TESTNET", "FUSE_MAINNET", "BERACHIAN_TESTNET", "LINEA_MAINNET", "LINEA_TESTNET", "CYBER_CONNECT_TESTNET , "CYBER_CONNECT_MAINNET", "BASE_MAINNET" , "BASE_TESTNET", "THE_GRAPH" | | theme | string | 'light' or 'dark' (customization to be given by the dApp) | | customTheme | INotificationItemTheme | custom theme object for the component | | isSpam | boolean | whether a spam notification or not | diff --git a/packages/uiweb/src/lib/components/chat/constants/chainDetails.tsx b/packages/uiweb/src/lib/components/chat/constants/chainDetails.tsx index 620654948..ea49d6b47 100644 --- a/packages/uiweb/src/lib/components/chat/constants/chainDetails.tsx +++ b/packages/uiweb/src/lib/components/chat/constants/chainDetails.tsx @@ -1,102 +1,105 @@ - -import Tooltip from "../../tooltip"; +import Tooltip from '../../tooltip'; import { EthereumSvg } from '../../../icons/EthereumSvg'; -import { PolygonSvg } from "../../../icons/PolygonSvg"; -import { BSCSvg } from "../../../icons/BSCSvg"; -import { OptimismSvg } from "../../../icons/OptimismSvg"; -import { PolygonzkevmSvg } from "../../../icons/PolygonzkevmSvg"; -import { ArbitrumSvg } from "../../../icons/ArbitrumSvg" -import { FuseSvg } from "../../../icons/FuseSvg" -import React from "react"; -import { BerachainSVG } from "../../../icons/BerachainSVG"; -import LineaSVG from "../../../icons/LineaSVG"; +import { PolygonSvg } from '../../../icons/PolygonSvg'; +import { BSCSvg } from '../../../icons/BSCSvg'; +import { OptimismSvg } from '../../../icons/OptimismSvg'; +import { PolygonzkevmSvg } from '../../../icons/PolygonzkevmSvg'; +import { ArbitrumSvg } from '../../../icons/ArbitrumSvg'; +import { FuseSvg } from '../../../icons/FuseSvg'; +import { BerachainSVG } from '../../../icons/BerachainSVG'; +import { LineaSVG } from '../../../icons/LineaSVG'; +import { BaseSVG } from '../../../icons/baseSVG'; -import { CyberConnectSVG } from "../../../icons/CyberConnectSVG"; -const createSVGIcon = (element:any, chainName: string) => { - return ( - - {element} - - ); +import { CyberConnectSVG } from '../../../icons/CyberConnectSVG'; +const createSVGIcon = (element: any, chainName: string) => { + return {element}; }; -export const NETWORK_ICON_DETAILS = { +export const NETWORK_ICON_DETAILS = { 11155111: { label: 'ETHEREUM SEPOLIA', - icon: createSVGIcon(, 'Ethereum Sepolia'), + icon: createSVGIcon(, 'Ethereum Sepolia'), }, 1: { label: 'ETHEREUM MAINNET', - icon: createSVGIcon(, 'Ethereum Mainnet'), + icon: createSVGIcon(, 'Ethereum Mainnet'), }, 80002: { label: 'POLYGON AMOY', - icon: createSVGIcon(, 'Polygon Amoy'), + icon: createSVGIcon(, 'Polygon Amoy'), }, 137: { label: 'POLYGON MAINNET', - icon: createSVGIcon(, 'Polygon Mainnet'), + icon: createSVGIcon(, 'Polygon Mainnet'), }, 97: { label: 'BSC TESTNET', - icon: createSVGIcon(, 'Bsc Testnet'), + icon: createSVGIcon(, 'Bsc Testnet'), }, 56: { label: 'BSC MAINNET', - icon: createSVGIcon(, 'Bsc Mainnet'), + icon: createSVGIcon(, 'Bsc Mainnet'), }, 11155420: { label: 'OPTIMISM TESTNET', - icon: createSVGIcon(, 'Optimism Testnet'), + icon: createSVGIcon(, 'Optimism Testnet'), }, 10: { label: 'OPTIMISM MAINNET', - icon: createSVGIcon(, 'Optimism Mainnet'), + icon: createSVGIcon(, 'Optimism Mainnet'), }, 1442: { label: 'POLYGON ZK EVM TESTNET', - icon: createSVGIcon(, 'Polygon ZK EVM Testnet'), + icon: createSVGIcon(, 'Polygon ZK EVM Testnet'), }, 1101: { label: 'POLYGON ZK EVM MAINNET', - icon: createSVGIcon(, 'Polygon ZK EVM Mainnet'), + icon: createSVGIcon(, 'Polygon ZK EVM Mainnet'), }, 42161: { label: 'ARBITRUMONE MAINNET', - icon: createSVGIcon(, 'Arbitrum Mainnet'), + icon: createSVGIcon(, 'Arbitrum Mainnet'), }, 421614: { label: 'ARBITRUM TESTNET', - icon: createSVGIcon(, 'Arbitrum Testnet'), + icon: createSVGIcon(, 'Arbitrum Testnet'), }, - 123 : { + 123: { label: 'FUSE TESTNET', - icon: createSVGIcon(, 'Fuse Testnet'), + icon: createSVGIcon(, 'Fuse Testnet'), }, - 122 : { + 122: { label: 'FUSE MAINNET', - icon: createSVGIcon(, 'Fuse Mainnet'), + icon: createSVGIcon(, 'Fuse Mainnet'), }, - 80085 : { + 80085: { label: 'BERACHAIN TESTNET', - icon: createSVGIcon(, 'Berachain Testnet'), + icon: createSVGIcon(, 'Berachain Testnet'), }, - 59141 : { + 59141: { label: 'LINEA TESTNET', - icon: createSVGIcon(, 'Linea Testnet'), + icon: createSVGIcon(, 'Linea Testnet'), }, - 59144 : { + 59144: { label: 'LIENA MAINNET', - icon: createSVGIcon(, 'Linea Mainnet'), + icon: createSVGIcon(, 'Linea Mainnet'), }, 111557560: { label: 'CYBER CONNECT TESTNET', - icon: createSVGIcon(, 'CyberConnect Testnet'), + icon: createSVGIcon(, 'CyberConnect Testnet'), }, 7560: { label: 'CYBER CONNECT MAINNET', - icon: createSVGIcon(, 'CyberConnect Mainnet'), - } + icon: createSVGIcon(, 'CyberConnect Mainnet'), + }, + 84532: { + label: 'BASE TESTNET', + icon: createSVGIcon(, 'Base Testnet'), + }, + 8453: { + label: 'BASE MAINNET', + icon: createSVGIcon(, 'Base Testnet'), + }, }; diff --git a/packages/uiweb/src/lib/components/notification/chainDetails.tsx b/packages/uiweb/src/lib/components/notification/chainDetails.tsx index 60f9e8273..ade80811b 100644 --- a/packages/uiweb/src/lib/components/notification/chainDetails.tsx +++ b/packages/uiweb/src/lib/components/notification/chainDetails.tsx @@ -9,8 +9,9 @@ import { OptimismSvg } from '../../icons/OptimismSvg'; import { PolygonSvg } from '../../icons/PolygonSvg'; import { PolygonzkevmSvg } from '../../icons/PolygonzkevmSvg'; import { TheGraphSvg } from '../../icons/TheGraphSvg'; -import LineaSVG from '../../icons/LineaSVG'; +import { LineaSVG } from '../../icons/LineaSVG'; import { CyberConnectSVG } from '../../icons/CyberConnectSVG'; +import { BaseSVG } from '../../icons/baseSVG'; const createSVGIcon = (element: any, chainName: string) => { return {element}; }; @@ -99,4 +100,12 @@ export default { label: 'CYBER CONNECT MAINNET', icon: createSVGIcon(, 'CyberConnect Mainnet'), }, + BASE_TESTNET: { + label: 'BASE TESTNET', + icon: createSVGIcon(, 'Base Testnet'), + }, + BASE_MAINNET: { + label: 'BASE MAINNET', + icon: createSVGIcon(, 'Base Mainnet'), + }, }; diff --git a/packages/uiweb/src/lib/components/notification/index.tsx b/packages/uiweb/src/lib/components/notification/index.tsx index 31dedba9a..02a010ef0 100644 --- a/packages/uiweb/src/lib/components/notification/index.tsx +++ b/packages/uiweb/src/lib/components/notification/index.tsx @@ -45,6 +45,8 @@ export type chainNameType = | 'LINEA_TESTNET' | 'CYBER_CONNECT_TESTNET' | 'CYBER_CONNECT_MAINNET' + | 'BASE_TESTNET' + | 'BASE_MAINNET' | undefined; export type NotificationItemProps = { diff --git a/packages/uiweb/src/lib/config/constants.ts b/packages/uiweb/src/lib/config/constants.ts index c5c089154..d57413840 100644 --- a/packages/uiweb/src/lib/config/constants.ts +++ b/packages/uiweb/src/lib/config/constants.ts @@ -61,6 +61,7 @@ const TESTNET_NETWORK = { FUSE: 'eip155:123', BERACHAIN: 'eip155:80085', CYBER_CONNECT: 'eip155:111557560', + BASE: 'eip155:84532', }; const MAINET_NETWORK = { ETHEREUM: 'eip155:1', @@ -71,6 +72,7 @@ const MAINET_NETWORK = { ARBITRUM: 'eip155:42161', FUSE: 'eip155:122', CYBER_CONNECT: 'eip155:7560', + BASE: 'eip155:8453', }; export const BLOCKCHAIN_NETWORK = { @@ -90,6 +92,7 @@ export const allowedNetworks = { 122, // for fuse mainnet 59144, // for linea mainnet 7569, // for cyber connect mainnet + 8453, // for base mainnet ], dev: [ 11155111, // for eth sepolia @@ -102,6 +105,7 @@ export const allowedNetworks = { 59141, // for linea testnet 2442, // polygon zkevm 111557560, // cyber connect testnet + 84532, // for base testnet ], staging: [ // 42, //for kovan @@ -115,6 +119,7 @@ export const allowedNetworks = { 59141, // for linea testnet 2442, // polygon zkevm 111557560, // cyber connect testnet + 84532, // for base testnet ], local: [ 11155111, // for eth sepolia @@ -127,6 +132,7 @@ export const allowedNetworks = { 59141, // for linea testnet 2442, // polygon zkevm 111557560, // cyber connect testnet + 84532, // for base testnet ], }; diff --git a/packages/uiweb/src/lib/icons/LineaSVG.tsx b/packages/uiweb/src/lib/icons/LineaSVG.tsx index 2dab10fad..2278c3456 100644 --- a/packages/uiweb/src/lib/icons/LineaSVG.tsx +++ b/packages/uiweb/src/lib/icons/LineaSVG.tsx @@ -1,7 +1,7 @@ import * as React from "react" import { SVGProps } from "react" -const LineaSVG = (props: SVGProps) => ( +export const LineaSVG = (props: SVGProps) => ( ) => ( ) -export default LineaSVG + diff --git a/packages/uiweb/src/lib/icons/base.svg b/packages/uiweb/src/lib/icons/base.svg new file mode 100644 index 000000000..da7e6fbe9 --- /dev/null +++ b/packages/uiweb/src/lib/icons/base.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/uiweb/src/lib/icons/baseSVG.tsx b/packages/uiweb/src/lib/icons/baseSVG.tsx new file mode 100644 index 000000000..9f896a270 --- /dev/null +++ b/packages/uiweb/src/lib/icons/baseSVG.tsx @@ -0,0 +1,17 @@ +import * as React from "react" +import { SVGProps } from "react" + +export const BaseSVG = (props: SVGProps) => ( + + + +) + From 72beb736a6f077b3d96e2e1c746d6817057bc707 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Mon, 10 Jun 2024 11:43:46 +0530 Subject: [PATCH 5/7] fix: fix clow stew issue (#1344) --- packages/restapi/src/lib/chat/helpers/pgp.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/restapi/src/lib/chat/helpers/pgp.ts b/packages/restapi/src/lib/chat/helpers/pgp.ts index 6240dc60d..0c06c7d24 100644 --- a/packages/restapi/src/lib/chat/helpers/pgp.ts +++ b/packages/restapi/src/lib/chat/helpers/pgp.ts @@ -75,6 +75,8 @@ const PGPHelper:IPGPHelper = { }) const publicKey: openpgp.PublicKey = await openpgp.readKey({ armoredKey: publicKeyArmored }) const verificationResult = await openpgp.verify({ + // setting date to 1 day in the future to avoid issues with clock skew + date: new Date(Date.now() + 1000 * 60 * 60 * 24), message, signature, verificationKeys: publicKey From 4aa6e97db46a29e95e53774367d72d660148814b Mon Sep 17 00:00:00 2001 From: Mohammed S Date: Wed, 12 Jun 2024 20:45:23 +0530 Subject: [PATCH 6/7] fix: support chatId for one to one in send message (#1350) --- .../src/lib/chat/helpers/payloadHelper.ts | 2 +- packages/restapi/src/lib/chat/send.ts | 52 +++++++++++++++---- 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/packages/restapi/src/lib/chat/helpers/payloadHelper.ts b/packages/restapi/src/lib/chat/helpers/payloadHelper.ts index 6ab762e1e..d22d2ba16 100644 --- a/packages/restapi/src/lib/chat/helpers/payloadHelper.ts +++ b/packages/restapi/src/lib/chat/helpers/payloadHelper.ts @@ -110,7 +110,7 @@ export const sendMessagePayloadCore = async ( env: ENV, pgpHelper: IPGPHelper ): Promise => { - const isGroup = !isValidPushCAIP(receiverAddress); + const isGroup = group !== null; let secretKey: string; if (isGroup && group?.encryptedSecret && group.sessionKey) { diff --git a/packages/restapi/src/lib/chat/send.ts b/packages/restapi/src/lib/chat/send.ts index 741e1e423..55838da14 100644 --- a/packages/restapi/src/lib/chat/send.ts +++ b/packages/restapi/src/lib/chat/send.ts @@ -1,4 +1,9 @@ -import { convertToValidDID, getAPIBaseUrls, isValidPushCAIP } from '../helpers'; +import { + convertToValidDID, + getAPIBaseUrls, + isValidPushCAIP, + walletToPCAIP10, +} from '../helpers'; import Constants, { MessageType, ENV } from '../constants'; import { ChatSendOptionsType, MessageWithCID, SignerType } from '../types'; import { @@ -15,6 +20,7 @@ import { validateMessageObj } from '../validations/messageObject'; import { axiosPost } from '../utils/axiosUtil'; import { getGroupInfo } from './getGroupInfo'; import { handleError } from '../errors/validationError'; +import * as PUSH_CHAT from '../chat'; /** * SENDS A PUSH CHAT MESSAGE @@ -36,7 +42,7 @@ export const sendCore = async ( * 2. Takes care of deprecated fields */ const computedOptions = computeOptions(options); - const { messageType, messageObj, account, to, signer, pgpPrivateKey, env } = + let { messageType, messageObj, account, to, signer, pgpPrivateKey, env } = computedOptions; /** * Validate Input Options @@ -50,16 +56,40 @@ export const sendCore = async ( env, pgpHelper ); - const receiver = await convertToValidDID(to, env); + let receiver = await convertToValidDID(to, env); const API_BASE_URL = getAPIBaseUrls(env); - const isGroup = isValidPushCAIP(to) ? false : true; - - const group = isGroup - ? await getGroupInfo({ - chatId: to, - env: env, - }) - : null; + + const isChatId = isValidPushCAIP(to) ? false : true; + let isGroup = false; + let group = null; + + if (isChatId) { + const request: PUSH_CHAT.GetChatInfoType = { + recipient: to, + account: account!, + env: env, + }; + + const chatInfo = await PUSH_CHAT.getChatInfo(request); + isGroup = chatInfo?.meta?.group ?? false; + + group = isGroup + ? await getGroupInfo({ + chatId: to, + env: env, + }) + : null; + + if (!isGroup) { + const participants = chatInfo.participants ?? []; + // Find the participant that is not the account being used + const messageSentTo = participants.find( + (participant) => participant !== walletToPCAIP10(account!) + ); + to = messageSentTo!; + receiver = to; + } + } // Not supported by legacy sdk versions, need to override messageContent to avoid parsing errors on legacy sdk versions let messageContent: string; From f5778bad6a601b646fa5d108d03462951ff95b33 Mon Sep 17 00:00:00 2001 From: Mohammed S Date: Wed, 12 Jun 2024 20:45:47 +0530 Subject: [PATCH 7/7] fix: chat implementation (#1349) --- packages/restapi/src/lib/pushapi/chat.ts | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/packages/restapi/src/lib/pushapi/chat.ts b/packages/restapi/src/lib/pushapi/chat.ts index b3570b291..9dc2e5f09 100644 --- a/packages/restapi/src/lib/pushapi/chat.ts +++ b/packages/restapi/src/lib/pushapi/chat.ts @@ -143,6 +143,32 @@ export class Chat { return historyMessages.map((message: any) => ({ ...message, listType })); } + async message( + target: string, + options?: { + reference?: string | null; + } + ) { + let reference: string; + + const { threadHash, intent } = await PUSH_CHAT.conversationHash({ + conversationId: target, + account: this.account, + env: this.env, + }); + + reference = options?.reference || threadHash; + + if (!reference) return {}; + + const historyMessages = await this.history(target, { reference, limit: 1 }); + const listType = intent ? 'CHATS' : 'REQUESTS'; + + return historyMessages.length > 0 + ? { ...historyMessages[0], listType } + : null; + } + async send(recipient: string, options: Message): Promise { if (!this.decryptedPgpPvtKey) { throw new Error(PushAPI.ensureSignerMessage());