mirror of
https://github.com/logos-messaging/OpChan.git
synced 2026-01-02 12:53:10 +00:00
chore: upgrade waku/sdk
This commit is contained in:
parent
d43d3bfec7
commit
9a70c59bc7
1238
package-lock.json
generated
1238
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -49,7 +49,7 @@
|
||||
"@reown/appkit-adapter-wagmi": "^1.7.17",
|
||||
"@reown/appkit-wallet-button": "^1.7.17",
|
||||
"@tanstack/react-query": "^5.84.1",
|
||||
"@waku/sdk": "^0.0.30",
|
||||
"@waku/sdk": "^0.0.35-67a7287.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"cmdk": "^1.0.0",
|
||||
|
||||
@ -2,7 +2,7 @@ import { createDecoder, createEncoder } from '@waku/sdk';
|
||||
import { MessageType } from './types';
|
||||
import { CellMessage, PostMessage, CommentMessage, VoteMessage } from './types';
|
||||
import { CONTENT_TOPICS, NETWORK_CONFIG } from './constants';
|
||||
import { OpchanMessage } from '@/types';
|
||||
import { OpchanMessage } from '@/types/forum';
|
||||
|
||||
export const encoders = {
|
||||
[MessageType.CELL]: createEncoder({
|
||||
@ -21,6 +21,10 @@ export const encoders = {
|
||||
contentTopic: CONTENT_TOPICS['vote'],
|
||||
pubsubTopicShardInfo: {clusterId: NETWORK_CONFIG.clusterId, shard: 0}
|
||||
}),
|
||||
[MessageType.MODERATE]: createEncoder({
|
||||
contentTopic: CONTENT_TOPICS['moderate'],
|
||||
pubsubTopicShardInfo: {clusterId: NETWORK_CONFIG.clusterId, shard: 0}
|
||||
})
|
||||
}
|
||||
|
||||
export const decoders = {
|
||||
@ -40,6 +44,10 @@ export const decoders = {
|
||||
clusterId: NETWORK_CONFIG.clusterId,
|
||||
shard: 0
|
||||
}),
|
||||
[MessageType.MODERATE]: createDecoder(CONTENT_TOPICS['moderate'], {
|
||||
clusterId: NETWORK_CONFIG.clusterId,
|
||||
shard: 0
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import { NetworkConfig } from "@waku/sdk";
|
||||
import { MessageType } from "./types";
|
||||
|
||||
/**
|
||||
@ -12,7 +11,7 @@ export const CONTENT_TOPICS: Record<MessageType, string> = {
|
||||
[MessageType.MODERATE]: '/opchan/1/moderate/proto'
|
||||
};
|
||||
|
||||
export const NETWORK_CONFIG: NetworkConfig = {
|
||||
export const NETWORK_CONFIG = {
|
||||
// contentTopics: Object.values(CONTENT_TOPICS),
|
||||
clusterId: 1,
|
||||
shards: [0,1,2,3,4,5,6,7]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { LightNode } from "@waku/sdk";
|
||||
import { CellMessage, CommentMessage, MessageType, PostMessage, VoteMessage, ModerateMessage } from "./types";
|
||||
import { OpchanMessage } from "@/types";
|
||||
import { OpchanMessage } from "@/types/forum";
|
||||
import { encodeMessage, encoders, decoders, decodeMessage } from "./codec";
|
||||
|
||||
export class EphemeralProtocolsManager {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { IDecodedMessage } from '@waku/sdk';
|
||||
import { Cell, Post, Comment } from '@/types';
|
||||
import { Cell, Post, Comment } from '@/types/forum';
|
||||
import { CellMessage, CommentMessage, MessageType, PostMessage } from './types';
|
||||
import { OpchanMessage } from '@/types';
|
||||
import { OpchanMessage } from '@/types/forum';
|
||||
// Utility functions for converting between message types and application models
|
||||
export function cellToMessage(cell: Cell, sender: string): CellMessage {
|
||||
return {
|
||||
|
||||
@ -36,7 +36,7 @@ export interface Cell {
|
||||
name: string;
|
||||
description: string;
|
||||
icon?: string;
|
||||
signature: string; // Message signature
|
||||
signature?: string; // Message signature
|
||||
browserPubKey?: string; // Public key that signed the message
|
||||
relevanceScore?: number; // Calculated relevance score
|
||||
activeMemberCount?: number; // Number of active members in the cell
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user