zcashname-sdk 0.4.0 → 0.5.1

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/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # Zcash Name System (ZNS) SDK
2
+
3
+ TypeScript SDK for interacting with the Zcash Name System — a decentralized naming system built on Zcash.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install zcashname-sdk
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```ts
14
+ import { ZNS } from "zcashname-sdk";
15
+
16
+ const zns = await ZNS.create();
17
+
18
+ const name = "alice";
19
+ const resolved = await zns.resolve(name);
20
+ if (resolved === null) {
21
+ console.log(`${name} is available`);
22
+ } else {
23
+ console.log(`${name} resolves to ${resolved.address}`);
24
+ }
25
+ ```
26
+
27
+ ## API
28
+
29
+ ### `ZNS.create(options?)`
30
+ Create a new ZNS instance connected to the default testnet endpoint.
31
+
32
+ ```ts
33
+ const zns = await ZNS.create();
34
+ const znsMainnet = await ZNS.create({ url: "https://light.zcash.me/zns-mainnet" });
35
+ ```
36
+
37
+ ### `zns.resolve(query)`
38
+ Resolve a name to its registered address. Returns `null` if the name is available.
39
+
40
+ ```ts
41
+ const result = await zns.resolve("alice");
42
+ ```
43
+
44
+ ### `zns.isAvailable(name)`
45
+ Check if a name is available for registration.
46
+
47
+ ```ts
48
+ const available = await zns.isAvailable("bob");
49
+ ```
50
+
51
+ ### `zns.listings()`
52
+ Get all names currently listed for sale.
53
+
54
+ ```ts
55
+ const listings = await zns.listings();
56
+ ```
57
+
58
+ ### `zns.events(filter?)`
59
+ Query blockchain events (claims, buys, lists, delists, updates, releases).
60
+
61
+ ```ts
62
+ const { events } = await zns.events({ action: "CLAIM", limit: 50 });
63
+ ```
64
+
65
+ ### Action Helpers
66
+
67
+ The SDK provides prepare/complete pairs for all ZNS actions:
68
+
69
+ - `zns.prepareClaim(name, address)` / `zns.completeClaim(...)` — claim a name
70
+ - `zns.prepareList(name, price, nonce)` / `zns.completeList(...)` — list a name for sale
71
+ - `zns.prepareDelist(name, nonce)` / `zns.completeDelist(...)` — delist a name
72
+ - `zns.prepareUpdate(name, newAddress, nonce)` / `zns.completeUpdate(...)` — update a name's address
73
+ - `zns.prepareBuy(name, buyerAddress)` / `zns.completeBuy(...)` — buy a name
74
+ - `zns.prepareRelease(name, nonce)` / `zns.completeRelease(...)` — release a name
75
+
76
+ Each `complete*` method returns a `{ memo, uri }` object suitable for constructing a ZIP 321 URI.
77
+
78
+ ### `zns.parseZip321Uri(uri)`
79
+ Parse a ZIP 321 URI into its components.
80
+
81
+ ```ts
82
+ const parsed = zns.parseZip321Uri("zcash:addr?amount=0.1&memo=...");
83
+ ```
84
+
85
+ ## Constants
86
+
87
+ - `DEFAULT_URL` — default testnet endpoint
88
+ - `TESTNET_UIVK` — expected testnet UIVK for verification
89
+ - `MAINNET_UIVK` — expected mainnet UIVK for verification
90
+
91
+ ## License
92
+
93
+ MIT
package/dist/zns.cjs ADDED
@@ -0,0 +1,333 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/zns.ts
21
+ var zns_exports = {};
22
+ __export(zns_exports, {
23
+ DEFAULT_URL: () => DEFAULT_URL,
24
+ MAINNET_UIVK: () => MAINNET_UIVK,
25
+ TESTNET_UIVK: () => TESTNET_UIVK,
26
+ ZNS: () => ZNS
27
+ });
28
+ module.exports = __toCommonJS(zns_exports);
29
+ var DEFAULT_URL = "https://light.zcash.me/zns-testnet";
30
+ var TESTNET_UIVK = "uivktest1hzw7wyadutvzfgpna80yftsk5l7jeyu2p5me5quvp28tytxueta00cx4068wnlzcv7tx9n3t3gfhsy83pe4y6jrhxtzaq0hj6xtg5zrk2dn7zen3vns2a5pgs4fxdjlletmqrhfa42";
31
+ var MAINNET_UIVK = "uivk1gl26qy0xjja7lqhyg3pf0x4j4j66kqwewrjkdcg28eqq4wgtzjmujpee7x9cs2ec9xhnlgrm8ptlw8z80j2aryw8nqtssser2ys778a0s00uvgkdjnfr58sndhfvc3f4zqjs6ywva6";
32
+ var KNOWN_UIVKS = [TESTNET_UIVK, MAINNET_UIVK];
33
+ var NAME_RE = /^[a-z0-9]{1,62}$/;
34
+ var ZNS = class _ZNS {
35
+ constructor(url) {
36
+ this.rpcId = 0;
37
+ this._adminPubkey = null;
38
+ this._pricing = null;
39
+ this._registryAddress = null;
40
+ this._verified = false;
41
+ this.url = url;
42
+ }
43
+ static async create(options) {
44
+ const url = options?.url ?? DEFAULT_URL;
45
+ const zns = new _ZNS(url);
46
+ const status = await zns.rpc("status");
47
+ if (!options?.skipVerify) {
48
+ if (!KNOWN_UIVKS.includes(status.uivk)) {
49
+ throw new Error(
50
+ `UIVK mismatch: indexer returned "${status.uivk.slice(0, 20)}..." which is not a known ZNS instance`
51
+ );
52
+ }
53
+ zns._verified = true;
54
+ }
55
+ zns.pinStatus(status);
56
+ return zns;
57
+ }
58
+ pinStatus(status) {
59
+ this._adminPubkey = status.admin_pubkey;
60
+ this._pricing = status.pricing;
61
+ this._registryAddress = status.address;
62
+ }
63
+ get verified() {
64
+ return this._verified;
65
+ }
66
+ get adminPubkey() {
67
+ return this._adminPubkey;
68
+ }
69
+ get pricing() {
70
+ return this._pricing;
71
+ }
72
+ get registryAddress() {
73
+ return this._registryAddress;
74
+ }
75
+ async resolve(query) {
76
+ const raw = await this.rpc("resolve", { query });
77
+ if (raw === null) return null;
78
+ if (Array.isArray(raw)) {
79
+ const results = [];
80
+ for (const r of raw) results.push(await this.enrichRegistration(r));
81
+ return results;
82
+ }
83
+ return this.enrichRegistration(raw);
84
+ }
85
+ async isAvailable(name) {
86
+ const result = await this.resolve(name);
87
+ return result === null;
88
+ }
89
+ async listings() {
90
+ const result = await this.rpc("list_for_sale");
91
+ const enriched = [];
92
+ for (const l of result.listings) enriched.push(await this.enrichListing(l));
93
+ return enriched;
94
+ }
95
+ async status() {
96
+ return this.rpc("status");
97
+ }
98
+ async events(filter) {
99
+ const result = await this.rpc("events", filter ?? {});
100
+ const enriched = [];
101
+ for (const e of result.events) enriched.push(await this.enrichEvent(e));
102
+ return { events: enriched, total: result.total };
103
+ }
104
+ prepareClaim(name, address) {
105
+ this.requireValidName(name);
106
+ const payload = `CLAIM:${name}:${address}`;
107
+ const cost = this.claimCost(name.length);
108
+ const uri = cost != null && this._registryAddress ? this.buildZcashUri(this._registryAddress, cost / 1e8) : void 0;
109
+ return { payload, cost: cost ?? void 0, uri };
110
+ }
111
+ completeClaim(name, address, signature, userPubkey) {
112
+ this.requireValidName(name);
113
+ const memo = userPubkey ? `ZNS:CLAIM:${name}:${address}:${signature}:${userPubkey}` : `ZNS:CLAIM:${name}:${address}:${signature}`;
114
+ const cost = this.claimCost(name.length);
115
+ const uri = this.buildZcashUri(this._registryAddress ?? "", cost != null ? cost / 1e8 : void 0, memo);
116
+ return { memo, uri };
117
+ }
118
+ prepareList(name, price, nonce) {
119
+ this.requireValidName(name);
120
+ return { payload: `LIST:${name}:${price}:${nonce}` };
121
+ }
122
+ completeList(name, price, nonce, signature, userPubkey) {
123
+ this.requireValidName(name);
124
+ const memo = userPubkey ? `ZNS:LIST:${name}:${price}:${nonce}:${signature}:${userPubkey}` : `ZNS:LIST:${name}:${price}:${nonce}:${signature}`;
125
+ return { memo, uri: this.memoUri(memo) };
126
+ }
127
+ prepareDelist(name, nonce) {
128
+ this.requireValidName(name);
129
+ return { payload: `DELIST:${name}:${nonce}` };
130
+ }
131
+ completeDelist(name, nonce, signature, userPubkey) {
132
+ this.requireValidName(name);
133
+ const memo = userPubkey ? `ZNS:DELIST:${name}:${nonce}:${signature}:${userPubkey}` : `ZNS:DELIST:${name}:${nonce}:${signature}`;
134
+ return { memo, uri: this.memoUri(memo) };
135
+ }
136
+ prepareUpdate(name, newAddress, nonce) {
137
+ this.requireValidName(name);
138
+ return { payload: `UPDATE:${name}:${newAddress}:${nonce}` };
139
+ }
140
+ completeUpdate(name, newAddress, nonce, signature, userPubkey) {
141
+ this.requireValidName(name);
142
+ const memo = userPubkey ? `ZNS:UPDATE:${name}:${newAddress}:${nonce}:${signature}:${userPubkey}` : `ZNS:UPDATE:${name}:${newAddress}:${nonce}:${signature}`;
143
+ return { memo, uri: this.memoUri(memo) };
144
+ }
145
+ prepareBuy(name, buyerAddress) {
146
+ this.requireValidName(name);
147
+ return { payload: `BUY:${name}:${buyerAddress}` };
148
+ }
149
+ completeBuy(name, buyerAddress, signature, userPubkey) {
150
+ this.requireValidName(name);
151
+ const memo = userPubkey ? `ZNS:BUY:${name}:${buyerAddress}:${signature}:${userPubkey}` : `ZNS:BUY:${name}:${buyerAddress}:${signature}`;
152
+ return { memo, uri: this.memoUri(memo) };
153
+ }
154
+ prepareRelease(name, nonce) {
155
+ this.requireValidName(name);
156
+ return { payload: `RELEASE:${name}:${nonce}` };
157
+ }
158
+ completeRelease(name, nonce, signature, userPubkey) {
159
+ this.requireValidName(name);
160
+ const memo = userPubkey ? `ZNS:RELEASE:${name}:${nonce}:${signature}:${userPubkey}` : `ZNS:RELEASE:${name}:${nonce}:${signature}`;
161
+ return { memo, uri: this.memoUri(memo) };
162
+ }
163
+ prepareSetPrice(prices, nonce) {
164
+ return { payload: `SETPRICE:${prices.length}:${prices.join(":")}:${nonce}` };
165
+ }
166
+ completeSetPrice(prices, nonce, signature) {
167
+ const memo = `ZNS:SETPRICE:${prices.length}:${prices.join(":")}:${nonce}:${signature}`;
168
+ return { memo, uri: this.memoUri(memo) };
169
+ }
170
+ isValidName(name) {
171
+ return NAME_RE.test(name);
172
+ }
173
+ claimCost(nameLength) {
174
+ if (!this._pricing || this._pricing.tiers.length === 0) return null;
175
+ const idx = Math.min(Math.max(nameLength - 1, 0), this._pricing.tiers.length - 1);
176
+ return this._pricing.tiers[idx];
177
+ }
178
+ parseZip321Uri(uri) {
179
+ const withoutScheme = String(uri ?? "").replace(/^zcash:/i, "");
180
+ const [addressPart, queryPart = ""] = withoutScheme.split("?");
181
+ const address = addressPart.trim();
182
+ const params = new URLSearchParams(queryPart);
183
+ const amount = String(params.get("amount") ?? "").trim();
184
+ const memoRaw = String(params.get("memo") ?? "").trim();
185
+ const memoDecoded = memoRaw ? this.decodeBase64Url(memoRaw) : "";
186
+ return { address, amount, memoRaw, memoDecoded };
187
+ }
188
+ async enrichRegistration(raw) {
189
+ const { listing: rawListing, ...reg } = raw;
190
+ const sovereign = reg.pubkey != null && reg.pubkey !== this._adminPubkey;
191
+ const verified = await this.verifyRegistration(reg, sovereign);
192
+ const listing = rawListing ? await this.verifyListing(rawListing) : null;
193
+ return { ...reg, listing, verified, sovereign };
194
+ }
195
+ async verifyRegistration(reg, sovereign) {
196
+ if (!reg.signature || !this._adminPubkey) return false;
197
+ const payload = this.registrationPayload(reg);
198
+ if (!payload) return false;
199
+ const pubkey = sovereign ? reg.pubkey : this._adminPubkey;
200
+ return this.verifyEd25519(payload, reg.signature, pubkey);
201
+ }
202
+ async verifyListing(listing) {
203
+ const verified = this._adminPubkey ? await this.verifyEd25519(this.listingPayload(listing), listing.signature, this._adminPubkey) : false;
204
+ return { ...listing, verified };
205
+ }
206
+ async enrichListing(listing) {
207
+ let verified = false;
208
+ if (this._adminPubkey) {
209
+ const payload = this.listingPayload(listing);
210
+ verified = await this.verifyEd25519(payload, listing.signature, this._adminPubkey);
211
+ }
212
+ return { ...listing, verified };
213
+ }
214
+ async enrichEvent(event) {
215
+ if (!event.signature || !this._adminPubkey) return { ...event, verified: false };
216
+ const payload = this.eventPayload(event);
217
+ if (!payload) return { ...event, verified: false };
218
+ const pubkey = event.pubkey ?? this._adminPubkey;
219
+ const verified = await this.verifyEd25519(payload, event.signature, pubkey);
220
+ return { ...event, verified };
221
+ }
222
+ registrationPayload(reg) {
223
+ switch (reg.last_action) {
224
+ case "CLAIM":
225
+ return `CLAIM:${reg.name}:${reg.address}`;
226
+ case "BUY":
227
+ return `BUY:${reg.name}:${reg.address}`;
228
+ case "UPDATE":
229
+ return `UPDATE:${reg.name}:${reg.address}:${reg.nonce}`;
230
+ case "DELIST":
231
+ return `DELIST:${reg.name}:${reg.nonce}`;
232
+ case "RELEASE":
233
+ return `RELEASE:${reg.name}:${reg.nonce}`;
234
+ default:
235
+ return "";
236
+ }
237
+ }
238
+ listingPayload(l) {
239
+ return `LIST:${l.name}:${l.price}:${l.nonce}`;
240
+ }
241
+ eventPayload(e) {
242
+ switch (e.action) {
243
+ case "CLAIM":
244
+ return e.ua ? `CLAIM:${e.name}:${e.ua}` : "";
245
+ case "BUY":
246
+ return e.ua ? `BUY:${e.name}:${e.ua}` : "";
247
+ case "LIST":
248
+ return e.price != null && e.nonce != null ? `LIST:${e.name}:${e.price}:${e.nonce}` : "";
249
+ case "DELIST":
250
+ return e.nonce != null ? `DELIST:${e.name}:${e.nonce}` : "";
251
+ case "RELEASE":
252
+ return e.nonce != null ? `RELEASE:${e.name}:${e.nonce}` : "";
253
+ case "UPDATE":
254
+ return e.ua && e.nonce != null ? `UPDATE:${e.name}:${e.ua}:${e.nonce}` : "";
255
+ default:
256
+ return "";
257
+ }
258
+ }
259
+ async verifyEd25519(payload, signatureB64, pubkeyB64) {
260
+ const sigBytes = this.decodeBase64(signatureB64);
261
+ const pkBytes = this.decodeBase64(pubkeyB64);
262
+ if (sigBytes.length !== 64 || pkBytes.length !== 32) return false;
263
+ try {
264
+ const key = await crypto.subtle.importKey("raw", pkBytes.buffer, { name: "Ed25519" }, false, ["verify"]);
265
+ return crypto.subtle.verify("Ed25519", key, sigBytes.buffer, new TextEncoder().encode(payload));
266
+ } catch {
267
+ return false;
268
+ }
269
+ }
270
+ requireValidName(name) {
271
+ if (!NAME_RE.test(name)) throw new Error(`Invalid ZNS name: ${name}`);
272
+ }
273
+ memoUri(memo) {
274
+ return this._registryAddress ? this.buildZcashUri(this._registryAddress, void 0, memo) : `zcash:?memo=${this.toBase64Url(memo)}`;
275
+ }
276
+ buildZcashUri(address, amount, memo) {
277
+ if (!address) return "";
278
+ const base = `zcash:${address}`;
279
+ const params = [];
280
+ if (amount !== void 0 && amount > 0) params.push(`amount=${amount}`);
281
+ if (memo) params.push(`memo=${this.toBase64Url(memo)}`);
282
+ return params.length ? `${base}?${params.join("&")}` : base;
283
+ }
284
+ toBase64Url(text) {
285
+ try {
286
+ return btoa(unescape(encodeURIComponent(text))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
287
+ } catch {
288
+ return "";
289
+ }
290
+ }
291
+ decodeBase64Url(value) {
292
+ try {
293
+ const normalized = String(value).replace(/-/g, "+").replace(/_/g, "/");
294
+ const padLen = normalized.length % 4 === 0 ? 0 : 4 - normalized.length % 4;
295
+ const padded = normalized + "=".repeat(padLen);
296
+ const binary = atob(padded);
297
+ const bytes = Uint8Array.from(binary, (c) => c.charCodeAt(0));
298
+ return new TextDecoder().decode(bytes);
299
+ } catch {
300
+ return "";
301
+ }
302
+ }
303
+ decodeBase64(s) {
304
+ const bin = atob(s);
305
+ const bytes = new Uint8Array(bin.length);
306
+ for (let i = 0; i < bin.length; i++) bytes[i] = bin.charCodeAt(i);
307
+ return bytes;
308
+ }
309
+ async rpc(method, params = {}) {
310
+ const id = ++this.rpcId;
311
+ const body = JSON.stringify({ jsonrpc: "2.0", id, method, params });
312
+ const res = await fetch(this.url, {
313
+ method: "POST",
314
+ headers: { "Content-Type": "application/json" },
315
+ body
316
+ });
317
+ if (!res.ok) {
318
+ throw new Error(`ZNS HTTP ${res.status}: ${res.statusText}`);
319
+ }
320
+ const json = await res.json();
321
+ if (json.error) {
322
+ throw new Error(`ZNS RPC error ${json.error.code}: ${json.error.message}`);
323
+ }
324
+ return json.result;
325
+ }
326
+ };
327
+ // Annotate the CommonJS export names for ESM import in node:
328
+ 0 && (module.exports = {
329
+ DEFAULT_URL,
330
+ MAINNET_UIVK,
331
+ TESTNET_UIVK,
332
+ ZNS
333
+ });
package/dist/zns.d.cts ADDED
@@ -0,0 +1,142 @@
1
+ interface Registration {
2
+ name: string;
3
+ address: string;
4
+ txid: string;
5
+ height: number;
6
+ nonce: number;
7
+ signature: string | null;
8
+ last_action: LastAction;
9
+ pubkey: string | null;
10
+ }
11
+ type LastAction = "CLAIM" | "BUY" | "UPDATE" | "DELIST" | "RELEASE";
12
+ interface Listing {
13
+ name: string;
14
+ price: number;
15
+ nonce: number;
16
+ txid: string;
17
+ height: number;
18
+ signature: string;
19
+ }
20
+ interface ResolveResult extends Registration {
21
+ listing: VerifiedListing | null;
22
+ verified: boolean;
23
+ sovereign: boolean;
24
+ }
25
+ interface VerifiedListing extends Listing {
26
+ verified: boolean;
27
+ }
28
+ interface Pricing {
29
+ nonce: number;
30
+ height: number;
31
+ tiers: number[];
32
+ }
33
+ interface StatusResult {
34
+ synced_height: number;
35
+ admin_pubkey: string;
36
+ uivk: string;
37
+ address: string;
38
+ registered: number;
39
+ listed: number;
40
+ pricing: Pricing | null;
41
+ }
42
+ interface Event {
43
+ id: number;
44
+ name: string;
45
+ action: Action;
46
+ txid: string;
47
+ height: number;
48
+ ua: string | null;
49
+ price: number | null;
50
+ nonce: number | null;
51
+ signature: string | null;
52
+ pubkey: string | null;
53
+ verified?: boolean;
54
+ }
55
+ type Action = "CLAIM" | "LIST" | "DELIST" | "RELEASE" | "UPDATE" | "BUY" | "SETPRICE";
56
+ interface EventsFilter {
57
+ name?: string;
58
+ action?: string;
59
+ since_height?: number;
60
+ limit?: number;
61
+ offset?: number;
62
+ }
63
+ interface EventsResult {
64
+ events: Event[];
65
+ total: number;
66
+ }
67
+ interface PreparedAction {
68
+ payload: string;
69
+ cost?: number;
70
+ uri?: string;
71
+ }
72
+ interface CompletedAction {
73
+ memo: string;
74
+ uri: string;
75
+ }
76
+
77
+ declare const DEFAULT_URL = "https://light.zcash.me/zns-testnet";
78
+ declare const TESTNET_UIVK = "uivktest1hzw7wyadutvzfgpna80yftsk5l7jeyu2p5me5quvp28tytxueta00cx4068wnlzcv7tx9n3t3gfhsy83pe4y6jrhxtzaq0hj6xtg5zrk2dn7zen3vns2a5pgs4fxdjlletmqrhfa42";
79
+ declare const MAINNET_UIVK = "uivk1gl26qy0xjja7lqhyg3pf0x4j4j66kqwewrjkdcg28eqq4wgtzjmujpee7x9cs2ec9xhnlgrm8ptlw8z80j2aryw8nqtssser2ys778a0s00uvgkdjnfr58sndhfvc3f4zqjs6ywva6";
80
+ declare class ZNS {
81
+ private url;
82
+ private rpcId;
83
+ private _adminPubkey;
84
+ private _pricing;
85
+ private _registryAddress;
86
+ private _verified;
87
+ private constructor();
88
+ static create(options?: {
89
+ url?: string;
90
+ skipVerify?: boolean;
91
+ }): Promise<ZNS>;
92
+ private pinStatus;
93
+ get verified(): boolean;
94
+ get adminPubkey(): string | null;
95
+ get pricing(): Pricing | null;
96
+ get registryAddress(): string | null;
97
+ resolve(query: string): Promise<ResolveResult | ResolveResult[] | null>;
98
+ isAvailable(name: string): Promise<boolean>;
99
+ listings(): Promise<VerifiedListing[]>;
100
+ status(): Promise<StatusResult>;
101
+ events(filter?: EventsFilter): Promise<EventsResult>;
102
+ prepareClaim(name: string, address: string): PreparedAction;
103
+ completeClaim(name: string, address: string, signature: string, userPubkey?: string): CompletedAction;
104
+ prepareList(name: string, price: number, nonce: number): PreparedAction;
105
+ completeList(name: string, price: number, nonce: number, signature: string, userPubkey?: string): CompletedAction;
106
+ prepareDelist(name: string, nonce: number): PreparedAction;
107
+ completeDelist(name: string, nonce: number, signature: string, userPubkey?: string): CompletedAction;
108
+ prepareUpdate(name: string, newAddress: string, nonce: number): PreparedAction;
109
+ completeUpdate(name: string, newAddress: string, nonce: number, signature: string, userPubkey?: string): CompletedAction;
110
+ prepareBuy(name: string, buyerAddress: string): PreparedAction;
111
+ completeBuy(name: string, buyerAddress: string, signature: string, userPubkey?: string): CompletedAction;
112
+ prepareRelease(name: string, nonce: number): PreparedAction;
113
+ completeRelease(name: string, nonce: number, signature: string, userPubkey?: string): CompletedAction;
114
+ prepareSetPrice(prices: number[], nonce: number): PreparedAction;
115
+ completeSetPrice(prices: number[], nonce: number, signature: string): CompletedAction;
116
+ isValidName(name: string): boolean;
117
+ claimCost(nameLength: number): number | null;
118
+ parseZip321Uri(uri: string): {
119
+ address: string;
120
+ amount: string;
121
+ memoRaw: string;
122
+ memoDecoded: string;
123
+ };
124
+ private enrichRegistration;
125
+ private verifyRegistration;
126
+ private verifyListing;
127
+ private enrichListing;
128
+ private enrichEvent;
129
+ private registrationPayload;
130
+ private listingPayload;
131
+ private eventPayload;
132
+ private verifyEd25519;
133
+ private requireValidName;
134
+ private memoUri;
135
+ private buildZcashUri;
136
+ private toBase64Url;
137
+ private decodeBase64Url;
138
+ private decodeBase64;
139
+ private rpc;
140
+ }
141
+
142
+ export { type Action, type CompletedAction, DEFAULT_URL, type Event, type EventsFilter, type EventsResult, type LastAction, type Listing, MAINNET_UIVK, type PreparedAction, type Pricing, type Registration, type ResolveResult, type StatusResult, TESTNET_UIVK, type VerifiedListing, ZNS };