*Add removeRelay and clearRelays API methods

This commit is contained in:
Derrick Hammer 2022-07-20 18:03:10 -04:00
parent 2c41826632
commit 179bef1f9f
1 changed files with 80 additions and 69 deletions

View File

@ -42,6 +42,17 @@ export class DHT {
throw new Error(err); throw new Error(err);
} }
} }
public async removeRelay(pubkey: string): Promise<void> {
const [, err] = await callModule(DHT_MODULE, "removeRelay", {pubkey});
if (err) {
throw new Error(err);
}
}
public async clearRelays(): Promise<void> {
await callModule(DHT_MODULE, "clearRelays");
}
} }
export class Socket extends EventEmitter { export class Socket extends EventEmitter {