chore: upgrade waku/sdk

This commit is contained in:
Danish Arora 2025-08-29 14:53:02 +05:30
parent d43d3bfec7
commit 9a70c59bc7
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E
7 changed files with 558 additions and 703 deletions

1238
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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",

View File

@ -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
})
}
/**

View File

@ -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]

View File

@ -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 {

View File

@ -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 {

View File

@ -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