diff --git a/wallets/react-wallet-chat/package.json b/wallets/react-wallet-chat/package.json index 426dce0..d094856 100644 --- a/wallets/react-wallet-chat/package.json +++ b/wallets/react-wallet-chat/package.json @@ -15,7 +15,7 @@ "@json-rpc-tools/utils": "1.7.6", "@nextui-org/react": "1.0.8-beta.5", "@solana/web3.js": "1.43.0", - "@walletconnect/chat-client": "^0.2.2", + "@walletconnect/chat-client": "^0.3.2", "@walletconnect/sign-client": "2.0.0-rc.4", "@walletconnect/utils": "2.0.0-rc.4", "@web3modal/core": "^2.0.0-beta.7", diff --git a/wallets/react-wallet-chat/src/pages/chats.tsx b/wallets/react-wallet-chat/src/pages/chats.tsx index 3305b5d..62d1fe9 100644 --- a/wallets/react-wallet-chat/src/pages/chats.tsx +++ b/wallets/react-wallet-chat/src/pages/chats.tsx @@ -54,7 +54,7 @@ export default function ChatsPage() { setChatInvites(chatClient.getReceivedInvites({ account: `eip155:1:${eip155Address}` })) }) - chatClient.on('chat_joined', async args => { + chatClient.on('chat_invite_accepted', async args => { console.log('chat_joined:', args) console.log(chatClient.chatThreads.getAll()) setChatThreads(chatClient.chatThreads.getAll()) diff --git a/wallets/react-wallet-chat/src/pages/newChat.tsx b/wallets/react-wallet-chat/src/pages/newChat.tsx index babf3f2..7c4ff66 100644 --- a/wallets/react-wallet-chat/src/pages/newChat.tsx +++ b/wallets/react-wallet-chat/src/pages/newChat.tsx @@ -17,7 +17,7 @@ export default function NewChatPage() { const { eip155Address } = useSnapshot(SettingsStore.state) useEffect(() => { - chatClient.once('chat_joined', args => { + chatClient.once('chat_invite_accepted', args => { const newChatTarget = new URLSearchParams(document.location.search).get('target') router.push(`/chat?topic=${args.topic}&peerAccount=${newChatTarget}`) }) diff --git a/wallets/react-wallet-chat/src/utils/WalletConnectUtil.ts b/wallets/react-wallet-chat/src/utils/WalletConnectUtil.ts index cbb8d6f..a594b5a 100644 --- a/wallets/react-wallet-chat/src/utils/WalletConnectUtil.ts +++ b/wallets/react-wallet-chat/src/utils/WalletConnectUtil.ts @@ -21,6 +21,7 @@ export async function createSignClient() { export async function createChatClient() { chatClient = await ChatClient.init({ logger: 'debug', + keyseverUrl: 'https://keys.walletconnect.com', projectId: process.env.NEXT_PUBLIC_PROJECT_ID, relayUrl: process.env.NEXT_PUBLIC_RELAY_URL ?? 'wss://relay.walletconnect.com' }) diff --git a/wallets/react-wallet-chat/yarn.lock b/wallets/react-wallet-chat/yarn.lock index 3911122..31bf700 100644 --- a/wallets/react-wallet-chat/yarn.lock +++ b/wallets/react-wallet-chat/yarn.lock @@ -2129,10 +2129,10 @@ "@typescript-eslint/types" "5.51.0" eslint-visitor-keys "^3.3.0" -"@walletconnect/chat-client@^0.2.2": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@walletconnect/chat-client/-/chat-client-0.2.2.tgz#0a7807f1d606ec740eef5aad7646e4a65a57f74d" - integrity sha512-L1s1fCotRrbJBpJQ5Ky63D+JzH9d0DxQtgJVTs/b7bxI6q9akWfGUIeLQJLgu0dZiBFizK+ilMf4Sn8S93W35g== +"@walletconnect/chat-client@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@walletconnect/chat-client/-/chat-client-0.3.2.tgz#6fc4ceb7ef1207ed821d1a0ea1451f7affa96965" + integrity sha512-xs84upGbLtMn9Ev4z+S8e2o5bYr070gCDwK84K5AgBM8BKhAexz956aVRUq90sKBMuKl0cCCp5lzm13eGIFKJA== dependencies: "@noble/ed25519" "^1.7.1" "@walletconnect/core" "^2.3.3"