/*
This file is part of web3.js.
web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with web3.js. If not, see .
*/
/**
* @file ens-test.ts
* @author Samuel Furter , Josh Stevens
* @date 2018
*/
import { Ens } from 'web3-eth-ens';
import { Eth } from 'web3-eth';
const ens = new Ens(new Eth('http://localhost:8545'));
// $ExpectType Registry
ens.registry;
// $ExpectType Promise
ens.resolver('name');
// $ExpectType Promise
ens.supportsInterface('name', 'interfaceId');
// $ExpectType Promise
ens.supportsInterface(
'name',
'interfaceId',
(error: Error, supportsInterface: boolean) => {}
);
// $ExpectType Promise
ens.getAddress('name');
// $ExpectType Promise
ens.getAddress('name', (error: Error, address: string) => {});
// $ExpectType PromiEvent
ens.setAddress('name', 'address', {});
// $ExpectType PromiEvent
ens.setAddress('name', 'address', {}, (error: Error, result: any) => {});
// $ExpectType Promise<{ [x: string]: string; }>
ens.getPubkey('name');
// $ExpectType Promise<{ [x: string]: string; }>
ens.getPubkey('name', (error: Error, result: { [x: string]: string }) => {});
// $ExpectType PromiEvent
ens.setPubkey('name', 'x', 'y', {});
// $ExpectType PromiEvent
ens.setPubkey('name', 'x', 'y', {}, (error: Error, result: any) => {});
// $ExpectType Promise
ens.getText('name', 'key');
// $ExpectType Promise
ens.getText('name', 'key', (error: Error, ensName: string) => {});
// $ExpectType PromiEvent
ens.setText('name', 'key', 'value', {});
// $ExpectType PromiEvent
ens.setText('name', 'key', 'value', {}, (error: Error, result: any) => {});
// $ExpectType Promise
ens.getContent('name');
// $ExpectType Promise
ens.getContent('name', (error: Error, contentHash: string) => {});
// $ExpectType PromiEvent
ens.setContent('name', 'hash', {});
// $ExpectType PromiEvent
ens.setContent('name', 'hash', {}, (error: Error, result: any) => {});
// $ExpectType Promise
ens.getMultihash('name');
// $ExpectType Promise
ens.getMultihash('name', (error: Error, multihash: string) => {});
// $ExpectType PromiEvent
ens.setMultihash('name', 'hash', {});
// $ExpectType PromiEvent
ens.setMultihash('name', 'hash', {}, (error: Error, result: any) => {});
// $ExpectType Promise
ens.getContenthash('name');
// $ExpectType Promise
ens.getContenthash('name', (error: Error, contenthash: string) => {});
// $ExpectType PromiEvent
ens.setContenthash('name', 'hash', {});
// $ExpectType PromiEvent
ens.setContenthash('name', 'hash', {}, (error: Error, result: any) => {});