@ensdomains/ensjs 3.0.0-alpha.20 → 3.0.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{functions/renewName.js → contracts/bulkRenewal.js} +6 -14
- package/dist/cjs/contracts/getContractAddress.js +2 -1
- package/dist/cjs/contracts/index.js +5 -0
- package/dist/cjs/functions/deleteSubname.js +40 -8
- package/dist/cjs/functions/getPrice.js +55 -8
- package/dist/cjs/functions/getSubnames.js +30 -94
- package/dist/cjs/functions/renewNames.js +42 -0
- package/dist/cjs/generated/BulkRenewal.js +16 -0
- package/dist/cjs/generated/factories/BulkRenewal__factory.js +120 -0
- package/dist/cjs/generated/factories/index.js +2 -0
- package/dist/cjs/generated/index.js +2 -0
- package/dist/cjs/index.js +5 -4
- package/dist/cjs/utils/registerHelpers.js +2 -1
- package/dist/esm/contracts/bulkRenewal.mjs +6 -0
- package/dist/esm/contracts/getContractAddress.mjs +2 -1
- package/dist/esm/contracts/index.mjs +5 -0
- package/dist/esm/functions/deleteSubname.mjs +40 -8
- package/dist/esm/functions/getPrice.mjs +56 -9
- package/dist/esm/functions/getSubnames.mjs +30 -94
- package/dist/esm/functions/renewNames.mjs +23 -0
- package/dist/esm/generated/BulkRenewal.mjs +0 -0
- package/dist/esm/generated/factories/BulkRenewal__factory.mjs +108 -0
- package/dist/esm/generated/factories/index.mjs +2 -0
- package/dist/esm/generated/index.mjs +2 -0
- package/dist/esm/index.mjs +5 -4
- package/dist/esm/utils/registerHelpers.mjs +2 -1
- package/dist/types/contracts/bulkRenewal.d.ts +3 -0
- package/dist/types/contracts/index.d.ts +1 -0
- package/dist/types/contracts/types.d.ts +1 -1
- package/dist/types/functions/commitName.d.ts +1 -1
- package/dist/types/functions/deleteSubname.d.ts +5 -2
- package/dist/types/functions/getPrice.d.ts +2 -2
- package/dist/types/functions/getSubnames.d.ts +1 -1
- package/dist/types/functions/registerName.d.ts +2 -5
- package/dist/types/functions/{renewName.d.ts → renewNames.d.ts} +2 -2
- package/dist/types/generated/BulkRenewal.d.ts +76 -0
- package/dist/types/generated/factories/BulkRenewal__factory.d.ts +32 -0
- package/dist/types/generated/factories/index.d.ts +1 -0
- package/dist/types/generated/index.d.ts +2 -0
- package/dist/types/index.d.ts +5 -5
- package/dist/types/utils/fuses.d.ts +2 -0
- package/dist/types/utils/registerHelpers.d.ts +13 -9
- package/package.json +1 -1
- package/src/contracts/bulkRenewal.ts +6 -0
- package/src/contracts/getContractAddress.ts +1 -0
- package/src/contracts/index.ts +6 -0
- package/src/contracts/types.ts +1 -0
- package/src/functions/deleteSubname.ts +51 -11
- package/src/functions/getNames.test.ts +10 -1
- package/src/functions/getPrice.test.ts +52 -0
- package/src/functions/getPrice.ts +61 -9
- package/src/functions/getProfile.test.ts +5 -1
- package/src/functions/getSubnames.test.ts +669 -29
- package/src/functions/getSubnames.ts +39 -98
- package/src/functions/registerName.ts +2 -5
- package/src/functions/{renewName.test.ts → renewNames.test.ts} +22 -2
- package/src/functions/renewNames.ts +30 -0
- package/src/generated/BulkRenewal.ts +197 -0
- package/src/generated/factories/BulkRenewal__factory.ts +108 -0
- package/src/generated/factories/index.ts +1 -0
- package/src/generated/index.ts +2 -0
- package/src/index.ts +6 -5
- package/src/utils/fuses.ts +3 -1
- package/src/utils/registerHelpers.ts +18 -9
- package/dist/esm/functions/renewName.mjs +0 -14
- package/src/functions/renewName.ts +0 -22
|
@@ -1,12 +1,44 @@
|
|
|
1
1
|
// src/functions/deleteSubname.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { ethers } from "ethers";
|
|
3
|
+
import { namehash } from "../utils/normalise.mjs";
|
|
4
|
+
async function deleteSubname_default({ contracts, signer }, name, { contract }) {
|
|
5
|
+
const labels = name.split(".");
|
|
6
|
+
if (labels.length !== 3) {
|
|
7
|
+
throw new Error("ENS.js currently only supports deleting 2LDs, not TLDs");
|
|
8
|
+
}
|
|
9
|
+
if (labels[2] !== "eth") {
|
|
10
|
+
throw new Error("ENS.js currently only supports deleting .eth 2LDs");
|
|
11
|
+
}
|
|
12
|
+
const label = labels.shift();
|
|
13
|
+
const labelhash = ethers.utils.solidityKeccak256(["string"], [label]);
|
|
14
|
+
const parentNodehash = namehash(labels.join("."));
|
|
15
|
+
switch (contract) {
|
|
16
|
+
case "registry": {
|
|
17
|
+
const registry = (await contracts.getRegistry()).connect(signer);
|
|
18
|
+
return registry.populateTransaction.setSubnodeRecord(
|
|
19
|
+
parentNodehash,
|
|
20
|
+
labelhash,
|
|
21
|
+
"0x0000000000000000000000000000000000000000",
|
|
22
|
+
"0x0000000000000000000000000000000000000000",
|
|
23
|
+
0
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
case "nameWrapper": {
|
|
27
|
+
const nameWrapper = (await contracts.getNameWrapper()).connect(signer);
|
|
28
|
+
return nameWrapper.populateTransaction.setSubnodeRecord(
|
|
29
|
+
parentNodehash,
|
|
30
|
+
label,
|
|
31
|
+
"0x0000000000000000000000000000000000000000",
|
|
32
|
+
"0x0000000000000000000000000000000000000000",
|
|
33
|
+
0,
|
|
34
|
+
0,
|
|
35
|
+
0
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
default: {
|
|
39
|
+
throw new Error(`Unknown contract: ${contract}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
10
42
|
}
|
|
11
43
|
export {
|
|
12
44
|
deleteSubname_default as default
|
|
@@ -1,11 +1,35 @@
|
|
|
1
1
|
// src/functions/getPrice.ts
|
|
2
|
-
import { utils } from "ethers";
|
|
3
|
-
var raw = async ({ contracts, multicallWrapper },
|
|
2
|
+
import { BigNumber, utils } from "ethers";
|
|
3
|
+
var raw = async ({ contracts, multicallWrapper }, nameOrNames, duration, legacy) => {
|
|
4
|
+
const names = Array.isArray(nameOrNames) ? nameOrNames : [nameOrNames];
|
|
5
|
+
if (names.length > 1) {
|
|
6
|
+
const bulkRenewal = await contracts?.getBulkRenewal();
|
|
7
|
+
const baseCall2 = {
|
|
8
|
+
to: bulkRenewal.address,
|
|
9
|
+
data: bulkRenewal.interface.encodeFunctionData("rentPrice", [
|
|
10
|
+
names,
|
|
11
|
+
duration
|
|
12
|
+
])
|
|
13
|
+
};
|
|
14
|
+
if (legacy) {
|
|
15
|
+
return multicallWrapper.raw([
|
|
16
|
+
baseCall2,
|
|
17
|
+
{
|
|
18
|
+
to: bulkRenewal.address,
|
|
19
|
+
data: bulkRenewal.interface.encodeFunctionData("rentPrice", [
|
|
20
|
+
names,
|
|
21
|
+
0
|
|
22
|
+
])
|
|
23
|
+
}
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
return baseCall2;
|
|
27
|
+
}
|
|
4
28
|
const controller = await contracts?.getEthRegistrarController();
|
|
5
29
|
const baseCall = {
|
|
6
30
|
to: controller.address,
|
|
7
31
|
data: controller.interface.encodeFunctionData("rentPrice", [
|
|
8
|
-
|
|
32
|
+
names[0],
|
|
9
33
|
duration
|
|
10
34
|
])
|
|
11
35
|
};
|
|
@@ -14,20 +38,42 @@ var raw = async ({ contracts, multicallWrapper }, name, duration, legacy) => {
|
|
|
14
38
|
baseCall,
|
|
15
39
|
{
|
|
16
40
|
to: controller.address,
|
|
17
|
-
data: controller.interface.encodeFunctionData("rentPrice", [
|
|
41
|
+
data: controller.interface.encodeFunctionData("rentPrice", [
|
|
42
|
+
names[0],
|
|
43
|
+
0
|
|
44
|
+
])
|
|
18
45
|
}
|
|
19
46
|
]);
|
|
20
47
|
}
|
|
21
48
|
return baseCall;
|
|
22
49
|
};
|
|
23
|
-
var decode = async ({ contracts, multicallWrapper }, data,
|
|
50
|
+
var decode = async ({ contracts, multicallWrapper }, data, _nameOrNames, _duration, legacy) => {
|
|
24
51
|
if (data === null)
|
|
25
52
|
return;
|
|
26
|
-
const controller = await contracts?.getEthRegistrarController();
|
|
27
53
|
try {
|
|
28
54
|
let base;
|
|
29
55
|
let premium;
|
|
30
|
-
|
|
56
|
+
const isBulkRenewal = Array.isArray(_nameOrNames) && _nameOrNames.length > 1;
|
|
57
|
+
if (isBulkRenewal && legacy) {
|
|
58
|
+
const result = await multicallWrapper.decode(data);
|
|
59
|
+
const [price] = utils.defaultAbiCoder.decode(
|
|
60
|
+
["uint256"],
|
|
61
|
+
result[0].returnData
|
|
62
|
+
);
|
|
63
|
+
[premium] = utils.defaultAbiCoder.decode(
|
|
64
|
+
["uint256"],
|
|
65
|
+
result[1].returnData
|
|
66
|
+
);
|
|
67
|
+
base = price.sub(premium);
|
|
68
|
+
} else if (isBulkRenewal) {
|
|
69
|
+
const bulkRenewal = await contracts?.getBulkRenewal();
|
|
70
|
+
const result = bulkRenewal.interface.decodeFunctionResult(
|
|
71
|
+
"rentPrice",
|
|
72
|
+
data
|
|
73
|
+
);
|
|
74
|
+
[base] = result;
|
|
75
|
+
premium = BigNumber.from(0);
|
|
76
|
+
} else if (!isBulkRenewal && legacy) {
|
|
31
77
|
const result = await multicallWrapper.decode(data);
|
|
32
78
|
const [price] = utils.defaultAbiCoder.decode(
|
|
33
79
|
["uint256"],
|
|
@@ -39,11 +85,12 @@ var decode = async ({ contracts, multicallWrapper }, data, _name, _number, legac
|
|
|
39
85
|
);
|
|
40
86
|
base = price.sub(premium);
|
|
41
87
|
} else {
|
|
42
|
-
;
|
|
43
|
-
|
|
88
|
+
const controller = await contracts?.getEthRegistrarController();
|
|
89
|
+
const result = controller.interface.decodeFunctionResult(
|
|
44
90
|
"rentPrice",
|
|
45
91
|
data
|
|
46
92
|
);
|
|
93
|
+
[base, premium] = result[0];
|
|
47
94
|
}
|
|
48
95
|
return {
|
|
49
96
|
base,
|
|
@@ -2,15 +2,36 @@
|
|
|
2
2
|
import { truncateFormat } from "../utils/format.mjs";
|
|
3
3
|
import { decryptName } from "../utils/labels.mjs";
|
|
4
4
|
import { namehash } from "../utils/normalise.mjs";
|
|
5
|
-
var largeQuery = async ({ gqlInstance }, {
|
|
5
|
+
var largeQuery = async ({ gqlInstance }, {
|
|
6
|
+
name,
|
|
7
|
+
pageSize = 10,
|
|
8
|
+
orderDirection,
|
|
9
|
+
orderBy,
|
|
10
|
+
lastSubnames = [],
|
|
11
|
+
search = ""
|
|
12
|
+
}) => {
|
|
6
13
|
const { client } = gqlInstance;
|
|
14
|
+
const lastSubname = lastSubnames?.[lastSubnames.length - 1];
|
|
15
|
+
const lastCreatedAt = lastSubname?.createdAt;
|
|
16
|
+
const lastLabelName = lastSubname?.labelName;
|
|
17
|
+
let whereFilter = "";
|
|
18
|
+
if (orderBy === "createdAt" && lastCreatedAt) {
|
|
19
|
+
whereFilter += orderDirection === "asc" ? "createdAt_gt: $lastCreatedAt" : "createdAt_lt: $lastCreatedAt";
|
|
20
|
+
} else if (orderBy === "labelName" && lastLabelName) {
|
|
21
|
+
whereFilter += orderDirection === "asc" ? "labelName_gt: $lastLabelName" : "labelName_lt: $lastLabelName";
|
|
22
|
+
}
|
|
23
|
+
if (search) {
|
|
24
|
+
whereFilter += " labelName_contains: $search";
|
|
25
|
+
}
|
|
7
26
|
const finalQuery = gqlInstance.gql`
|
|
8
27
|
query getSubnames(
|
|
9
28
|
$id: ID!
|
|
10
29
|
$first: Int
|
|
11
30
|
$lastCreatedAt: BigInt
|
|
31
|
+
$lastLabelName: String
|
|
12
32
|
$orderBy: Domain_orderBy
|
|
13
33
|
$orderDirection: OrderDirection
|
|
34
|
+
$search: String
|
|
14
35
|
) {
|
|
15
36
|
domain(
|
|
16
37
|
id: $id
|
|
@@ -20,7 +41,9 @@ var largeQuery = async ({ gqlInstance }, { name, pageSize = 10, orderDirection,
|
|
|
20
41
|
first: $first
|
|
21
42
|
orderBy: $orderBy
|
|
22
43
|
orderDirection: $orderDirection
|
|
23
|
-
where: {
|
|
44
|
+
where: {
|
|
45
|
+
${whereFilter}
|
|
46
|
+
}
|
|
24
47
|
) {
|
|
25
48
|
id
|
|
26
49
|
labelName
|
|
@@ -39,9 +62,11 @@ var largeQuery = async ({ gqlInstance }, { name, pageSize = 10, orderDirection,
|
|
|
39
62
|
const queryVars = {
|
|
40
63
|
id: namehash(name),
|
|
41
64
|
first: pageSize,
|
|
42
|
-
lastCreatedAt
|
|
65
|
+
lastCreatedAt,
|
|
66
|
+
lastLabelName,
|
|
43
67
|
orderBy,
|
|
44
|
-
orderDirection
|
|
68
|
+
orderDirection,
|
|
69
|
+
search: search?.toLowerCase()
|
|
45
70
|
};
|
|
46
71
|
const { domain } = await client.request(finalQuery, queryVars);
|
|
47
72
|
const subdomains = domain.subdomains.map((subname) => {
|
|
@@ -57,97 +82,8 @@ var largeQuery = async ({ gqlInstance }, { name, pageSize = 10, orderDirection,
|
|
|
57
82
|
subnameCount: domain.subdomainCount
|
|
58
83
|
};
|
|
59
84
|
};
|
|
60
|
-
var smallQuery = async ({ gqlInstance }, { name, page, pageSize = 10, orderDirection, orderBy }) => {
|
|
61
|
-
const { client } = gqlInstance;
|
|
62
|
-
const subdomainsGql = `
|
|
63
|
-
id
|
|
64
|
-
labelName
|
|
65
|
-
labelhash
|
|
66
|
-
isMigrated
|
|
67
|
-
name
|
|
68
|
-
subdomainCount
|
|
69
|
-
createdAt
|
|
70
|
-
owner {
|
|
71
|
-
id
|
|
72
|
-
}
|
|
73
|
-
`;
|
|
74
|
-
let queryVars = {};
|
|
75
|
-
let finalQuery = "";
|
|
76
|
-
if (typeof page !== "number") {
|
|
77
|
-
finalQuery = gqlInstance.gql`
|
|
78
|
-
query getSubnames(
|
|
79
|
-
$id: ID!
|
|
80
|
-
$orderBy: Domain_orderBy
|
|
81
|
-
$orderDirection: OrderDirection
|
|
82
|
-
) {
|
|
83
|
-
domain(
|
|
84
|
-
id: $id
|
|
85
|
-
) {
|
|
86
|
-
subdomains(
|
|
87
|
-
orderBy: $orderBy
|
|
88
|
-
orderDirection: $orderDirection
|
|
89
|
-
) {
|
|
90
|
-
${subdomainsGql}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
`;
|
|
95
|
-
queryVars = {
|
|
96
|
-
id: namehash(name),
|
|
97
|
-
orderBy,
|
|
98
|
-
orderDirection
|
|
99
|
-
};
|
|
100
|
-
} else {
|
|
101
|
-
finalQuery = gqlInstance.gql`
|
|
102
|
-
query getSubnames(
|
|
103
|
-
$id: ID!
|
|
104
|
-
$first: Int
|
|
105
|
-
$skip: Int
|
|
106
|
-
$orderBy: Domain_orderBy
|
|
107
|
-
$orderDirection: OrderDirection
|
|
108
|
-
) {
|
|
109
|
-
domain(
|
|
110
|
-
id: $id
|
|
111
|
-
) {
|
|
112
|
-
subdomainCount
|
|
113
|
-
subdomains(
|
|
114
|
-
first: $first
|
|
115
|
-
skip: $skip
|
|
116
|
-
orderBy: $orderBy
|
|
117
|
-
orderDirection: $orderDirection
|
|
118
|
-
) {
|
|
119
|
-
${subdomainsGql}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
`;
|
|
124
|
-
queryVars = {
|
|
125
|
-
id: namehash(name),
|
|
126
|
-
first: pageSize,
|
|
127
|
-
skip: (page || 0) * pageSize,
|
|
128
|
-
orderBy,
|
|
129
|
-
orderDirection
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
const { domain } = await client.request(finalQuery, queryVars);
|
|
133
|
-
const subdomains = domain.subdomains.map((subname) => {
|
|
134
|
-
const decrypted = decryptName(subname.name);
|
|
135
|
-
return {
|
|
136
|
-
...subname,
|
|
137
|
-
name: decrypted,
|
|
138
|
-
truncatedName: truncateFormat(decrypted)
|
|
139
|
-
};
|
|
140
|
-
});
|
|
141
|
-
return {
|
|
142
|
-
subnames: subdomains,
|
|
143
|
-
subnameCount: domain.subdomainCount
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
85
|
var getSubnames = (injected, functionArgs) => {
|
|
147
|
-
|
|
148
|
-
return largeQuery(injected, functionArgs);
|
|
149
|
-
}
|
|
150
|
-
return smallQuery(injected, functionArgs);
|
|
86
|
+
return largeQuery(injected, functionArgs);
|
|
151
87
|
};
|
|
152
88
|
var getSubnames_default = getSubnames;
|
|
153
89
|
export {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// src/functions/renewNames.ts
|
|
2
|
+
async function renewNames_default({ contracts }, nameOrNames, {
|
|
3
|
+
duration,
|
|
4
|
+
value
|
|
5
|
+
}) {
|
|
6
|
+
const names = Array.isArray(nameOrNames) ? nameOrNames : [nameOrNames];
|
|
7
|
+
const labels = names.map((name) => {
|
|
8
|
+
const label = name.split(".");
|
|
9
|
+
if (label.length !== 2 || label[1] !== "eth") {
|
|
10
|
+
throw new Error("Currently only .eth TLD renewals are supported");
|
|
11
|
+
}
|
|
12
|
+
return label[0];
|
|
13
|
+
});
|
|
14
|
+
if (labels.length === 1) {
|
|
15
|
+
const controller = await contracts.getEthRegistrarController();
|
|
16
|
+
return controller.populateTransaction.renew(labels[0], duration, { value });
|
|
17
|
+
}
|
|
18
|
+
const bulkRenewal = await contracts.getBulkRenewal();
|
|
19
|
+
return bulkRenewal.populateTransaction.renewAll(labels, duration, { value });
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
renewNames_default as default
|
|
23
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
// src/generated/factories/BulkRenewal__factory.ts
|
|
9
|
+
import { Contract, utils } from "ethers";
|
|
10
|
+
var _abi = [
|
|
11
|
+
{
|
|
12
|
+
inputs: [
|
|
13
|
+
{
|
|
14
|
+
internalType: "contract ENS",
|
|
15
|
+
name: "_ens",
|
|
16
|
+
type: "address"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
stateMutability: "nonpayable",
|
|
20
|
+
type: "constructor"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
inputs: [],
|
|
24
|
+
name: "ens",
|
|
25
|
+
outputs: [
|
|
26
|
+
{
|
|
27
|
+
internalType: "contract ENS",
|
|
28
|
+
name: "",
|
|
29
|
+
type: "address"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
stateMutability: "view",
|
|
33
|
+
type: "function"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
inputs: [
|
|
37
|
+
{
|
|
38
|
+
internalType: "string[]",
|
|
39
|
+
name: "names",
|
|
40
|
+
type: "string[]"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
internalType: "uint256",
|
|
44
|
+
name: "duration",
|
|
45
|
+
type: "uint256"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
name: "renewAll",
|
|
49
|
+
outputs: [],
|
|
50
|
+
stateMutability: "payable",
|
|
51
|
+
type: "function"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
inputs: [
|
|
55
|
+
{
|
|
56
|
+
internalType: "string[]",
|
|
57
|
+
name: "names",
|
|
58
|
+
type: "string[]"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
internalType: "uint256",
|
|
62
|
+
name: "duration",
|
|
63
|
+
type: "uint256"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
name: "rentPrice",
|
|
67
|
+
outputs: [
|
|
68
|
+
{
|
|
69
|
+
internalType: "uint256",
|
|
70
|
+
name: "total",
|
|
71
|
+
type: "uint256"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
stateMutability: "view",
|
|
75
|
+
type: "function"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
inputs: [
|
|
79
|
+
{
|
|
80
|
+
internalType: "bytes4",
|
|
81
|
+
name: "interfaceID",
|
|
82
|
+
type: "bytes4"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
name: "supportsInterface",
|
|
86
|
+
outputs: [
|
|
87
|
+
{
|
|
88
|
+
internalType: "bool",
|
|
89
|
+
name: "",
|
|
90
|
+
type: "bool"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
stateMutability: "pure",
|
|
94
|
+
type: "function"
|
|
95
|
+
}
|
|
96
|
+
];
|
|
97
|
+
var BulkRenewal__factory = class {
|
|
98
|
+
static createInterface() {
|
|
99
|
+
return new utils.Interface(_abi);
|
|
100
|
+
}
|
|
101
|
+
static connect(address, signerOrProvider) {
|
|
102
|
+
return new Contract(address, _abi, signerOrProvider);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
__publicField(BulkRenewal__factory, "abi", _abi);
|
|
106
|
+
export {
|
|
107
|
+
BulkRenewal__factory
|
|
108
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// src/generated/factories/index.ts
|
|
2
2
|
import { BaseRegistrarImplementation__factory } from "./BaseRegistrarImplementation__factory.mjs";
|
|
3
|
+
import { BulkRenewal__factory } from "./BulkRenewal__factory.mjs";
|
|
3
4
|
import { DNSRegistrar__factory } from "./DNSRegistrar__factory.mjs";
|
|
4
5
|
import { DNSSECImpl__factory } from "./DNSSECImpl__factory.mjs";
|
|
5
6
|
import { DefaultReverseResolver__factory } from "./DefaultReverseResolver__factory.mjs";
|
|
@@ -21,6 +22,7 @@ import { TLDPublicSuffixList__factory } from "./TLDPublicSuffixList__factory.mjs
|
|
|
21
22
|
import { UniversalResolver__factory } from "./UniversalResolver__factory.mjs";
|
|
22
23
|
export {
|
|
23
24
|
BaseRegistrarImplementation__factory,
|
|
25
|
+
BulkRenewal__factory,
|
|
24
26
|
DNSRegistrar__factory,
|
|
25
27
|
DNSSECImpl__factory,
|
|
26
28
|
DefaultReverseResolver__factory,
|
|
@@ -20,8 +20,10 @@ import { Multicall__factory } from "./factories/Multicall__factory.mjs";
|
|
|
20
20
|
import { NameWrapper__factory } from "./factories/NameWrapper__factory.mjs";
|
|
21
21
|
import { StaticMetadataService__factory } from "./factories/StaticMetadataService__factory.mjs";
|
|
22
22
|
import { UniversalResolver__factory } from "./factories/UniversalResolver__factory.mjs";
|
|
23
|
+
import { BulkRenewal__factory } from "./factories/BulkRenewal__factory.mjs";
|
|
23
24
|
export {
|
|
24
25
|
BaseRegistrarImplementation__factory,
|
|
26
|
+
BulkRenewal__factory,
|
|
25
27
|
DNSRegistrar__factory,
|
|
26
28
|
DNSSECImpl__factory,
|
|
27
29
|
DefaultReverseResolver__factory,
|
package/dist/esm/index.mjs
CHANGED
|
@@ -280,7 +280,7 @@ var ENS = class {
|
|
|
280
280
|
);
|
|
281
281
|
deleteSubname = this.generateWriteFunction(
|
|
282
282
|
"deleteSubname",
|
|
283
|
-
["
|
|
283
|
+
["contracts"]
|
|
284
284
|
);
|
|
285
285
|
transferSubname = this.generateWriteFunction(
|
|
286
286
|
"transferSubname",
|
|
@@ -294,9 +294,10 @@ var ENS = class {
|
|
|
294
294
|
"registerName",
|
|
295
295
|
["contracts"]
|
|
296
296
|
);
|
|
297
|
-
|
|
298
|
-
"
|
|
299
|
-
|
|
297
|
+
renewNames = this.generateWriteFunction(
|
|
298
|
+
"renewNames",
|
|
299
|
+
["contracts"]
|
|
300
|
+
);
|
|
300
301
|
};
|
|
301
302
|
export {
|
|
302
303
|
ENS
|
|
@@ -4,6 +4,7 @@ import generateFuseInput from "./generateFuseInput.mjs";
|
|
|
4
4
|
import { labelhash } from "./labels.mjs";
|
|
5
5
|
import { namehash } from "./normalise.mjs";
|
|
6
6
|
import { generateRecordCallArray } from "./recordHelpers.mjs";
|
|
7
|
+
var MAX_INT_64 = 2n ** 64n - 1n;
|
|
7
8
|
var randomSecret = () => {
|
|
8
9
|
const bytes = Buffer.allocUnsafe(32);
|
|
9
10
|
return `0x${crypto.getRandomValues(bytes).toString("hex")}`;
|
|
@@ -42,7 +43,7 @@ var makeCommitmentData = ({
|
|
|
42
43
|
secret,
|
|
43
44
|
!!reverseRecord,
|
|
44
45
|
fuseData,
|
|
45
|
-
wrapperExpiry ||
|
|
46
|
+
wrapperExpiry || MAX_INT_64
|
|
46
47
|
];
|
|
47
48
|
};
|
|
48
49
|
var makeRegistrationData = (params) => {
|
|
@@ -13,4 +13,5 @@ export default class ContractManager {
|
|
|
13
13
|
getBaseRegistrar: (passedProvider?: any, address?: string) => Promise<import("../generated/BaseRegistrarImplementation").BaseRegistrarImplementation>;
|
|
14
14
|
getEthRegistrarController: (passedProvider?: any, address?: string) => Promise<import("../generated/ETHRegistrarController").ETHRegistrarController>;
|
|
15
15
|
getMulticall: (passedProvider?: any, address?: string) => Promise<import("../generated/Multicall").Multicall>;
|
|
16
|
+
getBulkRenewal: (passedProvider?: any, address?: string) => Promise<import("../generated/BulkRenewal").BulkRenewal>;
|
|
16
17
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare type SupportedNetworkId = '1' | '3' | '4' | '5' | '1337';
|
|
2
|
-
export declare type ContractName = 'BaseRegistrarImplementation' | 'ETHRegistrarController' | 'Multicall' | 'NameWrapper' | 'PublicResolver' | 'ENSRegistryWithFallback' | 'ReverseRegistrar' | 'UniversalResolver';
|
|
2
|
+
export declare type ContractName = 'BaseRegistrarImplementation' | 'ETHRegistrarController' | 'Multicall' | 'NameWrapper' | 'PublicResolver' | 'ENSRegistryWithFallback' | 'ReverseRegistrar' | 'UniversalResolver' | 'BulkRenewal';
|
|
@@ -7,7 +7,7 @@ export default function ({ contracts }: ENSArgs<'contracts'>, name: string, { re
|
|
|
7
7
|
customData: {
|
|
8
8
|
secret: string;
|
|
9
9
|
commitment: string;
|
|
10
|
-
wrapperExpiry:
|
|
10
|
+
wrapperExpiry: import("ethers").BigNumberish;
|
|
11
11
|
};
|
|
12
12
|
to?: string | undefined;
|
|
13
13
|
from?: string | undefined;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { ethers } from 'ethers';
|
|
1
2
|
import { ENSArgs } from '..';
|
|
2
|
-
|
|
3
|
+
declare type Args = {
|
|
3
4
|
contract: 'registry' | 'nameWrapper';
|
|
4
|
-
}
|
|
5
|
+
};
|
|
6
|
+
export default function ({ contracts, signer }: ENSArgs<'contracts' | 'signer' | 'getExpiry'>, name: string, { contract }: Args): Promise<ethers.PopulatedTransaction>;
|
|
7
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BigNumber } from 'ethers';
|
|
2
2
|
import { ENSArgs } from '..';
|
|
3
3
|
declare const _default: {
|
|
4
|
-
raw: ({ contracts, multicallWrapper }: ENSArgs<"contracts" | "multicallWrapper">,
|
|
4
|
+
raw: ({ contracts, multicallWrapper }: ENSArgs<"contracts" | "multicallWrapper">, nameOrNames: string | string[], duration: number, legacy?: boolean | undefined) => Promise<{
|
|
5
5
|
to: string;
|
|
6
6
|
data: string;
|
|
7
7
|
}>;
|
|
8
|
-
decode: ({ contracts, multicallWrapper }: ENSArgs<"contracts" | "multicallWrapper">, data: string,
|
|
8
|
+
decode: ({ contracts, multicallWrapper }: ENSArgs<"contracts" | "multicallWrapper">, data: string, _nameOrNames: string | string[], _duration: number, legacy?: boolean | undefined) => Promise<{
|
|
9
9
|
base: BigNumber;
|
|
10
10
|
premium: BigNumber;
|
|
11
11
|
} | undefined>;
|
|
@@ -17,7 +17,7 @@ declare type Params = {
|
|
|
17
17
|
orderDirection?: 'asc' | 'desc';
|
|
18
18
|
orderBy?: 'createdAt' | 'labelName';
|
|
19
19
|
lastSubnames?: Array<any>;
|
|
20
|
-
|
|
20
|
+
search?: string;
|
|
21
21
|
};
|
|
22
22
|
declare const getSubnames: (injected: ENSArgs<'gqlInstance'>, functionArgs: Params) => Promise<{
|
|
23
23
|
subnames: Subname[];
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { BigNumber } from 'ethers';
|
|
2
2
|
import { ENSArgs } from '..';
|
|
3
|
-
import {
|
|
4
|
-
declare type Params =
|
|
5
|
-
resolverAddress?: string;
|
|
6
|
-
secret: string;
|
|
7
|
-
wrapperExpiry: number;
|
|
3
|
+
import { BaseRegistrationParams } from '../utils/registerHelpers';
|
|
4
|
+
declare type Params = BaseRegistrationParams & {
|
|
8
5
|
value: BigNumber;
|
|
9
6
|
};
|
|
10
7
|
export default function ({ contracts }: ENSArgs<'contracts'>, name: string, { resolverAddress, value, ...params }: Params): Promise<import("ethers").PopulatedTransaction>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BigNumber } from 'ethers';
|
|
2
2
|
import { ENSArgs } from '..';
|
|
3
|
-
export default function ({ contracts }: ENSArgs<'contracts'>,
|
|
3
|
+
export default function ({ contracts }: ENSArgs<'contracts'>, nameOrNames: string | string[], { duration, value, }: {
|
|
4
4
|
duration: number;
|
|
5
5
|
value: BigNumber;
|
|
6
6
|
}): Promise<import("ethers").PopulatedTransaction>;
|