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/.github/ISSUE_TEMPLATE/BUG_REPORT.yml b/.github/ISSUE_TEMPLATE/BUG_REPORT.yml
new file mode 100644
index 000000000..5dc22b08f
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/BUG_REPORT.yml
@@ -0,0 +1,79 @@
+name: "🐛 Bug Report"
+description: Create a bug report to help us improve.
+title: "🐛 [BUG] -
"
+labels: [
+ "bug"
+]
+body:
+ - type: textarea
+ id: expected-behaviour
+ attributes:
+ label: "Expected Behaviour"
+ description: Please describe the behavior you are expecting
+ placeholder: Short and explicit description of your desired behaviour...
+ validations:
+ required: true
+ - type: textarea
+ id: current-behaviour
+ attributes:
+ label: "Current Behaviour"
+ description: Please describe the current behavior
+ placeholder: What is the current behavior?...
+ validations:
+ required: true
+ - type: textarea
+ id: reprod
+ attributes:
+ label: "Reproduction steps"
+ description: Please enter an explicit description of your issue
+ value: |
+ 1. Go to '...'
+ 2. Invoke function '...'
+ 3. See error
+ render: bash
+ validations:
+ required: true
+ - type: textarea
+ id: screenshot
+ attributes:
+ label: "Screenshots"
+ description: If applicable, add screenshots to help explain your problem.
+ value: |
+ ![DESCRIPTION](LINK.png)
+ render: bash
+ validations:
+ required: false
+ - type: textarea
+ id: logs
+ attributes:
+ label: "Relevant Logs"
+ description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
+ render: bash
+ validations:
+ required: false
+ - type: dropdown
+ id: dapp-env
+ attributes:
+ label: "Dapp Env"
+ description: What is the impacted DApp environment ?
+ multiple: true
+ options:
+ - Prod (app.push.org)
+ - Staging (staging.push.org)
+ - Dev (dev.push.org)
+ validations:
+ required: true
+ - type: dropdown
+ id: browsers
+ attributes:
+ label: "Browsers"
+ description: What browsers are you seeing the problem on ?
+ multiple: true
+ options:
+ - Firefox
+ - Chrome
+ - Safari
+ - Microsoft Edge
+ - Opera
+ validations:
+ required: false
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/DOCUMENTATION_README_ISSUE.yml b/.github/ISSUE_TEMPLATE/DOCUMENTATION_README_ISSUE.yml
new file mode 100644
index 000000000..36ad7abc6
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/DOCUMENTATION_README_ISSUE.yml
@@ -0,0 +1,35 @@
+name: "✏️ Documentation/Readme Enhancement"
+description: Suggest an enhancement in documentation/readme.
+title: "✏️ [Documentation/Readme Enhancement] - "
+labels: [
+ "documentation"
+]
+body:
+ - type: textarea
+ id: expected-behaviour
+ attributes:
+ label: "Expected Behaviour"
+ description: Please describe the behavior you are expecting
+ placeholder: Short and explicit description of your desired behaviour...
+ validations:
+ required: false
+ - type: textarea
+ id: current-behaviour
+ attributes:
+ label: "Current Behaviour"
+ description: Please describe the current behavior
+ placeholder: What is the current behavior?...
+ validations:
+ required: false
+ - type: textarea
+ id: reprod
+ attributes:
+ label: "Steps to Reproduce"
+ description: Please enter an explicit description of your issue
+ value: |
+ 1. Go to '...'
+ 2. Invoke function '...'
+ 3. See error
+ render: bash
+ validations:
+ required: false
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/IMPROVEMENT_PROPOSAL.yml b/.github/ISSUE_TEMPLATE/IMPROVEMENT_PROPOSAL.yml
new file mode 100644
index 000000000..3f062784e
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/IMPROVEMENT_PROPOSAL.yml
@@ -0,0 +1,40 @@
+name: "😈 Improvement Proposal"
+description: Suggest improvement,whether new or built upon existing features.
+title: "😈 [Improvement Proposal] - "
+labels: [
+ "Improvement proposal"
+]
+body:
+ - type: input
+ id: proposal-name
+ attributes:
+ label: "Proposal name"
+ description: Brief title or summary of the proposed improvement.
+ placeholder: Summary of the proposal improvement.
+ validations:
+ required: true
+ - type: textarea
+ id: description
+ attributes:
+ label: "Describe the Proposal"
+ description: Please describe detailed description of the improvement, including the problem it solves and the benefits it brings.
+ placeholder: Detailed description of your desired proposal...
+ validations:
+ required: true
+ - type: textarea
+ id: usecase
+ attributes:
+ label: "Use Case"
+ description: Please explain the specific use cases or scenarios where this improvement would be valuable..
+ placeholder: List down the use case.
+ validations:
+ required: true
+ - type: textarea
+ id: current-limitations
+ attributes:
+ label: "Current Limitations"
+ description: Any existing limitations, issues, or challenges with the SDK that the proposed improvement aims to address.
+ placeholder: Overview for the current problem/limitations.
+ validations:
+ required: true
+
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/OTHER.yml b/.github/ISSUE_TEMPLATE/OTHER.yml
new file mode 100644
index 000000000..21941d88a
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/OTHER.yml
@@ -0,0 +1,27 @@
+name: "👾 Other"
+description: Something that doesn't belong elsewhere.
+title: "👾 [Other] - "
+labels: [
+ "Other"
+]
+body:
+ - type: textarea
+ id: description
+ attributes:
+ label: "Description"
+ description: Please describe something
+ placeholder: Detailed description of what you wanna share...
+ validations:
+ required: true
+ - type: dropdown
+ id: dapp-env
+ attributes:
+ label: "Dapp Env"
+ description: What is the impacted DApp environment ?
+ multiple: true
+ options:
+ - Prod (app.push.org)
+ - Staging (staging.push.org)
+ - Dev (dev.push.org)
+ validations:
+ required: false
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/QUESTION_SUPPORT.yml b/.github/ISSUE_TEMPLATE/QUESTION_SUPPORT.yml
new file mode 100644
index 000000000..2085f49e5
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/QUESTION_SUPPORT.yml
@@ -0,0 +1,15 @@
+name: "❓ Question or Support Request"
+description: Questions and requests for support.
+title: "❓ [Question/Support] - "
+labels: [
+ "support"
+]
+body:
+ - type: textarea
+ id: support-request
+ attributes:
+ label: "Question or Support Request"
+ description: Describe your question or ask for support.
+ placeholder: Detailed description of your question/support request...
+ validations:
+ required: true
\ No newline at end of file
diff --git a/README.md b/README.md
index 6cc5ea396..fe14fdc1b 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@
-
+
@@ -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
+
## License
Check out our License HERE
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/.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/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 b238022be..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;
@@ -526,9 +518,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/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/notification/notification.ts b/packages/examples/sdk-backend-node/notification/notification.ts
new file mode 100644
index 000000000..2865fee94
--- /dev/null
+++ b/packages/examples/sdk-backend-node/notification/notification.ts
@@ -0,0 +1,257 @@
+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;
+
+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'
+ );
+ 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 });
+
+ // 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');
+ 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',
+ },
+ });
+ 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, signer.address],
+ {
+ notification: {
+ title: 'test',
+ body: 'test',
+ },
+ }
+ );
+ await delay(3000); // Delay added to log the events in order
+ 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');
+ // -------------------------------------------------------------------
+ // -------------------------------------------------------------------
+ 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/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-backend-node/package.json b/packages/examples/sdk-backend-node/package.json
index 97b7d47cb..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": "^1.4.17",
+ "@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..c33154a92
--- /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: 1, 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/index.ts b/packages/examples/sdk-backend-node/pushAPI/chat.ts
similarity index 69%
rename from packages/examples/sdk-backend-node/pushAPI/index.ts
rename to packages/examples/sdk-backend-node/pushAPI/chat.ts
index e14d56659..f34973ec1 100644
--- a/packages/examples/sdk-backend-node/pushAPI/index.ts
+++ b/packages/examples/sdk-backend-node/pushAPI/chat.ts
@@ -34,6 +34,7 @@ const thirdSigner = createWalletClient({
transport: http(),
});
const thirdSignerAddress = thirdSigner.account.address;
+
// Dummy Wallet Addresses
const randomWallet1 = privateKeyToAccount(generatePrivateKey()).address;
const randomWallet2 = privateKeyToAccount(generatePrivateKey()).address;
@@ -51,47 +52,10 @@ const groupImage =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==';
/***************** SAMPLE GROUP DATA ****************************/
-export const runPushAPICases = async (): Promise => {
- console.log(`
-
-██████╗░██╗░░░██╗░██████╗██╗░░██╗░█████╗░██████╗░██╗ ░█████╗░██╗░░░░░░█████╗░░██████╗░██████╗
-██╔══██╗██║░░░██║██╔════╝██║░░██║██╔══██╗██╔══██╗██║ ██╔══██╗██║░░░░░██╔══██╗██╔════╝██╔════╝
-██████╔╝██║░░░██║╚█████╗░███████║███████║██████╔╝██║ ██║░░╚═╝██║░░░░░███████║╚█████╗░╚█████╗░
-██╔═══╝░██║░░░██║░╚═══██╗██╔══██║██╔══██║██╔═══╝░██║ ██║░░██╗██║░░░░░██╔══██║░╚═══██╗░╚═══██╗
-██║░░░░░╚██████╔╝██████╔╝██║░░██║██║░░██║██║░░░░░██║ ╚█████╔╝███████╗██║░░██║██████╔╝██████╔╝
-╚═╝░░░░░░╚═════╝░╚═════╝░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░░░░╚═╝ ░╚════╝░╚══════╝╚═╝░░╚═╝╚═════╝░╚═════╝░
- `);
- // -------------------------------------------------------------------
- // -------------------------------------------------------------------
- console.log('PushAPI.initialize');
+export const runPushAPIChatCases = async (): Promise => {
const userAlice = await PushAPI.initialize(signer, { env });
const userBob = await PushAPI.initialize(secondSigner, { 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');
+ const tempUser = await PushAPI.initialize(thirdSigner, { env });
// -------------------------------------------------------------------
// -------------------------------------------------------------------
console.log('PushAPI.chat.list');
@@ -144,9 +108,9 @@ export const runPushAPICases = async (): Promise => {
// -------------------------------------------------------------------
// -------------------------------------------------------------------
console.log('PushAPI.chat.reject');
- const tempUser = await PushAPI.initialize(thirdSigner, { env });
await tempUser.chat.send(secondSignerAddress, {
- content: 'Sending Malicious message to bob',
+ content: 'Sending malicious message',
+ type: 'Text',
});
const bobRejectsRequest = await userBob.chat.reject(thirdSignerAddress);
if (showAPIResponse) {
@@ -258,26 +222,6 @@ export const runPushAPICases = async (): Promise => {
admins: [],
private: true,
});
- const rejectGrpJoiningReq = await userBob.chat.group.reject(sampleGrp.chatId);
- if (showAPIResponse) {
- console.log(rejectGrpJoiningReq);
- }
+ await userBob.chat.group.reject(sampleGrp.chatId);
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');
};
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/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'
+ );
+ }
+};
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 209522514..afc8e636e 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',
];
@@ -45,12 +45,12 @@ const skipExample = () => {
// Push Video - Run Video Use cases
export const runVideoUseCases = async (): Promise => {
console.log(`
- ██╗ ██╗██╗██████╗ ███████╗ ██████╗
- ██║ ██║██║██╔══██╗██╔════╝██╔═══██╗
- ██║ ██║██║██║ ██║█████╗ ██║ ██║
- ╚██╗ ██╔╝██║██║ ██║██╔══╝ ██║ ██║
- ╚████╔╝ ██║██████╔╝███████╗╚██████╔╝
- ╚═══╝ ╚═╝╚═════╝ ╚══════╝ ╚═════╝
+██╗░░░██╗██╗██████╗░███████╗░█████╗░
+██║░░░██║██║██╔══██╗██╔════╝██╔══██╗
+╚██╗░██╔╝██║██║░░██║█████╗░░██║░░██║
+░╚████╔╝░██║██║░░██║██╔══╝░░██║░░██║
+░░╚██╔╝░░██║██████╔╝███████╗╚█████╔╝
+░░░╚═╝░░░╚═╝╚═════╝░╚══════╝░╚════╝░
`);
if (videoLocalStream === null) {
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
+
+
+
+
+
+ );
+};
+
+export default GetGroupMemberStatusTest;
diff --git a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatProfile.tsx b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatProfile.tsx
index b889f7daf..fc8c7eefb 100644
--- a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatProfile.tsx
+++ b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatProfile.tsx
@@ -6,7 +6,7 @@ export const ChatProfileTest = () => {
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..2537443d6 100644
--- a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewComponent.tsx
+++ b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatViewComponent.tsx
@@ -1,30 +1,30 @@
import styled from 'styled-components';
import { Section } from '../components/StyledComponents';
-
+import { CreateGroupModal } from "@pushprotocol/uiweb";
import { ChatViewComponent } from '@pushprotocol/uiweb';
-
const ChatViewComponentTest = () => {
-
-
+ const chatFilterList = [
+ 'bafyreidesy6f4iu34eqccmqh55g35wu36lvlz42c63ivtmgjjhezlzdqta',
+ 'bafyreig3gs4tpwxumiz5fxypyt4omlxhvrvuj66kfoyioeshawlau6lgem',
+ ];
return (
Chat UI Test page
-
- {/* */}
-
-
-
+ {console.log('in close')}} />
+
+ console.log("BOIIII RETURNNNSSSSS")} chatId='4ac5ab85c9c3d57adbdf2dba79357e56b2f9ef0256befe750d9f93af78d2ca68' limit={10} isConnected={true} />
);
-};
+}
export default ChatViewComponentTest;
-
const ChatViewComponentCard = styled(Section)`
-height:60vh;
-`;
\ No newline at end of file
+ height: 60vh;
+`;
+//c2d544ad9d1efd5c5a593b143bf8232875c926cf28015564e70ad078b95f807e
+//4ac5ab85c9c3d57adbdf2dba79357e56b2f9ef0256befe750d9f93af78d2ca68
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..98a5bd2c7 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 53ce68f1c..cc5b89378 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`
@@ -65,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() {
@@ -119,4 +121,4 @@ const ConnectButton = () => {
);
};
-export default ConnectButton;
+export default ConnectButtonComp;
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/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/reactnative/example/ios/Podfile.lock b/packages/reactnative/example/ios/Podfile.lock
index 653b63d4d..571da8c5e 100644
--- a/packages/reactnative/example/ios/Podfile.lock
+++ b/packages/reactnative/example/ios/Podfile.lock
@@ -333,6 +333,8 @@ PODS:
- glog
- react-native-fast-openpgp (2.6.0):
- React-Core
+ - react-native-webview (13.2.2):
+ - React-Core
- React-perflogger (0.71.11)
- React-RCTActionSheet (0.71.11):
- React-Core/RCTActionSheetHeaders (= 0.71.11)
@@ -470,6 +472,7 @@ DEPENDENCIES:
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- react-native-fast-openpgp (from `../node_modules/react-native-fast-openpgp`)
+ - react-native-webview (from `../node_modules/react-native-webview`)
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
- React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
@@ -548,6 +551,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/logger"
react-native-fast-openpgp:
:path: "../node_modules/react-native-fast-openpgp"
+ react-native-webview:
+ :path: "../node_modules/react-native-webview"
React-perflogger:
:path: "../node_modules/react-native/ReactCommon/reactperflogger"
React-RCTActionSheet:
@@ -612,7 +617,8 @@ SPEC CHECKSUMS:
React-jsiexecutor: 18b5b33c5f2687a784a61bc8176611b73524ae77
React-jsinspector: b6ed4cb3ffa27a041cd440300503dc512b761450
React-logger: 186dd536128ae5924bc38ed70932c00aa740cd5b
- react-native-fast-openpgp: 079314a83e0ed2b393e213802628db8b6cfd15ac
+ react-native-fast-openpgp: 25df11a0fc3a801ef8fa6bd4335cb48c66dc5bbe
+ react-native-webview: b8ec89966713985111a14d6e4bf98d8b54bced0d
React-perflogger: e706562ab7eb8eb590aa83a224d26fa13963d7f2
React-RCTActionSheet: 57d4bd98122f557479a3359ad5dad8e109e20c5a
React-RCTAnimation: ccf3ef00101ea74bda73a045d79a658b36728a60
@@ -632,4 +638,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: c63b686a08336fbad705bcda149d6478884e7332
-COCOAPODS: 1.11.3
+COCOAPODS: 1.12.1
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/PushNotificationLowLevelAPI.md b/packages/restapi/PushNotificationLowLevelAPI.md
new file mode 100644
index 000000000..dccc871a4
--- /dev/null
+++ b/packages/restapi/PushNotificationLowLevelAPI.md
@@ -0,0 +1,1490 @@
+# PushNotificationLowLevelAPI
+
+This file documents the usage of Low Level Push Notification Functions. Visit [Developer Docs](https://docs.push.org/developers) or [Push.org](https://push.org) to learn more.
+
+# Index
+- [PushNotificationLowLevelAPI](#pushnotificationlowlevelapi)
+- [Index](#index)
+ - [For Notification](#for-notification)
+ - [Fetching user notifications](#fetching-user-notifications)
+ - [Fetching user spam notifications](#fetching-user-spam-notifications)
+ - [Fetching user subscriptions](#fetching-user-subscriptions)
+ - [Fetching channel details](#fetching-channel-details)
+ - [Searching for channel(s)](#searching-for-channels)
+ - [Opt in to a channel](#opt-in-to-a-channel)
+ - [Opt out to a channel](#opt-out-to-a-channel)
+ - [Sending notification](#sending-notification)
+ - [Direct payload for single recipient(target)](#direct-payload-for-single-recipienttarget)
+ - [Direct payload for group of recipients(subset)](#direct-payload-for-group-of-recipientssubset)
+ - [Direct payload for all recipients(broadcast)](#direct-payload-for-all-recipientsbroadcast)
+ - [IPFS payload for single recipient(target)](#ipfs-payload-for-single-recipienttarget)
+ - [IPFS payload for group of recipients(subset)](#ipfs-payload-for-group-of-recipientssubset)
+ - [IPFS payload for all recipients(broadcast)](#ipfs-payload-for-all-recipientsbroadcast)
+ - [Minimal payload for single recipient(target)](#minimal-payload-for-single-recipienttarget)
+ - [Minimal payload for a group of recipient(subset)](#minimal-payload-for-a-group-of-recipientsubset)
+ - [Minimal payload for all recipients(broadcast)](#minimal-payload-for-all-recipientsbroadcast)
+ - [Graph payload for single recipient(target)](#graph-payload-for-single-recipienttarget)
+ - [Graph payload for group of recipients(subset)](#graph-payload-for-group-of-recipientssubset)
+ - [Graph payload for all recipients(broadcast)](#graph-payload-for-all-recipientsbroadcast)
+ - [Notification Helper Utils](#notification-helper-utils)
+ - [Parsing notifications](#parsing-notifications)
+ - [Advanced Notifications (WIP)](#advanced-notifications-wip)
+ - [DEPRECATED](#deprecated)
+ - [Get a channel's subscriber list of addresses](#get-a-channels-subscriber-list-of-addresses)
+
+
+## For Notification
+
+### **Fetching user notifications**
+
+```typescript
+const notifications = await PushAPI.user.getFeeds({
+ user: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // user address in CAIP
+ env: 'staging',
+});
+```
+
+
+ Expected response (Fetching user notifications)
+
+```typescript
+// PushAPI.user.getFeeds | Response - 200 OK
+[
+ {
+ cta: 'https://idle.finance/#/governance/proposals',
+ title: 'New Proposal',
+ message:
+ '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' +
+ '\n' +
+ '[d:Proposal] : IIP-32: Add Euler staking PYT wrappers for AA tranche to IdleDAI\n' +
+ '[timestamp:1676570405.922][timestamp: 1676570405]',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeidgjepmup44yqmghcmmzp5aohj6yemjuwal3hozowp2mnxmtdjv5u/bafkreieqw4su7yuqf5ycow4ajpzjyimfl4umnnoe5fz2mq7ukrmqnesk2y',
+ url: 'https://idle.finance/',
+ sid: '3401597',
+ app: 'Idle Finance',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: {
+ body: 'New Proposal On Idle Finance',
+ title: 'Idle Finance - New Proposal',
+ },
+ secret: '',
+ },
+ {
+ cta: '',
+ title: '',
+ message: 'hi socket',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeicahk2k5jcprepvqxl7xvh5ia4wyruikvpvcrel2rt7tsuefc7ktu/bafkreihjprcvuf2er5etxh7hsvslxzbntum5fqournkrsrtvhvppwx7jqy',
+ url: 'https://www.google.com/',
+ sid: '2491520',
+ app: 'AKP Test Channel',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: { body: 'hi socket', title: 'AKP Test Channel - ' },
+ secret: '',
+ },
+ {
+ cta: '',
+ title: '',
+ message: 'hiii',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeicahk2k5jcprepvqxl7xvh5ia4wyruikvpvcrel2rt7tsuefc7ktu/bafkreihjprcvuf2er5etxh7hsvslxzbntum5fqournkrsrtvhvppwx7jqy',
+ url: 'https://www.google.com/',
+ sid: '2490919',
+ app: 'AKP Test Channel',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: { body: 'hiii', title: 'AKP Test Channel - ' },
+ secret: '',
+ },
+ {
+ cta: '',
+ title: '',
+ message: 'Hey -testing',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeifvbiegzbgyoikdxe2rqhxf2uuvrqtfmllzy2ueidzyxnqkvkuizu/bafkreia26pvmuo2ugyub7boo2zxxj6dqhwqt3gcllpotmau3t7gsvy6vfq',
+ url: 'https://gnosis.io',
+ sid: '2429211',
+ app: 'Gnosis',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: { body: 'Hey -testing', title: 'Gnosis - ' },
+ secret: '',
+ },
+ {
+ cta: '',
+ title: '',
+ message: 'Hey',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeifvbiegzbgyoikdxe2rqhxf2uuvrqtfmllzy2ueidzyxnqkvkuizu/bafkreia26pvmuo2ugyub7boo2zxxj6dqhwqt3gcllpotmau3t7gsvy6vfq',
+ url: 'https://gnosis.io',
+ sid: '2429210',
+ app: 'Gnosis',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: { body: 'Hey', title: 'Gnosis - ' },
+ secret: '',
+ },
+ {
+ cta: 'https://idle.finance/#/governance/proposals',
+ title: 'New Proposal',
+ message:
+ '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' +
+ '\n' +
+ '[d:Proposal] : IIP-31: Add AA Euler staking PYT wrappers to IdleUSDT, IdleUSDC and IdleWETH. Gauges rate to 0. Extend LM. \n' +
+ '[timestamp:1674583206.258][timestamp: 1674583206]',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeidgjepmup44yqmghcmmzp5aohj6yemjuwal3hozowp2mnxmtdjv5u/bafkreieqw4su7yuqf5ycow4ajpzjyimfl4umnnoe5fz2mq7ukrmqnesk2y',
+ url: 'https://idle.finance/',
+ sid: '1784234',
+ app: 'Idle Finance',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: {
+ body: 'New Proposal On Idle Finance',
+ title: 'Idle Finance - New Proposal',
+ },
+ secret: '',
+ },
+ {
+ cta: '',
+ title: '',
+ message: 'hi 2023',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeicahk2k5jcprepvqxl7xvh5ia4wyruikvpvcrel2rt7tsuefc7ktu/bafkreihjprcvuf2er5etxh7hsvslxzbntum5fqournkrsrtvhvppwx7jqy',
+ url: 'https://www.google.com/',
+ sid: '1132231',
+ app: 'AKP Test Channel',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: { body: 'hi 2023', title: 'AKP Test Channel - ' },
+ secret: '',
+ },
+ {
+ cta: '',
+ title: '',
+ message: 'hi',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeicahk2k5jcprepvqxl7xvh5ia4wyruikvpvcrel2rt7tsuefc7ktu/bafkreihjprcvuf2er5etxh7hsvslxzbntum5fqournkrsrtvhvppwx7jqy',
+ url: 'https://www.google.com/',
+ sid: '1132230',
+ app: 'AKP Test Channel',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: { body: 'hi', title: 'AKP Test Channel - ' },
+ secret: '',
+ },
+ {
+ cta: 'https://idle.finance/#/governance/proposals',
+ title: 'New Proposal',
+ message:
+ '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' +
+ '\n' +
+ '[d:Proposal] : IIP-30: Remove idleDAI wrapper for cpFOL-USDC (DAI) senior. Same for idleUSDC with cpWIN-USDC. Remove idleRAI, idleSUSD, idleTUSD and idleFEI from IdleController. Update voting delay in Governor \n' +
+ ' \n' +
+ '[timestamp:1672769747.911][timestamp: 1672769747]',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeidgjepmup44yqmghcmmzp5aohj6yemjuwal3hozowp2mnxmtdjv5u/bafkreieqw4su7yuqf5ycow4ajpzjyimfl4umnnoe5fz2mq7ukrmqnesk2y',
+ url: 'https://idle.finance/',
+ sid: '1080072',
+ app: 'Idle Finance',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: {
+ body: 'New Proposal On Idle Finance',
+ title: 'Idle Finance - New Proposal',
+ },
+ secret: '',
+ },
+ {
+ cta: 'https://idle.finance/#/governance/proposals',
+ title: 'New Proposal',
+ message:
+ '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' +
+ '\n' +
+ '[d:Proposal] : IIP-29: Remove idleDAI wrapper for cpFOL-USDC (DAI) senior. Same for idleUSDC with cpWIN-USDC. Remove idleRAI, idleSUSD, idleTUSD and idleFEI from IdleController. Update voting delay in Governor \n' +
+ ' \n' +
+ '[timestamp:1671624005.155][timestamp: 1671624005]',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeidgjepmup44yqmghcmmzp5aohj6yemjuwal3hozowp2mnxmtdjv5u/bafkreieqw4su7yuqf5ycow4ajpzjyimfl4umnnoe5fz2mq7ukrmqnesk2y',
+ url: 'https://idle.finance/',
+ sid: '935285',
+ app: 'Idle Finance',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: {
+ body: 'New Proposal On Idle Finance',
+ title: 'Idle Finance - New Proposal',
+ },
+ secret: '',
+ },
+];
+```
+
+
+
+---
+
+### **Fetching user spam notifications**
+
+```typescript
+const spams = await PushAPI.user.getFeeds({
+ user: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // user address in CAIP
+ spam: true,
+ env: 'staging',
+});
+```
+
+Allowed Options (params with _ are mandatory)
+| Param | Type | Default | Remarks |
+|----------|---------|---------|--------------------------------------------|
+| user_ | string | - | user account address (CAIP) |
+| page | number | 1 | page index of the results |
+| limit | number | 10 | number of items in 1 page |
+| spam | boolean | false | if "true" it will fetch spam feeds |
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+| raw | boolean | false | if "true" the method will return unformatted raw API response|
+
+
+ Expected response (Fetching user spam notifications)
+
+```typescript
+PushAPI.user.getFeeds [Spam] | Response - 200 OK
+[
+ {
+ cta: 'https://goerli.etherscan.io/tx/0xe1d230d2139b0d726d5a80713ac437bed3b55b808eb651d85d8b86a377b56aa3',
+ title: 'PUSH Tokens Received',
+ message: 'Received 500 PUSH from 0x69e666767ba3a661369e1e2f572ede7adc926029',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeih7t3hftdcfz6axqvcnszou6tfo6blrlmis3cns33jad7dqhdcjpi/Qmah3yyjjcQGtkHDRkyrs4VoXsrgyr9SqEsLekLPW2nhpb',
+ url: 'https://uniswap.org',
+ sid: '3436148',
+ app: 'Uniswap Test',
+ image: 'https://play-lh.googleusercontent.com/i911_wMmFilaAAOTLvlQJZMXoxBF34BMSzRmascHezvurtslYUgOHamxgEnMXTklsF-S',
+ blockchain: 'THE_GRAPH',
+ notification: {
+ body: 'Received 500 PUSH from 0x69e666767ba3a661369e1e2f572ede7adc926029',
+ title: 'Uniswap Test - PUSH Tokens Received'
+ },
+ secret: ''
+ },
+ {
+ cta: '',
+ title: '[sdk-test] payload title',
+ message: 'sample msg body',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihvggzdcvfbjw4bqytpbldeauc7chru3mj62wz4af7lezqvuyxj6i/QmW8vCUVk43gtm8CzAqKBUR13HK4fiaFHk7EfEnJYSonZw',
+ url: 'https://stream-2-earn.vercel.app/',
+ sid: '3258266',
+ app: 'Stream2Earn',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: {
+ body: '[sdk-test] notification BODY',
+ title: 'Stream2Earn - [SDK-TEST] notification TITLE:'
+ },
+ secret: ''
+ },
+ {
+ cta: 'https://goerli.etherscan.io/tx/0xc4a01fd9ac033b5e00b45ad52af51821add8db4f31cae93e19326aff01b4e9c7',
+ title: 'PUSH Tokens Received',
+ message: 'Received 50 PUSH from 0x7b9e036bd304fd1bea0523de718038bbe345521a',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeih7t3hftdcfz6axqvcnszou6tfo6blrlmis3cns33jad7dqhdcjpi/Qmah3yyjjcQGtkHDRkyrs4VoXsrgyr9SqEsLekLPW2nhpb',
+ url: 'https://uniswap.org',
+ sid: '2868333',
+ app: 'Uniswap Test',
+ image: 'https://play-lh.googleusercontent.com/i911_wMmFilaAAOTLvlQJZMXoxBF34BMSzRmascHezvurtslYUgOHamxgEnMXTklsF-S',
+ blockchain: 'THE_GRAPH',
+ notification: {
+ body: 'Received 50 PUSH from 0x7b9e036bd304fd1bea0523de718038bbe345521a',
+ title: 'Uniswap Test - PUSH Tokens Received'
+ },
+ secret: ''
+ },
+ {
+ cta: '',
+ title: '[sdk-test] payload title 1675241933583',
+ message: 'type:3 identity:2',
+ icon: 'na',
+ url: 'https://app.push.org',
+ sid: '2427470',
+ app: 'internal',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: {
+ body: '[sdk-test] notification BODY 1675241933583',
+ title: 'internal - [SDK-TEST] notification TITLE: 16752419'
+ },
+ secret: ''
+ },
+ {
+ cta: '',
+ title: '[sdk-test] payload title 1673154212899',
+ message: 'type:3 identity:2',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihffthqhvxdt73pe4voisz63mm2fydnrctypmh5byaglujjejjvzm/QmcHvKxoCDgN7mH2sMzFkoqDaRLUWdNMa2FbJbGRVkdF3d',
+ url: 'https://www.google.com',
+ sid: '1178703',
+ app: 'Test Channel',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: {
+ body: '[sdk-test] notification BODY 1673154212899',
+ title: 'Test Channel - [SDK-TEST] notification TITLE: 1673'
+ },
+ secret: ''
+ },
+ {
+ cta: '',
+ title: '[sdk-test] payload title 1673154141751',
+ message: 'type:3 identity:2',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihffthqhvxdt73pe4voisz63mm2fydnrctypmh5byaglujjejjvzm/QmcHvKxoCDgN7mH2sMzFkoqDaRLUWdNMa2FbJbGRVkdF3d',
+ url: 'https://www.google.com',
+ sid: '1178702',
+ app: 'Test Channel',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: {
+ body: '[sdk-test] notification BODY 1673154141751',
+ title: 'Test Channel - [SDK-TEST] notification TITLE: 1673'
+ },
+ secret: ''
+ },
+ {
+ cta: '',
+ title: '[sdk-test] payload title 1669794606748',
+ message: 'type:4 identity:2',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeih4qfevv2ms3tzognoscd5r5kenjcjjzvkzb6w6jctzcjzqoaxite/Qma13kPK6pcv8Z4Xjjw1MULfXgHxXPafp5Fqm1D9b5UXuv',
+ url: 'https://google.com',
+ sid: '839794',
+ app: 'asdf',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: {
+ body: '[sdk-test] notification BODY 1669794606748',
+ title: 'asdf - [SDK-TEST] notification TITLE: 166979460674'
+ },
+ secret: ''
+ },
+ {
+ cta: '',
+ title: '[sdk-test] payload title 1669794334167',
+ message: 'type:4 identity:2',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeih4qfevv2ms3tzognoscd5r5kenjcjjzvkzb6w6jctzcjzqoaxite/Qma13kPK6pcv8Z4Xjjw1MULfXgHxXPafp5Fqm1D9b5UXuv',
+ url: 'https://google.com',
+ sid: '839772',
+ app: 'asdf',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: {
+ body: '[sdk-test] notification BODY 1669794334167',
+ title: 'asdf - [SDK-TEST] notification TITLE: 166979433416'
+ },
+ secret: ''
+ },
+ {
+ cta: '',
+ title: '[SDK-TEST] notification TITLE: 1669793429997',
+ message: '[sdk-test] notification BODY 1669793429997',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeih4qfevv2ms3tzognoscd5r5kenjcjjzvkzb6w6jctzcjzqoaxite/Qma13kPK6pcv8Z4Xjjw1MULfXgHxXPafp5Fqm1D9b5UXuv',
+ url: 'https://google.com',
+ sid: '839723',
+ app: 'asdf',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: {
+ body: '[sdk-test] notification BODY 1669793429997',
+ title: 'asdf - [SDK-TEST] notification TITLE: 166979342999'
+ },
+ secret: ''
+ },
+ {
+ cta: '',
+ title: '[sdk-test] payload title 1668866110431',
+ message: 'type:3 identity:2',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeibmpivnqppyhg2avfnkk4v4idnfo4jvfmkdxthtkxwooaglg5kxau/QmbokNY79DDthAQ5QNc64HisnEvH7Q1Wdnay7Gg2yHqULo',
+ url: 'https://cryptobulb.io/',
+ sid: '802376',
+ app: 'CryptobulbNFT',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: {
+ body: '[sdk-test] notification BODY 1668866110431',
+ title: 'CryptobulbNFT - [SDK-TEST] notification TITLE: 166'
+ },
+ secret: ''
+ }
+]
+```
+
+
+
+---
+
+### **Fetching user subscriptions**
+
+```typescript
+const subscriptions = await PushAPI.user.getSubscriptions({
+ user: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // user address in CAIP
+ env: 'staging',
+});
+```
+
+where `subscriptions` is a list of channels `[{ channel: '0xaddress', ... }]` subscribed by the user.
+
+_Note: We can find out if a user is subscribed to a channel by checking if the channel address is present in the subscriptions list_
+
+Allowed Options (params with _ are mandatory)
+| Param | Type | Default | Remarks |
+|----------|---------|---------|--------------------------------------------|
+| user_ | string | - | user address (CAIP) |
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+
+
+ Expected response (Fetching user opted in channels / subscriptions)
+
+```typescript
+// PushAPI.user.getSubscriptions | Response - 200 OK
+[
+ { channel: '0x0000000000000000000000000000000000000000',user_settings: null },
+ { channel: '0xa3B6712fB922cdbbdce9AB22571e75d0d81B3b00',user_settings: '[{"type": 1, "user": false, "index": 1, "default": false, "description": "test1"}, {"type": 2, "user": 25, "index": 2, "default": 25, "enabled": 1, "lowerLimit": 23, "upperLimit": 35, "description": "test3"}, {"type": 2, "user": 64, "index": 3, "default": 56, "enabled": 1, "lowerLimit": 43, "upperLimit": 78, "description": "test5"}]' },
+ { channel: '0xde3aEA26fDC3ADdC1dB32baf1a058Cf0878FEac1',user_settings: null },
+ { channel: '0x69e666767Ba3a661369e1e2F572EdE7ADC926029',user_settings: null },
+ { channel: '0x466AEEf0943C5F098dBcEf3c1eEC03322E1F97eD',user_settings: null },
+ { channel: '0xcE98113b998380729B04596e3eA0255fbA138D34',user_settings: null },
+ { channel: '0xa89523351BE1e2De64937AA9AF61Ae06eAd199C7',user_settings: null },
+ { channel: '0x0a651cF7A9b60082fecdb5f30DB7914Fd7d2cf93',user_settings: null },
+ { channel: '0x0b5E9fa12C4C1946fA2f14b7271cC60541508f23',user_settings: null },
+ { channel: '0x2AEcb6DeE3652dA1dD6b54D5fd4f7D8F43DaEb78',user_settings: null },
+ { channel: '0xcB6C7b2E340D50701d45d55507f19A5cE5d72330',user_settings: null },
+ { channel: '0xB59Cdc85Cacd15097ecE4C77ed9D225014b4D56D',user_settings: null },
+ { channel: '0xA5E269eec042Bf61183DEf9911D03359597494b7',user_settings: null },
+ { channel: '0x6bf1ee9DE5D11Fa558c1FA8D8855E26C38Fa582A',user_settings: null },
+ { channel: '0x72Ac64A3aE0ab60D725980b73Ef460ED9e742cc7',user_settings: null },
+ { channel: '0xEc6CbD318CB7BA8a0fBbffF697681C0a4ADA0349',user_settings: null },
+ { channel: '0xAb9415961F58eBD6d79029bC76F261Fa65a80D3D',user_settings: null },
+ { channel: '0x08D77bD7500a07d791dD1323919C22e1FDb72224',user_settings: null },
+ { channel: '0xa1016081D6Da53b4246178eD83922C55F7171e54',user_settings: null },
+ { channel: '0x6A06014AC6BdE2906D194e63ec3b1B5B4c9C2Abb',user_settings: null },
+ { channel: '0xf69389475E082f4BeFDb9dee4a1E9fe6cd29f6e7',user_settings: null },
+ { channel: '0x9601f08b9EcB981D273B72e7f33964Cb98f977fe',user_settings: null },
+ { channel: '0x47A2910432016CA9f62B20dCE09b89d357d0c3d7',user_settings: null },
+ { channel: '0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924',user_settings: null },
+ { channel: '0x14c0157f9eEA7AEe61ba2606E75716E210b4697a',user_settings: null },
+ { channel: '0x025846389950A13292E63e4794C7D148FF57F995',user_settings: null },
+ { channel: '0x2aecb6dee3652da1dd6b54d5fd4f7d8f43daeb77',user_settings: null },
+ { channel: '0xD8634C39BBFd4033c0d3289C4515275102423681',user_settings: null },
+ { channel: '0x19fB80f16EAFCfb5BBFa07451CC5694E8932EA52',user_settings: null },
+ { channel: '0x94c3016ef3e503774630fC71F59B8Da9f7D470B7',user_settings: null },
+]
+```
+
+
+
+---
+
+### **Fetching channel details**
+
+```typescript
+const channelData = await PushAPI.channels.getChannel({
+ channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // channel address in CAIP
+ env: 'staging',
+});
+```
+
+Allowed Options (params with _ are mandatory)
+| Param | Type | Default | Remarks |
+|----------|---------|---------|--------------------------------------------|
+| channel_ | string | - | channel address (CAIP) |
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+
+
+ Expected response (Fetching channel details)
+
+```typescript
+// PushAPI.channels.getChannel | Response - 200 OK
+{
+ id: 39,
+ channel: '0xD8634C39BBFd4033c0d3289C4515275102423681',
+ ipfshash: 'bafkreia26pvmuo2ugyub7boo2zxxj6dqhwqt3gcllpotmau3t7gsvy6vfq',
+ name: 'Gnosis',
+ info: 'Gnosis builds new market mechanisms for decentralized finance.\n',
+ url: 'https://gnosis.io',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeifvbiegzbgyoikdxe2rqhxf2uuvrqtfmllzy2ueidzyxnqkvkuizu/bafkreia26pvmuo2ugyub7boo2zxxj6dqhwqt3gcllpotmau3t7gsvy6vfq',
+ processed: 1,
+ attempts: 0,
+ alias_address: '0xD8634C39BBFd4033c0d3289C4515275102423681',
+ alias_verification_event: null,
+ is_alias_verified: 1,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-02-07T16:29:27.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null
+}
+```
+
+
+
+---
+
+### **Searching for channel(s)**
+
+```typescript
+const channelsData = await PushAPI.channels.search({
+ query: 'push', // a search query
+ page: 1, // page index
+ limit: 20, // no of items per page
+ env: 'staging',
+});
+```
+
+Allowed Options (params with _ are mandatory)
+| Param | Type | Default | Remarks |
+|----------|---------|---------|--------------------------------------------|
+| query_ | string | - | search query |
+| page | number | 1 | page index of the results |
+| limit | number | 10 | number of items in 1 page |
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+
+
+ Expected response (Searching for channel)
+
+```typescript
+// PushAPI.channels.search | Response - 200 OK
+[
+ {
+ id: 58,
+ channel: '0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924',
+ ipfshash: 'QmSbRT16JVF922yAB26YxWFD6DmGsnSHm8VBrGUQnXTS74',
+ name: 'Ethereum Push Notification Service',
+ info: 'The channel provides useful information, notifications, etc to all the users of the EPNS platform. While not recommended, you can unsubcribe if you want to.',
+ url: 'https://epns.io/',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihwgapkthxi6udojr7soqetk5xx22bdy56uupivcwkriaiqzwlyiu/QmSbRT16JVF922yAB26YxWFD6DmGsnSHm8VBrGUQnXTS74',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 756,
+ },
+ {
+ id: 817,
+ channel: '0xBA36124E8af635d9d32C4cC49802cacade133a5F',
+ ipfshash: 'QmUf7zuo4NXvkijhELfHAdmm8dQVY9VqesEs4xhobLZx4f',
+ name: 'push-ap-test',
+ info: 'testing push notifications',
+ url: 'https://www.google.com',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeigyk6kqiyn2dkburguqmnlkgvos4yld4hswcjcjnxbq6c5dqs7ih4/QmUf7zuo4NXvkijhELfHAdmm8dQVY9VqesEs4xhobLZx4f',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 57,
+ },
+ {
+ id: 243,
+ channel: '0xC533ec1f876eA99088c85896F246C2ec8c7b05f9',
+ ipfshash: 'bafkreibc36t5tlygsa75w6nnkjmjieyzrohuscwzvohbj5tq6v6tgm2q4y',
+ name: 'EPNS PUSH Governance',
+ info: 'Get notifications on new proposals, grants, and stay up to date on all things PUSH Governance.',
+ url: 'https://epns.io/',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihluvteyktaz6u7it6etf7jglqckcym5h5hxoqcilen73pcrz2wkq/bafkreibc36t5tlygsa75w6nnkjmjieyzrohuscwzvohbj5tq6v6tgm2q4y',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 9,
+ },
+ {
+ id: 923,
+ channel: '0x7F69eec6cC1F619Ea8d27323d4430BbA5b739354',
+ ipfshash: 'QmeBqut7zMg4NSLbyEbUeLn2g9UnUE9fKjiVhYvWwJ3vqu',
+ name: 'Polygon Ahmedabad <> PUSH',
+ info: "You'll get cool notifications and update here.",
+ url: 'https://polygon.technology/blog/polygons-web3-made-in-india-tour-starts-rolling-with-7-guild-events-web3-education-programs',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeiaxryfpf2gzmpq7uvye2kv3slru4vvdela5onldzder3zbbt3hoom/QmeBqut7zMg4NSLbyEbUeLn2g9UnUE9fKjiVhYvWwJ3vqu',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 9,
+ },
+ {
+ id: 274,
+ channel: '0x554d29160f779Adf0a4328597cD33Ea1Df4D9Ee9',
+ ipfshash: 'bafkreichmnqqcn6tfcv5lnbbluchr3tqgbhiu45qnq56p2razdhvgnblcy',
+ name: 'Push Governance',
+ info: 'Get notifications on new proposals, grants, and stay up to date on all updates regarding PUSH Governance',
+ url: 'https://epns.io/gov',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihkfdd4lch5vvcmziowi7dmuum2pouvk3st4v5rvfxo3etcoxh7oe/bafkreichmnqqcn6tfcv5lnbbluchr3tqgbhiu45qnq56p2razdhvgnblcy',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 5,
+ },
+ {
+ id: 1242,
+ channel: '0x453552953C4e2732A38B93F7fB834e5AeF6F60f8',
+ ipfshash: 'QmU7PC7yjdPfXJTgYuuqqvvWbxTn1rE3z8iWZEcorK3VPM',
+ name: 'Test push notifications',
+ info: 'Test push notifications',
+ url: 'https://www.youtube.com',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeiarff4fukkj7fvmjuav6xvqzg5pfzyj2jcytzcbb5tdgyfzjfakfa/QmU7PC7yjdPfXJTgYuuqqvvWbxTn1rE3z8iWZEcorK3VPM',
+ processed: 1,
+ attempts: 0,
+ alias_address: '0x453552953C4e2732A38B93F7fB834e5AeF6F60f8',
+ alias_verification_event:
+ '{"aliasAddress": "0x453552953C4e2732A38B93F7fB834e5AeF6F60f8", "aliasBlockchainId": "80001"}',
+ is_alias_verified: 1,
+ alias_blockchain_id: '80001',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 5,
+ },
+ {
+ id: 210,
+ channel: '0x8DaFfe9d1b5aDB33F53aDDC183C6b91F9cb30bc7',
+ ipfshash: 'bafkreiac6g3iul2uk6r6h2x5rsthgoq2y6uw23n4gzkvstfn7rl5tjq3v4',
+ name: 'PUSH for EthDenver',
+ info: 'Get notifications about everything EPNS at ETHDenver.',
+ url: 'http://ethdenver.epns.io/',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeia2emdjy63kap2yqig3h4qlsjuawdby777osyr4rls2nyno2qsv6u/bafkreiac6g3iul2uk6r6h2x5rsthgoq2y6uw23n4gzkvstfn7rl5tjq3v4',
+ processed: 1,
+ attempts: 1,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 4,
+ },
+ {
+ id: 809,
+ channel: '0x9dFe790B3baBCBD888dA7093017a0B7A68b99937',
+ ipfshash: 'QmbrQeT4FdvYRQDrDhVvZ9XMhs2TUNSA7UHc4M53vvNcKK',
+ name: 'Push-Graph Test',
+ info: 'This channel is to test subgraph notifications.',
+ url: 'https://push.org/',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihniwj5eflkxah7feqdgjnfuoyeq5iw4ka7qze3h6hdxsydx3gx3e/QmbrQeT4FdvYRQDrDhVvZ9XMhs2TUNSA7UHc4M53vvNcKK',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-02-03T12:26:00.000Z',
+ blocked: 0,
+ counter: 18,
+ subgraph_details: '60+aiswaryawalter/push-graph-test',
+ subscriber_count: 4,
+ },
+ {
+ id: 956,
+ channel: '0x85Cb63e3D8cEf31a421e59b6678bF0444Fa5d8BE',
+ ipfshash: 'QmUAgUYKteWdpcWkKmNtySGY5w7XkRpUYdYtqcSfEfXzLP',
+ name: 'Transfer PUSHNOTIFICATION',
+ info: 'Notification for Transfer',
+ url: 'https://push.org/',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeidwsc4kws4fvzzsdj5e46re46qmwxmgidouhcfeel34xmhxbqbroe/QmUAgUYKteWdpcWkKmNtySGY5w7XkRpUYdYtqcSfEfXzLP',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 4,
+ },
+ {
+ id: 967,
+ channel: '0xa45bdc5B11ce6F0952401bE35156398d8c40Ce64',
+ ipfshash: 'QmPWEKaJsfVweeyWT5bCftXDnbDFMgqw3sVpTnKtd3fH5a',
+ name: 'Push Graph Notif',
+ info: 'Subgraph notification test',
+ url: 'https://push.org/',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihlt5qyhs3g3ii5vrrhb4evcsltoa6bssb2qiuh3bamxx4ndorkr4/QmPWEKaJsfVweeyWT5bCftXDnbDFMgqw3sVpTnKtd3fH5a',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-02-03T12:26:00.000Z',
+ blocked: 0,
+ counter: 18,
+ subgraph_details: '60+aiswaryawalter/push-graph-test',
+ subscriber_count: 4,
+ },
+ {
+ id: 1425,
+ channel: '0x49403ae592C82fc3f861cD0b9738f7524Fb1F38C',
+ ipfshash: 'QmZ1t5upH5zHxvzefWppVNfv7ciacrDq9VUL3SZJ7trnNz',
+ name: 'SuperPush',
+ info: 'Create, Update and Delete Superfluid streams seemlessly and get alerted to your device with Push Notifications for every actions.',
+ url: 'https://www.superfluid.finance/',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeibfnawzeadz7d2exw2ncbytanzwjb3mdkx74whga5b5scz6mmuymu/QmZ1t5upH5zHxvzefWppVNfv7ciacrDq9VUL3SZJ7trnNz',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 0,
+ verified_status: 0,
+ timestamp: '2023-02-18T21:02:50.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 4,
+ },
+ {
+ id: 1659,
+ channel: '0x43097889162A9f2b7D85104f16aB7aB090056975',
+ ipfshash: 'QmQKuiR9nZw46pnrW16J7GZTsg3hteh93mWHcHV5Khrj24',
+ name: 'Push Protocol Demo',
+ info: 'A demo channel for testing out Push Protocol',
+ url: 'https://youtube.com',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeiaadvr565fk5mkam4hlmnaxdb7lxemfcffzqd24berqxw6sf3efny/QmQKuiR9nZw46pnrW16J7GZTsg3hteh93mWHcHV5Khrj24',
+ processed: 1,
+ attempts: 1,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-02-20T04:40:04.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 4,
+ },
+ {
+ id: 287,
+ channel: '0x72F569DE6d77B1D4C3810767865FC706A1C39915',
+ ipfshash: 'bafkreidlxu5pnjeamnriukkqskv4v6ndfz5nifb2adrqwsvqiypg4oq4yi',
+ name: 'Push for DevConnect',
+ info: 'Stay upto date on all the happenings at DevConnect',
+ url: 'https://devconnect.org/schedule',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeicgoxqjc3trzthp4chvdwyfe2nqm5lfaumkyztvm6vh6anwzztuty/bafkreidlxu5pnjeamnriukkqskv4v6ndfz5nifb2adrqwsvqiypg4oq4yi',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 3,
+ },
+ {
+ id: 369,
+ channel: '0x2b107f1B57F2A381dc8c09F8786FA3bdb3c70b27',
+ ipfshash: 'bafkreicnfx2wfjlphaoe7d3vttegbomdoc55n43p2r7wzpg2zzu2zcelrq',
+ name: 'Dapp Push notifications',
+ info: 'A channel to test out dapp push notifications',
+ url: 'animepahe.com',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihwyx4s5pv7afk7hskcvtz4j5o7yqkdwtb3t6mqsueqer4lbk53wy/bafkreicnfx2wfjlphaoe7d3vttegbomdoc55n43p2r7wzpg2zzu2zcelrq',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 3,
+ },
+ {
+ id: 445,
+ channel: '0x24a8E20a63DC3149BD7Ee136632161cDb8857522',
+ ipfshash: 'bafkreigglf54mwxxxzfhbexbyqgolyry4wfxkxvmxo3xojt6765rgi2r34',
+ name: 'Push Token Alerter',
+ info: 'Push Token alerter',
+ url: 'https://epns.io/',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeiaxnibay6ezfwmsytoiilcppa7piutbdzqzmm6vfcqi7wrmlx4qmm/bafkreigglf54mwxxxzfhbexbyqgolyry4wfxkxvmxo3xojt6765rgi2r34',
+ processed: 1,
+ attempts: 2,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 3,
+ },
+ {
+ id: 735,
+ channel: '0x76AF8b0ED41EEBda6Eb2aA7991e0564cCFD1eC1F',
+ ipfshash: 'QmeMSv9UrL5znYJoLkJgKnivzaN67WnfCWB7donSx8AbXP',
+ name: 'Push x Polygon',
+ info: 'Push x Polygon Integration',
+ url: 'https://push.org',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeiejlm3hfthuprnxyqj4onxnm3gy2tuygubaaapgw2bdhuqhhqggq4/QmeMSv9UrL5znYJoLkJgKnivzaN67WnfCWB7donSx8AbXP',
+ processed: 1,
+ attempts: 0,
+ alias_address: '0x76AF8b0ED41EEBda6Eb2aA7991e0564cCFD1eC1F',
+ alias_verification_event:
+ '{"aliasAddress": "0x76AF8b0ED41EEBda6Eb2aA7991e0564cCFD1eC1F", "aliasBlockchainId": "80001"}',
+ is_alias_verified: 1,
+ alias_blockchain_id: '80001',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 3,
+ },
+ {
+ id: 737,
+ channel: '0x0fEdC054075d14CF941A5cC62d22EBE9ad5de742',
+ ipfshash: 'QmZ3VQ87hNLeda2bgmvwZhKDaMgEboDVgGqTYktJGVNggG',
+ name: 'SeaLightPush',
+ info: 'Decentralized Exchange',
+ url: 'Https://SealightSwap.org',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeicn4gmyg5gq3u3eoo5lbkuo4pbstrhw6uu2u6lgx6yd43e6zgxyg4/QmZ3VQ87hNLeda2bgmvwZhKDaMgEboDVgGqTYktJGVNggG',
+ processed: 1,
+ attempts: 0,
+ alias_address: '0x0fEdC054075d14CF941A5cC62d22EBE9ad5de742',
+ alias_verification_event:
+ '{"aliasAddress": "0x0fEdC054075d14CF941A5cC62d22EBE9ad5de742", "aliasBlockchainId": "80001"}',
+ is_alias_verified: 1,
+ alias_blockchain_id: '80001',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 3,
+ },
+ {
+ id: 929,
+ channel: '0x983d0aD6D9c8778889311bC0E45DE417E9D74a90',
+ ipfshash: 'QmcqBzru5FFJDvLk7SYGEFYhgz9bokU77DWL4Kzt3NEDEJ',
+ name: 'Push amplify',
+ info: 'This channel will be used to test Push amplify features, and UI changes.',
+ url: 'https://twitter.com/pranshu3196',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihkrzovmnbscultfjfrnjqnsfqmrhrjuvnnokjwm35n7gcqy7xefi/QmcqBzru5FFJDvLk7SYGEFYhgz9bokU77DWL4Kzt3NEDEJ',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 3,
+ },
+ {
+ id: 1039,
+ channel: '0xc092d5Aa8c23165484486F246C828e4980b6C707',
+ ipfshash: 'QmXc2CE1c9fR34HVmkwQNaHRUvt7YxtiUcJfpBSbKTyBzD',
+ name: 'testPushHack',
+ info: 'test',
+ url: 'https://iamzub.in',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeia6djth6wbxpkujkxuftbkeot6d6atnhtyfb5k3bn5metcyj2pk3q/QmXc2CE1c9fR34HVmkwQNaHRUvt7YxtiUcJfpBSbKTyBzD',
+ processed: 1,
+ attempts: 1,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 3,
+ },
+ {
+ id: 1241,
+ channel: '0x11EaB508c309595F14E363e6a8d434BEab91eEBC',
+ ipfshash: 'QmZm14LgHZB2hYHcENkJNhrrL11QRKDCpX3AeVmXEiy2Hq',
+ name: 'Test for push',
+ info: 'Test for push',
+ url: 'https://www.youtube.com',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeicnv3jv7ylfxqgb5cqyzzi4lumbjeqyimcljewqbexszjrqeqkn5m/QmZm14LgHZB2hYHcENkJNhrrL11QRKDCpX3AeVmXEiy2Hq',
+ processed: 1,
+ attempts: 0,
+ alias_address: '0x11EaB508c309595F14E363e6a8d434BEab91eEBC',
+ alias_verification_event:
+ '{"aliasAddress": "0x11EaB508c309595F14E363e6a8d434BEab91eEBC", "aliasBlockchainId": "80001"}',
+ is_alias_verified: 1,
+ alias_blockchain_id: '80001',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 3,
+ },
+];
+```
+
+
+
+---
+
+### **Opt in to a channel**
+
+```typescript
+await PushAPI.channels.subscribe({
+ signer: _signer,
+ channelAddress: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // channel address in CAIP
+ userAddress: 'eip155:5:0x52f856A160733A860ae7DC98DC71061bE33A28b3', // user address in CAIP
+ onSuccess: () => {
+ console.log('opt in success');
+ },
+ onError: () => {
+ console.error('opt in error');
+ },
+ env: 'staging',
+});
+```
+
+Allowed Options (params with _ are mandatory)
+| Param | Type | Default | Remarks |
+|----------|---------|---------|--------------------------------------------|
+| signer_ | - | - | Signer object |
+| channelAddress* | string | - | channel address (CAIP) |
+| userAddress* | string | - | user address (CAIP) | |
+| verifyingContractAddress | string | - | Push communicator contract address|
+| onSuccess | function | - | on success callback |
+| onError | function | - | on error callback |
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+
+
+ Expected response (Opt in to channel)
+
+```typescript
+// PushAPI.channels.subscribe | Response - 204
+{ status: 204, message: 'successfully opted into channel' }
+
+```
+
+
+
+---
+
+### **Opt out to a channel**
+
+```typescript
+await PushAPI.channels.unsubscribe({
+ signer: _signer,
+ channelAddress: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // channel address in CAIP
+ userAddress: 'eip155:5:0x52f856A160733A860ae7DC98DC71061bE33A28b3', // user address in CAIP
+ onSuccess: () => {
+ console.log('opt out success');
+ },
+ onError: () => {
+ console.error('opt out error');
+ },
+ env: 'staging',
+});
+```
+
+Allowed Options (params with _ are mandatory)
+| Param | Type | Default | Remarks |
+|----------|---------|---------|--------------------------------------------|
+| signer_ | - | - | Signer object |
+| channelAddress* | string | - | channel address (CAIP) |
+| userAddress* | string | - | user address (CAIP) | |
+| verifyingContractAddress | string | - | Push communicator contract address|
+| onSuccess | function | - | on success callback |
+| onError | function | - | on error callback |
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+
+
+ Expected response (Opt out of a channel)
+
+```typescript
+// PushAPI.channels.unsubscribe | Response - 204
+{ status: 204, message: 'successfully opted out channel' }
+```
+
+
+
+---
+
+### **Sending notification**
+
+```typescript
+async function sendNotification(options: {
+ senderType?: 0 | 1;
+ signer: any;
+ type: NOTIFICATION_TYPE;
+ identityType: IDENTITY_TYPE;
+ notification?: {
+ title: string;
+ body: string;
+ };
+ payload?: {
+ sectype?: string;
+ title: string;
+ body: string;
+ cta: string;
+ img: string;
+ metadata?: any;
+ additionalMeta?: any;
+ };
+ recipients?: string | string[]; // CAIP or plain ETH
+ channel: string; // CAIP or plain ETH
+ expiry?: number;
+ hidden?: boolean;
+ graph?: {
+ id: string;
+ counter: number;
+ };
+ ipfsHash?: string;
+ env?: ENV;
+ chatId?: string;
+ pgpPrivateKey?: string;
+});
+```
+
+Allowed Options (params with _ are mandatory)
+| Param | Type | Default | Remarks |
+|----------|---------|---------|--------------------------------------------|
+| senderType_ | number | 0 | 0 for channel notification. 1 for chat notification |
+| signer* | - | - | Signer object |
+| channel* | string | - | channel address (CAIP) |
+| type* | number | - | Notification Type
Target = 3 (send to 1 address),
Subset = 4 (send to 1 or more addresses),
Broadcast = 1 (send to all addresses) |
+| identityType* | number | - | Identity Type
Minimal = 0,
IPFS = 1,
Direct Payload = 2,
Subgraph = 3 } |
+| recipients* | string or string[] | - | for Notification Type = Target it is 1 address,
for Notification Type = Subset, Broadcast it is an array of addresses (CAIP) |
+| notification.title* | string | - | Push Notification Title (not required for identityType IPFS, Subgraph)|
+| notification.body\* | string | - | Push Notification Body (not required for identityType IPFS, Subgraph)|
+| payload.title | string | - | Notification Title (not required for identityType IPFS, Subgraph)|
+| payload.body | string | - | Notification Body (not required for identityType IPFS, Subgraph)|
+| payload.cta | string | - | Notification Call To Action url (not required for identityType IPFS, Subgraph)|
+| payload.img | string | - | Notification Media url (not required for identityType IPFS, Subgraph)|
+| payload.sectype | string | - | If Secret Notification then pass (not required for identityType IPFS, Subgraph)|
+| graph.id | string | - | graph id, required only if the identityType is 3 |
+| graph.counter | string | - | graph counter, required only if the identityType is 3 |
+| ipfsHash | string | - | ipfsHash, required only if the identityType is 1 |
+| expiry | number | - | (optional) epoch value if the notification has an expiry |
+| hidden | boolean | false | (optional) true if we want to hide the notification |
+| pgpPrivateKey | string | - | (optional) pgp private key for new notification verification proof |
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+
+#### **Direct payload for single recipient(target)**
+
+```typescript
+// apiResponse?.status === 204, if sent successfully!
+const apiResponse = await PushAPI.payloads.sendNotification({
+ signer: _signer,
+ type: PushAPI.payloads.NOTIFICATION_TYPE.TARGETTED, // target
+ identityType: PushAPI.payloads.IDENTITY_TYPE.DIRECT_PAYLOAD, // direct payload
+ notification: {
+ title: `[SDK-TEST] notification TITLE:`,
+ body: `[sdk-test] notification BODY`,
+ },
+ payload: {
+ title: `[sdk-test] payload title`,
+ body: `sample msg body`,
+ cta: '',
+ img: '',
+ },
+ recipients: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // recipient address
+ channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
+ env: 'staging',
+});
+```
+
+#### **Direct payload for group of recipients(subset)**
+
+```typescript
+// apiResponse?.status === 204, if sent successfully!
+const apiResponse = await PushAPI.payloads.sendNotification({
+ signer: _signer,
+ type: 4, // subset
+ identityType: 2, // direct payload
+ notification: {
+ title: `[SDK-TEST] notification TITLE:`,
+ body: `[sdk-test] notification BODY`,
+ },
+ payload: {
+ title: `[sdk-test] payload title`,
+ body: `sample msg body`,
+ cta: '',
+ img: '',
+ },
+ recipients: [
+ 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681',
+ 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1',
+ ], // recipients addresses
+ channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
+ env: 'staging',
+});
+```
+
+#### **Direct payload for all recipients(broadcast)**
+
+```typescript
+// apiResponse?.status === 204, if sent successfully!
+const apiResponse = await PushAPI.payloads.sendNotification({
+ signer: _signer,
+ type: PushAPI.payloads.NOTIFICATION_TYPE.BROADCAST, // broadcast
+ identityType: PushAPI.payloads.IDENTITY_TYPE.DIRECT_PAYLOAD, // direct payload
+ notification: {
+ title: `[SDK-TEST] notification TITLE:`,
+ body: `[sdk-test] notification BODY`,
+ },
+ payload: {
+ title: `[sdk-test] payload title`,
+ body: `sample msg body`,
+ cta: '',
+ img: '',
+ },
+ channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
+ env: 'staging',
+});
+```
+
+#### **IPFS payload for single recipient(target)**
+
+```typescript
+// apiResponse?.status === 204, if sent successfully!
+const apiResponse = await PushAPI.payloads.sendNotification({
+ signer: _signer,
+ type: PushAPI.payloads.NOTIFICATION_TYPE.TARGETTED, // target
+ identityType: PushAPI.payloads.IDENTITY_TYPE.IPFS, // ipfs payload
+ ipfsHash: 'bafkreicuttr5gpbyzyn6cyapxctlr7dk2g6fnydqxy6lps424mcjcn73we', // IPFS hash of the payload
+ recipients: 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1', // recipient address
+ channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
+ env: 'staging',
+});
+```
+
+#### **IPFS payload for group of recipients(subset)**
+
+```typescript
+// apiResponse?.status === 204, if sent successfully!
+const apiResponse = await PushAPI.payloads.sendNotification({
+ signer: _signer,
+ type: PushAPI.payloads.NOTIFICATION_TYPE.SUBSET, // subset
+ identityType: PushAPI.payloads.IDENTITY_TYPE.IPFS, // ipfs payload
+ ipfsHash: 'bafkreicuttr5gpbyzyn6cyapxctlr7dk2g6fnydqxy6lps424mcjcn73we', // IPFS hash of the payload
+ recipients: [
+ 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1',
+ 'eip155:5:0x52f856A160733A860ae7DC98DC71061bE33A28b3',
+ ], // recipients addresses
+ channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
+ env: 'staging',
+});
+```
+
+#### **IPFS payload for all recipients(broadcast)**
+
+```typescript
+// apiResponse?.status === 204, if sent successfully!
+const apiResponse = await PushAPI.payloads.sendNotification({
+ signer: _signer,
+ type: PushAPI.payloads.NOTIFICATION_TYPE.BROADCAST, // broadcast
+ identityType: PushAPI.payloads.IDENTITY_TYPE.DIRECT_PAYLOAD, // direct payload
+ ipfsHash: 'bafkreicuttr5gpbyzyn6cyapxctlr7dk2g6fnydqxy6lps424mcjcn73we', // IPFS hash of the payload
+ channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
+ env: 'staging',
+});
+```
+
+#### **Minimal payload for single recipient(target)**
+
+```typescript
+// apiResponse?.status === 204, if sent successfully!
+const apiResponse = await PushAPI.payloads.sendNotification({
+ signer: _signer,
+ type: PushAPI.payloads.NOTIFICATION_TYPE.TARGETTED, // target
+ identityType: PushAPI.payloads.IDENTITY_TYPE.MINIMAL, // Minimal payload
+ notification: {
+ title: `[SDK-TEST] notification TITLE:`,
+ body: `[sdk-test] notification BODY`,
+ },
+ payload: {
+ title: `[sdk-test] payload title`,
+ body: `sample msg body`,
+ cta: '',
+ img: '',
+ },
+ recipients: 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1', // recipient address
+ channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
+ env: 'staging',
+});
+```
+
+#### **Minimal payload for a group of recipient(subset)**
+
+```typescript
+// apiResponse?.status === 204, if sent successfully!
+const apiResponse = await PushAPI.payloads.sendNotification({
+ signer: _signer,
+ type: PushAPI.payloads.NOTIFICATION_TYPE.SUBSET, // subset
+ identityType: PushAPI.payloads.IDENTITY_TYPE.MINIMAL, // Minimal payload
+ notification: {
+ title: `[SDK-TEST] notification TITLE:`,
+ body: `[sdk-test] notification BODY`,
+ },
+ payload: {
+ title: `[sdk-test] payload title`,
+ body: `sample msg body`,
+ cta: '',
+ img: '',
+ },
+ recipients: [
+ 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1',
+ 'eip155:5:0x52f856A160733A860ae7DC98DC71061bE33A28b3',
+ ], // recipients address
+ channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
+ env: 'staging',
+});
+```
+
+#### **Minimal payload for all recipients(broadcast)**
+
+```typescript
+// apiResponse?.status === 204, if sent successfully!
+const apiResponse = await PushAPI.payloads.sendNotification({
+ signer: _signer,
+ type: PushAPI.payloads.NOTIFICATION_TYPE.BROADCAST, // broadcast
+ identityType: PushAPI.payloads.IDENTITY_TYPE.MINIMAL, // Minimal payload
+ notification: {
+ title: `[SDK-TEST] notification TITLE:`,
+ body: `[sdk-test] notification BODY`,
+ },
+ payload: {
+ title: `[sdk-test] payload title`,
+ body: `sample msg body`,
+ cta: '',
+ img: '',
+ },
+ channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
+ env: 'staging',
+});
+```
+
+#### **Graph payload for single recipient(target)**
+
+**_Make sure the channel has the graph id you are providing!!_**
+
+```typescript
+// apiResponse?.status === 204, if sent successfully!
+const apiResponse = await PushAPI.payloads.sendNotification({
+ signer: _signer,
+ type: PushAPI.payloads.NOTIFICATION_TYPE.TARGETTED, // target
+ identityType: PushAPI.payloads.IDENTITY_TYPE.SUBGRAPH, // Subgraph payload
+ graph: {
+ id: '_your_graph_id',
+ counter: 3,
+ },
+ recipients: 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1', // recipient address
+ channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
+ env: 'staging',
+});
+```
+
+#### **Graph payload for group of recipients(subset)**
+
+**_Make sure the channel has the graph id you are providing!!_**
+
+```typescript
+// apiResponse?.status === 204, if sent successfully!
+const apiResponse = await PushAPI.payloads.sendNotification({
+ signer: _signer,
+ type: PushAPI.payloads.NOTIFICATION_TYPE.SUBSET, // subset
+ identityType: PushAPI.payloads.IDENTITY_TYPE.SUBGRAPH, // graph payload
+ graph: {
+ id: '_your_graph_id',
+ counter: 3,
+ },
+ recipients: [
+ 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1',
+ 'eip155:5:0x52f856A160733A860ae7DC98DC71061bE33A28b3',
+ ], // recipients addresses
+ channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
+ env: 'staging',
+});
+```
+
+#### **Graph payload for all recipients(broadcast)**
+
+**_Make sure the channel has the graph id you are providing!!_**
+
+```typescript
+// apiResponse?.status === 204, if sent successfully!
+const apiResponse = await PushAPI.payloads.sendNotification({
+ signer: _signer,
+ type: PushAPI.payloads.NOTIFICATION_TYPE.BROADCAST, // broadcast
+ identityType: PushAPI.payloads.IDENTITY_TYPE.SUBGRAPH, // graph payload
+ graph: {
+ id: '_your_graph_id',
+ counter: 3,
+ },
+ channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
+ env: 'staging',
+});
+```
+
+
+ Expected response (Send Notification)
+
+```typescript
+// PushAPI.payloads.sendNotification | Response - 204 OK
+```
+
+
+
+---
+
+### Notification Helper Utils
+
+#### **Parsing notifications**
+
+Utils method to parse raw Push Feeds API response into a pre-defined shape as below.
+
+```typescript
+// fetch some raw feeds data
+const apiResponse = await PushAPI.user.getFeeds({
+ user: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // user address
+ raw: true,
+ env: 'staging',
+});
+// parse it to get a specific shape of object.
+const parsedResults = PushAPI.utils.parseApiResponse(apiResponse);
+
+const [oneNotification] = parsedResults;
+
+// Now this object can be directly used by for e.g. "@pushprotocol/uiweb" NotificationItem component as props.
+
+const {
+ cta,
+ title,
+ message,
+ app,
+ icon,
+ image,
+ url,
+ blockchain,
+ secret,
+ notification,
+} = oneNotification;
+```
+
+_We get the above `keys` after the parsing of the API repsonse._
+
+---
+
+### Advanced Notifications (WIP)
+
+### DEPRECATED
+
+#### **Get a channel's subscriber list of addresses**
+
+```typescript
+const subscribers = await PushAPI.channels.getSubscribers({
+ channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // channel address in CAIP
+ page: 1, // Optional, defaults to 1
+ limit : 10 // Optional, defaults to 10
+ env: 'staging'
+});
+```
+
+Allowed Options (params with _ are mandatory)
+| Param | Type | Default | Remarks |
+|----------|---------|---------|--------------------------------------------|
+| channel_ | string | - | channel address (CAIP) |
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+
+
+ Expected response (Get channel's subscribers list)
+
+```typescript
+// PushAPI.channels.getSubscribers | Response - 200 OK
+{
+ "itemcount": 11,
+ "subscribers": [
+ "0x1d4f52775344f9a32093af0ccd03a4fb6dac8e30",
+ "0x28d615edd8404f8ca1e0271a0b5a48171589921a",
+ "0x4352639b99689069f9b0b847eee349c3c1b0706c",
+ "0x50029e62540537045bcfd3d320483865344edb33",
+ "0x5ac9e6205eaca2bbba6ef716fd9aabd76326eeee",
+ "0x778d3206374f8ac265728e18e3fe2ae6b93e4ce4",
+ "0xa44f2994750cf774eab05751d90ade4dedabe7fe",
+ "0xbcfb7da1dcf40e8cfb331683bb7d6f4eba091b08",
+ "0xcf5dbf241fc65a5af56c95101ac4e9ec2c57d941",
+ "0xd8634c39bbfd4033c0d3289c4515275102423681"
+ ]
+}
+```
+
+
+
+---
\ No newline at end of file
diff --git a/packages/restapi/README.md b/packages/restapi/README.md
index d38862a06..ccca693d7 100644
--- a/packages/restapi/README.md
+++ b/packages/restapi/README.md
@@ -18,32 +18,50 @@ This package gives access to Push Protocol (Push Nodes) APIs. Visit [Developer D
- [Push core contract address](#push-core-contract-address)
- [Push communicator contract address](#push-communicator-contract-address)
- [SDK Features](#sdk-features)
- - [For Notification](#for-notification)
- - [Fetching user notifications](#fetching-user-notifications)
- - [Fetching user spam notifications](#fetching-user-spam-notifications)
- - [Fetching user subscriptions](#fetching-user-subscriptions)
- - [Fetching channel details](#fetching-channel-details)
- - [Searching for channel(s)](#searching-for-channels)
- - [Opt in to a channel](#opt-in-to-a-channel)
- - [Opt out to a channel](#opt-out-to-a-channel)
- - [Sending notification](#sending-notification)
- - [Direct payload for single recipient(target)](#direct-payload-for-single-recipienttarget)
- - [Direct payload for group of recipients(subset)](#direct-payload-for-group-of-recipientssubset)
- - [Direct payload for all recipients(broadcast)](#direct-payload-for-all-recipientsbroadcast)
- - [IPFS payload for single recipient(target)](#ipfs-payload-for-single-recipienttarget)
- - [IPFS payload for group of recipients(subset)](#ipfs-payload-for-group-of-recipientssubset)
- - [IPFS payload for all recipients(broadcast)](#ipfs-payload-for-all-recipientsbroadcast)
- - [Minimal payload for single recipient(target)](#minimal-payload-for-single-recipienttarget)
- - [Minimal payload for a group of recipient(subset)](#minimal-payload-for-a-group-of-recipientsubset)
- - [Minimal payload for all recipients(broadcast)](#minimal-payload-for-all-recipientsbroadcast)
- - [Graph payload for single recipient(target)](#graph-payload-for-single-recipienttarget)
- - [Graph payload for group of recipients(subset)](#graph-payload-for-group-of-recipientssubset)
- - [Graph payload for all recipients(broadcast)](#graph-payload-for-all-recipientsbroadcast)
- - [Notification Helper Utils](#notification-helper-utils)
- - [Parsing notifications](#parsing-notifications)
- - [Advanced Notifications (WIP)](#advanced-notifications-wip)
- - [DEPRECATED](#deprecated)
- - [Get a channel's subscriber list of addresses](#get-a-channels-subscriber-list-of-addresses)
+ - [PushNotification Class](#pushnotification-class)
+ - [Initialize](#initialize)
+ - [Fetch Inbox Or Spam notifications](#fetch-inbox-or-spam-notifications)
+ - [Fetch user subscriptions](#fetch-user-subscriptions)
+ - [Subscribe to a channel](#subscribe-to-a-channel)
+ - [Unsubscribe to a channel](#unsubscribe-to-a-channel)
+ - [Channel information](#channel-information)
+ - [Search Channels](#search-channels)
+ - [Get Subscribers Of A Channel](#get-subscribers-of-a-channel)
+ - [Send a notification](#send-a-notification)
+ - [Create a channel](#create-a-channel)
+ - [Update channel information](#update-channel-information)
+ - [Verify a channel](#verify-a-channel)
+ - [Create channel Setting (WIP)](#create-channel-setting)
+ - [Get delegators information](#get-delegators-information)
+ - [Add delegator to a channel or alias](#add-delegator-to-a-channel-or-alias)
+ - [Remove delegator from a channel or alias](#remove-delegator-from-a-channel-or-alias)
+ - [Alias Information](#alias-information)
+ - [Stream Notifications](#stream-notifications)
+ - [PushChat Class](#pushchat-class)
+ - [Initialize](#initialize)
+ - [Fetch Info](#fetch-info)
+ - [Fetch Profile Info](#fetch-profile-info)
+ - [Update Profile Info](#update-profile-info)
+ - [Fetch Latest Chat](#fetch-latest-chat)
+ - [Fetch Chat History](#fetch-chat-history)
+ - [Send Message](#send-message)
+ - [Accept Chat Request](#accept-chat-request)
+ - [Reject Chat Request](#reject-chat-request)
+ - [Block Chat User](#block-chat-user)
+ - [Unblock Chat User](#unblock-chat-user)
+ - [Create Group](#create-group)
+ - [Fetch Group Info](#fetch-group-info)
+ - [Fetch Group Permission](#fetch-group-permissions)
+ - [Update Group](#update-group)
+ - [Add To Group](#add-to-group)
+ - [Remove From Group](#remove-from-group)
+ - [Join Group](#join-group)
+ - [Leave Group](#leave-group)
+ - [Reject Group Joining Request](#reject-group-joining-request)
+ - [Fetch Encryption Info](#fetch-encryption-info)
+ - [Update Encryption](#update-encryption)
+ - [Stream Chat Events](#stream-chat-events)
+ - [Stream Chat Ops Events](#stream-chat-ops-events)
- [For Video](#for-video)
- [Instance Variables](#instance-variables)
- [peerInstance](#peerinstance)
@@ -80,30 +98,6 @@ This package gives access to Push Protocol (Push Nodes) APIs. Visit [Developer D
- [Fetching list of user spaces](#fetching-list-of-user-spaces)
- [Fetching list of user space requests](#fetching-list-of-user-space-requests)
- [Fetching list of trending spaces](#fetching-list-of-trending-spaces)
- - [PushAPI Class](#pushapi-class)
- - [Initialize](#initialize)
- - [Fetch Info](#fetch-info)
- - [Fetch Profile Info](#fetch-profile-info)
- - [Update Profile Info](#update-profile)
- - [Fetch Latest Chat](#fetch-latest-chat)
- - [Fetch Chat History](#fetch-chat-history)
- - [Send Message](#send-message)
- - [Accept Chat Request](#accept-chat-request)
- - [Reject Chat Request](#reject-chat-request)
- - [Block Chat User](#block-chat-user)
- - [Unblock Chat User](#unblock-chat-user)
- - [Create Group](#create-group)
- - [Fetch Group Info](#fetcg-group-info)
- - [Fetch Group Permission](#fetch-group-permissions)
- - [Update Group Info](#update-group-info)
- - [Add To Group](#add-to-group)
- - [Remove From Group](#remove-from-group)
- - [Join Group](#join-group)
- - [Leave Group](#leave-group)
- - [Reject Group Joining Request](#reject-group-joining-request)
- - [Fetch Encryption Info](#fetch-encryption-info)
- - [Update Encryption](#update-encryption)
-
# How to use in your app?
## Installation
@@ -181,4041 +175,3942 @@ Binance Mainnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
Binance Testnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
Optimism Mainnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
Optimism Testnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
+Arbitrum Mainnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
+Arbitrum One Testnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
```
# SDK Features
-## For Notification
-### **Fetching user notifications**
+## For Video
+
+### **Instance Variables**
+
+#### **peerInstance**
+
+- Used to store the simple peer instance used for the webRTC connection.
```typescript
-const notifications = await PushAPI.user.getFeeds({
- user: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // user address in CAIP
- env: 'staging',
-});
+private peerInstance: any = null;
```
-
- Expected response (Fetching user notifications)
+---
+
+#### **signer**
+
+- Used to store the signer of a user.
+- Used in the request, acceptRequest and disconnect methods to send notifications.
```typescript
-// PushAPI.user.getFeeds | Response - 200 OK
-[
- {
- cta: 'https://idle.finance/#/governance/proposals',
- title: 'New Proposal',
- message:
- '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' +
- '\n' +
- '[d:Proposal] : IIP-32: Add Euler staking PYT wrappers for AA tranche to IdleDAI\n' +
- '[timestamp:1676570405.922][timestamp: 1676570405]',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeidgjepmup44yqmghcmmzp5aohj6yemjuwal3hozowp2mnxmtdjv5u/bafkreieqw4su7yuqf5ycow4ajpzjyimfl4umnnoe5fz2mq7ukrmqnesk2y',
- url: 'https://idle.finance/',
- sid: '3401597',
- app: 'Idle Finance',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: {
- body: 'New Proposal On Idle Finance',
- title: 'Idle Finance - New Proposal',
- },
- secret: '',
- },
- {
- cta: '',
- title: '',
- message: 'hi socket',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeicahk2k5jcprepvqxl7xvh5ia4wyruikvpvcrel2rt7tsuefc7ktu/bafkreihjprcvuf2er5etxh7hsvslxzbntum5fqournkrsrtvhvppwx7jqy',
- url: 'https://www.google.com/',
- sid: '2491520',
- app: 'AKP Test Channel',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: { body: 'hi socket', title: 'AKP Test Channel - ' },
- secret: '',
- },
- {
- cta: '',
- title: '',
- message: 'hiii',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeicahk2k5jcprepvqxl7xvh5ia4wyruikvpvcrel2rt7tsuefc7ktu/bafkreihjprcvuf2er5etxh7hsvslxzbntum5fqournkrsrtvhvppwx7jqy',
- url: 'https://www.google.com/',
- sid: '2490919',
- app: 'AKP Test Channel',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: { body: 'hiii', title: 'AKP Test Channel - ' },
- secret: '',
- },
- {
- cta: '',
- title: '',
- message: 'Hey -testing',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeifvbiegzbgyoikdxe2rqhxf2uuvrqtfmllzy2ueidzyxnqkvkuizu/bafkreia26pvmuo2ugyub7boo2zxxj6dqhwqt3gcllpotmau3t7gsvy6vfq',
- url: 'https://gnosis.io',
- sid: '2429211',
- app: 'Gnosis',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: { body: 'Hey -testing', title: 'Gnosis - ' },
- secret: '',
- },
- {
- cta: '',
- title: '',
- message: 'Hey',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeifvbiegzbgyoikdxe2rqhxf2uuvrqtfmllzy2ueidzyxnqkvkuizu/bafkreia26pvmuo2ugyub7boo2zxxj6dqhwqt3gcllpotmau3t7gsvy6vfq',
- url: 'https://gnosis.io',
- sid: '2429210',
- app: 'Gnosis',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: { body: 'Hey', title: 'Gnosis - ' },
- secret: '',
- },
- {
- cta: 'https://idle.finance/#/governance/proposals',
- title: 'New Proposal',
- message:
- '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' +
- '\n' +
- '[d:Proposal] : IIP-31: Add AA Euler staking PYT wrappers to IdleUSDT, IdleUSDC and IdleWETH. Gauges rate to 0. Extend LM. \n' +
- '[timestamp:1674583206.258][timestamp: 1674583206]',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeidgjepmup44yqmghcmmzp5aohj6yemjuwal3hozowp2mnxmtdjv5u/bafkreieqw4su7yuqf5ycow4ajpzjyimfl4umnnoe5fz2mq7ukrmqnesk2y',
- url: 'https://idle.finance/',
- sid: '1784234',
- app: 'Idle Finance',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: {
- body: 'New Proposal On Idle Finance',
- title: 'Idle Finance - New Proposal',
- },
- secret: '',
- },
- {
- cta: '',
- title: '',
- message: 'hi 2023',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeicahk2k5jcprepvqxl7xvh5ia4wyruikvpvcrel2rt7tsuefc7ktu/bafkreihjprcvuf2er5etxh7hsvslxzbntum5fqournkrsrtvhvppwx7jqy',
- url: 'https://www.google.com/',
- sid: '1132231',
- app: 'AKP Test Channel',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: { body: 'hi 2023', title: 'AKP Test Channel - ' },
- secret: '',
- },
- {
- cta: '',
- title: '',
- message: 'hi',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeicahk2k5jcprepvqxl7xvh5ia4wyruikvpvcrel2rt7tsuefc7ktu/bafkreihjprcvuf2er5etxh7hsvslxzbntum5fqournkrsrtvhvppwx7jqy',
- url: 'https://www.google.com/',
- sid: '1132230',
- app: 'AKP Test Channel',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: { body: 'hi', title: 'AKP Test Channel - ' },
- secret: '',
- },
- {
- cta: 'https://idle.finance/#/governance/proposals',
- title: 'New Proposal',
- message:
- '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' +
- '\n' +
- '[d:Proposal] : IIP-30: Remove idleDAI wrapper for cpFOL-USDC (DAI) senior. Same for idleUSDC with cpWIN-USDC. Remove idleRAI, idleSUSD, idleTUSD and idleFEI from IdleController. Update voting delay in Governor \n' +
- ' \n' +
- '[timestamp:1672769747.911][timestamp: 1672769747]',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeidgjepmup44yqmghcmmzp5aohj6yemjuwal3hozowp2mnxmtdjv5u/bafkreieqw4su7yuqf5ycow4ajpzjyimfl4umnnoe5fz2mq7ukrmqnesk2y',
- url: 'https://idle.finance/',
- sid: '1080072',
- app: 'Idle Finance',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: {
- body: 'New Proposal On Idle Finance',
- title: 'Idle Finance - New Proposal',
- },
- secret: '',
- },
- {
- cta: 'https://idle.finance/#/governance/proposals',
- title: 'New Proposal',
- message:
- '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' +
- '\n' +
- '[d:Proposal] : IIP-29: Remove idleDAI wrapper for cpFOL-USDC (DAI) senior. Same for idleUSDC with cpWIN-USDC. Remove idleRAI, idleSUSD, idleTUSD and idleFEI from IdleController. Update voting delay in Governor \n' +
- ' \n' +
- '[timestamp:1671624005.155][timestamp: 1671624005]',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeidgjepmup44yqmghcmmzp5aohj6yemjuwal3hozowp2mnxmtdjv5u/bafkreieqw4su7yuqf5ycow4ajpzjyimfl4umnnoe5fz2mq7ukrmqnesk2y',
- url: 'https://idle.finance/',
- sid: '935285',
- app: 'Idle Finance',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: {
- body: 'New Proposal On Idle Finance',
- title: 'Idle Finance - New Proposal',
- },
- secret: '',
- },
-];
+ private signer: SignerType;
```
-
+---
+
+#### **chainId**
+
+The chain id of the chain on which the call is being conducted.
+
+```typescript
+ private chainId: number;
+```
---
-### **Fetching user spam notifications**
+#### **pgpPrivateKey**
+
+- Used to store the PGP private key of a user.
+- Used in the request, acceptRequest and disconnect methods to send notifications.
```typescript
-const spams = await PushAPI.user.getFeeds({
- user: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // user address in CAIP
- spam: true,
- env: 'staging',
-});
+ private pgpPrivateKey: string;
```
-Allowed Options (params with _ are mandatory)
-| Param | Type | Default | Remarks |
-|----------|---------|---------|--------------------------------------------|
-| user_ | string | - | user account address (CAIP) |
-| page | number | 1 | page index of the results |
-| limit | number | 10 | number of items in 1 page |
-| spam | boolean | false | if "true" it will fetch spam feeds |
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
-| raw | boolean | false | if "true" the method will return unformatted raw API response|
+---
-
- Expected response (Fetching user spam notifications)
+#### **env**
+
+- The environment on which the call is being conducted.
```typescript
-PushAPI.user.getFeeds [Spam] | Response - 200 OK
-[
- {
- cta: 'https://goerli.etherscan.io/tx/0xe1d230d2139b0d726d5a80713ac437bed3b55b808eb651d85d8b86a377b56aa3',
- title: 'PUSH Tokens Received',
- message: 'Received 500 PUSH from 0x69e666767ba3a661369e1e2f572ede7adc926029',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeih7t3hftdcfz6axqvcnszou6tfo6blrlmis3cns33jad7dqhdcjpi/Qmah3yyjjcQGtkHDRkyrs4VoXsrgyr9SqEsLekLPW2nhpb',
- url: 'https://uniswap.org',
- sid: '3436148',
- app: 'Uniswap Test',
- image: 'https://play-lh.googleusercontent.com/i911_wMmFilaAAOTLvlQJZMXoxBF34BMSzRmascHezvurtslYUgOHamxgEnMXTklsF-S',
- blockchain: 'THE_GRAPH',
- notification: {
- body: 'Received 500 PUSH from 0x69e666767ba3a661369e1e2f572ede7adc926029',
- title: 'Uniswap Test - PUSH Tokens Received'
- },
- secret: ''
- },
- {
- cta: '',
- title: '[sdk-test] payload title',
- message: 'sample msg body',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeihvggzdcvfbjw4bqytpbldeauc7chru3mj62wz4af7lezqvuyxj6i/QmW8vCUVk43gtm8CzAqKBUR13HK4fiaFHk7EfEnJYSonZw',
- url: 'https://stream-2-earn.vercel.app/',
- sid: '3258266',
- app: 'Stream2Earn',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: {
- body: '[sdk-test] notification BODY',
- title: 'Stream2Earn - [SDK-TEST] notification TITLE:'
- },
- secret: ''
- },
- {
- cta: 'https://goerli.etherscan.io/tx/0xc4a01fd9ac033b5e00b45ad52af51821add8db4f31cae93e19326aff01b4e9c7',
- title: 'PUSH Tokens Received',
- message: 'Received 50 PUSH from 0x7b9e036bd304fd1bea0523de718038bbe345521a',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeih7t3hftdcfz6axqvcnszou6tfo6blrlmis3cns33jad7dqhdcjpi/Qmah3yyjjcQGtkHDRkyrs4VoXsrgyr9SqEsLekLPW2nhpb',
- url: 'https://uniswap.org',
- sid: '2868333',
- app: 'Uniswap Test',
- image: 'https://play-lh.googleusercontent.com/i911_wMmFilaAAOTLvlQJZMXoxBF34BMSzRmascHezvurtslYUgOHamxgEnMXTklsF-S',
- blockchain: 'THE_GRAPH',
- notification: {
- body: 'Received 50 PUSH from 0x7b9e036bd304fd1bea0523de718038bbe345521a',
- title: 'Uniswap Test - PUSH Tokens Received'
- },
- secret: ''
- },
- {
- cta: '',
- title: '[sdk-test] payload title 1675241933583',
- message: 'type:3 identity:2',
- icon: 'na',
- url: 'https://app.push.org',
- sid: '2427470',
- app: 'internal',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: {
- body: '[sdk-test] notification BODY 1675241933583',
- title: 'internal - [SDK-TEST] notification TITLE: 16752419'
- },
- secret: ''
- },
- {
- cta: '',
- title: '[sdk-test] payload title 1673154212899',
- message: 'type:3 identity:2',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeihffthqhvxdt73pe4voisz63mm2fydnrctypmh5byaglujjejjvzm/QmcHvKxoCDgN7mH2sMzFkoqDaRLUWdNMa2FbJbGRVkdF3d',
- url: 'https://www.google.com',
- sid: '1178703',
- app: 'Test Channel',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: {
- body: '[sdk-test] notification BODY 1673154212899',
- title: 'Test Channel - [SDK-TEST] notification TITLE: 1673'
- },
- secret: ''
- },
- {
- cta: '',
- title: '[sdk-test] payload title 1673154141751',
- message: 'type:3 identity:2',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeihffthqhvxdt73pe4voisz63mm2fydnrctypmh5byaglujjejjvzm/QmcHvKxoCDgN7mH2sMzFkoqDaRLUWdNMa2FbJbGRVkdF3d',
- url: 'https://www.google.com',
- sid: '1178702',
- app: 'Test Channel',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: {
- body: '[sdk-test] notification BODY 1673154141751',
- title: 'Test Channel - [SDK-TEST] notification TITLE: 1673'
- },
- secret: ''
- },
- {
- cta: '',
- title: '[sdk-test] payload title 1669794606748',
- message: 'type:4 identity:2',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeih4qfevv2ms3tzognoscd5r5kenjcjjzvkzb6w6jctzcjzqoaxite/Qma13kPK6pcv8Z4Xjjw1MULfXgHxXPafp5Fqm1D9b5UXuv',
- url: 'https://google.com',
- sid: '839794',
- app: 'asdf',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: {
- body: '[sdk-test] notification BODY 1669794606748',
- title: 'asdf - [SDK-TEST] notification TITLE: 166979460674'
- },
- secret: ''
- },
- {
- cta: '',
- title: '[sdk-test] payload title 1669794334167',
- message: 'type:4 identity:2',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeih4qfevv2ms3tzognoscd5r5kenjcjjzvkzb6w6jctzcjzqoaxite/Qma13kPK6pcv8Z4Xjjw1MULfXgHxXPafp5Fqm1D9b5UXuv',
- url: 'https://google.com',
- sid: '839772',
- app: 'asdf',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: {
- body: '[sdk-test] notification BODY 1669794334167',
- title: 'asdf - [SDK-TEST] notification TITLE: 166979433416'
- },
- secret: ''
- },
- {
- cta: '',
- title: '[SDK-TEST] notification TITLE: 1669793429997',
- message: '[sdk-test] notification BODY 1669793429997',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeih4qfevv2ms3tzognoscd5r5kenjcjjzvkzb6w6jctzcjzqoaxite/Qma13kPK6pcv8Z4Xjjw1MULfXgHxXPafp5Fqm1D9b5UXuv',
- url: 'https://google.com',
- sid: '839723',
- app: 'asdf',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: {
- body: '[sdk-test] notification BODY 1669793429997',
- title: 'asdf - [SDK-TEST] notification TITLE: 166979342999'
- },
- secret: ''
- },
- {
- cta: '',
- title: '[sdk-test] payload title 1668866110431',
- message: 'type:3 identity:2',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeibmpivnqppyhg2avfnkk4v4idnfo4jvfmkdxthtkxwooaglg5kxau/QmbokNY79DDthAQ5QNc64HisnEvH7Q1Wdnay7Gg2yHqULo',
- url: 'https://cryptobulb.io/',
- sid: '802376',
- app: 'CryptobulbNFT',
- image: '',
- blockchain: 'ETH_TEST_GOERLI',
- notification: {
- body: '[sdk-test] notification BODY 1668866110431',
- title: 'CryptobulbNFT - [SDK-TEST] notification TITLE: 166'
- },
- secret: ''
- }
-]
+private env: ENV;
```
-
+---
+
+### **data**
+
+- Stores data related to the video call.
+
+```typescript
+export type IMediaStream = MediaStream | null;
+
+export enum VideoCallStatus {
+ UNINITIALIZED,
+ INITIALIZED,
+ RECEIVED,
+ CONNECTED,
+ DISCONNECTED,
+ RETRY_INITIALIZED,
+ RETRY_RECEIVED,
+}
+
+export type PeerData = {
+ stream: IMediaStream; // incoming media stream
+ audio: boolean | null; // incoming audio status
+ video: boolean | null; // incoming video status
+ address: string; // incoming address
+ status: VideoCallStatus; // status for the connection with incoming peer
+ retryCount: number; // number of retires done
+};
+
+export type VideoCallData = {
+ meta: {
+ chatId: string; // unique chatId for the corresponding push w2w chat
+ initiator: {
+ address: string; // initiator's address
+ signal: any; // initiator's signaling data for webRTC connection
+ };
+ broadcast?: {
+ livepeerInfo: any;
+ hostAddress: string;
+ coHostAddress: string;
+ };
+ };
+ local: {
+ stream: IMediaStream; // local media stream
+ audio: boolean | null; // local audio status
+ video: boolean | null; // local video status
+ address: string; // local address
+ };
+ incoming: [PeerData];
+};
+
+private data: VideoCallData;
+```
---
-### **Fetching user subscriptions**
+#### **setData**
+
+- This function can be used to update the video call `data`
```typescript
-const subscriptions = await PushAPI.user.getSubscriptions({
- user: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // user address in CAIP
- env: 'staging',
+setData: (fn: (data: VideoCallData) => VideoCallData) => void;
+
+// usage
+
+import { produce } from 'immer';
+
+setData((oldData) => {
+ return produce(oldData, (draft) => {
+ // update the draft object, example
+ draft.incoming.status = VideoCallStatus.INITIALIZED;
+ });
});
```
-where `subscriptions` is a list of channels `[{ channel: '0xaddress', ... }]` subscribed by the user.
+---
+
+### **Methods**
+
+#### **constructor**
-_Note: We can find out if a user is subscribed to a channel by checking if the channel address is present in the subscriptions list_
+```typescript
+constructor({
+ signer,
+ chainId,
+ pgpPrivateKey,
+ env,
+ setData,
+ }: {
+ signer: SignerType;
+ chainId: number;
+ pgpPrivateKey: string;
+ env?: ENV;
+ setData: (fn: (data: VideoCallData) => VideoCallData) => void;
+ }) {}
+```
Allowed Options (params with _ are mandatory)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
-| user_ | string | - | user address (CAIP) |
+| signer_ | SignerType | - | signer object for a user |
+| chainId* | number | - | chainId for the video call - Eth Mainnet: 1, Polygon Mainnet: 137 |
+| pgpPrivatekey* | string | - | PGP private key of the user, used while sending video call notifications |
| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+| setData\* | `(fn: (data: VideoCallData) => VideoCallData) => void` | - | Function to update video call data |
-
- Expected response (Fetching user opted in channels / subscriptions)
+---
+
+#### **create**
+
+- This method is used to create a local stream
+- Assigns the local stream obtained from the `navigator.mediaDevices.getUserMedia` to `data.local.stream` state.
```typescript
-// PushAPI.user.getSubscriptions | Response - 200 OK
-[
- { channel: '0x0000000000000000000000000000000000000000' },
- { channel: '0xa3B6712fB922cdbbdce9AB22571e75d0d81B3b00' },
- { channel: '0xde3aEA26fDC3ADdC1dB32baf1a058Cf0878FEac1' },
- { channel: '0x69e666767Ba3a661369e1e2F572EdE7ADC926029' },
- { channel: '0x466AEEf0943C5F098dBcEf3c1eEC03322E1F97eD' },
- { channel: '0xcE98113b998380729B04596e3eA0255fbA138D34' },
- { channel: '0xa89523351BE1e2De64937AA9AF61Ae06eAd199C7' },
- { channel: '0x0a651cF7A9b60082fecdb5f30DB7914Fd7d2cf93' },
- { channel: '0x0b5E9fa12C4C1946fA2f14b7271cC60541508f23' },
- { channel: '0x2AEcb6DeE3652dA1dD6b54D5fd4f7D8F43DaEb78' },
- { channel: '0xcB6C7b2E340D50701d45d55507f19A5cE5d72330' },
- { channel: '0xB59Cdc85Cacd15097ecE4C77ed9D225014b4D56D' },
- { channel: '0xA5E269eec042Bf61183DEf9911D03359597494b7' },
- { channel: '0x6bf1ee9DE5D11Fa558c1FA8D8855E26C38Fa582A' },
- { channel: '0x72Ac64A3aE0ab60D725980b73Ef460ED9e742cc7' },
- { channel: '0xEc6CbD318CB7BA8a0fBbffF697681C0a4ADA0349' },
- { channel: '0xAb9415961F58eBD6d79029bC76F261Fa65a80D3D' },
- { channel: '0x08D77bD7500a07d791dD1323919C22e1FDb72224' },
- { channel: '0xa1016081D6Da53b4246178eD83922C55F7171e54' },
- { channel: '0x6A06014AC6BdE2906D194e63ec3b1B5B4c9C2Abb' },
- { channel: '0xf69389475E082f4BeFDb9dee4a1E9fe6cd29f6e7' },
- { channel: '0x9601f08b9EcB981D273B72e7f33964Cb98f977fe' },
- { channel: '0x47A2910432016CA9f62B20dCE09b89d357d0c3d7' },
- { channel: '0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924' },
- { channel: '0x14c0157f9eEA7AEe61ba2606E75716E210b4697a' },
- { channel: '0x025846389950A13292E63e4794C7D148FF57F995' },
- { channel: '0x2aecb6dee3652da1dd6b54d5fd4f7d8f43daeb77' },
- { channel: '0xD8634C39BBFd4033c0d3289C4515275102423681' },
- { channel: '0x19fB80f16EAFCfb5BBFa07451CC5694E8932EA52' },
- { channel: '0x94c3016ef3e503774630fC71F59B8Da9f7D470B7' },
-];
+export type VideoCreateInputOptions = {
+ video?: boolean;
+ audio?: boolean;
+};
+
+async create(options: VideoCreateInputOptions): Promise {}
```
-
+Allowed Options (params with \* are mandatory)
+| Param | Type | Default | Remarks |
+|----------|---------|---------|--------------------------------------------|
+| video | boolean | true | video status for the local stream |
+| audio | boolean | true | audio status for the local stream |
+
+Note - If audio, video aren't enabled in create() then they wont be available during the call respectively.
---
-### **Fetching channel details**
+#### **request**
+
+- This method is used to request a push video call.
+- Will be triggered on the initiator's end.
```typescript
-const channelData = await PushAPI.channels.getChannel({
- channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // channel address in CAIP
- env: 'staging',
-});
+export type VideoRequestInputOptions = {
+ senderAddress: string;
+ recipientAddress: string;
+ chatId: string;
+ onReceiveMessage?: (message: string) => void;
+ retry?: boolean;
+};
+
+async request(options: VideoRequestInputOptions): Promise {}
```
Allowed Options (params with _ are mandatory)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
-| channel_ | string | - | channel address (CAIP) |
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
-
-
- Expected response (Fetching channel details)
-
-```typescript
-// PushAPI.channels.getChannel | Response - 200 OK
-{
- id: 39,
- channel: '0xD8634C39BBFd4033c0d3289C4515275102423681',
- ipfshash: 'bafkreia26pvmuo2ugyub7boo2zxxj6dqhwqt3gcllpotmau3t7gsvy6vfq',
- name: 'Gnosis',
- info: 'Gnosis builds new market mechanisms for decentralized finance.\n',
- url: 'https://gnosis.io',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeifvbiegzbgyoikdxe2rqhxf2uuvrqtfmllzy2ueidzyxnqkvkuizu/bafkreia26pvmuo2ugyub7boo2zxxj6dqhwqt3gcllpotmau3t7gsvy6vfq',
- processed: 1,
- attempts: 0,
- alias_address: '0xD8634C39BBFd4033c0d3289C4515275102423681',
- alias_verification_event: null,
- is_alias_verified: 1,
- alias_blockchain_id: 'NULL',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-02-07T16:29:27.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null
-}
-```
-
-
+| senderAddress_ | string | - | Local peer address |
+| recipientAddress* | string | - | Incoming/remote peer address |
+| chatId* | string | - | Unique identifier for every wallet-to-wallet push chat, will be used during verification proof generation |
+| onReceiveMessage | `(message: string) => void` | `(message: string) => {console.log('received a meesage', message);}` | Function which will be called when the sender receives a message via webRTC data channel |
+| retry | boolean | false | If we are retrying the call, only for internal use |
---
-### **Searching for channel(s)**
+#### **acceptRequest**
+
+- This method is used to accept a push video call.
+- Will be triggered on the receiver's end.
```typescript
-const channelsData = await PushAPI.channels.search({
- query: 'push', // a search query
- page: 1, // page index
- limit: 20, // no of items per page
- env: 'staging',
-});
+export type VideoAcceptRequestInputOptions = {
+ signalData: any;
+ senderAddress: string;
+ recipientAddress: string;
+ chatId: string;
+ onReceiveMessage?: (message: string) => void;
+ retry?: boolean;
+};
+
+async acceptRequest(options: VideoAcceptRequestInputOptions): Promise {}
```
Allowed Options (params with _ are mandatory)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
-| query_ | string | - | search query |
-| page | number | 1 | page index of the results |
-| limit | number | 10 | number of items in 1 page |
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+| signalData_ | any | - | Signal data received from the initiator peer via psuh notification upon call request |
+| senderAddress* | string | - | Local peer address |
+| recipientAddress* | string | - | Incoming/remote peer address |
+| chatId\* | string | - | Unique identifier for every wallet-to-wallet push chat, will be used during verification proof generation |
+| onReceiveMessage | `(message: string) => void` | `(message: string) => {console.log('received a meesage', message);}` | Function which will be called when the sender receives a message via webRTC data channel |
+| retry | boolean | false | If we are retrying the call, only for internal use |
-
- Expected response (Searching for channel)
+---
-```typescript
-// PushAPI.channels.search | Response - 200 OK
-[
- {
- id: 58,
- channel: '0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924',
- ipfshash: 'QmSbRT16JVF922yAB26YxWFD6DmGsnSHm8VBrGUQnXTS74',
- name: 'Ethereum Push Notification Service',
- info: 'The channel provides useful information, notifications, etc to all the users of the EPNS platform. While not recommended, you can unsubcribe if you want to.',
- url: 'https://epns.io/',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeihwgapkthxi6udojr7soqetk5xx22bdy56uupivcwkriaiqzwlyiu/QmSbRT16JVF922yAB26YxWFD6DmGsnSHm8VBrGUQnXTS74',
- processed: 1,
- attempts: 0,
- alias_address: 'NULL',
- alias_verification_event: null,
- is_alias_verified: 0,
- alias_blockchain_id: 'NULL',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-01-03T16:38:31.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 756,
- },
- {
- id: 817,
- channel: '0xBA36124E8af635d9d32C4cC49802cacade133a5F',
- ipfshash: 'QmUf7zuo4NXvkijhELfHAdmm8dQVY9VqesEs4xhobLZx4f',
- name: 'push-ap-test',
- info: 'testing push notifications',
- url: 'https://www.google.com',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeigyk6kqiyn2dkburguqmnlkgvos4yld4hswcjcjnxbq6c5dqs7ih4/QmUf7zuo4NXvkijhELfHAdmm8dQVY9VqesEs4xhobLZx4f',
- processed: 1,
- attempts: 0,
- alias_address: 'NULL',
- alias_verification_event: null,
- is_alias_verified: 0,
- alias_blockchain_id: 'NULL',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-01-03T16:38:31.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 57,
- },
- {
- id: 243,
- channel: '0xC533ec1f876eA99088c85896F246C2ec8c7b05f9',
- ipfshash: 'bafkreibc36t5tlygsa75w6nnkjmjieyzrohuscwzvohbj5tq6v6tgm2q4y',
- name: 'EPNS PUSH Governance',
- info: 'Get notifications on new proposals, grants, and stay up to date on all things PUSH Governance.',
- url: 'https://epns.io/',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeihluvteyktaz6u7it6etf7jglqckcym5h5hxoqcilen73pcrz2wkq/bafkreibc36t5tlygsa75w6nnkjmjieyzrohuscwzvohbj5tq6v6tgm2q4y',
- processed: 1,
- attempts: 0,
- alias_address: 'NULL',
- alias_verification_event: null,
- is_alias_verified: 0,
- alias_blockchain_id: 'NULL',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-01-03T16:38:31.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 9,
+#### **connect**
+
+- This is the final method which is used to connect a push video call.
+- Will be triggered on the initiator's end.
+
+```typescript
+export type VideoConnectInputOptions = {
+ signalData: any;
+ peerAddress?: string;
+};
+
+connect(options: VideoConnectInputOptions): void {}
+```
+
+Allowed Options (params with _ are mandatory)
+| Param | Type | Default | Remarks |
+|----------|---------|---------|--------------------------------------------|
+| signalData_ | any | - | Signal data received from the receiver peer via push notification upon call acceptRequest |
+| peerAddress | string | data.incoming[0].address | Address of the receiver peer, received via push notification upon call acceptRequest |
+
+---
+
+#### **disconnect**
+
+- This method is used to end a push video call.
+- Can be triggered on the initiator as well as receivers end.
+
+```typescript
+export type VideoDisconnectOptions = {
+ peerAddress: string;
+} | null;
+
+disconnect(options: VideoDisconnectOptions): void {}
+```
+
+Allowed Options (params with \* are mandatory)
+| Param | Type | Default | Remarks |
+|----------|---------|---------|--------------------------------------------|
+| peerAddress | string | data.incoming[0].address | Address of the peer to be disconnected from |
+
+---
+
+#### **enableVideo**
+
+- This method is used to enable/disable the video (from `data.local.stream`) for a push video call.
+- Can be triggered on the initiator as well as receivers end.
+- **Note -** If video was not enabled during `create()` then it will always remain off.
+
+```typescript
+ export type EnableVideoInputOptions = {
+ state: boolean;
+}
+
+enableVideo(options: EnableVideoInputOptions): void
+```
+
+Allowed Options (params with \* are mandatory)
+| Param | Type | Default | Remarks |
+|----------|---------|---------|--------------------------------------------|
+| state | boolean | - | true for enable and false for disable |
+
+---
+
+#### **enableAudio**
+
+- This method is used to enable/disable the audio (from `data.local.stream`) for a push video call.
+- Can be triggered on the initiator as well as receivers end.
+- **Note -** If audio was not enabled during `create()` then it will always remain off.
+
+```typescript
+export type EnableAudioInputOptions = {
+ state: boolean;
+}
+
+enableAudio(options: EnableAudioInputOptions): void
+```
+
+Allowed Options (params with \* are mandatory)
+| Param | Type | Default | Remarks |
+|----------|---------|---------|--------------------------------------------|
+| state | boolean | - | true for enable and false for disable |
+
+---
+
+#### **isInitiator**
+
+- This method is used to tell if the current peer is the initator of the push video call or not.
+- Can be triggered on the initiator as well as receivers end.
+
+```typescript
+isInitiator(): boolean
+```
+
+---
+
+## For Spaces
+
+### **To create a space**
+
+```typescript
+// pre-requisite API calls that should be made before
+// need to get user and through that encryptedPvtKey of the user
+const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging');
+
+// need to decrypt the encryptedPvtKey to pass in the api using helper function
+const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer);
+
+// actual api
+const response = await PushAPI.space.create({
+ spaceName:'wasteful_indigo_warbler',
+ spaceDescription: 'boring_emerald_gamefowl',
+ listeners: ['0x9e60c47edF21fa5e5Af33347680B3971F2FfD464','0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
+ spaceImage: <space image link> ,
+ speakers: ['0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
+ isPublic: true,
+ account: '0xD993eb61B8843439A23741C0A3b5138763aE11a4',
+ env: 'staging',
+ pgpPrivateKey: pgpDecryptedPvtKey, //decrypted private key
+ scheduleAt: new Date("2024-07-15T14:48:00.000Z"),
+ scheduleEnd: new Date("2024-07-15T15:48:00.000Z")
+});
+```
+
+### **To create a token gated space**
+
+```typescript
+// pre-requisite API calls that should be made before
+// need to get user and through that encryptedPvtKey of the user
+const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging');
+
+// need to decrypt the encryptedPvtKey to pass in the api using helper function
+const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer);
+
+// actual api
+const response = await PushAPI.space.create({
+ spaceName:'wasteful_indigo_warbler',
+ spaceDescription: 'boring_emerald_gamefowl',
+ listeners: ['0x9e60c47edF21fa5e5Af33347680B3971F2FfD464','0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
+ spaceImage: <space image link> ,
+ speakers: ['0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
+ rules: {
+ 'spaceAccess': {
+ 'conditions': [
+ {
+ 'any': [
+ {
+ 'type': 'PUSH',
+ 'category': 'ERC20',
+ 'subcategory': 'holder',
+ 'data': {
+ 'contract': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
+ 'amount': 1000,
+ 'decimals': 18
+ }
+ },
+ {
+ 'type': 'GUILD',
+ 'category': 'guildRoles',
+ 'subcategory': 'specificRole',
+ 'data': {
+ 'guildId': '13468',
+ 'guildRoleId': '19924'
+ }
+ }
+ ]
+ }
+ ]
+ }
},
- {
- id: 923,
- channel: '0x7F69eec6cC1F619Ea8d27323d4430BbA5b739354',
- ipfshash: 'QmeBqut7zMg4NSLbyEbUeLn2g9UnUE9fKjiVhYvWwJ3vqu',
- name: 'Polygon Ahmedabad <> PUSH',
- info: "You'll get cool notifications and update here.",
- url: 'https://polygon.technology/blog/polygons-web3-made-in-india-tour-starts-rolling-with-7-guild-events-web3-education-programs',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeiaxryfpf2gzmpq7uvye2kv3slru4vvdela5onldzder3zbbt3hoom/QmeBqut7zMg4NSLbyEbUeLn2g9UnUE9fKjiVhYvWwJ3vqu',
- processed: 1,
- attempts: 0,
- alias_address: 'NULL',
- alias_verification_event: null,
- is_alias_verified: 0,
- alias_blockchain_id: 'NULL',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-01-03T16:38:31.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 9,
- },
- {
- id: 274,
- channel: '0x554d29160f779Adf0a4328597cD33Ea1Df4D9Ee9',
- ipfshash: 'bafkreichmnqqcn6tfcv5lnbbluchr3tqgbhiu45qnq56p2razdhvgnblcy',
- name: 'Push Governance',
- info: 'Get notifications on new proposals, grants, and stay up to date on all updates regarding PUSH Governance',
- url: 'https://epns.io/gov',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeihkfdd4lch5vvcmziowi7dmuum2pouvk3st4v5rvfxo3etcoxh7oe/bafkreichmnqqcn6tfcv5lnbbluchr3tqgbhiu45qnq56p2razdhvgnblcy',
- processed: 1,
- attempts: 0,
- alias_address: 'NULL',
- alias_verification_event: null,
- is_alias_verified: 0,
- alias_blockchain_id: 'NULL',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-01-03T16:38:31.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 5,
- },
- {
- id: 1242,
- channel: '0x453552953C4e2732A38B93F7fB834e5AeF6F60f8',
- ipfshash: 'QmU7PC7yjdPfXJTgYuuqqvvWbxTn1rE3z8iWZEcorK3VPM',
- name: 'Test push notifications',
- info: 'Test push notifications',
- url: 'https://www.youtube.com',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeiarff4fukkj7fvmjuav6xvqzg5pfzyj2jcytzcbb5tdgyfzjfakfa/QmU7PC7yjdPfXJTgYuuqqvvWbxTn1rE3z8iWZEcorK3VPM',
- processed: 1,
- attempts: 0,
- alias_address: '0x453552953C4e2732A38B93F7fB834e5AeF6F60f8',
- alias_verification_event:
- '{"aliasAddress": "0x453552953C4e2732A38B93F7fB834e5AeF6F60f8", "aliasBlockchainId": "80001"}',
- is_alias_verified: 1,
- alias_blockchain_id: '80001',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-01-03T16:38:31.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 5,
- },
- {
- id: 210,
- channel: '0x8DaFfe9d1b5aDB33F53aDDC183C6b91F9cb30bc7',
- ipfshash: 'bafkreiac6g3iul2uk6r6h2x5rsthgoq2y6uw23n4gzkvstfn7rl5tjq3v4',
- name: 'PUSH for EthDenver',
- info: 'Get notifications about everything EPNS at ETHDenver.',
- url: 'http://ethdenver.epns.io/',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeia2emdjy63kap2yqig3h4qlsjuawdby777osyr4rls2nyno2qsv6u/bafkreiac6g3iul2uk6r6h2x5rsthgoq2y6uw23n4gzkvstfn7rl5tjq3v4',
- processed: 1,
- attempts: 1,
- alias_address: 'NULL',
- alias_verification_event: null,
- is_alias_verified: 0,
- alias_blockchain_id: 'NULL',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-01-03T16:38:31.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 4,
- },
- {
- id: 809,
- channel: '0x9dFe790B3baBCBD888dA7093017a0B7A68b99937',
- ipfshash: 'QmbrQeT4FdvYRQDrDhVvZ9XMhs2TUNSA7UHc4M53vvNcKK',
- name: 'Push-Graph Test',
- info: 'This channel is to test subgraph notifications.',
- url: 'https://push.org/',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeihniwj5eflkxah7feqdgjnfuoyeq5iw4ka7qze3h6hdxsydx3gx3e/QmbrQeT4FdvYRQDrDhVvZ9XMhs2TUNSA7UHc4M53vvNcKK',
- processed: 1,
- attempts: 0,
- alias_address: 'NULL',
- alias_verification_event: null,
- is_alias_verified: 0,
- alias_blockchain_id: 'NULL',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-02-03T12:26:00.000Z',
- blocked: 0,
- counter: 18,
- subgraph_details: '60+aiswaryawalter/push-graph-test',
- subscriber_count: 4,
- },
- {
- id: 956,
- channel: '0x85Cb63e3D8cEf31a421e59b6678bF0444Fa5d8BE',
- ipfshash: 'QmUAgUYKteWdpcWkKmNtySGY5w7XkRpUYdYtqcSfEfXzLP',
- name: 'Transfer PUSHNOTIFICATION',
- info: 'Notification for Transfer',
- url: 'https://push.org/',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeidwsc4kws4fvzzsdj5e46re46qmwxmgidouhcfeel34xmhxbqbroe/QmUAgUYKteWdpcWkKmNtySGY5w7XkRpUYdYtqcSfEfXzLP',
- processed: 1,
- attempts: 0,
- alias_address: 'NULL',
- alias_verification_event: null,
- is_alias_verified: 0,
- alias_blockchain_id: 'NULL',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-01-03T16:38:31.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 4,
- },
- {
- id: 967,
- channel: '0xa45bdc5B11ce6F0952401bE35156398d8c40Ce64',
- ipfshash: 'QmPWEKaJsfVweeyWT5bCftXDnbDFMgqw3sVpTnKtd3fH5a',
- name: 'Push Graph Notif',
- info: 'Subgraph notification test',
- url: 'https://push.org/',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeihlt5qyhs3g3ii5vrrhb4evcsltoa6bssb2qiuh3bamxx4ndorkr4/QmPWEKaJsfVweeyWT5bCftXDnbDFMgqw3sVpTnKtd3fH5a',
- processed: 1,
- attempts: 0,
- alias_address: 'NULL',
- alias_verification_event: null,
- is_alias_verified: 0,
- alias_blockchain_id: 'NULL',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-02-03T12:26:00.000Z',
- blocked: 0,
- counter: 18,
- subgraph_details: '60+aiswaryawalter/push-graph-test',
- subscriber_count: 4,
- },
- {
- id: 1425,
- channel: '0x49403ae592C82fc3f861cD0b9738f7524Fb1F38C',
- ipfshash: 'QmZ1t5upH5zHxvzefWppVNfv7ciacrDq9VUL3SZJ7trnNz',
- name: 'SuperPush',
- info: 'Create, Update and Delete Superfluid streams seemlessly and get alerted to your device with Push Notifications for every actions.',
- url: 'https://www.superfluid.finance/',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeibfnawzeadz7d2exw2ncbytanzwjb3mdkx74whga5b5scz6mmuymu/QmZ1t5upH5zHxvzefWppVNfv7ciacrDq9VUL3SZJ7trnNz',
- processed: 1,
- attempts: 0,
- alias_address: 'NULL',
- alias_verification_event: null,
- is_alias_verified: 0,
- alias_blockchain_id: 'NULL',
- activation_status: 0,
- verified_status: 0,
- timestamp: '2023-02-18T21:02:50.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 4,
- },
- {
- id: 1659,
- channel: '0x43097889162A9f2b7D85104f16aB7aB090056975',
- ipfshash: 'QmQKuiR9nZw46pnrW16J7GZTsg3hteh93mWHcHV5Khrj24',
- name: 'Push Protocol Demo',
- info: 'A demo channel for testing out Push Protocol',
- url: 'https://youtube.com',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeiaadvr565fk5mkam4hlmnaxdb7lxemfcffzqd24berqxw6sf3efny/QmQKuiR9nZw46pnrW16J7GZTsg3hteh93mWHcHV5Khrj24',
- processed: 1,
- attempts: 1,
- alias_address: 'NULL',
- alias_verification_event: null,
- is_alias_verified: 0,
- alias_blockchain_id: 'NULL',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-02-20T04:40:04.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 4,
- },
- {
- id: 287,
- channel: '0x72F569DE6d77B1D4C3810767865FC706A1C39915',
- ipfshash: 'bafkreidlxu5pnjeamnriukkqskv4v6ndfz5nifb2adrqwsvqiypg4oq4yi',
- name: 'Push for DevConnect',
- info: 'Stay upto date on all the happenings at DevConnect',
- url: 'https://devconnect.org/schedule',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeicgoxqjc3trzthp4chvdwyfe2nqm5lfaumkyztvm6vh6anwzztuty/bafkreidlxu5pnjeamnriukkqskv4v6ndfz5nifb2adrqwsvqiypg4oq4yi',
- processed: 1,
- attempts: 0,
- alias_address: 'NULL',
- alias_verification_event: null,
- is_alias_verified: 0,
- alias_blockchain_id: 'NULL',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-01-03T16:38:31.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 3,
- },
- {
- id: 369,
- channel: '0x2b107f1B57F2A381dc8c09F8786FA3bdb3c70b27',
- ipfshash: 'bafkreicnfx2wfjlphaoe7d3vttegbomdoc55n43p2r7wzpg2zzu2zcelrq',
- name: 'Dapp Push notifications',
- info: 'A channel to test out dapp push notifications',
- url: 'animepahe.com',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeihwyx4s5pv7afk7hskcvtz4j5o7yqkdwtb3t6mqsueqer4lbk53wy/bafkreicnfx2wfjlphaoe7d3vttegbomdoc55n43p2r7wzpg2zzu2zcelrq',
- processed: 1,
- attempts: 0,
- alias_address: 'NULL',
- alias_verification_event: null,
- is_alias_verified: 0,
- alias_blockchain_id: 'NULL',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-01-03T16:38:31.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 3,
- },
- {
- id: 445,
- channel: '0x24a8E20a63DC3149BD7Ee136632161cDb8857522',
- ipfshash: 'bafkreigglf54mwxxxzfhbexbyqgolyry4wfxkxvmxo3xojt6765rgi2r34',
- name: 'Push Token Alerter',
- info: 'Push Token alerter',
- url: 'https://epns.io/',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeiaxnibay6ezfwmsytoiilcppa7piutbdzqzmm6vfcqi7wrmlx4qmm/bafkreigglf54mwxxxzfhbexbyqgolyry4wfxkxvmxo3xojt6765rgi2r34',
- processed: 1,
- attempts: 2,
- alias_address: 'NULL',
- alias_verification_event: null,
- is_alias_verified: 0,
- alias_blockchain_id: 'NULL',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-01-03T16:38:31.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 3,
- },
- {
- id: 735,
- channel: '0x76AF8b0ED41EEBda6Eb2aA7991e0564cCFD1eC1F',
- ipfshash: 'QmeMSv9UrL5znYJoLkJgKnivzaN67WnfCWB7donSx8AbXP',
- name: 'Push x Polygon',
- info: 'Push x Polygon Integration',
- url: 'https://push.org',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeiejlm3hfthuprnxyqj4onxnm3gy2tuygubaaapgw2bdhuqhhqggq4/QmeMSv9UrL5znYJoLkJgKnivzaN67WnfCWB7donSx8AbXP',
- processed: 1,
- attempts: 0,
- alias_address: '0x76AF8b0ED41EEBda6Eb2aA7991e0564cCFD1eC1F',
- alias_verification_event:
- '{"aliasAddress": "0x76AF8b0ED41EEBda6Eb2aA7991e0564cCFD1eC1F", "aliasBlockchainId": "80001"}',
- is_alias_verified: 1,
- alias_blockchain_id: '80001',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-01-03T16:38:31.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 3,
- },
- {
- id: 737,
- channel: '0x0fEdC054075d14CF941A5cC62d22EBE9ad5de742',
- ipfshash: 'QmZ3VQ87hNLeda2bgmvwZhKDaMgEboDVgGqTYktJGVNggG',
- name: 'SeaLightPush',
- info: 'Decentralized Exchange',
- url: 'Https://SealightSwap.org',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeicn4gmyg5gq3u3eoo5lbkuo4pbstrhw6uu2u6lgx6yd43e6zgxyg4/QmZ3VQ87hNLeda2bgmvwZhKDaMgEboDVgGqTYktJGVNggG',
- processed: 1,
- attempts: 0,
- alias_address: '0x0fEdC054075d14CF941A5cC62d22EBE9ad5de742',
- alias_verification_event:
- '{"aliasAddress": "0x0fEdC054075d14CF941A5cC62d22EBE9ad5de742", "aliasBlockchainId": "80001"}',
- is_alias_verified: 1,
- alias_blockchain_id: '80001',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-01-03T16:38:31.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 3,
- },
- {
- id: 929,
- channel: '0x983d0aD6D9c8778889311bC0E45DE417E9D74a90',
- ipfshash: 'QmcqBzru5FFJDvLk7SYGEFYhgz9bokU77DWL4Kzt3NEDEJ',
- name: 'Push amplify',
- info: 'This channel will be used to test Push amplify features, and UI changes.',
- url: 'https://twitter.com/pranshu3196',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeihkrzovmnbscultfjfrnjqnsfqmrhrjuvnnokjwm35n7gcqy7xefi/QmcqBzru5FFJDvLk7SYGEFYhgz9bokU77DWL4Kzt3NEDEJ',
- processed: 1,
- attempts: 0,
- alias_address: 'NULL',
- alias_verification_event: null,
- is_alias_verified: 0,
- alias_blockchain_id: 'NULL',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-01-03T16:38:31.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 3,
- },
- {
- id: 1039,
- channel: '0xc092d5Aa8c23165484486F246C828e4980b6C707',
- ipfshash: 'QmXc2CE1c9fR34HVmkwQNaHRUvt7YxtiUcJfpBSbKTyBzD',
- name: 'testPushHack',
- info: 'test',
- url: 'https://iamzub.in',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeia6djth6wbxpkujkxuftbkeot6d6atnhtyfb5k3bn5metcyj2pk3q/QmXc2CE1c9fR34HVmkwQNaHRUvt7YxtiUcJfpBSbKTyBzD',
- processed: 1,
- attempts: 1,
- alias_address: 'NULL',
- alias_verification_event: null,
- is_alias_verified: 0,
- alias_blockchain_id: 'NULL',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-01-03T16:38:31.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 3,
- },
- {
- id: 1241,
- channel: '0x11EaB508c309595F14E363e6a8d434BEab91eEBC',
- ipfshash: 'QmZm14LgHZB2hYHcENkJNhrrL11QRKDCpX3AeVmXEiy2Hq',
- name: 'Test for push',
- info: 'Test for push',
- url: 'https://www.youtube.com',
- icon: 'https://gateway.ipfs.io/ipfs/bafybeicnv3jv7ylfxqgb5cqyzzi4lumbjeqyimcljewqbexszjrqeqkn5m/QmZm14LgHZB2hYHcENkJNhrrL11QRKDCpX3AeVmXEiy2Hq',
- processed: 1,
- attempts: 0,
- alias_address: '0x11EaB508c309595F14E363e6a8d434BEab91eEBC',
- alias_verification_event:
- '{"aliasAddress": "0x11EaB508c309595F14E363e6a8d434BEab91eEBC", "aliasBlockchainId": "80001"}',
- is_alias_verified: 1,
- alias_blockchain_id: '80001',
- activation_status: 1,
- verified_status: 0,
- timestamp: '2023-01-03T16:38:31.000Z',
- blocked: 0,
- counter: null,
- subgraph_details: null,
- subscriber_count: 3,
- },
-];
-```
-
-
-
----
-
-### **Opt in to a channel**
-
-```typescript
-await PushAPI.channels.subscribe({
- signer: _signer,
- channelAddress: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // channel address in CAIP
- userAddress: 'eip155:5:0x52f856A160733A860ae7DC98DC71061bE33A28b3', // user address in CAIP
- onSuccess: () => {
- console.log('opt in success');
- },
- onError: () => {
- console.error('opt in error');
- },
- env: 'staging',
-});
-```
-
-Allowed Options (params with _ are mandatory)
-| Param | Type | Default | Remarks |
-|----------|---------|---------|--------------------------------------------|
-| signer_ | - | - | Signer object |
-| channelAddress* | string | - | channel address (CAIP) |
-| userAddress* | string | - | user address (CAIP) | |
-| verifyingContractAddress | string | - | Push communicator contract address|
-| onSuccess | function | - | on success callback |
-| onError | function | - | on error callback |
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
-
-
- Expected response (Opt in to channel)
-
-```typescript
-// PushAPI.channels.subscribe | Response - 200 OK
-{ status: 'success', message: 'successfully opted into channel' }
-
-```
-
-
-
----
-
-### **Opt out to a channel**
-
-```typescript
-await PushAPI.channels.unsubscribe({
- signer: _signer,
- channelAddress: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // channel address in CAIP
- userAddress: 'eip155:5:0x52f856A160733A860ae7DC98DC71061bE33A28b3', // user address in CAIP
- onSuccess: () => {
- console.log('opt out success');
- },
- onError: () => {
- console.error('opt out error');
- },
- env: 'staging',
-});
-```
-
-Allowed Options (params with _ are mandatory)
-| Param | Type | Default | Remarks |
-|----------|---------|---------|--------------------------------------------|
-| signer_ | - | - | Signer object |
-| channelAddress* | string | - | channel address (CAIP) |
-| userAddress* | string | - | user address (CAIP) | |
-| verifyingContractAddress | string | - | Push communicator contract address|
-| onSuccess | function | - | on success callback |
-| onError | function | - | on error callback |
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
-
-
- Expected response (Opt out of a channel)
-
-```typescript
-// PushAPI.channels.unsubscribe | Response - 200 OK
-{ status: 'success', message: 'successfully opted out channel' }
-```
-
-
-
----
-
-### **Sending notification**
-
-```typescript
-async function sendNotification(options: {
- senderType?: 0 | 1;
- signer: any;
- type: NOTIFICATION_TYPE;
- identityType: IDENTITY_TYPE;
- notification?: {
- title: string;
- body: string;
- };
- payload?: {
- sectype?: string;
- title: string;
- body: string;
- cta: string;
- img: string;
- metadata?: any;
- additionalMeta?: any;
- };
- recipients?: string | string[]; // CAIP or plain ETH
- channel: string; // CAIP or plain ETH
- expiry?: number;
- hidden?: boolean;
- graph?: {
- id: string;
- counter: number;
- };
- ipfsHash?: string;
- env?: ENV;
- chatId?: string;
- pgpPrivateKey?: string;
+ isPublic: true,
+ account: '0xD993eb61B8843439A23741C0A3b5138763aE11a4',
+ env: 'staging',
+ pgpPrivateKey: pgpDecryptedPvtKey, //decrypted private key
+ scheduleAt: new Date("2024-07-15T14:48:00.000Z"),
+ scheduleEnd: new Date("2024-07-15T15:48:00.000Z")
});
```
Allowed Options (params with _ are mandatory)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
-| senderType_ | number | 0 | 0 for channel notification. 1 for chat notification |
-| signer* | - | - | Signer object |
-| channel* | string | - | channel address (CAIP) |
-| type* | number | - | Notification Type
Target = 3 (send to 1 address),
Subset = 4 (send to 1 or more addresses),
Broadcast = 1 (send to all addresses) |
-| identityType* | number | - | Identity Type
Minimal = 0,
IPFS = 1,
Direct Payload = 2,
Subgraph = 3 } |
-| recipients* | string or string[] | - | for Notification Type = Target it is 1 address,
for Notification Type = Subset, Broadcast it is an array of addresses (CAIP) |
-| notification.title* | string | - | Push Notification Title (not required for identityType IPFS, Subgraph)|
-| notification.body\* | string | - | Push Notification Body (not required for identityType IPFS, Subgraph)|
-| payload.title | string | - | Notification Title (not required for identityType IPFS, Subgraph)|
-| payload.body | string | - | Notification Body (not required for identityType IPFS, Subgraph)|
-| payload.cta | string | - | Notification Call To Action url (not required for identityType IPFS, Subgraph)|
-| payload.img | string | - | Notification Media url (not required for identityType IPFS, Subgraph)|
-| payload.sectype | string | - | If Secret Notification then pass (not required for identityType IPFS, Subgraph)|
-| graph.id | string | - | graph id, required only if the identityType is 3 |
-| graph.counter | string | - | graph counter, required only if the identityType is 3 |
-| ipfsHash | string | - | ipfsHash, required only if the identityType is 1 |
-| expiry | number | - | (optional) epoch value if the notification has an expiry |
-| hidden | boolean | false | (optional) true if we want to hide the notification |
-| pgpPrivateKey | string | - | (optional) pgp private key for new notification verification proof |
+| account_ | string | - | user address |
+| spaceName* | string | - | group name |
+| spaceDescription* | string | - | group description |
+| spaceImage* | string | - | group image link |
+| listeners* | Array | - | wallet addresses of all listeners except speakers and spaceCreator |
+| speakers* | Array | - | wallet addresses of all speakers except listeners and spaceCreator |
+| isPublic* | boolean | - | true for public space, false for private space |
+| scheduleAt\* | Date | - | Date time when the space is scheduled to start |
+| scheduleEnd | Date | - | Date time when the space is scheduled to end |
+| contractAddressERC20 (deprecated) | string | null | ERC20 Contract Address |
+| numberOfERC20 (deprecated) | int | 0 | Minimum number of tokens required to join the group |
+| contractAddressNFT (deprecated) | string | null | NFT Contract Address |
+| numberOfNFTTokens (deprecated) | int | 0 | Minimum number of nfts required to join the group |
+| rules | Rules | - | conditions for space access (see format below) |
+| pgpPrivateKey | string | null | mandatory for users having pgp keys|
| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
-#### **Direct payload for single recipient(target)**
+## **Rules format**
```typescript
-// apiResponse?.status === 204, if sent successfully!
-const apiResponse = await PushAPI.payloads.sendNotification({
- signer: _signer,
- type: PushAPI.payloads.NOTIFICATION_TYPE.TARGETTED, // target
- identityType: PushAPI.payloads.IDENTITY_TYPE.DIRECT_PAYLOAD, // direct payload
- notification: {
- title: `[SDK-TEST] notification TITLE:`,
- body: `[sdk-test] notification BODY`,
- },
- payload: {
- title: `[sdk-test] payload title`,
- body: `sample msg body`,
- cta: '',
- img: '',
- },
- recipients: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // recipient address
- channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
- env: 'staging',
-});
-```
+export enum ConditionType {
+ PUSH = 'PUSH',
+ GUILD = 'GUILD',
+}
-#### **Direct payload for group of recipients(subset)**
+export type Data = {
+ contract?: string;
+ amount?: number;
+ decimals?: number;
+ guildId?: string;
+ guildRoleId?: string;
+ guildRoleAction?: 'all' | 'any';
+ url?: string;
+ comparison?: '>' | '<' | '>=' | '<=' | '==' | '!=';
+};
-```typescript
-// apiResponse?.status === 204, if sent successfully!
-const apiResponse = await PushAPI.payloads.sendNotification({
- signer: _signer,
- type: 4, // subset
- identityType: 2, // direct payload
- notification: {
- title: `[SDK-TEST] notification TITLE:`,
- body: `[sdk-test] notification BODY`,
- },
- payload: {
- title: `[sdk-test] payload title`,
- body: `sample msg body`,
- cta: '',
- img: '',
- },
- recipients: [
- 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681',
- 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1',
- ], // recipients addresses
- channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
- env: 'staging',
-});
-```
+export type ConditionBase = {
+ type?: ConditionType;
+ category?: string;
+ subcategory?: string;
+ data?: Data;
+ access?: Boolean;
+};
-#### **Direct payload for all recipients(broadcast)**
+export type Condition = ConditionBase & {
+ any?: ConditionBase[];
+ all?: ConditionBase[];
+};
-```typescript
-// apiResponse?.status === 204, if sent successfully!
-const apiResponse = await PushAPI.payloads.sendNotification({
- signer: _signer,
- type: PushAPI.payloads.NOTIFICATION_TYPE.BROADCAST, // broadcast
- identityType: PushAPI.payloads.IDENTITY_TYPE.DIRECT_PAYLOAD, // direct payload
- notification: {
- title: `[SDK-TEST] notification TITLE:`,
- body: `[sdk-test] notification BODY`,
- },
- payload: {
- title: `[sdk-test] payload title`,
- body: `sample msg body`,
- cta: '',
- img: '',
- },
- channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
- env: 'staging',
-});
+export interface Rules {
+ entry?: {
+ conditions: Array;
+ };
+ chat?: {
+ conditions: Array;
+ };
+}
```
-#### **IPFS payload for single recipient(target)**
+
+ Expected response (create space)
```typescript
-// apiResponse?.status === 204, if sent successfully!
-const apiResponse = await PushAPI.payloads.sendNotification({
- signer: _signer,
- type: PushAPI.payloads.NOTIFICATION_TYPE.TARGETTED, // target
- identityType: PushAPI.payloads.IDENTITY_TYPE.IPFS, // ipfs payload
- ipfsHash: 'bafkreicuttr5gpbyzyn6cyapxctlr7dk2g6fnydqxy6lps424mcjcn73we', // IPFS hash of the payload
- recipients: 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1', // recipient address
- channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
- env: 'staging',
-});
-```
+// PushAPI.space.create | Response - 200 OK
+{
+ members: [{
+ wallet: 'eip155:0x727C819feB2c7F99c66d71B8411521bca2010023',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGSrssEBCACg3ZjrZB40Xqr5IKIEtFldaeQyJPNwDACMekY77yApav0B\n' +
+ 'RwiqhFJDFJKcprSHg/vYdqalAIGRQ+J98VMBtHweurIubD/ODB6WknOms7ZY\n' +
+ '3ummaEzyFRombuq/C75o/0ImCi2v0PJBI3kdpwzOjiTt8S44yoAVOcTf9jyg\n' +
+ 'vTEVCOM81yqCf0mDB4t0jqRYewlQuJegORXDKHKTfZcnQybBkDYUGgmxOcyF\n' +
+ 'BaPMhSiWqAAqqb4gcFO2QKq69JoiE9dzSuF/7dvAq2QZRogC/GQW2Q9yQbq3\n' +
+ 'CvMNO4H2KUZzegaq2s2nMPGMXPNf4GZcZVJE1phWgAnApxTf5kUFfKr1ABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZKuywQQLCQcICZDwrCS5ulOLwQMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBFKpO7zcSRed+QmbIfCsJLm6U4vBAABZMwf+OIbBcFQ7x++1\n' +
+ 'NINOYbP9v0PyJvpllDcUORbk3uiPMpvDuQYAe2Fd4dY2Y91l3VdpIm/w6HQy\n' +
+ 'y81Y694w4E7PRVhDwHivv5D10VE9MF3h6qOHrLLpvdhpMaB5Ur8ts5rU2zOu\n' +
+ '64HR04/BVO9N0nrE9iywIgVMOy6IrS+OgK3r75PPX35bam/kbbmZHeygFaE9\n' +
+ '+mgQVdhwgF5borekIiz1Rc8CPA/P1yZy8QQl4KGmJEs+hOc5rPnUWwarvaAH\n' +
+ 'mPb6H0/mG81eXBOjpJlSFu6d/uqKLpoAw5fkvFoIsNwovYpyQkSbhzwe4T2N\n' +
+ 'jGqGd0+La03QdB5FbaiwcnJ96lU6oM7ATQRkq7LBAQgAxu9uK1+p62+/RvcF\n' +
+ 'Mz7g3A8SJiN76NYxk29sjQ9gW74B/IdPv5TlUVhG6PGr2c3SucASlEHieagY\n' +
+ 'CXM2+fpdu4rQ6EKRAe+30GFopfzhX1d0zv9d5BE6q1ML5mkrpDECH5iuqah7\n' +
+ 'smmbRdWE7zRSGaHyEfVqAG3wfMzzN0BcchxxR4vMCNKYLs9v2Q09ecO7DgaY\n' +
+ '5CZqxaFlTo+auuDhE0XU7WRbNL77izocV1Sm+McRyo28PrFTcrRRznD1nP0V\n' +
+ 'eZ4+aoulqyYA+gBBaIUdSA5kQXJiy67crB50yX3V6zLIfptD2ThHPjTY/inW\n' +
+ 'wVHVug4jIWUQ1QQw/q9qvGxAzQARAQABwsB2BBgBCAAqBYJkq7LBCZDwrCS5\n' +
+ 'ulOLwQKbDBYhBFKpO7zcSRed+QmbIfCsJLm6U4vBAADu6wf+NJDX/3NAxQKN\n' +
+ 'Iigj0GkBm/y69iFmQvWJxxtiYCNu8VBhm8MkcghUJ8G2tWP9ueUOM8sMTEa+\n' +
+ 'G+l+wSNwh/1yisF3FutDpy6l+fiy6kPPD4vl08jY3GrqSuWWfMxTJhMZ5D6v\n' +
+ 'OW2EfdyET+oP5eOnCd6p0EXP2ic48rVHDdU2iWeg0RkGvZP3t2LljWFdLbvw\n' +
+ 'h7+wSD1i4LY4slUIdbLdDSLN1gWFN1HXzX10mpX0grV2sBdfkNyHhF0WcIat\n' +
+ 'sD9HpAx2M62yP2D9D9UZVrW7WfmOoyL1NrnXSJsI8CRFDzujvpIrr7875zSi\n' +
+ 'VnxDVyt7twc7cYqRDHsNYuxAuE815A==\n' +
+ '=2jvb\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isSpeaker: true,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA4klEQVR4AcXBoW3FMBRA0dsn75E9skAU6BkMSk1CA0xNsoBnMLSyQPbIDgVlLX0OcPX1Vb1zPj6/v35QWg5o61bQok+MHHVHazmgrVtBE4wJxgRjjofzmuj4xCuiT2iRCe2gJxgTjAnGXMuBTi2MRJ8YOerOSMsBTTAmGBOMuXUraNEntKPuaEfdeUX0iU4taIIxwZhgzPGH6BP/STAmGBOMOR6W+UY7r4l3LPONttITjAnGBGMu+kSnFrQlB96xbgUt+oQmGBOMCcYcDy0HRs5rYmSZb7SWA1pkQhOMCcYEY78uSjTZAXCkaQAAAABJRU5ErkJggg=='
+ }],
+ pendingMembers: [{
+ wallet: 'eip155:0x5f4e9e7Fcc17a943178c0b0881b09E8Ef9D34437',
+ publicKey: null,
+ isSpeaker: false,
+ image: null
+ },
+ {
+ wallet: 'eip155:0xFedfA2b276676C5c6ce753ddb4B05d00104E9236',
+ publicKey: null,
+ isSpeaker: false,
+ image: null
+ }
+ ],
+ contractAddressERC20: "0x8Afa8FDf9fB545C8412499E8532C958086608b30",
+ numberOfERC20: 20,
+ contractAddressNFT: "0x42af3147f17239341477113484752D5D3dda997B",
+ numberOfNFTTokens: 2,
+ verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJkq7LBCZDwrCS5ulOLwRYhBFKpO7zcSRed+QmbIfCsJLm6\n' +
+ 'U4vBAAAAHwf+K4f0gxaP56X4Cv2zlPWB9iUPi/1FOnx8ZF7oEf9xJSv/xA7v\n' +
+ '9LHBTZ2Y9AQlJpy0WLB7KGF7mVV1MdUKHjn2SFQ+1h+8d+FIHXfmB7Ie4alP\n' +
+ 'nnar6XjtMVKYyqXRzMzCq2F7Fjea1sUOXBxAeyJstAGG6nvsU51imaAtGQlQ\n' +
+ 'u7ih8D9UkiOe719v5GyI1vtiS+hHGlYo0+A7WVImH6SuVyPZ3UyPvLxXpeKs\n' +
+ '1SeEfuvfmKHbswm1DDGOknyo7fJ/QgKqOfkwsBIrYRNGwPGEKt8pHdwNxsNn\n' +
+ 'hNQtlFqtmtvieaxbhJQKXHbVgNv206xNsUBrK/U2nCakx7EMmxikFg==\n' +
+ '=tz9T\n' +
+ '-----END PGP SIGNATURE-----\n',
+ spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ spaceName: 'wasteful_indigo_warbler',
+ isPublic: true,
+ spaceDescription: 'boring_emerald_gamefowl',
+ spaceCreator: 'eip155:0x727C819feB2c7F99c66d71B8411521bca2010023',
+ spaceId: 'spaces:e0553610da88dacac70b406d1222a6881c0bde2c5129e58b526b5ae729d82116',
+ scheduleAt: '2023-07-15T14:48:00.000Z',
+ scheduleEnd: '2023-07-15T15:48:00.000Z',
+ status: 'PENDING',
+ rules: {
+ 'spaceAccess': {
+ 'conditions': [
+ {
+ 'any': [
+ {
+ 'type': 'PUSH',
+ 'category': 'ERC20',
+ 'subcategory': 'holder',
+ 'data': {
+ 'contract': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
+ 'amount': 1000,
+ 'decimals': 18
+ }
+ },
+ {
+ 'type': 'GUILD',
+ 'category': 'guildRoles',
+ 'subcategory': 'specificRole',
+ 'data': {
+ 'guildId': '13468',
+ 'guildRoleId': '19924'
+ }
+ }
+ ]
+ }
+ ]
+ }
+ }
+}
-#### **IPFS payload for group of recipients(subset)**
-```typescript
-// apiResponse?.status === 204, if sent successfully!
-const apiResponse = await PushAPI.payloads.sendNotification({
- signer: _signer,
- type: PushAPI.payloads.NOTIFICATION_TYPE.SUBSET, // subset
- identityType: PushAPI.payloads.IDENTITY_TYPE.IPFS, // ipfs payload
- ipfsHash: 'bafkreicuttr5gpbyzyn6cyapxctlr7dk2g6fnydqxy6lps424mcjcn73we', // IPFS hash of the payload
- recipients: [
- 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1',
- 'eip155:5:0x52f856A160733A860ae7DC98DC71061bE33A28b3',
- ], // recipients addresses
- channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
- env: 'staging',
-});
```
-#### **IPFS payload for all recipients(broadcast)**
+
-```typescript
-// apiResponse?.status === 204, if sent successfully!
-const apiResponse = await PushAPI.payloads.sendNotification({
- signer: _signer,
- type: PushAPI.payloads.NOTIFICATION_TYPE.BROADCAST, // broadcast
- identityType: PushAPI.payloads.IDENTITY_TYPE.DIRECT_PAYLOAD, // direct payload
- ipfsHash: 'bafkreicuttr5gpbyzyn6cyapxctlr7dk2g6fnydqxy6lps424mcjcn73we', // IPFS hash of the payload
- channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
- env: 'staging',
-});
-```
+---
-#### **Minimal payload for single recipient(target)**
+### **To check user access of a token gated space**
```typescript
-// apiResponse?.status === 204, if sent successfully!
-const apiResponse = await PushAPI.payloads.sendNotification({
- signer: _signer,
- type: PushAPI.payloads.NOTIFICATION_TYPE.TARGETTED, // target
- identityType: PushAPI.payloads.IDENTITY_TYPE.MINIMAL, // Minimal payload
- notification: {
- title: `[SDK-TEST] notification TITLE:`,
- body: `[sdk-test] notification BODY`,
- },
- payload: {
- title: `[sdk-test] payload title`,
- body: `sample msg body`,
- cta: '',
- img: '',
- },
- recipients: 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1', // recipient address
- channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
+
+// actual api
+const response = await PushAPI.space.getAccess({
+ spaceId:'8f7be0068a677df166c2e5b8a9030fe8a4341807150339e588853c0049df3106',
+ did: '0x9e60c47edF21fa5e5Af33347680B3971F2FfD464'
env: 'staging',
});
```
-#### **Minimal payload for a group of recipient(subset)**
+Allowed Options (params with \_ are mandatory)
+| Param | Type | Default | Remarks |
+|----------|---------|---------|--------------------------------------------|
+| spaceId | string | - | space address |
+| did | string | - | user address |
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+
+
+ Expected response (space access)
```typescript
-// apiResponse?.status === 204, if sent successfully!
-const apiResponse = await PushAPI.payloads.sendNotification({
- signer: _signer,
- type: PushAPI.payloads.NOTIFICATION_TYPE.SUBSET, // subset
- identityType: PushAPI.payloads.IDENTITY_TYPE.MINIMAL, // Minimal payload
- notification: {
- title: `[SDK-TEST] notification TITLE:`,
- body: `[sdk-test] notification BODY`,
- },
- payload: {
- title: `[sdk-test] payload title`,
- body: `sample msg body`,
- cta: '',
- img: '',
- },
- recipients: [
- 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1',
- 'eip155:5:0x52f856A160733A860ae7DC98DC71061bE33A28b3',
- ], // recipients address
- channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
- env: 'staging',
-});
+// PushAPI_chat_getSpaceAccess | Response - 200 OK
+{
+ 'spaceAccess': true,
+ 'rules': {
+ 'spaceAccess': {
+ 'conditions': [
+ {
+ 'any': [
+ {
+ 'type': 'PUSH',
+ 'category': 'ERC20',
+ 'subcategory': 'holder',
+ 'data': {
+ 'contract': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
+ 'amount': 1000,
+ 'decimals': 18
+ },
+ 'access': false
+ },
+ {
+ 'type': 'GUILD',
+ 'category': 'guildRoles',
+ 'subcategory': 'specificRole',
+ 'data': {
+ 'guildId': '13468',
+ 'guildRoleId': '19924'
+ },
+ 'access': true
+ },
+ {
+ 'type': 'PUSH',
+ 'category': 'ERC721',
+ 'subcategory': 'owner',
+ 'data': {
+ 'contract': 'eip155:5:0x42af3147f17239341477113484752D5D3dda997B',
+ 'amount': 1
+ },
+ 'access': true
+ }
+ ]
+ }
+ ]
+ }
+}
+
```
-#### **Minimal payload for all recipients(broadcast)**
+
-```typescript
-// apiResponse?.status === 204, if sent successfully!
-const apiResponse = await PushAPI.payloads.sendNotification({
- signer: _signer,
- type: PushAPI.payloads.NOTIFICATION_TYPE.BROADCAST, // broadcast
- identityType: PushAPI.payloads.IDENTITY_TYPE.MINIMAL, // Minimal payload
- notification: {
- title: `[SDK-TEST] notification TITLE:`,
- body: `[sdk-test] notification BODY`,
- },
- payload: {
- title: `[sdk-test] payload title`,
- body: `sample msg body`,
- cta: '',
- img: '',
- },
- channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
- env: 'staging',
-});
-```
+---
-#### **Graph payload for single recipient(target)**
+### **To update space details**
-**_Make sure the channel has the graph id you are providing!!_**
+Note - updateSpace is an idompotent call
```typescript
-// apiResponse?.status === 204, if sent successfully!
-const apiResponse = await PushAPI.payloads.sendNotification({
- signer: _signer,
- type: PushAPI.payloads.NOTIFICATION_TYPE.TARGETTED, // target
- identityType: PushAPI.payloads.IDENTITY_TYPE.SUBGRAPH, // Subgraph payload
- graph: {
- id: '_your_graph_id',
- counter: 3,
- },
- recipients: 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1', // recipient address
- channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
- env: 'staging',
-});
-```
-
-#### **Graph payload for group of recipients(subset)**
+// pre-requisite API calls that should be made before
+// need to get user and through that encryptedPvtKey of the user
+const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging');
-**_Make sure the channel has the graph id you are providing!!_**
+// need to decrypt the encryptedPvtKey to pass in the api using helper function
+const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer);
-```typescript
-// apiResponse?.status === 204, if sent successfully!
-const apiResponse = await PushAPI.payloads.sendNotification({
- signer: _signer,
- type: PushAPI.payloads.NOTIFICATION_TYPE.SUBSET, // subset
- identityType: PushAPI.payloads.IDENTITY_TYPE.SUBGRAPH, // graph payload
- graph: {
- id: '_your_graph_id',
- counter: 3,
- },
- recipients: [
- 'eip155:5:0xCdBE6D076e05c5875D90fa35cc85694E1EAFBBd1',
- 'eip155:5:0x52f856A160733A860ae7DC98DC71061bE33A28b3',
- ], // recipients addresses
- channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
- env: 'staging',
+// actual api
+const response = await PushAPI.space.update({
+ spaceId: 'spaces:e0553610da88dacac70b406d1222a6881c0bde2c5129e58b526b5ae729d82116',
+ spaceName: 'Push Space 3',
+ spaceDescription: 'This is the oficial space for Push Protocol',
+ listeners: ['0x2e60c47edF21fa5e5A333347680B3971F1FfD456','0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
+ spaceImage: <group image link> ,
+ speakers: ['0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
+ scheduleAt: '2023-07-15T14:48:00.000Z',
+ scheduleEnd: '2023-07-15T15:48:00.000Z',
+ status: PushAPI.ChatStatus.PENDING,
+ account: '0xD993eb61B8843439A23741C0A3b5138763aE11a4',
+ env: 'staging',
+ pgpPrivateKey: pgpDecryptedPvtKey, //decrypted private key
});
```
-#### **Graph payload for all recipients(broadcast)**
+### **To update token gated space details**
-**_Make sure the channel has the graph id you are providing!!_**
+Note - updateSpace is an idompotent call
```typescript
-// apiResponse?.status === 204, if sent successfully!
-const apiResponse = await PushAPI.payloads.sendNotification({
- signer: _signer,
- type: PushAPI.payloads.NOTIFICATION_TYPE.BROADCAST, // broadcast
- identityType: PushAPI.payloads.IDENTITY_TYPE.SUBGRAPH, // graph payload
- graph: {
- id: '_your_graph_id',
- counter: 3,
- },
- channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // your channel address
- env: 'staging',
+// pre-requisite API calls that should be made before
+// need to get user and through that encryptedPvtKey of the user
+const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging');
+
+// need to decrypt the encryptedPvtKey to pass in the api using helper function
+const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer);
+
+// actual api
+const response = await PushAPI.space.update({
+ spaceId: 'spaces:e0553610da88dacac70b406d1222a6881c0bde2c5129e58b526b5ae729d82116',
+ spaceName: 'Push Space 3',
+ spaceDescription: 'This is the oficial space for Push Protocol',
+ listeners: ['0x2e60c47edF21fa5e5A333347680B3971F1FfD456','0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
+ spaceImage: <group image link> ,
+ speakers: ['0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
+ scheduleAt: '2023-07-15T14:48:00.000Z',
+ scheduleEnd: '2023-07-15T15:48:00.000Z',
+ status: PushAPI.ChatStatus.PENDING,
+ rules: {
+ 'entry': {
+ 'conditions': [
+ {
+ 'any': [
+ {
+ 'type': 'PUSH',
+ 'category': 'ERC20',
+ 'subcategory': 'token_holder',
+ 'data': {
+ 'address': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
+ 'amount': 1000,
+ 'decimals': 18
+ }
+ },
+ {
+ 'type': 'GUILD',
+ 'category': 'guildRoles',
+ 'subcategory': 'allRoles',
+ 'data': {
+ 'guildId': '13468'
+ }
+ }
+ ]
+ }
+ ]
+ },
+ 'chat': {
+ 'conditions': [
+ {
+ 'all': [
+ {
+ 'type': 'PUSH',
+ 'category': 'ERC20',
+ 'subcategory': 'token_holder',
+ 'data': {
+ 'address': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
+ 'amount': 1000,
+ 'decimals': 18
+ }
+ },
+ {
+ 'type': 'GUILD',
+ 'category': 'guildRoles',
+ 'subcategory': 'specificRole',
+ 'data': {
+ 'guildId': '13468',
+ 'guildRoleId': '19924'
+ }
+ }
+ ]
+ }
+ ]
+ }
+ },
+ account: '0xD993eb61B8843439A23741C0A3b5138763aE11a4',
+ env: 'staging',
+ pgpPrivateKey: pgpDecryptedPvtKey, //decrypted private key
});
```
+Allowed Options (params with _ are mandatory)
+| Param | Type | Default | Remarks |
+|----------|---------|---------|--------------------------------------------|
+| spaceId_ | string | - | Id of the space |
+| account* | string | - | user address |
+| spaceName* | string | - | space name |
+| spaceDescription* | string | - | space description |
+| spaceImage* | string | - | space image |
+| status* | string | - | space status - 'ACTIVE', 'PENDING', 'ENDED' |
+| listeners* | Array | - | wallet addresses of all listeners except speakers and spaceCreator |
+| speakers* | Array | - | wallet addresses of all speakers except listeners and spaceCreator |
+| scheduleAt* | Date | - | Date time when the space is scheduled to start |
+| scheduleEnd | Date | - | Date time when the space is scheduled to end |
+| contractAddressERC20 (deprecated) | string | null | ERC20 Contract Address |
+| numberOfERC20 (deprecated) | int | 0 | Minimum number of tokens required to join the space |
+| contractAddressNFT (deprecated) | string | null | NFT Contract Address |
+| numberOfNFTTokens (deprecated) | int | 0 | Minimum number of nfts required to join the space |
+| rules | Rules | - | conditions for space and chat access (see format above) |
+| pgpPrivateKey | string | null | mandatory for users having pgp keys|
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+
- Expected response (Send Notification)
+ Expected response (update space)
```typescript
-// PushAPI.payloads.sendNotification | Response - 204 OK
+// PushAPI.space.update | Response - 200 OK
+{
+ members: [
+ {
+ wallet: 'eip155:0x367c6555b2CAD9C2d2656066EC3996Ba12cD058d',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGSr17UBCADhEXWz/lsg0sDA+QRygzl+4t84/YYa459nzFRNB36jkbU8\n' +
+ 'FxRsE6oZTu0Leanup7aul4trJJ4qyA6xFfDjprDzrm1Gtp/gos46Lxk+br64\n' +
+ 'lzgqTfSKpBs9UWqOcr4Vnoq9WeOiFZax0DhN//7ibIQDWIJ0E6iOc8uiSoGZ\n' +
+ 's4AHTx7GtUvHxIUAk/hQY8UjjDNyhgCSrmdPeWt/SVbmFCHchdH/KhSK8JVq\n' +
+ 'qs8/nKx2Tm/nmAdWFZDqIJxd5tVuXXMxTZYZADZfmBltR2F/8GkF7hfX/aOo\n' +
+ 'gGQ/u2FPbCKRjtedfJi3WsPUKtyFg6QdwBnOQmYn0fGXlPGR7UVSsmIVABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZKvXtQQLCQcICZD2NRrvru2XMgMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBM1nsbalDm3PtLAK2/Y1Gu+u7ZcyAADzuwgAmTBbnBQZ2w06\n' +
+ 'RbLmcZf8cYTof1X3mpYBa1lprMltib2jZQdu8DxhZBapYIE1O0UzV2Dy8IXj\n' +
+ 'zavtNFZiLR8FTwkrXQ3DGrZylnqjLkQ6m2jZsGIypb2OpTlBIBnjW98Dh99F\n' +
+ 'egI/5wse59IfGhYXVcKluKDAW2ezUJx8BhacZCwf/S8iG9YKrZctS5cVZxQw\n' +
+ 'SymXv88msoQrWhxmu2AT0rNsZ656ANMr/MuUjKMxQsoNCNIkp5kE0UTGfMwc\n' +
+ 'c69Gabs9uOPOqAGeSBGVfw+uJig/RJ4MWDCbj6QIDsV5FFRvTmJmmSNLNH5y\n' +
+ '83pHxE+923z6NiPWRonbns3pFNvhnc7ATQRkq9e1AQgAxjGMkGhs2OTW8fW/\n' +
+ '4tloJOID0UIDrz/24uX4JU+qjTqMzFyNGaNagT8n0xDH2E63YFmketip4QA2\n' +
+ '6kUBICKR2Y5kNNzkJXK4NYfa5OXEIS+lw+X7oMXd9YJ/D1fig1XD4Bf0ofsZ\n' +
+ 'QIxHOn6w3T/wQHOBpu+cqE3d0pW+6s6hZ4mkuPk6OXrkBSEtynk4ADQS+a3b\n' +
+ 'PrCGU9rJy2OnbP+lMr3onv/6BR/DFE4qCIfQt0cLu4nhAuYVYrOupi3p9eBQ\n' +
+ 'z/oWHCSNQVQSW2/vHp0YwMj2r3jSGdoZ3pcfy4iXOa7xEyeauOn/pHK+syOX\n' +
+ 'Pv64DHncql4AJFj9tw4rZ2/kkQARAQABwsB2BBgBCAAqBYJkq9e1CZD2NRrv\n' +
+ 'ru2XMgKbDBYhBM1nsbalDm3PtLAK2/Y1Gu+u7ZcyAADapwf/XF6I2NifyL/h\n' +
+ '2aVsr2lL2At732336je3WM6QnA/q1x9lmxX646c9eETUQvLLhT5RZmx1X8Fa\n' +
+ 'X/qGMKJe+BWLFPy5k6LnOezvvOxHGV+dzRndlWbnC9d3AZhThciw/Rd8V9W6\n' +
+ 'd6luo7+Apdd3rS17hG4gElhNX1drq5TuWR89yxA5oXcIqA+u3jBdpz0qo/ME\n' +
+ '+63r0AubixdM7rgV0skugaIXvqMKtfMC/V2A8mCL5AmRXCyfMBIsEA0L5YA1\n' +
+ 'wsKlHIQAy3jiPdY/2q5KUWJsR9o/IFirjnTd5vywtYsscOq/KnfLKdc2cVOr\n' +
+ 'e/vSkTOrD+dVTlxGhADoud4kvcOPtg==\n' +
+ '=6H2/\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isSpeaker: true,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAy0lEQVR4AcXBMU5DMRBF0cvI63FJETn7oXY3K3CBNHX2g/WFKKdnLdCOUnyEgnjnPH2+v35RXPagOsbmEZc9qI6xqQwxQ8wQa9w5xuYvHWNzxhAzxAyxxg8ynKrPxZkMp+pzccYQM8QMsZbhVH0uzmQ4j8hwKkPMEDPEWp+LKsOp+lxUGc6ZPhdVhlP1uagMMUPMEGsZzn/KcCpDzBAzxBp3+lxUGU718vzGmVtcqfpcVBlOZYgZYoZY63PxG7ePK4/oc1EZYoaYIfYN05Y0ReqpB6sAAAAASUVORK5CYII='
+ }
+ ],
+ pendingMembers: [
+ {
+ wallet: 'eip155:0xB026B0A8BB1fea997a73c5a84fe7aF8cAab1AcF2',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA4ElEQVR4AcXBsU0EMRCG0Y+RC3ETzpwheqAFOnBmOZtSNqGC02abOaUAdwLp3AU+IYT+916+Pj6/CXLp/Kc1B5EhZogZYokn1hxEuXR21hxEuXR2DDFDzBBLuXSiNQdRaxeR+2CntYvIfRDl0okMMUPMEEs8cZw37pQbO8fJnUVlxxAzxAyxxINcOtGag7/IpbNjiBlihlh6f30jcq9EuXSiNQc7uXSiNQdRaxeRIWaIGWLJvRK1dhEdJ3dy6fxGaxeReyUyxAwxQyzxwL0SLSpRLp2dNQeRT7YMMUPMEPsB1yM4zt7CMugAAAAASUVORK5CYII='
+ },
+ {
+ wallet: 'eip155:0x9b70FD7164ec0Ed3E1B3E318836522340dd2e125',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA0UlEQVR4AcXBMWoDMRRF0ZtnkWYKgddgGKbSVrSILFBbUWUMLrICgwqXQ9L+NDKDIe+cj8+v7x+CPhpRyZV39NGISq5EwkyYCbN0f9z4a2Omj8ZMyZVo2Tei++NGJMyEmTBLz9OVqOTKTMmVIy7nlaiPRiTMhJkwS8u+8Z+WfSMSZsJMmKXLeWWmj0a07Bszz9OVqORKdDmvRMJMmAmzxAslV45ZOUKYCTNhlvpozJRcifpozJRcifpozAgzYSbMEi/00YhKrsz00ThCmAkzYfYLlLsvpsHyBx0AAAAASUVORK5CYII='
+ },
+ {
+ wallet: 'eip155:0x1A050099a08D7faf3b5923669a0FAe42A0872D72',
+ publicKey: null,
+ isSpeaker: false,
+ image: null
+ }
+ ],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJkq9e1CZD2NRrvru2XMhYhBM1nsbalDm3PtLAK2/Y1Gu+u\n' +
+ '7ZcyAAA0igf/Tgo/WU4C5g4UtHPCwU/jThQwjElzCa96bZU8bCXsgnoO1NMI\n' +
+ 'fwI7FxIw8FmFrktHIWT10T/9vq2ItyUvpbWRhnD5zt5aRhJ1KA1z06iwkoUt\n' +
+ 'DLiPfveoSDyIhUIjx5PUMN0r/tXmLhj3CrkHx1hiPBxEkhi9brfFcOvX57HS\n' +
+ 'VOKOeeUa4G1cmk6dtzLHWT4p7ekrFhZPHXDtZUMZEU2wbMkB6bRqlZ7UYLbN\n' +
+ '7+0AvCu7uaCYG0zfbl3oZc6DkIm9jnBknsII6Hqv7Dc9NLAUBWo8tPrW2/KN\n' +
+ '8Bv/gk5HPb16tOihIUjs8v45wO3oTPAQYbJGdF6ta+HyiKO8JWipbw==\n' +
+ '=wkHz\n' +
+ '-----END PGP SIGNATURE-----\n' +
+ ':null',
+ spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ spaceName: 'mobile_aquamarine_constrictor',
+ isPublic: true,
+ spaceDescription: 'conventional_crimson_dove',
+ spaceCreator: 'eip155:0x367c6555b2CAD9C2d2656066EC3996Ba12cD058d',
+ spaceId: 'spaces:108f766a5053e2b985d0843e806f741da5ad754d128aff0710e526eebc127afc',
+ scheduleAt: '2023-07-15T14:48:00.000Z',
+ scheduleEnd: '2023-07-15T15:48:00.000Z',
+ status: 'PENDING',
+ rules: {
+ 'spaceAccess': {
+ 'conditions': [
+ {
+ 'any': [
+ {
+ 'type': 'PUSH',
+ 'category': 'ERC20',
+ 'subcategory': 'token_holder',
+ 'data': {
+ 'address': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
+ 'amount': 1000,
+ 'decimals': 18
+ }
+ },
+ {
+ 'type': 'GUILD',
+ 'category': 'guildRoles',
+ 'subcategory': 'specificRole',
+ 'data': {
+ 'guildId': '13468',
+ 'guildRoleId': '19924'
+ }
+ },
+ {
+ 'type': 'PUSH',
+ 'category': 'ERC721',
+ 'subcategory': 'nft_owner',
+ 'data': {
+ 'address': 'eip155:5:0x42af3147f17239341477113484752D5D3dda997B',
+ 'amount': 1
+ }
+ }
+ ]
+ }
+ ]
+ }
+ }
+}
```
---
-### Notification Helper Utils
-
-#### **Parsing notifications**
-
-Utils method to parse raw Push Feeds API response into a pre-defined shape as below.
+### **To get space details by spaceId**
```typescript
-// fetch some raw feeds data
-const apiResponse = await PushAPI.user.getFeeds({
- user: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // user address
- raw: true,
+const response = await PushAPI.space.get({
+ spaceId:
+ 'spaces:108f766a5053e2b985d0843e806f741da5ad754d128aff0710e526eebc127afc',
env: 'staging',
});
-// parse it to get a specific shape of object.
-const parsedResults = PushAPI.utils.parseApiResponse(apiResponse);
-
-const [oneNotification] = parsedResults;
-
-// Now this object can be directly used by for e.g. "@pushprotocol/uiweb" NotificationItem component as props.
-
-const {
- cta,
- title,
- message,
- app,
- icon,
- image,
- url,
- blockchain,
- secret,
- notification,
-} = oneNotification;
-```
-
-_We get the above `keys` after the parsing of the API repsonse._
-
----
-
-### Advanced Notifications (WIP)
-
-### DEPRECATED
-
-#### **Get a channel's subscriber list of addresses**
-
-```typescript
-const subscribers = await PushAPI.channels.getSubscribers({
- channel: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681', // channel address in CAIP
- page: 1, // Optional, defaults to 1
- limit : 10 // Optional, defaults to 10
- env: 'staging'
-});
```
Allowed Options (params with _ are mandatory)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
-| channel_ | string | - | channel address (CAIP) |
+| spaceId_ | string | - | space id |
| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
- Expected response (Get channel's subscribers list)
+ Expected response (get space by space id)
```typescript
-// PushAPI.channels.getSubscribers | Response - 200 OK
+// PushAPI_space_get | Response - 200 OK
{
- "itemcount": 11,
- "subscribers": [
- "0x1d4f52775344f9a32093af0ccd03a4fb6dac8e30",
- "0x28d615edd8404f8ca1e0271a0b5a48171589921a",
- "0x4352639b99689069f9b0b847eee349c3c1b0706c",
- "0x50029e62540537045bcfd3d320483865344edb33",
- "0x5ac9e6205eaca2bbba6ef716fd9aabd76326eeee",
- "0x778d3206374f8ac265728e18e3fe2ae6b93e4ce4",
- "0xa44f2994750cf774eab05751d90ade4dedabe7fe",
- "0xbcfb7da1dcf40e8cfb331683bb7d6f4eba091b08",
- "0xcf5dbf241fc65a5af56c95101ac4e9ec2c57d941",
- "0xd8634c39bbfd4033c0d3289c4515275102423681"
- ]
-}
-```
-
-
-
----
-
-## For Video
-
-### **Instance Variables**
-
-#### **peerInstance**
-
-- Used to store the simple peer instance used for the webRTC connection.
-
-```typescript
-private peerInstance: any = null;
-```
-
----
-
-#### **signer**
-
-- Used to store the signer of a user.
-- Used in the request, acceptRequest and disconnect methods to send notifications.
-
-```typescript
- private signer: SignerType;
-```
-
----
-
-#### **chainId**
-
-The chain id of the chain on which the call is being conducted.
-
-```typescript
- private chainId: number;
-```
-
----
-
-#### **pgpPrivateKey**
-
-- Used to store the PGP private key of a user.
-- Used in the request, acceptRequest and disconnect methods to send notifications.
-
-```typescript
- private pgpPrivateKey: string;
-```
-
----
-
-#### **env**
-
-- The environment on which the call is being conducted.
-
-```typescript
-private env: ENV;
-```
-
----
-
-### **data**
-
-- Stores data related to the video call.
-
-```typescript
-export type IMediaStream = MediaStream | null;
-
-export enum VideoCallStatus {
- UNINITIALIZED,
- INITIALIZED,
- RECEIVED,
- CONNECTED,
- DISCONNECTED,
- RETRY_INITIALIZED,
- RETRY_RECEIVED,
-}
-
-export type PeerData = {
- stream: IMediaStream; // incoming media stream
- audio: boolean | null; // incoming audio status
- video: boolean | null; // incoming video status
- address: string; // incoming address
- status: VideoCallStatus; // status for the connection with incoming peer
- retryCount: number; // number of retires done
-};
-
-export type VideoCallData = {
- meta: {
- chatId: string; // unique chatId for the corresponding push w2w chat
- initiator: {
- address: string; // initiator's address
- signal: any; // initiator's signaling data for webRTC connection
- };
- broadcast?: {
- livepeerInfo: any;
- hostAddress: string;
- coHostAddress: string;
- };
- };
- local: {
- stream: IMediaStream; // local media stream
- audio: boolean | null; // local audio status
- video: boolean | null; // local video status
- address: string; // local address
- };
- incoming: [PeerData];
-};
-
-private data: VideoCallData;
-```
-
----
-
-#### **setData**
-
-- This function can be used to update the video call `data`
-
-```typescript
-setData: (fn: (data: VideoCallData) => VideoCallData) => void;
-
-// usage
-
-import { produce } from 'immer';
-
-setData((oldData) => {
- return produce(oldData, (draft) => {
- // update the draft object, example
- draft.incoming.status = VideoCallStatus.INITIALIZED;
- });
-});
+ members: [
+ {
+ wallet: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGSr528BCADI8kQcWkaw9PKmSrwCtPBDWj+wzPhmok9jAzxzb2+qAjSV\n' +
+ 'rYdIrnx6PAp1rMU6qoVg4cdDbCYPV+kCj8l3lUzH/a/SfPsDWpspA/ICWMeS\n' +
+ 'dMdGYxHLk2gsu0wRz69qoddXMY1h5eMZEyRnr2fsX/cy15mxO2IEHYnC2/rp\n' +
+ '06iFpx1T8k5HWgFDpyleWyMSQ7Bnn7GutrlHYEVtIGVfXDSkea8IDLLkzBEV\n' +
+ '3jlBUFhpsrlcvDwDYcMYOrqSBEtg1a+GMK+2Ye/hF37KUYTAPleKXeN0cYIs\n' +
+ 'Va8oleZK960XYfuy5SYCJav2kaAggNWQBie5G9C4H3h7FuFwWk8LH3DhABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZKvnbwQLCQcICZBm9Bz6DvB6DwMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBPkdSvwnOBuAJaOWAGb0HPoO8HoPAAAkiQgAukm3owebckwr\n' +
+ 'xAR42r/+CBx1uoqM2ZeEAUeYtBF7sdLEsdxFrxl8wHKAbglZwtgWcfG95v2R\n' +
+ 'zLcBco3v9p0IuS6DZduIfhngZ49gpYwqFGyiCOvo+k14tuMbrbOZTTKp0uc6\n' +
+ 'icpTyP8/1U0nZrQmmSXyfh6Hgmx1OnW3zTM7oUN1ZVvj3V6rOl+ktUPjAaYo\n' +
+ 'CWJjth92xhDWEPZnC/4Gz2eRoTVtmx8u+/2vNPffQVgzzHznUxB+G5XeZmPk\n' +
+ 'z8oxxSxII8PNiAs5LizqPjyq2gEv25GlCsMXTYz60n/t/4G7Yc94yu8xD8u3\n' +
+ 'BpWluHC2eW0pYFcDfiNLfv0uJCrUcM7ATQRkq+dvAQgA7v7Zz4CZdPsd4jvB\n' +
+ 'uDwjop/Gvoz+rbvAdS3Xrsi+OTyrWAqidnXChhwExlUNelZ9v52lGxe1twwr\n' +
+ 'vxeQ4M0pv4oqSlZxhkqBCyj+E7ECR2WXG7ccLlzYOz3b5BXT+fEkmVsbVTjA\n' +
+ 'Kttjosm7FtY4igY2Hu4UlZZW8M1tYL1R/UegFeMYGY7aO7dcKeiP0NsDwm3c\n' +
+ '0SiU6/JlOXAIi/ZSKDJ4b5BPK6GFj5pNWr92/V7LejlZfoHAVDbb91tiPGdP\n' +
+ 'y3+r9T3IYsgUDLgOpPQn6o82Nctm6CnIZqAN12nJ1DEJP2JyLDedg9b5H+aa\n' +
+ 'FDZFc7yQ3In/QPtjHImydLt9NwARAQABwsB2BBgBCAAqBYJkq+dvCZBm9Bz6\n' +
+ 'DvB6DwKbDBYhBPkdSvwnOBuAJaOWAGb0HPoO8HoPAABRUQf+KoF4UXuseLBO\n' +
+ 'd0PD0+hEcnsYbaPWmPZtJPWusxPl6kt421luymPiThDXwaMVzRrmxkz0dNZ3\n' +
+ 'bUFYtS24t2BhlXZ6cGFNRjXrA9OV0kLg/kNm1vboQ1GL8qRV9CIjPVEpksQp\n' +
+ 'tOiYN+X+/2XdPJkaQpITHIFV067qWQSAKIonvOI8OJYOovGRQTInz0VE71Yn\n' +
+ 'SeiOilKBK+p2RN38jGr0PGWt740KJ6560FzfUwTAQzz9vrkYa+vEhWe+bzOd\n' +
+ 'YBpxj/BRTGR19DrKlGcFPdTYz5ADxCjBuCxXgoRCbBiWwh+iIstk5qkT8uHK\n' +
+ 'NQjzDvo3RO1cROQp0zsikladmzGZHQ==\n' +
+ '=q/e/\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isSpeaker: true,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA10lEQVR4AcXBsWnFMBSG0c8/brOD9kgfogHUGQIuAppInSsVAQ2gdbSD64fTXl4hMI/HPWf5fXxf3DDaxkxIlTuEM+FMOFt5MtqG1XvBipGpsp9YMWaskCqWcCacCWfL4+fzwogx8069FyzhTDgTzpavv3oxEVLlFaNtzAhnwplwtvIkpIpV9hMrxsxM7wUrHxVrtA1LOBPOhLM1pIo12oaVj4rV98JMPj6wRtuwQqpYwplwJpyt3BRjZiZQuUM4E86Es7XsJ1aMTIVUeUXZTyzhTDgTzv4BnGY033BWusUAAAAASUVORK5CYII='
+ }
+ ],
+ pendingMembers: [
+ {
+ wallet: 'eip155:0xaC6C69c657cF6022fa787B14BDdaA22936B56D65',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA2UlEQVR4AcXBQWoEIRBA0Z+ikOwNDHirbARPKDiLvkzOIATaC4iQbGt6ITSzqPc+np8/fxhpVazzcfCOr99vrK4FS3AmOBOcKRddCy9GwQoxszNHw+rKluBMcCY407QqO10L1hyNO9Kq7AjOBGeCMz0fB9YcjZ20KjtdC1bXghVixhKcCc4EZzpH446uhXfM0bAEZ4IzwZmGmLHmaOyEmNmZo7ETYsYSnAnOBGfKRVoVq2vBmqNxR1oV6+SV4ExwJjhTLroWdkLM7MzRsLoWrMCBJTgTnAnO/gGd1jrTKk/8EAAAAABJRU5ErkJggg=='
+ },
+ {
+ wallet: 'eip155:0xEf532414907E8c631307c0d501cDe6D1694bAF5e',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA00lEQVR4AcXBobHDMBBF0ZsdjftIDeGuIkzIaGsQC1MNQkZirsLcnaQCk3yqBOzMH4N3zu11f38I+GPiinacRAwxQ8wQS/zo1flSGqNenUgujVGvziiXxsgQM8QMscSPXBqjXp1RLo1Ir84ol0bEEDPEDLHkj4lI51uvzn/4YyJiiBlihlhqx0lkZ2U0Pxci+7YyasdJxBAzxAyx1KsT8W3lil6diCFmiBlit9f9/SHQq3NFLo2IIWaIGWKpVyeybyuj+bkQ2beV0VwXIoaYIWaI/QH8GTSs76EUEQAAAABJRU5ErkJggg=='
+ },
+ {
+ wallet: 'eip155:0x2F5f27B523C8888eA79b7FA80a9CbA6b6980784c',
+ publicKey: null,
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA0klEQVR4AcXBsW3DQAxA0W9CExjIDhogfboDCw9gICvcHmldcIAMoYLgJJ5CKzgto4KA4ILvXT5+Pl8kwydZqJHt60bl+ryRDZ9koUYmNBOaCc0u31+/L04INSrDJ2cIzYRmQrMl1Dhj+KQSapwhNBOaCc0WDvZ1o+ROZV83KtfnjUxoJjQTmi0c3B/OO+4PpxLKP0IzoZnQbBk+yUKNyvBJJdSoDJ9kQjOhmdBsCTWy4ZNKqFEZPqmEGpnQTGgmNFs4CDWy4ZN3hBoVoZnQTGj2BxvbMvuaMCXUAAAAAElFTkSuQmCC'
+ }
+ ],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJkq+dvCZBm9Bz6DvB6DxYhBPkdSvwnOBuAJaOWAGb0HPoO\n' +
+ '8HoPAAD5ywf/cvaGM0DzcB22Q2FMzUZG4/ZmkN4OknvSj0d4hB/sPUIb9176\n' +
+ 'z+niFMjWZNFpIj8s36f16oMEZZ+Eleu9t6sECBxRDvO8pEwyByCXSmz8e/SH\n' +
+ 'Y659cvg5/A3bSe0FqR0VTI1o+Uz2BpnXG/P38C6D46btaIaJcr4cIh88wQ9J\n' +
+ 'lr05hOE7w/7Uo5OwyXala0NfB+8S4LIfpC2OlPOhyHQEJd2+WoFKb/6dO28D\n' +
+ 'TLuvgYJXJfc4R3ElcgFfm1N9ylG0Pt1F3c0C/k9bNokR2PVXgX2XSTQsx1rD\n' +
+ 'MCY/ePr93INyNZuTPcPlK87X6OTa2/gEW161vup2Xn2Did9HtL76Qw==\n' +
+ '=EkOP\n' +
+ '-----END PGP SIGNATURE-----\n' +
+ ':null',
+ spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ spaceName: 'intellectual_green_bat',
+ isPublic: true,
+ spaceDescription: 'sad_purple_pinniped',
+ spaceCreator: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
+ spaceId: 'spaces:9dab226c7920fe06154d76f78dfe1187bdc4fda712cdd9a8b37cc6a99741a63b',
+ scheduleAt: '2023-07-15T14:48:00.000Z',
+ scheduleEnd: '2023-07-15T15:48:00.000Z',
+ status: 'PENDING'
+}
```
----
+
-### **Methods**
+---
-#### **constructor**
+### **To start a space**
```typescript
-constructor({
- signer,
- chainId,
- pgpPrivateKey,
- env,
- setData,
- }: {
- signer: SignerType;
- chainId: number;
- pgpPrivateKey: string;
- env?: ENV;
- setData: (fn: (data: VideoCallData) => VideoCallData) => void;
- }) {}
+const response = await PushAPI.space.start({
+ spaceId:
+ 'spaces:108f766a5053e2b985d0843e806f741da5ad754d128aff0710e526eebc127afc',
+ env: 'staging',
+});
```
Allowed Options (params with _ are mandatory)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
-| signer_ | SignerType | - | signer object for a user |
-| chainId* | number | - | chainId for the video call - Eth Mainnet: 1, Polygon Mainnet: 137 |
-| pgpPrivatekey* | string | - | PGP private key of the user, used while sending video call notifications |
+| spaceId_ | string | - | space id |
| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
-| setData\* | `(fn: (data: VideoCallData) => VideoCallData) => void` | - | Function to update video call data |
----
+
+ Expected response (start space by space id)
-#### **create**
+```typescript
+// PushAPI_space_start | Response - 200 OK
+{
+ members: [
+ {
+ wallet: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGSr528BCADI8kQcWkaw9PKmSrwCtPBDWj+wzPhmok9jAzxzb2+qAjSV\n' +
+ 'rYdIrnx6PAp1rMU6qoVg4cdDbCYPV+kCj8l3lUzH/a/SfPsDWpspA/ICWMeS\n' +
+ 'dMdGYxHLk2gsu0wRz69qoddXMY1h5eMZEyRnr2fsX/cy15mxO2IEHYnC2/rp\n' +
+ '06iFpx1T8k5HWgFDpyleWyMSQ7Bnn7GutrlHYEVtIGVfXDSkea8IDLLkzBEV\n' +
+ '3jlBUFhpsrlcvDwDYcMYOrqSBEtg1a+GMK+2Ye/hF37KUYTAPleKXeN0cYIs\n' +
+ 'Va8oleZK960XYfuy5SYCJav2kaAggNWQBie5G9C4H3h7FuFwWk8LH3DhABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZKvnbwQLCQcICZBm9Bz6DvB6DwMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBPkdSvwnOBuAJaOWAGb0HPoO8HoPAAAkiQgAukm3owebckwr\n' +
+ 'xAR42r/+CBx1uoqM2ZeEAUeYtBF7sdLEsdxFrxl8wHKAbglZwtgWcfG95v2R\n' +
+ 'zLcBco3v9p0IuS6DZduIfhngZ49gpYwqFGyiCOvo+k14tuMbrbOZTTKp0uc6\n' +
+ 'icpTyP8/1U0nZrQmmSXyfh6Hgmx1OnW3zTM7oUN1ZVvj3V6rOl+ktUPjAaYo\n' +
+ 'CWJjth92xhDWEPZnC/4Gz2eRoTVtmx8u+/2vNPffQVgzzHznUxB+G5XeZmPk\n' +
+ 'z8oxxSxII8PNiAs5LizqPjyq2gEv25GlCsMXTYz60n/t/4G7Yc94yu8xD8u3\n' +
+ 'BpWluHC2eW0pYFcDfiNLfv0uJCrUcM7ATQRkq+dvAQgA7v7Zz4CZdPsd4jvB\n' +
+ 'uDwjop/Gvoz+rbvAdS3Xrsi+OTyrWAqidnXChhwExlUNelZ9v52lGxe1twwr\n' +
+ 'vxeQ4M0pv4oqSlZxhkqBCyj+E7ECR2WXG7ccLlzYOz3b5BXT+fEkmVsbVTjA\n' +
+ 'Kttjosm7FtY4igY2Hu4UlZZW8M1tYL1R/UegFeMYGY7aO7dcKeiP0NsDwm3c\n' +
+ '0SiU6/JlOXAIi/ZSKDJ4b5BPK6GFj5pNWr92/V7LejlZfoHAVDbb91tiPGdP\n' +
+ 'y3+r9T3IYsgUDLgOpPQn6o82Nctm6CnIZqAN12nJ1DEJP2JyLDedg9b5H+aa\n' +
+ 'FDZFc7yQ3In/QPtjHImydLt9NwARAQABwsB2BBgBCAAqBYJkq+dvCZBm9Bz6\n' +
+ 'DvB6DwKbDBYhBPkdSvwnOBuAJaOWAGb0HPoO8HoPAABRUQf+KoF4UXuseLBO\n' +
+ 'd0PD0+hEcnsYbaPWmPZtJPWusxPl6kt421luymPiThDXwaMVzRrmxkz0dNZ3\n' +
+ 'bUFYtS24t2BhlXZ6cGFNRjXrA9OV0kLg/kNm1vboQ1GL8qRV9CIjPVEpksQp\n' +
+ 'tOiYN+X+/2XdPJkaQpITHIFV067qWQSAKIonvOI8OJYOovGRQTInz0VE71Yn\n' +
+ 'SeiOilKBK+p2RN38jGr0PGWt740KJ6560FzfUwTAQzz9vrkYa+vEhWe+bzOd\n' +
+ 'YBpxj/BRTGR19DrKlGcFPdTYz5ADxCjBuCxXgoRCbBiWwh+iIstk5qkT8uHK\n' +
+ 'NQjzDvo3RO1cROQp0zsikladmzGZHQ==\n' +
+ '=q/e/\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isSpeaker: true,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA10lEQVR4AcXBsWnFMBSG0c8/brOD9kgfogHUGQIuAppInSsVAQ2gdbSD64fTXl4hMI/HPWf5fXxf3DDaxkxIlTuEM+FMOFt5MtqG1XvBipGpsp9YMWaskCqWcCacCWfL4+fzwogx8069FyzhTDgTzpavv3oxEVLlFaNtzAhnwplwtvIkpIpV9hMrxsxM7wUrHxVrtA1LOBPOhLM1pIo12oaVj4rV98JMPj6wRtuwQqpYwplwJpyt3BRjZiZQuUM4E86Es7XsJ1aMTIVUeUXZTyzhTDgTzv4BnGY033BWusUAAAAASUVORK5CYII='
+ }
+ ],
+ pendingMembers: [
+ {
+ wallet: 'eip155:0xaC6C69c657cF6022fa787B14BDdaA22936B56D65',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA2UlEQVR4AcXBQWoEIRBA0Z+ikOwNDHirbARPKDiLvkzOIATaC4iQbGt6ITSzqPc+np8/fxhpVazzcfCOr99vrK4FS3AmOBOcKRddCy9GwQoxszNHw+rKluBMcCY407QqO10L1hyNO9Kq7AjOBGeCMz0fB9YcjZ20KjtdC1bXghVixhKcCc4EZzpH446uhXfM0bAEZ4IzwZmGmLHmaOyEmNmZo7ETYsYSnAnOBGfKRVoVq2vBmqNxR1oV6+SV4ExwJjhTLroWdkLM7MzRsLoWrMCBJTgTnAnO/gGd1jrTKk/8EAAAAABJRU5ErkJggg=='
+ },
+ {
+ wallet: 'eip155:0xEf532414907E8c631307c0d501cDe6D1694bAF5e',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA00lEQVR4AcXBobHDMBBF0ZsdjftIDeGuIkzIaGsQC1MNQkZirsLcnaQCk3yqBOzMH4N3zu11f38I+GPiinacRAwxQ8wQS/zo1flSGqNenUgujVGvziiXxsgQM8QMscSPXBqjXp1RLo1Ir84ol0bEEDPEDLHkj4lI51uvzn/4YyJiiBlihlhqx0lkZ2U0Pxci+7YyasdJxBAzxAyx1KsT8W3lil6diCFmiBlit9f9/SHQq3NFLo2IIWaIGWKpVyeybyuj+bkQ2beV0VwXIoaYIWaI/QH8GTSs76EUEQAAAABJRU5ErkJggg=='
+ },
+ {
+ wallet: 'eip155:0x2F5f27B523C8888eA79b7FA80a9CbA6b6980784c',
+ publicKey: null,
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA0klEQVR4AcXBsW3DQAxA0W9CExjIDhogfboDCw9gICvcHmldcIAMoYLgJJ5CKzgto4KA4ILvXT5+Pl8kwydZqJHt60bl+ryRDZ9koUYmNBOaCc0u31+/L04INSrDJ2cIzYRmQrMl1Dhj+KQSapwhNBOaCc0WDvZ1o+ROZV83KtfnjUxoJjQTmi0c3B/OO+4PpxLKP0IzoZnQbBk+yUKNyvBJJdSoDJ9kQjOhmdBsCTWy4ZNKqFEZPqmEGpnQTGgmNFs4CDWy4ZN3hBoVoZnQTGj2BxvbMvuaMCXUAAAAAElFTkSuQmCC'
+ }
+ ],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJkq+dvCZBm9Bz6DvB6DxYhBPkdSvwnOBuAJaOWAGb0HPoO\n' +
+ '8HoPAAD5ywf/cvaGM0DzcB22Q2FMzUZG4/ZmkN4OknvSj0d4hB/sPUIb9176\n' +
+ 'z+niFMjWZNFpIj8s36f16oMEZZ+Eleu9t6sECBxRDvO8pEwyByCXSmz8e/SH\n' +
+ 'Y659cvg5/A3bSe0FqR0VTI1o+Uz2BpnXG/P38C6D46btaIaJcr4cIh88wQ9J\n' +
+ 'lr05hOE7w/7Uo5OwyXala0NfB+8S4LIfpC2OlPOhyHQEJd2+WoFKb/6dO28D\n' +
+ 'TLuvgYJXJfc4R3ElcgFfm1N9ylG0Pt1F3c0C/k9bNokR2PVXgX2XSTQsx1rD\n' +
+ 'MCY/ePr93INyNZuTPcPlK87X6OTa2/gEW161vup2Xn2Did9HtL76Qw==\n' +
+ '=EkOP\n' +
+ '-----END PGP SIGNATURE-----\n' +
+ ':null',
+ spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ spaceName: 'intellectual_green_bat',
+ isPublic: true,
+ spaceDescription: 'sad_purple_pinniped',
+ spaceCreator: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
+ spaceId: 'spaces:9dab226c7920fe06154d76f78dfe1187bdc4fda712cdd9a8b37cc6a99741a63b',
+ scheduleAt: '2023-07-15T14:48:00.000Z',
+ scheduleEnd: '2023-07-15T15:48:00.000Z',
+ status: 'ACTIVE'
+}
+```
-- This method is used to create a local stream
-- Assigns the local stream obtained from the `navigator.mediaDevices.getUserMedia` to `data.local.stream` state.
+
-```typescript
-export type VideoCreateInputOptions = {
- video?: boolean;
- audio?: boolean;
-};
+---
-async create(options: VideoCreateInputOptions): Promise {}
+### **To stop a space**
+
+```typescript
+const response = await PushAPI.space.stop({
+ spaceId:
+ 'spaces:108f766a5053e2b985d0843e806f741da5ad754d128aff0710e526eebc127afc',
+ env: 'staging',
+});
```
-Allowed Options (params with \* are mandatory)
+Allowed Options (params with _ are mandatory)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
-| video | boolean | true | video status for the local stream |
-| audio | boolean | true | audio status for the local stream |
-
-Note - If audio, video aren't enabled in create() then they wont be available during the call respectively.
-
----
-
-#### **request**
+| spaceId_ | string | - | space id |
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
-- This method is used to request a push video call.
-- Will be triggered on the initiator's end.
+
+ Expected response (stop space by space id)
```typescript
-export type VideoRequestInputOptions = {
- senderAddress: string;
- recipientAddress: string;
- chatId: string;
- onReceiveMessage?: (message: string) => void;
- retry?: boolean;
-};
-
-async request(options: VideoRequestInputOptions): Promise {}
+// PushAPI_space_stop | Response - 200 OK
+{
+ members: [
+ {
+ wallet: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGSr528BCADI8kQcWkaw9PKmSrwCtPBDWj+wzPhmok9jAzxzb2+qAjSV\n' +
+ 'rYdIrnx6PAp1rMU6qoVg4cdDbCYPV+kCj8l3lUzH/a/SfPsDWpspA/ICWMeS\n' +
+ 'dMdGYxHLk2gsu0wRz69qoddXMY1h5eMZEyRnr2fsX/cy15mxO2IEHYnC2/rp\n' +
+ '06iFpx1T8k5HWgFDpyleWyMSQ7Bnn7GutrlHYEVtIGVfXDSkea8IDLLkzBEV\n' +
+ '3jlBUFhpsrlcvDwDYcMYOrqSBEtg1a+GMK+2Ye/hF37KUYTAPleKXeN0cYIs\n' +
+ 'Va8oleZK960XYfuy5SYCJav2kaAggNWQBie5G9C4H3h7FuFwWk8LH3DhABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZKvnbwQLCQcICZBm9Bz6DvB6DwMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBPkdSvwnOBuAJaOWAGb0HPoO8HoPAAAkiQgAukm3owebckwr\n' +
+ 'xAR42r/+CBx1uoqM2ZeEAUeYtBF7sdLEsdxFrxl8wHKAbglZwtgWcfG95v2R\n' +
+ 'zLcBco3v9p0IuS6DZduIfhngZ49gpYwqFGyiCOvo+k14tuMbrbOZTTKp0uc6\n' +
+ 'icpTyP8/1U0nZrQmmSXyfh6Hgmx1OnW3zTM7oUN1ZVvj3V6rOl+ktUPjAaYo\n' +
+ 'CWJjth92xhDWEPZnC/4Gz2eRoTVtmx8u+/2vNPffQVgzzHznUxB+G5XeZmPk\n' +
+ 'z8oxxSxII8PNiAs5LizqPjyq2gEv25GlCsMXTYz60n/t/4G7Yc94yu8xD8u3\n' +
+ 'BpWluHC2eW0pYFcDfiNLfv0uJCrUcM7ATQRkq+dvAQgA7v7Zz4CZdPsd4jvB\n' +
+ 'uDwjop/Gvoz+rbvAdS3Xrsi+OTyrWAqidnXChhwExlUNelZ9v52lGxe1twwr\n' +
+ 'vxeQ4M0pv4oqSlZxhkqBCyj+E7ECR2WXG7ccLlzYOz3b5BXT+fEkmVsbVTjA\n' +
+ 'Kttjosm7FtY4igY2Hu4UlZZW8M1tYL1R/UegFeMYGY7aO7dcKeiP0NsDwm3c\n' +
+ '0SiU6/JlOXAIi/ZSKDJ4b5BPK6GFj5pNWr92/V7LejlZfoHAVDbb91tiPGdP\n' +
+ 'y3+r9T3IYsgUDLgOpPQn6o82Nctm6CnIZqAN12nJ1DEJP2JyLDedg9b5H+aa\n' +
+ 'FDZFc7yQ3In/QPtjHImydLt9NwARAQABwsB2BBgBCAAqBYJkq+dvCZBm9Bz6\n' +
+ 'DvB6DwKbDBYhBPkdSvwnOBuAJaOWAGb0HPoO8HoPAABRUQf+KoF4UXuseLBO\n' +
+ 'd0PD0+hEcnsYbaPWmPZtJPWusxPl6kt421luymPiThDXwaMVzRrmxkz0dNZ3\n' +
+ 'bUFYtS24t2BhlXZ6cGFNRjXrA9OV0kLg/kNm1vboQ1GL8qRV9CIjPVEpksQp\n' +
+ 'tOiYN+X+/2XdPJkaQpITHIFV067qWQSAKIonvOI8OJYOovGRQTInz0VE71Yn\n' +
+ 'SeiOilKBK+p2RN38jGr0PGWt740KJ6560FzfUwTAQzz9vrkYa+vEhWe+bzOd\n' +
+ 'YBpxj/BRTGR19DrKlGcFPdTYz5ADxCjBuCxXgoRCbBiWwh+iIstk5qkT8uHK\n' +
+ 'NQjzDvo3RO1cROQp0zsikladmzGZHQ==\n' +
+ '=q/e/\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isSpeaker: true,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA10lEQVR4AcXBsWnFMBSG0c8/brOD9kgfogHUGQIuAppInSsVAQ2gdbSD64fTXl4hMI/HPWf5fXxf3DDaxkxIlTuEM+FMOFt5MtqG1XvBipGpsp9YMWaskCqWcCacCWfL4+fzwogx8069FyzhTDgTzpavv3oxEVLlFaNtzAhnwplwtvIkpIpV9hMrxsxM7wUrHxVrtA1LOBPOhLM1pIo12oaVj4rV98JMPj6wRtuwQqpYwplwJpyt3BRjZiZQuUM4E86Es7XsJ1aMTIVUeUXZTyzhTDgTzv4BnGY033BWusUAAAAASUVORK5CYII='
+ }
+ ],
+ pendingMembers: [
+ {
+ wallet: 'eip155:0xaC6C69c657cF6022fa787B14BDdaA22936B56D65',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA2UlEQVR4AcXBQWoEIRBA0Z+ikOwNDHirbARPKDiLvkzOIATaC4iQbGt6ITSzqPc+np8/fxhpVazzcfCOr99vrK4FS3AmOBOcKRddCy9GwQoxszNHw+rKluBMcCY407QqO10L1hyNO9Kq7AjOBGeCMz0fB9YcjZ20KjtdC1bXghVixhKcCc4EZzpH446uhXfM0bAEZ4IzwZmGmLHmaOyEmNmZo7ETYsYSnAnOBGfKRVoVq2vBmqNxR1oV6+SV4ExwJjhTLroWdkLM7MzRsLoWrMCBJTgTnAnO/gGd1jrTKk/8EAAAAABJRU5ErkJggg=='
+ },
+ {
+ wallet: 'eip155:0xEf532414907E8c631307c0d501cDe6D1694bAF5e',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA00lEQVR4AcXBobHDMBBF0ZsdjftIDeGuIkzIaGsQC1MNQkZirsLcnaQCk3yqBOzMH4N3zu11f38I+GPiinacRAwxQ8wQS/zo1flSGqNenUgujVGvziiXxsgQM8QMscSPXBqjXp1RLo1Ir84ol0bEEDPEDLHkj4lI51uvzn/4YyJiiBlihlhqx0lkZ2U0Pxci+7YyasdJxBAzxAyx1KsT8W3lil6diCFmiBlit9f9/SHQq3NFLo2IIWaIGWKpVyeybyuj+bkQ2beV0VwXIoaYIWaI/QH8GTSs76EUEQAAAABJRU5ErkJggg=='
+ },
+ {
+ wallet: 'eip155:0x2F5f27B523C8888eA79b7FA80a9CbA6b6980784c',
+ publicKey: null,
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA0klEQVR4AcXBsW3DQAxA0W9CExjIDhogfboDCw9gICvcHmldcIAMoYLgJJ5CKzgto4KA4ILvXT5+Pl8kwydZqJHt60bl+ryRDZ9koUYmNBOaCc0u31+/L04INSrDJ2cIzYRmQrMl1Dhj+KQSapwhNBOaCc0WDvZ1o+ROZV83KtfnjUxoJjQTmi0c3B/OO+4PpxLKP0IzoZnQbBk+yUKNyvBJJdSoDJ9kQjOhmdBsCTWy4ZNKqFEZPqmEGpnQTGgmNFs4CDWy4ZN3hBoVoZnQTGj2BxvbMvuaMCXUAAAAAElFTkSuQmCC'
+ }
+ ],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJkq+dvCZBm9Bz6DvB6DxYhBPkdSvwnOBuAJaOWAGb0HPoO\n' +
+ '8HoPAAD5ywf/cvaGM0DzcB22Q2FMzUZG4/ZmkN4OknvSj0d4hB/sPUIb9176\n' +
+ 'z+niFMjWZNFpIj8s36f16oMEZZ+Eleu9t6sECBxRDvO8pEwyByCXSmz8e/SH\n' +
+ 'Y659cvg5/A3bSe0FqR0VTI1o+Uz2BpnXG/P38C6D46btaIaJcr4cIh88wQ9J\n' +
+ 'lr05hOE7w/7Uo5OwyXala0NfB+8S4LIfpC2OlPOhyHQEJd2+WoFKb/6dO28D\n' +
+ 'TLuvgYJXJfc4R3ElcgFfm1N9ylG0Pt1F3c0C/k9bNokR2PVXgX2XSTQsx1rD\n' +
+ 'MCY/ePr93INyNZuTPcPlK87X6OTa2/gEW161vup2Xn2Did9HtL76Qw==\n' +
+ '=EkOP\n' +
+ '-----END PGP SIGNATURE-----\n' +
+ ':null',
+ spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ spaceName: 'intellectual_green_bat',
+ isPublic: true,
+ spaceDescription: 'sad_purple_pinniped',
+ spaceCreator: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
+ spaceId: 'spaces:9dab226c7920fe06154d76f78dfe1187bdc4fda712cdd9a8b37cc6a99741a63b',
+ scheduleAt: '2023-07-15T14:48:00.000Z',
+ scheduleEnd: '2023-07-15T15:48:00.000Z',
+ status: 'ENDED'
+}
```
-Allowed Options (params with _ are mandatory)
-| Param | Type | Default | Remarks |
-|----------|---------|---------|--------------------------------------------|
-| senderAddress_ | string | - | Local peer address |
-| recipientAddress* | string | - | Incoming/remote peer address |
-| chatId* | string | - | Unique identifier for every wallet-to-wallet push chat, will be used during verification proof generation |
-| onReceiveMessage | `(message: string) => void` | `(message: string) => {console.log('received a meesage', message);}` | Function which will be called when the sender receives a message via webRTC data channel |
-| retry | boolean | false | If we are retrying the call, only for internal use |
+
---
-#### **acceptRequest**
-
-- This method is used to accept a push video call.
-- Will be triggered on the receiver's end.
+### **To approve a space request**
```typescript
-export type VideoAcceptRequestInputOptions = {
- signalData: any;
- senderAddress: string;
- recipientAddress: string;
- chatId: string;
- onReceiveMessage?: (message: string) => void;
- retry?: boolean;
-};
-
-async acceptRequest(options: VideoAcceptRequestInputOptions): Promise {}
+const response = await PushAPI.space.approve({
+ status: 'Approved',
+ account: '0x18C0Ab0809589c423Ac9eb42897258757b6b3d3d',
+ senderAddress: '0x873a538254f8162377296326BB3eDDbA7d00F8E9', // spaceId
+ env: 'staging',
+});
```
Allowed Options (params with _ are mandatory)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
-| signalData_ | any | - | Signal data received from the initiator peer via psuh notification upon call request |
-| senderAddress* | string | - | Local peer address |
-| recipientAddress* | string | - | Incoming/remote peer address |
-| chatId\* | string | - | Unique identifier for every wallet-to-wallet push chat, will be used during verification proof generation |
-| onReceiveMessage | `(message: string) => void` | `(message: string) => {console.log('received a meesage', message);}` | Function which will be called when the sender receives a message via webRTC data channel |
-| retry | boolean | false | If we are retrying the call, only for internal use |
+| status | 'Approved' | 'Approved' | flag for approving and rejecting space request, supports only approving for now|
+| senderAddress_ | string | - | space request sender's address or spaceId of a space |
+| signer\* | - | - | signer object |
+| pgpPrivateKey | string | null | mandatory for users having pgp keys|
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
----
+
+ Expected response (approve space request for a spaceId)
-#### **connect**
+```typescript
+// PushAPI_space_approve | Response - 204 OK
+```
-- This is the final method which is used to connect a push video call.
-- Will be triggered on the initiator's end.
+
-```typescript
-export type VideoConnectInputOptions = {
- signalData: any;
- peerAddress?: string;
-};
+---
-connect(options: VideoConnectInputOptions): void {}
+### **To add listeners to space**
+
+```typescript
+const response = await PushAPI.space.addListeners({
+ spaceId,
+ listeners: [
+ `eip155:0x65585D8D2475194A26C0B187e6bED494E5D68d5F`,
+ `eip155:0xE99F29C1b2A658a478E7766D5A2bB28322326C45`,
+ ],
+ signer: signer,
+ pgpPrivateKey: pgpDecrpyptedPvtKey,
+ env: env as ENV,
+});
```
Allowed Options (params with _ are mandatory)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
-| signalData_ | any | - | Signal data received from the receiver peer via push notification upon call acceptRequest |
-| peerAddress | string | data.incoming[0].address | Address of the receiver peer, received via push notification upon call acceptRequest |
+| spaceId_ | string | - | space id |
+| listeners | Array | - | new listeners that needs to be added to the space. Don't add listeners which are already part of space |
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
----
+
+ Expected response (add Listeners to space)
-#### **disconnect**
+```typescript
+// PushAPI_space_add_listeners | Response - 200 OK
+{
+ members: [{
+ wallet: 'eip155:0x4Be8cFD08B330853A530DEBB72a2DAf4d4F3D2Ba',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGSs51IBCAC+y8oXbU2YvfI7Z4xnSRfcPecRR+nO/XVLDbt30mbn1NU8\n' +
+ 'wHSXcuHLJTuU9yJy1t9AMB2SY8n/YWMFbeNICF0OQVINkvFS+8Ec/F42IIlb\n' +
+ 'StUY8rLS9pxTQoI3k1LnQKNL1krGiEuDl2ZT3l304aPGkF1sowu5w6xnzl/o\n' +
+ 'nb6cgc48jVqIgqoVUCnEoxc3GKdSORm35nl0RBDasFdFPJctnpg2n7hLofU1\n' +
+ 'RGOIzf/cITY7AE3nta0cqaFgNsO4rO0fXRwgDBAu66CtBG4Px2X8hT7IYMum\n' +
+ 'XJtCis3KvrmQAOhWrbAwmWjHbkSDSYigd39rmlht21GKf0/kfoILBgRfABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZKznUgQLCQcICZDTsTetOyJa2gMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBHGBWhlF6JChmgQO7tOxN607IlraAADq/Af/XWeAagX5+JCX\n' +
+ 'ChzadMaUtI6m2F7nT8sJcJep/a0Ldyz6kPmP9k6kmWO+QXJwl4FrP3e7HPer\n' +
+ 'SjTeIWm0FJ2a+pRtF+lWk7xjIWJuZxbx79nOk98arde75fT+bebne1V0raUM\n' +
+ 'gXPQIc60++okAPif6vJVLAaSMNbCkv8+Lsy0mJqsjY3b9iMVKWHKb8XVvTuN\n' +
+ 'pobxVV4dLq53lrdNDIiwAWTlbxyuKLSEF4f+hIPJX3PAhquORinOubclUwTM\n' +
+ '+kEmE6VI3pW4VL1VRi10cDI6ruEVwqOwQyYcp9gSDKXFR6ZXz7t0hjUUhl+3\n' +
+ 'z6T7yqAjExW1O4tETVSbt3jg6DjaAM7ATQRkrOdSAQgArRRrLZees3xCYyBO\n' +
+ '9WDzy7XCM2FxmaIJs/ibWwTtD1ZVoc9NKeOx07FYwGiYjigY6FxxJHdr20IQ\n' +
+ '3xieIyBLZM2XAIXrsxq4M9GLG8R6nhd35BenjcvSGiZH1Rq0aXtFt9Fd7gc6\n' +
+ 'E8XpMcHPH8KEnf66sPz18vrVCdstVU4Qj2ZjH25ilfeGdMj2HHfDxVN8sRhl\n' +
+ 'AXAcwblQ+IVXGjuKw19T4zN874bcAaOmXfzxu3+2PtxVSR5uV03x1ln3ji+b\n' +
+ '+GF8atJMMHCqE0FC/dEciS+BWSQtv0D93XWjzExJeyhd7Z+I3BG8JPuJT5Yj\n' +
+ '4PxktEgwUxQc83JFFwED9knzyQARAQABwsB2BBgBCAAqBYJkrOdSCZDTsTet\n' +
+ 'OyJa2gKbDBYhBHGBWhlF6JChmgQO7tOxN607IlraAABLdggAhe1KLjtHTsUI\n' +
+ 'SR0K25EJ+9gXC7wmebve9wNZL22/Ud9hnyS77/VUmMNBgdPyhm/9ITMhVtTt\n' +
+ 'rRNo1AzsVKDn3/dW1kc+nSribOufxzMoBM7Bm918Zt/0/7wCegz0bp3EAoQ8\n' +
+ 'KEa2KPY9lSh2WtEDoA87D8JB1xwIfcR98vg5/AZ7VdtE88foSqXAm+6F85hz\n' +
+ 'nAASNBO9CCDvUofR28b4exT/aWX0qZxLAukgH7fnYC3KPVv+9ug6mdyJPsOZ\n' +
+ 'LFjF327UKLrBuQ6VRlfKF+XULJbtNPxckgwO1V/oxycq/M67acGoXgc2MgP/\n' +
+ '2qOkbiQC0ZxcA+Ze5TNNhuGWKv6d9g==\n' +
+ '=S9Ba\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isSpeaker: true,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA1UlEQVR4AcXBQU1FUQxF0f2bZ6gaIOkAC4yxUCRQHyRoqIo6wcJnesLgEgJJ17p9vDzeEe9vd046nZOo4eT59YYylhnLjGW3p8+HOwedzl9EDSfGMmOZsezim05HRQ2q0zmJGlSno6IGZSwzlhnLrk5HRQ2q01FRw0mno6IG1ekoY5mxzFh2RQ2q01FRw29EDarTUVGDMpYZy4xlV6ejogbV6aio4aTTUVGD6nSUscxYZiy7+KbT+U+dzomxzFhmLLv4QdSgnl9vHNWgOp0TY5mxzFj2BfKPPQUA5ipXAAAAAElFTkSuQmCC'
+ }],
+ pendingMembers: [{
+ wallet: 'eip155:0x4d2eFB18383a48aCe19a198ae5228BB4bf854cec',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA9UlEQVR4AcXBoZHDMBCG0S87ZqEmooaiLmJJsNtwIyFuwzhERZgKmoqkhxz9HaCbmwP73u159w8iN0fVVFC5OT01FVRujqqpoIxgRjAj2JCbo6b1QE3LiDrpeywjF+vBRXOUEcwIZgQb+MW5zaiaCl3NUdN60GMEM4IZwYaaChfNUdN6cNGcnmk9UOc2o2oqKCOYEcwINuTmqJoKF835i3ObUTUVVG6OMoIZwYxgt+fdP4jHMqJe+xuVm9NTU0E9lhH12t8oI5gRzAg28OXcZlTeuKip0JObo06+7AVlBDOCGcFuz7t/6MjN+Y+aCj1GMCOYEewHE5pCbf3G8WQAAAAASUVORK5CYII='
+ },
+ {
+ wallet: 'eip155:0x8E50Bfb57f803814c242c5a25890f5F0c13304fF',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA20lEQVR4AcXBsWkDQRCG0W+Gy53pkgVVsiXYFVx2rsANiCtEmQoxbCHmYBNd6gLW6aBgjDDmf89eXr8GiW6VqIxGplslKqORccQcMUdsWued6Ho/k+lW+Yt13okcMUfMEZt4sM470YUb0XYsZC6nG9HKTsYRc8Qcsel6P5PpVnnGdixEZTQyjpgj5ohNPOhWyZTRyHSrRN0qURmNyBFzxBwx+34rg0QZjahbJVNGI+pWyThijpgjNvGLbpWojEamW+UZjpgj5ojZx/vnINiOhf90Od2IHDFHzBH7AWIQNGL6hyehAAAAAElFTkSuQmCC'
+ },
+ {
+ wallet: 'eip155:0xaA6E4434D881D2bDEea891AE127313AE5515a06B',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAyklEQVR4AcXBsZGDMABE0c8OqQPGZShzCdCCVNZVIhVAYrpQ6g48lMClkgMlBPve9HjtF0bCTJgJszmXykiKgTtyqYwIM2EmzOYUAyO5VO5IMTAizISZMJu/70rrOOmkGLgjl0prXegIM2EmzKbHa79o5FIZSTEwkktlJMVAS5gJM2E282Nd6Dy3QCuXykiKgdb3XRkRZsJMmE375++isS50jpNOioGRXCqtdaFznHSEmTATZjM/nluglUvljucWaOVSaQkzYSbM/gGGCDCC/3c1nwAAAABJRU5ErkJggg=='
+ },
+ {
+ wallet: 'eip155:0xf6106dd699B6e40f1E822c38DDA459F533470b11',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAwUlEQVR4AcXBsU2DMRSF0S9XHoIFIipmIEW2sPQ6pmGEdJa8BYXXsOgYxKF9afzrr+45l++39uSEUGenrcoZwkyYCbPCgVAna6uyE+pkbVV2hJkwE2Yl1MnaqmT364Ps5/eLnfv1QRZzkIU6mTATZsKscCDm4IXYijk4Q5gJM2FWONDeb7yYbLX3G1nMwY4wE2bCrHAg5iALdbYmpwgzYSbMLh+ff0+MhJkwE2Yl5iALdXbaquyEOjttVTJhJsyE2T84uix63kKmNgAAAABJRU5ErkJggg=='
+ },
+ {
+ wallet: 'eip155:0xAF3d4989652a6ED5554b6191c555525977424Cc9',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA3UlEQVR4AcXBsW3DMBCG0c8/tEMmUClkBDVaQAWHIKAZWHAGAxyChZDejbOCkcrDOO3ZxQlGENx7p4/t64Gj58JfpFbxiGAimAg2cOB6uWHNy4TnernxDhFMBBPBBl70XHg2YaVW8fRcsOalYKVWsUQwEUwEGziQWsXqueBJrWL1XPCIYCKYCHb6/vl8YKRW+U89FywRTAQTwQZebOOK53zf8Wzjim/CEsFEMBFs4MD5vmP1XPCktmNt44pHBBPBRLAhtYrVc+HZipXajmcbV6x5mbBSq1gimAgmgv0CTksv6eJNDqkAAAAASUVORK5CYII='
+ },
+ {
+ wallet: 'eip155:0x2ccBeEf6e30dF46D0A7Ee79Bc66FBF3beA7EeA5A',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA00lEQVR4AcXBIW6AMBiG4XdfmnAYboLlCE3NFBLX4JB40hMsWM4x08OgNvsXUbMs//N8fH59/2DksfCfthqxhDPhTDgLvGw1Yq3nhLWnm571nLD2dNMjnAlnwlnIY8HaasQajplGpWs4ZhqVRh4LlnAmnAln4VkuGinSs54TXcdMz7NcWMKZcCachT3dWHksWM9yYQ3HTM+zXFj5oLGlG0s4E86Es8DLViONFLEyhZ493TQqXcKZcCacCWfCmXAmnAVe8lj4izwWerYasYQz4Uw4+wXktDHpzVVJlwAAAABJRU5ErkJggg=='
+ },
+ {
+ wallet: 'eip155:0x65585D8D2475194A26C0B187e6bED494E5D68d5F',
+ publicKey: null,
+ isSpeaker: false,
+ image: null
+ },
+ {
+ wallet: 'eip155:0xE99F29C1b2A658a478E7766D5A2bB28322326C45',
+ publicKey: null,
+ isSpeaker: false,
+ image: null
+ },
+ {
+ wallet: 'eip155:0xa145b34443e28C8f718Cd0691Dc41A81E0d0A857',
+ publicKey: null,
+ isSpeaker: false,
+ image: null
+ }
+ ],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJkrOdUCZDTsTetOyJa2hYhBHGBWhlF6JChmgQO7tOxN607\n' +
+ 'IlraAAAqUQf9FvAtNouG7+2YSyyx7eiHRJZroDPFohH/F2xyc+oJkgh40p2y\n' +
+ 'hyKw+DSp0FA+IiT95/y8RbGDUrNFz+/kdMfZWCEYFim3Cy+c5k1/YNc8qxx6\n' +
+ 'VLwef+2YZepC1pSS9K0zbu04uVPWrNmDa5lHXqzTx/mOxWlxLD0NfpI60csE\n' +
+ 'iQx57duy2gMeW9MwOKSFjOSnWHKy7AySm/vBwZ9Rj4gnOhsvwbAfLprQQf4G\n' +
+ 'cUaxG/HOb0c/8Ugews0Z1uDJFmGKjT5R5CR63vPo5qDGQwWkm+LYpshCIV+K\n' +
+ 'ofLepDqQRuEFa7VyUlDOvMcF15LtlvAhwhkIVHvTGjXZC91e8/IUsQ==\n' +
+ '=UpR2\n' +
+ '-----END PGP SIGNATURE-----\n' +
+ ':null',
+ spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ spaceName: 'weird_moccasin_alligator',
+ isPublic: true,
+ spaceDescription: 'equivalent_blue_armadillo',
+ spaceCreator: 'eip155:0x4Be8cFD08B330853A530DEBB72a2DAf4d4F3D2Ba',
+ spaceId: 'spaces:d37c4e303a2ff194e546d3af94353ec829324a578ebffbeadebd1ba91ab88548',
+ scheduleAt: '2023-07-15T14:48:00.000Z',
+ scheduleEnd: '2023-07-15T15:48:00.000Z',
+ status: 'PENDING'
+}
+```
-- This method is used to end a push video call.
-- Can be triggered on the initiator as well as receivers end.
+
-```typescript
-export type VideoDisconnectOptions = {
- peerAddress: string;
-} | null;
+---
-disconnect(options: VideoDisconnectOptions): void {}
+### **To remove listeners from space**
+
+```typescript
+const response = await PushAPI.space.removeListeners({
+ spaceId,
+ listeners: [
+ `eip155:0xB12869BD3a0F9109222D67ba71e8b109B46908f9`,
+ `eip155:0x2E3af36E1aC6EEEA2C0d59E43Be1926aBB9eE0BD`,
+ ],
+ signer: signer,
+ pgpPrivateKey: pgpDecrpyptedPvtKey,
+ env: env as ENV,
+});
```
-Allowed Options (params with \* are mandatory)
+Allowed Options (params with _ are mandatory)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
-| peerAddress | string | data.incoming[0].address | Address of the peer to be disconnected from |
-
----
-
-#### **enableVideo**
+| spaceId_ | string | - | space id |
+| listeners | Array | - | existing listeners that needs to be removed from the space. Don't add listeners which are not part of space |
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
-- This method is used to enable/disable the video (from `data.local.stream`) for a push video call.
-- Can be triggered on the initiator as well as receivers end.
- <<<<<<< HEAD
-- # **Note -** If video was not enabled during `create()` then it will always remain off.
-- **Note -** If video was not enabled during `create()` then it will always remain off.
- > > > > > > > main
+
+ Expected response (remove Listeners from space)
```typescript
- export type EnableVideoInputOptions = {
- state: boolean;
+// PushAPI_space_from_speakers | Response - 200 OK
+{
+ members: [{
+ wallet: 'eip155:0x5908D89B1390ec5833001b86302B868A808D506D',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGSs6YABCADC4ldJKGpZ0Z+JJwA1t/1JWp5+dnR98nr7RHPX8eEGxIhL\n' +
+ 'gtx5TZmek2BcGzNcg66+GEyC4np9USaCZ4/YC9ZMLw8BQKzhOcd3ZILyGtGV\n' +
+ 'BijBNwjPIbQcy5/cXVtfKCvf303BDYddPYuJ1xFAh7kpvhcR4a72CSpeyEjM\n' +
+ 'UndteAVTIxqwdpnXIdqpwu6HrSJ089GpHV+XeaDo4Uhg+iHJsCRJy2VJ5m61\n' +
+ 'CwGx55f3ror6rAXQd+hEx+keLxYINNJLLvfvE9IGsIbKRFZx+emjXQZusbJp\n' +
+ 'zXYhJnEeHPLVDjWhzo8Q3/4gvOz8m6a+A9sl49sqodLdxVlXQ7d4CuylABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZKzpgAQLCQcICZCaDezdj8j4SwMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBGZpOFBNtTj1Oqt695oN7N2PyPhLAACCLgf/dB412nDRcOxR\n' +
+ 'dNSj2AYknJ+NKeX38KuksyR6wypnaJWpapmIeZCfFjeoBjuBCPd6unvN/IlZ\n' +
+ 'zPwl66lO5GKJxDaDd1/infxM/dbtFQSESLXlweRLQ/v1+plsntrBUyvbY4uH\n' +
+ 'Mh9PImYsLY+zo8P5mpBV5AGAMA6R9qmu3axH/MnKVdB0Ky6C/jP+7lPs/QVT\n' +
+ 'qsISyyI1E9E6Oivzxmao1axfXLdEvICHb6uD0R4p5SUVqHJX41OwM8BFevhK\n' +
+ '07Hi+c7NhUWp0sxXEOs6dneJZwerCD3EahutpP1Oyt5T8MZitysn2yJ+s5ks\n' +
+ 'SZza+x8OmCMcMZfZnIsJNnIUvPboP87ATQRkrOmAAQgAteDgsJJ0ftPD+P15\n' +
+ 'rKgkLuSCD2iwQgm2k8/ZDaXJBsdm4sJYTt2y0ckx7MRpXgLuIyidOGctqVL6\n' +
+ '/Rl2Hfl30JQPok5cYmYLENVuFz94MEvgDOo8jacyfPdLGPMWZMLRojyM/Yvs\n' +
+ 'nhDZ8if3zEstP4h3HcpdT+PWSmsJWjrq57la4vKbfILtKfTBaf8sibm5UuZA\n' +
+ '5Y/SIPxfVC+ybCPAjo4tpDYP901V+wxXDJ8BlZ4AaVvk20MYMzuAjBna+iwD\n' +
+ 'f0j4CccEabd2EVtAQQcMCg2yTjOT22Dt0jfpDuohDNaXDhX2ZQlJIdlSLCEI\n' +
+ 'a3c7g+uU9bnNqt7LHPgMzLYKnwARAQABwsB2BBgBCAAqBYJkrOmACZCaDezd\n' +
+ 'j8j4SwKbDBYhBGZpOFBNtTj1Oqt695oN7N2PyPhLAAD2vQgAu9+sd4AT5b6c\n' +
+ 'mWOaQBXz2XVfJXYQFNlBdOF23reycF9r7vDAKSRpeyMSyOfRAi0qdLynQ1dN\n' +
+ 'MXV/gfO0G9dzFu513P/Y1sZxQi0uLRKL9hMcgEQ8FLo8/PGfVcoLfQASryGj\n' +
+ 'Z8ybCFqiXocGpt2VkkK4wwgv+ZwZ8M1ubz0Boby6A1/kTYs/6ll+QekpB4ao\n' +
+ 'kJKw3DWvVNR/xODFfMQcClvzAtqwfxhTZXBMbZ4vAG5m1ExGmA15cGXrAfwV\n' +
+ 'nR2vOhPYDeZGbBKktM3xfDts75N2NF/TBpvazV2DTKpkLqvVitFHWvSMMpVd\n' +
+ 'dwk9tEOmBlj2AoYATvQ9kKHRTD27Wg==\n' +
+ '=IXzf\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isSpeaker: true,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA1klEQVR4AcXBoXHEMBRF0Zs3oqpHNYgJecZdGKYMd5GZRWaCwaohZbiAhP5d8HeC3jkfnz/fvwSTRua+DjJ1nGQ6i0iYCTNhVnjRWUSTRlTHyX90FhlhJsyEWeHFpJG5r4NMHSfRpBF1FpEwE2bCrPDGfR1E29jJPK6DqI6TjDATZsKsTBqZOk6iSa6ORmbSiISZMBNmpbOIHtcXUR0nUWeRmTSi+zqItrETCTNhJswKL7ax82wRTRqZzuLJ2MkIM2EmzApvTBpRZ5GZNKLOIiPMhJkw+wPV2i2sD43hKwAAAABJRU5ErkJggg=='
+ }],
+ pendingMembers: [{
+ wallet: 'eip155:0xC1469cB7b59d16dC887D4C11faB3E3C0abBeA12C',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA30lEQVR4AcXBsWnFMBSG0e9dBAGDPUs6LeAFNIEb1x5GtRtDei3gBQzZIFtYYEj10t73CkFw8Z/z+Pj+euJs14iXlsodJfd4U7fjGWKGmCEWzjnilUzTsB60nHOk5ZwjniFmiBligTdTt+MlIt52jbRVvKnb8RIRzxAzxAyxx+/nzxMhQ8wQM8RCyT0taancUXJPiyFmiBligTdTt+NNKy/OOdIyrAct2zXiGWKGmCEW0lJ5kUe8tFT+45wjXsk9XloqniFmiBliYVgPvHOOeCX33JGWijesB54hZogZYn8uFTTKoy9pgwAAAABJRU5ErkJggg=='
+ },
+ {
+ wallet: 'eip155:0xccF7a3131E0E73F83Bc457C27494411a57f23248',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA9ElEQVR4AcXBIWoEMRSA4X8fw6qayBW9zULVEBFygLqcqMwdhlBCbKjqXSLjY7b2UZEVpbzvu3x8vT5QShhoqUa0Yz9ZSTWiHfuJ5rNDE4wJxgRjl8/v9wdKn43/dLve0QRjgjHB2NZnQ7td72h9NrQSBis+O7Tb9Y7WZ0MTjAnGBGMbv/TZ0EoYaD47VkoYaD43VgRjgjHB2MYTqUa0Yz9ZSTWi9dlYEYwJxgRjlzf38kDx2aGVMNBSjawc+4nms0MrYaAJxgRjgrGNJ1KNaH02VlKNaH02VgRjgjHB2OazQythoKXKn5Qw0Hx2aIIxwZhg7Ae2cUcV4Bl8pAAAAABJRU5ErkJggg=='
+ },
+ {
+ wallet: 'eip155:0x052aD82D3a7b4DAb5b9BcFED771D28703a6faadf',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAy0lEQVR4AcXBoXFDQQxF0RtlkZsQNjHICKYYV7DFCAW6II2BycfbhklCNR/sTNA75+Pn+/MXIUPMEDPEBifhSVdr0oUnO7UmXXjS1Zp0hpghZogZYoaYIWaIDU5qTbrwpHtfnuyEJ12tyY4hZogZYiM86WpNdl7Hg53wL3bCk84QM8QMscFJeNLVmnS3652dOiZdeLJjiBlihtioNenCky486eqY7IQnO7UmnSFmiBliIzzpak262/XOf7wvT7rX8aALTzpDzBAzxP4AMOQyARcWaToAAAAASUVORK5CYII='
+ },
+ {
+ wallet: 'eip155:0x956f73E5a3BF0D19299BF74bD6dc819D7f775eC7',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA20lEQVR4AcXBsYnDMBiG4dc/nsHgHeJWS1x7G6QzqNQUKlUHLn12ONdqNYTBS/ja/xqBCeF7nmFbbydODoVPSjXiGWKGmCE2Pu8vvPT45pOe9xeeIWaIGWLj0Xa8HAo9qUZ6cih0tR3PEDPEDLFhW28nTg4FL9XIO3IoeKlGPEPMEDPEhq+f3xNnWmZ6jrbTMy0zPUfb8QwxQ8wQG6dlxjvajpdq5JLKPzkUvGmZ8QwxQ8wQG4+246Ua8XIovCPViJcpeIaYIWaIDdt6O7kgh0JPqpErDDFDzBD7AzabOPmHFg/aAAAAAElFTkSuQmCC'
+ },
+ {
+ wallet: 'eip155:0x19da526eD1a57E07D48aa25aDa6cbA7E41FF3129',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAyUlEQVR4AcXBsY1CQQxF0cvTFEHuNn4jxB6JJggpw5Mh/UZogmByumBTi2DQahf5nMN2vr1IjvtG1ufgL8Kc7Hm6k4liopgo1i7XB1nsG990uT7IRDFRTBRrfBDmZH0OVsKc3xDFRDFRrPFBn4MszFnpc5CFOSuimCgmih228+1Fctw3vul5upOJYqKYKNaO+0bW5yALc7I+BythTtbnIAtzMlFMFBPFGm/CnP8U5qyIYqKYKNZ40+dgJcxZ6XOwEuZkopgoJor9AIckL2mEiBQrAAAAAElFTkSuQmCC'
+ },
+ {
+ wallet: 'eip155:0x77059B40Ec974883b98a23eef519b4076D1Cf9F1',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsY0CMRRF0cuTQ6rYaQFiAvdBYMkFkFEAwWYTryxZ2kIcEE8N1MKmH4JJRuw7Z/d7uD0JRu1EuRW2GLUT5VaIhJkwE2a788/XEyNhJsyEWcqtEI3a+aTcCpEwE2bCLI3aia77E9EyT2xxvDyIvmsnEmbCTJgl3izzRDRqJ8qtsGbUzou58KLeiYSZMBNmKbfCf8qtEAkzYSbM0qidTxq1s0aYCTNhlq77E9EyT2yRW2HN8fIgEmbCTJj9AUPBKWCCQlIAAAAAAElFTkSuQmCC'
+ }
+ ],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJkrOmCCZCaDezdj8j4SxYhBGZpOFBNtTj1Oqt695oN7N2P\n' +
+ 'yPhLAAD+iwf/dvaRCTwXKGH6iUe49NpyTHMaD6ZwaLerk+K4Ojehbdoo0mDf\n' +
+ 'aOu/MR8wfqk49h2436rcMmyeM5avcMgmtGUmIdy/6hCZ6zxR/3E5t/vq5UfO\n' +
+ '3YFO1VLghR5cTYqR9bMLFkvvCB4P29rnaok2QVKTBZLfyAM4wu1h2DDBESoz\n' +
+ 'SS+ZtQLPz6/y7gOQobO0zbwBPmy8MpVVu1wxht+sneOMvZX+5al679nQbwNL\n' +
+ 'oCcU3UKrlqMhuFgMTCKx99VLcc4JbhBf2M+IHf78NtQ9mcQC/X+gxRfp6f+p\n' +
+ '2RePQzkmUH5vqXjzcUsNBWJPOyjl09/IZWWwaeiUjsPazjxqDtYNHg==\n' +
+ '=H4X4\n' +
+ '-----END PGP SIGNATURE-----\n' +
+ ':null',
+ spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ spaceName: 'sheer_ivory_ox',
+ isPublic: true,
+ spaceDescription: 'specific_green_alpaca',
+ spaceCreator: 'eip155:0x5908D89B1390ec5833001b86302B868A808D506D',
+ spaceId: 'spaces:bc96011f182e2c86ad68aaf4c95c4a916c808088370cb0ba294f9168e2ff6328',
+ scheduleAt: '2023-07-15T14:48:00.000Z',
+ scheduleEnd: '2023-07-15T15:48:00.000Z',
+ status: 'PENDING'
}
-
-enableVideo(options: EnableVideoInputOptions): void
```
-Allowed Options (params with \* are mandatory)
-| Param | Type | Default | Remarks |
-|----------|---------|---------|--------------------------------------------|
-| state | boolean | - | true for enable and false for disable |
+
---
-#### **enableAudio**
-
-- This method is used to enable/disable the audio (from `data.local.stream`) for a push video call.
-- Can be triggered on the initiator as well as receivers end.
- <<<<<<< HEAD
-- # **Note -** If audio was not enabled during `create()` then it will always remain off.
-- **Note -** If audio was not enabled during `create()` then it will always remain off.
- > > > > > > > main
+### **To add speakers to space**
```typescript
-export type EnableAudioInputOptions = {
- state: boolean;
-}
-
-enableAudio(options: EnableAudioInputOptions): void
+const response = await PushAPI.space.addSpeakers({
+ spaceId,
+ listeners: [
+ `eip155:0x65585D8D2475194A26C0B187e6bED494E5D68d5F`,
+ `eip155:0xE99F29C1b2A658a478E7766D5A2bB28322326C45`,
+ ],
+ signer: signer,
+ pgpPrivateKey: pgpDecrpyptedPvtKey,
+ env: env as ENV,
+});
```
-Allowed Options (params with \* are mandatory)
+Allowed Options (params with _ are mandatory)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
-| state | boolean | - | true for enable and false for disable |
-
----
-
-#### **isInitiator**
-
-- This method is used to tell if the current peer is the initator of the push video call or not.
-- Can be triggered on the initiator as well as receivers end.
-
-```typescript
-isInitiator(): boolean
-```
-
----
-
-## For Spaces
+| spaceId_ | string | - | space id |
+| speakers | Array | - | new speakers that needs to be added to the space. Don't add speakers which are already part of space |
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
-### **To create a space**
+
+ Expected response (add Speakers to space)
```typescript
-// pre-requisite API calls that should be made before
-// need to get user and through that encryptedPvtKey of the user
-const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging');
-
-// need to decrypt the encryptedPvtKey to pass in the api using helper function
-const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer);
-
-// actual api
-const response = await PushAPI.space.create({
- spaceName:'wasteful_indigo_warbler',
- spaceDescription: 'boring_emerald_gamefowl',
- listeners: ['0x9e60c47edF21fa5e5Af33347680B3971F2FfD464','0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
- spaceImage: <space image link> ,
- speakers: ['0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
- isPublic: true,
- account: '0xD993eb61B8843439A23741C0A3b5138763aE11a4',
- env: 'staging',
- pgpPrivateKey: pgpDecryptedPvtKey, //decrypted private key
- scheduleAt: new Date("2024-07-15T14:48:00.000Z"),
- scheduleEnd: new Date("2024-07-15T15:48:00.000Z")
-});
+// PushAPI_space_add_speakers | Response - 200 OK
+{
+ members: [{
+ wallet: 'eip155:0x4Be8cFD08B330853A530DEBB72a2DAf4d4F3D2Ba',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGSs51IBCAC+y8oXbU2YvfI7Z4xnSRfcPecRR+nO/XVLDbt30mbn1NU8\n' +
+ 'wHSXcuHLJTuU9yJy1t9AMB2SY8n/YWMFbeNICF0OQVINkvFS+8Ec/F42IIlb\n' +
+ 'StUY8rLS9pxTQoI3k1LnQKNL1krGiEuDl2ZT3l304aPGkF1sowu5w6xnzl/o\n' +
+ 'nb6cgc48jVqIgqoVUCnEoxc3GKdSORm35nl0RBDasFdFPJctnpg2n7hLofU1\n' +
+ 'RGOIzf/cITY7AE3nta0cqaFgNsO4rO0fXRwgDBAu66CtBG4Px2X8hT7IYMum\n' +
+ 'XJtCis3KvrmQAOhWrbAwmWjHbkSDSYigd39rmlht21GKf0/kfoILBgRfABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZKznUgQLCQcICZDTsTetOyJa2gMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBHGBWhlF6JChmgQO7tOxN607IlraAADq/Af/XWeAagX5+JCX\n' +
+ 'ChzadMaUtI6m2F7nT8sJcJep/a0Ldyz6kPmP9k6kmWO+QXJwl4FrP3e7HPer\n' +
+ 'SjTeIWm0FJ2a+pRtF+lWk7xjIWJuZxbx79nOk98arde75fT+bebne1V0raUM\n' +
+ 'gXPQIc60++okAPif6vJVLAaSMNbCkv8+Lsy0mJqsjY3b9iMVKWHKb8XVvTuN\n' +
+ 'pobxVV4dLq53lrdNDIiwAWTlbxyuKLSEF4f+hIPJX3PAhquORinOubclUwTM\n' +
+ '+kEmE6VI3pW4VL1VRi10cDI6ruEVwqOwQyYcp9gSDKXFR6ZXz7t0hjUUhl+3\n' +
+ 'z6T7yqAjExW1O4tETVSbt3jg6DjaAM7ATQRkrOdSAQgArRRrLZees3xCYyBO\n' +
+ '9WDzy7XCM2FxmaIJs/ibWwTtD1ZVoc9NKeOx07FYwGiYjigY6FxxJHdr20IQ\n' +
+ '3xieIyBLZM2XAIXrsxq4M9GLG8R6nhd35BenjcvSGiZH1Rq0aXtFt9Fd7gc6\n' +
+ 'E8XpMcHPH8KEnf66sPz18vrVCdstVU4Qj2ZjH25ilfeGdMj2HHfDxVN8sRhl\n' +
+ 'AXAcwblQ+IVXGjuKw19T4zN874bcAaOmXfzxu3+2PtxVSR5uV03x1ln3ji+b\n' +
+ '+GF8atJMMHCqE0FC/dEciS+BWSQtv0D93XWjzExJeyhd7Z+I3BG8JPuJT5Yj\n' +
+ '4PxktEgwUxQc83JFFwED9knzyQARAQABwsB2BBgBCAAqBYJkrOdSCZDTsTet\n' +
+ 'OyJa2gKbDBYhBHGBWhlF6JChmgQO7tOxN607IlraAABLdggAhe1KLjtHTsUI\n' +
+ 'SR0K25EJ+9gXC7wmebve9wNZL22/Ud9hnyS77/VUmMNBgdPyhm/9ITMhVtTt\n' +
+ 'rRNo1AzsVKDn3/dW1kc+nSribOufxzMoBM7Bm918Zt/0/7wCegz0bp3EAoQ8\n' +
+ 'KEa2KPY9lSh2WtEDoA87D8JB1xwIfcR98vg5/AZ7VdtE88foSqXAm+6F85hz\n' +
+ 'nAASNBO9CCDvUofR28b4exT/aWX0qZxLAukgH7fnYC3KPVv+9ug6mdyJPsOZ\n' +
+ 'LFjF327UKLrBuQ6VRlfKF+XULJbtNPxckgwO1V/oxycq/M67acGoXgc2MgP/\n' +
+ '2qOkbiQC0ZxcA+Ze5TNNhuGWKv6d9g==\n' +
+ '=S9Ba\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isSpeaker: true,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA1UlEQVR4AcXBQU1FUQxF0f2bZ6gaIOkAC4yxUCRQHyRoqIo6wcJnesLgEgJJ17p9vDzeEe9vd046nZOo4eT59YYylhnLjGW3p8+HOwedzl9EDSfGMmOZsezim05HRQ2q0zmJGlSno6IGZSwzlhnLrk5HRQ2q01FRw0mno6IG1ekoY5mxzFh2RQ2q01FRw29EDarTUVGDMpYZy4xlV6ejogbV6aio4aTTUVGD6nSUscxYZiy7+KbT+U+dzomxzFhmLLv4QdSgnl9vHNWgOp0TY5mxzFj2BfKPPQUA5ipXAAAAAElFTkSuQmCC'
+ }],
+ pendingMembers: [{
+ wallet: 'eip155:0x4d2eFB18383a48aCe19a198ae5228BB4bf854cec',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA9UlEQVR4AcXBoZHDMBCG0S87ZqEmooaiLmJJsNtwIyFuwzhERZgKmoqkhxz9HaCbmwP73u159w8iN0fVVFC5OT01FVRujqqpoIxgRjAj2JCbo6b1QE3LiDrpeywjF+vBRXOUEcwIZgQb+MW5zaiaCl3NUdN60GMEM4IZwYaaChfNUdN6cNGcnmk9UOc2o2oqKCOYEcwINuTmqJoKF835i3ObUTUVVG6OMoIZwYxgt+fdP4jHMqJe+xuVm9NTU0E9lhH12t8oI5gRzAg28OXcZlTeuKip0JObo06+7AVlBDOCGcFuz7t/6MjN+Y+aCj1GMCOYEewHE5pCbf3G8WQAAAAASUVORK5CYII='
+ },
+ {
+ wallet: 'eip155:0x8E50Bfb57f803814c242c5a25890f5F0c13304fF',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA20lEQVR4AcXBsWkDQRCG0W+Gy53pkgVVsiXYFVx2rsANiCtEmQoxbCHmYBNd6gLW6aBgjDDmf89eXr8GiW6VqIxGplslKqORccQcMUdsWued6Ho/k+lW+Yt13okcMUfMEZt4sM470YUb0XYsZC6nG9HKTsYRc8Qcsel6P5PpVnnGdixEZTQyjpgj5ohNPOhWyZTRyHSrRN0qURmNyBFzxBwx+34rg0QZjahbJVNGI+pWyThijpgjNvGLbpWojEamW+UZjpgj5ojZx/vnINiOhf90Od2IHDFHzBH7AWIQNGL6hyehAAAAAElFTkSuQmCC'
+ },
+ {
+ wallet: 'eip155:0xaA6E4434D881D2bDEea891AE127313AE5515a06B',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAyklEQVR4AcXBsZGDMABE0c8OqQPGZShzCdCCVNZVIhVAYrpQ6g48lMClkgMlBPve9HjtF0bCTJgJszmXykiKgTtyqYwIM2EmzOYUAyO5VO5IMTAizISZMJu/70rrOOmkGLgjl0prXegIM2EmzKbHa79o5FIZSTEwkktlJMVAS5gJM2E282Nd6Dy3QCuXykiKgdb3XRkRZsJMmE375++isS50jpNOioGRXCqtdaFznHSEmTATZjM/nluglUvljucWaOVSaQkzYSbM/gGGCDCC/3c1nwAAAABJRU5ErkJggg=='
+ },
+ {
+ wallet: 'eip155:0xf6106dd699B6e40f1E822c38DDA459F533470b11',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAwUlEQVR4AcXBsU2DMRSF0S9XHoIFIipmIEW2sPQ6pmGEdJa8BYXXsOgYxKF9afzrr+45l++39uSEUGenrcoZwkyYCbPCgVAna6uyE+pkbVV2hJkwE2Yl1MnaqmT364Ps5/eLnfv1QRZzkIU6mTATZsKscCDm4IXYijk4Q5gJM2FWONDeb7yYbLX3G1nMwY4wE2bCrHAg5iALdbYmpwgzYSbMLh+ff0+MhJkwE2Yl5iALdXbaquyEOjttVTJhJsyE2T84uix63kKmNgAAAABJRU5ErkJggg=='
+ },
+ {
+ wallet: 'eip155:0xAF3d4989652a6ED5554b6191c555525977424Cc9',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA3UlEQVR4AcXBsW3DMBCG0c8/tEMmUClkBDVaQAWHIKAZWHAGAxyChZDejbOCkcrDOO3ZxQlGENx7p4/t64Gj58JfpFbxiGAimAg2cOB6uWHNy4TnernxDhFMBBPBBl70XHg2YaVW8fRcsOalYKVWsUQwEUwEGziQWsXqueBJrWL1XPCIYCKYCHb6/vl8YKRW+U89FywRTAQTwQZebOOK53zf8Wzjim/CEsFEMBFs4MD5vmP1XPCktmNt44pHBBPBRLAhtYrVc+HZipXajmcbV6x5mbBSq1gimAgmgv0CTksv6eJNDqkAAAAASUVORK5CYII='
+ },
+ {
+ wallet: 'eip155:0x2ccBeEf6e30dF46D0A7Ee79Bc66FBF3beA7EeA5A',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA00lEQVR4AcXBIW6AMBiG4XdfmnAYboLlCE3NFBLX4JB40hMsWM4x08OgNvsXUbMs//N8fH59/2DksfCfthqxhDPhTDgLvGw1Yq3nhLWnm571nLD2dNMjnAlnwlnIY8HaasQajplGpWs4ZhqVRh4LlnAmnAln4VkuGinSs54TXcdMz7NcWMKZcCachT3dWHksWM9yYQ3HTM+zXFj5oLGlG0s4E86Es8DLViONFLEyhZ493TQqXcKZcCacCWfCmXAmnAVe8lj4izwWerYasYQz4Uw4+wXktDHpzVVJlwAAAABJRU5ErkJggg=='
+ },
+ {
+ wallet: 'eip155:0x65585D8D2475194A26C0B187e6bED494E5D68d5F',
+ publicKey: null,
+ isSpeaker: true,
+ image: null
+ },
+ {
+ wallet: 'eip155:0xE99F29C1b2A658a478E7766D5A2bB28322326C45',
+ publicKey: null,
+ isSpeaker: true,
+ image: null
+ },
+ {
+ wallet: 'eip155:0xa145b34443e28C8f718Cd0691Dc41A81E0d0A857',
+ publicKey: null,
+ isSpeaker: false,
+ image: null
+ }
+ ],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJkrOdUCZDTsTetOyJa2hYhBHGBWhlF6JChmgQO7tOxN607\n' +
+ 'IlraAAAqUQf9FvAtNouG7+2YSyyx7eiHRJZroDPFohH/F2xyc+oJkgh40p2y\n' +
+ 'hyKw+DSp0FA+IiT95/y8RbGDUrNFz+/kdMfZWCEYFim3Cy+c5k1/YNc8qxx6\n' +
+ 'VLwef+2YZepC1pSS9K0zbu04uVPWrNmDa5lHXqzTx/mOxWlxLD0NfpI60csE\n' +
+ 'iQx57duy2gMeW9MwOKSFjOSnWHKy7AySm/vBwZ9Rj4gnOhsvwbAfLprQQf4G\n' +
+ 'cUaxG/HOb0c/8Ugews0Z1uDJFmGKjT5R5CR63vPo5qDGQwWkm+LYpshCIV+K\n' +
+ 'ofLepDqQRuEFa7VyUlDOvMcF15LtlvAhwhkIVHvTGjXZC91e8/IUsQ==\n' +
+ '=UpR2\n' +
+ '-----END PGP SIGNATURE-----\n' +
+ ':null',
+ spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ spaceName: 'weird_moccasin_alligator',
+ isPublic: true,
+ spaceDescription: 'equivalent_blue_armadillo',
+ spaceCreator: 'eip155:0x4Be8cFD08B330853A530DEBB72a2DAf4d4F3D2Ba',
+ spaceId: 'spaces:d37c4e303a2ff194e546d3af94353ec829324a578ebffbeadebd1ba91ab88548',
+ scheduleAt: '2023-07-15T14:48:00.000Z',
+ scheduleEnd: '2023-07-15T15:48:00.000Z',
+ status: 'PENDING'
+}
```
-### **To create a token gated space**
+
-```typescript
-// pre-requisite API calls that should be made before
-// need to get user and through that encryptedPvtKey of the user
-const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging');
+---
-// need to decrypt the encryptedPvtKey to pass in the api using helper function
-const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer);
+### **To remove speakers from space**
-// actual api
-const response = await PushAPI.space.create({
- spaceName:'wasteful_indigo_warbler',
- spaceDescription: 'boring_emerald_gamefowl',
- listeners: ['0x9e60c47edF21fa5e5Af33347680B3971F2FfD464','0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
- spaceImage: <space image link> ,
- speakers: ['0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
- rules: {
- 'spaceAccess': {
- 'conditions': [
- {
- 'any': [
- {
- 'type': 'PUSH',
- 'category': 'ERC20',
- 'subcategory': 'holder',
- 'data': {
- 'contract': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
- 'amount': 1000,
- 'decimals': 18
- }
- },
- {
- 'type': 'GUILD',
- 'category': 'guildRoles',
- 'subcategory': 'specificRole',
- 'data': {
- 'guildId': '13468',
- 'guildRoleId': '19924'
- }
- }
- ]
- }
- ]
- }
- },
- isPublic: true,
- account: '0xD993eb61B8843439A23741C0A3b5138763aE11a4',
- env: 'staging',
- pgpPrivateKey: pgpDecryptedPvtKey, //decrypted private key
- scheduleAt: new Date("2024-07-15T14:48:00.000Z"),
- scheduleEnd: new Date("2024-07-15T15:48:00.000Z")
+```typescript
+const response = await PushAPI.space.removeSpeakers({
+ spaceId,
+ speakers: [
+ `eip155:0xB12869BD3a0F9109222D67ba71e8b109B46908f9`,
+ `eip155:0x2E3af36E1aC6EEEA2C0d59E43Be1926aBB9eE0BD`,
+ ],
+ signer: signer,
+ pgpPrivateKey: pgpDecrpyptedPvtKey,
+ env: env as ENV,
});
```
Allowed Options (params with _ are mandatory)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
-| account_ | string | - | user address |
-| spaceName* | string | - | group name |
-| spaceDescription* | string | - | group description |
-| spaceImage* | string | - | group image link |
-| listeners* | Array | - | wallet addresses of all listeners except speakers and spaceCreator |
-| speakers* | Array | - | wallet addresses of all speakers except listeners and spaceCreator |
-| isPublic* | boolean | - | true for public space, false for private space |
-| scheduleAt\* | Date | - | Date time when the space is scheduled to start |
-| scheduleEnd | Date | - | Date time when the space is scheduled to end |
-| contractAddressERC20 (deprecated) | string | null | ERC20 Contract Address |
-| numberOfERC20 (deprecated) | int | 0 | Minimum number of tokens required to join the group |
-| contractAddressNFT (deprecated) | string | null | NFT Contract Address |
-| numberOfNFTTokens (deprecated) | int | 0 | Minimum number of nfts required to join the group |
-| rules | Rules | - | conditions for space access (see format below) |
-| pgpPrivateKey | string | null | mandatory for users having pgp keys|
+| spaceId_ | string | - | space id |
+| speakers | Array | - | existing speakers that needs to be removed from the space. Don't add speakers which are not part of space |
| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
-## **Rules format**
-
-```typescript
-export enum ConditionType {
- PUSH = 'PUSH',
- GUILD = 'GUILD',
-}
-
-export type Data = {
- contract?: string;
- amount?: number;
- decimals?: number;
- guildId?: string;
- guildRoleId?: string;
- guildRoleAction?: 'all' | 'any';
- url?: string;
- comparison?: '>' | '<' | '>=' | '<=' | '==' | '!=';
-};
-
-export type ConditionBase = {
- type?: ConditionType;
- category?: string;
- subcategory?: string;
- data?: Data;
- access?: Boolean;
-};
-
-export type Condition = ConditionBase & {
- any?: ConditionBase[];
- all?: ConditionBase[];
-};
-
-export interface Rules {
- groupAccess?: {
- conditions: Array;
- };
- chatAccess?: {
- conditions: Array;
- };
-}
-```
-
- Expected response (create space)
+ Expected response (remove Speakers to space)
```typescript
-// PushAPI.space.create | Response - 200 OK
+// PushAPI_space_remove_speakers | Response - 200 OK
{
members: [{
- wallet: 'eip155:0x727C819feB2c7F99c66d71B8411521bca2010023',
+ wallet: 'eip155:0x5908D89B1390ec5833001b86302B868A808D506D',
publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
'\n' +
- 'xsBNBGSrssEBCACg3ZjrZB40Xqr5IKIEtFldaeQyJPNwDACMekY77yApav0B\n' +
- 'RwiqhFJDFJKcprSHg/vYdqalAIGRQ+J98VMBtHweurIubD/ODB6WknOms7ZY\n' +
- '3ummaEzyFRombuq/C75o/0ImCi2v0PJBI3kdpwzOjiTt8S44yoAVOcTf9jyg\n' +
- 'vTEVCOM81yqCf0mDB4t0jqRYewlQuJegORXDKHKTfZcnQybBkDYUGgmxOcyF\n' +
- 'BaPMhSiWqAAqqb4gcFO2QKq69JoiE9dzSuF/7dvAq2QZRogC/GQW2Q9yQbq3\n' +
- 'CvMNO4H2KUZzegaq2s2nMPGMXPNf4GZcZVJE1phWgAnApxTf5kUFfKr1ABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZKuywQQLCQcICZDwrCS5ulOLwQMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBFKpO7zcSRed+QmbIfCsJLm6U4vBAABZMwf+OIbBcFQ7x++1\n' +
- 'NINOYbP9v0PyJvpllDcUORbk3uiPMpvDuQYAe2Fd4dY2Y91l3VdpIm/w6HQy\n' +
- 'y81Y694w4E7PRVhDwHivv5D10VE9MF3h6qOHrLLpvdhpMaB5Ur8ts5rU2zOu\n' +
- '64HR04/BVO9N0nrE9iywIgVMOy6IrS+OgK3r75PPX35bam/kbbmZHeygFaE9\n' +
- '+mgQVdhwgF5borekIiz1Rc8CPA/P1yZy8QQl4KGmJEs+hOc5rPnUWwarvaAH\n' +
- 'mPb6H0/mG81eXBOjpJlSFu6d/uqKLpoAw5fkvFoIsNwovYpyQkSbhzwe4T2N\n' +
- 'jGqGd0+La03QdB5FbaiwcnJ96lU6oM7ATQRkq7LBAQgAxu9uK1+p62+/RvcF\n' +
- 'Mz7g3A8SJiN76NYxk29sjQ9gW74B/IdPv5TlUVhG6PGr2c3SucASlEHieagY\n' +
- 'CXM2+fpdu4rQ6EKRAe+30GFopfzhX1d0zv9d5BE6q1ML5mkrpDECH5iuqah7\n' +
- 'smmbRdWE7zRSGaHyEfVqAG3wfMzzN0BcchxxR4vMCNKYLs9v2Q09ecO7DgaY\n' +
- '5CZqxaFlTo+auuDhE0XU7WRbNL77izocV1Sm+McRyo28PrFTcrRRznD1nP0V\n' +
- 'eZ4+aoulqyYA+gBBaIUdSA5kQXJiy67crB50yX3V6zLIfptD2ThHPjTY/inW\n' +
- 'wVHVug4jIWUQ1QQw/q9qvGxAzQARAQABwsB2BBgBCAAqBYJkq7LBCZDwrCS5\n' +
- 'ulOLwQKbDBYhBFKpO7zcSRed+QmbIfCsJLm6U4vBAADu6wf+NJDX/3NAxQKN\n' +
- 'Iigj0GkBm/y69iFmQvWJxxtiYCNu8VBhm8MkcghUJ8G2tWP9ueUOM8sMTEa+\n' +
- 'G+l+wSNwh/1yisF3FutDpy6l+fiy6kPPD4vl08jY3GrqSuWWfMxTJhMZ5D6v\n' +
- 'OW2EfdyET+oP5eOnCd6p0EXP2ic48rVHDdU2iWeg0RkGvZP3t2LljWFdLbvw\n' +
- 'h7+wSD1i4LY4slUIdbLdDSLN1gWFN1HXzX10mpX0grV2sBdfkNyHhF0WcIat\n' +
- 'sD9HpAx2M62yP2D9D9UZVrW7WfmOoyL1NrnXSJsI8CRFDzujvpIrr7875zSi\n' +
- 'VnxDVyt7twc7cYqRDHsNYuxAuE815A==\n' +
- '=2jvb\n' +
+ 'xsBNBGSs6YABCADC4ldJKGpZ0Z+JJwA1t/1JWp5+dnR98nr7RHPX8eEGxIhL\n' +
+ 'gtx5TZmek2BcGzNcg66+GEyC4np9USaCZ4/YC9ZMLw8BQKzhOcd3ZILyGtGV\n' +
+ 'BijBNwjPIbQcy5/cXVtfKCvf303BDYddPYuJ1xFAh7kpvhcR4a72CSpeyEjM\n' +
+ 'UndteAVTIxqwdpnXIdqpwu6HrSJ089GpHV+XeaDo4Uhg+iHJsCRJy2VJ5m61\n' +
+ 'CwGx55f3ror6rAXQd+hEx+keLxYINNJLLvfvE9IGsIbKRFZx+emjXQZusbJp\n' +
+ 'zXYhJnEeHPLVDjWhzo8Q3/4gvOz8m6a+A9sl49sqodLdxVlXQ7d4CuylABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZKzpgAQLCQcICZCaDezdj8j4SwMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBGZpOFBNtTj1Oqt695oN7N2PyPhLAACCLgf/dB412nDRcOxR\n' +
+ 'dNSj2AYknJ+NKeX38KuksyR6wypnaJWpapmIeZCfFjeoBjuBCPd6unvN/IlZ\n' +
+ 'zPwl66lO5GKJxDaDd1/infxM/dbtFQSESLXlweRLQ/v1+plsntrBUyvbY4uH\n' +
+ 'Mh9PImYsLY+zo8P5mpBV5AGAMA6R9qmu3axH/MnKVdB0Ky6C/jP+7lPs/QVT\n' +
+ 'qsISyyI1E9E6Oivzxmao1axfXLdEvICHb6uD0R4p5SUVqHJX41OwM8BFevhK\n' +
+ '07Hi+c7NhUWp0sxXEOs6dneJZwerCD3EahutpP1Oyt5T8MZitysn2yJ+s5ks\n' +
+ 'SZza+x8OmCMcMZfZnIsJNnIUvPboP87ATQRkrOmAAQgAteDgsJJ0ftPD+P15\n' +
+ 'rKgkLuSCD2iwQgm2k8/ZDaXJBsdm4sJYTt2y0ckx7MRpXgLuIyidOGctqVL6\n' +
+ '/Rl2Hfl30JQPok5cYmYLENVuFz94MEvgDOo8jacyfPdLGPMWZMLRojyM/Yvs\n' +
+ 'nhDZ8if3zEstP4h3HcpdT+PWSmsJWjrq57la4vKbfILtKfTBaf8sibm5UuZA\n' +
+ '5Y/SIPxfVC+ybCPAjo4tpDYP901V+wxXDJ8BlZ4AaVvk20MYMzuAjBna+iwD\n' +
+ 'f0j4CccEabd2EVtAQQcMCg2yTjOT22Dt0jfpDuohDNaXDhX2ZQlJIdlSLCEI\n' +
+ 'a3c7g+uU9bnNqt7LHPgMzLYKnwARAQABwsB2BBgBCAAqBYJkrOmACZCaDezd\n' +
+ 'j8j4SwKbDBYhBGZpOFBNtTj1Oqt695oN7N2PyPhLAAD2vQgAu9+sd4AT5b6c\n' +
+ 'mWOaQBXz2XVfJXYQFNlBdOF23reycF9r7vDAKSRpeyMSyOfRAi0qdLynQ1dN\n' +
+ 'MXV/gfO0G9dzFu513P/Y1sZxQi0uLRKL9hMcgEQ8FLo8/PGfVcoLfQASryGj\n' +
+ 'Z8ybCFqiXocGpt2VkkK4wwgv+ZwZ8M1ubz0Boby6A1/kTYs/6ll+QekpB4ao\n' +
+ 'kJKw3DWvVNR/xODFfMQcClvzAtqwfxhTZXBMbZ4vAG5m1ExGmA15cGXrAfwV\n' +
+ 'nR2vOhPYDeZGbBKktM3xfDts75N2NF/TBpvazV2DTKpkLqvVitFHWvSMMpVd\n' +
+ 'dwk9tEOmBlj2AoYATvQ9kKHRTD27Wg==\n' +
+ '=IXzf\n' +
'-----END PGP PUBLIC KEY BLOCK-----\n',
isSpeaker: true,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA4klEQVR4AcXBoW3FMBRA0dsn75E9skAU6BkMSk1CA0xNsoBnMLSyQPbIDgVlLX0OcPX1Vb1zPj6/v35QWg5o61bQok+MHHVHazmgrVtBE4wJxgRjjofzmuj4xCuiT2iRCe2gJxgTjAnGXMuBTi2MRJ8YOerOSMsBTTAmGBOMuXUraNEntKPuaEfdeUX0iU4taIIxwZhgzPGH6BP/STAmGBOMOR6W+UY7r4l3LPONttITjAnGBGMu+kSnFrQlB96xbgUt+oQmGBOMCcYcDy0HRs5rYmSZb7SWA1pkQhOMCcYEY78uSjTZAXCkaQAAAABJRU5ErkJggg=='
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA1klEQVR4AcXBoXHEMBRF0Zs3oqpHNYgJecZdGKYMd5GZRWaCwaohZbiAhP5d8HeC3jkfnz/fvwSTRua+DjJ1nGQ6i0iYCTNhVnjRWUSTRlTHyX90FhlhJsyEWeHFpJG5r4NMHSfRpBF1FpEwE2bCrPDGfR1E29jJPK6DqI6TjDATZsKsTBqZOk6iSa6ORmbSiISZMBNmpbOIHtcXUR0nUWeRmTSi+zqItrETCTNhJswKL7ax82wRTRqZzuLJ2MkIM2EmzApvTBpRZ5GZNKLOIiPMhJkw+wPV2i2sD43hKwAAAABJRU5ErkJggg=='
}],
pendingMembers: [{
- wallet: 'eip155:0x5f4e9e7Fcc17a943178c0b0881b09E8Ef9D34437',
- publicKey: null,
+ wallet: 'eip155:0xC1469cB7b59d16dC887D4C11faB3E3C0abBeA12C',
+ publicKey: '',
isSpeaker: false,
- image: null
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA30lEQVR4AcXBsWnFMBSG0e9dBAGDPUs6LeAFNIEb1x5GtRtDei3gBQzZIFtYYEj10t73CkFw8Z/z+Pj+euJs14iXlsodJfd4U7fjGWKGmCEWzjnilUzTsB60nHOk5ZwjniFmiBligTdTt+MlIt52jbRVvKnb8RIRzxAzxAyxx+/nzxMhQ8wQM8RCyT0taancUXJPiyFmiBligTdTt+NNKy/OOdIyrAct2zXiGWKGmCEW0lJ5kUe8tFT+45wjXsk9XloqniFmiBliYVgPvHOOeCX33JGWijesB54hZogZYn8uFTTKoy9pgwAAAABJRU5ErkJggg=='
},
{
- wallet: 'eip155:0xFedfA2b276676C5c6ce753ddb4B05d00104E9236',
- publicKey: null,
+ wallet: 'eip155:0xccF7a3131E0E73F83Bc457C27494411a57f23248',
+ publicKey: '',
isSpeaker: false,
- image: null
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA9ElEQVR4AcXBIWoEMRSA4X8fw6qayBW9zULVEBFygLqcqMwdhlBCbKjqXSLjY7b2UZEVpbzvu3x8vT5QShhoqUa0Yz9ZSTWiHfuJ5rNDE4wJxgRjl8/v9wdKn43/dLve0QRjgjHB2NZnQ7td72h9NrQSBis+O7Tb9Y7WZ0MTjAnGBGMbv/TZ0EoYaD47VkoYaD43VgRjgjHB2MYTqUa0Yz9ZSTWi9dlYEYwJxgRjlzf38kDx2aGVMNBSjawc+4nms0MrYaAJxgRjgrGNJ1KNaH02VlKNaH02VgRjgjHB2OazQythoKXKn5Qw0Hx2aIIxwZhg7Ae2cUcV4Bl8pAAAAABJRU5ErkJggg=='
+ },
+ {
+ wallet: 'eip155:0x052aD82D3a7b4DAb5b9BcFED771D28703a6faadf',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAy0lEQVR4AcXBoXFDQQxF0RtlkZsQNjHICKYYV7DFCAW6II2BycfbhklCNR/sTNA75+Pn+/MXIUPMEDPEBifhSVdr0oUnO7UmXXjS1Zp0hpghZogZYoaYIWaIDU5qTbrwpHtfnuyEJ12tyY4hZogZYiM86WpNdl7Hg53wL3bCk84QM8QMscFJeNLVmnS3652dOiZdeLJjiBlihtioNenCky486eqY7IQnO7UmnSFmiBliIzzpak262/XOf7wvT7rX8aALTzpDzBAzxP4AMOQyARcWaToAAAAASUVORK5CYII='
+ },
+ {
+ wallet: 'eip155:0x956f73E5a3BF0D19299BF74bD6dc819D7f775eC7',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA20lEQVR4AcXBsYnDMBiG4dc/nsHgHeJWS1x7G6QzqNQUKlUHLn12ONdqNYTBS/ja/xqBCeF7nmFbbydODoVPSjXiGWKGmCE2Pu8vvPT45pOe9xeeIWaIGWLj0Xa8HAo9qUZ6cih0tR3PEDPEDLFhW28nTg4FL9XIO3IoeKlGPEPMEDPEhq+f3xNnWmZ6jrbTMy0zPUfb8QwxQ8wQG6dlxjvajpdq5JLKPzkUvGmZ8QwxQ8wQG4+246Ua8XIovCPViJcpeIaYIWaIDdt6O7kgh0JPqpErDDFDzBD7AzabOPmHFg/aAAAAAElFTkSuQmCC'
+ },
+ {
+ wallet: 'eip155:0x19da526eD1a57E07D48aa25aDa6cbA7E41FF3129',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAyUlEQVR4AcXBsY1CQQxF0cvTFEHuNn4jxB6JJggpw5Mh/UZogmByumBTi2DQahf5nMN2vr1IjvtG1ufgL8Kc7Hm6k4liopgo1i7XB1nsG990uT7IRDFRTBRrfBDmZH0OVsKc3xDFRDFRrPFBn4MszFnpc5CFOSuimCgmih228+1Fctw3vul5upOJYqKYKNaO+0bW5yALc7I+BythTtbnIAtzMlFMFBPFGm/CnP8U5qyIYqKYKNZ40+dgJcxZ6XOwEuZkopgoJor9AIckL2mEiBQrAAAAAElFTkSuQmCC'
+ },
+ {
+ wallet: 'eip155:0x77059B40Ec974883b98a23eef519b4076D1Cf9F1',
+ publicKey: '',
+ isSpeaker: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsY0CMRRF0cuTQ6rYaQFiAvdBYMkFkFEAwWYTryxZ2kIcEE8N1MKmH4JJRuw7Z/d7uD0JRu1EuRW2GLUT5VaIhJkwE2a788/XEyNhJsyEWcqtEI3a+aTcCpEwE2bCLI3aia77E9EyT2xxvDyIvmsnEmbCTJgl3izzRDRqJ8qtsGbUzou58KLeiYSZMBNmKbfCf8qtEAkzYSbM0qidTxq1s0aYCTNhlq77E9EyT2yRW2HN8fIgEmbCTJj9AUPBKWCCQlIAAAAAAElFTkSuQmCC'
}
],
- contractAddressERC20: "0x8Afa8FDf9fB545C8412499E8532C958086608b30",
- numberOfERC20: 20,
- contractAddressNFT: "0x42af3147f17239341477113484752D5D3dda997B",
- numberOfNFTTokens: 2,
- verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJkq7LBCZDwrCS5ulOLwRYhBFKpO7zcSRed+QmbIfCsJLm6\n' +
- 'U4vBAAAAHwf+K4f0gxaP56X4Cv2zlPWB9iUPi/1FOnx8ZF7oEf9xJSv/xA7v\n' +
- '9LHBTZ2Y9AQlJpy0WLB7KGF7mVV1MdUKHjn2SFQ+1h+8d+FIHXfmB7Ie4alP\n' +
- 'nnar6XjtMVKYyqXRzMzCq2F7Fjea1sUOXBxAeyJstAGG6nvsU51imaAtGQlQ\n' +
- 'u7ih8D9UkiOe719v5GyI1vtiS+hHGlYo0+A7WVImH6SuVyPZ3UyPvLxXpeKs\n' +
- '1SeEfuvfmKHbswm1DDGOknyo7fJ/QgKqOfkwsBIrYRNGwPGEKt8pHdwNxsNn\n' +
- 'hNQtlFqtmtvieaxbhJQKXHbVgNv206xNsUBrK/U2nCakx7EMmxikFg==\n' +
- '=tz9T\n' +
- '-----END PGP SIGNATURE-----\n',
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJkrOmCCZCaDezdj8j4SxYhBGZpOFBNtTj1Oqt695oN7N2P\n' +
+ 'yPhLAAD+iwf/dvaRCTwXKGH6iUe49NpyTHMaD6ZwaLerk+K4Ojehbdoo0mDf\n' +
+ 'aOu/MR8wfqk49h2436rcMmyeM5avcMgmtGUmIdy/6hCZ6zxR/3E5t/vq5UfO\n' +
+ '3YFO1VLghR5cTYqR9bMLFkvvCB4P29rnaok2QVKTBZLfyAM4wu1h2DDBESoz\n' +
+ 'SS+ZtQLPz6/y7gOQobO0zbwBPmy8MpVVu1wxht+sneOMvZX+5al679nQbwNL\n' +
+ 'oCcU3UKrlqMhuFgMTCKx99VLcc4JbhBf2M+IHf78NtQ9mcQC/X+gxRfp6f+p\n' +
+ '2RePQzkmUH5vqXjzcUsNBWJPOyjl09/IZWWwaeiUjsPazjxqDtYNHg==\n' +
+ '=H4X4\n' +
+ '-----END PGP SIGNATURE-----\n' +
+ ':null',
spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- spaceName: 'wasteful_indigo_warbler',
+ spaceName: 'sheer_ivory_ox',
isPublic: true,
- spaceDescription: 'boring_emerald_gamefowl',
- spaceCreator: 'eip155:0x727C819feB2c7F99c66d71B8411521bca2010023',
- spaceId: 'spaces:e0553610da88dacac70b406d1222a6881c0bde2c5129e58b526b5ae729d82116',
+ spaceDescription: 'specific_green_alpaca',
+ spaceCreator: 'eip155:0x5908D89B1390ec5833001b86302B868A808D506D',
+ spaceId: 'spaces:bc96011f182e2c86ad68aaf4c95c4a916c808088370cb0ba294f9168e2ff6328',
scheduleAt: '2023-07-15T14:48:00.000Z',
scheduleEnd: '2023-07-15T15:48:00.000Z',
- status: 'PENDING',
- rules: {
- 'spaceAccess': {
- 'conditions': [
- {
- 'any': [
- {
- 'type': 'PUSH',
- 'category': 'ERC20',
- 'subcategory': 'holder',
- 'data': {
- 'contract': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
- 'amount': 1000,
- 'decimals': 18
- }
- },
- {
- 'type': 'GUILD',
- 'category': 'guildRoles',
- 'subcategory': 'specificRole',
- 'data': {
- 'guildId': '13468',
- 'guildRoleId': '19924'
- }
- }
- ]
- }
- ]
- }
- }
+ status: 'PENDING'
}
-
-
```
---
-### **To check user access of a token gated group**
+### **Fetching list of user spaces**
```typescript
-
-// actual api
-const response = await PushAPI.space.getAccess({
- spaceId:'8f7be0068a677df166c2e5b8a9030fe8a4341807150339e588853c0049df3106',
- did: '0x9e60c47edF21fa5e5Af33347680B3971F2FfD464'
- env: 'staging',
+const spaces = await PushAPI.space.spaces({
+ account: string;
+ pgpPrivateKey?: string;
+ /**
+ * If true, the method will return decrypted message content in response
+ */
+ toDecrypt?: boolean;
+ /**
+ * Environment variable
+ */
+ env?: ENV;
});
```
-Allowed Options (params with \_ are mandatory)
-| Param | Type | Default | Remarks |
-|----------|---------|---------|--------------------------------------------|
-| spaceId | string | - | space address |
-| did | string | - | user address |
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
-
-
- Expected response (space access)
-
-```typescript
-// PushAPI_chat_getSpaceAccess | Response - 200 OK
-{
- 'spaceAccess': true,
- 'rules': {
- 'spaceAccess': {
- 'conditions': [
- {
- 'any': [
- {
- 'type': 'PUSH',
- 'category': 'ERC20',
- 'subcategory': 'holder',
- 'data': {
- 'contract': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
- 'amount': 1000,
- 'decimals': 18
- },
- 'access': false
- },
- {
- 'type': 'GUILD',
- 'category': 'guildRoles',
- 'subcategory': 'specificRole',
- 'data': {
- 'guildId': '13468',
- 'guildRoleId': '19924'
- },
- 'access': true
- },
- {
- 'type': 'PUSH',
- 'category': 'ERC721',
- 'subcategory': 'owner',
- 'data': {
- 'contract': 'eip155:5:0x42af3147f17239341477113484752D5D3dda997B',
- 'amount': 1
- },
- 'access': true
- }
- ]
- }
- ]
- }
-}
-
-```
-
-
-
----
-
-### **To update space details**
+| Param | Type | Default | Remarks |
+| ------------- | ------- | ------- | ---------------------------------------------------------------------- |
+| account | string | - | user address (Partial CAIP) |
+| toDecrypt | boolean | false | if "true" the method will return decrypted message content in response |
+| pgpPrivateKey | string | null | mandatory for users having pgp keys |
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev' |
-Note - updateSpace is an idompotent call
+**Example normal user:**
```typescript
// pre-requisite API calls that should be made before
// need to get user and through that encryptedPvtKey of the user
-const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging');
+const user = await PushAPI.user.get({
+ account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7',
+ env: ENV.STAGING,
+})
// need to decrypt the encryptedPvtKey to pass in the api using helper function
-const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer);
+const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: signer);
// actual api
-const response = await PushAPI.space.update({
- spaceId: 'spaces:e0553610da88dacac70b406d1222a6881c0bde2c5129e58b526b5ae729d82116',
- spaceName: 'Push Space 3',
- spaceDescription: 'This is the oficial space for Push Protocol',
- listeners: ['0x2e60c47edF21fa5e5A333347680B3971F1FfD456','0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
- spaceImage: <group image link> ,
- speakers: ['0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
- scheduleAt: '2023-07-15T14:48:00.000Z',
- scheduleEnd: '2023-07-15T15:48:00.000Z',
- status: PushAPI.ChatStatus.PENDING,
- account: '0xD993eb61B8843439A23741C0A3b5138763aE11a4',
- env: 'staging',
- pgpPrivateKey: pgpDecryptedPvtKey, //decrypted private key
+const spaces = await PushAPI.space.spaces({
+ account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7',
+ toDecrypt: true,
+ pgpPrivateKey: pgpDecryptedPvtKey,
+ env: ENV.STAGING,
});
```
-### **To update token gated space details**
-
-Note - updateSpace is an idompotent call
+**Example NFT user:**
```typescript
-// pre-requisite API calls that should be made before
-// need to get user and through that encryptedPvtKey of the user
-const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging');
+// Fetch user
+const user = await PushAPI.user.get({
+ account: `nft:eip155:${nftChainId}:${nftContractAddress}:${nftTokenId}`,
+ env: env as ENV,
+});
-// need to decrypt the encryptedPvtKey to pass in the api using helper function
-const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer);
+// Decrypt PGP Key
+const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({
+ encryptedPGPPrivateKey: user.encryptedPrivateKey,
+ signer: nftSigner,
+});
-// actual api
-const response = await PushAPI.space.update({
- spaceId: 'spaces:e0553610da88dacac70b406d1222a6881c0bde2c5129e58b526b5ae729d82116',
- spaceName: 'Push Space 3',
- spaceDescription: 'This is the oficial space for Push Protocol',
- listeners: ['0x2e60c47edF21fa5e5A333347680B3971F1FfD456','0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
- spaceImage: <group image link> ,
- speakers: ['0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
- scheduleAt: '2023-07-15T14:48:00.000Z',
- scheduleEnd: '2023-07-15T15:48:00.000Z',
- status: PushAPI.ChatStatus.PENDING,
- rules: {
- 'groupAccess': {
- 'conditions': [
- {
- 'any': [
- {
- 'type': 'PUSH',
- 'category': 'ERC20',
- 'subcategory': 'token_holder',
- 'data': {
- 'address': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
- 'amount': 1000,
- 'decimals': 18
- }
- },
- {
- 'type': 'GUILD',
- 'category': 'guildRoles',
- 'subcategory': 'allRoles',
- 'data': {
- 'guildId': '13468'
- }
- }
- ]
- }
- ]
- },
- 'chatAccess': {
- 'conditions': [
- {
- 'all': [
- {
- 'type': 'PUSH',
- 'category': 'ERC20',
- 'subcategory': 'token_holder',
- 'data': {
- 'address': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
- 'amount': 1000,
- 'decimals': 18
- }
- },
- {
- 'type': 'GUILD',
- 'category': 'guildRoles',
- 'subcategory': 'specificRole',
- 'data': {
- 'guildId': '13468',
- 'guildRoleId': '19924'
- }
- }
- ]
- }
- ]
- }
- },
- account: '0xD993eb61B8843439A23741C0A3b5138763aE11a4',
- env: 'staging',
- pgpPrivateKey: pgpDecryptedPvtKey, //decrypted private key
+// Actual api
+const spaces = await PushAPI.space.spaces({
+ account: `nft:eip155:${nftChainId}:${nftContractAddress}:${nftTokenId}`,
+ toDecrypt: true,
+ pgpPrivateKey: pgpDecrpyptedPvtKey,
+ env: env as ENV,
});
```
-Allowed Options (params with _ are mandatory)
-| Param | Type | Default | Remarks |
-|----------|---------|---------|--------------------------------------------|
-| spaceId_ | string | - | Id of the space |
-| account* | string | - | user address |
-| spaceName* | string | - | space name |
-| spaceDescription* | string | - | space description |
-| spaceImage* | string | - | space image |
-| status* | string | - | space status - 'ACTIVE', 'PENDING', 'ENDED' |
-| listeners* | Array | - | wallet addresses of all listeners except speakers and spaceCreator |
-| speakers* | Array | - | wallet addresses of all speakers except listeners and spaceCreator |
-| scheduleAt* | Date | - | Date time when the space is scheduled to start |
-| scheduleEnd | Date | - | Date time when the space is scheduled to end |
-| contractAddressERC20 (deprecated) | string | null | ERC20 Contract Address |
-| numberOfERC20 (deprecated) | int | 0 | Minimum number of tokens required to join the space |
-| contractAddressNFT (deprecated) | string | null | NFT Contract Address |
-| numberOfNFTTokens (deprecated) | int | 0 | Minimum number of nfts required to join the space |
-| rules | Rules | - | conditions for space and chat access (see format above) |
-| pgpPrivateKey | string | null | mandatory for users having pgp keys|
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
-
- Expected response (update space)
+ Expected response (Get spaces of a specific user)
```typescript
-// PushAPI.space.update | Response - 200 OK
-{
- members: [
- {
- wallet: 'eip155:0x367c6555b2CAD9C2d2656066EC3996Ba12cD058d',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+// PushAPI_space_spaces | Response - 200 OK
+// Array of spaces
+[
+ {
+ spaceId:
+ 'spaces:3aa43087b8c55ed9c534dd1d0a086a3340b0d829cda0a13592651cb59f284838',
+ about: null,
+ did: null,
+ intent:
+ 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A+eip155:0xF8aBe92d1d0706bF60509F8E9A64Ed6b8520E868',
+ intentSentBy: 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
+ intentTimestamp: '2023-07-12T01:11:32.000Z',
+ publicKey: null,
+ profilePicture: null,
+ threadhash: null,
+ wallets: null,
+ combinedDID:
+ 'eip155:0x12E429E3672a02E385F9f5F75E932cC1D566EEea_eip155:0x49D407CC9D0e966CD9B22BA40685083B49bd2315_eip155:0xF8aBe92d1d0706bF60509F8E9A64Ed6b8520E868_eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
+ name: null,
+ spaceInformation: {
+ members: [Array],
+ pendingMembers: [Array],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof:
+ 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
'\n' +
- 'xsBNBGSr17UBCADhEXWz/lsg0sDA+QRygzl+4t84/YYa459nzFRNB36jkbU8\n' +
- 'FxRsE6oZTu0Leanup7aul4trJJ4qyA6xFfDjprDzrm1Gtp/gos46Lxk+br64\n' +
- 'lzgqTfSKpBs9UWqOcr4Vnoq9WeOiFZax0DhN//7ibIQDWIJ0E6iOc8uiSoGZ\n' +
- 's4AHTx7GtUvHxIUAk/hQY8UjjDNyhgCSrmdPeWt/SVbmFCHchdH/KhSK8JVq\n' +
- 'qs8/nKx2Tm/nmAdWFZDqIJxd5tVuXXMxTZYZADZfmBltR2F/8GkF7hfX/aOo\n' +
- 'gGQ/u2FPbCKRjtedfJi3WsPUKtyFg6QdwBnOQmYn0fGXlPGR7UVSsmIVABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZKvXtQQLCQcICZD2NRrvru2XMgMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBM1nsbalDm3PtLAK2/Y1Gu+u7ZcyAADzuwgAmTBbnBQZ2w06\n' +
- 'RbLmcZf8cYTof1X3mpYBa1lprMltib2jZQdu8DxhZBapYIE1O0UzV2Dy8IXj\n' +
- 'zavtNFZiLR8FTwkrXQ3DGrZylnqjLkQ6m2jZsGIypb2OpTlBIBnjW98Dh99F\n' +
- 'egI/5wse59IfGhYXVcKluKDAW2ezUJx8BhacZCwf/S8iG9YKrZctS5cVZxQw\n' +
- 'SymXv88msoQrWhxmu2AT0rNsZ656ANMr/MuUjKMxQsoNCNIkp5kE0UTGfMwc\n' +
- 'c69Gabs9uOPOqAGeSBGVfw+uJig/RJ4MWDCbj6QIDsV5FFRvTmJmmSNLNH5y\n' +
- '83pHxE+923z6NiPWRonbns3pFNvhnc7ATQRkq9e1AQgAxjGMkGhs2OTW8fW/\n' +
- '4tloJOID0UIDrz/24uX4JU+qjTqMzFyNGaNagT8n0xDH2E63YFmketip4QA2\n' +
- '6kUBICKR2Y5kNNzkJXK4NYfa5OXEIS+lw+X7oMXd9YJ/D1fig1XD4Bf0ofsZ\n' +
- 'QIxHOn6w3T/wQHOBpu+cqE3d0pW+6s6hZ4mkuPk6OXrkBSEtynk4ADQS+a3b\n' +
- 'PrCGU9rJy2OnbP+lMr3onv/6BR/DFE4qCIfQt0cLu4nhAuYVYrOupi3p9eBQ\n' +
- 'z/oWHCSNQVQSW2/vHp0YwMj2r3jSGdoZ3pcfy4iXOa7xEyeauOn/pHK+syOX\n' +
- 'Pv64DHncql4AJFj9tw4rZ2/kkQARAQABwsB2BBgBCAAqBYJkq9e1CZD2NRrv\n' +
- 'ru2XMgKbDBYhBM1nsbalDm3PtLAK2/Y1Gu+u7ZcyAADapwf/XF6I2NifyL/h\n' +
- '2aVsr2lL2At732336je3WM6QnA/q1x9lmxX646c9eETUQvLLhT5RZmx1X8Fa\n' +
- 'X/qGMKJe+BWLFPy5k6LnOezvvOxHGV+dzRndlWbnC9d3AZhThciw/Rd8V9W6\n' +
- 'd6luo7+Apdd3rS17hG4gElhNX1drq5TuWR89yxA5oXcIqA+u3jBdpz0qo/ME\n' +
- '+63r0AubixdM7rgV0skugaIXvqMKtfMC/V2A8mCL5AmRXCyfMBIsEA0L5YA1\n' +
- 'wsKlHIQAy3jiPdY/2q5KUWJsR9o/IFirjnTd5vywtYsscOq/KnfLKdc2cVOr\n' +
- 'e/vSkTOrD+dVTlxGhADoud4kvcOPtg==\n' +
- '=6H2/\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isSpeaker: true,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAy0lEQVR4AcXBMU5DMRBF0cvI63FJETn7oXY3K3CBNHX2g/WFKKdnLdCOUnyEgnjnPH2+v35RXPagOsbmEZc9qI6xqQwxQ8wQa9w5xuYvHWNzxhAzxAyxxg8ynKrPxZkMp+pzccYQM8QMsZbhVH0uzmQ4j8hwKkPMEDPEWp+LKsOp+lxUGc6ZPhdVhlP1uagMMUPMEGsZzn/KcCpDzBAzxBp3+lxUGU718vzGmVtcqfpcVBlOZYgZYoZY63PxG7ePK4/oc1EZYoaYIfYN05Y0ReqpB6sAAAAASUVORK5CYII='
- }
- ],
- pendingMembers: [
- {
- wallet: 'eip155:0xB026B0A8BB1fea997a73c5a84fe7aF8cAab1AcF2',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA4ElEQVR4AcXBsU0EMRCG0Y+RC3ETzpwheqAFOnBmOZtSNqGC02abOaUAdwLp3AU+IYT+916+Pj6/CXLp/Kc1B5EhZogZYokn1hxEuXR21hxEuXR2DDFDzBBLuXSiNQdRaxeR+2CntYvIfRDl0okMMUPMEEs8cZw37pQbO8fJnUVlxxAzxAyxxINcOtGag7/IpbNjiBlihlh6f30jcq9EuXSiNQc7uXSiNQdRaxeRIWaIGWLJvRK1dhEdJ3dy6fxGaxeReyUyxAwxQyzxwL0SLSpRLp2dNQeRT7YMMUPMEPsB1yM4zt7CMugAAAAASUVORK5CYII='
+ 'wsBzBAEBCAAnBYJkrksbCZA3GHnYNke0AhYhBNp+D95LDfs4yU03LzcYedg2\n' +
+ 'R7QCAACRdAf9ELAnCLXfBiAVdbgwj81xr+w9Yzw2wXLLrPLfYY7EXfyChLzQ\n' +
+ 'rr9XBDdWMgtzEU1diSPMbLDh1METR7n71EjG0AoeX5A2pkHI7R1vIxXUJR3G\n' +
+ 'fzHENsfGaKLnhrL1wLjBQACzEsIqPrHl9RItdtKEs9izLmc+wV0GFJ5OjbAs\n' +
+ 'ty/1Q36nnMB7sQ7Ytb9Op+q0TtZPZ7jF9CjX8KGav3P1xDQex9nfsXiDHlLK\n' +
+ 'MqDePaaMO6RJUWAP2xTo2k1DDJQ2dpUhs9XyjMlvFhVbIcT1/lVRCPC8V3C8\n' +
+ 'fUKhUejvOjNFxf0QuR+E4xs+Q3zvR1+fXdJBxbH2Fp3kOTN1N9/LEw==\n' +
+ '=sLLC\n' +
+ '-----END PGP SIGNATURE-----\n',
+ spaceImage:
+ 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ spaceName: 'statutory_amber_roadrunner',
+ isPublic: true,
+ spaceDescription: 'continued_bronze_pigeon',
+ spaceCreator: 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
+ spaceId:
+ 'spaces:3aa43087b8c55ed9c534dd1d0a086a3340b0d829cda0a13592651cb59f284838',
+ scheduleAt: '2023-07-12T06:51:32.000Z',
+ scheduleEnd: '2023-07-12T07:41:32.000Z',
+ status: 'PENDING',
},
- {
- wallet: 'eip155:0x9b70FD7164ec0Ed3E1B3E318836522340dd2e125',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA0UlEQVR4AcXBMWoDMRRF0ZtnkWYKgddgGKbSVrSILFBbUWUMLrICgwqXQ9L+NDKDIe+cj8+v7x+CPhpRyZV39NGISq5EwkyYCbN0f9z4a2Omj8ZMyZVo2Tei++NGJMyEmTBLz9OVqOTKTMmVIy7nlaiPRiTMhJkwS8u+8Z+WfSMSZsJMmKXLeWWmj0a07Bszz9OVqORKdDmvRMJMmAmzxAslV45ZOUKYCTNhlvpozJRcifpozJRcifpozAgzYSbMEi/00YhKrsz00ThCmAkzYfYLlLsvpsHyBx0AAAAASUVORK5CYII='
+ msg: {
+ fromCAIP10: 'eip155:0x1615d2D9ae82D5F0eE79298899962b237386feB7',
+ toCAIP10: 'eip155:0x1C48fE875590f8e366447758b13982a3Ca7d9dBE',
+ fromDID: 'eip155:0x1615d2D9ae82D5F0eE79298899962b237386feB7',
+ toDID: 'eip155:0x1C48fE875590f8e366447758b13982a3Ca7d9dBE',
+ messageContent: "Gm gm! It's me... Mario",
+ messageType: 'Text',
+ signature:
+ '-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJkWKQWCZB7dzg7q3axjBYhBJFuYslzDGbuE+3FMnt3ODur\n' +
+ 'drGMAAAjtAf/TXjtm2qb6aSikFPKYXm0Ekws+65fisJGf7T48MYkkfcD4t2e\n' +
+ 'HXd9LtohzGhcztbOQfAND3yME1GWuMBIksq9rlyEA0ezwsGzCJVhBnkAHBe3\n' +
+ '+1v4/mNSMmInU8y6sOiLiOcW7ameJvZvDdPDJ0YHhc9dKDCIh1UAZEPAgx+z\n' +
+ 'Wc0DM6pW8bT70dfgnuW2LlLGF5Z23Z1vbHmeszt78+xYY3ez/hoMHXUIE25z\n' +
+ 'Wrnt75nasBBahtJ0mwH10ATnsQNE9hTi6XPGYxRSNDM9nyRxTQUpjhNmGS/+\n' +
+ '7oFyq8xTcRSaL7d3h8URp9hgFWher5ZZDyMV0jvk+HPguUX54g6Kgw==\n' +
+ '=dcRD\n' +
+ '-----END PGP SIGNATURE-----\n',
+ timestamp: 1683530775648,
+ sigType: 'pgp',
+ encType: 'pgp',
+ encryptedSecret:
+ '-----BEGIN PGP MESSAGE-----\n' +
+ '\n' +
+ 'wcBMA9aU+JGZVRn/AQgA1pIJHyeJinU21r6At5S5ZaWeN0OEKVB2TjpqZ0IW\n' +
+ 'lHLKQrQ8k3M16bN+Vf0P+DzDVOL84QRkBD56qSNVHOOCox5wcQeR01CczenV\n' +
+ 'LUVvVjBzR2hj7Sdw+Q+M//rgeZPPUDbNyiVmGijelhwDqWd7IOoZY26AGXlm\n' +
+ '7YQiElvHN2HcYXaTlLAOy36BcccwHu3Tn06F77ZXaf8FnGMWOUy7wh1/jugg\n' +
+ 'D17jUZGLYbmw+u5l9BOfljbw2pb4vtjWht0I1b4GYlKb+bYg/NY0UNsq7mSh\n' +
+ 'dGAmOhy5tC2NMjLRRLfD2qasxHoHN50onlB6HcYLl0RCf31ebOgO6rMhUnxt\n' +
+ '9cHATAMLWLG2xubrYAEH/2tVeq2j7nJALGSFxjJPboOY57aiFrhXNQ/e/oXH\n' +
+ '//TNJgGWx4Ta++OuF2Oexbh9DIZhl6DWld9adXDDtBS/fEyjNsYqwoYlNEJN\n' +
+ 'kLvSmokNNrE4MKC1A0GkhSh2MGQDNk42GSgz1tep8XSVc98MHqfNXCHVb5Oa\n' +
+ 'OBeWKLFyElT3+KuZxSkCsnoO5YjuCGbXPyG06tXMHXMTncpj1ri+vpjUSnhD\n' +
+ 'wn3o0zpNWu0GaWXIgTqj2ZouVwV2S1+wAJQjE8uI1JvBiMhA+X63/GCcApBu\n' +
+ 'C7rN0Cs5NGXCn9VWp8i1SCp2NuZ38POABwsXUUkjpF24txyUDX8dbXlkzpao\n' +
+ 'g93SQAElYYmyKbGp1TKhAZl2u40mgf2yCYDv2DLRfAKMJDLvmjXoUGEg2UYO\n' +
+ '11w6LD0pIykdKJmFtRls/uMnlcoBgDA=\n' +
+ '=kzUH\n' +
+ '-----END PGP MESSAGE-----\n',
+ link: 'bafyreib34jgnpp573rwquejcq5avxvydis7fbykat6dd5z7uazobucoumm',
},
- {
- wallet: 'eip155:0x1A050099a08D7faf3b5923669a0FAe42A0872D72',
- publicKey: null,
- isSpeaker: false,
- image: null
- }
- ],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJkq9e1CZD2NRrvru2XMhYhBM1nsbalDm3PtLAK2/Y1Gu+u\n' +
- '7ZcyAAA0igf/Tgo/WU4C5g4UtHPCwU/jThQwjElzCa96bZU8bCXsgnoO1NMI\n' +
- 'fwI7FxIw8FmFrktHIWT10T/9vq2ItyUvpbWRhnD5zt5aRhJ1KA1z06iwkoUt\n' +
- 'DLiPfveoSDyIhUIjx5PUMN0r/tXmLhj3CrkHx1hiPBxEkhi9brfFcOvX57HS\n' +
- 'VOKOeeUa4G1cmk6dtzLHWT4p7ekrFhZPHXDtZUMZEU2wbMkB6bRqlZ7UYLbN\n' +
- '7+0AvCu7uaCYG0zfbl3oZc6DkIm9jnBknsII6Hqv7Dc9NLAUBWo8tPrW2/KN\n' +
- '8Bv/gk5HPb16tOihIUjs8v45wO3oTPAQYbJGdF6ta+HyiKO8JWipbw==\n' +
- '=wkHz\n' +
- '-----END PGP SIGNATURE-----\n' +
- ':null',
- spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- spaceName: 'mobile_aquamarine_constrictor',
- isPublic: true,
- spaceDescription: 'conventional_crimson_dove',
- spaceCreator: 'eip155:0x367c6555b2CAD9C2d2656066EC3996Ba12cD058d',
- spaceId: 'spaces:108f766a5053e2b985d0843e806f741da5ad754d128aff0710e526eebc127afc',
- scheduleAt: '2023-07-15T14:48:00.000Z',
- scheduleEnd: '2023-07-15T15:48:00.000Z',
- status: 'PENDING',
- rules: {
- 'spaceAccess': {
- 'conditions': [
- {
- 'any': [
- {
- 'type': 'PUSH',
- 'category': 'ERC20',
- 'subcategory': 'token_holder',
- 'data': {
- 'address': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
- 'amount': 1000,
- 'decimals': 18
- }
- },
- {
- 'type': 'GUILD',
- 'category': 'guildRoles',
- 'subcategory': 'specificRole',
- 'data': {
- 'guildId': '13468',
- 'guildRoleId': '19924'
- }
- },
- {
- 'type': 'PUSH',
- 'category': 'ERC721',
- 'subcategory': 'nft_owner',
- 'data': {
- 'address': 'eip155:5:0x42af3147f17239341477113484752D5D3dda997B',
- 'amount': 1
- }
- }
- ]
- }
- ]
- }
- }
-}
+ },
+];
```
+| Parameter | Type | Description |
+| ---------------- | -------------- | ------------------------------------------------------------------ |
+| msg | `IMessageIPFS` | message object |
+| did | `string` | user DID |
+| wallets | `string` | user wallets |
+| profilePicture | `string` | user profile picture |
+| publicKey | `string` | user public key |
+| about | `string` | user description |
+| threadhash | `string` | cid from the latest message sent on this conversation |
+| intent | `string` | addresses concatenated from the users who have approved the intent |
+| intentSentBy | `string` | address of the user who sent the intent |
+| intentTimestamp | `number` | timestamp of the intent |
+| combinedDID | `string` | concatenated addresses of the members of this space |
+| cid | `string` | content identifier on IPFS |
+| spaceId | `string` | space identifier |
+| spaceInformation | `SpaceDTO` | all space information |
+
---
-### **To get space details by spaceId**
+### **Fetching list of user space requests**
```typescript
-const response = await PushAPI.space.get({
- spaceId:
- 'spaces:108f766a5053e2b985d0843e806f741da5ad754d128aff0710e526eebc127afc',
- env: 'staging',
+const spaces = await PushAPI.space.requests({
+ account: string;
+ pgpPrivateKey?: string;
+ /**
+ * If true, the method will return decrypted message content in response
+ */
+ toDecrypt?: boolean;
+ /**
+ * Environment variable
+ */
+ env?: ENV;
});
```
-Allowed Options (params with _ are mandatory)
-| Param | Type | Default | Remarks |
-|----------|---------|---------|--------------------------------------------|
-| spaceId_ | string | - | space id |
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+| Param | Type | Default | Remarks |
+| ------------- | ------- | ------- | ---------------------------------------------------------------------- |
+| account | string | - | user address (Partial CAIP) |
+| toDecrypt | boolean | false | if "true" the method will return decrypted message content in response |
+| pgpPrivateKey | string | null | mandatory for users having pgp keys |
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev' |
-
- Expected response (get space by space id)
+**Example normal user:**
```typescript
-// PushAPI_space_get | Response - 200 OK
-{
- members: [
- {
- wallet: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGSr528BCADI8kQcWkaw9PKmSrwCtPBDWj+wzPhmok9jAzxzb2+qAjSV\n' +
- 'rYdIrnx6PAp1rMU6qoVg4cdDbCYPV+kCj8l3lUzH/a/SfPsDWpspA/ICWMeS\n' +
- 'dMdGYxHLk2gsu0wRz69qoddXMY1h5eMZEyRnr2fsX/cy15mxO2IEHYnC2/rp\n' +
- '06iFpx1T8k5HWgFDpyleWyMSQ7Bnn7GutrlHYEVtIGVfXDSkea8IDLLkzBEV\n' +
- '3jlBUFhpsrlcvDwDYcMYOrqSBEtg1a+GMK+2Ye/hF37KUYTAPleKXeN0cYIs\n' +
- 'Va8oleZK960XYfuy5SYCJav2kaAggNWQBie5G9C4H3h7FuFwWk8LH3DhABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZKvnbwQLCQcICZBm9Bz6DvB6DwMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBPkdSvwnOBuAJaOWAGb0HPoO8HoPAAAkiQgAukm3owebckwr\n' +
- 'xAR42r/+CBx1uoqM2ZeEAUeYtBF7sdLEsdxFrxl8wHKAbglZwtgWcfG95v2R\n' +
- 'zLcBco3v9p0IuS6DZduIfhngZ49gpYwqFGyiCOvo+k14tuMbrbOZTTKp0uc6\n' +
- 'icpTyP8/1U0nZrQmmSXyfh6Hgmx1OnW3zTM7oUN1ZVvj3V6rOl+ktUPjAaYo\n' +
- 'CWJjth92xhDWEPZnC/4Gz2eRoTVtmx8u+/2vNPffQVgzzHznUxB+G5XeZmPk\n' +
- 'z8oxxSxII8PNiAs5LizqPjyq2gEv25GlCsMXTYz60n/t/4G7Yc94yu8xD8u3\n' +
- 'BpWluHC2eW0pYFcDfiNLfv0uJCrUcM7ATQRkq+dvAQgA7v7Zz4CZdPsd4jvB\n' +
- 'uDwjop/Gvoz+rbvAdS3Xrsi+OTyrWAqidnXChhwExlUNelZ9v52lGxe1twwr\n' +
- 'vxeQ4M0pv4oqSlZxhkqBCyj+E7ECR2WXG7ccLlzYOz3b5BXT+fEkmVsbVTjA\n' +
- 'Kttjosm7FtY4igY2Hu4UlZZW8M1tYL1R/UegFeMYGY7aO7dcKeiP0NsDwm3c\n' +
- '0SiU6/JlOXAIi/ZSKDJ4b5BPK6GFj5pNWr92/V7LejlZfoHAVDbb91tiPGdP\n' +
- 'y3+r9T3IYsgUDLgOpPQn6o82Nctm6CnIZqAN12nJ1DEJP2JyLDedg9b5H+aa\n' +
- 'FDZFc7yQ3In/QPtjHImydLt9NwARAQABwsB2BBgBCAAqBYJkq+dvCZBm9Bz6\n' +
- 'DvB6DwKbDBYhBPkdSvwnOBuAJaOWAGb0HPoO8HoPAABRUQf+KoF4UXuseLBO\n' +
- 'd0PD0+hEcnsYbaPWmPZtJPWusxPl6kt421luymPiThDXwaMVzRrmxkz0dNZ3\n' +
- 'bUFYtS24t2BhlXZ6cGFNRjXrA9OV0kLg/kNm1vboQ1GL8qRV9CIjPVEpksQp\n' +
- 'tOiYN+X+/2XdPJkaQpITHIFV067qWQSAKIonvOI8OJYOovGRQTInz0VE71Yn\n' +
- 'SeiOilKBK+p2RN38jGr0PGWt740KJ6560FzfUwTAQzz9vrkYa+vEhWe+bzOd\n' +
- 'YBpxj/BRTGR19DrKlGcFPdTYz5ADxCjBuCxXgoRCbBiWwh+iIstk5qkT8uHK\n' +
- 'NQjzDvo3RO1cROQp0zsikladmzGZHQ==\n' +
- '=q/e/\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isSpeaker: true,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA10lEQVR4AcXBsWnFMBSG0c8/brOD9kgfogHUGQIuAppInSsVAQ2gdbSD64fTXl4hMI/HPWf5fXxf3DDaxkxIlTuEM+FMOFt5MtqG1XvBipGpsp9YMWaskCqWcCacCWfL4+fzwogx8069FyzhTDgTzpavv3oxEVLlFaNtzAhnwplwtvIkpIpV9hMrxsxM7wUrHxVrtA1LOBPOhLM1pIo12oaVj4rV98JMPj6wRtuwQqpYwplwJpyt3BRjZiZQuUM4E86Es7XsJ1aMTIVUeUXZTyzhTDgTzv4BnGY033BWusUAAAAASUVORK5CYII='
- }
- ],
- pendingMembers: [
- {
- wallet: 'eip155:0xaC6C69c657cF6022fa787B14BDdaA22936B56D65',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA2UlEQVR4AcXBQWoEIRBA0Z+ikOwNDHirbARPKDiLvkzOIATaC4iQbGt6ITSzqPc+np8/fxhpVazzcfCOr99vrK4FS3AmOBOcKRddCy9GwQoxszNHw+rKluBMcCY407QqO10L1hyNO9Kq7AjOBGeCMz0fB9YcjZ20KjtdC1bXghVixhKcCc4EZzpH446uhXfM0bAEZ4IzwZmGmLHmaOyEmNmZo7ETYsYSnAnOBGfKRVoVq2vBmqNxR1oV6+SV4ExwJjhTLroWdkLM7MzRsLoWrMCBJTgTnAnO/gGd1jrTKk/8EAAAAABJRU5ErkJggg=='
- },
- {
- wallet: 'eip155:0xEf532414907E8c631307c0d501cDe6D1694bAF5e',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA00lEQVR4AcXBobHDMBBF0ZsdjftIDeGuIkzIaGsQC1MNQkZirsLcnaQCk3yqBOzMH4N3zu11f38I+GPiinacRAwxQ8wQS/zo1flSGqNenUgujVGvziiXxsgQM8QMscSPXBqjXp1RLo1Ir84ol0bEEDPEDLHkj4lI51uvzn/4YyJiiBlihlhqx0lkZ2U0Pxci+7YyasdJxBAzxAyx1KsT8W3lil6diCFmiBlit9f9/SHQq3NFLo2IIWaIGWKpVyeybyuj+bkQ2beV0VwXIoaYIWaI/QH8GTSs76EUEQAAAABJRU5ErkJggg=='
- },
- {
- wallet: 'eip155:0x2F5f27B523C8888eA79b7FA80a9CbA6b6980784c',
- publicKey: null,
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA0klEQVR4AcXBsW3DQAxA0W9CExjIDhogfboDCw9gICvcHmldcIAMoYLgJJ5CKzgto4KA4ILvXT5+Pl8kwydZqJHt60bl+ryRDZ9koUYmNBOaCc0u31+/L04INSrDJ2cIzYRmQrMl1Dhj+KQSapwhNBOaCc0WDvZ1o+ROZV83KtfnjUxoJjQTmi0c3B/OO+4PpxLKP0IzoZnQbBk+yUKNyvBJJdSoDJ9kQjOhmdBsCTWy4ZNKqFEZPqmEGpnQTGgmNFs4CDWy4ZN3hBoVoZnQTGj2BxvbMvuaMCXUAAAAAElFTkSuQmCC'
- }
- ],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJkq+dvCZBm9Bz6DvB6DxYhBPkdSvwnOBuAJaOWAGb0HPoO\n' +
- '8HoPAAD5ywf/cvaGM0DzcB22Q2FMzUZG4/ZmkN4OknvSj0d4hB/sPUIb9176\n' +
- 'z+niFMjWZNFpIj8s36f16oMEZZ+Eleu9t6sECBxRDvO8pEwyByCXSmz8e/SH\n' +
- 'Y659cvg5/A3bSe0FqR0VTI1o+Uz2BpnXG/P38C6D46btaIaJcr4cIh88wQ9J\n' +
- 'lr05hOE7w/7Uo5OwyXala0NfB+8S4LIfpC2OlPOhyHQEJd2+WoFKb/6dO28D\n' +
- 'TLuvgYJXJfc4R3ElcgFfm1N9ylG0Pt1F3c0C/k9bNokR2PVXgX2XSTQsx1rD\n' +
- 'MCY/ePr93INyNZuTPcPlK87X6OTa2/gEW161vup2Xn2Did9HtL76Qw==\n' +
- '=EkOP\n' +
- '-----END PGP SIGNATURE-----\n' +
- ':null',
- spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- spaceName: 'intellectual_green_bat',
- isPublic: true,
- spaceDescription: 'sad_purple_pinniped',
- spaceCreator: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
- spaceId: 'spaces:9dab226c7920fe06154d76f78dfe1187bdc4fda712cdd9a8b37cc6a99741a63b',
- scheduleAt: '2023-07-15T14:48:00.000Z',
- scheduleEnd: '2023-07-15T15:48:00.000Z',
- status: 'PENDING'
-}
-```
+// pre-requisite API calls that should be made before
+// need to get user and through that encryptedPvtKey of the user
+const user = await PushAPI.user.get({
+ account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7',
+ env: ENV.STAGING,
+})
-
+// need to decrypt the encryptedPvtKey to pass in the api using helper function
+const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: signer);
----
+// actual api
+const spaces = await PushAPI.space.requests({
+ account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7',
+ toDecrypt: true,
+ pgpPrivateKey: pgpDecryptedPvtKey,
+ env: ENV.STAGING,
+});
+```
-### **To start a space**
+**Example NFT user:**
```typescript
-const response = await PushAPI.space.start({
- spaceId:
- 'spaces:108f766a5053e2b985d0843e806f741da5ad754d128aff0710e526eebc127afc',
- env: 'staging',
+// Fetch user
+const user = await PushAPI.user.get({
+ account: `nft:eip155:${nftChainId}:${nftContractAddress}:${nftTokenId}`,
+ env: env as ENV,
});
-```
-Allowed Options (params with _ are mandatory)
-| Param | Type | Default | Remarks |
-|----------|---------|---------|--------------------------------------------|
-| spaceId_ | string | - | space id |
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+// Decrypt PGP Key
+const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({
+ encryptedPGPPrivateKey: user.encryptedPrivateKey,
+ signer: nftSigner,
+});
+
+// Actual api
+const spaces = await PushAPI.space.requests({
+ account: `nft:eip155:${nftChainId}:${nftContractAddress}:${nftTokenId}`,
+ toDecrypt: true,
+ pgpPrivateKey: pgpDecrpyptedPvtKey,
+ env: env as ENV,
+});
+```
- Expected response (start space by space id)
+ Expected response (Get spaces requests of a specific user)
```typescript
-// PushAPI_space_start | Response - 200 OK
-{
- members: [
- {
- wallet: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+// PushAPI_space_requests | Response - 200 OK
+// Array of spaces
+[
+ {
+ spaceId:
+ 'spaces:3aa43087b8c55ed9c534dd1d0a086a3340b0d829cda0a13592651cb59f284838',
+ about: null,
+ did: null,
+ intent:
+ 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A+eip155:0xF8aBe92d1d0706bF60509F8E9A64Ed6b8520E868',
+ intentSentBy: 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
+ intentTimestamp: '2023-07-12T01:11:32.000Z',
+ publicKey: null,
+ profilePicture: null,
+ threadhash: null,
+ wallets: null,
+ combinedDID:
+ 'eip155:0x12E429E3672a02E385F9f5F75E932cC1D566EEea_eip155:0x49D407CC9D0e966CD9B22BA40685083B49bd2315_eip155:0xF8aBe92d1d0706bF60509F8E9A64Ed6b8520E868_eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
+ name: null,
+ spaceInformation: {
+ members: [Array],
+ pendingMembers: [Array],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof:
+ 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
'\n' +
- 'xsBNBGSr528BCADI8kQcWkaw9PKmSrwCtPBDWj+wzPhmok9jAzxzb2+qAjSV\n' +
- 'rYdIrnx6PAp1rMU6qoVg4cdDbCYPV+kCj8l3lUzH/a/SfPsDWpspA/ICWMeS\n' +
- 'dMdGYxHLk2gsu0wRz69qoddXMY1h5eMZEyRnr2fsX/cy15mxO2IEHYnC2/rp\n' +
- '06iFpx1T8k5HWgFDpyleWyMSQ7Bnn7GutrlHYEVtIGVfXDSkea8IDLLkzBEV\n' +
- '3jlBUFhpsrlcvDwDYcMYOrqSBEtg1a+GMK+2Ye/hF37KUYTAPleKXeN0cYIs\n' +
- 'Va8oleZK960XYfuy5SYCJav2kaAggNWQBie5G9C4H3h7FuFwWk8LH3DhABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZKvnbwQLCQcICZBm9Bz6DvB6DwMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBPkdSvwnOBuAJaOWAGb0HPoO8HoPAAAkiQgAukm3owebckwr\n' +
- 'xAR42r/+CBx1uoqM2ZeEAUeYtBF7sdLEsdxFrxl8wHKAbglZwtgWcfG95v2R\n' +
- 'zLcBco3v9p0IuS6DZduIfhngZ49gpYwqFGyiCOvo+k14tuMbrbOZTTKp0uc6\n' +
- 'icpTyP8/1U0nZrQmmSXyfh6Hgmx1OnW3zTM7oUN1ZVvj3V6rOl+ktUPjAaYo\n' +
- 'CWJjth92xhDWEPZnC/4Gz2eRoTVtmx8u+/2vNPffQVgzzHznUxB+G5XeZmPk\n' +
- 'z8oxxSxII8PNiAs5LizqPjyq2gEv25GlCsMXTYz60n/t/4G7Yc94yu8xD8u3\n' +
- 'BpWluHC2eW0pYFcDfiNLfv0uJCrUcM7ATQRkq+dvAQgA7v7Zz4CZdPsd4jvB\n' +
- 'uDwjop/Gvoz+rbvAdS3Xrsi+OTyrWAqidnXChhwExlUNelZ9v52lGxe1twwr\n' +
- 'vxeQ4M0pv4oqSlZxhkqBCyj+E7ECR2WXG7ccLlzYOz3b5BXT+fEkmVsbVTjA\n' +
- 'Kttjosm7FtY4igY2Hu4UlZZW8M1tYL1R/UegFeMYGY7aO7dcKeiP0NsDwm3c\n' +
- '0SiU6/JlOXAIi/ZSKDJ4b5BPK6GFj5pNWr92/V7LejlZfoHAVDbb91tiPGdP\n' +
- 'y3+r9T3IYsgUDLgOpPQn6o82Nctm6CnIZqAN12nJ1DEJP2JyLDedg9b5H+aa\n' +
- 'FDZFc7yQ3In/QPtjHImydLt9NwARAQABwsB2BBgBCAAqBYJkq+dvCZBm9Bz6\n' +
- 'DvB6DwKbDBYhBPkdSvwnOBuAJaOWAGb0HPoO8HoPAABRUQf+KoF4UXuseLBO\n' +
- 'd0PD0+hEcnsYbaPWmPZtJPWusxPl6kt421luymPiThDXwaMVzRrmxkz0dNZ3\n' +
- 'bUFYtS24t2BhlXZ6cGFNRjXrA9OV0kLg/kNm1vboQ1GL8qRV9CIjPVEpksQp\n' +
- 'tOiYN+X+/2XdPJkaQpITHIFV067qWQSAKIonvOI8OJYOovGRQTInz0VE71Yn\n' +
- 'SeiOilKBK+p2RN38jGr0PGWt740KJ6560FzfUwTAQzz9vrkYa+vEhWe+bzOd\n' +
- 'YBpxj/BRTGR19DrKlGcFPdTYz5ADxCjBuCxXgoRCbBiWwh+iIstk5qkT8uHK\n' +
- 'NQjzDvo3RO1cROQp0zsikladmzGZHQ==\n' +
- '=q/e/\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isSpeaker: true,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA10lEQVR4AcXBsWnFMBSG0c8/brOD9kgfogHUGQIuAppInSsVAQ2gdbSD64fTXl4hMI/HPWf5fXxf3DDaxkxIlTuEM+FMOFt5MtqG1XvBipGpsp9YMWaskCqWcCacCWfL4+fzwogx8069FyzhTDgTzpavv3oxEVLlFaNtzAhnwplwtvIkpIpV9hMrxsxM7wUrHxVrtA1LOBPOhLM1pIo12oaVj4rV98JMPj6wRtuwQqpYwplwJpyt3BRjZiZQuUM4E86Es7XsJ1aMTIVUeUXZTyzhTDgTzv4BnGY033BWusUAAAAASUVORK5CYII='
- }
- ],
- pendingMembers: [
- {
- wallet: 'eip155:0xaC6C69c657cF6022fa787B14BDdaA22936B56D65',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA2UlEQVR4AcXBQWoEIRBA0Z+ikOwNDHirbARPKDiLvkzOIATaC4iQbGt6ITSzqPc+np8/fxhpVazzcfCOr99vrK4FS3AmOBOcKRddCy9GwQoxszNHw+rKluBMcCY407QqO10L1hyNO9Kq7AjOBGeCMz0fB9YcjZ20KjtdC1bXghVixhKcCc4EZzpH446uhXfM0bAEZ4IzwZmGmLHmaOyEmNmZo7ETYsYSnAnOBGfKRVoVq2vBmqNxR1oV6+SV4ExwJjhTLroWdkLM7MzRsLoWrMCBJTgTnAnO/gGd1jrTKk/8EAAAAABJRU5ErkJggg=='
+ 'wsBzBAEBCAAnBYJkrksbCZA3GHnYNke0AhYhBNp+D95LDfs4yU03LzcYedg2\n' +
+ 'R7QCAACRdAf9ELAnCLXfBiAVdbgwj81xr+w9Yzw2wXLLrPLfYY7EXfyChLzQ\n' +
+ 'rr9XBDdWMgtzEU1diSPMbLDh1METR7n71EjG0AoeX5A2pkHI7R1vIxXUJR3G\n' +
+ 'fzHENsfGaKLnhrL1wLjBQACzEsIqPrHl9RItdtKEs9izLmc+wV0GFJ5OjbAs\n' +
+ 'ty/1Q36nnMB7sQ7Ytb9Op+q0TtZPZ7jF9CjX8KGav3P1xDQex9nfsXiDHlLK\n' +
+ 'MqDePaaMO6RJUWAP2xTo2k1DDJQ2dpUhs9XyjMlvFhVbIcT1/lVRCPC8V3C8\n' +
+ 'fUKhUejvOjNFxf0QuR+E4xs+Q3zvR1+fXdJBxbH2Fp3kOTN1N9/LEw==\n' +
+ '=sLLC\n' +
+ '-----END PGP SIGNATURE-----\n',
+ spaceImage:
+ 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ spaceName: 'statutory_amber_roadrunner',
+ isPublic: true,
+ spaceDescription: 'continued_bronze_pigeon',
+ spaceCreator: 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
+ spaceId:
+ 'spaces:3aa43087b8c55ed9c534dd1d0a086a3340b0d829cda0a13592651cb59f284838',
+ scheduleAt: '2023-07-12T06:51:32.000Z',
+ scheduleEnd: '2023-07-12T07:41:32.000Z',
+ status: 'PENDING',
},
- {
- wallet: 'eip155:0xEf532414907E8c631307c0d501cDe6D1694bAF5e',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA00lEQVR4AcXBobHDMBBF0ZsdjftIDeGuIkzIaGsQC1MNQkZirsLcnaQCk3yqBOzMH4N3zu11f38I+GPiinacRAwxQ8wQS/zo1flSGqNenUgujVGvziiXxsgQM8QMscSPXBqjXp1RLo1Ir84ol0bEEDPEDLHkj4lI51uvzn/4YyJiiBlihlhqx0lkZ2U0Pxci+7YyasdJxBAzxAyx1KsT8W3lil6diCFmiBlit9f9/SHQq3NFLo2IIWaIGWKpVyeybyuj+bkQ2beV0VwXIoaYIWaI/QH8GTSs76EUEQAAAABJRU5ErkJggg=='
+ msg: {
+ fromCAIP10: 'eip155:0x1615d2D9ae82D5F0eE79298899962b237386feB7',
+ toCAIP10: 'eip155:0x1C48fE875590f8e366447758b13982a3Ca7d9dBE',
+ fromDID: 'eip155:0x1615d2D9ae82D5F0eE79298899962b237386feB7',
+ toDID: 'eip155:0x1C48fE875590f8e366447758b13982a3Ca7d9dBE',
+ messageContent: "Gm gm! It's me... Mario",
+ messageType: 'Text',
+ signature:
+ '-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJkWKQWCZB7dzg7q3axjBYhBJFuYslzDGbuE+3FMnt3ODur\n' +
+ 'drGMAAAjtAf/TXjtm2qb6aSikFPKYXm0Ekws+65fisJGf7T48MYkkfcD4t2e\n' +
+ 'HXd9LtohzGhcztbOQfAND3yME1GWuMBIksq9rlyEA0ezwsGzCJVhBnkAHBe3\n' +
+ '+1v4/mNSMmInU8y6sOiLiOcW7ameJvZvDdPDJ0YHhc9dKDCIh1UAZEPAgx+z\n' +
+ 'Wc0DM6pW8bT70dfgnuW2LlLGF5Z23Z1vbHmeszt78+xYY3ez/hoMHXUIE25z\n' +
+ 'Wrnt75nasBBahtJ0mwH10ATnsQNE9hTi6XPGYxRSNDM9nyRxTQUpjhNmGS/+\n' +
+ '7oFyq8xTcRSaL7d3h8URp9hgFWher5ZZDyMV0jvk+HPguUX54g6Kgw==\n' +
+ '=dcRD\n' +
+ '-----END PGP SIGNATURE-----\n',
+ timestamp: 1683530775648,
+ sigType: 'pgp',
+ encType: 'pgp',
+ encryptedSecret:
+ '-----BEGIN PGP MESSAGE-----\n' +
+ '\n' +
+ 'wcBMA9aU+JGZVRn/AQgA1pIJHyeJinU21r6At5S5ZaWeN0OEKVB2TjpqZ0IW\n' +
+ 'lHLKQrQ8k3M16bN+Vf0P+DzDVOL84QRkBD56qSNVHOOCox5wcQeR01CczenV\n' +
+ 'LUVvVjBzR2hj7Sdw+Q+M//rgeZPPUDbNyiVmGijelhwDqWd7IOoZY26AGXlm\n' +
+ '7YQiElvHN2HcYXaTlLAOy36BcccwHu3Tn06F77ZXaf8FnGMWOUy7wh1/jugg\n' +
+ 'D17jUZGLYbmw+u5l9BOfljbw2pb4vtjWht0I1b4GYlKb+bYg/NY0UNsq7mSh\n' +
+ 'dGAmOhy5tC2NMjLRRLfD2qasxHoHN50onlB6HcYLl0RCf31ebOgO6rMhUnxt\n' +
+ '9cHATAMLWLG2xubrYAEH/2tVeq2j7nJALGSFxjJPboOY57aiFrhXNQ/e/oXH\n' +
+ '//TNJgGWx4Ta++OuF2Oexbh9DIZhl6DWld9adXDDtBS/fEyjNsYqwoYlNEJN\n' +
+ 'kLvSmokNNrE4MKC1A0GkhSh2MGQDNk42GSgz1tep8XSVc98MHqfNXCHVb5Oa\n' +
+ 'OBeWKLFyElT3+KuZxSkCsnoO5YjuCGbXPyG06tXMHXMTncpj1ri+vpjUSnhD\n' +
+ 'wn3o0zpNWu0GaWXIgTqj2ZouVwV2S1+wAJQjE8uI1JvBiMhA+X63/GCcApBu\n' +
+ 'C7rN0Cs5NGXCn9VWp8i1SCp2NuZ38POABwsXUUkjpF24txyUDX8dbXlkzpao\n' +
+ 'g93SQAElYYmyKbGp1TKhAZl2u40mgf2yCYDv2DLRfAKMJDLvmjXoUGEg2UYO\n' +
+ '11w6LD0pIykdKJmFtRls/uMnlcoBgDA=\n' +
+ '=kzUH\n' +
+ '-----END PGP MESSAGE-----\n',
+ link: 'bafyreib34jgnpp573rwquejcq5avxvydis7fbykat6dd5z7uazobucoumm',
},
- {
- wallet: 'eip155:0x2F5f27B523C8888eA79b7FA80a9CbA6b6980784c',
- publicKey: null,
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA0klEQVR4AcXBsW3DQAxA0W9CExjIDhogfboDCw9gICvcHmldcIAMoYLgJJ5CKzgto4KA4ILvXT5+Pl8kwydZqJHt60bl+ryRDZ9koUYmNBOaCc0u31+/L04INSrDJ2cIzYRmQrMl1Dhj+KQSapwhNBOaCc0WDvZ1o+ROZV83KtfnjUxoJjQTmi0c3B/OO+4PpxLKP0IzoZnQbBk+yUKNyvBJJdSoDJ9kQjOhmdBsCTWy4ZNKqFEZPqmEGpnQTGgmNFs4CDWy4ZN3hBoVoZnQTGj2BxvbMvuaMCXUAAAAAElFTkSuQmCC'
- }
- ],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJkq+dvCZBm9Bz6DvB6DxYhBPkdSvwnOBuAJaOWAGb0HPoO\n' +
- '8HoPAAD5ywf/cvaGM0DzcB22Q2FMzUZG4/ZmkN4OknvSj0d4hB/sPUIb9176\n' +
- 'z+niFMjWZNFpIj8s36f16oMEZZ+Eleu9t6sECBxRDvO8pEwyByCXSmz8e/SH\n' +
- 'Y659cvg5/A3bSe0FqR0VTI1o+Uz2BpnXG/P38C6D46btaIaJcr4cIh88wQ9J\n' +
- 'lr05hOE7w/7Uo5OwyXala0NfB+8S4LIfpC2OlPOhyHQEJd2+WoFKb/6dO28D\n' +
- 'TLuvgYJXJfc4R3ElcgFfm1N9ylG0Pt1F3c0C/k9bNokR2PVXgX2XSTQsx1rD\n' +
- 'MCY/ePr93INyNZuTPcPlK87X6OTa2/gEW161vup2Xn2Did9HtL76Qw==\n' +
- '=EkOP\n' +
- '-----END PGP SIGNATURE-----\n' +
- ':null',
- spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- spaceName: 'intellectual_green_bat',
- isPublic: true,
- spaceDescription: 'sad_purple_pinniped',
- spaceCreator: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
- spaceId: 'spaces:9dab226c7920fe06154d76f78dfe1187bdc4fda712cdd9a8b37cc6a99741a63b',
- scheduleAt: '2023-07-15T14:48:00.000Z',
- scheduleEnd: '2023-07-15T15:48:00.000Z',
- status: 'ACTIVE'
-}
+ },
+];
```
+| Parameter | Type | Description |
+| ---------------- | -------------- | ------------------------------------------------------------------ |
+| msg | `IMessageIPFS` | message object |
+| did | `string` | user DID |
+| wallets | `string` | user wallets |
+| profilePicture | `string` | user profile picture |
+| publicKey | `string` | user public key |
+| about | `string` | user description |
+| threadhash | `string` | cid from the latest message sent on this conversation |
+| intent | `string` | addresses concatenated from the users who have approved the intent |
+| intentSentBy | `string` | address of the user who sent the intent |
+| intentTimestamp | `number` | timestamp of the intent |
+| combinedDID | `string` | concatenated addresses of the members of this space |
+| cid | `string` | content identifier on IPFS |
+| spaceId | `string` | space identifier |
+| spaceInformation | `SpaceDTO` | all space information |
+
---
-### **To stop a space**
+### **Fetching list of trending spaces**
```typescript
-const response = await PushAPI.space.stop({
- spaceId:
- 'spaces:108f766a5053e2b985d0843e806f741da5ad754d128aff0710e526eebc127afc',
- env: 'staging',
+const spaces = await PushAPI.space.trending({
+ env?: ENV;
});
```
-Allowed Options (params with _ are mandatory)
-| Param | Type | Default | Remarks |
-|----------|---------|---------|--------------------------------------------|
-| spaceId_ | string | - | space id |
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+| Param | Type | Default | Remarks |
+| ----- | ------ | ------- | ---------------------------------- |
+| env | string | 'prod' | API env - 'prod', 'staging', 'dev' |
+| page | number | 1 | page index of the results |
+| limit | number | 10 | number of items in 1 page |
- Expected response (stop space by space id)
+
+ Expected response (Get trending spaces)
```typescript
-// PushAPI_space_stop | Response - 200 OK
-{
- members: [
- {
- wallet: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+// PushAPI_space_trending | Response - 200 OK
+// Array of spaces
+[
+ {
+ spaceId:
+ 'spaces:3aa43087b8c55ed9c534dd1d0a086a3340b0d829cda0a13592651cb59f284838',
+ about: null,
+ did: null,
+ intent:
+ 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A+eip155:0xF8aBe92d1d0706bF60509F8E9A64Ed6b8520E868',
+ intentSentBy: 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
+ intentTimestamp: '2023-07-12T01:11:32.000Z',
+ publicKey: null,
+ profilePicture: null,
+ threadhash: null,
+ wallets: null,
+ combinedDID:
+ 'eip155:0x12E429E3672a02E385F9f5F75E932cC1D566EEea_eip155:0x49D407CC9D0e966CD9B22BA40685083B49bd2315_eip155:0xF8aBe92d1d0706bF60509F8E9A64Ed6b8520E868_eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
+ name: null,
+ spaceInformation: {
+ members: [Array],
+ pendingMembers: [Array],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof:
+ 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
'\n' +
- 'xsBNBGSr528BCADI8kQcWkaw9PKmSrwCtPBDWj+wzPhmok9jAzxzb2+qAjSV\n' +
- 'rYdIrnx6PAp1rMU6qoVg4cdDbCYPV+kCj8l3lUzH/a/SfPsDWpspA/ICWMeS\n' +
- 'dMdGYxHLk2gsu0wRz69qoddXMY1h5eMZEyRnr2fsX/cy15mxO2IEHYnC2/rp\n' +
- '06iFpx1T8k5HWgFDpyleWyMSQ7Bnn7GutrlHYEVtIGVfXDSkea8IDLLkzBEV\n' +
- '3jlBUFhpsrlcvDwDYcMYOrqSBEtg1a+GMK+2Ye/hF37KUYTAPleKXeN0cYIs\n' +
- 'Va8oleZK960XYfuy5SYCJav2kaAggNWQBie5G9C4H3h7FuFwWk8LH3DhABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZKvnbwQLCQcICZBm9Bz6DvB6DwMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBPkdSvwnOBuAJaOWAGb0HPoO8HoPAAAkiQgAukm3owebckwr\n' +
- 'xAR42r/+CBx1uoqM2ZeEAUeYtBF7sdLEsdxFrxl8wHKAbglZwtgWcfG95v2R\n' +
- 'zLcBco3v9p0IuS6DZduIfhngZ49gpYwqFGyiCOvo+k14tuMbrbOZTTKp0uc6\n' +
- 'icpTyP8/1U0nZrQmmSXyfh6Hgmx1OnW3zTM7oUN1ZVvj3V6rOl+ktUPjAaYo\n' +
- 'CWJjth92xhDWEPZnC/4Gz2eRoTVtmx8u+/2vNPffQVgzzHznUxB+G5XeZmPk\n' +
- 'z8oxxSxII8PNiAs5LizqPjyq2gEv25GlCsMXTYz60n/t/4G7Yc94yu8xD8u3\n' +
- 'BpWluHC2eW0pYFcDfiNLfv0uJCrUcM7ATQRkq+dvAQgA7v7Zz4CZdPsd4jvB\n' +
- 'uDwjop/Gvoz+rbvAdS3Xrsi+OTyrWAqidnXChhwExlUNelZ9v52lGxe1twwr\n' +
- 'vxeQ4M0pv4oqSlZxhkqBCyj+E7ECR2WXG7ccLlzYOz3b5BXT+fEkmVsbVTjA\n' +
- 'Kttjosm7FtY4igY2Hu4UlZZW8M1tYL1R/UegFeMYGY7aO7dcKeiP0NsDwm3c\n' +
- '0SiU6/JlOXAIi/ZSKDJ4b5BPK6GFj5pNWr92/V7LejlZfoHAVDbb91tiPGdP\n' +
- 'y3+r9T3IYsgUDLgOpPQn6o82Nctm6CnIZqAN12nJ1DEJP2JyLDedg9b5H+aa\n' +
- 'FDZFc7yQ3In/QPtjHImydLt9NwARAQABwsB2BBgBCAAqBYJkq+dvCZBm9Bz6\n' +
- 'DvB6DwKbDBYhBPkdSvwnOBuAJaOWAGb0HPoO8HoPAABRUQf+KoF4UXuseLBO\n' +
- 'd0PD0+hEcnsYbaPWmPZtJPWusxPl6kt421luymPiThDXwaMVzRrmxkz0dNZ3\n' +
- 'bUFYtS24t2BhlXZ6cGFNRjXrA9OV0kLg/kNm1vboQ1GL8qRV9CIjPVEpksQp\n' +
- 'tOiYN+X+/2XdPJkaQpITHIFV067qWQSAKIonvOI8OJYOovGRQTInz0VE71Yn\n' +
- 'SeiOilKBK+p2RN38jGr0PGWt740KJ6560FzfUwTAQzz9vrkYa+vEhWe+bzOd\n' +
- 'YBpxj/BRTGR19DrKlGcFPdTYz5ADxCjBuCxXgoRCbBiWwh+iIstk5qkT8uHK\n' +
- 'NQjzDvo3RO1cROQp0zsikladmzGZHQ==\n' +
- '=q/e/\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isSpeaker: true,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA10lEQVR4AcXBsWnFMBSG0c8/brOD9kgfogHUGQIuAppInSsVAQ2gdbSD64fTXl4hMI/HPWf5fXxf3DDaxkxIlTuEM+FMOFt5MtqG1XvBipGpsp9YMWaskCqWcCacCWfL4+fzwogx8069FyzhTDgTzpavv3oxEVLlFaNtzAhnwplwtvIkpIpV9hMrxsxM7wUrHxVrtA1LOBPOhLM1pIo12oaVj4rV98JMPj6wRtuwQqpYwplwJpyt3BRjZiZQuUM4E86Es7XsJ1aMTIVUeUXZTyzhTDgTzv4BnGY033BWusUAAAAASUVORK5CYII='
- }
- ],
- pendingMembers: [
- {
- wallet: 'eip155:0xaC6C69c657cF6022fa787B14BDdaA22936B56D65',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA2UlEQVR4AcXBQWoEIRBA0Z+ikOwNDHirbARPKDiLvkzOIATaC4iQbGt6ITSzqPc+np8/fxhpVazzcfCOr99vrK4FS3AmOBOcKRddCy9GwQoxszNHw+rKluBMcCY407QqO10L1hyNO9Kq7AjOBGeCMz0fB9YcjZ20KjtdC1bXghVixhKcCc4EZzpH446uhXfM0bAEZ4IzwZmGmLHmaOyEmNmZo7ETYsYSnAnOBGfKRVoVq2vBmqNxR1oV6+SV4ExwJjhTLroWdkLM7MzRsLoWrMCBJTgTnAnO/gGd1jrTKk/8EAAAAABJRU5ErkJggg=='
+ 'wsBzBAEBCAAnBYJkrksbCZA3GHnYNke0AhYhBNp+D95LDfs4yU03LzcYedg2\n' +
+ 'R7QCAACRdAf9ELAnCLXfBiAVdbgwj81xr+w9Yzw2wXLLrPLfYY7EXfyChLzQ\n' +
+ 'rr9XBDdWMgtzEU1diSPMbLDh1METR7n71EjG0AoeX5A2pkHI7R1vIxXUJR3G\n' +
+ 'fzHENsfGaKLnhrL1wLjBQACzEsIqPrHl9RItdtKEs9izLmc+wV0GFJ5OjbAs\n' +
+ 'ty/1Q36nnMB7sQ7Ytb9Op+q0TtZPZ7jF9CjX8KGav3P1xDQex9nfsXiDHlLK\n' +
+ 'MqDePaaMO6RJUWAP2xTo2k1DDJQ2dpUhs9XyjMlvFhVbIcT1/lVRCPC8V3C8\n' +
+ 'fUKhUejvOjNFxf0QuR+E4xs+Q3zvR1+fXdJBxbH2Fp3kOTN1N9/LEw==\n' +
+ '=sLLC\n' +
+ '-----END PGP SIGNATURE-----\n',
+ spaceImage:
+ 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ spaceName: 'statutory_amber_roadrunner',
+ isPublic: true,
+ spaceDescription: 'continued_bronze_pigeon',
+ spaceCreator: 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
+ spaceId:
+ 'spaces:3aa43087b8c55ed9c534dd1d0a086a3340b0d829cda0a13592651cb59f284838',
+ scheduleAt: '2023-07-12T06:51:32.000Z',
+ scheduleEnd: '2023-07-12T07:41:32.000Z',
+ status: 'PENDING',
},
- {
- wallet: 'eip155:0xEf532414907E8c631307c0d501cDe6D1694bAF5e',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA00lEQVR4AcXBobHDMBBF0ZsdjftIDeGuIkzIaGsQC1MNQkZirsLcnaQCk3yqBOzMH4N3zu11f38I+GPiinacRAwxQ8wQS/zo1flSGqNenUgujVGvziiXxsgQM8QMscSPXBqjXp1RLo1Ir84ol0bEEDPEDLHkj4lI51uvzn/4YyJiiBlihlhqx0lkZ2U0Pxci+7YyasdJxBAzxAyx1KsT8W3lil6diCFmiBlit9f9/SHQq3NFLo2IIWaIGWKpVyeybyuj+bkQ2beV0VwXIoaYIWaI/QH8GTSs76EUEQAAAABJRU5ErkJggg=='
+ msg: {
+ fromCAIP10: 'eip155:0x1615d2D9ae82D5F0eE79298899962b237386feB7',
+ toCAIP10: 'eip155:0x1C48fE875590f8e366447758b13982a3Ca7d9dBE',
+ fromDID: 'eip155:0x1615d2D9ae82D5F0eE79298899962b237386feB7',
+ toDID: 'eip155:0x1C48fE875590f8e366447758b13982a3Ca7d9dBE',
+ messageContent: "Gm gm! It's me... Mario",
+ messageType: 'Text',
+ signature:
+ '-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJkWKQWCZB7dzg7q3axjBYhBJFuYslzDGbuE+3FMnt3ODur\n' +
+ 'drGMAAAjtAf/TXjtm2qb6aSikFPKYXm0Ekws+65fisJGf7T48MYkkfcD4t2e\n' +
+ 'HXd9LtohzGhcztbOQfAND3yME1GWuMBIksq9rlyEA0ezwsGzCJVhBnkAHBe3\n' +
+ '+1v4/mNSMmInU8y6sOiLiOcW7ameJvZvDdPDJ0YHhc9dKDCIh1UAZEPAgx+z\n' +
+ 'Wc0DM6pW8bT70dfgnuW2LlLGF5Z23Z1vbHmeszt78+xYY3ez/hoMHXUIE25z\n' +
+ 'Wrnt75nasBBahtJ0mwH10ATnsQNE9hTi6XPGYxRSNDM9nyRxTQUpjhNmGS/+\n' +
+ '7oFyq8xTcRSaL7d3h8URp9hgFWher5ZZDyMV0jvk+HPguUX54g6Kgw==\n' +
+ '=dcRD\n' +
+ '-----END PGP SIGNATURE-----\n',
+ timestamp: 1683530775648,
+ sigType: 'pgp',
+ encType: 'pgp',
+ encryptedSecret:
+ '-----BEGIN PGP MESSAGE-----\n' +
+ '\n' +
+ 'wcBMA9aU+JGZVRn/AQgA1pIJHyeJinU21r6At5S5ZaWeN0OEKVB2TjpqZ0IW\n' +
+ 'lHLKQrQ8k3M16bN+Vf0P+DzDVOL84QRkBD56qSNVHOOCox5wcQeR01CczenV\n' +
+ 'LUVvVjBzR2hj7Sdw+Q+M//rgeZPPUDbNyiVmGijelhwDqWd7IOoZY26AGXlm\n' +
+ '7YQiElvHN2HcYXaTlLAOy36BcccwHu3Tn06F77ZXaf8FnGMWOUy7wh1/jugg\n' +
+ 'D17jUZGLYbmw+u5l9BOfljbw2pb4vtjWht0I1b4GYlKb+bYg/NY0UNsq7mSh\n' +
+ 'dGAmOhy5tC2NMjLRRLfD2qasxHoHN50onlB6HcYLl0RCf31ebOgO6rMhUnxt\n' +
+ '9cHATAMLWLG2xubrYAEH/2tVeq2j7nJALGSFxjJPboOY57aiFrhXNQ/e/oXH\n' +
+ '//TNJgGWx4Ta++OuF2Oexbh9DIZhl6DWld9adXDDtBS/fEyjNsYqwoYlNEJN\n' +
+ 'kLvSmokNNrE4MKC1A0GkhSh2MGQDNk42GSgz1tep8XSVc98MHqfNXCHVb5Oa\n' +
+ 'OBeWKLFyElT3+KuZxSkCsnoO5YjuCGbXPyG06tXMHXMTncpj1ri+vpjUSnhD\n' +
+ 'wn3o0zpNWu0GaWXIgTqj2ZouVwV2S1+wAJQjE8uI1JvBiMhA+X63/GCcApBu\n' +
+ 'C7rN0Cs5NGXCn9VWp8i1SCp2NuZ38POABwsXUUkjpF24txyUDX8dbXlkzpao\n' +
+ 'g93SQAElYYmyKbGp1TKhAZl2u40mgf2yCYDv2DLRfAKMJDLvmjXoUGEg2UYO\n' +
+ '11w6LD0pIykdKJmFtRls/uMnlcoBgDA=\n' +
+ '=kzUH\n' +
+ '-----END PGP MESSAGE-----\n',
+ link: 'bafyreib34jgnpp573rwquejcq5avxvydis7fbykat6dd5z7uazobucoumm',
},
- {
- wallet: 'eip155:0x2F5f27B523C8888eA79b7FA80a9CbA6b6980784c',
- publicKey: null,
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA0klEQVR4AcXBsW3DQAxA0W9CExjIDhogfboDCw9gICvcHmldcIAMoYLgJJ5CKzgto4KA4ILvXT5+Pl8kwydZqJHt60bl+ryRDZ9koUYmNBOaCc0u31+/L04INSrDJ2cIzYRmQrMl1Dhj+KQSapwhNBOaCc0WDvZ1o+ROZV83KtfnjUxoJjQTmi0c3B/OO+4PpxLKP0IzoZnQbBk+yUKNyvBJJdSoDJ9kQjOhmdBsCTWy4ZNKqFEZPqmEGpnQTGgmNFs4CDWy4ZN3hBoVoZnQTGj2BxvbMvuaMCXUAAAAAElFTkSuQmCC'
- }
- ],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJkq+dvCZBm9Bz6DvB6DxYhBPkdSvwnOBuAJaOWAGb0HPoO\n' +
- '8HoPAAD5ywf/cvaGM0DzcB22Q2FMzUZG4/ZmkN4OknvSj0d4hB/sPUIb9176\n' +
- 'z+niFMjWZNFpIj8s36f16oMEZZ+Eleu9t6sECBxRDvO8pEwyByCXSmz8e/SH\n' +
- 'Y659cvg5/A3bSe0FqR0VTI1o+Uz2BpnXG/P38C6D46btaIaJcr4cIh88wQ9J\n' +
- 'lr05hOE7w/7Uo5OwyXala0NfB+8S4LIfpC2OlPOhyHQEJd2+WoFKb/6dO28D\n' +
- 'TLuvgYJXJfc4R3ElcgFfm1N9ylG0Pt1F3c0C/k9bNokR2PVXgX2XSTQsx1rD\n' +
- 'MCY/ePr93INyNZuTPcPlK87X6OTa2/gEW161vup2Xn2Did9HtL76Qw==\n' +
- '=EkOP\n' +
- '-----END PGP SIGNATURE-----\n' +
- ':null',
- spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- spaceName: 'intellectual_green_bat',
- isPublic: true,
- spaceDescription: 'sad_purple_pinniped',
- spaceCreator: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
- spaceId: 'spaces:9dab226c7920fe06154d76f78dfe1187bdc4fda712cdd9a8b37cc6a99741a63b',
- scheduleAt: '2023-07-15T14:48:00.000Z',
- scheduleEnd: '2023-07-15T15:48:00.000Z',
- status: 'ENDED'
-}
+ },
+];
```
+| Parameter | Type | Description |
+| ---------------- | -------------- | ------------------------------------------------------------------ |
+| msg | `IMessageIPFS` | message object |
+| did | `string` | user DID |
+| wallets | `string` | user wallets |
+| profilePicture | `string` | user profile picture |
+| publicKey | `string` | user public key |
+| about | `string` | user description |
+| threadhash | `string` | cid from the latest message sent on this conversation |
+| intent | `string` | addresses concatenated from the users who have approved the intent |
+| intentSentBy | `string` | address of the user who sent the intent |
+| intentTimestamp | `number` | timestamp of the intent |
+| combinedDID | `string` | concatenated addresses of the members of this space |
+| cid | `string` | content identifier on IPFS |
+| spaceId | `string` | space identifier |
+| spaceInformation | `SpaceDTO` | all space information |
+
---
-### **To approve a space request**
+## PushChat Class
+
+### **Initialize**
```typescript
-const response = await PushAPI.space.approve({
- status: 'Approved',
- account: '0x18C0Ab0809589c423Ac9eb42897258757b6b3d3d',
- senderAddress: '0x873a538254f8162377296326BB3eDDbA7d00F8E9', // spaceId
- env: 'staging',
-});
+// Initialize PushAPI class instance
+const userAlice = await PushAPI.initialize(signer, {
+ env: ENV.LOCAL,
+ streamOptions: {
+ listen: [STREAM.PROFILE, STREAM.ENCRYPTION, ...Object.values(STREAM)],
+ filter: {
+ channels: ['Channel1', 'Channel2'],
+ chats: ['Chat1', 'Chat2']
+ },
+ connection: {
+ auto: true,
+ retries: 3
+ },
+ raw: true,
+ enabled: true
+ },
+ });
```
-Allowed Options (params with _ are mandatory)
-| Param | Type | Default | Remarks |
-|----------|---------|---------|--------------------------------------------|
-| status | 'Approved' | 'Approved' | flag for approving and rejecting space request, supports only approving for now|
-| senderAddress_ | string | - | space request sender's address or spaceId of a space |
-| signer\* | - | - | signer object |
-| pgpPrivateKey | string | null | mandatory for users having pgp keys|
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
-
- Expected response (approve space request for a spaceId)
-```typescript
-// PushAPI_space_approve | Response - 204 OK
-```
+## Parameters
+
+| Param | Type | Default | Remarks |
+| --------------------------------------- | ------------------------------------------------- | ------------- | -------------------------------------------------------------------------------------- |
+| `signer` | `SignerType` | - | EthersV5 or Viem Signer. |
+| `options` \* | `PushAPIInitializeProps` | - | Optional configuration properties for initializing the PushAPI. |
+| `options.env` \* | `ENV` | `staging` | API env - 'prod', 'staging', 'dev'. |
+| `options.progressHook`\* | `(progress: ProgressHookType) => void` | - | A callback function to receive progress updates during initialization. |
+| `options.account` \* | `string` | - | The account to associate with the PushAPI. If not provided, it is derived from signer. |
+| `options.version` \* | `string` | `ENC_TYPE_V3` | The encryption version to use for the PushAPI. |
+| `options.versionMeta` \* | `{ NFTPGP_V1 ?: password: string }` | - | Metadata related to the encryption version, including a password if needed. |
+| `options.autoUpgrade` \* | `boolean` | `true` | If `true`, upgrades encryption keys to the latest encryption version. |
+| `options.origin` \* | `string` | - | Specify origin or source while creating a Push Profile. |
+| `options.streamOptions` \* | `PushStreamInitializeProps` | - | Configuration options for the stream. |
+| `options.streamOptions.listen` \* | `STREAM[]` | - | Specifies which streams to listen to. |
+| `options.streamOptions.filter` \* | `{ channels?: string[]; chats?: string[]; }` | - | Specifies which channels or chats to filter for. |
+| `options.streamOptions.connection` \* | `{ auto?: boolean; retries?: number; }` | - | Connection settings, including auto-connect and number of retries. |
+| `options.streamOptions.raw` \* | `boolean` | - | If set to `true`, will provide raw stream data. |
+| `options.streamOptions.enabled` \* | `boolean` | - | Specifies if the stream is enabled or not. |
+
+
+
+
+\* - Optional
+
+## STREAM Options
+
+| Option | Value |
+|-----------------------|------------------------|
+| `PROFILE` | `STREAM.PROFILE` |
+| `ENCRYPTION` | `STREAM.ENCRYPTION` |
+| `NOTIF` | `STREAM.NOTIF` |
+| `NOTIF_OPS` | `STREAM.NOTIF_OPS` |
+| `CHAT` | `STREAM.CHAT` |
+| `CHAT_OPS` | `STREAM.CHAT_OPS` |
-
---
-### **To add listeners to space**
+### **Fetch Info**
```typescript
-const response = await PushAPI.space.addListeners({
- spaceId,
- listeners: [
- `eip155:0x65585D8D2475194A26C0B187e6bED494E5D68d5F`,
- `eip155:0xE99F29C1b2A658a478E7766D5A2bB28322326C45`,
- ],
- signer: signer,
- pgpPrivateKey: pgpDecrpyptedPvtKey,
- env: env as ENV,
-});
+// Fetch Info
+const aliceInfo = await userAlice.info();
```
-Allowed Options (params with _ are mandatory)
-| Param | Type | Default | Remarks |
-|----------|---------|---------|--------------------------------------------|
-| spaceId_ | string | - | space id |
-| listeners | Array | - | new listeners that needs to be added to the space. Don't add listeners which are already part of space |
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
-
- Expected response (add Listeners to space)
+
+ Expected response
```typescript
-// PushAPI_space_add_listeners | Response - 200 OK
{
- members: [{
- wallet: 'eip155:0x4Be8cFD08B330853A530DEBB72a2DAf4d4F3D2Ba',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGSs51IBCAC+y8oXbU2YvfI7Z4xnSRfcPecRR+nO/XVLDbt30mbn1NU8\n' +
- 'wHSXcuHLJTuU9yJy1t9AMB2SY8n/YWMFbeNICF0OQVINkvFS+8Ec/F42IIlb\n' +
- 'StUY8rLS9pxTQoI3k1LnQKNL1krGiEuDl2ZT3l304aPGkF1sowu5w6xnzl/o\n' +
- 'nb6cgc48jVqIgqoVUCnEoxc3GKdSORm35nl0RBDasFdFPJctnpg2n7hLofU1\n' +
- 'RGOIzf/cITY7AE3nta0cqaFgNsO4rO0fXRwgDBAu66CtBG4Px2X8hT7IYMum\n' +
- 'XJtCis3KvrmQAOhWrbAwmWjHbkSDSYigd39rmlht21GKf0/kfoILBgRfABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZKznUgQLCQcICZDTsTetOyJa2gMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBHGBWhlF6JChmgQO7tOxN607IlraAADq/Af/XWeAagX5+JCX\n' +
- 'ChzadMaUtI6m2F7nT8sJcJep/a0Ldyz6kPmP9k6kmWO+QXJwl4FrP3e7HPer\n' +
- 'SjTeIWm0FJ2a+pRtF+lWk7xjIWJuZxbx79nOk98arde75fT+bebne1V0raUM\n' +
- 'gXPQIc60++okAPif6vJVLAaSMNbCkv8+Lsy0mJqsjY3b9iMVKWHKb8XVvTuN\n' +
- 'pobxVV4dLq53lrdNDIiwAWTlbxyuKLSEF4f+hIPJX3PAhquORinOubclUwTM\n' +
- '+kEmE6VI3pW4VL1VRi10cDI6ruEVwqOwQyYcp9gSDKXFR6ZXz7t0hjUUhl+3\n' +
- 'z6T7yqAjExW1O4tETVSbt3jg6DjaAM7ATQRkrOdSAQgArRRrLZees3xCYyBO\n' +
- '9WDzy7XCM2FxmaIJs/ibWwTtD1ZVoc9NKeOx07FYwGiYjigY6FxxJHdr20IQ\n' +
- '3xieIyBLZM2XAIXrsxq4M9GLG8R6nhd35BenjcvSGiZH1Rq0aXtFt9Fd7gc6\n' +
- 'E8XpMcHPH8KEnf66sPz18vrVCdstVU4Qj2ZjH25ilfeGdMj2HHfDxVN8sRhl\n' +
- 'AXAcwblQ+IVXGjuKw19T4zN874bcAaOmXfzxu3+2PtxVSR5uV03x1ln3ji+b\n' +
- '+GF8atJMMHCqE0FC/dEciS+BWSQtv0D93XWjzExJeyhd7Z+I3BG8JPuJT5Yj\n' +
- '4PxktEgwUxQc83JFFwED9knzyQARAQABwsB2BBgBCAAqBYJkrOdSCZDTsTet\n' +
- 'OyJa2gKbDBYhBHGBWhlF6JChmgQO7tOxN607IlraAABLdggAhe1KLjtHTsUI\n' +
- 'SR0K25EJ+9gXC7wmebve9wNZL22/Ud9hnyS77/VUmMNBgdPyhm/9ITMhVtTt\n' +
- 'rRNo1AzsVKDn3/dW1kc+nSribOufxzMoBM7Bm918Zt/0/7wCegz0bp3EAoQ8\n' +
- 'KEa2KPY9lSh2WtEDoA87D8JB1xwIfcR98vg5/AZ7VdtE88foSqXAm+6F85hz\n' +
- 'nAASNBO9CCDvUofR28b4exT/aWX0qZxLAukgH7fnYC3KPVv+9ug6mdyJPsOZ\n' +
- 'LFjF327UKLrBuQ6VRlfKF+XULJbtNPxckgwO1V/oxycq/M67acGoXgc2MgP/\n' +
- '2qOkbiQC0ZxcA+Ze5TNNhuGWKv6d9g==\n' +
- '=S9Ba\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isSpeaker: true,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA1UlEQVR4AcXBQU1FUQxF0f2bZ6gaIOkAC4yxUCRQHyRoqIo6wcJnesLgEgJJ17p9vDzeEe9vd046nZOo4eT59YYylhnLjGW3p8+HOwedzl9EDSfGMmOZsezim05HRQ2q0zmJGlSno6IGZSwzlhnLrk5HRQ2q01FRw0mno6IG1ekoY5mxzFh2RQ2q01FRw29EDarTUVGDMpYZy4xlV6ejogbV6aio4aTTUVGD6nSUscxYZiy7+KbT+U+dzomxzFhmLLv4QdSgnl9vHNWgOp0TY5mxzFj2BfKPPQUA5ipXAAAAAElFTkSuQmCC'
- }],
- pendingMembers: [{
- wallet: 'eip155:0x4d2eFB18383a48aCe19a198ae5228BB4bf854cec',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA9UlEQVR4AcXBoZHDMBCG0S87ZqEmooaiLmJJsNtwIyFuwzhERZgKmoqkhxz9HaCbmwP73u159w8iN0fVVFC5OT01FVRujqqpoIxgRjAj2JCbo6b1QE3LiDrpeywjF+vBRXOUEcwIZgQb+MW5zaiaCl3NUdN60GMEM4IZwYaaChfNUdN6cNGcnmk9UOc2o2oqKCOYEcwINuTmqJoKF835i3ObUTUVVG6OMoIZwYxgt+fdP4jHMqJe+xuVm9NTU0E9lhH12t8oI5gRzAg28OXcZlTeuKip0JObo06+7AVlBDOCGcFuz7t/6MjN+Y+aCj1GMCOYEewHE5pCbf3G8WQAAAAASUVORK5CYII='
- },
- {
- wallet: 'eip155:0x8E50Bfb57f803814c242c5a25890f5F0c13304fF',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA20lEQVR4AcXBsWkDQRCG0W+Gy53pkgVVsiXYFVx2rsANiCtEmQoxbCHmYBNd6gLW6aBgjDDmf89eXr8GiW6VqIxGplslKqORccQcMUdsWued6Ho/k+lW+Yt13okcMUfMEZt4sM470YUb0XYsZC6nG9HKTsYRc8Qcsel6P5PpVnnGdixEZTQyjpgj5ohNPOhWyZTRyHSrRN0qURmNyBFzxBwx+34rg0QZjahbJVNGI+pWyThijpgjNvGLbpWojEamW+UZjpgj5ojZx/vnINiOhf90Od2IHDFHzBH7AWIQNGL6hyehAAAAAElFTkSuQmCC'
- },
- {
- wallet: 'eip155:0xaA6E4434D881D2bDEea891AE127313AE5515a06B',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAyklEQVR4AcXBsZGDMABE0c8OqQPGZShzCdCCVNZVIhVAYrpQ6g48lMClkgMlBPve9HjtF0bCTJgJszmXykiKgTtyqYwIM2EmzOYUAyO5VO5IMTAizISZMJu/70rrOOmkGLgjl0prXegIM2EmzKbHa79o5FIZSTEwkktlJMVAS5gJM2E282Nd6Dy3QCuXykiKgdb3XRkRZsJMmE375++isS50jpNOioGRXCqtdaFznHSEmTATZjM/nluglUvljucWaOVSaQkzYSbM/gGGCDCC/3c1nwAAAABJRU5ErkJggg=='
- },
- {
- wallet: 'eip155:0xf6106dd699B6e40f1E822c38DDA459F533470b11',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAwUlEQVR4AcXBsU2DMRSF0S9XHoIFIipmIEW2sPQ6pmGEdJa8BYXXsOgYxKF9afzrr+45l++39uSEUGenrcoZwkyYCbPCgVAna6uyE+pkbVV2hJkwE2Yl1MnaqmT364Ps5/eLnfv1QRZzkIU6mTATZsKscCDm4IXYijk4Q5gJM2FWONDeb7yYbLX3G1nMwY4wE2bCrHAg5iALdbYmpwgzYSbMLh+ff0+MhJkwE2Yl5iALdXbaquyEOjttVTJhJsyE2T84uix63kKmNgAAAABJRU5ErkJggg=='
- },
- {
- wallet: 'eip155:0xAF3d4989652a6ED5554b6191c555525977424Cc9',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA3UlEQVR4AcXBsW3DMBCG0c8/tEMmUClkBDVaQAWHIKAZWHAGAxyChZDejbOCkcrDOO3ZxQlGENx7p4/t64Gj58JfpFbxiGAimAg2cOB6uWHNy4TnernxDhFMBBPBBl70XHg2YaVW8fRcsOalYKVWsUQwEUwEGziQWsXqueBJrWL1XPCIYCKYCHb6/vl8YKRW+U89FywRTAQTwQZebOOK53zf8Wzjim/CEsFEMBFs4MD5vmP1XPCktmNt44pHBBPBRLAhtYrVc+HZipXajmcbV6x5mbBSq1gimAgmgv0CTksv6eJNDqkAAAAASUVORK5CYII='
- },
- {
- wallet: 'eip155:0x2ccBeEf6e30dF46D0A7Ee79Bc66FBF3beA7EeA5A',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA00lEQVR4AcXBIW6AMBiG4XdfmnAYboLlCE3NFBLX4JB40hMsWM4x08OgNvsXUbMs//N8fH59/2DksfCfthqxhDPhTDgLvGw1Yq3nhLWnm571nLD2dNMjnAlnwlnIY8HaasQajplGpWs4ZhqVRh4LlnAmnAln4VkuGinSs54TXcdMz7NcWMKZcCachT3dWHksWM9yYQ3HTM+zXFj5oLGlG0s4E86Es8DLViONFLEyhZ493TQqXcKZcCacCWfCmXAmnAVe8lj4izwWerYasYQz4Uw4+wXktDHpzVVJlwAAAABJRU5ErkJggg=='
- },
- {
- wallet: 'eip155:0x65585D8D2475194A26C0B187e6bED494E5D68d5F',
- publicKey: null,
- isSpeaker: false,
- image: null
- },
- {
- wallet: 'eip155:0xE99F29C1b2A658a478E7766D5A2bB28322326C45',
- publicKey: null,
- isSpeaker: false,
- image: null
- },
- {
- wallet: 'eip155:0xa145b34443e28C8f718Cd0691Dc41A81E0d0A857',
- publicKey: null,
- isSpeaker: false,
- image: null
- }
- ],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJkrOdUCZDTsTetOyJa2hYhBHGBWhlF6JChmgQO7tOxN607\n' +
- 'IlraAAAqUQf9FvAtNouG7+2YSyyx7eiHRJZroDPFohH/F2xyc+oJkgh40p2y\n' +
- 'hyKw+DSp0FA+IiT95/y8RbGDUrNFz+/kdMfZWCEYFim3Cy+c5k1/YNc8qxx6\n' +
- 'VLwef+2YZepC1pSS9K0zbu04uVPWrNmDa5lHXqzTx/mOxWlxLD0NfpI60csE\n' +
- 'iQx57duy2gMeW9MwOKSFjOSnWHKy7AySm/vBwZ9Rj4gnOhsvwbAfLprQQf4G\n' +
- 'cUaxG/HOb0c/8Ugews0Z1uDJFmGKjT5R5CR63vPo5qDGQwWkm+LYpshCIV+K\n' +
- 'ofLepDqQRuEFa7VyUlDOvMcF15LtlvAhwhkIVHvTGjXZC91e8/IUsQ==\n' +
- '=UpR2\n' +
- '-----END PGP SIGNATURE-----\n' +
- ':null',
- spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- spaceName: 'weird_moccasin_alligator',
- isPublic: true,
- spaceDescription: 'equivalent_blue_armadillo',
- spaceCreator: 'eip155:0x4Be8cFD08B330853A530DEBB72a2DAf4d4F3D2Ba',
- spaceId: 'spaces:d37c4e303a2ff194e546d3af94353ec829324a578ebffbeadebd1ba91ab88548',
- scheduleAt: '2023-07-15T14:48:00.000Z',
- scheduleEnd: '2023-07-15T15:48:00.000Z',
- status: 'PENDING'
+ did: 'eip155:0xEaC9c666570782E262f1E2a0b1d3BE4B95aFA7cd',
+ wallets: 'eip155:0xEaC9c666570782E262f1E2a0b1d3BE4B95aFA7cd',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGTu6YUBCACa7JaMqfhAnD/9ynE5Rhi8KNQ1tfdQe0ay/9jXX2naZIA+\n' +
+ '6WCi1uNcB2TTLfMuzsEl4u/26LTgtkr51snRt2QKgEqi5dXqbRD76wiRLd4h\n' +
+ 'ktBb4WB28o+BWOHYYJQq8he+zu3mQWjKLb1e9DyS0cTzwPwWVKce9IsG3NOi\n' +
+ 'eM7O5Kg5cU3qHXR+frF25peCBrzNXH+xuuTJPsX85h9dSz/u6dWXhk2LsX3s\n' +
+ 'cmX5mFcFErnGvUBddDGZc11q+WzZAtENPCxQrNjpkMtzCj9UMwgsJdzBghZZ\n' +
+ 'ZouGTG2uhfmIj3/KHOdwx/KGpTgC1iMVOb78kw9LmaxL6fGy4x9uvvI3ABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO7phQQLCQcICZABDloJB8hpcgMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBMga3B8GDU79nd/0mAEOWgkHyGlyAAAbHAf/bJMPIyvNZNjO\n' +
+ 'JK2xA1hYpzIGdbi3jMego6GXrmet3qY50zMKDccB2Ot399y/nmWMVEyfKYaP\n' +
+ '7N+mJbeAqIZ8TAHtpw++k/h8/hXoxb9iPsQyWYossuG499XyHnk+KEd4g0Wf\n' +
+ 'mqPk/XJB3xLLgW820jOsRRbWLyYKJEdh1Q+GIM+D6oIJ9ZmyRPv25u6yCF2P\n' +
+ '2IQZErWeYD/LxqMDw+uHdRZJRiyFy/Y7A43clejN+p3my8oktXh2N4+tEl7i\n' +
+ 'Hwxc5z9AOffuEyUerm0Rjwdn8rG8po7AfuXwmTiW1Sdc9TdJtAK/n6e9EFHV\n' +
+ 'gHzArwyaydHHy80Wqa+UF591NkPi387ATQRk7umFAQgAs0ao+EFoKJirGHfI\n' +
+ '69vZg+eAAUUKG657BzNzTAF2r5Y+a61jdcCAL+DXBcfks+H0dqG36zjOZTCJ\n' +
+ 'NirABp5RRPFty2VvUtOyezuKX/MBVg3st3t/yE3SncVaWMblAv3iegviNNpH\n' +
+ 'cFKqpHoVBWDNdhFHNsKTjpJcq3BVohy2Dxh8Di8N/1+gEPxADvIuH9MQ8MJk\n' +
+ '6lB9XYXBmmqtlQ3sB916mvusUIl8Zxw1C76yY0PAXz055zJMiL1vwo5gKDiV\n' +
+ 'iKyzry3wq7upPGJyeTKu7uUMifTPhJtyYvon2TIik5DIgHpqKziirCrolA+s\n' +
+ '7LhnFbawqDKleEdyCcL5mFCzXQARAQABwsB2BBgBCAAqBYJk7umFCZABDloJ\n' +
+ 'B8hpcgKbDBYhBMga3B8GDU79nd/0mAEOWgkHyGlyAABIqQgAmK9ijEEvtWTm\n' +
+ '7/mhkuDEtfPfcMexfkaCcGL4SdZqVz/h+eIL8+4EbI9uq+YTzcjtX8FAEQta\n' +
+ 'KWFACNEOPmSy6Sb9bDoNZUVpDaZzNNtqIK9Brt4zjJLEsDfmkuW3S/SgIYBQ\n' +
+ 'yTkuNmmAf8dr7L4fG0JlxPyGaL1/w9UDAr7xdU7WcHuyPc0edDGeE7NwaGWp\n' +
+ 'uBipXFw8AkikV3fCTDuOi3uhkIzZ5zlGCshD7m0aDSABwr4hbFzLFBDSrsiW\n' +
+ 'GKhWGYgf5Vx8qzlwXYYnoW/rn3UXWpeTXjq46ZNaxjHJ4VxGMyn/tHZOEjDE\n' +
+ 'vHapLIAgGyw2b+s+zZSqsXaMkH8WOw==\n' +
+ '=gPzx\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ encryptedPrivateKey: '{"ciphertext":"4f1243e1ffa76180f46ade2eb093867750c6bf72e8d6c71c7c0edca176c2f9fb32c603bb5e52d933730e0350292431b6e5287b8201f60ce9151b6a141bde98cdc3d9e5df8f84e00e5e4173bdf28b66e9590db10195fbd41ed241a65ab84fb5da251f613376bf78efe1af64613dd54fb05dced7cf8de0907d61489712ad42f06b5c775d97d15dee09b1c58cd79f596674e403353bc7e03297aa0d3fdaecac573c962409622ff8b1335b6fbb661bd2d5f5a076d9079f857849ba917662b40151041eca71385844160fc603c4d1beefbf71b26ac8968de52d6bb534ef6d6e2ea987170059d7d881dc684d28b5b2817804fba3b659e3ec0e802583e581b9f75d2f7e69e428cba91e62719e9ca6697588389db89b982370d23952120c0f972ab4b3a0da888d52b5055c60785d276152e43929df532bc7d5d68c6bc3cfdd1ca780df346113999a19d8e4a96c02f149d1ee4cde802277081ef339153872c00c9e9ddfe3ba8da8c68c0565752fea32258087e66aab37397a27b0228b5ed1aeb09a93b80778fd7f949409106c4cd82ff550aafb9d7bdce8727a76882f59ef2c54a137e51f04b6c27a0b1b92cd781dafb489a5e8203232669f5416454cc9cfe8c5b0fd8abc19d9ef16285a8da0aca2ed747adef7b49b8215790266d9c4791c250b0580e89c6429d10a1bcd45cf016a7ae30e1db948147d992722a7191e31852e6fd3c3679d868f34ebbe65f255be4b90dd64ceb52eaeee7d3356683b7fd511729493c887289ddb0f00c65ca2a95114f0e37d3b73d06333e2787c5fa6dd6f6c9e8334ff153dd63e30c81247efd497cf2c038843d8653edf23822eae07dd19d0be26a921673185bcf016533fdb59150ff46096419e6a6aeb1bd4293fc8146848d715d43afd04aa40f2b5ae9d058671677aad2413952a20b5214e18bbf3b4b033d936d673a0302967de3f74b05b74bc6c89f30ddeaab1bf6c567fcee355797b6cba17c3fcc8955bdf096e2dda2577b3374089d8c9d287552e5658c91e812bd0b8b63482c8de98fde216dd557eb34bafca2f8e73dc4582fa36332e8869f2717519921605915d8e1c75a37295e198ec0af75926d89a6832456304474a10c567334998226d9b6f709ebc216fb067d958e78a622040c91f46af202273d0b40307fb34cba5a6a57fbb196ac6e88c16d527b9bdb04b12fa7ed0bc771692712ccd146c41890b5caddbbb13b8ba77e632b2d7597256fb576ce87d2aff35a0e953b8227a5dcbf30f7d189ca7f77f6f8b2c4eb2752199a7a485ab52a6b65b6edd6cf65caaeb6f65544cc74c2fb3431fa484fb69adbda08d2402da953f20425832b6a2d712d56a5cc34095f25fb9524a478a71d387b7dea45b4bd41e79c61dceca332898dfeecf83999ed4fad892e2ede714b93f3969ad140f38bfa95d321ae5ef089cf0ce435d59f8b6611c0fd014c67ed38646f0771f1a74c1f950ee0900d883aca3ec4efbb2f7737e717007ae757d874573d4d70c9d7e38f8ff30a29b983036e684c4eaf35a7c03ed32a8e3fc62f0863c56830127a5f3c0e905a93e7466a4f43f0793cb6752b9be8d03d7be26170f694ecbb200f611bbf1dac4b6ec085deb8c3d8ee188d8c9c8c17ca720c0f0dee4d00e5866b5443b6af6e69ca64b8eb5a8f5fa1e1d27bfacbf1b0ae11241215358f5045b0d1a73d1b15dbd904709340c1e2b42a4ef78f76b8f901d6337849cff1052f06a8919255b596fb36d2fdf789fdf611813d20729c26d517dde6f11a3f6045ec5158652e128cf7c483a0fb8ab772cb5cdb56e42e6bf8c863f173307c3e053168e54e9e65bcacbb144413ff76d08a94929e6cdde2c5944246a4b344f3ca0ada3b403429750bdce76f04668b05ed79e9119f00901e7f7b4f1eea8a1b5b0186e3ed41277040a257601b0f3917db595f3f1808d92071a4e9521a251e9c5a66f2c8a57511f61b9fd88df77330aeb4bc15c043814b33610d60f6d0a13fd7977efaa1843913f6d3a79bc88020406c9979163684efe7b7ade9613221d06b52cd96abd31b77a707748d52e6e16c8c90821f29359b35307c10dafce5f35c0ff9802c23aef19f0a95b49a317cd6207002a5a9b822b4c056c4cbf9b27045dda8325d93060f358bb837f00954a6e281d1bdd1817a7cce8ed4a801f9164d32c52739c1ac650109868664be1fabab47c675222dc9ff9d75f9fb49531c832264aa5b55998675975f59e34829ce90b00092bd77e46328a6459d5c967d905b8e976611b839925ad742500231fa86cb5f7e6f39cb1e2e36b81c55269ea0f5fdcba5c8c0e38a899540d52be49c83efae5243998b926f029dc2980d4fdb1c125db409d015e0b36bc02272da1c688ee1f61d23cbde585064ab1e2164d0ca529774ec7797407ba5d988c58853e74a124a64dc24d0289b6a599354faf64790177c3032f5d660d7b76dfbf1c03388a7c75b2309c509c6a92144e124c8bd188274bc844e8f0aa7b5a06e79ad5776b5a62003b89aef194dcc03cd3c1b1f3ea541805cfc4e18aa159f9b5395185b573538c9bab16876dff91f365d16dcc56b339b01b86882ef8e52c51edd9c5b2f8a35713ed6eb43036e09f64f6e59ab417958faff974b6705400b341439fef4cba371c601927da7e0a8f23e1c6d3e070a19c2216da85f159d60303ab1321e479f4c371372845cef03daa7d2776c18face6cfa2ff9eed26f9f0a353a0f1c9a99b2556dccc1212fcb5c2078a3b0e58a7f3f7b3f346d624435ef94c95d40dc726d2e7400ae405e89473a934e7646124e34473dfe17f7f9cf481aa059ef422508ffe67f9b9276084973db0683269a046c1a0aafa7ab075b28008cbfb862b7e30c8b2afa1c2923d914b3d2469266e8e0182274a3d8d89642723820e61aa2d97a9370789ec4e89ebee05b6c0bef10778caf2a34c2d7622dde5fa64b012bea6205127c3c845229ef553f013b73823dc6631078fc628532e3e518bdc790ab8460078dedf0c5cb00492136813e2b91679bba82f3cf95169751933bee4358f84154014dbcc1de1a30613218039ebb2444429380fd283d3b60bd5d5b470e861f6ecc751c22aa467168512a0ef45755e6b59a7be591bd3b08fde874b166ccfbbedba10a0956d2d18cbda515341c2112d6094a746e9f562db6543e5bde2c4d4f7c06b7550400d66f7242a14f34cd8a7374372f0eea49a49b72909fc11ff81ea54a1e2c07225cdee856383a657b0f13c14b00ae3b7b2a32a22beaab8cfd18641dbfa82619fdcdddd3339e9423e71c487305e8aa932b694e94c37c7e418e4014c8bb264f47e8283e216eeeabf0fbdd2f5eb8d0ea979738d4f18b7bf72d7711f5d22653f217c7305314ec2c47a0ecbf1dc8f9bc1379ae38e2a04e736a1171b947609bb66f8d352ce57230d709f196953471c5504c7f9f40ed2f64bf3bd04bd57521a364ea03b5f0603cceec7851738d97c3fd73c16547d4d143b009a79832a1ed244937dce09edf2d5e32ae52ab0331c449325dce9e5e8ed1563c967a5f92031f4275e3179274ef3e0752ac01caf8a20aabb23d584d4d6607833f95cfc92832d936c37bb8b37222aa842f48944d06b37434c8dce5f19b450a7d1bd568672ef2c8eaa2afb7cff404b33377a61061f56b01849feb918521a7d63cfbe12466aedc7159c577f213f2c157586b8719164cd7108edfa9211287b43aadbad997bc62f8169eec4a6e02aeb535f670878e6af538b5281da04470d318f893102613977390a434e0557302a68ce42e532d350446d4d813b84c07b42bf22fbe4889096ec6303574c95040d8dcfed1b9bd26782c5033d7d1a491fece156cbc19a705204ed38a547e00a09b73bc7a702ef9c2e659171d1daab63958268148aba59766bc7a4ffb68c1ae047d1f0c5fb45fbacd07079f72af301c6aa00eebc0662c6792fc707d388b339d4f45afbf576bacf8730ec3e0f1e9dc0f9a6d58fd146b2293aed8d110da24336f9a4c01ae12c03ce214c6502f5fbc5224dd8b8b2e4edf2af16b811e5c8595fa76cafe34ba66199caaed48b5dfd5ae74a3e6b6d51a09c70afc30ebc0f40d51a15f1a8c2c41ec482eddf14bed3fd11a9e2aa4446268af25b49e429e2528d5df57797f6f3cd431eb5ded8f830c85cecde8012c31500ce9363903739a6759704fa87bfef984ed0285c8c0a5bf2f0985b1b511eb4145e4b27e2df6aa7b5c7a913b76b1ca869151b75c0717389b3d186f4e4637a5ceba3cef64809c3a06551a6a46be31af61c0ef78afb057f6cc625647dc04dcd74eb97f7aee0f5640e24b7662c799013efb83c80ec2851acda7c6328de789ae99ce296494225bd169e49c9a12dc7e281778f7fe275e72571cd5a3608733998d2f6b96c1d26c25223153fc5afc2f6e3d72f57fbcb2d087d718d3b6703b286f1e340c23cd3bc715797edf3ce6d5169bcf783ac9686233cc0358725143008b25bfbd329e1c30654e4b4c9461239d41ae77f706e64e5e60ce6de83becfd056f2678f17474ab9f4976b2d7d5d014d78f716d7d4edbf6ce4ed44ed677274d6b9b6e4bf4946dfd1ed8b821c81957b4bf5cd534ed6ca84dadd9d6380513dc6406b32dcd5c1bfa468a79e88a56656e71aed0c6675540e1617a31e1c122295427590e83b63e8da58a6c5c21a15703994bdc2b90d399b62679a4269224257f3ead5a2dd0980e6f5a45c5a9392929cc4743e106c7335136c9f8a3a29190462eef908eab02cda97dbcb71dff26b0ef4dae51de293b4cff0ebf37fce1391247c5ccf77dfb64974c4a1e6beeaf82041bb0d653e2e9b612f3442bba8480b86fd7b35514fc056d7429d5fb36199d4a6f632ea615d9acc961082d9d91aca416b57582bcd2f182f5f5be02b3f597c680b2e6b37ee4d133e51d077491cb536d6261808c42684d0912fd7bcc97dacdf32394e7b","salt":"da23dc7dbf23136dabc337a0caa170c0db7e4efec5f5c8a648dff9b7cd7df49f","nonce":"fe0e4ec3d40fb7de21a354bf","version":"eip191-aes256-gcm-hkdf-sha256","preKey":"b43efae4c92a35d9c0b5f6178cb8b8a6642c77d0a9281f61beb9f6e8f7b006a5"}',
+ verificationProof: 'eip191v2:0x97ca70a87ec658e0e488e8b9f71644ee23840d809803fcf5bdcd174c9f39cdeb27f6e3a8885fec5bede5f264b3996bc3fa019b0d52745a5573a972b7e79e321c1c',
+ msgSent: 0,
+ maxMsgPersisted: 1000,
+ profile: {
+ name: null,
+ desc: null,
+ picture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAqElEQVR4AcXBsQ3CUBBEwcfKCfIPnbgxF+ACKIYct+cGDpEdpCeCS0Damcu2PN40gqQaiE6QVAPREWbCTJgJM2EmzITZxJcg+acgqQaiEmbCTJhNQVINRCdIOgPRCZJKmAkzYTYNRLWfT6pjnalu54vOsc5U+/mkOtaZSpgJM2E2BUknSKr7eqWXdIKkEmbCTJhdtuXxphEkvxiIjjATZsJMmAkzYSbMPjaMJNvaf06gAAAAAElFTkSuQmCC',
+ profileVerificationProof: null
+ },
+ origin: null,
+ name: null,
+ about: null,
+ profilePicture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAqElEQVR4AcXBsQ3CUBBEwcfKCfIPnbgxF+ACKIYct+cGDpEdpCeCS0Damcu2PN40gqQaiE6QVAPREWbCTJgJM2EmzITZxJcg+acgqQaiEmbCTJhNQVINRCdIOgPRCZJKmAkzYTYNRLWfT6pjnalu54vOsc5U+/mkOtaZSpgJM2E2BUknSKr7eqWXdIKkEmbCTJhdtuXxphEkvxiIjjATZsJMmAkzYSbMPjaMJNvaf06gAAAAAElFTkSuQmCC',
+ numMsg: 0,
+ allowedNumMsg: 1000,
+ encryptionType: 'eip191-aes256-gcm-hkdf-sha256',
+ signature: '0x97ca70a87ec658e0e488e8b9f71644ee23840d809803fcf5bdcd174c9f39cdeb27f6e3a8885fec5bede5f264b3996bc3fa019b0d52745a5573a972b7e79e321c1c',
+ sigType: 'eip191v2',
+ encryptedPassword: null,
+ nftOwner: null,
+ linkedListHash: null,
+ nfts: null
}
```
+| Parameter | Type | Remarks |
+| ------------------- | -------- | --------------------------------------------------------------- |
+| did | `string` | user decentralized identity |
+| wallets | `string` | all wallets associated to the did |
+| publicKey | `string` | Public PGP key |
+| encryptedPrivateKey | `string` | Encrypted PGP Private Key |
+| verificationProof | `string` | Verification proof |
+| msgSent | `number` | Number of messages sent |
+| maxMsgPersisted | `number` | Maximum number of messages that can be persisted |
+| profile | `object` | User profile information |
+| origin | `string` | Origin information (source of the data) |
+| name | `string` | Profile Name ( Deprecated ) |
+| about | `string` | Profile Description ( Deprecated ) |
+| profilePicture | `string` | Profile Picture ( Deprecated ) |
+| numMsg | `number` | Number of messages sent ( Deprecated ) |
+| allowedNumMsg | `number` | Maximum number of messages that can be persisted ( Deprecated ) |
+| encryptionType | `string` | Type of encryption used |
+| signature | `string` | Account signature ( Deprecated ) |
+| sigType | `string` | Type of signature ( Dprecated ) |
+| encryptedPassword | `null` | Encrypted user password ( Deprecated ) |
+| nftOwner | `null` | Owner of NFT ( Deprecated ) |
+| linkedListHash | `null` | Deprecated |
+| nfts | `null` | Information about owned NFTs( Dprecated ) |
+
---
-### **To remove listeners from space**
+### **Fetch Profile Info**
```typescript
-const response = await PushAPI.space.removeListeners({
- spaceId,
- listeners: [
- `eip155:0xB12869BD3a0F9109222D67ba71e8b109B46908f9`,
- `eip155:0x2E3af36E1aC6EEEA2C0d59E43Be1926aBB9eE0BD`,
- ],
- signer: signer,
- pgpPrivateKey: pgpDecrpyptedPvtKey,
- env: env as ENV,
-});
+// Fetch Push Profile
+const aliceProfileInfo = await userAlice.profile.info();
```
-Allowed Options (params with _ are mandatory)
-| Param | Type | Default | Remarks |
-|----------|---------|---------|--------------------------------------------|
-| spaceId_ | string | - | space id |
-| listeners | Array | - | existing listeners that needs to be removed from the space. Don't add listeners which are not part of space |
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+
+
+ Expected response
+
+```typescript
+{
+ name: null,
+ desc: null,
+ picture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAqElEQVR4AcXBsQ3CUBBEwcfKCfIPnbgxF+ACKIYct+cGDpEdpCeCS0Damcu2PN40gqQaiE6QVAPREWbCTJgJM2EmzITZxJcg+acgqQaiEmbCTJhNQVINRCdIOgPRCZJKmAkzYTYNRLWfT6pjnalu54vOsc5U+/mkOtaZSpgJM2E2BUknSKr7eqWXdIKkEmbCTJhdtuXxphEkvxiIjjATZsJMmAkzYSbMPjaMJNvaf06gAAAAAElFTkSuQmCC',
+ profileVerificationProof: null
+}
+```
+
+| Param | Type | Remarks |
+| ------------------------ | ------------------ | ------------------------- |
+| name | `string` or `null` | Profile Name |
+| desc | `string` or `null` | Profile Description |
+| picture | `string` or `null` | Profile Picture |
+| profileVerificationProof | `string` or `null` | Profile VerificationProof |
+
+
+
+---
+
+### **Update Profile Info**
+
+```typescript
+// Update Push Profile
+const updatedProfile = await userAlice.profile.update({ name: updatedName });
+```
+
+| Param | Type | Default | Remarks |
+| -------------------- | -------- | ------- | ------------------------------------------ |
+| `options` | `object` | - | Configuration options for updating profile |
+| `options.name` \* | `string` | - | Profile Name |
+| `options.desc` \* | `string` | - | Profile Description |
+| `options.picture` \* | `string` | - | Profile Picture |
+
+\* - Optional
- Expected response (remove Listeners from space)
+
+ Expected response
```typescript
-// PushAPI_space_from_speakers | Response - 200 OK
{
- members: [{
- wallet: 'eip155:0x5908D89B1390ec5833001b86302B868A808D506D',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGSs6YABCADC4ldJKGpZ0Z+JJwA1t/1JWp5+dnR98nr7RHPX8eEGxIhL\n' +
- 'gtx5TZmek2BcGzNcg66+GEyC4np9USaCZ4/YC9ZMLw8BQKzhOcd3ZILyGtGV\n' +
- 'BijBNwjPIbQcy5/cXVtfKCvf303BDYddPYuJ1xFAh7kpvhcR4a72CSpeyEjM\n' +
- 'UndteAVTIxqwdpnXIdqpwu6HrSJ089GpHV+XeaDo4Uhg+iHJsCRJy2VJ5m61\n' +
- 'CwGx55f3ror6rAXQd+hEx+keLxYINNJLLvfvE9IGsIbKRFZx+emjXQZusbJp\n' +
- 'zXYhJnEeHPLVDjWhzo8Q3/4gvOz8m6a+A9sl49sqodLdxVlXQ7d4CuylABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZKzpgAQLCQcICZCaDezdj8j4SwMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBGZpOFBNtTj1Oqt695oN7N2PyPhLAACCLgf/dB412nDRcOxR\n' +
- 'dNSj2AYknJ+NKeX38KuksyR6wypnaJWpapmIeZCfFjeoBjuBCPd6unvN/IlZ\n' +
- 'zPwl66lO5GKJxDaDd1/infxM/dbtFQSESLXlweRLQ/v1+plsntrBUyvbY4uH\n' +
- 'Mh9PImYsLY+zo8P5mpBV5AGAMA6R9qmu3axH/MnKVdB0Ky6C/jP+7lPs/QVT\n' +
- 'qsISyyI1E9E6Oivzxmao1axfXLdEvICHb6uD0R4p5SUVqHJX41OwM8BFevhK\n' +
- '07Hi+c7NhUWp0sxXEOs6dneJZwerCD3EahutpP1Oyt5T8MZitysn2yJ+s5ks\n' +
- 'SZza+x8OmCMcMZfZnIsJNnIUvPboP87ATQRkrOmAAQgAteDgsJJ0ftPD+P15\n' +
- 'rKgkLuSCD2iwQgm2k8/ZDaXJBsdm4sJYTt2y0ckx7MRpXgLuIyidOGctqVL6\n' +
- '/Rl2Hfl30JQPok5cYmYLENVuFz94MEvgDOo8jacyfPdLGPMWZMLRojyM/Yvs\n' +
- 'nhDZ8if3zEstP4h3HcpdT+PWSmsJWjrq57la4vKbfILtKfTBaf8sibm5UuZA\n' +
- '5Y/SIPxfVC+ybCPAjo4tpDYP901V+wxXDJ8BlZ4AaVvk20MYMzuAjBna+iwD\n' +
- 'f0j4CccEabd2EVtAQQcMCg2yTjOT22Dt0jfpDuohDNaXDhX2ZQlJIdlSLCEI\n' +
- 'a3c7g+uU9bnNqt7LHPgMzLYKnwARAQABwsB2BBgBCAAqBYJkrOmACZCaDezd\n' +
- 'j8j4SwKbDBYhBGZpOFBNtTj1Oqt695oN7N2PyPhLAAD2vQgAu9+sd4AT5b6c\n' +
- 'mWOaQBXz2XVfJXYQFNlBdOF23reycF9r7vDAKSRpeyMSyOfRAi0qdLynQ1dN\n' +
- 'MXV/gfO0G9dzFu513P/Y1sZxQi0uLRKL9hMcgEQ8FLo8/PGfVcoLfQASryGj\n' +
- 'Z8ybCFqiXocGpt2VkkK4wwgv+ZwZ8M1ubz0Boby6A1/kTYs/6ll+QekpB4ao\n' +
- 'kJKw3DWvVNR/xODFfMQcClvzAtqwfxhTZXBMbZ4vAG5m1ExGmA15cGXrAfwV\n' +
- 'nR2vOhPYDeZGbBKktM3xfDts75N2NF/TBpvazV2DTKpkLqvVitFHWvSMMpVd\n' +
- 'dwk9tEOmBlj2AoYATvQ9kKHRTD27Wg==\n' +
- '=IXzf\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isSpeaker: true,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA1klEQVR4AcXBoXHEMBRF0Zs3oqpHNYgJecZdGKYMd5GZRWaCwaohZbiAhP5d8HeC3jkfnz/fvwSTRua+DjJ1nGQ6i0iYCTNhVnjRWUSTRlTHyX90FhlhJsyEWeHFpJG5r4NMHSfRpBF1FpEwE2bCrPDGfR1E29jJPK6DqI6TjDATZsKsTBqZOk6iSa6ORmbSiISZMBNmpbOIHtcXUR0nUWeRmTSi+zqItrETCTNhJswKL7ax82wRTRqZzuLJ2MkIM2EmzApvTBpRZ5GZNKLOIiPMhJkw+wPV2i2sD43hKwAAAABJRU5ErkJggg=='
- }],
- pendingMembers: [{
- wallet: 'eip155:0xC1469cB7b59d16dC887D4C11faB3E3C0abBeA12C',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA30lEQVR4AcXBsWnFMBSG0e9dBAGDPUs6LeAFNIEb1x5GtRtDei3gBQzZIFtYYEj10t73CkFw8Z/z+Pj+euJs14iXlsodJfd4U7fjGWKGmCEWzjnilUzTsB60nHOk5ZwjniFmiBligTdTt+MlIt52jbRVvKnb8RIRzxAzxAyxx+/nzxMhQ8wQM8RCyT0taancUXJPiyFmiBligTdTt+NNKy/OOdIyrAct2zXiGWKGmCEW0lJ5kUe8tFT+45wjXsk9XloqniFmiBliYVgPvHOOeCX33JGWijesB54hZogZYn8uFTTKoy9pgwAAAABJRU5ErkJggg=='
- },
- {
- wallet: 'eip155:0xccF7a3131E0E73F83Bc457C27494411a57f23248',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA9ElEQVR4AcXBIWoEMRSA4X8fw6qayBW9zULVEBFygLqcqMwdhlBCbKjqXSLjY7b2UZEVpbzvu3x8vT5QShhoqUa0Yz9ZSTWiHfuJ5rNDE4wJxgRjl8/v9wdKn43/dLve0QRjgjHB2NZnQ7td72h9NrQSBis+O7Tb9Y7WZ0MTjAnGBGMbv/TZ0EoYaD47VkoYaD43VgRjgjHB2MYTqUa0Yz9ZSTWi9dlYEYwJxgRjlzf38kDx2aGVMNBSjawc+4nms0MrYaAJxgRjgrGNJ1KNaH02VlKNaH02VgRjgjHB2OazQythoKXKn5Qw0Hx2aIIxwZhg7Ae2cUcV4Bl8pAAAAABJRU5ErkJggg=='
- },
- {
- wallet: 'eip155:0x052aD82D3a7b4DAb5b9BcFED771D28703a6faadf',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAy0lEQVR4AcXBoXFDQQxF0RtlkZsQNjHICKYYV7DFCAW6II2BycfbhklCNR/sTNA75+Pn+/MXIUPMEDPEBifhSVdr0oUnO7UmXXjS1Zp0hpghZogZYoaYIWaIDU5qTbrwpHtfnuyEJ12tyY4hZogZYiM86WpNdl7Hg53wL3bCk84QM8QMscFJeNLVmnS3652dOiZdeLJjiBlihtioNenCky486eqY7IQnO7UmnSFmiBliIzzpak262/XOf7wvT7rX8aALTzpDzBAzxP4AMOQyARcWaToAAAAASUVORK5CYII='
- },
- {
- wallet: 'eip155:0x956f73E5a3BF0D19299BF74bD6dc819D7f775eC7',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA20lEQVR4AcXBsYnDMBiG4dc/nsHgHeJWS1x7G6QzqNQUKlUHLn12ONdqNYTBS/ja/xqBCeF7nmFbbydODoVPSjXiGWKGmCE2Pu8vvPT45pOe9xeeIWaIGWLj0Xa8HAo9qUZ6cih0tR3PEDPEDLFhW28nTg4FL9XIO3IoeKlGPEPMEDPEhq+f3xNnWmZ6jrbTMy0zPUfb8QwxQ8wQG6dlxjvajpdq5JLKPzkUvGmZ8QwxQ8wQG4+246Ua8XIovCPViJcpeIaYIWaIDdt6O7kgh0JPqpErDDFDzBD7AzabOPmHFg/aAAAAAElFTkSuQmCC'
- },
- {
- wallet: 'eip155:0x19da526eD1a57E07D48aa25aDa6cbA7E41FF3129',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAyUlEQVR4AcXBsY1CQQxF0cvTFEHuNn4jxB6JJggpw5Mh/UZogmByumBTi2DQahf5nMN2vr1IjvtG1ufgL8Kc7Hm6k4liopgo1i7XB1nsG990uT7IRDFRTBRrfBDmZH0OVsKc3xDFRDFRrPFBn4MszFnpc5CFOSuimCgmih228+1Fctw3vul5upOJYqKYKNaO+0bW5yALc7I+BythTtbnIAtzMlFMFBPFGm/CnP8U5qyIYqKYKNZ40+dgJcxZ6XOwEuZkopgoJor9AIckL2mEiBQrAAAAAElFTkSuQmCC'
- },
- {
- wallet: 'eip155:0x77059B40Ec974883b98a23eef519b4076D1Cf9F1',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsY0CMRRF0cuTQ6rYaQFiAvdBYMkFkFEAwWYTryxZ2kIcEE8N1MKmH4JJRuw7Z/d7uD0JRu1EuRW2GLUT5VaIhJkwE2a788/XEyNhJsyEWcqtEI3a+aTcCpEwE2bCLI3aia77E9EyT2xxvDyIvmsnEmbCTJgl3izzRDRqJ8qtsGbUzou58KLeiYSZMBNmKbfCf8qtEAkzYSbM0qidTxq1s0aYCTNhlq77E9EyT2yRW2HN8fIgEmbCTJj9AUPBKWCCQlIAAAAAAElFTkSuQmCC'
- }
- ],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJkrOmCCZCaDezdj8j4SxYhBGZpOFBNtTj1Oqt695oN7N2P\n' +
- 'yPhLAAD+iwf/dvaRCTwXKGH6iUe49NpyTHMaD6ZwaLerk+K4Ojehbdoo0mDf\n' +
- 'aOu/MR8wfqk49h2436rcMmyeM5avcMgmtGUmIdy/6hCZ6zxR/3E5t/vq5UfO\n' +
- '3YFO1VLghR5cTYqR9bMLFkvvCB4P29rnaok2QVKTBZLfyAM4wu1h2DDBESoz\n' +
- 'SS+ZtQLPz6/y7gOQobO0zbwBPmy8MpVVu1wxht+sneOMvZX+5al679nQbwNL\n' +
- 'oCcU3UKrlqMhuFgMTCKx99VLcc4JbhBf2M+IHf78NtQ9mcQC/X+gxRfp6f+p\n' +
- '2RePQzkmUH5vqXjzcUsNBWJPOyjl09/IZWWwaeiUjsPazjxqDtYNHg==\n' +
- '=H4X4\n' +
- '-----END PGP SIGNATURE-----\n' +
- ':null',
- spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- spaceName: 'sheer_ivory_ox',
- isPublic: true,
- spaceDescription: 'specific_green_alpaca',
- spaceCreator: 'eip155:0x5908D89B1390ec5833001b86302B868A808D506D',
- spaceId: 'spaces:bc96011f182e2c86ad68aaf4c95c4a916c808088370cb0ba294f9168e2ff6328',
- scheduleAt: '2023-07-15T14:48:00.000Z',
- scheduleEnd: '2023-07-15T15:48:00.000Z',
- status: 'PENDING'
+ name: 'Bob The Builder',
+ desc: null,
+ picture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA0klEQVR4AcXBsW0EIRRF0esv0k2mGhogp4FJ3AC1UMM2QE66AQ24DZIpwE75E2CtbOmd8/H1+vxmcZ2ZVao4vbCVKk4vOI9nY2WIGWKGWOAmVbZS5S2p4gw8Q8wQM8QCv+gFJ1W2esFJlS1DzBAzxEKcmVUv/KtecGLNrAwxQ8wQC+NoOE/2Zmbn8WzsDDxDzBAzxEKcmZ1xNP4izsyOIWaIGWKBm3E0VnFmVuNo7MSZWY2jsYozszLEDDFDLHBznRmn4sSZecd1ZpyKY4gZYobYD0RQL1bKLk86AAAAAElFTkSuQmCC',
+ blockedUsersList: [],
+ verificationProof: 'pgpv2:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJk7dERCZAIZdJAfLB6iRYhBK0xCN+/G/tf7pts7whl0kB8\n' +
+ 'sHqJAADd9Af/Z4DcYGZyQmVmIXM3CSDf2RaJOsEchm3hN93ErvTwGrKiviKW\n' +
+ '3/k6HWON3COHqmL5D1wlgZERTqaw3Xft1JC/82P108/IgDHiid4Wo4ojONn+\n' +
+ 'ZZV6KUfH1i0+wxXNsSvS1XtVYVnq/pQbXi8fzayCYM9jwdiFzBosQTLmXIbY\n' +
+ 'mUl1OezZ35kPQuZWjtZ2jyATQit6QL0uvQBiGAIevj1LRiB8uQsi0+Xr7R6I\n' +
+ 'D7WQ0Iwr85OIENGyv1KgrH/1Q944SjamWWI31gUhedH5a+THVLNDJGg3CAfq\n' +
+ 'FoOb2DNDviovMQxZwUOyCRCxVE6Ohw5Hwkw1YQOvzSwJRzz70l8A8w==\n' +
+ '=k8OV\n' +
+ '-----END PGP SIGNATURE-----\n'
}
```
+| Param | Type | Remarks |
+| ------------------------ | ------------------ | -------------------------- |
+| name | `string` or `null` | Profile Name |
+| desc | `string` or `null` | Profile Description |
+| picture | `string` or `null` | Profile Picture |
+| profileVerificationProof | `string` | Profile Verification Proof |
+
+
+
+---
+
+### **Fetch List of Chats**
+
+```typescript
+// List all chats
+const aliceChats = await userAlice.chat.list('CHATS');
+// List all chat requests
+const aliceRequests = await userAlice.chat.list('REQUESTS');
+```
+
+| Param | Type | Default | Remarks |
+| ------------------ | --------------------- | ------- | -------------------------------------------------- |
+| `type` | `CHATS` or `REQUESTS` | - | Type of Chats to be listed |
+| `options` \* | `Object` | - | Optional configuration properties for listing chat |
+| `options.page` \* | `number` | `1` | The page number for pagination |
+| `options.limit` \* | `number` | `10` | The maximum number of items to retrieve per page |
+
+\* - Optional
+
+
+
+ Expected response
+
+```typescript
+[
+ {
+ chatId: '6168440929ced5109c50534d40bb98a5e109ebf1d33df966ae898f002fac8973',
+ about: null,
+ did: 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562',
+ intent: 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562',
+ intentSentBy: 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562',
+ intentTimestamp: '2023-08-29T08:05:03.000Z',
+ publicKey:
+ '{"key":"-----BEGIN PGP PUBLIC KEY BLOCK-----\\n\\nxsBNBGTt9AcBCADXjt9OEXDQyE7w2veaHqTUN9fALt7c+cubz2nhWfmD07M1\\n5Spm3ScT/4HdlPpUBYnGUKlCT09g663RvvmDzp8442vZhfYeKbetrcNFxfnp\\n+ePQGiLDY0h2FmjQGkmZGP43ZLyhNT4eCIGPcPSpzaWAKw4wgE/tW2hli5m/\\n7e8HFno+bHp2ycNoPJpdqhY77CJL9zPqFdctCPxI5r1/+xkVLcf+NZ+vD7mz\\nq8xVpu3Tij5Jb5ShDPQ3qqPsqdCcB/fpnEtAOT/Ryuf5Qqic/bDrzImfaIO9\\nYmdnuc6uQBR1s8WbLHmOsQvJhe2D8MtggV5HwHbkPqxXBmpGIJnMeLHZABEB\\nAAHNAMLAigQQAQgAPgWCZO30BwQLCQcICZBvKHl019glPAMVCAoEFgACAQIZ\\nAQKbAwIeARYhBEyKE1gcoT4IIxerrG8oeXTX2CU8AADltgf/dREUaHmfMnwa\\nWwcoGxfya7xeSeqGLWoWsCDg55lq0rf59IFKw59AKL+4kKQrmVDW0x6oo844\\nxBv3NBq7OssNbRr4XYIXJN4oP8g0SdOYinTTcnHFjJcRHfTIa+lmlf7fwc7d\\n2DRW3Kyu66OGq9sLzcgI3Q4Fg3VOQGRDdVGF4zJGjPEpnHsJuGCVnbn5L94p\\nMZHEMIahYrYg2asglSByNUZIH+r0Y8rCzKp8rs37X/Q8RBrmW/oTnE/bb+xo\\n1jHgRR3MUs2Ea0oAqv/TwqpBRzMIWQ8tGKfEaJ22p02FJaE5q9KMbLp0mMIe\\nd33xGwOezLKoK5L9cHKg7wmz4sWvUs7ATQRk7fQHAQgApXcZbj43S5sr7v8d\\nq9JwcXkSdpRuzGw5zyauxUUElq2RLKPvsP8En+OJQceKWQcpvz16xLjnSoZI\\nfgIl1wXUaEb2T45rUrWmnoO+Csy2h6FePNmlHOerY2/C0GHQX3XP/B0t41By\\nG/o4losESsBaHEYugHIg5kXhgsGnlgoC3Bu4zHFmIvLlZXjCWYUG2JnhNHlG\\nrD67/Xuox1FO+Hh/rR7sSsWIH6S+SFgG/P4bwiW0JAYQP6bC4tbXfzvKJk2R\\ndeySnppEAwdn/3lCU5QscYIIUXSaPoV3Q6hg+wRigBk2ixkqdOTJmJROTOo3\\nUdnaeGSwP23USJIUncZWgcIokwARAQABwsB2BBgBCAAqBYJk7fQHCZBvKHl0\\n19glPAKbDBYhBEyKE1gcoT4IIxerrG8oeXTX2CU8AABx6Af/XRamjQ4T79rf\\nhNArQt3VuHvpIUP860MCg0aW5rMtZ8q4+TwOyjiEgOUIFx215Yprb3R3NTKV\\nQWJr8n++ZGDmQ8iro8nrRMRELmoEJzyWp3yr0dyr2lx01//bud+vVw+ARPLt\\nVUnX8eguLKRrltQmIRwCqX01PCTiN2RDB2Akd+zlBGRiHoavW9dDdGGBY9wW\\nA2Pyw73BeMzVA3akiGzLsdRIshO0DBALaX0G5ytqyIf3QjXOqO6C7gp9XW7R\\njXhRhzvR9NjZPmSXEeYqYw2CUPxzaLsKoSP4dbXE7Hl+sYJptzke7LE1StzH\\nG64gRgEYMCKvRZaPXYnPJXAZwDhijw==\\n=8aQd\\n-----END PGP PUBLIC KEY BLOCK-----\\n","signature":"DEPRECATED"}',
+ profilePicture:
+ 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAsklEQVR4AcXBQY0DMRBE0Z+SCRhCsBhGAJiAYQwBgzGmZuDk2pPDSKPsqt57zNfzTVKPxX+K0ciEmTATZqXuSRajkdVjkcVoXKnHIovRyOqeZMJMmAmzEurcUffkF6FOJsyEmTAr3BTqXKks7hBmwkyYFb7UPflLdU+yUCcTZsJMmBW+hDong5O6J1diNE7EJWEmzIRZqccii9G4Eur8oh6LTJgJM2H2mK/nGyNhJsyE2QfJZChdHLm7QQAAAABJRU5ErkJggg==',
+ threadhash: 'bafyreiewla5iyd7rnvjw2c5w6dbab4zkyf2desbowzouijoea2jzakxz6i',
+ wallets: 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562',
+ combinedDID:
+ 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562_eip155:0x84a9385e9b97df87b80c2e689997133703853874',
+ name: null,
+ groupInformation: null,
+ msg: {
+ fromDID: 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562',
+ toDID: 'eip155:0x84a9385e9b97df87b80c2e689997133703853874',
+ messageObj: [Object],
+ messageContent: 'Hello Alice!',
+ messageType: 'Text',
+ timestamp: 1693316103747,
+ fromCAIP10: 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562',
+ toCAIP10: 'eip155:0x84a9385e9b97df87b80c2e689997133703853874',
+ encryptedSecret:
+ '-----BEGIN PGP MESSAGE-----\n' +
+ '\n' +
+ 'wcBMA3d9z8TNUuddAQf/U2hMcybh5mUt9FFen5tfZ52PaB0vc2G+wYYIsBfu\n' +
+ 'zg58rgLy8uGMxvzhtCWhpIE91G62d8M4OmaDa+PLjs8SqyRoyih/9pt8P4cw\n' +
+ 'UJVHHDcJNC9r6/AV4aZySdz5u5utE7o3iB1FU0Sr9HEQsImmOM7J6LZJ3xWJ\n' +
+ 'V+o4ToLbqUFYKg2uY1kUXpyX+D6JRinagnAosh4zCICLUqrEkKNqbyV2mr+5\n' +
+ 'FK+fClWBGCwpf38L220FqHYPQ4bQXks0N07yW4OVjVpCTZVuNttr7PIEqcyZ\n' +
+ 'qIovbQbkltiDpsb/yYysEHTwBtvugna7xMW7SRY34x3iWm/HBNJmfBG7LnjI\n' +
+ '6cHATAMrTKobmmcFTAEH/20nW6aNzfj1vn/5GIWjZ5Z4Rw6G3Syt+0NxPUix\n' +
+ 'dpKIFOR0/BEJkafGMdlk/vRElsyluKbzykBlIQ0hHGRpGMNEW8s8GrJeiXvV\n' +
+ 'JSNZ24u5DDk8DIBaJWJnyWM7XzgcmOmn9rvVbvc9qgNNgtDeMIZwUpiDipnA\n' +
+ '++7n72h0JSs8dWFQ62FSf5ACHC0UVbPiL3TRrRBEo7vQp4JsJyXp70CUclqU\n' +
+ '3ANLvNhINV6GGtpXEKnsBVkkg35HR92nIzk+8HL86SsRUYfXkufzXdkPpmRn\n' +
+ 'SG7MoDecNf/bwoqP8/l2X2h3R1c+WTQFb6Z+eK/NsJ/AnSErFZh3yEHAi1Rz\n' +
+ 'yIXSQAEA2KupLnBVC9fqZqhUySvOW/Hs/hD6iEEGIl+U/RC9AwdG2jpg4sVi\n' +
+ 'f9PhBJ5Tanynb3aHngRKtIzjP5m223A=\n' +
+ '=5w+B\n' +
+ '-----END PGP MESSAGE-----\n',
+ encType: 'pgp',
+ signature:
+ '-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJk7fQHCZBvKHl019glPBYhBEyKE1gcoT4IIxerrG8oeXTX\n' +
+ '2CU8AACRLQf/bbeJoUNwRkJYz100R3ULO27HGjKnFeOaMZWRNF8JqWzNmCBL\n' +
+ 'Cj3aIBkDuCUj7avBsanScbSa7tD8Mc8PZgpSkd22nNH5iHiDJqlPtySJ2KoZ\n' +
+ '3ekVXfOgfLlHtN78ghTxABewYQRuB6kwtv3XQW8X9sCL2jEF4NIIl5eXZvIT\n' +
+ 'nhbHhhOR47k2E0hiHjPv2t3ggrwkrw6ISDgV8qYcrnf7vEFeGHpeSc25QLJH\n' +
+ 'pXCeeHhH7h4C9L3PEdMt8T+Ne36cfNiwTGdOavin/yfNES6k0kqZxP44hn1M\n' +
+ 'ZBk4jfyaDUh70mv4FtxdPcdb1TGQsPC1YYAIh/059EBqkdJFhVF4+A==\n' +
+ '=DBch\n' +
+ '-----END PGP SIGNATURE-----\n',
+ sigType: 'pgpv2',
+ verificationProof:
+ 'pgpv2:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJk7fQHCZBvKHl019glPBYhBEyKE1gcoT4IIxerrG8oeXTX\n' +
+ '2CU8AADsmwf/UpJCmnqztJLt1Ltg0OD7xoDvumitRwkfhnXzUdBWxM3i7vj4\n' +
+ 'cfjtcpQI2R5W0TXj9e2fymimIc98kjUqpDiUIaVAuD0OnEbJdIluGLBTJeks\n' +
+ 'YTRikqkgjFJT9Y6/2VRQj59IR0rgC0sec8mSKPlxuhixkdSS7Wec0+84cGmX\n' +
+ 'aieskReKeitKacYkU4Uf82Klc7Ft8+duBsaMGR3TS22PzHfYIHmy+8Z3b1SK\n' +
+ 'pMyJ8NBXCG2F+05WdoUsXBR+lO74RjSDWnWZlgRngWjjvSXQuZ/QznIyBVmQ\n' +
+ 'oOxJM5LSCCwH6ch5J/HmXudJG+3wsCINchvSQx0LntZUoeSp8cezvg==\n' +
+ '=KUqZ\n' +
+ '-----END PGP SIGNATURE-----\n',
+ link: null,
+ },
+ },
+];
+```
+
+| Param | Type | Remarks |
+| ---------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------- |
+| msg | `IMessageIPFS` | message object |
+| did | `string` | user DID |
+| wallets | `string` | user wallets |
+| profilePicture | `string` | user profile picture |
+| publicKey | `string` | user public key |
+| about | `string` | user description |
+| threadhash | `string` | cid from the latest message sent on this conversation |
+| intent | `string` | addresses concatenated from the users who have approved the intent |
+| intentSentBy | `string` | address of the user who sent the intent |
+| intentTimestamp | `number` | timestamp of the intent |
+| combinedDID | `string` | concatenated addresses of the members of this chat (for DM the 2 addresses and from Group the addresses from all group members) |
+| cid | `string` | content identifier on IPFS |
+| chatId | `string` | chat identifier |
+| groupInformation | `GroupDTO` | if group chat, all group information |
+
---
-### **To add speakers to space**
+### **Fetch Latest Chat**
```typescript
-const response = await PushAPI.space.addSpeakers({
- spaceId,
- listeners: [
- `eip155:0x65585D8D2475194A26C0B187e6bED494E5D68d5F`,
- `eip155:0xE99F29C1b2A658a478E7766D5A2bB28322326C45`,
- ],
- signer: signer,
- pgpPrivateKey: pgpDecrpyptedPvtKey,
- env: env as ENV,
-});
+// Latest Chat message with the target user
+const aliceChats = await userAlice.chat.latest(bobAddress);
```
-Allowed Options (params with _ are mandatory)
-| Param | Type | Default | Remarks |
-|----------|---------|---------|--------------------------------------------|
-| spaceId_ | string | - | space id |
-| speakers | Array | - | new speakers that needs to be added to the space. Don't add speakers which are already part of space |
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+| Param | Type | Default | Remarks |
+| -------- | -------- | ------- | ----------------------------------------------------------------------------------- |
+| `target` | `string` | - | Target DID ( For Group Chats target is chatId, for 1 To 1 chat target is Push DID ) |
- Expected response (add Speakers to space)
-```typescript
-// PushAPI_space_add_speakers | Response - 200 OK
-{
- members: [{
- wallet: 'eip155:0x4Be8cFD08B330853A530DEBB72a2DAf4d4F3D2Ba',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGSs51IBCAC+y8oXbU2YvfI7Z4xnSRfcPecRR+nO/XVLDbt30mbn1NU8\n' +
- 'wHSXcuHLJTuU9yJy1t9AMB2SY8n/YWMFbeNICF0OQVINkvFS+8Ec/F42IIlb\n' +
- 'StUY8rLS9pxTQoI3k1LnQKNL1krGiEuDl2ZT3l304aPGkF1sowu5w6xnzl/o\n' +
- 'nb6cgc48jVqIgqoVUCnEoxc3GKdSORm35nl0RBDasFdFPJctnpg2n7hLofU1\n' +
- 'RGOIzf/cITY7AE3nta0cqaFgNsO4rO0fXRwgDBAu66CtBG4Px2X8hT7IYMum\n' +
- 'XJtCis3KvrmQAOhWrbAwmWjHbkSDSYigd39rmlht21GKf0/kfoILBgRfABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZKznUgQLCQcICZDTsTetOyJa2gMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBHGBWhlF6JChmgQO7tOxN607IlraAADq/Af/XWeAagX5+JCX\n' +
- 'ChzadMaUtI6m2F7nT8sJcJep/a0Ldyz6kPmP9k6kmWO+QXJwl4FrP3e7HPer\n' +
- 'SjTeIWm0FJ2a+pRtF+lWk7xjIWJuZxbx79nOk98arde75fT+bebne1V0raUM\n' +
- 'gXPQIc60++okAPif6vJVLAaSMNbCkv8+Lsy0mJqsjY3b9iMVKWHKb8XVvTuN\n' +
- 'pobxVV4dLq53lrdNDIiwAWTlbxyuKLSEF4f+hIPJX3PAhquORinOubclUwTM\n' +
- '+kEmE6VI3pW4VL1VRi10cDI6ruEVwqOwQyYcp9gSDKXFR6ZXz7t0hjUUhl+3\n' +
- 'z6T7yqAjExW1O4tETVSbt3jg6DjaAM7ATQRkrOdSAQgArRRrLZees3xCYyBO\n' +
- '9WDzy7XCM2FxmaIJs/ibWwTtD1ZVoc9NKeOx07FYwGiYjigY6FxxJHdr20IQ\n' +
- '3xieIyBLZM2XAIXrsxq4M9GLG8R6nhd35BenjcvSGiZH1Rq0aXtFt9Fd7gc6\n' +
- 'E8XpMcHPH8KEnf66sPz18vrVCdstVU4Qj2ZjH25ilfeGdMj2HHfDxVN8sRhl\n' +
- 'AXAcwblQ+IVXGjuKw19T4zN874bcAaOmXfzxu3+2PtxVSR5uV03x1ln3ji+b\n' +
- '+GF8atJMMHCqE0FC/dEciS+BWSQtv0D93XWjzExJeyhd7Z+I3BG8JPuJT5Yj\n' +
- '4PxktEgwUxQc83JFFwED9knzyQARAQABwsB2BBgBCAAqBYJkrOdSCZDTsTet\n' +
- 'OyJa2gKbDBYhBHGBWhlF6JChmgQO7tOxN607IlraAABLdggAhe1KLjtHTsUI\n' +
- 'SR0K25EJ+9gXC7wmebve9wNZL22/Ud9hnyS77/VUmMNBgdPyhm/9ITMhVtTt\n' +
- 'rRNo1AzsVKDn3/dW1kc+nSribOufxzMoBM7Bm918Zt/0/7wCegz0bp3EAoQ8\n' +
- 'KEa2KPY9lSh2WtEDoA87D8JB1xwIfcR98vg5/AZ7VdtE88foSqXAm+6F85hz\n' +
- 'nAASNBO9CCDvUofR28b4exT/aWX0qZxLAukgH7fnYC3KPVv+9ug6mdyJPsOZ\n' +
- 'LFjF327UKLrBuQ6VRlfKF+XULJbtNPxckgwO1V/oxycq/M67acGoXgc2MgP/\n' +
- '2qOkbiQC0ZxcA+Ze5TNNhuGWKv6d9g==\n' +
- '=S9Ba\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isSpeaker: true,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA1UlEQVR4AcXBQU1FUQxF0f2bZ6gaIOkAC4yxUCRQHyRoqIo6wcJnesLgEgJJ17p9vDzeEe9vd046nZOo4eT59YYylhnLjGW3p8+HOwedzl9EDSfGMmOZsezim05HRQ2q0zmJGlSno6IGZSwzlhnLrk5HRQ2q01FRw0mno6IG1ekoY5mxzFh2RQ2q01FRw29EDarTUVGDMpYZy4xlV6ejogbV6aio4aTTUVGD6nSUscxYZiy7+KbT+U+dzomxzFhmLLv4QdSgnl9vHNWgOp0TY5mxzFj2BfKPPQUA5ipXAAAAAElFTkSuQmCC'
- }],
- pendingMembers: [{
- wallet: 'eip155:0x4d2eFB18383a48aCe19a198ae5228BB4bf854cec',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA9UlEQVR4AcXBoZHDMBCG0S87ZqEmooaiLmJJsNtwIyFuwzhERZgKmoqkhxz9HaCbmwP73u159w8iN0fVVFC5OT01FVRujqqpoIxgRjAj2JCbo6b1QE3LiDrpeywjF+vBRXOUEcwIZgQb+MW5zaiaCl3NUdN60GMEM4IZwYaaChfNUdN6cNGcnmk9UOc2o2oqKCOYEcwINuTmqJoKF835i3ObUTUVVG6OMoIZwYxgt+fdP4jHMqJe+xuVm9NTU0E9lhH12t8oI5gRzAg28OXcZlTeuKip0JObo06+7AVlBDOCGcFuz7t/6MjN+Y+aCj1GMCOYEewHE5pCbf3G8WQAAAAASUVORK5CYII='
- },
- {
- wallet: 'eip155:0x8E50Bfb57f803814c242c5a25890f5F0c13304fF',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA20lEQVR4AcXBsWkDQRCG0W+Gy53pkgVVsiXYFVx2rsANiCtEmQoxbCHmYBNd6gLW6aBgjDDmf89eXr8GiW6VqIxGplslKqORccQcMUdsWued6Ho/k+lW+Yt13okcMUfMEZt4sM470YUb0XYsZC6nG9HKTsYRc8Qcsel6P5PpVnnGdixEZTQyjpgj5ohNPOhWyZTRyHSrRN0qURmNyBFzxBwx+34rg0QZjahbJVNGI+pWyThijpgjNvGLbpWojEamW+UZjpgj5ojZx/vnINiOhf90Od2IHDFHzBH7AWIQNGL6hyehAAAAAElFTkSuQmCC'
- },
- {
- wallet: 'eip155:0xaA6E4434D881D2bDEea891AE127313AE5515a06B',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAyklEQVR4AcXBsZGDMABE0c8OqQPGZShzCdCCVNZVIhVAYrpQ6g48lMClkgMlBPve9HjtF0bCTJgJszmXykiKgTtyqYwIM2EmzOYUAyO5VO5IMTAizISZMJu/70rrOOmkGLgjl0prXegIM2EmzKbHa79o5FIZSTEwkktlJMVAS5gJM2E282Nd6Dy3QCuXykiKgdb3XRkRZsJMmE375++isS50jpNOioGRXCqtdaFznHSEmTATZjM/nluglUvljucWaOVSaQkzYSbM/gGGCDCC/3c1nwAAAABJRU5ErkJggg=='
- },
- {
- wallet: 'eip155:0xf6106dd699B6e40f1E822c38DDA459F533470b11',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAwUlEQVR4AcXBsU2DMRSF0S9XHoIFIipmIEW2sPQ6pmGEdJa8BYXXsOgYxKF9afzrr+45l++39uSEUGenrcoZwkyYCbPCgVAna6uyE+pkbVV2hJkwE2Yl1MnaqmT364Ps5/eLnfv1QRZzkIU6mTATZsKscCDm4IXYijk4Q5gJM2FWONDeb7yYbLX3G1nMwY4wE2bCrHAg5iALdbYmpwgzYSbMLh+ff0+MhJkwE2Yl5iALdXbaquyEOjttVTJhJsyE2T84uix63kKmNgAAAABJRU5ErkJggg=='
- },
- {
- wallet: 'eip155:0xAF3d4989652a6ED5554b6191c555525977424Cc9',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA3UlEQVR4AcXBsW3DMBCG0c8/tEMmUClkBDVaQAWHIKAZWHAGAxyChZDejbOCkcrDOO3ZxQlGENx7p4/t64Gj58JfpFbxiGAimAg2cOB6uWHNy4TnernxDhFMBBPBBl70XHg2YaVW8fRcsOalYKVWsUQwEUwEGziQWsXqueBJrWL1XPCIYCKYCHb6/vl8YKRW+U89FywRTAQTwQZebOOK53zf8Wzjim/CEsFEMBFs4MD5vmP1XPCktmNt44pHBBPBRLAhtYrVc+HZipXajmcbV6x5mbBSq1gimAgmgv0CTksv6eJNDqkAAAAASUVORK5CYII='
- },
- {
- wallet: 'eip155:0x2ccBeEf6e30dF46D0A7Ee79Bc66FBF3beA7EeA5A',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA00lEQVR4AcXBIW6AMBiG4XdfmnAYboLlCE3NFBLX4JB40hMsWM4x08OgNvsXUbMs//N8fH59/2DksfCfthqxhDPhTDgLvGw1Yq3nhLWnm571nLD2dNMjnAlnwlnIY8HaasQajplGpWs4ZhqVRh4LlnAmnAln4VkuGinSs54TXcdMz7NcWMKZcCachT3dWHksWM9yYQ3HTM+zXFj5oLGlG0s4E86Es8DLViONFLEyhZ493TQqXcKZcCacCWfCmXAmnAVe8lj4izwWerYasYQz4Uw4+wXktDHpzVVJlwAAAABJRU5ErkJggg=='
- },
- {
- wallet: 'eip155:0x65585D8D2475194A26C0B187e6bED494E5D68d5F',
- publicKey: null,
- isSpeaker: true,
- image: null
- },
- {
- wallet: 'eip155:0xE99F29C1b2A658a478E7766D5A2bB28322326C45',
- publicKey: null,
- isSpeaker: true,
- image: null
- },
- {
- wallet: 'eip155:0xa145b34443e28C8f718Cd0691Dc41A81E0d0A857',
- publicKey: null,
- isSpeaker: false,
- image: null
- }
- ],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJkrOdUCZDTsTetOyJa2hYhBHGBWhlF6JChmgQO7tOxN607\n' +
- 'IlraAAAqUQf9FvAtNouG7+2YSyyx7eiHRJZroDPFohH/F2xyc+oJkgh40p2y\n' +
- 'hyKw+DSp0FA+IiT95/y8RbGDUrNFz+/kdMfZWCEYFim3Cy+c5k1/YNc8qxx6\n' +
- 'VLwef+2YZepC1pSS9K0zbu04uVPWrNmDa5lHXqzTx/mOxWlxLD0NfpI60csE\n' +
- 'iQx57duy2gMeW9MwOKSFjOSnWHKy7AySm/vBwZ9Rj4gnOhsvwbAfLprQQf4G\n' +
- 'cUaxG/HOb0c/8Ugews0Z1uDJFmGKjT5R5CR63vPo5qDGQwWkm+LYpshCIV+K\n' +
- 'ofLepDqQRuEFa7VyUlDOvMcF15LtlvAhwhkIVHvTGjXZC91e8/IUsQ==\n' +
- '=UpR2\n' +
- '-----END PGP SIGNATURE-----\n' +
- ':null',
- spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- spaceName: 'weird_moccasin_alligator',
- isPublic: true,
- spaceDescription: 'equivalent_blue_armadillo',
- spaceCreator: 'eip155:0x4Be8cFD08B330853A530DEBB72a2DAf4d4F3D2Ba',
- spaceId: 'spaces:d37c4e303a2ff194e546d3af94353ec829324a578ebffbeadebd1ba91ab88548',
- scheduleAt: '2023-07-15T14:48:00.000Z',
- scheduleEnd: '2023-07-15T15:48:00.000Z',
- status: 'PENDING'
-}
+ Expected response
+
+```typescript
+[
+ {
+ link: 'bafyreibfikschwlfi275hr7lrfqgj73mf6absailazh4sm5fwihspy2ky4',
+ toDID: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a',
+ encType: 'pgp',
+ fromDID: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d',
+ sigType: 'pgp',
+ toCAIP10: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a',
+ signature:
+ '-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBQJjh5tjCRBaJmgmByp5FRYhBJC23yBJT2d/pTAID1omaCYH\n' +
+ 'KnkVAAAZmwf/buPLw6caSZmYnw6D3/p6HF1kWlkGUOTP4RasaU/6dkeDaZs9\n' +
+ 'SJlz2wC8oOpBGWHMJ/5n3ZWmU71E6U7IKIY793MyIv5t32vTNkwsRHUX7IIn\n' +
+ 'QFF+FzTIEtHHVTRlnkqNR2YUk1kqcpZCZWHfahi5W2d/WkXlFNdvyyFH4W8L\n' +
+ 'd03FGhOyXbWwU3xicBz5mSBpIFaaSCXl1SdgJDPXLSk3b65EEOjCOaiz85xC\n' +
+ 'G+6SW4RUzCGSDcOd9F2EXvvY5H9LgQNi1jjlZn6JrPTPJTJ+wXZXzcZmtOXG\n' +
+ 'EKcwvPbbPY9wd+gavRSOgYLYn5xoZQW/o3hW7AQlbC5Kj6js48Z0HQ==\n' +
+ '=qLiJ\n' +
+ '-----END PGP SIGNATURE-----\n',
+ timestamp: 1669831523684,
+ fromCAIP10: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d',
+ messageType: 'Text',
+ messageContent: 'Hi',
+ encryptedSecret:
+ '-----BEGIN PGP MESSAGE-----\n' +
+ '\n' +
+ 'wcBMA1fn1CNqxQ7nAQgArlo75qe54WerfRKFv1+F9j4NRMvSTgUztvIe51eg\n' +
+ 'd5MVuj6RYxKERr2bTuBt5cMDJMlNuTnBBkPe4L8+SlsI46L9wmXV9xLoZq1a\n' +
+ '94JdxD98RGMF99Jde/3hC/X6GS1yVqPpKPKdWx/tkOPeyqeO/wFF7kqShgIi\n' +
+ 'Wgq6hGz1fzD3GZhKGY0VSLuC3s0aUy/qw5En1Xd0uX0jdXBl07IIj8p1G2zx\n' +
+ '9BuVlksSK34yvIc0RQfCeRadMHkxbA0Hyj31Wrr+Y310YLTppL0s5bQR9APL\n' +
+ 'WHsIztJ1fHTnXsPhnA7YG0SQpHTyJhuX3rgBjxGrvbZBArmZ+R/Pq9IkOkJe\n' +
+ 'z8HATAMOsbaZjGN5JwEH/jYjLN6AFRWeaB5CSBSAF+CvHsUgadGmxTdSHBM6\n' +
+ 'LM9rfGg/MCnpRBuHckA0NNZh+wepq6TDA54ZopsdP14gHj4MKCdfqZr86Jft\n' +
+ 'ldtjeSgPTFEEJxPMJ4/Z3UeFU9rvOgfxX6l0eHWS0MYwJ3sVYvSyqqHir1K5\n' +
+ 'TRdEIgtQ3NvLTKkX4bKTSU+SInrvDA+wsc2BcBsbgNhRiGb+XYrbqXBshL1a\n' +
+ 'lIdpnomkAQgOZMO2n347uURYoruH3OtFeNABJ9D/nEU+LdhDOPGZPefvPBc5\n' +
+ 'BxK4ExKZ2Wo/TZw8lgC53uqOljsGV63Hp71LkyesKWu5/+vdVrYx/vU63shh\n' +
+ 'x/TSQAEiaFYEfkWSOthtH0nrJHhkY7FWgjp/1bj/J4J9HCQrVtt2WlQfhowZ\n' +
+ 'ILxhKk/vep0sJviM3SfJ4hPtoYpZESc=\n' +
+ '=43Ta\n' +
+ '-----END PGP MESSAGE-----\n',
+ },
+];
```
+| Param | Type | Remarks |
+| ----------------- | -------- | ------------------------------------------- |
+| `fromCAIP10` | `string` | sender address |
+| `toCAIP10` | `string` | receiver address |
+| `fromDID` | `string` | sender did |
+| `toDID` | `string` | receiver did |
+| `messageType` | `string` | message type |
+| `messageContent` | `string` | message content |
+| `signature` | `string` | signature of the message |
+| `sigType` | `string` | signature type |
+| `link` | `string` | content identifier of the previous messages |
+| `timestamp` | `number` | timestamp of the message |
+| `encType` | `string` | encryption type |
+| `encryptedSecret` | `string` | encrypted secret |
+
---
-### **To remove speakers from space**
+### **Fetch Chat History**
```typescript
-const response = await PushAPI.space.removeSpeakers({
- spaceId,
- speakers: [
- `eip155:0xB12869BD3a0F9109222D67ba71e8b109B46908f9`,
- `eip155:0x2E3af36E1aC6EEEA2C0d59E43Be1926aBB9eE0BD`,
- ],
- signer: signer,
- pgpPrivateKey: pgpDecrpyptedPvtKey,
- env: env as ENV,
-});
+// Chat History with the target user
+const aliceChatHistoryWithBob = await userAlice.chat.history(bobAddress);
```
-Allowed Options (params with _ are mandatory)
-| Param | Type | Default | Remarks |
-|----------|---------|---------|--------------------------------------------|
-| spaceId_ | string | - | space id |
-| speakers | Array | - | existing speakers that needs to be removed from the space. Don't add speakers which are not part of space |
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
+| Param | Type | Default | Remarks |
+| ---------------------- | ------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------- |
+| `target` | `string` | - | Target DID ( For Group Chats target is chatId, for 1 To 1 chat target is Push DID ) |
+| `options` \* | `object` | - | Optional Configuration for fetching chat history |
+| `options.reference` \* | `string` or `null` | - | Refers to message refernce hash from where the previous messages are fetched. If null, messages are fetched from latest message |
+| `options.limit` \* | `number` | 10 | No. of messages to be loaded |
+
+\* - Optional
- Expected response (remove Speakers to space)
+
+ Expected response
```typescript
-// PushAPI_space_remove_speakers | Response - 200 OK
-{
- members: [{
- wallet: 'eip155:0x5908D89B1390ec5833001b86302B868A808D506D',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGSs6YABCADC4ldJKGpZ0Z+JJwA1t/1JWp5+dnR98nr7RHPX8eEGxIhL\n' +
- 'gtx5TZmek2BcGzNcg66+GEyC4np9USaCZ4/YC9ZMLw8BQKzhOcd3ZILyGtGV\n' +
- 'BijBNwjPIbQcy5/cXVtfKCvf303BDYddPYuJ1xFAh7kpvhcR4a72CSpeyEjM\n' +
- 'UndteAVTIxqwdpnXIdqpwu6HrSJ089GpHV+XeaDo4Uhg+iHJsCRJy2VJ5m61\n' +
- 'CwGx55f3ror6rAXQd+hEx+keLxYINNJLLvfvE9IGsIbKRFZx+emjXQZusbJp\n' +
- 'zXYhJnEeHPLVDjWhzo8Q3/4gvOz8m6a+A9sl49sqodLdxVlXQ7d4CuylABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZKzpgAQLCQcICZCaDezdj8j4SwMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBGZpOFBNtTj1Oqt695oN7N2PyPhLAACCLgf/dB412nDRcOxR\n' +
- 'dNSj2AYknJ+NKeX38KuksyR6wypnaJWpapmIeZCfFjeoBjuBCPd6unvN/IlZ\n' +
- 'zPwl66lO5GKJxDaDd1/infxM/dbtFQSESLXlweRLQ/v1+plsntrBUyvbY4uH\n' +
- 'Mh9PImYsLY+zo8P5mpBV5AGAMA6R9qmu3axH/MnKVdB0Ky6C/jP+7lPs/QVT\n' +
- 'qsISyyI1E9E6Oivzxmao1axfXLdEvICHb6uD0R4p5SUVqHJX41OwM8BFevhK\n' +
- '07Hi+c7NhUWp0sxXEOs6dneJZwerCD3EahutpP1Oyt5T8MZitysn2yJ+s5ks\n' +
- 'SZza+x8OmCMcMZfZnIsJNnIUvPboP87ATQRkrOmAAQgAteDgsJJ0ftPD+P15\n' +
- 'rKgkLuSCD2iwQgm2k8/ZDaXJBsdm4sJYTt2y0ckx7MRpXgLuIyidOGctqVL6\n' +
- '/Rl2Hfl30JQPok5cYmYLENVuFz94MEvgDOo8jacyfPdLGPMWZMLRojyM/Yvs\n' +
- 'nhDZ8if3zEstP4h3HcpdT+PWSmsJWjrq57la4vKbfILtKfTBaf8sibm5UuZA\n' +
- '5Y/SIPxfVC+ybCPAjo4tpDYP901V+wxXDJ8BlZ4AaVvk20MYMzuAjBna+iwD\n' +
- 'f0j4CccEabd2EVtAQQcMCg2yTjOT22Dt0jfpDuohDNaXDhX2ZQlJIdlSLCEI\n' +
- 'a3c7g+uU9bnNqt7LHPgMzLYKnwARAQABwsB2BBgBCAAqBYJkrOmACZCaDezd\n' +
- 'j8j4SwKbDBYhBGZpOFBNtTj1Oqt695oN7N2PyPhLAAD2vQgAu9+sd4AT5b6c\n' +
- 'mWOaQBXz2XVfJXYQFNlBdOF23reycF9r7vDAKSRpeyMSyOfRAi0qdLynQ1dN\n' +
- 'MXV/gfO0G9dzFu513P/Y1sZxQi0uLRKL9hMcgEQ8FLo8/PGfVcoLfQASryGj\n' +
- 'Z8ybCFqiXocGpt2VkkK4wwgv+ZwZ8M1ubz0Boby6A1/kTYs/6ll+QekpB4ao\n' +
- 'kJKw3DWvVNR/xODFfMQcClvzAtqwfxhTZXBMbZ4vAG5m1ExGmA15cGXrAfwV\n' +
- 'nR2vOhPYDeZGbBKktM3xfDts75N2NF/TBpvazV2DTKpkLqvVitFHWvSMMpVd\n' +
- 'dwk9tEOmBlj2AoYATvQ9kKHRTD27Wg==\n' +
- '=IXzf\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isSpeaker: true,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA1klEQVR4AcXBoXHEMBRF0Zs3oqpHNYgJecZdGKYMd5GZRWaCwaohZbiAhP5d8HeC3jkfnz/fvwSTRua+DjJ1nGQ6i0iYCTNhVnjRWUSTRlTHyX90FhlhJsyEWeHFpJG5r4NMHSfRpBF1FpEwE2bCrPDGfR1E29jJPK6DqI6TjDATZsKsTBqZOk6iSa6ORmbSiISZMBNmpbOIHtcXUR0nUWeRmTSi+zqItrETCTNhJswKL7ax82wRTRqZzuLJ2MkIM2EmzApvTBpRZ5GZNKLOIiPMhJkw+wPV2i2sD43hKwAAAABJRU5ErkJggg=='
- }],
- pendingMembers: [{
- wallet: 'eip155:0xC1469cB7b59d16dC887D4C11faB3E3C0abBeA12C',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA30lEQVR4AcXBsWnFMBSG0e9dBAGDPUs6LeAFNIEb1x5GtRtDei3gBQzZIFtYYEj10t73CkFw8Z/z+Pj+euJs14iXlsodJfd4U7fjGWKGmCEWzjnilUzTsB60nHOk5ZwjniFmiBligTdTt+MlIt52jbRVvKnb8RIRzxAzxAyxx+/nzxMhQ8wQM8RCyT0taancUXJPiyFmiBligTdTt+NNKy/OOdIyrAct2zXiGWKGmCEW0lJ5kUe8tFT+45wjXsk9XloqniFmiBliYVgPvHOOeCX33JGWijesB54hZogZYn8uFTTKoy9pgwAAAABJRU5ErkJggg=='
- },
- {
- wallet: 'eip155:0xccF7a3131E0E73F83Bc457C27494411a57f23248',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA9ElEQVR4AcXBIWoEMRSA4X8fw6qayBW9zULVEBFygLqcqMwdhlBCbKjqXSLjY7b2UZEVpbzvu3x8vT5QShhoqUa0Yz9ZSTWiHfuJ5rNDE4wJxgRjl8/v9wdKn43/dLve0QRjgjHB2NZnQ7td72h9NrQSBis+O7Tb9Y7WZ0MTjAnGBGMbv/TZ0EoYaD47VkoYaD43VgRjgjHB2MYTqUa0Yz9ZSTWi9dlYEYwJxgRjlzf38kDx2aGVMNBSjawc+4nms0MrYaAJxgRjgrGNJ1KNaH02VlKNaH02VgRjgjHB2OazQythoKXKn5Qw0Hx2aIIxwZhg7Ae2cUcV4Bl8pAAAAABJRU5ErkJggg=='
- },
- {
- wallet: 'eip155:0x052aD82D3a7b4DAb5b9BcFED771D28703a6faadf',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAy0lEQVR4AcXBoXFDQQxF0RtlkZsQNjHICKYYV7DFCAW6II2BycfbhklCNR/sTNA75+Pn+/MXIUPMEDPEBifhSVdr0oUnO7UmXXjS1Zp0hpghZogZYoaYIWaIDU5qTbrwpHtfnuyEJ12tyY4hZogZYiM86WpNdl7Hg53wL3bCk84QM8QMscFJeNLVmnS3652dOiZdeLJjiBlihtioNenCky486eqY7IQnO7UmnSFmiBliIzzpak262/XOf7wvT7rX8aALTzpDzBAzxP4AMOQyARcWaToAAAAASUVORK5CYII='
- },
- {
- wallet: 'eip155:0x956f73E5a3BF0D19299BF74bD6dc819D7f775eC7',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA20lEQVR4AcXBsYnDMBiG4dc/nsHgHeJWS1x7G6QzqNQUKlUHLn12ONdqNYTBS/ja/xqBCeF7nmFbbydODoVPSjXiGWKGmCE2Pu8vvPT45pOe9xeeIWaIGWLj0Xa8HAo9qUZ6cih0tR3PEDPEDLFhW28nTg4FL9XIO3IoeKlGPEPMEDPEhq+f3xNnWmZ6jrbTMy0zPUfb8QwxQ8wQG6dlxjvajpdq5JLKPzkUvGmZ8QwxQ8wQG4+246Ua8XIovCPViJcpeIaYIWaIDdt6O7kgh0JPqpErDDFDzBD7AzabOPmHFg/aAAAAAElFTkSuQmCC'
- },
- {
- wallet: 'eip155:0x19da526eD1a57E07D48aa25aDa6cbA7E41FF3129',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAyUlEQVR4AcXBsY1CQQxF0cvTFEHuNn4jxB6JJggpw5Mh/UZogmByumBTi2DQahf5nMN2vr1IjvtG1ufgL8Kc7Hm6k4liopgo1i7XB1nsG990uT7IRDFRTBRrfBDmZH0OVsKc3xDFRDFRrPFBn4MszFnpc5CFOSuimCgmih228+1Fctw3vul5upOJYqKYKNaO+0bW5yALc7I+BythTtbnIAtzMlFMFBPFGm/CnP8U5qyIYqKYKNZ40+dgJcxZ6XOwEuZkopgoJor9AIckL2mEiBQrAAAAAElFTkSuQmCC'
- },
- {
- wallet: 'eip155:0x77059B40Ec974883b98a23eef519b4076D1Cf9F1',
- publicKey: '',
- isSpeaker: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsY0CMRRF0cuTQ6rYaQFiAvdBYMkFkFEAwWYTryxZ2kIcEE8N1MKmH4JJRuw7Z/d7uD0JRu1EuRW2GLUT5VaIhJkwE2a788/XEyNhJsyEWcqtEI3a+aTcCpEwE2bCLI3aia77E9EyT2xxvDyIvmsnEmbCTJgl3izzRDRqJ8qtsGbUzou58KLeiYSZMBNmKbfCf8qtEAkzYSbM0qidTxq1s0aYCTNhlq77E9EyT2yRW2HN8fIgEmbCTJj9AUPBKWCCQlIAAAAAAElFTkSuQmCC'
- }
- ],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJkrOmCCZCaDezdj8j4SxYhBGZpOFBNtTj1Oqt695oN7N2P\n' +
- 'yPhLAAD+iwf/dvaRCTwXKGH6iUe49NpyTHMaD6ZwaLerk+K4Ojehbdoo0mDf\n' +
- 'aOu/MR8wfqk49h2436rcMmyeM5avcMgmtGUmIdy/6hCZ6zxR/3E5t/vq5UfO\n' +
- '3YFO1VLghR5cTYqR9bMLFkvvCB4P29rnaok2QVKTBZLfyAM4wu1h2DDBESoz\n' +
- 'SS+ZtQLPz6/y7gOQobO0zbwBPmy8MpVVu1wxht+sneOMvZX+5al679nQbwNL\n' +
- 'oCcU3UKrlqMhuFgMTCKx99VLcc4JbhBf2M+IHf78NtQ9mcQC/X+gxRfp6f+p\n' +
- '2RePQzkmUH5vqXjzcUsNBWJPOyjl09/IZWWwaeiUjsPazjxqDtYNHg==\n' +
- '=H4X4\n' +
- '-----END PGP SIGNATURE-----\n' +
- ':null',
- spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- spaceName: 'sheer_ivory_ox',
- isPublic: true,
- spaceDescription: 'specific_green_alpaca',
- spaceCreator: 'eip155:0x5908D89B1390ec5833001b86302B868A808D506D',
- spaceId: 'spaces:bc96011f182e2c86ad68aaf4c95c4a916c808088370cb0ba294f9168e2ff6328',
- scheduleAt: '2023-07-15T14:48:00.000Z',
- scheduleEnd: '2023-07-15T15:48:00.000Z',
- status: 'PENDING'
-}
+[
+ {
+ link: 'bafyreibfikschwlfi275hr7lrfqgj73mf6absailazh4sm5fwihspy2ky4',
+ toDID: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a',
+ encType: 'pgp',
+ fromDID: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d',
+ sigType: 'pgp',
+ toCAIP10: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a',
+ signature:
+ '-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBQJjh5tjCRBaJmgmByp5FRYhBJC23yBJT2d/pTAID1omaCYH\n' +
+ 'KnkVAAAZmwf/buPLw6caSZmYnw6D3/p6HF1kWlkGUOTP4RasaU/6dkeDaZs9\n' +
+ 'SJlz2wC8oOpBGWHMJ/5n3ZWmU71E6U7IKIY793MyIv5t32vTNkwsRHUX7IIn\n' +
+ 'QFF+FzTIEtHHVTRlnkqNR2YUk1kqcpZCZWHfahi5W2d/WkXlFNdvyyFH4W8L\n' +
+ 'd03FGhOyXbWwU3xicBz5mSBpIFaaSCXl1SdgJDPXLSk3b65EEOjCOaiz85xC\n' +
+ 'G+6SW4RUzCGSDcOd9F2EXvvY5H9LgQNi1jjlZn6JrPTPJTJ+wXZXzcZmtOXG\n' +
+ 'EKcwvPbbPY9wd+gavRSOgYLYn5xoZQW/o3hW7AQlbC5Kj6js48Z0HQ==\n' +
+ '=qLiJ\n' +
+ '-----END PGP SIGNATURE-----\n',
+ timestamp: 1669831523684,
+ fromCAIP10: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d',
+ messageType: 'Text',
+ messageContent: 'Hi',
+ encryptedSecret:
+ '-----BEGIN PGP MESSAGE-----\n' +
+ '\n' +
+ 'wcBMA1fn1CNqxQ7nAQgArlo75qe54WerfRKFv1+F9j4NRMvSTgUztvIe51eg\n' +
+ 'd5MVuj6RYxKERr2bTuBt5cMDJMlNuTnBBkPe4L8+SlsI46L9wmXV9xLoZq1a\n' +
+ '94JdxD98RGMF99Jde/3hC/X6GS1yVqPpKPKdWx/tkOPeyqeO/wFF7kqShgIi\n' +
+ 'Wgq6hGz1fzD3GZhKGY0VSLuC3s0aUy/qw5En1Xd0uX0jdXBl07IIj8p1G2zx\n' +
+ '9BuVlksSK34yvIc0RQfCeRadMHkxbA0Hyj31Wrr+Y310YLTppL0s5bQR9APL\n' +
+ 'WHsIztJ1fHTnXsPhnA7YG0SQpHTyJhuX3rgBjxGrvbZBArmZ+R/Pq9IkOkJe\n' +
+ 'z8HATAMOsbaZjGN5JwEH/jYjLN6AFRWeaB5CSBSAF+CvHsUgadGmxTdSHBM6\n' +
+ 'LM9rfGg/MCnpRBuHckA0NNZh+wepq6TDA54ZopsdP14gHj4MKCdfqZr86Jft\n' +
+ 'ldtjeSgPTFEEJxPMJ4/Z3UeFU9rvOgfxX6l0eHWS0MYwJ3sVYvSyqqHir1K5\n' +
+ 'TRdEIgtQ3NvLTKkX4bKTSU+SInrvDA+wsc2BcBsbgNhRiGb+XYrbqXBshL1a\n' +
+ 'lIdpnomkAQgOZMO2n347uURYoruH3OtFeNABJ9D/nEU+LdhDOPGZPefvPBc5\n' +
+ 'BxK4ExKZ2Wo/TZw8lgC53uqOljsGV63Hp71LkyesKWu5/+vdVrYx/vU63shh\n' +
+ 'x/TSQAEiaFYEfkWSOthtH0nrJHhkY7FWgjp/1bj/J4J9HCQrVtt2WlQfhowZ\n' +
+ 'ILxhKk/vep0sJviM3SfJ4hPtoYpZESc=\n' +
+ '=43Ta\n' +
+ '-----END PGP MESSAGE-----\n',
+ },
+ {
+ link: null,
+ toDID: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d',
+ encType: 'PlainText',
+ fromDID: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a',
+ sigType: '',
+ toCAIP10: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d',
+ signature: '',
+ timestamp: 1669831499724,
+ fromCAIP10: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a',
+ messageType: 'Text',
+ messageContent: 'Hey Fabio!',
+ encryptedSecret: '',
+ },
+];
```
+| Param | Type | Remarks |
+| ----------------- | -------- | ------------------------------------------- |
+| `fromCAIP10` | `string` | sender address |
+| `toCAIP10` | `string` | receiver address |
+| `fromDID` | `string` | sender did |
+| `toDID` | `string` | receiver did |
+| `messageType` | `string` | message type |
+| `messageContent` | `string` | message content |
+| `signature` | `string` | signature of the message |
+| `sigType` | `string` | signature type |
+| `link` | `string` | content identifier of the previous messages |
+| `timestamp` | `number` | timestamp of the message |
+| `encType` | `string` | encryption type |
+| `encryptedSecret` | `string` | encrypted secret |
+
---
-### **Fetching list of user spaces**
+### **Send Message**
```typescript
-const spaces = await PushAPI.space.spaces({
- account: string;
- pgpPrivateKey?: string;
- /**
- * If true, the method will return decrypted message content in response
- */
- toDecrypt?: boolean;
- /**
- * Environment variable
- */
- env?: ENV;
+// Alice sends message to bob
+const aliceMessagesBob = await userAlice.chat.send(bobAddress, {
+ content: 'Hello Bob!',
+ type: 'Text',
});
```
-| Param | Type | Default | Remarks |
-| ------------- | ------- | ------- | ---------------------------------------------------------------------- |
-| account | string | - | user address (Partial CAIP) |
-| toDecrypt | boolean | false | if "true" the method will return decrypted message content in response |
-| pgpPrivateKey | string | null | mandatory for users having pgp keys |
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev' |
+| Param | Type | Default | Remarks |
+| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------- |
+| `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 ) |
-**Example normal user:**
+\* - Optional
-```typescript
-// pre-requisite API calls that should be made before
-// need to get user and through that encryptedPvtKey of the user
-const user = await PushAPI.user.get({
- account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7',
- env: ENV.STAGING,
-})
+
-// need to decrypt the encryptedPvtKey to pass in the api using helper function
-const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: signer);
+ Expected response
-// actual api
-const spaces = await PushAPI.space.spaces({
- account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7',
- toDecrypt: true,
- pgpPrivateKey: pgpDecryptedPvtKey,
- env: ENV.STAGING,
-});
+```typescript
+{
+fromCAIP10: 'eip155:0x84a9385e9b97df87b80c2e689997133703853874',
+toCAIP10: 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562',
+fromDID: 'eip155:0x84a9385e9b97df87b80c2e689997133703853874',
+toDID: 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562',
+messageObj: 'U2FsdGVkX1/S1wljx7jN0NXJzSNoJCkg/6cw7gHwVibLsqyhpe/XgzJi7OUrXwUh',
+messageContent: 'U2FsdGVkX19oSSMVZpQdw+jZRExfd1GvJkIwgWAGe5g=',
+messageType: 'Text',
+timestamp: 1693316104031,
+encType: 'pgp',
+encryptedSecret: '-----BEGIN PGP MESSAGE-----\n' +
+ '\n' +
+ 'wcBMAytMqhuaZwVMAQf+KkUcX1rmNnorm0bCeGPknnjMBFn2wQ4nIAbQV5cW\n' +
+ 'W7bCHneK0V0+kpronJwuPb8e8GUZiJEmJGdTJYf3XMVP8sJkVVVQEbvYvAJL\n' +
+ 'tUEsdqgqRuqGB+u4k5shtlHN1ViTjjc1N97C0eQUqTCVFKa1Ul9eZirhDqiI\n' +
+ 'C/rj8uxESy+NH7o/nnbGTlwQonOOLLHfGH2zCpl/F59CO2CcLnuecfDT0WxJ\n' +
+ 'xi2hM/ovKgbsKVI8WOOde0sIV3MQEvxAFuPJ8gINpoDA28Ty+lf7x1bN9ONN\n' +
+ 'RZl4yjLpA7KUojWyfjp1/UW635NY11aZYEXIygDppCCvf6AE7je+1FDaVR/B\n' +
+ 'I8HATAN3fc/EzVLnXQEH/1H4r6FubywzPzRlDJzPgxyNpNGPZbexrWRQT5U4\n' +
+ 'eHmh7EsOfEattUCHb8zChL8crnX0CCw9MiN/ryfs9PXXK2qP3lFU59GUHd9q\n' +
+ 'Mz3RQwF76M9C8zbsoUymIPXUypBBma/qsF8MK54qYoVPody6T3u7bEfW6E8r\n' +
+ 'nDtlz62+G6wk4sNE7iJsk6KhGmb1t9v/j1qgmJwuE7zGP0QjSuquJsfkzUot\n' +
+ '1eU85XnUTGdoYBR2u5F2TsjIHn1ex2R0sZYfdc9eRNSSvDHrce9m7R5p7Y5F\n' +
+ 'sSs96Skx7wLuepGt/vY2cH9Mq3AEGaXREV2NSr453+gHeTupp3aIiQ2CDpFB\n' +
+ '/MzSQAHCPW1DUf8r1cFE1Y1RXU15gNBeFju/ZBnpDlTbj3xXi0shafcl59pe\n' +
+ '0LTGhdDSYPX0Rs6zqJgex20XBnfgPD0=\n' +
+ '=ycNl\n' +
+ '-----END PGP MESSAGE-----\n',
+signature: '-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJk7fQICZASd4ccCgkrMhYhBGLo0VO3qtKBG9Y0eBJ3hxwK\n' +
+ 'CSsyAACktggAr3mI2uwn4m4sI7m8A8wIRgjs6h8V7d2feLsdqV7QL6aUzYld\n' +
+ 'bewZYKQjSXdnklRtnlCIG1jmqFOCycv++3O5jcWY+du8lR912Gkjn0PDN/wW\n' +
+ 'jSBDTkH0IKmIrYqIDnfbxYoUfUxAWXzm8N0LgVnA+qgs1CYzcS8S38zAONvH\n' +
+ 'GBl8ZXNTgY5HYN3Pk74wms5jhBF1J7mtfMCNN8k7VHFaoC6YVF1REhwrSlxx\n' +
+ 'l4bajYkJJMWfKdiQWQ31kSHChzKXBhu2rIWJ6A7ijyoc7Ff0s4xgwm/3cLQc\n' +
+ 'hrlBpkMKI2xCDnP10Sr1sgmG7ropd+tCOFwsoEWqFqt+kJ592+g1mw==\n' +
+ '=TVDb\n' +
+ '-----END PGP SIGNATURE-----\n',
+sigType: 'pgpv2',
+verificationProof: 'pgpv2:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJk7fQICZASd4ccCgkrMhYhBGLo0VO3qtKBG9Y0eBJ3hxwK\n' +
+ 'CSsyAAA8/Qf/Qvcom0DtPUQAOWkM+FCeBttjkCiM/ekZa1Gxioyy7jT0Baoi\n' +
+ 'oUi8y4BpmjKjCvUGCDovcvvnjeLW8gpqunN/LOx1c4mPsgFTU0IQFqZmTtZK\n' +
+ 'KMa+p/uiTXNnwx9635FV8WLOWQoyJP+u76rTu8n2YU1+5+N7xan9Wl+yuu4d\n' +
+ '/WkFwAq/WQjW4cgIZ08OWfNGaOh6kt3ceCvR25XVbb8gdMPOj262d7RuWVqs\n' +
+ 'L31XJ8U/EkKZN5AxIB7AP6HKhZhlV6qbgizVFskWefT4E3Qq+9WLn4ApHf2R\n' +
+ 'OksjHVbukZNbXrWeMjbZE9RlswPCXM68WsxWe1zItjXs63w1mwoQZg==\n' +
+ '=e9QO\n' +
+ '-----END PGP SIGNATURE-----\n',
+link: 'bafyreiewla5iyd7rnvjw2c5w6dbab4zkyf2desbowzouijoea2jzakxz6i',
+cid: 'bafyreibhnilz634i55hdkrkp3j4vt76dnyegvmrezdiuykeizq7unvx7cy',
+messageCategory: 'Chat',
+messageOrigin: 'other'
+}
```
-**Example NFT user:**
+| Param | Type | Remarks |
+| ------------------- | -------- | ------------------------------------------- |
+| `fromCAIP10` | `string` | sender address |
+| `toCAIP10` | `string` | receiver address |
+| `fromDID` | `string` | sender did |
+| `toDID` | `string` | receiver did |
+| `messageObject` | `string` | message obejct |
+| `messageContent` | `string` | message content ( deprecated ) |
+| `messageType` | `string` | message type ( deprecated ) |
+| `timestamp` | `number` | timestamp of the message |
+| `encType` | `string` | encryption type |
+| `encryptedSecret` | `string` | encrypted secret |
+| `signature` | `string` | signature of the message ( deprecated ) |
+| `sigType` | `string` | signature type ( deprecated ) |
+| `verificationProof` | `string` | message verificationProof |
+| `link` | `string` | identifier of the previous messages |
+| `cid` | `string` | identifier of the message |
+| `messageCategory` | `string` | Category of message ( `Chat` or `Request` ) |
+| `messageOrigin` | `string` | `Self` or `Other` depending on the receiver |
-```typescript
-// Fetch user
-const user = await PushAPI.user.get({
- account: `nft:eip155:${nftChainId}:${nftContractAddress}:${nftTokenId}`,
- env: env as ENV,
-});
+
-// Decrypt PGP Key
-const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({
- encryptedPGPPrivateKey: user.encryptedPrivateKey,
- signer: nftSigner,
-});
+---
-// Actual api
-const spaces = await PushAPI.space.spaces({
- account: `nft:eip155:${nftChainId}:${nftContractAddress}:${nftTokenId}`,
- toDecrypt: true,
- pgpPrivateKey: pgpDecrpyptedPvtKey,
- env: env as ENV,
-});
+### **Accept Chat Request**
+
+```typescript
+// Accept Chat Request
+const bobAcceptAliceRequest = await userBob.chat.accept(aliceAddress);
```
+| Param | Type | Default | Remarks |
+| -------- | -------- | ------- | ----------------------------------------------------------------------------------- |
+| `target` | `string` | - | Target ( For Group Chats target is chatId, for 1 To 1 chat target is Push Account ) |
+
- Expected response (Get spaces of a specific user)
+
+ Expected response
```typescript
-// PushAPI_space_spaces | Response - 200 OK
-// Array of spaces
-[
- {
- spaceId:
- 'spaces:3aa43087b8c55ed9c534dd1d0a086a3340b0d829cda0a13592651cb59f284838',
- about: null,
- did: null,
- intent:
- 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A+eip155:0xF8aBe92d1d0706bF60509F8E9A64Ed6b8520E868',
- intentSentBy: 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
- intentTimestamp: '2023-07-12T01:11:32.000Z',
- publicKey: null,
- profilePicture: null,
- threadhash: null,
- wallets: null,
- combinedDID:
- 'eip155:0x12E429E3672a02E385F9f5F75E932cC1D566EEea_eip155:0x49D407CC9D0e966CD9B22BA40685083B49bd2315_eip155:0xF8aBe92d1d0706bF60509F8E9A64Ed6b8520E868_eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
- name: null,
- spaceInformation: {
- members: [Array],
- pendingMembers: [Array],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof:
- 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJkrksbCZA3GHnYNke0AhYhBNp+D95LDfs4yU03LzcYedg2\n' +
- 'R7QCAACRdAf9ELAnCLXfBiAVdbgwj81xr+w9Yzw2wXLLrPLfYY7EXfyChLzQ\n' +
- 'rr9XBDdWMgtzEU1diSPMbLDh1METR7n71EjG0AoeX5A2pkHI7R1vIxXUJR3G\n' +
- 'fzHENsfGaKLnhrL1wLjBQACzEsIqPrHl9RItdtKEs9izLmc+wV0GFJ5OjbAs\n' +
- 'ty/1Q36nnMB7sQ7Ytb9Op+q0TtZPZ7jF9CjX8KGav3P1xDQex9nfsXiDHlLK\n' +
- 'MqDePaaMO6RJUWAP2xTo2k1DDJQ2dpUhs9XyjMlvFhVbIcT1/lVRCPC8V3C8\n' +
- 'fUKhUejvOjNFxf0QuR+E4xs+Q3zvR1+fXdJBxbH2Fp3kOTN1N9/LEw==\n' +
- '=sLLC\n' +
- '-----END PGP SIGNATURE-----\n',
- spaceImage:
- 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- spaceName: 'statutory_amber_roadrunner',
- isPublic: true,
- spaceDescription: 'continued_bronze_pigeon',
- spaceCreator: 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
- spaceId:
- 'spaces:3aa43087b8c55ed9c534dd1d0a086a3340b0d829cda0a13592651cb59f284838',
- scheduleAt: '2023-07-12T06:51:32.000Z',
- scheduleEnd: '2023-07-12T07:41:32.000Z',
- status: 'PENDING',
- },
- msg: {
- fromCAIP10: 'eip155:0x1615d2D9ae82D5F0eE79298899962b237386feB7',
- toCAIP10: 'eip155:0x1C48fE875590f8e366447758b13982a3Ca7d9dBE',
- fromDID: 'eip155:0x1615d2D9ae82D5F0eE79298899962b237386feB7',
- toDID: 'eip155:0x1C48fE875590f8e366447758b13982a3Ca7d9dBE',
- messageContent: "Gm gm! It's me... Mario",
- messageType: 'Text',
- signature:
- '-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJkWKQWCZB7dzg7q3axjBYhBJFuYslzDGbuE+3FMnt3ODur\n' +
- 'drGMAAAjtAf/TXjtm2qb6aSikFPKYXm0Ekws+65fisJGf7T48MYkkfcD4t2e\n' +
- 'HXd9LtohzGhcztbOQfAND3yME1GWuMBIksq9rlyEA0ezwsGzCJVhBnkAHBe3\n' +
- '+1v4/mNSMmInU8y6sOiLiOcW7ameJvZvDdPDJ0YHhc9dKDCIh1UAZEPAgx+z\n' +
- 'Wc0DM6pW8bT70dfgnuW2LlLGF5Z23Z1vbHmeszt78+xYY3ez/hoMHXUIE25z\n' +
- 'Wrnt75nasBBahtJ0mwH10ATnsQNE9hTi6XPGYxRSNDM9nyRxTQUpjhNmGS/+\n' +
- '7oFyq8xTcRSaL7d3h8URp9hgFWher5ZZDyMV0jvk+HPguUX54g6Kgw==\n' +
- '=dcRD\n' +
- '-----END PGP SIGNATURE-----\n',
- timestamp: 1683530775648,
- sigType: 'pgp',
- encType: 'pgp',
- encryptedSecret:
- '-----BEGIN PGP MESSAGE-----\n' +
- '\n' +
- 'wcBMA9aU+JGZVRn/AQgA1pIJHyeJinU21r6At5S5ZaWeN0OEKVB2TjpqZ0IW\n' +
- 'lHLKQrQ8k3M16bN+Vf0P+DzDVOL84QRkBD56qSNVHOOCox5wcQeR01CczenV\n' +
- 'LUVvVjBzR2hj7Sdw+Q+M//rgeZPPUDbNyiVmGijelhwDqWd7IOoZY26AGXlm\n' +
- '7YQiElvHN2HcYXaTlLAOy36BcccwHu3Tn06F77ZXaf8FnGMWOUy7wh1/jugg\n' +
- 'D17jUZGLYbmw+u5l9BOfljbw2pb4vtjWht0I1b4GYlKb+bYg/NY0UNsq7mSh\n' +
- 'dGAmOhy5tC2NMjLRRLfD2qasxHoHN50onlB6HcYLl0RCf31ebOgO6rMhUnxt\n' +
- '9cHATAMLWLG2xubrYAEH/2tVeq2j7nJALGSFxjJPboOY57aiFrhXNQ/e/oXH\n' +
- '//TNJgGWx4Ta++OuF2Oexbh9DIZhl6DWld9adXDDtBS/fEyjNsYqwoYlNEJN\n' +
- 'kLvSmokNNrE4MKC1A0GkhSh2MGQDNk42GSgz1tep8XSVc98MHqfNXCHVb5Oa\n' +
- 'OBeWKLFyElT3+KuZxSkCsnoO5YjuCGbXPyG06tXMHXMTncpj1ri+vpjUSnhD\n' +
- 'wn3o0zpNWu0GaWXIgTqj2ZouVwV2S1+wAJQjE8uI1JvBiMhA+X63/GCcApBu\n' +
- 'C7rN0Cs5NGXCn9VWp8i1SCp2NuZ38POABwsXUUkjpF24txyUDX8dbXlkzpao\n' +
- 'g93SQAElYYmyKbGp1TKhAZl2u40mgf2yCYDv2DLRfAKMJDLvmjXoUGEg2UYO\n' +
- '11w6LD0pIykdKJmFtRls/uMnlcoBgDA=\n' +
- '=kzUH\n' +
- '-----END PGP MESSAGE-----\n',
- link: 'bafyreib34jgnpp573rwquejcq5avxvydis7fbykat6dd5z7uazobucoumm',
- },
+// Combined DID for Chat
+eip155:0x7a38D295786d1480BAab4a63b8d85B5a47bA4b78+eip155:0xcCC0Cc5081A135E4269E82907d2dAD6728ea4159
+```
+
+| Param | Type | Remarks |
+| ------------- | -------- | ------------------ |
+| `combinedDID` | `string` | Combined Chat DIDs |
+
+
+
+---
+
+### **Reject Chat Request**
+
+```typescript
+// Accept Chat Request
+await userBob.chat.reject(aliceAddress);
+```
+
+| Param | Type | Default | Remarks |
+| -------- | -------- | ------- | ----------------------------------------------------------------------------------- |
+| `target` | `string` | - | Target ( For Group Chats target is chatId, for 1 To 1 chat target is Push Account ) |
+
+---
+
+### **Block Chat User**
+
+```typescript
+// Block chat user
+const AliceBlocksBob = await userAlice.chat.block([bobAddress]);
+```
+
+| Param | Type | Default | Remarks |
+| ------- | ---------- | ------- | -------------------- |
+| `users` | `string[]` | - | Users to be blocked. |
+
+
+
+ Expected response
+
+```typescript
+{
+ did: 'eip155:0xdE3CA2cC2c91Cb9B3aDB80ac497662Dd9E57BFaA',
+ wallets: 'eip155:0xdE3CA2cC2c91Cb9B3aDB80ac497662Dd9E57BFaA',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGT29asBCADVtp8rHsmtqgUSHxutStJ8AO78jWFFerHJQQ7M/QRZ/1mg\n' +
+ 'uDTt4QTsmhNPlyzQ/OztVDOddn3qqZg4/gLUpJclMmR3UmxmTGrv9PaL9IOv\n' +
+ 'otdKrLlYKeXUHbaBWVgXHv6F7hrCx1Faiq4I5Ca8tdxhKyQc9WAA4f7TTxhg\n' +
+ 'htDY3VfRnp1LFlXyx8GyqCBGpmQx3tSK0w6SoC0FdCq/DpaXD6ofIKH8kcjJ\n' +
+ 'vpBXw6MLwymZrfzbUtYWykOZ7QWgDWF6Y0xjDjZvlajGeY7NfciQR+2ylb1r\n' +
+ 'eOn1yGN0Fvw6+7gGZy85XaDoCnyDAws0Nn+2G9BqTKVH0UwweWKcqOtbABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZPb1qwQLCQcICZDxpr16PpcWmAMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBDqZlQ8vQkW6qMko3/GmvXo+lxaYAAC9AwgAy6nLLykcdRlW\n' +
+ 'dPXUN/wTqowopbuRo5bMhz6+Q53Hf6qkjfknaswoBtE2bq/J54N0BN70Lv+j\n' +
+ '5klfjZWJF2stgMEyQfPbXp1yXQi9Rlmvg4qZvZRww5UNm6CuqxU/stXQK/Je\n' +
+ 'N9eIqd+fTB1EMKwbFrFHfOSKWK7OGnb6fi6JqofJcGvA0Oj1Wkf3i6UohsZL\n' +
+ 'XE8L1Ku2IXc4oUZH5UZD6vRYkQg6/EGq+WrHUXX2nifdK5b5tGZcfGe6Tudm\n' +
+ 'KeYFGTGfgbA8ag67nD4Esr296Mjjm06TTvqdo2r28/zn5KcRPWtHNpPU+t2u\n' +
+ 'kwq7UBvoroACgr3yZkdAFLt9E5NRTs7ATQRk9vWrAQgApfSeqUx3ob+kinzU\n' +
+ 'opKC8L9qV6jqkYu80coITufcc4TUEYlNEZwSaMRA+vOk+bwWbc+zJG7zW8aq\n' +
+ 'Tx0LyZqABgRsWOsNblepCzyejLmAwxl8kBEAMQvJ4Hjo55MGEjfsIFSqeEGt\n' +
+ 'PkPZBpxYN0/sB+yYZDt+59L0GGLC0vrxvj9aLw1xRaTNCNLkawTa8vTCwSTY\n' +
+ '/833aJy6kevAXzj7V8hOGnY5JU6dx5Wbsi1HmzuhtW/lG2n0JtYokfpESnQ7\n' +
+ 'La8I9PqpJC87iFEdt7MST2x687sf0vJI/QMRQ2kZF6Pi8LRYuMmrYTF2BIaH\n' +
+ 'kmPafAoy8BYNfetl67EArGHckQARAQABwsB2BBgBCAAqBYJk9vWrCZDxpr16\n' +
+ 'PpcWmAKbDBYhBDqZlQ8vQkW6qMko3/GmvXo+lxaYAABjFwf/epZQQVs6w3Fj\n' +
+ 'JV2OhS5PYsNr7hWAgAVTgqBLOuPkWG+yfwmayqyQKJmr3a/e+1wKC+Mrz1D7\n' +
+ 'cRpyiwyiCp01has6qMAledjGweg5wTz4axMSQn/KsLc7dsLOtccV05RkRPMZ\n' +
+ 'vRDDJkfIVYILBikTcg5WEIulGuy7enQO+Mo239WrUxi2QjAkEMt2pxjp4qNM\n' +
+ '9vMEPo8uUiEj/+Tsq15kbE5NGpL+n69R1/PYpHp6R7acimsZlXqyhUVaTD67\n' +
+ 'QDFLdR8nVToU2ACOvmJicTVHCiDbRfeUgMaaTu45degUEE7rbh+dNiJrkyFh\n' +
+ 'GCHIKjRcKEpModMxiZSJBINcWI2hlA==\n' +
+ '=ktHx\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ encryptedPrivateKey: '{"ciphertext":"5d3b651b63db81767bd7b9387a085c0134a30d2c77545b4db528c15c429286620edf527b069d4f90fb7e7e769c6a0fff19f52676972765881cbb601e78f386cc492b6ff7a4739996148904dc09f4f95ebbd53ee4e0f17d17dac66aa5b11e09daecf307b120f5d1157465ef15114b0b20642d7b64d45a218307764bf48c819e05247db0d782745d458e5ca574f92e0479188d5ba557201d58d85753f2619fd1648a80f8153e4847b7fa455e50379b096b4e430fb49b3084441a08f715f3b99c722e5a6b730ca8c2160075594caf3fccc26bc9289c116751e4e8306cf33b96a60bbbe46bf4363dd3b25529ced93c67ec60a153331fb340d2344851ace937dc161dd9aeef20dc71a6afd7cf308d8f4c05e9c779bf5d684fbc4620b955b0aaa80f89287c197f2f4b00b5450b55770ca1d44c8a78583762c3740dc88fe122afbec422e64842ae9719d21334d0289718468d11a3cd12373583488da7631f924c9f1566c6eaabcfc9f146fa50e49986300f7e7a3d36d0056c381f6decb38b10ca291a747deb0d896168fee9279b5bbd0ffb7aa419843d1f69da632552aa885ad694fe8ab50fe0bbc79ca4980e522d4b001215bd267752340f02270d05a5ad8673ef998199b1b0e6930cc53c97a14245ea5355e10a438513a94bdcab49b4aa605277ad11ba0603ac59d6f2e1068791a61b4531d55c55837bf43299524e5c4ff454631eddcdab0f036b70985e49f155bed3bbbc36f9e69b6c411077051c2f3083354160146336f7d023b51b8091b32cec3b0d8e5dd67f3796e00472d1b305ad3f861b6ea863deeabad29bac8dad1ded1a59fdd965ff5903c7dfa1ad956a4264e2227ffe9bd9e15ce7eb48c0a6494c07a95865770adacc94703c19f4c1aba9bf885d6311490a285d42a6e8899de07709e176a30dff3e8988de3f22188d0adf03bb633607ffd4daa503b7121a5e5c3946bf3a48d62d511cf5518ad94b43839827af07faf9037bc959a7ef621df75ad965045dba6c89ae255d200ebcfaa0a2f652ffe630df57685eb471c4b089ec6e7d4c841f1e2e25bfc3b852cf79c4fdf66327a18302fdc10c6f044e42387bb89c45644643546e93324b8ef4d7ddb6016457f5098da369915ac6e1d2ef45fc9155cf13d165d7822bc6e463932cc69ac7b372a0e3b18c45b45bd275b38af4b29d665856dfbd6e6c6ecd9b6d02f4e61308273d76ba0baa0eaa03ad831adb428ec70a1dd29b3b2c4941adfddaa76ac99c47bf6eef92a361ab890c3e9bc714263a4f93289cad7344882886aa101685586a54e5da7d370449b91400e48c6a1ae8f6e2bcc06fe186d981399c28143a3faf1cf2c06342b82382c01096ff8542ef55c24175d052f199fe39a4ebf39c56bd30a8251c19745d1b9d0a1a96d81e6cff3c060d00d85d627a9344e1ae98cb42c1f05cd2dd9ae3d83b7974a7bf96980c33fcd76f96ec6c2ea11a2348026333424307f1568e5aa575c31f819260d52ad968e9a17cc46723ba1e129614d2a47ece4dde0e0cf4bce2be7ab25441255997d8bc659a194665090baf6e071dd4775b2e2f7974d26e0cd040df9890ab58c77732d6e33a8ce909e965c2f04a7f65ab5331c044cbbbe39184721310235a772b30a30071a8058b9941f42d85c2e63bbfece7d6116a507bf1612194ed17f430274e4053d2b8de761cd6c316f08c401c66f1650d0e83fcd0d69dc92763f8202748d8e40bacae6cfa264d8ab19ff86e1753d3a33c3ee9b4b9fa6ef64765e9d2b2ba52b28e61743aca96471e6c35143ac8238275b504e7d0ccf0c9cec095d02259849b5f382fd7eb0b7fa3ddc0c5dd91cc2be7829948852dc740d9227f17b2f960141f4807678a2dca6ee24a858a6f20874b1b8e35305106c77c38dbbe52d3e533a845dc8a0912c7d95218c6b820384de5c2693447529522df552383e35d126122801008aca30065c8f93c8556ceb09f5512e64dd481d5ae823675c201124759a80477b1be6ff4756e94e814b279f4de19b79a72acc52d0e1d1e9119abbcbaa1ef0c6dd50894db4ee5f4c005658416fa840f19e36b65c591e73ac8ae4d9e49ac13dfc40d754cc4f9eefd327876a94e5a72f6ebcc8bb4645f6da8a7505d64190ef400829be6455737fb60d595ab13cc9d8634514675803693402570ff869858943c4cfaf914402153a41bcbf417be30c8220ff994d48d85a2893991a5241d407e6acf8341d11bc72de3967720238b218052580d121c6d2d01e788d6cfb2bac26ae205e0e72198c40418bb6e3f25f0e14f03d237bde9efdccdcdb2659a40276ac760a4eeb0770bdff49513b88e51a649bccd82da5c82e6c50a91cf9145091f08bacf7aee46e80bdaeb320af371d6e6b6bc29fab41df2c4f09953c0efa3b92f0745c9480536680d60fa0badaaed85b8836b5e5e54c5aebfc99e2a3b32ad3a5c882829b55e9d80a33468b05e8196c408a9de4a13af00df4c9b632eb4d04372c99c8020fad56383cd4937088d2fb4e7a0c4edc15e3bd79214337e02fc72cfa703e12bebc396068da9eb6ef142a55f6eefd8d11a501c4c6610c808a75923e2b279a2809ca34c2da49731ce85756a7039b667cafcb081693375f4cf8e1b39aa5f29560d7ca003775ad5affc621c359198a4dfe484edb11853586c1c664459c996457454803fee7350786410b8b9d81bc0e31f4426760ef812ebb49b1a63612c3c3249a0dfea9b50b620a818654bc18bb3f411024ef9ef7fa21a494f359473bcb30c70070b78ea9106d5441dd89322ee2a31c945b884ee9008841ca8dc776aaa6c46526e6a21ead1831b20697b75905a13dd947ee53e6a105f0bccb3184f679b05c475f5294d96a16fc50dd9430967a1c7013c054f3fb0fe07c586c5835b048238fd1effb7bcb6ae6da40883f387dcf684ac20709c59a312507d125fbb65208a985f0a6f5e2e442330ce39c0503d27cd32d61541f99e1d20b2314e830f3d03918be89152a0547a45ba0a419ef6beccb83b444c8081fd12c79f8d88ace21c9057265b351a7ed8588560a9f549149b1e2fcacf99fa6cd045462122a4f60d969fdc7d780465349fa359c95a5b58a9e2b751e45301696407a1ddd17c32dc7bd5acc3ce09ff5ad20b9d91a9ac8eb3d142bb6907f19b789cbbe15a2a34469e90a652e5504228f12411a4ef54abc1c1d9a132ab85e42f1dbe2c14eab46532f22fbad0e912911f44510c10569a99a0a99f774070178776a970d83bdf50257cb6ba08ba6561b16535b1e05c16a06bf0e3b29b082f66b8336e676cb4c6e9bf98362b631173f683d251c4866e49860fb83f4053087f44c033198397ffb69b7053746ba150e16399c2f064967334f893125de76539730211f8c6edff3108db2c7e8641fc50ccb9946596b59fa425265ec86db50414218b494b5166399209a1d664d2157da0161d9786396dcf2d91f9433d39219d35f6974c96e4f1bf5f5e0a17db196e97dfff13e58131ffcbe3a8a647cb6a17754657b93e9b9cb458b9bd1d8cbbde72cdbccef7073ab2c290e237423b8053a5cbf358a88d1101e1f648c392c80704c7dc9d0509e186a11a9d90e9106bb1fee1883af0daeed804702b9e2384ab0c519129ae330914ade6c5080f6a2d17b716f71d81c352c07c2cca0c210e0d951b0fefecbb00ff0c3693fe262cf9125094b46329eed041d3801025ebb67722659b98d3e5da83ba5343a058540e868742ac36c852f26b3310bd33af4884d3e51e046c0ee17b714ce1f29df6442468791a469eb1e387cf9d366d24b00aec6a089a88c96a82a1ff71b1947a24015b1cc13be259be5bb75731a18ca58aa46609e2a2ee9fe0583588f0c453a2b99166831669547428941bda9a65ab82462de8add40f16976a13e36a0018886d27b4cba663369d13fb056a874f6d5e0e9ee6567ce7428d9e179790b44649a05aa8523fbda4b9db72873e9aba33892bc0677339332d5da9b3b4754e2b387597d8405de304d8b65ba6bba9b0558457431820582df5ae3577efba787ea3b4eea2515cfba590c7821d2d47ada99c612ed4e3b9d3ff9ced63e76379789da562f45f851bd10e8e6d2ef633984ef4bc6bfdb4c833175448c3c6f1f7735587b6e325866a21b8d02cda06e9520d18350e38b428b3949635dad18cccd4d840d9e4c872b32c527d2f521de3822565b7af6f5d8e254bc142029faa91effaaea2ce70de748eae946a2521d3b5952d5874e5bd6c4322a35660b51ff114d5cf6c5b5fbaacf834eb1eb68087ec06668dbe804d349b1d5bd3396099f3062982fdb9a6afe542c8529752c728501ddbed65a210a28f351f3f44ad40d3a6ce4995f2e6da7495dfa40a4838fd2d808b2e298a863a7475c2134a713cfe8a47fb5bd479891c2747f0db0005ee4a894b6e8b66cb5e1af8d938fb1f5f53c24aeacbcf25b57b83c5abc3a1adbf7853e0a6ed5904e19d5d824b1500296550589c4a3186359b72a1d482b02dfdc1874e64c78a9df7097696457832d6aa572102000c06af444c8ab83e6204ea920a2a847cb163efd9a4701148b4009b2f8053bd7d6408045f627df3f45b002d249a20dd829cc8ba18d9c468d816d451b7f3792e31f360c5932656aa7bfae55b75ae0c40af53ad33005d065d047926543d68e9548c51c3d5405a164b902825fa5ba8c8be5dbfe8632a94df6ae322425be86df9234140bbeeb707d45dfb4b64a09925499ddd2192ad1174776f006f3e91627768f60be59756b7a9b51e4e4e02c01a7fb8b06e63dc3e71951e0b426652b1796bf546da832ae70b055a4700b3d6e266f4af898f0f517277db75aac827d6c30f75c6a6fc9fe6ef67e6f3fbf9c21f731f1f5d89feeb1a76c7ac9923320eb56c517f937a32f3629a8fb4f134a499562f837515596508cf6b2ff3de5c536dedf2946b85505c5843d09bed34","salt":"7b0c5813b930a5ab6713f1572441734633ec845aaebf526f1daafbf89ef268c4","nonce":"bf2c1e6312caa6a32e95eee5","version":"eip191-aes256-gcm-hkdf-sha256","preKey":"fe71bd49335560367aee6772233e69316de48378df6ed104647068e8525d2c4e"}',
+ verificationProof: 'eip191v2:0xe58171978843f55fda11f3989ef8a2310a3366585cf3ba6c71dc260e362bea1b2b2667e287959f6f79628a03073d5757011b7161a2782c32290f924486f87e0a1b',
+ msgSent: 1,
+ maxMsgPersisted: 1000,
+ profile: {
+ name: 'Bob The Builder',
+ desc: null,
+ picture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA40lEQVR4AcXBsU1DUQxA0RvrK3JJReE50jADEpTZwRUbsEIq75AS5sgcnsFKE1orxUMRSD5n9/n8cqMxV7qMojNXVjKKzlzpMopOGCYME4Zt3Mko/lNGsSIME4YJwzZ+Ya48wlzpMooVYZgwTBi2ccdcWckoVsyVzlzpMopOGCYME4Zt5spKRtGZKysZRWeudOZKJwwThgnDtoyiM1c6c+UR5spKRtEJw4RhwrDNXOkyiu5yPdK9fXyx8n16pzvsz3TmSicME4YJw3avT6cbzWF/pjNX/iKj6C7XI50wTBgmDPsBSK85Mi5fmXwAAAAASUVORK5CYII=',
+ blockedUsersList: [ 'eip155:0x30d45C4aAfDB894Dc529aE15e7A55fCf49184eCf' ],
+ verificationProof: 'pgpv2:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJk9vWtCZDxpr16PpcWmBYhBDqZlQ8vQkW6qMko3/GmvXo+\n' +
+ 'lxaYAAADJggAoSO2WXXxPtkFBMcM2Bqc9pzBFkklicmWj3Fjl+6FB3sDXt3V\n' +
+ 'YGNDqSruqpqoiCpMATy9QC48zO9Bj/gbIzuIbLRvNs9M3D5e0si4/OHKIbSX\n' +
+ '3dBiaqaLdki7tUvtPioQ4Q1ZkdOATr3Wr/PyrHc0V00fE64qb0MlN4ouvYYf\n' +
+ 'yG4WK/0x0iH/RPRyG60fkrsmZa/PPpRBzReZXwrsVbBoOCBSe6f9s3EYTfim\n' +
+ '4ThX4zrbwKXx7Wgv1lXw386jvlaqUze9A14DAq6OjwqAZEVmLZaq6r/OHmqM\n' +
+ 'Jy4fZI2auG9uYDorCxP7n6RjOSEOCLG8k+WRDFn6LSPJpdrYoYi6MA==\n' +
+ '=d+/X\n' +
+ '-----END PGP SIGNATURE-----\n'
},
-];
+ origin: null,
+ name: 'Bob The Builder',
+ about: null,
+ profilePicture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA40lEQVR4AcXBsU1DUQxA0RvrK3JJReE50jADEpTZwRUbsEIq75AS5sgcnsFKE1orxUMRSD5n9/n8cqMxV7qMojNXVjKKzlzpMopOGCYME4Zt3Mko/lNGsSIME4YJwzZ+Ya48wlzpMooVYZgwTBi2ccdcWckoVsyVzlzpMopOGCYME4Zt5spKRtGZKysZRWeudOZKJwwThgnDtoyiM1c6c+UR5spKRtEJw4RhwrDNXOkyiu5yPdK9fXyx8n16pzvsz3TmSicME4YJw3avT6cbzWF/pjNX/iKj6C7XI50wTBgmDPsBSK85Mi5fmXwAAAAASUVORK5CYII=',
+ numMsg: 1,
+ allowedNumMsg: 1000,
+ encryptionType: 'eip191-aes256-gcm-hkdf-sha256',
+ signature: '0xe58171978843f55fda11f3989ef8a2310a3366585cf3ba6c71dc260e362bea1b2b2667e287959f6f79628a03073d5757011b7161a2782c32290f924486f87e0a1b',
+ sigType: 'eip191v2',
+ encryptedPassword: null,
+ nftOwner: null,
+ linkedListHash: null,
+ nfts: null
+}
```
-| Parameter | Type | Description |
-| ---------------- | -------------- | ------------------------------------------------------------------ |
-| msg | `IMessageIPFS` | message object |
-| did | `string` | user DID |
-| wallets | `string` | user wallets |
-| profilePicture | `string` | user profile picture |
-| publicKey | `string` | user public key |
-| about | `string` | user description |
-| threadhash | `string` | cid from the latest message sent on this conversation |
-| intent | `string` | addresses concatenated from the users who have approved the intent |
-| intentSentBy | `string` | address of the user who sent the intent |
-| intentTimestamp | `number` | timestamp of the intent |
-| combinedDID | `string` | concatenated addresses of the members of this space |
-| cid | `string` | content identifier on IPFS |
-| spaceId | `string` | space identifier |
-| spaceInformation | `SpaceDTO` | all space information |
+| Parameter | Type | Remarks |
+| ------------------- | -------- | --------------------------------------------------------------- |
+| did | `string` | user decentralized identity |
+| wallets | `string` | all wallets associated to the did |
+| publicKey | `string` | Public PGP key |
+| encryptedPrivateKey | `string` | Encrypted PGP Private Key |
+| verificationProof | `string` | Verification proof |
+| msgSent | `number` | Number of messages sent |
+| maxMsgPersisted | `number` | Maximum number of messages that can be persisted |
+| profile | `object` | User profile information |
+| origin | `string` | Origin information (source of the data) |
+| name | `string` | Profile Name ( Deprecated ) |
+| about | `string` | Profile Description ( Deprecated ) |
+| profilePicture | `string` | Profile Picture ( Deprecated ) |
+| numMsg | `number` | Number of messages sent ( Deprecated ) |
+| allowedNumMsg | `number` | Maximum number of messages that can be persisted ( Deprecated ) |
+| encryptionType | `string` | Type of encryption used |
+| signature | `string` | Account signature ( Deprecated ) |
+| sigType | `string` | Type of signature ( Dprecated ) |
+| encryptedPassword | `null` | Encrypted user password ( Deprecated ) |
+| nftOwner | `null` | Owner of NFT ( Deprecated ) |
+| linkedListHash | `null` | Deprecated |
+| nfts | `null` | Information about owned NFTs( Dprecated ) |
---
-### **Fetching list of user space requests**
+### **Unblock Chat User**
```typescript
-const spaces = await PushAPI.space.requests({
- account: string;
- pgpPrivateKey?: string;
- /**
- * If true, the method will return decrypted message content in response
- */
- toDecrypt?: boolean;
- /**
- * Environment variable
- */
- env?: ENV;
-});
+// Unblock chat user
+const AliceUnblocksBob = await userAlice.chat.unblock([bobAddress]);
```
-| Param | Type | Default | Remarks |
-| ------------- | ------- | ------- | ---------------------------------------------------------------------- |
-| account | string | - | user address (Partial CAIP) |
-| toDecrypt | boolean | false | if "true" the method will return decrypted message content in response |
-| pgpPrivateKey | string | null | mandatory for users having pgp keys |
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev' |
+| Param | Type | Default | Remarks |
+| ------- | ---------- | ------- | ---------------------- |
+| `users` | `string[]` | - | Users to be unblocked. |
-**Example normal user:**
+
+
+ Expected response
```typescript
-// pre-requisite API calls that should be made before
-// need to get user and through that encryptedPvtKey of the user
-const user = await PushAPI.user.get({
- account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7',
- env: ENV.STAGING,
-})
+{
+ did: 'eip155:0xd1790E37fe3459e3F48eEEe41a7708a3eC2148f7',
+ wallets: 'eip155:0xd1790E37fe3459e3F48eEEe41a7708a3eC2148f7',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGT291gBCADFq+sw1v0dNAqkG7bMUZy0tzo3E6iPZQ5UwlOvtzaen2md\n' +
+ 'OHOTnvaCFRjRQZjrvlmbWwBELOTsHbmluA41MeayoJ7aA+o6+aflaa6PCUG5\n' +
+ 'ugAfXjuQxPn+gK0hFdn6IYxvBQHdh+Hu0Obi4peol1GobzraVZt/fRrXdttA\n' +
+ 'tLM7EmvX/l5440xO8+kZ9/uhMx5MR6fdD32AWPpGDy6tJin4awSdTN4eIwI4\n' +
+ 'ueKUZ0+B4wWAiEkRwIRWY4vbCCfMeF+qNMGBaz69I+YS/2FvyqAXTkyKytt4\n' +
+ 'U9efp+ObJsNGk8OA2JWZE+X/16eO8xvQSHhcoH5L2ahGTmG8+xr8bFoRABEB\n' +
+ 'AAHNAMLAiQQQAQgAPgWCZPb3WAQLCQcICZDzsIc63rzcLQMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBLvWJU1IWhvs+frC7POwhzrevNwtAAD9Awf2KFgMZaNyYeMO\n' +
+ 'DNojkd6YpwtXGp4zxxL4JrZwDBginbcba4oUyTAqIcJWe3BAGPXX4hi3AYjE\n' +
+ 'BIERstIeb/YkcTyRgyZKDj7tDNPF0itxfiUXAETN7Z+ySkLWx+5rQ8B9VQv5\n' +
+ '0PLDDwBfwju2pp1/j8XTx/81PSjVKpFQoEsEPOj+WloOdonzx+SGcr5mjjYj\n' +
+ 'rR9NpHVUxi3Xx40zJVVqWFbTdnqd1Wm5SGkrRWLJAe1hzHhYxtpEDGqPfxYo\n' +
+ 'bBMe7bphBkh4DYWuemj/2PiZaS8NC1ed32YOwOSWJV+9wmUvIvq3Q08AE2yF\n' +
+ 'tfeNnX6Gb6fDgvPa3Y1Qg/0S3wYvzsBNBGT291gBCACqFMmyuJkBkNwwpNE1\n' +
+ 'L1bJLulRqEm/tCZ2HY58G9NGYgo6u9Ii8H+ia42bf9Ezq4fLBDzYH0T6Pe9Z\n' +
+ 'zAQHudpId8SNfT15QdqYvHjovxk7jqucF/+W7+DilPXZn6eomrOKePCNP8Cg\n' +
+ 'JXSoShkVaWkbkr2UkHGpcU7YIvooAtsxXMWWr1Z3hbk7tCf1uwXV4NlAGIXx\n' +
+ '7FSvWuQ5ow21GqM/6HyeOzbJRis0DNV5NHY6uUoFNUNzPPBBYx8DRDzjmmde\n' +
+ 'KpjialSW5QK7g8KlWaSGnHFCd6eS7pHZURl1l299ONNJ5m/B9yibBKwHCQ3r\n' +
+ 'V/8ByDlxzjU3wbgdZ7+LfjitABEBAAHCwHYEGAEIACoFgmT291gJkPOwhzre\n' +
+ 'vNwtApsMFiEEu9YlTUhaG+z5+sLs87CHOt683C0AAGnNCACtFS+hJSnqZDmf\n' +
+ 'XGSIw3FLkD7OsaOd/75BZ+cqXnfE4is4JlN7IceOHb/9+UlghAOfpjJYfn3Z\n' +
+ 'HobaRnUZTm8unx0uVQZ4PEZgPGuIKjnwmU75xZVpYegXTE55faiDoQZp0Kir\n' +
+ 'zyScqaIuxHGkuW5Ii4hcLXKBK5qKv8cydeOgZU4NJ7jb8DMQhWulx4PHOaMk\n' +
+ 'JR/sRVuzkxfZQ6LPtnWoTmJLr4wJ4WD/nM77W7XmO8ZGoe2hE5V/OZJC+0uQ\n' +
+ 'OPK4S3YmXcBZoz8L6/gdUQz6kaLtRzsP7vZfyn4jWhlbfad1R7KM1srRT+OT\n' +
+ 'HDPpdh1b+4npYo8iTcJTnANQ5oAm\n' +
+ '=rs9R\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ encryptedPrivateKey: '{"ciphertext":"4bb789bbdaa33f355800c4b8d14e75f310050a0269961b1f4b64c820756ce3595ac737fba749f0b268c418b19cb32f5ccd476bddec8d252ea4cd8e7cf15423a03cc00e9a2064e4134aba89524fe2018fb5ef6b27024a4dbe519883e6f41b462608c33914e129fd651e88d0f14973b3305f8e9d1e3d95670263b1b36921a1b5052f43282768a7210c7b66d5f5886359526cb56f48c61fd3cb165ba15b36f47611d1af8c2aa6d34eec0966d1aaa5522bc2291a5a962585218b4cca7a8d4081aed274ca8ceef95596583683b212549f0568a78b9116a4847d94d32488a0c4ecb9a9b5045afcebc9bcf9d3406fbb4d7eba89f21efce27e3ac174941768008f9d67842efb65e1f3f658a9b366c5c164b5cde2c2db442421c39d46e6017be35bb5b73b06a1569b35e8c4814e0edc1f1be46a964b5a4d9a8245694e530c43e9dbfb9176c41731b315f53b46138c270b6faaec8562abfdf7b595284de89d75bfb87e977330e943788ff914636a2cb81da54dcbaaaa39bd06929020dddcd3b628c44a91a3985f527a9b4592bda19aee4da3e3ee6bc73f98d6de843315476b1f67f8b8174db7b985b94c88c0686b4fd42b45ba398a46638b8d0cde5caa22f45fa51c749377baf35358ee2c1c057dd85b550194f4436af0a43c7c5f36bd7620f28a5ccfa28f16732a4992ff9345a863f1a8f48e5312ef5927b2af2890fee50ad219b43a88781e4b007572e4b7abf5fc5b41e3b944bb164f6c9a397495c46da239b0d40aad8d5bd17a5d02a032212f6495c2f4b8287a0e2d4b7a7d4a56114becb7a26e87233ec3201c558e6f42bc74414b34ec39ada6ab64f7ba9c47e0ddbbe5a622045b236b4a137adbeeeea3559b7b8873d727f7707f75a60a3310a54080eb00e59d6fce88ffd079ac9bf3c85f4fcdb56355bdb8b0b844f42526f4b624591a1729d5b7bed31c1affb0a95266e1092afd45f5c2466a2a7234f8481b8526180ae854e6b9b5e2a2835aef5dfba36ede0c01a56eda4aea27dc415f3ef1440ed0b8f8ae805544d3f4e24d0c9ee8b4ed6def38c7a545cfdc32b3efcf3ad321fab80a15b19c5710198f97826321b69c7677bcf5cae6218279f4bf9192b4ea77e510b7409b31e7b50c4b2dee85857ecf42f3b12365ac73c41d7bbe0564c8d741128c0723619a48ac29760c1a9eff36c179b50e6be26b4e10432cf6b8f987838450189a9474e20bc10adfcaacd1199c026cecb9d8b905bf9a2216345ef532e7cf3b94bc6962b4ac1cf52ed86547aaac352d2ce3a294ccd7299221722cd2852b7c5120dad85e041b09709b49e29e2fa17e6e94c0a77c0508ae805f4ecd0fc70b3ff78cd38ada6d8ddb9b150677589ab5b77968bafdf9f8cbfb0c7ec85d35c004b7d74dab2b3c235069276422878d6c0967ed051b03f05ae70ee8f054eb25054ece32f548c48671aa2b0206f61261f3ce8f44e2754f505ea29d879a1842531e7f2c37333be6c34178c4ccde01fa79f344809e0bddf8aa07e4614e4ed31b4d2fb4dff0b97cb33305afaff864ded85b13a69de4b421f331471595df86e6a8a6bf0c64bd00a7b8521614d00e0120895ce81355285fbbdfde434df2846fb062d5e309fe58df0ebc568378ccee69d6f86aeaed2a65e3ff477812692316535f52b927da1ae3a3cd49ed49fc19988e2759f7252510af3d6f3b4b444d838c24df9627b3cbaef01707de84182c1440c736d5432da40a9ba9d493917c82f3b6475a2d2b82e77dc72111ed454b7cd6fe0d0b0f68512fe9538898060043dc9ed2995a1f8df00ac7b58fd8f9d169225c66b527b5447cf597a2c785b8777aeb2054e2c95106f701d1645bdbee9a1c48649e51dd7ceeb611a99cbd85f8e9f8fae2bdce1a46023eff7bf6748434117624a9002eaf2d1feee0b5d4519706a7fd04b7fa497a0f5e152d5387b010fce47b7df330c12b9091848976cc1aef5b50f93bc2332e320bc46d01c891fedce914141805e74c3f912dbf2991aa927eddec4ec2a80cd3acdb5946764ae5da7759f142420567cf51172b37a50d827e4f463c51a9fd6dd47139c8acba1dbd6036dd4ce6af0e5e37ddc6b2c37dfe3d1482d0f695268e842e980cdb2d6d3541856f7780b216012ac67363cdf9907626ac81fd498cd133150c95aa5832ad4119fbdab0bc8ac0012c7217558e52de5e9a0dc779cb7c013cb7a277849cb9e040d5b32d9c454317b59c8962a645540fa0d7ee59ce4468b697ffdd29c93d4db10bde567c9d2105553116860829e728e9510a4cf986a9857de09846fe78095a48787985ba2b95d2094798d9fa209b893e1874615b313b099550ad17f7050112ca81a8a3ef6c83f4c44a90b2ebe44c60d658f15ef773304ac2d715e7c061675c3abe58386a7a2803856009e5e8c495c7d3c97091ba82893899fd12fb127db0deb06aa5717c63a1f949b35be830c2a3f7731d3f41423aca7a3951c4b4ebc5e3d874c36b518276cb0c07c27952571691d4fc16655be7450b55b3587f0ce79695661d325bb6f736e20338556efc1191eab56f5a2479be34a4c7c8d58b1028def385eb0e60aed6b7e9dac35863aba918641eecb7d12cc55b858bfcaed15e330d6fc47c42e76a13e6671758d8f665aaea876191f51f335b48d1fca47dc3dbaf7a357eb3f1946d8b3073b925ba58b7886a68118d3fc5eea83c1650cb5842668f82eb3350efa6ae6f5002bef3c11c3e7f368489c5a93dec16b93817778941626f6ae7a14c6ce4e5512664b23845e0df4bb76aceb20931765106fdaefb0f749a5fee20cfe467b87dccc73dc66b652cf63ce97e8470b195ed7aec14a7c154f2a3563b8f5b3db7992499dc9795217be05148a21468b204cd025ead1cc1e4144728c9e910140d1d04225df4632fa71604bec728117791d4742c1e1006a0604601942f5852de872fef382378676f59fe6d704d1bd07b7ad0c797b6da17bd39d8b66f90d95d913d46686c3ce881c9136efe0445b1e87c2eb8cb2283532e617cf6a0c5f40fdff1fc25b8372c9d46295934a48ecb5d8a6bd5388b76a984d20a1934823501cc85b0b453bc8aa5a6f19502ca788f4ae5219e6470fd9cfc75a244cf2923cd05e1d9da40f21bdf3bbdeb4647cc82f5988d365dc2b4ae331db8e504cca746092c63f1e305b027e707c38e13c66f5d90553717f9f41cc2624d0c2cfbf814a2355d1e9dfeb06cee67b132425b4d0ec68bdc0fb058ce6c444fdd284995349379a2a17739f0859b7ce24e9b681aac2a78b5b65790aa0dc83aacc6607b15acbafcf7bf943cd3826ea64c765c6943fdbb11853abad1aa92aca6f34c0dd2002fac9f4293dc9cd776d882ccb6e1bc02eb1294e99a0cfadf3923fd9798927aa9754e0cc573ee57a20df72b08fd571ee093fac1cb074b9cc90d10ee909031fe0f3c0cd85f31871b7527d653f143cd71c2084c8a9d8354d98ca9e138eb9e813bb90bd71e58880f5b03da49218e77afc3a8802ae80770490233478c9ff149d1eda00df6af91a57f022e158d23f29c058c9183ee39c6dd86fdbdccc81851ad136fc2813c639e8b367dee11d7eb3efe8f57852f2629cdaa1586fd47150c8ecca8d1ac9cfbef23d2489a0cc515154a09b35717d029a5e7ff14d3969692281c71ebc1f8e21b6f77d724bfa60d75d3a77a54ff3043edf1339bc53fa4c2279c3068a47f8d57dea5481c6c1a3aea9938972dc00bf8b637dab25e7b01cffccce70ff15896e38bb160266370e58c61518b4de88ffa121d6f0c0c757c2585f89f456756176fcd2c18852b43231f9f3c439a338ba8052d1a498d92b9f329610f4a636abc3bec7e895b6244c2c013a1cb9c2661ea1679f2fcb931ab9ffc7d04674144a2012ecda09272d6bb83fe039cd472cd059d734137cc2cf017b1177a63b1c2db74c4b5a6ae9f65524b090c6857bfa9f05960b8dcbc6d4d340064ea6079cba74961dcb6a0f00b0de01863574158bc424cd3dcf14f43b067b3584aef99d5c4cd7831ed3e8608f3f31045c4c37d6b408f32d4590fef6435036164632698c880d22577bb1c521e01e96a57c5780665d97eb8c1b472f3a00c04362ce6f72bd9250958ed6970d411c38d616d90cdda53ab2a5621ad318cb5e23f923426c15c8dcf55d7f54a516fb0bf61fbca1e73ceb9d13742a200fa92bc06fdf8027f7fda8549cbc3f837cbf53f249225e2b7d11bb45f79ac946f9e236da16e080338bc0ec5cee88691dd9e5ea54c6079c325801e0ccc980443b652d8971bca1fd253f078da4390eef90d975460a1300a92936a2097b3529e3316efcc11b398ca5ca7128431f438b4756ca3f690844a4ebbc133f8ebcf030ad7839daebd8e9a10724754fb5d4ae289a9637932ae3dafc5b8d6017648305b1eb4d43b16e58eae02fb9501a56ba23f0c27bc9a800120b018cc69f1a070da2936a5af9cd25ba1aa64eae66b218c8964f2b38c371c8a25c04a353d228fc59f08602fbf74a98e61ba3d2a34a844bc829d5f1ee1eaf1bb1cacca386496e22eaf171f1145695f759062f9fa254c5d8c103ff26f1cd73b1c7fd0ced091c917cb63d2fc98ff2e1437b802fd60d6d72b146b695dc93d646913bb9ffc763d604ec61fa733aefd5f14c465cb1ac85a6a1bbc34fc2204876b76c631725690155eaa5d8f07648f22fe954b3b121c56046c24e99e3ab5b2bf10dbd85505d8f55a1cf985ecdf4a42b6d031ea322ac969f86acc6d3a8ba3f5361b6e05b86374bd43d707293c27993a5ac7595a0d5348332dc13c6b651b4a859702844cbded3c6bd35aa67c8fdfc4e913a8b8615ce28129aecf3217ecc4c2bfc48607b650c47bec3365e1af941b9046958b7c8b64bf45028760984336b6c27bc044a7ea69385805d089434190f0044d856ad2fbad4965846f59491e37f0256548d82145f571e18090b0fa91","salt":"d2deba0a43769862a0fbd80dd6fc867599706ca644920fe1bc05585f922b518e","nonce":"74e9fa0359646cdfbe86a7ad","version":"eip191-aes256-gcm-hkdf-sha256","preKey":"358718727d4b43422a7719176c09b66f633e52a47ee3879d1e19b85cc362938d"}',
+ verificationProof: 'eip191v2:0xd7f0bc7c3960f84280c1433e27c0110dea4b4af1a8c10f7531b8194625cada9456cb67117154f20e97a3d8764b8e3e276d0e6da44f36c4a89a06da9a76d3821a1c',
+ msgSent: 1,
+ maxMsgPersisted: 1000,
+ profile: {
+ name: 'Bob The Builder',
+ desc: null,
+ picture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAnUlEQVR4AcXBQQ0CMBBE0c+kSXVUBWdMoGRl1AsSkLIWuO4Jrj2VNCTMe5fr9fFmI7L4xRydHWEmzIRZ49AcnZ3I4oQwE2bCrEUWJyKLE5HFjjATZsKszdFZRRarOTq/iCxWc3RWwkyYCbPGF5HFao7OTmRxQpgJM2HWIot/iixWwkyYCbM2R+fE/fVkZ44bJ4SZMBNmwkyYCTNh9gEzZiOL39d+3QAAAABJRU5ErkJggg==',
+ blockedUsersList: [],
+ verificationProof: 'pgpv2:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJk9vdaCZDzsIc63rzcLRYhBLvWJU1IWhvs+frC7POwhzre\n' +
+ 'vNwtAAB5dAf/cDGsyD3YabE6iTIhNPDn+hvbHuZUjpNPnnSb+mjrvD/XBNYV\n' +
+ 'ITTHhp3Xy4Kuk19BkgmPO3O5TZHVUXK7IwYJd7uutNJJyLEWZYI9ttfeJ9cY\n' +
+ 'HQM3GjApAHycDkBAn5ZRDtmruyWipeE1II3omDUgChQOnQFoK/jWohoIOUvO\n' +
+ 'zi+0V02z7uIGwgTjBLgOYehD8NloGxTjwaZHMqEN7xbr1mZqy82Aew1Bw+EY\n' +
+ '+JPMyiKTF6HXHYrJZL1yaNw/T7ukCI8ecGoql04xlOHU+SKUTz+8Kcg4tZQR\n' +
+ '0pp6Fz9Fy9ROUI8ieu5LytJwQq4c9VkH/SPUvkoODloXc0MbrY59tA==\n' +
+ '=A3pG\n' +
+ '-----END PGP SIGNATURE-----\n'
+ },
+ origin: null,
+ name: 'Bob The Builder',
+ about: null,
+ profilePicture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAnUlEQVR4AcXBQQ0CMBBE0c+kSXVUBWdMoGRl1AsSkLIWuO4Jrj2VNCTMe5fr9fFmI7L4xRydHWEmzIRZ49AcnZ3I4oQwE2bCrEUWJyKLE5HFjjATZsKszdFZRRarOTq/iCxWc3RWwkyYCbPGF5HFao7OTmRxQpgJM2HWIot/iixWwkyYCbM2R+fE/fVkZ44bJ4SZMBNmwkyYCTNh9gEzZiOL39d+3QAAAABJRU5ErkJggg==',
+ numMsg: 1,
+ allowedNumMsg: 1000,
+ encryptionType: 'eip191-aes256-gcm-hkdf-sha256',
+ signature: '0xd7f0bc7c3960f84280c1433e27c0110dea4b4af1a8c10f7531b8194625cada9456cb67117154f20e97a3d8764b8e3e276d0e6da44f36c4a89a06da9a76d3821a1c',
+ sigType: 'eip191v2',
+ encryptedPassword: null,
+ nftOwner: null,
+ linkedListHash: null,
+ nfts: null
+}
+```
+
+| Parameter | Type | Remarks |
+| ------------------- | -------- | --------------------------------------------------------------- |
+| did | `string` | user decentralized identity |
+| wallets | `string` | all wallets associated to the did |
+| publicKey | `string` | Public PGP key |
+| encryptedPrivateKey | `string` | Encrypted PGP Private Key |
+| verificationProof | `string` | Verification proof |
+| msgSent | `number` | Number of messages sent |
+| maxMsgPersisted | `number` | Maximum number of messages that can be persisted |
+| profile | `object` | User profile information |
+| origin | `string` | Origin information (source of the data) |
+| name | `string` | Profile Name ( Deprecated ) |
+| about | `string` | Profile Description ( Deprecated ) |
+| profilePicture | `string` | Profile Picture ( Deprecated ) |
+| numMsg | `number` | Number of messages sent ( Deprecated ) |
+| allowedNumMsg | `number` | Maximum number of messages that can be persisted ( Deprecated ) |
+| encryptionType | `string` | Type of encryption used |
+| signature | `string` | Account signature ( Deprecated ) |
+| sigType | `string` | Type of signature ( Dprecated ) |
+| encryptedPassword | `null` | Encrypted user password ( Deprecated ) |
+| nftOwner | `null` | Owner of NFT ( Deprecated ) |
+| linkedListHash | `null` | Deprecated |
+| nfts | `null` | Information about owned NFTs( Dprecated ) |
-// need to decrypt the encryptedPvtKey to pass in the api using helper function
-const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: signer);
+
-// actual api
-const spaces = await PushAPI.space.requests({
- account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7',
- toDecrypt: true,
- pgpPrivateKey: pgpDecryptedPvtKey,
- env: ENV.STAGING,
-});
-```
+---
-**Example NFT user:**
+### **Create Group**
```typescript
-// Fetch user
-const user = await PushAPI.user.get({
- account: `nft:eip155:${nftChainId}:${nftContractAddress}:${nftTokenId}`,
- env: env as ENV,
+// Create a Group
+const createdGroup = await userAlice.chat.group.create(groupName, {
+ description: groupDescription,
+ image: groupImage,
+ members: [walletAddress1, walletAddress2, walletAddress3],
+ admins: [],
+ private: false,
});
+```
-// Decrypt PGP Key
-const pgpDecrpyptedPvtKey = await PushAPI.chat.decryptPGPKey({
- encryptedPGPPrivateKey: user.encryptedPrivateKey,
- signer: nftSigner,
-});
+| Param | Type | Default | Remarks |
+| ----------------------------------- | ---------- | ------- | ------------------------------------------ |
+| `name` | `string` | - | The name of the group to be created. |
+| `options` \* | `object` | - | Optional Configuration for creating group. |
+| `options.description` \* | `string` | - | A description of the group. |
+| `options.image` \* | `string` | - | Image for the group. |
+| `options.members` \* | `string[]` | `[]` | An array of member DID. |
+| `options.admins` \* | `string[]` | - | An array of admin DID. |
+| `options.private` \* | `boolean` | `false` | Indicates if the group is private. |
+| `options.rules.entry.conditions` \* | `any[]` | - | Conditions for entry to the group. |
+| `options.rules.chat.conditions` \* | `any[]` | - | Conditions for chat within the group. |
-// Actual api
-const spaces = await PushAPI.space.requests({
- account: `nft:eip155:${nftChainId}:${nftContractAddress}:${nftTokenId}`,
- toDecrypt: true,
- pgpPrivateKey: pgpDecrpyptedPvtKey,
- env: env as ENV,
-});
-```
+\* - Optional
- Expected response (Get spaces requests of a specific user)
+
+ Expected response
```typescript
-// PushAPI_space_requests | Response - 200 OK
-// Array of spaces
-[
- {
- spaceId:
- 'spaces:3aa43087b8c55ed9c534dd1d0a086a3340b0d829cda0a13592651cb59f284838',
- about: null,
- did: null,
- intent:
- 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A+eip155:0xF8aBe92d1d0706bF60509F8E9A64Ed6b8520E868',
- intentSentBy: 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
- intentTimestamp: '2023-07-12T01:11:32.000Z',
- publicKey: null,
- profilePicture: null,
- threadhash: null,
- wallets: null,
- combinedDID:
- 'eip155:0x12E429E3672a02E385F9f5F75E932cC1D566EEea_eip155:0x49D407CC9D0e966CD9B22BA40685083B49bd2315_eip155:0xF8aBe92d1d0706bF60509F8E9A64Ed6b8520E868_eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
- name: null,
- spaceInformation: {
- members: [Array],
- pendingMembers: [Array],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof:
- 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+{
+ members: [
+ {
+ wallet: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
'\n' +
- 'wsBzBAEBCAAnBYJkrksbCZA3GHnYNke0AhYhBNp+D95LDfs4yU03LzcYedg2\n' +
- 'R7QCAACRdAf9ELAnCLXfBiAVdbgwj81xr+w9Yzw2wXLLrPLfYY7EXfyChLzQ\n' +
- 'rr9XBDdWMgtzEU1diSPMbLDh1METR7n71EjG0AoeX5A2pkHI7R1vIxXUJR3G\n' +
- 'fzHENsfGaKLnhrL1wLjBQACzEsIqPrHl9RItdtKEs9izLmc+wV0GFJ5OjbAs\n' +
- 'ty/1Q36nnMB7sQ7Ytb9Op+q0TtZPZ7jF9CjX8KGav3P1xDQex9nfsXiDHlLK\n' +
- 'MqDePaaMO6RJUWAP2xTo2k1DDJQ2dpUhs9XyjMlvFhVbIcT1/lVRCPC8V3C8\n' +
- 'fUKhUejvOjNFxf0QuR+E4xs+Q3zvR1+fXdJBxbH2Fp3kOTN1N9/LEw==\n' +
- '=sLLC\n' +
- '-----END PGP SIGNATURE-----\n',
- spaceImage:
- 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- spaceName: 'statutory_amber_roadrunner',
- isPublic: true,
- spaceDescription: 'continued_bronze_pigeon',
- spaceCreator: 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
- spaceId:
- 'spaces:3aa43087b8c55ed9c534dd1d0a086a3340b0d829cda0a13592651cb59f284838',
- scheduleAt: '2023-07-12T06:51:32.000Z',
- scheduleEnd: '2023-07-12T07:41:32.000Z',
- status: 'PENDING',
+ 'xsBNBGTvNZgBCADeYpZfxgn1HoMUuWM42v8ZWfLPwglQYmzz5rY3PdPPoRFU\n' +
+ 'v0AyPjYKpmLh2ZNfXjPaS9GuMdpXaomYSEwsV02hXZOQelo9cLop0Fc2i+l7\n' +
+ '70rYhePuOuQ+XD/xYzhngAgNJ9rX96YnSodldb8uJfxYmgoF0E9Z2o2fgZGj\n' +
+ 'll2CPnOaLXZaBQlPS3x/461TmZ1n2ZePS/fwiC7taLz3PtyGtKaC0vo4isvI\n' +
+ 'yf04fkjudG0XIns5CWjdR2HeDC8BzSl8OVj8AQAc5uVU8Abk+ejWVr4zfoox\n' +
+ 'eaziDPgGdkckFiQ6Tdsg0tPwwOpSrCCtJocTmc/fWaBb0YlnyAAL88fJABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZBMYqhmfI2WQQMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAACxNQf/UrM/whR7vCs+\n' +
+ 'ez8Y8Hz4WqIuXtfMh4l2nKVv5UUuAfQkBxEY5j6Ga2+JgKU3neQ34x/v6fm9\n' +
+ 'CLcY38Tc4AWyEx8KC78J+xOs7RMfyNBeiaf8KdaFfQrP0nMmufE6TxkfV1Y5\n' +
+ 'LJZZ8350rZVtYJppWtlH+gbyUmMObyWDWbL3aWtqa3xjv0kLsf7TnugiFwzB\n' +
+ 'gHHtk8tlDSOxRt0VdNNd19+/zrBYNl07Ig24WD2ETaJiaqa651z24/6/MkGT\n' +
+ 'MBoQh+679tuWWcTrNi4jIA8jhSQ5BOgbAapl3qXk0m9/Aexpe2s6ISLXe8YJ\n' +
+ 'j4cObDLv/ZKKeLZYTq9lVCydLAQUbs7ATQRk7zWYAQgAmx36uefgUF4cCSYH\n' +
+ 'WMWAOTyc8Awo+hxn6FktOLU1+9hfGrX2jwGLOoOwjNgbYJbiSvRglAX2b57/\n' +
+ 'qkkltAg1ZYCLSUzfBUbbWYlJNBwpv7+52zHaLUZ3gmI5aE48ad+uzaadgpVT\n' +
+ 'VqLbhdgkN6jkemPTlfMehyS49AAbmqeKfo2U72tm9ZqT2cPVCASMjN/Ux2qG\n' +
+ '3W8HTo0KIVFSbkTthl1zAlwAFksp0q437+pxbdJIecJ9mO6N4OQMnv+hVBDc\n' +
+ 'WrPqBDJ0nas4JNgLxmLv0pheGg/TEfwS/p6xGRW5m08bj2l0cgqmEaM27jbi\n' +
+ 'DEpOykRWsDMhheEfI2zV/Qam8QARAQABwsB2BBgBCAAqBYJk7zWYCZBMYqhm\n' +
+ 'fI2WQQKbDBYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAAAnBggA1gkIopr9HJFP\n' +
+ 'fO5SebcbowH4AG9M0qBqF4h1JIKbqvOnxLSsC5QmmzFcjS9ihyHBvzbRVGkC\n' +
+ 'zEHYpLRedQ2AmQQfsf/VOoZJEOlb7tTk4+SpYtsGte5X/yLT5Bkls7Rp8ubK\n' +
+ '/V99muj1nA/OkasllXQUSGEweVz6ejzJ0oMm3Vewmw8PelsdAnfS7Ud1MnXQ\n' +
+ 'h+O8TCR56F5gAMWxZmxFpZMZyUFOH6KM+vL7HJUBztUS2g0ELsHKy9ep2yhv\n' +
+ 'iABIwx/gEuPr0NDAH9x9XFKg5m3rO64KTY4BRWBISwmQ25dM1s1bwDPLi5XI\n' +
+ '6Daw1glFxpPRrxgQGlVLzJOu5b8swQ==\n' +
+ '=9hCc\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isAdmin: true,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzUlEQVR4AcXBsWlDMRiF0c8XTeAJPIAgoFbgQew1PIbXyKsyhUGtCqM6ZAJX6Z32fykM4hnuObv71++TYJRKlHtji1EqUe6NSJgJM2G2W74/nkzIvfHKKJUZwkyYCbOUe+Odcm/MEGbCTJil2/VMdLx8Eo1S2SL3RnS7nomEmTATZmm//BANKlHujS1GqUT7hRVhJsyEWWLSKJVXcm/MEGbCTJgl/sm9EY1SmTFKJcq9EY1SiYSZMBNm6XE6sHJhJffGOz1OByJhJsyE2R/3lDA4e9QQhAAAAABJRU5ErkJggg=='
+ }
+ ],
+ pendingMembers: [
+ {
+ wallet: 'eip155:0x119bb8ad40B1f94e2b30ae5f59eeaEB67cD0Bd6C',
+ publicKey: null,
+ isAdmin: false,
+ image: null
},
- msg: {
- fromCAIP10: 'eip155:0x1615d2D9ae82D5F0eE79298899962b237386feB7',
- toCAIP10: 'eip155:0x1C48fE875590f8e366447758b13982a3Ca7d9dBE',
- fromDID: 'eip155:0x1615d2D9ae82D5F0eE79298899962b237386feB7',
- toDID: 'eip155:0x1C48fE875590f8e366447758b13982a3Ca7d9dBE',
- messageContent: "Gm gm! It's me... Mario",
- messageType: 'Text',
- signature:
- '-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJkWKQWCZB7dzg7q3axjBYhBJFuYslzDGbuE+3FMnt3ODur\n' +
- 'drGMAAAjtAf/TXjtm2qb6aSikFPKYXm0Ekws+65fisJGf7T48MYkkfcD4t2e\n' +
- 'HXd9LtohzGhcztbOQfAND3yME1GWuMBIksq9rlyEA0ezwsGzCJVhBnkAHBe3\n' +
- '+1v4/mNSMmInU8y6sOiLiOcW7ameJvZvDdPDJ0YHhc9dKDCIh1UAZEPAgx+z\n' +
- 'Wc0DM6pW8bT70dfgnuW2LlLGF5Z23Z1vbHmeszt78+xYY3ez/hoMHXUIE25z\n' +
- 'Wrnt75nasBBahtJ0mwH10ATnsQNE9hTi6XPGYxRSNDM9nyRxTQUpjhNmGS/+\n' +
- '7oFyq8xTcRSaL7d3h8URp9hgFWher5ZZDyMV0jvk+HPguUX54g6Kgw==\n' +
- '=dcRD\n' +
- '-----END PGP SIGNATURE-----\n',
- timestamp: 1683530775648,
- sigType: 'pgp',
- encType: 'pgp',
- encryptedSecret:
- '-----BEGIN PGP MESSAGE-----\n' +
- '\n' +
- 'wcBMA9aU+JGZVRn/AQgA1pIJHyeJinU21r6At5S5ZaWeN0OEKVB2TjpqZ0IW\n' +
- 'lHLKQrQ8k3M16bN+Vf0P+DzDVOL84QRkBD56qSNVHOOCox5wcQeR01CczenV\n' +
- 'LUVvVjBzR2hj7Sdw+Q+M//rgeZPPUDbNyiVmGijelhwDqWd7IOoZY26AGXlm\n' +
- '7YQiElvHN2HcYXaTlLAOy36BcccwHu3Tn06F77ZXaf8FnGMWOUy7wh1/jugg\n' +
- 'D17jUZGLYbmw+u5l9BOfljbw2pb4vtjWht0I1b4GYlKb+bYg/NY0UNsq7mSh\n' +
- 'dGAmOhy5tC2NMjLRRLfD2qasxHoHN50onlB6HcYLl0RCf31ebOgO6rMhUnxt\n' +
- '9cHATAMLWLG2xubrYAEH/2tVeq2j7nJALGSFxjJPboOY57aiFrhXNQ/e/oXH\n' +
- '//TNJgGWx4Ta++OuF2Oexbh9DIZhl6DWld9adXDDtBS/fEyjNsYqwoYlNEJN\n' +
- 'kLvSmokNNrE4MKC1A0GkhSh2MGQDNk42GSgz1tep8XSVc98MHqfNXCHVb5Oa\n' +
- 'OBeWKLFyElT3+KuZxSkCsnoO5YjuCGbXPyG06tXMHXMTncpj1ri+vpjUSnhD\n' +
- 'wn3o0zpNWu0GaWXIgTqj2ZouVwV2S1+wAJQjE8uI1JvBiMhA+X63/GCcApBu\n' +
- 'C7rN0Cs5NGXCn9VWp8i1SCp2NuZ38POABwsXUUkjpF24txyUDX8dbXlkzpao\n' +
- 'g93SQAElYYmyKbGp1TKhAZl2u40mgf2yCYDv2DLRfAKMJDLvmjXoUGEg2UYO\n' +
- '11w6LD0pIykdKJmFtRls/uMnlcoBgDA=\n' +
- '=kzUH\n' +
- '-----END PGP MESSAGE-----\n',
- link: 'bafyreib34jgnpp573rwquejcq5avxvydis7fbykat6dd5z7uazobucoumm',
+ {
+ wallet: 'eip155:0x6e0C509d14EbF26A529bf6DC5CC9bee7F5b8DBa4',
+ publicKey: null,
+ isAdmin: false,
+ image: null
},
- },
-];
+ {
+ wallet: 'eip155:0xE3FDD0527a9F8418f9a7D9e970452827FbE202FF',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGTvNZgBCADouo4S2kPqA//+I7nDAk15/LcJ2TGvDhOYuPNUNMiNGOb4\n' +
+ 'txusuKz6HOaG+K9hiUBpHjKrYEmCT2FEXxt8bfS3SpWb74RHSkWUNUkxk25y\n' +
+ 'gE5gaCKyAdcnOUyVLmobVFFYtH6naK9bULaUtkVik1P0iuEevWHxtTpsjbyH\n' +
+ 'bZtNpVTdprdLib4Wx6bb7VogsvjlvNJcVJ4sfPE0XgsQgAGIev7yJyU0DGzt\n' +
+ '/EbvFX4sv51Kb1dX9ctBcvzVbs9+qT6LTivsrQp+TNHUN4zEeMhnWFFP5K1d\n' +
+ 'H445S6FWk53XvBudcOkFPtltU1MPCS6hmhevArBfYzy5eSlaKA/fH+kFABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZCrD2gy8Zu4awMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBKru9/u8wPcTeHibkasPaDLxm7hrAADa/Af+PbamVg/Ig2S2\n' +
+ 'HgIy4w5x7ulSk1/49+AmuiUMiVUwJSVBhROsyDbLET56w4+1TIMYZFJaczW3\n' +
+ '8tCvAOUSauzc52I3zwGmaCupBJokIWp7ncPh0B8TFYrgThgXV7sLf3xy4roy\n' +
+ 'y8oFz1Zla88krwtPe4Az7TF+WNdXoDsLNJ3GXRmNqs1GITmDqAXFWncl12NM\n' +
+ 'ajUKWIKc/Gi1oKfz22mabJTtWBimDpA12LaGK3GjEK5CiWXT3Tzlqn6R14EZ\n' +
+ '6ohpKZldSJiMPL0Bu9iT52iHOsw1wTZNC1L5lKhOCi3c+/fLRcJZt3hdCjqy\n' +
+ 'd/FSCa8/Ny/GrHBWoL49rSF4pDEA+s7ATQRk7zWYAQgAtNOoHCL7BCnjwp8O\n' +
+ 'htTxEI5r7Q/1zKKHiz6QKjjrGBYyR6gcmPM3JNEcvzY4OsCFnKBv2suOgrqH\n' +
+ '8kXJzfpIQ7u7uJs+O3p/cn86RMANiEnO8NbB/0scpfZ7Vg3eOfoiWYE4I/1o\n' +
+ 'FVDCyZ1YVqtbcmuW6D8i1djjeoUmkUDZyPo7Qs6hUsJeYA/Rfl8mH5sjy2cN\n' +
+ 'WXf8cEtOUqJtwERXt5aRB/nBZiC0bsP6hf0HtAoNA8/96TkqrcQpODW/RckD\n' +
+ 'fo4wkpEONHRH+LGX7GV0pwymHu42TUnULmED6BrMgMYG2sKpxMThxtAxRaiP\n' +
+ 'nZ3DKXr8GCjTYnbEZpoi2zKCOQARAQABwsB2BBgBCAAqBYJk7zWYCZCrD2gy\n' +
+ '8Zu4awKbDBYhBKru9/u8wPcTeHibkasPaDLxm7hrAADGyQgA5NMUkoyDTPZa\n' +
+ 'Znj1dB+17xBXCZ/u7pPQc1DukBefVke7/qYIicdnnEGIX3Zd7TckFRsDljR/\n' +
+ '3418Bne4WyL57fAF/GgYsegpJ9n1KT7oPxWzibIaYdj7R6bkDt5r61EDWC3N\n' +
+ 'VBbnZu9cO15TYkObJIiyNvwbQyd6Dm313b39GnEE8sM709TWsI6Es6rRZAfC\n' +
+ '+sI8ezYxqVUbP7sW3jJZYzdPOhZPHvFd5iJ2EfygEOuk5tb7AimfNwF/CNcB\n' +
+ 'weQGEU7feOSB9lXXA+Ag1duLM4B9bLbbHEQIPhKlBF1ED64e/W/5HNfoAkS4\n' +
+ 'qhzOD5XWs6xs45nnYqUbBFLG9Xk+Jg==\n' +
+ '=qtAv\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isAdmin: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsXECMRRF0csbdbAZBagHKlJMSOL90IUq2h5UABktLE6/HcizY4/fOafrcntzQB/BTKvBEcJMmAmz0keQtRpk67bzRQ1m1m0nu19E1keQCTNhJsxO1+X2JukjmHm+Ppg5Lw9mWg0yYSbMhFnhoPPy4C8JM2EmzArftBr8J2EmzIRZ6SPIWg2yPoKs1WCmjyBrNcj6CDJhJsyEWWk1OKKP4DdaDTJhJsyEWeEHrQbZuu3M3C/iCGEmzITZJ/s7LOkKUABjAAAAAElFTkSuQmCC'
+ }
+ ],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJk7zWZCZBMYqhmfI2WQRYhBC9DyzhpX3ACb/yTq0xiqGZ8\n' +
+ 'jZZBAADwAwgAq/6WjtwRt1aPTLWwtSx80Ng/Wxf97dkpebMXSj9T7f5ia1rM\n' +
+ '8wqsuNUDMEMPB9LM34f6Q5pD994oeN2YT7z34u20mskiNphZdx/DNvu8w9UZ\n' +
+ 'rI3tyjfZULhARNVM34sSABnHtExbl4ZArhNDsT86ku0sZNjr9frn2mtgmlKN\n' +
+ 'nQdGcLJSxbci0hFg3nE5mYNpwZNs2S/2uk11WHKxzMhII6AdePE77BKPqedu\n' +
+ 'PiXDODO2dIvV8glLQoJPRPgc2ap+/xYIBUFljqHGPU/62VSLlHxBJv72p5s/\n' +
+ 'kOxiqD42TmpaaMtfudqgsZsGoYpZDHcMKYGNZs+9qVRHPRD+s0QhEA==\n' +
+ '=c6IF\n' +
+ '-----END PGP SIGNATURE-----\n',
+ groupImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ groupName: 'influential_maroon_gamefowl',
+ groupDescription: 'urgent_brown_butterfly',
+ isPublic: false,
+ groupCreator: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
+ chatId: '5f769c881ffe328117dea3d3acd0b97ce7f4c163e440f75a96be3e33f7d2a000',
+ meta: null,
+ scheduleAt: null,
+ scheduleEnd: null,
+ groupType: 'default',
+ status: null,
+ rules: {},
+ eventType: 'create'
+}
```
-| Parameter | Type | Description |
-| ---------------- | -------------- | ------------------------------------------------------------------ |
-| msg | `IMessageIPFS` | message object |
-| did | `string` | user DID |
-| wallets | `string` | user wallets |
-| profilePicture | `string` | user profile picture |
-| publicKey | `string` | user public key |
-| about | `string` | user description |
-| threadhash | `string` | cid from the latest message sent on this conversation |
-| intent | `string` | addresses concatenated from the users who have approved the intent |
-| intentSentBy | `string` | address of the user who sent the intent |
-| intentTimestamp | `number` | timestamp of the intent |
-| combinedDID | `string` | concatenated addresses of the members of this space |
-| cid | `string` | content identifier on IPFS |
-| spaceId | `string` | space identifier |
-| spaceInformation | `SpaceDTO` | all space information |
+| Parameter | Type | Remarks |
+| -------------------------- | --------------------- | -------------------------------------------------------------- |
+| `members` | `Array
---
-### **Fetching list of trending spaces**
+### **Fetch Group Info**
```typescript
-const spaces = await PushAPI.space.trending({
- env?: ENV;
-});
+// Fetch Group Info
+const fetchGroupInfo = await userAlice.chat.group.info(groupChatId);
```
-| Param | Type | Default | Remarks |
-| ----- | ------ | ------- | ---------------------------------- |
-| env | string | 'prod' | API env - 'prod', 'staging', 'dev' |
-| page | number | 1 | page index of the results |
-| limit | number | 10 | number of items in 1 page |
+| Param | Type | Default | Remarks |
+| -------- | -------- | ------- | ------------ |
+| `chatId` | `string` | - | Group ChatId |
- Expected response (Get trending spaces)
+ Expected response
```typescript
-// PushAPI_space_trending | Response - 200 OK
-// Array of spaces
-[
- {
- spaceId:
- 'spaces:3aa43087b8c55ed9c534dd1d0a086a3340b0d829cda0a13592651cb59f284838',
- about: null,
- did: null,
- intent:
- 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A+eip155:0xF8aBe92d1d0706bF60509F8E9A64Ed6b8520E868',
- intentSentBy: 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
- intentTimestamp: '2023-07-12T01:11:32.000Z',
- publicKey: null,
- profilePicture: null,
- threadhash: null,
- wallets: null,
- combinedDID:
- 'eip155:0x12E429E3672a02E385F9f5F75E932cC1D566EEea_eip155:0x49D407CC9D0e966CD9B22BA40685083B49bd2315_eip155:0xF8aBe92d1d0706bF60509F8E9A64Ed6b8520E868_eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
- name: null,
- spaceInformation: {
- members: [Array],
- pendingMembers: [Array],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof:
- 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+{
+ members: [
+ {
+ wallet: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
'\n' +
- 'wsBzBAEBCAAnBYJkrksbCZA3GHnYNke0AhYhBNp+D95LDfs4yU03LzcYedg2\n' +
- 'R7QCAACRdAf9ELAnCLXfBiAVdbgwj81xr+w9Yzw2wXLLrPLfYY7EXfyChLzQ\n' +
- 'rr9XBDdWMgtzEU1diSPMbLDh1METR7n71EjG0AoeX5A2pkHI7R1vIxXUJR3G\n' +
- 'fzHENsfGaKLnhrL1wLjBQACzEsIqPrHl9RItdtKEs9izLmc+wV0GFJ5OjbAs\n' +
- 'ty/1Q36nnMB7sQ7Ytb9Op+q0TtZPZ7jF9CjX8KGav3P1xDQex9nfsXiDHlLK\n' +
- 'MqDePaaMO6RJUWAP2xTo2k1DDJQ2dpUhs9XyjMlvFhVbIcT1/lVRCPC8V3C8\n' +
- 'fUKhUejvOjNFxf0QuR+E4xs+Q3zvR1+fXdJBxbH2Fp3kOTN1N9/LEw==\n' +
- '=sLLC\n' +
- '-----END PGP SIGNATURE-----\n',
- spaceImage:
- 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- spaceName: 'statutory_amber_roadrunner',
- isPublic: true,
- spaceDescription: 'continued_bronze_pigeon',
- spaceCreator: 'eip155:0xf4c946D6bd5cF09713D27364bbEd42712Bdffa8A',
- spaceId:
- 'spaces:3aa43087b8c55ed9c534dd1d0a086a3340b0d829cda0a13592651cb59f284838',
- scheduleAt: '2023-07-12T06:51:32.000Z',
- scheduleEnd: '2023-07-12T07:41:32.000Z',
- status: 'PENDING',
+ 'xsBNBGTvNZgBCADeYpZfxgn1HoMUuWM42v8ZWfLPwglQYmzz5rY3PdPPoRFU\n' +
+ 'v0AyPjYKpmLh2ZNfXjPaS9GuMdpXaomYSEwsV02hXZOQelo9cLop0Fc2i+l7\n' +
+ '70rYhePuOuQ+XD/xYzhngAgNJ9rX96YnSodldb8uJfxYmgoF0E9Z2o2fgZGj\n' +
+ 'll2CPnOaLXZaBQlPS3x/461TmZ1n2ZePS/fwiC7taLz3PtyGtKaC0vo4isvI\n' +
+ 'yf04fkjudG0XIns5CWjdR2HeDC8BzSl8OVj8AQAc5uVU8Abk+ejWVr4zfoox\n' +
+ 'eaziDPgGdkckFiQ6Tdsg0tPwwOpSrCCtJocTmc/fWaBb0YlnyAAL88fJABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZBMYqhmfI2WQQMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAACxNQf/UrM/whR7vCs+\n' +
+ 'ez8Y8Hz4WqIuXtfMh4l2nKVv5UUuAfQkBxEY5j6Ga2+JgKU3neQ34x/v6fm9\n' +
+ 'CLcY38Tc4AWyEx8KC78J+xOs7RMfyNBeiaf8KdaFfQrP0nMmufE6TxkfV1Y5\n' +
+ 'LJZZ8350rZVtYJppWtlH+gbyUmMObyWDWbL3aWtqa3xjv0kLsf7TnugiFwzB\n' +
+ 'gHHtk8tlDSOxRt0VdNNd19+/zrBYNl07Ig24WD2ETaJiaqa651z24/6/MkGT\n' +
+ 'MBoQh+679tuWWcTrNi4jIA8jhSQ5BOgbAapl3qXk0m9/Aexpe2s6ISLXe8YJ\n' +
+ 'j4cObDLv/ZKKeLZYTq9lVCydLAQUbs7ATQRk7zWYAQgAmx36uefgUF4cCSYH\n' +
+ 'WMWAOTyc8Awo+hxn6FktOLU1+9hfGrX2jwGLOoOwjNgbYJbiSvRglAX2b57/\n' +
+ 'qkkltAg1ZYCLSUzfBUbbWYlJNBwpv7+52zHaLUZ3gmI5aE48ad+uzaadgpVT\n' +
+ 'VqLbhdgkN6jkemPTlfMehyS49AAbmqeKfo2U72tm9ZqT2cPVCASMjN/Ux2qG\n' +
+ '3W8HTo0KIVFSbkTthl1zAlwAFksp0q437+pxbdJIecJ9mO6N4OQMnv+hVBDc\n' +
+ 'WrPqBDJ0nas4JNgLxmLv0pheGg/TEfwS/p6xGRW5m08bj2l0cgqmEaM27jbi\n' +
+ 'DEpOykRWsDMhheEfI2zV/Qam8QARAQABwsB2BBgBCAAqBYJk7zWYCZBMYqhm\n' +
+ 'fI2WQQKbDBYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAAAnBggA1gkIopr9HJFP\n' +
+ 'fO5SebcbowH4AG9M0qBqF4h1JIKbqvOnxLSsC5QmmzFcjS9ihyHBvzbRVGkC\n' +
+ 'zEHYpLRedQ2AmQQfsf/VOoZJEOlb7tTk4+SpYtsGte5X/yLT5Bkls7Rp8ubK\n' +
+ '/V99muj1nA/OkasllXQUSGEweVz6ejzJ0oMm3Vewmw8PelsdAnfS7Ud1MnXQ\n' +
+ 'h+O8TCR56F5gAMWxZmxFpZMZyUFOH6KM+vL7HJUBztUS2g0ELsHKy9ep2yhv\n' +
+ 'iABIwx/gEuPr0NDAH9x9XFKg5m3rO64KTY4BRWBISwmQ25dM1s1bwDPLi5XI\n' +
+ '6Daw1glFxpPRrxgQGlVLzJOu5b8swQ==\n' +
+ '=9hCc\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isAdmin: true,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzUlEQVR4AcXBsWlDMRiF0c8XTeAJPIAgoFbgQew1PIbXyKsyhUGtCqM6ZAJX6Z32fykM4hnuObv71++TYJRKlHtji1EqUe6NSJgJM2G2W74/nkzIvfHKKJUZwkyYCbOUe+Odcm/MEGbCTJil2/VMdLx8Eo1S2SL3RnS7nomEmTATZmm//BANKlHujS1GqUT7hRVhJsyEWWLSKJVXcm/MEGbCTJgl/sm9EY1SmTFKJcq9EY1SiYSZMBNm6XE6sHJhJffGOz1OByJhJsyE2R/3lDA4e9QQhAAAAABJRU5ErkJggg=='
+ }
+ ],
+ pendingMembers: [
+ {
+ wallet: 'eip155:0x119bb8ad40B1f94e2b30ae5f59eeaEB67cD0Bd6C',
+ publicKey: null,
+ isAdmin: false,
+ image: null
},
- msg: {
- fromCAIP10: 'eip155:0x1615d2D9ae82D5F0eE79298899962b237386feB7',
- toCAIP10: 'eip155:0x1C48fE875590f8e366447758b13982a3Ca7d9dBE',
- fromDID: 'eip155:0x1615d2D9ae82D5F0eE79298899962b237386feB7',
- toDID: 'eip155:0x1C48fE875590f8e366447758b13982a3Ca7d9dBE',
- messageContent: "Gm gm! It's me... Mario",
- messageType: 'Text',
- signature:
- '-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJkWKQWCZB7dzg7q3axjBYhBJFuYslzDGbuE+3FMnt3ODur\n' +
- 'drGMAAAjtAf/TXjtm2qb6aSikFPKYXm0Ekws+65fisJGf7T48MYkkfcD4t2e\n' +
- 'HXd9LtohzGhcztbOQfAND3yME1GWuMBIksq9rlyEA0ezwsGzCJVhBnkAHBe3\n' +
- '+1v4/mNSMmInU8y6sOiLiOcW7ameJvZvDdPDJ0YHhc9dKDCIh1UAZEPAgx+z\n' +
- 'Wc0DM6pW8bT70dfgnuW2LlLGF5Z23Z1vbHmeszt78+xYY3ez/hoMHXUIE25z\n' +
- 'Wrnt75nasBBahtJ0mwH10ATnsQNE9hTi6XPGYxRSNDM9nyRxTQUpjhNmGS/+\n' +
- '7oFyq8xTcRSaL7d3h8URp9hgFWher5ZZDyMV0jvk+HPguUX54g6Kgw==\n' +
- '=dcRD\n' +
- '-----END PGP SIGNATURE-----\n',
- timestamp: 1683530775648,
- sigType: 'pgp',
- encType: 'pgp',
- encryptedSecret:
- '-----BEGIN PGP MESSAGE-----\n' +
- '\n' +
- 'wcBMA9aU+JGZVRn/AQgA1pIJHyeJinU21r6At5S5ZaWeN0OEKVB2TjpqZ0IW\n' +
- 'lHLKQrQ8k3M16bN+Vf0P+DzDVOL84QRkBD56qSNVHOOCox5wcQeR01CczenV\n' +
- 'LUVvVjBzR2hj7Sdw+Q+M//rgeZPPUDbNyiVmGijelhwDqWd7IOoZY26AGXlm\n' +
- '7YQiElvHN2HcYXaTlLAOy36BcccwHu3Tn06F77ZXaf8FnGMWOUy7wh1/jugg\n' +
- 'D17jUZGLYbmw+u5l9BOfljbw2pb4vtjWht0I1b4GYlKb+bYg/NY0UNsq7mSh\n' +
- 'dGAmOhy5tC2NMjLRRLfD2qasxHoHN50onlB6HcYLl0RCf31ebOgO6rMhUnxt\n' +
- '9cHATAMLWLG2xubrYAEH/2tVeq2j7nJALGSFxjJPboOY57aiFrhXNQ/e/oXH\n' +
- '//TNJgGWx4Ta++OuF2Oexbh9DIZhl6DWld9adXDDtBS/fEyjNsYqwoYlNEJN\n' +
- 'kLvSmokNNrE4MKC1A0GkhSh2MGQDNk42GSgz1tep8XSVc98MHqfNXCHVb5Oa\n' +
- 'OBeWKLFyElT3+KuZxSkCsnoO5YjuCGbXPyG06tXMHXMTncpj1ri+vpjUSnhD\n' +
- 'wn3o0zpNWu0GaWXIgTqj2ZouVwV2S1+wAJQjE8uI1JvBiMhA+X63/GCcApBu\n' +
- 'C7rN0Cs5NGXCn9VWp8i1SCp2NuZ38POABwsXUUkjpF24txyUDX8dbXlkzpao\n' +
- 'g93SQAElYYmyKbGp1TKhAZl2u40mgf2yCYDv2DLRfAKMJDLvmjXoUGEg2UYO\n' +
- '11w6LD0pIykdKJmFtRls/uMnlcoBgDA=\n' +
- '=kzUH\n' +
- '-----END PGP MESSAGE-----\n',
- link: 'bafyreib34jgnpp573rwquejcq5avxvydis7fbykat6dd5z7uazobucoumm',
+ {
+ wallet: 'eip155:0x6e0C509d14EbF26A529bf6DC5CC9bee7F5b8DBa4',
+ publicKey: null,
+ isAdmin: false,
+ image: null
},
- },
-];
+ {
+ wallet: 'eip155:0xE3FDD0527a9F8418f9a7D9e970452827FbE202FF',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGTvNZgBCADouo4S2kPqA//+I7nDAk15/LcJ2TGvDhOYuPNUNMiNGOb4\n' +
+ 'txusuKz6HOaG+K9hiUBpHjKrYEmCT2FEXxt8bfS3SpWb74RHSkWUNUkxk25y\n' +
+ 'gE5gaCKyAdcnOUyVLmobVFFYtH6naK9bULaUtkVik1P0iuEevWHxtTpsjbyH\n' +
+ 'bZtNpVTdprdLib4Wx6bb7VogsvjlvNJcVJ4sfPE0XgsQgAGIev7yJyU0DGzt\n' +
+ '/EbvFX4sv51Kb1dX9ctBcvzVbs9+qT6LTivsrQp+TNHUN4zEeMhnWFFP5K1d\n' +
+ 'H445S6FWk53XvBudcOkFPtltU1MPCS6hmhevArBfYzy5eSlaKA/fH+kFABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZCrD2gy8Zu4awMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBKru9/u8wPcTeHibkasPaDLxm7hrAADa/Af+PbamVg/Ig2S2\n' +
+ 'HgIy4w5x7ulSk1/49+AmuiUMiVUwJSVBhROsyDbLET56w4+1TIMYZFJaczW3\n' +
+ '8tCvAOUSauzc52I3zwGmaCupBJokIWp7ncPh0B8TFYrgThgXV7sLf3xy4roy\n' +
+ 'y8oFz1Zla88krwtPe4Az7TF+WNdXoDsLNJ3GXRmNqs1GITmDqAXFWncl12NM\n' +
+ 'ajUKWIKc/Gi1oKfz22mabJTtWBimDpA12LaGK3GjEK5CiWXT3Tzlqn6R14EZ\n' +
+ '6ohpKZldSJiMPL0Bu9iT52iHOsw1wTZNC1L5lKhOCi3c+/fLRcJZt3hdCjqy\n' +
+ 'd/FSCa8/Ny/GrHBWoL49rSF4pDEA+s7ATQRk7zWYAQgAtNOoHCL7BCnjwp8O\n' +
+ 'htTxEI5r7Q/1zKKHiz6QKjjrGBYyR6gcmPM3JNEcvzY4OsCFnKBv2suOgrqH\n' +
+ '8kXJzfpIQ7u7uJs+O3p/cn86RMANiEnO8NbB/0scpfZ7Vg3eOfoiWYE4I/1o\n' +
+ 'FVDCyZ1YVqtbcmuW6D8i1djjeoUmkUDZyPo7Qs6hUsJeYA/Rfl8mH5sjy2cN\n' +
+ 'WXf8cEtOUqJtwERXt5aRB/nBZiC0bsP6hf0HtAoNA8/96TkqrcQpODW/RckD\n' +
+ 'fo4wkpEONHRH+LGX7GV0pwymHu42TUnULmED6BrMgMYG2sKpxMThxtAxRaiP\n' +
+ 'nZ3DKXr8GCjTYnbEZpoi2zKCOQARAQABwsB2BBgBCAAqBYJk7zWYCZCrD2gy\n' +
+ '8Zu4awKbDBYhBKru9/u8wPcTeHibkasPaDLxm7hrAADGyQgA5NMUkoyDTPZa\n' +
+ 'Znj1dB+17xBXCZ/u7pPQc1DukBefVke7/qYIicdnnEGIX3Zd7TckFRsDljR/\n' +
+ '3418Bne4WyL57fAF/GgYsegpJ9n1KT7oPxWzibIaYdj7R6bkDt5r61EDWC3N\n' +
+ 'VBbnZu9cO15TYkObJIiyNvwbQyd6Dm313b39GnEE8sM709TWsI6Es6rRZAfC\n' +
+ '+sI8ezYxqVUbP7sW3jJZYzdPOhZPHvFd5iJ2EfygEOuk5tb7AimfNwF/CNcB\n' +
+ 'weQGEU7feOSB9lXXA+Ag1duLM4B9bLbbHEQIPhKlBF1ED64e/W/5HNfoAkS4\n' +
+ 'qhzOD5XWs6xs45nnYqUbBFLG9Xk+Jg==\n' +
+ '=qtAv\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isAdmin: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsXECMRRF0csbdbAZBagHKlJMSOL90IUq2h5UABktLE6/HcizY4/fOafrcntzQB/BTKvBEcJMmAmz0keQtRpk67bzRQ1m1m0nu19E1keQCTNhJsxO1+X2JukjmHm+Ppg5Lw9mWg0yYSbMhFnhoPPy4C8JM2EmzArftBr8J2EmzIRZ6SPIWg2yPoKs1WCmjyBrNcj6CDJhJsyEWWk1OKKP4DdaDTJhJsyEWeEHrQbZuu3M3C/iCGEmzITZJ/s7LOkKUABjAAAAAElFTkSuQmCC'
+ }
+ ],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJk7zWZCZBMYqhmfI2WQRYhBC9DyzhpX3ACb/yTq0xiqGZ8\n' +
+ 'jZZBAADwAwgAq/6WjtwRt1aPTLWwtSx80Ng/Wxf97dkpebMXSj9T7f5ia1rM\n' +
+ '8wqsuNUDMEMPB9LM34f6Q5pD994oeN2YT7z34u20mskiNphZdx/DNvu8w9UZ\n' +
+ 'rI3tyjfZULhARNVM34sSABnHtExbl4ZArhNDsT86ku0sZNjr9frn2mtgmlKN\n' +
+ 'nQdGcLJSxbci0hFg3nE5mYNpwZNs2S/2uk11WHKxzMhII6AdePE77BKPqedu\n' +
+ 'PiXDODO2dIvV8glLQoJPRPgc2ap+/xYIBUFljqHGPU/62VSLlHxBJv72p5s/\n' +
+ 'kOxiqD42TmpaaMtfudqgsZsGoYpZDHcMKYGNZs+9qVRHPRD+s0QhEA==\n' +
+ '=c6IF\n' +
+ '-----END PGP SIGNATURE-----\n',
+ groupImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ groupName: 'influential_maroon_gamefowl',
+ groupDescription: 'urgent_brown_butterfly',
+ isPublic: false,
+ groupCreator: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
+ chatId: '5f769c881ffe328117dea3d3acd0b97ce7f4c163e440f75a96be3e33f7d2a000',
+ meta: null,
+ scheduleAt: null,
+ scheduleEnd: null,
+ groupType: 'default',
+ status: null,
+ rules: {},
+ eventType: 'create'
+}
```
-| Parameter | Type | Description |
-| ---------------- | -------------- | ------------------------------------------------------------------ |
-| msg | `IMessageIPFS` | message object |
-| did | `string` | user DID |
-| wallets | `string` | user wallets |
-| profilePicture | `string` | user profile picture |
-| publicKey | `string` | user public key |
-| about | `string` | user description |
-| threadhash | `string` | cid from the latest message sent on this conversation |
-| intent | `string` | addresses concatenated from the users who have approved the intent |
-| intentSentBy | `string` | address of the user who sent the intent |
-| intentTimestamp | `number` | timestamp of the intent |
-| combinedDID | `string` | concatenated addresses of the members of this space |
-| cid | `string` | content identifier on IPFS |
-| spaceId | `string` | space identifier |
-| spaceInformation | `SpaceDTO` | all space information |
+| Parameter | Type | Remarks |
+| -------------------------- | --------------------- | -------------------------------------------------------------- |
+| `members` | `Array` | An array containing member objects. |
+| `members.wallet` | `string` | The wallet address of the member. |
+| `members.publicKey` | `string` | The member's public PGP key (if available). |
+| `members.isAdmin` | `boolean` | Indicates whether the member is an admin. |
+| `members.image` | `string` | Image associated with the member. |
+| `pendingMembers` | `Array` | An array containing pending member objects. |
+| `pendingMembers.wallet` | `string` | The wallet address of the pending member. |
+| `pendingMembers.publicKey` | `string` | The pending member's public PGP key (if available). |
+| `pendingMembers.isAdmin` | `boolean` | Indicates whether the pending member is an admin. |
+| `pendingMembers.image` | `string` | Image associated with the pending member. |
+| `contractAddressERC20` | `string` or `null` | Contract address for ERC20 tokens (Used for tokenGating). |
+| `numberOfERC20` | `number` | The number of ERC20 tokens associated. (Used for tokenGating). |
+| `contractAddressNFT` | `string` or `null` | Contract address for NFT tokens (Used for tokenGating) |
+| `numberOfNFTTokens` | `number` | The number of NFT tokens associated. (Used for tokenGating) |
+| `verificationProof` | `string` | Verification proof associated with group data. |
+| `groupImage` | `string` | Group's image. |
+| `groupName` | `string` | The name of the group. |
+| `groupDescription` | `string` | Description of the group. |
+| `isPublic` | `boolean` | Indicates whether the group is public or private. |
+| `groupCreator` | `string` | Push Profile DID of the group creator. |
+| `chatId` | `string` | Unique chat ID associated with the group. |
+| `meta` | `object` or `null` | Additional metadata (if available). |
+| `scheduleAt` | `timestamp` or `null` | Scheduled start time (if available). |
+| `scheduleEnd` | `timestamp` or `null` | Scheduled end time (if available). |
+| `groupType` | `string` | Type of the group (default, spaces, live etc). |
+| `status` | `string` or `null` | Status information ( active, expired etc) |
+| `rules` | `Object` | Group-specific moderation rules |
+| `eventType` | `string` | The type of event (create, update etc) |
---
-## PushAPI Class
+### **Fetch Group Permissions**
+
+```typescript
+// Fetch Group Permissions
+const fetchGroupPermissions = await userAlice.chat.group.permissions(
+ groupChatId
+);
+```
-### **Initialize**
+| Param | Type | Default | Remarks |
+| -------- | -------- | ------- | ------------ |
+| `chatId` | `string` | - | Group ChatId |
+
+
+
+ Expected response
```typescript
-// Initialize PushAPI class instance
-const userAlice = await PushAPI.initialize(signer);
+{
+ entry: true,
+ chat: true,
+ rules: { entry: { conditions: [] }, chat: { conditions: [] } }
+}
```
-| Param | Type | Default | Remarks |
-| ------------------------ | -------------------------------------- | ------------- | -------------------------------------------------------------------------------------- |
-| `signer` | `SignerType` | - | EthersV5 or Viem Signer |
-| `options` \* | `PushAPIInitializeProps` | - | Optional configuration properties for initializing the PushAPI. |
-| `options.env` \* | `ENV` | `staging` | API env - 'prod', 'staging', 'dev' |
-| `options.progressHook`\* | `(progress: ProgressHookType) => void` | - | A callback function to receive progress updates during initialization. |
-| `options.account` \* | `string` | - | The account to associate with the PushAPI. If not provided, it is derived from signer. |
-| `options.version` \* | `string` | `ENC_TYPE_V3` | The encryption version to use for the PushAPI |
-| `options.versionMeta` \* | `{ NFTPGP_V1 ?: password: string }` | - | Metadata related to the encryption version, including a password if needed. |
-| `options.autoUpgrade` \* | `boolean` | `true` | If `true`, upgrades encryption keys to latest encryption version |
-| `options.origin` \* | `string` | - | Specify origin or source while creating a Push Profile |
+| Param | Type | Remarks |
+| ------- | --------- | ----------------------------------------------------- |
+| `entry` | `boolean` | Refers if the Profile has access to enter the group |
+| `chat` | `boolean` | Refers if the Profile has access to chat in the group |
+| `rules` | `object` | Moderation rules of the group |
-\* - Optional
+
---
-### **Fetch Info**
+### **Update Group**
```typescript
-// Fetch Info
-const aliceInfo = await userAlice.info();
+// Update Group Info
+const createdGroup = await userAlice.chat.group.create(groupChatId, {
+ description: newGroupDescription,
+ image: newGroupImage,
+});
```
+| Param | Type | Default | Remarks |
+| ------------------------ | ------------------ | ------- | ------------------------------------------ |
+| `chatId` | `string` | - | Unique identifier of the group. |
+| `options` \* | `object` | - | Optional Configuration for updating group. |
+| `options.name` \* | `string` | - | Updated Group Name |
+| `options.description` \* | `string` | - | Updated Description |
+| `options.image` \* | `string` | - | Updated Image |
+| `options.scheduleAt` \* | `date` or `null` | - | Updated Start Schedule |
+| `options.scheduleEnd` \* | `date` or `null` | - | Updated End Schedule |
+| `options.status` \* | `string` or `null` | - | Updated group Status |
+| `options.meta` \* | `object` or `null` | - | Updated Group Meta |
+| `options.rules` \* | `object` | - | Updated Group Moderation Rules |
+
+\* - Optional
+
Expected response
```typescript
{
- did: 'eip155:0xEaC9c666570782E262f1E2a0b1d3BE4B95aFA7cd',
- wallets: 'eip155:0xEaC9c666570782E262f1E2a0b1d3BE4B95aFA7cd',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTu6YUBCACa7JaMqfhAnD/9ynE5Rhi8KNQ1tfdQe0ay/9jXX2naZIA+\n' +
- '6WCi1uNcB2TTLfMuzsEl4u/26LTgtkr51snRt2QKgEqi5dXqbRD76wiRLd4h\n' +
- 'ktBb4WB28o+BWOHYYJQq8he+zu3mQWjKLb1e9DyS0cTzwPwWVKce9IsG3NOi\n' +
- 'eM7O5Kg5cU3qHXR+frF25peCBrzNXH+xuuTJPsX85h9dSz/u6dWXhk2LsX3s\n' +
- 'cmX5mFcFErnGvUBddDGZc11q+WzZAtENPCxQrNjpkMtzCj9UMwgsJdzBghZZ\n' +
- 'ZouGTG2uhfmIj3/KHOdwx/KGpTgC1iMVOb78kw9LmaxL6fGy4x9uvvI3ABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO7phQQLCQcICZABDloJB8hpcgMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBMga3B8GDU79nd/0mAEOWgkHyGlyAAAbHAf/bJMPIyvNZNjO\n' +
- 'JK2xA1hYpzIGdbi3jMego6GXrmet3qY50zMKDccB2Ot399y/nmWMVEyfKYaP\n' +
- '7N+mJbeAqIZ8TAHtpw++k/h8/hXoxb9iPsQyWYossuG499XyHnk+KEd4g0Wf\n' +
- 'mqPk/XJB3xLLgW820jOsRRbWLyYKJEdh1Q+GIM+D6oIJ9ZmyRPv25u6yCF2P\n' +
- '2IQZErWeYD/LxqMDw+uHdRZJRiyFy/Y7A43clejN+p3my8oktXh2N4+tEl7i\n' +
- 'Hwxc5z9AOffuEyUerm0Rjwdn8rG8po7AfuXwmTiW1Sdc9TdJtAK/n6e9EFHV\n' +
- 'gHzArwyaydHHy80Wqa+UF591NkPi387ATQRk7umFAQgAs0ao+EFoKJirGHfI\n' +
- '69vZg+eAAUUKG657BzNzTAF2r5Y+a61jdcCAL+DXBcfks+H0dqG36zjOZTCJ\n' +
- 'NirABp5RRPFty2VvUtOyezuKX/MBVg3st3t/yE3SncVaWMblAv3iegviNNpH\n' +
- 'cFKqpHoVBWDNdhFHNsKTjpJcq3BVohy2Dxh8Di8N/1+gEPxADvIuH9MQ8MJk\n' +
- '6lB9XYXBmmqtlQ3sB916mvusUIl8Zxw1C76yY0PAXz055zJMiL1vwo5gKDiV\n' +
- 'iKyzry3wq7upPGJyeTKu7uUMifTPhJtyYvon2TIik5DIgHpqKziirCrolA+s\n' +
- '7LhnFbawqDKleEdyCcL5mFCzXQARAQABwsB2BBgBCAAqBYJk7umFCZABDloJ\n' +
- 'B8hpcgKbDBYhBMga3B8GDU79nd/0mAEOWgkHyGlyAABIqQgAmK9ijEEvtWTm\n' +
- '7/mhkuDEtfPfcMexfkaCcGL4SdZqVz/h+eIL8+4EbI9uq+YTzcjtX8FAEQta\n' +
- 'KWFACNEOPmSy6Sb9bDoNZUVpDaZzNNtqIK9Brt4zjJLEsDfmkuW3S/SgIYBQ\n' +
- 'yTkuNmmAf8dr7L4fG0JlxPyGaL1/w9UDAr7xdU7WcHuyPc0edDGeE7NwaGWp\n' +
- 'uBipXFw8AkikV3fCTDuOi3uhkIzZ5zlGCshD7m0aDSABwr4hbFzLFBDSrsiW\n' +
- 'GKhWGYgf5Vx8qzlwXYYnoW/rn3UXWpeTXjq46ZNaxjHJ4VxGMyn/tHZOEjDE\n' +
- 'vHapLIAgGyw2b+s+zZSqsXaMkH8WOw==\n' +
- '=gPzx\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- encryptedPrivateKey: '{"ciphertext":"4f1243e1ffa76180f46ade2eb093867750c6bf72e8d6c71c7c0edca176c2f9fb32c603bb5e52d933730e0350292431b6e5287b8201f60ce9151b6a141bde98cdc3d9e5df8f84e00e5e4173bdf28b66e9590db10195fbd41ed241a65ab84fb5da251f613376bf78efe1af64613dd54fb05dced7cf8de0907d61489712ad42f06b5c775d97d15dee09b1c58cd79f596674e403353bc7e03297aa0d3fdaecac573c962409622ff8b1335b6fbb661bd2d5f5a076d9079f857849ba917662b40151041eca71385844160fc603c4d1beefbf71b26ac8968de52d6bb534ef6d6e2ea987170059d7d881dc684d28b5b2817804fba3b659e3ec0e802583e581b9f75d2f7e69e428cba91e62719e9ca6697588389db89b982370d23952120c0f972ab4b3a0da888d52b5055c60785d276152e43929df532bc7d5d68c6bc3cfdd1ca780df346113999a19d8e4a96c02f149d1ee4cde802277081ef339153872c00c9e9ddfe3ba8da8c68c0565752fea32258087e66aab37397a27b0228b5ed1aeb09a93b80778fd7f949409106c4cd82ff550aafb9d7bdce8727a76882f59ef2c54a137e51f04b6c27a0b1b92cd781dafb489a5e8203232669f5416454cc9cfe8c5b0fd8abc19d9ef16285a8da0aca2ed747adef7b49b8215790266d9c4791c250b0580e89c6429d10a1bcd45cf016a7ae30e1db948147d992722a7191e31852e6fd3c3679d868f34ebbe65f255be4b90dd64ceb52eaeee7d3356683b7fd511729493c887289ddb0f00c65ca2a95114f0e37d3b73d06333e2787c5fa6dd6f6c9e8334ff153dd63e30c81247efd497cf2c038843d8653edf23822eae07dd19d0be26a921673185bcf016533fdb59150ff46096419e6a6aeb1bd4293fc8146848d715d43afd04aa40f2b5ae9d058671677aad2413952a20b5214e18bbf3b4b033d936d673a0302967de3f74b05b74bc6c89f30ddeaab1bf6c567fcee355797b6cba17c3fcc8955bdf096e2dda2577b3374089d8c9d287552e5658c91e812bd0b8b63482c8de98fde216dd557eb34bafca2f8e73dc4582fa36332e8869f2717519921605915d8e1c75a37295e198ec0af75926d89a6832456304474a10c567334998226d9b6f709ebc216fb067d958e78a622040c91f46af202273d0b40307fb34cba5a6a57fbb196ac6e88c16d527b9bdb04b12fa7ed0bc771692712ccd146c41890b5caddbbb13b8ba77e632b2d7597256fb576ce87d2aff35a0e953b8227a5dcbf30f7d189ca7f77f6f8b2c4eb2752199a7a485ab52a6b65b6edd6cf65caaeb6f65544cc74c2fb3431fa484fb69adbda08d2402da953f20425832b6a2d712d56a5cc34095f25fb9524a478a71d387b7dea45b4bd41e79c61dceca332898dfeecf83999ed4fad892e2ede714b93f3969ad140f38bfa95d321ae5ef089cf0ce435d59f8b6611c0fd014c67ed38646f0771f1a74c1f950ee0900d883aca3ec4efbb2f7737e717007ae757d874573d4d70c9d7e38f8ff30a29b983036e684c4eaf35a7c03ed32a8e3fc62f0863c56830127a5f3c0e905a93e7466a4f43f0793cb6752b9be8d03d7be26170f694ecbb200f611bbf1dac4b6ec085deb8c3d8ee188d8c9c8c17ca720c0f0dee4d00e5866b5443b6af6e69ca64b8eb5a8f5fa1e1d27bfacbf1b0ae11241215358f5045b0d1a73d1b15dbd904709340c1e2b42a4ef78f76b8f901d6337849cff1052f06a8919255b596fb36d2fdf789fdf611813d20729c26d517dde6f11a3f6045ec5158652e128cf7c483a0fb8ab772cb5cdb56e42e6bf8c863f173307c3e053168e54e9e65bcacbb144413ff76d08a94929e6cdde2c5944246a4b344f3ca0ada3b403429750bdce76f04668b05ed79e9119f00901e7f7b4f1eea8a1b5b0186e3ed41277040a257601b0f3917db595f3f1808d92071a4e9521a251e9c5a66f2c8a57511f61b9fd88df77330aeb4bc15c043814b33610d60f6d0a13fd7977efaa1843913f6d3a79bc88020406c9979163684efe7b7ade9613221d06b52cd96abd31b77a707748d52e6e16c8c90821f29359b35307c10dafce5f35c0ff9802c23aef19f0a95b49a317cd6207002a5a9b822b4c056c4cbf9b27045dda8325d93060f358bb837f00954a6e281d1bdd1817a7cce8ed4a801f9164d32c52739c1ac650109868664be1fabab47c675222dc9ff9d75f9fb49531c832264aa5b55998675975f59e34829ce90b00092bd77e46328a6459d5c967d905b8e976611b839925ad742500231fa86cb5f7e6f39cb1e2e36b81c55269ea0f5fdcba5c8c0e38a899540d52be49c83efae5243998b926f029dc2980d4fdb1c125db409d015e0b36bc02272da1c688ee1f61d23cbde585064ab1e2164d0ca529774ec7797407ba5d988c58853e74a124a64dc24d0289b6a599354faf64790177c3032f5d660d7b76dfbf1c03388a7c75b2309c509c6a92144e124c8bd188274bc844e8f0aa7b5a06e79ad5776b5a62003b89aef194dcc03cd3c1b1f3ea541805cfc4e18aa159f9b5395185b573538c9bab16876dff91f365d16dcc56b339b01b86882ef8e52c51edd9c5b2f8a35713ed6eb43036e09f64f6e59ab417958faff974b6705400b341439fef4cba371c601927da7e0a8f23e1c6d3e070a19c2216da85f159d60303ab1321e479f4c371372845cef03daa7d2776c18face6cfa2ff9eed26f9f0a353a0f1c9a99b2556dccc1212fcb5c2078a3b0e58a7f3f7b3f346d624435ef94c95d40dc726d2e7400ae405e89473a934e7646124e34473dfe17f7f9cf481aa059ef422508ffe67f9b9276084973db0683269a046c1a0aafa7ab075b28008cbfb862b7e30c8b2afa1c2923d914b3d2469266e8e0182274a3d8d89642723820e61aa2d97a9370789ec4e89ebee05b6c0bef10778caf2a34c2d7622dde5fa64b012bea6205127c3c845229ef553f013b73823dc6631078fc628532e3e518bdc790ab8460078dedf0c5cb00492136813e2b91679bba82f3cf95169751933bee4358f84154014dbcc1de1a30613218039ebb2444429380fd283d3b60bd5d5b470e861f6ecc751c22aa467168512a0ef45755e6b59a7be591bd3b08fde874b166ccfbbedba10a0956d2d18cbda515341c2112d6094a746e9f562db6543e5bde2c4d4f7c06b7550400d66f7242a14f34cd8a7374372f0eea49a49b72909fc11ff81ea54a1e2c07225cdee856383a657b0f13c14b00ae3b7b2a32a22beaab8cfd18641dbfa82619fdcdddd3339e9423e71c487305e8aa932b694e94c37c7e418e4014c8bb264f47e8283e216eeeabf0fbdd2f5eb8d0ea979738d4f18b7bf72d7711f5d22653f217c7305314ec2c47a0ecbf1dc8f9bc1379ae38e2a04e736a1171b947609bb66f8d352ce57230d709f196953471c5504c7f9f40ed2f64bf3bd04bd57521a364ea03b5f0603cceec7851738d97c3fd73c16547d4d143b009a79832a1ed244937dce09edf2d5e32ae52ab0331c449325dce9e5e8ed1563c967a5f92031f4275e3179274ef3e0752ac01caf8a20aabb23d584d4d6607833f95cfc92832d936c37bb8b37222aa842f48944d06b37434c8dce5f19b450a7d1bd568672ef2c8eaa2afb7cff404b33377a61061f56b01849feb918521a7d63cfbe12466aedc7159c577f213f2c157586b8719164cd7108edfa9211287b43aadbad997bc62f8169eec4a6e02aeb535f670878e6af538b5281da04470d318f893102613977390a434e0557302a68ce42e532d350446d4d813b84c07b42bf22fbe4889096ec6303574c95040d8dcfed1b9bd26782c5033d7d1a491fece156cbc19a705204ed38a547e00a09b73bc7a702ef9c2e659171d1daab63958268148aba59766bc7a4ffb68c1ae047d1f0c5fb45fbacd07079f72af301c6aa00eebc0662c6792fc707d388b339d4f45afbf576bacf8730ec3e0f1e9dc0f9a6d58fd146b2293aed8d110da24336f9a4c01ae12c03ce214c6502f5fbc5224dd8b8b2e4edf2af16b811e5c8595fa76cafe34ba66199caaed48b5dfd5ae74a3e6b6d51a09c70afc30ebc0f40d51a15f1a8c2c41ec482eddf14bed3fd11a9e2aa4446268af25b49e429e2528d5df57797f6f3cd431eb5ded8f830c85cecde8012c31500ce9363903739a6759704fa87bfef984ed0285c8c0a5bf2f0985b1b511eb4145e4b27e2df6aa7b5c7a913b76b1ca869151b75c0717389b3d186f4e4637a5ceba3cef64809c3a06551a6a46be31af61c0ef78afb057f6cc625647dc04dcd74eb97f7aee0f5640e24b7662c799013efb83c80ec2851acda7c6328de789ae99ce296494225bd169e49c9a12dc7e281778f7fe275e72571cd5a3608733998d2f6b96c1d26c25223153fc5afc2f6e3d72f57fbcb2d087d718d3b6703b286f1e340c23cd3bc715797edf3ce6d5169bcf783ac9686233cc0358725143008b25bfbd329e1c30654e4b4c9461239d41ae77f706e64e5e60ce6de83becfd056f2678f17474ab9f4976b2d7d5d014d78f716d7d4edbf6ce4ed44ed677274d6b9b6e4bf4946dfd1ed8b821c81957b4bf5cd534ed6ca84dadd9d6380513dc6406b32dcd5c1bfa468a79e88a56656e71aed0c6675540e1617a31e1c122295427590e83b63e8da58a6c5c21a15703994bdc2b90d399b62679a4269224257f3ead5a2dd0980e6f5a45c5a9392929cc4743e106c7335136c9f8a3a29190462eef908eab02cda97dbcb71dff26b0ef4dae51de293b4cff0ebf37fce1391247c5ccf77dfb64974c4a1e6beeaf82041bb0d653e2e9b612f3442bba8480b86fd7b35514fc056d7429d5fb36199d4a6f632ea615d9acc961082d9d91aca416b57582bcd2f182f5f5be02b3f597c680b2e6b37ee4d133e51d077491cb536d6261808c42684d0912fd7bcc97dacdf32394e7b","salt":"da23dc7dbf23136dabc337a0caa170c0db7e4efec5f5c8a648dff9b7cd7df49f","nonce":"fe0e4ec3d40fb7de21a354bf","version":"eip191-aes256-gcm-hkdf-sha256","preKey":"b43efae4c92a35d9c0b5f6178cb8b8a6642c77d0a9281f61beb9f6e8f7b006a5"}',
- verificationProof: 'eip191v2:0x97ca70a87ec658e0e488e8b9f71644ee23840d809803fcf5bdcd174c9f39cdeb27f6e3a8885fec5bede5f264b3996bc3fa019b0d52745a5573a972b7e79e321c1c',
- msgSent: 0,
- maxMsgPersisted: 1000,
- profile: {
- name: null,
- desc: null,
- picture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAqElEQVR4AcXBsQ3CUBBEwcfKCfIPnbgxF+ACKIYct+cGDpEdpCeCS0Damcu2PN40gqQaiE6QVAPREWbCTJgJM2EmzITZxJcg+acgqQaiEmbCTJhNQVINRCdIOgPRCZJKmAkzYTYNRLWfT6pjnalu54vOsc5U+/mkOtaZSpgJM2E2BUknSKr7eqWXdIKkEmbCTJhdtuXxphEkvxiIjjATZsJMmAkzYSbMPjaMJNvaf06gAAAAAElFTkSuQmCC',
- profileVerificationProof: null
- },
- origin: null,
- name: null,
- about: null,
- profilePicture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAqElEQVR4AcXBsQ3CUBBEwcfKCfIPnbgxF+ACKIYct+cGDpEdpCeCS0Damcu2PN40gqQaiE6QVAPREWbCTJgJM2EmzITZxJcg+acgqQaiEmbCTJhNQVINRCdIOgPRCZJKmAkzYTYNRLWfT6pjnalu54vOsc5U+/mkOtaZSpgJM2E2BUknSKr7eqWXdIKkEmbCTJhdtuXxphEkvxiIjjATZsJMmAkzYSbMPjaMJNvaf06gAAAAAElFTkSuQmCC',
- numMsg: 0,
- allowedNumMsg: 1000,
- encryptionType: 'eip191-aes256-gcm-hkdf-sha256',
- signature: '0x97ca70a87ec658e0e488e8b9f71644ee23840d809803fcf5bdcd174c9f39cdeb27f6e3a8885fec5bede5f264b3996bc3fa019b0d52745a5573a972b7e79e321c1c',
- sigType: 'eip191v2',
- encryptedPassword: null,
- nftOwner: null,
- linkedListHash: null,
- nfts: null
+ members: [
+ {
+ wallet: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGTvNZgBCADeYpZfxgn1HoMUuWM42v8ZWfLPwglQYmzz5rY3PdPPoRFU\n' +
+ 'v0AyPjYKpmLh2ZNfXjPaS9GuMdpXaomYSEwsV02hXZOQelo9cLop0Fc2i+l7\n' +
+ '70rYhePuOuQ+XD/xYzhngAgNJ9rX96YnSodldb8uJfxYmgoF0E9Z2o2fgZGj\n' +
+ 'll2CPnOaLXZaBQlPS3x/461TmZ1n2ZePS/fwiC7taLz3PtyGtKaC0vo4isvI\n' +
+ 'yf04fkjudG0XIns5CWjdR2HeDC8BzSl8OVj8AQAc5uVU8Abk+ejWVr4zfoox\n' +
+ 'eaziDPgGdkckFiQ6Tdsg0tPwwOpSrCCtJocTmc/fWaBb0YlnyAAL88fJABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZBMYqhmfI2WQQMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAACxNQf/UrM/whR7vCs+\n' +
+ 'ez8Y8Hz4WqIuXtfMh4l2nKVv5UUuAfQkBxEY5j6Ga2+JgKU3neQ34x/v6fm9\n' +
+ 'CLcY38Tc4AWyEx8KC78J+xOs7RMfyNBeiaf8KdaFfQrP0nMmufE6TxkfV1Y5\n' +
+ 'LJZZ8350rZVtYJppWtlH+gbyUmMObyWDWbL3aWtqa3xjv0kLsf7TnugiFwzB\n' +
+ 'gHHtk8tlDSOxRt0VdNNd19+/zrBYNl07Ig24WD2ETaJiaqa651z24/6/MkGT\n' +
+ 'MBoQh+679tuWWcTrNi4jIA8jhSQ5BOgbAapl3qXk0m9/Aexpe2s6ISLXe8YJ\n' +
+ 'j4cObDLv/ZKKeLZYTq9lVCydLAQUbs7ATQRk7zWYAQgAmx36uefgUF4cCSYH\n' +
+ 'WMWAOTyc8Awo+hxn6FktOLU1+9hfGrX2jwGLOoOwjNgbYJbiSvRglAX2b57/\n' +
+ 'qkkltAg1ZYCLSUzfBUbbWYlJNBwpv7+52zHaLUZ3gmI5aE48ad+uzaadgpVT\n' +
+ 'VqLbhdgkN6jkemPTlfMehyS49AAbmqeKfo2U72tm9ZqT2cPVCASMjN/Ux2qG\n' +
+ '3W8HTo0KIVFSbkTthl1zAlwAFksp0q437+pxbdJIecJ9mO6N4OQMnv+hVBDc\n' +
+ 'WrPqBDJ0nas4JNgLxmLv0pheGg/TEfwS/p6xGRW5m08bj2l0cgqmEaM27jbi\n' +
+ 'DEpOykRWsDMhheEfI2zV/Qam8QARAQABwsB2BBgBCAAqBYJk7zWYCZBMYqhm\n' +
+ 'fI2WQQKbDBYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAAAnBggA1gkIopr9HJFP\n' +
+ 'fO5SebcbowH4AG9M0qBqF4h1JIKbqvOnxLSsC5QmmzFcjS9ihyHBvzbRVGkC\n' +
+ 'zEHYpLRedQ2AmQQfsf/VOoZJEOlb7tTk4+SpYtsGte5X/yLT5Bkls7Rp8ubK\n' +
+ '/V99muj1nA/OkasllXQUSGEweVz6ejzJ0oMm3Vewmw8PelsdAnfS7Ud1MnXQ\n' +
+ 'h+O8TCR56F5gAMWxZmxFpZMZyUFOH6KM+vL7HJUBztUS2g0ELsHKy9ep2yhv\n' +
+ 'iABIwx/gEuPr0NDAH9x9XFKg5m3rO64KTY4BRWBISwmQ25dM1s1bwDPLi5XI\n' +
+ '6Daw1glFxpPRrxgQGlVLzJOu5b8swQ==\n' +
+ '=9hCc\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isAdmin: true,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzUlEQVR4AcXBsWlDMRiF0c8XTeAJPIAgoFbgQew1PIbXyKsyhUGtCqM6ZAJX6Z32fykM4hnuObv71++TYJRKlHtji1EqUe6NSJgJM2G2W74/nkzIvfHKKJUZwkyYCbOUe+Odcm/MEGbCTJil2/VMdLx8Eo1S2SL3RnS7nomEmTATZmm//BANKlHujS1GqUT7hRVhJsyEWWLSKJVXcm/MEGbCTJgl/sm9EY1SmTFKJcq9EY1SiYSZMBNm6XE6sHJhJffGOz1OByJhJsyE2R/3lDA4e9QQhAAAAABJRU5ErkJggg=='
+ }
+ ],
+ pendingMembers: [
+ {
+ wallet: 'eip155:0x119bb8ad40B1f94e2b30ae5f59eeaEB67cD0Bd6C',
+ publicKey: null,
+ isAdmin: false,
+ image: null
+ },
+ {
+ wallet: 'eip155:0x6e0C509d14EbF26A529bf6DC5CC9bee7F5b8DBa4',
+ publicKey: null,
+ isAdmin: false,
+ image: null
+ },
+ {
+ wallet: 'eip155:0xE3FDD0527a9F8418f9a7D9e970452827FbE202FF',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGTvNZgBCADouo4S2kPqA//+I7nDAk15/LcJ2TGvDhOYuPNUNMiNGOb4\n' +
+ 'txusuKz6HOaG+K9hiUBpHjKrYEmCT2FEXxt8bfS3SpWb74RHSkWUNUkxk25y\n' +
+ 'gE5gaCKyAdcnOUyVLmobVFFYtH6naK9bULaUtkVik1P0iuEevWHxtTpsjbyH\n' +
+ 'bZtNpVTdprdLib4Wx6bb7VogsvjlvNJcVJ4sfPE0XgsQgAGIev7yJyU0DGzt\n' +
+ '/EbvFX4sv51Kb1dX9ctBcvzVbs9+qT6LTivsrQp+TNHUN4zEeMhnWFFP5K1d\n' +
+ 'H445S6FWk53XvBudcOkFPtltU1MPCS6hmhevArBfYzy5eSlaKA/fH+kFABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZCrD2gy8Zu4awMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBKru9/u8wPcTeHibkasPaDLxm7hrAADa/Af+PbamVg/Ig2S2\n' +
+ 'HgIy4w5x7ulSk1/49+AmuiUMiVUwJSVBhROsyDbLET56w4+1TIMYZFJaczW3\n' +
+ '8tCvAOUSauzc52I3zwGmaCupBJokIWp7ncPh0B8TFYrgThgXV7sLf3xy4roy\n' +
+ 'y8oFz1Zla88krwtPe4Az7TF+WNdXoDsLNJ3GXRmNqs1GITmDqAXFWncl12NM\n' +
+ 'ajUKWIKc/Gi1oKfz22mabJTtWBimDpA12LaGK3GjEK5CiWXT3Tzlqn6R14EZ\n' +
+ '6ohpKZldSJiMPL0Bu9iT52iHOsw1wTZNC1L5lKhOCi3c+/fLRcJZt3hdCjqy\n' +
+ 'd/FSCa8/Ny/GrHBWoL49rSF4pDEA+s7ATQRk7zWYAQgAtNOoHCL7BCnjwp8O\n' +
+ 'htTxEI5r7Q/1zKKHiz6QKjjrGBYyR6gcmPM3JNEcvzY4OsCFnKBv2suOgrqH\n' +
+ '8kXJzfpIQ7u7uJs+O3p/cn86RMANiEnO8NbB/0scpfZ7Vg3eOfoiWYE4I/1o\n' +
+ 'FVDCyZ1YVqtbcmuW6D8i1djjeoUmkUDZyPo7Qs6hUsJeYA/Rfl8mH5sjy2cN\n' +
+ 'WXf8cEtOUqJtwERXt5aRB/nBZiC0bsP6hf0HtAoNA8/96TkqrcQpODW/RckD\n' +
+ 'fo4wkpEONHRH+LGX7GV0pwymHu42TUnULmED6BrMgMYG2sKpxMThxtAxRaiP\n' +
+ 'nZ3DKXr8GCjTYnbEZpoi2zKCOQARAQABwsB2BBgBCAAqBYJk7zWYCZCrD2gy\n' +
+ '8Zu4awKbDBYhBKru9/u8wPcTeHibkasPaDLxm7hrAADGyQgA5NMUkoyDTPZa\n' +
+ 'Znj1dB+17xBXCZ/u7pPQc1DukBefVke7/qYIicdnnEGIX3Zd7TckFRsDljR/\n' +
+ '3418Bne4WyL57fAF/GgYsegpJ9n1KT7oPxWzibIaYdj7R6bkDt5r61EDWC3N\n' +
+ 'VBbnZu9cO15TYkObJIiyNvwbQyd6Dm313b39GnEE8sM709TWsI6Es6rRZAfC\n' +
+ '+sI8ezYxqVUbP7sW3jJZYzdPOhZPHvFd5iJ2EfygEOuk5tb7AimfNwF/CNcB\n' +
+ 'weQGEU7feOSB9lXXA+Ag1duLM4B9bLbbHEQIPhKlBF1ED64e/W/5HNfoAkS4\n' +
+ 'qhzOD5XWs6xs45nnYqUbBFLG9Xk+Jg==\n' +
+ '=qtAv\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isAdmin: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsXECMRRF0csbdbAZBagHKlJMSOL90IUq2h5UABktLE6/HcizY4/fOafrcntzQB/BTKvBEcJMmAmz0keQtRpk67bzRQ1m1m0nu19E1keQCTNhJsxO1+X2JukjmHm+Ppg5Lw9mWg0yYSbMhFnhoPPy4C8JM2EmzArftBr8J2EmzIRZ6SPIWg2yPoKs1WCmjyBrNcj6CDJhJsyEWWk1OKKP4DdaDTJhJsyEWeEHrQbZuu3M3C/iCGEmzITZJ/s7LOkKUABjAAAAAElFTkSuQmCC'
+ }
+ ],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJk7zWZCZBMYqhmfI2WQRYhBC9DyzhpX3ACb/yTq0xiqGZ8\n' +
+ 'jZZBAADwAwgAq/6WjtwRt1aPTLWwtSx80Ng/Wxf97dkpebMXSj9T7f5ia1rM\n' +
+ '8wqsuNUDMEMPB9LM34f6Q5pD994oeN2YT7z34u20mskiNphZdx/DNvu8w9UZ\n' +
+ 'rI3tyjfZULhARNVM34sSABnHtExbl4ZArhNDsT86ku0sZNjr9frn2mtgmlKN\n' +
+ 'nQdGcLJSxbci0hFg3nE5mYNpwZNs2S/2uk11WHKxzMhII6AdePE77BKPqedu\n' +
+ 'PiXDODO2dIvV8glLQoJPRPgc2ap+/xYIBUFljqHGPU/62VSLlHxBJv72p5s/\n' +
+ 'kOxiqD42TmpaaMtfudqgsZsGoYpZDHcMKYGNZs+9qVRHPRD+s0QhEA==\n' +
+ '=c6IF\n' +
+ '-----END PGP SIGNATURE-----\n',
+ groupImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ groupName: 'influential_maroon_gamefowl',
+ groupDescription: 'urgent_brown_butterfly',
+ isPublic: false,
+ groupCreator: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
+ chatId: '5f769c881ffe328117dea3d3acd0b97ce7f4c163e440f75a96be3e33f7d2a000',
+ meta: null,
+ scheduleAt: null,
+ scheduleEnd: null,
+ groupType: 'default',
+ status: null,
+ rules: {},
+ eventType: 'update'
}
```
-| Parameter | Type | Remarks |
-| ------------------- | -------- | --------------------------------------------------------------- |
-| did | `string` | user decentralized identity |
-| wallets | `string` | all wallets associated to the did |
-| publicKey | `string` | Public PGP key |
-| encryptedPrivateKey | `string` | Encrypted PGP Private Key |
-| verificationProof | `string` | Verification proof |
-| msgSent | `number` | Number of messages sent |
-| maxMsgPersisted | `number` | Maximum number of messages that can be persisted |
-| profile | `object` | User profile information |
-| origin | `string` | Origin information (source of the data) |
-| name | `string` | Profile Name ( Deprecated ) |
-| about | `string` | Profile Description ( Deprecated ) |
-| profilePicture | `string` | Profile Picture ( Deprecated ) |
-| numMsg | `number` | Number of messages sent ( Deprecated ) |
-| allowedNumMsg | `number` | Maximum number of messages that can be persisted ( Deprecated ) |
-| encryptionType | `string` | Type of encryption used |
-| signature | `string` | Account signature ( Deprecated ) |
-| sigType | `string` | Type of signature ( Dprecated ) |
-| encryptedPassword | `null` | Encrypted user password ( Deprecated ) |
-| nftOwner | `null` | Owner of NFT ( Deprecated ) |
-| linkedListHash | `null` | Deprecated |
-| nfts | `null` | Information about owned NFTs( Dprecated ) |
+| Parameter | Type | Remarks |
+| -------------------------- | --------------------- | -------------------------------------------------------------- |
+| `members` | `Array` | An array containing member objects. |
+| `members.wallet` | `string` | The wallet address of the member. |
+| `members.publicKey` | `string` | The member's public PGP key (if available). |
+| `members.isAdmin` | `boolean` | Indicates whether the member is an admin. |
+| `members.image` | `string` | Image associated with the member. |
+| `pendingMembers` | `Array` | An array containing pending member objects. |
+| `pendingMembers.wallet` | `string` | The wallet address of the pending member. |
+| `pendingMembers.publicKey` | `string` | The pending member's public PGP key (if available). |
+| `pendingMembers.isAdmin` | `boolean` | Indicates whether the pending member is an admin. |
+| `pendingMembers.image` | `string` | Image associated with the pending member. |
+| `contractAddressERC20` | `string` or `null` | Contract address for ERC20 tokens (Used for tokenGating). |
+| `numberOfERC20` | `number` | The number of ERC20 tokens associated. (Used for tokenGating). |
+| `contractAddressNFT` | `string` or `null` | Contract address for NFT tokens (Used for tokenGating) |
+| `numberOfNFTTokens` | `number` | The number of NFT tokens associated. (Used for tokenGating) |
+| `verificationProof` | `string` | Verification proof associated with group data. |
+| `groupImage` | `string` | Group's image. |
+| `groupName` | `string` | The name of the group. |
+| `groupDescription` | `string` | Description of the group. |
+| `isPublic` | `boolean` | Indicates whether the group is public or private. |
+| `groupCreator` | `string` | Push Profile DID of the group creator. |
+| `chatId` | `string` | Unique chat ID associated with the group. |
+| `meta` | `object` or `null` | Additional metadata (if available). |
+| `scheduleAt` | `timestamp` or `null` | Scheduled start time (if available). |
+| `scheduleEnd` | `timestamp` or `null` | Scheduled end time (if available). |
+| `groupType` | `string` | Type of the group (default, spaces, live etc). |
+| `status` | `string` or `null` | Status information ( active, expired etc) |
+| `rules` | `Object` | Group-specific moderation rules |
+| `eventType` | `string` | The type of event (create, update etc) |
---
-### **Fetch Profile Info**
-
-```typescript
-// Fetch Push Profile
-const aliceProfileInfo = await userAlice.profile.info();
-```
-
-
-
- Expected response
+### **Add To Group**
```typescript
-{
- name: null,
- desc: null,
- picture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAqElEQVR4AcXBsQ3CUBBEwcfKCfIPnbgxF+ACKIYct+cGDpEdpCeCS0Damcu2PN40gqQaiE6QVAPREWbCTJgJM2EmzITZxJcg+acgqQaiEmbCTJhNQVINRCdIOgPRCZJKmAkzYTYNRLWfT6pjnalu54vOsc5U+/mkOtaZSpgJM2E2BUknSKr7eqWXdIKkEmbCTJhdtuXxphEkvxiIjjATZsJMmAkzYSbMPjaMJNvaf06gAAAAAElFTkSuQmCC',
- profileVerificationProof: null
-}
-```
-
-| Param | Type | Remarks |
-| ------------------------ | ------------------ | ------------------------- |
-| name | `string` or `null` | Profile Name |
-| desc | `string` or `null` | Profile Description |
-| picture | `string` or `null` | Profile Picture |
-| profileVerificationProof | `string` or `null` | Profile VerificationProof |
-
-
-
----
-
-### **Update Profile Info**
+// Add Member To Group
+const addMemberToGroup = await userAlice.chat.group.add(groupChatId, {
+ role : 'MEMBER'
+ accounts: [account1, account2]
+});
-```typescript
-// Update Push Profile
-const updatedProfile = await userAlice.profile.update({ name: updatedName });
+// Add Admin To Group
+const addAdminToGroup = await userAlice.chat.group.add(groupChatId, {
+ role : 'ADMIN'
+ accounts: [account1, account2]
+});
```
-| Param | Type | Default | Remarks |
-| -------------------- | -------- | ------- | ------------------------------------------ |
-| `options` | `object` | - | Configuration options for updating profile |
-| `options.name` \* | `string` | - | Profile Name |
-| `options.desc` \* | `string` | - | Profile Description |
-| `options.picture` \* | `string` | - | Profile Picture |
-
-\* - Optional
+| Param | Type | Default | Remarks |
+| ------------------ | ------------------- | ------- | ----------------------------------------------- |
+| `chatId` | `string` | - | Unique identifier of the group. |
+| `options` | `object` | - | Configuration for adding participants to group. |
+| `options.role` | `ADMIN` or `MEMBER` | - | Role of added participant |
+| `options.accounts` | `string[]` | - | Added participant addresses |
@@ -4223,500 +4118,830 @@ const updatedProfile = await userAlice.profile.update({ name: updatedName });
```typescript
{
- name: 'Bob The Builder',
- desc: null,
- picture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA0klEQVR4AcXBsW0EIRRF0esv0k2mGhogp4FJ3AC1UMM2QE66AQ24DZIpwE75E2CtbOmd8/H1+vxmcZ2ZVao4vbCVKk4vOI9nY2WIGWKGWOAmVbZS5S2p4gw8Q8wQM8QCv+gFJ1W2esFJlS1DzBAzxEKcmVUv/KtecGLNrAwxQ8wQC+NoOE/2Zmbn8WzsDDxDzBAzxEKcmZ1xNP4izsyOIWaIGWKBm3E0VnFmVuNo7MSZWY2jsYozszLEDDFDLHBznRmn4sSZecd1ZpyKY4gZYobYD0RQL1bKLk86AAAAAElFTkSuQmCC',
- blockedUsersList: [],
- verificationProof: 'pgpv2:-----BEGIN PGP SIGNATURE-----\n' +
+ members: [
+ {
+ wallet: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGTvNZgBCADeYpZfxgn1HoMUuWM42v8ZWfLPwglQYmzz5rY3PdPPoRFU\n' +
+ 'v0AyPjYKpmLh2ZNfXjPaS9GuMdpXaomYSEwsV02hXZOQelo9cLop0Fc2i+l7\n' +
+ '70rYhePuOuQ+XD/xYzhngAgNJ9rX96YnSodldb8uJfxYmgoF0E9Z2o2fgZGj\n' +
+ 'll2CPnOaLXZaBQlPS3x/461TmZ1n2ZePS/fwiC7taLz3PtyGtKaC0vo4isvI\n' +
+ 'yf04fkjudG0XIns5CWjdR2HeDC8BzSl8OVj8AQAc5uVU8Abk+ejWVr4zfoox\n' +
+ 'eaziDPgGdkckFiQ6Tdsg0tPwwOpSrCCtJocTmc/fWaBb0YlnyAAL88fJABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZBMYqhmfI2WQQMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAACxNQf/UrM/whR7vCs+\n' +
+ 'ez8Y8Hz4WqIuXtfMh4l2nKVv5UUuAfQkBxEY5j6Ga2+JgKU3neQ34x/v6fm9\n' +
+ 'CLcY38Tc4AWyEx8KC78J+xOs7RMfyNBeiaf8KdaFfQrP0nMmufE6TxkfV1Y5\n' +
+ 'LJZZ8350rZVtYJppWtlH+gbyUmMObyWDWbL3aWtqa3xjv0kLsf7TnugiFwzB\n' +
+ 'gHHtk8tlDSOxRt0VdNNd19+/zrBYNl07Ig24WD2ETaJiaqa651z24/6/MkGT\n' +
+ 'MBoQh+679tuWWcTrNi4jIA8jhSQ5BOgbAapl3qXk0m9/Aexpe2s6ISLXe8YJ\n' +
+ 'j4cObDLv/ZKKeLZYTq9lVCydLAQUbs7ATQRk7zWYAQgAmx36uefgUF4cCSYH\n' +
+ 'WMWAOTyc8Awo+hxn6FktOLU1+9hfGrX2jwGLOoOwjNgbYJbiSvRglAX2b57/\n' +
+ 'qkkltAg1ZYCLSUzfBUbbWYlJNBwpv7+52zHaLUZ3gmI5aE48ad+uzaadgpVT\n' +
+ 'VqLbhdgkN6jkemPTlfMehyS49AAbmqeKfo2U72tm9ZqT2cPVCASMjN/Ux2qG\n' +
+ '3W8HTo0KIVFSbkTthl1zAlwAFksp0q437+pxbdJIecJ9mO6N4OQMnv+hVBDc\n' +
+ 'WrPqBDJ0nas4JNgLxmLv0pheGg/TEfwS/p6xGRW5m08bj2l0cgqmEaM27jbi\n' +
+ 'DEpOykRWsDMhheEfI2zV/Qam8QARAQABwsB2BBgBCAAqBYJk7zWYCZBMYqhm\n' +
+ 'fI2WQQKbDBYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAAAnBggA1gkIopr9HJFP\n' +
+ 'fO5SebcbowH4AG9M0qBqF4h1JIKbqvOnxLSsC5QmmzFcjS9ihyHBvzbRVGkC\n' +
+ 'zEHYpLRedQ2AmQQfsf/VOoZJEOlb7tTk4+SpYtsGte5X/yLT5Bkls7Rp8ubK\n' +
+ '/V99muj1nA/OkasllXQUSGEweVz6ejzJ0oMm3Vewmw8PelsdAnfS7Ud1MnXQ\n' +
+ 'h+O8TCR56F5gAMWxZmxFpZMZyUFOH6KM+vL7HJUBztUS2g0ELsHKy9ep2yhv\n' +
+ 'iABIwx/gEuPr0NDAH9x9XFKg5m3rO64KTY4BRWBISwmQ25dM1s1bwDPLi5XI\n' +
+ '6Daw1glFxpPRrxgQGlVLzJOu5b8swQ==\n' +
+ '=9hCc\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isAdmin: true,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzUlEQVR4AcXBsWlDMRiF0c8XTeAJPIAgoFbgQew1PIbXyKsyhUGtCqM6ZAJX6Z32fykM4hnuObv71++TYJRKlHtji1EqUe6NSJgJM2G2W74/nkzIvfHKKJUZwkyYCbOUe+Odcm/MEGbCTJil2/VMdLx8Eo1S2SL3RnS7nomEmTATZmm//BANKlHujS1GqUT7hRVhJsyEWWLSKJVXcm/MEGbCTJgl/sm9EY1SmTFKJcq9EY1SiYSZMBNm6XE6sHJhJffGOz1OByJhJsyE2R/3lDA4e9QQhAAAAABJRU5ErkJggg=='
+ }
+ ],
+ pendingMembers: [
+ {
+ wallet: 'eip155:0x119bb8ad40B1f94e2b30ae5f59eeaEB67cD0Bd6C',
+ publicKey: null,
+ isAdmin: false,
+ image: null
+ },
+ {
+ wallet: 'eip155:0x6e0C509d14EbF26A529bf6DC5CC9bee7F5b8DBa4',
+ publicKey: null,
+ isAdmin: false,
+ image: null
+ },
+ {
+ wallet: 'eip155:0xE3FDD0527a9F8418f9a7D9e970452827FbE202FF',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGTvNZgBCADouo4S2kPqA//+I7nDAk15/LcJ2TGvDhOYuPNUNMiNGOb4\n' +
+ 'txusuKz6HOaG+K9hiUBpHjKrYEmCT2FEXxt8bfS3SpWb74RHSkWUNUkxk25y\n' +
+ 'gE5gaCKyAdcnOUyVLmobVFFYtH6naK9bULaUtkVik1P0iuEevWHxtTpsjbyH\n' +
+ 'bZtNpVTdprdLib4Wx6bb7VogsvjlvNJcVJ4sfPE0XgsQgAGIev7yJyU0DGzt\n' +
+ '/EbvFX4sv51Kb1dX9ctBcvzVbs9+qT6LTivsrQp+TNHUN4zEeMhnWFFP5K1d\n' +
+ 'H445S6FWk53XvBudcOkFPtltU1MPCS6hmhevArBfYzy5eSlaKA/fH+kFABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZCrD2gy8Zu4awMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBKru9/u8wPcTeHibkasPaDLxm7hrAADa/Af+PbamVg/Ig2S2\n' +
+ 'HgIy4w5x7ulSk1/49+AmuiUMiVUwJSVBhROsyDbLET56w4+1TIMYZFJaczW3\n' +
+ '8tCvAOUSauzc52I3zwGmaCupBJokIWp7ncPh0B8TFYrgThgXV7sLf3xy4roy\n' +
+ 'y8oFz1Zla88krwtPe4Az7TF+WNdXoDsLNJ3GXRmNqs1GITmDqAXFWncl12NM\n' +
+ 'ajUKWIKc/Gi1oKfz22mabJTtWBimDpA12LaGK3GjEK5CiWXT3Tzlqn6R14EZ\n' +
+ '6ohpKZldSJiMPL0Bu9iT52iHOsw1wTZNC1L5lKhOCi3c+/fLRcJZt3hdCjqy\n' +
+ 'd/FSCa8/Ny/GrHBWoL49rSF4pDEA+s7ATQRk7zWYAQgAtNOoHCL7BCnjwp8O\n' +
+ 'htTxEI5r7Q/1zKKHiz6QKjjrGBYyR6gcmPM3JNEcvzY4OsCFnKBv2suOgrqH\n' +
+ '8kXJzfpIQ7u7uJs+O3p/cn86RMANiEnO8NbB/0scpfZ7Vg3eOfoiWYE4I/1o\n' +
+ 'FVDCyZ1YVqtbcmuW6D8i1djjeoUmkUDZyPo7Qs6hUsJeYA/Rfl8mH5sjy2cN\n' +
+ 'WXf8cEtOUqJtwERXt5aRB/nBZiC0bsP6hf0HtAoNA8/96TkqrcQpODW/RckD\n' +
+ 'fo4wkpEONHRH+LGX7GV0pwymHu42TUnULmED6BrMgMYG2sKpxMThxtAxRaiP\n' +
+ 'nZ3DKXr8GCjTYnbEZpoi2zKCOQARAQABwsB2BBgBCAAqBYJk7zWYCZCrD2gy\n' +
+ '8Zu4awKbDBYhBKru9/u8wPcTeHibkasPaDLxm7hrAADGyQgA5NMUkoyDTPZa\n' +
+ 'Znj1dB+17xBXCZ/u7pPQc1DukBefVke7/qYIicdnnEGIX3Zd7TckFRsDljR/\n' +
+ '3418Bne4WyL57fAF/GgYsegpJ9n1KT7oPxWzibIaYdj7R6bkDt5r61EDWC3N\n' +
+ 'VBbnZu9cO15TYkObJIiyNvwbQyd6Dm313b39GnEE8sM709TWsI6Es6rRZAfC\n' +
+ '+sI8ezYxqVUbP7sW3jJZYzdPOhZPHvFd5iJ2EfygEOuk5tb7AimfNwF/CNcB\n' +
+ 'weQGEU7feOSB9lXXA+Ag1duLM4B9bLbbHEQIPhKlBF1ED64e/W/5HNfoAkS4\n' +
+ 'qhzOD5XWs6xs45nnYqUbBFLG9Xk+Jg==\n' +
+ '=qtAv\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isAdmin: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsXECMRRF0csbdbAZBagHKlJMSOL90IUq2h5UABktLE6/HcizY4/fOafrcntzQB/BTKvBEcJMmAmz0keQtRpk67bzRQ1m1m0nu19E1keQCTNhJsxO1+X2JukjmHm+Ppg5Lw9mWg0yYSbMhFnhoPPy4C8JM2EmzArftBr8J2EmzIRZ6SPIWg2yPoKs1WCmjyBrNcj6CDJhJsyEWWk1OKKP4DdaDTJhJsyEWeEHrQbZuu3M3C/iCGEmzITZJ/s7LOkKUABjAAAAAElFTkSuQmCC'
+ }
+ ],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
'\n' +
- 'wsBzBAEBCAAnBYJk7dERCZAIZdJAfLB6iRYhBK0xCN+/G/tf7pts7whl0kB8\n' +
- 'sHqJAADd9Af/Z4DcYGZyQmVmIXM3CSDf2RaJOsEchm3hN93ErvTwGrKiviKW\n' +
- '3/k6HWON3COHqmL5D1wlgZERTqaw3Xft1JC/82P108/IgDHiid4Wo4ojONn+\n' +
- 'ZZV6KUfH1i0+wxXNsSvS1XtVYVnq/pQbXi8fzayCYM9jwdiFzBosQTLmXIbY\n' +
- 'mUl1OezZ35kPQuZWjtZ2jyATQit6QL0uvQBiGAIevj1LRiB8uQsi0+Xr7R6I\n' +
- 'D7WQ0Iwr85OIENGyv1KgrH/1Q944SjamWWI31gUhedH5a+THVLNDJGg3CAfq\n' +
- 'FoOb2DNDviovMQxZwUOyCRCxVE6Ohw5Hwkw1YQOvzSwJRzz70l8A8w==\n' +
- '=k8OV\n' +
- '-----END PGP SIGNATURE-----\n'
+ 'wsBzBAEBCAAnBYJk7zWZCZBMYqhmfI2WQRYhBC9DyzhpX3ACb/yTq0xiqGZ8\n' +
+ 'jZZBAADwAwgAq/6WjtwRt1aPTLWwtSx80Ng/Wxf97dkpebMXSj9T7f5ia1rM\n' +
+ '8wqsuNUDMEMPB9LM34f6Q5pD994oeN2YT7z34u20mskiNphZdx/DNvu8w9UZ\n' +
+ 'rI3tyjfZULhARNVM34sSABnHtExbl4ZArhNDsT86ku0sZNjr9frn2mtgmlKN\n' +
+ 'nQdGcLJSxbci0hFg3nE5mYNpwZNs2S/2uk11WHKxzMhII6AdePE77BKPqedu\n' +
+ 'PiXDODO2dIvV8glLQoJPRPgc2ap+/xYIBUFljqHGPU/62VSLlHxBJv72p5s/\n' +
+ 'kOxiqD42TmpaaMtfudqgsZsGoYpZDHcMKYGNZs+9qVRHPRD+s0QhEA==\n' +
+ '=c6IF\n' +
+ '-----END PGP SIGNATURE-----\n',
+ groupImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ groupName: 'influential_maroon_gamefowl',
+ groupDescription: 'urgent_brown_butterfly',
+ isPublic: false,
+ groupCreator: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
+ chatId: '5f769c881ffe328117dea3d3acd0b97ce7f4c163e440f75a96be3e33f7d2a000',
+ meta: null,
+ scheduleAt: null,
+ scheduleEnd: null,
+ groupType: 'default',
+ status: null,
+ rules: {},
+ eventType: 'update'
}
```
-| Param | Type | Remarks |
-| ------------------------ | ------------------ | -------------------------- |
-| name | `string` or `null` | Profile Name |
-| desc | `string` or `null` | Profile Description |
-| picture | `string` or `null` | Profile Picture |
-| profileVerificationProof | `string` | Profile Verification Proof |
+| Parameter | Type | Remarks |
+| -------------------------- | --------------------- | -------------------------------------------------------------- |
+| `members` | `Array` | An array containing member objects. |
+| `members.wallet` | `string` | The wallet address of the member. |
+| `members.publicKey` | `string` | The member's public PGP key (if available). |
+| `members.isAdmin` | `boolean` | Indicates whether the member is an admin. |
+| `members.image` | `string` | Image associated with the member. |
+| `pendingMembers` | `Array` | An array containing pending member objects. |
+| `pendingMembers.wallet` | `string` | The wallet address of the pending member. |
+| `pendingMembers.publicKey` | `string` | The pending member's public PGP key (if available). |
+| `pendingMembers.isAdmin` | `boolean` | Indicates whether the pending member is an admin. |
+| `pendingMembers.image` | `string` | Image associated with the pending member. |
+| `contractAddressERC20` | `string` or `null` | Contract address for ERC20 tokens (Used for tokenGating). |
+| `numberOfERC20` | `number` | The number of ERC20 tokens associated. (Used for tokenGating). |
+| `contractAddressNFT` | `string` or `null` | Contract address for NFT tokens (Used for tokenGating) |
+| `numberOfNFTTokens` | `number` | The number of NFT tokens associated. (Used for tokenGating) |
+| `verificationProof` | `string` | Verification proof associated with group data. |
+| `groupImage` | `string` | Group's image. |
+| `groupName` | `string` | The name of the group. |
+| `groupDescription` | `string` | Description of the group. |
+| `isPublic` | `boolean` | Indicates whether the group is public or private. |
+| `groupCreator` | `string` | Push Profile DID of the group creator. |
+| `chatId` | `string` | Unique chat ID associated with the group. |
+| `meta` | `object` or `null` | Additional metadata (if available). |
+| `scheduleAt` | `timestamp` or `null` | Scheduled start time (if available). |
+| `scheduleEnd` | `timestamp` or `null` | Scheduled end time (if available). |
+| `groupType` | `string` | Type of the group (default, spaces, live etc). |
+| `status` | `string` or `null` | Status information ( active, expired etc) |
+| `rules` | `Object` | Group-specific moderation rules |
+| `eventType` | `string` | The type of event (create, update etc) |
---
-### **Fetch List of Chats**
+### **Remove From Group**
```typescript
-// List all chats
-const aliceChats = await userAlice.chat.list('CHATS');
-// List all chat requests
-const aliceRequests = await userAlice.chat.list('REQUESTS');
-```
+// Remove Members To Group
+const addMemberToGroup = await userAlice.chat.group.remove(groupChatId, {
+ role : 'MEMBER'
+ accounts: [account1, account2] // these accounts should be a part of group
+});
-| Param | Type | Default | Remarks |
-| ------------------ | --------------------- | ------- | -------------------------------------------------- |
-| `type` | `CHATS` or `REQUESTS` | - | Type of Chats to be listed |
-| `options` \* | `Object` | - | Optional configuration properties for listing chat |
-| `options.page` \* | `number` | `1` | The page number for pagination |
-| `options.limit` \* | `number` | `10` | The maximum number of items to retrieve per page |
+// Remove Admin To Group
+const addAdminToGroup = await userAlice.chat.group.remove(groupChatId, {
+ role : 'ADMIN'
+ accounts: [account1, account2] // // these accounts should be a part of group
+});
+```
-\* - Optional
+| Param | Type | Default | Remarks |
+| ------------------ | ------------------- | ------- | ----------------------------------------------- |
+| `chatId` | `string` | - | Unique identifier of the group. |
+| `options` | `object` | - | Configuration for adding participants to group. |
+| `options.role` | `ADMIN` or `MEMBER` | - | Role of added participant |
+| `options.accounts` | `string[]` | - | Added participant addresses |
Expected response
```typescript
-[
- {
- chatId: '6168440929ced5109c50534d40bb98a5e109ebf1d33df966ae898f002fac8973',
- about: null,
- did: 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562',
- intent: 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562',
- intentSentBy: 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562',
- intentTimestamp: '2023-08-29T08:05:03.000Z',
- publicKey:
- '{"key":"-----BEGIN PGP PUBLIC KEY BLOCK-----\\n\\nxsBNBGTt9AcBCADXjt9OEXDQyE7w2veaHqTUN9fALt7c+cubz2nhWfmD07M1\\n5Spm3ScT/4HdlPpUBYnGUKlCT09g663RvvmDzp8442vZhfYeKbetrcNFxfnp\\n+ePQGiLDY0h2FmjQGkmZGP43ZLyhNT4eCIGPcPSpzaWAKw4wgE/tW2hli5m/\\n7e8HFno+bHp2ycNoPJpdqhY77CJL9zPqFdctCPxI5r1/+xkVLcf+NZ+vD7mz\\nq8xVpu3Tij5Jb5ShDPQ3qqPsqdCcB/fpnEtAOT/Ryuf5Qqic/bDrzImfaIO9\\nYmdnuc6uQBR1s8WbLHmOsQvJhe2D8MtggV5HwHbkPqxXBmpGIJnMeLHZABEB\\nAAHNAMLAigQQAQgAPgWCZO30BwQLCQcICZBvKHl019glPAMVCAoEFgACAQIZ\\nAQKbAwIeARYhBEyKE1gcoT4IIxerrG8oeXTX2CU8AADltgf/dREUaHmfMnwa\\nWwcoGxfya7xeSeqGLWoWsCDg55lq0rf59IFKw59AKL+4kKQrmVDW0x6oo844\\nxBv3NBq7OssNbRr4XYIXJN4oP8g0SdOYinTTcnHFjJcRHfTIa+lmlf7fwc7d\\n2DRW3Kyu66OGq9sLzcgI3Q4Fg3VOQGRDdVGF4zJGjPEpnHsJuGCVnbn5L94p\\nMZHEMIahYrYg2asglSByNUZIH+r0Y8rCzKp8rs37X/Q8RBrmW/oTnE/bb+xo\\n1jHgRR3MUs2Ea0oAqv/TwqpBRzMIWQ8tGKfEaJ22p02FJaE5q9KMbLp0mMIe\\nd33xGwOezLKoK5L9cHKg7wmz4sWvUs7ATQRk7fQHAQgApXcZbj43S5sr7v8d\\nq9JwcXkSdpRuzGw5zyauxUUElq2RLKPvsP8En+OJQceKWQcpvz16xLjnSoZI\\nfgIl1wXUaEb2T45rUrWmnoO+Csy2h6FePNmlHOerY2/C0GHQX3XP/B0t41By\\nG/o4losESsBaHEYugHIg5kXhgsGnlgoC3Bu4zHFmIvLlZXjCWYUG2JnhNHlG\\nrD67/Xuox1FO+Hh/rR7sSsWIH6S+SFgG/P4bwiW0JAYQP6bC4tbXfzvKJk2R\\ndeySnppEAwdn/3lCU5QscYIIUXSaPoV3Q6hg+wRigBk2ixkqdOTJmJROTOo3\\nUdnaeGSwP23USJIUncZWgcIokwARAQABwsB2BBgBCAAqBYJk7fQHCZBvKHl0\\n19glPAKbDBYhBEyKE1gcoT4IIxerrG8oeXTX2CU8AABx6Af/XRamjQ4T79rf\\nhNArQt3VuHvpIUP860MCg0aW5rMtZ8q4+TwOyjiEgOUIFx215Yprb3R3NTKV\\nQWJr8n++ZGDmQ8iro8nrRMRELmoEJzyWp3yr0dyr2lx01//bud+vVw+ARPLt\\nVUnX8eguLKRrltQmIRwCqX01PCTiN2RDB2Akd+zlBGRiHoavW9dDdGGBY9wW\\nA2Pyw73BeMzVA3akiGzLsdRIshO0DBALaX0G5ytqyIf3QjXOqO6C7gp9XW7R\\njXhRhzvR9NjZPmSXEeYqYw2CUPxzaLsKoSP4dbXE7Hl+sYJptzke7LE1StzH\\nG64gRgEYMCKvRZaPXYnPJXAZwDhijw==\\n=8aQd\\n-----END PGP PUBLIC KEY BLOCK-----\\n","signature":"DEPRECATED"}',
- profilePicture:
- 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAsklEQVR4AcXBQY0DMRBE0Z+SCRhCsBhGAJiAYQwBgzGmZuDk2pPDSKPsqt57zNfzTVKPxX+K0ciEmTATZqXuSRajkdVjkcVoXKnHIovRyOqeZMJMmAmzEurcUffkF6FOJsyEmTAr3BTqXKks7hBmwkyYFb7UPflLdU+yUCcTZsJMmBW+hDong5O6J1diNE7EJWEmzIRZqccii9G4Eur8oh6LTJgJM2H2mK/nGyNhJsyE2QfJZChdHLm7QQAAAABJRU5ErkJggg==',
- threadhash: 'bafyreiewla5iyd7rnvjw2c5w6dbab4zkyf2desbowzouijoea2jzakxz6i',
- wallets: 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562',
- combinedDID:
- 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562_eip155:0x84a9385e9b97df87b80c2e689997133703853874',
- name: null,
- groupInformation: null,
- msg: {
- fromDID: 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562',
- toDID: 'eip155:0x84a9385e9b97df87b80c2e689997133703853874',
- messageObj: [Object],
- messageContent: 'Hello Alice!',
- messageType: 'Text',
- timestamp: 1693316103747,
- fromCAIP10: 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562',
- toCAIP10: 'eip155:0x84a9385e9b97df87b80c2e689997133703853874',
- encryptedSecret:
- '-----BEGIN PGP MESSAGE-----\n' +
- '\n' +
- 'wcBMA3d9z8TNUuddAQf/U2hMcybh5mUt9FFen5tfZ52PaB0vc2G+wYYIsBfu\n' +
- 'zg58rgLy8uGMxvzhtCWhpIE91G62d8M4OmaDa+PLjs8SqyRoyih/9pt8P4cw\n' +
- 'UJVHHDcJNC9r6/AV4aZySdz5u5utE7o3iB1FU0Sr9HEQsImmOM7J6LZJ3xWJ\n' +
- 'V+o4ToLbqUFYKg2uY1kUXpyX+D6JRinagnAosh4zCICLUqrEkKNqbyV2mr+5\n' +
- 'FK+fClWBGCwpf38L220FqHYPQ4bQXks0N07yW4OVjVpCTZVuNttr7PIEqcyZ\n' +
- 'qIovbQbkltiDpsb/yYysEHTwBtvugna7xMW7SRY34x3iWm/HBNJmfBG7LnjI\n' +
- '6cHATAMrTKobmmcFTAEH/20nW6aNzfj1vn/5GIWjZ5Z4Rw6G3Syt+0NxPUix\n' +
- 'dpKIFOR0/BEJkafGMdlk/vRElsyluKbzykBlIQ0hHGRpGMNEW8s8GrJeiXvV\n' +
- 'JSNZ24u5DDk8DIBaJWJnyWM7XzgcmOmn9rvVbvc9qgNNgtDeMIZwUpiDipnA\n' +
- '++7n72h0JSs8dWFQ62FSf5ACHC0UVbPiL3TRrRBEo7vQp4JsJyXp70CUclqU\n' +
- '3ANLvNhINV6GGtpXEKnsBVkkg35HR92nIzk+8HL86SsRUYfXkufzXdkPpmRn\n' +
- 'SG7MoDecNf/bwoqP8/l2X2h3R1c+WTQFb6Z+eK/NsJ/AnSErFZh3yEHAi1Rz\n' +
- 'yIXSQAEA2KupLnBVC9fqZqhUySvOW/Hs/hD6iEEGIl+U/RC9AwdG2jpg4sVi\n' +
- 'f9PhBJ5Tanynb3aHngRKtIzjP5m223A=\n' +
- '=5w+B\n' +
- '-----END PGP MESSAGE-----\n',
- encType: 'pgp',
- signature:
- '-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJk7fQHCZBvKHl019glPBYhBEyKE1gcoT4IIxerrG8oeXTX\n' +
- '2CU8AACRLQf/bbeJoUNwRkJYz100R3ULO27HGjKnFeOaMZWRNF8JqWzNmCBL\n' +
- 'Cj3aIBkDuCUj7avBsanScbSa7tD8Mc8PZgpSkd22nNH5iHiDJqlPtySJ2KoZ\n' +
- '3ekVXfOgfLlHtN78ghTxABewYQRuB6kwtv3XQW8X9sCL2jEF4NIIl5eXZvIT\n' +
- 'nhbHhhOR47k2E0hiHjPv2t3ggrwkrw6ISDgV8qYcrnf7vEFeGHpeSc25QLJH\n' +
- 'pXCeeHhH7h4C9L3PEdMt8T+Ne36cfNiwTGdOavin/yfNES6k0kqZxP44hn1M\n' +
- 'ZBk4jfyaDUh70mv4FtxdPcdb1TGQsPC1YYAIh/059EBqkdJFhVF4+A==\n' +
- '=DBch\n' +
- '-----END PGP SIGNATURE-----\n',
- sigType: 'pgpv2',
- verificationProof:
- 'pgpv2:-----BEGIN PGP SIGNATURE-----\n' +
+{
+ members: [
+ {
+ wallet: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
'\n' +
- 'wsBzBAEBCAAnBYJk7fQHCZBvKHl019glPBYhBEyKE1gcoT4IIxerrG8oeXTX\n' +
- '2CU8AADsmwf/UpJCmnqztJLt1Ltg0OD7xoDvumitRwkfhnXzUdBWxM3i7vj4\n' +
- 'cfjtcpQI2R5W0TXj9e2fymimIc98kjUqpDiUIaVAuD0OnEbJdIluGLBTJeks\n' +
- 'YTRikqkgjFJT9Y6/2VRQj59IR0rgC0sec8mSKPlxuhixkdSS7Wec0+84cGmX\n' +
- 'aieskReKeitKacYkU4Uf82Klc7Ft8+duBsaMGR3TS22PzHfYIHmy+8Z3b1SK\n' +
- 'pMyJ8NBXCG2F+05WdoUsXBR+lO74RjSDWnWZlgRngWjjvSXQuZ/QznIyBVmQ\n' +
- 'oOxJM5LSCCwH6ch5J/HmXudJG+3wsCINchvSQx0LntZUoeSp8cezvg==\n' +
- '=KUqZ\n' +
- '-----END PGP SIGNATURE-----\n',
- link: null,
+ 'xsBNBGTvNZgBCADeYpZfxgn1HoMUuWM42v8ZWfLPwglQYmzz5rY3PdPPoRFU\n' +
+ 'v0AyPjYKpmLh2ZNfXjPaS9GuMdpXaomYSEwsV02hXZOQelo9cLop0Fc2i+l7\n' +
+ '70rYhePuOuQ+XD/xYzhngAgNJ9rX96YnSodldb8uJfxYmgoF0E9Z2o2fgZGj\n' +
+ 'll2CPnOaLXZaBQlPS3x/461TmZ1n2ZePS/fwiC7taLz3PtyGtKaC0vo4isvI\n' +
+ 'yf04fkjudG0XIns5CWjdR2HeDC8BzSl8OVj8AQAc5uVU8Abk+ejWVr4zfoox\n' +
+ 'eaziDPgGdkckFiQ6Tdsg0tPwwOpSrCCtJocTmc/fWaBb0YlnyAAL88fJABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZBMYqhmfI2WQQMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAACxNQf/UrM/whR7vCs+\n' +
+ 'ez8Y8Hz4WqIuXtfMh4l2nKVv5UUuAfQkBxEY5j6Ga2+JgKU3neQ34x/v6fm9\n' +
+ 'CLcY38Tc4AWyEx8KC78J+xOs7RMfyNBeiaf8KdaFfQrP0nMmufE6TxkfV1Y5\n' +
+ 'LJZZ8350rZVtYJppWtlH+gbyUmMObyWDWbL3aWtqa3xjv0kLsf7TnugiFwzB\n' +
+ 'gHHtk8tlDSOxRt0VdNNd19+/zrBYNl07Ig24WD2ETaJiaqa651z24/6/MkGT\n' +
+ 'MBoQh+679tuWWcTrNi4jIA8jhSQ5BOgbAapl3qXk0m9/Aexpe2s6ISLXe8YJ\n' +
+ 'j4cObDLv/ZKKeLZYTq9lVCydLAQUbs7ATQRk7zWYAQgAmx36uefgUF4cCSYH\n' +
+ 'WMWAOTyc8Awo+hxn6FktOLU1+9hfGrX2jwGLOoOwjNgbYJbiSvRglAX2b57/\n' +
+ 'qkkltAg1ZYCLSUzfBUbbWYlJNBwpv7+52zHaLUZ3gmI5aE48ad+uzaadgpVT\n' +
+ 'VqLbhdgkN6jkemPTlfMehyS49AAbmqeKfo2U72tm9ZqT2cPVCASMjN/Ux2qG\n' +
+ '3W8HTo0KIVFSbkTthl1zAlwAFksp0q437+pxbdJIecJ9mO6N4OQMnv+hVBDc\n' +
+ 'WrPqBDJ0nas4JNgLxmLv0pheGg/TEfwS/p6xGRW5m08bj2l0cgqmEaM27jbi\n' +
+ 'DEpOykRWsDMhheEfI2zV/Qam8QARAQABwsB2BBgBCAAqBYJk7zWYCZBMYqhm\n' +
+ 'fI2WQQKbDBYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAAAnBggA1gkIopr9HJFP\n' +
+ 'fO5SebcbowH4AG9M0qBqF4h1JIKbqvOnxLSsC5QmmzFcjS9ihyHBvzbRVGkC\n' +
+ 'zEHYpLRedQ2AmQQfsf/VOoZJEOlb7tTk4+SpYtsGte5X/yLT5Bkls7Rp8ubK\n' +
+ '/V99muj1nA/OkasllXQUSGEweVz6ejzJ0oMm3Vewmw8PelsdAnfS7Ud1MnXQ\n' +
+ 'h+O8TCR56F5gAMWxZmxFpZMZyUFOH6KM+vL7HJUBztUS2g0ELsHKy9ep2yhv\n' +
+ 'iABIwx/gEuPr0NDAH9x9XFKg5m3rO64KTY4BRWBISwmQ25dM1s1bwDPLi5XI\n' +
+ '6Daw1glFxpPRrxgQGlVLzJOu5b8swQ==\n' +
+ '=9hCc\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isAdmin: true,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzUlEQVR4AcXBsWlDMRiF0c8XTeAJPIAgoFbgQew1PIbXyKsyhUGtCqM6ZAJX6Z32fykM4hnuObv71++TYJRKlHtji1EqUe6NSJgJM2G2W74/nkzIvfHKKJUZwkyYCbOUe+Odcm/MEGbCTJil2/VMdLx8Eo1S2SL3RnS7nomEmTATZmm//BANKlHujS1GqUT7hRVhJsyEWWLSKJVXcm/MEGbCTJgl/sm9EY1SmTFKJcq9EY1SiYSZMBNm6XE6sHJhJffGOz1OByJhJsyE2R/3lDA4e9QQhAAAAABJRU5ErkJggg=='
+ }
+ ],
+ pendingMembers: [
+ {
+ wallet: 'eip155:0x119bb8ad40B1f94e2b30ae5f59eeaEB67cD0Bd6C',
+ publicKey: null,
+ isAdmin: false,
+ image: null
},
- },
-];
+ {
+ wallet: 'eip155:0x6e0C509d14EbF26A529bf6DC5CC9bee7F5b8DBa4',
+ publicKey: null,
+ isAdmin: false,
+ image: null
+ },
+ {
+ wallet: 'eip155:0xE3FDD0527a9F8418f9a7D9e970452827FbE202FF',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGTvNZgBCADouo4S2kPqA//+I7nDAk15/LcJ2TGvDhOYuPNUNMiNGOb4\n' +
+ 'txusuKz6HOaG+K9hiUBpHjKrYEmCT2FEXxt8bfS3SpWb74RHSkWUNUkxk25y\n' +
+ 'gE5gaCKyAdcnOUyVLmobVFFYtH6naK9bULaUtkVik1P0iuEevWHxtTpsjbyH\n' +
+ 'bZtNpVTdprdLib4Wx6bb7VogsvjlvNJcVJ4sfPE0XgsQgAGIev7yJyU0DGzt\n' +
+ '/EbvFX4sv51Kb1dX9ctBcvzVbs9+qT6LTivsrQp+TNHUN4zEeMhnWFFP5K1d\n' +
+ 'H445S6FWk53XvBudcOkFPtltU1MPCS6hmhevArBfYzy5eSlaKA/fH+kFABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZCrD2gy8Zu4awMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBKru9/u8wPcTeHibkasPaDLxm7hrAADa/Af+PbamVg/Ig2S2\n' +
+ 'HgIy4w5x7ulSk1/49+AmuiUMiVUwJSVBhROsyDbLET56w4+1TIMYZFJaczW3\n' +
+ '8tCvAOUSauzc52I3zwGmaCupBJokIWp7ncPh0B8TFYrgThgXV7sLf3xy4roy\n' +
+ 'y8oFz1Zla88krwtPe4Az7TF+WNdXoDsLNJ3GXRmNqs1GITmDqAXFWncl12NM\n' +
+ 'ajUKWIKc/Gi1oKfz22mabJTtWBimDpA12LaGK3GjEK5CiWXT3Tzlqn6R14EZ\n' +
+ '6ohpKZldSJiMPL0Bu9iT52iHOsw1wTZNC1L5lKhOCi3c+/fLRcJZt3hdCjqy\n' +
+ 'd/FSCa8/Ny/GrHBWoL49rSF4pDEA+s7ATQRk7zWYAQgAtNOoHCL7BCnjwp8O\n' +
+ 'htTxEI5r7Q/1zKKHiz6QKjjrGBYyR6gcmPM3JNEcvzY4OsCFnKBv2suOgrqH\n' +
+ '8kXJzfpIQ7u7uJs+O3p/cn86RMANiEnO8NbB/0scpfZ7Vg3eOfoiWYE4I/1o\n' +
+ 'FVDCyZ1YVqtbcmuW6D8i1djjeoUmkUDZyPo7Qs6hUsJeYA/Rfl8mH5sjy2cN\n' +
+ 'WXf8cEtOUqJtwERXt5aRB/nBZiC0bsP6hf0HtAoNA8/96TkqrcQpODW/RckD\n' +
+ 'fo4wkpEONHRH+LGX7GV0pwymHu42TUnULmED6BrMgMYG2sKpxMThxtAxRaiP\n' +
+ 'nZ3DKXr8GCjTYnbEZpoi2zKCOQARAQABwsB2BBgBCAAqBYJk7zWYCZCrD2gy\n' +
+ '8Zu4awKbDBYhBKru9/u8wPcTeHibkasPaDLxm7hrAADGyQgA5NMUkoyDTPZa\n' +
+ 'Znj1dB+17xBXCZ/u7pPQc1DukBefVke7/qYIicdnnEGIX3Zd7TckFRsDljR/\n' +
+ '3418Bne4WyL57fAF/GgYsegpJ9n1KT7oPxWzibIaYdj7R6bkDt5r61EDWC3N\n' +
+ 'VBbnZu9cO15TYkObJIiyNvwbQyd6Dm313b39GnEE8sM709TWsI6Es6rRZAfC\n' +
+ '+sI8ezYxqVUbP7sW3jJZYzdPOhZPHvFd5iJ2EfygEOuk5tb7AimfNwF/CNcB\n' +
+ 'weQGEU7feOSB9lXXA+Ag1duLM4B9bLbbHEQIPhKlBF1ED64e/W/5HNfoAkS4\n' +
+ 'qhzOD5XWs6xs45nnYqUbBFLG9Xk+Jg==\n' +
+ '=qtAv\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isAdmin: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsXECMRRF0csbdbAZBagHKlJMSOL90IUq2h5UABktLE6/HcizY4/fOafrcntzQB/BTKvBEcJMmAmz0keQtRpk67bzRQ1m1m0nu19E1keQCTNhJsxO1+X2JukjmHm+Ppg5Lw9mWg0yYSbMhFnhoPPy4C8JM2EmzArftBr8J2EmzIRZ6SPIWg2yPoKs1WCmjyBrNcj6CDJhJsyEWWk1OKKP4DdaDTJhJsyEWeEHrQbZuu3M3C/iCGEmzITZJ/s7LOkKUABjAAAAAElFTkSuQmCC'
+ }
+ ],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJk7zWZCZBMYqhmfI2WQRYhBC9DyzhpX3ACb/yTq0xiqGZ8\n' +
+ 'jZZBAADwAwgAq/6WjtwRt1aPTLWwtSx80Ng/Wxf97dkpebMXSj9T7f5ia1rM\n' +
+ '8wqsuNUDMEMPB9LM34f6Q5pD994oeN2YT7z34u20mskiNphZdx/DNvu8w9UZ\n' +
+ 'rI3tyjfZULhARNVM34sSABnHtExbl4ZArhNDsT86ku0sZNjr9frn2mtgmlKN\n' +
+ 'nQdGcLJSxbci0hFg3nE5mYNpwZNs2S/2uk11WHKxzMhII6AdePE77BKPqedu\n' +
+ 'PiXDODO2dIvV8glLQoJPRPgc2ap+/xYIBUFljqHGPU/62VSLlHxBJv72p5s/\n' +
+ 'kOxiqD42TmpaaMtfudqgsZsGoYpZDHcMKYGNZs+9qVRHPRD+s0QhEA==\n' +
+ '=c6IF\n' +
+ '-----END PGP SIGNATURE-----\n',
+ groupImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ groupName: 'influential_maroon_gamefowl',
+ groupDescription: 'urgent_brown_butterfly',
+ isPublic: false,
+ groupCreator: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
+ chatId: '5f769c881ffe328117dea3d3acd0b97ce7f4c163e440f75a96be3e33f7d2a000',
+ meta: null,
+ scheduleAt: null,
+ scheduleEnd: null,
+ groupType: 'default',
+ status: null,
+ rules: {},
+ eventType: 'update'
+}
```
-| Param | Type | Remarks |
-| ---------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------- |
-| msg | `IMessageIPFS` | message object |
-| did | `string` | user DID |
-| wallets | `string` | user wallets |
-| profilePicture | `string` | user profile picture |
-| publicKey | `string` | user public key |
-| about | `string` | user description |
-| threadhash | `string` | cid from the latest message sent on this conversation |
-| intent | `string` | addresses concatenated from the users who have approved the intent |
-| intentSentBy | `string` | address of the user who sent the intent |
-| intentTimestamp | `number` | timestamp of the intent |
-| combinedDID | `string` | concatenated addresses of the members of this chat (for DM the 2 addresses and from Group the addresses from all group members) |
-| cid | `string` | content identifier on IPFS |
-| chatId | `string` | chat identifier |
-| groupInformation | `GroupDTO` | if group chat, all group information |
+| Parameter | Type | Remarks |
+| -------------------------- | --------------------- | -------------------------------------------------------------- |
+| `members` | `Array` | An array containing member objects. |
+| `members.wallet` | `string` | The wallet address of the member. |
+| `members.publicKey` | `string` | The member's public PGP key (if available). |
+| `members.isAdmin` | `boolean` | Indicates whether the member is an admin. |
+| `members.image` | `string` | Image associated with the member. |
+| `pendingMembers` | `Array` | An array containing pending member objects. |
+| `pendingMembers.wallet` | `string` | The wallet address of the pending member. |
+| `pendingMembers.publicKey` | `string` | The pending member's public PGP key (if available). |
+| `pendingMembers.isAdmin` | `boolean` | Indicates whether the pending member is an admin. |
+| `pendingMembers.image` | `string` | Image associated with the pending member. |
+| `contractAddressERC20` | `string` or `null` | Contract address for ERC20 tokens (Used for tokenGating). |
+| `numberOfERC20` | `number` | The number of ERC20 tokens associated. (Used for tokenGating). |
+| `contractAddressNFT` | `string` or `null` | Contract address for NFT tokens (Used for tokenGating) |
+| `numberOfNFTTokens` | `number` | The number of NFT tokens associated. (Used for tokenGating) |
+| `verificationProof` | `string` | Verification proof associated with group data. |
+| `groupImage` | `string` | Group's image. |
+| `groupName` | `string` | The name of the group. |
+| `groupDescription` | `string` | Description of the group. |
+| `isPublic` | `boolean` | Indicates whether the group is public or private. |
+| `groupCreator` | `string` | Push Profile DID of the group creator. |
+| `chatId` | `string` | Unique chat ID associated with the group. |
+| `meta` | `object` or `null` | Additional metadata (if available). |
+| `scheduleAt` | `timestamp` or `null` | Scheduled start time (if available). |
+| `scheduleEnd` | `timestamp` or `null` | Scheduled end time (if available). |
+| `groupType` | `string` | Type of the group (default, spaces, live etc). |
+| `status` | `string` or `null` | Status information ( active, expired etc) |
+| `rules` | `Object` | Group-specific moderation rules |
+| `eventType` | `string` | The type of event (create, update etc) |
---
-### **Fetch Latest Chat**
+### **Join Group**
```typescript
-// Latest Chat message with the target user
-const aliceChats = await userAlice.chat.latest(bobAddress);
+const joinGroup = await userAlice.chat.group.join(groupChatId);
```
-| Param | Type | Default | Remarks |
-| -------- | -------- | ------- | ----------------------------------------------------------------------------------- |
-| `target` | `string` | - | Target DID ( For Group Chats target is chatId, for 1 To 1 chat target is Push DID ) |
+| Param | Type | Default | Remarks |
+| -------- | -------- | ------- | ------------------------------- |
+| `chatId` | `string` | - | Unique identifier of the group. |
Expected response
```typescript
-[
- {
- link: 'bafyreibfikschwlfi275hr7lrfqgj73mf6absailazh4sm5fwihspy2ky4',
- toDID: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a',
- encType: 'pgp',
- fromDID: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d',
- sigType: 'pgp',
- toCAIP10: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a',
- signature:
- '-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBQJjh5tjCRBaJmgmByp5FRYhBJC23yBJT2d/pTAID1omaCYH\n' +
- 'KnkVAAAZmwf/buPLw6caSZmYnw6D3/p6HF1kWlkGUOTP4RasaU/6dkeDaZs9\n' +
- 'SJlz2wC8oOpBGWHMJ/5n3ZWmU71E6U7IKIY793MyIv5t32vTNkwsRHUX7IIn\n' +
- 'QFF+FzTIEtHHVTRlnkqNR2YUk1kqcpZCZWHfahi5W2d/WkXlFNdvyyFH4W8L\n' +
- 'd03FGhOyXbWwU3xicBz5mSBpIFaaSCXl1SdgJDPXLSk3b65EEOjCOaiz85xC\n' +
- 'G+6SW4RUzCGSDcOd9F2EXvvY5H9LgQNi1jjlZn6JrPTPJTJ+wXZXzcZmtOXG\n' +
- 'EKcwvPbbPY9wd+gavRSOgYLYn5xoZQW/o3hW7AQlbC5Kj6js48Z0HQ==\n' +
- '=qLiJ\n' +
- '-----END PGP SIGNATURE-----\n',
- timestamp: 1669831523684,
- fromCAIP10: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d',
- messageType: 'Text',
- messageContent: 'Hi',
- encryptedSecret:
- '-----BEGIN PGP MESSAGE-----\n' +
- '\n' +
- 'wcBMA1fn1CNqxQ7nAQgArlo75qe54WerfRKFv1+F9j4NRMvSTgUztvIe51eg\n' +
- 'd5MVuj6RYxKERr2bTuBt5cMDJMlNuTnBBkPe4L8+SlsI46L9wmXV9xLoZq1a\n' +
- '94JdxD98RGMF99Jde/3hC/X6GS1yVqPpKPKdWx/tkOPeyqeO/wFF7kqShgIi\n' +
- 'Wgq6hGz1fzD3GZhKGY0VSLuC3s0aUy/qw5En1Xd0uX0jdXBl07IIj8p1G2zx\n' +
- '9BuVlksSK34yvIc0RQfCeRadMHkxbA0Hyj31Wrr+Y310YLTppL0s5bQR9APL\n' +
- 'WHsIztJ1fHTnXsPhnA7YG0SQpHTyJhuX3rgBjxGrvbZBArmZ+R/Pq9IkOkJe\n' +
- 'z8HATAMOsbaZjGN5JwEH/jYjLN6AFRWeaB5CSBSAF+CvHsUgadGmxTdSHBM6\n' +
- 'LM9rfGg/MCnpRBuHckA0NNZh+wepq6TDA54ZopsdP14gHj4MKCdfqZr86Jft\n' +
- 'ldtjeSgPTFEEJxPMJ4/Z3UeFU9rvOgfxX6l0eHWS0MYwJ3sVYvSyqqHir1K5\n' +
- 'TRdEIgtQ3NvLTKkX4bKTSU+SInrvDA+wsc2BcBsbgNhRiGb+XYrbqXBshL1a\n' +
- 'lIdpnomkAQgOZMO2n347uURYoruH3OtFeNABJ9D/nEU+LdhDOPGZPefvPBc5\n' +
- 'BxK4ExKZ2Wo/TZw8lgC53uqOljsGV63Hp71LkyesKWu5/+vdVrYx/vU63shh\n' +
- 'x/TSQAEiaFYEfkWSOthtH0nrJHhkY7FWgjp/1bj/J4J9HCQrVtt2WlQfhowZ\n' +
- 'ILxhKk/vep0sJviM3SfJ4hPtoYpZESc=\n' +
- '=43Ta\n' +
- '-----END PGP MESSAGE-----\n',
- },
-];
+{
+ members: [
+ {
+ wallet: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGTvNZgBCADeYpZfxgn1HoMUuWM42v8ZWfLPwglQYmzz5rY3PdPPoRFU\n' +
+ 'v0AyPjYKpmLh2ZNfXjPaS9GuMdpXaomYSEwsV02hXZOQelo9cLop0Fc2i+l7\n' +
+ '70rYhePuOuQ+XD/xYzhngAgNJ9rX96YnSodldb8uJfxYmgoF0E9Z2o2fgZGj\n' +
+ 'll2CPnOaLXZaBQlPS3x/461TmZ1n2ZePS/fwiC7taLz3PtyGtKaC0vo4isvI\n' +
+ 'yf04fkjudG0XIns5CWjdR2HeDC8BzSl8OVj8AQAc5uVU8Abk+ejWVr4zfoox\n' +
+ 'eaziDPgGdkckFiQ6Tdsg0tPwwOpSrCCtJocTmc/fWaBb0YlnyAAL88fJABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZBMYqhmfI2WQQMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAACxNQf/UrM/whR7vCs+\n' +
+ 'ez8Y8Hz4WqIuXtfMh4l2nKVv5UUuAfQkBxEY5j6Ga2+JgKU3neQ34x/v6fm9\n' +
+ 'CLcY38Tc4AWyEx8KC78J+xOs7RMfyNBeiaf8KdaFfQrP0nMmufE6TxkfV1Y5\n' +
+ 'LJZZ8350rZVtYJppWtlH+gbyUmMObyWDWbL3aWtqa3xjv0kLsf7TnugiFwzB\n' +
+ 'gHHtk8tlDSOxRt0VdNNd19+/zrBYNl07Ig24WD2ETaJiaqa651z24/6/MkGT\n' +
+ 'MBoQh+679tuWWcTrNi4jIA8jhSQ5BOgbAapl3qXk0m9/Aexpe2s6ISLXe8YJ\n' +
+ 'j4cObDLv/ZKKeLZYTq9lVCydLAQUbs7ATQRk7zWYAQgAmx36uefgUF4cCSYH\n' +
+ 'WMWAOTyc8Awo+hxn6FktOLU1+9hfGrX2jwGLOoOwjNgbYJbiSvRglAX2b57/\n' +
+ 'qkkltAg1ZYCLSUzfBUbbWYlJNBwpv7+52zHaLUZ3gmI5aE48ad+uzaadgpVT\n' +
+ 'VqLbhdgkN6jkemPTlfMehyS49AAbmqeKfo2U72tm9ZqT2cPVCASMjN/Ux2qG\n' +
+ '3W8HTo0KIVFSbkTthl1zAlwAFksp0q437+pxbdJIecJ9mO6N4OQMnv+hVBDc\n' +
+ 'WrPqBDJ0nas4JNgLxmLv0pheGg/TEfwS/p6xGRW5m08bj2l0cgqmEaM27jbi\n' +
+ 'DEpOykRWsDMhheEfI2zV/Qam8QARAQABwsB2BBgBCAAqBYJk7zWYCZBMYqhm\n' +
+ 'fI2WQQKbDBYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAAAnBggA1gkIopr9HJFP\n' +
+ 'fO5SebcbowH4AG9M0qBqF4h1JIKbqvOnxLSsC5QmmzFcjS9ihyHBvzbRVGkC\n' +
+ 'zEHYpLRedQ2AmQQfsf/VOoZJEOlb7tTk4+SpYtsGte5X/yLT5Bkls7Rp8ubK\n' +
+ '/V99muj1nA/OkasllXQUSGEweVz6ejzJ0oMm3Vewmw8PelsdAnfS7Ud1MnXQ\n' +
+ 'h+O8TCR56F5gAMWxZmxFpZMZyUFOH6KM+vL7HJUBztUS2g0ELsHKy9ep2yhv\n' +
+ 'iABIwx/gEuPr0NDAH9x9XFKg5m3rO64KTY4BRWBISwmQ25dM1s1bwDPLi5XI\n' +
+ '6Daw1glFxpPRrxgQGlVLzJOu5b8swQ==\n' +
+ '=9hCc\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isAdmin: true,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzUlEQVR4AcXBsWlDMRiF0c8XTeAJPIAgoFbgQew1PIbXyKsyhUGtCqM6ZAJX6Z32fykM4hnuObv71++TYJRKlHtji1EqUe6NSJgJM2G2W74/nkzIvfHKKJUZwkyYCbOUe+Odcm/MEGbCTJil2/VMdLx8Eo1S2SL3RnS7nomEmTATZmm//BANKlHujS1GqUT7hRVhJsyEWWLSKJVXcm/MEGbCTJgl/sm9EY1SmTFKJcq9EY1SiYSZMBNm6XE6sHJhJffGOz1OByJhJsyE2R/3lDA4e9QQhAAAAABJRU5ErkJggg=='
+ }
+ ],
+ pendingMembers: [
+ {
+ wallet: 'eip155:0x119bb8ad40B1f94e2b30ae5f59eeaEB67cD0Bd6C',
+ publicKey: null,
+ isAdmin: false,
+ image: null
+ },
+ {
+ wallet: 'eip155:0x6e0C509d14EbF26A529bf6DC5CC9bee7F5b8DBa4',
+ publicKey: null,
+ isAdmin: false,
+ image: null
+ },
+ {
+ wallet: 'eip155:0xE3FDD0527a9F8418f9a7D9e970452827FbE202FF',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGTvNZgBCADouo4S2kPqA//+I7nDAk15/LcJ2TGvDhOYuPNUNMiNGOb4\n' +
+ 'txusuKz6HOaG+K9hiUBpHjKrYEmCT2FEXxt8bfS3SpWb74RHSkWUNUkxk25y\n' +
+ 'gE5gaCKyAdcnOUyVLmobVFFYtH6naK9bULaUtkVik1P0iuEevWHxtTpsjbyH\n' +
+ 'bZtNpVTdprdLib4Wx6bb7VogsvjlvNJcVJ4sfPE0XgsQgAGIev7yJyU0DGzt\n' +
+ '/EbvFX4sv51Kb1dX9ctBcvzVbs9+qT6LTivsrQp+TNHUN4zEeMhnWFFP5K1d\n' +
+ 'H445S6FWk53XvBudcOkFPtltU1MPCS6hmhevArBfYzy5eSlaKA/fH+kFABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZCrD2gy8Zu4awMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBKru9/u8wPcTeHibkasPaDLxm7hrAADa/Af+PbamVg/Ig2S2\n' +
+ 'HgIy4w5x7ulSk1/49+AmuiUMiVUwJSVBhROsyDbLET56w4+1TIMYZFJaczW3\n' +
+ '8tCvAOUSauzc52I3zwGmaCupBJokIWp7ncPh0B8TFYrgThgXV7sLf3xy4roy\n' +
+ 'y8oFz1Zla88krwtPe4Az7TF+WNdXoDsLNJ3GXRmNqs1GITmDqAXFWncl12NM\n' +
+ 'ajUKWIKc/Gi1oKfz22mabJTtWBimDpA12LaGK3GjEK5CiWXT3Tzlqn6R14EZ\n' +
+ '6ohpKZldSJiMPL0Bu9iT52iHOsw1wTZNC1L5lKhOCi3c+/fLRcJZt3hdCjqy\n' +
+ 'd/FSCa8/Ny/GrHBWoL49rSF4pDEA+s7ATQRk7zWYAQgAtNOoHCL7BCnjwp8O\n' +
+ 'htTxEI5r7Q/1zKKHiz6QKjjrGBYyR6gcmPM3JNEcvzY4OsCFnKBv2suOgrqH\n' +
+ '8kXJzfpIQ7u7uJs+O3p/cn86RMANiEnO8NbB/0scpfZ7Vg3eOfoiWYE4I/1o\n' +
+ 'FVDCyZ1YVqtbcmuW6D8i1djjeoUmkUDZyPo7Qs6hUsJeYA/Rfl8mH5sjy2cN\n' +
+ 'WXf8cEtOUqJtwERXt5aRB/nBZiC0bsP6hf0HtAoNA8/96TkqrcQpODW/RckD\n' +
+ 'fo4wkpEONHRH+LGX7GV0pwymHu42TUnULmED6BrMgMYG2sKpxMThxtAxRaiP\n' +
+ 'nZ3DKXr8GCjTYnbEZpoi2zKCOQARAQABwsB2BBgBCAAqBYJk7zWYCZCrD2gy\n' +
+ '8Zu4awKbDBYhBKru9/u8wPcTeHibkasPaDLxm7hrAADGyQgA5NMUkoyDTPZa\n' +
+ 'Znj1dB+17xBXCZ/u7pPQc1DukBefVke7/qYIicdnnEGIX3Zd7TckFRsDljR/\n' +
+ '3418Bne4WyL57fAF/GgYsegpJ9n1KT7oPxWzibIaYdj7R6bkDt5r61EDWC3N\n' +
+ 'VBbnZu9cO15TYkObJIiyNvwbQyd6Dm313b39GnEE8sM709TWsI6Es6rRZAfC\n' +
+ '+sI8ezYxqVUbP7sW3jJZYzdPOhZPHvFd5iJ2EfygEOuk5tb7AimfNwF/CNcB\n' +
+ 'weQGEU7feOSB9lXXA+Ag1duLM4B9bLbbHEQIPhKlBF1ED64e/W/5HNfoAkS4\n' +
+ 'qhzOD5XWs6xs45nnYqUbBFLG9Xk+Jg==\n' +
+ '=qtAv\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isAdmin: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsXECMRRF0csbdbAZBagHKlJMSOL90IUq2h5UABktLE6/HcizY4/fOafrcntzQB/BTKvBEcJMmAmz0keQtRpk67bzRQ1m1m0nu19E1keQCTNhJsxO1+X2JukjmHm+Ppg5Lw9mWg0yYSbMhFnhoPPy4C8JM2EmzArftBr8J2EmzIRZ6SPIWg2yPoKs1WCmjyBrNcj6CDJhJsyEWWk1OKKP4DdaDTJhJsyEWeEHrQbZuu3M3C/iCGEmzITZJ/s7LOkKUABjAAAAAElFTkSuQmCC'
+ }
+ ],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJk7zWZCZBMYqhmfI2WQRYhBC9DyzhpX3ACb/yTq0xiqGZ8\n' +
+ 'jZZBAADwAwgAq/6WjtwRt1aPTLWwtSx80Ng/Wxf97dkpebMXSj9T7f5ia1rM\n' +
+ '8wqsuNUDMEMPB9LM34f6Q5pD994oeN2YT7z34u20mskiNphZdx/DNvu8w9UZ\n' +
+ 'rI3tyjfZULhARNVM34sSABnHtExbl4ZArhNDsT86ku0sZNjr9frn2mtgmlKN\n' +
+ 'nQdGcLJSxbci0hFg3nE5mYNpwZNs2S/2uk11WHKxzMhII6AdePE77BKPqedu\n' +
+ 'PiXDODO2dIvV8glLQoJPRPgc2ap+/xYIBUFljqHGPU/62VSLlHxBJv72p5s/\n' +
+ 'kOxiqD42TmpaaMtfudqgsZsGoYpZDHcMKYGNZs+9qVRHPRD+s0QhEA==\n' +
+ '=c6IF\n' +
+ '-----END PGP SIGNATURE-----\n',
+ groupImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ groupName: 'influential_maroon_gamefowl',
+ groupDescription: 'urgent_brown_butterfly',
+ isPublic: false,
+ groupCreator: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
+ chatId: '5f769c881ffe328117dea3d3acd0b97ce7f4c163e440f75a96be3e33f7d2a000',
+ meta: null,
+ scheduleAt: null,
+ scheduleEnd: null,
+ groupType: 'default',
+ status: null,
+ rules: {},
+ eventType: 'update'
+}
```
-| Param | Type | Remarks |
-| ----------------- | -------- | ------------------------------------------- |
-| `fromCAIP10` | `string` | sender address |
-| `toCAIP10` | `string` | receiver address |
-| `fromDID` | `string` | sender did |
-| `toDID` | `string` | receiver did |
-| `messageType` | `string` | message type |
-| `messageContent` | `string` | message content |
-| `signature` | `string` | signature of the message |
-| `sigType` | `string` | signature type |
-| `link` | `string` | content identifier of the previous messages |
-| `timestamp` | `number` | timestamp of the message |
-| `encType` | `string` | encryption type |
-| `encryptedSecret` | `string` | encrypted secret |
+| Parameter | Type | Remarks |
+| -------------------------- | --------------------- | -------------------------------------------------------------- |
+| `members` | `Array` | An array containing member objects. |
+| `members.wallet` | `string` | The wallet address of the member. |
+| `members.publicKey` | `string` | The member's public PGP key (if available). |
+| `members.isAdmin` | `boolean` | Indicates whether the member is an admin. |
+| `members.image` | `string` | Image associated with the member. |
+| `pendingMembers` | `Array` | An array containing pending member objects. |
+| `pendingMembers.wallet` | `string` | The wallet address of the pending member. |
+| `pendingMembers.publicKey` | `string` | The pending member's public PGP key (if available). |
+| `pendingMembers.isAdmin` | `boolean` | Indicates whether the pending member is an admin. |
+| `pendingMembers.image` | `string` | Image associated with the pending member. |
+| `contractAddressERC20` | `string` or `null` | Contract address for ERC20 tokens (Used for tokenGating). |
+| `numberOfERC20` | `number` | The number of ERC20 tokens associated. (Used for tokenGating). |
+| `contractAddressNFT` | `string` or `null` | Contract address for NFT tokens (Used for tokenGating) |
+| `numberOfNFTTokens` | `number` | The number of NFT tokens associated. (Used for tokenGating) |
+| `verificationProof` | `string` | Verification proof associated with group data. |
+| `groupImage` | `string` | Group's image. |
+| `groupName` | `string` | The name of the group. |
+| `groupDescription` | `string` | Description of the group. |
+| `isPublic` | `boolean` | Indicates whether the group is public or private. |
+| `groupCreator` | `string` | Push Profile DID of the group creator. |
+| `chatId` | `string` | Unique chat ID associated with the group. |
+| `meta` | `object` or `null` | Additional metadata (if available). |
+| `scheduleAt` | `timestamp` or `null` | Scheduled start time (if available). |
+| `scheduleEnd` | `timestamp` or `null` | Scheduled end time (if available). |
+| `groupType` | `string` | Type of the group (default, spaces, live etc). |
+| `status` | `string` or `null` | Status information ( active, expired etc) |
+| `rules` | `Object` | Group-specific moderation rules |
+| `eventType` | `string` | The type of event (create, update etc) |
---
-### **Fetch Chat History**
+### **Leave Group**
```typescript
-// Chat History with the target user
-const aliceChatHistoryWithBob = await userAlice.chat.history(bobAddress);
+// Leave Group
+const leaveGrp = await userAlice.chat.group.leave(groupChatId);
```
-| Param | Type | Default | Remarks |
-| ---------------------- | ------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------- |
-| `target` | `string` | - | Target DID ( For Group Chats target is chatId, for 1 To 1 chat target is Push DID ) |
-| `options` \* | `object` | - | Optional Configuration for fetching chat history |
-| `options.reference` \* | `string` or `null` | - | Refers to message refernce hash from where the previous messages are fetched. If null, messages are fetched from latest message |
-| `options.limit` \* | `number` | 10 | No. of messages to be loaded |
-
-\* - Optional
+| Param | Type | Default | Remarks |
+| -------- | -------- | ------- | ------------------------------- |
+| `chatId` | `string` | - | Unique identifier of the group. |
Expected response
```typescript
-[
- {
- link: 'bafyreibfikschwlfi275hr7lrfqgj73mf6absailazh4sm5fwihspy2ky4',
- toDID: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a',
- encType: 'pgp',
- fromDID: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d',
- sigType: 'pgp',
- toCAIP10: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a',
- signature:
- '-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBQJjh5tjCRBaJmgmByp5FRYhBJC23yBJT2d/pTAID1omaCYH\n' +
- 'KnkVAAAZmwf/buPLw6caSZmYnw6D3/p6HF1kWlkGUOTP4RasaU/6dkeDaZs9\n' +
- 'SJlz2wC8oOpBGWHMJ/5n3ZWmU71E6U7IKIY793MyIv5t32vTNkwsRHUX7IIn\n' +
- 'QFF+FzTIEtHHVTRlnkqNR2YUk1kqcpZCZWHfahi5W2d/WkXlFNdvyyFH4W8L\n' +
- 'd03FGhOyXbWwU3xicBz5mSBpIFaaSCXl1SdgJDPXLSk3b65EEOjCOaiz85xC\n' +
- 'G+6SW4RUzCGSDcOd9F2EXvvY5H9LgQNi1jjlZn6JrPTPJTJ+wXZXzcZmtOXG\n' +
- 'EKcwvPbbPY9wd+gavRSOgYLYn5xoZQW/o3hW7AQlbC5Kj6js48Z0HQ==\n' +
- '=qLiJ\n' +
- '-----END PGP SIGNATURE-----\n',
- timestamp: 1669831523684,
- fromCAIP10: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d',
- messageType: 'Text',
- messageContent: 'Hi',
- encryptedSecret:
- '-----BEGIN PGP MESSAGE-----\n' +
- '\n' +
- 'wcBMA1fn1CNqxQ7nAQgArlo75qe54WerfRKFv1+F9j4NRMvSTgUztvIe51eg\n' +
- 'd5MVuj6RYxKERr2bTuBt5cMDJMlNuTnBBkPe4L8+SlsI46L9wmXV9xLoZq1a\n' +
- '94JdxD98RGMF99Jde/3hC/X6GS1yVqPpKPKdWx/tkOPeyqeO/wFF7kqShgIi\n' +
- 'Wgq6hGz1fzD3GZhKGY0VSLuC3s0aUy/qw5En1Xd0uX0jdXBl07IIj8p1G2zx\n' +
- '9BuVlksSK34yvIc0RQfCeRadMHkxbA0Hyj31Wrr+Y310YLTppL0s5bQR9APL\n' +
- 'WHsIztJ1fHTnXsPhnA7YG0SQpHTyJhuX3rgBjxGrvbZBArmZ+R/Pq9IkOkJe\n' +
- 'z8HATAMOsbaZjGN5JwEH/jYjLN6AFRWeaB5CSBSAF+CvHsUgadGmxTdSHBM6\n' +
- 'LM9rfGg/MCnpRBuHckA0NNZh+wepq6TDA54ZopsdP14gHj4MKCdfqZr86Jft\n' +
- 'ldtjeSgPTFEEJxPMJ4/Z3UeFU9rvOgfxX6l0eHWS0MYwJ3sVYvSyqqHir1K5\n' +
- 'TRdEIgtQ3NvLTKkX4bKTSU+SInrvDA+wsc2BcBsbgNhRiGb+XYrbqXBshL1a\n' +
- 'lIdpnomkAQgOZMO2n347uURYoruH3OtFeNABJ9D/nEU+LdhDOPGZPefvPBc5\n' +
- 'BxK4ExKZ2Wo/TZw8lgC53uqOljsGV63Hp71LkyesKWu5/+vdVrYx/vU63shh\n' +
- 'x/TSQAEiaFYEfkWSOthtH0nrJHhkY7FWgjp/1bj/J4J9HCQrVtt2WlQfhowZ\n' +
- 'ILxhKk/vep0sJviM3SfJ4hPtoYpZESc=\n' +
- '=43Ta\n' +
- '-----END PGP MESSAGE-----\n',
- },
- {
- link: null,
- toDID: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d',
- encType: 'PlainText',
- fromDID: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a',
- sigType: '',
- toCAIP10: 'eip155:0x0F1AAC847B5720DDf01BFa07B7a8Ee641690816d',
- signature: '',
- timestamp: 1669831499724,
- fromCAIP10: 'eip155:0xb340E384FC4549591bc7994b0f90074753dEC72a',
- messageType: 'Text',
- messageContent: 'Hey Fabio!',
- encryptedSecret: '',
- },
-];
-```
-
-| Param | Type | Remarks |
-| ----------------- | -------- | ------------------------------------------- |
-| `fromCAIP10` | `string` | sender address |
-| `toCAIP10` | `string` | receiver address |
-| `fromDID` | `string` | sender did |
-| `toDID` | `string` | receiver did |
-| `messageType` | `string` | message type |
-| `messageContent` | `string` | message content |
-| `signature` | `string` | signature of the message |
-| `sigType` | `string` | signature type |
-| `link` | `string` | content identifier of the previous messages |
-| `timestamp` | `number` | timestamp of the message |
-| `encType` | `string` | encryption type |
-| `encryptedSecret` | `string` | encrypted secret |
-
-
-
----
-
-### **Send Message**
-
-```typescript
-// Alice sends message to bob
-const aliceMessagesBob = await userAlice.chat.send(bobAddress, {
- content: 'Hello Bob!',
- type: 'Text',
-});
+{
+ members: [
+ {
+ wallet: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGTvNZgBCADeYpZfxgn1HoMUuWM42v8ZWfLPwglQYmzz5rY3PdPPoRFU\n' +
+ 'v0AyPjYKpmLh2ZNfXjPaS9GuMdpXaomYSEwsV02hXZOQelo9cLop0Fc2i+l7\n' +
+ '70rYhePuOuQ+XD/xYzhngAgNJ9rX96YnSodldb8uJfxYmgoF0E9Z2o2fgZGj\n' +
+ 'll2CPnOaLXZaBQlPS3x/461TmZ1n2ZePS/fwiC7taLz3PtyGtKaC0vo4isvI\n' +
+ 'yf04fkjudG0XIns5CWjdR2HeDC8BzSl8OVj8AQAc5uVU8Abk+ejWVr4zfoox\n' +
+ 'eaziDPgGdkckFiQ6Tdsg0tPwwOpSrCCtJocTmc/fWaBb0YlnyAAL88fJABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZBMYqhmfI2WQQMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAACxNQf/UrM/whR7vCs+\n' +
+ 'ez8Y8Hz4WqIuXtfMh4l2nKVv5UUuAfQkBxEY5j6Ga2+JgKU3neQ34x/v6fm9\n' +
+ 'CLcY38Tc4AWyEx8KC78J+xOs7RMfyNBeiaf8KdaFfQrP0nMmufE6TxkfV1Y5\n' +
+ 'LJZZ8350rZVtYJppWtlH+gbyUmMObyWDWbL3aWtqa3xjv0kLsf7TnugiFwzB\n' +
+ 'gHHtk8tlDSOxRt0VdNNd19+/zrBYNl07Ig24WD2ETaJiaqa651z24/6/MkGT\n' +
+ 'MBoQh+679tuWWcTrNi4jIA8jhSQ5BOgbAapl3qXk0m9/Aexpe2s6ISLXe8YJ\n' +
+ 'j4cObDLv/ZKKeLZYTq9lVCydLAQUbs7ATQRk7zWYAQgAmx36uefgUF4cCSYH\n' +
+ 'WMWAOTyc8Awo+hxn6FktOLU1+9hfGrX2jwGLOoOwjNgbYJbiSvRglAX2b57/\n' +
+ 'qkkltAg1ZYCLSUzfBUbbWYlJNBwpv7+52zHaLUZ3gmI5aE48ad+uzaadgpVT\n' +
+ 'VqLbhdgkN6jkemPTlfMehyS49AAbmqeKfo2U72tm9ZqT2cPVCASMjN/Ux2qG\n' +
+ '3W8HTo0KIVFSbkTthl1zAlwAFksp0q437+pxbdJIecJ9mO6N4OQMnv+hVBDc\n' +
+ 'WrPqBDJ0nas4JNgLxmLv0pheGg/TEfwS/p6xGRW5m08bj2l0cgqmEaM27jbi\n' +
+ 'DEpOykRWsDMhheEfI2zV/Qam8QARAQABwsB2BBgBCAAqBYJk7zWYCZBMYqhm\n' +
+ 'fI2WQQKbDBYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAAAnBggA1gkIopr9HJFP\n' +
+ 'fO5SebcbowH4AG9M0qBqF4h1JIKbqvOnxLSsC5QmmzFcjS9ihyHBvzbRVGkC\n' +
+ 'zEHYpLRedQ2AmQQfsf/VOoZJEOlb7tTk4+SpYtsGte5X/yLT5Bkls7Rp8ubK\n' +
+ '/V99muj1nA/OkasllXQUSGEweVz6ejzJ0oMm3Vewmw8PelsdAnfS7Ud1MnXQ\n' +
+ 'h+O8TCR56F5gAMWxZmxFpZMZyUFOH6KM+vL7HJUBztUS2g0ELsHKy9ep2yhv\n' +
+ 'iABIwx/gEuPr0NDAH9x9XFKg5m3rO64KTY4BRWBISwmQ25dM1s1bwDPLi5XI\n' +
+ '6Daw1glFxpPRrxgQGlVLzJOu5b8swQ==\n' +
+ '=9hCc\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isAdmin: true,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzUlEQVR4AcXBsWlDMRiF0c8XTeAJPIAgoFbgQew1PIbXyKsyhUGtCqM6ZAJX6Z32fykM4hnuObv71++TYJRKlHtji1EqUe6NSJgJM2G2W74/nkzIvfHKKJUZwkyYCbOUe+Odcm/MEGbCTJil2/VMdLx8Eo1S2SL3RnS7nomEmTATZmm//BANKlHujS1GqUT7hRVhJsyEWWLSKJVXcm/MEGbCTJgl/sm9EY1SmTFKJcq9EY1SiYSZMBNm6XE6sHJhJffGOz1OByJhJsyE2R/3lDA4e9QQhAAAAABJRU5ErkJggg=='
+ }
+ ],
+ pendingMembers: [
+ {
+ wallet: 'eip155:0x119bb8ad40B1f94e2b30ae5f59eeaEB67cD0Bd6C',
+ publicKey: null,
+ isAdmin: false,
+ image: null
+ },
+ {
+ wallet: 'eip155:0x6e0C509d14EbF26A529bf6DC5CC9bee7F5b8DBa4',
+ publicKey: null,
+ isAdmin: false,
+ image: null
+ },
+ {
+ wallet: 'eip155:0xE3FDD0527a9F8418f9a7D9e970452827FbE202FF',
+ publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGTvNZgBCADouo4S2kPqA//+I7nDAk15/LcJ2TGvDhOYuPNUNMiNGOb4\n' +
+ 'txusuKz6HOaG+K9hiUBpHjKrYEmCT2FEXxt8bfS3SpWb74RHSkWUNUkxk25y\n' +
+ 'gE5gaCKyAdcnOUyVLmobVFFYtH6naK9bULaUtkVik1P0iuEevWHxtTpsjbyH\n' +
+ 'bZtNpVTdprdLib4Wx6bb7VogsvjlvNJcVJ4sfPE0XgsQgAGIev7yJyU0DGzt\n' +
+ '/EbvFX4sv51Kb1dX9ctBcvzVbs9+qT6LTivsrQp+TNHUN4zEeMhnWFFP5K1d\n' +
+ 'H445S6FWk53XvBudcOkFPtltU1MPCS6hmhevArBfYzy5eSlaKA/fH+kFABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZCrD2gy8Zu4awMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBKru9/u8wPcTeHibkasPaDLxm7hrAADa/Af+PbamVg/Ig2S2\n' +
+ 'HgIy4w5x7ulSk1/49+AmuiUMiVUwJSVBhROsyDbLET56w4+1TIMYZFJaczW3\n' +
+ '8tCvAOUSauzc52I3zwGmaCupBJokIWp7ncPh0B8TFYrgThgXV7sLf3xy4roy\n' +
+ 'y8oFz1Zla88krwtPe4Az7TF+WNdXoDsLNJ3GXRmNqs1GITmDqAXFWncl12NM\n' +
+ 'ajUKWIKc/Gi1oKfz22mabJTtWBimDpA12LaGK3GjEK5CiWXT3Tzlqn6R14EZ\n' +
+ '6ohpKZldSJiMPL0Bu9iT52iHOsw1wTZNC1L5lKhOCi3c+/fLRcJZt3hdCjqy\n' +
+ 'd/FSCa8/Ny/GrHBWoL49rSF4pDEA+s7ATQRk7zWYAQgAtNOoHCL7BCnjwp8O\n' +
+ 'htTxEI5r7Q/1zKKHiz6QKjjrGBYyR6gcmPM3JNEcvzY4OsCFnKBv2suOgrqH\n' +
+ '8kXJzfpIQ7u7uJs+O3p/cn86RMANiEnO8NbB/0scpfZ7Vg3eOfoiWYE4I/1o\n' +
+ 'FVDCyZ1YVqtbcmuW6D8i1djjeoUmkUDZyPo7Qs6hUsJeYA/Rfl8mH5sjy2cN\n' +
+ 'WXf8cEtOUqJtwERXt5aRB/nBZiC0bsP6hf0HtAoNA8/96TkqrcQpODW/RckD\n' +
+ 'fo4wkpEONHRH+LGX7GV0pwymHu42TUnULmED6BrMgMYG2sKpxMThxtAxRaiP\n' +
+ 'nZ3DKXr8GCjTYnbEZpoi2zKCOQARAQABwsB2BBgBCAAqBYJk7zWYCZCrD2gy\n' +
+ '8Zu4awKbDBYhBKru9/u8wPcTeHibkasPaDLxm7hrAADGyQgA5NMUkoyDTPZa\n' +
+ 'Znj1dB+17xBXCZ/u7pPQc1DukBefVke7/qYIicdnnEGIX3Zd7TckFRsDljR/\n' +
+ '3418Bne4WyL57fAF/GgYsegpJ9n1KT7oPxWzibIaYdj7R6bkDt5r61EDWC3N\n' +
+ 'VBbnZu9cO15TYkObJIiyNvwbQyd6Dm313b39GnEE8sM709TWsI6Es6rRZAfC\n' +
+ '+sI8ezYxqVUbP7sW3jJZYzdPOhZPHvFd5iJ2EfygEOuk5tb7AimfNwF/CNcB\n' +
+ 'weQGEU7feOSB9lXXA+Ag1duLM4B9bLbbHEQIPhKlBF1ED64e/W/5HNfoAkS4\n' +
+ 'qhzOD5XWs6xs45nnYqUbBFLG9Xk+Jg==\n' +
+ '=qtAv\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n',
+ isAdmin: false,
+ image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsXECMRRF0csbdbAZBagHKlJMSOL90IUq2h5UABktLE6/HcizY4/fOafrcntzQB/BTKvBEcJMmAmz0keQtRpk67bzRQ1m1m0nu19E1keQCTNhJsxO1+X2JukjmHm+Ppg5Lw9mWg0yYSbMhFnhoPPy4C8JM2EmzArftBr8J2EmzIRZ6SPIWg2yPoKs1WCmjyBrNcj6CDJhJsyEWWk1OKKP4DdaDTJhJsyEWeEHrQbZuu3M3C/iCGEmzITZJ/s7LOkKUABjAAAAAElFTkSuQmCC'
+ }
+ ],
+ contractAddressERC20: null,
+ numberOfERC20: 0,
+ contractAddressNFT: null,
+ numberOfNFTTokens: 0,
+ verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
+ '\n' +
+ 'wsBzBAEBCAAnBYJk7zWZCZBMYqhmfI2WQRYhBC9DyzhpX3ACb/yTq0xiqGZ8\n' +
+ 'jZZBAADwAwgAq/6WjtwRt1aPTLWwtSx80Ng/Wxf97dkpebMXSj9T7f5ia1rM\n' +
+ '8wqsuNUDMEMPB9LM34f6Q5pD994oeN2YT7z34u20mskiNphZdx/DNvu8w9UZ\n' +
+ 'rI3tyjfZULhARNVM34sSABnHtExbl4ZArhNDsT86ku0sZNjr9frn2mtgmlKN\n' +
+ 'nQdGcLJSxbci0hFg3nE5mYNpwZNs2S/2uk11WHKxzMhII6AdePE77BKPqedu\n' +
+ 'PiXDODO2dIvV8glLQoJPRPgc2ap+/xYIBUFljqHGPU/62VSLlHxBJv72p5s/\n' +
+ 'kOxiqD42TmpaaMtfudqgsZsGoYpZDHcMKYGNZs+9qVRHPRD+s0QhEA==\n' +
+ '=c6IF\n' +
+ '-----END PGP SIGNATURE-----\n',
+ groupImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
+ groupName: 'influential_maroon_gamefowl',
+ groupDescription: 'urgent_brown_butterfly',
+ isPublic: false,
+ groupCreator: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
+ chatId: '5f769c881ffe328117dea3d3acd0b97ce7f4c163e440f75a96be3e33f7d2a000',
+ meta: null,
+ scheduleAt: null,
+ scheduleEnd: null,
+ groupType: 'default',
+ status: null,
+ rules: {},
+ eventType: 'update'
+}
```
-| 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 ) |
+| Parameter | Type | Remarks |
+| -------------------------- | --------------------- | -------------------------------------------------------------- |
+| `members` | `Array` | An array containing member objects. |
+| `members.wallet` | `string` | The wallet address of the member. |
+| `members.publicKey` | `string` | The member's public PGP key (if available). |
+| `members.isAdmin` | `boolean` | Indicates whether the member is an admin. |
+| `members.image` | `string` | Image associated with the member. |
+| `pendingMembers` | `Array` | An array containing pending member objects. |
+| `pendingMembers.wallet` | `string` | The wallet address of the pending member. |
+| `pendingMembers.publicKey` | `string` | The pending member's public PGP key (if available). |
+| `pendingMembers.isAdmin` | `boolean` | Indicates whether the pending member is an admin. |
+| `pendingMembers.image` | `string` | Image associated with the pending member. |
+| `contractAddressERC20` | `string` or `null` | Contract address for ERC20 tokens (Used for tokenGating). |
+| `numberOfERC20` | `number` | The number of ERC20 tokens associated. (Used for tokenGating). |
+| `contractAddressNFT` | `string` or `null` | Contract address for NFT tokens (Used for tokenGating) |
+| `numberOfNFTTokens` | `number` | The number of NFT tokens associated. (Used for tokenGating) |
+| `verificationProof` | `string` | Verification proof associated with group data. |
+| `groupImage` | `string` | Group's image. |
+| `groupName` | `string` | The name of the group. |
+| `groupDescription` | `string` | Description of the group. |
+| `isPublic` | `boolean` | Indicates whether the group is public or private. |
+| `groupCreator` | `string` | Push Profile DID of the group creator. |
+| `chatId` | `string` | Unique chat ID associated with the group. |
+| `meta` | `object` or `null` | Additional metadata (if available). |
+| `scheduleAt` | `timestamp` or `null` | Scheduled start time (if available). |
+| `scheduleEnd` | `timestamp` or `null` | Scheduled end time (if available). |
+| `groupType` | `string` | Type of the group (default, spaces, live etc). |
+| `status` | `string` or `null` | Status information ( active, expired etc) |
+| `rules` | `Object` | Group-specific moderation rules |
+| `eventType` | `string` | The type of event (create, update etc) |
-\* - Optional
+
-
+---
- Expected response
+### **Reject Group Joining Request**
```typescript
-{
-fromCAIP10: 'eip155:0x84a9385e9b97df87b80c2e689997133703853874',
-toCAIP10: 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562',
-fromDID: 'eip155:0x84a9385e9b97df87b80c2e689997133703853874',
-toDID: 'eip155:0x14727F96dF61105661E78275D1A03C4F8aeff562',
-messageObj: 'U2FsdGVkX1/S1wljx7jN0NXJzSNoJCkg/6cw7gHwVibLsqyhpe/XgzJi7OUrXwUh',
-messageContent: 'U2FsdGVkX19oSSMVZpQdw+jZRExfd1GvJkIwgWAGe5g=',
-messageType: 'Text',
-timestamp: 1693316104031,
-encType: 'pgp',
-encryptedSecret: '-----BEGIN PGP MESSAGE-----\n' +
- '\n' +
- 'wcBMAytMqhuaZwVMAQf+KkUcX1rmNnorm0bCeGPknnjMBFn2wQ4nIAbQV5cW\n' +
- 'W7bCHneK0V0+kpronJwuPb8e8GUZiJEmJGdTJYf3XMVP8sJkVVVQEbvYvAJL\n' +
- 'tUEsdqgqRuqGB+u4k5shtlHN1ViTjjc1N97C0eQUqTCVFKa1Ul9eZirhDqiI\n' +
- 'C/rj8uxESy+NH7o/nnbGTlwQonOOLLHfGH2zCpl/F59CO2CcLnuecfDT0WxJ\n' +
- 'xi2hM/ovKgbsKVI8WOOde0sIV3MQEvxAFuPJ8gINpoDA28Ty+lf7x1bN9ONN\n' +
- 'RZl4yjLpA7KUojWyfjp1/UW635NY11aZYEXIygDppCCvf6AE7je+1FDaVR/B\n' +
- 'I8HATAN3fc/EzVLnXQEH/1H4r6FubywzPzRlDJzPgxyNpNGPZbexrWRQT5U4\n' +
- 'eHmh7EsOfEattUCHb8zChL8crnX0CCw9MiN/ryfs9PXXK2qP3lFU59GUHd9q\n' +
- 'Mz3RQwF76M9C8zbsoUymIPXUypBBma/qsF8MK54qYoVPody6T3u7bEfW6E8r\n' +
- 'nDtlz62+G6wk4sNE7iJsk6KhGmb1t9v/j1qgmJwuE7zGP0QjSuquJsfkzUot\n' +
- '1eU85XnUTGdoYBR2u5F2TsjIHn1ex2R0sZYfdc9eRNSSvDHrce9m7R5p7Y5F\n' +
- 'sSs96Skx7wLuepGt/vY2cH9Mq3AEGaXREV2NSr453+gHeTupp3aIiQ2CDpFB\n' +
- '/MzSQAHCPW1DUf8r1cFE1Y1RXU15gNBeFju/ZBnpDlTbj3xXi0shafcl59pe\n' +
- '0LTGhdDSYPX0Rs6zqJgex20XBnfgPD0=\n' +
- '=ycNl\n' +
- '-----END PGP MESSAGE-----\n',
-signature: '-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJk7fQICZASd4ccCgkrMhYhBGLo0VO3qtKBG9Y0eBJ3hxwK\n' +
- 'CSsyAACktggAr3mI2uwn4m4sI7m8A8wIRgjs6h8V7d2feLsdqV7QL6aUzYld\n' +
- 'bewZYKQjSXdnklRtnlCIG1jmqFOCycv++3O5jcWY+du8lR912Gkjn0PDN/wW\n' +
- 'jSBDTkH0IKmIrYqIDnfbxYoUfUxAWXzm8N0LgVnA+qgs1CYzcS8S38zAONvH\n' +
- 'GBl8ZXNTgY5HYN3Pk74wms5jhBF1J7mtfMCNN8k7VHFaoC6YVF1REhwrSlxx\n' +
- 'l4bajYkJJMWfKdiQWQ31kSHChzKXBhu2rIWJ6A7ijyoc7Ff0s4xgwm/3cLQc\n' +
- 'hrlBpkMKI2xCDnP10Sr1sgmG7ropd+tCOFwsoEWqFqt+kJ592+g1mw==\n' +
- '=TVDb\n' +
- '-----END PGP SIGNATURE-----\n',
-sigType: 'pgpv2',
-verificationProof: 'pgpv2:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJk7fQICZASd4ccCgkrMhYhBGLo0VO3qtKBG9Y0eBJ3hxwK\n' +
- 'CSsyAAA8/Qf/Qvcom0DtPUQAOWkM+FCeBttjkCiM/ekZa1Gxioyy7jT0Baoi\n' +
- 'oUi8y4BpmjKjCvUGCDovcvvnjeLW8gpqunN/LOx1c4mPsgFTU0IQFqZmTtZK\n' +
- 'KMa+p/uiTXNnwx9635FV8WLOWQoyJP+u76rTu8n2YU1+5+N7xan9Wl+yuu4d\n' +
- '/WkFwAq/WQjW4cgIZ08OWfNGaOh6kt3ceCvR25XVbb8gdMPOj262d7RuWVqs\n' +
- 'L31XJ8U/EkKZN5AxIB7AP6HKhZhlV6qbgizVFskWefT4E3Qq+9WLn4ApHf2R\n' +
- 'OksjHVbukZNbXrWeMjbZE9RlswPCXM68WsxWe1zItjXs63w1mwoQZg==\n' +
- '=e9QO\n' +
- '-----END PGP SIGNATURE-----\n',
-link: 'bafyreiewla5iyd7rnvjw2c5w6dbab4zkyf2desbowzouijoea2jzakxz6i',
-cid: 'bafyreibhnilz634i55hdkrkp3j4vt76dnyegvmrezdiuykeizq7unvx7cy',
-messageCategory: 'Chat',
-messageOrigin: 'other'
-}
+// Reject Group Request
+await userAlice.chat.group.reject(groupChatId);
```
-| Param | Type | Remarks |
-| ------------------- | -------- | ------------------------------------------- |
-| `fromCAIP10` | `string` | sender address |
-| `toCAIP10` | `string` | receiver address |
-| `fromDID` | `string` | sender did |
-| `toDID` | `string` | receiver did |
-| `messageObject` | `string` | message obejct |
-| `messageContent` | `string` | message content ( deprecated ) |
-| `messageType` | `string` | message type ( deprecated ) |
-| `timestamp` | `number` | timestamp of the message |
-| `encType` | `string` | encryption type |
-| `encryptedSecret` | `string` | encrypted secret |
-| `signature` | `string` | signature of the message ( deprecated ) |
-| `sigType` | `string` | signature type ( deprecated ) |
-| `verificationProof` | `string` | message verificationProof |
-| `link` | `string` | identifier of the previous messages |
-| `cid` | `string` | identifier of the message |
-| `messageCategory` | `string` | Category of message ( `Chat` or `Request` ) |
-| `messageOrigin` | `string` | `Self` or `Other` depending on the receiver |
-
-
+| Param | Type | Default | Remarks |
+| -------- | -------- | ------- | ------------------------------- |
+| `chatId` | `string` | - | Unique identifier of the group. |
---
-### **Accept Chat Request**
+### **Fetch Encryption Info**
```typescript
-// Accept Chat Request
-const bobAcceptAliceRequest = await userBob.chat.accept(aliceAddress);
+// Fetch Encryption Info
+const aliceEncryptionInfo = await userAlice.encryption.info();
```
-| Param | Type | Default | Remarks |
-| -------- | -------- | ------- | ----------------------------------------------------------------------------------- |
-| `target` | `string` | - | Target ( For Group Chats target is chatId, for 1 To 1 chat target is Push Account ) |
-
Expected response
```typescript
-// Combined DID for Chat
-eip155:0x7a38D295786d1480BAab4a63b8d85B5a47bA4b78+eip155:0xcCC0Cc5081A135E4269E82907d2dAD6728ea4159
+{
+ decryptedPgpPrivateKey: '-----BEGIN PGP PRIVATE KEY BLOCK-----\n' +
+ '\n' +
+ 'xcLYBGTvQKUBCACgsuLM540Bq39fAbLRGoaRZR5/lETkpQSArzP4+B+wxcQe\n' +
+ 'IItuLF9z1+OHilx/uAJ6yWH2En8QdlSBRMDCSwhLOXYnrB5dTvEM2nm+v59H\n' +
+ 'sIRkRUogXSIgTrcVG7Tt0JsrjBV2avOki1L4vzPvHEDUtlKcxdJ5914W2lSu\n' +
+ '05xPG+ALRsYFki1ga6bt6kT1+v7GV+862hOHY/FugohLKdIZOo6CeI0ddnHF\n' +
+ '9jL3pu4aTRn11VIphju3KQ2oCxF/6843OrA4X/GtVtsoRq00RBLuv61ZmRpr\n' +
+ 'qsOgEz009cDEWdUWs8wvf75TG/MfYM4g+9nSWflJGMSD3PfVHKTzOsYlABEB\n' +
+ 'AAEAB/0d/GNPwuFP73VsAAAi/qUfmlPPkJYuaBBoBslW6s3XCYAn8wCxhTwm\n' +
+ 'fKFrWEkcV/S2fr910Eu/gaURHggt+RxKFSXUD0z3MlTOhjHzgwQwt2Js53UG\n' +
+ 'hvpoNuf421uuiJ97x771gs2F5a2M1vjU5FvAlWji8hLtSVhYQVNN8BSZuhkK\n' +
+ 'Adq+/MsHmOvD6YkBW2xuAGo1ZVF4D8JUJDUWcjRJCMr0gJJv34c8f74EYW8b\n' +
+ 'LhrLGZgPRBkJemmN08sVwW5NLlPwjHTrvZOcb9RQ/N3liBwamk13dIEMNil1\n' +
+ 'GjGI6txtd04SXN0nTq2e+v+n8jk3HgwM3ypTAbaO+XQSBWyhBAC/mIv9OK7t\n' +
+ 'RoNA42+nJU+SYLEFFDew6x0b6Yg8k44gSiWiYadRWpDRP/essz641W1Ksn0a\n' +
+ '02kx+m55tT6uQFFwly24FOaFexhfvhbKtmA+sfJtvQVNebgH/2EJn9QSti/y\n' +
+ 'rGBStwDs48Psb2ZtcNNwhYajTACLioEF/vgx7FhKbQQA1reKmY5TefRFEK0b\n' +
+ 'lBqkDyYZoLKxEAoXQ6IwrVbIdO2kvPVDjfAy1CqpCnDhzXdXYmHA3HHOPJgr\n' +
+ 'PkLc8r0MeZR7ZI67JSSFoP2ixlxJjI06vXjQVvzrCigSJfL24LaBXBjQtd8t\n' +
+ 'X+g4KpM+a5iGrE1dQ/dgCt/G97Ra2v7Ql5kD/01W5Q+NqXxb++YrTJOXaNhp\n' +
+ 'yfSWYqtf62/xMoRBY8n/jtmyVD88i61aoqRsTDy+6Ugoi9QkrzhL7PSgn6Gl\n' +
+ 'yy5whksUFHFIcXDGF0HtPLIuEUJ7V3tC9yZ8Q630o3Dirf1+tP6+aLoMLwb2\n' +
+ '5O+SZFQk4cAVvW4aKbyGPdhlDvYxPkPNAMLAigQQAQgAPgWCZO9ApQQLCQcI\n' +
+ 'CZD+BWKBkBMI0AMVCAoEFgACAQIZAQKbAwIeARYhBEXCtUQEMuKbuZLzrv4F\n' +
+ 'YoGQEwjQAAC0VAf/VNnQ5xfPHhm6JfZ+cH2lUfy65pZ+5GqXHanB9RcxZPHe\n' +
+ '9hzr0l1IJk4o48HUrIcwJhpBfXUsd9oLC81Un1io0uX37hE3in+ND4j11ZiR\n' +
+ 'e8kQakH67/R7XKUaD3JTfXTshVpWhVTa1mjBZZcxOzr8ZxhnuaSQ7888t5cF\n' +
+ '0zBuOo6YPmqiNVudlXlhXuiAVqp+xK5yamqxW9drz767aXUAvE9GChE4+P0i\n' +
+ 'a1wwvvA2wkZTE2+rJKvAWA8iit4TeOTTDJoja0zc2yKxytdeOy6PWr6lGjjb\n' +
+ 'zJEq9uqs1tx8znRosDkb+Gw26CHdUo2uVUDGkcesqxNUv+C/4R9eubBVYMfC\n' +
+ '2ARk70ClAQgA38Hi0a1rqZAPdBaUnlqY4x4pIi2KyFPQ7TmW3Y/V1NgEm9Y8\n' +
+ 'w3bx3TF8O8uDETn6U5ASUa2DG4gppcZrDqFsChnxhHOdJhEgh3X8LeyzuCHn\n' +
+ 'qWQPbo2iCt3ve0fRsK/f0ZPABgCqlgTGkeVi7KppUqB1FtkRMfh0Eqr3fLC9\n' +
+ 'pNRLtlnQT793rfavvXavK+0eeukZVPYbALuJq2tX0IBwr9+/6YEzSi7yo/1P\n' +
+ 'pRZSRSM9KQwk/R2ohS2FAytUpTRp/4OFIJqv93PxS7MlHVfe/lhc9fXeTvH2\n' +
+ 'sMQCfMsp16wP7Em+AjT5elJgXv3VrQ4whrr5yGfTvO9uQVoV7LKoWQARAQAB\n' +
+ 'AAf7BXspAJiiTGQnYsE6WQIwYFDg8lHCBmv6MFNysQD43JbBjyUxdhrL7C6O\n' +
+ 'A+N1dZaxXXpoHnjU/zfHyGQqw3AcFsfBqSxRV0lAXh0bZS8ZDGvFMlqtf5hn\n' +
+ '1aMP3pnY5r56Kba4M5Vw2E2r5Q9Ey/YVMCVW1O1SjOIwirQGLbdhH+BZMvcf\n' +
+ 'iAJ2fbQ919cX3CuATJnMs1/4Q+7dzPcksE1SON6eGeixrzXAr1y/Ls04wx9/\n' +
+ 'DXsXyPunzNDVdZPttEbpNcWv3gZ9MHpYIYbC3kbuopC7ICvW4pkSGkl+uiV8\n' +
+ 'iqoi+AxjgCvXSq+eVI11sZJ+Rjqi7M9yW5qjxzw2Wy25sQQA6Jm1+nXwo0UX\n' +
+ 'NagosTXSf++9CDraFdbbpz2HUX8B6Ls8HwTMQ7q/EZRqmjKqeT/BxVQVp+O6\n' +
+ 'WNMtpnGMUQrbDI6Tcu6C3kVhZg/R9dWpRigsOHnsySrI74nYh9DBISAkabCf\n' +
+ 'cqir7V7treB5vcIaS80ys1vFHgtuLtTgFisCfpEEAPZEb0rbQ5PR5yTBvE80\n' +
+ '0MW3OnNDqZ8905GHJ6IGJVOuQuDQfMoZ+06757IwrWrQ6mZk5WIyiHD31+tr\n' +
+ 'd58MP351/0wv1/WUkPEcwuxWuTIK1kKtwQkcl75wZbnqvAGOigAFlvOTNPnD\n' +
+ 'qZVODWmod1Yg0dLIB3HF/xV29nx5ngFJA/9ifa68aMeoZqd3CePMS3zUwyLy\n' +
+ '6ZZ2cnUuBLjf87Fl9Rl+OLPMryEwA24I6ybcaa01ZsUgG2SZIwkKAovEhgmJ\n' +
+ 'll5mXY9GNpULHj9fr2KyLkweFnvyTwIpv0VlT7WzEthebIM0hC0eSJyNmu2C\n' +
+ '/SQTKvYUIcwP3v1RMFsCNPV1dTy+wsB2BBgBCAAqBYJk70ClCZD+BWKBkBMI\n' +
+ '0AKbDBYhBEXCtUQEMuKbuZLzrv4FYoGQEwjQAABMkAf/UKvQHe+oYH/hU0/p\n' +
+ '7OXUMCKIzSHD9c7lrb2nnP4CGyxF+FoZbQ9qnMVuT6FX6zPyZgDtOjp8Grvc\n' +
+ 'ACBibxwujfnNdKBdA1r0XQGf2ht3BWYpgn9jGYw58bf3yaxr6/Dg1D7FzgbN\n' +
+ 'FkaarU8C4fEAhiAHY4SpMUzqej/QfrwvasjyqPnbD+vCqyTivNmpTb6LYzXP\n' +
+ 'BtXQW0A1B6EhmFwftGyNxIG1wEO+tWE4v4XLCyscAz8ZBMBPdfaRe26lnr6C\n' +
+ 'UnTUwL+VecX2uIVRE9w9FhXuKeaPoDzPWnu0SZ6WCUV3DxQwMoUB/3vJ8sRK\n' +
+ 'l2L+h0L32V6yjL0asut2G+qfvw==\n' +
+ '=o527\n' +
+ '-----END PGP PRIVATE KEY BLOCK-----\n',
+ pgpPublicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
+ '\n' +
+ 'xsBNBGTvQKUBCACgsuLM540Bq39fAbLRGoaRZR5/lETkpQSArzP4+B+wxcQe\n' +
+ 'IItuLF9z1+OHilx/uAJ6yWH2En8QdlSBRMDCSwhLOXYnrB5dTvEM2nm+v59H\n' +
+ 'sIRkRUogXSIgTrcVG7Tt0JsrjBV2avOki1L4vzPvHEDUtlKcxdJ5914W2lSu\n' +
+ '05xPG+ALRsYFki1ga6bt6kT1+v7GV+862hOHY/FugohLKdIZOo6CeI0ddnHF\n' +
+ '9jL3pu4aTRn11VIphju3KQ2oCxF/6843OrA4X/GtVtsoRq00RBLuv61ZmRpr\n' +
+ 'qsOgEz009cDEWdUWs8wvf75TG/MfYM4g+9nSWflJGMSD3PfVHKTzOsYlABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO9ApQQLCQcICZD+BWKBkBMI0AMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBEXCtUQEMuKbuZLzrv4FYoGQEwjQAAC0VAf/VNnQ5xfPHhm6\n' +
+ 'JfZ+cH2lUfy65pZ+5GqXHanB9RcxZPHe9hzr0l1IJk4o48HUrIcwJhpBfXUs\n' +
+ 'd9oLC81Un1io0uX37hE3in+ND4j11ZiRe8kQakH67/R7XKUaD3JTfXTshVpW\n' +
+ 'hVTa1mjBZZcxOzr8ZxhnuaSQ7888t5cF0zBuOo6YPmqiNVudlXlhXuiAVqp+\n' +
+ 'xK5yamqxW9drz767aXUAvE9GChE4+P0ia1wwvvA2wkZTE2+rJKvAWA8iit4T\n' +
+ 'eOTTDJoja0zc2yKxytdeOy6PWr6lGjjbzJEq9uqs1tx8znRosDkb+Gw26CHd\n' +
+ 'Uo2uVUDGkcesqxNUv+C/4R9eubBVYM7ATQRk70ClAQgA38Hi0a1rqZAPdBaU\n' +
+ 'nlqY4x4pIi2KyFPQ7TmW3Y/V1NgEm9Y8w3bx3TF8O8uDETn6U5ASUa2DG4gp\n' +
+ 'pcZrDqFsChnxhHOdJhEgh3X8LeyzuCHnqWQPbo2iCt3ve0fRsK/f0ZPABgCq\n' +
+ 'lgTGkeVi7KppUqB1FtkRMfh0Eqr3fLC9pNRLtlnQT793rfavvXavK+0eeukZ\n' +
+ 'VPYbALuJq2tX0IBwr9+/6YEzSi7yo/1PpRZSRSM9KQwk/R2ohS2FAytUpTRp\n' +
+ '/4OFIJqv93PxS7MlHVfe/lhc9fXeTvH2sMQCfMsp16wP7Em+AjT5elJgXv3V\n' +
+ 'rQ4whrr5yGfTvO9uQVoV7LKoWQARAQABwsB2BBgBCAAqBYJk70ClCZD+BWKB\n' +
+ 'kBMI0AKbDBYhBEXCtUQEMuKbuZLzrv4FYoGQEwjQAABMkAf/UKvQHe+oYH/h\n' +
+ 'U0/p7OXUMCKIzSHD9c7lrb2nnP4CGyxF+FoZbQ9qnMVuT6FX6zPyZgDtOjp8\n' +
+ 'GrvcACBibxwujfnNdKBdA1r0XQGf2ht3BWYpgn9jGYw58bf3yaxr6/Dg1D7F\n' +
+ 'zgbNFkaarU8C4fEAhiAHY4SpMUzqej/QfrwvasjyqPnbD+vCqyTivNmpTb6L\n' +
+ 'YzXPBtXQW0A1B6EhmFwftGyNxIG1wEO+tWE4v4XLCyscAz8ZBMBPdfaRe26l\n' +
+ 'nr6CUnTUwL+VecX2uIVRE9w9FhXuKeaPoDzPWnu0SZ6WCUV3DxQwMoUB/3vJ\n' +
+ '8sRKl2L+h0L32V6yjL0asut2G+qfvw==\n' +
+ '=4XKH\n' +
+ '-----END PGP PUBLIC KEY BLOCK-----\n'
+}
```
-| Param | Type | Remarks |
-| ------------- | -------- | ------------------ |
-| `combinedDID` | `string` | Combined Chat DIDs |
-
-
-
----
-
-### **Reject Chat Request**
-
-```typescript
-// Accept Chat Request
-await userBob.chat.reject(aliceAddress);
-```
+| Param | Type | Remarks |
+| ------------------------ | ----------------------- | ------------------------------ |
+| `decryptedPgpPrivateKey` | `string` | Push Profile's PGP Private key |
+| `pgpPublicKey` | `string` | Push Profile's PGP Public key |
+| `decryptedPassword` | `string` or `undefined` | Push Profile's Password |
-| Param | Type | Default | Remarks |
-| -------- | -------- | ------- | ----------------------------------------------------------------------------------- |
-| `target` | `string` | - | Target ( For Group Chats target is chatId, for 1 To 1 chat target is Push Account ) |
+
---
-### **Block Chat User**
+### **Update Encryption**
```typescript
-// Block chat user
-const AliceBlocksBob = await userAlice.chat.block([bobAddress]);
+// Update keys encryption
+const aliceUpdateEncryption = await userAlice.encryption.update(
+ ENCRYPTION_VERSION.PGP_V3
+);
```
-| Param | Type | Default | Remarks |
-| ------- | ---------- | ------- | -------------------- |
-| `users` | `string[]` | - | Users to be blocked. |
+| Param | Type | Default | Remarks |
+| ------------------------ | --------------------------------------- | ------- | ----------------------------------------------------- |
+| `updatedEncryptionType` | `ENCRYPTION_TYPE` | - | New Encryption Scheme to which keys are to be updated |
+| `options` \* | `object` | - | Optional Configuration for updating encryption |
+| `options.versionMeta` \* | `{ NFTPGP_V1 ?: { password : string} }` | - | New Password ( In case of NFT Profile ) |
+
+\* - Optional
@@ -4724,68 +4949,57 @@ const AliceBlocksBob = await userAlice.chat.block([bobAddress]);
```typescript
{
- did: 'eip155:0xdE3CA2cC2c91Cb9B3aDB80ac497662Dd9E57BFaA',
- wallets: 'eip155:0xdE3CA2cC2c91Cb9B3aDB80ac497662Dd9E57BFaA',
+ did: 'eip155:0xEaC9c666570782E262f1E2a0b1d3BE4B95aFA7cd',
+ wallets: 'eip155:0xEaC9c666570782E262f1E2a0b1d3BE4B95aFA7cd',
publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
'\n' +
- 'xsBNBGT29asBCADVtp8rHsmtqgUSHxutStJ8AO78jWFFerHJQQ7M/QRZ/1mg\n' +
- 'uDTt4QTsmhNPlyzQ/OztVDOddn3qqZg4/gLUpJclMmR3UmxmTGrv9PaL9IOv\n' +
- 'otdKrLlYKeXUHbaBWVgXHv6F7hrCx1Faiq4I5Ca8tdxhKyQc9WAA4f7TTxhg\n' +
- 'htDY3VfRnp1LFlXyx8GyqCBGpmQx3tSK0w6SoC0FdCq/DpaXD6ofIKH8kcjJ\n' +
- 'vpBXw6MLwymZrfzbUtYWykOZ7QWgDWF6Y0xjDjZvlajGeY7NfciQR+2ylb1r\n' +
- 'eOn1yGN0Fvw6+7gGZy85XaDoCnyDAws0Nn+2G9BqTKVH0UwweWKcqOtbABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZPb1qwQLCQcICZDxpr16PpcWmAMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBDqZlQ8vQkW6qMko3/GmvXo+lxaYAAC9AwgAy6nLLykcdRlW\n' +
- 'dPXUN/wTqowopbuRo5bMhz6+Q53Hf6qkjfknaswoBtE2bq/J54N0BN70Lv+j\n' +
- '5klfjZWJF2stgMEyQfPbXp1yXQi9Rlmvg4qZvZRww5UNm6CuqxU/stXQK/Je\n' +
- 'N9eIqd+fTB1EMKwbFrFHfOSKWK7OGnb6fi6JqofJcGvA0Oj1Wkf3i6UohsZL\n' +
- 'XE8L1Ku2IXc4oUZH5UZD6vRYkQg6/EGq+WrHUXX2nifdK5b5tGZcfGe6Tudm\n' +
- 'KeYFGTGfgbA8ag67nD4Esr296Mjjm06TTvqdo2r28/zn5KcRPWtHNpPU+t2u\n' +
- 'kwq7UBvoroACgr3yZkdAFLt9E5NRTs7ATQRk9vWrAQgApfSeqUx3ob+kinzU\n' +
- 'opKC8L9qV6jqkYu80coITufcc4TUEYlNEZwSaMRA+vOk+bwWbc+zJG7zW8aq\n' +
- 'Tx0LyZqABgRsWOsNblepCzyejLmAwxl8kBEAMQvJ4Hjo55MGEjfsIFSqeEGt\n' +
- 'PkPZBpxYN0/sB+yYZDt+59L0GGLC0vrxvj9aLw1xRaTNCNLkawTa8vTCwSTY\n' +
- '/833aJy6kevAXzj7V8hOGnY5JU6dx5Wbsi1HmzuhtW/lG2n0JtYokfpESnQ7\n' +
- 'La8I9PqpJC87iFEdt7MST2x687sf0vJI/QMRQ2kZF6Pi8LRYuMmrYTF2BIaH\n' +
- 'kmPafAoy8BYNfetl67EArGHckQARAQABwsB2BBgBCAAqBYJk9vWrCZDxpr16\n' +
- 'PpcWmAKbDBYhBDqZlQ8vQkW6qMko3/GmvXo+lxaYAABjFwf/epZQQVs6w3Fj\n' +
- 'JV2OhS5PYsNr7hWAgAVTgqBLOuPkWG+yfwmayqyQKJmr3a/e+1wKC+Mrz1D7\n' +
- 'cRpyiwyiCp01has6qMAledjGweg5wTz4axMSQn/KsLc7dsLOtccV05RkRPMZ\n' +
- 'vRDDJkfIVYILBikTcg5WEIulGuy7enQO+Mo239WrUxi2QjAkEMt2pxjp4qNM\n' +
- '9vMEPo8uUiEj/+Tsq15kbE5NGpL+n69R1/PYpHp6R7acimsZlXqyhUVaTD67\n' +
- 'QDFLdR8nVToU2ACOvmJicTVHCiDbRfeUgMaaTu45degUEE7rbh+dNiJrkyFh\n' +
- 'GCHIKjRcKEpModMxiZSJBINcWI2hlA==\n' +
- '=ktHx\n' +
+ 'xsBNBGTu6YUBCACa7JaMqfhAnD/9ynE5Rhi8KNQ1tfdQe0ay/9jXX2naZIA+\n' +
+ '6WCi1uNcB2TTLfMuzsEl4u/26LTgtkr51snRt2QKgEqi5dXqbRD76wiRLd4h\n' +
+ 'ktBb4WB28o+BWOHYYJQq8he+zu3mQWjKLb1e9DyS0cTzwPwWVKce9IsG3NOi\n' +
+ 'eM7O5Kg5cU3qHXR+frF25peCBrzNXH+xuuTJPsX85h9dSz/u6dWXhk2LsX3s\n' +
+ 'cmX5mFcFErnGvUBddDGZc11q+WzZAtENPCxQrNjpkMtzCj9UMwgsJdzBghZZ\n' +
+ 'ZouGTG2uhfmIj3/KHOdwx/KGpTgC1iMVOb78kw9LmaxL6fGy4x9uvvI3ABEB\n' +
+ 'AAHNAMLAigQQAQgAPgWCZO7phQQLCQcICZABDloJB8hpcgMVCAoEFgACAQIZ\n' +
+ 'AQKbAwIeARYhBMga3B8GDU79nd/0mAEOWgkHyGlyAAAbHAf/bJMPIyvNZNjO\n' +
+ 'JK2xA1hYpzIGdbi3jMego6GXrmet3qY50zMKDccB2Ot399y/nmWMVEyfKYaP\n' +
+ '7N+mJbeAqIZ8TAHtpw++k/h8/hXoxb9iPsQyWYossuG499XyHnk+KEd4g0Wf\n' +
+ 'mqPk/XJB3xLLgW820jOsRRbWLyYKJEdh1Q+GIM+D6oIJ9ZmyRPv25u6yCF2P\n' +
+ '2IQZErWeYD/LxqMDw+uHdRZJRiyFy/Y7A43clejN+p3my8oktXh2N4+tEl7i\n' +
+ 'Hwxc5z9AOffuEyUerm0Rjwdn8rG8po7AfuXwmTiW1Sdc9TdJtAK/n6e9EFHV\n' +
+ 'gHzArwyaydHHy80Wqa+UF591NkPi387ATQRk7umFAQgAs0ao+EFoKJirGHfI\n' +
+ '69vZg+eAAUUKG657BzNzTAF2r5Y+a61jdcCAL+DXBcfks+H0dqG36zjOZTCJ\n' +
+ 'NirABp5RRPFty2VvUtOyezuKX/MBVg3st3t/yE3SncVaWMblAv3iegviNNpH\n' +
+ 'cFKqpHoVBWDNdhFHNsKTjpJcq3BVohy2Dxh8Di8N/1+gEPxADvIuH9MQ8MJk\n' +
+ '6lB9XYXBmmqtlQ3sB916mvusUIl8Zxw1C76yY0PAXz055zJMiL1vwo5gKDiV\n' +
+ 'iKyzry3wq7upPGJyeTKu7uUMifTPhJtyYvon2TIik5DIgHpqKziirCrolA+s\n' +
+ '7LhnFbawqDKleEdyCcL5mFCzXQARAQABwsB2BBgBCAAqBYJk7umFCZABDloJ\n' +
+ 'B8hpcgKbDBYhBMga3B8GDU79nd/0mAEOWgkHyGlyAABIqQgAmK9ijEEvtWTm\n' +
+ '7/mhkuDEtfPfcMexfkaCcGL4SdZqVz/h+eIL8+4EbI9uq+YTzcjtX8FAEQta\n' +
+ 'KWFACNEOPmSy6Sb9bDoNZUVpDaZzNNtqIK9Brt4zjJLEsDfmkuW3S/SgIYBQ\n' +
+ 'yTkuNmmAf8dr7L4fG0JlxPyGaL1/w9UDAr7xdU7WcHuyPc0edDGeE7NwaGWp\n' +
+ 'uBipXFw8AkikV3fCTDuOi3uhkIzZ5zlGCshD7m0aDSABwr4hbFzLFBDSrsiW\n' +
+ 'GKhWGYgf5Vx8qzlwXYYnoW/rn3UXWpeTXjq46ZNaxjHJ4VxGMyn/tHZOEjDE\n' +
+ 'vHapLIAgGyw2b+s+zZSqsXaMkH8WOw==\n' +
+ '=gPzx\n' +
'-----END PGP PUBLIC KEY BLOCK-----\n',
- encryptedPrivateKey: '{"ciphertext":"5d3b651b63db81767bd7b9387a085c0134a30d2c77545b4db528c15c429286620edf527b069d4f90fb7e7e769c6a0fff19f52676972765881cbb601e78f386cc492b6ff7a4739996148904dc09f4f95ebbd53ee4e0f17d17dac66aa5b11e09daecf307b120f5d1157465ef15114b0b20642d7b64d45a218307764bf48c819e05247db0d782745d458e5ca574f92e0479188d5ba557201d58d85753f2619fd1648a80f8153e4847b7fa455e50379b096b4e430fb49b3084441a08f715f3b99c722e5a6b730ca8c2160075594caf3fccc26bc9289c116751e4e8306cf33b96a60bbbe46bf4363dd3b25529ced93c67ec60a153331fb340d2344851ace937dc161dd9aeef20dc71a6afd7cf308d8f4c05e9c779bf5d684fbc4620b955b0aaa80f89287c197f2f4b00b5450b55770ca1d44c8a78583762c3740dc88fe122afbec422e64842ae9719d21334d0289718468d11a3cd12373583488da7631f924c9f1566c6eaabcfc9f146fa50e49986300f7e7a3d36d0056c381f6decb38b10ca291a747deb0d896168fee9279b5bbd0ffb7aa419843d1f69da632552aa885ad694fe8ab50fe0bbc79ca4980e522d4b001215bd267752340f02270d05a5ad8673ef998199b1b0e6930cc53c97a14245ea5355e10a438513a94bdcab49b4aa605277ad11ba0603ac59d6f2e1068791a61b4531d55c55837bf43299524e5c4ff454631eddcdab0f036b70985e49f155bed3bbbc36f9e69b6c411077051c2f3083354160146336f7d023b51b8091b32cec3b0d8e5dd67f3796e00472d1b305ad3f861b6ea863deeabad29bac8dad1ded1a59fdd965ff5903c7dfa1ad956a4264e2227ffe9bd9e15ce7eb48c0a6494c07a95865770adacc94703c19f4c1aba9bf885d6311490a285d42a6e8899de07709e176a30dff3e8988de3f22188d0adf03bb633607ffd4daa503b7121a5e5c3946bf3a48d62d511cf5518ad94b43839827af07faf9037bc959a7ef621df75ad965045dba6c89ae255d200ebcfaa0a2f652ffe630df57685eb471c4b089ec6e7d4c841f1e2e25bfc3b852cf79c4fdf66327a18302fdc10c6f044e42387bb89c45644643546e93324b8ef4d7ddb6016457f5098da369915ac6e1d2ef45fc9155cf13d165d7822bc6e463932cc69ac7b372a0e3b18c45b45bd275b38af4b29d665856dfbd6e6c6ecd9b6d02f4e61308273d76ba0baa0eaa03ad831adb428ec70a1dd29b3b2c4941adfddaa76ac99c47bf6eef92a361ab890c3e9bc714263a4f93289cad7344882886aa101685586a54e5da7d370449b91400e48c6a1ae8f6e2bcc06fe186d981399c28143a3faf1cf2c06342b82382c01096ff8542ef55c24175d052f199fe39a4ebf39c56bd30a8251c19745d1b9d0a1a96d81e6cff3c060d00d85d627a9344e1ae98cb42c1f05cd2dd9ae3d83b7974a7bf96980c33fcd76f96ec6c2ea11a2348026333424307f1568e5aa575c31f819260d52ad968e9a17cc46723ba1e129614d2a47ece4dde0e0cf4bce2be7ab25441255997d8bc659a194665090baf6e071dd4775b2e2f7974d26e0cd040df9890ab58c77732d6e33a8ce909e965c2f04a7f65ab5331c044cbbbe39184721310235a772b30a30071a8058b9941f42d85c2e63bbfece7d6116a507bf1612194ed17f430274e4053d2b8de761cd6c316f08c401c66f1650d0e83fcd0d69dc92763f8202748d8e40bacae6cfa264d8ab19ff86e1753d3a33c3ee9b4b9fa6ef64765e9d2b2ba52b28e61743aca96471e6c35143ac8238275b504e7d0ccf0c9cec095d02259849b5f382fd7eb0b7fa3ddc0c5dd91cc2be7829948852dc740d9227f17b2f960141f4807678a2dca6ee24a858a6f20874b1b8e35305106c77c38dbbe52d3e533a845dc8a0912c7d95218c6b820384de5c2693447529522df552383e35d126122801008aca30065c8f93c8556ceb09f5512e64dd481d5ae823675c201124759a80477b1be6ff4756e94e814b279f4de19b79a72acc52d0e1d1e9119abbcbaa1ef0c6dd50894db4ee5f4c005658416fa840f19e36b65c591e73ac8ae4d9e49ac13dfc40d754cc4f9eefd327876a94e5a72f6ebcc8bb4645f6da8a7505d64190ef400829be6455737fb60d595ab13cc9d8634514675803693402570ff869858943c4cfaf914402153a41bcbf417be30c8220ff994d48d85a2893991a5241d407e6acf8341d11bc72de3967720238b218052580d121c6d2d01e788d6cfb2bac26ae205e0e72198c40418bb6e3f25f0e14f03d237bde9efdccdcdb2659a40276ac760a4eeb0770bdff49513b88e51a649bccd82da5c82e6c50a91cf9145091f08bacf7aee46e80bdaeb320af371d6e6b6bc29fab41df2c4f09953c0efa3b92f0745c9480536680d60fa0badaaed85b8836b5e5e54c5aebfc99e2a3b32ad3a5c882829b55e9d80a33468b05e8196c408a9de4a13af00df4c9b632eb4d04372c99c8020fad56383cd4937088d2fb4e7a0c4edc15e3bd79214337e02fc72cfa703e12bebc396068da9eb6ef142a55f6eefd8d11a501c4c6610c808a75923e2b279a2809ca34c2da49731ce85756a7039b667cafcb081693375f4cf8e1b39aa5f29560d7ca003775ad5affc621c359198a4dfe484edb11853586c1c664459c996457454803fee7350786410b8b9d81bc0e31f4426760ef812ebb49b1a63612c3c3249a0dfea9b50b620a818654bc18bb3f411024ef9ef7fa21a494f359473bcb30c70070b78ea9106d5441dd89322ee2a31c945b884ee9008841ca8dc776aaa6c46526e6a21ead1831b20697b75905a13dd947ee53e6a105f0bccb3184f679b05c475f5294d96a16fc50dd9430967a1c7013c054f3fb0fe07c586c5835b048238fd1effb7bcb6ae6da40883f387dcf684ac20709c59a312507d125fbb65208a985f0a6f5e2e442330ce39c0503d27cd32d61541f99e1d20b2314e830f3d03918be89152a0547a45ba0a419ef6beccb83b444c8081fd12c79f8d88ace21c9057265b351a7ed8588560a9f549149b1e2fcacf99fa6cd045462122a4f60d969fdc7d780465349fa359c95a5b58a9e2b751e45301696407a1ddd17c32dc7bd5acc3ce09ff5ad20b9d91a9ac8eb3d142bb6907f19b789cbbe15a2a34469e90a652e5504228f12411a4ef54abc1c1d9a132ab85e42f1dbe2c14eab46532f22fbad0e912911f44510c10569a99a0a99f774070178776a970d83bdf50257cb6ba08ba6561b16535b1e05c16a06bf0e3b29b082f66b8336e676cb4c6e9bf98362b631173f683d251c4866e49860fb83f4053087f44c033198397ffb69b7053746ba150e16399c2f064967334f893125de76539730211f8c6edff3108db2c7e8641fc50ccb9946596b59fa425265ec86db50414218b494b5166399209a1d664d2157da0161d9786396dcf2d91f9433d39219d35f6974c96e4f1bf5f5e0a17db196e97dfff13e58131ffcbe3a8a647cb6a17754657b93e9b9cb458b9bd1d8cbbde72cdbccef7073ab2c290e237423b8053a5cbf358a88d1101e1f648c392c80704c7dc9d0509e186a11a9d90e9106bb1fee1883af0daeed804702b9e2384ab0c519129ae330914ade6c5080f6a2d17b716f71d81c352c07c2cca0c210e0d951b0fefecbb00ff0c3693fe262cf9125094b46329eed041d3801025ebb67722659b98d3e5da83ba5343a058540e868742ac36c852f26b3310bd33af4884d3e51e046c0ee17b714ce1f29df6442468791a469eb1e387cf9d366d24b00aec6a089a88c96a82a1ff71b1947a24015b1cc13be259be5bb75731a18ca58aa46609e2a2ee9fe0583588f0c453a2b99166831669547428941bda9a65ab82462de8add40f16976a13e36a0018886d27b4cba663369d13fb056a874f6d5e0e9ee6567ce7428d9e179790b44649a05aa8523fbda4b9db72873e9aba33892bc0677339332d5da9b3b4754e2b387597d8405de304d8b65ba6bba9b0558457431820582df5ae3577efba787ea3b4eea2515cfba590c7821d2d47ada99c612ed4e3b9d3ff9ced63e76379789da562f45f851bd10e8e6d2ef633984ef4bc6bfdb4c833175448c3c6f1f7735587b6e325866a21b8d02cda06e9520d18350e38b428b3949635dad18cccd4d840d9e4c872b32c527d2f521de3822565b7af6f5d8e254bc142029faa91effaaea2ce70de748eae946a2521d3b5952d5874e5bd6c4322a35660b51ff114d5cf6c5b5fbaacf834eb1eb68087ec06668dbe804d349b1d5bd3396099f3062982fdb9a6afe542c8529752c728501ddbed65a210a28f351f3f44ad40d3a6ce4995f2e6da7495dfa40a4838fd2d808b2e298a863a7475c2134a713cfe8a47fb5bd479891c2747f0db0005ee4a894b6e8b66cb5e1af8d938fb1f5f53c24aeacbcf25b57b83c5abc3a1adbf7853e0a6ed5904e19d5d824b1500296550589c4a3186359b72a1d482b02dfdc1874e64c78a9df7097696457832d6aa572102000c06af444c8ab83e6204ea920a2a847cb163efd9a4701148b4009b2f8053bd7d6408045f627df3f45b002d249a20dd829cc8ba18d9c468d816d451b7f3792e31f360c5932656aa7bfae55b75ae0c40af53ad33005d065d047926543d68e9548c51c3d5405a164b902825fa5ba8c8be5dbfe8632a94df6ae322425be86df9234140bbeeb707d45dfb4b64a09925499ddd2192ad1174776f006f3e91627768f60be59756b7a9b51e4e4e02c01a7fb8b06e63dc3e71951e0b426652b1796bf546da832ae70b055a4700b3d6e266f4af898f0f517277db75aac827d6c30f75c6a6fc9fe6ef67e6f3fbf9c21f731f1f5d89feeb1a76c7ac9923320eb56c517f937a32f3629a8fb4f134a499562f837515596508cf6b2ff3de5c536dedf2946b85505c5843d09bed34","salt":"7b0c5813b930a5ab6713f1572441734633ec845aaebf526f1daafbf89ef268c4","nonce":"bf2c1e6312caa6a32e95eee5","version":"eip191-aes256-gcm-hkdf-sha256","preKey":"fe71bd49335560367aee6772233e69316de48378df6ed104647068e8525d2c4e"}',
- verificationProof: 'eip191v2:0xe58171978843f55fda11f3989ef8a2310a3366585cf3ba6c71dc260e362bea1b2b2667e287959f6f79628a03073d5757011b7161a2782c32290f924486f87e0a1b',
- msgSent: 1,
+ encryptedPrivateKey: '{"ciphertext":"4f1243e1ffa76180f46ade2eb093867750c6bf72e8d6c71c7c0edca176c2f9fb32c603bb5e52d933730e0350292431b6e5287b8201f60ce9151b6a141bde98cdc3d9e5df8f84e00e5e4173bdf28b66e9590db10195fbd41ed241a65ab84fb5da251f613376bf78efe1af64613dd54fb05dced7cf8de0907d61489712ad42f06b5c775d97d15dee09b1c58cd79f596674e403353bc7e03297aa0d3fdaecac573c962409622ff8b1335b6fbb661bd2d5f5a076d9079f857849ba917662b40151041eca71385844160fc603c4d1beefbf71b26ac8968de52d6bb534ef6d6e2ea987170059d7d881dc684d28b5b2817804fba3b659e3ec0e802583e581b9f75d2f7e69e428cba91e62719e9ca6697588389db89b982370d23952120c0f972ab4b3a0da888d52b5055c60785d276152e43929df532bc7d5d68c6bc3cfdd1ca780df346113999a19d8e4a96c02f149d1ee4cde802277081ef339153872c00c9e9ddfe3ba8da8c68c0565752fea32258087e66aab37397a27b0228b5ed1aeb09a93b80778fd7f949409106c4cd82ff550aafb9d7bdce8727a76882f59ef2c54a137e51f04b6c27a0b1b92cd781dafb489a5e8203232669f5416454cc9cfe8c5b0fd8abc19d9ef16285a8da0aca2ed747adef7b49b8215790266d9c4791c250b0580e89c6429d10a1bcd45cf016a7ae30e1db948147d992722a7191e31852e6fd3c3679d868f34ebbe65f255be4b90dd64ceb52eaeee7d3356683b7fd511729493c887289ddb0f00c65ca2a95114f0e37d3b73d06333e2787c5fa6dd6f6c9e8334ff153dd63e30c81247efd497cf2c038843d8653edf23822eae07dd19d0be26a921673185bcf016533fdb59150ff46096419e6a6aeb1bd4293fc8146848d715d43afd04aa40f2b5ae9d058671677aad2413952a20b5214e18bbf3b4b033d936d673a0302967de3f74b05b74bc6c89f30ddeaab1bf6c567fcee355797b6cba17c3fcc8955bdf096e2dda2577b3374089d8c9d287552e5658c91e812bd0b8b63482c8de98fde216dd557eb34bafca2f8e73dc4582fa36332e8869f2717519921605915d8e1c75a37295e198ec0af75926d89a6832456304474a10c567334998226d9b6f709ebc216fb067d958e78a622040c91f46af202273d0b40307fb34cba5a6a57fbb196ac6e88c16d527b9bdb04b12fa7ed0bc771692712ccd146c41890b5caddbbb13b8ba77e632b2d7597256fb576ce87d2aff35a0e953b8227a5dcbf30f7d189ca7f77f6f8b2c4eb2752199a7a485ab52a6b65b6edd6cf65caaeb6f65544cc74c2fb3431fa484fb69adbda08d2402da953f20425832b6a2d712d56a5cc34095f25fb9524a478a71d387b7dea45b4bd41e79c61dceca332898dfeecf83999ed4fad892e2ede714b93f3969ad140f38bfa95d321ae5ef089cf0ce435d59f8b6611c0fd014c67ed38646f0771f1a74c1f950ee0900d883aca3ec4efbb2f7737e717007ae757d874573d4d70c9d7e38f8ff30a29b983036e684c4eaf35a7c03ed32a8e3fc62f0863c56830127a5f3c0e905a93e7466a4f43f0793cb6752b9be8d03d7be26170f694ecbb200f611bbf1dac4b6ec085deb8c3d8ee188d8c9c8c17ca720c0f0dee4d00e5866b5443b6af6e69ca64b8eb5a8f5fa1e1d27bfacbf1b0ae11241215358f5045b0d1a73d1b15dbd904709340c1e2b42a4ef78f76b8f901d6337849cff1052f06a8919255b596fb36d2fdf789fdf611813d20729c26d517dde6f11a3f6045ec5158652e128cf7c483a0fb8ab772cb5cdb56e42e6bf8c863f173307c3e053168e54e9e65bcacbb144413ff76d08a94929e6cdde2c5944246a4b344f3ca0ada3b403429750bdce76f04668b05ed79e9119f00901e7f7b4f1eea8a1b5b0186e3ed41277040a257601b0f3917db595f3f1808d92071a4e9521a251e9c5a66f2c8a57511f61b9fd88df77330aeb4bc15c043814b33610d60f6d0a13fd7977efaa1843913f6d3a79bc88020406c9979163684efe7b7ade9613221d06b52cd96abd31b77a707748d52e6e16c8c90821f29359b35307c10dafce5f35c0ff9802c23aef19f0a95b49a317cd6207002a5a9b822b4c056c4cbf9b27045dda8325d93060f358bb837f00954a6e281d1bdd1817a7cce8ed4a801f9164d32c52739c1ac650109868664be1fabab47c675222dc9ff9d75f9fb49531c832264aa5b55998675975f59e34829ce90b00092bd77e46328a6459d5c967d905b8e976611b839925ad742500231fa86cb5f7e6f39cb1e2e36b81c55269ea0f5fdcba5c8c0e38a899540d52be49c83efae5243998b926f029dc2980d4fdb1c125db409d015e0b36bc02272da1c688ee1f61d23cbde585064ab1e2164d0ca529774ec7797407ba5d988c58853e74a124a64dc24d0289b6a599354faf64790177c3032f5d660d7b76dfbf1c03388a7c75b2309c509c6a92144e124c8bd188274bc844e8f0aa7b5a06e79ad5776b5a62003b89aef194dcc03cd3c1b1f3ea541805cfc4e18aa159f9b5395185b573538c9bab16876dff91f365d16dcc56b339b01b86882ef8e52c51edd9c5b2f8a35713ed6eb43036e09f64f6e59ab417958faff974b6705400b341439fef4cba371c601927da7e0a8f23e1c6d3e070a19c2216da85f159d60303ab1321e479f4c371372845cef03daa7d2776c18face6cfa2ff9eed26f9f0a353a0f1c9a99b2556dccc1212fcb5c2078a3b0e58a7f3f7b3f346d624435ef94c95d40dc726d2e7400ae405e89473a934e7646124e34473dfe17f7f9cf481aa059ef422508ffe67f9b9276084973db0683269a046c1a0aafa7ab075b28008cbfb862b7e30c8b2afa1c2923d914b3d2469266e8e0182274a3d8d89642723820e61aa2d97a9370789ec4e89ebee05b6c0bef10778caf2a34c2d7622dde5fa64b012bea6205127c3c845229ef553f013b73823dc6631078fc628532e3e518bdc790ab8460078dedf0c5cb00492136813e2b91679bba82f3cf95169751933bee4358f84154014dbcc1de1a30613218039ebb2444429380fd283d3b60bd5d5b470e861f6ecc751c22aa467168512a0ef45755e6b59a7be591bd3b08fde874b166ccfbbedba10a0956d2d18cbda515341c2112d6094a746e9f562db6543e5bde2c4d4f7c06b7550400d66f7242a14f34cd8a7374372f0eea49a49b72909fc11ff81ea54a1e2c07225cdee856383a657b0f13c14b00ae3b7b2a32a22beaab8cfd18641dbfa82619fdcdddd3339e9423e71c487305e8aa932b694e94c37c7e418e4014c8bb264f47e8283e216eeeabf0fbdd2f5eb8d0ea979738d4f18b7bf72d7711f5d22653f217c7305314ec2c47a0ecbf1dc8f9bc1379ae38e2a04e736a1171b947609bb66f8d352ce57230d709f196953471c5504c7f9f40ed2f64bf3bd04bd57521a364ea03b5f0603cceec7851738d97c3fd73c16547d4d143b009a79832a1ed244937dce09edf2d5e32ae52ab0331c449325dce9e5e8ed1563c967a5f92031f4275e3179274ef3e0752ac01caf8a20aabb23d584d4d6607833f95cfc92832d936c37bb8b37222aa842f48944d06b37434c8dce5f19b450a7d1bd568672ef2c8eaa2afb7cff404b33377a61061f56b01849feb918521a7d63cfbe12466aedc7159c577f213f2c157586b8719164cd7108edfa9211287b43aadbad997bc62f8169eec4a6e02aeb535f670878e6af538b5281da04470d318f893102613977390a434e0557302a68ce42e532d350446d4d813b84c07b42bf22fbe4889096ec6303574c95040d8dcfed1b9bd26782c5033d7d1a491fece156cbc19a705204ed38a547e00a09b73bc7a702ef9c2e659171d1daab63958268148aba59766bc7a4ffb68c1ae047d1f0c5fb45fbacd07079f72af301c6aa00eebc0662c6792fc707d388b339d4f45afbf576bacf8730ec3e0f1e9dc0f9a6d58fd146b2293aed8d110da24336f9a4c01ae12c03ce214c6502f5fbc5224dd8b8b2e4edf2af16b811e5c8595fa76cafe34ba66199caaed48b5dfd5ae74a3e6b6d51a09c70afc30ebc0f40d51a15f1a8c2c41ec482eddf14bed3fd11a9e2aa4446268af25b49e429e2528d5df57797f6f3cd431eb5ded8f830c85cecde8012c31500ce9363903739a6759704fa87bfef984ed0285c8c0a5bf2f0985b1b511eb4145e4b27e2df6aa7b5c7a913b76b1ca869151b75c0717389b3d186f4e4637a5ceba3cef64809c3a06551a6a46be31af61c0ef78afb057f6cc625647dc04dcd74eb97f7aee0f5640e24b7662c799013efb83c80ec2851acda7c6328de789ae99ce296494225bd169e49c9a12dc7e281778f7fe275e72571cd5a3608733998d2f6b96c1d26c25223153fc5afc2f6e3d72f57fbcb2d087d718d3b6703b286f1e340c23cd3bc715797edf3ce6d5169bcf783ac9686233cc0358725143008b25bfbd329e1c30654e4b4c9461239d41ae77f706e64e5e60ce6de83becfd056f2678f17474ab9f4976b2d7d5d014d78f716d7d4edbf6ce4ed44ed677274d6b9b6e4bf4946dfd1ed8b821c81957b4bf5cd534ed6ca84dadd9d6380513dc6406b32dcd5c1bfa468a79e88a56656e71aed0c6675540e1617a31e1c122295427590e83b63e8da58a6c5c21a15703994bdc2b90d399b62679a4269224257f3ead5a2dd0980e6f5a45c5a9392929cc4743e106c7335136c9f8a3a29190462eef908eab02cda97dbcb71dff26b0ef4dae51de293b4cff0ebf37fce1391247c5ccf77dfb64974c4a1e6beeaf82041bb0d653e2e9b612f3442bba8480b86fd7b35514fc056d7429d5fb36199d4a6f632ea615d9acc961082d9d91aca416b57582bcd2f182f5f5be02b3f597c680b2e6b37ee4d133e51d077491cb536d6261808c42684d0912fd7bcc97dacdf32394e7b","salt":"da23dc7dbf23136dabc337a0caa170c0db7e4efec5f5c8a648dff9b7cd7df49f","nonce":"fe0e4ec3d40fb7de21a354bf","version":"eip191-aes256-gcm-hkdf-sha256","preKey":"b43efae4c92a35d9c0b5f6178cb8b8a6642c77d0a9281f61beb9f6e8f7b006a5"}',
+ verificationProof: 'eip191v2:0x97ca70a87ec658e0e488e8b9f71644ee23840d809803fcf5bdcd174c9f39cdeb27f6e3a8885fec5bede5f264b3996bc3fa019b0d52745a5573a972b7e79e321c1c',
+ msgSent: 0,
maxMsgPersisted: 1000,
profile: {
- name: 'Bob The Builder',
+ name: null,
desc: null,
- picture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA40lEQVR4AcXBsU1DUQxA0RvrK3JJReE50jADEpTZwRUbsEIq75AS5sgcnsFKE1orxUMRSD5n9/n8cqMxV7qMojNXVjKKzlzpMopOGCYME4Zt3Mko/lNGsSIME4YJwzZ+Ya48wlzpMooVYZgwTBi2ccdcWckoVsyVzlzpMopOGCYME4Zt5spKRtGZKysZRWeudOZKJwwThgnDtoyiM1c6c+UR5spKRtEJw4RhwrDNXOkyiu5yPdK9fXyx8n16pzvsz3TmSicME4YJw3avT6cbzWF/pjNX/iKj6C7XI50wTBgmDPsBSK85Mi5fmXwAAAAASUVORK5CYII=',
- blockedUsersList: [ 'eip155:0x30d45C4aAfDB894Dc529aE15e7A55fCf49184eCf' ],
- verificationProof: 'pgpv2:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJk9vWtCZDxpr16PpcWmBYhBDqZlQ8vQkW6qMko3/GmvXo+\n' +
- 'lxaYAAADJggAoSO2WXXxPtkFBMcM2Bqc9pzBFkklicmWj3Fjl+6FB3sDXt3V\n' +
- 'YGNDqSruqpqoiCpMATy9QC48zO9Bj/gbIzuIbLRvNs9M3D5e0si4/OHKIbSX\n' +
- '3dBiaqaLdki7tUvtPioQ4Q1ZkdOATr3Wr/PyrHc0V00fE64qb0MlN4ouvYYf\n' +
- 'yG4WK/0x0iH/RPRyG60fkrsmZa/PPpRBzReZXwrsVbBoOCBSe6f9s3EYTfim\n' +
- '4ThX4zrbwKXx7Wgv1lXw386jvlaqUze9A14DAq6OjwqAZEVmLZaq6r/OHmqM\n' +
- 'Jy4fZI2auG9uYDorCxP7n6RjOSEOCLG8k+WRDFn6LSPJpdrYoYi6MA==\n' +
- '=d+/X\n' +
- '-----END PGP SIGNATURE-----\n'
+ picture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAqElEQVR4AcXBsQ3CUBBEwcfKCfIPnbgxF+ACKIYct+cGDpEdpCeCS0Damcu2PN40gqQaiE6QVAPREWbCTJgJM2EmzITZxJcg+acgqQaiEmbCTJhNQVINRCdIOgPRCZJKmAkzYTYNRLWfT6pjnalu54vOsc5U+/mkOtaZSpgJM2E2BUknSKr7eqWXdIKkEmbCTJhdtuXxphEkvxiIjjATZsJMmAkzYSbMPjaMJNvaf06gAAAAAElFTkSuQmCC',
+ profileVerificationProof: null
},
origin: null,
- name: 'Bob The Builder',
+ name: null,
about: null,
- profilePicture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA40lEQVR4AcXBsU1DUQxA0RvrK3JJReE50jADEpTZwRUbsEIq75AS5sgcnsFKE1orxUMRSD5n9/n8cqMxV7qMojNXVjKKzlzpMopOGCYME4Zt3Mko/lNGsSIME4YJwzZ+Ya48wlzpMooVYZgwTBi2ccdcWckoVsyVzlzpMopOGCYME4Zt5spKRtGZKysZRWeudOZKJwwThgnDtoyiM1c6c+UR5spKRtEJw4RhwrDNXOkyiu5yPdK9fXyx8n16pzvsz3TmSicME4YJw3avT6cbzWF/pjNX/iKj6C7XI50wTBgmDPsBSK85Mi5fmXwAAAAASUVORK5CYII=',
- numMsg: 1,
+ profilePicture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAqElEQVR4AcXBsQ3CUBBEwcfKCfIPnbgxF+ACKIYct+cGDpEdpCeCS0Damcu2PN40gqQaiE6QVAPREWbCTJgJM2EmzITZxJcg+acgqQaiEmbCTJhNQVINRCdIOgPRCZJKmAkzYTYNRLWfT6pjnalu54vOsc5U+/mkOtaZSpgJM2E2BUknSKr7eqWXdIKkEmbCTJhdtuXxphEkvxiIjjATZsJMmAkzYSbMPjaMJNvaf06gAAAAAElFTkSuQmCC',
+ numMsg: 0,
allowedNumMsg: 1000,
encryptionType: 'eip191-aes256-gcm-hkdf-sha256',
- signature: '0xe58171978843f55fda11f3989ef8a2310a3366585cf3ba6c71dc260e362bea1b2b2667e287959f6f79628a03073d5757011b7161a2782c32290f924486f87e0a1b',
+ signature: '0x97ca70a87ec658e0e488e8b9f71644ee23840d809803fcf5bdcd174c9f39cdeb27f6e3a8885fec5bede5f264b3996bc3fa019b0d52745a5573a972b7e79e321c1c',
sigType: 'eip191v2',
encryptedPassword: null,
nftOwner: null,
@@ -4822,1642 +5036,1798 @@ const AliceBlocksBob = await userAlice.chat.block([bobAddress]);
---
-### **Unblock Chat User**
+### **Stream Chat Events**
-```typescript
-// Unblock chat user
-const AliceUnblocksBob = await userAlice.chat.unblock([bobAddress]);
+```tsx
+ // recevive stream related to chat
+ userAlice.stream.on(STREAM.CHAT, (data: any) => {
+ console.log(data)
+ })
```
-| Param | Type | Default | Remarks |
-| ------- | ---------- | ------- | ---------------------- |
-| `users` | `string[]` | - | Users to be unblocked. |
+
+ Expected response (Chat Request Stream)
+
+ ```tsx
+ {
+ "event": "chat.request",
+ "origin": "other",
+ "timestamp": "1696576961629",
+ "chatId": "b6f53ac38d0698ea64e6c4b0f024437ac2271ca869413d5f779d7cda75de1aaa",
+ "from": "eip155:0x0aF73cF3b072E39A46D78E6c4fbaA058A138Bc05",
+ "to": [
+ "eip155:0x52C6050536a77A405F03b6Da3F98Db9Ca69ad899"
+ ],
+ "message": {
+ "type": "Text",
+ "content": "Hey There!!!"
+ },
+ "meta": {
+ "group": false
+ },
+ "reference": "bafyreid7b7m5ub3ouybgp2nzu733vle73bem5jcz5lg5u2epknncfhfeuy",
+ "raw": {
+ "fromCAIP10": "eip155:0x0aF73cF3b072E39A46D78E6c4fbaA058A138Bc05",
+ "toCAIP10": "eip155:0x52C6050536a77A405F03b6Da3F98Db9Ca69ad899",
+ "fromDID": "eip155:0x0aF73cF3b072E39A46D78E6c4fbaA058A138Bc05",
+ "toDID": "eip155:0x52C6050536a77A405F03b6Da3F98Db9Ca69ad899",
+ "encType": "pgp",
+ "encryptedSecret": "-----BEGIN PGP MESSAGE-----\n\nwcBMAyaG8qwtJd4vAQf+JbzXYRQZ4Tm+8P+igfgH5kHFxMdd6XD11+UgyX3o\nhvxIaH43AjtpAuhNCvVVnmmIjWHAnCye7IDrT5BFEYVI03FaxxMyAwxvROTe\nb1xn4R5TmXPzuZ2N0AGbD1iTAqvPjLj3UvHJJihilOOAs5rqUNmWns4+xWr6\n8Znl5J2RyyqxJ3+LnHn4N6Spwm1gFzJ0alS2gwp+Tdi7OEPRiiWTkIcrdRcw\nKUv1i3aJw4Jyd9wDz6jldNBsa3L8RHUf47Oo4b/17dEqeFkioKCuWyH/DlKO\nkxZRsZEGUDR8ILKCRxbQw7RwWjxQnUeP+4oRuGC6P34zxZEJofHFz/8VWjlG\necHATAOhR72eaWLr8wEIAJEP2F/ocesJWKafpUzIN33fTTIFBjIvVB5GXb/V\nRvtwgRqsrKoudQLUf3ybsH2jw5JOmA8nV4Kc/aB/DVtvSyfObLxxngXe4HnD\n4OlUBGH80Z/RC2p6egrxIQUu1AMhTpu9SJ3HApTHHkDtGetp9Lnax5AxEV2t\ntFQWgkfwYy0xz2UuU+f85skTDgHBn7cW4Hb8WAaXWptpoGIlxMaVQYcHzA8A\ny7opcoPJPlE7AtRVQDmrQDLMZTRjxPwu9+vOYSh9bC3QFXE8PQeaseK379BG\no8wL6lnfX9mOdX3xaXRBuccm5akT61UGHnFH1zZv+rhyM67/bVCsIHEsG2Mt\nSHrSQAG/I7P/KleW2A4iEKPW8LAV1hGFkZZj1YumMGqHocTLncC8QwKzzHzi\nKyO4PxEL0qhgP16ya+vzT0PazgQnYtA=\n=AmIG\n-----END PGP MESSAGE-----\n",
+ "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7XBCRCfItQMnVG/eBYhBKTq6JYHJG7fZv5Yop8i1Ayd\nUb94AACmjgf/XGx0k/OMCg7XNIb5DjPMtiDuSU9Gm5KSUGhoBDIatNhrgZsj\nhULiKdk0DG1tk6G6a1/IpxM17obw4q3OI6QrT5TdgNS5c4kNRJ65xN0smxLl\nZC9fM5GEoTNI9CMIghH+zTesmVxkq6cS5iwzFJNgV05MoCa+HBCSHR3oLKFU\nH2muI7veUj1/yF93OEqtsqUjsgVr+bsqSVhwD8hcjS4AlRmHgBCLdwMWSOnK\nqFFV/0X/SZXnq0Jy2NULGFGTuQSV6NhB448HMEToxGrVbkYhPxRazBbEaSxD\nDrYQ+8b6EQBSJlPCKO3MAV8CNMNbfwwGo1RtXm6+xZj3DCHEdiU96w==\n=BRdW\n-----END PGP SIGNATURE-----\n",
+ "sigType": "pgpv2",
+ "verificationProof": "pgpv2:-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7XBCRCfItQMnVG/eBYhBKTq6JYHJG7fZv5Yop8i1Ayd\nUb94AAClEggAxIFP9BJNwHzqUlEB8UD7gK+wNJxx5Nc7b31y0edUiSL6MWGL\n/b82efqACFNi2yc8/3xreJZr5ZuyHHSuCAb6zRamBS4QYTD+cMhNwpUTPiQE\ngyGZejVP8o+ko4N//itioi43BC619iSs7OTCvXkWS+gLFvOeRrBBPfp/15NG\nbeTavruBfiIUBR3YGtlcY296LLmo2YCEz49B1q/nQ+Ant1UNdhmuVhqU6W5l\nBzV3mLkxnlxpey9JNnNjC6tiKDB34OI06aYc863mLphk0R3obzGyt3XQqgL2\noteUPdkfPsJb3DCdq9F/XRNNJtypnAWeuMk8T5OK44FfLnjo26lwHQ==\n=QPQd\n-----END PGP SIGNATURE-----\n",
+ "previousReference": null
+ }
+}
+```
+
+
+
+
+---
+ Expected response (Chat Request Stream)
- Expected response
+ ```tsx
-```typescript
{
- did: 'eip155:0xd1790E37fe3459e3F48eEEe41a7708a3eC2148f7',
- wallets: 'eip155:0xd1790E37fe3459e3F48eEEe41a7708a3eC2148f7',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGT291gBCADFq+sw1v0dNAqkG7bMUZy0tzo3E6iPZQ5UwlOvtzaen2md\n' +
- 'OHOTnvaCFRjRQZjrvlmbWwBELOTsHbmluA41MeayoJ7aA+o6+aflaa6PCUG5\n' +
- 'ugAfXjuQxPn+gK0hFdn6IYxvBQHdh+Hu0Obi4peol1GobzraVZt/fRrXdttA\n' +
- 'tLM7EmvX/l5440xO8+kZ9/uhMx5MR6fdD32AWPpGDy6tJin4awSdTN4eIwI4\n' +
- 'ueKUZ0+B4wWAiEkRwIRWY4vbCCfMeF+qNMGBaz69I+YS/2FvyqAXTkyKytt4\n' +
- 'U9efp+ObJsNGk8OA2JWZE+X/16eO8xvQSHhcoH5L2ahGTmG8+xr8bFoRABEB\n' +
- 'AAHNAMLAiQQQAQgAPgWCZPb3WAQLCQcICZDzsIc63rzcLQMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBLvWJU1IWhvs+frC7POwhzrevNwtAAD9Awf2KFgMZaNyYeMO\n' +
- 'DNojkd6YpwtXGp4zxxL4JrZwDBginbcba4oUyTAqIcJWe3BAGPXX4hi3AYjE\n' +
- 'BIERstIeb/YkcTyRgyZKDj7tDNPF0itxfiUXAETN7Z+ySkLWx+5rQ8B9VQv5\n' +
- '0PLDDwBfwju2pp1/j8XTx/81PSjVKpFQoEsEPOj+WloOdonzx+SGcr5mjjYj\n' +
- 'rR9NpHVUxi3Xx40zJVVqWFbTdnqd1Wm5SGkrRWLJAe1hzHhYxtpEDGqPfxYo\n' +
- 'bBMe7bphBkh4DYWuemj/2PiZaS8NC1ed32YOwOSWJV+9wmUvIvq3Q08AE2yF\n' +
- 'tfeNnX6Gb6fDgvPa3Y1Qg/0S3wYvzsBNBGT291gBCACqFMmyuJkBkNwwpNE1\n' +
- 'L1bJLulRqEm/tCZ2HY58G9NGYgo6u9Ii8H+ia42bf9Ezq4fLBDzYH0T6Pe9Z\n' +
- 'zAQHudpId8SNfT15QdqYvHjovxk7jqucF/+W7+DilPXZn6eomrOKePCNP8Cg\n' +
- 'JXSoShkVaWkbkr2UkHGpcU7YIvooAtsxXMWWr1Z3hbk7tCf1uwXV4NlAGIXx\n' +
- '7FSvWuQ5ow21GqM/6HyeOzbJRis0DNV5NHY6uUoFNUNzPPBBYx8DRDzjmmde\n' +
- 'KpjialSW5QK7g8KlWaSGnHFCd6eS7pHZURl1l299ONNJ5m/B9yibBKwHCQ3r\n' +
- 'V/8ByDlxzjU3wbgdZ7+LfjitABEBAAHCwHYEGAEIACoFgmT291gJkPOwhzre\n' +
- 'vNwtApsMFiEEu9YlTUhaG+z5+sLs87CHOt683C0AAGnNCACtFS+hJSnqZDmf\n' +
- 'XGSIw3FLkD7OsaOd/75BZ+cqXnfE4is4JlN7IceOHb/9+UlghAOfpjJYfn3Z\n' +
- 'HobaRnUZTm8unx0uVQZ4PEZgPGuIKjnwmU75xZVpYegXTE55faiDoQZp0Kir\n' +
- 'zyScqaIuxHGkuW5Ii4hcLXKBK5qKv8cydeOgZU4NJ7jb8DMQhWulx4PHOaMk\n' +
- 'JR/sRVuzkxfZQ6LPtnWoTmJLr4wJ4WD/nM77W7XmO8ZGoe2hE5V/OZJC+0uQ\n' +
- 'OPK4S3YmXcBZoz8L6/gdUQz6kaLtRzsP7vZfyn4jWhlbfad1R7KM1srRT+OT\n' +
- 'HDPpdh1b+4npYo8iTcJTnANQ5oAm\n' +
- '=rs9R\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- encryptedPrivateKey: '{"ciphertext":"4bb789bbdaa33f355800c4b8d14e75f310050a0269961b1f4b64c820756ce3595ac737fba749f0b268c418b19cb32f5ccd476bddec8d252ea4cd8e7cf15423a03cc00e9a2064e4134aba89524fe2018fb5ef6b27024a4dbe519883e6f41b462608c33914e129fd651e88d0f14973b3305f8e9d1e3d95670263b1b36921a1b5052f43282768a7210c7b66d5f5886359526cb56f48c61fd3cb165ba15b36f47611d1af8c2aa6d34eec0966d1aaa5522bc2291a5a962585218b4cca7a8d4081aed274ca8ceef95596583683b212549f0568a78b9116a4847d94d32488a0c4ecb9a9b5045afcebc9bcf9d3406fbb4d7eba89f21efce27e3ac174941768008f9d67842efb65e1f3f658a9b366c5c164b5cde2c2db442421c39d46e6017be35bb5b73b06a1569b35e8c4814e0edc1f1be46a964b5a4d9a8245694e530c43e9dbfb9176c41731b315f53b46138c270b6faaec8562abfdf7b595284de89d75bfb87e977330e943788ff914636a2cb81da54dcbaaaa39bd06929020dddcd3b628c44a91a3985f527a9b4592bda19aee4da3e3ee6bc73f98d6de843315476b1f67f8b8174db7b985b94c88c0686b4fd42b45ba398a46638b8d0cde5caa22f45fa51c749377baf35358ee2c1c057dd85b550194f4436af0a43c7c5f36bd7620f28a5ccfa28f16732a4992ff9345a863f1a8f48e5312ef5927b2af2890fee50ad219b43a88781e4b007572e4b7abf5fc5b41e3b944bb164f6c9a397495c46da239b0d40aad8d5bd17a5d02a032212f6495c2f4b8287a0e2d4b7a7d4a56114becb7a26e87233ec3201c558e6f42bc74414b34ec39ada6ab64f7ba9c47e0ddbbe5a622045b236b4a137adbeeeea3559b7b8873d727f7707f75a60a3310a54080eb00e59d6fce88ffd079ac9bf3c85f4fcdb56355bdb8b0b844f42526f4b624591a1729d5b7bed31c1affb0a95266e1092afd45f5c2466a2a7234f8481b8526180ae854e6b9b5e2a2835aef5dfba36ede0c01a56eda4aea27dc415f3ef1440ed0b8f8ae805544d3f4e24d0c9ee8b4ed6def38c7a545cfdc32b3efcf3ad321fab80a15b19c5710198f97826321b69c7677bcf5cae6218279f4bf9192b4ea77e510b7409b31e7b50c4b2dee85857ecf42f3b12365ac73c41d7bbe0564c8d741128c0723619a48ac29760c1a9eff36c179b50e6be26b4e10432cf6b8f987838450189a9474e20bc10adfcaacd1199c026cecb9d8b905bf9a2216345ef532e7cf3b94bc6962b4ac1cf52ed86547aaac352d2ce3a294ccd7299221722cd2852b7c5120dad85e041b09709b49e29e2fa17e6e94c0a77c0508ae805f4ecd0fc70b3ff78cd38ada6d8ddb9b150677589ab5b77968bafdf9f8cbfb0c7ec85d35c004b7d74dab2b3c235069276422878d6c0967ed051b03f05ae70ee8f054eb25054ece32f548c48671aa2b0206f61261f3ce8f44e2754f505ea29d879a1842531e7f2c37333be6c34178c4ccde01fa79f344809e0bddf8aa07e4614e4ed31b4d2fb4dff0b97cb33305afaff864ded85b13a69de4b421f331471595df86e6a8a6bf0c64bd00a7b8521614d00e0120895ce81355285fbbdfde434df2846fb062d5e309fe58df0ebc568378ccee69d6f86aeaed2a65e3ff477812692316535f52b927da1ae3a3cd49ed49fc19988e2759f7252510af3d6f3b4b444d838c24df9627b3cbaef01707de84182c1440c736d5432da40a9ba9d493917c82f3b6475a2d2b82e77dc72111ed454b7cd6fe0d0b0f68512fe9538898060043dc9ed2995a1f8df00ac7b58fd8f9d169225c66b527b5447cf597a2c785b8777aeb2054e2c95106f701d1645bdbee9a1c48649e51dd7ceeb611a99cbd85f8e9f8fae2bdce1a46023eff7bf6748434117624a9002eaf2d1feee0b5d4519706a7fd04b7fa497a0f5e152d5387b010fce47b7df330c12b9091848976cc1aef5b50f93bc2332e320bc46d01c891fedce914141805e74c3f912dbf2991aa927eddec4ec2a80cd3acdb5946764ae5da7759f142420567cf51172b37a50d827e4f463c51a9fd6dd47139c8acba1dbd6036dd4ce6af0e5e37ddc6b2c37dfe3d1482d0f695268e842e980cdb2d6d3541856f7780b216012ac67363cdf9907626ac81fd498cd133150c95aa5832ad4119fbdab0bc8ac0012c7217558e52de5e9a0dc779cb7c013cb7a277849cb9e040d5b32d9c454317b59c8962a645540fa0d7ee59ce4468b697ffdd29c93d4db10bde567c9d2105553116860829e728e9510a4cf986a9857de09846fe78095a48787985ba2b95d2094798d9fa209b893e1874615b313b099550ad17f7050112ca81a8a3ef6c83f4c44a90b2ebe44c60d658f15ef773304ac2d715e7c061675c3abe58386a7a2803856009e5e8c495c7d3c97091ba82893899fd12fb127db0deb06aa5717c63a1f949b35be830c2a3f7731d3f41423aca7a3951c4b4ebc5e3d874c36b518276cb0c07c27952571691d4fc16655be7450b55b3587f0ce79695661d325bb6f736e20338556efc1191eab56f5a2479be34a4c7c8d58b1028def385eb0e60aed6b7e9dac35863aba918641eecb7d12cc55b858bfcaed15e330d6fc47c42e76a13e6671758d8f665aaea876191f51f335b48d1fca47dc3dbaf7a357eb3f1946d8b3073b925ba58b7886a68118d3fc5eea83c1650cb5842668f82eb3350efa6ae6f5002bef3c11c3e7f368489c5a93dec16b93817778941626f6ae7a14c6ce4e5512664b23845e0df4bb76aceb20931765106fdaefb0f749a5fee20cfe467b87dccc73dc66b652cf63ce97e8470b195ed7aec14a7c154f2a3563b8f5b3db7992499dc9795217be05148a21468b204cd025ead1cc1e4144728c9e910140d1d04225df4632fa71604bec728117791d4742c1e1006a0604601942f5852de872fef382378676f59fe6d704d1bd07b7ad0c797b6da17bd39d8b66f90d95d913d46686c3ce881c9136efe0445b1e87c2eb8cb2283532e617cf6a0c5f40fdff1fc25b8372c9d46295934a48ecb5d8a6bd5388b76a984d20a1934823501cc85b0b453bc8aa5a6f19502ca788f4ae5219e6470fd9cfc75a244cf2923cd05e1d9da40f21bdf3bbdeb4647cc82f5988d365dc2b4ae331db8e504cca746092c63f1e305b027e707c38e13c66f5d90553717f9f41cc2624d0c2cfbf814a2355d1e9dfeb06cee67b132425b4d0ec68bdc0fb058ce6c444fdd284995349379a2a17739f0859b7ce24e9b681aac2a78b5b65790aa0dc83aacc6607b15acbafcf7bf943cd3826ea64c765c6943fdbb11853abad1aa92aca6f34c0dd2002fac9f4293dc9cd776d882ccb6e1bc02eb1294e99a0cfadf3923fd9798927aa9754e0cc573ee57a20df72b08fd571ee093fac1cb074b9cc90d10ee909031fe0f3c0cd85f31871b7527d653f143cd71c2084c8a9d8354d98ca9e138eb9e813bb90bd71e58880f5b03da49218e77afc3a8802ae80770490233478c9ff149d1eda00df6af91a57f022e158d23f29c058c9183ee39c6dd86fdbdccc81851ad136fc2813c639e8b367dee11d7eb3efe8f57852f2629cdaa1586fd47150c8ecca8d1ac9cfbef23d2489a0cc515154a09b35717d029a5e7ff14d3969692281c71ebc1f8e21b6f77d724bfa60d75d3a77a54ff3043edf1339bc53fa4c2279c3068a47f8d57dea5481c6c1a3aea9938972dc00bf8b637dab25e7b01cffccce70ff15896e38bb160266370e58c61518b4de88ffa121d6f0c0c757c2585f89f456756176fcd2c18852b43231f9f3c439a338ba8052d1a498d92b9f329610f4a636abc3bec7e895b6244c2c013a1cb9c2661ea1679f2fcb931ab9ffc7d04674144a2012ecda09272d6bb83fe039cd472cd059d734137cc2cf017b1177a63b1c2db74c4b5a6ae9f65524b090c6857bfa9f05960b8dcbc6d4d340064ea6079cba74961dcb6a0f00b0de01863574158bc424cd3dcf14f43b067b3584aef99d5c4cd7831ed3e8608f3f31045c4c37d6b408f32d4590fef6435036164632698c880d22577bb1c521e01e96a57c5780665d97eb8c1b472f3a00c04362ce6f72bd9250958ed6970d411c38d616d90cdda53ab2a5621ad318cb5e23f923426c15c8dcf55d7f54a516fb0bf61fbca1e73ceb9d13742a200fa92bc06fdf8027f7fda8549cbc3f837cbf53f249225e2b7d11bb45f79ac946f9e236da16e080338bc0ec5cee88691dd9e5ea54c6079c325801e0ccc980443b652d8971bca1fd253f078da4390eef90d975460a1300a92936a2097b3529e3316efcc11b398ca5ca7128431f438b4756ca3f690844a4ebbc133f8ebcf030ad7839daebd8e9a10724754fb5d4ae289a9637932ae3dafc5b8d6017648305b1eb4d43b16e58eae02fb9501a56ba23f0c27bc9a800120b018cc69f1a070da2936a5af9cd25ba1aa64eae66b218c8964f2b38c371c8a25c04a353d228fc59f08602fbf74a98e61ba3d2a34a844bc829d5f1ee1eaf1bb1cacca386496e22eaf171f1145695f759062f9fa254c5d8c103ff26f1cd73b1c7fd0ced091c917cb63d2fc98ff2e1437b802fd60d6d72b146b695dc93d646913bb9ffc763d604ec61fa733aefd5f14c465cb1ac85a6a1bbc34fc2204876b76c631725690155eaa5d8f07648f22fe954b3b121c56046c24e99e3ab5b2bf10dbd85505d8f55a1cf985ecdf4a42b6d031ea322ac969f86acc6d3a8ba3f5361b6e05b86374bd43d707293c27993a5ac7595a0d5348332dc13c6b651b4a859702844cbded3c6bd35aa67c8fdfc4e913a8b8615ce28129aecf3217ecc4c2bfc48607b650c47bec3365e1af941b9046958b7c8b64bf45028760984336b6c27bc044a7ea69385805d089434190f0044d856ad2fbad4965846f59491e37f0256548d82145f571e18090b0fa91","salt":"d2deba0a43769862a0fbd80dd6fc867599706ca644920fe1bc05585f922b518e","nonce":"74e9fa0359646cdfbe86a7ad","version":"eip191-aes256-gcm-hkdf-sha256","preKey":"358718727d4b43422a7719176c09b66f633e52a47ee3879d1e19b85cc362938d"}',
- verificationProof: 'eip191v2:0xd7f0bc7c3960f84280c1433e27c0110dea4b4af1a8c10f7531b8194625cada9456cb67117154f20e97a3d8764b8e3e276d0e6da44f36c4a89a06da9a76d3821a1c',
- msgSent: 1,
- maxMsgPersisted: 1000,
- profile: {
- name: 'Bob The Builder',
- desc: null,
- picture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAnUlEQVR4AcXBQQ0CMBBE0c+kSXVUBWdMoGRl1AsSkLIWuO4Jrj2VNCTMe5fr9fFmI7L4xRydHWEmzIRZ49AcnZ3I4oQwE2bCrEUWJyKLE5HFjjATZsKszdFZRRarOTq/iCxWc3RWwkyYCbPGF5HFao7OTmRxQpgJM2HWIot/iixWwkyYCbM2R+fE/fVkZ44bJ4SZMBNmwkyYCTNh9gEzZiOL39d+3QAAAABJRU5ErkJggg==',
- blockedUsersList: [],
- verificationProof: 'pgpv2:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJk9vdaCZDzsIc63rzcLRYhBLvWJU1IWhvs+frC7POwhzre\n' +
- 'vNwtAAB5dAf/cDGsyD3YabE6iTIhNPDn+hvbHuZUjpNPnnSb+mjrvD/XBNYV\n' +
- 'ITTHhp3Xy4Kuk19BkgmPO3O5TZHVUXK7IwYJd7uutNJJyLEWZYI9ttfeJ9cY\n' +
- 'HQM3GjApAHycDkBAn5ZRDtmruyWipeE1II3omDUgChQOnQFoK/jWohoIOUvO\n' +
- 'zi+0V02z7uIGwgTjBLgOYehD8NloGxTjwaZHMqEN7xbr1mZqy82Aew1Bw+EY\n' +
- '+JPMyiKTF6HXHYrJZL1yaNw/T7ukCI8ecGoql04xlOHU+SKUTz+8Kcg4tZQR\n' +
- '0pp6Fz9Fy9ROUI8ieu5LytJwQq4c9VkH/SPUvkoODloXc0MbrY59tA==\n' +
- '=A3pG\n' +
- '-----END PGP SIGNATURE-----\n'
- },
- origin: null,
- name: 'Bob The Builder',
- about: null,
- profilePicture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAnUlEQVR4AcXBQQ0CMBBE0c+kSXVUBWdMoGRl1AsSkLIWuO4Jrj2VNCTMe5fr9fFmI7L4xRydHWEmzIRZ49AcnZ3I4oQwE2bCrEUWJyKLE5HFjjATZsKszdFZRRarOTq/iCxWc3RWwkyYCbPGF5HFao7OTmRxQpgJM2HWIot/iixWwkyYCbM2R+fE/fVkZ44bJ4SZMBNmwkyYCTNh9gEzZiOL39d+3QAAAABJRU5ErkJggg==',
- numMsg: 1,
- allowedNumMsg: 1000,
- encryptionType: 'eip191-aes256-gcm-hkdf-sha256',
- signature: '0xd7f0bc7c3960f84280c1433e27c0110dea4b4af1a8c10f7531b8194625cada9456cb67117154f20e97a3d8764b8e3e276d0e6da44f36c4a89a06da9a76d3821a1c',
- sigType: 'eip191v2',
- encryptedPassword: null,
- nftOwner: null,
- linkedListHash: null,
- nfts: null
+ "event": "chat.accept",
+ "origin": "self",
+ "timestamp": "1696576962016",
+ "chatId": "b6f53ac38d0698ea64e6c4b0f024437ac2271ca869413d5f779d7cda75de1aaa",
+ "from": "eip155:0x52C6050536a77A405F03b6Da3F98Db9Ca69ad899",
+ "to": [
+ "eip155:0x0aF73cF3b072E39A46D78E6c4fbaA058A138Bc05"
+ ],
+ "message": {
+ "type": null,
+ "content": null
+ },
+ "meta": {
+ "group": false
+ },
+ "reference": null,
+ "raw": {
+ "fromCAIP10": "eip155:0x52C6050536a77A405F03b6Da3F98Db9Ca69ad899",
+ "toCAIP10": "eip155:0x0aF73cF3b072E39A46D78E6c4fbaA058A138Bc05",
+ "fromDID": "eip155:0x52C6050536a77A405F03b6Da3F98Db9Ca69ad899",
+ "toDID": "eip155:0x0aF73cF3b072E39A46D78E6c4fbaA058A138Bc05",
+ "encType": "",
+ "encryptedSecret": null,
+ "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7XBCRAMkuwWk00HQxYhBKHMQtCl0iVWLJla7QyS7BaT\nTQdDAAAE+Af/U8h9c2tBPq6PjvDvjjs+yL/qTadagegzLZN0Gd9pT1kAmZ50\n+J1+f05oLCFdFcVTFz8dFZpueh+0s/8daXJ1uKVTBPPpfvWRInkD2KxlRrMu\n6gry3Tr2Fb1k8nIulIB/GSs7A85jJZQaG5WShZmfvg03bMadNIYmgl3ACmEe\nX3VovLFM5VLzuzKJGTn+7OM1VrZlZdsMRa7nfIdMKafMEEJcr41bmXCeYfzN\nw24kEO9/tAGaHzSRLsoNYxYDjby45OU1AJUHaLwjInk0klugcw7GWfMM3r2u\nE8qDuDZ0eveI6yArosK9amBlGF26l4UhEVPbCpumMrBBoItU03MPRw==\n=InOB\n-----END PGP SIGNATURE-----\n",
+ "sigType": "pgp",
+ "verificationProof": "pgp-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7XBCRAMkuwWk00HQxYhBKHMQtCl0iVWLJla7QyS7BaT\nTQdDAAAE+Af/U8h9c2tBPq6PjvDvjjs+yL/qTadagegzLZN0Gd9pT1kAmZ50\n+J1+f05oLCFdFcVTFz8dFZpueh+0s/8daXJ1uKVTBPPpfvWRInkD2KxlRrMu\n6gry3Tr2Fb1k8nIulIB/GSs7A85jJZQaG5WShZmfvg03bMadNIYmgl3ACmEe\nX3VovLFM5VLzuzKJGTn+7OM1VrZlZdsMRa7nfIdMKafMEEJcr41bmXCeYfzN\nw24kEO9/tAGaHzSRLsoNYxYDjby45OU1AJUHaLwjInk0klugcw7GWfMM3r2u\nE8qDuDZ0eveI6yArosK9amBlGF26l4UhEVPbCpumMrBBoItU03MPRw==\n=InOB\n-----END PGP SIGNATURE-----\n",
+ "previousReference": null
+ }
+}
+ ```
+
+
+---
+
+ Expected response (Chat Message Stream)
+
+```tsx
+{
+ "event": "chat.message",
+ "origin": "other",
+ "timestamp": "1696576962232",
+ "chatId": "b6f53ac38d0698ea64e6c4b0f024437ac2271ca869413d5f779d7cda75de1aaa",
+ "from": "eip155:0x0aF73cF3b072E39A46D78E6c4fbaA058A138Bc05",
+ "to": [
+ "eip155:0x52C6050536a77A405F03b6Da3F98Db9Ca69ad899"
+ ],
+ "message": {
+ "type": "Text",
+ "content": "Hey There!!!"
+ },
+ "meta": {
+ "group": false
+ },
+ "reference": "bafyreich6wtnzojmgqft6eudx43y4xir2emfnhxqlvyy7rq6a73w7szywe",
+ "raw": {
+ "fromCAIP10": "eip155:0x0aF73cF3b072E39A46D78E6c4fbaA058A138Bc05",
+ "toCAIP10": "eip155:0x52C6050536a77A405F03b6Da3F98Db9Ca69ad899",
+ "fromDID": "eip155:0x0aF73cF3b072E39A46D78E6c4fbaA058A138Bc05",
+ "toDID": "eip155:0x52C6050536a77A405F03b6Da3F98Db9Ca69ad899",
+ "encType": "pgp",
+ "encryptedSecret": "-----BEGIN PGP MESSAGE-----\n\nwcBMAyaG8qwtJd4vAQf9Fg4udBKFN/Pqd9+bi5dqGnLr/PJbRHaIljRlzt5R\nm+6sPUeGyVkXcFdGbSnUKG0M7rtwKVOg0LiCX/oFx//k6ULJWJNVpuZsy4QT\nGYZevcU6dEPMMw4KSG/KJb+sdTAqlRPegibfrfg7YK/Mr9xd0DbN8K9CFsqC\nW/CYz0AkgZS/wN2099cy9WEgesv9yHMd1tU+59A/gAjmI5qk1ge3PvReKGP/\ncSWCX4wz0lioviib7g9zdw79ecpJThmWXKWaW/dPikcNYUTCbK31gY9TuRsy\nS+z+7AdddGj0hqgQvZIfj4XHgHbpQrRisddbgc1AE1xV7eiiT2jtNPswtsat\n48HATAOhR72eaWLr8wEIAJ06+SdpAuQT6mdlIAo/Kttiyd71UkxgMlappQKQ\nM5e2aei/H/C93EFYIitVHobeH/Q8Y89k4E+Plopo23OS6TGGbWIUl0PSJkyg\nxAIyC8J4RfqylCp+k/d9ZxZP/l0WrrXo9SqGOfXnAVm/IITLl8hlG7dvSztI\ng8ndUrk8Af3Jwq4vbrbUOMr2ophzV027HVWQl53Dez/e+DfpuyvT2uDAevTw\nf82H0+2DIz3jzj3rNfkvyA6C3InhW37K4JNh+T3XlL7qWV77XTWFN0yLzZwP\nrW0hLWV5YGAj0kqpup5oY4H1ANPknRiNxP6hUrQH5ZkHPahEUo78gpP70qgc\nZafSQAHfRbVWZC7J+0OF15W+dR3iM8Ngrz/PjYEchVo73a8uBtNk4mSai8o7\nv1A2hx74RVX6yN05D8Bxpf6u7wQMXB8=\n=T81R\n-----END PGP MESSAGE-----\n",
+ "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7XCCRCfItQMnVG/eBYhBKTq6JYHJG7fZv5Yop8i1Ayd\nUb94AAB/NQf/bwUkzVHV6/ODTtnjeA0y0kqEv3OAzbYoG60QdgNf3zAEmFbk\nf4ULNghzvl3Nt3S7TYsF06xu4gzzsjaOt8glPxJCiZUa3lXdJH53X5+VCbZV\nSWJuip9tdljAv4zg27+ZAGrwyC4NrTHE8t1b8mDHLTgJeqae6dJHjScmCXKZ\ngBZb2mNeVYWklg1mpCuXxB8YJpeFKDgSYeZ3C+YNSGAmoCyICRpYvxYo038P\nDehkFMS3HHvSGjFslcDN0D9l8gWY/4H520Rfer4GHJoFMSZeKlyWkQRCNPNz\nFY3fjmPLuimbEnnzd9Nxw1kbx4P9SBEEa4xhEjJnxx/sAnQxJX72RQ==\n=1zuZ\n-----END PGP SIGNATURE-----\n",
+ "sigType": "pgpv2",
+ "verificationProof": "pgpv2:-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7XCCRCfItQMnVG/eBYhBKTq6JYHJG7fZv5Yop8i1Ayd\nUb94AACE2wf9GQq+/lkGQ7HVVmLF3SnSRI0IM9s4OvLckwjyd1i3D1lLnwu5\nVaPj+VxKZSBe+GHHukd/gQ+qYr9fhfHNMQ019AfHfz81kCCai6KhExH3YVbE\nsrL+j2bwttfcRjRWy/MoHo1T6M9F8PR4jm4aaktTSliApRE0k92Igm8Gw5it\nUaP1/qDIOQRjlofa7wAyDz7Kf83/WkbS78+MJZP0JWL9znhdFH5em8RvVYpS\nMa7/Skl8BnCr46BIfcd4Urd9q/RECKA4WJaxpOosH42MJQ4DLJ2iRnzZKkyr\nyZBfXXyiMA5goy+uzJzVhA5tlsHZp3jUFEZSvofaMX6a5UopweHMGw==\n=Wp+E\n-----END PGP SIGNATURE-----\n",
+ "previousReference": "bafyreid7b7m5ub3ouybgp2nzu733vle73bem5jcz5lg5u2epknncfhfeuy"
+ }
+}
+```
+
+
+---
+
+
+ Expected response (Chat Rejection Stream)
+ ```tsx
+ {
+ "event": "chat.reject",
+ "origin": "self",
+ "timestamp": "1696577053528",
+ "chatId": "e819ff24ee06d44927bdc0c0967bd55b6410d389c29c72c329dcce4dca9f413d",
+ "from": "eip155:0xd49F5038C4baA79DF1f1191d6B18FF55D06a4648",
+ "to": [
+ "eip155:0x1fd48A2697Bdfd5A63436cEf5548e095649B65a7"
+ ],
+ "message": {
+ "type": null,
+ "content": null
+ },
+ "meta": {
+ "group": false
+ },
+ "reference": null,
+ "raw": {
+ "fromCAIP10": "eip155:0xd49F5038C4baA79DF1f1191d6B18FF55D06a4648",
+ "toCAIP10": "eip155:0x1fd48A2697Bdfd5A63436cEf5548e095649B65a7",
+ "fromDID": "eip155:0xd49F5038C4baA79DF1f1191d6B18FF55D06a4648",
+ "toDID": "eip155:0x1fd48A2697Bdfd5A63436cEf5548e095649B65a7",
+ "encType": "",
+ "encryptedSecret": null,
+ "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7YdCRCAVGEKwfvuDBYhBDuMv0sczhcV+XqGZYBUYQrB\n++4MAACNGQf/UM17dLBNzMLEmhfThqnxdXo1w1n4U/1DCSmzavvJ2CmCXvTU\nfekuTaxEEGQ83yKeI85KEkHdKgYpNmNa7O5OfOekjum4kRLi8qo4yVH6uard\nEiV+r4i52gWAqdrZOuFqWOLpbtWzMXF3gl6f+Sq5VT/SIi2/g5lO/bYd4QFX\n7cm/J+M5MzDJvxDht29bwDMylJVJXYr93xsEsLUAG0xo71mzsnEc7aSCxY71\nGw+4/KstoSDT40pvoZLw7qRidmHOt5QLHI6wpcztdo8ALDByYpIifV/J7lao\ns4bDS0TOXCb8/F6MQt2SXRKD8pIvzQ3CZBBZSKg+29Muq7Gw8hDq/A==\n=lcfd\n-----END PGP SIGNATURE-----\n",
+ "sigType": "pgp",
+ "verificationProof": "pgp-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7YdCRCAVGEKwfvuDBYhBDuMv0sczhcV+XqGZYBUYQrB\n++4MAACNGQf/UM17dLBNzMLEmhfThqnxdXo1w1n4U/1DCSmzavvJ2CmCXvTU\nfekuTaxEEGQ83yKeI85KEkHdKgYpNmNa7O5OfOekjum4kRLi8qo4yVH6uard\nEiV+r4i52gWAqdrZOuFqWOLpbtWzMXF3gl6f+Sq5VT/SIi2/g5lO/bYd4QFX\n7cm/J+M5MzDJvxDht29bwDMylJVJXYr93xsEsLUAG0xo71mzsnEc7aSCxY71\nGw+4/KstoSDT40pvoZLw7qRidmHOt5QLHI6wpcztdo8ALDByYpIifV/J7lao\ns4bDS0TOXCb8/F6MQt2SXRKD8pIvzQ3CZBBZSKg+29Muq7Gw8hDq/A==\n=lcfd\n-----END PGP SIGNATURE-----\n",
+ "previousReference": null
+ }
+}
+ ```
+
+
+---
+
+
+ Expected response (Group Chat Message)
+
+ ```tsx
+ {
+ "event": "chat.message",
+ "origin": "self",
+ "timestamp": "1696576220066",
+ "chatId": "a64abd4256a607e7bd2ab4068d9024ddb0d355687267c0e39eb31a3a7d245ab0",
+ "from": "eip155:0x9d57759F2D0cbf19D6cfAf72C5A4c4B1A2443500",
+ "to": [
+ "a64abd4256a607e7bd2ab4068d9024ddb0d355687267c0e39eb31a3a7d245ab0"
+ ],
+ "message": {
+ "type": "Text",
+ "content": "Hello"
+ },
+ "meta": {
+ "group": true
+ },
+ "reference": "bafyreidheq2764lxdi2plbp4mik24ohtjfyvfbmkde2wsb2ahvwdjrwygq",
+ "raw": {
+ "fromCAIP10": "eip155:0x9d57759F2D0cbf19D6cfAf72C5A4c4B1A2443500",
+ "toCAIP10": "a64abd4256a607e7bd2ab4068d9024ddb0d355687267c0e39eb31a3a7d245ab0",
+ "fromDID": "eip155:0x9d57759F2D0cbf19D6cfAf72C5A4c4B1A2443500",
+ "toDID": "a64abd4256a607e7bd2ab4068d9024ddb0d355687267c0e39eb31a3a7d245ab0",
+ "encType": "PlainText",
+ "encryptedSecret": "",
+ "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7LcCRBG3kV4UbDyWhYhBPyPo+yD4wbsNV5YNkbeRXhR\nsPJaAABWfAf+MQFE/qy3X8R19wQeQ90eu6rYtK1h5aVlLwezo4z8F/8KqK1S\nwr8tlrtlQ9TieNH6Q5xebM2K356R44QnmE3qZB52Ukww2hiyrrCu7+x55KzK\na1+P8bQh1bGiesBYOa3LqnFlnFyQgBFJvGQqI0m2QBDbkM5OTkQGUYSi4tnO\nYIxVplb/lhEYHt/ZRGu1xg0XMhgycsRESidNLldKRx+AooeGfWgNIws97Yaq\nBbGTEgNOul8XV8b7y2ORL74Dl18UMPRF91dyktm/y8FJp30rWHaeNMAgKzlX\nr/nSgXFtCkfxclQgbBlSit1PBHmhB/Sr0amZKelpiYdRT+lVluknLg==\n=/QXX\n-----END PGP SIGNATURE-----\n",
+ "sigType": "pgpv2",
+ "verificationProof": "pgpv2:-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7LcCRBG3kV4UbDyWhYhBPyPo+yD4wbsNV5YNkbeRXhR\nsPJaAAAHQQf/eb4aaRUTbcAwLRWlI+55Ddd1PBeWXhTyDIZgsiFYUwSmtLLd\n/bFHnQzyplo+Tp8BuUB+wO5dH112ousWxOeTj8yAGUve6OhbP/8g9nJmHecJ\nmZwAHPhr4BVYomQRQChLp8FstLLjiI3CNdfarIYzBmlWGhrurXltjx69e+Ef\nyxtxRZ6zZavG56IHhOJru0p3y1nsbNI5eGsXG9Wq3FdAUXhbsOizxDCAdqN/\nfzOmqnZGMKsk6DNQ1471txAGujbg29i9o41lxYGcuNYYMal0CEceawfMXDH8\n8T2fbILXRZzpX/I+dlArPMDHqLdfNu2uLwYOmq+aTv7qUm3t1SkR0w==\n=+0T5\n-----END PGP SIGNATURE-----\n",
+ "previousReference": null
+ }
+}
+ ```
+
+
+
+---
+
+
+ Expected response (Group Chat Request)
+
+ ```tsx
+ {
+ "origin": "self",
+ "timestamp": 1696576021653,
+ "chatId": "3781b4193166ec8f0a1fabe162ef3f2458cac28516d4d20f8dd7faf446815900",
+ "from": "eip155:0x136E326b22ED48dbB665733eC024407d4fAA4F12",
+ "to": [
+ "eip155:0x3AD7cf4Ef82dd7f4f040c5eD7352f12C662F21db",
+ "eip155:0x1b77273e527Ec5948995f395e3ADa41E708d617e",
+ "eip155:0x7711FED1Bc6B1E461aE7869959bdBf529335db5A"
+ ],
+ "event": "chat.request",
+ "meta": {
+ "group": true
+ },
+ "raw": {
+ "verificationProof": "pgp:-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7IVCRAxpSc3atCeoBYhBGHp9Ifk8vvLrMzkYTGlJzdq\n0J6gAAD//wf/bTrC0LnwzcUIE10d3XQ2Y56jK6kRVGWKR/7i6CC+hGs5PGKu\nzefIGdtLVjAqTeKn6PbNnb1t2niLhmMeTbN+knGCzSqx/FN8OodLLmunLNAx\nWJ5thFyjZWNyIF7IoH2zUdc8zbsjXHzfd70yoxMZSwd5C7EPj/e17kyYHdj2\nzPQecbTsnCIjJKzi0PBa2YMNoF5fExP3hwTnP0k693r8oC5ivxj7Ht3Hwmu0\njsv+sGXk+XZPC/JQQfEEviEh3j9dEiNIeHutk/7cFdEnDfEy5dFMxubjf6oH\nY6vt0q2V2CZJHHw99JYeTHN/d3YDXc4RggoUINo1cysR904owgEsVw==\n=QTX8\n-----END PGP SIGNATURE-----\n:0x136E326b22ED48dbB665733eC024407d4fAA4F12"
+ }
+}
+ ```
+
+
+
+---
+
+ Expected response (Group Chat Request Accepted)
+
+```tsx
+ {
+ "event": "chat.accept",
+ "origin": "other",
+ "timestamp": "1696576021843",
+ "chatId": "3781b4193166ec8f0a1fabe162ef3f2458cac28516d4d20f8dd7faf446815900",
+ "from": "eip155:0x3AD7cf4Ef82dd7f4f040c5eD7352f12C662F21db",
+ "to": null,
+ "message": {
+ "type": null,
+ "content": null
+ },
+ "meta": {
+ "group": true
+ },
+ "reference": null,
+ "raw": {
+ "fromCAIP10": "eip155:0x3AD7cf4Ef82dd7f4f040c5eD7352f12C662F21db",
+ "toCAIP10": "3781b4193166ec8f0a1fabe162ef3f2458cac28516d4d20f8dd7faf446815900",
+ "fromDID": "eip155:0x3AD7cf4Ef82dd7f4f040c5eD7352f12C662F21db",
+ "toDID": "3781b4193166ec8f0a1fabe162ef3f2458cac28516d4d20f8dd7faf446815900",
+ "encType": "",
+ "encryptedSecret": null,
+ "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7IVCRA1c2iyC1q/7RYhBH5kgFyUQlfGEgbg0jVzaLIL\nWr/tAABinQf9E+7UUlPnAVu9VifNHS6GJuf/o1RJdE8gL4mi27+rdfr+Y2+Y\nzZaZbBEJK3BTJgT4op1yJKtg2GZDZUIMWSbkcouE+2YyyYsANS89z/blq/05\nYf6RFuUeHr3pGIyzkeb7Aj7VEHbUhrK5nHheTkO7K6Gpa9blNEYVrhsYrHbs\n7UhYKlq6tsoo1E8XXFWBhd+2rVPKF4zhIt9jPdqNPYTQSn7K7hjVvZueWd0Z\nD7Vr4RO4Af3a/5EiVAvOtxVGLpwhw+FKDOGJhRdNCNLqEc8gZ0q+l1cvglKp\nfAiqSZpnnTzIUloszJvNFAeQSR/nZQ9wjEihosDztVOOz5uyQ3XhZw==\n=kX/p\n-----END PGP SIGNATURE-----\n",
+ "sigType": "pgp",
+ "verificationProof": "pgp-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7IVCRA1c2iyC1q/7RYhBH5kgFyUQlfGEgbg0jVzaLIL\nWr/tAABinQf9E+7UUlPnAVu9VifNHS6GJuf/o1RJdE8gL4mi27+rdfr+Y2+Y\nzZaZbBEJK3BTJgT4op1yJKtg2GZDZUIMWSbkcouE+2YyyYsANS89z/blq/05\nYf6RFuUeHr3pGIyzkeb7Aj7VEHbUhrK5nHheTkO7K6Gpa9blNEYVrhsYrHbs\n7UhYKlq6tsoo1E8XXFWBhd+2rVPKF4zhIt9jPdqNPYTQSn7K7hjVvZueWd0Z\nD7Vr4RO4Af3a/5EiVAvOtxVGLpwhw+FKDOGJhRdNCNLqEc8gZ0q+l1cvglKp\nfAiqSZpnnTzIUloszJvNFAeQSR/nZQ9wjEihosDztVOOz5uyQ3XhZw==\n=kX/p\n-----END PGP SIGNATURE-----\n",
+ "previousReference": null
+ }
}
```
+
-| Parameter | Type | Remarks |
-| ------------------- | -------- | --------------------------------------------------------------- |
-| did | `string` | user decentralized identity |
-| wallets | `string` | all wallets associated to the did |
-| publicKey | `string` | Public PGP key |
-| encryptedPrivateKey | `string` | Encrypted PGP Private Key |
-| verificationProof | `string` | Verification proof |
-| msgSent | `number` | Number of messages sent |
-| maxMsgPersisted | `number` | Maximum number of messages that can be persisted |
-| profile | `object` | User profile information |
-| origin | `string` | Origin information (source of the data) |
-| name | `string` | Profile Name ( Deprecated ) |
-| about | `string` | Profile Description ( Deprecated ) |
-| profilePicture | `string` | Profile Picture ( Deprecated ) |
-| numMsg | `number` | Number of messages sent ( Deprecated ) |
-| allowedNumMsg | `number` | Maximum number of messages that can be persisted ( Deprecated ) |
-| encryptionType | `string` | Type of encryption used |
-| signature | `string` | Account signature ( Deprecated ) |
-| sigType | `string` | Type of signature ( Dprecated ) |
-| encryptedPassword | `null` | Encrypted user password ( Deprecated ) |
-| nftOwner | `null` | Owner of NFT ( Deprecated ) |
-| linkedListHash | `null` | Deprecated |
-| nfts | `null` | Information about owned NFTs( Dprecated ) |
+---
+
+
+ Expected response (Group Chat Request Rejected)
+
+```tsx
+{
+ "event": "chat.reject",
+ "origin": "other",
+ "timestamp": "1696576601599",
+ "chatId": "7a200d55cc76428e9938e935b604e993c5f6cb2f3e9a1dd7108a07dd32de0791",
+ "from": "eip155:0x15d8a67c0B1eb61dA5901109DB4CA382E989aA13",
+ "to": null,
+ "message": {
+ "type": null,
+ "content": null
+ },
+ "meta": {
+ "group": true
+ },
+ "reference": null,
+ "raw": {
+ "fromCAIP10": "eip155:0x15d8a67c0B1eb61dA5901109DB4CA382E989aA13",
+ "toCAIP10": "7a200d55cc76428e9938e935b604e993c5f6cb2f3e9a1dd7108a07dd32de0791",
+ "fromDID": "eip155:0x15d8a67c0B1eb61dA5901109DB4CA382E989aA13",
+ "toDID": "7a200d55cc76428e9938e935b604e993c5f6cb2f3e9a1dd7108a07dd32de0791",
+ "encType": "",
+ "encryptedSecret": null,
+ "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7RZCRA8vrXKPfPlwRYhBECQe8HJcpH3IRX27jy+tco9\n8+XBAADl0Af7BumEnrIcSj/1H3LvxaqG4wK/G6iTP3iTvXUca0n7UBplXS8P\nbKV7XFhjollN6jJVZ53mmUHgNDAbfaQTvutm3SRJlFVJxV4zV9uL7UMZW+k4\nYAJM5XNbqqyn7+KjcLIwBpJ3YLMmmLfdrO4+WJAYswAAJGiS+KPDsU+oOsfm\nHMWc5aRqis0Epf3FLWELO0uDyydm75575bBe60FxfPjnd5GhUgmMWydNCZH1\ngeGMLZbhuQ+bvnLjTuWSmnW64cl+jlRCzs2Mpgwvrh0ZQIcPWjVDjNevNohu\n3l9VXhHuYPUCyGGIyhcPG3tubRcudY+U/uavhQ6XXgWPVdKZ/qwfAw==\n=0jOy\n-----END PGP SIGNATURE-----\n",
+ "sigType": "pgp",
+ "verificationProof": "pgp-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7RZCRA8vrXKPfPlwRYhBECQe8HJcpH3IRX27jy+tco9\n8+XBAADl0Af7BumEnrIcSj/1H3LvxaqG4wK/G6iTP3iTvXUca0n7UBplXS8P\nbKV7XFhjollN6jJVZ53mmUHgNDAbfaQTvutm3SRJlFVJxV4zV9uL7UMZW+k4\nYAJM5XNbqqyn7+KjcLIwBpJ3YLMmmLfdrO4+WJAYswAAJGiS+KPDsU+oOsfm\nHMWc5aRqis0Epf3FLWELO0uDyydm75575bBe60FxfPjnd5GhUgmMWydNCZH1\ngeGMLZbhuQ+bvnLjTuWSmnW64cl+jlRCzs2Mpgwvrh0ZQIcPWjVDjNevNohu\n3l9VXhHuYPUCyGGIyhcPG3tubRcudY+U/uavhQ6XXgWPVdKZ/qwfAw==\n=0jOy\n-----END PGP SIGNATURE-----\n",
+ "previousReference": null
+ }
+}
+```
---
-### **Create Group**
+
+ Expected response (Participant is Removed from a Group)
-```typescript
-// Create a Group
-const createdGroup = await userAlice.chat.group.create(groupName, {
- description: groupDescription,
- image: groupImage,
- members: [walletAddress1, walletAddress2, walletAddress3],
- admins: [],
- private: false,
-});
+```tsx
+{
+ "origin": "other",
+ "timestamp": 1696576219688,
+ "chatId": "a64abd4256a607e7bd2ab4068d9024ddb0d355687267c0e39eb31a3a7d245ab0",
+ "from": "eip155:0x50bbFA4833e89389FE00a62D14E6eDDf1c155855",
+ "to": [
+ "eip155:0x50bbFA4833e89389FE00a62D14E6eDDf1c155855"
+ ],
+ "event": "chat.group.participant.remove",
+ "raw": {
+ "verificationProof": "pgp:-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7LbCRByYd40HdgiDBYhBLSq7nZZRBYzsnezMXJh3jQd\n2CIMAADNoAf/UxniQM/ZtzDuSmhIuvWiuGzl8vkeFbN2dOLW1a2yJO2Z8jDa\nDDuxyTcSt9d9YyCO/NojhbxmScE73gBysVt9OLdUn9hXlAKclYjXu4r7KvLk\nmrQyMlN3akDjpzH1gGiiCSi18vll07KRGSgWt3P13cA9vGpT+YV3A6uiCGUS\nE3CV16wdYTd0FUPJHckTJVVu3se1K3NfzzELMwIeN9bPJLxaZD3u3t074dN/\nc+jwUS1OC0sUQ5ptHCgfNIMgtueutKSPPZO6MKVBE/qQauKh81PHgzrhW0OE\n6gMkSDPjVbncjBSumofTWga7udk65RhwysCxx9qa3O/u6skBH0N+bg==\n=oqeR\n-----END PGP SIGNATURE-----\n:0x50bbFA4833e89389FE00a62D14E6eDDf1c155855"
+ }
+}
```
+
-| Param | Type | Default | Remarks |
-| ----------------------------------- | ---------- | ------- | ------------------------------------------ |
-| `name` | `string` | - | The name of the group to be created. |
-| `options` \* | `object` | - | Optional Configuration for creating group. |
-| `options.description` \* | `string` | - | A description of the group. |
-| `options.image` \* | `string` | - | Image for the group. |
-| `options.members` \* | `string[]` | `[]` | An array of member DID. |
-| `options.admins` \* | `string[]` | - | An array of admin DID. |
-| `options.private` \* | `boolean` | `false` | Indicates if the group is private. |
-| `options.rules.entry.conditions` \* | `any[]` | - | Conditions for entry to the group. |
-| `options.rules.chat.conditions` \* | `any[]` | - | Conditions for chat within the group. |
-
-\* - Optional
+---
+ Expected response (Participant Joins a Group)
- Expected response
+```tsx
+{
+ "origin": "other",
+ "timestamp": 1696576531987,
+ "chatId": "1032596dea9f24a7a0ee419668f7d39da32a2fb32003a27c6b293cc6668d2a82",
+ "from": "eip155:0x8c1EAB3227250526f133681630c2B191969f8581",
+ "to": null,
+ "event": "chat.group.participant.join",
+ "raw": {
+ "verificationProof": "pgp:-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7QTCRCI26TZ8c3OJBYhBNDtmDIWimjDn9MUIIjbpNnx\nzc4kAAAfFwgAgQkKBS/W7e53maVOne1lob2Qk14gWfUQm/LaRlP0iO5YwPlg\njckyQaX0Ient3PmLSqUoykuKWH2wR53YJ6Wgb//EkOxdywkrDbAZCGnQgxaO\nakTU30mDaV06HLQjDQmRTHdeozwV+6PF+i71vZPNmsCSI8x/VSex/gMrs2nk\nhSAHnuhUcuEWHshc+FXEO70acz8nkhH7Pw0icDwb50yFZNuekrK4rjUPmXb2\nwBzwFDjpfS6n8JMQz4//jYXyFuDfzYlr97ymWdltR5h8QKs1iZsN++X/5FsA\nO2EltMRqhxcpPApcHB9QQe6CAZFG+1fB8FKOXx6MZMwHqjyEtrL27Q==\n=bDP5\n-----END PGP SIGNATURE-----\n:0x8c1EAB3227250526f133681630c2B191969f8581"
+ }
+}
+```
+
-```typescript
+---
+
+
+ Expected response (Participant Leaves a Group)
+
+```tsx
{
- members: [
- {
- wallet: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTvNZgBCADeYpZfxgn1HoMUuWM42v8ZWfLPwglQYmzz5rY3PdPPoRFU\n' +
- 'v0AyPjYKpmLh2ZNfXjPaS9GuMdpXaomYSEwsV02hXZOQelo9cLop0Fc2i+l7\n' +
- '70rYhePuOuQ+XD/xYzhngAgNJ9rX96YnSodldb8uJfxYmgoF0E9Z2o2fgZGj\n' +
- 'll2CPnOaLXZaBQlPS3x/461TmZ1n2ZePS/fwiC7taLz3PtyGtKaC0vo4isvI\n' +
- 'yf04fkjudG0XIns5CWjdR2HeDC8BzSl8OVj8AQAc5uVU8Abk+ejWVr4zfoox\n' +
- 'eaziDPgGdkckFiQ6Tdsg0tPwwOpSrCCtJocTmc/fWaBb0YlnyAAL88fJABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZBMYqhmfI2WQQMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAACxNQf/UrM/whR7vCs+\n' +
- 'ez8Y8Hz4WqIuXtfMh4l2nKVv5UUuAfQkBxEY5j6Ga2+JgKU3neQ34x/v6fm9\n' +
- 'CLcY38Tc4AWyEx8KC78J+xOs7RMfyNBeiaf8KdaFfQrP0nMmufE6TxkfV1Y5\n' +
- 'LJZZ8350rZVtYJppWtlH+gbyUmMObyWDWbL3aWtqa3xjv0kLsf7TnugiFwzB\n' +
- 'gHHtk8tlDSOxRt0VdNNd19+/zrBYNl07Ig24WD2ETaJiaqa651z24/6/MkGT\n' +
- 'MBoQh+679tuWWcTrNi4jIA8jhSQ5BOgbAapl3qXk0m9/Aexpe2s6ISLXe8YJ\n' +
- 'j4cObDLv/ZKKeLZYTq9lVCydLAQUbs7ATQRk7zWYAQgAmx36uefgUF4cCSYH\n' +
- 'WMWAOTyc8Awo+hxn6FktOLU1+9hfGrX2jwGLOoOwjNgbYJbiSvRglAX2b57/\n' +
- 'qkkltAg1ZYCLSUzfBUbbWYlJNBwpv7+52zHaLUZ3gmI5aE48ad+uzaadgpVT\n' +
- 'VqLbhdgkN6jkemPTlfMehyS49AAbmqeKfo2U72tm9ZqT2cPVCASMjN/Ux2qG\n' +
- '3W8HTo0KIVFSbkTthl1zAlwAFksp0q437+pxbdJIecJ9mO6N4OQMnv+hVBDc\n' +
- 'WrPqBDJ0nas4JNgLxmLv0pheGg/TEfwS/p6xGRW5m08bj2l0cgqmEaM27jbi\n' +
- 'DEpOykRWsDMhheEfI2zV/Qam8QARAQABwsB2BBgBCAAqBYJk7zWYCZBMYqhm\n' +
- 'fI2WQQKbDBYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAAAnBggA1gkIopr9HJFP\n' +
- 'fO5SebcbowH4AG9M0qBqF4h1JIKbqvOnxLSsC5QmmzFcjS9ihyHBvzbRVGkC\n' +
- 'zEHYpLRedQ2AmQQfsf/VOoZJEOlb7tTk4+SpYtsGte5X/yLT5Bkls7Rp8ubK\n' +
- '/V99muj1nA/OkasllXQUSGEweVz6ejzJ0oMm3Vewmw8PelsdAnfS7Ud1MnXQ\n' +
- 'h+O8TCR56F5gAMWxZmxFpZMZyUFOH6KM+vL7HJUBztUS2g0ELsHKy9ep2yhv\n' +
- 'iABIwx/gEuPr0NDAH9x9XFKg5m3rO64KTY4BRWBISwmQ25dM1s1bwDPLi5XI\n' +
- '6Daw1glFxpPRrxgQGlVLzJOu5b8swQ==\n' +
- '=9hCc\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isAdmin: true,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzUlEQVR4AcXBsWlDMRiF0c8XTeAJPIAgoFbgQew1PIbXyKsyhUGtCqM6ZAJX6Z32fykM4hnuObv71++TYJRKlHtji1EqUe6NSJgJM2G2W74/nkzIvfHKKJUZwkyYCbOUe+Odcm/MEGbCTJil2/VMdLx8Eo1S2SL3RnS7nomEmTATZmm//BANKlHujS1GqUT7hRVhJsyEWWLSKJVXcm/MEGbCTJgl/sm9EY1SmTFKJcq9EY1SiYSZMBNm6XE6sHJhJffGOz1OByJhJsyE2R/3lDA4e9QQhAAAAABJRU5ErkJggg=='
+ "origin": "other",
+ "timestamp": 1696576531987,
+ "chatId": "1032596dea9f24a7a0ee419668f7d39da32a2fb32003a27c6b293cc6668d2a82",
+ "from": "eip155:0x8c1EAB3227250526f133681630c2B191969f8581",
+ "to": null,
+ "event": "chat.group.participant.leave",
+ "raw": {
+ "verificationProof": "pgp:-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7QTCRCI26TZ8c3OJBYhBNDtmDIWimjDn9MUIIjbpNnx\nzc4kAAAfFwgAgQkKBS/W7e53maVOne1lob2Qk14gWfUQm/LaRlP0iO5YwPlg\njckyQaX0Ient3PmLSqUoykuKWH2wR53YJ6Wgb//EkOxdywkrDbAZCGnQgxaO\nakTU30mDaV06HLQjDQmRTHdeozwV+6PF+i71vZPNmsCSI8x/VSex/gMrs2nk\nhSAHnuhUcuEWHshc+FXEO70acz8nkhH7Pw0icDwb50yFZNuekrK4rjUPmXb2\nwBzwFDjpfS6n8JMQz4//jYXyFuDfzYlr97ymWdltR5h8QKs1iZsN++X/5FsA\nO2EltMRqhxcpPApcHB9QQe6CAZFG+1fB8FKOXx6MZMwHqjyEtrL27Q==\n=bDP5\n-----END PGP SIGNATURE-----\n:0x8c1EAB3227250526f133681630c2B191969f8581"
}
- ],
- pendingMembers: [
- {
- wallet: 'eip155:0x119bb8ad40B1f94e2b30ae5f59eeaEB67cD0Bd6C',
- publicKey: null,
- isAdmin: false,
- image: null
+}
+```
+
+
+---
+
+### **Stream Chat Ops Events**
+
+```tsx
+ // recevive stream realated to group creation and updation
+ userAlice.stream.on(STREAM.CHAT_OPS, (data: any) => {
+ console.log(data)
+ })
+```
+
+
+ Expected response (Group Created)
+
+```tsx
+
+{
+ "event": "chat.group.create",
+ "origin": "self",
+ "timestamp": 1696576020848,
+ "chatId": "3781b4193166ec8f0a1fabe162ef3f2458cac28516d4d20f8dd7faf446815900",
+ "from": "eip155:0x136E326b22ED48dbB665733eC024407d4fAA4F12",
+ "meta": {
+ "name": "test",
+ "description": "test",
+ "image": "test",
+ "owner": "eip155:0x136E326b22ED48dbB665733eC024407d4fAA4F12",
+ "members": [],
+ "admins": [
+ {
+ "address": "eip155:0x136E326b22ED48dbB665733eC024407d4fAA4F12",
+ "profile": {
+ "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA30lEQVR4AcXBsa2DMBSG0S+/3LJBKkZgjUzADi4sJEoqSkvIBSNEYhtG8BIMkNdeGqd4iu45j+f79aHh7HasY91oGZcJa7giLcKZcCacBb441g1rXCZajnXjJtEknAlnwlk4u52WIUWsfEWaEjdnt9MinAlnwlk41g0rp4o1l57/GFLEmkuPJZwJZ8JZ4IucKr8knAlnwlnIqWLNpcfKqWKd3U7LcEWsufRYOVUs4Uw4E87CXHqscZmwRu6GK9Jydjs3C3frhiWcCWfC2eP5fn0w5tLzSzlVLOFMOBPO/gCOGzPC9wXXhQAAAABJRU5ErkJggg==",
+ "publicKey": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nxsBNBGUfshMBCADOFCC0uSjbBGbjJi5QWaEtDpv7PMGqA0kU+e2mHBvZgGM2\nimibNukifrDArM+oJL3/OnjQHwkF5L6W3oCnKwe1hwSiceLDf3uR0F5E+wWA\nEeFv3xPdYYpqbT9tdYXlOCJpoSJH2TM7mcvSECltpSOIYAWpD2E450kTTHCJ\nYDrnrMdPifrCTSrfh4X1pKkbdSDJIrHHeqVTDcUPZhZlbXdEypqK4u5wjEqe\nLc/AprwDyeDx+ltGAo4hmD3ojHGkckk7ctW9RmdqGBGCB/VaK35JT0Tp6AQ8\nrmKOejF4nxbH5eCzUX4vC6xz666gWGj2eGDnS5XCGaBtfWfvYvTCoe4HABEB\nAAHNAMLAigQQAQgAPgUCZR+yEwQLCQcICRAxpSc3atCeoAMVCAoEFgACAQIZ\nAQIbAwIeARYhBGHp9Ifk8vvLrMzkYTGlJzdq0J6gAABuBwgAvNkpwWQCoB8D\nFC56ir7s2tRlzpIUb+nnK5ygqpxp/Wvo1+TpFoWGkdUOC0ng9H98MrJmEh1k\nhLkaBv1VPQN6l+O7tjAyvWNA+JfKLaefxc6EB0KFUOZH1E/gFWc8b6+cciXZ\npAINmBW8+PPSlt1EYuo2UAXqEAOW4dlez8Z6OCf7c4L7+MZKVv2a5r3Cqfl2\nNHaI4lHQYabWt1tsoVyN7kyfZkENXQQv3LsJ7o98WK0FnfFEM/hA1I5jM8Ww\nf0qBukDmzOTxtgYDE7mo3xHNDpjptr8lk5oOFPsHCpOwgksAVKK4yHqy4aQe\nqXPBjBMmUBUuSlB/8KwI6FtX2JFm9s7ATQRlH7ITAQgAySkQBm6drDe5FJI1\nUe5QhoUXX8ugfXyCR7SoL4JMxVmhaO9/Fj/Swy1UoagONZYJZzcamJWnPzAR\nvfYBEzSEFGrkPKVdrJAM7Zf1sX5v+wpUtLTE6/gSCzAJMnK11pdgTHqEn+Rc\nfPuTnGYFZw3EybYMbhr/wBCyvFd49ES+8q3jrjHbMGS5lFCnVFYE/gyN9nqp\nSG0biMS7pl+w51bjIfJ9bRiUzrxpk5yvr9WDqMTVJA0N6ZRsD+xtkipc7XFe\nnsY0caCVVYFOH9YCiwuytC4ShU2VHjEPXcgzLTk9k5ecfE8AdwiYgLsWOHTn\nbz1JpwqYJx5Rndkb4vXdV6Pi7wARAQABwsB2BBgBCAAqBQJlH7ITCRAxpSc3\natCeoAIbDBYhBGHp9Ifk8vvLrMzkYTGlJzdq0J6gAACZvQgAyJrLhQ9/MsBU\n6E1ZwdKlKBWi62A4SBXRZJpRl2hBwagyNq7zbsX/yO7D7fW1FVLfcT28cmCe\nCUD6aa904dQ8GVDyuUqRsSXZZvZqFdddgNT7O8fCbIbMCihfz9Gg6mbxVHcy\nOby7nkOBbrKDBpIPab9yMHHYsycsPDo8/8cGI9RNZz06aAgOVGjfcMTuw8RR\nXWINBmTWn9I4xrylEtH7SQU9b0Alj2SxfV9N/+mMGGv/Zo3E99/a/p2DLExY\n/+dk0I9kxjxHkjtq49/tT00JYLDkHVtMgGxjl9n8Uv7KXFHkuGFg7gV9ivdN\n1phi4oalkdY5sqbd5GkUxM7M1VN6Xg==\n=nCF5\n-----END PGP PUBLIC KEY BLOCK-----\n"
+ }
+ }
+ ],
+ "pending": {
+ "members": [],
+ "admins": []
+ },
+ "private": false,
+ "rules": {}
},
- {
- wallet: 'eip155:0x6e0C509d14EbF26A529bf6DC5CC9bee7F5b8DBa4',
- publicKey: null,
- isAdmin: false,
- image: null
+ "raw": {
+ "verificationProof": "pgp:-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7IUCRAxpSc3atCeoBYhBGHp9Ifk8vvLrMzkYTGlJzdq\n0J6gAADrLAgAgDSQ7CJ3ZVOPye++rkpyR4Q9XSGnV3Z0bqO+HCqFDW/hTmJ+\n12kjrAQV43Q1fQviIMqh+RTA9WJHPA14vu/ZYHjmCM/HfPSxbY4zV/7FJF9C\nCaEgq+wGs+2vhixHX4Zoo4qrxdXQ6q8Wl4XXW3SVaw1sGxfIh+uMje54Tsil\nnaLNK+lIPdSAJDw1hOHIM3iMWaSzZasLaXkJ6KY9KefW52mhg112BZI94FxJ\n/wFQtlIaXGZHhCbaqiigjRPKo17KyW7PX6I0rTAQJlwHyIKS/vIH8Uahi2x3\ndzjonpXjjtsgcP+VhzEP1jxQkpo4mG47Fxkxzp/Q7ztdSGHnJGlXkQ==\n=HydQ\n-----END PGP SIGNATURE-----\n"
+ }
+}
+```
+
+
+---
+
+
+ Expected response (Group Updated)
+
+```tsx
+
+{
+ "event": "chat.group.update",
+ "origin": "self",
+ "timestamp": 1696576021192,
+ "chatId": "3781b4193166ec8f0a1fabe162ef3f2458cac28516d4d20f8dd7faf446815900",
+ "from": "eip155:0x136E326b22ED48dbB665733eC024407d4fAA4F12",
+ "meta": {
+ "name": "test",
+ "description": "Updated Description",
+ "image": "test",
+ "owner": "eip155:0x136E326b22ED48dbB665733eC024407d4fAA4F12",
+ "members": [],
+ "admins": [
+ {
+ "address": "eip155:0x136E326b22ED48dbB665733eC024407d4fAA4F12",
+ "profile": {
+ "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA30lEQVR4AcXBsa2DMBSG0S+/3LJBKkZgjUzADi4sJEoqSkvIBSNEYhtG8BIMkNdeGqd4iu45j+f79aHh7HasY91oGZcJa7giLcKZcCacBb441g1rXCZajnXjJtEknAlnwlk4u52WIUWsfEWaEjdnt9MinAlnwlk41g0rp4o1l57/GFLEmkuPJZwJZ8JZ4IucKr8knAlnwlnIqWLNpcfKqWKd3U7LcEWsufRYOVUs4Uw4E87CXHqscZmwRu6GK9Jydjs3C3frhiWcCWfC2eP5fn0w5tLzSzlVLOFMOBPO/gCOGzPC9wXXhQAAAABJRU5ErkJggg==",
+ "publicKey": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nxsBNBGUfshMBCADOFCC0uSjbBGbjJi5QWaEtDpv7PMGqA0kU+e2mHBvZgGM2\nimibNukifrDArM+oJL3/OnjQHwkF5L6W3oCnKwe1hwSiceLDf3uR0F5E+wWA\nEeFv3xPdYYpqbT9tdYXlOCJpoSJH2TM7mcvSECltpSOIYAWpD2E450kTTHCJ\nYDrnrMdPifrCTSrfh4X1pKkbdSDJIrHHeqVTDcUPZhZlbXdEypqK4u5wjEqe\nLc/AprwDyeDx+ltGAo4hmD3ojHGkckk7ctW9RmdqGBGCB/VaK35JT0Tp6AQ8\nrmKOejF4nxbH5eCzUX4vC6xz666gWGj2eGDnS5XCGaBtfWfvYvTCoe4HABEB\nAAHNAMLAigQQAQgAPgUCZR+yEwQLCQcICRAxpSc3atCeoAMVCAoEFgACAQIZ\nAQIbAwIeARYhBGHp9Ifk8vvLrMzkYTGlJzdq0J6gAABuBwgAvNkpwWQCoB8D\nFC56ir7s2tRlzpIUb+nnK5ygqpxp/Wvo1+TpFoWGkdUOC0ng9H98MrJmEh1k\nhLkaBv1VPQN6l+O7tjAyvWNA+JfKLaefxc6EB0KFUOZH1E/gFWc8b6+cciXZ\npAINmBW8+PPSlt1EYuo2UAXqEAOW4dlez8Z6OCf7c4L7+MZKVv2a5r3Cqfl2\nNHaI4lHQYabWt1tsoVyN7kyfZkENXQQv3LsJ7o98WK0FnfFEM/hA1I5jM8Ww\nf0qBukDmzOTxtgYDE7mo3xHNDpjptr8lk5oOFPsHCpOwgksAVKK4yHqy4aQe\nqXPBjBMmUBUuSlB/8KwI6FtX2JFm9s7ATQRlH7ITAQgAySkQBm6drDe5FJI1\nUe5QhoUXX8ugfXyCR7SoL4JMxVmhaO9/Fj/Swy1UoagONZYJZzcamJWnPzAR\nvfYBEzSEFGrkPKVdrJAM7Zf1sX5v+wpUtLTE6/gSCzAJMnK11pdgTHqEn+Rc\nfPuTnGYFZw3EybYMbhr/wBCyvFd49ES+8q3jrjHbMGS5lFCnVFYE/gyN9nqp\nSG0biMS7pl+w51bjIfJ9bRiUzrxpk5yvr9WDqMTVJA0N6ZRsD+xtkipc7XFe\nnsY0caCVVYFOH9YCiwuytC4ShU2VHjEPXcgzLTk9k5ecfE8AdwiYgLsWOHTn\nbz1JpwqYJx5Rndkb4vXdV6Pi7wARAQABwsB2BBgBCAAqBQJlH7ITCRAxpSc3\natCeoAIbDBYhBGHp9Ifk8vvLrMzkYTGlJzdq0J6gAACZvQgAyJrLhQ9/MsBU\n6E1ZwdKlKBWi62A4SBXRZJpRl2hBwagyNq7zbsX/yO7D7fW1FVLfcT28cmCe\nCUD6aa904dQ8GVDyuUqRsSXZZvZqFdddgNT7O8fCbIbMCihfz9Gg6mbxVHcy\nOby7nkOBbrKDBpIPab9yMHHYsycsPDo8/8cGI9RNZz06aAgOVGjfcMTuw8RR\nXWINBmTWn9I4xrylEtH7SQU9b0Alj2SxfV9N/+mMGGv/Zo3E99/a/p2DLExY\n/+dk0I9kxjxHkjtq49/tT00JYLDkHVtMgGxjl9n8Uv7KXFHkuGFg7gV9ivdN\n1phi4oalkdY5sqbd5GkUxM7M1VN6Xg==\n=nCF5\n-----END PGP PUBLIC KEY BLOCK-----\n"
+ }
+ }
+ ],
+ "pending": {
+ "members": [],
+ "admins": []
+ },
+ "private": false,
+ "rules": {}
},
- {
- wallet: 'eip155:0xE3FDD0527a9F8418f9a7D9e970452827FbE202FF',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTvNZgBCADouo4S2kPqA//+I7nDAk15/LcJ2TGvDhOYuPNUNMiNGOb4\n' +
- 'txusuKz6HOaG+K9hiUBpHjKrYEmCT2FEXxt8bfS3SpWb74RHSkWUNUkxk25y\n' +
- 'gE5gaCKyAdcnOUyVLmobVFFYtH6naK9bULaUtkVik1P0iuEevWHxtTpsjbyH\n' +
- 'bZtNpVTdprdLib4Wx6bb7VogsvjlvNJcVJ4sfPE0XgsQgAGIev7yJyU0DGzt\n' +
- '/EbvFX4sv51Kb1dX9ctBcvzVbs9+qT6LTivsrQp+TNHUN4zEeMhnWFFP5K1d\n' +
- 'H445S6FWk53XvBudcOkFPtltU1MPCS6hmhevArBfYzy5eSlaKA/fH+kFABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZCrD2gy8Zu4awMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBKru9/u8wPcTeHibkasPaDLxm7hrAADa/Af+PbamVg/Ig2S2\n' +
- 'HgIy4w5x7ulSk1/49+AmuiUMiVUwJSVBhROsyDbLET56w4+1TIMYZFJaczW3\n' +
- '8tCvAOUSauzc52I3zwGmaCupBJokIWp7ncPh0B8TFYrgThgXV7sLf3xy4roy\n' +
- 'y8oFz1Zla88krwtPe4Az7TF+WNdXoDsLNJ3GXRmNqs1GITmDqAXFWncl12NM\n' +
- 'ajUKWIKc/Gi1oKfz22mabJTtWBimDpA12LaGK3GjEK5CiWXT3Tzlqn6R14EZ\n' +
- '6ohpKZldSJiMPL0Bu9iT52iHOsw1wTZNC1L5lKhOCi3c+/fLRcJZt3hdCjqy\n' +
- 'd/FSCa8/Ny/GrHBWoL49rSF4pDEA+s7ATQRk7zWYAQgAtNOoHCL7BCnjwp8O\n' +
- 'htTxEI5r7Q/1zKKHiz6QKjjrGBYyR6gcmPM3JNEcvzY4OsCFnKBv2suOgrqH\n' +
- '8kXJzfpIQ7u7uJs+O3p/cn86RMANiEnO8NbB/0scpfZ7Vg3eOfoiWYE4I/1o\n' +
- 'FVDCyZ1YVqtbcmuW6D8i1djjeoUmkUDZyPo7Qs6hUsJeYA/Rfl8mH5sjy2cN\n' +
- 'WXf8cEtOUqJtwERXt5aRB/nBZiC0bsP6hf0HtAoNA8/96TkqrcQpODW/RckD\n' +
- 'fo4wkpEONHRH+LGX7GV0pwymHu42TUnULmED6BrMgMYG2sKpxMThxtAxRaiP\n' +
- 'nZ3DKXr8GCjTYnbEZpoi2zKCOQARAQABwsB2BBgBCAAqBYJk7zWYCZCrD2gy\n' +
- '8Zu4awKbDBYhBKru9/u8wPcTeHibkasPaDLxm7hrAADGyQgA5NMUkoyDTPZa\n' +
- 'Znj1dB+17xBXCZ/u7pPQc1DukBefVke7/qYIicdnnEGIX3Zd7TckFRsDljR/\n' +
- '3418Bne4WyL57fAF/GgYsegpJ9n1KT7oPxWzibIaYdj7R6bkDt5r61EDWC3N\n' +
- 'VBbnZu9cO15TYkObJIiyNvwbQyd6Dm313b39GnEE8sM709TWsI6Es6rRZAfC\n' +
- '+sI8ezYxqVUbP7sW3jJZYzdPOhZPHvFd5iJ2EfygEOuk5tb7AimfNwF/CNcB\n' +
- 'weQGEU7feOSB9lXXA+Ag1duLM4B9bLbbHEQIPhKlBF1ED64e/W/5HNfoAkS4\n' +
- 'qhzOD5XWs6xs45nnYqUbBFLG9Xk+Jg==\n' +
- '=qtAv\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isAdmin: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsXECMRRF0csbdbAZBagHKlJMSOL90IUq2h5UABktLE6/HcizY4/fOafrcntzQB/BTKvBEcJMmAmz0keQtRpk67bzRQ1m1m0nu19E1keQCTNhJsxO1+X2JukjmHm+Ppg5Lw9mWg0yYSbMhFnhoPPy4C8JM2EmzArftBr8J2EmzIRZ6SPIWg2yPoKs1WCmjyBrNcj6CDJhJsyEWWk1OKKP4DdaDTJhJsyEWeEHrQbZuu3M3C/iCGEmzITZJ/s7LOkKUABjAAAAAElFTkSuQmCC'
+ "raw": {
+ "verificationProof": "pgp:-----BEGIN PGP SIGNATURE-----\n\nwsBzBAEBCAAnBQJlH7IVCRAxpSc3atCeoBYhBGHp9Ifk8vvLrMzkYTGlJzdq\n0J6gAACfBQgAgDYEX8fSjArginDEbjDmMxQxmieIMt3/N2wTjWU/r8muAnNb\nIpijtAvftEkCoVnefXH9rlILr0rUGLwFXTsc6YYO6u9Tr1iODQQZopD8Bqtc\ntKE5RzRT6qS6QUQQP8YNlh/iqtTWCzdY7aYKGNWkrSOUKhu+iHKLIsEqNSf2\nYV9S9qksGWhK9xfsExkHjR0Df3yo/BUwpDKW/duiwBPgl99aUYunjAQyRRun\njlXmX6W+bEAlEmJABq5C9Tw+M/+j4AiBy57kdrxAQ6aKHnfGJafH7Xo8/BuN\nG6XJdNELJKug/5Xb+eWjO3JggGOD90fetTKcVdzGJPhXaVyIhL0e/A==\n=+sdF\n-----END PGP SIGNATURE-----\n:0x136E326b22ED48dbB665733eC024407d4fAA4F12"
}
- ],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJk7zWZCZBMYqhmfI2WQRYhBC9DyzhpX3ACb/yTq0xiqGZ8\n' +
- 'jZZBAADwAwgAq/6WjtwRt1aPTLWwtSx80Ng/Wxf97dkpebMXSj9T7f5ia1rM\n' +
- '8wqsuNUDMEMPB9LM34f6Q5pD994oeN2YT7z34u20mskiNphZdx/DNvu8w9UZ\n' +
- 'rI3tyjfZULhARNVM34sSABnHtExbl4ZArhNDsT86ku0sZNjr9frn2mtgmlKN\n' +
- 'nQdGcLJSxbci0hFg3nE5mYNpwZNs2S/2uk11WHKxzMhII6AdePE77BKPqedu\n' +
- 'PiXDODO2dIvV8glLQoJPRPgc2ap+/xYIBUFljqHGPU/62VSLlHxBJv72p5s/\n' +
- 'kOxiqD42TmpaaMtfudqgsZsGoYpZDHcMKYGNZs+9qVRHPRD+s0QhEA==\n' +
- '=c6IF\n' +
- '-----END PGP SIGNATURE-----\n',
- groupImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- groupName: 'influential_maroon_gamefowl',
- groupDescription: 'urgent_brown_butterfly',
- isPublic: false,
- groupCreator: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
- chatId: '5f769c881ffe328117dea3d3acd0b97ce7f4c163e440f75a96be3e33f7d2a000',
- meta: null,
- scheduleAt: null,
- scheduleEnd: null,
- groupType: 'default',
- status: null,
- rules: {},
- eventType: 'create'
}
+
```
+
-| Parameter | Type | Remarks |
-| -------------------------- | --------------------- | -------------------------------------------------------------- |
-| `members` | `Array` | An array containing member objects. |
-| `members.wallet` | `string` | The wallet address of the member. |
-| `members.publicKey` | `string` | The member's public PGP key (if available). |
-| `members.isAdmin` | `boolean` | Indicates whether the member is an admin. |
-| `members.image` | `string` | Image associated with the member. |
-| `pendingMembers` | `Array` | An array containing pending member objects. |
-| `pendingMembers.wallet` | `string` | The wallet address of the pending member. |
-| `pendingMembers.publicKey` | `string` | The pending member's public PGP key (if available). |
-| `pendingMembers.isAdmin` | `boolean` | Indicates whether the pending member is an admin. |
-| `pendingMembers.image` | `string` | Image associated with the pending member. |
-| `contractAddressERC20` | `string` or `null` | Contract address for ERC20 tokens (Used for tokenGating). |
-| `numberOfERC20` | `number` | The number of ERC20 tokens associated. (Used for tokenGating). |
-| `contractAddressNFT` | `string` or `null` | Contract address for NFT tokens (Used for tokenGating) |
-| `numberOfNFTTokens` | `number` | The number of NFT tokens associated. (Used for tokenGating) |
-| `verificationProof` | `string` | Verification proof associated with group data. |
-| `groupImage` | `string` | Group's image. |
-| `groupName` | `string` | The name of the group. |
-| `groupDescription` | `string` | Description of the group. |
-| `isPublic` | `boolean` | Indicates whether the group is public or private. |
-| `groupCreator` | `string` | Push Profile DID of the group creator. |
-| `chatId` | `string` | Unique chat ID associated with the group. |
-| `meta` | `object` or `null` | Additional metadata (if available). |
-| `scheduleAt` | `timestamp` or `null` | Scheduled start time (if available). |
-| `scheduleEnd` | `timestamp` or `null` | Scheduled end time (if available). |
-| `groupType` | `string` | Type of the group (default, spaces, live etc). |
-| `status` | `string` or `null` | Status information ( active, expired etc) |
-| `rules` | `Object` | Group-specific moderation rules |
-| `eventType` | `string` | The type of event (create, update etc) |
+---
+
+## PushNotification Class
+
+### **Initialize**
+
+```typescript
+// Initialize PushAPI class instance
+const userAlice = await PushAPI.initialize(signer, {
+ env: ENV.LOCAL,
+ streamOptions: { raw: true },
+ });
+```
+
+
+
+## Parameters
+
+| Param | Type | Default | Remarks |
+| --------------------------------------- | ------------------------------------------------- | ------------- | -------------------------------------------------------------------------------------- |
+| `signer` | `SignerType` | - | EthersV5 or Viem Signer. |
+| `options` \* | `PushAPIInitializeProps` | - | Optional configuration properties for initializing the PushAPI. |
+| `options.env` \* | `ENV` | `staging` | API env - 'prod', 'staging', 'dev'. |
+| `options.progressHook`\* | `(progress: ProgressHookType) => void` | - | A callback function to receive progress updates during initialization. |
+| `options.account` \* | `string` | - | The account to associate with the PushAPI. If not provided, it is derived from signer. |
+| `options.version` \* | `string` | `ENC_TYPE_V3` | The encryption version to use for the PushAPI. |
+| `options.versionMeta` \* | `{ NFTPGP_V1 ?: password: string }` | - | Metadata related to the encryption version, including a password if needed. |
+| `options.autoUpgrade` \* | `boolean` | `true` | If `true`, upgrades encryption keys to the latest encryption version. |
+| `options.origin` \* | `string` | - | Specify origin or source while creating a Push Profile. |
+| `options.streamOptions` \* | `PushStreamInitializeProps` | - | Configuration options for the stream. |
+| `options.streamOptions.listen` \* | `STREAM[]` | - | Specifies which streams to listen to. |
+| `options.streamOptions.filter` \* | `{ channels?: string[]; chats?: string[]; }` | - | Specifies which channels or chats to filter for. |
+| `options.streamOptions.connection` \* | `{ auto?: boolean; retries?: number; }` | - | Connection settings, including auto-connect and number of retries. |
+| `options.streamOptions.raw` \* | `boolean` | - | If set to `true`, will provide raw stream data. |
+| `options.streamOptions.enabled` \* | `boolean` | - | Specifies if the stream is enabled or not. |
+
+
+
+
+\* - Optional
+
+## STREAM Options
+
+| Option | Value |
+|-----------------------|------------------------|
+| `PROFILE` | `STREAM.PROFILE` |
+| `ENCRYPTION` | `STREAM.ENCRYPTION` |
+| `NOTIF` | `STREAM.NOTIF` |
+| `NOTIF_OPS` | `STREAM.NOTIF_OPS` |
+| `CHAT` | `STREAM.CHAT` |
+| `CHAT_OPS` | `STREAM.CHAT_OPS` |
-
---
-### **Fetch Group Info**
+### **Fetch Inbox Or Spam notifications**
+
+```tsx
+// lists feeds
+const aliceInfo = await userAlice.notification.list();
-```typescript
-// Fetch Group Info
-const fetchGroupInfo = await userAlice.chat.group.info(groupChatId);
```
-| Param | Type | Default | Remarks |
-| -------- | -------- | ------- | ------------ |
-| `chatId` | `string` | - | Group ChatId |
+**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
+ Expected response (Fetching user notifications)
- Expected response
```typescript
-{
- members: [
- {
- wallet: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTvNZgBCADeYpZfxgn1HoMUuWM42v8ZWfLPwglQYmzz5rY3PdPPoRFU\n' +
- 'v0AyPjYKpmLh2ZNfXjPaS9GuMdpXaomYSEwsV02hXZOQelo9cLop0Fc2i+l7\n' +
- '70rYhePuOuQ+XD/xYzhngAgNJ9rX96YnSodldb8uJfxYmgoF0E9Z2o2fgZGj\n' +
- 'll2CPnOaLXZaBQlPS3x/461TmZ1n2ZePS/fwiC7taLz3PtyGtKaC0vo4isvI\n' +
- 'yf04fkjudG0XIns5CWjdR2HeDC8BzSl8OVj8AQAc5uVU8Abk+ejWVr4zfoox\n' +
- 'eaziDPgGdkckFiQ6Tdsg0tPwwOpSrCCtJocTmc/fWaBb0YlnyAAL88fJABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZBMYqhmfI2WQQMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAACxNQf/UrM/whR7vCs+\n' +
- 'ez8Y8Hz4WqIuXtfMh4l2nKVv5UUuAfQkBxEY5j6Ga2+JgKU3neQ34x/v6fm9\n' +
- 'CLcY38Tc4AWyEx8KC78J+xOs7RMfyNBeiaf8KdaFfQrP0nMmufE6TxkfV1Y5\n' +
- 'LJZZ8350rZVtYJppWtlH+gbyUmMObyWDWbL3aWtqa3xjv0kLsf7TnugiFwzB\n' +
- 'gHHtk8tlDSOxRt0VdNNd19+/zrBYNl07Ig24WD2ETaJiaqa651z24/6/MkGT\n' +
- 'MBoQh+679tuWWcTrNi4jIA8jhSQ5BOgbAapl3qXk0m9/Aexpe2s6ISLXe8YJ\n' +
- 'j4cObDLv/ZKKeLZYTq9lVCydLAQUbs7ATQRk7zWYAQgAmx36uefgUF4cCSYH\n' +
- 'WMWAOTyc8Awo+hxn6FktOLU1+9hfGrX2jwGLOoOwjNgbYJbiSvRglAX2b57/\n' +
- 'qkkltAg1ZYCLSUzfBUbbWYlJNBwpv7+52zHaLUZ3gmI5aE48ad+uzaadgpVT\n' +
- 'VqLbhdgkN6jkemPTlfMehyS49AAbmqeKfo2U72tm9ZqT2cPVCASMjN/Ux2qG\n' +
- '3W8HTo0KIVFSbkTthl1zAlwAFksp0q437+pxbdJIecJ9mO6N4OQMnv+hVBDc\n' +
- 'WrPqBDJ0nas4JNgLxmLv0pheGg/TEfwS/p6xGRW5m08bj2l0cgqmEaM27jbi\n' +
- 'DEpOykRWsDMhheEfI2zV/Qam8QARAQABwsB2BBgBCAAqBYJk7zWYCZBMYqhm\n' +
- 'fI2WQQKbDBYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAAAnBggA1gkIopr9HJFP\n' +
- 'fO5SebcbowH4AG9M0qBqF4h1JIKbqvOnxLSsC5QmmzFcjS9ihyHBvzbRVGkC\n' +
- 'zEHYpLRedQ2AmQQfsf/VOoZJEOlb7tTk4+SpYtsGte5X/yLT5Bkls7Rp8ubK\n' +
- '/V99muj1nA/OkasllXQUSGEweVz6ejzJ0oMm3Vewmw8PelsdAnfS7Ud1MnXQ\n' +
- 'h+O8TCR56F5gAMWxZmxFpZMZyUFOH6KM+vL7HJUBztUS2g0ELsHKy9ep2yhv\n' +
- 'iABIwx/gEuPr0NDAH9x9XFKg5m3rO64KTY4BRWBISwmQ25dM1s1bwDPLi5XI\n' +
- '6Daw1glFxpPRrxgQGlVLzJOu5b8swQ==\n' +
- '=9hCc\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isAdmin: true,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzUlEQVR4AcXBsWlDMRiF0c8XTeAJPIAgoFbgQew1PIbXyKsyhUGtCqM6ZAJX6Z32fykM4hnuObv71++TYJRKlHtji1EqUe6NSJgJM2G2W74/nkzIvfHKKJUZwkyYCbOUe+Odcm/MEGbCTJil2/VMdLx8Eo1S2SL3RnS7nomEmTATZmm//BANKlHujS1GqUT7hRVhJsyEWWLSKJVXcm/MEGbCTJgl/sm9EY1SmTFKJcq9EY1SiYSZMBNm6XE6sHJhJffGOz1OByJhJsyE2R/3lDA4e9QQhAAAAABJRU5ErkJggg=='
- }
- ],
- pendingMembers: [
- {
- wallet: 'eip155:0x119bb8ad40B1f94e2b30ae5f59eeaEB67cD0Bd6C',
- publicKey: null,
- isAdmin: false,
- image: null
+// PushAPI.user.getFeeds | Response - 200 OK
+[
+ {
+ cta: 'https://idle.finance/#/governance/proposals',
+ title: 'New Proposal',
+ message:
+ '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' +
+ '\n' +
+ '[d:Proposal] : IIP-32: Add Euler staking PYT wrappers for AA tranche to IdleDAI\n' +
+ '[timestamp:1676570405.922][timestamp: 1676570405]',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeidgjepmup44yqmghcmmzp5aohj6yemjuwal3hozowp2mnxmtdjv5u/bafkreieqw4su7yuqf5ycow4ajpzjyimfl4umnnoe5fz2mq7ukrmqnesk2y',
+ url: 'https://idle.finance/',
+ sid: '3401597',
+ app: 'Idle Finance',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: {
+ body: 'New Proposal On Idle Finance',
+ title: 'Idle Finance - New Proposal',
},
- {
- wallet: 'eip155:0x6e0C509d14EbF26A529bf6DC5CC9bee7F5b8DBa4',
- publicKey: null,
- isAdmin: false,
- image: null
+ secret: '',
+ },
+ {
+ cta: '',
+ title: '',
+ message: 'hi socket',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeicahk2k5jcprepvqxl7xvh5ia4wyruikvpvcrel2rt7tsuefc7ktu/bafkreihjprcvuf2er5etxh7hsvslxzbntum5fqournkrsrtvhvppwx7jqy',
+ url: 'https://www.google.com/',
+ sid: '2491520',
+ app: 'AKP Test Channel',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: { body: 'hi socket', title: 'AKP Test Channel - ' },
+ secret: '',
+ },
+ {
+ cta: '',
+ title: '',
+ message: 'hiii',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeicahk2k5jcprepvqxl7xvh5ia4wyruikvpvcrel2rt7tsuefc7ktu/bafkreihjprcvuf2er5etxh7hsvslxzbntum5fqournkrsrtvhvppwx7jqy',
+ url: 'https://www.google.com/',
+ sid: '2490919',
+ app: 'AKP Test Channel',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: { body: 'hiii', title: 'AKP Test Channel - ' },
+ secret: '',
+ },
+ {
+ cta: '',
+ title: '',
+ message: 'Hey -testing',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeifvbiegzbgyoikdxe2rqhxf2uuvrqtfmllzy2ueidzyxnqkvkuizu/bafkreia26pvmuo2ugyub7boo2zxxj6dqhwqt3gcllpotmau3t7gsvy6vfq',
+ url: 'https://gnosis.io',
+ sid: '2429211',
+ app: 'Gnosis',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: { body: 'Hey -testing', title: 'Gnosis - ' },
+ secret: '',
+ },
+ {
+ cta: '',
+ title: '',
+ message: 'Hey',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeifvbiegzbgyoikdxe2rqhxf2uuvrqtfmllzy2ueidzyxnqkvkuizu/bafkreia26pvmuo2ugyub7boo2zxxj6dqhwqt3gcllpotmau3t7gsvy6vfq',
+ url: 'https://gnosis.io',
+ sid: '2429210',
+ app: 'Gnosis',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: { body: 'Hey', title: 'Gnosis - ' },
+ secret: '',
+ },
+ {
+ cta: 'https://idle.finance/#/governance/proposals',
+ title: 'New Proposal',
+ message:
+ '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' +
+ '\n' +
+ '[d:Proposal] : IIP-31: Add AA Euler staking PYT wrappers to IdleUSDT, IdleUSDC and IdleWETH. Gauges rate to 0. Extend LM. \n' +
+ '[timestamp:1674583206.258][timestamp: 1674583206]',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeidgjepmup44yqmghcmmzp5aohj6yemjuwal3hozowp2mnxmtdjv5u/bafkreieqw4su7yuqf5ycow4ajpzjyimfl4umnnoe5fz2mq7ukrmqnesk2y',
+ url: 'https://idle.finance/',
+ sid: '1784234',
+ app: 'Idle Finance',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: {
+ body: 'New Proposal On Idle Finance',
+ title: 'Idle Finance - New Proposal',
},
- {
- wallet: 'eip155:0xE3FDD0527a9F8418f9a7D9e970452827FbE202FF',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTvNZgBCADouo4S2kPqA//+I7nDAk15/LcJ2TGvDhOYuPNUNMiNGOb4\n' +
- 'txusuKz6HOaG+K9hiUBpHjKrYEmCT2FEXxt8bfS3SpWb74RHSkWUNUkxk25y\n' +
- 'gE5gaCKyAdcnOUyVLmobVFFYtH6naK9bULaUtkVik1P0iuEevWHxtTpsjbyH\n' +
- 'bZtNpVTdprdLib4Wx6bb7VogsvjlvNJcVJ4sfPE0XgsQgAGIev7yJyU0DGzt\n' +
- '/EbvFX4sv51Kb1dX9ctBcvzVbs9+qT6LTivsrQp+TNHUN4zEeMhnWFFP5K1d\n' +
- 'H445S6FWk53XvBudcOkFPtltU1MPCS6hmhevArBfYzy5eSlaKA/fH+kFABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZCrD2gy8Zu4awMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBKru9/u8wPcTeHibkasPaDLxm7hrAADa/Af+PbamVg/Ig2S2\n' +
- 'HgIy4w5x7ulSk1/49+AmuiUMiVUwJSVBhROsyDbLET56w4+1TIMYZFJaczW3\n' +
- '8tCvAOUSauzc52I3zwGmaCupBJokIWp7ncPh0B8TFYrgThgXV7sLf3xy4roy\n' +
- 'y8oFz1Zla88krwtPe4Az7TF+WNdXoDsLNJ3GXRmNqs1GITmDqAXFWncl12NM\n' +
- 'ajUKWIKc/Gi1oKfz22mabJTtWBimDpA12LaGK3GjEK5CiWXT3Tzlqn6R14EZ\n' +
- '6ohpKZldSJiMPL0Bu9iT52iHOsw1wTZNC1L5lKhOCi3c+/fLRcJZt3hdCjqy\n' +
- 'd/FSCa8/Ny/GrHBWoL49rSF4pDEA+s7ATQRk7zWYAQgAtNOoHCL7BCnjwp8O\n' +
- 'htTxEI5r7Q/1zKKHiz6QKjjrGBYyR6gcmPM3JNEcvzY4OsCFnKBv2suOgrqH\n' +
- '8kXJzfpIQ7u7uJs+O3p/cn86RMANiEnO8NbB/0scpfZ7Vg3eOfoiWYE4I/1o\n' +
- 'FVDCyZ1YVqtbcmuW6D8i1djjeoUmkUDZyPo7Qs6hUsJeYA/Rfl8mH5sjy2cN\n' +
- 'WXf8cEtOUqJtwERXt5aRB/nBZiC0bsP6hf0HtAoNA8/96TkqrcQpODW/RckD\n' +
- 'fo4wkpEONHRH+LGX7GV0pwymHu42TUnULmED6BrMgMYG2sKpxMThxtAxRaiP\n' +
- 'nZ3DKXr8GCjTYnbEZpoi2zKCOQARAQABwsB2BBgBCAAqBYJk7zWYCZCrD2gy\n' +
- '8Zu4awKbDBYhBKru9/u8wPcTeHibkasPaDLxm7hrAADGyQgA5NMUkoyDTPZa\n' +
- 'Znj1dB+17xBXCZ/u7pPQc1DukBefVke7/qYIicdnnEGIX3Zd7TckFRsDljR/\n' +
- '3418Bne4WyL57fAF/GgYsegpJ9n1KT7oPxWzibIaYdj7R6bkDt5r61EDWC3N\n' +
- 'VBbnZu9cO15TYkObJIiyNvwbQyd6Dm313b39GnEE8sM709TWsI6Es6rRZAfC\n' +
- '+sI8ezYxqVUbP7sW3jJZYzdPOhZPHvFd5iJ2EfygEOuk5tb7AimfNwF/CNcB\n' +
- 'weQGEU7feOSB9lXXA+Ag1duLM4B9bLbbHEQIPhKlBF1ED64e/W/5HNfoAkS4\n' +
- 'qhzOD5XWs6xs45nnYqUbBFLG9Xk+Jg==\n' +
- '=qtAv\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isAdmin: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsXECMRRF0csbdbAZBagHKlJMSOL90IUq2h5UABktLE6/HcizY4/fOafrcntzQB/BTKvBEcJMmAmz0keQtRpk67bzRQ1m1m0nu19E1keQCTNhJsxO1+X2JukjmHm+Ppg5Lw9mWg0yYSbMhFnhoPPy4C8JM2EmzArftBr8J2EmzIRZ6SPIWg2yPoKs1WCmjyBrNcj6CDJhJsyEWWk1OKKP4DdaDTJhJsyEWeEHrQbZuu3M3C/iCGEmzITZJ/s7LOkKUABjAAAAAElFTkSuQmCC'
- }
- ],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJk7zWZCZBMYqhmfI2WQRYhBC9DyzhpX3ACb/yTq0xiqGZ8\n' +
- 'jZZBAADwAwgAq/6WjtwRt1aPTLWwtSx80Ng/Wxf97dkpebMXSj9T7f5ia1rM\n' +
- '8wqsuNUDMEMPB9LM34f6Q5pD994oeN2YT7z34u20mskiNphZdx/DNvu8w9UZ\n' +
- 'rI3tyjfZULhARNVM34sSABnHtExbl4ZArhNDsT86ku0sZNjr9frn2mtgmlKN\n' +
- 'nQdGcLJSxbci0hFg3nE5mYNpwZNs2S/2uk11WHKxzMhII6AdePE77BKPqedu\n' +
- 'PiXDODO2dIvV8glLQoJPRPgc2ap+/xYIBUFljqHGPU/62VSLlHxBJv72p5s/\n' +
- 'kOxiqD42TmpaaMtfudqgsZsGoYpZDHcMKYGNZs+9qVRHPRD+s0QhEA==\n' +
- '=c6IF\n' +
- '-----END PGP SIGNATURE-----\n',
- groupImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- groupName: 'influential_maroon_gamefowl',
- groupDescription: 'urgent_brown_butterfly',
- isPublic: false,
- groupCreator: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
- chatId: '5f769c881ffe328117dea3d3acd0b97ce7f4c163e440f75a96be3e33f7d2a000',
- meta: null,
- scheduleAt: null,
- scheduleEnd: null,
- groupType: 'default',
- status: null,
- rules: {},
- eventType: 'create'
-}
+ secret: '',
+ },
+ {
+ cta: '',
+ title: '',
+ message: 'hi 2023',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeicahk2k5jcprepvqxl7xvh5ia4wyruikvpvcrel2rt7tsuefc7ktu/bafkreihjprcvuf2er5etxh7hsvslxzbntum5fqournkrsrtvhvppwx7jqy',
+ url: 'https://www.google.com/',
+ sid: '1132231',
+ app: 'AKP Test Channel',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: { body: 'hi 2023', title: 'AKP Test Channel - ' },
+ secret: '',
+ },
+ {
+ cta: '',
+ title: '',
+ message: 'hi',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeicahk2k5jcprepvqxl7xvh5ia4wyruikvpvcrel2rt7tsuefc7ktu/bafkreihjprcvuf2er5etxh7hsvslxzbntum5fqournkrsrtvhvppwx7jqy',
+ url: 'https://www.google.com/',
+ sid: '1132230',
+ app: 'AKP Test Channel',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: { body: 'hi', title: 'AKP Test Channel - ' },
+ secret: '',
+ },
+ {
+ cta: 'https://idle.finance/#/governance/proposals',
+ title: 'New Proposal',
+ message:
+ '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' +
+ '\n' +
+ '[d:Proposal] : IIP-30: Remove idleDAI wrapper for cpFOL-USDC (DAI) senior. Same for idleUSDC with cpWIN-USDC. Remove idleRAI, idleSUSD, idleTUSD and idleFEI from IdleController. Update voting delay in Governor \n' +
+ ' \n' +
+ '[timestamp:1672769747.911][timestamp: 1672769747]',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeidgjepmup44yqmghcmmzp5aohj6yemjuwal3hozowp2mnxmtdjv5u/bafkreieqw4su7yuqf5ycow4ajpzjyimfl4umnnoe5fz2mq7ukrmqnesk2y',
+ url: 'https://idle.finance/',
+ sid: '1080072',
+ app: 'Idle Finance',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: {
+ body: 'New Proposal On Idle Finance',
+ title: 'Idle Finance - New Proposal',
+ },
+ secret: '',
+ },
+ {
+ cta: 'https://idle.finance/#/governance/proposals',
+ title: 'New Proposal',
+ message:
+ '[d:Proposer] : 0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b\n' +
+ '\n' +
+ '[d:Proposal] : IIP-29: Remove idleDAI wrapper for cpFOL-USDC (DAI) senior. Same for idleUSDC with cpWIN-USDC. Remove idleRAI, idleSUSD, idleTUSD and idleFEI from IdleController. Update voting delay in Governor \n' +
+ ' \n' +
+ '[timestamp:1671624005.155][timestamp: 1671624005]',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeidgjepmup44yqmghcmmzp5aohj6yemjuwal3hozowp2mnxmtdjv5u/bafkreieqw4su7yuqf5ycow4ajpzjyimfl4umnnoe5fz2mq7ukrmqnesk2y',
+ url: 'https://idle.finance/',
+ sid: '935285',
+ app: 'Idle Finance',
+ image: '',
+ blockchain: 'ETH_TEST_GOERLI',
+ notification: {
+ body: 'New Proposal On Idle Finance',
+ title: 'Idle Finance - New Proposal',
+ },
+ secret: '',
+ },
+];
```
-| Parameter | Type | Remarks |
-| -------------------------- | --------------------- | -------------------------------------------------------------- |
-| `members` | `Array` | An array containing member objects. |
-| `members.wallet` | `string` | The wallet address of the member. |
-| `members.publicKey` | `string` | The member's public PGP key (if available). |
-| `members.isAdmin` | `boolean` | Indicates whether the member is an admin. |
-| `members.image` | `string` | Image associated with the member. |
-| `pendingMembers` | `Array` | An array containing pending member objects. |
-| `pendingMembers.wallet` | `string` | The wallet address of the pending member. |
-| `pendingMembers.publicKey` | `string` | The pending member's public PGP key (if available). |
-| `pendingMembers.isAdmin` | `boolean` | Indicates whether the pending member is an admin. |
-| `pendingMembers.image` | `string` | Image associated with the pending member. |
-| `contractAddressERC20` | `string` or `null` | Contract address for ERC20 tokens (Used for tokenGating). |
-| `numberOfERC20` | `number` | The number of ERC20 tokens associated. (Used for tokenGating). |
-| `contractAddressNFT` | `string` or `null` | Contract address for NFT tokens (Used for tokenGating) |
-| `numberOfNFTTokens` | `number` | The number of NFT tokens associated. (Used for tokenGating) |
-| `verificationProof` | `string` | Verification proof associated with group data. |
-| `groupImage` | `string` | Group's image. |
-| `groupName` | `string` | The name of the group. |
-| `groupDescription` | `string` | Description of the group. |
-| `isPublic` | `boolean` | Indicates whether the group is public or private. |
-| `groupCreator` | `string` | Push Profile DID of the group creator. |
-| `chatId` | `string` | Unique chat ID associated with the group. |
-| `meta` | `object` or `null` | Additional metadata (if available). |
-| `scheduleAt` | `timestamp` or `null` | Scheduled start time (if available). |
-| `scheduleEnd` | `timestamp` or `null` | Scheduled end time (if available). |
-| `groupType` | `string` | Type of the group (default, spaces, live etc). |
-| `status` | `string` or `null` | Status information ( active, expired etc) |
-| `rules` | `Object` | Group-specific moderation rules |
-| `eventType` | `string` | The type of event (create, update etc) |
-
---
-### **Fetch Group Permissions**
-
-```typescript
-// Fetch Group Permissions
-const fetchGroupPermissions = await userAlice.chat.group.permissions(
- groupChatId
-);
-```
+### **Fetch user subscriptions**
-| Param | Type | Default | Remarks |
-| -------- | -------- | ------- | ------------ |
-| `chatId` | `string` | - | Group ChatId |
-
-
-
- Expected response
+```tsx
+// fetches list of channels to which the user is subscribed
+const subscriptions = await userAlice.notification.subscriptions();
-```typescript
-{
- entry: true,
- chat: true,
- rules: { entry: { conditions: [] }, chat: { conditions: [] } }
-}
```
-| Param | Type | Remarks |
-| ------- | --------- | ----------------------------------------------------- |
-| `entry` | `boolean` | Refers if the Profile has access to enter the group |
-| `chat` | `boolean` | Refers if the Profile has access to chat in the group |
-| `rules` | `object` | Moderation rules of the group |
-
-
-
----
-
-### **Update Group**
-
-```typescript
-// Update Group Info
-const createdGroup = await userAlice.chat.group.create(groupChatId, {
- description: newGroupDescription,
- image: newGroupImage,
-});
-```
+**Parameters:**
-| Param | Type | Default | Remarks |
-| ------------------------ | ------------------ | ------- | ------------------------------------------ |
-| `chatId` | `string` | - | Unique identifier of the group. |
-| `options` \* | `object` | - | Optional Configuration for updating group. |
-| `options.name` \* | `string` | - | Updated Group Name |
-| `options.description` \* | `string` | - | Updated Description |
-| `options.image` \* | `string` | - | Updated Image |
-| `options.scheduleAt` \* | `date` or `null` | - | Updated Start Schedule |
-| `options.scheduleEnd` \* | `date` or `null` | - | Updated End Schedule |
-| `options.status` \* | `string` or `null` | - | Updated group Status |
-| `options.meta` \* | `object` or `null` | - | Updated Group Meta |
-| `options.rules` \* | `object` | - | Updated Group Moderation Rules |
+| 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
-
- Expected response
+ Expected response (Fetching user opted in channels / subscriptions)
```typescript
-{
- members: [
- {
- wallet: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTvNZgBCADeYpZfxgn1HoMUuWM42v8ZWfLPwglQYmzz5rY3PdPPoRFU\n' +
- 'v0AyPjYKpmLh2ZNfXjPaS9GuMdpXaomYSEwsV02hXZOQelo9cLop0Fc2i+l7\n' +
- '70rYhePuOuQ+XD/xYzhngAgNJ9rX96YnSodldb8uJfxYmgoF0E9Z2o2fgZGj\n' +
- 'll2CPnOaLXZaBQlPS3x/461TmZ1n2ZePS/fwiC7taLz3PtyGtKaC0vo4isvI\n' +
- 'yf04fkjudG0XIns5CWjdR2HeDC8BzSl8OVj8AQAc5uVU8Abk+ejWVr4zfoox\n' +
- 'eaziDPgGdkckFiQ6Tdsg0tPwwOpSrCCtJocTmc/fWaBb0YlnyAAL88fJABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZBMYqhmfI2WQQMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAACxNQf/UrM/whR7vCs+\n' +
- 'ez8Y8Hz4WqIuXtfMh4l2nKVv5UUuAfQkBxEY5j6Ga2+JgKU3neQ34x/v6fm9\n' +
- 'CLcY38Tc4AWyEx8KC78J+xOs7RMfyNBeiaf8KdaFfQrP0nMmufE6TxkfV1Y5\n' +
- 'LJZZ8350rZVtYJppWtlH+gbyUmMObyWDWbL3aWtqa3xjv0kLsf7TnugiFwzB\n' +
- 'gHHtk8tlDSOxRt0VdNNd19+/zrBYNl07Ig24WD2ETaJiaqa651z24/6/MkGT\n' +
- 'MBoQh+679tuWWcTrNi4jIA8jhSQ5BOgbAapl3qXk0m9/Aexpe2s6ISLXe8YJ\n' +
- 'j4cObDLv/ZKKeLZYTq9lVCydLAQUbs7ATQRk7zWYAQgAmx36uefgUF4cCSYH\n' +
- 'WMWAOTyc8Awo+hxn6FktOLU1+9hfGrX2jwGLOoOwjNgbYJbiSvRglAX2b57/\n' +
- 'qkkltAg1ZYCLSUzfBUbbWYlJNBwpv7+52zHaLUZ3gmI5aE48ad+uzaadgpVT\n' +
- 'VqLbhdgkN6jkemPTlfMehyS49AAbmqeKfo2U72tm9ZqT2cPVCASMjN/Ux2qG\n' +
- '3W8HTo0KIVFSbkTthl1zAlwAFksp0q437+pxbdJIecJ9mO6N4OQMnv+hVBDc\n' +
- 'WrPqBDJ0nas4JNgLxmLv0pheGg/TEfwS/p6xGRW5m08bj2l0cgqmEaM27jbi\n' +
- 'DEpOykRWsDMhheEfI2zV/Qam8QARAQABwsB2BBgBCAAqBYJk7zWYCZBMYqhm\n' +
- 'fI2WQQKbDBYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAAAnBggA1gkIopr9HJFP\n' +
- 'fO5SebcbowH4AG9M0qBqF4h1JIKbqvOnxLSsC5QmmzFcjS9ihyHBvzbRVGkC\n' +
- 'zEHYpLRedQ2AmQQfsf/VOoZJEOlb7tTk4+SpYtsGte5X/yLT5Bkls7Rp8ubK\n' +
- '/V99muj1nA/OkasllXQUSGEweVz6ejzJ0oMm3Vewmw8PelsdAnfS7Ud1MnXQ\n' +
- 'h+O8TCR56F5gAMWxZmxFpZMZyUFOH6KM+vL7HJUBztUS2g0ELsHKy9ep2yhv\n' +
- 'iABIwx/gEuPr0NDAH9x9XFKg5m3rO64KTY4BRWBISwmQ25dM1s1bwDPLi5XI\n' +
- '6Daw1glFxpPRrxgQGlVLzJOu5b8swQ==\n' +
- '=9hCc\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isAdmin: true,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzUlEQVR4AcXBsWlDMRiF0c8XTeAJPIAgoFbgQew1PIbXyKsyhUGtCqM6ZAJX6Z32fykM4hnuObv71++TYJRKlHtji1EqUe6NSJgJM2G2W74/nkzIvfHKKJUZwkyYCbOUe+Odcm/MEGbCTJil2/VMdLx8Eo1S2SL3RnS7nomEmTATZmm//BANKlHujS1GqUT7hRVhJsyEWWLSKJVXcm/MEGbCTJgl/sm9EY1SmTFKJcq9EY1SiYSZMBNm6XE6sHJhJffGOz1OByJhJsyE2R/3lDA4e9QQhAAAAABJRU5ErkJggg=='
- }
- ],
- pendingMembers: [
- {
- wallet: 'eip155:0x119bb8ad40B1f94e2b30ae5f59eeaEB67cD0Bd6C',
- publicKey: null,
- isAdmin: false,
- image: null
- },
- {
- wallet: 'eip155:0x6e0C509d14EbF26A529bf6DC5CC9bee7F5b8DBa4',
- publicKey: null,
- isAdmin: false,
- image: null
- },
- {
- wallet: 'eip155:0xE3FDD0527a9F8418f9a7D9e970452827FbE202FF',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTvNZgBCADouo4S2kPqA//+I7nDAk15/LcJ2TGvDhOYuPNUNMiNGOb4\n' +
- 'txusuKz6HOaG+K9hiUBpHjKrYEmCT2FEXxt8bfS3SpWb74RHSkWUNUkxk25y\n' +
- 'gE5gaCKyAdcnOUyVLmobVFFYtH6naK9bULaUtkVik1P0iuEevWHxtTpsjbyH\n' +
- 'bZtNpVTdprdLib4Wx6bb7VogsvjlvNJcVJ4sfPE0XgsQgAGIev7yJyU0DGzt\n' +
- '/EbvFX4sv51Kb1dX9ctBcvzVbs9+qT6LTivsrQp+TNHUN4zEeMhnWFFP5K1d\n' +
- 'H445S6FWk53XvBudcOkFPtltU1MPCS6hmhevArBfYzy5eSlaKA/fH+kFABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZCrD2gy8Zu4awMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBKru9/u8wPcTeHibkasPaDLxm7hrAADa/Af+PbamVg/Ig2S2\n' +
- 'HgIy4w5x7ulSk1/49+AmuiUMiVUwJSVBhROsyDbLET56w4+1TIMYZFJaczW3\n' +
- '8tCvAOUSauzc52I3zwGmaCupBJokIWp7ncPh0B8TFYrgThgXV7sLf3xy4roy\n' +
- 'y8oFz1Zla88krwtPe4Az7TF+WNdXoDsLNJ3GXRmNqs1GITmDqAXFWncl12NM\n' +
- 'ajUKWIKc/Gi1oKfz22mabJTtWBimDpA12LaGK3GjEK5CiWXT3Tzlqn6R14EZ\n' +
- '6ohpKZldSJiMPL0Bu9iT52iHOsw1wTZNC1L5lKhOCi3c+/fLRcJZt3hdCjqy\n' +
- 'd/FSCa8/Ny/GrHBWoL49rSF4pDEA+s7ATQRk7zWYAQgAtNOoHCL7BCnjwp8O\n' +
- 'htTxEI5r7Q/1zKKHiz6QKjjrGBYyR6gcmPM3JNEcvzY4OsCFnKBv2suOgrqH\n' +
- '8kXJzfpIQ7u7uJs+O3p/cn86RMANiEnO8NbB/0scpfZ7Vg3eOfoiWYE4I/1o\n' +
- 'FVDCyZ1YVqtbcmuW6D8i1djjeoUmkUDZyPo7Qs6hUsJeYA/Rfl8mH5sjy2cN\n' +
- 'WXf8cEtOUqJtwERXt5aRB/nBZiC0bsP6hf0HtAoNA8/96TkqrcQpODW/RckD\n' +
- 'fo4wkpEONHRH+LGX7GV0pwymHu42TUnULmED6BrMgMYG2sKpxMThxtAxRaiP\n' +
- 'nZ3DKXr8GCjTYnbEZpoi2zKCOQARAQABwsB2BBgBCAAqBYJk7zWYCZCrD2gy\n' +
- '8Zu4awKbDBYhBKru9/u8wPcTeHibkasPaDLxm7hrAADGyQgA5NMUkoyDTPZa\n' +
- 'Znj1dB+17xBXCZ/u7pPQc1DukBefVke7/qYIicdnnEGIX3Zd7TckFRsDljR/\n' +
- '3418Bne4WyL57fAF/GgYsegpJ9n1KT7oPxWzibIaYdj7R6bkDt5r61EDWC3N\n' +
- 'VBbnZu9cO15TYkObJIiyNvwbQyd6Dm313b39GnEE8sM709TWsI6Es6rRZAfC\n' +
- '+sI8ezYxqVUbP7sW3jJZYzdPOhZPHvFd5iJ2EfygEOuk5tb7AimfNwF/CNcB\n' +
- 'weQGEU7feOSB9lXXA+Ag1duLM4B9bLbbHEQIPhKlBF1ED64e/W/5HNfoAkS4\n' +
- 'qhzOD5XWs6xs45nnYqUbBFLG9Xk+Jg==\n' +
- '=qtAv\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isAdmin: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsXECMRRF0csbdbAZBagHKlJMSOL90IUq2h5UABktLE6/HcizY4/fOafrcntzQB/BTKvBEcJMmAmz0keQtRpk67bzRQ1m1m0nu19E1keQCTNhJsxO1+X2JukjmHm+Ppg5Lw9mWg0yYSbMhFnhoPPy4C8JM2EmzArftBr8J2EmzIRZ6SPIWg2yPoKs1WCmjyBrNcj6CDJhJsyEWWk1OKKP4DdaDTJhJsyEWeEHrQbZuu3M3C/iCGEmzITZJ/s7LOkKUABjAAAAAElFTkSuQmCC'
- }
- ],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJk7zWZCZBMYqhmfI2WQRYhBC9DyzhpX3ACb/yTq0xiqGZ8\n' +
- 'jZZBAADwAwgAq/6WjtwRt1aPTLWwtSx80Ng/Wxf97dkpebMXSj9T7f5ia1rM\n' +
- '8wqsuNUDMEMPB9LM34f6Q5pD994oeN2YT7z34u20mskiNphZdx/DNvu8w9UZ\n' +
- 'rI3tyjfZULhARNVM34sSABnHtExbl4ZArhNDsT86ku0sZNjr9frn2mtgmlKN\n' +
- 'nQdGcLJSxbci0hFg3nE5mYNpwZNs2S/2uk11WHKxzMhII6AdePE77BKPqedu\n' +
- 'PiXDODO2dIvV8glLQoJPRPgc2ap+/xYIBUFljqHGPU/62VSLlHxBJv72p5s/\n' +
- 'kOxiqD42TmpaaMtfudqgsZsGoYpZDHcMKYGNZs+9qVRHPRD+s0QhEA==\n' +
- '=c6IF\n' +
- '-----END PGP SIGNATURE-----\n',
- groupImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- groupName: 'influential_maroon_gamefowl',
- groupDescription: 'urgent_brown_butterfly',
- isPublic: false,
- groupCreator: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
- chatId: '5f769c881ffe328117dea3d3acd0b97ce7f4c163e440f75a96be3e33f7d2a000',
- meta: null,
- scheduleAt: null,
- scheduleEnd: null,
- groupType: 'default',
- status: null,
- rules: {},
- eventType: 'update'
-}
+// PushAPI.user.getSubscriptions | Response - 200 OK
+[
+ { channel: '0x0000000000000000000000000000000000000000',user_settings: null },
+ { channel: '0xa3B6712fB922cdbbdce9AB22571e75d0d81B3b00',user_settings: '[{"type": 1, "user": false, "index": 1, "default": false, "description": "test1"}, {"type": 2, "user": 25, "index": 2, "default": 25, "enabled": 1, "lowerLimit": 23, "upperLimit": 35, "description": "test3"}, {"type": 2, "user": 64, "index": 3, "default": 56, "enabled": 1, "lowerLimit": 43, "upperLimit": 78, "description": "test5"}]' },
+ { channel: '0xde3aEA26fDC3ADdC1dB32baf1a058Cf0878FEac1',user_settings: null },
+ { channel: '0x69e666767Ba3a661369e1e2F572EdE7ADC926029',user_settings: null },
+ { channel: '0x466AEEf0943C5F098dBcEf3c1eEC03322E1F97eD',user_settings: null },
+ { channel: '0xcE98113b998380729B04596e3eA0255fbA138D34',user_settings: null },
+ { channel: '0xa89523351BE1e2De64937AA9AF61Ae06eAd199C7',user_settings: null },
+ { channel: '0x0a651cF7A9b60082fecdb5f30DB7914Fd7d2cf93',user_settings: null },
+ { channel: '0x0b5E9fa12C4C1946fA2f14b7271cC60541508f23',user_settings: null },
+ { channel: '0x2AEcb6DeE3652dA1dD6b54D5fd4f7D8F43DaEb78',user_settings: null },
+ { channel: '0xcB6C7b2E340D50701d45d55507f19A5cE5d72330',user_settings: null },
+ { channel: '0xB59Cdc85Cacd15097ecE4C77ed9D225014b4D56D',user_settings: null },
+ { channel: '0xA5E269eec042Bf61183DEf9911D03359597494b7',user_settings: null },
+ { channel: '0x6bf1ee9DE5D11Fa558c1FA8D8855E26C38Fa582A',user_settings: null },
+ { channel: '0x72Ac64A3aE0ab60D725980b73Ef460ED9e742cc7',user_settings: null },
+ { channel: '0xEc6CbD318CB7BA8a0fBbffF697681C0a4ADA0349',user_settings: null },
+ { channel: '0xAb9415961F58eBD6d79029bC76F261Fa65a80D3D',user_settings: null },
+ { channel: '0x08D77bD7500a07d791dD1323919C22e1FDb72224',user_settings: null },
+ { channel: '0xa1016081D6Da53b4246178eD83922C55F7171e54',user_settings: null },
+ { channel: '0x6A06014AC6BdE2906D194e63ec3b1B5B4c9C2Abb',user_settings: null },
+ { channel: '0xf69389475E082f4BeFDb9dee4a1E9fe6cd29f6e7',user_settings: null },
+ { channel: '0x9601f08b9EcB981D273B72e7f33964Cb98f977fe',user_settings: null },
+ { channel: '0x47A2910432016CA9f62B20dCE09b89d357d0c3d7',user_settings: null },
+ { channel: '0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924',user_settings: null },
+ { channel: '0x14c0157f9eEA7AEe61ba2606E75716E210b4697a',user_settings: null },
+ { channel: '0x025846389950A13292E63e4794C7D148FF57F995',user_settings: null },
+ { channel: '0x2aecb6dee3652da1dd6b54d5fd4f7d8f43daeb77',user_settings: null },
+ { channel: '0xD8634C39BBFd4033c0d3289C4515275102423681',user_settings: null },
+ { channel: '0x19fB80f16EAFCfb5BBFa07451CC5694E8932EA52',user_settings: null },
+ { channel: '0x94c3016ef3e503774630fC71F59B8Da9f7D470B7',user_settings: null },
+]
```
-| Parameter | Type | Remarks |
-| -------------------------- | --------------------- | -------------------------------------------------------------- |
-| `members` | `Array` | An array containing member objects. |
-| `members.wallet` | `string` | The wallet address of the member. |
-| `members.publicKey` | `string` | The member's public PGP key (if available). |
-| `members.isAdmin` | `boolean` | Indicates whether the member is an admin. |
-| `members.image` | `string` | Image associated with the member. |
-| `pendingMembers` | `Array` | An array containing pending member objects. |
-| `pendingMembers.wallet` | `string` | The wallet address of the pending member. |
-| `pendingMembers.publicKey` | `string` | The pending member's public PGP key (if available). |
-| `pendingMembers.isAdmin` | `boolean` | Indicates whether the pending member is an admin. |
-| `pendingMembers.image` | `string` | Image associated with the pending member. |
-| `contractAddressERC20` | `string` or `null` | Contract address for ERC20 tokens (Used for tokenGating). |
-| `numberOfERC20` | `number` | The number of ERC20 tokens associated. (Used for tokenGating). |
-| `contractAddressNFT` | `string` or `null` | Contract address for NFT tokens (Used for tokenGating) |
-| `numberOfNFTTokens` | `number` | The number of NFT tokens associated. (Used for tokenGating) |
-| `verificationProof` | `string` | Verification proof associated with group data. |
-| `groupImage` | `string` | Group's image. |
-| `groupName` | `string` | The name of the group. |
-| `groupDescription` | `string` | Description of the group. |
-| `isPublic` | `boolean` | Indicates whether the group is public or private. |
-| `groupCreator` | `string` | Push Profile DID of the group creator. |
-| `chatId` | `string` | Unique chat ID associated with the group. |
-| `meta` | `object` or `null` | Additional metadata (if available). |
-| `scheduleAt` | `timestamp` or `null` | Scheduled start time (if available). |
-| `scheduleEnd` | `timestamp` or `null` | Scheduled end time (if available). |
-| `groupType` | `string` | Type of the group (default, spaces, live etc). |
-| `status` | `string` or `null` | Status information ( active, expired etc) |
-| `rules` | `Object` | Group-specific moderation rules |
-| `eventType` | `string` | The type of event (create, update etc) |
-
---
-### **Add To Group**
+### **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
+
+
+ Expected response (Opt in to channel)
```typescript
-// Add Member To Group
-const addMemberToGroup = await userAlice.chat.group.add(groupChatId, {
- role : 'MEMBER'
- accounts: [account1, account2]
-});
+// PushAPI.channels.subscribe | Response - 204
+{ status: 204, message: 'successfully opted into channel' }
-// Add Admin To Group
-const addAdminToGroup = await userAlice.chat.group.add(groupChatId, {
- role : 'ADMIN'
- accounts: [account1, account2]
-});
```
-| Param | Type | Default | Remarks |
-| ------------------ | ------------------- | ------- | ----------------------------------------------- |
-| `chatId` | `string` | - | Unique identifier of the group. |
-| `options` | `object` | - | Configuration for adding participants to group. |
-| `options.role` | `ADMIN` or `MEMBER` | - | Role of added participant |
-| `options.accounts` | `string[]` | - | Added participant addresses |
+
+
+---
+
+### **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
+ Expected response (Opt out of a channel)
- Expected response
+```typescript
+// PushAPI.channels.unsubscribe | Response - 204
+{ status: 204, message: 'successfully opted out channel' }
+```
+
+
+
+---
+
+### **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
+
+
+ Expected response (Fetching channel details)
```typescript
+// PushAPI.channels.getChannel | Response - 200 OK
{
- members: [
- {
- wallet: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTvNZgBCADeYpZfxgn1HoMUuWM42v8ZWfLPwglQYmzz5rY3PdPPoRFU\n' +
- 'v0AyPjYKpmLh2ZNfXjPaS9GuMdpXaomYSEwsV02hXZOQelo9cLop0Fc2i+l7\n' +
- '70rYhePuOuQ+XD/xYzhngAgNJ9rX96YnSodldb8uJfxYmgoF0E9Z2o2fgZGj\n' +
- 'll2CPnOaLXZaBQlPS3x/461TmZ1n2ZePS/fwiC7taLz3PtyGtKaC0vo4isvI\n' +
- 'yf04fkjudG0XIns5CWjdR2HeDC8BzSl8OVj8AQAc5uVU8Abk+ejWVr4zfoox\n' +
- 'eaziDPgGdkckFiQ6Tdsg0tPwwOpSrCCtJocTmc/fWaBb0YlnyAAL88fJABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZBMYqhmfI2WQQMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAACxNQf/UrM/whR7vCs+\n' +
- 'ez8Y8Hz4WqIuXtfMh4l2nKVv5UUuAfQkBxEY5j6Ga2+JgKU3neQ34x/v6fm9\n' +
- 'CLcY38Tc4AWyEx8KC78J+xOs7RMfyNBeiaf8KdaFfQrP0nMmufE6TxkfV1Y5\n' +
- 'LJZZ8350rZVtYJppWtlH+gbyUmMObyWDWbL3aWtqa3xjv0kLsf7TnugiFwzB\n' +
- 'gHHtk8tlDSOxRt0VdNNd19+/zrBYNl07Ig24WD2ETaJiaqa651z24/6/MkGT\n' +
- 'MBoQh+679tuWWcTrNi4jIA8jhSQ5BOgbAapl3qXk0m9/Aexpe2s6ISLXe8YJ\n' +
- 'j4cObDLv/ZKKeLZYTq9lVCydLAQUbs7ATQRk7zWYAQgAmx36uefgUF4cCSYH\n' +
- 'WMWAOTyc8Awo+hxn6FktOLU1+9hfGrX2jwGLOoOwjNgbYJbiSvRglAX2b57/\n' +
- 'qkkltAg1ZYCLSUzfBUbbWYlJNBwpv7+52zHaLUZ3gmI5aE48ad+uzaadgpVT\n' +
- 'VqLbhdgkN6jkemPTlfMehyS49AAbmqeKfo2U72tm9ZqT2cPVCASMjN/Ux2qG\n' +
- '3W8HTo0KIVFSbkTthl1zAlwAFksp0q437+pxbdJIecJ9mO6N4OQMnv+hVBDc\n' +
- 'WrPqBDJ0nas4JNgLxmLv0pheGg/TEfwS/p6xGRW5m08bj2l0cgqmEaM27jbi\n' +
- 'DEpOykRWsDMhheEfI2zV/Qam8QARAQABwsB2BBgBCAAqBYJk7zWYCZBMYqhm\n' +
- 'fI2WQQKbDBYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAAAnBggA1gkIopr9HJFP\n' +
- 'fO5SebcbowH4AG9M0qBqF4h1JIKbqvOnxLSsC5QmmzFcjS9ihyHBvzbRVGkC\n' +
- 'zEHYpLRedQ2AmQQfsf/VOoZJEOlb7tTk4+SpYtsGte5X/yLT5Bkls7Rp8ubK\n' +
- '/V99muj1nA/OkasllXQUSGEweVz6ejzJ0oMm3Vewmw8PelsdAnfS7Ud1MnXQ\n' +
- 'h+O8TCR56F5gAMWxZmxFpZMZyUFOH6KM+vL7HJUBztUS2g0ELsHKy9ep2yhv\n' +
- 'iABIwx/gEuPr0NDAH9x9XFKg5m3rO64KTY4BRWBISwmQ25dM1s1bwDPLi5XI\n' +
- '6Daw1glFxpPRrxgQGlVLzJOu5b8swQ==\n' +
- '=9hCc\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isAdmin: true,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzUlEQVR4AcXBsWlDMRiF0c8XTeAJPIAgoFbgQew1PIbXyKsyhUGtCqM6ZAJX6Z32fykM4hnuObv71++TYJRKlHtji1EqUe6NSJgJM2G2W74/nkzIvfHKKJUZwkyYCbOUe+Odcm/MEGbCTJil2/VMdLx8Eo1S2SL3RnS7nomEmTATZmm//BANKlHujS1GqUT7hRVhJsyEWWLSKJVXcm/MEGbCTJgl/sm9EY1SmTFKJcq9EY1SiYSZMBNm6XE6sHJhJffGOz1OByJhJsyE2R/3lDA4e9QQhAAAAABJRU5ErkJggg=='
- }
- ],
- pendingMembers: [
- {
- wallet: 'eip155:0x119bb8ad40B1f94e2b30ae5f59eeaEB67cD0Bd6C',
- publicKey: null,
- isAdmin: false,
- image: null
- },
- {
- wallet: 'eip155:0x6e0C509d14EbF26A529bf6DC5CC9bee7F5b8DBa4',
- publicKey: null,
- isAdmin: false,
- image: null
- },
- {
- wallet: 'eip155:0xE3FDD0527a9F8418f9a7D9e970452827FbE202FF',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTvNZgBCADouo4S2kPqA//+I7nDAk15/LcJ2TGvDhOYuPNUNMiNGOb4\n' +
- 'txusuKz6HOaG+K9hiUBpHjKrYEmCT2FEXxt8bfS3SpWb74RHSkWUNUkxk25y\n' +
- 'gE5gaCKyAdcnOUyVLmobVFFYtH6naK9bULaUtkVik1P0iuEevWHxtTpsjbyH\n' +
- 'bZtNpVTdprdLib4Wx6bb7VogsvjlvNJcVJ4sfPE0XgsQgAGIev7yJyU0DGzt\n' +
- '/EbvFX4sv51Kb1dX9ctBcvzVbs9+qT6LTivsrQp+TNHUN4zEeMhnWFFP5K1d\n' +
- 'H445S6FWk53XvBudcOkFPtltU1MPCS6hmhevArBfYzy5eSlaKA/fH+kFABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZCrD2gy8Zu4awMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBKru9/u8wPcTeHibkasPaDLxm7hrAADa/Af+PbamVg/Ig2S2\n' +
- 'HgIy4w5x7ulSk1/49+AmuiUMiVUwJSVBhROsyDbLET56w4+1TIMYZFJaczW3\n' +
- '8tCvAOUSauzc52I3zwGmaCupBJokIWp7ncPh0B8TFYrgThgXV7sLf3xy4roy\n' +
- 'y8oFz1Zla88krwtPe4Az7TF+WNdXoDsLNJ3GXRmNqs1GITmDqAXFWncl12NM\n' +
- 'ajUKWIKc/Gi1oKfz22mabJTtWBimDpA12LaGK3GjEK5CiWXT3Tzlqn6R14EZ\n' +
- '6ohpKZldSJiMPL0Bu9iT52iHOsw1wTZNC1L5lKhOCi3c+/fLRcJZt3hdCjqy\n' +
- 'd/FSCa8/Ny/GrHBWoL49rSF4pDEA+s7ATQRk7zWYAQgAtNOoHCL7BCnjwp8O\n' +
- 'htTxEI5r7Q/1zKKHiz6QKjjrGBYyR6gcmPM3JNEcvzY4OsCFnKBv2suOgrqH\n' +
- '8kXJzfpIQ7u7uJs+O3p/cn86RMANiEnO8NbB/0scpfZ7Vg3eOfoiWYE4I/1o\n' +
- 'FVDCyZ1YVqtbcmuW6D8i1djjeoUmkUDZyPo7Qs6hUsJeYA/Rfl8mH5sjy2cN\n' +
- 'WXf8cEtOUqJtwERXt5aRB/nBZiC0bsP6hf0HtAoNA8/96TkqrcQpODW/RckD\n' +
- 'fo4wkpEONHRH+LGX7GV0pwymHu42TUnULmED6BrMgMYG2sKpxMThxtAxRaiP\n' +
- 'nZ3DKXr8GCjTYnbEZpoi2zKCOQARAQABwsB2BBgBCAAqBYJk7zWYCZCrD2gy\n' +
- '8Zu4awKbDBYhBKru9/u8wPcTeHibkasPaDLxm7hrAADGyQgA5NMUkoyDTPZa\n' +
- 'Znj1dB+17xBXCZ/u7pPQc1DukBefVke7/qYIicdnnEGIX3Zd7TckFRsDljR/\n' +
- '3418Bne4WyL57fAF/GgYsegpJ9n1KT7oPxWzibIaYdj7R6bkDt5r61EDWC3N\n' +
- 'VBbnZu9cO15TYkObJIiyNvwbQyd6Dm313b39GnEE8sM709TWsI6Es6rRZAfC\n' +
- '+sI8ezYxqVUbP7sW3jJZYzdPOhZPHvFd5iJ2EfygEOuk5tb7AimfNwF/CNcB\n' +
- 'weQGEU7feOSB9lXXA+Ag1duLM4B9bLbbHEQIPhKlBF1ED64e/W/5HNfoAkS4\n' +
- 'qhzOD5XWs6xs45nnYqUbBFLG9Xk+Jg==\n' +
- '=qtAv\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isAdmin: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsXECMRRF0csbdbAZBagHKlJMSOL90IUq2h5UABktLE6/HcizY4/fOafrcntzQB/BTKvBEcJMmAmz0keQtRpk67bzRQ1m1m0nu19E1keQCTNhJsxO1+X2JukjmHm+Ppg5Lw9mWg0yYSbMhFnhoPPy4C8JM2EmzArftBr8J2EmzIRZ6SPIWg2yPoKs1WCmjyBrNcj6CDJhJsyEWWk1OKKP4DdaDTJhJsyEWeEHrQbZuu3M3C/iCGEmzITZJ/s7LOkKUABjAAAAAElFTkSuQmCC'
- }
- ],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJk7zWZCZBMYqhmfI2WQRYhBC9DyzhpX3ACb/yTq0xiqGZ8\n' +
- 'jZZBAADwAwgAq/6WjtwRt1aPTLWwtSx80Ng/Wxf97dkpebMXSj9T7f5ia1rM\n' +
- '8wqsuNUDMEMPB9LM34f6Q5pD994oeN2YT7z34u20mskiNphZdx/DNvu8w9UZ\n' +
- 'rI3tyjfZULhARNVM34sSABnHtExbl4ZArhNDsT86ku0sZNjr9frn2mtgmlKN\n' +
- 'nQdGcLJSxbci0hFg3nE5mYNpwZNs2S/2uk11WHKxzMhII6AdePE77BKPqedu\n' +
- 'PiXDODO2dIvV8glLQoJPRPgc2ap+/xYIBUFljqHGPU/62VSLlHxBJv72p5s/\n' +
- 'kOxiqD42TmpaaMtfudqgsZsGoYpZDHcMKYGNZs+9qVRHPRD+s0QhEA==\n' +
- '=c6IF\n' +
- '-----END PGP SIGNATURE-----\n',
- groupImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- groupName: 'influential_maroon_gamefowl',
- groupDescription: 'urgent_brown_butterfly',
- isPublic: false,
- groupCreator: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
- chatId: '5f769c881ffe328117dea3d3acd0b97ce7f4c163e440f75a96be3e33f7d2a000',
- meta: null,
- scheduleAt: null,
- scheduleEnd: null,
- groupType: 'default',
- status: null,
- rules: {},
- eventType: 'update'
+ id: 39,
+ channel: '0xD8634C39BBFd4033c0d3289C4515275102423681',
+ ipfshash: 'bafkreia26pvmuo2ugyub7boo2zxxj6dqhwqt3gcllpotmau3t7gsvy6vfq',
+ name: 'Gnosis',
+ info: 'Gnosis builds new market mechanisms for decentralized finance.\n',
+ url: 'https://gnosis.io',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeifvbiegzbgyoikdxe2rqhxf2uuvrqtfmllzy2ueidzyxnqkvkuizu/bafkreia26pvmuo2ugyub7boo2zxxj6dqhwqt3gcllpotmau3t7gsvy6vfq',
+ processed: 1,
+ attempts: 0,
+ alias_address: '0xD8634C39BBFd4033c0d3289C4515275102423681',
+ alias_verification_event: null,
+ is_alias_verified: 1,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-02-07T16:29:27.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null
}
```
-
-| Parameter | Type | Remarks |
-| -------------------------- | --------------------- | -------------------------------------------------------------- |
-| `members` | `Array` | An array containing member objects. |
-| `members.wallet` | `string` | The wallet address of the member. |
-| `members.publicKey` | `string` | The member's public PGP key (if available). |
-| `members.isAdmin` | `boolean` | Indicates whether the member is an admin. |
-| `members.image` | `string` | Image associated with the member. |
-| `pendingMembers` | `Array` | An array containing pending member objects. |
-| `pendingMembers.wallet` | `string` | The wallet address of the pending member. |
-| `pendingMembers.publicKey` | `string` | The pending member's public PGP key (if available). |
-| `pendingMembers.isAdmin` | `boolean` | Indicates whether the pending member is an admin. |
-| `pendingMembers.image` | `string` | Image associated with the pending member. |
-| `contractAddressERC20` | `string` or `null` | Contract address for ERC20 tokens (Used for tokenGating). |
-| `numberOfERC20` | `number` | The number of ERC20 tokens associated. (Used for tokenGating). |
-| `contractAddressNFT` | `string` or `null` | Contract address for NFT tokens (Used for tokenGating) |
-| `numberOfNFTTokens` | `number` | The number of NFT tokens associated. (Used for tokenGating) |
-| `verificationProof` | `string` | Verification proof associated with group data. |
-| `groupImage` | `string` | Group's image. |
-| `groupName` | `string` | The name of the group. |
-| `groupDescription` | `string` | Description of the group. |
-| `isPublic` | `boolean` | Indicates whether the group is public or private. |
-| `groupCreator` | `string` | Push Profile DID of the group creator. |
-| `chatId` | `string` | Unique chat ID associated with the group. |
-| `meta` | `object` or `null` | Additional metadata (if available). |
-| `scheduleAt` | `timestamp` or `null` | Scheduled start time (if available). |
-| `scheduleEnd` | `timestamp` or `null` | Scheduled end time (if available). |
-| `groupType` | `string` | Type of the group (default, spaces, live etc). |
-| `status` | `string` or `null` | Status information ( active, expired etc) |
-| `rules` | `Object` | Group-specific moderation rules |
-| `eventType` | `string` | The type of event (create, update etc) |
-
---
-### **Remove From Group**
+### **Search Channels**
-```typescript
-// Remove Members To Group
-const addMemberToGroup = await userAlice.chat.group.remove(groupChatId, {
- role : 'MEMBER'
- accounts: [account1, account2] // these accounts should be a part of group
-});
+```tsx
+// returns channel matching the query
+const searchResult = await userAlice.channel.search("push")
-// Remove Admin To Group
-const addAdminToGroup = await userAlice.chat.group.remove(groupChatId, {
- role : 'ADMIN'
- accounts: [account1, account2] // // these accounts should be a part of group
-});
```
-| Param | Type | Default | Remarks |
-| ------------------ | ------------------- | ------- | ----------------------------------------------- |
-| `chatId` | `string` | - | Unique identifier of the group. |
-| `options` | `object` | - | Configuration for adding participants to group. |
-| `options.role` | `ADMIN` or `MEMBER` | - | Role of added participant |
-| `options.accounts` | `string[]` | - | Added participant addresses |
+**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 |
- Expected response
+\* - Optional
+
+
+ Expected response (Searching for channel)
```typescript
-{
- members: [
- {
- wallet: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTvNZgBCADeYpZfxgn1HoMUuWM42v8ZWfLPwglQYmzz5rY3PdPPoRFU\n' +
- 'v0AyPjYKpmLh2ZNfXjPaS9GuMdpXaomYSEwsV02hXZOQelo9cLop0Fc2i+l7\n' +
- '70rYhePuOuQ+XD/xYzhngAgNJ9rX96YnSodldb8uJfxYmgoF0E9Z2o2fgZGj\n' +
- 'll2CPnOaLXZaBQlPS3x/461TmZ1n2ZePS/fwiC7taLz3PtyGtKaC0vo4isvI\n' +
- 'yf04fkjudG0XIns5CWjdR2HeDC8BzSl8OVj8AQAc5uVU8Abk+ejWVr4zfoox\n' +
- 'eaziDPgGdkckFiQ6Tdsg0tPwwOpSrCCtJocTmc/fWaBb0YlnyAAL88fJABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZBMYqhmfI2WQQMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAACxNQf/UrM/whR7vCs+\n' +
- 'ez8Y8Hz4WqIuXtfMh4l2nKVv5UUuAfQkBxEY5j6Ga2+JgKU3neQ34x/v6fm9\n' +
- 'CLcY38Tc4AWyEx8KC78J+xOs7RMfyNBeiaf8KdaFfQrP0nMmufE6TxkfV1Y5\n' +
- 'LJZZ8350rZVtYJppWtlH+gbyUmMObyWDWbL3aWtqa3xjv0kLsf7TnugiFwzB\n' +
- 'gHHtk8tlDSOxRt0VdNNd19+/zrBYNl07Ig24WD2ETaJiaqa651z24/6/MkGT\n' +
- 'MBoQh+679tuWWcTrNi4jIA8jhSQ5BOgbAapl3qXk0m9/Aexpe2s6ISLXe8YJ\n' +
- 'j4cObDLv/ZKKeLZYTq9lVCydLAQUbs7ATQRk7zWYAQgAmx36uefgUF4cCSYH\n' +
- 'WMWAOTyc8Awo+hxn6FktOLU1+9hfGrX2jwGLOoOwjNgbYJbiSvRglAX2b57/\n' +
- 'qkkltAg1ZYCLSUzfBUbbWYlJNBwpv7+52zHaLUZ3gmI5aE48ad+uzaadgpVT\n' +
- 'VqLbhdgkN6jkemPTlfMehyS49AAbmqeKfo2U72tm9ZqT2cPVCASMjN/Ux2qG\n' +
- '3W8HTo0KIVFSbkTthl1zAlwAFksp0q437+pxbdJIecJ9mO6N4OQMnv+hVBDc\n' +
- 'WrPqBDJ0nas4JNgLxmLv0pheGg/TEfwS/p6xGRW5m08bj2l0cgqmEaM27jbi\n' +
- 'DEpOykRWsDMhheEfI2zV/Qam8QARAQABwsB2BBgBCAAqBYJk7zWYCZBMYqhm\n' +
- 'fI2WQQKbDBYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAAAnBggA1gkIopr9HJFP\n' +
- 'fO5SebcbowH4AG9M0qBqF4h1JIKbqvOnxLSsC5QmmzFcjS9ihyHBvzbRVGkC\n' +
- 'zEHYpLRedQ2AmQQfsf/VOoZJEOlb7tTk4+SpYtsGte5X/yLT5Bkls7Rp8ubK\n' +
- '/V99muj1nA/OkasllXQUSGEweVz6ejzJ0oMm3Vewmw8PelsdAnfS7Ud1MnXQ\n' +
- 'h+O8TCR56F5gAMWxZmxFpZMZyUFOH6KM+vL7HJUBztUS2g0ELsHKy9ep2yhv\n' +
- 'iABIwx/gEuPr0NDAH9x9XFKg5m3rO64KTY4BRWBISwmQ25dM1s1bwDPLi5XI\n' +
- '6Daw1glFxpPRrxgQGlVLzJOu5b8swQ==\n' +
- '=9hCc\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isAdmin: true,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzUlEQVR4AcXBsWlDMRiF0c8XTeAJPIAgoFbgQew1PIbXyKsyhUGtCqM6ZAJX6Z32fykM4hnuObv71++TYJRKlHtji1EqUe6NSJgJM2G2W74/nkzIvfHKKJUZwkyYCbOUe+Odcm/MEGbCTJil2/VMdLx8Eo1S2SL3RnS7nomEmTATZmm//BANKlHujS1GqUT7hRVhJsyEWWLSKJVXcm/MEGbCTJgl/sm9EY1SmTFKJcq9EY1SiYSZMBNm6XE6sHJhJffGOz1OByJhJsyE2R/3lDA4e9QQhAAAAABJRU5ErkJggg=='
- }
- ],
- pendingMembers: [
- {
- wallet: 'eip155:0x119bb8ad40B1f94e2b30ae5f59eeaEB67cD0Bd6C',
- publicKey: null,
- isAdmin: false,
- image: null
- },
- {
- wallet: 'eip155:0x6e0C509d14EbF26A529bf6DC5CC9bee7F5b8DBa4',
- publicKey: null,
- isAdmin: false,
- image: null
- },
- {
- wallet: 'eip155:0xE3FDD0527a9F8418f9a7D9e970452827FbE202FF',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTvNZgBCADouo4S2kPqA//+I7nDAk15/LcJ2TGvDhOYuPNUNMiNGOb4\n' +
- 'txusuKz6HOaG+K9hiUBpHjKrYEmCT2FEXxt8bfS3SpWb74RHSkWUNUkxk25y\n' +
- 'gE5gaCKyAdcnOUyVLmobVFFYtH6naK9bULaUtkVik1P0iuEevWHxtTpsjbyH\n' +
- 'bZtNpVTdprdLib4Wx6bb7VogsvjlvNJcVJ4sfPE0XgsQgAGIev7yJyU0DGzt\n' +
- '/EbvFX4sv51Kb1dX9ctBcvzVbs9+qT6LTivsrQp+TNHUN4zEeMhnWFFP5K1d\n' +
- 'H445S6FWk53XvBudcOkFPtltU1MPCS6hmhevArBfYzy5eSlaKA/fH+kFABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZCrD2gy8Zu4awMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBKru9/u8wPcTeHibkasPaDLxm7hrAADa/Af+PbamVg/Ig2S2\n' +
- 'HgIy4w5x7ulSk1/49+AmuiUMiVUwJSVBhROsyDbLET56w4+1TIMYZFJaczW3\n' +
- '8tCvAOUSauzc52I3zwGmaCupBJokIWp7ncPh0B8TFYrgThgXV7sLf3xy4roy\n' +
- 'y8oFz1Zla88krwtPe4Az7TF+WNdXoDsLNJ3GXRmNqs1GITmDqAXFWncl12NM\n' +
- 'ajUKWIKc/Gi1oKfz22mabJTtWBimDpA12LaGK3GjEK5CiWXT3Tzlqn6R14EZ\n' +
- '6ohpKZldSJiMPL0Bu9iT52iHOsw1wTZNC1L5lKhOCi3c+/fLRcJZt3hdCjqy\n' +
- 'd/FSCa8/Ny/GrHBWoL49rSF4pDEA+s7ATQRk7zWYAQgAtNOoHCL7BCnjwp8O\n' +
- 'htTxEI5r7Q/1zKKHiz6QKjjrGBYyR6gcmPM3JNEcvzY4OsCFnKBv2suOgrqH\n' +
- '8kXJzfpIQ7u7uJs+O3p/cn86RMANiEnO8NbB/0scpfZ7Vg3eOfoiWYE4I/1o\n' +
- 'FVDCyZ1YVqtbcmuW6D8i1djjeoUmkUDZyPo7Qs6hUsJeYA/Rfl8mH5sjy2cN\n' +
- 'WXf8cEtOUqJtwERXt5aRB/nBZiC0bsP6hf0HtAoNA8/96TkqrcQpODW/RckD\n' +
- 'fo4wkpEONHRH+LGX7GV0pwymHu42TUnULmED6BrMgMYG2sKpxMThxtAxRaiP\n' +
- 'nZ3DKXr8GCjTYnbEZpoi2zKCOQARAQABwsB2BBgBCAAqBYJk7zWYCZCrD2gy\n' +
- '8Zu4awKbDBYhBKru9/u8wPcTeHibkasPaDLxm7hrAADGyQgA5NMUkoyDTPZa\n' +
- 'Znj1dB+17xBXCZ/u7pPQc1DukBefVke7/qYIicdnnEGIX3Zd7TckFRsDljR/\n' +
- '3418Bne4WyL57fAF/GgYsegpJ9n1KT7oPxWzibIaYdj7R6bkDt5r61EDWC3N\n' +
- 'VBbnZu9cO15TYkObJIiyNvwbQyd6Dm313b39GnEE8sM709TWsI6Es6rRZAfC\n' +
- '+sI8ezYxqVUbP7sW3jJZYzdPOhZPHvFd5iJ2EfygEOuk5tb7AimfNwF/CNcB\n' +
- 'weQGEU7feOSB9lXXA+Ag1duLM4B9bLbbHEQIPhKlBF1ED64e/W/5HNfoAkS4\n' +
- 'qhzOD5XWs6xs45nnYqUbBFLG9Xk+Jg==\n' +
- '=qtAv\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isAdmin: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsXECMRRF0csbdbAZBagHKlJMSOL90IUq2h5UABktLE6/HcizY4/fOafrcntzQB/BTKvBEcJMmAmz0keQtRpk67bzRQ1m1m0nu19E1keQCTNhJsxO1+X2JukjmHm+Ppg5Lw9mWg0yYSbMhFnhoPPy4C8JM2EmzArftBr8J2EmzIRZ6SPIWg2yPoKs1WCmjyBrNcj6CDJhJsyEWWk1OKKP4DdaDTJhJsyEWeEHrQbZuu3M3C/iCGEmzITZJ/s7LOkKUABjAAAAAElFTkSuQmCC'
- }
- ],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJk7zWZCZBMYqhmfI2WQRYhBC9DyzhpX3ACb/yTq0xiqGZ8\n' +
- 'jZZBAADwAwgAq/6WjtwRt1aPTLWwtSx80Ng/Wxf97dkpebMXSj9T7f5ia1rM\n' +
- '8wqsuNUDMEMPB9LM34f6Q5pD994oeN2YT7z34u20mskiNphZdx/DNvu8w9UZ\n' +
- 'rI3tyjfZULhARNVM34sSABnHtExbl4ZArhNDsT86ku0sZNjr9frn2mtgmlKN\n' +
- 'nQdGcLJSxbci0hFg3nE5mYNpwZNs2S/2uk11WHKxzMhII6AdePE77BKPqedu\n' +
- 'PiXDODO2dIvV8glLQoJPRPgc2ap+/xYIBUFljqHGPU/62VSLlHxBJv72p5s/\n' +
- 'kOxiqD42TmpaaMtfudqgsZsGoYpZDHcMKYGNZs+9qVRHPRD+s0QhEA==\n' +
- '=c6IF\n' +
- '-----END PGP SIGNATURE-----\n',
- groupImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- groupName: 'influential_maroon_gamefowl',
- groupDescription: 'urgent_brown_butterfly',
- isPublic: false,
- groupCreator: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
- chatId: '5f769c881ffe328117dea3d3acd0b97ce7f4c163e440f75a96be3e33f7d2a000',
- meta: null,
- scheduleAt: null,
- scheduleEnd: null,
- groupType: 'default',
- status: null,
- rules: {},
- eventType: 'update'
-}
+// PushAPI.channels.search | Response - 200 OK
+[
+ {
+ id: 58,
+ channel: '0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924',
+ ipfshash: 'QmSbRT16JVF922yAB26YxWFD6DmGsnSHm8VBrGUQnXTS74',
+ name: 'Ethereum Push Notification Service',
+ info: 'The channel provides useful information, notifications, etc to all the users of the EPNS platform. While not recommended, you can unsubcribe if you want to.',
+ url: 'https://epns.io/',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihwgapkthxi6udojr7soqetk5xx22bdy56uupivcwkriaiqzwlyiu/QmSbRT16JVF922yAB26YxWFD6DmGsnSHm8VBrGUQnXTS74',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 756,
+ },
+ {
+ id: 817,
+ channel: '0xBA36124E8af635d9d32C4cC49802cacade133a5F',
+ ipfshash: 'QmUf7zuo4NXvkijhELfHAdmm8dQVY9VqesEs4xhobLZx4f',
+ name: 'push-ap-test',
+ info: 'testing push notifications',
+ url: 'https://www.google.com',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeigyk6kqiyn2dkburguqmnlkgvos4yld4hswcjcjnxbq6c5dqs7ih4/QmUf7zuo4NXvkijhELfHAdmm8dQVY9VqesEs4xhobLZx4f',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 57,
+ },
+ {
+ id: 243,
+ channel: '0xC533ec1f876eA99088c85896F246C2ec8c7b05f9',
+ ipfshash: 'bafkreibc36t5tlygsa75w6nnkjmjieyzrohuscwzvohbj5tq6v6tgm2q4y',
+ name: 'EPNS PUSH Governance',
+ info: 'Get notifications on new proposals, grants, and stay up to date on all things PUSH Governance.',
+ url: 'https://epns.io/',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihluvteyktaz6u7it6etf7jglqckcym5h5hxoqcilen73pcrz2wkq/bafkreibc36t5tlygsa75w6nnkjmjieyzrohuscwzvohbj5tq6v6tgm2q4y',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 9,
+ },
+ {
+ id: 923,
+ channel: '0x7F69eec6cC1F619Ea8d27323d4430BbA5b739354',
+ ipfshash: 'QmeBqut7zMg4NSLbyEbUeLn2g9UnUE9fKjiVhYvWwJ3vqu',
+ name: 'Polygon Ahmedabad <> PUSH',
+ info: "You'll get cool notifications and update here.",
+ url: 'https://polygon.technology/blog/polygons-web3-made-in-india-tour-starts-rolling-with-7-guild-events-web3-education-programs',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeiaxryfpf2gzmpq7uvye2kv3slru4vvdela5onldzder3zbbt3hoom/QmeBqut7zMg4NSLbyEbUeLn2g9UnUE9fKjiVhYvWwJ3vqu',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 9,
+ },
+ {
+ id: 274,
+ channel: '0x554d29160f779Adf0a4328597cD33Ea1Df4D9Ee9',
+ ipfshash: 'bafkreichmnqqcn6tfcv5lnbbluchr3tqgbhiu45qnq56p2razdhvgnblcy',
+ name: 'Push Governance',
+ info: 'Get notifications on new proposals, grants, and stay up to date on all updates regarding PUSH Governance',
+ url: 'https://epns.io/gov',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihkfdd4lch5vvcmziowi7dmuum2pouvk3st4v5rvfxo3etcoxh7oe/bafkreichmnqqcn6tfcv5lnbbluchr3tqgbhiu45qnq56p2razdhvgnblcy',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 5,
+ },
+ {
+ id: 1242,
+ channel: '0x453552953C4e2732A38B93F7fB834e5AeF6F60f8',
+ ipfshash: 'QmU7PC7yjdPfXJTgYuuqqvvWbxTn1rE3z8iWZEcorK3VPM',
+ name: 'Test push notifications',
+ info: 'Test push notifications',
+ url: 'https://www.youtube.com',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeiarff4fukkj7fvmjuav6xvqzg5pfzyj2jcytzcbb5tdgyfzjfakfa/QmU7PC7yjdPfXJTgYuuqqvvWbxTn1rE3z8iWZEcorK3VPM',
+ processed: 1,
+ attempts: 0,
+ alias_address: '0x453552953C4e2732A38B93F7fB834e5AeF6F60f8',
+ alias_verification_event:
+ '{"aliasAddress": "0x453552953C4e2732A38B93F7fB834e5AeF6F60f8", "aliasBlockchainId": "80001"}',
+ is_alias_verified: 1,
+ alias_blockchain_id: '80001',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 5,
+ },
+ {
+ id: 210,
+ channel: '0x8DaFfe9d1b5aDB33F53aDDC183C6b91F9cb30bc7',
+ ipfshash: 'bafkreiac6g3iul2uk6r6h2x5rsthgoq2y6uw23n4gzkvstfn7rl5tjq3v4',
+ name: 'PUSH for EthDenver',
+ info: 'Get notifications about everything EPNS at ETHDenver.',
+ url: 'http://ethdenver.epns.io/',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeia2emdjy63kap2yqig3h4qlsjuawdby777osyr4rls2nyno2qsv6u/bafkreiac6g3iul2uk6r6h2x5rsthgoq2y6uw23n4gzkvstfn7rl5tjq3v4',
+ processed: 1,
+ attempts: 1,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 4,
+ },
+ {
+ id: 809,
+ channel: '0x9dFe790B3baBCBD888dA7093017a0B7A68b99937',
+ ipfshash: 'QmbrQeT4FdvYRQDrDhVvZ9XMhs2TUNSA7UHc4M53vvNcKK',
+ name: 'Push-Graph Test',
+ info: 'This channel is to test subgraph notifications.',
+ url: 'https://push.org/',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihniwj5eflkxah7feqdgjnfuoyeq5iw4ka7qze3h6hdxsydx3gx3e/QmbrQeT4FdvYRQDrDhVvZ9XMhs2TUNSA7UHc4M53vvNcKK',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-02-03T12:26:00.000Z',
+ blocked: 0,
+ counter: 18,
+ subgraph_details: '60+aiswaryawalter/push-graph-test',
+ subscriber_count: 4,
+ },
+ {
+ id: 956,
+ channel: '0x85Cb63e3D8cEf31a421e59b6678bF0444Fa5d8BE',
+ ipfshash: 'QmUAgUYKteWdpcWkKmNtySGY5w7XkRpUYdYtqcSfEfXzLP',
+ name: 'Transfer PUSHNOTIFICATION',
+ info: 'Notification for Transfer',
+ url: 'https://push.org/',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeidwsc4kws4fvzzsdj5e46re46qmwxmgidouhcfeel34xmhxbqbroe/QmUAgUYKteWdpcWkKmNtySGY5w7XkRpUYdYtqcSfEfXzLP',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 4,
+ },
+ {
+ id: 967,
+ channel: '0xa45bdc5B11ce6F0952401bE35156398d8c40Ce64',
+ ipfshash: 'QmPWEKaJsfVweeyWT5bCftXDnbDFMgqw3sVpTnKtd3fH5a',
+ name: 'Push Graph Notif',
+ info: 'Subgraph notification test',
+ url: 'https://push.org/',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihlt5qyhs3g3ii5vrrhb4evcsltoa6bssb2qiuh3bamxx4ndorkr4/QmPWEKaJsfVweeyWT5bCftXDnbDFMgqw3sVpTnKtd3fH5a',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-02-03T12:26:00.000Z',
+ blocked: 0,
+ counter: 18,
+ subgraph_details: '60+aiswaryawalter/push-graph-test',
+ subscriber_count: 4,
+ },
+ {
+ id: 1425,
+ channel: '0x49403ae592C82fc3f861cD0b9738f7524Fb1F38C',
+ ipfshash: 'QmZ1t5upH5zHxvzefWppVNfv7ciacrDq9VUL3SZJ7trnNz',
+ name: 'SuperPush',
+ info: 'Create, Update and Delete Superfluid streams seemlessly and get alerted to your device with Push Notifications for every actions.',
+ url: 'https://www.superfluid.finance/',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeibfnawzeadz7d2exw2ncbytanzwjb3mdkx74whga5b5scz6mmuymu/QmZ1t5upH5zHxvzefWppVNfv7ciacrDq9VUL3SZJ7trnNz',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 0,
+ verified_status: 0,
+ timestamp: '2023-02-18T21:02:50.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 4,
+ },
+ {
+ id: 1659,
+ channel: '0x43097889162A9f2b7D85104f16aB7aB090056975',
+ ipfshash: 'QmQKuiR9nZw46pnrW16J7GZTsg3hteh93mWHcHV5Khrj24',
+ name: 'Push Protocol Demo',
+ info: 'A demo channel for testing out Push Protocol',
+ url: 'https://youtube.com',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeiaadvr565fk5mkam4hlmnaxdb7lxemfcffzqd24berqxw6sf3efny/QmQKuiR9nZw46pnrW16J7GZTsg3hteh93mWHcHV5Khrj24',
+ processed: 1,
+ attempts: 1,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-02-20T04:40:04.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 4,
+ },
+ {
+ id: 287,
+ channel: '0x72F569DE6d77B1D4C3810767865FC706A1C39915',
+ ipfshash: 'bafkreidlxu5pnjeamnriukkqskv4v6ndfz5nifb2adrqwsvqiypg4oq4yi',
+ name: 'Push for DevConnect',
+ info: 'Stay upto date on all the happenings at DevConnect',
+ url: 'https://devconnect.org/schedule',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeicgoxqjc3trzthp4chvdwyfe2nqm5lfaumkyztvm6vh6anwzztuty/bafkreidlxu5pnjeamnriukkqskv4v6ndfz5nifb2adrqwsvqiypg4oq4yi',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 3,
+ },
+ {
+ id: 369,
+ channel: '0x2b107f1B57F2A381dc8c09F8786FA3bdb3c70b27',
+ ipfshash: 'bafkreicnfx2wfjlphaoe7d3vttegbomdoc55n43p2r7wzpg2zzu2zcelrq',
+ name: 'Dapp Push notifications',
+ info: 'A channel to test out dapp push notifications',
+ url: 'animepahe.com',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihwyx4s5pv7afk7hskcvtz4j5o7yqkdwtb3t6mqsueqer4lbk53wy/bafkreicnfx2wfjlphaoe7d3vttegbomdoc55n43p2r7wzpg2zzu2zcelrq',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 3,
+ },
+ {
+ id: 445,
+ channel: '0x24a8E20a63DC3149BD7Ee136632161cDb8857522',
+ ipfshash: 'bafkreigglf54mwxxxzfhbexbyqgolyry4wfxkxvmxo3xojt6765rgi2r34',
+ name: 'Push Token Alerter',
+ info: 'Push Token alerter',
+ url: 'https://epns.io/',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeiaxnibay6ezfwmsytoiilcppa7piutbdzqzmm6vfcqi7wrmlx4qmm/bafkreigglf54mwxxxzfhbexbyqgolyry4wfxkxvmxo3xojt6765rgi2r34',
+ processed: 1,
+ attempts: 2,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 3,
+ },
+ {
+ id: 735,
+ channel: '0x76AF8b0ED41EEBda6Eb2aA7991e0564cCFD1eC1F',
+ ipfshash: 'QmeMSv9UrL5znYJoLkJgKnivzaN67WnfCWB7donSx8AbXP',
+ name: 'Push x Polygon',
+ info: 'Push x Polygon Integration',
+ url: 'https://push.org',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeiejlm3hfthuprnxyqj4onxnm3gy2tuygubaaapgw2bdhuqhhqggq4/QmeMSv9UrL5znYJoLkJgKnivzaN67WnfCWB7donSx8AbXP',
+ processed: 1,
+ attempts: 0,
+ alias_address: '0x76AF8b0ED41EEBda6Eb2aA7991e0564cCFD1eC1F',
+ alias_verification_event:
+ '{"aliasAddress": "0x76AF8b0ED41EEBda6Eb2aA7991e0564cCFD1eC1F", "aliasBlockchainId": "80001"}',
+ is_alias_verified: 1,
+ alias_blockchain_id: '80001',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 3,
+ },
+ {
+ id: 737,
+ channel: '0x0fEdC054075d14CF941A5cC62d22EBE9ad5de742',
+ ipfshash: 'QmZ3VQ87hNLeda2bgmvwZhKDaMgEboDVgGqTYktJGVNggG',
+ name: 'SeaLightPush',
+ info: 'Decentralized Exchange',
+ url: 'Https://SealightSwap.org',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeicn4gmyg5gq3u3eoo5lbkuo4pbstrhw6uu2u6lgx6yd43e6zgxyg4/QmZ3VQ87hNLeda2bgmvwZhKDaMgEboDVgGqTYktJGVNggG',
+ processed: 1,
+ attempts: 0,
+ alias_address: '0x0fEdC054075d14CF941A5cC62d22EBE9ad5de742',
+ alias_verification_event:
+ '{"aliasAddress": "0x0fEdC054075d14CF941A5cC62d22EBE9ad5de742", "aliasBlockchainId": "80001"}',
+ is_alias_verified: 1,
+ alias_blockchain_id: '80001',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 3,
+ },
+ {
+ id: 929,
+ channel: '0x983d0aD6D9c8778889311bC0E45DE417E9D74a90',
+ ipfshash: 'QmcqBzru5FFJDvLk7SYGEFYhgz9bokU77DWL4Kzt3NEDEJ',
+ name: 'Push amplify',
+ info: 'This channel will be used to test Push amplify features, and UI changes.',
+ url: 'https://twitter.com/pranshu3196',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeihkrzovmnbscultfjfrnjqnsfqmrhrjuvnnokjwm35n7gcqy7xefi/QmcqBzru5FFJDvLk7SYGEFYhgz9bokU77DWL4Kzt3NEDEJ',
+ processed: 1,
+ attempts: 0,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 3,
+ },
+ {
+ id: 1039,
+ channel: '0xc092d5Aa8c23165484486F246C828e4980b6C707',
+ ipfshash: 'QmXc2CE1c9fR34HVmkwQNaHRUvt7YxtiUcJfpBSbKTyBzD',
+ name: 'testPushHack',
+ info: 'test',
+ url: 'https://iamzub.in',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeia6djth6wbxpkujkxuftbkeot6d6atnhtyfb5k3bn5metcyj2pk3q/QmXc2CE1c9fR34HVmkwQNaHRUvt7YxtiUcJfpBSbKTyBzD',
+ processed: 1,
+ attempts: 1,
+ alias_address: 'NULL',
+ alias_verification_event: null,
+ is_alias_verified: 0,
+ alias_blockchain_id: 'NULL',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 3,
+ },
+ {
+ id: 1241,
+ channel: '0x11EaB508c309595F14E363e6a8d434BEab91eEBC',
+ ipfshash: 'QmZm14LgHZB2hYHcENkJNhrrL11QRKDCpX3AeVmXEiy2Hq',
+ name: 'Test for push',
+ info: 'Test for push',
+ url: 'https://www.youtube.com',
+ icon: 'https://gateway.ipfs.io/ipfs/bafybeicnv3jv7ylfxqgb5cqyzzi4lumbjeqyimcljewqbexszjrqeqkn5m/QmZm14LgHZB2hYHcENkJNhrrL11QRKDCpX3AeVmXEiy2Hq',
+ processed: 1,
+ attempts: 0,
+ alias_address: '0x11EaB508c309595F14E363e6a8d434BEab91eEBC',
+ alias_verification_event:
+ '{"aliasAddress": "0x11EaB508c309595F14E363e6a8d434BEab91eEBC", "aliasBlockchainId": "80001"}',
+ is_alias_verified: 1,
+ alias_blockchain_id: '80001',
+ activation_status: 1,
+ verified_status: 0,
+ timestamp: '2023-01-03T16:38:31.000Z',
+ blocked: 0,
+ counter: null,
+ subgraph_details: null,
+ subscriber_count: 3,
+ },
+];
```
-| Parameter | Type | Remarks |
-| -------------------------- | --------------------- | -------------------------------------------------------------- |
-| `members` | `Array` | An array containing member objects. |
-| `members.wallet` | `string` | The wallet address of the member. |
-| `members.publicKey` | `string` | The member's public PGP key (if available). |
-| `members.isAdmin` | `boolean` | Indicates whether the member is an admin. |
-| `members.image` | `string` | Image associated with the member. |
-| `pendingMembers` | `Array` | An array containing pending member objects. |
-| `pendingMembers.wallet` | `string` | The wallet address of the pending member. |
-| `pendingMembers.publicKey` | `string` | The pending member's public PGP key (if available). |
-| `pendingMembers.isAdmin` | `boolean` | Indicates whether the pending member is an admin. |
-| `pendingMembers.image` | `string` | Image associated with the pending member. |
-| `contractAddressERC20` | `string` or `null` | Contract address for ERC20 tokens (Used for tokenGating). |
-| `numberOfERC20` | `number` | The number of ERC20 tokens associated. (Used for tokenGating). |
-| `contractAddressNFT` | `string` or `null` | Contract address for NFT tokens (Used for tokenGating) |
-| `numberOfNFTTokens` | `number` | The number of NFT tokens associated. (Used for tokenGating) |
-| `verificationProof` | `string` | Verification proof associated with group data. |
-| `groupImage` | `string` | Group's image. |
-| `groupName` | `string` | The name of the group. |
-| `groupDescription` | `string` | Description of the group. |
-| `isPublic` | `boolean` | Indicates whether the group is public or private. |
-| `groupCreator` | `string` | Push Profile DID of the group creator. |
-| `chatId` | `string` | Unique chat ID associated with the group. |
-| `meta` | `object` or `null` | Additional metadata (if available). |
-| `scheduleAt` | `timestamp` or `null` | Scheduled start time (if available). |
-| `scheduleEnd` | `timestamp` or `null` | Scheduled end time (if available). |
-| `groupType` | `string` | Type of the group (default, spaces, live etc). |
-| `status` | `string` or `null` | Status information ( active, expired etc) |
-| `rules` | `Object` | Group-specific moderation rules |
-| `eventType` | `string` | The type of event (create, update etc) |
-
---
-### **Join Group**
+### **Get Subscribers Of A Channel**
+
+```tsx
+// fetches subscribers of a channel
+const subscribersResult = await userAlice.channel.subscribers()
-```typescript
-const joinGroup = await userAlice.chat.group.join(groupChatId);
```
-| Param | Type | Default | Remarks |
-| -------- | -------- | ------- | ------------------------------- |
-| `chatId` | `string` | - | Unique identifier of the group. |
+**Parameters:**
-
+| Parameter | Type | Default | Description |
+| --- | --- | --- | --- |
+| options* | ChannelInfoOptions | - | Configuration options for retrieving subscribers. |
+| options.channel* | string | - | Channel address in CAIP |
- Expected response
+\* - Optional
+
+
+ Expected response (Get channel's subscribers list)
```typescript
+// PushAPI.channels.getSubscribers | Response - 200 OK
{
- members: [
- {
- wallet: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTvNZgBCADeYpZfxgn1HoMUuWM42v8ZWfLPwglQYmzz5rY3PdPPoRFU\n' +
- 'v0AyPjYKpmLh2ZNfXjPaS9GuMdpXaomYSEwsV02hXZOQelo9cLop0Fc2i+l7\n' +
- '70rYhePuOuQ+XD/xYzhngAgNJ9rX96YnSodldb8uJfxYmgoF0E9Z2o2fgZGj\n' +
- 'll2CPnOaLXZaBQlPS3x/461TmZ1n2ZePS/fwiC7taLz3PtyGtKaC0vo4isvI\n' +
- 'yf04fkjudG0XIns5CWjdR2HeDC8BzSl8OVj8AQAc5uVU8Abk+ejWVr4zfoox\n' +
- 'eaziDPgGdkckFiQ6Tdsg0tPwwOpSrCCtJocTmc/fWaBb0YlnyAAL88fJABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZBMYqhmfI2WQQMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAACxNQf/UrM/whR7vCs+\n' +
- 'ez8Y8Hz4WqIuXtfMh4l2nKVv5UUuAfQkBxEY5j6Ga2+JgKU3neQ34x/v6fm9\n' +
- 'CLcY38Tc4AWyEx8KC78J+xOs7RMfyNBeiaf8KdaFfQrP0nMmufE6TxkfV1Y5\n' +
- 'LJZZ8350rZVtYJppWtlH+gbyUmMObyWDWbL3aWtqa3xjv0kLsf7TnugiFwzB\n' +
- 'gHHtk8tlDSOxRt0VdNNd19+/zrBYNl07Ig24WD2ETaJiaqa651z24/6/MkGT\n' +
- 'MBoQh+679tuWWcTrNi4jIA8jhSQ5BOgbAapl3qXk0m9/Aexpe2s6ISLXe8YJ\n' +
- 'j4cObDLv/ZKKeLZYTq9lVCydLAQUbs7ATQRk7zWYAQgAmx36uefgUF4cCSYH\n' +
- 'WMWAOTyc8Awo+hxn6FktOLU1+9hfGrX2jwGLOoOwjNgbYJbiSvRglAX2b57/\n' +
- 'qkkltAg1ZYCLSUzfBUbbWYlJNBwpv7+52zHaLUZ3gmI5aE48ad+uzaadgpVT\n' +
- 'VqLbhdgkN6jkemPTlfMehyS49AAbmqeKfo2U72tm9ZqT2cPVCASMjN/Ux2qG\n' +
- '3W8HTo0KIVFSbkTthl1zAlwAFksp0q437+pxbdJIecJ9mO6N4OQMnv+hVBDc\n' +
- 'WrPqBDJ0nas4JNgLxmLv0pheGg/TEfwS/p6xGRW5m08bj2l0cgqmEaM27jbi\n' +
- 'DEpOykRWsDMhheEfI2zV/Qam8QARAQABwsB2BBgBCAAqBYJk7zWYCZBMYqhm\n' +
- 'fI2WQQKbDBYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAAAnBggA1gkIopr9HJFP\n' +
- 'fO5SebcbowH4AG9M0qBqF4h1JIKbqvOnxLSsC5QmmzFcjS9ihyHBvzbRVGkC\n' +
- 'zEHYpLRedQ2AmQQfsf/VOoZJEOlb7tTk4+SpYtsGte5X/yLT5Bkls7Rp8ubK\n' +
- '/V99muj1nA/OkasllXQUSGEweVz6ejzJ0oMm3Vewmw8PelsdAnfS7Ud1MnXQ\n' +
- 'h+O8TCR56F5gAMWxZmxFpZMZyUFOH6KM+vL7HJUBztUS2g0ELsHKy9ep2yhv\n' +
- 'iABIwx/gEuPr0NDAH9x9XFKg5m3rO64KTY4BRWBISwmQ25dM1s1bwDPLi5XI\n' +
- '6Daw1glFxpPRrxgQGlVLzJOu5b8swQ==\n' +
- '=9hCc\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isAdmin: true,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzUlEQVR4AcXBsWlDMRiF0c8XTeAJPIAgoFbgQew1PIbXyKsyhUGtCqM6ZAJX6Z32fykM4hnuObv71++TYJRKlHtji1EqUe6NSJgJM2G2W74/nkzIvfHKKJUZwkyYCbOUe+Odcm/MEGbCTJil2/VMdLx8Eo1S2SL3RnS7nomEmTATZmm//BANKlHujS1GqUT7hRVhJsyEWWLSKJVXcm/MEGbCTJgl/sm9EY1SmTFKJcq9EY1SiYSZMBNm6XE6sHJhJffGOz1OByJhJsyE2R/3lDA4e9QQhAAAAABJRU5ErkJggg=='
- }
- ],
- pendingMembers: [
- {
- wallet: 'eip155:0x119bb8ad40B1f94e2b30ae5f59eeaEB67cD0Bd6C',
- publicKey: null,
- isAdmin: false,
- image: null
- },
- {
- wallet: 'eip155:0x6e0C509d14EbF26A529bf6DC5CC9bee7F5b8DBa4',
- publicKey: null,
- isAdmin: false,
- image: null
- },
- {
- wallet: 'eip155:0xE3FDD0527a9F8418f9a7D9e970452827FbE202FF',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTvNZgBCADouo4S2kPqA//+I7nDAk15/LcJ2TGvDhOYuPNUNMiNGOb4\n' +
- 'txusuKz6HOaG+K9hiUBpHjKrYEmCT2FEXxt8bfS3SpWb74RHSkWUNUkxk25y\n' +
- 'gE5gaCKyAdcnOUyVLmobVFFYtH6naK9bULaUtkVik1P0iuEevWHxtTpsjbyH\n' +
- 'bZtNpVTdprdLib4Wx6bb7VogsvjlvNJcVJ4sfPE0XgsQgAGIev7yJyU0DGzt\n' +
- '/EbvFX4sv51Kb1dX9ctBcvzVbs9+qT6LTivsrQp+TNHUN4zEeMhnWFFP5K1d\n' +
- 'H445S6FWk53XvBudcOkFPtltU1MPCS6hmhevArBfYzy5eSlaKA/fH+kFABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZCrD2gy8Zu4awMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBKru9/u8wPcTeHibkasPaDLxm7hrAADa/Af+PbamVg/Ig2S2\n' +
- 'HgIy4w5x7ulSk1/49+AmuiUMiVUwJSVBhROsyDbLET56w4+1TIMYZFJaczW3\n' +
- '8tCvAOUSauzc52I3zwGmaCupBJokIWp7ncPh0B8TFYrgThgXV7sLf3xy4roy\n' +
- 'y8oFz1Zla88krwtPe4Az7TF+WNdXoDsLNJ3GXRmNqs1GITmDqAXFWncl12NM\n' +
- 'ajUKWIKc/Gi1oKfz22mabJTtWBimDpA12LaGK3GjEK5CiWXT3Tzlqn6R14EZ\n' +
- '6ohpKZldSJiMPL0Bu9iT52iHOsw1wTZNC1L5lKhOCi3c+/fLRcJZt3hdCjqy\n' +
- 'd/FSCa8/Ny/GrHBWoL49rSF4pDEA+s7ATQRk7zWYAQgAtNOoHCL7BCnjwp8O\n' +
- 'htTxEI5r7Q/1zKKHiz6QKjjrGBYyR6gcmPM3JNEcvzY4OsCFnKBv2suOgrqH\n' +
- '8kXJzfpIQ7u7uJs+O3p/cn86RMANiEnO8NbB/0scpfZ7Vg3eOfoiWYE4I/1o\n' +
- 'FVDCyZ1YVqtbcmuW6D8i1djjeoUmkUDZyPo7Qs6hUsJeYA/Rfl8mH5sjy2cN\n' +
- 'WXf8cEtOUqJtwERXt5aRB/nBZiC0bsP6hf0HtAoNA8/96TkqrcQpODW/RckD\n' +
- 'fo4wkpEONHRH+LGX7GV0pwymHu42TUnULmED6BrMgMYG2sKpxMThxtAxRaiP\n' +
- 'nZ3DKXr8GCjTYnbEZpoi2zKCOQARAQABwsB2BBgBCAAqBYJk7zWYCZCrD2gy\n' +
- '8Zu4awKbDBYhBKru9/u8wPcTeHibkasPaDLxm7hrAADGyQgA5NMUkoyDTPZa\n' +
- 'Znj1dB+17xBXCZ/u7pPQc1DukBefVke7/qYIicdnnEGIX3Zd7TckFRsDljR/\n' +
- '3418Bne4WyL57fAF/GgYsegpJ9n1KT7oPxWzibIaYdj7R6bkDt5r61EDWC3N\n' +
- 'VBbnZu9cO15TYkObJIiyNvwbQyd6Dm313b39GnEE8sM709TWsI6Es6rRZAfC\n' +
- '+sI8ezYxqVUbP7sW3jJZYzdPOhZPHvFd5iJ2EfygEOuk5tb7AimfNwF/CNcB\n' +
- 'weQGEU7feOSB9lXXA+Ag1duLM4B9bLbbHEQIPhKlBF1ED64e/W/5HNfoAkS4\n' +
- 'qhzOD5XWs6xs45nnYqUbBFLG9Xk+Jg==\n' +
- '=qtAv\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isAdmin: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsXECMRRF0csbdbAZBagHKlJMSOL90IUq2h5UABktLE6/HcizY4/fOafrcntzQB/BTKvBEcJMmAmz0keQtRpk67bzRQ1m1m0nu19E1keQCTNhJsxO1+X2JukjmHm+Ppg5Lw9mWg0yYSbMhFnhoPPy4C8JM2EmzArftBr8J2EmzIRZ6SPIWg2yPoKs1WCmjyBrNcj6CDJhJsyEWWk1OKKP4DdaDTJhJsyEWeEHrQbZuu3M3C/iCGEmzITZJ/s7LOkKUABjAAAAAElFTkSuQmCC'
- }
- ],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJk7zWZCZBMYqhmfI2WQRYhBC9DyzhpX3ACb/yTq0xiqGZ8\n' +
- 'jZZBAADwAwgAq/6WjtwRt1aPTLWwtSx80Ng/Wxf97dkpebMXSj9T7f5ia1rM\n' +
- '8wqsuNUDMEMPB9LM34f6Q5pD994oeN2YT7z34u20mskiNphZdx/DNvu8w9UZ\n' +
- 'rI3tyjfZULhARNVM34sSABnHtExbl4ZArhNDsT86ku0sZNjr9frn2mtgmlKN\n' +
- 'nQdGcLJSxbci0hFg3nE5mYNpwZNs2S/2uk11WHKxzMhII6AdePE77BKPqedu\n' +
- 'PiXDODO2dIvV8glLQoJPRPgc2ap+/xYIBUFljqHGPU/62VSLlHxBJv72p5s/\n' +
- 'kOxiqD42TmpaaMtfudqgsZsGoYpZDHcMKYGNZs+9qVRHPRD+s0QhEA==\n' +
- '=c6IF\n' +
- '-----END PGP SIGNATURE-----\n',
- groupImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- groupName: 'influential_maroon_gamefowl',
- groupDescription: 'urgent_brown_butterfly',
- isPublic: false,
- groupCreator: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
- chatId: '5f769c881ffe328117dea3d3acd0b97ce7f4c163e440f75a96be3e33f7d2a000',
- meta: null,
- scheduleAt: null,
- scheduleEnd: null,
- groupType: 'default',
- status: null,
- rules: {},
- eventType: 'update'
+ "itemcount": 11,
+ "subscribers": [
+ "0x1d4f52775344f9a32093af0ccd03a4fb6dac8e30",
+ "0x28d615edd8404f8ca1e0271a0b5a48171589921a",
+ "0x4352639b99689069f9b0b847eee349c3c1b0706c",
+ "0x50029e62540537045bcfd3d320483865344edb33",
+ "0x5ac9e6205eaca2bbba6ef716fd9aabd76326eeee",
+ "0x778d3206374f8ac265728e18e3fe2ae6b93e4ce4",
+ "0xa44f2994750cf774eab05751d90ade4dedabe7fe",
+ "0xbcfb7da1dcf40e8cfb331683bb7d6f4eba091b08",
+ "0xcf5dbf241fc65a5af56c95101ac4e9ec2c57d941",
+ "0xd8634c39bbfd4033c0d3289c4515275102423681"
+ ]
}
```
-| Parameter | Type | Remarks |
-| -------------------------- | --------------------- | -------------------------------------------------------------- |
-| `members` | `Array` | An array containing member objects. |
-| `members.wallet` | `string` | The wallet address of the member. |
-| `members.publicKey` | `string` | The member's public PGP key (if available). |
-| `members.isAdmin` | `boolean` | Indicates whether the member is an admin. |
-| `members.image` | `string` | Image associated with the member. |
-| `pendingMembers` | `Array` | An array containing pending member objects. |
-| `pendingMembers.wallet` | `string` | The wallet address of the pending member. |
-| `pendingMembers.publicKey` | `string` | The pending member's public PGP key (if available). |
-| `pendingMembers.isAdmin` | `boolean` | Indicates whether the pending member is an admin. |
-| `pendingMembers.image` | `string` | Image associated with the pending member. |
-| `contractAddressERC20` | `string` or `null` | Contract address for ERC20 tokens (Used for tokenGating). |
-| `numberOfERC20` | `number` | The number of ERC20 tokens associated. (Used for tokenGating). |
-| `contractAddressNFT` | `string` or `null` | Contract address for NFT tokens (Used for tokenGating) |
-| `numberOfNFTTokens` | `number` | The number of NFT tokens associated. (Used for tokenGating) |
-| `verificationProof` | `string` | Verification proof associated with group data. |
-| `groupImage` | `string` | Group's image. |
-| `groupName` | `string` | The name of the group. |
-| `groupDescription` | `string` | Description of the group. |
-| `isPublic` | `boolean` | Indicates whether the group is public or private. |
-| `groupCreator` | `string` | Push Profile DID of the group creator. |
-| `chatId` | `string` | Unique chat ID associated with the group. |
-| `meta` | `object` or `null` | Additional metadata (if available). |
-| `scheduleAt` | `timestamp` or `null` | Scheduled start time (if available). |
-| `scheduleEnd` | `timestamp` or `null` | Scheduled end time (if available). |
-| `groupType` | `string` | Type of the group (default, spaces, live etc). |
-| `status` | `string` or `null` | Status information ( active, expired etc) |
-| `rules` | `Object` | Group-specific moderation rules |
-| `eventType` | `string` | The type of event (create, update etc) |
+
+
+---
+
+### **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
+
+
+ Expected response (Send Notification)
+
+```typescript
+// PushAPI.payloads.sendNotification | Response - 204 OK
+```
+
+
+
+---
+
+### **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. |
+
+\* - Optional
+
+
+ Expected response (Create Channel)
+
+```typescript
+ { transactionHash: "0x25b099ee5afa75283e5b31eda788e3de465cac8d1a9b44edf5645d675e11f38c"
+ }
+```
---
-### **Leave Group**
+### **Update channel 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. |
+| | | | |
+
+\* - Optional
+
+
+ Expected response (Update Channel)
```typescript
-// Leave Group
-const leaveGrp = await userAlice.chat.group.leave(groupChatId);
+ { transactionHash: "0xf5056d382f209b5a7bcbf08d69c80dd13079467ba38413da8ca065a45f901a32"
+ }
```
+
-| Param | Type | Default | Remarks |
-| -------- | -------- | ------- | ------------------------------- |
-| `chatId` | `string` | - | Unique identifier of the group. |
+---
+
+### **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 |
+ Expected response (Verify Channel)
- Expected response
+```typescript
+ { transactionHash: "0xf5056d382f209b5a7bcbf08d69c80dd13079467ba38413da8ca065a45f901a32"
+ }
+```
+
+
+---
+
+### **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, enabled: true, ticker: 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. |
+| data.enabled* | boolean | - | Valid for slider type only. If the settting should be enabled by default. |
+| data.ticker* | number | - | Valid for slider type only. Offset for slider values |
+
+
+ Expected response (Create Channel Setting)
```typescript
-{
- members: [
- {
- wallet: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTvNZgBCADeYpZfxgn1HoMUuWM42v8ZWfLPwglQYmzz5rY3PdPPoRFU\n' +
- 'v0AyPjYKpmLh2ZNfXjPaS9GuMdpXaomYSEwsV02hXZOQelo9cLop0Fc2i+l7\n' +
- '70rYhePuOuQ+XD/xYzhngAgNJ9rX96YnSodldb8uJfxYmgoF0E9Z2o2fgZGj\n' +
- 'll2CPnOaLXZaBQlPS3x/461TmZ1n2ZePS/fwiC7taLz3PtyGtKaC0vo4isvI\n' +
- 'yf04fkjudG0XIns5CWjdR2HeDC8BzSl8OVj8AQAc5uVU8Abk+ejWVr4zfoox\n' +
- 'eaziDPgGdkckFiQ6Tdsg0tPwwOpSrCCtJocTmc/fWaBb0YlnyAAL88fJABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZBMYqhmfI2WQQMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAACxNQf/UrM/whR7vCs+\n' +
- 'ez8Y8Hz4WqIuXtfMh4l2nKVv5UUuAfQkBxEY5j6Ga2+JgKU3neQ34x/v6fm9\n' +
- 'CLcY38Tc4AWyEx8KC78J+xOs7RMfyNBeiaf8KdaFfQrP0nMmufE6TxkfV1Y5\n' +
- 'LJZZ8350rZVtYJppWtlH+gbyUmMObyWDWbL3aWtqa3xjv0kLsf7TnugiFwzB\n' +
- 'gHHtk8tlDSOxRt0VdNNd19+/zrBYNl07Ig24WD2ETaJiaqa651z24/6/MkGT\n' +
- 'MBoQh+679tuWWcTrNi4jIA8jhSQ5BOgbAapl3qXk0m9/Aexpe2s6ISLXe8YJ\n' +
- 'j4cObDLv/ZKKeLZYTq9lVCydLAQUbs7ATQRk7zWYAQgAmx36uefgUF4cCSYH\n' +
- 'WMWAOTyc8Awo+hxn6FktOLU1+9hfGrX2jwGLOoOwjNgbYJbiSvRglAX2b57/\n' +
- 'qkkltAg1ZYCLSUzfBUbbWYlJNBwpv7+52zHaLUZ3gmI5aE48ad+uzaadgpVT\n' +
- 'VqLbhdgkN6jkemPTlfMehyS49AAbmqeKfo2U72tm9ZqT2cPVCASMjN/Ux2qG\n' +
- '3W8HTo0KIVFSbkTthl1zAlwAFksp0q437+pxbdJIecJ9mO6N4OQMnv+hVBDc\n' +
- 'WrPqBDJ0nas4JNgLxmLv0pheGg/TEfwS/p6xGRW5m08bj2l0cgqmEaM27jbi\n' +
- 'DEpOykRWsDMhheEfI2zV/Qam8QARAQABwsB2BBgBCAAqBYJk7zWYCZBMYqhm\n' +
- 'fI2WQQKbDBYhBC9DyzhpX3ACb/yTq0xiqGZ8jZZBAAAnBggA1gkIopr9HJFP\n' +
- 'fO5SebcbowH4AG9M0qBqF4h1JIKbqvOnxLSsC5QmmzFcjS9ihyHBvzbRVGkC\n' +
- 'zEHYpLRedQ2AmQQfsf/VOoZJEOlb7tTk4+SpYtsGte5X/yLT5Bkls7Rp8ubK\n' +
- '/V99muj1nA/OkasllXQUSGEweVz6ejzJ0oMm3Vewmw8PelsdAnfS7Ud1MnXQ\n' +
- 'h+O8TCR56F5gAMWxZmxFpZMZyUFOH6KM+vL7HJUBztUS2g0ELsHKy9ep2yhv\n' +
- 'iABIwx/gEuPr0NDAH9x9XFKg5m3rO64KTY4BRWBISwmQ25dM1s1bwDPLi5XI\n' +
- '6Daw1glFxpPRrxgQGlVLzJOu5b8swQ==\n' +
- '=9hCc\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isAdmin: true,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzUlEQVR4AcXBsWlDMRiF0c8XTeAJPIAgoFbgQew1PIbXyKsyhUGtCqM6ZAJX6Z32fykM4hnuObv71++TYJRKlHtji1EqUe6NSJgJM2G2W74/nkzIvfHKKJUZwkyYCbOUe+Odcm/MEGbCTJil2/VMdLx8Eo1S2SL3RnS7nomEmTATZmm//BANKlHujS1GqUT7hRVhJsyEWWLSKJVXcm/MEGbCTJgl/sm9EY1SmTFKJcq9EY1SiYSZMBNm6XE6sHJhJffGOz1OByJhJsyE2R/3lDA4e9QQhAAAAABJRU5ErkJggg=='
- }
- ],
- pendingMembers: [
- {
- wallet: 'eip155:0x119bb8ad40B1f94e2b30ae5f59eeaEB67cD0Bd6C',
- publicKey: null,
- isAdmin: false,
- image: null
- },
- {
- wallet: 'eip155:0x6e0C509d14EbF26A529bf6DC5CC9bee7F5b8DBa4',
- publicKey: null,
- isAdmin: false,
- image: null
- },
- {
- wallet: 'eip155:0xE3FDD0527a9F8418f9a7D9e970452827FbE202FF',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTvNZgBCADouo4S2kPqA//+I7nDAk15/LcJ2TGvDhOYuPNUNMiNGOb4\n' +
- 'txusuKz6HOaG+K9hiUBpHjKrYEmCT2FEXxt8bfS3SpWb74RHSkWUNUkxk25y\n' +
- 'gE5gaCKyAdcnOUyVLmobVFFYtH6naK9bULaUtkVik1P0iuEevWHxtTpsjbyH\n' +
- 'bZtNpVTdprdLib4Wx6bb7VogsvjlvNJcVJ4sfPE0XgsQgAGIev7yJyU0DGzt\n' +
- '/EbvFX4sv51Kb1dX9ctBcvzVbs9+qT6LTivsrQp+TNHUN4zEeMhnWFFP5K1d\n' +
- 'H445S6FWk53XvBudcOkFPtltU1MPCS6hmhevArBfYzy5eSlaKA/fH+kFABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO81mAQLCQcICZCrD2gy8Zu4awMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBKru9/u8wPcTeHibkasPaDLxm7hrAADa/Af+PbamVg/Ig2S2\n' +
- 'HgIy4w5x7ulSk1/49+AmuiUMiVUwJSVBhROsyDbLET56w4+1TIMYZFJaczW3\n' +
- '8tCvAOUSauzc52I3zwGmaCupBJokIWp7ncPh0B8TFYrgThgXV7sLf3xy4roy\n' +
- 'y8oFz1Zla88krwtPe4Az7TF+WNdXoDsLNJ3GXRmNqs1GITmDqAXFWncl12NM\n' +
- 'ajUKWIKc/Gi1oKfz22mabJTtWBimDpA12LaGK3GjEK5CiWXT3Tzlqn6R14EZ\n' +
- '6ohpKZldSJiMPL0Bu9iT52iHOsw1wTZNC1L5lKhOCi3c+/fLRcJZt3hdCjqy\n' +
- 'd/FSCa8/Ny/GrHBWoL49rSF4pDEA+s7ATQRk7zWYAQgAtNOoHCL7BCnjwp8O\n' +
- 'htTxEI5r7Q/1zKKHiz6QKjjrGBYyR6gcmPM3JNEcvzY4OsCFnKBv2suOgrqH\n' +
- '8kXJzfpIQ7u7uJs+O3p/cn86RMANiEnO8NbB/0scpfZ7Vg3eOfoiWYE4I/1o\n' +
- 'FVDCyZ1YVqtbcmuW6D8i1djjeoUmkUDZyPo7Qs6hUsJeYA/Rfl8mH5sjy2cN\n' +
- 'WXf8cEtOUqJtwERXt5aRB/nBZiC0bsP6hf0HtAoNA8/96TkqrcQpODW/RckD\n' +
- 'fo4wkpEONHRH+LGX7GV0pwymHu42TUnULmED6BrMgMYG2sKpxMThxtAxRaiP\n' +
- 'nZ3DKXr8GCjTYnbEZpoi2zKCOQARAQABwsB2BBgBCAAqBYJk7zWYCZCrD2gy\n' +
- '8Zu4awKbDBYhBKru9/u8wPcTeHibkasPaDLxm7hrAADGyQgA5NMUkoyDTPZa\n' +
- 'Znj1dB+17xBXCZ/u7pPQc1DukBefVke7/qYIicdnnEGIX3Zd7TckFRsDljR/\n' +
- '3418Bne4WyL57fAF/GgYsegpJ9n1KT7oPxWzibIaYdj7R6bkDt5r61EDWC3N\n' +
- 'VBbnZu9cO15TYkObJIiyNvwbQyd6Dm313b39GnEE8sM709TWsI6Es6rRZAfC\n' +
- '+sI8ezYxqVUbP7sW3jJZYzdPOhZPHvFd5iJ2EfygEOuk5tb7AimfNwF/CNcB\n' +
- 'weQGEU7feOSB9lXXA+Ag1duLM4B9bLbbHEQIPhKlBF1ED64e/W/5HNfoAkS4\n' +
- 'qhzOD5XWs6xs45nnYqUbBFLG9Xk+Jg==\n' +
- '=qtAv\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- isAdmin: false,
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAw0lEQVR4AcXBsXECMRRF0csbdbAZBagHKlJMSOL90IUq2h5UABktLE6/HcizY4/fOafrcntzQB/BTKvBEcJMmAmz0keQtRpk67bzRQ1m1m0nu19E1keQCTNhJsxO1+X2JukjmHm+Ppg5Lw9mWg0yYSbMhFnhoPPy4C8JM2EmzArftBr8J2EmzIRZ6SPIWg2yPoKs1WCmjyBrNcj6CDJhJsyEWWk1OKKP4DdaDTJhJsyEWeEHrQbZuu3M3C/iCGEmzITZJ/s7LOkKUABjAAAAAElFTkSuQmCC'
- }
- ],
- contractAddressERC20: null,
- numberOfERC20: 0,
- contractAddressNFT: null,
- numberOfNFTTokens: 0,
- verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
- '\n' +
- 'wsBzBAEBCAAnBYJk7zWZCZBMYqhmfI2WQRYhBC9DyzhpX3ACb/yTq0xiqGZ8\n' +
- 'jZZBAADwAwgAq/6WjtwRt1aPTLWwtSx80Ng/Wxf97dkpebMXSj9T7f5ia1rM\n' +
- '8wqsuNUDMEMPB9LM34f6Q5pD994oeN2YT7z34u20mskiNphZdx/DNvu8w9UZ\n' +
- 'rI3tyjfZULhARNVM34sSABnHtExbl4ZArhNDsT86ku0sZNjr9frn2mtgmlKN\n' +
- 'nQdGcLJSxbci0hFg3nE5mYNpwZNs2S/2uk11WHKxzMhII6AdePE77BKPqedu\n' +
- 'PiXDODO2dIvV8glLQoJPRPgc2ap+/xYIBUFljqHGPU/62VSLlHxBJv72p5s/\n' +
- 'kOxiqD42TmpaaMtfudqgsZsGoYpZDHcMKYGNZs+9qVRHPRD+s0QhEA==\n' +
- '=c6IF\n' +
- '-----END PGP SIGNATURE-----\n',
- groupImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
- groupName: 'influential_maroon_gamefowl',
- groupDescription: 'urgent_brown_butterfly',
- isPublic: false,
- groupCreator: 'eip155:0x140BE62b2177A975Bbef398DF8934b883E7d13f9',
- chatId: '5f769c881ffe328117dea3d3acd0b97ce7f4c163e440f75a96be3e33f7d2a000',
- meta: null,
- scheduleAt: null,
- scheduleEnd: null,
- groupType: 'default',
- status: null,
- rules: {},
- eventType: 'update'
-}
+ { transactionHash: "0xf5056d382f209b5a7bcbf08d69c80dd13079467ba38413da8ca065a45f901a32"
+ }
```
+
-| Parameter | Type | Remarks |
-| -------------------------- | --------------------- | -------------------------------------------------------------- |
-| `members` | `Array` | An array containing member objects. |
-| `members.wallet` | `string` | The wallet address of the member. |
-| `members.publicKey` | `string` | The member's public PGP key (if available). |
-| `members.isAdmin` | `boolean` | Indicates whether the member is an admin. |
-| `members.image` | `string` | Image associated with the member. |
-| `pendingMembers` | `Array` | An array containing pending member objects. |
-| `pendingMembers.wallet` | `string` | The wallet address of the pending member. |
-| `pendingMembers.publicKey` | `string` | The pending member's public PGP key (if available). |
-| `pendingMembers.isAdmin` | `boolean` | Indicates whether the pending member is an admin. |
-| `pendingMembers.image` | `string` | Image associated with the pending member. |
-| `contractAddressERC20` | `string` or `null` | Contract address for ERC20 tokens (Used for tokenGating). |
-| `numberOfERC20` | `number` | The number of ERC20 tokens associated. (Used for tokenGating). |
-| `contractAddressNFT` | `string` or `null` | Contract address for NFT tokens (Used for tokenGating) |
-| `numberOfNFTTokens` | `number` | The number of NFT tokens associated. (Used for tokenGating) |
-| `verificationProof` | `string` | Verification proof associated with group data. |
-| `groupImage` | `string` | Group's image. |
-| `groupName` | `string` | The name of the group. |
-| `groupDescription` | `string` | Description of the group. |
-| `isPublic` | `boolean` | Indicates whether the group is public or private. |
-| `groupCreator` | `string` | Push Profile DID of the group creator. |
-| `chatId` | `string` | Unique chat ID associated with the group. |
-| `meta` | `object` or `null` | Additional metadata (if available). |
-| `scheduleAt` | `timestamp` or `null` | Scheduled start time (if available). |
-| `scheduleEnd` | `timestamp` or `null` | Scheduled end time (if available). |
-| `groupType` | `string` | Type of the group (default, spaces, live etc). |
-| `status` | `string` or `null` | Status information ( active, expired etc) |
-| `rules` | `Object` | Group-specific moderation rules |
-| `eventType` | `string` | The type of event (create, update etc) |
+| \* - 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 | | | |
+
+
+ Expected response (Get Delegates)
+
+```typescript
+[
+ '0x69e666767Ba3a661369e1e2F572EdE7ADC926029',
+ '0x74415Bc4C4Bf4Baecc2DD372426F0a1D016Fa924',
+ '0x7b9e036BD304fd1Bea0523dE718038bbe345521A',
+ '0xD8634C39BBFd4033c0d3289C4515275102423681'
+]
+```
---
-### **Reject Group Joining Request**
+### **Add delegator to a channel or alias**
+
+```tsx
+// adds a delegate
+const addDelegatorRes = userAlice.channel.delegate.add(delegatorAddressInCAIP)
-```typescript
-// Reject Group Request
-await userAlice.chat.group.reject(groupChatId);
```
-| Param | Type | Default | Remarks |
-| -------- | -------- | ------- | ------------------------------- |
-| `chatId` | `string` | - | Unique identifier of the group. |
+**Parameters:**
----
+| Parameter | Type | Default | Description |
+| --- | --- | --- | --- |
+| delegate | string | - | delegator address in CAIP |
+| Note: Support for contract interaction via viem is coming soon | | | |
-### **Fetch Encryption Info**
+
+ Expected response (Add Delegate)
```typescript
-// Fetch Encryption Info
-const aliceEncryptionInfo = await userAlice.encryption.info();
+ { transactionHash: "0xee8055ffb8ce35268900c64a57ae28fa5f7ab56879311bb467640c0e7af79d4a"
+ }
```
+
-
+---
- Expected response
+### **Remove delegator from a channel or alias**
+
+```tsx
+// removes a delegate
+const removeDelegatorRes = userAlice.channel.delegate.remove(delegatorAddressInCAIP)
-```typescript
-{
- decryptedPgpPrivateKey: '-----BEGIN PGP PRIVATE KEY BLOCK-----\n' +
- '\n' +
- 'xcLYBGTvQKUBCACgsuLM540Bq39fAbLRGoaRZR5/lETkpQSArzP4+B+wxcQe\n' +
- 'IItuLF9z1+OHilx/uAJ6yWH2En8QdlSBRMDCSwhLOXYnrB5dTvEM2nm+v59H\n' +
- 'sIRkRUogXSIgTrcVG7Tt0JsrjBV2avOki1L4vzPvHEDUtlKcxdJ5914W2lSu\n' +
- '05xPG+ALRsYFki1ga6bt6kT1+v7GV+862hOHY/FugohLKdIZOo6CeI0ddnHF\n' +
- '9jL3pu4aTRn11VIphju3KQ2oCxF/6843OrA4X/GtVtsoRq00RBLuv61ZmRpr\n' +
- 'qsOgEz009cDEWdUWs8wvf75TG/MfYM4g+9nSWflJGMSD3PfVHKTzOsYlABEB\n' +
- 'AAEAB/0d/GNPwuFP73VsAAAi/qUfmlPPkJYuaBBoBslW6s3XCYAn8wCxhTwm\n' +
- 'fKFrWEkcV/S2fr910Eu/gaURHggt+RxKFSXUD0z3MlTOhjHzgwQwt2Js53UG\n' +
- 'hvpoNuf421uuiJ97x771gs2F5a2M1vjU5FvAlWji8hLtSVhYQVNN8BSZuhkK\n' +
- 'Adq+/MsHmOvD6YkBW2xuAGo1ZVF4D8JUJDUWcjRJCMr0gJJv34c8f74EYW8b\n' +
- 'LhrLGZgPRBkJemmN08sVwW5NLlPwjHTrvZOcb9RQ/N3liBwamk13dIEMNil1\n' +
- 'GjGI6txtd04SXN0nTq2e+v+n8jk3HgwM3ypTAbaO+XQSBWyhBAC/mIv9OK7t\n' +
- 'RoNA42+nJU+SYLEFFDew6x0b6Yg8k44gSiWiYadRWpDRP/essz641W1Ksn0a\n' +
- '02kx+m55tT6uQFFwly24FOaFexhfvhbKtmA+sfJtvQVNebgH/2EJn9QSti/y\n' +
- 'rGBStwDs48Psb2ZtcNNwhYajTACLioEF/vgx7FhKbQQA1reKmY5TefRFEK0b\n' +
- 'lBqkDyYZoLKxEAoXQ6IwrVbIdO2kvPVDjfAy1CqpCnDhzXdXYmHA3HHOPJgr\n' +
- 'PkLc8r0MeZR7ZI67JSSFoP2ixlxJjI06vXjQVvzrCigSJfL24LaBXBjQtd8t\n' +
- 'X+g4KpM+a5iGrE1dQ/dgCt/G97Ra2v7Ql5kD/01W5Q+NqXxb++YrTJOXaNhp\n' +
- 'yfSWYqtf62/xMoRBY8n/jtmyVD88i61aoqRsTDy+6Ugoi9QkrzhL7PSgn6Gl\n' +
- 'yy5whksUFHFIcXDGF0HtPLIuEUJ7V3tC9yZ8Q630o3Dirf1+tP6+aLoMLwb2\n' +
- '5O+SZFQk4cAVvW4aKbyGPdhlDvYxPkPNAMLAigQQAQgAPgWCZO9ApQQLCQcI\n' +
- 'CZD+BWKBkBMI0AMVCAoEFgACAQIZAQKbAwIeARYhBEXCtUQEMuKbuZLzrv4F\n' +
- 'YoGQEwjQAAC0VAf/VNnQ5xfPHhm6JfZ+cH2lUfy65pZ+5GqXHanB9RcxZPHe\n' +
- '9hzr0l1IJk4o48HUrIcwJhpBfXUsd9oLC81Un1io0uX37hE3in+ND4j11ZiR\n' +
- 'e8kQakH67/R7XKUaD3JTfXTshVpWhVTa1mjBZZcxOzr8ZxhnuaSQ7888t5cF\n' +
- '0zBuOo6YPmqiNVudlXlhXuiAVqp+xK5yamqxW9drz767aXUAvE9GChE4+P0i\n' +
- 'a1wwvvA2wkZTE2+rJKvAWA8iit4TeOTTDJoja0zc2yKxytdeOy6PWr6lGjjb\n' +
- 'zJEq9uqs1tx8znRosDkb+Gw26CHdUo2uVUDGkcesqxNUv+C/4R9eubBVYMfC\n' +
- '2ARk70ClAQgA38Hi0a1rqZAPdBaUnlqY4x4pIi2KyFPQ7TmW3Y/V1NgEm9Y8\n' +
- 'w3bx3TF8O8uDETn6U5ASUa2DG4gppcZrDqFsChnxhHOdJhEgh3X8LeyzuCHn\n' +
- 'qWQPbo2iCt3ve0fRsK/f0ZPABgCqlgTGkeVi7KppUqB1FtkRMfh0Eqr3fLC9\n' +
- 'pNRLtlnQT793rfavvXavK+0eeukZVPYbALuJq2tX0IBwr9+/6YEzSi7yo/1P\n' +
- 'pRZSRSM9KQwk/R2ohS2FAytUpTRp/4OFIJqv93PxS7MlHVfe/lhc9fXeTvH2\n' +
- 'sMQCfMsp16wP7Em+AjT5elJgXv3VrQ4whrr5yGfTvO9uQVoV7LKoWQARAQAB\n' +
- 'AAf7BXspAJiiTGQnYsE6WQIwYFDg8lHCBmv6MFNysQD43JbBjyUxdhrL7C6O\n' +
- 'A+N1dZaxXXpoHnjU/zfHyGQqw3AcFsfBqSxRV0lAXh0bZS8ZDGvFMlqtf5hn\n' +
- '1aMP3pnY5r56Kba4M5Vw2E2r5Q9Ey/YVMCVW1O1SjOIwirQGLbdhH+BZMvcf\n' +
- 'iAJ2fbQ919cX3CuATJnMs1/4Q+7dzPcksE1SON6eGeixrzXAr1y/Ls04wx9/\n' +
- 'DXsXyPunzNDVdZPttEbpNcWv3gZ9MHpYIYbC3kbuopC7ICvW4pkSGkl+uiV8\n' +
- 'iqoi+AxjgCvXSq+eVI11sZJ+Rjqi7M9yW5qjxzw2Wy25sQQA6Jm1+nXwo0UX\n' +
- 'NagosTXSf++9CDraFdbbpz2HUX8B6Ls8HwTMQ7q/EZRqmjKqeT/BxVQVp+O6\n' +
- 'WNMtpnGMUQrbDI6Tcu6C3kVhZg/R9dWpRigsOHnsySrI74nYh9DBISAkabCf\n' +
- 'cqir7V7treB5vcIaS80ys1vFHgtuLtTgFisCfpEEAPZEb0rbQ5PR5yTBvE80\n' +
- '0MW3OnNDqZ8905GHJ6IGJVOuQuDQfMoZ+06757IwrWrQ6mZk5WIyiHD31+tr\n' +
- 'd58MP351/0wv1/WUkPEcwuxWuTIK1kKtwQkcl75wZbnqvAGOigAFlvOTNPnD\n' +
- 'qZVODWmod1Yg0dLIB3HF/xV29nx5ngFJA/9ifa68aMeoZqd3CePMS3zUwyLy\n' +
- '6ZZ2cnUuBLjf87Fl9Rl+OLPMryEwA24I6ybcaa01ZsUgG2SZIwkKAovEhgmJ\n' +
- 'll5mXY9GNpULHj9fr2KyLkweFnvyTwIpv0VlT7WzEthebIM0hC0eSJyNmu2C\n' +
- '/SQTKvYUIcwP3v1RMFsCNPV1dTy+wsB2BBgBCAAqBYJk70ClCZD+BWKBkBMI\n' +
- '0AKbDBYhBEXCtUQEMuKbuZLzrv4FYoGQEwjQAABMkAf/UKvQHe+oYH/hU0/p\n' +
- '7OXUMCKIzSHD9c7lrb2nnP4CGyxF+FoZbQ9qnMVuT6FX6zPyZgDtOjp8Grvc\n' +
- 'ACBibxwujfnNdKBdA1r0XQGf2ht3BWYpgn9jGYw58bf3yaxr6/Dg1D7FzgbN\n' +
- 'FkaarU8C4fEAhiAHY4SpMUzqej/QfrwvasjyqPnbD+vCqyTivNmpTb6LYzXP\n' +
- 'BtXQW0A1B6EhmFwftGyNxIG1wEO+tWE4v4XLCyscAz8ZBMBPdfaRe26lnr6C\n' +
- 'UnTUwL+VecX2uIVRE9w9FhXuKeaPoDzPWnu0SZ6WCUV3DxQwMoUB/3vJ8sRK\n' +
- 'l2L+h0L32V6yjL0asut2G+qfvw==\n' +
- '=o527\n' +
- '-----END PGP PRIVATE KEY BLOCK-----\n',
- pgpPublicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTvQKUBCACgsuLM540Bq39fAbLRGoaRZR5/lETkpQSArzP4+B+wxcQe\n' +
- 'IItuLF9z1+OHilx/uAJ6yWH2En8QdlSBRMDCSwhLOXYnrB5dTvEM2nm+v59H\n' +
- 'sIRkRUogXSIgTrcVG7Tt0JsrjBV2avOki1L4vzPvHEDUtlKcxdJ5914W2lSu\n' +
- '05xPG+ALRsYFki1ga6bt6kT1+v7GV+862hOHY/FugohLKdIZOo6CeI0ddnHF\n' +
- '9jL3pu4aTRn11VIphju3KQ2oCxF/6843OrA4X/GtVtsoRq00RBLuv61ZmRpr\n' +
- 'qsOgEz009cDEWdUWs8wvf75TG/MfYM4g+9nSWflJGMSD3PfVHKTzOsYlABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO9ApQQLCQcICZD+BWKBkBMI0AMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBEXCtUQEMuKbuZLzrv4FYoGQEwjQAAC0VAf/VNnQ5xfPHhm6\n' +
- 'JfZ+cH2lUfy65pZ+5GqXHanB9RcxZPHe9hzr0l1IJk4o48HUrIcwJhpBfXUs\n' +
- 'd9oLC81Un1io0uX37hE3in+ND4j11ZiRe8kQakH67/R7XKUaD3JTfXTshVpW\n' +
- 'hVTa1mjBZZcxOzr8ZxhnuaSQ7888t5cF0zBuOo6YPmqiNVudlXlhXuiAVqp+\n' +
- 'xK5yamqxW9drz767aXUAvE9GChE4+P0ia1wwvvA2wkZTE2+rJKvAWA8iit4T\n' +
- 'eOTTDJoja0zc2yKxytdeOy6PWr6lGjjbzJEq9uqs1tx8znRosDkb+Gw26CHd\n' +
- 'Uo2uVUDGkcesqxNUv+C/4R9eubBVYM7ATQRk70ClAQgA38Hi0a1rqZAPdBaU\n' +
- 'nlqY4x4pIi2KyFPQ7TmW3Y/V1NgEm9Y8w3bx3TF8O8uDETn6U5ASUa2DG4gp\n' +
- 'pcZrDqFsChnxhHOdJhEgh3X8LeyzuCHnqWQPbo2iCt3ve0fRsK/f0ZPABgCq\n' +
- 'lgTGkeVi7KppUqB1FtkRMfh0Eqr3fLC9pNRLtlnQT793rfavvXavK+0eeukZ\n' +
- 'VPYbALuJq2tX0IBwr9+/6YEzSi7yo/1PpRZSRSM9KQwk/R2ohS2FAytUpTRp\n' +
- '/4OFIJqv93PxS7MlHVfe/lhc9fXeTvH2sMQCfMsp16wP7Em+AjT5elJgXv3V\n' +
- 'rQ4whrr5yGfTvO9uQVoV7LKoWQARAQABwsB2BBgBCAAqBYJk70ClCZD+BWKB\n' +
- 'kBMI0AKbDBYhBEXCtUQEMuKbuZLzrv4FYoGQEwjQAABMkAf/UKvQHe+oYH/h\n' +
- 'U0/p7OXUMCKIzSHD9c7lrb2nnP4CGyxF+FoZbQ9qnMVuT6FX6zPyZgDtOjp8\n' +
- 'GrvcACBibxwujfnNdKBdA1r0XQGf2ht3BWYpgn9jGYw58bf3yaxr6/Dg1D7F\n' +
- 'zgbNFkaarU8C4fEAhiAHY4SpMUzqej/QfrwvasjyqPnbD+vCqyTivNmpTb6L\n' +
- 'YzXPBtXQW0A1B6EhmFwftGyNxIG1wEO+tWE4v4XLCyscAz8ZBMBPdfaRe26l\n' +
- 'nr6CUnTUwL+VecX2uIVRE9w9FhXuKeaPoDzPWnu0SZ6WCUV3DxQwMoUB/3vJ\n' +
- '8sRKl2L+h0L32V6yjL0asut2G+qfvw==\n' +
- '=4XKH\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n'
-}
```
-| Param | Type | Remarks |
-| ------------------------ | ----------------------- | ------------------------------ |
-| `decryptedPgpPrivateKey` | `string` | Push Profile's PGP Private key |
-| `pgpPublicKey` | `string` | Push Profile's PGP Public key |
-| `decryptedPassword` | `string` or `undefined` | Push Profile's Password |
+**Parameters:**
+
+| Parameter | Type | Default | Description |
+| --- | --- | --- | --- |
+| delegate | string | - | delegator address in CAIP |
+| Note: Support for contract interaction via viem is coming soon | | | |
+
+
+ Expected response (Remove Delegate)
+```typescript
+ { transactionHash: "0xee8055ffb8ce35268900c64a57ae28fa5f7ab56879311bb467640c0e7af79d4a"
+ }
+```
---
-### **Update Encryption**
+### **Alias Information**
-```typescript
-// Update keys encryption
-const aliceUpdateEncryption = await userAlice.encryption.update(
- ENCRYPTION_VERSION.PGP_V3
-);
-```
+```tsx
+// fetch alias info
+const aliasInfo = userAlice.channel.alias.info({alias: '0xABC', aliasChain:'POLYGON'})
-| Param | Type | Default | Remarks |
-| ------------------------ | --------------------------------------- | ------- | ----------------------------------------------------- |
-| `updatedEncryptionType` | `ENCRYPTION_TYPE` | - | New Encryption Scheme to which keys are to be updated |
-| `options` \* | `object` | - | Optional Configuration for updating encryption |
-| `options.versionMeta` \* | `{ NFTPGP_V1 ?: { password : string} }` | - | New Password ( In case of NFT Profile ) |
+```
-\* - Optional
+| 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' |
-
- Expected response
+ Expected response (Alias Info)
```typescript
{
- did: 'eip155:0xEaC9c666570782E262f1E2a0b1d3BE4B95aFA7cd',
- wallets: 'eip155:0xEaC9c666570782E262f1E2a0b1d3BE4B95aFA7cd',
- publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
- '\n' +
- 'xsBNBGTu6YUBCACa7JaMqfhAnD/9ynE5Rhi8KNQ1tfdQe0ay/9jXX2naZIA+\n' +
- '6WCi1uNcB2TTLfMuzsEl4u/26LTgtkr51snRt2QKgEqi5dXqbRD76wiRLd4h\n' +
- 'ktBb4WB28o+BWOHYYJQq8he+zu3mQWjKLb1e9DyS0cTzwPwWVKce9IsG3NOi\n' +
- 'eM7O5Kg5cU3qHXR+frF25peCBrzNXH+xuuTJPsX85h9dSz/u6dWXhk2LsX3s\n' +
- 'cmX5mFcFErnGvUBddDGZc11q+WzZAtENPCxQrNjpkMtzCj9UMwgsJdzBghZZ\n' +
- 'ZouGTG2uhfmIj3/KHOdwx/KGpTgC1iMVOb78kw9LmaxL6fGy4x9uvvI3ABEB\n' +
- 'AAHNAMLAigQQAQgAPgWCZO7phQQLCQcICZABDloJB8hpcgMVCAoEFgACAQIZ\n' +
- 'AQKbAwIeARYhBMga3B8GDU79nd/0mAEOWgkHyGlyAAAbHAf/bJMPIyvNZNjO\n' +
- 'JK2xA1hYpzIGdbi3jMego6GXrmet3qY50zMKDccB2Ot399y/nmWMVEyfKYaP\n' +
- '7N+mJbeAqIZ8TAHtpw++k/h8/hXoxb9iPsQyWYossuG499XyHnk+KEd4g0Wf\n' +
- 'mqPk/XJB3xLLgW820jOsRRbWLyYKJEdh1Q+GIM+D6oIJ9ZmyRPv25u6yCF2P\n' +
- '2IQZErWeYD/LxqMDw+uHdRZJRiyFy/Y7A43clejN+p3my8oktXh2N4+tEl7i\n' +
- 'Hwxc5z9AOffuEyUerm0Rjwdn8rG8po7AfuXwmTiW1Sdc9TdJtAK/n6e9EFHV\n' +
- 'gHzArwyaydHHy80Wqa+UF591NkPi387ATQRk7umFAQgAs0ao+EFoKJirGHfI\n' +
- '69vZg+eAAUUKG657BzNzTAF2r5Y+a61jdcCAL+DXBcfks+H0dqG36zjOZTCJ\n' +
- 'NirABp5RRPFty2VvUtOyezuKX/MBVg3st3t/yE3SncVaWMblAv3iegviNNpH\n' +
- 'cFKqpHoVBWDNdhFHNsKTjpJcq3BVohy2Dxh8Di8N/1+gEPxADvIuH9MQ8MJk\n' +
- '6lB9XYXBmmqtlQ3sB916mvusUIl8Zxw1C76yY0PAXz055zJMiL1vwo5gKDiV\n' +
- 'iKyzry3wq7upPGJyeTKu7uUMifTPhJtyYvon2TIik5DIgHpqKziirCrolA+s\n' +
- '7LhnFbawqDKleEdyCcL5mFCzXQARAQABwsB2BBgBCAAqBYJk7umFCZABDloJ\n' +
- 'B8hpcgKbDBYhBMga3B8GDU79nd/0mAEOWgkHyGlyAABIqQgAmK9ijEEvtWTm\n' +
- '7/mhkuDEtfPfcMexfkaCcGL4SdZqVz/h+eIL8+4EbI9uq+YTzcjtX8FAEQta\n' +
- 'KWFACNEOPmSy6Sb9bDoNZUVpDaZzNNtqIK9Brt4zjJLEsDfmkuW3S/SgIYBQ\n' +
- 'yTkuNmmAf8dr7L4fG0JlxPyGaL1/w9UDAr7xdU7WcHuyPc0edDGeE7NwaGWp\n' +
- 'uBipXFw8AkikV3fCTDuOi3uhkIzZ5zlGCshD7m0aDSABwr4hbFzLFBDSrsiW\n' +
- 'GKhWGYgf5Vx8qzlwXYYnoW/rn3UXWpeTXjq46ZNaxjHJ4VxGMyn/tHZOEjDE\n' +
- 'vHapLIAgGyw2b+s+zZSqsXaMkH8WOw==\n' +
- '=gPzx\n' +
- '-----END PGP PUBLIC KEY BLOCK-----\n',
- encryptedPrivateKey: '{"ciphertext":"4f1243e1ffa76180f46ade2eb093867750c6bf72e8d6c71c7c0edca176c2f9fb32c603bb5e52d933730e0350292431b6e5287b8201f60ce9151b6a141bde98cdc3d9e5df8f84e00e5e4173bdf28b66e9590db10195fbd41ed241a65ab84fb5da251f613376bf78efe1af64613dd54fb05dced7cf8de0907d61489712ad42f06b5c775d97d15dee09b1c58cd79f596674e403353bc7e03297aa0d3fdaecac573c962409622ff8b1335b6fbb661bd2d5f5a076d9079f857849ba917662b40151041eca71385844160fc603c4d1beefbf71b26ac8968de52d6bb534ef6d6e2ea987170059d7d881dc684d28b5b2817804fba3b659e3ec0e802583e581b9f75d2f7e69e428cba91e62719e9ca6697588389db89b982370d23952120c0f972ab4b3a0da888d52b5055c60785d276152e43929df532bc7d5d68c6bc3cfdd1ca780df346113999a19d8e4a96c02f149d1ee4cde802277081ef339153872c00c9e9ddfe3ba8da8c68c0565752fea32258087e66aab37397a27b0228b5ed1aeb09a93b80778fd7f949409106c4cd82ff550aafb9d7bdce8727a76882f59ef2c54a137e51f04b6c27a0b1b92cd781dafb489a5e8203232669f5416454cc9cfe8c5b0fd8abc19d9ef16285a8da0aca2ed747adef7b49b8215790266d9c4791c250b0580e89c6429d10a1bcd45cf016a7ae30e1db948147d992722a7191e31852e6fd3c3679d868f34ebbe65f255be4b90dd64ceb52eaeee7d3356683b7fd511729493c887289ddb0f00c65ca2a95114f0e37d3b73d06333e2787c5fa6dd6f6c9e8334ff153dd63e30c81247efd497cf2c038843d8653edf23822eae07dd19d0be26a921673185bcf016533fdb59150ff46096419e6a6aeb1bd4293fc8146848d715d43afd04aa40f2b5ae9d058671677aad2413952a20b5214e18bbf3b4b033d936d673a0302967de3f74b05b74bc6c89f30ddeaab1bf6c567fcee355797b6cba17c3fcc8955bdf096e2dda2577b3374089d8c9d287552e5658c91e812bd0b8b63482c8de98fde216dd557eb34bafca2f8e73dc4582fa36332e8869f2717519921605915d8e1c75a37295e198ec0af75926d89a6832456304474a10c567334998226d9b6f709ebc216fb067d958e78a622040c91f46af202273d0b40307fb34cba5a6a57fbb196ac6e88c16d527b9bdb04b12fa7ed0bc771692712ccd146c41890b5caddbbb13b8ba77e632b2d7597256fb576ce87d2aff35a0e953b8227a5dcbf30f7d189ca7f77f6f8b2c4eb2752199a7a485ab52a6b65b6edd6cf65caaeb6f65544cc74c2fb3431fa484fb69adbda08d2402da953f20425832b6a2d712d56a5cc34095f25fb9524a478a71d387b7dea45b4bd41e79c61dceca332898dfeecf83999ed4fad892e2ede714b93f3969ad140f38bfa95d321ae5ef089cf0ce435d59f8b6611c0fd014c67ed38646f0771f1a74c1f950ee0900d883aca3ec4efbb2f7737e717007ae757d874573d4d70c9d7e38f8ff30a29b983036e684c4eaf35a7c03ed32a8e3fc62f0863c56830127a5f3c0e905a93e7466a4f43f0793cb6752b9be8d03d7be26170f694ecbb200f611bbf1dac4b6ec085deb8c3d8ee188d8c9c8c17ca720c0f0dee4d00e5866b5443b6af6e69ca64b8eb5a8f5fa1e1d27bfacbf1b0ae11241215358f5045b0d1a73d1b15dbd904709340c1e2b42a4ef78f76b8f901d6337849cff1052f06a8919255b596fb36d2fdf789fdf611813d20729c26d517dde6f11a3f6045ec5158652e128cf7c483a0fb8ab772cb5cdb56e42e6bf8c863f173307c3e053168e54e9e65bcacbb144413ff76d08a94929e6cdde2c5944246a4b344f3ca0ada3b403429750bdce76f04668b05ed79e9119f00901e7f7b4f1eea8a1b5b0186e3ed41277040a257601b0f3917db595f3f1808d92071a4e9521a251e9c5a66f2c8a57511f61b9fd88df77330aeb4bc15c043814b33610d60f6d0a13fd7977efaa1843913f6d3a79bc88020406c9979163684efe7b7ade9613221d06b52cd96abd31b77a707748d52e6e16c8c90821f29359b35307c10dafce5f35c0ff9802c23aef19f0a95b49a317cd6207002a5a9b822b4c056c4cbf9b27045dda8325d93060f358bb837f00954a6e281d1bdd1817a7cce8ed4a801f9164d32c52739c1ac650109868664be1fabab47c675222dc9ff9d75f9fb49531c832264aa5b55998675975f59e34829ce90b00092bd77e46328a6459d5c967d905b8e976611b839925ad742500231fa86cb5f7e6f39cb1e2e36b81c55269ea0f5fdcba5c8c0e38a899540d52be49c83efae5243998b926f029dc2980d4fdb1c125db409d015e0b36bc02272da1c688ee1f61d23cbde585064ab1e2164d0ca529774ec7797407ba5d988c58853e74a124a64dc24d0289b6a599354faf64790177c3032f5d660d7b76dfbf1c03388a7c75b2309c509c6a92144e124c8bd188274bc844e8f0aa7b5a06e79ad5776b5a62003b89aef194dcc03cd3c1b1f3ea541805cfc4e18aa159f9b5395185b573538c9bab16876dff91f365d16dcc56b339b01b86882ef8e52c51edd9c5b2f8a35713ed6eb43036e09f64f6e59ab417958faff974b6705400b341439fef4cba371c601927da7e0a8f23e1c6d3e070a19c2216da85f159d60303ab1321e479f4c371372845cef03daa7d2776c18face6cfa2ff9eed26f9f0a353a0f1c9a99b2556dccc1212fcb5c2078a3b0e58a7f3f7b3f346d624435ef94c95d40dc726d2e7400ae405e89473a934e7646124e34473dfe17f7f9cf481aa059ef422508ffe67f9b9276084973db0683269a046c1a0aafa7ab075b28008cbfb862b7e30c8b2afa1c2923d914b3d2469266e8e0182274a3d8d89642723820e61aa2d97a9370789ec4e89ebee05b6c0bef10778caf2a34c2d7622dde5fa64b012bea6205127c3c845229ef553f013b73823dc6631078fc628532e3e518bdc790ab8460078dedf0c5cb00492136813e2b91679bba82f3cf95169751933bee4358f84154014dbcc1de1a30613218039ebb2444429380fd283d3b60bd5d5b470e861f6ecc751c22aa467168512a0ef45755e6b59a7be591bd3b08fde874b166ccfbbedba10a0956d2d18cbda515341c2112d6094a746e9f562db6543e5bde2c4d4f7c06b7550400d66f7242a14f34cd8a7374372f0eea49a49b72909fc11ff81ea54a1e2c07225cdee856383a657b0f13c14b00ae3b7b2a32a22beaab8cfd18641dbfa82619fdcdddd3339e9423e71c487305e8aa932b694e94c37c7e418e4014c8bb264f47e8283e216eeeabf0fbdd2f5eb8d0ea979738d4f18b7bf72d7711f5d22653f217c7305314ec2c47a0ecbf1dc8f9bc1379ae38e2a04e736a1171b947609bb66f8d352ce57230d709f196953471c5504c7f9f40ed2f64bf3bd04bd57521a364ea03b5f0603cceec7851738d97c3fd73c16547d4d143b009a79832a1ed244937dce09edf2d5e32ae52ab0331c449325dce9e5e8ed1563c967a5f92031f4275e3179274ef3e0752ac01caf8a20aabb23d584d4d6607833f95cfc92832d936c37bb8b37222aa842f48944d06b37434c8dce5f19b450a7d1bd568672ef2c8eaa2afb7cff404b33377a61061f56b01849feb918521a7d63cfbe12466aedc7159c577f213f2c157586b8719164cd7108edfa9211287b43aadbad997bc62f8169eec4a6e02aeb535f670878e6af538b5281da04470d318f893102613977390a434e0557302a68ce42e532d350446d4d813b84c07b42bf22fbe4889096ec6303574c95040d8dcfed1b9bd26782c5033d7d1a491fece156cbc19a705204ed38a547e00a09b73bc7a702ef9c2e659171d1daab63958268148aba59766bc7a4ffb68c1ae047d1f0c5fb45fbacd07079f72af301c6aa00eebc0662c6792fc707d388b339d4f45afbf576bacf8730ec3e0f1e9dc0f9a6d58fd146b2293aed8d110da24336f9a4c01ae12c03ce214c6502f5fbc5224dd8b8b2e4edf2af16b811e5c8595fa76cafe34ba66199caaed48b5dfd5ae74a3e6b6d51a09c70afc30ebc0f40d51a15f1a8c2c41ec482eddf14bed3fd11a9e2aa4446268af25b49e429e2528d5df57797f6f3cd431eb5ded8f830c85cecde8012c31500ce9363903739a6759704fa87bfef984ed0285c8c0a5bf2f0985b1b511eb4145e4b27e2df6aa7b5c7a913b76b1ca869151b75c0717389b3d186f4e4637a5ceba3cef64809c3a06551a6a46be31af61c0ef78afb057f6cc625647dc04dcd74eb97f7aee0f5640e24b7662c799013efb83c80ec2851acda7c6328de789ae99ce296494225bd169e49c9a12dc7e281778f7fe275e72571cd5a3608733998d2f6b96c1d26c25223153fc5afc2f6e3d72f57fbcb2d087d718d3b6703b286f1e340c23cd3bc715797edf3ce6d5169bcf783ac9686233cc0358725143008b25bfbd329e1c30654e4b4c9461239d41ae77f706e64e5e60ce6de83becfd056f2678f17474ab9f4976b2d7d5d014d78f716d7d4edbf6ce4ed44ed677274d6b9b6e4bf4946dfd1ed8b821c81957b4bf5cd534ed6ca84dadd9d6380513dc6406b32dcd5c1bfa468a79e88a56656e71aed0c6675540e1617a31e1c122295427590e83b63e8da58a6c5c21a15703994bdc2b90d399b62679a4269224257f3ead5a2dd0980e6f5a45c5a9392929cc4743e106c7335136c9f8a3a29190462eef908eab02cda97dbcb71dff26b0ef4dae51de293b4cff0ebf37fce1391247c5ccf77dfb64974c4a1e6beeaf82041bb0d653e2e9b612f3442bba8480b86fd7b35514fc056d7429d5fb36199d4a6f632ea615d9acc961082d9d91aca416b57582bcd2f182f5f5be02b3f597c680b2e6b37ee4d133e51d077491cb536d6261808c42684d0912fd7bcc97dacdf32394e7b","salt":"da23dc7dbf23136dabc337a0caa170c0db7e4efec5f5c8a648dff9b7cd7df49f","nonce":"fe0e4ec3d40fb7de21a354bf","version":"eip191-aes256-gcm-hkdf-sha256","preKey":"b43efae4c92a35d9c0b5f6178cb8b8a6642c77d0a9281f61beb9f6e8f7b006a5"}',
- verificationProof: 'eip191v2:0x97ca70a87ec658e0e488e8b9f71644ee23840d809803fcf5bdcd174c9f39cdeb27f6e3a8885fec5bede5f264b3996bc3fa019b0d52745a5573a972b7e79e321c1c',
- msgSent: 0,
- maxMsgPersisted: 1000,
- profile: {
- name: null,
- desc: null,
- picture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAqElEQVR4AcXBsQ3CUBBEwcfKCfIPnbgxF+ACKIYct+cGDpEdpCeCS0Damcu2PN40gqQaiE6QVAPREWbCTJgJM2EmzITZxJcg+acgqQaiEmbCTJhNQVINRCdIOgPRCZJKmAkzYTYNRLWfT6pjnalu54vOsc5U+/mkOtaZSpgJM2E2BUknSKr7eqWXdIKkEmbCTJhdtuXxphEkvxiIjjATZsJMmAkzYSbMPjaMJNvaf06gAAAAAElFTkSuQmCC',
- profileVerificationProof: null
- },
- origin: null,
- name: null,
- about: null,
- profilePicture: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAqElEQVR4AcXBsQ3CUBBEwcfKCfIPnbgxF+ACKIYct+cGDpEdpCeCS0Damcu2PN40gqQaiE6QVAPREWbCTJgJM2EmzITZxJcg+acgqQaiEmbCTJhNQVINRCdIOgPRCZJKmAkzYTYNRLWfT6pjnalu54vOsc5U+/mkOtaZSpgJM2E2BUknSKr7eqWXdIKkEmbCTJhdtuXxphEkvxiIjjATZsJMmAkzYSbMPjaMJNvaf06gAAAAAElFTkSuQmCC',
- numMsg: 0,
- allowedNumMsg: 1000,
- encryptionType: 'eip191-aes256-gcm-hkdf-sha256',
- signature: '0x97ca70a87ec658e0e488e8b9f71644ee23840d809803fcf5bdcd174c9f39cdeb27f6e3a8885fec5bede5f264b3996bc3fa019b0d52745a5573a972b7e79e321c1c',
- sigType: 'eip191v2',
- encryptedPassword: null,
- nftOwner: null,
- linkedListHash: null,
- nfts: null
+ channel: '0x0A087Fb5CC25F156115c8193Ef8116b77B9421F7',
+ alias_address: '0x93A829d16DE51745Db0530A0F8E8A9B8CA5370E5',
+ is_alias_verified: 1,
+ blocked: 0,
+ activation_status: 1
}
```
+
-| Parameter | Type | Remarks |
-| ------------------- | -------- | --------------------------------------------------------------- |
-| did | `string` | user decentralized identity |
-| wallets | `string` | all wallets associated to the did |
-| publicKey | `string` | Public PGP key |
-| encryptedPrivateKey | `string` | Encrypted PGP Private Key |
-| verificationProof | `string` | Verification proof |
-| msgSent | `number` | Number of messages sent |
-| maxMsgPersisted | `number` | Maximum number of messages that can be persisted |
-| profile | `object` | User profile information |
-| origin | `string` | Origin information (source of the data) |
-| name | `string` | Profile Name ( Deprecated ) |
-| about | `string` | Profile Description ( Deprecated ) |
-| profilePicture | `string` | Profile Picture ( Deprecated ) |
-| numMsg | `number` | Number of messages sent ( Deprecated ) |
-| allowedNumMsg | `number` | Maximum number of messages that can be persisted ( Deprecated ) |
-| encryptionType | `string` | Type of encryption used |
-| signature | `string` | Account signature ( Deprecated ) |
-| sigType | `string` | Type of signature ( Dprecated ) |
-| encryptedPassword | `null` | Encrypted user password ( Deprecated ) |
-| nftOwner | `null` | Owner of NFT ( Deprecated ) |
-| linkedListHash | `null` | Deprecated |
-| nfts | `null` | Information about owned NFTs( Dprecated ) |
+### **Stream Notifications**
+
+```tsx
+ // recevive stream of notification
+ userAlice.stream.on(STREAM.NOTIF, (data: any) => {
+ console.log(data)
+ })
+```
+
+
+ Expected response (Inbox)
+
+```typescript
+{
+ "event": "notification.inbox",
+ "origin": "other",
+ "timestamp": "2023-10-06T01:55:51.000Z",
+ "from": "0xfFA1aF9E558B68bBC09ad74058331c100C135280",
+ "to": [
+ "eip155:0xffa1af9e558b68bbc09ad74058331c100c135280"
+ ],
+ "notifID": "1676",
+ "channel": {
+ "name": "Testing Goerli",
+ "icon": "https://gateway.ipfs.io/ipfs/bafybeifu3tisz7cntfnoolwe6tthi554b2cdl46jzcr5amo6swucyautzq/QmYZZnnEuTnzjkhhnRZWaHgYTeHsohLZEme9LomWRYQAZ5",
+ "url": "https://dev.push.org/"
+ },
+ "meta": {
+ "type": "NOTIFICATION.BROADCAST"
+ },
+ "message": {
+ "notification": {
+ "title": "Testing Goerli - notification TITLE:",
+ "body": "notification BODY"
+ },
+ "payload": {
+ "title": "payload title",
+ "body": "sample msg body",
+ "cta": "",
+ "embed": "",
+ "meta": {
+ "domain": "push.org"
+ }
+ }
+ },
+ "config": {
+ "expiry": null,
+ "silent": false,
+ "hidden": false
+ },
+ "source": "ETH_TEST_GOERLI",
+ "raw": {
+ "verificationProof": "eip712v2:0xf2b50f07c7cdae4a493860554301dc017dd6f819f92db3aba534dffde210bfaa0f545818e919c42c3bb51181339af33ad83e3bc691ada7fcccdcbc7fb3b3abd91b::uid::feaa2d31-85ec-47d2-b38c-6f797f637de7"
+ }
+}
+```
---
+
+
+ Expected response (Spam)
+
+```typescript
+{
+ "event": "notification.spam",
+ "origin": "other",
+ "timestamp": "2023-10-06T01:55:51.000Z",
+ "from": "0xfFA1aF9E558B68bBC09ad74058331c100C135280",
+ "to": [
+ "eip155:0x1f1a304af17f22cac91eeca5f31a0f814d752377"
+ ],
+ "notifID": "1677",
+ "channel": {
+ "name": "Testing Goerli",
+ "icon": "https://gateway.ipfs.io/ipfs/bafybeifu3tisz7cntfnoolwe6tthi554b2cdl46jzcr5amo6swucyautzq/QmYZZnnEuTnzjkhhnRZWaHgYTeHsohLZEme9LomWRYQAZ5",
+ "url": "https://dev.push.org/"
+ },
+ "meta": {
+ "type": "NOTIFICATION.TARGETTED"
+ },
+ "message": {
+ "notification": {
+ "title": "Testing Goerli - notification TITLE:",
+ "body": "notification BODY"
+ },
+ "payload": {
+ "title": "payload title",
+ "body": "sample msg body",
+ "cta": "",
+ "embed": "",
+ "meta": {
+ "domain": "push.org"
+ }
+ }
+ },
+ "config": {
+ "expiry": null,
+ "silent": false,
+ "hidden": false
+ },
+ "source": "ETH_TEST_GOERLI",
+ "raw": {
+ "verificationProof": "eip712v2:0x6b903f16d0ce87483643e1502e7416203cb7ecef0e947a497f0fb6fbe1c43c3511f2f602b757ab02c1be7daa07f3872ee14e4d05134f1ecb3d11fe58324422c01c::uid::6c0fad10-d1eb-4779-84d3-3a96bd96263f"
+ }
+}
+```
+
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..7d07fba25 100644
--- a/packages/restapi/package.json
+++ b/packages/restapi/package.json
@@ -1,6 +1,6 @@
{
"name": "@pushprotocol/restapi",
- "version": "1.4.11",
+ "version": "1.4.22",
"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..6f7ec7b4b 100644
--- a/packages/restapi/project.json
+++ b/packages/restapi/project.json
@@ -35,7 +35,7 @@
"options": {
"preset": "angular",
"commitMessageFormat": "ci(${projectName}): 🎉 cut release to ${projectName}-v${version}",
- "postTargets": ["restapi:build", "restapi:ci-publish"]
+ "postTargets": ["socket:build", "restapi:build", "restapi:ci-publish"]
}
},
"ci-version-beta": {
@@ -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/alias/getAliasInfo.ts b/packages/restapi/src/lib/alias/getAliasInfo.ts
index e0413319f..549e73b25 100644
--- a/packages/restapi/src/lib/alias/getAliasInfo.ts
+++ b/packages/restapi/src/lib/alias/getAliasInfo.ts
@@ -34,7 +34,7 @@ export const getAliasInfo = async (
const aliasChainId:number = ALIAS_CHAIN_ID[aliasChain][env];
const _alias = getCAIPWithChainId(alias, aliasChainId, 'Alias');
- console.log(_alias)
+ // console.log(_alias)
const API_BASE_URL = getAPIBaseUrls(env);
const apiEndpoint = `${API_BASE_URL}/v1/alias`;
const requestUrl = `${apiEndpoint}/${_alias}/channel`;
diff --git a/packages/restapi/src/lib/channels/index.ts b/packages/restapi/src/lib/channels/index.ts
index 51f12c24e..6e584d9d3 100644
--- a/packages/restapi/src/lib/channels/index.ts
+++ b/packages/restapi/src/lib/channels/index.ts
@@ -4,4 +4,6 @@ export * from './search';
export * from './subscribe';
export * from './unsubscribe';
export * from './_getSubscribers';
-export * from './getSubscribers';
\ No newline at end of file
+export * from './getSubscribers';
+export * from './subscribeV2';
+export * from './unsubscribeV2';
diff --git a/packages/restapi/src/lib/channels/signature.helpers.ts b/packages/restapi/src/lib/channels/signature.helpers.ts
index 33f977f4e..fadb4e480 100644
--- a/packages/restapi/src/lib/channels/signature.helpers.ts
+++ b/packages/restapi/src/lib/channels/signature.helpers.ts
@@ -1,47 +1,77 @@
-
-type channelActionType = "Unsubscribe" | "Subscribe";
+type channelActionType = 'Unsubscribe' | 'Subscribe';
export const getDomainInformation = (
chainId: number,
verifyingContract: string
) => {
return {
- name: "EPNS COMM V1",
+ name: 'EPNS COMM V1',
chainId,
verifyingContract,
};
-}
-
+};
+
export const getSubscriptionMessage = (
channel: string,
userAddress: string,
action: channelActionType
) => {
- const actionTypeKey = (action === "Unsubscribe") ? "unsubscriber" : "subscriber";
-
+ const actionTypeKey =
+ action === 'Unsubscribe' ? 'unsubscriber' : 'subscriber';
+
return {
channel,
[actionTypeKey]: userAddress,
action: action,
};
-}
+};
+
+export const getSubscriptionMessageV2 = (
+ channel: string,
+ userAddress: string,
+ action: channelActionType,
+ userSetting?: string | null
+) => {
+ const actionTypeKey =
+ action === 'Unsubscribe' ? 'unsubscriber' : 'subscriber';
+ if (action == 'Subscribe') {
+ return JSON.stringify({
+ channel,
+ [actionTypeKey]: userAddress,
+ action: action,
+ userSetting: userSetting?? '',
+ }, null, 4);
+ } else {
+ return JSON.stringify({
+ channel,
+ [actionTypeKey]: userAddress,
+ action: action,
+ }, null, 4);
+ }
+};
export const getTypeInformation = (action: string) => {
- if (action === "Subscribe") {
+ if (action === 'Subscribe') {
return {
Subscribe: [
- { name: "channel", type: "address" },
- { name: "subscriber", type: "address" },
- { name: "action", type: "string" },
+ { name: 'channel', type: 'address' },
+ { name: 'subscriber', type: 'address' },
+ { name: 'action', type: 'string' },
],
};
}
return {
Unsubscribe: [
- { name: "channel", type: "address" },
- { name: "unsubscriber", type: "address" },
- { name: "action", type: "string" },
+ { name: 'channel', type: 'address' },
+ { name: 'unsubscriber', type: 'address' },
+ { name: 'action', type: 'string' },
],
};
-};
\ No newline at end of file
+};
+
+export const getTypeInformationV2 = () => {
+ return {
+ Data: [{ name: 'data', type: 'string' }],
+ };
+};
diff --git a/packages/restapi/src/lib/channels/subscribeV2.ts b/packages/restapi/src/lib/channels/subscribeV2.ts
new file mode 100644
index 000000000..b86b8e937
--- /dev/null
+++ b/packages/restapi/src/lib/channels/subscribeV2.ts
@@ -0,0 +1,111 @@
+import axios from 'axios';
+import {
+ getCAIPAddress,
+ getConfig,
+ getCAIPDetails,
+ signTypedData,
+} from '../helpers';
+import {
+ getDomainInformation,
+ getTypeInformationV2,
+ getSubscriptionMessageV2,
+} from './signature.helpers';
+import Constants, { ENV } from '../constants';
+import { SignerType } from '../types';
+
+export type SubscribeOptionsV2Type = {
+ signer: SignerType;
+ channelAddress: string;
+ userAddress: string;
+ settings?: string | null;
+ verifyingContractAddress?: string;
+ env?: ENV;
+ onSuccess?: () => void;
+ onError?: (err: Error) => void;
+};
+
+export const subscribeV2 = async (options: SubscribeOptionsV2Type) => {
+ const {
+ signer,
+ channelAddress,
+ userAddress,
+ settings = undefined,
+ verifyingContractAddress,
+ env = Constants.ENV.PROD,
+ onSuccess,
+ onError,
+ } = options || {};
+ try {
+ const _channelAddress = await getCAIPAddress(
+ env,
+ channelAddress,
+ 'Channel'
+ );
+
+ const channelCAIPDetails = getCAIPDetails(_channelAddress);
+ if (!channelCAIPDetails) throw Error('Invalid Channel CAIP!');
+
+ const chainId = parseInt(channelCAIPDetails.networkId, 10);
+
+ const _userAddress = await getCAIPAddress(env, userAddress, 'User');
+
+ const userCAIPDetails = getCAIPDetails(_userAddress);
+ if (!userCAIPDetails) throw Error('Invalid User CAIP!');
+
+ const { API_BASE_URL, EPNS_COMMUNICATOR_CONTRACT } = getConfig(
+ env,
+ channelCAIPDetails
+ );
+
+ const requestUrl = `${API_BASE_URL}/v1/channels/${_channelAddress}/subscribe`;
+ // get domain information
+ const domainInformation = getDomainInformation(
+ chainId,
+ verifyingContractAddress || EPNS_COMMUNICATOR_CONTRACT
+ );
+
+ // get type information
+ const typeInformation = getTypeInformationV2();
+
+ // get message
+ const messageInformation = {
+ data: getSubscriptionMessageV2(
+ channelCAIPDetails.address,
+ userCAIPDetails.address,
+ 'Subscribe',
+ settings
+ ),
+ };
+ // sign a message using EIP712
+ const signature = await signTypedData(
+ signer,
+ domainInformation,
+ typeInformation,
+ messageInformation,
+ 'Data'
+ );
+
+ const verificationProof = signature; // might change
+
+ const body = {
+ verificationProof: `eip712v2:${verificationProof}`,
+ message:
+ messageInformation.data,
+
+ };
+
+ const res = await axios.post(requestUrl, body);
+
+ if (typeof onSuccess === 'function') onSuccess();
+
+ return { status: res.status, message: 'successfully opted into channel' };
+ } catch (err: any) {
+
+ if (typeof onError === 'function') onError(err as Error);
+
+ return {
+ status: err?.response?.status?? '' ,
+ message: err instanceof Error ? err.message : JSON.stringify(err),
+ };
+ }
+};
diff --git a/packages/restapi/src/lib/channels/unsubscribeV2.ts b/packages/restapi/src/lib/channels/unsubscribeV2.ts
new file mode 100644
index 000000000..f792fb782
--- /dev/null
+++ b/packages/restapi/src/lib/channels/unsubscribeV2.ts
@@ -0,0 +1,110 @@
+import axios from 'axios';
+import {
+ getCAIPAddress,
+ getConfig,
+ getCAIPDetails,
+ signTypedData,
+} from '../helpers';
+import {
+ getTypeInformation,
+ getDomainInformation,
+ getSubscriptionMessage,
+ getTypeInformationV2,
+ getSubscriptionMessageV2,
+} from './signature.helpers';
+import Constants, { ENV } from '../constants';
+import { SignerType } from '../types';
+
+export type UnSubscribeOptionsV2Type = {
+ signer: SignerType;
+ channelAddress: string;
+ userAddress: string;
+ verifyingContractAddress?: string;
+ env?: ENV;
+ onSuccess?: () => void;
+ onError?: (err: Error) => void;
+};
+
+export const unsubscribeV2 = async (options: UnSubscribeOptionsV2Type) => {
+ const {
+ signer,
+ channelAddress,
+ userAddress,
+ verifyingContractAddress,
+ env = Constants.ENV.PROD,
+ onSuccess,
+ onError,
+ } = options || {};
+
+ try {
+ const _channelAddress = await getCAIPAddress(
+ env,
+ channelAddress,
+ 'Channel'
+ );
+
+ const channelCAIPDetails = getCAIPDetails(_channelAddress);
+ if (!channelCAIPDetails) throw Error('Invalid Channel CAIP!');
+
+ const chainId = parseInt(channelCAIPDetails.networkId, 10);
+
+ const _userAddress = await getCAIPAddress(env, userAddress, 'User');
+
+ const userCAIPDetails = getCAIPDetails(_userAddress);
+ if (!userCAIPDetails) throw Error('Invalid User CAIP!');
+
+ const { API_BASE_URL, EPNS_COMMUNICATOR_CONTRACT } = getConfig(
+ env,
+ channelCAIPDetails
+ );
+
+ const requestUrl = `${API_BASE_URL}/v1/channels/${_channelAddress}/unsubscribe`;
+
+ // get domain information
+ const domainInformation = getDomainInformation(
+ chainId,
+ verifyingContractAddress || EPNS_COMMUNICATOR_CONTRACT
+ );
+
+ // get type information
+ const typeInformation = getTypeInformationV2();
+
+ // get message
+ const messageInformation = {
+ data: getSubscriptionMessageV2(
+ channelCAIPDetails.address,
+ userCAIPDetails.address,
+ 'Unsubscribe'
+ ),
+ };
+
+ // sign a message using EIP712
+ const signature = await signTypedData(
+ signer,
+ domainInformation,
+ typeInformation,
+ messageInformation,
+ 'Unsubscribe'
+ );
+
+ const verificationProof = signature; // might change
+
+ const body = {
+ verificationProof: `eip712v2:${verificationProof}`,
+ message: messageInformation.data,
+ };
+
+ const res = await axios.post(requestUrl, body);
+
+ if (typeof onSuccess === 'function') onSuccess();
+
+ return { status: res.status, message: 'successfully opted into channel' };
+ } catch (err: any) {
+ if (typeof onError === 'function') onError(err as Error);
+
+ return {
+ status: err?.response?.status?? '' ,
+ message: err instanceof Error ? err.message : JSON.stringify(err),
+ };
+ }
+};
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/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/chat/helpers/payloadHelper.ts b/packages/restapi/src/lib/chat/helpers/payloadHelper.ts
index 3ced51cae..b322a8e00 100644
--- a/packages/restapi/src/lib/chat/helpers/payloadHelper.ts
+++ b/packages/restapi/src/lib/chat/helpers/payloadHelper.ts
@@ -287,7 +287,7 @@ export const groupDtoToSpaceDto = (groupDto: GroupDTO): SpaceDTO => {
if (groupDto.rules) {
spaceDto.rules = {
- spaceAccess: groupDto.rules.groupAccess,
+ entry: groupDto.rules.entry,
};
}
@@ -296,23 +296,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/chat/send.ts b/packages/restapi/src/lib/chat/send.ts
index bbf8a542d..674c85b52 100644
--- a/packages/restapi/src/lib/chat/send.ts
+++ b/packages/restapi/src/lib/chat/send.ts
@@ -13,16 +13,8 @@ import {
import { conversationHash } from './conversationHash';
import { ISendMessagePayload, sendMessagePayloadCore } 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
@@ -63,14 +55,18 @@ export const sendCore = 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,
@@ -148,36 +144,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 => {
@@ -213,6 +180,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/config.ts b/packages/restapi/src/lib/config.ts
index c4ed49fb2..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
@@ -25,10 +39,18 @@ 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 ETH_CHAIN_ID = {
+ [ENV.PROD]: 1,
+ [ENV.STAGING]: 5,
+ [ENV.DEV]: 5,
+ [ENV.LOCAL]: 5,
+};
export const ALIAS_CHAIN_ID = {
POLYGON: {
[ENV.PROD]: 137,
@@ -52,15 +74,86 @@ export const ALIAS_CHAIN_ID = {
[ENV.PROD]: 1101,
[ENV.STAGING]: 1442,
[ENV.DEV]: 1442,
- [ENV.LOCAL]: 420,
+ [ENV.LOCAL]: 1442,
},
+ ARBITRUMONE: {
+ [ENV.PROD]: 42161,
+ [ENV.STAGING]: 421613,
+ [ENV.DEV]: 421613,
+ [ENV.LOCAL]: 421613,
+ }
+};
+
+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]: {
@@ -83,6 +176,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 +202,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 +228,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,7 +254,153 @@ 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',
+ },
},
};
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/constants.ts b/packages/restapi/src/lib/constants.ts
index 4735b547a..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 = {
@@ -55,7 +54,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/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/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..0ef67d4f2 100644
--- a/packages/restapi/src/lib/payloads/helpers.ts
+++ b/packages/restapi/src/lib/payloads/helpers.ts
@@ -67,6 +67,9 @@ export function getPayloadForAPIInput(
...(inputOptions?.payload?.additionalMeta && {
additionalMeta: inputOptions?.payload?.additionalMeta,
}),
+ ...(inputOptions?.payload?.index && {
+ index: inputOptions?.payload?.index,
+ }),
},
recipients: recipients,
};
@@ -321,7 +324,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/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..a4ac86d79
--- /dev/null
+++ b/packages/restapi/src/lib/pushNotification/PushNotificationTypes.ts
@@ -0,0 +1,114 @@
+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;
+ settings?: UserSetting[];
+};
+
+export type UserSetting = {
+ enabled: boolean;
+ value?: number;
+};
+
+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;
+ index?: {
+ index: number;
+ value?: number;
+ };
+ 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;
+ enabled?: boolean;
+ ticker?: number;
+ };
+};
+
+export type NotificationSettings = NotificationSetting[];
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..ebd7ade15
--- /dev/null
+++ b/packages/restapi/src/lib/pushNotification/notification.ts
@@ -0,0 +1,206 @@
+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, settings } = 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)
+ );
+ // convert the setting to minimal version
+ const minimalSetting = this.getMinimalUserSetting(settings!);
+ return await PUSH_CHANNEL.subscribeV2({
+ signer: this.signer!,
+ channelAddress: channel,
+ userAddress: userAddressInCaip,
+ env: this.env,
+ settings: minimalSetting ?? '',
+ 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.unsubscribeV2({
+ 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..760057fd4
--- /dev/null
+++ b/packages/restapi/src/lib/pushNotification/pushNotificationBase.ts
@@ -0,0 +1,739 @@
+import { ENV } from '../constants';
+import { SignerType, ISendNotificationInputOptions } from '../types';
+import {
+ NotificationOptions,
+ CreateChannelOptions,
+ NotificationSettings,
+ UserSetting,
+} 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 = '+';
+const SLIDER_TYPE = 2;
+const BOOLEAN_TYPE = 1;
+const DEFAULT_ENABLE_VALUE = '1';
+const DEFAULT_TICKER_VALUE = '1';
+
+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;
+ // fetch the minimal version based on conifg that was passed
+ let index;
+ if (options.payload?.index) {
+ if (options.payload?.index.value) {
+ index =
+ options.payload.index.index +
+ SETTING_DELIMITER +
+ SLIDER_TYPE +
+ SETTING_DELIMITER +
+ options.payload.index.value;
+ } else {
+ index = options.payload.index.index + SETTING_DELIMITER + BOOLEAN_TYPE;
+ }
+ }
+ 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,
+ index: options.payload?.index ? index : '',
+ },
+ 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 == BOOLEAN_TYPE) {
+ notificationSetting =
+ notificationSetting +
+ SETTING_SEPARATOR +
+ BOOLEAN_TYPE +
+ SETTING_DELIMITER +
+ ele.default;
+ notificationSettingDescription =
+ notificationSettingDescription + SETTING_SEPARATOR + ele.description;
+ }
+ if (ele.type == 1) {
+ if (ele.data) {
+ const enabled = (ele.data && ele.data.enabled != undefined) ? Number(ele.data.enabled).toString() : DEFAULT_ENABLE_VALUE
+ const ticker = ele.data.ticker ?? DEFAULT_TICKER_VALUE
+ notificationSetting =
+ notificationSetting +
+ SETTING_SEPARATOR +
+ SLIDER_TYPE +
+ SETTING_DELIMITER+
+ enabled+
+ SETTING_DELIMITER +
+ ele.default +
+ SETTING_DELIMITER +
+ ele.data.lower +
+ SETTING_DELIMITER +
+ ele.data.upper +
+ SETTING_DELIMITER+
+ ticker
+
+ notificationSettingDescription =
+ notificationSettingDescription +
+ SETTING_SEPARATOR +
+ ele.description;
+ }
+ }
+ }
+ return {
+ setting: notificationSetting.replace(/^\+/, ''),
+ description: notificationSettingDescription.replace(/^\+/, ''),
+ };
+ }
+
+ protected getMinimalUserSetting(setting: UserSetting[]) {
+ if(!setting){
+ return null;
+ }
+ let userSetting = '';
+ let numberOfSettings = 0;
+ for (let i = 0; i < setting.length; i++) {
+ const ele = setting[i];
+ const enabled = ele.enabled ? 1 : 0;
+ if (ele.enabled) numberOfSettings++;
+ // slider type
+ if (Object.keys(ele).includes('value')) {
+ userSetting =
+ userSetting +
+ SLIDER_TYPE +
+ SETTING_DELIMITER +
+ enabled +
+ SETTING_DELIMITER +
+ ele.value;
+ } else {
+ // boolean type
+ userSetting = userSetting + BOOLEAN_TYPE + SETTING_DELIMITER + enabled;
+ }
+ if (i != setting.length - 1)
+ userSetting = userSetting + SETTING_SEPARATOR;
+ }
+ return numberOfSettings + SETTING_SEPARATOR + userSetting;
+ }
+}
diff --git a/packages/restapi/src/lib/pushapi/PushAPI.ts b/packages/restapi/src/lib/pushapi/PushAPI.ts
index a41d25b80..429b3aac3 100644
--- a/packages/restapi/src/lib/pushapi/PushAPI.ts
+++ b/packages/restapi/src/lib/pushapi/PushAPI.ts
@@ -1,40 +1,34 @@
-import Constants, { ENCRYPTION_TYPE, ENV, MessageType } from '../constants';
-import {
- ChatSendOptionsType,
- GroupAccess,
- GroupDTO,
- IFeeds,
- MessageWithCID,
- SignerType,
- Message,
- ProgressHookType,
- IUser,
-} 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,
@@ -49,540 +43,153 @@ 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
): 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: options?.version || defaultOptions.version,
+ versionMeta: options?.versionMeta || defaultOptions.versionMeta,
+ autoUpgrade:
+ options?.autoUpgrade !== undefined
+ ? options?.autoUpgrade
+ : defaultOptions.autoUpgrade,
+ streamOptions: {
+ ...defaultOptions.streamOptions,
+ ...(options?.streamOptions ?? {}),
+ },
};
- return await PUSH_CHAT.send(sendParams);
- },
- 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 = [];
- }
+ // Get account
+ // Derives account from signer if not provided
+ const derivedAccount = await getAccountAddress(
+ getWallet({
+ account: settings.account as string | null,
+ signer: signer,
+ })
+ );
- user.profile.blockedUsersList = [
- ...new Set([...user.profile.blockedUsersList, ...users]),
- ];
+ let decryptedPGPPrivateKey: string;
+ let pgpPublicKey: string;
- 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,
- });
- },
-
- 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,
- });
- },
-
- update: async (
- chatId: string,
- options: GroupUpdateOptions
- ): Promise => {
- // Fetch Group Details
- const group = 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,
});
- 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!');
- }
+ // Initialize PushAPI instance
+ const api = new PushAPI(
+ signer,
+ settings.env as ENV,
+ derivedAccount,
+ decryptedPGPPrivateKey,
+ pgpPublicKey,
+ settings.progressHook
+ );
- accounts.forEach((account) => {
- if (!isValidETHAddress(account)) {
- throw new Error(`Invalid account address: ${account}`);
+ if (settings.streamOptions.enabled) {
+ const streamInstance = await PushStream.initialize(
+ api.account,
+ decryptedPGPPrivateKey,
+ signer,
+ settings.progressHook,
+ {
+ ...settings.streamOptions,
+ env: settings.env, // Use the env from the top-level PushAPIInitializeProps
}
- });
-
- 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 (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/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/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/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..5fd42f966 100644
--- a/packages/restapi/src/lib/space/start.ts
+++ b/packages/restapi/src/lib/space/start.ts
@@ -24,21 +24,22 @@ 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 = {
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,
@@ -93,7 +94,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,
@@ -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..336175364 100644
--- a/packages/restapi/src/lib/types/index.ts
+++ b/packages/restapi/src/lib/types/index.ts
@@ -116,6 +116,7 @@ export interface ISendNotificationInputOptions {
* use additionalMeta instead
*/
metadata?: any;
+ index?: string;
};
recipients?: string | string[]; // CAIP or plain ETH
channel: string; // CAIP or plain ETH
@@ -315,10 +316,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 +328,7 @@ export type ConditionBase = {
subcategory?: string;
data?: Data;
access?: boolean;
+
};
export type Condition = ConditionBase & {
@@ -335,28 +337,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 +545,7 @@ export interface UserInfo {
isAdmin: boolean;
}
-type ethersV5SignerType = {
+export type ethersV5SignerType = {
_signTypedData: (
domain: TypedDataDomain,
types: Record>,
@@ -548,7 +557,7 @@ type ethersV5SignerType = {
privateKey?: string;
provider?: providers.Provider;
};
-type viemSignerType = {
+export type viemSignerType = {
signTypedData: (args: {
account: any;
domain: any;
@@ -565,6 +574,7 @@ type viemSignerType = {
account: { [key: string]: any };
privateKey?: string;
provider?: providers.Provider;
+
};
export type SignerType = ethersV5SignerType | viemSignerType;
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/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 9f1a7bbe3..3d5fff4f8 100644
--- a/packages/restapi/src/lib/user/index.ts
+++ b/packages/restapi/src/lib/user/index.ts
@@ -10,6 +10,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/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/channel/sendNotification.test.ts b/packages/restapi/tests/lib/channel/sendNotification.test.ts
new file mode 100644
index 000000000..692e8e740
--- /dev/null
+++ b/packages/restapi/tests/lib/channel/sendNotification.test.ts
@@ -0,0 +1,70 @@
+import * as path from 'path';
+import * as dotenv from 'dotenv';
+dotenv.config({ path: path.resolve(__dirname, '../../.env') });
+import * as PUSH_PAYLOAD from '../../../src/lib/payloads';
+import { expect } from 'chai';
+import Constants from '../../../src/lib/constants';
+import { ethers } from 'ethers';
+
+describe('PUSH_PAYLOAD.sendNotification functionality', () => {
+ let signer1: any;
+ let account1: string;
+ let signer2: any;
+ let account2: string;
+
+ beforeEach(async () => {
+ signer1 = new ethers.Wallet(
+ '0xb9d00f786e1d024cfed08f696a775217ff75501f4aacef5ec0795fc4a2eb9df1'
+ );
+ account1 = signer1.address;
+
+ const WALLET2 = ethers.Wallet.createRandom();
+ signer2 = new ethers.Wallet(WALLET2.privateKey);
+ account2 = WALLET2.address;
+ });
+
+ it('Should send notification with setting index', async () => {
+ enum IDENTITY_TYPE {
+ MINIMAL = 0,
+ IPFS = 1,
+ DIRECT_PAYLOAD = 2,
+ SUBGRAPH = 3,
+ }
+
+ enum NOTIFICATION_TYPE {
+ BROADCAST = 1,
+ TARGETTED = 3,
+ SUBSET = 4,
+ }
+
+ enum ENV {
+ PROD = 'prod',
+ STAGING = 'staging',
+ DEV = 'dev',
+ /**
+ * **This is for local development only**
+ */
+ LOCAL = 'local',
+ }
+ const res = await PUSH_PAYLOAD.sendNotification({
+ env: ENV.DEV,
+ signer: signer1,
+ type: NOTIFICATION_TYPE.BROADCAST,
+ identityType: IDENTITY_TYPE.DIRECT_PAYLOAD,
+
+ notification: {
+ title: 'hey',
+ body: 'hey',
+ },
+ payload: {
+ title: 'hey',
+ body: 'hey',
+ cta: '',
+ img: '',
+ index: '1-2-10',
+ },
+ channel: `eip155:5:${account1}`,
+ });
+ expect(res.status).to.be.equal(204);
+ });
+});
diff --git a/packages/restapi/tests/lib/channel/subscribeV2.test.ts b/packages/restapi/tests/lib/channel/subscribeV2.test.ts
new file mode 100644
index 000000000..b1bd3f0b4
--- /dev/null
+++ b/packages/restapi/tests/lib/channel/subscribeV2.test.ts
@@ -0,0 +1,56 @@
+import * as path from 'path';
+import * as dotenv from 'dotenv';
+dotenv.config({ path: path.resolve(__dirname, '../../.env') });
+import * as PUSH_CHANNEL from '../../../src/lib/channels/';
+import { expect } from 'chai';
+import Constants from '../../../src/lib/constants';
+import { ethers } from 'ethers';
+
+describe('PUSH_CHANNEL.subscribeV2 functionality', () => {
+ let signer1: any;
+ let account1: string;
+ let signer2: any;
+ let account2: string;
+
+ beforeEach(async () => {
+ const WALLET1 = ethers.Wallet.createRandom();
+ signer1 = new ethers.Wallet(WALLET1.privateKey);
+ account1 = WALLET1.address;
+
+ const WALLET2 = ethers.Wallet.createRandom();
+ signer2 = new ethers.Wallet(WALLET2.privateKey);
+ account2 = WALLET2.address;
+ });
+
+ it('Should subscribe to the channel via V2 without settings', async () => {
+ const res = await PUSH_CHANNEL.subscribeV2({
+ signer: signer1,
+ channelAddress: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681',
+ userAddress: `eip155:5:${account1}`,
+ env: Constants.ENV.STAGING,
+ });
+ expect(res.status).to.be.equal('success');
+ });
+
+ it('Should unsubscribe to the channel via V2 without settings', async () => {
+ const res = await PUSH_CHANNEL.unsubscribeV2({
+ signer: signer1,
+ channelAddress: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681',
+ userAddress: `eip155:5:${account1}`,
+ env: Constants.ENV.STAGING,
+ });
+ console.log(res)
+ expect(res.status).to.be.equal('success');
+ });
+
+ it('Should subscribe to the channel via V2 with settings', async () => {
+ const res = await PUSH_CHANNEL.subscribeV2({
+ signer: signer1,
+ channelAddress: 'eip155:5:0xD8634C39BBFd4033c0d3289C4515275102423681',
+ userAddress: `eip155:5:${account1}`,
+ env: Constants.ENV.STAGING,
+ userSetting: '2-1-0+2-1',
+ });
+ expect(res.status).to.be.equal('success');
+ });
+});
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/send.test.ts b/packages/restapi/tests/lib/chat/send.test.ts
index fc3e8d0dd..88dba0595 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,10 +15,7 @@ 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;
@@ -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/chat/updateGroup.test.ts b/packages/restapi/tests/lib/chat/updateGroup.test.ts
index 1ad448a69..5f10b2db5 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);
@@ -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/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 () => {
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..677d4ac8d
--- /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, {env: ENV.DEV})
+ // 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: 1, default: 1, description: 'My Notif Settings' },
+ {type: 2, default: 5, description: "My notif setting 2", data: {upper:100, lower:5, ticker: 10}}
+ ]);
+ // 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..a72d37db3
--- /dev/null
+++ b/packages/restapi/tests/lib/pushNotification/notification.test.ts
@@ -0,0 +1,207 @@
+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")
+ // })
+
+
+ });
+// });
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..faaf15126
--- /dev/null
+++ b/packages/restapi/tests/lib/pushNotification/onchain.test.ts
@@ -0,0 +1,242 @@
+// 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.only('Test minimal conversion', async () => {
+// const account2 = await signer2.getAddress();
+// const viemUser = new PushNotificationBaseClass(
+// signer,
+// ENV.STAGING,
+// account2
+// );
+// viemUser.getMinimalUserSetting([
+// { enabled: true },
+// { enabled: false, value: 10 },
+// { enabled: false },
+// { enabled: true, value: 10 },
+// ]);
+// });
+ // 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);
+ // });
+// it.only('Should get proper minnimal payload', async() => {
+// const inputData = [
+// {
+// type: 0,
+// default: 1,
+// description: 'test1',
+// },
+// {
+// type: 1,
+// default: 10,
+// description: 'test2',
+// data: {
+// upper: 100,
+// lower: 1,
+
+// ticker: 10
+// },
+// },
+// ];
+// const account2 = await signer2.getAddress();
+// const userAlice = new PushNotificationBaseClass(signer2, ENV.STAGING, account2,);
+// const minimalSettings = userAlice.getMinimalSetting(inputData);
+// console.log(minimalSettings);
+// });
+
+// it.only('Should get proper minnimal payload', async() => {
+// const inputData = [
+// {
+// type: 1,
+// default: 10,
+// description: 'test2',
+// data: {
+// upper: 100,
+// lower: 1,
+// enabled: false
+// },
+// },
+// {
+// type: 0,
+// default: 1,
+// description: 'test1',
+// },
+// ];
+// const account2 = await signer2.getAddress();
+// const userAlice = new PushNotificationBaseClass(signer2, ENV.STAGING, account2,);
+// const minimalSettings = userAlice.getMinimalSetting(inputData);
+// console.log(minimalSettings);
+// });
+ // 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/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');
+ });
});
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 d7bbe3e09..d5f2e96f0 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 |
@@ -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..dd8d4f64d 100644
--- a/packages/uiweb/src/lib/components/chat/ChatProfile/AddWalletContent.tsx
+++ b/packages/uiweb/src/lib/components/chat/ChatProfile/AddWalletContent.tsx
@@ -1,335 +1,215 @@
-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 ArrowGreyIcon from '../../../icons/CaretDownGrey.svg'
-import ArrowLeftIcon from '../../../icons/ArrowLeft.svg';
-import CloseIcon from '../../../icons/close.svg';
-import { Spinner } from "../../supportChat/spinner/Spinner";
-import { MoreLightIcon } from '../../../icons/MoreLight';
+import { useContext, useState } from 'react';
+
+import styled from 'styled-components';
+
+import { ThemeContext } from '../theme/ThemeProvider';
+import { useChatData } from '../../../hooks';
+import { MdError } from 'react-icons/md';
+
+import { Spinner } from '../../supportChat/spinner/Spinner';
import { MoreDarkIcon } from '../../../icons/MoreDark';
-import { SearchIcon } from '../../../icons/SearchIcon';
-import { Section, Span, Image } from "../../reusables/sharedStyling";
+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 useToast from "../helpers/NewToast";
-import { MdCheckCircle, MdError } from "react-icons/md";
-import { Modal } from "../helpers/Modal";
-
-
-
-export const AddWalletContent = ({ onSubmit, handlePrevious, onClose, memberList, handleMemberList, title, groupMembers, isLoading }: {onSubmit: ()=> void ,onClose: ()=> void, handlePrevious: ()=> void, memberList: any, handleMemberList: any, title: string, groupMembers: any, isLoading?: boolean }) => {
- 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);
- const groupInfoToast = useToast();
-
-
- useEffect(() => {
- if (isInValidAddress) {
- groupInfoToast.showMessageToast({
- toastTitle: 'Error',
- toastMessage: 'Invalid Address',
- toastType: 'ERROR',
- getToastIcon: (size) => (
-
- ),
- });
- }
- }, [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){
- groupInfoToast.showMessageToast({
- toastTitle: 'Error',
- toastMessage: 'Unsuccessful search, Try again',
- toastType: 'ERROR',
- getToastIcon: (size) => (
-
- ),
- });
- }
- };
-
- 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);
- };
+import { MemberListContainer } from './MemberListContainer';
+import useMediaQuery from '../../../hooks/useMediaQuery';
+import useToast from '../reusables/NewToast';
+
+import {
+ getNewChatUser,
+} from '../../../helpers';
+import { ModalButtonProps, User } from '../exportedTypes';
+import { addWalletValidation } from '../helpers/helper';
+import { device } from '../../../config';
+import CloseIcon from '../../../icons/close.svg';
+import { ChatSearchInput, CustomStyleParamsType, ModalHeader } from '../reusables';
+import useGetChatProfile from '../../../hooks/useGetChatProfile';
+import { BackIcon } from '../../../icons/Back';
+
+
+type AddWalletContentProps = {
+ onSubmit: () => void;
+ onClose: () => void;
+ handlePrevious: () => void;
+ memberList: any;
+ handleMemberList: any;
+ groupMembers: any;
+ isLoading?: boolean;
+ modalHeader: string;
+};
+export const AddWalletContent = ({
+ onSubmit,
+ handlePrevious,
+ onClose,
+ memberList,
+ handleMemberList,
+ groupMembers,
+ isLoading,
+ modalHeader,
+}: AddWalletContentProps) => {
+ const theme = useContext(ThemeContext);
+
+ const [filteredUserData, setFilteredUserData] = useState(null);
+ const { account, env } = useChatData();
+ const isMobile = useMediaQuery(device.mobileL);
+ const {fetchChatProfile} = useGetChatProfile();
+ const groupInfoToast = useToast();
+ const customSearchStyle:CustomStyleParamsType = {
+ background:theme.backgroundColor?.modalInputBackground,
+ border:theme.border?.modalInnerComponents,
+ placeholderColor:theme.textColor?.modalSubHeadingText,
+ fontSize:'15px',
+ fontWeight:'400'
+ };
+
+ const handleSearch = async ({searchedText}:{searchedText:string}): Promise => {
+ //fix ens search
+ const newChatUser = await getNewChatUser({
+ searchText: searchedText,
+ fetchChatProfile,
+ env,
+ });
+ if(newChatUser){
+ setFilteredUserData(newChatUser);
+ }
+ else{
+ groupInfoToast.showMessageToast({
+ toastTitle: 'Error',
+ toastMessage: 'Invalid Address',
+ toastType: 'ERROR',
+ getToastIcon: (size) => ,
+ });
+ }
+ };
+
+ const clearInput = () => {
+ setFilteredUserData(null);
+ };
const addMemberToList = (member: User) => {
let errorMessage = '';
- errorMessage = addWalletValidation(member, memberList, groupMembers, account);
+ errorMessage = addWalletValidation(
+ member,
+ memberList,
+ groupMembers,
+ account
+ );
if (errorMessage) {
groupInfoToast.showMessageToast({
toastTitle: 'Error',
toastMessage: errorMessage,
toastType: 'ERROR',
- getToastIcon: (size) => (
-
- ),
+ getToastIcon: (size) => ,
});
- } 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`}
-
-
-
-
-
- {filteredUserData ? (
-
- }
- darkIcon={}
- />
-
- ) : isLoadingSearch ? (
-
- ) : null}
-
-
- {memberList?.map((member: any, index: any) => (
- }
- darkIcon={}
- />
- ))}
-
-
-
- onSubmit()}
- isLoading={isLoading}
- memberListCount={memberList?.length > 0}
- theme={theme}
- >
- {!isLoading && groupMembers ? 'Add To Group' : ''}
- {isLoading && }
- ModalConfirmButton>
-
-
-
- )
-}
-
-const SearchBarContent = styled.form`
- position: relative;
- display: flex;
- flex: 1;
-`;
+ } else {
+ handleMemberList((prev: any) => [...prev, { ...member, isAdmin: false }]);
+ }
+
+ setFilteredUserData('');
+ clearInput();
+ };
+
+ const removeMemberFromList = (member: User) => {
+ const filteredMembers = memberList?.filter(
+ (user: any) => user.wallets.toLowerCase() !== member.wallets.toLowerCase()
+ );
+ handleMemberList(filteredMembers);
+ };
+
+ return (
+
+
+
+
+
+ Add Wallets
+
+
+
+ {groupMembers
+ ? `0${memberList?.length + groupMembers?.length} / 09 Members`
+ : `0${memberList?.length} / 09 Members`}
+
+
+
+
+
+ {filteredUserData && (
+
+ }
+ />
+
+ ) }
+
+
+ {memberList?.map((member: any, index: any) => (
+ }
+ />
+ ))}
+
+
+
+ onSubmit()}
+ isLoading={isLoading}
+ memberListCount={memberList?.length > 0}
+ theme={theme}
+ >
+ {!isLoading && groupMembers ? 'Add To Group' : ''}
+ {isLoading && }
+
+
+
+ );
+};
+
+
-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%;
+ flex: 1;
+ width: 100%;
+ margin-bottom:40px;
`;
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};
+ background-color: ${(props) => props.theme.scrollbarColor};
}
&::-webkit-scrollbar {
- background-color: ${(props) => props.theme.scrollBg};
+ background-color: ${(props) => props.theme.scrollbarColor};
width: 6px;
}
@@ -362,19 +242,24 @@ const MultipleMemberList = styled.div`
`;
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: center;
- box-shadow: none;
-`;
\ No newline at end of file
+ margin: 60px 0 0 0;
+ width: 197px;
+ background: ${(props) =>
+ props.memberListCount ? props.theme.backgroundColor.buttonBackground : props.theme.backgroundColor.buttonDisableBackground};
+ color: ${(props) =>
+ props.memberListCount ? props.theme.textColor.buttonText : props.theme.textColor.buttonDisableText};
+ border: ${(props) =>
+ props.memberListCount ? 'none' : props.theme.border.modal};
+ min-width: 50%;
+ box-sizing: border-box;
+ cursor: pointer;
+ border-radius: 12px;
+ padding: 16px;
+ font-size: 16px;
+ font-weight: 500;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-shadow: none;
+ height: 48px;
+`;
diff --git a/packages/uiweb/src/lib/components/chat/ChatProfile/ChatProfile.tsx b/packages/uiweb/src/lib/components/chat/ChatProfile/ChatProfile.tsx
index 4949a44b6..fa6d4e27b 100644
--- a/packages/uiweb/src/lib/components/chat/ChatProfile/ChatProfile.tsx
+++ b/packages/uiweb/src/lib/components/chat/ChatProfile/ChatProfile.tsx
@@ -1,182 +1,230 @@
// @typescript-eslint/no-non-null-asserted-optional-chain
-import { useContext, useEffect, useRef, useState } from "react";
-import { Image, Section, Span } from "../../reusables";
-import styled from "styled-components";
-import TokenGatedIcon from '../../../icons/Token-Gated.svg';
+import { useContext, useEffect, useRef, useState } from 'react';
+
+import styled from 'styled-components';
+import type { IUser } from '@pushprotocol/restapi';
+import { ethers } from 'ethers';
+import { ToastContainer } from 'react-toastify';
+
+import { Image, Section, Span } from '../../reusables';
+import { useChatData, useClickAway } from '../../../hooks';
+import { ThemeContext } from '../theme/ThemeProvider';
+import useGetGroupByID from '../../../hooks/chat/useGetGroupByID';
+import useChatProfile from '../../../hooks/chat/useChatProfile';
+import { GroupInfoModal } from './GroupInfoModal';
+import useMediaQuery from '../../../hooks/useMediaQuery';
+import { createBlockie } from '../../space/helpers/blockies';
+import { ProfileContainer } from '../reusables';
+import 'react-toastify/dist/ReactToastify.min.css';
+
+import { IGroup } from '../../../types';
+import { isValidETHAddress } from '../helpers/helper';
+import { IChatProfile, IChatTheme } from '../exportedTypes';
+import { InfuraAPIKey, allowedNetworks, device } from '../../../config';
+import { resolveNewEns, shortenText } from '../../../helpers';
+import TokenGatedIcon from '../../../icons/TokenGatedIcon.svg';
import PublicChatIcon from '../../../icons/Public-Chat.svg';
-import VideoChatIcon from '../../../icons/VideoCallIcon.svg';
import GreyImage from '../../../icons/greyImage.png';
import InfoIcon from '../../../icons/infodark.svg';
import VerticalEllipsisIcon from '../../../icons/VerticalEllipsis.svg';
-import type { IUser } from '@pushprotocol/restapi';
-import { useChatData, useClickAway, useDeviceWidthCheck } from "../../../hooks";
-import { ThemeContext } from "../theme/ThemeProvider";
-import { IChatTheme } from "../theme";
-import { pCAIP10ToWallet, resolveEns, resolveNewEns, shortenText } from "../../../helpers";
-import useGetGroupByID from "../../../hooks/chat/useGetGroupByID";
-import useChatProfile from "../../../hooks/chat/useChatProfile";
-import { IGroup } from "../../../types";
-import { GroupInfoModal } from "./GroupInfoModal";
-import { isValidETHAddress } from "../helpers/helper";
-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 { createBlockie } from "../../space/helpers/blockies";
-// import { NewToast } from "../helpers/NewToast";
-import { ToastContainer, toast } from 'react-toastify';
-import 'react-toastify/dist/ReactToastify.min.css';
-
-
-const Options = ({ options, setOptions, isGroup, chatInfo, groupInfo, setGroupInfo,theme }: OptionProps) => {
- const DropdownRef = useRef(null);
- const [modal, setModal] = useState(false);
-
- useClickAway(DropdownRef, () => {
- setOptions(false);
- });
- const ShowModal = () => {
- setModal(true);
- }
-
- if (groupInfo && isGroup){
- return (
-
-
-
- {groupInfo?.isPublic &&
- ()}
-
- setOptions(true)}>
-
-
- {options &&
- (
-
-
-
-
- Group Info
-
-
- )}
-
- {modal &&
- ()}
-
-
- )
- } else {
- return null }
- };
-
-
-
-
-
-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 isMobile = useMediaQuery(device.tablet);
- const l1ChainId = allowedNetworks[env].includes(1) ? 1 : 5;
- const provider = new ethers.providers.InfuraProvider(l1ChainId, InfuraAPIKey);
-
-
-
- const fetchProfileData = async () => {
- if(isValidETHAddress(chatId)){
- const ChatProfile = await fetchUserChatProfile({ profileId: chatId });
- setChatInfo(ChatProfile);
- setGroupInfo(null);
- setIsGroup(false);
- } else {
- const GroupProfile = await getGroupByID({ groupId : chatId})
- setGroupInfo(GroupProfile);
- setChatInfo(null);
- setIsGroup(true);
- }
+type OptionProps = {
+ options: boolean;
+ setOptions: React.Dispatch>;
+ isGroup: boolean;
+ groupInfo: IGroup | null | undefined;
+ setGroupInfo: React.Dispatch>;
+ theme: IChatTheme;
+};
+
+const Options = ({
+ options,
+ setOptions,
+ isGroup,
+ groupInfo,
+ setGroupInfo,
+ theme,
+}: OptionProps) => {
+ const DropdownRef = useRef(null);
+ const [modal, setModal] = useState(false);
+
+ useClickAway(DropdownRef, () => {
+ setOptions(false);
+ });
+
+ const ShowModal = () => {
+ setModal(true);
+ };
+
+ if (groupInfo && isGroup) {
+ return (
+
+ {/* {(groupInfo?.rules?.chat?.conditions || groupInfo.rules?.entry?.conditions) && (
+
+ )} */}
+
+
+ setOptions(true)}>
+
+
+ {options && (
+
+
+
+
+ Group Info
+
+
+ )}
+
+ {modal && (
+
+ )}
+
+
+ );
+ } else {
+ return null;
+ }
+};
+
+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 isMobile = useMediaQuery(device.tablet);
+ const l1ChainId = allowedNetworks[env].includes(1) ? 1 : 5;
+ const provider = new ethers.providers.InfuraProvider(l1ChainId, InfuraAPIKey);
+
+ const fetchProfileData = async () => {
+ if (isValidETHAddress(chatId)) {
+ const ChatProfile = await fetchUserChatProfile({ profileId: chatId });
+ const result = await resolveNewEns(chatId, provider);
+ setEnsName(result);
+ setChatInfo(ChatProfile);
+ setGroupInfo(null);
+ setIsGroup(false);
+ } else {
+ const GroupProfile = await getGroupByID({ groupId: chatId });
+ setGroupInfo(GroupProfile);
+ setChatInfo(null);
+ setIsGroup(true);
}
-
- const getName = async (chatId: string) => {
- if(isValidETHAddress(chatId)){
- const result = await resolveNewEns(chatId, provider);
- // if(result)
- console.log(result);
- setEnsName(result);
- }
+ };
+
+ const getImage = () => {
+ if (chatInfo || groupInfo) {
+ return isGroup
+ ? groupInfo?.groupImage ?? GreyImage
+ : chatInfo?.profile?.picture ??
+ createBlockie?.(chatId)?.toDataURL()?.toString();
+ } else {
+ return createBlockie?.(chatId)?.toDataURL()?.toString();
}
-
-
- useEffect(()=> {
- if(!chatId) return;
- fetchProfileData();
- getName(chatId);
- },[chatId, account, env])
-
- if (chatId && style === 'Info') {
- return (
-
- {chatInfo || groupInfo ? (
-
- ) : ()}
-
-
-
- {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 &&
+ };
+
+ const getProfileName = () => {
+ return 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);
+ };
+
+ useEffect(() => {
+ if (!chatId) return;
+ fetchProfileData();
+ }, [chatId, account, env]);
+
+ if (chatId && style === 'Info') {
+ return (
+
+
+
+
+
+ {/* {!isGroup &&
} */}
-
-
-
-
- )
- } else {
- return null;
- }
-}
-
+
+
+ );
+ } else {
+ return null;
+ }
+};
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;
@@ -189,28 +237,21 @@ const ImageItem = styled.div`
position: relative;
`;
-const DummyImage = styled.div`
- height: 48px;
- width: 48px;
- border-radius: 100%;
- background: #ccc;
-`;
-
const DropDownBar = styled.div`
- position: absolute;
- top: 30px;
- left: -130px;
- display: block;
- min-width: 140px;
- color: rgb(101, 119, 149);
- border: ${(props) => `1px solid ${props.theme.defaultBorder}`};
- background: ${(props) => props.theme.bgColorPrimary};
- z-index: 10;
- border-radius: 16px;
+ position: absolute;
+ top: 30px;
+ left: -130px;
+ display: block;
+ min-width: 140px;
+ color: rgb(101, 119, 149);
+ background: ${(props) => props.theme.backgroundColor.modalBackground};
+ border: ${(props) => props.theme.border.modalInnerComponents};
+ z-index: 10;
+ border-radius: ${(props) => props.theme.borderRadius.modalInnerComponents};
`;
const VideoChatSection = styled.div`
- margin: 0 25px 0 auto;
+ margin: 0 25px 0 auto;
`;
const DropDownItem = styled(Span)`
@@ -225,17 +266,8 @@ const DropDownItem = styled(Span)`
`;
const TextItem = styled(Span)`
- white-space: nowrap;
- overflow: hidden;
+ white-space: nowrap;
+ overflow: hidden;
`;
-
-
-
-
-
-
-
-
-
-
+//auto update members when an user accepts not done
diff --git a/packages/uiweb/src/lib/components/chat/ChatProfile/GroupInfoModal.tsx b/packages/uiweb/src/lib/components/chat/ChatProfile/GroupInfoModal.tsx
index c5a03ca8b..aca69ae8f 100644
--- a/packages/uiweb/src/lib/components/chat/ChatProfile/GroupInfoModal.tsx
+++ b/packages/uiweb/src/lib/components/chat/ChatProfile/GroupInfoModal.tsx
@@ -1,635 +1,969 @@
-import { useRef, useState } from "react";
-import styled from "styled-components";
-import { useChatData, useClickAway } from "../../../hooks";
-import { IGroup } from "../../../types";
-import { IChatTheme } from "../theme";
-import * as PushAPI from '@pushprotocol/restapi';
-import { IToast, ShadowedProps, UpdateGroupType } from "../exportedTypes";
-import { convertToWalletAddressList, getAdminList, getUpdatedAdminList, getUpdatedMemberList } from "../helpers/helper";
-import { DropdownValueType } from "./DropDown";
+import { useEffect, useRef, useState } from 'react';
+
+import styled from 'styled-components';
+import { MdCheckCircle, MdError } from 'react-icons/md';
+
+import { useChatData, useClickAway } from '../../../hooks';
+import { DropdownValueType } from '../reusables/DropDown';
+import { Section, Span, Image, Div } from '../../reusables/sharedStyling';
+import { AddWalletContent } from './AddWalletContent';
+import { Modal, ModalHeader } from '../reusables';
+import useMediaQuery from '../../../hooks/useMediaQuery';
+import useToast from '../reusables/NewToast';
+import useUpdateGroup from '../../../hooks/chat/useUpdateGroup';
+import { MemberProfileCard } from './MemberProfileCard';
+import { ProfileContainer } from '../reusables';
+
+import { IGroup } from '../../../types';
+import { IChatTheme } from '../theme';
+import { device } from '../../../config';
+import {
+ convertToWalletAddressList,
+ getAdminList,
+ getUpdatedAdminList,
+ getUpdatedMemberList,
+ isAccountOwnerAdmin,
+} from '../helpers/group';
+import LockIcon from '../../../icons/Lock.png';
+import LockSlashIcon from '../../../icons/LockSlash.png';
+import ArrowIcon from '../../../icons/CaretUp.svg';
+import addIcon from '../../../icons/addicon.svg';
import DismissAdmin from '../../../icons/dismissadmin.svg';
import AddAdmin from '../../../icons/addadmin.svg';
import Remove from '../../../icons/remove.svg';
-import { Section, Span, Image } from "../../reusables/sharedStyling";
-import CloseIcon from '../../../icons/close.svg';
-import { ProfileCard } from "./ProfileCard";
-import addIcon from '../../../icons/addicon.svg';
-import { pCAIP10ToWallet, shortenText } from "../../../helpers";
-import LockIcon from '../../../icons/Lock.png'
-import LockSlashIcon from '../../../icons/LockSlash.png'
-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 useToast from "../helpers/NewToast";
-import { MdCheckCircle, MdError } from "react-icons/md";
-
-
+import { shortenText } from '../../../helpers';
+import TokenGatedIcon from '../../../icons/TokenGatedIcon.svg';
+import ConditionsComponent from '../CreateGroup/ConditionsComponent';
+import { ConditionArray } from '../exportedTypes';
+import { ACCESS_TYPE_TITLE } from '../constants';
+
+const UPDATE_KEYS = {
+ REMOVE_MEMBER: 'REMOVE_MEMBER',
+ ADD_MEMBER: 'ADD_MEMBER',
+ REMOVE_ADMIN: 'REMOVE_ADMIN',
+ ADD_ADMIN: 'ADD_ADMIN',
+} as const;
+
+type UpdateKeys = typeof UPDATE_KEYS[keyof typeof UPDATE_KEYS];
+const SUCCESS_MESSAGE = {
+ REMOVE_MEMBER: 'Removed Member successfully',
+ ADD_MEMBER: 'Group Invitation sent',
+ REMOVE_ADMIN: 'Admin added successfully',
+ ADD_ADMIN: 'Removed added successfully',
+};
+
+type PendingMembersProps = {
+ groupInfo?: IGroup | null;
+ setShowPendingRequests: React.Dispatch>;
+ showPendingRequests: boolean;
+ theme: IChatTheme;
+};
+
+interface ShadowedProps {
+ setPosition: boolean;
+}
-const PendingMembers = ({ groupInfo, setShowPendingRequests, showPendingRequests, theme }: {groupInfo?: IGroup | null, setShowPendingRequests: React.Dispatch>, showPendingRequests: boolean, theme: IChatTheme }) => {
- if(groupInfo){
+const PendingMembers = ({
+ groupInfo,
+ setShowPendingRequests,
+ showPendingRequests,
+ theme,
+}: PendingMembersProps) => {
+ if (groupInfo) {
return (
-
+ setShowPendingRequests(!showPendingRequests)}
>
- setShowPendingRequests(!showPendingRequests)}>
- Pending Requests
- {groupInfo?.pendingMembers?.length}
-
-
- {/* */}
+
+ Pending Requests
+
+ {groupInfo?.pendingMembers?.length}
+
+
- {showPendingRequests && (
-
- {groupInfo?.pendingMembers && groupInfo?.pendingMembers?.length > 0 && groupInfo?.pendingMembers.map((item) => (
-
-
-
-
- {shortenText(item?.wallet?.split(':')[1] ?? '', 6, true)}
-
+ {showPendingRequests && (
+
+ {groupInfo?.pendingMembers &&
+ groupInfo?.pendingMembers?.length > 0 &&
+ groupInfo?.pendingMembers.map((item) => (
+
+
+
+ ))}
+
+ )}
+
+ );
+ } else {
+ return null;
+ }
+};
+
+const dummyConditonsData: ConditionArray[] = [
+ [{ operator: 'any' }],
+ [
+ {
+ type: 'PUSH',
+ category: 'ERC20',
+ subcategory: 'holder',
+ data: {
+ contract: 'eip155:1:0xf418588522d5dd018b425E472991E52EBBeEEEEE',
+ amount: 1,
+ decimals: 18,
+ },
+ },
+ ],
+ [
+ { operator: 'all' },
+ {
+ type: 'PUSH',
+ category: 'ERC20',
+ subcategory: 'holder',
+ data: {
+ contract: 'eip155:137:0x58001cC1A9E17A20935079aB40B1B8f4Fc19EFd1',
+ amount: 1,
+ decimals: 18,
+ },
+ },
+ {
+ type: 'PUSH',
+ category: 'ERC721',
+ subcategory: 'holder',
+ data: {
+ contract: 'eip155:137:0x58001cC1A9E17A20935079aB40B1B8f4Fc19EFd1',
+ amount: 1,
+ decimals: 18,
+ },
+ },
+ {
+ type: 'GUILD',
+ category: 'ROLES',
+ subcategory: 'DEFAULT',
+ data: {
+ id: '1',
+ role: '346243',
+ comparison: 'all',
+ },
+ },
+ ],
+ // [
+ // { operator: 'any' },
+ // {
+ // type: 'PUSH',
+ // category: 'INVITE',
+ // subcategory: 'DEFAULT',
+ // data: {
+ // inviterRoles: 'ADMIN',
+ // },
+ // },
+ // {
+ // type: 'PUSH',
+ // category: 'INVITE',
+ // subcategory: 'DEFAULT',
+ // data: {
+ // inviterRoles: 'OWNER',
+ // },
+ // },
+ // ],
+];
+
+const dummySingleCondtionData: ConditionArray[] = dummyConditonsData[2].map(
+ (criteria) => [criteria]
+);
+
+interface ConditionsInformationProps {
+ theme: IChatTheme;
+ groupInfo?: IGroup | null;
+}
-
- ))}
+export const ConditionsInformation = ({
+ theme,
+ groupInfo,
+}: ConditionsInformationProps) => {
+ return (
+
+ {(groupInfo?.rules?.chat?.conditions ||
+ groupInfo?.rules?.entry?.conditions) && (
+
+ )}
+ {Object.keys(ACCESS_TYPE_TITLE).map((key) => (
+ <>
+
+ { ACCESS_TYPE_TITLE[key as keyof typeof ACCESS_TYPE_TITLE]?.heading}
+
+
+
+
+ >
+ ))}
- )}
-
- )
- } else {return null }
+ );
+};
+
+interface GroupTypeProps {
+ theme: IChatTheme;
+ icon: string;
+ header: string;
+ subheader: string;
+ cursor?: string;
+ handleNextInformation?: () => void;
}
-export const GroupInfoModal = ({ theme, modal, setModal, groupInfo, setGroupInfo }: { theme: IChatTheme, modal: boolean, setModal: React.Dispatch>, groupInfo: IGroup, setGroupInfo: React.Dispatch> }) => {
- const { account, env, pgpPrivateKey } = useChatData();
- const [showAddMoreWalletModal, setShowAddMoreWalletModal] = useState(false);
- const [showPendingRequests, setShowPendingRequests] = useState(false);
- const [memberList, setMemberList] = useState([]);
- const [isLoading, setIsLoading] = useState(false);
- const [selectedMemberAddress, setSelectedMemberAddress] = useState(null);
-
- const handleClose = () => onClose();
- const dropdownRef = useRef(null);
- useClickAway(dropdownRef, () => setSelectedMemberAddress(null));
- const groupInfoToast = useToast();
-
-
- const groupCreator = groupInfo?.groupCreator;
- const membersExceptGroupCreator = groupInfo?.members?.filter((x) => x.wallet?.toLowerCase() !== groupCreator?.toLowerCase());
- const groupMembers = [...membersExceptGroupCreator, ...groupInfo.pendingMembers];
-
-
- const updateGroup = async (options:UpdateGroupType) => {
- const { groupInfo, connectedUser,adminList,memberList } = options;
- const updateResponse = await PushAPI.chat.updateGroup({
- chatId: groupInfo?.chatId,
- groupName: groupInfo?.groupName,
- groupDescription: groupInfo?.groupDescription ?? '',
- groupImage: groupInfo?.groupImage,
- members: memberList,
- admins: adminList,
- account: connectedUser?.wallets,
- pgpPrivateKey: pgpPrivateKey,
- env: env,
+const GroupTypeBadge = ({
+ theme,
+ icon,
+ header,
+ subheader,
+ handleNextInformation,
+ cursor,
+}: GroupTypeProps) => {
+ return (
+
+
+
+
+
+
+ {header}
+
+
+ {subheader}
+
+
+
+
+ );
+};
+
+type GroupSectionProps = GroupInfoModalProps & {
+ handleNextInformation: () => void;
+ handlePreviousInformation?: () => void;
+};
+
+type GroupInfoModalProps = {
+ theme: IChatTheme;
+ setModal: React.Dispatch>;
+ groupInfo: IGroup;
+ setGroupInfo: React.Dispatch>;
+};
+
+export const GROUPINFO_STEPS = {
+ GROUP_INFO: 1,
+ CRITERIA: 2,
+} as const;
+
+export type GROUP_INFO_TYPE =
+ typeof GROUPINFO_STEPS[keyof typeof GROUPINFO_STEPS];
+
+const GroupInformation = ({
+ theme,
+ setModal,
+ groupInfo,
+ setGroupInfo,
+ handleNextInformation,
+}: GroupSectionProps) => {
+ const { account } = useChatData();
+ const [showAddMoreWalletModal, setShowAddMoreWalletModal] =
+ useState(false);
+ const [showPendingRequests, setShowPendingRequests] =
+ useState(false);
+ const [memberList, setMemberList] = useState([]);
+ const [isLoading, setIsLoading] = useState(false);
+ const [checkedValue, setchecked] = useState(false);
+ const [selectedMemberAddress, setSelectedMemberAddress] = useState<
+ string | null
+ >(null);
+ const { updateGroup } = useUpdateGroup();
+ const isMobile = useMediaQuery(device.mobileL);
+
+ const handleClose = () => onClose();
+ const dropdownRef = useRef(null);
+ useClickAway(dropdownRef, () => setSelectedMemberAddress(null));
+ const groupInfoToast = useToast();
+
+ const groupCreator = groupInfo?.groupCreator;
+ const membersExceptGroupCreator = groupInfo?.members?.filter(
+ (x) => x.wallet?.toLowerCase() !== groupCreator?.toLowerCase()
+ );
+
+ const groupMembers = [
+ ...membersExceptGroupCreator,
+ ...groupInfo.pendingMembers,
+ ];
+
+ type UpdateGroupType = {
+ adminList: Array;
+ memberList: Array;
+ };
+
+ const handleUpdateGroup = async (options: UpdateGroupType) => {
+ const { adminList, memberList } = options || {};
+ const updateResponse = await updateGroup({
+ groupInfo,
+ memberList,
+ adminList,
+ });
+ return { updateResponse };
+ };
+
+ const handleAddRemove = async (
+ options: UpdateGroupType & { updateKey: UpdateKeys }
+ ) => {
+ const { adminList, memberList, updateKey } = options || {};
+
+ try {
+ setIsLoading(true);
+ const { updateResponse } = await handleUpdateGroup({
+ adminList,
+ memberList,
+ });
+
+ if (typeof updateResponse !== 'string') {
+ setGroupInfo(updateResponse);
+
+ groupInfoToast.showMessageToast({
+ toastTitle: 'Success',
+ toastMessage: SUCCESS_MESSAGE[updateKey],
+ toastType: 'SUCCESS',
+ getToastIcon: (size) => ,
});
- let updatedCurrentChat = null;
- if(typeof updateResponse !== 'string')
- {
- updatedCurrentChat = groupInfo;
- updatedCurrentChat = updateResponse;
- }
- return {updateResponse,updatedCurrentChat};
+ } else {
+ groupInfoToast.showMessageToast({
+ toastTitle: 'Error',
+ toastMessage: updateResponse,
+ toastType: 'ERROR',
+ getToastIcon: (size) => ,
+ });
+ }
+ } catch (error) {
+ console.error('Error', error);
+ groupInfoToast.showMessageToast({
+ toastTitle: 'Error',
+ toastMessage: 'Please, try again',
+ toastType: 'ERROR',
+ getToastIcon: (size) => ,
+ });
+ } finally {
+ if (updateKey === UPDATE_KEYS.ADD_MEMBER) handleClose();
+ setIsLoading(false);
+ setSelectedMemberAddress(null);
}
-
- const addMembers = async () => {
- //Already Present Members and PendingMembers
- const groupMemberList = convertToWalletAddressList([
- ...groupInfo.members,
- ...groupInfo.pendingMembers,
- ]);
-
- //Newly Added Members and alreadyPresent Members in the groupchat
- const newMembersToAdd = memberList.map((member: any) => member.wallets);
- const members = [...groupMemberList, ...newMembersToAdd];
-
- //Admins wallet address from both members and pendingMembers
- const adminList = getAdminList?.(groupInfo);
-
-
- try {
- setIsLoading(true);
- const connectedUser = await PushAPI.user.get({ account: account as string, env });
- const { updateResponse, updatedCurrentChat } = await updateGroup({
- groupInfo,
- connectedUser,
- adminList,
- memberList: members,
- });
-
- if (typeof updateResponse !== 'string') {
- setSelectedMemberAddress(null);
- setGroupInfo(updateResponse);
- } else {
- groupInfoToast.showMessageToast({
- toastTitle: 'Error',
- toastMessage: updateResponse,
- toastType: 'ERROR',
- getToastIcon: (size) => (
-
- ),
- });
- setSelectedMemberAddress(null);
- }
- setIsLoading(false);
- groupInfoToast.showMessageToast({
- toastTitle: 'Success',
- toastMessage: 'Group Invitation sent',
- toastType: 'SUCCESS',
- getToastIcon: (size) => (
-
- ),
- });
- handleClose();
- } catch (error) {
- setIsLoading(false);
- console.log('Error', error);
- groupInfoToast.showMessageToast({
- toastTitle: 'Error',
- toastMessage: 'Please, try again',
- toastType: 'ERROR',
- getToastIcon: (size) => (
-
- ),
- });
- }
- };
-
-
- const makeGroupAdmin = async () => {
- const groupMemberList = convertToWalletAddressList([
- ...groupInfo.members,
- ...groupInfo.pendingMembers,
- ]);
- const newAdminList = getUpdatedAdminList(groupInfo, selectedMemberAddress, false);
- try {
- const connectedUser = await PushAPI.user.get({ account: account as string, env });
- const { updateResponse, updatedCurrentChat } = await updateGroup({
- groupInfo,
- connectedUser,
- adminList: newAdminList,
- memberList: groupMemberList,
- });
- if (typeof updateResponse !== 'string') {
- setSelectedMemberAddress(null);
- setGroupInfo(updateResponse);
-
- groupInfoToast.showMessageToast({
- toastTitle: 'Success',
- toastMessage: 'Admin added successfully',
- toastType: 'SUCCESS',
- getToastIcon: (size) => (
- ),
- });
- } else {
- groupInfoToast.showMessageToast({
- toastTitle: 'Error',
- toastMessage: updateResponse,
- toastType: 'ERROR',
- getToastIcon: (size) => (
-
- ),
- });
- setSelectedMemberAddress(null);
- }
- } catch (e) {
- console.error('Error while adding admin', e);
- groupInfoToast.showMessageToast({
- toastTitle: 'Error',
- toastMessage: 'Error',
- toastType: 'ERROR',
- getToastIcon: (size) => (
-
- ),
- });
- }
- setSelectedMemberAddress(null);
- };
-
- const dismissGroupAdmin = async () => {
- const groupMemberList = convertToWalletAddressList([
- ...groupInfo.members,
- ...groupInfo.pendingMembers,
- ]);
- const newAdminList = getUpdatedAdminList(groupInfo, selectedMemberAddress, true);
- try {
- const connectedUser = await PushAPI.user.get({ account: account as string, env });
- const { updateResponse, updatedCurrentChat } = await updateGroup({
- groupInfo,
- connectedUser,
- adminList: newAdminList,
- memberList: groupMemberList,
- });
- if (typeof updateResponse !== 'string') {
- setSelectedMemberAddress(null);
- setGroupInfo(updateResponse);
-
- groupInfoToast.showMessageToast({
- toastTitle: 'Success',
- toastMessage: 'Admin removed successfully',
- toastType: 'SUCCESS',
- getToastIcon: (size) => (
- ),
- });
-
- } else {
- groupInfoToast.showMessageToast({
- toastTitle: 'Error',
- toastMessage: updateResponse,
- toastType: 'ERROR',
- getToastIcon: (size) => (
-
- ),
- });
- setSelectedMemberAddress(null);
- }
- } catch (e) {
- console.error('Error while dismissing admin', e);
- groupInfoToast.showMessageToast({
- toastTitle: 'Error',
- toastMessage: 'Please, try again',
- toastType: 'ERROR',
- getToastIcon: (size) => (
-
- ),
- });
- }
- setSelectedMemberAddress(null);
- };
-
- const removeMember = async () => {
- const updatedMemberList = getUpdatedMemberList(groupInfo, selectedMemberAddress!);
- const adminList = getUpdatedAdminList(groupInfo, selectedMemberAddress, true);
- try {
- const connectedUser = await PushAPI.user.get({ account: account as string, env });
- const { updateResponse, updatedCurrentChat } = await updateGroup({
- groupInfo,
- connectedUser,
- adminList,
- memberList: updatedMemberList,
- });
-
- if (typeof updateResponse !== 'string') {
- setSelectedMemberAddress(null);
- setGroupInfo(updateResponse);
-
- groupInfoToast.showMessageToast({
- toastTitle: 'Success',
- toastMessage: 'Removed Member successfully',
- toastType: 'SUCCESS',
- getToastIcon: (size) => (
-
- ),
- });
- } else {
- groupInfoToast.showMessageToast({
- toastTitle: 'Error',
- toastMessage: updateResponse,
- toastType: 'ERROR',
- getToastIcon: (size) => (
-
- ),
- });
- setSelectedMemberAddress(null);
- }
- } catch (error) {
- console.error('Error in removing member', error);
- groupInfoToast.showMessageToast({
- toastTitle: 'Error',
- toastMessage: 'Please, try again',
- toastType: 'ERROR',
- getToastIcon: (size) => (
-
- ),
- });
+ };
+ const removeMember = async () => {
+ const updatedMemberList = getUpdatedMemberList(
+ groupInfo,
+ selectedMemberAddress!
+ );
+ const adminList = getUpdatedAdminList(
+ groupInfo,
+ selectedMemberAddress,
+ true
+ );
+ await handleAddRemove({
+ memberList: updatedMemberList,
+ adminList,
+ updateKey: UPDATE_KEYS.REMOVE_MEMBER,
+ });
+ };
+
+ const addMembers = async () => {
+ //Already Present Members and PendingMembers
+ const groupMemberList = convertToWalletAddressList([
+ ...groupInfo.members,
+ ...groupInfo.pendingMembers,
+ ]);
+
+ //Newly Added Members and alreadyPresent Members in the groupchat
+ const newMembersToAdd = memberList.map((member: any) => member.wallets);
+ const members = [...groupMemberList, ...newMembersToAdd];
+
+ //Admins wallet address from both members and pendingMembers
+ const adminList = getAdminList?.(groupInfo);
+
+ await handleAddRemove({
+ memberList: members,
+ adminList,
+ updateKey: UPDATE_KEYS.ADD_MEMBER,
+ });
+ };
+
+ const updateGroupAdmin = async (updateKey: UpdateKeys) => {
+ const groupMemberList = convertToWalletAddressList([
+ ...groupInfo.members,
+ ...groupInfo.pendingMembers,
+ ]);
+ const newAdminList = getUpdatedAdminList(
+ groupInfo,
+ selectedMemberAddress,
+ !(updateKey === UPDATE_KEYS.ADD_ADMIN)
+ );
+ await handleAddRemove({
+ memberList: groupMemberList,
+ adminList: newAdminList,
+ updateKey,
+ });
+ };
+
+ // const messageUserDropdown: DropdownValueType = {
+ // id: 'message_user',
+ // title: 'Message user',
+ // icon: Message,
+ // function: () => messageUser(),
+ // };
+
+ const removeAdminDropdown: DropdownValueType = {
+ id: 'dismiss_admin',
+ title: 'Dismiss as admin',
+ icon: DismissAdmin,
+ function: () => updateGroupAdmin(UPDATE_KEYS.REMOVE_ADMIN),
+ };
+ const addAdminDropdown: DropdownValueType = {
+ id: 'add_admin',
+ title: 'Make group admin',
+ icon: AddAdmin,
+ function: () => updateGroupAdmin(UPDATE_KEYS.ADD_ADMIN),
+ };
+ const removeMemberDropdown: DropdownValueType = {
+ id: 'remove_member',
+ title: 'Remove',
+ icon: Remove,
+ function: () => removeMember(),
+ textColor: '#ED5858',
+ };
+
+ //remove all testing things
+
+ const a1: DropdownValueType = {
+ id: 'dismiss_admin',
+ title: 'Dismiss as admin',
+ function: () => updateGroupAdmin(UPDATE_KEYS.REMOVE_ADMIN),
+ };
+ const a2: DropdownValueType = {
+ id: 'add_admin',
+ title: 'Make group admin',
+ function: () => updateGroupAdmin(UPDATE_KEYS.ADD_ADMIN),
+ };
+
+ const handlePrevious = () => {
+ setShowAddMoreWalletModal(false);
+ };
+
+ const onClose = (): void => {
+ setModal(false);
+ };
+
+ return (
+
+
+
+ Group Description
+
+
+ {groupInfo?.groupDescription}
+
+
+ messageUser(),
- // };
- const removeAdminDropdown: DropdownValueType = {
- id: 'dismiss_admin',
- title: 'Dismiss as admin',
- icon: DismissAdmin,
- function: () => dismissGroupAdmin(),
- };
- const addAdminDropdown: DropdownValueType = {
- id: 'add_admin',
- title: 'Make group admin',
- icon: AddAdmin,
- function: () => makeGroupAdmin(),
- };
- const removeMemberDropdown: DropdownValueType = {
- id: 'remove_member',
- title: 'Remove',
- icon: Remove,
- function: () => removeMember(),
- textColor: '#ED5858',
- };
-
-
-
- const isAccountOwnerAdmin = groupInfo?.members?.some(
- (member) => pCAIP10ToWallet(member?.wallet)?.toLowerCase() === account?.toLowerCase() && member?.isAdmin
- );
-
- const handlePrevious = () => {
- setShowAddMoreWalletModal(false);
- };
-
- const onClose = () => {
- setModal(false);
- }
-
- const isMobile = useMediaQuery(device.mobileL);
- if(groupInfo){
- return(
-
- {!showAddMoreWalletModal && (
-
-
-
-
- Group Info
-
- onClose()} cursor='pointer' />
-
-
-
-
-
-
- {groupInfo?.groupName}
- {groupInfo?.members?.length} Members
-
-
-
-
- Group Description
- {groupInfo?.groupDescription}
-
-
-
-
-
-
- {groupInfo?.isPublic ? 'Public' : 'Private'}
- {groupInfo?.isPublic ? 'Chats are not encrypted' : 'Chats are encrypted'}
-
-
+ />
+ {/* {(groupInfo.rules?.chat?.conditions ||
+ groupInfo.rules?.entry?.conditions) && (
+
+ )} */}
+
+ {isAccountOwnerAdmin(groupInfo, account!) &&
+ groupInfo?.members &&
+ groupInfo?.members?.length < 10 && (
+ setShowAddMoreWalletModal(true)}
+ >
+
- {isAccountOwnerAdmin && groupInfo?.members && groupInfo?.members?.length < 10 && (
- setShowAddMoreWalletModal(true)}
- >
-
-
-
- Add more wallets
-
- )}
-
-
+ )}
+
+
{groupInfo?.pendingMembers?.length > 0 && (
-
+ )}
+
+
+
+ {groupInfo?.members &&
+ groupInfo?.members?.length > 0 &&
+ groupInfo?.members.map((item, index) => (
+
- )}
+ ))}
+
+ {showAddMoreWalletModal && (
+
+ )}
+ );
+};
+
+export const GroupInfoModal = ({
+ theme,
+ setModal,
+ groupInfo,
+ setGroupInfo,
+}: GroupInfoModalProps) => {
+ const [activeComponent, setActiveComponent] = useState(
+ GROUPINFO_STEPS.GROUP_INFO
+ );
+ const handleNextInfo = () => {
+ console.log('criteria');
+ setActiveComponent((activeComponent + 1) as GROUP_INFO_TYPE);
+ console.log(activeComponent);
+ };
+
+ const handlePreviousInfo = () => {
+ setActiveComponent((activeComponent - 1) as GROUP_INFO_TYPE);
+ };
+
+ const renderComponent = () => {
+ switch (activeComponent) {
+ case GROUPINFO_STEPS.GROUP_INFO:
+ return (
+
+ );
+ case GROUPINFO_STEPS.CRITERIA:
+ return ;
+
+ default:
+ return (
+
+ );
+ }
+ };
+ const [showAddMoreWalletModal, setShowAddMoreWalletModal] =
+ useState(false);
+ useState(false);
+ const [memberList, setMemberList] = useState([]);
+ const [isLoading, setIsLoading] = useState(false);
+ const [selectedMemberAddress, setSelectedMemberAddress] = useState<
+ string | null
+ >(null);
+ const { updateGroup } = useUpdateGroup();
+ const isMobile = useMediaQuery(device.mobileL);
+
+ const handleClose = () => onClose();
+ const dropdownRef = useRef(null);
+ useClickAway(dropdownRef, () => setSelectedMemberAddress(null));
+ const groupInfoToast = useToast();
+
+ const groupCreator = groupInfo?.groupCreator;
+ const membersExceptGroupCreator = groupInfo?.members?.filter(
+ (x) => x.wallet?.toLowerCase() !== groupCreator?.toLowerCase()
+ );
+
+ type UpdateGroupType = {
+ adminList: Array;
+ memberList: Array;
+ };
+
+ const handleUpdateGroup = async (options: UpdateGroupType) => {
+ const { adminList, memberList } = options || {};
+ const updateResponse = await updateGroup({
+ groupInfo,
+ memberList,
+ adminList,
+ });
+ return { updateResponse };
+ };
+
+ const handleAddRemove = async (
+ options: UpdateGroupType & { updateKey: UpdateKeys }
+ ) => {
+ const { adminList, memberList, updateKey } = options || {};
+
+ try {
+ setIsLoading(true);
+ const { updateResponse } = await handleUpdateGroup({
+ adminList,
+ memberList,
+ });
+
+ if (typeof updateResponse !== 'string') {
+ setGroupInfo(updateResponse);
+
+ groupInfoToast.showMessageToast({
+ toastTitle: 'Success',
+ toastMessage: SUCCESS_MESSAGE[updateKey],
+ toastType: 'SUCCESS',
+ getToastIcon: (size) => ,
+ });
+ } else {
+ groupInfoToast.showMessageToast({
+ toastTitle: 'Error',
+ toastMessage: updateResponse,
+ toastType: 'ERROR',
+ getToastIcon: (size) => ,
+ });
+ }
+ } catch (error) {
+ console.error('Error', error);
+ groupInfoToast.showMessageToast({
+ toastTitle: 'Error',
+ toastMessage: 'Please, try again',
+ toastType: 'ERROR',
+ getToastIcon: (size) => ,
+ });
+ } finally {
+ if (updateKey === UPDATE_KEYS.ADD_MEMBER) handleClose();
+ setIsLoading(false);
+ setSelectedMemberAddress(null);
+ }
+ };
+ const removeMember = async () => {
+ const updatedMemberList = getUpdatedMemberList(
+ groupInfo,
+ selectedMemberAddress!
+ );
+ const adminList = getUpdatedAdminList(
+ groupInfo,
+ selectedMemberAddress,
+ true
+ );
+ await handleAddRemove({
+ memberList: updatedMemberList,
+ adminList,
+ updateKey: UPDATE_KEYS.REMOVE_MEMBER,
+ });
+ };
+
+ const addMembers = async () => {
+ //Already Present Members and PendingMembers
+ const groupMemberList = convertToWalletAddressList([
+ ...groupInfo.members,
+ ...groupInfo.pendingMembers,
+ ]);
+
+ //Newly Added Members and alreadyPresent Members in the groupchat
+ const newMembersToAdd = memberList.map((member: any) => member.wallets);
+ const members = [...groupMemberList, ...newMembersToAdd];
+
+ //Admins wallet address from both members and pendingMembers
+ const adminList = getAdminList?.(groupInfo);
+
+ await handleAddRemove({
+ memberList: members,
+ adminList,
+ updateKey: UPDATE_KEYS.ADD_MEMBER,
+ });
+ };
+
+ const updateGroupAdmin = async (updateKey: UpdateKeys) => {
+ const groupMemberList = convertToWalletAddressList([
+ ...groupInfo.members,
+ ...groupInfo.pendingMembers,
+ ]);
+ const newAdminList = getUpdatedAdminList(
+ groupInfo,
+ selectedMemberAddress,
+ !(updateKey === UPDATE_KEYS.ADD_ADMIN)
+ );
+ await handleAddRemove({
+ memberList: groupMemberList,
+ adminList: newAdminList,
+ updateKey,
+ });
+ };
+
+ const onClose = (): void => {
+ setModal(false);
+ };
+
+ if (groupInfo) {
+ return (
+
+ {!showAddMoreWalletModal && (
+
+
-
- {groupInfo?.members && groupInfo?.members?.length > 0 && groupInfo?.members.map((item, index) => (
-
- ))}
-
-
- )}
-
-
-
- {showAddMoreWalletModal && (
-
- )}
-
- )
-} else { return null }
-
-}
+
+
-const ProfileDiv = styled.div<{minHeight?: number}>`
- display: flex;
- flex-direction: column;
- justify-content: flex-start;
- padding-right: 3px;
- align-items: center;
- min-width: 445px;
- min-height: 72px;
- max-height: 216px;
- min-height: ${(props) => `${props.minHeight}px`};
- overflow-y: auto;
- overflow-x: hidden;
- &&::-webkit-scrollbar {
- width: 4px;
+
+
+ {groupInfo?.groupName}
+
+
+ {groupInfo?.members?.length} Members
+
+
+
+ {renderComponent()}
+
+ )}
+
+ );
+ } else {
+ return null;
}
- &&::-webkit-scrollbar-thumb {
- background: #cf1c84;
- border-radius: 10px;
- }
- @media (max-width: 480px) {
- min-width: 300px;
- }
-`;
+};
+//styles
const GroupHeader = styled.div`
- margin-top: 34px;
- display: flex;
- flex-direction: row;
- width: 100%;
- gap: 19px;
+ margin-top: 34px;
+ display: flex;
+ flex-direction: row;
+ width: 100%;
+ gap: 19px;
`;
const GroupDescription = styled.div`
- margin-top: 34px;
- display: flex;
- flex-direction: column;
- width: 100%;
- align-items: flex-start;
- gap: 5px;
+ margin-top: 34px;
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ align-items: flex-start;
+ gap: 5px;
`;
-
const PublicEncrypted = styled.div`
- margin-top: 20px;
- display: flex;
- flex-direction: row;
- width: 100%;
- gap: 19px;
- align-items: center;
- border: ${(props) => `1px solid ${props.theme.defaultBorder}`};
- border-radius: 16px;
- padding: 16px;
- box-sizing: border-box;
-`;
-
-const GroupMembers = styled.div`
- margin-top: 20px;
- display: flex;
- flex-direction: row;
- width: 100%;
- align-items: center;
-`;
-
-const AdminItem = styled.div`
- background: rgb(244, 220, 234);
- color: rgb(213, 58, 148);
- margin-left: auto;
- font-size: 10px;
- padding: 6px;
- border-radius: 8px;
+ margin-top: 20px;
+ display: flex;
+ flex-direction: row;
+ width: 100%;
+ gap: 19px;
+ align-items: center;
+ border: ${(props) => props.theme.border.modalInnerComponents};
+ border-radius: ${(props) => props.theme.borderRadius.modalInnerComponents};
+ padding: 16px;
+ box-sizing: border-box;
+ background: ${(props) => props.theme.backgroundColor.modalHoverBackground};
`;
const AddWalletContainer = styled.div`
- margin-top: 20px;
- border: ${(props) => `1px solid ${props.theme.defaultBorder}`};
- border-radius: 16px;
- width: 100%;
- padding: 20px 16px;
- box-sizing: border-box;
- display: flex;
- flex-direction: row;
- justify-content: center;
- cursor: pointer;
- align-items: center;
+ margin-top: 20px;
+ border: ${(props) => props.theme.border.modalInnerComponents};
+ border-radius: ${(props) => props.theme.borderRadius.modalInnerComponents};
+ width: 100%;
+ padding: 20px 16px;
+ box-sizing: border-box;
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
+ cursor: pointer;
+ align-items: center;
`;
const GroupPendingMembers = styled.div`
- margin-top: 3px;
- display: flex;
- flex-direction: row;
- width: 100%;
- align-items: center;
- background: ${(props) => props.theme.pendingCardBackground};
- padding: 10px 15px;
- box-sizing: border-box;
-
- &:last-child {
- border-radius: 0px 0px 16px 16px;
- }
-`;
+ margin-top: 3px;
+ display: flex;
+ flex-direction: row;
+ width: 100%;
+ align-items: center;
+ background: ${(props) => props.theme.backgroundColor.modalHoverBackground};
+ padding: 10px 15px;
+ box-sizing: border-box;
+ &:last-child {
+ border-radius: 0px 0px 16px 16px;
+ }
+`;
const PendingRequestWrapper = styled.div`
- width: 100%;
- margin-top: 20px;
- border: ${(props) => `1px solid ${props.theme.defaultBorder}`};
- border-radius: 16px;
- padding: 0px 0px;
- box-sizing: border-box;
+ width: 100%;
+ margin-top: 20px;
+ border: ${(props) => props.theme.border.modalInnerComponents};
+ border-radius: ${(props) => props.theme.borderRadius.modalInnerComponents};
+ padding: 0px 0px;
+ box-sizing: border-box;
`;
const PendingSection = styled.div`
- width: 100%;
- display: flex;
- flex-direction: row;
- align-items: center;
- flex: 1;
- cursor: pointer;
- padding: 15px 20px;
- box-sizing: border-box;
+ width: 100%;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ flex: 1;
+ cursor: pointer;
+ padding: 15px 20px;
+ box-sizing: border-box;
`;
const ArrowImage = styled(Image)`
- margin-left: auto;
- transform: ${(props) => props?.setPosition ? 'rotate(0)' : 'rotate(180deg)'};
+ margin-left: auto;
+ transform: ${(props) =>
+ props?.setPosition ? 'rotate(0)' : 'rotate(180deg)'};
`;
-
const Badge = styled.div`
- margin: 0 0 0 5px;
- font-size: 13px;
- background: rgb(207, 28, 132);
- padding: 4px 8px;
- border-radius: 7px;
- color: white;
- font-weight: 700;
+ margin: 0 0 0 5px;
+ font-size: 13px;
+ background: rgb(207, 28, 132);
+ padding: 4px 8px;
+ border-radius: 7px;
+ color: white;
+ font-weight: 700;
`;
+
+const ConditionSection = styled(Section)<{ theme: IChatTheme }>`
+ &::-webkit-scrollbar-thumb {
+ background: ${(props) => props.theme.scrollbarColor};
+ border-radius: 10px;
+ }
+ &::-webkit-scrollbar-button {
+ height: 20px;
+ }
+ &::-webkit-scrollbar {
+ width: 4px;
+ }
+`;
+
+//auto update members when an user accepts not done
diff --git a/packages/uiweb/src/lib/components/chat/ChatProfile/MemberListContainer.tsx b/packages/uiweb/src/lib/components/chat/ChatProfile/MemberListContainer.tsx
index c92529fef..52885bec5 100644
--- a/packages/uiweb/src/lib/components/chat/ChatProfile/MemberListContainer.tsx
+++ b/packages/uiweb/src/lib/components/chat/ChatProfile/MemberListContainer.tsx
@@ -1,183 +1,201 @@
-import { useContext, useRef, useState } from "react";
-import { ThemeContext } from "../theme/ThemeProvider";
-import { useClickAway } from "../../../hooks";
-import Dropdown, { DropdownValueType } from "./DropDown";
+import { useContext, useRef, useState } from 'react';
+
+import styled from 'styled-components';
+
+import { ThemeContext } from '../theme/ThemeProvider';
+import { useClickAway } from '../../../hooks';
+import Dropdown, { DropdownValueType } from '../reusables/DropDown';
+import { Section, Span } from '../../reusables/sharedStyling';
+
import DismissAdmin from '../../../icons/dismissadmin.svg';
import AddAdmin from '../../../icons/addadmin.svg';
import Remove from '../../../icons/remove.svg';
-import styled from "styled-components";
-import { Section, Image, Span } from "../../reusables/sharedStyling";
-import { MemberListContainerType, WalletProfileContainerProps } from "../exportedTypes";
-import { findObject } from "../helpers/helper";
-import { device } from "../../../config";
-import { shortenText } from "../../../helpers";
-
-export const MemberListContainer = ({ key, memberData, handleMembers, handleMemberList, lightIcon, darkIcon, memberList }: MemberListContainerType) => {
- const theme = useContext(ThemeContext);
- const [selectedWallet, setSelectedWallet] = useState(null);
+import { IChatTheme, User } from '../exportedTypes';
+import { findObject } from '../helpers/helper';
+import { device } from '../../../config';
+import { shortenText } from '../../../helpers';
+import { ProfileContainer } from '../reusables';
+
+
+type MemberListContainerType = {
+ key?: number;
+ memberData: User;
+ handleMemberList: (member: User) => void;
+ handleMembers?: (value: User[]) => void;
+ darkIcon: any;
+ memberList?: any;
+};
+
+export interface WalletProfileContainerProps {
+ id?: any;
+ background?: any;
+ border?: string;
+};
+
+export const MemberListContainer = ({
+ key,
+ memberData,
+ handleMembers,
+ handleMemberList,
+ darkIcon,
+ memberList,
+}: MemberListContainerType) => {
+ const theme = useContext(ThemeContext);
+ const [selectedWallet, setSelectedWallet] = useState(null);
const [dropdownHeight, setDropdownHeight] = useState(0);
const dropdownRef = useRef(null);
-
useClickAway(dropdownRef, () => setSelectedWallet(null));
- const removeAdminDropdown: DropdownValueType =
- { id: 'dismiss_admin', title: 'Dismiss as admin', icon: DismissAdmin, function: () => dismissGroupAdmin() }
+ const removeAdminDropdown: DropdownValueType = {
+ id: 'dismiss_admin',
+ title: 'Dismiss as admin',
+ icon: DismissAdmin,
+ function: () => dismissGroupAdmin(),
+ };
- const addAdminDropdown: DropdownValueType =
- { id: 'dismiss_admin', title: 'Make group admin', icon: AddAdmin, function: () => makeGroupAdmin() }
+ const addAdminDropdown: DropdownValueType = {
+ id: 'dismiss_admin',
+ title: 'Make group admin',
+ icon: AddAdmin,
+ function: () => makeGroupAdmin(),
+ };
- const removeUserDropdown: DropdownValueType =
- { id: 'remove_user', title: 'Remove', icon: Remove, function: () => removeUser() }
+ const removeUserDropdown: DropdownValueType = {
+ id: 'remove_user',
+ title: 'Remove',
+ icon: Remove,
+ function: () => removeUser(),
+ };
const dismissGroupAdmin = () => {
- const updatedMembers = memberList.map((member:any) => member?.wallets?.toLowerCase() == memberData?.wallets?.toLowerCase() ? ({ ...member, isAdmin: false }) : member)
- handleMembers?.(updatedMembers)
- setSelectedWallet(null)
- }
+ const updatedMembers = memberList.map((member: any) =>
+ member?.wallets?.toLowerCase() == memberData?.wallets?.toLowerCase()
+ ? { ...member, isAdmin: false }
+ : member
+ );
+ handleMembers?.(updatedMembers);
+ setSelectedWallet(null);
+ };
const makeGroupAdmin = () => {
- const updatedMembers = memberList.map((member: any) => member?.wallets?.toLowerCase() == memberData?.wallets?.toLowerCase() ? ({ ...member, isAdmin: true }) : member)
- handleMembers?.(updatedMembers)
- setSelectedWallet(null)
- }
+ const updatedMembers = memberList.map((member: any) =>
+ member?.wallets?.toLowerCase() == memberData?.wallets?.toLowerCase()
+ ? { ...member, isAdmin: true }
+ : member
+ );
+ handleMembers?.(updatedMembers);
+ setSelectedWallet(null);
+ };
const removeUser = () => {
- handleMemberList(memberData)
- setSelectedWallet(null)
- }
-
+ handleMemberList(memberData);
+ setSelectedWallet(null);
+ };
const handleHeight = (id: any) => {
- const containerHeight = document.getElementById(id)?.getBoundingClientRect();
+ const containerHeight = document
+ .getElementById(id)
+ ?.getBoundingClientRect();
setDropdownHeight(containerHeight?.top);
};
-
-
- return (
-
-
-
-
- {shortenText(memberData?.wallets?.split(':')[1], 8, true)}
-
+
-
+
{memberData?.isAdmin && (
-
+
Admin
-
+
)}
- {
- handleHeight(memberData?.wallets);
- setSelectedWallet(null)
- memberList
- ? findObject(memberData, memberList, 'wallets')
- ? setSelectedWallet(memberData?.wallets)
- : handleMemberList(memberData)
- : handleMemberList(memberData)
- }}
- >
- {/* {theme === 'light' ? lightIcon : darkIcon} */}
- {darkIcon}
-
+ {
+ handleHeight(memberData?.wallets);
+ setSelectedWallet(null);
+ memberList
+ ? findObject(memberData, memberList, 'wallets')
+ ? setSelectedWallet(memberData?.wallets)
+ : handleMemberList(memberData)
+ : handleMemberList(memberData);
+ }}
+ >
+ {darkIcon}
+
{selectedWallet?.toLowerCase() == memberData?.wallets?.toLowerCase() && (
- 500 ? '30%' : "45%" }} ref={dropdownRef} theme={theme}>
+ 500 ? '30%' : '45%' }}
+ ref={dropdownRef}
+ theme={theme}
+ >
)}
-
- WalletProfileContainer>
- )
-}
-
+
+ );
+};
const WalletProfileContainer = styled(Section)`
- // position: relative;
- // padding: 5px 16px;
- // margin: 8px 0px;
- // justify-content: space-between;
- // // min-width: 450px;
- // min-width: 100%;
- // box-sizing: border-box;
- // align-items: center;
- // border-radius: 16px;
-
- // @media (max-width: 480px) {
- // // min-width: 300px;
- // }
-
- justify-content: space-between;
- padding: 8px 16px;
- border-radius: 16px;
- position: relative;
- box-sizing: border-box;
- width: 100%;
- // background-color: ${(props) => props.theme.snapFocusBg};
- max-height: 64px;
- align-self: stretch;
- display: flex;
- height: auto;
- z-index: auto;
- flex: 1;
- @media (max-width: 480px) {
- max-width: 100%;
- }
-
-`;
-
-const WalletProfile = styled(Section)`
- justify-content: flex-start;
+ justify-content: space-between;
+ padding: 8px 16px;
+ border: ${(props) => props.border};
+ position: relative;
+ box-sizing: border-box;
+ width: 100%;
+ max-height: 64px;
+ align-self: stretch;
+ display: flex;
+ height: auto;
+ z-index: auto;
+ flex: 1;
+ @media (max-width: 480px) {
+ max-width: 100%;
+ }
`;
const DropdownContainer = styled.div`
- // position: absolute;
- // left: 48%;
- // border-radius: 16px;
- // padding: 14px 8px;
- // background: ${(props) => props.theme.modalContentBackground};
- // border: 1px solid ${(props) => props.theme.modalBorderColor};
- // z-index: 400;
- // @media ${device.mobileL} {
- // left: 27%;
- // }
- // @media (min-width: 426px) and (max-width: 1150px) {
- // left: 47%;
- // }
position: absolute;
left: 48%;
top: 69%;
- border-radius: 16px;
+ border-radius: ${(props) => props.theme.borderRadius.modalInnerComponents};
padding: 14px 8px;
z-index: 999999999999 !important;
display: flex;
flex-direction: column !important;
- background: ${(props) => props.theme.modalContentBackground};
- border: 1px solid ${(props) => props.theme.modalBorderColor};
+ background: ${(props) => props.theme.backgroundColor.modalBackground};
+ border: ${(props) => props.theme.border.modalInnerComponents};
@media ${device.mobileL} {
left: 27%;
@@ -185,7 +203,7 @@ const DropdownContainer = styled.div`
@media (min-width: 426px) and (max-width: 1150px) {
left: 48%;
}
- @media (max-width: 480px){
+ @media (max-width: 480px) {
left: 25%;
}
-`;
\ No newline at end of file
+`;
diff --git a/packages/uiweb/src/lib/components/chat/ChatProfile/MemberProfileCard.tsx b/packages/uiweb/src/lib/components/chat/ChatProfile/MemberProfileCard.tsx
new file mode 100644
index 000000000..80b6bfa9f
--- /dev/null
+++ b/packages/uiweb/src/lib/components/chat/ChatProfile/MemberProfileCard.tsx
@@ -0,0 +1,154 @@
+// React + Web3 Essentials
+import React, { useContext, useState } from 'react';
+
+// External Packages
+import styled from 'styled-components';
+
+// Internal Components
+import { MoreLightIcon } from '../../../icons/MoreLight';
+import { shortenText } from '../../../helpers';
+import { ThemeContext } from '../theme/ThemeProvider';
+import { useChatData } from '../../../hooks';
+import { Section, Span } from '../../reusables';
+import Dropdown from '../reusables/DropDown';
+import { pCAIP10ToWallet } from '../../../helpers';
+import { device } from '../../../config';
+import { IChatTheme } from '../theme';
+import { ProfileContainer } from '../reusables';
+
+type MemberProfileCardProps = {
+ key?: number | string;
+ member?: any;
+ dropdownValues?: any;
+ selectedMemberAddress?: any;
+ setSelectedMemberAddress?: any;
+ dropdownRef?: any;
+};
+
+
+export const MemberProfileCard = ({
+ key,
+ member,
+ dropdownValues,
+ selectedMemberAddress,
+ setSelectedMemberAddress,
+ dropdownRef,
+}: MemberProfileCardProps) => {
+ const theme = useContext(ThemeContext);
+ const { account } = useChatData();
+
+ const [dropdownHeight, setDropdownHeight] = useState(0);
+
+ const handleHeight = (id: any) => {
+ const containerHeight = document
+ .getElementById(id)
+ ?.getBoundingClientRect();
+ setDropdownHeight(containerHeight?.top);
+ };
+
+
+ return (
+
+
+
+ {member?.isAdmin && (
+
+ Admin
+
+ )}
+ {pCAIP10ToWallet(member?.wallet)?.toLowerCase() !==
+ account?.toLowerCase() &&
+ dropdownValues.length > 0 && (
+ {
+ handleHeight(member.wallet);
+ setSelectedMemberAddress(member?.wallet);
+ }}
+ style={{ cursor: 'pointer' }}
+ >
+
+
+ )}
+
+ {selectedMemberAddress?.toLowerCase() ==
+ member?.wallet?.toLowerCase() && (
+ 570 ? '30%' : '40%' }}
+ theme={theme}
+ ref={dropdownRef}
+ >
+
+
+ )}
+
+ );
+};
+
+//styles
+const ProfileCardItem = styled(Section)<{ id: any; key: any; background: any }>`
+ justify-content: space-between;
+ padding: 8px 8px;
+ border-radius: 16px;
+ position: relative;
+ box-sizing: border-box;
+ width: 100%;
+ max-height: 64px;
+ align-self: stretch;
+ display: flex;
+ height: auto;
+ z-index: auto;
+ flex: 1;
+ @media (max-width: 480px) {
+ max-width: 100%;
+ }
+`;
+
+const DropdownContainer = styled(Section)`
+ position: absolute;
+ left: 48%;
+ top: 69%;
+ border-radius: ${(props) => props.theme.borderRadius.modalInnerComponents};
+ padding: 14px 8px;
+ z-index: 999999999999 !important;
+ display: flex;
+ flex-direction: column !important;
+ background: ${(props) => props.theme.backgroundColor.modalBackground};
+ border: ${(props) => props.theme.border.modal};
+
+ @media ${device.mobileL} {
+ left: 27%;
+ }
+ @media (min-width: 426px) and (max-width: 1150px) {
+ left: 48%;
+ }
+ @media (max-width: 480px) {
+ left: 25%;
+ }
+`;
diff --git a/packages/uiweb/src/lib/components/chat/ChatProfile/ProfileCard.tsx b/packages/uiweb/src/lib/components/chat/ChatProfile/ProfileCard.tsx
deleted file mode 100644
index 2ee09770f..000000000
--- a/packages/uiweb/src/lib/components/chat/ChatProfile/ProfileCard.tsx
+++ /dev/null
@@ -1,158 +0,0 @@
-// React + Web3 Essentials
-import React, { useContext ,useState } from 'react';
-
-// External Packages
-import styled from 'styled-components';
-import { ethers } from 'ethers';
-
-// Internal Components
-import { MoreLightIcon } from '../../../icons/MoreLight';
-import { MoreDarkIcon } from '../../../icons/MoreDark';
-import { shortenText } from "../../../helpers";
-import { ThemeContext } from "../theme/ThemeProvider";
-import { useChatData, useClickAway} from "../../../hooks";
-import { Image, Section, Span } from "../../reusables";
-import Dropdown from './DropDown';
-import { pCAIP10ToWallet } from '../../../helpers';
-import { device } from "../../../config";
-
-
-type ProfileCardProps = {
- key?: number | string,
- member?: any,
- dropdownValues?: any;
- selectedMemberAddress?: any;
- setSelectedMemberAddress?: any;
- dropdownRef?: any;
-}
-
-export const ProfileCard = ({
- key,
- member,
- dropdownValues,
- selectedMemberAddress,
- setSelectedMemberAddress,
- dropdownRef,
-}: ProfileCardProps) => {
- const theme = useContext(ThemeContext);
- const { account } = useChatData();
-
- const [dropdownHeight, setDropdownHeight] = useState(0);
-
- const handleHeight = (id: any) => {
- const containerHeight = document.getElementById(id)?.getBoundingClientRect();
- setDropdownHeight(containerHeight?.top);
- };
-
- return (
-
-
-
-
- {shortenText(member?.wallet?.split(':')[1], 6, true)}
-
-
-
- {member?.isAdmin && (
-
- Admin
-
- )}
- {pCAIP10ToWallet(member?.wallet)?.toLowerCase() !== account?.toLowerCase() && dropdownValues.length > 0 && (
- {
- handleHeight(member.wallet);
- setSelectedMemberAddress(member?.wallet)
- }}
- style={{ cursor: 'pointer' }}
- >
- {theme ? : }
-
- )}
-
- {selectedMemberAddress?.toLowerCase() == member?.wallet?.toLowerCase() && (
- 570 ? '30%' : '40%' }}
- theme={theme}
- ref={dropdownRef}>
-
-
- )}
-
- );
-};
-
-const ProfileCardItem = styled(Section)<{id: any, key: any, background: any}>`
- justify-content: space-between;
- padding: 8px 16px;
- border-radius: 16px;
- position: relative;
- box-sizing: border-box;
- width: 100%;
- // background-color: ${(props) => props.theme.snapFocusBg};
- max-height: 64px;
- align-self: stretch;
- display: flex;
- height: auto;
- z-index: auto;
- flex: 1;
- @media (max-width: 480px) {
- max-width: 100%;
- }
-`;
-
-const DropdownContainer = styled(Section)`
- position: absolute;
- left: 48%;
- top: 69%;
- border-radius: 16px;
- padding: 14px 8px;
- z-index: 999999999999 !important;
- display: flex;
- flex-direction: column !important;
- background: ${(props) => props.theme.modalContentBackground};
- border: 1px solid ${(props) => props.theme.modalBorderColor};
-
- @media ${device.mobileL} {
- left: 27%;
- }
- @media (min-width: 426px) and (max-width: 1150px) {
- left: 48%;
- }
- @media (max-width: 480px){
- left: 25%;
- }
-`;
diff --git a/packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx b/packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx
index 9ad6ce257..1b388c4ed 100644
--- a/packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx
+++ b/packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx
@@ -1,320 +1,388 @@
-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 {
+ ReactElement,
+ ReactNode,
+ useContext,
+ useEffect,
+ useState,
+} from 'react';
+
+import moment from 'moment';
+import styled from 'styled-components';
+import { TwitterTweetEmbed } from 'react-twitter-embed';
+
+import { Section, Span, Image } from '../../reusables';
+import { checkTwitterUrl } from '../helpers/twitter';
+import { ChatDataContext } from '../../../context';
+import { useChatData } from '../../../hooks';
+import { ThemeContext } from '../theme/ThemeProvider';
+
+import { FileMessageContent } from '../../../types';
+import { IMessagePayload, TwitterFeedReturnType } from '../exportedTypes';
+import { FILE_ICON } from '../../../config';
+import {
+ formatFileSize,
+ getPfp,
+ pCAIP10ToWallet,
+ shortenText,
+} from '../../../helpers';
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 && (
-
- )}
+ };
+ useEffect(() => {
+ getUserPfp();
+ }, [account, chat.fromCAIP10]);
+ return (
+
+ {chat.fromCAIP10.split(':')[1] !== account && (
+
- )
-}
+ )}
+
+ );
+};
+
+const MessageWrapper = ({
+ chat,
+ children,
+ isGroup,
+ maxWidth,
+}: {
+ chat: IMessagePayload;
+ children: ReactNode;
+ isGroup: boolean;
+ maxWidth?: string;
+}) => {
+ const theme = useContext(ThemeContext);
+ return (
+
+ {isGroup && }
+
+ {isGroup && }
+ {children}
+
+
+
+ );
+};
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 &&
-
- }
-
+
+ {' '}
+
+ {chat.messageContent.split('\n').map((str) => (
+
- {isGroup &&
-
- }
-
- {' '}
-
- {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 &&
-
- }
-
-
-
-
- {shortenText(name, 11)}
-
-
- {formatFileSize(size)}
-
-
-
-
-
-
-
+ return (
+
+
+
+
+
+ {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 &&
-
- }
-
- {isGroup && (
-
- )}
-
-
-
- );
+ return (
+
+
+
+ );
};
const GIFCard = ({
- chat,
- position,
- isGroup,
+ chat,
+ position,
+ isGroup,
}: {
- chat: IMessagePayload;
- position: number;
- isGroup: boolean;
+ chat: IMessagePayload;
+ position: number;
+ isGroup: boolean;
}) => {
- return (
-
- );
+ return (
+
+
+
+ );
};
-const TwitterCard = ({ chat, tweetId, isGroup, position }: { chat: IMessagePayload, tweetId: string, isGroup: boolean, position: number }) => {
- return (
-
- )
-}
+const TwitterCard = ({
+ chat,
+ tweetId,
+ isGroup,
+ position,
+}: {
+ chat: IMessagePayload;
+ tweetId: string;
+ isGroup: boolean;
+ position: number;
+}) => {
+ return (
+
+
+
+ );
+};
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])
-
- // useEffect(() => {
- // setAccount("");
- // setPgpPrivateKey("");
- // setEnv(env);
- // }, [account, env, pgpPrivateKey])
-
- if (messageType === 'TwitterFeedLink') {
- chat.messageType = 'TwitterFeedLink';
+ 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]);
- 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 +390,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..b63b1ee00 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,29 @@ export const ChatViewList: React.FC = (
setChatStatusText('');
}, [chatId, account, env]);
+ 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 +119,26 @@ 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,26 @@ 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 (conversationHash) {
@@ -145,10 +173,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 +186,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 +239,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 +257,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 +316,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 && (
-
- )}
- {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 && (
+
+ )}
+ {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 +410,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 d196b00b7..b0090d41a 100644
--- a/packages/uiweb/src/lib/components/chat/ConnectButton/ConnectButton.tsx
+++ b/packages/uiweb/src/lib/components/chat/ConnectButton/ConnectButton.tsx
@@ -1,174 +1,134 @@
-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 { useContext, useEffect, useState } from 'react';
+
+import styled from 'styled-components';
+import { Signer, ethers } from 'ethers';
+
+import { useAccount, useChatData } from '../../../hooks';
+import { ThemeContext } from '../theme/ThemeProvider';
+import useGetChatProfile from '../../../hooks/useGetChatProfile';
+import useCreateChatProfile from '../../../hooks/useCreateChatProfile';
+import useDecryptPGPKey from '../../../hooks/useDecryptPGPKey';
+
+import { getAddressFromSigner } from '../../../helpers';
+import { IChatTheme } from '../theme';
+import { device } from '../../../config';
+
+/**
+ * @interface IThemeProps
+ * this interface is used for defining the props for styled components
+ */
+interface IThemeProps {
+ theme?: IChatTheme;
+}
+interface IConnectButtonProps {
+ autoConnect?: boolean;
}
-
-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',
-};
-
-const injected = new InjectedConnector({
- supportedChainIds: [1, 3, 4, 5, 42, 137, 80001, 56, 97, 10, 420, 1442, 1101],
-});
-
-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;
+export const ConnectButtonSub = ({autoConnect = false}) => {
+ const {wallet, connecting , connect, disconnect} = useAccount();
+
+ const {
+ signer,
+ pgpPrivateKey,
+ account,
+ env,
+ setPgpPrivateKey,
+ setAccount,
+ setSigner,
+ } = useChatData();
+ const theme = useContext(ThemeContext);
+ const {fetchChatProfile} = useGetChatProfile();
+ const {creteChatProfile} = useCreateChatProfile();
+ const {decryptPGPKey} = useDecryptPGPKey();
+
+
+ const setUserData = () => {
+ 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,
- });
-
- 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,
+ }
+ useEffect(() => {
+ if(wallet && !autoConnect)
+ disconnect(wallet);
+ setUserData()
+ }, [wallet])
+
+ useEffect(() => {
+ (async () => {
+ if (account && signer) {
+ if (!pgpPrivateKey) await handleUserCreation();
+ }
+ })();
+ }, [account, signer]);
+
+
+ const handleUserCreation = async () => {
+ if (!account && !env) return;
+ try {
+ let user = await fetchChatProfile({ profileId: account! ,env});
+ if (!user) {
+ if (!signer) return;
+ user = await creteChatProfile({ signer: signer ,env});
+ }
+ if (user?.encryptedPrivateKey && !pgpPrivateKey) {
+ const decryptPgpKey = await decryptPGPKey({
+ encryptedPrivateKey: user.encryptedPrivateKey,
+ account: account!,
+ signer: signer,
+ env: env,
});
-
- setPgpPrivateKey(pvtKey);
- };
-
- async function connect() {
- try {
- await activate(injected);
- } catch (ex) {
- console.log(ex);
- }
+ if(decryptPgpKey)
+ 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.textColor.buttonText}!important`};
+ text-align:center;
+ font-size: 1em;
+ cursor:pointer;
+ 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;
+ }
+ body.modal-open {
+ overflow-y: hidden;
+ }
+`;
\ No newline at end of file
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..b6b603fdf
--- /dev/null
+++ b/packages/uiweb/src/lib/components/chat/ConnectButton/index.tsx
@@ -0,0 +1,100 @@
+import { IChatTheme } from '../theme';
+
+import coinbaseWalletModule from '@web3-onboard/coinbase'
+import { ConnectButtonSub } from './ConnectButton';
+import { BLOCKNATIVE_PROJECT_ID, 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';
+
+const APP_META_DATA = {
+ name: 'Push Protocol',
+ icon: 'https://files.slack.com/files-pri/T011WQBLH39-F05QWQA0MSR/pushlogoblocknative.png',
+ description: 'Example showcasing how to connect a wallet.',
+
+ recommendedInjectedWallets: [
+ { name: 'MetaMask', url: 'https://metamask.io' },
+ ]
+}
+
+const wcv2InitOptions = {
+ projectId: BLOCKNATIVE_PROJECT_ID,
+ 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 web3OnBoard = init({
+ wallets,
+ chains:CHAINS,
+ appMetadata:APP_META_DATA,
+ 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/CreateGroup/AddButtons.tsx b/packages/uiweb/src/lib/components/chat/CreateGroup/AddButtons.tsx
new file mode 100644
index 000000000..73b56e0c5
--- /dev/null
+++ b/packages/uiweb/src/lib/components/chat/CreateGroup/AddButtons.tsx
@@ -0,0 +1,27 @@
+import React, { useContext } from 'react'
+
+import { Button } from '../reusables'
+import { ThemeContext } from '../theme/ThemeProvider';
+
+interface AddButtonsProps {
+ title: string;
+ handleNext?: () => void;
+}
+
+export const AddButtons = ({title, handleNext}: AddButtonsProps) => {
+ const theme = useContext(ThemeContext);
+ return (
+
+ )
+}
diff --git a/packages/uiweb/src/lib/components/chat/CreateGroup/AddCriteria.tsx b/packages/uiweb/src/lib/components/chat/CreateGroup/AddCriteria.tsx
new file mode 100644
index 000000000..8f9bbd0c2
--- /dev/null
+++ b/packages/uiweb/src/lib/components/chat/CreateGroup/AddCriteria.tsx
@@ -0,0 +1,557 @@
+import { useContext, useEffect, useState } from 'react';
+
+import {
+ Button,
+ DropDownInput,
+ DropdownValueType,
+ ModalHeader,
+ TextInput,
+} from '../reusables';
+import { Section, } from '../../reusables';
+import useMediaQuery from '../../../hooks/useMediaQuery';
+import { GatingRulesInformation, ModalHeaderProps } from './CreateGroupModal';
+import { useChatData } from '../../../hooks';
+import { QuantityInput } from '../reusables/QuantityInput';
+import { ThemeContext } from '../theme/ThemeProvider';
+import { Checkbox } from '../reusables/Checkbox';
+import OptionButtons from '../reusables/OptionButtons';
+
+import EthereumSvg from '../../../icons/ethereum.svg';
+import PolygonSvg from '../../../icons/polygon.svg';
+import BSCSvg from '../../../icons/bsc.svg';
+import OptimismSvg from '../../../icons/optimisim.svg';
+import { BLOCKCHAIN_NETWORK, device } from '../../../config';
+import { GUILD_COMPARISON_OPTIONS, INVITE_CHECKBOX_LABEL } from '../constants';
+import {
+ CATEGORY,
+ DropdownCategoryValuesType,
+ DropdownSubCategoryValuesType,
+ SUBCATEGORY,
+ TYPE,
+ SubCategoryKeys,
+ TypeKeys,
+ ReadonlyInputType,
+} from '../types';
+import { Data, GuildData, PushData, Rule } from '../types/tokenGatedGroupCreationType';
+
+
+
+const AddCriteria = ({
+ handlePrevious,
+ handleNext,
+ onClose,
+ criteriaStateManager
+}: ModalHeaderProps) => {
+ const [selectedTypeValue, setSelectedTypeValue] = useState(0);
+ const [selectedCategoryValue, setSelectedCategoryValue] = useState(0);
+ const [selectedSubCategoryValue, setSelectedSubCategoryValue] =
+ useState(0);
+ const [guildComparison, setGuildComparison] = useState('')
+ const [selectedChainValue, setSelectedChainValue] = useState(0);
+ const [contract, setContract] = useState('');
+ const [inviteCheckboxes, setInviteCheckboxes] = useState<{
+ admin: boolean;
+ owner: boolean;
+ }>({ admin: true, owner: true });
+ const [url, setUrl] = useState('');
+ const [guildId, setGuildId] = useState('');
+ const [specificRoleId, setSpecificRoleId] = useState('');
+
+ const [quantity, setQuantity] = useState<{ value: number; range: number }>({
+ value: 0,
+ range: 0,
+ });
+ const { env } = useChatData();
+ const theme = useContext(ThemeContext);
+
+ const isMobile = useMediaQuery(device.mobileL);
+
+ const dropdownQuantityRangeValues: Array = [
+ {
+ id: 0,
+ title: 'Greater than',
+ value: '>',
+ function: () => setQuantity({ ...quantity, range: 0 }),
+ },
+ {
+ id: 1,
+ title: 'Greater or equal to',
+ value: '>=',
+ function: () => setQuantity({ ...quantity, range: 1 }),
+ },
+ {
+ id: 2,
+ title: 'Less than',
+ value: '<',
+ function: () => setQuantity({ ...quantity, range: 2 }),
+ },
+ {
+ id: 3,
+ title: 'Less or equal to',
+ value: '<=',
+ function: () => setQuantity({ ...quantity, range: 3 }),
+ },
+ {
+ id: 4,
+ title: 'Equal to',
+ value: '==',
+ function: () => setQuantity({ ...quantity, range: 4 }),
+ },
+ {
+ id: 5,
+ title: 'Not equal to',
+ value: '!=',
+ function: () => setQuantity({ ...quantity, range: 5 }),
+ },
+ ];
+ const dropdownTypeValues: Array = [
+ {
+ id: 0,
+ title: 'Push protocol',
+ value: TYPE.PUSH,
+ function: () => setSelectedTypeValue(0),
+ },
+ {
+ id: 1,
+ title: 'Guild',
+ value: TYPE.GUILD,
+ function: () => setSelectedTypeValue(1),
+ },
+ ];
+ const dropdownCategoryValues: DropdownCategoryValuesType = {
+ PUSH: [
+ {
+ id: 0,
+ value: CATEGORY.ERC20,
+ title: 'Token ERC20',
+ function: () => setSelectedCategoryValue(0),
+ },
+ {
+ id: 1,
+ value: CATEGORY.ERC721,
+ title: 'NFT ERC721',
+ function: () => setSelectedCategoryValue(1),
+ },
+ {
+ id: 2,
+ value: CATEGORY.INVITE,
+ title: 'Invite',
+ function: () => setSelectedCategoryValue(2),
+ },
+ {
+ id: 3,
+ value: CATEGORY.CustomEndpoint,
+ title: 'Custom Endpoint',
+ function: () => setSelectedCategoryValue(3),
+ },
+ ],
+ GUILD: {
+ value: CATEGORY.ROLES,
+ title: 'Roles',
+ },
+ };
+
+ const tokenCategoryValues = [
+ {
+ id: 0,
+ value: SUBCATEGORY.HOLDER,
+ title: 'Holder',
+ function: () => setSelectedSubCategoryValue(0),
+ },
+ {
+ id: 1,
+ value: SUBCATEGORY.OWENER,
+ title: 'Owner',
+ function: () => setSelectedSubCategoryValue(1),
+ },
+ ];
+ const dropdownSubCategoryValues: DropdownSubCategoryValuesType = {
+ ERC20: tokenCategoryValues,
+ ERC721: tokenCategoryValues,
+ INVITE: {
+ value: SUBCATEGORY.DEFAULT,
+ title: 'Default',
+ },
+ CustomEndpoint: [
+ {
+ id: 0,
+ value: SUBCATEGORY.GET,
+ title: 'Get',
+ function: () => setSelectedSubCategoryValue(0),
+ },
+ ],
+ ROLES: {
+ value: SUBCATEGORY.DEFAULT,
+ title: 'Default',
+ },
+ };
+
+ const dropdownChainsValues: Array = [
+ {
+ id: 0,
+ value: BLOCKCHAIN_NETWORK[env].ETHEREUM,
+ title: 'Ethereum',
+ icon: EthereumSvg,
+ function: () => setSelectedChainValue(0),
+ },
+ {
+ id: 1,
+ value: BLOCKCHAIN_NETWORK[env].POLYGON,
+ title: 'Polygon',
+ icon: PolygonSvg,
+ function: () => setSelectedChainValue(1),
+ },
+ {
+ id: 2,
+ value: BLOCKCHAIN_NETWORK[env].BSC,
+ title: 'BSC',
+ icon: BSCSvg,
+ function: () => setSelectedChainValue(2),
+ },
+ {
+ id: 3,
+ value: BLOCKCHAIN_NETWORK[env].OPTIMISM,
+ title: 'Optimism',
+ icon: OptimismSvg,
+ function: () => setSelectedChainValue(3),
+ },
+ ];
+
+ const getCategoryDropdownValues = () => {
+ return dropdownCategoryValues[
+ dropdownTypeValues[selectedTypeValue].value as TypeKeys
+ ];
+ };
+
+ const getSelectedCategoryValue = () => {
+ const category = getCategoryDropdownValues();
+ if (Array.isArray(category))
+ return (category as DropdownValueType[])[selectedCategoryValue].value!;
+ else return category.value! as SubCategoryKeys;
+ };
+
+ const getSelectedSubCategoryValue = () => {
+ const subCategory = getSubCategoryDropdownValues();
+ if (Array.isArray(subCategory))
+ return (subCategory as DropdownValueType[])[selectedCategoryValue].value!;
+ else return subCategory.value! as SubCategoryKeys;
+ };
+
+ const checkIfTokenNFT = () => {
+ const category = getSelectedCategoryValue();
+ if (category === CATEGORY.ERC20 || category === CATEGORY.ERC721)
+ return true;
+
+ return false;
+ };
+
+ const checkIfCustomEndpoint = () => {
+ const category = getSelectedCategoryValue();
+ if (category === CATEGORY.CustomEndpoint) return true;
+ return false;
+ };
+
+ const checkIfPushInvite = () => {
+ const accessType = dropdownTypeValues[selectedTypeValue].value;
+ if (accessType === TYPE.PUSH) {
+ const category = getSelectedCategoryValue();
+ if (category === CATEGORY.INVITE) return true;
+ }
+
+ return false;
+ };
+
+ const checkIfGuild = () => {
+ const accessType = dropdownTypeValues[selectedTypeValue].value;
+ if (accessType === TYPE.GUILD) {
+ return true;
+ }
+
+ return false;
+ };
+
+ const getSubCategoryDropdownValues = () => {
+ const category = getCategoryDropdownValues();
+ if (Array.isArray(category))
+ return dropdownSubCategoryValues[
+ (category as DropdownValueType[])[selectedCategoryValue]
+ .value as SubCategoryKeys
+ ];
+ else return dropdownSubCategoryValues[category.value as SubCategoryKeys];
+ };
+
+ const onQuantityChange = (e: any) => {
+ setQuantity({ ...quantity, value: e.target.value });
+ };
+
+ const verifyAndDoNext = ()=>{
+ const _type = dropdownTypeValues[selectedTypeValue].value as 'PUSH' | 'GUILD'
+ const category:string = _type === "PUSH" ? (dropdownCategoryValues[_type] as DropdownValueType[])[
+ selectedCategoryValue
+ ].value || CATEGORY.ERC20 : "ROLES"
+
+ let subCategory = "DEFAULT"
+ if(_type === "PUSH"){
+ if(category === CATEGORY.ERC20 || category === CATEGORY.ERC721){
+ subCategory = tokenCategoryValues[selectedSubCategoryValue].value
+ }else if(category === CATEGORY.CustomEndpoint){
+ subCategory = "GET"
+ }
+ }
+
+ const getData = (type:string, category:string):Data=>{
+ if(type === "PUSH"){
+ if(category === CATEGORY.ERC20 || category === CATEGORY.ERC721){
+ const selectedChain = dropdownChainsValues[selectedChainValue].value || 'eip155:1';
+ return {
+ contract: `${selectedChain}:${contract}`,
+ amount: quantity.value,
+ comparison:dropdownQuantityRangeValues[quantity.range].value,
+ decimals: 18,
+ }
+ }else if(category === CATEGORY.INVITE){
+ const _inviteRoles = []
+ if(inviteCheckboxes.admin){
+ _inviteRoles.push("ADMIN")
+ }
+ if(inviteCheckboxes.owner){
+ _inviteRoles.push("OWNER")
+ }
+
+ return{
+ inviterRoles: _inviteRoles as ['OWNER' | 'ADMIN']
+ }
+ }else{
+ // CATEGORY.CustomEndpoint
+ // TODO: validate url
+ return{
+ url:url
+ }
+ }
+ }else{
+ // GUILD type
+ return {
+ id:guildId,
+ comparison:guildComparison,
+ role:guildComparison === 'specific' ? specificRoleId : "*",
+ }
+ }
+ }
+
+ const rule:Rule = {
+ type: _type,
+ category: category,
+ subcategory: subCategory,
+ data: getData(_type, category),
+ }
+
+ criteriaState.addNewRule(rule)
+
+ if(handlePrevious){
+ handlePrevious()
+ }
+
+ }
+
+ const criteriaState = criteriaStateManager.getSelectedCriteria()
+
+
+ // Autofill the form for the update
+ useEffect(()=>{
+ if(criteriaState.isUpdateCriteriaEnabled()){
+ //Load the states
+ const oldValue = criteriaState.selectedRules[criteriaState.updateCriteriaIdx]
+
+ if(oldValue.type === 'PUSH'){
+
+ // category
+ setSelectedCategoryValue(
+ (dropdownCategoryValues.PUSH as DropdownValueType[]).findIndex(obj => obj.value === oldValue.category)
+ )
+
+ const pushData = oldValue.data as PushData
+
+ // sub category
+ if(oldValue.category === CATEGORY.ERC20 || oldValue.category === CATEGORY.ERC721){
+ setSelectedSubCategoryValue(
+ tokenCategoryValues.findIndex(obj => obj.value === oldValue.subcategory)
+ )
+
+ const contractAndChain:string[] = (pushData.contract || "eip155:1:0x").split(':')
+ setSelectedChainValue(
+ dropdownChainsValues.findIndex(
+ obj => obj.value === contractAndChain[0]+":"+contractAndChain[1]
+ )
+ )
+ setContract(contractAndChain.length === 3 ? contractAndChain[2]: "")
+ setQuantity({
+ value:pushData.amount || 0,
+ range:dropdownQuantityRangeValues.findIndex(
+ obj => obj.value === pushData.comparison
+ )
+ })
+ }else if(oldValue.category === CATEGORY.INVITE){
+ setInviteCheckboxes({
+ admin:true,
+ owner:true,
+ })
+ }else{
+ // invite
+ setUrl(pushData.url || "")
+ }
+ }else{
+ // guild condition
+ setGuildId((oldValue.data as GuildData).id)
+ setSpecificRoleId((oldValue.data as GuildData).role)
+ setGuildComparison((oldValue.data as GuildData).comparison)
+ }
+
+ setSelectedTypeValue(
+ dropdownTypeValues.findIndex(obj => obj.value === oldValue.type)
+ )
+ }
+ },[])
+
+ return (
+
+
+
+ {Array.isArray(getCategoryDropdownValues()) ? (
+
+ ) : (
+
+ )}
+
+ {Array.isArray(getSubCategoryDropdownValues()) ? (
+
+ ) : (
+
+ )}
+ {/* shift to minor components leave for now*/}
+ {checkIfTokenNFT() && (
+ <>
+
+ setContract(e.target.value)}
+ placeholder="e.g. 0x123..."
+ />
+
+ >
+ )}
+
+ {checkIfCustomEndpoint() && (
+ setUrl(e.target.value)}
+ placeholder="e.g. abc.com"
+ />
+ )}
+ {checkIfPushInvite() && (
+
+ {Object.keys(INVITE_CHECKBOX_LABEL).map((key) => (
+
+ setInviteCheckboxes({
+ admin:true,
+ owner:true
+ })
+ }
+ checked={
+ inviteCheckboxes[key as keyof typeof INVITE_CHECKBOX_LABEL]
+ }
+ />
+ ))}
+
+ )}
+
+ {checkIfGuild() && (
+ <>
+ setGuildId(e.target.value)}
+ placeholder="e.g. 4687"
+ />
+ {
+ setGuildComparison(newEl)}}
+ />
+
+ {guildComparison === "specific" &&
+ setSpecificRoleId(e.target.value)}
+ placeholder="e.g. 4687"
+ />
+ }
+
+
+ >
+ )}
+
+
+
+ );
+};
+
+export default AddCriteria;
+
diff --git a/packages/uiweb/src/lib/components/chat/CreateGroup/ConditionsComponent.tsx b/packages/uiweb/src/lib/components/chat/CreateGroup/ConditionsComponent.tsx
new file mode 100644
index 000000000..4efb0d594
--- /dev/null
+++ b/packages/uiweb/src/lib/components/chat/CreateGroup/ConditionsComponent.tsx
@@ -0,0 +1,322 @@
+import React, { useContext, useRef, useState } from 'react';
+
+import styled from 'styled-components';
+
+import { Section, Span } from '../../reusables';
+import { MoreDarkIcon } from '../../../icons/MoreDark';
+import { ThemeContext } from '../theme/ThemeProvider';
+import Dropdown, { DropdownValueType } from '../reusables/DropDown';
+import { ConditionArray, ConditionData, IChatTheme } from '../exportedTypes';
+import { useClickAway } from '../../../hooks';
+import { CATEGORY, CRITERIA_TYPE, CriteriaType, TOKEN_NFT_COMPARISION, TokenNftComparision } from '../types';
+
+import EditSvg from '../../../icons/EditSvg.svg';
+import RemoveSvg from '../../../icons/RemoveSvg.svg';
+import { shortenText } from '../../../helpers';
+import { GUILD_COMPARISON_OPTIONS } from '../constants';
+
+export type CriteraValueType = {
+ invertedIcon?: any;
+ id: number;
+ type?: string;
+ title?: string;
+ icon?: string;
+ function: () => void;
+};
+
+interface CriteriaProps {
+ conditionData: ConditionArray[];
+ moreOptions?: boolean;
+ deleteFunction?: (idx: number) => void;
+ updateFunction?: (idx: number) => void;
+}
+
+interface MoreOptionsContainerProps {
+ handleMoreOptionsClick: (row: number, col: number) => void;
+ setSelectedIndex: any;
+ selectedIndex: Array | null;
+ row: number;
+ col: number;
+ dropDownValues: DropdownValueType[];
+}
+
+// fix dropdown position mobile view and z index
+const MoreOptionsContainer = ({
+ handleMoreOptionsClick,
+ setSelectedIndex,
+ selectedIndex,
+ row,
+ col,
+ dropDownValues,
+}: MoreOptionsContainerProps) => {
+ const theme = useContext(ThemeContext);
+ const dropdownRef = useRef(null);
+
+ useClickAway(dropdownRef, () => setSelectedIndex(null));
+ return (
+ handleMoreOptionsClick(row, col)} position='static'>
+
+ {selectedIndex?.length && selectedIndex[0] === row && (
+
+
+
+ )}
+
+ );
+};
+
+const CriteriaSection = ({ criteria }: { criteria: ConditionData }) => {
+ const theme = useContext(ThemeContext);
+
+ const getTokenNftComparisionLabel = () => {
+ return TOKEN_NFT_COMPARISION[
+ criteria?.data?.['comparison'] as TokenNftComparision
+ ];
+ };
+ const checkIfNftToken = () => {
+ if (
+ criteria?.category === CATEGORY.ERC721 ||
+ criteria?.category === CATEGORY.ERC20
+ )
+ return true;
+ return false;
+ };
+
+ const getGuildRole = () =>{
+ return (GUILD_COMPARISON_OPTIONS.find(option => option.value === criteria?.data?.['comparison']))?.heading;
+
+ }
+ return (
+
+
+ {CRITERIA_TYPE[criteria.category as CriteriaType]}
+
+ {checkIfNftToken() && (
+
+
+ {getTokenNftComparisionLabel()}{' '}
+
+ {/* need to fetch token symbol */}
+ {criteria?.data?.['amount']} {criteria.category}
+
+ )}
+ {criteria.category === CATEGORY.INVITE && (
+
+ Owner and Admin can invite
+
+ )}
+ {criteria.category === CATEGORY.CustomEndpoint && (
+
+ {shortenText(criteria.data?.['url'],30)}
+
+ )}
+ {criteria.category === CATEGORY.ROLES && (
+
+ {criteria?.data?.['id']} {' '}
+
+ with {' '}
+
+ {getGuildRole()} role
+
+ )}
+
+ );
+};
+// fix dropdown ui
+const ConditionsComponent = ({
+ conditionData,
+ deleteFunction,
+ updateFunction,
+ moreOptions = true,
+}: CriteriaProps) => {
+ const [selectedIndex, setSelectedIndex] = useState | null>(
+ null
+ );
+
+ const dropdownRef = useRef(null);
+
+ const dropDownValues: DropdownValueType[] = [
+ {
+ id: 0,
+ value: 'Edit',
+ title: 'Edit',
+ icon: EditSvg,
+ function: () => {
+ if (updateFunction) {
+ if (selectedIndex) {
+ updateFunction(selectedIndex[0]);
+ setSelectedIndex(null);
+ }
+ }
+ },
+ },
+ {
+ id: 1,
+ value: 'Remove',
+ title: 'Remove',
+ icon: RemoveSvg,
+ function: () => {
+ if (deleteFunction) {
+ if (selectedIndex) {
+ deleteFunction(selectedIndex[0]);
+ setSelectedIndex(null);
+ }
+ }
+ },
+ },
+ ];
+ const theme = useContext(ThemeContext);
+
+ useClickAway(dropdownRef, () => setSelectedIndex(null));
+
+ const handleMoreOptionsClick = (row: number, col: number) => {
+ setSelectedIndex([row, col]);
+ };
+
+ return (
+
+ {conditionData &&
+ conditionData.slice(1).map((criteria, row) => (
+
+ {criteria.length <= 2 &&
+ criteria.length >= 1 &&
+ criteria.map((singleCriteria, col) => (
+ <>
+ {singleCriteria.type && (
+
+