mirror of
https://github.com/status-im/status-web.git
synced 2026-08-31 14:21:18 +00:00
chore: update waku dependencies
* chore: update waku dependencies => update to node 22 * chore: add changeset * chore(ci.yml): update node version * fix(build): use jsx runtime for rehype-react in production * chore(release.yml): update node version * fix(build): handle CoinGecko API failures in exchanges page * chore(status-js): update waku dependencies * fix(status-js): resolve Uint8Array ArrayBufferLike type errors * feat(status-js): make package compatible with ethers v5 & v6 * fix(status-js): fix ethers v6 API compatibility * chore(ethers): prevent webpack from analyzing ethers v5 & v6 compatible calls at build time to avoid false positive errors * chore(preview-page): add console logs for debugging in vercel preview * chore(status-js): add console log to ethereum client to debug on preview * chore(status-js): add extra logs to request-client to debug in preview * chore(status-js): add extra logs to debug in preview * chore(status.app): remove unnecessary guard * patch crypto deps * chore(status.app): type rehype-react options in jobs and blog pages * remove logs * update readme * remove nested resolutions * c * add node networkConfig * refactor(status-js): migrate to @bufbuild/protobuf v2 API * chore(status-js): remove console logs * chore(status-js): revert compatibility update for ethers v5 & v6 * chore(status-js): update waku packages to latest version * fix(apps/wallet): react-router-dom version mismatch * chore(packages/wallet): remove useless peer dependency * fix(status.app): upgrade remark packages to unified 11 for mdx compatibility --------- Co-authored-by: Felicio <felicio@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
---
|
||||
'@status-im/status-network': minor
|
||||
'status.network': minor
|
||||
'status.app': minor
|
||||
'portfolio': minor
|
||||
'api': minor
|
||||
'hub': minor
|
||||
---
|
||||
|
||||
chore: update waku dependencies => update to node 22
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.18.0
|
||||
node-version: 22.17.0
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Changeset
|
||||
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
version: 9.12.3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.18.0
|
||||
node-version: 22.17.0
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm build
|
||||
- uses: changesets/action@v1
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
20.18.0
|
||||
22.17.0
|
||||
|
||||
@@ -11,7 +11,7 @@ public-hoist-pattern[]=*it-pipe*
|
||||
public-hoist-pattern[]=*@libp2p/interfaces*
|
||||
public-hoist-pattern[]=*remark*
|
||||
; https://pnpm.io/npmrc#node-version
|
||||
node-version=20.18.0
|
||||
node-version=22.17.0
|
||||
; https://pnpm.io/npmrc#engine-strict
|
||||
engine-strict=true
|
||||
ignore-workspace-root-check=true
|
||||
|
||||
@@ -31,7 +31,7 @@ Packages for building user interfaces, websites, web applications, dapps, browse
|
||||
|
||||
Required:
|
||||
|
||||
- **[Node.js](https://nodejs.org/)** v20.x
|
||||
- **[Node.js](https://nodejs.org/)** v22.x
|
||||
- **[pnpm](https://pnpm.io)** v9.12.x
|
||||
|
||||
## Stack
|
||||
|
||||
@@ -1 +1 @@
|
||||
20.18.0
|
||||
22.17.0
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ enable-pre-post-scripts=true
|
||||
;auto-install-peers=true
|
||||
; https://pnpm.io/npmrc#public-hoist-pattern
|
||||
; https://pnpm.io/npmrc#public-hoist-pattern
|
||||
node-version=20.18.0
|
||||
node-version=22.17.0
|
||||
engine-strict=true
|
||||
ignore-workspace-root-check=true
|
||||
; https://pnpm.io/npmrc#node-options
|
||||
|
||||
@@ -20,23 +20,23 @@
|
||||
"@trpc/next": "10.45.2",
|
||||
"@trpc/server": "10.45.2",
|
||||
"next": "15.3.0",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react": "19.1.0",
|
||||
"react-dom": "19.1.0",
|
||||
"zod": "^3.23.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3.1.0",
|
||||
"@next/eslint-plugin-next": "15.3.0",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19",
|
||||
"@types/react": "^19.1.0",
|
||||
"@types/react-dom": "^19.1.0",
|
||||
"eslint": "^9",
|
||||
"eslint-config-next": "15.3.0",
|
||||
"globals": "^15.12.0",
|
||||
"typescript": "^5.6.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20.x"
|
||||
"node": "22.x"
|
||||
},
|
||||
"lint-staged": {
|
||||
"{.env,src/config/env.server.mjs}": [
|
||||
|
||||
@@ -1 +1 @@
|
||||
20.18.0
|
||||
22.17.0
|
||||
+1
-1
@@ -2,6 +2,6 @@
|
||||
; why: https://github.com/vercel/next.js/discussions/70423
|
||||
# node-options=--network-family-autoselection-attempt-timeout=1000
|
||||
; https://pnpm.io/npmrc#node-version
|
||||
node-version=20.18.0
|
||||
node-version=22.17.0
|
||||
; https://pnpm.io/npmrc#engine-strict
|
||||
engine-strict=true
|
||||
@@ -61,7 +61,7 @@
|
||||
"typescript-eslint": "^8.22.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20.x"
|
||||
"node": "22.x"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,mjs,ts,tsx}": [
|
||||
|
||||
@@ -1 +1 @@
|
||||
20.18.0
|
||||
22.17.0
|
||||
|
||||
@@ -10,7 +10,7 @@ enable-pre-post-scripts=true
|
||||
public-hoist-pattern[]=*it-pipe*
|
||||
public-hoist-pattern[]=*@libp2p/interfaces*
|
||||
public-hoist-pattern[]=*remark*
|
||||
node-version=20.18.0
|
||||
node-version=22.17.0
|
||||
engine-strict=true
|
||||
ignore-workspace-root-check=true
|
||||
; https://pnpm.io/npmrc#node-options
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
// For "Build dependencies behind this expression are ignored and might cause incorrect cache invalidation." warning
|
||||
// @see https://github.com/contentlayerdev/contentlayer/issues/129#issuecomment-1080416633
|
||||
|
||||
import { createRequire } from 'module'
|
||||
import path from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
import './src/config/env.server.mjs'
|
||||
import './src/config/env.client.mjs'
|
||||
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import withVercelToolbar from '@vercel/toolbar/plugins/next'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
const require = createRequire(import.meta.url)
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
let config = {
|
||||
logging: {
|
||||
@@ -116,6 +124,24 @@ let config = {
|
||||
},
|
||||
// note: fallback for non-Turbopack builds
|
||||
webpack: (config, { isServer }) => {
|
||||
// Ensure react-hook-form is properly resolved when processing @status-im/wallet
|
||||
try {
|
||||
const reactHookFormPath = require.resolve('react-hook-form')
|
||||
config.resolve.alias = {
|
||||
...config.resolve.alias,
|
||||
'react-hook-form': reactHookFormPath,
|
||||
}
|
||||
} catch {
|
||||
// Fallback to node_modules path if require.resolve fails
|
||||
config.resolve.alias = {
|
||||
...config.resolve.alias,
|
||||
'react-hook-form': path.resolve(
|
||||
__dirname,
|
||||
'node_modules/react-hook-form'
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
if (!isServer) {
|
||||
config.resolve.alias = {
|
||||
...config.resolve.alias,
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
"vfile": "^5.3.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20.x"
|
||||
"node": "22.x"
|
||||
},
|
||||
"lint-staged": {
|
||||
"{.env,src/config/env.{server,client}.mjs}": [
|
||||
|
||||
@@ -1 +1 @@
|
||||
20.18.0
|
||||
22.17.0
|
||||
|
||||
@@ -10,7 +10,7 @@ enable-pre-post-scripts=true
|
||||
public-hoist-pattern[]=*it-pipe*
|
||||
public-hoist-pattern[]=*@libp2p/interfaces*
|
||||
public-hoist-pattern[]=*remark*
|
||||
node-version=20.18.0
|
||||
node-version=22.17.0
|
||||
engine-strict=true
|
||||
ignore-workspace-root-check=true
|
||||
; https://pnpm.io/npmrc#node-options
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
// import remarkPresetLintConsistent from 'remark-preset-lint-consistent'
|
||||
// import remarkPresetLintRecommended from 'remark-preset-lint-recommended'
|
||||
import remarkLintListItemIndent from 'remark-lint-list-item-indent'
|
||||
import remarkStringify from 'remark-stringify'
|
||||
import remarkMdx from 'remark-mdx'
|
||||
// import remarkParse from 'remark-parse'
|
||||
import remarkPresetWoorm from 'remark-preset-wooorm'
|
||||
@@ -55,9 +54,9 @@ import remarkPresetWoorm from 'remark-preset-wooorm'
|
||||
import remarkLintMaximumLineLength from 'remark-lint-maximum-line-length'
|
||||
// import remarkFrontmatter from 'remark-frontmatter'
|
||||
// import remarkLint from 'remark-lint'
|
||||
import remarkGfm from 'remark-gfm-v3'
|
||||
import remarkGfm from 'remark-gfm'
|
||||
import remarkPreset from '@1stg/remark-preset'
|
||||
import remarkValidateLinks from 'remark-validate-links'
|
||||
// import remarkValidateLinks from 'remark-validate-links'
|
||||
import remarkRetext from 'remark-retext'
|
||||
import { unified } from 'unified'
|
||||
import retextEnglish from 'retext-english'
|
||||
@@ -75,10 +74,12 @@ import remarkLintOrderedListMarkerValue from 'remark-lint-ordered-list-marker-va
|
||||
// remarkPresetWoorm.plugins.splice(0, 1)
|
||||
// remarkPresetWoorm.plugins.splice(2, 1)
|
||||
remarkPresetWoorm.plugins.splice(3, 1)
|
||||
remarkPreset.plugins.splice(7, 1)
|
||||
// index 9 = remarkValidateLinks in @1stg/remark-preset
|
||||
remarkPreset.plugins.splice(9, 1)
|
||||
|
||||
/** @type {Array<import('unified').Plugin | import('unified').Preset>} */
|
||||
const plugins = [
|
||||
remarkMdx,
|
||||
// note: incl. code/node indenting
|
||||
remarkPresetWoorm,
|
||||
// // note: https://github.com/retextjs/retext-quotes/issues/6
|
||||
@@ -137,11 +138,6 @@ const plugins = [
|
||||
// remarkLint,
|
||||
// [remarkFrontmatter, { type: 'custom', marker: { open: '<', close: '>' } }],
|
||||
[remarkLintListItemIndent, 'space'],
|
||||
[
|
||||
remarkStringify,
|
||||
{ listItemIndent: 'one', rule: '-', incrementListMarker: false },
|
||||
],
|
||||
remarkMdx,
|
||||
// remarkParse,
|
||||
[remarkLintMaximumLineLength, 'off'],
|
||||
remarkGfm,
|
||||
@@ -164,10 +160,11 @@ const plugins = [
|
||||
['remark-lint-file-extension', false],
|
||||
['remark-lint-no-emphasis-as-heading', false],
|
||||
['remark-lint-table-pipe-alignment', false],
|
||||
[
|
||||
remarkValidateLinks,
|
||||
{ repository: 'https://github.com/status-im/status-website.git' },
|
||||
],
|
||||
// Disabled because remark-validate-links doesn't support .mdx files
|
||||
// [
|
||||
// remarkValidateLinks,
|
||||
// { repository: 'https://github.com/status-im/status-website.git' },
|
||||
// ],
|
||||
// [remarkValidateLinks, false],
|
||||
// note: use https://github.com/orgs/remarkjs/discussions/734#discussioncomment-819364 --frail option
|
||||
// [remarkValidateLinks, [2]],
|
||||
@@ -201,10 +198,9 @@ export default {
|
||||
emphasis: '_',
|
||||
bullet: '-',
|
||||
quote: '"',
|
||||
// position: {
|
||||
// start: { line: 1, column: 1, offset: 0 },
|
||||
// },
|
||||
// position: false
|
||||
listItemIndent: 'one',
|
||||
rule: '-',
|
||||
incrementListMarker: false,
|
||||
},
|
||||
plugins,
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
// note: https://github.com/contentlayerdev/contentlayer/issues/84 – support for multiple sources
|
||||
// import { makeSource } from '@contentlayer/source-remote-files'
|
||||
import remarkHeadings from '@vcarl/remark-headings'
|
||||
import {
|
||||
defineDocumentType,
|
||||
defineNestedType,
|
||||
makeSource,
|
||||
} from '@contentlayer/source-files'
|
||||
// note: https://github.com/contentlayerdev/contentlayer/issues/84 – support for multiple sources
|
||||
// import { makeSource } from '@contentlayer/source-remote-files'
|
||||
import remarkHeadings from '@vcarl/remark-headings'
|
||||
} from 'contentlayer2/source-files'
|
||||
import { slug as slugify } from 'github-slugger'
|
||||
import { toString } from 'mdast-util-to-string'
|
||||
import { spawn } from 'node:child_process'
|
||||
import * as fs from 'node:fs/promises'
|
||||
import path from 'node:path'
|
||||
import { stderr } from 'node:process'
|
||||
import rehypePrettyCode from 'rehype-pretty-code'
|
||||
import { rehypePrettyCode } from 'rehype-pretty-code'
|
||||
import rehypeSlug from 'rehype-slug'
|
||||
// note: https://github.com/mdx-js/mdx/issues/1042#issuecomment-1027059063
|
||||
import remarkComment from 'remark-comment'
|
||||
// import { remark } from 'remark'
|
||||
import remarkDirective from 'remark-directive'
|
||||
// import remarkFrontmatter from 'remark-frontmatter'
|
||||
import remarkGfm from 'remark-gfm-v3'
|
||||
import remarkGfm from 'remark-gfm'
|
||||
import remarkMdx from 'remark-mdx'
|
||||
import remarkParse from 'remark-parse'
|
||||
import strip from 'strip-markdown'
|
||||
@@ -580,16 +580,14 @@ export default makeSource({
|
||||
for (const helpDoc of allHelpDocs) {
|
||||
// todo?: use mdx and markdown fields instead
|
||||
const processor = unified()
|
||||
.use(remarkMdx)
|
||||
.use(remarkParse)
|
||||
// .use(remarkComment)
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
.use(remarkMdx)
|
||||
.use(strip, {
|
||||
keep: ['heading'],
|
||||
})
|
||||
.use(remarkGfm)
|
||||
.use(remarkIndexer, { path: '/' + helpDoc._raw.flattenedPath })
|
||||
.use(remarkIndexer)
|
||||
const tree = await processor.parse(helpDoc.body.raw)
|
||||
const file = await new Promise<VFile | undefined>(resolve => {
|
||||
processor.run(tree, (_error, _tree, file) => {
|
||||
@@ -645,7 +643,7 @@ export default makeSource({
|
||||
keep: ['heading'],
|
||||
})
|
||||
.use(remarkGfm)
|
||||
.use(remarkIndexer, { path: '/' + specsDoc._raw.flattenedPath })
|
||||
.use(remarkIndexer)
|
||||
const tree = await processor.parse(specsDoc.body.raw)
|
||||
const file = await new Promise<VFile | undefined>(resolve => {
|
||||
processor.run(tree, (_error, _tree, file) => {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import './src/config/env.server.mjs'
|
||||
import './src/config/env.client.mjs'
|
||||
|
||||
import { withContentlayer } from 'next-contentlayer'
|
||||
import { withContentlayer } from 'next-contentlayer2'
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import withVercelToolbar from '@vercel/toolbar/plugins/next'
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
"predev": "pnpm install",
|
||||
"dev:next": "next dev --turbopack",
|
||||
"dev:content": "contentlayer dev",
|
||||
"dev:content": "contentlayer2 dev",
|
||||
"watch:content": "node --watch-path=./content --watch-preserve-output ./scripts/trigger-content-compilation.cjs",
|
||||
"build": "pnpm lint && next build",
|
||||
"build:content": "contentlayer build && :",
|
||||
"build:content": "contentlayer2 build && :",
|
||||
"postbuild": "if [ \"$VERCEL_ENV\" = \"production\" ]; then next-sitemap; fi",
|
||||
"start": "next start",
|
||||
"prelint": "contentlayer build",
|
||||
"prelint": "contentlayer2 build",
|
||||
"lint": "pnpm lint:remark && pnpm lint:next",
|
||||
"lint:next": "next lint --dir=src --ext=.ts --ext=.tsx",
|
||||
"lint:remark": "remark --quiet --ext md --ext mdx content/help content/legal",
|
||||
@@ -26,9 +26,9 @@
|
||||
"format": "pnpm format:remark && pnpm format:prettier",
|
||||
"format:remark": "pnpm lint:fix:remark",
|
||||
"format:prettier": "prettier --write .",
|
||||
"types:check": "contentlayer build && tsc",
|
||||
"types:check": "contentlayer2 build && tsc",
|
||||
"env:check": "node -r dotenv/config ./src/config/env.server.mjs dotenv_config_path=./.env && node -r dotenv/config ./src/config/env.client.mjs dotenv_config_path=./.env && :",
|
||||
"clean": "rimraf .next .vercel/output node_modules .contentlayer .turbo",
|
||||
"clean": "rimraf .next .vercel/output node_modules .contentlayer2 .turbo",
|
||||
"preview": "next start --port 8151",
|
||||
"codegen": "graphql-codegen -r dotenv/config --config codegen.yml",
|
||||
"codegen:watch": "pnpm run codegen -- --watch",
|
||||
@@ -90,7 +90,7 @@
|
||||
"@visx/visx": "^3.0.0",
|
||||
"arctic": "1.2.0",
|
||||
"class-variance-authority": "^0.6.0",
|
||||
"contentlayer": "^0.3.4",
|
||||
"contentlayer2": "^0.5.8",
|
||||
"csstype": "^3.1.3",
|
||||
"d3-array": "^3.2.3",
|
||||
"d3-scale": "^4.0.2",
|
||||
@@ -110,7 +110,7 @@
|
||||
"match-sorter": "^6.3.4",
|
||||
"minisearch": "^6.1.0",
|
||||
"next": "15.2.4",
|
||||
"next-contentlayer": "^0.3.4",
|
||||
"next-contentlayer2": "^0.5.8",
|
||||
"next-mdx-remote": "^5.0.0",
|
||||
"oslo": "1.0.1",
|
||||
"parallax-controller": "^1.7.1",
|
||||
@@ -132,15 +132,12 @@
|
||||
"title": "^3.5.3",
|
||||
"ts-pattern": "^5.3.1",
|
||||
"type-fest": "^4.18.2",
|
||||
"unified": "^10.1.2",
|
||||
"vfile-matter": "^5.0.0",
|
||||
"unified": "^11.0.5",
|
||||
"vfile-matter": "^5.0.1",
|
||||
"zod": "^3.21.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@1stg/remark-preset": "^2.0.0",
|
||||
"@contentlayer/core": "^0.3.4",
|
||||
"@contentlayer/source-files": "^0.3.4",
|
||||
"@contentlayer/utils": "^0.3.4",
|
||||
"@1stg/remark-preset": "^3.0.0",
|
||||
"@eslint/eslintrc": "^3.1.0",
|
||||
"@graphql-codegen/cli": "5.0.2",
|
||||
"@graphql-codegen/import-types-preset": "3.0.0",
|
||||
@@ -162,7 +159,7 @@
|
||||
"@types/react": "19.1.0",
|
||||
"@types/react-dom": "19.1.1",
|
||||
"@types/tryghost__content-api": "^1.3.11",
|
||||
"@types/unist": "^2.0.6",
|
||||
"@types/unist": "^3.0.3",
|
||||
"@vcarl/remark-headings": "^0.1.0",
|
||||
"autoprefixer": "^10.4.14",
|
||||
"dotenv": "^16.4.5",
|
||||
@@ -179,8 +176,8 @@
|
||||
"knip": "^5.30.2",
|
||||
"lint-staged": "^13.2.0",
|
||||
"mdast": "^3.0.0",
|
||||
"mdast-util-to-string": "^3.2.0",
|
||||
"mdx-bundler": "^9.2.1",
|
||||
"mdast-util-to-string": "^4.0.0",
|
||||
"mdx-bundler": "^10.0.0",
|
||||
"nanoid": "^5.0.8",
|
||||
"next-sitemap": "^4.2.3",
|
||||
"postcss": "^8.4.21",
|
||||
@@ -188,19 +185,18 @@
|
||||
"react-easy-emoji": "^1.8.1",
|
||||
"rehype": "^12.0.1",
|
||||
"rehype-format": "^4.0.1",
|
||||
"rehype-parse": "^8.0.4",
|
||||
"rehype-pretty-code": "0.10.2",
|
||||
"rehype-parse": "^9.0.1",
|
||||
"rehype-pretty-code": "0.14.1",
|
||||
"rehype-raw": "^6.1.1",
|
||||
"rehype-react": "^7.2.0",
|
||||
"rehype-slug": "^5.1.0",
|
||||
"rehype-react": "^8.0.0",
|
||||
"rehype-slug": "^6.0.0",
|
||||
"rehype-stringify": "^9.0.3",
|
||||
"remark": "^14.0.3",
|
||||
"remark": "^15.0.0",
|
||||
"remark-breaks": "^3.0.3",
|
||||
"remark-cli": "^11.0.0",
|
||||
"remark-directive": "^2.0.1",
|
||||
"remark-cli": "^12.0.0",
|
||||
"remark-directive": "^4.0.0",
|
||||
"remark-frontmatter": "^4.0.1",
|
||||
"remark-gfm-v3": "npm:remark-gfm@3.0.1",
|
||||
"remark-gfm-v4": "npm:remark-gfm@4.0.0",
|
||||
"remark-gfm": "^4.0.1",
|
||||
"remark-github-beta-blockquote-admonitions": "^1.1.0",
|
||||
"remark-lint": "9.1.2",
|
||||
"remark-lint-emphasis-marker": "^3.1.2",
|
||||
@@ -210,16 +206,16 @@
|
||||
"remark-lint-no-consecutive-blank-lines": "^4.1.3",
|
||||
"remark-lint-no-undefined-references": "^5.0.0",
|
||||
"remark-lint-ordered-list-marker-value": "^3.1.2",
|
||||
"remark-mdx": "^2.3.0",
|
||||
"remark-parse": "^10.0.2",
|
||||
"remark-preset-lint-consistent": "^5.1.2",
|
||||
"remark-preset-lint-markdown-style-guide": "^5.1.3",
|
||||
"remark-preset-lint-recommended": "^6.1.3",
|
||||
"remark-mdx": "^3.1.1",
|
||||
"remark-parse": "^11.0.0",
|
||||
"remark-preset-lint-consistent": "^6.0.0",
|
||||
"remark-preset-lint-markdown-style-guide": "^6.0.0",
|
||||
"remark-preset-lint-recommended": "^7.0.0",
|
||||
"remark-preset-prettier": "^2.0.1",
|
||||
"remark-preset-wooorm": "^9.1.0",
|
||||
"remark-preset-wooorm": "^11.0.0",
|
||||
"remark-prettier": "^2.0.0",
|
||||
"remark-rehype": "^10.1.0",
|
||||
"remark-retext": "^5.0.1",
|
||||
"remark-retext": "^6.0.0",
|
||||
"remark-stringify": "^10.0.3",
|
||||
"remark-validate-links": "^12.1.1",
|
||||
"retext-contractions": "^5.2.0",
|
||||
@@ -228,8 +224,8 @@
|
||||
"retext-quotes": "^5.2.0",
|
||||
"retext-sentence-spacing": "^5.2.0",
|
||||
"rimraf": "^4.4.1",
|
||||
"shiki": "^0.14.2",
|
||||
"strip-markdown": "^5.0.1",
|
||||
"shiki": "^3.15.0",
|
||||
"strip-markdown": "^6.0.0",
|
||||
"superjson": "^2.2.1",
|
||||
"tailwind-scrollbar-utilities": "^0.2.0",
|
||||
"tailwindcss": "^3.4.11",
|
||||
@@ -237,11 +233,11 @@
|
||||
"tailwindcss-react-aria-components": "^1.1.5",
|
||||
"tsx": "^4.11.0",
|
||||
"typescript": "^5.6.2",
|
||||
"unist-util-visit": "^4.1.2",
|
||||
"vfile": "^5.3.7"
|
||||
"unist-util-visit": "^5.0.0",
|
||||
"vfile": "5.3.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20.x"
|
||||
"node": "22.x"
|
||||
},
|
||||
"lint-staged": {
|
||||
"{.env,src/config/env.{server,client}.mjs}": [
|
||||
|
||||
@@ -629,7 +629,7 @@ const getAvatarURL = (data: Data): string | undefined => {
|
||||
}
|
||||
|
||||
const url = URL.createObjectURL(
|
||||
new Blob([avatar], {
|
||||
new Blob([new Uint8Array(avatar)], {
|
||||
type: 'image/jpeg',
|
||||
})
|
||||
)
|
||||
|
||||
+5
-4
@@ -1,4 +1,5 @@
|
||||
import { type Plugin } from 'unified'
|
||||
import type { Plugin } from 'unified'
|
||||
import type { VFile } from 'vfile'
|
||||
|
||||
export function remarkRawDocumentData({
|
||||
path,
|
||||
@@ -7,17 +8,17 @@ export function remarkRawDocumentData({
|
||||
path: string
|
||||
dir: string
|
||||
}): Plugin {
|
||||
return function (_, file) {
|
||||
return function (_tree: any, file: VFile) {
|
||||
const sourceFilePath = path.split(`/${dir}/`)[1]
|
||||
const sourceFileName = sourceFilePath.split('/').pop()
|
||||
const sourceFileDir = sourceFilePath.split('/').slice(0, -1).join('/')
|
||||
const flattenedPath = sourceFilePath.replace(/\.[^.]+$/, '')
|
||||
|
||||
file.data.rawDocumentData = {
|
||||
file.data['rawDocumentData'] = {
|
||||
sourceFilePath,
|
||||
sourceFileName,
|
||||
sourceFileDir,
|
||||
flattenedPath,
|
||||
}
|
||||
}
|
||||
} as Plugin
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { type Plugin } from 'unified'
|
||||
import { visit } from 'unist-util-visit'
|
||||
import { matter } from 'vfile-matter'
|
||||
|
||||
@@ -6,8 +5,11 @@ import { METADATA } from '../../../../../config/specs/metadata'
|
||||
import { resolvePathname } from '../../../../_utils/resolve-pathname'
|
||||
import { slugify } from '../../../../_utils/slugify'
|
||||
|
||||
import type { Plugin } from 'unified'
|
||||
import type { VFile } from 'vfile'
|
||||
|
||||
export function remarkRewriteLinks(): Plugin {
|
||||
return function (root, file) {
|
||||
return function (root: any, file: VFile) {
|
||||
visit(root, 'yaml', () => {
|
||||
// todo?: use unified
|
||||
// unified().use(remarkFrontmatter)
|
||||
@@ -76,5 +78,5 @@ export function remarkRewriteLinks(): Plugin {
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
} as Plugin
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createElement, Fragment } from 'react'
|
||||
import { type ReactElement } from 'react'
|
||||
|
||||
import { Avatar, Text } from '@status-im/components'
|
||||
import {
|
||||
@@ -7,8 +7,9 @@ import {
|
||||
TwitterIcon,
|
||||
} from '@status-im/icons/social'
|
||||
import { notFound } from 'next/navigation'
|
||||
import production from 'react/jsx-runtime'
|
||||
import rehypeParse from 'rehype-parse'
|
||||
import rehypeReact from 'rehype-react'
|
||||
import rehypeReact, { type Options } from 'rehype-react'
|
||||
import { unified } from 'unified'
|
||||
|
||||
import { Metadata } from '~app/_metadata'
|
||||
@@ -83,15 +84,18 @@ export default async function BlogDetailPage(props: Props) {
|
||||
}
|
||||
}
|
||||
|
||||
const rehypeReactOptions: Options = {
|
||||
...production,
|
||||
components: blogComponents,
|
||||
}
|
||||
|
||||
const { result } = await unified()
|
||||
.use(rehypeParse, { fragment: true })
|
||||
.use(rehypeReact, {
|
||||
createElement,
|
||||
Fragment,
|
||||
components: blogComponents,
|
||||
})
|
||||
.use(rehypeReact, rehypeReactOptions)
|
||||
.process(post.html!)
|
||||
|
||||
const content = result as ReactElement
|
||||
|
||||
// root
|
||||
const breadcrumbs = [
|
||||
{
|
||||
@@ -148,7 +152,7 @@ export default async function BlogDetailPage(props: Props) {
|
||||
</div>
|
||||
|
||||
{/* Content */}
|
||||
<div className="root-content container-blog py-6">{result}</div>
|
||||
<div className="root-content container-blog py-6">{content}</div>
|
||||
|
||||
<div className="container-blog py-6">
|
||||
<div className="mb-4 flex flex-row items-center gap-2">
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { createElement, Fragment } from 'react'
|
||||
|
||||
import { Button, Tag, Text } from '@status-im/components'
|
||||
import { cx } from 'class-variance-authority'
|
||||
import { redirect } from 'next/navigation'
|
||||
import production from 'react/jsx-runtime'
|
||||
import rehypeParse from 'rehype-parse'
|
||||
import rehypeReact from 'rehype-react'
|
||||
import rehypeReact, { type Options } from 'rehype-react'
|
||||
import { unified } from 'unified'
|
||||
|
||||
import { Metadata } from '~app/_metadata'
|
||||
@@ -15,6 +14,8 @@ import { getStatusJob, getStatusJobs } from '~website/_lib/greenhouse'
|
||||
|
||||
import { ApplicationFormDialog } from './_components/application-form-dialog'
|
||||
|
||||
import type { ReactElement } from 'react'
|
||||
|
||||
export const revalidate = 3600 // 1 hour
|
||||
export const dynamicParams = true
|
||||
|
||||
@@ -56,15 +57,18 @@ export default async function JobsDetailPage(props: Props) {
|
||||
.use(rehypeParse, { fragment: true })
|
||||
.parse(job.content)
|
||||
|
||||
const content = await unified()
|
||||
const rehypeReactOptions: Options = {
|
||||
...production,
|
||||
components: jobsComponents,
|
||||
}
|
||||
|
||||
const contentResult = await unified()
|
||||
.use(rehypeParse, { fragment: true })
|
||||
.use(rehypeReact, {
|
||||
createElement,
|
||||
Fragment,
|
||||
components: jobsComponents,
|
||||
})
|
||||
.use(rehypeReact, rehypeReactOptions)
|
||||
.process((result.children[0] as any).value)
|
||||
|
||||
const content = contentResult.result as ReactElement
|
||||
|
||||
return (
|
||||
<Body>
|
||||
<Breadcrumbs
|
||||
@@ -90,7 +94,7 @@ export default async function JobsDetailPage(props: Props) {
|
||||
</div>
|
||||
|
||||
{/* CONTENT */}
|
||||
<div className="root-content pb-12 xl:pb-20">{content.result}</div>
|
||||
<div className="root-content pb-12 xl:pb-20">{content}</div>
|
||||
|
||||
{/* FOOTER */}
|
||||
<div
|
||||
|
||||
@@ -4,11 +4,11 @@ import 'server-only'
|
||||
import fs from 'fs/promises'
|
||||
import { compileMDX } from 'next-mdx-remote/rsc'
|
||||
import path from 'path'
|
||||
import rehypePrettyCode from 'rehype-pretty-code'
|
||||
import { rehypePrettyCode } from 'rehype-pretty-code'
|
||||
import rehypeSlug from 'rehype-slug'
|
||||
import remarkComment from 'remark-comment'
|
||||
import remarkDirective from 'remark-directive'
|
||||
import remarkGfm from 'remark-gfm-v4'
|
||||
import remarkGfm from 'remark-gfm'
|
||||
import { z } from 'zod'
|
||||
|
||||
import {
|
||||
|
||||
@@ -49,26 +49,56 @@ export type Coin = {
|
||||
}
|
||||
|
||||
export const getCoins = async (): Promise<Coin[]> => {
|
||||
const response = await fetch('https://api.coingecko.com/api/v3/coins/list', {
|
||||
next: {
|
||||
revalidate: 3600, // 1 hour
|
||||
},
|
||||
})
|
||||
const coins = await response.json()
|
||||
try {
|
||||
const response = await fetch(
|
||||
'https://api.coingecko.com/api/v3/coins/list',
|
||||
{
|
||||
next: {
|
||||
revalidate: 3600, // 1 hour
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
return coins
|
||||
if (!response.ok) {
|
||||
return []
|
||||
}
|
||||
|
||||
const coins = await response.json()
|
||||
|
||||
return Array.isArray(coins) ? coins : []
|
||||
} catch {
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
export const getMarket = async (): Promise<Market> => {
|
||||
const response = await fetch(
|
||||
'https://api.coingecko.com/api/v3/coins/status/tickers?include_exchange_logo=true&order=volume_desc&depth=true',
|
||||
{
|
||||
next: {
|
||||
revalidate: 3600, // 1 hour
|
||||
},
|
||||
}
|
||||
)
|
||||
const market = await response.json()
|
||||
try {
|
||||
const response = await fetch(
|
||||
'https://api.coingecko.com/api/v3/coins/status/tickers?include_exchange_logo=true&order=volume_desc&depth=true',
|
||||
{
|
||||
next: {
|
||||
revalidate: 3600, // 1 hour
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
return market
|
||||
if (!response.ok) {
|
||||
return {
|
||||
name: '',
|
||||
tickers: [],
|
||||
}
|
||||
}
|
||||
|
||||
const market = await response.json()
|
||||
|
||||
return {
|
||||
name: market.name ?? '',
|
||||
tickers: Array.isArray(market.tickers) ? market.tickers : [],
|
||||
}
|
||||
} catch {
|
||||
return {
|
||||
name: '',
|
||||
tickers: [],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
20.18.0
|
||||
22.17.0
|
||||
@@ -2,6 +2,6 @@
|
||||
; why: https://github.com/vercel/next.js/discussions/70423
|
||||
node-options=--network-family-autoselection-attempt-timeout=1000
|
||||
; https://pnpm.io/npmrc#node-version
|
||||
node-version=20.18.0
|
||||
node-version=22.17.0
|
||||
; https://pnpm.io/npmrc#engine-strict
|
||||
engine-strict=true
|
||||
@@ -45,7 +45,7 @@
|
||||
"typescript-eslint": "^8.22.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20.x"
|
||||
"node": "22.x"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,mjs,ts,tsx}": [
|
||||
|
||||
@@ -52,8 +52,8 @@
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"ethers": "^6.15.0",
|
||||
"long": "^5.3.1",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react": "19.1.0",
|
||||
"react-dom": "19.1.0",
|
||||
"react-hook-form": "^7.54.2",
|
||||
"rehype-react": "^8.0.0",
|
||||
"rehype-stringify": "^10.0.0",
|
||||
|
||||
@@ -73,6 +73,17 @@ export class Storage implements T {
|
||||
return Promise.reject(new Error('clear method is not supported'))
|
||||
}
|
||||
|
||||
async getBytesInUse(keys?: null | string | string[]): Promise<number> {
|
||||
const items = await this.get(keys ?? null)
|
||||
const jsonString = JSON.stringify(items)
|
||||
return new Blob([jsonString]).size
|
||||
}
|
||||
|
||||
async getKeys(): Promise<string[]> {
|
||||
const items = await this.get(null)
|
||||
return Object.keys(items)
|
||||
}
|
||||
|
||||
onChanged = {
|
||||
addListener: () => {},
|
||||
removeListener: () => {},
|
||||
|
||||
+122
-202
@@ -8,179 +8,71 @@
|
||||
// You should NOT make any changes in this file as it will be overwritten.
|
||||
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
||||
|
||||
// Import Routes
|
||||
import { Route as rootRouteImport } from './routes/__root'
|
||||
import { Route as OnboardingLayoutRouteImport } from './routes/onboarding/_layout'
|
||||
import { Route as IndexRouteImport } from './routes/index'
|
||||
import { Route as OnboardingIndexRouteImport } from './routes/onboarding/index'
|
||||
import { Route as OnboardingNewRouteImport } from './routes/onboarding/new'
|
||||
import { Route as OnboardingImportRouteImport } from './routes/onboarding/import'
|
||||
import { Route as PortfolioCollectiblesIndexRouteImport } from './routes/portfolio/collectibles/index'
|
||||
import { Route as PortfolioAssetsIndexRouteImport } from './routes/portfolio/assets/index'
|
||||
import { Route as PortfolioActivityIndexRouteImport } from './routes/portfolio/activity/index'
|
||||
import { Route as PortfolioAssetsTickerRouteImport } from './routes/portfolio/assets/$ticker'
|
||||
import { Route as PortfolioCollectiblesNetworkContractIdRouteImport } from './routes/portfolio/collectibles/$network/$contract/$id'
|
||||
|
||||
import { Route as rootRoute } from './routes/__root'
|
||||
import { Route as OnboardingLayoutImport } from './routes/onboarding/_layout'
|
||||
import { Route as IndexImport } from './routes/index'
|
||||
import { Route as OnboardingIndexImport } from './routes/onboarding/index'
|
||||
import { Route as OnboardingNewImport } from './routes/onboarding/new'
|
||||
import { Route as OnboardingImportImport } from './routes/onboarding/import'
|
||||
import { Route as PortfolioCollectiblesIndexImport } from './routes/portfolio/collectibles/index'
|
||||
import { Route as PortfolioAssetsIndexImport } from './routes/portfolio/assets/index'
|
||||
import { Route as PortfolioActivityIndexImport } from './routes/portfolio/activity/index'
|
||||
import { Route as PortfolioAssetsTickerImport } from './routes/portfolio/assets/$ticker'
|
||||
import { Route as PortfolioCollectiblesNetworkContractIdImport } from './routes/portfolio/collectibles/$network/$contract/$id'
|
||||
|
||||
// Create/Update Routes
|
||||
|
||||
const OnboardingLayoutRoute = OnboardingLayoutImport.update({
|
||||
const OnboardingLayoutRoute = OnboardingLayoutRouteImport.update({
|
||||
id: '/onboarding',
|
||||
path: '/onboarding',
|
||||
getParentRoute: () => rootRoute,
|
||||
getParentRoute: () => rootRouteImport,
|
||||
} as any)
|
||||
|
||||
const IndexRoute = IndexImport.update({
|
||||
const IndexRoute = IndexRouteImport.update({
|
||||
id: '/',
|
||||
path: '/',
|
||||
getParentRoute: () => rootRoute,
|
||||
getParentRoute: () => rootRouteImport,
|
||||
} as any)
|
||||
|
||||
const OnboardingIndexRoute = OnboardingIndexImport.update({
|
||||
const OnboardingIndexRoute = OnboardingIndexRouteImport.update({
|
||||
id: '/',
|
||||
path: '/',
|
||||
getParentRoute: () => OnboardingLayoutRoute,
|
||||
} as any)
|
||||
|
||||
const OnboardingNewRoute = OnboardingNewImport.update({
|
||||
const OnboardingNewRoute = OnboardingNewRouteImport.update({
|
||||
id: '/new',
|
||||
path: '/new',
|
||||
getParentRoute: () => OnboardingLayoutRoute,
|
||||
} as any)
|
||||
|
||||
const OnboardingImportRoute = OnboardingImportImport.update({
|
||||
const OnboardingImportRoute = OnboardingImportRouteImport.update({
|
||||
id: '/import',
|
||||
path: '/import',
|
||||
getParentRoute: () => OnboardingLayoutRoute,
|
||||
} as any)
|
||||
|
||||
const PortfolioCollectiblesIndexRoute = PortfolioCollectiblesIndexImport.update(
|
||||
{
|
||||
const PortfolioCollectiblesIndexRoute =
|
||||
PortfolioCollectiblesIndexRouteImport.update({
|
||||
id: '/portfolio/collectibles/',
|
||||
path: '/portfolio/collectibles/',
|
||||
getParentRoute: () => rootRoute,
|
||||
} as any,
|
||||
)
|
||||
|
||||
const PortfolioAssetsIndexRoute = PortfolioAssetsIndexImport.update({
|
||||
getParentRoute: () => rootRouteImport,
|
||||
} as any)
|
||||
const PortfolioAssetsIndexRoute = PortfolioAssetsIndexRouteImport.update({
|
||||
id: '/portfolio/assets/',
|
||||
path: '/portfolio/assets/',
|
||||
getParentRoute: () => rootRoute,
|
||||
getParentRoute: () => rootRouteImport,
|
||||
} as any)
|
||||
|
||||
const PortfolioActivityIndexRoute = PortfolioActivityIndexImport.update({
|
||||
const PortfolioActivityIndexRoute = PortfolioActivityIndexRouteImport.update({
|
||||
id: '/portfolio/activity/',
|
||||
path: '/portfolio/activity/',
|
||||
getParentRoute: () => rootRoute,
|
||||
getParentRoute: () => rootRouteImport,
|
||||
} as any)
|
||||
|
||||
const PortfolioAssetsTickerRoute = PortfolioAssetsTickerImport.update({
|
||||
const PortfolioAssetsTickerRoute = PortfolioAssetsTickerRouteImport.update({
|
||||
id: '/portfolio/assets/$ticker',
|
||||
path: '/portfolio/assets/$ticker',
|
||||
getParentRoute: () => rootRoute,
|
||||
getParentRoute: () => rootRouteImport,
|
||||
} as any)
|
||||
|
||||
const PortfolioCollectiblesNetworkContractIdRoute =
|
||||
PortfolioCollectiblesNetworkContractIdImport.update({
|
||||
PortfolioCollectiblesNetworkContractIdRouteImport.update({
|
||||
id: '/portfolio/collectibles/$network/$contract/$id',
|
||||
path: '/portfolio/collectibles/$network/$contract/$id',
|
||||
getParentRoute: () => rootRoute,
|
||||
getParentRoute: () => rootRouteImport,
|
||||
} as any)
|
||||
|
||||
// Populate the FileRoutesByPath interface
|
||||
|
||||
declare module '@tanstack/react-router' {
|
||||
interface FileRoutesByPath {
|
||||
'/': {
|
||||
id: '/'
|
||||
path: '/'
|
||||
fullPath: '/'
|
||||
preLoaderRoute: typeof IndexImport
|
||||
parentRoute: typeof rootRoute
|
||||
}
|
||||
'/onboarding': {
|
||||
id: '/onboarding'
|
||||
path: '/onboarding'
|
||||
fullPath: '/onboarding'
|
||||
preLoaderRoute: typeof OnboardingLayoutImport
|
||||
parentRoute: typeof rootRoute
|
||||
}
|
||||
'/onboarding/import': {
|
||||
id: '/onboarding/import'
|
||||
path: '/import'
|
||||
fullPath: '/onboarding/import'
|
||||
preLoaderRoute: typeof OnboardingImportImport
|
||||
parentRoute: typeof OnboardingLayoutImport
|
||||
}
|
||||
'/onboarding/new': {
|
||||
id: '/onboarding/new'
|
||||
path: '/new'
|
||||
fullPath: '/onboarding/new'
|
||||
preLoaderRoute: typeof OnboardingNewImport
|
||||
parentRoute: typeof OnboardingLayoutImport
|
||||
}
|
||||
'/onboarding/': {
|
||||
id: '/onboarding/'
|
||||
path: '/'
|
||||
fullPath: '/onboarding/'
|
||||
preLoaderRoute: typeof OnboardingIndexImport
|
||||
parentRoute: typeof OnboardingLayoutImport
|
||||
}
|
||||
'/portfolio/assets/$ticker': {
|
||||
id: '/portfolio/assets/$ticker'
|
||||
path: '/portfolio/assets/$ticker'
|
||||
fullPath: '/portfolio/assets/$ticker'
|
||||
preLoaderRoute: typeof PortfolioAssetsTickerImport
|
||||
parentRoute: typeof rootRoute
|
||||
}
|
||||
'/portfolio/activity/': {
|
||||
id: '/portfolio/activity/'
|
||||
path: '/portfolio/activity'
|
||||
fullPath: '/portfolio/activity'
|
||||
preLoaderRoute: typeof PortfolioActivityIndexImport
|
||||
parentRoute: typeof rootRoute
|
||||
}
|
||||
'/portfolio/assets/': {
|
||||
id: '/portfolio/assets/'
|
||||
path: '/portfolio/assets'
|
||||
fullPath: '/portfolio/assets'
|
||||
preLoaderRoute: typeof PortfolioAssetsIndexImport
|
||||
parentRoute: typeof rootRoute
|
||||
}
|
||||
'/portfolio/collectibles/': {
|
||||
id: '/portfolio/collectibles/'
|
||||
path: '/portfolio/collectibles'
|
||||
fullPath: '/portfolio/collectibles'
|
||||
preLoaderRoute: typeof PortfolioCollectiblesIndexImport
|
||||
parentRoute: typeof rootRoute
|
||||
}
|
||||
'/portfolio/collectibles/$network/$contract/$id': {
|
||||
id: '/portfolio/collectibles/$network/$contract/$id'
|
||||
path: '/portfolio/collectibles/$network/$contract/$id'
|
||||
fullPath: '/portfolio/collectibles/$network/$contract/$id'
|
||||
preLoaderRoute: typeof PortfolioCollectiblesNetworkContractIdImport
|
||||
parentRoute: typeof rootRoute
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create and export the route tree
|
||||
|
||||
interface OnboardingLayoutRouteChildren {
|
||||
OnboardingImportRoute: typeof OnboardingImportRoute
|
||||
OnboardingNewRoute: typeof OnboardingNewRoute
|
||||
OnboardingIndexRoute: typeof OnboardingIndexRoute
|
||||
}
|
||||
|
||||
const OnboardingLayoutRouteChildren: OnboardingLayoutRouteChildren = {
|
||||
OnboardingImportRoute: OnboardingImportRoute,
|
||||
OnboardingNewRoute: OnboardingNewRoute,
|
||||
OnboardingIndexRoute: OnboardingIndexRoute,
|
||||
}
|
||||
|
||||
const OnboardingLayoutRouteWithChildren =
|
||||
OnboardingLayoutRoute._addFileChildren(OnboardingLayoutRouteChildren)
|
||||
|
||||
export interface FileRoutesByFullPath {
|
||||
'/': typeof IndexRoute
|
||||
'/onboarding': typeof OnboardingLayoutRouteWithChildren
|
||||
@@ -193,7 +85,6 @@ export interface FileRoutesByFullPath {
|
||||
'/portfolio/collectibles': typeof PortfolioCollectiblesIndexRoute
|
||||
'/portfolio/collectibles/$network/$contract/$id': typeof PortfolioCollectiblesNetworkContractIdRoute
|
||||
}
|
||||
|
||||
export interface FileRoutesByTo {
|
||||
'/': typeof IndexRoute
|
||||
'/onboarding/import': typeof OnboardingImportRoute
|
||||
@@ -205,9 +96,8 @@ export interface FileRoutesByTo {
|
||||
'/portfolio/collectibles': typeof PortfolioCollectiblesIndexRoute
|
||||
'/portfolio/collectibles/$network/$contract/$id': typeof PortfolioCollectiblesNetworkContractIdRoute
|
||||
}
|
||||
|
||||
export interface FileRoutesById {
|
||||
__root__: typeof rootRoute
|
||||
__root__: typeof rootRouteImport
|
||||
'/': typeof IndexRoute
|
||||
'/onboarding': typeof OnboardingLayoutRouteWithChildren
|
||||
'/onboarding/import': typeof OnboardingImportRoute
|
||||
@@ -219,7 +109,6 @@ export interface FileRoutesById {
|
||||
'/portfolio/collectibles/': typeof PortfolioCollectiblesIndexRoute
|
||||
'/portfolio/collectibles/$network/$contract/$id': typeof PortfolioCollectiblesNetworkContractIdRoute
|
||||
}
|
||||
|
||||
export interface FileRouteTypes {
|
||||
fileRoutesByFullPath: FileRoutesByFullPath
|
||||
fullPaths:
|
||||
@@ -258,7 +147,6 @@ export interface FileRouteTypes {
|
||||
| '/portfolio/collectibles/$network/$contract/$id'
|
||||
fileRoutesById: FileRoutesById
|
||||
}
|
||||
|
||||
export interface RootRouteChildren {
|
||||
IndexRoute: typeof IndexRoute
|
||||
OnboardingLayoutRoute: typeof OnboardingLayoutRouteWithChildren
|
||||
@@ -269,6 +157,96 @@ export interface RootRouteChildren {
|
||||
PortfolioCollectiblesNetworkContractIdRoute: typeof PortfolioCollectiblesNetworkContractIdRoute
|
||||
}
|
||||
|
||||
declare module '@tanstack/react-router' {
|
||||
interface FileRoutesByPath {
|
||||
'/onboarding': {
|
||||
id: '/onboarding'
|
||||
path: '/onboarding'
|
||||
fullPath: '/onboarding'
|
||||
preLoaderRoute: typeof OnboardingLayoutRouteImport
|
||||
parentRoute: typeof rootRouteImport
|
||||
}
|
||||
'/': {
|
||||
id: '/'
|
||||
path: '/'
|
||||
fullPath: '/'
|
||||
preLoaderRoute: typeof IndexRouteImport
|
||||
parentRoute: typeof rootRouteImport
|
||||
}
|
||||
'/onboarding/': {
|
||||
id: '/onboarding/'
|
||||
path: '/'
|
||||
fullPath: '/onboarding/'
|
||||
preLoaderRoute: typeof OnboardingIndexRouteImport
|
||||
parentRoute: typeof OnboardingLayoutRoute
|
||||
}
|
||||
'/onboarding/new': {
|
||||
id: '/onboarding/new'
|
||||
path: '/new'
|
||||
fullPath: '/onboarding/new'
|
||||
preLoaderRoute: typeof OnboardingNewRouteImport
|
||||
parentRoute: typeof OnboardingLayoutRoute
|
||||
}
|
||||
'/onboarding/import': {
|
||||
id: '/onboarding/import'
|
||||
path: '/import'
|
||||
fullPath: '/onboarding/import'
|
||||
preLoaderRoute: typeof OnboardingImportRouteImport
|
||||
parentRoute: typeof OnboardingLayoutRoute
|
||||
}
|
||||
'/portfolio/collectibles/': {
|
||||
id: '/portfolio/collectibles/'
|
||||
path: '/portfolio/collectibles'
|
||||
fullPath: '/portfolio/collectibles'
|
||||
preLoaderRoute: typeof PortfolioCollectiblesIndexRouteImport
|
||||
parentRoute: typeof rootRouteImport
|
||||
}
|
||||
'/portfolio/assets/': {
|
||||
id: '/portfolio/assets/'
|
||||
path: '/portfolio/assets'
|
||||
fullPath: '/portfolio/assets'
|
||||
preLoaderRoute: typeof PortfolioAssetsIndexRouteImport
|
||||
parentRoute: typeof rootRouteImport
|
||||
}
|
||||
'/portfolio/activity/': {
|
||||
id: '/portfolio/activity/'
|
||||
path: '/portfolio/activity'
|
||||
fullPath: '/portfolio/activity'
|
||||
preLoaderRoute: typeof PortfolioActivityIndexRouteImport
|
||||
parentRoute: typeof rootRouteImport
|
||||
}
|
||||
'/portfolio/assets/$ticker': {
|
||||
id: '/portfolio/assets/$ticker'
|
||||
path: '/portfolio/assets/$ticker'
|
||||
fullPath: '/portfolio/assets/$ticker'
|
||||
preLoaderRoute: typeof PortfolioAssetsTickerRouteImport
|
||||
parentRoute: typeof rootRouteImport
|
||||
}
|
||||
'/portfolio/collectibles/$network/$contract/$id': {
|
||||
id: '/portfolio/collectibles/$network/$contract/$id'
|
||||
path: '/portfolio/collectibles/$network/$contract/$id'
|
||||
fullPath: '/portfolio/collectibles/$network/$contract/$id'
|
||||
preLoaderRoute: typeof PortfolioCollectiblesNetworkContractIdRouteImport
|
||||
parentRoute: typeof rootRouteImport
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface OnboardingLayoutRouteChildren {
|
||||
OnboardingImportRoute: typeof OnboardingImportRoute
|
||||
OnboardingNewRoute: typeof OnboardingNewRoute
|
||||
OnboardingIndexRoute: typeof OnboardingIndexRoute
|
||||
}
|
||||
|
||||
const OnboardingLayoutRouteChildren: OnboardingLayoutRouteChildren = {
|
||||
OnboardingImportRoute: OnboardingImportRoute,
|
||||
OnboardingNewRoute: OnboardingNewRoute,
|
||||
OnboardingIndexRoute: OnboardingIndexRoute,
|
||||
}
|
||||
|
||||
const OnboardingLayoutRouteWithChildren =
|
||||
OnboardingLayoutRoute._addFileChildren(OnboardingLayoutRouteChildren)
|
||||
|
||||
const rootRouteChildren: RootRouteChildren = {
|
||||
IndexRoute: IndexRoute,
|
||||
OnboardingLayoutRoute: OnboardingLayoutRouteWithChildren,
|
||||
@@ -279,64 +257,6 @@ const rootRouteChildren: RootRouteChildren = {
|
||||
PortfolioCollectiblesNetworkContractIdRoute:
|
||||
PortfolioCollectiblesNetworkContractIdRoute,
|
||||
}
|
||||
|
||||
export const routeTree = rootRoute
|
||||
export const routeTree = rootRouteImport
|
||||
._addFileChildren(rootRouteChildren)
|
||||
._addFileTypes<FileRouteTypes>()
|
||||
|
||||
/* ROUTE_MANIFEST_START
|
||||
{
|
||||
"routes": {
|
||||
"__root__": {
|
||||
"filePath": "__root.tsx",
|
||||
"children": [
|
||||
"/",
|
||||
"/onboarding",
|
||||
"/portfolio/assets/$ticker",
|
||||
"/portfolio/activity/",
|
||||
"/portfolio/assets/",
|
||||
"/portfolio/collectibles/",
|
||||
"/portfolio/collectibles/$network/$contract/$id"
|
||||
]
|
||||
},
|
||||
"/": {
|
||||
"filePath": "index.tsx"
|
||||
},
|
||||
"/onboarding": {
|
||||
"filePath": "onboarding/_layout.tsx",
|
||||
"children": [
|
||||
"/onboarding/import",
|
||||
"/onboarding/new",
|
||||
"/onboarding/"
|
||||
]
|
||||
},
|
||||
"/onboarding/import": {
|
||||
"filePath": "onboarding/import.tsx",
|
||||
"parent": "/onboarding"
|
||||
},
|
||||
"/onboarding/new": {
|
||||
"filePath": "onboarding/new.tsx",
|
||||
"parent": "/onboarding"
|
||||
},
|
||||
"/onboarding/": {
|
||||
"filePath": "onboarding/index.tsx",
|
||||
"parent": "/onboarding"
|
||||
},
|
||||
"/portfolio/assets/$ticker": {
|
||||
"filePath": "portfolio/assets/$ticker.tsx"
|
||||
},
|
||||
"/portfolio/activity/": {
|
||||
"filePath": "portfolio/activity/index.tsx"
|
||||
},
|
||||
"/portfolio/assets/": {
|
||||
"filePath": "portfolio/assets/index.tsx"
|
||||
},
|
||||
"/portfolio/collectibles/": {
|
||||
"filePath": "portfolio/collectibles/index.tsx"
|
||||
},
|
||||
"/portfolio/collectibles/$network/$contract/$id": {
|
||||
"filePath": "portfolio/collectibles/$network/$contract/$id.tsx"
|
||||
}
|
||||
}
|
||||
}
|
||||
ROUTE_MANIFEST_END */
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
default = pkgsFor.${system}.mkShellNoCC {
|
||||
packages = with pkgsFor.${system}.buildPackages; [
|
||||
git # 2.47.2
|
||||
nodejs_20 # v20.19.1
|
||||
nodejs_20 # v20.19.1 to be updated to v22.17.0
|
||||
pnpm # 9.15.9
|
||||
];
|
||||
};
|
||||
|
||||
+14
-6
@@ -37,10 +37,15 @@
|
||||
"vite": "6.3.5",
|
||||
"vitest": "3.1.4",
|
||||
"vite-node": "3.1.4",
|
||||
"protons-runtime": "3.1.0",
|
||||
"protons-runtime": "^5.4.0",
|
||||
"it-length-prefixed": "9.0.3",
|
||||
"remark-lint": "9.1.2",
|
||||
"@scure/base": "^1.2.6"
|
||||
"remark-lint": "10.0.1",
|
||||
"@scure/base": "^1.2.6",
|
||||
"vfile": "5.3.7",
|
||||
"vfile-message": "3.1.4",
|
||||
"react-hook-form": "^7.45.1",
|
||||
"@noble/secp256k1": "1.7.2",
|
||||
"@waku/message-encryption": "0.0.38"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@changesets/cli": "^2.26.2",
|
||||
@@ -71,13 +76,13 @@
|
||||
},
|
||||
"pnpm": {
|
||||
"patchedDependencies": {
|
||||
"@achingbrain/ssdp@4.0.1": "patches/@achingbrain__ssdp@4.0.1.patch",
|
||||
"@libp2p/bootstrap@9.0.10": "patches/@libp2p__bootstrap@9.0.10.patch",
|
||||
"it-length-prefixed@9.0.3": "patches/it-length-prefixed@9.0.3.patch",
|
||||
"arctic@1.2.0": "patches/arctic@1.2.0.patch",
|
||||
"tinykeys@3.0.0": "patches/tinykeys@3.0.0.patch",
|
||||
"oslo@1.0.1": "patches/oslo@1.0.1.patch",
|
||||
"@trpc/server@11.1.0": "patches/@trpc__server@11.1.0.patch"
|
||||
"@trpc/server@11.1.0": "patches/@trpc__server@11.1.0.patch",
|
||||
"@noble/secp256k1@1.7.2": "patches/@noble__secp256k1@1.7.2.patch",
|
||||
"@waku/message-encryption@0.0.38": "patches/@waku__message-encryption@0.0.38.patch"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -85,5 +90,8 @@
|
||||
"connectkit": "^1.9.0",
|
||||
"iron-session": "^8.0.4",
|
||||
"wagmi": "^2.12.8"
|
||||
},
|
||||
"engines": {
|
||||
"node": "22.x"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
"url": "https://github.com/status-im/status-web/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.18.0"
|
||||
"node": ">=22.x"
|
||||
},
|
||||
"scripts": {
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
@@ -63,20 +63,20 @@
|
||||
"clean": "rimraf dist node_modules .turbo"
|
||||
},
|
||||
"dependencies": {
|
||||
"@bufbuild/protobuf": "1.4.2",
|
||||
"@libp2p/bootstrap": "^9.0.10",
|
||||
"@bufbuild/protobuf": "2.10.0",
|
||||
"@libp2p/bootstrap": "^11.0.42",
|
||||
"@scure/base": "^1.2.6",
|
||||
"@waku/message-encryption": "^0.0.24",
|
||||
"@waku/sdk": "^0.0.22",
|
||||
"@waku/message-encryption": "^0.0.38",
|
||||
"@waku/sdk": "^0.0.36",
|
||||
"ethereum-cryptography": "^1.0.3",
|
||||
"ethers": "^6.2.1",
|
||||
"ethers": "^6.15.0",
|
||||
"multiformats": "^11.0.1",
|
||||
"zod": "^3.23.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@bufbuild/protoc-gen-es": "1.4.2",
|
||||
"@bufbuild/protoc-gen-es": "2.10.0",
|
||||
"@status-im/eslint-config": "workspace:*",
|
||||
"@waku/interfaces": "^0.0.21",
|
||||
"@waku/interfaces": "^0.0.34",
|
||||
"happy-dom": "^9.1.7"
|
||||
},
|
||||
"files": [
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
import { PageDirection } from '@waku/interfaces'
|
||||
import { create, toBinary } from '@bufbuild/protobuf'
|
||||
import { createDecoder } from '@waku/message-encryption/symmetric'
|
||||
|
||||
import { containsOnlyEmoji } from '../helpers/contains-only-emoji'
|
||||
import { ApplicationMetadataMessage_Type } from '../protos/application-metadata-message_pb'
|
||||
import {
|
||||
ChatMessage as ChatMessageProto,
|
||||
ChatMessage_ContentType,
|
||||
DeleteMessage,
|
||||
EditMessage,
|
||||
ChatMessageSchema,
|
||||
DeleteMessageSchema,
|
||||
EditMessageSchema,
|
||||
} from '../protos/chat-message_pb'
|
||||
import { EmojiReaction, EmojiReaction_Type } from '../protos/emoji-reaction_pb'
|
||||
import {
|
||||
EmojiReaction_Type,
|
||||
EmojiReactionSchema,
|
||||
} from '../protos/emoji-reaction_pb'
|
||||
import { MessageType } from '../protos/enums_pb'
|
||||
import { createChannelURLWithChatKey } from '../utils/create-url'
|
||||
import { generateKeyFromPassword } from '../utils/generate-key-from-password'
|
||||
@@ -17,19 +20,20 @@ import { getNextClock } from '../utils/get-next-clock'
|
||||
import { idToContentTopic } from '../utils/id-to-content-topic'
|
||||
import { getReactions } from './community/get-reactions'
|
||||
|
||||
import type { ImageMessage } from '../protos/chat-message_pb'
|
||||
import type { CommunityChat as CommunityChatProto } from '../protos/communities_pb'
|
||||
import type {
|
||||
ChatMessage as ChatMessageProto,
|
||||
ImageMessage,
|
||||
} from '../protos/chat-message_pb'
|
||||
import type { CommunityChat } from '../protos/communities_pb'
|
||||
import type { EmojiReaction } from '../protos/emoji-reaction_pb'
|
||||
import type { Client } from './client'
|
||||
import type { Community } from './community/community'
|
||||
import type { Reactions } from './community/get-reactions'
|
||||
import type { Member } from './member'
|
||||
import type { PlainMessage } from '@bufbuild/protobuf'
|
||||
|
||||
export { ChatMessage_ContentType as ChatMessageContentType } from '../protos/chat-message_pb'
|
||||
|
||||
export type CommunityChat = PlainMessage<CommunityChatProto>
|
||||
|
||||
export type ChatMessage = PlainMessage<ChatMessageProto> & {
|
||||
export type ChatMessage = ChatMessageProto & {
|
||||
messageId: string
|
||||
pinned: boolean
|
||||
reactions: Reactions
|
||||
@@ -209,10 +213,15 @@ export class Chat {
|
||||
|
||||
await this.client.waku.store.queryWithOrderedCallback(
|
||||
[
|
||||
createDecoder(this.contentTopic, this.symmetricKey, {
|
||||
clusterId: 16,
|
||||
shard: 32,
|
||||
}),
|
||||
createDecoder(
|
||||
this.contentTopic,
|
||||
{
|
||||
clusterId: 16,
|
||||
shardId: 32,
|
||||
pubsubTopic: '/waku/2/rs/16/32',
|
||||
},
|
||||
this.symmetricKey,
|
||||
),
|
||||
],
|
||||
wakuMessage => {
|
||||
this.#fetchingMessages = true
|
||||
@@ -220,13 +229,11 @@ export class Chat {
|
||||
this.#fetchingMessages = false
|
||||
},
|
||||
{
|
||||
timeFilter: {
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
},
|
||||
pageSize: 50,
|
||||
timeStart: startTime,
|
||||
timeEnd: endTime,
|
||||
paginationLimit: 50,
|
||||
// most recent page first
|
||||
pageDirection: PageDirection.BACKWARD,
|
||||
paginationForward: false,
|
||||
},
|
||||
)
|
||||
|
||||
@@ -472,18 +479,21 @@ export class Chat {
|
||||
: ChatMessage_ContentType.TEXT_PLAIN
|
||||
|
||||
// TODO: protos does not support optional fields :-(
|
||||
const payload = new ChatMessageProto({
|
||||
clock: this.setClock(this.#clock),
|
||||
timestamp: BigInt(Date.now()),
|
||||
text,
|
||||
responseTo: responseTo ?? '',
|
||||
ensName: '',
|
||||
chatId: this.id,
|
||||
contentType: type,
|
||||
messageType: MessageType.COMMUNITY_CHAT,
|
||||
grant: new Uint8Array([]),
|
||||
displayName: '',
|
||||
}).toBinary()
|
||||
const payload = toBinary(
|
||||
ChatMessageSchema,
|
||||
create(ChatMessageSchema, {
|
||||
clock: this.setClock(this.#clock),
|
||||
timestamp: BigInt(Date.now()),
|
||||
text,
|
||||
responseTo: responseTo ?? '',
|
||||
ensName: '',
|
||||
chatId: this.id,
|
||||
contentType: type,
|
||||
messageType: MessageType.COMMUNITY_CHAT,
|
||||
grant: new Uint8Array([]),
|
||||
displayName: '',
|
||||
}),
|
||||
)
|
||||
|
||||
await this.client.sendWakuMessage(
|
||||
ApplicationMetadataMessage_Type.CHAT_MESSAGE,
|
||||
@@ -494,25 +504,28 @@ export class Chat {
|
||||
}
|
||||
|
||||
public sendImageMessage = async (image: ImageMessage) => {
|
||||
const payload = new ChatMessageProto({
|
||||
clock: this.setClock(this.#clock),
|
||||
timestamp: BigInt(Date.now()),
|
||||
text: '',
|
||||
responseTo: '',
|
||||
ensName: '',
|
||||
chatId: this.id,
|
||||
messageType: MessageType.COMMUNITY_CHAT,
|
||||
contentType: ChatMessage_ContentType.IMAGE,
|
||||
payload: {
|
||||
case: 'image',
|
||||
value: {
|
||||
format: image.format,
|
||||
payload: image.payload,
|
||||
const payload = toBinary(
|
||||
ChatMessageSchema,
|
||||
create(ChatMessageSchema, {
|
||||
clock: this.setClock(this.#clock),
|
||||
timestamp: BigInt(Date.now()),
|
||||
text: '',
|
||||
responseTo: '',
|
||||
ensName: '',
|
||||
chatId: this.id,
|
||||
messageType: MessageType.COMMUNITY_CHAT,
|
||||
contentType: ChatMessage_ContentType.IMAGE,
|
||||
payload: {
|
||||
case: 'image',
|
||||
value: {
|
||||
format: image.format,
|
||||
payload: image.payload,
|
||||
},
|
||||
},
|
||||
},
|
||||
grant: new Uint8Array([]),
|
||||
displayName: '',
|
||||
}).toBinary()
|
||||
grant: new Uint8Array([]),
|
||||
displayName: '',
|
||||
}),
|
||||
)
|
||||
|
||||
await this.client.sendWakuMessage(
|
||||
ApplicationMetadataMessage_Type.CHAT_MESSAGE,
|
||||
@@ -541,14 +554,17 @@ export class Chat {
|
||||
throw new Error('Text message cannot be empty')
|
||||
}
|
||||
|
||||
const payload = new EditMessage({
|
||||
clock: this.setClock(this.#clock),
|
||||
text,
|
||||
messageId,
|
||||
chatId: this.id,
|
||||
grant: new Uint8Array([]),
|
||||
messageType: MessageType.COMMUNITY_CHAT,
|
||||
}).toBinary()
|
||||
const payload = toBinary(
|
||||
EditMessageSchema,
|
||||
create(EditMessageSchema, {
|
||||
clock: this.setClock(this.#clock),
|
||||
text,
|
||||
messageId,
|
||||
chatId: this.id,
|
||||
grant: new Uint8Array([]),
|
||||
messageType: MessageType.COMMUNITY_CHAT,
|
||||
}),
|
||||
)
|
||||
|
||||
await this.client.sendWakuMessage(
|
||||
ApplicationMetadataMessage_Type.EDIT_MESSAGE,
|
||||
@@ -575,13 +591,16 @@ export class Chat {
|
||||
throw new Error('Text message can only be deleted by its author')
|
||||
}
|
||||
|
||||
const payload = new DeleteMessage({
|
||||
clock: this.setClock(this.#clock),
|
||||
messageId,
|
||||
chatId: this.id,
|
||||
grant: new Uint8Array([]),
|
||||
messageType: MessageType.COMMUNITY_CHAT,
|
||||
}).toBinary()
|
||||
const payload = toBinary(
|
||||
DeleteMessageSchema,
|
||||
create(DeleteMessageSchema, {
|
||||
clock: this.setClock(this.#clock),
|
||||
messageId,
|
||||
chatId: this.id,
|
||||
grant: new Uint8Array([]),
|
||||
messageType: MessageType.COMMUNITY_CHAT,
|
||||
}),
|
||||
)
|
||||
|
||||
await this.client.sendWakuMessage(
|
||||
ApplicationMetadataMessage_Type.DELETE_MESSAGE,
|
||||
@@ -609,15 +628,18 @@ export class Chat {
|
||||
`0x${this.client.account.publicKey}`,
|
||||
)
|
||||
|
||||
const payload = new EmojiReaction({
|
||||
clock: this.setClock(this.#clock),
|
||||
chatId: this.id,
|
||||
messageType: MessageType.COMMUNITY_CHAT,
|
||||
messageId,
|
||||
type: EmojiReaction_Type[reaction],
|
||||
retracted,
|
||||
grant: new Uint8Array([]),
|
||||
}).toBinary()
|
||||
const payload = toBinary(
|
||||
EmojiReactionSchema,
|
||||
create(EmojiReactionSchema, {
|
||||
clock: this.setClock(this.#clock),
|
||||
chatId: this.id,
|
||||
messageType: MessageType.COMMUNITY_CHAT,
|
||||
messageId,
|
||||
type: EmojiReaction_Type[reaction],
|
||||
retracted,
|
||||
grant: new Uint8Array([]),
|
||||
}),
|
||||
)
|
||||
|
||||
await this.client.sendWakuMessage(
|
||||
ApplicationMetadataMessage_Type.EMOJI_REACTION,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* @see https://specs.status.im/spec/1
|
||||
*/
|
||||
|
||||
import { create, toBinary } from '@bufbuild/protobuf'
|
||||
import { bootstrap } from '@libp2p/bootstrap'
|
||||
import { Protocols } from '@waku/interfaces'
|
||||
import { createEncoder } from '@waku/message-encryption/symmetric'
|
||||
@@ -9,7 +10,7 @@ import { createLightNode, waitForRemotePeer } from '@waku/sdk'
|
||||
import { hexToBytes } from 'ethereum-cryptography/utils'
|
||||
|
||||
import { peers } from '../consts/peers'
|
||||
import { ApplicationMetadataMessage } from '../protos/application-metadata-message_pb'
|
||||
import { ApplicationMetadataMessageSchema } from '../protos/application-metadata-message_pb'
|
||||
import { Account } from './account'
|
||||
import { ActivityCenter } from './activityCenter'
|
||||
import { Community } from './community/community'
|
||||
@@ -262,20 +263,24 @@ class Client {
|
||||
|
||||
const signature = await this.#account.sign(payload)
|
||||
|
||||
const message = new ApplicationMetadataMessage({
|
||||
type: type,
|
||||
signature,
|
||||
payload,
|
||||
}).toBinary()
|
||||
const message = toBinary(
|
||||
ApplicationMetadataMessageSchema,
|
||||
create(ApplicationMetadataMessageSchema, {
|
||||
type: type,
|
||||
signature: new Uint8Array(signature),
|
||||
payload: new Uint8Array(payload),
|
||||
}),
|
||||
)
|
||||
|
||||
await this.waku.lightPush.send(
|
||||
createEncoder({
|
||||
contentTopic,
|
||||
symKey,
|
||||
sigPrivKey: hexToBytes(this.#account.privateKey),
|
||||
pubsubTopicShardInfo: {
|
||||
routingInfo: {
|
||||
clusterId: 16,
|
||||
shard: 32,
|
||||
shardId: 32,
|
||||
pubsubTopic: '/waku/2/rs/16/32',
|
||||
},
|
||||
}),
|
||||
{ payload: message },
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { create, toBinary } from '@bufbuild/protobuf'
|
||||
import { createDecoder } from '@waku/message-encryption/symmetric'
|
||||
import { hexToBytes } from 'ethereum-cryptography/utils'
|
||||
|
||||
import { getDifferenceByKeys } from '../../helpers/get-difference-by-keys'
|
||||
import { getObjectsDifference } from '../../helpers/get-objects-difference'
|
||||
import { ApplicationMetadataMessage_Type } from '../../protos/application-metadata-message_pb'
|
||||
import { CommunityRequestToJoin } from '../../protos/communities_pb'
|
||||
import { CommunityRequestToJoinSchema } from '../../protos/communities_pb'
|
||||
import { MessageType } from '../../protos/enums_pb'
|
||||
import { compressPublicKey } from '../../utils/compress-public-key'
|
||||
import { createCommunityURLWithChatKey } from '../../utils/create-url'
|
||||
@@ -15,12 +16,11 @@ import { serializePublicKey } from '../../utils/serialize-public-key'
|
||||
import { Chat } from '../chat'
|
||||
import { Member } from '../member'
|
||||
|
||||
import type { CommunityDescription as CommunityDescriptionProto } from '../../protos/communities_pb'
|
||||
import type { CommunityChat } from '../chat'
|
||||
import type {
|
||||
CommunityChat,
|
||||
CommunityDescription,
|
||||
} from '../../protos/communities_pb'
|
||||
import type { Client } from '../client'
|
||||
import type { PlainMessage } from '@bufbuild/protobuf'
|
||||
|
||||
type CommunityDescription = PlainMessage<CommunityDescriptionProto>
|
||||
|
||||
export class Community {
|
||||
private client: Client
|
||||
@@ -95,10 +95,15 @@ export class Community {
|
||||
// most recent page first
|
||||
await this.client.waku.store.queryWithOrderedCallback(
|
||||
[
|
||||
createDecoder(this.contentTopic, this.symmetricKey, {
|
||||
clusterId: 16,
|
||||
shard: 32,
|
||||
}),
|
||||
createDecoder(
|
||||
this.contentTopic,
|
||||
{
|
||||
clusterId: 16,
|
||||
shardId: 32,
|
||||
pubsubTopic: '/waku/2/rs/16/32',
|
||||
},
|
||||
this.symmetricKey,
|
||||
),
|
||||
],
|
||||
wakuMessage => {
|
||||
this.client.handleWakuMessage(wakuMessage)
|
||||
@@ -115,10 +120,15 @@ export class Community {
|
||||
private observe = async () => {
|
||||
await this.client.waku.filter.subscribe(
|
||||
[
|
||||
createDecoder(this.contentTopic, this.symmetricKey, {
|
||||
clusterId: 16,
|
||||
shard: 32,
|
||||
}),
|
||||
createDecoder(
|
||||
this.contentTopic,
|
||||
{
|
||||
clusterId: 16,
|
||||
shardId: 32,
|
||||
pubsubTopic: '/waku/2/rs/16/32',
|
||||
},
|
||||
this.symmetricKey,
|
||||
),
|
||||
],
|
||||
this.client.handleWakuMessage,
|
||||
)
|
||||
@@ -139,16 +149,25 @@ export class Community {
|
||||
|
||||
this.chats.set(chatUuid, chat)
|
||||
|
||||
const unobserveFn = await this.client.waku.filter.subscribe(
|
||||
[
|
||||
createDecoder(chat.contentTopic, chat.symmetricKey, {
|
||||
clusterId: 16,
|
||||
shard: 32,
|
||||
}),
|
||||
],
|
||||
const decoder = createDecoder(
|
||||
chat.contentTopic,
|
||||
{
|
||||
clusterId: 16,
|
||||
shardId: 32,
|
||||
pubsubTopic: '/waku/2/rs/16/32',
|
||||
},
|
||||
chat.symmetricKey,
|
||||
)
|
||||
|
||||
await this.client.waku.filter.subscribe(
|
||||
[decoder],
|
||||
this.client.handleWakuMessage,
|
||||
)
|
||||
|
||||
const unobserveFn = () => {
|
||||
this.client.waku.filter.unsubscribe([decoder])
|
||||
}
|
||||
|
||||
this.#chatUnobserveFns.set(chat.contentTopic, unobserveFn)
|
||||
},
|
||||
)
|
||||
@@ -264,12 +283,15 @@ export class Community {
|
||||
}
|
||||
|
||||
public requestToJoin = async (chatId = '') => {
|
||||
const payload = new CommunityRequestToJoin({
|
||||
clock: this.setClock(this.#clock),
|
||||
chatId,
|
||||
communityId: hexToBytes(this.id),
|
||||
ensName: '',
|
||||
}).toBinary()
|
||||
const payload = toBinary(
|
||||
CommunityRequestToJoinSchema,
|
||||
create(CommunityRequestToJoinSchema, {
|
||||
clock: this.setClock(this.#clock),
|
||||
chatId,
|
||||
communityId: new Uint8Array(hexToBytes(this.id)),
|
||||
ensName: '',
|
||||
}),
|
||||
)
|
||||
|
||||
await this.client.sendWakuMessage(
|
||||
ApplicationMetadataMessage_Type.COMMUNITY_REQUEST_TO_JOIN,
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
import { fromBinary } from '@bufbuild/protobuf'
|
||||
import { bytesToHex } from 'ethereum-cryptography/utils'
|
||||
|
||||
import {
|
||||
ApplicationMetadataMessage,
|
||||
ApplicationMetadataMessage_Type,
|
||||
ApplicationMetadataMessageSchema,
|
||||
} from '../../protos/application-metadata-message_pb'
|
||||
import {
|
||||
ChatMessage,
|
||||
DeleteMessage,
|
||||
EditMessage,
|
||||
ChatMessageSchema,
|
||||
DeleteMessageSchema,
|
||||
EditMessageSchema,
|
||||
} from '../../protos/chat-message_pb'
|
||||
import { CommunityDescription } from '../../protos/communities_pb'
|
||||
import { EmojiReaction } from '../../protos/emoji-reaction_pb'
|
||||
import { CommunityDescriptionSchema } from '../../protos/communities_pb'
|
||||
import { EmojiReactionSchema } from '../../protos/emoji-reaction_pb'
|
||||
import { MessageType } from '../../protos/enums_pb'
|
||||
import { PinMessage } from '../../protos/pin-message_pb'
|
||||
import { ProtocolMessage } from '../../protos/protocol-message_pb'
|
||||
import { PinMessageSchema } from '../../protos/pin-message_pb'
|
||||
import { ProtocolMessageSchema } from '../../protos/protocol-message_pb'
|
||||
import { isClockValid } from '../../utils/is-clock-valid'
|
||||
import { payloadToId } from '../../utils/payload-to-id'
|
||||
import { recoverPublicKey } from '../../utils/recover-public-key'
|
||||
@@ -53,14 +54,17 @@ export function handleWakuMessage(
|
||||
let messageToDecode = wakuMessage.payload
|
||||
let decodedProtocol
|
||||
try {
|
||||
decodedProtocol = ProtocolMessage.fromBinary(messageToDecode)
|
||||
decodedProtocol = fromBinary(ProtocolMessageSchema, messageToDecode)
|
||||
if (decodedProtocol) {
|
||||
messageToDecode = decodedProtocol.publicMessage
|
||||
}
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch {}
|
||||
|
||||
const decodedMetadata = ApplicationMetadataMessage.fromBinary(messageToDecode)
|
||||
const decodedMetadata = fromBinary(
|
||||
ApplicationMetadataMessageSchema,
|
||||
messageToDecode,
|
||||
)
|
||||
if (!decodedMetadata.payload) {
|
||||
return
|
||||
}
|
||||
@@ -90,7 +94,10 @@ export function handleWakuMessage(
|
||||
switch (decodedMetadata.type) {
|
||||
case ApplicationMetadataMessage_Type.COMMUNITY_DESCRIPTION: {
|
||||
// decode
|
||||
const decodedPayload = CommunityDescription.fromBinary(messageToDecode)
|
||||
const decodedPayload = fromBinary(
|
||||
CommunityDescriptionSchema,
|
||||
messageToDecode,
|
||||
)
|
||||
|
||||
// validate
|
||||
if (!isClockValid(BigInt(decodedPayload.clock), messageTimestamp)) {
|
||||
@@ -112,7 +119,7 @@ export function handleWakuMessage(
|
||||
|
||||
case ApplicationMetadataMessage_Type.CHAT_MESSAGE: {
|
||||
// decode
|
||||
const decodedPayload = ChatMessage.fromBinary(messageToDecode)
|
||||
const decodedPayload = fromBinary(ChatMessageSchema, messageToDecode)
|
||||
|
||||
if (!isClockValid(BigInt(decodedPayload.clock), messageTimestamp)) {
|
||||
return
|
||||
@@ -156,7 +163,7 @@ export function handleWakuMessage(
|
||||
}
|
||||
|
||||
case ApplicationMetadataMessage_Type.EDIT_MESSAGE: {
|
||||
const decodedPayload = EditMessage.fromBinary(messageToDecode)
|
||||
const decodedPayload = fromBinary(EditMessageSchema, messageToDecode)
|
||||
|
||||
if (!isClockValid(BigInt(decodedPayload.clock), messageTimestamp)) {
|
||||
return
|
||||
@@ -196,7 +203,7 @@ export function handleWakuMessage(
|
||||
}
|
||||
|
||||
case ApplicationMetadataMessage_Type.DELETE_MESSAGE: {
|
||||
const decodedPayload = DeleteMessage.fromBinary(messageToDecode)
|
||||
const decodedPayload = fromBinary(DeleteMessageSchema, messageToDecode)
|
||||
|
||||
if (!isClockValid(BigInt(decodedPayload.clock), messageTimestamp)) {
|
||||
return
|
||||
@@ -235,7 +242,7 @@ export function handleWakuMessage(
|
||||
}
|
||||
|
||||
case ApplicationMetadataMessage_Type.PIN_MESSAGE: {
|
||||
const decodedPayload = PinMessage.fromBinary(messageToDecode)
|
||||
const decodedPayload = fromBinary(PinMessageSchema, messageToDecode)
|
||||
|
||||
if (!isClockValid(BigInt(decodedPayload.clock), messageTimestamp)) {
|
||||
return
|
||||
@@ -274,7 +281,7 @@ export function handleWakuMessage(
|
||||
}
|
||||
|
||||
case ApplicationMetadataMessage_Type.EMOJI_REACTION: {
|
||||
const decodedPayload = EmojiReaction.fromBinary(messageToDecode)
|
||||
const decodedPayload = fromBinary(EmojiReactionSchema, messageToDecode)
|
||||
|
||||
if (!isClockValid(BigInt(decodedPayload.clock), messageTimestamp)) {
|
||||
return
|
||||
|
||||
@@ -10,7 +10,7 @@ export const pbkdf2: PBKDF2 = async (
|
||||
): Promise<Uint8Array> => {
|
||||
const cryptoKey = await window.crypto.subtle.importKey(
|
||||
'raw',
|
||||
password,
|
||||
new Uint8Array(password),
|
||||
{ name: 'PBKDF2' },
|
||||
false,
|
||||
['deriveBits'],
|
||||
@@ -19,7 +19,7 @@ export const pbkdf2: PBKDF2 = async (
|
||||
const derivedKey = await window.crypto.subtle.deriveBits(
|
||||
{
|
||||
name: 'PBKDF2',
|
||||
salt,
|
||||
salt: new Uint8Array(salt),
|
||||
iterations,
|
||||
hash: {
|
||||
name: 'SHA-256',
|
||||
|
||||
@@ -1,95 +1,54 @@
|
||||
// @generated by protoc-gen-es v1.4.2 with parameter "target=ts"
|
||||
// @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
|
||||
// @generated from file application-metadata-message.proto (syntax proto3)
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import type {
|
||||
BinaryReadOptions,
|
||||
FieldList,
|
||||
JsonReadOptions,
|
||||
JsonValue,
|
||||
PartialMessage,
|
||||
PlainMessage,
|
||||
} from '@bufbuild/protobuf'
|
||||
import { Message, proto3 } from '@bufbuild/protobuf'
|
||||
import type { GenEnum, GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2'
|
||||
import { enumDesc, fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2'
|
||||
import type { Message } from '@bufbuild/protobuf'
|
||||
|
||||
/**
|
||||
* Describes the file application-metadata-message.proto.
|
||||
*/
|
||||
export const file_application_metadata_message: GenFile =
|
||||
/*@__PURE__*/
|
||||
fileDesc(
|
||||
'CiJhcHBsaWNhdGlvbi1tZXRhZGF0YS1tZXNzYWdlLnByb3RvIvgUChpBcHBsaWNhdGlvbk1ldGFkYXRhTWVzc2FnZRIRCglzaWduYXR1cmUYASABKAwSDwoHcGF5bG9hZBgCIAEoDBIuCgR0eXBlGAMgASgOMiAuQXBwbGljYXRpb25NZXRhZGF0YU1lc3NhZ2UuVHlwZSKFFAoEVHlwZRILCgdVTktOT1dOEAASEAoMQ0hBVF9NRVNTQUdFEAESEgoOQ09OVEFDVF9VUERBVEUQAhIdChlNRU1CRVJTSElQX1VQREFURV9NRVNTQUdFEAMSGgoWU1lOQ19QQUlSX0lOU1RBTExBVElPThAEEiQKHERFUFJFQ0FURURfU1lOQ19JTlNUQUxMQVRJT04QBRoCCAESIwofUkVRVUVTVF9BRERSRVNTX0ZPUl9UUkFOU0FDVElPThAGEioKJkFDQ0VQVF9SRVFVRVNUX0FERFJFU1NfRk9SX1RSQU5TQUNUSU9OEAcSKwonREVDTElORV9SRVFVRVNUX0FERFJFU1NfRk9SX1RSQU5TQUNUSU9OEAgSFwoTUkVRVUVTVF9UUkFOU0FDVElPThAJEhQKEFNFTkRfVFJBTlNBQ1RJT04QChIfChtERUNMSU5FX1JFUVVFU1RfVFJBTlNBQ1RJT04QCxIgChxTWU5DX0lOU1RBTExBVElPTl9DT05UQUNUX1YyEAwSHQoZU1lOQ19JTlNUQUxMQVRJT05fQUNDT1VOVBANEh4KGkNPTlRBQ1RfQ09ERV9BRFZFUlRJU0VNRU5UEA8SIgoeUFVTSF9OT1RJRklDQVRJT05fUkVHSVNUUkFUSU9OEBASKwonUFVTSF9OT1RJRklDQVRJT05fUkVHSVNUUkFUSU9OX1JFU1BPTlNFEBESGwoXUFVTSF9OT1RJRklDQVRJT05fUVVFUlkQEhIkCiBQVVNIX05PVElGSUNBVElPTl9RVUVSWV9SRVNQT05TRRATEh0KGVBVU0hfTk9USUZJQ0FUSU9OX1JFUVVFU1QQFBIeChpQVVNIX05PVElGSUNBVElPTl9SRVNQT05TRRAVEhIKDkVNT0pJX1JFQUNUSU9OEBYSGQoVR1JPVVBfQ0hBVF9JTlZJVEFUSU9OEBcSEQoNQ0hBVF9JREVOVElUWRAYEhkKFUNPTU1VTklUWV9ERVNDUklQVElPThAZEhwKFENPTU1VTklUWV9JTlZJVEFUSU9OEBoaAggBEh0KGUNPTU1VTklUWV9SRVFVRVNUX1RPX0pPSU4QGxIPCgtQSU5fTUVTU0FHRRAcEhAKDEVESVRfTUVTU0FHRRAdEhEKDVNUQVRVU19VUERBVEUQHhISCg5ERUxFVEVfTUVTU0FHRRAfEh8KG1NZTkNfSU5TVEFMTEFUSU9OX0NPTU1VTklUWRAgEhoKFkFOT05ZTU9VU19NRVRSSUNfQkFUQ0gQIRIVChFTWU5DX0NIQVRfUkVNT1ZFRBAiEhsKF1NZTkNfQ0hBVF9NRVNTQUdFU19SRUFEECMSCgoGQkFDS1VQECQSHQoZU1lOQ19BQ1RJVklUWV9DRU5URVJfUkVBRBAlEiEKHVNZTkNfQUNUSVZJVFlfQ0VOVEVSX0FDQ0VQVEVEECYSIgoeU1lOQ19BQ1RJVklUWV9DRU5URVJfRElTTUlTU0VEECcSEQoNU1lOQ19CT09LTUFSSxAoEhYKElNZTkNfQ0xFQVJfSElTVE9SWRApEhAKDFNZTkNfU0VUVElORxAqEigKJENPTU1VTklUWV9NRVNTQUdFX0FSQ0hJVkVfTUFHTkVUTElOSxArEhkKFVNZTkNfUFJPRklMRV9QSUNUVVJFUxAsEhAKDFNZTkNfQUNDT1VOVBAtEhoKFkFDQ0VQVF9DT05UQUNUX1JFUVVFU1QQLhIbChdSRVRSQUNUX0NPTlRBQ1RfUkVRVUVTVBAvEiYKIkNPTU1VTklUWV9SRVFVRVNUX1RPX0pPSU5fUkVTUE9OU0UQMBIbChdTWU5DX0NPTU1VTklUWV9TRVRUSU5HUxAxEiAKHFJFUVVFU1RfQ09OVEFDVF9WRVJJRklDQVRJT04QMhIfChtBQ0NFUFRfQ09OVEFDVF9WRVJJRklDQVRJT04QMxIgChxERUNMSU5FX0NPTlRBQ1RfVkVSSUZJQ0FUSU9OEDQSFQoRU1lOQ19UUlVTVEVEX1VTRVIQNRIdChlTWU5DX1ZFUklGSUNBVElPTl9SRVFVRVNUEDYSIQodU1lOQ19DT05UQUNUX1JFUVVFU1RfREVDSVNJT04QOBIeChpDT01NVU5JVFlfUkVRVUVTVF9UT19MRUFWRRA5Eh4KGlNZTkNfREVMRVRFX0ZPUl9NRV9NRVNTQUdFEDoSFgoSU1lOQ19TQVZFRF9BRERSRVNTEDsSJAogQ09NTVVOSVRZX0NBTkNFTF9SRVFVRVNUX1RPX0pPSU4QPBIfChtDQU5DRUxfQ09OVEFDVF9WRVJJRklDQVRJT04QPRIQCgxTWU5DX0tFWVBBSVIQPhIVChFTWU5DX1NPQ0lBTF9MSU5LUxA/EhwKGFNZTkNfRU5TX1VTRVJOQU1FX0RFVEFJTBBAEhwKGENPTU1VTklUWV9FVkVOVFNfTUVTU0FHRRBDEiMKH0NPTU1VTklUWV9FRElUX1NIQVJFRF9BRERSRVNTRVMQRBIkCiBTWU5DX0FDQ09VTlRfQ1VTVE9NSVpBVElPTl9DT0xPUhBFEhsKF1NZTkNfQUNDT1VOVFNfUE9TSVRJT05TEEYSJQohQ09NTVVOSVRZX0VWRU5UU19NRVNTQUdFX1JFSkVDVEVEEEcSKgomQ09NTVVOSVRZX1BSSVZJTEVHRURfVVNFUl9TWU5DX01FU1NBR0UQSBIXChNDT01NVU5JVFlfU0hBUkRfS0VZEEkSDQoJU1lOQ19DSEFUEEoSIAocU1lOQ19BQ1RJVklUWV9DRU5URVJfREVMRVRFRBBLEh8KG1NZTkNfQUNUSVZJVFlfQ0VOVEVSX1VOUkVBRBBMEjMKL1NZTkNfQUNUSVZJVFlfQ0VOVEVSX0NPTU1VTklUWV9SRVFVRVNUX0RFQ0lTSU9OEE0SGgoWU1lOQ19UT0tFTl9QUkVGRVJFTkNFUxBOEh8KG0NPTU1VTklUWV9QVUJMSUNfU0hBUkRfSU5GTxBPEiAKHFNZTkNfQ09MTEVDVElCTEVfUFJFRkVSRU5DRVMQUBIZChVDT01NVU5JVFlfVVNFUl9LSUNLRUQQURIlCiFTWU5DX1BST0ZJTEVfU0hPV0NBU0VfUFJFRkVSRU5DRVMQUhIkCiBDT01NVU5JVFlfUFVCTElDX1NUT1JFTk9ERVNfSU5GTxBTEiwKKENPTU1VTklUWV9SRUVWQUxVQVRFX1BFUk1JU1NJT05TX1JFUVVFU1QQVCIECA4QDiIECEEQQSIECEIQQiodU1lOQ19JTlNUQUxMQVRJT05fUFVCTElDX0NIQVQqIlNZTkNfQUNUSVZJVFlfQ0VOVEVSX05PVElGSUNBVElPTlMqJ1NZTkNfQUNUSVZJVFlfQ0VOVEVSX05PVElGSUNBVElPTl9TVEFURWIGcHJvdG8z',
|
||||
)
|
||||
|
||||
/**
|
||||
* @generated from message ApplicationMetadataMessage
|
||||
*/
|
||||
export class ApplicationMetadataMessage extends Message<ApplicationMetadataMessage> {
|
||||
/**
|
||||
* Signature of the payload field
|
||||
*
|
||||
* @generated from field: bytes signature = 1;
|
||||
*/
|
||||
signature = new Uint8Array(0)
|
||||
export type ApplicationMetadataMessage =
|
||||
Message<'ApplicationMetadataMessage'> & {
|
||||
/**
|
||||
* Signature of the payload field
|
||||
*
|
||||
* @generated from field: bytes signature = 1;
|
||||
*/
|
||||
signature: Uint8Array
|
||||
|
||||
/**
|
||||
* This is the encoded protobuf of the application level message, i.e ChatMessage
|
||||
*
|
||||
* @generated from field: bytes payload = 2;
|
||||
*/
|
||||
payload = new Uint8Array(0)
|
||||
/**
|
||||
* This is the encoded protobuf of the application level message, i.e ChatMessage
|
||||
*
|
||||
* @generated from field: bytes payload = 2;
|
||||
*/
|
||||
payload: Uint8Array
|
||||
|
||||
/**
|
||||
* The type of protobuf message sent
|
||||
*
|
||||
* @generated from field: ApplicationMetadataMessage.Type type = 3;
|
||||
*/
|
||||
type = ApplicationMetadataMessage_Type.UNKNOWN
|
||||
|
||||
constructor(data?: PartialMessage<ApplicationMetadataMessage>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
/**
|
||||
* The type of protobuf message sent
|
||||
*
|
||||
* @generated from field: ApplicationMetadataMessage.Type type = 3;
|
||||
*/
|
||||
type: ApplicationMetadataMessage_Type
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'ApplicationMetadataMessage'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'signature', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
{ no: 2, name: 'payload', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
{
|
||||
no: 3,
|
||||
name: 'type',
|
||||
kind: 'enum',
|
||||
T: proto3.getEnumType(ApplicationMetadataMessage_Type),
|
||||
},
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): ApplicationMetadataMessage {
|
||||
return new ApplicationMetadataMessage().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): ApplicationMetadataMessage {
|
||||
return new ApplicationMetadataMessage().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): ApplicationMetadataMessage {
|
||||
return new ApplicationMetadataMessage().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a:
|
||||
| ApplicationMetadataMessage
|
||||
| PlainMessage<ApplicationMetadataMessage>
|
||||
| undefined,
|
||||
b:
|
||||
| ApplicationMetadataMessage
|
||||
| PlainMessage<ApplicationMetadataMessage>
|
||||
| undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(ApplicationMetadataMessage, a, b)
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Describes the message ApplicationMetadataMessage.
|
||||
* Use `create(ApplicationMetadataMessageSchema)` to create a new message.
|
||||
*/
|
||||
export const ApplicationMetadataMessageSchema: GenMessage<ApplicationMetadataMessage> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_application_metadata_message, 0)
|
||||
|
||||
/**
|
||||
* @generated from enum ApplicationMetadataMessage.Type
|
||||
@@ -502,91 +461,10 @@ export enum ApplicationMetadataMessage_Type {
|
||||
*/
|
||||
COMMUNITY_REEVALUATE_PERMISSIONS_REQUEST = 84,
|
||||
}
|
||||
// Retrieve enum metadata with: proto3.getEnumType(ApplicationMetadataMessage_Type)
|
||||
proto3.util.setEnumType(
|
||||
ApplicationMetadataMessage_Type,
|
||||
'ApplicationMetadataMessage.Type',
|
||||
[
|
||||
{ no: 0, name: 'UNKNOWN' },
|
||||
{ no: 1, name: 'CHAT_MESSAGE' },
|
||||
{ no: 2, name: 'CONTACT_UPDATE' },
|
||||
{ no: 3, name: 'MEMBERSHIP_UPDATE_MESSAGE' },
|
||||
{ no: 4, name: 'SYNC_PAIR_INSTALLATION' },
|
||||
{ no: 5, name: 'DEPRECATED_SYNC_INSTALLATION' },
|
||||
{ no: 6, name: 'REQUEST_ADDRESS_FOR_TRANSACTION' },
|
||||
{ no: 7, name: 'ACCEPT_REQUEST_ADDRESS_FOR_TRANSACTION' },
|
||||
{ no: 8, name: 'DECLINE_REQUEST_ADDRESS_FOR_TRANSACTION' },
|
||||
{ no: 9, name: 'REQUEST_TRANSACTION' },
|
||||
{ no: 10, name: 'SEND_TRANSACTION' },
|
||||
{ no: 11, name: 'DECLINE_REQUEST_TRANSACTION' },
|
||||
{ no: 12, name: 'SYNC_INSTALLATION_CONTACT_V2' },
|
||||
{ no: 13, name: 'SYNC_INSTALLATION_ACCOUNT' },
|
||||
{ no: 15, name: 'CONTACT_CODE_ADVERTISEMENT' },
|
||||
{ no: 16, name: 'PUSH_NOTIFICATION_REGISTRATION' },
|
||||
{ no: 17, name: 'PUSH_NOTIFICATION_REGISTRATION_RESPONSE' },
|
||||
{ no: 18, name: 'PUSH_NOTIFICATION_QUERY' },
|
||||
{ no: 19, name: 'PUSH_NOTIFICATION_QUERY_RESPONSE' },
|
||||
{ no: 20, name: 'PUSH_NOTIFICATION_REQUEST' },
|
||||
{ no: 21, name: 'PUSH_NOTIFICATION_RESPONSE' },
|
||||
{ no: 22, name: 'EMOJI_REACTION' },
|
||||
{ no: 23, name: 'GROUP_CHAT_INVITATION' },
|
||||
{ no: 24, name: 'CHAT_IDENTITY' },
|
||||
{ no: 25, name: 'COMMUNITY_DESCRIPTION' },
|
||||
{ no: 26, name: 'COMMUNITY_INVITATION' },
|
||||
{ no: 27, name: 'COMMUNITY_REQUEST_TO_JOIN' },
|
||||
{ no: 28, name: 'PIN_MESSAGE' },
|
||||
{ no: 29, name: 'EDIT_MESSAGE' },
|
||||
{ no: 30, name: 'STATUS_UPDATE' },
|
||||
{ no: 31, name: 'DELETE_MESSAGE' },
|
||||
{ no: 32, name: 'SYNC_INSTALLATION_COMMUNITY' },
|
||||
{ no: 33, name: 'ANONYMOUS_METRIC_BATCH' },
|
||||
{ no: 34, name: 'SYNC_CHAT_REMOVED' },
|
||||
{ no: 35, name: 'SYNC_CHAT_MESSAGES_READ' },
|
||||
{ no: 36, name: 'BACKUP' },
|
||||
{ no: 37, name: 'SYNC_ACTIVITY_CENTER_READ' },
|
||||
{ no: 38, name: 'SYNC_ACTIVITY_CENTER_ACCEPTED' },
|
||||
{ no: 39, name: 'SYNC_ACTIVITY_CENTER_DISMISSED' },
|
||||
{ no: 40, name: 'SYNC_BOOKMARK' },
|
||||
{ no: 41, name: 'SYNC_CLEAR_HISTORY' },
|
||||
{ no: 42, name: 'SYNC_SETTING' },
|
||||
{ no: 43, name: 'COMMUNITY_MESSAGE_ARCHIVE_MAGNETLINK' },
|
||||
{ no: 44, name: 'SYNC_PROFILE_PICTURES' },
|
||||
{ no: 45, name: 'SYNC_ACCOUNT' },
|
||||
{ no: 46, name: 'ACCEPT_CONTACT_REQUEST' },
|
||||
{ no: 47, name: 'RETRACT_CONTACT_REQUEST' },
|
||||
{ no: 48, name: 'COMMUNITY_REQUEST_TO_JOIN_RESPONSE' },
|
||||
{ no: 49, name: 'SYNC_COMMUNITY_SETTINGS' },
|
||||
{ no: 50, name: 'REQUEST_CONTACT_VERIFICATION' },
|
||||
{ no: 51, name: 'ACCEPT_CONTACT_VERIFICATION' },
|
||||
{ no: 52, name: 'DECLINE_CONTACT_VERIFICATION' },
|
||||
{ no: 53, name: 'SYNC_TRUSTED_USER' },
|
||||
{ no: 54, name: 'SYNC_VERIFICATION_REQUEST' },
|
||||
{ no: 56, name: 'SYNC_CONTACT_REQUEST_DECISION' },
|
||||
{ no: 57, name: 'COMMUNITY_REQUEST_TO_LEAVE' },
|
||||
{ no: 58, name: 'SYNC_DELETE_FOR_ME_MESSAGE' },
|
||||
{ no: 59, name: 'SYNC_SAVED_ADDRESS' },
|
||||
{ no: 60, name: 'COMMUNITY_CANCEL_REQUEST_TO_JOIN' },
|
||||
{ no: 61, name: 'CANCEL_CONTACT_VERIFICATION' },
|
||||
{ no: 62, name: 'SYNC_KEYPAIR' },
|
||||
{ no: 63, name: 'SYNC_SOCIAL_LINKS' },
|
||||
{ no: 64, name: 'SYNC_ENS_USERNAME_DETAIL' },
|
||||
{ no: 67, name: 'COMMUNITY_EVENTS_MESSAGE' },
|
||||
{ no: 68, name: 'COMMUNITY_EDIT_SHARED_ADDRESSES' },
|
||||
{ no: 69, name: 'SYNC_ACCOUNT_CUSTOMIZATION_COLOR' },
|
||||
{ no: 70, name: 'SYNC_ACCOUNTS_POSITIONS' },
|
||||
{ no: 71, name: 'COMMUNITY_EVENTS_MESSAGE_REJECTED' },
|
||||
{ no: 72, name: 'COMMUNITY_PRIVILEGED_USER_SYNC_MESSAGE' },
|
||||
{ no: 73, name: 'COMMUNITY_SHARD_KEY' },
|
||||
{ no: 74, name: 'SYNC_CHAT' },
|
||||
{ no: 75, name: 'SYNC_ACTIVITY_CENTER_DELETED' },
|
||||
{ no: 76, name: 'SYNC_ACTIVITY_CENTER_UNREAD' },
|
||||
{ no: 77, name: 'SYNC_ACTIVITY_CENTER_COMMUNITY_REQUEST_DECISION' },
|
||||
{ no: 78, name: 'SYNC_TOKEN_PREFERENCES' },
|
||||
{ no: 79, name: 'COMMUNITY_PUBLIC_SHARD_INFO' },
|
||||
{ no: 80, name: 'SYNC_COLLECTIBLE_PREFERENCES' },
|
||||
{ no: 81, name: 'COMMUNITY_USER_KICKED' },
|
||||
{ no: 82, name: 'SYNC_PROFILE_SHOWCASE_PREFERENCES' },
|
||||
{ no: 83, name: 'COMMUNITY_PUBLIC_STORENODES_INFO' },
|
||||
{ no: 84, name: 'COMMUNITY_REEVALUATE_PERMISSIONS_REQUEST' },
|
||||
]
|
||||
)
|
||||
|
||||
/**
|
||||
* Describes the enum ApplicationMetadataMessage.Type.
|
||||
*/
|
||||
export const ApplicationMetadataMessage_TypeSchema: GenEnum<ApplicationMetadataMessage_Type> =
|
||||
/*@__PURE__*/
|
||||
enumDesc(file_application_metadata_message, 0, 0)
|
||||
|
||||
@@ -1,75 +1,80 @@
|
||||
// @generated by protoc-gen-es v1.4.2 with parameter "target=ts"
|
||||
// @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
|
||||
// @generated from file chat-identity.proto (syntax proto3)
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import type {
|
||||
BinaryReadOptions,
|
||||
FieldList,
|
||||
JsonReadOptions,
|
||||
JsonValue,
|
||||
PartialMessage,
|
||||
PlainMessage,
|
||||
} from '@bufbuild/protobuf'
|
||||
import { Message, proto3, protoInt64 } from '@bufbuild/protobuf'
|
||||
import { ProfileShowcase } from './profile-showcase_pb.js'
|
||||
import { ImageFormat } from './enums_pb.js'
|
||||
import type { GenEnum, GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2'
|
||||
import { enumDesc, fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2'
|
||||
import type { ImageFormat } from './enums_pb'
|
||||
import { file_enums } from './enums_pb'
|
||||
import type { ProfileShowcase } from './profile-showcase_pb'
|
||||
import { file_profile_showcase } from './profile-showcase_pb'
|
||||
import type { Message } from '@bufbuild/protobuf'
|
||||
|
||||
/**
|
||||
* Describes the file chat-identity.proto.
|
||||
*/
|
||||
export const file_chat_identity: GenFile =
|
||||
/*@__PURE__*/
|
||||
fileDesc(
|
||||
'ChNjaGF0LWlkZW50aXR5LnByb3RvItICCgxDaGF0SWRlbnRpdHkSDQoFY2xvY2sYASABKAQSEAoIZW5zX25hbWUYAiABKAkSKQoGaW1hZ2VzGAMgAygLMhkuQ2hhdElkZW50aXR5LkltYWdlc0VudHJ5EhQKDGRpc3BsYXlfbmFtZRgEIAEoCRITCgtkZXNjcmlwdGlvbhgFIAEoCRINCgVjb2xvchgGIAEoCRINCgVlbW9qaRgHIAEoCRIhCgxzb2NpYWxfbGlua3MYCCADKAsyCy5Tb2NpYWxMaW5rEh8KF2ZpcnN0X21lc3NhZ2VfdGltZXN0YW1wGAkgASgNEioKEHByb2ZpbGVfc2hvd2Nhc2UYCiABKAsyEC5Qcm9maWxlU2hvd2Nhc2UaPQoLSW1hZ2VzRW50cnkSCwoDa2V5GAEgASgJEh0KBXZhbHVlGAIgASgLMg4uSWRlbnRpdHlJbWFnZToCOAEi6AEKDUlkZW50aXR5SW1hZ2USDwoHcGF5bG9hZBgBIAEoDBIuCgtzb3VyY2VfdHlwZRgCIAEoDjIZLklkZW50aXR5SW1hZ2UuU291cmNlVHlwZRIiCgxpbWFnZV9mb3JtYXQYAyABKA4yDC5JbWFnZUZvcm1hdBIXCg9lbmNyeXB0aW9uX2tleXMYBCADKAwSEQoJZW5jcnlwdGVkGAUgASgIIkYKClNvdXJjZVR5cGUSFwoTVU5LTk9XTl9TT1VSQ0VfVFlQRRAAEg8KC1JBV19QQVlMT0FEEAESDgoKRU5TX0FWQVRBUhACIicKClNvY2lhbExpbmsSDAoEdGV4dBgBIAEoCRILCgN1cmwYAiABKAliBnByb3RvMw',
|
||||
[file_enums, file_profile_showcase],
|
||||
)
|
||||
|
||||
/**
|
||||
* ChatIdentity represents the user defined identity associated with their public chat key
|
||||
*
|
||||
* @generated from message ChatIdentity
|
||||
*/
|
||||
export class ChatIdentity extends Message<ChatIdentity> {
|
||||
export type ChatIdentity = Message<'ChatIdentity'> & {
|
||||
/**
|
||||
* Lamport timestamp of the message
|
||||
*
|
||||
* @generated from field: uint64 clock = 1;
|
||||
*/
|
||||
clock = protoInt64.zero
|
||||
clock: bigint
|
||||
|
||||
/**
|
||||
* ens_name is the valid ENS name associated with the chat key
|
||||
*
|
||||
* @generated from field: string ens_name = 2;
|
||||
*/
|
||||
ensName = ''
|
||||
ensName: string
|
||||
|
||||
/**
|
||||
* images is a string indexed mapping of images associated with an identity
|
||||
*
|
||||
* @generated from field: map<string, IdentityImage> images = 3;
|
||||
*/
|
||||
images: { [key: string]: IdentityImage } = {}
|
||||
images: { [key: string]: IdentityImage }
|
||||
|
||||
/**
|
||||
* display name is the user set identity
|
||||
*
|
||||
* @generated from field: string display_name = 4;
|
||||
*/
|
||||
displayName = ''
|
||||
displayName: string
|
||||
|
||||
/**
|
||||
* description is the user set description
|
||||
*
|
||||
* @generated from field: string description = 5;
|
||||
*/
|
||||
description = ''
|
||||
description: string
|
||||
|
||||
/**
|
||||
* @generated from field: string color = 6;
|
||||
*/
|
||||
color = ''
|
||||
color: string
|
||||
|
||||
/**
|
||||
* @generated from field: string emoji = 7;
|
||||
*/
|
||||
emoji = ''
|
||||
emoji: string
|
||||
|
||||
/**
|
||||
* @generated from field: repeated SocialLink social_links = 8;
|
||||
*/
|
||||
socialLinks: SocialLink[] = []
|
||||
socialLinks: SocialLink[]
|
||||
|
||||
/**
|
||||
* first known message timestamp in seconds (valid only for community chats for now)
|
||||
@@ -78,191 +83,73 @@ export class ChatIdentity extends Message<ChatIdentity> {
|
||||
*
|
||||
* @generated from field: uint32 first_message_timestamp = 9;
|
||||
*/
|
||||
firstMessageTimestamp = 0
|
||||
firstMessageTimestamp: number
|
||||
|
||||
/**
|
||||
* @generated from field: ProfileShowcase profile_showcase = 10;
|
||||
*/
|
||||
profileShowcase?: ProfileShowcase
|
||||
|
||||
constructor(data?: PartialMessage<ChatIdentity>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'ChatIdentity'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
|
||||
{ no: 2, name: 'ens_name', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{
|
||||
no: 3,
|
||||
name: 'images',
|
||||
kind: 'map',
|
||||
K: 9 /* ScalarType.STRING */,
|
||||
V: { kind: 'message', T: IdentityImage },
|
||||
},
|
||||
{
|
||||
no: 4,
|
||||
name: 'display_name',
|
||||
kind: 'scalar',
|
||||
T: 9 /* ScalarType.STRING */,
|
||||
},
|
||||
{
|
||||
no: 5,
|
||||
name: 'description',
|
||||
kind: 'scalar',
|
||||
T: 9 /* ScalarType.STRING */,
|
||||
},
|
||||
{ no: 6, name: 'color', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{ no: 7, name: 'emoji', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{
|
||||
no: 8,
|
||||
name: 'social_links',
|
||||
kind: 'message',
|
||||
T: SocialLink,
|
||||
repeated: true,
|
||||
},
|
||||
{
|
||||
no: 9,
|
||||
name: 'first_message_timestamp',
|
||||
kind: 'scalar',
|
||||
T: 13 /* ScalarType.UINT32 */,
|
||||
},
|
||||
{ no: 10, name: 'profile_showcase', kind: 'message', T: ProfileShowcase },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): ChatIdentity {
|
||||
return new ChatIdentity().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): ChatIdentity {
|
||||
return new ChatIdentity().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): ChatIdentity {
|
||||
return new ChatIdentity().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: ChatIdentity | PlainMessage<ChatIdentity> | undefined,
|
||||
b: ChatIdentity | PlainMessage<ChatIdentity> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(ChatIdentity, a, b)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message ChatIdentity.
|
||||
* Use `create(ChatIdentitySchema)` to create a new message.
|
||||
*/
|
||||
export const ChatIdentitySchema: GenMessage<ChatIdentity> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_chat_identity, 0)
|
||||
|
||||
/**
|
||||
* ProfileImage represents data associated with a user's profile image
|
||||
*
|
||||
* @generated from message IdentityImage
|
||||
*/
|
||||
export class IdentityImage extends Message<IdentityImage> {
|
||||
export type IdentityImage = Message<'IdentityImage'> & {
|
||||
/**
|
||||
* payload is a context based payload for the profile image data,
|
||||
* context is determined by the `source_type`
|
||||
*
|
||||
* @generated from field: bytes payload = 1;
|
||||
*/
|
||||
payload = new Uint8Array(0)
|
||||
payload: Uint8Array
|
||||
|
||||
/**
|
||||
* source_type signals the image payload source
|
||||
*
|
||||
* @generated from field: IdentityImage.SourceType source_type = 2;
|
||||
*/
|
||||
sourceType = IdentityImage_SourceType.UNKNOWN_SOURCE_TYPE
|
||||
sourceType: IdentityImage_SourceType
|
||||
|
||||
/**
|
||||
* image_format signals the image format and method of parsing the payload
|
||||
*
|
||||
* @generated from field: ImageFormat image_format = 3;
|
||||
*/
|
||||
imageFormat = ImageFormat.UNKNOWN_IMAGE_FORMAT
|
||||
imageFormat: ImageFormat
|
||||
|
||||
/**
|
||||
* encryption_keys is a list of encrypted keys that can be used to decrypted an encrypted payload
|
||||
*
|
||||
* @generated from field: repeated bytes encryption_keys = 4;
|
||||
*/
|
||||
encryptionKeys: Uint8Array[] = []
|
||||
encryptionKeys: Uint8Array[]
|
||||
|
||||
/**
|
||||
* encrypted signals the encryption state of the payload, default is false.
|
||||
*
|
||||
* @generated from field: bool encrypted = 5;
|
||||
*/
|
||||
encrypted = false
|
||||
|
||||
constructor(data?: PartialMessage<IdentityImage>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'IdentityImage'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'payload', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
{
|
||||
no: 2,
|
||||
name: 'source_type',
|
||||
kind: 'enum',
|
||||
T: proto3.getEnumType(IdentityImage_SourceType),
|
||||
},
|
||||
{
|
||||
no: 3,
|
||||
name: 'image_format',
|
||||
kind: 'enum',
|
||||
T: proto3.getEnumType(ImageFormat),
|
||||
},
|
||||
{
|
||||
no: 4,
|
||||
name: 'encryption_keys',
|
||||
kind: 'scalar',
|
||||
T: 12 /* ScalarType.BYTES */,
|
||||
repeated: true,
|
||||
},
|
||||
{ no: 5, name: 'encrypted', kind: 'scalar', T: 8 /* ScalarType.BOOL */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): IdentityImage {
|
||||
return new IdentityImage().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): IdentityImage {
|
||||
return new IdentityImage().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): IdentityImage {
|
||||
return new IdentityImage().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: IdentityImage | PlainMessage<IdentityImage> | undefined,
|
||||
b: IdentityImage | PlainMessage<IdentityImage> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(IdentityImage, a, b)
|
||||
}
|
||||
encrypted: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message IdentityImage.
|
||||
* Use `create(IdentityImageSchema)` to create a new message.
|
||||
*/
|
||||
export const IdentityImageSchema: GenMessage<IdentityImage> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_chat_identity, 1)
|
||||
|
||||
/**
|
||||
* SourceType are the predefined types of image source allowed
|
||||
*
|
||||
@@ -291,66 +178,35 @@ export enum IdentityImage_SourceType {
|
||||
*/
|
||||
ENS_AVATAR = 2,
|
||||
}
|
||||
// Retrieve enum metadata with: proto3.getEnumType(IdentityImage_SourceType)
|
||||
proto3.util.setEnumType(IdentityImage_SourceType, 'IdentityImage.SourceType', [
|
||||
{ no: 0, name: 'UNKNOWN_SOURCE_TYPE' },
|
||||
{ no: 1, name: 'RAW_PAYLOAD' },
|
||||
{ no: 2, name: 'ENS_AVATAR' },
|
||||
])
|
||||
|
||||
/**
|
||||
* Describes the enum IdentityImage.SourceType.
|
||||
*/
|
||||
export const IdentityImage_SourceTypeSchema: GenEnum<IdentityImage_SourceType> =
|
||||
/*@__PURE__*/
|
||||
enumDesc(file_chat_identity, 1, 0)
|
||||
|
||||
/**
|
||||
* SocialLinks represents social link assosiated with given chat identity (personal/community)
|
||||
*
|
||||
* @generated from message SocialLink
|
||||
*/
|
||||
export class SocialLink extends Message<SocialLink> {
|
||||
export type SocialLink = Message<'SocialLink'> & {
|
||||
/**
|
||||
* @generated from field: string text = 1;
|
||||
*/
|
||||
text = ''
|
||||
text: string
|
||||
|
||||
/**
|
||||
* @generated from field: string url = 2;
|
||||
*/
|
||||
url = ''
|
||||
|
||||
constructor(data?: PartialMessage<SocialLink>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'SocialLink'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'text', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{ no: 2, name: 'url', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): SocialLink {
|
||||
return new SocialLink().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): SocialLink {
|
||||
return new SocialLink().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): SocialLink {
|
||||
return new SocialLink().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: SocialLink | PlainMessage<SocialLink> | undefined,
|
||||
b: SocialLink | PlainMessage<SocialLink> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(SocialLink, a, b)
|
||||
}
|
||||
url: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message SocialLink.
|
||||
* Use `create(SocialLinkSchema)` to create a new message.
|
||||
*/
|
||||
export const SocialLinkSchema: GenMessage<SocialLink> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_chat_identity, 2)
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,142 +1,82 @@
|
||||
// @generated by protoc-gen-es v1.4.2 with parameter "target=ts"
|
||||
// @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
|
||||
// @generated from file contact.proto (syntax proto3)
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import type {
|
||||
BinaryReadOptions,
|
||||
FieldList,
|
||||
JsonReadOptions,
|
||||
JsonValue,
|
||||
PartialMessage,
|
||||
PlainMessage,
|
||||
} from '@bufbuild/protobuf'
|
||||
import { Message, proto3, protoInt64 } from '@bufbuild/protobuf'
|
||||
import type { GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2'
|
||||
import { fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2'
|
||||
import type { Message } from '@bufbuild/protobuf'
|
||||
|
||||
/**
|
||||
* Describes the file contact.proto.
|
||||
*/
|
||||
export const file_contact: GenFile =
|
||||
/*@__PURE__*/
|
||||
fileDesc(
|
||||
'Cg1jb250YWN0LnByb3RvInUKHUNvbnRhY3RSZXF1ZXN0UHJvcGFnYXRlZFN0YXRlEhMKC2xvY2FsX2Nsb2NrGAEgASgEEhMKC2xvY2FsX3N0YXRlGAIgASgEEhQKDHJlbW90ZV9jbG9jaxgDIAEoBBIUCgxyZW1vdGVfc3RhdGUYBCABKAQi2gEKDUNvbnRhY3RVcGRhdGUSDQoFY2xvY2sYASABKAQSEAoIZW5zX25hbWUYAiABKAkSFQoNcHJvZmlsZV9pbWFnZRgDIAEoCRIUCgxkaXNwbGF5X25hbWUYBCABKAkSHQoVY29udGFjdF9yZXF1ZXN0X2Nsb2NrGAUgASgEEkgKIGNvbnRhY3RfcmVxdWVzdF9wcm9wYWdhdGVkX3N0YXRlGAYgASgLMh4uQ29udGFjdFJlcXVlc3RQcm9wYWdhdGVkU3RhdGUSEgoKcHVibGljX2tleRgHIAEoCSIxChRBY2NlcHRDb250YWN0UmVxdWVzdBIKCgJpZBgBIAEoCRINCgVjbG9jaxgCIAEoBCIyChVSZXRyYWN0Q29udGFjdFJlcXVlc3QSCgoCaWQYASABKAkSDQoFY2xvY2sYAiABKARiBnByb3RvMw',
|
||||
)
|
||||
|
||||
/**
|
||||
* @generated from message ContactRequestPropagatedState
|
||||
*/
|
||||
export class ContactRequestPropagatedState extends Message<ContactRequestPropagatedState> {
|
||||
/**
|
||||
* @generated from field: uint64 local_clock = 1;
|
||||
*/
|
||||
localClock = protoInt64.zero
|
||||
export type ContactRequestPropagatedState =
|
||||
Message<'ContactRequestPropagatedState'> & {
|
||||
/**
|
||||
* @generated from field: uint64 local_clock = 1;
|
||||
*/
|
||||
localClock: bigint
|
||||
|
||||
/**
|
||||
* @generated from field: uint64 local_state = 2;
|
||||
*/
|
||||
localState = protoInt64.zero
|
||||
/**
|
||||
* @generated from field: uint64 local_state = 2;
|
||||
*/
|
||||
localState: bigint
|
||||
|
||||
/**
|
||||
* @generated from field: uint64 remote_clock = 3;
|
||||
*/
|
||||
remoteClock = protoInt64.zero
|
||||
/**
|
||||
* @generated from field: uint64 remote_clock = 3;
|
||||
*/
|
||||
remoteClock: bigint
|
||||
|
||||
/**
|
||||
* @generated from field: uint64 remote_state = 4;
|
||||
*/
|
||||
remoteState = protoInt64.zero
|
||||
|
||||
constructor(data?: PartialMessage<ContactRequestPropagatedState>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
/**
|
||||
* @generated from field: uint64 remote_state = 4;
|
||||
*/
|
||||
remoteState: bigint
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'ContactRequestPropagatedState'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{
|
||||
no: 1,
|
||||
name: 'local_clock',
|
||||
kind: 'scalar',
|
||||
T: 4 /* ScalarType.UINT64 */,
|
||||
},
|
||||
{
|
||||
no: 2,
|
||||
name: 'local_state',
|
||||
kind: 'scalar',
|
||||
T: 4 /* ScalarType.UINT64 */,
|
||||
},
|
||||
{
|
||||
no: 3,
|
||||
name: 'remote_clock',
|
||||
kind: 'scalar',
|
||||
T: 4 /* ScalarType.UINT64 */,
|
||||
},
|
||||
{
|
||||
no: 4,
|
||||
name: 'remote_state',
|
||||
kind: 'scalar',
|
||||
T: 4 /* ScalarType.UINT64 */,
|
||||
},
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): ContactRequestPropagatedState {
|
||||
return new ContactRequestPropagatedState().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): ContactRequestPropagatedState {
|
||||
return new ContactRequestPropagatedState().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): ContactRequestPropagatedState {
|
||||
return new ContactRequestPropagatedState().fromJsonString(
|
||||
jsonString,
|
||||
options
|
||||
)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a:
|
||||
| ContactRequestPropagatedState
|
||||
| PlainMessage<ContactRequestPropagatedState>
|
||||
| undefined,
|
||||
b:
|
||||
| ContactRequestPropagatedState
|
||||
| PlainMessage<ContactRequestPropagatedState>
|
||||
| undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(ContactRequestPropagatedState, a, b)
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Describes the message ContactRequestPropagatedState.
|
||||
* Use `create(ContactRequestPropagatedStateSchema)` to create a new message.
|
||||
*/
|
||||
export const ContactRequestPropagatedStateSchema: GenMessage<ContactRequestPropagatedState> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_contact, 0)
|
||||
|
||||
/**
|
||||
* @generated from message ContactUpdate
|
||||
*/
|
||||
export class ContactUpdate extends Message<ContactUpdate> {
|
||||
export type ContactUpdate = Message<'ContactUpdate'> & {
|
||||
/**
|
||||
* @generated from field: uint64 clock = 1;
|
||||
*/
|
||||
clock = protoInt64.zero
|
||||
clock: bigint
|
||||
|
||||
/**
|
||||
* @generated from field: string ens_name = 2;
|
||||
*/
|
||||
ensName = ''
|
||||
ensName: string
|
||||
|
||||
/**
|
||||
* @generated from field: string profile_image = 3;
|
||||
*/
|
||||
profileImage = ''
|
||||
profileImage: string
|
||||
|
||||
/**
|
||||
* @generated from field: string display_name = 4;
|
||||
*/
|
||||
displayName = ''
|
||||
displayName: string
|
||||
|
||||
/**
|
||||
* @generated from field: uint64 contact_request_clock = 5;
|
||||
*/
|
||||
contactRequestClock = protoInt64.zero
|
||||
contactRequestClock: bigint
|
||||
|
||||
/**
|
||||
* @generated from field: ContactRequestPropagatedState contact_request_propagated_state = 6;
|
||||
@@ -146,180 +86,59 @@ export class ContactUpdate extends Message<ContactUpdate> {
|
||||
/**
|
||||
* @generated from field: string public_key = 7;
|
||||
*/
|
||||
publicKey = ''
|
||||
|
||||
constructor(data?: PartialMessage<ContactUpdate>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'ContactUpdate'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
|
||||
{ no: 2, name: 'ens_name', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{
|
||||
no: 3,
|
||||
name: 'profile_image',
|
||||
kind: 'scalar',
|
||||
T: 9 /* ScalarType.STRING */,
|
||||
},
|
||||
{
|
||||
no: 4,
|
||||
name: 'display_name',
|
||||
kind: 'scalar',
|
||||
T: 9 /* ScalarType.STRING */,
|
||||
},
|
||||
{
|
||||
no: 5,
|
||||
name: 'contact_request_clock',
|
||||
kind: 'scalar',
|
||||
T: 4 /* ScalarType.UINT64 */,
|
||||
},
|
||||
{
|
||||
no: 6,
|
||||
name: 'contact_request_propagated_state',
|
||||
kind: 'message',
|
||||
T: ContactRequestPropagatedState,
|
||||
},
|
||||
{ no: 7, name: 'public_key', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): ContactUpdate {
|
||||
return new ContactUpdate().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): ContactUpdate {
|
||||
return new ContactUpdate().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): ContactUpdate {
|
||||
return new ContactUpdate().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: ContactUpdate | PlainMessage<ContactUpdate> | undefined,
|
||||
b: ContactUpdate | PlainMessage<ContactUpdate> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(ContactUpdate, a, b)
|
||||
}
|
||||
publicKey: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message ContactUpdate.
|
||||
* Use `create(ContactUpdateSchema)` to create a new message.
|
||||
*/
|
||||
export const ContactUpdateSchema: GenMessage<ContactUpdate> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_contact, 1)
|
||||
|
||||
/**
|
||||
* @generated from message AcceptContactRequest
|
||||
*/
|
||||
export class AcceptContactRequest extends Message<AcceptContactRequest> {
|
||||
export type AcceptContactRequest = Message<'AcceptContactRequest'> & {
|
||||
/**
|
||||
* @generated from field: string id = 1;
|
||||
*/
|
||||
id = ''
|
||||
id: string
|
||||
|
||||
/**
|
||||
* @generated from field: uint64 clock = 2;
|
||||
*/
|
||||
clock = protoInt64.zero
|
||||
|
||||
constructor(data?: PartialMessage<AcceptContactRequest>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'AcceptContactRequest'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{ no: 2, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): AcceptContactRequest {
|
||||
return new AcceptContactRequest().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): AcceptContactRequest {
|
||||
return new AcceptContactRequest().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): AcceptContactRequest {
|
||||
return new AcceptContactRequest().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: AcceptContactRequest | PlainMessage<AcceptContactRequest> | undefined,
|
||||
b: AcceptContactRequest | PlainMessage<AcceptContactRequest> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(AcceptContactRequest, a, b)
|
||||
}
|
||||
clock: bigint
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message AcceptContactRequest.
|
||||
* Use `create(AcceptContactRequestSchema)` to create a new message.
|
||||
*/
|
||||
export const AcceptContactRequestSchema: GenMessage<AcceptContactRequest> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_contact, 2)
|
||||
|
||||
/**
|
||||
* @generated from message RetractContactRequest
|
||||
*/
|
||||
export class RetractContactRequest extends Message<RetractContactRequest> {
|
||||
export type RetractContactRequest = Message<'RetractContactRequest'> & {
|
||||
/**
|
||||
* @generated from field: string id = 1;
|
||||
*/
|
||||
id = ''
|
||||
id: string
|
||||
|
||||
/**
|
||||
* @generated from field: uint64 clock = 2;
|
||||
*/
|
||||
clock = protoInt64.zero
|
||||
|
||||
constructor(data?: PartialMessage<RetractContactRequest>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'RetractContactRequest'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{ no: 2, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): RetractContactRequest {
|
||||
return new RetractContactRequest().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): RetractContactRequest {
|
||||
return new RetractContactRequest().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): RetractContactRequest {
|
||||
return new RetractContactRequest().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: RetractContactRequest | PlainMessage<RetractContactRequest> | undefined,
|
||||
b: RetractContactRequest | PlainMessage<RetractContactRequest> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(RetractContactRequest, a, b)
|
||||
}
|
||||
clock: bigint
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message RetractContactRequest.
|
||||
* Use `create(RetractContactRequestSchema)` to create a new message.
|
||||
*/
|
||||
export const RetractContactRequestSchema: GenMessage<RetractContactRequest> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_contact, 3)
|
||||
|
||||
@@ -1,29 +1,33 @@
|
||||
// @generated by protoc-gen-es v1.4.2 with parameter "target=ts"
|
||||
// @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
|
||||
// @generated from file emoji-reaction.proto (syntax proto3)
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import type {
|
||||
BinaryReadOptions,
|
||||
FieldList,
|
||||
JsonReadOptions,
|
||||
JsonValue,
|
||||
PartialMessage,
|
||||
PlainMessage,
|
||||
} from '@bufbuild/protobuf'
|
||||
import { Message, proto3, protoInt64 } from '@bufbuild/protobuf'
|
||||
import { MessageType } from './enums_pb.js'
|
||||
import type { GenEnum, GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2'
|
||||
import { enumDesc, fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2'
|
||||
import type { MessageType } from './enums_pb'
|
||||
import { file_enums } from './enums_pb'
|
||||
import type { Message } from '@bufbuild/protobuf'
|
||||
|
||||
/**
|
||||
* Describes the file emoji-reaction.proto.
|
||||
*/
|
||||
export const file_emoji_reaction: GenFile =
|
||||
/*@__PURE__*/
|
||||
fileDesc(
|
||||
'ChRlbW9qaS1yZWFjdGlvbi5wcm90byKiAgoNRW1vamlSZWFjdGlvbhINCgVjbG9jaxgBIAEoBBIPCgdjaGF0X2lkGAIgASgJEhIKCm1lc3NhZ2VfaWQYAyABKAkSIgoMbWVzc2FnZV90eXBlGAQgASgOMgwuTWVzc2FnZVR5cGUSIQoEdHlwZRgFIAEoDjITLkVtb2ppUmVhY3Rpb24uVHlwZRIRCglyZXRyYWN0ZWQYBiABKAgSEQoFZ3JhbnQYByABKAxCAhgBInAKBFR5cGUSHwobVU5LTk9XTl9FTU9KSV9SRUFDVElPTl9UWVBFEAASCAoETE9WRRABEg0KCVRIVU1CU19VUBACEg8KC1RIVU1CU19ET1dOEAMSCQoFTEFVR0gQBBIHCgNTQUQQBRIJCgVBTkdSWRAGYgZwcm90bzM',
|
||||
[file_enums],
|
||||
)
|
||||
|
||||
/**
|
||||
* @generated from message EmojiReaction
|
||||
*/
|
||||
export class EmojiReaction extends Message<EmojiReaction> {
|
||||
export type EmojiReaction = Message<'EmojiReaction'> & {
|
||||
/**
|
||||
* clock Lamport timestamp of the chat message
|
||||
*
|
||||
* @generated from field: uint64 clock = 1;
|
||||
*/
|
||||
clock = protoInt64.zero
|
||||
clock: bigint
|
||||
|
||||
/**
|
||||
* chat_id the ID of the chat the message belongs to, for query efficiency the chat_id is stored in the db even though the
|
||||
@@ -31,35 +35,35 @@ export class EmojiReaction extends Message<EmojiReaction> {
|
||||
*
|
||||
* @generated from field: string chat_id = 2;
|
||||
*/
|
||||
chatId = ''
|
||||
chatId: string
|
||||
|
||||
/**
|
||||
* message_id the ID of the target message that the user wishes to react to
|
||||
*
|
||||
* @generated from field: string message_id = 3;
|
||||
*/
|
||||
messageId = ''
|
||||
messageId: string
|
||||
|
||||
/**
|
||||
* message_type is (somewhat confusingly) the ID of the type of chat the message belongs to
|
||||
*
|
||||
* @generated from field: MessageType message_type = 4;
|
||||
*/
|
||||
messageType = MessageType.UNKNOWN_MESSAGE_TYPE
|
||||
messageType: MessageType
|
||||
|
||||
/**
|
||||
* type the ID of the emoji the user wishes to react with
|
||||
*
|
||||
* @generated from field: EmojiReaction.Type type = 5;
|
||||
*/
|
||||
type = EmojiReaction_Type.UNKNOWN_EMOJI_REACTION_TYPE
|
||||
type: EmojiReaction_Type
|
||||
|
||||
/**
|
||||
* whether this is a rectraction of a previously sent emoji
|
||||
*
|
||||
* @generated from field: bool retracted = 6;
|
||||
*/
|
||||
retracted = false
|
||||
retracted: boolean
|
||||
|
||||
/**
|
||||
* Grant for organisation chat messages
|
||||
@@ -67,64 +71,17 @@ export class EmojiReaction extends Message<EmojiReaction> {
|
||||
* @generated from field: bytes grant = 7 [deprecated = true];
|
||||
* @deprecated
|
||||
*/
|
||||
grant = new Uint8Array(0)
|
||||
|
||||
constructor(data?: PartialMessage<EmojiReaction>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'EmojiReaction'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
|
||||
{ no: 2, name: 'chat_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{ no: 3, name: 'message_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{
|
||||
no: 4,
|
||||
name: 'message_type',
|
||||
kind: 'enum',
|
||||
T: proto3.getEnumType(MessageType),
|
||||
},
|
||||
{
|
||||
no: 5,
|
||||
name: 'type',
|
||||
kind: 'enum',
|
||||
T: proto3.getEnumType(EmojiReaction_Type),
|
||||
},
|
||||
{ no: 6, name: 'retracted', kind: 'scalar', T: 8 /* ScalarType.BOOL */ },
|
||||
{ no: 7, name: 'grant', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): EmojiReaction {
|
||||
return new EmojiReaction().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): EmojiReaction {
|
||||
return new EmojiReaction().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): EmojiReaction {
|
||||
return new EmojiReaction().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: EmojiReaction | PlainMessage<EmojiReaction> | undefined,
|
||||
b: EmojiReaction | PlainMessage<EmojiReaction> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(EmojiReaction, a, b)
|
||||
}
|
||||
grant: Uint8Array
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message EmojiReaction.
|
||||
* Use `create(EmojiReactionSchema)` to create a new message.
|
||||
*/
|
||||
export const EmojiReactionSchema: GenMessage<EmojiReaction> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_emoji_reaction, 0)
|
||||
|
||||
/**
|
||||
* @generated from enum EmojiReaction.Type
|
||||
*/
|
||||
@@ -164,13 +121,10 @@ export enum EmojiReaction_Type {
|
||||
*/
|
||||
ANGRY = 6,
|
||||
}
|
||||
// Retrieve enum metadata with: proto3.getEnumType(EmojiReaction_Type)
|
||||
proto3.util.setEnumType(EmojiReaction_Type, 'EmojiReaction.Type', [
|
||||
{ no: 0, name: 'UNKNOWN_EMOJI_REACTION_TYPE' },
|
||||
{ no: 1, name: 'LOVE' },
|
||||
{ no: 2, name: 'THUMBS_UP' },
|
||||
{ no: 3, name: 'THUMBS_DOWN' },
|
||||
{ no: 4, name: 'LAUGH' },
|
||||
{ no: 5, name: 'SAD' },
|
||||
{ no: 6, name: 'ANGRY' },
|
||||
])
|
||||
|
||||
/**
|
||||
* Describes the enum EmojiReaction.Type.
|
||||
*/
|
||||
export const EmojiReaction_TypeSchema: GenEnum<EmojiReaction_Type> =
|
||||
/*@__PURE__*/
|
||||
enumDesc(file_emoji_reaction, 0, 0)
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
// @generated by protoc-gen-es v1.4.2 with parameter "target=ts"
|
||||
// @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
|
||||
// @generated from file enums.proto (syntax proto3)
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { proto3 } from '@bufbuild/protobuf'
|
||||
import type { GenEnum, GenFile } from '@bufbuild/protobuf/codegenv2'
|
||||
import { enumDesc, fileDesc } from '@bufbuild/protobuf/codegenv2'
|
||||
|
||||
/**
|
||||
* Describes the file enums.proto.
|
||||
*/
|
||||
export const file_enums: GenFile =
|
||||
/*@__PURE__*/
|
||||
fileDesc(
|
||||
'CgtlbnVtcy5wcm90byqqAQoLTWVzc2FnZVR5cGUSGAoUVU5LTk9XTl9NRVNTQUdFX1RZUEUQABIOCgpPTkVfVE9fT05FEAESEAoMUFVCTElDX0dST1VQEAISEQoNUFJJVkFURV9HUk9VUBADEiAKHFNZU1RFTV9NRVNTQUdFX1BSSVZBVEVfR1JPVVAQBBISCg5DT01NVU5JVFlfQ0hBVBAFEhYKElNZU1RFTV9NRVNTQUdFX0dBUBAGKk0KC0ltYWdlRm9ybWF0EhgKFFVOS05PV05fSU1BR0VfRk9STUFUEAASBwoDUE5HEAESCAoESlBFRxACEggKBFdFQlAQAxIHCgNHSUYQBCpMChJDb21tdW5pdHlUb2tlblR5cGUSFgoSVU5LTk9XTl9UT0tFTl9UWVBFEAASCQoFRVJDMjAQARIKCgZFUkM3MjEQAhIHCgNFTlMQA2IGcHJvdG8z',
|
||||
)
|
||||
|
||||
/**
|
||||
* @generated from enum MessageType
|
||||
@@ -48,16 +57,13 @@ export enum MessageType {
|
||||
*/
|
||||
SYSTEM_MESSAGE_GAP = 6,
|
||||
}
|
||||
// Retrieve enum metadata with: proto3.getEnumType(MessageType)
|
||||
proto3.util.setEnumType(MessageType, 'MessageType', [
|
||||
{ no: 0, name: 'UNKNOWN_MESSAGE_TYPE' },
|
||||
{ no: 1, name: 'ONE_TO_ONE' },
|
||||
{ no: 2, name: 'PUBLIC_GROUP' },
|
||||
{ no: 3, name: 'PRIVATE_GROUP' },
|
||||
{ no: 4, name: 'SYSTEM_MESSAGE_PRIVATE_GROUP' },
|
||||
{ no: 5, name: 'COMMUNITY_CHAT' },
|
||||
{ no: 6, name: 'SYSTEM_MESSAGE_GAP' },
|
||||
])
|
||||
|
||||
/**
|
||||
* Describes the enum MessageType.
|
||||
*/
|
||||
export const MessageTypeSchema: GenEnum<MessageType> =
|
||||
/*@__PURE__*/
|
||||
enumDesc(file_enums, 0)
|
||||
|
||||
/**
|
||||
* @generated from enum ImageFormat
|
||||
@@ -90,14 +96,13 @@ export enum ImageFormat {
|
||||
*/
|
||||
GIF = 4,
|
||||
}
|
||||
// Retrieve enum metadata with: proto3.getEnumType(ImageFormat)
|
||||
proto3.util.setEnumType(ImageFormat, 'ImageFormat', [
|
||||
{ no: 0, name: 'UNKNOWN_IMAGE_FORMAT' },
|
||||
{ no: 1, name: 'PNG' },
|
||||
{ no: 2, name: 'JPEG' },
|
||||
{ no: 3, name: 'WEBP' },
|
||||
{ no: 4, name: 'GIF' },
|
||||
])
|
||||
|
||||
/**
|
||||
* Describes the enum ImageFormat.
|
||||
*/
|
||||
export const ImageFormatSchema: GenEnum<ImageFormat> =
|
||||
/*@__PURE__*/
|
||||
enumDesc(file_enums, 1)
|
||||
|
||||
/**
|
||||
* @generated from enum CommunityTokenType
|
||||
@@ -123,10 +128,10 @@ export enum CommunityTokenType {
|
||||
*/
|
||||
ENS = 3,
|
||||
}
|
||||
// Retrieve enum metadata with: proto3.getEnumType(CommunityTokenType)
|
||||
proto3.util.setEnumType(CommunityTokenType, 'CommunityTokenType', [
|
||||
{ no: 0, name: 'UNKNOWN_TOKEN_TYPE' },
|
||||
{ no: 1, name: 'ERC20' },
|
||||
{ no: 2, name: 'ERC721' },
|
||||
{ no: 3, name: 'ENS' },
|
||||
])
|
||||
|
||||
/**
|
||||
* Describes the enum CommunityTokenType.
|
||||
*/
|
||||
export const CommunityTokenTypeSchema: GenEnum<CommunityTokenType> =
|
||||
/*@__PURE__*/
|
||||
enumDesc(file_enums, 2)
|
||||
|
||||
@@ -1,122 +1,80 @@
|
||||
// @generated by protoc-gen-es v1.4.2 with parameter "target=ts"
|
||||
// @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
|
||||
// @generated from file membership-update-message.proto (syntax proto3)
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import type {
|
||||
BinaryReadOptions,
|
||||
FieldList,
|
||||
JsonReadOptions,
|
||||
JsonValue,
|
||||
PartialMessage,
|
||||
PlainMessage,
|
||||
} from '@bufbuild/protobuf'
|
||||
import { Message, proto3, protoInt64 } from '@bufbuild/protobuf'
|
||||
import { ChatMessage } from './chat-message_pb.js'
|
||||
import { EmojiReaction } from './emoji-reaction_pb.js'
|
||||
import type { GenEnum, GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2'
|
||||
import { enumDesc, fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2'
|
||||
import type { ChatMessage } from './chat-message_pb'
|
||||
import { file_chat_message } from './chat-message_pb'
|
||||
import type { EmojiReaction } from './emoji-reaction_pb'
|
||||
import { file_emoji_reaction } from './emoji-reaction_pb'
|
||||
import type { Message } from '@bufbuild/protobuf'
|
||||
|
||||
/**
|
||||
* Describes the file membership-update-message.proto.
|
||||
*/
|
||||
export const file_membership_update_message: GenFile =
|
||||
/*@__PURE__*/
|
||||
fileDesc(
|
||||
'Ch9tZW1iZXJzaGlwLXVwZGF0ZS1tZXNzYWdlLnByb3RvItcCChVNZW1iZXJzaGlwVXBkYXRlRXZlbnQSDQoFY2xvY2sYASABKAQSDwoHbWVtYmVycxgCIAMoCRIMCgRuYW1lGAMgASgJEi4KBHR5cGUYBCABKA4yIC5NZW1iZXJzaGlwVXBkYXRlRXZlbnQuRXZlbnRUeXBlEg0KBWNvbG9yGAUgASgJEg0KBWltYWdlGAYgASgMIsEBCglFdmVudFR5cGUSCwoHVU5LTk9XThAAEhAKDENIQVRfQ1JFQVRFRBABEhAKDE5BTUVfQ0hBTkdFRBACEhEKDU1FTUJFUlNfQURERUQQAxIRCg1NRU1CRVJfSk9JTkVEEAQSEgoOTUVNQkVSX1JFTU9WRUQQBRIQCgxBRE1JTlNfQURERUQQBhIRCg1BRE1JTl9SRU1PVkVEEAcSEQoNQ09MT1JfQ0hBTkdFRBAIEhEKDUlNQUdFX0NIQU5HRUQQCSKUAQoXTWVtYmVyc2hpcFVwZGF0ZU1lc3NhZ2USDwoHY2hhdF9pZBgBIAEoCRIOCgZldmVudHMYAiADKAwSHwoHbWVzc2FnZRgDIAEoCzIMLkNoYXRNZXNzYWdlSAASKAoOZW1vamlfcmVhY3Rpb24YBCABKAsyDi5FbW9qaVJlYWN0aW9uSABCDQoLY2hhdF9lbnRpdHliBnByb3RvMw',
|
||||
[file_chat_message, file_emoji_reaction],
|
||||
)
|
||||
|
||||
/**
|
||||
* @generated from message MembershipUpdateEvent
|
||||
*/
|
||||
export class MembershipUpdateEvent extends Message<MembershipUpdateEvent> {
|
||||
export type MembershipUpdateEvent = Message<'MembershipUpdateEvent'> & {
|
||||
/**
|
||||
* Lamport timestamp of the event
|
||||
*
|
||||
* @generated from field: uint64 clock = 1;
|
||||
*/
|
||||
clock = protoInt64.zero
|
||||
clock: bigint
|
||||
|
||||
/**
|
||||
* List of public keys of objects of the action
|
||||
*
|
||||
* @generated from field: repeated string members = 2;
|
||||
*/
|
||||
members: string[] = []
|
||||
members: string[]
|
||||
|
||||
/**
|
||||
* Name of the chat for the CHAT_CREATED/NAME_CHANGED event types
|
||||
*
|
||||
* @generated from field: string name = 3;
|
||||
*/
|
||||
name = ''
|
||||
name: string
|
||||
|
||||
/**
|
||||
* The type of the event
|
||||
*
|
||||
* @generated from field: MembershipUpdateEvent.EventType type = 4;
|
||||
*/
|
||||
type = MembershipUpdateEvent_EventType.UNKNOWN
|
||||
type: MembershipUpdateEvent_EventType
|
||||
|
||||
/**
|
||||
* Color of the chat for the CHAT_CREATED/COLOR_CHANGED event types
|
||||
*
|
||||
* @generated from field: string color = 5;
|
||||
*/
|
||||
color = ''
|
||||
color: string
|
||||
|
||||
/**
|
||||
* Chat image
|
||||
*
|
||||
* @generated from field: bytes image = 6;
|
||||
*/
|
||||
image = new Uint8Array(0)
|
||||
|
||||
constructor(data?: PartialMessage<MembershipUpdateEvent>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'MembershipUpdateEvent'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
|
||||
{
|
||||
no: 2,
|
||||
name: 'members',
|
||||
kind: 'scalar',
|
||||
T: 9 /* ScalarType.STRING */,
|
||||
repeated: true,
|
||||
},
|
||||
{ no: 3, name: 'name', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{
|
||||
no: 4,
|
||||
name: 'type',
|
||||
kind: 'enum',
|
||||
T: proto3.getEnumType(MembershipUpdateEvent_EventType),
|
||||
},
|
||||
{ no: 5, name: 'color', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{ no: 6, name: 'image', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): MembershipUpdateEvent {
|
||||
return new MembershipUpdateEvent().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): MembershipUpdateEvent {
|
||||
return new MembershipUpdateEvent().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): MembershipUpdateEvent {
|
||||
return new MembershipUpdateEvent().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: MembershipUpdateEvent | PlainMessage<MembershipUpdateEvent> | undefined,
|
||||
b: MembershipUpdateEvent | PlainMessage<MembershipUpdateEvent> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(MembershipUpdateEvent, a, b)
|
||||
}
|
||||
image: Uint8Array
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message MembershipUpdateEvent.
|
||||
* Use `create(MembershipUpdateEventSchema)` to create a new message.
|
||||
*/
|
||||
export const MembershipUpdateEventSchema: GenMessage<MembershipUpdateEvent> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_membership_update_message, 0)
|
||||
|
||||
/**
|
||||
* @generated from enum MembershipUpdateEvent.EventType
|
||||
*/
|
||||
@@ -171,23 +129,13 @@ export enum MembershipUpdateEvent_EventType {
|
||||
*/
|
||||
IMAGE_CHANGED = 9,
|
||||
}
|
||||
// Retrieve enum metadata with: proto3.getEnumType(MembershipUpdateEvent_EventType)
|
||||
proto3.util.setEnumType(
|
||||
MembershipUpdateEvent_EventType,
|
||||
'MembershipUpdateEvent.EventType',
|
||||
[
|
||||
{ no: 0, name: 'UNKNOWN' },
|
||||
{ no: 1, name: 'CHAT_CREATED' },
|
||||
{ no: 2, name: 'NAME_CHANGED' },
|
||||
{ no: 3, name: 'MEMBERS_ADDED' },
|
||||
{ no: 4, name: 'MEMBER_JOINED' },
|
||||
{ no: 5, name: 'MEMBER_REMOVED' },
|
||||
{ no: 6, name: 'ADMINS_ADDED' },
|
||||
{ no: 7, name: 'ADMIN_REMOVED' },
|
||||
{ no: 8, name: 'COLOR_CHANGED' },
|
||||
{ no: 9, name: 'IMAGE_CHANGED' },
|
||||
]
|
||||
)
|
||||
|
||||
/**
|
||||
* Describes the enum MembershipUpdateEvent.EventType.
|
||||
*/
|
||||
export const MembershipUpdateEvent_EventTypeSchema: GenEnum<MembershipUpdateEvent_EventType> =
|
||||
/*@__PURE__*/
|
||||
enumDesc(file_membership_update_message, 0, 0)
|
||||
|
||||
/**
|
||||
* MembershipUpdateMessage is a message used to propagate information
|
||||
@@ -196,13 +144,13 @@ proto3.util.setEnumType(
|
||||
*
|
||||
* @generated from message MembershipUpdateMessage
|
||||
*/
|
||||
export class MembershipUpdateMessage extends Message<MembershipUpdateMessage> {
|
||||
export type MembershipUpdateMessage = Message<'MembershipUpdateMessage'> & {
|
||||
/**
|
||||
* The chat id of the private group chat
|
||||
*
|
||||
* @generated from field: string chat_id = 1;
|
||||
*/
|
||||
chatId = ''
|
||||
chatId: string
|
||||
|
||||
/**
|
||||
* A list of events for this group chat, first x bytes are the signature, then is a
|
||||
@@ -210,7 +158,7 @@ export class MembershipUpdateMessage extends Message<MembershipUpdateMessage> {
|
||||
*
|
||||
* @generated from field: repeated bytes events = 2;
|
||||
*/
|
||||
events: Uint8Array[] = []
|
||||
events: Uint8Array[]
|
||||
|
||||
/**
|
||||
* An optional chat message
|
||||
@@ -232,71 +180,13 @@ export class MembershipUpdateMessage extends Message<MembershipUpdateMessage> {
|
||||
value: EmojiReaction
|
||||
case: 'emojiReaction'
|
||||
}
|
||||
| { case: undefined; value?: undefined } = { case: undefined }
|
||||
|
||||
constructor(data?: PartialMessage<MembershipUpdateMessage>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'MembershipUpdateMessage'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'chat_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{
|
||||
no: 2,
|
||||
name: 'events',
|
||||
kind: 'scalar',
|
||||
T: 12 /* ScalarType.BYTES */,
|
||||
repeated: true,
|
||||
},
|
||||
{
|
||||
no: 3,
|
||||
name: 'message',
|
||||
kind: 'message',
|
||||
T: ChatMessage,
|
||||
oneof: 'chat_entity',
|
||||
},
|
||||
{
|
||||
no: 4,
|
||||
name: 'emoji_reaction',
|
||||
kind: 'message',
|
||||
T: EmojiReaction,
|
||||
oneof: 'chat_entity',
|
||||
},
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): MembershipUpdateMessage {
|
||||
return new MembershipUpdateMessage().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): MembershipUpdateMessage {
|
||||
return new MembershipUpdateMessage().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): MembershipUpdateMessage {
|
||||
return new MembershipUpdateMessage().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a:
|
||||
| MembershipUpdateMessage
|
||||
| PlainMessage<MembershipUpdateMessage>
|
||||
| undefined,
|
||||
b:
|
||||
| MembershipUpdateMessage
|
||||
| PlainMessage<MembershipUpdateMessage>
|
||||
| undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(MembershipUpdateMessage, a, b)
|
||||
}
|
||||
| { case: undefined; value?: undefined }
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message MembershipUpdateMessage.
|
||||
* Use `create(MembershipUpdateMessageSchema)` to create a new message.
|
||||
*/
|
||||
export const MembershipUpdateMessageSchema: GenMessage<MembershipUpdateMessage> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_membership_update_message, 1)
|
||||
|
||||
@@ -1,95 +1,59 @@
|
||||
// @generated by protoc-gen-es v1.4.2 with parameter "target=ts"
|
||||
// @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
|
||||
// @generated from file pin-message.proto (syntax proto3)
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import type {
|
||||
BinaryReadOptions,
|
||||
FieldList,
|
||||
JsonReadOptions,
|
||||
JsonValue,
|
||||
PartialMessage,
|
||||
PlainMessage,
|
||||
} from '@bufbuild/protobuf'
|
||||
import { Message, proto3, protoInt64 } from '@bufbuild/protobuf'
|
||||
import { MessageType } from './enums_pb.js'
|
||||
import type { GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2'
|
||||
import { fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2'
|
||||
import type { MessageType } from './enums_pb'
|
||||
import { file_enums } from './enums_pb'
|
||||
import type { Message } from '@bufbuild/protobuf'
|
||||
|
||||
/**
|
||||
* Describes the file pin-message.proto.
|
||||
*/
|
||||
export const file_pin_message: GenFile =
|
||||
/*@__PURE__*/
|
||||
fileDesc(
|
||||
'ChFwaW4tbWVzc2FnZS5wcm90byJ0CgpQaW5NZXNzYWdlEg0KBWNsb2NrGAEgASgEEhIKCm1lc3NhZ2VfaWQYAiABKAkSDwoHY2hhdF9pZBgDIAEoCRIOCgZwaW5uZWQYBCABKAgSIgoMbWVzc2FnZV90eXBlGAUgASgOMgwuTWVzc2FnZVR5cGViBnByb3RvMw',
|
||||
[file_enums],
|
||||
)
|
||||
|
||||
/**
|
||||
* @generated from message PinMessage
|
||||
*/
|
||||
export class PinMessage extends Message<PinMessage> {
|
||||
export type PinMessage = Message<'PinMessage'> & {
|
||||
/**
|
||||
* @generated from field: uint64 clock = 1;
|
||||
*/
|
||||
clock = protoInt64.zero
|
||||
clock: bigint
|
||||
|
||||
/**
|
||||
* @generated from field: string message_id = 2;
|
||||
*/
|
||||
messageId = ''
|
||||
messageId: string
|
||||
|
||||
/**
|
||||
* @generated from field: string chat_id = 3;
|
||||
*/
|
||||
chatId = ''
|
||||
chatId: string
|
||||
|
||||
/**
|
||||
* @generated from field: bool pinned = 4;
|
||||
*/
|
||||
pinned = false
|
||||
pinned: boolean
|
||||
|
||||
/**
|
||||
* The type of message (public/one-to-one/private-group-chat)
|
||||
*
|
||||
* @generated from field: MessageType message_type = 5;
|
||||
*/
|
||||
messageType = MessageType.UNKNOWN_MESSAGE_TYPE
|
||||
|
||||
constructor(data?: PartialMessage<PinMessage>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'PinMessage'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
|
||||
{ no: 2, name: 'message_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{ no: 3, name: 'chat_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{ no: 4, name: 'pinned', kind: 'scalar', T: 8 /* ScalarType.BOOL */ },
|
||||
{
|
||||
no: 5,
|
||||
name: 'message_type',
|
||||
kind: 'enum',
|
||||
T: proto3.getEnumType(MessageType),
|
||||
},
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): PinMessage {
|
||||
return new PinMessage().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): PinMessage {
|
||||
return new PinMessage().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): PinMessage {
|
||||
return new PinMessage().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: PinMessage | PlainMessage<PinMessage> | undefined,
|
||||
b: PinMessage | PlainMessage<PinMessage> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(PinMessage, a, b)
|
||||
}
|
||||
messageType: MessageType
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message PinMessage.
|
||||
* Use `create(PinMessageSchema)` to create a new message.
|
||||
*/
|
||||
export const PinMessageSchema: GenMessage<PinMessage> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_pin_message, 0)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,176 +1,95 @@
|
||||
// @generated by protoc-gen-es v1.4.2 with parameter "target=ts"
|
||||
// @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
|
||||
// @generated from file protocol-message.proto (syntax proto3)
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import type {
|
||||
BinaryReadOptions,
|
||||
FieldList,
|
||||
JsonReadOptions,
|
||||
JsonValue,
|
||||
PartialMessage,
|
||||
PlainMessage,
|
||||
} from '@bufbuild/protobuf'
|
||||
import { Message, proto3, protoInt64 } from '@bufbuild/protobuf'
|
||||
import type { GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2'
|
||||
import { fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2'
|
||||
import type { Message } from '@bufbuild/protobuf'
|
||||
|
||||
/**
|
||||
* Describes the file protocol-message.proto.
|
||||
*/
|
||||
export const file_protocol_message: GenFile =
|
||||
/*@__PURE__*/
|
||||
fileDesc(
|
||||
'ChZwcm90b2NvbC1tZXNzYWdlLnByb3RvIlEKDFNpZ25lZFByZUtleRIWCg5zaWduZWRfcHJlX2tleRgBIAEoDBIPCgd2ZXJzaW9uGAIgASgNEhgKEHByb3RvY29sX3ZlcnNpb24YAyABKA0iugEKBkJ1bmRsZRIQCghpZGVudGl0eRgBIAEoDBIzCg9zaWduZWRfcHJlX2tleXMYAiADKAsyGi5CdW5kbGUuU2lnbmVkUHJlS2V5c0VudHJ5EhEKCXNpZ25hdHVyZRgEIAEoDBIRCgl0aW1lc3RhbXAYBSABKAMaQwoSU2lnbmVkUHJlS2V5c0VudHJ5EgsKA2tleRgBIAEoCRIcCgV2YWx1ZRgCIAEoCzINLlNpZ25lZFByZUtleToCOAEiUAoPQnVuZGxlQ29udGFpbmVyEhcKBmJ1bmRsZRgBIAEoCzIHLkJ1bmRsZRIeChZwcml2YXRlX3NpZ25lZF9wcmVfa2V5GAIgASgMSgQIAxAEIjoKCERSSGVhZGVyEgsKA2tleRgBIAEoDBIJCgFuGAIgASgNEgoKAnBuGAMgASgNEgoKAmlkGAQgASgMIhcKCERISGVhZGVyEgsKA2tleRgBIAEoDCIrCgpYM0RISGVhZGVyEgsKA2tleRgBIAEoDBIKCgJpZBgEIAEoDEoECAMQBCJuCghIUkhlYWRlchIZChFkZXByZWNhdGVkX2tleV9pZBgBIAEoDRIOCgZzZXFfbm8YAiABKA0SEAoIZ3JvdXBfaWQYAyABKAwSDgoGa2V5X2lkGAQgASgMEhUKBGtleXMYBSABKAsyBy5IUktleXMicQoKUmVrZXlHcm91cBIRCgl0aW1lc3RhbXAYAiABKAQSIwoEa2V5cxgEIAMoCzIVLlJla2V5R3JvdXAuS2V5c0VudHJ5GisKCUtleXNFbnRyeRILCgNrZXkYASABKA0SDQoFdmFsdWUYAiABKAw6AjgBIkAKBkhSS2V5cxIUCgRrZXlzGAEgAygLMgYuSFJLZXkSIAoLcmVrZXlfZ3JvdXAYAiABKAsyCy5SZWtleUdyb3VwIkIKBUhSS2V5EhkKEWRlcHJlY2F0ZWRfa2V5X2lkGAEgASgNEgsKA2tleRgCIAEoDBIRCgl0aW1lc3RhbXAYAyABKAQipwEKGEVuY3J5cHRlZE1lc3NhZ2VQcm90b2NvbBIgCgtYM0RIX2hlYWRlchgBIAEoCzILLlgzREhIZWFkZXISHAoJRFJfaGVhZGVyGAIgASgLMgkuRFJIZWFkZXISHAoJREhfaGVhZGVyGGUgASgLMgkuREhIZWFkZXISHAoJSFJfaGVhZGVyGGYgASgLMgkuSFJIZWFkZXISDwoHcGF5bG9hZBgDIAEoDCLzAQoPUHJvdG9jb2xNZXNzYWdlEhcKD2luc3RhbGxhdGlvbl9pZBgCIAEoCRIYCgdidW5kbGVzGAMgAygLMgcuQnVuZGxlEkEKEWVuY3J5cHRlZF9tZXNzYWdlGGUgAygLMiYuUHJvdG9jb2xNZXNzYWdlLkVuY3J5cHRlZE1lc3NhZ2VFbnRyeRIWCg5wdWJsaWNfbWVzc2FnZRhmIAEoDBpSChVFbmNyeXB0ZWRNZXNzYWdlRW50cnkSCwoDa2V5GAEgASgJEigKBXZhbHVlGAIgASgLMhkuRW5jcnlwdGVkTWVzc2FnZVByb3RvY29sOgI4AWIGcHJvdG8z',
|
||||
)
|
||||
|
||||
/**
|
||||
* @generated from message SignedPreKey
|
||||
*/
|
||||
export class SignedPreKey extends Message<SignedPreKey> {
|
||||
export type SignedPreKey = Message<'SignedPreKey'> & {
|
||||
/**
|
||||
* @generated from field: bytes signed_pre_key = 1;
|
||||
*/
|
||||
signedPreKey = new Uint8Array(0)
|
||||
signedPreKey: Uint8Array
|
||||
|
||||
/**
|
||||
* @generated from field: uint32 version = 2;
|
||||
*/
|
||||
version = 0
|
||||
version: number
|
||||
|
||||
/**
|
||||
* @generated from field: uint32 protocol_version = 3;
|
||||
*/
|
||||
protocolVersion = 0
|
||||
|
||||
constructor(data?: PartialMessage<SignedPreKey>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'SignedPreKey'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{
|
||||
no: 1,
|
||||
name: 'signed_pre_key',
|
||||
kind: 'scalar',
|
||||
T: 12 /* ScalarType.BYTES */,
|
||||
},
|
||||
{ no: 2, name: 'version', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ },
|
||||
{
|
||||
no: 3,
|
||||
name: 'protocol_version',
|
||||
kind: 'scalar',
|
||||
T: 13 /* ScalarType.UINT32 */,
|
||||
},
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): SignedPreKey {
|
||||
return new SignedPreKey().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): SignedPreKey {
|
||||
return new SignedPreKey().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): SignedPreKey {
|
||||
return new SignedPreKey().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: SignedPreKey | PlainMessage<SignedPreKey> | undefined,
|
||||
b: SignedPreKey | PlainMessage<SignedPreKey> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(SignedPreKey, a, b)
|
||||
}
|
||||
protocolVersion: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message SignedPreKey.
|
||||
* Use `create(SignedPreKeySchema)` to create a new message.
|
||||
*/
|
||||
export const SignedPreKeySchema: GenMessage<SignedPreKey> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_protocol_message, 0)
|
||||
|
||||
/**
|
||||
* X3DH prekey bundle
|
||||
*
|
||||
* @generated from message Bundle
|
||||
*/
|
||||
export class Bundle extends Message<Bundle> {
|
||||
export type Bundle = Message<'Bundle'> & {
|
||||
/**
|
||||
* Identity key
|
||||
*
|
||||
* @generated from field: bytes identity = 1;
|
||||
*/
|
||||
identity = new Uint8Array(0)
|
||||
identity: Uint8Array
|
||||
|
||||
/**
|
||||
* Installation id
|
||||
*
|
||||
* @generated from field: map<string, SignedPreKey> signed_pre_keys = 2;
|
||||
*/
|
||||
signedPreKeys: { [key: string]: SignedPreKey } = {}
|
||||
signedPreKeys: { [key: string]: SignedPreKey }
|
||||
|
||||
/**
|
||||
* Prekey signature
|
||||
*
|
||||
* @generated from field: bytes signature = 4;
|
||||
*/
|
||||
signature = new Uint8Array(0)
|
||||
signature: Uint8Array
|
||||
|
||||
/**
|
||||
* When the bundle was created locally
|
||||
*
|
||||
* @generated from field: int64 timestamp = 5;
|
||||
*/
|
||||
timestamp = protoInt64.zero
|
||||
|
||||
constructor(data?: PartialMessage<Bundle>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'Bundle'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'identity', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
{
|
||||
no: 2,
|
||||
name: 'signed_pre_keys',
|
||||
kind: 'map',
|
||||
K: 9 /* ScalarType.STRING */,
|
||||
V: { kind: 'message', T: SignedPreKey },
|
||||
},
|
||||
{ no: 4, name: 'signature', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
{ no: 5, name: 'timestamp', kind: 'scalar', T: 3 /* ScalarType.INT64 */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): Bundle {
|
||||
return new Bundle().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): Bundle {
|
||||
return new Bundle().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): Bundle {
|
||||
return new Bundle().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: Bundle | PlainMessage<Bundle> | undefined,
|
||||
b: Bundle | PlainMessage<Bundle> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(Bundle, a, b)
|
||||
}
|
||||
timestamp: bigint
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message Bundle.
|
||||
* Use `create(BundleSchema)` to create a new message.
|
||||
*/
|
||||
export const BundleSchema: GenMessage<Bundle> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_protocol_message, 1)
|
||||
|
||||
/**
|
||||
* @generated from message BundleContainer
|
||||
*/
|
||||
export class BundleContainer extends Message<BundleContainer> {
|
||||
export type BundleContainer = Message<'BundleContainer'> & {
|
||||
/**
|
||||
* X3DH prekey bundle
|
||||
*
|
||||
@@ -183,515 +102,233 @@ export class BundleContainer extends Message<BundleContainer> {
|
||||
*
|
||||
* @generated from field: bytes private_signed_pre_key = 2;
|
||||
*/
|
||||
privateSignedPreKey = new Uint8Array(0)
|
||||
|
||||
constructor(data?: PartialMessage<BundleContainer>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'BundleContainer'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'bundle', kind: 'message', T: Bundle },
|
||||
{
|
||||
no: 2,
|
||||
name: 'private_signed_pre_key',
|
||||
kind: 'scalar',
|
||||
T: 12 /* ScalarType.BYTES */,
|
||||
},
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): BundleContainer {
|
||||
return new BundleContainer().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): BundleContainer {
|
||||
return new BundleContainer().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): BundleContainer {
|
||||
return new BundleContainer().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: BundleContainer | PlainMessage<BundleContainer> | undefined,
|
||||
b: BundleContainer | PlainMessage<BundleContainer> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(BundleContainer, a, b)
|
||||
}
|
||||
privateSignedPreKey: Uint8Array
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message BundleContainer.
|
||||
* Use `create(BundleContainerSchema)` to create a new message.
|
||||
*/
|
||||
export const BundleContainerSchema: GenMessage<BundleContainer> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_protocol_message, 2)
|
||||
|
||||
/**
|
||||
* @generated from message DRHeader
|
||||
*/
|
||||
export class DRHeader extends Message<DRHeader> {
|
||||
export type DRHeader = Message<'DRHeader'> & {
|
||||
/**
|
||||
* Current ratchet public key
|
||||
*
|
||||
* @generated from field: bytes key = 1;
|
||||
*/
|
||||
key = new Uint8Array(0)
|
||||
key: Uint8Array
|
||||
|
||||
/**
|
||||
* Number of the message in the sending chain
|
||||
*
|
||||
* @generated from field: uint32 n = 2;
|
||||
*/
|
||||
n = 0
|
||||
n: number
|
||||
|
||||
/**
|
||||
* Length of the previous sending chain
|
||||
*
|
||||
* @generated from field: uint32 pn = 3;
|
||||
*/
|
||||
pn = 0
|
||||
pn: number
|
||||
|
||||
/**
|
||||
* Bundle ID
|
||||
*
|
||||
* @generated from field: bytes id = 4;
|
||||
*/
|
||||
id = new Uint8Array(0)
|
||||
|
||||
constructor(data?: PartialMessage<DRHeader>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'DRHeader'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
{ no: 2, name: 'n', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ },
|
||||
{ no: 3, name: 'pn', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ },
|
||||
{ no: 4, name: 'id', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): DRHeader {
|
||||
return new DRHeader().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): DRHeader {
|
||||
return new DRHeader().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): DRHeader {
|
||||
return new DRHeader().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: DRHeader | PlainMessage<DRHeader> | undefined,
|
||||
b: DRHeader | PlainMessage<DRHeader> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(DRHeader, a, b)
|
||||
}
|
||||
id: Uint8Array
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message DRHeader.
|
||||
* Use `create(DRHeaderSchema)` to create a new message.
|
||||
*/
|
||||
export const DRHeaderSchema: GenMessage<DRHeader> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_protocol_message, 3)
|
||||
|
||||
/**
|
||||
* @generated from message DHHeader
|
||||
*/
|
||||
export class DHHeader extends Message<DHHeader> {
|
||||
export type DHHeader = Message<'DHHeader'> & {
|
||||
/**
|
||||
* Compressed ephemeral public key
|
||||
*
|
||||
* @generated from field: bytes key = 1;
|
||||
*/
|
||||
key = new Uint8Array(0)
|
||||
|
||||
constructor(data?: PartialMessage<DHHeader>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'DHHeader'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): DHHeader {
|
||||
return new DHHeader().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): DHHeader {
|
||||
return new DHHeader().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): DHHeader {
|
||||
return new DHHeader().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: DHHeader | PlainMessage<DHHeader> | undefined,
|
||||
b: DHHeader | PlainMessage<DHHeader> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(DHHeader, a, b)
|
||||
}
|
||||
key: Uint8Array
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message DHHeader.
|
||||
* Use `create(DHHeaderSchema)` to create a new message.
|
||||
*/
|
||||
export const DHHeaderSchema: GenMessage<DHHeader> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_protocol_message, 4)
|
||||
|
||||
/**
|
||||
* @generated from message X3DHHeader
|
||||
*/
|
||||
export class X3DHHeader extends Message<X3DHHeader> {
|
||||
export type X3DHHeader = Message<'X3DHHeader'> & {
|
||||
/**
|
||||
* Ephemeral key used
|
||||
*
|
||||
* @generated from field: bytes key = 1;
|
||||
*/
|
||||
key = new Uint8Array(0)
|
||||
key: Uint8Array
|
||||
|
||||
/**
|
||||
* Used bundle's signed prekey
|
||||
*
|
||||
* @generated from field: bytes id = 4;
|
||||
*/
|
||||
id = new Uint8Array(0)
|
||||
|
||||
constructor(data?: PartialMessage<X3DHHeader>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'X3DHHeader'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
{ no: 4, name: 'id', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): X3DHHeader {
|
||||
return new X3DHHeader().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): X3DHHeader {
|
||||
return new X3DHHeader().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): X3DHHeader {
|
||||
return new X3DHHeader().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: X3DHHeader | PlainMessage<X3DHHeader> | undefined,
|
||||
b: X3DHHeader | PlainMessage<X3DHHeader> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(X3DHHeader, a, b)
|
||||
}
|
||||
id: Uint8Array
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message X3DHHeader.
|
||||
* Use `create(X3DHHeaderSchema)` to create a new message.
|
||||
*/
|
||||
export const X3DHHeaderSchema: GenMessage<X3DHHeader> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_protocol_message, 5)
|
||||
|
||||
/**
|
||||
* Hash Ratchet Header
|
||||
*
|
||||
* @generated from message HRHeader
|
||||
*/
|
||||
export class HRHeader extends Message<HRHeader> {
|
||||
export type HRHeader = Message<'HRHeader'> & {
|
||||
/**
|
||||
* deprecated group key ID
|
||||
*
|
||||
* @generated from field: uint32 deprecated_key_id = 1;
|
||||
*/
|
||||
deprecatedKeyId = 0
|
||||
deprecatedKeyId: number
|
||||
|
||||
/**
|
||||
* group message number for this key_id
|
||||
*
|
||||
* @generated from field: uint32 seq_no = 2;
|
||||
*/
|
||||
seqNo = 0
|
||||
seqNo: number
|
||||
|
||||
/**
|
||||
* group ID
|
||||
*
|
||||
* @generated from field: bytes group_id = 3;
|
||||
*/
|
||||
groupId = new Uint8Array(0)
|
||||
groupId: Uint8Array
|
||||
|
||||
/**
|
||||
* group key ID
|
||||
*
|
||||
* @generated from field: bytes key_id = 4;
|
||||
*/
|
||||
keyId = new Uint8Array(0)
|
||||
keyId: Uint8Array
|
||||
|
||||
/**
|
||||
* @generated from field: HRKeys keys = 5;
|
||||
*/
|
||||
keys?: HRKeys
|
||||
|
||||
constructor(data?: PartialMessage<HRHeader>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'HRHeader'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{
|
||||
no: 1,
|
||||
name: 'deprecated_key_id',
|
||||
kind: 'scalar',
|
||||
T: 13 /* ScalarType.UINT32 */,
|
||||
},
|
||||
{ no: 2, name: 'seq_no', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ },
|
||||
{ no: 3, name: 'group_id', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
{ no: 4, name: 'key_id', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
{ no: 5, name: 'keys', kind: 'message', T: HRKeys },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): HRHeader {
|
||||
return new HRHeader().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): HRHeader {
|
||||
return new HRHeader().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): HRHeader {
|
||||
return new HRHeader().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: HRHeader | PlainMessage<HRHeader> | undefined,
|
||||
b: HRHeader | PlainMessage<HRHeader> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(HRHeader, a, b)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message HRHeader.
|
||||
* Use `create(HRHeaderSchema)` to create a new message.
|
||||
*/
|
||||
export const HRHeaderSchema: GenMessage<HRHeader> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_protocol_message, 6)
|
||||
|
||||
/**
|
||||
* @generated from message RekeyGroup
|
||||
*/
|
||||
export class RekeyGroup extends Message<RekeyGroup> {
|
||||
export type RekeyGroup = Message<'RekeyGroup'> & {
|
||||
/**
|
||||
* @generated from field: uint64 timestamp = 2;
|
||||
*/
|
||||
timestamp = protoInt64.zero
|
||||
timestamp: bigint
|
||||
|
||||
/**
|
||||
* @generated from field: map<uint32, bytes> keys = 4;
|
||||
*/
|
||||
keys: { [key: number]: Uint8Array } = {}
|
||||
|
||||
constructor(data?: PartialMessage<RekeyGroup>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'RekeyGroup'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 2, name: 'timestamp', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
|
||||
{
|
||||
no: 4,
|
||||
name: 'keys',
|
||||
kind: 'map',
|
||||
K: 13 /* ScalarType.UINT32 */,
|
||||
V: { kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
},
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): RekeyGroup {
|
||||
return new RekeyGroup().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): RekeyGroup {
|
||||
return new RekeyGroup().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): RekeyGroup {
|
||||
return new RekeyGroup().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: RekeyGroup | PlainMessage<RekeyGroup> | undefined,
|
||||
b: RekeyGroup | PlainMessage<RekeyGroup> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(RekeyGroup, a, b)
|
||||
}
|
||||
keys: { [key: number]: Uint8Array }
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message RekeyGroup.
|
||||
* Use `create(RekeyGroupSchema)` to create a new message.
|
||||
*/
|
||||
export const RekeyGroupSchema: GenMessage<RekeyGroup> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_protocol_message, 7)
|
||||
|
||||
/**
|
||||
* @generated from message HRKeys
|
||||
*/
|
||||
export class HRKeys extends Message<HRKeys> {
|
||||
export type HRKeys = Message<'HRKeys'> & {
|
||||
/**
|
||||
* @generated from field: repeated HRKey keys = 1;
|
||||
*/
|
||||
keys: HRKey[] = []
|
||||
keys: HRKey[]
|
||||
|
||||
/**
|
||||
* @generated from field: RekeyGroup rekey_group = 2;
|
||||
*/
|
||||
rekeyGroup?: RekeyGroup
|
||||
|
||||
constructor(data?: PartialMessage<HRKeys>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'HRKeys'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'keys', kind: 'message', T: HRKey, repeated: true },
|
||||
{ no: 2, name: 'rekey_group', kind: 'message', T: RekeyGroup },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): HRKeys {
|
||||
return new HRKeys().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): HRKeys {
|
||||
return new HRKeys().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): HRKeys {
|
||||
return new HRKeys().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: HRKeys | PlainMessage<HRKeys> | undefined,
|
||||
b: HRKeys | PlainMessage<HRKeys> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(HRKeys, a, b)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message HRKeys.
|
||||
* Use `create(HRKeysSchema)` to create a new message.
|
||||
*/
|
||||
export const HRKeysSchema: GenMessage<HRKeys> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_protocol_message, 8)
|
||||
|
||||
/**
|
||||
* @generated from message HRKey
|
||||
*/
|
||||
export class HRKey extends Message<HRKey> {
|
||||
export type HRKey = Message<'HRKey'> & {
|
||||
/**
|
||||
* @generated from field: uint32 deprecated_key_id = 1;
|
||||
*/
|
||||
deprecatedKeyId = 0
|
||||
deprecatedKeyId: number
|
||||
|
||||
/**
|
||||
* @generated from field: bytes key = 2;
|
||||
*/
|
||||
key = new Uint8Array(0)
|
||||
key: Uint8Array
|
||||
|
||||
/**
|
||||
* @generated from field: uint64 timestamp = 3;
|
||||
*/
|
||||
timestamp = protoInt64.zero
|
||||
|
||||
constructor(data?: PartialMessage<HRKey>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'HRKey'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{
|
||||
no: 1,
|
||||
name: 'deprecated_key_id',
|
||||
kind: 'scalar',
|
||||
T: 13 /* ScalarType.UINT32 */,
|
||||
},
|
||||
{ no: 2, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
{ no: 3, name: 'timestamp', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): HRKey {
|
||||
return new HRKey().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): HRKey {
|
||||
return new HRKey().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): HRKey {
|
||||
return new HRKey().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: HRKey | PlainMessage<HRKey> | undefined,
|
||||
b: HRKey | PlainMessage<HRKey> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(HRKey, a, b)
|
||||
}
|
||||
timestamp: bigint
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message HRKey.
|
||||
* Use `create(HRKeySchema)` to create a new message.
|
||||
*/
|
||||
export const HRKeySchema: GenMessage<HRKey> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_protocol_message, 9)
|
||||
|
||||
/**
|
||||
* Direct message value
|
||||
*
|
||||
* @generated from message EncryptedMessageProtocol
|
||||
*/
|
||||
export class EncryptedMessageProtocol extends Message<EncryptedMessageProtocol> {
|
||||
export type EncryptedMessageProtocol = Message<'EncryptedMessageProtocol'> & {
|
||||
/**
|
||||
* @generated from field: X3DHHeader X3DH_header = 1;
|
||||
*/
|
||||
@@ -717,77 +354,36 @@ export class EncryptedMessageProtocol extends Message<EncryptedMessageProtocol>
|
||||
*
|
||||
* @generated from field: bytes payload = 3;
|
||||
*/
|
||||
payload = new Uint8Array(0)
|
||||
|
||||
constructor(data?: PartialMessage<EncryptedMessageProtocol>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'EncryptedMessageProtocol'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'X3DH_header', kind: 'message', T: X3DHHeader },
|
||||
{ no: 2, name: 'DR_header', kind: 'message', T: DRHeader },
|
||||
{ no: 101, name: 'DH_header', kind: 'message', T: DHHeader },
|
||||
{ no: 102, name: 'HR_header', kind: 'message', T: HRHeader },
|
||||
{ no: 3, name: 'payload', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): EncryptedMessageProtocol {
|
||||
return new EncryptedMessageProtocol().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): EncryptedMessageProtocol {
|
||||
return new EncryptedMessageProtocol().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): EncryptedMessageProtocol {
|
||||
return new EncryptedMessageProtocol().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a:
|
||||
| EncryptedMessageProtocol
|
||||
| PlainMessage<EncryptedMessageProtocol>
|
||||
| undefined,
|
||||
b:
|
||||
| EncryptedMessageProtocol
|
||||
| PlainMessage<EncryptedMessageProtocol>
|
||||
| undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(EncryptedMessageProtocol, a, b)
|
||||
}
|
||||
payload: Uint8Array
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message EncryptedMessageProtocol.
|
||||
* Use `create(EncryptedMessageProtocolSchema)` to create a new message.
|
||||
*/
|
||||
export const EncryptedMessageProtocolSchema: GenMessage<EncryptedMessageProtocol> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_protocol_message, 10)
|
||||
|
||||
/**
|
||||
* Top-level protocol message
|
||||
*
|
||||
* @generated from message ProtocolMessage
|
||||
*/
|
||||
export class ProtocolMessage extends Message<ProtocolMessage> {
|
||||
export type ProtocolMessage = Message<'ProtocolMessage'> & {
|
||||
/**
|
||||
* The device id of the sender
|
||||
*
|
||||
* @generated from field: string installation_id = 2;
|
||||
*/
|
||||
installationId = ''
|
||||
installationId: string
|
||||
|
||||
/**
|
||||
* List of bundles
|
||||
*
|
||||
* @generated from field: repeated Bundle bundles = 3;
|
||||
*/
|
||||
bundles: Bundle[] = []
|
||||
bundles: Bundle[]
|
||||
|
||||
/**
|
||||
* One to one message, encrypted, indexed by installation_id
|
||||
@@ -795,70 +391,20 @@ export class ProtocolMessage extends Message<ProtocolMessage> {
|
||||
*
|
||||
* @generated from field: map<string, EncryptedMessageProtocol> encrypted_message = 101;
|
||||
*/
|
||||
encryptedMessage: { [key: string]: EncryptedMessageProtocol } = {}
|
||||
encryptedMessage: { [key: string]: EncryptedMessageProtocol }
|
||||
|
||||
/**
|
||||
* Public chats, not encrypted
|
||||
*
|
||||
* @generated from field: bytes public_message = 102;
|
||||
*/
|
||||
publicMessage = new Uint8Array(0)
|
||||
|
||||
constructor(data?: PartialMessage<ProtocolMessage>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'ProtocolMessage'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{
|
||||
no: 2,
|
||||
name: 'installation_id',
|
||||
kind: 'scalar',
|
||||
T: 9 /* ScalarType.STRING */,
|
||||
},
|
||||
{ no: 3, name: 'bundles', kind: 'message', T: Bundle, repeated: true },
|
||||
{
|
||||
no: 101,
|
||||
name: 'encrypted_message',
|
||||
kind: 'map',
|
||||
K: 9 /* ScalarType.STRING */,
|
||||
V: { kind: 'message', T: EncryptedMessageProtocol },
|
||||
},
|
||||
{
|
||||
no: 102,
|
||||
name: 'public_message',
|
||||
kind: 'scalar',
|
||||
T: 12 /* ScalarType.BYTES */,
|
||||
},
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): ProtocolMessage {
|
||||
return new ProtocolMessage().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): ProtocolMessage {
|
||||
return new ProtocolMessage().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): ProtocolMessage {
|
||||
return new ProtocolMessage().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: ProtocolMessage | PlainMessage<ProtocolMessage> | undefined,
|
||||
b: ProtocolMessage | PlainMessage<ProtocolMessage> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(ProtocolMessage, a, b)
|
||||
}
|
||||
publicMessage: Uint8Array
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message ProtocolMessage.
|
||||
* Use `create(ProtocolMessageSchema)` to create a new message.
|
||||
*/
|
||||
export const ProtocolMessageSchema: GenMessage<ProtocolMessage> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_protocol_message, 11)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,99 +1,57 @@
|
||||
// @generated by protoc-gen-es v1.4.2 with parameter "target=ts"
|
||||
// @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
|
||||
// @generated from file segment-message.proto (syntax proto3)
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import type {
|
||||
BinaryReadOptions,
|
||||
FieldList,
|
||||
JsonReadOptions,
|
||||
JsonValue,
|
||||
PartialMessage,
|
||||
PlainMessage,
|
||||
} from '@bufbuild/protobuf'
|
||||
import { Message, proto3 } from '@bufbuild/protobuf'
|
||||
import type { GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2'
|
||||
import { fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2'
|
||||
import type { Message } from '@bufbuild/protobuf'
|
||||
|
||||
/**
|
||||
* Describes the file segment-message.proto.
|
||||
*/
|
||||
export const file_segment_message: GenFile =
|
||||
/*@__PURE__*/
|
||||
fileDesc(
|
||||
'ChVzZWdtZW50LW1lc3NhZ2UucHJvdG8iZQoOU2VnbWVudE1lc3NhZ2USGwoTZW50aXJlX21lc3NhZ2VfaGFzaBgBIAEoDBINCgVpbmRleBgCIAEoDRIWCg5zZWdtZW50c19jb3VudBgDIAEoDRIPCgdwYXlsb2FkGAQgASgMYgZwcm90bzM',
|
||||
)
|
||||
|
||||
/**
|
||||
* @generated from message SegmentMessage
|
||||
*/
|
||||
export class SegmentMessage extends Message<SegmentMessage> {
|
||||
export type SegmentMessage = Message<'SegmentMessage'> & {
|
||||
/**
|
||||
* hash of the entire original message
|
||||
*
|
||||
* @generated from field: bytes entire_message_hash = 1;
|
||||
*/
|
||||
entireMessageHash = new Uint8Array(0)
|
||||
entireMessageHash: Uint8Array
|
||||
|
||||
/**
|
||||
* Index of this segment within the entire original message
|
||||
*
|
||||
* @generated from field: uint32 index = 2;
|
||||
*/
|
||||
index = 0
|
||||
index: number
|
||||
|
||||
/**
|
||||
* Total number of segments the entire original message is divided into
|
||||
*
|
||||
* @generated from field: uint32 segments_count = 3;
|
||||
*/
|
||||
segmentsCount = 0
|
||||
segmentsCount: number
|
||||
|
||||
/**
|
||||
* The payload data for this particular segment
|
||||
*
|
||||
* @generated from field: bytes payload = 4;
|
||||
*/
|
||||
payload = new Uint8Array(0)
|
||||
|
||||
constructor(data?: PartialMessage<SegmentMessage>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'SegmentMessage'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{
|
||||
no: 1,
|
||||
name: 'entire_message_hash',
|
||||
kind: 'scalar',
|
||||
T: 12 /* ScalarType.BYTES */,
|
||||
},
|
||||
{ no: 2, name: 'index', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ },
|
||||
{
|
||||
no: 3,
|
||||
name: 'segments_count',
|
||||
kind: 'scalar',
|
||||
T: 13 /* ScalarType.UINT32 */,
|
||||
},
|
||||
{ no: 4, name: 'payload', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): SegmentMessage {
|
||||
return new SegmentMessage().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): SegmentMessage {
|
||||
return new SegmentMessage().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): SegmentMessage {
|
||||
return new SegmentMessage().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: SegmentMessage | PlainMessage<SegmentMessage> | undefined,
|
||||
b: SegmentMessage | PlainMessage<SegmentMessage> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(SegmentMessage, a, b)
|
||||
}
|
||||
payload: Uint8Array
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message SegmentMessage.
|
||||
* Use `create(SegmentMessageSchema)` to create a new message.
|
||||
*/
|
||||
export const SegmentMessageSchema: GenMessage<SegmentMessage> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_segment_message, 0)
|
||||
|
||||
@@ -1,90 +1,60 @@
|
||||
// @generated by protoc-gen-es v1.4.2 with parameter "target=ts"
|
||||
// @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
|
||||
// @generated from file shard.proto (syntax proto3)
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import type {
|
||||
BinaryReadOptions,
|
||||
FieldList,
|
||||
JsonReadOptions,
|
||||
JsonValue,
|
||||
PartialMessage,
|
||||
PlainMessage,
|
||||
} from '@bufbuild/protobuf'
|
||||
import { Message, proto3, protoInt64 } from '@bufbuild/protobuf'
|
||||
import type { GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2'
|
||||
import { fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2'
|
||||
import type { Message } from '@bufbuild/protobuf'
|
||||
|
||||
/**
|
||||
* Describes the file shard.proto.
|
||||
*/
|
||||
export const file_shard: GenFile =
|
||||
/*@__PURE__*/
|
||||
fileDesc(
|
||||
'CgtzaGFyZC5wcm90byInCgVTaGFyZBIPCgdjbHVzdGVyGAEgASgFEg0KBWluZGV4GAIgASgFIl4KD1B1YmxpY1NoYXJkSW5mbxINCgVjbG9jaxgBIAEoBBIUCgxjb21tdW5pdHlfaWQYAiABKAwSFQoFc2hhcmQYAyABKAsyBi5TaGFyZBIPCgdjaGFpbklkGAQgASgEIj4KGENvbW11bml0eVB1YmxpY1NoYXJkSW5mbxIRCglzaWduYXR1cmUYASABKAwSDwoHcGF5bG9hZBgCIAEoDGIGcHJvdG8z',
|
||||
)
|
||||
|
||||
/**
|
||||
* @generated from message Shard
|
||||
*/
|
||||
export class Shard extends Message<Shard> {
|
||||
export type Shard = Message<'Shard'> & {
|
||||
/**
|
||||
* @generated from field: int32 cluster = 1;
|
||||
*/
|
||||
cluster = 0
|
||||
cluster: number
|
||||
|
||||
/**
|
||||
* @generated from field: int32 index = 2;
|
||||
*/
|
||||
index = 0
|
||||
|
||||
constructor(data?: PartialMessage<Shard>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'Shard'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'cluster', kind: 'scalar', T: 5 /* ScalarType.INT32 */ },
|
||||
{ no: 2, name: 'index', kind: 'scalar', T: 5 /* ScalarType.INT32 */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): Shard {
|
||||
return new Shard().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): Shard {
|
||||
return new Shard().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): Shard {
|
||||
return new Shard().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: Shard | PlainMessage<Shard> | undefined,
|
||||
b: Shard | PlainMessage<Shard> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(Shard, a, b)
|
||||
}
|
||||
index: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message Shard.
|
||||
* Use `create(ShardSchema)` to create a new message.
|
||||
*/
|
||||
export const ShardSchema: GenMessage<Shard> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_shard, 0)
|
||||
|
||||
/**
|
||||
* @generated from message PublicShardInfo
|
||||
*/
|
||||
export class PublicShardInfo extends Message<PublicShardInfo> {
|
||||
export type PublicShardInfo = Message<'PublicShardInfo'> & {
|
||||
/**
|
||||
* clock
|
||||
*
|
||||
* @generated from field: uint64 clock = 1;
|
||||
*/
|
||||
clock = protoInt64.zero
|
||||
clock: bigint
|
||||
|
||||
/**
|
||||
* community ID
|
||||
*
|
||||
* @generated from field: bytes community_id = 2;
|
||||
*/
|
||||
communityId = new Uint8Array(0)
|
||||
communityId: Uint8Array
|
||||
|
||||
/**
|
||||
* shard information
|
||||
@@ -98,117 +68,40 @@ export class PublicShardInfo extends Message<PublicShardInfo> {
|
||||
*
|
||||
* @generated from field: uint64 chainId = 4;
|
||||
*/
|
||||
chainId = protoInt64.zero
|
||||
|
||||
constructor(data?: PartialMessage<PublicShardInfo>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'PublicShardInfo'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
|
||||
{
|
||||
no: 2,
|
||||
name: 'community_id',
|
||||
kind: 'scalar',
|
||||
T: 12 /* ScalarType.BYTES */,
|
||||
},
|
||||
{ no: 3, name: 'shard', kind: 'message', T: Shard },
|
||||
{ no: 4, name: 'chainId', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): PublicShardInfo {
|
||||
return new PublicShardInfo().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): PublicShardInfo {
|
||||
return new PublicShardInfo().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): PublicShardInfo {
|
||||
return new PublicShardInfo().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: PublicShardInfo | PlainMessage<PublicShardInfo> | undefined,
|
||||
b: PublicShardInfo | PlainMessage<PublicShardInfo> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(PublicShardInfo, a, b)
|
||||
}
|
||||
chainId: bigint
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message PublicShardInfo.
|
||||
* Use `create(PublicShardInfoSchema)` to create a new message.
|
||||
*/
|
||||
export const PublicShardInfoSchema: GenMessage<PublicShardInfo> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_shard, 1)
|
||||
|
||||
/**
|
||||
* @generated from message CommunityPublicShardInfo
|
||||
*/
|
||||
export class CommunityPublicShardInfo extends Message<CommunityPublicShardInfo> {
|
||||
export type CommunityPublicShardInfo = Message<'CommunityPublicShardInfo'> & {
|
||||
/**
|
||||
* Signature of the payload field
|
||||
*
|
||||
* @generated from field: bytes signature = 1;
|
||||
*/
|
||||
signature = new Uint8Array(0)
|
||||
signature: Uint8Array
|
||||
|
||||
/**
|
||||
* Marshaled PublicShardInfo
|
||||
*
|
||||
* @generated from field: bytes payload = 2;
|
||||
*/
|
||||
payload = new Uint8Array(0)
|
||||
|
||||
constructor(data?: PartialMessage<CommunityPublicShardInfo>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'CommunityPublicShardInfo'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'signature', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
{ no: 2, name: 'payload', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): CommunityPublicShardInfo {
|
||||
return new CommunityPublicShardInfo().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): CommunityPublicShardInfo {
|
||||
return new CommunityPublicShardInfo().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): CommunityPublicShardInfo {
|
||||
return new CommunityPublicShardInfo().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a:
|
||||
| CommunityPublicShardInfo
|
||||
| PlainMessage<CommunityPublicShardInfo>
|
||||
| undefined,
|
||||
b:
|
||||
| CommunityPublicShardInfo
|
||||
| PlainMessage<CommunityPublicShardInfo>
|
||||
| undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(CommunityPublicShardInfo, a, b)
|
||||
}
|
||||
payload: Uint8Array
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message CommunityPublicShardInfo.
|
||||
* Use `create(CommunityPublicShardInfoSchema)` to create a new message.
|
||||
*/
|
||||
export const CommunityPublicShardInfoSchema: GenMessage<CommunityPublicShardInfo> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_shard, 2)
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
// @generated by protoc-gen-es v1.4.2 with parameter "target=ts"
|
||||
// @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
|
||||
// @generated from file status-update.proto (syntax proto3)
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import type {
|
||||
BinaryReadOptions,
|
||||
FieldList,
|
||||
JsonReadOptions,
|
||||
JsonValue,
|
||||
PartialMessage,
|
||||
PlainMessage,
|
||||
} from '@bufbuild/protobuf'
|
||||
import { Message, proto3, protoInt64 } from '@bufbuild/protobuf'
|
||||
import type { GenEnum, GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2'
|
||||
import { enumDesc, fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2'
|
||||
import type { Message } from '@bufbuild/protobuf'
|
||||
|
||||
/**
|
||||
* Describes the file status-update.proto.
|
||||
*/
|
||||
export const file_status_update: GenFile =
|
||||
/*@__PURE__*/
|
||||
fileDesc(
|
||||
'ChNzdGF0dXMtdXBkYXRlLnByb3RvIswBCgxTdGF0dXNVcGRhdGUSDQoFY2xvY2sYASABKAQSLQoLc3RhdHVzX3R5cGUYAiABKA4yGC5TdGF0dXNVcGRhdGUuU3RhdHVzVHlwZRITCgtjdXN0b21fdGV4dBgDIAEoCSJpCgpTdGF0dXNUeXBlEhcKE1VOS05PV05fU1RBVFVTX1RZUEUQABINCglBVVRPTUFUSUMQARISCg5ET19OT1RfRElTVFVSQhACEhEKDUFMV0FZU19PTkxJTkUQAxIMCghJTkFDVElWRRAEYgZwcm90bzM',
|
||||
)
|
||||
|
||||
/**
|
||||
* Specs:
|
||||
@@ -28,74 +30,31 @@ import { Message, proto3, protoInt64 } from '@bufbuild/protobuf'
|
||||
*
|
||||
* @generated from message StatusUpdate
|
||||
*/
|
||||
export class StatusUpdate extends Message<StatusUpdate> {
|
||||
export type StatusUpdate = Message<'StatusUpdate'> & {
|
||||
/**
|
||||
* @generated from field: uint64 clock = 1;
|
||||
*/
|
||||
clock = protoInt64.zero
|
||||
clock: bigint
|
||||
|
||||
/**
|
||||
* @generated from field: StatusUpdate.StatusType status_type = 2;
|
||||
*/
|
||||
statusType = StatusUpdate_StatusType.UNKNOWN_STATUS_TYPE
|
||||
statusType: StatusUpdate_StatusType
|
||||
|
||||
/**
|
||||
* @generated from field: string custom_text = 3;
|
||||
*/
|
||||
customText = ''
|
||||
|
||||
constructor(data?: PartialMessage<StatusUpdate>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'StatusUpdate'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'clock', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ },
|
||||
{
|
||||
no: 2,
|
||||
name: 'status_type',
|
||||
kind: 'enum',
|
||||
T: proto3.getEnumType(StatusUpdate_StatusType),
|
||||
},
|
||||
{
|
||||
no: 3,
|
||||
name: 'custom_text',
|
||||
kind: 'scalar',
|
||||
T: 9 /* ScalarType.STRING */,
|
||||
},
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): StatusUpdate {
|
||||
return new StatusUpdate().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): StatusUpdate {
|
||||
return new StatusUpdate().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): StatusUpdate {
|
||||
return new StatusUpdate().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: StatusUpdate | PlainMessage<StatusUpdate> | undefined,
|
||||
b: StatusUpdate | PlainMessage<StatusUpdate> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(StatusUpdate, a, b)
|
||||
}
|
||||
customText: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message StatusUpdate.
|
||||
* Use `create(StatusUpdateSchema)` to create a new message.
|
||||
*/
|
||||
export const StatusUpdateSchema: GenMessage<StatusUpdate> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_status_update, 0)
|
||||
|
||||
/**
|
||||
* @generated from enum StatusUpdate.StatusType
|
||||
*/
|
||||
@@ -125,11 +84,10 @@ export enum StatusUpdate_StatusType {
|
||||
*/
|
||||
INACTIVE = 4,
|
||||
}
|
||||
// Retrieve enum metadata with: proto3.getEnumType(StatusUpdate_StatusType)
|
||||
proto3.util.setEnumType(StatusUpdate_StatusType, 'StatusUpdate.StatusType', [
|
||||
{ no: 0, name: 'UNKNOWN_STATUS_TYPE' },
|
||||
{ no: 1, name: 'AUTOMATIC' },
|
||||
{ no: 2, name: 'DO_NOT_DISTURB' },
|
||||
{ no: 3, name: 'ALWAYS_ONLINE' },
|
||||
{ no: 4, name: 'INACTIVE' },
|
||||
])
|
||||
|
||||
/**
|
||||
* Describes the enum StatusUpdate.StatusType.
|
||||
*/
|
||||
export const StatusUpdate_StatusTypeSchema: GenEnum<StatusUpdate_StatusType> =
|
||||
/*@__PURE__*/
|
||||
enumDesc(file_status_update, 0, 0)
|
||||
|
||||
@@ -1,135 +1,81 @@
|
||||
// @generated by protoc-gen-es v1.4.2 with parameter "target=ts"
|
||||
// @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
|
||||
// @generated from file url.proto (syntax proto3)
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import type {
|
||||
BinaryReadOptions,
|
||||
FieldList,
|
||||
JsonReadOptions,
|
||||
JsonValue,
|
||||
PartialMessage,
|
||||
PlainMessage,
|
||||
} from '@bufbuild/protobuf'
|
||||
import { Message, proto3 } from '@bufbuild/protobuf'
|
||||
import type { GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2'
|
||||
import { fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2'
|
||||
import type { Message } from '@bufbuild/protobuf'
|
||||
|
||||
/**
|
||||
* Describes the file url.proto.
|
||||
*/
|
||||
export const file_url: GenFile =
|
||||
/*@__PURE__*/
|
||||
fileDesc(
|
||||
'Cgl1cmwucHJvdG8icQoJQ29tbXVuaXR5EhQKDGRpc3BsYXlfbmFtZRgBIAEoCRITCgtkZXNjcmlwdGlvbhgCIAEoCRIVCg1tZW1iZXJzX2NvdW50GAMgASgNEg0KBWNvbG9yGAQgASgJEhMKC3RhZ19pbmRpY2VzGAUgAygNIn8KB0NoYW5uZWwSFAoMZGlzcGxheV9uYW1lGAEgASgJEhMKC2Rlc2NyaXB0aW9uGAIgASgJEg0KBWVtb2ppGAMgASgJEg0KBWNvbG9yGAQgASgJEh0KCWNvbW11bml0eRgFIAEoCzIKLkNvbW11bml0eRIMCgR1dWlkGAYgASgJIkAKBFVzZXISFAoMZGlzcGxheV9uYW1lGAEgASgJEhMKC2Rlc2NyaXB0aW9uGAIgASgJEg0KBWNvbG9yGAMgASgJIhoKB1VSTERhdGESDwoHY29udGVudBgBIAEoDGIGcHJvdG8z',
|
||||
)
|
||||
|
||||
/**
|
||||
* @generated from message Community
|
||||
*/
|
||||
export class Community extends Message<Community> {
|
||||
export type Community = Message<'Community'> & {
|
||||
/**
|
||||
* @generated from field: string display_name = 1;
|
||||
*/
|
||||
displayName = ''
|
||||
displayName: string
|
||||
|
||||
/**
|
||||
* @generated from field: string description = 2;
|
||||
*/
|
||||
description = ''
|
||||
description: string
|
||||
|
||||
/**
|
||||
* @generated from field: uint32 members_count = 3;
|
||||
*/
|
||||
membersCount = 0
|
||||
membersCount: number
|
||||
|
||||
/**
|
||||
* @generated from field: string color = 4;
|
||||
*/
|
||||
color = ''
|
||||
color: string
|
||||
|
||||
/**
|
||||
* @generated from field: repeated uint32 tag_indices = 5;
|
||||
*/
|
||||
tagIndices: number[] = []
|
||||
|
||||
constructor(data?: PartialMessage<Community>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'Community'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{
|
||||
no: 1,
|
||||
name: 'display_name',
|
||||
kind: 'scalar',
|
||||
T: 9 /* ScalarType.STRING */,
|
||||
},
|
||||
{
|
||||
no: 2,
|
||||
name: 'description',
|
||||
kind: 'scalar',
|
||||
T: 9 /* ScalarType.STRING */,
|
||||
},
|
||||
{
|
||||
no: 3,
|
||||
name: 'members_count',
|
||||
kind: 'scalar',
|
||||
T: 13 /* ScalarType.UINT32 */,
|
||||
},
|
||||
{ no: 4, name: 'color', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{
|
||||
no: 5,
|
||||
name: 'tag_indices',
|
||||
kind: 'scalar',
|
||||
T: 13 /* ScalarType.UINT32 */,
|
||||
repeated: true,
|
||||
},
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): Community {
|
||||
return new Community().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): Community {
|
||||
return new Community().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): Community {
|
||||
return new Community().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: Community | PlainMessage<Community> | undefined,
|
||||
b: Community | PlainMessage<Community> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(Community, a, b)
|
||||
}
|
||||
tagIndices: number[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message Community.
|
||||
* Use `create(CommunitySchema)` to create a new message.
|
||||
*/
|
||||
export const CommunitySchema: GenMessage<Community> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_url, 0)
|
||||
|
||||
/**
|
||||
* @generated from message Channel
|
||||
*/
|
||||
export class Channel extends Message<Channel> {
|
||||
export type Channel = Message<'Channel'> & {
|
||||
/**
|
||||
* @generated from field: string display_name = 1;
|
||||
*/
|
||||
displayName = ''
|
||||
displayName: string
|
||||
|
||||
/**
|
||||
* @generated from field: string description = 2;
|
||||
*/
|
||||
description = ''
|
||||
description: string
|
||||
|
||||
/**
|
||||
* @generated from field: string emoji = 3;
|
||||
*/
|
||||
emoji = ''
|
||||
emoji: string
|
||||
|
||||
/**
|
||||
* @generated from field: string color = 4;
|
||||
*/
|
||||
color = ''
|
||||
color: string
|
||||
|
||||
/**
|
||||
* @generated from field: Community community = 5;
|
||||
@@ -139,181 +85,61 @@ export class Channel extends Message<Channel> {
|
||||
/**
|
||||
* @generated from field: string uuid = 6;
|
||||
*/
|
||||
uuid = ''
|
||||
|
||||
constructor(data?: PartialMessage<Channel>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'Channel'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{
|
||||
no: 1,
|
||||
name: 'display_name',
|
||||
kind: 'scalar',
|
||||
T: 9 /* ScalarType.STRING */,
|
||||
},
|
||||
{
|
||||
no: 2,
|
||||
name: 'description',
|
||||
kind: 'scalar',
|
||||
T: 9 /* ScalarType.STRING */,
|
||||
},
|
||||
{ no: 3, name: 'emoji', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{ no: 4, name: 'color', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
{ no: 5, name: 'community', kind: 'message', T: Community },
|
||||
{ no: 6, name: 'uuid', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): Channel {
|
||||
return new Channel().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): Channel {
|
||||
return new Channel().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): Channel {
|
||||
return new Channel().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: Channel | PlainMessage<Channel> | undefined,
|
||||
b: Channel | PlainMessage<Channel> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(Channel, a, b)
|
||||
}
|
||||
uuid: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message Channel.
|
||||
* Use `create(ChannelSchema)` to create a new message.
|
||||
*/
|
||||
export const ChannelSchema: GenMessage<Channel> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_url, 1)
|
||||
|
||||
/**
|
||||
* @generated from message User
|
||||
*/
|
||||
export class User extends Message<User> {
|
||||
export type User = Message<'User'> & {
|
||||
/**
|
||||
* @generated from field: string display_name = 1;
|
||||
*/
|
||||
displayName = ''
|
||||
displayName: string
|
||||
|
||||
/**
|
||||
* @generated from field: string description = 2;
|
||||
*/
|
||||
description = ''
|
||||
description: string
|
||||
|
||||
/**
|
||||
* @generated from field: string color = 3;
|
||||
*/
|
||||
color = ''
|
||||
|
||||
constructor(data?: PartialMessage<User>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'User'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{
|
||||
no: 1,
|
||||
name: 'display_name',
|
||||
kind: 'scalar',
|
||||
T: 9 /* ScalarType.STRING */,
|
||||
},
|
||||
{
|
||||
no: 2,
|
||||
name: 'description',
|
||||
kind: 'scalar',
|
||||
T: 9 /* ScalarType.STRING */,
|
||||
},
|
||||
{ no: 3, name: 'color', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): User {
|
||||
return new User().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): User {
|
||||
return new User().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): User {
|
||||
return new User().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: User | PlainMessage<User> | undefined,
|
||||
b: User | PlainMessage<User> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(User, a, b)
|
||||
}
|
||||
color: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message User.
|
||||
* Use `create(UserSchema)` to create a new message.
|
||||
*/
|
||||
export const UserSchema: GenMessage<User> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_url, 2)
|
||||
|
||||
/**
|
||||
* @generated from message URLData
|
||||
*/
|
||||
export class URLData extends Message<URLData> {
|
||||
export type URLData = Message<'URLData'> & {
|
||||
/**
|
||||
* Community, Channel, or User
|
||||
*
|
||||
* @generated from field: bytes content = 1;
|
||||
*/
|
||||
content = new Uint8Array(0)
|
||||
|
||||
constructor(data?: PartialMessage<URLData>) {
|
||||
super()
|
||||
proto3.util.initPartial(data, this)
|
||||
}
|
||||
|
||||
static readonly runtime: typeof proto3 = proto3
|
||||
static readonly typeName = 'URLData'
|
||||
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
||||
{ no: 1, name: 'content', kind: 'scalar', T: 12 /* ScalarType.BYTES */ },
|
||||
])
|
||||
|
||||
static fromBinary(
|
||||
bytes: Uint8Array,
|
||||
options?: Partial<BinaryReadOptions>
|
||||
): URLData {
|
||||
return new URLData().fromBinary(bytes, options)
|
||||
}
|
||||
|
||||
static fromJson(
|
||||
jsonValue: JsonValue,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): URLData {
|
||||
return new URLData().fromJson(jsonValue, options)
|
||||
}
|
||||
|
||||
static fromJsonString(
|
||||
jsonString: string,
|
||||
options?: Partial<JsonReadOptions>
|
||||
): URLData {
|
||||
return new URLData().fromJsonString(jsonString, options)
|
||||
}
|
||||
|
||||
static equals(
|
||||
a: URLData | PlainMessage<URLData> | undefined,
|
||||
b: URLData | PlainMessage<URLData> | undefined
|
||||
): boolean {
|
||||
return proto3.util.equals(URLData, a, b)
|
||||
}
|
||||
content: Uint8Array
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the message URLData.
|
||||
* Use `create(URLDataSchema)` to create a new message.
|
||||
*/
|
||||
export const URLDataSchema: GenMessage<URLData> =
|
||||
/*@__PURE__*/
|
||||
messageDesc(file_url, 3)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { fromBinary } from '@bufbuild/protobuf'
|
||||
import { bootstrap } from '@libp2p/bootstrap'
|
||||
import { Protocols } from '@waku/interfaces'
|
||||
import { createDecoder } from '@waku/message-encryption/symmetric'
|
||||
@@ -9,16 +10,16 @@ import { peers } from '../consts/peers'
|
||||
import { providers } from '../consts/providers'
|
||||
import { EthereumClient } from '../ethereum-client/ethereum-client'
|
||||
import {
|
||||
ApplicationMetadataMessage,
|
||||
ApplicationMetadataMessage_Type,
|
||||
ApplicationMetadataMessageSchema,
|
||||
} from '../protos/application-metadata-message_pb'
|
||||
import {
|
||||
CommunityDescription,
|
||||
CommunityDescriptionSchema,
|
||||
CommunityTokenPermission_Type,
|
||||
} from '../protos/communities_pb'
|
||||
import { ProtocolMessage } from '../protos/protocol-message_pb'
|
||||
import { ContactCodeAdvertisement } from '../protos/push-notifications_pb'
|
||||
import { SegmentMessage } from '../protos/segment-message_pb'
|
||||
import { ProtocolMessageSchema } from '../protos/protocol-message_pb'
|
||||
import { ContactCodeAdvertisementSchema } from '../protos/push-notifications_pb'
|
||||
import { SegmentMessageSchema } from '../protos/segment-message_pb'
|
||||
import { compressPublicKey } from '../utils/compress-public-key'
|
||||
import { generateKeyFromPassword } from '../utils/generate-key-from-password'
|
||||
import { idToContentTopic } from '../utils/id-to-content-topic'
|
||||
@@ -30,6 +31,9 @@ import { mapCommunity } from './map-community'
|
||||
import { mapUser } from './map-user'
|
||||
|
||||
import type { DecodedMessage } from '../client/community/handle-waku-message'
|
||||
import type { CommunityDescription } from '../protos/communities_pb'
|
||||
import type { ContactCodeAdvertisement } from '../protos/push-notifications_pb'
|
||||
import type { SegmentMessage } from '../protos/segment-message_pb'
|
||||
import type { ChannelInfo } from './map-channel'
|
||||
import type { CommunityInfo } from './map-community'
|
||||
import type { UserInfo } from './map-user'
|
||||
@@ -93,6 +97,9 @@ class RequestClient {
|
||||
emitSelf: true,
|
||||
// pingKeepAlive: 0,
|
||||
// relayKeepAlive: 0,
|
||||
networkConfig: {
|
||||
clusterId: 16,
|
||||
},
|
||||
libp2p: {
|
||||
peerDiscovery: [
|
||||
bootstrap({
|
||||
@@ -212,10 +219,15 @@ class RequestClient {
|
||||
const symmetricKey = await generateKeyFromPassword(communityPublicKey)
|
||||
|
||||
const wakuMessageGenerator = this.waku.store.queryGenerator([
|
||||
createDecoder(contentTopic, symmetricKey, {
|
||||
clusterId: 16,
|
||||
shard: 32,
|
||||
}),
|
||||
createDecoder(
|
||||
contentTopic,
|
||||
{
|
||||
clusterId: 16,
|
||||
shardId: 32,
|
||||
pubsubTopic: '/waku/2/rs/16/32',
|
||||
},
|
||||
symmetricKey,
|
||||
),
|
||||
])
|
||||
for await (const wakuMessages of wakuMessageGenerator) {
|
||||
for await (const wakuMessage of wakuMessages) {
|
||||
@@ -236,7 +248,8 @@ class RequestClient {
|
||||
}
|
||||
|
||||
// decode
|
||||
const decodedCommunityDescription = CommunityDescription.fromBinary(
|
||||
const decodedCommunityDescription = fromBinary(
|
||||
CommunityDescriptionSchema,
|
||||
message.payload,
|
||||
)
|
||||
|
||||
@@ -309,10 +322,15 @@ class RequestClient {
|
||||
)
|
||||
|
||||
const wakuMessageGenerator = this.waku.store.queryGenerator([
|
||||
createDecoder(contentTopic, symmetricKey, {
|
||||
clusterId: 16,
|
||||
shard: 32,
|
||||
}),
|
||||
createDecoder(
|
||||
contentTopic,
|
||||
{
|
||||
clusterId: 16,
|
||||
shardId: 32,
|
||||
pubsubTopic: '/waku/2/rs/16/32',
|
||||
},
|
||||
symmetricKey,
|
||||
),
|
||||
])
|
||||
for await (const wakuMessages of wakuMessageGenerator) {
|
||||
for await (const wakuMessage of wakuMessages) {
|
||||
@@ -335,7 +353,8 @@ class RequestClient {
|
||||
}
|
||||
|
||||
// decode
|
||||
const decodedContactCode = ContactCodeAdvertisement.fromBinary(
|
||||
const decodedContactCode = fromBinary(
|
||||
ContactCodeAdvertisementSchema,
|
||||
message.payload,
|
||||
)
|
||||
|
||||
@@ -390,7 +409,7 @@ class RequestClient {
|
||||
let messageToDecode = wakuMessage.payload // default
|
||||
|
||||
try {
|
||||
const decodedSegment = SegmentMessage.fromBinary(messageToDecode)
|
||||
const decodedSegment = fromBinary(SegmentMessageSchema, messageToDecode)
|
||||
|
||||
if (decodedSegment) {
|
||||
const unsegmentedMessageHash = bytesToHex(
|
||||
@@ -439,7 +458,7 @@ class RequestClient {
|
||||
|
||||
let decodedProtocol
|
||||
try {
|
||||
decodedProtocol = ProtocolMessage.fromBinary(messageToDecode)
|
||||
decodedProtocol = fromBinary(ProtocolMessageSchema, messageToDecode)
|
||||
|
||||
if (decodedProtocol.encryptedMessage.none) {
|
||||
messageToDecode = decodedProtocol.encryptedMessage.none.payload
|
||||
@@ -451,7 +470,10 @@ class RequestClient {
|
||||
|
||||
let decodedMetadata
|
||||
try {
|
||||
decodedMetadata = ApplicationMetadataMessage.fromBinary(messageToDecode)
|
||||
decodedMetadata = fromBinary(
|
||||
ApplicationMetadataMessageSchema,
|
||||
messageToDecode,
|
||||
)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -18,8 +18,11 @@ import type {
|
||||
CommunityDescription,
|
||||
} from '../protos/communities_pb'
|
||||
import type { ContactCodeAdvertisement } from '../protos/push-notifications_pb'
|
||||
import type { Channel as ChannelProto } from '../protos/url_pb'
|
||||
import type { PlainMessage } from '@bufbuild/protobuf'
|
||||
import type {
|
||||
Channel as ChannelProto,
|
||||
Community as CommunityProto,
|
||||
User,
|
||||
} from '../protos/url_pb'
|
||||
|
||||
/**
|
||||
* @see https://github.com/microsoft/TypeScript/issues/24509
|
||||
@@ -57,7 +60,7 @@ describe('Create URLs', () => {
|
||||
color: community.description.identity!.color,
|
||||
membersCount: 446_744,
|
||||
tagIndices: [1, 33, 51],
|
||||
},
|
||||
} as unknown as CommunityProto,
|
||||
community.chatKey,
|
||||
)
|
||||
).toString(),
|
||||
@@ -111,7 +114,7 @@ describe('Create URLs', () => {
|
||||
community: {
|
||||
displayName: community.description.identity!.displayName,
|
||||
},
|
||||
} as unknown as PlainMessage<ChannelProto>,
|
||||
} as unknown as ChannelProto,
|
||||
community.chatKey,
|
||||
)
|
||||
).toString(),
|
||||
@@ -146,7 +149,7 @@ describe('Create URLs', () => {
|
||||
description: account.description.chatIdentity!.description,
|
||||
displayName: account.description.chatIdentity!.displayName,
|
||||
color: account.description.chatIdentity!.color,
|
||||
},
|
||||
} as unknown as User,
|
||||
account.chatKey,
|
||||
)
|
||||
).toString(),
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
} from './encode-url-data'
|
||||
|
||||
import type { Channel, Community, User } from '../protos/url_pb'
|
||||
import type { PlainMessage } from '@bufbuild/protobuf'
|
||||
|
||||
const BASE_URL = 'https://status.app'
|
||||
|
||||
@@ -14,7 +13,7 @@ export function createCommunityURLWithChatKey(communityChatKey: string): URL {
|
||||
}
|
||||
|
||||
export async function createCommunityURLWithData(
|
||||
communityData: PlainMessage<Community>,
|
||||
communityData: Community,
|
||||
communityChatKey: string,
|
||||
): Promise<URL> {
|
||||
const encodedURLData = encodeCommunityURLData(communityData)
|
||||
@@ -30,7 +29,7 @@ export function createChannelURLWithChatKey(
|
||||
}
|
||||
|
||||
export async function createChannelURLWithData(
|
||||
channelData: PlainMessage<Channel>,
|
||||
channelData: Channel,
|
||||
communityChatKey: string,
|
||||
): Promise<URL> {
|
||||
const encodedURLData = encodeChannelURLData(channelData)
|
||||
@@ -47,7 +46,7 @@ export function createUserURLWithChatKey(chatKey: string): URL {
|
||||
}
|
||||
|
||||
export async function createUserURLWithData(
|
||||
userData: PlainMessage<User>,
|
||||
userData: User,
|
||||
userChatKey: string,
|
||||
): Promise<URL> {
|
||||
const encodedURLData = encodeUserURLData(userData)
|
||||
|
||||
@@ -9,8 +9,7 @@ import {
|
||||
encodeUserURLData,
|
||||
} from './encode-url-data'
|
||||
|
||||
import type { Channel } from '../protos/url_pb'
|
||||
import type { PlainMessage } from '@bufbuild/protobuf'
|
||||
import type { Channel, Community, User } from '../protos/url_pb'
|
||||
|
||||
describe('Encode URL data', () => {
|
||||
test('should encode and decode community', () => {
|
||||
@@ -23,7 +22,7 @@ describe('Encode URL data', () => {
|
||||
tagIndices: [1, 2, 3, 4],
|
||||
}
|
||||
|
||||
const encodedData = encodeCommunityURLData(data)
|
||||
const encodedData = encodeCommunityURLData(data as unknown as Community)
|
||||
const decodedData = decodeCommunityURLData(encodedData)
|
||||
|
||||
expect(encodedData).toBe(
|
||||
@@ -72,9 +71,7 @@ describe('Encode URL data', () => {
|
||||
},
|
||||
}
|
||||
|
||||
const encodedData = encodeChannelURLData(
|
||||
data as unknown as PlainMessage<Channel>,
|
||||
)
|
||||
const encodedData = encodeChannelURLData(data as unknown as Channel)
|
||||
const decodedData = decodeChannelURLData(encodedData)
|
||||
|
||||
expect(encodedData).toBe(
|
||||
@@ -146,7 +143,7 @@ describe('Encode URL data', () => {
|
||||
color: '#EAB700',
|
||||
}
|
||||
|
||||
const encodedData = encodeUserURLData(data)
|
||||
const encodedData = encodeUserURLData(data as unknown as User)
|
||||
const decodedData = decodeUserURLData(encodedData)
|
||||
|
||||
expect(encodedData).toBe(
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
import { create, fromBinary, toBinary, toJson } from '@bufbuild/protobuf'
|
||||
import { base64url } from '@scure/base'
|
||||
import { brotliCompressSync, brotliDecompressSync } from 'zlib'
|
||||
import { z } from 'zod'
|
||||
|
||||
import { Channel, Community, URLData, User } from '../protos/url_pb'
|
||||
import {
|
||||
ChannelSchema,
|
||||
CommunitySchema,
|
||||
URLDataSchema,
|
||||
UserSchema,
|
||||
} from '../protos/url_pb'
|
||||
|
||||
import type { PlainMessage } from '@bufbuild/protobuf'
|
||||
import type { Channel, Community, URLData, User } from '../protos/url_pb'
|
||||
|
||||
export type EncodedURLData = string & { _: 'EncodedURLData' }
|
||||
|
||||
@@ -19,16 +25,19 @@ const communitySchema = z.object({
|
||||
tagIndices: z.number().nonnegative().array().optional(),
|
||||
})
|
||||
|
||||
export function encodeCommunityURLData(
|
||||
data: PlainMessage<Community>,
|
||||
): EncodedURLData {
|
||||
return encodeURLData(new Community(data).toBinary()) as EncodedURLData
|
||||
export function encodeCommunityURLData(data: Community): EncodedURLData {
|
||||
return encodeURLData(
|
||||
toBinary(CommunitySchema, create(CommunitySchema, data)),
|
||||
) as EncodedURLData
|
||||
}
|
||||
|
||||
export function decodeCommunityURLData(data: string) {
|
||||
const deserialized = decodeURLData(data)
|
||||
|
||||
const community = Community.fromBinary(deserialized.content).toJson()
|
||||
const community = toJson(
|
||||
CommunitySchema,
|
||||
fromBinary(CommunitySchema, deserialized.content),
|
||||
)
|
||||
|
||||
return communitySchema.parse(community)
|
||||
}
|
||||
@@ -44,16 +53,19 @@ const channelSchema = z.object({
|
||||
uuid: z.string().uuid(),
|
||||
})
|
||||
|
||||
export function encodeChannelURLData(
|
||||
data: PlainMessage<Channel>,
|
||||
): EncodedURLData {
|
||||
return encodeURLData(new Channel(data).toBinary()) as EncodedURLData
|
||||
export function encodeChannelURLData(data: Channel): EncodedURLData {
|
||||
return encodeURLData(
|
||||
toBinary(ChannelSchema, create(ChannelSchema, data)),
|
||||
) as EncodedURLData
|
||||
}
|
||||
|
||||
export function decodeChannelURLData(data: string) {
|
||||
const deserialized = decodeURLData(data)
|
||||
|
||||
const channel = Channel.fromBinary(deserialized.content).toJson()
|
||||
const channel = toJson(
|
||||
ChannelSchema,
|
||||
fromBinary(ChannelSchema, deserialized.content),
|
||||
)
|
||||
|
||||
return channelSchema.parse(channel)
|
||||
}
|
||||
@@ -65,22 +77,27 @@ const userSchema = z.object({
|
||||
color: colorSchema.optional().default('#ffffff'),
|
||||
})
|
||||
|
||||
export function encodeUserURLData(data: PlainMessage<User>): EncodedURLData {
|
||||
return encodeURLData(new User(data).toBinary()) as EncodedURLData
|
||||
export function encodeUserURLData(data: User): EncodedURLData {
|
||||
return encodeURLData(
|
||||
toBinary(UserSchema, create(UserSchema, data)),
|
||||
) as EncodedURLData
|
||||
}
|
||||
|
||||
export function decodeUserURLData(data: string) {
|
||||
const deserialized = decodeURLData(data)
|
||||
|
||||
const user = User.fromBinary(deserialized.content).toJson()
|
||||
const user = toJson(UserSchema, fromBinary(UserSchema, deserialized.content))
|
||||
|
||||
return userSchema.parse(user)
|
||||
}
|
||||
|
||||
function encodeURLData(data: Uint8Array): string {
|
||||
const serialized = new URLData({
|
||||
content: data,
|
||||
}).toBinary()
|
||||
const serialized = toBinary(
|
||||
URLDataSchema,
|
||||
create(URLDataSchema, {
|
||||
content: new Uint8Array(data),
|
||||
}),
|
||||
)
|
||||
const compressed = brotliCompressSync(serialized)
|
||||
const encoded = base64url.encode(compressed as unknown as Uint8Array)
|
||||
|
||||
@@ -95,7 +112,10 @@ function decodeURLData(data: string): URLData {
|
||||
|
||||
const decoded = base64url.decode(data)
|
||||
const decompressed = brotliDecompressSync(decoded)
|
||||
const deserialized = URLData.fromBinary(decompressed as unknown as Uint8Array)
|
||||
const deserialized = fromBinary(
|
||||
URLDataSchema,
|
||||
decompressed as unknown as Uint8Array,
|
||||
)
|
||||
|
||||
return deserialized
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { create } from '@bufbuild/protobuf'
|
||||
import { bytesToHex, utf8ToBytes } from 'ethereum-cryptography/utils'
|
||||
import { expect, test } from 'vitest'
|
||||
|
||||
import { Account } from '../client/account'
|
||||
import {
|
||||
ApplicationMetadataMessage,
|
||||
ApplicationMetadataMessage_Type,
|
||||
ApplicationMetadataMessageSchema,
|
||||
} from '../protos/application-metadata-message_pb'
|
||||
import { recoverPublicKey } from './recover-public-key'
|
||||
|
||||
@@ -23,7 +24,7 @@ test('should recover public key', async () => {
|
||||
})
|
||||
|
||||
test('should recover public key from fixture', async () => {
|
||||
const metadataFixture = new ApplicationMetadataMessage({
|
||||
const metadataFixture = create(ApplicationMetadataMessageSchema, {
|
||||
type: ApplicationMetadataMessage_Type.EMOJI_REACTION,
|
||||
signature: new Uint8Array([
|
||||
250, 132, 234, 119, 159, 124, 98, 93, 197, 108, 99, 52, 186, 234, 142,
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
"dist"
|
||||
],
|
||||
"engines": {
|
||||
"node": "20.x"
|
||||
"node": "22.x"
|
||||
},
|
||||
"scripts": {
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
|
||||
@@ -109,7 +109,6 @@
|
||||
"qrcode.react": "^3.1.0",
|
||||
"react-aria-components": "^1.3.3",
|
||||
"react-day-picker": "^8.7.1",
|
||||
"react-hook-form": "^7.58.1",
|
||||
"react-swipeable": "^7.0.1",
|
||||
"superjson": "^2.2.1",
|
||||
"ts-pattern": "^5.3.1",
|
||||
@@ -118,6 +117,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@hookform/devtools": "^4.3.1",
|
||||
"react-hook-form": "^7.45.1",
|
||||
"@status-im/eslint-config": "workspace:*",
|
||||
"@types/d3-array": "^3.0.4",
|
||||
"@types/d3-scale": "^4.0.8",
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
diff --git a/dist/crypto/utils.js b/dist/crypto/utils.js
|
||||
index 24fe178c408f7bfec7f99c775b6411ad939efa27..eb47fd218c81e45bb2c351058357be2def4f5471 100644
|
||||
--- a/dist/crypto/utils.js
|
||||
+++ b/dist/crypto/utils.js
|
||||
@@ -4,7 +4,7 @@ import { concat } from "@waku/utils/bytes";
|
||||
import sha3 from "js-sha3";
|
||||
import { Asymmetric, Symmetric } from "../misc.js";
|
||||
const crypto = {
|
||||
- node: nodeCrypto,
|
||||
+ node: typeof require === 'function' && require('crypto'),
|
||||
web: typeof self === "object" && "crypto" in self ? self.crypto : undefined
|
||||
};
|
||||
export function getSubtle() {
|
||||
Generated
+12109
-13306
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user