/* 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 index.d.ts * @author Samuel Furter , Josh Stevens * @date 2018 */ import { PromiEvent, TransactionConfig, TransactionReceipt } from 'web3-core'; import { TransactionRevertInstructionError } from 'web3-core-helpers'; import { Eth } from 'web3-eth'; import { Contract } from 'web3-eth-contract'; export interface ContentHash { protocolType: 'ipfs' | 'bzz' | 'onion' | 'onion3' | null, decoded: string | null, error?: Error | null } // TODO: Define as soon as implemented the generic contract export class Ens { constructor(eth: Eth); registryAddress: string | null; registry: Registry; /** * @deprecated This callback signature is deprecated */ supportsInterface( name: string, interfaceId: string, callback?: (value: any) => void ): Promise; supportsInterface( name: string, interfaceId: string, callback?: (error: Error, supported: boolean) => void ): Promise; /** * @deprecated Please use the "getResolver" method instead of "resolver" */ resolver( name: string, callback?: (error: Error, contract: Contract) => void ): Promise; /** * @deprecated Please use the "getResolver" method instead of "resolver" */ resolver( name: string, callback?: (value: any) => void ): Promise; /** * @deprecated This callback signature is deprecated */ getResolver( name: string, callback?: (value: any) => void ): Promise; getResolver( name: string, callback?: (error: Error, contract: Contract) => void ): Promise; setResolver( name: string, address: string, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent setSubnodeOwner( name: string, label: string, address: string, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent setRecord( name: string, owner: string, resolver: string, ttl: number | string, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent setSubnodeRecord( name: string, label: string, owner: string, resolver: string, ttl: number | string, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent setApprovalForAll( operator: string, approved: boolean, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent /** * @deprecated This callback signature is deprecated */ isApprovedForAll( owner: string, operator: string, callback?: (value: any) => void ): Promise; isApprovedForAll( owner: string, operator: string, callback?: (error: Error, result: boolean) => void ): Promise; /** * @deprecated This callback signature is deprecated */ recordExists( name: string, callback?: (value: any) => void ): Promise; recordExists( name: string, callback?: (error: Error, result: boolean) => void ): Promise; /** * @deprecated This callback signature is deprecated */ getTTL( name: string, callback?: (value: any) => void ): Promise; getTTL( name: string, callback?: (error: Error, ttl: string) => void ): Promise; setTTL( name: string, ttl: string | number, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent; /** * @deprecated This callback signature is deprecated */ getOwner( name: string, callback?: (value: any) => void ): Promise; getOwner( name: string, callback?: (error: Error, owner: string) => void ): Promise; setOwner( name: string, address: string, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent; /** * @deprecated This callback signature is deprecated */ getAddress( name: string, callback?: (value: any) => void ): Promise; getAddress( name: string, callback?: (error: Error, address: string) => void ): Promise; setAddress( name: string, address: string, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent; /** * @deprecated This callback signature is deprecated */ getPubkey( name: string, callback?: (value: any) => void ): Promise<{ [x: string]: string }>; getPubkey( name: string, callback?: (error: Error, result: { [x: string]: string }) => void ): Promise<{ [x: string]: string }>; setPubkey( name: string, x: string, y: string, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent; /** * @deprecated This callback signature is deprecated */ getText( name: string, key: string, callback?: (value: any) => void ): Promise; getText( name: string, key: string, callback?: (error: Error, ensName: string) => void ): Promise; setText( name: string, key: string, value: string, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent; /** * @deprecated This callback signature is deprecated */ getContent( name: string, callback?: (value: any) => void ): Promise; getContent( name: string, callback?: (error: Error, contentHash: string) => void ): Promise; setContent( name: string, hash: string, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent; /** * @deprecated This callback signature is deprecated */ getMultihash( name: string, callback?: (value: any) => void ): Promise; getMultihash( name: string, callback?: (error: Error, multihash: string) => void ): Promise; setMultihash( name: string, hash: string, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent; /** * @deprecated This callback signature is deprecated */ getContenthash( name: string, callback?: (value: ContentHash) => void ): Promise; getContenthash( name: string, callback?: (error: Error, contenthash: ContentHash) => void ): Promise; setContenthash( name: string, hash: string, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent; } export class Registry { constructor(ens: Ens); ens: Ens; contract: Contract | null; /** * @deprecated Please use the "getOwner" method instead of "owner" */ owner( name: string, callback?: (error: Error, address: string) => void ): Promise; /** * @deprecated Please use the "getOwner" method instead of "owner" */ owner( name: string, callback?: (value: any) => void ): Promise; /** * @deprecated This callback signature is deprecated */ getOwner( name: string, callback?: (value: any) => void ): Promise; getOwner( name: string, callback?: (error: Error, address: string) => void ): Promise; setOwner( name: string, address: string, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent; /** * @deprecated This callback signature is deprecated */ getTTl( name: string, callback?: (value: any) => void ): Promise; getTTl( name: string, callback?: (error: Error, ttl: string) => void ): Promise; setTTL( name: string, ttl: string | number, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent; setSubnodeOwner( name: string, label: string, address: string, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent /** * @deprecated Please use the "getResolver" method instead of "resolver" */ resolver( name: string, callback?: (error: Error, contract: Contract) => void ): Promise; /** * @deprecated Please use the "getResolver" method instead of "resolver" */ resolver( name: string, callback?: (value: any) => void ): Promise; /** * @deprecated This callback signature is deprecated */ getResolver( name: string, callback?: (value: any) => void ): Promise; getResolver( name: string, callback?: (error: Error, contract: Contract) => void ): Promise; setResolver( name: string, address: string, txConfig?: TransactionConfig, callback?: (error: Error | TransactionRevertInstructionError, receipt: TransactionReceipt) => void ): PromiEvent }