*Add method to remove a relay and clear relays

This commit is contained in:
Derrick Hammer 2022-06-27 16:25:53 -04:00
parent e9bbdeac38
commit 5e3de30f51
1 changed files with 15 additions and 0 deletions

View File

@ -69,6 +69,21 @@ export default class RpcNetwork {
this._relays = [...new Set(this._relays)];
}
public removeRelay(pubkey: string): boolean {
if (!this._relays.includes(pubkey)) {
return false;
}
delete this._relays[this._relays.indexOf(pubkey)];
this._relays = Object.values(this._relays);
return true;
}
public clearRelays(): void {
this._relays = [];
}
public query(
query: string,
chain: string,