From a321cf0859f90d2333edfd366e8031be38ed0317 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 20 Jul 2022 18:03:37 -0400 Subject: [PATCH] *Update dist --- dist/index.d.ts | 2 ++ dist/index.d.ts.map | 2 +- dist/index.js | 9 +++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dist/index.d.ts b/dist/index.d.ts index 686e762..107da91 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -7,6 +7,8 @@ export declare class DHT { connect(pubkey: string): Promise; ready(): Promise; addRelay(pubkey: string): Promise; + removeRelay(pubkey: string): Promise; + clearRelays(): Promise; } export declare class Socket extends EventEmitter { private id; diff --git a/dist/index.d.ts.map b/dist/index.d.ts.map index f4e9920..f68b3d4 100644 --- a/dist/index.d.ts.map +++ b/dist/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAU,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAehC,qBAAa,GAAG;IACD,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ/C,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC;IAInB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAMrD;AAED,qBAAa,MAAO,SAAQ,YAAY;IACtC,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,YAAY,CAAqC;gBAE7C,EAAE,EAAE,MAAM;IAKtB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI;IAkB/D,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,IAAI;IAStC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIrC,GAAG,IAAI,IAAI;IAIX,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,UAAU;CAInB"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAQA,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAS,QAAQ,EAAC,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAC;AAe9B,qBAAa,GAAG;IACC,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ/C,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC;IAInB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOvC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO1C,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5C;AAED,qBAAa,MAAO,SAAQ,YAAY;IACpC,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,YAAY,CAAqC;gBAE7C,EAAE,EAAE,MAAM;IAKtB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI;IAkB/D,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,IAAI;IAStC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIrC,GAAG,IAAI,IAAI;IAIX,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,UAAU;CAIrB"} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index f5c9ed9..93f437b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -28,6 +28,15 @@ export class DHT { throw new Error(err); } } + async removeRelay(pubkey) { + const [, err] = await callModule(DHT_MODULE, "removeRelay", { pubkey }); + if (err) { + throw new Error(err); + } + } + async clearRelays() { + await callModule(DHT_MODULE, "clearRelays"); + } } export class Socket extends EventEmitter { id;