mirror of https://github.com/embarklabs/embark.git
add ENS console commands
This commit is contained in:
parent
9a34a66d13
commit
159b74eb4b
|
@ -25,6 +25,34 @@ class ENS {
|
|||
this.addENSToEmbarkJS();
|
||||
this.configureContracts();
|
||||
this.registerEvents();
|
||||
this.registerConsoleCommands();
|
||||
}
|
||||
|
||||
|
||||
registerConsoleCommands() {
|
||||
this.embark.registerConsoleCommand((cmd, _options) => {
|
||||
let [cmdName, domain] = cmd.split(' ');
|
||||
return {
|
||||
match: () => cmdName === 'resolve',
|
||||
process: (cb) => global.EmbarkJS.Names.resolve(domain, cb)
|
||||
};
|
||||
});
|
||||
|
||||
this.embark.registerConsoleCommand((cmd, _options) => {
|
||||
let [cmdName, address] = cmd.split(' ');
|
||||
return {
|
||||
match: () => cmdName === 'lookup',
|
||||
process: (cb) => global.EmbarkJS.Names.lookup(address, cb)
|
||||
};
|
||||
});
|
||||
|
||||
this.embark.registerConsoleCommand((cmd, _options) => {
|
||||
let [cmdName, name, address] = cmd.split(' ');
|
||||
return {
|
||||
match: () => cmdName === 'registerSubDomain',
|
||||
process: (cb) => global.EmbarkJS.Names.registerSubDomain(name, address, cb)
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
registerEvents() {
|
||||
|
|
Loading…
Reference in New Issue