@ensdomains/ensjs 3.0.0-alpha.37 → 3.0.0-alpha.39
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/contentHash.js +3 -3
- 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/dist/esm/utils/contentHash.mjs +3 -3
- package/package.json +1 -1
- package/src/contracts/getContractAddress.ts +1 -1
- package/src/index.ts +6 -2
- package/src/utils/contentHash.ts +3 -3
|
@@ -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"
|
package/dist/esm/index.mjs
CHANGED
|
@@ -38,10 +38,13 @@ var ENS = class {
|
|
|
38
38
|
const thisRef = this;
|
|
39
39
|
const mainFunc = async function(...args) {
|
|
40
40
|
await thisRef.checkInitialProvider();
|
|
41
|
-
|
|
41
|
+
let mod = await import(
|
|
42
42
|
/* webpackMode: "lazy", webpackChunkName: "[request]", webpackPreload: true, webpackExclude: /.*\.ts$/ */
|
|
43
43
|
`./functions/${path}`
|
|
44
44
|
);
|
|
45
|
+
if (mod.default?.[exportName]) {
|
|
46
|
+
mod = mod.default;
|
|
47
|
+
}
|
|
45
48
|
if (subFunc !== "combine") {
|
|
46
49
|
const writeable = subFunc === "write" || subFunc === "populateTransaction";
|
|
47
50
|
const func = subFunc && !writeable ? mod[exportName][subFunc] : mod[exportName];
|
|
@@ -11,7 +11,7 @@ var supportedCodecs = [
|
|
|
11
11
|
"arweave-ns"
|
|
12
12
|
];
|
|
13
13
|
function matchProtocol(text) {
|
|
14
|
-
return text.match(/^(ipfs|sia|ipns|bzz|onion|onion3|arweave):\/\/(.*)/) || text.match(/\/(ipfs)\/(.*)/) || text.match(/\/(ipns)\/(.*)/);
|
|
14
|
+
return text.match(/^(ipfs|sia|ipns|bzz|onion|onion3|arweave|ar):\/\/(.*)/) || text.match(/\/(ipfs)\/(.*)/) || text.match(/\/(ipns)\/(.*)/);
|
|
15
15
|
}
|
|
16
16
|
function decodeContenthash(encoded) {
|
|
17
17
|
let decoded;
|
|
@@ -43,7 +43,7 @@ function decodeContenthash(encoded) {
|
|
|
43
43
|
} else if (codec === "skynet-ns") {
|
|
44
44
|
protocolType = "sia";
|
|
45
45
|
} else if (codec === "arweave-ns") {
|
|
46
|
-
protocolType = "
|
|
46
|
+
protocolType = "ar";
|
|
47
47
|
} else {
|
|
48
48
|
decoded = encoded;
|
|
49
49
|
}
|
|
@@ -115,7 +115,7 @@ function encodeContenthash(text) {
|
|
|
115
115
|
if (content.length === 46) {
|
|
116
116
|
encoded = `0x${contentHash.encode("skynet-ns", content)}`;
|
|
117
117
|
}
|
|
118
|
-
} else if (contentType === "arweave") {
|
|
118
|
+
} else if (contentType === "arweave" || contentType === "ar") {
|
|
119
119
|
if (content.length === 43) {
|
|
120
120
|
encoded = `0x${contentHash.encode("arweave-ns", content)}`;
|
|
121
121
|
}
|
package/package.json
CHANGED
|
@@ -46,7 +46,7 @@ const addresses: Record<
|
|
|
46
46
|
'5': '0xD5610A08E370051a01fdfe4bB3ddf5270af1aA48',
|
|
47
47
|
},
|
|
48
48
|
UniversalResolver: {
|
|
49
|
-
'1': '
|
|
49
|
+
'1': '0x74E20Bd2A1fE0cdbe45b9A1d89cb7e0a45b36376',
|
|
50
50
|
'3': '0x74e20bd2a1fe0cdbe45b9a1d89cb7e0a45b36376',
|
|
51
51
|
'4': '0x74e20bd2a1fe0cdbe45b9a1d89cb7e0a45b36376',
|
|
52
52
|
'5': '0x687c30Cc44bFA39A1449e86E172BF002E7b3f0b0',
|
package/src/index.ts
CHANGED
|
@@ -15,7 +15,6 @@ import type createSubname from './functions/createSubname'
|
|
|
15
15
|
import type deleteSubname from './functions/deleteSubname'
|
|
16
16
|
import type getAvailable from './functions/getAvailable'
|
|
17
17
|
import type getDNSOwner from './functions/getDNSOwner'
|
|
18
|
-
import type supportsTLD from './functions/supportsTLD'
|
|
19
18
|
import type getExpiry from './functions/getExpiry'
|
|
20
19
|
import type { getHistory } from './functions/getHistory'
|
|
21
20
|
import type getName from './functions/getName'
|
|
@@ -46,6 +45,7 @@ import type setName from './functions/setName'
|
|
|
46
45
|
import type setRecord from './functions/setRecord'
|
|
47
46
|
import type setRecords from './functions/setRecords'
|
|
48
47
|
import type setResolver from './functions/setResolver'
|
|
48
|
+
import type supportsTLD from './functions/supportsTLD'
|
|
49
49
|
import type transferController from './functions/transferController'
|
|
50
50
|
import type transferName from './functions/transferName'
|
|
51
51
|
import type transferSubname from './functions/transferSubname'
|
|
@@ -259,10 +259,14 @@ export class ENS {
|
|
|
259
259
|
// check the initial provider and set if it exists
|
|
260
260
|
await thisRef.checkInitialProvider()
|
|
261
261
|
// import the module dynamically
|
|
262
|
-
|
|
262
|
+
let mod = await import(
|
|
263
263
|
/* webpackMode: "lazy", webpackChunkName: "[request]", webpackPreload: true, webpackExclude: /.*\.ts$/ */
|
|
264
264
|
`./functions/${path}`
|
|
265
265
|
)
|
|
266
|
+
// if export is nested in default, use default
|
|
267
|
+
if (mod.default?.[exportName]) {
|
|
268
|
+
mod = mod.default
|
|
269
|
+
}
|
|
266
270
|
|
|
267
271
|
// if combine isn't specified, run normally
|
|
268
272
|
// otherwise, create a function from the raw and decode functions
|
package/src/utils/contentHash.ts
CHANGED
|
@@ -19,7 +19,7 @@ const supportedCodecs = [
|
|
|
19
19
|
|
|
20
20
|
function matchProtocol(text: string) {
|
|
21
21
|
return (
|
|
22
|
-
text.match(/^(ipfs|sia|ipns|bzz|onion|onion3|arweave):\/\/(.*)/) ||
|
|
22
|
+
text.match(/^(ipfs|sia|ipns|bzz|onion|onion3|arweave|ar):\/\/(.*)/) ||
|
|
23
23
|
text.match(/\/(ipfs)\/(.*)/) ||
|
|
24
24
|
text.match(/\/(ipns)\/(.*)/)
|
|
25
25
|
)
|
|
@@ -55,7 +55,7 @@ export function decodeContenthash(encoded: any) {
|
|
|
55
55
|
} else if (codec === 'skynet-ns') {
|
|
56
56
|
protocolType = 'sia'
|
|
57
57
|
} else if (codec === 'arweave-ns') {
|
|
58
|
-
protocolType = '
|
|
58
|
+
protocolType = 'ar'
|
|
59
59
|
} else {
|
|
60
60
|
decoded = encoded
|
|
61
61
|
}
|
|
@@ -132,7 +132,7 @@ export function encodeContenthash(text: string) {
|
|
|
132
132
|
if (content.length === 46) {
|
|
133
133
|
encoded = `0x${contentHash.encode('skynet-ns', content)}`
|
|
134
134
|
}
|
|
135
|
-
} else if (contentType === 'arweave') {
|
|
135
|
+
} else if (contentType === 'arweave' || contentType === 'ar') {
|
|
136
136
|
if (content.length === 43) {
|
|
137
137
|
encoded = `0x${contentHash.encode('arweave-ns', content)}`
|
|
138
138
|
}
|