diff --git a/dist/index.d.ts b/dist/index.d.ts
new file mode 100644
index 0000000..36654a3
--- /dev/null
+++ b/dist/index.d.ts
@@ -0,0 +1,12 @@
+///
+export interface Peer {
+ host: string;
+ port: number;
+}
+export type PeerSource = (pubkey: Buffer) => Promise;
+export declare class PeerDiscovery {
+ private _sources;
+ registerSource(name: string, source: PeerSource): boolean;
+ removeSource(name: string): boolean;
+ discover(pubkey: string | Buffer): Promise;
+}
diff --git a/dist/index.js b/dist/index.js
new file mode 100644
index 0000000..6b881dc
--- /dev/null
+++ b/dist/index.js
@@ -0,0 +1,38 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.PeerDiscovery = void 0;
+const b4a_1 = __importDefault(require("b4a"));
+class PeerDiscovery {
+ _sources = new Map();
+ registerSource(name, source) {
+ if (this._sources.has(name)) {
+ return false;
+ }
+ this._sources.set(name, source);
+ return true;
+ }
+ removeSource(name) {
+ if (!this._sources.has(name)) {
+ return false;
+ }
+ this._sources.delete(name);
+ return true;
+ }
+ async discover(pubkey) {
+ if (!b4a_1.default.isBuffer(pubkey)) {
+ pubkey = b4a_1.default.from(pubkey, "hex");
+ }
+ for (const source of this._sources.values()) {
+ const result = await source(pubkey);
+ if (result) {
+ return result;
+ }
+ }
+ return false;
+ }
+}
+exports.PeerDiscovery = PeerDiscovery;
+//# sourceMappingURL=index.js.map
\ No newline at end of file