Remove relay package, move everything into net
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import {PublishStatus} from "@welshman/net"
|
||||
import {PublishStatus, LOCAL_RELAY_URL} from "@welshman/net"
|
||||
import {NOTE, DIRECT_MESSAGE, WRAP, makeEvent} from "@welshman/util"
|
||||
import {LOCAL_RELAY_URL} from "@welshman/relay"
|
||||
import {getPubkey, makeSecret, prep} from "@welshman/signer"
|
||||
import {afterEach, beforeEach, describe, expect, it, vi} from "vitest"
|
||||
import {repository, tracker} from "../src/core"
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
"@types/throttle-debounce": "^5.0.2",
|
||||
"@welshman/feeds": "workspace:*",
|
||||
"@welshman/lib": "workspace:*",
|
||||
"@welshman/relay": "workspace:*",
|
||||
"@welshman/router": "workspace:*",
|
||||
"@welshman/net": "workspace:*",
|
||||
"@welshman/signer": "workspace:*",
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
"paths": {
|
||||
"@welshman/feeds": ["../feeds/src/index.js"],
|
||||
"@welshman/lib": ["../lib/src/index.js"],
|
||||
"@welshman/relay": ["../relay/src/index.js"],
|
||||
"@welshman/net": ["../net/src/index.js"],
|
||||
"@welshman/signer": ["../signer/src/index.js"],
|
||||
"@welshman/store": ["../store/src/index.js"],
|
||||
|
||||
Reference in New Issue
Block a user