remove debug
This commit is contained in:
parent
cc6f665f26
commit
020f20e801
|
@ -4,7 +4,7 @@
|
|||
"source": "./index.html",
|
||||
"browserslist": "> 0.5%, last 2 versions, not dead, not ios_saf < 13",
|
||||
"scripts": {
|
||||
"dev": "parcel --https --host 192.168.86.38 --port 8080",
|
||||
"dev": "parcel --https",
|
||||
"prebuild": "rm -rf dist",
|
||||
"build": "parcel build"
|
||||
},
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"prebuild": "rm -rf dist",
|
||||
"dev": "parcel --host 192.168.86.38 --port 8080",
|
||||
"dev": "parcel",
|
||||
"build": "parcel build",
|
||||
"debug": "parcel build src/debug.ts --dist-dir output",
|
||||
"build:vite": "vite build",
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
import { keccak256 } from 'ethereum-cryptography/keccak'
|
||||
import { getPublicKey, sign, utils } from 'ethereum-cryptography/secp256k1'
|
||||
import {
|
||||
bytesToHex,
|
||||
concatBytes,
|
||||
hexToBytes,
|
||||
} from 'ethereum-cryptography/utils'
|
||||
import { bytesToHex, concatBytes } from 'ethereum-cryptography/utils'
|
||||
|
||||
export class Account {
|
||||
public privateKey: string
|
||||
|
@ -17,9 +13,7 @@ export class Account {
|
|||
const chatKey = getPublicKey(privateKey, true)
|
||||
|
||||
this.privateKey = bytesToHex(privateKey)
|
||||
// this.publicKey = bytesToHex(publicKey)
|
||||
this.publicKey =
|
||||
'0x04ac419dac9a8bbb58825a3cde60eef0ee71b8cf6c63df611eeefc8e7aac7c79b55954b679d24cf5ec82da7ed921caf240628a9bfb3450c5111a9cffe54e631811'
|
||||
this.publicKey = bytesToHex(publicKey)
|
||||
|
||||
// TODO?: add 0x prefix to public key
|
||||
this.chatKey = bytesToHex(chatKey)
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
import { createClient } from '../src/client'
|
||||
|
||||
const COMMUNITY_PUBLIC_KEY =
|
||||
'0x029f196bbfef4fa6a5eb81dd802133a63498325445ca1af1d154b1bb4542955133' // Boring community
|
||||
// '0x0243611cc13cc4e4390180fe8fd35234ab0fe2a7ba8d32e8ae5dd23b60ac7ec177'
|
||||
// '0x02e7102c85ed78e5be30124f8f52014b1135f972c383f55f83ec8ff50436cd1260'
|
||||
const CHANNEL_ID =
|
||||
// '00d3f525-a0cf-4c40-832d-543ec9f8188b' // #messages
|
||||
'30804ea7-bd66-4d5d-91eb-b2dcfe2515b3' // #test-messages
|
||||
|
||||
;(async () => {
|
||||
const client = await createClient({ publicKey: COMMUNITY_PUBLIC_KEY })
|
||||
|
||||
await client.createAccount()
|
||||
|
||||
const communityMetadata = await client.community.fetchCommunity()
|
||||
console.log(communityMetadata)
|
||||
|
||||
const fetchChannelMessages =
|
||||
await client.community.createFetchChannelMessages(CHANNEL_ID, messages =>
|
||||
console.log(messages)
|
||||
)
|
||||
await fetchChannelMessages({ start: new Date('2022-06-08T08:00:00.000Z') })
|
||||
await fetchChannelMessages({ start: new Date('2022-06-08T08:45:00.000Z') })
|
||||
await fetchChannelMessages({ start: new Date('2022-01-01T08:00:00.000Z') })
|
||||
await fetchChannelMessages({ start: new Date('2021-01-01T08:00:00.000Z') }) // 2021
|
||||
|
||||
client.community.onCommunityUpdate(community => console.log(community))
|
||||
|
||||
client.community.onChannelMessageUpdate(CHANNEL_ID, messages =>
|
||||
console.log(messages)
|
||||
)
|
||||
|
||||
debugger
|
||||
|
||||
// await client.stop()
|
||||
})()
|
Loading…
Reference in New Issue