mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-10 22:16:20 +00:00
starting to create registration and some changes to the deployment
Signed-off-by: VoR0220 <catalanor0220@gmail.com>
This commit is contained in:
parent
c872c36de8
commit
e3e9d2c962
@ -251,3 +251,26 @@ __embarkENS.isAvailable = function () {
|
||||
__embarkENS.register = function () {
|
||||
return new Error("Not available with ENS");
|
||||
};
|
||||
|
||||
__embarkENS.register = function (name, options) {
|
||||
const self = this;
|
||||
|
||||
if (self.ens === undefined) return;
|
||||
|
||||
if (options.livenet) {
|
||||
return;
|
||||
}
|
||||
|
||||
let node = namehash.hash(name);
|
||||
|
||||
return self.ens.methods.owner(node).call().then((owner) => {
|
||||
if (owner !== "0x" || owner !== undefined) {
|
||||
console.warn("name has already been claimed, see owner: ", owner);
|
||||
return;
|
||||
}
|
||||
return self.ens.methods.setSubnodeOwner(node, );
|
||||
}).then((addr) => {
|
||||
|
||||
return addr;
|
||||
}).catch(err => err);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user