Skip to content

Commit 8646aa6

Browse files
committed
feat: add validate-handle endpoint to check ownership of handle under ENS names
1 parent fe5f1ff commit 8646aa6

File tree

3 files changed

+318
-190
lines changed

3 files changed

+318
-190
lines changed

clk-gateway/src/graphql/index.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
export const FIND_HANDLE_OWNERSHIP = (name: string, handle: string, service: string) => `
2+
query FindHandleOwnership {
3+
eNs(filter: {
4+
name: {
5+
equalTo : "${name.toLowerCase()}"
6+
}
7+
}, first: 1) {
8+
nodes {
9+
name
10+
textRecords(filter: {
11+
key: {
12+
equalTo: "${service.toLowerCase()}"
13+
},
14+
value: {
15+
equalTo: "${handle.toLowerCase()}"
16+
}
17+
}) {
18+
nodes {
19+
key
20+
value
21+
}
22+
}
23+
}
24+
}
25+
}
26+
`
27+
export type FindHandleOwnershipResponse = {
28+
data: {
29+
eNs: {
30+
nodes: {
31+
name: string
32+
textRecords: {
33+
nodes: {
34+
key: string
35+
value: string
36+
}[]
37+
}
38+
}[]
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)