Skip to content

Commit e06202f

Browse files
author
Enrique A
committed
Update readme
1 parent 5841a7a commit e06202f

File tree

2 files changed

+9
-29
lines changed

2 files changed

+9
-29
lines changed

LICENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Creit Technologies LLP.
3+
Copyright (c) 2026 Creit Tech.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
66
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the

README.md

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ npx jsr add @creit-tech/sorobandomains-sdk
1515
The first step will be creating a new instance from the main class.
1616

1717
```typescript
18-
import * as SDK from "@stellar/stellar-sdk";
19-
import config from "./myconfigfile.ts";
20-
21-
const sdk: SorobanDomainsSDK = new SorobanDomainsSDK({ rpcUrl: config.RPC_URL });
18+
const sdk: SorobanDomainsSDK = new SorobanDomainsSDK();
2219
```
2320

2421
> There are more parameters you can provide to the SDK, check the `SorobanDomainsSDKParams` interface in the
@@ -27,33 +24,16 @@ const sdk: SorobanDomainsSDK = new SorobanDomainsSDK({ rpcUrl: config.RPC_URL })
2724
## Fetch a registered domain
2825

2926
```typescript
30-
import { Record } from "@creit.tech/sorobandomains-sdk";
27+
import { Domain, SubDomain } from "@creit.tech/sorobandomains-sdk";
3128

32-
const domainRecord: Record = await sdk.searchDomain({ domain: "jhon" });
33-
const subDomainRecord: Record = await sdk.searchDomain({ domain: "jhon", subDomain: "payments" });
29+
const domainRecord: Domain = await sdk.searchDomain("jhon.xlm");
30+
const subDomainRecord: SubDomain = await sdk.searchDomain("payments.jhon.xlm");
3431
```
3532

36-
When searching for a domain, you can receive two types of errors: an expected error by the SDK or a simulation error.
37-
Currently, there is only one expected error by the SDK: `Domain404Error`.
38-
39-
If you need to catch this type of error you can do this:
40-
41-
```typescript
42-
import { Domain404Error } from "@creit.tech/sorobandomains-sdk";
43-
44-
try {
45-
const domainRecord: Record = await sdk.searchDomain({ domain: "nonexistingrecord" });
46-
} catch (e) {
47-
if (e.name === Domain404Error.name) {
48-
// ... Do something here
49-
} else {
50-
// ... Do this instead
51-
}
52-
}
53-
```
33+
This method will fail in two cases:
5434

55-
> Note: In the example we check by the name and not if is an instance of the class because depending on your environment
56-
> that validation method could fail.
35+
- The domain doesn't exist
36+
- The domain is expired.
5737

5838
## Fetch the reverse domain of an address
5939

@@ -80,6 +60,6 @@ try {
8060

8161
![](https://img.shields.io/badge/License-MIT-lightgrey)
8262

83-
Licensed under the MIT License, Copyright © 2024-present Creit Technologies LLP.
63+
Licensed under the MIT License, Copyright © 2026-present Creit Tech.
8464

8565
Checkout the `LICENSE.md` file for more details.

0 commit comments

Comments
 (0)