@ensdomains/ensjs 3.0.0-alpha.37 → 3.0.0-alpha.38
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/LICENSE +1 -1
- package/README.md +7 -0
- package/dist/cjs/GqlManager.js +22 -20
- package/dist/cjs/contracts/getContractAddress.js +1 -1
- package/dist/cjs/contracts/index.js +44 -46
- package/dist/cjs/functions/batchWrappers.js +6 -6
- package/dist/cjs/functions/createSubname.js +1 -1
- package/dist/cjs/functions/getAvailable.js +2 -2
- package/dist/cjs/functions/getDNSOwner.js +4 -2
- package/dist/cjs/functions/getExpiry.js +4 -4
- package/dist/cjs/functions/getName.js +2 -2
- package/dist/cjs/functions/getNames.js +6 -6
- package/dist/cjs/functions/getOwner.js +10 -9
- package/dist/cjs/functions/getPrice.js +4 -4
- package/dist/cjs/functions/getProfile.js +10 -10
- package/dist/cjs/functions/getResolver.js +2 -2
- package/dist/cjs/functions/getSpecificRecord.js +6 -6
- package/dist/cjs/functions/getSubnames.js +4 -4
- package/dist/cjs/functions/getWrapperData.js +2 -2
- package/dist/cjs/functions/importDNSSECName.js +5 -5
- package/dist/cjs/functions/setName.js +3 -2
- package/dist/cjs/functions/setRecord.js +2 -1
- package/dist/cjs/functions/setRecords.js +2 -1
- package/dist/cjs/functions/setResolver.js +2 -2
- package/dist/cjs/functions/supportsTLD.js +1 -1
- package/dist/cjs/functions/transferController.js +2 -2
- package/dist/cjs/functions/transferName.js +3 -3
- package/dist/cjs/functions/wrapName.js +3 -3
- package/dist/cjs/generated/factories/BaseRegistrarImplementation__factory.js +1 -1
- package/dist/cjs/generated/factories/BulkRenewal__factory.js +1 -1
- package/dist/cjs/generated/factories/DNSRegistrar__factory.js +1 -1
- package/dist/cjs/generated/factories/DNSSECImpl__factory.js +1 -1
- package/dist/cjs/generated/factories/DefaultReverseResolver__factory.js +1 -1
- package/dist/cjs/generated/factories/ENSRegistry__factory.js +1 -1
- package/dist/cjs/generated/factories/ETHRegistrarController__factory.js +1 -1
- package/dist/cjs/generated/factories/Multicall__factory.js +1 -1
- package/dist/cjs/generated/factories/NameWrapper__factory.js +1 -1
- package/dist/cjs/generated/factories/P256SHA256Algorithm__factory.js +1 -1
- package/dist/cjs/generated/factories/PublicResolver__factory.js +1 -1
- package/dist/cjs/generated/factories/RSASHA1Algorithm__factory.js +1 -1
- package/dist/cjs/generated/factories/RSASHA256Algorithm__factory.js +1 -1
- package/dist/cjs/generated/factories/ReverseRegistrar__factory.js +1 -1
- package/dist/cjs/generated/factories/Root__factory.js +1 -1
- package/dist/cjs/generated/factories/SHA1Digest__factory.js +1 -1
- package/dist/cjs/generated/factories/SHA1NSEC3Digest__factory.js +1 -1
- package/dist/cjs/generated/factories/SHA256Digest__factory.js +1 -1
- package/dist/cjs/generated/factories/StaticMetadataService__factory.js +1 -1
- package/dist/cjs/generated/factories/TLDPublicSuffixList__factory.js +1 -1
- package/dist/cjs/generated/factories/UniversalResolver__factory.js +1 -1
- package/dist/cjs/index.js +295 -296
- package/dist/cjs/utils/labels.js +1 -1
- package/dist/cjs/utils/recordHelpers.js +1 -1
- package/dist/cjs/utils/registerHelpers.js +2 -1
- package/dist/cjs/utils/wrapper.js +1 -1
- package/dist/esm/contracts/getContractAddress.mjs +1 -1
- package/dist/esm/index.mjs +4 -1
- package/package.json +1 -1
- package/src/contracts/getContractAddress.ts +1 -1
- package/src/index.ts +6 -2
package/dist/cjs/index.js
CHANGED
|
@@ -39,307 +39,306 @@ const graphURIEndpoints = {
|
|
|
39
39
|
5: "https://api.thegraph.com/subgraphs/name/ensdomains/ensgoerli"
|
|
40
40
|
};
|
|
41
41
|
class ENS {
|
|
42
|
-
options;
|
|
43
|
-
provider;
|
|
44
|
-
graphURI;
|
|
45
|
-
initialProvider;
|
|
46
|
-
contracts;
|
|
47
|
-
getContractAddress = import_getContractAddress.getContractAddress;
|
|
48
|
-
gqlInstance = new import_GqlManager.default();
|
|
49
42
|
constructor(options) {
|
|
50
|
-
this.
|
|
51
|
-
this.
|
|
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
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
43
|
+
this.getContractAddress = import_getContractAddress.getContractAddress;
|
|
44
|
+
this.gqlInstance = new import_GqlManager.default();
|
|
45
|
+
this.checkInitialProvider = async () => {
|
|
46
|
+
if (!this.initialProvider) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
await this.setProvider(this.initialProvider);
|
|
50
|
+
};
|
|
51
|
+
this.forwardDependenciesFromArray = (dependencies) => Object.fromEntries(
|
|
52
|
+
dependencies.map((dep) => [dep, this[dep]])
|
|
53
|
+
);
|
|
54
|
+
this.importGenerator = (path, dependencies, exportName = "default", subFunc, passthrough) => {
|
|
55
|
+
if (subFunc === "batch") {
|
|
56
|
+
return (...args) => ({ args, ...passthrough });
|
|
57
|
+
}
|
|
58
|
+
const thisRef = this;
|
|
59
|
+
const mainFunc = async function(...args) {
|
|
60
|
+
var _a, _b;
|
|
61
|
+
await thisRef.checkInitialProvider();
|
|
62
|
+
let mod = await import(
|
|
63
|
+
/* webpackMode: "lazy", webpackChunkName: "[request]", webpackPreload: true, webpackExclude: /.*\.ts$/ */
|
|
64
|
+
`./functions/${path}`
|
|
65
|
+
);
|
|
66
|
+
if ((_a = mod.default) == null ? void 0 : _a[exportName]) {
|
|
67
|
+
mod = mod.default;
|
|
68
|
+
}
|
|
69
|
+
if (subFunc !== "combine") {
|
|
70
|
+
const writeable = subFunc === "write" || subFunc === "populateTransaction";
|
|
71
|
+
const func = subFunc && !writeable ? mod[exportName][subFunc] : mod[exportName];
|
|
72
|
+
let dependenciesToForward2 = thisRef.forwardDependenciesFromArray(dependencies);
|
|
73
|
+
if (writeable) {
|
|
74
|
+
const options = args[1] || {};
|
|
75
|
+
const signer = options.signer || ((_b = thisRef.provider) == null ? void 0 : _b.getSigner(options.addressOrIndex));
|
|
76
|
+
const populate = subFunc === "populateTransaction";
|
|
77
|
+
if (!signer) {
|
|
78
|
+
throw new Error("No signer specified");
|
|
79
|
+
}
|
|
80
|
+
delete options.addressOrIndex;
|
|
81
|
+
delete options.signer;
|
|
82
|
+
dependenciesToForward2 = { ...dependenciesToForward2, signer };
|
|
83
|
+
return func(dependenciesToForward2, args[0], options).then(
|
|
84
|
+
(0, import_writeTx.default)(signer, populate)
|
|
85
|
+
);
|
|
83
86
|
}
|
|
84
|
-
|
|
85
|
-
delete options.signer;
|
|
86
|
-
dependenciesToForward2 = { ...dependenciesToForward2, signer };
|
|
87
|
-
return func(dependenciesToForward2, args[0], options).then(
|
|
88
|
-
(0, import_writeTx.default)(signer, populate)
|
|
89
|
-
);
|
|
87
|
+
return func(dependenciesToForward2, ...args);
|
|
90
88
|
}
|
|
91
|
-
|
|
89
|
+
const dependenciesToForward = thisRef.forwardDependenciesFromArray(dependencies);
|
|
90
|
+
return (0, import_singleCall.default)(
|
|
91
|
+
thisRef.provider,
|
|
92
|
+
dependenciesToForward,
|
|
93
|
+
mod[exportName],
|
|
94
|
+
...args
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
if (subFunc === "combine") {
|
|
98
|
+
mainFunc.raw = this.importGenerator(
|
|
99
|
+
path,
|
|
100
|
+
dependencies,
|
|
101
|
+
exportName,
|
|
102
|
+
"raw"
|
|
103
|
+
);
|
|
104
|
+
mainFunc.decode = this.importGenerator(
|
|
105
|
+
path,
|
|
106
|
+
dependencies,
|
|
107
|
+
exportName,
|
|
108
|
+
"decode"
|
|
109
|
+
);
|
|
110
|
+
mainFunc.batch = this.importGenerator(
|
|
111
|
+
path,
|
|
112
|
+
dependencies,
|
|
113
|
+
exportName,
|
|
114
|
+
"batch",
|
|
115
|
+
{ raw: mainFunc.raw, decode: mainFunc.decode }
|
|
116
|
+
);
|
|
117
|
+
} else if (subFunc === "write") {
|
|
118
|
+
mainFunc.populateTransaction = this.importGenerator(
|
|
119
|
+
path,
|
|
120
|
+
dependencies,
|
|
121
|
+
exportName,
|
|
122
|
+
"populateTransaction"
|
|
123
|
+
);
|
|
92
124
|
}
|
|
93
|
-
|
|
94
|
-
return (0, import_singleCall.default)(
|
|
95
|
-
thisRef.provider,
|
|
96
|
-
dependenciesToForward,
|
|
97
|
-
mod[exportName],
|
|
98
|
-
...args
|
|
99
|
-
);
|
|
125
|
+
return mainFunc;
|
|
100
126
|
};
|
|
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
|
-
"populateTransaction"
|
|
127
|
+
this.generateFunction = (path, dependencies, exportName = "default") => this.importGenerator(path, dependencies, exportName);
|
|
128
|
+
this.generateWriteFunction = (path, dependencies, exportName = "default") => this.importGenerator(
|
|
129
|
+
path,
|
|
130
|
+
dependencies,
|
|
131
|
+
exportName,
|
|
132
|
+
"write"
|
|
133
|
+
);
|
|
134
|
+
this.generateRawFunction = (path, dependencies, exportName = "default") => this.importGenerator(
|
|
135
|
+
path,
|
|
136
|
+
dependencies,
|
|
137
|
+
exportName,
|
|
138
|
+
"combine"
|
|
139
|
+
);
|
|
140
|
+
this.setProvider = async (provider) => {
|
|
141
|
+
this.provider = provider;
|
|
142
|
+
const network = (await this.provider.getNetwork()).chainId;
|
|
143
|
+
if (this.options && this.options.graphURI) {
|
|
144
|
+
this.graphURI = this.options.graphURI;
|
|
145
|
+
} else {
|
|
146
|
+
this.graphURI = graphURIEndpoints[network];
|
|
147
|
+
}
|
|
148
|
+
await this.gqlInstance.setUrl(this.graphURI);
|
|
149
|
+
this.contracts = new import_contracts.default(
|
|
150
|
+
this.provider,
|
|
151
|
+
this.getContractAddress(String(network))
|
|
127
152
|
);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
this.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
"
|
|
173
|
-
"
|
|
174
|
-
"
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
"
|
|
153
|
+
};
|
|
154
|
+
this.withProvider = (provider) => {
|
|
155
|
+
const newENS = new ENS(this.options);
|
|
156
|
+
newENS.initialProvider = provider;
|
|
157
|
+
return newENS;
|
|
158
|
+
};
|
|
159
|
+
this.batch = this.generateRawFunction(
|
|
160
|
+
"initialGetters",
|
|
161
|
+
["multicallWrapper"],
|
|
162
|
+
"batch"
|
|
163
|
+
);
|
|
164
|
+
this.getProfile = this.generateFunction(
|
|
165
|
+
"initialGetters",
|
|
166
|
+
[
|
|
167
|
+
"contracts",
|
|
168
|
+
"gqlInstance",
|
|
169
|
+
"getName",
|
|
170
|
+
"resolverMulticallWrapper",
|
|
171
|
+
"multicallWrapper",
|
|
172
|
+
"_getAddr",
|
|
173
|
+
"_getContentHash",
|
|
174
|
+
"_getText"
|
|
175
|
+
],
|
|
176
|
+
"getProfile"
|
|
177
|
+
);
|
|
178
|
+
this.getRecords = this.generateFunction(
|
|
179
|
+
"initialGetters",
|
|
180
|
+
["getProfile"],
|
|
181
|
+
"getRecords"
|
|
182
|
+
);
|
|
183
|
+
this.getName = this.generateRawFunction(
|
|
184
|
+
"initialGetters",
|
|
185
|
+
["contracts"],
|
|
186
|
+
"getName"
|
|
187
|
+
);
|
|
188
|
+
this.getResolver = this.generateRawFunction(
|
|
189
|
+
"getResolver",
|
|
190
|
+
["contracts"]
|
|
191
|
+
);
|
|
192
|
+
this.getWrapperData = this.generateRawFunction(
|
|
193
|
+
"getWrapperData",
|
|
194
|
+
["contracts"]
|
|
195
|
+
);
|
|
196
|
+
this.getHistory = this.generateFunction(
|
|
197
|
+
"getHistory",
|
|
198
|
+
["gqlInstance"],
|
|
199
|
+
"getHistory"
|
|
200
|
+
);
|
|
201
|
+
this.getContentHash = this.generateRawFunction(
|
|
202
|
+
"initialGetters",
|
|
203
|
+
["contracts", "universalWrapper"],
|
|
204
|
+
"getContentHash"
|
|
205
|
+
);
|
|
206
|
+
this._getContentHash = this.generateRawFunction(
|
|
207
|
+
"initialGetters",
|
|
208
|
+
["contracts"],
|
|
209
|
+
"_getContentHash"
|
|
210
|
+
);
|
|
211
|
+
this.getAddr = this.generateRawFunction(
|
|
212
|
+
"initialGetters",
|
|
213
|
+
["contracts", "universalWrapper"],
|
|
214
|
+
"getAddr"
|
|
215
|
+
);
|
|
216
|
+
this._getAddr = this.generateRawFunction(
|
|
217
|
+
"initialGetters",
|
|
218
|
+
["contracts"],
|
|
219
|
+
"_getAddr"
|
|
220
|
+
);
|
|
221
|
+
this.getText = this.generateRawFunction(
|
|
222
|
+
"initialGetters",
|
|
223
|
+
["contracts", "universalWrapper"],
|
|
224
|
+
"getText"
|
|
225
|
+
);
|
|
226
|
+
this._getText = this.generateRawFunction(
|
|
227
|
+
"initialGetters",
|
|
228
|
+
["contracts"],
|
|
178
229
|
"_getText"
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
"
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
"
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
"
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
"provider",
|
|
294
|
-
"getResolver"
|
|
295
|
-
]);
|
|
296
|
-
setResolver = this.generateWriteFunction(
|
|
297
|
-
"setResolver",
|
|
298
|
-
["contracts"]
|
|
299
|
-
);
|
|
300
|
-
transferName = this.generateWriteFunction(
|
|
301
|
-
"transferName",
|
|
302
|
-
["contracts"]
|
|
303
|
-
);
|
|
304
|
-
transferController = this.generateWriteFunction("transferController", ["contracts"]);
|
|
305
|
-
wrapName = this.generateWriteFunction("wrapName", [
|
|
306
|
-
"contracts",
|
|
307
|
-
"getExpiry"
|
|
308
|
-
]);
|
|
309
|
-
unwrapName = this.generateWriteFunction(
|
|
310
|
-
"unwrapName",
|
|
311
|
-
["contracts"]
|
|
312
|
-
);
|
|
313
|
-
burnFuses = this.generateWriteFunction("burnFuses", [
|
|
314
|
-
"contracts"
|
|
315
|
-
]);
|
|
316
|
-
importDNSSECName = this.generateWriteFunction(
|
|
317
|
-
"importDNSSECName",
|
|
318
|
-
["contracts", "provider", "signer"]
|
|
319
|
-
);
|
|
320
|
-
createSubname = this.generateWriteFunction(
|
|
321
|
-
"createSubname",
|
|
322
|
-
["contracts", "getExpiry"]
|
|
323
|
-
);
|
|
324
|
-
deleteSubname = this.generateWriteFunction(
|
|
325
|
-
"deleteSubname",
|
|
326
|
-
["contracts"]
|
|
327
|
-
);
|
|
328
|
-
transferSubname = this.generateWriteFunction(
|
|
329
|
-
"transferSubname",
|
|
330
|
-
["contracts", "getExpiry"]
|
|
331
|
-
);
|
|
332
|
-
commitName = this.generateWriteFunction(
|
|
333
|
-
"commitName",
|
|
334
|
-
["contracts"]
|
|
335
|
-
);
|
|
336
|
-
registerName = this.generateWriteFunction(
|
|
337
|
-
"registerName",
|
|
338
|
-
["contracts"]
|
|
339
|
-
);
|
|
340
|
-
renewNames = this.generateWriteFunction(
|
|
341
|
-
"renewNames",
|
|
342
|
-
["contracts"]
|
|
343
|
-
);
|
|
344
|
-
renewNameWithData = this.generateWriteFunction("renewNames", ["contracts"], "renewNameWithData");
|
|
230
|
+
);
|
|
231
|
+
this.getOwner = this.generateRawFunction(
|
|
232
|
+
"initialGetters",
|
|
233
|
+
["contracts", "multicallWrapper", "gqlInstance"],
|
|
234
|
+
"getOwner"
|
|
235
|
+
);
|
|
236
|
+
this.getExpiry = this.generateRawFunction(
|
|
237
|
+
"initialGetters",
|
|
238
|
+
["contracts", "multicallWrapper"],
|
|
239
|
+
"getExpiry"
|
|
240
|
+
);
|
|
241
|
+
this.getSubnames = this.generateFunction(
|
|
242
|
+
"initialGetters",
|
|
243
|
+
["gqlInstance"],
|
|
244
|
+
"getSubnames"
|
|
245
|
+
);
|
|
246
|
+
this.getNames = this.generateFunction(
|
|
247
|
+
"initialGetters",
|
|
248
|
+
["gqlInstance"],
|
|
249
|
+
"getNames"
|
|
250
|
+
);
|
|
251
|
+
this.getPrice = this.generateRawFunction(
|
|
252
|
+
"initialGetters",
|
|
253
|
+
["contracts", "multicallWrapper"],
|
|
254
|
+
"getPrice"
|
|
255
|
+
);
|
|
256
|
+
this.getDNSOwner = this.generateFunction(
|
|
257
|
+
"getDNSOwner",
|
|
258
|
+
[]
|
|
259
|
+
);
|
|
260
|
+
this.supportsTLD = this.generateFunction(
|
|
261
|
+
"initialGetters",
|
|
262
|
+
["getOwner", "provider"],
|
|
263
|
+
"supportsTLD"
|
|
264
|
+
);
|
|
265
|
+
this.getAvailable = this.generateRawFunction(
|
|
266
|
+
"getAvailable",
|
|
267
|
+
["contracts"]
|
|
268
|
+
);
|
|
269
|
+
this.universalWrapper = this.generateRawFunction(
|
|
270
|
+
"initialGetters",
|
|
271
|
+
["contracts"],
|
|
272
|
+
"universalWrapper"
|
|
273
|
+
);
|
|
274
|
+
this.resolverMulticallWrapper = this.generateRawFunction("initialGetters", ["contracts"], "resolverMulticallWrapper");
|
|
275
|
+
this.multicallWrapper = this.generateRawFunction(
|
|
276
|
+
"initialGetters",
|
|
277
|
+
["contracts"],
|
|
278
|
+
"multicallWrapper"
|
|
279
|
+
);
|
|
280
|
+
this.setName = this.generateWriteFunction("setName", [
|
|
281
|
+
"contracts"
|
|
282
|
+
]);
|
|
283
|
+
this.setRecords = this.generateWriteFunction(
|
|
284
|
+
"setRecords",
|
|
285
|
+
["contracts", "provider", "getResolver"]
|
|
286
|
+
);
|
|
287
|
+
this.setRecord = this.generateWriteFunction("setRecord", [
|
|
288
|
+
"contracts",
|
|
289
|
+
"provider",
|
|
290
|
+
"getResolver"
|
|
291
|
+
]);
|
|
292
|
+
this.setResolver = this.generateWriteFunction(
|
|
293
|
+
"setResolver",
|
|
294
|
+
["contracts"]
|
|
295
|
+
);
|
|
296
|
+
this.transferName = this.generateWriteFunction(
|
|
297
|
+
"transferName",
|
|
298
|
+
["contracts"]
|
|
299
|
+
);
|
|
300
|
+
this.transferController = this.generateWriteFunction("transferController", ["contracts"]);
|
|
301
|
+
this.wrapName = this.generateWriteFunction("wrapName", [
|
|
302
|
+
"contracts",
|
|
303
|
+
"getExpiry"
|
|
304
|
+
]);
|
|
305
|
+
this.unwrapName = this.generateWriteFunction(
|
|
306
|
+
"unwrapName",
|
|
307
|
+
["contracts"]
|
|
308
|
+
);
|
|
309
|
+
this.burnFuses = this.generateWriteFunction("burnFuses", [
|
|
310
|
+
"contracts"
|
|
311
|
+
]);
|
|
312
|
+
this.importDNSSECName = this.generateWriteFunction(
|
|
313
|
+
"importDNSSECName",
|
|
314
|
+
["contracts", "provider", "signer"]
|
|
315
|
+
);
|
|
316
|
+
this.createSubname = this.generateWriteFunction(
|
|
317
|
+
"createSubname",
|
|
318
|
+
["contracts", "getExpiry"]
|
|
319
|
+
);
|
|
320
|
+
this.deleteSubname = this.generateWriteFunction(
|
|
321
|
+
"deleteSubname",
|
|
322
|
+
["contracts"]
|
|
323
|
+
);
|
|
324
|
+
this.transferSubname = this.generateWriteFunction(
|
|
325
|
+
"transferSubname",
|
|
326
|
+
["contracts", "getExpiry"]
|
|
327
|
+
);
|
|
328
|
+
this.commitName = this.generateWriteFunction(
|
|
329
|
+
"commitName",
|
|
330
|
+
["contracts"]
|
|
331
|
+
);
|
|
332
|
+
this.registerName = this.generateWriteFunction(
|
|
333
|
+
"registerName",
|
|
334
|
+
["contracts"]
|
|
335
|
+
);
|
|
336
|
+
this.renewNames = this.generateWriteFunction(
|
|
337
|
+
"renewNames",
|
|
338
|
+
["contracts"]
|
|
339
|
+
);
|
|
340
|
+
this.renewNameWithData = this.generateWriteFunction("renewNames", ["contracts"], "renewNameWithData");
|
|
341
|
+
this.options = options;
|
|
342
|
+
this.getContractAddress = (options == null ? void 0 : options.getContractAddress) || import_getContractAddress.getContractAddress;
|
|
343
|
+
}
|
|
345
344
|
}
|
package/dist/cjs/utils/labels.js
CHANGED
|
@@ -109,7 +109,7 @@ function parseName(name) {
|
|
|
109
109
|
return nameArray.map((label) => encodeLabel(label)).join(".");
|
|
110
110
|
}
|
|
111
111
|
function checkIsDecrypted(string) {
|
|
112
|
-
return !string
|
|
112
|
+
return !(string == null ? void 0 : string.includes("["));
|
|
113
113
|
}
|
|
114
114
|
function decryptName(name) {
|
|
115
115
|
return name.split(".").map((label) => checkLabel(label) || label).join(".");
|
|
@@ -34,7 +34,7 @@ const generateSetAddr = (namehash, coinType, address, resolver) => {
|
|
|
34
34
|
}
|
|
35
35
|
const inputCoinType = coinTypeInstance.coinType;
|
|
36
36
|
const encodedAddress = coinTypeInstance.decoder(address);
|
|
37
|
-
return resolver
|
|
37
|
+
return resolver == null ? void 0 : resolver.interface.encodeFunctionData(
|
|
38
38
|
"setAddr(bytes32,uint256,bytes)",
|
|
39
39
|
[namehash, inputCoinType, encodedAddress]
|
|
40
40
|
);
|
|
@@ -53,6 +53,7 @@ const makeCommitmentData = ({
|
|
|
53
53
|
wrapperExpiry,
|
|
54
54
|
secret
|
|
55
55
|
}) => {
|
|
56
|
+
var _a;
|
|
56
57
|
const label = (0, import_labels.labelhash)(name.split(".")[0]);
|
|
57
58
|
const hash = (0, import_normalise.namehash)(name);
|
|
58
59
|
const resolverAddress = resolver.address;
|
|
@@ -60,7 +61,7 @@ const makeCommitmentData = ({
|
|
|
60
61
|
if (reverseRecord) {
|
|
61
62
|
if (!records) {
|
|
62
63
|
records = { coinTypes: [{ key: "ETH", value: owner }] };
|
|
63
|
-
} else if (!records.coinTypes
|
|
64
|
+
} else if (!((_a = records.coinTypes) == null ? void 0 : _a.find((c) => c.key === "ETH"))) {
|
|
64
65
|
if (!records.coinTypes)
|
|
65
66
|
records.coinTypes = [];
|
|
66
67
|
records.coinTypes.push({ key: "ETH", value: owner });
|
|
@@ -38,7 +38,7 @@ const makeExpiry = async ({ getExpiry }, name, expiry) => {
|
|
|
38
38
|
}
|
|
39
39
|
if (name.endsWith(".eth")) {
|
|
40
40
|
const expResponse = await getExpiry(name);
|
|
41
|
-
if (!expResponse
|
|
41
|
+
if (!(expResponse == null ? void 0 : expResponse.expiry))
|
|
42
42
|
throw new Error("Couldn't get expiry for name, please provide one.");
|
|
43
43
|
return import_ethers.BigNumber.from(expResponse.expiry.getTime() / 1e3);
|
|
44
44
|
}
|
|
@@ -41,7 +41,7 @@ var addresses = {
|
|
|
41
41
|
"5": "0xD5610A08E370051a01fdfe4bB3ddf5270af1aA48"
|
|
42
42
|
},
|
|
43
43
|
UniversalResolver: {
|
|
44
|
-
"1": "
|
|
44
|
+
"1": "0x74E20Bd2A1fE0cdbe45b9A1d89cb7e0a45b36376",
|
|
45
45
|
"3": "0x74e20bd2a1fe0cdbe45b9a1d89cb7e0a45b36376",
|
|
46
46
|
"4": "0x74e20bd2a1fe0cdbe45b9a1d89cb7e0a45b36376",
|
|
47
47
|
"5": "0x687c30Cc44bFA39A1449e86E172BF002E7b3f0b0"
|