From 995042b789b19d487b5e2953463cae60e75199b8 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Fri, 22 Sep 2023 17:54:35 +0530 Subject: [PATCH 01/18] fix: added chat.decrypt (#726) * fix: added chat.decrypt * fix: fix examples --- .../examples/sdk-backend-node/package.json | 2 +- .../sdk-backend-node/pushAPI/index.ts | 22 +++++++++++ .../restapi/src/lib/chat/helpers/inbox.ts | 38 +++++++++++-------- packages/restapi/src/lib/pushapi/PushAPI.ts | 10 +++++ .../restapi/tests/lib/pushapi/chat.test.ts | 11 ++++++ 5 files changed, 67 insertions(+), 16 deletions(-) diff --git a/packages/examples/sdk-backend-node/package.json b/packages/examples/sdk-backend-node/package.json index 97b7d47cb..47b5d3196 100644 --- a/packages/examples/sdk-backend-node/package.json +++ b/packages/examples/sdk-backend-node/package.json @@ -11,7 +11,7 @@ "author": "", "license": "ISC", "dependencies": { - "@pushprotocol/restapi": "^1.4.17", + "@pushprotocol/restapi": "@latest", "@pushprotocol/socket": "^0.5.2" } } diff --git a/packages/examples/sdk-backend-node/pushAPI/index.ts b/packages/examples/sdk-backend-node/pushAPI/index.ts index e14d56659..60fdd8285 100644 --- a/packages/examples/sdk-backend-node/pushAPI/index.ts +++ b/packages/examples/sdk-backend-node/pushAPI/index.ts @@ -9,6 +9,7 @@ import { config } from '../config'; import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; import { createWalletClient, http } from 'viem'; import { goerli } from 'viem/chains'; +import { createSocketConnection, EVENTS } from '@pushprotocol/socket'; // CONFIGS const { env, showAPIResponse } = config; @@ -135,6 +136,27 @@ export const runPushAPICases = async (): Promise => { console.log('PushAPI.chat.send | Response - 200 OK\n\n'); // ------------------------------------------------------------------- // ------------------------------------------------------------------- + console.log('PushAPI.chat.decrypt'); + const pushSDKSocket = createSocketConnection({ + user: signerAddress, + socketType: 'chat', + socketOptions: { autoConnect: true, reconnectionAttempts: 3 }, + env: env, + }); + if (pushSDKSocket) { + await userAlice.chat.send(secondSignerAddress, { + content: 'Hello Bob!', + type: 'Text', + }); + pushSDKSocket.on(EVENTS.CHAT_RECEIVED_MESSAGE, async (message) => { + // uncomment after latest sdk deployment + // await userAlice.chat.decrypt([message]); + // pushSDKSocket.disconnect(); + }); + } + console.log('PushAPI.chat.decrypt | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- console.log('PushAPI.chat.accept'); const bobAcceptsRequest = await userBob.chat.accept(signerAddress); if (showAPIResponse) { diff --git a/packages/restapi/src/lib/chat/helpers/inbox.ts b/packages/restapi/src/lib/chat/helpers/inbox.ts index b243e2b78..f73f9a735 100644 --- a/packages/restapi/src/lib/chat/helpers/inbox.ts +++ b/packages/restapi/src/lib/chat/helpers/inbox.ts @@ -171,23 +171,31 @@ export const decryptConversation = async (options: DecryptConverationType) => { const message = messages[i]; let gotOtherPeer = false; if (message.encType !== 'PlainText') { - if (!pgpPrivateKey) { - throw Error('Decrypted private key is necessary'); - } - if (message.fromCAIP10 !== connectedUser.wallets.split(',')[0]) { - if (!gotOtherPeer) { - otherPeer = await getUser({ account: message.fromCAIP10, env }); - gotOtherPeer = true; + // check if message is already decrypted + if ( + // legacy messages ( no way to know if they are decrypted or not ) + message.messageObj === undefined || + // new messages ( if messageObj is string then it is not decrypted ) + typeof message.messageObj === 'string' + ) { + if (!pgpPrivateKey) { + throw Error('Decrypted private key is necessary'); + } + if (message.fromCAIP10 !== connectedUser.wallets.split(',')[0]) { + if (!gotOtherPeer) { + otherPeer = await getUser({ account: message.fromCAIP10, env }); + gotOtherPeer = true; + } + signatureValidationPubliKey = otherPeer!.publicKey; + } else { + signatureValidationPubliKey = connectedUser.publicKey; } - signatureValidationPubliKey = otherPeer!.publicKey; - } else { - signatureValidationPubliKey = connectedUser.publicKey; + messages[i] = await decryptAndVerifyMessage( + message, + signatureValidationPubliKey, + pgpPrivateKey + ); } - messages[i] = await decryptAndVerifyMessage( - message, - signatureValidationPubliKey, - pgpPrivateKey - ); } } return messages; diff --git a/packages/restapi/src/lib/pushapi/PushAPI.ts b/packages/restapi/src/lib/pushapi/PushAPI.ts index a41d25b80..610e6158d 100644 --- a/packages/restapi/src/lib/pushapi/PushAPI.ts +++ b/packages/restapi/src/lib/pushapi/PushAPI.ts @@ -9,6 +9,7 @@ import { Message, ProgressHookType, IUser, + IMessageIPFS, } from '../types'; import { GroupUpdateOptions, @@ -259,6 +260,15 @@ export class PushAPI { return await PUSH_CHAT.send(sendParams); }, + decrypt: async (messagePayloads: IMessageIPFS[]) => { + return await PUSH_CHAT.decryptConversation({ + pgpPrivateKey: this.decryptedPgpPvtKey, + env: this.env, + messages: messagePayloads, + connectedUser: await this.info(), + }); + }, + accept: async (target: string): Promise => { return await PUSH_CHAT.approve({ senderAddress: target, diff --git a/packages/restapi/tests/lib/pushapi/chat.test.ts b/packages/restapi/tests/lib/pushapi/chat.test.ts index b7ebbf683..c98e3e0ca 100644 --- a/packages/restapi/tests/lib/pushapi/chat.test.ts +++ b/packages/restapi/tests/lib/pushapi/chat.test.ts @@ -52,4 +52,15 @@ describe('PushAPI.chat functionality', () => { }); expect(response).to.be.an('object'); }); + it('Should decrypt message ', async () => { + await userAlice.chat.send(account2, { + content: 'Hello', + type: MessageType.TEXT, + }); + const messagePayloads = await userAlice.chat.history(account2); + const decryptedMessagePayloads = await userBob.chat.decrypt( + messagePayloads + ); + expect(decryptedMessagePayloads).to.be.an('array'); + }); }); From 23fa1bcc86fd2716173df279559c942f40aec6bd Mon Sep 17 00:00:00 2001 From: Ashis Kumar Pradhan <38760485+akp111@users.noreply.github.com> Date: Fri, 29 Sep 2023 14:14:41 +0530 Subject: [PATCH 02/18] Arbitrum changes (#735) * fix: inital implementation for arbitrum changes * fix: more changes * fix: added final changes --- .../src/app/components/Connect.tsx | 4 ++- .../sdk-frontend-react/src/app/helpers.ts | 2 +- packages/reactnative/README.md | 2 +- .../components/chainDetails/arbitrumSVG.tsx | 29 +++++++++++++++++++ .../src/lib/components/chainDetails/index.tsx | 16 ++++++++-- .../components/notifications/notification.tsx | 2 +- packages/restapi/README.md | 2 ++ packages/restapi/src/lib/config.ts | 26 ++++++++++++++++- packages/restapi/src/lib/constants.ts | 2 +- .../restapi/src/lib/payloads/constants.ts | 4 +++ packages/restapi/src/lib/payloads/helpers.ts | 2 +- packages/uiweb/README.md | 2 +- .../chat/ConnectButton/ConnectButton.tsx | 4 ++- .../components/notification/chainDetails.tsx | 11 ++++++- .../src/lib/components/notification/index.tsx | 2 ++ packages/uiweb/src/lib/config/constants.ts | 12 +++++--- packages/uiweb/src/lib/icons/ArbitrumSvg.tsx | 23 +++++++++++++++ 17 files changed, 128 insertions(+), 17 deletions(-) create mode 100644 packages/reactnative/src/lib/components/chainDetails/arbitrumSVG.tsx create mode 100644 packages/uiweb/src/lib/icons/ArbitrumSvg.tsx diff --git a/packages/examples/sdk-frontend-react/src/app/components/Connect.tsx b/packages/examples/sdk-frontend-react/src/app/components/Connect.tsx index 53ce68f1c..1398c4c77 100644 --- a/packages/examples/sdk-frontend-react/src/app/components/Connect.tsx +++ b/packages/examples/sdk-frontend-react/src/app/components/Connect.tsx @@ -19,10 +19,12 @@ const NETWORK_MAPPING: NwMappingType = { 10: 'OPTIMISM_MAINNET', 1442: 'POLYGON_ZK_EVM_TESTNET', 1101: 'POLYGON_ZK_EVM_MAINNET', + 421613: "ARBITRUM_TESTNET", + 42161: "ARBITRUMONE_MAINNET" }; const injected = new InjectedConnector({ - supportedChainIds: [1, 3, 4, 5, 42, 137, 80001, 56, 97, 10, 420, 1442, 1101], + supportedChainIds: [1, 3, 4, 5, 42, 137, 80001, 56, 97, 10, 420, 1442, 1101, 421613, 42161], }); const ConnectWrapper = styled.div` diff --git a/packages/examples/sdk-frontend-react/src/app/helpers.ts b/packages/examples/sdk-frontend-react/src/app/helpers.ts index d5af6bc15..bad12f49d 100644 --- a/packages/examples/sdk-frontend-react/src/app/helpers.ts +++ b/packages/examples/sdk-frontend-react/src/app/helpers.ts @@ -18,7 +18,7 @@ const Constants = { }, DEFAULT_CHAIN_ID: 5, DEV_CHAIN_ID: 99999, - NON_ETH_CHAINS: [137, 80001, 56, 97, 10, 420, 1442, 1101], + NON_ETH_CHAINS: [137, 80001, 56, 97, 10, 420, 1442, 1101, 421613, 42161], ETH_CHAINS: [1, 5], }; diff --git a/packages/reactnative/README.md b/packages/reactnative/README.md index 4eae3bfa0..d3e665c64 100644 --- a/packages/reactnative/README.md +++ b/packages/reactnative/README.md @@ -208,5 +208,5 @@ where | cta | string | Call To Action Link (given during notification creation) | | image | string | Any media link (given during notification creation) | | appbot | string | is the notification is from EPNS bot the value is "1" else "0" | -| chainName | string | Can be anyone of the following blockchain networks on which the notification was sent - "ETH_MAINNET", "ETH_TEST_GOERLI", "POLYGON_MAINNET", "POLYGON_TEST_MUMBAI", "BSC_MAINNET, "BSC_TESTNET", "OPTIMISM_MAINNET", "OPTIMISM_TESTNET", "POLYGON_ZK_EVM_TESTNET", "POLYGON_ZK_EVM_MAINNET", "THE_GRAPH" | +| chainName | string | Can be anyone of the following blockchain networks on which the notification was sent - "ETH_MAINNET", "ETH_TEST_GOERLI", "POLYGON_MAINNET", "POLYGON_TEST_MUMBAI", "BSC_MAINNET, "BSC_TESTNET", "OPTIMISM_MAINNET", "OPTIMISM_TESTNET", "POLYGON_ZK_EVM_TESTNET", "POLYGON_ZK_EVM_MAINNET", "ARBITRUM_TESTNET", "ARBITRUMONE_MAINNET", "THE_GRAPH" | | youTubeAPIKey | string | Your generated Youtube API key | \ No newline at end of file diff --git a/packages/reactnative/src/lib/components/chainDetails/arbitrumSVG.tsx b/packages/reactnative/src/lib/components/chainDetails/arbitrumSVG.tsx new file mode 100644 index 000000000..7106c3552 --- /dev/null +++ b/packages/reactnative/src/lib/components/chainDetails/arbitrumSVG.tsx @@ -0,0 +1,29 @@ +import * as React from 'react'; +import { SVGProps } from 'react'; + +const ArbitrumSvgComponent = (props: SVGProps) => ( + + + + + + + +); + +export default ArbitrumSvgComponent; diff --git a/packages/reactnative/src/lib/components/chainDetails/index.tsx b/packages/reactnative/src/lib/components/chainDetails/index.tsx index 08c8cb55b..dbd6c8e19 100644 --- a/packages/reactnative/src/lib/components/chainDetails/index.tsx +++ b/packages/reactnative/src/lib/components/chainDetails/index.tsx @@ -3,9 +3,15 @@ import PolygonSvg from "./polygonSVG"; import GraphSvg from "./thegraphSVG"; import BscSvg from "./bscSVG"; import OptimismSvg from "./optimismSVG" -import PolygonZKEVMSvg from "./polygonZKEVMSVG"; +import PolygonZKEVMSvg from "./polygonZkEVMSVG"; +import ArbitrumSvgComponent from "./arbitrumSVG"; -export default { +type Network = { + label: string; + Icon: any; +}; + +const networks: Record = { ETH_TEST_GOERLI: { label: "ETHEREUM GOERLI", Icon: EthereumSvg }, ETH_MAINNET: { label: "ETHEREUM MAINNET", Icon: EthereumSvg }, POLYGON_TEST_MUMBAI: { label: "POLYGON MUMBAI", Icon: PolygonSvg }, @@ -16,5 +22,9 @@ export default { OPTIMISM_MAINNET: { label: "OPTIMISM MAINNET", Icon: OptimismSvg }, POLYGON_ZK_EVM_TESTNET: {label:"POLYGON_ZK_EVM_TESTNET",Icon: PolygonZKEVMSvg}, POLYGON_ZK_EVM_MAINNET: {label:"POLYGON_ZK_EVM_MAINNET",Icon: PolygonZKEVMSvg}, + ARBITRUM_TESTNET: {label:"ARBITRUM_TESTNET",Icon: ArbitrumSvgComponent}, + ARBITRUMONE_MAINNET: {label: "ARBITRUMONE_MAINNET", Icon: ArbitrumSvgComponent}, THE_GRAPH: { label: "THE GRAPH", Icon: GraphSvg }, -}; \ No newline at end of file +}; + +export default networks \ No newline at end of file diff --git a/packages/reactnative/src/lib/components/notifications/notification.tsx b/packages/reactnative/src/lib/components/notifications/notification.tsx index 30869655e..bbc064056 100644 --- a/packages/reactnative/src/lib/components/notifications/notification.tsx +++ b/packages/reactnative/src/lib/components/notifications/notification.tsx @@ -18,7 +18,7 @@ import { ImageDownloadWithIndicator, VideoDownloadWithIndicator } from '../load // ================= Define types -export type chainNameType = "ETH_TEST_GOERLI" | "POLYGON_TEST_MUMBAI" | "ETH_MAINNET" | "POLYGON_MAINNET" | "BSC_MAINNET" | "BSC_TESTNET" | "OPTIMISM_MAINNET" | "OPTIMISM_TESTNET" | "POLYGON_ZK_EVM_TESTNET" | "POLYGON_ZK_EVM_MAINNET" | "THE_GRAPH" | undefined; +export type chainNameType = "ETH_TEST_GOERLI" | "POLYGON_TEST_MUMBAI" | "ETH_MAINNET" | "POLYGON_MAINNET" | "BSC_MAINNET" | "BSC_TESTNET" | "OPTIMISM_MAINNET" | "OPTIMISM_TESTNET" | "POLYGON_ZK_EVM_TESTNET" | "POLYGON_ZK_EVM_MAINNET" | "ARBITRUMONE_MAINNET" | "ARBITRUM_TESTNET" | "THE_GRAPH" | undefined; const botImageLocalPath = '../../assets/epnsbot.png'; diff --git a/packages/restapi/README.md b/packages/restapi/README.md index d38862a06..fc50d8c05 100644 --- a/packages/restapi/README.md +++ b/packages/restapi/README.md @@ -181,6 +181,8 @@ Binance Mainnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa Binance Testnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa Optimism Mainnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa Optimism Testnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa +Arbitrum Mainnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa +Arbitrum One Testnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa ``` # SDK Features diff --git a/packages/restapi/src/lib/config.ts b/packages/restapi/src/lib/config.ts index c4ed49fb2..20d902c0a 100644 --- a/packages/restapi/src/lib/config.ts +++ b/packages/restapi/src/lib/config.ts @@ -25,9 +25,11 @@ const BLOCKCHAIN_NETWORK = { OPTIMISM_MAINNET: 'eip155:10', POLYGON_ZK_EVM_TESTNET: 'eip155:1442', POLYGON_ZK_EVM_MAINNET: 'eip155:1101', + ARBITRUM_TESTNET: 'eip155:421613', + ARBITRUMONE_MAINNET: "eip155:42161" }; -export type ALIAS_CHAIN = 'POLYGON' | 'BSC' | 'OPTIMISM' | 'POLYGONZKEVM'; +export type ALIAS_CHAIN = 'POLYGON' | 'BSC' | 'OPTIMISM' | 'POLYGONZKEVM' | "ARBITRUMONE"; export const ALIAS_CHAIN_ID = { POLYGON: { @@ -54,6 +56,12 @@ export const ALIAS_CHAIN_ID = { [ENV.DEV]: 1442, [ENV.LOCAL]: 420, }, + ARBITRUMONE: { + [ENV.PROD]: 42161, + [ENV.STAGING]: 421613, + [ENV.DEV]: 421613, + [ENV.LOCAL]: 421613, + } }; export interface ConfigType { @@ -83,6 +91,10 @@ const CONFIG = { API_BASE_URL: API_BASE_URL[ENV.PROD], EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', }, + [BLOCKCHAIN_NETWORK.ARBITRUMONE_MAINNET]: { + API_BASE_URL: API_BASE_URL[ENV.PROD], + EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', + }, }, [ENV.STAGING]: { [BLOCKCHAIN_NETWORK.ETH_GOERLI]: { @@ -105,6 +117,10 @@ const CONFIG = { API_BASE_URL: API_BASE_URL[ENV.STAGING], EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', }, + [BLOCKCHAIN_NETWORK.ARBITRUM_TESTNET]: { + API_BASE_URL: API_BASE_URL[ENV.STAGING], + EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', + }, }, [ENV.DEV]: { [BLOCKCHAIN_NETWORK.ETH_GOERLI]: { @@ -127,6 +143,10 @@ const CONFIG = { API_BASE_URL: API_BASE_URL[ENV.DEV], EPNS_COMMUNICATOR_CONTRACT: '0x630b152e4185c63D7177c656b56b26f878C61572', }, + [BLOCKCHAIN_NETWORK.ARBITRUM_TESTNET]: { + API_BASE_URL: API_BASE_URL[ENV.STAGING], + EPNS_COMMUNICATOR_CONTRACT: '0x2f6aE0907116A2c50D712e78b48D874fadeB6850', + }, }, [ENV.LOCAL]: { [BLOCKCHAIN_NETWORK.ETH_GOERLI]: { @@ -149,6 +169,10 @@ const CONFIG = { API_BASE_URL: API_BASE_URL[ENV.DEV], EPNS_COMMUNICATOR_CONTRACT: '0x630b152e4185c63D7177c656b56b26f878C61572', }, + [BLOCKCHAIN_NETWORK.ARBITRUM_TESTNET]: { + API_BASE_URL: API_BASE_URL[ENV.STAGING], + EPNS_COMMUNICATOR_CONTRACT: '0x2f6aE0907116A2c50D712e78b48D874fadeB6850', + }, }, }; diff --git a/packages/restapi/src/lib/constants.ts b/packages/restapi/src/lib/constants.ts index 4735b547a..595f52077 100644 --- a/packages/restapi/src/lib/constants.ts +++ b/packages/restapi/src/lib/constants.ts @@ -55,7 +55,7 @@ const Constants = { }, DEFAULT_CHAIN_ID: 5, DEV_CHAIN_ID: 99999, - NON_ETH_CHAINS: [137, 80001, 56, 97, 10, 420, 1442, 1101], + NON_ETH_CHAINS: [137, 80001, 56, 97, 10, 420, 1442, 1101, 421613, 42161], ETH_CHAINS: [1, 5], ENC_TYPE_V1: 'x25519-xsalsa20-poly1305', ENC_TYPE_V2: 'aes256GcmHkdfSha256', diff --git a/packages/restapi/src/lib/payloads/constants.ts b/packages/restapi/src/lib/payloads/constants.ts index a3c5d9a41..da01fafc7 100644 --- a/packages/restapi/src/lib/payloads/constants.ts +++ b/packages/restapi/src/lib/payloads/constants.ts @@ -13,6 +13,8 @@ export const CHAIN_ID_TO_SOURCE: ChainIdToSourceType = { 420: 'OPTIMISM_TESTNET', 1442: 'POLYGON_ZK_EVM_TESTNET', 1101: 'POLYGON_ZK_EVM_MAINNET', + 421613: "ARBITRUM_TESTNET", + 42161: "ARBITRUMONE_MAINNET" }; export const SOURCE_TYPES = { @@ -26,6 +28,8 @@ export const SOURCE_TYPES = { OPTIMISM_TESTNET: 'OPTIMISM_TESTNET', POLYGON_ZK_EVM_TESTNET: 'POLYGON_ZK_EVM_TESTNET', POLYGON_ZK_EVM_MAINNET: 'POLYGON_ZK_EVM_MAINNET', + ARBITRUM_TESTNET: "ARBITRUM_TESTNET", + ARBITRUMONE_MAINNET: "ARBITRUMONE_MAINNET", THE_GRAPH: 'THE_GRAPH', PUSH_VIDEO: 'PUSH_VIDEO', }; diff --git a/packages/restapi/src/lib/payloads/helpers.ts b/packages/restapi/src/lib/payloads/helpers.ts index 6b7016feb..1863ed1ca 100644 --- a/packages/restapi/src/lib/payloads/helpers.ts +++ b/packages/restapi/src/lib/payloads/helpers.ts @@ -321,7 +321,7 @@ export function getSource( export function getCAIPFormat(chainId: number, address: string) { // EVM based chains - if ([1, 5, 42, 137, 80001, 56, 97, 10, 420, 1442, 1101].includes(chainId)) { + if ([1, 5, 42, 137, 80001, 56, 97, 10, 420, 1442, 1101, 421613, 42161].includes(chainId)) { return `eip155:${chainId}:${address}`; } diff --git a/packages/uiweb/README.md b/packages/uiweb/README.md index d7bbe3e09..ba3ba4a3e 100644 --- a/packages/uiweb/README.md +++ b/packages/uiweb/README.md @@ -149,7 +149,7 @@ where | cta | string | Call To Action Link (given during notification creation) | | image | string | Any media link (given during notification creation) | | url | string | Channel Link (given during channel setup) | -| chainName | string | Can be anyone of the following blockchain networks on which the notification was sent - "ETH_MAINNET", "ETH_TEST_GOERLI", "POLYGON_MAINNET", "POLYGON_TEST_MUMBAI", "BSC_MAINNET, "BSC_TESTNET", "OPTIMISM_MAINNET", "OPTIMISM_TESTNET", "POLYGON_ZK_EVM_TESTNET", "POLYGON_ZK_EVM_MAINNET", "THE_GRAPH" | +| chainName | string | Can be anyone of the following blockchain networks on which the notification was sent - "ETH_MAINNET", "ETH_TEST_GOERLI", "POLYGON_MAINNET", "POLYGON_TEST_MUMBAI", "BSC_MAINNET, "BSC_TESTNET", "OPTIMISM_MAINNET", "OPTIMISM_TESTNET", "POLYGON_ZK_EVM_TESTNET", "POLYGON_ZK_EVM_MAINNET", "ARBITRUM_TESTNET", "ARBITRUMONE_MAINNET", "THE_GRAPH" | | theme | string | 'light' or 'dark' (customization to be given by the dApp) | | customTheme | INotificationItemTheme | custom theme object for the component | | isSpam | boolean | whether a spam notification or not | diff --git a/packages/uiweb/src/lib/components/chat/ConnectButton/ConnectButton.tsx b/packages/uiweb/src/lib/components/chat/ConnectButton/ConnectButton.tsx index d196b00b7..d9d81c4cd 100644 --- a/packages/uiweb/src/lib/components/chat/ConnectButton/ConnectButton.tsx +++ b/packages/uiweb/src/lib/components/chat/ConnectButton/ConnectButton.tsx @@ -24,10 +24,12 @@ const NETWORK_MAPPING: NwMappingType = { 10: 'OPTIMISM_MAINNET', 1442: 'POLYGON_ZK_EVM_TESTNET', 1101: 'POLYGON_ZK_EVM_MAINNET', + 421613: "ARBITRUM_TESTNET", + 42161: "ARBITRUMONE_MAINNET" }; const injected = new InjectedConnector({ - supportedChainIds: [1, 3, 4, 5, 42, 137, 80001, 56, 97, 10, 420, 1442, 1101], + supportedChainIds: [1, 3, 4, 5, 42, 137, 80001, 56, 97, 10, 420, 1442, 1101, 421613, 42161], }); const ConnectWrapper = styled.div` diff --git a/packages/uiweb/src/lib/components/notification/chainDetails.tsx b/packages/uiweb/src/lib/components/notification/chainDetails.tsx index ad783c516..b666f00c7 100644 --- a/packages/uiweb/src/lib/components/notification/chainDetails.tsx +++ b/packages/uiweb/src/lib/components/notification/chainDetails.tsx @@ -7,7 +7,7 @@ import { BSCSvg } from "../../icons/BSCSvg"; import { OptimismSvg } from "../../icons/OptimismSvg"; import { PolygonzkevmSvg } from "../../icons/PolygonzkevmSvg"; import { TheGraphSvg } from "../../icons/TheGraphSvg"; -import { ReactElement } from "react"; +import { ArbitrumSvg } from "../../icons/ArbitrumSvg" const createSVGIcon = (element:any, chainName: string) => { return ( @@ -58,5 +58,14 @@ export default { label: 'POLYGON ZK EVM MAINNET', icon: createSVGIcon(, 'Polygon ZK EVM Mainnet'), }, + + ARBITRUMONE_MAINNET: { + label: 'ARBITRUMONE MAINNET', + icon: createSVGIcon(, 'Arbitrum Mainnet'), + }, + ARBITRUM_TESTNET: { + label: 'ARBITRUMONE MAINNET', + icon: createSVGIcon(, 'Arbitrum Testnet'), + }, THE_GRAPH: { label: 'THE GRAPH', icon: createSVGIcon(, 'The Graph') }, }; diff --git a/packages/uiweb/src/lib/components/notification/index.tsx b/packages/uiweb/src/lib/components/notification/index.tsx index bcec3907b..8ce4dd911 100644 --- a/packages/uiweb/src/lib/components/notification/index.tsx +++ b/packages/uiweb/src/lib/components/notification/index.tsx @@ -34,6 +34,8 @@ export type chainNameType = | 'OPTIMISM_TESTNET' | 'POLYGON_ZK_EVM_TESTNET' | 'POLYGON_ZK_EVM_MAINNET' + | 'ARBITRUMONE_MAINNET' + | 'ARBITRUM_TESTNET' | 'THE_GRAPH' | undefined; diff --git a/packages/uiweb/src/lib/config/constants.ts b/packages/uiweb/src/lib/config/constants.ts index 32782b3ce..e07576aba 100644 --- a/packages/uiweb/src/lib/config/constants.ts +++ b/packages/uiweb/src/lib/config/constants.ts @@ -48,25 +48,29 @@ export const allowedNetworks = { 1, //for ethereum mainnet 137, //for polygon mainnet 56, // for bnb mainnet - // 10 // for optimism mainnet + 10, // for optimism mainnet + 42161 // for arbitrum mainnet ], 'dev' : [ 5, // for eth goerli 80001, //for mumbai polygon 97, // bnb testnet - 420 // optimism goerli testnet + 420, // optimism goerli testnet + 421613 // for arbitrum testnet ], 'staging' : [ // 42, //for kovan 5, // for goerli 80001, //for mumbai polygon - 97 // bnb testnet + 97, // bnb testnet + 421613 // for arbitrum testnet ], 'local' :[ 5, // for eth goerli 80001, //for mumbai polygon 97, // bnb testnet - 420 // optimism goerli testnet + 420, // optimism goerli testnet + 421613 // for arbitrum testnet ] } diff --git a/packages/uiweb/src/lib/icons/ArbitrumSvg.tsx b/packages/uiweb/src/lib/icons/ArbitrumSvg.tsx new file mode 100644 index 000000000..5703e7717 --- /dev/null +++ b/packages/uiweb/src/lib/icons/ArbitrumSvg.tsx @@ -0,0 +1,23 @@ +import * as React from 'react'; + +export const ArbitrumSvg = () => ( + + + + + +); + From 6737403738dd70ad4056f9d10b4ab363fc172094 Mon Sep 17 00:00:00 2001 From: akp111 Date: Tue, 3 Oct 2023 12:00:59 +0530 Subject: [PATCH 03/18] fix: minor fixes --- packages/uiweb/src/lib/components/notification/chainDetails.tsx | 2 +- packages/uiweb/src/lib/config/constants.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/uiweb/src/lib/components/notification/chainDetails.tsx b/packages/uiweb/src/lib/components/notification/chainDetails.tsx index b666f00c7..d3b6df8c0 100644 --- a/packages/uiweb/src/lib/components/notification/chainDetails.tsx +++ b/packages/uiweb/src/lib/components/notification/chainDetails.tsx @@ -64,7 +64,7 @@ export default { icon: createSVGIcon(, 'Arbitrum Mainnet'), }, ARBITRUM_TESTNET: { - label: 'ARBITRUMONE MAINNET', + label: 'ARBITRUMONE TESTNET', icon: createSVGIcon(, 'Arbitrum Testnet'), }, THE_GRAPH: { label: 'THE GRAPH', icon: createSVGIcon(, 'The Graph') }, diff --git a/packages/uiweb/src/lib/config/constants.ts b/packages/uiweb/src/lib/config/constants.ts index e07576aba..bc4590658 100644 --- a/packages/uiweb/src/lib/config/constants.ts +++ b/packages/uiweb/src/lib/config/constants.ts @@ -63,6 +63,7 @@ export const allowedNetworks = { 5, // for goerli 80001, //for mumbai polygon 97, // bnb testnet + 420, // optimism goerli testnet 421613 // for arbitrum testnet ], 'local' :[ From 3c6b14d1ae68ce74c91864d898e3d646898655bb Mon Sep 17 00:00:00 2001 From: akp111 Date: Tue, 3 Oct 2023 12:07:30 +0530 Subject: [PATCH 04/18] fix: fixed typo --- packages/uiweb/src/lib/components/notification/chainDetails.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/uiweb/src/lib/components/notification/chainDetails.tsx b/packages/uiweb/src/lib/components/notification/chainDetails.tsx index d3b6df8c0..403f12c39 100644 --- a/packages/uiweb/src/lib/components/notification/chainDetails.tsx +++ b/packages/uiweb/src/lib/components/notification/chainDetails.tsx @@ -64,7 +64,7 @@ export default { icon: createSVGIcon(, 'Arbitrum Mainnet'), }, ARBITRUM_TESTNET: { - label: 'ARBITRUMONE TESTNET', + label: 'ARBITRUM TESTNET', icon: createSVGIcon(, 'Arbitrum Testnet'), }, THE_GRAPH: { label: 'THE GRAPH', icon: createSVGIcon(, 'The Graph') }, From a4da132a0488b975ec85b8d8f3a864f33423a7ea Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 4 Oct 2023 12:35:20 +0530 Subject: [PATCH 05/18] docs: added Class Examples (#739) * docs: added documentation * docs: fixed chat class examples * docs: fix notif class * docs: fixed stream examples * docs: fix nft grp update * docs: fixed logs --- .../examples/sdk-backend-node/chat/nftChat.ts | 4 +- .../examples/sdk-backend-node/package.json | 2 +- .../sdk-backend-node/pushAPI/channel.ts | 192 ++++++++++++ .../examples/sdk-backend-node/pushAPI/chat.ts | 227 +++++++++++++++ .../sdk-backend-node/pushAPI/encryption.ts | 38 +++ .../sdk-backend-node/pushAPI/index.ts | 274 +----------------- .../sdk-backend-node/pushAPI/notification.ts | 58 ++++ .../sdk-backend-node/pushAPI/profile.ts | 38 +++ .../sdk-backend-node/pushAPI/stream.ts | 202 +++++++++++++ 9 files changed, 771 insertions(+), 264 deletions(-) create mode 100644 packages/examples/sdk-backend-node/pushAPI/channel.ts create mode 100644 packages/examples/sdk-backend-node/pushAPI/chat.ts create mode 100644 packages/examples/sdk-backend-node/pushAPI/encryption.ts create mode 100644 packages/examples/sdk-backend-node/pushAPI/notification.ts create mode 100644 packages/examples/sdk-backend-node/pushAPI/profile.ts create mode 100644 packages/examples/sdk-backend-node/pushAPI/stream.ts diff --git a/packages/examples/sdk-backend-node/chat/nftChat.ts b/packages/examples/sdk-backend-node/chat/nftChat.ts index b238022be..a3d6a0cfd 100644 --- a/packages/examples/sdk-backend-node/chat/nftChat.ts +++ b/packages/examples/sdk-backend-node/chat/nftChat.ts @@ -526,9 +526,9 @@ async function PushAPI_nft_chat_updateGroup( chatId, groupName: updatedNftGroupName, groupDescription, - members: [nftAccount2, nftAccount3], + members: [nftAccount2, nftAccount3, nftAccount1], groupImage, - admins: [nftAccount2], + admins: [nftAccount1], account: nftAccount1, signer: nftSigner1, pgpPrivateKey: pgpDecrpyptedPvtKey, diff --git a/packages/examples/sdk-backend-node/package.json b/packages/examples/sdk-backend-node/package.json index 47b5d3196..a75fdb60c 100644 --- a/packages/examples/sdk-backend-node/package.json +++ b/packages/examples/sdk-backend-node/package.json @@ -11,7 +11,7 @@ "author": "", "license": "ISC", "dependencies": { - "@pushprotocol/restapi": "@latest", + "@pushprotocol/restapi": "0.0.1-alpha.44", "@pushprotocol/socket": "^0.5.2" } } diff --git a/packages/examples/sdk-backend-node/pushAPI/channel.ts b/packages/examples/sdk-backend-node/pushAPI/channel.ts new file mode 100644 index 000000000..7e6b236a0 --- /dev/null +++ b/packages/examples/sdk-backend-node/pushAPI/channel.ts @@ -0,0 +1,192 @@ +import { PushAPI } from '@pushprotocol/restapi'; +import { config } from '../config'; +import { ethers } from 'ethers'; + +// CONFIGS +const { env, showAPIResponse } = config; + +export const runPushAPIChannelCases = async (): Promise => { + if (!process.env.WALLET_PRIVATE_KEY) { + console.log( + 'skipping PushAPI.channel examples, no private key passed in .env' + ); + return; + } + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + // Signer Generation + const provider = new ethers.providers.JsonRpcProvider( + 'https://goerli.blockpi.network/v1/rpc/public' // Goerli Provider + ); + const signer = new ethers.Wallet( + `0x${process.env.WALLET_PRIVATE_KEY}`, + provider + ); + const randomWallet1 = ethers.Wallet.createRandom().address; + const randomWallet2 = ethers.Wallet.createRandom().address; + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + const userAlice = await PushAPI.initialize(signer, { env }); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.channel.info'); + const channelInfo = await userAlice.channel.info(); + if (showAPIResponse) { + console.log(channelInfo); + } + console.log('PushAPI.channel.info | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.channel.search'); + const searchedChannels = await userAlice.channel.search( + 'push' // search by name or address + ); + if (showAPIResponse) { + console.log(searchedChannels); + } + console.log('PushAPI.channel.search | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.channel.subscribers'); + const channelSubscribers = await userAlice.channel.subscribers(); + if (showAPIResponse) { + console.log(channelSubscribers); + } + console.log('PushAPI.channel.subscribers | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.channel.send'); + if (channelInfo) { + const broadcastNotif = await userAlice.channel.send(['*'], { + notification: { + title: 'test', + body: 'test', + }, + }); + const targetedNotif = await userAlice.channel.send([randomWallet1], { + notification: { + title: 'test', + body: 'test', + }, + }); + const subsetNotif = await userAlice.channel.send( + [randomWallet1, randomWallet2], + { + notification: { + title: 'test', + body: 'test', + }, + } + ); + if (showAPIResponse) { + console.log(broadcastNotif, targetedNotif, subsetNotif); + } + console.log('PushAPI.channel.send | Response - 200 OK\n\n'); + } else { + console.log( + 'skipping PushAPI.channel.send as no channel exists with the signer\n\n' + ); + } + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + // These Examples requires wallet to hold some ETH & PUSH + const balance = await provider.getBalance(signer.address); + if (parseFloat(ethers.utils.formatEther(balance)) < 0.001) { + console.log( + 'skipping PushAPI.channel examples, wallet does not have enough balance to pay fee' + ); + } + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.channel.create'); + if (channelInfo) { + console.log('skipping PushAPI.channel.create as it already exists\n\n'); + } else { + const createdChannel = await userAlice.channel.create({ + name: 'Test Channel', + description: 'Test Description', + icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAz0lEQVR4AcXBsU0EQQyG0e+saWJ7oACiKYDMEZVs6GgSpC2BIhzRwAS0sgk9HKn3gpFOAv3v3V4/3+4U4Z1q5KTy42Ql940qvFONnFSGmCFmiN2+fj7uCBlihpgh1ngwcvKfwjuVIWaIGWKNB+GdauSk8uNkJfeNKryzYogZYoZY40m5b/wlQ8wQM8TayMlKeKcaOVkJ71QjJyuGmCFmiDUe+HFy4VyEd57hx0mV+0ZliBlihlgL71w4FyMnVXhnZeSkiu93qheuDDFDzBD7BcCyMAOfy204AAAAAElFTkSuQmCC', + url: 'https://push.org', + }); + if (showAPIResponse) { + console.log(createdChannel); + } + console.log('PushAPI.channel.create | Response - 200 OK\n\n'); + } + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.channel.update'); + const updatedChannel = await userAlice.channel.update({ + name: 'Updated Name', + description: 'Testing new description', + url: 'https://google.com', + icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAz0lEQVR4AcXBsU0EQQyG0e+saWJ7oACiKYDMEZVs6GgSpC2BIhzRwAS0sgk9HKn3gpFOAv3v3V4/3+4U4Z1q5KTy42Ql940qvFONnFSGmCFmiN2+fj7uCBlihpgh1ngwcvKfwjuVIWaIGWKNB+GdauSk8uNkJfeNKryzYogZYoZY40m5b/wlQ8wQM8TayMlKeKcaOVkJ71QjJyuGmCFmiDUe+HFy4VyEd57hx0mV+0ZliBlihlgL71w4FyMnVXhnZeSkiu93qheuDDFDzBD7BcCyMAOfy204AAAAAElFTkSuQmCC', + }); + if (showAPIResponse) { + console.log(updatedChannel); + } + console.log('PushAPI.channel.update | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.channel.verify'); + // only verified channels can verify other channels (otherwise this action is skipped by sdk) + if (channelInfo.verified_status) { + const verifiedTrx = await userAlice.channel.verify( + '0x35B84d6848D16415177c64D64504663b998A6ab4' + ); + if (showAPIResponse) { + console.log(verifiedTrx); + } + } + console.log('PushAPI.channel.verify | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.channel.setting'); + const channelSettingTrx = await userAlice.channel.setting([ + { type: 0, default: 1, description: 'My Notif Settings' }, + ]); + if (showAPIResponse) { + console.log(channelSettingTrx); + } + console.log('PushAPI.channel.setting | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.channel.delegate.add'); + const addedDelegate = await userAlice.channel.delegate.add( + `eip155:5:${randomWallet1}` + ); + + if (showAPIResponse) { + console.log(addedDelegate); + } + console.log('PushAPI.channel.delegate.add | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.channel.delegate.get'); + const delegates = await userAlice.channel.delegate.get(); + if (showAPIResponse) { + console.log(delegates); + } + console.log('PushAPI.channel.delegate.get | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.channel.delegate.remove'); + const removedDelegate = await userAlice.channel.delegate.remove( + `eip155:5:${randomWallet1}` + ); + if (showAPIResponse) { + console.log(removedDelegate); + } + console.log('PushAPI.channel.delegate.remove | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.channel.alias.info'); + const aliasInfo = await userAlice.channel.alias.info({ + alias: '0x35B84d6848D16415177c64D64504663b998A6ab4', + aliasChain: 'POLYGON', + }); + if (showAPIResponse) { + console.log(aliasInfo); + } + console.log('PushAPI.channel.alias.info | Response - 200 OK\n\n'); +}; diff --git a/packages/examples/sdk-backend-node/pushAPI/chat.ts b/packages/examples/sdk-backend-node/pushAPI/chat.ts new file mode 100644 index 000000000..f34973ec1 --- /dev/null +++ b/packages/examples/sdk-backend-node/pushAPI/chat.ts @@ -0,0 +1,227 @@ +import { PushAPI } from '@pushprotocol/restapi'; +import { + adjectives, + animals, + colors, + uniqueNamesGenerator, +} from 'unique-names-generator'; +import { config } from '../config'; +import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; +import { createWalletClient, http } from 'viem'; +import { goerli } from 'viem/chains'; + +// CONFIGS +const { env, showAPIResponse } = config; + +/***************** SAMPLE SIGNER GENERATION *********************/ +// Uing VIEM +// Random Wallet Signers +const signer = createWalletClient({ + account: privateKeyToAccount(generatePrivateKey()), + chain: goerli, + transport: http(), +}); +const signerAddress = signer.account.address; +const secondSigner = createWalletClient({ + account: privateKeyToAccount(generatePrivateKey()), + chain: goerli, + transport: http(), +}); +const secondSignerAddress = secondSigner.account.address; +const thirdSigner = createWalletClient({ + account: privateKeyToAccount(generatePrivateKey()), + chain: goerli, + transport: http(), +}); +const thirdSignerAddress = thirdSigner.account.address; + +// Dummy Wallet Addresses +const randomWallet1 = privateKeyToAccount(generatePrivateKey()).address; +const randomWallet2 = privateKeyToAccount(generatePrivateKey()).address; +const randomWallet3 = privateKeyToAccount(generatePrivateKey()).address; +/****************************************************************/ + +/***************** SAMPLE GROUP DATA ****************************/ +const groupName = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], +}); +const groupDescription = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], +}); +const groupImage = + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg=='; +/***************** SAMPLE GROUP DATA ****************************/ + +export const runPushAPIChatCases = async (): Promise => { + const userAlice = await PushAPI.initialize(signer, { env }); + const userBob = await PushAPI.initialize(secondSigner, { env }); + const tempUser = await PushAPI.initialize(thirdSigner, { env }); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.chat.list'); + const aliceChats = await userAlice.chat.list('CHATS'); + const aliceRequests = await userAlice.chat.list('REQUESTS'); + if (showAPIResponse) { + console.log(aliceChats); + console.log(aliceRequests); + } + console.log('PushAPI.chat.list | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.chat.latest'); + const aliceLatestChatWithBob = await userAlice.chat.latest( + secondSignerAddress + ); + if (showAPIResponse) { + console.log(aliceLatestChatWithBob); + } + console.log('PushAPI.chat.latest | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.chat.history'); + const aliceChatHistoryWithBob = await userAlice.chat.history( + secondSignerAddress + ); + if (showAPIResponse) { + console.log(aliceChatHistoryWithBob); + } + console.log('PushAPI.chat.history | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.chat.send'); + const aliceMessagesBob = await userAlice.chat.send(secondSignerAddress, { + content: 'Hello Bob!', + type: 'Text', + }); + if (showAPIResponse) { + console.log(aliceMessagesBob); + } + console.log('PushAPI.chat.send | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.chat.accept'); + const bobAcceptsRequest = await userBob.chat.accept(signerAddress); + if (showAPIResponse) { + console.log(bobAcceptsRequest); + } + console.log('PushAPI.chat.accept | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.chat.reject'); + await tempUser.chat.send(secondSignerAddress, { + content: 'Sending malicious message', + type: 'Text', + }); + const bobRejectsRequest = await userBob.chat.reject(thirdSignerAddress); + if (showAPIResponse) { + console.log(bobRejectsRequest); + } + console.log('PushAPI.chat.reject | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.chat.block'); + const AliceBlocksBob = await userAlice.chat.block([secondSignerAddress]); + if (showAPIResponse) { + console.log(AliceBlocksBob); + } + console.log('PushAPI.chat.block | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.chat.unblock'); + const AliceUnblocksBob = await userAlice.chat.unblock([secondSignerAddress]); + if (showAPIResponse) { + console.log(AliceUnblocksBob); + } + console.log('PushAPI.chat.unblock | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.create'); + const createdGroup = await userAlice.chat.group.create(groupName, { + description: groupDescription, + image: groupImage, + members: [randomWallet1, randomWallet2], + admins: [], + private: false, + }); + const groupChatId = createdGroup.chatId; // to be used in other examples + if (showAPIResponse) { + console.log(createdGroup); + } + console.log('PushAPI.group.create | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.permissions'); + const grouppermissions = await userAlice.chat.group.permissions(groupChatId); + if (showAPIResponse) { + console.log(grouppermissions); + } + console.log('PushAPI.group.permissions | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.info'); + const groupInfo = await userAlice.chat.group.info(groupChatId); + if (showAPIResponse) { + console.log(groupInfo); + } + console.log('PushAPI.group.info | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.update'); + const updatedGroup = await userAlice.chat.group.update(groupChatId, { + description: 'Updated Description', + }); + if (showAPIResponse) { + console.log(updatedGroup); + } + console.log('PushAPI.group.update | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.add'); + const addMember = await userAlice.chat.group.add(groupChatId, { + role: 'MEMBER', + accounts: [randomWallet3], + }); + if (showAPIResponse) { + console.log(addMember); + } + console.log('PushAPI.group.add | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.remove'); + const removeMember = await userAlice.chat.group.remove(groupChatId, { + role: 'MEMBER', + accounts: [randomWallet3], + }); + if (showAPIResponse) { + console.log(removeMember); + } + console.log('PushAPI.group.remove | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.join'); + const joinGrp = await userBob.chat.group.join(groupChatId); + if (showAPIResponse) { + console.log(joinGrp); + } + console.log('PushAPI.group.join | Response - 200 OK\n\n'); + //------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.leave'); + const leaveGrp = await userBob.chat.group.leave(groupChatId); + if (showAPIResponse) { + console.log(leaveGrp); + } + console.log('PushAPI.group.leave | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.reject'); + const sampleGrp = await userAlice.chat.group.create('Sample Grp', { + description: groupDescription, + image: groupImage, + members: [secondSignerAddress], // invite bob + admins: [], + private: true, + }); + await userBob.chat.group.reject(sampleGrp.chatId); + console.log('PushAPI.group.reject | Response - 200 OK\n\n'); +}; diff --git a/packages/examples/sdk-backend-node/pushAPI/encryption.ts b/packages/examples/sdk-backend-node/pushAPI/encryption.ts new file mode 100644 index 000000000..67300c65f --- /dev/null +++ b/packages/examples/sdk-backend-node/pushAPI/encryption.ts @@ -0,0 +1,38 @@ +import { PushAPI } from '@pushprotocol/restapi'; +import { config } from '../config'; +import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; +import { createWalletClient, http } from 'viem'; +import { goerli } from 'viem/chains'; + +// CONFIGS +const { env, showAPIResponse } = config; + +/***************** SAMPLE SIGNER GENERATION *********************/ +// Uing VIEM +// Random Wallet Signers +const signer = createWalletClient({ + account: privateKeyToAccount(generatePrivateKey()), + chain: goerli, + transport: http(), +}); + +export const runPushAPIEncryptionCases = async (): Promise => { + const userAlice = await PushAPI.initialize(signer, { env }); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.encryption.info'); + const encryptionInfo = await userAlice.encryption.info(); + if (showAPIResponse) { + console.log(encryptionInfo); + } + console.log('PushAPI.encryption.info | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.encryption.update'); + const PGP_V3 = 'eip191-aes256-gcm-hkdf-sha256'; + const encryptionUpdate = await userAlice.encryption.update(PGP_V3 as any); + if (showAPIResponse) { + console.log(encryptionUpdate); + } + console.log('PushAPI.encryption.update | Response - 200 OK\n\n'); +}; diff --git a/packages/examples/sdk-backend-node/pushAPI/index.ts b/packages/examples/sdk-backend-node/pushAPI/index.ts index 60fdd8285..e7931842c 100644 --- a/packages/examples/sdk-backend-node/pushAPI/index.ts +++ b/packages/examples/sdk-backend-node/pushAPI/index.ts @@ -1,15 +1,14 @@ import { PushAPI } from '@pushprotocol/restapi'; -import { - adjectives, - animals, - colors, - uniqueNamesGenerator, -} from 'unique-names-generator'; import { config } from '../config'; import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; import { createWalletClient, http } from 'viem'; import { goerli } from 'viem/chains'; -import { createSocketConnection, EVENTS } from '@pushprotocol/socket'; +import { runPushAPIChatCases } from './chat'; +import { runPushAPIEncryptionCases } from './encryption'; +import { runPushAPINotificationCases } from './notification'; +import { runPushAPIProfileCases } from './profile'; +import { runPushAPIStreamCases } from './stream'; +import { runPushAPIChannelCases } from './channel'; // CONFIGS const { env, showAPIResponse } = config; @@ -22,35 +21,6 @@ const signer = createWalletClient({ chain: goerli, transport: http(), }); -const signerAddress = signer.account.address; -const secondSigner = createWalletClient({ - account: privateKeyToAccount(generatePrivateKey()), - chain: goerli, - transport: http(), -}); -const secondSignerAddress = secondSigner.account.address; -const thirdSigner = createWalletClient({ - account: privateKeyToAccount(generatePrivateKey()), - chain: goerli, - transport: http(), -}); -const thirdSignerAddress = thirdSigner.account.address; -// Dummy Wallet Addresses -const randomWallet1 = privateKeyToAccount(generatePrivateKey()).address; -const randomWallet2 = privateKeyToAccount(generatePrivateKey()).address; -const randomWallet3 = privateKeyToAccount(generatePrivateKey()).address; -/****************************************************************/ - -/***************** SAMPLE GROUP DATA ****************************/ -const groupName = uniqueNamesGenerator({ - dictionaries: [adjectives, colors, animals], -}); -const groupDescription = uniqueNamesGenerator({ - dictionaries: [adjectives, colors, animals], -}); -const groupImage = - 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg=='; -/***************** SAMPLE GROUP DATA ****************************/ export const runPushAPICases = async (): Promise => { console.log(` @@ -66,10 +36,10 @@ export const runPushAPICases = async (): Promise => { // ------------------------------------------------------------------- console.log('PushAPI.initialize'); const userAlice = await PushAPI.initialize(signer, { env }); - const userBob = await PushAPI.initialize(secondSigner, { env }); console.log('PushAPI.initialize | Response - 200 OK\n\n'); // ------------------------------------------------------------------- // ------------------------------------------------------------------- + // todo : This is yet to be discussed console.log('PushAPI.info'); const userAliceInfo = await userAlice.info(); if (showAPIResponse) { @@ -78,228 +48,10 @@ export const runPushAPICases = async (): Promise => { console.log('PushAPI.info | Response - 200 OK\n\n'); // ------------------------------------------------------------------- // ------------------------------------------------------------------- - console.log('PushAPI.profile.info'); - const userAliceProfileInfo = await userAlice.profile.info(); - if (showAPIResponse) { - console.log(userAliceProfileInfo); - } - console.log('PushAPI.profile.info | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.profile.update'); - const updatedName = 'Bob The Builder'; - const response = await userAlice.profile.update({ name: updatedName }); - if (showAPIResponse) { - console.log(response); - } - console.log('PushAPI.profile.update | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.list'); - const aliceChats = await userAlice.chat.list('CHATS'); - const aliceRequests = await userAlice.chat.list('REQUESTS'); - if (showAPIResponse) { - console.log(aliceChats); - console.log(aliceRequests); - } - console.log('PushAPI.chat.list | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.latest'); - const aliceLatestChatWithBob = await userAlice.chat.latest( - secondSignerAddress - ); - if (showAPIResponse) { - console.log(aliceLatestChatWithBob); - } - console.log('PushAPI.chat.latest | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.history'); - const aliceChatHistoryWithBob = await userAlice.chat.history( - secondSignerAddress - ); - if (showAPIResponse) { - console.log(aliceChatHistoryWithBob); - } - console.log('PushAPI.chat.history | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.send'); - const aliceMessagesBob = await userAlice.chat.send(secondSignerAddress, { - content: 'Hello Bob!', - type: 'Text', - }); - if (showAPIResponse) { - console.log(aliceMessagesBob); - } - console.log('PushAPI.chat.send | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.decrypt'); - const pushSDKSocket = createSocketConnection({ - user: signerAddress, - socketType: 'chat', - socketOptions: { autoConnect: true, reconnectionAttempts: 3 }, - env: env, - }); - if (pushSDKSocket) { - await userAlice.chat.send(secondSignerAddress, { - content: 'Hello Bob!', - type: 'Text', - }); - pushSDKSocket.on(EVENTS.CHAT_RECEIVED_MESSAGE, async (message) => { - // uncomment after latest sdk deployment - // await userAlice.chat.decrypt([message]); - // pushSDKSocket.disconnect(); - }); - } - console.log('PushAPI.chat.decrypt | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.accept'); - const bobAcceptsRequest = await userBob.chat.accept(signerAddress); - if (showAPIResponse) { - console.log(bobAcceptsRequest); - } - console.log('PushAPI.chat.accept | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.reject'); - const tempUser = await PushAPI.initialize(thirdSigner, { env }); - await tempUser.chat.send(secondSignerAddress, { - content: 'Sending Malicious message to bob', - }); - const bobRejectsRequest = await userBob.chat.reject(thirdSignerAddress); - if (showAPIResponse) { - console.log(bobRejectsRequest); - } - console.log('PushAPI.chat.reject | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.block'); - const AliceBlocksBob = await userAlice.chat.block([secondSignerAddress]); - if (showAPIResponse) { - console.log(AliceBlocksBob); - } - console.log('PushAPI.chat.block | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.unblock'); - const AliceUnblocksBob = await userAlice.chat.unblock([secondSignerAddress]); - if (showAPIResponse) { - console.log(AliceUnblocksBob); - } - console.log('PushAPI.chat.unblock | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.create'); - const createdGroup = await userAlice.chat.group.create(groupName, { - description: groupDescription, - image: groupImage, - members: [randomWallet1, randomWallet2], - admins: [], - private: false, - }); - const groupChatId = createdGroup.chatId; // to be used in other examples - if (showAPIResponse) { - console.log(createdGroup); - } - console.log('PushAPI.group.create | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.permissions'); - const grouppermissions = await userAlice.chat.group.permissions(groupChatId); - if (showAPIResponse) { - console.log(grouppermissions); - } - console.log('PushAPI.group.permissions | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.info'); - const groupInfo = await userAlice.chat.group.info(groupChatId); - if (showAPIResponse) { - console.log(groupInfo); - } - console.log('PushAPI.group.info | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.update'); - const updatedGroup = await userAlice.chat.group.update(groupChatId, { - description: 'Updated Description', - }); - if (showAPIResponse) { - console.log(updatedGroup); - } - console.log('PushAPI.group.update | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.add'); - const addMember = await userAlice.chat.group.add(groupChatId, { - role: 'MEMBER', - accounts: [randomWallet3], - }); - if (showAPIResponse) { - console.log(addMember); - } - console.log('PushAPI.group.add | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.remove'); - const removeMember = await userAlice.chat.group.remove(groupChatId, { - role: 'MEMBER', - accounts: [randomWallet3], - }); - if (showAPIResponse) { - console.log(removeMember); - } - console.log('PushAPI.group.remove | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.join'); - const joinGrp = await userBob.chat.group.join(groupChatId); - if (showAPIResponse) { - console.log(joinGrp); - } - console.log('PushAPI.group.join | Response - 200 OK\n\n'); - //------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.leave'); - const leaveGrp = await userBob.chat.group.leave(groupChatId); - if (showAPIResponse) { - console.log(leaveGrp); - } - console.log('PushAPI.group.leave | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.reject'); - const sampleGrp = await userAlice.chat.group.create('Sample Grp', { - description: groupDescription, - image: groupImage, - members: [secondSignerAddress], // invite bob - admins: [], - private: true, - }); - const rejectGrpJoiningReq = await userBob.chat.group.reject(sampleGrp.chatId); - if (showAPIResponse) { - console.log(rejectGrpJoiningReq); - } - console.log('PushAPI.group.reject | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.encryption.info'); - const encryptionInfo = await userAlice.encryption.info(); - if (showAPIResponse) { - console.log(encryptionInfo); - } - console.log('PushAPI.encryption.info | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.encryption.update'); - const PGP_V3 = 'eip191-aes256-gcm-hkdf-sha256'; - const encryptionUpdate = await userAlice.encryption.update(PGP_V3 as any); - if (showAPIResponse) { - console.log(encryptionUpdate); - } - console.log('PushAPI.encryption.update | Response - 200 OK\n\n'); + await runPushAPIProfileCases(); // PushAPI.profile + await runPushAPIChatCases(); // PushAPI.chat + await runPushAPIEncryptionCases(); // PushAPI.encryption + await runPushAPINotificationCases(); // PushAPI.notification + await runPushAPIChannelCases(); // PushAPI.channel + await runPushAPIStreamCases(); // PushAPI.stream }; diff --git a/packages/examples/sdk-backend-node/pushAPI/notification.ts b/packages/examples/sdk-backend-node/pushAPI/notification.ts new file mode 100644 index 000000000..579ea1e2b --- /dev/null +++ b/packages/examples/sdk-backend-node/pushAPI/notification.ts @@ -0,0 +1,58 @@ +import { PushAPI } from '@pushprotocol/restapi'; +import { config } from '../config'; +import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; +import { createWalletClient, http } from 'viem'; +import { goerli } from 'viem/chains'; + +// CONFIGS +const { env, showAPIResponse } = config; + +/***************** SAMPLE SIGNER GENERATION *********************/ +// Uing VIEM +// Random Wallet Signers +const signer = createWalletClient({ + account: privateKeyToAccount(generatePrivateKey()), + chain: goerli, + transport: http(), +}); + +export const runPushAPINotificationCases = async (): Promise => { + const userAlice = await PushAPI.initialize(signer, { env }); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.notification.list'); + const inboxNotifications = await userAlice.notification.list('INBOX'); + const spamNotifications = await userAlice.notification.list('SPAM'); + if (showAPIResponse) { + console.log(inboxNotifications, spamNotifications); + } + console.log('PushAPI.notification.list | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.notification.subscribe'); + const subscribeResponse = await userAlice.notification.subscribe( + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' // channel to subscribe + ); + if (showAPIResponse) { + console.log(subscribeResponse); + } + console.log('PushAPI.notification.subscribe | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.notification.subscriptions'); + const aliceSubscriptions = await userAlice.notification.subscriptions(); + if (showAPIResponse) { + console.log(aliceSubscriptions); + } + console.log('PushAPI.notification.subscriptions | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.notification.unsubscribe'); + const unsubscribeResponse = await userAlice.notification.unsubscribe( + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' // channel to unsubscribe + ); + if (showAPIResponse) { + console.log(unsubscribeResponse); + } + console.log('PushAPI.notification.unsubscribe | Response - 200 OK\n\n'); +}; diff --git a/packages/examples/sdk-backend-node/pushAPI/profile.ts b/packages/examples/sdk-backend-node/pushAPI/profile.ts new file mode 100644 index 000000000..f72d93f1b --- /dev/null +++ b/packages/examples/sdk-backend-node/pushAPI/profile.ts @@ -0,0 +1,38 @@ +import { PushAPI } from '@pushprotocol/restapi'; +import { config } from '../config'; +import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; +import { createWalletClient, http } from 'viem'; +import { goerli } from 'viem/chains'; + +// CONFIGS +const { env, showAPIResponse } = config; + +/***************** SAMPLE SIGNER GENERATION *********************/ +// Uing VIEM +// Random Wallet Signers +const signer = createWalletClient({ + account: privateKeyToAccount(generatePrivateKey()), + chain: goerli, + transport: http(), +}); + +export const runPushAPIProfileCases = async (): Promise => { + const userAlice = await PushAPI.initialize(signer, { env }); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.profile.info'); + const userAliceProfileInfo = await userAlice.profile.info(); + if (showAPIResponse) { + console.log(userAliceProfileInfo); + } + console.log('PushAPI.profile.info | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.profile.update'); + const updatedName = 'Bob The Builder'; + const response = await userAlice.profile.update({ name: updatedName }); + if (showAPIResponse) { + console.log(response); + } + console.log('PushAPI.profile.update | Response - 200 OK\n\n'); +}; diff --git a/packages/examples/sdk-backend-node/pushAPI/stream.ts b/packages/examples/sdk-backend-node/pushAPI/stream.ts new file mode 100644 index 000000000..e10c599c8 --- /dev/null +++ b/packages/examples/sdk-backend-node/pushAPI/stream.ts @@ -0,0 +1,202 @@ +import { PushAPI } from '@pushprotocol/restapi'; +import { config } from '../config'; +import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; +import { createWalletClient, http } from 'viem'; +import { goerli } from 'viem/chains'; +import { STREAM } from '@pushprotocol/restapi/src/lib/pushstream/pushStreamTypes'; + +// CONFIGS +const { env, showAPIResponse } = config; + +/***************** SAMPLE SIGNER GENERATION *********************/ +// Uing VIEM +// Random Wallet Signers +const signer = createWalletClient({ + account: privateKeyToAccount(generatePrivateKey()), + chain: goerli, + transport: http(), +}); +const signerAddress = signer.account.address; +const secondSigner = createWalletClient({ + account: privateKeyToAccount(generatePrivateKey()), + chain: goerli, + transport: http(), +}); +const secondSignerAddress = secondSigner.account.address; +const thirdSigner = createWalletClient({ + account: privateKeyToAccount(generatePrivateKey()), + chain: goerli, + transport: http(), +}); +const thirdSignerAddress = thirdSigner.account.address; +// Dummy Wallet Addresses +const randomWallet1 = privateKeyToAccount(generatePrivateKey()).address; + +const eventlistener = async ( + pushAPI: PushAPI, + eventName: string +): Promise => { + pushAPI.stream.on(eventName, (data: any) => { + if (showAPIResponse) { + console.log(data); + } + }); +}; + +const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + +export const runPushAPIStreamCases = async (): Promise => { + const userAlice = await PushAPI.initialize(signer, { env }); + const userBob = await PushAPI.initialize(secondSigner, { env }); + const userKate = await PushAPI.initialize(thirdSigner, { env }); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log(`Listening ${STREAM.PROFILE} Events`); + eventlistener(userAlice, STREAM.PROFILE); + console.log(`Listening ${STREAM.ENCRYPTION} Events`); + eventlistener(userAlice, STREAM.ENCRYPTION); + console.log(`Listening ${STREAM.NOTIF} Events`); + eventlistener(userAlice, STREAM.NOTIF); + console.log(`Listening ${STREAM.NOTIF_OPS} Events`); + eventlistener(userAlice, STREAM.NOTIF_OPS); + console.log(`Listening ${STREAM.CHAT} Events`); + eventlistener(userAlice, STREAM.CHAT); + console.log(`Listening ${STREAM.CHAT_OPS} Events`); + eventlistener(userAlice, STREAM.CHAT_OPS); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('\n\nNew Chat Request, Expected Events:\n1. chat.request'); + await userAlice.chat.send(secondSignerAddress, { + content: 'Hello Bob! from Alice', + }); + await delay(3000); // Delay added to log the events in order + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('\n\nNew Chat Request, Expected Events:\n1. chat.request'); + await userAlice.chat.send(thirdSignerAddress, { + content: 'Hello Kate! from Alice', + }); + await delay(3000); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('\n\nChat Request Accept, Expected Events:\n1. chat.accept'); + await userBob.chat.accept(signerAddress); + await delay(3000); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('\n\nChat Request Reject, Expected Events:\n1. chat.reject'); + await userKate.chat.reject(signerAddress); + await delay(3000); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('\n\nCreate Chat Group, Expected Events:\n1. chat.group.create'); + const groupChatId = ( + await userAlice.chat.group.create('Test Grp', { + description: 'Test Desc', + image: + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==', + members: [secondSignerAddress, thirdSignerAddress], + admins: [], + private: false, + }) + ).chatId; + await delay(3000); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('\n\nUpdate Chat Group, Expected Events:\n1. chat.group.update'); + await userAlice.chat.group.update(groupChatId, { + description: 'Updated Test Desc', + image: + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==', + }); + await delay(3000); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('\n\nAdd member to Group, Expected Events:\n1. chat.request'); + await userAlice.chat.group.add(groupChatId, { + role: 'MEMBER', + accounts: [randomWallet1], + }); + await delay(3000); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log( + '\n\nRemove member from Group, Expected Events:\n1. chat.group.participant.remove' + ); + await userAlice.chat.group.remove(groupChatId, { + role: 'MEMBER', + accounts: [randomWallet1], + }); + await delay(3000); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('\n\nAdd Admin to Group, Expected Events:\n1. chat.request'); + await userAlice.chat.group.add(groupChatId, { + role: 'ADMIN', + accounts: [randomWallet1], + }); + await delay(3000); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log( + '\n\nRemove Admin from Group, Expected Events:\n1. chat.group.participant.remove' + ); + await userAlice.chat.group.remove(groupChatId, { + role: 'ADMIN', + accounts: [randomWallet1], + }); + await delay(3000); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('\n\nJoin Group, Expected Events:\n1. chat.accept'); + await userBob.chat.group.join(groupChatId); + await delay(3000); + //------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log( + '\n\nLeave Group, Expected Events:\n1. chat.group.participant.leave' + ); + await userBob.chat.group.leave(groupChatId); + await delay(3000); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log( + '\n\nReject Group Joining Request, Expected Events:\n1. chat.reject' + ); + await userKate.chat.group.reject(groupChatId); + await delay(3000); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + if (process.env.WALLET_PRIVATE_KEY) { + // create signer + const channelSigner = createWalletClient({ + account: privateKeyToAccount(`0x${process.env.WALLET_PRIVATE_KEY}`), + chain: goerli, + transport: http(), + }); + + await userAlice.notification.subscribe( + `eip155:5:${channelSigner.account.address}` // channel to subscribe + ); + + const channelUser = await PushAPI.initialize(channelSigner, { env }); + console.log( + '\n\nSend channel notification, Expected Events:\n1. notif.send' + ); + await channelUser.channel.send(['*'], { + notification: { + title: 'test', + body: 'test', + }, + }); + await delay(3000); + + await userAlice.notification.unsubscribe( + `eip155:5:${channelSigner.account.address}` // channel to subscribe + ); + } else { + console.log( + 'Skipping channel notification streams, as WALLET_PRIVATE_KEY is not present in .env' + ); + } +}; From e86b846efd800464d164615526b39f975388ccbd Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 4 Oct 2023 12:36:13 +0530 Subject: [PATCH 06/18] Message Type Implementations (#730) * fix: added video & audio messages * fix: fixed meta, reaction & added intent & readReceipt * fix: added reply * fix: added composite, fixed receipt --- packages/restapi/README.md | 17 +- packages/restapi/src/lib/chat/send.ts | 89 +- packages/restapi/src/lib/constants.ts | 21 +- packages/restapi/src/lib/space/Space.ts | 4 +- .../src/lib/space/broadcastRaisedHand.ts | 4 +- .../src/lib/space/helpers/getLiveSpaceData.ts | 4 +- .../lib/space/helpers/sendLiveSpaceData.ts | 6 +- .../restapi/src/lib/space/onJoinListener.ts | 15 +- .../src/lib/space/onReceiveMetaMessage.ts | 6 +- .../src/lib/space/rejectPromotionRequest.ts | 4 +- packages/restapi/src/lib/space/start.ts | 4 +- .../restapi/src/lib/types/messageTypes.ts | 176 ++- .../src/lib/validations/messageObject.ts | 157 +- packages/restapi/tests/lib/chat/send.test.ts | 1390 ++++++++++++++++- .../lib/progressHook/progressHook.test.ts | 9 +- 15 files changed, 1667 insertions(+), 239 deletions(-) diff --git a/packages/restapi/README.md b/packages/restapi/README.md index fc50d8c05..8b2e45470 100644 --- a/packages/restapi/README.md +++ b/packages/restapi/README.md @@ -4569,15 +4569,14 @@ const aliceMessagesBob = await userAlice.chat.send(bobAddress, { }); ``` -| Param | Type | Default | Remarks | -| ---------------------- | ---------------------------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------- | -| `recipient` | `string` | - | Recipient ( For Group Chats target is chatId, for 1 To 1 chat target is Push DID ) | -| `options` | `object` | - | Configuration for message to be sent | -| `options.type` \* | `Text` or `Image` or `File` or `MediaEmbed` or `GIF` or `Meta` or `Reaction` | - | Type of message Content | -| `options.content` | `string` | - | Message Content | -| `options.action` \* | `string` | - | Message action ( Only available for Meta & Reaction Messages ) | -| `options.reference` \* | `string` or `null` | - | Message reference hash ( Only available for Reaction Messages ) | -| `options.info` \* | `{ affected : string[]: arbitrary?: { [key: string]: any } }` | - | Message reference hash ( Only available for Meta Messages ) | +| Param | Type | Default | Remarks | +| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------- | +| `recipient` | `string` | - | Recipient ( For Group Chats target is chatId, for 1 To 1 chat target is Push DID ) | +| `options` | `object` | - | Configuration for message to be sent | +| `options.type` \* | `Text` or `Image` or `Audio` or `Video` or `File` or `MediaEmbed` or `GIF` or `Meta` or `Reaction` or `Receipt` or `Intent` or `Reply` or `Composite` | - | Type of message Content | +| `options.content` | `string` or `{type: `Text`or`Image`or`Audio`or`Video`or`File`or`MediaEmbed`or`GIF` ; content: string}` [For Reply] or `{type: `Text`or`Image`or`Audio`or`Video`or`File`or`MediaEmbed`or`GIF` ; content: string}[]` [For Composite] | - | Message Content | +| `options.reference` \* | `string` | - | Message reference hash ( Only available for Reaction & Reply Messages ) | +| `options.info` \* | `{ affected : string[]: arbitrary?: { [key: string]: any } }` | - | Message reference hash ( Only available for Meta & UserActivity Messages ) | \* - Optional diff --git a/packages/restapi/src/lib/chat/send.ts b/packages/restapi/src/lib/chat/send.ts index 30a396495..095f0fa73 100644 --- a/packages/restapi/src/lib/chat/send.ts +++ b/packages/restapi/src/lib/chat/send.ts @@ -11,16 +11,8 @@ import { import { conversationHash } from './conversationHash'; import { ISendMessagePayload, sendMessagePayload } from './helpers'; import { getGroup } from './getGroup'; -import { - MessageObj, - REACTION_SYMBOL, - ReactionMessage, -} from '../types/messageTypes'; -import { - messageObjSchema, - metaMessageObjSchema, - reationMessageObjSchema, -} from '../validations/messageObject'; +import { MessageObj } from '../types/messageTypes'; +import { validateMessageObj } from '../validations/messageObject'; /** * SENDS A PUSH CHAT MESSAGE @@ -54,14 +46,18 @@ export const send = async ( }) : null; - // OVERRIDE CONTENT FOR REACTION MESSAGE - if (messageType === MessageType.REACTION) { - messageObj.content = - REACTION_SYMBOL[(messageObj as Omit).action]; + // Not supported by legacy sdk versions, need to override messageContent to avoid parsing errors on legacy sdk versions + let messageContent: string; + if ( + messageType === MessageType.REPLY || + messageType === MessageType.COMPOSITE + ) { + messageContent = + 'MessageType Not Supported by this sdk version. Plz upgrade !!!'; + } else { + messageContent = messageObj.content as string; } - const messageContent = messageObj.content; // provide backward compatibility & override deprecated field - const conversationResponse = await conversationHash({ conversationId: receiver, account: sender.did, @@ -138,36 +134,7 @@ const validateOptions = async (options: ComputedOptionsType) => { } } - if ( - messageType === MessageType.TEXT || - messageType === MessageType.IMAGE || - messageType === MessageType.FILE || - messageType === MessageType.MEDIA_EMBED || - messageType === MessageType.GIF - ) { - const { error } = messageObjSchema.validate(messageObj); - if (error) { - throw new Error( - `Unable to parse this messageType. Please ensure 'messageObj' is properly defined.` - ); - } - } - - if (messageType === MessageType.META) { - const { error } = metaMessageObjSchema.validate(messageObj); - if (error) { - throw new Error( - `Unable to parse this messageType. Please ensure 'messageObj' is properly defined.` - ); - } - } else if (messageType === MessageType.REACTION) { - const { error } = reationMessageObjSchema.validate(messageObj); - if (error) { - throw new Error( - `Unable to parse this messageType. Please ensure 'messageObj' is properly defined.` - ); - } - } + validateMessageObj(messageObj, messageType); }; const computeOptions = (options: ChatSendOptionsType): ComputedOptionsType => { @@ -203,6 +170,36 @@ const computeOptions = (options: ChatSendOptionsType): ComputedOptionsType => { messageObj = rest; } + // Parse Reply Message + if (messageType === MessageType.REPLY) { + if (typeof messageObj.content === 'object') { + const { type, ...rest } = messageObj.content; + messageObj.content = { + messageType: type, + messageObj: rest, + }; + } else { + throw new Error('Options.message is not properly defined for Reply'); + } + } + + // Parse Composite Message + if (messageType === MessageType.COMPOSITE) { + if (messageObj.content instanceof Array) { + messageObj.content = messageObj.content.map( + (obj: { type: string; content: string }) => { + const { type, ...rest } = obj; + return { + messageType: type, + messageObj: rest, + }; + } + ); + } else { + throw new Error('Options.message is not properly defined for Composite'); + } + } + const account = options.account !== undefined ? options.account : null; const to = options.to !== undefined ? options.to : options.receiverAddress; diff --git a/packages/restapi/src/lib/constants.ts b/packages/restapi/src/lib/constants.ts index 595f52077..94d46f3d4 100644 --- a/packages/restapi/src/lib/constants.ts +++ b/packages/restapi/src/lib/constants.ts @@ -27,21 +27,20 @@ export enum ENCRYPTION_TYPE { export enum MessageType { TEXT = 'Text', IMAGE = 'Image', + VIDEO = 'Video', + AUDIO = 'Audio', FILE = 'File', + /** @deprecated - Use `MediaEmbed` Instead */ + GIF = 'GIF', MEDIA_EMBED = 'MediaEmbed', META = 'Meta', REACTION = 'Reaction', - /** - * @deprecated - Use MediaEmbed Instead - */ - GIF = 'GIF', - - // TODO - // AUDIO = 'Audio', - // VIDEO = 'Video', - // PAYMENT = 'Payment', - // REPLY = 'Reply', - // COMPOSITE = 'Composite', + RECEIPT = 'Receipt', + USER_ACTIVITY = 'UserActivity', + INTENT = 'Intent', + REPLY = 'Reply', + COMPOSITE = 'Composite', + PAYMENT = 'Payment', } const Constants = { diff --git a/packages/restapi/src/lib/space/Space.ts b/packages/restapi/src/lib/space/Space.ts index 7ddd78b27..a466da5fb 100644 --- a/packages/restapi/src/lib/space/Space.ts +++ b/packages/restapi/src/lib/space/Space.ts @@ -29,7 +29,7 @@ import { } from '../types'; import { VIDEO_CALL_TYPE } from '../payloads/constants'; import sendLiveSpaceData from './helpers/sendLiveSpaceData'; -import { META_ACTION } from '../types/messageTypes'; +import { CHAT } from '../types/messageTypes'; import { broadcastRaisedHand } from './broadcastRaisedHand'; import { onReceiveMetaMessage } from './onReceiveMetaMessage'; import { onJoinListener } from './onJoinListener'; @@ -157,7 +157,7 @@ export class Space extends Video { env: this.env, spaceId: this.spaceSpecificData.spaceId, signer: this.signer, - action: META_ACTION.PROMOTE_TO_ADMIN, // TODO: Add a meta action for SPEAKER_JOINED + action: CHAT.META.GROUP.ADMIN.PRVILEGE, // TODO: Add a meta action for SPEAKER_JOINED }); } }, diff --git a/packages/restapi/src/lib/space/broadcastRaisedHand.ts b/packages/restapi/src/lib/space/broadcastRaisedHand.ts index db2c0b1c9..d90b706e8 100644 --- a/packages/restapi/src/lib/space/broadcastRaisedHand.ts +++ b/packages/restapi/src/lib/space/broadcastRaisedHand.ts @@ -1,6 +1,6 @@ import { produce } from 'immer'; import sendLiveSpaceData from './helpers/sendLiveSpaceData'; -import { META_ACTION } from '../types/messageTypes'; +import { CHAT } from '../types/messageTypes'; import { pCAIP10ToWallet } from '../helpers'; import type Space from './Space'; @@ -41,6 +41,6 @@ export async function broadcastRaisedHand( env: this.env, spaceId: this.spaceSpecificData.spaceId, signer: this.signer, - action: META_ACTION.USER_INTERACTION, + action: CHAT.META.GROUP.USER.INTERACTION, }); } diff --git a/packages/restapi/src/lib/space/helpers/getLiveSpaceData.ts b/packages/restapi/src/lib/space/helpers/getLiveSpaceData.ts index 4d3f952a4..7f8896b00 100644 --- a/packages/restapi/src/lib/space/helpers/getLiveSpaceData.ts +++ b/packages/restapi/src/lib/space/helpers/getLiveSpaceData.ts @@ -1,7 +1,7 @@ import { conversationHash, history } from '../../chat'; import { MessageType } from '../../constants'; import { EnvOptionsType, LiveSpaceData } from '../../types'; -import { MetaMessage } from '../../types/messageTypes'; +import { InfoMessage } from '../../types/messageTypes'; import { initLiveSpaceData } from '../Space'; interface GetLatestMessageType extends EnvOptionsType { @@ -54,7 +54,7 @@ const getLiveSpaceData = async ({ latestMetaMessage.messageObj !== null ) { // found the latest meta message - liveSpaceData = (latestMetaMessage.messageObj as Omit) + liveSpaceData = (latestMetaMessage.messageObj as Omit) ?.info?.arbitrary as LiveSpaceData; } diff --git a/packages/restapi/src/lib/space/helpers/sendLiveSpaceData.ts b/packages/restapi/src/lib/space/helpers/sendLiveSpaceData.ts index 78cb59fb1..099eed844 100644 --- a/packages/restapi/src/lib/space/helpers/sendLiveSpaceData.ts +++ b/packages/restapi/src/lib/space/helpers/sendLiveSpaceData.ts @@ -1,11 +1,10 @@ import { send } from '../../chat'; import { MessageType } from '../../constants'; import { EnvOptionsType, LiveSpaceData, SignerType } from '../../types'; -import { META_ACTION } from '../../types/messageTypes'; interface SendLiveSpaceData extends EnvOptionsType { liveSpaceData?: LiveSpaceData; - action: META_ACTION; + action: string; spaceId: string; pgpPrivateKey: string; signer: SignerType; @@ -26,8 +25,7 @@ const sendLiveSpaceData = async ({ signer, messageType: MessageType.META, messageObj: { - content: 'PUSH SPACE META MESSAGE', - action, + content: action, info: { affected: [], arbitrary: liveSpaceData, diff --git a/packages/restapi/src/lib/space/onJoinListener.ts b/packages/restapi/src/lib/space/onJoinListener.ts index 30db1c4dd..72aa30c68 100644 --- a/packages/restapi/src/lib/space/onJoinListener.ts +++ b/packages/restapi/src/lib/space/onJoinListener.ts @@ -3,7 +3,7 @@ import { get } from './get'; import { pCAIP10ToWallet } from '../helpers'; import { produce } from 'immer'; -import { META_ACTION } from '../types/messageTypes'; +import { CHAT } from '../types/messageTypes'; import type Space from './Space'; export interface OnJoinListenerType { @@ -43,11 +43,12 @@ export async function onJoinListener(this: Space, options: OnJoinListenerType) { const modifiedLiveSpaceData = produce( this.spaceSpecificData.liveSpaceData, (draft) => { - const isListenerAlreadyAdded = this.spaceSpecificData.liveSpaceData.listeners.find( - (currentListener) => - pCAIP10ToWallet(currentListener.address) === - pCAIP10ToWallet(receivedAddress) - ); + const isListenerAlreadyAdded = + this.spaceSpecificData.liveSpaceData.listeners.find( + (currentListener) => + pCAIP10ToWallet(currentListener.address) === + pCAIP10ToWallet(receivedAddress) + ); if (isListenerAlreadyAdded) { // listener is already added in the meta message @@ -75,6 +76,6 @@ export async function onJoinListener(this: Space, options: OnJoinListenerType) { env: this.env, signer: this.signer, liveSpaceData: modifiedLiveSpaceData, - action: META_ACTION.ADD_LISTENER, + action: CHAT.META.SPACE.LISTENER.ADD, }); } diff --git a/packages/restapi/src/lib/space/onReceiveMetaMessage.ts b/packages/restapi/src/lib/space/onReceiveMetaMessage.ts index f6b6ae24c..800511e31 100644 --- a/packages/restapi/src/lib/space/onReceiveMetaMessage.ts +++ b/packages/restapi/src/lib/space/onReceiveMetaMessage.ts @@ -1,6 +1,6 @@ import { MessageType } from '../constants'; import { IMessageIPFS, LiveSpaceData } from '../types'; -import { MetaMessage } from '../types/messageTypes'; +import { InfoMessage } from '../types/messageTypes'; import type Space from './Space'; export interface OnReceiveMetaMessageType { @@ -18,14 +18,14 @@ export function onReceiveMetaMessage( if ( receivedMetaMessage.messageType !== MessageType.META || typeof receivedMetaMessage.messageObj !== 'object' || - !(receivedMetaMessage?.messageObj as Omit)?.info + !(receivedMetaMessage?.messageObj as Omit)?.info ?.arbitrary ) { return; } const receivedLiveSpaceData = ( - receivedMetaMessage.messageObj as Omit + receivedMetaMessage.messageObj as Omit ).info.arbitrary as LiveSpaceData; console.log('RECEIVED LIVE SPACE DATA', receivedLiveSpaceData); diff --git a/packages/restapi/src/lib/space/rejectPromotionRequest.ts b/packages/restapi/src/lib/space/rejectPromotionRequest.ts index 3fb45154b..f2be499e9 100644 --- a/packages/restapi/src/lib/space/rejectPromotionRequest.ts +++ b/packages/restapi/src/lib/space/rejectPromotionRequest.ts @@ -1,6 +1,6 @@ import { produce } from 'immer'; import sendLiveSpaceData from './helpers/sendLiveSpaceData'; -import { META_ACTION } from '../types/messageTypes'; +import { CHAT } from '../types/messageTypes'; import { pCAIP10ToWallet } from '../helpers'; import type Space from './Space'; @@ -41,6 +41,6 @@ export async function rejectPromotionRequest( env: this.env, spaceId: this.spaceSpecificData.spaceId, signer: this.signer, - action: META_ACTION.USER_INTERACTION, // TODO: Add a reject request type + action: CHAT.META.GROUP.USER.INTERACTION, // TODO: Add a reject request type }); } diff --git a/packages/restapi/src/lib/space/start.ts b/packages/restapi/src/lib/space/start.ts index 6a14791e7..70c369a13 100644 --- a/packages/restapi/src/lib/space/start.ts +++ b/packages/restapi/src/lib/space/start.ts @@ -24,7 +24,7 @@ export interface StartSpaceType extends EnvOptionsType { import type Space from './Space'; import { produce } from 'immer'; import { pCAIP10ToWallet } from '../helpers'; -import { META_ACTION } from '../types/messageTypes'; +import { CHAT } from '../types/messageTypes'; import sendLiveSpaceData from './helpers/sendLiveSpaceData'; type StartType = { @@ -93,7 +93,7 @@ export async function start(this: Space, options: StartType): Promise { await sendLiveSpaceData({ liveSpaceData, - action: META_ACTION.CREATE_SPACE, + action: CHAT.META.SPACE.CREATE, spaceId: this.spaceSpecificData.spaceId, signer: this.signer, pgpPrivateKey: this.pgpPrivateKey, diff --git a/packages/restapi/src/lib/types/messageTypes.ts b/packages/restapi/src/lib/types/messageTypes.ts index 49f4d986a..634121784 100644 --- a/packages/restapi/src/lib/types/messageTypes.ts +++ b/packages/restapi/src/lib/types/messageTypes.ts @@ -3,67 +3,92 @@ */ import { MessageType } from '../constants'; -export enum META_ACTION { - /** - * DEFAULT GROUP ACTIONS - */ - CREATE_GROUP = 1, - ADD_MEMBER = 2, - REMOVE_MEMBER = 3, - PROMOTE_TO_ADMIN = 4, - DEMOTE_FROM_ADMIN = 5, - /** - * SHARED ACTIONS - */ - CHANGE_IMAGE_OR_DESC = 6, - CHANGE_META = 7, - /** - * SPACES ACTIONS - */ - CREATE_SPACE = 8, - ADD_LISTENER = 9, - REMOVE_LISTENER = 10, - PROMOTE_TO_SPEAKER = 11, - DEMOTE_FROM_SPEARKER = 12, - PROMOTE_TO_COHOST = 13, - DEMOTE_FROM_COHOST = 14, - USER_INTERACTION = 15, // For MIC_ON | MIC_OFF | RAISE_HAND | EMOJI REACTION | or any other user activity -} +export const CHAT = { + META: { + GROUP: { + CREATE: 'CREATE_GROUP', + MEMBER: { + ADD: 'ADD_MEMBER', + REMOVE: 'REMOVE_MEMBER', + PRIVILEGE: 'ASSIGN_MEMBER_PRIVILEGE', + }, + ADMIN: { + PRVILEGE: 'ASSIGN_ADMIN_PRIVILEGE', + }, + // todo: Why do we need update group when we already have profile and meta update + UPDATE: 'UPDATE_GROUP', + PROFILE: { + UPDATE: 'UPDATE_GROUP_PROFILE', + }, + // todo : this seems to be a wierd name CHAT.META.GROUP.META.UPDATE + META: { + UPDATE: 'UPDATE_GROUP_META', + }, + // todo : Remove this as it comes under UserActivity now ( remove after space changes ) + USER: { + INTERACTION: 'USER_INTERACTION', + }, + }, + SPACE: { + CREATE: 'CREATE_SPACE', + LISTENER: { + ADD: 'ADD_LISTENER', + REMOVE: 'REMOVE_LISTENER', + PRVILEGE: 'ASSIGN_LISTENER_PRIVILEGE', + }, + SPEAKER: { + PRVILEGE: 'ASSIGN_SPEAKER_PRIVILEGE', + }, + COHOST: { + PRVILEGE: 'ASSIGN_COHOST_PRIVILEGE', + }, + }, + }, -export enum REACTION_TYPE { - THUMBS_UP, - THUMBS_DOWN, - HEART, - CLAP, - LAUGHING_FACE, - SAD_FACE, - ANGRY_FACE, - SURPRISED_FACE, - CLAPPING_HANDS, - FIRE, -} + REACTION: { + THUMBSUP: '\u{1F44D}', + THUMBSDOWN: '\u{1F44E}', + HEART: '\u{2764}\u{FE0F}', + CLAP: '\u{1F44F}', + LAUGH: '\u{1F602}', + SAD: '\u{1F622}', + ANGRY: '\u{1F621}', + SUPRISE: '\u{1F632}', + FIRE: '\u{1F525}', + }, + + RECEIPT: { + READ: 'READ_RECEIPT', + }, -// Create a mapping object that associates reaction types with their Unicode escape sequences -export const REACTION_SYMBOL: Record = { - [REACTION_TYPE.THUMBS_UP]: '\u{1F44D}', - [REACTION_TYPE.THUMBS_DOWN]: '\u{1F44E}', - [REACTION_TYPE.HEART]: '\u{2764}\u{FE0F}', - [REACTION_TYPE.CLAP]: '\u{1F44F}', - [REACTION_TYPE.LAUGHING_FACE]: '\u{1F602}', - [REACTION_TYPE.SAD_FACE]: '\u{1F622}', - [REACTION_TYPE.ANGRY_FACE]: '\u{1F621}', - [REACTION_TYPE.SURPRISED_FACE]: '\u{1F632}', - [REACTION_TYPE.CLAPPING_HANDS]: '\u{1F44F}\u{1F44F}', - [REACTION_TYPE.FIRE]: '\u{1F525}', + UA: { + LISTENER: { + JOIN: 'LISTENER_JOIN', + LEAVE: 'LISTENER_LEAVE', + MICREQUEST: 'LISTENER_REQUEST_MIC', + }, + SPEAKER: { + MIC_ON: 'SPEAKER_MIC_ON', + MIC_OFF: 'SPEAKER_MIC_OFF', + }, + }, + + INTENT: { + ACCEPT: 'ACCEPT_INTENT', + REJECT: 'REJECT_INTENT', + JOIN: 'JOIN_GROUP', + LEAVE: 'LEAVE_GROUP', + }, }; -export interface BaseMessage { +interface BaseMessage { type?: T; content: string; } -export interface MetaMessage extends BaseMessage<`${MessageType.META}`> { - action: META_ACTION; +// Used by MessageType.Meta & MessageType.USER_ACTIVITY +export interface InfoMessage + extends BaseMessage<`${MessageType.META}` | `${MessageType.USER_ACTIVITY}`> { info: { affected: string[]; arbitrary?: { @@ -72,28 +97,53 @@ export interface MetaMessage extends BaseMessage<`${MessageType.META}`> { }; } -export interface ReactionMessage - extends BaseMessage<`${MessageType.REACTION}`> { - action: REACTION_TYPE; - reference?: string | null; +interface ReferenceMessage + extends BaseMessage<`${MessageType.REACTION}` | `${MessageType.RECEIPT}`> { + reference: string; +} + +interface ReplyMessage { + type: `${MessageType.REPLY}`; + /** Only Few BaseMessageTypes are allowed, this can be changed in the future */ + content: { + type: string; + content: string; + }; + reference: string; +} + +interface CompositeMessage { + type: `${MessageType.COMPOSITE}`; + /** Only Few BaseMessageTypes are allowed, this can be changed in the future */ + content: { + type: string; + content: string; + }[]; } -export type BaseMessageTypes = +type BaseMessageTypes = | `${MessageType.TEXT}` | `${MessageType.IMAGE}` + | `${MessageType.VIDEO}` + | `${MessageType.AUDIO}` | `${MessageType.FILE}` + | `${MessageType.GIF}` | `${MessageType.MEDIA_EMBED}` - | `${MessageType.GIF}`; + | `${MessageType.INTENT}`; export type Message = | BaseMessage - | MetaMessage - | ReactionMessage; + | InfoMessage + | ReferenceMessage + | ReplyMessage + | CompositeMessage; /** * @deprecated */ export type MessageObj = | Omit, 'type'> - | Omit - | Omit; + | Omit + | Omit + | Omit + | Omit; diff --git a/packages/restapi/src/lib/validations/messageObject.ts b/packages/restapi/src/lib/validations/messageObject.ts index 6057d12d5..d40382126 100644 --- a/packages/restapi/src/lib/validations/messageObject.ts +++ b/packages/restapi/src/lib/validations/messageObject.ts @@ -1,14 +1,26 @@ import * as Joi from 'joi'; -import { META_ACTION, REACTION_TYPE } from '../types/messageTypes'; +import { CHAT, MessageObj } from '../types/messageTypes'; +import { MessageType } from '../constants'; -export const messageObjSchema = Joi.object({ +const extractValidValues = (obj: any): string[] => { + const validValues: string[] = []; + for (const key in obj) { + if (typeof obj[key] === 'string') { + validValues.push(obj[key]); + } else if (typeof obj[key] === 'object') { + validValues.push(...extractValidValues(obj[key])); + } + } + return validValues; +}; + +const messageObjSchema = Joi.object({ content: Joi.string().required().allow(''), }); -export const metaMessageObjSchema = Joi.object({ - content: Joi.string().required().allow(''), - action: Joi.number() - .valid(...Object.values(META_ACTION)) +const metaMessageObjSchema = Joi.object({ + content: Joi.string() + .valid(...Object.values(extractValidValues(CHAT.META))) .required(), info: Joi.object({ affected: Joi.array().items(Joi.string()).required(), @@ -16,10 +28,133 @@ export const metaMessageObjSchema = Joi.object({ }).required(), }); -export const reationMessageObjSchema = Joi.object({ - content: Joi.string().required().allow(''), - action: Joi.number() - .valid(...Object.values(REACTION_TYPE)) +const reationMessageObjSchema = Joi.object({ + content: Joi.string() + .valid(...Object.values(extractValidValues(CHAT.REACTION))) + .required(), + reference: Joi.string().required(), +}); + +const receiptMessageObjSchema = Joi.object({ + content: Joi.string() + .valid(...Object.values(extractValidValues(CHAT.RECEIPT))) .required(), - reference: Joi.string().allow(null), + reference: Joi.string().required(), }); + +const userActivityMessageObjSchema = Joi.object({ + content: Joi.string() + .valid(...Object.values(extractValidValues(CHAT.UA))) + .required(), + info: Joi.object({ + affected: Joi.array().items(Joi.string()).required(), + arbitrary: Joi.object().pattern(Joi.string(), Joi.any()), + }).required(), +}); + +const intentMessageObjSchema = Joi.object({ + content: Joi.string().valid( + ...Object.values(extractValidValues(CHAT.INTENT)) + ), +}); + +const replyMessageObjSchema = Joi.object({ + content: Joi.object({ + messageType: Joi.string() + .valid( + ...Object.values([ + MessageType.TEXT, + MessageType.IMAGE, + MessageType.AUDIO, + MessageType.VIDEO, + MessageType.FILE, + MessageType.MEDIA_EMBED, + ]) + ) + .required(), + messageObj: Joi.object({ + content: Joi.string().required(), // Change the validation as needed + }).required(), + }).required(), + reference: Joi.string().required(), +}); + +const compositeMessageObjSchema = Joi.object({ + content: Joi.array() + .items( + Joi.object({ + messageType: Joi.string() + .valid( + ...Object.values([ + MessageType.TEXT, + MessageType.IMAGE, + MessageType.AUDIO, + MessageType.VIDEO, + MessageType.FILE, + MessageType.MEDIA_EMBED, + ]) + ) + .required(), + messageObj: Joi.object({ + content: Joi.string().required(), + }).required(), + }) + ) + .required(), +}); + +export const validateMessageObj = ( + messageObj: MessageObj, + messageType: MessageType +) => { + let error: Joi.ValidationError | undefined = undefined; + switch (messageType) { + case MessageType.TEXT: + case MessageType.IMAGE: + case MessageType.VIDEO: + case MessageType.AUDIO: + case MessageType.FILE: + case MessageType.MEDIA_EMBED: + case MessageType.GIF: { + error = messageObjSchema.validate(messageObj).error; + break; + } + case MessageType.META: { + error = metaMessageObjSchema.validate(messageObj).error; + break; + } + case MessageType.REACTION: { + error = reationMessageObjSchema.validate(messageObj).error; + break; + } + case MessageType.RECEIPT: { + error = receiptMessageObjSchema.validate(messageObj).error; + break; + } + case MessageType.USER_ACTIVITY: { + error = userActivityMessageObjSchema.validate(messageObj).error; + break; + } + case MessageType.INTENT: { + error = intentMessageObjSchema.validate(messageObj).error; + break; + } + case MessageType.REPLY: { + error = replyMessageObjSchema.validate(messageObj).error; + break; + } + case MessageType.COMPOSITE: { + error = compositeMessageObjSchema.validate(messageObj).error; + break; + } + default: { + throw new Error('Invalid MessageType'); + } + } + + if (error) { + throw new Error( + `Unable to parse this messageType. Please ensure 'messageObj' is properly defined.` + ); + } +}; diff --git a/packages/restapi/tests/lib/chat/send.test.ts b/packages/restapi/tests/lib/chat/send.test.ts index fc3e8d0dd..5aeb21512 100644 --- a/packages/restapi/tests/lib/chat/send.test.ts +++ b/packages/restapi/tests/lib/chat/send.test.ts @@ -6,7 +6,7 @@ import { ethers } from 'ethers'; import Constants, { MessageType } from '../../../src/lib/constants'; import { upgrade } from '../../../src/lib/user/upgradeUser'; import { decryptPGPKey } from '../../../src/lib/helpers'; -import { createGroup, send } from '../../../src/lib/chat'; +import { approve, createGroup, send } from '../../../src/lib/chat'; import { MessageWithCID, SignerType } from '../../../src/lib/types'; import { decryptAndVerifyMessage } from '../../../src/lib/chat/helpers'; import { @@ -15,14 +15,11 @@ import { colors, uniqueNamesGenerator, } from 'unique-names-generator'; -import { - REACTION_SYMBOL, - REACTION_TYPE, -} from '../../../src/lib/types/messageTypes'; +import { CHAT } from '../../../src/lib/types/messageTypes'; chai.use(chaiAsPromised); const _env = Constants.ENV.DEV; -describe('PushAPI.chat.send', () => { +describe.only('PushAPI.chat.send', () => { const provider = ethers.getDefaultProvider(5); let _signer1: any; let walletAddress1: string; @@ -630,6 +627,232 @@ describe('PushAPI.chat.send', () => { ); }); }); + describe('Video Message', () => { + const MESSAGE_TYPE = MessageType.VIDEO; + const MESSAGE = '{"content":"data:application/mp4;base64,JVBERi0xLjQKJ}'; + it('should throw error using wrong messageObj', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: MESSAGE, + action: 1, + info: { affected: [] }, + }, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + // Video message was not supported in v1 & v2 + it('should throw error for deprecated V1', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, + messageContent: MESSAGE, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + it('Deprecated V2 | EncType - Plaintext', async () => { + const msg = await send({ + messageType: MESSAGE_TYPE, + messageObj: { content: MESSAGE }, + receiverAddress: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + MESSAGE, + account1, + _signer1, + account2, + 'PlainText' + ); + }); + it('Deprecated V2 | EncType - pgp', async () => { + await create({ + account: account2, + env: _env, + signer: _signer2, + version: Constants.ENC_TYPE_V1, + }); + const msg = await send({ + messageType: MESSAGE_TYPE, + messageObj: { content: MESSAGE }, + receiverAddress: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + MESSAGE, + account1, + _signer1, + account2, + 'pgp' + ); + }); + it('V3 | EncType - Plaintext', async () => { + const msg = await send({ + message: { type: MESSAGE_TYPE, content: MESSAGE }, + to: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { content: MESSAGE }, + account1, + _signer1, + account2, + 'PlainText' + ); + }); + it('V3 | EncType - pgp', async () => { + await create({ + account: account2, + env: _env, + signer: _signer2, + version: Constants.ENC_TYPE_V1, + }); + const msg = await send({ + message: { type: MESSAGE_TYPE, content: MESSAGE }, + to: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { content: MESSAGE }, + account1, + _signer1, + account2, + 'pgp' + ); + }); + }); + describe('Audio Message', () => { + const MESSAGE_TYPE = MessageType.AUDIO; + const MESSAGE = '{"content":"data:application/mp3;base64,JVBERi0xLjQKJ}'; + it('should throw error using wrong messageObj', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: MESSAGE, + action: 1, + info: { affected: [] }, + }, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + // Audio message was not supported in v1 & v2 + it('should throw error for deprecated V1', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, + messageContent: MESSAGE, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + it('Deprecated V2 | EncType - Plaintext', async () => { + const msg = await send({ + messageType: MESSAGE_TYPE, + messageObj: { content: MESSAGE }, + receiverAddress: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + MESSAGE, + account1, + _signer1, + account2, + 'PlainText' + ); + }); + it('Deprecated V2 | EncType - pgp', async () => { + await create({ + account: account2, + env: _env, + signer: _signer2, + version: Constants.ENC_TYPE_V1, + }); + const msg = await send({ + messageType: MESSAGE_TYPE, + messageObj: { content: MESSAGE }, + receiverAddress: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + MESSAGE, + account1, + _signer1, + account2, + 'pgp' + ); + }); + it('V3 | EncType - Plaintext', async () => { + const msg = await send({ + message: { type: MESSAGE_TYPE, content: MESSAGE }, + to: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { content: MESSAGE }, + account1, + _signer1, + account2, + 'PlainText' + ); + }); + it('V3 | EncType - pgp', async () => { + await create({ + account: account2, + env: _env, + signer: _signer2, + version: Constants.ENC_TYPE_V1, + }); + const msg = await send({ + message: { type: MESSAGE_TYPE, content: MESSAGE }, + to: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { content: MESSAGE }, + account1, + _signer1, + account2, + 'pgp' + ); + }); + }); describe('File Message', () => { const MESSAGE_TYPE = MessageType.FILE; const MESSAGE = '{"content":"data:application/pdf;base64,JVBERi0xLjQKJ}'; @@ -773,8 +996,8 @@ describe('PushAPI.chat.send', () => { ); }); }); - describe('MediaEmbed Message', () => { - const MESSAGE_TYPE = MessageType.MEDIA_EMBED; + describe('GIF Message', () => { + const MESSAGE_TYPE = MessageType.GIF; const MESSAGE = 'ttps://media1.giphy.com/media/FtlUfrq3pVZXVNjoxf/giphy360p.mp4?cid=ecf05e47jk317254v9hbdjrknemduocie4pf54wtsir98xsx&ep=v1_videos_search&rid=giphy360p.mp4&ct=v'; it('should throw error using wrong messageObj', async () => { @@ -917,8 +1140,8 @@ describe('PushAPI.chat.send', () => { ); }); }); - describe('GIF Message', () => { - const MESSAGE_TYPE = MessageType.GIF; + describe('MediaEmbed Message', () => { + const MESSAGE_TYPE = MessageType.MEDIA_EMBED; const MESSAGE = 'ttps://media1.giphy.com/media/FtlUfrq3pVZXVNjoxf/giphy360p.mp4?cid=ecf05e47jk317254v9hbdjrknemduocie4pf54wtsir98xsx&ep=v1_videos_search&rid=giphy360p.mp4&ct=v'; it('should throw error using wrong messageObj', async () => { @@ -1063,7 +1286,7 @@ describe('PushAPI.chat.send', () => { }); describe('Meta Message', () => { const MESSAGE_TYPE = MessageType.META; - const MESSAGE = 'xyz created group PUSH'; + const MESSAGE = CHAT.META.GROUP.CREATE; it('should throw error using messageContent or wrong MessageObject', async () => { await expect( send({ @@ -1087,7 +1310,7 @@ describe('PushAPI.chat.send', () => { await expect( send({ messageType: MESSAGE_TYPE, - messageObj: { content: MESSAGE, reference: '' }, + messageObj: { content: MESSAGE }, messageContent: MESSAGE, receiverAddress: account2, signer: _signer1, @@ -1097,30 +1320,25 @@ describe('PushAPI.chat.send', () => { await expect( send({ messageType: MESSAGE_TYPE, - messageObj: { content: MESSAGE, action: 1 }, // no info provided + messageObj: { content: MESSAGE, action: 1 }, // no info messageContent: MESSAGE, receiverAddress: account2, signer: _signer1, env: _env, }) ).to.be.rejected; - }); - it('should throw error for non-group', async () => { await expect( send({ messageType: MESSAGE_TYPE, - messageObj: { - content: MESSAGE, - action: 1, - info: { affected: [] }, - }, + messageObj: { content: MESSAGE, action: 1, info: { affected: [] } }, // action is not allowed + messageContent: MESSAGE, receiverAddress: account2, signer: _signer1, env: _env, }) ).to.be.rejected; }); - it('should throw error for non member of group', async () => { + it('should throw error for invalid content', async () => { const groupName = uniqueNamesGenerator({ dictionaries: [adjectives, colors, animals], }); @@ -1133,28 +1351,76 @@ describe('PushAPI.chat.send', () => { const group = await createGroup({ groupName, groupDescription, - members: [_nftAccount1, _nftAccount2], + members: [_nftAccount1, _nftAccount2, account2], groupImage, admins: [], // takes signer as admin automatically, add more if you want to isPublic: true, signer: _signer1, env: _env, }); + + await expect( + send({ + messageType: MESSAGE_TYPE, + message: { + type: MESSAGE_TYPE, + content: 'INVALID CONTENT', + info: { affected: [] }, + }, + receiverAddress: group.chatId, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + it('should throw error for non-group', async () => { await expect( send({ messageType: MESSAGE_TYPE, messageObj: { content: MESSAGE, - action: 1, info: { affected: [] }, }, - receiverAddress: group.chatId, - signer: _signer2, + receiverAddress: account2, + signer: _signer1, env: _env, }) ).to.be.rejected; }); - it('should throw error for Non-Admin member of group', async () => { + it('should throw error for non member of group', async () => { + const groupName = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], + }); + const groupDescription = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], + }); + const groupImage = + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg=='; + + const group = await createGroup({ + groupName, + groupDescription, + members: [_nftAccount1, _nftAccount2], + groupImage, + admins: [], // takes signer as admin automatically, add more if you want to + isPublic: true, + signer: _signer1, + env: _env, + }); + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: MESSAGE, + info: { affected: [] }, + }, + receiverAddress: group.chatId, + signer: _signer2, + env: _env, + }) + ).to.be.rejected; + }); + it('should throw error for Non-Admin member of group', async () => { const groupName = uniqueNamesGenerator({ dictionaries: [adjectives, colors, animals], }); @@ -1179,7 +1445,6 @@ describe('PushAPI.chat.send', () => { messageType: MESSAGE_TYPE, messageObj: { content: MESSAGE, - action: 1, info: { affected: [] }, }, receiverAddress: group.chatId, @@ -1212,7 +1477,6 @@ describe('PushAPI.chat.send', () => { messageType: MESSAGE_TYPE, messageObj: { content: MESSAGE, - action: 1, info: { affected: [] }, }, receiverAddress: group.chatId, @@ -1222,7 +1486,7 @@ describe('PushAPI.chat.send', () => { await expectMsg( msg, MESSAGE_TYPE, - { content: MESSAGE, action: 1, info: { affected: [] } }, + { content: MESSAGE, info: { affected: [] } }, account1, _signer1, group.chatId, @@ -1253,7 +1517,6 @@ describe('PushAPI.chat.send', () => { messageType: MESSAGE_TYPE, messageObj: { content: MESSAGE, - action: 1, info: { affected: [] }, }, receiverAddress: group.chatId, @@ -1263,7 +1526,7 @@ describe('PushAPI.chat.send', () => { await expectMsg( msg, MESSAGE_TYPE, - { content: MESSAGE, action: 1, info: { affected: [] } }, + { content: MESSAGE, info: { affected: [] } }, account1, _signer1, group.chatId, @@ -1294,7 +1557,6 @@ describe('PushAPI.chat.send', () => { message: { type: MESSAGE_TYPE, content: MESSAGE, - action: 1, info: { affected: [] }, }, to: group.chatId, @@ -1304,7 +1566,7 @@ describe('PushAPI.chat.send', () => { await expectMsg( msg, MESSAGE_TYPE, - { content: MESSAGE, action: 1, info: { affected: [] } }, + { content: MESSAGE, info: { affected: [] } }, account1, _signer1, group.chatId, @@ -1335,7 +1597,6 @@ describe('PushAPI.chat.send', () => { message: { type: MESSAGE_TYPE, content: MESSAGE, - action: 1, info: { affected: [] }, }, to: group.chatId, @@ -1345,7 +1606,7 @@ describe('PushAPI.chat.send', () => { await expectMsg( msg, MESSAGE_TYPE, - { content: MESSAGE, action: 1, info: { affected: [] } }, + { content: MESSAGE, info: { affected: [] } }, account1, _signer1, group.chatId, @@ -1355,8 +1616,8 @@ describe('PushAPI.chat.send', () => { }); describe('Reaction Message', () => { const MESSAGE_TYPE = MessageType.REACTION; - const MESSAGE = ''; - it('should throw error using messageContent or wrong MessageObject', async () => { + const MESSAGE = CHAT.REACTION.CLAP; + it('should throw error using messageContent on wrong MessageObject', async () => { await expect( send({ messageType: MESSAGE_TYPE, @@ -1370,12 +1631,175 @@ describe('PushAPI.chat.send', () => { send({ messageType: MESSAGE_TYPE, messageObj: { content: MESSAGE }, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { content: MESSAGE, info: { affected: [] } }, + messageContent: MESSAGE, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + it('should throw error on wrong content', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: 'Invalid Symbol', + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + messageContent: MESSAGE, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + it('Deprecated V1 | EncType - PlainText', async () => { + const msg = await send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: MESSAGE, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + receiverAddress: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { + content: MESSAGE, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + account1, + _signer1, + account2, + 'PlainText' + ); + }); + it('Deprecated V1 | EncType - pgp', async () => { + await create({ + account: account2, + env: _env, + signer: _signer2, + }); + const msg = await send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: MESSAGE, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + receiverAddress: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { + content: MESSAGE, // REACTION OVERRIDES THE MESSAGE CONTENT TO THE SYMBOL + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + account1, + _signer1, + account2, + 'pgp' + ); + }); + it('V2 | EncType - PlainText', async () => { + const msg = await send({ + message: { + type: MESSAGE_TYPE, + content: MESSAGE, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + to: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { + content: MESSAGE, // REACTION OVERRIDES THE MESSAGE CONTENT TO THE SYMBOL, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + account1, + _signer1, + account2, + 'PlainText' + ); + }); + it('V2 | EncType - pgp', async () => { + await create({ + account: account2, + env: _env, + signer: _signer2, + }); + const msg = await send({ + message: { + type: MESSAGE_TYPE, + content: MESSAGE, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + to: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { + content: MESSAGE, // REACTION OVERRIDES THE MESSAGE CONTENT TO THE SYMBOL + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + account1, + _signer1, + account2, + 'pgp' + ); + }); + }); + describe('Receipt Message', () => { + const MESSAGE_TYPE = MessageType.RECEIPT; + const MESSAGE = CHAT.RECEIPT.READ; + it('should throw error using messageContent on wrong MessageObject', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, messageContent: MESSAGE, receiverAddress: account2, signer: _signer1, env: _env, }) ).to.be.rejected; + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { content: MESSAGE }, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; await expect( send({ messageType: MESSAGE_TYPE, @@ -1387,12 +1811,29 @@ describe('PushAPI.chat.send', () => { }) ).to.be.rejected; }); + it('should throw error on wrong content', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: 'Invalid Message Content', + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + messageContent: MESSAGE, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); it('Deprecated V1 | EncType - PlainText', async () => { const msg = await send({ messageType: MESSAGE_TYPE, messageObj: { content: MESSAGE, - action: REACTION_TYPE.THUMBS_UP, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', }, receiverAddress: walletAddress2, signer: _signer1, @@ -1402,8 +1843,9 @@ describe('PushAPI.chat.send', () => { msg, MESSAGE_TYPE, { - content: REACTION_SYMBOL[REACTION_TYPE.THUMBS_UP], // REACTION OVERRIDES THE MESSAGE CONTENT TO THE SYMBOL, - action: REACTION_TYPE.THUMBS_UP, + content: MESSAGE, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', }, account1, _signer1, @@ -1421,7 +1863,8 @@ describe('PushAPI.chat.send', () => { messageType: MESSAGE_TYPE, messageObj: { content: MESSAGE, - action: REACTION_TYPE.THUMBS_UP, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', }, receiverAddress: walletAddress2, signer: _signer1, @@ -1431,8 +1874,9 @@ describe('PushAPI.chat.send', () => { msg, MESSAGE_TYPE, { - content: REACTION_SYMBOL[REACTION_TYPE.THUMBS_UP], // REACTION OVERRIDES THE MESSAGE CONTENT TO THE SYMBOL - action: REACTION_TYPE.THUMBS_UP, + content: MESSAGE, // REACTION OVERRIDES THE MESSAGE CONTENT TO THE SYMBOL + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', }, account1, _signer1, @@ -1445,7 +1889,8 @@ describe('PushAPI.chat.send', () => { message: { type: MESSAGE_TYPE, content: MESSAGE, - action: REACTION_TYPE.THUMBS_UP, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', }, to: walletAddress2, signer: _signer1, @@ -1455,8 +1900,9 @@ describe('PushAPI.chat.send', () => { msg, MESSAGE_TYPE, { - content: REACTION_SYMBOL[REACTION_TYPE.THUMBS_UP], // REACTION OVERRIDES THE MESSAGE CONTENT TO THE SYMBOL, - action: REACTION_TYPE.THUMBS_UP, + content: MESSAGE, // REACTION OVERRIDES THE MESSAGE CONTENT TO THE SYMBOL, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', }, account1, _signer1, @@ -1474,7 +1920,8 @@ describe('PushAPI.chat.send', () => { message: { type: MESSAGE_TYPE, content: MESSAGE, - action: REACTION_TYPE.THUMBS_UP, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', }, to: walletAddress2, signer: _signer1, @@ -1484,8 +1931,9 @@ describe('PushAPI.chat.send', () => { msg, MESSAGE_TYPE, { - content: REACTION_SYMBOL[REACTION_TYPE.THUMBS_UP], // REACTION OVERRIDES THE MESSAGE CONTENT TO THE SYMBOL - action: REACTION_TYPE.THUMBS_UP, + content: MESSAGE, // REACTION OVERRIDES THE MESSAGE CONTENT TO THE SYMBOL + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', }, account1, _signer1, @@ -1494,21 +1942,817 @@ describe('PushAPI.chat.send', () => { ); }); }); -}); + describe('User Activity Message', () => { + const MESSAGE_TYPE = MessageType.USER_ACTIVITY; + const MESSAGE = CHAT.UA.LISTENER.JOIN; + it('should throw error using messageContent or wrong MessageObject', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, + messageContent: MESSAGE, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { content: MESSAGE }, + messageContent: MESSAGE, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { content: MESSAGE }, + messageContent: MESSAGE, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { content: MESSAGE, action: 1 }, // no info + messageContent: MESSAGE, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { content: MESSAGE, action: 1, info: { affected: [] } }, // action is not allowed + messageContent: MESSAGE, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + it('should throw error for invalid content', async () => { + const groupName = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], + }); + const groupDescription = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], + }); + const groupImage = + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg=='; -/** - * HELPER FUNCTION - */ -const expectMsg = async ( - msg: MessageWithCID, - messageType: string, - content: string | { [key: string]: any }, - sender: string, - senderSigner: SignerType, // or receiverSigner - receiver: string, - encType?: 'PlainText' | 'pgp' -): Promise => { - expect(msg.fromDID).to.include(sender); + const group = await createGroup({ + groupName, + groupDescription, + members: [_nftAccount1, _nftAccount2, account2], + groupImage, + admins: [], // takes signer as admin automatically, add more if you want to + isPublic: true, + signer: _signer1, + env: _env, + }); + + await expect( + send({ + messageType: MESSAGE_TYPE, + message: { + type: MESSAGE_TYPE, + content: 'INVALID CONTENT', + info: { affected: [] }, + }, + receiverAddress: group.chatId, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + it('should throw error for non-group', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: MESSAGE, + info: { affected: [] }, + }, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + it('should throw error for non member of group', async () => { + const groupName = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], + }); + const groupDescription = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], + }); + const groupImage = + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg=='; + + const group = await createGroup({ + groupName, + groupDescription, + members: [_nftAccount1, _nftAccount2], + groupImage, + admins: [], // takes signer as admin automatically, add more if you want to + isPublic: true, + signer: _signer1, + env: _env, + }); + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: MESSAGE, + info: { affected: [] }, + }, + receiverAddress: group.chatId, + signer: _signer2, + env: _env, + }) + ).to.be.rejected; + }); + it('Deprecated V1 | EncType - PlainText ( Public Grp )', async () => { + const groupName = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], + }); + const groupDescription = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], + }); + const groupImage = + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg=='; + + const group = await createGroup({ + groupName, + groupDescription, + members: [account2], + groupImage, + admins: [], // takes signer as admin automatically, add more if you want to + isPublic: true, + signer: _signer1, + env: _env, + }); + // approve intent + await approve({ + senderAddress: group.chatId, + status: 'Approved', + account: account2, + signer: _signer2, + env: _env, + }); + // send message + const msg = await send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: MESSAGE, + info: { affected: [] }, + }, + receiverAddress: group.chatId, + signer: _signer2, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { content: MESSAGE, info: { affected: [] } }, + account2, + _signer2, + group.chatId, + 'PlainText' + ); + }); + it('Deprecated V1 | EncType - pgp ( Private Grp )', async () => { + const groupName = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], + }); + const groupDescription = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], + }); + const groupImage = + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg=='; + + const group = await createGroup({ + groupName, + groupDescription, + members: [_nftAccount1, _nftAccount2, account2], + groupImage, + admins: [], // takes signer as admin automatically, add more if you want to + isPublic: false, + signer: _signer1, + env: _env, + }); + const msg = await send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: MESSAGE, + info: { affected: [] }, + }, + receiverAddress: group.chatId, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { content: MESSAGE, info: { affected: [] } }, + account1, + _signer1, + group.chatId, + 'pgp' + ); + }); + it('V2 | EncType - PlainText ( Public Grp )', async () => { + const groupName = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], + }); + const groupDescription = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], + }); + const groupImage = + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg=='; + + const group = await createGroup({ + groupName, + groupDescription, + members: [_nftAccount1, _nftAccount2, account2], + groupImage, + admins: [], // takes signer as admin automatically, add more if you want to + isPublic: true, + signer: _signer1, + env: _env, + }); + const msg = await send({ + message: { + type: MESSAGE_TYPE, + content: MESSAGE, + info: { affected: [] }, + }, + to: group.chatId, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { content: MESSAGE, info: { affected: [] } }, + account1, + _signer1, + group.chatId, + 'PlainText' + ); + }); + it('V2 | EncType - pgp ( Private Grp )', async () => { + const groupName = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], + }); + const groupDescription = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], + }); + const groupImage = + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg=='; + + const group = await createGroup({ + groupName, + groupDescription, + members: [_nftAccount1, _nftAccount2, account2], + groupImage, + admins: [], // takes signer as admin automatically, add more if you want to + isPublic: false, + signer: _signer1, + env: _env, + }); + const msg = await send({ + message: { + type: MESSAGE_TYPE, + content: MESSAGE, + info: { affected: [] }, + }, + to: group.chatId, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { content: MESSAGE, info: { affected: [] } }, + account1, + _signer1, + group.chatId, + 'pgp' + ); + }); + }); + describe('Intent Message', () => { + const MESSAGE_TYPE = MessageType.INTENT; + const MESSAGE = CHAT.INTENT.ACCEPT; + it('should throw error using wrong messageObj', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: MESSAGE, + info: { affected: [] }, // not supported for intent + }, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + it('should throw error using wrong content', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: 'Invalid Message', + }, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + it('Deprecated V1 | EncType - Plaintext', async () => { + const msg = await send({ + messageType: MESSAGE_TYPE, + messageObj: { content: MESSAGE }, + receiverAddress: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + MESSAGE, + account1, + _signer1, + account2, + 'PlainText' + ); + }); + it('Deprecated V1 | EncType - pgp', async () => { + await create({ + account: account2, + env: _env, + signer: _signer2, + version: Constants.ENC_TYPE_V1, + }); + const msg = await send({ + messageType: MESSAGE_TYPE, + messageObj: { content: MESSAGE }, + receiverAddress: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + MESSAGE, + account1, + _signer1, + account2, + 'pgp' + ); + }); + it('V2 | EncType - Plaintext', async () => { + const msg = await send({ + message: { type: MESSAGE_TYPE, content: MESSAGE }, + to: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { content: MESSAGE }, + account1, + _signer1, + account2, + 'PlainText' + ); + }); + it('V2 | EncType - pgp', async () => { + await create({ + account: account2, + env: _env, + signer: _signer2, + version: Constants.ENC_TYPE_V1, + }); + const msg = await send({ + message: { type: MESSAGE_TYPE, content: MESSAGE }, + to: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { content: MESSAGE }, + account1, + _signer1, + account2, + 'pgp' + ); + }); + }); + describe('Reply Message', () => { + const MESSAGE_TYPE = MessageType.REPLY; + const MESSAGE = { + type: MessageType.TEXT, + content: 'Replying to prev message', + }; + it('should throw error using wrong messageObj', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: MESSAGE, + }, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { + // Adding content is legacy format is not allowed for reply + content: { + messageType: MessageType.TEXT, + messageObj: { + content: 'Hey', + }, + }, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + it('should throw error using wrong content', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: 'Invalid Message', + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + it('should throw error for unsupported messageType reply', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: { + type: MessageType.RECEIPT, + content: CHAT.RECEIPT.READ, + }, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + receiverAddress: walletAddress2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + it('Deprecated V1 | EncType - Plaintext', async () => { + const msg = await send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: MESSAGE, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + receiverAddress: walletAddress2, + signer: _signer1, + env: _env, + }); + + await expectMsg( + msg, + MESSAGE_TYPE, + { + content: { + messageType: MESSAGE.type, + messageObj: { content: MESSAGE.content }, + }, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + account1, + _signer1, + account2, + 'PlainText' + ); + }); + it('Deprecated V1 | EncType - pgp', async () => { + await create({ + account: account2, + env: _env, + signer: _signer2, + version: Constants.ENC_TYPE_V1, + }); + const msg = await send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: MESSAGE, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + receiverAddress: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { + content: { + messageType: MESSAGE.type, + messageObj: { content: MESSAGE.content }, + }, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + account1, + _signer1, + account2, + 'pgp' + ); + }); + it('V2 | EncType - Plaintext', async () => { + const msg = await send({ + message: { + type: MESSAGE_TYPE, + content: MESSAGE, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + to: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { + content: { + messageType: MESSAGE.type, + messageObj: { content: MESSAGE.content }, + }, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + account1, + _signer1, + account2, + 'PlainText' + ); + }); + it('V2 | EncType - pgp', async () => { + await create({ + account: account2, + env: _env, + signer: _signer2, + version: Constants.ENC_TYPE_V1, + }); + const msg = await send({ + message: { + type: MESSAGE_TYPE, + content: MESSAGE, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + to: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { + content: { + messageType: MESSAGE.type, + messageObj: { content: MESSAGE.content }, + }, + reference: + 'bafyreia22girudospfbs3q7t6eelb453rmwsi7shkejwxtwpp57xww6vae', + }, + account1, + _signer1, + account2, + 'pgp' + ); + }); + }); + describe('Composite Message', () => { + const MESSAGE_TYPE = MessageType.COMPOSITE; + const MESSAGE = [ + { + type: MessageType.TEXT as string, + content: 'Replying to prev message', + }, + ]; + it('should throw error using wrong messageObj', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: MESSAGE, + info: { affected: [] }, // not supported for composite + }, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + it('should throw error using wrong content', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: 'Invalid Message', + }, + receiverAddress: account2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + it('should throw error for unsupported messageType composite', async () => { + await expect( + send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: [ + { + type: MessageType.READ_RECEIPT, + content: CHAT.READ_RECEIPT, + }, + ], + }, + receiverAddress: walletAddress2, + signer: _signer1, + env: _env, + }) + ).to.be.rejected; + }); + it('Deprecated V1 | EncType - Plaintext', async () => { + const msg = await send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: MESSAGE, + }, + receiverAddress: walletAddress2, + signer: _signer1, + env: _env, + }); + + await expectMsg( + msg, + MESSAGE_TYPE, + { + content: [ + { + messageType: MESSAGE[0].type, + messageObj: { content: MESSAGE[0].content }, + }, + ], + }, + account1, + _signer1, + account2, + 'PlainText' + ); + }); + it('Deprecated V1 | EncType - pgp', async () => { + await create({ + account: account2, + env: _env, + signer: _signer2, + version: Constants.ENC_TYPE_V1, + }); + const msg = await send({ + messageType: MESSAGE_TYPE, + messageObj: { + content: MESSAGE, + }, + receiverAddress: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { + content: [ + { + messageType: MESSAGE[0].type, + messageObj: { content: MESSAGE[0].content }, + }, + ], + }, + account1, + _signer1, + account2, + 'pgp' + ); + }); + it('V2 | EncType - Plaintext', async () => { + const msg = await send({ + message: { + type: MESSAGE_TYPE, + content: MESSAGE, + }, + to: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { + content: [ + { + messageType: MESSAGE[0].type, + messageObj: { content: MESSAGE[0].content }, + }, + ], + }, + account1, + _signer1, + account2, + 'PlainText' + ); + }); + it('V2 | EncType - pgp', async () => { + await create({ + account: account2, + env: _env, + signer: _signer2, + version: Constants.ENC_TYPE_V1, + }); + const msg = await send({ + message: { + type: MESSAGE_TYPE, + content: MESSAGE, + }, + to: walletAddress2, + signer: _signer1, + env: _env, + }); + await expectMsg( + msg, + MESSAGE_TYPE, + { + content: [ + { + messageType: MESSAGE[0].type, + messageObj: { content: MESSAGE[0].content }, + }, + ], + }, + account1, + _signer1, + account2, + 'pgp' + ); + }); + }); +}); + +/** + * HELPER FUNCTION + */ +const expectMsg = async ( + msg: MessageWithCID, + messageType: string, + content: string | { [key: string]: any }, + sender: string, + senderSigner: SignerType, // or receiverSigner + receiver: string, + encType?: 'PlainText' | 'pgp' +): Promise => { + expect(msg.fromDID).to.include(sender); expect(msg.fromCAIP10).to.include(sender); expect(msg.toDID).to.include(receiver); expect(msg.toCAIP10).to.include(receiver); @@ -1518,6 +2762,9 @@ const expectMsg = async ( expect(msg.sigType).to.equal(msg.verificationProof?.split(':')[0]); //Backward Compatibility check ( signature signs messageContent and will be diff from vProof ) expect(msg.signature).not.to.equal(msg.verificationProof?.split(':')[1]); + + const unsupportedContent = + 'MessageType Not Supported by this sdk version. Plz upgrade !!!'; try { if (encType && encType === 'pgp') { throw new Error('Should be encrypted'); @@ -1527,11 +2774,14 @@ const expectMsg = async ( if (typeof content === 'string') { expect((msg.messageObj as { content: string }).content).to.equal(content); //Backward Compatibility check - expect(msg.messageContent).to.equal(content); + expect(msg.messageContent).to.be.oneOf([content, unsupportedContent]); } else { expect(msg.messageObj).to.eql(content); //Backward Compatibility check - expect(msg.messageContent).to.equal((content as any).content); + expect(msg.messageContent).to.be.oneOf([ + (content as any).content, + unsupportedContent, + ]); } } catch (err) { if (encType && encType === 'PlainText') { @@ -1557,11 +2807,17 @@ const expectMsg = async ( content ); //Backward Compatibility check - expect(decryptedMsg.messageContent).to.equal(content); + expect(decryptedMsg.messageContent).to.be.oneOf([ + content, + unsupportedContent, + ]); } else { expect(decryptedMsg.messageObj).to.eql(content); //Backward Compatibility check - expect(decryptedMsg.messageContent).to.equal((content as any).content); + expect(decryptedMsg.messageContent).to.be.oneOf([ + (content as any).content, + unsupportedContent, + ]); } } }; diff --git a/packages/restapi/tests/lib/progressHook/progressHook.test.ts b/packages/restapi/tests/lib/progressHook/progressHook.test.ts index 3d177985b..4ea5a4155 100644 --- a/packages/restapi/tests/lib/progressHook/progressHook.test.ts +++ b/packages/restapi/tests/lib/progressHook/progressHook.test.ts @@ -86,14 +86,7 @@ describe('ProgressHook Tests', () => { for (let i = 0; i < progressInfo.length - 1; i++) { expect(progressInfo[i]).to.deep.equal(expectedHooks[i]); } - const expectedErrorHook = { - progressId: 'PUSH-ERROR-00', - progressTitle: 'Non Specific Error', - progressInfo: - '[Push SDK] - API - Error - API create() -: Error: [Push SDK] - API https://backend-dev.epns.io/apis/v2/users/: AxiosError: Request failed with status code 400', - level: 'ERROR', - }; - expect(progressInfo[4]).to.deep.equal(expectedErrorHook); + expect(progressInfo[4].progressId).to.be.equal('PUSH-ERROR-00'); } }); it('Decrypt Push Profile Success ProgressHooks', async () => { From e6ac9dc896e710213d74e715da8af971c10b5e29 Mon Sep 17 00:00:00 2001 From: strykerin Date: Wed, 4 Oct 2023 04:07:09 -0300 Subject: [PATCH 07/18] fix: local tests (#744) --- packages/restapi/tests/lib/chat/createGroup.test.ts | 4 ++-- packages/restapi/tests/lib/chat/updateGroup.test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/restapi/tests/lib/chat/createGroup.test.ts b/packages/restapi/tests/lib/chat/createGroup.test.ts index 5c8db3987..d9ea55a2e 100644 --- a/packages/restapi/tests/lib/chat/createGroup.test.ts +++ b/packages/restapi/tests/lib/chat/createGroup.test.ts @@ -127,8 +127,8 @@ const expectGroup = async ( expect(group.members[0].image).to.be.a('string'); expect(group.pendingMembers).to.be.an('array'); expect(group.pendingMembers.length).to.equal(pendingMembers.length); - expect(group.pendingMembers[0].wallet).to.equal(pendingMembers[0]); - expect(group.pendingMembers[1].wallet).to.equal(pendingMembers[1]); + expect(pendingMembers.includes(group.pendingMembers[0].wallet)).to.be.true; + expect(pendingMembers.includes(group.pendingMembers[1].wallet)).to.be.true; expect(group.groupImage).to.equal(groupImage); expect(group.groupName).to.equal(groupName); expect(group.groupDescription).to.equal(groupDescription); diff --git a/packages/restapi/tests/lib/chat/updateGroup.test.ts b/packages/restapi/tests/lib/chat/updateGroup.test.ts index 1ad448a69..86862853a 100644 --- a/packages/restapi/tests/lib/chat/updateGroup.test.ts +++ b/packages/restapi/tests/lib/chat/updateGroup.test.ts @@ -179,7 +179,7 @@ const expectGroup = async ( expect(group.pendingMembers).to.be.an('array'); expect(group.pendingMembers.length).to.equal(pendingMembers.length); for (let i = 0; i < pendingMembers.length; i++) { - expect(group.pendingMembers[i].wallet).to.equal(pendingMembers[i]); + expect(pendingMembers.includes(group.pendingMembers[i].wallet)).to.be.true; } expect(group.groupImage).to.equal(groupImage); expect(group.groupName).to.equal(groupName); From 6cc4db3469453397d724b2e0919aded5118b5eb0 Mon Sep 17 00:00:00 2001 From: Rahul Pandey Date: Wed, 4 Oct 2023 12:42:03 +0530 Subject: [PATCH 08/18] fix(env and index): fixes typo RECIPEINT to RECIPIENT (#743) fix #733 --- packages/examples/sdk-backend-node/.env.sample | 4 ++-- packages/examples/sdk-backend-node/video/index.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/examples/sdk-backend-node/.env.sample b/packages/examples/sdk-backend-node/.env.sample index 550450212..a444eee26 100644 --- a/packages/examples/sdk-backend-node/.env.sample +++ b/packages/examples/sdk-backend-node/.env.sample @@ -43,8 +43,8 @@ VIDEO_CHAIN_ID=your_video_chain_id # VIDEO SENDER ADDRESS VIDEO_SENDER_ADDRESS=your_video_sender_address -# VIDEO RECIPEINT ADDRESS -VIDEO_RECIPEINT_ADDRESS=your_video_recipeint_address +# VIDEO RECIPIENT ADDRESS +VIDEO_RECIPIENT_ADDRESS=your_video_recipient_address # VIDEO CHAT ID VIDEO_CHAT_ID=your_video_chat_id \ No newline at end of file diff --git a/packages/examples/sdk-backend-node/video/index.ts b/packages/examples/sdk-backend-node/video/index.ts index 209522514..e9202c387 100644 --- a/packages/examples/sdk-backend-node/video/index.ts +++ b/packages/examples/sdk-backend-node/video/index.ts @@ -21,14 +21,14 @@ const videoSetData: ( let videoObject: any = null; const videoLocalStream = null; // get the local stream const videoSenderAddress = process.env.VIDEO_SENDER_ADDRESS; -const videoRecipientAddress = process.env.VIDEO_RECIPEINT_ADDRESS; +const videoRecipientAddress = process.env.VIDEO_RECIPIENT_ADDRESS; const videoChatId = process.env.VIDEO_CHAT_ID; let videoSignalData_1: any = null; const skipExample = () => { const requiredEnvVars = [ 'VIDEO_SENDER_ADDRESS', - 'VIDEO_RECIPEINT_ADDRESS', + 'VIDEO_RECIPIENT_ADDRESS', 'VIDEO_CHAT_ID', 'VIDEO_CHAIN_ID', ]; From ef50b4557791418df09df8567c64412f2c0cbace Mon Sep 17 00:00:00 2001 From: dinesh <67892133+dinesh11515@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:50:43 +0530 Subject: [PATCH 09/18] Update README.md (#742) Changed the discord link --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6cc5ea396..fe14fdc1b 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@

- + discord @@ -177,7 +177,7 @@ node main - **[Website](https://push.org)** To checkout our Product. - **[Docs](https://docs.push.org/developers/)** For comprehensive documentation. - **[Blog](https://medium.com/push-protocol)** To learn more about our partners, new launches, etc. -- **[Discord](discord.gg/pushprotocol)** for support and discussions with the community and the team. +- **[Discord](https://discord.com/invite/pushprotocol)** for support and discussions with the community and the team. - **[GitHub](https://github.com/ethereum-push-notification-service)** for source code, project board, issues, and pull requests. - **[Twitter](https://twitter.com/pushprotocol)** for the latest updates on the product and published blogs. @@ -196,7 +196,7 @@ Read how you can contribute Discord +Discord ## License Check out our License HERE From 63384c50c2c9c3aacf84eb8e4567aa8b70907cea Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Thu, 5 Oct 2023 14:16:15 +0530 Subject: [PATCH 10/18] docs: example restructuring (#751) --- .../sdk-backend-node/chat/chat.lowlevel.ts | 667 ++++++++++++++ .../examples/sdk-backend-node/chat/chat.ts | 815 +++++------------- .../examples/sdk-backend-node/chat/index.ts | 30 +- .../chat/{nftChat.ts => nftChat.lowlevel.ts} | 10 +- packages/examples/sdk-backend-node/main.ts | 72 +- .../sdk-backend-node/notification/index.ts | 396 +-------- .../notification/notification.lowlevel.ts | 377 ++++++++ .../notification.ts} | 71 +- .../examples/sdk-backend-node/pushAPI/chat.ts | 227 ----- .../sdk-backend-node/pushAPI/encryption.ts | 38 - .../sdk-backend-node/pushAPI/index.ts | 57 -- .../sdk-backend-node/pushAPI/notification.ts | 58 -- .../sdk-backend-node/pushAPI/profile.ts | 38 - .../sdk-backend-node/pushAPI/stream.ts | 202 ----- .../{spaces => space}/index.ts | 15 +- .../examples/sdk-backend-node/user/index.ts | 75 ++ .../examples/sdk-backend-node/video/index.ts | 12 +- 17 files changed, 1490 insertions(+), 1670 deletions(-) create mode 100644 packages/examples/sdk-backend-node/chat/chat.lowlevel.ts rename packages/examples/sdk-backend-node/chat/{nftChat.ts => nftChat.lowlevel.ts} (96%) create mode 100644 packages/examples/sdk-backend-node/notification/notification.lowlevel.ts rename packages/examples/sdk-backend-node/{pushAPI/channel.ts => notification/notification.ts} (72%) delete mode 100644 packages/examples/sdk-backend-node/pushAPI/chat.ts delete mode 100644 packages/examples/sdk-backend-node/pushAPI/encryption.ts delete mode 100644 packages/examples/sdk-backend-node/pushAPI/index.ts delete mode 100644 packages/examples/sdk-backend-node/pushAPI/notification.ts delete mode 100644 packages/examples/sdk-backend-node/pushAPI/profile.ts delete mode 100644 packages/examples/sdk-backend-node/pushAPI/stream.ts rename packages/examples/sdk-backend-node/{spaces => space}/index.ts (94%) create mode 100644 packages/examples/sdk-backend-node/user/index.ts diff --git a/packages/examples/sdk-backend-node/chat/chat.lowlevel.ts b/packages/examples/sdk-backend-node/chat/chat.lowlevel.ts new file mode 100644 index 000000000..852b62153 --- /dev/null +++ b/packages/examples/sdk-backend-node/chat/chat.lowlevel.ts @@ -0,0 +1,667 @@ +import * as PushAPI from '@pushprotocol/restapi'; +import { createSocketConnection, EVENTS } from '@pushprotocol/socket'; +import { ethers } from 'ethers'; +import { + adjectives, + animals, + colors, + uniqueNamesGenerator, +} from 'unique-names-generator'; +import { ENV } from '../types'; +import { config } from '../config'; +import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; +import { createWalletClient, http } from 'viem'; +import { goerli } from 'viem/chains'; + +// CONFIGS +const { env, showAPIResponse } = config; + +/***************** SAMPLE SIGNER GENERATION *********************/ +/** + * USING VIEM + */ +// Random Wallet Signers +const signer = createWalletClient({ + account: privateKeyToAccount(generatePrivateKey()), + chain: goerli, + transport: http(), +}); +const signerAddress = signer.account.address; +const secondSigner = createWalletClient({ + account: privateKeyToAccount(generatePrivateKey()), + chain: goerli, + transport: http(), +}); +const secondSignerAddress = secondSigner.account.address; +// Dummy Wallet Addresses +const randomWallet1 = privateKeyToAccount(generatePrivateKey()).address; +const randomWallet2 = privateKeyToAccount(generatePrivateKey()).address; +const randomWallet3 = privateKeyToAccount(generatePrivateKey()).address; + +/** + * USING ETHERS + */ +// // Random Wallet Signers +// const signer = ethers.Wallet.createRandom(); +// const signerAddress = signer.address; +// const secondSigner = ethers.Wallet.createRandom(); +// const secondSignerAddress = secondSigner.address; +// // Dummy Wallet Addresses +// const randomWallet1 = ethers.Wallet.createRandom().address; +// const randomWallet2 = ethers.Wallet.createRandom().address; +// const randomWallet3 = ethers.Wallet.createRandom().address; + +/************************************************************* */ + +// Group Chat Data +const groupName = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], +}); +const groupDescription = uniqueNamesGenerator({ + dictionaries: [adjectives, colors, animals], +}); +const groupImage = + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg=='; + +// Push Chat - Run Chat Use cases +export const runChatLowlevelUseCases = async (): Promise => { + console.log('PushAPI.user.create'); + await PushAPI_user_create(); + + console.log('PushAPI.user.get'); + await PushAPI_user_get(); + + console.log('PushAPI_chat_decryptPGPKey'); + await PushAPI_chat_decryptPGPKey(); + + console.log('PushAPI.chat.chats'); + await PushAPI_chat_chats(); + + console.log('PushAPI.chat.requests'); + await PushAPI_chat_requests(); + + console.log('PushAPI.chat.send'); + const TargetChatId = await PushAPI_chat_send(); + + console.log('PushAPI.chat.approve'); + await PushAPI_chat_approve(); + + console.log('PushAPI chat Video call Notification'); + await PushAPI_chat_video_call_notification(TargetChatId); + + console.log('PushAPI.chat.createGroup'); + const { chatId, name } = await PushAPI_chat_createGroup(); + + console.log('PushAPI.chat.conversationHash'); + await PushAPI_chat_conversationHash(); + + console.log('PushAPI_chat_history'); + await PushAPI_chat_history(); + + console.log('PushAPI.chat.latest'); + await PushAPI_chat_latest(); + + console.log('PushAPI.chat.updateGroup'); + await PushAPI_chat_updateGroup(chatId); + + console.log('PushAPI.chat.getGroupByName'); + await PushAPI_chat_getGroupByName(name); + + console.log('PushAPI.chat.getGroup'); + await PushAPI_chat_getGroup(chatId); + + console.log('PushAPI.chat.decryptConversation'); + await PushAPI_chat_decryptConversation(); + + console.log('Push Chat - PushSDKSocket()'); + await PushChatSDKSocket(); +}; + +// Push Chat - PushAPI.user.create +async function PushAPI_user_create(silent = !showAPIResponse) { + const user = await PushAPI.user.create({ + signer: signer, + env: env as ENV, + }); + + const user_2 = await PushAPI.user.create({ + signer: secondSigner, + env: env as ENV, + }); + + console.log('PushAPI_user_create | Response - 200 OK'); + if (!silent) { + console.log(user); + console.log(user_2); + } + + return user; +} + +// Push Chat - PushAPI.user.get +async function PushAPI_user_get(silent = !showAPIResponse) { + const user = await PushAPI.user.get({ + account: `eip155:${signerAddress}`, + env: env as ENV, + }); + + console.log('PushAPI_user_get | Response - 200 OK'); + + if (!silent) { + console.log(user); + } +} + +// Push Chat - PushAPI.chat.decryptPGPKey +async function PushAPI_chat_decryptPGPKey(silent = !showAPIResponse) { + // get user and derive encrypted PGP key + const user = await PushAPI.user.get({ + account: `eip155:${signerAddress}`, + env: env as ENV, + }); + + // decrypt the PGP Key + const pgpKey = await PushAPI.chat.decryptPGPKey({ + encryptedPGPPrivateKey: user.encryptedPrivateKey, + + signer: signer, + }); + + console.log('PushAPI_chat_decryptPGPKey | Response - 200 OK'); + if (!silent) { + console.log(pgpKey); + } +} + +// Push Chat - PushAPI.chat.chats +async function PushAPI_chat_chats(silent = !showAPIResponse) { + // Fetch user + const user = await PushAPI.user.get({ + account: `eip155:${signerAddress}`, + env: env as ENV, + }); + + // Decrypt PGP Key + const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ + encryptedPGPPrivateKey: user.encryptedPrivateKey, + + signer: signer, + }); + + // Actual api + const response = await PushAPI.chat.chats({ + account: `eip155:${signerAddress}`, + toDecrypt: true, + pgpPrivateKey: pgpDecrpyptedPvtKey, + env: env as ENV, + }); + + console.log('PushAPI_chat_chats | Response - 200 OK'); + if (!silent) { + console.log(response); + } +} + +// Push Chat - PushAPI.chat.requests +async function PushAPI_chat_requests(silent = !showAPIResponse) { + // Fetch user + const user = await PushAPI.user.get({ + account: `eip155:${signerAddress}`, + env: env as ENV, + }); + + // Decrypt PGP Key + const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ + encryptedPGPPrivateKey: user.encryptedPrivateKey, + + signer: signer, + }); + + // Actual api + const response = await PushAPI.chat.requests({ + account: `eip155:${signerAddress}`, + toDecrypt: true, + pgpPrivateKey: pgpDecrpyptedPvtKey, + env: env as ENV, + }); + + console.log('PushAPI_chat_requests | Response - 200 OK'); + if (!silent) { + console.log(response); + } +} + +// Push Chat - PushAPI.chat.conversationHash +async function PushAPI_chat_conversationHash(silent = !showAPIResponse) { + // conversation hash are also called link inside chat messages + const conversationHash = await PushAPI.chat.conversationHash({ + account: `eip155:${signerAddress}`, + conversationId: `eip155:${secondSignerAddress}`, // 2nd address + env: env as ENV, + }); + + console.log('PushAPI_chat_conversationHash | Response - 200 OK'); + if (!silent) { + console.log(conversationHash); + } +} + +// Push Chat - PushAPI.chat.latest +async function PushAPI_chat_latest(silent = !showAPIResponse) { + // Fetch user + const user = await PushAPI.user.get({ + account: `eip155:${signerAddress}`, + env: env as ENV, + }); + + // Decrypt PGP Key + const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ + encryptedPGPPrivateKey: user.encryptedPrivateKey, + + signer: signer, + }); + + // Fetch conversation hash + // conversation hash are also called link inside chat messages + const conversationHash = await PushAPI.chat.conversationHash({ + account: `eip155:${signerAddress}`, + conversationId: `eip155:${secondSignerAddress}`, // 2nd address + env: env as ENV, + }); + + // Actual API + const response = await PushAPI.chat.latest({ + threadhash: conversationHash.threadHash, // get conversation hash from conversationHash function and send the response threadhash here + account: `eip155:${signerAddress}`, + toDecrypt: true, + pgpPrivateKey: pgpDecrpyptedPvtKey, + env: env as ENV, + }); + + console.log('PushAPI_chat_latest | Response - 200 OK'); + if (!silent) { + console.log(response); + } +} + +// Push Chat - PushAPI.chat.history +async function PushAPI_chat_history(silent = !showAPIResponse) { + // Fetch user + const user = await PushAPI.user.get({ + account: `eip155:${signerAddress}`, + env: env as ENV, + }); + + // Decrypt PGP Key + const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ + encryptedPGPPrivateKey: user.encryptedPrivateKey, + + signer: signer, + }); + + // Fetch conversation hash + // conversation hash are also called link inside chat messages + const conversationHash = await PushAPI.chat.conversationHash({ + account: `eip155:${signerAddress}`, + conversationId: `eip155:${secondSignerAddress}`, // 2nd address + env: env as ENV, + }); + + // Actual API + const response = await PushAPI.chat.history({ + threadhash: conversationHash.threadHash, // get conversation hash from conversationHash function and send the response threadhash here + account: `eip155:${signerAddress}`, + limit: 5, + toDecrypt: true, + pgpPrivateKey: pgpDecrpyptedPvtKey, + env: env as ENV, + }); + + console.log('PushAPI_chat_history | Response - 200 OK'); + if (!silent) { + console.log(response); + } +} + +// Push Chat - PushAPI.chat.send +// // Will send a message to the user or chat request in case user hasn't approved them +async function PushAPI_chat_send(silent = !showAPIResponse) { + // Fetch user + const user = await PushAPI.user.get({ + account: `eip155:${signerAddress}`, + env: env as ENV, + }); + + // Decrypt PGP Key + const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ + encryptedPGPPrivateKey: user.encryptedPrivateKey, + + signer: signer, + }); + + // Actual api + const response = await PushAPI.chat.send({ + messageObj: { + content: "Gm gm! It's me... Mario", + }, + messageType: 'Text', // can be "Text" | "Image" | "File" | "GIF" + receiverAddress: secondSignerAddress, + + signer: signer, + pgpPrivateKey: pgpDecrpyptedPvtKey, + env: env as ENV, + }); + + console.log('PushAPI_chat_send | Response - 200 OK'); + if (!silent) { + console.log(response); + } + return response.chatId; +} + +// Push Chat - Approve +async function PushAPI_chat_approve(silent = !showAPIResponse) { + // Fetch user + const user = await PushAPI.user.get({ + account: `eip155:${secondSignerAddress}`, + env: env as ENV, + }); + + // Decrypt PGP Key + const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ + encryptedPGPPrivateKey: user.encryptedPrivateKey, + + signer: secondSigner, + }); + + // Actual api + const approve = await PushAPI.chat.approve({ + status: 'Approved', + senderAddress: signerAddress, // receiver's address or chatId of a group + + signer: secondSigner, + pgpPrivateKey: pgpDecrpyptedPvtKey, + env: env as ENV, + }); + + console.log('PushAPI_chat_approve | Response - 200 OK'); + if (!silent) { + console.log(approve); + } +} + +// Push Chat - PushAPI.chat.createGroup +async function PushAPI_chat_createGroup( + silent = !showAPIResponse +): Promise<{ chatId: string; name: string }> { + // Fetch user + const user = await PushAPI.user.get({ + account: `eip155:${signerAddress}`, + env: env as ENV, + }); + + // Decrypt PGP Key + const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ + encryptedPGPPrivateKey: user.encryptedPrivateKey, + + signer: signer, + }); + + // Actual API + // Convert image to base 64 and pass + const response = await PushAPI.chat.createGroup({ + groupName, + groupDescription, + members: [`eip155:${randomWallet1}`, `eip155:${randomWallet2}`], + groupImage, + admins: [], // takes signer as admin automatically, add more if you want to + isPublic: true, + + signer: signer, + pgpPrivateKey: pgpDecrpyptedPvtKey, + env: env as ENV, + }); + + console.log('PushAPI_chat_createGroup | Response - 200 OK'); + if (!silent) { + console.log(response); + } + return { chatId: response.chatId, name: response.groupName }; +} + +// Push Chat - PushAPI.chat.updateGroup +async function PushAPI_chat_updateGroup( + chatId: string, + silent = !showAPIResponse +) { + // Fetch user + const user = await PushAPI.user.get({ + account: `eip155:${signerAddress}`, + env: env as ENV, + }); + + // Decrypt PGP Key + const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ + encryptedPGPPrivateKey: user.encryptedPrivateKey, + + signer: signer, + }); + + // Actual API + // Convert image to base 64 and pass + // This is an idempotent operation, meaning it requires all group info to be passed no matter if only few things change + // Why so? To ensure that verificationProof always is able to replicate the current group info (trustless since signature is stored with the info) + const response = await PushAPI.chat.updateGroup({ + chatId, + groupName, + groupDescription, + members: [ + `eip155:${randomWallet1}`, + `eip155:${randomWallet2}`, + `eip155:${randomWallet3}`, + `eip155:${signerAddress}`, + ], + groupImage, + admins: [`eip155:${signerAddress}`], // takes signer as admin automatically, add more if you want to + + signer: signer, + pgpPrivateKey: pgpDecrpyptedPvtKey, + env: env as ENV, + }); + + console.log('PushAPI_chat_updateGroup | Response - 200 OK'); + if (!silent) { + console.log(response); + } +} + +// Push Chat - PushAPI.chat.getGroupByName +async function PushAPI_chat_getGroupByName( + name: string, + silent = !showAPIResponse +) { + const response = await PushAPI.chat.getGroupByName({ + groupName: name, + env: env as ENV, + }); + + console.log('PushAPI_chat_getGroupByName | Response - 200 OK'); + if (!silent) { + console.log(response); + } +} + +// Push Chat - PushAPI.chat.getGroup +async function PushAPI_chat_getGroup( + chatId: string, + silent = !showAPIResponse +) { + const response = await PushAPI.chat.getGroup({ + chatId: chatId, + env: env as ENV, + }); + + console.log('PushAPI_chat_getGroup | Response - 200 OK'); + if (!silent) { + console.log(response); + } +} + +// Push Chat - PushAPI.chat.decryptConversation +async function PushAPI_chat_decryptConversation(silent = !showAPIResponse) { + // Fetch user + const user = await PushAPI.user.get({ + account: `eip155:${signerAddress}`, + env: env as ENV, + }); + + // Decrypt PGP Key + const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ + encryptedPGPPrivateKey: user.encryptedPrivateKey, + + signer: signer, + }); + + // Fetch conversation hash + // conversation hash are also called link inside chat messages + const conversationHash = await PushAPI.chat.conversationHash({ + account: `eip155:${signerAddress}`, + conversationId: `eip155:${secondSignerAddress}`, // 2nd address + env: env as ENV, + }); + + // Chat History + const encryptedChats = await PushAPI.chat.history({ + threadhash: conversationHash.threadHash, // get conversation hash from conversationHash function and send the response threadhash here + account: `eip155:${signerAddress}`, + limit: 5, + toDecrypt: false, + pgpPrivateKey: pgpDecrpyptedPvtKey, + env: env as ENV, + }); + + // Decrypted Chat + const decryptedChat = await PushAPI.chat.decryptConversation({ + messages: encryptedChats, // array of message object fetched from chat.history method + connectedUser: user, // user meta data object fetched from chat.get method + pgpPrivateKey: pgpDecrpyptedPvtKey, //decrypted private key + env: env as ENV, + }); + + console.log('PushAPI_chat_decryptConversation | Response - 200 OK'); + if (!silent) { + console.log(decryptedChat); + } +} + +// Push Chat - Socket Connection +async function PushChatSDKSocket(silent = !showAPIResponse) { + const pushSDKSocket = createSocketConnection({ + user: `eip155:${signerAddress}`, + socketType: 'chat', + socketOptions: { autoConnect: true, reconnectionAttempts: 3 }, + env: env as ENV, + }); + + if (!pushSDKSocket) { + throw new Error('Socket not connected'); + } + + pushSDKSocket.on(EVENTS.CONNECT, async () => { + console.log('Socket Connected - will disconnect after 4 seconds'); + + // send a chat from other wallet to this one to see the result + // Fetch user + const user = await PushAPI.user.get({ + account: `eip155:${secondSignerAddress}`, + env: env as ENV, + }); + + // Decrypt PGP Key + const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ + encryptedPGPPrivateKey: user.encryptedPrivateKey, + + signer: secondSigner, + }); + + // Actual api + const response = await PushAPI.chat.send({ + messageContent: "Gm gm! It's me... Mario", + messageType: 'Text', + receiverAddress: `eip155:${signerAddress}`, + + signer: secondSigner, + pgpPrivateKey: pgpDecrpyptedPvtKey, + env: env as ENV, + }); + console.log('PushAPI_chat_send | Response - 200 OK'); + }); + + pushSDKSocket.on(EVENTS.DISCONNECT, () => { + console.log('Socket Disconnected'); + }); + + pushSDKSocket.on(EVENTS.CHAT_RECEIVED_MESSAGE, (message) => { + // feedItem is the notification data when that notification was received + console.log('Incoming Push Chat message from Socket'); + if (!silent) { + console.log(message); + } + + // disconnect socket after this, not to be done in real implementations + pushSDKSocket.disconnect(); + }); + + const delay = (ms: number) => + new Promise((resolve) => setTimeout(resolve, ms)); + await delay(4000); +} + +async function PushAPI_chat_video_call_notification( + chatId: string, + silent = !showAPIResponse +) { + // Fetch user + const user = await PushAPI.user.get({ + account: signerAddress, + env: env as ENV, + }); + + // Decrypt PGP Key + const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ + encryptedPGPPrivateKey: user.encryptedPrivateKey, + signer: signer, + }); + // get PGP KEy + const apiResponse = await PushAPI.payloads.sendNotification({ + senderType: 1, + signer: signer, + pgpPrivateKey: pgpDecrpyptedPvtKey, + chatId: chatId, + type: 3, // target + identityType: 2, // direct payload + notification: { + title: `VC TITLE:`, + body: `VC BODY`, + }, + payload: { + title: `payload title`, + body: `sample msg body`, + cta: '', + img: '', + additionalMeta: { + type: '1+1', + data: 'Random DATA', + domain: 'push.org', + }, + }, + recipients: secondSignerAddress, // recipient address + channel: signerAddress, // your channel address + env: env as ENV, + }); + + console.log('PushAPI.payloads.sendNotification | Response - 204 OK'); + if (!silent) { + console.log(apiResponse); + } +} diff --git a/packages/examples/sdk-backend-node/chat/chat.ts b/packages/examples/sdk-backend-node/chat/chat.ts index 3b594ec1c..fba19a0be 100644 --- a/packages/examples/sdk-backend-node/chat/chat.ts +++ b/packages/examples/sdk-backend-node/chat/chat.ts @@ -1,25 +1,21 @@ -import * as PushAPI from '@pushprotocol/restapi'; -import { createSocketConnection, EVENTS } from '@pushprotocol/socket'; -import { ethers } from 'ethers'; +import { PushAPI } from '@pushprotocol/restapi'; import { adjectives, animals, colors, uniqueNamesGenerator, } from 'unique-names-generator'; -import { ENV } from '../types'; import { config } from '../config'; import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; import { createWalletClient, http } from 'viem'; import { goerli } from 'viem/chains'; +import { STREAM } from '@pushprotocol/restapi/src/lib/pushstream/pushStreamTypes'; // CONFIGS const { env, showAPIResponse } = config; /***************** SAMPLE SIGNER GENERATION *********************/ -/** - * USING VIEM - */ +// Uing VIEM // Random Wallet Signers const signer = createWalletClient({ account: privateKeyToAccount(generatePrivateKey()), @@ -33,27 +29,20 @@ const secondSigner = createWalletClient({ transport: http(), }); const secondSignerAddress = secondSigner.account.address; +const thirdSigner = createWalletClient({ + account: privateKeyToAccount(generatePrivateKey()), + chain: goerli, + transport: http(), +}); +const thirdSignerAddress = thirdSigner.account.address; + // Dummy Wallet Addresses const randomWallet1 = privateKeyToAccount(generatePrivateKey()).address; const randomWallet2 = privateKeyToAccount(generatePrivateKey()).address; const randomWallet3 = privateKeyToAccount(generatePrivateKey()).address; +/****************************************************************/ -/** - * USING ETHERS - */ -// // Random Wallet Signers -// const signer = ethers.Wallet.createRandom(); -// const signerAddress = signer.address; -// const secondSigner = ethers.Wallet.createRandom(); -// const secondSignerAddress = secondSigner.address; -// // Dummy Wallet Addresses -// const randomWallet1 = ethers.Wallet.createRandom().address; -// const randomWallet2 = ethers.Wallet.createRandom().address; -// const randomWallet3 = ethers.Wallet.createRandom().address; - -/************************************************************* */ - -// Group Chat Data +/***************** SAMPLE GROUP DATA ****************************/ const groupName = uniqueNamesGenerator({ dictionaries: [adjectives, colors, animals], }); @@ -62,613 +51,211 @@ const groupDescription = uniqueNamesGenerator({ }); const groupImage = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg=='; - -// Push Chat - Run Chat Use cases -export const runChatUseCases = async (): Promise => { - console.log(` - ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - `); - console.log('PushAPI.user.create'); - await PushAPI_user_create(); - - console.log('PushAPI.user.get'); - await PushAPI_user_get(); - - console.log('PushAPI_chat_decryptPGPKey'); - await PushAPI_chat_decryptPGPKey(); - - console.log('PushAPI.chat.chats'); - await PushAPI_chat_chats(); - - console.log('PushAPI.chat.requests'); - await PushAPI_chat_requests(); - - console.log('PushAPI.chat.send'); - const TargetChatId = await PushAPI_chat_send(); - - console.log('PushAPI.chat.approve'); - await PushAPI_chat_approve(); - - console.log('PushAPI chat Video call Notification'); - await PushAPI_chat_video_call_notification(TargetChatId); - - console.log('PushAPI.chat.createGroup'); - const { chatId, name } = await PushAPI_chat_createGroup(); - - console.log('PushAPI.chat.conversationHash'); - await PushAPI_chat_conversationHash(); - - console.log('PushAPI_chat_history'); - await PushAPI_chat_history(); - - console.log('PushAPI.chat.latest'); - await PushAPI_chat_latest(); - - console.log('PushAPI.chat.updateGroup'); - await PushAPI_chat_updateGroup(chatId); - - console.log('PushAPI.chat.getGroupByName'); - await PushAPI_chat_getGroupByName(name); - - console.log('PushAPI.chat.getGroup'); - await PushAPI_chat_getGroup(chatId); - - console.log('PushAPI.chat.decryptConversation'); - await PushAPI_chat_decryptConversation(); - - console.log('Push Chat - PushSDKSocket()'); - await PushChatSDKSocket(); -}; - -// Push Chat - PushAPI.user.create -async function PushAPI_user_create(silent = !showAPIResponse) { - const user = await PushAPI.user.create({ - signer: signer, - env: env as ENV, - }); - - const user_2 = await PushAPI.user.create({ - signer: secondSigner, - env: env as ENV, - }); - - console.log('PushAPI_user_create | Response - 200 OK'); - if (!silent) { - console.log(user); - console.log(user_2); - } - - return user; -} - -// Push Chat - PushAPI.user.get -async function PushAPI_user_get(silent = !showAPIResponse) { - const user = await PushAPI.user.get({ - account: `eip155:${signerAddress}`, - env: env as ENV, +/***************** SAMPLE GROUP DATA ****************************/ + +const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + +const eventlistener = async ( + pushAPI: PushAPI, + eventName: string +): Promise => { + pushAPI.stream.on(eventName, (data: any) => { + if (showAPIResponse) { + console.log('Stream Event Received'); + console.log(data); + console.log('\n'); + } }); +}; - console.log('PushAPI_user_get | Response - 200 OK'); - - if (!silent) { - console.log(user); +export const runChatClassUseCases = async (): Promise => { + const userAlice = await PushAPI.initialize(signer, { env }); + const userBob = await PushAPI.initialize(secondSigner, { env }); + const userKate = await PushAPI.initialize(thirdSigner, { env }); + + // Listen stream events to receive websocket events + console.log(`Listening ${STREAM.CHAT} Events`); + eventlistener(userAlice, STREAM.CHAT); + console.log(`Listening ${STREAM.CHAT_OPS} Events`); + eventlistener(userAlice, STREAM.CHAT_OPS); + console.log('\n\n'); + + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.chat.list'); + const aliceChats = await userAlice.chat.list('CHATS'); + const aliceRequests = await userAlice.chat.list('REQUESTS'); + if (showAPIResponse) { + console.log(aliceChats); + console.log(aliceRequests); } -} - -// Push Chat - PushAPI.chat.decryptPGPKey -async function PushAPI_chat_decryptPGPKey(silent = !showAPIResponse) { - // get user and derive encrypted PGP key - const user = await PushAPI.user.get({ - account: `eip155:${signerAddress}`, - env: env as ENV, - }); - - // decrypt the PGP Key - const pgpKey = await PushAPI.chat.decryptPGPKey({ - encryptedPGPPrivateKey: user.encryptedPrivateKey, - - signer: signer, - }); - - console.log('PushAPI_chat_decryptPGPKey | Response - 200 OK'); - if (!silent) { - console.log(pgpKey); + console.log('PushAPI.chat.list | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.chat.latest'); + const aliceLatestChatWithBob = await userAlice.chat.latest( + secondSignerAddress + ); + if (showAPIResponse) { + console.log(aliceLatestChatWithBob); } -} - -// Push Chat - PushAPI.chat.chats -async function PushAPI_chat_chats(silent = !showAPIResponse) { - // Fetch user - const user = await PushAPI.user.get({ - account: `eip155:${signerAddress}`, - env: env as ENV, - }); - - // Decrypt PGP Key - const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ - encryptedPGPPrivateKey: user.encryptedPrivateKey, - - signer: signer, - }); - - // Actual api - const response = await PushAPI.chat.chats({ - account: `eip155:${signerAddress}`, - toDecrypt: true, - pgpPrivateKey: pgpDecrpyptedPvtKey, - env: env as ENV, - }); - - console.log('PushAPI_chat_chats | Response - 200 OK'); - if (!silent) { - console.log(response); + console.log('PushAPI.chat.latest | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.chat.history'); + const aliceChatHistoryWithBob = await userAlice.chat.history( + secondSignerAddress + ); + if (showAPIResponse) { + console.log(aliceChatHistoryWithBob); } -} - -// Push Chat - PushAPI.chat.requests -async function PushAPI_chat_requests(silent = !showAPIResponse) { - // Fetch user - const user = await PushAPI.user.get({ - account: `eip155:${signerAddress}`, - env: env as ENV, - }); - - // Decrypt PGP Key - const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ - encryptedPGPPrivateKey: user.encryptedPrivateKey, - - signer: signer, - }); - - // Actual api - const response = await PushAPI.chat.requests({ - account: `eip155:${signerAddress}`, - toDecrypt: true, - pgpPrivateKey: pgpDecrpyptedPvtKey, - env: env as ENV, + console.log('PushAPI.chat.history | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.chat.send'); + const aliceMessagesBob = await userAlice.chat.send(secondSignerAddress, { + content: 'Hello Bob!', + type: 'Text', }); - - console.log('PushAPI_chat_requests | Response - 200 OK'); - if (!silent) { - console.log(response); + if (showAPIResponse) { + console.log(aliceMessagesBob); } -} - -// Push Chat - PushAPI.chat.conversationHash -async function PushAPI_chat_conversationHash(silent = !showAPIResponse) { - // conversation hash are also called link inside chat messages - const conversationHash = await PushAPI.chat.conversationHash({ - account: `eip155:${signerAddress}`, - conversationId: `eip155:${secondSignerAddress}`, // 2nd address - env: env as ENV, - }); - - console.log('PushAPI_chat_conversationHash | Response - 200 OK'); - if (!silent) { - console.log(conversationHash); + await delay(2000); // Delay added to log the events in order + console.log('PushAPI.chat.send | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.chat.accept'); + const bobAcceptsRequest = await userBob.chat.accept(signerAddress); + if (showAPIResponse) { + console.log(bobAcceptsRequest); } -} - -// Push Chat - PushAPI.chat.latest -async function PushAPI_chat_latest(silent = !showAPIResponse) { - // Fetch user - const user = await PushAPI.user.get({ - account: `eip155:${signerAddress}`, - env: env as ENV, - }); - - // Decrypt PGP Key - const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ - encryptedPGPPrivateKey: user.encryptedPrivateKey, - - signer: signer, - }); - - // Fetch conversation hash - // conversation hash are also called link inside chat messages - const conversationHash = await PushAPI.chat.conversationHash({ - account: `eip155:${signerAddress}`, - conversationId: `eip155:${secondSignerAddress}`, // 2nd address - env: env as ENV, - }); - - // Actual API - const response = await PushAPI.chat.latest({ - threadhash: conversationHash.threadHash, // get conversation hash from conversationHash function and send the response threadhash here - account: `eip155:${signerAddress}`, - toDecrypt: true, - pgpPrivateKey: pgpDecrpyptedPvtKey, - env: env as ENV, - }); - - console.log('PushAPI_chat_latest | Response - 200 OK'); - if (!silent) { - console.log(response); + await delay(2000); // Delay added to log the events in order + console.log('PushAPI.chat.accept | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.chat.reject'); + await userKate.chat.send(signerAddress, { + content: 'Sending malicious message', + type: 'Text', + }); + const AliceRejectsRequest = await userAlice.chat.reject(thirdSignerAddress); + if (showAPIResponse) { + console.log(AliceRejectsRequest); } -} - -// Push Chat - PushAPI.chat.history -async function PushAPI_chat_history(silent = !showAPIResponse) { - // Fetch user - const user = await PushAPI.user.get({ - account: `eip155:${signerAddress}`, - env: env as ENV, - }); - - // Decrypt PGP Key - const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ - encryptedPGPPrivateKey: user.encryptedPrivateKey, - - signer: signer, - }); - - // Fetch conversation hash - // conversation hash are also called link inside chat messages - const conversationHash = await PushAPI.chat.conversationHash({ - account: `eip155:${signerAddress}`, - conversationId: `eip155:${secondSignerAddress}`, // 2nd address - env: env as ENV, - }); - - // Actual API - const response = await PushAPI.chat.history({ - threadhash: conversationHash.threadHash, // get conversation hash from conversationHash function and send the response threadhash here - account: `eip155:${signerAddress}`, - limit: 5, - toDecrypt: true, - pgpPrivateKey: pgpDecrpyptedPvtKey, - env: env as ENV, - }); - - console.log('PushAPI_chat_history | Response - 200 OK'); - if (!silent) { - console.log(response); + await delay(2000); // Delay added to log the events in order + console.log('PushAPI.chat.reject | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.chat.block'); + const AliceBlocksBob = await userAlice.chat.block([secondSignerAddress]); + if (showAPIResponse) { + console.log(AliceBlocksBob); } -} - -// Push Chat - PushAPI.chat.send -// // Will send a message to the user or chat request in case user hasn't approved them -async function PushAPI_chat_send(silent = !showAPIResponse) { - // Fetch user - const user = await PushAPI.user.get({ - account: `eip155:${signerAddress}`, - env: env as ENV, - }); - - // Decrypt PGP Key - const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ - encryptedPGPPrivateKey: user.encryptedPrivateKey, - - signer: signer, - }); - - // Actual api - const response = await PushAPI.chat.send({ - messageObj: { - content: "Gm gm! It's me... Mario", - }, - messageType: 'Text', // can be "Text" | "Image" | "File" | "GIF" - receiverAddress: secondSignerAddress, - - signer: signer, - pgpPrivateKey: pgpDecrpyptedPvtKey, - env: env as ENV, - }); - - console.log('PushAPI_chat_send | Response - 200 OK'); - if (!silent) { - console.log(response); + console.log('PushAPI.chat.block | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.chat.unblock'); + const AliceUnblocksBob = await userAlice.chat.unblock([secondSignerAddress]); + if (showAPIResponse) { + console.log(AliceUnblocksBob); } - return response.chatId; -} - -// Push Chat - Approve -async function PushAPI_chat_approve(silent = !showAPIResponse) { - // Fetch user - const user = await PushAPI.user.get({ - account: `eip155:${secondSignerAddress}`, - env: env as ENV, - }); - - // Decrypt PGP Key - const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ - encryptedPGPPrivateKey: user.encryptedPrivateKey, - - signer: secondSigner, - }); - - // Actual api - const approve = await PushAPI.chat.approve({ - status: 'Approved', - senderAddress: signerAddress, // receiver's address or chatId of a group - - signer: secondSigner, - pgpPrivateKey: pgpDecrpyptedPvtKey, - env: env as ENV, - }); - - console.log('PushAPI_chat_approve | Response - 200 OK'); - if (!silent) { - console.log(approve); + console.log('PushAPI.chat.unblock | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.create'); + const createdGroup = await userAlice.chat.group.create(groupName, { + description: groupDescription, + image: groupImage, + members: [randomWallet1, randomWallet2], + admins: [], + private: false, + }); + const groupChatId = createdGroup.chatId; // to be used in other examples + if (showAPIResponse) { + console.log(createdGroup); } -} - -// Push Chat - PushAPI.chat.createGroup -async function PushAPI_chat_createGroup( - silent = !showAPIResponse -): Promise<{ chatId: string; name: string }> { - // Fetch user - const user = await PushAPI.user.get({ - account: `eip155:${signerAddress}`, - env: env as ENV, - }); - - // Decrypt PGP Key - const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ - encryptedPGPPrivateKey: user.encryptedPrivateKey, - - signer: signer, - }); - - // Actual API - // Convert image to base 64 and pass - const response = await PushAPI.chat.createGroup({ - groupName, - groupDescription, - members: [`eip155:${randomWallet1}`, `eip155:${randomWallet2}`], - groupImage, - admins: [], // takes signer as admin automatically, add more if you want to - isPublic: true, - - signer: signer, - pgpPrivateKey: pgpDecrpyptedPvtKey, - env: env as ENV, - }); - - console.log('PushAPI_chat_createGroup | Response - 200 OK'); - if (!silent) { - console.log(response); + await delay(2000); // Delay added to log the events in order + console.log('PushAPI.group.create | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.permissions'); + const grouppermissions = await userAlice.chat.group.permissions(groupChatId); + if (showAPIResponse) { + console.log(grouppermissions); } - return { chatId: response.chatId, name: response.groupName }; -} - -// Push Chat - PushAPI.chat.updateGroup -async function PushAPI_chat_updateGroup( - chatId: string, - silent = !showAPIResponse -) { - // Fetch user - const user = await PushAPI.user.get({ - account: `eip155:${signerAddress}`, - env: env as ENV, - }); - - // Decrypt PGP Key - const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ - encryptedPGPPrivateKey: user.encryptedPrivateKey, - - signer: signer, - }); - - // Actual API - // Convert image to base 64 and pass - // This is an idempotent operation, meaning it requires all group info to be passed no matter if only few things change - // Why so? To ensure that verificationProof always is able to replicate the current group info (trustless since signature is stored with the info) - const response = await PushAPI.chat.updateGroup({ - chatId, - groupName, - groupDescription, - members: [ - `eip155:${randomWallet1}`, - `eip155:${randomWallet2}`, - `eip155:${randomWallet3}`, - `eip155:${signerAddress}`, - ], - groupImage, - admins: [`eip155:${signerAddress}`], // takes signer as admin automatically, add more if you want to - - signer: signer, - pgpPrivateKey: pgpDecrpyptedPvtKey, - env: env as ENV, - }); - - console.log('PushAPI_chat_updateGroup | Response - 200 OK'); - if (!silent) { - console.log(response); + console.log('PushAPI.group.permissions | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.info'); + const groupInfo = await userAlice.chat.group.info(groupChatId); + if (showAPIResponse) { + console.log(groupInfo); } -} - -// Push Chat - PushAPI.chat.getGroupByName -async function PushAPI_chat_getGroupByName( - name: string, - silent = !showAPIResponse -) { - const response = await PushAPI.chat.getGroupByName({ - groupName: name, - env: env as ENV, - }); - - console.log('PushAPI_chat_getGroupByName | Response - 200 OK'); - if (!silent) { - console.log(response); + console.log('PushAPI.group.info | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.update'); + const updatedGroup = await userAlice.chat.group.update(groupChatId, { + description: 'Updated Description', + }); + if (showAPIResponse) { + console.log(updatedGroup); } -} - -// Push Chat - PushAPI.chat.getGroup -async function PushAPI_chat_getGroup( - chatId: string, - silent = !showAPIResponse -) { - const response = await PushAPI.chat.getGroup({ - chatId: chatId, - env: env as ENV, - }); - - console.log('PushAPI_chat_getGroup | Response - 200 OK'); - if (!silent) { - console.log(response); + await delay(2000); // Delay added to log the events in order + console.log('PushAPI.group.update | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.add'); + const addMember = await userAlice.chat.group.add(groupChatId, { + role: 'MEMBER', + accounts: [randomWallet3], + }); + if (showAPIResponse) { + console.log(addMember); } -} - -// Push Chat - PushAPI.chat.decryptConversation -async function PushAPI_chat_decryptConversation(silent = !showAPIResponse) { - // Fetch user - const user = await PushAPI.user.get({ - account: `eip155:${signerAddress}`, - env: env as ENV, - }); - - // Decrypt PGP Key - const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ - encryptedPGPPrivateKey: user.encryptedPrivateKey, - - signer: signer, - }); - - // Fetch conversation hash - // conversation hash are also called link inside chat messages - const conversationHash = await PushAPI.chat.conversationHash({ - account: `eip155:${signerAddress}`, - conversationId: `eip155:${secondSignerAddress}`, // 2nd address - env: env as ENV, - }); - - // Chat History - const encryptedChats = await PushAPI.chat.history({ - threadhash: conversationHash.threadHash, // get conversation hash from conversationHash function and send the response threadhash here - account: `eip155:${signerAddress}`, - limit: 5, - toDecrypt: false, - pgpPrivateKey: pgpDecrpyptedPvtKey, - env: env as ENV, - }); - - // Decrypted Chat - const decryptedChat = await PushAPI.chat.decryptConversation({ - messages: encryptedChats, // array of message object fetched from chat.history method - connectedUser: user, // user meta data object fetched from chat.get method - pgpPrivateKey: pgpDecrpyptedPvtKey, //decrypted private key - env: env as ENV, - }); - - console.log('PushAPI_chat_decryptConversation | Response - 200 OK'); - if (!silent) { - console.log(decryptedChat); + await delay(2000); // Delay added to log the events in order + console.log('PushAPI.group.add | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.remove'); + const removeMember = await userAlice.chat.group.remove(groupChatId, { + role: 'MEMBER', + accounts: [randomWallet3], + }); + if (showAPIResponse) { + console.log(removeMember); } -} - -// Push Chat - Socket Connection -async function PushChatSDKSocket(silent = !showAPIResponse) { - const pushSDKSocket = createSocketConnection({ - user: `eip155:${signerAddress}`, - socketType: 'chat', - socketOptions: { autoConnect: true, reconnectionAttempts: 3 }, - env: env as ENV, - }); - - if (!pushSDKSocket) { - throw new Error('Socket not connected'); + await delay(2000); // Delay added to log the events in order + console.log('PushAPI.group.remove | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.join'); + const joinGrp = await userBob.chat.group.join(groupChatId); + if (showAPIResponse) { + console.log(joinGrp); } - - pushSDKSocket.on(EVENTS.CONNECT, async () => { - console.log('Socket Connected - will disconnect after 4 seconds'); - - // send a chat from other wallet to this one to see the result - // Fetch user - const user = await PushAPI.user.get({ - account: `eip155:${secondSignerAddress}`, - env: env as ENV, - }); - - // Decrypt PGP Key - const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ - encryptedPGPPrivateKey: user.encryptedPrivateKey, - - signer: secondSigner, - }); - - // Actual api - const response = await PushAPI.chat.send({ - messageContent: "Gm gm! It's me... Mario", - messageType: 'Text', - receiverAddress: `eip155:${signerAddress}`, - - signer: secondSigner, - pgpPrivateKey: pgpDecrpyptedPvtKey, - env: env as ENV, - }); - console.log('PushAPI_chat_send | Response - 200 OK'); - }); - - pushSDKSocket.on(EVENTS.DISCONNECT, () => { - console.log('Socket Disconnected'); - }); - - pushSDKSocket.on(EVENTS.CHAT_RECEIVED_MESSAGE, (message) => { - // feedItem is the notification data when that notification was received - console.log('Incoming Push Chat message from Socket'); - if (!silent) { - console.log(message); - } - - // disconnect socket after this, not to be done in real implementations - pushSDKSocket.disconnect(); - }); - - const delay = (ms: number) => - new Promise((resolve) => setTimeout(resolve, ms)); - await delay(4000); -} - -async function PushAPI_chat_video_call_notification( - chatId: string, - silent = !showAPIResponse -) { - // Fetch user - const user = await PushAPI.user.get({ - account: signerAddress, - env: env as ENV, - }); - - // Decrypt PGP Key - const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({ - encryptedPGPPrivateKey: user.encryptedPrivateKey, - signer: signer, - }); - // get PGP KEy - const apiResponse = await PushAPI.payloads.sendNotification({ - senderType: 1, - signer: signer, - pgpPrivateKey: pgpDecrpyptedPvtKey, - chatId: chatId, - type: 3, // target - identityType: 2, // direct payload - notification: { - title: `VC TITLE:`, - body: `VC BODY`, - }, - payload: { - title: `payload title`, - body: `sample msg body`, - cta: '', - img: '', - additionalMeta: { - type: '1+1', - data: 'Random DATA', - domain: 'push.org', - }, - }, - recipients: secondSignerAddress, // recipient address - channel: signerAddress, // your channel address - env: env as ENV, - }); - - console.log('PushAPI.payloads.sendNotification | Response - 204 OK'); - if (!silent) { - console.log(apiResponse); + await delay(2000); // Delay added to log the events in order + console.log('PushAPI.group.join | Response - 200 OK\n\n'); + //------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.leave'); + const leaveGrp = await userBob.chat.group.leave(groupChatId); + if (showAPIResponse) { + console.log(leaveGrp); } -} + await delay(2000); // Delay added to log the events in order + console.log('PushAPI.group.leave | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.group.reject'); + const sampleGrp = await userAlice.chat.group.create('Sample Grp', { + description: groupDescription, + image: groupImage, + members: [secondSignerAddress], // invite bob + admins: [], + private: true, + }); + await userBob.chat.group.reject(sampleGrp.chatId); + await delay(2000); // Delay added to log the events in order + console.log('PushAPI.group.reject | Response - 200 OK\n\n'); +}; diff --git a/packages/examples/sdk-backend-node/chat/index.ts b/packages/examples/sdk-backend-node/chat/index.ts index 40bccd361..85621540f 100644 --- a/packages/examples/sdk-backend-node/chat/index.ts +++ b/packages/examples/sdk-backend-node/chat/index.ts @@ -1,2 +1,28 @@ -export { runChatUseCases } from './chat'; -export { runNFTChatUseCases } from './nftChat'; +import { runChatLowlevelUseCases } from './chat.lowlevel'; +import { runNFTChatLowLevelUseCases } from './nftChat.lowlevel'; +import { runChatClassUseCases } from './chat'; + +export const runChatUseCases = async (): Promise => { + console.log(` +ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— +ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā•šā•ā•ā–ˆā–ˆā•”ā•ā•ā• +ā–ˆā–ˆā•‘ā–‘ā–‘ā•šā•ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ +ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ +ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ +ā–‘ā•šā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ + `); + + await runChatClassUseCases(); + console.log(` +ā–’ā–ˆā–€ā–€ā–ˆ ā–’ā–ˆā–‘ā–’ā–ˆ ā–‘ā–ˆā–€ā–€ā–ˆ ā–€ā–€ā–ˆā–€ā–€ ā–‘ ā–’ā–ˆā–‘ā–‘ā–‘ ā–’ā–ˆā–€ā–€ā–€ā–ˆ ā–’ā–ˆā–‘ā–‘ā–’ā–ˆ ā–’ā–ˆā–‘ā–‘ā–‘ ā–’ā–ˆā–€ā–€ā–€ ā–’ā–ˆā–‘ā–‘ā–’ā–ˆ ā–’ā–ˆā–€ā–€ā–€ ā–’ā–ˆā–‘ā–‘ā–‘ +ā–’ā–ˆā–‘ā–‘ā–‘ ā–’ā–ˆā–€ā–€ā–ˆ ā–’ā–ˆā–„ā–„ā–ˆ ā–‘ā–’ā–ˆā–‘ā–‘ ā–„ ā–’ā–ˆā–‘ā–‘ā–‘ ā–’ā–ˆā–‘ā–‘ā–’ā–ˆ ā–’ā–ˆā–’ā–ˆā–’ā–ˆ ā–’ā–ˆā–‘ā–‘ā–‘ ā–’ā–ˆā–€ā–€ā–€ ā–‘ā–’ā–ˆā–’ā–ˆā–‘ ā–’ā–ˆā–€ā–€ā–€ ā–’ā–ˆā–‘ā–‘ā–‘ +ā–’ā–ˆā–„ā–„ā–ˆ ā–’ā–ˆā–‘ā–’ā–ˆ ā–’ā–ˆā–‘ā–’ā–ˆ ā–‘ā–’ā–ˆā–‘ā–‘ ā–ˆ ā–’ā–ˆā–„ā–„ā–ˆ ā–’ā–ˆā–„ā–„ā–„ā–ˆ ā–’ā–ˆā–„ā–€ā–„ā–ˆ ā–’ā–ˆā–„ā–„ā–ˆ ā–’ā–ˆā–„ā–„ā–„ ā–‘ā–‘ā–€ā–„ā–€ā–‘ ā–’ā–ˆā–„ā–„ā–„ ā–’ā–ˆā–„ā–„ā–ˆ + `); + await runChatLowlevelUseCases(); + console.log(` +ā–’ā–ˆā–„ā–‘ā–’ā–ˆ ā–’ā–ˆā–€ā–€ā–€ ā–€ā–€ā–ˆā–€ā–€ ā–’ā–ˆā–€ā–€ā–ˆ ā–’ā–ˆā–‘ā–’ā–ˆ ā–‘ā–ˆā–€ā–€ā–ˆ ā–€ā–€ā–ˆā–€ā–€ ā–‘ ā–’ā–ˆā–‘ā–‘ā–‘ ā–’ā–ˆā–€ā–€ā–€ā–ˆ ā–’ā–ˆā–‘ā–‘ā–’ā–ˆ ā–’ā–ˆā–‘ā–‘ā–‘ ā–’ā–ˆā–€ā–€ā–€ ā–’ā–ˆā–‘ā–‘ā–’ā–ˆ ā–’ā–ˆā–€ā–€ā–€ ā–’ā–ˆā–‘ā–‘ā–‘ +ā–’ā–ˆā–’ā–ˆā–’ā–ˆ ā–’ā–ˆā–€ā–€ā–€ ā–‘ā–’ā–ˆā–‘ā–‘ ā–’ā–ˆā–‘ā–‘ā–‘ ā–’ā–ˆā–€ā–€ā–ˆ ā–’ā–ˆā–„ā–„ā–ˆ ā–‘ā–’ā–ˆā–‘ā–‘ ā–„ ā–’ā–ˆā–‘ā–‘ā–‘ ā–’ā–ˆā–‘ā–‘ā–’ā–ˆ ā–’ā–ˆā–’ā–ˆā–’ā–ˆ ā–’ā–ˆā–‘ā–‘ā–‘ ā–’ā–ˆā–€ā–€ā–€ ā–‘ā–’ā–ˆā–’ā–ˆā–‘ ā–’ā–ˆā–€ā–€ā–€ ā–’ā–ˆā–‘ā–‘ā–‘ +ā–’ā–ˆā–‘ā–‘ā–€ā–ˆ ā–’ā–ˆā–‘ā–‘ā–‘ ā–‘ā–’ā–ˆā–‘ā–‘ ā–’ā–ˆā–„ā–„ā–ˆ ā–’ā–ˆā–‘ā–’ā–ˆ ā–’ā–ˆā–‘ā–’ā–ˆ ā–‘ā–’ā–ˆā–‘ā–‘ ā–ˆ ā–’ā–ˆā–„ā–„ā–ˆ ā–’ā–ˆā–„ā–„ā–„ā–ˆ ā–’ā–ˆā–„ā–€ā–„ā–ˆ ā–’ā–ˆā–„ā–„ā–ˆ ā–’ā–ˆā–„ā–„ā–„ ā–‘ā–‘ā–€ā–„ā–€ā–‘ ā–’ā–ˆā–„ā–„ā–„ ā–’ā–ˆā–„ā–„ā–ˆ + `); + await runNFTChatLowLevelUseCases(); +}; diff --git a/packages/examples/sdk-backend-node/chat/nftChat.ts b/packages/examples/sdk-backend-node/chat/nftChat.lowlevel.ts similarity index 96% rename from packages/examples/sdk-backend-node/chat/nftChat.ts rename to packages/examples/sdk-backend-node/chat/nftChat.lowlevel.ts index a3d6a0cfd..2f5142d5c 100644 --- a/packages/examples/sdk-backend-node/chat/nftChat.ts +++ b/packages/examples/sdk-backend-node/chat/nftChat.lowlevel.ts @@ -74,15 +74,7 @@ const skipExample = () => { }; // Push Chat - Run Chat Use cases -export const runNFTChatUseCases = async (): Promise => { - console.log(` - ā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ - ā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - `); - +export const runNFTChatLowLevelUseCases = async (): Promise => { if (skipExample()) { console.log('Skipping examples as required env vars are missing'); return; diff --git a/packages/examples/sdk-backend-node/main.ts b/packages/examples/sdk-backend-node/main.ts index dbb09f210..e8a538268 100644 --- a/packages/examples/sdk-backend-node/main.ts +++ b/packages/examples/sdk-backend-node/main.ts @@ -1,11 +1,12 @@ -import { runNotificaitonsUseCases } from './notification'; -import { runChatUseCases, runNFTChatUseCases } from './chat'; +import { runUserCases } from './user'; +import { runNotificationUseCases } from './notification'; +import { runChatUseCases } from './chat'; import { runVideoUseCases } from './video'; -import { runSpacesUseCases } from './spaces'; -import { runPushAPICases } from './pushAPI'; +import { runSpaceUseCases } from './space'; import { config } from './config'; import { ENV } from './types'; +import { exit } from 'process'; // CONFIGS const { env } = config; @@ -15,12 +16,12 @@ const start = async (): Promise => { console.log(`${returnHeadingLog()}`); console.log(`${returnENVLog()}`); - await runPushAPICases(); - await runNotificaitonsUseCases(); + await runUserCases(); + await runNotificationUseCases(); await runChatUseCases(); - await runNFTChatUseCases(); await runVideoUseCases(); - await runSpacesUseCases(); + await runSpaceUseCases(); + exit(0); }; start(); @@ -32,39 +33,54 @@ start(); // ----------- function returnHeadingLog() { const headingLog = ` - ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ + +ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–ˆā–ˆā•— +ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–‘ā–ˆā–ˆā•”ā• ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā•šā•ā•ā–ˆā–ˆā•”ā•ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā•šā•ā•ā–ˆā–ˆā•”ā•ā•ā•ā•šā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•”ā• +ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•ā•ā–‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā•šā–ˆā–ˆā–ˆā–ˆā•”ā•ā–‘ +ā–‘ā•šā•ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā–ˆā–ˆā•—ā–‘ ā–ˆā–ˆā•”ā•ā•ā•ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā•šā–ˆā–ˆā•”ā•ā–‘ā–‘ +ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–‘ā•šā–ˆā–ˆā•— ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–‘ā•šā–ˆā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–‘ā•šā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ +ā•šā•ā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā–‘ā–‘ā•šā•ā• ā•šā•ā•ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā•šā•ā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā–‘ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā•ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ `; return headingLog; } function returnENVLog() { let environmentLog = ` - ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ + +ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•—ā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–ˆā–ˆā•— ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ +ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā•šā•ā•ā–ˆā–ˆā•”ā•ā•ā•ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–‘ +ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•”ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•”ā• ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•—ā–‘ +ā–ˆā–ˆā•”ā•ā•ā•ā–‘ā–‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā•‘ā–‘ā•šā–ˆā–ˆā–ˆā–ˆā•”ā•ā–‘ ā•šā•ā•ā•ā•ā• ā–‘ā•šā•ā•ā•ā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā•šā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā•šā–ˆā–ˆā•— +ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–‘ā•šā–ˆā–ˆā–ˆā•‘ā–‘ā–‘ā•šā–ˆā–ˆā•”ā•ā–‘ā–‘ ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā•šā–ˆā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā• +ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā•ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ ā•šā•ā•ā•ā•ā•ā•ā–‘ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā•ā–‘ `; if (env === ENV.PROD) { environmentLog = ` - ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆ +ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•—ā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–ˆā–ˆā•— ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ +ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•— +ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•”ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•”ā• ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ +ā–ˆā–ˆā•”ā•ā•ā•ā–‘ā–‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā•‘ā–‘ā•šā–ˆā–ˆā–ˆā–ˆā•”ā•ā–‘ ā•šā•ā•ā•ā•ā• ā–ˆā–ˆā•”ā•ā•ā•ā•ā–‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ +ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–‘ā•šā–ˆā–ˆā–ˆā•‘ā–‘ā–‘ā•šā–ˆā–ˆā•”ā•ā–‘ā–‘ ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā• +ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā•ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ ā•šā•ā•ā–‘ā–‘ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā•ā–‘ `; } else if (env === ENV.DEV) { environmentLog = ` - ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆ +ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•—ā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–ˆā–ˆā•— ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–ˆā–ˆā•— +ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ +ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•”ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•”ā• ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā•šā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•”ā• +ā–ˆā–ˆā•”ā•ā•ā•ā–‘ā–‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā•‘ā–‘ā•šā–ˆā–ˆā–ˆā–ˆā•”ā•ā–‘ ā•šā•ā•ā•ā•ā• ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā–‘ā–‘ā–‘ā•šā–ˆā–ˆā–ˆā–ˆā•”ā•ā–‘ +ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–‘ā•šā–ˆā–ˆā–ˆā•‘ā–‘ā–‘ā•šā–ˆā–ˆā•”ā•ā–‘ā–‘ ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā•šā–ˆā–ˆā•”ā•ā–‘ā–‘ +ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā•ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ ā•šā•ā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā•ā•ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ + `; + } else if (env === ENV.LOCAL) { + environmentLog = ` +ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•—ā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–ˆā–ˆā•— ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ ā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–‘ā–‘ +ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ +ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•”ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•”ā• ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā•šā•ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ +ā–ˆā–ˆā•”ā•ā•ā•ā–‘ā–‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā•‘ā–‘ā•šā–ˆā–ˆā–ˆā–ˆā•”ā•ā–‘ ā•šā•ā•ā•ā•ā• ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ +ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–‘ā•šā–ˆā–ˆā–ˆā•‘ā–‘ā–‘ā•šā–ˆā–ˆā•”ā•ā–‘ā–‘ ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— +ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā•ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ ā•šā•ā•ā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā–‘ā–‘ā•šā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā•šā•ā•ā•ā•ā•ā•ā• `; } diff --git a/packages/examples/sdk-backend-node/notification/index.ts b/packages/examples/sdk-backend-node/notification/index.ts index 605a60a23..f2251c1c7 100644 --- a/packages/examples/sdk-backend-node/notification/index.ts +++ b/packages/examples/sdk-backend-node/notification/index.ts @@ -1,384 +1,20 @@ -import * as PushAPI from '@pushprotocol/restapi'; -import { createSocketConnection, EVENTS } from '@pushprotocol/socket'; -import { ethers } from 'ethers'; -import { config } from '../config'; +import { runNotificaitonsLowLevelUseCases } from './notification.lowlevel'; +import { runNotificationClassUseCases } from './notification'; -import { createWalletClient, http } from 'viem'; -import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; -import { goerli } from 'viem/chains'; - -enum ENV { - PROD = 'prod', - STAGING = 'staging', - DEV = 'dev', - /** - * **This is for local development only** - */ - LOCAL = 'local', -} - -// CONFIGS -const { env, showAPIResponse } = config; - -// If you own a channel, you can use your channel address as well -const channelPrivateKey = process.env.WALLET_PRIVATE_KEY; - -/***************** SAMPLE SIGNER GENERATION *********************/ -/** - * USING VIEM - */ -const signerChannel = channelPrivateKey - ? createWalletClient({ - account: privateKeyToAccount(`0x${channelPrivateKey}`), - chain: goerli, - transport: http(), - }) - : undefined; -const channelAddress = signerChannel - ? signerChannel.account.address - : undefined; -// Random Wallet Signers -const signer = createWalletClient({ - account: privateKeyToAccount(generatePrivateKey()), - chain: goerli, - transport: http(), -}); -const signerAddress = signer.account.address; -// Dummy Wallet Addresses -const randomWallet1 = privateKeyToAccount(generatePrivateKey()).address; - -/** - * USING ETHERS - */ -// const signerChannel = new ethers.Wallet(`0x${channelPrivateKey}`); -// const channelAddress = signerChannel.address; -// // Random Wallet Signers -// const signer = ethers.Wallet.createRandom(); -// const signerAddress = signer.address; -// // Dummy Wallet Addresses -// const randomWallet1 = ethers.Wallet.createRandom().address; -/************************************************************* */ - -const skipExample = () => { - const requiredEnvVars = ['WALLET_PRIVATE_KEY']; - - for (const envVar of requiredEnvVars) { - if (!process.env[envVar]) { - return true; // Skip the example if any of the required env vars is missing - } - } - - return false; // All required env vars are present, don't skip the example -}; - -// Push Notification - Run Notifications Use cases -export const runNotificaitonsUseCases = async (): Promise => { +export const runNotificationUseCases = async (): Promise => { + console.log(` +ā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•— +ā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā•šā•ā•ā–ˆā–ˆā•”ā•ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā•šā•ā•ā–ˆā–ˆā•”ā•ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•‘ +ā–ˆā–ˆā•”ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā•šā•ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ +ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā•‘ +ā–ˆā–ˆā•‘ā–‘ā•šā–ˆā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–‘ā•šā–ˆā–ˆā–ˆā•‘ +ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā–‘ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ā•šā•ā•ā•šā•ā•ā–‘ā–‘ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā• + `); + await runNotificationClassUseCases(); console.log(` - ā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ - ā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ - ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ +ā–’ā–ˆā–„ā–‘ā–’ā–ˆ ā–’ā–ˆā–€ā–€ā–€ā–ˆ ā–€ā–€ā–ˆā–€ā–€ ā–€ā–ˆā–€ ā–’ā–ˆā–€ā–€ā–€ ā–€ā–ˆā–€ ā–’ā–ˆā–€ā–€ā–ˆ ā–‘ā–ˆā–€ā–€ā–ˆ ā–€ā–€ā–ˆā–€ā–€ ā–€ā–ˆā–€ ā–’ā–ˆā–€ā–€ā–€ā–ˆ ā–’ā–ˆā–„ā–‘ā–’ā–ˆ ā–‘ ā–’ā–ˆā–‘ā–‘ā–‘ ā–’ā–ˆā–€ā–€ā–€ā–ˆ ā–’ā–ˆā–‘ā–‘ā–’ā–ˆ ā–’ā–ˆā–‘ā–‘ā–‘ ā–’ā–ˆā–€ā–€ā–€ ā–’ā–ˆā–‘ā–‘ā–’ā–ˆ ā–’ā–ˆā–€ā–€ā–€ ā–’ā–ˆā–‘ā–‘ā–‘ +ā–’ā–ˆā–’ā–ˆā–’ā–ˆ ā–’ā–ˆā–‘ā–‘ā–’ā–ˆ ā–‘ā–’ā–ˆā–‘ā–‘ ā–’ā–ˆā–‘ ā–’ā–ˆā–€ā–€ā–€ ā–’ā–ˆā–‘ ā–’ā–ˆā–‘ā–‘ā–‘ ā–’ā–ˆā–„ā–„ā–ˆ ā–‘ā–’ā–ˆā–‘ā–‘ ā–’ā–ˆā–‘ ā–’ā–ˆā–‘ā–‘ā–’ā–ˆ ā–’ā–ˆā–’ā–ˆā–’ā–ˆ ā–„ ā–’ā–ˆā–‘ā–‘ā–‘ ā–’ā–ˆā–‘ā–‘ā–’ā–ˆ ā–’ā–ˆā–’ā–ˆā–’ā–ˆ ā–’ā–ˆā–‘ā–‘ā–‘ ā–’ā–ˆā–€ā–€ā–€ ā–‘ā–’ā–ˆā–’ā–ˆā–‘ ā–’ā–ˆā–€ā–€ā–€ ā–’ā–ˆā–‘ā–‘ā–‘ +ā–’ā–ˆā–‘ā–‘ā–€ā–ˆ ā–’ā–ˆā–„ā–„ā–„ā–ˆ ā–‘ā–’ā–ˆā–‘ā–‘ ā–„ā–ˆā–„ ā–’ā–ˆā–‘ā–‘ā–‘ ā–„ā–ˆā–„ ā–’ā–ˆā–„ā–„ā–ˆ ā–’ā–ˆā–‘ā–’ā–ˆ ā–‘ā–’ā–ˆā–‘ā–‘ ā–„ā–ˆā–„ ā–’ā–ˆā–„ā–„ā–„ā–ˆ ā–’ā–ˆā–‘ā–‘ā–€ā–ˆ ā–ˆ ā–’ā–ˆā–„ā–„ā–ˆ ā–’ā–ˆā–„ā–„ā–„ā–ˆ ā–’ā–ˆā–„ā–€ā–„ā–ˆ ā–’ā–ˆā–„ā–„ā–ˆ ā–’ā–ˆā–„ā–„ā–„ ā–‘ā–‘ā–€ā–„ā–€ā–‘ ā–’ā–ˆā–„ā–„ā–„ ā–’ā–ˆā–„ā–„ā–ˆ `); - console.log('PushAPI.user.getFeeds'); - await PushAPI_user_getFeeds(); - - console.log('PushAPI.user.getFeeds [Spam]'); - await PushAPI_user_getFeeds__spam(); - - console.log('PushAPI.user.getSubscriptions'); - await PushAPI_user_getSubscriptions(); - - if (!skipExample()) { - console.log('PushAPI.channels.getChannel()'); - await PushAPI_channels_getChannel(); - - console.log('PushAPI.channels.search()'); - await PushAPI_channels_search(); - - console.log('PushAPI.channels.subscribe()'); - await PushAPI_channels_subscribe(); - - console.log('PushAPI.channels.unsubscribe()'); - await PushAPI_channels_unsubscribe(); - - // IMPORTANT: VARIOUS OTHER NOTIFICATIONS FORMAT SUPPORTED - // EXAMPLES HERE: https://github.com/ethereum-push-notification-service/push-sdk/blob/main/packages/restapi/README.md - console.log( - 'PushAPI.payloads.sendNotification() [Direct Payload, Single Recipient]' - ); - await PushAPI_payloads_sendNotification__direct_payload_single_recipient(); - - console.log( - 'PushAPI.payloads.sendNotification() [Direct Payload, Batch of Recipients (Subset)]' - ); - await PushAPI_payloads_sendNotification__direct_payload_group_of_recipient_subset(); - - console.log( - 'PushAPI.payloads.sendNotification() [Direct Payload, All Recipients (Broadcast)]' - ); - await PushAPI_payloads_sendNotification__direct_payload_all_recipients_brodcast(); - - console.log('PushAPI.channels._getSubscribers()'); - await PushAPI_channels_getSubscribers(); - - console.log('Push Notification - PushSDKSocket()'); - await PushSDKSocket(); - } + await runNotificaitonsLowLevelUseCases(); }; - -// Push Notification - PushAPI.user.getFeeds -async function PushAPI_user_getFeeds(silent = !showAPIResponse) { - const notifications = await PushAPI.user.getFeeds({ - user: `eip155:5:${signerAddress}`, // user address in CAIP - env: env as ENV, - }); - - console.log('PushAPI.user.getFeeds | Response - 200 OK'); - if (!silent) { - console.log(notifications); - } -} - -// Push Notification - PushAPI.user.getFeeds - Spam -async function PushAPI_user_getFeeds__spam(silent = !showAPIResponse) { - const notifications = await PushAPI.user.getFeeds({ - user: `eip155:5:${signerAddress}`, // user address in CAIP - spam: true, - env: env as ENV, - }); - - console.log('PushAPI.user.getFeeds [Spam] | Response - 200 OK'); - if (!silent) { - console.log(notifications); - } -} - -// Push Notification - PushAPI.user.getSubscriptions -async function PushAPI_user_getSubscriptions(silent = !showAPIResponse) { - const subscriptions = await PushAPI.user.getSubscriptions({ - user: `eip155:5:${signerAddress}`, // user address in CAIP - env: env as ENV, - }); - - console.log('PushAPI.user.getSubscriptions | Response - 200 OK'); - if (!silent) { - console.log(subscriptions); - } -} - -// Push Notification - PushAPI.channels.getChannel -async function PushAPI_channels_getChannel(silent = !showAPIResponse) { - const channelData = await PushAPI.channels.getChannel({ - channel: channelAddress as string, - env: env as ENV, - }); - - console.log('PushAPI.channels.getChannel | Response - 200 OK'); - if (!silent) { - console.log(channelData); - } -} - -// Push Notification - PushAPI.channels.search -async function PushAPI_channels_search(silent = !showAPIResponse) { - const channelsData = await PushAPI.channels.search({ - query: 'push', // a search query - page: 1, // page index - limit: 20, // no of items per page - env: env as ENV, - }); - - console.log('PushAPI.channels.search | Response - 200 OK'); - if (!silent) { - console.log(channelsData); - } -} - -// Push Notification - PushAPI.channels.subscribe -async function PushAPI_channels_subscribe(silent = !showAPIResponse) { - const response = await PushAPI.channels.subscribe({ - signer: signer, - channelAddress: `eip155:5:${channelAddress}`, // channel address in CAIP - userAddress: `eip155:5:${signerAddress}`, // user address in CAIP - onSuccess: () => { - console.log('opt in success'); - }, - onError: () => { - console.error('opt in error'); - }, - env: env as ENV, - }); - - console.log('PushAPI.channels.subscribe | Response - 200 OK'); - if (!silent) { - console.log(response); - } -} - -// Push Notification - PushAPI.channels.unsubscribe -async function PushAPI_channels_unsubscribe(silent = !showAPIResponse) { - const response = await PushAPI.channels.unsubscribe({ - signer: signer, - channelAddress: `eip155:5:${channelAddress}`, // channel address in CAIP - userAddress: `eip155:5:${signerAddress}`, // user address in CAIP - onSuccess: () => { - console.log('opt out success'); - }, - onError: () => { - console.error('opt out error'); - }, - env: env as ENV, - }); - - console.log('PushAPI.channels.unsubscribe | Response - 200 OK'); - if (!silent) { - console.log(response); - } -} - -// Push Notification - Send Notifications -// Direct payload for single recipient(target) -// PushAPI.payloads.sendNotification -async function PushAPI_payloads_sendNotification__direct_payload_single_recipient( - silent = !showAPIResponse -) { - const apiResponse = await PushAPI.payloads.sendNotification({ - signer: signerChannel, // Need to resolve to channel address - type: 3, // target - identityType: 2, // direct payload - notification: { - title: `notification TITLE:`, - body: `notification BODY`, - }, - payload: { - title: `payload title`, - body: `sample msg body`, - cta: '', - img: '', - }, - recipients: `eip155:5:${signerAddress}`, // recipient address - channel: `eip155:5:${channelAddress}`, // your channel address - env: env as ENV, - }); - - console.log('PushAPI.payloads.sendNotification | Response - 204 OK'); - if (!silent) { - console.log(apiResponse); - } -} - -// Push Notification - Direct payload for group of recipients(subset) -// PushAPI.payloads.sendNotification -async function PushAPI_payloads_sendNotification__direct_payload_group_of_recipient_subset( - silent = !showAPIResponse -) { - const apiResponse = await PushAPI.payloads.sendNotification({ - signer: signerChannel, // Need to resolve to channel address - type: 4, // subset - identityType: 2, // direct payload - notification: { - title: `notification TITLE:`, - body: `notification BODY`, - }, - payload: { - title: `payload title`, - body: `sample msg body`, - cta: '', - img: '', - }, - recipients: [`eip155:5:${signerAddress}`, `eip155:5:${randomWallet1}`], // recipient addresses - channel: `eip155:5:${channelAddress}`, // your channel address - env: env as ENV, - }); - - console.log('PushAPI.payloads.sendNotification | Response - 204 OK'); - if (!silent) { - console.log(apiResponse); - } -} - -// Push Notification - Direct payload for all recipients(broadcast) -// PushAPI.payloads.sendNotification -async function PushAPI_payloads_sendNotification__direct_payload_all_recipients_brodcast( - silent = !showAPIResponse -) { - const apiResponse = await PushAPI.payloads.sendNotification({ - signer: signerChannel, // Needs to resolve to channel address - type: 1, // broadcast - identityType: 2, // direct payload - notification: { - title: `notification TITLE:`, - body: `notification BODY`, - }, - payload: { - title: `payload title`, - body: `sample msg body`, - cta: '', - img: '', - }, - channel: `eip155:5:${channelAddress}`, // your channel address - env: env as ENV, - }); - - console.log('PushAPI.payloads.sendNotification | Response - 204 OK'); - if (!silent) { - console.log(apiResponse); - } -} - -// Push Notification - Get Subscribers list from channels (DEPRECATED) -async function PushAPI_channels_getSubscribers(silent = !showAPIResponse) { - const subscribers = await PushAPI.channels._getSubscribers({ - channel: `eip155:5:${channelAddress}`, // channel address in CAIP - env: env as ENV, - }); - - console.log('PushAPI.channels._getSubscribers | Response - 200 OK'); - if (!silent) { - console.log(subscribers); - } -} - -// Push Notification - Socket Connection -async function PushSDKSocket(silent = !showAPIResponse) { - const pushSDKSocket = createSocketConnection({ - user: `eip155:5:${signerAddress}`, // CAIP, see below - socketOptions: { autoConnect: false }, - env: env as ENV, - }); - - if (!pushSDKSocket) { - throw new Error('PushSDKSocket | Socket Connection Failed'); - } - - pushSDKSocket.connect(); - - pushSDKSocket.on(EVENTS.CONNECT, async () => { - console.log('Socket Connected - will disconnect after 4 seconds'); - - // send a notification to see the result - await PushAPI_payloads_sendNotification__direct_payload_single_recipient( - true - ); - }); - - pushSDKSocket.on(EVENTS.DISCONNECT, () => { - console.log('Socket Disconnected'); - }); - - pushSDKSocket.on(EVENTS.USER_FEEDS, (feedItem) => { - // feedItem is the notification data when that notification was received - console.log('Incoming Feed from Socket'); - if (!silent) { - console.log(feedItem); - } - - // disconnect socket after this, not to be done in real implementations - pushSDKSocket.disconnect(); - }); - - const delay = (ms: number) => - new Promise((resolve) => setTimeout(resolve, ms)); - await delay(4000); -} diff --git a/packages/examples/sdk-backend-node/notification/notification.lowlevel.ts b/packages/examples/sdk-backend-node/notification/notification.lowlevel.ts new file mode 100644 index 000000000..e2f04f99a --- /dev/null +++ b/packages/examples/sdk-backend-node/notification/notification.lowlevel.ts @@ -0,0 +1,377 @@ +import * as PushAPI from '@pushprotocol/restapi'; +import { createSocketConnection, EVENTS } from '@pushprotocol/socket'; +import { ethers } from 'ethers'; +import { config } from '../config'; + +import { createWalletClient, http } from 'viem'; +import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; +import { goerli } from 'viem/chains'; + +enum ENV { + PROD = 'prod', + STAGING = 'staging', + DEV = 'dev', + /** + * **This is for local development only** + */ + LOCAL = 'local', +} + +// CONFIGS +const { env, showAPIResponse } = config; + +// If you own a channel, you can use your channel address as well +const channelPrivateKey = process.env.WALLET_PRIVATE_KEY; + +/***************** SAMPLE SIGNER GENERATION *********************/ +/** + * USING VIEM + */ +const signerChannel = channelPrivateKey + ? createWalletClient({ + account: privateKeyToAccount(`0x${channelPrivateKey}`), + chain: goerli, + transport: http(), + }) + : undefined; +const channelAddress = signerChannel + ? signerChannel.account.address + : undefined; +// Random Wallet Signers +const signer = createWalletClient({ + account: privateKeyToAccount(generatePrivateKey()), + chain: goerli, + transport: http(), +}); +const signerAddress = signer.account.address; +// Dummy Wallet Addresses +const randomWallet1 = privateKeyToAccount(generatePrivateKey()).address; + +/** + * USING ETHERS + */ +// const signerChannel = new ethers.Wallet(`0x${channelPrivateKey}`); +// const channelAddress = signerChannel.address; +// // Random Wallet Signers +// const signer = ethers.Wallet.createRandom(); +// const signerAddress = signer.address; +// // Dummy Wallet Addresses +// const randomWallet1 = ethers.Wallet.createRandom().address; +/************************************************************* */ + +const skipExample = () => { + const requiredEnvVars = ['WALLET_PRIVATE_KEY']; + + for (const envVar of requiredEnvVars) { + if (!process.env[envVar]) { + return true; // Skip the example if any of the required env vars is missing + } + } + + return false; // All required env vars are present, don't skip the example +}; + +// Push Notification - Run Notifications Use cases +export const runNotificaitonsLowLevelUseCases = async (): Promise => { + console.log('PushAPI.user.getFeeds'); + await PushAPI_user_getFeeds(); + + console.log('PushAPI.user.getFeeds [Spam]'); + await PushAPI_user_getFeeds__spam(); + + console.log('PushAPI.user.getSubscriptions'); + await PushAPI_user_getSubscriptions(); + + if (!skipExample()) { + console.log('PushAPI.channels.getChannel()'); + await PushAPI_channels_getChannel(); + + console.log('PushAPI.channels.search()'); + await PushAPI_channels_search(); + + console.log('PushAPI.channels.subscribe()'); + await PushAPI_channels_subscribe(); + + console.log('PushAPI.channels.unsubscribe()'); + await PushAPI_channels_unsubscribe(); + + // IMPORTANT: VARIOUS OTHER NOTIFICATIONS FORMAT SUPPORTED + // EXAMPLES HERE: https://github.com/ethereum-push-notification-service/push-sdk/blob/main/packages/restapi/README.md + console.log( + 'PushAPI.payloads.sendNotification() [Direct Payload, Single Recipient]' + ); + await PushAPI_payloads_sendNotification__direct_payload_single_recipient(); + + console.log( + 'PushAPI.payloads.sendNotification() [Direct Payload, Batch of Recipients (Subset)]' + ); + await PushAPI_payloads_sendNotification__direct_payload_group_of_recipient_subset(); + + console.log( + 'PushAPI.payloads.sendNotification() [Direct Payload, All Recipients (Broadcast)]' + ); + await PushAPI_payloads_sendNotification__direct_payload_all_recipients_brodcast(); + + console.log('PushAPI.channels._getSubscribers()'); + await PushAPI_channels_getSubscribers(); + + console.log('Push Notification - PushSDKSocket()'); + await PushSDKSocket(); + } +}; + +// Push Notification - PushAPI.user.getFeeds +async function PushAPI_user_getFeeds(silent = !showAPIResponse) { + const notifications = await PushAPI.user.getFeeds({ + user: `eip155:5:${signerAddress}`, // user address in CAIP + env: env as ENV, + }); + + console.log('PushAPI.user.getFeeds | Response - 200 OK'); + if (!silent) { + console.log(notifications); + } +} + +// Push Notification - PushAPI.user.getFeeds - Spam +async function PushAPI_user_getFeeds__spam(silent = !showAPIResponse) { + const notifications = await PushAPI.user.getFeeds({ + user: `eip155:5:${signerAddress}`, // user address in CAIP + spam: true, + env: env as ENV, + }); + + console.log('PushAPI.user.getFeeds [Spam] | Response - 200 OK'); + if (!silent) { + console.log(notifications); + } +} + +// Push Notification - PushAPI.user.getSubscriptions +async function PushAPI_user_getSubscriptions(silent = !showAPIResponse) { + const subscriptions = await PushAPI.user.getSubscriptions({ + user: `eip155:5:${signerAddress}`, // user address in CAIP + env: env as ENV, + }); + + console.log('PushAPI.user.getSubscriptions | Response - 200 OK'); + if (!silent) { + console.log(subscriptions); + } +} + +// Push Notification - PushAPI.channels.getChannel +async function PushAPI_channels_getChannel(silent = !showAPIResponse) { + const channelData = await PushAPI.channels.getChannel({ + channel: channelAddress as string, + env: env as ENV, + }); + + console.log('PushAPI.channels.getChannel | Response - 200 OK'); + if (!silent) { + console.log(channelData); + } +} + +// Push Notification - PushAPI.channels.search +async function PushAPI_channels_search(silent = !showAPIResponse) { + const channelsData = await PushAPI.channels.search({ + query: 'push', // a search query + page: 1, // page index + limit: 20, // no of items per page + env: env as ENV, + }); + + console.log('PushAPI.channels.search | Response - 200 OK'); + if (!silent) { + console.log(channelsData); + } +} + +// Push Notification - PushAPI.channels.subscribe +async function PushAPI_channels_subscribe(silent = !showAPIResponse) { + const response = await PushAPI.channels.subscribe({ + signer: signer, + channelAddress: `eip155:5:${channelAddress}`, // channel address in CAIP + userAddress: `eip155:5:${signerAddress}`, // user address in CAIP + onSuccess: () => { + console.log('opt in success'); + }, + onError: () => { + console.error('opt in error'); + }, + env: env as ENV, + }); + + console.log('PushAPI.channels.subscribe | Response - 200 OK'); + if (!silent) { + console.log(response); + } +} + +// Push Notification - PushAPI.channels.unsubscribe +async function PushAPI_channels_unsubscribe(silent = !showAPIResponse) { + const response = await PushAPI.channels.unsubscribe({ + signer: signer, + channelAddress: `eip155:5:${channelAddress}`, // channel address in CAIP + userAddress: `eip155:5:${signerAddress}`, // user address in CAIP + onSuccess: () => { + console.log('opt out success'); + }, + onError: () => { + console.error('opt out error'); + }, + env: env as ENV, + }); + + console.log('PushAPI.channels.unsubscribe | Response - 200 OK'); + if (!silent) { + console.log(response); + } +} + +// Push Notification - Send Notifications +// Direct payload for single recipient(target) +// PushAPI.payloads.sendNotification +async function PushAPI_payloads_sendNotification__direct_payload_single_recipient( + silent = !showAPIResponse +) { + const apiResponse = await PushAPI.payloads.sendNotification({ + signer: signerChannel, // Need to resolve to channel address + type: 3, // target + identityType: 2, // direct payload + notification: { + title: `notification TITLE:`, + body: `notification BODY`, + }, + payload: { + title: `payload title`, + body: `sample msg body`, + cta: '', + img: '', + }, + recipients: `eip155:5:${signerAddress}`, // recipient address + channel: `eip155:5:${channelAddress}`, // your channel address + env: env as ENV, + }); + + console.log('PushAPI.payloads.sendNotification | Response - 204 OK'); + if (!silent) { + console.log(apiResponse); + } +} + +// Push Notification - Direct payload for group of recipients(subset) +// PushAPI.payloads.sendNotification +async function PushAPI_payloads_sendNotification__direct_payload_group_of_recipient_subset( + silent = !showAPIResponse +) { + const apiResponse = await PushAPI.payloads.sendNotification({ + signer: signerChannel, // Need to resolve to channel address + type: 4, // subset + identityType: 2, // direct payload + notification: { + title: `notification TITLE:`, + body: `notification BODY`, + }, + payload: { + title: `payload title`, + body: `sample msg body`, + cta: '', + img: '', + }, + recipients: [`eip155:5:${signerAddress}`, `eip155:5:${randomWallet1}`], // recipient addresses + channel: `eip155:5:${channelAddress}`, // your channel address + env: env as ENV, + }); + + console.log('PushAPI.payloads.sendNotification | Response - 204 OK'); + if (!silent) { + console.log(apiResponse); + } +} + +// Push Notification - Direct payload for all recipients(broadcast) +// PushAPI.payloads.sendNotification +async function PushAPI_payloads_sendNotification__direct_payload_all_recipients_brodcast( + silent = !showAPIResponse +) { + const apiResponse = await PushAPI.payloads.sendNotification({ + signer: signerChannel, // Needs to resolve to channel address + type: 1, // broadcast + identityType: 2, // direct payload + notification: { + title: `notification TITLE:`, + body: `notification BODY`, + }, + payload: { + title: `payload title`, + body: `sample msg body`, + cta: '', + img: '', + }, + channel: `eip155:5:${channelAddress}`, // your channel address + env: env as ENV, + }); + + console.log('PushAPI.payloads.sendNotification | Response - 204 OK'); + if (!silent) { + console.log(apiResponse); + } +} + +// Push Notification - Get Subscribers list from channels (DEPRECATED) +async function PushAPI_channels_getSubscribers(silent = !showAPIResponse) { + const subscribers = await PushAPI.channels._getSubscribers({ + channel: `eip155:5:${channelAddress}`, // channel address in CAIP + env: env as ENV, + }); + + console.log('PushAPI.channels._getSubscribers | Response - 200 OK'); + if (!silent) { + console.log(subscribers); + } +} + +// Push Notification - Socket Connection +async function PushSDKSocket(silent = !showAPIResponse) { + const pushSDKSocket = createSocketConnection({ + user: `eip155:5:${signerAddress}`, // CAIP, see below + socketOptions: { autoConnect: false }, + env: env as ENV, + }); + + if (!pushSDKSocket) { + throw new Error('PushSDKSocket | Socket Connection Failed'); + } + + pushSDKSocket.connect(); + + pushSDKSocket.on(EVENTS.CONNECT, async () => { + console.log('Socket Connected - will disconnect after 4 seconds'); + + // send a notification to see the result + await PushAPI_payloads_sendNotification__direct_payload_single_recipient( + true + ); + }); + + pushSDKSocket.on(EVENTS.DISCONNECT, () => { + console.log('Socket Disconnected'); + }); + + pushSDKSocket.on(EVENTS.USER_FEEDS, (feedItem) => { + // feedItem is the notification data when that notification was received + console.log('Incoming Feed from Socket'); + if (!silent) { + console.log(feedItem); + } + + // disconnect socket after this, not to be done in real implementations + pushSDKSocket.disconnect(); + }); + + const delay = (ms: number) => + new Promise((resolve) => setTimeout(resolve, ms)); + await delay(4000); +} diff --git a/packages/examples/sdk-backend-node/pushAPI/channel.ts b/packages/examples/sdk-backend-node/notification/notification.ts similarity index 72% rename from packages/examples/sdk-backend-node/pushAPI/channel.ts rename to packages/examples/sdk-backend-node/notification/notification.ts index 7e6b236a0..2865fee94 100644 --- a/packages/examples/sdk-backend-node/pushAPI/channel.ts +++ b/packages/examples/sdk-backend-node/notification/notification.ts @@ -1,11 +1,27 @@ import { PushAPI } from '@pushprotocol/restapi'; import { config } from '../config'; import { ethers } from 'ethers'; +import { STREAM } from '@pushprotocol/restapi/src/lib/pushstream/pushStreamTypes'; // CONFIGS const { env, showAPIResponse } = config; -export const runPushAPIChannelCases = async (): Promise => { +const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + +const eventlistener = async ( + pushAPI: PushAPI, + eventName: string +): Promise => { + pushAPI.stream.on(eventName, (data: any) => { + if (showAPIResponse) { + console.log('Stream Event Received'); + console.log(data); + console.log('\n'); + } + }); +}; + +export const runNotificationClassUseCases = async (): Promise => { if (!process.env.WALLET_PRIVATE_KEY) { console.log( 'skipping PushAPI.channel examples, no private key passed in .env' @@ -27,6 +43,13 @@ export const runPushAPIChannelCases = async (): Promise => { // ------------------------------------------------------------------- // ------------------------------------------------------------------- const userAlice = await PushAPI.initialize(signer, { env }); + + // Listen Stream Events for getting websocket events + console.log(`Listening ${STREAM.NOTIF} Events`); + eventlistener(userAlice, STREAM.NOTIF); + console.log(`Listening ${STREAM.NOTIF_OPS} Events`); + eventlistener(userAlice, STREAM.NOTIF_OPS); + console.log('\n\n'); // ------------------------------------------------------------------- // ------------------------------------------------------------------- console.log('PushAPI.channel.info'); @@ -63,14 +86,16 @@ export const runPushAPIChannelCases = async (): Promise => { body: 'test', }, }); - const targetedNotif = await userAlice.channel.send([randomWallet1], { + await delay(3000); // Delay added to log the events in order + const targetedNotif = await userAlice.channel.send([signer.address], { notification: { title: 'test', body: 'test', }, }); + await delay(3000); // Delay added to log the events in order const subsetNotif = await userAlice.channel.send( - [randomWallet1, randomWallet2], + [randomWallet1, randomWallet2, signer.address], { notification: { title: 'test', @@ -78,6 +103,7 @@ export const runPushAPIChannelCases = async (): Promise => { }, } ); + await delay(3000); // Delay added to log the events in order if (showAPIResponse) { console.log(broadcastNotif, targetedNotif, subsetNotif); } @@ -189,4 +215,43 @@ export const runPushAPIChannelCases = async (): Promise => { console.log(aliasInfo); } console.log('PushAPI.channel.alias.info | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.notification.list'); + const inboxNotifications = await userAlice.notification.list('INBOX'); + const spamNotifications = await userAlice.notification.list('SPAM'); + if (showAPIResponse) { + console.log(inboxNotifications, spamNotifications); + } + console.log('PushAPI.notification.list | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.notification.subscribe'); + const subscribeResponse = await userAlice.notification.subscribe( + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' // channel to subscribe + ); + if (showAPIResponse) { + console.log(subscribeResponse); + } + console.log('PushAPI.notification.subscribe | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.notification.subscriptions'); + const aliceSubscriptions = await userAlice.notification.subscriptions(); + if (showAPIResponse) { + console.log(aliceSubscriptions); + } + console.log('PushAPI.notification.subscriptions | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.notification.unsubscribe'); + const unsubscribeResponse = await userAlice.notification.unsubscribe( + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' // channel to unsubscribe + ); + if (showAPIResponse) { + console.log(unsubscribeResponse); + } + console.log('PushAPI.notification.unsubscribe | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- }; diff --git a/packages/examples/sdk-backend-node/pushAPI/chat.ts b/packages/examples/sdk-backend-node/pushAPI/chat.ts deleted file mode 100644 index f34973ec1..000000000 --- a/packages/examples/sdk-backend-node/pushAPI/chat.ts +++ /dev/null @@ -1,227 +0,0 @@ -import { PushAPI } from '@pushprotocol/restapi'; -import { - adjectives, - animals, - colors, - uniqueNamesGenerator, -} from 'unique-names-generator'; -import { config } from '../config'; -import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; -import { createWalletClient, http } from 'viem'; -import { goerli } from 'viem/chains'; - -// CONFIGS -const { env, showAPIResponse } = config; - -/***************** SAMPLE SIGNER GENERATION *********************/ -// Uing VIEM -// Random Wallet Signers -const signer = createWalletClient({ - account: privateKeyToAccount(generatePrivateKey()), - chain: goerli, - transport: http(), -}); -const signerAddress = signer.account.address; -const secondSigner = createWalletClient({ - account: privateKeyToAccount(generatePrivateKey()), - chain: goerli, - transport: http(), -}); -const secondSignerAddress = secondSigner.account.address; -const thirdSigner = createWalletClient({ - account: privateKeyToAccount(generatePrivateKey()), - chain: goerli, - transport: http(), -}); -const thirdSignerAddress = thirdSigner.account.address; - -// Dummy Wallet Addresses -const randomWallet1 = privateKeyToAccount(generatePrivateKey()).address; -const randomWallet2 = privateKeyToAccount(generatePrivateKey()).address; -const randomWallet3 = privateKeyToAccount(generatePrivateKey()).address; -/****************************************************************/ - -/***************** SAMPLE GROUP DATA ****************************/ -const groupName = uniqueNamesGenerator({ - dictionaries: [adjectives, colors, animals], -}); -const groupDescription = uniqueNamesGenerator({ - dictionaries: [adjectives, colors, animals], -}); -const groupImage = - 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg=='; -/***************** SAMPLE GROUP DATA ****************************/ - -export const runPushAPIChatCases = async (): Promise => { - const userAlice = await PushAPI.initialize(signer, { env }); - const userBob = await PushAPI.initialize(secondSigner, { env }); - const tempUser = await PushAPI.initialize(thirdSigner, { env }); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.list'); - const aliceChats = await userAlice.chat.list('CHATS'); - const aliceRequests = await userAlice.chat.list('REQUESTS'); - if (showAPIResponse) { - console.log(aliceChats); - console.log(aliceRequests); - } - console.log('PushAPI.chat.list | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.latest'); - const aliceLatestChatWithBob = await userAlice.chat.latest( - secondSignerAddress - ); - if (showAPIResponse) { - console.log(aliceLatestChatWithBob); - } - console.log('PushAPI.chat.latest | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.history'); - const aliceChatHistoryWithBob = await userAlice.chat.history( - secondSignerAddress - ); - if (showAPIResponse) { - console.log(aliceChatHistoryWithBob); - } - console.log('PushAPI.chat.history | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.send'); - const aliceMessagesBob = await userAlice.chat.send(secondSignerAddress, { - content: 'Hello Bob!', - type: 'Text', - }); - if (showAPIResponse) { - console.log(aliceMessagesBob); - } - console.log('PushAPI.chat.send | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.accept'); - const bobAcceptsRequest = await userBob.chat.accept(signerAddress); - if (showAPIResponse) { - console.log(bobAcceptsRequest); - } - console.log('PushAPI.chat.accept | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.reject'); - await tempUser.chat.send(secondSignerAddress, { - content: 'Sending malicious message', - type: 'Text', - }); - const bobRejectsRequest = await userBob.chat.reject(thirdSignerAddress); - if (showAPIResponse) { - console.log(bobRejectsRequest); - } - console.log('PushAPI.chat.reject | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.block'); - const AliceBlocksBob = await userAlice.chat.block([secondSignerAddress]); - if (showAPIResponse) { - console.log(AliceBlocksBob); - } - console.log('PushAPI.chat.block | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.chat.unblock'); - const AliceUnblocksBob = await userAlice.chat.unblock([secondSignerAddress]); - if (showAPIResponse) { - console.log(AliceUnblocksBob); - } - console.log('PushAPI.chat.unblock | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.create'); - const createdGroup = await userAlice.chat.group.create(groupName, { - description: groupDescription, - image: groupImage, - members: [randomWallet1, randomWallet2], - admins: [], - private: false, - }); - const groupChatId = createdGroup.chatId; // to be used in other examples - if (showAPIResponse) { - console.log(createdGroup); - } - console.log('PushAPI.group.create | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.permissions'); - const grouppermissions = await userAlice.chat.group.permissions(groupChatId); - if (showAPIResponse) { - console.log(grouppermissions); - } - console.log('PushAPI.group.permissions | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.info'); - const groupInfo = await userAlice.chat.group.info(groupChatId); - if (showAPIResponse) { - console.log(groupInfo); - } - console.log('PushAPI.group.info | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.update'); - const updatedGroup = await userAlice.chat.group.update(groupChatId, { - description: 'Updated Description', - }); - if (showAPIResponse) { - console.log(updatedGroup); - } - console.log('PushAPI.group.update | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.add'); - const addMember = await userAlice.chat.group.add(groupChatId, { - role: 'MEMBER', - accounts: [randomWallet3], - }); - if (showAPIResponse) { - console.log(addMember); - } - console.log('PushAPI.group.add | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.remove'); - const removeMember = await userAlice.chat.group.remove(groupChatId, { - role: 'MEMBER', - accounts: [randomWallet3], - }); - if (showAPIResponse) { - console.log(removeMember); - } - console.log('PushAPI.group.remove | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.join'); - const joinGrp = await userBob.chat.group.join(groupChatId); - if (showAPIResponse) { - console.log(joinGrp); - } - console.log('PushAPI.group.join | Response - 200 OK\n\n'); - //------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.leave'); - const leaveGrp = await userBob.chat.group.leave(groupChatId); - if (showAPIResponse) { - console.log(leaveGrp); - } - console.log('PushAPI.group.leave | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.group.reject'); - const sampleGrp = await userAlice.chat.group.create('Sample Grp', { - description: groupDescription, - image: groupImage, - members: [secondSignerAddress], // invite bob - admins: [], - private: true, - }); - await userBob.chat.group.reject(sampleGrp.chatId); - console.log('PushAPI.group.reject | Response - 200 OK\n\n'); -}; diff --git a/packages/examples/sdk-backend-node/pushAPI/encryption.ts b/packages/examples/sdk-backend-node/pushAPI/encryption.ts deleted file mode 100644 index 67300c65f..000000000 --- a/packages/examples/sdk-backend-node/pushAPI/encryption.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { PushAPI } from '@pushprotocol/restapi'; -import { config } from '../config'; -import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; -import { createWalletClient, http } from 'viem'; -import { goerli } from 'viem/chains'; - -// CONFIGS -const { env, showAPIResponse } = config; - -/***************** SAMPLE SIGNER GENERATION *********************/ -// Uing VIEM -// Random Wallet Signers -const signer = createWalletClient({ - account: privateKeyToAccount(generatePrivateKey()), - chain: goerli, - transport: http(), -}); - -export const runPushAPIEncryptionCases = async (): Promise => { - const userAlice = await PushAPI.initialize(signer, { env }); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.encryption.info'); - const encryptionInfo = await userAlice.encryption.info(); - if (showAPIResponse) { - console.log(encryptionInfo); - } - console.log('PushAPI.encryption.info | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.encryption.update'); - const PGP_V3 = 'eip191-aes256-gcm-hkdf-sha256'; - const encryptionUpdate = await userAlice.encryption.update(PGP_V3 as any); - if (showAPIResponse) { - console.log(encryptionUpdate); - } - console.log('PushAPI.encryption.update | Response - 200 OK\n\n'); -}; diff --git a/packages/examples/sdk-backend-node/pushAPI/index.ts b/packages/examples/sdk-backend-node/pushAPI/index.ts deleted file mode 100644 index e7931842c..000000000 --- a/packages/examples/sdk-backend-node/pushAPI/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { PushAPI } from '@pushprotocol/restapi'; -import { config } from '../config'; -import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; -import { createWalletClient, http } from 'viem'; -import { goerli } from 'viem/chains'; -import { runPushAPIChatCases } from './chat'; -import { runPushAPIEncryptionCases } from './encryption'; -import { runPushAPINotificationCases } from './notification'; -import { runPushAPIProfileCases } from './profile'; -import { runPushAPIStreamCases } from './stream'; -import { runPushAPIChannelCases } from './channel'; - -// CONFIGS -const { env, showAPIResponse } = config; - -/***************** SAMPLE SIGNER GENERATION *********************/ -// Uing VIEM -// Random Wallet Signers -const signer = createWalletClient({ - account: privateKeyToAccount(generatePrivateKey()), - chain: goerli, - transport: http(), -}); - -export const runPushAPICases = async (): Promise => { - console.log(` - -ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•— ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— -ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā•”ā•ā•ā•ā•ā• -ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–‘ā–‘ā•šā•ā•ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ -ā–ˆā–ˆā•”ā•ā•ā•ā•ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā•šā•ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā–‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–‘ā•šā•ā•ā•ā–ˆā–ˆā•—ā–‘ā•šā•ā•ā•ā–ˆā–ˆā•— -ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā• -ā•šā•ā•ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā•šā•ā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā•šā•ā•ā–‘ā–‘ā–‘ā–‘ā–‘ā•šā•ā• ā–‘ā•šā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā•šā•ā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā•ā–‘ - `); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.initialize'); - const userAlice = await PushAPI.initialize(signer, { env }); - console.log('PushAPI.initialize | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - // todo : This is yet to be discussed - console.log('PushAPI.info'); - const userAliceInfo = await userAlice.info(); - if (showAPIResponse) { - console.log(userAliceInfo); - } - console.log('PushAPI.info | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - await runPushAPIProfileCases(); // PushAPI.profile - await runPushAPIChatCases(); // PushAPI.chat - await runPushAPIEncryptionCases(); // PushAPI.encryption - await runPushAPINotificationCases(); // PushAPI.notification - await runPushAPIChannelCases(); // PushAPI.channel - await runPushAPIStreamCases(); // PushAPI.stream -}; diff --git a/packages/examples/sdk-backend-node/pushAPI/notification.ts b/packages/examples/sdk-backend-node/pushAPI/notification.ts deleted file mode 100644 index 579ea1e2b..000000000 --- a/packages/examples/sdk-backend-node/pushAPI/notification.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { PushAPI } from '@pushprotocol/restapi'; -import { config } from '../config'; -import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; -import { createWalletClient, http } from 'viem'; -import { goerli } from 'viem/chains'; - -// CONFIGS -const { env, showAPIResponse } = config; - -/***************** SAMPLE SIGNER GENERATION *********************/ -// Uing VIEM -// Random Wallet Signers -const signer = createWalletClient({ - account: privateKeyToAccount(generatePrivateKey()), - chain: goerli, - transport: http(), -}); - -export const runPushAPINotificationCases = async (): Promise => { - const userAlice = await PushAPI.initialize(signer, { env }); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.notification.list'); - const inboxNotifications = await userAlice.notification.list('INBOX'); - const spamNotifications = await userAlice.notification.list('SPAM'); - if (showAPIResponse) { - console.log(inboxNotifications, spamNotifications); - } - console.log('PushAPI.notification.list | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.notification.subscribe'); - const subscribeResponse = await userAlice.notification.subscribe( - 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' // channel to subscribe - ); - if (showAPIResponse) { - console.log(subscribeResponse); - } - console.log('PushAPI.notification.subscribe | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.notification.subscriptions'); - const aliceSubscriptions = await userAlice.notification.subscriptions(); - if (showAPIResponse) { - console.log(aliceSubscriptions); - } - console.log('PushAPI.notification.subscriptions | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.notification.unsubscribe'); - const unsubscribeResponse = await userAlice.notification.unsubscribe( - 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' // channel to unsubscribe - ); - if (showAPIResponse) { - console.log(unsubscribeResponse); - } - console.log('PushAPI.notification.unsubscribe | Response - 200 OK\n\n'); -}; diff --git a/packages/examples/sdk-backend-node/pushAPI/profile.ts b/packages/examples/sdk-backend-node/pushAPI/profile.ts deleted file mode 100644 index f72d93f1b..000000000 --- a/packages/examples/sdk-backend-node/pushAPI/profile.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { PushAPI } from '@pushprotocol/restapi'; -import { config } from '../config'; -import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; -import { createWalletClient, http } from 'viem'; -import { goerli } from 'viem/chains'; - -// CONFIGS -const { env, showAPIResponse } = config; - -/***************** SAMPLE SIGNER GENERATION *********************/ -// Uing VIEM -// Random Wallet Signers -const signer = createWalletClient({ - account: privateKeyToAccount(generatePrivateKey()), - chain: goerli, - transport: http(), -}); - -export const runPushAPIProfileCases = async (): Promise => { - const userAlice = await PushAPI.initialize(signer, { env }); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.profile.info'); - const userAliceProfileInfo = await userAlice.profile.info(); - if (showAPIResponse) { - console.log(userAliceProfileInfo); - } - console.log('PushAPI.profile.info | Response - 200 OK\n\n'); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('PushAPI.profile.update'); - const updatedName = 'Bob The Builder'; - const response = await userAlice.profile.update({ name: updatedName }); - if (showAPIResponse) { - console.log(response); - } - console.log('PushAPI.profile.update | Response - 200 OK\n\n'); -}; diff --git a/packages/examples/sdk-backend-node/pushAPI/stream.ts b/packages/examples/sdk-backend-node/pushAPI/stream.ts deleted file mode 100644 index e10c599c8..000000000 --- a/packages/examples/sdk-backend-node/pushAPI/stream.ts +++ /dev/null @@ -1,202 +0,0 @@ -import { PushAPI } from '@pushprotocol/restapi'; -import { config } from '../config'; -import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; -import { createWalletClient, http } from 'viem'; -import { goerli } from 'viem/chains'; -import { STREAM } from '@pushprotocol/restapi/src/lib/pushstream/pushStreamTypes'; - -// CONFIGS -const { env, showAPIResponse } = config; - -/***************** SAMPLE SIGNER GENERATION *********************/ -// Uing VIEM -// Random Wallet Signers -const signer = createWalletClient({ - account: privateKeyToAccount(generatePrivateKey()), - chain: goerli, - transport: http(), -}); -const signerAddress = signer.account.address; -const secondSigner = createWalletClient({ - account: privateKeyToAccount(generatePrivateKey()), - chain: goerli, - transport: http(), -}); -const secondSignerAddress = secondSigner.account.address; -const thirdSigner = createWalletClient({ - account: privateKeyToAccount(generatePrivateKey()), - chain: goerli, - transport: http(), -}); -const thirdSignerAddress = thirdSigner.account.address; -// Dummy Wallet Addresses -const randomWallet1 = privateKeyToAccount(generatePrivateKey()).address; - -const eventlistener = async ( - pushAPI: PushAPI, - eventName: string -): Promise => { - pushAPI.stream.on(eventName, (data: any) => { - if (showAPIResponse) { - console.log(data); - } - }); -}; - -const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); - -export const runPushAPIStreamCases = async (): Promise => { - const userAlice = await PushAPI.initialize(signer, { env }); - const userBob = await PushAPI.initialize(secondSigner, { env }); - const userKate = await PushAPI.initialize(thirdSigner, { env }); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log(`Listening ${STREAM.PROFILE} Events`); - eventlistener(userAlice, STREAM.PROFILE); - console.log(`Listening ${STREAM.ENCRYPTION} Events`); - eventlistener(userAlice, STREAM.ENCRYPTION); - console.log(`Listening ${STREAM.NOTIF} Events`); - eventlistener(userAlice, STREAM.NOTIF); - console.log(`Listening ${STREAM.NOTIF_OPS} Events`); - eventlistener(userAlice, STREAM.NOTIF_OPS); - console.log(`Listening ${STREAM.CHAT} Events`); - eventlistener(userAlice, STREAM.CHAT); - console.log(`Listening ${STREAM.CHAT_OPS} Events`); - eventlistener(userAlice, STREAM.CHAT_OPS); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('\n\nNew Chat Request, Expected Events:\n1. chat.request'); - await userAlice.chat.send(secondSignerAddress, { - content: 'Hello Bob! from Alice', - }); - await delay(3000); // Delay added to log the events in order - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('\n\nNew Chat Request, Expected Events:\n1. chat.request'); - await userAlice.chat.send(thirdSignerAddress, { - content: 'Hello Kate! from Alice', - }); - await delay(3000); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('\n\nChat Request Accept, Expected Events:\n1. chat.accept'); - await userBob.chat.accept(signerAddress); - await delay(3000); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('\n\nChat Request Reject, Expected Events:\n1. chat.reject'); - await userKate.chat.reject(signerAddress); - await delay(3000); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('\n\nCreate Chat Group, Expected Events:\n1. chat.group.create'); - const groupChatId = ( - await userAlice.chat.group.create('Test Grp', { - description: 'Test Desc', - image: - 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==', - members: [secondSignerAddress, thirdSignerAddress], - admins: [], - private: false, - }) - ).chatId; - await delay(3000); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('\n\nUpdate Chat Group, Expected Events:\n1. chat.group.update'); - await userAlice.chat.group.update(groupChatId, { - description: 'Updated Test Desc', - image: - 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==', - }); - await delay(3000); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('\n\nAdd member to Group, Expected Events:\n1. chat.request'); - await userAlice.chat.group.add(groupChatId, { - role: 'MEMBER', - accounts: [randomWallet1], - }); - await delay(3000); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log( - '\n\nRemove member from Group, Expected Events:\n1. chat.group.participant.remove' - ); - await userAlice.chat.group.remove(groupChatId, { - role: 'MEMBER', - accounts: [randomWallet1], - }); - await delay(3000); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('\n\nAdd Admin to Group, Expected Events:\n1. chat.request'); - await userAlice.chat.group.add(groupChatId, { - role: 'ADMIN', - accounts: [randomWallet1], - }); - await delay(3000); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log( - '\n\nRemove Admin from Group, Expected Events:\n1. chat.group.participant.remove' - ); - await userAlice.chat.group.remove(groupChatId, { - role: 'ADMIN', - accounts: [randomWallet1], - }); - await delay(3000); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log('\n\nJoin Group, Expected Events:\n1. chat.accept'); - await userBob.chat.group.join(groupChatId); - await delay(3000); - //------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log( - '\n\nLeave Group, Expected Events:\n1. chat.group.participant.leave' - ); - await userBob.chat.group.leave(groupChatId); - await delay(3000); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - console.log( - '\n\nReject Group Joining Request, Expected Events:\n1. chat.reject' - ); - await userKate.chat.group.reject(groupChatId); - await delay(3000); - // ------------------------------------------------------------------- - // ------------------------------------------------------------------- - if (process.env.WALLET_PRIVATE_KEY) { - // create signer - const channelSigner = createWalletClient({ - account: privateKeyToAccount(`0x${process.env.WALLET_PRIVATE_KEY}`), - chain: goerli, - transport: http(), - }); - - await userAlice.notification.subscribe( - `eip155:5:${channelSigner.account.address}` // channel to subscribe - ); - - const channelUser = await PushAPI.initialize(channelSigner, { env }); - console.log( - '\n\nSend channel notification, Expected Events:\n1. notif.send' - ); - await channelUser.channel.send(['*'], { - notification: { - title: 'test', - body: 'test', - }, - }); - await delay(3000); - - await userAlice.notification.unsubscribe( - `eip155:5:${channelSigner.account.address}` // channel to subscribe - ); - } else { - console.log( - 'Skipping channel notification streams, as WALLET_PRIVATE_KEY is not present in .env' - ); - } -}; diff --git a/packages/examples/sdk-backend-node/spaces/index.ts b/packages/examples/sdk-backend-node/space/index.ts similarity index 94% rename from packages/examples/sdk-backend-node/spaces/index.ts rename to packages/examples/sdk-backend-node/space/index.ts index 64e04891d..43c7afb32 100644 --- a/packages/examples/sdk-backend-node/spaces/index.ts +++ b/packages/examples/sdk-backend-node/space/index.ts @@ -43,15 +43,14 @@ const spaceDescription = uniqueNamesGenerator({ const spaceImage = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg=='; -export const runSpacesUseCases = async (): Promise => { +export const runSpaceUseCases = async (): Promise => { console.log(` - ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— - ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā•”ā•ā•ā•ā•ā• - ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— - ā•šā•ā•ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā• ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• ā•šā•ā•ā•ā•ā–ˆā–ˆā•‘ - ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ - ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā• ā•šā•ā• ā•šā•ā• ā•šā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā• - +ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— +ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā•ā•ā• +ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā•šā•ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ +ā–‘ā•šā•ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā•ā•ā–‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā•ā–‘ā–‘ +ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— +ā•šā•ā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā•šā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā•ā• `); console.log('PushAPI.user.create'); diff --git a/packages/examples/sdk-backend-node/user/index.ts b/packages/examples/sdk-backend-node/user/index.ts new file mode 100644 index 000000000..6a9dd6d30 --- /dev/null +++ b/packages/examples/sdk-backend-node/user/index.ts @@ -0,0 +1,75 @@ +import { PushAPI } from '@pushprotocol/restapi'; +import { config } from '../config'; +import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; +import { createWalletClient, http } from 'viem'; +import { goerli } from 'viem/chains'; + +// CONFIGS +const { env, showAPIResponse } = config; + +/***************** SAMPLE SIGNER GENERATION *********************/ +// Uing VIEM +// Random Wallet Signers +const signer = createWalletClient({ + account: privateKeyToAccount(generatePrivateKey()), + chain: goerli, + transport: http(), +}); + +export const runUserCases = async (): Promise => { + console.log(` +ā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ +ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•— +ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā• +ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā•šā•ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā•ā–‘ā–‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•— +ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ +ā–‘ā•šā•ā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā–‘ā–‘ā•šā•ā• +`); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.initialize'); + const userAlice = await PushAPI.initialize(signer, { env }); + console.log('PushAPI.initialize | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.info'); + const userAliceInfo = await userAlice.info(); + if (showAPIResponse) { + console.log(userAliceInfo); + } + console.log('PushAPI.info | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.profile.info'); + const userAliceProfileInfo = await userAlice.profile.info(); + if (showAPIResponse) { + console.log(userAliceProfileInfo); + } + console.log('PushAPI.profile.info | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.profile.update'); + const updatedName = 'Bob The Builder'; + const response = await userAlice.profile.update({ name: updatedName }); + if (showAPIResponse) { + console.log(response); + } + console.log('PushAPI.profile.update | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.encryption.info'); + const encryptionInfo = await userAlice.encryption.info(); + if (showAPIResponse) { + console.log(encryptionInfo); + } + console.log('PushAPI.encryption.info | Response - 200 OK\n\n'); + // ------------------------------------------------------------------- + // ------------------------------------------------------------------- + console.log('PushAPI.encryption.update'); + const PGP_V3 = 'eip191-aes256-gcm-hkdf-sha256'; + const encryptionUpdate = await userAlice.encryption.update(PGP_V3 as any); + if (showAPIResponse) { + console.log(encryptionUpdate); + } + console.log('PushAPI.encryption.update | Response - 200 OK\n\n'); +}; diff --git a/packages/examples/sdk-backend-node/video/index.ts b/packages/examples/sdk-backend-node/video/index.ts index e9202c387..afc8e636e 100644 --- a/packages/examples/sdk-backend-node/video/index.ts +++ b/packages/examples/sdk-backend-node/video/index.ts @@ -45,12 +45,12 @@ const skipExample = () => { // Push Video - Run Video Use cases export const runVideoUseCases = async (): Promise => { console.log(` - ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— - ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā•”ā•ā•ā•ā–ˆā–ˆā•— - ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ - ā•šā–ˆā–ˆā•— ā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ - ā•šā–ˆā–ˆā–ˆā–ˆā•”ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā• - ā•šā•ā•ā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• +ā–ˆā–ˆā•—ā–‘ā–‘ā–‘ā–ˆā–ˆā•—ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ +ā–ˆā–ˆā•‘ā–‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā•ā•ā•ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•— +ā•šā–ˆā–ˆā•—ā–‘ā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ +ā–‘ā•šā–ˆā–ˆā–ˆā–ˆā•”ā•ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā–‘ā–‘ā–ˆā–ˆā•‘ā–‘ā–‘ā–ˆā–ˆā•‘ +ā–‘ā–‘ā•šā–ˆā–ˆā•”ā•ā–‘ā–‘ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā• +ā–‘ā–‘ā–‘ā•šā•ā•ā–‘ā–‘ā–‘ā•šā•ā•ā•šā•ā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā•ā•ā–‘ā•šā•ā•ā•ā•ā•ā–‘ `); if (videoLocalStream === null) { From 50b8d5de10cc904c6e3885cad940d6f775315e6f Mon Sep 17 00:00:00 2001 From: Mohammed S Date: Thu, 5 Oct 2023 15:07:48 +0530 Subject: [PATCH 11/18] Alpha to Main merge (#753) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: add name to SpaceIFeeds * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.18 * ci(restapi): šŸŽ‰ cut release to restapi-v1.3.9 * fix: rename based on new convention * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.19 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.19 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.19 * fix: new commit * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.20 * fix: spaces naming * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.21 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.22 * Add alpha version of Spaces SDK (#513) * refactor: added initial SpacesUI class architecture * Update packages/uiweb/src/lib/components/space/SpacesUI.tsx Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> * Update packages/uiweb/src/lib/components/space/SpacesUI.tsx Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> * fix: refine code structure * refactor: change structure and added a test sample * feat: added themeprovider for spaces ui components (#436) * feat: feat: add themeprovider for spaces * fix: resolved conflicts * refactor: cleaned up provider * refactor: resolved comments * feat: added colors and themeing in demoreactapp * refactor: cleaned code * refactor: resolved comments * refactor: added a basic style structure for ease of use (#453) * feat: SpaceBanner Component (#438) * feat: SpaceBanner * refactor: removed-optionals * feat: space-banner functionality * fix: reverted app.tsx * fix: reverted app.tsx * fix: removed test svg file * refactor: change structure and added a test sample * feat: space-banner functionality * refactor: api-implementation * fix: removed-svg * refactor: mobile version * Revert "fix: removed test svg file" This reverts commit 7af756badaeb8435db60712c42ca57ef9ce9f74c. * Revert "refactor: change structure and added a test sample" This reverts commit b1e8745948a9ce5e0485ad51a8cffd07010a5186. * fix: revert * refactor: lastest-pull * feat: added-spaceBanner-test * refactor: cache-to-context * refactor: custom hook added for data * refactor: spaceDTO * fix: SpaceDTO implementation * refactor: participant-container * refactor: cleanups * fix: ui-fixes * fix: EOF newlines * fix: overflow-fixed * refactor: tweaked context structure a bit --------- Co-authored-by: Samarendra Gouda Co-authored-by: Nilesh Gupta * refactor: updated theme object along with light and dark theme * feat: Create Space Component (#454) * refactor: resolved merge conflicts * feat: added modals and modal behaviour logic * feat: modal inputs * feat: change modal logic + integr8 API * feat: added CSS for modals and inputs * fix: resolved PR comments * refactor: improve css * refactor: rft create modal * feat: added search input component * Refactor/space widget component (#458) * refactor: added basic design * refactor: added full widget with style * refactor: reduced fixed height of scheduled widget content * refactor: changes requested * refactor: resolved review comments * feat: add spaces info component (#474) * Feat/added members modal (#477) * refactor: added modal * refactor: added members modal * refactor: review comments * refactor: resolve review comments * fix: review comments * 424 spaces functions webrtc logic (#482) * fix: add spaces for functions * fix: Separate page for space in the demo react APP * fix: start/stop spaces functions * fix: fix image and description types * fix: added functions to add and remove members from group * fix: spaces functions * fix: spaces functions refactoring * fix: few more changes * fix: spaces function testing * fix: spaces functions * fix: SDK bug fixes * fix: SDK bug fixes * fix: minor fixes * fix: minor fix * fix: minor fix * feat(video): add create mesh connection logic in Video class * feat(spaces): make video mesh compatible & add spaces class * feat(spaces): add backend methods in Space class --------- Co-authored-by: Shoaib Mohammed Co-authored-by: Madhur Gupta * refactor: spaces UI Components refactor (#478) > replaced hardcoded styles with context theme >added smoother animations on collapsoble components >added profile cards to invite modal * refactor: added spaceUI class variables into context as well (#488) * refactor: added spaceUI class variables into context as well * refactor: resolve review comments * refactor: added a clickHandler in spaceBanner component for extra flexibility (#489) * fix(spaces): fix console errs and refactor create, update methods (#492) * fix: add spaces for functions * fix: Separate page for space in the demo react APP * fix: start/stop spaces functions * fix: fix image and description types * fix: added functions to add and remove members from group * fix: spaces functions * fix: spaces functions refactoring * fix: few more changes * fix: spaces function testing * fix: spaces functions * fix: SDK bug fixes * fix: SDK bug fixes * fix: minor fixes * fix: minor fix * fix: minor fix * feat(video): add create mesh connection logic in Video class * feat(spaces): make video mesh compatible & add spaces class * feat(spaces): add backend methods in Space class * fix: Merge branch 'alpha' into 424-spaces-functions-webrtc-logic * fix(spaces): fix console errors and move out create, update functions from Space class --------- Co-authored-by: Shoaib Mohammed * refactor: modified init class method * refactor/added-space-feed-component(#481) * feat: space-feed * refactor: space-feed * Deployment (#440) * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.0 * fix(component): dummy * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.0 * fix(component): dummy * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.1 * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.1 * fix(component): dummy * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.2 * fix(component): dummy * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.2 * fix(component): dummy * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.3 * fix: success progressHook * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.4 * ci(restapi): šŸŽ‰ cut release to restapi-v1.1.0 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.0 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.0 * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.0 * fix(component): dummy * fix(component): dummy * fix(component): dummy * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.2 * fix(component): dummy * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.3 * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.4 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.1 * fix: local for local development (#295) Co-Authored-By: aman035 * fix: version update * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.2 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.3 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.4 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.5 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.6 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.7 * ci(socket): šŸŽ‰ cut release to socket-v0.5.0 * fix: test commit * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.8 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.0.0 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.0.0 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.0.1 * fix: added ci-version-beta * fix: added ci-version-beta * ci(restapi): šŸŽ‰ cut beta release to restapi-v1.2.9 * fix: added releaseType * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-beta.0 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-beta.0 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.10 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.10 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-beta.1 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.11 * fix: linkedListHash test cases removed & CI version corrected * fix: update name to beta * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.12 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.12 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.13 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.14 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.15 * fix: update package json * fix: updated socket version * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.0.2 * fix: socket lib update * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.0.2 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.16 * ci(restapi): šŸŽ‰ cut release to restapi-v1.3.0 * ci(restapi): šŸŽ‰ cut release to restapi-v1.3.1 * ci(socket): šŸŽ‰ cut release to socket-v0.5.1 * ci(restapi): šŸŽ‰ cut release to restapi-v1.3.2 * ci(restapi): šŸŽ‰ cut release to restapi-v1.3.3 * ci(restapi): šŸŽ‰ cut release to restapi-v1.3.4 --------- Co-authored-by: aman035 * feat: space-feed * refactor: space-feed * fix: api-call-custom-hooks * fix: api-call * refactor: enums/changes * fix: scrollable * fix: scrolling-issue * feat: filter-changes * fix: added types * fix: loader-issue * fix: tab-button-color * feat: new-filter and prop * fix: ended-logic && participant-number logic * refactor: add onBannerClick * fix: conflicts * revert: messed-up spaceBanner * fix: onClick issue * fix: onClick and cleanups * refactor: new pagination interface * fix: scroll-logic * fix: scroll-final * fix: .. * fix: removed any * fix: onClick-issue * fix: loading-context-to-state * refactor: add-NoSpaceIcons * refactor: new-ui-layout * refactor: new-ui-layout --------- Co-authored-by: Mohammed S Co-authored-by: aman035 Co-authored-by: Nilesh Gupta * refactor: added structure for spaces invites modal component * refactor: invite-component * fix: minor-bug * feat: Create Space API Integration (#494) * feat: create spaces integration * feat: added datetime picker * feat: completed create space API integration * feat: changed flow and time component * feat(spaces): initiate livepeer playback in start method (#499) * fix: add spaces for functions * fix: Separate page for space in the demo react APP * fix: start/stop spaces functions * fix: fix image and description types * fix: added functions to add and remove members from group * fix: spaces functions * fix: spaces functions refactoring * fix: few more changes * fix: spaces function testing * fix: spaces functions * fix: SDK bug fixes * fix: SDK bug fixes * fix: minor fixes * fix: minor fix * fix: minor fix * feat(video): add create mesh connection logic in Video class * feat(spaces): make video mesh compatible & add spaces class * feat(spaces): add backend methods in Space class * fix: Merge branch 'alpha' into 424-spaces-functions-webrtc-logic * fix(spaces): fix console errors and move out create, update functions from Space class * feat(spaces): initiate livepeer playback in start method * feat(spaces): store livepeer playback id in space description --------- Co-authored-by: Shoaib Mohammed * Add initialize method (#505) * fix: add spaces for functions * fix: Separate page for space in the demo react APP * fix: start/stop spaces functions * fix: fix image and description types * fix: added functions to add and remove members from group * fix: spaces functions * fix: spaces functions refactoring * fix: few more changes * fix: spaces function testing * fix: spaces functions * fix: SDK bug fixes * fix: SDK bug fixes * fix: minor fixes * fix: minor fix * fix: minor fix * feat(video): add create mesh connection logic in Video class * feat(spaces): make video mesh compatible & add spaces class * feat(spaces): add backend methods in Space class * fix: Merge branch 'alpha' into 424-spaces-functions-webrtc-logic * fix(spaces): fix console errors and move out create, update functions from Space class * feat(spaces): initiate livepeer playback in start method * feat(spaces): store livepeer playback id in space description * feat(spaces): add intitialize method --------- Co-authored-by: Shoaib Mohammed * refactor: resolved css in space banner * refactor: added a skeleton loading effect on space Banner component * feat: add invite functionality to create space (#506) * feat: added invite functionality * fix: add logic for time selector * fix: css fixes * refactor: info-on-widget (#504) * refactor: info-on-widget * refactor: add Space class to context * fix: padding, added new mic icons * fix: added-ref to context * feat: start added * fix: remove optional spaceId * fix: inf-bug * fix: effectAdded * fix(spaces): add is supported check in start * refactor: added-join-functionalities (#507) * refactor: added-join-functionalities * fix: screens * fix(spaces): fix livepeer stream creation in start --------- Co-authored-by: Madhur Gupta * Fix join and pgpPrivateKey in demoreact (#508) * refactor: info-on-widget * refactor: add Space class to context * fix: padding, added new mic icons * fix: added-ref to context * feat: start added * fix: remove optional spaceId * fix: inf-bug * fix: effectAdded * fix(spaces): add is supported check in start * refactor: added-join-functionalities * fix: screens * refactor: added-join-functionalities (#507) * refactor: added-join-functionalities * fix: screens * fix(spaces): fix livepeer stream creation in start * fix: join function --------- Co-authored-by: samarendra-push Co-authored-by: Samarendra Gouda <134079446+samarendra-push@users.noreply.github.com> * refactor: added feature of triggering widget from sdk * fix(spaces): fix join as speaker and listner * fix: resolved updating env and other class variables * Spaces/UI migration (#510) * fix: ui-migration * fix: migration fixes * refactor: added notification socket for space in uiweb * feat: add remove and admin func to invite modal (#509) * feat: add remove and admin func to invite modal * fix: fix null * fix(spaces): fix start * feat: add join functionality to invited spaces (#512) * feat: add join functionality to invited spaces * fix: open space widget after joining * refactor: add audio playback from space speakers (#511) * refactor: added a hidden Video container * fix: migrated initSpaceObject to parent component * feat(spaces): add user feeds socket handler logic --------- Co-authored-by: Nilesh Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Samarendra Gouda <134079446+samarendra-push@users.noreply.github.com> Co-authored-by: Samarendra Gouda Co-authored-by: Shoaib Mohammed Co-authored-by: aman035 Co-authored-by: samarendra-push * Spaces backend examples (#522) * fix: spaces documentation * Update README.md * fix: formatting issues * fix: uncommented code * Spaces SDK alpha publish (#520) * refactor: added initial SpacesUI class architecture * Update packages/uiweb/src/lib/components/space/SpacesUI.tsx Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> * Update packages/uiweb/src/lib/components/space/SpacesUI.tsx Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> * fix: refine code structure * refactor: change structure and added a test sample * feat: added themeprovider for spaces ui components (#436) * feat: feat: add themeprovider for spaces * fix: resolved conflicts * refactor: cleaned up provider * refactor: resolved comments * feat: added colors and themeing in demoreactapp * refactor: cleaned code * refactor: resolved comments * refactor: added a basic style structure for ease of use (#453) * feat: SpaceBanner Component (#438) * feat: SpaceBanner * refactor: removed-optionals * feat: space-banner functionality * fix: reverted app.tsx * fix: reverted app.tsx * fix: removed test svg file * refactor: change structure and added a test sample * feat: space-banner functionality * refactor: api-implementation * fix: removed-svg * refactor: mobile version * Revert "fix: removed test svg file" This reverts commit 7af756badaeb8435db60712c42ca57ef9ce9f74c. * Revert "refactor: change structure and added a test sample" This reverts commit b1e8745948a9ce5e0485ad51a8cffd07010a5186. * fix: revert * refactor: lastest-pull * feat: added-spaceBanner-test * refactor: cache-to-context * refactor: custom hook added for data * refactor: spaceDTO * fix: SpaceDTO implementation * refactor: participant-container * refactor: cleanups * fix: ui-fixes * fix: EOF newlines * fix: overflow-fixed * refactor: tweaked context structure a bit --------- Co-authored-by: Samarendra Gouda Co-authored-by: Nilesh Gupta * refactor: updated theme object along with light and dark theme * feat: Create Space Component (#454) * refactor: resolved merge conflicts * feat: added modals and modal behaviour logic * feat: modal inputs * feat: change modal logic + integr8 API * feat: added CSS for modals and inputs * fix: resolved PR comments * refactor: improve css * refactor: rft create modal * feat: added search input component * Refactor/space widget component (#458) * refactor: added basic design * refactor: added full widget with style * refactor: reduced fixed height of scheduled widget content * refactor: changes requested * refactor: resolved review comments * feat: add spaces info component (#474) * Feat/added members modal (#477) * refactor: added modal * refactor: added members modal * refactor: review comments * refactor: resolve review comments * fix: review comments * 424 spaces functions webrtc logic (#482) * fix: add spaces for functions * fix: Separate page for space in the demo react APP * fix: start/stop spaces functions * fix: fix image and description types * fix: added functions to add and remove members from group * fix: spaces functions * fix: spaces functions refactoring * fix: few more changes * fix: spaces function testing * fix: spaces functions * fix: SDK bug fixes * fix: SDK bug fixes * fix: minor fixes * fix: minor fix * fix: minor fix * feat(video): add create mesh connection logic in Video class * feat(spaces): make video mesh compatible & add spaces class * feat(spaces): add backend methods in Space class --------- Co-authored-by: Shoaib Mohammed Co-authored-by: Madhur Gupta * refactor: spaces UI Components refactor (#478) > replaced hardcoded styles with context theme >added smoother animations on collapsoble components >added profile cards to invite modal * refactor: added spaceUI class variables into context as well (#488) * refactor: added spaceUI class variables into context as well * refactor: resolve review comments * refactor: added a clickHandler in spaceBanner component for extra flexibility (#489) * fix(spaces): fix console errs and refactor create, update methods (#492) * fix: add spaces for functions * fix: Separate page for space in the demo react APP * fix: start/stop spaces functions * fix: fix image and description types * fix: added functions to add and remove members from group * fix: spaces functions * fix: spaces functions refactoring * fix: few more changes * fix: spaces function testing * fix: spaces functions * fix: SDK bug fixes * fix: SDK bug fixes * fix: minor fixes * fix: minor fix * fix: minor fix * feat(video): add create mesh connection logic in Video class * feat(spaces): make video mesh compatible & add spaces class * feat(spaces): add backend methods in Space class * fix: Merge branch 'alpha' into 424-spaces-functions-webrtc-logic * fix(spaces): fix console errors and move out create, update functions from Space class --------- Co-authored-by: Shoaib Mohammed * refactor: modified init class method * refactor/added-space-feed-component(#481) * feat: space-feed * refactor: space-feed * Deployment (#440) * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.0 * fix(component): dummy * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.0 * fix(component): dummy * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.1 * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.1 * fix(component): dummy * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.2 * fix(component): dummy * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.2 * fix(component): dummy * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.3 * fix: success progressHook * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.4 * ci(restapi): šŸŽ‰ cut release to restapi-v1.1.0 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.0 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.0 * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.0 * fix(component): dummy * fix(component): dummy * fix(component): dummy * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.2 * fix(component): dummy * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.3 * ci(restapi): šŸŽ‰ cut release to restapi-v1.0.4 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.1 * fix: local for local development (#295) Co-Authored-By: aman035 * fix: version update * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.2 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.3 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.4 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.5 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.6 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.7 * ci(socket): šŸŽ‰ cut release to socket-v0.5.0 * fix: test commit * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.8 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.0.0 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.0.0 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.0.1 * fix: added ci-version-beta * fix: added ci-version-beta * ci(restapi): šŸŽ‰ cut beta release to restapi-v1.2.9 * fix: added releaseType * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-beta.0 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-beta.0 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.10 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.10 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-beta.1 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.11 * fix: linkedListHash test cases removed & CI version corrected * fix: update name to beta * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.12 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.12 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.13 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.14 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.15 * fix: update package json * fix: updated socket version * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.0.2 * fix: socket lib update * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.0.2 * ci(restapi): šŸŽ‰ cut release to restapi-v1.2.16 * ci(restapi): šŸŽ‰ cut release to restapi-v1.3.0 * ci(restapi): šŸŽ‰ cut release to restapi-v1.3.1 * ci(socket): šŸŽ‰ cut release to socket-v0.5.1 * ci(restapi): šŸŽ‰ cut release to restapi-v1.3.2 * ci(restapi): šŸŽ‰ cut release to restapi-v1.3.3 * ci(restapi): šŸŽ‰ cut release to restapi-v1.3.4 --------- Co-authored-by: aman035 * feat: space-feed * refactor: space-feed * fix: api-call-custom-hooks * fix: api-call * refactor: enums/changes * fix: scrollable * fix: scrolling-issue * feat: filter-changes * fix: added types * fix: loader-issue * fix: tab-button-color * feat: new-filter and prop * fix: ended-logic && participant-number logic * refactor: add onBannerClick * fix: conflicts * revert: messed-up spaceBanner * fix: onClick issue * fix: onClick and cleanups * refactor: new pagination interface * fix: scroll-logic * fix: scroll-final * fix: .. * fix: removed any * fix: onClick-issue * fix: loading-context-to-state * refactor: add-NoSpaceIcons * refactor: new-ui-layout * refactor: new-ui-layout --------- Co-authored-by: Mohammed S Co-authored-by: aman035 Co-authored-by: Nilesh Gupta * refactor: added structure for spaces invites modal component * refactor: invite-component * fix: minor-bug * feat: Create Space API Integration (#494) * feat: create spaces integration * feat: added datetime picker * feat: completed create space API integration * feat: changed flow and time component * feat(spaces): initiate livepeer playback in start method (#499) * fix: add spaces for functions * fix: Separate page for space in the demo react APP * fix: start/stop spaces functions * fix: fix image and description types * fix: added functions to add and remove members from group * fix: spaces functions * fix: spaces functions refactoring * fix: few more changes * fix: spaces function testing * fix: spaces functions * fix: SDK bug fixes * fix: SDK bug fixes * fix: minor fixes * fix: minor fix * fix: minor fix * feat(video): add create mesh connection logic in Video class * feat(spaces): make video mesh compatible & add spaces class * feat(spaces): add backend methods in Space class * fix: Merge branch 'alpha' into 424-spaces-functions-webrtc-logic * fix(spaces): fix console errors and move out create, update functions from Space class * feat(spaces): initiate livepeer playback in start method * feat(spaces): store livepeer playback id in space description --------- Co-authored-by: Shoaib Mohammed * Add initialize method (#505) * fix: add spaces for functions * fix: Separate page for space in the demo react APP * fix: start/stop spaces functions * fix: fix image and description types * fix: added functions to add and remove members from group * fix: spaces functions * fix: spaces functions refactoring * fix: few more changes * fix: spaces function testing * fix: spaces functions * fix: SDK bug fixes * fix: SDK bug fixes * fix: minor fixes * fix: minor fix * fix: minor fix * feat(video): add create mesh connection logic in Video class * feat(spaces): make video mesh compatible & add spaces class * feat(spaces): add backend methods in Space class * fix: Merge branch 'alpha' into 424-spaces-functions-webrtc-logic * fix(spaces): fix console errors and move out create, update functions from Space class * feat(spaces): initiate livepeer playback in start method * feat(spaces): store livepeer playback id in space description * feat(spaces): add intitialize method --------- Co-authored-by: Shoaib Mohammed * refactor: resolved css in space banner * refactor: added a skeleton loading effect on space Banner component * feat: add invite functionality to create space (#506) * feat: added invite functionality * fix: add logic for time selector * fix: css fixes * refactor: info-on-widget (#504) * refactor: info-on-widget * refactor: add Space class to context * fix: padding, added new mic icons * fix: added-ref to context * feat: start added * fix: remove optional spaceId * fix: inf-bug * fix: effectAdded * fix(spaces): add is supported check in start * refactor: added-join-functionalities (#507) * refactor: added-join-functionalities * fix: screens * fix(spaces): fix livepeer stream creation in start --------- Co-authored-by: Madhur Gupta * Fix join and pgpPrivateKey in demoreact (#508) * refactor: info-on-widget * refactor: add Space class to context * fix: padding, added new mic icons * fix: added-ref to context * feat: start added * fix: remove optional spaceId * fix: inf-bug * fix: effectAdded * fix(spaces): add is supported check in start * refactor: added-join-functionalities * fix: screens * refactor: added-join-functionalities (#507) * refactor: added-join-functionalities * fix: screens * fix(spaces): fix livepeer stream creation in start * fix: join function --------- Co-authored-by: samarendra-push Co-authored-by: Samarendra Gouda <134079446+samarendra-push@users.noreply.github.com> * refactor: added feature of triggering widget from sdk * fix(spaces): fix join as speaker and listner * fix: resolved updating env and other class variables * Spaces/UI migration (#510) * fix: ui-migration * fix: migration fixes * refactor: added notification socket for space in uiweb * feat: add remove and admin func to invite modal (#509) * feat: add remove and admin func to invite modal * fix: fix null * fix(spaces): fix start * feat: add join functionality to invited spaces (#512) * feat: add join functionality to invited spaces * fix: open space widget after joining * refactor: add audio playback from space speakers (#511) * refactor: added a hidden Video container * fix: migrated initSpaceObject to parent component * feat(spaces): add user feeds socket handler logic * fix: fix create invite UI edge cases (#515) * fix: fix create invite UI edge cases * fix: fix env * fix: fix state behaviour * fix: add wallet as name if name string empty add wallet as name if name string empty * refactor: added join function and socket code (#517) * refactor: added join function and socket code * refactor(spaces): fix mesh creation logic * refactor(spaces): remove unused imports from context * refactor(spaces): remove unused code and improve positioning of code blocks --------- Co-authored-by: Madhur Gupta * Fix isJoined, add hidden video tag (#514) * refactor: added a hidden Video container * fix: migrated initSpaceObject to parent component * fix: WIP isJoined * fix: join as a listener --------- Co-authored-by: Madhur Gupta * fix(spaces): add create audio call before join for speakers (#518) * Widget/videoplayer (#519) * refactor: added a hidden Video container * fix: migrated initSpaceObject to parent component * fix: WIP isJoined * fix: revert husky * fix: nx.json revert * fix: join as a listener * fix: start ui-logic refactor * fix: merge-conflicts * fix: isListener * fix(spaces): fix isSpeaker and isListner logic * feat: added blockies (#523) --------- Co-authored-by: Nilesh Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Samarendra Gouda <134079446+samarendra-push@users.noreply.github.com> Co-authored-by: Samarendra Gouda Co-authored-by: Shoaib Mohammed Co-authored-by: aman035 Co-authored-by: samarendra-push * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.23 * Update README.md * fix: rename chats to spaces * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.24 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.0 * fix: spaces examples fixes * fix: renamed spaces variables and removed some unused variables * Update README.md * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.1 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.0 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.1 * fix: corrections * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.2 * fix: space api * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.25 * fix: use SpaceIFeeds * fix: signer compatibility with viem and ethers * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.3 * fix: space feed API path fix * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.4 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.2 * fix: revert space changes * fix: merge main * fix: signer compatibility with viem and ethers (#567) * fix: signer compatibility with viem and ethers * fix: revert space changes * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.26 * Update README.md * Update README.md * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.3 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.27 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.4 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.5 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.6 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.7 * fix: add: scw sig verification (#593) * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.28 * fix: url correction * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.29 * ci(socket): šŸŽ‰ cut release to socket-v0.5.2 * fix: fixed subscribe and unsubscribe * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.5 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.8 * Feat/chat components (#621) * feat: created architechture * fix: added context values (#594) * Chat dataprovider (#596) * feat: data provider for chat component * fix: replaced react.usestate to usestate * fix: added props as the initial state and changed state name * fix: reverted chat context changes and renamed values * fix: added test page for chat ui components (#597) * added chatbubble component (#602) * feat: added chatbubble component * fix: made the messageBubble's width to fit-content --------- Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * fix: added theme * Group chat bubble (#604) * feat: moved test component to testui folder & replaced dummy data with sdk response * feat: added twitter card and address for group chat received msg * feat: made the messageaddress reusable, added account from context * fix: removed unnecessary div and unused props and console logs * feat: adding pfp in text bubbles * fix: replaced hook with function and added pfp to messagebubble * fix: fixed image alignment * fix: changed border-radius of msg bubble and changed function name * fix: fixed theme and decryptedPrivateKey name (#616) * fix: fixed theme and decryptedPrivateKey name * fix: fixed bug * fix: fixed theme reviews * Message list (#615) * fix: message list comp * fix: message list comp * fix: added pagination * fix: added pagination * fix: pagination * fix: create useChatData hook * fix: fixed minor bug * fix: socket issues fixed * fix: added theme in msgbubble (#620) * fix: added theme in msgbubble * fix: fixed import --------- Co-authored-by: Monalisha Mishra --------- Co-authored-by: Satyam <100528412+KlausMikhaelson@users.noreply.github.com> Co-authored-by: KlausMikhaelson * fix: add alpha support to UI web * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.0 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.6 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.9 * Feat/chat components (#625) * feat: created architechture * fix: added context values (#594) * Chat dataprovider (#596) * feat: data provider for chat component * fix: replaced react.usestate to usestate * fix: added props as the initial state and changed state name * fix: reverted chat context changes and renamed values * fix: added test page for chat ui components (#597) * added chatbubble component (#602) * feat: added chatbubble component * fix: made the messageBubble's width to fit-content --------- Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * fix: added theme * Group chat bubble (#604) * feat: moved test component to testui folder & replaced dummy data with sdk response * feat: added twitter card and address for group chat received msg * feat: made the messageaddress reusable, added account from context * fix: removed unnecessary div and unused props and console logs * feat: adding pfp in text bubbles * fix: replaced hook with function and added pfp to messagebubble * fix: fixed image alignment * fix: changed border-radius of msg bubble and changed function name * fix: fixed theme and decryptedPrivateKey name (#616) * fix: fixed theme and decryptedPrivateKey name * fix: fixed bug * fix: fixed theme reviews * Message list (#615) * fix: message list comp * fix: message list comp * fix: added pagination * fix: added pagination * fix: pagination * fix: create useChatData hook * fix: fixed minor bug * fix: socket issues fixed * fix: added theme in msgbubble (#620) * fix: added theme in msgbubble * fix: fixed import --------- Co-authored-by: Monalisha Mishra * fix: exported the theme (#623) * fix: exported the theme * fix: fixed issues --------- Co-authored-by: Monalisha Mishra --------- Co-authored-by: Satyam <100528412+KlausMikhaelson@users.noreply.github.com> Co-authored-by: KlausMikhaelson * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.1 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.7 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.8 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.10 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.9 * 632 group access control sdk changes (#640) * fix: group access control changes * fix: get group access SDK fix * fix: removed unnecessary param * Update README.md * Update README.md * Update README.md * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.30 * Reduce profile creation signature to 2 (#639) * fix: reduced signatures * fix: fixed examples * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.31 * fix: Read me fixes * fix: Space rules * Update README.md * Update README.md * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.32 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.10 * Feat/chat components (#658) * feat: created architechture * fix: added context values (#594) * Chat dataprovider (#596) * feat: data provider for chat component * fix: replaced react.usestate to usestate * fix: added props as the initial state and changed state name * fix: reverted chat context changes and renamed values * fix: added test page for chat ui components (#597) * added chatbubble component (#602) * feat: added chatbubble component * fix: made the messageBubble's width to fit-content --------- Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * fix: added theme * Group chat bubble (#604) * feat: moved test component to testui folder & replaced dummy data with sdk response * feat: added twitter card and address for group chat received msg * feat: made the messageaddress reusable, added account from context * fix: removed unnecessary div and unused props and console logs * feat: adding pfp in text bubbles * fix: replaced hook with function and added pfp to messagebubble * fix: fixed image alignment * fix: changed border-radius of msg bubble and changed function name * fix: fixed theme and decryptedPrivateKey name (#616) * fix: fixed theme and decryptedPrivateKey name * fix: fixed bug * fix: fixed theme reviews * Message list (#615) * fix: message list comp * fix: message list comp * fix: added pagination * fix: added pagination * fix: pagination * fix: create useChatData hook * fix: fixed minor bug * fix: socket issues fixed * fix: added theme in msgbubble (#620) * fix: added theme in msgbubble * fix: fixed import --------- Co-authored-by: Monalisha Mishra * fix: exported the theme (#623) * fix: exported the theme * fix: fixed issues --------- Co-authored-by: Monalisha Mishra * Typebar component (#631) * feat: added typebar UI * feat: added functions to typebar * fix: added icon * fix: fixed theme issues --------- Co-authored-by: Monalisha Mishra * feat: added connectbutton * fix: fixed connectbtn ui and remove disconnect and fixed error on disconnect * fix: fixed create account getting called twice * Profile Header Component (#636) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * Message container (#635) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * fix: updated svg to react component * fix: changed svg to tsx component * fix: fixed review changes (#646) * fix: fixed review changes * fix: resolved issues --------- Co-authored-by: Nilesh Gupta * Profile Header -> Chat Profile fixes (#647) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * fix: notifs * fix: correct theme colors * fix: renaming profileHeader * fix: qa fixes * fix: loader * refactor: resolved issues * fix: edit types --------- Co-authored-by: Nilesh Gupta * fix: resolved package not added issue * Fix: modal issue in group info && alert remove members (#653) * fix: modal * fix: update changes * refactor: resolved issue --------- Co-authored-by: Nilesh Gupta * fix: QA fixes (#654) --------- Co-authored-by: Monalisha Mishra Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> Co-authored-by: Satyam <100528412+KlausMikhaelson@users.noreply.github.com> Co-authored-by: KlausMikhaelson Co-authored-by: Kolade * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.11 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.12 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.11 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.13 * fix: update read me file * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.14 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.15 * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.12 * Feat/chat components (#679) * feat: created architechture * fix: added context values (#594) * Chat dataprovider (#596) * feat: data provider for chat component * fix: replaced react.usestate to usestate * fix: added props as the initial state and changed state name * fix: reverted chat context changes and renamed values * fix: added test page for chat ui components (#597) * added chatbubble component (#602) * feat: added chatbubble component * fix: made the messageBubble's width to fit-content --------- Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * fix: added theme * Group chat bubble (#604) * feat: moved test component to testui folder & replaced dummy data with sdk response * feat: added twitter card and address for group chat received msg * feat: made the messageaddress reusable, added account from context * fix: removed unnecessary div and unused props and console logs * feat: adding pfp in text bubbles * fix: replaced hook with function and added pfp to messagebubble * fix: fixed image alignment * fix: changed border-radius of msg bubble and changed function name * fix: fixed theme and decryptedPrivateKey name (#616) * fix: fixed theme and decryptedPrivateKey name * fix: fixed bug * fix: fixed theme reviews * Message list (#615) * fix: message list comp * fix: message list comp * fix: added pagination * fix: added pagination * fix: pagination * fix: create useChatData hook * fix: fixed minor bug * fix: socket issues fixed * fix: added theme in msgbubble (#620) * fix: added theme in msgbubble * fix: fixed import --------- Co-authored-by: Monalisha Mishra * fix: exported the theme (#623) * fix: exported the theme * fix: fixed issues --------- Co-authored-by: Monalisha Mishra * Typebar component (#631) * feat: added typebar UI * feat: added functions to typebar * fix: added icon * fix: fixed theme issues --------- Co-authored-by: Monalisha Mishra * feat: added connectbutton * fix: fixed connectbtn ui and remove disconnect and fixed error on disconnect * fix: fixed create account getting called twice * Profile Header Component (#636) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * Message container (#635) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * fix: updated svg to react component * fix: changed svg to tsx component * fix: fixed review changes (#646) * fix: fixed review changes * fix: resolved issues --------- Co-authored-by: Nilesh Gupta * Profile Header -> Chat Profile fixes (#647) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * fix: notifs * fix: correct theme colors * fix: renaming profileHeader * fix: qa fixes * fix: loader * refactor: resolved issues * fix: edit types --------- Co-authored-by: Nilesh Gupta * fix: resolved package not added issue * Fix: modal issue in group info && alert remove members (#653) * fix: modal * fix: update changes * refactor: resolved issue --------- Co-authored-by: Nilesh Gupta * fix: QA fixes (#654) * Connect btn revamp (#668) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container * feat: adding rainbowkit for btn * fix: fix issues * fix: addec onnect functionality * fix: connect button * fix: added hack for rainbowkit css --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * Typebar UI issue (#666) * fix: fixed typebar space not working and theme * fix: fixed gif and emoji --------- Co-authored-by: KlausMikhaelson * fix: fixed theme colours * fix: added theme for brb * fix: added filter hat * fix: merged with main * fix: fixed msg border * fix: fixed theme * fix: fixed fonts * fix: fixed bug * Access control (#672) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * fix: added minor fix --------- Co-authored-by: Monalisha Mishra * fix: fixed padding issues * fix(f): fixed build issues * fix: fix for chat status test * Check rules access control (#678) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * 662 group access control v2 changes (#663) * fix: spaces access API * fix: custom endpoint doc impl * Update README.md * Update README.md * fix: review comments change * fix: read me update * Update README.md * Update README.md * fix: origin in user creation (#665) * fix: origin in user creation * Update README.md * fix: review comments * 662 group access control v2 changes (#677) * fix: spaces access API * fix: custom endpoint doc impl * Update README.md * Update README.md * fix: review comments change * fix: read me update * Update README.md * Update README.md * fix(spaces): broadcast changes and UX fixes (#674) * fix: fix UI grid view (#642) * fix: fix UI grid view * refactor: conditional added * fix: resolved muting/unmuting try catch error (#657) * fix(spaces): fix livepeer broadcast (#656) * fix(spaces): fix livepeer broadcast * fix(spaces): fix data shown for unjoined space & promote listener logic --------- Co-authored-by: Madhur Gupta * refactor(spaces): use local state instead of get from server while meta message fire (#676) --------- Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Nilesh Gupta * feat: added verification option to show only on token gated groups * fix: fixing group access control --------- Co-authored-by: Monalisha Mishra Co-authored-by: Mohammed S Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Nilesh Gupta * fix: fixed build --------- Co-authored-by: Satyam <100528412+KlausMikhaelson@users.noreply.github.com> Co-authored-by: KlausMikhaelson Co-authored-by: Kolade Co-authored-by: Nilesh Gupta Co-authored-by: Mohammed S Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.2 * fix: dummy change * ci(uiweb): šŸŽ‰ cut release to uiweb-v1.1.13 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.16 * Join group option (#681) * feat: created architechture * fix: added context values (#594) * Chat dataprovider (#596) * feat: data provider for chat component * fix: replaced react.usestate to usestate * fix: added props as the initial state and changed state name * fix: reverted chat context changes and renamed values * fix: added test page for chat ui components (#597) * added chatbubble component (#602) * feat: added chatbubble component * fix: made the messageBubble's width to fit-content --------- Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * fix: added theme * Group chat bubble (#604) * feat: moved test component to testui folder & replaced dummy data with sdk response * feat: added twitter card and address for group chat received msg * feat: made the messageaddress reusable, added account from context * fix: removed unnecessary div and unused props and console logs * feat: adding pfp in text bubbles * fix: replaced hook with function and added pfp to messagebubble * fix: fixed image alignment * fix: changed border-radius of msg bubble and changed function name * fix: fixed theme and decryptedPrivateKey name (#616) * fix: fixed theme and decryptedPrivateKey name * fix: fixed bug * fix: fixed theme reviews * Message list (#615) * fix: message list comp * fix: message list comp * fix: added pagination * fix: added pagination * fix: pagination * fix: create useChatData hook * fix: fixed minor bug * fix: socket issues fixed * fix: added theme in msgbubble (#620) * fix: added theme in msgbubble * fix: fixed import --------- Co-authored-by: Monalisha Mishra * fix: exported the theme (#623) * fix: exported the theme * fix: fixed issues --------- Co-authored-by: Monalisha Mishra * Typebar component (#631) * feat: added typebar UI * feat: added functions to typebar * fix: added icon * fix: fixed theme issues --------- Co-authored-by: Monalisha Mishra * feat: added connectbutton * fix: fixed connectbtn ui and remove disconnect and fixed error on disconnect * fix: fixed create account getting called twice * Profile Header Component (#636) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * Message container (#635) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * fix: updated svg to react component * fix: changed svg to tsx component * fix: fixed review changes (#646) * fix: fixed review changes * fix: resolved issues --------- Co-authored-by: Nilesh Gupta * Profile Header -> Chat Profile fixes (#647) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * fix: notifs * fix: correct theme colors * fix: renaming profileHeader * fix: qa fixes * fix: loader * refactor: resolved issues * fix: edit types --------- Co-authored-by: Nilesh Gupta * fix: resolved package not added issue * Fix: modal issue in group info && alert remove members (#653) * fix: modal * fix: update changes * refactor: resolved issue --------- Co-authored-by: Nilesh Gupta * fix: QA fixes (#654) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * Connect btn revamp (#668) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container * feat: adding rainbowkit for btn * fix: fix issues * fix: addec onnect functionality * fix: connect button * fix: added hack for rainbowkit css --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * Typebar UI issue (#666) * fix: fixed typebar space not working and theme * fix: fixed gif and emoji --------- Co-authored-by: KlausMikhaelson * fix: fixed theme colours * fix: added theme for brb * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * fix: added filter hat * fix: merged with main * fix: fixed msg border * fix: fixed theme * fix: fixed fonts * fix: fixed bug * Access control (#672) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * fix: added minor fix --------- Co-authored-by: Monalisha Mishra * fix: fixed padding issues * fix(f): fixed build issues * fix: fix for chat status test * feat: added verification option to show only on token gated groups * fix: fixing group access control * Check rules access control (#678) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * 662 group access control v2 changes (#663) * fix: spaces access API * fix: custom endpoint doc impl * Update README.md * Update README.md * fix: review comments change * fix: read me update * Update README.md * Update README.md * fix: origin in user creation (#665) * fix: origin in user creation * Update README.md * fix: review comments * 662 group access control v2 changes (#677) * fix: spaces access API * fix: custom endpoint doc impl * Update README.md * Update README.md * fix: review comments change * fix: read me update * Update README.md * Update README.md * fix(spaces): broadcast changes and UX fixes (#674) * fix: fix UI grid view (#642) * fix: fix UI grid view * refactor: conditional added * fix: resolved muting/unmuting try catch error (#657) * fix(spaces): fix livepeer broadcast (#656) * fix(spaces): fix livepeer broadcast * fix(spaces): fix data shown for unjoined space & promote listener logic --------- Co-authored-by: Madhur Gupta * refactor(spaces): use local state instead of get from server while meta message fire (#676) --------- Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Nilesh Gupta * feat: added verification option to show only on token gated groups * fix: fixing group access control --------- Co-authored-by: Monalisha Mishra Co-authored-by: Mohammed S Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Nilesh Gupta * fix: fixed build * feat: added send request to join group * fix: fixed verification on send * fix: fixed verify access btn not showing after joining group * fix: fixed join group showing for members too * fix: fixed join group showing to members * 667 chat.send enhancement (#673) * fix: changes messageObj for meta and reaction message type * fix: enhance send fn * fix: fixed intent issues * 680 group rules cosmetic changes (#682) * fix: fixed guild condition * fix: add did validation * fix: fixed * fix: fixed minor issues * fix: fixe dissue * fix: fixed minor issues * fix: check for scroll * fix: fixed scrolling * fix: fixed theme * fix: fixed * fix: fixed * fix: fixed * fix: fixed issues * fix: fixed * feat: added toast in join group btn for pvt groups * fix: fixed blurr --------- Co-authored-by: Monalisha Mishra Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> Co-authored-by: Kolade Co-authored-by: Nilesh Gupta Co-authored-by: Mohammed S Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Aman Gupta * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.3 * Join group option (#687) * feat: created architechture * fix: added context values (#594) * Chat dataprovider (#596) * feat: data provider for chat component * fix: replaced react.usestate to usestate * fix: added props as the initial state and changed state name * fix: reverted chat context changes and renamed values * fix: added test page for chat ui components (#597) * added chatbubble component (#602) * feat: added chatbubble component * fix: made the messageBubble's width to fit-content --------- Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * fix: added theme * Group chat bubble (#604) * feat: moved test component to testui folder & replaced dummy data with sdk response * feat: added twitter card and address for group chat received msg * feat: made the messageaddress reusable, added account from context * fix: removed unnecessary div and unused props and console logs * feat: adding pfp in text bubbles * fix: replaced hook with function and added pfp to messagebubble * fix: fixed image alignment * fix: changed border-radius of msg bubble and changed function name * fix: fixed theme and decryptedPrivateKey name (#616) * fix: fixed theme and decryptedPrivateKey name * fix: fixed bug * fix: fixed theme reviews * Message list (#615) * fix: message list comp * fix: message list comp * fix: added pagination * fix: added pagination * fix: pagination * fix: create useChatData hook * fix: fixed minor bug * fix: socket issues fixed * fix: added theme in msgbubble (#620) * fix: added theme in msgbubble * fix: fixed import --------- Co-authored-by: Monalisha Mishra * fix: exported the theme (#623) * fix: exported the theme * fix: fixed issues --------- Co-authored-by: Monalisha Mishra * Typebar component (#631) * feat: added typebar UI * feat: added functions to typebar * fix: added icon * fix: fixed theme issues --------- Co-authored-by: Monalisha Mishra * feat: added connectbutton * fix: fixed connectbtn ui and remove disconnect and fixed error on disconnect * fix: fixed create account getting called twice * Profile Header Component (#636) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * Message container (#635) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * fix: updated svg to react component * fix: changed svg to tsx component * fix: fixed review changes (#646) * fix: fixed review changes * fix: resolved issues --------- Co-authored-by: Nilesh Gupta * Profile Header -> Chat Profile fixes (#647) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * fix: notifs * fix: correct theme colors * fix: renaming profileHeader * fix: qa fixes * fix: loader * refactor: resolved issues * fix: edit types --------- Co-authored-by: Nilesh Gupta * fix: resolved package not added issue * Fix: modal issue in group info && alert remove members (#653) * fix: modal * fix: update changes * refactor: resolved issue --------- Co-authored-by: Nilesh Gupta * fix: QA fixes (#654) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * Connect btn revamp (#668) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container * feat: adding rainbowkit for btn * fix: fix issues * fix: addec onnect functionality * fix: connect button * fix: added hack for rainbowkit css --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * Typebar UI issue (#666) * fix: fixed typebar space not working and theme * fix: fixed gif and emoji --------- Co-authored-by: KlausMikhaelson * fix: fixed theme colours * fix: added theme for brb * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * fix: added filter hat * fix: merged with main * fix: fixed msg border * fix: fixed theme * fix: fixed fonts * fix: fixed bug * Access control (#672) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * fix: added minor fix --------- Co-authored-by: Monalisha Mishra * fix: fixed padding issues * fix(f): fixed build issues * fix: fix for chat status test * feat: added verification option to show only on token gated groups * fix: fixing group access control * Check rules access control (#678) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * 662 group access control v2 changes (#663) * fix: spaces access API * fix: custom endpoint doc impl * Update README.md * Update README.md * fix: review comments change * fix: read me update * Update README.md * Update README.md * fix: origin in user creation (#665) * fix: origin in user creation * Update README.md * fix: review comments * 662 group access control v2 changes (#677) * fix: spaces access API * fix: custom endpoint doc impl * Update README.md * Update README.md * fix: review comments change * fix: read me update * Update README.md * Update README.md * fix(spaces): broadcast changes and UX fixes (#674) * fix: fix UI grid view (#642) * fix: fix UI grid view * refactor: conditional added * fix: resolved muting/unmuting try catch error (#657) * fix(spaces): fix livepeer broadcast (#656) * fix(spaces): fix livepeer broadcast * fix(spaces): fix data shown for unjoined space & promote listener logic --------- Co-authored-by: Madhur Gupta * refactor(spaces): use local state instead of get from server while meta message fire (#676) --------- Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Nilesh Gupta * feat: added verification option to show only on token gated groups * fix: fixing group access control --------- Co-authored-by: Monalisha Mishra Co-authored-by: Mohammed S Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Nilesh Gupta * fix: fixed build * feat: added send request to join group * fix: fixed verification on send * fix: fixed verify access btn not showing after joining group * fix: fixed join group showing for members too * fix: fixed join group showing to members * 667 chat.send enhancement (#673) * fix: changes messageObj for meta and reaction message type * fix: enhance send fn * fix: fixed intent issues * 680 group rules cosmetic changes (#682) * fix: fixed guild condition * fix: add did validation * fix: fixed * fix: fixed minor issues * fix: fixe dissue * fix: fixed minor issues * fix: check for scroll * fix: fixed scrolling * fix: fixed theme * fix: fixed * fix: fixed * fix: fixed * fix: fixed issues * fix: fixed * feat: added toast in join group btn for pvt groups * fix: fixed blurr * fix: fixed minor issues rules * fix: fixed * fix: fixed --------- Co-authored-by: Satyam <100528412+KlausMikhaelson@users.noreply.github.com> Co-authored-by: KlausMikhaelson Co-authored-by: Kolade Co-authored-by: Nilesh Gupta Co-authored-by: Mohammed S Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Aman Gupta * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.4 * Join group option (#688) * feat: created architechture * fix: added context values (#594) * Chat dataprovider (#596) * feat: data provider for chat component * fix: replaced react.usestate to usestate * fix: added props as the initial state and changed state name * fix: reverted chat context changes and renamed values * fix: added test page for chat ui components (#597) * added chatbubble component (#602) * feat: added chatbubble component * fix: made the messageBubble's width to fit-content --------- Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> * fix: added theme * Group chat bubble (#604) * feat: moved test component to testui folder & replaced dummy data with sdk response * feat: added twitter card and address for group chat received msg * feat: made the messageaddress reusable, added account from context * fix: removed unnecessary div and unused props and console logs * feat: adding pfp in text bubbles * fix: replaced hook with function and added pfp to messagebubble * fix: fixed image alignment * fix: changed border-radius of msg bubble and changed function name * fix: fixed theme and decryptedPrivateKey name (#616) * fix: fixed theme and decryptedPrivateKey name * fix: fixed bug * fix: fixed theme reviews * Message list (#615) * fix: message list comp * fix: message list comp * fix: added pagination * fix: added pagination * fix: pagination * fix: create useChatData hook * fix: fixed minor bug * fix: socket issues fixed * fix: added theme in msgbubble (#620) * fix: added theme in msgbubble * fix: fixed import --------- Co-authored-by: Monalisha Mishra * fix: exported the theme (#623) * fix: exported the theme * fix: fixed issues --------- Co-authored-by: Monalisha Mishra * Typebar component (#631) * feat: added typebar UI * feat: added functions to typebar * fix: added icon * fix: fixed theme issues --------- Co-authored-by: Monalisha Mishra * feat: added connectbutton * fix: fixed connectbtn ui and remove disconnect and fixed error on disconnect * fix: fixed create account getting called twice * Profile Header Component (#636) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * Message container (#635) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * fix: updated svg to react component * fix: changed svg to tsx component * fix: fixed review changes (#646) * fix: fixed review changes * fix: resolved issues --------- Co-authored-by: Nilesh Gupta * Profile Header -> Chat Profile fixes (#647) * feat: profile header * feat: update profile header * fix: update hooks * fix: video icon ui * feat: add group modal * fix: add modal info * fix: edit components * fix: commit modal theme * fix: updating UI * fix: ensname * fix: add notifs * fix: remove alerts * fix: remove alert logs * fix: push fixes * fix: conflicts * fix: notifs * fix: correct theme colors * fix: renaming profileHeader * fix: qa fixes * fix: loader * refactor: resolved issues * fix: edit types --------- Co-authored-by: Nilesh Gupta * fix: resolved package not added issue * Fix: modal issue in group info && alert remove members (#653) * fix: modal * fix: update changes * refactor: resolved issue --------- Co-authored-by: Nilesh Gupta * fix: QA fixes (#654) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * Connect btn revamp (#668) * fix: added theme in msgbubble * fix: fixed import * fix: fixed message-list * fix: added approve intent * fix: added fixes * fix: fixed socket bug * fix: fixed message from socket * fix: fixed minor issues * fix: fixed typebar theming * fix: fixed env issue * fix: fixed message not updating issue * refactor: added isConnected prop in msgContainer * refactor: resolve merge conflicts * fix: fixed request sending * fix: fixed decryption * fix: fixed env issue * feat: added profile header in message container * feat: adding rainbowkit for btn * fix: fix issues * fix: addec onnect functionality * fix: connect button * fix: added hack for rainbowkit css --------- Co-authored-by: KlausMikhaelson Co-authored-by: Nilesh Gupta * Typebar UI issue (#666) * fix: fixed typebar space not working and theme * fix: fixed gif and emoji --------- Co-authored-by: KlausMikhaelson * fix: fixed theme colours * fix: added theme for brb * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * fix: added filter hat * fix: merged with main * fix: fixed msg border * fix: fixed theme * fix: fixed fonts * fix: fixed bug * Access control (#672) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * fix: added minor fix --------- Co-authored-by: Monalisha Mishra * fix: fixed padding issues * fix(f): fixed build issues * fix: fix for chat status test * feat: added verification option to show only on token gated groups * fix: fixing group access control * Check rules access control (#678) * fix: fixed typebar space not working and theme * feat: created access control UI * feat: created verify access control hook * fix: fixed access control hook issue * feat: added access control verification * feat: added onclick props for integration team to pass function and fixed btn ui * fix: added link for learn more * fix: fixed msg not updating in socket issue * 662 group access control v2 changes (#663) * fix: spaces access API * fix: custom endpoint doc impl * Update README.md * Update README.md * fix: review comments change * fix: read me update * Update README.md * Update README.md * fix: origin in user creation (#665) * fix: origin in user creation * Update README.md * fix: review comments * 662 group access control v2 changes (#677) * fix: spaces access API * fix: custom endpoint doc impl * Update README.md * Update README.md * fix: review comments change * fix: read me update * Update README.md * Update README.md * fix(spaces): broadcast changes and UX fixes (#674) * fix: fix UI grid view (#642) * fix: fix UI grid view * refactor: conditional added * fix: resolved muting/unmuting try catch error (#657) * fix(spaces): fix livepeer broadcast (#656) * fix(spaces): fix livepeer broadcast * fix(spaces): fix data shown for unjoined space & promote listener logic --------- Co-authored-by: Madhur Gupta * refactor(spaces): use local state instead of get from server while meta message fire (#676) --------- Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Nilesh Gupta * feat: added verification option to show only on token gated groups * fix: fixing group access control --------- Co-authored-by: Monalisha Mishra Co-authored-by: Mohammed S Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Nilesh Gupta * fix: fixed build * feat: added send request to join group * fix: fixed verification on send * fix: fixed verify access btn not showing after joining group * fix: fixed join group showing for members too * fix: fixed join group showing to members * 667 chat.send enhancement (#673) * fix: changes messageObj for meta and reaction message type * fix: enhance send fn * fix: fixed intent issues * 680 group rules cosmetic changes (#682) * fix: fixed guild condition * fix: add did validation * fix: fixed * fix: fixed minor issues * fix: fixe dissue * fix: fixed minor issues * fix: check for scroll * fix: fixed scrolling * fix: fixed theme * fix: fixed * fix: fixed * fix: fixed * fix: fixed issues * fix: fixed * feat: added toast in join group btn for pvt groups * fix: fixed blurr * fix: fixed minor issues rules * fix: fixed * fix: fixed * fix: fixed socket issue * fix: fixed --------- Co-authored-by: Satyam <100528412+KlausMikhaelson@users.noreply.github.com> Co-authored-by: KlausMikhaelson Co-authored-by: Kolade Co-authored-by: Nilesh Gupta Co-authored-by: Mohammed S Co-authored-by: Madhur Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Aman Gupta * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.5 * fix: fixed (#689) * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.6 * chat Load issue fixed (#690) * fix: fixed * fix: fixed minor issues * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.7 * fix: fixed msg bubble width (#691) * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.8 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.17 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.18 * ci(restapi): šŸŽ‰ cut release to restapi-v1.4.19 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.33 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.33 * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.9 * Onboarding blocknative (#702) * fix: added reusable folder * fix: fixed theme for modal * fix: removed reusables from export * fix: fixed fallback for message input * feat: replaced rainbowkit with blocknative * fix: removed unused code --------- Co-authored-by: Monalisha Mishra * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.10 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.33 * Fix connect button issue (#710) * fix: fixed connect button blocknative * fix: fixed message fetching * fix: removed console * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.11 * fix: added condition while showing tokengatedIcon (#715) * fix: added disconnect for wallet (#721) * fix: added disconnect for wallet * fix: added autoConnect * Wallet disconnect (#722) * fix: added disconnect for wallet * fix: added autoConnect * fix: changed onClick to onGetTokenClick * Wallet disconnect (#723) * fix: added disconnect for wallet * fix: added autoConnect * fix: changed onClick to onGetTokenClick * fix: fixed errors * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.12 * Changed messageInput params Case (#725) * fix: added disconnect for wallet * fix: added autoConnect * fix: changed onClick to onGetTokenClick * fix: fixed errors * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.13 * Wallet disconnect (#728) * fix: added disconnect for wallet * fix: added autoConnect * fix: changed onClick to onGetTokenClick * fix: fixed errors * fix: added coinbase wallet * fix: img added * fix: fixed metamask not showing if not present in it --------- Co-authored-by: KlausMikhaelson * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.14 * Wallet disconnect (#732) * fix: added disconnect for wallet * fix: added autoConnect * fix: changed onClick to onGetTokenClick * fix: fixed errors * fix: added coinbase wallet * fix: img added * fix: fixed metamask not showing if not present in it * fix: fixed injected wallets --------- Co-authored-by: KlausMikhaelson * ci(uiweb): šŸŽ‰ cut beta release to uiweb-v0.0.1-alpha.15 * fix: added class based implementation for notification (#699) * fix: added class based implementation for notification * fix: class based implementation for notification * fix: small fixes * fix: minor fixes and testcases * fix: fixes for testcases * fix: updated core abi and minor fixes * fix: removed comment * fix: minor fixes and additional checks * fix: minor fixes * fix: viem support for contract and new folder structure * fix: changed typescript 5.0.2 and configured eslint * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.34 * 720 pushstream class implementation (#729) * chore: added an example of automated chat using the new class based initialization * fix: fixed usecases * chore: added an example of automated chat using the new class based iā€¦ (#712) * chore: added an example of automated chat using the new class based initialization * fix: fixed usecases --------- Co-authored-by: aman035 * chore(automated chat example): tweaked automated chat example * fix: stream changes * fix: stream changes * fix: added chat.decrypt (#726) * fix: added chat.decrypt * fix: fix examples * fix: stream changes * fix: PUSH Stream Changes * fix: chat classes split * fix: Notification socket initialisations and rules backward compatibility * fix: added message decrypt * fix: review comments * fix: socket events * fix: test case fix and UserInfo to user * fix: rip PushNotification class * fix: additional check --------- Co-authored-by: harshrajat Co-authored-by: aman035 Co-authored-by: Harsh | Push Co-authored-by: akp111 * fix: remove only from test * fix: error fixed * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.35 * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.35 * fix: stream cases * 720 pushstream class implementation (#737) * fix: stream changes * fix: stream changes * fix: stream changes * fix: PUSH Stream Changes * fix: chat classes split * fix: Notification socket initialisations and rules backward compatibility * fix: added message decrypt * fix: review comments * fix: socket events * fix: test case fix and UserInfo to user * fix: rip PushNotification class * fix: additional check * fix: minor fixes --------- Co-authored-by: Mohammed S * fix: corrected example * fix: some changes on stream * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.36 * fix: minor fixes * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.37 * fix: error handling in socket events * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.38 * fix: more fixes * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.39 * fix: minor fixes * fix: socket enabled * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.40 * fix: minor fixes * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.41 * Add counter for update channel (#740) * fix: added counter to update group * fix: added counter logic, moved delegate and alias function to channel class * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.42 * Add counter for update channel (#741) * fix: added counter to update group * fix: added counter logic, moved delegate and alias function to channel class * fix: added readme for notification * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.43 * fix: minor fix * fix: log removed * ci(restapi): šŸŽ‰ cut beta release to restapi-v0.0.1-alpha.44 * docs: fix tests * Feat/space backup (#746) * refactor: added code for joining livekit room for listeners (#731) * feat: drop in livekit inplace of livepeer (#736) * feat: drop in livekit inplace of livepeer * feat: added microphone * feat: added mic * feat: added access control --------- Co-authored-by: Nilesh Gupta * fix: Notification event mutation --------- Co-authored-by: aman035 Co-authored-by: Madhur Gupta Co-authored-by: Nilesh Gupta Co-authored-by: Arnab Chatterjee <60937304+arn4b@users.noreply.github.com> Co-authored-by: Samarendra Gouda <134079446+samarendra-push@users.noreply.github.com> Co-authored-by: Samarendra Gouda Co-authored-by: samarendra-push Co-authored-by: Monalisha Mishra Co-authored-by: Monalisha Mishra <42746736+mishramonalisha76@users.noreply.github.com> Co-authored-by: Satyam <100528412+KlausMikhaelson@users.noreply.github.com> Co-authored-by: KlausMikhaelson Co-authored-by: Kolade Co-authored-by: Ashis Kumar Pradhan <38760485+akp111@users.noreply.github.com> Co-authored-by: akp111 Co-authored-by: harshrajat Co-authored-by: Harsh | Push --- .eslintrc.json | 6 +- package.json | 2 +- .../sdk-backend-node/package-lock.json | 5600 +++++++++++++++++ .../src/app/ChatTest/ChatTest.tsx | 3 + .../src/app/ChatTest/CreateGroupTest.tsx | 21 +- .../app/ChatTest/GetGroupMemberStatusTest.tsx | 86 + .../src/app/ChatUITest/ChatUITest.tsx | 1 + .../src/app/ChatUITest/ChatViewBubble.tsx | 2 +- .../src/app/ChatUITest/ChatViewComponent.tsx | 23 +- .../src/app/ChatUITest/ChatViewListTest.tsx | 23 +- .../sdk-frontend-react/src/app/app.tsx | 13 +- .../src/app/components/Connect.tsx | 4 +- .../examples/sdk-frontend/pages/index.tsx | 4 +- .../examples/sdk-frontend/pages/video.tsx | 2 +- packages/restapi/CHANGELOG.md | 516 +- packages/restapi/PushChatLowLevelAPI.md | 30 +- packages/restapi/README.md | 340 +- packages/restapi/package-lock.json | 3673 ++++++++++- packages/restapi/package.json | 3 +- packages/restapi/project.json | 2 +- packages/restapi/src/lib/abis/comm.ts | 520 ++ packages/restapi/src/lib/abis/core.ts | 957 +++ packages/restapi/src/lib/abis/token.ts | 709 +++ .../src/lib/chat/getGroupMemberStatus.ts | 54 + .../src/lib/chat/helpers/payloadHelper.ts | 12 +- packages/restapi/src/lib/chat/index.ts | 1 + .../restapi/src/lib/chat/rejectRequest.ts | 2 +- packages/restapi/src/lib/config.ts | 231 +- packages/restapi/src/lib/index.ts | 1 - packages/restapi/src/lib/progressHook.ts | 62 + .../pushNotification/PushNotificationTypes.ts | 104 + .../restapi/src/lib/pushNotification/alias.ts | 25 + .../src/lib/pushNotification/channel.ts | 431 ++ .../src/lib/pushNotification/delegate.ts | 112 + .../src/lib/pushNotification/notification.ts | 205 + .../pushNotification/pushNotificationBase.ts | 684 ++ packages/restapi/src/lib/pushapi/PushAPI.ts | 691 +- packages/restapi/src/lib/pushapi/chat.ts | 450 ++ .../restapi/src/lib/pushapi/encryption.ts | 67 + packages/restapi/src/lib/pushapi/profile.ts | 36 + .../restapi/src/lib/pushapi/pushAPITypes.ts | 11 +- packages/restapi/src/lib/pushapi/user.ts | 13 + .../src/lib/pushstream/DataModifier.ts | 379 ++ .../restapi/src/lib/pushstream/PushStream.ts | 280 + .../src/lib/pushstream/pushStreamTypes.ts | 233 + .../src/lib/space/acceptPromotionRequest.ts | 20 +- packages/restapi/src/lib/space/start.ts | 217 +- packages/restapi/src/lib/types/index.ts | 37 +- .../src/lib/user/getFeedsPerChannel.ts | 57 + packages/restapi/src/lib/user/index.ts | 2 + .../tests/lib/chat/updateGroup.test.ts | 1 - .../tests/lib/pushNotification/alias.test.ts | 53 + .../lib/pushNotification/channel.test.ts | 298 + .../lib/pushNotification/delegate.test.ts | 180 + .../lib/pushNotification/notification.test.ts | 249 + .../lib/pushNotification/onchain.test.ts | 115 + .../tests/lib/pushNotification/tokenABI.ts | 709 +++ .../tests/lib/pushstream/initialize.test.ts | 369 ++ packages/restapi/yarn.lock | 356 +- packages/uiweb/CHANGELOG.md | 272 +- packages/uiweb/README.md | 1 + packages/uiweb/package.json | 14 +- .../chat/ChatProfile/AddWalletContent.tsx | 6 +- .../chat/ChatProfile/ChatProfile.tsx | 144 +- .../chat/ChatProfile/GroupInfoModal.tsx | 12 +- .../chat/ChatProfile/ProfileCard.tsx | 2 +- .../chat/ChatViewBubble/ChatViewBubble.tsx | 631 +- .../ChatViewComponent/ChatViewComponent.tsx | 88 +- .../ChatViewList/ApproveRequestBubble.tsx | 30 +- .../chat/ChatViewList/ChatViewList.tsx | 359 +- .../chat/ChatViewList/MessageEncryption.tsx | 21 +- .../chat/ConnectButton/ConnectButton.tsx | 291 +- .../components/chat/ConnectButton/index.ts | 1 - .../components/chat/ConnectButton/index.tsx | 109 + .../chat/MessageInput/MessageInput.tsx | 997 ++- .../chat/MessageInput/VerificationFailed.tsx | 107 + .../chat/ProfileHeader/AddWalletContent.tsx | 354 ++ .../src/lib/components/chat/exportedTypes.ts | 13 +- .../src/lib/components/chat/helpers/Modal.tsx | 6 +- .../lib/components/chat/helpers/NewToast.tsx | 4 +- .../src/lib/components/chat/helpers/index.ts | 6 +- .../chat/reusables/ChatSearchInput.tsx | 189 + .../lib/components/chat/reusables/index.ts | 1 + .../src/lib/components/chat/theme/index.ts | 351 +- .../space/SpaceWidget/LiveWidgetContent.tsx | 180 +- .../space/SpaceWidget/Microphone.tsx | 45 + .../SpaceWidget/ScheduledWidgetContent.tsx | 41 +- .../space/SpaceWidget/WidgetContent.tsx | 1 + packages/uiweb/src/lib/config/constants.ts | 12 +- packages/uiweb/src/lib/context/chatContext.ts | 8 +- .../lib/dataProviders/ChatDataProvider.tsx | 46 +- packages/uiweb/src/lib/helpers/address.ts | 19 +- packages/uiweb/src/lib/helpers/chat/chat.ts | 181 +- .../src/lib/helpers/chat/localStorage.ts | 9 + packages/uiweb/src/lib/hooks/chat/index.ts | 2 - .../lib/hooks/chat/useApproveChatRequest.ts | 10 +- .../uiweb/src/lib/hooks/chat/useFetchChat.ts | 5 +- .../hooks/chat/useFetchConversationHash.ts | 2 +- .../lib/hooks/chat/useFetchHistoryMessages.ts | 2 +- .../src/lib/hooks/chat/usePushChatSocket.ts | 45 +- .../src/lib/hooks/chat/usePushSendMessage.ts | 10 +- .../lib/hooks/chat/useVerifyAccessControl.ts | 65 + packages/uiweb/src/lib/hooks/index.ts | 3 +- .../chat/helpers => hooks}/useMediaQuery.ts | 0 packages/uiweb/src/lib/icons/ArrowLeft.svg | 4 - packages/uiweb/src/lib/icons/Emoji.tsx | 4 +- packages/uiweb/src/lib/icons/MoreLight.tsx | 12 +- packages/uiweb/src/lib/icons/OpenLink.tsx | 16 + .../src/lib/services/getLivekitRoomToken.ts | 25 + packages/uiweb/src/lib/services/index.ts | 2 + .../uiweb/src/lib/services/performAction.ts | 15 + packages/uiweb/src/lib/types/index.ts | 6 +- packages/uiweb/yarn.lock | 3409 +++++++++- yarn.lock | 10 +- 114 files changed, 25096 insertions(+), 2389 deletions(-) create mode 100644 packages/examples/sdk-backend-node/package-lock.json create mode 100644 packages/examples/sdk-frontend-react/src/app/ChatTest/GetGroupMemberStatusTest.tsx create mode 100644 packages/restapi/src/lib/abis/comm.ts create mode 100644 packages/restapi/src/lib/abis/core.ts create mode 100644 packages/restapi/src/lib/abis/token.ts create mode 100644 packages/restapi/src/lib/chat/getGroupMemberStatus.ts create mode 100644 packages/restapi/src/lib/pushNotification/PushNotificationTypes.ts create mode 100644 packages/restapi/src/lib/pushNotification/alias.ts create mode 100644 packages/restapi/src/lib/pushNotification/channel.ts create mode 100644 packages/restapi/src/lib/pushNotification/delegate.ts create mode 100644 packages/restapi/src/lib/pushNotification/notification.ts create mode 100644 packages/restapi/src/lib/pushNotification/pushNotificationBase.ts create mode 100644 packages/restapi/src/lib/pushapi/chat.ts create mode 100644 packages/restapi/src/lib/pushapi/encryption.ts create mode 100644 packages/restapi/src/lib/pushapi/profile.ts create mode 100644 packages/restapi/src/lib/pushapi/user.ts create mode 100644 packages/restapi/src/lib/pushstream/DataModifier.ts create mode 100644 packages/restapi/src/lib/pushstream/PushStream.ts create mode 100644 packages/restapi/src/lib/pushstream/pushStreamTypes.ts create mode 100644 packages/restapi/src/lib/user/getFeedsPerChannel.ts create mode 100644 packages/restapi/tests/lib/pushNotification/alias.test.ts create mode 100644 packages/restapi/tests/lib/pushNotification/channel.test.ts create mode 100644 packages/restapi/tests/lib/pushNotification/delegate.test.ts create mode 100644 packages/restapi/tests/lib/pushNotification/notification.test.ts create mode 100644 packages/restapi/tests/lib/pushNotification/onchain.test.ts create mode 100644 packages/restapi/tests/lib/pushNotification/tokenABI.ts create mode 100644 packages/restapi/tests/lib/pushstream/initialize.test.ts delete mode 100644 packages/uiweb/src/lib/components/chat/ConnectButton/index.ts create mode 100644 packages/uiweb/src/lib/components/chat/ConnectButton/index.tsx create mode 100644 packages/uiweb/src/lib/components/chat/MessageInput/VerificationFailed.tsx create mode 100644 packages/uiweb/src/lib/components/chat/ProfileHeader/AddWalletContent.tsx create mode 100644 packages/uiweb/src/lib/components/chat/reusables/ChatSearchInput.tsx create mode 100644 packages/uiweb/src/lib/components/chat/reusables/index.ts create mode 100644 packages/uiweb/src/lib/components/space/SpaceWidget/Microphone.tsx create mode 100644 packages/uiweb/src/lib/hooks/chat/useVerifyAccessControl.ts rename packages/uiweb/src/lib/{components/chat/helpers => hooks}/useMediaQuery.ts (100%) delete mode 100644 packages/uiweb/src/lib/icons/ArrowLeft.svg create mode 100644 packages/uiweb/src/lib/icons/OpenLink.tsx create mode 100644 packages/uiweb/src/lib/services/getLivekitRoomToken.ts create mode 100644 packages/uiweb/src/lib/services/index.ts create mode 100644 packages/uiweb/src/lib/services/performAction.ts diff --git a/.eslintrc.json b/.eslintrc.json index 06cc47d9a..2f936c714 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -24,7 +24,11 @@ { "files": ["*.ts", "*.tsx"], "extends": ["plugin:@nrwl/nx/typescript"], - "rules": {} + "rules": { + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-explicit-any": "off" + } }, { "files": ["*.js", "*.jsx"], diff --git a/package.json b/package.json index 49514fb87..c6d4e222a 100644 --- a/package.json +++ b/package.json @@ -120,6 +120,6 @@ "react-test-renderer": "17.0.2", "ts-jest": "27.1.4", "ts-node": "9.1.1", - "typescript": "~4.6.2" + "typescript": "5.0.2" } } diff --git a/packages/examples/sdk-backend-node/package-lock.json b/packages/examples/sdk-backend-node/package-lock.json new file mode 100644 index 000000000..d1b261a12 --- /dev/null +++ b/packages/examples/sdk-backend-node/package-lock.json @@ -0,0 +1,5600 @@ +{ + "name": "sdk-backend-node", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "sdk-backend-node", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@pushprotocol/restapi": "^1.4.17", + "@pushprotocol/socket": "^0.5.2" + } + }, + "node_modules/@ambire/signature-validator": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@ambire/signature-validator/-/signature-validator-1.3.1.tgz", + "integrity": "sha512-kR6Se3nhAGf1VMeun7V2Lml9KRXB5oz64vO2zGSg+dNaGq4BPDEjsNdr0PIKXZ8651sDlRCN7V9SzL5E2ddBYQ==", + "dependencies": { + "ethers": "^5.6.5", + "tap-spec": "^5.0.0", + "tape": "^5.5.3" + } + }, + "node_modules/@ethereumjs/rlp": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", + "integrity": "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==", + "bin": { + "rlp": "bin/rlp" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@ethereumjs/util": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", + "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", + "dependencies": { + "@ethereumjs/rlp": "^4.0.1", + "ethereum-cryptography": "^2.0.0", + "micro-ftch": "^0.3.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@ethersproject/abi": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", + "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/abstract-provider": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", + "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0" + } + }, + "node_modules/@ethersproject/abstract-signer": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", + "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "node_modules/@ethersproject/address": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", + "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/rlp": "^5.7.0" + } + }, + "node_modules/@ethersproject/base64": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", + "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0" + } + }, + "node_modules/@ethersproject/basex": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", + "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "node_modules/@ethersproject/bignumber": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", + "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "bn.js": "^5.2.1" + } + }, + "node_modules/@ethersproject/bignumber/node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + }, + "node_modules/@ethersproject/bytes": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", + "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/constants": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", + "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0" + } + }, + "node_modules/@ethersproject/contracts": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", + "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0" + } + }, + "node_modules/@ethersproject/hash": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/hdnode": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", + "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "node_modules/@ethersproject/json-wallets": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", + "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "aes-js": "3.0.0", + "scrypt-js": "3.0.1" + } + }, + "node_modules/@ethersproject/keccak256": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", + "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "js-sha3": "0.8.0" + } + }, + "node_modules/@ethersproject/logger": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", + "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ] + }, + "node_modules/@ethersproject/networks": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", + "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/pbkdf2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", + "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/sha2": "^5.7.0" + } + }, + "node_modules/@ethersproject/properties": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", + "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/providers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", + "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0", + "bech32": "1.1.4", + "ws": "7.4.6" + } + }, + "node_modules/@ethersproject/random": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", + "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/rlp": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", + "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/sha2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", + "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "hash.js": "1.1.7" + } + }, + "node_modules/@ethersproject/signing-key": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", + "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "bn.js": "^5.2.1", + "elliptic": "6.5.4", + "hash.js": "1.1.7" + } + }, + "node_modules/@ethersproject/signing-key/node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + }, + "node_modules/@ethersproject/solidity": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", + "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/strings": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", + "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/transactions": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", + "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0" + } + }, + "node_modules/@ethersproject/units": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", + "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/wallet": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", + "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/json-wallets": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "node_modules/@ethersproject/web": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", + "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/wordlists": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", + "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@hapi/hoek": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", + "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==" + }, + "node_modules/@hapi/topo": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", + "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "node_modules/@livepeer/core": { + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/@livepeer/core/-/core-1.8.6.tgz", + "integrity": "sha512-VWMHaHMzNCr8YuC9hD87Ju+fwnpldEoe3y9CqOXrQPyyIgiAWfraZBA6Ard67f09X9UBGaaRcAMgMcCUs9HtKA==", + "dependencies": { + "cross-fetch": "^4.0.0", + "ms": "^3.0.0-canary.1", + "multiformats": "9.9.0", + "tus-js-client": "^3.1.0", + "zustand": "^4.3.9" + }, + "peerDependencies": { + "react": ">=17.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + } + } + }, + "node_modules/@ljharb/resumer": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@ljharb/resumer/-/resumer-0.0.1.tgz", + "integrity": "sha512-skQiAOrCfO7vRTq53cxznMpks7wS1va95UCidALlOVWqvBAzwPVErwizDwoMqNVMEn1mDq0utxZd02eIrvF1lw==", + "dependencies": { + "@ljharb/through": "^2.3.9" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/@ljharb/through": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.9.tgz", + "integrity": "sha512-yN599ZBuMPPK4tdoToLlvgJB4CLK8fGl7ntfy0Wn7U6ttNvHYurd81bfUiK/6sMkiIwm65R6ck4L6+Y3DfVbNQ==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/@metamask/eth-sig-util": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-5.1.0.tgz", + "integrity": "sha512-mlgziIHYlA9pi/XZerChqg4NocdOgBPB9NmxgXWQO2U2hH8RGOJQrz6j/AIKkYxgCMIE2PY000+joOwXfzeTDQ==", + "dependencies": { + "@ethereumjs/util": "^8.0.6", + "bn.js": "^4.12.0", + "ethereum-cryptography": "^2.0.0", + "ethjs-util": "^0.1.6", + "tweetnacl": "^1.0.3", + "tweetnacl-util": "^0.15.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@noble/curves": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz", + "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==", + "dependencies": { + "@noble/hashes": "1.3.1" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", + "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@pushprotocol/restapi": { + "version": "1.4.19", + "resolved": "https://registry.npmjs.org/@pushprotocol/restapi/-/restapi-1.4.19.tgz", + "integrity": "sha512-MGeYMX0NB2/sPSOnyvERZL2jKqeBPE6nUgySecEvW/JaUW8DsAX7KSN5IU4xvF9KpQblbUDcdXq4iW55/oZqOA==", + "dependencies": { + "@ambire/signature-validator": "^1.3.1", + "@metamask/eth-sig-util": "^5.0.2", + "axios": "^0.27.2", + "buffer": "^6.0.3", + "crypto-js": "^4.1.1", + "immer": "^10.0.2", + "joi": "^17.9.2", + "livepeer": "^2.5.8", + "openpgp": "^5.5.0", + "simple-peer": "^9.11.1", + "tslib": "^2.3.0", + "unique-names-generator": "^4.7.1", + "uuid": "^9.0.0", + "video-stream-merger": "^4.0.1" + }, + "peerDependencies": { + "ethers": "^5.6.8" + } + }, + "node_modules/@pushprotocol/socket": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@pushprotocol/socket/-/socket-0.5.2.tgz", + "integrity": "sha512-lVGMT3q8T5by6qwAhQ+zIeE/yv7oUC9eIlFux8M7WaKu/ArLBrrojD5REbr9QXXwpJIP3Q8GJUKyClZl4uGsJw==", + "dependencies": { + "socket.io-client": "^4.5.2", + "tslib": "^2.3.0" + }, + "peerDependencies": { + "ethers": "^5.6.8" + } + }, + "node_modules/@scure/base": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.3.tgz", + "integrity": "sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip32": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.1.tgz", + "integrity": "sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A==", + "dependencies": { + "@noble/curves": "~1.1.0", + "@noble/hashes": "~1.3.1", + "@scure/base": "~1.1.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip39": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz", + "integrity": "sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==", + "dependencies": { + "@noble/hashes": "~1.3.0", + "@scure/base": "~1.1.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@sideway/address": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz", + "integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==", + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "node_modules/@sideway/formula": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", + "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==" + }, + "node_modules/@sideway/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==" + }, + "node_modules/@socket.io/component-emitter": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", + "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==" + }, + "node_modules/@stitches/core": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@stitches/core/-/core-1.2.8.tgz", + "integrity": "sha512-Gfkvwk9o9kE9r9XNBmJRfV8zONvXThnm1tcuojL04Uy5uRyqg93DC83lDebl0rocZCfKSjUv+fWYtMQmEDJldg==" + }, + "node_modules/aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==" + }, + "node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dependencies": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.every": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.5.tgz", + "integrity": "sha512-FfMQJ+/joFGXpRCltbzV3znaP5QxIhLFySo0fEPn3GuoYlud9LhknMCIxdYKC2qsM/6VHoSp6YGwe3EZXrEcwQ==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", + "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "dependencies": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "dependencies": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" + }, + "node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, + "node_modules/buffer-shims": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "integrity": "sha512-Zy8ZXMyxIT6RMTeY7OP/bDndfj6bwCan7SS98CEndS6deHwWPpseeHlwarNcBim+etXnF9HBc1non5JgDaJU1g==" + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/combine-errors": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/combine-errors/-/combine-errors-3.0.3.tgz", + "integrity": "sha512-C8ikRNRMygCwaTx+Ek3Yr+OuZzgZjduCOfSQBjbM8V3MfgcjSTeto/GXP6PAwKvJz/v15b7GHZvx5rOlczFw/Q==", + "dependencies": { + "custom-error-instance": "2.1.1", + "lodash.uniqby": "4.5.0" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/core-js": { + "version": "3.32.2", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.32.2.tgz", + "integrity": "sha512-pxXSw1mYZPDGvTQqEc5vgIb83jGQKFGYWY76z4a7weZXUolw3G+OvpZqSRcfYOoOVUQJYEPsWeQK8pKEnUtWxQ==", + "hasInstallScript": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, + "node_modules/crypto-js": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz", + "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==" + }, + "node_modules/custom-error-instance": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/custom-error-instance/-/custom-error-instance-2.1.1.tgz", + "integrity": "sha512-p6JFxJc3M4OTD2li2qaHkDCw9SfMw82Ldr6OC9Je1aXiGfhx2W8p3GaoeaGrPJTUN9NirTM/KTxHWMUdR1rsUg==" + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/deep-equal": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.2.tgz", + "integrity": "sha512-xjVyBf0w5vH0I42jdAZzOKVldmPgSulmiyPRywoyq7HXC9qdgo17kxJE+rdnif5Tz6+pIrpJI8dCpMNLIGkUiA==", + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "es-get-iterator": "^1.1.3", + "get-intrinsic": "^1.2.1", + "is-arguments": "^1.1.1", + "is-array-buffer": "^3.0.2", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "isarray": "^2.0.5", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.0", + "side-channel": "^1.0.4", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-data-property": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz", + "integrity": "sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==", + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/defined": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", + "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/dotignore": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/dotignore/-/dotignore-0.1.2.tgz", + "integrity": "sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==", + "dependencies": { + "minimatch": "^3.0.4" + }, + "bin": { + "ignored": "bin/ignored" + } + }, + "node_modules/duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==" + }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/engine.io-client": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.5.2.tgz", + "integrity": "sha512-CQZqbrpEYnrpGqC07a9dJDz4gePZUgTPMU3NKJPSeQOyw27Tst4Pl3FemKoFGAlHzgZmKjoRmiJvbWfhCXUlIg==", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.11.0", + "xmlhttprequest-ssl": "~2.0.0" + } + }, + "node_modules/engine.io-client/node_modules/ws": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", + "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/engine.io-parser": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.1.tgz", + "integrity": "sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/err-code": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", + "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + }, + "node_modules/es-abstract": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.2.tgz", + "integrity": "sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA==", + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.2", + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.1", + "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.12", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.1", + "safe-array-concat": "^1.0.1", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.11" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-get-iterator": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", + "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "has-symbols": "^1.0.3", + "is-arguments": "^1.1.1", + "is-map": "^2.0.2", + "is-set": "^2.0.2", + "is-string": "^1.0.7", + "isarray": "^2.0.5", + "stop-iteration-iterator": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dependencies": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/ethereum-cryptography": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz", + "integrity": "sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug==", + "dependencies": { + "@noble/curves": "1.1.0", + "@noble/hashes": "1.3.1", + "@scure/bip32": "1.3.1", + "@scure/bip39": "1.2.1" + } + }, + "node_modules/ethers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", + "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" + } + }, + "node_modules/ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "dependencies": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha512-UxKlfCRuCBxSXU4C6t9scbDyWZ4VlaFFdojKtzJuSkuOBQ5CNFum+zZXFwHjo+CxBC1t6zlYPgHIgFjL8ggoEQ==", + "dependencies": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-browser-rtc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-browser-rtc/-/get-browser-rtc-1.1.0.tgz", + "integrity": "sha512-MghbMJ61EJrRsDe7w1Bvqt3ZsBuqhce5nrn/XAwgwOXhcsz53/ltdxOse1h/8eKXj5slzxdsz56g5rzOFSGwfQ==" + }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-dynamic-import": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-dynamic-import/-/has-dynamic-import-2.0.1.tgz", + "integrity": "sha512-X3fbtsZmwb6W7fJGR9o7x65fZoodygCrZ3TVycvghP62yYQfS0t4RS0Qcz+j5tQYUKeSWS09tHkWW6WhFV3XhQ==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hls.js": { + "version": "1.4.12", + "resolved": "https://registry.npmjs.org/hls.js/-/hls.js-1.4.12.tgz", + "integrity": "sha512-1RBpx2VihibzE3WE9kGoVCtrhhDWTzydzElk/kyRbEOLnb1WIE+3ZabM/L8BqKFTCL3pUy4QzhXgD1Q6Igr1JA==" + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/immer": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/immer/-/immer-10.0.2.tgz", + "integrity": "sha512-Rx3CqeqQ19sxUtYV9CU911Vhy8/721wRFnJv3REVGWUmoAcIwzifTsdmJte/MV+0/XpM35LZdQMBGkRIoLPwQA==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/immer" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/internal-slot": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", + "dependencies": { + "get-intrinsic": "^1.2.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/is-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", + "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", + "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "dependencies": { + "which-typed-array": "^1.1.11" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", + "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" + }, + "node_modules/joi": { + "version": "17.10.2", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.10.2.tgz", + "integrity": "sha512-hcVhjBxRNW/is3nNLdGLIjkgXetkeGc2wyhydhz8KumG23Aerk4HPjU5zaPAMRqXQFc0xNqXTC7+zQjxr0GlKA==", + "dependencies": { + "@hapi/hoek": "^9.0.0", + "@hapi/topo": "^5.0.0", + "@sideway/address": "^4.1.3", + "@sideway/formula": "^3.0.1", + "@sideway/pinpoint": "^2.0.0" + } + }, + "node_modules/js-base64": { + "version": "3.7.5", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.5.tgz", + "integrity": "sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA==" + }, + "node_modules/js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "peer": true + }, + "node_modules/livepeer": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/livepeer/-/livepeer-2.8.6.tgz", + "integrity": "sha512-8K2lRtpgZKbv6l6cGYYMJW9qpdRKkGUuy7R7xTLkS6NaRQzaeW08vubftmbMHil8v8GX/nDmodcW2vA4oIkP0w==", + "dependencies": { + "@livepeer/core": "^1.8.6", + "@stitches/core": "^1.2.8", + "core-js": "^3.31.1", + "cross-fetch": "^4.0.0", + "hls.js": "^1.4.9", + "ms": "^3.0.0-canary.1", + "tus-js-client": "^3.1.0", + "zustand": "^4.3.9" + }, + "peerDependencies": { + "react": ">=17.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + } + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash._baseiteratee": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash._baseiteratee/-/lodash._baseiteratee-4.7.0.tgz", + "integrity": "sha512-nqB9M+wITz0BX/Q2xg6fQ8mLkyfF7MU7eE+MNBNjTHFKeKaZAPEzEg+E8LWxKWf1DQVflNEn9N49yAuqKh2mWQ==", + "dependencies": { + "lodash._stringtopath": "~4.8.0" + } + }, + "node_modules/lodash._basetostring": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz", + "integrity": "sha512-SwcRIbyxnN6CFEEK4K1y+zuApvWdpQdBHM/swxP962s8HIxPO3alBH5t3m/dl+f4CMUug6sJb7Pww8d13/9WSw==" + }, + "node_modules/lodash._baseuniq": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz", + "integrity": "sha512-Ja1YevpHZctlI5beLA7oc5KNDhGcPixFhcqSiORHNsp/1QTv7amAXzw+gu4YOvErqVlMVyIJGgtzeepCnnur0A==", + "dependencies": { + "lodash._createset": "~4.0.0", + "lodash._root": "~3.0.0" + } + }, + "node_modules/lodash._createset": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/lodash._createset/-/lodash._createset-4.0.3.tgz", + "integrity": "sha512-GTkC6YMprrJZCYU3zcqZj+jkXkrXzq3IPBcF/fIPpNEAB4hZEtXU8zp/RwKOvZl43NUmwDbyRk3+ZTbeRdEBXA==" + }, + "node_modules/lodash._root": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", + "integrity": "sha512-O0pWuFSK6x4EXhM1dhZ8gchNtG7JMqBtrHdoUFUWXD7dJnNSUze1GuyQr5sOs0aCvgGeI3o/OJW8f4ca7FDxmQ==" + }, + "node_modules/lodash._stringtopath": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/lodash._stringtopath/-/lodash._stringtopath-4.8.0.tgz", + "integrity": "sha512-SXL66C731p0xPDC5LZg4wI5H+dJo/EO4KTqOMwLYCH3+FmmfAKJEZCm6ohGpI+T1xwsDsJCfL4OnhorllvlTPQ==", + "dependencies": { + "lodash._basetostring": "~4.12.0" + } + }, + "node_modules/lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==" + }, + "node_modules/lodash.uniqby": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.5.0.tgz", + "integrity": "sha512-IRt7cfTtHy6f1aRVA5n7kT8rgN3N1nH6MOWLcHfpWG2SH19E3JksLK38MktLxZDhlAjCP9jpIXkOnRXlu6oByQ==", + "dependencies": { + "lodash._baseiteratee": "~4.7.0", + "lodash._baseuniq": "~4.6.0" + } + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "peer": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/micro-ftch": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/micro-ftch/-/micro-ftch-0.3.1.tgz", + "integrity": "sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==" + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ms": { + "version": "3.0.0-canary.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-3.0.0-canary.1.tgz", + "integrity": "sha512-kh8ARjh8rMN7Du2igDRO9QJnqCb2xYTJxyQYK7vJJS4TvLLmsbyhiKpSW+t+y26gyOyMd0riphX0GeWKU3ky5g==", + "engines": { + "node": ">=12.13" + } + }, + "node_modules/multiformats": { + "version": "9.9.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", + "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==" + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/openpgp": { + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/openpgp/-/openpgp-5.10.2.tgz", + "integrity": "sha512-nRqMp4o31rBagWB02tgfKCsocXWq4uYobZf9GDVlD5rQXBq/wRIZHiDhGX1dlDAI2inkZcPd2dSZOqmtGnsK1A==", + "dependencies": { + "asn1.js": "^5.0.0" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/parse-ms": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", + "integrity": "sha512-LpH1Cf5EYuVjkBvCDBYvkUPh+iv2bk3FHflxHkpCYT0/FZ1d3N3uJaLiHr4yGuMcFUhv6eAivitTvWZI4B/chg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "node_modules/plur": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/plur/-/plur-1.0.0.tgz", + "integrity": "sha512-qSnKBSZeDY8ApxwhfVIwKwF36KVJqb1/9nzYYq3j3vdwocULCXT8f8fQGkiw1Nk9BGfxiDagEe/pwakA+bOBqw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pretty-ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-2.1.0.tgz", + "integrity": "sha512-H2enpsxzDhuzRl3zeSQpQMirn8dB0Z/gxW96j06tMfTviUWvX14gjKb7qd1gtkUyYhDPuoNe00K5PqNvy2oQNg==", + "dependencies": { + "is-finite": "^1.0.1", + "parse-ms": "^1.0.0", + "plur": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha512-yN0WQmuCX63LP/TMvAg31nvT6m4vDqJEiiv2CAZqWOGNWutc9DfDk1NPYYmKUFmaVM2UwDowH4u5AHWYP/jxKw==" + }, + "node_modules/proper-lockfile": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz", + "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==", + "dependencies": { + "graceful-fs": "^4.2.4", + "retry": "^0.12.0", + "signal-exit": "^3.0.2" + } + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/re-emitter": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/re-emitter/-/re-emitter-1.1.3.tgz", + "integrity": "sha512-bHJul9CWcocrS+w5e5QrKYXV9NkbSA9hxSEyhYuctwm6keY9NXR2Xt/4A0vbMP0QvuwyfEyb4bkowYXv1ziEbg==" + }, + "node_modules/react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", + "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "set-function-name": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" + }, + "node_modules/resolve": { + "version": "2.0.0-next.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", + "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", + "dependencies": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/safe-array-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", + "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + }, + "node_modules/set-function-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", + "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "dependencies": { + "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "node_modules/simple-peer": { + "version": "9.11.1", + "resolved": "https://registry.npmjs.org/simple-peer/-/simple-peer-9.11.1.tgz", + "integrity": "sha512-D1SaWpOW8afq1CZGWB8xTfrT3FekjQmPValrqncJMX7QFl8YwhrPTZvMCANLtgBwwdS+7zURyqxDDEmY558tTw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "buffer": "^6.0.3", + "debug": "^4.3.2", + "err-code": "^3.0.1", + "get-browser-rtc": "^1.1.0", + "queue-microtask": "^1.2.3", + "randombytes": "^2.1.0", + "readable-stream": "^3.6.0" + } + }, + "node_modules/socket.io-client": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.7.2.tgz", + "integrity": "sha512-vtA0uD4ibrYD793SOIAwlo8cj6haOeMHrGvwPxJsxH7CeIksqJ+3Zc06RvWTIFgiSqx4A3sOnTXpfAEE2Zyz6w==", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.2", + "engine.io-client": "~6.5.2", + "socket.io-parser": "~4.2.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-parser": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", + "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/split": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.0.tgz", + "integrity": "sha512-3SVfJe2A0WZg3D+ZEtXqYkvpSGAVaZ1MgufNCeHioBESCqQFsuT1VcQufiopBfJZqh92ZwQ6ddL378iUSbqVNQ==", + "dependencies": { + "through": "2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/stop-iteration-iterator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", + "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", + "dependencies": { + "internal-slot": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", + "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", + "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", + "dependencies": { + "is-hex-prefixed": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tap-out": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tap-out/-/tap-out-2.1.0.tgz", + "integrity": "sha512-LJE+TBoVbOWhwdz4+FQk40nmbIuxJLqaGvj3WauQw3NYYU5TdjoV3C0x/yq37YAvVyi+oeBXmWnxWSjJ7IEyUw==", + "dependencies": { + "re-emitter": "1.1.3", + "readable-stream": "2.2.9", + "split": "1.0.0", + "trim": "0.0.1" + }, + "bin": { + "tap-out": "bin/cmd.js" + } + }, + "node_modules/tap-out/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/tap-out/node_modules/readable-stream": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.9.tgz", + "integrity": "sha512-iuxqX7b7FYt08AriYECxUsK9KTXE3A/FenxIa3IPmvANHxaTP/wGIwwf+IidvvIDk/MsCp/oEV6A8CXo4SDcCg==", + "dependencies": { + "buffer-shims": "~1.0.0", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~1.0.0", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/tap-out/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/tap-out/node_modules/string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/tap-spec": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tap-spec/-/tap-spec-5.0.0.tgz", + "integrity": "sha512-zMDVJiE5I6Y4XGjlueGXJIX2YIkbDN44broZlnypT38Hj/czfOXrszHNNJBF/DXR8n+x6gbfSx68x04kIEHdrw==", + "dependencies": { + "chalk": "^1.0.0", + "duplexer": "^0.1.1", + "figures": "^1.4.0", + "lodash": "^4.17.10", + "pretty-ms": "^2.1.0", + "repeat-string": "^1.5.2", + "tap-out": "^2.1.0", + "through2": "^2.0.0" + }, + "bin": { + "tap-spec": "bin/cmd.js", + "tspec": "bin/cmd.js" + } + }, + "node_modules/tape": { + "version": "5.6.6", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.6.6.tgz", + "integrity": "sha512-rGp2cZ3rfZ6QfTBm6yvohf8aXmDqPyzMKZwTMV12w4i+b/N2Adwlg8PlW8jLqWzlJUZhglyYaLOSrMt/ZlZkAA==", + "dependencies": { + "@ljharb/resumer": "^0.0.1", + "@ljharb/through": "^2.3.9", + "array.prototype.every": "^1.1.4", + "call-bind": "^1.0.2", + "deep-equal": "^2.2.2", + "defined": "^1.0.1", + "dotignore": "^0.1.2", + "for-each": "^0.3.3", + "get-package-type": "^0.1.0", + "glob": "^7.2.3", + "has": "^1.0.3", + "has-dynamic-import": "^2.0.1", + "inherits": "^2.0.4", + "is-regex": "^1.1.4", + "minimist": "^1.2.8", + "object-inspect": "^1.12.3", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "resolve": "^2.0.0-next.4", + "string.prototype.trim": "^1.2.7" + }, + "bin": { + "tape": "bin/tape" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/through2/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/through2/node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/through2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/through2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/trim": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "integrity": "sha512-YzQV+TZg4AxpKxaTHK3c3D+kRDCGVEE7LemdlQZoQXn0iennk10RsIoY6ikzAqJTc9Xjl9C1/waHom/J86ziAQ==", + "deprecated": "Use String.prototype.trim() instead" + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, + "node_modules/tus-js-client": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/tus-js-client/-/tus-js-client-3.1.1.tgz", + "integrity": "sha512-SZzWP62jEFLmROSRZx+uoGLKqsYWMGK/m+PiNehPVWbCm7/S9zRIMaDxiaOcKdMnFno4luaqP5E+Y1iXXPjP0A==", + "dependencies": { + "buffer-from": "^1.1.2", + "combine-errors": "^3.0.3", + "is-stream": "^2.0.0", + "js-base64": "^3.7.2", + "lodash.throttle": "^4.1.1", + "proper-lockfile": "^4.1.2", + "url-parse": "^1.5.7" + } + }, + "node_modules/tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + }, + "node_modules/tweetnacl-util": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==" + }, + "node_modules/typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/unique-names-generator": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/unique-names-generator/-/unique-names-generator-4.7.1.tgz", + "integrity": "sha512-lMx9dX+KRmG8sq6gulYYpKWZc9RlGsgBR6aoO8Qsm3qvkSJ+3rAymr+TnV8EDMrIrwuFJ4kruzMWM/OpYzPoow==", + "engines": { + "node": ">=8" + } + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/use-sync-external-store": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", + "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/video-stream-merger": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/video-stream-merger/-/video-stream-merger-4.0.1.tgz", + "integrity": "sha512-VazYSr8tk6S/zkOq5jpR/ryy1HnGxm5XCw+d2Ejpqy1m6d71oZpyFG82dUkgAo7dg/lk3k4TqvJPtuRUtR8URA==" + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", + "dependencies": { + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-weakmap": "^2.0.1", + "is-weakset": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", + "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/ws": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xmlhttprequest-ssl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz", + "integrity": "sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/zustand": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.4.1.tgz", + "integrity": "sha512-QCPfstAS4EBiTQzlaGP1gmorkh/UL1Leaj2tdj+zZCZ/9bm0WS7sI2wnfD5lpOszFqWJ1DcPnGoY8RDL61uokw==", + "dependencies": { + "use-sync-external-store": "1.2.0" + }, + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "@types/react": ">=16.8", + "immer": ">=9.0", + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "immer": { + "optional": true + }, + "react": { + "optional": true + } + } + } + }, + "dependencies": { + "@ambire/signature-validator": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@ambire/signature-validator/-/signature-validator-1.3.1.tgz", + "integrity": "sha512-kR6Se3nhAGf1VMeun7V2Lml9KRXB5oz64vO2zGSg+dNaGq4BPDEjsNdr0PIKXZ8651sDlRCN7V9SzL5E2ddBYQ==", + "requires": { + "ethers": "^5.6.5", + "tap-spec": "^5.0.0", + "tape": "^5.5.3" + } + }, + "@ethereumjs/rlp": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", + "integrity": "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==" + }, + "@ethereumjs/util": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", + "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", + "requires": { + "@ethereumjs/rlp": "^4.0.1", + "ethereum-cryptography": "^2.0.0", + "micro-ftch": "^0.3.1" + } + }, + "@ethersproject/abi": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", + "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", + "requires": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "@ethersproject/abstract-provider": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", + "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", + "requires": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0" + } + }, + "@ethersproject/abstract-signer": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", + "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", + "requires": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "@ethersproject/address": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", + "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", + "requires": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/rlp": "^5.7.0" + } + }, + "@ethersproject/base64": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", + "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", + "requires": { + "@ethersproject/bytes": "^5.7.0" + } + }, + "@ethersproject/basex": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", + "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "@ethersproject/bignumber": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", + "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "bn.js": "^5.2.1" + }, + "dependencies": { + "bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + } + } + }, + "@ethersproject/bytes": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", + "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", + "requires": { + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/constants": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", + "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", + "requires": { + "@ethersproject/bignumber": "^5.7.0" + } + }, + "@ethersproject/contracts": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", + "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", + "requires": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0" + } + }, + "@ethersproject/hash": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", + "requires": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "@ethersproject/hdnode": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", + "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", + "requires": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "@ethersproject/json-wallets": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", + "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", + "requires": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "aes-js": "3.0.0", + "scrypt-js": "3.0.1" + } + }, + "@ethersproject/keccak256": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", + "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "js-sha3": "0.8.0" + } + }, + "@ethersproject/logger": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", + "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==" + }, + "@ethersproject/networks": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", + "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", + "requires": { + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/pbkdf2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", + "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/sha2": "^5.7.0" + } + }, + "@ethersproject/properties": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", + "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", + "requires": { + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/providers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", + "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", + "requires": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0", + "bech32": "1.1.4", + "ws": "7.4.6" + } + }, + "@ethersproject/random": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", + "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/rlp": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", + "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/sha2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", + "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "hash.js": "1.1.7" + } + }, + "@ethersproject/signing-key": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", + "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "bn.js": "^5.2.1", + "elliptic": "6.5.4", + "hash.js": "1.1.7" + }, + "dependencies": { + "bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + } + } + }, + "@ethersproject/solidity": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", + "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", + "requires": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "@ethersproject/strings": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", + "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/transactions": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", + "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", + "requires": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0" + } + }, + "@ethersproject/units": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", + "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", + "requires": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/wallet": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", + "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", + "requires": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/json-wallets": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "@ethersproject/web": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", + "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", + "requires": { + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "@ethersproject/wordlists": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", + "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "@hapi/hoek": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", + "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==" + }, + "@hapi/topo": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", + "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", + "requires": { + "@hapi/hoek": "^9.0.0" + } + }, + "@livepeer/core": { + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/@livepeer/core/-/core-1.8.6.tgz", + "integrity": "sha512-VWMHaHMzNCr8YuC9hD87Ju+fwnpldEoe3y9CqOXrQPyyIgiAWfraZBA6Ard67f09X9UBGaaRcAMgMcCUs9HtKA==", + "requires": { + "cross-fetch": "^4.0.0", + "ms": "^3.0.0-canary.1", + "multiformats": "9.9.0", + "tus-js-client": "^3.1.0", + "zustand": "^4.3.9" + } + }, + "@ljharb/resumer": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@ljharb/resumer/-/resumer-0.0.1.tgz", + "integrity": "sha512-skQiAOrCfO7vRTq53cxznMpks7wS1va95UCidALlOVWqvBAzwPVErwizDwoMqNVMEn1mDq0utxZd02eIrvF1lw==", + "requires": { + "@ljharb/through": "^2.3.9" + } + }, + "@ljharb/through": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.9.tgz", + "integrity": "sha512-yN599ZBuMPPK4tdoToLlvgJB4CLK8fGl7ntfy0Wn7U6ttNvHYurd81bfUiK/6sMkiIwm65R6ck4L6+Y3DfVbNQ==" + }, + "@metamask/eth-sig-util": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-5.1.0.tgz", + "integrity": "sha512-mlgziIHYlA9pi/XZerChqg4NocdOgBPB9NmxgXWQO2U2hH8RGOJQrz6j/AIKkYxgCMIE2PY000+joOwXfzeTDQ==", + "requires": { + "@ethereumjs/util": "^8.0.6", + "bn.js": "^4.12.0", + "ethereum-cryptography": "^2.0.0", + "ethjs-util": "^0.1.6", + "tweetnacl": "^1.0.3", + "tweetnacl-util": "^0.15.1" + } + }, + "@noble/curves": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz", + "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==", + "requires": { + "@noble/hashes": "1.3.1" + } + }, + "@noble/hashes": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", + "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==" + }, + "@pushprotocol/restapi": { + "version": "1.4.19", + "resolved": "https://registry.npmjs.org/@pushprotocol/restapi/-/restapi-1.4.19.tgz", + "integrity": "sha512-MGeYMX0NB2/sPSOnyvERZL2jKqeBPE6nUgySecEvW/JaUW8DsAX7KSN5IU4xvF9KpQblbUDcdXq4iW55/oZqOA==", + "requires": { + "@ambire/signature-validator": "^1.3.1", + "@metamask/eth-sig-util": "^5.0.2", + "axios": "^0.27.2", + "buffer": "^6.0.3", + "crypto-js": "^4.1.1", + "immer": "^10.0.2", + "joi": "^17.9.2", + "livepeer": "^2.5.8", + "openpgp": "^5.5.0", + "simple-peer": "^9.11.1", + "tslib": "^2.3.0", + "unique-names-generator": "^4.7.1", + "uuid": "^9.0.0", + "video-stream-merger": "^4.0.1" + } + }, + "@pushprotocol/socket": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@pushprotocol/socket/-/socket-0.5.2.tgz", + "integrity": "sha512-lVGMT3q8T5by6qwAhQ+zIeE/yv7oUC9eIlFux8M7WaKu/ArLBrrojD5REbr9QXXwpJIP3Q8GJUKyClZl4uGsJw==", + "requires": { + "socket.io-client": "^4.5.2", + "tslib": "^2.3.0" + } + }, + "@scure/base": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.3.tgz", + "integrity": "sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==" + }, + "@scure/bip32": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.1.tgz", + "integrity": "sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A==", + "requires": { + "@noble/curves": "~1.1.0", + "@noble/hashes": "~1.3.1", + "@scure/base": "~1.1.0" + } + }, + "@scure/bip39": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz", + "integrity": "sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==", + "requires": { + "@noble/hashes": "~1.3.0", + "@scure/base": "~1.1.0" + } + }, + "@sideway/address": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz", + "integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==", + "requires": { + "@hapi/hoek": "^9.0.0" + } + }, + "@sideway/formula": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", + "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==" + }, + "@sideway/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==" + }, + "@socket.io/component-emitter": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", + "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==" + }, + "@stitches/core": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@stitches/core/-/core-1.2.8.tgz", + "integrity": "sha512-Gfkvwk9o9kE9r9XNBmJRfV8zONvXThnm1tcuojL04Uy5uRyqg93DC83lDebl0rocZCfKSjUv+fWYtMQmEDJldg==" + }, + "aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==" + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==" + }, + "array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "requires": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + } + }, + "array.prototype.every": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.5.tgz", + "integrity": "sha512-FfMQJ+/joFGXpRCltbzV3znaP5QxIhLFySo0fEPn3GuoYlud9LhknMCIxdYKC2qsM/6VHoSp6YGwe3EZXrEcwQ==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "is-string": "^1.0.7" + } + }, + "arraybuffer.prototype.slice": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", + "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", + "requires": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" + } + }, + "asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==" + }, + "axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "requires": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" + }, + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + }, + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, + "buffer-shims": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "integrity": "sha512-Zy8ZXMyxIT6RMTeY7OP/bDndfj6bwCan7SS98CEndS6deHwWPpseeHlwarNcBim+etXnF9HBc1non5JgDaJU1g==" + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "combine-errors": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/combine-errors/-/combine-errors-3.0.3.tgz", + "integrity": "sha512-C8ikRNRMygCwaTx+Ek3Yr+OuZzgZjduCOfSQBjbM8V3MfgcjSTeto/GXP6PAwKvJz/v15b7GHZvx5rOlczFw/Q==", + "requires": { + "custom-error-instance": "2.1.1", + "lodash.uniqby": "4.5.0" + } + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "core-js": { + "version": "3.32.2", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.32.2.tgz", + "integrity": "sha512-pxXSw1mYZPDGvTQqEc5vgIb83jGQKFGYWY76z4a7weZXUolw3G+OvpZqSRcfYOoOVUQJYEPsWeQK8pKEnUtWxQ==" + }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "requires": { + "node-fetch": "^2.6.12" + } + }, + "crypto-js": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz", + "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==" + }, + "custom-error-instance": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/custom-error-instance/-/custom-error-instance-2.1.1.tgz", + "integrity": "sha512-p6JFxJc3M4OTD2li2qaHkDCw9SfMw82Ldr6OC9Je1aXiGfhx2W8p3GaoeaGrPJTUN9NirTM/KTxHWMUdR1rsUg==" + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, + "deep-equal": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.2.tgz", + "integrity": "sha512-xjVyBf0w5vH0I42jdAZzOKVldmPgSulmiyPRywoyq7HXC9qdgo17kxJE+rdnif5Tz6+pIrpJI8dCpMNLIGkUiA==", + "requires": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "es-get-iterator": "^1.1.3", + "get-intrinsic": "^1.2.1", + "is-arguments": "^1.1.1", + "is-array-buffer": "^3.0.2", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "isarray": "^2.0.5", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.0", + "side-channel": "^1.0.4", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.9" + } + }, + "define-data-property": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz", + "integrity": "sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==", + "requires": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + } + }, + "define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "requires": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, + "defined": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", + "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==" + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" + }, + "dotignore": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/dotignore/-/dotignore-0.1.2.tgz", + "integrity": "sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==", + "requires": { + "minimatch": "^3.0.4" + } + }, + "duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==" + }, + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "engine.io-client": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.5.2.tgz", + "integrity": "sha512-CQZqbrpEYnrpGqC07a9dJDz4gePZUgTPMU3NKJPSeQOyw27Tst4Pl3FemKoFGAlHzgZmKjoRmiJvbWfhCXUlIg==", + "requires": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.11.0", + "xmlhttprequest-ssl": "~2.0.0" + }, + "dependencies": { + "ws": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", + "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", + "requires": {} + } + } + }, + "engine.io-parser": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.1.tgz", + "integrity": "sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ==" + }, + "err-code": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", + "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + }, + "es-abstract": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.2.tgz", + "integrity": "sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA==", + "requires": { + "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.2", + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.1", + "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.12", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.1", + "safe-array-concat": "^1.0.1", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.11" + } + }, + "es-get-iterator": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", + "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "has-symbols": "^1.0.3", + "is-arguments": "^1.1.1", + "is-map": "^2.0.2", + "is-set": "^2.0.2", + "is-string": "^1.0.7", + "isarray": "^2.0.5", + "stop-iteration-iterator": "^1.0.0" + } + }, + "es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "requires": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" + }, + "ethereum-cryptography": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz", + "integrity": "sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug==", + "requires": { + "@noble/curves": "1.1.0", + "@noble/hashes": "1.3.1", + "@scure/bip32": "1.3.1", + "@scure/bip39": "1.2.1" + } + }, + "ethers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", + "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", + "requires": { + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" + } + }, + "ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "requires": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha512-UxKlfCRuCBxSXU4C6t9scbDyWZ4VlaFFdojKtzJuSkuOBQ5CNFum+zZXFwHjo+CxBC1t6zlYPgHIgFjL8ggoEQ==", + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "requires": { + "is-callable": "^1.1.3" + } + }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + } + }, + "functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==" + }, + "get-browser-rtc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-browser-rtc/-/get-browser-rtc-1.1.0.tgz", + "integrity": "sha512-MghbMJ61EJrRsDe7w1Bvqt3ZsBuqhce5nrn/XAwgwOXhcsz53/ltdxOse1h/8eKXj5slzxdsz56g5rzOFSGwfQ==" + }, + "get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + } + }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==" + }, + "get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + } + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "requires": { + "define-properties": "^1.1.3" + } + }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "requires": { + "get-intrinsic": "^1.1.3" + } + }, + "graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==" + }, + "has-dynamic-import": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-dynamic-import/-/has-dynamic-import-2.0.1.tgz", + "integrity": "sha512-X3fbtsZmwb6W7fJGR9o7x65fZoodygCrZ3TVycvghP62yYQfS0t4RS0Qcz+j5tQYUKeSWS09tHkWW6WhFV3XhQ==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + } + }, + "has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "requires": { + "get-intrinsic": "^1.1.1" + } + }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==" + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "requires": { + "has-symbols": "^1.0.2" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hls.js": { + "version": "1.4.12", + "resolved": "https://registry.npmjs.org/hls.js/-/hls.js-1.4.12.tgz", + "integrity": "sha512-1RBpx2VihibzE3WE9kGoVCtrhhDWTzydzElk/kyRbEOLnb1WIE+3ZabM/L8BqKFTCL3pUy4QzhXgD1Q6Igr1JA==" + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "immer": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/immer/-/immer-10.0.2.tgz", + "integrity": "sha512-Rx3CqeqQ19sxUtYV9CU911Vhy8/721wRFnJv3REVGWUmoAcIwzifTsdmJte/MV+0/XpM35LZdQMBGkRIoLPwQA==" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "internal-slot": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", + "requires": { + "get-intrinsic": "^1.2.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + } + }, + "is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + } + }, + "is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "requires": { + "has-bigints": "^1.0.1" + } + }, + "is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==" + }, + "is-core-module": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "requires": { + "has": "^1.0.3" + } + }, + "is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==" + }, + "is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==" + }, + "is-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", + "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==" + }, + "is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==" + }, + "is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-set": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", + "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==" + }, + "is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "requires": { + "call-bind": "^1.0.2" + } + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + }, + "is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "requires": { + "has-symbols": "^1.0.2" + } + }, + "is-typed-array": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "requires": { + "which-typed-array": "^1.1.11" + } + }, + "is-weakmap": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==" + }, + "is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "requires": { + "call-bind": "^1.0.2" + } + }, + "is-weakset": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", + "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + } + }, + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" + }, + "joi": { + "version": "17.10.2", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.10.2.tgz", + "integrity": "sha512-hcVhjBxRNW/is3nNLdGLIjkgXetkeGc2wyhydhz8KumG23Aerk4HPjU5zaPAMRqXQFc0xNqXTC7+zQjxr0GlKA==", + "requires": { + "@hapi/hoek": "^9.0.0", + "@hapi/topo": "^5.0.0", + "@sideway/address": "^4.1.3", + "@sideway/formula": "^3.0.1", + "@sideway/pinpoint": "^2.0.0" + } + }, + "js-base64": { + "version": "3.7.5", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.5.tgz", + "integrity": "sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA==" + }, + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "peer": true + }, + "livepeer": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/livepeer/-/livepeer-2.8.6.tgz", + "integrity": "sha512-8K2lRtpgZKbv6l6cGYYMJW9qpdRKkGUuy7R7xTLkS6NaRQzaeW08vubftmbMHil8v8GX/nDmodcW2vA4oIkP0w==", + "requires": { + "@livepeer/core": "^1.8.6", + "@stitches/core": "^1.2.8", + "core-js": "^3.31.1", + "cross-fetch": "^4.0.0", + "hls.js": "^1.4.9", + "ms": "^3.0.0-canary.1", + "tus-js-client": "^3.1.0", + "zustand": "^4.3.9" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lodash._baseiteratee": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash._baseiteratee/-/lodash._baseiteratee-4.7.0.tgz", + "integrity": "sha512-nqB9M+wITz0BX/Q2xg6fQ8mLkyfF7MU7eE+MNBNjTHFKeKaZAPEzEg+E8LWxKWf1DQVflNEn9N49yAuqKh2mWQ==", + "requires": { + "lodash._stringtopath": "~4.8.0" + } + }, + "lodash._basetostring": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz", + "integrity": "sha512-SwcRIbyxnN6CFEEK4K1y+zuApvWdpQdBHM/swxP962s8HIxPO3alBH5t3m/dl+f4CMUug6sJb7Pww8d13/9WSw==" + }, + "lodash._baseuniq": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz", + "integrity": "sha512-Ja1YevpHZctlI5beLA7oc5KNDhGcPixFhcqSiORHNsp/1QTv7amAXzw+gu4YOvErqVlMVyIJGgtzeepCnnur0A==", + "requires": { + "lodash._createset": "~4.0.0", + "lodash._root": "~3.0.0" + } + }, + "lodash._createset": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/lodash._createset/-/lodash._createset-4.0.3.tgz", + "integrity": "sha512-GTkC6YMprrJZCYU3zcqZj+jkXkrXzq3IPBcF/fIPpNEAB4hZEtXU8zp/RwKOvZl43NUmwDbyRk3+ZTbeRdEBXA==" + }, + "lodash._root": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", + "integrity": "sha512-O0pWuFSK6x4EXhM1dhZ8gchNtG7JMqBtrHdoUFUWXD7dJnNSUze1GuyQr5sOs0aCvgGeI3o/OJW8f4ca7FDxmQ==" + }, + "lodash._stringtopath": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/lodash._stringtopath/-/lodash._stringtopath-4.8.0.tgz", + "integrity": "sha512-SXL66C731p0xPDC5LZg4wI5H+dJo/EO4KTqOMwLYCH3+FmmfAKJEZCm6ohGpI+T1xwsDsJCfL4OnhorllvlTPQ==", + "requires": { + "lodash._basetostring": "~4.12.0" + } + }, + "lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==" + }, + "lodash.uniqby": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.5.0.tgz", + "integrity": "sha512-IRt7cfTtHy6f1aRVA5n7kT8rgN3N1nH6MOWLcHfpWG2SH19E3JksLK38MktLxZDhlAjCP9jpIXkOnRXlu6oByQ==", + "requires": { + "lodash._baseiteratee": "~4.7.0", + "lodash._baseuniq": "~4.6.0" + } + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "peer": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "micro-ftch": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/micro-ftch/-/micro-ftch-0.3.1.tgz", + "integrity": "sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==" + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" + }, + "ms": { + "version": "3.0.0-canary.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-3.0.0-canary.1.tgz", + "integrity": "sha512-kh8ARjh8rMN7Du2igDRO9QJnqCb2xYTJxyQYK7vJJS4TvLLmsbyhiKpSW+t+y26gyOyMd0riphX0GeWKU3ky5g==" + }, + "multiformats": { + "version": "9.9.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", + "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==" + }, + "node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" + }, + "object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" + }, + "object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "requires": { + "wrappy": "1" + } + }, + "openpgp": { + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/openpgp/-/openpgp-5.10.2.tgz", + "integrity": "sha512-nRqMp4o31rBagWB02tgfKCsocXWq4uYobZf9GDVlD5rQXBq/wRIZHiDhGX1dlDAI2inkZcPd2dSZOqmtGnsK1A==", + "requires": { + "asn1.js": "^5.0.0" + } + }, + "parse-ms": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", + "integrity": "sha512-LpH1Cf5EYuVjkBvCDBYvkUPh+iv2bk3FHflxHkpCYT0/FZ1d3N3uJaLiHr4yGuMcFUhv6eAivitTvWZI4B/chg==" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "plur": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/plur/-/plur-1.0.0.tgz", + "integrity": "sha512-qSnKBSZeDY8ApxwhfVIwKwF36KVJqb1/9nzYYq3j3vdwocULCXT8f8fQGkiw1Nk9BGfxiDagEe/pwakA+bOBqw==" + }, + "pretty-ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-2.1.0.tgz", + "integrity": "sha512-H2enpsxzDhuzRl3zeSQpQMirn8dB0Z/gxW96j06tMfTviUWvX14gjKb7qd1gtkUyYhDPuoNe00K5PqNvy2oQNg==", + "requires": { + "is-finite": "^1.0.1", + "parse-ms": "^1.0.0", + "plur": "^1.0.0" + } + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha512-yN0WQmuCX63LP/TMvAg31nvT6m4vDqJEiiv2CAZqWOGNWutc9DfDk1NPYYmKUFmaVM2UwDowH4u5AHWYP/jxKw==" + }, + "proper-lockfile": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz", + "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==", + "requires": { + "graceful-fs": "^4.2.4", + "retry": "^0.12.0", + "signal-exit": "^3.0.2" + } + }, + "querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "re-emitter": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/re-emitter/-/re-emitter-1.1.3.tgz", + "integrity": "sha512-bHJul9CWcocrS+w5e5QrKYXV9NkbSA9hxSEyhYuctwm6keY9NXR2Xt/4A0vbMP0QvuwyfEyb4bkowYXv1ziEbg==" + }, + "react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "peer": true, + "requires": { + "loose-envify": "^1.1.0" + } + }, + "readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "regexp.prototype.flags": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", + "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "set-function-name": "^2.0.0" + } + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==" + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" + }, + "resolve": { + "version": "2.0.0-next.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", + "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", + "requires": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==" + }, + "safe-array-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", + "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + }, + "set-function-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", + "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "requires": { + "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.0" + } + }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "simple-peer": { + "version": "9.11.1", + "resolved": "https://registry.npmjs.org/simple-peer/-/simple-peer-9.11.1.tgz", + "integrity": "sha512-D1SaWpOW8afq1CZGWB8xTfrT3FekjQmPValrqncJMX7QFl8YwhrPTZvMCANLtgBwwdS+7zURyqxDDEmY558tTw==", + "requires": { + "buffer": "^6.0.3", + "debug": "^4.3.2", + "err-code": "^3.0.1", + "get-browser-rtc": "^1.1.0", + "queue-microtask": "^1.2.3", + "randombytes": "^2.1.0", + "readable-stream": "^3.6.0" + } + }, + "socket.io-client": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.7.2.tgz", + "integrity": "sha512-vtA0uD4ibrYD793SOIAwlo8cj6haOeMHrGvwPxJsxH7CeIksqJ+3Zc06RvWTIFgiSqx4A3sOnTXpfAEE2Zyz6w==", + "requires": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.2", + "engine.io-client": "~6.5.2", + "socket.io-parser": "~4.2.4" + } + }, + "socket.io-parser": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", + "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "requires": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1" + } + }, + "split": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.0.tgz", + "integrity": "sha512-3SVfJe2A0WZg3D+ZEtXqYkvpSGAVaZ1MgufNCeHioBESCqQFsuT1VcQufiopBfJZqh92ZwQ6ddL378iUSbqVNQ==", + "requires": { + "through": "2" + } + }, + "stop-iteration-iterator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", + "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", + "requires": { + "internal-slot": "^1.0.4" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "string.prototype.trim": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", + "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, + "string.prototype.trimend": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", + "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, + "string.prototype.trimstart": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", + "requires": { + "is-hex-prefixed": "1.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==" + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + }, + "tap-out": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tap-out/-/tap-out-2.1.0.tgz", + "integrity": "sha512-LJE+TBoVbOWhwdz4+FQk40nmbIuxJLqaGvj3WauQw3NYYU5TdjoV3C0x/yq37YAvVyi+oeBXmWnxWSjJ7IEyUw==", + "requires": { + "re-emitter": "1.1.3", + "readable-stream": "2.2.9", + "split": "1.0.0", + "trim": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "readable-stream": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.9.tgz", + "integrity": "sha512-iuxqX7b7FYt08AriYECxUsK9KTXE3A/FenxIa3IPmvANHxaTP/wGIwwf+IidvvIDk/MsCp/oEV6A8CXo4SDcCg==", + "requires": { + "buffer-shims": "~1.0.0", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~1.0.0", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "tap-spec": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tap-spec/-/tap-spec-5.0.0.tgz", + "integrity": "sha512-zMDVJiE5I6Y4XGjlueGXJIX2YIkbDN44broZlnypT38Hj/czfOXrszHNNJBF/DXR8n+x6gbfSx68x04kIEHdrw==", + "requires": { + "chalk": "^1.0.0", + "duplexer": "^0.1.1", + "figures": "^1.4.0", + "lodash": "^4.17.10", + "pretty-ms": "^2.1.0", + "repeat-string": "^1.5.2", + "tap-out": "^2.1.0", + "through2": "^2.0.0" + } + }, + "tape": { + "version": "5.6.6", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.6.6.tgz", + "integrity": "sha512-rGp2cZ3rfZ6QfTBm6yvohf8aXmDqPyzMKZwTMV12w4i+b/N2Adwlg8PlW8jLqWzlJUZhglyYaLOSrMt/ZlZkAA==", + "requires": { + "@ljharb/resumer": "^0.0.1", + "@ljharb/through": "^2.3.9", + "array.prototype.every": "^1.1.4", + "call-bind": "^1.0.2", + "deep-equal": "^2.2.2", + "defined": "^1.0.1", + "dotignore": "^0.1.2", + "for-each": "^0.3.3", + "get-package-type": "^0.1.0", + "glob": "^7.2.3", + "has": "^1.0.3", + "has-dynamic-import": "^2.0.1", + "inherits": "^2.0.4", + "is-regex": "^1.1.4", + "minimist": "^1.2.8", + "object-inspect": "^1.12.3", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "resolve": "^2.0.0-next.4", + "string.prototype.trim": "^1.2.7" + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "trim": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "integrity": "sha512-YzQV+TZg4AxpKxaTHK3c3D+kRDCGVEE7LemdlQZoQXn0iennk10RsIoY6ikzAqJTc9Xjl9C1/waHom/J86ziAQ==" + }, + "tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, + "tus-js-client": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/tus-js-client/-/tus-js-client-3.1.1.tgz", + "integrity": "sha512-SZzWP62jEFLmROSRZx+uoGLKqsYWMGK/m+PiNehPVWbCm7/S9zRIMaDxiaOcKdMnFno4luaqP5E+Y1iXXPjP0A==", + "requires": { + "buffer-from": "^1.1.2", + "combine-errors": "^3.0.3", + "is-stream": "^2.0.0", + "js-base64": "^3.7.2", + "lodash.throttle": "^4.1.1", + "proper-lockfile": "^4.1.2", + "url-parse": "^1.5.7" + } + }, + "tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + }, + "tweetnacl-util": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==" + }, + "typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + } + }, + "typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "requires": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + } + }, + "typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "requires": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + } + }, + "typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "requires": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + } + }, + "unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "requires": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + } + }, + "unique-names-generator": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/unique-names-generator/-/unique-names-generator-4.7.1.tgz", + "integrity": "sha512-lMx9dX+KRmG8sq6gulYYpKWZc9RlGsgBR6aoO8Qsm3qvkSJ+3rAymr+TnV8EDMrIrwuFJ4kruzMWM/OpYzPoow==" + }, + "url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "requires": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "use-sync-external-store": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", + "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "requires": {} + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==" + }, + "video-stream-merger": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/video-stream-merger/-/video-stream-merger-4.0.1.tgz", + "integrity": "sha512-VazYSr8tk6S/zkOq5jpR/ryy1HnGxm5XCw+d2Ejpqy1m6d71oZpyFG82dUkgAo7dg/lk3k4TqvJPtuRUtR8URA==" + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "requires": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + } + }, + "which-collection": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", + "requires": { + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-weakmap": "^2.0.1", + "is-weakset": "^2.0.1" + } + }, + "which-typed-array": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", + "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "requires": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "ws": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "requires": {} + }, + "xmlhttprequest-ssl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz", + "integrity": "sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + }, + "zustand": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.4.1.tgz", + "integrity": "sha512-QCPfstAS4EBiTQzlaGP1gmorkh/UL1Leaj2tdj+zZCZ/9bm0WS7sI2wnfD5lpOszFqWJ1DcPnGoY8RDL61uokw==", + "requires": { + "use-sync-external-store": "1.2.0" + } + } + } +} diff --git a/packages/examples/sdk-frontend-react/src/app/ChatTest/ChatTest.tsx b/packages/examples/sdk-frontend-react/src/app/ChatTest/ChatTest.tsx index d898b3736..789c84588 100644 --- a/packages/examples/sdk-frontend-react/src/app/ChatTest/ChatTest.tsx +++ b/packages/examples/sdk-frontend-react/src/app/ChatTest/ChatTest.tsx @@ -71,6 +71,9 @@ const ChatTest = () => { CHAT.GETGROUPACCESS + + CHAT.GETGROUPMEMBERSTATUS + CHAT.SEARCHGROUPS diff --git a/packages/examples/sdk-frontend-react/src/app/ChatTest/CreateGroupTest.tsx b/packages/examples/sdk-frontend-react/src/app/ChatTest/CreateGroupTest.tsx index 4f273a383..2c52acb7d 100644 --- a/packages/examples/sdk-frontend-react/src/app/ChatTest/CreateGroupTest.tsx +++ b/packages/examples/sdk-frontend-react/src/app/ChatTest/CreateGroupTest.tsx @@ -106,7 +106,26 @@ const CreateGroupTest = () => { signer: librarySigner, env, meta: meta, - rules: rules ? JSON.parse(rules) as Rules : undefined + rules: { + 'chat': { + 'conditions': [ + { + 'all': [ + { + 'type': PushAPI.ConditionType.PUSH, + 'category': 'ERC20', + 'subcategory': 'holder', + 'data': { + 'contract': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33', + 'amount': 1, + 'decimals': 18 + } + } + ] + } + ] + } + } }); setSendResponse(response); diff --git a/packages/examples/sdk-frontend-react/src/app/ChatTest/GetGroupMemberStatusTest.tsx b/packages/examples/sdk-frontend-react/src/app/ChatTest/GetGroupMemberStatusTest.tsx new file mode 100644 index 000000000..085c86ac9 --- /dev/null +++ b/packages/examples/sdk-frontend-react/src/app/ChatTest/GetGroupMemberStatusTest.tsx @@ -0,0 +1,86 @@ +import { useState, useContext } from 'react'; +import { + Section, + SectionItem, + CodeFormatter, + SectionButton, +} from '../components/StyledComponents'; +import Loader from '../components/Loader'; +import { EnvContext } from '../context'; +import * as PushAPI from '@pushprotocol/restapi'; + +const GetGroupMemberStatusTest = () => { + const { env } = useContext(EnvContext); + const [isLoading, setLoading] = useState(false); + const [chatId, setChatId] = useState(''); + const [did, setDid] = useState(''); + const [sendResponse, setSendResponse] = useState(''); + + const updateChatId = (e: React.SyntheticEvent) => { + setChatId((e.target as HTMLInputElement).value); + }; + + const updateDid = (e: React.SyntheticEvent) => { + setDid((e.target as HTMLInputElement).value); + }; + + const testGetGroupMemberStatus = async () => { + try { + setLoading(true); + + const response = await PushAPI.chat.getGroupMemberStatus({ + chatId: chatId, + did: did, + env, + }); + setSendResponse(response); + } catch (e) { + console.error(e); + } finally { + setLoading(false); + } + }; + + return ( +
+

Get Group Member Status Test Page

+ + + +
+ + get group member status + + + + + + + + + + +
+ {sendResponse ? ( + + {JSON.stringify(sendResponse, null, 4)} + + ) : null} +
+
+
+
+ ); +}; + +export default GetGroupMemberStatusTest; diff --git a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatUITest.tsx b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatUITest.tsx index 7dd92f1ff..06cdb3837 100644 --- a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatUITest.tsx +++ b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatUITest.tsx @@ -38,6 +38,7 @@ const ChatUITest = () => { CHAT VIEW COMPONENT + diff --git a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewBubble.tsx b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewBubble.tsx index d9d184845..16cd126ad 100644 --- a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewBubble.tsx +++ b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewBubble.tsx @@ -26,7 +26,7 @@ export const ChatViewBubbles = () => { const ConversationHash = await PUSHAPI.chat.conversationHash({ account: `eip155:${account}`, - conversationId: '831b1d93f36fa2fce6c3d8c7c41c53335c82ad13cbe05478579af235f10716dc', + conversationId: '196f58cbe07c7eb5716d939e0a3be1f15b22b2334d5179c601566600016860ac', env: env }); setConversationHash(ConversationHash.threadHash); diff --git a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewComponent.tsx b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewComponent.tsx index bf1273fa6..ba0f92847 100644 --- a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewComponent.tsx +++ b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewComponent.tsx @@ -4,27 +4,28 @@ import { Section } from '../components/StyledComponents'; import { ChatViewComponent } from '@pushprotocol/uiweb'; - const ChatViewComponentTest = () => { - - + const chatFilterList = [ + 'bafyreidesy6f4iu34eqccmqh55g35wu36lvlz42c63ivtmgjjhezlzdqta', + 'bafyreig3gs4tpwxumiz5fxypyt4omlxhvrvuj66kfoyioeshawlau6lgem', + ]; return (

Chat UI Test page

+ - {/* */} - - - + console.log("BOIIII RETURNNNSSSSS")} chatId='b8e068e02fe12d7136bc2f24408835573f30c6fbf0b65ea26ab4c7055a2c85f1' limit={10} isConnected={true} autoConnect={false}/> + +
); -}; +} export default ChatViewComponentTest; - const ChatViewComponentCard = styled(Section)` -height:60vh; -`; \ No newline at end of file + height: 60vh; +`; +//c2d544ad9d1efd5c5a593b143bf8232875c926cf28015564e70ad078b95f807e diff --git a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewListTest.tsx b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewListTest.tsx index 28eec588d..69a29c15c 100644 --- a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewListTest.tsx +++ b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewListTest.tsx @@ -3,29 +3,32 @@ import styled from 'styled-components'; import * as PUSHAPI from '@pushprotocol/restapi'; import { Link } from 'react-router-dom'; import { Section } from '../components/StyledComponents'; -import { ChatViewList } from '@pushprotocol/uiweb'; +import { ChatViewList } from '@pushprotocol/uiweb'; import { EnvContext, Web3Context } from '../context'; import { usePushChatSocket } from '@pushprotocol/uiweb'; import { MessageInput } from '@pushprotocol/uiweb'; + const ChatViewListTest = () => { - const { account, pgpPrivateKey } = useContext(Web3Context) + // const { account, pgpPrivateKey } = useContext(Web3Context) - const { env } = useContext(EnvContext); + // const { env } = useContext(EnvContext); - usePushChatSocket(); + // usePushChatSocket(); + + return (

Chat UI Test page

{/* */} - - - + + + - + {/* */}
); }; @@ -33,7 +36,9 @@ const ChatViewListTest = () => { export default ChatViewListTest; -const ChatViewListCard = styled(Section)` +const ChatViewListCard = styled.div` height:40vh; background:black; +overflow: auto; +overflow-x: hidden; `; \ No newline at end of file diff --git a/packages/examples/sdk-frontend-react/src/app/app.tsx b/packages/examples/sdk-frontend-react/src/app/app.tsx index 04ed98fef..7f1db9f4c 100644 --- a/packages/examples/sdk-frontend-react/src/app/app.tsx +++ b/packages/examples/sdk-frontend-react/src/app/app.tsx @@ -2,7 +2,7 @@ import { useContext, useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; import { Route, Routes, Link } from 'react-router-dom'; import { useWeb3React } from '@web3-react/core'; -import ConnectButton from './components/Connect'; +import ConnectButtonComp from './components/Connect'; import { Checkbox } from './components/Checkbox'; import Dropdown from './components/Dropdown'; import { @@ -87,6 +87,8 @@ import { lightChatTheme } from '@pushprotocol/uiweb'; import SearchSpaceTest from './SpaceTest/SearchSpaceTest'; import SearchGroupTest from './ChatTest/SearchGroupTest'; import RejectRequestTest from './ChatTest/RejectRequestTest'; +import GetGroupMemberStatusTest from './ChatTest/GetGroupMemberStatusTest'; + window.Buffer = window.Buffer || Buffer; @@ -219,6 +221,7 @@ export function App() { const { account, library, active, chainId } = useWeb3React(); const [env, setEnv] = useState(ENV.PROD); const [isCAIP, setIsCAIP] = useState(false); + const [signer, setSigner] = useState(); const { SpaceWidgetComponent } = useSpaceComponents(); const [spaceId, setSpaceId] = useState(''); @@ -246,6 +249,7 @@ export function App() { const user = await PushAPI.user.get({ account: account, env }); let pgpPrivateKey; const librarySigner = await library.getSigner(account); + setSigner(librarySigner); if (user?.encryptedPrivateKey) { pgpPrivateKey = await PushAPI.chat.decryptPGPKey({ encryptedPGPPrivateKey: user.encryptedPrivateKey, @@ -258,7 +262,6 @@ export function App() { setPgpPrivateKey(pgpPrivateKey); })(); }, [account, env, library]); - const spaceUI = useMemo( () => new SpacesUI({ @@ -277,7 +280,7 @@ export function App() {

SDK Demo React App

- + - + } /> } /> } /> + } /> + } diff --git a/packages/examples/sdk-frontend-react/src/app/components/Connect.tsx b/packages/examples/sdk-frontend-react/src/app/components/Connect.tsx index 1398c4c77..cc5b89378 100644 --- a/packages/examples/sdk-frontend-react/src/app/components/Connect.tsx +++ b/packages/examples/sdk-frontend-react/src/app/components/Connect.tsx @@ -67,7 +67,7 @@ const Disconnect = styled(StyledButton)` background: rgb(226, 8, 128); `; -const ConnectButton = () => { +const ConnectButtonComp = () => { const { active, account, activate, deactivate, chainId } = useWeb3React(); async function connect() { @@ -121,4 +121,4 @@ const ConnectButton = () => { ); }; -export default ConnectButton; +export default ConnectButtonComp; diff --git a/packages/examples/sdk-frontend/pages/index.tsx b/packages/examples/sdk-frontend/pages/index.tsx index e95310d1b..936704b2c 100644 --- a/packages/examples/sdk-frontend/pages/index.tsx +++ b/packages/examples/sdk-frontend/pages/index.tsx @@ -1,4 +1,4 @@ -import { ConnectButton } from '@rainbow-me/rainbowkit'; +import { ConnectButtonComp } from '@rainbow-me/rainbowkit'; import { NextPage } from 'next'; import Link from 'next/link'; import styled from 'styled-components'; @@ -7,7 +7,7 @@ const Index: NextPage = () => { return (

Hello Next.js šŸ‘‹

- + diff --git a/packages/examples/sdk-frontend/pages/video.tsx b/packages/examples/sdk-frontend/pages/video.tsx index 05291f1d8..a44a90ac3 100644 --- a/packages/examples/sdk-frontend/pages/video.tsx +++ b/packages/examples/sdk-frontend/pages/video.tsx @@ -243,7 +243,7 @@ const Home: NextPage = () => { Video Call Status: {data.incoming[0].status} - + {isConnected ? ( diff --git a/packages/restapi/CHANGELOG.md b/packages/restapi/CHANGELOG.md index 7856279ae..393b1c1be 100644 --- a/packages/restapi/CHANGELOG.md +++ b/packages/restapi/CHANGELOG.md @@ -2,26 +2,530 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver). -## [1.4.11](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.4.10...restapi-1.4.11) (2023-08-18) +## [0.0.1-alpha.44](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.43...restapi-0.0.1-alpha.44) (2023-10-03) ### Bug Fixes -* merge main ([f53a5e2](https://github.com/ethereum-push-notification-service/push-sdk/commit/f53a5e279e3780566b4e2a9242b3555ef50fb4a6)) +* log removed ([68b38e9](https://github.com/ethereum-push-notification-service/push-sdk/commit/68b38e91a1afacb21baa0ee29f8967d86ce4b7f7)) +* minor fix ([c73b6cc](https://github.com/ethereum-push-notification-service/push-sdk/commit/c73b6ccfb510dfc38150a4207f806ccee7b44efb)) -## [1.4.10](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.4.9...restapi-1.4.10) (2023-08-18) +## [0.0.1-alpha.43](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.42...restapi-0.0.1-alpha.43) (2023-09-29) ### Bug Fixes -* add meta ([#643](https://github.com/ethereum-push-notification-service/push-sdk/issues/643)) ([06689e7](https://github.com/ethereum-push-notification-service/push-sdk/commit/06689e75b58dc93981302b7a5feff28f8486cb85)) -* added decryptedPGPPrivateKey in the returned response for client ([#650](https://github.com/ethereum-push-notification-service/push-sdk/issues/650)) ([16646b4](https://github.com/ethereum-push-notification-service/push-sdk/commit/16646b4e2f6792c2fb30c5e544012244e5b5a6fe)) +* Merge branch 'alpha' into alpha-deployment ([0bf9a2d](https://github.com/ethereum-push-notification-service/push-sdk/commit/0bf9a2d6e0e8ff19af34e5e53ee6e05f35bc0479)) + + + +## [0.0.1-alpha.42](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.41...restapi-0.0.1-alpha.42) (2023-09-29) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([6c3b91d](https://github.com/ethereum-push-notification-service/push-sdk/commit/6c3b91d79622e695808e38afb1e5dbdccab2f3eb)) + + + +## [0.0.1-alpha.41](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.40...restapi-0.0.1-alpha.41) (2023-09-29) + + +### Bug Fixes + +* minor fixes ([4338d18](https://github.com/ethereum-push-notification-service/push-sdk/commit/4338d18e07dbb51245331547442014eff2b54707)) + + + +## [0.0.1-alpha.40](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.39...restapi-0.0.1-alpha.40) (2023-09-29) + + +### Bug Fixes + +* minor fixes ([be3e90a](https://github.com/ethereum-push-notification-service/push-sdk/commit/be3e90ae43625eac56cc82548e150a6296a09777)) +* socket enabled ([fa4fc0a](https://github.com/ethereum-push-notification-service/push-sdk/commit/fa4fc0ae78898432232031df85a1ec04cc9027c8)) + + + +## [0.0.1-alpha.39](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.38...restapi-0.0.1-alpha.39) (2023-09-29) + + +### Bug Fixes + +* more fixes ([fe0ad48](https://github.com/ethereum-push-notification-service/push-sdk/commit/fe0ad486338d1cc57508e5ccc1c3b2aeece9624a)) + + + +## [0.0.1-alpha.38](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.37...restapi-0.0.1-alpha.38) (2023-09-29) + + +### Bug Fixes + +* error handling in socket events ([399d1fe](https://github.com/ethereum-push-notification-service/push-sdk/commit/399d1fe396ce19f764c9fc80dea3a3852216837a)) + + + +## [0.0.1-alpha.37](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.36...restapi-0.0.1-alpha.37) (2023-09-29) + + +### Bug Fixes + +* minor fixes ([12e3ca5](https://github.com/ethereum-push-notification-service/push-sdk/commit/12e3ca542aa11f7640ba5b84492707eb6e8bc3fc)) + + + +## [0.0.1-alpha.36](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.35...restapi-0.0.1-alpha.36) (2023-09-29) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([c4d2cff](https://github.com/ethereum-push-notification-service/push-sdk/commit/c4d2cff0d7ecf909ab9dd993f54ffa9f4ce9d7b4)) +* some changes on stream ([92a2202](https://github.com/ethereum-push-notification-service/push-sdk/commit/92a220264e15dad6636b1e7a34ca6f0871849b14)) +* stream cases ([3ca0496](https://github.com/ethereum-push-notification-service/push-sdk/commit/3ca0496396a9796568973376ee99e26b65f1abed)) + + + +## [0.0.1-alpha.35](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.34...restapi-0.0.1-alpha.35) (2023-09-29) + + +### Bug Fixes + +* added chat.decrypt ([#726](https://github.com/ethereum-push-notification-service/push-sdk/issues/726)) ([995042b](https://github.com/ethereum-push-notification-service/push-sdk/commit/995042b789b19d487b5e2953463cae60e75199b8)) +* error fixed ([99163b3](https://github.com/ethereum-push-notification-service/push-sdk/commit/99163b3338940dd9904630007868ca01faf4190c)) +* Merge branch 'alpha' into alpha-deployment ([be03539](https://github.com/ethereum-push-notification-service/push-sdk/commit/be035393a90a50ac2b9115b8f0a817a988f395f9)) +* Merge branch 'alpha' into alpha-deployment ([8d56ee8](https://github.com/ethereum-push-notification-service/push-sdk/commit/8d56ee882719a65391e7e51abfb0b7f86c2ae5ad)) +* Merge branch 'main' into alpha ([b6887db](https://github.com/ethereum-push-notification-service/push-sdk/commit/b6887db0aa76126a47efa6ec88fc9841d7c3ae06)) +* remove only from test ([09524c7](https://github.com/ethereum-push-notification-service/push-sdk/commit/09524c793ecdef095f90c54bc5895ca1c6adba01)) + + + +## [0.0.1-alpha.35](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.34...restapi-0.0.1-alpha.35) (2023-09-28) + + +### Bug Fixes + +* added chat.decrypt ([#726](https://github.com/ethereum-push-notification-service/push-sdk/issues/726)) ([995042b](https://github.com/ethereum-push-notification-service/push-sdk/commit/995042b789b19d487b5e2953463cae60e75199b8)) +* error fixed ([99163b3](https://github.com/ethereum-push-notification-service/push-sdk/commit/99163b3338940dd9904630007868ca01faf4190c)) +* Merge branch 'alpha' into alpha-deployment ([be03539](https://github.com/ethereum-push-notification-service/push-sdk/commit/be035393a90a50ac2b9115b8f0a817a988f395f9)) +* Merge branch 'alpha' into alpha-deployment ([8d56ee8](https://github.com/ethereum-push-notification-service/push-sdk/commit/8d56ee882719a65391e7e51abfb0b7f86c2ae5ad)) +* Merge branch 'main' into alpha ([b6887db](https://github.com/ethereum-push-notification-service/push-sdk/commit/b6887db0aa76126a47efa6ec88fc9841d7c3ae06)) +* remove only from test ([09524c7](https://github.com/ethereum-push-notification-service/push-sdk/commit/09524c793ecdef095f90c54bc5895ca1c6adba01)) + + + +## [0.0.1-alpha.34](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.33...restapi-0.0.1-alpha.34) (2023-09-27) + + +### Bug Fixes + +* added class based implementation for notification ([#699](https://github.com/ethereum-push-notification-service/push-sdk/issues/699)) ([44f0b7b](https://github.com/ethereum-push-notification-service/push-sdk/commit/44f0b7be1fb568c90c4dfebb7dc61ab82efaddc2)) +* changed typescript 5.0.2 and configured eslint ([8ca7e42](https://github.com/ethereum-push-notification-service/push-sdk/commit/8ca7e4203bcc06886dfe293f8aec5597aec60e5b)) + + + +## [0.0.1-alpha.33](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.4.19...restapi-0.0.1-alpha.33) (2023-09-07) + + +### Bug Fixes + +* merge alpha ([1783d45](https://github.com/ethereum-push-notification-service/push-sdk/commit/1783d45bb3ceab1cce3c6bb19dfbda38c3662a3e)) +* Merge branch 'alpha' into alpha-deployment ([84aaadf](https://github.com/ethereum-push-notification-service/push-sdk/commit/84aaadfb19e335e5806086fba2ad5e94c1bf3b7e)) +* merge main ([5f37942](https://github.com/ethereum-push-notification-service/push-sdk/commit/5f379427e8a517089758de776eab9f2409aa61f8)) +* merge main ([44e0d32](https://github.com/ethereum-push-notification-service/push-sdk/commit/44e0d324af1d4605129a5e129d3ab6481313c00c)) +* merge main ([9efdbe8](https://github.com/ethereum-push-notification-service/push-sdk/commit/9efdbe8c6f86eeb859075af493797575728cf902)) +* merge main ([93e3106](https://github.com/ethereum-push-notification-service/push-sdk/commit/93e31068bc48e9a271c376d2610e503f69499f8b)) + + + +## [0.0.1-alpha.32](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.31...restapi-0.0.1-alpha.32) (2023-08-17) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([8dd925c](https://github.com/ethereum-push-notification-service/push-sdk/commit/8dd925cd5e0a134e07735b5a3ef7382f4b1909de)) +* Read me fixes ([7c02c3a](https://github.com/ethereum-push-notification-service/push-sdk/commit/7c02c3adef593b59bde6c8dd4d23b760e99a5416)) +* Space rules ([2181074](https://github.com/ethereum-push-notification-service/push-sdk/commit/2181074811549a0c70aea189bc82a1acf1944ba1)) + + + +## [0.0.1-alpha.31](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.30...restapi-0.0.1-alpha.31) (2023-08-16) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([a4c170e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a4c170edd7766c843412bd83f6ef7e5a9ab70247)) + + + +## [0.0.1-alpha.30](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.4.9...restapi-0.0.1-alpha.30) (2023-08-15) + + +### Bug Fixes + +* fixed subscribe and unsubscribe ([3f908a0](https://github.com/ethereum-push-notification-service/push-sdk/commit/3f908a02ce7faee703340e17f6441f3ebe88fd58)) +* Merge branch 'alpha' into alpha-deployment ([984a80f](https://github.com/ethereum-push-notification-service/push-sdk/commit/984a80f178abc220a0243a5fce00413d4dd0aadb)) +* merge main ([f338fd4](https://github.com/ethereum-push-notification-service/push-sdk/commit/f338fd49707933c65bdcc7736cdd08d6784625ba)) +* **merged:** merged ([bb71789](https://github.com/ethereum-push-notification-service/push-sdk/commit/bb717897cec1e7d46d86be05b1d29ca9103272c5)) + + + +## [0.0.1-alpha.29](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.28...restapi-0.0.1-alpha.29) (2023-08-02) + + +### Bug Fixes + +* url correction ([26b6b73](https://github.com/ethereum-push-notification-service/push-sdk/commit/26b6b739d8b6b8a38ae10ae87270ca4d8782db51)) + + + +## [0.0.1-alpha.28](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.4.4...restapi-0.0.1-alpha.28) (2023-08-02) + + +### Bug Fixes + +* add: scw sig verification ([#593](https://github.com/ethereum-push-notification-service/push-sdk/issues/593)) ([6768065](https://github.com/ethereum-push-notification-service/push-sdk/commit/67680657981a847e23a4dbad6d2fd6a7bc127743)) +* Merge branch 'alpha' into alpha-deployment ([6c19940](https://github.com/ethereum-push-notification-service/push-sdk/commit/6c19940b4d72d9443b8afd06ddc2a6f9e29582a7)) +* merged main ([c5533f8](https://github.com/ethereum-push-notification-service/push-sdk/commit/c5533f8dce7b88cb1f14aa72f83579a8e01dcf36)) + + + +## [0.0.1-alpha.27](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.4.3...restapi-0.0.1-alpha.27) (2023-07-24) + + +### Bug Fixes + +* merge alpha ([16a55af](https://github.com/ethereum-push-notification-service/push-sdk/commit/16a55af713da0394ab9d82e13fed6d64190b247d)) +* Merge branch 'alpha' into alpha-deployment ([6ea669a](https://github.com/ethereum-push-notification-service/push-sdk/commit/6ea669a5aa3cebe693de259c1ea28787c0407d2a)) +* signer compatibility with viem ([3df201c](https://github.com/ethereum-push-notification-service/push-sdk/commit/3df201c7474b88d270d6e868bc516f223539e74c)) + + + +## [0.0.1-alpha.26](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.4.2...restapi-0.0.1-alpha.26) (2023-07-21) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([3f3369a](https://github.com/ethereum-push-notification-service/push-sdk/commit/3f3369a1bda71a82cde8ef386901265a62a91a2c)) +* merge main ([c07ce16](https://github.com/ethereum-push-notification-service/push-sdk/commit/c07ce1628321dd3bae46d08e08bfc7986795bb64)) +* signer compatibility with viem and ethers ([1edea43](https://github.com/ethereum-push-notification-service/push-sdk/commit/1edea431ccf7f19cc0430deb2ce7a5c61390d99f)) +* signer compatibility with viem and ethers ([#567](https://github.com/ethereum-push-notification-service/push-sdk/issues/567)) ([c07c3fa](https://github.com/ethereum-push-notification-service/push-sdk/commit/c07c3fab76a095998b1eac830c941116ad1e9b4f)) +* space feed API path fix ([00d91b1](https://github.com/ethereum-push-notification-service/push-sdk/commit/00d91b1860525c15618f130970c9173100424a23)) +* use SpaceIFeeds ([5b7f2fc](https://github.com/ethereum-push-notification-service/push-sdk/commit/5b7f2fc2398a2203925059aa2721e855ea9f98d4)) + + + +## [0.0.1-alpha.25](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.4.1...restapi-0.0.1-alpha.25) (2023-07-19) + + +### Bug Fixes + +* fixed merge conflicts ([dfab492](https://github.com/ethereum-push-notification-service/push-sdk/commit/dfab492127e821219c5fd5dc08ed08a172bee31b)) +* Merge branch 'alpha' into alpha-deployment ([a71302b](https://github.com/ethereum-push-notification-service/push-sdk/commit/a71302b4a5066cb9d00ca5d14e55228c558eda85)) +* Merge branch 'main' into alpha-deployment ([fe93d43](https://github.com/ethereum-push-notification-service/push-sdk/commit/fe93d43a103d5067b16d8f7a5d01835be1d1f40a)) +* renamed spaces variables and removed some unused variables ([3519d39](https://github.com/ethereum-push-notification-service/push-sdk/commit/3519d3982be389711f48891896478b7a35a71b73)) +* space api ([064e10d](https://github.com/ethereum-push-notification-service/push-sdk/commit/064e10d9c66ab1d39f799fd64a39652862b2f074)) + + + +## [0.0.1-alpha.24](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.23...restapi-0.0.1-alpha.24) (2023-07-14) + + +### Bug Fixes + +* rename chats to spaces ([899eb21](https://github.com/ethereum-push-notification-service/push-sdk/commit/899eb212af29e3a65541686d98927e37b97927c5)) + + + +## [0.0.1-alpha.23](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.22...restapi-0.0.1-alpha.23) (2023-07-12) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([b120e30](https://github.com/ethereum-push-notification-service/push-sdk/commit/b120e302f6b9f8e360b43f80dcdd3248c1e4304b)) +* Merge branch 'alpha' into alpha-deployment ([54c5721](https://github.com/ethereum-push-notification-service/push-sdk/commit/54c57219c7f3f198a3f7578a0720895aff2d27f4)) +* Merge branch 'main' into alpha ([7b316ec](https://github.com/ethereum-push-notification-service/push-sdk/commit/7b316ec8e6f3178c02e7fce6d27884ba8ef1b4f4)) +* Merge branch 'main' into alpha ([d66202d](https://github.com/ethereum-push-notification-service/push-sdk/commit/d66202d0798b9ec731d7f5d30031b89ae29d72b4)) + + + +## [0.0.1-alpha.22](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.21...restapi-0.0.1-alpha.22) (2023-07-07) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([5c84e2f](https://github.com/ethereum-push-notification-service/push-sdk/commit/5c84e2f07667fe4e9d94561544807b11c103ac49)) +* merged maain ([942cc65](https://github.com/ethereum-push-notification-service/push-sdk/commit/942cc65a60aa043054cebb143990711fb6e2efdb)) + + + +## [0.0.1-alpha.21](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.20...restapi-0.0.1-alpha.21) (2023-07-07) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([c05d024](https://github.com/ethereum-push-notification-service/push-sdk/commit/c05d024415bb1cb9e1fe59714d7db5516d161c06)) +* merged main ([46cf04e](https://github.com/ethereum-push-notification-service/push-sdk/commit/46cf04e75c314065c77a5a77d9351d9ccc7e0a58)) +* spaces naming ([6db7fc0](https://github.com/ethereum-push-notification-service/push-sdk/commit/6db7fc09b680060f022040feb2a22aeed9c652d0)) + + + +## [0.0.1-alpha.20](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.19...restapi-0.0.1-alpha.20) (2023-07-03) + + +### Bug Fixes + +* new commit ([25f2725](https://github.com/ethereum-push-notification-service/push-sdk/commit/25f2725efb0e1017ee2a0460259b27f252471014)) + + + +## [0.0.1-alpha.19](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.3.9...restapi-0.0.1-alpha.19) (2023-07-03) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([a15e368](https://github.com/ethereum-push-notification-service/push-sdk/commit/a15e368241215e2e2219792afd718567d621bf2a)) +* merge main ([6998d35](https://github.com/ethereum-push-notification-service/push-sdk/commit/6998d35aa181f17a5ad8d9501943a6a867814650)) +* rename based on new convention ([0e34479](https://github.com/ethereum-push-notification-service/push-sdk/commit/0e34479b1581abd59e0f853d6547e23a0afb5e28)) + + + +## [0.0.1-alpha.18](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.3.8...restapi-0.0.1-alpha.18) (2023-06-20) + + +### Bug Fixes + +* add name to SpaceIFeeds ([9c22271](https://github.com/ethereum-push-notification-service/push-sdk/commit/9c222715d0f15ae912b90661f9d18d42bddc4c89)) +* Merge branch 'alpha' into alpha-deployment ([b521522](https://github.com/ethereum-push-notification-service/push-sdk/commit/b521522c3b147b789a03b2683da4b6cefac795fe)) +* Merge branch 'main' into alpha ([64de06f](https://github.com/ethereum-push-notification-service/push-sdk/commit/64de06fc3cfd4359cf0d7fb70212e775ce9e51b9)) +* merge main ([27105a2](https://github.com/ethereum-push-notification-service/push-sdk/commit/27105a247fe4bd4db78a41be06ef6a2d52fb6b21)) +* update path ([10d62b1](https://github.com/ethereum-push-notification-service/push-sdk/commit/10d62b1a017b3d0a5044a4ab33bdce183f795f51)) + + + +## [0.0.1-alpha.17](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.3.5...restapi-0.0.1-alpha.17) (2023-06-08) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([a9d8ff1](https://github.com/ethereum-push-notification-service/push-sdk/commit/a9d8ff18bcad950e40b966e5b4020e29b493aa28)) +* merge main ([78c020a](https://github.com/ethereum-push-notification-service/push-sdk/commit/78c020ac61decc2d3b78d3749c8ec5df7478842f)) +* **video:** fix error on repeated acceptRequest calls ([#442](https://github.com/ethereum-push-notification-service/push-sdk/issues/442)) ([f34bfa0](https://github.com/ethereum-push-notification-service/push-sdk/commit/f34bfa09cf88e812e07c0dcf7fabf792726c577f)) + + + +## [0.0.1-alpha.16](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.3.3...restapi-0.0.1-alpha.16) (2023-06-02) + + +### Bug Fixes + +* add spaces for functions ([#307](https://github.com/ethereum-push-notification-service/push-sdk/issues/307)) ([aea015a](https://github.com/ethereum-push-notification-service/push-sdk/commit/aea015ae478da77ebaa41a4e111ac213027b0b6a)) +* Merge branch 'alpha' into alpha-deployment ([ad6a56b](https://github.com/ethereum-push-notification-service/push-sdk/commit/ad6a56be24c326b7fb1f6eddb01b20b489eee27d)) +* merge main ([3959345](https://github.com/ethereum-push-notification-service/push-sdk/commit/39593456140e152e53f4bd7c10a19e0d8f05dfc9)) + + + +## [0.0.1-alpha.15](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.3.2...restapi-0.0.1-alpha.15) (2023-05-29) + + +### Bug Fixes + +* fix nft videocall ([#411](https://github.com/ethereum-push-notification-service/push-sdk/issues/411)) ([8cdb999](https://github.com/ethereum-push-notification-service/push-sdk/commit/8cdb999bc548caf67ec6fbe625253b5795a4e465)) +* Iuser structure changed ([#365](https://github.com/ethereum-push-notification-service/push-sdk/issues/365)) ([2fc6f54](https://github.com/ethereum-push-notification-service/push-sdk/commit/2fc6f549c80a65a5a6009b0c2fa9635d757bdf11)), closes [#390](https://github.com/ethereum-push-notification-service/push-sdk/issues/390) [#295](https://github.com/ethereum-push-notification-service/push-sdk/issues/295) +* Merge branch 'alpha' into alpha-deployment ([a66c9a4](https://github.com/ethereum-push-notification-service/push-sdk/commit/a66c9a4a3628700a450b8e2fb7a5f942d1d84095)) +* Merge branch 'alpha' into alpha-deployment ([f247665](https://github.com/ethereum-push-notification-service/push-sdk/commit/f2476650b650ade59721c30f6e8483e86c013cd4)) +* merged main to alpha ([067bc5d](https://github.com/ethereum-push-notification-service/push-sdk/commit/067bc5d358c5f218628a980ce23ab3b39615805f)) + + + +## [0.0.1-alpha.13](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.12...restapi-0.0.1-alpha.13) (2023-05-19) + + +### Bug Fixes + +* backward compatiblity fix ([fbf2463](https://github.com/ethereum-push-notification-service/push-sdk/commit/fbf246396a44513626fc1dda6e90c12d2f073ead)) +* Merge branch 'alpha' into alpha-deployment ([3b5a0f1](https://github.com/ethereum-push-notification-service/push-sdk/commit/3b5a0f160b72e775cf17031067fa7488171e1bbd)) + + + +## [0.0.1-alpha.12](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.11...restapi-0.0.1-alpha.12) (2023-05-19) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([963cc02](https://github.com/ethereum-push-notification-service/push-sdk/commit/963cc02768862b6a9427519257ff9f9565f613ea)) +* **video:** fix enableAudio ([85ef733](https://github.com/ethereum-push-notification-service/push-sdk/commit/85ef733127bdfbae5c66c671ddc7700785d192c0)) + + + +## [0.0.1-alpha.11](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.10...restapi-0.0.1-alpha.11) (2023-05-19) + + +### Bug Fixes + +* added enums ([f1880d8](https://github.com/ethereum-push-notification-service/push-sdk/commit/f1880d8f037fc640851af4311bd5e514de5cf3db)) +* changed additionalMeta structure ([#406](https://github.com/ethereum-push-notification-service/push-sdk/issues/406)) ([0cf573e](https://github.com/ethereum-push-notification-service/push-sdk/commit/0cf573e56165bf3164a42cbc4b41a3085801e90a)) +* fix versions ([05c8fa9](https://github.com/ethereum-push-notification-service/push-sdk/commit/05c8fa9f9286e78d706c6be53e7b8ae963105766)) +* Merge branch 'alpha' into alpha-deployment ([68f11eb](https://github.com/ethereum-push-notification-service/push-sdk/commit/68f11eb71d44423081000c00c36cb0a936558f2f)) +* Merge branch 'alpha' into alpha-deployment ([3700515](https://github.com/ethereum-push-notification-service/push-sdk/commit/3700515be010fdcab6062db0a039f7df612a7a6b)) +* Merge branch 'alpha' into alpha-deployment ([925b437](https://github.com/ethereum-push-notification-service/push-sdk/commit/925b4379aa7b7d2d061b23d5ccbc42d06829f100)) +* **sendvideonotifications:** modify additional meta acc to new std ([#407](https://github.com/ethereum-push-notification-service/push-sdk/issues/407)) ([9d2124a](https://github.com/ethereum-push-notification-service/push-sdk/commit/9d2124aa61f798a0b137636aac62397e1e52150e)) +* **types:** remove bad import ([5517200](https://github.com/ethereum-push-notification-service/push-sdk/commit/55172002a2cecb33407a3828c2debeca24e0c972)) +* **video:** remove stop audio/video logic from create function ([#404](https://github.com/ethereum-push-notification-service/push-sdk/issues/404)) ([983c896](https://github.com/ethereum-push-notification-service/push-sdk/commit/983c896a2c89463f117f5a4d8153ef95501f2124)) + + +### Reverts + +* **getverificationproof:** add wallet and env params to getVerificationProof ([#403](https://github.com/ethereum-push-notification-service/push-sdk/issues/403)) ([26f6fcb](https://github.com/ethereum-push-notification-service/push-sdk/commit/26f6fcb9b2992850cd33ea613cea13830bd48bc3)) + + + +## [0.0.1-alpha.10](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.9...restapi-0.0.1-alpha.10) (2023-05-17) + + +### Bug Fixes + +* added deprecated info to history ([#399](https://github.com/ethereum-push-notification-service/push-sdk/issues/399)) ([eda1a34](https://github.com/ethereum-push-notification-service/push-sdk/commit/eda1a345975141c5656891dbf919aacd2924d66b)) +* Merge branch 'alpha' into alpha-deployment ([46ebed2](https://github.com/ethereum-push-notification-service/push-sdk/commit/46ebed2b9d4b4ff0518429a091d0a37b1d3f022d)) + + + +## [0.0.1-alpha.9](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.8...restapi-0.0.1-alpha.9) (2023-05-16) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([469398d](https://github.com/ethereum-push-notification-service/push-sdk/commit/469398dc94df805257d6a6bb8e0707cebc5f7d8a)) +* **video:** turn off trickle while creating peer instance ([#398](https://github.com/ethereum-push-notification-service/push-sdk/issues/398)) ([ae5b38e](https://github.com/ethereum-push-notification-service/push-sdk/commit/ae5b38e702539eaf92a516b4e557c5a88de0f4c7)) + + + +## [0.0.1-alpha.8](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.7...restapi-0.0.1-alpha.8) (2023-05-16) + + +### Bug Fixes + +* 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)) +* **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)) + + + +## [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)) + + + +## [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-1.2.15...restapi-0.0.1-alpha.4) (2023-05-12) + + +### Bug Fixes + +* 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)) + + + +## [0.0.1-alpha.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.2.13...restapi-0.0.1-alpha.2) (2023-05-10) + + +### Bug Fixes + +* 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)) + + + +## [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)) +* 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-alpha.32](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.31...restapi-0.0.1-alpha.32) (2023-08-17) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([8dd925c](https://github.com/ethereum-push-notification-service/push-sdk/commit/8dd925cd5e0a134e07735b5a3ef7382f4b1909de)) +* Read me fixes ([7c02c3a](https://github.com/ethereum-push-notification-service/push-sdk/commit/7c02c3adef593b59bde6c8dd4d23b760e99a5416)) +* Space rules ([2181074](https://github.com/ethereum-push-notification-service/push-sdk/commit/2181074811549a0c70aea189bc82a1acf1944ba1)) + + + +## [0.0.1-alpha.31](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.30...restapi-0.0.1-alpha.31) (2023-08-16) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([a4c170e](https://github.com/ethereum-push-notification-service/push-sdk/commit/a4c170edd7766c843412bd83f6ef7e5a9ab70247)) + + + +## [0.0.1-alpha.30](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.29...restapi-0.0.1-alpha.30) (2023-08-15) + + +### Bug Fixes + +* added Reaction MessageType ([#633](https://github.com/ethereum-push-notification-service/push-sdk/issues/633)) ([2856ece](https://github.com/ethereum-push-notification-service/push-sdk/commit/2856ece83e0a42335ff7e5e2f8db83d2aa7fd007)) +* allow to create empty groups just with group creator. ([#607](https://github.com/ethereum-push-notification-service/push-sdk/issues/607)) ([7d14e24](https://github.com/ethereum-push-notification-service/push-sdk/commit/7d14e248626422cf079e4b99dbdfa3ce6cd796da)) +* CreateUserPropsWithProfile ([#612](https://github.com/ethereum-push-notification-service/push-sdk/issues/612)) ([32125b5](https://github.com/ethereum-push-notification-service/push-sdk/commit/32125b5408b45e8a51ba9a16acc1250fc56decae)) +* deprecation notice ([#581](https://github.com/ethereum-push-notification-service/push-sdk/issues/581)) ([6cd4b1e](https://github.com/ethereum-push-notification-service/push-sdk/commit/6cd4b1ea8626849a5f78588a21ac66db2bd293df)) +* fixed subscribe and unsubscribe ([3f908a0](https://github.com/ethereum-push-notification-service/push-sdk/commit/3f908a02ce7faee703340e17f6441f3ebe88fd58)) +* Merge branch 'alpha' into alpha-deployment ([984a80f](https://github.com/ethereum-push-notification-service/push-sdk/commit/984a80f178abc220a0243a5fce00413d4dd0aadb)) +* merge main ([f338fd4](https://github.com/ethereum-push-notification-service/push-sdk/commit/f338fd49707933c65bdcc7736cdd08d6784625ba)) +* **merged:** merged ([bb71789](https://github.com/ethereum-push-notification-service/push-sdk/commit/bb717897cec1e7d46d86be05b1d29ca9103272c5)) +* **sdk-frontend:** comment out spaces UI to remove build issues ([#618](https://github.com/ethereum-push-notification-service/push-sdk/issues/618)) ([769c20d](https://github.com/ethereum-push-notification-service/push-sdk/commit/769c20d5eb42b758277e57699793b8e76deeab94)) -## [1.4.9](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-1.4.8...restapi-1.4.9) (2023-08-11) ## [0.0.1-alpha.29](https://github.com/ethereum-push-notification-service/push-sdk/compare/restapi-0.0.1-alpha.28...restapi-0.0.1-alpha.29) (2023-08-02) diff --git a/packages/restapi/PushChatLowLevelAPI.md b/packages/restapi/PushChatLowLevelAPI.md index 1cd735442..5ead9ebde 100644 --- a/packages/restapi/PushChatLowLevelAPI.md +++ b/packages/restapi/PushChatLowLevelAPI.md @@ -1681,7 +1681,7 @@ const response = await PushAPI.chat.createGroup({ groupImage: <group image link> , admins: ['0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'], rules: { - 'groupAccess': { + 'entry': { 'conditions': [ { 'any': [ @@ -1717,7 +1717,7 @@ const response = await PushAPI.chat.createGroup({ } ] }, - 'chatAccess': { + 'chat': { 'conditions': [ { 'all': [ @@ -1803,10 +1803,10 @@ export type Condition = ConditionBase & { }; export interface Rules { - groupAccess?: { + entry?: { conditions: Array; }; - chatAccess?: { + chat?: { conditions: Array; }; } @@ -1814,7 +1814,7 @@ export interface Rules { #### Rules Object Description -The rules object consists of two main sections: `groupAccess` and `chatAccess`, both of which contain conditions to manage access and permissions within a chat application. These conditions may involve different criteria related to token holdings or guild membership. +The rules object consists of two main sections: `entry` and `chat`, both of which contain conditions to manage access and permissions within a chat application. These conditions may involve different criteria related to token holdings or guild membership. #### Conditions @@ -1995,7 +1995,7 @@ This structure governs user permissions within a guild. The subcategory dictates groupCreator: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a', chatId: '0364908cbaef95a5a3124c394ada868177c158a4d677cedd6fd1e42db1852386', rules: { - 'groupAccess': { + 'entry': { 'conditions': [ { 'any': [ @@ -2030,7 +2030,7 @@ This structure governs user permissions within a guild. The subcategory dictates } ] }, - 'chatAccess': { + 'chat': { 'conditions': [ { 'all': [ @@ -2100,10 +2100,10 @@ Allowed Options (params with \_ are mandatory) ```typescript // PushAPI_chat_getGroupAccess | Response - 200 OK { - 'groupAccess': true, - 'chatAccess': false, + 'entry': true, + 'chat': false, 'rules': { - 'groupAccess': { + 'entry': { 'conditions': [ { 'any': [ @@ -2142,7 +2142,7 @@ Allowed Options (params with \_ are mandatory) } ] }, - 'chatAccess': { + 'chat': { 'conditions': [ { 'all': [ @@ -2227,7 +2227,7 @@ const response = await PushAPI.chat.updateGroup({ groupImage: <group image link> , admins: ['0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'], rules: { - 'groupAccess': { + 'entry': { 'conditions': [ { 'any': [ @@ -2254,7 +2254,7 @@ const response = await PushAPI.chat.updateGroup({ } ] }, - 'chatAccess': { + 'chat': { 'conditions': [ { 'all': [ @@ -2431,7 +2431,7 @@ Allowed Options (params with _ are mandatory) groupCreator: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a', chatId: '870cbb20f0b116d5e461a154dc723dc1485976e97f61a673259698aa7f48371c', rules: { - 'groupAccess': { + 'entry': { 'conditions': [ { 'any': [ @@ -2458,7 +2458,7 @@ Allowed Options (params with _ are mandatory) } ] }, - 'chatAccess': { + 'chat': { 'conditions': [ { 'all': [ diff --git a/packages/restapi/README.md b/packages/restapi/README.md index 8b2e45470..1c51666e1 100644 --- a/packages/restapi/README.md +++ b/packages/restapi/README.md @@ -2123,10 +2123,10 @@ export type Condition = ConditionBase & { }; export interface Rules { - groupAccess?: { + entry?: { conditions: Array; }; - chatAccess?: { + chat?: { conditions: Array; }; } @@ -2376,7 +2376,7 @@ const response = await PushAPI.space.update({ scheduleEnd: '2023-07-15T15:48:00.000Z', status: PushAPI.ChatStatus.PENDING, rules: { - 'groupAccess': { + 'entry': { 'conditions': [ { 'any': [ @@ -2402,7 +2402,7 @@ const response = await PushAPI.space.update({ } ] }, - 'chatAccess': { + 'chat': { 'conditions': [ { 'all': [ @@ -6462,3 +6462,335 @@ const aliceUpdateEncryption = await userAlice.encryption.update( --- + + +### **Fetch Inbox /Spam notifications** + +```tsx +// lists feeds +const aliceInfo = await userAlice.notification.list(); + +``` + +**Parameters:** + +| Parameter | Type | Default | Description | +| --- | --- | --- | --- | +| spam | INBOX or SPAM | INBOX | A string representing the type of feed to retrieve. | +| options* | object | - | An object containing additional options for filtering and pagination. | +| options.account* | string | - | Account in full CAIP | +| options.channels* | [string] | - | An array of channels to filter feeds by. | +| options.page* | number | - | A number representing the page of results to retrieve. | +| options.limit* | number | - | A number representing the maximum number of feeds to retrieve per page. | +| options.raw* | boolean | - | A boolean indicating whether to retrieve raw feed data. | + +\* - Optional + +--- + +### **Fetch user subscriptions** + +```tsx +// fetches list of channels to which the user is subscribed +const subscriptions = await userAlice.notification.subscriptions(); + +``` + +**Parameters:** + +| Parameter | Type | Default | Description | +| --- | --- | --- | --- | +| options* | object | - | An object containing additional options for subscriptions. | +| options.account* | string | - | Account in CAIP . | +| options.page* | number | - | page of results to retrieve. | +| options.limit* | number | - | represents the maximum number of subscriptions to retrieve per page. | + +\* - Optional + +--- + +### **Subscribe to a channel** + +```tsx +// subscribes to a channel +const subscribeStatus = await userAlice.notification.subscribe(channelInCAIP) + +``` + +**Parameters:** + +| Parameter | Type | Default | Description | +| --- | --- | --- | --- | +| channel | string | - | Channel/Alias address in CAIP format | +| options* | SubscribeUnsubscribeOptions | - | Optional configuration | +| options.onSuccess* | () => void | - | A callback function to execute when the subscription is successful. | +| options.onError* | (err: Error) => void | - | A callback function to execute when an error occurs during subscription. | + +\* - Optional + +--- + +### **Unsubscribe to a channel** + +```tsx +// unsubscribes to the channel +const unsubscribeStatus = await userAlice.notification.unsubscribe(channelInCAIP) + +``` + +**Parameters:** + +| Parameter | Type | Default | Description | +| --- | --- | --- | --- | +| channel | string | - | Channel/Alias address in CAIP format | +| options* | SubscribeUnsubscribeOptions | - | Optional configuration | +| options.onSuccess* | () => void | - | A callback function to execute when the unsubscription is successful. | +| options.onError* | (err: Error) => void | - | A callback function to execute when an error occurs during unsubscription. | + +\* - Optional + +--- + +### **Channel information** + +```tsx +// fetches information about the channel +const channelInfo = await userAlice.channel.info(pushChannelInCAIP) + +``` + +**Parameters:** + +| Parameter | Type | Default | Description | +| --- | --- | --- | --- | +| channel* | string | - | Channel address in CAIP format | + +\* - Optional + +--- + +### **Search Channels** + +```tsx +// returns channel matching the query +const searchResult = await userAlice.channel.search("push") + +``` + +**Parameters:** + +| Parameter | Type | Default | Description | +| --- | --- | --- | --- | +| query | string | - | The search query to find channels. | +| options* | ChannelSearchOptions | - | Configuration options for the search. | +| options.page* | number | - | The page of results to retrieve. Default is set to 1 | +| options.limit* | number | - | The maximum number of channels to retrieve per page. Default is set to 10 | + +\* - Optional + +### **Get a channel's subscribers** + +```tsx +// fetches subscribers of a channel +const subscribersResult = await userAlice.channel.subscribers() + +``` + +**Parameters:** + +| Parameter | Type | Default | Description | +| --- | --- | --- | --- | +| options* | ChannelInfoOptions | - | Configuration options for retrieving subscribers. | +| options.channel* | string | - | Channel address in CAIP | + +\* - Optional + +### **Send a notification** + +```tsx +// sends a notification +const sendNotifRes = await userAlice.channel.send(['*'], {notification: {title: 'test',body: 'test',},}) + +``` + +**Parameters:** + +| Parameter | Type | Default | Description | +| --- | --- | --- | --- | +| recipients | string[] | - | An array of recipient addresses. Possible values are: Broadcast -> [*], Targeted -> [0xA], Subset -> [0xA, 0xB] | +| options | NotificationOptions | - | Configuration options for sending notifications. | +| options.notification | INotification | - | An object containing the notification's title and body. (Mandatory) | +| options.payload* | IPayload | - | An object containing additional payload information for the notification. | +| options.payload.title* | string | - | The title for the notification. If not provided, it is taken from notification.title. | +| options.payload.body* | string | - | The body of the notification. If not provided, it is taken from notification.body. | +| options.payload.cta* | string | - | Call to action for the notification. | +| options.payload.embed | string | - | Media information like image/video links | +| options.payload.meta* | { domain?: string, type: string, data: string } | - | Metadata for the notification, including domain, type, and data. | +| options.config* | IConfig | - | An object containing configuration options for the notification. | +| options.config.expiry* | number | - | Expiry time for the notification in seconds | +| options.config.silent* | boolean | - | Indicates whether the notification is silent. | +| options.config.hidden* | boolean | - | Indicates whether the notification is hidden. | +| options.advanced* | IAdvance | - | An object containing advanced options for the notification. | +| options.advanced.graph* | { id: string, counter: number } | - | Advanced options related to the graph based notification. | +| options.advanced.ipfs* | string | - | IPFS information for the notification. | +| options.advanced.minimal* | string | - | Minimal Payload type notification. | +| options.advanced.chatid* | string | - | For chat based notification. | +| options.advanced.pgpPrivateKey* | string | - | PGP private key for chat based notification. | +| options.channel* | string | - | Channel address in CAIP. Mostly used when a delegator sends a notification on behalf of the channel | + +\* - Optional + +--- + +### **Create a channel** + +```tsx +// creates a channel +const createChannelRes = await userAlice.channel.create({name: channelName, description: channelDescription, url: channelURL, icon: base64FormatImage, alias?: aliasAddressInCAIP}) + +``` + +**Parameters:** + +| Parameter | Type | Default | Description | +| --- | --- | --- | --- | +| options | CreateChannelOptions | - | Configuration options for creating a channel. | +| options.name | string | - | The name of the channel. | +| options.description | string | - | A description of the channel. | +| options.icon | string (base64 encoded) | - | The channel's icon in base64 encoded string format. | +| options.url | string | - | The URL associated with the channel. | +| options.alias* | string | - | alias address in CAIP | +| options.progresshook* | () => void | - | (Optional) A callback function to execute when the channel creation progresses. | + +**Note**: Support for contract interaction via `viem` is coming soon +\* - Optional + +--- + +### **Update a channel's information** + +```tsx +// updates channel info +const updateChannelRes = await userAlice.channel.update({name: newChannelName, description: newChannelDescription, url: newChannelURL, icon: newBase64FormatImage, alias?: newAliasAddressInCAIP}) + +``` + +**Parameters:** + +| Parameter | Type | Default | Description | +| --- | --- | --- | --- | +| options | - | - | Configuration options for creating a channel. | +| options.name | string | - | New name of the channel. | +| options.description | string | - | New description of the channel. | +| options.icon | string (base64 encoded) | - | The channel's new icon in base64 encoded string format. | +| options.url | string | - | New URL associated with the channel. | +| options.alias* | string | - | New alias address in CAIP | +| options.progresshook* | () => void | - | A callback function to execute when the channel updation progresses. | +| Note: Support for contract interaction via viem is coming soon | | | | + +\* - Optional + +--- + +### **Verify a channel** + +```tsx +const verifyChannelRes = await userAlice.channel.verify(channelToBeVerified) + +``` + +**Parameters:** + +| Parameter | Type | Default | Description | +| --- | --- | --- | --- | +| channelToBeVerified | string | - | Channel address in CAIP to be verified | + +--- + +### **Create channel Setting** + +```tsx +// creates channel settings +const createChannelSettingRes = userAlice.channel.settings([{ type: 0, default: 1, description: 'marketing' }, {type: 2, default: 10, description: 'loan liquidation threshold', data: {upper: 100, lower: 5}}]) + +``` + +**Parameters:** + +| Property | Type | Default | Description | +| --- | --- | --- | --- | +| type | number | - | The type of notification setting. 1 for boolean type and 2 for slider type | +| default | number | - | The default value for the setting. | +| description | string | - | A description of the setting. | +| data.upper* | number | - | Valid for slider type only. The upper limit for the setting. | +| data.lower* | number | - | Valid for slider type only. The lower limit for the setting. | +| Note: Support for contract interaction via viem is coming soon | | | | +| \* - Optional | | | | + +--- + +### **Get delegators information** + +```tsx +// fetch delegate information +const delegatorsInfo = userAlice.channel.delegate.get() + +``` + +**Parameters:** + +| Parameter | Type | Default | Description | +| --- | --- | --- | --- | +| options* | ChannelInfoOptions | - | Configuration options for retrieving delegator information. | +| options.channel* | string | - | channel address in CAIP | +| \* - Optional | | | | + +--- + +### **Add delegator to a channel/alias** + +```tsx +// adds a delegate +const addDelegatorRes = userAlice.channel.delegate.add(delegatorAddressInCAIP) + +``` + +**Parameters:** + +| Parameter | Type | Default | Description | +| --- | --- | --- | --- | +| delegate | string | - | delegator address in CAIP | +| Note: Support for contract interaction via viem is coming soon | | | | + +--- + +### **Remove delegator from a channel/alias** + +```tsx +// removes a delegate +const removeDelegatorRes = userAlice.channel.delegate.remove(delegatorAddressInCAIP) + +``` + +**Parameters:** + +| Parameter | Type | Default | Description | +| --- | --- | --- | --- | +| delegate | string | - | delegator address in CAIP | +| Note: Support for contract interaction via viem is coming soon | | | | + +--- + +### **Alias Information** + +```tsx +// fetch alias info +const aliasInfo = userAlice.channel.alias.info({alias: '0xABC', aliasChain:'POLYGON'}) + +``` + +| Parameter | Type | Default | Description | +| --- | --- | --- | --- | +| options | AliasOptions | - | Configuration options for retrieving alias information. | +| options.alias | string | - | The alias address | +| options.aliasChain | ALIAS_CHAIN | - | The name of the alias chain, which can be 'POLYGON' or 'BSC' or 'OPTIMISM' or 'POLYGONZKEVM' | \ No newline at end of file diff --git a/packages/restapi/package-lock.json b/packages/restapi/package-lock.json index a2cdeca0a..49c454e84 100644 --- a/packages/restapi/package-lock.json +++ b/packages/restapi/package-lock.json @@ -1,19 +1,24 @@ { "name": "@pushprotocol/restapi", - "version": "0.0.1-alpha.13", + "version": "1.4.11", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@pushprotocol/restapi", - "version": "0.0.1-alpha.13", + "version": "1.4.11", "dependencies": { + "@ambire/signature-validator": "^1.3.1", "@metamask/eth-sig-util": "^5.0.2", + "@pushprotocol/socket": "^0.5.2", "buffer": "^6.0.3", "crypto-js": "^4.1.1", "immer": "^10.0.2", + "joi": "^17.9.2", + "livepeer": "^2.5.8", "openpgp": "^5.5.0", - "simple-peer": "^9.11.1" + "simple-peer": "^9.11.1", + "video-stream-merger": "^4.0.1" }, "devDependencies": { "@types/chai": "^4.3.4", @@ -31,6 +36,16 @@ "ethers": "^5.6.8" } }, + "node_modules/@ambire/signature-validator": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@ambire/signature-validator/-/signature-validator-1.3.1.tgz", + "integrity": "sha512-kR6Se3nhAGf1VMeun7V2Lml9KRXB5oz64vO2zGSg+dNaGq4BPDEjsNdr0PIKXZ8651sDlRCN7V9SzL5E2ddBYQ==", + "dependencies": { + "ethers": "^5.6.5", + "tap-spec": "^5.0.0", + "tape": "^5.5.3" + } + }, "node_modules/@chainsafe/as-sha256": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz", @@ -104,7 +119,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/address": "^5.7.0", "@ethersproject/bignumber": "^5.7.0", @@ -131,7 +145,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/bignumber": "^5.7.0", "@ethersproject/bytes": "^5.7.0", @@ -156,7 +169,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/abstract-provider": "^5.7.0", "@ethersproject/bignumber": "^5.7.0", @@ -179,7 +191,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/bignumber": "^5.7.0", "@ethersproject/bytes": "^5.7.0", @@ -202,7 +213,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/bytes": "^5.7.0" } @@ -221,7 +231,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/properties": "^5.7.0" @@ -241,7 +250,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/logger": "^5.7.0", @@ -251,8 +259,7 @@ "node_modules/@ethersproject/bignumber/node_modules/bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", - "peer": true + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "node_modules/@ethersproject/bytes": { "version": "5.7.0", @@ -268,7 +275,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/logger": "^5.7.0" } @@ -287,7 +293,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/bignumber": "^5.7.0" } @@ -306,7 +311,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/abi": "^5.7.0", "@ethersproject/abstract-provider": "^5.7.0", @@ -334,7 +338,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/abstract-signer": "^5.7.0", "@ethersproject/address": "^5.7.0", @@ -361,7 +364,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/abstract-signer": "^5.7.0", "@ethersproject/basex": "^5.7.0", @@ -391,7 +393,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/abstract-signer": "^5.7.0", "@ethersproject/address": "^5.7.0", @@ -422,7 +423,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/bytes": "^5.7.0", "js-sha3": "0.8.0" @@ -441,8 +441,7 @@ "type": "individual", "url": "https://www.buymeacoffee.com/ricmoo" } - ], - "peer": true + ] }, "node_modules/@ethersproject/networks": { "version": "5.7.1", @@ -458,7 +457,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/logger": "^5.7.0" } @@ -477,7 +475,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/sha2": "^5.7.0" @@ -497,7 +494,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/logger": "^5.7.0" } @@ -516,7 +512,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/abstract-provider": "^5.7.0", "@ethersproject/abstract-signer": "^5.7.0", @@ -554,7 +549,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/logger": "^5.7.0" @@ -574,7 +568,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/logger": "^5.7.0" @@ -594,7 +587,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/logger": "^5.7.0", @@ -615,7 +607,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/logger": "^5.7.0", @@ -628,8 +619,7 @@ "node_modules/@ethersproject/signing-key/node_modules/bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", - "peer": true + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "node_modules/@ethersproject/solidity": { "version": "5.7.0", @@ -645,7 +635,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/bignumber": "^5.7.0", "@ethersproject/bytes": "^5.7.0", @@ -669,7 +658,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/constants": "^5.7.0", @@ -690,7 +678,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/address": "^5.7.0", "@ethersproject/bignumber": "^5.7.0", @@ -717,7 +704,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/bignumber": "^5.7.0", "@ethersproject/constants": "^5.7.0", @@ -738,7 +724,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/abstract-provider": "^5.7.0", "@ethersproject/abstract-signer": "^5.7.0", @@ -771,7 +756,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/base64": "^5.7.0", "@ethersproject/bytes": "^5.7.0", @@ -794,7 +778,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/hash": "^5.7.0", @@ -803,6 +786,19 @@ "@ethersproject/strings": "^5.7.0" } }, + "node_modules/@hapi/hoek": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", + "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==" + }, + "node_modules/@hapi/topo": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", + "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", @@ -828,6 +824,53 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@livepeer/core": { + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/@livepeer/core/-/core-1.8.6.tgz", + "integrity": "sha512-VWMHaHMzNCr8YuC9hD87Ju+fwnpldEoe3y9CqOXrQPyyIgiAWfraZBA6Ard67f09X9UBGaaRcAMgMcCUs9HtKA==", + "dependencies": { + "cross-fetch": "^4.0.0", + "ms": "^3.0.0-canary.1", + "multiformats": "9.9.0", + "tus-js-client": "^3.1.0", + "zustand": "^4.3.9" + }, + "peerDependencies": { + "react": ">=17.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + } + } + }, + "node_modules/@livepeer/core/node_modules/ms": { + "version": "3.0.0-canary.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-3.0.0-canary.1.tgz", + "integrity": "sha512-kh8ARjh8rMN7Du2igDRO9QJnqCb2xYTJxyQYK7vJJS4TvLLmsbyhiKpSW+t+y26gyOyMd0riphX0GeWKU3ky5g==", + "engines": { + "node": ">=12.13" + } + }, + "node_modules/@ljharb/resumer": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@ljharb/resumer/-/resumer-0.0.1.tgz", + "integrity": "sha512-skQiAOrCfO7vRTq53cxznMpks7wS1va95UCidALlOVWqvBAzwPVErwizDwoMqNVMEn1mDq0utxZd02eIrvF1lw==", + "dependencies": { + "@ljharb/through": "^2.3.9" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/@ljharb/through": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.9.tgz", + "integrity": "sha512-yN599ZBuMPPK4tdoToLlvgJB4CLK8fGl7ntfy0Wn7U6ttNvHYurd81bfUiK/6sMkiIwm65R6ck4L6+Y3DfVbNQ==", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/@metamask/eth-sig-util": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-5.0.2.tgz", @@ -866,6 +909,18 @@ } ] }, + "node_modules/@pushprotocol/socket": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@pushprotocol/socket/-/socket-0.5.2.tgz", + "integrity": "sha512-lVGMT3q8T5by6qwAhQ+zIeE/yv7oUC9eIlFux8M7WaKu/ArLBrrojD5REbr9QXXwpJIP3Q8GJUKyClZl4uGsJw==", + "dependencies": { + "socket.io-client": "^4.5.2", + "tslib": "^2.3.0" + }, + "peerDependencies": { + "ethers": "^5.6.8" + } + }, "node_modules/@scure/base": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", @@ -908,6 +963,34 @@ "@scure/base": "~1.1.0" } }, + "node_modules/@sideway/address": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz", + "integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==", + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "node_modules/@sideway/formula": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", + "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==" + }, + "node_modules/@sideway/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==" + }, + "node_modules/@socket.io/component-emitter": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", + "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==" + }, + "node_modules/@stitches/core": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@stitches/core/-/core-1.2.8.tgz", + "integrity": "sha512-Gfkvwk9o9kE9r9XNBmJRfV8zONvXThnm1tcuojL04Uy5uRyqg93DC83lDebl0rocZCfKSjUv+fWYtMQmEDJldg==" + }, "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -990,8 +1073,7 @@ "node_modules/aes-js": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", - "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==", - "peer": true + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==" }, "node_modules/ansi-colors": { "version": "4.1.1", @@ -1051,6 +1133,55 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dependencies": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.every": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.5.tgz", + "integrity": "sha512-FfMQJ+/joFGXpRCltbzV3znaP5QxIhLFySo0fEPn3GuoYlud9LhknMCIxdYKC2qsM/6VHoSp6YGwe3EZXrEcwQ==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", + "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/asn1.js": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", @@ -1071,11 +1202,21 @@ "node": "*" } }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/base64-js": { "version": "1.5.1", @@ -1099,8 +1240,7 @@ "node_modules/bech32": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", - "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", - "peer": true + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" }, "node_modules/binary-extensions": { "version": "2.2.0", @@ -1120,7 +1260,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1141,8 +1280,7 @@ "node_modules/brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", - "peer": true + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" }, "node_modules/browser-stdout": { "version": "1.3.1", @@ -1173,6 +1311,28 @@ "ieee754": "^1.2.1" } }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, + "node_modules/buffer-shims": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "integrity": "sha512-Zy8ZXMyxIT6RMTeY7OP/bDndfj6bwCan7SS98CEndS6deHwWPpseeHlwarNcBim+etXnF9HBc1non5JgDaJU1g==" + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -1325,11 +1485,34 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/combine-errors": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/combine-errors/-/combine-errors-3.0.3.tgz", + "integrity": "sha512-C8ikRNRMygCwaTx+Ek3Yr+OuZzgZjduCOfSQBjbM8V3MfgcjSTeto/GXP6PAwKvJz/v15b7GHZvx5rOlczFw/Q==", + "dependencies": { + "custom-error-instance": "2.1.1", + "lodash.uniqby": "4.5.0" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/core-js": { + "version": "3.32.2", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.32.2.tgz", + "integrity": "sha512-pxXSw1mYZPDGvTQqEc5vgIb83jGQKFGYWY76z4a7weZXUolw3G+OvpZqSRcfYOoOVUQJYEPsWeQK8pKEnUtWxQ==", + "hasInstallScript": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/create-require": { "version": "1.1.1", @@ -1337,6 +1520,14 @@ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, + "node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, "node_modules/cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -1358,6 +1549,11 @@ "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz", "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==" }, + "node_modules/custom-error-instance": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/custom-error-instance/-/custom-error-instance-2.1.1.tgz", + "integrity": "sha512-p6JFxJc3M4OTD2li2qaHkDCw9SfMw82Ldr6OC9Je1aXiGfhx2W8p3GaoeaGrPJTUN9NirTM/KTxHWMUdR1rsUg==" + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -1403,6 +1599,71 @@ "node": ">=6" } }, + "node_modules/deep-equal": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.2.tgz", + "integrity": "sha512-xjVyBf0w5vH0I42jdAZzOKVldmPgSulmiyPRywoyq7HXC9qdgo17kxJE+rdnif5Tz6+pIrpJI8dCpMNLIGkUiA==", + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "es-get-iterator": "^1.1.3", + "get-intrinsic": "^1.2.1", + "is-arguments": "^1.1.1", + "is-array-buffer": "^3.0.2", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "isarray": "^2.0.5", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.0", + "side-channel": "^1.0.4", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-data-property": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz", + "integrity": "sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==", + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/defined": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", + "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -1412,11 +1673,37 @@ "node": ">=0.3.1" } }, + "node_modules/dotignore": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/dotignore/-/dotignore-0.1.2.tgz", + "integrity": "sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==", + "dependencies": { + "minimatch": "^3.0.4" + }, + "bin": { + "ignored": "bin/ignored" + } + }, + "node_modules/dotignore/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==" + }, "node_modules/elliptic": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "peer": true, "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -1442,11 +1729,151 @@ "once": "^1.4.0" } }, + "node_modules/engine.io-client": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.5.2.tgz", + "integrity": "sha512-CQZqbrpEYnrpGqC07a9dJDz4gePZUgTPMU3NKJPSeQOyw27Tst4Pl3FemKoFGAlHzgZmKjoRmiJvbWfhCXUlIg==", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.11.0", + "xmlhttprequest-ssl": "~2.0.0" + } + }, + "node_modules/engine.io-client/node_modules/ws": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", + "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/engine.io-parser": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.1.tgz", + "integrity": "sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/err-code": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" }, + "node_modules/es-abstract": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.2.tgz", + "integrity": "sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA==", + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.2", + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.1", + "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.12", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.1", + "safe-array-concat": "^1.0.1", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.11" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-get-iterator": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", + "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "has-symbols": "^1.0.3", + "is-arguments": "^1.1.1", + "is-map": "^2.0.2", + "is-set": "^2.0.2", + "is-string": "^1.0.7", + "isarray": "^2.0.5", + "stop-iteration-iterator": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dependencies": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -1493,7 +1920,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "peer": true, "dependencies": { "@ethersproject/abi": "5.7.0", "@ethersproject/abstract-provider": "5.7.0", @@ -1558,6 +1984,26 @@ "node": ">=6" } }, + "node_modules/figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha512-UxKlfCRuCBxSXU4C6t9scbDyWZ4VlaFFdojKtzJuSkuOBQ5CNFum+zZXFwHjo+CxBC1t6zlYPgHIgFjL8ggoEQ==", + "dependencies": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -1595,11 +2041,18 @@ "flat": "cli.js" } }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dependencies": { + "is-callable": "^1.1.3" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "node_modules/fsevents": { "version": "2.3.2", @@ -1615,6 +2068,36 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-browser-rtc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/get-browser-rtc/-/get-browser-rtc-1.1.0.tgz", @@ -1638,9 +2121,31 @@ "node": "*" } }, - "node_modules/get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", "dev": true, "dependencies": { @@ -1650,6 +2155,21 @@ "node": ">=6" } }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", @@ -1694,6 +2214,86 @@ "node": "*" } }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-ansi/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-dynamic-import": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-dynamic-import/-/has-dynamic-import-2.0.1.tgz", + "integrity": "sha512-X3fbtsZmwb6W7fJGR9o7x65fZoodygCrZ3TVycvghP62yYQfS0t4RS0Qcz+j5tQYUKeSWS09tHkWW6WhFV3XhQ==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1703,11 +2303,57 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/hash.js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "peer": true, "dependencies": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" @@ -1722,11 +2368,15 @@ "he": "bin/he" } }, + "node_modules/hls.js": { + "version": "1.4.12", + "resolved": "https://registry.npmjs.org/hls.js/-/hls.js-1.4.12.tgz", + "integrity": "sha512-1RBpx2VihibzE3WE9kGoVCtrhhDWTzydzElk/kyRbEOLnb1WIE+3ZabM/L8BqKFTCL3pUy4QzhXgD1Q6Igr1JA==" + }, "node_modules/hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", - "peer": true, "dependencies": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -1765,7 +2415,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -1776,6 +2425,19 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "node_modules/internal-slot": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", + "dependencies": { + "get-intrinsic": "^1.2.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/invert-kv": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", @@ -1785,6 +2447,45 @@ "node": ">=4" } }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -1797,6 +2498,57 @@ "node": ">=8" } }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -1806,6 +2558,17 @@ "node": ">=0.10.0" } }, + "node_modules/is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -1836,6 +2599,25 @@ "npm": ">=3" } }, + "node_modules/is-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", + "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -1845,6 +2627,20 @@ "node": ">=0.12.0" } }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -1854,6 +2650,40 @@ "node": ">=8" } }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", + "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", @@ -1863,6 +2693,48 @@ "node": ">=0.10.0" } }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "dependencies": { + "which-typed-array": "^1.1.11" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -1875,16 +2747,74 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-weakmap": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", + "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "node_modules/joi": { + "version": "17.10.2", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.10.2.tgz", + "integrity": "sha512-hcVhjBxRNW/is3nNLdGLIjkgXetkeGc2wyhydhz8KumG23Aerk4HPjU5zaPAMRqXQFc0xNqXTC7+zQjxr0GlKA==", + "dependencies": { + "@hapi/hoek": "^9.0.0", + "@hapi/topo": "^5.0.0", + "@sideway/address": "^4.1.3", + "@sideway/formula": "^3.0.1", + "@sideway/pinpoint": "^2.0.0" + } + }, + "node_modules/js-base64": { + "version": "3.7.5", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.5.tgz", + "integrity": "sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA==" + }, "node_modules/js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "peer": true }, "node_modules/js-yaml": { @@ -1911,6 +2841,37 @@ "node": ">=6" } }, + "node_modules/livepeer": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/livepeer/-/livepeer-2.8.6.tgz", + "integrity": "sha512-8K2lRtpgZKbv6l6cGYYMJW9qpdRKkGUuy7R7xTLkS6NaRQzaeW08vubftmbMHil8v8GX/nDmodcW2vA4oIkP0w==", + "dependencies": { + "@livepeer/core": "^1.8.6", + "@stitches/core": "^1.2.8", + "core-js": "^3.31.1", + "cross-fetch": "^4.0.0", + "hls.js": "^1.4.9", + "ms": "^3.0.0-canary.1", + "tus-js-client": "^3.1.0", + "zustand": "^4.3.9" + }, + "peerDependencies": { + "react": ">=17.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + } + } + }, + "node_modules/livepeer/node_modules/ms": { + "version": "3.0.0-canary.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-3.0.0-canary.1.tgz", + "integrity": "sha512-kh8ARjh8rMN7Du2igDRO9QJnqCb2xYTJxyQYK7vJJS4TvLLmsbyhiKpSW+t+y26gyOyMd0riphX0GeWKU3ky5g==", + "engines": { + "node": ">=12.13" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -1926,15 +2887,74 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash._baseiteratee": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash._baseiteratee/-/lodash._baseiteratee-4.7.0.tgz", + "integrity": "sha512-nqB9M+wITz0BX/Q2xg6fQ8mLkyfF7MU7eE+MNBNjTHFKeKaZAPEzEg+E8LWxKWf1DQVflNEn9N49yAuqKh2mWQ==", "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, + "lodash._stringtopath": "~4.8.0" + } + }, + "node_modules/lodash._basetostring": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz", + "integrity": "sha512-SwcRIbyxnN6CFEEK4K1y+zuApvWdpQdBHM/swxP962s8HIxPO3alBH5t3m/dl+f4CMUug6sJb7Pww8d13/9WSw==" + }, + "node_modules/lodash._baseuniq": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz", + "integrity": "sha512-Ja1YevpHZctlI5beLA7oc5KNDhGcPixFhcqSiORHNsp/1QTv7amAXzw+gu4YOvErqVlMVyIJGgtzeepCnnur0A==", + "dependencies": { + "lodash._createset": "~4.0.0", + "lodash._root": "~3.0.0" + } + }, + "node_modules/lodash._createset": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/lodash._createset/-/lodash._createset-4.0.3.tgz", + "integrity": "sha512-GTkC6YMprrJZCYU3zcqZj+jkXkrXzq3IPBcF/fIPpNEAB4hZEtXU8zp/RwKOvZl43NUmwDbyRk3+ZTbeRdEBXA==" + }, + "node_modules/lodash._root": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", + "integrity": "sha512-O0pWuFSK6x4EXhM1dhZ8gchNtG7JMqBtrHdoUFUWXD7dJnNSUze1GuyQr5sOs0aCvgGeI3o/OJW8f4ca7FDxmQ==" + }, + "node_modules/lodash._stringtopath": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/lodash._stringtopath/-/lodash._stringtopath-4.8.0.tgz", + "integrity": "sha512-SXL66C731p0xPDC5LZg4wI5H+dJo/EO4KTqOMwLYCH3+FmmfAKJEZCm6ohGpI+T1xwsDsJCfL4OnhorllvlTPQ==", + "dependencies": { + "lodash._basetostring": "~4.12.0" + } + }, + "node_modules/lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==" + }, + "node_modules/lodash.uniqby": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.5.0.tgz", + "integrity": "sha512-IRt7cfTtHy6f1aRVA5n7kT8rgN3N1nH6MOWLcHfpWG2SH19E3JksLK38MktLxZDhlAjCP9jpIXkOnRXlu6oByQ==", + "dependencies": { + "lodash._baseiteratee": "~4.7.0", + "lodash._baseuniq": "~4.6.0" + } + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, "engines": { "node": ">=10" }, @@ -1942,6 +2962,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "peer": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, "node_modules/loupe": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", @@ -2000,8 +3032,7 @@ "node_modules/minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", - "peer": true + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" }, "node_modules/minimatch": { "version": "5.0.1", @@ -2024,6 +3055,14 @@ "balanced-match": "^1.0.0" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/mocha": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", @@ -2403,6 +3442,11 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, + "node_modules/multiformats": { + "version": "9.9.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", + "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==" + }, "node_modules/nanoid": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", @@ -2421,6 +3465,25 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -2451,11 +3514,66 @@ "node": ">=0.10.0" } }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, "dependencies": { "wrappy": "1" } @@ -2551,6 +3669,14 @@ "node": ">=4" } }, + "node_modules/parse-ms": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", + "integrity": "sha512-LpH1Cf5EYuVjkBvCDBYvkUPh+iv2bk3FHflxHkpCYT0/FZ1d3N3uJaLiHr4yGuMcFUhv6eAivitTvWZI4B/chg==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -2564,7 +3690,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -2578,6 +3703,11 @@ "node": ">=4" } }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", @@ -2599,6 +3729,42 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/plur": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/plur/-/plur-1.0.0.tgz", + "integrity": "sha512-qSnKBSZeDY8ApxwhfVIwKwF36KVJqb1/9nzYYq3j3vdwocULCXT8f8fQGkiw1Nk9BGfxiDagEe/pwakA+bOBqw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pretty-ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-2.1.0.tgz", + "integrity": "sha512-H2enpsxzDhuzRl3zeSQpQMirn8dB0Z/gxW96j06tMfTviUWvX14gjKb7qd1gtkUyYhDPuoNe00K5PqNvy2oQNg==", + "dependencies": { + "is-finite": "^1.0.1", + "parse-ms": "^1.0.0", + "plur": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha512-yN0WQmuCX63LP/TMvAg31nvT6m4vDqJEiiv2CAZqWOGNWutc9DfDk1NPYYmKUFmaVM2UwDowH4u5AHWYP/jxKw==" + }, + "node_modules/proper-lockfile": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz", + "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==", + "dependencies": { + "graceful-fs": "^4.2.4", + "retry": "^0.12.0", + "signal-exit": "^3.0.2" + } + }, "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -2609,6 +3775,11 @@ "once": "^1.3.1" } }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -2636,6 +3807,23 @@ "safe-buffer": "^5.1.0" } }, + "node_modules/re-emitter": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/re-emitter/-/re-emitter-1.1.3.tgz", + "integrity": "sha512-bHJul9CWcocrS+w5e5QrKYXV9NkbSA9hxSEyhYuctwm6keY9NXR2Xt/4A0vbMP0QvuwyfEyb4bkowYXv1ziEbg==" + }, + "node_modules/react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -2661,6 +3849,30 @@ "node": ">=8.10.0" } }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", + "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "set-function-name": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "engines": { + "node": ">=0.10" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -2676,6 +3888,52 @@ "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==", "dev": true }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" + }, + "node_modules/resolve": { + "version": "2.0.0-next.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", + "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", + "dependencies": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/safe-array-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", + "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -2695,6 +3953,19 @@ } ] }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -2703,8 +3974,7 @@ "node_modules/scrypt-js": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", - "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", - "peer": true + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" }, "node_modules/semver": { "version": "5.7.1", @@ -2730,6 +4000,19 @@ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, + "node_modules/set-function-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", + "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "dependencies": { + "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -2751,11 +4034,23 @@ "node": ">=0.10.0" } }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "node_modules/simple-peer": { "version": "9.11.1", @@ -2785,6 +4080,54 @@ "readable-stream": "^3.6.0" } }, + "node_modules/socket.io-client": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.7.2.tgz", + "integrity": "sha512-vtA0uD4ibrYD793SOIAwlo8cj6haOeMHrGvwPxJsxH7CeIksqJ+3Zc06RvWTIFgiSqx4A3sOnTXpfAEE2Zyz6w==", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.2", + "engine.io-client": "~6.5.2", + "socket.io-parser": "~4.2.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-parser": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", + "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/split": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.0.tgz", + "integrity": "sha512-3SVfJe2A0WZg3D+ZEtXqYkvpSGAVaZ1MgufNCeHioBESCqQFsuT1VcQufiopBfJZqh92ZwQ6ddL378iUSbqVNQ==", + "dependencies": { + "through": "2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/stop-iteration-iterator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", + "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", + "dependencies": { + "internal-slot": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -2793,78 +4136,369 @@ "safe-buffer": "~5.2.0" } }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", + "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", + "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", + "dependencies": { + "is-hex-prefixed": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tap-out": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tap-out/-/tap-out-2.1.0.tgz", + "integrity": "sha512-LJE+TBoVbOWhwdz4+FQk40nmbIuxJLqaGvj3WauQw3NYYU5TdjoV3C0x/yq37YAvVyi+oeBXmWnxWSjJ7IEyUw==", + "dependencies": { + "re-emitter": "1.1.3", + "readable-stream": "2.2.9", + "split": "1.0.0", + "trim": "0.0.1" + }, + "bin": { + "tap-out": "bin/cmd.js" + } + }, + "node_modules/tap-out/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/tap-out/node_modules/readable-stream": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.9.tgz", + "integrity": "sha512-iuxqX7b7FYt08AriYECxUsK9KTXE3A/FenxIa3IPmvANHxaTP/wGIwwf+IidvvIDk/MsCp/oEV6A8CXo4SDcCg==", + "dependencies": { + "buffer-shims": "~1.0.0", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~1.0.0", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/tap-out/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/tap-out/node_modules/string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/tap-spec": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tap-spec/-/tap-spec-5.0.0.tgz", + "integrity": "sha512-zMDVJiE5I6Y4XGjlueGXJIX2YIkbDN44broZlnypT38Hj/czfOXrszHNNJBF/DXR8n+x6gbfSx68x04kIEHdrw==", + "dependencies": { + "chalk": "^1.0.0", + "duplexer": "^0.1.1", + "figures": "^1.4.0", + "lodash": "^4.17.10", + "pretty-ms": "^2.1.0", + "repeat-string": "^1.5.2", + "tap-out": "^2.1.0", + "through2": "^2.0.0" + }, + "bin": { + "tap-spec": "bin/cmd.js", + "tspec": "bin/cmd.js" + } + }, + "node_modules/tap-spec/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tap-spec/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tap-spec/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tap-spec/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/tap-spec/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tap-spec/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/tape": { + "version": "5.6.6", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.6.6.tgz", + "integrity": "sha512-rGp2cZ3rfZ6QfTBm6yvohf8aXmDqPyzMKZwTMV12w4i+b/N2Adwlg8PlW8jLqWzlJUZhglyYaLOSrMt/ZlZkAA==", + "dependencies": { + "@ljharb/resumer": "^0.0.1", + "@ljharb/through": "^2.3.9", + "array.prototype.every": "^1.1.4", + "call-bind": "^1.0.2", + "deep-equal": "^2.2.2", + "defined": "^1.0.1", + "dotignore": "^0.1.2", + "for-each": "^0.3.3", + "get-package-type": "^0.1.0", + "glob": "^7.2.3", + "has": "^1.0.3", + "has-dynamic-import": "^2.0.1", + "inherits": "^2.0.4", + "is-regex": "^1.1.4", + "minimist": "^1.2.8", + "object-inspect": "^1.12.3", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "resolve": "^2.0.0-next.4", + "string.prototype.trim": "^1.2.7" + }, + "bin": { + "tape": "bin/tape" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tape/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">=8" + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, + "node_modules/tape/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dependencies": { - "ansi-regex": "^5.0.1" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=8" + "node": "*" } }, - "node_modules/strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" } }, - "node_modules/strip-hex-prefix": { + "node_modules/through2/node_modules/isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", - "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/through2/node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dependencies": { - "is-hex-prefixed": "1.0.0" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "node_modules/through2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, - "node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, + "node_modules/through2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" + "safe-buffer": "~5.1.0" } }, "node_modules/to-regex-range": { @@ -2879,6 +4513,17 @@ "node": ">=8.0" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/trim": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "integrity": "sha512-YzQV+TZg4AxpKxaTHK3c3D+kRDCGVEE7LemdlQZoQXn0iennk10RsIoY6ikzAqJTc9Xjl9C1/waHom/J86ziAQ==", + "deprecated": "Use String.prototype.trim() instead" + }, "node_modules/ts-node": { "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", @@ -2922,6 +4567,36 @@ } } }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, + "node_modules/tus-js-client": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/tus-js-client/-/tus-js-client-3.1.1.tgz", + "integrity": "sha512-SZzWP62jEFLmROSRZx+uoGLKqsYWMGK/m+PiNehPVWbCm7/S9zRIMaDxiaOcKdMnFno4luaqP5E+Y1iXXPjP0A==", + "dependencies": { + "buffer-from": "^1.1.2", + "combine-errors": "^3.0.3", + "is-stream": "^2.0.0", + "js-base64": "^3.7.2", + "lodash.throttle": "^4.1.1", + "proper-lockfile": "^4.1.2", + "url-parse": "^1.5.7" + } + }, + "node_modules/tus-js-client/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", @@ -2941,6 +4616,67 @@ "node": ">=4" } }, + "node_modules/typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typescript": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz", @@ -2954,6 +4690,37 @@ "node": ">=12.20" } }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/use-sync-external-store": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", + "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -2965,6 +4732,25 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, + "node_modules/video-stream-merger": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/video-stream-merger/-/video-stream-merger-4.0.1.tgz", + "integrity": "sha512-VazYSr8tk6S/zkOq5jpR/ryy1HnGxm5XCw+d2Ejpqy1m6d71oZpyFG82dUkgAo7dg/lk3k4TqvJPtuRUtR8URA==" + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -2977,12 +4763,59 @@ "which": "bin/which" } }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", + "dependencies": { + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-weakmap": "^2.0.1", + "is-weakset": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", "dev": true }, + "node_modules/which-typed-array": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", + "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", @@ -3009,14 +4842,12 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { "version": "7.4.6", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", - "peer": true, "engines": { "node": ">=8.3.0" }, @@ -3033,6 +4864,22 @@ } } }, + "node_modules/xmlhttprequest-ssl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz", + "integrity": "sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "engines": { + "node": ">=0.4" + } + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -3104,9 +4951,46 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zustand": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.4.1.tgz", + "integrity": "sha512-QCPfstAS4EBiTQzlaGP1gmorkh/UL1Leaj2tdj+zZCZ/9bm0WS7sI2wnfD5lpOszFqWJ1DcPnGoY8RDL61uokw==", + "dependencies": { + "use-sync-external-store": "1.2.0" + }, + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "@types/react": ">=16.8", + "immer": ">=9.0", + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "immer": { + "optional": true + }, + "react": { + "optional": true + } + } } }, "dependencies": { + "@ambire/signature-validator": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@ambire/signature-validator/-/signature-validator-1.3.1.tgz", + "integrity": "sha512-kR6Se3nhAGf1VMeun7V2Lml9KRXB5oz64vO2zGSg+dNaGq4BPDEjsNdr0PIKXZ8651sDlRCN7V9SzL5E2ddBYQ==", + "requires": { + "ethers": "^5.6.5", + "tap-spec": "^5.0.0", + "tape": "^5.5.3" + } + }, "@chainsafe/as-sha256": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz", @@ -3158,7 +5042,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", - "peer": true, "requires": { "@ethersproject/address": "^5.7.0", "@ethersproject/bignumber": "^5.7.0", @@ -3175,7 +5058,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", - "peer": true, "requires": { "@ethersproject/bignumber": "^5.7.0", "@ethersproject/bytes": "^5.7.0", @@ -3190,7 +5072,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", - "peer": true, "requires": { "@ethersproject/abstract-provider": "^5.7.0", "@ethersproject/bignumber": "^5.7.0", @@ -3203,7 +5084,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", - "peer": true, "requires": { "@ethersproject/bignumber": "^5.7.0", "@ethersproject/bytes": "^5.7.0", @@ -3216,7 +5096,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", - "peer": true, "requires": { "@ethersproject/bytes": "^5.7.0" } @@ -3225,7 +5104,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", - "peer": true, "requires": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/properties": "^5.7.0" @@ -3235,7 +5113,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", - "peer": true, "requires": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/logger": "^5.7.0", @@ -3245,8 +5122,7 @@ "bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", - "peer": true + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" } } }, @@ -3254,7 +5130,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", - "peer": true, "requires": { "@ethersproject/logger": "^5.7.0" } @@ -3263,7 +5138,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", - "peer": true, "requires": { "@ethersproject/bignumber": "^5.7.0" } @@ -3272,7 +5146,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", - "peer": true, "requires": { "@ethersproject/abi": "^5.7.0", "@ethersproject/abstract-provider": "^5.7.0", @@ -3290,7 +5163,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", - "peer": true, "requires": { "@ethersproject/abstract-signer": "^5.7.0", "@ethersproject/address": "^5.7.0", @@ -3307,7 +5179,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", - "peer": true, "requires": { "@ethersproject/abstract-signer": "^5.7.0", "@ethersproject/basex": "^5.7.0", @@ -3327,7 +5198,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", - "peer": true, "requires": { "@ethersproject/abstract-signer": "^5.7.0", "@ethersproject/address": "^5.7.0", @@ -3348,7 +5218,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", - "peer": true, "requires": { "@ethersproject/bytes": "^5.7.0", "js-sha3": "0.8.0" @@ -3357,14 +5226,12 @@ "@ethersproject/logger": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", - "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", - "peer": true + "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==" }, "@ethersproject/networks": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", - "peer": true, "requires": { "@ethersproject/logger": "^5.7.0" } @@ -3373,7 +5240,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", - "peer": true, "requires": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/sha2": "^5.7.0" @@ -3383,7 +5249,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", - "peer": true, "requires": { "@ethersproject/logger": "^5.7.0" } @@ -3392,7 +5257,6 @@ "version": "5.7.2", "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", - "peer": true, "requires": { "@ethersproject/abstract-provider": "^5.7.0", "@ethersproject/abstract-signer": "^5.7.0", @@ -3420,7 +5284,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", - "peer": true, "requires": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/logger": "^5.7.0" @@ -3430,7 +5293,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", - "peer": true, "requires": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/logger": "^5.7.0" @@ -3440,7 +5302,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", - "peer": true, "requires": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/logger": "^5.7.0", @@ -3451,7 +5312,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", - "peer": true, "requires": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/logger": "^5.7.0", @@ -3464,8 +5324,7 @@ "bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", - "peer": true + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" } } }, @@ -3473,7 +5332,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", - "peer": true, "requires": { "@ethersproject/bignumber": "^5.7.0", "@ethersproject/bytes": "^5.7.0", @@ -3487,7 +5345,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", - "peer": true, "requires": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/constants": "^5.7.0", @@ -3498,7 +5355,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", - "peer": true, "requires": { "@ethersproject/address": "^5.7.0", "@ethersproject/bignumber": "^5.7.0", @@ -3515,7 +5371,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", - "peer": true, "requires": { "@ethersproject/bignumber": "^5.7.0", "@ethersproject/constants": "^5.7.0", @@ -3526,7 +5381,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", - "peer": true, "requires": { "@ethersproject/abstract-provider": "^5.7.0", "@ethersproject/abstract-signer": "^5.7.0", @@ -3549,7 +5403,6 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", - "peer": true, "requires": { "@ethersproject/base64": "^5.7.0", "@ethersproject/bytes": "^5.7.0", @@ -3562,7 +5415,6 @@ "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", - "peer": true, "requires": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/hash": "^5.7.0", @@ -3571,6 +5423,19 @@ "@ethersproject/strings": "^5.7.0" } }, + "@hapi/hoek": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", + "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==" + }, + "@hapi/topo": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", + "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", + "requires": { + "@hapi/hoek": "^9.0.0" + } + }, "@jridgewell/resolve-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", @@ -3593,6 +5458,38 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "@livepeer/core": { + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/@livepeer/core/-/core-1.8.6.tgz", + "integrity": "sha512-VWMHaHMzNCr8YuC9hD87Ju+fwnpldEoe3y9CqOXrQPyyIgiAWfraZBA6Ard67f09X9UBGaaRcAMgMcCUs9HtKA==", + "requires": { + "cross-fetch": "^4.0.0", + "ms": "^3.0.0-canary.1", + "multiformats": "9.9.0", + "tus-js-client": "^3.1.0", + "zustand": "^4.3.9" + }, + "dependencies": { + "ms": { + "version": "3.0.0-canary.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-3.0.0-canary.1.tgz", + "integrity": "sha512-kh8ARjh8rMN7Du2igDRO9QJnqCb2xYTJxyQYK7vJJS4TvLLmsbyhiKpSW+t+y26gyOyMd0riphX0GeWKU3ky5g==" + } + } + }, + "@ljharb/resumer": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@ljharb/resumer/-/resumer-0.0.1.tgz", + "integrity": "sha512-skQiAOrCfO7vRTq53cxznMpks7wS1va95UCidALlOVWqvBAzwPVErwizDwoMqNVMEn1mDq0utxZd02eIrvF1lw==", + "requires": { + "@ljharb/through": "^2.3.9" + } + }, + "@ljharb/through": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.9.tgz", + "integrity": "sha512-yN599ZBuMPPK4tdoToLlvgJB4CLK8fGl7ntfy0Wn7U6ttNvHYurd81bfUiK/6sMkiIwm65R6ck4L6+Y3DfVbNQ==" + }, "@metamask/eth-sig-util": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-5.0.2.tgz", @@ -3616,6 +5513,15 @@ "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz", "integrity": "sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==" }, + "@pushprotocol/socket": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@pushprotocol/socket/-/socket-0.5.2.tgz", + "integrity": "sha512-lVGMT3q8T5by6qwAhQ+zIeE/yv7oUC9eIlFux8M7WaKu/ArLBrrojD5REbr9QXXwpJIP3Q8GJUKyClZl4uGsJw==", + "requires": { + "socket.io-client": "^4.5.2", + "tslib": "^2.3.0" + } + }, "@scure/base": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", @@ -3640,6 +5546,34 @@ "@scure/base": "~1.1.0" } }, + "@sideway/address": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz", + "integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==", + "requires": { + "@hapi/hoek": "^9.0.0" + } + }, + "@sideway/formula": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", + "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==" + }, + "@sideway/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==" + }, + "@socket.io/component-emitter": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", + "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==" + }, + "@stitches/core": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@stitches/core/-/core-1.2.8.tgz", + "integrity": "sha512-Gfkvwk9o9kE9r9XNBmJRfV8zONvXThnm1tcuojL04Uy5uRyqg93DC83lDebl0rocZCfKSjUv+fWYtMQmEDJldg==" + }, "@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -3713,8 +5647,7 @@ "aes-js": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", - "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==", - "peer": true + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==" }, "ansi-colors": { "version": "4.1.1", @@ -3759,6 +5692,40 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, + "array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "requires": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + } + }, + "array.prototype.every": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.5.tgz", + "integrity": "sha512-FfMQJ+/joFGXpRCltbzV3znaP5QxIhLFySo0fEPn3GuoYlud9LhknMCIxdYKC2qsM/6VHoSp6YGwe3EZXrEcwQ==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "is-string": "^1.0.7" + } + }, + "arraybuffer.prototype.slice": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", + "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", + "requires": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" + } + }, "asn1.js": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", @@ -3776,11 +5743,15 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, + "available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==" + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "base64-js": { "version": "1.5.1", @@ -3790,8 +5761,7 @@ "bech32": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", - "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", - "peer": true + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" }, "binary-extensions": { "version": "2.2.0", @@ -3808,7 +5778,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3826,8 +5795,7 @@ "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", - "peer": true + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" }, "browser-stdout": { "version": "1.3.1", @@ -3844,6 +5812,25 @@ "ieee754": "^1.2.1" } }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, + "buffer-shims": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "integrity": "sha512-Zy8ZXMyxIT6RMTeY7OP/bDndfj6bwCan7SS98CEndS6deHwWPpseeHlwarNcBim+etXnF9HBc1non5JgDaJU1g==" + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, "camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -3954,11 +5941,29 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "combine-errors": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/combine-errors/-/combine-errors-3.0.3.tgz", + "integrity": "sha512-C8ikRNRMygCwaTx+Ek3Yr+OuZzgZjduCOfSQBjbM8V3MfgcjSTeto/GXP6PAwKvJz/v15b7GHZvx5rOlczFw/Q==", + "requires": { + "custom-error-instance": "2.1.1", + "lodash.uniqby": "4.5.0" + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "core-js": { + "version": "3.32.2", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.32.2.tgz", + "integrity": "sha512-pxXSw1mYZPDGvTQqEc5vgIb83jGQKFGYWY76z4a7weZXUolw3G+OvpZqSRcfYOoOVUQJYEPsWeQK8pKEnUtWxQ==" + }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "create-require": { "version": "1.1.1", @@ -3966,6 +5971,14 @@ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, + "cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "requires": { + "node-fetch": "^2.6.12" + } + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -3984,6 +5997,11 @@ "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz", "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==" }, + "custom-error-instance": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/custom-error-instance/-/custom-error-instance-2.1.1.tgz", + "integrity": "sha512-p6JFxJc3M4OTD2li2qaHkDCw9SfMw82Ldr6OC9Je1aXiGfhx2W8p3GaoeaGrPJTUN9NirTM/KTxHWMUdR1rsUg==" + }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -4014,17 +6032,89 @@ "type-detect": "^4.0.0" } }, + "deep-equal": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.2.tgz", + "integrity": "sha512-xjVyBf0w5vH0I42jdAZzOKVldmPgSulmiyPRywoyq7HXC9qdgo17kxJE+rdnif5Tz6+pIrpJI8dCpMNLIGkUiA==", + "requires": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "es-get-iterator": "^1.1.3", + "get-intrinsic": "^1.2.1", + "is-arguments": "^1.1.1", + "is-array-buffer": "^3.0.2", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "isarray": "^2.0.5", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.0", + "side-channel": "^1.0.4", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.9" + } + }, + "define-data-property": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz", + "integrity": "sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==", + "requires": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + } + }, + "define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "requires": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, + "defined": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", + "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==" + }, "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, + "dotignore": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/dotignore/-/dotignore-0.1.2.tgz", + "integrity": "sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==", + "requires": { + "minimatch": "^3.0.4" + }, + "dependencies": { + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==" + }, "elliptic": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "peer": true, "requires": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -4050,11 +6140,118 @@ "once": "^1.4.0" } }, + "engine.io-client": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.5.2.tgz", + "integrity": "sha512-CQZqbrpEYnrpGqC07a9dJDz4gePZUgTPMU3NKJPSeQOyw27Tst4Pl3FemKoFGAlHzgZmKjoRmiJvbWfhCXUlIg==", + "requires": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.11.0", + "xmlhttprequest-ssl": "~2.0.0" + }, + "dependencies": { + "ws": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", + "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", + "requires": {} + } + } + }, + "engine.io-parser": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.1.tgz", + "integrity": "sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ==" + }, "err-code": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" }, + "es-abstract": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.2.tgz", + "integrity": "sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA==", + "requires": { + "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.2", + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.1", + "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.12", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.1", + "safe-array-concat": "^1.0.1", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.11" + } + }, + "es-get-iterator": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", + "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "has-symbols": "^1.0.3", + "is-arguments": "^1.1.1", + "is-map": "^2.0.2", + "is-set": "^2.0.2", + "is-string": "^1.0.7", + "isarray": "^2.0.5", + "stop-iteration-iterator": "^1.0.0" + } + }, + "es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "requires": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -4082,7 +6279,6 @@ "version": "5.7.2", "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", - "peer": true, "requires": { "@ethersproject/abi": "5.7.0", "@ethersproject/abstract-provider": "5.7.0", @@ -4140,6 +6336,22 @@ "strip-eof": "^1.0.0" } }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha512-UxKlfCRuCBxSXU4C6t9scbDyWZ4VlaFFdojKtzJuSkuOBQ5CNFum+zZXFwHjo+CxBC1t6zlYPgHIgFjL8ggoEQ==", + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" + } + } + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -4165,11 +6377,18 @@ "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "requires": { + "is-callable": "^1.1.3" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "fsevents": { "version": "2.3.2", @@ -4178,6 +6397,27 @@ "dev": true, "optional": true }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + } + }, + "functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==" + }, "get-browser-rtc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/get-browser-rtc/-/get-browser-rtc-1.1.0.tgz", @@ -4195,6 +6435,22 @@ "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", "dev": true }, + "get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + } + }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==" + }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -4204,6 +6460,15 @@ "pump": "^3.0.0" } }, + "get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + } + }, "glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", @@ -4238,17 +6503,100 @@ "is-glob": "^4.0.1" } }, + "globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "requires": { + "define-properties": "^1.1.3" + } + }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "requires": { + "get-intrinsic": "^1.1.3" + } + }, + "graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==" + } + } + }, + "has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==" + }, + "has-dynamic-import": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-dynamic-import/-/has-dynamic-import-2.0.1.tgz", + "integrity": "sha512-X3fbtsZmwb6W7fJGR9o7x65fZoodygCrZ3TVycvghP62yYQfS0t4RS0Qcz+j5tQYUKeSWS09tHkWW6WhFV3XhQ==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + } + }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "requires": { + "get-intrinsic": "^1.1.1" + } + }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==" + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "requires": { + "has-symbols": "^1.0.2" + } + }, "hash.js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "peer": true, "requires": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" @@ -4260,11 +6608,15 @@ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, + "hls.js": { + "version": "1.4.12", + "resolved": "https://registry.npmjs.org/hls.js/-/hls.js-1.4.12.tgz", + "integrity": "sha512-1RBpx2VihibzE3WE9kGoVCtrhhDWTzydzElk/kyRbEOLnb1WIE+3ZabM/L8BqKFTCL3pUy4QzhXgD1Q6Igr1JA==" + }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", - "peer": true, "requires": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -4285,7 +6637,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -4296,12 +6647,49 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "internal-slot": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", + "requires": { + "get-intrinsic": "^1.2.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + } + }, "invert-kv": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", "dev": true }, + "is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + } + }, + "is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "requires": { + "has-bigints": "^1.0.1" + } + }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -4311,12 +6699,47 @@ "binary-extensions": "^2.0.0" } }, + "is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==" + }, + "is-core-module": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "requires": { + "has": "^1.0.3" + } + }, + "is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "requires": { + "has-tostringtag": "^1.0.0" + } + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, + "is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==" + }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -4337,40 +6760,153 @@ "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==" }, + "is-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", + "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==" + }, + "is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==" + }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, + "is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "requires": { + "has-tostringtag": "^1.0.0" + } + }, "is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true }, + "is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-set": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", + "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==" + }, + "is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "requires": { + "call-bind": "^1.0.2" + } + }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", "dev": true }, + "is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "requires": { + "has-symbols": "^1.0.2" + } + }, + "is-typed-array": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "requires": { + "which-typed-array": "^1.1.11" + } + }, "is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true }, + "is-weakmap": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==" + }, + "is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "requires": { + "call-bind": "^1.0.2" + } + }, + "is-weakset": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", + "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + } + }, + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "joi": { + "version": "17.10.2", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.10.2.tgz", + "integrity": "sha512-hcVhjBxRNW/is3nNLdGLIjkgXetkeGc2wyhydhz8KumG23Aerk4HPjU5zaPAMRqXQFc0xNqXTC7+zQjxr0GlKA==", + "requires": { + "@hapi/hoek": "^9.0.0", + "@hapi/topo": "^5.0.0", + "@sideway/address": "^4.1.3", + "@sideway/formula": "^3.0.1", + "@sideway/pinpoint": "^2.0.0" + } + }, + "js-base64": { + "version": "3.7.5", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.5.tgz", + "integrity": "sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA==" + }, "js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "peer": true }, "js-yaml": { @@ -4388,16 +6924,97 @@ "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", "dev": true, "requires": { - "invert-kv": "^2.0.0" + "invert-kv": "^2.0.0" + } + }, + "livepeer": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/livepeer/-/livepeer-2.8.6.tgz", + "integrity": "sha512-8K2lRtpgZKbv6l6cGYYMJW9qpdRKkGUuy7R7xTLkS6NaRQzaeW08vubftmbMHil8v8GX/nDmodcW2vA4oIkP0w==", + "requires": { + "@livepeer/core": "^1.8.6", + "@stitches/core": "^1.2.8", + "core-js": "^3.31.1", + "cross-fetch": "^4.0.0", + "hls.js": "^1.4.9", + "ms": "^3.0.0-canary.1", + "tus-js-client": "^3.1.0", + "zustand": "^4.3.9" + }, + "dependencies": { + "ms": { + "version": "3.0.0-canary.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-3.0.0-canary.1.tgz", + "integrity": "sha512-kh8ARjh8rMN7Du2igDRO9QJnqCb2xYTJxyQYK7vJJS4TvLLmsbyhiKpSW+t+y26gyOyMd0riphX0GeWKU3ky5g==" + } + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lodash._baseiteratee": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash._baseiteratee/-/lodash._baseiteratee-4.7.0.tgz", + "integrity": "sha512-nqB9M+wITz0BX/Q2xg6fQ8mLkyfF7MU7eE+MNBNjTHFKeKaZAPEzEg+E8LWxKWf1DQVflNEn9N49yAuqKh2mWQ==", + "requires": { + "lodash._stringtopath": "~4.8.0" + } + }, + "lodash._basetostring": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz", + "integrity": "sha512-SwcRIbyxnN6CFEEK4K1y+zuApvWdpQdBHM/swxP962s8HIxPO3alBH5t3m/dl+f4CMUug6sJb7Pww8d13/9WSw==" + }, + "lodash._baseuniq": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz", + "integrity": "sha512-Ja1YevpHZctlI5beLA7oc5KNDhGcPixFhcqSiORHNsp/1QTv7amAXzw+gu4YOvErqVlMVyIJGgtzeepCnnur0A==", + "requires": { + "lodash._createset": "~4.0.0", + "lodash._root": "~3.0.0" + } + }, + "lodash._createset": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/lodash._createset/-/lodash._createset-4.0.3.tgz", + "integrity": "sha512-GTkC6YMprrJZCYU3zcqZj+jkXkrXzq3IPBcF/fIPpNEAB4hZEtXU8zp/RwKOvZl43NUmwDbyRk3+ZTbeRdEBXA==" + }, + "lodash._root": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", + "integrity": "sha512-O0pWuFSK6x4EXhM1dhZ8gchNtG7JMqBtrHdoUFUWXD7dJnNSUze1GuyQr5sOs0aCvgGeI3o/OJW8f4ca7FDxmQ==" + }, + "lodash._stringtopath": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/lodash._stringtopath/-/lodash._stringtopath-4.8.0.tgz", + "integrity": "sha512-SXL66C731p0xPDC5LZg4wI5H+dJo/EO4KTqOMwLYCH3+FmmfAKJEZCm6ohGpI+T1xwsDsJCfL4OnhorllvlTPQ==", + "requires": { + "lodash._basetostring": "~4.12.0" } }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, + "lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==" + }, + "lodash.uniqby": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.5.0.tgz", + "integrity": "sha512-IRt7cfTtHy6f1aRVA5n7kT8rgN3N1nH6MOWLcHfpWG2SH19E3JksLK38MktLxZDhlAjCP9jpIXkOnRXlu6oByQ==", "requires": { - "p-locate": "^5.0.0" + "lodash._baseiteratee": "~4.7.0", + "lodash._baseuniq": "~4.6.0" } }, "log-symbols": { @@ -4410,6 +7027,15 @@ "is-unicode-supported": "^0.1.0" } }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "peer": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, "loupe": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", @@ -4459,8 +7085,7 @@ "minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", - "peer": true + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" }, "minimatch": { "version": "5.0.1", @@ -4482,6 +7107,11 @@ } } }, + "minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" + }, "mocha": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", @@ -4786,6 +7416,11 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, + "multiformats": { + "version": "9.9.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", + "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==" + }, "nanoid": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", @@ -4798,6 +7433,14 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -4819,11 +7462,45 @@ "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", "dev": true }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" + }, + "object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" + }, + "object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, "requires": { "wrappy": "1" } @@ -4889,6 +7566,11 @@ "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", "dev": true }, + "parse-ms": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", + "integrity": "sha512-LpH1Cf5EYuVjkBvCDBYvkUPh+iv2bk3FHflxHkpCYT0/FZ1d3N3uJaLiHr4yGuMcFUhv6eAivitTvWZI4B/chg==" + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -4898,8 +7580,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" }, "path-key": { "version": "2.0.1", @@ -4907,6 +7588,11 @@ "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", "dev": true }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, "pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", @@ -4919,6 +7605,36 @@ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, + "plur": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/plur/-/plur-1.0.0.tgz", + "integrity": "sha512-qSnKBSZeDY8ApxwhfVIwKwF36KVJqb1/9nzYYq3j3vdwocULCXT8f8fQGkiw1Nk9BGfxiDagEe/pwakA+bOBqw==" + }, + "pretty-ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-2.1.0.tgz", + "integrity": "sha512-H2enpsxzDhuzRl3zeSQpQMirn8dB0Z/gxW96j06tMfTviUWvX14gjKb7qd1gtkUyYhDPuoNe00K5PqNvy2oQNg==", + "requires": { + "is-finite": "^1.0.1", + "parse-ms": "^1.0.0", + "plur": "^1.0.0" + } + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha512-yN0WQmuCX63LP/TMvAg31nvT6m4vDqJEiiv2CAZqWOGNWutc9DfDk1NPYYmKUFmaVM2UwDowH4u5AHWYP/jxKw==" + }, + "proper-lockfile": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz", + "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==", + "requires": { + "graceful-fs": "^4.2.4", + "retry": "^0.12.0", + "signal-exit": "^3.0.2" + } + }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -4929,6 +7645,11 @@ "once": "^1.3.1" } }, + "querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" + }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -4942,6 +7663,20 @@ "safe-buffer": "^5.1.0" } }, + "re-emitter": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/re-emitter/-/re-emitter-1.1.3.tgz", + "integrity": "sha512-bHJul9CWcocrS+w5e5QrKYXV9NkbSA9hxSEyhYuctwm6keY9NXR2Xt/4A0vbMP0QvuwyfEyb4bkowYXv1ziEbg==" + }, + "react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "peer": true, + "requires": { + "loose-envify": "^1.1.0" + } + }, "readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -4961,6 +7696,21 @@ "picomatch": "^2.2.1" } }, + "regexp.prototype.flags": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", + "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "set-function-name": "^2.0.0" + } + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==" + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -4973,11 +7723,52 @@ "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==", "dev": true }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" + }, + "resolve": { + "version": "2.0.0-next.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", + "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", + "requires": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==" + }, + "safe-array-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", + "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, + "safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + } + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -4986,8 +7777,7 @@ "scrypt-js": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", - "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", - "peer": true + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" }, "semver": { "version": "5.7.1", @@ -5010,6 +7800,16 @@ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, + "set-function-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", + "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "requires": { + "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.0" + } + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -5025,11 +7825,20 @@ "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", "dev": true }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, "signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "simple-peer": { "version": "9.11.1", @@ -5045,6 +7854,42 @@ "readable-stream": "^3.6.0" } }, + "socket.io-client": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.7.2.tgz", + "integrity": "sha512-vtA0uD4ibrYD793SOIAwlo8cj6haOeMHrGvwPxJsxH7CeIksqJ+3Zc06RvWTIFgiSqx4A3sOnTXpfAEE2Zyz6w==", + "requires": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.2", + "engine.io-client": "~6.5.2", + "socket.io-parser": "~4.2.4" + } + }, + "socket.io-parser": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", + "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "requires": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1" + } + }, + "split": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.0.tgz", + "integrity": "sha512-3SVfJe2A0WZg3D+ZEtXqYkvpSGAVaZ1MgufNCeHioBESCqQFsuT1VcQufiopBfJZqh92ZwQ6ddL378iUSbqVNQ==", + "requires": { + "through": "2" + } + }, + "stop-iteration-iterator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", + "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", + "requires": { + "internal-slot": "^1.0.4" + } + }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -5064,6 +7909,36 @@ "strip-ansi": "^6.0.1" } }, + "string.prototype.trim": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", + "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, + "string.prototype.trimend": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", + "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, + "string.prototype.trimstart": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -5102,6 +7977,217 @@ "has-flag": "^4.0.0" } }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + }, + "tap-out": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tap-out/-/tap-out-2.1.0.tgz", + "integrity": "sha512-LJE+TBoVbOWhwdz4+FQk40nmbIuxJLqaGvj3WauQw3NYYU5TdjoV3C0x/yq37YAvVyi+oeBXmWnxWSjJ7IEyUw==", + "requires": { + "re-emitter": "1.1.3", + "readable-stream": "2.2.9", + "split": "1.0.0", + "trim": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "readable-stream": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.9.tgz", + "integrity": "sha512-iuxqX7b7FYt08AriYECxUsK9KTXE3A/FenxIa3IPmvANHxaTP/wGIwwf+IidvvIDk/MsCp/oEV6A8CXo4SDcCg==", + "requires": { + "buffer-shims": "~1.0.0", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~1.0.0", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "tap-spec": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tap-spec/-/tap-spec-5.0.0.tgz", + "integrity": "sha512-zMDVJiE5I6Y4XGjlueGXJIX2YIkbDN44broZlnypT38Hj/czfOXrszHNNJBF/DXR8n+x6gbfSx68x04kIEHdrw==", + "requires": { + "chalk": "^1.0.0", + "duplexer": "^0.1.1", + "figures": "^1.4.0", + "lodash": "^4.17.10", + "pretty-ms": "^2.1.0", + "repeat-string": "^1.5.2", + "tap-out": "^2.1.0", + "through2": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==" + } + } + }, + "tape": { + "version": "5.6.6", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.6.6.tgz", + "integrity": "sha512-rGp2cZ3rfZ6QfTBm6yvohf8aXmDqPyzMKZwTMV12w4i+b/N2Adwlg8PlW8jLqWzlJUZhglyYaLOSrMt/ZlZkAA==", + "requires": { + "@ljharb/resumer": "^0.0.1", + "@ljharb/through": "^2.3.9", + "array.prototype.every": "^1.1.4", + "call-bind": "^1.0.2", + "deep-equal": "^2.2.2", + "defined": "^1.0.1", + "dotignore": "^0.1.2", + "for-each": "^0.3.3", + "get-package-type": "^0.1.0", + "glob": "^7.2.3", + "has": "^1.0.3", + "has-dynamic-import": "^2.0.1", + "inherits": "^2.0.4", + "is-regex": "^1.1.4", + "minimist": "^1.2.8", + "object-inspect": "^1.12.3", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "resolve": "^2.0.0-next.4", + "string.prototype.trim": "^1.2.7" + }, + "dependencies": { + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -5111,6 +8197,16 @@ "is-number": "^7.0.0" } }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "trim": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "integrity": "sha512-YzQV+TZg4AxpKxaTHK3c3D+kRDCGVEE7LemdlQZoQXn0iennk10RsIoY6ikzAqJTc9Xjl9C1/waHom/J86ziAQ==" + }, "ts-node": { "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", @@ -5132,6 +8228,32 @@ "yn": "3.1.1" } }, + "tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, + "tus-js-client": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/tus-js-client/-/tus-js-client-3.1.1.tgz", + "integrity": "sha512-SZzWP62jEFLmROSRZx+uoGLKqsYWMGK/m+PiNehPVWbCm7/S9zRIMaDxiaOcKdMnFno4luaqP5E+Y1iXXPjP0A==", + "requires": { + "buffer-from": "^1.1.2", + "combine-errors": "^3.0.3", + "is-stream": "^2.0.0", + "js-base64": "^3.7.2", + "lodash.throttle": "^4.1.1", + "proper-lockfile": "^4.1.2", + "url-parse": "^1.5.7" + }, + "dependencies": { + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + } + } + }, "tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", @@ -5148,12 +8270,81 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, + "typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + } + }, + "typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "requires": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + } + }, + "typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "requires": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + } + }, + "typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "requires": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + } + }, "typescript": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz", "integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==", "dev": true }, + "unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "requires": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + } + }, + "url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "requires": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "use-sync-external-store": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", + "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "requires": {} + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -5165,6 +8356,25 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, + "video-stream-merger": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/video-stream-merger/-/video-stream-merger-4.0.1.tgz", + "integrity": "sha512-VazYSr8tk6S/zkOq5jpR/ryy1HnGxm5XCw+d2Ejpqy1m6d71oZpyFG82dUkgAo7dg/lk3k4TqvJPtuRUtR8URA==" + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -5174,12 +8384,47 @@ "isexe": "^2.0.0" } }, + "which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "requires": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + } + }, + "which-collection": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", + "requires": { + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-weakmap": "^2.0.1", + "is-weakset": "^2.0.1" + } + }, "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", "dev": true }, + "which-typed-array": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", + "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "requires": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + } + }, "workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", @@ -5200,16 +8445,24 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "ws": { "version": "7.4.6", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", - "peer": true, "requires": {} }, + "xmlhttprequest-ssl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz", + "integrity": "sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + }, "y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -5260,6 +8513,14 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true + }, + "zustand": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.4.1.tgz", + "integrity": "sha512-QCPfstAS4EBiTQzlaGP1gmorkh/UL1Leaj2tdj+zZCZ/9bm0WS7sI2wnfD5lpOszFqWJ1DcPnGoY8RDL61uokw==", + "requires": { + "use-sync-external-store": "1.2.0" + } } } } diff --git a/packages/restapi/package.json b/packages/restapi/package.json index fc72b0867..c9d214e70 100644 --- a/packages/restapi/package.json +++ b/packages/restapi/package.json @@ -1,6 +1,6 @@ { "name": "@pushprotocol/restapi", - "version": "1.4.11", + "version": "0.0.1-alpha.44", "type": "commonjs", "publishConfig": { "registry": "https://registry.npmjs.org/" @@ -11,6 +11,7 @@ "dependencies": { "@ambire/signature-validator": "^1.3.1", "@metamask/eth-sig-util": "^5.0.2", + "@pushprotocol/socket": "^0.5.2", "buffer": "^6.0.3", "crypto-js": "^4.1.1", "immer": "^10.0.2", diff --git a/packages/restapi/project.json b/packages/restapi/project.json index 90d27ba83..48ed574a1 100644 --- a/packages/restapi/project.json +++ b/packages/restapi/project.json @@ -43,7 +43,7 @@ "options": { "preset": "angular", "commitMessageFormat": "ci(${projectName}): šŸŽ‰ cut beta release to ${projectName}-v${version}", - "postTargets": ["restapi:build", "restapi:ci-publish"], + "postTargets": ["socket:build", "restapi:build", "restapi:ci-publish"], "version": "prerelease", "preid": "alpha" } diff --git a/packages/restapi/src/lib/abis/comm.ts b/packages/restapi/src/lib/abis/comm.ts new file mode 100644 index 000000000..31b7c27d7 --- /dev/null +++ b/packages/restapi/src/lib/abis/comm.ts @@ -0,0 +1,520 @@ +export const commABI = [ + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'channel', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'delegate', + type: 'address', + }, + ], + name: 'AddDelegate', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'string', + name: '_chainName', + type: 'string', + }, + { + indexed: true, + internalType: 'uint256', + name: '_chainID', + type: 'uint256', + }, + { + indexed: true, + internalType: 'address', + name: '_channelOwnerAddress', + type: 'address', + }, + { + indexed: false, + internalType: 'string', + name: '_ethereumChannelAddress', + type: 'string', + }, + ], + name: 'ChannelAlias', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: 'publickey', + type: 'bytes', + }, + ], + name: 'PublicKeyRegistered', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'channel', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'delegate', + type: 'address', + }, + ], + name: 'RemoveDelegate', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'channel', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: 'identity', + type: 'bytes', + }, + ], + name: 'SendNotification', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'channel', + type: 'address', + }, + { indexed: true, internalType: 'address', name: 'user', type: 'address' }, + ], + name: 'Subscribe', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'channel', + type: 'address', + }, + { indexed: true, internalType: 'address', name: 'user', type: 'address' }, + ], + name: 'Unsubscribe', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: '_channel', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: '_user', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: '_notifID', + type: 'uint256', + }, + { + indexed: false, + internalType: 'string', + name: '_notifSettings', + type: 'string', + }, + ], + name: 'UserNotifcationSettingsAdded', + type: 'event', + }, + { + inputs: [], + name: 'DOMAIN_TYPEHASH', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'EPNSCoreAddress', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'NAME_HASH', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'SEND_NOTIFICATION_TYPEHASH', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'SUBSCRIBE_TYPEHASH', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'UNSUBSCRIBE_TYPEHASH', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '_delegate', type: 'address' }], + name: 'addDelegate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address[]', name: '_channelList', type: 'address[]' }, + ], + name: 'batchSubscribe', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address[]', name: '_channelList', type: 'address[]' }, + ], + name: 'batchUnsubscribe', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes', name: '_publicKey', type: 'bytes' }], + name: 'broadcastUserPublicKey', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'chainID', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'chainName', + outputs: [{ internalType: 'string', name: '', type: 'string' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '_channel', type: 'address' }, + { internalType: 'uint256', name: '_notifID', type: 'uint256' }, + { internalType: 'string', name: '_notifSettings', type: 'string' }, + ], + name: 'changeUserChannelSettings', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'completeMigration', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '', type: 'address' }, + { internalType: 'address', name: '', type: 'address' }, + ], + name: 'delegatedNotificationSenders', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes', name: '_publicKey', type: 'bytes' }], + name: 'getWalletFromPublicKey', + outputs: [{ internalType: 'address', name: 'wallet', type: 'address' }], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'governance', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '_pushChannelAdmin', type: 'address' }, + { internalType: 'string', name: '_chainName', type: 'string' }, + ], + name: 'initialize', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'isMigrationComplete', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '_channel', type: 'address' }, + { internalType: 'address', name: '_user', type: 'address' }, + ], + name: 'isUserSubscribed', + outputs: [{ internalType: 'bool', name: 'isSubscriber', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + name: 'mapAddressUsers', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: '_startIndex', type: 'uint256' }, + { internalType: 'uint256', name: '_endIndex', type: 'uint256' }, + { internalType: 'address[]', name: '_channelList', type: 'address[]' }, + { internalType: 'address[]', name: '_usersList', type: 'address[]' }, + ], + name: 'migrateSubscribeData', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [{ internalType: 'string', name: '', type: 'string' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '', type: 'address' }], + name: 'nonces', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'pushChannelAdmin', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '_delegate', type: 'address' }], + name: 'removeDelegate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '_channel', type: 'address' }, + { internalType: 'address', name: '_recipient', type: 'address' }, + { internalType: 'bytes', name: '_identity', type: 'bytes' }, + { internalType: 'uint256', name: 'nonce', type: 'uint256' }, + { internalType: 'uint256', name: 'expiry', type: 'uint256' }, + { internalType: 'uint8', name: 'v', type: 'uint8' }, + { internalType: 'bytes32', name: 'r', type: 'bytes32' }, + { internalType: 'bytes32', name: 's', type: 'bytes32' }, + ], + name: 'sendNotifBySig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '_channel', type: 'address' }, + { internalType: 'address', name: '_recipient', type: 'address' }, + { internalType: 'bytes', name: '_identity', type: 'bytes' }, + ], + name: 'sendNotification', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '_coreAddress', type: 'address' }, + ], + name: 'setEPNSCoreAddress', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '_governanceAddress', type: 'address' }, + ], + name: 'setGovernanceAddress', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '_channel', type: 'address' }], + name: 'subscribe', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'channel', type: 'address' }, + { internalType: 'uint256', name: 'nonce', type: 'uint256' }, + { internalType: 'uint256', name: 'expiry', type: 'uint256' }, + { internalType: 'uint8', name: 'v', type: 'uint8' }, + { internalType: 'bytes32', name: 'r', type: 'bytes32' }, + { internalType: 'bytes32', name: 's', type: 'bytes32' }, + ], + name: 'subscribeBySig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '_channel', type: 'address' }, + { internalType: 'address', name: '_user', type: 'address' }, + ], + name: 'subscribeViaCore', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '_newAdmin', type: 'address' }], + name: 'transferPushChannelAdminControl', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '_channel', type: 'address' }], + name: 'unsubscribe', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'channel', type: 'address' }, + { internalType: 'uint256', name: 'nonce', type: 'uint256' }, + { internalType: 'uint256', name: 'expiry', type: 'uint256' }, + { internalType: 'uint8', name: 'v', type: 'uint8' }, + { internalType: 'bytes32', name: 'r', type: 'bytes32' }, + { internalType: 'bytes32', name: 's', type: 'bytes32' }, + ], + name: 'unsubscribeBySig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '', type: 'address' }, + { internalType: 'address', name: '', type: 'address' }, + ], + name: 'userToChannelNotifs', + outputs: [{ internalType: 'string', name: '', type: 'string' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '', type: 'address' }], + name: 'users', + outputs: [ + { internalType: 'bool', name: 'userActivated', type: 'bool' }, + { internalType: 'bool', name: 'publicKeyRegistered', type: 'bool' }, + { internalType: 'uint256', name: 'userStartBlock', type: 'uint256' }, + { internalType: 'uint256', name: 'subscribedCount', type: 'uint256' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'usersCount', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'string', name: '_channelAddress', type: 'string' }, + ], + name: 'verifyChannelAlias', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +] as const; diff --git a/packages/restapi/src/lib/abis/core.ts b/packages/restapi/src/lib/abis/core.ts new file mode 100644 index 000000000..6032a8b3d --- /dev/null +++ b/packages/restapi/src/lib/abis/core.ts @@ -0,0 +1,957 @@ +export const coreABI = [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'channel', + type: 'address', + }, + { + indexed: true, + internalType: 'enum EPNSCoreStorageV1_5.ChannelType', + name: 'channelType', + type: 'uint8', + }, + { + indexed: false, + internalType: 'bytes', + name: 'identity', + type: 'bytes', + }, + ], + name: 'AddChannel', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'channel', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: '_subGraphData', + type: 'bytes', + }, + ], + name: 'AddSubGraph', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'channel', + type: 'address', + }, + ], + name: 'ChannelBlocked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: '_channel', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalNotifOptions', + type: 'uint256', + }, + { + indexed: false, + internalType: 'string', + name: '_notifSettings', + type: 'string', + }, + { + indexed: false, + internalType: 'string', + name: '_notifDescription', + type: 'string', + }, + ], + name: 'ChannelNotifcationSettingsAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'channel', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'ChannelOwnershipTransfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'channel', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'revoker', + type: 'address', + }, + ], + name: 'ChannelVerificationRevoked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'channel', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'verifier', + type: 'address', + }, + ], + name: 'ChannelVerified', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'address', name: 'user', type: 'address' }, + { + indexed: true, + internalType: 'uint256', + name: 'amountClaimed', + type: 'uint256', + }, + ], + name: 'ChatIncentiveClaimed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'channel', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'amountRefunded', + type: 'uint256', + }, + ], + name: 'DeactivateChannel', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'requestSender', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'requestReceiver', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountForReqReceiver', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'feePoolAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + name: 'IncentivizeChatReqReceived', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'Paused', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'channel', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'amountDeposited', + type: 'uint256', + }, + ], + name: 'ReactivateChannel', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'address', name: 'user', type: 'address' }, + { + indexed: false, + internalType: 'uint256', + name: 'rewardAmount', + type: 'uint256', + }, + ], + name: 'RewardsClaimed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'address', name: 'user', type: 'address' }, + { + indexed: true, + internalType: 'uint256', + name: 'rewardAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'fromEpoch', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'tillEpoch', + type: 'uint256', + }, + ], + name: 'RewardsHarvested', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'address', name: 'user', type: 'address' }, + { + indexed: true, + internalType: 'uint256', + name: 'amountStaked', + type: 'uint256', + }, + ], + name: 'Staked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'channel', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'amountRefunded', + type: 'uint256', + }, + ], + name: 'TimeBoundChannelDestroyed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'Unpaused', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'address', name: 'user', type: 'address' }, + { + indexed: true, + internalType: 'uint256', + name: 'amountUnstaked', + type: 'uint256', + }, + ], + name: 'Unstaked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'channel', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: 'identity', + type: 'bytes', + }, + { + indexed: true, + internalType: 'uint256', + name: 'amountDeposited', + type: 'uint256', + }, + ], + name: 'UpdateChannel', + type: 'event', + }, + { + inputs: [], + name: 'ADD_CHANNEL_MIN_FEES', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'CHANNEL_POOL_FUNDS', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'CREATE_CHANNEL_TYPEHASH', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DOMAIN_TYPEHASH', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'FEE_AMOUNT', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'MIN_POOL_CONTRIBUTION', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PROTOCOL_POOL_FEES', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PUSH_TOKEN_ADDRESS', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'REFERRAL_CODE', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'UNISWAP_V2_ROUTER', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'WETH_ADDRESS', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'aDaiAddress', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: '_rewardAmount', type: 'uint256' }, + ], + name: 'addPoolFees', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes', name: '_subGraphData', type: 'bytes' }], + name: 'addSubGraph', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: '_startIndex', type: 'uint256' }, + { internalType: 'uint256', name: '_endIndex', type: 'uint256' }, + { internalType: 'address[]', name: '_channelList', type: 'address[]' }, + ], + name: 'batchVerification', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '_channelAddress', type: 'address' }, + ], + name: 'blockChannel', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '_user', type: 'address' }, + { internalType: 'uint256', name: '_epochId', type: 'uint256' }, + ], + name: 'calculateEpochRewards', + outputs: [{ internalType: 'uint256', name: 'rewards', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '', type: 'address' }], + name: 'celebUserFunds', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + name: 'channelById', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '', type: 'address' }], + name: 'channelNotifSettings', + outputs: [{ internalType: 'string', name: '', type: 'string' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '', type: 'address' }], + name: 'channelUpdateCounter', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '', type: 'address' }], + name: 'channels', + outputs: [ + { + internalType: 'enum EPNSCoreStorageV1_5.ChannelType', + name: 'channelType', + type: 'uint8', + }, + { internalType: 'uint8', name: 'channelState', type: 'uint8' }, + { internalType: 'address', name: 'verifiedBy', type: 'address' }, + { internalType: 'uint256', name: 'poolContribution', type: 'uint256' }, + { internalType: 'uint256', name: 'channelHistoricalZ', type: 'uint256' }, + { + internalType: 'uint256', + name: 'channelFairShareCount', + type: 'uint256', + }, + { internalType: 'uint256', name: 'channelLastUpdate', type: 'uint256' }, + { internalType: 'uint256', name: 'channelStartBlock', type: 'uint256' }, + { internalType: 'uint256', name: 'channelUpdateBlock', type: 'uint256' }, + { internalType: 'uint256', name: 'channelWeight', type: 'uint256' }, + { internalType: 'uint256', name: 'expiryTime', type: 'uint256' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'channelsCount', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: '_amount', type: 'uint256' }], + name: 'claimChatIncentives', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: '_notifOptions', type: 'uint256' }, + { internalType: 'string', name: '_notifSettings', type: 'string' }, + { internalType: 'string', name: '_notifDescription', type: 'string' }, + { internalType: 'uint256', name: '_amountDeposited', type: 'uint256' }, + ], + name: 'createChannelSettings', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'enum EPNSCoreStorageV1_5.ChannelType', + name: '_channelType', + type: 'uint8', + }, + { internalType: 'bytes', name: '_identity', type: 'bytes' }, + { internalType: 'uint256', name: '_amount', type: 'uint256' }, + { internalType: 'uint256', name: '_channelExpiryTime', type: 'uint256' }, + ], + name: 'createChannelWithPUSH', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'daiAddress', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: '_tillEpoch', type: 'uint256' }], + name: 'daoHarvestPaginated', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'deactivateChannel', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '_channelAddress', type: 'address' }, + ], + name: 'destroyTimeBoundChannel', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'epnsCommunicator', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'epochDuration', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + name: 'epochRewards', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + name: 'epochToTotalStakedWeight', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'genesisEpoch', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '_channel', type: 'address' }], + name: 'getChannelVerfication', + outputs: [ + { internalType: 'uint8', name: 'verificationStatus', type: 'uint8' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'governance', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'groupFairShareCount', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'groupHistoricalZ', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'groupLastUpdate', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'groupNormalizedWeight', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'requestSender', type: 'address' }, + { internalType: 'address', name: 'requestReceiver', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + ], + name: 'handleChatRequestData', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'harvestAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: '_tillEpoch', type: 'uint256' }], + name: 'harvestPaginated', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '_pushChannelAdmin', type: 'address' }, + { internalType: 'address', name: '_pushTokenAddress', type: 'address' }, + { internalType: 'address', name: '_wethAddress', type: 'address' }, + { + internalType: 'address', + name: '_uniswapRouterAddress', + type: 'address', + }, + { + internalType: 'address', + name: '_lendingPoolProviderAddress', + type: 'address', + }, + { internalType: 'address', name: '_daiAddress', type: 'address' }, + { internalType: 'address', name: '_aDaiAddress', type: 'address' }, + { internalType: 'uint256', name: '_referralCode', type: 'uint256' }, + ], + name: 'initialize', + outputs: [{ internalType: 'bool', name: 'success', type: 'bool' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'initializeStake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'isMigrationComplete', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: '_from', type: 'uint256' }, + { internalType: 'uint256', name: '_to', type: 'uint256' }, + ], + name: 'lastEpochRelative', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'lendingPoolProviderAddress', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [{ internalType: 'string', name: '', type: 'string' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '', type: 'address' }], + name: 'nonces', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'pauseContract', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'paused', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'previouslySetEpochRewards', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'pushChannelAdmin', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: '_amount', type: 'uint256' }], + name: 'reactivateChannel', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '_commAddress', type: 'address' }, + ], + name: 'setEpnsCommunicatorAddress', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: '_newFees', type: 'uint256' }], + name: 'setFeeAmount', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '_governanceAddress', type: 'address' }, + ], + name: 'setGovernanceAddress', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: '_newFees', type: 'uint256' }], + name: 'setMinChannelCreationFees', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: '_newAmount', type: 'uint256' }], + name: 'setMinPoolContribution', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: '_amount', type: 'uint256' }], + name: 'stake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'totalStakedAmount', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '_newAdmin', type: 'address' }], + name: 'transferPushChannelAdminControl', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'unPauseContract', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'unstake', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '_channel', type: 'address' }], + name: 'unverifyChannel', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '_channel', type: 'address' }, + { internalType: 'bytes', name: '_newIdentity', type: 'bytes' }, + { internalType: 'uint256', name: '_amount', type: 'uint256' }, + ], + name: 'updateChannelMeta', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '', type: 'address' }], + name: 'userFeesInfo', + outputs: [ + { internalType: 'uint256', name: 'stakedAmount', type: 'uint256' }, + { internalType: 'uint256', name: 'stakedWeight', type: 'uint256' }, + { internalType: 'uint256', name: 'lastStakedBlock', type: 'uint256' }, + { internalType: 'uint256', name: 'lastClaimedBlock', type: 'uint256' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '', type: 'address' }], + name: 'usersRewardsClaimed', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '_channel', type: 'address' }], + name: 'verifyChannel', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +] as const; diff --git a/packages/restapi/src/lib/abis/token.ts b/packages/restapi/src/lib/abis/token.ts new file mode 100644 index 000000000..a68265ba9 --- /dev/null +++ b/packages/restapi/src/lib/abis/token.ts @@ -0,0 +1,709 @@ +export const tokenABI = [ + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'delegator', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'fromDelegate', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'toDelegate', + type: 'address', + }, + ], + name: 'DelegateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'delegate', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'previousBalance', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newBalance', + type: 'uint256', + }, + ], + name: 'DelegateVotesChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'holder', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'weight', + type: 'uint256', + }, + ], + name: 'HolderWeightChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + inputs: [], + name: 'DELEGATION_TYPEHASH', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DOMAIN_TYPEHASH', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PERMIT_TYPEHASH', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'rawAmount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'born', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'rawAmount', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint32', + name: '', + type: 'uint32', + }, + ], + name: 'checkpoints', + outputs: [ + { + internalType: 'uint32', + name: 'fromBlock', + type: 'uint32', + }, + { + internalType: 'uint96', + name: 'votes', + type: 'uint96', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + ], + name: 'delegate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegatee', + type: 'address', + }, + { + internalType: 'uint256', + name: 'nonce', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expiry', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'delegateBySig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'delegates', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'getCurrentVotes', + outputs: [ + { + internalType: 'uint96', + name: '', + type: 'uint96', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'blockNumber', + type: 'uint256', + }, + ], + name: 'getPriorVotes', + outputs: [ + { + internalType: 'uint96', + name: '', + type: 'uint96', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'holderDelegation', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'holderWeight', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'nonces', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'numCheckpoints', + outputs: [ + { + internalType: 'uint32', + name: '', + type: 'uint32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'rawAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'permit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'holder', + type: 'address', + }, + ], + name: 'resetHolderWeight', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'address', + name: 'delegate', + type: 'address', + }, + ], + name: 'returnHolderDelegation', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'returnHolderRatio', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'delegate', + type: 'address', + }, + { + internalType: 'bool', + name: 'value', + type: 'bool', + }, + ], + name: 'setHolderDelegation', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'dst', + type: 'address', + }, + { + internalType: 'uint256', + name: 'rawAmount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'src', + type: 'address', + }, + { + internalType: 'address', + name: 'dst', + type: 'address', + }, + { + internalType: 'uint256', + name: 'rawAmount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, +] as const; diff --git a/packages/restapi/src/lib/chat/getGroupMemberStatus.ts b/packages/restapi/src/lib/chat/getGroupMemberStatus.ts new file mode 100644 index 000000000..8c9f0282c --- /dev/null +++ b/packages/restapi/src/lib/chat/getGroupMemberStatus.ts @@ -0,0 +1,54 @@ +import axios from 'axios'; +import { getAPIBaseUrls } from '../helpers'; +import Constants, { ENV } from '../constants'; +import { GroupAccess, GroupMemberStatus } from '../types'; +import { getUserDID } from './helpers'; + +/** + * GET /v1/chat/groups/:chatId/access/:did + */ + +export interface GetGroupMemberStatusType { + chatId: string; + did: string; // Decentralized Identifier + env?: ENV; +} + +export const getGroupMemberStatus = async ( + options: GetGroupMemberStatusType +): Promise => { + // Replace "any" with the actual response type + const { chatId, did, env = Constants.ENV.PROD } = options || {}; + try { + if (chatId == null || chatId.length === 0) { + throw new Error(`chatId cannot be null or empty`); + } + + if (did == null || did.length === 0) { + throw new Error(`did cannot be null or empty`); + } + + const user = await getUserDID(did, env); + + const API_BASE_URL = getAPIBaseUrls(env); + const requestUrl = `${API_BASE_URL}/v1/chat/groups/${chatId}/members/${user}/status`; + + return axios + .get(requestUrl) + .then((response) => { + return response.data; + }) + .catch((err) => { + if (err?.response?.data) throw new Error(err?.response?.data); + throw new Error(err); + }); + } catch (err) { + console.error( + `[Push SDK] - API - Error - API ${getGroupMemberStatus.name} -: `, + err + ); + throw Error( + `[Push SDK] - API - Error - API ${getGroupMemberStatus.name} -: ${err}` + ); + } +}; diff --git a/packages/restapi/src/lib/chat/helpers/payloadHelper.ts b/packages/restapi/src/lib/chat/helpers/payloadHelper.ts index c624d31de..16d8eaaf4 100644 --- a/packages/restapi/src/lib/chat/helpers/payloadHelper.ts +++ b/packages/restapi/src/lib/chat/helpers/payloadHelper.ts @@ -258,7 +258,7 @@ export const groupDtoToSpaceDto = (groupDto: GroupDTO): SpaceDTO => { if (groupDto.rules) { spaceDto.rules = { - spaceAccess: groupDto.rules.groupAccess, + entry: groupDto.rules.entry, }; } @@ -267,23 +267,23 @@ export const groupDtoToSpaceDto = (groupDto: GroupDTO): SpaceDTO => { export const convertSpaceRulesToRules = (spaceRules: SpaceRules): Rules => { return { - groupAccess: spaceRules.spaceAccess, - chatAccess: undefined, + entry: spaceRules.entry, + chat: undefined, }; }; export const convertRulesToSpaceRules = (rules: Rules): SpaceRules => { return { - spaceAccess: rules.groupAccess, + entry: rules.entry, }; }; export const groupAccessToSpaceAccess = (group: GroupAccess): SpaceAccess => { const spaceAccess: SpaceAccess = { - spaceAccess: group.groupAccess, + entry: group.entry, }; - // If rules are present in the groupAccess, map them to the spaceAccess + // If rules are present in the entry, map them to the spaceAccess if (group.rules) { spaceAccess.rules = convertRulesToSpaceRules(group.rules); } diff --git a/packages/restapi/src/lib/chat/index.ts b/packages/restapi/src/lib/chat/index.ts index 54660ee0c..64512ed4b 100644 --- a/packages/restapi/src/lib/chat/index.ts +++ b/packages/restapi/src/lib/chat/index.ts @@ -21,3 +21,4 @@ export * from './removeAdmins'; export * from './getGroupAccess'; export * from './searchGroups'; export * from './rejectRequest'; +export * from './getGroupMemberStatus'; diff --git a/packages/restapi/src/lib/chat/rejectRequest.ts b/packages/restapi/src/lib/chat/rejectRequest.ts index 05bf8226f..57c884e3d 100644 --- a/packages/restapi/src/lib/chat/rejectRequest.ts +++ b/packages/restapi/src/lib/chat/rejectRequest.ts @@ -80,7 +80,7 @@ export const reject = async ( signature ); - axios + return axios .put(apiEndpoint, body) .then((response) => { return response.data; diff --git a/packages/restapi/src/lib/config.ts b/packages/restapi/src/lib/config.ts index 20d902c0a..36f9e6ddc 100644 --- a/packages/restapi/src/lib/config.ts +++ b/packages/restapi/src/lib/config.ts @@ -1,5 +1,19 @@ import Constants from './constants'; - +import { coreABI } from './abis/core'; +import { commABI } from './abis/comm'; +import { tokenABI } from './abis/token'; +import { + mainnet, + goerli, + polygon, + polygonMumbai, + bsc, + bscTestnet, + optimism, + optimismGoerli, + polygonZkEvm, + polygonZkEvmTestnet, +} from 'viem/chains'; const { ENV } = Constants; // for methods not needing the entire config @@ -31,6 +45,12 @@ const BLOCKCHAIN_NETWORK = { export type ALIAS_CHAIN = 'POLYGON' | 'BSC' | 'OPTIMISM' | 'POLYGONZKEVM' | "ARBITRUMONE"; +export const ETH_CHAIN_ID = { + [ENV.PROD]: 1, + [ENV.STAGING]: 5, + [ENV.DEV]: 5, + [ENV.LOCAL]: 5, +}; export const ALIAS_CHAIN_ID = { POLYGON: { [ENV.PROD]: 137, @@ -54,7 +74,7 @@ export const ALIAS_CHAIN_ID = { [ENV.PROD]: 1101, [ENV.STAGING]: 1442, [ENV.DEV]: 1442, - [ENV.LOCAL]: 420, + [ENV.LOCAL]: 1442, }, ARBITRUMONE: { [ENV.PROD]: 42161, @@ -64,11 +84,76 @@ export const ALIAS_CHAIN_ID = { } }; +export const CHAIN_ID = { + ETHEREUM: ETH_CHAIN_ID, + ...ALIAS_CHAIN_ID, +}; + +export const CHAIN_NAME: { [key: number]: string } = { + // eth + 1: 'ETHEREUM', + 5: 'ETHEREUM', + // polygon + 137: 'POLYGON', + 80001: 'POLYGON', + // bsc + 56: 'BSC', + 97: 'BSC', + // optimism + 10: 'OPTIMISM', + 420: 'OPTIMISM', + // plygonzkevm + 1101: 'POLYGONZKEVM', + 1442: 'POLYGONZKEVM', +}; export interface ConfigType { API_BASE_URL: string; EPNS_COMMUNICATOR_CONTRACT: string; } + +export const VIEM_CORE_CONFIG = { + [ENV.PROD]: { + NETWORK: mainnet, + API_BASE_URL: API_BASE_URL[ENV.PROD], + EPNS_CORE_CONTRACT: '0x66329Fdd4042928BfCAB60b179e1538D56eeeeeE', + }, + [ENV.STAGING]: { + NETWORK: goerli, + API_BASE_URL: API_BASE_URL[ENV.STAGING], + EPNS_CORE_CONTRACT: '0xd4E3ceC407cD36d9e3767cD189ccCaFBF549202C', + }, + [ENV.DEV]: { + NETWORK: goerli, + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_CORE_CONTRACT: '0x23346B732d56d34EC4e890419fBFB8548216a799', + }, + [ENV.LOCAL]: { + NETWORK: goerli, + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_CORE_CONTRACT: '0x23346B732d56d34EC4e890419fBFB8548216a799', + }, +}; + +export const CORE_CONFIG = { + [ENV.PROD]: { + API_BASE_URL: API_BASE_URL[ENV.PROD], + EPNS_CORE_CONTRACT: '0x66329Fdd4042928BfCAB60b179e1538D56eeeeeE', + }, + [ENV.STAGING]: { + API_BASE_URL: API_BASE_URL[ENV.STAGING], + EPNS_CORE_CONTRACT: '0xd4E3ceC407cD36d9e3767cD189ccCaFBF549202C', + }, + [ENV.DEV]: { + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_CORE_CONTRACT: '0x23346B732d56d34EC4e890419fBFB8548216a799', + }, + [ENV.LOCAL]: { + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_CORE_CONTRACT: '0x23346B732d56d34EC4e890419fBFB8548216a799', + }, +}; + const CONFIG = { [ENV.PROD]: { [BLOCKCHAIN_NETWORK.ETH_MAINNET]: { @@ -177,3 +262,145 @@ const CONFIG = { }; export default CONFIG; +export const TOKEN = { + [ENV.PROD]: '0xf418588522d5dd018b425E472991E52EBBeEEEEE', + [ENV.STAGING]: '0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33', + [ENV.DEV]: '0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33', + [ENV.LOCAL]: '0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33', +}; + +export const TOKEN_VIEM_NETWORK_MAP = { + [ENV.PROD]: mainnet, + [ENV.STAGING]: goerli, + [ENV.DEV]: goerli, + [ENV.LOCAL]: goerli, +} + +export const MIN_TOKEN_BALANCE = { + [ENV.PROD]: 50, + [ENV.STAGING]: 50, + [ENV.DEV]: 50, + [ENV.LOCAL]: 50, +}; +export const ABIS = { + CORE: coreABI, + COMM: commABI, + TOKEN: tokenABI, +}; + +export const CHANNEL_TYPE = { + TIMEBOUND: 4, + GENERAL: 2, +}; + + +export const VIEM_CONFIG = { + [ENV.PROD]: { + [BLOCKCHAIN_NETWORK.ETH_MAINNET]: { + NETWORK: mainnet, + API_BASE_URL: API_BASE_URL[ENV.PROD], + EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', + }, + [BLOCKCHAIN_NETWORK.POLYGON_MAINNET]: { + NETWORK: polygon, + API_BASE_URL: API_BASE_URL[ENV.PROD], + EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', + }, + [BLOCKCHAIN_NETWORK.BSC_MAINNET]: { + NETWORK: bsc, + API_BASE_URL: API_BASE_URL[ENV.PROD], + EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', + }, + [BLOCKCHAIN_NETWORK.OPTIMISM_MAINNET]: { + NETWORK: optimism, + API_BASE_URL: API_BASE_URL[ENV.PROD], + EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', + }, + [BLOCKCHAIN_NETWORK.POLYGON_ZK_EVM_MAINNET]: { + NETWORK: polygonZkEvm, + API_BASE_URL: API_BASE_URL[ENV.PROD], + EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', + }, + }, + [ENV.STAGING]: { + [BLOCKCHAIN_NETWORK.ETH_GOERLI]: { + NETWORK: goerli, + API_BASE_URL: API_BASE_URL[ENV.STAGING], + EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', + }, + [BLOCKCHAIN_NETWORK.POLYGON_MUMBAI]: { + NETWORK: polygonMumbai, + API_BASE_URL: API_BASE_URL[ENV.STAGING], + EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', + }, + [BLOCKCHAIN_NETWORK.BSC_TESTNET]: { + NETWORK: bscTestnet, + API_BASE_URL: API_BASE_URL[ENV.STAGING], + EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', + }, + [BLOCKCHAIN_NETWORK.OPTIMISM_TESTNET]: { + NETWORK: optimismGoerli, + API_BASE_URL: API_BASE_URL[ENV.STAGING], + EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', + }, + [BLOCKCHAIN_NETWORK.POLYGON_ZK_EVM_TESTNET]: { + NETWORK: polygonZkEvmTestnet, + API_BASE_URL: API_BASE_URL[ENV.STAGING], + EPNS_COMMUNICATOR_CONTRACT: '0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa', + }, + }, + [ENV.DEV]: { + [BLOCKCHAIN_NETWORK.ETH_GOERLI]: { + NETWORK: goerli, + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_COMMUNICATOR_CONTRACT: '0xc064F30bac07e84500c97A04D21a9d1bfFC72Ec0', + }, + [BLOCKCHAIN_NETWORK.POLYGON_MUMBAI]: { + NETWORK: polygonMumbai, + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_COMMUNICATOR_CONTRACT: '0xAf55BE8e6b0d6107891bA76eADeEa032ef8A4504', + }, + [BLOCKCHAIN_NETWORK.BSC_TESTNET]: { + NETWORK: bscTestnet, + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_COMMUNICATOR_CONTRACT: '0x4132061E3349ff36cFfCadA460E10Bd4f31F7ea8', + }, + [BLOCKCHAIN_NETWORK.OPTIMISM_TESTNET]: { + NETWORK: optimismGoerli, + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_COMMUNICATOR_CONTRACT: '0x4305D572F2bf38Fc2AE8D0172055b1EFd18F57a6', + }, + [BLOCKCHAIN_NETWORK.POLYGON_ZK_EVM_TESTNET]: { + NETWORK: polygonZkEvmTestnet, + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_COMMUNICATOR_CONTRACT: '0x630b152e4185c63D7177c656b56b26f878C61572', + }, + }, + [ENV.LOCAL]: { + [BLOCKCHAIN_NETWORK.ETH_GOERLI]: { + NETWORK: goerli, + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_COMMUNICATOR_CONTRACT: '0xc064F30bac07e84500c97A04D21a9d1bfFC72Ec0', + }, + [BLOCKCHAIN_NETWORK.POLYGON_MUMBAI]: { + NETWORK: polygonMumbai, + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_COMMUNICATOR_CONTRACT: '0xAf55BE8e6b0d6107891bA76eADeEa032ef8A4504', + }, + [BLOCKCHAIN_NETWORK.BSC_TESTNET]: { + NETWORK: bscTestnet, + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_COMMUNICATOR_CONTRACT: '0x4132061E3349ff36cFfCadA460E10Bd4f31F7ea8', + }, + [BLOCKCHAIN_NETWORK.OPTIMISM_TESTNET]: { + NETWORK: optimismGoerli, + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_COMMUNICATOR_CONTRACT: '0x4305D572F2bf38Fc2AE8D0172055b1EFd18F57a6', + }, + [BLOCKCHAIN_NETWORK.POLYGON_ZK_EVM_TESTNET]: { + NETWORK: polygonZkEvmTestnet, + API_BASE_URL: API_BASE_URL[ENV.DEV], + EPNS_COMMUNICATOR_CONTRACT: '0x630b152e4185c63D7177c656b56b26f878C61572', + }, + }, +}; diff --git a/packages/restapi/src/lib/index.ts b/packages/restapi/src/lib/index.ts index cd3f53dbd..cbb11f040 100644 --- a/packages/restapi/src/lib/index.ts +++ b/packages/restapi/src/lib/index.ts @@ -9,7 +9,6 @@ import * as video from "./video" export * from './types'; export { PushAPI } from './pushapi/PushAPI'; - export { alias, channels, diff --git a/packages/restapi/src/lib/progressHook.ts b/packages/restapi/src/lib/progressHook.ts index 0309c5618..64b6556b6 100644 --- a/packages/restapi/src/lib/progressHook.ts +++ b/packages/restapi/src/lib/progressHook.ts @@ -176,6 +176,60 @@ const PROGRESSHOOK: Record< progressInfo: '', level: 'SUCCESS', }, + /** + * PUSH_CHANNEL_CREATE PROGRESSHOOKS + */ + 'PUSH-CHANNEL-CREATE-01': { + progressId: 'PUSH-CHANNEL-CREATE-01', + progressTitle: 'Uploading data to IPFS', + progressInfo: 'The channelā€™s data is getting uploaded to IPFS', + level: 'INFO', + }, + 'PUSH-CHANNEL-CREATE-02': { + progressId: 'PUSH-CHANNEL-CREATE-02', + progressTitle: 'Approving PUSH tokens', + progressInfo: 'Gives approval to Push Core contract to spend 50 DAI', + level: 'INFO', + }, + 'PUSH-CHANNEL-CREATE-03': { + progressId: 'PUSH-CHANNEL-CREATE-03', + progressTitle: 'Channel is getting created', + progressInfo: 'Calls Push Core contract to create your channel', + level: 'INFO', + }, + 'PUSH-CHANNEL-CREATE-04': { + progressId: 'PUSH-CHANNEL-CREATE-04', + progressTitle: 'Channel creation is done, Welcome to Push Ecosystem', + progressInfo: 'Channel creation is completed', + level: 'SUCCESS', + }, + /** + * PUSH_CHANNEL_UPDATE PROGRESSHOOKS + */ + 'PUSH-CHANNEL-UPDATE-01': { + progressId: 'PUSH-CHANNEL-UPDATE-01', + progressTitle: 'Uploading new data to IPFS', + progressInfo: 'The channelā€™s new data is getting uploaded to IPFS', + level: 'INFO', + }, + 'PUSH-CHANNEL-UPDATE-02': { + progressId: 'PUSH-CHANNEL-UPDATE-02', + progressTitle: 'Approving PUSH tokens', + progressInfo: 'Gives approval to Push Core contract to spend 50 DAI', + level: 'INFO', + }, + 'PUSH-CHANNEL-UPDATE-03': { + progressId: 'PUSH-CHANNEL-UPDATE-03', + progressTitle: 'Channel is getting updated', + progressInfo: 'Calls Push Core contract to update your channel details', + level: 'INFO', + }, + 'PUSH-CHANNEL-UPDATE-04': { + progressId: 'PUSH-CHANNEL-UPDATE-04', + progressTitle: 'Channel is updated with new data', + progressInfo: 'Channel is successfully updated', + level: 'SUCCESS', + }, /** * PUSH-ERROR PROGRESSHOOKS */ @@ -195,5 +249,13 @@ const PROGRESSHOOK: Record< level: 'WARN', }; }, + 'PUSH-ERROR-02': (name: string, err: string) => { + return { + progressId: 'PUSH-ERROR-02', + progressTitle: 'Transaction failed', + progressInfo: `[Push SDK] - Contract - Error - ${name} -: ${err}`, + level: 'ERROR', + }; + }, }; export default PROGRESSHOOK; diff --git a/packages/restapi/src/lib/pushNotification/PushNotificationTypes.ts b/packages/restapi/src/lib/pushNotification/PushNotificationTypes.ts new file mode 100644 index 000000000..bc83e881c --- /dev/null +++ b/packages/restapi/src/lib/pushNotification/PushNotificationTypes.ts @@ -0,0 +1,104 @@ +import { ProgressHookType } from '../types'; +import { GetAliasInfoOptionsType } from '../alias'; +import { + ADDITIONAL_META_TYPE, +} from '../../lib/payloads/constants'; + +export type SubscriptionOptions = { + account?: string; + page?: number; + limit?: number; +}; +export type ChannelInfoOptions = { + channel?: string; +}; + +export type SubscribeUnsubscribeOptions = { + onSuccess?: () => void; + onError?: (err: Error) => void; +}; + +export type AliasOptions = Omit; + +export enum FeedType { + INBOX = 'INBOX', + SPAM = 'SPAM', +} + +export type FeedsOptions = { + account?: string; + //TODO: change it to string[] once we start supporting multiple channel + channels?: [string]; + page?: number; + limit?: number; + raw?: boolean; +}; + +export type ChannelSearchOptions = { + page?: number; + limit?: number; +}; + +// Types related to notification +export type INotification = { + title: string; + body: string; +}; + +export type IPayload = { + title?: string; + body?: string; + cta?: string; + embed?: string; + meta?: { + domain?: string; + type: `${ADDITIONAL_META_TYPE}+${number}`; + data: string; + }; +}; + +export type IConfig = { + expiry?: number; + silent?: boolean; + hidden?: boolean; +}; + +export type IAdvance = { + graph?: { + id: string; + counter: number; + }; + ipfs?: string; + minimal?: string; + chatid?: string; + pgpPrivateKey?: string; +}; + +export type NotificationOptions = { + notification: INotification; + payload?: IPayload; + config?: IConfig; + advanced?: IAdvance; + channel?: string; +}; + +export type CreateChannelOptions = { + name: string; + description: string; + icon: string; + url: string; + alias?: string; + progressHook?: (progress: ProgressHookType) => void; +}; + +export type NotificationSetting = { + type: number, + default: number, + description: string, + data?: { + upper: number; + lower: number; + } +} + +export type NotificationSettings = NotificationSetting[] \ No newline at end of file diff --git a/packages/restapi/src/lib/pushNotification/alias.ts b/packages/restapi/src/lib/pushNotification/alias.ts new file mode 100644 index 000000000..487d8ad20 --- /dev/null +++ b/packages/restapi/src/lib/pushNotification/alias.ts @@ -0,0 +1,25 @@ +import { ENV } from '../constants'; +import { AliasOptions } from './PushNotificationTypes'; + +import * as PUSH_ALIAS from '../alias'; + + +export class Alias { + private env: ENV + constructor(env: ENV) { + this.env = env + } + + /** + * @description - fetches alias information + * @param {AliasOptions} options - options related to alias + * @returns Alias details + */ + info = async (options: AliasOptions) => { + try { + return await PUSH_ALIAS.getAliasInfo({ ...options, env: this.env }); + } catch (error) { + throw new Error(`Push SDK Error: API : alias::info : ${error}`); + } + }; +} diff --git a/packages/restapi/src/lib/pushNotification/channel.ts b/packages/restapi/src/lib/pushNotification/channel.ts new file mode 100644 index 000000000..da57c04bb --- /dev/null +++ b/packages/restapi/src/lib/pushNotification/channel.ts @@ -0,0 +1,431 @@ +import Constants, { ENV } from '../constants'; +import { + SignerType, + ProgressHookType, + ProgressHookTypeFunction, +} from '../types'; +import { + ChannelInfoOptions, + ChannelSearchOptions, + NotificationOptions, + CreateChannelOptions, + NotificationSettings, +} from './PushNotificationTypes'; +import * as config from '../config'; +import * as PUSH_PAYLOAD from '../payloads'; +import * as PUSH_CHANNEL from '../channels'; +import { + getCAIPDetails, + validateCAIP, + getFallbackETHCAIPAddress, +} from '../helpers'; +import PROGRESSHOOK from '../progressHook'; +import { ethers } from 'ethers'; + +import { PushNotificationBaseClass } from './pushNotificationBase'; +import { Delegate } from './delegate'; +import { Alias } from './alias'; + +export class Channel extends PushNotificationBaseClass { + public delegate!: Delegate + public alias!: Alias + constructor(signer?: SignerType, env?: ENV, account?: string) { + super(signer, env, account); + this.delegate = new Delegate(signer, env, account) + this.alias = new Alias(env!); + } + + /** + * @description - returns information about a channel + * @param {string} [options.channel] - channel address in caip, defaults to eth caip address + * @returns information about the channel if it exists + */ + info = async (channel?: string) => { + try { + this.checkUserAddressExists(channel); + channel = channel ?? getFallbackETHCAIPAddress(this.env!, this.account!); + return await PUSH_CHANNEL.getChannel({ + channel: channel as string, + env: this.env, + }); + } catch (error) { + throw new Error(`Push SDK Error: API : channel::info : ${error}`); + } + }; + + /** + * @description - returns relevant information as per the query that was passed + * @param {string} query - search query + * @param {number} [options.page] - page number. default is set to Constants.PAGINATION.INITIAL_PAGE + * @param {number} [options.limit] - number of feeds per page. default is set to Constants.PAGINATION.LIMIT + * @returns Array of results relevant to the serach query + */ + search = async (query: string, options?: ChannelSearchOptions) => { + try { + const { + page = Constants.PAGINATION.INITIAL_PAGE, + limit = Constants.PAGINATION.LIMIT, + } = options || {}; + return await PUSH_CHANNEL.search({ + query: query, + page: page, + limit: limit, + env: this.env, + }); + } catch (error) { + throw new Error(`Push SDK Error: API : channel::search : ${error}`); + } + }; + /** + * @description - Get subscribers of a channell + * @param {string} [options.channel] - channel in caip. defaults to account from signer with eth caip + * @returns array of subscribers + */ + subscribers = async (options?: ChannelInfoOptions) => { + try { + const { + channel = this.account + ? getFallbackETHCAIPAddress(this.env!, this.account!) + : null, + } = options || {}; + + this.checkUserAddressExists(channel!); + if (!validateCAIP(channel!)) { + throw new Error('Invalid CAIP'); + } + return await PUSH_CHANNEL._getSubscribers({ + channel: channel!, + env: this.env, + }); + } catch (error) { + throw new Error(`Push SDK Error: API : channel::subscribers : ${error}`); + } + }; + /** + * + * @param {string[]} recipients - Array of recipients. `['0x1'] -> TARGET`, `['0x1, 0x2'] -> SUBSET`, `['*'] -> BROADCAST` + * @param {object} options - Notification options + * @returns + */ + send = async (recipients: string[], options: NotificationOptions) => { + try { + this.checkSignerObjectExists(); + const lowLevelPayload = this.generateNotificationLowLevelPayload({ + signer: this.signer!, + env: this.env!, + recipients: recipients, + options: options, + channel: options.channel ?? this.account, + }); + return await PUSH_PAYLOAD.sendNotification(lowLevelPayload); + } catch (error) { + throw new Error(`Push SDK Error: API : channel::send : ${error}`); + } + }; + + create = async (options: CreateChannelOptions) => { + const { + name, + description, + url, + icon, + alias = null, + progressHook, + } = options || {}; + try { + if ('_signTypedData' in this.signer!) { + if (!this.signer || !this.signer.provider) { + throw new Error('ethers provider/signer is not provided'); + } + } else if ('signTypedData' in this.signer!) { + if (!this.coreContract.write) { + throw new Error('viem signer is not provided'); + } + } else { + throw new Error('Unsupported Signer'); + } + // create push token instance + let aliasInfo; + // validate all the parameters and length + this.validateChannelParameters(options); + // check for PUSH balance + const pushTokenContract = await this.createContractInstance( + config.TOKEN[this.env!], + config.ABIS.TOKEN, + config.TOKEN_VIEM_NETWORK_MAP[this.env!] + ); + const balance = await this.fetchBalance(pushTokenContract, this.account!); + const fees = ethers.utils.parseUnits( + config.MIN_TOKEN_BALANCE[this.env!].toString(), + 18 + ); + if (fees.gte(balance)) { + throw new Error('Insufficient PUSH balance'); + } + // if alias is passed, check for the caip + if (alias) { + if (!validateCAIP(alias)) { + throw new Error('Invalid alias CAIP'); + } + const aliasDetails = getCAIPDetails(alias); + aliasInfo = { + [`${aliasDetails?.blockchain}:${aliasDetails?.networkId}`]: + aliasDetails?.address, + }; + } + // construct channel identity + progressHook?.(PROGRESSHOOK['PUSH-CREATE-01'] as ProgressHookType); + const input = { + name: name, + info: description, + url: url, + icon: icon, + aliasDetails: aliasInfo ?? {}, + }; + const cid = await this.uploadToIPFSViaPushNode(JSON.stringify(input)); + const allowanceAmount = await this.fetchAllownace( + pushTokenContract, + this.account!, + config.CORE_CONFIG[this.env!].EPNS_CORE_CONTRACT + ); + if (!allowanceAmount.gte(fees)) { + progressHook?.(PROGRESSHOOK['PUSH-CREATE-02'] as ProgressHookType); + const approvalRes = await this.approveToken( + pushTokenContract, + config.CORE_CONFIG[this.env!].EPNS_CORE_CONTRACT, + fees + ); + if (!approvalRes) { + throw new Error('Something went wrong while approving the token'); + } + } + // generate the contract parameters + const channelType = config.CHANNEL_TYPE['GENERAL']; + const identity = '1+' + cid; + const identityBytes = ethers.utils.toUtf8Bytes(identity); + // call contract + progressHook?.(PROGRESSHOOK['PUSH-CREATE-03'] as ProgressHookType); + const createChannelRes = await this.createChannel( + this.coreContract, + channelType, + identityBytes, + fees + ); + progressHook?.(PROGRESSHOOK['PUSH-CREATE-04'] as ProgressHookType); + return { transactionHash: createChannelRes }; + } catch (error) { + const errorProgressHook = PROGRESSHOOK[ + 'PUSH-ERROR-02' + ] as ProgressHookTypeFunction; + progressHook?.(errorProgressHook('Create Channel', error)); + throw new Error( + `Push SDK Error: Contract : createChannelWithPUSH : ${error}` + ); + } + }; + + update = async (options: CreateChannelOptions) => { + const { + name, + description, + url, + icon, + alias = null, + progressHook, + } = options || {}; + try { + // create push token instance + let aliasInfo; + if ('_signTypedData' in this.signer!) { + if (!this.signer || !this.signer.provider) { + throw new Error('ethers provider/signer is not provided'); + } + } else if ('signTypedData' in this.signer!) { + if (!this.coreContract.write) { + throw new Error('viem signer is not provided'); + } + } else { + throw new Error('Unsupported Signer'); + } + // validate all the parameters and length + this.validateChannelParameters(options); + // check for PUSH balance + const pushTokenContract = await this.createContractInstance( + config.TOKEN[this.env!], + config.ABIS.TOKEN, + config.TOKEN_VIEM_NETWORK_MAP[this.env!] + ); + const balance = await this.fetchBalance(pushTokenContract, this.account!); + // get counter + const counter = await this.fetchUpdateCounter(this.coreContract, this.account!); + const fees = ethers.utils.parseUnits( + config.MIN_TOKEN_BALANCE[this.env!].toString(), + 18 + ); + const totalFees = fees.mul(counter) + if (totalFees.gte(balance)) { + throw new Error('Insufficient PUSH balance'); + } + // if alias is passed, check for the caip + if (alias) { + if (!validateCAIP(alias)) { + throw new Error('Invalid alias CAIP'); + } + const aliasDetails = getCAIPDetails(alias); + aliasInfo = { + [`${aliasDetails?.blockchain}:${aliasDetails?.networkId}`]: + aliasDetails?.address, + }; + } + // construct channel identity + progressHook?.(PROGRESSHOOK['PUSH-UPDATE-01'] as ProgressHookType); + const input = { + name: name, + info: description, + url: url, + icon: icon, + aliasDetails: aliasInfo ?? {}, + }; + const cid = await this.uploadToIPFSViaPushNode(JSON.stringify(input)); + // approve the tokens to core contract + const allowanceAmount = await this.fetchAllownace( + pushTokenContract, + this.account!, + config.CORE_CONFIG[this.env!].EPNS_CORE_CONTRACT + ); + // if allowance is not greater than the fees, dont call approval again + if (!allowanceAmount.gte(totalFees)) { + progressHook?.(PROGRESSHOOK['PUSH-UPDATE-02'] as ProgressHookType); + const approvalRes = await this.approveToken( + pushTokenContract, + config.CORE_CONFIG[this.env!].EPNS_CORE_CONTRACT, + totalFees + ); + if (!approvalRes) { + throw new Error('Something went wrong while approving the token'); + } + } + // generate the contract parameters + const identity = '1+' + cid; + const identityBytes = ethers.utils.toUtf8Bytes(identity); + // call contract + progressHook?.(PROGRESSHOOK['PUSH-UPDATE-03'] as ProgressHookType); + const updateChannelRes = await this.updateChannel( + this.coreContract, + this.account!, + identityBytes, + totalFees + ); + progressHook?.(PROGRESSHOOK['PUSH-UPDATE-04'] as ProgressHookType); + return { transactionHash: updateChannelRes }; + } catch (error) { + const errorProgressHook = PROGRESSHOOK[ + 'PUSH-ERROR-02' + ] as ProgressHookTypeFunction; + progressHook?.(errorProgressHook('Update Channel', error)); + throw new Error(`Push SDK Error: Contract channel::update : ${error}`); + } + }; + /** + * @description verifies a channel + * @param {string} channelToBeVerified - address of the channel to be verified + * @returns the transaction hash if the transaction is successful + */ + verify = async (channelToBeVerified: string) => { + try { + this.checkSignerObjectExists(); + if ('_signTypedData' in this.signer!) { + if (!this.signer || !this.signer.provider) { + throw new Error('ethers provider/signer is not provided'); + } + } else if ('signTypedData' in this.signer!) { + if (!this.coreContract.write) { + throw new Error('viem signer is not provided'); + } + } else { + throw new Error('Unsupported Signer'); + } + if (validateCAIP(channelToBeVerified)) { + channelToBeVerified = channelToBeVerified.split(':')[2]; + } + // checks if it is a valid address + if (!ethers.utils.isAddress(channelToBeVerified)) { + throw new Error('Invalid channel address'); + } + const channelDetails = await this.info(this.account); + if(channelDetails?.verified_status == 0){ + throw new Error("Only verified channel can verify other channel") + } + // if valid, continue with it + const res = await this.verifyChannel( + this.coreContract, + channelToBeVerified + ); + if (!res) { + throw new Error('Something went wrong while verifying the channel'); + } + return { transactionHash: res }; + } catch (error) { + throw new Error(`Push SDK Error: Contract channel::verify : ${error}`); + } + }; + + setting = async (configuration: NotificationSettings) => { + try { + this.checkSignerObjectExists(); + //TODO: create a separate function later + if ('_signTypedData' in this.signer!) { + if (!this.signer || !this.signer.provider) { + throw new Error('ethers provider/signer is not provided'); + } + } else if ('signTypedData' in this.signer!) { + if (!this.coreContract.write) { + throw new Error('viem signer is not provided'); + } + } else { + throw new Error('Unsupported Signer'); + } + // check for PUSH balance + const pushTokenContract = await this.createContractInstance( + config.TOKEN[this.env!], + config.ABIS.TOKEN, + config.TOKEN_VIEM_NETWORK_MAP[this.env!] + ); + const balance = await this.fetchBalance(pushTokenContract, this.account!); + const fees = ethers.utils.parseUnits( + config.MIN_TOKEN_BALANCE[this.env!].toString(), + 18 + ); + if (fees.gte(balance)) { + throw new Error('Insufficient PUSH balance'); + } + const allowanceAmount = await this.fetchAllownace( + pushTokenContract, + this.account!, + config.CORE_CONFIG[this.env!].EPNS_CORE_CONTRACT + ); + // if allowance is not greater than the fees, dont call approval again + if (!allowanceAmount.gte(fees)) { + const approveRes = await this.approveToken( + pushTokenContract, + config.CORE_CONFIG[this.env!].EPNS_CORE_CONTRACT, + fees + ); + if (!approveRes) { + throw new Error('Something went wrong while approving your token'); + } + } + const { setting, description } = this.getMinimalSetting(configuration); + const createSettingsRes = await this.createChanelSettings( + this.coreContract, + configuration.length, + setting, + description, + fees + ); + return { transactionHash: createSettingsRes }; + } catch (error) { + throw new Error(`Push SDK Error: Contract : channel::setting : ${error}`); + } + }; +} diff --git a/packages/restapi/src/lib/pushNotification/delegate.ts b/packages/restapi/src/lib/pushNotification/delegate.ts new file mode 100644 index 000000000..3d08bcd3a --- /dev/null +++ b/packages/restapi/src/lib/pushNotification/delegate.ts @@ -0,0 +1,112 @@ +import { ENV } from '../constants'; +import { SignerType } from '../types'; +import { ChannelInfoOptions } from './PushNotificationTypes'; +import CONFIG, * as config from '../config'; +import * as PUSH_CHANNEL from '../channels'; +import { validateCAIP, getFallbackETHCAIPAddress } from '../helpers'; +import { PushNotificationBaseClass } from './pushNotificationBase'; + +export class Delegate extends PushNotificationBaseClass { + constructor(signer?: SignerType, env?: ENV, account?: string) { + super(signer, env, account); + } + + /** + * @description - Get delegates of a channell + * @param {string} [options.channel] - channel in caip. defaults to account from signer with eth caip + * @returns array of delegates + */ + get = async (options?: ChannelInfoOptions) => { + try { + const { + channel = this.account + ? getFallbackETHCAIPAddress(this.env!, this.account!) + : null, + } = options || {}; + this.checkUserAddressExists(channel!); + if (!validateCAIP(channel!)) { + throw new Error('Invalid CAIP'); + } + return await PUSH_CHANNEL.getDelegates({ + channel: channel!, + env: this.env, + }); + } catch (error) { + throw new Error(`Push SDK Error: API : delegate::get : ${error}`); + } + }; + + /** + * @description adds a delegate + * @param {string} delegate - delegate address in caip to be added + * @returns the transaction hash if the transaction is successfull + */ + add = async (delegate: string) => { + try { + if (!validateCAIP(delegate)) { + throw new Error('Invalid CAIP'); + } + + const networkDetails = await this.getChianId(this.signer!); + if (networkDetails !== parseInt(delegate.split(':')[1])) { + return new Error('Signer and CAIP chain id doesnt match'); + } + const caip = `eip155:${networkDetails}`; + if (!CONFIG[this.env!][caip] || !config.VIEM_CONFIG[this.env!][caip]) { + throw new Error('Unsupported Chainid'); + } + const commAddress = CONFIG[this.env!][caip].EPNS_COMMUNICATOR_CONTRACT; + const commContract = this.createContractInstance( + commAddress, + config.ABIS.COMM, + config.VIEM_CONFIG[this.env!][caip].NETWORK + ); + const addDelegateRes = await this.addDelegator( + commContract, + delegate.split(':')[2] + ); + return { transactionHash: addDelegateRes }; + } catch (error) { + throw new Error(`Push SDK Error: Contract : delegate::add : ${error}`); + } + }; + + /** + * @description removes a delegate + * @param {string} delegate - caip address of the delegate to be removed + * @returns the transaction hash if the transaction is successfull + */ + remove = async (delegate: string) => { + try { + this.checkSignerObjectExists(); + if (this.signer && !this.signer.provider) { + throw new Error('Provider is required'); + } + if (!validateCAIP(delegate)) { + throw new Error('Invalid CAIP'); + } + + const networkDetails = await this.getChianId(this.signer!); + if (networkDetails !== parseInt(delegate.split(':')[1])) { + return new Error('Signer and CAIP chain id doesnt match'); + } + const caip = `eip155:${networkDetails}`; + if (!CONFIG[this.env!][caip] || !config.VIEM_CONFIG[this.env!][caip]) { + throw new Error('Unsupported Chainid'); + } + const commAddress = CONFIG[this.env!][caip].EPNS_COMMUNICATOR_CONTRACT; + const commContract = this.createContractInstance( + commAddress, + config.ABIS.COMM, + config.VIEM_CONFIG[this.env!][caip].NETWORK + ); + const removeDelegateRes = await this.removeDelegator( + commContract, + delegate.split(':')[2] + ); + return { transactionHash: removeDelegateRes }; + } catch (error) { + throw new Error(`Push SDK Error: Contract : delegate::remove : ${error}`); + } + }; +} diff --git a/packages/restapi/src/lib/pushNotification/notification.ts b/packages/restapi/src/lib/pushNotification/notification.ts new file mode 100644 index 000000000..67abdd976 --- /dev/null +++ b/packages/restapi/src/lib/pushNotification/notification.ts @@ -0,0 +1,205 @@ +import Constants, { ENV } from '../constants'; +import { + SignerType, +} from '../types'; +import { + SubscribeUnsubscribeOptions, + SubscriptionOptions, + FeedType, + FeedsOptions, +} from './PushNotificationTypes'; +import * as PUSH_USER from '../user'; +import * as PUSH_CHANNEL from '../channels'; + +import { + getCAIPDetails, + getCAIPWithChainId, + validateCAIP, + getFallbackETHCAIPAddress, +} from '../helpers'; +import PROGRESSHOOK from '../progressHook'; +import { ethers } from 'ethers'; + +import { PushNotificationBaseClass } from './pushNotificationBase'; +// ERROR CONSTANTS +const ERROR_CHANNEL_NEEDED = 'Channel is needed'; +const ERROR_INVALID_CAIP = 'Invalid CAIP format'; + +export const FEED_MAP = { + INBOX: false, + SPAM: true, +}; +export class Notification extends PushNotificationBaseClass { + constructor(signer?: SignerType, env?: ENV, account?: string) { + super(signer, env, account); + } + + /** + * @description - Fetches feeds and spam feeds for a specific user + * @param {enums} spam - indicates if its a spam or not. `INBOX` for non-spam and `SPAM` for spam. default `INBOX` + * @param {string} [options.user] - user address, defaults to address from signer + * @param {number} [options.page] - page number. default is set to Constants.PAGINATION.INITIAL_PAGE + * @param {number} [options.limit] - number of feeds per page. default is set to Constants.PAGINATION.LIMIT + * @param {boolean} [options.raw] - indicates if the response should be raw or formatted. defaults is set to false + * @returns feeds for a specific address + */ + list = async ( + spam: `${FeedType}` = FeedType.INBOX, + options?: FeedsOptions + ) => { + const { + account = this.account + ? getFallbackETHCAIPAddress(this.env!, this.account!) + : null, + page = Constants.PAGINATION.INITIAL_PAGE, + limit = Constants.PAGINATION.LIMIT, + channels = [], + raw = false, + } = options || {}; + try { + // guest mode and valid address check + this.checkUserAddressExists(account!); + if (!validateCAIP(account!)) { + throw new Error('Invalid CAIP'); + } + const nonCaipAccount = + account?.split(':')[account?.split(':').length - 1]; + if (channels.length == 0) { + // else return the response + return await PUSH_USER.getFeeds({ + user: nonCaipAccount!, + page: page, + limit: limit, + spam: FEED_MAP[spam], + raw: raw, + env: this.env, + }); + } else { + return await PUSH_USER.getFeedsPerChannel({ + user: nonCaipAccount!, + page: page, + limit: limit, + spam: FEED_MAP[spam], + raw: raw, + env: this.env, + channels: channels, + }); + } + } catch (error) { + throw new Error(`Push SDK Error: API : notifcaiton::list : ${error}`); + } + }; + + subscriptions = async (options?: SubscriptionOptions) => { + try { + const { + account = this.account, + // TODO: to be used once pagination is implemeted at API level + page = Constants.PAGINATION.INITIAL_PAGE, + limit = Constants.PAGINATION.LIMIT, + } = options || {}; + this.checkUserAddressExists(account!); + return await PUSH_USER.getSubscriptions({ + user: account!, + env: this.env, + }); + } catch (error) { + throw new Error( + `Push SDK Error: API : notifcaiton::subscriptions : ${error}` + ); + } + }; + /** + * Subscribes a user to a channel + * @param {string} channel - channel address in caip format + * @param {function} [options.onSuccess] - callback function when a user successfully subscribes to a channel + * @param {function} [options.onError] - callback function incase a user was not able to subscribe to a channel + * @returns Subscribe status object + */ + subscribe = async ( + channel: string, + options?: SubscribeUnsubscribeOptions + ) => { + try { + const { onSuccess, onError } = options || {}; + // Vaidatiions + // validates if signer object is present + this.checkSignerObjectExists(); + // validates if the user address exists + this.checkUserAddressExists(); + // validates if channel exists + if (!channel && channel != '') { + throw new Error(ERROR_CHANNEL_NEEDED); + } + // validates if caip is correct + if (!validateCAIP(channel)) { + throw new Error(ERROR_INVALID_CAIP); + } + // get channel caip + const caipDetail = getCAIPDetails(channel); + // based on the caip, construct the user caip + const userAddressInCaip = getCAIPWithChainId( + this.account!, + parseInt(caipDetail?.networkId as string) + ); + return await PUSH_CHANNEL.subscribe({ + signer: this.signer!, + channelAddress: channel, + userAddress: userAddressInCaip, + env: this.env, + onSuccess: onSuccess, + onError: onError, + }); + } catch (error) { + throw new Error( + `Push SDK Error: API : notifcaiton::subscribe : ${error}` + ); + } + }; + + /** + * Unsubscribes a user to a channel + * @param {string} channel - channel address in caip format + * @param {function} [options.onSuccess] - callback function when a user successfully unsubscribes to a channel + * @param {function} [options.onError] - callback function incase a user was not able to unsubscribe to a channel + * @returns Unsubscribe status object + */ + unsubscribe = async ( + channel: string, + options?: SubscribeUnsubscribeOptions + ) => { + try { + const { onSuccess, onError } = options || {}; + // Vaidatiions + // validates if the user address exists + this.checkUserAddressExists(); + // validates if signer object is present + this.checkSignerObjectExists(); + // validates if channel exists + if (!channel && channel != '') { + return new Error(ERROR_CHANNEL_NEEDED); + } + // validates if caip is correct + if (!validateCAIP(channel)) { + return new Error(ERROR_INVALID_CAIP); + } + const caipDetail = getCAIPDetails(channel); + const userAddressInCaip = getCAIPWithChainId( + this.account!, + parseInt(caipDetail?.networkId as string) + ); + return await PUSH_CHANNEL.unsubscribe({ + signer: this.signer!, + channelAddress: channel, + userAddress: userAddressInCaip, + env: this.env, + onSuccess: onSuccess, + onError: onError, + }); + } catch (error) { + throw new Error( + `Push SDK Error: API : notifcaiton::unsubscribe : ${error}` + ); + } + }; +} diff --git a/packages/restapi/src/lib/pushNotification/pushNotificationBase.ts b/packages/restapi/src/lib/pushNotification/pushNotificationBase.ts new file mode 100644 index 000000000..1d9aab9ab --- /dev/null +++ b/packages/restapi/src/lib/pushNotification/pushNotificationBase.ts @@ -0,0 +1,684 @@ +import { ENV } from '../constants'; +import { SignerType, ISendNotificationInputOptions } from '../types'; +import { + NotificationOptions, + CreateChannelOptions, + NotificationSettings, +} from './PushNotificationTypes'; +import CONFIG, * as config from '../config'; +import { getAccountAddress } from '../chat/helpers'; +import { IDENTITY_TYPE, NOTIFICATION_TYPE } from '../payloads/constants'; +import { ethers, Signer, BigNumber } from 'ethers'; +import axios from 'axios'; +import { + createPublicClient, + http, + getContract, + WalletClient, + Chain, +} from 'viem'; + +// ERROR CONSTANTS +const ERROR_ACCOUNT_NEEDED = 'Account is required'; +const ERROR_SIGNER_NEEDED = 'Signer object is required'; + +const BROADCAST_TYPE = '*'; +const LENGTH_UPPER_LIMIT = 125; +const LENGTH_LOWER_LIMTI = 1; +const SETTING_DELIMITER = '-'; +const SETTING_SEPARATOR = '+'; + +export const FEED_MAP = { + INBOX: false, + SPAM: true, +}; +export class PushNotificationBaseClass { + protected signer: SignerType | undefined; + protected account: string | undefined; + protected env: ENV | undefined; + protected guestMode: boolean; + protected coreContract: any; + + constructor(signer?: SignerType, env?: ENV, account?: string) { + this.signer = signer; + this.env = env; + this.guestMode = !!(account && signer); + this.account = account; + this.initializeCoreContract({ signer: this.signer, env: this.env }); + } + + private async initializeCoreContract(options?: { + signer?: SignerType; + env?: ENV; + }) { + const { env = ENV.STAGING, signer = null } = options || {}; + // Derives account from signer if not provided + let derivedAccount; + let coreContract; + if (signer) { + if (!('_signTypedData' in signer!) && !('signTypedData' in signer!)) { + throw new Error('Unsupported signer type'); + } else if ('_signTypedData' in signer) { + derivedAccount = await getAccountAddress({ + account: null, + signer: signer, + }); + if (signer?.provider) { + coreContract = new ethers.Contract( + config.CORE_CONFIG[env].EPNS_CORE_CONTRACT, + config.ABIS.CORE, + signer as unknown as Signer + ); + } + } else if ('signTypedData' in signer) { + derivedAccount = await getAccountAddress({ + account: null, + signer: signer, + }); + const client = createPublicClient({ + chain: config.TOKEN_VIEM_NETWORK_MAP[env], + transport: http(), + }); + coreContract = getContract({ + abi: config.ABIS.CORE, + address: config.CORE_CONFIG[env].EPNS_CORE_CONTRACT as `0x${string}`, + publicClient: client, + walletClient: signer as unknown as WalletClient, + }); + } + } + + // Initialize PushNotifications instance + this.coreContract = coreContract; + } + + // check if addresses is supplied either by user or derived from signer object or if its guest mode + protected checkUserAddressExists(user?: string) { + if (!user && !this.account && !this.guestMode) + throw new Error(ERROR_ACCOUNT_NEEDED); + return true; + } + + // checks if the signer object is supplied + protected checkSignerObjectExists() { + if (!this.signer) throw new Error(ERROR_SIGNER_NEEDED); + return true; + } + + // get type of notification from recipient + protected getNotificationType( + recipient: string[], + channel: string + ): { recipient: string[] | string; type: number } { + if (recipient.length == 1) { + if (recipient[0] == BROADCAST_TYPE) { + return { recipient: channel, type: NOTIFICATION_TYPE['BROADCAST'] }; + } else { + return { + recipient: recipient[0], + type: NOTIFICATION_TYPE['TARGETTED'], + }; + } + } + return { recipient, type: NOTIFICATION_TYPE['SUBSET'] }; + } + + // get identity type for lowlevel call + protected generateNotificationLowLevelPayload({ + signer, + env, + recipients, + options, + channel, + }: { + signer: SignerType; + env: ENV; + recipients: string[]; + options: NotificationOptions; + channel?: string; + }): ISendNotificationInputOptions { + if (!channel) { + channel = `${this.account}`; + } + const notificationType = this.getNotificationType(recipients, channel); + const identityType = IDENTITY_TYPE.DIRECT_PAYLOAD; + const notificationPayload: ISendNotificationInputOptions = { + signer: signer, + channel: channel, + type: notificationType.type, + identityType: identityType, + notification: options.notification, + payload: { + title: options.payload?.title ?? options.notification.title, + body: options.payload?.body ?? options.notification.body, + cta: options.payload?.cta ?? '', + img: options.payload?.embed ?? '', + hidden: options.config?.hidden, + etime: options.config?.expiry, + silent: options.config?.silent, + additionalMeta: options.payload?.meta, + }, + recipients: notificationType.recipient, + graph: options.advanced?.graph, + ipfsHash: options.advanced?.ipfs, + env: env, + chatId: options.advanced?.chatid, + pgpPrivateKey: options.advanced?.pgpPrivateKey, + }; + + return notificationPayload; + } + + // check if the fields are empty + protected isEmpty(field: string) { + if (field.trim().length == 0) { + return true; + } + + return false; + } + + // check if the length is valid + protected isValidLength( + data: string, + upperLen: number = LENGTH_UPPER_LIMIT, + lowerLen: number = LENGTH_LOWER_LIMTI + ): boolean { + return data.length >= lowerLen && data.length <= upperLen!; + } + + // check if url is valid + protected isValidUrl(urlString: string): boolean { + const urlPattern = new RegExp( + '^((?:https|http):\\/\\/)' + // validate protocol + '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // validate domain name + '((\\d{1,3}\\.){3}\\d{1,3}))' + // validate OR ip (v4) address + '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // validate port and path + '(\\?[;&a-z\\d%_.~+=-]*)?' + // validate query string + '(\\#[-a-z\\d_]*)?$', + 'i' + ); // validate fragment locator + return !!urlPattern.test(urlString); + } + + // check all the fields of channel + protected verifyEmptyChannelParameters( + options: CreateChannelOptions + ): boolean { + if (this.isEmpty(options.name)) { + throw new Error('Channel name cannot be empty'); + } else if (this.isEmpty(options.description)) { + throw new Error('Channel description cannot be empty'); + } else if (this.isEmpty(options.icon)) { + throw new Error('Channel icon cannot be empty'); + } else if (this.isEmpty(options.url)) { + throw new Error('Channel url cannot ne empty'); + } else { + return true; + } + } + + // check for valid length and url + protected validateParameterLength(options: CreateChannelOptions): boolean { + if (!this.isValidLength(options.name)) { + throw new Error( + `Channel name should not exceed ${LENGTH_UPPER_LIMIT} characters` + ); + } else if (!this.isValidLength(options.description)) { + throw new Error( + `Channel description should not exceed ${LENGTH_UPPER_LIMIT} characters` + ); + } else if ( + !this.isValidLength(options.url) || + !this.isValidUrl(options.url) + ) { + throw new Error( + `Channel url either excees ${LENGTH_UPPER_LIMIT} characters or is not a valid url` + ); + } else { + return true; + } + } + + protected validateChannelParameters(options: CreateChannelOptions): boolean { + return ( + this.verifyEmptyChannelParameters(options) && + this.validateParameterLength(options) + ); + } + + // create contract instance + protected createContractInstance( + contractAddress: string | `0x${string}`, + contractABI: any, + network: Chain + ) { + let contract: any; + if ( + !('_signTypedData' in this.signer!) && + !('signTypedData' in this.signer!) + ) { + throw new Error('Unsupported signer type'); + } else if ('_signTypedData' in this.signer) { + if (!this.signer?.provider) { + throw new Error('Provider is required'); + } + contract = new ethers.Contract( + contractAddress, + contractABI, + this.signer as unknown as Signer + ); + } else if ('signTypedData' in this.signer) { + const client = createPublicClient({ + chain: network, + transport: http(), + }); + contract = getContract({ + abi: contractABI, + address: contractAddress as `0x${string}`, + publicClient: client, + walletClient: this.signer as unknown as WalletClient, + }); + } else { + throw new Error('Unsupported signer type'); + } + return contract; + } + + protected async fetchBalance(contract: any, userAddress: string) { + let balance: BigNumber; + try { + if ('_signTypedData' in this.signer!) { + balance = await contract!['balanceOf'](userAddress); + } else if ('signTypedData' in this.signer!) { + const balanceInBigInt = await contract.read.balanceOf({ + args: [userAddress], + }); + balance = ethers.BigNumber.from(balanceInBigInt); + } else { + throw new Error('Unsupported signer'); + } + return balance; + } catch (error) { + console.log(error); + throw new Error(JSON.stringify(error)); + } + } + + protected async fetchAllownace( + contract: any, + userAddress: string, + spenderAddress: string + ) { + let allowance: BigNumber; + try { + if ('_signTypedData' in this.signer!) { + allowance = await contract!['allowance'](userAddress, spenderAddress); + } else if ('signTypedData' in this.signer!) { + const allowanceInBigInt = await contract.read.allowance({ + args: [userAddress, spenderAddress], + }); + allowance = ethers.BigNumber.from(allowanceInBigInt); + } else { + throw new Error('Unsupported signer'); + } + return allowance; + } catch (error) { + throw new Error(JSON.stringify(error)); + } + } + + protected async fetchUpdateCounter(contract: any, userAddress: string) { + let count: BigNumber; + try { + if ('_signTypedData' in this.signer!) { + count = await contract!['channelUpdateCounter'](userAddress); + } else if ('signTypedData' in this.signer!) { + const countInBigInt = await contract.read.channelUpdateCounter({ + args: [userAddress], + }); + count = ethers.BigNumber.from(countInBigInt); + } else { + throw new Error('Unsupported signer'); + } + // add one and return the count + return count.add(ethers.BigNumber.from(1)); + } catch (error) { + throw new Error(JSON.stringify(error)); + } + } + + protected async approveToken( + contract: any, + spenderAddress: string, + amount: string | BigNumber + ) { + try { + if ('_signTypedData' in this.signer!) { + if (!this.signer || !this.signer.provider) { + throw new Error('ethers provider/signer is not provided'); + } + const approvalTrxPromise = contract!['approve'](spenderAddress, amount); + const approvalTrx = await approvalTrxPromise; + await this.signer?.provider?.waitForTransaction(approvalTrx.hash); + // console.log(approvalTrx.hash) + } else if ('signTypedData' in this.signer!) { + if (!contract.write) { + throw new Error('viem signer is not provided'); + } + const approvalTrxPromise = contract.write.approve({ + args: [spenderAddress, amount], + }); + const approvalTrxRes = await approvalTrxPromise; + // console.log(approvalTrxRes); + } else { + throw new Error('Unsupported signer'); + } + return true; + } catch (error) { + console.log(error); + return false; + } + } + + protected async createChannel( + contract: any, + channelType: number, + identityBytes: Uint8Array, + fees: BigNumber + ) { + let createChannelRes; + try { + if (!this.signer || !this.signer.provider) { + throw new Error('ethers provider/signer is not provided'); + } + if ('_signTypedData' in this.signer!) { + const createChannelPromise = contract!['createChannelWithPUSH']( + channelType, + identityBytes, + fees, + this.getTimeBound(), + { + gasLimit: 1000000, + } + ); + const createChannelTrx = await createChannelPromise; + const createChannelTrxStatus = + await this.signer?.provider?.waitForTransaction( + createChannelTrx.hash + ); + if (createChannelTrxStatus?.status == 0) { + throw new Error('Something Went wrong while creating your channel'); + } + createChannelRes = createChannelTrx.hash; + } else if ('signTypedData' in this.signer!) { + if (!contract.write) { + throw new Error('viem signer is not provided'); + } + const createChannelPromise = contract.write.createChannelWithPUSH({ + args: [channelType, identityBytes, fees, this.getTimeBound()], + }); + createChannelRes = await createChannelPromise; + } + + return createChannelRes; + } catch (error: any) { + throw new Error(error?.message); + } + } + + protected async updateChannel( + contract: any, + account: string, + identityBytes: Uint8Array, + fees: BigNumber + ) { + let updateChannelRes; + try { + if (!this.signer || !this.signer.provider) { + throw new Error('ethers provider/signer is not provided'); + } + if ('_signTypedData' in this.signer!) { + const updateChannelPromise = contract!['updateChannelMeta']( + account, + identityBytes, + fees, + { + gasLimit: 1000000, + } + ); + const updateChannelTrx = await updateChannelPromise; + const updateChannelTrxStatus = + await this.signer?.provider?.waitForTransaction( + updateChannelTrx.hash + ); + if (updateChannelTrxStatus?.status == 0) { + throw new Error('Something Went wrong while updating your channel'); + } + updateChannelRes = updateChannelTrx.hash; + } else if ('signTypedData' in this.signer!) { + if (!contract.write) { + throw new Error('viem signer is not provided'); + } + const updateChannelPromise = contract.write.createChannelWithPUSH({ + args: [account, identityBytes, fees], + }); + updateChannelRes = await updateChannelPromise; + } + + return updateChannelRes; + } catch (error: any) { + throw new Error(error?.message); + } + } + + protected async verifyChannel(contract: any, channelToBeVerified: string) { + try { + let verifyTrxRes; + if ('_signTypedData' in this.signer!) { + if (!this.signer || !this.signer.provider) { + throw new Error('ethers provider/signer is not provided'); + } + const verifyTrxPromise = contract!['verify'](channelToBeVerified); + const verifyTrx = await verifyTrxPromise; + await this.signer?.provider?.waitForTransaction(verifyTrx.hash); + verifyTrxRes = verifyTrx.hash; + } else if ('signTypedData' in this.signer!) { + if (!contract.write) { + throw new Error('viem signer is not provided'); + } + const verifyTrxPromise = contract.write.verify({ + args: [channelToBeVerified], + }); + verifyTrxRes = await verifyTrxPromise; + } else { + throw new Error('Unsupported signer'); + } + return verifyTrxRes; + } catch (error: any) { + throw new Error(error.message); + } + } + + protected async createChanelSettings( + contract: any, + numberOfSettings: number, + settings: string, + description: string, + fees: BigNumber + ) { + try { + let createSettingsRes; + if ('_signTypedData' in this.signer!) { + if (!this.signer || !this.signer.provider) { + throw new Error('ethers provider/signer is not provided'); + } + const createSettingsPromise = contract!['createChannelSettings']( + numberOfSettings, + settings, + description, + fees + ); + const createSettings = await createSettingsPromise; + await this.signer?.provider?.waitForTransaction(createSettings.hash); + createSettingsRes = createSettings.hash; + } else if ('signTypedData' in this.signer!) { + if (!contract.write) { + throw new Error('viem signer is not provided'); + } + const createSettingsTrxPromise = contract.write.createChannelSettings({ + args: [numberOfSettings, settings, description, fees], + }); + createSettingsRes = await createSettingsTrxPromise; + } else { + throw new Error('Unsupported signer'); + } + return createSettingsRes; + } catch (error: any) { + throw new Error(error.message); + } + } + + protected async addDelegator(contract: any, delegatee: string) { + try { + let addDelegateRes; + if ('_signTypedData' in this.signer!) { + if (!this.signer || !this.signer.provider) { + throw new Error('ethers provider/signer is not provided'); + } + const addDelegateTrxPromise = contract!['addDelegate'](delegatee); + const addDelegateTrx = await addDelegateTrxPromise; + await this.signer?.provider?.waitForTransaction(addDelegateTrx.hash); + addDelegateRes = addDelegateTrx.hash; + } else if ('signTypedData' in this.signer!) { + if (!contract.write) { + throw new Error('viem signer is not provided'); + } + const addDelegateTrxPromise = contract.write.addDelegate({ + args: [delegatee], + }); + addDelegateRes = await addDelegateTrxPromise; + } else { + throw new Error('Unsupported signer'); + } + return addDelegateRes; + } catch (error: any) { + throw new Error(error.message); + } + } + + protected async removeDelegator(contract: any, delegatee: string) { + try { + let removeDelegateRes; + if ('_signTypedData' in this.signer!) { + if (!this.signer || !this.signer.provider) { + throw new Error('ethers provider/signer is not provided'); + } + const removeDelegateTrxPromise = contract!['removeDelegate'](delegatee); + const removeDelegateTrx = await removeDelegateTrxPromise; + await this.signer?.provider?.waitForTransaction(removeDelegateTrx.hash); + removeDelegateRes = removeDelegateTrx.hash; + } else if ('signTypedData' in this.signer!) { + if (!contract.write) { + throw new Error('viem signer is not provided'); + } + const removeDelegateTrxPromise = contract.write.removeDelegate({ + args: [delegatee], + }); + removeDelegateRes = await removeDelegateTrxPromise; + } else { + throw new Error('Unsupported signer'); + } + return removeDelegateRes; + } catch (error: any) { + throw new Error(error.message); + } + } + + protected async getChianId(signer: SignerType) { + let chainId; + const isProviderExists = await this.checkProvider(signer); + if (!isProviderExists) { + throw new Error('Provider doesnt exists'); + } + if ('_signTypedData' in signer!) { + const chainDetails = await signer?.provider?.getNetwork(); + chainId = chainDetails?.chainId; + } else if ('signTypedData' in signer!) { + chainId = await signer.getChainId(); + } + return chainId; + } + + protected async checkProvider(signer: SignerType) { + let res = false; + if ('_signTypedData' in signer!) { + res = signer && signer?.provider ? true : false; + } else if ('signTypedData' in signer!) { + const chainId = await signer.getChainId(); + res = !!chainId; + } + return res; + } + + protected async uploadToIPFSViaPushNode(data: string): Promise { + try { + const response = await axios.post( + `${config.CORE_CONFIG[this.env!].API_BASE_URL}/v1/ipfs/upload`, + { data } + ); + return response.data.cid as string; + } catch (error) { + throw new Error('Something went wrong while uploading data to IPFS'); + } + } + + protected getTimeBound(timeStamp?: number) { + // for now returns 0 for non-time bound. Later it can be modified to handle time bound channels + return 0; + } + + protected getMinimalSetting(configuration: NotificationSettings): { + setting: string; + description: string; + } { + let notificationSetting = ''; + let notificationSettingDescription = ''; + for (let i = 0; i < configuration.length; i++) { + const ele = configuration[i]; + if (ele.type == 0) { + notificationSetting = + notificationSetting + + SETTING_SEPARATOR + + ele.type + + SETTING_DELIMITER + + ele.default; + notificationSettingDescription = + notificationSettingDescription + SETTING_SEPARATOR + ele.description; + } + if (ele.type == 1) { + if (ele.data) { + notificationSetting = + notificationSetting + + SETTING_SEPARATOR + + ele.type + + SETTING_DELIMITER + + ele.default + + SETTING_DELIMITER + + ele.data.lower + + SETTING_DELIMITER + + ele.data.upper; + + notificationSettingDescription = + notificationSettingDescription + + SETTING_SEPARATOR + + ele.description; + } + } + } + return { + setting: notificationSetting.replace(/^\+/, ''), + description: notificationSettingDescription.replace(/^\+/, ''), + }; + } +} diff --git a/packages/restapi/src/lib/pushapi/PushAPI.ts b/packages/restapi/src/lib/pushapi/PushAPI.ts index 610e6158d..e79fd5dc9 100644 --- a/packages/restapi/src/lib/pushapi/PushAPI.ts +++ b/packages/restapi/src/lib/pushapi/PushAPI.ts @@ -1,41 +1,34 @@ -import Constants, { ENCRYPTION_TYPE, ENV, MessageType } from '../constants'; -import { - ChatSendOptionsType, - GroupAccess, - GroupDTO, - IFeeds, - MessageWithCID, - SignerType, - Message, - ProgressHookType, - IUser, - IMessageIPFS, -} from '../types'; -import { - GroupUpdateOptions, - ChatListType, - GroupCreationOptions, - ManageGroupOptions, - PushAPIInitializeProps, -} from './pushAPITypes'; +import Constants, { ENV } from '../constants'; +import { SignerType, ProgressHookType } from '../types'; +import { PushAPIInitializeProps } from './pushAPITypes'; import * as PUSH_USER from '../user'; import * as PUSH_CHAT from '../chat'; -import { getAccountAddress, getUserDID, getWallet } from '../chat/helpers'; -import { isValidETHAddress } from '../helpers'; -import { - ChatUpdateGroupProfileType, - updateGroupProfile, -} from '../chat/updateGroupProfile'; +import { getAccountAddress, getWallet } from '../chat/helpers'; +import { Chat } from './chat'; +import { Profile } from './profile'; +import { Encryption } from './encryption'; +import { User } from './user'; +import { PushStream } from '../pushstream/PushStream'; +import { Channel } from '../pushNotification/channel'; +import { Notification } from '../pushNotification/notification'; export class PushAPI { private signer: SignerType; private account: string; private decryptedPgpPvtKey: string; private pgpPublicKey: string; - private env: ENV; private progressHook?: (progress: ProgressHookType) => void; + public chat: Chat; // Public instances to be accessed from outside the class + public profile: Profile; + public encryption: Encryption; + private user: User; + public stream!: PushStream; + // Notification + public channel!: Channel; + public notification!: Notification; + private constructor( signer: SignerType, env: ENV, @@ -50,549 +43,151 @@ export class PushAPI { this.decryptedPgpPvtKey = decryptedPgpPvtKey; this.pgpPublicKey = pgpPublicKey; this.progressHook = progressHook; + // Instantiate the notification classes + this.channel = new Channel(this.signer, this.env, this.account); + this.notification = new Notification(this.signer, this.env, this.account); + // Initialize the instances of the four classes + this.chat = new Chat( + this.account, + this.decryptedPgpPvtKey, + this.env, + this.signer, + this.progressHook + ); + this.profile = new Profile( + this.account, + this.decryptedPgpPvtKey, + this.env, + this.progressHook + ); + this.encryption = new Encryption( + this.account, + this.decryptedPgpPvtKey, + this.pgpPublicKey, + this.env, + this.signer, + this.progressHook + ); + this.user = new User(this.account, this.env); } static async initialize( signer: SignerType, - options?: PushAPIInitializeProps + options?: PushAPIInitializeProps, + version?: typeof Constants.ENC_TYPE_V1 | typeof Constants.ENC_TYPE_V3, + versionMeta?: { NFTPGP_V1?: { password: string } }, + autoUpgrade?: boolean ): Promise { - // Default options - const defaultOptions: PushAPIInitializeProps = { - env: ENV.STAGING, - version: Constants.ENC_TYPE_V3, - autoUpgrade: true, - account: null, - }; - - // Settings object - // Default options are overwritten by the options passed in the initialize method - const settings = { - ...defaultOptions, - ...options, - }; - - // Get account - // Derives account from signer if not provided - const derivedAccount = await getAccountAddress( - getWallet({ - account: settings.account as string | null, - signer: signer, - }) - ); - - let decryptedPGPPrivateKey: string; - let pgpPublicKey: string; - - /** - * Decrypt PGP private key - * If user exists, decrypts the PGP private key - * If user does not exist, creates a new user and returns the decrypted PGP private key - */ - const user = await PUSH_USER.get({ - account: derivedAccount, - env: settings.env, - }); - if (user && user.encryptedPrivateKey) { - decryptedPGPPrivateKey = await PUSH_CHAT.decryptPGPKey({ - encryptedPGPPrivateKey: user.encryptedPrivateKey, - signer: signer, - toUpgrade: settings.autoUpgrade, - additionalMeta: settings.versionMeta, - progressHook: settings.progressHook, - env: settings.env, - }); - pgpPublicKey = user.publicKey; - } else { - const newUser = await PUSH_USER.create({ - env: settings.env, - account: derivedAccount, - signer, - version: settings.version, - additionalMeta: settings.versionMeta, - origin: settings.origin, - progressHook: settings.progressHook, - }); - decryptedPGPPrivateKey = newUser.decryptedPrivateKey as string; - pgpPublicKey = newUser.publicKey; - } - - // Initialize PushAPI instance - return new PushAPI( - signer, - settings.env as ENV, - derivedAccount, - decryptedPGPPrivateKey, - pgpPublicKey, - settings.progressHook - ); - } - - info = async () => { - return await PUSH_USER.get({ - account: this.account, - env: this.env, - }); - }; + try { + // Default options + const defaultOptions: PushAPIInitializeProps = { + env: ENV.STAGING, - profile = { - info: async () => { - const response = await PUSH_USER.get({ - account: this.account, - env: this.env, - }); - return response.profile; - }, + version: Constants.ENC_TYPE_V3, + autoUpgrade: true, - update: async (options: { - name?: string; - desc?: string; - picture?: string; - }) => { - const { name, desc, picture } = options; - const response = await PUSH_USER.profile.update({ - pgpPrivateKey: this.decryptedPgpPvtKey, - account: this.account, - profile: { - name: name, - desc: desc, - picture: picture, + account: null, + streamOptions: { + enabled: true, // Default value }, - env: this.env, - progressHook: this.progressHook, - }); - return response.profile; - }, - }; - - chat = { - list: async ( - type: `${ChatListType}`, - options?: { - /** - * @default 1 - */ - page?: number; - limit?: number; - } - ): Promise => { - const listParams = { - account: this.account, - pgpPrivateKey: this.decryptedPgpPvtKey, - page: options?.page, - limit: options?.limit, - env: this.env, - toDecrypt: true, }; - switch (type) { - case ChatListType.CHATS: - return await PUSH_CHAT.chats(listParams); - case ChatListType.REQUESTS: - return await PUSH_CHAT.requests(listParams); - default: - throw new Error('Invalid Chat List Type'); - } - }, - - latest: async (target: string) => { - const { threadHash } = await PUSH_CHAT.conversationHash({ - conversationId: target, - account: this.account, - env: this.env, - }); - if (!threadHash) return {}; - - return await PUSH_CHAT.latest({ - threadhash: threadHash, - toDecrypt: true, - pgpPrivateKey: this.decryptedPgpPvtKey, - account: this.account, - env: this.env, - }); - }, - - history: async ( - target: string, - options?: { - reference?: string | null; - limit?: number; - } - ) => { - let reference: string; - - if (!options?.reference) { - const { threadHash } = await PUSH_CHAT.conversationHash({ - conversationId: target, - account: this.account, - env: this.env, - }); - reference = threadHash; - } else { - reference = options.reference; - } - - if (!reference) return []; - - return await PUSH_CHAT.history({ - account: this.account, - env: this.env, - threadhash: reference, - pgpPrivateKey: this.decryptedPgpPvtKey, - toDecrypt: true, - limit: options?.limit, - }); - }, - - send: async ( - recipient: string, - options: Message - ): Promise => { - if (!options.type) { - options.type = MessageType.TEXT; - } - const sendParams: ChatSendOptionsType = { - message: options, - to: recipient, - signer: this.signer, - pgpPrivateKey: this.decryptedPgpPvtKey, - env: this.env, + // Settings object + // Default options are overwritten by the options passed in the initialize method + const settings = { + ...defaultOptions, + ...options, + version: version || defaultOptions.version, + versionMeta: versionMeta || defaultOptions.versionMeta, + autoUpgrade: + autoUpgrade !== undefined ? autoUpgrade : defaultOptions.autoUpgrade, + streamOptions: { + ...defaultOptions.streamOptions, + ...(options?.streamOptions ?? {}), + }, }; - return await PUSH_CHAT.send(sendParams); - }, - decrypt: async (messagePayloads: IMessageIPFS[]) => { - return await PUSH_CHAT.decryptConversation({ - pgpPrivateKey: this.decryptedPgpPvtKey, - env: this.env, - messages: messagePayloads, - connectedUser: await this.info(), - }); - }, - - accept: async (target: string): Promise => { - return await PUSH_CHAT.approve({ - senderAddress: target, - env: this.env, - account: this.account, - signer: this.signer, - pgpPrivateKey: this.decryptedPgpPvtKey, - }); - }, - - reject: async (target: string): Promise => { - await PUSH_CHAT.reject({ - senderAddress: target, - env: this.env, - account: this.account, - signer: this.signer, - pgpPrivateKey: this.decryptedPgpPvtKey, - }); - }, - - block: async (users: Array): Promise => { - const user = await PUSH_USER.get({ - account: this.account, - env: this.env, - }); - - for (const element of users) { - if (!isValidETHAddress(element)) { - throw new Error('Invalid address in the users: ' + element); - } - } - - if (!user.profile.blockedUsersList) { - user.profile.blockedUsersList = []; - } - - user.profile.blockedUsersList = [ - ...new Set([...user.profile.blockedUsersList, ...users]), - ]; + // Get account + // Derives account from signer if not provided + const derivedAccount = await getAccountAddress( + getWallet({ + account: settings.account as string | null, + signer: signer, + }) + ); - return await PUSH_USER.profile.update({ - pgpPrivateKey: this.decryptedPgpPvtKey, - account: this.account, - profile: { - name: user.profile.name!, - desc: user.profile.desc!, - picture: user.profile.picture!, - blockedUsersList: user.profile.blockedUsersList, - }, - env: this.env, - progressHook: this.progressHook, - }); - }, + let decryptedPGPPrivateKey: string; + let pgpPublicKey: string; - unblock: async (users: Array): Promise => { + /** + * Decrypt PGP private key + * If user exists, decrypts the PGP private key + * If user does not exist, creates a new user and returns the decrypted PGP private key + */ const user = await PUSH_USER.get({ - account: this.account, - env: this.env, - }); - - for (const element of users) { - if (!isValidETHAddress(element)) { - throw new Error('Invalid address in the users: ' + element); - } - } - - if (!user.profile.blockedUsersList) { - return user; - } - - const userDIDsPromises = users.map(async (user) => { - return (await getUserDID(user, this.env)).toLowerCase(); - }); - const userDIDs = await Promise.all(userDIDsPromises); - - user.profile.blockedUsersList = user.profile.blockedUsersList.filter( - (blockedUser) => { - !userDIDs.includes(blockedUser.toLowerCase()); - } - ); - - return await PUSH_USER.profile.update({ - pgpPrivateKey: this.decryptedPgpPvtKey, - account: this.account, - profile: { - name: user.profile.name!, - desc: user.profile.desc!, - picture: user.profile.picture!, - blockedUsersList: user.profile.blockedUsersList, - }, - env: this.env, - progressHook: this.progressHook, + account: derivedAccount, + env: settings.env, }); - }, - - group: { - create: async (name: string, options?: GroupCreationOptions) => { - const groupParams: PUSH_CHAT.ChatCreateGroupType = { - groupName: name, - groupDescription: options?.description, - members: options?.members ? options.members : [], - groupImage: options?.image, - admins: options?.admins ? options.admins : [], - rules: { - groupAccess: options?.rules?.entry, - chatAccess: options?.rules?.chat, - }, - isPublic: !options?.private, - signer: this.signer, - pgpPrivateKey: this.decryptedPgpPvtKey, - env: this.env, - }; - - return await PUSH_CHAT.createGroup(groupParams); - }, - - permissions: async (chatId: string): Promise => { - const getGroupAccessOptions: PUSH_CHAT.GetGroupAccessType = { - chatId, - did: this.account, - env: this.env, - }; - return await PUSH_CHAT.getGroupAccess(getGroupAccessOptions); - }, - - info: async (chatId: string): Promise => { - return await PUSH_CHAT.getGroup({ - chatId: chatId, - env: this.env, + if (user && user.encryptedPrivateKey) { + decryptedPGPPrivateKey = await PUSH_CHAT.decryptPGPKey({ + encryptedPGPPrivateKey: user.encryptedPrivateKey, + signer: signer, + toUpgrade: settings.autoUpgrade, + additionalMeta: settings.versionMeta, + progressHook: settings.progressHook, + env: settings.env, }); - }, - - update: async ( - chatId: string, - options: GroupUpdateOptions - ): Promise => { - // Fetch Group Details - const group = await PUSH_CHAT.getGroup({ - chatId: chatId, - env: this.env, - }); - if (!group) { - throw new Error('Group not found'); - } - - const updateGroupProfileOptions: ChatUpdateGroupProfileType = { - chatId: chatId, - groupName: options.name ? options.name : group.groupName, - groupImage: options.image ? options.image : group.groupImage, - groupDescription: options.description - ? options.description - : group.groupDescription, - scheduleAt: options.scheduleAt - ? options.scheduleAt - : group.scheduleAt, - scheduleEnd: options.scheduleEnd - ? options.scheduleEnd - : group.scheduleEnd, - status: options.status ? options.status : group.status, - meta: options.meta ? options.meta : group.meta, - rules: options.rules ? options.rules : group.rules, - account: this.account, - pgpPrivateKey: this.decryptedPgpPvtKey, - env: this.env, - }; - return await updateGroupProfile(updateGroupProfileOptions); - }, - - add: async (chatId: string, options: ManageGroupOptions) => { - const { role, accounts } = options; - - const validRoles = ['ADMIN', 'MEMBER']; - if (!validRoles.includes(role)) { - throw new Error('Invalid role provided.'); - } - - if (!accounts || accounts.length === 0) { - throw new Error('accounts array cannot be empty!'); - } - - accounts.forEach((account) => { - if (!isValidETHAddress(account)) { - throw new Error(`Invalid account address: ${account}`); - } + pgpPublicKey = user.publicKey; + } else { + const newUser = await PUSH_USER.create({ + env: settings.env, + account: derivedAccount, + signer, + version: settings.version, + additionalMeta: settings.versionMeta, + origin: settings.origin, + progressHook: settings.progressHook, }); + decryptedPGPPrivateKey = newUser.decryptedPrivateKey as string; + pgpPublicKey = newUser.publicKey; + } - if (role === 'ADMIN') { - return await PUSH_CHAT.addAdmins({ - chatId: chatId, - admins: accounts, - env: this.env, - account: this.account, - signer: this.signer, - pgpPrivateKey: this.decryptedPgpPvtKey, - }); - } else { - return await PUSH_CHAT.addMembers({ - chatId: chatId, - members: accounts, - env: this.env, - account: this.account, - signer: this.signer, - pgpPrivateKey: this.decryptedPgpPvtKey, - }); - } - }, - - remove: async (chatId: string, options: ManageGroupOptions) => { - const { role, accounts } = options; - - const validRoles = ['ADMIN', 'MEMBER']; - if (!validRoles.includes(role)) { - throw new Error('Invalid role provided.'); - } - - if (!accounts || accounts.length === 0) { - throw new Error('accounts array cannot be empty!'); - } - - accounts.forEach((account) => { - if (!isValidETHAddress(account)) { - throw new Error(`Invalid account address: ${account}`); - } - }); + // Initialize PushAPI instance + const api = new PushAPI( + signer, + settings.env as ENV, + derivedAccount, + decryptedPGPPrivateKey, + pgpPublicKey, + settings.progressHook + ); - if (role === 'ADMIN') { - return await PUSH_CHAT.removeAdmins({ - chatId: chatId, - admins: accounts, - env: this.env, - account: this.account, - signer: this.signer, - pgpPrivateKey: this.decryptedPgpPvtKey, - }); + if (settings.streamOptions.enabled) { + const streamInstance = await PushStream.initialize( + api.account, + decryptedPGPPrivateKey, + signer, + settings.progressHook, + settings.streamOptions + ); + if (streamInstance) { + api.stream = streamInstance; } else { - return await PUSH_CHAT.removeMembers({ - chatId: chatId, - members: accounts, - env: this.env, - account: this.account, - signer: this.signer, - pgpPrivateKey: this.decryptedPgpPvtKey, - }); + throw new Error('Failed to initialize PushStream.'); } - }, - - join: async (target: string): Promise => { - return await PUSH_CHAT.addMembers({ - chatId: target, - members: [this.account], - env: this.env, - account: this.account, - signer: this.signer, - pgpPrivateKey: this.decryptedPgpPvtKey, - }); - }, - - leave: async (target: string): Promise => { - return await PUSH_CHAT.removeMembers({ - chatId: target, - members: [this.account], - env: this.env, - account: this.account, - signer: this.signer, - pgpPrivateKey: this.decryptedPgpPvtKey, - }); - }, - - reject: async (target: string): Promise => { - await PUSH_CHAT.reject({ - senderAddress: target, - env: this.env, - account: this.account, - signer: this.signer, - pgpPrivateKey: this.decryptedPgpPvtKey, - }); - }, - }, - }; - - encryption = { - info: async () => { - const userInfo = await this.info(); - const decryptedPassword = await PUSH_USER.decryptAuth({ - account: this.account, - env: this.env, - signer: this.signer, - progressHook: this.progressHook, - additionalMeta: { - NFTPGP_V1: { - encryptedPassword: JSON.stringify( - JSON.parse(userInfo.encryptedPrivateKey).encryptedPassword - ), - }, - }, - }); + } - return { - decryptedPgpPrivateKey: this.decryptedPgpPvtKey, - pgpPublicKey: this.pgpPublicKey, - ...(decryptedPassword !== undefined && decryptedPassword !== null - ? { decryptedPassword: decryptedPassword } - : {}), - }; - }, + return api; + } catch (error) { + console.error('Error initializing PushAPI:', error); + throw error; // or handle it more gracefully if desired + } + } - update: async ( - updatedEncryptionType: ENCRYPTION_TYPE, - options?: { - versionMeta?: { - NFTPGP_V1?: { password: string }; - }; - } - ) => { - return await PUSH_USER.auth.update({ - account: this.account, - pgpEncryptionVersion: updatedEncryptionType, - additionalMeta: options?.versionMeta, - progressHook: this.progressHook, - signer: this.signer, - env: this.env, - pgpPrivateKey: this.decryptedPgpPvtKey, - pgpPublicKey: this.pgpPublicKey, - }); - }, - }; + async info() { + return await PUSH_USER.get({ + account: this.account, + env: this.env, + }); + } } diff --git a/packages/restapi/src/lib/pushapi/chat.ts b/packages/restapi/src/lib/pushapi/chat.ts new file mode 100644 index 000000000..193db597a --- /dev/null +++ b/packages/restapi/src/lib/pushapi/chat.ts @@ -0,0 +1,450 @@ +import { ENV, MessageType } from '../constants'; +import { + ChatSendOptionsType, + GroupAccess, + GroupDTO, + IFeeds, + MessageWithCID, + SignerType, + Message, + ProgressHookType, + IUser, + IMessageIPFS, +} from '../types'; +import { + GroupUpdateOptions, + ChatListType, + GroupCreationOptions, + ManageGroupOptions, +} from './pushAPITypes'; +import * as PUSH_USER from '../user'; +import * as PUSH_CHAT from '../chat'; +import { getUserDID } from '../chat/helpers'; +import { isValidETHAddress } from '../helpers'; +import { + ChatUpdateGroupProfileType, + updateGroupProfile, +} from '../chat/updateGroupProfile'; +import { User } from './user'; +export class Chat { + private userInstance: User; + + constructor( + private account: string, + private decryptedPgpPvtKey: string, + private env: ENV, + private signer: SignerType, + private progressHook?: (progress: ProgressHookType) => void + ) { + this.userInstance = new User(this.account, this.env); + } + + async list( + type: `${ChatListType}`, + options?: { + /** + * @default 1 + */ + page?: number; + limit?: number; + } + ): Promise { + const listParams = { + account: this.account, + pgpPrivateKey: this.decryptedPgpPvtKey, + page: options?.page, + limit: options?.limit, + env: this.env, + toDecrypt: true, + }; + + switch (type) { + case ChatListType.CHATS: + return await PUSH_CHAT.chats(listParams); + case ChatListType.REQUESTS: + return await PUSH_CHAT.requests(listParams); + default: + throw new Error('Invalid Chat List Type'); + } + } + async latest(target: string) { + const { threadHash } = await PUSH_CHAT.conversationHash({ + conversationId: target, + account: this.account, + env: this.env, + }); + if (!threadHash) return {}; + + return await PUSH_CHAT.latest({ + threadhash: threadHash, + toDecrypt: true, + pgpPrivateKey: this.decryptedPgpPvtKey, + account: this.account, + env: this.env, + }); + } + + async history( + target: string, + options?: { + reference?: string | null; + limit?: number; + } + ) { + let reference: string; + + if (!options?.reference) { + const { threadHash } = await PUSH_CHAT.conversationHash({ + conversationId: target, + account: this.account, + env: this.env, + }); + reference = threadHash; + } else { + reference = options.reference; + } + + if (!reference) return []; + + return await PUSH_CHAT.history({ + account: this.account, + env: this.env, + threadhash: reference, + pgpPrivateKey: this.decryptedPgpPvtKey, + toDecrypt: true, + limit: options?.limit, + }); + } + + async send(recipient: string, options: Message): Promise { + if (!options.type) { + options.type = MessageType.TEXT; + } + const sendParams: ChatSendOptionsType = { + message: options, + to: recipient, + signer: this.signer, + pgpPrivateKey: this.decryptedPgpPvtKey, + env: this.env, + }; + return await PUSH_CHAT.send(sendParams); + } + + async decrypt(messagePayloads: IMessageIPFS[]) { + return await PUSH_CHAT.decryptConversation({ + pgpPrivateKey: this.decryptedPgpPvtKey, + env: this.env, + messages: messagePayloads, + connectedUser: await this.userInstance.info(), + }); + } + + async accept(target: string): Promise { + return await PUSH_CHAT.approve({ + senderAddress: target, + env: this.env, + account: this.account, + signer: this.signer, + pgpPrivateKey: this.decryptedPgpPvtKey, + }); + } + + async reject(target: string): Promise { + await PUSH_CHAT.reject({ + senderAddress: target, + env: this.env, + account: this.account, + signer: this.signer, + pgpPrivateKey: this.decryptedPgpPvtKey, + }); + } + + async block(users: Array): Promise { + const user = await PUSH_USER.get({ + account: this.account, + env: this.env, + }); + + for (const element of users) { + if (!isValidETHAddress(element)) { + throw new Error('Invalid address in the users: ' + element); + } + } + + if (!user.profile.blockedUsersList) { + user.profile.blockedUsersList = []; + } + + user.profile.blockedUsersList = [ + ...new Set([...user.profile.blockedUsersList, ...users]), + ]; + + return await PUSH_USER.profile.update({ + pgpPrivateKey: this.decryptedPgpPvtKey, + account: this.account, + profile: { + name: user.profile.name!, + desc: user.profile.desc!, + picture: user.profile.picture!, + blockedUsersList: user.profile.blockedUsersList, + }, + env: this.env, + progressHook: this.progressHook, + }); + } + + async unblock(users: Array): Promise { + const user = await PUSH_USER.get({ + account: this.account, + env: this.env, + }); + + for (const element of users) { + if (!isValidETHAddress(element)) { + throw new Error('Invalid address in the users: ' + element); + } + } + + if (!user.profile.blockedUsersList) { + return user; + } + + const userDIDsPromises = users.map(async (user) => { + return (await getUserDID(user, this.env)).toLowerCase(); + }); + const userDIDs = await Promise.all(userDIDsPromises); + + user.profile.blockedUsersList = user.profile.blockedUsersList.filter( + (blockedUser) => { + !userDIDs.includes(blockedUser.toLowerCase()); + } + ); + + return await PUSH_USER.profile.update({ + pgpPrivateKey: this.decryptedPgpPvtKey, + account: this.account, + profile: { + name: user.profile.name!, + desc: user.profile.desc!, + picture: user.profile.picture!, + blockedUsersList: user.profile.blockedUsersList, + }, + env: this.env, + progressHook: this.progressHook, + }); + } + + group = { + create: async (name: string, options?: GroupCreationOptions) => { + const groupParams: PUSH_CHAT.ChatCreateGroupType = { + groupName: name, + groupDescription: options?.description, + members: options?.members ? options.members : [], + groupImage: options?.image, + admins: options?.admins ? options.admins : [], + rules: options?.rules, + isPublic: !options?.private, + signer: this.signer, + pgpPrivateKey: this.decryptedPgpPvtKey, + env: this.env, + }; + + return await PUSH_CHAT.createGroup(groupParams); + }, + + permissions: async (chatId: string): Promise => { + const getGroupAccessOptions: PUSH_CHAT.GetGroupAccessType = { + chatId, + did: this.account, + env: this.env, + }; + return await PUSH_CHAT.getGroupAccess(getGroupAccessOptions); + }, + + info: async (chatId: string): Promise => { + return await PUSH_CHAT.getGroup({ + chatId: chatId, + env: this.env, + }); + }, + update: async ( + chatId: string, + options: GroupUpdateOptions + ): Promise => { + const group = await PUSH_CHAT.getGroup({ + chatId: chatId, + env: this.env, + }); + if (!group) { + throw new Error('Group not found'); + } + + const updateGroupProfileOptions: ChatUpdateGroupProfileType = { + chatId: chatId, + groupName: options.name ? options.name : group.groupName, + groupImage: options.image ? options.image : group.groupImage, + groupDescription: options.description + ? options.description + : group.groupDescription, + scheduleAt: options.scheduleAt ? options.scheduleAt : group.scheduleAt, + scheduleEnd: options.scheduleEnd + ? options.scheduleEnd + : group.scheduleEnd, + status: options.status ? options.status : group.status, + meta: options.meta ? options.meta : group.meta, + rules: options.rules ? options.rules : group.rules, + account: this.account, + pgpPrivateKey: this.decryptedPgpPvtKey, + env: this.env, + }; + return await updateGroupProfile(updateGroupProfileOptions); + }, + + add: async (chatId: string, options: ManageGroupOptions) => { + const { role, accounts } = options; + + const validRoles = ['ADMIN', 'MEMBER']; + if (!validRoles.includes(role)) { + throw new Error('Invalid role provided.'); + } + + if (!accounts || accounts.length === 0) { + throw new Error('accounts array cannot be empty!'); + } + + accounts.forEach((account) => { + if (!isValidETHAddress(account)) { + throw new Error(`Invalid account address: ${account}`); + } + }); + + if (role === 'ADMIN') { + return await PUSH_CHAT.addAdmins({ + chatId: chatId, + admins: accounts, + env: this.env, + account: this.account, + signer: this.signer, + pgpPrivateKey: this.decryptedPgpPvtKey, + }); + } else { + return await PUSH_CHAT.addMembers({ + chatId: chatId, + members: accounts, + env: this.env, + account: this.account, + signer: this.signer, + pgpPrivateKey: this.decryptedPgpPvtKey, + }); + } + }, + + remove: async (chatId: string, options: ManageGroupOptions) => { + const { role, accounts } = options; + + const validRoles = ['ADMIN', 'MEMBER']; + if (!validRoles.includes(role)) { + throw new Error('Invalid role provided.'); + } + + if (!accounts || accounts.length === 0) { + throw new Error('accounts array cannot be empty!'); + } + + accounts.forEach((account) => { + if (!isValidETHAddress(account)) { + throw new Error(`Invalid account address: ${account}`); + } + }); + + if (role === 'ADMIN') { + return await PUSH_CHAT.removeAdmins({ + chatId: chatId, + admins: accounts, + env: this.env, + account: this.account, + signer: this.signer, + pgpPrivateKey: this.decryptedPgpPvtKey, + }); + } else { + return await PUSH_CHAT.removeMembers({ + chatId: chatId, + members: accounts, + env: this.env, + account: this.account, + signer: this.signer, + pgpPrivateKey: this.decryptedPgpPvtKey, + }); + } + }, + + join: async (target: string): Promise => { + const status = await PUSH_CHAT.getGroupMemberStatus({ + chatId: target, + did: this.account, + env: this.env, + }); + + if (status.isPending) { + await PUSH_CHAT.approve({ + senderAddress: target, + env: this.env, + account: this.account, + signer: this.signer, + pgpPrivateKey: this.decryptedPgpPvtKey, + }); + } else if (!status.isMember) { + return await PUSH_CHAT.addMembers({ + chatId: target, + members: [this.account], + env: this.env, + account: this.account, + signer: this.signer, + pgpPrivateKey: this.decryptedPgpPvtKey, + }); + } + + return await PUSH_CHAT.getGroup({ + chatId: target, + env: this.env, + }); + }, + + leave: async (target: string): Promise => { + const status = await PUSH_CHAT.getGroupMemberStatus({ + chatId: target, + did: this.account, + env: this.env, + }); + + if (status.isAdmin) { + return await PUSH_CHAT.removeAdmins({ + chatId: target, + admins: [this.account], + env: this.env, + account: this.account, + signer: this.signer, + pgpPrivateKey: this.decryptedPgpPvtKey, + }); + } else { + return await PUSH_CHAT.removeMembers({ + chatId: target, + members: [this.account], + env: this.env, + account: this.account, + signer: this.signer, + pgpPrivateKey: this.decryptedPgpPvtKey, + }); + } + }, + reject: async (target: string): Promise => { + await PUSH_CHAT.reject({ + senderAddress: target, + env: this.env, + account: this.account, + signer: this.signer, + pgpPrivateKey: this.decryptedPgpPvtKey, + }); + }, + }; +} diff --git a/packages/restapi/src/lib/pushapi/encryption.ts b/packages/restapi/src/lib/pushapi/encryption.ts new file mode 100644 index 000000000..14e1ec286 --- /dev/null +++ b/packages/restapi/src/lib/pushapi/encryption.ts @@ -0,0 +1,67 @@ +import { ENCRYPTION_TYPE, ENV } from '../constants'; +import { + SignerType, + ProgressHookType, +} from '../types'; +import * as PUSH_USER from '../user'; +import { User } from './user'; + +export class Encryption { + private userInstance: User; + + constructor( + private account: string, + private decryptedPgpPvtKey: string, + private pgpPublicKey: string, + private env: ENV, + private signer: SignerType, + private progressHook?: (progress: ProgressHookType) => void + ) { + this.userInstance = new User(this.account, this.env); + } + + async info() { + const userInfo = await this.userInstance.info(); + const decryptedPassword = await PUSH_USER.decryptAuth({ + account: this.account, + env: this.env, + signer: this.signer, + progressHook: this.progressHook, + additionalMeta: { + NFTPGP_V1: { + encryptedPassword: JSON.stringify( + JSON.parse(userInfo.encryptedPrivateKey).encryptedPassword + ), + }, + }, + }); + + return { + decryptedPgpPrivateKey: this.decryptedPgpPvtKey, + pgpPublicKey: this.pgpPublicKey, + ...(decryptedPassword !== undefined && decryptedPassword !== null + ? { decryptedPassword: decryptedPassword } + : {}), + }; + } + + async update( + updatedEncryptionType: ENCRYPTION_TYPE, + options?: { + versionMeta?: { + NFTPGP_V1?: { password: string }; + }; + } + ) { + return await PUSH_USER.auth.update({ + account: this.account, + pgpEncryptionVersion: updatedEncryptionType, + additionalMeta: options?.versionMeta, + progressHook: this.progressHook, + signer: this.signer, + env: this.env, + pgpPrivateKey: this.decryptedPgpPvtKey, + pgpPublicKey: this.pgpPublicKey, + }); + } +} diff --git a/packages/restapi/src/lib/pushapi/profile.ts b/packages/restapi/src/lib/pushapi/profile.ts new file mode 100644 index 000000000..f3a8861b0 --- /dev/null +++ b/packages/restapi/src/lib/pushapi/profile.ts @@ -0,0 +1,36 @@ +import { ProgressHookType } from '../types'; +import * as PUSH_USER from '../user'; +import { ENV } from '../constants'; + +export class Profile { + constructor( + private account: string, + private decryptedPgpPvtKey: string, + private env: ENV, + private progressHook?: (progress: ProgressHookType) => void + ) {} + + async info() { + const response = await PUSH_USER.get({ + account: this.account, + env: this.env, + }); + return response.profile; + } + + async update(options: { name?: string; desc?: string; picture?: string }) { + const { name, desc, picture } = options; + const response = await PUSH_USER.profile.update({ + pgpPrivateKey: this.decryptedPgpPvtKey, + account: this.account, + profile: { + name: name, + desc: desc, + picture: picture, + }, + env: this.env, + progressHook: this.progressHook, + }); + return response.profile; + } +} diff --git a/packages/restapi/src/lib/pushapi/pushAPITypes.ts b/packages/restapi/src/lib/pushapi/pushAPITypes.ts index 391598ffe..094b16488 100644 --- a/packages/restapi/src/lib/pushapi/pushAPITypes.ts +++ b/packages/restapi/src/lib/pushapi/pushAPITypes.ts @@ -1,4 +1,5 @@ import Constants, { ENV } from '../constants'; +import { PushStreamInitializeProps } from '../pushstream/pushStreamTypes'; import { ChatStatus, ProgressHookType, Rules } from '../types'; export enum ChatListType { @@ -13,6 +14,7 @@ export interface PushAPIInitializeProps { versionMeta?: { NFTPGP_V1?: { password: string } }; autoUpgrade?: boolean; origin?: string; + streamOptions?: PushStreamInitializeProps; } export interface GroupCreationOptions { @@ -21,14 +23,7 @@ export interface GroupCreationOptions { members?: string[]; admins?: string[]; private?: boolean; - rules?: { - entry?: { - conditions: any[]; - }; - chat?: { - conditions: any[]; - }; - }; + rules?: Rules | null; } export interface ManageGroupOptions { diff --git a/packages/restapi/src/lib/pushapi/user.ts b/packages/restapi/src/lib/pushapi/user.ts new file mode 100644 index 000000000..4a485e787 --- /dev/null +++ b/packages/restapi/src/lib/pushapi/user.ts @@ -0,0 +1,13 @@ +import * as PUSH_USER from '../user'; +import { ENV } from '../constants'; + +export class User { + constructor(private account: string, private env: ENV) {} + + async info() { + return await PUSH_USER.get({ + account: this.account, + env: this.env, + }); + } +} diff --git a/packages/restapi/src/lib/pushstream/DataModifier.ts b/packages/restapi/src/lib/pushstream/DataModifier.ts new file mode 100644 index 000000000..949a1ad45 --- /dev/null +++ b/packages/restapi/src/lib/pushstream/DataModifier.ts @@ -0,0 +1,379 @@ +import { + CreateGroupEvent, + GroupMeta, + GroupEventRawData, + UpdateGroupEvent, + MessageRawData, + MessageEvent, + MessageEventType, + Member, + GroupEventType, + LeaveGroupEvent, + JoinGroupEvent, + RequestEvent, + RemoveEvent, + NotificationEvent, + NotificationEventType, + NotificationType, + NOTIFICATION, +} from './pushStreamTypes'; + +export class DataModifier { + public static handleChatGroupEvent(data: any, includeRaw = false): any { + switch (data.eventType) { + case 'create': + return this.mapToCreateGroupEvent(data, includeRaw); + case 'update': + return this.mapToUpdateGroupEvent(data, includeRaw); + case GroupEventType.JoinGroup: + return this.mapToJoinGroupEvent(data, includeRaw); + case GroupEventType.LeaveGroup: + return this.mapToLeaveGroupEvent(data, includeRaw); + case MessageEventType.Request: + return this.mapToRequestEvent(data, includeRaw); + case GroupEventType.Remove: + return this.mapToRemoveEvent(data, includeRaw); + default: + console.warn('Unknown eventType:', data.eventType); + return data; + } + } + + private static mapToJoinGroupEvent( + data: any, + includeRaw: boolean + ): JoinGroupEvent { + const baseEventData: JoinGroupEvent = { + origin: data.messageOrigin, + timestamp: data.timestamp, + chatId: data.chatId, + from: data.from, + to: data.to, + event: GroupEventType.JoinGroup, + }; + + return includeRaw + ? { + ...baseEventData, + raw: { verificationProof: data.verificationProof }, + } + : baseEventData; + } + + private static mapToLeaveGroupEvent( + data: any, + includeRaw: boolean + ): LeaveGroupEvent { + const baseEventData: LeaveGroupEvent = { + origin: data.messageOrigin, + timestamp: data.timestamp, + chatId: data.chatId, + from: data.from, + to: data.to, + event: GroupEventType.LeaveGroup, + }; + + return includeRaw + ? { + ...baseEventData, + raw: { verificationProof: data.verificationProof }, + } + : baseEventData; + } + + private static mapToRequestEvent(data: any, includeRaw: boolean): any { + const eventData: RequestEvent = { + origin: data.messageOrigin, + timestamp: data.timestamp, + chatId: data.chatId, + from: data.from, + to: data.to, + event: MessageEventType.Request, + meta: { + group: data.isGroup || false, + }, + }; + + if (includeRaw) { + eventData.raw = { verificationProof: data.verificationProof }; + } + return eventData; + } + + private static mapToRemoveEvent(data: any, includeRaw: boolean): any { + // Whatever the structure of your RemoveEvent, modify accordingly + const eventData: RemoveEvent = { + origin: data.messageOrigin, + timestamp: data.timestamp, + chatId: data.chatId, + from: data.from, + to: data.to, + event: GroupEventType.Remove, + }; + + if (includeRaw) { + eventData.raw = { verificationProof: data.verificationProof }; + } + return eventData; + } + + private static buildChatGroupEventMetaAndRaw( + incomingData: any, + includeRaw: boolean + ): { + meta: GroupMeta; + raw?: GroupEventRawData; + } { + const mapMembersAdmins = (arr: any[]): Member[] => { + return arr.map((item) => ({ + address: item.wallet, + profile: { + image: item.image, + publicKey: item.publicKey, + }, + })); + }; + + const mapPendingMembersAdmins = (arr: any[]): Member[] => { + return arr.map((item) => ({ + address: item.wallet, + profile: { + image: item.image, + publicKey: item.publicKey, + }, + })); + }; + + const meta: GroupMeta = { + name: incomingData.groupName, + description: incomingData.groupDescription, + image: incomingData.groupImage, + owner: incomingData.groupCreator, + members: mapMembersAdmins( + incomingData.members.filter((m: any) => !m.isAdmin) + ), + admins: mapMembersAdmins( + incomingData.members.filter((m: any) => m.isAdmin) + ), + pending: { + members: mapPendingMembersAdmins( + incomingData.pendingMembers.filter((m: any) => !m.isAdmin) + ), + admins: mapPendingMembersAdmins( + incomingData.pendingMembers.filter((m: any) => m.isAdmin) + ), + }, + private: !incomingData.isPublic, + rules: incomingData.rules || {}, + }; + + if (includeRaw) { + const raw: GroupEventRawData = { + verificationProof: incomingData.verificationProof, + }; + return { meta, raw }; + } + + return { meta }; + } + + public static mapToGroupEvent( + eventType: GroupEventType, + incomingData: any, + includeRaw: boolean + ): CreateGroupEvent | UpdateGroupEvent { + const { meta, raw } = this.buildChatGroupEventMetaAndRaw( + incomingData, + includeRaw + ); + + const groupEvent: any = { + event: eventType, + origin: incomingData.messageOrigin, + timestamp: incomingData.timestamp, + chatId: incomingData.chatId, + from: incomingData.from, + meta, + }; + + if (includeRaw) { + groupEvent.raw = raw; + } + + return groupEvent as CreateGroupEvent | UpdateGroupEvent; + } + + public static mapToCreateGroupEvent( + incomingData: any, + includeRaw: boolean + ): CreateGroupEvent { + return this.mapToGroupEvent( + GroupEventType.CreateGroup, + incomingData, + includeRaw + ) as CreateGroupEvent; + } + + public static mapToUpdateGroupEvent( + incomingData: any, + includeRaw: boolean + ): UpdateGroupEvent { + return this.mapToGroupEvent( + GroupEventType.UpdateGroup, + incomingData, + includeRaw + ) as UpdateGroupEvent; + } + + public static mapToMessageEvent( + data: any, + includeRaw = false, + eventType: MessageEventType + ): MessageEvent { + const messageEvent: MessageEvent = { + event: eventType, + origin: data.messageOrigin, + timestamp: data.timestamp.toString(), + chatId: data.chatId, // TODO: ChatId not working for w2w + from: data.fromCAIP10, + to: [data.toCAIP10], // TODO: Assuming 'to' is an array in MessageEvent. Update as necessary. + message: { + type: data.messageType, + content: data.messageContent, + }, + meta: { + group: data.isGroup || false, + }, + reference: data.cid, + }; + + if (includeRaw) { + const rawData: MessageRawData = { + fromCAIP10: data.fromCAIP10, + toCAIP10: data.toCAIP10, + fromDID: data.fromDID, + toDID: data.toDID, + encType: data.encType, + encryptedSecret: data.encryptedSecret, + signature: data.signature, + sigType: data.sigType, + verificationProof: data.verificationProof, + previousReference: data.link, + }; + messageEvent.raw = rawData; + } + + return messageEvent; + } + + public static handleChatEvent(data: any, includeRaw = false): any { + if (!data) { + console.error('Error in handleChatEvent: data is undefined or null'); + throw new Error('data is undefined or null'); + } + + const eventTypeMap: { [key: string]: MessageEventType } = { + Chat: MessageEventType.Message, + Request: MessageEventType.Request, + Approve: MessageEventType.Accept, + Reject: MessageEventType.Reject, + }; + + const key = data.eventType || data.messageCategory; + + if (!eventTypeMap[key]) { + console.error( + 'Error in handleChatEvent: Invalid eventType or messageCategory', + JSON.stringify(data) + ); + throw new Error('Invalid eventType or messageCategory in data'); + } + + const eventType: MessageEventType = eventTypeMap[key]; + + if (eventType) { + return this.mapToMessageEvent( + data, + includeRaw, + eventType as MessageEventType + ); + } else { + console.warn( + 'Unknown eventType:', + data.eventType || data.messageCategory + ); + return data; + } + } + + public static mapToNotificationEvent( + data: any, + notificationEventType: NotificationEventType, + origin: 'other' | 'self', + includeRaw = false + ): NotificationEvent { + const notificationType = + (Object.keys(NOTIFICATION.TYPE) as NotificationType[]).find( + (key) => NOTIFICATION.TYPE[key] === data.payload.data.type + ) || 'BROADCAST'; // Assuming 'BROADCAST' as the default + + + let recipients: string[]; + + if (Array.isArray(data.payload.recipients)) { + recipients = data.payload.recipients; + } else if (typeof data.payload.recipients === 'string') { + recipients = [data.payload.recipients]; + } else { + recipients = Object.keys(data.payload.recipients); + } + + const notificationEvent: NotificationEvent = { + event: notificationEventType, + origin: origin, + timestamp: data.epoch, + from: data.sender, + to: recipients, + notifID: data.payload_id.toString(), + channel: { + name: data.payload.data.app, + icon: data.payload.data.icon, + url: data.payload.data.url, + }, + meta: { + type: 'NOTIFICATION.' + notificationType, + }, + message: { + notification: { + title: data.payload.notification.title, + body: data.payload.notification.body, + }, + payload: { + title: data.payload.data.asub, + body: data.payload.data.amsg, + cta: data.payload.data.acta, + embed: data.payload.data.aimg, + meta: { + domain: data.payload.data.additionalMeta?.domain || 'push.org', + type: data.payload.data.additionalMeta?.type, + data: data.payload.data.additionalMeta?.data, + }, + }, + }, + config: { + expiry: data.payload.data.etime, + silent: data.payload.data.silent === '1', + hidden: data.payload.data.hidden === '1', + }, + source: data.source, + }; + + if (includeRaw) { + notificationEvent.raw = { + verificationProof: data.payload.verificationProof, + }; + } + + return notificationEvent; + } +} diff --git a/packages/restapi/src/lib/pushstream/PushStream.ts b/packages/restapi/src/lib/pushstream/PushStream.ts new file mode 100644 index 000000000..f7102175e --- /dev/null +++ b/packages/restapi/src/lib/pushstream/PushStream.ts @@ -0,0 +1,280 @@ +import { EventEmitter } from 'events'; +import { createSocketConnection, EVENTS } from '@pushprotocol/socket'; +import { ENV } from '../constants'; +import { + GroupEventType, + MessageEventType, + NotificationEventType, + ProposedEventNames, + PushStreamInitializeProps, + STREAM, +} from './pushStreamTypes'; +import { DataModifier } from './DataModifier'; +import { pCAIP10ToWallet, walletToPCAIP10 } from '../helpers'; +import { Chat } from '../pushapi/chat'; +import { ProgressHookType, SignerType } from '../types'; + +export class PushStream extends EventEmitter { + private pushChatSocket: any; + private pushNotificationSocket: any; + + private account: string; + private raw: boolean; + private options: PushStreamInitializeProps; + private chatInstance: Chat; + + constructor( + account: string, + private decryptedPgpPvtKey: string, + private signer: SignerType, + options: PushStreamInitializeProps, + private progressHook?: (progress: ProgressHookType) => void + ) { + super(); + + this.account = account; + this.pushChatSocket = createSocketConnection({ + user: walletToPCAIP10(account), + socketType: 'chat', + socketOptions: { + autoConnect: options.connection?.auto ?? true, + reconnectionAttempts: options.connection?.retries ?? 3, + }, + env: options.env as ENV, + }); + + this.pushNotificationSocket = createSocketConnection({ + user: pCAIP10ToWallet(this.account), + env: options.env as ENV, + socketOptions: { + autoConnect: options.connection?.auto ?? true, + reconnectionAttempts: options.connection?.retries ?? 3, + }, + }); + + if (!this.pushNotificationSocket) { + throw new Error('Push notification socket not connected'); + } + + if (!this.pushChatSocket) { + throw new Error('Push chat socket not connected'); + } + + this.raw = options.raw ?? false; + this.options = options; + + this.chatInstance = new Chat( + this.account, + this.decryptedPgpPvtKey, + this.options.env as ENV, + this.signer, + this.progressHook + ); + } + + static async initialize( + account: string, + decryptedPgpPvtKey: string, + signer: SignerType, + progressHook?: (progress: ProgressHookType) => void, + options?: PushStreamInitializeProps + ): Promise { + const defaultOptions: PushStreamInitializeProps = { + listen: [], + env: ENV.LOCAL, + raw: false, + connection: { + auto: true, + retries: 3, + }, + }; + + const settings = { + ...defaultOptions, + ...options, + }; + + const stream = new PushStream( + account, + decryptedPgpPvtKey, + signer, + settings, + progressHook + ); + await stream.init(); + return stream; + } + + private convertToProposedName(currentEventName: string): ProposedEventNames { + switch (currentEventName) { + case 'message': + return ProposedEventNames.Message; + case 'request': + return ProposedEventNames.Request; + case 'accept': + return ProposedEventNames.Accept; + case 'reject': + return ProposedEventNames.Reject; + case 'leaveGroup': + return ProposedEventNames.LeaveGroup; + case 'joinGroup': + return ProposedEventNames.JoinGroup; + case 'createGroup': + return ProposedEventNames.CreateGroup; + case 'updateGroup': + return ProposedEventNames.UpdateGroup; + case 'remove': + return ProposedEventNames.Remove; + default: + throw new Error(`Unknown current event name: ${currentEventName}`); + } + } + + private handleToField(data: any): void { + switch (data.event) { + case ProposedEventNames.LeaveGroup: + case ProposedEventNames.JoinGroup: + data.to = null; + break; + + case ProposedEventNames.Accept: + case ProposedEventNames.Reject: + if (data.meta?.group) { + data.to = null; + } + break; + + default: + break; + } + } + + private shouldEmitChat(dataChatId: string): boolean { + if (!this.options.filter?.chats || this.options.filter.chats.length === 0) { + return true; + } + return this.options.filter.chats.includes(dataChatId); + } + + private shouldEmitChannel(dataChannelId: string): boolean { + if ( + !this.options.filter?.channels || + this.options.filter.channels.length === 0 + ) { + return true; + } + return this.options.filter.channels.includes(dataChannelId); + } + + public async init(): Promise { + const shouldEmit = (eventType: STREAM): boolean => { + if (!this.options.listen || this.options.listen.length === 0) { + return true; + } + return this.options.listen.includes(eventType); + }; + + this.pushChatSocket.on(EVENTS.CHAT_GROUPS, (data: any) => { + try { + const modifiedData = DataModifier.handleChatGroupEvent(data, this.raw); + modifiedData.event = this.convertToProposedName(modifiedData.event); + this.handleToField(modifiedData); + if (this.shouldEmitChat(data.chatId)) { + if ( + data.eventType === GroupEventType.JoinGroup || + data.eventType === GroupEventType.LeaveGroup || + data.eventType === MessageEventType.Request || + data.eventType === GroupEventType.Remove + ) { + if (shouldEmit(STREAM.CHAT)) { + this.emit(STREAM.CHAT, modifiedData); + } + } else { + if (shouldEmit(STREAM.CHAT_OPS)) { + this.emit(STREAM.CHAT_OPS, modifiedData); + } + } + } + } catch (error) { + console.error( + 'Error handling CHAT_GROUPS event:', + error, + 'Data:', + data + ); + } + }); + + this.pushChatSocket.on(EVENTS.CHAT_RECEIVED_MESSAGE, async (data: any) => { + try { + if ( + data.messageCategory == 'Chat' || + data.messageCategory == 'Request' + ) { + data = await this.chatInstance.decrypt([data]); + data = data[0]; + } + + const modifiedData = DataModifier.handleChatEvent(data, this.raw); + modifiedData.event = this.convertToProposedName(modifiedData.event); + this.handleToField(modifiedData); + if (this.shouldEmitChat(data.chatId)) { + if (shouldEmit(STREAM.CHAT)) { + this.emit(STREAM.CHAT, modifiedData); + } + } + } catch (error) { + console.error( + 'Error handling CHAT_RECEIVED_MESSAGE event:', + error, + 'Data:', + data + ); + } + }); + + this.pushNotificationSocket.on(EVENTS.USER_FEEDS, (data: any) => { + try { + const modifiedData = DataModifier.mapToNotificationEvent( + data, + NotificationEventType.INBOX, + this.account === data.sender ? 'self' : 'other', + this.raw + ); + + if (this.shouldEmitChannel(modifiedData.from)) { + if (shouldEmit(STREAM.NOTIF)) { + this.emit(STREAM.NOTIF, modifiedData); + } + } + } catch (error) { + console.error('Error handling USER_FEEDS event:', error, 'Data:', data); + } + }); + + this.pushNotificationSocket.on(EVENTS.USER_SPAM_FEEDS, (data: any) => { + try { + const modifiedData = DataModifier.mapToNotificationEvent( + data, + NotificationEventType.SPAM, + this.account === data.sender ? 'self' : 'other', + this.raw + ); + modifiedData.origin = + this.account === modifiedData.from ? 'self' : 'other'; + if (this.shouldEmitChannel(modifiedData.from)) { + if (shouldEmit(STREAM.NOTIF)) { + this.emit(STREAM.NOTIF, modifiedData); + } + } + } catch (error) { + console.error( + 'Error handling USER_SPAM_FEEDS event:', + error, + 'Data:', + data + ); + } + }); + } +} diff --git a/packages/restapi/src/lib/pushstream/pushStreamTypes.ts b/packages/restapi/src/lib/pushstream/pushStreamTypes.ts new file mode 100644 index 000000000..e96496edb --- /dev/null +++ b/packages/restapi/src/lib/pushstream/pushStreamTypes.ts @@ -0,0 +1,233 @@ +import { Rules } from "../types"; +import Constants, { ENV } from '../constants'; + +export type PushStreamInitializeProps = { + listen?: STREAM[]; + filter?: { + channels?: string[]; + chats?: string[]; + }; + connection?: { + auto?: boolean; + retries?: number; + }; + raw?: boolean; + env?: ENV; + enabled?: boolean; +}; + +export enum STREAM { + PROFILE = 'STREAM.PROFILE', + ENCRYPTION = 'STREAM.ENCRYPTION', + NOTIF = 'STREAM.NOTIF', + NOTIF_OPS = 'STREAM.NOTIF_OPS', + CHAT = 'STREAM.CHAT', + CHAT_OPS = 'STREAM.CHAT_OPS', +} + +export enum NotificationEventType { + INBOX = 'notification.inbox', + SPAM = 'notification.spam', +} + + +export enum MessageOrigin { + Other = 'other', + Self = 'self', +} + +export enum MessageEventType { + Message = 'message', + Request = 'request', + Accept = 'accept', + Reject = 'reject', +} + +export enum GroupEventType { + CreateGroup = 'createGroup', + UpdateGroup = 'updateGroup', + JoinGroup = 'joinGroup', + LeaveGroup = 'leaveGroup', + Remove = 'remove', +} + +export enum ProposedEventNames { + Message = 'chat.message', + Request = 'chat.request', + Accept = 'chat.accept', + Reject = 'chat.reject', + LeaveGroup = 'chat.group.participant.leave', + JoinGroup = 'chat.group.participant.join', + CreateGroup = 'chat.group.create', + UpdateGroup = 'chat.group.update', + Remove = 'chat.group.participant.remove', +} + + +export interface Profile { + image: string; + publicKey: string; +} + +export interface Member { + address: string; + profile: Profile; +} + +export interface Pending { + members: Member[]; + admins: Member[]; +} + +export interface GroupMeta { + name: string; + description: string; + image: string; + owner: string; + members: Member[]; + admins: Member[]; + pending: Pending; + private: boolean; + rules: Rules; +} + +export interface GroupEventRawData { + verificationProof: string; +} + +export interface GroupEventBase { + origin: MessageOrigin; + timestamp: string; + chatId: string; + from: string; + meta: GroupMeta; + raw?: GroupEventRawData; + event: GroupEventType; +} + +export interface CreateGroupEvent extends GroupEventBase { + event: GroupEventType.CreateGroup; +} + +export interface UpdateGroupEvent extends GroupEventBase { + event: GroupEventType.UpdateGroup; +} + +export interface GroupMemberEventBase { + event: GroupEventType | MessageEventType; + origin: MessageOrigin; + timestamp: string; + chatId: string; + from: string; + to: string[]; + raw?: GroupEventRawData; +} + +export interface JoinGroupEvent extends GroupMemberEventBase { + event: GroupEventType.JoinGroup; +} + +export interface LeaveGroupEvent extends GroupMemberEventBase { + event: GroupEventType.LeaveGroup; +} + +export interface RequestEvent extends GroupMemberEventBase { + event: MessageEventType.Request; + meta: { + group: boolean; + }; +} + +export interface RemoveEvent extends GroupMemberEventBase { + event: GroupEventType.Remove; +} + + +export interface MessageEvent { + event: MessageEventType; + origin: MessageOrigin; + timestamp: string; + chatId: string; + from: string; + to: string[]; + message: { + type: string; + content: string; + }; + meta: { + group: boolean; + }; + reference: string; + raw?: MessageRawData; +} + +export const NOTIFICATION = { + TYPE: { + BROADCAST: 1, + TARGETTED: 3, + SUBSET: 4, + }, +} as const; + +export type NotificationType = keyof typeof NOTIFICATION.TYPE; + + + +export interface NotificationEvent { + event: NotificationEventType; + origin: 'other' | 'self'; + timestamp: string; + from: string; + to: string[]; + notifID: string; + channel: { + name: string; + icon: string; + url: string; + }; + meta: { + type: string; + }; + message: { + notification: { + title: string; + body: string; + }; + payload?: { + title?: string; + body?: string; + cta?: string; + embed?: string; + meta?: { + domain?: string; + type: string; + data: string; + }; + }; + }; + config?: { + expiry?: number; + silent?: boolean; + hidden?: boolean; + }; + advanced?: { + chatid?: string; + }; + source: string; + raw?: { + verificationProof: string; + }; +} + +export interface MessageRawData { + fromCAIP10: string; + toCAIP10: string; + fromDID: string; + toDID: string; + encType: string; + encryptedSecret: string; + signature: string; + sigType: string; + verificationProof: string; + previousReference: string; +} \ No newline at end of file diff --git a/packages/restapi/src/lib/space/acceptPromotionRequest.ts b/packages/restapi/src/lib/space/acceptPromotionRequest.ts index 0a5ea4ea3..6ed125b25 100644 --- a/packages/restapi/src/lib/space/acceptPromotionRequest.ts +++ b/packages/restapi/src/lib/space/acceptPromotionRequest.ts @@ -36,14 +36,14 @@ export async function acceptPromotionRequest( }); // accept the promotion request - this.acceptRequest({ - signalData, - senderAddress: this.data.local.address, - recipientAddress: pCAIP10ToWallet(promoteeAddress), - chatId: spaceId, - details: { - type: SPACE_ACCEPT_REQUEST_TYPE.ACCEPT_PROMOTION, - data: {}, - }, - }); + // this.acceptRequest({ + // signalData, + // senderAddress: this.data.local.address, + // recipientAddress: pCAIP10ToWallet(promoteeAddress), + // chatId: spaceId, + // details: { + // type: SPACE_ACCEPT_REQUEST_TYPE.ACCEPT_PROMOTION, + // data: {}, + // }, + // }); } diff --git a/packages/restapi/src/lib/space/start.ts b/packages/restapi/src/lib/space/start.ts index 70c369a13..5fd42f966 100644 --- a/packages/restapi/src/lib/space/start.ts +++ b/packages/restapi/src/lib/space/start.ts @@ -31,14 +31,15 @@ type StartType = { livepeerApiKey: string; }; -export async function start(this: Space, options: StartType): Promise { - const { livepeerApiKey } = options || {}; +// export async function start(this: Space, options: StartType): Promise { +export async function start(this: Space): Promise { + // const { livepeerApiKey } = options || {}; try { // host should have there audio stream - if (!this.data.local.stream) { - throw new Error('Local audio stream not found'); - } + // if (!this.data.local.stream) { + // throw new Error('Local audio stream not found'); + // } const space = await get({ spaceId: this.spaceSpecificData.spaceId, @@ -115,109 +116,109 @@ export async function start(this: Space, options: StartType): Promise { }); }); - // start the livepeer playback and store the playback URL group meta - // send a notification/meta message to all the added listeners (members) telling the space has started - - // create the mergeStream object - const mergedStream = getMergeStreamObject(this.data.local.stream); - // store the mergeStreamObject - this.mergedStream = mergedStream; - - const url = 'https://livepeer.studio/api/stream'; - const data = { - name: this.spaceSpecificData.spaceName, - record: true, - }; - - const { data: responseData } = await axios.post(url, data, { - headers: { - Authorization: 'Bearer ' + livepeerApiKey, - }, - }); - - const { streamKey, playbackId } = responseData; - - console.log('livepeer details', streamKey, playbackId); - - this.update({ meta: playbackId }); - - let redirectUrl; - try { - console.log('Ignore the following error'); - - // the redirect URL from the above GET request - await axios.get(`https://livepeer.studio/webrtc/${streamKey}`); - } catch (err: any) { - console.log('redirectUrl error', err); - redirectUrl = err.request.responseURL; - } - - // we use the host from the redirect URL in the ICE server configuration - const host = new URL(redirectUrl).host; - - const iceServers = [ - { - urls: `stun:${host}`, - }, - { - urls: `turn:${host}`, - username: 'livepeer', - credential: 'livepeer', - }, - ]; - - const peerConnection = new RTCPeerConnection({ iceServers }); - - const newAudioTrack = mergedStream.result?.getAudioTracks?.()?.[0] ?? null; - - if (newAudioTrack) { - peerConnection?.addTransceiver(newAudioTrack, { - direction: 'sendonly', - }); - } - - /** - * https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/createOffer - * We create an SDP offer here which will be shared with the server - */ - const offer = await peerConnection.createOffer(); - /** https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/setLocalDescription */ - await peerConnection.setLocalDescription(offer); - - /** Wait for ICE gathering to complete */ - const ofr = await new Promise((resolve) => { - /** Wait at most five seconds for ICE gathering. */ - setTimeout(() => { - resolve(peerConnection.localDescription); - }, 5000); - peerConnection.onicegatheringstatechange = (_ev) => { - if (peerConnection.iceGatheringState === 'complete') { - resolve(peerConnection.localDescription); - } - }; - }); - if (!ofr) { - throw Error('failed to gather ICE candidates for offer'); - } - /** - * This response contains the server's SDP offer. - * This specifies how the client should communicate, - * and what kind of media client and server have negotiated to exchange. - */ - const sdpResponse = await fetch(redirectUrl, { - method: 'POST', - mode: 'cors', - headers: { - 'content-type': 'application/sdp', - }, - body: ofr.sdp, - }); - if (sdpResponse.ok) { - const answerSDP = await sdpResponse.text(); - await peerConnection.setRemoteDescription( - new RTCSessionDescription({ type: 'answer', sdp: answerSDP }) - ); - } + // // start the livepeer playback and store the playback URL group meta + // // send a notification/meta message to all the added listeners (members) telling the space has started + + // // create the mergeStream object + // const mergedStream = getMergeStreamObject(this.data.local.stream); + // // store the mergeStreamObject + // this.mergedStream = mergedStream; + + // const url = 'https://livepeer.studio/api/stream'; + // const data = { + // name: this.spaceSpecificData.spaceName, + // record: true, + // }; + + // const { data: responseData } = await axios.post(url, data, { + // headers: { + // Authorization: 'Bearer ' + livepeerApiKey, + // }, + // }); + + // const { streamKey, playbackId } = responseData; + + // console.log('livepeer details', streamKey, playbackId); + + // this.update({ meta: playbackId }); + + // let redirectUrl; + // try { + // console.log('Ignore the following error'); + + // // the redirect URL from the above GET request + // await axios.get(`https://livepeer.studio/webrtc/${streamKey}`); + // } catch (err: any) { + // console.log('redirectUrl error', err); + // redirectUrl = err.request.responseURL; + // } + + // // we use the host from the redirect URL in the ICE server configuration + // const host = new URL(redirectUrl).host; + + // const iceServers = [ + // { + // urls: `stun:${host}`, + // }, + // { + // urls: `turn:${host}`, + // username: 'livepeer', + // credential: 'livepeer', + // }, + // ]; + + // const peerConnection = new RTCPeerConnection({ iceServers }); + + // const newAudioTrack = mergedStream.result?.getAudioTracks?.()?.[0] ?? null; + + // if (newAudioTrack) { + // peerConnection?.addTransceiver(newAudioTrack, { + // direction: 'sendonly', + // }); + // } + + // /** + // * https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/createOffer + // * We create an SDP offer here which will be shared with the server + // */ + // const offer = await peerConnection.createOffer(); + // /** https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/setLocalDescription */ + // await peerConnection.setLocalDescription(offer); + + // /** Wait for ICE gathering to complete */ + // const ofr = await new Promise((resolve) => { + // /** Wait at most five seconds for ICE gathering. */ + // setTimeout(() => { + // resolve(peerConnection.localDescription); + // }, 5000); + // peerConnection.onicegatheringstatechange = (_ev) => { + // if (peerConnection.iceGatheringState === 'complete') { + // resolve(peerConnection.localDescription); + // } + // }; + // }); + // if (!ofr) { + // throw Error('failed to gather ICE candidates for offer'); + // } + // /** + // * This response contains the server's SDP offer. + // * This specifies how the client should communicate, + // * and what kind of media client and server have negotiated to exchange. + // */ + // const sdpResponse = await fetch(redirectUrl, { + // method: 'POST', + // mode: 'cors', + // headers: { + // 'content-type': 'application/sdp', + // }, + // body: ofr.sdp, + // }); + // if (sdpResponse.ok) { + // const answerSDP = await sdpResponse.text(); + // await peerConnection.setRemoteDescription( + // new RTCSessionDescription({ type: 'answer', sdp: answerSDP }) + // ); + // } console.log('Live Stream started'); } catch (err) { diff --git a/packages/restapi/src/lib/types/index.ts b/packages/restapi/src/lib/types/index.ts index 3394cdbec..e75a057a5 100644 --- a/packages/restapi/src/lib/types/index.ts +++ b/packages/restapi/src/lib/types/index.ts @@ -315,10 +315,10 @@ export type Data = { contract?: string; amount?: number; decimals?: number; - guildId?: string; - guildRoleId?: string; + id?: string; + role?: string; url?: string; - comparison?: '>' | '<' | '>=' | '<=' | '==' | '!='; + comparison?: '>' | '<' | '>=' | '<=' | '==' | '!=' | 'all' | 'any'; }; export type ConditionBase = { @@ -327,6 +327,7 @@ export type ConditionBase = { subcategory?: string; data?: Data; access?: boolean; + }; export type Condition = ConditionBase & { @@ -335,28 +336,35 @@ export type Condition = ConditionBase & { }; export interface Rules { - groupAccess?: { - conditions: Array; + entry?: { + conditions: Array | (Condition | ConditionBase); }; - chatAccess?: { - conditions: Array; + chat?: { + conditions: Array | (Condition | ConditionBase); }; } + export interface SpaceRules { - spaceAccess?: { - conditions: Array; + entry?: { + conditions: Array | (Condition | ConditionBase); }; } export interface GroupAccess { - groupAccess: boolean; - chatAccess: boolean; + entry: boolean; + chat: boolean; rules?: Rules; } +export interface GroupMemberStatus { + isMember: boolean; + isPending: boolean; + isAdmin: boolean; +} + export interface SpaceAccess { - spaceAccess: boolean; + entry: boolean; rules?: SpaceRules; } @@ -536,7 +544,7 @@ export interface UserInfo { isAdmin: boolean; } -type ethersV5SignerType = { +export type ethersV5SignerType = { _signTypedData: ( domain: TypedDataDomain, types: Record>, @@ -548,7 +556,7 @@ type ethersV5SignerType = { privateKey?: string; provider?: providers.Provider; }; -type viemSignerType = { +export type viemSignerType = { signTypedData: (args: { account: any; domain: any; @@ -565,6 +573,7 @@ type viemSignerType = { account: { [key: string]: any }; privateKey?: string; provider?: providers.Provider; + }; export type SignerType = ethersV5SignerType | viemSignerType; diff --git a/packages/restapi/src/lib/user/getFeedsPerChannel.ts b/packages/restapi/src/lib/user/getFeedsPerChannel.ts new file mode 100644 index 000000000..fb6d902d4 --- /dev/null +++ b/packages/restapi/src/lib/user/getFeedsPerChannel.ts @@ -0,0 +1,57 @@ +import axios from 'axios'; +import { + getCAIPAddress, + getAPIBaseUrls, + getQueryParams, + getLimit, +} from '../helpers'; +import Constants, { ENV } from '../constants'; +import { parseApiResponse } from '../utils'; + +export type FeedsPerChannelOptionsType = { + user: string; + env?: ENV; + channels?: [string]; + page?: number; + limit?: number; + spam?: boolean; + raw?: boolean; +}; + +export const getFeedsPerChannel = async (options: FeedsPerChannelOptionsType) => { + const { + user, + env = Constants.ENV.PROD, + page = Constants.PAGINATION.INITIAL_PAGE, + limit = Constants.PAGINATION.LIMIT, + spam = false, + raw = false, + channels = [], + } = options || {}; + + const _user = await getCAIPAddress(env, user, 'User'); + const API_BASE_URL = getAPIBaseUrls(env); + if (channels.length == 0) { + throw new Error('channels cannot be empty'); + } + const _channel = await getCAIPAddress(env, channels[0], 'Channel'); + const apiEndpoint = `${API_BASE_URL}/v1/users/${_channel}/channels/${_user}/feeds`; + const queryObj = { + page, + limit: getLimit(limit), + spam, + }; + + const requestUrl = `${apiEndpoint}?${getQueryParams(queryObj)}`; + return axios + .get(requestUrl) + .then((response) => { + if (raw) { + return response?.data?.feeds || []; + } + return parseApiResponse(response?.data?.feeds) || []; + }) + .catch((err) => { + console.error(`[Push SDK] - API ${requestUrl}: `, err); + }); +}; diff --git a/packages/restapi/src/lib/user/index.ts b/packages/restapi/src/lib/user/index.ts index 3c3affd54..d5c2b9084 100644 --- a/packages/restapi/src/lib/user/index.ts +++ b/packages/restapi/src/lib/user/index.ts @@ -9,6 +9,8 @@ export * from './getUsersBatch'; export * from './upgradeUser'; export * from './decryptAuth'; export * from './createUserWithProfile'; +export * from './getFeedsPerChannel'; + export const auth = { update: authUpdate, }; diff --git a/packages/restapi/tests/lib/chat/updateGroup.test.ts b/packages/restapi/tests/lib/chat/updateGroup.test.ts index 86862853a..5f10b2db5 100644 --- a/packages/restapi/tests/lib/chat/updateGroup.test.ts +++ b/packages/restapi/tests/lib/chat/updateGroup.test.ts @@ -191,7 +191,6 @@ const expectGroup = async ( expect(group.scheduleEnd).to.be.null; expect(group.groupType).to.equal('default'); expect((group as any).status).to.be.null; - expect((group as any).eventType).to.equal('update'); if (!HasMeta) { expect((group as any).meta).to.be.null; } else { diff --git a/packages/restapi/tests/lib/pushNotification/alias.test.ts b/packages/restapi/tests/lib/pushNotification/alias.test.ts new file mode 100644 index 000000000..ae62cf864 --- /dev/null +++ b/packages/restapi/tests/lib/pushNotification/alias.test.ts @@ -0,0 +1,53 @@ +import * as path from 'path'; +import * as dotenv from 'dotenv'; +dotenv.config({ path: path.resolve(__dirname, '../../../.env') }); + +import { PushAPI } from '../../../src/lib/pushapi/PushAPI'; +import { expect } from 'chai'; +import { ethers } from 'ethers'; + +describe('PushAPI.alias functionality', () => { + let userAlice: PushAPI; + let userBob: PushAPI; + let userKate: PushAPI; + let signer1: any; + let account1: string; + let signer2: any; + let account2: string; + + beforeEach(async () => { + signer1 = new ethers.Wallet(`0x${process.env['WALLET_PRIVATE_KEY']}`); + account1 = await signer1.getAddress(); + + const provider = new ethers.providers.JsonRpcProvider( + // PUBLIC RPC + 'https://goerli.blockpi.network/v1/rpc/public' + ); + + signer2 = new ethers.Wallet( + `0x${process.env['WALLET_PRIVATE_KEY']}`, + provider + ); + account2 = await signer2.getAddress(); + + // initialisation with signer and provider + userKate = await PushAPI.initialize(signer2); + // initialisation with signer + userAlice = await PushAPI.initialize(signer2); + // TODO: remove signer1 after chat makes signer as optional + //initialisation without signer + userBob = await PushAPI.initialize(signer1); + }); + + describe('alias :: info', () => { + // TODO: remove skip after signer becomes optional + it('Should return response', async () => { + const res = await userBob.channel.alias.info({ + alias: '0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', + aliasChain: 'POLYGON', + }); + // console.log(res) + expect(res).not.null; + }); + }); +}); diff --git a/packages/restapi/tests/lib/pushNotification/channel.test.ts b/packages/restapi/tests/lib/pushNotification/channel.test.ts new file mode 100644 index 000000000..579fcb3c4 --- /dev/null +++ b/packages/restapi/tests/lib/pushNotification/channel.test.ts @@ -0,0 +1,298 @@ +import * as path from 'path'; +import * as dotenv from 'dotenv'; +dotenv.config({ path: path.resolve(__dirname, '../../../.env') }); + +import { PushAPI } from '../../../src/lib/pushapi/PushAPI'; +import { expect } from 'chai'; +import { ethers } from 'ethers'; + +describe('PushAPI.channel functionality', () => { + let userAlice: PushAPI; + let userBob: PushAPI; + let userKate: PushAPI; + let signer1: any; + let account1: string; + let signer2: any; + let account2: string; + + beforeEach(async () => { + signer1 = new ethers.Wallet(`0x${process.env['WALLET_PRIVATE_KEY']}`); + account1 = await signer1.getAddress(); + + const provider = new ethers.providers.JsonRpcProvider( + // PUBLIC RPC + 'https://goerli.blockpi.network/v1/rpc/public' + ); + + signer2 = new ethers.Wallet( + `0x${process.env['WALLET_PRIVATE_KEY']}`, + provider + ); + account2 = await signer2.getAddress(); + enum ENV { + PROD = 'prod', + STAGING = 'staging', + DEV = 'dev', + /** + * **This is for local development only** + */ + LOCAL = 'local', + } + // initialisation with signer and provider + userKate = await PushAPI.initialize(signer2) + // initialisation with signer + userAlice = await PushAPI.initialize(signer2); + // TODO: remove signer1 after chat makes signer as optional + //initialisation without signer + userBob = await PushAPI.initialize(signer1); + }); + + describe('channel :: info', () => { + // TODO: remove skip after signer becomes optional + it.skip('Without signer and account: Should throw error', async () => { + await expect(() => userBob.channel.info()).to.Throw; + }); + + it('Without signer but with non-caip account: Should return response', async () => { + const res = await userBob.channel.info( + '0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5' + ); + // console.log(res) + expect(res).not.null; + }); + + it('Without signer and with valid caip account: Should return response', async () => { + const res = await userBob.channel.info( + 'eip155:5:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5' + ); + // console.log(res); + expect(res).not.null; + }); + }); + + describe('channel :: search', () => { + it('Without signer and account : Should return response', async () => { + const res = await userBob.channel.search(' '); + // console.log(res); + expect(res).not.null; + }); + + it('With signer: Should return response', async () => { + const res = await userBob.channel.search(' '); + // console.log(res); + expect(res).not.null; + }); + + it('Should throw error for empty query', async () => { + // const res = await userBob.channel.search('') + await expect(() => userBob.channel.search('')).to.Throw; + }); + }); + + describe('channel :: subscribers', () => { + // TODO: remove skip after signer becomes optional + it.skip('Without signer and account : Should throw error', async () => { + await expect(() => userBob.channel.subscribers()).to.Throw; + }); + + it('Without signer and account : Should return response as address is passed', async () => { + const res = await userBob.channel.subscribers({ + channel: 'eip155:5:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', + }); + // console.log(res) + expect(res).not.null; + }); + + it('Without signer and account : Should return response for alias address', async () => { + const res = await userBob.channel.subscribers({ + channel: 'eip155:80001:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', + }); + // console.log(res) + expect(res).not.null; + }); + + it('Without signer and account : Should return response without passing the options', async () => { + const res = await userKate.channel.subscribers(); + expect(res).not.null; + }); + + it('Without signer and account : Should throw error for invalid caip', async () => { + await expect(() => + userBob.channel.subscribers({ + channel: '0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', + }) + ).to.Throw; + }); + }); + + describe('channel :: send', () => { + // TODO: remove skip after signer becomes optional + it.skip('Without signer and account : Should throw error', async () => { + await expect(() => { + userBob.channel.send(['*'], { + notification: { + title: 'test', + body: 'test', + }, + }); + }).to.Throw; + }); + + it('With signer : broadcast : Should send notification with title and body', async () => { + const res = await userAlice.channel.send(['*'], { + notification: { + title: 'test', + body: 'test', + }, + }); + // console.log(res) + expect(res.status).to.equal(204); + }); + + it('With signer : targeted : Should send notification with title and body', async () => { + const res = await userAlice.channel.send( + ['eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681'], + { + notification: { + title: 'hi', + body: 'test-targeted', + }, + } + ); + expect(res.status).to.equal(204); + }); + + it('With signer : targeted : Should send notification with title and body', async () => { + const res = await userAlice.channel.send( + ['eip155:5:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5'], + { + notification: { + title: 'hi', + body: 'test-targeted', + }, + } + ); + expect(res.status).to.equal(204); + }); + + it('With signer : subset : Should send notification with title and body', async () => { + const res = await userAlice.channel.send( + [ + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', + 'eip155:5:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', + ], + { + notification: { + title: 'hi', + body: 'test-targeted', + }, + } + ); + expect(res.status).to.equal(204); + }); + + it('With signer : subset : Should send notification with title and body along with additional options', async () => { + const res = await userAlice.channel.send( + [ + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', + 'eip155:5:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', + ], + { + notification: { + title: 'hi', + body: 'test-targeted', + }, + payload: { + title: 'testing first notification', + body: 'testing with random body', + cta: 'https://google.com/', + embed: 'https://avatars.githubusercontent.com/u/64157541?s=200&v=4', + }, + } + ); + expect(res.status).to.equal(204); + }); + + it('With signer : subset : Should send notification with title and body along with additional options', async () => { + const res = await userAlice.channel.send( + [ + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', + 'eip155:5:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', + ], + { + notification: { + title: 'hi', + body: 'test-subset', + }, + payload: { + title: 'testing first subset notification', + body: 'testing with random body', + cta: 'https://google.com/', + embed: 'https://avatars.githubusercontent.com/u/64157541?s=200&v=4', + }, + } + ); + expect(res.status).to.equal(204); + }); + + it('With signer : subset : Should send notification with title and body along with additional options for alias', async () => { + const res = await userAlice.channel.send( + [ + 'eip155:97:0xD8634C39BBFd4033c0d3289C4515275102423681', + 'eip155:97:0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5', + ], + { + notification: { + title: 'hi', + body: 'test-subset', + }, + payload: { + title: 'testing first subset notification', + body: 'testing with random body', + cta: 'https://google.com/', + embed: 'https://avatars.githubusercontent.com/u/64157541?s=200&v=4', + }, + channel: 'eip155:97:0xD8634C39BBFd4033c0d3289C4515275102423681', + } + ); + expect(res.status).to.equal(204); + }); + }); + + describe.skip('channel :: update', () => { + it('Should update channel meta', async () => { + const res = await userKate.channel.update({ + name: 'Updated Name', + description: 'Testing new description', + url: 'https://google.com', + icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAz0lEQVR4AcXBsU0EQQyG0e+saWJ7oACiKYDMEZVs6GgSpC2BIhzRwAS0sgk9HKn3gpFOAv3v3V4/3+4U4Z1q5KTy42Ql940qvFONnFSGmCFmiN2+fj7uCBlihpgh1ngwcvKfwjuVIWaIGWKNB+GdauSk8uNkJfeNKryzYogZYoZY40m5b/wlQ8wQM8TayMlKeKcaOVkJ71QjJyuGmCFmiDUe+HFy4VyEd57hx0mV+0ZliBlihlgL71w4FyMnVXhnZeSkiu93qheuDDFDzBD7BcCyMAOfy204AAAAAElFTkSuQmCC', + }); + // console.log(res) + expect(res).not.null; + }, 10000000000); + }); + + describe.skip('channel :: create', () => { + it('Should create channel', async () => { + const res = await userKate.channel.create({ + name: 'SDK Test', + description: 'Testing new description', + url: 'https://google.com', + icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAz0lEQVR4AcXBsU0EQQyG0e+saWJ7oACiKYDMEZVs6GgSpC2BIhzRwAS0sgk9HKn3gpFOAv3v3V4/3+4U4Z1q5KTy42Ql940qvFONnFSGmCFmiN2+fj7uCBlihpgh1ngwcvKfwjuVIWaIGWKNB+GdauSk8uNkJfeNKryzYogZYoZY40m5b/wlQ8wQM8TayMlKeKcaOVkJ71QjJyuGmCFmiDUe+HFy4VyEd57hx0mV+0ZliBlihlgL71w4FyMnVXhnZeSkiu93qheuDDFDzBD7BcCyMAOfy204AAAAAElFTkSuQmCC', + }); + // console.log(res) + expect(res).not.null; + }, 10000000000); + }); + + describe.skip('channel :: settings', () => { + it('Should create channel', async () => { + const res = await userKate.channel.setting([ + { type: 0, default: 1, description: 'My Notif Settings' }, + {type: 1, default: 5, description: "My notif setting 2", data: {upper:100, lower:5}} + ]); + // console.log(res) + expect(res).not.null; + }, 10000000000); + }); +}); diff --git a/packages/restapi/tests/lib/pushNotification/delegate.test.ts b/packages/restapi/tests/lib/pushNotification/delegate.test.ts new file mode 100644 index 000000000..bc43c9986 --- /dev/null +++ b/packages/restapi/tests/lib/pushNotification/delegate.test.ts @@ -0,0 +1,180 @@ +import * as path from 'path'; +import * as dotenv from 'dotenv'; +dotenv.config({ path: path.resolve(__dirname, '../../../.env') }); + +import { PushAPI } from '../../../src/lib/pushapi/PushAPI'; // Ensure correct import path +import { expect } from 'chai'; +import { ethers } from 'ethers'; +// import tokenABI from './tokenABI'; +describe('PushAPI.delegate functionality', () => { + let userAlice: PushAPI; + let userBob: PushAPI; + let userKate: PushAPI; + let signer1: any; + let account1: string; + let signer2: any; + let account2: string; + + beforeEach(async () => { + signer1 = new ethers.Wallet(`0x${process.env['WALLET_PRIVATE_KEY']}`); + account1 = await signer1.getAddress(); + + const provider = new ethers.providers.JsonRpcProvider( + 'https://goerli.blockpi.network/v1/rpc/public' + ); + + signer2 = new ethers.Wallet( + `0x${process.env['WALLET_PRIVATE_KEY']}`, + provider + ); + account2 = await signer2.getAddress(); + + // initialisation with signer and provider + userKate = await PushAPI.initialize(signer2); + // initialisation with signer + userAlice = await PushAPI.initialize(signer1); + // initialisation without signer + userBob = await PushAPI.initialize(signer1); + }); + + describe('delegate :: add', () => { + // TODO: remove skip after signer becomes optional + it.skip('Without signer and account :: should throw error', async () => { + await expect(() => + userBob.channel.delegate.add( + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + ) + ).to.Throw; + }); + + it('With signer and without provider :: should throw error', async () => { + await expect(() => + userAlice.channel.delegate.add( + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + ) + ).to.Throw; + }); + + it('With signer and provider :: should add delegate', async () => { + const res = await userKate.channel.delegate.add( + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + ); + // console.log(res); + expect(res).not.null; + }, 100000000); + + it('With signer and provider :: should throw error as delegate caip and provider doesnt match', async () => { + await expect(() => + userKate.channel.delegate.add( + 'eip155:80001:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + ) + ).to.Throw; + }); + + it('With viem signer: Should add delegate', async () => { + // create polygon mumbai provider + const provider = new ethers.providers.JsonRpcProvider( + 'https://rpc-mumbai.maticvigil.com' + ); + + signer2 = new ethers.Wallet( + `0x${process.env['WALLET_PRIVATE_KEY']}`, + provider + ); + userKate = await PushAPI.initialize(signer2); + const res = await userKate.channel.delegate.add( + 'eip155:80001:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + ); + // console.log(res); + expect(res).not.null; + }, 10000000); + }); + + describe('delegate :: remove', () => { + // TODO: remove skip after signer becomes optional + it.skip('Without signer and account :: should throw error', async () => { + await expect(() => + userBob.channel.delegate.remove( + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + ) + ).to.Throw; + }); + + it('With signer and without provider :: should throw error', async () => { + await expect(() => + userAlice.channel.delegate.remove( + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + ) + ).to.Throw; + }); + + it('With signer and provider :: should add delegate', async () => { + const res = await userKate.channel.delegate.remove( + 'eip155:5:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + ); + console.log(res); + expect(res).not.null; + }, 100000000); + + it('With signer and provider :: should throw error as delegate caip and provider doesnt match', async () => { + await expect(() => + userKate.channel.delegate.remove( + 'eip155:80001:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + ) + ).to.Throw; + }); + + it('With viem signer: Should remove delegate', async () => { + // create polygon mumbai provider + const provider = new ethers.providers.JsonRpcProvider( + 'https://rpc-mumbai.maticvigil.com' + ); + + signer2 = new ethers.Wallet( + `0x${process.env['WALLET_PRIVATE_KEY']}`, + provider + ); + userKate = await PushAPI.initialize(signer2); + const res = await userKate.channel.delegate.remove( + 'eip155:80001:0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' + ); + // console.log(res); + expect(res).not.null; + }, 10000000); + }); + + describe('delegate :: get', () => { + it.skip('Without signer and account : Should throw error', async () => { + await expect(() => userBob.channel.delegate.get()).to.Throw; + }); + it('Without signer : Should throw error for non-caip format', async () => { + await expect(() => + userBob.channel.delegate.get({ + channel: '0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924', + }) + ).to.Throw; + }); + + it('Without signer : Should fetch delegates', async () => { + const res = await userBob.channel.delegate.get({ + channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', + }); + console.log(res); + expect(res).not.null; + }); + + it('Without signer : Should fetch delegates for alias', async () => { + const res = await userBob.channel.delegate.get({ + channel: 'eip155:80001:0xD8634C39BBFd4033c0d3289C4515275102423681', + }); + // console.log(res) + expect(res).not.null; + }); + + it('With signer : Should fetch delegates for channel', async () => { + const res = await userKate.channel.delegate.get(); + // console.log(res); + expect(res).not.null; + }); + }); +}); diff --git a/packages/restapi/tests/lib/pushNotification/notification.test.ts b/packages/restapi/tests/lib/pushNotification/notification.test.ts new file mode 100644 index 000000000..31442a287 --- /dev/null +++ b/packages/restapi/tests/lib/pushNotification/notification.test.ts @@ -0,0 +1,249 @@ +import * as path from 'path'; +import * as dotenv from 'dotenv'; +dotenv.config({ path: path.resolve(__dirname, '../../../.env') }); + +import { PushAPI } from '../../../src/lib/pushapi/PushAPI'; // Ensure correct import path +import { expect } from 'chai'; +import { ethers } from 'ethers'; +import { createWalletClient, http } from 'viem'; +import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; +import { goerli } from 'viem/chains'; +// import tokenABI from './tokenABI'; +describe('PushAPI.notification functionality', () => { + let userAlice: PushAPI; + let userBob: PushAPI; + let userKate: PushAPI; + let signer1: any; + let account1: string; + let signer2: any; + let account2: string; + let viemSigner: any; + let userViem: PushAPI; + beforeEach(async () => { + signer1 = new ethers.Wallet( + `0x${process.env['NFT_HOLDER_WALLET_PRIVATE_KEY_1']}` + ); + account1 = await signer1.getAddress(); + + const provider = new ethers.providers.JsonRpcProvider( + 'https://goerli.blockpi.network/v1/rpc/public' + ); + + signer2 = new ethers.Wallet( + `0x${process.env['NFT_HOLDER_WALLET_PRIVATE_KEY_1']}`, + provider + ); + account2 = await signer2.getAddress(); + viemSigner = createWalletClient({ + account: privateKeyToAccount( + `0x${process.env['NFT_HOLDER_WALLET_PRIVATE_KEY_1']}` + ), + chain: goerli, + transport: http(), + }); + // initialisation with signer and provider + userKate = await PushAPI.initialize(signer2); + // initialisation with signer + userAlice = await PushAPI.initialize(signer1); + // TODO: remove signer1 after signer becomes optional + // initialisation without signer + userBob = await PushAPI.initialize(signer1); + // initialisation with viem + userViem = await PushAPI.initialize(viemSigner); + }); + + describe('PushAPI.notification functionality', () => { + it('Should return feeds with signer object', async () => { + const response = await userAlice.notification.list('SPAM'); + expect(response).not.null; + }); + + it('Should return feeds with signer object when an account is passed', async () => { + const response = await userAlice.notification.list('SPAM', { + account: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', + }); + expect(response).not.null; + expect(response.length).not.equal(0); + }); + + it('Should return feeds without signer object when an account is passed', async () => { + const response = await userBob.notification.list('SPAM', { + account: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', + }); + expect(response).not.null; + expect(response.length).not.equal(0); + }); + + it.skip('Should throw error without signer object when an account is not passed', async () => { + await expect(() => userBob.notification.list('SPAM')).to.Throw; + }); + + it('Should return feeds when signer with provider is used', async () => { + const response = await userKate.notification.list('SPAM'); + expect(response).not.null; + }); + + it('Should return feeds when viem is used', async () => { + const response = await userViem.notification.list('SPAM'); + console.log(response) + expect(response).not.null; + }); + + it('Should return feeds when signer with provider is used', async () => { + const response = await userKate.notification.list('INBOX', { + account: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', + channels: ['0xD8634C39BBFd4033c0d3289C4515275102423681'], + raw: true, + }); + // console.log(response) + expect(response).not.null; + }); + }); + + describe('notification :: subscribe', () => { + beforeEach(async () => { + await userAlice.notification.unsubscribe( + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' + ); + + await userKate.notification.unsubscribe( + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' + ); + }); + + afterEach(async () => { + await userAlice.notification.unsubscribe( + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' + ); + + await userKate.notification.unsubscribe( + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' + ); + }); + it.skip('Without signer object: should throw error', async () => { + await expect(() => + userBob.notification.subscribe( + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' + ) + ).to.Throw; + }); + + it.skip('With signer object: should throw error for invalid channel caip', async () => { + await expect(() => { + userAlice.notification.subscribe( + '0xD8634C39BBFd4033c0d3289C4515275102423681' + ); + }).to.Throw; + }); + + it('With signer object: Should subscribe', async () => { + const res = await userAlice.notification.subscribe( + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' + ); + console.log(res) + expect(res).not.null; + }); + + it('With signer and provider: Should subscribe', async () => { + const res = await userKate.notification.subscribe( + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' + ); + // console.log(res) + expect(res).not.null; + }); + + it('With viem signer and provider: Should subscribe', async () => { + const res = await userViem.notification.subscribe( + 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' + ); + // console.log(res) + expect(res).not.null; + }); + }); + + describe('notification :: subscriptions', () => { + it.skip('No signer or account: Should throw error', async () => { + await expect(() => userBob.notification.subscriptions()).to.Throw; + }); + + it('Signer with no account: Should return response', async () => { + const response = await userAlice.notification.subscriptions(); + console.log(response); + expect(response).not.null; + }); + + it('Signer with account: Should return response', async () => { + const response = await userAlice.notification.subscriptions({ + account: 'eip155:80001:0xD8634C39BBFd4033c0d3289C4515275102423681', + }); + // console.log(response); + expect(response).not.null; + expect(response.lenth).not.equal(0); + }); + }); + + // TO RUN THIS, MAKE THE PRIVATE FUNTIONS PUBLIC + // describe('debug :: test private functions', () => { + // it('Fetching data from contract', async () => { + // const contract = userKate.createContractInstance( + // '0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33', + // tokenABI + // ); + // const balance = await contract['balanceOf']( + // '0xD8634C39BBFd4033c0d3289C4515275102423681' + // ); + // console.log(balance.toString()); + // const fees = ethers.utils.parseUnits('50', 18); + // console.log(fees) + // console.log(fees.lte(balance)) + // }); + + // it("Uploading data to ipfs via push node", async () => { + // await userAlice.uploadToIPFSViaPushNode("test") + // }) + + // it('Should get proper minnimal payload', () => { + // const inputData = [ + // { + // type: 0, + // default: 1, + // description: 'test1', + // }, + // { + // type: 1, + // default: 10, + // description: 'test2', + // data: { + // upper: 100, + // lower: 1, + // }, + // }, + // ]; + + // const minimalSettings = userAlice.getMinimalSetting(inputData); + // console.log(minimalSettings); + // }); + + // it('Should get proper minnimal payload', () => { + // const inputData = [ + // { + // type: 1, + // default: 10, + // description: 'test2', + // data: { + // upper: 100, + // lower: 1, + // }, + // }, + // { + // type: 0, + // default: 1, + // description: 'test1', + // }, + // ]; + + // const minimalSettings = userAlice.getMinimalSetting(inputData); + // console.log(minimalSettings); + // }); + // }); +}); diff --git a/packages/restapi/tests/lib/pushNotification/onchain.test.ts b/packages/restapi/tests/lib/pushNotification/onchain.test.ts new file mode 100644 index 000000000..c8e91058c --- /dev/null +++ b/packages/restapi/tests/lib/pushNotification/onchain.test.ts @@ -0,0 +1,115 @@ +// import * as path from 'path'; +// import * as dotenv from 'dotenv'; +// dotenv.config({ path: path.resolve(__dirname, '../../../.env') }); +// import { expect } from 'chai'; +// import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; +// import { PushNotificationBaseClass } from '../../../src/lib/pushNotification/pushNotificationBase'; +// import * as config from "../../../src/lib/config" +// import { +// createWalletClient, +// http, +// getContract, +// createPublicClient, +// } from 'viem'; +// import { abi } from './tokenABI'; +// import { goerli, polygonMumbai } from 'viem/chains'; +// import { BigNumber, ethers } from 'ethers'; + +// enum ENV { +// PROD = 'prod', +// STAGING = 'staging', +// DEV = 'dev', +// /** +// * **This is for local development only** +// */ +// LOCAL = 'local', +// } +// describe.only('test', () => { +// const signer = createWalletClient({ +// account: privateKeyToAccount(`0x${process.env['WALLET_PRIVATE_KEY']}`), +// chain: goerli, +// transport: http( +// 'https://goerli.blockpi.network/v1/rpc/public' +// ), +// }); + +// const signer3 = createWalletClient({ +// account: privateKeyToAccount(`0x${process.env['WALLET_PRIVATE_KEY']}`), +// chain: polygonMumbai, +// transport: http(), +// }); + +// const provider = new ethers.providers.JsonRpcProvider( +// 'https://goerli.blockpi.network/v1/rpc/public' +// ); +// const signer2 = new ethers.Wallet( +// `0x${process.env['WALLET_PRIVATE_KEY']}`, +// provider +// ); +// it('testing with viem', async () => { +// const account2 = await signer2.getAddress(); +// const viemUser = new PushNotificationBaseClass(signer, ENV.STAGING, account2) +// const contract = viemUser.createContractInstance("0xd4E3ceC407cD36d9e3767cD189ccCaFBF549202C", config.ABIS.CORE, goerli) +// const res = await viemUser.fetchUpdateCounter(contract, account2); +// console.log(res) +// const viemContract = await userViem.createContractInstance( +// '0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33', +// abi, +// goerli +// ); +// const balance = await userViem.fetchBalance( +// viemContract, +// '0xD8634C39BBFd4033c0d3289C4515275102423681' +// ); +// console.log(balance); +// const allowance = await userViem.fetchAllownace( +// viemContract, +// '0xD8634C39BBFd4033c0d3289C4515275102423681', +// '0xd4E3ceC407cD36d9e3767cD189ccCaFBF549202C' +// ); +// console.log(allowance); +// const approveAmount = ethers.BigNumber.from(10000); +// const approveRes = await userViem.approveToken( +// viemContract, +// '0xd4E3ceC407cD36d9e3767cD189ccCaFBF549202C', +// approveAmount +// ); +// console.log(approveRes); + +// const addDelegate = await userViem.delegate.add( +// 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681' +// ); +// console.log(addDelegate); +// }); + +// it.only('test with ethers', async () => { +// const account2 = await signer2.getAddress(); +// const userEthers = new PushNotificationBaseClass(signer2, ENV.STAGING, account2,); +// const contract = userEthers.createContractInstance("0xd4E3ceC407cD36d9e3767cD189ccCaFBF549202C", config.ABIS.CORE, goerli) +// const res = await userEthers.fetchUpdateCounter(contract, account2); +// console.log(res) +// const ethersContract = await userEthers.createContractInstance( +// '0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33', +// abi, +// goerli +// ); +// const balance2 = await userEthers.fetchBalance( +// ethersContract, +// '0xD8634C39BBFd4033c0d3289C4515275102423681' +// ); +// console.log(balance2); +// const allowance2 = await userEthers.fetchAllownace( +// ethersContract, +// '0xD8634C39BBFd4033c0d3289C4515275102423681', +// '0xd4E3ceC407cD36d9e3767cD189ccCaFBF549202C' +// ); +// console.log(allowance2); +// const approveAmount2 = ethers.BigNumber.from(10000); +// const approveRes2 = await userEthers.approveToken( +// ethersContract, +// '0xd4E3ceC407cD36d9e3767cD189ccCaFBF549202C', +// approveAmount2 +// ); +// console.log(approveRes2); +// }); +// }); diff --git a/packages/restapi/tests/lib/pushNotification/tokenABI.ts b/packages/restapi/tests/lib/pushNotification/tokenABI.ts new file mode 100644 index 000000000..0f602271d --- /dev/null +++ b/packages/restapi/tests/lib/pushNotification/tokenABI.ts @@ -0,0 +1,709 @@ +export const abi = [ + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromDelegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toDelegate", + "type": "address" + } + ], + "name": "DelegateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "DelegateVotesChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "holder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "weight", + "type": "uint256" + } + ], + "name": "HolderWeightChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DELEGATION_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DOMAIN_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PERMIT_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "rawAmount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "born", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "rawAmount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "checkpoints", + "outputs": [ + { + "internalType": "uint32", + "name": "fromBlock", + "type": "uint32" + }, + { + "internalType": "uint96", + "name": "votes", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "delegateBySig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getCurrentVotes", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "getPriorVotes", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "holderDelegation", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "holderWeight", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "numCheckpoints", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "rawAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "resetHolderWeight", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "returnHolderDelegation", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "returnHolderRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "setHolderDelegation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "rawAmount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "rawAmount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ] as const \ No newline at end of file diff --git a/packages/restapi/tests/lib/pushstream/initialize.test.ts b/packages/restapi/tests/lib/pushstream/initialize.test.ts new file mode 100644 index 000000000..9ae1527f6 --- /dev/null +++ b/packages/restapi/tests/lib/pushstream/initialize.test.ts @@ -0,0 +1,369 @@ +import * as path from 'path'; +import * as dotenv from 'dotenv'; +dotenv.config({ path: path.resolve(__dirname, '../../.env') }); +import { expect } from 'chai'; // Assuming you're using chai for assertions +import { ethers } from 'ethers'; +import { PushAPI } from '../../../src/lib/pushapi/PushAPI'; +import { sendNotification } from '../../../src/lib/payloads/sendNotifications'; +import { subscribe, unsubscribe } from '../../../src/lib/channels'; + +import { ENV } from '../../../src/lib/constants'; +import { STREAM } from '../../../src/lib/pushstream/pushStreamTypes'; +import * as util from 'util'; +import { ConditionType } from '../../../src/lib'; + +describe('PushStream.initialize functionality', () => { + it('Should initialize new stream and listen to events', async () => { + const MESSAGE = 'Hey There!!!'; + + const provider = ethers.getDefaultProvider(); + + const WALLET = ethers.Wallet.createRandom(); + const signer = new ethers.Wallet(WALLET.privateKey, provider); + const user = await PushAPI.initialize(signer, { + env: ENV.LOCAL, + streamOptions: { raw: true }, + }); + + const WALLET2 = ethers.Wallet.createRandom(); + const signer2 = new ethers.Wallet(WALLET2.privateKey, provider); + const user2 = await PushAPI.initialize(signer2, { + env: ENV.LOCAL, + }); + + const WALLET3 = ethers.Wallet.createRandom(); + const signer3 = new ethers.Wallet(WALLET3.privateKey, provider); + const user3 = await PushAPI.initialize(signer3, { + env: ENV.LOCAL, + }); + + const WALLET4 = ethers.Wallet.createRandom(); + const signer4 = new ethers.Wallet(WALLET4.privateKey, provider); + const user4 = await PushAPI.initialize(signer4, { + env: ENV.LOCAL, + }); + + const GROUP_RULES = { + entry: { + conditions: [ + { + any: [ + { + type: 'PUSH', + category: 'CustomEndpoint', + subcategory: 'GET', + data: { + url: 'https://api.ud-staging.com/profile/badges/dead_pixel/validate/{{user_address}}?rule=join', + }, + }, + ], + }, + ], + }, + chat: { + conditions: [ + { + any: [ + { + type: 'PUSH', + category: 'CustomEndpoint', + subcategory: 'GET', + data: { + url: 'https://api.ud-staging.com/profile/badges/dead_pixel/validate/{{user_address}}?rule=chat', + }, + }, + ], + }, + ], + }, + }; + + const CREATE_GROUP_REQUEST = { + description: 'test', + image: 'test', + members: [], + admins: [], + private: false, + rules: { + chat: { + conditions: { + any: [ + { + type: ConditionType.PUSH, + category: 'ERC20', + subcategory: 'holder', + data: { + contract: + 'eip155:1:0xf418588522d5dd018b425E472991E52EBBeEEEEE', + amount: 1, + decimals: 18, + }, + }, + { + type: ConditionType.PUSH, + category: 'INVITE', + subcategory: 'DEFAULT', + data: { + inviterRoles: ['ADMIN', 'OWNER'], + }, + }, + ], + }, + }, + }, + }; + + const CREATE_GROUP_REQUEST_2 = { + description: 'test', + image: 'test', + members: [], + admins: [], + private: false, + rules: {}, + }; + + const stream = user.stream; + + const createEventPromise = ( + expectedEvent: string, + eventType: string, + expectedEventCount: number + ) => { + return new Promise((resolve, reject) => { + let eventCount = 0; + if (expectedEventCount == 0) { + resolve('Done'); + } + const receivedEvents: any[] = []; + stream.on(eventType, (data: any) => { + try { + receivedEvents.push(data); + eventCount++; + + console.log( + `Event ${eventCount} for ${expectedEvent}:`, + util.inspect(JSON.stringify(data), { + showHidden: false, + depth: null, + colors: true, + }) + ); + expect(data).to.not.be.null; + + if (eventCount === expectedEventCount) { + resolve(receivedEvents); + } + } catch (error) { + console.error('An error occurred:', error); + reject(error); + } + }); + }); + }; + + // leave admin bug + // group creator check remove add + + const onDataReceived = createEventPromise('CHAT_OPS', STREAM.CHAT_OPS, 5); + const onMessageReceived = createEventPromise('CHAT', STREAM.CHAT, 4); + const onNoitificationsReceived = createEventPromise('NOTIF', STREAM.NOTIF, 4); + + // Create and update group + const createdGroup = await user.chat.group.create( + 'test', + CREATE_GROUP_REQUEST_2 + ); + + const updatedGroup = await user.chat.group.update(createdGroup.chatId, { + description: 'Updated Description', + }); + + const updatedGroup2 = await user.chat.group.add(createdGroup.chatId, { + role: 'ADMIN', + accounts: [signer2.address, signer3.address, signer4.address], + }); + + const w2wRejectRequest = await user2.chat.group.join( + createdGroup.chatId + ); + + + + /*const w2wMessageResponse = await user2.chat.send(signer.address, { + content: MESSAGE, + }); + const w2wAcceptsRequest = await user.chat.accept(signer2.address); + + const w2wMessageResponse2 = await user2.chat.send(signer.address, { + content: MESSAGE, + });*/ + + /*const channelPrivateKey = process.env['WALLET_PRIVATE_KEY']; + + const signerChannel = new ethers.Wallet(`0x${channelPrivateKey}`); + const channelAddress = signerChannel.address; + + console.log(channelAddress); + + const response = await subscribe({ + signer: signer, + channelAddress: `eip155:5:${channelAddress}`, // channel address in CAIP + userAddress: `eip155:5:${signer.address}`, // user address in CAIP + onSuccess: () => { + console.log('opt in success'); + }, + onError: () => { + console.error('opt in error'); + }, + env: ENV.LOCAL, + }); + + + const apiResponse = await sendNotification({ + signer: signerChannel, // Needs to resolve to channel address + type: 1, // broadcast + identityType: 2, // direct payload + notification: { + title: `notification TITLE:`, + body: `notification BODY`, + }, + payload: { + title: `payload title`, + body: `sample msg body`, + cta: '', + img: '', + }, + channel: `eip155:5:${channelAddress}`, // your channel address + env: ENV.LOCAL, + }); + + + const response2 = await unsubscribe({ + signer: signer, + channelAddress: `eip155:5:${channelAddress}`, // channel address in CAIP + userAddress: `eip155:5:${signer.address}`, // user address in CAIP + onSuccess: () => { + console.log('opt out success'); + }, + onError: () => { + console.error('opt out error'); + }, + env: ENV.LOCAL, + }); + + + const apiResponse2 = await sendNotification({ + signer: signerChannel, // Needs to resolve to channel address + type: 3, // broadcast + identityType: 2, // direct payload + notification: { + title: `notification TITLE:`, + body: `notification BODY`, + }, + payload: { + title: `payload title`, + body: `sample msg body`, + cta: '', + img: '', + }, + recipients: `eip155:5:${signer.address}`, + channel: `eip155:5:${channelAddress}`, // your channel address + env: ENV.LOCAL, + }); + + + + //const w2wRejectRequest = await user2.chat.group.join(createdGroup.chatId); + //const updatedGroup2 = await user2.chat.group.leave(createdGroup.chatId); + + /*const updatedGroup3 = await user.chat.group.add(createdGroup.chatId, { + role: 'ADMIN', + accounts: [signer2.address], + }); + + + + const w2wAcceptsRequest = await user2.chat.group.join(createdGroup.chatId); + + /* const updatedGroup4 = await user.chat.group.add( + createdGroup.chatId, + { + role: 'ADMIN', + accounts: [signer3.address], + } + );*/ + + /*const w2wMessageResponse = await user2.chat.send(signer.address, { + content: MESSAGE, + }); + const w2wAcceptsRequest = await user.chat.accept(signer2.address); + + const w2wMessageResponse2 = await user2.chat.send(signer.address, { + content: MESSAGE, + }); + + //const w2wRejectRequest = await user2.chat.group.join(createdGroup.chatId); + + /* + + + const updatedGroup2 = await user2.chat.group.leave(createdGroup.chatId); + + + + const updatedGroup = await user.chat.group.update(createdGroup.chatId, { + description: 'Updated Description', + }); + + const groupMessageResponse = await user.chat.send(createdGroup.chatId, { + content: 'Hello', + type: MessageType.TEXT, + }); + + + + const w2wMessageResponse2 = await user2.chat.send(signer.address, { + content: MESSAGE, + }); + + const w2wMessageResponse2 = await user3.chat.send(signer.address, { + content: MESSAGE, + }); + const w2wRejectRequest = await user.chat.reject(signer3.address);*/ + + let timeoutTriggered = false; + + const timeout = new Promise((_, reject) => { + setTimeout(() => { + timeoutTriggered = true; + reject(new Error('Timeout after 5 seconds')); + }, 5000); + }); + + // Wrap the Promise.allSettled inside a Promise.race with the timeout + try { + const result = await Promise.race([ + Promise.allSettled([ + onDataReceived, + onMessageReceived, + onNoitificationsReceived, + ]), + timeout, + ]); + + if (timeoutTriggered) { + console.error('Timeout reached before events were emitted.'); + } else { + (result as PromiseSettledResult[]).forEach((outcome) => { + if (outcome.status === 'fulfilled') { + //console.log(outcome.value); + } else if (outcome.status === 'rejected') { + console.error(outcome.reason); + } + }); + } + } catch (error) { + console.error(error); + } + }); +}); diff --git a/packages/restapi/yarn.lock b/packages/restapi/yarn.lock index de55ed8e8..1a2318580 100644 --- a/packages/restapi/yarn.lock +++ b/packages/restapi/yarn.lock @@ -397,12 +397,12 @@ "@hapi/hoek@^9.0.0": version "9.3.0" - resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb" + resolved "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz" integrity sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ== "@hapi/topo@^5.0.0": version "5.1.0" - resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.1.0.tgz#dc448e332c6c6e37a4dc02fd84ba8d44b9afb012" + resolved "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz" integrity sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg== dependencies: "@hapi/hoek" "^9.0.0" @@ -425,10 +425,10 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@livepeer/core@^1.8.0": - version "1.8.0" - resolved "https://registry.npmjs.org/@livepeer/core/-/core-1.8.0.tgz" - integrity sha512-Sr+DplfGfhpv2Arh53tTTL9DyPEzlVAzy+eXd8+PMIlXLVOHTgGfDgpfpaeSCB8v8WlJtrgX50vFdSWyUyxi3g== +"@livepeer/core@^1.8.6": + version "1.8.6" + resolved "https://registry.npmjs.org/@livepeer/core/-/core-1.8.6.tgz" + integrity sha512-VWMHaHMzNCr8YuC9hD87Ju+fwnpldEoe3y9CqOXrQPyyIgiAWfraZBA6Ard67f09X9UBGaaRcAMgMcCUs9HtKA== dependencies: cross-fetch "^4.0.0" ms "^3.0.0-canary.1" @@ -470,6 +470,14 @@ resolved "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz" integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== +"@pushprotocol/socket@^0.5.2": + version "0.5.2" + resolved "https://registry.npmjs.org/@pushprotocol/socket/-/socket-0.5.2.tgz" + integrity sha512-lVGMT3q8T5by6qwAhQ+zIeE/yv7oUC9eIlFux8M7WaKu/ArLBrrojD5REbr9QXXwpJIP3Q8GJUKyClZl4uGsJw== + dependencies: + socket.io-client "^4.5.2" + tslib "^2.3.0" + "@scure/base@~1.1.0": version "1.1.1" resolved "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz" @@ -494,21 +502,26 @@ "@sideway/address@^4.1.3": version "4.1.4" - resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0" + resolved "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz" integrity sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw== dependencies: "@hapi/hoek" "^9.0.0" "@sideway/formula@^3.0.1": version "3.0.1" - resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.1.tgz#80fcbcbaf7ce031e0ef2dd29b1bfc7c3f583611f" + resolved "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz" integrity sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg== "@sideway/pinpoint@^2.0.0": version "2.0.0" - resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df" + resolved "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz" integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ== +"@socket.io/component-emitter@~3.1.0": + version "3.1.0" + resolved "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz" + integrity sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg== + "@stitches/core@^1.2.8": version "1.2.8" resolved "https://registry.npmjs.org/@stitches/core/-/core-1.2.8.tgz" @@ -642,23 +655,24 @@ array-buffer-byte-length@^1.0.0: is-array-buffer "^3.0.1" array.prototype.every@^1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.4.tgz" - integrity sha512-Aui35iRZk1HHLRAyF7QP0KAnOnduaQ6fo6k1NVWfRc0xTs2AZ70ytlXvOmkC6Di4JmUs2Wv3DYzGtCQFSk5uGg== + version "1.1.5" + resolved "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.5.tgz" + integrity sha512-FfMQJ+/joFGXpRCltbzV3znaP5QxIhLFySo0fEPn3GuoYlud9LhknMCIxdYKC2qsM/6VHoSp6YGwe3EZXrEcwQ== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" is-string "^1.0.7" -arraybuffer.prototype.slice@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz" - integrity sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw== +arraybuffer.prototype.slice@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz" + integrity sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw== dependencies: array-buffer-byte-length "^1.0.0" call-bind "^1.0.2" define-properties "^1.2.0" + es-abstract "^1.22.1" get-intrinsic "^1.2.1" is-array-buffer "^3.0.2" is-shared-array-buffer "^1.0.2" @@ -915,9 +929,9 @@ concat-map@0.0.1: integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== core-js@^3.31.1: - version "3.32.0" - resolved "https://registry.npmjs.org/core-js/-/core-js-3.32.0.tgz" - integrity sha512-rd4rYZNlF3WuoYuRIDEmbR/ga9CeuWX9U05umAvgrrZoHY4Z++cp/xwPQMvUpBB4Ag6J8KfD80G0zwCyaSxDww== + version "3.32.2" + resolved "https://registry.npmjs.org/core-js/-/core-js-3.32.2.tgz" + integrity sha512-pxXSw1mYZPDGvTQqEc5vgIb83jGQKFGYWY76z4a7weZXUolw3G+OvpZqSRcfYOoOVUQJYEPsWeQK8pKEnUtWxQ== core-util-is@~1.0.0: version "1.0.3" @@ -957,7 +971,7 @@ custom-error-instance@2.1.1: resolved "https://registry.npmjs.org/custom-error-instance/-/custom-error-instance-2.1.1.tgz" integrity sha512-p6JFxJc3M4OTD2li2qaHkDCw9SfMw82Ldr6OC9Je1aXiGfhx2W8p3GaoeaGrPJTUN9NirTM/KTxHWMUdR1rsUg== -debug@4.3.4, debug@^4.3.2: +debug@4.3.4, debug@^4.3.2, debug@~4.3.1, debug@~4.3.2: version "4.3.4" resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -1005,11 +1019,21 @@ deep-equal@^2.2.2: which-collection "^1.0.1" which-typed-array "^1.1.9" +define-data-property@^1.0.1: + version "1.1.0" + resolved "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz" + integrity sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g== + dependencies: + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz" - integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== + version "1.2.1" + resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== dependencies: + define-data-property "^1.0.1" has-property-descriptors "^1.0.0" object-keys "^1.1.1" @@ -1065,23 +1089,39 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" +engine.io-client@~6.5.2: + version "6.5.2" + resolved "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.5.2.tgz" + integrity sha512-CQZqbrpEYnrpGqC07a9dJDz4gePZUgTPMU3NKJPSeQOyw27Tst4Pl3FemKoFGAlHzgZmKjoRmiJvbWfhCXUlIg== + dependencies: + "@socket.io/component-emitter" "~3.1.0" + debug "~4.3.1" + engine.io-parser "~5.2.1" + ws "~8.11.0" + xmlhttprequest-ssl "~2.0.0" + +engine.io-parser@~5.2.1: + version "5.2.1" + resolved "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.1.tgz" + integrity sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ== + err-code@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz" integrity sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA== -es-abstract@^1.19.0, es-abstract@^1.20.4: - version "1.22.1" - resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz" - integrity sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw== +es-abstract@^1.22.1: + version "1.22.2" + resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.2.tgz" + integrity sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA== dependencies: array-buffer-byte-length "^1.0.0" - arraybuffer.prototype.slice "^1.0.1" + arraybuffer.prototype.slice "^1.0.2" available-typed-arrays "^1.0.5" call-bind "^1.0.2" es-set-tostringtag "^2.0.1" es-to-primitive "^1.2.1" - function.prototype.name "^1.1.5" + function.prototype.name "^1.1.6" get-intrinsic "^1.2.1" get-symbol-description "^1.0.0" globalthis "^1.0.3" @@ -1097,23 +1137,23 @@ es-abstract@^1.19.0, es-abstract@^1.20.4: is-regex "^1.1.4" is-shared-array-buffer "^1.0.2" is-string "^1.0.7" - is-typed-array "^1.1.10" + is-typed-array "^1.1.12" is-weakref "^1.0.2" object-inspect "^1.12.3" object-keys "^1.1.1" object.assign "^4.1.4" - regexp.prototype.flags "^1.5.0" - safe-array-concat "^1.0.0" + regexp.prototype.flags "^1.5.1" + safe-array-concat "^1.0.1" safe-regex-test "^1.0.0" - string.prototype.trim "^1.2.7" - string.prototype.trimend "^1.0.6" - string.prototype.trimstart "^1.0.6" + string.prototype.trim "^1.2.8" + string.prototype.trimend "^1.0.7" + string.prototype.trimstart "^1.0.7" typed-array-buffer "^1.0.0" typed-array-byte-length "^1.0.0" typed-array-byte-offset "^1.0.0" typed-array-length "^1.0.4" unbox-primitive "^1.0.2" - which-typed-array "^1.1.10" + which-typed-array "^1.1.11" es-get-iterator@^1.1.3: version "1.1.3" @@ -1232,7 +1272,7 @@ execa@^1.0.0: figures@^1.4.0: version "1.7.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + resolved "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz" integrity sha512-UxKlfCRuCBxSXU4C6t9scbDyWZ4VlaFFdojKtzJuSkuOBQ5CNFum+zZXFwHjo+CxBC1t6zlYPgHIgFjL8ggoEQ== dependencies: escape-string-regexp "^1.0.5" @@ -1267,7 +1307,7 @@ flat@^5.0.2: for-each@^0.3.3: version "0.3.3" - resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + resolved "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz" integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== dependencies: is-callable "^1.1.3" @@ -1284,22 +1324,22 @@ fsevents@~2.3.2: function-bind@^1.1.1: version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -function.prototype.name@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.5.tgz#cce0505fe1ffb80503e6f9e46cc64e46a12a9621" - integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== +function.prototype.name@^1.1.6: + version "1.1.6" + resolved "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz" + integrity sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.0" - functions-have-names "^1.2.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + functions-have-names "^1.2.3" -functions-have-names@^1.2.2, functions-have-names@^1.2.3: +functions-have-names@^1.2.3: version "1.2.3" - resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" + resolved "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== get-browser-rtc@^1.1.0: @@ -1324,7 +1364,7 @@ get-func-name@^2.0.0: get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0, get-intrinsic@^1.2.1: version "1.2.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" + resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz" integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== dependencies: function-bind "^1.1.1" @@ -1334,7 +1374,7 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@ get-package-type@^0.1.0: version "0.1.0" - resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" + resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== get-stream@^4.0.0: @@ -1346,7 +1386,7 @@ get-stream@^4.0.0: get-symbol-description@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + resolved "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz" integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== dependencies: call-bind "^1.0.2" @@ -1373,7 +1413,7 @@ glob@7.2.0: glob@^7.2.3: version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== dependencies: fs.realpath "^1.0.0" @@ -1385,38 +1425,38 @@ glob@^7.2.3: globalthis@^1.0.3: version "1.0.3" - resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" + resolved "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz" integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== dependencies: define-properties "^1.1.3" gopd@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + resolved "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz" integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== dependencies: get-intrinsic "^1.1.3" graceful-fs@^4.2.4: version "4.2.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== has-ansi@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + resolved "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" integrity sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg== dependencies: ansi-regex "^2.0.0" has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" - resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" + resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz" integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== has-dynamic-import@^2.0.1: version "2.0.1" - resolved "https://registry.yarnpkg.com/has-dynamic-import/-/has-dynamic-import-2.0.1.tgz#9bca87846aa264f2ad224fcd014946f5e5182f52" + resolved "https://registry.npmjs.org/has-dynamic-import/-/has-dynamic-import-2.0.1.tgz" integrity sha512-X3fbtsZmwb6W7fJGR9o7x65fZoodygCrZ3TVycvghP62yYQfS0t4RS0Qcz+j5tQYUKeSWS09tHkWW6WhFV3XhQ== dependencies: call-bind "^1.0.2" @@ -1434,38 +1474,38 @@ has-flag@^4.0.0: has-property-descriptors@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" + resolved "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz" integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== dependencies: get-intrinsic "^1.1.1" has-proto@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz" integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== has-tostringtag@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + resolved "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz" integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== dependencies: has-symbols "^1.0.2" has@^1.0.3: version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== dependencies: function-bind "^1.1.1" hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz" integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== dependencies: inherits "^2.0.3" @@ -1477,13 +1517,13 @@ he@1.2.0: integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== hls.js@^1.4.9: - version "1.4.10" - resolved "https://registry.yarnpkg.com/hls.js/-/hls.js-1.4.10.tgz#3feac40f21a558453b243b5b926b7317e70624e1" - integrity sha512-wAVSj4Fm2MqOHy5+BlYnlKxXvJlv5IuZHjlzHu18QmjRzSDFQiUDWdHs5+NsFMQrgKEBwuWDcyvaMC9dUzJ5Uw== + version "1.4.12" + resolved "https://registry.npmjs.org/hls.js/-/hls.js-1.4.12.tgz" + integrity sha512-1RBpx2VihibzE3WE9kGoVCtrhhDWTzydzElk/kyRbEOLnb1WIE+3ZabM/L8BqKFTCL3pUy4QzhXgD1Q6Igr1JA== hmac-drbg@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz" integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== dependencies: hash.js "^1.0.3" @@ -1515,7 +1555,7 @@ inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, internal-slot@^1.0.4, internal-slot@^1.0.5: version "1.0.5" - resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" + resolved "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz" integrity sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ== dependencies: get-intrinsic "^1.2.0" @@ -1529,7 +1569,7 @@ invert-kv@^2.0.0: is-arguments@^1.1.1: version "1.1.1" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" + resolved "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz" integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== dependencies: call-bind "^1.0.2" @@ -1537,7 +1577,7 @@ is-arguments@^1.1.1: is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: version "3.0.2" - resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" + resolved "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz" integrity sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== dependencies: call-bind "^1.0.2" @@ -1546,7 +1586,7 @@ is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: is-bigint@^1.0.1: version "1.0.4" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + resolved "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz" integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== dependencies: has-bigints "^1.0.1" @@ -1560,7 +1600,7 @@ is-binary-path@~2.1.0: is-boolean-object@^1.1.0: version "1.1.2" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + resolved "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz" integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== dependencies: call-bind "^1.0.2" @@ -1568,19 +1608,19 @@ is-boolean-object@^1.1.0: is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: version "1.2.7" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== is-core-module@^2.9.0: - version "2.12.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.1.tgz#0c0b6885b6f80011c71541ce15c8d66cf5a4f9fd" - integrity sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg== + version "2.13.0" + resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz" + integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ== dependencies: has "^1.0.3" is-date-object@^1.0.1, is-date-object@^1.0.5: version "1.0.5" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz" integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== dependencies: has-tostringtag "^1.0.0" @@ -1592,7 +1632,7 @@ is-extglob@^2.1.1: is-finite@^1.0.1: version "1.1.0" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" + resolved "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz" integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== is-fullwidth-code-point@^1.0.0: @@ -1626,17 +1666,17 @@ is-hex-prefixed@1.0.0: is-map@^2.0.1, is-map@^2.0.2: version "2.0.2" - resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127" + resolved "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz" integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg== is-negative-zero@^2.0.2: version "2.0.2" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz" integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== is-number-object@^1.0.4: version "1.0.7" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" + resolved "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz" integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== dependencies: has-tostringtag "^1.0.0" @@ -1653,7 +1693,7 @@ is-plain-obj@^2.1.0: is-regex@^1.1.4: version "1.1.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz" integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== dependencies: call-bind "^1.0.2" @@ -1661,12 +1701,12 @@ is-regex@^1.1.4: is-set@^2.0.1, is-set@^2.0.2: version "2.0.2" - resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.2.tgz#90755fa4c2562dc1c5d4024760d6119b94ca18ec" + resolved "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz" integrity sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g== is-shared-array-buffer@^1.0.2: version "1.0.2" - resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" + resolved "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz" integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== dependencies: call-bind "^1.0.2" @@ -1678,26 +1718,26 @@ is-stream@^1.1.0: is-stream@^2.0.0: version "2.0.1" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== is-string@^1.0.5, is-string@^1.0.7: version "1.0.7" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + resolved "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz" integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== dependencies: has-tostringtag "^1.0.0" is-symbol@^1.0.2, is-symbol@^1.0.3: version "1.0.4" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + resolved "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz" integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== dependencies: has-symbols "^1.0.2" -is-typed-array@^1.1.10, is-typed-array@^1.1.9: +is-typed-array@^1.1.10, is-typed-array@^1.1.12, is-typed-array@^1.1.9: version "1.1.12" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" + resolved "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz" integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== dependencies: which-typed-array "^1.1.11" @@ -1709,19 +1749,19 @@ is-unicode-supported@^0.1.0: is-weakmap@^2.0.1: version "2.0.1" - resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.1.tgz#5008b59bdc43b698201d18f62b37b2ca243e8cf2" + resolved "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz" integrity sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA== is-weakref@^1.0.2: version "1.0.2" - resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + resolved "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz" integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== dependencies: call-bind "^1.0.2" is-weakset@^2.0.1: version "2.0.2" - resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.2.tgz#4569d67a747a1ce5a994dfd4ef6dcea76e7c0a1d" + resolved "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz" integrity sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg== dependencies: call-bind "^1.0.2" @@ -1729,12 +1769,12 @@ is-weakset@^2.0.1: isarray@^2.0.5: version "2.0.5" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + resolved "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz" integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== isarray@~1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== isexe@^2.0.0: @@ -1743,9 +1783,9 @@ isexe@^2.0.0: integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== joi@^17.9.2: - version "17.9.2" - resolved "https://registry.yarnpkg.com/joi/-/joi-17.9.2.tgz#8b2e4724188369f55451aebd1d0b1d9482470690" - integrity sha512-Itk/r+V4Dx0V3c7RLFdRh12IOjySm2/WGPMubBT92cQvRfYZhPM2W0hZlctjj72iES8jsRCwp7S/cRmWBnJ4nw== + version "17.10.2" + resolved "https://registry.npmjs.org/joi/-/joi-17.10.2.tgz" + integrity sha512-hcVhjBxRNW/is3nNLdGLIjkgXetkeGc2wyhydhz8KumG23Aerk4HPjU5zaPAMRqXQFc0xNqXTC7+zQjxr0GlKA== dependencies: "@hapi/hoek" "^9.0.0" "@hapi/topo" "^5.0.0" @@ -1755,7 +1795,7 @@ joi@^17.9.2: js-base64@^3.7.2: version "3.7.5" - resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.5.tgz#21e24cf6b886f76d6f5f165bfcd69cc55b9e3fca" + resolved "https://registry.npmjs.org/js-base64/-/js-base64-3.7.5.tgz" integrity sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA== js-sha3@0.8.0: @@ -1778,11 +1818,11 @@ lcid@^2.0.0: invert-kv "^2.0.0" livepeer@^2.5.8: - version "2.8.0" - resolved "https://registry.npmjs.org/livepeer/-/livepeer-2.8.0.tgz" - integrity sha512-ZYw/bew356VZ1MZE6T7NBV6xgQ6yukqutb/GiSk9Yz+vjJvxy2npu4sEhgZ1pkHFVVczcGVwjZidWWaZ+oMwGg== + version "2.8.6" + resolved "https://registry.npmjs.org/livepeer/-/livepeer-2.8.6.tgz" + integrity sha512-8K2lRtpgZKbv6l6cGYYMJW9qpdRKkGUuy7R7xTLkS6NaRQzaeW08vubftmbMHil8v8GX/nDmodcW2vA4oIkP0w== dependencies: - "@livepeer/core" "^1.8.0" + "@livepeer/core" "^1.8.6" "@stitches/core" "^1.2.8" core-js "^3.31.1" cross-fetch "^4.0.0" @@ -1999,9 +2039,9 @@ nice-try@^1.0.4: integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== node-fetch@^2.6.12: - version "2.6.12" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz" - integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== + version "2.7.0" + resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== dependencies: whatwg-url "^5.0.0" @@ -2271,14 +2311,14 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -regexp.prototype.flags@^1.5.0: - version "1.5.0" - resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz" - integrity sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA== +regexp.prototype.flags@^1.5.0, regexp.prototype.flags@^1.5.1: + version "1.5.1" + resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz" + integrity sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg== dependencies: call-bind "^1.0.2" define-properties "^1.2.0" - functions-have-names "^1.2.3" + set-function-name "^2.0.0" repeat-string@^1.5.2: version "1.6.1" @@ -2314,13 +2354,13 @@ retry@^0.12.0: resolved "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz" integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== -safe-array-concat@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz" - integrity sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ== +safe-array-concat@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz" + integrity sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q== dependencies: call-bind "^1.0.2" - get-intrinsic "^1.2.0" + get-intrinsic "^1.2.1" has-symbols "^1.0.3" isarray "^2.0.5" @@ -2370,6 +2410,15 @@ set-blocking@^2.0.0: resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== +set-function-name@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz" + integrity sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA== + dependencies: + define-data-property "^1.0.1" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.0" + shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz" @@ -2409,6 +2458,24 @@ simple-peer@^9.11.1: randombytes "^2.1.0" readable-stream "^3.6.0" +socket.io-client@^4.5.2: + version "4.7.2" + resolved "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.7.2.tgz" + integrity sha512-vtA0uD4ibrYD793SOIAwlo8cj6haOeMHrGvwPxJsxH7CeIksqJ+3Zc06RvWTIFgiSqx4A3sOnTXpfAEE2Zyz6w== + dependencies: + "@socket.io/component-emitter" "~3.1.0" + debug "~4.3.2" + engine.io-client "~6.5.2" + socket.io-parser "~4.2.4" + +socket.io-parser@~4.2.4: + version "4.2.4" + resolved "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz" + integrity sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew== + dependencies: + "@socket.io/component-emitter" "~3.1.0" + debug "~4.3.1" + split@1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/split/-/split-1.0.0.tgz" @@ -2449,32 +2516,32 @@ string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string.prototype.trim@^1.2.7: - version "1.2.7" - resolved "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz" - integrity sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== +string.prototype.trim@^1.2.7, string.prototype.trim@^1.2.8: + version "1.2.8" + resolved "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz" + integrity sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" -string.prototype.trimend@^1.0.6: - version "1.0.6" - resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz" - integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== +string.prototype.trimend@^1.0.7: + version "1.0.7" + resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz" + integrity sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" -string.prototype.trimstart@^1.0.6: - version "1.0.6" - resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz" - integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== +string.prototype.trimstart@^1.0.7: + version "1.0.7" + resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz" + integrity sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" string_decoder@^1.1.1: version "1.3.0" @@ -2666,6 +2733,11 @@ ts-node@^10.9.1: v8-compile-cache-lib "^3.0.1" yn "3.1.1" +tslib@^2.3.0: + version "2.6.2" + resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== + tus-js-client@^3.1.0: version "3.1.1" resolved "https://registry.npmjs.org/tus-js-client/-/tus-js-client-3.1.1.tgz" @@ -2815,7 +2887,7 @@ which-module@^2.0.0: resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz" integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== -which-typed-array@^1.1.10, which-typed-array@^1.1.11, which-typed-array@^1.1.9: +which-typed-array@^1.1.11, which-typed-array@^1.1.9: version "1.1.11" resolved "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz" integrity sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew== @@ -2865,6 +2937,16 @@ ws@7.4.6: resolved "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== +ws@~8.11.0: + version "8.11.0" + resolved "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz" + integrity sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg== + +xmlhttprequest-ssl@~2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz" + integrity sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A== + xtend@~4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" diff --git a/packages/uiweb/CHANGELOG.md b/packages/uiweb/CHANGELOG.md index 4589c675c..fc461f033 100644 --- a/packages/uiweb/CHANGELOG.md +++ b/packages/uiweb/CHANGELOG.md @@ -2,11 +2,279 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver). -## [1.1.10](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-1.1.9...uiweb-1.1.10) (2023-08-10) +## [0.0.1-alpha.15](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.14...uiweb-0.0.1-alpha.15) (2023-09-25) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([eef6b18](https://github.com/ethereum-push-notification-service/push-sdk/commit/eef6b18d87a27c59930029b9933540333fb36bc6)) + + + +## [0.0.1-alpha.14](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.13...uiweb-0.0.1-alpha.14) (2023-09-25) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([7efc3ab](https://github.com/ethereum-push-notification-service/push-sdk/commit/7efc3ab1c3a409a29166c9644c94708b0ac37417)) + + + +## [0.0.1-alpha.13](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.12...uiweb-0.0.1-alpha.13) (2023-09-21) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([fed5d89](https://github.com/ethereum-push-notification-service/push-sdk/commit/fed5d8940aaa20f6f68f6ec3dad6d4dd90afdda0)) + + + +## [0.0.1-alpha.12](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.11...uiweb-0.0.1-alpha.12) (2023-09-20) + + +### Bug Fixes + +* added condition while showing tokengatedIcon ([#715](https://github.com/ethereum-push-notification-service/push-sdk/issues/715)) ([8ae0f49](https://github.com/ethereum-push-notification-service/push-sdk/commit/8ae0f49fcd385dfdcad197de2f89c58a074f681e)) +* added disconnect for wallet ([#721](https://github.com/ethereum-push-notification-service/push-sdk/issues/721)) ([4e30c36](https://github.com/ethereum-push-notification-service/push-sdk/commit/4e30c36532a55abd440f779c98b31f52bfb9e107)) +* Merge branch 'alpha' into alpha-deployment ([a3b4ead](https://github.com/ethereum-push-notification-service/push-sdk/commit/a3b4ead84601329e36afd8555011a5088dba6983)) +* Merge branch 'alpha' into alpha-deployment ([a356f4b](https://github.com/ethereum-push-notification-service/push-sdk/commit/a356f4b8497252e75c8f70fd6f6bf533a6980c0a)) +* Merge branch 'alpha' into alpha-deployment ([1a4c5ac](https://github.com/ethereum-push-notification-service/push-sdk/commit/1a4c5ac8f704cc5bfeed1ba4eb688e4742acfd9e)) + + + +## [0.0.1-alpha.11](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.10...uiweb-0.0.1-alpha.11) (2023-09-15) + + + +## [0.0.1-alpha.10](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.9...uiweb-0.0.1-alpha.10) (2023-09-09) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([f410046](https://github.com/ethereum-push-notification-service/push-sdk/commit/f410046d871bb34f3ec7a7eecd9f500d50fc0fbf)) + + + +## [0.0.1-alpha.9](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.8...uiweb-0.0.1-alpha.9) (2023-09-08) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([699706b](https://github.com/ethereum-push-notification-service/push-sdk/commit/699706bc0c2b05eebb11624f7b16411d4111a5cb)) +* merge main ([5f37942](https://github.com/ethereum-push-notification-service/push-sdk/commit/5f379427e8a517089758de776eab9f2409aa61f8)) + + + +## [1.1.13](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.2...uiweb-1.1.13) (2023-08-24) + + +### Bug Fixes + +* dummy change ([cbfbec0](https://github.com/ethereum-push-notification-service/push-sdk/commit/cbfbec0b17a460361b4b5ecef84aaa45b06ab7a2)) + + + +## [1.1.12](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-1.1.11...uiweb-1.1.12) (2023-08-23) + + +### Bug Fixes + +* Merge branch 'main' into deployment ([64278ec](https://github.com/ethereum-push-notification-service/push-sdk/commit/64278eccd6fd51d02b123ec00e1d36fa94a23608)) + + + +## [1.1.11](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-1.1.10...uiweb-1.1.11) (2023-08-18) + + +### Bug Fixes + +* merge main ([f53a5e2](https://github.com/ethereum-push-notification-service/push-sdk/commit/f53a5e279e3780566b4e2a9242b3555ef50fb4a6)) + + + +## [1.1.10](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.1...uiweb-1.1.10) (2023-08-10) + + +### Bug Fixes + +* Merge branch 'main' into deployment ([e504703](https://github.com/ethereum-push-notification-service/push-sdk/commit/e5047039c6ec668c0a2ad5950d7a5ba227c4f50a)) + + + +## [1.1.9](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.0...uiweb-1.1.9) (2023-08-10) + + +### Bug Fixes + +* Merge branch 'main' into deployment ([843cd01](https://github.com/ethereum-push-notification-service/push-sdk/commit/843cd0169a270bbab69922021edf312616de3802)) + + + +## [1.1.8](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-1.1.7...uiweb-1.1.8) (2023-08-04) + + +### Bug Fixes + +* merge main ([b9e4440](https://github.com/ethereum-push-notification-service/push-sdk/commit/b9e44408fa4c97720b12217486e8d13ef3caeb00)) + + + +## [1.1.7](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-1.1.6...uiweb-1.1.7) (2023-07-31) + + +### Bug Fixes + +* Merge branch 'main' into deployment ([9755baf](https://github.com/ethereum-push-notification-service/push-sdk/commit/9755baf3d4bcd3ab3fd365fad9d8fb7623fda58f)) + + + +## [1.1.6](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-1.1.5...uiweb-1.1.6) (2023-07-28) + + +### Bug Fixes + +* Merge branch 'main' into deployment ([e33017a](https://github.com/ethereum-push-notification-service/push-sdk/commit/e33017afb2d4e9361d5df47e0f7e726ecdffbc32)) + + + +## [1.1.5](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-1.1.4...uiweb-1.1.5) (2023-07-27) + + +### Bug Fixes + +* Merge branch 'main' into deployment ([90f51b9](https://github.com/ethereum-push-notification-service/push-sdk/commit/90f51b9009096ae8fcb1599d6fa8fe5cb74bbd5a)) +* merge main ([1bdc675](https://github.com/ethereum-push-notification-service/push-sdk/commit/1bdc6754bc67b489ca9e14597aa6c5d6197580e7)) + + + +## [1.1.4](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-1.1.3...uiweb-1.1.4) (2023-07-20) + + +### Bug Fixes + +* merge main ([24784e9](https://github.com/ethereum-push-notification-service/push-sdk/commit/24784e9ceca8f3757481f3be72efd0ca1ff3fba8)) + + + +## [1.1.3](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-1.1.2...uiweb-1.1.3) (2023-07-20) + + +### Bug Fixes + +* Merge branch 'main' into deployment ([9f77f39](https://github.com/ethereum-push-notification-service/push-sdk/commit/9f77f391b26111006891c10a3cc8eab06e26f14f)) + + + +## [1.1.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-1.1.1...uiweb-1.1.2) (2023-07-18) + + +### Bug Fixes + +* Merge branch 'main' into deployment ([8bc14a7](https://github.com/ethereum-push-notification-service/push-sdk/commit/8bc14a711f308fada706fb8fc228136e4ea24544)) + + + +## [1.1.1](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-1.1.0...uiweb-1.1.1) (2023-07-17) + + +### Bug Fixes + +* Merge branch 'main' into deployment ([2e2c904](https://github.com/ethereum-push-notification-service/push-sdk/commit/2e2c904040260726d5c5087aed6e33d0d722a0f4)) + + + +# [1.1.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-1.0.2...uiweb-1.1.0) (2023-07-14) + + +### Bug Fixes + +* Merge branch 'main' into deployment ([fc7a9dc](https://github.com/ethereum-push-notification-service/push-sdk/commit/fc7a9dc64b4bcfdaa96aed70344b0ce95a1e0a6f)) +* Merge branch 'main' into deployment ([89b72a7](https://github.com/ethereum-push-notification-service/push-sdk/commit/89b72a7898af285c35fa03c6fb73708112f5d94c)) +* Merge branch 'main' into deployment ([1d52d6b](https://github.com/ethereum-push-notification-service/push-sdk/commit/1d52d6ba5aaadd70d7ccfd3904100586ad74d0f0)) +* merge main ([b58d9d5](https://github.com/ethereum-push-notification-service/push-sdk/commit/b58d9d53bd91fa33200a854170fe7e3facff4371)) + + + +## [1.0.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-1.0.1...uiweb-1.0.2) (2023-05-13) + + +### Bug Fixes + +* merge main ([26377c3](https://github.com/ethereum-push-notification-service/push-sdk/commit/26377c322ad01737e40244f6a815308c3c003aca)) +* socket lib update ([1301f99](https://github.com/ethereum-push-notification-service/push-sdk/commit/1301f999fe37b8e801a3d3e24aa45cf012db158a)) +* update package json ([6c321c7](https://github.com/ethereum-push-notification-service/push-sdk/commit/6c321c760055fa9aaebf1ee5f693bbbad16fb9c8)) +* updated socket version ([5052b6a](https://github.com/ethereum-push-notification-service/push-sdk/commit/5052b6ab721a942dcb7560bfe875296fa2d6a992)) + + + +## [0.0.1-alpha.8](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.7...uiweb-0.0.1-alpha.8) (2023-08-29) + + +### Bug Fixes + +* fixed msg bubble width ([#691](https://github.com/ethereum-push-notification-service/push-sdk/issues/691)) ([c24a9e1](https://github.com/ethereum-push-notification-service/push-sdk/commit/c24a9e144110ad3c67decbc1364b5dd610f5f58a)) +* Merge branch 'alpha' into alpha-deployment ([a825667](https://github.com/ethereum-push-notification-service/push-sdk/commit/a825667be9380ec6e5b457f5751a8b6b6b5a6b23)) + + + +## [0.0.1-alpha.7](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.6...uiweb-0.0.1-alpha.7) (2023-08-26) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([45e6489](https://github.com/ethereum-push-notification-service/push-sdk/commit/45e6489eca403160d512f30fa6617c980e16a244)) + + + +## [0.0.1-alpha.6](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.5...uiweb-0.0.1-alpha.6) (2023-08-25) + + +### Bug Fixes + +* fixed ([#689](https://github.com/ethereum-push-notification-service/push-sdk/issues/689)) ([a7ed3c0](https://github.com/ethereum-push-notification-service/push-sdk/commit/a7ed3c0955316da00739f114afe1a3d3a958c66e)) +* Merge branch 'alpha' into alpha-deployment ([af5a4a7](https://github.com/ethereum-push-notification-service/push-sdk/commit/af5a4a75bde324ef8552fb8a3d404e8c57f59f1c)) + + + +## [0.0.1-alpha.5](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.4...uiweb-0.0.1-alpha.5) (2023-08-25) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([292a8f9](https://github.com/ethereum-push-notification-service/push-sdk/commit/292a8f94fbe1c13c49aa2b07c633e10cad1f02bc)) + + + +## [0.0.1-alpha.4](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.3...uiweb-0.0.1-alpha.4) (2023-08-25) + + +### Bug Fixes + +* Merge branch 'alpha' into alpha-deployment ([7a0d87e](https://github.com/ethereum-push-notification-service/push-sdk/commit/7a0d87eb35a77cad6898be54af5431eb5335c80d)) + + + +## [0.0.1-alpha.3](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.2...uiweb-0.0.1-alpha.3) (2023-08-25) + + + +## [0.0.1-alpha.2](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.1...uiweb-0.0.1-alpha.2) (2023-08-23) + + +### Bug Fixes + +* hide few spaces features ([#622](https://github.com/ethereum-push-notification-service/push-sdk/issues/622)) ([0e2556c](https://github.com/ethereum-push-notification-service/push-sdk/commit/0e2556c6bbe3438cd30851ffdd9764b027f42f6e)) +* merge alpha ([1783d45](https://github.com/ethereum-push-notification-service/push-sdk/commit/1783d45bb3ceab1cce3c6bb19dfbda38c3662a3e)) +* Merge branch 'alpha' into alpha-deployment ([8b50b53](https://github.com/ethereum-push-notification-service/push-sdk/commit/8b50b53eae51729ab9c5202b1750d70c444be829)) +* merge main ([f338fd4](https://github.com/ethereum-push-notification-service/push-sdk/commit/f338fd49707933c65bdcc7736cdd08d6784625ba)) +* **spaces:** broadcast changes and UX fixes ([#674](https://github.com/ethereum-push-notification-service/push-sdk/issues/674)) ([375ebe7](https://github.com/ethereum-push-notification-service/push-sdk/commit/375ebe7f7e757d84df62cd103884e75d04bcc2b0)), closes [#642](https://github.com/ethereum-push-notification-service/push-sdk/issues/642) [#657](https://github.com/ethereum-push-notification-service/push-sdk/issues/657) [#656](https://github.com/ethereum-push-notification-service/push-sdk/issues/656) + + + +## [0.0.1-alpha.1](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-0.0.1-alpha.0...uiweb-0.0.1-alpha.1) (2023-08-10) -## [1.1.9](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-1.1.8...uiweb-1.1.9) (2023-08-10) ## [0.0.1-alpha.0](https://github.com/ethereum-push-notification-service/push-sdk/compare/uiweb-1.0.1...uiweb-0.0.1-alpha.0) (2023-08-09) diff --git a/packages/uiweb/README.md b/packages/uiweb/README.md index ba3ba4a3e..d5f2e96f0 100644 --- a/packages/uiweb/README.md +++ b/packages/uiweb/README.md @@ -330,3 +330,4 @@ Allowed Options (props with * are mandatory) | activeChat | string | - | to open a particular chat when modal first opens | | onClose | () => void | - | function to execute when modal is minimised | | env | string | 'prod' | API env - 'prod', 'staging', 'dev'| + diff --git a/packages/uiweb/package.json b/packages/uiweb/package.json index 7e3eea05b..6645e2d69 100644 --- a/packages/uiweb/package.json +++ b/packages/uiweb/package.json @@ -1,23 +1,33 @@ { "name": "@pushprotocol/uiweb", - "version": "0.0.1-alpha.0", + "version": "0.0.1-alpha.15", "publishConfig": { "registry": "https://registry.npmjs.org/" }, "dependencies": { + "@livekit/components-react": "^1.2.2", + "@livekit/components-styles": "^1.0.6", "@livepeer/react": "^2.6.0", "@pushprotocol/socket": "^0.5.0", "@unstoppabledomains/resolution": "^8.5.0", + "@web3-onboard/coinbase": "^2.2.5", + "@web3-onboard/core": "^2.21.1", + "@web3-onboard/injected-wallets": "^2.10.5", + "@web3-onboard/react": "^2.8.9", + "@web3-onboard/walletconnect": "^2.4.6", "@web3-react/injected-connector": "^6.0.7", "date-fns": "^2.28.0", "emoji-picker-react": "^4.4.9", + "ethers": "^5.6.8", "font-awesome": "^4.7.0", "gif-picker-react": "^1.1.0", "html-react-parser": "^1.4.13", + "livekit-client": "^1.13.3", "moment": "^2.29.4", "react-icons": "^4.10.1", "react-toastify": "^9.1.3", - "react-twitter-embed": "^4.0.4" + "react-twitter-embed": "^4.0.4", + "uuid": "^9.0.1" }, "peerDependencies": { "@pushprotocol/restapi": "^1.2.15", diff --git a/packages/uiweb/src/lib/components/chat/ChatProfile/AddWalletContent.tsx b/packages/uiweb/src/lib/components/chat/ChatProfile/AddWalletContent.tsx index 0ba4639b9..f2a00f5e4 100644 --- a/packages/uiweb/src/lib/components/chat/ChatProfile/AddWalletContent.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatProfile/AddWalletContent.tsx @@ -8,7 +8,7 @@ import * as PushAPI from '@pushprotocol/restapi'; import { ethers } from "ethers"; import { addWalletValidation } from "../helpers/helper"; import ArrowGreyIcon from '../../../icons/CaretDownGrey.svg' -import ArrowLeftIcon from '../../../icons/ArrowLeft.svg'; +// import ArrowLeftIcon from '../../../icons/ArrowLeft.svg'; import CloseIcon from '../../../icons/close.svg'; import { Spinner } from "../../supportChat/spinner/Spinner"; import { MoreLightIcon } from '../../../icons/MoreLight'; @@ -18,7 +18,7 @@ import { Section, Span, Image } from "../../reusables/sharedStyling"; import { AddUserDarkIcon } from '../../../icons/Adddark'; import { device } from "../../../config"; import { MemberListContainer } from "./MemberListContainer"; -import useMediaQuery from "../helpers/useMediaQuery"; +import useMediaQuery from "../../../hooks/useMediaQuery"; import useToast from "../helpers/NewToast"; import { MdCheckCircle, MdError } from "react-icons/md"; import { Modal } from "../helpers/Modal"; @@ -171,7 +171,7 @@ export const AddWalletContent = ({ onSubmit, handlePrevious, onClose, memberList
- handlePrevious()} cursor='pointer' /> + {/* handlePrevious()} cursor='pointer' /> */} Add Wallets diff --git a/packages/uiweb/src/lib/components/chat/ChatProfile/ChatProfile.tsx b/packages/uiweb/src/lib/components/chat/ChatProfile/ChatProfile.tsx index 4949a44b6..b9267b17b 100644 --- a/packages/uiweb/src/lib/components/chat/ChatProfile/ChatProfile.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatProfile/ChatProfile.tsx @@ -23,7 +23,7 @@ import { ethers } from "ethers"; import { IChatProfile, IToast, OptionProps } from "../exportedTypes"; import { InfuraAPIKey, allowedNetworks, device } from "../../../config"; import Toast from "../helpers/Toast"; -import useMediaQuery from "../helpers/useMediaQuery"; +import useMediaQuery from "../../../hooks/useMediaQuery"; import { createBlockie } from "../../space/helpers/blockies"; // import { NewToast } from "../helpers/NewToast"; import { ToastContainer, toast } from 'react-toastify'; @@ -31,10 +31,10 @@ import 'react-toastify/dist/ReactToastify.min.css'; -const Options = ({ options, setOptions, isGroup, chatInfo, groupInfo, setGroupInfo,theme }: OptionProps) => { +const Options = ({ options, setOptions, isGroup, chatInfo, groupInfo, setGroupInfo, theme }: OptionProps) => { const DropdownRef = useRef(null); const [modal, setModal] = useState(false); - + useClickAway(DropdownRef, () => { setOptions(false); }); @@ -42,59 +42,65 @@ const Options = ({ options, setOptions, isGroup, chatInfo, groupInfo, setGroupIn const ShowModal = () => { setModal(true); } + console.log(groupInfo?.rules?.chat, "groupInfooo") - if (groupInfo && isGroup){ + if (groupInfo && isGroup) { return (
- + { + (groupInfo?.rules?.chat?.conditions || groupInfo?.rules?.entry?.conditions) && ( + + ) + } - {groupInfo?.isPublic && - ()} + {groupInfo?.isPublic && + ()} setOptions(true)}> - - - {options && - ( - - - - - Group Info - - - )} - - {modal && - ()} + + + {options && + ( + + + + + Group Info + + + )} + + {modal && + ()}
) - } else { - return null } - }; + } else { + return null + } +}; + - -export const ChatProfile: React.FC = ({ chatId, style }: {chatId: string, style: "Info" | "Preview"}) => { +export const ChatProfile: React.FC = ({ chatId, style }: { chatId: string, style: "Info" | "Preview" }) => { const theme = useContext(ThemeContext); const { account, env } = useChatData(); const { getGroupByID } = useGetGroupByID(); const { fetchUserChatProfile } = useChatProfile(); const [isGroup, setIsGroup] = useState(false); - const [options, setOptions] = useState(false); - const [chatInfo, setChatInfo ] = useState(); - const [groupInfo, setGroupInfo ] = useState(); - const [ensName, setEnsName ] = useState(''); + const [options, setOptions] = useState(false); + const [chatInfo, setChatInfo] = useState(); + const [groupInfo, setGroupInfo] = useState(); + const [ensName, setEnsName] = useState(''); const isMobile = useMediaQuery(device.tablet); const l1ChainId = allowedNetworks[env].includes(1) ? 1 : 5; const provider = new ethers.providers.InfuraProvider(l1ChainId, InfuraAPIKey); @@ -102,13 +108,13 @@ export const ChatProfile: React.FC = ({ chatId, style }: {chatId: const fetchProfileData = async () => { - if(isValidETHAddress(chatId)){ + if (isValidETHAddress(chatId)) { const ChatProfile = await fetchUserChatProfile({ profileId: chatId }); setChatInfo(ChatProfile); setGroupInfo(null); setIsGroup(false); } else { - const GroupProfile = await getGroupByID({ groupId : chatId}) + const GroupProfile = await getGroupByID({ groupId: chatId }) setGroupInfo(GroupProfile); setChatInfo(null); setIsGroup(true); @@ -116,45 +122,44 @@ export const ChatProfile: React.FC = ({ chatId, style }: {chatId: } const getName = async (chatId: string) => { - if(isValidETHAddress(chatId)){ - const result = await resolveNewEns(chatId, provider); - // if(result) - console.log(result); - setEnsName(result); - } + if (isValidETHAddress(chatId)) { + const result = await resolveNewEns(chatId, provider); + // if(result) + setEnsName(result); + } } - useEffect(()=> { - if(!chatId) return; + useEffect(() => { + if (!chatId) return; fetchProfileData(); getName(chatId); - },[chatId, account, env]) + }, [chatId, account, env]) if (chatId && style === 'Info') { return ( {chatInfo || groupInfo ? ( + ?.toString()} height="48px" maxHeight="48px" width='48px' borderRadius="100%" /> ) : ()} - + ?.toString()} height="48px" maxHeight="48px" width='48px' borderRadius="100%" />)} + + + + {isGroup ? groupInfo?.groupName : ensName ? `${ensName} (${isMobile ? shortenText(chatInfo?.did?.split(':')[1] ?? '', 4, true) : chatId})` : chatInfo ? shortenText(chatInfo.did?.split(':')[1] ?? '', 6, true) : shortenText(chatId, 6, true)} - - {isGroup ? groupInfo?.groupName : ensName ? `${ensName} (${isMobile ? shortenText(chatInfo?.did?.split(':')[1] ?? '', 4, true) : chatId})`: chatInfo ? shortenText(chatInfo.did?.split(':')[1] ?? '', 6, true) : shortenText(chatId,6, true)} - - + {/* {!isGroup && @@ -162,10 +167,10 @@ export const ChatProfile: React.FC = ({ chatId, style }: {chatId: } */} - + + - - + ) } else { return null; @@ -175,8 +180,9 @@ export const ChatProfile: React.FC = ({ chatId, style }: {chatId: const Container = styled.div` width: 100%; - background: ${(props) => props.theme.bgColorPrimary}; - border-radius: 32px; + background: ${(props) => props.theme.backgroundColor.chatProfileBackground}; + border:${(props) => props.theme.border?.chatProfile}; + border-radius:${(props) => props.theme.borderRadius?.chatProfile}; display: flex; flex-direction: row; align-items: center; @@ -204,7 +210,7 @@ const DropDownBar = styled.div` min-width: 140px; color: rgb(101, 119, 149); border: ${(props) => `1px solid ${props.theme.defaultBorder}`}; - background: ${(props) => props.theme.bgColorPrimary}; + background: ${(props) => props.theme.backgroundColor.chatReceivedBubbleBackground}; z-index: 10; border-radius: 16px; `; diff --git a/packages/uiweb/src/lib/components/chat/ChatProfile/GroupInfoModal.tsx b/packages/uiweb/src/lib/components/chat/ChatProfile/GroupInfoModal.tsx index c5a03ca8b..e684cef63 100644 --- a/packages/uiweb/src/lib/components/chat/ChatProfile/GroupInfoModal.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatProfile/GroupInfoModal.tsx @@ -21,7 +21,7 @@ import { AddWalletContent } from './AddWalletContent' import ArrowIcon from '../../../icons/CaretDown.svg' import { Modal } from "../helpers/Modal"; import { device } from "../../../config"; -import useMediaQuery from "../helpers/useMediaQuery"; +import useMediaQuery from "../../../hooks/useMediaQuery"; import useToast from "../helpers/NewToast"; import { MdCheckCircle, MdError } from "react-icons/md"; @@ -47,7 +47,7 @@ const PendingMembers = ({ groupInfo, setShowPendingRequests, showPendingRequests - + {shortenText(item?.wallet?.split(':')[1] ?? '', 6, true)} @@ -400,7 +400,7 @@ export const GroupInfoModal = ({ theme, modal, setModal, groupInfo, setGroupInfo
- Group Info + Group Info onClose()} cursor='pointer' />
@@ -409,7 +409,7 @@ export const GroupInfoModal = ({ theme, modal, setModal, groupInfo, setGroupInfo
- {groupInfo?.groupName} + {groupInfo?.groupName} {groupInfo?.members?.length} Members
@@ -423,7 +423,7 @@ export const GroupInfoModal = ({ theme, modal, setModal, groupInfo, setGroupInfo
- {groupInfo?.isPublic ? 'Public' : 'Private'} + {groupInfo?.isPublic ? 'Public' : 'Private'} {groupInfo?.isPublic ? 'Chats are not encrypted' : 'Chats are encrypted'}
@@ -435,7 +435,7 @@ export const GroupInfoModal = ({ theme, modal, setModal, groupInfo, setGroupInfo - {theme ? : } +
)} diff --git a/packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx b/packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx index 9ad6ce257..f527c883b 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx @@ -1,320 +1,399 @@ -import { useContext, useEffect, useState } from "react"; -import { Section, Span, Image } from "../../reusables"; -import moment from "moment"; -import styled from "styled-components"; -import { FileMessageContent } from "../../../types"; -import { FILE_ICON } from "../../../config"; -import { formatFileSize, getPfp, pCAIP10ToWallet, setPfp, shortenText } from "../../../helpers"; -import { checkTwitterUrl } from "../helpers/twitter"; -import { IMessagePayload, TwitterFeedReturnType } from "../exportedTypes"; -import { TwitterTweetEmbed } from "react-twitter-embed"; -import { ChatDataContext } from "../../../context"; -import { useChatData } from "../../../hooks"; -import { ThemeContext } from "../theme/ThemeProvider"; +import { useContext, useEffect, useState } from 'react'; +import { Section, Span, Image } from '../../reusables'; +import moment from 'moment'; +import styled from 'styled-components'; +import { FileMessageContent } from '../../../types'; +import { FILE_ICON } from '../../../config'; +import { + formatFileSize, + getPfp, + pCAIP10ToWallet, + shortenText, +} from '../../../helpers'; +import { checkTwitterUrl } from '../helpers/twitter'; +import { IMessagePayload, TwitterFeedReturnType } from '../exportedTypes'; +import { TwitterTweetEmbed } from 'react-twitter-embed'; +import { ChatDataContext } from '../../../context'; +import { useChatData } from '../../../hooks'; +import { ThemeContext } from '../theme/ThemeProvider'; const SenderMessageAddress = ({ chat }: { chat: IMessagePayload }) => { - const { account } = useContext(ChatDataContext) - const theme = useContext(ThemeContext) - return ( - <> - {chat.fromCAIP10.split(":")[1] !== account && ( - {chat.fromDID.split(":")[1].slice(0, 6)}... - {chat.fromDID.split(":")[1].slice(-6)} - )} - - ) -} + const { account } = useContext(ChatDataContext); + const theme = useContext(ThemeContext); + return ( + <> + {chat.fromCAIP10.split(':')[1] !== account && ( + + {chat.fromDID.split(':')[1].slice(0, 6)}... + {chat.fromDID.split(':')[1].slice(-6)} + + )} + + ); +}; -const SenderMessafeProfilePicture = ({ chat }: { chat: IMessagePayload }) => { - const { account, env } = useContext(ChatDataContext) - const [pfp, setPfp] = useState("") - const getUserPfp = async () => { - const pfp = await getPfp({ account: chat.fromCAIP10.split(":")[1], env: env }) - if (pfp) { - setPfp(pfp) - } +const SenderMessageProfilePicture = ({ chat }: { chat: IMessagePayload }) => { + const { account, env } = useContext(ChatDataContext); + const [pfp, setPfp] = useState(''); + const getUserPfp = async () => { + const pfp = await getPfp({ + account: chat.fromCAIP10.split(':')[1], + env: env, + }); + if (pfp) { + setPfp(pfp); } - useEffect(() => { - getUserPfp() - }, [account, chat.fromCAIP10]) - return ( -
- {chat.fromCAIP10.split(":")[1] !== account && ( -
- {pfp && profile picture} -
- )} + }; + useEffect(() => { + getUserPfp(); + }, [account, chat.fromCAIP10]); + return ( +
+ {chat.fromCAIP10.split(':')[1] !== account && ( +
+ {pfp && ( + profile picture + )}
- ) -} + )} +
+ ); +}; + +//can create a wrapper for till the senderMessageAddress and use it for all cards(types of messages) const MessageCard = ({ - chat, - position, - isGroup, + chat, + position, + isGroup, }: { - chat: IMessagePayload; - position: number; - isGroup: boolean; + chat: IMessagePayload; + position: number; + isGroup: boolean; }) => { - const theme = useContext(ThemeContext) - const time = moment(chat.timestamp).format('hh:mm a'); - return ( -
- {isGroup && - - } -
- {isGroup && - + const theme = useContext(ThemeContext); + const time = moment(chat.timestamp).format('hh:mm a'); + return ( +
+ {isGroup && } +
+ {isGroup && } +
+ {' '} +
+ {chat.messageContent.split('\n').map((str) => ( + - {' '} -
- {chat.messageContent.split('\n').map((str) => ( - - {str} - - ))} -
- - {time} - -
-
+ > + {str} + + ))} +
+ + {time} +
- ); +
+
+ ); }; const FileCard = ({ - chat, - isGroup, + chat, + isGroup, }: { - chat: IMessagePayload; - position: number; - isGroup: boolean; + chat: IMessagePayload; + position: number; + isGroup: boolean; }) => { - const fileContent: FileMessageContent = JSON.parse(chat.messageContent); - const name = fileContent.name; + const fileContent: FileMessageContent = JSON.parse(chat.messageContent); + const name = fileContent.name; - const content = fileContent.content as string; - const size = fileContent.size; + const content = fileContent.content as string; + const size = fileContent.size; - return ( -
- {isGroup && - - } -
- {isGroup && - - } -
- extension icon -
- - {shortenText(name, 11)} - - - {formatFileSize(size)} - -
- - -
-
+ return ( +
+ {isGroup && } +
+ {isGroup && } +
+ extension icon +
+ + {shortenText(name, 11)} + + + {formatFileSize(size)} + +
+ +
- ); +
+
+ ); }; const ImageCard = ({ - chat, - position, - isGroup, + chat, + position, + isGroup, }: { - chat: IMessagePayload; - position: number; - isGroup: boolean; + chat: IMessagePayload; + position: number; + isGroup: boolean; }) => { - - return ( -
- {isGroup && - + return ( +
+ {isGroup && } +
+ {isGroup && } +
+ - {isGroup && ( - - )} -
- -
-
+ />
- ); +
+
+ ); }; const GIFCard = ({ - chat, - position, - isGroup, + chat, + position, + isGroup, }: { - chat: IMessagePayload; - position: number; - isGroup: boolean; + chat: IMessagePayload; + position: number; + isGroup: boolean; }) => { - return ( -
- {isGroup && - + return ( +
+ {isGroup && } +
+ {isGroup && } +
+ - {isGroup && - - } -
- -
-
+ />
- ); +
+
+ ); }; -const TwitterCard = ({ chat, tweetId, isGroup, position }: { chat: IMessagePayload, tweetId: string, isGroup: boolean, position: number }) => { - return ( -
- {isGroup && - - } -
- {isGroup && - - } -
- -
-
+const TwitterCard = ({ + chat, + tweetId, + isGroup, + position, +}: { + chat: IMessagePayload; + tweetId: string; + isGroup: boolean; + position: number; +}) => { + return ( +
+ {isGroup && } +
+ {isGroup && } +
+
- ) -} +
+
+ ); +}; export const ChatViewBubble = ({ chat }: { chat: IMessagePayload }) => { - const { account, setAccount, pgpPrivateKey, setPgpPrivateKey, env, setEnv } = useChatData(); - const position = pCAIP10ToWallet(chat.fromDID).toLowerCase() !== account?.toLowerCase() ? 0 : 1; - const { tweetId, messageType }: TwitterFeedReturnType = checkTwitterUrl({ message: chat?.messageContent }); - const [isGroup, setIsGroup] = useState(false); - useEffect(() => { - if (chat.toDID.split(':')[0] === 'eip155') { - if (isGroup) { - setIsGroup(false); - } - } else { - if (!isGroup) { - setIsGroup(true); - } - } - }, [chat.toDID, isGroup]) + const { account} = + useChatData(); + const position = + pCAIP10ToWallet(chat.fromDID).toLowerCase() !== account?.toLowerCase() + ? 0 + : 1; + const { tweetId, messageType }: TwitterFeedReturnType = checkTwitterUrl({ + message: chat?.messageContent, + }); + const [isGroup, setIsGroup] = useState(false); + useEffect(() => { + if (chat.toDID.split(':')[0] === 'eip155') { + if (isGroup) { + setIsGroup(false); + } + } else { + if (!isGroup) { + setIsGroup(true); + } + } + }, [chat.toDID, isGroup]); - // useEffect(() => { - // setAccount(""); - // setPgpPrivateKey(""); - // setEnv(env); - // }, [account, env, pgpPrivateKey]) - if (messageType === 'TwitterFeedLink') { - chat.messageType = 'TwitterFeedLink'; - } - if (chat.messageType === 'GIF') { - return - } - if (chat.messageType === 'Image') { - return ; - } - if (chat.messageType === 'File') { - return ; - } - if (chat.messageType === 'TwitterFeedLink') { - return ; - } - return ; -} + if (messageType === 'TwitterFeedLink') { + chat.messageType = 'TwitterFeedLink'; + } + if (chat.messageType === 'GIF') { + return ; + } + if (chat.messageType === 'Image') { + return ; + } + if (chat.messageType === 'File') { + return ; + } + if (chat.messageType === 'TwitterFeedLink') { + return ( + + ); + } + return ; +}; const FileDownloadIcon = styled.i` color: #575757; @@ -322,4 +401,4 @@ const FileDownloadIcon = styled.i` const FileDownloadIconAnchor = styled.a` font-size: 20px; -`; \ No newline at end of file +`; diff --git a/packages/uiweb/src/lib/components/chat/ChatViewComponent/ChatViewComponent.tsx b/packages/uiweb/src/lib/components/chat/ChatViewComponent/ChatViewComponent.tsx index 846112317..9cd16d4da 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewComponent/ChatViewComponent.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewComponent/ChatViewComponent.tsx @@ -1,22 +1,31 @@ -import React, { useContext} from 'react'; -import { IChatViewComponentProps } from '../exportedTypes'; +import React, { useContext } from 'react'; +import { IChatTheme, IChatViewComponentProps } from '../exportedTypes'; -import { Section, } from '../../reusables'; +import { Section, Span } from '../../reusables'; import { ChatViewList } from '../ChatViewList'; -import { chatLimit } from '../../../config'; +import { chatLimit, device } from '../../../config'; import { ThemeContext } from '../theme/ThemeProvider'; import { useChatData } from '../../../hooks/chat/useChatData'; import { MessageInput } from '../MessageInput'; import { ChatProfile } from '../ChatProfile'; +import styled from 'styled-components'; +import useMediaQuery from '../../../hooks/useMediaQuery'; - +/** + * @interface IThemeProps + * this interface is used for defining the props for styled components + */ +interface IThemeProps { + theme?: IChatTheme; +} export const ChatViewComponent: React.FC = ( options: IChatViewComponentProps ) => { const { chatId, + chatFilterList = [], messageInput = true, chatViewList = true, chatProfile = true, @@ -25,62 +34,77 @@ export const ChatViewComponent: React.FC = ( file = true, gif = true, isConnected = true, + autoConnect = false, + onGetTokenClick, } = options || {}; - const {env } = useChatData(); + const { env, signer, account, pgpPrivateKey } = useChatData(); - console.log(env); - // const [conversationHash, setConversationHash] = useState(); const theme = useContext(ThemeContext); - - - - - - - - + const isMobile = useMediaQuery(device.mobileL); return ( -
- - {chatProfile && } + {chatProfile && }
- - - {chatId && chatViewList && } - + {chatId && chatViewList && ( + + )}
- {/* )} */} - - {messageInput && ( + {(!signer && !(!!account && !!pgpPrivateKey) && !isConnected) && ( +
+ + You need to either pass signer or isConnected to send + messages{' '} + +
+ )} + {(messageInput && (!!signer || (!!account && !!pgpPrivateKey) || isConnected )) && (
- +
)} -
+ + ); }; //styles - +const Conatiner = styled(Section)` + border: ${(props) => props.theme.border?.chatViewComponent}; + backdrop-filter: ${(props) => props.theme.backdropFilter}; + box-sizing: border-box; +`; diff --git a/packages/uiweb/src/lib/components/chat/ChatViewList/ApproveRequestBubble.tsx b/packages/uiweb/src/lib/components/chat/ChatViewList/ApproveRequestBubble.tsx index afdc1724a..6df0a560b 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewList/ApproveRequestBubble.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewList/ApproveRequestBubble.tsx @@ -1,10 +1,9 @@ import { IFeeds } from '@pushprotocol/restapi'; import { ThemeContext } from '../theme/ThemeProvider'; import { Dispatch, useContext } from 'react'; -import { Div, Section, Span, Spinner } from '../../reusables'; +import { Section, Span, Spinner } from '../../reusables'; import useApproveChatRequest from '../../../hooks/chat/useApproveChatRequest'; import { useChatData } from '../../../hooks'; -import { TickSvg } from '../../../icons/Tick'; import styled from 'styled-components'; import { IChatTheme } from '../theme'; @@ -21,17 +20,19 @@ export interface IApproveRequestBubbleProps { setChatFeed: Dispatch; } + export const ApproveRequestBubble = ({ chatFeed, chatId, setChatFeed, }: IApproveRequestBubbleProps) => { - const { account, pgpPrivateKey, env } = useChatData(); + const { pgpPrivateKey } = useChatData(); const ApproveRequestText = { GROUP: `You were invited to the group ${chatFeed?.groupInformation?.groupName}. Please accept to continue messaging in this group.`, W2W: ` Please accept to enable push chat from this wallet`, }; + const theme = useContext(ThemeContext); const { approveChatRequest, loading: approveLoading } = useApproveChatRequest(); @@ -41,6 +42,7 @@ export const ApproveRequestBubble = ({ if (!pgpPrivateKey) { return; } + const response = await approveChatRequest({ chatId, }); @@ -56,9 +58,9 @@ export const ApproveRequestBubble = ({ }; return (
{chatFeed?.groupInformation @@ -87,13 +89,7 @@ export const ApproveRequestBubble = ({ > {approveLoading ? : 'Accept'} - {/*
(!approveLoading ? handleApproveChatRequest() : null)} - > - {approveLoading ? : } -
*/} +
); }; @@ -103,9 +99,9 @@ const Button = styled.button` border: none; cursor: pointer; border-radius: 8px; - background: ${(props) => props.theme.accentBgColor}; + background: ${(props) => props.theme.backgroundColor.buttonBackground}; border: none; - color: white; + color: ${(props) => props.theme.textColor.buttonText}; width: 100%; font-size: 16px; font-weight: 600; diff --git a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx index 220aef905..a7011cd74 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx @@ -1,12 +1,17 @@ import React, { useContext, useEffect, useRef, useState } from 'react'; -import { ChatDataContext } from '../../../context'; + +import { + IFeeds, + IMessageIPFS, + IMessageIPFSWithCID, +} from '@pushprotocol/restapi'; +import moment from 'moment'; +import styled from 'styled-components'; + import { IChatViewListProps } from '../exportedTypes'; import { chatLimit } from '../../../config'; -import { IFeeds, IMessageIPFS } from '@pushprotocol/restapi'; import useFetchHistoryMessages from '../../../hooks/chat/useFetchHistoryMessages'; -import styled from 'styled-components'; -import { Div, Section, Span, Spinner } from '../../reusables'; -import moment from 'moment'; +import { Section, Span, Spinner } from '../../reusables'; import { ChatViewBubble } from '../ChatViewBubble'; import { appendUniqueMessages, @@ -16,14 +21,14 @@ import { getDefaultFeedObject, getNewChatUser, pCAIP10ToWallet, + walletToPCAIP10, } from '../../../helpers'; import { useChatData, usePushChatSocket } from '../../../hooks'; import { Messagetype } from '../../../types'; import { ThemeContext } from '../theme/ThemeProvider'; import { IChatTheme } from '../theme'; -import useFetchConversationHash from '../../../hooks/chat/useFetchConversationHash'; -import { EncryptionMessage } from './MessageEncryption'; +import { ENCRYPTION_KEYS, EncryptionMessage } from './MessageEncryption'; import useGetGroup from '../../../hooks/chat/useGetGroup'; import useGetChatProfile from '../../../hooks/useGetChatProfile'; import useFetchChat from '../../../hooks/chat/useFetchChat'; @@ -35,6 +40,7 @@ import { ApproveRequestBubble } from './ApproveRequestBubble'; */ interface IThemeProps { theme?: IChatTheme; + blur: boolean; } const ChatStatus = { FIRST_CHAT: `This is your first conversation with recipient.\n Start the conversation by sending a message.`, @@ -44,23 +50,24 @@ const ChatStatus = { export const ChatViewList: React.FC = ( options: IChatViewListProps ) => { - const { chatId, limit = chatLimit } = options || {}; - const { pgpPrivateKey, account } = useChatData(); + const { chatId, limit = chatLimit, chatFilterList = [] } = options || {}; + const { pgpPrivateKey, account, connectedProfile, setConnectedProfile } = + useChatData(); const [chatFeed, setChatFeed] = useState({} as IFeeds); const [chatStatusText, setChatStatusText] = useState(''); const [messages, setMessages] = useState(); - const [ loading,setLoading] = useState(true); + const [loading, setLoading] = useState(true); const [conversationHash, setConversationHash] = useState(); - const { historyMessages, loading:messageLoading } = useFetchHistoryMessages(); + const { historyMessages, loading: messageLoading } = + useFetchHistoryMessages(); const listInnerRef = useRef(null); - const bottomRef = useRef(null); + const [isMember, setIsMember] = useState(false); const { fetchChat } = useFetchChat(); const { fetchChatProfile } = useGetChatProfile(); const { getGroup } = useGetGroup(); const { messagesSinceLastConnection, groupInformationSinceLastConnection } = usePushChatSocket(); - const { fetchConversationHash } = useFetchConversationHash(); const theme = useContext(ThemeContext); const dates = new Set(); const { env } = useChatData(); @@ -69,15 +76,30 @@ export const ChatViewList: React.FC = ( setChatStatusText(''); }, [chatId, account, env]); + //need to do something about fetching connectedUser in every component + useEffect(() => { + (async () => { + if (!connectedProfile && account) { + const user = await fetchChatProfile({ profileId: account!, env }); + if (user) setConnectedProfile(user); + } + })(); + }, [account]); + useEffect(() => { setMessages(undefined); setConversationHash(undefined); }, [chatId, account, pgpPrivateKey, env]); + //need to make a common method for fetching chatFeed to ruse in messageInput useEffect(() => { (async () => { + if (!account && !env) return; const chat = await fetchChat({ chatId }); - if (Object.keys(chat || {}).length) setChatFeed(chat as IFeeds); + if (Object.keys(chat || {}).length) { + setConversationHash(chat?.threadhash as string); + setChatFeed(chat as IFeeds); + } else { let newChatFeed; let group; @@ -98,24 +120,25 @@ export const ChatViewList: React.FC = ( if (!newChatFeed?.groupInformation) { setChatStatusText(ChatStatus.FIRST_CHAT); } - console.log(chatFeed) + setConversationHash(newChatFeed.threadhash as string); setChatFeed(newChatFeed); } else { setChatStatusText(ChatStatus.INVALID_CHAT); } - } setLoading(false); })(); }, [chatId, pgpPrivateKey, account, env]); - + //moniters socket changes useEffect(() => { if (checkIfSameChat(messagesSinceLastConnection, account!, chatId)) { + const updatedChatFeed = chatFeed; + updatedChatFeed.msg = messagesSinceLastConnection; if (!Object.keys(messages || {}).length) { - setMessages({ - messages: [messagesSinceLastConnection], - lastThreadHash: messagesSinceLastConnection.cid, - }); + setFilteredMessages([ + messagesSinceLastConnection, + ] as IMessageIPFSWithCID[]); + setConversationHash(messagesSinceLastConnection.cid); } else { const newChatViewList = appendUniqueMessages( @@ -123,21 +146,42 @@ export const ChatViewList: React.FC = ( [messagesSinceLastConnection], false ); - setMessages({ - messages: newChatViewList, - lastThreadHash: messages!.lastThreadHash, - }); + setFilteredMessages(newChatViewList as IMessageIPFSWithCID[]); } - scrollToBottom(null); + setChatStatusText(''); + setChatFeed(updatedChatFeed); + scrollToBottom(); } }, [messagesSinceLastConnection]); useEffect(() => { - (async function () { - const hash = await fetchConversationHash({ conversationId: chatId }); - setConversationHash(hash?.threadHash); - })(); - }, [chatId, account, env, pgpPrivateKey]); + if (Object.keys(groupInformationSinceLastConnection || {}).length) { + if ( + chatFeed?.groupInformation?.chatId.toLowerCase() === + groupInformationSinceLastConnection.chatId.toLowerCase() + ) { + const updateChatFeed = chatFeed; + updateChatFeed.groupInformation = groupInformationSinceLastConnection; + setChatFeed(updateChatFeed); + } + } + }, [groupInformationSinceLastConnection]); + // useEffect(() => { + // if ( + // Object.keys(messagesSinceLastConnection || {}).length && + // Object.keys(chatFeed || {}).length && + // checkIfSameChat(messagesSinceLastConnection, account!, chatId) + // ) { + + // } + // }, [messagesSinceLastConnection]); + // useEffect(() => { + // (async function () { + // if (!account && !env && !chatId) return; + // const hash = await fetchConversationHash({ conversationId: chatId }); + // setConversationHash(hash?.threadHash); + // })(); + // }, [chatId, account, env, pgpPrivateKey]); useEffect(() => { if (conversationHash) { @@ -145,10 +189,10 @@ export const ChatViewList: React.FC = ( await getMessagesCall(); })(); } - }, [conversationHash, pgpPrivateKey, account, env]); + }, [conversationHash, pgpPrivateKey, account, env,chatFeed]); useEffect(() => { - scrollToBottom(null); + scrollToBottom(); }, [conversationHash]); useEffect(() => { @@ -158,42 +202,35 @@ export const ChatViewList: React.FC = ( messages?.messages.length && messages?.messages.length <= limit ) { - scrollToBottom(null); + setChatStatusText(''); + scrollToBottom(); } }, [messages]); - useEffect(() => { - if ( - Object.keys(messagesSinceLastConnection || {}).length && - Object.keys(chatFeed || {}).length && - checkIfSameChat(messagesSinceLastConnection, account!, chatId) - ) { - const updatedChatFeed = chatFeed; - updatedChatFeed.msg = messagesSinceLastConnection; + useEffect(()=>{ - setChatStatusText(''); - setChatFeed(updatedChatFeed); + if(chatFeed && !chatFeed?.groupInformation?.isPublic && account) + { + chatFeed?.groupInformation?.members.forEach((acc) => { + if ( + acc.wallet.toLowerCase() === walletToPCAIP10(account!).toLowerCase() + ) { + setIsMember(true); + } + }); } - }, [messagesSinceLastConnection]); + },[account,chatFeed]) - const scrollToBottom = (behavior?: string | null) => { - bottomRef?.current?.scrollIntoView( - !behavior ? true : { behavior: 'smooth' } - ); - }; + //methods + const scrollToBottom = () => { + setTimeout(()=>{ + if (listInnerRef.current) { + listInnerRef.current.scrollTop = listInnerRef.current.scrollHeight +100; - useEffect(() => { - if (Object.keys(groupInformationSinceLastConnection || {}).length) { - if ( - chatFeed?.groupInformation?.chatId.toLowerCase() === - groupInformationSinceLastConnection.chatId.toLowerCase() - ) { - const updateChatFeed = chatFeed; - updateChatFeed.groupInformation = groupInformationSinceLastConnection; - setChatFeed(updateChatFeed); } - } - }, [groupInformationSinceLastConnection]); + },0) + + }; const onScroll = async () => { if (listInnerRef.current) { @@ -218,7 +255,13 @@ export const ChatViewList: React.FC = ( } else { threadHash = messages?.lastThreadHash; } - if (threadHash && account) { + + if ( + threadHash && + ((account && pgpPrivateKey&& chatFeed && !chatFeed?.groupInformation) || + (chatFeed && chatFeed?.groupInformation)) + ) { + const chatHistory = await historyMessages({ limit: limit, threadHash, @@ -230,34 +273,50 @@ export const ChatViewList: React.FC = ( chatHistory, true ); - setMessages({ - messages: newChatViewList, - lastThreadHash: chatHistory[0].link, - }); + + setFilteredMessages(newChatViewList as IMessageIPFSWithCID[]); } else { - setMessages({ - messages: chatHistory, - lastThreadHash: chatHistory[0].link, - }); + setFilteredMessages(chatHistory as IMessageIPFSWithCID[]); } } } }; + const setFilteredMessages = (messageList: Array) => { + const updatedMessageList = messageList.filter( + (msg) => !chatFilterList.includes(msg.cid) + ); + + if (updatedMessageList && updatedMessageList.length) { + setMessages({ + messages: updatedMessageList, + lastThreadHash: updatedMessageList[0].link, + }); + } + }; + + const ifBlurChat = () =>{ + return !!( + chatFeed && + chatFeed?.groupInformation && + !chatFeed?.groupInformation?.isPublic && + ((!isMember && pgpPrivateKey) || (!pgpPrivateKey)) + ); + } + type RenderDataType = { chat: IMessageIPFS; dateNum: string; }; - const renderDate = ({ chat, dateNum }: RenderDataType) => { const timestampDate = dateToFromNowDaily(chat.timestamp as number); dates.add(dateNum); return ( {timestampDate} @@ -273,67 +332,93 @@ export const ChatViewList: React.FC = ( justifyContent="start" padding="0 2px" theme={theme} - onScroll={() => onScroll()} + blur={ + ifBlurChat() + } + onScroll={(e) => { + e.stopPropagation(); + onScroll(); + }} > - {loading ? : ''} - {!loading && - <> - {chatFeed && - (chatFeed.publicKey || - (chatFeed?.groupInformation && - !chatFeed?.groupInformation?.isPublic)) ? ( - - ) : ( - - )} + {loading ? : ''} + {!loading && ( + <> + {chatFeed && + (chatFeed.publicKey || + (chatFeed?.groupInformation && + !chatFeed?.groupInformation?.isPublic)) ? ( + + ) : ( + + )} - {chatStatusText && ( -
- - {chatStatusText} - -
- )} - {messageLoading ? : ''} - - { - !messageLoading && - <> -
- {messages?.messages && - messages?.messages?.map((chat: IMessageIPFS, index: number) => { - const dateNum = moment(chat.timestamp).format('L'); - const position = - pCAIP10ToWallet(chat.fromDID).toLowerCase() !== - account?.toLowerCase() - ? 0 - : 1; - return ( - <> - {dates.has(dateNum) ? null : renderDate({ chat, dateNum })} -
- -
- - ); - })} -
-
- {chatFeed && checkIfIntent({ chat: chatFeed as IFeeds, account: account! }) && ( - + {chatStatusText && ( +
+ + {chatStatusText} + +
+ )} + {messageLoading ? : ''} + + {!messageLoading && ( + <> +
+ {messages?.messages && + messages?.messages?.map( + (chat: IMessageIPFS, index: number) => { + const dateNum = moment(chat.timestamp).format('L'); + const position = + pCAIP10ToWallet(chat.fromDID).toLowerCase() !== + account?.toLowerCase() + ? 0 + : 1; + return ( + <> + {dates.has(dateNum) + ? null + : renderDate({ chat, dateNum })} +
+ +
+ + ); + } + )} +
+ {chatFeed && + account && + checkIfIntent({ + chat: chatFeed as IFeeds, + account: account!, + }) && ( + + )} + + )} + )} - - } - - } ); }; @@ -341,11 +426,19 @@ export const ChatViewList: React.FC = ( //styles const ChatViewListCard = styled(Section)` &::-webkit-scrollbar-thumb { - background: ${(props) => props.theme.accentBgColor}; + background: ${(props) => props.theme.scrollbarColor}; border-radius: 10px; } &::-webkit-scrollbar { width: 5px; } + ${({ blur }) => + blur && + ` + filter: blur(12px); + `} + overscroll-behavior: contain; + scroll-behavior: smooth; `; + diff --git a/packages/uiweb/src/lib/components/chat/ChatViewList/MessageEncryption.tsx b/packages/uiweb/src/lib/components/chat/ChatViewList/MessageEncryption.tsx index d2519e6ed..74e307637 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewList/MessageEncryption.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewList/MessageEncryption.tsx @@ -6,6 +6,14 @@ import { ThemeContext } from "../theme/ThemeProvider"; import { NoEncryptionIcon } from "../../../icons/NoEncryption"; import { EncryptionIcon } from "../../../icons/Encryption"; +export const ENCRYPTION_KEYS = { + ENCRYPTED: 'ENCRYPTED', + NO_ENCRYPTED: 'NO_ENCRYPTED', + NO_ENCRYPTED_GROUP: 'NO_ENCRYPTED_GROUP' +} as const; + +export type EncryptionKeys = (typeof ENCRYPTION_KEYS)[keyof typeof ENCRYPTION_KEYS]; + const EncryptionMessageContent = { ENCRYPTED: { IconComponent: , @@ -14,10 +22,15 @@ const EncryptionMessageContent = { NO_ENCRYPTED: { IconComponent: , text: `Messages are not encrypted`, + }, + NO_ENCRYPTED_GROUP: { + IconComponent: , + text: `Messages in this group are not encrypted`, + }, + }; - export const EncryptionMessage = ({ id }: { id: 'ENCRYPTED' | 'NO_ENCRYPTED' }) => { - console.log(id) + export const EncryptionMessage = ({ id }: { id: EncryptionKeys}) => { const theme = useContext(ThemeContext); const isMobile = useDeviceWidthCheck(771); return ( @@ -25,7 +38,7 @@ const EncryptionMessageContent = { padding="10px" alignSelf="center" borderRadius="12px" - background={theme.bgColorPrimary} + background={theme.backgroundColor?.encryptionMessageBackground} margin="10px 10px 0px" width={isMobile ? '80%' : 'fit-content'} > @@ -35,7 +48,7 @@ const EncryptionMessageContent = { diff --git a/packages/uiweb/src/lib/components/chat/ConnectButton/ConnectButton.tsx b/packages/uiweb/src/lib/components/chat/ConnectButton/ConnectButton.tsx index d9d81c4cd..f739f6e0a 100644 --- a/packages/uiweb/src/lib/components/chat/ConnectButton/ConnectButton.tsx +++ b/packages/uiweb/src/lib/components/chat/ConnectButton/ConnectButton.tsx @@ -1,176 +1,129 @@ -import React, { useContext, useEffect } from "react"; -import styled from "styled-components"; -import { InjectedConnector } from "@web3-react/injected-connector"; -import { useWeb3React } from "@web3-react/core"; -import { useChatData } from "../../../hooks"; -import * as PUSHAPI from "@pushprotocol/restapi" -import { Spinner } from "../../reusables"; -import { ThemeContext } from "../theme/ThemeProvider"; - -interface NwMappingType { - [key: number]: string; +import styled from 'styled-components'; +import { IChatTheme } from '../theme'; +import { useChatData } from '../../../hooks'; +import * as PushAPI from '@pushprotocol/restapi'; +import { useContext, useEffect, useState } from 'react'; +import { init, useConnectWallet } from "@web3-onboard/react"; +import injectedModule from "@web3-onboard/injected-wallets"; +import { Signer, ethers } from 'ethers'; + +import { ThemeContext } from '../theme/ThemeProvider'; +import { device } from '../../../config'; +import { getAddressFromSigner } from '../../../helpers'; + +/** + * @interface IThemeProps + * this interface is used for defining the props for styled components + */ +interface IThemeProps { + theme?: IChatTheme; } - -const NETWORK_MAPPING: NwMappingType = { - 1: 'ETH_MAIN_NET', - 5: 'ETH_GOERLI', - 3: 'ETH_ROPSTEN', - 137: 'POLYGON_MAINNET', - 80001: 'POLYGON_MUMBAI', - 56: 'BSC_MAINNET', - 97: 'BSC_TESTNET', - 420: 'OPTIMISM_TESTNET', - 10: 'OPTIMISM_MAINNET', - 1442: 'POLYGON_ZK_EVM_TESTNET', - 1101: 'POLYGON_ZK_EVM_MAINNET', - 421613: "ARBITRUM_TESTNET", - 42161: "ARBITRUMONE_MAINNET" -}; - -const injected = new InjectedConnector({ - supportedChainIds: [1, 3, 4, 5, 42, 137, 80001, 56, 97, 10, 420, 1442, 1101, 421613, 42161], -}); - -const ConnectWrapper = styled.div` - display: flex; - align-items: center; - flex-direction: column; - margin: 20; - - & .account { - font-size: 1.2rem; - border: 1px solid green; - border-radius: 3px; - padding: 4px 7px; - font-weight: 500; - font-family: monospace; - } - - & .network { - margin: 5px 0; +interface IConnectButtonProps { + autoConnect?: boolean; +} +export const ConnectButtonSub: React.FC = ({autoConnect = false}) => { + const [{ wallet, connecting }, connect, disconnect] = useConnectWallet(); + + const { + signer, + pgpPrivateKey, + account, + env, + setPgpPrivateKey, + setAccount, + setSigner, + } = useChatData(); + const theme = useContext(ThemeContext); + + const newFunc = () => { + if (wallet) { + (async () => { + + const ethersProvider = new ethers.providers.Web3Provider(wallet.provider, 'any') + const signer = ethersProvider.getSigner() + const newAdd = await getAddressFromSigner(signer) + setSigner(signer) + setAccount(newAdd); + })() + } else if (!wallet) { + setAccount('') + setSigner(undefined) + setPgpPrivateKey(null) } - `; - -const StyledButton = styled.button` - border: 0px; - outline: 0px; - padding: 24px 9px; - font-weight: 500; - margin: 10px; - border-radius: 12px; - font-size: 17px; - cursor: pointer; - width: 165px; - height: 44px; - text-align: start; - align-items: center; - display: flex; - justify-content: center; - `; - -const Connect = styled(StyledButton)` - color: rgb(255, 255, 255); - background: #D53A94; - `; - -const Disconnect = styled(StyledButton)` -display: flex; -padding: 9px 24px; -justify-content: center; -align-items: center; -gap: 10px; -background: var(--general-use-creamy-pink, #D53A94); -color: var(--general-use-white, #ffffff); - `; - -export const ConnectButton = () => { - const { active, activate, library } = useWeb3React(); - const { pgpPrivateKey, account, env, setPgpPrivateKey } = useChatData(); - const theme = useContext(ThemeContext); - - useEffect(() => { - if (active && account && env && library) { - const librarySigner = library.getSigner(); - - const connectBtn = async () => { - const user = await PUSHAPI.user.get({ account: account, env: env }); - if (!user) { - await createProfile(); - } - if (user?.encryptedPrivateKey && !pgpPrivateKey) { - const decryptPgpKey = await PUSHAPI.chat.decryptPGPKey({ - encryptedPGPPrivateKey: user.encryptedPrivateKey, - account: account, - signer: librarySigner, - env: env, - }); - setPgpPrivateKey(decryptPgpKey); - } - }; - - connectBtn(); - } - }, [active, account, env, library]); - - const createProfile = async () => { - if (!account || !env || !library) return; - - const librarySigner = library.getSigner(); - - const user = await PUSHAPI.user.create({ - signer: librarySigner, - env: env, + } + + useEffect(() => { + if(wallet && !autoConnect) + disconnect(wallet); + newFunc() + }, [wallet]) + + + useEffect(() => { + (async () => { + if (account && signer) { + if (!pgpPrivateKey) await handleUserCreation(); + } + })(); + }, [account, signer]); + + const handleUserCreation = async () => { + if (!account && !env) return; + try { + let user = await PushAPI.user.get({ account: account!, env: env }); + if (!user) { + if (!signer) return; + user = await PushAPI.user.create({ + signer: signer, + env: env, }); - - const createdUser = await PUSHAPI.user.get({ - account: account, - env: env, - }); - - const pvtKey = await PUSHAPI.chat.decryptPGPKey({ - encryptedPGPPrivateKey: createdUser.encryptedPrivateKey ? createdUser.encryptedPrivateKey : "", - signer: librarySigner, - env: env, - toUpgrade: true, + } + if (user?.encryptedPrivateKey && !pgpPrivateKey) { + const decryptPgpKey = await PushAPI.chat.decryptPGPKey({ + encryptedPGPPrivateKey: user.encryptedPrivateKey, + account: account!, + signer: signer, + env: env, }); - - setPgpPrivateKey(pvtKey); - }; - - async function connect() { - try { - await activate(injected); - } catch (ex) { - console.log(ex); - } + setPgpPrivateKey(decryptPgpKey); + } + } catch (e: any) { + console.log(e); } + }; + return !signer ? ( + + + + ) : ( + <> + ); +}; - const connectWalletOnPageLoad = async () => { - if (!pgpPrivateKey && !account) { - try { - await activate(injected); - } catch (ex) { - console.log(ex); - } - } - }; - - useEffect(() => { - connectWalletOnPageLoad(); - }, [activate]); - - return ( - - {active ? ( - <> - - - - - ) : ( - Connect Wallet - )} - - ); -}; \ No newline at end of file +//styles +const ConnectButtonDiv = styled.div` + width: fit-content; + + button{ + background: ${(props) => `${props.theme.backgroundColor.buttonBackground}!important`}; + // color: ${(props) => `${props.theme.backgroundColor.buttonText}!important`}; + color: #fff; + text-align:center; + font-size: 1em; + border-radius: 10px; + padding: 10px 20px; + outline: none; + border: none; + cursor: pointer; + font-weight: 600; + + } + button:hover{ + scale: 1.05; + transition: 0.3s; + } + @media ${device.mobileL} { + font-size: 12px; + } +`; diff --git a/packages/uiweb/src/lib/components/chat/ConnectButton/index.ts b/packages/uiweb/src/lib/components/chat/ConnectButton/index.ts deleted file mode 100644 index d5457ba77..000000000 --- a/packages/uiweb/src/lib/components/chat/ConnectButton/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { ConnectButton } from './ConnectButton'; diff --git a/packages/uiweb/src/lib/components/chat/ConnectButton/index.tsx b/packages/uiweb/src/lib/components/chat/ConnectButton/index.tsx new file mode 100644 index 000000000..6994cbb3c --- /dev/null +++ b/packages/uiweb/src/lib/components/chat/ConnectButton/index.tsx @@ -0,0 +1,109 @@ +import { IChatTheme } from '../theme'; + +import coinbaseWalletModule from '@web3-onboard/coinbase' +import { ConnectButtonSub } from './ConnectButton'; +import { InfuraAPIKey } from '../../../config'; +import { Web3OnboardProvider } from '@web3-onboard/react'; +import injectedModule, { ProviderLabel } from '@web3-onboard/injected-wallets'; +import walletConnectModule from '@web3-onboard/walletconnect' +import init from '@web3-onboard/core'; +import { ethers } from 'ethers'; + + +/** + * @interface IThemeProps + * this interface is used for defining the props for styled components + */ +interface IThemeProps { + theme?: IChatTheme; +} + +const wcv2InitOptions = { + projectId: '64a44a0fb537407bfe97d24330e4109c', + requiredChains: [1, 56] +} + +const walletConnect = walletConnectModule(wcv2InitOptions) +const coinbaseWalletSdk = coinbaseWalletModule({ darkMode: true }) +const chains = [ + { + id: '0x1', + token: 'ETH', + label: 'Ethereum Mainnet', + rpcUrl: `https://mainnet.infura.io/v3/${InfuraAPIKey}` + }, + { + id: '0x5', + token: 'ETH', + label: 'Goerli', + rpcUrl: `https://goerli.infura.io/v3/${InfuraAPIKey}` + }, + { + id: '0x13881', + token: 'MATIC', + label: 'Polygon - Mumbai', + rpcUrl: 'https://matic-mumbai.chainstacklabs.com' + }, + { + id: '0x38', + token: 'BNB', + label: 'Binance', + rpcUrl: 'https://bsc-dataseed.binance.org/' + }, + { + id: '0xA', + token: 'OETH', + label: 'Optimism', + rpcUrl: 'https://mainnet.optimism.io' + }, + { + id: '0xA4B1', + token: 'ARB-ETH', + label: 'Arbitrum', + rpcUrl: 'https://rpc.ankr.com/arbitrum' + } +] + + +const wallets = [injectedModule(), walletConnect, coinbaseWalletSdk] + + + +const appMetadata = { + name: 'Push Protocol', + icon: 'https://push.org/static/media/PushLogoTextBlack.fa01629c2ebd2149bab979861756591d.svg', + description: 'Example showcasing how to connect a wallet.', + + recommendedInjectedWallets: [ + { name: 'MetaMask', url: 'https://metamask.io' }, + ] +} + +const web3OnBoard = init({ + wallets, + chains, + appMetadata, + accountCenter: { + desktop: { + enabled: false + }, + mobile: { + enabled: false + } + }, + connect: { + autoConnectLastWallet: true, + } +}) + +interface IConnectButtonCompProps { + autoConnect?: boolean; +} + +export const ConnectButtonComp: React.FC = ({ autoConnect }) => { + return ( + + + + ); +}; \ No newline at end of file diff --git a/packages/uiweb/src/lib/components/chat/MessageInput/MessageInput.tsx b/packages/uiweb/src/lib/components/chat/MessageInput/MessageInput.tsx index a1305be48..2fb41b5e2 100644 --- a/packages/uiweb/src/lib/components/chat/MessageInput/MessageInput.tsx +++ b/packages/uiweb/src/lib/components/chat/MessageInput/MessageInput.tsx @@ -1,288 +1,681 @@ -import { useChatData, useClickAway, useDeviceWidthCheck } from "../../../hooks"; -import type { FileMessageContent } from "../../../types"; -import type { ChatMainStateContextType } from "../../../context/chatAndNotification/chat/chatMainStateContext"; -import { ChangeEvent, useContext, useEffect, useRef, useState } from "react"; -import { GIFType, IChatTheme, MessageInputProps } from "../exportedTypes"; -import styled from "styled-components"; -import { PUBLIC_GOOGLE_TOKEN, device } from "../../../config"; -import { Section, Div, Span } from "../../reusables"; -import { EmojiIcon } from "../../../icons/Emoji"; -import EmojiPicker, { EmojiClickData } from "emoji-picker-react"; -import * as PUSHAPI from "@pushprotocol/restapi"; -import { GifIcon } from "../../../icons/Gif"; -import GifPicker from "gif-picker-react"; -import { AttachmentIcon } from "../../../icons/Attachment"; -import usePushSendMessage from "../../../hooks/chat/usePushSendMessage"; -import { SendCompIcon } from "../../../icons/SendCompIcon"; -import { Spinner } from "../../reusables"; -import { ThemeContext } from "../theme/ThemeProvider"; -import { ConnectButton } from "../ConnectButton"; - +import { + useChatData, + useClickAway, + useDeviceWidthCheck, + usePushChatSocket, +} from '../../../hooks'; +import type { FileMessageContent } from '../../../types'; +import { ChangeEvent, useContext, useEffect, useRef, useState } from 'react'; +import { GIFType, IChatTheme, MessageInputProps } from '../exportedTypes'; +import styled from 'styled-components'; +import { PUBLIC_GOOGLE_TOKEN, device } from '../../../config'; +import { Section, Div, Span } from '../../reusables'; +import { EmojiIcon } from '../../../icons/Emoji'; +import EmojiPicker, { EmojiClickData } from 'emoji-picker-react'; +import { GifIcon } from '../../../icons/Gif'; +import GifPicker from 'gif-picker-react'; +import { AttachmentIcon } from '../../../icons/Attachment'; +import usePushSendMessage from '../../../hooks/chat/usePushSendMessage'; +import { SendCompIcon } from '../../../icons/SendCompIcon'; +import { Spinner } from '../../reusables'; +import { ThemeContext } from '../theme/ThemeProvider'; +import OpenLink from '../../../icons/OpenLink'; +import useVerifyAccessControl from '../../../hooks/chat/useVerifyAccessControl'; +import TokenGatedIcon from '../../../icons/Token-Gated.svg'; +import { Modal } from '../helpers/Modal'; +import { Image } from '../../reusables'; +import { ConnectButtonComp } from '../ConnectButton'; +import useGetGroupByID from '../../../hooks/chat/useGetGroupByID'; +import { + checkIfIntent, + getDefaultFeedObject, + getNewChatUser, + setAccessControl, + walletToPCAIP10, +} from '../../../helpers'; +import useFetchChat from '../../../hooks/chat/useFetchChat'; +import useGetChatProfile from '../../../hooks/useGetChatProfile'; +import { IFeeds } from '@pushprotocol/restapi'; +import useGetGroup from '../../../hooks/chat/useGetGroup'; +import useApproveChatRequest from '../../../hooks/chat/useApproveChatRequest'; +import useToast from '../helpers/NewToast'; +import { MdCheckCircle, MdError } from 'react-icons/md'; /** * @interface IThemeProps * this interface is used for defining the props for styled components */ interface IThemeProps { - theme?: IChatTheme; + theme?: IChatTheme; } -export const MessageInput: React.FC = ({ chatId, Emoji = true, GIF = true, File = true, isConnected = true }) => { - const [typedMessage, setTypedMessage] = useState(""); - const [showEmojis, setShowEmojis] = useState(false); - const [gifOpen, setGifOpen] = useState(false); - const [newChat, setNewChat] = useState(false); - const modalRef = useRef(null); - const fileUploadInputRef = useRef(null); - const [fileUploading, setFileUploading] = useState(false); - const onChangeTypedMessage = (val: string) => { - setTypedMessage(val.trim()); - }; - const theme = useContext(ThemeContext); - const isMobile = useDeviceWidthCheck(425); - const { sendMessage, loading } = usePushSendMessage(); - const { pgpPrivateKey, setPgpPrivateKey } = useChatData(); - - useClickAway(modalRef, () => { - setShowEmojis(false); - setGifOpen(false); - }); - const textAreaRef = useRef(null); - useEffect(() => { - if (textAreaRef?.current?.style) { - textAreaRef.current.style.height = 25 + 'px'; - const scrollHeight = textAreaRef.current?.scrollHeight; - textAreaRef.current.style.height = scrollHeight + 'px'; - } - }, [textAreaRef, typedMessage]) +export const MessageInput: React.FC = ({ + chatId, + emoji = true, + gif = true, + file = true, + isConnected = true, + autoConnect = false, + onGetTokenClick, +}) => { + const [typedMessage, setTypedMessage] = useState(''); + const [showEmojis, setShowEmojis] = useState(false); + const [gifOpen, setGifOpen] = useState(false); + const modalRef = useRef(null); + const fileUploadInputRef = useRef(null); + const [fileUploading, setFileUploading] = useState(false); + const [isRules, setIsRules] = useState(false); + const [isMember, setIsMember] = useState(false); + const { approveChatRequest, loading: approveLoading } = + useApproveChatRequest(); + const onChangeTypedMessage = (val: string) => { + setTypedMessage(val); + }; + const { acceptedRequestMessage, groupInformationSinceLastConnection } = + usePushChatSocket(); + const [chatFeed, setChatFeed] = useState({} as IFeeds); + const theme = useContext(ThemeContext); + const isMobile = useDeviceWidthCheck(425); + const { sendMessage, loading } = usePushSendMessage(); + const { + verificationSuccessfull, + verifyAccessControl, + setVerificationSuccessfull, + verified, + setVerified, + loading: accessLoading, + } = useVerifyAccessControl(); + const { + account, + env, + connectedProfile, + setConnectedProfile, + pgpPrivateKey, + signer, + } = useChatData(); + const { fetchChat } = useFetchChat(); + const { fetchChatProfile } = useGetChatProfile(); + const { getGroup } = useGetGroup(); + const statusToast = useToast(); + const textAreaRef = useRef(null); + + useClickAway(modalRef, () => { + setShowEmojis(false); + setGifOpen(false); + }); - const addEmoji = (emojiData: EmojiClickData, event: MouseEvent): void => { - setTypedMessage(typedMessage + emojiData.emoji); - setShowEmojis(false); + useEffect(() => { + if (textAreaRef?.current?.style) { + textAreaRef.current.style.height = 25 + 'px'; + const scrollHeight = textAreaRef.current?.scrollHeight; + textAreaRef.current.style.height = scrollHeight + 'px'; } + }, [textAreaRef, typedMessage]); - const handleUploadFile = () => { - if (fileUploadInputRef.current) { - fileUploadInputRef.current.click(); - } + //need to do something about fetching connectedUser in every component + useEffect(() => { + (async () => { + if (!connectedProfile && account) { + const user = await fetchChatProfile({ profileId: account!, env }); + if (user) setConnectedProfile(user); + } + })(); + }, [account]); + + useEffect(() => { + const storedTimestampJSON = localStorage.getItem(chatId); + + if (storedTimestampJSON) { + const storedTimestamp = JSON.parse(storedTimestampJSON); + const currentTimestamp = new Date().getTime(); + const twentyFourHoursInMilliseconds = 24 * 60 * 60 * 1000; + + if ( + Math.abs(currentTimestamp - storedTimestamp) < + twentyFourHoursInMilliseconds + ) { + setVerified(true); + } else { + setVerified(false); + setAccessControl(chatId, true); + } } + }, [chatId, verified, isMember, account, env]); - const uploadFile = async ( - e: ChangeEvent - ): Promise => { - if (!(e.target instanceof HTMLInputElement)) { - return; - } - if (!e.target.files) { - return; - } - if ( - e.target && - (e.target as HTMLInputElement).files && - ((e.target as HTMLInputElement).files as FileList).length - ) { - const file: File = e.target.files[0]; - if (file) { - try { - const TWO_MB = 1024 * 1024 * 2; - if (file.size > TWO_MB) { - console.log('Files larger than 2mb is now allowed'); - throw new Error('Files larger than 2mb is now allowed'); - } - setFileUploading(true); - const messageType = file.type.startsWith('image') ? 'Image' : 'File'; - const reader = new FileReader(); - let fileMessageContent: FileMessageContent; - reader.readAsDataURL(file); - reader.onloadend = async (e): Promise => { - fileMessageContent = { - content: e.target!.result as string, - name: file.name, - type: file.type, - size: file.size, - }; - - sendPushMessage(JSON.stringify(fileMessageContent), messageType); - }; - } catch (err) { - console.log(err); - } finally { - setFileUploading(false); - } + useEffect(() => { + if (Object.keys(groupInformationSinceLastConnection || {}).length) { + if ( + chatFeed?.groupInformation?.chatId.toLowerCase() === + groupInformationSinceLastConnection.chatId.toLowerCase() + ) { + const updateChatFeed = chatFeed; + updateChatFeed.groupInformation = groupInformationSinceLastConnection; + setChatFeed(updateChatFeed); + } + } + }, [groupInformationSinceLastConnection]); + + useEffect(() => { + (async () => { + if ( + Object.keys(acceptedRequestMessage || {}).length && + Object.keys(chatFeed || {}).length + ) { + await updateChatFeed(); + } + })(); + }, [acceptedRequestMessage]); + + //need to makea common method for fetching chatFeed to ruse in messageInput + useEffect(() => { + (async () => { + if (!account && !env) return; + if (account && env) { + const chat = await fetchChat({ chatId }); + if (Object.keys(chat || {}).length) setChatFeed(chat as IFeeds); + else { + let newChatFeed; + let group; + const result = await getNewChatUser({ + searchText: chatId, + fetchChatProfile, + env, + }); + if (result) { + newChatFeed = getDefaultFeedObject({ user: result }); + } else { + group = await getGroup({ searchText: chatId }); + if (group) { + newChatFeed = getDefaultFeedObject({ groupInformation: group }); } + } + if (newChatFeed) { + setChatFeed(newChatFeed); + } } - }; + } + })(); + }, [chatId, pgpPrivateKey, account, env]); + + useEffect(() => { + if (!account && !env && !chatId) return; + if (account && env && chatId && chatFeed && chatFeed?.groupInformation) + checkIfrules(); + }, [chatId, chatFeed, account, env]); + + const addEmoji = (emojiData: EmojiClickData, event: MouseEvent): void => { + setTypedMessage(typedMessage + emojiData.emoji); + setShowEmojis(false); + }; - const sendPushMessage = async (content: string, type: string) => { + const handleUploadFile = () => { + if (fileUploadInputRef.current) { + fileUploadInputRef.current.click(); + } + }; + + const checkVerification = () => { + verifyAccessControl({ chatId, did: account! }); + }; + + const handleJoinGroup = async () => { + if (chatFeed && chatFeed?.groupInformation?.isPublic) { + const response = await approveChatRequest({ + chatId, + }); + if (response) await updateChatFeed(); + } else { + const sendTextMessage = await sendMessage({ + message: `Hello, please let me join this group, my wallet address is ${account}`, + chatId: chatFeed?.groupInformation?.groupCreator || '', + messageType: 'Text', + }); + if (sendTextMessage) { + statusToast.showMessageToast({ + toastTitle: 'Success', + toastMessage: 'Request sent successfully', + toastType: 'SUCCESS', + getToastIcon: (size) => , + }); + } else { + statusToast.showMessageToast({ + toastTitle: 'Error', + toastMessage: 'Unable to send request', + toastType: 'ERROR', + getToastIcon: (size) => , + }); + } + } + }; + + const uploadFile = async ( + e: ChangeEvent + ): Promise => { + if (!(e.target instanceof HTMLInputElement)) { + return; + } + if (!e.target.files) { + return; + } + if ( + e.target && + (e.target as HTMLInputElement).files && + ((e.target as HTMLInputElement).files as FileList).length + ) { + const file: File = e.target.files[0]; + if (file) { try { - await sendMessage({ - message: content, - chatId, - messageType: type as any, - }); - } catch (error) { - console.log(error); + const TWO_MB = 1024 * 1024 * 2; + if (file.size > TWO_MB) { + console.log('Files larger than 2mb is now allowed'); + throw new Error('Files larger than 2mb is now allowed'); + } + setFileUploading(true); + const messageType = file.type.startsWith('image') ? 'Image' : 'File'; + const reader = new FileReader(); + let fileMessageContent: FileMessageContent; + reader.readAsDataURL(file); + reader.onloadend = async (e): Promise => { + fileMessageContent = { + content: e.target!.result as string, + name: file.name, + type: file.type, + size: file.size, + }; + + sendPushMessage(JSON.stringify(fileMessageContent), messageType); + }; + } catch (err) { + console.log(err); + } finally { + setFileUploading(false); } + } } + }; - const sendTextMsg = async () => { - if (typedMessage.trim() !== '') { - await sendPushMessage(typedMessage as string, 'Text'); - setTypedMessage(''); - } + const sendPushMessage = async (content: string, type: string) => { + try { + const sendMessageResponse = await sendMessage({ + message: content, + chatId, + messageType: type as any, + }); + if ( + sendMessageResponse && + typeof sendMessageResponse === 'string' && + sendMessageResponse.includes('403') + ) { + setAccessControl(chatId, true); + setVerified(false); + setVerificationSuccessfull(false); + } + } catch (error) { + console.log(error); + } + }; + + const sendTextMsg = async () => { + if (typedMessage.trim() !== '') { + await sendPushMessage(typedMessage as string, 'Text'); + setTypedMessage(''); } + }; + + const sendGIF = async (emojiObject: GIFType) => { + sendPushMessage(emojiObject.url as string, 'GIF'); + setGifOpen(false); + }; - // useEffect(() => { - // setPgpPrivateKey - // }, [pgpPrivateKey]) + const updateChatFeed = async () => { + const chat = await fetchChat({ chatId }); + if (Object.keys(chat || {}).length) { + setChatFeed(chat as IFeeds); + } + }; + + //shift to helpers + const checkIfrules = async () => { + const members = chatFeed?.groupInformation?.members || []; + const pendingMembers = chatFeed?.groupInformation?.pendingMembers || []; + const allMembers = [...members, ...pendingMembers]; + allMembers.forEach((acc) => { + if ( + acc.wallet.toLowerCase() === walletToPCAIP10(account!).toLowerCase() + ) { + setIsMember(true); + } + }); - const sendGIF = async (emojiObject: GIFType) => { - sendPushMessage(emojiObject.url as string, 'GIF'); - setGifOpen(false); + if ( + chatFeed?.groupInformation?.rules && + (chatFeed?.groupInformation?.rules?.entry || + chatFeed?.groupInformation?.rules?.chat) + ) { + setIsRules(true); } + }; - return ( - - {/* {isConnected && ( - - )} */} - + {!pgpPrivateKey && (isConnected || !!signer) && ( + +
+ {!signer && ( + + You need to connect your wallet to get started + + )} + +
+
+ )} + + ) : !checkIfIntent({ chat: chatFeed, account: account! }) && + Object.keys(chatFeed || {}).length ? ( + + + {Object.keys(chatFeed || {}).length && chatFeed?.groupInformation ? ( + <> + {pgpPrivateKey && !isMember && ( +
+ + Click on the button to join the group + + + handleJoinGroup()}> + {approveLoading ? ( + + ) : ( + ' Join Group ' + )} + + +
+ )} + {pgpPrivateKey && !verified && isMember && isRules && ( +
- {!pgpPrivateKey && isConnected && ( - // align this button in right corner - -
- - You need to connect your wallet to get started - - + alignItems="center" + > + + Sending messages requires{' '} + + 1 PUSH Token + {' '} + for participation.{' '} + + Learn More + + + + checkVerification()}> + {accessLoading ? ( + + ) : ( + 'Verify Access' + )} + + +
+ )} + {pgpPrivateKey && !verificationSuccessfull && ( + +
+ + Verification Failed + + + Please ensure the following conditions are met to + participate and send messages. + +
+ token-gated +
+ {' '} + {/* Added marginLeft */} + + Token Gated + + + You need to have{' '} + + 1 PUSH Token + {' '} + in your wallet to be able to send messages. +
- ) - } - {pgpPrivateKey && +
+
+ { + if (onGetTokenClick) { + onGetTokenClick(); + } + setVerificationSuccessfull(true); + }} + > + + Get Free Tokens + + + + { + setVerificationSuccessfull(true); + }} + > + Close + +
+
+
+ )} + + ) : null} + {pgpPrivateKey && + (((isRules ? verified : true) && isMember) || + (chatFeed && !chatFeed?.groupInformation)) && ( + <> +
+ {emoji && ( +
setShowEmojis(!showEmojis)} + > + +
+ )} + {showEmojis && ( +
+ +
+ )} + { + if (event.key === 'Enter' && !event.shiftKey) { + event.preventDefault(); + sendTextMsg(); + } + }} + placeholder="Type your message..." + onChange={(e) => onChangeTypedMessage(e.target.value)} + value={typedMessage} + ref={textAreaRef} + rows={1} + /> +
+ + {gif && ( +
setGifOpen(!gifOpen)} + > + +
+ )} + {gifOpen && ( +
+ +
+ )} +
+ {!fileUploading && file && ( <> -
- {Emoji && -
setShowEmojis(!showEmojis)} - > - -
- } - {showEmojis && ( -
-
- )} - { - if (event.key === 'Enter' && !event.shiftKey) { - event.preventDefault(); - sendTextMsg(); - } - }} - placeholder="Type your message..." - onChange={(e) => onChangeTypedMessage(e.target.value)} - value={typedMessage} - ref={textAreaRef} - rows={1} - /> -
- - {GIF && -
setGifOpen(!gifOpen)}> - -
- } - {gifOpen && ( -
- -
- )} -
- {!fileUploading && File && ( - <> -
setNewChat(true)} - > - -
- uploadFile(e)} - /> - - )} -
- {!(loading || fileUploading) && ( -
sendTextMsg()} - > - -
- )} - - {(loading || fileUploading) && ( -
- -
- )} -
+
+ +
+ uploadFile(e)} + /> - } - - - ) -} + )} +
+ {!(loading || fileUploading) && ( +
sendTextMsg()} + > + +
+ )} -const Container = styled.div` + {(loading || fileUploading) && ( +
+ +
+ )} +
+ + )} + + + ) : ( + <> + ); +}; + +const Container = styled.div` width: 100%; overflow: hidden; + border: ${(props) => props.theme.border?.messageInput}; + border-radius: ${(props) => props.theme.borderRadius?.messageInput}; `; const TypebarSection = styled(Section)` gap: 10px; @@ -304,9 +697,9 @@ const MultiLineInput = styled.textarea` outline: none; overflow-y: auto; box-sizing: border-box; - background:${(props) => props.theme.bgColorPrimary}; + background: ${(props) => props.theme.backgroundColor?.messageInputBackground}; border: none; - color: ${(props) => props.theme.textColorSecondary}; + color: ${(props) => props.theme.textColor?.messageInputText}; resize: none; flex: 1; padding-right: 5px; @@ -324,8 +717,8 @@ const MultiLineInput = styled.textarea` height: 50px; } ::placeholder { - color: ${(props) => props.theme.textColorSecondary}; - transform: translateY(1px); + color: ${(props) => props.theme.textColor?.messageInputText}; + transform: translateY(0px); @media ${device.mobileL} { font-size: 14px; } @@ -337,4 +730,94 @@ const MultiLineInput = styled.textarea` `; const FileInput = styled.input` display: none; -`; \ No newline at end of file +`; + +const ConnectWrapper = styled.div` + display: flex; + align-items: center; + flex-direction: column; + cursor: pointer; +`; + +const StyledButton = styled.button` + border: 0px; + outline: 0px; + padding: 24px 9px; + font-weight: 500; + border-radius: 12px; + font-size: 17px; + cursor: pointer; + width: 147px; + height: 44px; + text-align: start; + align-items: center; + display: flex; + justify-content: center; +`; + +const Connect = styled(StyledButton)` + color: rgb(255, 255, 255); + background: #d53a94; +`; + +const ConnectWrapperClose = styled.div` + display: flex; + align-items: center; + flex-direction: column; +`; + +const StyledButtonClose = styled.button` + border: 0px; + outline: 0px; + padding: 24px 9px; + font-weight: 500; + border-radius: 12px; + font-size: 17px; + cursor: pointer; + width: 147px; + height: 44px; + text-align: start; + align-items: center; + display: flex; + justify-content: center; +`; + +const ConnectClose = styled(StyledButtonClose)` + color: rgb(255, 255, 255); + background: #d53a94; + gap: 8px; +`; + +const TokenWrapper = styled.div` + display: flex; + align-items: center; + flex-direction: column; +`; + +const TokenStyledButton = styled.button` + border: 0px; + outline: 0px; + padding: 22px 9px; + font-weight: 500; + border-radius: 12px; + font-size: 17px; + cursor: pointer; + width: 100%; + height: 44px; + text-align: start; + align-items: center; + display: flex; + justify-content: center; +`; + +const TokenGet = styled(TokenStyledButton)` + color: #d53a94; + border: 2px solid #d53a94; + background: none; + gap: 8px; +`; +const Link = styled.a` + color: #d53a94; + link-decoration: none; + text-decoration: none; +`; diff --git a/packages/uiweb/src/lib/components/chat/MessageInput/VerificationFailed.tsx b/packages/uiweb/src/lib/components/chat/MessageInput/VerificationFailed.tsx new file mode 100644 index 000000000..98f5c3dcc --- /dev/null +++ b/packages/uiweb/src/lib/components/chat/MessageInput/VerificationFailed.tsx @@ -0,0 +1,107 @@ +import React, { useContext } from 'react' +import { Modal } from '../helpers/Modal' +import { Image, Section, Span } from '../../reusables' +import { ThemeContext } from '../theme/ThemeProvider'; +import TokenGatedIcon from "../../../icons/Token-Gated.svg" +import OpenLink from "../../../icons/OpenLink"; +import styled from 'styled-components'; +import useVerifyAccessControl from '../../../hooks/chat/useVerifyAccessControl'; + + +const VerificationFailed = () => { + const theme = useContext(ThemeContext); + const { setVerificationSuccessfull, verificationSuccessfull } = useVerifyAccessControl(); + return ( + +
+ Verification Failed + Please ensure the following conditions are met to participate and send messages. +
+ token-gated +
{/* Added marginLeft */} + Token Gated + You need to have 1 PUSH Token in your wallet to be able to send messages. +
+
+
+ + + Get Tokens + + + + { + setVerificationSuccessfull(false) + console.log(verificationSuccessfull) + }}> + + Close + + +
+
+
+ ) +} + +export default VerificationFailed + + +const ConnectWrapper = styled.div` + display: flex; + align-items: center; + flex-direction: column; + `; + +const ConnectWrapperClose = styled.div` + display: flex; + align-items: center; + flex-direction: column; +`; + + +const StyledButton = styled.button` + border: 0px; + outline: 0px; + padding: 22px 9px; + font-weight: 500; + border-radius: 12px; + font-size: 17px; + cursor: pointer; + width: 147px; + height: 44px; + text-align: start; + align-items: center; + display: flex; + justify-content: center; + `; + +const StyledButtonClose = styled.button` + border: 0px; + outline: 0px; + padding: 24px 9px; + font-weight: 500; + border-radius: 12px; + font-size: 17px; + cursor: pointer; + width: 147px; + height: 44px; + text-align: start; + align-items: center; + display: flex; + justify-content: center; +`; + + +const Connect = styled(StyledButton)` + color: #D53A94; + border: 2px solid #D53A94; + background: none; + gap: 8px; + `; + +const ConnectClose = styled(StyledButtonClose)` + color: rgb(255, 255, 255); + background: #D53A94; + gap: 8px; + `; diff --git a/packages/uiweb/src/lib/components/chat/ProfileHeader/AddWalletContent.tsx b/packages/uiweb/src/lib/components/chat/ProfileHeader/AddWalletContent.tsx new file mode 100644 index 000000000..f370e5278 --- /dev/null +++ b/packages/uiweb/src/lib/components/chat/ProfileHeader/AddWalletContent.tsx @@ -0,0 +1,354 @@ +import { useContext, useEffect, useState } from "react"; +import styled from "styled-components"; +import { ThemeContext } from "../theme/ThemeProvider"; +import { useChatData } from "../../../hooks"; +import { displayDefaultUser, getAddress, walletToPCAIP10 } from "../../../helpers"; +import { IToast, ModalButtonProps, User } from "../exportedTypes"; +import * as PushAPI from '@pushprotocol/restapi'; +import { ethers } from "ethers"; +import { addWalletValidation } from "../helpers/helper"; +// import ArrowLeftIcon from '../../../icons/ArrowLeft.svg'; +import CloseIcon from '../../../icons/close.svg'; +import { Spinner } from "../../supportChat/spinner/Spinner"; +import { MoreLightIcon } from '../../../icons/MoreLight'; +import { MoreDarkIcon } from '../../../icons/MoreDark'; +import { SearchIcon } from '../../../icons/SearchIcon'; +import { Section, Span, Image } from "../../reusables/sharedStyling"; +import { AddUserDarkIcon } from '../../../icons/Adddark'; +import { device } from "../../../config"; +import { MemberListContainer } from "./MemberListContainer"; +import useMediaQuery from "../../../hooks/useMediaQuery"; + +export const AddWalletContent = ({ onSubmit, handlePrevious, onClose, memberList, handleMemberList, title, groupMembers, isLoading, setToastInfo }: { onSubmit: () => void, onClose: () => void, handlePrevious: () => void, memberList: any, handleMemberList: any, title: string, groupMembers: any, isLoading?: boolean, setToastInfo: React.Dispatch> }) => { + const theme = useContext(ThemeContext); + + const [searchedUser, setSearchedUser] = useState(''); + const [filteredUserData, setFilteredUserData] = useState(null); + const [isInValidAddress, setIsInvalidAddress] = useState(false); + const [isLoadingSearch, setIsLoadingSearch] = useState(false); + const { account, env } = useChatData(); + const isMobile = useMediaQuery(device.mobileL); + + + + useEffect(() => { + if (isInValidAddress) { + setToastInfo({ + message: 'Invalid Address', + status: 'error' + }) + } + }, [isInValidAddress]); + + const onChangeSearchBox = (e: any) => { + setSearchedUser(e.target.value); + }; + + const handleUserSearch = async (userSearchData: string): Promise => { + try { + const caip10 = walletToPCAIP10(userSearchData); + let filteredData: User; + + if (userSearchData.length) { + filteredData = await PushAPI.user.get({ + account: caip10, + env: env + }); + + if (filteredData !== null) { + setFilteredUserData(filteredData); + } + // User is not in the protocol. Create new user + else { + if (ethers.utils.isAddress(userSearchData)) { + const displayUser = displayDefaultUser({ caip10 }); + setFilteredUserData(displayUser); + } else { + setIsInvalidAddress(true); + setFilteredUserData(null); + } + } + } else { + setFilteredUserData(null); + } + setIsLoadingSearch(false); + } + catch (error) { + setToastInfo({ + message: 'Unsuccessful search, Try again', + status: 'error' + }) + } + }; + + const handleSearch = async (e: any): Promise => { + setIsLoadingSearch(true); + setIsInvalidAddress(false); + e.preventDefault(); + if (!ethers.utils.isAddress(searchedUser)) { + let address: string; + try { + address = await getAddress(searchedUser, env) as string; + // if (!address) { + // address = await library.resolveName(searchedUser); + // } + // this ensures address are checksummed + address = ethers.utils.getAddress(address?.toLowerCase()); + if (address) { + handleUserSearch(address); + } else { + setIsInvalidAddress(true); + setFilteredUserData(null); + } + } catch (err) { + setIsInvalidAddress(true); + setFilteredUserData(null); + } finally { + setIsLoadingSearch(false); + } + } else { + handleUserSearch(searchedUser); + } + }; + + const clearInput = () => { + setSearchedUser(''); + setFilteredUserData(null); + setIsLoadingSearch(false); + }; + + const addMemberToList = (member: User) => { + let errorMessage = ''; + + errorMessage = addWalletValidation(member, memberList, groupMembers, account); + + if (errorMessage) { + setToastInfo({ + message: `Error`, + status: 'error' + }) + } else { + handleMemberList((prev: any) => [...prev, { ...member, isAdmin: false }]); + } + + setFilteredUserData(''); + clearInput(); + }; + + const removeMemberFromList = (member: User) => { + const filteredMembers = memberList?.filter((user: any) => user.wallets !== member.wallets); + handleMemberList(filteredMembers); + }; + + return ( +
+
+ + {/* handlePrevious()} cursor='pointer' /> */} + + Add Wallets + + onClose()} cursor='pointer' /> +
+ +
+ Add Wallets + + + {groupMembers + ? `0${memberList?.length + groupMembers?.length} / 09 Members` + : `0${memberList?.length} / 09 Members`} + +
+ +
+ + +
+ {searchedUser.length > 0 && ( + clearInput()} cursor='pointer' /> + )} + {searchedUser.length == 0 && !filteredUserData && +
+ +
+ } +
+
+
+ + {filteredUserData ? ( + + } + darkIcon={} + /> + + ) : isLoadingSearch ? ( +
+ +
+ ) : null} + + + {memberList?.map((member: any, index: any) => ( + } + darkIcon={} + /> + ))} + + +
+ onSubmit()} + isLoading={isLoading} + // loaderTitle={groupMembers ? 'Adding Members' : 'Creating group'} + memberListCount={memberList?.length > 0} + theme={theme} + > + {groupMembers ? 'Add To Group' : 'Create Group'} + {isLoading && } + +
+ +
+ ) +} + +const SearchBarContent = styled.form` + position: relative; + display: flex; + flex: 1; +`; + +const Input = styled.input` + box-sizing: border-box; + display: flex; + flex: 1; +// min-width: 445px; + height: 48px; + padding: 0px 50px 0px 16px; + margin: 10px 0px 0px; + border-radius: 99px; + border: 1px solid; + border-color: ${(props) => props.theme.modalSearchBarBorderColor}; + background: ${(props) => props.theme.modalSearchBarBackground}; + color: ${(props) => props.color || '#000'}; + &:focus { + outline: none; + background-image: linear-gradient( + ${(props) => props.theme.snapFocusBg}, + ${(props) => props.theme.snapFocusBg} + ), + linear-gradient( + to right, + rgba(182, 160, 245, 1), + rgba(244, 110, 246, 1), + rgba(255, 222, 211, 1), + rgba(255, 207, 197, 1) + ); + background-origin: border; + border: 1px solid transparent !important; + background-clip: padding-box, border-box; + } + &::placeholder { + color: #657795; + } + @media ${device.mobileL} { + min-width: 100%; + } +`; + +const MemberList = styled.div` + // justify-content: flex-start; + // padding: 0px 2px; + // margin: 0 0 34px 0; + flex: 1; + // background: red; + width: 100%; +`; + +const MultipleMemberList = styled.div` + overflow-y: auto; + height: fit-content; + max-height: 216px; + padding: 0px 2px; + overflow-x: hidden; + width: 100%; + + &::-webkit-scrollbar-track { + background-color: ${(props) => props.theme.scrollBg}; + } + + &::-webkit-scrollbar { + background-color: ${(props) => props.theme.scrollBg}; + width: 6px; + } + + @media (max-width: 768px) { + padding: 0px 0px 0px 0px; + max-height: 35vh; + + &::-webkit-scrollbar-track { + background-color: none; + border-radius: 9px; + } + + &::-webkit-scrollbar { + background-color: none; + width: 4px; + } + } + + &::-webkit-scrollbar-thumb { + border-radius: 10px; + background-image: -webkit-gradient( + linear, + left top, + left bottom, + color-stop(0.44, #cf1c84), + color-stop(0.72, #cf1c84), + color-stop(0.86, #cf1c84) + ); + } +`; + +const ModalConfirmButton = styled.button` + margin: 60px 0 0 0; + background: ${(props) => props.memberListCount ? '#CF1C84' : props.theme.groupButtonBackgroundColor}; + color: ${(props) => props.memberListCount ? '#fff' : props.theme.groupButtonTextColor}; + border: ${(props) => props.memberListCount ? 'none' : props.theme.modalConfirmButtonBorder}; + min-width: 50%; + box-sizing: border-box; + cursor: pointer; + border-radius: 15px; + padding: 16px; + font-size: 1.125rem; + font-weight: 500; + display: flex; + align-items: center; + justify-content: ${(props) => props.isLoading ? 'space-between' : 'center'}; + box-shadow: none; +`; \ No newline at end of file diff --git a/packages/uiweb/src/lib/components/chat/exportedTypes.ts b/packages/uiweb/src/lib/components/chat/exportedTypes.ts index 4da3d5691..7c49a676e 100644 --- a/packages/uiweb/src/lib/components/chat/exportedTypes.ts +++ b/packages/uiweb/src/lib/components/chat/exportedTypes.ts @@ -4,12 +4,14 @@ import { IGroup } from '../../types' export interface IChatViewListProps { chatId: string; + chatFilterList?: Array; limit?: number; } export interface IChatViewComponentProps { messageInput?: boolean; chatViewList?: boolean; + chatFilterList?: Array; chatProfile?: boolean; //name needs to change chatId: string; //need confirmation on this limit?: number; @@ -17,6 +19,8 @@ export interface IChatViewComponentProps { gif?: boolean; file?: boolean; isConnected?: boolean; + autoConnect?:boolean; + onGetTokenClick?: () => void; } export interface IChatProfile { @@ -58,11 +62,12 @@ export type GIFType = { export interface MessageInputProps { chatId: string; - Emoji?: boolean; - GIF?: boolean; - File?: boolean; - Image?: boolean; + emoji?: boolean; + gif?: boolean; + file?: boolean; isConnected?: boolean; + autoConnect?:boolean; + onGetTokenClick?: () => void; } export type UpdateGroupType = { diff --git a/packages/uiweb/src/lib/components/chat/helpers/Modal.tsx b/packages/uiweb/src/lib/components/chat/helpers/Modal.tsx index c7cbef9b4..8fd4e5797 100644 --- a/packages/uiweb/src/lib/components/chat/helpers/Modal.tsx +++ b/packages/uiweb/src/lib/components/chat/helpers/Modal.tsx @@ -7,6 +7,7 @@ import { useRef, useContext } from 'react'; import styled from 'styled-components' import { ThemeContext } from '../theme/ThemeProvider'; import { useClickAway } from '../../../hooks'; +import { IChatTheme } from '../theme'; // import { ThemeContext } from '../theme/ThemeProvider'; @@ -16,6 +17,7 @@ interface IModalProps { width?: string; clickawayClose?: () => void; children: any; + theme?:IChatTheme } const ClickawayCloseModal = ({ children, clickawayClose, width }: IModalProps) => { @@ -65,7 +67,7 @@ const ModalOverlay = styled.div` height: 100%; background-color: rgba(0, 0, 0, 0.4); /* Black with 40% opacity */ display: flex; - color: ${props => props.theme.textColorPrimary ?? '#000'}; + color: ${(props) => props.theme.modalBackgroundColor?? '#000'}; justify-content: center; align-items: center; z-index: 2000; @@ -86,7 +88,7 @@ const ModalParent = styled.div` align-items: center; padding: 24px 20px; - background: ${(props => props.theme.bgColorPrimary)}; + background: ${(props) => props.theme.modalBackgroundColor}; border-radius: 12px; width: ${(props => props.width ? props.width : 'auto')}; diff --git a/packages/uiweb/src/lib/components/chat/helpers/NewToast.tsx b/packages/uiweb/src/lib/components/chat/helpers/NewToast.tsx index 3009b3054..6e9ae030f 100644 --- a/packages/uiweb/src/lib/components/chat/helpers/NewToast.tsx +++ b/packages/uiweb/src/lib/components/chat/helpers/NewToast.tsx @@ -6,7 +6,7 @@ import { Spinner } from '../../supportChat/spinner/Spinner'; import { toast } from 'react-toastify'; import styled, { ThemeProvider } from 'styled-components'; import CloseIcon from '../../../icons/close.svg'; -import useMediaQuery from './useMediaQuery'; +import useMediaQuery from '../../../hooks/useMediaQuery'; import { useContext, useRef } from 'react'; import { Image } from '../../reusables'; import { device } from '../../../config'; @@ -114,7 +114,7 @@ const useToast = ( {toastTitle} diff --git a/packages/uiweb/src/lib/components/chat/helpers/index.ts b/packages/uiweb/src/lib/components/chat/helpers/index.ts index eb150f0e9..33149132c 100644 --- a/packages/uiweb/src/lib/components/chat/helpers/index.ts +++ b/packages/uiweb/src/lib/components/chat/helpers/index.ts @@ -1 +1,5 @@ -export * from './twitter'; \ No newline at end of file +export * from './twitter'; +export * from './Modal'; +export * from './NewToast'; +export * from './Toast'; +export * from './helper'; \ No newline at end of file diff --git a/packages/uiweb/src/lib/components/chat/reusables/ChatSearchInput.tsx b/packages/uiweb/src/lib/components/chat/reusables/ChatSearchInput.tsx new file mode 100644 index 000000000..1590bfaab --- /dev/null +++ b/packages/uiweb/src/lib/components/chat/reusables/ChatSearchInput.tsx @@ -0,0 +1,189 @@ +import React, { useContext, useState } from 'react'; +import styled from 'styled-components'; +import { Div, Section, Span, Spinner } from '../../reusables'; +import { SearchIcon } from '../../../icons/Search'; +import { CloseIcon } from '../../../icons/Close'; +import { ThemeContext } from '../theme/ThemeProvider'; +import { IChatTheme } from '../theme'; + +/** + * @interface IThemeProps + * this interface is used for defining the props for styled components + */ +interface IThemeProps { + theme?: IChatTheme; + customStyle?: any; +} + +type ChatSearchInputPropType = { + handleSearch: any; + clearInput: () => void; + placeholder: string; + customStyle?: any; +}; + +export const ChatSearchInput: React.FC = ({ + handleSearch, + clearInput, + customStyle = null, + placeholder, +}) => { + const theme = useContext(ThemeContext); + const [searchedText, setSearchedText] = useState(''); + const [loading, setLoading] = useState(false); + const onChangeSearchText = (val: string) => { + setSearchedText(val); + }; + + React.useEffect(() => { + setLoading(true); + const getData = setTimeout(() => { + onSearch(); + setLoading(false); + }, 2000); + return () => clearTimeout(getData); + }, [searchedText]); + + const onSearch = () => { + if (searchedText.trim() !== '') { + handleSearch({ searchedText }); + } else { + clearInput(); + } + }; +console.log(theme.border?.searchInput) + return ( + + + onChangeSearchText(e.target.value)} + placeholder={placeholder} + onKeyDown={(event) => { + if (event.key === 'Enter') { + onSearch(); + } + }} + /> + + {!loading && !searchedText && ( +
onSearch()} + > + +
+ )} + {!loading && searchedText && ( +
{ + setSearchedText(''); + clearInput(); + }} + width="17.49px" + height="17.49px" + > + +
+ )} + {loading && } +
+
+
+ ); +}; + +//styles +const Container = styled(Section)` + border-radius: 4px; +`; + +const InputSection = styled(Section)` + border: ${(props) => + props.customStyle + ? props.customStyle.border + : props.theme.border?.searchInput}; + + &:focus-within { + outline: none; + background-image: linear-gradient( + #F4F5FA, + #F4F5FA + ), + linear-gradient( + to right, + rgba(182, 160, 245, 1), + rgba(244, 110, 246, 1), + rgba(255, 222, 211, 1), + rgba(255, 207, 197, 1) + ); + background-origin: border; + border: 1px solid transparent !important; + background-clip: padding-box, border-box; + } + +`; + +const Input = styled.input` + border: none; + background: ${(props) => + props.customStyle + ? props.customStyle.background + : props.theme.backgroundColor?.searchInputBackground}; + width: 100%; + flex: 1; + margin-left: 10px; + font-style: normal; + color: ${(props) => + props.customStyle + ? props.customStyle.color + : props.theme.textColor.searchInputText}; + font-weight: ${(props) => + props.customStyle + ? props.customStyle.fontWeight + : props.theme.fontWeight.searchInputText}; + font-size: ${(props) => + props.customStyle + ? props.customStyle.fontSize + : props.theme.fontSize.searchInputText}; + line-height: 24px; + &:focus { + outline: none; + background-origin: border; + background-clip: padding-box, border-box; + } + &::placeholder { + color: ${(props) => + props.customStyle + ? props.customStyle.placeholderColor + : props.theme.textColor.searchPlaceholderText}; + } + +`; + +//theme diff --git a/packages/uiweb/src/lib/components/chat/reusables/index.ts b/packages/uiweb/src/lib/components/chat/reusables/index.ts new file mode 100644 index 000000000..706a1c4bc --- /dev/null +++ b/packages/uiweb/src/lib/components/chat/reusables/index.ts @@ -0,0 +1 @@ +export * from './ChatSearchInput'; \ No newline at end of file diff --git a/packages/uiweb/src/lib/components/chat/theme/index.ts b/packages/uiweb/src/lib/components/chat/theme/index.ts index 34947cdb4..effd88077 100644 --- a/packages/uiweb/src/lib/components/chat/theme/index.ts +++ b/packages/uiweb/src/lib/components/chat/theme/index.ts @@ -3,22 +3,105 @@ */ import { CHAT_THEME_OPTIONS } from '../exportedTypes'; +//theme type +interface IBorder { + chatViewComponent?: string; + chatProfile?: string; + messageInput?: string; + searchInput?:string; + modal?:string; + modalInnerComponents?:string; +} +interface IBorderRadius { + chatViewComponent?: string; + chatProfile?: string; + messageInput?: string; + searchInput?:string; + modal?:string; + modalInnerComponents?:string; +} +interface IBackgroundColor { + chatViewComponentBackground?: string; + chatProfileBackground?: string; + messageInputBackground?: string; + chatSentBubbleBackground?: string; + chatReceivedBubbleBackground?: string; + encryptionMessageBackground?: string; + buttonBackground?: string; + searchInputBackground?:string; + modalBackground?:string; + modalInputBackground?:string; + modalHoverBackground?:string; +} + +interface ITextColor { + chatProfileText?: string; + messageInputText?: string; + chatSentBubbleText?: string; + chatReceivedBubbleText?: string; + timestamp?: string; + encryptionMessageText?: string; + buttonText?: string; + chatReceivedBubbleAddressText?: string; + chatReceivedBubbleTimestampText?: string; + chatSentBubbleTimestampText?: string; + searchInputText?:string; + searchPlaceholderText?:string; + modalHeadingText?:string; + modalSubHeadingText?:string; +} +interface IFont { + chatProfileText?: string; + messageInputText?: string; + chatSentBubbleText?: string; + chatReceivedBubbleText?: string; + timestamp?: string; + encryptionMessageText?: string; + chatReceivedBubbleAddressText?: string; + chatReceivedBubbleTimestampText?: string; + chatSentBubbleTimestampText?: string; + searchInputText?:string; + searchPlaceholderText?:string; +} +interface IFontWeight { + chatProfileText?: string; + messageInputText?: string; + chatSentBubbleText?: string; + chatReceivedBubbleText?: string; + timestamp?: string; + encryptionMessageText?: string; + chatReceivedBubbleAddressText?: string; + chatReceivedBubbleTimestampText?: string; + chatSentBubbleTimestampText?: string; + searchInputText?:string; + searchPlaceholderText?:string; +} +interface IIconColor { + emoji?: string; + attachment?: string; + sendButton?: string; + groupSettings?: string; +} export interface IChatTheme { - bgColorPrimary?: string; - bgColorSecondary?: string; - textColorPrimary?: string; - textColorSecondary?: string; - accentBgColor?: string; - accentTextColor?: string; - btnColorPrimary?: string; - chatBubbleAccentBgColor?:string; - border?: string; - borderRadius?: string; - iconColorPrimary?: string; + borderRadius?: IBorderRadius; + + backgroundColor?: IBackgroundColor; + + fontSize?: IFont; + + fontWeight?: IFontWeight; + fontFamily?: string; - chatBubblePrimaryBgColor?: string; - fileIconColor?: string; - dropdownBorderColor?: string; + + border?: IBorder; + iconColor?: IIconColor; + textColor?: ITextColor; + backdropFilter?: string; + scrollbarColor?: string; + + //below needs to be categorised + spinnerColor?: string; + modalBackgroundColor?:string; modalPrimaryTextColor?: string; modalSearchBarBorderColor?: string; modalSearchBarBackground?: string; @@ -26,12 +109,12 @@ export interface IChatTheme { groupButtonBackgroundColor?: string; groupButtonTextColor?: string; modalConfirmButtonBorder?: string; - groupSearchProfilBackground?: string, - modalInputBorderColor?: string, - snackbarBorderText?: string, - snackbarBorderIcon?: string, - modalContentBackground?: string, - modalProfileTextColor?: string, + groupSearchProfilBackground?: string; + modalInputBorderColor?: string; + snackbarBorderText?: string; + snackbarBorderIcon?: string; + modalContentBackground?: string; + modalProfileTextColor?: string; toastSuccessBackground?: string; toastErrorBackground?: string; toastShadowColor?: string; @@ -40,27 +123,103 @@ export interface IChatTheme { modalBorderColor?: string; modalDescriptionTextColor?: string; modalIconColor?: string; - pendingCardBackground?: string, + pendingCardBackground?: string; modalHeadingColor?: string; defaultBorder?: string; } +//dark theme object export const lightChatTheme: IChatTheme = { - bgColorPrimary: '#fff', - chatBubblePrimaryBgColor: '#fff', - bgColorSecondary: - 'linear-gradient(179.97deg, #EEF5FF 0.02%, #ECE9FA 123.25%)', - textColorPrimary: '#000', - textColorSecondary: 'rgb(101, 119, 149)', - chatBubbleAccentBgColor: 'rgb(202, 89, 155)', - accentBgColor: 'rgb(202, 89, 155)', - accentTextColor: '#fff', - btnColorPrimary: 'rgb(202, 89, 155)', - border: 'none', - borderRadius: '24px', - iconColorPrimary: 'none', - fileIconColor: '#000', - dropdownBorderColor: '1px solid rgb(229, 232, 246)', + borderRadius: { + chatViewComponent: '24px', + chatProfile: '32px', + messageInput: '13px', + searchInput: '99px', + modal: '16px', + modalInnerComponents:'12px' + }, + + backgroundColor: { + chatViewComponentBackground: + 'linear-gradient(179.97deg, #EEF5FF 0.02%, #ECE9FA 123.25%)', + chatProfileBackground: '#fff', + messageInputBackground: '#fff', + chatSentBubbleBackground: 'rgb(202, 89, 155)', + chatReceivedBubbleBackground: '#fff', + encryptionMessageBackground: '#fff', + buttonBackground: 'rgb(202, 89, 155)', + searchInputBackground: 'rgb(244, 245, 250)', + modalBackground:'#fff', + modalInputBackground:'transparent', + modalHoverBackground:'rgb(244, 245, 250)' + }, + + fontSize: { + chatProfileText: '17px', + messageInputText: '16px', + chatSentBubbleText: '16px', + chatReceivedBubbleText: '16px', + timestamp: '12px', + encryptionMessageText: '13px', + chatReceivedBubbleAddressText: '16px', + chatReceivedBubbleTimestampText: '12px', + chatSentBubbleTimestampText: '12px', + searchInputText:'16px', + searchPlaceholderText:'16px' + }, + + fontWeight: { + chatProfileText: '300', + messageInputText: '400', + chatSentBubbleText: '400', + chatReceivedBubbleText: '400', + timestamp: '400', + encryptionMessageText: '400', + chatReceivedBubbleAddressText: '300', + chatReceivedBubbleTimestampText: '400', + chatSentBubbleTimestampText: '400', + searchInputText:'400', + searchPlaceholderText:'400' + }, + + fontFamily: 'inherit', + + border: { + chatViewComponent: 'none', + chatProfile: 'none', + messageInput: 'none', + searchInput:'1px solid transparent', + modal:'1px solid rgb(229, 232, 246)', + modalInnerComponents:'1px solid rgb(194, 203, 219)' + }, + + iconColor: { + emoji: 'rgb(101, 119, 149)', + attachment: 'rgb(101, 119, 149)', + sendButton: 'rgb(101, 119, 149)', + groupSettings: 'rgb(101, 119, 149)', + }, + textColor: { + chatProfileText: '#000', + messageInputText: '#000', + chatSentBubbleText: '#fff', + chatReceivedBubbleText: '#000', + timestamp: '400', + encryptionMessageText: '#000', + buttonText: '#fff', + chatReceivedBubbleAddressText: '#000', + chatReceivedBubbleTimestampText: '#000', + chatSentBubbleTimestampText: '#fff', + searchInputText:'#000', + searchPlaceholderText:'rgb(101, 119, 149)', + modalHeadingText:'#000', + modalSubHeadingText:'rgb(101, 119, 149)' + }, + backdropFilter: 'none', + spinnerColor: 'rgb(202, 89, 155)', + scrollbarColor: 'rgb(202, 89, 155)', + //the rest param needs to be included in categories + modalBackgroundColor:'#fff', modalPrimaryTextColor: '#1E1E1E', modalSearchBarBorderColor: '#BAC4D6', modalSearchBarBackground: '#FFF', @@ -74,8 +233,10 @@ export const lightChatTheme: IChatTheme = { snackbarBorderIcon: 'none', modalContentBackground: '#FFFFFF', modalProfileTextColor: '#1E1E1E', - toastSuccessBackground: 'linear-gradient(90.15deg, #30CC8B -125.65%, #30CC8B -125.63%, #F3FFF9 42.81%)', - toastErrorBackground: 'linear-gradient(90.15deg, #FF2070 -125.65%, #FF2D79 -125.63%, #FFF9FB 42.81%)', + toastSuccessBackground: + 'linear-gradient(90.15deg, #30CC8B -125.65%, #30CC8B -125.63%, #F3FFF9 42.81%)', + toastErrorBackground: + 'linear-gradient(90.15deg, #FF2070 -125.65%, #FF2D79 -125.63%, #FFF9FB 42.81%)', toastShadowColor: '#ccc', toastBorderColor: '#F4F3FF', mainBg: '#fff', @@ -88,21 +249,94 @@ export const lightChatTheme: IChatTheme = { }; export const darkChatTheme: IChatTheme = { - chatBubblePrimaryBgColor: '#fff', - bgColorPrimary: 'rgb(47, 49, 55)', - bgColorSecondary: 'rgb(40, 42, 46)', - textColorPrimary: '#fff', - textColorSecondary: 'rgb(182, 188, 214)', - chatBubbleAccentBgColor: 'rgb(202, 89, 155)', - accentBgColor: 'rgb(202, 89, 155)', - accentTextColor: '#fff', - btnColorPrimary: 'rgb(202, 89, 155)', - border: 'none', - borderRadius: '24px', - iconColorPrimary: - 'brightness(0) saturate(100%) invert(89%) sepia(8%) saturate(1567%) hue-rotate(191deg) brightness(86%) contrast(93%)', - dropdownBorderColor: '1px solid rgb(74, 79, 103)', - fileIconColor: '#fff', + borderRadius: { + chatViewComponent: '24px', + chatProfile: '32px', + messageInput: '13px', + searchInput: '99px', + modal: '16px', + modalInnerComponents:'12px' + }, + + backgroundColor: { + chatViewComponentBackground: 'rgb(40, 42, 46);', + chatProfileBackground: 'rgb(64, 70, 80);', + messageInputBackground: 'rgb(64, 70, 80);', + chatSentBubbleBackground: 'rgb(202, 89, 155)', + chatReceivedBubbleBackground: 'rgb(64, 70, 80);', + encryptionMessageBackground: 'rgb(64, 70, 80);', + buttonBackground: 'rgb(202, 89, 155)', + modalBackground:'rgb(47, 49, 55)', + modalInputBackground:'rgb(40, 42, 46)', + modalHoverBackground:'rgb(64, 70, 80)' + }, + + fontSize: { + chatProfileText: '17px', + messageInputText: '16px', + chatSentBubbleText: '16px', + chatReceivedBubbleText: '16px', + timestamp: '12px', + encryptionMessageText: '13px', + chatReceivedBubbleAddressText: '16px', + chatReceivedBubbleTimestampText: '12px', + chatSentBubbleTimestampText: '12px', + searchInputText:'16px', + searchPlaceholderText:'16px' + }, + + fontWeight: { + chatProfileText: '300', + messageInputText: '400', + chatSentBubbleText: '400', + chatReceivedBubbleText: '400', + timestamp: '400', + encryptionMessageText: '400', + chatReceivedBubbleAddressText: '300', + chatReceivedBubbleTimestampText: '400', + chatSentBubbleTimestampText: '400', + searchInputText:'400', + searchPlaceholderText:'400' + }, + + fontFamily: 'inherit', + + border: { + chatViewComponent: 'none', + chatProfile: 'none', + messageInput: 'none', + searchInput:'1px solid transparent', + modal:'1px solid rgb(74, 79, 103)', + modalInnerComponents:'1px solid rgb(74, 79, 103)' + }, + + iconColor: { + emoji: 'rgba(120, 126, 153, 1)', + attachment: 'rgba(120, 126, 153, 1)', + sendButton: 'rgba(120, 126, 153, 1)', + groupSettings: 'rgba(120, 126, 153, 1)', + }, + textColor: { + chatProfileText: 'rgb(182, 188, 214)', + messageInputText: 'rgb(182, 188, 214)', + chatSentBubbleText: '#fff', + chatReceivedBubbleText: 'rgb(182, 188, 214)', + timestamp: 'rgb(182, 188, 214)', + encryptionMessageText: 'rgb(182, 188, 214)', + buttonText: '#fff', + chatReceivedBubbleAddressText: 'rgb(182, 188, 214)', + chatReceivedBubbleTimestampText: 'rgb(182, 188, 214)', + chatSentBubbleTimestampText: '#fff', + searchInputText:'#fff', + searchPlaceholderText:'rgb(101, 119, 149)', + modalHeadingText:'#fff', + modalSubHeadingText:'rgb(182, 188, 214)' + }, + backdropFilter: 'none', + spinnerColor: 'rgb(202, 89, 155)', + scrollbarColor: 'rgb(202, 89, 155)', + //the rest param needs to be included in categories + modalBackgroundColor:'rgba(47, 49, 55, 1)', modalPrimaryTextColor: '#B6BCD6', modalSearchBarBorderColor: '#4A4F67', modalSearchBarBackground: '#282A2E', @@ -114,11 +348,13 @@ export const darkChatTheme: IChatTheme = { modalInputBorderColor: '#4A4F67', snackbarBorderText: '#B6BCD6', snackbarBorderIcon: - 'brightness(0) saturate(100%) invert(89%) sepia(8%) saturate(1567%) hue-rotate(191deg) brightness(86%) contrast(93%)', + 'brightness(0) saturate(100%) invert(89%) sepia(8%) saturate(1567%) hue-rotate(191deg) brightness(86%) contrast(93%)', modalContentBackground: '#2F3137', modalProfileTextColor: '#B6BCD6', - toastSuccessBackground: 'linear-gradient(90.15deg, #30CC8B -125.65%, #30CC8B -125.63%, #2F3137 42.81%)', - toastErrorBackground: 'linear-gradient(89.96deg, #FF2070 -101.85%, #2F3137 51.33%)', + toastSuccessBackground: + 'linear-gradient(90.15deg, #30CC8B -125.65%, #30CC8B -125.63%, #2F3137 42.81%)', + toastErrorBackground: + 'linear-gradient(89.96deg, #FF2070 -101.85%, #2F3137 51.33%)', toastShadowColor: '#00000010', toastBorderColor: '#4A4F67', mainBg: '#000', @@ -127,6 +363,5 @@ export const darkChatTheme: IChatTheme = { modalIconColor: '#787E99', pendingCardBackground: 'rgba(173, 176, 190, 0.08)', modalHeadingColor: '#B6BCD6', - defaultBorder: '#4A4F67' + defaultBorder: '#4A4F67', }; - diff --git a/packages/uiweb/src/lib/components/space/SpaceWidget/LiveWidgetContent.tsx b/packages/uiweb/src/lib/components/space/SpaceWidget/LiveWidgetContent.tsx index 2e996e542..a4b8fcf06 100644 --- a/packages/uiweb/src/lib/components/space/SpaceWidget/LiveWidgetContent.tsx +++ b/packages/uiweb/src/lib/components/space/SpaceWidget/LiveWidgetContent.tsx @@ -1,9 +1,13 @@ -import React, { useEffect, useState, useContext } from 'react'; +import React, { useEffect, useState, useContext, useMemo } from 'react'; import styled, { ThemeProvider } from 'styled-components'; import { Player } from '@livepeer/react'; import * as PushAPI from '@pushprotocol/restapi'; import { SpaceDTO } from '@pushprotocol/restapi'; +// livekit imports +import { LiveKitRoom, ConnectionState, RoomAudioRenderer, TrackToggle, ConnectionStateToast } from '@livekit/components-react'; +import { Room, Track } from 'livekit-client'; + import { LiveSpaceProfileContainer } from './LiveSpaceProfileContainer'; import { SpaceMembersSectionModal } from './SpaceMembersSectionModal'; @@ -12,7 +16,7 @@ import { ThemeContext } from '../theme/ThemeProvider'; import CircularProgressSpinner from '../../loader/loader'; -import { Button, Image, Item, Text } from '../../../config'; +import { Button, Image, Item, LIVEKIT_SERVER_URL, Text } from '../../../config'; import MicOnIcon from '../../../icons/micon.svg'; import MicEngagedIcon from '../../../icons/MicEngage.svg'; import MuteIcon from '../../../icons/Muted.svg'; @@ -21,18 +25,22 @@ import MembersIcon from '../../../icons/Members.svg'; import { useSpaceData } from '../../../hooks'; import { SpaceStatus } from './WidgetContent'; import { pCAIP10ToWallet } from '../../../helpers'; +import { getLivekitRoomToken, performAction } from '../../../services'; +import Microphone from './Microphone'; interface LiveWidgetContentProps { spaceData?: SpaceDTO; // temp props only for testing demo purpose for now isHost?: boolean; setSpaceStatusState: React.Dispatch>; + account: string | undefined; } export const LiveWidgetContent: React.FC = ({ spaceData, isHost, setSpaceStatusState, + account }) => { const [showMembersModal, setShowMembersModal] = useState(false); const [playBackUrl, setPlayBackUrl] = useState(''); @@ -41,6 +49,7 @@ export const LiveWidgetContent: React.FC = ({ const [isRequestedForMic, setIsRequestedForMic] = useState(false); const [promotedListener, setPromotedListener] = useState(''); + const [livekitToken, setLivekitToken] = useState(null); const theme = useContext(ThemeContext); @@ -57,12 +66,27 @@ export const LiveWidgetContent: React.FC = ({ const isMicOn = spaceObjectData?.connectionData?.local?.audio; - const numberOfRequests = spaceObjectData.liveSpaceData.listeners.filter((listener: any) => listener.handRaised).length; + // const numberOfRequests = spaceObjectData.liveSpaceData.listeners.filter((listener: any) => listener.handRaised).length; const handleMicState = async () => { await spacesObjectRef?.current?.enableAudio?.({ state: !isMicOn }); }; + useEffect(() => { + (async function () { + const removeEIP155 = (input: string) => input.substring(7); + const nonEIPAddress = removeEIP155(account as string); + + if ((isHost || isSpeaker) && spaceData?.spaceId) { + const livekitToken = await getLivekitRoomToken({ userType: "sender", roomId: spaceData?.spaceId, userId: nonEIPAddress }); + setLivekitToken(livekitToken.data); + } else if (isListener && spaceData?.spaceId) { + const livekitToken = await getLivekitRoomToken({ userType: "receiver", roomId: spaceData?.spaceId, userId: nonEIPAddress }); + setLivekitToken(livekitToken.data); + } + })(); + }, [isListener, isHost, spaceData]); + useEffect(() => { if (!spaceObjectData?.connectionData?.local?.stream || !isRequestedForMic) return; @@ -83,11 +107,13 @@ export const LiveWidgetContent: React.FC = ({ }; useEffect(() => { - if (!spaceObjectData?.connectionData?.local?.stream || promotedListener.length === 0) + // if (!spaceObjectData?.connectionData?.local?.stream || promotedListener.length === 0) + // return; + if (promotedListener.length === 0) return; const options = { - signalData: raisedHandInfo[promotedListener].signalData, + // signalData: raisedHandInfo[promotedListener].signalData, promoteeAddress: pCAIP10ToWallet( raisedHandInfo[promotedListener].senderAddress ), @@ -102,14 +128,16 @@ export const LiveWidgetContent: React.FC = ({ }, [promotedListener]); const handleAcceptPromotion = async (requesterAddress: any) => { - await spacesObjectRef?.current?.createAudioStream?.(); + // await spacesObjectRef?.current?.createAudioStream?.(); setPromotedListener(requesterAddress); + await performAction({ roomId: spaceData?.spaceId, userId: requesterAddress, canPublish: true }); }; const handleRejectPromotion = async (requesterAddress: any) => { await spacesObjectRef?.current?.rejectPromotionRequest?.({ promoteeAddress: pCAIP10ToWallet(requesterAddress), }); + await performAction({ roomId: spaceData?.spaceId, userId: requesterAddress, canPublish: false }); }; const handleJoinSpace = async () => { @@ -204,6 +232,8 @@ export const LiveWidgetContent: React.FC = ({ setPlayBackUrl(spaceObjectData?.meta); }, [spaceObjectData?.meta]); + const livekitRoom = useMemo(() => new Room(), []); + return ( = ({ justifyContent={'space-between'} padding={'6px 8px'} > - - isHost || isSpeaker ? handleMicState() : handleRequest() - } - > - Mic Icon - + + {isHost || isSpeaker - ? isMicOn - ? 'Speaking' - : 'Muted' - : isRequestedForMic - ? 'Requested' - : 'Request' + ? + + + + : + handleRequest()} + > + Mic Icon + + { + isRequestedForMic + ? 'Requested' + : 'Request' + } + + } - - + + )} + {/* + isHost || isSpeaker ? handleMicState() : handleRequest() + } + > + Mic Icon + + {isHost || isSpeaker + ? isMicOn + ? 'Speaking' + : 'Muted' + : isRequestedForMic + ? 'Requested' + : 'Request' + } + + */} - { + {/* { isHost && numberOfRequests ? {numberOfRequests} : null - } + } */} = ({ {!isHost ? 'Leave' : 'End space'} - {isListener && !isHost && playBackUrl.length > 0 && ( + {/* {isListener && !isHost && playBackUrl.length > 0 && ( - )} + )} */} ) : (