From 331a5568eae133d8ee9a29c62b46c63ad0df9cf3 Mon Sep 17 00:00:00 2001 From: Mohammed S Date: Tue, 16 Apr 2024 21:07:29 +0530 Subject: [PATCH] Alpha merge (#1231) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add: ethers support (#952) * fix: fix viem support, add ethers support * fix: remove @pushprotocol/socket dependency from restapi * fix: changed ethers fn * fix: fix ether changes * fix: fix subscribev2 * chore: readme changes * fix: fix ethers provider issue * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.61 * fix: fix channel.update * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.62 * feat(video-v2): add video v2 class and stream (#930) * feat(video-v2): add highlevel video class * feat(video): add video stream * fix(sendnotification): modify rules.access.data to be an object & code cleanup * fix(video): remove signer from input, throw err if signer, decrypted pgp key not found * feat(video): add sendNotification calls in connect, disconnect methods * fix(videonotificationrules): typo in VideoNotificationRules interface * feat(video stream): handle connect, retry internally from the SDK * feat(video connect): remove the connect method from the videov2 SDK * fix(videov2): create push signer instance to get chain id in initialize() * fix(video stream): add backwards compatibilty to rules object for older SDK versions * fix(video stream): fix bug in rules object creation * feat(video): update param names for video.initialize() * feat(video): add internal event handlers for stream in video SDK --------- Co-authored-by: Mohammed S * ci(restapi): šŸŽ‰ cut release to restapi-v0.9.0 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.63 * Chat Preview List workable PoC (#987) * fix: revert space changes * fix: merge main * fix: signer compatibility with viem and ethers (#567) * fix: signer compatibility with viem and ethers * fix: revert space changes * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.26 * Update README.md * Update README.md * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.3 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.27 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.4 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.5 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.6 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.7 * fix: add: scw sig verification (#593) * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.28 * fix: url correction * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.29 * ci(socket): šŸŽ‰ cut release to socket-v0.5.2 * fix: fixed subscribe and unsubscribe * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.5 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.8 * Feat/chat components (#621) * feat: created architechture * fix: added context values (#594) * Chat dataprovider (#596) * feat: data provider for chat component * fix: replaced react.usestate to usestate * fix: added props as the initial state and changed state name * fix: reverted chat context changes and renamed values * fix: added test page for chat ui components (#597) * added chatbubble component (#602) * feat: added chatbubble component * fix: made the messageBubble's width to fit-content --------- Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * fix: added theme * Group chat bubble (#604) * feat: moved test component to testui folder & replaced dummy data with sdk response * feat: added twitter card and address for group chat received msg * feat: made the messageaddress reusable, added account from context * fix: removed unnecessary div and unused props and console logs * feat: adding pfp in text bubbles * fix: replaced hook with function and added pfp to messagebubble * fix: fixed image alignment * fix: changed border-radius of msg bubble and changed function name * fix: fixed theme and decryptedPrivateKey name (#616) * fix: fixed theme and decryptedPrivateKey name * fix: fixed bug * fix: fixed theme reviews * Message list (#615) * fix: message list comp * fix: message list comp * fix: added pagination * fix: added pagination * fix: pagination * fix: create useChatData hook * fix: fixed minor bug * fix: socket issues fixed * fix: added theme in msgbubble (#620) * fix: added theme in msgbubble * fix: fixed import --------- Co-authored-by: Monalisha Mishra --------- Co-authored-by: Satyam <100528412+KlausMikhaelson@users.noreply.github.com> Co-authored-by: KlausMikhaelson * fix: add alpha support to UI web * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.0 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.6 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.9 * Feat/chat components (#625) * feat: created architechture * fix: added context values (#594) * Chat dataprovider (#596) * feat: data provider for chat component * fix: replaced react.usestate to usestate * fix: added props as the initial state and changed state name * fix: reverted chat context changes and renamed values * fix: added test page for chat ui components (#597) * added chatbubble component (#602) * feat: added chatbubble component * fix: made the messageBubble's width to fit-content --------- Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * fix: added theme * Group chat bubble (#604) * feat: moved test component to testui folder & replaced dummy data with sdk response * feat: added twitter card and address for group chat received msg * feat: made the messageaddress reusable, added account from context * fix: removed unnecessary div and unused props and console logs * feat: adding pfp in text bubbles * fix: replaced hook with function and added pfp to messagebubble * fix: fixed image alignment * fix: changed border-radius of msg bubble and changed function name * fix: fixed theme and decryptedPrivateKey name (#616) * fix: fixed theme and decryptedPrivateKey name * fix: fixed bug * fix: fixed theme reviews * Message list (#615) * fix: message list comp * fix: message list comp * fix: added pagination * fix: added pagination * fix: pagination * fix: create useChatData hook * fix: fixed minor bug * fix: socket issues fixed * fix: added theme in msgbubble (#620) * fix: added theme in msgbubble * fix: fixed import --------- Co-authored-by: Monalisha Mishra * fix: exported the theme (#623) * fix: exported the theme * fix: fixed issues --------- Co-authored-by: Monalisha Mishra --------- Co-authored-by: Satyam <100528412+KlausMikhaelson@users.noreply.github.com> Co-authored-by: KlausMikhaelson * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.1 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.7 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.8 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.10 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.9 * 632 group access control sdk changes (#640) * fix: group access control changes * fix: get group access SDK fix * fix: removed unnecessary param * Update README.md * Update README.md * Update README.md * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.30 * Reduce profile creation signature to 2 (#639) * fix: reduced signatures * fix: fixed examples * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.31 * fix: Read me fixes * fix: Space rules * Update README.md * Update README.md * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.32 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.10 * Feat/chat components (#658) * feat: created architechture * fix: added context values (#594) * Chat dataprovider (#596) * feat: data provider for chat component * fix: replaced react.usestate to usestate * fix: added props as the initial state and changed state name * fix: reverted chat context changes and renamed values * fix: added test page for chat ui components (#597) * added chatbubble component (#602) * feat: added chatbubble component * fix: made the messageBubble's width to fit-content --------- Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * fix: added theme * Group chat bubble (#604) * feat: moved test component to testui folder & replaced dummy data with sdk response * feat: added twitter card and address for group chat received msg * feat: made the messageaddress reusable, added account from context * fix: removed unnecessary div and unused props and console logs * feat: adding pfp in text bubbles * fix: replaced hook with function and added pfp to messagebubble * fix: fixed image alignment * fix: changed border-radius of msg bubble and changed function name * fix: fixed theme and decryptedPrivateKey name (#616) * fix: fixed theme and decryptedPrivateKey name * fix: fixed bug * fix: fixed theme reviews * Message list (#615) * fix: message list comp * fix: message list comp * fix: added pagination * fix: added pagination * fix: pagination * fix: create useChatData hook * fix: fixed minor bug * fix: socket issues fixed * fix: added theme in msgbubble (#620) * fix: added theme in msgbubble * fix: fixed import --------- Co-authored-by: Monalisha Mishra * fix: exported the theme (#623) * fix: exported the theme * fix: fixed issues --------- Co-authored-by: Monalisha Mishra * Typebar component (#631) * feat: added typebar UI * feat: added functions to typebar * fix: added icon * fix: fixed theme issues --------- Co-authored-by: Monalisha Mishra * feat: added connectbutton * fix: fixed connectbtn ui and remove disconnect and fixed error on disconnect * fix: fixed create account getting called twice * Profile Header Component (#636) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * Message container (#635) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * fix: updated svg to react component * fix: changed svg to tsx component * fix: fixed review changes (#646) * fix: fixed review changes * fix: resolved issues --------- Co-authored-by: Nilesh Gupta * Profile Header -> Chat Profile fixes (#647) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * fix: notifs * fix: correct theme colors * fix: renaming profileHeader * fix: qa fixes * fix: loader * refactor: resolved issues * fix: edit types --------- Co-authored-by: Nilesh Gupta * fix: resolved package not added issue * Fix: modal issue in group info && alert remove members (#653) * fix: modal * fix: update changes * refactor: resolved issue --------- Co-authored-by: Nilesh Gupta * fix: QA fixes (#654) --------- Co-authored-by: Monalisha Mishra Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> Co-authored-by: Satyam <100528412+KlausMikhaelson@users.noreply.github.com> Co-authored-by: KlausMikhaelson Co-authored-by: Kolade * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.11 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.12 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.11 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.13 * fix: update read me file * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.14 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.15 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.12 * Feat/chat components (#679) * feat: created architechture * fix: added context values (#594) * Chat dataprovider (#596) * feat: data provider for chat component * fix: replaced react.usestate to usestate * fix: added props as the initial state and changed state name * fix: reverted chat context changes and renamed values * fix: added test page for chat ui components (#597) * added chatbubble component (#602) * feat: added chatbubble component * fix: made the messageBubble's width to fit-content --------- Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * fix: added theme * Group chat bubble (#604) * feat: moved test component to testui folder & replaced dummy data with sdk response * feat: added twitter card and address for group chat received msg * feat: made the messageaddress reusable, added account from context * fix: removed unnecessary div and unused props and console logs * feat: adding pfp in text bubbles * fix: replaced hook with function and added pfp to messagebubble * fix: fixed image alignment * fix: changed border-radius of msg bubble and changed function name * fix: fixed theme and decryptedPrivateKey name (#616) * fix: fixed theme and decryptedPrivateKey name * fix: fixed bug * fix: fixed theme reviews * Message list (#615) * fix: message list comp * fix: message list comp * fix: added pagination * fix: added pagination * fix: pagination * fix: create useChatData hook * fix: fixed minor bug * fix: socket issues fixed * fix: added theme in msgbubble (#620) * fix: added theme in msgbubble * fix: fixed import --------- Co-authored-by: Monalisha Mishra * fix: exported the theme (#623) * fix: exported the theme * fix: fixed issues --------- Co-authored-by: Monalisha Mishra * Typebar component (#631) * feat: added typebar UI * feat: added functions to typebar * fix: added icon * fix: fixed theme issues --------- Co-authored-by: Monalisha Mishra * feat: added connectbutton * fix: fixed connectbtn ui and remove disconnect and fixed error on disconnect * fix: fixed create account getting called twice * Profile Header Component (#636) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * Message container (#635) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * fix: updated svg to react component * fix: changed svg to tsx component * fix: fixed review changes (#646) * fix: fixed review changes * fix: resolved issues --------- Co-authored-by: Nilesh Gupta * Profile Header -> Chat Profile fixes (#647) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * fix: notifs * fix: correct theme colors * fix: renaming profileHeader * fix: qa fixes * fix: loader * refactor: resolved issues * fix: edit types --------- Co-authored-by: Nilesh Gupta * fix: resolved package not added issue * Fix: modal issue in group info && alert remove members (#653) * fix: modal * fix: update changes * refactor: resolved issue --------- Co-authored-by: Nilesh Gupta * fix: QA fixes (#654) * Connect btn revamp (#668) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container * feat: adding rainbowkit for btn * fix: fix issues * fix: addec onnect functionality * fix: connect button * fix: added hack for rainbowkit css --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * Typebar UI issue (#666) * fix: fixed typebar space not working and theme * fix: fixed gif and emoji --------- Co-authored-by: KlausMikhaelson * fix: fixed theme colours * fix: added theme for brb * fix: added filter hat * fix: merged with main * fix: fixed msg border * fix: fixed theme * fix: fixed fonts * fix: fixed bug * Access control (#672) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * fix: added minor fix --------- Co-authored-by: Monalisha Mishra * fix: fixed padding issues * fix(f): fixed build issues * fix: fix for chat status test * Check rules access control (#678) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * 662 group access control v2 changes (#663) * fix: spaces access API * fix: custom endpoint doc impl * Update README.md * Update README.md * fix: review comments change * fix: read me update * Update README.md * Update README.md * fix: origin in user creation (#665) * fix: origin in user creation * Update README.md * fix: review comments * 662 group access control v2 changes (#677) * fix: spaces access API * fix: custom endpoint doc impl * Update README.md * Update README.md * fix: review comments change * fix: read me update * Update README.md * Update README.md * fix(spaces): broadcast changes and UX fixes (#674) * fix: fix UI grid view (#642) * fix: fix UI grid view * refactor: conditional added * fix: resolved muting/unmuting try catch error (#657) * fix(spaces): fix livepeer broadcast (#656) * fix(spaces): fix livepeer broadcast * fix(spaces): fix data shown for unjoined space & promote listener logic --------- Co-authored-by: Madhur Gupta * refactor(spaces): use local state instead of get from server while meta message fire (#676) --------- Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Nilesh Gupta * feat: added verification option to show only on token gated groups * fix: fixing group access control --------- Co-authored-by: Monalisha Mishra Co-authored-by: Mohammed S Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Nilesh Gupta * fix: fixed build --------- Co-authored-by: Satyam <100528412+KlausMikhaelson@users.noreply.github.com> Co-authored-by: KlausMikhaelson Co-authored-by: Kolade Co-authored-by: Nilesh Gupta Co-authored-by: Mohammed S Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.2 * fix: dummy change * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.13 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.16 * Join group option (#681) * feat: created architechture * fix: added context values (#594) * Chat dataprovider (#596) * feat: data provider for chat component * fix: replaced react.usestate to usestate * fix: added props as the initial state and changed state name * fix: reverted chat context changes and renamed values * fix: added test page for chat ui components (#597) * added chatbubble component (#602) * feat: added chatbubble component * fix: made the messageBubble's width to fit-content --------- Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * fix: added theme * Group chat bubble (#604) * feat: moved test component to testui folder & replaced dummy data with sdk response * feat: added twitter card and address for group chat received msg * feat: made the messageaddress reusable, added account from context * fix: removed unnecessary div and unused props and console logs * feat: adding pfp in text bubbles * fix: replaced hook with function and added pfp to messagebubble * fix: fixed image alignment * fix: changed border-radius of msg bubble and changed function name * fix: fixed theme and decryptedPrivateKey name (#616) * fix: fixed theme and decryptedPrivateKey name * fix: fixed bug * fix: fixed theme reviews * Message list (#615) * fix: message list comp * fix: message list comp * fix: added pagination * fix: added pagination * fix: pagination * fix: create useChatData hook * fix: fixed minor bug * fix: socket issues fixed * fix: added theme in msgbubble (#620) * fix: added theme in msgbubble * fix: fixed import --------- Co-authored-by: Monalisha Mishra * fix: exported the theme (#623) * fix: exported the theme * fix: fixed issues --------- Co-authored-by: Monalisha Mishra * Typebar component (#631) * feat: added typebar UI * feat: added functions to typebar * fix: added icon * fix: fixed theme issues --------- Co-authored-by: Monalisha Mishra * feat: added connectbutton * fix: fixed connectbtn ui and remove disconnect and fixed error on disconnect * fix: fixed create account getting called twice * Profile Header Component (#636) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * Message container (#635) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * fix: updated svg to react component * fix: changed svg to tsx component * fix: fixed review changes (#646) * fix: fixed review changes * fix: resolved issues --------- Co-authored-by: Nilesh Gupta * Profile Header -> Chat Profile fixes (#647) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * fix: notifs * fix: correct theme colors * fix: renaming profileHeader * fix: qa fixes * fix: loader * refactor: resolved issues * fix: edit types --------- Co-authored-by: Nilesh Gupta * fix: resolved package not added issue * Fix: modal issue in group info && alert remove members (#653) * fix: modal * fix: update changes * refactor: resolved issue --------- Co-authored-by: Nilesh Gupta * fix: QA fixes (#654) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * Connect btn revamp (#668) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container * feat: adding rainbowkit for btn * fix: fix issues * fix: addec onnect functionality * fix: connect button * fix: added hack for rainbowkit css --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * Typebar UI issue (#666) * fix: fixed typebar space not working and theme * fix: fixed gif and emoji --------- Co-authored-by: KlausMikhaelson * fix: fixed theme colours * fix: added theme for brb * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * fix: added filter hat * fix: merged with main * fix: fixed msg border * fix: fixed theme * fix: fixed fonts * fix: fixed bug * Access control (#672) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * fix: added minor fix --------- Co-authored-by: Monalisha Mishra * fix: fixed padding issues * fix(f): fixed build issues * fix: fix for chat status test * feat: added verification option to show only on token gated groups * fix: fixing group access control * Check rules access control (#678) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * 662 group access control v2 changes (#663) * fix: spaces access API * fix: custom endpoint doc impl * Update README.md * Update README.md * fix: review comments change * fix: read me update * Update README.md * Update README.md * fix: origin in user creation (#665) * fix: origin in user creation * Update README.md * fix: review comments * 662 group access control v2 changes (#677) * fix: spaces access API * fix: custom endpoint doc impl * Update README.md * Update README.md * fix: review comments change * fix: read me update * Update README.md * Update README.md * fix(spaces): broadcast changes and UX fixes (#674) * fix: fix UI grid view (#642) * fix: fix UI grid view * refactor: conditional added * fix: resolved muting/unmuting try catch error (#657) * fix(spaces): fix livepeer broadcast (#656) * fix(spaces): fix livepeer broadcast * fix(spaces): fix data shown for unjoined space & promote listener logic --------- Co-authored-by: Madhur Gupta * refactor(spaces): use local state instead of get from server while meta message fire (#676) --------- Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Nilesh Gupta * feat: added verification option to show only on token gated groups * fix: fixing group access control --------- Co-authored-by: Monalisha Mishra Co-authored-by: Mohammed S Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Nilesh Gupta * fix: fixed build * feat: added send request to join group * fix: fixed verification on send * fix: fixed verify access btn not showing after joining group * fix: fixed join group showing for members too * fix: fixed join group showing to members * 667 chat.send enhancement (#673) * fix: changes messageObj for meta and reaction message type * fix: enhance send fn * fix: fixed intent issues * 680 group rules cosmetic changes (#682) * fix: fixed guild condition * fix: add did validation * fix: fixed * fix: fixed minor issues * fix: fixe dissue * fix: fixed minor issues * fix: check for scroll * fix: fixed scrolling * fix: fixed theme * fix: fixed * fix: fixed * fix: fixed * fix: fixed issues * fix: fixed * feat: added toast in join group btn for pvt groups * fix: fixed blurr --------- Co-authored-by: Monalisha Mishra Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> Co-authored-by: Kolade Co-authored-by: Nilesh Gupta Co-authored-by: Mohammed S Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Aman Gupta * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.3 * Join group option (#687) * feat: created architechture * fix: added context values (#594) * Chat dataprovider (#596) * feat: data provider for chat component * fix: replaced react.usestate to usestate * fix: added props as the initial state and changed state name * fix: reverted chat context changes and renamed values * fix: added test page for chat ui components (#597) * added chatbubble component (#602) * feat: added chatbubble component * fix: made the messageBubble's width to fit-content --------- Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * fix: added theme * Group chat bubble (#604) * feat: moved test component to testui folder & replaced dummy data with sdk response * feat: added twitter card and address for group chat received msg * feat: made the messageaddress reusable, added account from context * fix: removed unnecessary div and unused props and console logs * feat: adding pfp in text bubbles * fix: replaced hook with function and added pfp to messagebubble * fix: fixed image alignment * fix: changed border-radius of msg bubble and changed function name * fix: fixed theme and decryptedPrivateKey name (#616) * fix: fixed theme and decryptedPrivateKey name * fix: fixed bug * fix: fixed theme reviews * Message list (#615) * fix: message list comp * fix: message list comp * fix: added pagination * fix: added pagination * fix: pagination * fix: create useChatData hook * fix: fixed minor bug * fix: socket issues fixed * fix: added theme in msgbubble (#620) * fix: added theme in msgbubble * fix: fixed import --------- Co-authored-by: Monalisha Mishra * fix: exported the theme (#623) * fix: exported the theme * fix: fixed issues --------- Co-authored-by: Monalisha Mishra * Typebar component (#631) * feat: added typebar UI * feat: added functions to typebar * fix: added icon * fix: fixed theme issues --------- Co-authored-by: Monalisha Mishra * feat: added connectbutton * fix: fixed connectbtn ui and remove disconnect and fixed error on disconnect * fix: fixed create account getting called twice * Profile Header Component (#636) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * Message container (#635) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * fix: updated svg to react component * fix: changed svg to tsx component * fix: fixed review changes (#646) * fix: fixed review changes * fix: resolved issues --------- Co-authored-by: Nilesh Gupta * Profile Header -> Chat Profile fixes (#647) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * fix: notifs * fix: correct theme colors * fix: renaming profileHeader * fix: qa fixes * fix: loader * refactor: resolved issues * fix: edit types --------- Co-authored-by: Nilesh Gupta * fix: resolved package not added issue * Fix: modal issue in group info && alert remove members (#653) * fix: modal * fix: update changes * refactor: resolved issue --------- Co-authored-by: Nilesh Gupta * fix: QA fixes (#654) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * Connect btn revamp (#668) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container * feat: adding rainbowkit for btn * fix: fix issues * fix: addec onnect functionality * fix: connect button * fix: added hack for rainbowkit css --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * Typebar UI issue (#666) * fix: fixed typebar space not working and theme * fix: fixed gif and emoji --------- Co-authored-by: KlausMikhaelson * fix: fixed theme colours * fix: added theme for brb * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * fix: added filter hat * fix: merged with main * fix: fixed msg border * fix: fixed theme * fix: fixed fonts * fix: fixed bug * Access control (#672) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * fix: added minor fix --------- Co-authored-by: Monalisha Mishra * fix: fixed padding issues * fix(f): fixed build issues * fix: fix for chat status test * feat: added verification option to show only on token gated groups * fix: fixing group access control * Check rules access control (#678) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * 662 group access control v2 changes (#663) * fix: spaces access API * fix: custom endpoint doc impl * Update README.md * Update README.md * fix: review comments change * fix: read me update * Update README.md * Update README.md * fix: origin in user creation (#665) * fix: origin in user creation * Update README.md * fix: review comments * 662 group access control v2 changes (#677) * fix: spaces access API * fix: custom endpoint doc impl * Update README.md * Update README.md * fix: review comments change * fix: read me update * Update README.md * Update README.md * fix(spaces): broadcast changes and UX fixes (#674) * fix: fix UI grid view (#642) * fix: fix UI grid view * refactor: conditional added * fix: resolved muting/unmuting try catch error (#657) * fix(spaces): fix livepeer broadcast (#656) * fix(spaces): fix livepeer broadcast * fix(spaces): fix data shown for unjoined space & promote listener logic --------- Co-authored-by: Madhur Gupta * refactor(spaces): use local state instead of get from server while meta message fire (#676) --------- Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Nilesh Gupta * feat: added verification option to show only on token gated groups * fix: fixing group access control --------- Co-authored-by: Monalisha Mishra Co-authored-by: Mohammed S Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Nilesh Gupta * fix: fixed build * feat: added send request to join group * fix: fixed verification on send * fix: fixed verify access btn not showing after joining group * fix: fixed join group showing for members too * fix: fixed join group showing to members * 667 chat.send enhancement (#673) * fix: changes messageObj for meta and reaction message type * fix: enhance send fn * fix: fixed intent issues * 680 group rules cosmetic changes (#682) * fix: fixed guild condition * fix: add did validation * fix: fixed * fix: fixed minor issues * fix: fixe dissue * fix: fixed minor issues * fix: check for scroll * fix: fixed scrolling * fix: fixed theme * fix: fixed * fix: fixed * fix: fixed * fix: fixed issues * fix: fixed * feat: added toast in join group btn for pvt groups * fix: fixed blurr * fix: fixed minor issues rules * fix: fixed * fix: fixed --------- Co-authored-by: Satyam <100528412+KlausMikhaelson@users.noreply.github.com> Co-authored-by: KlausMikhaelson Co-authored-by: Kolade Co-authored-by: Nilesh Gupta Co-authored-by: Mohammed S Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Aman Gupta * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.4 * Join group option (#688) * feat: created architechture * fix: added context values (#594) * Chat dataprovider (#596) * feat: data provider for chat component * fix: replaced react.usestate to usestate * fix: added props as the initial state and changed state name * fix: reverted chat context changes and renamed values * fix: added test page for chat ui components (#597) * added chatbubble component (#602) * feat: added chatbubble component * fix: made the messageBubble's width to fit-content --------- Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * fix: added theme * Group chat bubble (#604) * feat: moved test component to testui folder & replaced dummy data with sdk response * feat: added twitter card and address for group chat received msg * feat: made the messageaddress reusable, added account from context * fix: removed unnecessary div and unused props and console logs * feat: adding pfp in text bubbles * fix: replaced hook with function and added pfp to messagebubble * fix: fixed image alignment * fix: changed border-radius of msg bubble and changed function name * fix: fixed theme and decryptedPrivateKey name (#616) * fix: fixed theme and decryptedPrivateKey name * fix: fixed bug * fix: fixed theme reviews * Message list (#615) * fix: message list comp * fix: message list comp * fix: added pagination * fix: added pagination * fix: pagination * fix: create useChatData hook * fix: fixed minor bug * fix: socket issues fixed * fix: added theme in msgbubble (#620) * fix: added theme in msgbubble * fix: fixed import --------- Co-authored-by: Monalisha Mishra * fix: exported the theme (#623) * fix: exported the theme * fix: fixed issues --------- Co-authored-by: Monalisha Mishra * Typebar component (#631) * feat: added typebar UI * feat: added functions to typebar * fix: added icon * fix: fixed theme issues --------- Co-authored-by: Monalisha Mishra * feat: added connectbutton * fix: fixed connectbtn ui and remove disconnect and fixed error on disconnect * fix: fixed create account getting called twice * Profile Header Component (#636) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * Message container (#635) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * fix: updated svg to react component * fix: changed svg to tsx component * fix: fixed review changes (#646) * fix: fixed review changes * fix: resolved issues --------- Co-authored-by: Nilesh Gupta * Profile Header -> Chat Profile fixes (#647) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * fix: notifs * fix: correct theme colors * fix: renaming profileHeader * fix: qa fixes * fix: loader * refactor: resolved issues * fix: edit types --------- Co-authored-by: Nilesh Gupta * fix: resolved package not added issue * Fix: modal issue in group info && alert remove members (#653) * fix: modal * fix: update changes * refactor: resolved issue --------- Co-authored-by: Nilesh Gupta * fix: QA fixes (#654) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * Connect btn revamp (#668) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container * feat: adding rainbowkit for btn * fix: fix issues * fix: addec onnect functionality * fix: connect button * fix: added hack for rainbowkit css --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * Typebar UI issue (#666) * fix: fixed typebar space not working and theme * fix: fixed gif and emoji --------- Co-authored-by: KlausMikhaelson * fix: fixed theme colours * fix: added theme for brb * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * fix: added filter hat * fix: merged with main * fix: fixed msg border * fix: fixed theme * fix: fixed fonts * fix: fixed bug * Access control (#672) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * fix: added minor fix --------- Co-authored-by: Monalisha Mishra * fix: fixed padding issues * fix(f): fixed build issues * fix: fix for chat status test * feat: added verification option to show only on token gated groups * fix: fixing group access control * Check rules access control (#678) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * 662 group access control v2 changes (#663) * fix: spaces access API * fix: custom endpoint doc impl * Update README.md * Update README.md * fix: review comments change * fix: read me update * Update README.md * Update README.md * fix: origin in user creation (#665) * fix: origin in user creation * Update README.md * fix: review comments * 662 group access control v2 changes (#677) * fix: spaces access API * fix: custom endpoint doc impl * Update README.md * Update README.md * fix: review comments change * fix: read me update * Update README.md * Update README.md * fix(spaces): broadcast changes and UX fixes (#674) * fix: fix UI grid view (#642) * fix: fix UI grid view * refactor: conditional added * fix: resolved muting/unmuting try catch error (#657) * fix(spaces): fix livepeer broadcast (#656) * fix(spaces): fix livepeer broadcast * fix(spaces): fix data shown for unjoined space & promote listener logic --------- Co-authored-by: Madhur Gupta * refactor(spaces): use local state instead of get from server while meta message fire (#676) --------- Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Nilesh Gupta * feat: added verification option to show only on token gated groups * fix: fixing group access control --------- Co-authored-by: Monalisha Mishra Co-authored-by: Mohammed S Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Nilesh Gupta * fix: fixed build * feat: added send request to join group * fix: fixed verification on send * fix: fixed verify access btn not showing after joining group * fix: fixed join group showing for members too * fix: fixed join group showing to members * 667 chat.send enhancement (#673) * fix: changes messageObj for meta and reaction message type * fix: enhance send fn * fix: fixed intent issues * 680 group rules cosmetic changes (#682) * fix: fixed guild condition * fix: add did validation * fix: fixed * fix: fixed minor issues * fix: fixe dissue * fix: fixed minor issues * fix: check for scroll * fix: fixed scrolling * fix: fixed theme * fix: fixed * fix: fixed * fix: fixed * fix: fixed issues * fix: fixed * feat: added toast in join group btn for pvt groups * fix: fixed blurr * fix: fixed minor issues rules * fix: fixed * fix: fixed * fix: fixed socket issue * fix: fixed --------- Co-authored-by: Satyam <100528412+KlausMikhaelson@users.noreply.github.com> Co-authored-by: KlausMikhaelson Co-authored-by: Kolade Co-authored-by: Nilesh Gupta Co-authored-by: Mohammed S Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Aman Gupta * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.5 * fix: fixed (#689) * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.6 * chat Load issue fixed (#690) * fix: fixed * fix: fixed minor issues * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.7 * fix: fixed msg bubble width (#691) * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.8 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.17 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.18 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.19 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.33 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.33 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.9 * Onboarding blocknative (#702) * fix: added reusable folder * fix: fixed theme for modal * fix: removed reusables from export * fix: fixed fallback for message input * feat: replaced rainbowkit with blocknative * fix: removed unused code --------- Co-authored-by: Monalisha Mishra * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.10 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.33 * Fix connect button issue (#710) * fix: fixed connect button blocknative * fix: fixed message fetching * fix: removed console * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.11 * fix: added condition while showing tokengatedIcon (#715) * fix: added disconnect for wallet (#721) * fix: added disconnect for wallet * fix: added autoConnect * Wallet disconnect (#722) * fix: added disconnect for wallet * fix: added autoConnect * fix: changed onClick to onGetTokenClick * Wallet disconnect (#723) * fix: added disconnect for wallet * fix: added autoConnect * fix: changed onClick to onGetTokenClick * fix: fixed errors * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.12 * Changed messageInput params Case (#725) * fix: added disconnect for wallet * fix: added autoConnect * fix: changed onClick to onGetTokenClick * fix: fixed errors * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.13 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.20 * Wallet disconnect (#728) * fix: added disconnect for wallet * fix: added autoConnect * fix: changed onClick to onGetTokenClick * fix: fixed errors * fix: added coinbase wallet * fix: img added * fix: fixed metamask not showing if not present in it --------- Co-authored-by: KlausMikhaelson * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.14 * Wallet disconnect (#732) * fix: added disconnect for wallet * fix: added autoConnect * fix: changed onClick to onGetTokenClick * fix: fixed errors * fix: added coinbase wallet * fix: img added * fix: fixed metamask not showing if not present in it * fix: fixed injected wallets --------- Co-authored-by: KlausMikhaelson * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.15 * fix: added class based implementation for notification (#699) * fix: added class based implementation for notification * fix: class based implementation for notification * fix: small fixes * fix: minor fixes and testcases * fix: fixes for testcases * fix: updated core abi and minor fixes * fix: removed comment * fix: minor fixes and additional checks * fix: minor fixes * fix: viem support for contract and new folder structure * fix: changed typescript 5.0.2 and configured eslint * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.34 * 720 pushstream class implementation (#729) * chore: added an example of automated chat using the new class based initialization * fix: fixed usecases * chore: added an example of automated chat using the new class based iā€¦ (#712) * chore: added an example of automated chat using the new class based initialization * fix: fixed usecases --------- Co-authored-by: aman035 * chore(automated chat example): tweaked automated chat example * fix: stream changes * fix: stream changes * fix: added chat.decrypt (#726) * fix: added chat.decrypt * fix: fix examples * fix: stream changes * fix: PUSH Stream Changes * fix: chat classes split * fix: Notification socket initialisations and rules backward compatibility * fix: added message decrypt * fix: review comments * fix: socket events * fix: test case fix and UserInfo to user * fix: rip PushNotification class * fix: additional check --------- Co-authored-by: harshrajat Co-authored-by: aman035 Co-authored-by: Harsh | Push Co-authored-by: akp111 * fix: remove only from test * fix: error fixed * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.35 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.35 * fix: stream cases * 720 pushstream class implementation (#737) * fix: stream changes * fix: stream changes * fix: stream changes * fix: PUSH Stream Changes * fix: chat classes split * fix: Notification socket initialisations and rules backward compatibility * fix: added message decrypt * fix: review comments * fix: socket events * fix: test case fix and UserInfo to user * fix: rip PushNotification class * fix: additional check * fix: minor fixes --------- Co-authored-by: Mohammed S * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.21 * fix: corrected example * fix: some changes on stream * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.36 * fix: minor fixes * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.37 * fix: error handling in socket events * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.38 * fix: more fixes * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.39 * fix: minor fixes * fix: socket enabled * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.40 * fix: minor fixes * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.41 * Add counter for update channel (#740) * fix: added counter to update group * fix: added counter logic, moved delegate and alias function to channel class * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.42 * Add counter for update channel (#741) * fix: added counter to update group * fix: added counter logic, moved delegate and alias function to channel class * fix: added readme for notification * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.43 * fix: minor fix * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.14 * fix: log removed * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.44 * docs: fix tests * Feat/space backup (#746) * refactor: added code for joining livekit room for listeners (#731) * feat: drop in livekit inplace of livepeer (#736) * feat: drop in livekit inplace of livepeer * feat: added microphone * feat: added mic * feat: added access control --------- Co-authored-by: Nilesh Gupta * fix: Notification event mutation * Notification setting changes (#752) * Arbitrum changes (#735) * fix: inital implementation for arbitrum changes * fix: more changes * fix: added final changes * fix: minor fixes * fix: fixed typo * fix: notification settings related changes * fix: added index parameter for notification * fix: restored config * Arnab/livekit fixes (#754) * refactor: added code for joining livekit room for listeners (#731) * feat: drop in livekit inplace of livepeer * feat: added microphone * feat: added mic * feat: added access control * feat: fixes for livekit API call --------- Co-authored-by: Nilesh Gupta * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.22 * fix: added settings * fix: added settings (#762) * fix: build fix * fix: minor fix * fix: minor fix * Added initial chat sidebar * fix: pagination done * fix: added fuse network * Working stream with hacks, working badges, working loading, partial loading, not working accept stream * fix: focus back to message input after sending the message (#1014) * fix: added support for ens (#1008) * feat: add video SDK v2 and video stream (#1017) * add: ethers support (#952) * fix: fix viem support, add ethers support * fix: remove @pushprotocol/socket dependency from restapi * fix: changed ethers fn * fix: fix ether changes * fix: fix subscribev2 * chore: readme changes * fix: fix ethers provider issue * fix: fix channel.update * feat(video-v2): add video v2 class and stream (#930) * feat(video-v2): add highlevel video class * feat(video): add video stream * fix(sendnotification): modify rules.access.data to be an object & code cleanup * fix(video): remove signer from input, throw err if signer, decrypted pgp key not found * feat(video): add sendNotification calls in connect, disconnect methods * fix(videonotificationrules): typo in VideoNotificationRules interface * feat(video stream): handle connect, retry internally from the SDK * feat(video connect): remove the connect method from the videov2 SDK * fix(videov2): create push signer instance to get chain id in initialize() * fix(video stream): add backwards compatibilty to rules object for older SDK versions * fix(video stream): fix bug in rules object creation * feat(video): update param names for video.initialize() * feat(video): add internal event handlers for stream in video SDK --------- Co-authored-by: Mohammed S --------- Co-authored-by: Aman Gupta Co-authored-by: Mohammed S * fix: Added ethersV6SignerType in uiweb signer types (#1018) * fix: added pushUser and stream (#1023) * fix: case sensative file inclusion (#1024) * fix: added themisation and ens resolve * fix: fixed a bug * 963 improvement proposal support for fuse network (#1026) * fix: case sensative file inclusion * fix: changed icon dimesnion * streaming tweaks * streaming tweaks with connected in restapi * fix(video stream): add video event type enum in CONSTANTS (#1032) * fix: added search for chatPreviewList * fix: added error codes * frontend react demo adjustment and rebasing * duplicate import fix * fix: refatored code * fix: changed chatSender to chatParticipant * adding onChatSelected and onUnreadCountChange * fix: name change fix --------- Co-authored-by: aman035 Co-authored-by: Mohammed S Co-authored-by: Mohammed S Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> Co-authored-by: Satyam <100528412+KlausMikhaelson@users.noreply.github.com> Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta Co-authored-by: Monalisha Mishra Co-authored-by: Kolade Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Ashis Kumar Pradhan <38760485+akp111@users.noreply.github.com> Co-authored-by: akp111 Co-authored-by: Pritipriya Singh * fix: fix errors * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.64 * fix: changed stream type to any * fix: changed stream type to any * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.16 * fix: minor change * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.17 * fix: minor fix * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * fix: fixed issues on chatpreviewlist (#1044) * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.37 * fix: added a dynamic component for no chatId (#1042) * fix: changed pushUser to user (#1058) * Chatpreview bug (#1063) * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.61 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.62 * ci(restapi): šŸŽ‰ cut release to restapi-v0.9.0 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.63 * fix: fix errors * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.64 * fix: changed stream type to any * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.16 * fix: minor change * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.17 * fix: minor fix * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.37 * fix: fixed pagination bug and added functions for preload * fix: added review comments --------- Co-authored-by: Mohammed S * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.38 * fix: fixed minor limit bug (#1065) * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * Bug fix (#1068) * fix: fixed minor limit bug * fix: exposed chatParticipant * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.40 * Chatprofile (#1040) * Added initial chat sidebar * fix: pagination done * Working stream with hacks, working badges, working loading, partial loading, not working accept stream * fix: added themisation and ens resolve * fix: fixed a bug * streaming tweaks * streaming tweaks with connected in restapi * fix: added search for chatPreviewList * fix: added error codes * frontend react demo adjustment and rebasing * duplicate import fix * fix: refatored code * fix: addec chat profile and create group changes * fix: changed chatSender to chatParticipant * fix: fixed scroll when not needed * fix: changed group size * fix: stream not getting connected * fix: tested socket events * fix: fixed bugs --------- Co-authored-by: harshrajat Co-authored-by: Pritipriya Singh Co-authored-by: KlausMikhaelson * fix: fixed preview bugs (#1078) * Userprofile (#1084) * feat(video-v2): add highlevel video class * feat(video): add video stream * fix(sendnotification): modify rules.access.data to be an object & code cleanup * fix(video): remove signer from input, throw err if signer, decrypted pgp key not found * feat(video): add sendNotification calls in connect, disconnect methods * fix(videonotificationrules): typo in VideoNotificationRules interface * add: useStream.ts video-v2-example-app * add: videoV2.tsx in video-v2-example-app * feat(video stream): handle connect, retry internally from the SDK * feat(video connect): remove the connect method from the videov2 SDK * fix(videov2): create push signer instance to get chain id in initialize() * fix(videov2-example): refactor react example component & remove useStream hook * fix(video stream): add backwards compatibilty to rules object for older SDK versions * fix(video stream): fix bug in rules object creation * fix(video stream): call connect() for ApproveVideo event * feat(example-video-1.5): video v2 example app implementation * feat(sdk-frontend): few ui changes * fix(video-v2-example-app): initialisevdeo call after a call ends * feat(video stream): add request, deny evennt handlers * feat(sdk-frontend and sdk-frontend-react): added video-v2 example implementation * fix: few fixes * refactor: refator and remove console logs * fix: fix import error * feat(video): update param names for video.initialize() * fix: param name changes * chore: added few comments * chore: ui toast added * fix(video example): remove pushprotocol sdk direct dir reference for initVideoCallData * fix(video example): import React in examples & update SDK version in sdk-frontend * feat(video example): replace video events from CONSTANTS obj * Edited video example to make it more versatile * Update index.js * fix: added layout for userProfile * fix: added modal * fix: added modal * fix: added modal content * fix: added theme for userprofile * fix: fixed bugs in profile --------- Co-authored-by: Madhur Gupta Co-authored-by: Siddesh Sankhya <79219618+Siddesh7@users.noreply.github.com> Co-authored-by: Siddesh Co-authored-by: harshrajat Co-authored-by: Harsh | Push * fix: removed console * fix: fixed length issue in test * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.41 * fix: fixed pagination bug * fix: the messages disappearing on scroll (#1077) Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * fix: fixed chat preview stream issues (#1085) * 897 improvement proposal spaces high level functions (#898) * fix: spaces high level * fix: spaces high level function * fix: spaces test cases * fix: spaces stream changes * fix: removed unnecessary logs * Add spaces high level audio methods (#993) * feat(spaces): add high level audio methods * fix: socket url fix (#995) * feat(spaces-highlevel-audio-methods): add media function in Spaces class --------- Co-authored-by: Mohammed S * feat(space stream): add 'start', 'stop' events (#1027) * fix(high level spaces sdk): fix list() method to uses spaces(), requests() methods (#1061) --------- Co-authored-by: Madhur Gupta * fix(restapi): build errors from spaces (#1098) * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.65 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.42 * feat(spaces v2): update space.initialize() param name, rename media() in SpacesV2 (#1101) * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.66 * fix: media emoji added * fix: sending first message now shows in the inbox * fix: for requests for receivers * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.43 * fix: added notification widget layout (#1076) * feat(video-v2): add highlevel video class * feat(video): add video stream * fix(sendnotification): modify rules.access.data to be an object & code cleanup * fix(video): remove signer from input, throw err if signer, decrypted pgp key not found * feat(video): add sendNotification calls in connect, disconnect methods * fix(videonotificationrules): typo in VideoNotificationRules interface * add: useStream.ts video-v2-example-app * add: videoV2.tsx in video-v2-example-app * feat(video stream): handle connect, retry internally from the SDK * feat(video connect): remove the connect method from the videov2 SDK * fix(videov2): create push signer instance to get chain id in initialize() * fix(videov2-example): refactor react example component & remove useStream hook * fix(video stream): add backwards compatibilty to rules object for older SDK versions * fix(video stream): fix bug in rules object creation * fix(video stream): call connect() for ApproveVideo event * feat(example-video-1.5): video v2 example app implementation * feat(sdk-frontend): few ui changes * fix(video-v2-example-app): initialisevdeo call after a call ends * feat(video stream): add request, deny evennt handlers * feat(sdk-frontend and sdk-frontend-react): added video-v2 example implementation * fix: few fixes * refactor: refator and remove console logs * fix: fix import error * feat(video): update param names for video.initialize() * fix: param name changes * chore: added few comments * chore: ui toast added * fix(video example): remove pushprotocol sdk direct dir reference for initVideoCallData * fix(video example): import React in examples & update SDK version in sdk-frontend * feat(video example): replace video events from CONSTANTS obj * Edited video example to make it more versatile * Update index.js * fix: fixed message parsing (#1051) * Minor fixes and improvements in video v2 (#1062) * feat(video v2): add VIDEO constants and types * feat(video v2): modify approve, deny to use internally stored peerInfo * fix(video constants): rename DEFAULT_DATA to INITIAL_DATA * 1050 update video example implementation in sdk-frontend (#1070) * fix: use latest imports in example app * feat: use latest rainbowkit library * chore: use latest restapi package * chore: remove unnecessary libs * fix: fixed signer bug (#1073) * fix: send intent in history and latest. (#1069) * fix: send intent in history and latest. * fix: get chat info API sdk changes * fix: stream helper functions * fix: caching implementation on user profile API (#1053) * fix: caching implementation on user profile API * fix: cache code review comments * fix: fix public key in read mode (#1074) * fix: added notification widget layout * fix: fixed naming convention * fix: added layout for hyperlink * Pub key cache to speed up chat messages verification (#1081) * fix: minor fixes * fix: cache implementation for public keys * fix: fix encV1 key decryption (#1088) * fix: add benchamark tests, fix reference msgs' (#1089) * fix: added resuables * bolierplate examples * bolierplate examples * bolierplate examples * fix: added connect button * fix: fixed lint * fix: v2 user creation / upgrades / downgrades (#1099) * fix: fix v2 user * test: remove only * Add filter for subscription (#1102) * fix: added parsing for settings * fix: minor fixes * fix: added manage notifiction * fix: added channel setting parse logic (#1107) * fix: fixed css * added user downgrade example * fix: fixed lint * fix: fixed connect modal * fix: added readmode * fix: fixed readMode --------- Co-authored-by: Madhur Gupta Co-authored-by: Siddesh Sankhya <79219618+Siddesh7@users.noreply.github.com> Co-authored-by: Siddesh Co-authored-by: harshrajat Co-authored-by: Harsh | Push Co-authored-by: Aman Gupta Co-authored-by: Mohammed S Co-authored-by: Ashis Kumar Pradhan <38760485+akp111@users.noreply.github.com> Co-authored-by: Mohammed S * fix: fixed build issues * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.44 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.67 * Alpha deployment (#1112) * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.61 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.62 * ci(restapi): šŸŽ‰ cut release to restapi-v0.9.0 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.63 * fix: fix errors * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.64 * fix: changed stream type to any * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.16 * fix: minor change * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.17 * fix: minor fix * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.37 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.38 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.40 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.41 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.65 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.42 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.66 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.43 * fix: fixed build issues --------- Co-authored-by: Mohammed S * fix: fixed minor bugs * Alpha deployment (#1114) * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.61 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.62 * ci(restapi): šŸŽ‰ cut release to restapi-v0.9.0 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.63 * fix: fix errors * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.64 * fix: changed stream type to any * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.16 * fix: minor change * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.17 * fix: minor fix * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.37 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.38 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.40 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.41 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.65 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.42 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.66 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.43 * fix: fixed build issues * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.44 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.67 * fix: fixed minor bugs --------- Co-authored-by: Mohammed S * fix: fixed chatpreview and widget issues * Alpha deployment (#1116) * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.61 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.62 * ci(restapi): šŸŽ‰ cut release to restapi-v0.9.0 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.63 * fix: fix errors * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.64 * fix: changed stream type to any * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.16 * fix: minor change * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.17 * fix: minor fix * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.37 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.38 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.40 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.41 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.65 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.42 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.66 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.43 * fix: fixed build issues * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.44 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.67 * fix: fixed minor bugs * fix: fixed chatpreview and widget issues --------- Co-authored-by: Mohammed S * fix: fixed chat bugs * 1119 read only mode bug fix (#1120) * fix: optimize chat.list (#1115) * fix: read only guest mode * fix: review comments --------- Co-authored-by: Aman Gupta * fix: fixed readmode * Alpha deployment (#1121) * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.61 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.62 * ci(restapi): šŸŽ‰ cut release to restapi-v0.9.0 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.63 * fix: fix errors * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.64 * fix: changed stream type to any * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.16 * fix: minor change * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.17 * fix: minor fix * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.37 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.38 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.40 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.41 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.65 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.42 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.66 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.43 * fix: fixed build issues * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.44 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.67 * fix: fixed minor bugs * fix: fixed chatpreview and widget issues * fix: fixed chat bugs * fix: fixed readmode --------- Co-authored-by: Mohammed S * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.68 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.68 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.70 * Mark ethers optional (#1124) * fix: optimize chat.list (#1115) * fix: allow groupImage and groupDesc to be updated to null (#1118) * fix: mark ethers as optional peer dependency * fix: change typeDataDomain * fix: update readme * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.71 * fix: added prefillChatList (#1122) * fix: troubleshoot * fix: fixed minor issue * Alpha deployment (#1132) * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.61 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.62 * ci(restapi): šŸŽ‰ cut release to restapi-v0.9.0 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.63 * fix: fix errors * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.64 * fix: changed stream type to any * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.16 * fix: minor change * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.17 * fix: minor fix * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.37 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.38 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.40 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.41 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.65 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.42 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.66 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.43 * fix: fixed build issues * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.44 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.67 * fix: fixed minor bugs * fix: fixed chatpreview and widget issues * fix: fixed chat bugs * fix: fixed readmode * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.68 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.68 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.70 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.71 --------- Co-authored-by: Mohammed S * fix: fixed gues mode user profile * fix: fixed subscription error * Minor changes in spaces v2 SDK (#1136) * refactor(spaces v2): call createUserAudio internally before start, join as speaker * fix(spaces v2): add a check before creating stream in start, join as speaker * fix(spaces v2): make 'private' param in space.create() as optional * feat(spaces v2): export space types, constants from TYPES, CONSTANTS * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.72 * Alpha deployment (#1134) * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.61 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.62 * ci(restapi): šŸŽ‰ cut release to restapi-v0.9.0 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.63 * fix: fix errors * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.64 * fix: changed stream type to any * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.16 * fix: minor change * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.17 * fix: minor fix * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.37 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.38 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.40 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.41 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.65 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.42 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.66 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.43 * fix: fixed build issues * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.44 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.67 * fix: fixed minor bugs * fix: fixed chatpreview and widget issues * fix: fixed chat bugs * fix: fixed readmode * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.68 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.68 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.70 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.71 * fix: troubleshoot * fix: fixed gues mode user profile * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.72 --------- Co-authored-by: Mohammed S * fix: stream connection support chat + pushUser to user fix (#1066) * fix: stream connection support chat + pushUser to user fix * fix: change console messages * fix: ens added * fix: z-index re added --------- Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * Alpha deployment (#1146) * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.61 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.62 * ci(restapi): šŸŽ‰ cut release to restapi-v0.9.0 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.63 * fix: fix errors * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.64 * fix: changed stream type to any * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.16 * fix: minor change * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.17 * fix: minor fix * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.37 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.38 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.40 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.41 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.65 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.42 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.66 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.43 * fix: fixed build issues * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.44 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.67 * fix: fixed minor bugs * fix: fixed chatpreview and widget issues * fix: fixed chat bugs * fix: fixed readmode * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.68 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.68 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.70 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.71 * fix: troubleshoot * fix: fixed gues mode user profile * fix: fixed subscription error * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.72 --------- Co-authored-by: Mohammed S * fix: z-index modal (#1152) * Revert "fix: z-index modal (#1152)" (#1153) This reverts commit 4e40221385750a240afde708c73d7b1221e5db0c. * Fix role change stream event (#1157) * fix: fix roleChange stream * fix: fix testcases * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.45 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.73 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.74 * Added channel.list API (#1160) * Added channel.list API * Added channel.list API * fix: horizontal scroll (#1156) * fix: horizontal scroll * fix: z-index of prodile modal * fix: remove chat profile z-index * fix: remove chat profile z-index * fix: modal overlay z-index inc * fix: added word break to parent * fix: revert z-index profile * fix: fixed span * Alpha deployment (#1178) * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.61 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.62 * ci(restapi): šŸŽ‰ cut release to restapi-v0.9.0 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.63 * fix: fix errors * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.64 * fix: changed stream type to any * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.16 * fix: minor change * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.17 * fix: minor fix * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.37 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.38 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.40 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.41 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.65 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.42 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.66 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.43 * fix: fixed build issues * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.44 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.67 * fix: fixed minor bugs * fix: fixed chatpreview and widget issues * fix: fixed chat bugs * fix: fixed readmode * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.68 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.68 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.70 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.71 * fix: troubleshoot * fix: fixed gues mode user profile * fix: fixed subscription error * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.72 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.45 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.73 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.74 * fix: fixed span --------- Co-authored-by: Mohammed S * fix: support chat scroll (#1184) * fix: support chat scroll * fix: when the scroll touches the last message it does fluctuate * Group fixes (#1182) * fix: fixed group minor issues * fix: fixed group fiex * fix: fixed user giving undefined for info (#1194) * Chatviewlist migration (#1164) * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.61 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.62 * ci(restapi): šŸŽ‰ cut release to restapi-v0.9.0 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.63 * fix: fix errors * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.64 * fix: changed stream type to any * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.16 * fix: minor change * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.17 * fix: minor fix * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.37 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.38 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.40 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.41 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.65 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.42 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.66 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.43 * fix: fixed build issues * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.44 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.67 * fix: fixed minor bugs * fix: fixed chatpreview and widget issues * fix: fixed chat bugs * fix: added fetch chT * fix: fix * fix: added fetching chat * fix: fixed lint issues * fix: fixed * fix: converted send to class based * fix: fixed * fix: debugging stream issue * fix: debugging stream issue * fix: hack for stream fix * fix: removed event listeners * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.15 * fix: fixed chat bugs * fix: fixing stream issue * fix: fixed lint * fix: temp fix for stream * fix: fixed --------- Co-authored-by: Mohammed S * Alpha deployment (#1200) * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.61 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.62 * ci(restapi): šŸŽ‰ cut release to restapi-v0.9.0 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.63 * fix: fix errors * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.64 * fix: changed stream type to any * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.16 * fix: minor change * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.17 * fix: minor fix * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.37 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.38 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.40 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.41 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.65 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.42 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.66 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.43 * fix: fixed build issues * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.44 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.67 * fix: fixed minor bugs * fix: fixed chatpreview and widget issues * fix: fixed chat bugs * fix: fixed readmode * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.68 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.68 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.70 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.71 * fix: troubleshoot * fix: fixed gues mode user profile * fix: fixed subscription error * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.72 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.45 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.73 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.74 * fix: fixed span --------- Co-authored-by: Mohammed S * Revert "Alpha deployment (#1200)" (#1201) This reverts commit 029e34d3a51a0ce4e0bc6adbad168e71b5c6129b. * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.75 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.75 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.77 * Chatviewlist migration (#1202) * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.61 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.62 * ci(restapi): šŸŽ‰ cut release to restapi-v0.9.0 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.63 * fix: fix errors * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.64 * fix: changed stream type to any * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.16 * fix: minor change * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.17 * fix: minor fix * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.37 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.38 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.39 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.40 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.41 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.65 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.42 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.66 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.43 * fix: fixed build issues * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.36 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.44 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.67 * fix: fixed minor bugs * fix: fixed chatpreview and widget issues * fix: fixed chat bugs * fix: added fetch chT * fix: fix * fix: added fetching chat * fix: fixed lint issues * fix: fixed * fix: converted send to class based * fix: fixed * fix: debugging stream issue * fix: debugging stream issue * fix: hack for stream fix * fix: removed event listeners * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.15 * fix: fixed chat bugs * fix: fixing stream issue * fix: fixed lint * fix: temp fix for stream * fix: fixed * fix: fixed copy --------- Co-authored-by: Mohammed S * feat(uiweb): return response in createGroupModal (#1198) * feat(uiweb): return response in createGroupModal return group information when group is successfully created in uiweb createGroupModal * fix: fixed build issue --------- Co-authored-by: Monalisha Mishra Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * feat(uiweb): return response in createGroupModal (#1198) (#1215) * feat(uiweb): return response in createGroupModal return group information when group is successfully created in uiweb createGroupModal * fix: fixed build issue --------- Co-authored-by: Siddesh Sankhya <79219618+Siddesh7@users.noreply.github.com> * Add Polygon Amoy Support (#1221) * feat: add Polygon Amoy Support * test: added amoy test cases --------- Co-authored-by: Pratham Bhatnagar Co-authored-by: aman035 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.78 * 1220 add polygon amoy support (#1222) * feat: add Polygon Amoy Support * test: added amoy test cases * fix: fix minor changes --------- Co-authored-by: Pratham Bhatnagar Co-authored-by: aman035 * fix: added instanceids for push user and stream (#1224) * 1223 return id for push api and stream init (#1226) * fix: added instanceids for push user and stream * fix: review comments * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.79 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.80 * fix: chat info changes * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.81 * fix: bug fixes * fix: renamed sender to account * fix: fix fn definitions (#1232) * fix: fix tmp error * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.82 --------- Co-authored-by: Aman Gupta Co-authored-by: Madhur Gupta Co-authored-by: Harsh | Push Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> Co-authored-by: Satyam <100528412+KlausMikhaelson@users.noreply.github.com> Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta Co-authored-by: Monalisha Mishra Co-authored-by: Kolade Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Ashis Kumar Pradhan <38760485+akp111@users.noreply.github.com> Co-authored-by: akp111 Co-authored-by: Pritipriya Singh Co-authored-by: harshrajat Co-authored-by: Siddesh Sankhya <79219618+Siddesh7@users.noreply.github.com> Co-authored-by: Siddesh Co-authored-by: Pratham Bhatnagar <84272138+pratham-bhatnagar@users.noreply.github.com> Co-authored-by: Pratham Bhatnagar --- .../src/app/ChatUITest/ChatProfile.tsx | 2 +- packages/restapi/CHANGELOG.md | 166 +++++++++++++ packages/restapi/package.json | 4 +- .../restapi/src/lib/chat/approveRequest.ts | 14 +- packages/restapi/src/lib/chat/chat.ts | 29 ++- packages/restapi/src/lib/chat/chats.ts | 39 +-- .../restapi/src/lib/chat/conversationHash.ts | 14 +- packages/restapi/src/lib/chat/createGroup.ts | 9 +- .../restapi/src/lib/chat/createGroupV2.ts | 11 +- packages/restapi/src/lib/chat/getChatInfo.ts | 21 +- .../restapi/src/lib/chat/getGroupAccess.ts | 5 +- .../src/lib/chat/getGroupMemberStatus.ts | 9 +- .../restapi/src/lib/chat/helpers/crypto.ts | 4 +- .../restapi/src/lib/chat/helpers/inbox.ts | 10 +- .../src/lib/chat/helpers/payloadHelper.ts | 10 +- .../restapi/src/lib/chat/helpers/service.ts | 10 +- packages/restapi/src/lib/chat/helpers/user.ts | 90 +------ .../restapi/src/lib/chat/helpers/validator.ts | 30 +-- .../restapi/src/lib/chat/rejectRequest.ts | 13 +- packages/restapi/src/lib/chat/requests.ts | 42 ++-- packages/restapi/src/lib/chat/send.ts | 9 +- packages/restapi/src/lib/chat/updateGroup.ts | 7 +- .../src/lib/chat/updateGroupMembers.ts | 7 +- packages/restapi/src/lib/helpers/address.ts | 223 +++++++++++++----- packages/restapi/src/lib/helpers/crypto.ts | 12 +- packages/restapi/src/lib/payloads/helpers.ts | 2 +- .../src/lib/payloads/sendNotifications.ts | 8 +- .../src/lib/pushNotification/notification.ts | 4 +- packages/restapi/src/lib/pushapi/PushAPI.ts | 4 +- packages/restapi/src/lib/pushapi/chat.ts | 46 ++-- packages/restapi/src/lib/pushapi/space.ts | 8 +- packages/restapi/src/lib/space/approve.ts | 76 +++--- packages/restapi/src/lib/space/requests.ts | 10 +- packages/restapi/src/lib/space/spaceFeed.ts | 10 +- packages/restapi/src/lib/space/spaces.ts | 14 +- .../restapi/src/lib/user/auth.updateUser.ts | 4 +- packages/restapi/src/lib/user/createUser.ts | 8 +- packages/restapi/src/lib/user/decryptAuth.ts | 4 +- packages/restapi/src/lib/user/getUser.ts | 4 +- .../restapi/src/lib/user/getUsersBatch.ts | 4 +- .../src/lib/user/profile.updateUser.ts | 11 +- packages/restapi/src/lib/user/upgradeUser.ts | 4 +- packages/restapi/src/lib/video/VideoV2.ts | 22 +- .../src/lib/video/helpers/validatePeerInfo.ts | 4 +- 44 files changed, 609 insertions(+), 428 deletions(-) diff --git a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatProfile.tsx b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatProfile.tsx index e70b393ea..3c82c76f7 100644 --- a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatProfile.tsx +++ b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatProfile.tsx @@ -8,7 +8,7 @@ export const ChatProfileTest = () => { chatProfileLeftHelperComponent={
left component
} chatProfileRightHelperComponent={
right component
} chatId='monalisha.wallet' -// chatId='d9c2d6fa7132d49ea6d1b570f0ebd2bcc45c1ecac726eab993ad91c574fbe3c6' +// chatId='36baf37e441fdd94e23406c6c716fc4e91a93a9ee68e070cd5b054534dbe09a6' /> ) diff --git a/packages/restapi/CHANGELOG.md b/packages/restapi/CHANGELOG.md index f75386e99..f9557fc17 100644 --- a/packages/restapi/CHANGELOG.md +++ b/packages/restapi/CHANGELOG.md @@ -2,6 +2,172 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver). +## [0.0.1-alpha.82](https://github.com/push-protocol/push-sdk/compare/restapi-0.0.1-alpha.81...restapi-0.0.1-alpha.82) (2024-04-16) + + +### Bug Fixes + +* bug fixes ([fab3700](https://github.com/push-protocol/push-sdk/commit/fab370073224481b901351c00da43dc3bc99fa64)) +* fix fn definitions ([#1232](https://github.com/push-protocol/push-sdk/issues/1232)) ([7bbc443](https://github.com/push-protocol/push-sdk/commit/7bbc4434ec19c9969d0f1932c9cb08f74300a9b8)) +* fix tmp error ([bd70cda](https://github.com/push-protocol/push-sdk/commit/bd70cda0eb68a2329da743727c3b2a4b7f14589e)) +* Merge branch 'alpha' into alpha-deployment ([7e32f93](https://github.com/push-protocol/push-sdk/commit/7e32f93153b2ef338a1c18d4c1c6df7b9a1687cf)) +* renamed sender to account ([ce4af1a](https://github.com/push-protocol/push-sdk/commit/ce4af1a200e98de3c47055cc495f55a4a8e561cf)) + + + +## [0.0.1-alpha.81](https://github.com/push-protocol/push-sdk/compare/restapi-0.0.1-alpha.80...restapi-0.0.1-alpha.81) (2024-04-15) + + +### Bug Fixes + +* chat info changes ([6718648](https://github.com/push-protocol/push-sdk/commit/67186484a4dff605ef94df83b19bb2d4a220e546)) +* Merge branch 'alpha' into alpha-deployment ([97f8390](https://github.com/push-protocol/push-sdk/commit/97f839020e9b0313548753c364f01795e6bc7b3d)) + + + +## [0.0.1-alpha.80](https://github.com/push-protocol/push-sdk/compare/restapi-0.0.1-alpha.79...restapi-0.0.1-alpha.80) (2024-04-13) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([ad37848](https://github.com/push-protocol/push-sdk/commit/ad3784890d97b09b7d6212cfcd6c868cb360cba2)) + + + +## [0.0.1-alpha.79](https://github.com/push-protocol/push-sdk/compare/restapi-0.0.1-alpha.78...restapi-0.0.1-alpha.79) (2024-04-12) + + +### Bug Fixes + +* added instanceids for push user and stream ([#1224](https://github.com/push-protocol/push-sdk/issues/1224)) ([34263c9](https://github.com/push-protocol/push-sdk/commit/34263c94ccfe674f915ce318a60cc21a77a0a5de)) +* Merge branch 'alpha' into alpha-deployment ([cb8d996](https://github.com/push-protocol/push-sdk/commit/cb8d996f868109a8e659a5654abfb265d2bb37ad)) + + + +## [0.0.1-alpha.78](https://github.com/push-protocol/push-sdk/compare/restapi-0.0.1-alpha.77...restapi-0.0.1-alpha.78) (2024-04-10) + + +### Bug Fixes + +* add decryptedPGPPrivateKey in options ([#1216](https://github.com/push-protocol/push-sdk/issues/1216)) ([ed9d3a7](https://github.com/push-protocol/push-sdk/commit/ed9d3a7e6ef3880fd897927e67d7db8e0a7b06c7)) +* fix testcases to take push node environment from .env rather thaā€¦ ([#1196](https://github.com/push-protocol/push-sdk/issues/1196)) ([7a4bd8d](https://github.com/push-protocol/push-sdk/commit/7a4bd8d7637fb17a714062a7b9ea055c889b0bf0)) +* Merge branch 'alpha' into alpha-deployment ([3d52b21](https://github.com/push-protocol/push-sdk/commit/3d52b21accc046b2133eaf15d13e0c945d793b1f)) +* tes cases and minor bugs ([#1212](https://github.com/push-protocol/push-sdk/issues/1212)) ([d30e095](https://github.com/push-protocol/push-sdk/commit/d30e095860ef20b8f8ef6a341d49f698227df998)) + + + +## [0.0.1-alpha.77](https://github.com/push-protocol/push-sdk/compare/restapi-0.0.1-alpha.76...restapi-0.0.1-alpha.77) (2024-04-02) + + + +## [0.0.1-alpha.75](https://github.com/push-protocol/push-sdk/compare/restapi-0.0.1-alpha.74...restapi-0.0.1-alpha.75) (2024-04-02) + + +### Bug Fixes + +* chat.info changes ([#1163](https://github.com/push-protocol/push-sdk/issues/1163)) ([b16b842](https://github.com/push-protocol/push-sdk/commit/b16b84289bc840d1a6a210726fe8350f0291ccf0)) +* error handling for chat ([#1110](https://github.com/push-protocol/push-sdk/issues/1110)) ([59f4c77](https://github.com/push-protocol/push-sdk/commit/59f4c7704c91653ac114baf75ea30cd0b839980f)) +* fix build ([#1176](https://github.com/push-protocol/push-sdk/issues/1176)) ([fefdf91](https://github.com/push-protocol/push-sdk/commit/fefdf912df6110cebbbaf8fbd47989ba727679b4)) +* fix channel notifications response ([#1166](https://github.com/push-protocol/push-sdk/issues/1166)) ([c01798a](https://github.com/push-protocol/push-sdk/commit/c01798af23f4f8cc2215fa9a529145d0c3bf349d)) +* fixed berachain issue ([6cd5dd8](https://github.com/push-protocol/push-sdk/commit/6cd5dd8ff77d7a916ce795b1238b381d20808786)) +* merge alpha ([4d1c5ef](https://github.com/push-protocol/push-sdk/commit/4d1c5ef2e0e6ce3382af6b811ffd6211ba15520d)) +* Merge branch 'main' into alpha ([53a795d](https://github.com/push-protocol/push-sdk/commit/53a795db5ec82d44597410dca670dfadd9199277)) +* **migrate goerli to sepolia:** migrate goerli to sepolia ([#1149](https://github.com/push-protocol/push-sdk/issues/1149)) ([490b104](https://github.com/push-protocol/push-sdk/commit/490b104902b9a509c6a8c68d5c5f33446e91e113)) +* pulled ([f22e9fb](https://github.com/push-protocol/push-sdk/commit/f22e9fb0bd7a1529d1f9ba79626ef37a32e76f31)) +* pulled main ([b7391b6](https://github.com/push-protocol/push-sdk/commit/b7391b6318b40117d61b86ea8163b116f757c94a)) + + + +## [0.0.1-alpha.75](https://github.com/push-protocol/push-sdk/compare/restapi-0.0.1-alpha.74...restapi-0.0.1-alpha.75) (2024-04-02) + + +### Bug Fixes + +* chat.info changes ([#1163](https://github.com/push-protocol/push-sdk/issues/1163)) ([b16b842](https://github.com/push-protocol/push-sdk/commit/b16b84289bc840d1a6a210726fe8350f0291ccf0)) +* error handling for chat ([#1110](https://github.com/push-protocol/push-sdk/issues/1110)) ([59f4c77](https://github.com/push-protocol/push-sdk/commit/59f4c7704c91653ac114baf75ea30cd0b839980f)) +* fix build ([#1176](https://github.com/push-protocol/push-sdk/issues/1176)) ([fefdf91](https://github.com/push-protocol/push-sdk/commit/fefdf912df6110cebbbaf8fbd47989ba727679b4)) +* fix channel notifications response ([#1166](https://github.com/push-protocol/push-sdk/issues/1166)) ([c01798a](https://github.com/push-protocol/push-sdk/commit/c01798af23f4f8cc2215fa9a529145d0c3bf349d)) +* fixed berachain issue ([6cd5dd8](https://github.com/push-protocol/push-sdk/commit/6cd5dd8ff77d7a916ce795b1238b381d20808786)) +* merge alpha ([4d1c5ef](https://github.com/push-protocol/push-sdk/commit/4d1c5ef2e0e6ce3382af6b811ffd6211ba15520d)) +* Merge branch 'main' into alpha ([53a795d](https://github.com/push-protocol/push-sdk/commit/53a795db5ec82d44597410dca670dfadd9199277)) +* **migrate goerli to sepolia:** migrate goerli to sepolia ([#1149](https://github.com/push-protocol/push-sdk/issues/1149)) ([490b104](https://github.com/push-protocol/push-sdk/commit/490b104902b9a509c6a8c68d5c5f33446e91e113)) +* pulled ([f22e9fb](https://github.com/push-protocol/push-sdk/commit/f22e9fb0bd7a1529d1f9ba79626ef37a32e76f31)) +* pulled main ([b7391b6](https://github.com/push-protocol/push-sdk/commit/b7391b6318b40117d61b86ea8163b116f757c94a)) + + + +## [0.0.1-alpha.75](https://github.com/push-protocol/push-sdk/compare/restapi-0.0.1-alpha.74...restapi-0.0.1-alpha.75) (2024-04-02) + + +### Bug Fixes + +* chat.info changes ([#1163](https://github.com/push-protocol/push-sdk/issues/1163)) ([b16b842](https://github.com/push-protocol/push-sdk/commit/b16b84289bc840d1a6a210726fe8350f0291ccf0)) +* error handling for chat ([#1110](https://github.com/push-protocol/push-sdk/issues/1110)) ([59f4c77](https://github.com/push-protocol/push-sdk/commit/59f4c7704c91653ac114baf75ea30cd0b839980f)) +* fix build ([#1176](https://github.com/push-protocol/push-sdk/issues/1176)) ([fefdf91](https://github.com/push-protocol/push-sdk/commit/fefdf912df6110cebbbaf8fbd47989ba727679b4)) +* fix channel notifications response ([#1166](https://github.com/push-protocol/push-sdk/issues/1166)) ([c01798a](https://github.com/push-protocol/push-sdk/commit/c01798af23f4f8cc2215fa9a529145d0c3bf349d)) +* fixed berachain issue ([6cd5dd8](https://github.com/push-protocol/push-sdk/commit/6cd5dd8ff77d7a916ce795b1238b381d20808786)) +* merge alpha ([4d1c5ef](https://github.com/push-protocol/push-sdk/commit/4d1c5ef2e0e6ce3382af6b811ffd6211ba15520d)) +* Merge branch 'main' into alpha ([53a795d](https://github.com/push-protocol/push-sdk/commit/53a795db5ec82d44597410dca670dfadd9199277)) +* **migrate goerli to sepolia:** migrate goerli to sepolia ([#1149](https://github.com/push-protocol/push-sdk/issues/1149)) ([490b104](https://github.com/push-protocol/push-sdk/commit/490b104902b9a509c6a8c68d5c5f33446e91e113)) +* pulled ([f22e9fb](https://github.com/push-protocol/push-sdk/commit/f22e9fb0bd7a1529d1f9ba79626ef37a32e76f31)) +* pulled main ([b7391b6](https://github.com/push-protocol/push-sdk/commit/b7391b6318b40117d61b86ea8163b116f757c94a)) + + + +## [0.0.1-alpha.75](https://github.com/push-protocol/push-sdk/compare/restapi-0.0.1-alpha.74...restapi-0.0.1-alpha.75) (2024-04-02) + + +### Bug Fixes + +* chat.info changes ([#1163](https://github.com/push-protocol/push-sdk/issues/1163)) ([b16b842](https://github.com/push-protocol/push-sdk/commit/b16b84289bc840d1a6a210726fe8350f0291ccf0)) +* error handling for chat ([#1110](https://github.com/push-protocol/push-sdk/issues/1110)) ([59f4c77](https://github.com/push-protocol/push-sdk/commit/59f4c7704c91653ac114baf75ea30cd0b839980f)) +* fix build ([#1176](https://github.com/push-protocol/push-sdk/issues/1176)) ([fefdf91](https://github.com/push-protocol/push-sdk/commit/fefdf912df6110cebbbaf8fbd47989ba727679b4)) +* fix channel notifications response ([#1166](https://github.com/push-protocol/push-sdk/issues/1166)) ([c01798a](https://github.com/push-protocol/push-sdk/commit/c01798af23f4f8cc2215fa9a529145d0c3bf349d)) +* fixed berachain issue ([6cd5dd8](https://github.com/push-protocol/push-sdk/commit/6cd5dd8ff77d7a916ce795b1238b381d20808786)) +* merge alpha ([4d1c5ef](https://github.com/push-protocol/push-sdk/commit/4d1c5ef2e0e6ce3382af6b811ffd6211ba15520d)) +* Merge branch 'main' into alpha ([53a795d](https://github.com/push-protocol/push-sdk/commit/53a795db5ec82d44597410dca670dfadd9199277)) +* **migrate goerli to sepolia:** migrate goerli to sepolia ([#1149](https://github.com/push-protocol/push-sdk/issues/1149)) ([490b104](https://github.com/push-protocol/push-sdk/commit/490b104902b9a509c6a8c68d5c5f33446e91e113)) +* pulled ([f22e9fb](https://github.com/push-protocol/push-sdk/commit/f22e9fb0bd7a1529d1f9ba79626ef37a32e76f31)) +* pulled main ([b7391b6](https://github.com/push-protocol/push-sdk/commit/b7391b6318b40117d61b86ea8163b116f757c94a)) + + + +## [0.0.1-alpha.75](https://github.com/push-protocol/push-sdk/compare/restapi-0.0.1-alpha.74...restapi-0.0.1-alpha.75) (2024-04-02) + + +### Bug Fixes + +* chat.info changes ([#1163](https://github.com/push-protocol/push-sdk/issues/1163)) ([b16b842](https://github.com/push-protocol/push-sdk/commit/b16b84289bc840d1a6a210726fe8350f0291ccf0)) +* error handling for chat ([#1110](https://github.com/push-protocol/push-sdk/issues/1110)) ([59f4c77](https://github.com/push-protocol/push-sdk/commit/59f4c7704c91653ac114baf75ea30cd0b839980f)) +* fix build ([#1176](https://github.com/push-protocol/push-sdk/issues/1176)) ([fefdf91](https://github.com/push-protocol/push-sdk/commit/fefdf912df6110cebbbaf8fbd47989ba727679b4)) +* fix channel notifications response ([#1166](https://github.com/push-protocol/push-sdk/issues/1166)) ([c01798a](https://github.com/push-protocol/push-sdk/commit/c01798af23f4f8cc2215fa9a529145d0c3bf349d)) +* fixed berachain issue ([6cd5dd8](https://github.com/push-protocol/push-sdk/commit/6cd5dd8ff77d7a916ce795b1238b381d20808786)) +* merge alpha ([4d1c5ef](https://github.com/push-protocol/push-sdk/commit/4d1c5ef2e0e6ce3382af6b811ffd6211ba15520d)) +* Merge branch 'main' into alpha ([53a795d](https://github.com/push-protocol/push-sdk/commit/53a795db5ec82d44597410dca670dfadd9199277)) +* **migrate goerli to sepolia:** migrate goerli to sepolia ([#1149](https://github.com/push-protocol/push-sdk/issues/1149)) ([490b104](https://github.com/push-protocol/push-sdk/commit/490b104902b9a509c6a8c68d5c5f33446e91e113)) +* pulled ([f22e9fb](https://github.com/push-protocol/push-sdk/commit/f22e9fb0bd7a1529d1f9ba79626ef37a32e76f31)) +* pulled main ([b7391b6](https://github.com/push-protocol/push-sdk/commit/b7391b6318b40117d61b86ea8163b116f757c94a)) + + + +## [0.0.1-alpha.75](https://github.com/push-protocol/push-sdk/compare/restapi-0.0.1-alpha.74...restapi-0.0.1-alpha.75) (2024-04-02) + + +### Bug Fixes + +* chat.info changes ([#1163](https://github.com/push-protocol/push-sdk/issues/1163)) ([b16b842](https://github.com/push-protocol/push-sdk/commit/b16b84289bc840d1a6a210726fe8350f0291ccf0)) +* error handling for chat ([#1110](https://github.com/push-protocol/push-sdk/issues/1110)) ([59f4c77](https://github.com/push-protocol/push-sdk/commit/59f4c7704c91653ac114baf75ea30cd0b839980f)) +* fix build ([#1176](https://github.com/push-protocol/push-sdk/issues/1176)) ([fefdf91](https://github.com/push-protocol/push-sdk/commit/fefdf912df6110cebbbaf8fbd47989ba727679b4)) +* fix channel notifications response ([#1166](https://github.com/push-protocol/push-sdk/issues/1166)) ([c01798a](https://github.com/push-protocol/push-sdk/commit/c01798af23f4f8cc2215fa9a529145d0c3bf349d)) +* fixed berachain issue ([6cd5dd8](https://github.com/push-protocol/push-sdk/commit/6cd5dd8ff77d7a916ce795b1238b381d20808786)) +* merge alpha ([4d1c5ef](https://github.com/push-protocol/push-sdk/commit/4d1c5ef2e0e6ce3382af6b811ffd6211ba15520d)) +* Merge branch 'main' into alpha ([53a795d](https://github.com/push-protocol/push-sdk/commit/53a795db5ec82d44597410dca670dfadd9199277)) +* **migrate goerli to sepolia:** migrate goerli to sepolia ([#1149](https://github.com/push-protocol/push-sdk/issues/1149)) ([490b104](https://github.com/push-protocol/push-sdk/commit/490b104902b9a509c6a8c68d5c5f33446e91e113)) +* pulled ([f22e9fb](https://github.com/push-protocol/push-sdk/commit/f22e9fb0bd7a1529d1f9ba79626ef37a32e76f31)) +* pulled main ([b7391b6](https://github.com/push-protocol/push-sdk/commit/b7391b6318b40117d61b86ea8163b116f757c94a)) + + + ## [1.7.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.7.1...restapi-1.7.2) (2024-03-13) diff --git a/packages/restapi/package.json b/packages/restapi/package.json index 0209d6eaf..ca4b88618 100644 --- a/packages/restapi/package.json +++ b/packages/restapi/package.json @@ -1,6 +1,6 @@ { "name": "@pushprotocol/restapi", - "version": "0.0.1-alpha.74", + "version": "0.0.1-alpha.82", "type": "commonjs", "publishConfig": { "registry": "https://registry.npmjs.org/" @@ -43,4 +43,4 @@ "ts-node": "^10.9.1", "typescript": "^5.0.2" } -} \ No newline at end of file +} diff --git a/packages/restapi/src/lib/chat/approveRequest.ts b/packages/restapi/src/lib/chat/approveRequest.ts index 034b3acef..9a79b258d 100644 --- a/packages/restapi/src/lib/chat/approveRequest.ts +++ b/packages/restapi/src/lib/chat/approveRequest.ts @@ -1,10 +1,9 @@ -import { getAPIBaseUrls, isValidETHAddress } from '../helpers'; +import { convertToValidDID, getAPIBaseUrls, isValidPushCAIP } from '../helpers'; import Constants, { PACKAGE_BUILD } from '../constants'; import { EnvOptionsType, SignerType } from '../types'; import { getAccountAddress, getWallet, - getUserDID, getConnectedUserV2Core, PGPHelper, IPGPHelper, @@ -70,7 +69,8 @@ export const approveCore = async ( */ const wallet = getWallet({ account, signer }); const address = await getAccountAddress(wallet); - const isGroup = !isValidETHAddress(senderAddress); + + const isGroup = !isValidPushCAIP(senderAddress); const connectedUser = await getConnectedUserV2Core( wallet, @@ -79,12 +79,12 @@ export const approveCore = async ( pgpHelper ); const fromDID: string = isGroup - ? await getUserDID(address, env) - : await getUserDID(senderAddress, env); + ? await convertToValidDID(address, env) + : await convertToValidDID(senderAddress, env); const toDID: string = isGroup - ? await getUserDID(senderAddress, env) - : await getUserDID(address, env); + ? await convertToValidDID(senderAddress, env) + : await convertToValidDID(address, env); let encryptedSecret: string | null = null; /** diff --git a/packages/restapi/src/lib/chat/chat.ts b/packages/restapi/src/lib/chat/chat.ts index 4135452c5..ec68e6941 100644 --- a/packages/restapi/src/lib/chat/chat.ts +++ b/packages/restapi/src/lib/chat/chat.ts @@ -1,8 +1,8 @@ -import { getAPIBaseUrls, isValidETHAddress, walletToPCAIP10 } from '../helpers'; +import { convertToValidDID, getAPIBaseUrls, isValidPushCAIP } from '../helpers'; import Constants, { ENV } from '../constants'; import { IFeeds } from '../types'; import { axiosGet } from '../utils/axiosUtil'; -import { PGPHelper, addDeprecatedInfo, getInboxLists, getUserDID } from './helpers'; +import { PGPHelper, addDeprecatedInfo, getInboxLists } from './helpers'; import { handleError } from '../errors/validationError'; export const chat = async (options: { @@ -19,24 +19,27 @@ export const chat = async (options: { toDecrypt = false, recipient, } = options || {}; - const user = await getUserDID(account, env); - const recipientWallet = await getUserDID(recipient, env); - if (!isValidETHAddress(user)) throw new Error(`Invalid address ${user}`); + const user = await convertToValidDID(account, env); + const recipientWallet = await convertToValidDID(recipient, env); + if (!isValidPushCAIP(user)) throw new Error(`Invalid address ${user}`); const API_BASE_URL = getAPIBaseUrls(env); const apiEndpoint = `${API_BASE_URL}/v1/chat/users/${user}/chat/${recipientWallet}`; try { - const response = await axiosGet(apiEndpoint); + const response = await axiosGet(apiEndpoint); // If no chat between users, then returns {} const chat: IFeeds = response.data; if (Object.keys(chat).length !== 0) { const updatedChat = addDeprecatedInfo([chat]); - const [feed]: IFeeds[] = await getInboxLists({ - lists: updatedChat, - user, - toDecrypt, - pgpPrivateKey, - env, - },PGPHelper); + const [feed]: IFeeds[] = await getInboxLists( + { + lists: updatedChat, + user, + toDecrypt, + pgpPrivateKey, + env, + }, + PGPHelper + ); return feed; } else { return chat; diff --git a/packages/restapi/src/lib/chat/chats.ts b/packages/restapi/src/lib/chat/chats.ts index 79a55ec9b..395641eb0 100644 --- a/packages/restapi/src/lib/chat/chats.ts +++ b/packages/restapi/src/lib/chat/chats.ts @@ -1,7 +1,12 @@ -import { getAPIBaseUrls, isValidETHAddress } from '../helpers'; +import { convertToValidDID, getAPIBaseUrls, isValidPushCAIP } from '../helpers'; import Constants, { ENV } from '../constants'; import { IFeeds } from '../types'; -import { getInboxLists, getUserDID, addDeprecatedInfo, IPGPHelper, PGPHelper } from './helpers'; +import { + getInboxLists, + addDeprecatedInfo, + IPGPHelper, + PGPHelper, +} from './helpers'; import { axiosGet } from '../utils/axiosUtil'; import { handleError } from '../errors/validationError'; @@ -31,10 +36,13 @@ export type ChatsOptionsType = { */ export const chats = async (options: ChatsOptionsType): Promise => { - return await chatsCore(options,PGPHelper) -} + return await chatsCore(options, PGPHelper); +}; -export const chatsCore = async (options: ChatsOptionsType, pgpHelper: IPGPHelper): Promise => { +export const chatsCore = async ( + options: ChatsOptionsType, + pgpHelper: IPGPHelper +): Promise => { const { account, pgpPrivateKey, @@ -43,10 +51,10 @@ export const chatsCore = async (options: ChatsOptionsType, pgpHelper: IPGPHelper page = 1, limit = 10, } = options || {}; - if (!isValidETHAddress(account)) { + if (!isValidPushCAIP(account)) { throw new Error(`Invalid address!`); } - const user = await getUserDID(account, env); + const user = await convertToValidDID(account, env); const API_BASE_URL = getAPIBaseUrls(env); const apiEndpoint = `${API_BASE_URL}/v1/chat/users/${user}/chats?page=${page}&limit=${limit}`; const requestUrl = `${apiEndpoint}`; @@ -54,13 +62,16 @@ export const chatsCore = async (options: ChatsOptionsType, pgpHelper: IPGPHelper const response = await axiosGet(requestUrl); const chats: IFeeds[] = response.data.chats; const updatedChats = addDeprecatedInfo(chats); - const feeds: IFeeds[] = await getInboxLists({ - lists: updatedChats, - user: user, - toDecrypt, - pgpPrivateKey, - env, - },pgpHelper); + const feeds: IFeeds[] = await getInboxLists( + { + lists: updatedChats, + user: user, + toDecrypt, + pgpPrivateKey, + env, + }, + pgpHelper + ); return feeds; } catch (err) { throw handleError(err, chats.name); diff --git a/packages/restapi/src/lib/chat/conversationHash.ts b/packages/restapi/src/lib/chat/conversationHash.ts index ab4ddf6c9..54aa450d8 100644 --- a/packages/restapi/src/lib/chat/conversationHash.ts +++ b/packages/restapi/src/lib/chat/conversationHash.ts @@ -1,23 +1,25 @@ import Constants from '../constants'; import { handleError } from '../errors/validationError'; -import { isValidETHAddress } from '../helpers'; +import { convertToValidDID, isValidPushCAIP } from '../helpers'; import { ConversationHashOptionsType } from '../types'; -import { getConversationHashService, getUserDID } from './helpers'; +import { getConversationHashService } from './helpers'; /** * All chat messages are stored on IPFS. This function will return the latest message's CID (Content Identifier on IPFS). * Whenever a new message is sent or received, this CID will change. */ -export const conversationHash = async(options: ConversationHashOptionsType) => { +export const conversationHash = async ( + options: ConversationHashOptionsType +) => { const { conversationId, account, env = Constants.ENV.PROD } = options || {}; try { - if (!isValidETHAddress(account)) { + if (!isValidPushCAIP(account)) { throw new Error(`Invalid address!`); } - const updatedConversationId = await getUserDID(conversationId, env); - const accountDID = await getUserDID(account, env); + const updatedConversationId = await convertToValidDID(conversationId, env); + const accountDID = await convertToValidDID(account, env); const response = await getConversationHashService({ conversationId: updatedConversationId, account: accountDID, diff --git a/packages/restapi/src/lib/chat/createGroup.ts b/packages/restapi/src/lib/chat/createGroup.ts index 34775d2d0..c20c1862b 100644 --- a/packages/restapi/src/lib/chat/createGroup.ts +++ b/packages/restapi/src/lib/chat/createGroup.ts @@ -1,4 +1,4 @@ -import { getAPIBaseUrls } from '../helpers'; +import { convertToValidDID, getAPIBaseUrls } from '../helpers'; import Constants from '../constants'; import { EnvOptionsType, GroupDTO, SignerType, Rules } from '../types'; import { @@ -6,7 +6,6 @@ import { createGroupPayload, createGroupRequestValidator, getWallet, - getUserDID, IPGPHelper, PGPHelper, validateScheduleDates, @@ -88,10 +87,10 @@ export const createGroupCore = async ( ); const convertedMembersPromise = members.map(async (each) => { - return getUserDID(each, env); + return convertToValidDID(each, env); }); const convertedAdminsPromise = admins.map(async (each) => { - return getUserDID(each, env); + return convertToValidDID(each, env); }); const convertedMembers = await Promise.all(convertedMembersPromise); const convertedAdmins = await Promise.all(convertedAdminsPromise); @@ -153,6 +152,6 @@ export const createGroupCore = async ( const response = await axiosPost(apiEndpoint, body); return response.data; } catch (err) { - throw handleError(err, createGroup.name); + throw handleError(err, createGroup.name); } }; diff --git a/packages/restapi/src/lib/chat/createGroupV2.ts b/packages/restapi/src/lib/chat/createGroupV2.ts index a33b0233d..5063e90f6 100644 --- a/packages/restapi/src/lib/chat/createGroupV2.ts +++ b/packages/restapi/src/lib/chat/createGroupV2.ts @@ -1,10 +1,9 @@ import axios from 'axios'; -import { getAPIBaseUrls, isValidETHAddress } from '../helpers'; +import { convertToValidDID, getAPIBaseUrls, isValidPushCAIP } from '../helpers'; import Constants from '../constants'; import { EnvOptionsType, GroupInfoDTO, SignerType, Rules } from '../types'; import { getWallet, - getUserDID, IPGPHelper, PGPHelper, validateScheduleDates, @@ -73,10 +72,10 @@ export const createGroupCoreV2 = async ( pgpHelper ); const convertedMembersPromise = members.map(async (each) => { - return getUserDID(each, env); + return convertToValidDID(each, env); }); const convertedAdminsPromise = admins.map(async (each) => { - return getUserDID(each, env); + return convertToValidDID(each, env); }); const convertedMembers = await Promise.all(convertedMembersPromise); const convertedAdmins = await Promise.all(convertedAdminsPromise); @@ -199,13 +198,13 @@ const createGroupV2OptionsValidator = ( } for (let i = 0; i < members.length; i++) { - if (members[i] && !isValidETHAddress(members[i])) { + if (members[i] && !isValidPushCAIP(members[i])) { throw new Error(`Invalid member address!`); } } for (let i = 0; i < admins.length; i++) { - if (!isValidETHAddress(admins[i])) { + if (!isValidPushCAIP(admins[i])) { throw new Error(`Invalid admin address!`); } } diff --git a/packages/restapi/src/lib/chat/getChatInfo.ts b/packages/restapi/src/lib/chat/getChatInfo.ts index 907e39303..b7e0b77db 100644 --- a/packages/restapi/src/lib/chat/getChatInfo.ts +++ b/packages/restapi/src/lib/chat/getChatInfo.ts @@ -1,8 +1,7 @@ -import { getAPIBaseUrls } from '../helpers'; +import { convertToValidDID, getAPIBaseUrls } from '../helpers'; import Constants, { ENV } from '../constants'; import { axiosGet } from '../utils/axiosUtil'; import { handleError } from '../errors/validationError'; -import { getUserDID } from './helpers'; /** * Represents the response type for the chat status. @@ -14,15 +13,15 @@ export interface ChatInfoResponse { list: string; participants: string[]; chatId: string; - receipient: string; + recipient: string; } /** * Represents the input type for fetching chat status. */ export interface GetChatInfoType { - receipient: string; - sender: string; // Ethereum address or similar + recipient: string; + account: string; // Ethereum address or similar env?: ENV; } @@ -32,18 +31,18 @@ export interface GetChatInfoType { export const getChatInfo = async ( options: GetChatInfoType ): Promise => { - const { receipient, sender, env = Constants.ENV.PROD } = options; + const { recipient, account, env = Constants.ENV.PROD } = options; try { - if (!receipient || !sender) { - throw new Error('receipient and sender cannot be null or empty'); + if (!recipient || !account) { + throw new Error('receipient and account cannot be null or empty'); } const API_BASE_URL = getAPIBaseUrls(env); - const requestUrl = `${API_BASE_URL}/v1/chat/${await getUserDID( - receipient, + const requestUrl = `${API_BASE_URL}/v1/chat/${await convertToValidDID( + recipient, env - )}/address/${await getUserDID(sender, env)}`; + )}/address/${await convertToValidDID(account, env)}`; const response = await axiosGet(requestUrl); return response.data; } catch (err) { diff --git a/packages/restapi/src/lib/chat/getGroupAccess.ts b/packages/restapi/src/lib/chat/getGroupAccess.ts index 952a70e02..978f71008 100644 --- a/packages/restapi/src/lib/chat/getGroupAccess.ts +++ b/packages/restapi/src/lib/chat/getGroupAccess.ts @@ -1,7 +1,6 @@ -import { getAPIBaseUrls } from '../helpers'; +import { convertToValidDID, getAPIBaseUrls } from '../helpers'; import Constants, { ENV } from '../constants'; import { GroupAccess } from '../types'; -import { getUserDID } from './helpers'; import { axiosGet } from '../utils/axiosUtil'; import { handleError } from '../errors/validationError'; @@ -29,7 +28,7 @@ export const getGroupAccess = async ( throw new Error(`did cannot be null or empty`); } - const user = await getUserDID(did, env); + const user = await convertToValidDID(did, env); const API_BASE_URL = getAPIBaseUrls(env); const requestUrl = `${API_BASE_URL}/v1/chat/groups/${chatId}/access/${user}`; diff --git a/packages/restapi/src/lib/chat/getGroupMemberStatus.ts b/packages/restapi/src/lib/chat/getGroupMemberStatus.ts index 2caca5040..ea018b4c1 100644 --- a/packages/restapi/src/lib/chat/getGroupMemberStatus.ts +++ b/packages/restapi/src/lib/chat/getGroupMemberStatus.ts @@ -1,7 +1,6 @@ -import { getAPIBaseUrls } from '../helpers'; +import { convertToValidDID, getAPIBaseUrls } from '../helpers'; import Constants, { ENV } from '../constants'; -import { GroupMemberStatus } from '../types'; -import { getUserDID } from './helpers'; +import { GroupMemberStatus } from '../types'; import { axiosGet } from '../utils/axiosUtil'; import { handleError } from '../errors/validationError'; @@ -29,7 +28,7 @@ export const getGroupMemberStatus = async ( throw new Error(`did cannot be null or empty`); } - const user = await getUserDID(did, env); + const user = await convertToValidDID(did, env); const API_BASE_URL = getAPIBaseUrls(env); const requestUrl = `${API_BASE_URL}/v1/chat/groups/${chatId}/members/${user}/status`; @@ -37,6 +36,6 @@ export const getGroupMemberStatus = async ( const response = await axiosGet(requestUrl); return response.data; } catch (err) { - throw handleError(err, getGroupMemberStatus.name); + throw handleError(err, getGroupMemberStatus.name); } }; diff --git a/packages/restapi/src/lib/chat/helpers/crypto.ts b/packages/restapi/src/lib/chat/helpers/crypto.ts index 590b4d1fb..7d07e9693 100644 --- a/packages/restapi/src/lib/chat/helpers/crypto.ts +++ b/packages/restapi/src/lib/chat/helpers/crypto.ts @@ -16,7 +16,7 @@ import { Signer, decryptPGPKey, decryptWithWalletRPCMethod, - isValidETHAddress, + isValidPushCAIP, } from '../../helpers'; import { get as getUser } from '../../user'; import { createUserService } from './service'; @@ -247,7 +247,7 @@ export const getEncryptedRequestCore = async ( env, }); if (!receiverCreatedUser?.publicKey) { - if (!isValidETHAddress(receiverAddress)) { + if (!isValidPushCAIP(receiverAddress)) { throw new Error(`Invalid receiver address!`); } await createUserService({ diff --git a/packages/restapi/src/lib/chat/helpers/inbox.ts b/packages/restapi/src/lib/chat/helpers/inbox.ts index 6a3412600..c6e4322d0 100644 --- a/packages/restapi/src/lib/chat/helpers/inbox.ts +++ b/packages/restapi/src/lib/chat/helpers/inbox.ts @@ -1,6 +1,6 @@ import * as PGP from './pgp'; import Constants, { ENV } from '../../constants'; -import { isValidCAIP10NFTAddress, pCAIP10ToWallet } from '../../helpers'; +import { isValidNFTCAIP, pCAIP10ToWallet } from '../../helpers'; import { IFeeds, IMessageIPFS, IUser, SpaceIFeeds } from '../../types'; import { get as getUser } from '../../user'; import { getCID } from '../ipfs'; @@ -212,7 +212,7 @@ export const addDeprecatedInfo = (() => { const latestDIDs: { [key: string]: string } = {}; return (chats: IFeeds[]): IFeeds[] => { chats.forEach((chat) => { - if (isValidCAIP10NFTAddress(chat.did)) { + if (isValidNFTCAIP(chat.did)) { const didWithoutTimestamp = chat.did.split(':').slice(0, 5).join(':'); const timestamp = chat.did.split(':')[5]; if ( @@ -224,7 +224,7 @@ export const addDeprecatedInfo = (() => { } }); chats.forEach((chat) => { - if (isValidCAIP10NFTAddress(chat.did)) { + if (isValidNFTCAIP(chat.did)) { const didWithoutTimestamp = chat.did.split(':').slice(0, 5).join(':'); if (latestDIDs[didWithoutTimestamp] !== chat.did) { chat['deprecated'] = true; @@ -242,7 +242,7 @@ export const addDeprecatedInfoToMessages = (() => { const latestDIDs: { [key: string]: string } = {}; return (chats: IMessageIPFS[]): IMessageIPFS[] => { chats.forEach((chat) => { - if (isValidCAIP10NFTAddress(chat.fromDID)) { + if (isValidNFTCAIP(chat.fromDID)) { const didWithoutTimestamp = chat.fromDID .split(':') .slice(0, 5) @@ -257,7 +257,7 @@ export const addDeprecatedInfoToMessages = (() => { } }); chats.forEach((chat) => { - if (isValidCAIP10NFTAddress(chat.fromDID)) { + if (isValidNFTCAIP(chat.fromDID)) { const didWithoutTimestamp = chat.fromDID .split(':') .slice(0, 5) diff --git a/packages/restapi/src/lib/chat/helpers/payloadHelper.ts b/packages/restapi/src/lib/chat/helpers/payloadHelper.ts index 5455ff458..6ab762e1e 100644 --- a/packages/restapi/src/lib/chat/helpers/payloadHelper.ts +++ b/packages/restapi/src/lib/chat/helpers/payloadHelper.ts @@ -1,4 +1,4 @@ -import { isValidETHAddress, walletToPCAIP10 } from '../../helpers'; +import { isValidPushCAIP, walletToPCAIP10 } from '../../helpers'; import { getEncryptedRequestCore } from './crypto'; import { IConnectedUser, @@ -110,7 +110,7 @@ export const sendMessagePayloadCore = async ( env: ENV, pgpHelper: IPGPHelper ): Promise => { - const isGroup = !isValidETHAddress(receiverAddress); + const isGroup = !isValidPushCAIP(receiverAddress); let secretKey: string; if (isGroup && group?.encryptedSecret && group.sessionKey) { @@ -374,7 +374,9 @@ export const spaceDtoToSpaceInfoDto = (spaceDto: SpaceDTO): SpaceInfoDTO => { }; }; -export const mapSpaceListTypeToChatListType = (type: SpaceListType): ChatListType => { +export const mapSpaceListTypeToChatListType = ( + type: SpaceListType +): ChatListType => { switch (type) { case SpaceListType.SPACES: return ChatListType.CHATS; @@ -383,7 +385,7 @@ export const mapSpaceListTypeToChatListType = (type: SpaceListType): ChatListTyp default: throw new Error(`Unsupported SpaceListType: ${type}`); } -} +}; export const convertSpaceRulesToRules = (spaceRules: SpaceRules): Rules => { return { diff --git a/packages/restapi/src/lib/chat/helpers/service.ts b/packages/restapi/src/lib/chat/helpers/service.ts index 172be01e0..682b20a34 100644 --- a/packages/restapi/src/lib/chat/helpers/service.ts +++ b/packages/restapi/src/lib/chat/helpers/service.ts @@ -3,7 +3,7 @@ import { generateHash, getAPIBaseUrls, getQueryParams, - isValidCAIP10NFTAddress, + isValidNFTCAIP, verifyProfileKeys, walletToPCAIP10, } from '../../helpers'; @@ -22,7 +22,7 @@ type CreateUserOptionsType = { publicKey?: string; encryptedPrivateKey?: string; env?: ENV; - origin? : string | null; + origin?: string | null; }; export const createUserService = async (options: CreateUserOptionsType) => { @@ -39,7 +39,7 @@ export const createUserService = async (options: CreateUserOptionsType) => { const requestUrl = `${API_BASE_URL}/v2/users/`; - if (isValidCAIP10NFTAddress(user)) { + if (isValidNFTCAIP(user)) { const epoch = Math.floor(Date.now() / 1000); if (user.split(':').length !== 6) { user = `${user}:${epoch}`; @@ -49,7 +49,7 @@ export const createUserService = async (options: CreateUserOptionsType) => { caip10: walletToPCAIP10(user), did: walletToPCAIP10(user), publicKey, - encryptedPrivateKey + encryptedPrivateKey, }; const hash = generateHash(data); @@ -125,7 +125,7 @@ export const authUpdateUserService = async (options: CreateUserOptionsType) => { export const getConversationHashService = async ( options: ConversationHashOptionsType -): Promise<{ threadHash: string, intent: boolean }> => { +): Promise<{ threadHash: string; intent: boolean }> => { const { conversationId, account, env = Constants.ENV.PROD } = options || {}; const API_BASE_URL = getAPIBaseUrls(env); diff --git a/packages/restapi/src/lib/chat/helpers/user.ts b/packages/restapi/src/lib/chat/helpers/user.ts index 63e6aaa3e..b9e672d15 100644 --- a/packages/restapi/src/lib/chat/helpers/user.ts +++ b/packages/restapi/src/lib/chat/helpers/user.ts @@ -1,79 +1,8 @@ import Constants, { ENV } from '../../constants'; -import { get, create, createUserCore } from '../../user'; -import { IConnectedUser, IUser, SignerType, walletType } from '../../types'; +import { get, createUserCore } from '../../user'; +import { IConnectedUser, SignerType, walletType } from '../../types'; import { getAccountAddress } from './wallet'; import { IPGPHelper, PGPHelper, getDecryptedPrivateKey } from '.'; -import { - isValidCAIP10NFTAddress, - isValidETHAddress, - walletToPCAIP10, -} from '../../helpers'; - -export const createUserIfNecessary = async ( - wallet: walletType, - env: ENV -): Promise => { - const address = await getAccountAddress(wallet); - const connectedUser = await get({ account: address, env }); - if (!connectedUser?.encryptedPrivateKey) { - const createUserProps: { - account?: string; - signer?: SignerType; - env?: ENV; - } = {}; - if (wallet.account) { - createUserProps.account = wallet.account; - } - if (wallet.signer) { - createUserProps.signer = wallet.signer; - } - createUserProps.env = env; - const createdUser: IUser = await create(createUserProps); - return createdUser; - } else { - return connectedUser; - } -}; - -export const getConnectedUser = async ( - wallet: walletType, - privateKey: string | null, - env: ENV -): Promise => { - const address = await getAccountAddress(wallet); - const user = await get({ account: address, env: env || Constants.ENV.PROD }); - if (user?.encryptedPrivateKey) { - if (privateKey) { - return { ...user, privateKey }; - } else { - throw new Error(`Decrypted pgp private key required as input`); - } - } else { - const createUserProps: { - account?: string; - signer?: SignerType; - env?: ENV; - } = {}; - if (wallet.account) { - createUserProps.account = wallet.account; - } - if (user && user.did) { - createUserProps.account = user.did; - } - if (wallet.signer) { - createUserProps.signer = wallet.signer; - } - createUserProps.env = env; - const newUser = await create(createUserProps); - const decryptedPrivateKey = await getDecryptedPrivateKey( - wallet, - newUser, - address, - env - ); - return { ...newUser, privateKey: decryptedPrivateKey }; - } -}; export const getConnectedUserV2 = async ( wallet: walletType, @@ -132,18 +61,3 @@ export const getConnectedUserV2Core = async ( return { ...newUser, privateKey: decryptedPrivateKey }; } }; - -export const getUserDID = async ( - address: string, - env: ENV -): Promise => { - if (isValidCAIP10NFTAddress(address)) { - if (address.split(':').length === 6) return address; - const user = await get({ account: address, env: env }); - if (user && user.did) return user.did; - const epoch = Math.floor(Date.now() / 1000); - address = `${address}:${epoch}`; - } - if (isValidETHAddress(address)) return walletToPCAIP10(address); - return address; -}; diff --git a/packages/restapi/src/lib/chat/helpers/validator.ts b/packages/restapi/src/lib/chat/helpers/validator.ts index 78e4053eb..18c8df3a0 100644 --- a/packages/restapi/src/lib/chat/helpers/validator.ts +++ b/packages/restapi/src/lib/chat/helpers/validator.ts @@ -1,4 +1,4 @@ -import { isValidETHAddress, isValidNFTCAIP10Address } from '../../helpers'; +import { isValidPushCAIP, isValidFullCAIP10 } from '../../helpers'; import { GroupMemberUpdateOptions } from '../updateGroupMembers'; export const createGroupRequestValidator = ( @@ -28,7 +28,7 @@ export const createGroupRequestValidator = ( } for (let i = 0; i < members.length; i++) { - if (members[i] && !isValidETHAddress(members[i])) { + if (members[i] && !isValidPushCAIP(members[i])) { throw new Error(`Invalid member address!`); } } @@ -38,7 +38,7 @@ export const createGroupRequestValidator = ( } for (let i = 0; i < admins.length; i++) { - if (!isValidETHAddress(admins[i])) { + if (!isValidPushCAIP(admins[i])) { throw new Error(`Invalid admin address!`); } } @@ -46,7 +46,7 @@ export const createGroupRequestValidator = ( if ( contractAddressNFT != null && contractAddressNFT?.length > 0 && - !isValidNFTCAIP10Address(contractAddressNFT) + !isValidFullCAIP10(contractAddressNFT) ) { throw new Error(`Invalid contractAddressNFT address!`); } @@ -58,7 +58,7 @@ export const createGroupRequestValidator = ( if ( contractAddressERC20 != null && contractAddressERC20?.length > 0 && - !isValidNFTCAIP10Address(contractAddressERC20) + !isValidFullCAIP10(contractAddressERC20) ) { throw new Error(`Invalid contractAddressERC20 address!`); } @@ -95,7 +95,7 @@ export const createSpaceRequestValidator = ( } for (let i = 0; i < members.length; i++) { - if (members[i] && !isValidETHAddress(members[i])) { + if (members[i] && !isValidPushCAIP(members[i])) { throw new Error(`Invalid member address!`); } } @@ -105,7 +105,7 @@ export const createSpaceRequestValidator = ( } for (let i = 0; i < admins.length; i++) { - if (!isValidETHAddress(admins[i])) { + if (!isValidPushCAIP(admins[i])) { throw new Error(`Invalid admin address!`); } } @@ -113,7 +113,7 @@ export const createSpaceRequestValidator = ( if ( contractAddressNFT != null && contractAddressNFT?.length > 0 && - !isValidNFTCAIP10Address(contractAddressNFT) + !isValidFullCAIP10(contractAddressNFT) ) { throw new Error(`Invalid contractAddressNFT address!`); } @@ -125,7 +125,7 @@ export const createSpaceRequestValidator = ( if ( contractAddressERC20 != null && contractAddressERC20?.length > 0 && - !isValidNFTCAIP10Address(contractAddressERC20) + !isValidFullCAIP10(contractAddressERC20) ) { throw new Error(`Invalid contractAddressERC20 address!`); } @@ -191,7 +191,7 @@ export const updateGroupRequestValidator = ( if (members != null && members.length > 0) { for (let i = 0; i < members.length; i++) { - if (!isValidETHAddress(members[i])) { + if (!isValidPushCAIP(members[i])) { throw new Error(`Invalid member address in members list!`); } } @@ -199,13 +199,13 @@ export const updateGroupRequestValidator = ( if (admins != null && admins.length > 0) { for (let i = 0; i < admins.length; i++) { - if (!isValidETHAddress(admins[i])) { + if (!isValidPushCAIP(admins[i])) { throw new Error(`Invalid member address in admins list!`); } } } - if (address != null && !isValidETHAddress(address)) { + if (address != null && !isValidPushCAIP(address)) { throw new Error(`Invalid address field!`); } }; @@ -232,9 +232,9 @@ export const validateGroupMemberUpdateOptions = ( throw new Error(`${role} array cannot have more than 1000 addresses.`); } - // Assuming you have a function `isValidETHAddress` to validate Ethereum addresses + // Assuming you have a function `isValidPushCAIP` to validate Ethereum addresses upsert[role].forEach((address) => { - if (!isValidETHAddress(address)) { + if (!isValidPushCAIP(address)) { throw new Error(`Invalid address found in ${role} list.`); } }); @@ -245,7 +245,7 @@ export const validateGroupMemberUpdateOptions = ( throw new Error('Remove array cannot have more than 1000 addresses.'); } remove.forEach((address) => { - if (!isValidETHAddress(address)) { + if (!isValidPushCAIP(address)) { throw new Error('Invalid address found in remove list.'); } }); diff --git a/packages/restapi/src/lib/chat/rejectRequest.ts b/packages/restapi/src/lib/chat/rejectRequest.ts index 7b5900b5d..17ee20311 100644 --- a/packages/restapi/src/lib/chat/rejectRequest.ts +++ b/packages/restapi/src/lib/chat/rejectRequest.ts @@ -1,4 +1,4 @@ -import { getAPIBaseUrls, isValidETHAddress } from '../helpers'; +import { convertToValidDID, getAPIBaseUrls, isValidPushCAIP } from '../helpers'; import Constants from '../constants'; import { EnvOptionsType, SignerType } from '../types'; import { @@ -6,7 +6,6 @@ import { getConnectedUserV2, getAccountAddress, getWallet, - getUserDID, IRejectRequestPayload, rejectRequestPayload, } from './helpers'; @@ -50,17 +49,17 @@ export const reject = async ( const apiEndpoint = `${API_BASE_URL}/v1/chat/request/reject`; let isGroup = true; - if (isValidETHAddress(senderAddress)) { + if (isValidPushCAIP(senderAddress)) { isGroup = false; } const connectedUser = await getConnectedUserV2(wallet, pgpPrivateKey, env); - let fromDID = await getUserDID(senderAddress, env); - let toDID = await getUserDID(address, env); + let fromDID = await convertToValidDID(senderAddress, env); + let toDID = await convertToValidDID(address, env); if (isGroup) { - fromDID = await getUserDID(address, env); - toDID = await getUserDID(senderAddress, env); + fromDID = await convertToValidDID(address, env); + toDID = await convertToValidDID(senderAddress, env); } const bodyToBeHashed = { diff --git a/packages/restapi/src/lib/chat/requests.ts b/packages/restapi/src/lib/chat/requests.ts index 43cc694e0..9c4a8e07c 100644 --- a/packages/restapi/src/lib/chat/requests.ts +++ b/packages/restapi/src/lib/chat/requests.ts @@ -1,8 +1,13 @@ -import { getAPIBaseUrls, isValidETHAddress } from '../helpers'; +import { convertToValidDID, getAPIBaseUrls, isValidPushCAIP } from '../helpers'; import Constants, { ENV } from '../constants'; import { IFeeds } from '../types'; import { axiosGet } from '../utils/axiosUtil'; -import { IPGPHelper, PGPHelper, addDeprecatedInfo, getInboxLists, getUserDID } from './helpers'; +import { + IPGPHelper, + PGPHelper, + addDeprecatedInfo, + getInboxLists, +} from './helpers'; import { handleError } from '../errors/validationError'; export type RequestOptionsType = { @@ -30,15 +35,15 @@ export type RequestOptionsType = { * The first time an address wants to send a message to another peer, the address sends an intent request. This first message shall not land in this peer Inbox but in its Request box. * This function will return all the chats that landed on the address' Request box. The user can then approve the request or ignore it for now. */ -export const requests = async ( +export const requests = async ( options: RequestOptionsType ): Promise => { - return await requestsCore(options, PGPHelper) + return await requestsCore(options, PGPHelper); }; -export const requestsCore = async ( +export const requestsCore = async ( options: RequestOptionsType, - pgpHelper:IPGPHelper, + pgpHelper: IPGPHelper ): Promise => { const { account, @@ -48,26 +53,29 @@ export const requestsCore = async ( page = 1, limit = 10, } = options || {}; - const user = await getUserDID(account, env); + const user = await convertToValidDID(account, env); const API_BASE_URL = getAPIBaseUrls(env); const apiEndpoint = `${API_BASE_URL}/v1/chat/users/${user}/requests?page=${page}&limit=${limit}`; try { - if (!isValidETHAddress(user)) { + if (!isValidPushCAIP(user)) { throw new Error(`Invalid address!`); } const response = await axiosGet(apiEndpoint); const requests: IFeeds[] = response.data.requests; const updatedRequests = addDeprecatedInfo(requests); - const Feeds: IFeeds[] = await getInboxLists({ - lists: updatedRequests, - user, - toDecrypt, - pgpPrivateKey, - env, - },pgpHelper); + const Feeds: IFeeds[] = await getInboxLists( + { + lists: updatedRequests, + user, + toDecrypt, + pgpPrivateKey, + env, + }, + pgpHelper + ); return Feeds; } catch (err) { - throw handleError(err, requests.name); + throw handleError(err, requests.name); } -}; \ No newline at end of file +}; diff --git a/packages/restapi/src/lib/chat/send.ts b/packages/restapi/src/lib/chat/send.ts index fac436780..741e1e423 100644 --- a/packages/restapi/src/lib/chat/send.ts +++ b/packages/restapi/src/lib/chat/send.ts @@ -1,4 +1,4 @@ -import { getAPIBaseUrls, isValidETHAddress } from '../helpers'; +import { convertToValidDID, getAPIBaseUrls, isValidPushCAIP } from '../helpers'; import Constants, { MessageType, ENV } from '../constants'; import { ChatSendOptionsType, MessageWithCID, SignerType } from '../types'; import { @@ -6,7 +6,6 @@ import { PGPHelper, getAccountAddress, getConnectedUserV2Core, - getUserDID, getWallet, } from './helpers'; import { conversationHash } from './conversationHash'; @@ -51,9 +50,9 @@ export const sendCore = async ( env, pgpHelper ); - const receiver = await getUserDID(to, env); + const receiver = await convertToValidDID(to, env); const API_BASE_URL = getAPIBaseUrls(env); - const isGroup = isValidETHAddress(to) ? false : true; + const isGroup = isValidPushCAIP(to) ? false : true; const group = isGroup ? await getGroupInfo({ @@ -133,7 +132,7 @@ const validateOptions = async (options: ComputedOptionsType) => { const wallet = getWallet({ account, signer }); const address = await getAccountAddress(wallet); - if (!isValidETHAddress(address)) { + if (!isValidPushCAIP(address)) { throw new Error( `Invalid sender. Please ensure that either 'account' or 'signer' is properly defined.` ); diff --git a/packages/restapi/src/lib/chat/updateGroup.ts b/packages/restapi/src/lib/chat/updateGroup.ts index e825656b1..12730f4d6 100644 --- a/packages/restapi/src/lib/chat/updateGroup.ts +++ b/packages/restapi/src/lib/chat/updateGroup.ts @@ -1,4 +1,4 @@ -import { getAPIBaseUrls } from '../helpers'; +import { convertToValidDID, getAPIBaseUrls } from '../helpers'; import Constants from '../constants'; import { ChatStatus, @@ -15,7 +15,6 @@ import { PGPHelper, getConnectedUserV2Core, getAccountAddress, - getUserDID, updateGroupRequestValidator, } from './helpers'; import * as CryptoJS from 'crypto-js'; @@ -97,10 +96,10 @@ export const updateGroupCore = async ( pgpHelper ); const convertedMembersPromise = members.map(async (each) => { - return getUserDID(each, env); + return convertToValidDID(each, env); }); const convertedAdminsPromise = admins.map(async (each) => { - return getUserDID(each, env); + return convertToValidDID(each, env); }); const convertedMembers = await Promise.all(convertedMembersPromise); const convertedAdmins = await Promise.all(convertedAdminsPromise); diff --git a/packages/restapi/src/lib/chat/updateGroupMembers.ts b/packages/restapi/src/lib/chat/updateGroupMembers.ts index b315ed1de..6338f6896 100644 --- a/packages/restapi/src/lib/chat/updateGroupMembers.ts +++ b/packages/restapi/src/lib/chat/updateGroupMembers.ts @@ -1,11 +1,10 @@ import axios from 'axios'; -import { getAPIBaseUrls } from '../helpers'; +import { convertToValidDID, getAPIBaseUrls } from '../helpers'; import Constants, { PACKAGE_BUILD } from '../constants'; import { getWallet, PGPHelper, getConnectedUserV2Core, - getUserDID, validateGroupMemberUpdateOptions, pgpEncrypt, } from './helpers'; @@ -60,7 +59,7 @@ export const updateGroupMembers = async ( const convertedUpsertPromise = Object.entries(upsert).map( async ([role, userDIDs]) => { const userIDs = await Promise.all( - userDIDs.map((userDID) => getUserDID(userDID, env)) + userDIDs.map((userDID) => convertToValidDID(userDID, env)) ); return [role, userIDs]; } @@ -69,7 +68,7 @@ export const updateGroupMembers = async ( await Promise.all(convertedUpsertPromise) ); const convertedRemove = await Promise.all( - remove.map((userDID) => getUserDID(userDID, env)) + remove.map((userDID) => convertToValidDID(userDID, env)) ); let encryptedSecret: string | null = null; diff --git a/packages/restapi/src/lib/helpers/address.ts b/packages/restapi/src/lib/helpers/address.ts index c8e2b40d5..f50796aa5 100644 --- a/packages/restapi/src/lib/helpers/address.ts +++ b/packages/restapi/src/lib/helpers/address.ts @@ -1,40 +1,42 @@ import * as viem from 'viem'; -import Constants, {ENV} from '../constants'; -import { getUserDID } from '../chat/helpers'; +import Constants, { ENV } from '../constants'; +import { get } from '../user'; export interface AddressValidatorsType { - [key: string]: ({ address } : { address: string }) => boolean; + [key: string]: ({ address }: { address: string }) => boolean; } -export function isValidETHAddress(address: string) { - if(isValidCAIP10NFTAddress(address))return true; - if (address.includes('eip155:')) { - const splittedAddress = address.split(':'); - if(splittedAddress.length === 3){ - return viem.isAddress(splittedAddress[2]); - } - if(splittedAddress.length === 2) - return viem.isAddress(splittedAddress[1]); +/** + * CHECK IF THE WALLET IS A VALID PUSH CAIP SCW DID + * @param wallet scw:eip155:chainId:address + * @returns boolean + */ +export const isValidSCWCAIP = (wallet: string) => { + try { + const walletComponent = wallet.split(':'); + return ( + walletComponent.length === 4 && + walletComponent[0] === 'scw' && + walletComponent[1] === 'eip155' && + !isNaN(Number(walletComponent[2])) && + Number(walletComponent[2]) > 0 && + viem.isAddress(walletComponent[3]) + ); + } catch (err) { + return false; } - return viem.isAddress(address); -} - -export function isValidNFTCAIP10Address (realCAIP10: string) { - const walletComponent = realCAIP10.split(':'); - if (isNaN(Number(walletComponent[1]))) return false - return (walletComponent.length === 3 && walletComponent[0] === 'eip155' && viem.isAddress(walletComponent[2])) -} +}; /** - * + * CHECK IF THE WALLET IS A VALID PUSH CAIP NFT DID * @param wallet nft:eip155:nftChainId:nftContractAddress:nftTokenId - * @returns + * @returns boolean */ -export const isValidCAIP10NFTAddress = (wallet: string): boolean => { +export const isValidNFTCAIP = (wallet: string): boolean => { try { const walletComponent = wallet.split(':'); return ( - (walletComponent.length === 5 || walletComponent.length === 6)&& + (walletComponent.length === 5 || walletComponent.length === 6) && walletComponent[0].toLowerCase() === 'nft' && !isNaN(Number(walletComponent[4])) && Number(walletComponent[4]) > 0 && @@ -48,26 +50,121 @@ export const isValidCAIP10NFTAddress = (wallet: string): boolean => { } }; +/** + * CHECK IF THE WALLET IS A VALID PUSH CAIP EOA DID + * @param wallet eip155:chainId:address | eip155:address + * @returns + */ +export const isValidEOACAIP = (wallet: string): boolean => { + try { + const walletComponent = wallet.split(':'); + if (walletComponent.length === 3) { + return ( + walletComponent[0] === 'eip155' && + !isNaN(Number(walletComponent[1])) && + Number(walletComponent[1]) > 0 && + viem.isAddress(walletComponent[2]) + ); + } + if (walletComponent.length === 2) { + return ( + walletComponent[0] === 'eip155' && viem.isAddress(walletComponent[1]) + ); + } + return false; + } catch (err) { + return false; + } +}; + +/** + * CHECK IF THE WALLET IS A VALID PUSH CAIP + * @param wallet + * @returns boolean + */ +export const isValidPushCAIP = (wallet: string): boolean => { + return ( + isValidEOACAIP(wallet) || + isValidSCWCAIP(wallet) || + isValidNFTCAIP(wallet) || + viem.isAddress(wallet) + ); +}; + +/** + * CONVERT A VALID PUSH CAIP TO A VALID PUSH DID + * @param wallet valid wallet CAIP + * @param env optional env + * @param chainId optional chainId + * @param provider optional provider + * @returns valid Push DID + */ +export const convertToValidDID = async ( + wallet: string, + env: ENV = ENV.STAGING, + chainId?: number, + provider?: any +) => { + /** @dev Why Not throw error? - Used by Group ChatID also */ + if (!isValidPushCAIP(wallet)) return wallet; + if ( + isValidEOACAIP(wallet) || + isValidSCWCAIP(wallet) || + (isValidNFTCAIP(wallet) && wallet.split(':').length === 6) + ) + return wallet; + + if (isValidNFTCAIP(wallet)) { + const user = await get({ account: wallet, env: env }); + if (user && user.did) return user.did; + const epoch = Math.floor(Date.now() / 1000); + return `${wallet}:${epoch}`; + } + + // TODO: Implement SCW DID CHECK + if (provider) { + try { + // check if onChain code exists + } catch (err) { + // Ignore if it fails + } + } + + return chainId ? `eip155:${chainId}:${wallet}` : `eip155:${wallet}`; +}; + +/** + * CHECK IF THE WALLET IS A VALID FULL CAIP10 + * @param wallet eip155:chainId:address + * @returns boolean + */ +export const isValidFullCAIP10 = (wallet: string) => { + const walletComponent = wallet.split(':'); + if (isNaN(Number(walletComponent[1]))) return false; + return ( + walletComponent[0] === 'eip155' && + !isNaN(Number(walletComponent[1])) && + Number(walletComponent[1]) > 0 && + viem.isAddress(walletComponent[2]) + ); +}; + const AddressValidators: AddressValidatorsType = { // Ethereum - 'eip155': ({ address } : { address: string }) => { - return isValidETHAddress(address); - } + eip155: ({ address }: { address: string }) => { + return isValidPushCAIP(address); + }, // Add other chains here }; export function validateCAIP(addressInCAIP: string) { - const [ - blockchain, - networkId, - address - ] = addressInCAIP.split(':'); + const [blockchain, networkId, address] = addressInCAIP.split(':'); if (!blockchain) return false; if (!networkId) return false; if (!address) return false; - if(isValidCAIP10NFTAddress(addressInCAIP))return true; + if (isValidNFTCAIP(addressInCAIP)) return true; const validatorFn = AddressValidators[blockchain]; @@ -80,18 +177,14 @@ export type CAIPDetailsType = { address: string; }; -export function getCAIPDetails(addressInCAIP: string) : CAIPDetailsType | null { +export function getCAIPDetails(addressInCAIP: string): CAIPDetailsType | null { if (validateCAIP(addressInCAIP)) { - const [ - blockchain, - networkId, - address - ] = addressInCAIP.split(':'); + const [blockchain, networkId, address] = addressInCAIP.split(':'); return { blockchain, networkId, - address + address, }; } @@ -101,7 +194,11 @@ export function getCAIPDetails(addressInCAIP: string) : CAIPDetailsType | null { export function getFallbackETHCAIPAddress(env: ENV, address: string) { let chainId = 1; // by default PROD - if (env === Constants.ENV.DEV || env === Constants.ENV.STAGING || env === Constants.ENV.LOCAL) { + if ( + env === Constants.ENV.DEV || + env === Constants.ENV.STAGING || + env === Constants.ENV.LOCAL + ) { chainId = 11155111; } @@ -109,23 +206,23 @@ export function getFallbackETHCAIPAddress(env: ENV, address: string) { } /** - * This helper + * This helper * checks if a VALID CAIP * return the CAIP * else * check if valid ETH * return a CAIP representation of that address (EIP155 + env) - * else + * else * throw error! */ export async function getCAIPAddress(env: ENV, address: string, msg?: string) { - if(isValidCAIP10NFTAddress(address)){ - return await getUserDID(address, env); + if (isValidNFTCAIP(address)) { + return await convertToValidDID(address, env); } if (validateCAIP(address)) { return address; } else { - if (isValidETHAddress(address)) { + if (isValidPushCAIP(address)) { return getFallbackETHCAIPAddress(env, address); } else { throw Error(`Invalid Address! ${msg} \n Address: ${address}`); @@ -133,27 +230,29 @@ export async function getCAIPAddress(env: ENV, address: string, msg?: string) { } } -export const getCAIPWithChainId = (address:string, chainId:number, msg?: string) => { - if(isValidETHAddress(address)) { - if(!address.includes('eip155:')) - return `eip155:${chainId}:${address}`; - else - return address; +export const getCAIPWithChainId = ( + address: string, + chainId: number, + msg?: string +) => { + if (isValidPushCAIP(address)) { + if (!address.includes('eip155:')) return `eip155:${chainId}:${address}`; + else return address; } else { throw Error(`Invalid Address! ${msg} \n Address: ${address}`); } -} +}; // P = Partial CAIP -export const walletToPCAIP10 = (account:string): string => { - if(isValidCAIP10NFTAddress(account) || account.includes('eip155:')){ - return account +export const walletToPCAIP10 = (account: string): string => { + if (isValidNFTCAIP(account) || account.includes('eip155:')) { + return account; } - return 'eip155:' + account -} + return 'eip155:' + account; +}; export const pCAIP10ToWallet = (wallet: string): string => { - if(isValidCAIP10NFTAddress(wallet))return wallet; - wallet = wallet.replace('eip155:', '') - return wallet -} \ No newline at end of file + if (isValidNFTCAIP(wallet)) return wallet; + wallet = wallet.replace('eip155:', ''); + return wallet; +}; diff --git a/packages/restapi/src/lib/helpers/crypto.ts b/packages/restapi/src/lib/helpers/crypto.ts index 7ed3e7557..94b90cb98 100644 --- a/packages/restapi/src/lib/helpers/crypto.ts +++ b/packages/restapi/src/lib/helpers/crypto.ts @@ -23,11 +23,7 @@ import { ProgressHookType, ProgressHookTypeFunction, } from '../types'; -import { - isValidCAIP10NFTAddress, - isValidETHAddress, - pCAIP10ToWallet, -} from './address'; +import { isValidNFTCAIP, isValidPushCAIP, pCAIP10ToWallet } from './address'; import { verifyProfileSignature } from '../chat/helpers/signature'; import { upgrade } from '../user/upgradeUser'; import PROGRESSHOOK from '../progressHook'; @@ -133,7 +129,7 @@ export const decryptPGPKey = async (options: decryptPgpKeyProps) => { const wallet = getWallet({ account, signer }); const address = await getAccountAddress(wallet); - if (!isValidETHAddress(address)) { + if (!isValidPushCAIP(address)) { throw new Error(`Invalid address!`); } @@ -530,7 +526,7 @@ export const verifyProfileKeys = async ( encryptedPrivateKey, }; - if (isValidCAIP10NFTAddress(did)) { + if (isValidNFTCAIP(did)) { const keyToRemove = 'owner'; const parsedEncryptedPrivateKey = JSON.parse(encryptedPrivateKey); if (keyToRemove in parsedEncryptedPrivateKey) { @@ -544,7 +540,7 @@ export const verifyProfileKeys = async ( const isValidSig: boolean = await verifyProfileSignature( verificationProof, signedData, - isValidCAIP10NFTAddress(did) + isValidNFTCAIP(did) ? pCAIP10ToWallet(JSON.parse(encryptedPrivateKey).owner) : pCAIP10ToWallet(did) ); diff --git a/packages/restapi/src/lib/payloads/helpers.ts b/packages/restapi/src/lib/payloads/helpers.ts index 228cbb77b..de1be2071 100644 --- a/packages/restapi/src/lib/payloads/helpers.ts +++ b/packages/restapi/src/lib/payloads/helpers.ts @@ -15,7 +15,7 @@ import { CHAIN_ID_TO_SOURCE, SOURCE_TYPES, } from './constants'; -import { getConnectedUser, sign } from '../chat/helpers'; +import { sign } from '../chat/helpers'; export function getUUID() { return uuidv4(); diff --git a/packages/restapi/src/lib/payloads/sendNotifications.ts b/packages/restapi/src/lib/payloads/sendNotifications.ts index 8de6e6bfb..ea02b3c12 100644 --- a/packages/restapi/src/lib/payloads/sendNotifications.ts +++ b/packages/restapi/src/lib/payloads/sendNotifications.ts @@ -13,8 +13,8 @@ import { getCAIPAddress, getCAIPDetails, getConfig, - isValidCAIP10NFTAddress, - isValidETHAddress, + isValidNFTCAIP, + isValidPushCAIP, } from '../helpers'; import { IDENTITY_TYPE, @@ -33,7 +33,7 @@ function validateOptions(options: ISendNotificationInputOptions) { if (!options?.channel) { throw '[Push SDK] - Error - sendNotification() - "channel" is mandatory!'; } - if (!isValidETHAddress(options.channel)) { + if (!isValidPushCAIP(options.channel)) { throw '[Push SDK] - Error - sendNotification() - "channel" is invalid!'; } if (options.senderType === 0 && options.signer === undefined) { @@ -213,7 +213,7 @@ export async function sendNotification(options: ISendNotificationInputOptions) { verificationProof, identity, sender: - senderType === 1 && !isValidCAIP10NFTAddress(_channelAddress) + senderType === 1 && !isValidNFTCAIP(_channelAddress) ? `${channelCAIPDetails?.blockchain}:${channelCAIPDetails?.address}` : _channelAddress, source, diff --git a/packages/restapi/src/lib/pushNotification/notification.ts b/packages/restapi/src/lib/pushNotification/notification.ts index d6b8ab7bc..c1e5a1438 100644 --- a/packages/restapi/src/lib/pushNotification/notification.ts +++ b/packages/restapi/src/lib/pushNotification/notification.ts @@ -97,7 +97,7 @@ export class Notification extends PushNotificationBaseClass { page = Constants.PAGINATION.INITIAL_PAGE, limit = Constants.PAGINATION.LIMIT, channel = null, - raw + raw, } = options || {}; const account = options?.account ? options.account @@ -109,7 +109,7 @@ export class Notification extends PushNotificationBaseClass { user: account!, env: this.env, channel: channel, - raw + raw, }); } catch (error) { throw new Error( diff --git a/packages/restapi/src/lib/pushapi/PushAPI.ts b/packages/restapi/src/lib/pushapi/PushAPI.ts index 6165b77fb..292ec9b37 100644 --- a/packages/restapi/src/lib/pushapi/PushAPI.ts +++ b/packages/restapi/src/lib/pushapi/PushAPI.ts @@ -18,7 +18,7 @@ import { import { ALPHA_FEATURE_CONFIG } from '../config'; import { Space } from './space'; import { Video } from './video'; -import { isValidCAIP10NFTAddress } from '../helpers'; +import { isValidNFTCAIP } from '../helpers'; import { LRUCache } from 'lru-cache'; import { cache } from '../helpers/cache'; import { v4 as uuidv4 } from 'uuid'; @@ -261,7 +261,7 @@ export class PushAPI { message: decryptionError, }); console.error(decryptionError); - if (isValidCAIP10NFTAddress(derivedAccount)) { + if (isValidNFTCAIP(derivedAccount)) { const nftDecryptionError = 'NFT Account Detected. If this NFT was recently transferred to you, please ensure you have received the correct password from the previous owner. Alternatively, you can reinitialize for a fresh start. Please be aware that reinitialization will result in the loss of all previous account data.'; diff --git a/packages/restapi/src/lib/pushapi/chat.ts b/packages/restapi/src/lib/pushapi/chat.ts index ad5ffcb37..57aad1b04 100644 --- a/packages/restapi/src/lib/pushapi/chat.ts +++ b/packages/restapi/src/lib/pushapi/chat.ts @@ -25,8 +25,8 @@ import { } from './pushAPITypes'; import * as PUSH_USER from '../user'; import * as PUSH_CHAT from '../chat'; -import { PGPHelper, getUserDID } from '../chat/helpers'; -import { isValidETHAddress } from '../helpers'; +import { PGPHelper } from '../chat/helpers'; +import { convertToValidDID, isValidPushCAIP } from '../helpers'; import { ChatUpdateGroupProfileType, updateGroupProfile, @@ -208,7 +208,7 @@ export class Chat { }); for (const element of users) { - if (!isValidETHAddress(element)) { + if (!isValidPushCAIP(element)) { throw new Error('Invalid address in the users: ' + element); } } @@ -249,7 +249,7 @@ export class Chat { }); for (const element of users) { - if (!isValidETHAddress(element)) { + if (!isValidPushCAIP(element)) { throw new Error('Invalid address in the users: ' + element); } } @@ -259,7 +259,7 @@ export class Chat { } const userDIDsPromises = users.map(async (user) => { - return (await getUserDID(user, this.env)).toLowerCase(); + return (await convertToValidDID(user, this.env)).toLowerCase(); }); const userDIDs = await Promise.all(userDIDsPromises); @@ -284,33 +284,29 @@ export class Chat { } async info( - receipient: string, + recipient: string, options?: { overrideAccount?: string; } ): Promise { const accountToUse = options?.overrideAccount || this.account; const request: PUSH_CHAT.GetChatInfoType = { - receipient: receipient, - sender: accountToUse, + recipient: recipient, + account: accountToUse, env: this.env, }; try { const chatInfo = await PUSH_CHAT.getChatInfo(request); - const finalRecipient = chatInfo.meta.group - ? chatInfo.chatId - : receipient; - - const response: ChatInfoResponse = { - meta: chatInfo.meta, - list: chatInfo.list, - participants: chatInfo.participants, - chatId: chatInfo.chatId, - receipient: finalRecipient, - }; - - return response; - return chatInfo; + const finalRecipient = chatInfo.meta.group ? chatInfo.chatId : recipient; + + const response: ChatInfoResponse = { + meta: chatInfo.meta, + list: chatInfo.list, + participants: chatInfo.participants, + chatId: chatInfo.chatId, + recipient: finalRecipient, + }; + return response; } catch (error) { console.error(`Error in Chat.info: `, error); throw new Error(`Error fetching chat info: ${error}`); @@ -508,7 +504,7 @@ export class Chat { } accounts.forEach((account) => { - if (!isValidETHAddress(account)) { + if (!isValidPushCAIP(account)) { throw new Error(`Invalid account address: ${account}`); } }); @@ -561,7 +557,7 @@ export class Chat { } accounts.forEach((account) => { - if (!isValidETHAddress(account)) { + if (!isValidPushCAIP(account)) { throw new Error(`Invalid account address: ${account}`); } }); @@ -623,7 +619,7 @@ export class Chat { } accounts.forEach((account) => { - if (!isValidETHAddress(account)) { + if (!isValidPushCAIP(account)) { throw new Error(`Invalid account address: ${account}`); } }); diff --git a/packages/restapi/src/lib/pushapi/space.ts b/packages/restapi/src/lib/pushapi/space.ts index 51f609a18..52a2014d4 100644 --- a/packages/restapi/src/lib/pushapi/space.ts +++ b/packages/restapi/src/lib/pushapi/space.ts @@ -39,7 +39,7 @@ import { groupInfoDtoToSpaceInfoDto, mapSpaceListTypeToChatListType, } from '../chat'; -import { isValidETHAddress } from '../helpers'; +import { isValidPushCAIP } from '../helpers'; import { Chat } from './chat'; import { Signer as PushSigner } from '../helpers'; @@ -237,7 +237,7 @@ export class Space { } accounts.forEach((account) => { - if (!isValidETHAddress(account)) { + if (!isValidPushCAIP(account)) { throw new Error(`Invalid account address: ${account}`); } }); @@ -282,7 +282,7 @@ export class Space { } accounts.forEach((account) => { - if (!isValidETHAddress(account)) { + if (!isValidPushCAIP(account)) { throw new Error(`Invalid account address: ${account}`); } }); @@ -347,7 +347,7 @@ export class Space { } accounts.forEach((account) => { - if (!isValidETHAddress(account)) { + if (!isValidPushCAIP(account)) { throw new Error(`Invalid account address: ${account}`); } }); diff --git a/packages/restapi/src/lib/space/approve.ts b/packages/restapi/src/lib/space/approve.ts index 61b426fcc..bea10fe00 100644 --- a/packages/restapi/src/lib/space/approve.ts +++ b/packages/restapi/src/lib/space/approve.ts @@ -1,58 +1,48 @@ -import { - isValidETHAddress, -} from '../helpers'; +import { isValidPushCAIP } from '../helpers'; import Constants from '../constants'; -import { - EnvOptionsType, - SignerType -} from '../types'; -import { - approve as approveRequest -} from '../chat/approveRequest'; +import { EnvOptionsType, SignerType } from '../types'; +import { approve as approveRequest } from '../chat/approveRequest'; interface ApproveRequestOptionsType extends EnvOptionsType { senderAddress: string; - pgpPrivateKey ? : string | null; - status ? : 'Approved'; - account ? : string | null; - signer ? : SignerType | null; + pgpPrivateKey?: string | null; + status?: 'Approved'; + account?: string | null; + signer?: SignerType | null; } export const approve = async ( options: ApproveRequestOptionsType -): Promise < string > => { +): Promise => { const { - status = 'Approved', - account = null, - signer = null, - senderAddress, // space id - env = Constants.ENV.PROD, - pgpPrivateKey = null, + status = 'Approved', + account = null, + signer = null, + senderAddress, // space id + env = Constants.ENV.PROD, + pgpPrivateKey = null, } = options || {}; try { + if (account == null && signer == null) { + throw new Error(`At least one from account or signer is necessary!`); + } - if (account == null && signer == null) { - throw new Error(`At least one from account or signer is necessary!`); - } - - if (!isValidETHAddress(senderAddress) && !senderAddress.startsWith("spaces:")) { - throw new Error("Not a valid spaceId or ETH address"); - } - return await approveRequest({ - status: status, - account: account, - signer: signer, - senderAddress: senderAddress, - env: env, - pgpPrivateKey: pgpPrivateKey - }) + if ( + !isValidPushCAIP(senderAddress) && + !senderAddress.startsWith('spaces:') + ) { + throw new Error('Not a valid spaceId or ETH address'); + } + return await approveRequest({ + status: status, + account: account, + signer: signer, + senderAddress: senderAddress, + env: env, + pgpPrivateKey: pgpPrivateKey, + }); } catch (err) { - console.error( - `[Push SDK] - API - Error - API ${approve.name} -: `, - err - ); - throw Error( - `[Push SDK] - API - Error - API ${approve.name} -: ${err}` - ); + console.error(`[Push SDK] - API - Error - API ${approve.name} -: `, err); + throw Error(`[Push SDK] - API - Error - API ${approve.name} -: ${err}`); } }; diff --git a/packages/restapi/src/lib/space/requests.ts b/packages/restapi/src/lib/space/requests.ts index b6821f590..fb0ce10a8 100644 --- a/packages/restapi/src/lib/space/requests.ts +++ b/packages/restapi/src/lib/space/requests.ts @@ -1,7 +1,7 @@ -import { getAPIBaseUrls, isValidETHAddress } from '../helpers'; +import { convertToValidDID, getAPIBaseUrls, isValidPushCAIP } from '../helpers'; import Constants, { ENV } from '../constants'; -import { SpaceIFeeds } from '../types'; -import { getSpaceInboxLists, getUserDID } from '../chat/helpers'; +import { SpaceIFeeds } from '../types'; +import { getSpaceInboxLists } from '../chat/helpers'; import { axiosGet } from '../utils/axiosUtil'; export type RequestOptionsType = { @@ -40,11 +40,11 @@ export const requests = async ( page = 1, limit = 10, } = options || {}; - const user = await getUserDID(account, env); + const user = await convertToValidDID(account, env); const API_BASE_URL = getAPIBaseUrls(env); const apiEndpoint = `${API_BASE_URL}/v1/spaces/users/${user}/requests?page=${page}&limit=${limit}`; try { - if (!isValidETHAddress(user)) { + if (!isValidPushCAIP(user)) { throw new Error(`Invalid address!`); } const response = await axiosGet(apiEndpoint); diff --git a/packages/restapi/src/lib/space/spaceFeed.ts b/packages/restapi/src/lib/space/spaceFeed.ts index 5084feebd..a994a4417 100644 --- a/packages/restapi/src/lib/space/spaceFeed.ts +++ b/packages/restapi/src/lib/space/spaceFeed.ts @@ -1,7 +1,7 @@ -import { getAPIBaseUrls, isValidETHAddress } from '../helpers'; +import { convertToValidDID, getAPIBaseUrls, isValidPushCAIP } from '../helpers'; import Constants, { ENV } from '../constants'; import { SpaceIFeeds } from '../types'; -import { getSpaceInboxLists, getUserDID } from './../chat/helpers'; +import { getSpaceInboxLists } from './../chat/helpers'; import { axiosGet } from '../utils/axiosUtil'; export const spaceFeed = async (options: { @@ -18,9 +18,9 @@ export const spaceFeed = async (options: { toDecrypt = false, recipient, } = options || {}; - const user = await getUserDID(account, env); - const recipientWallet = await getUserDID(recipient, env); - if (!isValidETHAddress(user)) throw new Error(`Invalid address ${user}`); + const user = await convertToValidDID(account, env); + const recipientWallet = await convertToValidDID(recipient, env); + if (!isValidPushCAIP(user)) throw new Error(`Invalid address ${user}`); const API_BASE_URL = getAPIBaseUrls(env); const apiEndpoint = `${API_BASE_URL}/v1/spaces/users/${user}/space/${recipientWallet}`; try { diff --git a/packages/restapi/src/lib/space/spaces.ts b/packages/restapi/src/lib/space/spaces.ts index 1f802781c..cd24c0901 100644 --- a/packages/restapi/src/lib/space/spaces.ts +++ b/packages/restapi/src/lib/space/spaces.ts @@ -1,7 +1,7 @@ -import { getAPIBaseUrls, isValidETHAddress } from '../helpers'; +import { convertToValidDID, getAPIBaseUrls, isValidPushCAIP } from '../helpers'; import Constants, { ENV } from '../constants'; -import { SpaceIFeeds } from '../types'; -import { getSpaceInboxLists, getUserDID } from '../chat/helpers'; +import { SpaceIFeeds } from '../types'; +import { getSpaceInboxLists } from '../chat/helpers'; import { axiosGet } from '../utils/axiosUtil'; export type ChatsOptionsType = { @@ -28,7 +28,9 @@ export type ChatsOptionsType = { /** * Return the latest message from all wallet addresses you have talked to. This can be used when building the inbox page. */ -export const spaces = async (options: ChatsOptionsType): Promise => { +export const spaces = async ( + options: ChatsOptionsType +): Promise => { const { account, pgpPrivateKey, @@ -36,10 +38,10 @@ export const spaces = async (options: ChatsOptionsType): Promise page = 1, limit = 10, } = options || {}; - if (!isValidETHAddress(account)) { + if (!isValidPushCAIP(account)) { throw new Error(`Invalid address!`); } - const user = await getUserDID(account, env); + const user = await convertToValidDID(account, env); const API_BASE_URL = getAPIBaseUrls(env); const apiEndpoint = `${API_BASE_URL}/v1/spaces/users/${user}/spaces?page=${page}&limit=${limit}`; const requestUrl = `${apiEndpoint}`; diff --git a/packages/restapi/src/lib/user/auth.updateUser.ts b/packages/restapi/src/lib/user/auth.updateUser.ts index 8074dcfc8..789abd0e2 100644 --- a/packages/restapi/src/lib/user/auth.updateUser.ts +++ b/packages/restapi/src/lib/user/auth.updateUser.ts @@ -6,7 +6,7 @@ import { import Constants, { ENV, ENCRYPTION_TYPE } from '../constants'; import { encryptPGPKey, - isValidETHAddress, + isValidPushCAIP, preparePGPPublicKey, walletToPCAIP10, } from '../helpers'; @@ -68,7 +68,7 @@ export const authUpdate = async (options: AuthUpdateProps): Promise => { ? true : false; - if (!isValidETHAddress(address)) { + if (!isValidPushCAIP(address)) { throw new Error(`Invalid address!`); } diff --git a/packages/restapi/src/lib/user/createUser.ts b/packages/restapi/src/lib/user/createUser.ts index 2583ac78e..c14822009 100644 --- a/packages/restapi/src/lib/user/createUser.ts +++ b/packages/restapi/src/lib/user/createUser.ts @@ -8,11 +8,11 @@ import { } from '../chat/helpers'; import Constants, { ENV } from '../constants'; import { - isValidETHAddress, + isValidPushCAIP, walletToPCAIP10, encryptPGPKey, preparePGPPublicKey, - isValidCAIP10NFTAddress, + isValidNFTCAIP, validatePssword, } from '../helpers'; import { @@ -76,7 +76,7 @@ export const createUserCore = async ( const wallet = getWallet({ account, signer }); const address = await getAccountAddress(wallet); - if (!isValidETHAddress(address)) { + if (!isValidPushCAIP(address)) { throw new Error(`Invalid address!`); } if (additionalMeta?.NFTPGP_V1?.password) { @@ -86,7 +86,7 @@ export const createUserCore = async ( const caip10: string = walletToPCAIP10(address); let encryptionType = version; - if (isValidCAIP10NFTAddress(caip10)) { + if (isValidNFTCAIP(caip10)) { // upgrade to v4 (nft encryption) encryptionType = Constants.ENC_TYPE_V4; } else { diff --git a/packages/restapi/src/lib/user/decryptAuth.ts b/packages/restapi/src/lib/user/decryptAuth.ts index b9a160a2c..47f6c42c5 100644 --- a/packages/restapi/src/lib/user/decryptAuth.ts +++ b/packages/restapi/src/lib/user/decryptAuth.ts @@ -1,5 +1,5 @@ import Constants, { ENV } from '../constants'; -import { decryptPGPKey, isValidCAIP10NFTAddress } from '../helpers'; +import { decryptPGPKey, isValidNFTCAIP } from '../helpers'; import PROGRESSHOOK from '../progressHook'; import { ProgressHookType, @@ -37,7 +37,7 @@ export const decryptAuth = async ( progressHook, } = options || {}; try { - if (!isValidCAIP10NFTAddress(account as string)) { + if (!isValidNFTCAIP(account as string)) { return null; } // Report Progress diff --git a/packages/restapi/src/lib/user/getUser.ts b/packages/restapi/src/lib/user/getUser.ts index a3012c1a8..ee67b568b 100644 --- a/packages/restapi/src/lib/user/getUser.ts +++ b/packages/restapi/src/lib/user/getUser.ts @@ -1,5 +1,5 @@ import { AccountEnvOptionsType, IUser } from '../types'; -import { isValidETHAddress, walletToPCAIP10 } from '../helpers/address'; +import { isValidPushCAIP, walletToPCAIP10 } from '../helpers/address'; import { getAPIBaseUrls, verifyProfileKeys } from '../helpers'; import Constants from '../constants'; import { populateDeprecatedUser } from '../utils/populateIUser'; @@ -7,7 +7,7 @@ import { axiosGet } from '../utils/axiosUtil'; export const get = async (options: AccountEnvOptionsType): Promise => { const { account, env = Constants.ENV.PROD } = options || {}; - if (!isValidETHAddress(account)) { + if (!isValidPushCAIP(account)) { throw new Error(`Invalid address!`); } const caip10 = walletToPCAIP10(account); diff --git a/packages/restapi/src/lib/user/getUsersBatch.ts b/packages/restapi/src/lib/user/getUsersBatch.ts index 2ec31fa4c..03b3b05a0 100644 --- a/packages/restapi/src/lib/user/getUsersBatch.ts +++ b/packages/restapi/src/lib/user/getUsersBatch.ts @@ -1,5 +1,5 @@ import { IUser } from '../types'; -import { isValidETHAddress, walletToPCAIP10 } from '../helpers/address'; +import { isValidPushCAIP, walletToPCAIP10 } from '../helpers/address'; import { getAPIBaseUrls, verifyProfileKeys } from '../helpers'; import Constants, { ENV } from '../constants'; import { populateDeprecatedUser } from '../utils/populateIUser'; @@ -24,7 +24,7 @@ export const getBatch = async (options: GetBatchType): Promise => { } for (let i = 0; i < userIds.length; i++) { - if (!isValidETHAddress(userIds[i])) { + if (!isValidPushCAIP(userIds[i])) { throw new Error(`Invalid user address!`); } } diff --git a/packages/restapi/src/lib/user/profile.updateUser.ts b/packages/restapi/src/lib/user/profile.updateUser.ts index 3d83b14c1..e33d76bad 100644 --- a/packages/restapi/src/lib/user/profile.updateUser.ts +++ b/packages/restapi/src/lib/user/profile.updateUser.ts @@ -1,9 +1,10 @@ import * as CryptoJS from 'crypto-js'; -import { IPGPHelper, PGPHelper, getUserDID } from '../chat/helpers'; +import { IPGPHelper, PGPHelper } from '../chat/helpers'; import Constants, { ENV } from '../constants'; import { + convertToValidDID, getAPIBaseUrls, - isValidETHAddress, + isValidPushCAIP, verifyProfileKeys, } from '../helpers'; import { IUser, ProgressHookType, ProgressHookTypeFunction } from '../types'; @@ -55,7 +56,7 @@ export const profileUpdateCore = async ( progressHook, } = options || {}; try { - if (!isValidETHAddress(account)) { + if (!isValidPushCAIP(account)) { throw new Error(`Invalid account!`); } @@ -67,7 +68,7 @@ export const profileUpdateCore = async ( if (profile.blockedUsersList) { for (const element of profile.blockedUsersList) { // Check if the element is a valid CAIP-10 address - if (!isValidETHAddress(element)) { + if (!isValidPushCAIP(element)) { throw new Error( 'Invalid address in the blockedUsersList: ' + element ); @@ -76,7 +77,7 @@ export const profileUpdateCore = async ( const convertedBlockedListUsersPromise = profile.blockedUsersList.map( async (each) => { - return getUserDID(each, env); + return convertToValidDID(each, env); } ); blockedUsersList = await Promise.all(convertedBlockedListUsersPromise); diff --git a/packages/restapi/src/lib/user/upgradeUser.ts b/packages/restapi/src/lib/user/upgradeUser.ts index 5bc39d04b..0a7888bec 100644 --- a/packages/restapi/src/lib/user/upgradeUser.ts +++ b/packages/restapi/src/lib/user/upgradeUser.ts @@ -1,6 +1,6 @@ import { getAccountAddress, getWallet } from '../chat/helpers'; import Constants, { ENV } from '../constants'; -import { isValidETHAddress, decryptPGPKey } from '../helpers'; +import { isValidPushCAIP, decryptPGPKey } from '../helpers'; import { SignerType, IUser, @@ -41,7 +41,7 @@ export const upgrade = async (options: UpgradeUserProps): Promise => { const wallet = getWallet({ account, signer }); const address = await getAccountAddress(wallet); - if (!isValidETHAddress(address)) { + if (!isValidPushCAIP(address)) { throw new Error(`Invalid address!`); } diff --git a/packages/restapi/src/lib/video/VideoV2.ts b/packages/restapi/src/lib/video/VideoV2.ts index 45d300f6e..eae801e2f 100644 --- a/packages/restapi/src/lib/video/VideoV2.ts +++ b/packages/restapi/src/lib/video/VideoV2.ts @@ -1,11 +1,7 @@ import { produce } from 'immer'; import { chats } from '../chat'; import { ENV } from '../constants'; -import { - isValidETHAddress, - pCAIP10ToWallet, - walletToPCAIP10, -} from '../helpers'; +import { isValidPushCAIP, pCAIP10ToWallet, walletToPCAIP10 } from '../helpers'; import { VIDEO_NOTIFICATION_ACCESS_TYPE } from '../payloads/constants'; import { VideoCallStatus, @@ -26,7 +22,7 @@ export class VideoV2 { private videoInstance: VideoV1; // peerInfo objects from the incoming video call requests - private peerInfos: {[key: string]: VideoPeerInfo}; + private peerInfos: { [key: string]: VideoPeerInfo }; /** * VideoV2 constructor @@ -41,13 +37,13 @@ export class VideoV2 { account, decryptedPgpPvtKey, env, - peerInfos + peerInfos, }: { videoV1Instance: VideoV1; account: string; decryptedPgpPvtKey: string; env: ENV; - peerInfos: {[key: string]: VideoPeerInfo} + peerInfos: { [key: string]: VideoPeerInfo }; }) { this.videoInstance = videoV1Instance; this.account = account; @@ -75,7 +71,7 @@ export class VideoV2 { const { rules } = options || {}; for (const recipient of recipients) { - if (!isValidETHAddress(recipient)) { + if (!isValidPushCAIP(recipient)) { throw new Error('Invalid recipient address found'); } } @@ -164,7 +160,9 @@ export class VideoV2 { if (!address) { const peerInfoAddresses = Object.keys(this.peerInfos); if (peerInfoAddresses.length !== 1) { - throw new Error('Either no request exists or more than one request found. Please pass an address.'); + throw new Error( + 'Either no request exists or more than one request found. Please pass an address.' + ); } address = peerInfoAddresses[0]; } @@ -189,7 +187,9 @@ export class VideoV2 { if (!address) { const peerInfoAddresses = Object.keys(this.peerInfos); if (peerInfoAddresses.length !== 1) { - throw new Error('Either no request exists or more than one request found. Please pass an address.'); + throw new Error( + 'Either no request exists or more than one request found. Please pass an address.' + ); } address = peerInfoAddresses[0]; } diff --git a/packages/restapi/src/lib/video/helpers/validatePeerInfo.ts b/packages/restapi/src/lib/video/helpers/validatePeerInfo.ts index b72f20a4b..9402063de 100644 --- a/packages/restapi/src/lib/video/helpers/validatePeerInfo.ts +++ b/packages/restapi/src/lib/video/helpers/validatePeerInfo.ts @@ -1,4 +1,4 @@ -import { isValidETHAddress } from '../../helpers'; +import { isValidPushCAIP } from '../../helpers'; import { VIDEO_NOTIFICATION_ACCESS_TYPE } from '../../payloads/constants'; import { VideoPeerInfo } from '../../types'; @@ -9,7 +9,7 @@ export const validatePeerInfo = (peerInfo: VideoPeerInfo) => { throw new Error('Invalid signal data received'); } - if (!isValidETHAddress(address)) { + if (!isValidPushCAIP(address)) { throw new Error('Invalid address received'); }