Remove relay package, move everything into net
This commit is contained in:
@@ -208,7 +208,7 @@ export type SendWrappedOptions = Omit<ThunkOptions, "event" | "relays"> & {
|
||||
recipients: string[]
|
||||
}
|
||||
|
||||
export const sendWrapped = async ({event, recipients, ...options}: SendWrappedOptions) =>
|
||||
export const sendWrapped = ({event, recipients, ...options}: SendWrappedOptions) =>
|
||||
new MergedThunk(
|
||||
uniq(recipients).map(recipient => {
|
||||
const relays = Router.get().PubkeyInbox(recipient).getUrls()
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import {throttle} from "@welshman/lib"
|
||||
import {Repository, LocalRelay, Tracker} from "@welshman/relay"
|
||||
import {Repository, Tracker} from "@welshman/net"
|
||||
import {custom} from "@welshman/store"
|
||||
|
||||
export const tracker = new Tracker()
|
||||
|
||||
export const repository = Repository.get()
|
||||
|
||||
export const relay = new LocalRelay(repository)
|
||||
|
||||
// Adapt objects to stores
|
||||
|
||||
export const makeRepositoryStore = ({throttle: t = 300}: {throttle?: number} = {}) =>
|
||||
|
||||
@@ -13,8 +13,8 @@ import {
|
||||
getPubkey,
|
||||
ISigner,
|
||||
} from "@welshman/signer"
|
||||
import {WrapManager} from "@welshman/relay"
|
||||
import {relay, tracker} from "./core.js"
|
||||
import {WrapManager} from "@welshman/net"
|
||||
import {tracker, repository} from "./core.js"
|
||||
|
||||
export enum SessionMethod {
|
||||
Nip01 = "nip01",
|
||||
@@ -279,7 +279,7 @@ export const nip44EncryptToSelf = (payload: string) => {
|
||||
|
||||
// Gift wrap utilities
|
||||
|
||||
export const wrapManager = new WrapManager({relay, tracker})
|
||||
export const wrapManager = new WrapManager({repository, tracker})
|
||||
|
||||
export const shouldUnwrap = withGetter(writable(false))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user