@ensdomains/ensjs 3.0.0-alpha.64 → 3.0.0-alpha.65
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/getSubnames.js +4 -2
- package/dist/cjs/index.js +1 -1
- package/dist/esm/functions/getSubnames.mjs +4 -2
- package/dist/esm/index.mjs +1 -1
- package/dist/types/functions/getSubnames.d.ts +1 -1
- package/package.json +1 -1
- package/src/functions/getSubnames.ts +7 -3
- package/src/index.ts +1 -1
|
@@ -26,7 +26,7 @@ var import_format = require("../utils/format");
|
|
|
26
26
|
var import_fuses = require("../utils/fuses");
|
|
27
27
|
var import_labels = require("../utils/labels");
|
|
28
28
|
var import_normalise = require("../utils/normalise");
|
|
29
|
-
const largeQuery = async ({ gqlInstance }, {
|
|
29
|
+
const largeQuery = async ({ gqlInstance, contracts }, {
|
|
30
30
|
name,
|
|
31
31
|
pageSize = 10,
|
|
32
32
|
orderDirection,
|
|
@@ -34,6 +34,8 @@ const largeQuery = async ({ gqlInstance }, {
|
|
|
34
34
|
lastSubnames = [],
|
|
35
35
|
search = ""
|
|
36
36
|
}) => {
|
|
37
|
+
const nameWrapper = await (contracts == null ? void 0 : contracts.getNameWrapper());
|
|
38
|
+
const nameWrapperAddress = nameWrapper == null ? void 0 : nameWrapper.address.toLowerCase();
|
|
37
39
|
const { client } = gqlInstance;
|
|
38
40
|
const lastSubname = lastSubnames == null ? void 0 : lastSubnames[lastSubnames.length - 1];
|
|
39
41
|
const lastCreatedAt = lastSubname == null ? void 0 : lastSubname.createdAt;
|
|
@@ -121,7 +123,7 @@ const largeQuery = async ({ gqlInstance }, {
|
|
|
121
123
|
owner: subname.owner.id,
|
|
122
124
|
type: "domain"
|
|
123
125
|
};
|
|
124
|
-
if (wrappedDomain) {
|
|
126
|
+
if (wrappedDomain && obj.owner === nameWrapperAddress) {
|
|
125
127
|
obj.type = "wrappedDomain";
|
|
126
128
|
const expiryDateAsDate = wrappedDomain.expiryDate && wrappedDomain.expiryDate !== "0" ? new Date(parseInt(wrappedDomain.expiryDate) * 1e3) : void 0;
|
|
127
129
|
const hasExpired = expiryDateAsDate && expiryDateAsDate < new Date();
|
package/dist/cjs/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { truncateFormat } from "../utils/format.mjs";
|
|
|
8
8
|
import { checkPCCBurned, decodeFuses } from "../utils/fuses.mjs";
|
|
9
9
|
import { decryptName } from "../utils/labels.mjs";
|
|
10
10
|
import { namehash } from "../utils/normalise.mjs";
|
|
11
|
-
var largeQuery = async ({ gqlInstance }, {
|
|
11
|
+
var largeQuery = async ({ gqlInstance, contracts }, {
|
|
12
12
|
name,
|
|
13
13
|
pageSize = 10,
|
|
14
14
|
orderDirection,
|
|
@@ -16,6 +16,8 @@ var largeQuery = async ({ gqlInstance }, {
|
|
|
16
16
|
lastSubnames = [],
|
|
17
17
|
search = ""
|
|
18
18
|
}) => {
|
|
19
|
+
const nameWrapper = await contracts?.getNameWrapper();
|
|
20
|
+
const nameWrapperAddress = nameWrapper?.address.toLowerCase();
|
|
19
21
|
const { client } = gqlInstance;
|
|
20
22
|
const lastSubname = lastSubnames?.[lastSubnames.length - 1];
|
|
21
23
|
const lastCreatedAt = lastSubname?.createdAt;
|
|
@@ -103,7 +105,7 @@ var largeQuery = async ({ gqlInstance }, {
|
|
|
103
105
|
owner: subname.owner.id,
|
|
104
106
|
type: "domain"
|
|
105
107
|
};
|
|
106
|
-
if (wrappedDomain) {
|
|
108
|
+
if (wrappedDomain && obj.owner === nameWrapperAddress) {
|
|
107
109
|
obj.type = "wrappedDomain";
|
|
108
110
|
const expiryDateAsDate = wrappedDomain.expiryDate && wrappedDomain.expiryDate !== "0" ? new Date(parseInt(wrappedDomain.expiryDate) * 1e3) : void 0;
|
|
109
111
|
const hasExpired = expiryDateAsDate && expiryDateAsDate < new Date();
|
package/dist/esm/index.mjs
CHANGED
|
@@ -35,5 +35,5 @@ declare type Params = {
|
|
|
35
35
|
lastSubnames?: Array<any>;
|
|
36
36
|
search?: string;
|
|
37
37
|
};
|
|
38
|
-
declare const getSubnames: (injected: ENSArgs<'gqlInstance'>, functionArgs: Params) => Promise<ReturnData>;
|
|
38
|
+
declare const getSubnames: (injected: ENSArgs<'gqlInstance' | 'contracts'>, functionArgs: Params) => Promise<ReturnData>;
|
|
39
39
|
export default getSubnames;
|
package/package.json
CHANGED
|
@@ -52,7 +52,7 @@ type Params = {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
const largeQuery = async (
|
|
55
|
-
{ gqlInstance }: ENSArgs<'gqlInstance'>,
|
|
55
|
+
{ gqlInstance, contracts }: ENSArgs<'gqlInstance' | 'contracts'>,
|
|
56
56
|
{
|
|
57
57
|
name,
|
|
58
58
|
pageSize = 10,
|
|
@@ -62,6 +62,9 @@ const largeQuery = async (
|
|
|
62
62
|
search = '',
|
|
63
63
|
}: Params,
|
|
64
64
|
) => {
|
|
65
|
+
const nameWrapper = await contracts?.getNameWrapper()
|
|
66
|
+
const nameWrapperAddress = nameWrapper?.address.toLowerCase()
|
|
67
|
+
|
|
65
68
|
const { client } = gqlInstance
|
|
66
69
|
|
|
67
70
|
const lastSubname = lastSubnames?.[lastSubnames.length - 1]
|
|
@@ -165,7 +168,8 @@ const largeQuery = async (
|
|
|
165
168
|
type: 'domain',
|
|
166
169
|
} as Subname
|
|
167
170
|
|
|
168
|
-
|
|
171
|
+
// If the subname is wrapped, we need to verfiy that it is wrapped by checking the registry owner
|
|
172
|
+
if (wrappedDomain && obj.owner === nameWrapperAddress) {
|
|
169
173
|
obj.type = 'wrappedDomain'
|
|
170
174
|
const expiryDateAsDate =
|
|
171
175
|
wrappedDomain.expiryDate && wrappedDomain.expiryDate !== '0'
|
|
@@ -194,7 +198,7 @@ const largeQuery = async (
|
|
|
194
198
|
}
|
|
195
199
|
|
|
196
200
|
const getSubnames = (
|
|
197
|
-
injected: ENSArgs<'gqlInstance'>,
|
|
201
|
+
injected: ENSArgs<'gqlInstance' | 'contracts'>,
|
|
198
202
|
functionArgs: Params,
|
|
199
203
|
): Promise<ReturnData> => {
|
|
200
204
|
return largeQuery(injected, functionArgs)
|