store-sigits and update working flow #116
@ -37,13 +37,11 @@ import {
|
|||||||
RelayMap,
|
RelayMap,
|
||||||
RelayReadStats,
|
RelayReadStats,
|
||||||
RelayStats,
|
RelayStats,
|
||||||
Rumor,
|
|
||||||
SignedEvent
|
SignedEvent
|
||||||
} from '../types'
|
} from '../types'
|
||||||
import {
|
import {
|
||||||
compareObjects,
|
compareObjects,
|
||||||
getNsecBunkerDelegatedKey,
|
getNsecBunkerDelegatedKey,
|
||||||
randomNow,
|
|
||||||
verifySignedEvent
|
verifySignedEvent
|
||||||
} from '../utils'
|
} from '../utils'
|
||||||
|
|
||||||
@ -306,24 +304,6 @@ export class NostrController extends EventEmitter {
|
|||||||
return event
|
return event
|
||||||
}
|
}
|
||||||
|
|
||||||
createSeal = async (rumor: Rumor, receiver: string) => {
|
|
||||||
const encryptedContent = await this.nip44Encrypt(
|
|
||||||
receiver,
|
|
||||||
JSON.stringify(rumor)
|
|
||||||
)
|
|
||||||
|
|
||||||
const unsignedEvent: UnsignedEvent = {
|
|
||||||
kind: 13,
|
|
||||||
content: encryptedContent,
|
|
||||||
created_at: randomNow(),
|
|
||||||
tags: [],
|
|
||||||
pubkey: (store.getState().auth as AuthState).usersPubkey!
|
|
||||||
}
|
|
||||||
|
|
||||||
const signedEvent = await this.signEvent(unsignedEvent)
|
|
||||||
return signedEvent
|
|
||||||
}
|
|
||||||
|
|
||||||
nip44Encrypt = async (receiver: string, content: string) => {
|
nip44Encrypt = async (receiver: string, content: string) => {
|
||||||
const loginMethod = (store.getState().auth as AuthState).loginMethod
|
const loginMethod = (store.getState().auth as AuthState).loginMethod
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user