Add client package

This commit is contained in:
Jon Staab
2026-04-28 16:08:41 -07:00
parent 48bf9d6ebe
commit e0e9ad5834
10 changed files with 497 additions and 26 deletions
+8
View File
@@ -162,10 +162,18 @@ export const getAdapter = (url: string, adapterContext: AdapterContext = {}) =>
}
if (url === LOCAL_RELAY_URL) {
if (!context.repository) {
throw new Error("LOCAL_RELAY_URL cannot be used without context.repository")
}
return new LocalAdapter(context.repository)
}
if (isRelayUrl(url)) {
if (!context.pool) {
throw new Error("Unable to connect to relays without context.pool")
}
return new SocketAdapter(context.pool.get(url))
}