15 lines
592 B
JavaScript
Raw Normal View History

2018-09-01 08:22:34 -04:00
import EmbarkJS from 'Embark/EmbarkJS';
import web3 from "Embark/web3";
2018-09-01 08:22:34 -04:00
import ENSRegistry from 'Embark/contracts/ENSRegistry';
import PublicResolver from 'Embark/contracts/PublicResolver';
const { methods: { owner, resolver } } = ENSRegistry;
export const nullAddress = '0x0000000000000000000000000000000000000000';
export const getResolver = async node => {
const resolverAddress = await resolver(node).call();
return resolverAddress !== nullAddress
? new EmbarkJS.Blockchain.Contract({ abi: PublicResolver._jsonInterface, address: resolverAddress, web3 })
2018-09-01 08:22:34 -04:00
: PublicResolver
}