diff --git a/packages/demoreact/src/app/ChatTest/GetUser.tsx b/packages/demoreact/src/app/ChatTest/GetUser.tsx index 8233e07e6..973234e03 100644 --- a/packages/demoreact/src/app/ChatTest/GetUser.tsx +++ b/packages/demoreact/src/app/ChatTest/GetUser.tsx @@ -152,7 +152,7 @@ const GetUserTest = () => { ) : null} - {connectedUser && (connectedUser as IUser).nftOwner !== null && ( + {connectedUser && (connectedUser as IUser).did.split(':')[0] === 'nft' && (
{connectedUser ? {password} : null} diff --git a/packages/restapi/CHANGELOG.md b/packages/restapi/CHANGELOG.md index 909f52dcf..a3c332e6e 100644 --- a/packages/restapi/CHANGELOG.md +++ b/packages/restapi/CHANGELOG.md @@ -4,7 +4,6 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/s ## [1.3.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.3.1...restapi-1.3.2) (2023-05-23) - ### Bug Fixes * merge main ([5d0bc64](https://github.com/ethereum-push-notification-service/push-sdk/commit/5d0bc649b16c674d20e96eedc590a0efe6a5b77f)) @@ -13,7 +12,6 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/s ## [1.3.1](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.3.0...restapi-1.3.1) (2023-05-22) - ### Bug Fixes * merge main ([dc2ba17](https://github.com/ethereum-push-notification-service/push-sdk/commit/dc2ba179cef2f834ac4fe13a6673095b97a6e019)) @@ -22,7 +20,6 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/s # [1.3.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.16...restapi-1.3.0) (2023-05-19) - ### Bug Fixes * merge main ([b58d9d5](https://github.com/ethereum-push-notification-service/push-sdk/commit/b58d9d53bd91fa33200a854170fe7e3facff4371)) @@ -36,989 +33,747 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/s ## [1.2.16](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.15...restapi-1.2.16) (2023-05-19) - ### Bug Fixes -* add deprecated info to chat.chat ([#392](https://github.com/ethereum-push-notification-service/push-sdk/issues/392)) ([d84ae64](https://github.com/ethereum-push-notification-service/push-sdk/commit/d84ae64c116adb7eea9e8faf7929b6eb3b74c657)) -* Merge branch 'alpha' into alpha-deployment ([549fd83](https://github.com/ethereum-push-notification-service/push-sdk/commit/549fd839867d84a98a10206a7f9945aeb1720e49)) -* Merge branch 'main' into alpha ([72464fd](https://github.com/ethereum-push-notification-service/push-sdk/commit/72464fd97260b612649035e3b241f946de8f9e92)) -* show hardcoded msg rather than throwing error ([#388](https://github.com/ethereum-push-notification-service/push-sdk/issues/388)) ([8962e10](https://github.com/ethereum-push-notification-service/push-sdk/commit/8962e10036916d0bc161324f5684f74bb7b74dc3)) -* **video:** set trickle to true while creating peer instance ([#397](https://github.com/ethereum-push-notification-service/push-sdk/issues/397)) ([0b609be](https://github.com/ethereum-push-notification-service/push-sdk/commit/0b609bec87a6187d1e7cbf8052a2b9a36b9fcd7a)) - - +- add deprecated info to chat.chat ([#392](https://github.com/ethereum-push-notification-service/push-sdk/issues/392)) ([d84ae64](https://github.com/ethereum-push-notification-service/push-sdk/commit/d84ae64c116adb7eea9e8faf7929b6eb3b74c657)) +- Merge branch 'alpha' into alpha-deployment ([549fd83](https://github.com/ethereum-push-notification-service/push-sdk/commit/549fd839867d84a98a10206a7f9945aeb1720e49)) +- Merge branch 'main' into alpha ([72464fd](https://github.com/ethereum-push-notification-service/push-sdk/commit/72464fd97260b612649035e3b241f946de8f9e92)) +- show hardcoded msg rather than throwing error ([#388](https://github.com/ethereum-push-notification-service/push-sdk/issues/388)) ([8962e10](https://github.com/ethereum-push-notification-service/push-sdk/commit/8962e10036916d0bc161324f5684f74bb7b74dc3)) +- **video:** set trickle to true while creating peer instance ([#397](https://github.com/ethereum-push-notification-service/push-sdk/issues/397)) ([0b609be](https://github.com/ethereum-push-notification-service/push-sdk/commit/0b609bec87a6187d1e7cbf8052a2b9a36b9fcd7a)) ## [0.0.1-alpha.7](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.6...restapi-0.0.1-alpha.7) (2023-05-15) - ### Bug Fixes -* Merge branch 'alpha' into alpha-deployment ([37c1c8d](https://github.com/ethereum-push-notification-service/push-sdk/commit/37c1c8db579876f5835c2e5bb5e6baf073dc9208)) -* **video:** remove status change upon connect in request ([#394](https://github.com/ethereum-push-notification-service/push-sdk/issues/394)) ([7441ef0](https://github.com/ethereum-push-notification-service/push-sdk/commit/7441ef0fb2c9ed39e12a4f1819ade0ee7e0d6b10)) - - +- Merge branch 'alpha' into alpha-deployment ([37c1c8d](https://github.com/ethereum-push-notification-service/push-sdk/commit/37c1c8db579876f5835c2e5bb5e6baf073dc9208)) +- **video:** remove status change upon connect in request ([#394](https://github.com/ethereum-push-notification-service/push-sdk/issues/394)) ([7441ef0](https://github.com/ethereum-push-notification-service/push-sdk/commit/7441ef0fb2c9ed39e12a4f1819ade0ee7e0d6b10)) ## [0.0.1-alpha.6](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.5...restapi-0.0.1-alpha.6) (2023-05-14) - ### Bug Fixes -* add video call retry logic upon error & doc: add video call in restapi/readme ([#391](https://github.com/ethereum-push-notification-service/push-sdk/issues/391)) ([9c8c86b](https://github.com/ethereum-push-notification-service/push-sdk/commit/9c8c86b35d1cb0300d0170e87931dd31a15f9342)) - - +- add video call retry logic upon error & doc: add video call in restapi/readme ([#391](https://github.com/ethereum-push-notification-service/push-sdk/issues/391)) ([9c8c86b](https://github.com/ethereum-push-notification-service/push-sdk/commit/9c8c86b35d1cb0300d0170e87931dd31a15f9342)) ## [0.0.1-alpha.5](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.4...restapi-0.0.1-alpha.5) (2023-05-14) - - ## [0.0.1-alpha.4](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.3...restapi-0.0.1-alpha.4) (2023-05-12) - ### Bug Fixes -* fix chat.chat for grps ([#382](https://github.com/ethereum-push-notification-service/push-sdk/issues/382)) ([052a75c](https://github.com/ethereum-push-notification-service/push-sdk/commit/052a75ca0f0fea7664d8c607fc85cdf37cc5d398)) -* fix eip712v2 ([#385](https://github.com/ethereum-push-notification-service/push-sdk/issues/385)) ([42c10ba](https://github.com/ethereum-push-notification-service/push-sdk/commit/42c10ba6f5331c9caf5db7136ba94d1a6ed05e10)) -* Merge branch 'alpha' into alpha-deployment ([a1a8666](https://github.com/ethereum-push-notification-service/push-sdk/commit/a1a86661b1823c84328ec90ac9aafc6c57f574f3)) -* Merge branch 'main' into alpha ([5fc51db](https://github.com/ethereum-push-notification-service/push-sdk/commit/5fc51db1a336203048b4b42a5384cb37cf79c509)) -* **video:** separate react state from video class instance variable data ([#389](https://github.com/ethereum-push-notification-service/push-sdk/issues/389)) ([83bf445](https://github.com/ethereum-push-notification-service/push-sdk/commit/83bf4457332b127bf9e41a2f4c93fb851367724d)) - - +- fix chat.chat for grps ([#382](https://github.com/ethereum-push-notification-service/push-sdk/issues/382)) ([052a75c](https://github.com/ethereum-push-notification-service/push-sdk/commit/052a75ca0f0fea7664d8c607fc85cdf37cc5d398)) +- fix eip712v2 ([#385](https://github.com/ethereum-push-notification-service/push-sdk/issues/385)) ([42c10ba](https://github.com/ethereum-push-notification-service/push-sdk/commit/42c10ba6f5331c9caf5db7136ba94d1a6ed05e10)) +- Merge branch 'alpha' into alpha-deployment ([a1a8666](https://github.com/ethereum-push-notification-service/push-sdk/commit/a1a86661b1823c84328ec90ac9aafc6c57f574f3)) +- Merge branch 'main' into alpha ([5fc51db](https://github.com/ethereum-push-notification-service/push-sdk/commit/5fc51db1a336203048b4b42a5384cb37cf79c509)) +- **video:** separate react state from video class instance variable data ([#389](https://github.com/ethereum-push-notification-service/push-sdk/issues/389)) ([83bf445](https://github.com/ethereum-push-notification-service/push-sdk/commit/83bf4457332b127bf9e41a2f4c93fb851367724d)) ## [0.0.1-alpha.3](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.2...restapi-0.0.1-alpha.3) (2023-05-11) - ### Bug Fixes -* Merge branch 'alpha' into alpha-deployment ([e19b9b0](https://github.com/ethereum-push-notification-service/push-sdk/commit/e19b9b05b60174e68dc7bfe0e2349e20d8af2604)) -* Replace arrow functions with normal functions in the Video class ([#380](https://github.com/ethereum-push-notification-service/push-sdk/issues/380)) ([b90435a](https://github.com/ethereum-push-notification-service/push-sdk/commit/b90435a953b908899c92eb5b4d4c3677e47b1552)) - - +- Merge branch 'alpha' into alpha-deployment ([e19b9b0](https://github.com/ethereum-push-notification-service/push-sdk/commit/e19b9b05b60174e68dc7bfe0e2349e20d8af2604)) +- Replace arrow functions with normal functions in the Video class ([#380](https://github.com/ethereum-push-notification-service/push-sdk/issues/380)) ([b90435a](https://github.com/ethereum-push-notification-service/push-sdk/commit/b90435a953b908899c92eb5b4d4c3677e47b1552)) ## [0.0.1-alpha.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.1...restapi-0.0.1-alpha.2) (2023-05-10) - ### Bug Fixes -* eip191v2 signatures for create and auth.update ([#359](https://github.com/ethereum-push-notification-service/push-sdk/issues/359)) ([48abaf6](https://github.com/ethereum-push-notification-service/push-sdk/commit/48abaf667dce2a1140c3622451c1c5b49d153c00)) -* merge alpha ([7f0642c](https://github.com/ethereum-push-notification-service/push-sdk/commit/7f0642c4c417390a5bb52d36d9493bd5b767b634)) -* merge main ([a5fdfe1](https://github.com/ethereum-push-notification-service/push-sdk/commit/a5fdfe10f18c857c32aa5fe5c5dd95db0f268cd1)) -* merge main to alpha ([4866a37](https://github.com/ethereum-push-notification-service/push-sdk/commit/4866a37ed0502c0d16ac91f088d3bb5e597b652a)) - - +- eip191v2 signatures for create and auth.update ([#359](https://github.com/ethereum-push-notification-service/push-sdk/issues/359)) ([48abaf6](https://github.com/ethereum-push-notification-service/push-sdk/commit/48abaf667dce2a1140c3622451c1c5b49d153c00)) +- merge alpha ([7f0642c](https://github.com/ethereum-push-notification-service/push-sdk/commit/7f0642c4c417390a5bb52d36d9493bd5b767b634)) +- merge main ([a5fdfe1](https://github.com/ethereum-push-notification-service/push-sdk/commit/a5fdfe10f18c857c32aa5fe5c5dd95db0f268cd1)) +- merge main to alpha ([4866a37](https://github.com/ethereum-push-notification-service/push-sdk/commit/4866a37ed0502c0d16ac91f088d3bb5e597b652a)) ## [0.0.1-alpha.1](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.0...restapi-0.0.1-alpha.1) (2023-05-08) - ### Bug Fixes -* Merge branch 'alpha' into alpha-deployment ([1223c60](https://github.com/ethereum-push-notification-service/push-sdk/commit/1223c60b0f179b26537992a776155aefffd7b5ef)) -* sendVideoNotification and end video call logic ([#367](https://github.com/ethereum-push-notification-service/push-sdk/issues/367)) ([d39c703](https://github.com/ethereum-push-notification-service/push-sdk/commit/d39c703bcda6d332717a5e9b1af6ab574be9d991)) - - +- Merge branch 'alpha' into alpha-deployment ([1223c60](https://github.com/ethereum-push-notification-service/push-sdk/commit/1223c60b0f179b26537992a776155aefffd7b5ef)) +- sendVideoNotification and end video call logic ([#367](https://github.com/ethereum-push-notification-service/push-sdk/issues/367)) ([d39c703](https://github.com/ethereum-push-notification-service/push-sdk/commit/d39c703bcda6d332717a5e9b1af6ab574be9d991)) ## [0.0.1-alpha.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-beta.2...restapi-0.0.1-alpha.0) (2023-05-04) - ### Bug Fixes -* added pagination and deprecation tag ([#346](https://github.com/ethereum-push-notification-service/push-sdk/issues/346)) ([69763b8](https://github.com/ethereum-push-notification-service/push-sdk/commit/69763b8da2cf3e92bb85908e4f46a72b650c9dba)) -* change preid to alpha ([#358](https://github.com/ethereum-push-notification-service/push-sdk/issues/358)) ([6ac2c23](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ac2c23c5e4a9f54f8bd6ae99aeb77c96417aae3)) -* changed Definitions for auth.update and upgrade ([#351](https://github.com/ethereum-push-notification-service/push-sdk/issues/351)) ([31daee3](https://github.com/ethereum-push-notification-service/push-sdk/commit/31daee3a5aa913705d1dec8210c0412cd89c94c9)) -* eip191v2 signatures for create and auth.update ([#353](https://github.com/ethereum-push-notification-service/push-sdk/issues/353)) ([008e6d0](https://github.com/ethereum-push-notification-service/push-sdk/commit/008e6d08d75fdacf19f1674cc2b8bd82091fa31f)) -* Merge branch 'main' into alpha ([477bae4](https://github.com/ethereum-push-notification-service/push-sdk/commit/477bae4fdc4e86374615f0f67c41c570a567b9fe)) - - +- added pagination and deprecation tag ([#346](https://github.com/ethereum-push-notification-service/push-sdk/issues/346)) ([69763b8](https://github.com/ethereum-push-notification-service/push-sdk/commit/69763b8da2cf3e92bb85908e4f46a72b650c9dba)) +- change preid to alpha ([#358](https://github.com/ethereum-push-notification-service/push-sdk/issues/358)) ([6ac2c23](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ac2c23c5e4a9f54f8bd6ae99aeb77c96417aae3)) +- changed Definitions for auth.update and upgrade ([#351](https://github.com/ethereum-push-notification-service/push-sdk/issues/351)) ([31daee3](https://github.com/ethereum-push-notification-service/push-sdk/commit/31daee3a5aa913705d1dec8210c0412cd89c94c9)) +- eip191v2 signatures for create and auth.update ([#353](https://github.com/ethereum-push-notification-service/push-sdk/issues/353)) ([008e6d0](https://github.com/ethereum-push-notification-service/push-sdk/commit/008e6d08d75fdacf19f1674cc2b8bd82091fa31f)) +- Merge branch 'main' into alpha ([477bae4](https://github.com/ethereum-push-notification-service/push-sdk/commit/477bae4fdc4e86374615f0f67c41c570a567b9fe)) ## [0.0.1-beta.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-beta.1...restapi-0.0.1-beta.2) (2023-05-04) - ### Bug Fixes -* change preid to alpha ([#358](https://github.com/ethereum-push-notification-service/push-sdk/issues/358)) ([6ac2c23](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ac2c23c5e4a9f54f8bd6ae99aeb77c96417aae3)) -* changed AdditionalMeta structure ([#349](https://github.com/ethereum-push-notification-service/push-sdk/issues/349)) ([ee8ca02](https://github.com/ethereum-push-notification-service/push-sdk/commit/ee8ca022b2d948d08fa8503616898ff6c773062e)) - - +- change preid to alpha ([#358](https://github.com/ethereum-push-notification-service/push-sdk/issues/358)) ([6ac2c23](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ac2c23c5e4a9f54f8bd6ae99aeb77c96417aae3)) +- changed AdditionalMeta structure ([#349](https://github.com/ethereum-push-notification-service/push-sdk/issues/349)) ([ee8ca02](https://github.com/ethereum-push-notification-service/push-sdk/commit/ee8ca022b2d948d08fa8503616898ff6c773062e)) ## [1.2.11](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-beta.1...restapi-1.2.11) (2023-05-08) - - ## [1.2.10](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-beta.1...restapi-1.2.10) (2023-05-08) - - ## [0.0.1-alpha.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-beta.1...restapi-0.0.1-alpha.0) (2023-05-08) - - ## [0.0.1-beta.1](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.10...restapi-0.0.1-beta.1) (2023-05-04) - - ## [1.2.10](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-beta.0...restapi-1.2.10) (2023-05-02) - ### Bug Fixes -* add password validation ([#345](https://github.com/ethereum-push-notification-service/push-sdk/issues/345)) ([863f48f](https://github.com/ethereum-push-notification-service/push-sdk/commit/863f48f9cbb3022e01f8715005cc8cd0fa96d0a8)) -* Merge branch 'main' into deployment ([a3cf078](https://github.com/ethereum-push-notification-service/push-sdk/commit/a3cf078f37d31859ae83129d2b704639bbaab62b)) - - +- add password validation ([#345](https://github.com/ethereum-push-notification-service/push-sdk/issues/345)) ([863f48f](https://github.com/ethereum-push-notification-service/push-sdk/commit/863f48f9cbb3022e01f8715005cc8cd0fa96d0a8)) +- Merge branch 'main' into deployment ([a3cf078](https://github.com/ethereum-push-notification-service/push-sdk/commit/a3cf078f37d31859ae83129d2b704639bbaab62b)) ## [1.2.10](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-beta.0...restapi-1.2.10) (2023-05-02) - ### Bug Fixes -* add password validation ([#345](https://github.com/ethereum-push-notification-service/push-sdk/issues/345)) ([863f48f](https://github.com/ethereum-push-notification-service/push-sdk/commit/863f48f9cbb3022e01f8715005cc8cd0fa96d0a8)) -* Merge branch 'main' into deployment ([a3cf078](https://github.com/ethereum-push-notification-service/push-sdk/commit/a3cf078f37d31859ae83129d2b704639bbaab62b)) - - +- add password validation ([#345](https://github.com/ethereum-push-notification-service/push-sdk/issues/345)) ([863f48f](https://github.com/ethereum-push-notification-service/push-sdk/commit/863f48f9cbb3022e01f8715005cc8cd0fa96d0a8)) +- Merge branch 'main' into deployment ([a3cf078](https://github.com/ethereum-push-notification-service/push-sdk/commit/a3cf078f37d31859ae83129d2b704639bbaab62b)) ## [0.0.1-beta.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.9...restapi-0.0.1-beta.0) (2023-05-02) - ### Bug Fixes -* added ci-version-beta ([2f282ce](https://github.com/ethereum-push-notification-service/push-sdk/commit/2f282ce60003733fc95ce239a6c1a2d6c24616cc)) -* added ci-version-beta ([496952a](https://github.com/ethereum-push-notification-service/push-sdk/commit/496952ac8faab02c82ee11be8e8925a1fb01cd01)) -* added release type ([28d7181](https://github.com/ethereum-push-notification-service/push-sdk/commit/28d71818c766b7057d4b1b8f629c8a4d01378db0)) -* added releaseType ([55429e5](https://github.com/ethereum-push-notification-service/push-sdk/commit/55429e54fc9df054dab955796ae4e34da8dd25ec)) - - +- added ci-version-beta ([2f282ce](https://github.com/ethereum-push-notification-service/push-sdk/commit/2f282ce60003733fc95ce239a6c1a2d6c24616cc)) +- added ci-version-beta ([496952a](https://github.com/ethereum-push-notification-service/push-sdk/commit/496952ac8faab02c82ee11be8e8925a1fb01cd01)) +- added release type ([28d7181](https://github.com/ethereum-push-notification-service/push-sdk/commit/28d71818c766b7057d4b1b8f629c8a4d01378db0)) +- added releaseType ([55429e5](https://github.com/ethereum-push-notification-service/push-sdk/commit/55429e54fc9df054dab955796ae4e34da8dd25ec)) ## [0.0.1-beta.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.9...restapi-0.0.1-beta.0) (2023-05-02) - ### Bug Fixes -* added ci-version-beta ([2f282ce](https://github.com/ethereum-push-notification-service/push-sdk/commit/2f282ce60003733fc95ce239a6c1a2d6c24616cc)) -* added ci-version-beta ([496952a](https://github.com/ethereum-push-notification-service/push-sdk/commit/496952ac8faab02c82ee11be8e8925a1fb01cd01)) -* added release type ([28d7181](https://github.com/ethereum-push-notification-service/push-sdk/commit/28d71818c766b7057d4b1b8f629c8a4d01378db0)) -* added releaseType ([55429e5](https://github.com/ethereum-push-notification-service/push-sdk/commit/55429e54fc9df054dab955796ae4e34da8dd25ec)) - - +- added ci-version-beta ([2f282ce](https://github.com/ethereum-push-notification-service/push-sdk/commit/2f282ce60003733fc95ce239a6c1a2d6c24616cc)) +- added ci-version-beta ([496952a](https://github.com/ethereum-push-notification-service/push-sdk/commit/496952ac8faab02c82ee11be8e8925a1fb01cd01)) +- added release type ([28d7181](https://github.com/ethereum-push-notification-service/push-sdk/commit/28d71818c766b7057d4b1b8f629c8a4d01378db0)) +- added releaseType ([55429e5](https://github.com/ethereum-push-notification-service/push-sdk/commit/55429e54fc9df054dab955796ae4e34da8dd25ec)) ## [1.2.9](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.8...restapi-1.2.9) (2023-05-02) - ### Bug Fixes -* Merge branch 'main' into deployment ([2b3993c](https://github.com/ethereum-push-notification-service/push-sdk/commit/2b3993c673fcf11a39acd7a6663b6e6996fc26b6)) -* remove autoupgarde for v4 ([#344](https://github.com/ethereum-push-notification-service/push-sdk/issues/344)) ([3a4bef0](https://github.com/ethereum-push-notification-service/push-sdk/commit/3a4bef0750abb5bdb5ab9e96c9cc76e2269afa3c)) - - +- Merge branch 'main' into deployment ([2b3993c](https://github.com/ethereum-push-notification-service/push-sdk/commit/2b3993c673fcf11a39acd7a6663b6e6996fc26b6)) +- remove autoupgarde for v4 ([#344](https://github.com/ethereum-push-notification-service/push-sdk/issues/344)) ([3a4bef0](https://github.com/ethereum-push-notification-service/push-sdk/commit/3a4bef0750abb5bdb5ab9e96c9cc76e2269afa3c)) ## [1.2.8](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.7...restapi-1.2.8) (2023-05-01) - ### Bug Fixes -* error ProgressHook added ([#336](https://github.com/ethereum-push-notification-service/push-sdk/issues/336)) ([3f7295f](https://github.com/ethereum-push-notification-service/push-sdk/commit/3f7295f7811c15e5b9f3ba74a69ffcbe3fb6d829)) - - +- error ProgressHook added ([#336](https://github.com/ethereum-push-notification-service/push-sdk/issues/336)) ([3f7295f](https://github.com/ethereum-push-notification-service/push-sdk/commit/3f7295f7811c15e5b9f3ba74a69ffcbe3fb6d829)) ## [1.2.7](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.6...restapi-1.2.7) (2023-04-27) - ### Bug Fixes -* Merge branch 'deployment' ([0d184dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/0d184dc75d8680ac8a77f1124204af86befac82c)) -* senderType is optional param ([#329](https://github.com/ethereum-push-notification-service/push-sdk/issues/329)) ([ed3d6e6](https://github.com/ethereum-push-notification-service/push-sdk/commit/ed3d6e611975da054d5e1b3809e614450a563cd5)) - - +- Merge branch 'deployment' ([0d184dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/0d184dc75d8680ac8a77f1124204af86befac82c)) +- senderType is optional param ([#329](https://github.com/ethereum-push-notification-service/push-sdk/issues/329)) ([ed3d6e6](https://github.com/ethereum-push-notification-service/push-sdk/commit/ed3d6e611975da054d5e1b3809e614450a563cd5)) ## [1.2.6](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.5...restapi-1.2.6) (2023-04-27) - ### Bug Fixes -* add chat.chat to exports ([#331](https://github.com/ethereum-push-notification-service/push-sdk/issues/331)) ([289c774](https://github.com/ethereum-push-notification-service/push-sdk/commit/289c774074cecd6998b0bda39bee4e779ee9daa3)) - - +- add chat.chat to exports ([#331](https://github.com/ethereum-push-notification-service/push-sdk/issues/331)) ([289c774](https://github.com/ethereum-push-notification-service/push-sdk/commit/289c774074cecd6998b0bda39bee4e779ee9daa3)) ## [1.2.5](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.4...restapi-1.2.5) (2023-04-27) - ### Bug Fixes -* nft compatibility ([#326](https://github.com/ethereum-push-notification-service/push-sdk/issues/326)) ([80650e6](https://github.com/ethereum-push-notification-service/push-sdk/commit/80650e65f490e08df30c17c9e5dadc0b513b1f46)) - - +- nft compatibility ([#326](https://github.com/ethereum-push-notification-service/push-sdk/issues/326)) ([80650e6](https://github.com/ethereum-push-notification-service/push-sdk/commit/80650e65f490e08df30c17c9e5dadc0b513b1f46)) ## [1.2.5](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.4...restapi-1.2.5) (2023-04-27) - ### Bug Fixes -* nft compatibility ([#326](https://github.com/ethereum-push-notification-service/push-sdk/issues/326)) ([80650e6](https://github.com/ethereum-push-notification-service/push-sdk/commit/80650e65f490e08df30c17c9e5dadc0b513b1f46)) - - +- nft compatibility ([#326](https://github.com/ethereum-push-notification-service/push-sdk/issues/326)) ([80650e6](https://github.com/ethereum-push-notification-service/push-sdk/commit/80650e65f490e08df30c17c9e5dadc0b513b1f46)) ## [1.2.4](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.3...restapi-1.2.4) (2023-04-19) - ### Bug Fixes -* chamged signerType from ethers.wallet ([#315](https://github.com/ethereum-push-notification-service/push-sdk/issues/315)) ([385b3dd](https://github.com/ethereum-push-notification-service/push-sdk/commit/385b3ddf2e2aa22b687a5094ba5cfec0e13da63b)) -* fix videoCall Notif ([#310](https://github.com/ethereum-push-notification-service/push-sdk/issues/310)) ([069783e](https://github.com/ethereum-push-notification-service/push-sdk/commit/069783e2cbe77723e335affb2f2668c785aeace6)) - - +- chamged signerType from ethers.wallet ([#315](https://github.com/ethereum-push-notification-service/push-sdk/issues/315)) ([385b3dd](https://github.com/ethereum-push-notification-service/push-sdk/commit/385b3ddf2e2aa22b687a5094ba5cfec0e13da63b)) +- fix videoCall Notif ([#310](https://github.com/ethereum-push-notification-service/push-sdk/issues/310)) ([069783e](https://github.com/ethereum-push-notification-service/push-sdk/commit/069783e2cbe77723e335affb2f2668c785aeace6)) ## [1.2.3](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.2...restapi-1.2.3) (2023-04-18) - ### Bug Fixes -* git merge ([87a31a1](https://github.com/ethereum-push-notification-service/push-sdk/commit/87a31a142b80e3305d5986e9f6b5734d9345b7d0)) - - +- git merge ([87a31a1](https://github.com/ethereum-push-notification-service/push-sdk/commit/87a31a142b80e3305d5986e9f6b5734d9345b7d0)) ## [1.2.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.1...restapi-1.2.2) (2023-04-07) - ### Bug Fixes -* local for local development ([#295](https://github.com/ethereum-push-notification-service/push-sdk/issues/295)) ([639b4d2](https://github.com/ethereum-push-notification-service/push-sdk/commit/639b4d2de728ef289da5889b51fd45e003156699)) -* main merge ([0be9604](https://github.com/ethereum-push-notification-service/push-sdk/commit/0be9604eacf003db0cc4244f41d5e9c533f7613a)) -* remove hardcoded values ([#299](https://github.com/ethereum-push-notification-service/push-sdk/issues/299)) ([02a4e20](https://github.com/ethereum-push-notification-service/push-sdk/commit/02a4e2077a2ee4fb010d619d04acffc1881a2c0c)) -* signerType ([#303](https://github.com/ethereum-push-notification-service/push-sdk/issues/303)) ([20eb15a](https://github.com/ethereum-push-notification-service/push-sdk/commit/20eb15af4bc3286e5836845e299326352af0ce34)) -* version update ([d5433a9](https://github.com/ethereum-push-notification-service/push-sdk/commit/d5433a93de34e69953ca88e602d264b234708727)) -* version update ([#302](https://github.com/ethereum-push-notification-service/push-sdk/issues/302)) ([82bd4f7](https://github.com/ethereum-push-notification-service/push-sdk/commit/82bd4f7882f8782f8d19a1daf97e5366ce26c5de)) - - +- local for local development ([#295](https://github.com/ethereum-push-notification-service/push-sdk/issues/295)) ([639b4d2](https://github.com/ethereum-push-notification-service/push-sdk/commit/639b4d2de728ef289da5889b51fd45e003156699)) +- main merge ([0be9604](https://github.com/ethereum-push-notification-service/push-sdk/commit/0be9604eacf003db0cc4244f41d5e9c533f7613a)) +- remove hardcoded values ([#299](https://github.com/ethereum-push-notification-service/push-sdk/issues/299)) ([02a4e20](https://github.com/ethereum-push-notification-service/push-sdk/commit/02a4e2077a2ee4fb010d619d04acffc1881a2c0c)) +- signerType ([#303](https://github.com/ethereum-push-notification-service/push-sdk/issues/303)) ([20eb15a](https://github.com/ethereum-push-notification-service/push-sdk/commit/20eb15af4bc3286e5836845e299326352af0ce34)) +- version update ([d5433a9](https://github.com/ethereum-push-notification-service/push-sdk/commit/d5433a93de34e69953ca88e602d264b234708727)) +- version update ([#302](https://github.com/ethereum-push-notification-service/push-sdk/issues/302)) ([82bd4f7](https://github.com/ethereum-push-notification-service/push-sdk/commit/82bd4f7882f8782f8d19a1daf97e5366ce26c5de)) ## [1.2.1](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.0...restapi-1.2.1) (2023-04-07) - ### Bug Fixes -* added types for chat fn ([#298](https://github.com/ethereum-push-notification-service/push-sdk/issues/298)) ([1c944b2](https://github.com/ethereum-push-notification-service/push-sdk/commit/1c944b237909e393f6ae72c76138411076c62b13)) - - - +- added types for chat fn ([#298](https://github.com/ethereum-push-notification-service/push-sdk/issues/298)) ([1c944b2](https://github.com/ethereum-push-notification-service/push-sdk/commit/1c944b237909e393f6ae72c76138411076c62b13)) # [1.2.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.1.0...restapi-1.2.0) (2023-04-06) - ### Bug Fixes -* **component:** add chatid to requests and chats ([#278](https://github.com/ethereum-push-notification-service/push-sdk/issues/278)) ([e1d4af5](https://github.com/ethereum-push-notification-service/push-sdk/commit/e1d4af5aa9cfeef0a2ca422d87a158e546fe9d4a)) - +- **component:** add chatid to requests and chats ([#278](https://github.com/ethereum-push-notification-service/push-sdk/issues/278)) ([e1d4af5](https://github.com/ethereum-push-notification-service/push-sdk/commit/e1d4af5aa9cfeef0a2ca422d87a158e546fe9d4a)) ### Features -* local for local development ([#295](https://github.com/ethereum-push-notification-service/push-sdk/issues/295)) ([2b09806](https://github.com/ethereum-push-notification-service/push-sdk/commit/2b09806d28f1c8d2f74e163691fc2bcc60f26116)) - - +- local for local development ([#295](https://github.com/ethereum-push-notification-service/push-sdk/issues/295)) ([2b09806](https://github.com/ethereum-push-notification-service/push-sdk/commit/2b09806d28f1c8d2f74e163691fc2bcc60f26116)) # [1.2.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.1.0...restapi-1.2.0) (2023-04-06) - ### Bug Fixes -* **component:** add chatid to requests and chats ([#278](https://github.com/ethereum-push-notification-service/push-sdk/issues/278)) ([e1d4af5](https://github.com/ethereum-push-notification-service/push-sdk/commit/e1d4af5aa9cfeef0a2ca422d87a158e546fe9d4a)) - +- **component:** add chatid to requests and chats ([#278](https://github.com/ethereum-push-notification-service/push-sdk/issues/278)) ([e1d4af5](https://github.com/ethereum-push-notification-service/push-sdk/commit/e1d4af5aa9cfeef0a2ca422d87a158e546fe9d4a)) ### Features -* local for local development ([#295](https://github.com/ethereum-push-notification-service/push-sdk/issues/295)) ([2b09806](https://github.com/ethereum-push-notification-service/push-sdk/commit/2b09806d28f1c8d2f74e163691fc2bcc60f26116)) - - +- local for local development ([#295](https://github.com/ethereum-push-notification-service/push-sdk/issues/295)) ([2b09806](https://github.com/ethereum-push-notification-service/push-sdk/commit/2b09806d28f1c8d2f74e163691fc2bcc60f26116)) # [1.1.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.0.4...restapi-1.1.0) (2023-04-05) - ### Bug Fixes -* remove unnecessary log ([#289](https://github.com/ethereum-push-notification-service/push-sdk/issues/289)) ([7ac6be3](https://github.com/ethereum-push-notification-service/push-sdk/commit/7ac6be3b99ab1c36fa18e701b7656ff483834456)) -* success progressHook ([#291](https://github.com/ethereum-push-notification-service/push-sdk/issues/291)) ([9fd5b5a](https://github.com/ethereum-push-notification-service/push-sdk/commit/9fd5b5a0a64d922b299e8e33543c0ba500147fbc)) - +- remove unnecessary log ([#289](https://github.com/ethereum-push-notification-service/push-sdk/issues/289)) ([7ac6be3](https://github.com/ethereum-push-notification-service/push-sdk/commit/7ac6be3b99ab1c36fa18e701b7656ff483834456)) +- success progressHook ([#291](https://github.com/ethereum-push-notification-service/push-sdk/issues/291)) ([9fd5b5a](https://github.com/ethereum-push-notification-service/push-sdk/commit/9fd5b5a0a64d922b299e8e33543c0ba500147fbc)) ### Features -* **sendnotification:** add additionalMeta field to payload ([#235](https://github.com/ethereum-push-notification-service/push-sdk/issues/235)) ([6d9d60b](https://github.com/ethereum-push-notification-service/push-sdk/commit/6d9d60b2532bf408aaed708a8bbf753aeab13296)), closes [#234](https://github.com/ethereum-push-notification-service/push-sdk/issues/234) - - +- **sendnotification:** add additionalMeta field to payload ([#235](https://github.com/ethereum-push-notification-service/push-sdk/issues/235)) ([6d9d60b](https://github.com/ethereum-push-notification-service/push-sdk/commit/6d9d60b2532bf408aaed708a8bbf753aeab13296)), closes [#234](https://github.com/ethereum-push-notification-service/push-sdk/issues/234) ## [1.0.4](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.0.3...restapi-1.0.4) (2023-04-04) - ### Bug Fixes -* success progressHook ([3e699b0](https://github.com/ethereum-push-notification-service/push-sdk/commit/3e699b07071fe53499d8116bab108ff5a00d8a85)) - - +- success progressHook ([3e699b0](https://github.com/ethereum-push-notification-service/push-sdk/commit/3e699b07071fe53499d8116bab108ff5a00d8a85)) ## [1.0.3](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.0.2...restapi-1.0.3) (2023-04-04) - ### Bug Fixes - ## [1.0.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.0.1...restapi-1.0.2) (2023-04-04) - ### Bug Fixes - - - - ## [1.0.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.0.1...restapi-1.0.2) (2023-04-04) - ### Bug Fixes - - ## [1.0.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.0.1...restapi-1.0.2) (2023-04-04) - ### Bug Fixes - ## [1.0.1](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.0.0...restapi-1.0.1) (2023-04-04) - ### Bug Fixes - ## [1.0.1](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.0.0...restapi-1.0.1) (2023-04-04) - ### Bug Fixes - # [1.0.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.8.2...restapi-1.0.0) (2023-04-04) - ### Bug Fixes -* **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) -* **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) -* **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) -* **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) -* **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) -* **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) -* progressHook Changes ([#287](https://github.com/ethereum-push-notification-service/push-sdk/issues/287)) ([10d3e92](https://github.com/ethereum-push-notification-service/push-sdk/commit/10d3e929022fdada202be1a9cbb3d49d90edb1d1)) -* **restapi/helpers/crypto.ts:** hook Fix ([#288](https://github.com/ethereum-push-notification-service/push-sdk/issues/288)) ([b751637](https://github.com/ethereum-push-notification-service/push-sdk/commit/b751637c158811201140cfa1190c57c5f1b07262)) -* sig changes to include domain ([#279](https://github.com/ethereum-push-notification-service/push-sdk/issues/279)) ([3dd8a9c](https://github.com/ethereum-push-notification-service/push-sdk/commit/3dd8a9ce301521e3913437f3192cefa8d699a914)) -* signature Validation of chat msg ([#272](https://github.com/ethereum-push-notification-service/push-sdk/issues/272)) ([9f6093f](https://github.com/ethereum-push-notification-service/push-sdk/commit/9f6093fcc5941a2a7bc19d00217483016828bdcb)) - - -* Chat keys Encryption V2 (#231) ([f35730b](https://github.com/ethereum-push-notification-service/push-sdk/commit/f35730bd6398694176941875abb3e8678b255568)), closes [#231](https://github.com/ethereum-push-notification-service/push-sdk/issues/231) +- **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) +- **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) +- **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) +- **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) +- **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) +- **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) +- progressHook Changes ([#287](https://github.com/ethereum-push-notification-service/push-sdk/issues/287)) ([10d3e92](https://github.com/ethereum-push-notification-service/push-sdk/commit/10d3e929022fdada202be1a9cbb3d49d90edb1d1)) +- **restapi/helpers/crypto.ts:** hook Fix ([#288](https://github.com/ethereum-push-notification-service/push-sdk/issues/288)) ([b751637](https://github.com/ethereum-push-notification-service/push-sdk/commit/b751637c158811201140cfa1190c57c5f1b07262)) +- sig changes to include domain ([#279](https://github.com/ethereum-push-notification-service/push-sdk/issues/279)) ([3dd8a9c](https://github.com/ethereum-push-notification-service/push-sdk/commit/3dd8a9ce301521e3913437f3192cefa8d699a914)) +- signature Validation of chat msg ([#272](https://github.com/ethereum-push-notification-service/push-sdk/issues/272)) ([9f6093f](https://github.com/ethereum-push-notification-service/push-sdk/commit/9f6093fcc5941a2a7bc19d00217483016828bdcb)) +- Chat keys Encryption V2 (#231) ([f35730b](https://github.com/ethereum-push-notification-service/push-sdk/commit/f35730bd6398694176941875abb3e8678b255568)), closes [#231](https://github.com/ethereum-push-notification-service/push-sdk/issues/231) ### Features -* chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) -* mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) - +- chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) +- mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) ### BREAKING CHANGES -* New chat key ecnryption +- New chat key ecnryption -* feat: chat key encryption v2 +- feat: chat key encryption v2 New encryption version for pgp keys -* Signer is required in ui-web -* refactor: add signer in ApproveRequest +- Signer is required in ui-web -* fix: revert dev from localhost +- refactor: add signer in ApproveRequest -* feat: auto uprade keys +- fix: revert dev from localhost -* test: tests for upgrade User +- feat: auto uprade keys -* test: test for send chat message +- test: tests for upgrade User -* test: rename tests - -* test: text formating fix +- test: test for send chat message +- test: rename tests +- test: text formating fix # [1.0.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.8.2...restapi-1.0.0) (2023-04-04) - ### Bug Fixes -* **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) -* **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) -* **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) -* **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) -* **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) -* **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) -* progressHook Changes ([#287](https://github.com/ethereum-push-notification-service/push-sdk/issues/287)) ([10d3e92](https://github.com/ethereum-push-notification-service/push-sdk/commit/10d3e929022fdada202be1a9cbb3d49d90edb1d1)) -* **restapi/helpers/crypto.ts:** hook Fix ([#288](https://github.com/ethereum-push-notification-service/push-sdk/issues/288)) ([b751637](https://github.com/ethereum-push-notification-service/push-sdk/commit/b751637c158811201140cfa1190c57c5f1b07262)) -* sig changes to include domain ([#279](https://github.com/ethereum-push-notification-service/push-sdk/issues/279)) ([3dd8a9c](https://github.com/ethereum-push-notification-service/push-sdk/commit/3dd8a9ce301521e3913437f3192cefa8d699a914)) -* signature Validation of chat msg ([#272](https://github.com/ethereum-push-notification-service/push-sdk/issues/272)) ([9f6093f](https://github.com/ethereum-push-notification-service/push-sdk/commit/9f6093fcc5941a2a7bc19d00217483016828bdcb)) - - -* Chat keys Encryption V2 (#231) ([f35730b](https://github.com/ethereum-push-notification-service/push-sdk/commit/f35730bd6398694176941875abb3e8678b255568)), closes [#231](https://github.com/ethereum-push-notification-service/push-sdk/issues/231) +- **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) +- **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) +- **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) +- **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) +- **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) +- **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) +- progressHook Changes ([#287](https://github.com/ethereum-push-notification-service/push-sdk/issues/287)) ([10d3e92](https://github.com/ethereum-push-notification-service/push-sdk/commit/10d3e929022fdada202be1a9cbb3d49d90edb1d1)) +- **restapi/helpers/crypto.ts:** hook Fix ([#288](https://github.com/ethereum-push-notification-service/push-sdk/issues/288)) ([b751637](https://github.com/ethereum-push-notification-service/push-sdk/commit/b751637c158811201140cfa1190c57c5f1b07262)) +- sig changes to include domain ([#279](https://github.com/ethereum-push-notification-service/push-sdk/issues/279)) ([3dd8a9c](https://github.com/ethereum-push-notification-service/push-sdk/commit/3dd8a9ce301521e3913437f3192cefa8d699a914)) +- signature Validation of chat msg ([#272](https://github.com/ethereum-push-notification-service/push-sdk/issues/272)) ([9f6093f](https://github.com/ethereum-push-notification-service/push-sdk/commit/9f6093fcc5941a2a7bc19d00217483016828bdcb)) +- Chat keys Encryption V2 (#231) ([f35730b](https://github.com/ethereum-push-notification-service/push-sdk/commit/f35730bd6398694176941875abb3e8678b255568)), closes [#231](https://github.com/ethereum-push-notification-service/push-sdk/issues/231) ### Features -* chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) -* mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) - +- chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) +- mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) ### BREAKING CHANGES -* New chat key ecnryption +- New chat key ecnryption -* feat: chat key encryption v2 +- feat: chat key encryption v2 New encryption version for pgp keys -* Signer is required in ui-web -* refactor: add signer in ApproveRequest +- Signer is required in ui-web -* fix: revert dev from localhost +- refactor: add signer in ApproveRequest -* feat: auto uprade keys +- fix: revert dev from localhost -* test: tests for upgrade User +- feat: auto uprade keys -* test: test for send chat message +- test: tests for upgrade User -* test: rename tests - -* test: text formating fix +- test: test for send chat message +- test: rename tests +- test: text formating fix # [1.0.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.8.2...restapi-1.0.0) (2023-04-04) - ### Bug Fixes -* **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) -* **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) -* **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) -* **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) -* **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) -* **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) -* progressHook Changes ([#287](https://github.com/ethereum-push-notification-service/push-sdk/issues/287)) ([10d3e92](https://github.com/ethereum-push-notification-service/push-sdk/commit/10d3e929022fdada202be1a9cbb3d49d90edb1d1)) -* **restapi/helpers/crypto.ts:** hook Fix ([#288](https://github.com/ethereum-push-notification-service/push-sdk/issues/288)) ([b751637](https://github.com/ethereum-push-notification-service/push-sdk/commit/b751637c158811201140cfa1190c57c5f1b07262)) -* sig changes to include domain ([#279](https://github.com/ethereum-push-notification-service/push-sdk/issues/279)) ([3dd8a9c](https://github.com/ethereum-push-notification-service/push-sdk/commit/3dd8a9ce301521e3913437f3192cefa8d699a914)) -* signature Validation of chat msg ([#272](https://github.com/ethereum-push-notification-service/push-sdk/issues/272)) ([9f6093f](https://github.com/ethereum-push-notification-service/push-sdk/commit/9f6093fcc5941a2a7bc19d00217483016828bdcb)) - - -* Chat keys Encryption V2 (#231) ([f35730b](https://github.com/ethereum-push-notification-service/push-sdk/commit/f35730bd6398694176941875abb3e8678b255568)), closes [#231](https://github.com/ethereum-push-notification-service/push-sdk/issues/231) +- **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) +- **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) +- **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) +- **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) +- **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) +- **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) +- progressHook Changes ([#287](https://github.com/ethereum-push-notification-service/push-sdk/issues/287)) ([10d3e92](https://github.com/ethereum-push-notification-service/push-sdk/commit/10d3e929022fdada202be1a9cbb3d49d90edb1d1)) +- **restapi/helpers/crypto.ts:** hook Fix ([#288](https://github.com/ethereum-push-notification-service/push-sdk/issues/288)) ([b751637](https://github.com/ethereum-push-notification-service/push-sdk/commit/b751637c158811201140cfa1190c57c5f1b07262)) +- sig changes to include domain ([#279](https://github.com/ethereum-push-notification-service/push-sdk/issues/279)) ([3dd8a9c](https://github.com/ethereum-push-notification-service/push-sdk/commit/3dd8a9ce301521e3913437f3192cefa8d699a914)) +- signature Validation of chat msg ([#272](https://github.com/ethereum-push-notification-service/push-sdk/issues/272)) ([9f6093f](https://github.com/ethereum-push-notification-service/push-sdk/commit/9f6093fcc5941a2a7bc19d00217483016828bdcb)) +- Chat keys Encryption V2 (#231) ([f35730b](https://github.com/ethereum-push-notification-service/push-sdk/commit/f35730bd6398694176941875abb3e8678b255568)), closes [#231](https://github.com/ethereum-push-notification-service/push-sdk/issues/231) ### Features -* chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) -* mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) - +- chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) +- mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) ### BREAKING CHANGES -* New chat key ecnryption +- New chat key ecnryption -* feat: chat key encryption v2 +- feat: chat key encryption v2 New encryption version for pgp keys -* Signer is required in ui-web - -* refactor: add signer in ApproveRequest -* fix: revert dev from localhost +- Signer is required in ui-web -* feat: auto uprade keys +- refactor: add signer in ApproveRequest -* test: tests for upgrade User +- fix: revert dev from localhost -* test: test for send chat message +- feat: auto uprade keys -* test: rename tests +- test: tests for upgrade User -* test: text formating fix +- test: test for send chat message +- test: rename tests +- test: text formating fix ## [1.0.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.0.1...restapi-1.0.2) (2023-04-04) - ### Bug Fixes - ## [1.0.1](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.0.0...restapi-1.0.1) (2023-04-04) - ### Bug Fixes - - # [1.0.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.8.2...restapi-1.0.0) (2023-04-04) - ### Bug Fixes -* **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) -* **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) -* **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) -* **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) -* **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) -* **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) -* sig changes to include domain ([#279](https://github.com/ethereum-push-notification-service/push-sdk/issues/279)) ([3dd8a9c](https://github.com/ethereum-push-notification-service/push-sdk/commit/3dd8a9ce301521e3913437f3192cefa8d699a914)) -* signature Validation of chat msg ([#272](https://github.com/ethereum-push-notification-service/push-sdk/issues/272)) ([9f6093f](https://github.com/ethereum-push-notification-service/push-sdk/commit/9f6093fcc5941a2a7bc19d00217483016828bdcb)) - - -* Chat keys Encryption V2 (#231) ([f35730b](https://github.com/ethereum-push-notification-service/push-sdk/commit/f35730bd6398694176941875abb3e8678b255568)), closes [#231](https://github.com/ethereum-push-notification-service/push-sdk/issues/231) +- **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) +- **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) +- **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) +- **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) +- **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) +- **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) +- sig changes to include domain ([#279](https://github.com/ethereum-push-notification-service/push-sdk/issues/279)) ([3dd8a9c](https://github.com/ethereum-push-notification-service/push-sdk/commit/3dd8a9ce301521e3913437f3192cefa8d699a914)) +- signature Validation of chat msg ([#272](https://github.com/ethereum-push-notification-service/push-sdk/issues/272)) ([9f6093f](https://github.com/ethereum-push-notification-service/push-sdk/commit/9f6093fcc5941a2a7bc19d00217483016828bdcb)) +- Chat keys Encryption V2 (#231) ([f35730b](https://github.com/ethereum-push-notification-service/push-sdk/commit/f35730bd6398694176941875abb3e8678b255568)), closes [#231](https://github.com/ethereum-push-notification-service/push-sdk/issues/231) ### Features -* chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) -* mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) - +- chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) +- mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) ### BREAKING CHANGES -* New chat key ecnryption +- New chat key ecnryption -* feat: chat key encryption v2 +- feat: chat key encryption v2 New encryption version for pgp keys -* Signer is required in ui-web - -* refactor: add signer in ApproveRequest -* fix: revert dev from localhost +- Signer is required in ui-web -* feat: auto uprade keys +- refactor: add signer in ApproveRequest -* test: tests for upgrade User +- fix: revert dev from localhost -* test: test for send chat message +- feat: auto uprade keys -* test: rename tests +- test: tests for upgrade User -* test: text formating fix +- test: test for send chat message +- test: rename tests +- test: text formating fix # [1.0.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.8.2...restapi-1.0.0) (2023-04-04) - ### Bug Fixes -* **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) -* **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) -* **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) -* **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) -* **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) -* **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) -* sig changes to include domain ([#279](https://github.com/ethereum-push-notification-service/push-sdk/issues/279)) ([3dd8a9c](https://github.com/ethereum-push-notification-service/push-sdk/commit/3dd8a9ce301521e3913437f3192cefa8d699a914)) -* signature Validation of chat msg ([#272](https://github.com/ethereum-push-notification-service/push-sdk/issues/272)) ([9f6093f](https://github.com/ethereum-push-notification-service/push-sdk/commit/9f6093fcc5941a2a7bc19d00217483016828bdcb)) - - -* Chat keys Encryption V2 (#231) ([f35730b](https://github.com/ethereum-push-notification-service/push-sdk/commit/f35730bd6398694176941875abb3e8678b255568)), closes [#231](https://github.com/ethereum-push-notification-service/push-sdk/issues/231) +- **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) +- **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) +- **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) +- **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) +- **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) +- **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) +- sig changes to include domain ([#279](https://github.com/ethereum-push-notification-service/push-sdk/issues/279)) ([3dd8a9c](https://github.com/ethereum-push-notification-service/push-sdk/commit/3dd8a9ce301521e3913437f3192cefa8d699a914)) +- signature Validation of chat msg ([#272](https://github.com/ethereum-push-notification-service/push-sdk/issues/272)) ([9f6093f](https://github.com/ethereum-push-notification-service/push-sdk/commit/9f6093fcc5941a2a7bc19d00217483016828bdcb)) +- Chat keys Encryption V2 (#231) ([f35730b](https://github.com/ethereum-push-notification-service/push-sdk/commit/f35730bd6398694176941875abb3e8678b255568)), closes [#231](https://github.com/ethereum-push-notification-service/push-sdk/issues/231) ### Features -* chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) -* mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) - +- chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) +- mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) ### BREAKING CHANGES -* New chat key ecnryption +- New chat key ecnryption -* feat: chat key encryption v2 +- feat: chat key encryption v2 New encryption version for pgp keys -* Signer is required in ui-web -* refactor: add signer in ApproveRequest +- Signer is required in ui-web -* fix: revert dev from localhost +- refactor: add signer in ApproveRequest -* feat: auto uprade keys +- fix: revert dev from localhost -* test: tests for upgrade User +- feat: auto uprade keys -* test: test for send chat message +- test: tests for upgrade User -* test: rename tests - -* test: text formating fix +- test: test for send chat message +- test: rename tests +- test: text formating fix # [1.0.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.8.2...restapi-1.0.0) (2023-03-28) - ### Bug Fixes -* **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) -* **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) -* **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) -* **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) -* **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) -* **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) -* signature Validation of chat msg ([#272](https://github.com/ethereum-push-notification-service/push-sdk/issues/272)) ([9f6093f](https://github.com/ethereum-push-notification-service/push-sdk/commit/9f6093fcc5941a2a7bc19d00217483016828bdcb)) - - -* Chat keys Encryption V2 (#231) ([f35730b](https://github.com/ethereum-push-notification-service/push-sdk/commit/f35730bd6398694176941875abb3e8678b255568)), closes [#231](https://github.com/ethereum-push-notification-service/push-sdk/issues/231) +- **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) +- **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) +- **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) +- **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) +- **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) +- **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) +- signature Validation of chat msg ([#272](https://github.com/ethereum-push-notification-service/push-sdk/issues/272)) ([9f6093f](https://github.com/ethereum-push-notification-service/push-sdk/commit/9f6093fcc5941a2a7bc19d00217483016828bdcb)) +- Chat keys Encryption V2 (#231) ([f35730b](https://github.com/ethereum-push-notification-service/push-sdk/commit/f35730bd6398694176941875abb3e8678b255568)), closes [#231](https://github.com/ethereum-push-notification-service/push-sdk/issues/231) ### Features -* chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) -* mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) - +- chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) +- mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) ### BREAKING CHANGES -* New chat key ecnryption +- New chat key ecnryption -* feat: chat key encryption v2 +- feat: chat key encryption v2 New encryption version for pgp keys -* Signer is required in ui-web - -* refactor: add signer in ApproveRequest -* fix: revert dev from localhost +- Signer is required in ui-web -* feat: auto uprade keys +- refactor: add signer in ApproveRequest -* test: tests for upgrade User +- fix: revert dev from localhost -* test: test for send chat message +- feat: auto uprade keys -* test: rename tests +- test: tests for upgrade User -* test: text formating fix +- test: test for send chat message +- test: rename tests +- test: text formating fix # [0.9.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.8.2...restapi-0.9.0) (2023-03-23) - ### Bug Fixes -* **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) -* **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) -* **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) -* **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) -* **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) -* **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) - +- **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) +- **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) +- **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) +- **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) +- **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) +- **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) ### Features -* chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) -* mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) - - +- chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) +- mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) # [0.9.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.8.2...restapi-0.9.0) (2023-03-23) - ### Bug Fixes -* **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) -* **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) -* **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) -* **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) -* **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) -* **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) - +- **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) +- **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) +- **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) +- **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) +- **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) +- **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) ### Features -* chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) -* mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) - - +- chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) +- mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) # [0.9.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.8.2...restapi-0.9.0) (2023-03-23) - ### Bug Fixes -* **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) -* **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) -* **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) -* **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) -* **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) -* **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) - +- **component:** decrypt issue fixed ([21538db](https://github.com/ethereum-push-notification-service/push-sdk/commit/21538dbb0569914b880d8f36aea341360041b4e7)) +- **component:** mocha setup ([6ecf79d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ecf79dd3ee4840350965fb045cc163bdd98b5a9)) +- **component:** mocha setup ([5b7c504](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7c50444734c8df507175eb98ab780507ddcad4)) +- **component:** mocha setup with basic test case ([35fa1dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/35fa1dc259051572ca51f8e2e0607a3917589159)) +- **component:** removed duplicate decryptAndVerifySignature method ([e42b7ff](https://github.com/ethereum-push-notification-service/push-sdk/commit/e42b7ffb4659c4f603a2f15eec2f6bf84ddcf303)) +- **component:** removed duplicate decryptAndVerifySignature method ([a03cf7e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a03cf7e2ff56e5af82e0d80943cfb3ee48b773f6)) ### Features -* chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) -* mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) - - +- chat.chat function ([760dda4](https://github.com/ethereum-push-notification-service/push-sdk/commit/760dda4095e57ef1f79fba8543aa5ff6a8c48c6f)) +- mediaURL type message support ([72d8d41](https://github.com/ethereum-push-notification-service/push-sdk/commit/72d8d411155ffce55da14810d7aeb5845035dade)) ## [0.8.3](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.8.2...restapi-0.8.3) (2023-03-22) - - ## [0.8.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.8.1...restapi-0.8.2) (2023-03-17) - ### Bug Fixes -* fix user.getBatch fn of restapi ([24e6a82](https://github.com/ethereum-push-notification-service/push-sdk/commit/24e6a8251031f766ceb8b76f89a72651f133db78)) -* rollback to crypto-js ([ba06e91](https://github.com/ethereum-push-notification-service/push-sdk/commit/ba06e9122c6b2c230d6f45980fddc0ddff77a201)) - - +- fix user.getBatch fn of restapi ([24e6a82](https://github.com/ethereum-push-notification-service/push-sdk/commit/24e6a8251031f766ceb8b76f89a72651f133db78)) +- rollback to crypto-js ([ba06e91](https://github.com/ethereum-push-notification-service/push-sdk/commit/ba06e9122c6b2c230d6f45980fddc0ddff77a201)) ## [0.8.1](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.8.0...restapi-0.8.1) (2023-03-09) - - # [0.8.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.7.6...restapi-0.8.0) (2023-03-07) - ### Bug Fixes -* **component:** added enum type to notification type and identity type ([#216](https://github.com/ethereum-push-notification-service/push-sdk/issues/216)) ([e76dc18](https://github.com/ethereum-push-notification-service/push-sdk/commit/e76dc1800739472133cf97e59891c62d223a80f7)) -* **component:** added signing fix for approve intent request ([#215](https://github.com/ethereum-push-notification-service/push-sdk/issues/215)) ([b117fe5](https://github.com/ethereum-push-notification-service/push-sdk/commit/b117fe544b96e5b80c8df1b91257afca2402cde3)) -* **component:** env type in demo react and uiweb ([#225](https://github.com/ethereum-push-notification-service/push-sdk/issues/225)) ([ff1113a](https://github.com/ethereum-push-notification-service/push-sdk/commit/ff1113adb226aee4c9f6ccdfa488e59b47ca9b9e)) - +- **component:** added enum type to notification type and identity type ([#216](https://github.com/ethereum-push-notification-service/push-sdk/issues/216)) ([e76dc18](https://github.com/ethereum-push-notification-service/push-sdk/commit/e76dc1800739472133cf97e59891c62d223a80f7)) +- **component:** added signing fix for approve intent request ([#215](https://github.com/ethereum-push-notification-service/push-sdk/issues/215)) ([b117fe5](https://github.com/ethereum-push-notification-service/push-sdk/commit/b117fe544b96e5b80c8df1b91257afca2402cde3)) +- **component:** env type in demo react and uiweb ([#225](https://github.com/ethereum-push-notification-service/push-sdk/issues/225)) ([ff1113a](https://github.com/ethereum-push-notification-service/push-sdk/commit/ff1113adb226aee4c9f6ccdfa488e59b47ca9b9e)) ### Features -* added Optimism Chain ([#221](https://github.com/ethereum-push-notification-service/push-sdk/issues/221)) ([a9f6e56](https://github.com/ethereum-push-notification-service/push-sdk/commit/a9f6e56f51ac6eb089ddeffd6c47f144b9b28dd8)) - - +- added Optimism Chain ([#221](https://github.com/ethereum-push-notification-service/push-sdk/issues/221)) ([a9f6e56](https://github.com/ethereum-push-notification-service/push-sdk/commit/a9f6e56f51ac6eb089ddeffd6c47f144b9b28dd8)) ## [0.7.6](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.7.5...restapi-0.7.6) (2023-03-03) - ### Bug Fixes -* **component:** eNV type check across all the functions ([#210](https://github.com/ethereum-push-notification-service/push-sdk/issues/210)) ([d532b12](https://github.com/ethereum-push-notification-service/push-sdk/commit/d532b1217d836d7fcedb3f665173b96cbb588607)) -* resolved buffer polyfills issue in browser environments ([#218](https://github.com/ethereum-push-notification-service/push-sdk/issues/218)) ([ded2c50](https://github.com/ethereum-push-notification-service/push-sdk/commit/ded2c50e25916e0ceb907701c30a334faaacf403)) - - +- **component:** eNV type check across all the functions ([#210](https://github.com/ethereum-push-notification-service/push-sdk/issues/210)) ([d532b12](https://github.com/ethereum-push-notification-service/push-sdk/commit/d532b1217d836d7fcedb3f665173b96cbb588607)) +- resolved buffer polyfills issue in browser environments ([#218](https://github.com/ethereum-push-notification-service/push-sdk/issues/218)) ([ded2c50](https://github.com/ethereum-push-notification-service/push-sdk/commit/ded2c50e25916e0ceb907701c30a334faaacf403)) ## [0.7.5](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.7.4...restapi-0.7.5) (2023-02-25) - - ## [0.7.4](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.7.3...restapi-0.7.4) (2023-02-25) - ### Bug Fixes -* send message signature fixes ([#203](https://github.com/ethereum-push-notification-service/push-sdk/issues/203)) ([9a3c448](https://github.com/ethereum-push-notification-service/push-sdk/commit/9a3c4484f2c1ac5f7abd2796801da626caa91629)) - - +- send message signature fixes ([#203](https://github.com/ethereum-push-notification-service/push-sdk/issues/203)) ([9a3c448](https://github.com/ethereum-push-notification-service/push-sdk/commit/9a3c4484f2c1ac5f7abd2796801da626caa91629)) ## [0.7.3](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.7.2...restapi-0.7.3) (2023-02-25) - - ## [0.7.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.7.1...restapi-0.7.2) (2023-02-24) - ### Bug Fixes -* **component:** implemented signature validation for create and update indent ([ffe026b](https://github.com/ethereum-push-notification-service/push-sdk/commit/ffe026bb76b97883a301d887395df055d579356b)) -* fix merge conflict ([90fb1d5](https://github.com/ethereum-push-notification-service/push-sdk/commit/90fb1d5c1a60695d7c559eaa43a6b72b3a5705af)) -* merge conflict fix ([af6ee32](https://github.com/ethereum-push-notification-service/push-sdk/commit/af6ee324937e31581b1ece56d817740e55a5ced6)) -* small change ([e346547](https://github.com/ethereum-push-notification-service/push-sdk/commit/e346547b848c69f1f41866e9625e52e285256a12)) - - +- **component:** implemented signature validation for create and update indent ([ffe026b](https://github.com/ethereum-push-notification-service/push-sdk/commit/ffe026bb76b97883a301d887395df055d579356b)) +- fix merge conflict ([90fb1d5](https://github.com/ethereum-push-notification-service/push-sdk/commit/90fb1d5c1a60695d7c559eaa43a6b72b3a5705af)) +- merge conflict fix ([af6ee32](https://github.com/ethereum-push-notification-service/push-sdk/commit/af6ee324937e31581b1ece56d817740e55a5ced6)) +- small change ([e346547](https://github.com/ethereum-push-notification-service/push-sdk/commit/e346547b848c69f1f41866e9625e52e285256a12)) ## [0.7.1](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.7.0...restapi-0.7.1) (2023-02-23) - ### Bug Fixes -* added missing import in approveRequest ([b79045d](https://github.com/ethereum-push-notification-service/push-sdk/commit/b79045d0946facd57e1bf72e5664c54021f3e3d7)) -* **component:** added group meta ([#193](https://github.com/ethereum-push-notification-service/push-sdk/issues/193)) ([8e0ef1e](https://github.com/ethereum-push-notification-service/push-sdk/commit/8e0ef1e584a4e28be965e46a2f3bac7f81262c14)) - - +- added missing import in approveRequest ([b79045d](https://github.com/ethereum-push-notification-service/push-sdk/commit/b79045d0946facd57e1bf72e5664c54021f3e3d7)) +- **component:** added group meta ([#193](https://github.com/ethereum-push-notification-service/push-sdk/issues/193)) ([8e0ef1e](https://github.com/ethereum-push-notification-service/push-sdk/commit/8e0ef1e584a4e28be965e46a2f3bac7f81262c14)) # [0.7.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.6.4...restapi-0.7.0) (2023-02-22) - ### Features -* add group by name function ([8601021](https://github.com/ethereum-push-notification-service/push-sdk/commit/860102153e2f8876423b218aa0d5dce98f012dba)) -* **component:** added sdk method get users in batch ([#182](https://github.com/ethereum-push-notification-service/push-sdk/issues/182)) ([ebb8e8b](https://github.com/ethereum-push-notification-service/push-sdk/commit/ebb8e8b39d7b50d4dda6787b06fe7bef803d87c3)) -* update npm package version for rest-api ([66d7d9c](https://github.com/ethereum-push-notification-service/push-sdk/commit/66d7d9c028bd936203a7e3640f552b833203ca47)) - - +- add group by name function ([8601021](https://github.com/ethereum-push-notification-service/push-sdk/commit/860102153e2f8876423b218aa0d5dce98f012dba)) +- **component:** added sdk method get users in batch ([#182](https://github.com/ethereum-push-notification-service/push-sdk/issues/182)) ([ebb8e8b](https://github.com/ethereum-push-notification-service/push-sdk/commit/ebb8e8b39d7b50d4dda6787b06fe7bef803d87c3)) +- update npm package version for rest-api ([66d7d9c](https://github.com/ethereum-push-notification-service/push-sdk/commit/66d7d9c028bd936203a7e3640f552b833203ca47)) ## [0.6.4](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.6.3...restapi-0.6.4) (2023-02-21) - - ## [0.6.3](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.6.2...restapi-0.6.3) (2023-02-21) - - ## [0.6.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.6.1...restapi-0.6.2) (2023-02-21) - ### Bug Fixes -* commenting out for jscutlery semver version fix ([0e52b01](https://github.com/ethereum-push-notification-service/push-sdk/commit/0e52b01a488cb7a63f6b5162f02cdf412ee10139)) - - +- commenting out for jscutlery semver version fix ([0e52b01](https://github.com/ethereum-push-notification-service/push-sdk/commit/0e52b01a488cb7a63f6b5162f02cdf412ee10139)) ## [0.6.1](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.6.0...restapi-0.6.1) (2023-02-21) - ### Bug Fixes -* commenting for jscutlery semver version tag fix ([d7def98](https://github.com/ethereum-push-notification-service/push-sdk/commit/d7def98bb0ad4a2ebe0b51dc658c5fb7439b5dda)) - - +- commenting for jscutlery semver version tag fix ([d7def98](https://github.com/ethereum-push-notification-service/push-sdk/commit/d7def98bb0ad4a2ebe0b51dc658c5fb7439b5dda)) # [0.6.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.5.0...restapi-0.6.0) (2023-02-21) - ### Features -* commenting out for jscutlery/semver version tag bug fix ([3533ae7](https://github.com/ethereum-push-notification-service/push-sdk/commit/3533ae75e362e1801bd7d03e5c3a6e599b784acc)) - - +- commenting out for jscutlery/semver version tag bug fix ([3533ae7](https://github.com/ethereum-push-notification-service/push-sdk/commit/3533ae75e362e1801bd7d03e5c3a6e599b784acc)) # [0.5.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.4.0...restapi-0.5.0) (2023-02-21) - ### Bug Fixes -* **component:** get-subscribers-api page, limit improvements ([#156](https://github.com/ethereum-push-notification-service/push-sdk/issues/156)) ([a396fa4](https://github.com/ethereum-push-notification-service/push-sdk/commit/a396fa4343a79239b2ef0ffba3ace57f7b5f9dcc)) -* **component:** group chat - Added validation for NFT Address with ChainId ([#172](https://github.com/ethereum-push-notification-service/push-sdk/issues/172)) ([bca5191](https://github.com/ethereum-push-notification-service/push-sdk/commit/bca519108f244ffb21fcfcebb27a1e4bed197835)) -* **component:** group chat SDK changes and improvements ([#154](https://github.com/ethereum-push-notification-service/push-sdk/issues/154)) ([e94fab9](https://github.com/ethereum-push-notification-service/push-sdk/commit/e94fab906eba9fa5672e3171871cf94259a95992)) -* **component:** update group signature generation bug fix ([#164](https://github.com/ethereum-push-notification-service/push-sdk/issues/164)) ([acb82a9](https://github.com/ethereum-push-notification-service/push-sdk/commit/acb82a9b44625b1ac37b5ea2d82e7877bcfc669e)) - +- **component:** get-subscribers-api page, limit improvements ([#156](https://github.com/ethereum-push-notification-service/push-sdk/issues/156)) ([a396fa4](https://github.com/ethereum-push-notification-service/push-sdk/commit/a396fa4343a79239b2ef0ffba3ace57f7b5f9dcc)) +- **component:** group chat - Added validation for NFT Address with ChainId ([#172](https://github.com/ethereum-push-notification-service/push-sdk/issues/172)) ([bca5191](https://github.com/ethereum-push-notification-service/push-sdk/commit/bca519108f244ffb21fcfcebb27a1e4bed197835)) +- **component:** group chat SDK changes and improvements ([#154](https://github.com/ethereum-push-notification-service/push-sdk/issues/154)) ([e94fab9](https://github.com/ethereum-push-notification-service/push-sdk/commit/e94fab906eba9fa5672e3171871cf94259a95992)) +- **component:** update group signature generation bug fix ([#164](https://github.com/ethereum-push-notification-service/push-sdk/issues/164)) ([acb82a9](https://github.com/ethereum-push-notification-service/push-sdk/commit/acb82a9b44625b1ac37b5ea2d82e7877bcfc669e)) ### Features -* **component:** group chat - update group, conversation hash ([#150](https://github.com/ethereum-push-notification-service/push-sdk/issues/150)) ([fc24618](https://github.com/ethereum-push-notification-service/push-sdk/commit/fc2461847bb86d7e0384ace5a484675480f00503)) - - +- **component:** group chat - update group, conversation hash ([#150](https://github.com/ethereum-push-notification-service/push-sdk/issues/150)) ([fc24618](https://github.com/ethereum-push-notification-service/push-sdk/commit/fc2461847bb86d7e0384ace5a484675480f00503)) # [0.4.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.3.1...restapi-0.4.0) (2023-02-09) - ### Bug Fixes -* fixed response of chat.chats restapi and published restapi v0.3.3 ([#142](https://github.com/ethereum-push-notification-service/push-sdk/issues/142)) ([40abc16](https://github.com/ethereum-push-notification-service/push-sdk/commit/40abc1609d780aea6620d6f136d46c37e8e70744)) -* Metamask reject handled ([#136](https://github.com/ethereum-push-notification-service/push-sdk/issues/136)) ([46a20b7](https://github.com/ethereum-push-notification-service/push-sdk/commit/46a20b751e655a526168c8ae7c400211f3b62b15)) -* **restapi:** fix parse api response of notifications to send subject/title as asub ([#140](https://github.com/ethereum-push-notification-service/push-sdk/issues/140)) ([6a11feb](https://github.com/ethereum-push-notification-service/push-sdk/commit/6a11feb7cc02bf9ca0541b34f399992ad33f12a4)), closes [#139](https://github.com/ethereum-push-notification-service/push-sdk/issues/139) -* send request bug fixed ([#143](https://github.com/ethereum-push-notification-service/push-sdk/issues/143)) ([99b305d](https://github.com/ethereum-push-notification-service/push-sdk/commit/99b305d2a54f51fd8d82b15a79e58344e6ff66c8)) - +- fixed response of chat.chats restapi and published restapi v0.3.3 ([#142](https://github.com/ethereum-push-notification-service/push-sdk/issues/142)) ([40abc16](https://github.com/ethereum-push-notification-service/push-sdk/commit/40abc1609d780aea6620d6f136d46c37e8e70744)) +- Metamask reject handled ([#136](https://github.com/ethereum-push-notification-service/push-sdk/issues/136)) ([46a20b7](https://github.com/ethereum-push-notification-service/push-sdk/commit/46a20b751e655a526168c8ae7c400211f3b62b15)) +- **restapi:** fix parse api response of notifications to send subject/title as asub ([#140](https://github.com/ethereum-push-notification-service/push-sdk/issues/140)) ([6a11feb](https://github.com/ethereum-push-notification-service/push-sdk/commit/6a11feb7cc02bf9ca0541b34f399992ad33f12a4)), closes [#139](https://github.com/ethereum-push-notification-service/push-sdk/issues/139) +- send request bug fixed ([#143](https://github.com/ethereum-push-notification-service/push-sdk/issues/143)) ([99b305d](https://github.com/ethereum-push-notification-service/push-sdk/commit/99b305d2a54f51fd8d82b15a79e58344e6ff66c8)) ### Features -* **component:** Added Group Chat Functionality ([#122](https://github.com/ethereum-push-notification-service/push-sdk/issues/122)) ([5bf341f](https://github.com/ethereum-push-notification-service/push-sdk/commit/5bf341f6f60a6786be47f668fa3ed1b15a66be88)) - - +- **component:** Added Group Chat Functionality ([#122](https://github.com/ethereum-push-notification-service/push-sdk/issues/122)) ([5bf341f](https://github.com/ethereum-push-notification-service/push-sdk/commit/5bf341f6f60a6786be47f668fa3ed1b15a66be88)) ## [0.3.3](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.3.1...restapi-0.3.2) (2023-02-08) - ### Bug Fixes -* fixed response of chat.chats restapi ([ab1f432](https://github.com/ethereum-push-notification-service/push-sdk/commit/ab1f432dbe5443c72375ab1baa7226b997396aa4)) -* fixed the message response object ([83d4f1e](https://github.com/ethereum-push-notification-service/push-sdk/commit/83d4f1e565b090d1c62859f7461f4e1c3bb9398a)) -* Metamask reject handled ([#136](https://github.com/ethereum-push-notification-service/push-sdk/issues/136)) ([46a20b7](https://github.com/ethereum-push-notification-service/push-sdk/commit/46a20b751e655a526168c8ae7c400211f3b62b15)) -* **restapi:** fix parse api response of notifications to send subject/title as asub ([#140](https://github.com/ethereum-push-notification-service/push-sdk/issues/140)) ([6a11feb](https://github.com/ethereum-push-notification-service/push-sdk/commit/6a11feb7cc02bf9ca0541b34f399992ad33f12a4)), closes [#139](https://github.com/ethereum-push-notification-service/push-sdk/issues/139) - - +- fixed response of chat.chats restapi ([ab1f432](https://github.com/ethereum-push-notification-service/push-sdk/commit/ab1f432dbe5443c72375ab1baa7226b997396aa4)) +- fixed the message response object ([83d4f1e](https://github.com/ethereum-push-notification-service/push-sdk/commit/83d4f1e565b090d1c62859f7461f4e1c3bb9398a)) +- Metamask reject handled ([#136](https://github.com/ethereum-push-notification-service/push-sdk/issues/136)) ([46a20b7](https://github.com/ethereum-push-notification-service/push-sdk/commit/46a20b751e655a526168c8ae7c400211f3b62b15)) +- **restapi:** fix parse api response of notifications to send subject/title as asub ([#140](https://github.com/ethereum-push-notification-service/push-sdk/issues/140)) ([6a11feb](https://github.com/ethereum-push-notification-service/push-sdk/commit/6a11feb7cc02bf9ca0541b34f399992ad33f12a4)), closes [#139](https://github.com/ethereum-push-notification-service/push-sdk/issues/139) ## [0.3.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.3.1...restapi-0.3.2) (2023-02-03) - ### Bug Fixes -* Metamask reject handled ([#136](https://github.com/ethereum-push-notification-service/push-sdk/issues/136)) ([46a20b7](https://github.com/ethereum-push-notification-service/push-sdk/commit/46a20b751e655a526168c8ae7c400211f3b62b15)) -* **restapi:** fix parse api response of notifications to send subject/title as asub ([#140](https://github.com/ethereum-push-notification-service/push-sdk/issues/140)) ([6a11feb](https://github.com/ethereum-push-notification-service/push-sdk/commit/6a11feb7cc02bf9ca0541b34f399992ad33f12a4)), closes [#139](https://github.com/ethereum-push-notification-service/push-sdk/issues/139) - - +- Metamask reject handled ([#136](https://github.com/ethereum-push-notification-service/push-sdk/issues/136)) ([46a20b7](https://github.com/ethereum-push-notification-service/push-sdk/commit/46a20b751e655a526168c8ae7c400211f3b62b15)) +- **restapi:** fix parse api response of notifications to send subject/title as asub ([#140](https://github.com/ethereum-push-notification-service/push-sdk/issues/140)) ([6a11feb](https://github.com/ethereum-push-notification-service/push-sdk/commit/6a11feb7cc02bf9ca0541b34f399992ad33f12a4)), closes [#139](https://github.com/ethereum-push-notification-service/push-sdk/issues/139) ## [0.3.1](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.3.0...restapi-0.3.1) (2023-01-27) - - # [0.3.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.2.1...restapi-0.3.0) (2023-01-13) - ### Bug Fixes -* added throw Error in remaining sdk endpoints ([f78e3d6](https://github.com/ethereum-push-notification-service/push-sdk/commit/f78e3d66684f8941315b21ac9876a18f37fdf1d0)) - +- added throw Error in remaining sdk endpoints ([f78e3d6](https://github.com/ethereum-push-notification-service/push-sdk/commit/f78e3d66684f8941315b21ac9876a18f37fdf1d0)) ### Features -* Bsc chain config changes added ([#113](https://github.com/ethereum-push-notification-service/push-sdk/issues/113)) ([e1af11b](https://github.com/ethereum-push-notification-service/push-sdk/commit/e1af11b1fa444e30f8aa08ee6b54a30bb03d6070)) - - +- Bsc chain config changes added ([#113](https://github.com/ethereum-push-notification-service/push-sdk/issues/113)) ([e1af11b](https://github.com/ethereum-push-notification-service/push-sdk/commit/e1af11b1fa444e30f8aa08ee6b54a30bb03d6070)) ## [0.2.1](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.2.0...restapi-0.2.1) (2022-11-03) - ### Bug Fixes -* removed lightweight package ([4c0883e](https://github.com/ethereum-push-notification-service/push-sdk/commit/4c0883eb5d7172ef9c6134bad9d26a0a8116f53d)) - - +- removed lightweight package ([4c0883e](https://github.com/ethereum-push-notification-service/push-sdk/commit/4c0883eb5d7172ef9c6134bad9d26a0a8116f53d)) # [0.2.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.1.1...restapi-0.2.0) (2022-11-02) - ### Features -* push chat restapi ([5899556](https://github.com/ethereum-push-notification-service/push-sdk/commit/5899556fc33a2be247911a1cf194e656c3e7a6df)), closes [#31](https://github.com/ethereum-push-notification-service/push-sdk/issues/31) [#40](https://github.com/ethereum-push-notification-service/push-sdk/issues/40) - - +- push chat restapi ([5899556](https://github.com/ethereum-push-notification-service/push-sdk/commit/5899556fc33a2be247911a1cf194e656c3e7a6df)), closes [#31](https://github.com/ethereum-push-notification-service/push-sdk/issues/31) [#40](https://github.com/ethereum-push-notification-service/push-sdk/issues/40) ## [0.1.1](https://github.com/ethereum-push-notification-service/sdk/compare/restapi-0.1.0...restapi-0.1.1) (2022-10-07) - - # [0.1.0](https://github.com/ethereum-push-notification-service/sdk/compare/restapi-0.0.5...restapi-0.1.0) (2022-10-07) - ### Features -* **restapi:** stable version ([f6d18b6](https://github.com/ethereum-push-notification-service/sdk/commit/f6d18b685696d00c06b711fd70b51e567a31e288)) - - +- **restapi:** stable version ([f6d18b6](https://github.com/ethereum-push-notification-service/sdk/commit/f6d18b685696d00c06b711fd70b51e567a31e288)) ## [0.0.5](https://github.com/ethereum-push-notification-service/sdk/compare/restapi-0.0.4...restapi-0.0.5) (2022-10-07) - ### Bug Fixes -* **all:** updating restapi, uiweb ([d86945d](https://github.com/ethereum-push-notification-service/sdk/commit/d86945d43af815a6a7ccd6a38f6a383a1fc8d4d1)) - - +- **all:** updating restapi, uiweb ([d86945d](https://github.com/ethereum-push-notification-service/sdk/commit/d86945d43af815a6a7ccd6a38f6a383a1fc8d4d1)) ## [0.0.4](https://github.com/ethereum-push-notification-service/sdk/compare/restapi-0.0.3...restapi-0.0.4) (2022-10-05) - - ## [0.0.3](https://github.com/ethereum-push-notification-service/sdk/compare/restapi-0.0.2...restapi-0.0.3) (2022-10-05) - - ## [0.0.2](https://github.com/ethereum-push-notification-service/sdk/compare/restapi-0.0.1...restapi-0.0.2) (2022-10-05) - ### Bug Fixes -* **restapi:** trigger publish ([41348fc](https://github.com/ethereum-push-notification-service/sdk/commit/41348fcefa62471fa3272e53b40bde1d0587ee0c)) - - +- **restapi:** trigger publish ([41348fc](https://github.com/ethereum-push-notification-service/sdk/commit/41348fcefa62471fa3272e53b40bde1d0587ee0c)) ## 0.0.1 (2022-10-05) diff --git a/packages/restapi/README.md b/packages/restapi/README.md index 86df69317..722c67255 100644 --- a/packages/restapi/README.md +++ b/packages/restapi/README.md @@ -1,7 +1,9 @@ # restapi + This package gives access to Push Protocol (Push Nodes) APIs. Visit [Developer Docs](https://docs.push.org/developers) or [Push.org](https://push.org) to learn more. # Index + - [restapi](#restapi) - [Index](#index) - [How to use in your app?](#how-to-use-in-your-app) @@ -80,6 +82,7 @@ This package gives access to Push Protocol (Push Nodes) APIs. Visit [Developer D - [isInitiator](#isinitiator) # How to use in your app? + ## Installation ```bash @@ -91,21 +94,26 @@ or ```bash npm install @pushprotocol/restapi@latest ethers@^5.6 ``` + ## Import SDK + ```typescript -import * as PushAPI from "@pushprotocol/restapi"; +import * as PushAPI from '@pushprotocol/restapi'; ``` ## **About generating the "signer" object for different platforms** -### When using in SERVER-SIDE code: +### When using in SERVER-SIDE code: + ```typescript const ethers = require('ethers'); const PK = 'your_channel_address_secret_key'; const Pkey = `0x${PK}`; const _signer = new ethers.Wallet(Pkey); ``` -### When using in FRONT-END code: + +### When using in FRONT-END code: + ```typescript // any other web3 ui lib is also acceptable import { useWeb3React } from "@web3-react/core"; @@ -118,24 +126,29 @@ const _signer = library.getSigner(account); ## **About blockchain agnostic address format** -In any of the below methods (unless explicitly stated otherwise) we accept either - -- [CAIP format](https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md#test-cases): for any on chain addresses ***We strongly recommend using this address format***. [Learn more about the format and examples](https://docs.push.org/developers/concepts/web3-notifications). -(Example : `eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb`) +In any of the below methods (unless explicitly stated otherwise) we accept either - -- ETH address format: only for backwards compatibility. -(Example: `0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb`) - - ### Chat blockchain agnostic address format - **Note** - For chat related apis, the address is in the format: eip155:<address> instead of eip155:<chainId>:<address>, we call this format **Partial CAIP** +- [CAIP format](https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md#test-cases): for any on chain addresses **_We strongly recommend using this address format_**. [Learn more about the format and examples](https://docs.push.org/developers/concepts/web3-notifications). + (Example : `eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb`) + +- ETH address format: only for backwards compatibility. + (Example: `0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb`) + +### Chat blockchain agnostic address format + +**Note** - For chat related apis, the address is in the format: eip155:<address> instead of eip155:<chainId>:<address>, we call this format **Partial CAIP** (Example : `eip155:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb`) ## **About Push contract addresses** + ### Push core contract address + ``` ETH Mainnet - 0x66329Fdd4042928BfCAB60b179e1538D56eeeeeE ``` ### Push communicator contract address + ``` ETH Mainnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa ETH Goerli - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa @@ -148,13 +161,15 @@ Optimism Testnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa ``` # SDK Features + ## For Notification ### **Fetching user notifications** + ```typescript const notifications = await PushAPI.user.getFeeds({ user: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // user address in CAIP - env: 'staging' + env: 'staging', }); ``` @@ -167,10 +182,7 @@ const notifications = await PushAPI.user.getFeeds({ { cta: 'https://idle.finance/#/governance/proposals', title: 'New Proposal', - message: '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' + - '\n' + - '[d:Proposal] : IIP-32: Add Euler staking PYT wrappers for AA tranche to IdleDAI\n' + - '[timestamp:1676570405.922][timestamp: 1676570405]', + message: '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' + '\n' + '[d:Proposal] : IIP-32: Add Euler staking PYT wrappers for AA tranche to IdleDAI\n' + '[timestamp:1676570405.922][timestamp: 1676570405]', icon: 'https://gateway.ipfs.io/ipfs/bafybeidgjepmup44yqmghcmmzp5aohj6yemjuwal3hozowp2mnxmtdjv5u/bafkreieqw4su7yuqf5ycow4ajpzjyimfl4umnnoe5fz2mq7ukrmqnesk2y', url: 'https://idle.finance/', sid: '3401597', @@ -179,9 +191,9 @@ const notifications = await PushAPI.user.getFeeds({ blockchain: 'ETH_TEST_GOERLI', notification: { body: 'New Proposal On Idle Finance', - title: 'Idle Finance - New Proposal' + title: 'Idle Finance - New Proposal', }, - secret: '' + secret: '', }, { cta: '', @@ -194,7 +206,7 @@ const notifications = await PushAPI.user.getFeeds({ image: '', blockchain: 'ETH_TEST_GOERLI', notification: { body: 'hi socket', title: 'AKP Test Channel - ' }, - secret: '' + secret: '', }, { cta: '', @@ -207,7 +219,7 @@ const notifications = await PushAPI.user.getFeeds({ image: '', blockchain: 'ETH_TEST_GOERLI', notification: { body: 'hiii', title: 'AKP Test Channel - ' }, - secret: '' + secret: '', }, { cta: '', @@ -220,7 +232,7 @@ const notifications = await PushAPI.user.getFeeds({ image: '', blockchain: 'ETH_TEST_GOERLI', notification: { body: 'Hey -testing', title: 'Gnosis - ' }, - secret: '' + secret: '', }, { cta: '', @@ -233,15 +245,12 @@ const notifications = await PushAPI.user.getFeeds({ image: '', blockchain: 'ETH_TEST_GOERLI', notification: { body: 'Hey', title: 'Gnosis - ' }, - secret: '' + secret: '', }, { cta: 'https://idle.finance/#/governance/proposals', title: 'New Proposal', - message: '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' + - '\n' + - '[d:Proposal] : IIP-31: Add AA Euler staking PYT wrappers to IdleUSDT, IdleUSDC and IdleWETH. Gauges rate to 0. Extend LM. \n' + - '[timestamp:1674583206.258][timestamp: 1674583206]', + message: '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' + '\n' + '[d:Proposal] : IIP-31: Add AA Euler staking PYT wrappers to IdleUSDT, IdleUSDC and IdleWETH. Gauges rate to 0. Extend LM. \n' + '[timestamp:1674583206.258][timestamp: 1674583206]', icon: 'https://gateway.ipfs.io/ipfs/bafybeidgjepmup44yqmghcmmzp5aohj6yemjuwal3hozowp2mnxmtdjv5u/bafkreieqw4su7yuqf5ycow4ajpzjyimfl4umnnoe5fz2mq7ukrmqnesk2y', url: 'https://idle.finance/', sid: '1784234', @@ -250,9 +259,9 @@ const notifications = await PushAPI.user.getFeeds({ blockchain: 'ETH_TEST_GOERLI', notification: { body: 'New Proposal On Idle Finance', - title: 'Idle Finance - New Proposal' + title: 'Idle Finance - New Proposal', }, - secret: '' + secret: '', }, { cta: '', @@ -265,7 +274,7 @@ const notifications = await PushAPI.user.getFeeds({ image: '', blockchain: 'ETH_TEST_GOERLI', notification: { body: 'hi 2023', title: 'AKP Test Channel - ' }, - secret: '' + secret: '', }, { cta: '', @@ -278,16 +287,12 @@ const notifications = await PushAPI.user.getFeeds({ image: '', blockchain: 'ETH_TEST_GOERLI', notification: { body: 'hi', title: 'AKP Test Channel - ' }, - secret: '' + secret: '', }, { cta: 'https://idle.finance/#/governance/proposals', title: 'New Proposal', - message: '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' + - '\n' + - '[d:Proposal] : IIP-30: Remove idleDAI wrapper for cpFOL-USDC (DAI) senior. Same for idleUSDC with cpWIN-USDC. Remove idleRAI, idleSUSD, idleTUSD and idleFEI from IdleController. Update voting delay in Governor \n' + - ' \n' + - '[timestamp:1672769747.911][timestamp: 1672769747]', + message: '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' + '\n' + '[d:Proposal] : IIP-30: Remove idleDAI wrapper for cpFOL-USDC (DAI) senior. Same for idleUSDC with cpWIN-USDC. Remove idleRAI, idleSUSD, idleTUSD and idleFEI from IdleController. Update voting delay in Governor \n' + ' \n' + '[timestamp:1672769747.911][timestamp: 1672769747]', icon: 'https://gateway.ipfs.io/ipfs/bafybeidgjepmup44yqmghcmmzp5aohj6yemjuwal3hozowp2mnxmtdjv5u/bafkreieqw4su7yuqf5ycow4ajpzjyimfl4umnnoe5fz2mq7ukrmqnesk2y', url: 'https://idle.finance/', sid: '1080072', @@ -296,18 +301,14 @@ const notifications = await PushAPI.user.getFeeds({ blockchain: 'ETH_TEST_GOERLI', notification: { body: 'New Proposal On Idle Finance', - title: 'Idle Finance - New Proposal' + title: 'Idle Finance - New Proposal', }, - secret: '' + secret: '', }, { cta: 'https://idle.finance/#/governance/proposals', title: 'New Proposal', - message: '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' + - '\n' + - '[d:Proposal] : IIP-29: Remove idleDAI wrapper for cpFOL-USDC (DAI) senior. Same for idleUSDC with cpWIN-USDC. Remove idleRAI, idleSUSD, idleTUSD and idleFEI from IdleController. Update voting delay in Governor \n' + - ' \n' + - '[timestamp:1671624005.155][timestamp: 1671624005]', + message: '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' + '\n' + '[d:Proposal] : IIP-29: Remove idleDAI wrapper for cpFOL-USDC (DAI) senior. Same for idleUSDC with cpWIN-USDC. Remove idleRAI, idleSUSD, idleTUSD and idleFEI from IdleController. Update voting delay in Governor \n' + ' \n' + '[timestamp:1671624005.155][timestamp: 1671624005]', icon: 'https://gateway.ipfs.io/ipfs/bafybeidgjepmup44yqmghcmmzp5aohj6yemjuwal3hozowp2mnxmtdjv5u/bafkreieqw4su7yuqf5ycow4ajpzjyimfl4umnnoe5fz2mq7ukrmqnesk2y', url: 'https://idle.finance/', sid: '935285', @@ -316,34 +317,36 @@ const notifications = await PushAPI.user.getFeeds({ blockchain: 'ETH_TEST_GOERLI', notification: { body: 'New Proposal On Idle Finance', - title: 'Idle Finance - New Proposal' + title: 'Idle Finance - New Proposal', }, - secret: '' - } -] + secret: '', + }, +]; ``` + ------ +--- ### **Fetching user spam notifications** + ```typescript const spams = await PushAPI.user.getFeeds({ user: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // user address in CAIP spam: true, - env: 'staging' + env: 'staging', }); ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| user* | string | - | user account address (CAIP) | -| page | number | 1 | page index of the results | -| limit | number | 10 | number of items in 1 page | -| spam | boolean | false | if "true" it will fetch spam feeds | -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| -| raw | boolean | false | if "true" the method will return unformatted raw API response| +| user_ | string | - | user account address (CAIP) | +| page | number | 1 | page index of the results | +| limit | number | 10 | number of items in 1 page | +| spam | boolean | false | if "true" it will fetch spam feeds | +| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| +| raw | boolean | false | if "true" the method will return unformatted raw API response|
Expected response (Fetching user spam notifications) @@ -513,85 +516,56 @@ PushAPI.user.getFeeds [Spam] | Response - 200 OK } ] ``` +
------ +--- ### **Fetching user subscriptions** + ```typescript const subscriptions = await PushAPI.user.getSubscriptions({ user: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // user address in CAIP - env: 'staging' + env: 'staging', }); ``` where `subscriptions` is a list of channels `[{ channel: '0xaddress', ... }]` subscribed by the user. -*Note: We can find out if a user is subscribed to a channel by checking if the channel address is present in the subscriptions list* +_Note: We can find out if a user is subscribed to a channel by checking if the channel address is present in the subscriptions list_ -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| user* | string | - | user address (CAIP) | -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| - +| user_ | string | - | user address (CAIP) | +| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
Expected response (Fetching user opted in channels / subscriptions) ```typescript // PushAPI.user.getSubscriptions | Response - 200 OK -[ - { channel: '0x0000000000000000000000000000000000000000' }, - { channel: '0xa3B6712fB922cdbbdce9AB22571e75d0d81B3b00' }, - { channel: '0xde3aEA26fDC3ADdC1dB32baf1a058Cf0878FEac1' }, - { channel: '0x69e666767Ba3a661369e1e2F572EdE7ADC926029' }, - { channel: '0x466AEEf0943C5F098dBcEf3c1eEC03322E1F97eD' }, - { channel: '0xcE98113b998380729B04596e3eA0255fbA138D34' }, - { channel: '0xa89523351BE1e2De64937AA9AF61Ae06eAd199C7' }, - { channel: '0x0a651cF7A9b60082fecdb5f30DB7914Fd7d2cf93' }, - { channel: '0x0b5E9fa12C4C1946fA2f14b7271cC60541508f23' }, - { channel: '0x2AEcb6DeE3652dA1dD6b54D5fd4f7D8F43DaEb78' }, - { channel: '0xcB6C7b2E340D50701d45d55507f19A5cE5d72330' }, - { channel: '0xB59Cdc85Cacd15097ecE4C77ed9D225014b4D56D' }, - { channel: '0xA5E269eec042Bf61183DEf9911D03359597494b7' }, - { channel: '0x6bf1ee9DE5D11Fa558c1FA8D8855E26C38Fa582A' }, - { channel: '0x72Ac64A3aE0ab60D725980b73Ef460ED9e742cc7' }, - { channel: '0xEc6CbD318CB7BA8a0fBbffF697681C0a4ADA0349' }, - { channel: '0xAb9415961F58eBD6d79029bC76F261Fa65a80D3D' }, - { channel: '0x08D77bD7500a07d791dD1323919C22e1FDb72224' }, - { channel: '0xa1016081D6Da53b4246178eD83922C55F7171e54' }, - { channel: '0x6A06014AC6BdE2906D194e63ec3b1B5B4c9C2Abb' }, - { channel: '0xf69389475E082f4BeFDb9dee4a1E9fe6cd29f6e7' }, - { channel: '0x9601f08b9EcB981D273B72e7f33964Cb98f977fe' }, - { channel: '0x47A2910432016CA9f62B20dCE09b89d357d0c3d7' }, - { channel: '0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' }, - { channel: '0x14c0157f9eEA7AEe61ba2606E75716E210b4697a' }, - { channel: '0x025846389950A13292E63e4794C7D148FF57F995' }, - { channel: '0x2aecb6dee3652da1dd6b54d5fd4f7d8f43daeb77' }, - { channel: '0xD8634C39BBFd4033c0d3289C4515275102423681' }, - { channel: '0x19fB80f16EAFCfb5BBFa07451CC5694E8932EA52' }, - { channel: '0x94c3016ef3e503774630fC71F59B8Da9f7D470B7' } -] +[{ channel: '0x0000000000000000000000000000000000000000' }, { channel: '0xa3B6712fB922cdbbdce9AB22571e75d0d81B3b00' }, { channel: '0xde3aEA26fDC3ADdC1dB32baf1a058Cf0878FEac1' }, { channel: '0x69e666767Ba3a661369e1e2F572EdE7ADC926029' }, { channel: '0x466AEEf0943C5F098dBcEf3c1eEC03322E1F97eD' }, { channel: '0xcE98113b998380729B04596e3eA0255fbA138D34' }, { channel: '0xa89523351BE1e2De64937AA9AF61Ae06eAd199C7' }, { channel: '0x0a651cF7A9b60082fecdb5f30DB7914Fd7d2cf93' }, { channel: '0x0b5E9fa12C4C1946fA2f14b7271cC60541508f23' }, { channel: '0x2AEcb6DeE3652dA1dD6b54D5fd4f7D8F43DaEb78' }, { channel: '0xcB6C7b2E340D50701d45d55507f19A5cE5d72330' }, { channel: '0xB59Cdc85Cacd15097ecE4C77ed9D225014b4D56D' }, { channel: '0xA5E269eec042Bf61183DEf9911D03359597494b7' }, { channel: '0x6bf1ee9DE5D11Fa558c1FA8D8855E26C38Fa582A' }, { channel: '0x72Ac64A3aE0ab60D725980b73Ef460ED9e742cc7' }, { channel: '0xEc6CbD318CB7BA8a0fBbffF697681C0a4ADA0349' }, { channel: '0xAb9415961F58eBD6d79029bC76F261Fa65a80D3D' }, { channel: '0x08D77bD7500a07d791dD1323919C22e1FDb72224' }, { channel: '0xa1016081D6Da53b4246178eD83922C55F7171e54' }, { channel: '0x6A06014AC6BdE2906D194e63ec3b1B5B4c9C2Abb' }, { channel: '0xf69389475E082f4BeFDb9dee4a1E9fe6cd29f6e7' }, { channel: '0x9601f08b9EcB981D273B72e7f33964Cb98f977fe' }, { channel: '0x47A2910432016CA9f62B20dCE09b89d357d0c3d7' }, { channel: '0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' }, { channel: '0x14c0157f9eEA7AEe61ba2606E75716E210b4697a' }, { channel: '0x025846389950A13292E63e4794C7D148FF57F995' }, { channel: '0x2aecb6dee3652da1dd6b54d5fd4f7d8f43daeb77' }, { channel: '0xD8634C39BBFd4033c0d3289C4515275102423681' }, { channel: '0x19fB80f16EAFCfb5BBFa07451CC5694E8932EA52' }, { channel: '0x94c3016ef3e503774630fC71F59B8Da9f7D470B7' }]; ``` +
------ +--- ### **Fetching channel details** + ```typescript const channelData = await PushAPI.channels.getChannel({ channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // channel address in CAIP - env: 'staging' + env: 'staging', }); ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| channel* | string | - | channel address (CAIP) | -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| - +| channel_ | string | - | channel address (CAIP) | +| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
Expected response (Fetching channel details) @@ -620,28 +594,29 @@ Allowed Options (params with * are mandatory) subgraph_details: null } ``` +
------ +--- ### **Searching for channel(s)** + ```typescript const channelsData = await PushAPI.channels.search({ query: 'push', // a search query page: 1, // page index limit: 20, // no of items per page - env: 'staging' + env: 'staging', }); ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| query* | string | - | search query | -| page | number | 1 | page index of the results | -| limit | number | 10 | number of items in 1 page | -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| - +| query_ | string | - | search query | +| page | number | 1 | page index of the results | +| limit | number | 10 | number of items in 1 page | +| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
Expected response (Searching for channel) @@ -669,7 +644,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 756 + subscriber_count: 756, }, { id: 817, @@ -691,7 +666,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 57 + subscriber_count: 57, }, { id: 243, @@ -713,7 +688,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 9 + subscriber_count: 9, }, { id: 923, @@ -735,7 +710,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 9 + subscriber_count: 9, }, { id: 274, @@ -757,7 +732,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 5 + subscriber_count: 5, }, { id: 1242, @@ -779,7 +754,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 5 + subscriber_count: 5, }, { id: 210, @@ -801,7 +776,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 4 + subscriber_count: 4, }, { id: 809, @@ -823,7 +798,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: 18, subgraph_details: '60+aiswaryawalter/push-graph-test', - subscriber_count: 4 + subscriber_count: 4, }, { id: 956, @@ -845,7 +820,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 4 + subscriber_count: 4, }, { id: 967, @@ -867,7 +842,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: 18, subgraph_details: '60+aiswaryawalter/push-graph-test', - subscriber_count: 4 + subscriber_count: 4, }, { id: 1425, @@ -889,7 +864,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 4 + subscriber_count: 4, }, { id: 1659, @@ -911,7 +886,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 4 + subscriber_count: 4, }, { id: 287, @@ -933,7 +908,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 3 + subscriber_count: 3, }, { id: 369, @@ -955,7 +930,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 3 + subscriber_count: 3, }, { id: 445, @@ -977,7 +952,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 3 + subscriber_count: 3, }, { id: 735, @@ -999,7 +974,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 3 + subscriber_count: 3, }, { id: 737, @@ -1021,7 +996,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 3 + subscriber_count: 3, }, { id: 929, @@ -1043,7 +1018,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 3 + subscriber_count: 3, }, { id: 1039, @@ -1065,7 +1040,7 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 3 + subscriber_count: 3, }, { id: 1241, @@ -1087,41 +1062,42 @@ Allowed Options (params with * are mandatory) blocked: 0, counter: null, subgraph_details: null, - subscriber_count: 3 - } -] + subscriber_count: 3, + }, +]; ``` -
------ + +--- ### **Opt in to a channel** + ```typescript await PushAPI.channels.subscribe({ signer: _signer, channelAddress: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // channel address in CAIP userAddress: 'eip155:5:0x52f856A160733A860ae7DC98DC71061bE33A28b3', // user address in CAIP onSuccess: () => { - console.log('opt in success'); + console.log('opt in success'); }, onError: () => { console.error('opt in error'); }, - env: 'staging' -}) + env: 'staging', +}); ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| signer* | - | - | Signer object | -| channelAddress* | string | - | channel address (CAIP) | -| userAddress* | string | - | user address (CAIP) | | -| verifyingContractAddress | string | - | Push communicator contract address| -| onSuccess | function | - | on success callback | -| onError | function | - | on error callback | -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| +| signer_ | - | - | Signer object | +| channelAddress* | string | - | channel address (CAIP) | +| userAddress* | string | - | user address (CAIP) | | +| verifyingContractAddress | string | - | Push communicator contract address| +| onSuccess | function | - | on success callback | +| onError | function | - | on error callback | +| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
Expected response (Opt in to channel) @@ -1131,35 +1107,38 @@ Allowed Options (params with * are mandatory) { status: 'success', message: 'successfully opted into channel' } ``` +
------ +--- ### **Opt out to a channel** + ```typescript await PushAPI.channels.unsubscribe({ signer: _signer, channelAddress: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // channel address in CAIP userAddress: 'eip155:5:0x52f856A160733A860ae7DC98DC71061bE33A28b3', // user address in CAIP onSuccess: () => { - console.log('opt out success'); + console.log('opt out success'); }, onError: () => { console.error('opt out error'); }, - env: 'staging' -}) + env: 'staging', +}); ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | + +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| signer* | - | - | Signer object | -| channelAddress* | string | - | channel address (CAIP) | -| userAddress* | string | - | user address (CAIP) | | -| verifyingContractAddress | string | - | Push communicator contract address| -| onSuccess | function | - | on success callback | -| onError | function | - | on error callback | -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| +| signer_ | - | - | Signer object | +| channelAddress* | string | - | channel address (CAIP) | +| userAddress* | string | - | user address (CAIP) | | +| verifyingContractAddress | string | - | Push communicator contract address| +| onSuccess | function | - | on success callback | +| onError | function | - | on error callback | +| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
Expected response (Opt out of a channel) @@ -1168,9 +1147,10 @@ Allowed Options (params with * are mandatory) // PushAPI.channels.unsubscribe | Response - 200 OK { status: 'success', message: 'successfully opted out channel' } ``` +
------ +--- ### **Sending notification** @@ -1205,34 +1185,35 @@ async function sendNotification(options: { env?: ENV; chatId?: string; pgpPrivateKey?: string; -}) +}); ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| senderType* | number | 0 | 0 for channel notification. 1 for chat notification | -| signer* | - | - | Signer object | -| channel* | string | - | channel address (CAIP) | -| type* | number | - | Notification Type
Target = 3 (send to 1 address),
Subset = 4 (send to 1 or more addresses),
Broadcast = 1 (send to all addresses) | -| identityType* | number | - | Identity Type
Minimal = 0,
IPFS = 1,
Direct Payload = 2,
Subgraph = 3 } | -| recipients* | string or string[] | - | for Notification Type = Target it is 1 address,
for Notification Type = Subset, Broadcast it is an array of addresses (CAIP) | -| notification.title* | string | - | Push Notification Title (not required for identityType IPFS, Subgraph)| -| notification.body* | string | - | Push Notification Body (not required for identityType IPFS, Subgraph)| -| payload.title | string | - | Notification Title (not required for identityType IPFS, Subgraph)| -| payload.body | string | - | Notification Body (not required for identityType IPFS, Subgraph)| -| payload.cta | string | - | Notification Call To Action url (not required for identityType IPFS, Subgraph)| -| payload.img | string | - | Notification Media url (not required for identityType IPFS, Subgraph)| -| payload.sectype | string | - | If Secret Notification then pass (not required for identityType IPFS, Subgraph)| -| graph.id | string | - | graph id, required only if the identityType is 3 | -| graph.counter | string | - | graph counter, required only if the identityType is 3 | -| ipfsHash | string | - | ipfsHash, required only if the identityType is 1 | -| expiry | number | - | (optional) epoch value if the notification has an expiry | -| hidden | boolean | false | (optional) true if we want to hide the notification | -| pgpPrivateKey | string | - | (optional) pgp private key for new notification verification proof | -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| +| senderType_ | number | 0 | 0 for channel notification. 1 for chat notification | +| signer* | - | - | Signer object | +| channel* | string | - | channel address (CAIP) | +| type* | number | - | Notification Type
Target = 3 (send to 1 address),
Subset = 4 (send to 1 or more addresses),
Broadcast = 1 (send to all addresses) | +| identityType* | number | - | Identity Type
Minimal = 0,
IPFS = 1,
Direct Payload = 2,
Subgraph = 3 } | +| recipients* | string or string[] | - | for Notification Type = Target it is 1 address,
for Notification Type = Subset, Broadcast it is an array of addresses (CAIP) | +| notification.title* | string | - | Push Notification Title (not required for identityType IPFS, Subgraph)| +| notification.body\* | string | - | Push Notification Body (not required for identityType IPFS, Subgraph)| +| payload.title | string | - | Notification Title (not required for identityType IPFS, Subgraph)| +| payload.body | string | - | Notification Body (not required for identityType IPFS, Subgraph)| +| payload.cta | string | - | Notification Call To Action url (not required for identityType IPFS, Subgraph)| +| payload.img | string | - | Notification Media url (not required for identityType IPFS, Subgraph)| +| payload.sectype | string | - | If Secret Notification then pass (not required for identityType IPFS, Subgraph)| +| graph.id | string | - | graph id, required only if the identityType is 3 | +| graph.counter | string | - | graph counter, required only if the identityType is 3 | +| ipfsHash | string | - | ipfsHash, required only if the identityType is 1 | +| expiry | number | - | (optional) epoch value if the notification has an expiry | +| hidden | boolean | false | (optional) true if we want to hide the notification | +| pgpPrivateKey | string | - | (optional) pgp private key for new notification verification proof | +| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| #### **Direct payload for single recipient(target)** + ```typescript // apiResponse?.status === 204, if sent successfully! const apiResponse = await PushAPI.payloads.sendNotification({ @@ -1241,21 +1222,22 @@ const apiResponse = await PushAPI.payloads.sendNotification({ identityType: PushAPI.payloads.IDENTITY_TYPE.DIRECT_PAYLOAD, // direct payload notification: { title: `[SDK-TEST] notification TITLE:`, - body: `[sdk-test] notification BODY` + body: `[sdk-test] notification BODY`, }, payload: { title: `[sdk-test] payload title`, body: `sample msg body`, cta: '', - img: '' + img: '', }, recipients: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // recipient address channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address - env: 'staging' + env: 'staging', }); ``` - + #### **Direct payload for group of recipients(subset)** + ```typescript // apiResponse?.status === 204, if sent successfully! const apiResponse = await PushAPI.payloads.sendNotification({ @@ -1264,21 +1246,22 @@ const apiResponse = await PushAPI.payloads.sendNotification({ identityType: 2, // direct payload notification: { title: `[SDK-TEST] notification TITLE:`, - body: `[sdk-test] notification BODY` + body: `[sdk-test] notification BODY`, }, payload: { title: `[sdk-test] payload title`, body: `sample msg body`, cta: '', - img: '' + img: '', }, recipients: ['eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1'], // recipients addresses channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address - env: 'staging' + env: 'staging', }); ``` #### **Direct payload for all recipients(broadcast)** + ```typescript // apiResponse?.status === 204, if sent successfully! const apiResponse = await PushAPI.payloads.sendNotification({ @@ -1287,20 +1270,21 @@ const apiResponse = await PushAPI.payloads.sendNotification({ identityType: PushAPI.payloads.IDENTITY_TYPE.DIRECT_PAYLOAD, // direct payload notification: { title: `[SDK-TEST] notification TITLE:`, - body: `[sdk-test] notification BODY` + body: `[sdk-test] notification BODY`, }, payload: { title: `[sdk-test] payload title`, body: `sample msg body`, cta: '', - img: '' + img: '', }, channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address - env: 'staging' + env: 'staging', }); ``` #### **IPFS payload for single recipient(target)** + ```typescript // apiResponse?.status === 204, if sent successfully! const apiResponse = await PushAPI.payloads.sendNotification({ @@ -1310,11 +1294,12 @@ const apiResponse = await PushAPI.payloads.sendNotification({ ipfsHash: 'bafkreicuttr5gpbyzyn6cyapxctlr7dk2g6fnydqxy6lps424mcjcn73we', // IPFS hash of the payload recipients: 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1', // recipient address channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address - env: 'staging' + env: 'staging', }); ``` #### **IPFS payload for group of recipients(subset)** + ```typescript // apiResponse?.status === 204, if sent successfully! const apiResponse = await PushAPI.payloads.sendNotification({ @@ -1324,11 +1309,12 @@ const apiResponse = await PushAPI.payloads.sendNotification({ ipfsHash: 'bafkreicuttr5gpbyzyn6cyapxctlr7dk2g6fnydqxy6lps424mcjcn73we', // IPFS hash of the payload recipients: ['eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1', 'eip155:5:0x52f856A160733A860ae7DC98DC71061bE33A28b3'], // recipients addresses channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address - env: 'staging' + env: 'staging', }); ``` #### **IPFS payload for all recipients(broadcast)** + ```typescript // apiResponse?.status === 204, if sent successfully! const apiResponse = await PushAPI.payloads.sendNotification({ @@ -1337,11 +1323,12 @@ const apiResponse = await PushAPI.payloads.sendNotification({ identityType: PushAPI.payloads.IDENTITY_TYPE.DIRECT_PAYLOAD, // direct payload ipfsHash: 'bafkreicuttr5gpbyzyn6cyapxctlr7dk2g6fnydqxy6lps424mcjcn73we', // IPFS hash of the payload channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address - env: 'staging' + env: 'staging', }); ``` #### **Minimal payload for single recipient(target)** + ```typescript // apiResponse?.status === 204, if sent successfully! const apiResponse = await PushAPI.payloads.sendNotification({ @@ -1350,21 +1337,22 @@ const apiResponse = await PushAPI.payloads.sendNotification({ identityType: PushAPI.payloads.IDENTITY_TYPE.MINIMAL, // Minimal payload notification: { title: `[SDK-TEST] notification TITLE:`, - body: `[sdk-test] notification BODY` + body: `[sdk-test] notification BODY`, }, payload: { title: `[sdk-test] payload title`, body: `sample msg body`, cta: '', - img: '' + img: '', }, recipients: 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1', // recipient address channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address - env: 'staging' + env: 'staging', }); ``` #### **Minimal payload for a group of recipient(subset)** + ```typescript // apiResponse?.status === 204, if sent successfully! const apiResponse = await PushAPI.payloads.sendNotification({ @@ -1373,21 +1361,22 @@ const apiResponse = await PushAPI.payloads.sendNotification({ identityType: PushAPI.payloads.IDENTITY_TYPE.MINIMAL, // Minimal payload notification: { title: `[SDK-TEST] notification TITLE:`, - body: `[sdk-test] notification BODY` + body: `[sdk-test] notification BODY`, }, payload: { title: `[sdk-test] payload title`, body: `sample msg body`, cta: '', - img: '' + img: '', }, recipients: ['eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1', 'eip155:5:0x52f856A160733A860ae7DC98DC71061bE33A28b3'], // recipients address channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address - env: 'staging' + env: 'staging', }); ``` #### **Minimal payload for all recipients(broadcast)** + ```typescript // apiResponse?.status === 204, if sent successfully! const apiResponse = await PushAPI.payloads.sendNotification({ @@ -1396,21 +1385,23 @@ const apiResponse = await PushAPI.payloads.sendNotification({ identityType: PushAPI.payloads.IDENTITY_TYPE.MINIMAL, // Minimal payload notification: { title: `[SDK-TEST] notification TITLE:`, - body: `[sdk-test] notification BODY` + body: `[sdk-test] notification BODY`, }, payload: { title: `[sdk-test] payload title`, body: `sample msg body`, cta: '', - img: '' + img: '', }, channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address - env: 'staging' + env: 'staging', }); ``` #### **Graph payload for single recipient(target)** -***Make sure the channel has the graph id you are providing!!*** + +**_Make sure the channel has the graph id you are providing!!_** + ```typescript // apiResponse?.status === 204, if sent successfully! const apiResponse = await PushAPI.payloads.sendNotification({ @@ -1419,16 +1410,18 @@ const apiResponse = await PushAPI.payloads.sendNotification({ identityType: PushAPI.payloads.IDENTITY_TYPE.SUBGRAPH, // Subgraph payload graph: { id: '_your_graph_id', - counter: 3 + counter: 3, }, recipients: 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1', // recipient address channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address - env: 'staging' + env: 'staging', }); ``` #### **Graph payload for group of recipients(subset)** -***Make sure the channel has the graph id you are providing!!*** + +**_Make sure the channel has the graph id you are providing!!_** + ```typescript // apiResponse?.status === 204, if sent successfully! const apiResponse = await PushAPI.payloads.sendNotification({ @@ -1437,16 +1430,18 @@ const apiResponse = await PushAPI.payloads.sendNotification({ identityType: PushAPI.payloads.IDENTITY_TYPE.SUBGRAPH, // graph payload graph: { id: '_your_graph_id', - counter: 3 + counter: 3, }, recipients: ['eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1', 'eip155:5:0x52f856A160733A860ae7DC98DC71061bE33A28b3'], // recipients addresses channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address - env: 'staging' + env: 'staging', }); ``` #### **Graph payload for all recipients(broadcast)** -***Make sure the channel has the graph id you are providing!!*** + +**_Make sure the channel has the graph id you are providing!!_** + ```typescript // apiResponse?.status === 204, if sent successfully! const apiResponse = await PushAPI.payloads.sendNotification({ @@ -1455,34 +1450,36 @@ const apiResponse = await PushAPI.payloads.sendNotification({ identityType: PushAPI.payloads.IDENTITY_TYPE.SUBGRAPH, // graph payload graph: { id: '_your_graph_id', - counter: 3 + counter: 3, }, channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address - env: 'staging' + env: 'staging', }); ``` -
Expected response (Send Notification) ```typescript // PushAPI.payloads.sendNotification | Response - 204 OK ``` -
------ + +--- ### Notification Helper Utils + #### **Parsing notifications** + Utils method to parse raw Push Feeds API response into a pre-defined shape as below. + ```typescript // fetch some raw feeds data const apiResponse = await PushAPI.user.getFeeds({ user: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // user address raw: true, - env: 'staging' + env: 'staging', }); // parse it to get a specific shape of object. const parsedResults = PushAPI.utils.parseApiResponse(apiResponse); @@ -1491,28 +1488,19 @@ const [oneNotification] = parsedResults; // Now this object can be directly used by for e.g. "@pushprotocol/uiweb" NotificationItem component as props. -const { - cta, - title, - message, - app, - icon, - image, - url, - blockchain, - secret, - notification -} = oneNotification; - +const { cta, title, message, app, icon, image, url, blockchain, secret, notification } = oneNotification; ``` -*We get the above `keys` after the parsing of the API repsonse.* ------ +_We get the above `keys` after the parsing of the API repsonse._ + +--- ### Advanced Notifications (WIP) ### DEPRECATED + #### **Get a channel's subscriber list of addresses** + ```typescript const subscribers = await PushAPI.channels.getSubscribers({ channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // channel address in CAIP @@ -1522,11 +1510,11 @@ const subscribers = await PushAPI.channels.getSubscribers({ }); ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| channel* | string | - | channel address (CAIP) | -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| +| channel_ | string | - | channel address (CAIP) | +| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
DEPRECATED - Expected response (Get channel's subscribers list) @@ -1637,11 +1625,13 @@ Allowed Options (params with * are mandatory) ... 656 more items ] ``` +
------ +--- ## For Chat + ### **Create user for chat** ```typescript @@ -1660,7 +1650,7 @@ const user = await PushAPI.user.create({ ``` | Param | Remarks | -|----------------|---------------------------------------------------------------| +| -------------- | ------------------------------------------------------------- | | env | API env - 'prod', 'staging', 'dev' | | account | Account address | | signer | ethers.js signer | @@ -1680,12 +1670,12 @@ const user = await PushAPI.user.create({ Example creating NFT user for chat: ```typescript - const user = await PushAPI.user.create({ - account: `nft:eip155:${nftChainId}:${nftContractAddress}:${nftTokenId}`, - signer: nftSigner, // ethers.js signer - env: env as ENV, - additionalMeta: { NFTPGP_V1: { password: '@Test0i1223de' } }, - }); +const user = await PushAPI.user.create({ + account: `nft:eip155:${nftChainId}:${nftContractAddress}:${nftTokenId}`, + signer: nftSigner, // ethers.js signer + env: env as ENV, + additionalMeta: { NFTPGP_V1: { password: '@Test0i1223de' } }, +}); ```
@@ -1714,26 +1704,27 @@ export interface IUser { } ``` -| Parameter | Description | -| --- | --- | -| `did` | user decentralized identity | -| `wallets` | all wallets associated to the did | -| `profilePicture` | user chat profile picture. As of now i cannot be changed | -| `publicKey` | PGP public key | -| `encryptedPrivateKey` | encrypted private PGP key | -| `encryptionType` | encryption type used to encrypt the private key | -| `signature` | user payload signature used when creating a user | -| `sigType` | signature type used when creating a user | -| `about` | short user description | -| `name` | user name | -| `encryptedPassword` | encrypted password used to encrypt the private key for NFT chat | -| `nftOwner` | NFT owner address | -| `numMsg` | number of messages sent by the user | -| `allowedNumMsg` | number of messages allowed to be sent by the user | -| `linkedListHash` | cid from all messages this user has sent | -| `nfts` | array of NFTs owned by the user | +| Parameter | Description | +| --------------------- | --------------------------------------------------------------- | +| `did` | user decentralized identity | +| `wallets` | all wallets associated to the did | +| `profilePicture` | user chat profile picture. As of now i cannot be changed | +| `publicKey` | PGP public key | +| `encryptedPrivateKey` | encrypted private PGP key | +| `encryptionType` | encryption type used to encrypt the private key | +| `signature` | user payload signature used when creating a user | +| `sigType` | signature type used when creating a user | +| `about` | short user description | +| `name` | user name | +| `encryptedPassword` | encrypted password used to encrypt the private key for NFT chat | +| `nftOwner` | NFT owner address | +| `numMsg` | number of messages sent by the user | +| `allowedNumMsg` | number of messages allowed to be sent by the user | +| `linkedListHash` | cid from all messages this user has sent | +| `nfts` | array of NFTs owned by the user | Example response normal user: + ```typescript // PushAPI_user_get | Response - 200 OK { @@ -1907,25 +1898,25 @@ export interface IUser { } ``` -| Parameter | Description | -| --- | --- | -| `msgSent` | number of messages sent by the user | -| `maxMsgPersisted` | number of messages allowed to be sent by the user | -| `did` | user decentralized identity | -| `wallets` | all wallets associated to the did | -| `name` | user name | -| `desc` | short user description | -| `profilePicture` | user chat profile picture. As of now i cannot be changed | -| `encryptedPrivateKey` | encrypted private PGP key | -| `publicKey` | PGP public key | -| `nftOwner` | NFT owner address | -| `verificationProof` | verification proof | +| Parameter | Description | +| --------------------- | -------------------------------------------------------- | +| `msgSent` | number of messages sent by the user | +| `maxMsgPersisted` | number of messages allowed to be sent by the user | +| `did` | user decentralized identity | +| `wallets` | all wallets associated to the did | +| `name` | user name | +| `desc` | short user description | +| `profilePicture` | user chat profile picture. As of now i cannot be changed | +| `encryptedPrivateKey` | encrypted private PGP key | +| `publicKey` | PGP public key | +| `verificationProof` | verification proof |
------ +--- ### **Get user data for chat** + ```typescript const user = await PushAPI.user.get({ env?: ENV; @@ -1933,10 +1924,10 @@ const user = await PushAPI.user.get({ }); ``` -| Param | Remarks | -|----------|---------| -| account | Account address | -| env | API env - 'prod', 'staging', 'dev'| +| Param | Remarks | +| ------- | ---------------------------------- | +| account | Account address | +| env | API env - 'prod', 'staging', 'dev' | Example request get normal user data: @@ -1982,24 +1973,24 @@ export interface IUser { } ``` -| Parameter | Description | -| --- | --- | -| `did` | user decentralized identity | -| `wallets` | all wallets associated to the did | -| `profilePicture` | user chat profile picture. As of now i cannot be changed | -| `publicKey` | PGP public key | -| `encryptedPrivateKey` | encrypted private PGP key | -| `encryptionType` | encryption type used to encrypt the private key | -| `signature` | user payload signature used when creating a user | -| `sigType` | signature type used when creating a user | -| `about` | short user description | -| `name` | user name | -| `encryptedPassword` | encrypted password used to encrypt the private key for NFT chat | -| `nftOwner` | NFT owner address | -| `numMsg` | number of messages sent by the user | -| `allowedNumMsg` | number of messages allowed to be sent by the user | -| `linkedListHash` | cid from all messages this user has sent | -| `nfts` | array of NFTs owned by the user | +| Parameter | Description | +| --------------------- | --------------------------------------------------------------- | +| `did` | user decentralized identity | +| `wallets` | all wallets associated to the did | +| `profilePicture` | user chat profile picture. As of now i cannot be changed | +| `publicKey` | PGP public key | +| `encryptedPrivateKey` | encrypted private PGP key | +| `encryptionType` | encryption type used to encrypt the private key | +| `signature` | user payload signature used when creating a user | +| `sigType` | signature type used when creating a user | +| `about` | short user description | +| `name` | user name | +| `encryptedPassword` | encrypted password used to encrypt the private key for NFT chat | +| `nftOwner` | NFT owner address | +| `numMsg` | number of messages sent by the user | +| `allowedNumMsg` | number of messages allowed to be sent by the user | +| `linkedListHash` | cid from all messages this user has sent | +| `nfts` | array of NFTs owned by the user | Example response normal user: @@ -2176,24 +2167,23 @@ export interface IUser { } ``` -| Parameter | Description | -| --- | --- | -| `msgSent` | number of messages sent by the user | -| `maxMsgPersisted` | number of messages allowed to be sent by the user | -| `did` | user decentralized identity | -| `wallets` | all wallets associated to the did | -| `name` | user name | -| `desc` | short user description | -| `profilePicture` | user chat profile picture. As of now i cannot be changed | -| `encryptedPrivateKey` | encrypted private PGP key | -| `publicKey` | PGP public key | -| `nftOwner` | NFT owner address | -| `verificationProof` | verification proof | +| Parameter | Description | +| --------------------- | -------------------------------------------------------- | +| `msgSent` | number of messages sent by the user | +| `maxMsgPersisted` | number of messages allowed to be sent by the user | +| `did` | user decentralized identity | +| `wallets` | all wallets associated to the did | +| `name` | user name | +| `desc` | short user description | +| `picture` | user chat profile picture. As of now i cannot be changed | +| `encryptedPrivateKey` | encrypted private PGP key | +| `publicKey` | PGP public key | +| `verificationProof` | verification proof | ------ - +--- + ### **Decrypting encrypted pgp private key from user data** ```typescript @@ -2201,22 +2191,22 @@ const response = await PushAPI.chat.decryptPGPKey({ encryptedPGPPrivateKey: string; account?: string; signer?: SignerType; - additionalMeta?: { password?: string }; + additionalMeta?: { password?: string }; env?: ENV; toUpgrade?: boolean; progressHook?: (progress: ProgressHookType) => void; }) ``` -| Parameter | Type | Description | -| --- | --- | --- | -| `encryptedPGPPrivateKey` | `string` | encrypted pgp private key | -| `account` | `string` | user account | -| `signer` | `SignerType` | ethers.js signer | -| `additionalMeta` | `{ password?: string }` | additional meta data | -| `env` | `ENV` | environment | -| `toUpgrade` | `boolean` | if true, the user will be upgraded to the latest version | -| `progressHook` | `(progress: ProgressHookType) => void` | progress hook | +| Parameter | Type | Description | +| ------------------------ | -------------------------------------- | -------------------------------------------------------- | +| `encryptedPGPPrivateKey` | `string` | encrypted pgp private key | +| `account` | `string` | user account | +| `signer` | `SignerType` | ethers.js signer | +| `additionalMeta` | `{ password?: string }` | additional meta data | +| `env` | `ENV` | environment | +| `toUpgrade` | `boolean` | if true, the user will be upgraded to the latest version | +| `progressHook` | `(progress: ProgressHookType) => void` | progress hook | **Example request for normal user:** @@ -2224,13 +2214,13 @@ const response = await PushAPI.chat.decryptPGPKey({ const user = await PushAPI.user.get({ account: `eip155:${signer.address}`, env: ENV.STAGING, -}) +}); // decrypt the PGP Key const pgpKey = await PushAPI.chat.decryptPGPKey({ encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: signer, -}) +}); ``` **Example request for NFT user:** @@ -2238,14 +2228,14 @@ const pgpKey = await PushAPI.chat.decryptPGPKey({ ```typescript // get user and derive encrypted PGP key const user = await PushAPI.user.get({ - account: `nft:eip155:${nftChainId}:${nftContractAddress}:${nftTokenId}`, + account: `nft:eip155:${nftChainId}:${nftContractAddress}:${nftTokenId}`, env: env as ENV, }); // decrypt the PGP Key const pgpKey = await PushAPI.chat.decryptPGPKey({ encryptedPGPPrivateKey: user.encryptedPrivateKey, - account: `nft:eip155:${nftChainId}:${nftContractAddress}:${nftTokenId}`, + account: `nft:eip155:${nftChainId}:${nftContractAddress}:${nftTokenId}`, signer: nftSigner, }); ``` @@ -2286,9 +2276,10 @@ n4FxJNoL/lmuCqhQm4Zgduj3GdYUunMDID3k54J1FPGN+iCj =OX08 -----END PGP PRIVATE KEY BLOCK----- ``` + ------ +--- ### **Fetching list of user chats** @@ -2307,12 +2298,12 @@ const chats = await PushAPI.chat.chats({ }); ``` -| Param | Type | Default | Remarks | -|----------|---------|---------|--------------------------------------------| -| account | string | - | user address (Partial CAIP) | -| toDecrypt | boolean | false | if "true" the method will return decrypted message content in response| -| pgpPrivateKey | string | null | mandatory for users having pgp keys| -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| +| Param | Type | Default | Remarks | +| ------------- | ------- | ------- | ---------------------------------------------------------------------- | +| account | string | - | user address (Partial CAIP) | +| toDecrypt | boolean | false | if "true" the method will return decrypted message content in response | +| pgpPrivateKey | string | null | mandatory for users having pgp keys | +| env | string | 'prod' | API env - 'prod', 'staging', 'dev' | **Example normal user:** @@ -2323,10 +2314,10 @@ const user = await PushAPI.user.get({ account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: ENV.STAGING, }) - + // need to decrypt the encryptedPvtKey to pass in the api using helper function const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: signer); - + // actual api const chats = await PushAPI.chat.chats({ account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', @@ -2360,7 +2351,6 @@ const response = await PushAPI.chat.chats({ }); ``` -
Expected response (Get chats of a specific user) @@ -2388,66 +2378,39 @@ const response = await PushAPI.chat.chats({ toDID: 'eip155:0x1C48fE875590f8e366447758b13982a3Ca7d9dBE', messageContent: "Gm gm! It's me... Mario", messageType: 'Text', - signature: '-----BEGIN PGP SIGNATURE-----\n' + - '\n' + - 'wsBzBAEBCAAnBYJkWKQWCZB7dzg7q3axjBYhBJFuYslzDGbuE+3FMnt3ODur\n' + - 'drGMAAAjtAf/TXjtm2qb6aSikFPKYXm0Ekws+65fisJGf7T48MYkkfcD4t2e\n' + - 'HXd9LtohzGhcztbOQfAND3yME1GWuMBIksq9rlyEA0ezwsGzCJVhBnkAHBe3\n' + - '+1v4/mNSMmInU8y6sOiLiOcW7ameJvZvDdPDJ0YHhc9dKDCIh1UAZEPAgx+z\n' + - 'Wc0DM6pW8bT70dfgnuW2LlLGF5Z23Z1vbHmeszt78+xYY3ez/hoMHXUIE25z\n' + - 'Wrnt75nasBBahtJ0mwH10ATnsQNE9hTi6XPGYxRSNDM9nyRxTQUpjhNmGS/+\n' + - '7oFyq8xTcRSaL7d3h8URp9hgFWher5ZZDyMV0jvk+HPguUX54g6Kgw==\n' + - '=dcRD\n' + - '-----END PGP SIGNATURE-----\n', + signature: '-----BEGIN PGP SIGNATURE-----\n' + '\n' + 'wsBzBAEBCAAnBYJkWKQWCZB7dzg7q3axjBYhBJFuYslzDGbuE+3FMnt3ODur\n' + 'drGMAAAjtAf/TXjtm2qb6aSikFPKYXm0Ekws+65fisJGf7T48MYkkfcD4t2e\n' + 'HXd9LtohzGhcztbOQfAND3yME1GWuMBIksq9rlyEA0ezwsGzCJVhBnkAHBe3\n' + '+1v4/mNSMmInU8y6sOiLiOcW7ameJvZvDdPDJ0YHhc9dKDCIh1UAZEPAgx+z\n' + 'Wc0DM6pW8bT70dfgnuW2LlLGF5Z23Z1vbHmeszt78+xYY3ez/hoMHXUIE25z\n' + 'Wrnt75nasBBahtJ0mwH10ATnsQNE9hTi6XPGYxRSNDM9nyRxTQUpjhNmGS/+\n' + '7oFyq8xTcRSaL7d3h8URp9hgFWher5ZZDyMV0jvk+HPguUX54g6Kgw==\n' + '=dcRD\n' + '-----END PGP SIGNATURE-----\n', timestamp: 1683530775648, sigType: 'pgp', encType: 'pgp', - encryptedSecret: '-----BEGIN PGP MESSAGE-----\n' + - '\n' + - 'wcBMA9aU+JGZVRn/AQgA1pIJHyeJinU21r6At5S5ZaWeN0OEKVB2TjpqZ0IW\n' + - 'lHLKQrQ8k3M16bN+Vf0P+DzDVOL84QRkBD56qSNVHOOCox5wcQeR01CczenV\n' + - 'LUVvVjBzR2hj7Sdw+Q+M//rgeZPPUDbNyiVmGijelhwDqWd7IOoZY26AGXlm\n' + - '7YQiElvHN2HcYXaTlLAOy36BcccwHu3Tn06F77ZXaf8FnGMWOUy7wh1/jugg\n' + - 'D17jUZGLYbmw+u5l9BOfljbw2pb4vtjWht0I1b4GYlKb+bYg/NY0UNsq7mSh\n' + - 'dGAmOhy5tC2NMjLRRLfD2qasxHoHN50onlB6HcYLl0RCf31ebOgO6rMhUnxt\n' + - '9cHATAMLWLG2xubrYAEH/2tVeq2j7nJALGSFxjJPboOY57aiFrhXNQ/e/oXH\n' + - '//TNJgGWx4Ta++OuF2Oexbh9DIZhl6DWld9adXDDtBS/fEyjNsYqwoYlNEJN\n' + - 'kLvSmokNNrE4MKC1A0GkhSh2MGQDNk42GSgz1tep8XSVc98MHqfNXCHVb5Oa\n' + - 'OBeWKLFyElT3+KuZxSkCsnoO5YjuCGbXPyG06tXMHXMTncpj1ri+vpjUSnhD\n' + - 'wn3o0zpNWu0GaWXIgTqj2ZouVwV2S1+wAJQjE8uI1JvBiMhA+X63/GCcApBu\n' + - 'C7rN0Cs5NGXCn9VWp8i1SCp2NuZ38POABwsXUUkjpF24txyUDX8dbXlkzpao\n' + - 'g93SQAElYYmyKbGp1TKhAZl2u40mgf2yCYDv2DLRfAKMJDLvmjXoUGEg2UYO\n' + - '11w6LD0pIykdKJmFtRls/uMnlcoBgDA=\n' + - '=kzUH\n' + - '-----END PGP MESSAGE-----\n', - link: 'bafyreib34jgnpp573rwquejcq5avxvydis7fbykat6dd5z7uazobucoumm' + encryptedSecret: '-----BEGIN PGP MESSAGE-----\n' + '\n' + 'wcBMA9aU+JGZVRn/AQgA1pIJHyeJinU21r6At5S5ZaWeN0OEKVB2TjpqZ0IW\n' + 'lHLKQrQ8k3M16bN+Vf0P+DzDVOL84QRkBD56qSNVHOOCox5wcQeR01CczenV\n' + 'LUVvVjBzR2hj7Sdw+Q+M//rgeZPPUDbNyiVmGijelhwDqWd7IOoZY26AGXlm\n' + '7YQiElvHN2HcYXaTlLAOy36BcccwHu3Tn06F77ZXaf8FnGMWOUy7wh1/jugg\n' + 'D17jUZGLYbmw+u5l9BOfljbw2pb4vtjWht0I1b4GYlKb+bYg/NY0UNsq7mSh\n' + 'dGAmOhy5tC2NMjLRRLfD2qasxHoHN50onlB6HcYLl0RCf31ebOgO6rMhUnxt\n' + '9cHATAMLWLG2xubrYAEH/2tVeq2j7nJALGSFxjJPboOY57aiFrhXNQ/e/oXH\n' + '//TNJgGWx4Ta++OuF2Oexbh9DIZhl6DWld9adXDDtBS/fEyjNsYqwoYlNEJN\n' + 'kLvSmokNNrE4MKC1A0GkhSh2MGQDNk42GSgz1tep8XSVc98MHqfNXCHVb5Oa\n' + 'OBeWKLFyElT3+KuZxSkCsnoO5YjuCGbXPyG06tXMHXMTncpj1ri+vpjUSnhD\n' + 'wn3o0zpNWu0GaWXIgTqj2ZouVwV2S1+wAJQjE8uI1JvBiMhA+X63/GCcApBu\n' + 'C7rN0Cs5NGXCn9VWp8i1SCp2NuZ38POABwsXUUkjpF24txyUDX8dbXlkzpao\n' + 'g93SQAElYYmyKbGp1TKhAZl2u40mgf2yCYDv2DLRfAKMJDLvmjXoUGEg2UYO\n' + '11w6LD0pIykdKJmFtRls/uMnlcoBgDA=\n' + '=kzUH\n' + '-----END PGP MESSAGE-----\n', + link: 'bafyreib34jgnpp573rwquejcq5avxvydis7fbykat6dd5z7uazobucoumm', }, - groupInformation: undefined - } -] -``` - -| Parameter | Type | Description | -| --- | --- | --- | -| msg | `IMessageIPFS` | message object | -| did | `string` | user DID | -| wallets | `string` | user wallets | -| profilePicture | `string` | user profile picture | -| publicKey | `string` | user public key | -| about | `string` | user description | -| threadhash | `string` | cid from the latest message sent on this conversation | -| intent | `string` | addresses concatenated from the users who have approved the intent | -| intentSentBy | `string` | address of the user who sent the intent | -| intentTimestamp | `number` | timestamp of the intent | -| combinedDID | `string` | concatenated addresses of the members of this chat (for DM the 2 addresses and from Group the addresses from all group members) | -| cid | `string` | content identifier on IPFS | -| chatId | `string` | chat identifier | -| groupInformation | `GroupDTO` | if group chat, all group information | + groupInformation: undefined, + }, +]; +``` + +| Parameter | Type | Description | +| ---------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| msg | `IMessageIPFS` | message object | +| did | `string` | user DID | +| wallets | `string` | user wallets | +| profilePicture | `string` | user profile picture | +| publicKey | `string` | user public key | +| about | `string` | user description | +| threadhash | `string` | cid from the latest message sent on this conversation | +| intent | `string` | addresses concatenated from the users who have approved the intent | +| intentSentBy | `string` | address of the user who sent the intent | +| intentTimestamp | `number` | timestamp of the intent | +| combinedDID | `string` | concatenated addresses of the members of this chat (for DM the 2 addresses and from Group the addresses from all group members) | +| cid | `string` | content identifier on IPFS | +| chatId | `string` | chat identifier | +| groupInformation | `GroupDTO` | if group chat, all group information |
------ - +--- + ### **Fetching list of user chat requests** ```typescript @@ -2465,12 +2428,12 @@ const chats = await PushAPI.chat.requests({ }); ``` -| Param | Type | Default | Remarks | -|----------|---------|---------|--------------------------------------------| -| account | string | - | user address (Partial CAIP) | -| toDecrypt | boolean | false | if "true" the method will return decrypted message content in response| -| pgpPrivateKey | string | null | mandatory for users having pgp keys| -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| +| Param | Type | Default | Remarks | +| ------------- | ------- | ------- | ---------------------------------------------------------------------- | +| account | string | - | user address (Partial CAIP) | +| toDecrypt | boolean | false | if "true" the method will return decrypted message content in response | +| pgpPrivateKey | string | null | mandatory for users having pgp keys | +| env | string | 'prod' | API env - 'prod', 'staging', 'dev' | **Example:** @@ -2478,10 +2441,10 @@ const chats = await PushAPI.chat.requests({ // pre-requisite API calls that should be made before // need to get user and through that encryptedPvtKey of the user const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: ENV.STAGING); - + // need to decrypt the encryptedPvtKey to pass in the api using helper function const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer); - + // actual api const chats = await PushAPI.chat.requests({ account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', @@ -2504,37 +2467,7 @@ const chats = await PushAPI.chat.requests({ intent: 'eip155:0x69e666767Ba3a661369e1e2F572EdE7ADC926029', intentSentBy: 'eip155:0x69e666767Ba3a661369e1e2F572EdE7ADC926029', intentTimestamp: '2023-01-07T03:51:11.000Z', - publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' + - '\n' + - 'xsBNBGOhhq8BCADP5Nzw0jOXhKO86ndGkY/JlD8AadVXmsLA+Yvoc22LrNTU\n' + - 'QrfcDWaMAzpmtMWJlNEHSTieUPEgODm/qj422+rdskSedum3gq1HWn2bmqEI\n' + - 'LrFc+zR3B70Pe7saEEmC/hXG53/8m7V0HsOuvkEjBa3pW3KElZIhimVvcgYR\n' + - '9AnLjUYKR/lci1eXXsAz+J+RjgPlFfiIE0/3KYXwkjt9meSJDPCIcEIZ1tqw\n' + - 'IkGRINM5XINMvC+FxPNQ+jIHF9WIzmUg4YfYZQbMo96j4LAV0kYvAB0qI2Y8\n' + - 'DHAjHXYQ+fafRGOJwePASjDHUjcB9QEr1EPIMG3i4iFaBV2ZmePjzE7XABEB\n' + - 'AAHNAMLAigQQAQgAPgUCY6GGrwQLCQcICRCUVlBnqYwnwgMVCAoEFgACAQIZ\n' + - 'AQIbAwIeARYhBPYJKSdUrZzVgB9jy5RWUGepjCfCAABLZAgAtVdxz75k3qFY\n' + - 'qtwMdsrIPX4A7rpT/zCd2Yjl2asFdlkyAusfNdFEiff1dHz5+qBM88z/Zh+O\n' + - '1FNDKS/WKL9qmZ+AceyidCjnRVTUeH6Mi/ZD/YZInJyLozCksb0Gciswl6Rp\n' + - 'RHb6nXt0PebUFXTsOVxSeodaEGBgltd/V1bDHpfx8Wu03z3h/Jq2tI4s28XA\n' + - 'S2lSZpG8+nC1zLOmpbYx8mdOe00ONBdnMvxAqckd437ns7Tu8sKW4SsRzjg1\n' + - 'YHTmApRjai1L6bHn0P5Utz0BcynzrUn+bZ0cC+5Rq3kZvrjnaJOIutY+ALDF\n' + - '4yWoVIz8KzzAUx1caVyVvwdFtjVTS87ATQRjoYavAQgA3nCB6WLASwBwp5r/\n' + - 'WU8SiUzf/2srENNObpjxavmv2FVKcKfO0ehSi6ti22KSKnUgm5prlOMWsVl/\n' + - 'wEClvpGw0Btdar4OQI7XdwkY8XUVB5Jff7cNpi4qE+4lIYqCTQief9H5GLC/\n' + - 'QvpE53yZWGFK581OSaeomtibN5xAaUyEE8qITnYyjqA+SgffRFVN5/WOnnBK\n' + - 'zbIHrXl2lXOFkegXaOk+Qxxikw9cSpHNV5YHVoDStRCJZKVU8JhKa7pYKkmC\n' + - 'pSIiXT3IdSAqDiglDRxwX4KlFFhGZ1OGbBmPefN3pZ7/xvaM28TqSDNB7f89\n' + - '/lc5UKLz5Em2aroEclT0YpKYGQARAQABwsB2BBgBCAAqBQJjoYavCRCUVlBn\n' + - 'qYwnwgIbDBYhBPYJKSdUrZzVgB9jy5RWUGepjCfCAAC6rwgAji6/qPQn/BN/\n' + - 'BbwGBN+A8tWRuQLwrgOilg8oHWkyCIUK7DeBp+gpkSghjsnaEAqc94xaGD3U\n' + - 'AfgcPGmC/Jx92W+bX8P40Iq8OvPgLgvG1u5Rf1a1SNYAuypQemuHYu3HOvUU\n' + - 'vP+0omoiTWyNZVqsZA0FGIYQk9uRg8KGsLvXwzPPLqC5Yo3fyfQUmytBZfEf\n' + - 'OwYwuvzx1RBHtvyZ32sfq//q4t2fXY0d49rg6l475zo3JsZsYtqZJCf9h6uK\n' + - 'MrSFgvn8mJFlpwI1+g7X46VB+t8D1Ac35r9Bn9UIWieIyS2Aux2UwBsY2iET\n' + - 'CdgkH8gWFBU7bdKsFh7BQX2ZhrxHXQ==\n' + - '=Lr7Q\n' + - '-----END PGP PUBLIC KEY BLOCK-----\n', + publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' + '\n' + 'xsBNBGOhhq8BCADP5Nzw0jOXhKO86ndGkY/JlD8AadVXmsLA+Yvoc22LrNTU\n' + 'QrfcDWaMAzpmtMWJlNEHSTieUPEgODm/qj422+rdskSedum3gq1HWn2bmqEI\n' + 'LrFc+zR3B70Pe7saEEmC/hXG53/8m7V0HsOuvkEjBa3pW3KElZIhimVvcgYR\n' + '9AnLjUYKR/lci1eXXsAz+J+RjgPlFfiIE0/3KYXwkjt9meSJDPCIcEIZ1tqw\n' + 'IkGRINM5XINMvC+FxPNQ+jIHF9WIzmUg4YfYZQbMo96j4LAV0kYvAB0qI2Y8\n' + 'DHAjHXYQ+fafRGOJwePASjDHUjcB9QEr1EPIMG3i4iFaBV2ZmePjzE7XABEB\n' + 'AAHNAMLAigQQAQgAPgUCY6GGrwQLCQcICRCUVlBnqYwnwgMVCAoEFgACAQIZ\n' + 'AQIbAwIeARYhBPYJKSdUrZzVgB9jy5RWUGepjCfCAABLZAgAtVdxz75k3qFY\n' + 'qtwMdsrIPX4A7rpT/zCd2Yjl2asFdlkyAusfNdFEiff1dHz5+qBM88z/Zh+O\n' + '1FNDKS/WKL9qmZ+AceyidCjnRVTUeH6Mi/ZD/YZInJyLozCksb0Gciswl6Rp\n' + 'RHb6nXt0PebUFXTsOVxSeodaEGBgltd/V1bDHpfx8Wu03z3h/Jq2tI4s28XA\n' + 'S2lSZpG8+nC1zLOmpbYx8mdOe00ONBdnMvxAqckd437ns7Tu8sKW4SsRzjg1\n' + 'YHTmApRjai1L6bHn0P5Utz0BcynzrUn+bZ0cC+5Rq3kZvrjnaJOIutY+ALDF\n' + '4yWoVIz8KzzAUx1caVyVvwdFtjVTS87ATQRjoYavAQgA3nCB6WLASwBwp5r/\n' + 'WU8SiUzf/2srENNObpjxavmv2FVKcKfO0ehSi6ti22KSKnUgm5prlOMWsVl/\n' + 'wEClvpGw0Btdar4OQI7XdwkY8XUVB5Jff7cNpi4qE+4lIYqCTQief9H5GLC/\n' + 'QvpE53yZWGFK581OSaeomtibN5xAaUyEE8qITnYyjqA+SgffRFVN5/WOnnBK\n' + 'zbIHrXl2lXOFkegXaOk+Qxxikw9cSpHNV5YHVoDStRCJZKVU8JhKa7pYKkmC\n' + 'pSIiXT3IdSAqDiglDRxwX4KlFFhGZ1OGbBmPefN3pZ7/xvaM28TqSDNB7f89\n' + '/lc5UKLz5Em2aroEclT0YpKYGQARAQABwsB2BBgBCAAqBQJjoYavCRCUVlBn\n' + 'qYwnwgIbDBYhBPYJKSdUrZzVgB9jy5RWUGepjCfCAAC6rwgAji6/qPQn/BN/\n' + 'BbwGBN+A8tWRuQLwrgOilg8oHWkyCIUK7DeBp+gpkSghjsnaEAqc94xaGD3U\n' + 'AfgcPGmC/Jx92W+bX8P40Iq8OvPgLgvG1u5Rf1a1SNYAuypQemuHYu3HOvUU\n' + 'vP+0omoiTWyNZVqsZA0FGIYQk9uRg8KGsLvXwzPPLqC5Yo3fyfQUmytBZfEf\n' + 'OwYwuvzx1RBHtvyZ32sfq//q4t2fXY0d49rg6l475zo3JsZsYtqZJCf9h6uK\n' + 'MrSFgvn8mJFlpwI1+g7X46VB+t8D1Ac35r9Bn9UIWieIyS2Aux2UwBsY2iET\n' + 'CdgkH8gWFBU7bdKsFh7BQX2ZhrxHXQ==\n' + '=Lr7Q\n' + '-----END PGP PUBLIC KEY BLOCK-----\n', profilePicture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA1UlEQVR4AcXBobGEMBSG0W//idlKiKARaohMAzEIzFoEhgaQ1EAV6xCkmn32PpMZZue9e87j9Xx/uKGkSMu6X9whnAlnwlkoKdKy7hdWnTJN+4hVUqRFOBPOhLPH6/n+YAznwl86+hFLOBPOhLNQUsRa+5GW4VxoOfqRlpIilnAmnAlnYd0v/tO6X1jCmXAmnIWSIladMtbRj3xjOBesbt6whDPhTDgLdcrc0c0bLQcXLXXKWMKZcCachW7esOqUsUqKWHXKtBQ2rMpv3bxhCWfCmXD2A590MfREqrg1AAAAAElFTkSuQmCC', threadhash: 'bafyreigs26i7k3g5u4xmqg44tecmkfvelclp5lletnikfbsrj7dhg5oi4y', wallets: 'eip155:0x69e666767Ba3a661369e1e2F572EdE7ADC926029', @@ -2545,77 +2478,40 @@ const chats = await PushAPI.chat.requests({ toDID: 'eip155:0x69e666767Ba3a661369e1e2F572EdE7ADC926029', encType: 'pgp', fromDID: 'eip155:0xD8634C39BBFd4033c0d3289C4515275102423681', - sigType: '-----BEGIN PGP SIGNATURE-----\n' + - '\n' + - 'wsBzBAEBCAAnBQJjuJ7WCRCszcBmB607ShYhBEWdLV876c+znjS0l6zNwGYH\n' + - 'rTtKAAAEUQgAiSLgvLRf4UM/VIOImO4I/CHt5vBCqvOjq8068K5Bb2ciRn0o\n' + - '8IqLV2eYKe8c0LK8Gf/CzZn7S13eux4FUlXcX7TlU9BpgHAVQIP4gDe7Q1XN\n' + - '1+rXFH+QW4P/Zv0knObHAby/7wYfD1ZfBrLbo5SpZEBDYQNYZ5t29y7aVD5e\n' + - 'QMOoSvj5+y6SLDLJalb5daeSfaZtpNBsTZvUBLndNomT///gzrXRutkgW4T4\n' + - 'bDipFPUvLMNvWM1qXJjDyYbyQnr8J8aq3FKoGs4Qs5Z2wcwx9RF54Izh81vd\n' + - 'Y5jkZdpULqxjB4BH2mFGyB9Cp2e5cIpKriY597JCAc6Y6WfhgbIZoA==\n' + - '=n2B5\n' + - '-----END PGP SIGNATURE-----\n', + sigType: '-----BEGIN PGP SIGNATURE-----\n' + '\n' + 'wsBzBAEBCAAnBQJjuJ7WCRCszcBmB607ShYhBEWdLV876c+znjS0l6zNwGYH\n' + 'rTtKAAAEUQgAiSLgvLRf4UM/VIOImO4I/CHt5vBCqvOjq8068K5Bb2ciRn0o\n' + '8IqLV2eYKe8c0LK8Gf/CzZn7S13eux4FUlXcX7TlU9BpgHAVQIP4gDe7Q1XN\n' + '1+rXFH+QW4P/Zv0knObHAby/7wYfD1ZfBrLbo5SpZEBDYQNYZ5t29y7aVD5e\n' + 'QMOoSvj5+y6SLDLJalb5daeSfaZtpNBsTZvUBLndNomT///gzrXRutkgW4T4\n' + 'bDipFPUvLMNvWM1qXJjDyYbyQnr8J8aq3FKoGs4Qs5Z2wcwx9RF54Izh81vd\n' + 'Y5jkZdpULqxjB4BH2mFGyB9Cp2e5cIpKriY597JCAc6Y6WfhgbIZoA==\n' + '=n2B5\n' + '-----END PGP SIGNATURE-----\n', toCAIP10: 'eip155:0x69e666767Ba3a661369e1e2F572EdE7ADC926029', - signature: '-----BEGIN PGP SIGNATURE-----\n' + - '\n' + - 'wsBzBAEBCAAnBQJjuJ7WCRCszcBmB607ShYhBEWdLV876c+znjS0l6zNwGYH\n' + - 'rTtKAAAEUQgAiSLgvLRf4UM/VIOImO4I/CHt5vBCqvOjq8068K5Bb2ciRn0o\n' + - '8IqLV2eYKe8c0LK8Gf/CzZn7S13eux4FUlXcX7TlU9BpgHAVQIP4gDe7Q1XN\n' + - '1+rXFH+QW4P/Zv0knObHAby/7wYfD1ZfBrLbo5SpZEBDYQNYZ5t29y7aVD5e\n' + - 'QMOoSvj5+y6SLDLJalb5daeSfaZtpNBsTZvUBLndNomT///gzrXRutkgW4T4\n' + - 'bDipFPUvLMNvWM1qXJjDyYbyQnr8J8aq3FKoGs4Qs5Z2wcwx9RF54Izh81vd\n' + - 'Y5jkZdpULqxjB4BH2mFGyB9Cp2e5cIpKriY597JCAc6Y6WfhgbIZoA==\n' + - '=n2B5\n' + - '-----END PGP SIGNATURE-----\n', + signature: '-----BEGIN PGP SIGNATURE-----\n' + '\n' + 'wsBzBAEBCAAnBQJjuJ7WCRCszcBmB607ShYhBEWdLV876c+znjS0l6zNwGYH\n' + 'rTtKAAAEUQgAiSLgvLRf4UM/VIOImO4I/CHt5vBCqvOjq8068K5Bb2ciRn0o\n' + '8IqLV2eYKe8c0LK8Gf/CzZn7S13eux4FUlXcX7TlU9BpgHAVQIP4gDe7Q1XN\n' + '1+rXFH+QW4P/Zv0knObHAby/7wYfD1ZfBrLbo5SpZEBDYQNYZ5t29y7aVD5e\n' + 'QMOoSvj5+y6SLDLJalb5daeSfaZtpNBsTZvUBLndNomT///gzrXRutkgW4T4\n' + 'bDipFPUvLMNvWM1qXJjDyYbyQnr8J8aq3FKoGs4Qs5Z2wcwx9RF54Izh81vd\n' + 'Y5jkZdpULqxjB4BH2mFGyB9Cp2e5cIpKriY597JCAc6Y6WfhgbIZoA==\n' + '=n2B5\n' + '-----END PGP SIGNATURE-----\n', timestamp: 1673043671357, fromCAIP10: 'eip155:0xD8634C39BBFd4033c0d3289C4515275102423681', messageType: 'Text', messageContent: 'hey', - encryptedSecret: '-----BEGIN PGP MESSAGE-----\n' + - '\n' + - 'wcBMAzJsNgcerTKoAQgAvzX9pBj4j7ytnwU7DwMsCMl6PUDx6qAQybQxrlby\n' + - '+xkP1Cf1tOkLj1HP/oFHg3cX5HioM600jAaIYhCr8ib+M3ydvhKnti0mcpbn\n' + - 'VnbWilrzyFUBE7T3eZY54JeFxIQ9mtjl/TmGryXpWD9FHjnSp22NRnbZIcZZ\n' + - 'SHpatgDZYzRhHf9zqusBH2QUDKX1Ty7dIq9JD2AeS55l40IHNMPcP2btxfY1\n' + - 'T7od8WvFYhlWQGtkbm8k42fwdK1mIJ3H/rOSeM8sTliYAECe+IhmpIevg4II\n' + - 'Eel7eG81HjGciWt3Vs3FXkhuEUbQnMRAKfhaqalJNDriaWwzUMMt5a/rWdS1\n' + - 'gMHATAN7roGwZ8OLswEH/2RmDHNAaDi11UT3uLAuQxNzlLeqxFaTPecSFaEW\n' + - 'IFdJ+3ujcy3FHoyndK0S+ucFhP2V0hJRMHyyMiKNKSuUp6Q03NZ7Uqavqku3\n' + - 'kVfAJ3tH6jlUWNetvV8t95OmYInqhC4MNk0nIhdI10bl89KmNRqsfQqKu5Hn\n' + - '5b9Jy7B+XgjKNdj7iWx0FuFabVIQ3NIDnVBDLy8/mDTeB1HuAv/7KljBr0fC\n' + - 'TtzSZij1Pu5+aIPWaGG2hJvxga9g5Zqfvdm79Wn3gfoOCz3FdXcp/n3732rY\n' + - '+mrIE0DVUlWa0YbVotcSCzLlUpXlFts85Ok8W/N8ERtBMbbd2+e2tBKAP8Hs\n' + - 'iYHSQAHz9V5LwQaFvujErtV5KZfD5DnB8RlUVJU4JKLDgYiXaP18O0fpsZyO\n' + - '4fym770psCEPU4sc+flSJ0SxBa8m+yM=\n' + - '=Cp3M\n' + - '-----END PGP MESSAGE-----\n' + encryptedSecret: '-----BEGIN PGP MESSAGE-----\n' + '\n' + 'wcBMAzJsNgcerTKoAQgAvzX9pBj4j7ytnwU7DwMsCMl6PUDx6qAQybQxrlby\n' + '+xkP1Cf1tOkLj1HP/oFHg3cX5HioM600jAaIYhCr8ib+M3ydvhKnti0mcpbn\n' + 'VnbWilrzyFUBE7T3eZY54JeFxIQ9mtjl/TmGryXpWD9FHjnSp22NRnbZIcZZ\n' + 'SHpatgDZYzRhHf9zqusBH2QUDKX1Ty7dIq9JD2AeS55l40IHNMPcP2btxfY1\n' + 'T7od8WvFYhlWQGtkbm8k42fwdK1mIJ3H/rOSeM8sTliYAECe+IhmpIevg4II\n' + 'Eel7eG81HjGciWt3Vs3FXkhuEUbQnMRAKfhaqalJNDriaWwzUMMt5a/rWdS1\n' + 'gMHATAN7roGwZ8OLswEH/2RmDHNAaDi11UT3uLAuQxNzlLeqxFaTPecSFaEW\n' + 'IFdJ+3ujcy3FHoyndK0S+ucFhP2V0hJRMHyyMiKNKSuUp6Q03NZ7Uqavqku3\n' + 'kVfAJ3tH6jlUWNetvV8t95OmYInqhC4MNk0nIhdI10bl89KmNRqsfQqKu5Hn\n' + '5b9Jy7B+XgjKNdj7iWx0FuFabVIQ3NIDnVBDLy8/mDTeB1HuAv/7KljBr0fC\n' + 'TtzSZij1Pu5+aIPWaGG2hJvxga9g5Zqfvdm79Wn3gfoOCz3FdXcp/n3732rY\n' + '+mrIE0DVUlWa0YbVotcSCzLlUpXlFts85Ok8W/N8ERtBMbbd2+e2tBKAP8Hs\n' + 'iYHSQAHz9V5LwQaFvujErtV5KZfD5DnB8RlUVJU4JKLDgYiXaP18O0fpsZyO\n' + '4fym770psCEPU4sc+flSJ0SxBa8m+yM=\n' + '=Cp3M\n' + '-----END PGP MESSAGE-----\n', }, - groupInformation: undefined - } -] -``` - -| Parameter | Type | Description | -| --- | --- | --- | -| msg | `IMessageIPFS` | message object | -| did | `string` | user DID | -| wallets | `string` | user wallets | -| profilePicture | `string` | user profile picture | -| publicKey | `string` | user public key | -| about | `string` | user description | -| threadhash | `string` | cid from the latest message sent on this conversation | -| intent | `string` | addresses concatenated from the users who have approved the intent | -| intentSentBy | `string` | address of the user who sent the intent | -| intentTimestamp | `number` | timestamp of the intent | -| combinedDID | `string` | concatenated addresses of the members of this chat (for DM the 2 addresses and from Group the addresses from all group members) | -| cid | `string` | content identifier on IPFS | -| chatId | `string` | chat identifier | -| groupInformation | `GroupDTO` | if group chat, all group information | + groupInformation: undefined, + }, +]; +``` + +| Parameter | Type | Description | +| ---------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| msg | `IMessageIPFS` | message object | +| did | `string` | user DID | +| wallets | `string` | user wallets | +| profilePicture | `string` | user profile picture | +| publicKey | `string` | user public key | +| about | `string` | user description | +| threadhash | `string` | cid from the latest message sent on this conversation | +| intent | `string` | addresses concatenated from the users who have approved the intent | +| intentSentBy | `string` | address of the user who sent the intent | +| intentTimestamp | `number` | timestamp of the intent | +| combinedDID | `string` | concatenated addresses of the members of this chat (for DM the 2 addresses and from Group the addresses from all group members) | +| cid | `string` | content identifier on IPFS | +| chatId | `string` | chat identifier | +| groupInformation | `GroupDTO` | if group chat, all group information | ------ +--- ### **Fetching conversation hash between two users** @@ -2630,11 +2526,11 @@ const conversationHash = await PushAPI.chat.conversationHash({ }); ``` -| Param | Type | Default | Remarks | -|----------|---------|---------|--------------------------------------------| -| account | string | - | user address | -| conversationId | string | - | receiver's address (partial CAIP) or chatId of a group| -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| +| Param | Type | Default | Remarks | +| -------------- | ------ | ------- | ------------------------------------------------------ | +| account | string | - | user address | +| conversationId | string | - | receiver's address (partial CAIP) or chatId of a group | +| env | string | 'prod' | API env - 'prod', 'staging', 'dev' | **Example:** @@ -2643,7 +2539,7 @@ const conversationHash = await PushAPI.chat.conversationHash({ const conversationHash = await PushAPI.chat.conversationHash({ account: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a', conversationId: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d', // receiver's address or chatId of a group - env: ENV.STAGING + env: ENV.STAGING, }); ``` @@ -2653,16 +2549,17 @@ const conversationHash = await PushAPI.chat.conversationHash({ ```typescript // PushAPI_chat_conversationHash | Response - 200 OK { - threadHash: 'bafyreign2egu7so7lf3gdicehyqjvghzmwn5gokh4fmp4oy3vjwrjk2rjy' + threadHash: 'bafyreign2egu7so7lf3gdicehyqjvghzmwn5gokh4fmp4oy3vjwrjk2rjy'; } ``` -| Param | Type | Default | Remarks | -|----------|---------|---------|--------------------------------------------| -| threadHash | string | - | message content identifier | +| Param | Type | Default | Remarks | +| ---------- | ------ | ------- | -------------------------- | +| threadHash | string | - | message content identifier | + ------ +--- ### **Fetching latest chat between two users** @@ -2676,13 +2573,13 @@ const chatHistory = await PushAPI.chat.latest({ }); ``` -| Param | Type | Remarks | -|----------|---------|--------------------------------------------| -| threadHash | string | message content identifier | -| toDecrypt | boolean | true if you want messages to be decrypted | -| pgpPrivateKey | string | PGP Private Key | -| account | string | user account | -| env | ENV | environment variable | +| Param | Type | Remarks | +| ------------- | ------- | ----------------------------------------- | +| threadHash | string | message content identifier | +| toDecrypt | boolean | true if you want messages to be decrypted | +| pgpPrivateKey | string | PGP Private Key | +| account | string | user account | +| env | ENV | environment variable | **Example:** @@ -2690,7 +2587,7 @@ const chatHistory = await PushAPI.chat.latest({ // pre-requisite API calls that should be made before // need to get user and through that encryptedPvtKey of the user const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging'); - + // need to decrypt the encryptedPvtKey to pass in the api using helper function const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer); @@ -2700,7 +2597,7 @@ const conversationHash = await PushAPI.chat.conversationHash({ conversationId: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d', // receiver's address or chatId of a group env: 'staging' }); - + // actual api const chatHistory = await PushAPI.chat.latest({ threadhash: conversationHash.threadHash, @@ -2724,63 +2621,35 @@ const chatHistory = await PushAPI.chat.latest({ fromDID: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d', sigType: 'pgp', toCAIP10: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a', - signature: '-----BEGIN PGP SIGNATURE-----\n' + - '\n' + - 'wsBzBAEBCAAnBQJjh5tjCRBaJmgmByp5FRYhBJC23yBJT2d/pTAID1omaCYH\n' + - 'KnkVAAAZmwf/buPLw6caSZmYnw6D3/p6HF1kWlkGUOTP4RasaU/6dkeDaZs9\n' + - 'SJlz2wC8oOpBGWHMJ/5n3ZWmU71E6U7IKIY793MyIv5t32vTNkwsRHUX7IIn\n' + - 'QFF+FzTIEtHHVTRlnkqNR2YUk1kqcpZCZWHfahi5W2d/WkXlFNdvyyFH4W8L\n' + - 'd03FGhOyXbWwU3xicBz5mSBpIFaaSCXl1SdgJDPXLSk3b65EEOjCOaiz85xC\n' + - 'G+6SW4RUzCGSDcOd9F2EXvvY5H9LgQNi1jjlZn6JrPTPJTJ+wXZXzcZmtOXG\n' + - 'EKcwvPbbPY9wd+gavRSOgYLYn5xoZQW/o3hW7AQlbC5Kj6js48Z0HQ==\n' + - '=qLiJ\n' + - '-----END PGP SIGNATURE-----\n', + signature: '-----BEGIN PGP SIGNATURE-----\n' + '\n' + 'wsBzBAEBCAAnBQJjh5tjCRBaJmgmByp5FRYhBJC23yBJT2d/pTAID1omaCYH\n' + 'KnkVAAAZmwf/buPLw6caSZmYnw6D3/p6HF1kWlkGUOTP4RasaU/6dkeDaZs9\n' + 'SJlz2wC8oOpBGWHMJ/5n3ZWmU71E6U7IKIY793MyIv5t32vTNkwsRHUX7IIn\n' + 'QFF+FzTIEtHHVTRlnkqNR2YUk1kqcpZCZWHfahi5W2d/WkXlFNdvyyFH4W8L\n' + 'd03FGhOyXbWwU3xicBz5mSBpIFaaSCXl1SdgJDPXLSk3b65EEOjCOaiz85xC\n' + 'G+6SW4RUzCGSDcOd9F2EXvvY5H9LgQNi1jjlZn6JrPTPJTJ+wXZXzcZmtOXG\n' + 'EKcwvPbbPY9wd+gavRSOgYLYn5xoZQW/o3hW7AQlbC5Kj6js48Z0HQ==\n' + '=qLiJ\n' + '-----END PGP SIGNATURE-----\n', timestamp: 1669831523684, fromCAIP10: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d', messageType: 'Text', messageContent: 'Hi', - encryptedSecret: '-----BEGIN PGP MESSAGE-----\n' + - '\n' + - 'wcBMA1fn1CNqxQ7nAQgArlo75qe54WerfRKFv1+F9j4NRMvSTgUztvIe51eg\n' + - 'd5MVuj6RYxKERr2bTuBt5cMDJMlNuTnBBkPe4L8+SlsI46L9wmXV9xLoZq1a\n' + - '94JdxD98RGMF99Jde/3hC/X6GS1yVqPpKPKdWx/tkOPeyqeO/wFF7kqShgIi\n' + - 'Wgq6hGz1fzD3GZhKGY0VSLuC3s0aUy/qw5En1Xd0uX0jdXBl07IIj8p1G2zx\n' + - '9BuVlksSK34yvIc0RQfCeRadMHkxbA0Hyj31Wrr+Y310YLTppL0s5bQR9APL\n' + - 'WHsIztJ1fHTnXsPhnA7YG0SQpHTyJhuX3rgBjxGrvbZBArmZ+R/Pq9IkOkJe\n' + - 'z8HATAMOsbaZjGN5JwEH/jYjLN6AFRWeaB5CSBSAF+CvHsUgadGmxTdSHBM6\n' + - 'LM9rfGg/MCnpRBuHckA0NNZh+wepq6TDA54ZopsdP14gHj4MKCdfqZr86Jft\n' + - 'ldtjeSgPTFEEJxPMJ4/Z3UeFU9rvOgfxX6l0eHWS0MYwJ3sVYvSyqqHir1K5\n' + - 'TRdEIgtQ3NvLTKkX4bKTSU+SInrvDA+wsc2BcBsbgNhRiGb+XYrbqXBshL1a\n' + - 'lIdpnomkAQgOZMO2n347uURYoruH3OtFeNABJ9D/nEU+LdhDOPGZPefvPBc5\n' + - 'BxK4ExKZ2Wo/TZw8lgC53uqOljsGV63Hp71LkyesKWu5/+vdVrYx/vU63shh\n' + - 'x/TSQAEiaFYEfkWSOthtH0nrJHhkY7FWgjp/1bj/J4J9HCQrVtt2WlQfhowZ\n' + - 'ILxhKk/vep0sJviM3SfJ4hPtoYpZESc=\n' + - '=43Ta\n' + - '-----END PGP MESSAGE-----\n' - } -] - -``` - -| Param | Type | Remarks | -|----------|---------|--------------------------------------------| -| `fromCAIP10` | string | sender address | -| `toCAIP10` | string | receiver address | -| `fromDID` | string | sender did | -| `toDID` | string | receiver did | -| `messageType` | string | message type | -| `messageContent` | string | message content | -| `signature` | string | signature of the message | -| `sigType` | string | signature type | -| `link` | string | content identifier of the previous messages | -| `timestamp` | number | timestamp of the message | -| `encType` | string | encryption type | -| `encryptedSecret` | string | encrypted secret | + encryptedSecret: '-----BEGIN PGP MESSAGE-----\n' + '\n' + 'wcBMA1fn1CNqxQ7nAQgArlo75qe54WerfRKFv1+F9j4NRMvSTgUztvIe51eg\n' + 'd5MVuj6RYxKERr2bTuBt5cMDJMlNuTnBBkPe4L8+SlsI46L9wmXV9xLoZq1a\n' + '94JdxD98RGMF99Jde/3hC/X6GS1yVqPpKPKdWx/tkOPeyqeO/wFF7kqShgIi\n' + 'Wgq6hGz1fzD3GZhKGY0VSLuC3s0aUy/qw5En1Xd0uX0jdXBl07IIj8p1G2zx\n' + '9BuVlksSK34yvIc0RQfCeRadMHkxbA0Hyj31Wrr+Y310YLTppL0s5bQR9APL\n' + 'WHsIztJ1fHTnXsPhnA7YG0SQpHTyJhuX3rgBjxGrvbZBArmZ+R/Pq9IkOkJe\n' + 'z8HATAMOsbaZjGN5JwEH/jYjLN6AFRWeaB5CSBSAF+CvHsUgadGmxTdSHBM6\n' + 'LM9rfGg/MCnpRBuHckA0NNZh+wepq6TDA54ZopsdP14gHj4MKCdfqZr86Jft\n' + 'ldtjeSgPTFEEJxPMJ4/Z3UeFU9rvOgfxX6l0eHWS0MYwJ3sVYvSyqqHir1K5\n' + 'TRdEIgtQ3NvLTKkX4bKTSU+SInrvDA+wsc2BcBsbgNhRiGb+XYrbqXBshL1a\n' + 'lIdpnomkAQgOZMO2n347uURYoruH3OtFeNABJ9D/nEU+LdhDOPGZPefvPBc5\n' + 'BxK4ExKZ2Wo/TZw8lgC53uqOljsGV63Hp71LkyesKWu5/+vdVrYx/vU63shh\n' + 'x/TSQAEiaFYEfkWSOthtH0nrJHhkY7FWgjp/1bj/J4J9HCQrVtt2WlQfhowZ\n' + 'ILxhKk/vep0sJviM3SfJ4hPtoYpZESc=\n' + '=43Ta\n' + '-----END PGP MESSAGE-----\n', + }, +]; +``` + +| Param | Type | Remarks | +| ----------------- | ------ | ------------------------------------------- | +| `fromCAIP10` | string | sender address | +| `toCAIP10` | string | receiver address | +| `fromDID` | string | sender did | +| `toDID` | string | receiver did | +| `messageType` | string | message type | +| `messageContent` | string | message content | +| `signature` | string | signature of the message | +| `sigType` | string | signature type | +| `link` | string | content identifier of the previous messages | +| `timestamp` | number | timestamp of the message | +| `encType` | string | encryption type | +| `encryptedSecret` | string | encrypted secret | ------ - +--- + ### **Fetching chat history between two users** ```typescript @@ -2797,14 +2666,14 @@ const chatHistory = await PushAPI.chat.history({ }); ``` -| Param | Type | Default | Remarks | -|----------|---------|---------|--------------------------------------------| -| account | string | - | user address | -| threadhash | string | - | conversation hash between two users | -| toDecrypt | boolean | false | if "true" the method will return decrypted message content in response| -| limit | number | 10 | number of messages between two users | -| pgpPrivateKey | string | null | mandatory for users having pgp keys| -| env | ENV | 'prod' | API env - 'prod', 'staging', 'dev'| +| Param | Type | Default | Remarks | +| ------------- | ------- | ------- | ---------------------------------------------------------------------- | +| account | string | - | user address | +| threadhash | string | - | conversation hash between two users | +| toDecrypt | boolean | false | if "true" the method will return decrypted message content in response | +| limit | number | 10 | number of messages between two users | +| pgpPrivateKey | string | null | mandatory for users having pgp keys | +| env | ENV | 'prod' | API env - 'prod', 'staging', 'dev' | **Example:** @@ -2812,7 +2681,7 @@ const chatHistory = await PushAPI.chat.history({ // pre-requisite API calls that should be made before // need to get user and through that encryptedPvtKey of the user const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging'); - + // need to decrypt the encryptedPvtKey to pass in the api using helper function const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer); @@ -2824,7 +2693,7 @@ const conversationHash = await PushAPI.chat.conversationHash({ conversationId: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d', // receiver's address or chatId of a group env: 'staging' }); - + // actual api const chatHistory = await PushAPI.chat.history({ threadhash: conversationHash.threadHash, @@ -2849,39 +2718,12 @@ const chatHistory = await PushAPI.chat.history({ fromDID: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d', sigType: 'pgp', toCAIP10: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a', - signature: '-----BEGIN PGP SIGNATURE-----\n' + - '\n' + - 'wsBzBAEBCAAnBQJjh5tjCRBaJmgmByp5FRYhBJC23yBJT2d/pTAID1omaCYH\n' + - 'KnkVAAAZmwf/buPLw6caSZmYnw6D3/p6HF1kWlkGUOTP4RasaU/6dkeDaZs9\n' + - 'SJlz2wC8oOpBGWHMJ/5n3ZWmU71E6U7IKIY793MyIv5t32vTNkwsRHUX7IIn\n' + - 'QFF+FzTIEtHHVTRlnkqNR2YUk1kqcpZCZWHfahi5W2d/WkXlFNdvyyFH4W8L\n' + - 'd03FGhOyXbWwU3xicBz5mSBpIFaaSCXl1SdgJDPXLSk3b65EEOjCOaiz85xC\n' + - 'G+6SW4RUzCGSDcOd9F2EXvvY5H9LgQNi1jjlZn6JrPTPJTJ+wXZXzcZmtOXG\n' + - 'EKcwvPbbPY9wd+gavRSOgYLYn5xoZQW/o3hW7AQlbC5Kj6js48Z0HQ==\n' + - '=qLiJ\n' + - '-----END PGP SIGNATURE-----\n', + signature: '-----BEGIN PGP SIGNATURE-----\n' + '\n' + 'wsBzBAEBCAAnBQJjh5tjCRBaJmgmByp5FRYhBJC23yBJT2d/pTAID1omaCYH\n' + 'KnkVAAAZmwf/buPLw6caSZmYnw6D3/p6HF1kWlkGUOTP4RasaU/6dkeDaZs9\n' + 'SJlz2wC8oOpBGWHMJ/5n3ZWmU71E6U7IKIY793MyIv5t32vTNkwsRHUX7IIn\n' + 'QFF+FzTIEtHHVTRlnkqNR2YUk1kqcpZCZWHfahi5W2d/WkXlFNdvyyFH4W8L\n' + 'd03FGhOyXbWwU3xicBz5mSBpIFaaSCXl1SdgJDPXLSk3b65EEOjCOaiz85xC\n' + 'G+6SW4RUzCGSDcOd9F2EXvvY5H9LgQNi1jjlZn6JrPTPJTJ+wXZXzcZmtOXG\n' + 'EKcwvPbbPY9wd+gavRSOgYLYn5xoZQW/o3hW7AQlbC5Kj6js48Z0HQ==\n' + '=qLiJ\n' + '-----END PGP SIGNATURE-----\n', timestamp: 1669831523684, fromCAIP10: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d', messageType: 'Text', messageContent: 'Hi', - encryptedSecret: '-----BEGIN PGP MESSAGE-----\n' + - '\n' + - 'wcBMA1fn1CNqxQ7nAQgArlo75qe54WerfRKFv1+F9j4NRMvSTgUztvIe51eg\n' + - 'd5MVuj6RYxKERr2bTuBt5cMDJMlNuTnBBkPe4L8+SlsI46L9wmXV9xLoZq1a\n' + - '94JdxD98RGMF99Jde/3hC/X6GS1yVqPpKPKdWx/tkOPeyqeO/wFF7kqShgIi\n' + - 'Wgq6hGz1fzD3GZhKGY0VSLuC3s0aUy/qw5En1Xd0uX0jdXBl07IIj8p1G2zx\n' + - '9BuVlksSK34yvIc0RQfCeRadMHkxbA0Hyj31Wrr+Y310YLTppL0s5bQR9APL\n' + - 'WHsIztJ1fHTnXsPhnA7YG0SQpHTyJhuX3rgBjxGrvbZBArmZ+R/Pq9IkOkJe\n' + - 'z8HATAMOsbaZjGN5JwEH/jYjLN6AFRWeaB5CSBSAF+CvHsUgadGmxTdSHBM6\n' + - 'LM9rfGg/MCnpRBuHckA0NNZh+wepq6TDA54ZopsdP14gHj4MKCdfqZr86Jft\n' + - 'ldtjeSgPTFEEJxPMJ4/Z3UeFU9rvOgfxX6l0eHWS0MYwJ3sVYvSyqqHir1K5\n' + - 'TRdEIgtQ3NvLTKkX4bKTSU+SInrvDA+wsc2BcBsbgNhRiGb+XYrbqXBshL1a\n' + - 'lIdpnomkAQgOZMO2n347uURYoruH3OtFeNABJ9D/nEU+LdhDOPGZPefvPBc5\n' + - 'BxK4ExKZ2Wo/TZw8lgC53uqOljsGV63Hp71LkyesKWu5/+vdVrYx/vU63shh\n' + - 'x/TSQAEiaFYEfkWSOthtH0nrJHhkY7FWgjp/1bj/J4J9HCQrVtt2WlQfhowZ\n' + - 'ILxhKk/vep0sJviM3SfJ4hPtoYpZESc=\n' + - '=43Ta\n' + - '-----END PGP MESSAGE-----\n' + encryptedSecret: '-----BEGIN PGP MESSAGE-----\n' + '\n' + 'wcBMA1fn1CNqxQ7nAQgArlo75qe54WerfRKFv1+F9j4NRMvSTgUztvIe51eg\n' + 'd5MVuj6RYxKERr2bTuBt5cMDJMlNuTnBBkPe4L8+SlsI46L9wmXV9xLoZq1a\n' + '94JdxD98RGMF99Jde/3hC/X6GS1yVqPpKPKdWx/tkOPeyqeO/wFF7kqShgIi\n' + 'Wgq6hGz1fzD3GZhKGY0VSLuC3s0aUy/qw5En1Xd0uX0jdXBl07IIj8p1G2zx\n' + '9BuVlksSK34yvIc0RQfCeRadMHkxbA0Hyj31Wrr+Y310YLTppL0s5bQR9APL\n' + 'WHsIztJ1fHTnXsPhnA7YG0SQpHTyJhuX3rgBjxGrvbZBArmZ+R/Pq9IkOkJe\n' + 'z8HATAMOsbaZjGN5JwEH/jYjLN6AFRWeaB5CSBSAF+CvHsUgadGmxTdSHBM6\n' + 'LM9rfGg/MCnpRBuHckA0NNZh+wepq6TDA54ZopsdP14gHj4MKCdfqZr86Jft\n' + 'ldtjeSgPTFEEJxPMJ4/Z3UeFU9rvOgfxX6l0eHWS0MYwJ3sVYvSyqqHir1K5\n' + 'TRdEIgtQ3NvLTKkX4bKTSU+SInrvDA+wsc2BcBsbgNhRiGb+XYrbqXBshL1a\n' + 'lIdpnomkAQgOZMO2n347uURYoruH3OtFeNABJ9D/nEU+LdhDOPGZPefvPBc5\n' + 'BxK4ExKZ2Wo/TZw8lgC53uqOljsGV63Hp71LkyesKWu5/+vdVrYx/vU63shh\n' + 'x/TSQAEiaFYEfkWSOthtH0nrJHhkY7FWgjp/1bj/J4J9HCQrVtt2WlQfhowZ\n' + 'ILxhKk/vep0sJviM3SfJ4hPtoYpZESc=\n' + '=43Ta\n' + '-----END PGP MESSAGE-----\n', }, { link: null, @@ -2895,43 +2737,44 @@ const chatHistory = await PushAPI.chat.history({ fromCAIP10: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a', messageType: 'Text', messageContent: 'Hey Fabio!', - encryptedSecret: '' - } -] -``` - -| Param | Type | Remarks | -|----------|---------|--------------------------------------------| -| `fromCAIP10` | string | sender address | -| `toCAIP10` | string | receiver address | -| `fromDID` | string | sender did | -| `toDID` | string | receiver did | -| `messageType` | string | message type | -| `messageContent` | string | message content | -| `signature` | string | signature of the message | -| `sigType` | string | signature type | -| `link` | string | content identifier of the previous messages | -| `timestamp` | number | timestamp of the message | -| `encType` | string | encryption type | -| `encryptedSecret` | string | encrypted secret | + encryptedSecret: '', + }, +]; +``` + +| Param | Type | Remarks | +| ----------------- | ------ | ------------------------------------------- | +| `fromCAIP10` | string | sender address | +| `toCAIP10` | string | receiver address | +| `fromDID` | string | sender did | +| `toDID` | string | receiver did | +| `messageType` | string | message type | +| `messageContent` | string | message content | +| `signature` | string | signature of the message | +| `sigType` | string | signature type | +| `link` | string | content identifier of the previous messages | +| `timestamp` | number | timestamp of the message | +| `encType` | string | encryption type | +| `encryptedSecret` | string | encrypted secret | ------ +--- ### **To send a message** + ```typescript // pre-requisite API calls that should be made before // need to get user and through that encryptedPvtKey of the user const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging'); - + // need to decrypt the encryptedPvtKey to pass in the api using helper function const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer); // actual api const response = await PushAPI.chat.send({ messageContent: "Gm gm! It's me... Mario", - messageType: 'Text', // can be "Text" | "Image" | "File" | "GIF" + messageType: 'Text', // can be "Text" | "Image" | "File" | "GIF" receiverAddress: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d', signer: _signer, pgpPrivateKey: pgpDecrpyptedPvtKey, @@ -2939,15 +2782,15 @@ const response = await PushAPI.chat.send({ }); ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| messageContent | string | '' | message to be sent | -| messageType | 'Text' | 'Image' | 'File' | 'GIF' | 'Text'| type of messageContent | -| receiverAddress* | string | - | user address or group chat id (Partial CAIP) | -| signer* | - | - | signer object | -| pgpPrivateKey | string | null | mandatory for users having pgp keys| -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| +| messageContent | string | '' | message to be sent | +| messageType | 'Text' | 'Image' | 'File' | 'GIF' | 'Text'| type of messageContent | +| receiverAddress_ | string | - | user address or group chat id (Partial CAIP) | +| signer\* | - | - | signer object | +| pgpPrivateKey | string | null | mandatory for users having pgp keys| +| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
Expected response (send chat message or chat request to a wallet) @@ -2971,28 +2814,30 @@ Allowed Options (params with * are mandatory) } ``` +
------ - +--- + ### **To approve a chat request** + ```typescript const response = await PushAPI.chat.approve({ status: 'Approved', account: '0x18C0Ab0809589c423Ac9eb42897258757b6b3d3d', - senderAddress : '0x873a538254f8162377296326BB3eDDbA7d00F8E9', // receiver's address or chatId of a group - env:'staging', + senderAddress: '0x873a538254f8162377296326BB3eDDbA7d00F8E9', // receiver's address or chatId of a group + env: 'staging', }); ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| status | 'Approved' | 'Approved' | flag for approving and rejecting chat request, supports only approving for now| -| senderAddress* | string | - | chat request sender's address or chatId of a group | -| signer* | - | - | signer object | -| pgpPrivateKey | string | null | mandatory for users having pgp keys| -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| +| status | 'Approved' | 'Approved' | flag for approving and rejecting chat request, supports only approving for now| +| senderAddress_ | string | - | chat request sender's address or chatId of a group | +| signer\* | - | - | signer object | +| pgpPrivateKey | string | null | mandatory for users having pgp keys| +| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
Expected response (approve chat request for a wallet / group chat id) @@ -3000,16 +2845,18 @@ Allowed Options (params with * are mandatory) ```typescript // PushAPI_chat_approve | Response - 204 OK ``` +
------ - +--- + ### **To create a group** + ```typescript // pre-requisite API calls that should be made before // need to get user and through that encryptedPvtKey of the user const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging'); - + // need to decrypt the encryptedPvtKey to pass in the api using helper function const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer); @@ -3027,19 +2874,18 @@ const response = await PushAPI.chat.createGroup({ }); ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| account* | string | - | user address | -| groupName* | string | - | group name | -| groupDescription* | string | - | group description | -| groupImage* | string | - | group image link | -| members* | Array | - | wallet addresses of all members except admins and groupCreator | -| admins* | Array | - | wallet addresses of all admins except members and groupCreator | -| isPublic* | boolean | - | true for public group, false for private group | -| pgpPrivateKey | string | null | mandatory for users having pgp keys| -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| - +| account_ | string | - | user address | +| groupName* | string | - | group name | +| groupDescription* | string | - | group description | +| groupImage* | string | - | group image link | +| members* | Array | - | wallet addresses of all members except admins and groupCreator | +| admins* | Array | - | wallet addresses of all admins except members and groupCreator | +| isPublic* | boolean | - | true for public group, false for private group | +| pgpPrivateKey | string | null | mandatory for users having pgp keys| +| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
Expected response (create group) @@ -3154,17 +3000,20 @@ Allowed Options (params with * are mandatory) ``` +
------ +--- ### **To update group details** + Note - updateGroup is an idompotent call + ```typescript // pre-requisite API calls that should be made before // need to get user and through that encryptedPvtKey of the user const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging'); - + // need to decrypt the encryptedPvtKey to pass in the api using helper function const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer); @@ -3182,35 +3031,34 @@ const response = await PushAPI.chat.updateGroup({ }); ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| chatId* | string | - | chatId of the group | -| account* | string | - | user address | -| groupName* | string | - | group name | -| groupDescription* | string | - | group description | -| groupImage* | string | - | group image link | -| members* | Array | - | wallet addresses of all members except admins and groupCreator | -| admins* | Array | - | wallet addresses of all admins except members and groupCreator | -| pgpPrivateKey | string | null | mandatory for users having pgp keys| -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| - - +| chatId_ | string | - | chatId of the group | +| account* | string | - | user address | +| groupName* | string | - | group name | +| groupDescription* | string | - | group description | +| groupImage* | string | - | group image link | +| members* | Array | - | wallet addresses of all members except admins and groupCreator | +| admins* | Array | - | wallet addresses of all admins except members and groupCreator | +| pgpPrivateKey | string | null | mandatory for users having pgp keys| +| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| + ### **To get group details by group name** ```typescript const response = await PushAPI.chat.getGroupByName({ - groupName: "Push Group Chat 3", + groupName: 'Push Group Chat 3', env: 'staging', }); ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| groupName* | string | - | name of the group | -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| - +| groupName_ | string | - | name of the group | +| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| +
Expected response (get group by name) @@ -3323,9 +3171,10 @@ Allowed Options (params with * are mandatory) } ``` +
------ +--- ### **To get group details by chatId** @@ -3336,11 +3185,11 @@ const response = await PushAPI.chat.getGroup({ }); ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| chatId* | string | - | group chat id | -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| +| chatId_ | string | - | group chat id | +| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
Expected response (get group by chat id) @@ -3453,17 +3302,20 @@ Allowed Options (params with * are mandatory) chatId: '870cbb20f0b116d5e461a154dc723dc1485976e97f61a673259698aa7f48371c' } ``` +
------ - +--- + ### **Chat Helper Utils** + #### **Decrypting messages** + ```typescript // pre-requisite API calls that should be made before // need to get user and through that encryptedPvtKey of the user const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging'); - + // need to decrypt the encryptedPvtKey to pass in the api using helper function const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer); @@ -3475,7 +3327,7 @@ const conversationHash = await PushAPI.chat.conversationHash({ conversationId: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d', // receiver's address or chatId of a group env: 'staging' }); - + // chat history but with decrypt helper so everything is encrypted const encryptedChats = await PushAPI.chat.history({ threadhash: conversationHash.threadHash, @@ -3485,7 +3337,7 @@ const encryptedChats = await PushAPI.chat.history({ pgpPrivateKey: pgpDecryptedPvtKey, env: 'staging', }); - + // actual api const decryptedChat = await PushAPI.chat.decryptConversation({ messages: encryptedChats, // array of message object fetched from chat.history method @@ -3495,14 +3347,14 @@ const decryptedChat = await PushAPI.chat.decryptConversation({ }); ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| messages* | string | - | array of message object fetched from chat.history method | -| connectedUser* | IUser | false | user meta data object| -| pgpPrivateKey | string | null | mandatory for users having pgp keys| -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| - +| messages_ | string | - | array of message object fetched from chat.history method | +| connectedUser\* | IUser | false | user meta data object| +| pgpPrivateKey | string | null | mandatory for users having pgp keys| +| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| +
Expected response (decrypt conversation) @@ -3517,39 +3369,12 @@ Allowed Options (params with * are mandatory) fromDID: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d', sigType: 'pgp', toCAIP10: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a', - signature: '-----BEGIN PGP SIGNATURE-----\n' + - '\n' + - 'wsBzBAEBCAAnBQJjh5tjCRBaJmgmByp5FRYhBJC23yBJT2d/pTAID1omaCYH\n' + - 'KnkVAAAZmwf/buPLw6caSZmYnw6D3/p6HF1kWlkGUOTP4RasaU/6dkeDaZs9\n' + - 'SJlz2wC8oOpBGWHMJ/5n3ZWmU71E6U7IKIY793MyIv5t32vTNkwsRHUX7IIn\n' + - 'QFF+FzTIEtHHVTRlnkqNR2YUk1kqcpZCZWHfahi5W2d/WkXlFNdvyyFH4W8L\n' + - 'd03FGhOyXbWwU3xicBz5mSBpIFaaSCXl1SdgJDPXLSk3b65EEOjCOaiz85xC\n' + - 'G+6SW4RUzCGSDcOd9F2EXvvY5H9LgQNi1jjlZn6JrPTPJTJ+wXZXzcZmtOXG\n' + - 'EKcwvPbbPY9wd+gavRSOgYLYn5xoZQW/o3hW7AQlbC5Kj6js48Z0HQ==\n' + - '=qLiJ\n' + - '-----END PGP SIGNATURE-----\n', + signature: '-----BEGIN PGP SIGNATURE-----\n' + '\n' + 'wsBzBAEBCAAnBQJjh5tjCRBaJmgmByp5FRYhBJC23yBJT2d/pTAID1omaCYH\n' + 'KnkVAAAZmwf/buPLw6caSZmYnw6D3/p6HF1kWlkGUOTP4RasaU/6dkeDaZs9\n' + 'SJlz2wC8oOpBGWHMJ/5n3ZWmU71E6U7IKIY793MyIv5t32vTNkwsRHUX7IIn\n' + 'QFF+FzTIEtHHVTRlnkqNR2YUk1kqcpZCZWHfahi5W2d/WkXlFNdvyyFH4W8L\n' + 'd03FGhOyXbWwU3xicBz5mSBpIFaaSCXl1SdgJDPXLSk3b65EEOjCOaiz85xC\n' + 'G+6SW4RUzCGSDcOd9F2EXvvY5H9LgQNi1jjlZn6JrPTPJTJ+wXZXzcZmtOXG\n' + 'EKcwvPbbPY9wd+gavRSOgYLYn5xoZQW/o3hW7AQlbC5Kj6js48Z0HQ==\n' + '=qLiJ\n' + '-----END PGP SIGNATURE-----\n', timestamp: 1669831523684, fromCAIP10: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d', messageType: 'Text', messageContent: 'Hi', - encryptedSecret: '-----BEGIN PGP MESSAGE-----\n' + - '\n' + - 'wcBMA1fn1CNqxQ7nAQgArlo75qe54WerfRKFv1+F9j4NRMvSTgUztvIe51eg\n' + - 'd5MVuj6RYxKERr2bTuBt5cMDJMlNuTnBBkPe4L8+SlsI46L9wmXV9xLoZq1a\n' + - '94JdxD98RGMF99Jde/3hC/X6GS1yVqPpKPKdWx/tkOPeyqeO/wFF7kqShgIi\n' + - 'Wgq6hGz1fzD3GZhKGY0VSLuC3s0aUy/qw5En1Xd0uX0jdXBl07IIj8p1G2zx\n' + - '9BuVlksSK34yvIc0RQfCeRadMHkxbA0Hyj31Wrr+Y310YLTppL0s5bQR9APL\n' + - 'WHsIztJ1fHTnXsPhnA7YG0SQpHTyJhuX3rgBjxGrvbZBArmZ+R/Pq9IkOkJe\n' + - 'z8HATAMOsbaZjGN5JwEH/jYjLN6AFRWeaB5CSBSAF+CvHsUgadGmxTdSHBM6\n' + - 'LM9rfGg/MCnpRBuHckA0NNZh+wepq6TDA54ZopsdP14gHj4MKCdfqZr86Jft\n' + - 'ldtjeSgPTFEEJxPMJ4/Z3UeFU9rvOgfxX6l0eHWS0MYwJ3sVYvSyqqHir1K5\n' + - 'TRdEIgtQ3NvLTKkX4bKTSU+SInrvDA+wsc2BcBsbgNhRiGb+XYrbqXBshL1a\n' + - 'lIdpnomkAQgOZMO2n347uURYoruH3OtFeNABJ9D/nEU+LdhDOPGZPefvPBc5\n' + - 'BxK4ExKZ2Wo/TZw8lgC53uqOljsGV63Hp71LkyesKWu5/+vdVrYx/vU63shh\n' + - 'x/TSQAEiaFYEfkWSOthtH0nrJHhkY7FWgjp/1bj/J4J9HCQrVtt2WlQfhowZ\n' + - 'ILxhKk/vep0sJviM3SfJ4hPtoYpZESc=\n' + - '=43Ta\n' + - '-----END PGP MESSAGE-----\n' + encryptedSecret: '-----BEGIN PGP MESSAGE-----\n' + '\n' + 'wcBMA1fn1CNqxQ7nAQgArlo75qe54WerfRKFv1+F9j4NRMvSTgUztvIe51eg\n' + 'd5MVuj6RYxKERr2bTuBt5cMDJMlNuTnBBkPe4L8+SlsI46L9wmXV9xLoZq1a\n' + '94JdxD98RGMF99Jde/3hC/X6GS1yVqPpKPKdWx/tkOPeyqeO/wFF7kqShgIi\n' + 'Wgq6hGz1fzD3GZhKGY0VSLuC3s0aUy/qw5En1Xd0uX0jdXBl07IIj8p1G2zx\n' + '9BuVlksSK34yvIc0RQfCeRadMHkxbA0Hyj31Wrr+Y310YLTppL0s5bQR9APL\n' + 'WHsIztJ1fHTnXsPhnA7YG0SQpHTyJhuX3rgBjxGrvbZBArmZ+R/Pq9IkOkJe\n' + 'z8HATAMOsbaZjGN5JwEH/jYjLN6AFRWeaB5CSBSAF+CvHsUgadGmxTdSHBM6\n' + 'LM9rfGg/MCnpRBuHckA0NNZh+wepq6TDA54ZopsdP14gHj4MKCdfqZr86Jft\n' + 'ldtjeSgPTFEEJxPMJ4/Z3UeFU9rvOgfxX6l0eHWS0MYwJ3sVYvSyqqHir1K5\n' + 'TRdEIgtQ3NvLTKkX4bKTSU+SInrvDA+wsc2BcBsbgNhRiGb+XYrbqXBshL1a\n' + 'lIdpnomkAQgOZMO2n347uURYoruH3OtFeNABJ9D/nEU+LdhDOPGZPefvPBc5\n' + 'BxK4ExKZ2Wo/TZw8lgC53uqOljsGV63Hp71LkyesKWu5/+vdVrYx/vU63shh\n' + 'x/TSQAEiaFYEfkWSOthtH0nrJHhkY7FWgjp/1bj/J4J9HCQrVtt2WlQfhowZ\n' + 'ILxhKk/vep0sJviM3SfJ4hPtoYpZESc=\n' + '=43Ta\n' + '-----END PGP MESSAGE-----\n', }, { link: null, @@ -3563,61 +3388,75 @@ Allowed Options (params with * are mandatory) fromCAIP10: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a', messageType: 'Text', messageContent: 'Hey Fabio!', - encryptedSecret: '' - } -] + encryptedSecret: '', + }, +]; ``` +
------ +--- ## For Video ### **Instance Variables** + #### **peerInstance** + - Used to store the simple peer instance used for the webRTC connection. + ```typescript private peerInstance: any = null; ``` ------ +--- #### **signer** + - Used to store the signer of a user. - Used in the request, acceptRequest and disconnect methods to send notifications. + ```typescript private signer: SignerType; ``` ------ +--- #### **chainId** + The chain id of the chain on which the call is being conducted. + ```typescript private chainId: number; ``` ------ +--- #### **pgpPrivateKey** + - Used to store the PGP private key of a user. - Used in the request, acceptRequest and disconnect methods to send notifications. + ```typescript private pgpPrivateKey: string; ``` ------ +--- #### **env** + - The environment on which the call is being conducted. + ```typescript private env: ENV; ``` ------ +--- ### **data** + - Stores data related to the video call. + ```typescript export type IMediaStream = MediaStream | null; @@ -3665,10 +3504,12 @@ export type VideoCallData = { private data: VideoCallData; ``` ------ +--- #### **setData** -- This function can be used to update the video call ```data``` + +- This function can be used to update the video call `data` + ```typescript setData: (fn: (data: VideoCallData) => VideoCallData) => void; @@ -3684,10 +3525,12 @@ setData((oldData) => { }); ``` ------ +--- ### **Methods** + #### **constructor** + ```typescript constructor({ signer, @@ -3704,20 +3547,22 @@ constructor({ }) {} ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| signer* | SignerType | - | signer object for a user | -| chainId* | number | - | chainId for the video call - Eth Mainnet: 1, Polygon Mainnet: 137 | -| pgpPrivatekey* | string | - | PGP private key of the user, used while sending video call notifications | -| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| -| setData* | ```(fn: (data: VideoCallData) => VideoCallData) => void``` | - | Function to update video call data | +| signer_ | SignerType | - | signer object for a user | +| chainId* | number | - | chainId for the video call - Eth Mainnet: 1, Polygon Mainnet: 137 | +| pgpPrivatekey* | string | - | PGP private key of the user, used while sending video call notifications | +| env | string | 'prod' | API env - 'prod', 'staging', 'dev'| +| setData\* | `(fn: (data: VideoCallData) => VideoCallData) => void` | - | Function to update video call data | ------ +--- #### **create** + - This method is used to create a local stream -- Assigns the local stream obtained from the ```navigator.mediaDevices.getUserMedia``` to `data.local.stream` state. +- Assigns the local stream obtained from the `navigator.mediaDevices.getUserMedia` to `data.local.stream` state. + ```typescript export type VideoCreateInputOptions = { video?: boolean; @@ -3727,19 +3572,21 @@ export type VideoCreateInputOptions = { async create(options: VideoCreateInputOptions): Promise {} ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with \* are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| video | boolean | true | video status for the local stream | -| audio | boolean | true | audio status for the local stream | +| video | boolean | true | video status for the local stream | +| audio | boolean | true | audio status for the local stream | Note - If audio, video aren't enabled in create() then they wont be available during the call respectively. ------ +--- #### **request** + - This method is used to request a push video call. - Will be triggered on the initiator's end. + ```typescript export type VideoRequestInputOptions = { senderAddress: string; @@ -3752,21 +3599,22 @@ export type VideoRequestInputOptions = { async request(options: VideoRequestInputOptions): Promise {} ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| senderAddress* | string | - | Local peer address | -| recipientAddress* | string | - | Incoming/remote peer address | -| chatId* | string | - | Unique identifier for every wallet-to-wallet push chat, will be used during verification proof generation | -| onReceiveMessage | ```(message: string) => void``` | ```(message: string) => {console.log('received a meesage', message);}``` | Function which will be called when the sender receives a message via webRTC data channel | +| senderAddress_ | string | - | Local peer address | +| recipientAddress* | string | - | Incoming/remote peer address | +| chatId* | string | - | Unique identifier for every wallet-to-wallet push chat, will be used during verification proof generation | +| onReceiveMessage | `(message: string) => void` | `(message: string) => {console.log('received a meesage', message);}` | Function which will be called when the sender receives a message via webRTC data channel | | retry | boolean | false | If we are retrying the call, only for internal use | - ------ +--- #### **acceptRequest** + - This method is used to accept a push video call. - Will be triggered on the receiver's end. + ```typescript export type VideoAcceptRequestInputOptions = { signalData: any; @@ -3780,21 +3628,23 @@ export type VideoAcceptRequestInputOptions = { async acceptRequest(options: VideoAcceptRequestInputOptions): Promise {} ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| signalData* | any | - | Signal data received from the initiator peer via psuh notification upon call request | -| senderAddress* | string | - | Local peer address | -| recipientAddress* | string | - | Incoming/remote peer address | -| chatId* | string | - | Unique identifier for every wallet-to-wallet push chat, will be used during verification proof generation | -| onReceiveMessage | ```(message: string) => void``` | ```(message: string) => {console.log('received a meesage', message);}``` | Function which will be called when the sender receives a message via webRTC data channel | +| signalData_ | any | - | Signal data received from the initiator peer via psuh notification upon call request | +| senderAddress* | string | - | Local peer address | +| recipientAddress* | string | - | Incoming/remote peer address | +| chatId\* | string | - | Unique identifier for every wallet-to-wallet push chat, will be used during verification proof generation | +| onReceiveMessage | `(message: string) => void` | `(message: string) => {console.log('received a meesage', message);}` | Function which will be called when the sender receives a message via webRTC data channel | | retry | boolean | false | If we are retrying the call, only for internal use | ------ +--- #### **connect** + - This is the final method which is used to connect a push video call. - Will be triggered on the initiator's end. + ```typescript export type VideoConnectInputOptions = { signalData: any; @@ -3803,71 +3653,82 @@ export type VideoConnectInputOptions = { connect(options: VideoConnectInputOptions): void {} ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with _ are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| -| signalData* | any | - | Signal data received from the receiver peer via push notification upon call acceptRequest | +| signalData_ | any | - | Signal data received from the receiver peer via push notification upon call acceptRequest | ------ +--- #### **disconnect** + - This method is used to end a push video call. - Can be triggered on the initiator as well as receivers end. + ```typescript disconnect(): void {} ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with \* are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| | - | - | - | - | ------ +--- #### **enableVideo** -- This method is used to enable/disable the video (from ```data.local.stream```) for a push video call. + +- This method is used to enable/disable the video (from `data.local.stream`) for a push video call. - Can be triggered on the initiator as well as receivers end. -- **Note -** If video was not enabled during ```create()``` then it will always remain off. + <<<<<<< HEAD +- # **Note -** If video was not enabled during `create()` then it will always remain off. +- **Note -** If video was not enabled during `create()` then it will always remain off. + > > > > > > > main ```typescript export type EnableVideoInputOptions = { state: boolean; } - + enableVideo(options: EnableVideoInputOptions): void ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with \* are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| | state | boolean | - | true for enable and false for disable | ------ +--- #### **enableAudio** -- This method is used to enable/disable the audio (from ```data.local.stream```) for a push video call. + +- This method is used to enable/disable the audio (from `data.local.stream`) for a push video call. - Can be triggered on the initiator as well as receivers end. -- **Note -** If audio was not enabled during ```create()``` then it will always remain off. + <<<<<<< HEAD +- # **Note -** If audio was not enabled during `create()` then it will always remain off. +- **Note -** If audio was not enabled during `create()` then it will always remain off. + > > > > > > > main ```typescript export type EnableAudioInputOptions = { state: boolean; -} - +} + enableAudio(options: EnableAudioInputOptions): void ``` -Allowed Options (params with * are mandatory) -| Param | Type | Default | Remarks | +Allowed Options (params with \* are mandatory) +| Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| | state | boolean | - | true for enable and false for disable | ------ +--- #### **isInitiator** + - This method is used to tell if the current peer is the initator of the push video call or not. - Can be triggered on the initiator as well as receivers end. ```typescript isInitiator(): boolean -``` \ No newline at end of file +``` diff --git a/packages/restapi/src/lib/chat/helpers/crypto.ts b/packages/restapi/src/lib/chat/helpers/crypto.ts index 2e04ad277..a62037d3e 100644 --- a/packages/restapi/src/lib/chat/helpers/crypto.ts +++ b/packages/restapi/src/lib/chat/helpers/crypto.ts @@ -194,9 +194,6 @@ export const getEncryptedRequest = async ( user: receiverAddress, publicKey: '', encryptedPrivateKey: '', - encryptionType: '', - signature: 'pgp', - sigType: 'pgp', env, }); // If the user is being created here, that means that user don't have a PGP keys. So this intent will be in plaintext diff --git a/packages/restapi/src/lib/chat/helpers/service.ts b/packages/restapi/src/lib/chat/helpers/service.ts index 150512c2d..e0f5863a2 100644 --- a/packages/restapi/src/lib/chat/helpers/service.ts +++ b/packages/restapi/src/lib/chat/helpers/service.ts @@ -14,18 +14,13 @@ import { walletType, } from '../../types'; import { getEip191Signature } from './crypto'; +import { populateDeprecatedUser } from '../../utils/populateIUser'; type CreateUserOptionsType = { user: string; wallet?: walletType; - name?: string; - nftOwner?: string | null; - encryptedPassword?: string | null; publicKey?: string; encryptedPrivateKey?: string; - encryptionType?: string; - signature?: string; - sigType?: string; env?: ENV; }; @@ -34,16 +29,13 @@ export const createUserService = async (options: CreateUserOptionsType) => { wallet, publicKey = '', encryptedPrivateKey = '', - encryptionType = '', env = Constants.ENV.PROD, - encryptedPassword = null, - nftOwner = null, } = options || {}; let { user } = options || {}; const API_BASE_URL = getAPIBaseUrls(env); - const requestUrl = `${API_BASE_URL}/v1/users/`; + const requestUrl = `${API_BASE_URL}/v2/users/`; if (isValidCAIP10NFTAddress(user)) { const epoch = Math.floor(Date.now() / 1000); @@ -56,33 +48,14 @@ export const createUserService = async (options: CreateUserOptionsType) => { did: walletToPCAIP10(user), publicKey, encryptedPrivateKey, - - // DEPRECATED in eip191v2 - - // encryptionType, - // name: '', - // encryptedPassword: encryptedPassword, - // nftOwner: nftOwner ? nftOwner.toLowerCase() : nftOwner, }; const hash = generateHash(data); const signatureObj = await getEip191Signature(wallet!, hash, 'v2'); - // NOTE - To be removed after backend route changes - const updatedData = { - caip10: walletToPCAIP10(user), - did: walletToPCAIP10(user), - publicKey, - encryptedPrivateKey, - encryptionType, - name: '', - encryptedPassword: encryptedPassword, - nftOwner: nftOwner ? nftOwner.toLowerCase() : nftOwner, - }; - const body = { - ...updatedData, + ...data, ...signatureObj, }; @@ -91,12 +64,11 @@ export const createUserService = async (options: CreateUserOptionsType) => { .then((response) => { if (response.data) response.data.publicKey = verifyPGPPublicKey( - response.data.encryptionType, + response.data.encryptedPrivateKey, response.data.publicKey, - response.data.did, - response.data.nftOwner + response.data.did ); - return response.data; + return populateDeprecatedUser(response.data); }) .catch((err) => { console.error(`[Push SDK] - API ${requestUrl}: `, err); @@ -110,62 +82,37 @@ export const authUpdateUserService = async (options: CreateUserOptionsType) => { wallet, publicKey = '', encryptedPrivateKey = '', - encryptionType = '', - name = '', - encryptedPassword = null, - nftOwner = null, env = Constants.ENV.PROD, } = options || {}; const API_BASE_URL = getAPIBaseUrls(env); - const requestUrl = `${API_BASE_URL}/v1/users/${walletToPCAIP10(user)}/auth`; + const requestUrl = `${API_BASE_URL}/v2/users/${walletToPCAIP10(user)}/auth`; const data = { caip10: walletToPCAIP10(user), did: walletToPCAIP10(user), publicKey, encryptedPrivateKey, - - // DEPRECATED in eip191v2 - - // encryptionType, - // name, - // encryptedPassword, - // nftOwner: nftOwner ? nftOwner.toLowerCase() : nftOwner, }; const hash = generateHash(data); const signatureObj = await getEip191Signature(wallet!, hash, 'v2'); - // NOTE - To be removed after backend route changes - const updatedData = { - caip10: walletToPCAIP10(user), - publicKey, - encryptedPrivateKey, - encryptionType, - name, - encryptedPassword, - nftOwner: nftOwner ? nftOwner.toLowerCase() : nftOwner, - }; - - const body = { - ...updatedData, - ...signatureObj, - }; + // Exclude the "did" property from the "body" object + const { did, ...body } = { ...data, ...signatureObj }; return axios .put(requestUrl, body) .then((response) => { if (response.data) response.data.publicKey = verifyPGPPublicKey( - response.data.encryptionType, + response.data.encryptedPrivateKey, response.data.publicKey, - response.data.did, - response.data.nftOwner + response.data.did ); - return response.data; + return populateDeprecatedUser(response.data); }) .catch((err) => { console.error(`[Push SDK] - API ${requestUrl}: `, err); diff --git a/packages/restapi/src/lib/chat/helpers/signature.ts b/packages/restapi/src/lib/chat/helpers/signature.ts index 064b36c5e..96371baa0 100644 --- a/packages/restapi/src/lib/chat/helpers/signature.ts +++ b/packages/restapi/src/lib/chat/helpers/signature.ts @@ -85,8 +85,7 @@ export const getTypedData = ( export const verifyProfileSignature = ( verificationProof: string, signedData: string, - address: string, - nftOwner: string + address: string ): boolean => { const SIG_TYPE_V2 = 'eip712v2'; const SIG_TYPE_V3 = 'eip191'; @@ -138,10 +137,7 @@ export const verifyProfileSignature = ( hashMessage(signedData), signature ); - if ( - recoveredAddress.toLowerCase() === address.toLowerCase() || - recoveredAddress.toLowerCase() === nftOwner.toLowerCase() - ) { + if (recoveredAddress.toLowerCase() === address.toLowerCase()) { return true; } else return false; } diff --git a/packages/restapi/src/lib/chat/index.ts b/packages/restapi/src/lib/chat/index.ts index 64c53e6be..8588cabd3 100644 --- a/packages/restapi/src/lib/chat/index.ts +++ b/packages/restapi/src/lib/chat/index.ts @@ -2,14 +2,13 @@ export * from './chats'; export * from './chat'; export * from './requests'; export * from './send'; -export * from "./conversationHash"; +export * from './conversationHash'; export * from './approveRequest'; -export * from './updateUser'; export * from './historicalMessages'; export * from './latestMessage'; -export { decryptWithWalletRPCMethod } from "../helpers/crypto"; -export { decryptPGPKey } from "../helpers/crypto"; -export { decryptConversation } from "./helpers"; +export { decryptWithWalletRPCMethod } from '../helpers/crypto'; +export { decryptPGPKey } from '../helpers/crypto'; +export { decryptConversation } from './helpers'; export * from './helpers/payloadHelper'; export * from './createGroup'; export * from './updateGroup'; diff --git a/packages/restapi/src/lib/chat/updateUser.ts b/packages/restapi/src/lib/chat/updateUser.ts deleted file mode 100644 index f6fd42ace..000000000 --- a/packages/restapi/src/lib/chat/updateUser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import axios from 'axios'; -import { getAPIBaseUrls } from '../helpers'; -import Constants, { ENV } from '../constants'; -import { IUser } from '../types'; - -export type ChatUpdateUserOptionsType = { - user: string; - profilePictureCID?: string; - name?: string; - env?: ENV; -}; - -export const updateUser = async ( - options: ChatUpdateUserOptionsType -): Promise => { - const { - user, - profilePictureCID = '', - name = '', - env = Constants.ENV.PROD, - } = options || {}; - - const API_BASE_URL = getAPIBaseUrls(env); - const apiEndpoint = `${API_BASE_URL}/v1/w2w/users/${user}`; - const body = { - caip10: user, - profilePictureCID, - name, - }; - - return axios - .put(apiEndpoint, body) - .then((response) => { - return response.data; - }) - .catch((err) => { - console.error(`[Push SDK] - API ${updateUser.name}: `, err); - throw Error(`[Push SDK] - API ${updateUser.name}: ${err}`); - }); -}; diff --git a/packages/restapi/src/lib/helpers/crypto.ts b/packages/restapi/src/lib/helpers/crypto.ts index 6d04cc5c8..6c6aef706 100644 --- a/packages/restapi/src/lib/helpers/crypto.ts +++ b/packages/restapi/src/lib/helpers/crypto.ts @@ -23,7 +23,11 @@ import { IMessageIPFS, ProgressHookType, } from '../types'; -import { isValidETHAddress, pCAIP10ToWallet } from './address'; +import { + isValidCAIP10NFTAddress, + isValidETHAddress, + pCAIP10ToWallet, +} from './address'; import { verifyProfileSignature } from '../chat/helpers/signature'; import { upgrade } from '../user/upgradeUser'; @@ -575,30 +579,35 @@ export const preparePGPPublicKey = async ( }; export const verifyPGPPublicKey = ( - encryptionType: string, + encryptedPrivateKey: string, publicKey: string, - did: string, - nftOwner: string + did: string ): string => { - if (encryptionType && encryptionType !== Constants.ENC_TYPE_V1) { - const { key, signature: verificationProof } = JSON.parse(publicKey); - publicKey = key; - let signedData: string; - if (encryptionType === Constants.ENC_TYPE_V2) - signedData = 'Create Push Chat Profile \n' + generateHash(key); - else signedData = 'Create Push Profile \n' + generateHash(key); - if ( - verifyProfileSignature( - verificationProof, - signedData, - pCAIP10ToWallet(did), - nftOwner ? pCAIP10ToWallet(nftOwner) : nftOwner + try { + if (publicKey !== '' && publicKey.includes('signature')) { + const { key, signature: verificationProof } = JSON.parse(publicKey); + publicKey = key; + let signedData: string; + if (verificationProof.includes('eip712')) + signedData = 'Create Push Chat Profile \n' + generateHash(key); + else signedData = 'Create Push Profile \n' + generateHash(key); + if ( + verifyProfileSignature( + verificationProof, + signedData, + isValidCAIP10NFTAddress(did) + ? pCAIP10ToWallet(JSON.parse(encryptedPrivateKey).owner) + : pCAIP10ToWallet(did) + ) ) - ) - return publicKey; - else throw new Error('Cannot verify Encryption Keys for this user'); + return publicKey; + else throw new Error('Cannot Verify this publicKey Owner!!!'); + } + return publicKey; + } catch (err) { + console.warn('Cannot Verify this publicKey Owner!!!'); + return publicKey; } - return publicKey; }; export const validatePssword = (password: string) => { diff --git a/packages/restapi/src/lib/types/index.ts b/packages/restapi/src/lib/types/index.ts index a0cf03047..f95ae8394 100644 --- a/packages/restapi/src/lib/types/index.ts +++ b/packages/restapi/src/lib/types/index.ts @@ -169,21 +169,67 @@ export interface IFeeds { deprecatedCode?: string; // scope only at sdk level } export interface IUser { + msgSent: number; + maxMsgPersisted: number; did: string; wallets: string; - profilePicture: string | null; - publicKey: string; + profile: { + name: string | null; + desc: string | null; + picture: string | null; + profileVerificationProof: string | null; + }; encryptedPrivateKey: string; + publicKey: string; + verificationProof: string; + + /** + * @deprecated Use `profile.name` instead. + */ + name: string | null; + /** + * @deprecated Use `profile.desc` instead. + */ + about: string | null; + /** + * @deprecated Use `profile.picture` instead. + */ + profilePicture: string | null; + /** + * @deprecated Use `msgSent` instead. + */ + numMsg: number; + /** + * @deprecated Use `maxMsgPersisted` instead. + */ + allowedNumMsg: number; + /** + * @deprecated Use `encryptedPrivateKey.version` instead. + */ encryptionType: string; + /** + * @deprecated Use `verificationProof` instead. + */ signature: string; + /** + * @deprecated Use `verificationProof` instead. + */ sigType: string; - about: string | null; - name: string | null; + /** + * @deprecated Use `encryptedPrivateKey.encryptedPassword` instead. + */ encryptedPassword: string | null; + /** + * @deprecated + */ nftOwner: string | null; - numMsg: number; - allowedNumMsg: number; + /** + * @deprecated Not recommended to be used anywhere + */ linkedListHash?: string | null; + /** + * @deprecated Not recommended to be used anywhere + */ nfts?: [] | null; } diff --git a/packages/restapi/src/lib/user/auth.updateUser.ts b/packages/restapi/src/lib/user/auth.updateUser.ts index 9e8d564e5..c94679a7a 100644 --- a/packages/restapi/src/lib/user/auth.updateUser.ts +++ b/packages/restapi/src/lib/user/auth.updateUser.ts @@ -133,15 +133,8 @@ export const update = async (options: AuthUpdateProps): Promise => { const body = { user: user.did, wallet, - name: user.name ? user.name : '', - encryptedPassword: null, - nftOwner: - pgpEncryptionVersion === ENCRYPTION_TYPE.NFTPGP_V1 - ? walletToPCAIP10((await signer?.getAddress()) as string) - : null, // check for nft, publicKey: signedPublicKey, encryptedPrivateKey: JSON.stringify(encryptedPgpPrivateKey), - encryptionType: pgpEncryptionVersion, env, }; diff --git a/packages/restapi/src/lib/user/createUser.ts b/packages/restapi/src/lib/user/createUser.ts index b3256ed00..1681c7758 100644 --- a/packages/restapi/src/lib/user/createUser.ts +++ b/packages/restapi/src/lib/user/createUser.ts @@ -131,12 +131,7 @@ export const create = async (options: CreateUserProps): Promise => { wallet, publicKey: publicKey, encryptedPrivateKey: JSON.stringify(encryptedPrivateKey), - encryptionType: encryptionType, env, - nftOwner: - encryptionType === Constants.ENC_TYPE_V4 - ? walletToPCAIP10((await signer?.getAddress()) as string) - : null, // check for nft }; // Report Progress diff --git a/packages/restapi/src/lib/user/getUser.ts b/packages/restapi/src/lib/user/getUser.ts index 7bf82296d..67dfefd9b 100644 --- a/packages/restapi/src/lib/user/getUser.ts +++ b/packages/restapi/src/lib/user/getUser.ts @@ -3,6 +3,7 @@ import { AccountEnvOptionsType, IUser } from '../types'; import { isValidETHAddress, walletToPCAIP10 } from '../helpers/address'; import { getAPIBaseUrls, verifyPGPPublicKey } from '../helpers'; import Constants from '../constants'; +import { populateDeprecatedUser } from '../utils/populateIUser'; export const get = async (options: AccountEnvOptionsType): Promise => { const { account, env = Constants.ENV.PROD } = options || {}; @@ -11,18 +12,18 @@ export const get = async (options: AccountEnvOptionsType): Promise => { } const caip10 = walletToPCAIP10(account); const API_BASE_URL = getAPIBaseUrls(env); - const requestUrl = `${API_BASE_URL}/v1/users/?caip10=${caip10}`; + const requestUrl = `${API_BASE_URL}/v2/users/?caip10=${caip10}`; return axios .get(requestUrl) .then((response) => { - if (response.data) + if (response.data) { response.data.publicKey = verifyPGPPublicKey( - response.data.encryptionType, + response.data.encryptedPrivateKey, response.data.publicKey, - response.data.did, - response.data.nftOwner + response.data.did ); - return response.data; + } + return populateDeprecatedUser(response.data); }) .catch((err) => { console.error(`[Push SDK] - API ${requestUrl}: `, err); diff --git a/packages/restapi/src/lib/user/getUsersBatch.ts b/packages/restapi/src/lib/user/getUsersBatch.ts index 976402832..8997ca348 100644 --- a/packages/restapi/src/lib/user/getUsersBatch.ts +++ b/packages/restapi/src/lib/user/getUsersBatch.ts @@ -3,6 +3,7 @@ import { IUser } from '../types'; import { isValidETHAddress, walletToPCAIP10 } from '../helpers/address'; import { getAPIBaseUrls, verifyPGPPublicKey } from '../helpers'; import Constants, { ENV } from '../constants'; +import { populateDeprecatedUser } from '../utils/populateIUser'; export interface GetBatchType { userIds: string[]; @@ -13,7 +14,7 @@ export const getBatch = async (options: GetBatchType): Promise => { const { env = Constants.ENV.PROD, userIds } = options || {}; const API_BASE_URL = getAPIBaseUrls(env); - const requestUrl = `${API_BASE_URL}/v1/users/batch`; + const requestUrl = `${API_BASE_URL}/v2/users/batch`; const MAX_USER_IDS_LENGTH = 100; if (userIds.length > MAX_USER_IDS_LENGTH) { @@ -36,10 +37,13 @@ export const getBatch = async (options: GetBatchType): Promise => { .then((response) => { response.data.users.forEach((user: any, index: number) => { response.data.users[index].publicKey = verifyPGPPublicKey( - user.encryptionType, + user.encryptedPrivateKey, user.publicKey, - user.did, - user.nftOwner + user.did + ); + + response.data.users[index] = populateDeprecatedUser( + response.data.users[index] ); }); return response.data; diff --git a/packages/restapi/src/lib/user/upgradeUser.ts b/packages/restapi/src/lib/user/upgradeUser.ts index 94e7da209..f4a8d9cf3 100644 --- a/packages/restapi/src/lib/user/upgradeUser.ts +++ b/packages/restapi/src/lib/user/upgradeUser.ts @@ -46,10 +46,11 @@ export const upgrade = async (options: UpgradeUserProps): Promise => { } const recommendedPgpEncryptionVersion = Constants.ENCRYPTION_TYPE.PGP_V3; + const { version } = JSON.parse(user.encryptedPrivateKey); if ( - user.encryptionType === recommendedPgpEncryptionVersion || - user.encryptionType === Constants.ENCRYPTION_TYPE.NFTPGP_V1 + version === recommendedPgpEncryptionVersion || + version === Constants.ENCRYPTION_TYPE.NFTPGP_V1 ) { return user; } diff --git a/packages/restapi/src/lib/utils/populateIUser.ts b/packages/restapi/src/lib/utils/populateIUser.ts new file mode 100644 index 000000000..e8cfe6886 --- /dev/null +++ b/packages/restapi/src/lib/utils/populateIUser.ts @@ -0,0 +1,39 @@ +import { IUser } from '../types'; + +/** + * To be removed in v2 verisons of sdk + * @param user + * @returns User with deprecated params + */ +export const populateDeprecatedUser = (user: IUser): IUser => { + if (!user) return user; + user.name = user.profile.name; + user.about = user.profile.desc; + user.profilePicture = user.profile.picture; + user.numMsg = user.msgSent; + user.allowedNumMsg = user.maxMsgPersisted; + let encryptionType = ''; + let sigType = ''; + let signature = ''; + try { + const { version } = JSON.parse(user.encryptedPrivateKey); + encryptionType = version; + } catch (err) { + //ignore since no encryption found + } + user.encryptionType = encryptionType; + try { + sigType = user.verificationProof.split(':')[0]; + signature = user.verificationProof.split(':')[1]; + } catch (err) { + //ignore since no verification proof found + } + user.signature = signature; + user.sigType = sigType; + user.encryptedPassword = null; + //TODO FOR NFT PROFILE + user.nftOwner = null; + user.linkedListHash = null; + user.nfts = null; + return user; +}; diff --git a/packages/restapi/tests/lib/user/createUser.test.ts b/packages/restapi/tests/lib/user/createUser.test.ts index 0419a09a2..ade9220be 100644 --- a/packages/restapi/tests/lib/user/createUser.test.ts +++ b/packages/restapi/tests/lib/user/createUser.test.ts @@ -55,13 +55,11 @@ describe('Create Push Profile', () => { expect(user.encryptedPrivateKey).to.contains( `"version":"${Constants.ENC_TYPE_V1}"` ); - expect(user.encryptionType).to.be.equal(Constants.ENC_TYPE_V1); - expect(user.encryptedPassword).to.be.null; - expect(user.nftOwner).to.be.null; - expect(user.profilePicture).to.contains('data:image/png;base64,'); - expect(user.about).to.be.null; - expect(user.name).to.be.null; - expect(user.numMsg).to.be.equal(0); + expect(user.profile.name).to.be.null; + expect(user.profile.desc).to.be.null; + expect(user.profile.picture).to.contains('data:image/png;base64,'); + + expect(user.msgSent).to.be.equal(0); }); it('Push Profile V3', async () => { const user = await create({ @@ -80,13 +78,10 @@ describe('Create Push Profile', () => { expect(user.encryptedPrivateKey).to.contains( `"version":"${Constants.ENC_TYPE_V3}"` ); - expect(user.encryptionType).to.be.equal(Constants.ENC_TYPE_V3); - expect(user.encryptedPassword).to.be.null; - expect(user.nftOwner).to.be.null; - expect(user.profilePicture).to.contains('data:image/png;base64,'); - expect(user.about).to.be.null; - expect(user.name).to.be.null; - expect(user.numMsg).to.be.equal(0); + expect(user.profile.name).to.be.null; + expect(user.profile.desc).to.be.null; + expect(user.profile.picture).to.contains('data:image/png;base64,'); + expect(user.msgSent).to.be.equal(0); }); it('Push Profile V4 ( NFT Profile )', async () => { const user = await create({ @@ -105,12 +100,10 @@ describe('Create Push Profile', () => { expect(user.encryptedPrivateKey).to.contains( `"version":"${Constants.ENC_TYPE_V4}"` ); - expect(user.encryptionType).to.be.equal(Constants.ENC_TYPE_V4); - expect(user.encryptedPassword).to.be.null; - expect(user.nftOwner).to.be.equal('eip155:' + _nftWalletAddress1); - expect(user.profilePicture).to.contains('data:image/png;base64,'); - expect(user.about).to.be.null; - expect(user.name).to.be.null; - expect(user.numMsg).to.be.equal(0); + expect(user.profile.name).to.be.null; + expect(user.profile.desc).to.be.null; + expect(user.profile.picture).to.contains('data:image/png;base64,'); + + expect(user.msgSent).to.be.equal(0); }); }); diff --git a/packages/restapi/tests/lib/user/getUser.test.ts b/packages/restapi/tests/lib/user/getUser.test.ts index bcd5c458c..ca8fcbd9a 100644 --- a/packages/restapi/tests/lib/user/getUser.test.ts +++ b/packages/restapi/tests/lib/user/getUser.test.ts @@ -52,6 +52,6 @@ describe('Get user', () => { value.includes(`"version":"${Constants.ENC_TYPE_V3}"`) ); }); - expect(user.profilePicture).to.contains('data:image/png;base64,'); + expect(user.profile.picture).to.contains('data:image/png;base64,'); }); }); diff --git a/packages/restapi/tests/lib/user/upgradeUser.test.ts b/packages/restapi/tests/lib/user/upgradeUser.test.ts index e71ce18a9..1648f369d 100644 --- a/packages/restapi/tests/lib/user/upgradeUser.test.ts +++ b/packages/restapi/tests/lib/user/upgradeUser.test.ts @@ -47,12 +47,10 @@ describe('Upgrade user keys', () => { expect(upgradedUser.encryptedPrivateKey).to.contains( `"version":"${upgradationVersion}"` ); - expect(upgradedUser.encryptionType).to.be.equal(upgradationVersion); - expect(user.encryptedPassword).to.be.equal(upgradedUser.encryptedPassword); - expect(user.nftOwner).to.be.equal(upgradedUser.nftOwner); - expect(user.profilePicture).to.be.equal(upgradedUser.profilePicture); - expect(user.about).to.be.equal(upgradedUser.about); - expect(user.name).to.be.equal(upgradedUser.name); + + expect(user.profile.picture).to.be.equal(upgradedUser.profile.picture); + expect(user.profile.desc).to.be.equal(upgradedUser.profile.desc); + expect(user.profile.name).to.be.equal(upgradedUser.profile.name); const userPrivatePGPKey = await decryptPGPKey({ encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer, @@ -87,12 +85,10 @@ describe('Upgrade user keys', () => { expect(upgradedUser.encryptedPrivateKey).to.contains( `"version":"${upgradationVersion}"` ); - expect(upgradedUser.encryptionType).to.be.equal(upgradationVersion); - expect(user.encryptedPassword).to.be.equal(upgradedUser.encryptedPassword); - expect(user.nftOwner).to.be.equal(upgradedUser.nftOwner); - expect(user.profilePicture).to.be.equal(upgradedUser.profilePicture); - expect(user.about).to.be.equal(upgradedUser.about); - expect(user.name).to.be.equal(upgradedUser.name); + + expect(user.profile.picture).to.be.equal(upgradedUser.profile.picture); + expect(user.profile.desc).to.be.equal(upgradedUser.profile.desc); + expect(user.profile.name).to.be.equal(upgradedUser.profile.name); const userPrivatePGPKey = await decryptPGPKey({ encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer, @@ -117,7 +113,6 @@ describe('Upgrade user keys', () => { expect(createdUser.encryptedPrivateKey).to.contains( `"version":"${Constants.ENC_TYPE_V1}"` ); - expect(createdUser.encryptionType).to.be.equal(Constants.ENC_TYPE_V1); const userPrivatePGPKey = await decryptPGPKey({ encryptedPGPPrivateKey: createdUser.encryptedPrivateKey, signer: _signer, @@ -128,7 +123,6 @@ describe('Upgrade user keys', () => { expect(user.encryptedPrivateKey).to.contains( `"version":"${upgradationVersion}"` ); - expect(user.encryptionType).to.be.equal(upgradationVersion); const upgradedPrivatePGPKey = await decryptPGPKey({ encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer, diff --git a/packages/uiweb/src/lib/components/chat/AddressInfo.tsx b/packages/uiweb/src/lib/components/chat/AddressInfo.tsx index 4034e6125..4ef2bd8ac 100644 --- a/packages/uiweb/src/lib/components/chat/AddressInfo.tsx +++ b/packages/uiweb/src/lib/components/chat/AddressInfo.tsx @@ -27,8 +27,8 @@ export const AddressInfo: React.FC = () => { address profile {
)} {isCopied && ( -
setIsCopied(false)}> +
setIsCopied(false)}> props.theme.textColorPrimary || '#000'}; `; -