wakuconnect-chat-sdk/packages/status-js/.scripts/example copy 2.ts

25 lines
688 B
TypeScript
Raw Normal View History

2022-05-26 21:17:10 +00:00
import { createClient } from '../src/client'
2022-05-25 12:52:48 +00:00
import { Community } from '../src/community'
2022-05-29 18:20:35 +00:00
// import { Messenger } from '../src/messenger'
2022-05-25 12:52:48 +00:00
2022-05-26 21:17:10 +00:00
const COMMUNITY_PUBLIC_KEY =
'0x029dd5fecbd689dc11e2a5b399afed92cf1fab65d315b883efca753e8f3882f3bd' // compressed
2022-05-25 12:52:48 +00:00
;(async () => {
const client = await createClient()
2022-05-29 18:20:35 +00:00
// Community (e.g. description, channels, channel messages)
2022-05-26 21:17:10 +00:00
const community = await Community.instantiateCommunity(
COMMUNITY_PUBLIC_KEY,
client
)
2022-05-25 12:52:48 +00:00
2022-05-29 18:20:35 +00:00
// // Messenger/Messages (e.g. direct messages)
2022-05-25 12:52:48 +00:00
// const messenger = await Messenger.create(, client)
// // TODO: Register observers/callbacks
// messenger.addObserver(() => {})
await client.stop()
})()