use new api

This commit is contained in:
danisharora099 2023-02-09 12:57:45 +05:30
parent 22ec6ae33b
commit 52c62fea12
No known key found for this signature in database
GPG Key ID: FBD2BF500037F135
2 changed files with 3 additions and 5 deletions

View File

@ -1,8 +1,7 @@
import * as React from "react";
import protobuf from "protobufjs";
import { createRelayNode } from "@waku/create";
import { waitForRemotePeer } from "@waku/core";
import { createDecoder, createEncoder } from "@waku/core";
import { createDecoder, createEncoder, waitForRemotePeer } from "@waku/core";
const ContentTopic = `/js-waku-examples/1/chat/proto`;
const Encoder = createEncoder(ContentTopic);

View File

@ -1,12 +1,11 @@
import * as React from "react";
import protobuf from "protobufjs";
import { createLightNode } from "@waku/create";
import { waitForRemotePeer } from "@waku/core";
import { Decoder } from "@waku/core/lib/message/version_0";
import { waitForRemotePeer, createDecoder } from "@waku/core";
import { bytesToUtf8 } from "@waku/byte-utils";
const ContentTopic = "/toy-chat/2/huilong/proto";
const decoder = new Decoder(ContentTopic);
const decoder = createDecoder(ContentTopic);
const ProtoChatMessage = new protobuf.Type("ChatMessage")
.add(new protobuf.Field("timestamp", 1, "uint64"))