From 020f20e801c9872060ccda611271058b084ed76c Mon Sep 17 00:00:00 2001 From: Felicio Mununga Date: Fri, 10 Jun 2022 17:46:38 +0200 Subject: [PATCH] remove debug --- examples/community/package.json | 2 +- packages/status-js/package.json | 2 +- packages/status-js/src/account.ts | 10 ++------- packages/status-js/src/debug.ts | 37 ------------------------------- 4 files changed, 4 insertions(+), 47 deletions(-) delete mode 100644 packages/status-js/src/debug.ts diff --git a/examples/community/package.json b/examples/community/package.json index 6223190a..9ad69287 100644 --- a/examples/community/package.json +++ b/examples/community/package.json @@ -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" }, diff --git a/packages/status-js/package.json b/packages/status-js/package.json index 21bb908e..141f0c3b 100644 --- a/packages/status-js/package.json +++ b/packages/status-js/package.json @@ -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", diff --git a/packages/status-js/src/account.ts b/packages/status-js/src/account.ts index 77b75e93..e292e767 100644 --- a/packages/status-js/src/account.ts +++ b/packages/status-js/src/account.ts @@ -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) diff --git a/packages/status-js/src/debug.ts b/packages/status-js/src/debug.ts deleted file mode 100644 index 50e2a356..00000000 --- a/packages/status-js/src/debug.ts +++ /dev/null @@ -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() -})()