Skip to content

Commit 74e8b88

Browse files
author
Vincent Shadbolt
authored
chore: Resolution API Guide
* guide outline * added resolution and reverse resolution API code snippets, nuked SDK * fixed sidebar * minor title changes and removed SDK mentions from the resolution overviews * minor guide updates * removed last of the SDK references, added wildcard redirect, and replaced SDK examples with API
1 parent dbc228b commit 74e8b88

21 files changed

Lines changed: 509 additions & 1606 deletions

File tree

domain-distribution-and-management/quickstart/retrieve-an-api-key.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ If you wish to have access to `Partner API v3`, please click `Request access to
9494

9595

9696
### SDK Key
97-
Refer to [Resolution SDKs](https://docs.unstoppabledomains.com/resolution/sdks-and-libraries/overview/)
97+
Refer to the [Javascript Resolution SDKs](https://github.com/unstoppabledomains/resolution)
9898

99-
The key is only allowed to be used in Resolution SDKs to interact with EVM RPC providers to query on-chain data. See [example](https://docs.unstoppabledomains.com/resolution/sdks-and-libraries/javascript/#initialize-with-unstoppable-domains-uns-proxy-provider)
99+
The key is only allowed to be used in Resolution SDKs to interact with EVM RPC providers to query on-chain data. The SDKs are unmaintained.
100100

101101
### Legacy API Key
102102
Refer to [Domain Resolution](https://docs.unstoppabledomains.com/openapi/resolution/) and [Domain Distribution and Management Overview

redirects.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,11 @@
293293
to: '/smart-contracts/quick-start/reverse-resolve-domains/'
294294
type: 301
295295
'/resolution/guides/reverse-resolution/integration-guides/resolution-libraries/':
296-
to: '/resolution/quickstart/reverse-resolution/'
296+
to: '/resolution/guides/sdk/reverse-resolution/'
297297
type: 301
298298
'/resolution/guides/reverse-resolution/faq/':
299299
to: '/resolution/guides/rr-faq/'
300+
type: 301
301+
'/resolution/sdks-and-libraries/*':
302+
to: '/resolution/overview/'
300303
type: 301

resolution/guides/browser-resolution/overview.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ Domain Resolution allows developers to translate a `.crypto` or `.zil` domain na
1313

1414
To make domain resolution easier, we've written libraries for web, Android, and iOS.
1515

16-
### Domain Resolution Libraries
16+
### Domain Resolution Service API
1717

18-
- [Resolution-Javascript](/resolution/sdks-and-libraries/javascript.md)
19-
- [Resolution-Java](/resolution/sdks-and-libraries/java.md)
20-
- [Resolution-Swift](/resolution/sdks-and-libraries/swift.md)
21-
- [Resolution-Go](/resolution/sdks-and-libraries/go.md)
18+
For our HTTP-based API that allows you to quickly build applications that fetch UD domain data from the blockchain with a single API request, see the [Resolution Service API](https://docs.unstoppabledomains.com/openapi/resolution). The Unstoppable Domains team manages this service.
19+
20+
- [Resolution](/resolution/quickstart/resolution.md)
2221

2322
### Access Domain Metadata Directly
2423

resolution/guides/browser-resolution/test-domains.md

Lines changed: 28 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -25,134 +25,37 @@ redirectFrom:
2525

2626
## Getting test records
2727

28-
Check records with the [Resolution Libraries](/resolution/sdks-and-libraries/javascript.md) and [Resolution CLI](/resolution/sdks-and-libraries/cli.md):
29-
30-
```typescript JavaScript
31-
import Resolution from "@unstoppabledomains/resolution/build/Resolution";
32-
33-
// obtain a key by following this document https://docs.unstoppabledomains.com/domain-distribution-and-management/quickstart/retrieve-an-api-key/#api-key. See https://github.com/unstoppabledomains/resolution for more initialization options
34-
const resolution = new Resolution({ apiKey: "<api_key>" });
35-
resolution.allRecords("udtestdev-dns-ipfs.crypto").then((records) => {
36-
console.log(records);
37-
// Output
38-
// {
39-
// 'dns.A': '["10.0.0.1","10.0.0.2"]',
40-
// 'dns.A.ttl': '1800',
41-
// 'dns.ttl': '1000',
42-
// 'dns.CNAME': '',
43-
// 'dns.CNAME.ttl': '',
44-
// 'dweb.ipfs.hash': 'QmVJ26hBrwwNAPVmLavEFXDUunNDXeFSeMPmHuPxKe6dJv',
45-
// 'browser.preferred_protocols': '["ipfs","https","http"]',
46-
// 'browser.redirect_url': '',
47-
// 'ipfs.html.value': '',
48-
// 'ipfs.redirect_domain.value': ''
49-
// }
50-
});
51-
```
52-
53-
```bash Resolution CLI
54-
$ resolution -d udtestdev-dns-ipfs.crypto -a
55-
{
56-
"records": {
57-
"dns.A": "[\"10.0.0.1\",\"10.0.0.2\"]",
58-
"dns.A.ttl": "1800",
59-
"dns.ttl": "1000",
60-
"dweb.ipfs.hash": "QmVJ26hBrwwNAPVmLavEFXDUunNDXeFSeMPmHuPxKe6dJv",
61-
"browser.preferred_protocols": "[\"ipfs\",\"https\",\"http\"]"
62-
}
63-
}
64-
```
65-
66-
```swift Swift
67-
import UnstoppableDomainsResolution
28+
Check records with the [Resolution Service API](/resolution/quickstart/resolution/):
29+
30+
```typescript
31+
/**
32+
* Resolves all records for a given domain.
33+
*
34+
* @param {string} domain - The domain name to resolve
35+
* @returns {Promise<string | null>} The resolved addresses or null if not found
36+
*
37+
* @throws {Error} When no addresses can be resolved for the custom record
38+
*/
39+
async function resolveAllRecords(
40+
domain: string,
41+
): Promise<string | null> {
42+
43+
try {
44+
const response = await axios.get(
45+
UNSTOPPABLE_API_BASE_URL + 'domains/' + encodeURIComponent(domain),
46+
{
47+
headers: { 'Authorization': 'Bearer ' + UNSTOPPABLE_API_KEY }
48+
}
49+
);
6850

69-
// obtain a key by following this document https://docs.unstoppabledomains.com/domain-distribution-and-management/quickstart/retrieve-an-api-key/#api-key. See https://github.com/unstoppabledomains/resolution-swift for more initialization options
70-
guard let resolution = try? Resolution(apiKey: "<api_key>") else {
71-
print ("Init of Resolution instance failed...")
72-
return
73-
}
51+
const records = response.data.records;
7452

75-
resolution.allRecords(domain: "udtestdev-dns-ipfs.crypto") { result in
76-
switch result {
77-
case .success(let returnValue):
78-
dump(returnValue);
79-
/*
80-
Output:
81-
'dns.A': '["10.0.0.1","10.0.0.2"]'
82-
'dns.A.ttl': '1800'
83-
'dns.ttl': '1000'
84-
'dns.CNAME': ''
85-
'dns.CNAME.ttl': ''
86-
'dweb.ipfs.hash': 'QmVJ26hBrwwNAPVmLavEFXDUunNDXeFSeMPmHuPxKe6dJv'
87-
'browser.preferred_protocols': '["ipfs","https","http"]'
88-
'browser.redirect_url': ''
89-
'ipfs.html.value': '',
90-
'ipfs.redirect_domain.value': ''
91-
*/
92-
case .failure(let error):
93-
XCTFail("Expected all records from uns domain, but got \(error)");
94-
}
95-
}
96-
```
53+
if (records) return records;
9754

98-
```java Java
99-
import com.unstoppabledomains.resolution.Resolution;
100-
import java.util.Map;
101-
102-
public class Main {
103-
public static void main(String[] args) {
104-
try {
105-
// obtain a key by following this document https://docs.unstoppabledomains.com/domain-distribution-and-management/quickstart/retrieve-an-api-key/#api-key. See https://github.com/unstoppabledomains/resolution-java for more initialization options
106-
DomainResolution resolution = new Resolution("<api_key>");
107-
Map<String, String> records = res.getAllRecords("udtestdev-dns-ipfs.crypto");
108-
for (Map.Entry<String, String> entry : records.entrySet()) {
109-
System.out.println(String.format("'%s': '%s'", entry.getKey(), entry.getValue());
110-
}
111-
/*
112-
* Output:
113-
* 'dns.A': '["10.0.0.1","10.0.0.2"]'
114-
* 'dns.A.ttl': '1800'
115-
* 'dns.ttl': '1000'
116-
* 'dns.CNAME': ''
117-
* 'dns.CNAME.ttl': ''
118-
* 'dweb.ipfs.hash': 'QmVJ26hBrwwNAPVmLavEFXDUunNDXeFSeMPmHuPxKe6dJv'
119-
* 'browser.preferred_protocols': '["ipfs","https","http"]'
120-
* 'browser.redirect_url': ''
121-
* 'ipfs.html.value': '',
122-
* 'ipfs.redirect_domain.value': ''
123-
*/
124-
} catch (Exception e) {
125-
e.printStackTrace();
126-
}
55+
throw new Error('No records found for ' + domain);
56+
} catch (error) {
57+
console.error('Record resolution error:', error);
58+
return null;
12759
}
12860
}
12961
```
130-
131-
```go Golang
132-
package main
133-
134-
import (
135-
"fmt"
136-
"github.com/unstoppabledomains/resolution-go/v3"
137-
)
138-
139-
func main() {
140-
// obtain a key by following this document https://docs.unstoppabledomains.com/domain-distribution-and-management/quickstart/retrieve-an-api-key/#api-key. See https://github.com/unstoppabledomains/resolution-go for more initialization options
141-
uns, _ := resolution.NewUnsBuilder().SetUdClient("<api_key>").Build()
142-
allUnsRecords, _ := uns.AllRecords("udtestdev-dns-ipfs.crypto")
143-
fmt.Println("Records for udtestdev-dns-ipfs.crypto", allUnsRecords)
144-
// Output
145-
// {
146-
// 'dns.A': '["10.0.0.1","10.0.0.2"]',
147-
// 'dns.A.ttl': '1800',
148-
// 'dns.ttl': '1000',
149-
// 'dns.CNAME': '',
150-
// 'dns.CNAME.ttl': '',
151-
// 'dweb.ipfs.hash': 'QmVJ26hBrwwNAPVmLavEFXDUunNDXeFSeMPmHuPxKe6dJv',
152-
// 'browser.preferred_protocols': '["ipfs","https","http"]',
153-
// 'browser.redirect_url': '',
154-
// 'ipfs.html.value': '',
155-
// 'ipfs.redirect_domain.value': ''
156-
// }
157-
}
158-
```

resolution/guides/troubleshooting-guide.md

Lines changed: 0 additions & 63 deletions
This file was deleted.

resolution/overview.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,8 @@ Check out the video below for a high-level overview!
2020

2121
For our HTTP-based API that allows you to quickly build applications that fetch UD domain data from the blockchain with a single API request, see the [Resolution Service API](/openapi/resolution). The Unstoppable Domains team manages this service.
2222

23-
## Resolution Libraries
24-
25-
For language-specific, blockchain-agnostic libraries for resolving Unstoppable Web3 domains (including domains on Ethereum, Polygon, and Zilliqa) see our [Resolution Libraries](sdks-and-libraries/javascript.md) guide. These are managed by Unstoppable and updated regularly to reflect changes in our services.
26-
27-
## Resolution CLI
28-
29-
For an Unstoppable-managed, blockchain-agnostic command-line interface for resolving all Unstoppable Web3 domains, see the [Resolution CLI](sdks-and-libraries/cli.md) guide.
30-
31-
## Resolve Using Matic.js SDK
32-
33-
For developers developing on Polygon using the [Matic.js SDK](https://github.com/maticnetwork/matic.js) and who want an easy way to integrate domain resolution functionalities into their applications, see the [Resolve Using Matic.js SDK](sdks-and-libraries/maticjs.md) guide.
34-
23+
## Smart Contracts
3524

25+
Integrate Resolution using Unstoppable Domains UNS smart contracts. See the [Smart Contracts Guide](../smart-contracts/quick-start/resolve-domains.md). The Unstoppable Domains team manages this service.
3626

3727
<embed src="/snippets/_developer-survey-embed.md" />

0 commit comments

Comments
 (0)