Skip to content

Commit 6f5184f

Browse files
author
Enrique A
committed
Upgrade to v1.0.2
1 parent e57153e commit 6f5184f

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All notable changes to this project will be documented in this file. See
44
[standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
55

6+
### [1.0.2] (2026-01-06)
7+
8+
### Add
9+
10+
- Add parameter `type` to both the Domain and SubDomain to make it easy for developers consuming both from the library.
11+
612
### [1.0.1] (2026-01-02)
713

814
### Add

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@creit-tech/sorobandomains-sdk",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "An SDK to easily fetch and interact with domains from the sorobandomains.org protocol",
55
"license": "MIT",
66
"author": {

src/sdk.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import { type Domain, NFD_CONTRACT, type SubDomain } from "./types.ts";
21
import {
2+
type Domain,
33
type DomainStorageValue,
44
KEY_VALUE_DB_CONTRACT,
5+
NFD_CONTRACT,
6+
RecordKey,
57
REGISTRY_CONTRACT,
68
REVERSE_REGISTRAR_CONTRACT,
79
SIMULATION_ACCOUNT,
810
type SorobanDomainsSDKParams,
11+
type SubDomain,
912
} from "./types.ts";
1013
import { Buffer } from "buffer";
1114
import { crypto } from "@std/crypto";
@@ -364,23 +367,25 @@ export class SorobanDomainsSDK {
364367
const [domain, subDomain] = scValToNative(sim.result!.retval);
365368
if (subDomain) {
366369
return {
370+
type: RecordKey.SubDomain,
367371
address: subDomain.address,
368372
domain: subDomain.domain.toString(),
369373
parent: subDomain.parent.toString("hex"),
370374
root: subDomain.root.toString("hex"),
371375
node: subDomain.node.toString("hex"),
372376
snapshot: Number(subDomain.snapshot),
373-
};
377+
} satisfies SubDomain;
374378
} else {
375379
return {
380+
type: RecordKey.Domain,
376381
address: domain.address,
377382
domain: domain.domain.toString(),
378383
tld: domain.tld.toString(),
379384
node: domain.node.toString("hex"),
380385
snapshot: Number(domain.snapshot),
381386
token_id: domain.token_id,
382387
exp_date: Number(domain.exp_date),
383-
};
388+
} satisfies Domain;
384389
}
385390
}
386391

@@ -448,6 +453,7 @@ export class SorobanDomainsSDK {
448453
}
449454

450455
return domains.map((domain): Domain => ({
456+
type: RecordKey.Domain,
451457
address: domain.address,
452458
domain: domain.domain.toString(),
453459
tld: domain.tld.toString(),

src/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ export interface SorobanDomainsSDKParams {
5656
}
5757

5858
export interface Domain {
59+
type: RecordKey.Domain;
60+
5961
domain: string;
6062
tld: string;
6163

@@ -77,6 +79,8 @@ export interface Domain {
7779
}
7880

7981
export interface SubDomain {
82+
type: RecordKey.SubDomain;
83+
8084
// This is the subdomain value
8185
domain: string;
8286

0 commit comments

Comments
 (0)