Update publish
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import {now} from "@welshman/lib"
|
||||
import {Nip01Signer} from "@welshman/signer"
|
||||
import {TrustedEvent, StampedEvent, Filter} from "@welshman/util"
|
||||
import {request, MultiPublish, PublishEvent, AdapterContext} from "@welshman/net"
|
||||
import {request, publish, AdapterContext} from "@welshman/net"
|
||||
|
||||
export type DVMHandler = {
|
||||
stop?: () => void
|
||||
@@ -118,8 +118,6 @@ export class DVM {
|
||||
const {relays, context} = this.opts
|
||||
const event = await this.signer.sign(template)
|
||||
|
||||
await new Promise<void>(resolve => {
|
||||
new MultiPublish({event, relays, context}).on(PublishEvent.Complete, resolve)
|
||||
})
|
||||
await publish({event, relays, context})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {Emitter, now} from "@welshman/lib"
|
||||
import {TrustedEvent, SignedEvent, Filter} from "@welshman/util"
|
||||
import {request, MultiPublish, AdapterContext} from "@welshman/net"
|
||||
import {request, publish, AdapterContext} from "@welshman/net"
|
||||
|
||||
export enum DVMEvent {
|
||||
Progress = "progress",
|
||||
@@ -19,7 +19,6 @@ export type DVMRequestOptions = {
|
||||
export type DVMRequest = {
|
||||
options: DVMRequestOptions
|
||||
emitter: Emitter
|
||||
pub: MultiPublish
|
||||
}
|
||||
|
||||
export const makeDvmRequest = (options: DVMRequestOptions) => {
|
||||
@@ -56,8 +55,8 @@ export const makeDvmRequest = (options: DVMRequestOptions) => {
|
||||
},
|
||||
})
|
||||
|
||||
const pub = new MultiPublish({relays, event, timeout, context})
|
||||
publish({relays, event, timeout, context})
|
||||
|
||||
|
||||
return {options, emitter, pub} as DVMRequest
|
||||
return {options, emitter} as DVMRequest
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user