From 33e15a3dbe2070b0bc5e80a15313b1fe4a6be994 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Mon, 30 Jul 2018 12:47:04 +0100 Subject: [PATCH] Add register function for IPNS --- src/names.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/names.js b/src/names.js index 9d95abc..7394e51 100644 --- a/src/names.js +++ b/src/names.js @@ -46,4 +46,11 @@ Names.registerSubDomain = function(name, address, callback) { return this.currentNameSystems.registerSubDomain(name, address, callback); }; +Names.register = function(name, callback) { + if (!this.currentNameSystems) { + throw new Error(this.noProviderError); + } + return this.currentNameSystems.register(name, callback); +}; + export default Names;