fishcake on Nostr: One fix for types: function nip44Encrypt(rumor: Rumor | VerifiedEvent, privateKey: ...
One fix for types:
function nip44Encrypt(rumor: Rumor | VerifiedEvent, privateKey: Uint8Array, publicKey: string): string {
const key = nip44.v2.utils.getConversationKey(privateKey, publicKey)
return nip44.v2.encrypt(JSON.stringify(rumor), key)
}
It does not have any impact, just cosmetics
Published at
2024-10-17 06:36:15Event JSON
{
"id": "60ab9d2eb8aef24ab04c008915b5784d1038d620f701541c14d9c4f3ced62e98",
"pubkey": "8fb140b4e8ddef97ce4b821d247278a1a4353362623f64021484b372f948000c",
"created_at": 1729146975,
"kind": 1,
"tags": [
[
"e",
"548879fbdf38a28775aa31b77288cf00ef467b4413471e71a58d9a7e5a4472e3",
"",
"root"
],
[
"e",
"be097f473f8d571f63e2c26e326c14b7a4944addc3de778517197cc4919b22d6",
"",
"reply"
],
[
"p",
"460c25e682fda7832b52d1f22d3d22b3176d972f60dcdc3212ed8c92ef85065c"
],
[
"p",
"e2ccf7cf20403f3f2a4a55b328f0de3be38558a7d5f33632fdaaefc726c1c8eb"
],
[
"p",
"dab9562a4b156617923fb2bb31d59bab075ffa5f1f885a811fba468cba18162e"
]
],
"content": "One fix for types:\n\nfunction nip44Encrypt(rumor: Rumor | VerifiedEvent, privateKey: Uint8Array, publicKey: string): string {\n const key = nip44.v2.utils.getConversationKey(privateKey, publicKey)\n return nip44.v2.encrypt(JSON.stringify(rumor), key)\n}\n\n\nIt does not have any impact, just cosmetics",
"sig": "9e408fe5e246b227333d197e31c2ae21b2a2dfbac4cf0d0562400fe91fb13ad24a2290ad1d76a147e29cece3f1dd4fcdf877dcfe54ad208ce1c96559e2045e4a"
}