This repository has been archived by the owner on Jan 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.d.ts
133 lines (133 loc) · 6.05 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import { ethers } from 'ethers';
export declare function getDate(date: Date): string;
export declare function getDateTimer(timestamp: Date): string;
export declare const interfaces: {
ens: ethers.utils.Interface;
testRegistrar: ethers.utils.Interface;
hashRegistrar: ethers.utils.Interface;
reverseRegistrar: ethers.utils.Interface;
simpleRegistrar: ethers.utils.Interface;
resolver: ethers.utils.Interface;
};
export declare enum ABIEncodings {
JSON = 1,
zlibJSON = 2,
CBOR = 4,
URI = 8
}
export interface Auction {
state: string;
winningDeed: string;
endDate: Date;
revealDate: Date;
value: ethers.utils.BigNumber;
highestBid: ethers.utils.BigNumber;
}
export interface ENSTransactionResponse extends ethers.providers.TransactionResponse {
metadata: {
[key: string]: any;
};
}
interface Bid {
address: string;
bidAmount: ethers.utils.BigNumber;
salt: string;
sealedBid: string;
registrar: HashRegistrarContract;
name: string;
labelHash: string;
}
interface EnsContract {
address: string;
connect(signer: ethers.Signer): EnsContract;
owner(nodeHash: string): Promise<string>;
resolver(nodeHash: string): Promise<string>;
ttl(nodeHash: string): Promise<ethers.utils.BigNumber>;
setOwner(nodeHash: string, owner: string): Promise<ENSTransactionResponse>;
setSubnodeOwner(node: string, label: string, owner: string): Promise<ENSTransactionResponse>;
setResolver(nodeHash: string, resolver: string): Promise<ENSTransactionResponse>;
}
interface ResolverContract {
address: string;
connect(signer: ethers.Signer): ResolverContract;
supportsInterface(interfaceId: string): Promise<boolean>;
addr(nodeHash: string): Promise<string>;
setAddr(nodeHash: string, addr: string): Promise<ENSTransactionResponse>;
name(nodeHash: string): Promise<string>;
setName(nodeHash: string, name: string): Promise<ENSTransactionResponse>;
pubkey(nodeHash: string): Promise<{
x: string;
y: string;
}>;
setPubkey(nodeHash: string, x: string, y: string): Promise<ENSTransactionResponse>;
text(nodeHash: string, key: string): Promise<string>;
setText(nodeHash: string, key: string, value: string): Promise<ENSTransactionResponse>;
ABI(nodeHash: string): Promise<{
type: number;
data: Uint8Array;
}>;
setABI(nodeHash: string, type: number, data: Uint8Array): Promise<ENSTransactionResponse>;
contenthash(nodeHash: string): Promise<string>;
content(nodeHash: string): Promise<string>;
setContenthash(nodeHash: string, contentHash: Uint8Array): Promise<ENSTransactionResponse>;
}
interface HashRegistrarContract {
address: string;
connect(signer: ethers.Signer): HashRegistrarContract;
entries(labelHash: string): Promise<{
state: number;
winningDeed: string;
endDate: ethers.utils.BigNumber;
value: ethers.utils.BigNumber;
highestBid: ethers.utils.BigNumber;
}>;
getAllowedTime(labelHash: string): Promise<ethers.utils.BigNumber>;
shaBid(labelHash: string, owner: string, bidAmount: ethers.utils.BigNumberish, salt: ethers.utils.Arrayish): Promise<string>;
startAuction(labelHash: string): Promise<ENSTransactionResponse>;
newBid(sealedBid: string, options?: {
value: ethers.utils.BigNumberish;
}): Promise<ENSTransactionResponse>;
unsealBid(labelHash: string, bidAmount: ethers.utils.BigNumberish, salt: ethers.utils.Arrayish): Promise<ENSTransactionResponse>;
finalizeAuction(labelHash: string): Promise<ENSTransactionResponse>;
}
export declare class ENS {
readonly provider: ethers.providers.Provider;
readonly signer: ethers.Signer;
private _ens;
private _hashRegistrar;
constructor(providerOrSigner: ethers.providers.Provider | ethers.Signer);
getAuctionStartDate(name: string): Promise<Date>;
getAuction(name: string): Promise<Auction>;
startAuction(name: string): Promise<ENSTransactionResponse>;
finalizeAuction(name: string): Promise<ENSTransactionResponse>;
getBidHash(name: string, address: string, bidAmount: ethers.utils.BigNumber, salt: ethers.utils.Arrayish): Promise<string>;
_getBid(name: string, bidAmount: ethers.utils.BigNumber, salt: ethers.utils.Arrayish): Promise<Bid>;
placeBid(name: string, amount: ethers.utils.BigNumberish, salt: ethers.utils.Arrayish, extraAmount?: ethers.utils.BigNumberish): Promise<ENSTransactionResponse>;
getDeedAddress(address: string, bidHash: string): Promise<string>;
revealBid(name: string, bidAmount: ethers.utils.BigNumberish, salt: ethers.utils.Arrayish): Promise<ENSTransactionResponse>;
setSubnodeOwner(parentName: string, label: string, owner: string): Promise<ENSTransactionResponse>;
getResolver(name: string): Promise<string>;
setResolver(name: string, address: string): Promise<ENSTransactionResponse>;
getOwner(name: string): Promise<string>;
setOwner(name: string, owner: string): Promise<ENSTransactionResponse>;
getDeedOwner(address: string): Promise<string>;
lookupAddress(address: string): Promise<string>;
resolveName(name: string): Promise<string>;
setReverseName(name: string): Promise<ENSTransactionResponse>;
setAddress(name: string, addr: string): Promise<ENSTransactionResponse>;
getAddress(name: string): Promise<string>;
setName(address: string, name: string): Promise<ENSTransactionResponse>;
setPublicKey(name: string, publicKey: string): Promise<ENSTransactionResponse>;
getPublicKey(name: string, compressed?: boolean): Promise<string>;
setText(name: string, key: string, value: string): Promise<ENSTransactionResponse>;
getText(name: string, key: string): Promise<string>;
setContentHash(name: string, contentHash: string): Promise<ENSTransactionResponse>;
getContentHash(name: string, legacy?: boolean): Promise<string>;
_getResolver(name: string, interfaceId?: string): Promise<ResolverContract>;
_getEns(): Promise<EnsContract>;
_getHashRegistrar(name: string): Promise<{
registrar: HashRegistrarContract;
labelHash: string;
}>;
}
export {};