domani 0.4.12 → 1.0.0

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.
@@ -0,0 +1,1582 @@
1
+ export interface DomaniOptions {
2
+ /** API key from https://domani.run. Sent as `Authorization: Bearer <apiKey>`. */
3
+ apiKey: string;
4
+ /** Override the API base URL. Defaults to https://domani.run. */
5
+ baseUrl?: string;
6
+ /** Custom fetch implementation (defaults to global fetch). */
7
+ fetch?: typeof fetch;
8
+ }
9
+ /** Structured API error - mirrors the `apiError()` shape returned by the API. */
10
+ export declare class DomaniError extends Error {
11
+ status: number;
12
+ code: string;
13
+ hint?: string;
14
+ documentation_url?: string;
15
+ constructor(status: number, body: any);
16
+ }
17
+ export interface Error {
18
+ /** Human-readable error message */
19
+ error: string;
20
+ /** Machine-readable error code */
21
+ code: "MISSING_API_KEY" | "INVALID_API_KEY" | "EXPIRED_API_KEY" | "MISSING_PARAMETER" | "INVALID_DOMAIN" | "PAYMENT_REQUIRED" | "DOMAIN_UNAVAILABLE" | "RATE_LIMIT_EXCEEDED" | "USER_EXISTS" | "NOT_FOUND" | "UNKNOWN_PROVIDER" | "UNKNOWN_METHOD" | "TARGET_REQUIRED" | "INVALID_PARAMETER" | "CONTACT_REQUIRED" | "INVALID_CONTACT" | "INSUFFICIENT_SCOPE" | "SCOPE_ESCALATION" | "DOMAIN_EXISTS" | "DOMAIN_NOT_ACTIVE" | "UNSUPPORTED_TLD" | "NOT_AVAILABLE" | "ALREADY_REGISTERED" | "TRANSFER_NOT_ELIGIBLE" | "ALREADY_LISTED" | "LISTING_SOLD" | "SELF_PURCHASE" | "DESCRIPTION_TOO_LONG" | "DEAL_NOT_FOUND" | "INVALID_DEAL_STATE" | "EPP_ATTEMPTS_EXCEEDED" | "ACTIVE_DEAL_EXISTS";
22
+ /** Actionable recovery guidance for the caller */
23
+ hint?: string;
24
+ /** CLI command to resolve the error (e.g. 'domani login', 'domani billing'). Present in CLI --json output. */
25
+ fix_command?: string;
26
+ /** Link to relevant documentation */
27
+ documentation_url: string;
28
+ /** URL to resolve the issue (e.g. add payment method) */
29
+ setup_url?: string;
30
+ /** URL to resolve the issue (alias for setup_url in CLI --json output) */
31
+ fix_url?: string;
32
+ /** Seconds until retry is allowed (present on 429 responses) */
33
+ retry_after?: number;
34
+ }
35
+ export interface SearchResult {
36
+ /** Whether the domain is available for registration */
37
+ available: boolean;
38
+ /** Full domain name including TLD */
39
+ domain: string;
40
+ /** Registration price in the specified currency */
41
+ price: number;
42
+ /** ISO 4217 currency code (always USD) */
43
+ currency: string;
44
+ /** True if RDAP lookup failed (availability unknown) */
45
+ error?: boolean;
46
+ /** Present when the domain is listed for sale (either on Domani marketplace or detected on an external aftermarket) */
47
+ for_sale?: {
48
+ price: number;
49
+ currency: string;
50
+ source: string;
51
+ buyable: boolean;
52
+ url?: string;
53
+ description?: string;
54
+ };
55
+ }
56
+ export interface TldInfo {
57
+ /** Top-level domain without dot prefix */
58
+ tld: string;
59
+ /** First-year registration price in USD */
60
+ registration: number;
61
+ /** Annual renewal price in USD */
62
+ renewal: number;
63
+ /** Transfer price in USD */
64
+ transfer: number;
65
+ }
66
+ export interface DnsRecord {
67
+ /** DNS record type */
68
+ type: "A" | "AAAA" | "CNAME" | "MX" | "TXT" | "NS" | "SRV" | "CAA";
69
+ /** Record name (@ for root, or subdomain) */
70
+ name: string;
71
+ /** Record value (IP address, hostname, etc.) */
72
+ value: string;
73
+ /** Time to live in seconds */
74
+ ttl: number;
75
+ /** Priority value (required for MX records) */
76
+ priority?: number;
77
+ }
78
+ export interface DomainRecord {
79
+ domain: string;
80
+ /** Current registration status */
81
+ status: "active" | "expired" | "pending";
82
+ /** Whether auto-renew is enabled */
83
+ auto_renew: boolean;
84
+ purchasedAt: string;
85
+ expiresAt: string;
86
+ /** Whether email is set up for this domain */
87
+ emailEnabled: boolean;
88
+ /** Whether email DNS records have been verified */
89
+ emailVerified: boolean;
90
+ /** When email DNS was verified (null if not yet verified) */
91
+ emailVerifiedAt?: string | null;
92
+ /** Number of mailboxes configured for this domain */
93
+ mailboxCount: number;
94
+ }
95
+ export interface Backorder {
96
+ id?: string;
97
+ domain?: string;
98
+ status?: "watching" | "caught" | "failed" | "cancelled" | "expired";
99
+ payment_method?: "card" | "balance";
100
+ /** Max USD you'll pay to catch it */
101
+ max_price?: number;
102
+ currency?: string;
103
+ /** Current registration's expiry (informational) */
104
+ domain_expires?: string | null;
105
+ last_checked?: string | null;
106
+ /** Number of availability checks performed */
107
+ attempts?: number;
108
+ caught_at?: string | null;
109
+ /** ID of the Domain created when caught */
110
+ registered_domain_id?: string | null;
111
+ failure_reason?: string | null;
112
+ /** When the watch window ends */
113
+ expires_at?: string;
114
+ created_at?: string;
115
+ }
116
+ export interface DealInvoice {
117
+ deal_id?: string;
118
+ domain?: string;
119
+ date?: string;
120
+ status?: string;
121
+ your_role?: "buyer" | "seller";
122
+ currency?: string;
123
+ line_items?: {
124
+ description?: string;
125
+ amount?: number;
126
+ }[];
127
+ /** Buyer: amount paid. Seller: net payout after commission. */
128
+ total?: number;
129
+ /** Platform commission percent */
130
+ commission_rate?: number;
131
+ /** Platform commission in USD */
132
+ commission_amount?: number;
133
+ /** Buyer only */
134
+ payment_method?: string;
135
+ /** Seller only */
136
+ payout_method?: "bank" | "balance";
137
+ /** Seller only */
138
+ payout_status?: "paid" | "credited" | "pending";
139
+ }
140
+ export interface BrokerRequest {
141
+ id?: string;
142
+ domain?: string;
143
+ status?: "sourcing" | "contacted" | "negotiating" | "agreed" | "completed" | "no_contact" | "declined" | "expired" | "cancelled";
144
+ /** Your ceiling in USD */
145
+ max_budget?: number | null;
146
+ /** Whether the owner has been reached */
147
+ contacted?: boolean;
148
+ /** Set once the owner engages and a negotiation opens */
149
+ negotiation_id?: string | null;
150
+ failure_reason?: string | null;
151
+ expires_at?: string;
152
+ created_at?: string;
153
+ }
154
+ export interface Negotiation {
155
+ id?: string;
156
+ domain?: string;
157
+ status?: "open" | "agreed" | "completed" | "declined" | "expired" | "cancelled";
158
+ your_role?: "buyer" | "seller";
159
+ /** True when it's your move to respond */
160
+ your_turn?: boolean;
161
+ /** Latest amount on the table (USD) */
162
+ current_offer?: number;
163
+ /** Set once the price is agreed */
164
+ agreed_price?: number | null;
165
+ /** The listing's asking price (USD) */
166
+ list_price?: number;
167
+ expires_at?: string;
168
+ /** Set once finalized into a deal */
169
+ deal_id?: string | null;
170
+ created_at?: string;
171
+ /** The negotiation thread, oldest first */
172
+ offers?: {
173
+ from?: "you" | "counterparty";
174
+ kind?: "offer" | "counter" | "accept" | "decline";
175
+ amount?: number | null;
176
+ message?: string | null;
177
+ at?: string;
178
+ }[];
179
+ }
180
+ export interface DomainDetail {
181
+ domain: string;
182
+ status: "active" | "expired" | "pending";
183
+ /** Whether auto-renew is enabled */
184
+ auto_renew: boolean;
185
+ purchased_at: string;
186
+ expires_at: string;
187
+ /** Days until domain expiry */
188
+ days_until_expiry: number;
189
+ /** How the domain was paid for */
190
+ payment_method: "card" | "x402" | "crypto";
191
+ /** On-chain tx hash (USDC payments) */
192
+ payment_tx?: string | null;
193
+ /** Domain registration details (null if unavailable) */
194
+ registrar?: {
195
+ security_lock?: boolean;
196
+ whois_privacy?: boolean;
197
+ auto_renew?: boolean;
198
+ create_date?: string;
199
+ expire_date?: string;
200
+ } | null;
201
+ }
202
+ export interface TokenInfo {
203
+ /** Unique token identifier (use this for DELETE) */
204
+ id: string;
205
+ /** Human-readable token label */
206
+ name: string;
207
+ /** Masked API key (full key shown only on creation) */
208
+ key: string;
209
+ /** Last time this token was used */
210
+ lastUsed?: string | null;
211
+ /** When this token expires (null = never) */
212
+ expiresAt?: string | null;
213
+ /** Whether this token has expired */
214
+ expired?: boolean;
215
+ /** Permission scopes granted to this token. ['*'] means full access. */
216
+ scopes?: string[];
217
+ createdAt: string;
218
+ }
219
+ export interface Contact {
220
+ /** Contact name */
221
+ name?: string | null;
222
+ /** Organization name */
223
+ organization?: string | null;
224
+ /** Contact email */
225
+ email?: string | null;
226
+ /** Phone number */
227
+ phone?: string | null;
228
+ /** Fax number */
229
+ fax?: string | null;
230
+ /** Street address */
231
+ street?: string | null;
232
+ /** City */
233
+ city?: string | null;
234
+ /** State or province */
235
+ state?: string | null;
236
+ /** Postal/ZIP code */
237
+ postal_code?: string | null;
238
+ /** Country code or name */
239
+ country?: string | null;
240
+ }
241
+ export interface RegistrantContact {
242
+ /** First name */
243
+ first_name: string;
244
+ /** Last name */
245
+ last_name: string;
246
+ /** Organization name (optional) */
247
+ org_name?: string | null;
248
+ /** Street address line 1 */
249
+ address1: string;
250
+ /** Street address line 2 (optional) */
251
+ address2?: string | null;
252
+ /** City */
253
+ city: string;
254
+ /** State or province */
255
+ state: string;
256
+ /** Postal/ZIP code */
257
+ postal_code: string;
258
+ /** ISO 3166-1 alpha-2 country code (e.g. US, GB, FR) */
259
+ country: string;
260
+ /** Phone in +CC.NUMBER format (e.g. +1.5551234567) */
261
+ phone: string;
262
+ /** Contact email address */
263
+ email: string;
264
+ }
265
+ export interface AccountInfo {
266
+ id: string;
267
+ email: string;
268
+ /** Whether the user has a card on file (required before buying domains) */
269
+ has_payment_method: boolean;
270
+ /** Whether the user has set WHOIS contact info (required before purchasing domains) */
271
+ has_contact: boolean;
272
+ /** Registrant contact info (null if not set) */
273
+ contact?: RegistrantContact;
274
+ /** Your unique referral code */
275
+ referral_code: string;
276
+ /** Commission percentage on referred purchases */
277
+ referral_rate: number;
278
+ /** Marketplace credit balance in USD (earned from sales) */
279
+ balance?: number;
280
+ /** Number of domains owned */
281
+ domain_count: number;
282
+ /** Number of active API tokens */
283
+ token_count: number;
284
+ created_at: string;
285
+ }
286
+ export declare class Domani {
287
+ private apiKey;
288
+ private baseUrl;
289
+ private fetchImpl;
290
+ constructor(opts: DomaniOptions);
291
+ request<T = unknown>(method: string, path: string, opts?: {
292
+ query?: Record<string, unknown>;
293
+ body?: unknown;
294
+ }): Promise<T>;
295
+ /** Add a mailbox alias (POST /api/emails/{address}/aliases) */
296
+ addMailboxAlias(address: string, body: {
297
+ alias: string;
298
+ }): Promise<{
299
+ address?: string;
300
+ mailbox?: string;
301
+ created_at?: string;
302
+ hint?: string;
303
+ }>;
304
+ /** Add a suppression (POST /api/suppressions) */
305
+ addSuppression(body: {
306
+ address: string;
307
+ reason?: "manual" | "hard_bounce" | "complaint";
308
+ }): Promise<{
309
+ address?: string;
310
+ reason?: string;
311
+ source?: string;
312
+ created_at?: string;
313
+ hint?: string;
314
+ }>;
315
+ /** Purchase one or more domains (POST /api/domains/buy) */
316
+ buyDomain(body: {
317
+ domain?: string;
318
+ domains?: string[];
319
+ payment_method?: "card" | "usdc" | "balance";
320
+ payment_tx?: string;
321
+ payment_chain?: "base" | "ethereum";
322
+ years?: number;
323
+ ref?: string;
324
+ }): Promise<{
325
+ domain?: string;
326
+ status?: "active";
327
+ expires?: string;
328
+ price?: number;
329
+ currency?: string;
330
+ years?: number;
331
+ payment_method?: "card" | "x402" | "crypto";
332
+ payment_tx?: string;
333
+ marketplace_purchase?: boolean;
334
+ }>;
335
+ /** Cancel a backorder (DELETE /api/backorders/{id}) */
336
+ cancelBackorder(id: string): Promise<{
337
+ id?: string;
338
+ status?: string;
339
+ hint?: string;
340
+ }>;
341
+ /** Cancel a broker request (DELETE /api/broker/{id}) */
342
+ cancelBrokerRequest(id: string): Promise<{
343
+ cancelled?: boolean;
344
+ }>;
345
+ /** Cancel a domain listing (DELETE /api/domains/{domain}/for-sale) */
346
+ cancelListing(domain: string): Promise<{
347
+ domain?: string;
348
+ status?: "cancelled";
349
+ hint?: string;
350
+ }>;
351
+ /** Withdraw a negotiation (DELETE /api/negotiations/{id}) */
352
+ cancelNegotiation(id: string): Promise<{
353
+ cancelled?: boolean;
354
+ }>;
355
+ /** Check email DNS health (MX, SPF, DMARC, DKIM) (GET /api/domains/{domain}/email/check) */
356
+ checkEmail(domain: string): Promise<{
357
+ domain?: string;
358
+ provider?: string | null;
359
+ mx?: {
360
+ configured?: boolean;
361
+ records?: string[];
362
+ };
363
+ spf?: {
364
+ configured?: boolean;
365
+ value?: string | null;
366
+ };
367
+ dmarc?: {
368
+ configured?: boolean;
369
+ value?: string | null;
370
+ };
371
+ dkim?: {
372
+ configured?: boolean;
373
+ selectors?: string[];
374
+ };
375
+ }>;
376
+ /** Pre-check transfer eligibility (GET /api/domains/transfer-check) */
377
+ checkTransferEligibility(query?: {
378
+ domain: string;
379
+ }): Promise<{
380
+ domain: string;
381
+ tld: string;
382
+ eligible: boolean;
383
+ price: number | null;
384
+ currency: string;
385
+ reason?: string;
386
+ code?: "UNSUPPORTED_TLD" | "NOT_AVAILABLE" | "ALREADY_REGISTERED" | "TRANSFER_NOT_ELIGIBLE";
387
+ eligible_at?: string;
388
+ hint?: string;
389
+ }>;
390
+ /** Check inbound transfer status (GET /api/domains/{domain}/transfer-status) */
391
+ checkTransferStatus(domain: string): Promise<{
392
+ domain: string;
393
+ status: "pending_owner" | "pending_admin" | "pending_registry" | "completed" | "cancelled" | "unknown";
394
+ timestamp?: string;
395
+ hint: string;
396
+ }>;
397
+ /** Clear domain catch-all (DELETE /api/domains/{domain}/email/catch-all) */
398
+ clearCatchAll(domain: string): Promise<{
399
+ domain?: string;
400
+ catch_all?: string | null;
401
+ hint?: string;
402
+ }>;
403
+ /** Stop forwarding a domain (DELETE /api/domains/{domain}/redirect) */
404
+ clearDomainRedirect(domain: string): Promise<{
405
+ domain?: string;
406
+ redirect_url?: string | null;
407
+ }>;
408
+ /** Connect a domain to a hosting or email provider (POST /api/domains/{domain}/connect) */
409
+ connectDomain(domain: string, body: {
410
+ target?: string;
411
+ provider?: string;
412
+ method?: string;
413
+ }): Promise<{
414
+ domain?: string;
415
+ provider?: string;
416
+ category?: "hosting" | "email";
417
+ method?: string;
418
+ records?: DnsRecord[];
419
+ docs?: string;
420
+ status?: "dns_set" | "manual_setup_required";
421
+ hint?: string;
422
+ next_steps?: string[];
423
+ }>;
424
+ /** Place a backorder on a taken domain (POST /api/backorders) */
425
+ createBackorder(body: {
426
+ domain: string;
427
+ max_price?: number;
428
+ payment_method?: "card" | "balance";
429
+ }): Promise<{
430
+ backorder?: Backorder;
431
+ hint?: string;
432
+ }>;
433
+ /** Request acquisition of a taken domain (POST /api/broker) */
434
+ createBrokerRequest(body: {
435
+ domain: string;
436
+ max_budget?: number;
437
+ }): Promise<{
438
+ request?: BrokerRequest;
439
+ }>;
440
+ /** Purchase an external domain (create deal) (POST /api/deals) */
441
+ createDeal(body: {
442
+ domain: string;
443
+ payment_method?: "card" | "usdc" | "balance";
444
+ }): Promise<{
445
+ deal?: Record<string, unknown>;
446
+ hint?: string;
447
+ next_steps?: string[];
448
+ }>;
449
+ /** List a domain for sale (PUT /api/domains/{domain}/for-sale) */
450
+ createListing(domain: string, body: {
451
+ price: number;
452
+ description?: string;
453
+ }): Promise<{
454
+ listing?: {
455
+ id?: string;
456
+ domain?: string;
457
+ price?: number;
458
+ currency?: string;
459
+ description?: string | null;
460
+ status?: "active";
461
+ created_at?: string;
462
+ };
463
+ hint?: string;
464
+ }>;
465
+ /** Create a mailbox on domani.run (POST /api/email) */
466
+ createMailbox(body: {
467
+ slug: string;
468
+ name?: string;
469
+ }): Promise<{
470
+ id?: string;
471
+ address?: string;
472
+ slug?: string;
473
+ domain?: string;
474
+ }>;
475
+ /** Create a mailbox (POST /api/emails) */
476
+ createMailboxByAddress(body?: {
477
+ address: string;
478
+ name?: string;
479
+ force?: boolean;
480
+ }): Promise<{
481
+ id?: string;
482
+ address?: string;
483
+ name?: string | null;
484
+ domain?: string;
485
+ slug?: string;
486
+ webhook_url?: string | null;
487
+ forward_to?: string | null;
488
+ signing_secret?: string;
489
+ }>;
490
+ /** Create a new API token (POST /api/tokens) */
491
+ createToken(body: {
492
+ name?: string;
493
+ expires_in?: number;
494
+ expires_at?: string;
495
+ scopes?: string[];
496
+ }): Promise<{
497
+ id?: string;
498
+ name?: string;
499
+ key?: string;
500
+ expiresAt?: string | null;
501
+ scopes?: string[];
502
+ createdAt?: string;
503
+ }>;
504
+ /** Create webhook (POST /api/webhooks) */
505
+ createWebhook(body: {
506
+ url: string;
507
+ events: string[];
508
+ }): Promise<{
509
+ id?: string;
510
+ url?: string;
511
+ events?: string[];
512
+ secret?: string;
513
+ active?: boolean;
514
+ created_at?: string;
515
+ hint?: string;
516
+ }>;
517
+ /** Delete account and all associated data (DELETE /api/me) */
518
+ deleteAccount(): Promise<{
519
+ deleted?: boolean;
520
+ hint?: string;
521
+ }>;
522
+ /** Delete a mailbox (DELETE /api/emails/{address}) */
523
+ deleteMailboxByAddress(address: string, body?: {
524
+ confirm?: boolean;
525
+ }): Promise<unknown>;
526
+ /** Delete a message (DELETE /api/emails/{address}/messages/{id}) */
527
+ deleteMessageByAddress(address: string, id: string): Promise<{
528
+ id?: string;
529
+ deleted?: boolean;
530
+ }>;
531
+ /** Bulk delete messages (POST /api/emails/{address}/messages/delete) */
532
+ deleteMessagesByAddress(address: string, body?: {
533
+ message_ids: string[];
534
+ }): Promise<{
535
+ count?: number;
536
+ }>;
537
+ /** Delete webhook (DELETE /api/webhooks/{id}) */
538
+ deleteWebhook(id: string): Promise<{
539
+ success?: boolean;
540
+ hint?: string;
541
+ }>;
542
+ /** Fast DNS-based domain existence check (GET /api/domains/dns-check) */
543
+ dnsCheck(query?: {
544
+ name: string;
545
+ tlds: string;
546
+ }): Promise<{
547
+ name?: string;
548
+ taken?: string[];
549
+ candidates?: string[];
550
+ }>;
551
+ /** Finalize an agreed negotiation (pay) (POST /api/negotiations/{id}/finalize) */
552
+ finalizeNegotiation(id: string, body?: {
553
+ payment_method?: "card" | "usdc" | "balance";
554
+ payment_signature?: string | null;
555
+ payment_tx?: string;
556
+ payment_chain?: string;
557
+ confirm_over_budget?: boolean;
558
+ }): Promise<unknown>;
559
+ /** Forward a message (POST /api/emails/{address}/messages/{id}/forward) */
560
+ forwardMessageByAddress(address: string, id: string, body?: {
561
+ to: string;
562
+ text?: string;
563
+ }): Promise<{
564
+ id?: string;
565
+ message_id?: string;
566
+ from?: string;
567
+ to?: string;
568
+ status?: string;
569
+ }>;
570
+ /** Get current account details (GET /api/me) */
571
+ getAccount(): Promise<AccountInfo>;
572
+ /** Get EPP auth code (GET /api/domains/{domain}/auth-code) */
573
+ getAuthCode(domain: string): Promise<{
574
+ domain: string;
575
+ auth_code: string;
576
+ was_unlocked: boolean;
577
+ hint: string;
578
+ next_steps: string[];
579
+ }>;
580
+ /** Get a backorder (GET /api/backorders/{id}) */
581
+ getBackorder(id: string): Promise<{
582
+ backorder?: Backorder;
583
+ }>;
584
+ /** Read a broker inquiry's state (owner side) (GET /api/broker/respond) */
585
+ getBrokerInquiryState(query?: {
586
+ token: string;
587
+ }): Promise<{
588
+ domain?: string;
589
+ status?: string;
590
+ your_turn?: boolean;
591
+ current_offer_usd?: number | null;
592
+ agreed_price_usd?: number | null;
593
+ actions?: string[];
594
+ }>;
595
+ /** Get a broker request (GET /api/broker/{id}) */
596
+ getBrokerRequest(id: string): Promise<{
597
+ request?: BrokerRequest;
598
+ }>;
599
+ /** Get registrant contact info (GET /api/me/contact) */
600
+ getContact(): Promise<{
601
+ has_contact?: boolean;
602
+ contact?: RegistrantContact;
603
+ }>;
604
+ /** Get deal detail with timeline (GET /api/deals/{id}) */
605
+ getDeal(id: string): Promise<{
606
+ deal?: {
607
+ id?: string;
608
+ domain?: string;
609
+ price?: number;
610
+ currency?: string;
611
+ fee?: number;
612
+ seller_credit?: number;
613
+ status?: "escrow_held" | "epp_pending" | "transfer_started" | "completed" | "refunded" | "expired";
614
+ role?: "buyer" | "seller";
615
+ payment_method?: string;
616
+ epp_deadline?: string | null;
617
+ transfer_deadline?: string | null;
618
+ completed_at?: string | null;
619
+ created_at?: string;
620
+ events?: {
621
+ status?: string;
622
+ detail?: string | null;
623
+ created_at?: string;
624
+ }[];
625
+ };
626
+ hint?: string;
627
+ }>;
628
+ /** Get a deal receipt / statement (GET /api/deals/{id}/invoice) */
629
+ getDealInvoice(id: string): Promise<{
630
+ invoice?: DealInvoice;
631
+ }>;
632
+ /** Get DNS records for a domain you own (GET /api/domains/{domain}/dns) */
633
+ getDnsRecords(domain: string): Promise<{
634
+ domain?: string;
635
+ records?: DnsRecord[];
636
+ }>;
637
+ /** Check email DNS status (GET /api/domains/{domain}/email/status) */
638
+ getDomainEmailStatus(domain: string): Promise<{
639
+ domain?: string;
640
+ verified?: boolean;
641
+ records?: DnsRecord[];
642
+ mailbox_count?: number;
643
+ }>;
644
+ /** Get detailed information about a domain you own (GET /api/domains/{domain}) */
645
+ getDomainInfo(domain: string): Promise<DomainDetail>;
646
+ /** Get website preview metadata for a domain (GET /api/domains/{domain}/og) */
647
+ getDomainOg(domain: string): Promise<{
648
+ title: string | null;
649
+ description: string | null;
650
+ image: string | null;
651
+ favicon: string | null;
652
+ }>;
653
+ /** Check domain health: DNS, SSL, email, expiry (GET /api/domains/{domain}/status) */
654
+ getDomainStatus(domain: string): Promise<{
655
+ domain?: string;
656
+ status?: string;
657
+ expires?: string;
658
+ days_until_expiry?: number;
659
+ dns?: {
660
+ propagated?: boolean;
661
+ a?: string[];
662
+ aaaa?: string[];
663
+ cname?: string[];
664
+ mx?: string[];
665
+ txt?: string[];
666
+ ns?: string[];
667
+ registrar_records?: DnsRecord[];
668
+ };
669
+ ssl?: {
670
+ active?: boolean;
671
+ };
672
+ email?: {
673
+ configured?: boolean;
674
+ mx?: string[];
675
+ };
676
+ }>;
677
+ /** Get mailbox avatar info (GET /api/emails/{address}/avatar) */
678
+ getMailboxAvatarByAddress(address: string): Promise<{
679
+ address?: string;
680
+ gravatar_url?: string | null;
681
+ gravatar_signup?: string;
682
+ has_avatar?: boolean;
683
+ hint?: string;
684
+ }>;
685
+ /** Get mailbox details (GET /api/emails/{address}) */
686
+ getMailboxByAddress(address: string): Promise<{
687
+ id?: string;
688
+ address?: string;
689
+ slug?: string;
690
+ domain?: string;
691
+ webhook_url?: string | null;
692
+ forward_to?: string | null;
693
+ signing_secret?: string;
694
+ message_count?: number;
695
+ created_at?: string;
696
+ }>;
697
+ /** Get mailbox webhook config (GET /api/emails/{address}/webhook) */
698
+ getMailboxWebhook(address: string): Promise<{
699
+ address?: string;
700
+ webhook_url?: string | null;
701
+ signing_secret?: string | null;
702
+ has_webhook?: boolean;
703
+ hint?: string;
704
+ }>;
705
+ /** Get a message (GET /api/emails/{address}/messages/{id}) */
706
+ getMessageByAddress(address: string, id: string): Promise<{
707
+ id?: string;
708
+ message_id?: string | null;
709
+ direction?: "in" | "out";
710
+ from?: string;
711
+ to?: string;
712
+ cc?: string | null;
713
+ reply_to?: string | null;
714
+ subject?: string;
715
+ text?: string | null;
716
+ html?: string | null;
717
+ in_reply_to?: string | null;
718
+ references?: string | null;
719
+ attachments?: {
720
+ filename?: string;
721
+ content_type?: string;
722
+ size?: number;
723
+ url?: string | null;
724
+ }[];
725
+ status?: string;
726
+ is_read?: boolean;
727
+ read_at?: string | null;
728
+ events?: {
729
+ status?: string;
730
+ detail?: Record<string, unknown> | null;
731
+ created_at?: string;
732
+ }[];
733
+ created_at?: string;
734
+ }>;
735
+ /** Get nameservers for a domain (GET /api/domains/{domain}/nameservers) */
736
+ getNameservers(domain: string): Promise<{
737
+ domain?: string;
738
+ nameservers?: string[];
739
+ default_nameservers?: string[] | null;
740
+ hint?: string;
741
+ }>;
742
+ /** Get a negotiation thread (GET /api/negotiations/{id}) */
743
+ getNegotiation(id: string): Promise<{
744
+ negotiation?: Negotiation;
745
+ }>;
746
+ /** Get notification preferences (GET /api/notifications/preferences) */
747
+ getNotificationPreferences(): Promise<{
748
+ preferences?: {
749
+ category?: "domains" | "transfers" | "marketplace" | "email" | "inquiries";
750
+ label?: string;
751
+ description?: string;
752
+ channel?: "in_app" | "email";
753
+ enabled?: boolean;
754
+ }[];
755
+ }>;
756
+ /** Get parking analytics (GET /api/domains/{domain}/analytics) */
757
+ getParkingAnalytics(domain: string): Promise<{
758
+ domain?: string;
759
+ views_7d?: number;
760
+ views_30d?: number;
761
+ inquiries_30d?: number;
762
+ conversion_rate?: number;
763
+ daily_views?: {
764
+ date?: string;
765
+ views?: number;
766
+ }[];
767
+ recent_inquiries?: {
768
+ email?: string;
769
+ offer?: number | null;
770
+ date?: string;
771
+ }[];
772
+ hint?: string;
773
+ }>;
774
+ /** Get marketplace payout status (GET /api/billing/connect) */
775
+ getPayoutStatus(): Promise<{
776
+ onboarded?: boolean;
777
+ payouts_enabled?: boolean;
778
+ details_submitted?: boolean;
779
+ balance_cents?: number;
780
+ }>;
781
+ /** Get referral earnings and history (GET /api/referrals) */
782
+ getReferrals(): Promise<{
783
+ referral_code?: string;
784
+ referral_rate?: number;
785
+ total_earned_cents?: number;
786
+ total_paid_cents?: number;
787
+ total_pending_cents?: number;
788
+ referrals?: {
789
+ id?: string;
790
+ domains?: string[];
791
+ earned_cents?: number;
792
+ paid_out?: boolean;
793
+ created_at?: string;
794
+ }[];
795
+ }>;
796
+ /** Check listing and deal status (GET /api/domains/sell/status) */
797
+ getSellStatus(query?: {
798
+ domain: string;
799
+ }): Promise<{
800
+ listing?: Record<string, unknown> | null;
801
+ deal?: Record<string, unknown> | null;
802
+ hint?: string;
803
+ }>;
804
+ /** Get outbound transfer status (GET /api/domains/{domain}/transfer-away) */
805
+ getTransferAway(domain: string): Promise<{
806
+ domain: string;
807
+ status: "none" | "pending" | "approved" | "completed" | "rejected" | "expired";
808
+ gaining_registrar?: string;
809
+ request_date?: string;
810
+ hint: string;
811
+ }>;
812
+ /** Get unread notification count (GET /api/notifications/count) */
813
+ getUnreadCount(): Promise<{
814
+ unread_count?: number;
815
+ }>;
816
+ /** List webhook deliveries (GET /api/webhooks/{id}/deliveries) */
817
+ getWebhookDeliveries(id: string, query?: {
818
+ limit?: number;
819
+ }): Promise<{
820
+ deliveries?: {
821
+ id?: string;
822
+ event_type?: string;
823
+ status?: "pending" | "delivered" | "failed";
824
+ http_status?: number | null;
825
+ attempts?: number;
826
+ last_error?: string | null;
827
+ created_at?: string;
828
+ }[];
829
+ hint?: string;
830
+ }>;
831
+ /** Import an external domain (POST /api/domains/import) */
832
+ importDomain(body: {
833
+ domain: string;
834
+ }): Promise<{
835
+ domain?: string;
836
+ status?: string;
837
+ token?: string;
838
+ txt_record?: {
839
+ type?: string;
840
+ name?: string;
841
+ value?: string;
842
+ };
843
+ hint?: string;
844
+ }>;
845
+ /** List your backorders (GET /api/backorders) */
846
+ listBackorders(query?: {
847
+ status?: "watching" | "caught" | "failed" | "cancelled" | "expired";
848
+ }): Promise<{
849
+ backorders?: Backorder[];
850
+ }>;
851
+ /** List your broker requests (GET /api/broker) */
852
+ listBrokerRequests(query?: {
853
+ status?: string;
854
+ }): Promise<{
855
+ requests?: BrokerRequest[];
856
+ }>;
857
+ /** List available providers for connecting a domain (GET /api/domains/{domain}/connect) */
858
+ listConnectProviders(domain: string): Promise<{
859
+ domain?: string;
860
+ providers?: {
861
+ hosting?: Record<string, unknown>[];
862
+ email?: Record<string, unknown>[];
863
+ };
864
+ }>;
865
+ /** List your deals (GET /api/deals) */
866
+ listDeals(query?: {
867
+ role?: "buyer" | "seller";
868
+ status?: "active" | "escrow_held" | "epp_pending" | "transfer_started" | "completed" | "refunded" | "expired";
869
+ domain?: string;
870
+ limit?: number;
871
+ cursor?: string;
872
+ }): Promise<{
873
+ deals?: {
874
+ id?: string;
875
+ domain?: string;
876
+ price?: number;
877
+ currency?: string;
878
+ status?: string;
879
+ role?: "buyer" | "seller";
880
+ payment_method?: string;
881
+ epp_deadline?: string | null;
882
+ transfer_deadline?: string | null;
883
+ created_at?: string;
884
+ }[];
885
+ has_more?: boolean;
886
+ next_cursor?: string | null;
887
+ }>;
888
+ /** List all your registered domains (GET /api/domains) */
889
+ listDomains(): Promise<{
890
+ domains?: DomainRecord[];
891
+ }>;
892
+ /** List emails (GET /api/emails/{address}/messages) */
893
+ listEmailMessagesByAddress(address: string, query?: {
894
+ cursor?: string;
895
+ limit?: number;
896
+ direction?: "in" | "out" | "all";
897
+ since?: string;
898
+ from?: string;
899
+ to?: string;
900
+ subject?: string;
901
+ }): Promise<{
902
+ messages?: {
903
+ id?: string;
904
+ message_id?: string | null;
905
+ direction?: "in" | "out";
906
+ from?: string;
907
+ to?: string;
908
+ cc?: string | null;
909
+ reply_to?: string | null;
910
+ subject?: string;
911
+ text?: string;
912
+ in_reply_to?: string | null;
913
+ references?: string | null;
914
+ status?: "queued" | "sent" | "delivered" | "delayed" | "bounced" | "failed" | "complained" | "suppressed";
915
+ events?: {
916
+ status?: string;
917
+ detail?: Record<string, unknown> | null;
918
+ created_at?: string;
919
+ }[];
920
+ created_at?: string;
921
+ }[];
922
+ next_cursor?: string | null;
923
+ has_more?: boolean;
924
+ }>;
925
+ /** List payment invoices (GET /api/billing/invoices) */
926
+ listInvoices(query?: {
927
+ limit?: number;
928
+ }): Promise<{
929
+ invoices?: {
930
+ id?: string;
931
+ number?: string | null;
932
+ status?: string;
933
+ amount_due?: number;
934
+ amount_paid?: number;
935
+ currency?: string;
936
+ description?: string | null;
937
+ created?: string;
938
+ hosted_invoice_url?: string | null;
939
+ invoice_pdf?: string | null;
940
+ }[];
941
+ has_more?: boolean;
942
+ hint?: string;
943
+ }>;
944
+ /** List mailbox aliases (GET /api/emails/{address}/aliases) */
945
+ listMailboxAliases(address: string): Promise<{
946
+ mailbox?: string;
947
+ aliases?: {
948
+ address?: string;
949
+ created_at?: string;
950
+ }[];
951
+ hint?: string;
952
+ }>;
953
+ /** List all mailboxes (GET /api/email) */
954
+ listMailboxes(query?: {
955
+ domain?: string;
956
+ }): Promise<{
957
+ mailboxes?: {
958
+ id?: string;
959
+ address?: string;
960
+ slug?: string;
961
+ domain?: string;
962
+ message_count?: number;
963
+ }[];
964
+ }>;
965
+ /** List all mailboxes (GET /api/emails) */
966
+ listMailboxesByAddress(query?: {
967
+ domain?: string;
968
+ }): Promise<{
969
+ mailboxes?: {
970
+ id?: string;
971
+ address?: string;
972
+ slug?: string;
973
+ domain?: string;
974
+ message_count?: number;
975
+ webhook_url?: string | null;
976
+ forward_to?: string | null;
977
+ }[];
978
+ }>;
979
+ /** List your negotiations (GET /api/negotiations) */
980
+ listNegotiations(query?: {
981
+ role?: "buyer" | "seller";
982
+ status?: string;
983
+ }): Promise<{
984
+ negotiations?: Negotiation[];
985
+ }>;
986
+ /** List notifications (GET /api/notifications) */
987
+ listNotifications(query?: {
988
+ limit?: number;
989
+ cursor?: string;
990
+ }): Promise<{
991
+ notifications?: {
992
+ id?: string;
993
+ type?: string;
994
+ title?: string;
995
+ body?: string;
996
+ action_url?: string | null;
997
+ read?: boolean;
998
+ created_at?: string;
999
+ }[];
1000
+ has_more?: boolean;
1001
+ next_cursor?: string | null;
1002
+ }>;
1003
+ /** List suppressed addresses (GET /api/suppressions) */
1004
+ listSuppressions(query?: {
1005
+ cursor?: string;
1006
+ limit?: number;
1007
+ }): Promise<{
1008
+ suppressions?: {
1009
+ address?: string;
1010
+ reason?: "hard_bounce" | "complaint" | "manual";
1011
+ source?: "resend" | "api";
1012
+ created_at?: string;
1013
+ }[];
1014
+ next_cursor?: string | null;
1015
+ hint?: string;
1016
+ }>;
1017
+ /** List all available TLDs with pricing (GET /api/tlds) */
1018
+ listTlds(query?: {
1019
+ max_price?: number;
1020
+ min_price?: number;
1021
+ sort?: "tld" | "price" | "renewal";
1022
+ order?: "asc" | "desc";
1023
+ search?: string;
1024
+ limit?: number;
1025
+ offset?: number;
1026
+ }): Promise<{
1027
+ tlds?: TldInfo[];
1028
+ total?: number;
1029
+ offset?: number;
1030
+ limit?: number | null;
1031
+ }>;
1032
+ /** List your API tokens (GET /api/tokens) */
1033
+ listTokens(): Promise<{
1034
+ tokens?: TokenInfo[];
1035
+ }>;
1036
+ /** List supported services for domain verification (GET /api/domains/{domain}/verify-service) */
1037
+ listVerifyServices(domain: string): Promise<{
1038
+ domain?: string;
1039
+ services?: {
1040
+ name?: string;
1041
+ displayName?: string;
1042
+ description?: string;
1043
+ docs?: string;
1044
+ }[];
1045
+ hint?: string;
1046
+ }>;
1047
+ /** List webhook event types (GET /api/webhooks/events) */
1048
+ listWebhookEvents(): Promise<{
1049
+ events?: {
1050
+ type?: string;
1051
+ description?: string;
1052
+ }[];
1053
+ }>;
1054
+ /** List webhooks (GET /api/webhooks) */
1055
+ listWebhooks(): Promise<{
1056
+ webhooks?: {
1057
+ id?: string;
1058
+ url?: string;
1059
+ events?: string[];
1060
+ active?: boolean;
1061
+ created_at?: string;
1062
+ }[];
1063
+ hint?: string;
1064
+ }>;
1065
+ /** Send a magic link sign-in email (POST /api/auth/login) */
1066
+ loginUser(body: {
1067
+ email: string;
1068
+ }): Promise<{
1069
+ ok?: boolean;
1070
+ message?: string;
1071
+ }>;
1072
+ /** Make an offer on a listing (POST /api/negotiations) */
1073
+ makeOffer(body: {
1074
+ domain: string;
1075
+ offer: number;
1076
+ message?: string;
1077
+ }): Promise<{
1078
+ negotiation?: Negotiation;
1079
+ }>;
1080
+ /** Mark all notifications as read (POST /api/notifications/read-all) */
1081
+ markAllNotificationsRead(): Promise<{
1082
+ ok?: boolean;
1083
+ count?: number;
1084
+ }>;
1085
+ /** Mark messages as read or unread (PATCH /api/emails/{address}/messages/read) */
1086
+ markMessagesReadByAddress(address: string, body?: {
1087
+ message_ids: string[];
1088
+ read: boolean;
1089
+ }): Promise<{
1090
+ count?: number;
1091
+ }>;
1092
+ /** Mark notification as read (PATCH /api/notifications/{id}) */
1093
+ markNotificationRead(id: string, body: {
1094
+ read: boolean;
1095
+ }): Promise<{
1096
+ ok?: boolean;
1097
+ }>;
1098
+ /** Provide EPP/auth code (seller) (PATCH /api/deals/{id}) */
1099
+ provideEppCode(id: string, body: {
1100
+ auth_code: string;
1101
+ }): Promise<{
1102
+ deal?: Record<string, unknown>;
1103
+ hint?: string;
1104
+ }>;
1105
+ /** Provision a complete agent identity in one call (POST /api/agents/provision) */
1106
+ provisionAgent(body: {
1107
+ domain: string;
1108
+ slug?: string;
1109
+ name?: string;
1110
+ webhook_url?: string;
1111
+ webhook_events?: string[];
1112
+ payment_method?: "card" | "usdc" | "balance";
1113
+ payment_tx?: string;
1114
+ payment_chain?: "base" | "ethereum";
1115
+ years?: number;
1116
+ }): Promise<unknown>;
1117
+ /** Create a new account (POST /api/auth/register) */
1118
+ registerUser(body: {
1119
+ email: string;
1120
+ ref?: string;
1121
+ }): Promise<{
1122
+ api_key?: string;
1123
+ referral_code?: string;
1124
+ has_payment_method?: boolean;
1125
+ user?: {
1126
+ id?: string;
1127
+ email?: string;
1128
+ };
1129
+ }>;
1130
+ /** Remove saved payment method (DELETE /api/billing/card) */
1131
+ removeCard(): Promise<{
1132
+ removed?: boolean;
1133
+ }>;
1134
+ /** Remove email from a domain (DELETE /api/domains/{domain}/email/setup) */
1135
+ removeDomainEmail(domain: string): Promise<unknown>;
1136
+ /** Remove a mailbox alias (DELETE /api/emails/{address}/aliases/{alias}) */
1137
+ removeMailboxAlias(address: string, alias: string): Promise<{
1138
+ address?: string;
1139
+ deleted?: boolean;
1140
+ hint?: string;
1141
+ }>;
1142
+ /** Remove mailbox webhook (DELETE /api/emails/{address}/webhook) */
1143
+ removeMailboxWebhook(address: string): Promise<{
1144
+ address?: string;
1145
+ webhook_url?: string | null;
1146
+ signing_secret?: string | null;
1147
+ has_webhook?: boolean;
1148
+ hint?: string;
1149
+ }>;
1150
+ /** Remove a suppression (DELETE /api/suppressions/{address}) */
1151
+ removeSuppression(address: string): Promise<{
1152
+ address?: string;
1153
+ deleted?: boolean;
1154
+ hint?: string;
1155
+ }>;
1156
+ /** Renew a domain (POST /api/domains/{domain}/renew) */
1157
+ renewDomain(domain: string, body?: {
1158
+ years?: number;
1159
+ payment_method?: "card" | "usdc" | "balance";
1160
+ payment_tx?: string;
1161
+ payment_chain?: "base" | "ethereum";
1162
+ }): Promise<{
1163
+ domain: string;
1164
+ renewed_years: number;
1165
+ new_expiry: string;
1166
+ price: number;
1167
+ currency: string;
1168
+ payment_method: string;
1169
+ payment_tx?: string;
1170
+ }>;
1171
+ /** Reply to a message (POST /api/emails/{address}/messages/{id}/reply) */
1172
+ replyToMessageByAddress(address: string, id: string, body?: {
1173
+ text?: string;
1174
+ html?: string;
1175
+ cc?: string | string[];
1176
+ all?: boolean;
1177
+ }): Promise<{
1178
+ id?: string;
1179
+ message_id?: string;
1180
+ from?: string;
1181
+ to?: string;
1182
+ status?: string;
1183
+ }>;
1184
+ /** Resend contact email verification (POST /api/me/resend-verification) */
1185
+ resendEmailVerification(body?: {
1186
+ email?: string;
1187
+ }): Promise<{
1188
+ sent?: boolean;
1189
+ already_verified?: boolean;
1190
+ hint?: string;
1191
+ }>;
1192
+ /** Respond to a broker inquiry (owner side) (POST /api/broker/respond) */
1193
+ respondToBrokerInquiry(body: {
1194
+ token: string;
1195
+ action: "offer" | "counter" | "accept" | "decline" | "opt_out";
1196
+ price?: number;
1197
+ }): Promise<{
1198
+ handled?: boolean;
1199
+ outcome?: string;
1200
+ status?: string;
1201
+ negotiation_id?: string;
1202
+ domain?: string;
1203
+ }>;
1204
+ /** Counter, accept, or decline (POST /api/negotiations/{id}) */
1205
+ respondToNegotiation(id: string, body: {
1206
+ action: "counter" | "accept" | "decline";
1207
+ counter?: number;
1208
+ message?: string;
1209
+ }): Promise<{
1210
+ negotiation?: Negotiation;
1211
+ }>;
1212
+ /** Restore DNS from a snapshot (POST /api/domains/{domain}/dns/restore) */
1213
+ restoreDns(domain: string, body?: {
1214
+ snapshot?: {
1215
+ domain?: string;
1216
+ records?: DnsRecord[];
1217
+ subdomains?: string[];
1218
+ sources?: string[];
1219
+ capturedAt?: string;
1220
+ };
1221
+ }): Promise<{
1222
+ domain?: string;
1223
+ applied?: number;
1224
+ skipped?: number;
1225
+ recordCount?: number;
1226
+ errors?: string[];
1227
+ }>;
1228
+ /** Revoke an API token (DELETE /api/tokens/{id}) */
1229
+ revokeToken(id: string): Promise<{
1230
+ success?: boolean;
1231
+ }>;
1232
+ /** Rotate webhook signing secret (POST /api/emails/{address}/webhook/rotate) */
1233
+ rotateMailboxWebhookSecret(address: string): Promise<{
1234
+ address?: string;
1235
+ webhook_url?: string;
1236
+ signing_secret?: string;
1237
+ has_webhook?: boolean;
1238
+ hint?: string;
1239
+ }>;
1240
+ /** Check availability and pricing for domains (GET /api/domains/search) */
1241
+ search(query?: {
1242
+ q?: string;
1243
+ domains?: string;
1244
+ max_price?: number;
1245
+ sort?: "price" | "tld";
1246
+ source?: "all" | "primary" | "secondary";
1247
+ order?: "asc" | "desc";
1248
+ }): Promise<SearchResult>;
1249
+ /** List a domain for sale (open marketplace) (POST /api/domains/sell) */
1250
+ sellDomain(body: {
1251
+ domain: string;
1252
+ price: number;
1253
+ description?: string;
1254
+ }): Promise<{
1255
+ listing?: {
1256
+ id?: string;
1257
+ domain?: string;
1258
+ price?: number;
1259
+ currency?: string;
1260
+ status?: "active" | "pending_verification";
1261
+ description?: string | null;
1262
+ created_at?: string;
1263
+ };
1264
+ txt_record?: {
1265
+ type?: "TXT";
1266
+ name?: string;
1267
+ value?: string;
1268
+ } | null;
1269
+ hint?: string;
1270
+ }>;
1271
+ /** Send an email (POST /api/emails/{address}/send) */
1272
+ sendEmailByAddress(address: string, body?: {
1273
+ to: string;
1274
+ cc?: string | string[];
1275
+ bcc?: string | string[];
1276
+ subject?: string;
1277
+ text?: string;
1278
+ html?: string;
1279
+ reply_to?: string;
1280
+ in_reply_to?: string;
1281
+ references?: string;
1282
+ attachments?: {
1283
+ content: string;
1284
+ filename: string;
1285
+ content_type?: string;
1286
+ }[];
1287
+ }): Promise<{
1288
+ id?: string;
1289
+ message_id?: string;
1290
+ from?: string;
1291
+ to?: string;
1292
+ status?: string;
1293
+ attachments_count?: number;
1294
+ }>;
1295
+ /** Set domain catch-all (PUT /api/domains/{domain}/email/catch-all) */
1296
+ setCatchAll(domain: string, body: {
1297
+ mailbox: string;
1298
+ }): Promise<{
1299
+ domain?: string;
1300
+ catch_all?: string | null;
1301
+ hint?: string;
1302
+ }>;
1303
+ /** Set registrant contact info (PUT /api/me/contact) */
1304
+ setContact(body: RegistrantContact): Promise<{
1305
+ contact?: RegistrantContact;
1306
+ }>;
1307
+ /** Set DNS records for a domain you own (PUT /api/domains/{domain}/dns) */
1308
+ setDnsRecords(domain: string, body: {
1309
+ records: DnsRecord[];
1310
+ }): Promise<{
1311
+ success?: boolean;
1312
+ domain?: string;
1313
+ records?: DnsRecord[];
1314
+ }>;
1315
+ /** Forward a domain to a URL (PUT /api/domains/{domain}/redirect) */
1316
+ setDomainRedirect(domain: string, body: {
1317
+ url: string;
1318
+ permanent?: boolean;
1319
+ }): Promise<{
1320
+ domain?: string;
1321
+ redirect_url?: string | null;
1322
+ permanent?: boolean;
1323
+ }>;
1324
+ /** Set mailbox webhook (PUT /api/emails/{address}/webhook) */
1325
+ setMailboxWebhook(address: string, body: {
1326
+ url: string;
1327
+ }): Promise<{
1328
+ address?: string;
1329
+ webhook_url?: string;
1330
+ signing_secret?: string;
1331
+ has_webhook?: boolean;
1332
+ hint?: string;
1333
+ }>;
1334
+ /** Set nameservers for a domain (PUT /api/domains/{domain}/nameservers) */
1335
+ setNameservers(domain: string, body: {
1336
+ nameservers: string[];
1337
+ }): Promise<{
1338
+ success?: boolean;
1339
+ domain?: string;
1340
+ nameservers?: string[];
1341
+ hint?: string;
1342
+ }>;
1343
+ /** Get checkout URL for adding a payment method (POST /api/billing/setup) */
1344
+ setupBilling(body?: {
1345
+ mode?: "setup_intent" | "checkout";
1346
+ }): Promise<{
1347
+ url?: string;
1348
+ client_secret?: string;
1349
+ hint?: string;
1350
+ }>;
1351
+ /** Set up email on a domain (POST /api/domains/{domain}/email/setup) */
1352
+ setupDomainEmail(domain: string, body?: {
1353
+ force?: boolean;
1354
+ }): Promise<{
1355
+ domain?: string;
1356
+ status?: "configured" | "already_configured";
1357
+ verified_at?: string | null;
1358
+ records?: DnsRecord[];
1359
+ hint?: string;
1360
+ }>;
1361
+ /** Capture a DNS snapshot (POST /api/domains/{domain}/dns/snapshot) */
1362
+ snapshotDns(domain: string, body?: {
1363
+ extra_subdomains?: string[];
1364
+ }): Promise<{
1365
+ domain?: string;
1366
+ records?: DnsRecord[];
1367
+ subdomains?: string[];
1368
+ sources?: string[];
1369
+ capturedAt?: string;
1370
+ }>;
1371
+ /** Start bank payout onboarding (POST /api/billing/connect) */
1372
+ startPayoutOnboarding(): Promise<{
1373
+ url?: string;
1374
+ }>;
1375
+ /** AI-powered domain suggestions with availability (GET /api/domains/suggest) */
1376
+ suggestDomains(query?: {
1377
+ prompt: string;
1378
+ count?: number;
1379
+ exclude?: string;
1380
+ tlds?: string;
1381
+ style?: "single" | "creative" | "short" | "brandable" | "keyword";
1382
+ lang?: "japanese" | "spanish" | "french" | "italian" | "latin" | "nordic" | "arabic" | "sanskrit";
1383
+ }): Promise<{
1384
+ suggestions: {
1385
+ domain: string;
1386
+ price: number;
1387
+ currency: string;
1388
+ }[];
1389
+ checked: number;
1390
+ iterations: number;
1391
+ }>;
1392
+ /** Test mailbox webhook (POST /api/emails/{address}/webhook/test) */
1393
+ testMailboxWebhook(address: string): Promise<{
1394
+ address?: string;
1395
+ webhook_url?: string;
1396
+ status?: number;
1397
+ success?: boolean;
1398
+ hint?: string;
1399
+ }>;
1400
+ /** Transfer domain from another provider (POST /api/domains/transfer) */
1401
+ transferDomain(body: {
1402
+ domain: string;
1403
+ auth_code: string;
1404
+ payment_method?: "card" | "usdc" | "balance";
1405
+ payment_tx?: string;
1406
+ payment_chain?: "base" | "ethereum";
1407
+ extra_subdomains?: string[];
1408
+ }): Promise<unknown>;
1409
+ /** Update account preferences (PUT /api/me) */
1410
+ updateAccount(body: {
1411
+ preferred_payment_method: "card" | "usdc" | null;
1412
+ }): Promise<{
1413
+ preferred_payment_method?: string | null;
1414
+ hint?: string;
1415
+ }>;
1416
+ /** Update domain settings (PUT /api/domains/{domain}/settings) */
1417
+ updateDomainSettings(domain: string, body: {
1418
+ auto_renew?: boolean;
1419
+ whois_privacy?: boolean;
1420
+ security_lock?: boolean;
1421
+ }): Promise<{
1422
+ domain: string;
1423
+ auto_renew?: boolean;
1424
+ whois_privacy?: boolean;
1425
+ security_lock?: boolean;
1426
+ hint: string;
1427
+ }>;
1428
+ /** Update a domain listing (PATCH /api/domains/{domain}/for-sale) */
1429
+ updateListing(domain: string, body: {
1430
+ price?: number;
1431
+ description?: string | null;
1432
+ }): Promise<{
1433
+ listing?: {
1434
+ id?: string;
1435
+ domain?: string;
1436
+ price?: number;
1437
+ currency?: string;
1438
+ description?: string | null;
1439
+ status?: "active";
1440
+ created_at?: string;
1441
+ };
1442
+ hint?: string;
1443
+ }>;
1444
+ /** Update mailbox (PATCH /api/emails/{address}) */
1445
+ updateMailboxByAddress(address: string, body?: {
1446
+ name?: string | null;
1447
+ webhook_url?: string | null;
1448
+ forward_to?: string | null;
1449
+ }): Promise<{
1450
+ id?: string;
1451
+ address?: string;
1452
+ slug?: string;
1453
+ domain?: string;
1454
+ name?: string | null;
1455
+ webhook_url?: string | null;
1456
+ forward_to?: string | null;
1457
+ signing_secret?: string;
1458
+ }>;
1459
+ /** Update notification preferences (PUT /api/notifications/preferences) */
1460
+ updateNotificationPreferences(body: {
1461
+ preferences: {
1462
+ category: "domains" | "transfers" | "marketplace" | "email" | "inquiries";
1463
+ channel: "in_app" | "email";
1464
+ enabled: boolean;
1465
+ }[];
1466
+ }): Promise<{
1467
+ ok?: boolean;
1468
+ }>;
1469
+ /** Update parking settings (PUT /api/domains/{domain}/parking) */
1470
+ updateParking(domain: string, body: {
1471
+ enabled?: boolean;
1472
+ listing_price?: number | null;
1473
+ }): Promise<{
1474
+ domain?: string;
1475
+ parking_enabled?: boolean;
1476
+ listing_price?: number | null;
1477
+ hint?: string;
1478
+ }>;
1479
+ /** Update webhook (PATCH /api/webhooks/{id}) */
1480
+ updateWebhook(id: string, body: {
1481
+ url?: string;
1482
+ events?: string[];
1483
+ active?: boolean;
1484
+ }): Promise<{
1485
+ id?: string;
1486
+ url?: string;
1487
+ events?: string[];
1488
+ active?: boolean;
1489
+ hint?: string;
1490
+ }>;
1491
+ /** Verify that a provider connection is working (POST /api/domains/{domain}/verify) */
1492
+ verifyConnection(domain: string, body: {
1493
+ target?: string;
1494
+ provider?: string;
1495
+ method?: string;
1496
+ }): Promise<{
1497
+ domain?: string;
1498
+ provider?: string;
1499
+ method?: string;
1500
+ verified?: boolean;
1501
+ message?: string;
1502
+ hint?: string;
1503
+ next_steps?: string[];
1504
+ }>;
1505
+ /** Verify and complete domain import (POST /api/domains/import/verify) */
1506
+ verifyImport(body: {
1507
+ domain: string;
1508
+ }): Promise<{
1509
+ domain?: string;
1510
+ status?: string;
1511
+ expires?: string;
1512
+ registrar?: string;
1513
+ payment_method?: string;
1514
+ hint?: string;
1515
+ }>;
1516
+ /** Verify a magic link token (GET /api/auth/verify) */
1517
+ verifyMagicLink(query?: {
1518
+ token: string;
1519
+ }): Promise<unknown>;
1520
+ /** Verify TXT ownership for external listing (POST /api/domains/sell/verify) */
1521
+ verifySellListing(body: {
1522
+ domain: string;
1523
+ }): Promise<{
1524
+ listing?: Record<string, unknown>;
1525
+ hint?: string;
1526
+ }>;
1527
+ /** Add DNS records to verify domain ownership for a third-party service (POST /api/domains/{domain}/verify-service) */
1528
+ verifyService(domain: string, body: {
1529
+ service: string;
1530
+ token: string;
1531
+ }): Promise<{
1532
+ domain?: string;
1533
+ service?: string;
1534
+ service_display_name?: string;
1535
+ known_service?: boolean;
1536
+ records_added?: DnsRecord[];
1537
+ total_records?: number;
1538
+ docs?: string | null;
1539
+ hint?: string;
1540
+ }>;
1541
+ /** Watch a domain for transfer eligibility (POST /api/domains/transfer-watch) */
1542
+ watchTransfer(body: {
1543
+ domain: string;
1544
+ }): Promise<{
1545
+ domain: string;
1546
+ eligible: boolean;
1547
+ eligible_at?: string;
1548
+ hint?: string;
1549
+ watching: boolean;
1550
+ }>;
1551
+ /** Look up domain registration data via RDAP (GET /api/domains/whois) */
1552
+ whoisLookup(query?: {
1553
+ q: string;
1554
+ }): Promise<{
1555
+ domain: string;
1556
+ registered: boolean;
1557
+ registrar: string | null;
1558
+ registrar_url: string | null;
1559
+ registrar_iana_id: string | null;
1560
+ created: string | null;
1561
+ expires: string | null;
1562
+ updated: string | null;
1563
+ days_until_expiry: number | null;
1564
+ status: string[];
1565
+ nameservers: string[];
1566
+ dnssec: boolean;
1567
+ redacted: boolean;
1568
+ contacts: {
1569
+ registrant: Contact | unknown;
1570
+ admin: Contact | unknown;
1571
+ tech: Contact | unknown;
1572
+ billing: Contact | unknown;
1573
+ abuse: Contact | unknown;
1574
+ };
1575
+ }>;
1576
+ /** Withdraw marketplace balance to bank (POST /api/billing/connect/payout) */
1577
+ withdrawBalance(): Promise<{
1578
+ amount_cents?: number;
1579
+ transfer_id?: string;
1580
+ }>;
1581
+ }
1582
+ export default Domani;