@namefi/api-client 0.0.0-pre.4 → 0.0.0-pre.6

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/dist/index.d.ts CHANGED
@@ -1,11 +1,37 @@
1
1
  import * as _orpc_client from '@orpc/client';
2
2
  import * as zod from 'zod';
3
3
 
4
+ type EIP712Signer = {
5
+ signTypedData: (data: {
6
+ domain: {
7
+ name: string;
8
+ version: string;
9
+ chainId?: number;
10
+ verifyingContract?: `0x${string}`;
11
+ };
12
+ types: {
13
+ [key: string]: {
14
+ name: string;
15
+ type: string;
16
+ }[];
17
+ };
18
+ primaryType: string;
19
+ message: Record<string, unknown>;
20
+ }) => Promise<{
21
+ signature: string;
22
+ address: string;
23
+ }>;
24
+ generateNonce: () => string;
25
+ };
26
+ type CreateNamefiClientAuth = {
27
+ apiKey: string;
28
+ type: 'API_KEY';
29
+ } | {
30
+ type: 'EIP712';
31
+ signer: EIP712Signer;
32
+ };
4
33
  type CreateNamefiClientOptions = {
5
- authentication: {
6
- apiKey: string;
7
- type: 'API_KEY';
8
- };
34
+ authentication: CreateNamefiClientAuth;
9
35
  logger: {
10
36
  info: (...args: any[]) => void;
11
37
  error: (...args: any[]) => void;
@@ -29,9 +55,9 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
29
55
  id: string;
30
56
  }[], Error>;
31
57
  createDnsRecord: _orpc_client.Client<Record<never, never>, {
32
- type: "A" | "AAAA" | "CNAME" | "MX" | "TXT" | "NS" | "SOA" | "PTR" | "SRV" | "CAA" | "DS" | "TLSA" | "SSHFP" | "HTTPS" | "SVCB" | "NAPTR" | "SPF";
33
58
  zoneName: string;
34
59
  rdata: string;
60
+ type: "A" | "AAAA" | "CNAME" | "MX" | "TXT" | "NS" | "SOA" | "PTR" | "SRV" | "CAA" | "DS" | "TLSA" | "SSHFP" | "HTTPS" | "SVCB" | "NAPTR" | "SPF";
35
61
  name?: string | undefined;
36
62
  ttl?: number | undefined;
37
63
  }, {
@@ -75,9 +101,9 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
75
101
  records: {
76
102
  id: string;
77
103
  name?: string | undefined;
78
- type?: "A" | "AAAA" | "CNAME" | "MX" | "TXT" | "NS" | "SOA" | "PTR" | "SRV" | "CAA" | "DS" | "TLSA" | "SSHFP" | "HTTPS" | "SVCB" | "NAPTR" | "SPF" | undefined;
79
- ttl?: number | undefined;
80
104
  rdata?: string | undefined;
105
+ ttl?: number | undefined;
106
+ type?: "A" | "AAAA" | "CNAME" | "MX" | "TXT" | "NS" | "SOA" | "PTR" | "SRV" | "CAA" | "DS" | "TLSA" | "SSHFP" | "HTTPS" | "SVCB" | "NAPTR" | "SPF" | undefined;
81
107
  }[];
82
108
  zoneName: string;
83
109
  }, {
@@ -225,61 +251,14 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
225
251
  ensRecord: string | null;
226
252
  };
227
253
  }[], Error>;
228
- getUserCart: _orpc_client.Client<Record<never, never>, void, {
229
- id: string;
230
- userId: string;
231
- normalizedDomainName: string & zod.$brand<"NamefiNormalizedDomain">;
232
- amountInUSDCents: number;
233
- durationInYears: number;
234
- type: "REGISTER" | "IMPORT" | "RENEW";
235
- registrar: string;
236
- encryptionKeyId: string | null;
237
- encryptedEppAuthorizationCode: string | null;
238
- createdAt: string;
239
- updatedAt: string;
240
- claims: {
241
- groupOrCampaignKey: string;
242
- claimsAvailable: number;
243
- exactMatchClaims: {
244
- createdAt: string;
245
- updatedAt: string;
246
- userId: string;
247
- groupOrCampaignKey: string;
248
- reason: string | null;
249
- expirationDate: string | null;
250
- orderItemId: string | null;
251
- claimingStatus: "IDLE" | "CLAIMING" | "CLAIMED";
252
- claimedAt: string | null;
253
- metadata: any;
254
- id: string;
255
- exactDomainName?: (string & zod.$brand<"NamefiNormalizedDomain">) | null | undefined;
256
- parentDomain?: (string & zod.$brand<"NamefiNormalizedDomain">) | null | undefined;
257
- claimedDomainName?: (string & zod.$brand<"NamefiNormalizedDomain">) | null | undefined;
258
- }[];
259
- parentMatchClaims: {
260
- createdAt: string;
261
- updatedAt: string;
262
- userId: string;
263
- groupOrCampaignKey: string;
264
- reason: string | null;
265
- expirationDate: string | null;
266
- orderItemId: string | null;
267
- claimingStatus: "IDLE" | "CLAIMING" | "CLAIMED";
268
- claimedAt: string | null;
269
- metadata: any;
270
- id: string;
271
- exactDomainName?: (string & zod.$brand<"NamefiNormalizedDomain">) | null | undefined;
272
- parentDomain?: (string & zod.$brand<"NamefiNormalizedDomain">) | null | undefined;
273
- claimedDomainName?: (string & zod.$brand<"NamefiNormalizedDomain">) | null | undefined;
274
- }[];
275
- }[];
276
- metadata?: {
277
- [x: string]: unknown;
278
- freeClaim?: boolean | undefined;
279
- groupOrCampaignKey?: string | undefined;
280
- claimId?: string | undefined;
281
- } | null | undefined;
282
- }[], Error>;
254
+ requestNfscFaucet: _orpc_client.Client<Record<never, never>, {
255
+ walletAddress?: string | undefined;
256
+ }, {
257
+ status: "started";
258
+ workflowId: string;
259
+ walletAddress: `0x${string}` & zod.$brand<"ChecksumWalletAddress">;
260
+ nextEligibleAt: string;
261
+ }, Error>;
283
262
  getUserOrders: _orpc_client.Client<Record<never, never>, void, {
284
263
  id: string;
285
264
  orderId: string;
@@ -290,7 +269,7 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
290
269
  registrar: string;
291
270
  encryptionKeyId: string | null;
292
271
  encryptedEppAuthorizationCode: string | null;
293
- status: "PARTIALLY_COMPLETED" | "CREATED" | "PROCESSING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | null;
272
+ status: "CREATED" | "PROCESSING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "PARTIALLY_COMPLETED" | null;
294
273
  createdAt: string;
295
274
  updatedAt: string;
296
275
  metadata?: {
@@ -302,6 +281,7 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
302
281
  txHash: string;
303
282
  recordedAt: string;
304
283
  } | undefined;
284
+ requiredAction?: "EPP_UNLOCK_REQUIRED" | "EPP_AUTH_CODE_UPDATE_REQUIRED" | "UNDETERMINED" | undefined;
305
285
  } | null | undefined;
306
286
  }[], Error>;
307
287
  };
@@ -310,13 +290,15 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
310
290
  orderId: string;
311
291
  }, {
312
292
  order: {
293
+ startedAt: string | null;
294
+ finishedAt: string | null;
313
295
  createdAt: string;
314
296
  updatedAt: string;
315
297
  nftWalletAddress: string | null;
316
298
  nftChainId: number | null;
317
299
  amountInUSDCents: number;
318
300
  userId: string;
319
- status: "PARTIALLY_COMPLETED" | "CREATED" | "PROCESSING" | "SUCCEEDED" | "FAILED" | "CANCELLED";
301
+ status: "CREATED" | "PROCESSING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "PARTIALLY_COMPLETED";
320
302
  id: string;
321
303
  metadata?: {
322
304
  [x: string]: unknown;
@@ -326,12 +308,30 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
326
308
  recordedAt: string;
327
309
  };
328
310
  } | undefined;
311
+ backfilled_started_finished_at?: boolean | undefined;
312
+ legacyOrderMetadata?: {
313
+ source: "legacy";
314
+ type: "legacy-migration";
315
+ legacyOrderId: string;
316
+ useNfscBalance: boolean;
317
+ migratedAt: string;
318
+ legacyPaymentIntentId?: string | undefined;
319
+ legacyPaymentDetails?: {
320
+ status: string;
321
+ provider: string;
322
+ paymentType: string;
323
+ txHash?: string | undefined;
324
+ externalId?: string | undefined;
325
+ } | undefined;
326
+ } | undefined;
329
327
  freeClaim?: boolean | undefined;
330
328
  groupOrCampaignKey?: string | undefined;
331
329
  claimId?: string | undefined;
332
330
  } | null | undefined;
333
331
  };
334
332
  items: {
333
+ startedAt: string | null;
334
+ finishedAt: string | null;
335
335
  createdAt: string;
336
336
  updatedAt: string;
337
337
  durationInYears: number;
@@ -339,7 +339,7 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
339
339
  registrar: string;
340
340
  encryptionKeyId: string | null;
341
341
  encryptedEppAuthorizationCode: string | null;
342
- status: "PARTIALLY_COMPLETED" | "CREATED" | "PROCESSING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | null;
342
+ status: "CREATED" | "PROCESSING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "PARTIALLY_COMPLETED" | null;
343
343
  amountInUSDCents: number;
344
344
  normalizedDomainName: string & zod.$brand<"NamefiNormalizedDomain">;
345
345
  orderId: string;
@@ -353,9 +353,41 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
353
353
  txHash: string;
354
354
  recordedAt: string;
355
355
  } | undefined;
356
+ postProcessOrderItem?: {
357
+ [x: string]: unknown;
358
+ actions: {
359
+ scope: "dns-records";
360
+ action: "set" | "add";
361
+ records: {
362
+ name: string;
363
+ type: "A" | "AAAA" | "CNAME" | "MX" | "TXT" | "NS" | "SOA" | "PTR" | "SRV" | "CAA" | "DS" | "TLSA" | "SSHFP" | "HTTPS" | "SVCB" | "NAPTR" | "SPF";
364
+ rdata: string;
365
+ ttl?: number | undefined;
366
+ }[];
367
+ }[];
368
+ } | undefined;
369
+ requiredAction?: "EPP_UNLOCK_REQUIRED" | "EPP_AUTH_CODE_UPDATE_REQUIRED" | "UNDETERMINED" | undefined;
370
+ failureDetails?: {
371
+ requiredAction: "EPP_UNLOCK_REQUIRED" | "EPP_AUTH_CODE_UPDATE_REQUIRED" | "UNDETERMINED";
372
+ resolution: "TIMEOUT" | "USER_SIGNAL";
373
+ recordedAt: string;
374
+ actor?: "USER" | "ADMIN" | undefined;
375
+ actorId?: string | undefined;
376
+ timeoutMs?: number | undefined;
377
+ } | undefined;
378
+ backfilled_started_finished_at?: boolean | undefined;
379
+ legacyOrderItemMetadata?: {
380
+ source: "legacy";
381
+ type: "legacy-migration";
382
+ legacyItemId: string;
383
+ chainId: number;
384
+ receivingWalletAddress: string | null;
385
+ } | undefined;
356
386
  } | null | undefined;
357
387
  }[];
358
388
  payments: {
389
+ startedAt: string | null;
390
+ finishedAt: string | null;
359
391
  createdAt: string;
360
392
  updatedAt: string;
361
393
  status: "CREATED" | "PROCESSING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "REFUND_REQUESTED" | "REQUIRES_CAPTURE";
@@ -369,6 +401,32 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
369
401
  stripePaymentDetails: {
370
402
  paymentMethodId?: string | undefined;
371
403
  } | null;
404
+ metadata: {
405
+ legacyPaymentMetadata?: {
406
+ id: string;
407
+ amountinusdcents: number;
408
+ externalid: string | null;
409
+ paymenttype: string;
410
+ status: string;
411
+ txhash: string | null;
412
+ modified: boolean | null;
413
+ refundtxhash: string | null;
414
+ stripeRefund?: {
415
+ paymentIntentId: string;
416
+ amount: number;
417
+ fullRefund: boolean;
418
+ totalRefundAmount: number;
419
+ refundsDetails: {
420
+ type: string;
421
+ paymentId: string;
422
+ amountInUSDCents: number;
423
+ status: string;
424
+ createdAt: string;
425
+ paymentProviderReferenceId: string;
426
+ }[];
427
+ } | undefined;
428
+ } | undefined;
429
+ } | null;
372
430
  amountInUSDCents: number;
373
431
  id: string;
374
432
  }[];
@@ -385,6 +443,8 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
385
443
  };
386
444
  }, Error>;
387
445
  getOrderItems: _orpc_client.Client<Record<never, never>, void, {
446
+ startedAt: string | null;
447
+ finishedAt: string | null;
388
448
  createdAt: string;
389
449
  updatedAt: string;
390
450
  durationInYears: number;
@@ -392,7 +452,7 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
392
452
  registrar: string;
393
453
  encryptionKeyId: string | null;
394
454
  encryptedEppAuthorizationCode: string | null;
395
- status: "PARTIALLY_COMPLETED" | "CREATED" | "PROCESSING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | null;
455
+ status: "CREATED" | "PROCESSING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "PARTIALLY_COMPLETED" | null;
396
456
  amountInUSDCents: number;
397
457
  normalizedDomainName: string & zod.$brand<"NamefiNormalizedDomain">;
398
458
  orderId: string;
@@ -406,6 +466,36 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
406
466
  txHash: string;
407
467
  recordedAt: string;
408
468
  } | undefined;
469
+ postProcessOrderItem?: {
470
+ [x: string]: unknown;
471
+ actions: {
472
+ scope: "dns-records";
473
+ action: "set" | "add";
474
+ records: {
475
+ name: string;
476
+ type: "A" | "AAAA" | "CNAME" | "MX" | "TXT" | "NS" | "SOA" | "PTR" | "SRV" | "CAA" | "DS" | "TLSA" | "SSHFP" | "HTTPS" | "SVCB" | "NAPTR" | "SPF";
477
+ rdata: string;
478
+ ttl?: number | undefined;
479
+ }[];
480
+ }[];
481
+ } | undefined;
482
+ requiredAction?: "EPP_UNLOCK_REQUIRED" | "EPP_AUTH_CODE_UPDATE_REQUIRED" | "UNDETERMINED" | undefined;
483
+ failureDetails?: {
484
+ requiredAction: "EPP_UNLOCK_REQUIRED" | "EPP_AUTH_CODE_UPDATE_REQUIRED" | "UNDETERMINED";
485
+ resolution: "TIMEOUT" | "USER_SIGNAL";
486
+ recordedAt: string;
487
+ actor?: "USER" | "ADMIN" | undefined;
488
+ actorId?: string | undefined;
489
+ timeoutMs?: number | undefined;
490
+ } | undefined;
491
+ backfilled_started_finished_at?: boolean | undefined;
492
+ legacyOrderItemMetadata?: {
493
+ source: "legacy";
494
+ type: "legacy-migration";
495
+ legacyItemId: string;
496
+ chainId: number;
497
+ receivingWalletAddress: string | null;
498
+ } | undefined;
409
499
  } | null | undefined;
410
500
  }[], Error>;
411
501
  registerDomain: _orpc_client.Client<Record<never, never>, {
@@ -422,6 +512,8 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
422
512
  nftWalletAddress: string | null;
423
513
  nftChainId: number | null;
424
514
  items: {
515
+ startedAt: string | null;
516
+ finishedAt: string | null;
425
517
  createdAt: string;
426
518
  updatedAt: string;
427
519
  durationInYears: number;
@@ -429,7 +521,7 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
429
521
  registrar: string;
430
522
  encryptionKeyId: string | null;
431
523
  encryptedEppAuthorizationCode: string | null;
432
- status: "PARTIALLY_COMPLETED" | "CREATED" | "PROCESSING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | null;
524
+ status: "CREATED" | "PROCESSING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "PARTIALLY_COMPLETED" | null;
433
525
  amountInUSDCents: number;
434
526
  normalizedDomainName: string & zod.$brand<"NamefiNormalizedDomain">;
435
527
  orderId: string;
@@ -443,6 +535,112 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
443
535
  txHash: string;
444
536
  recordedAt: string;
445
537
  } | undefined;
538
+ postProcessOrderItem?: {
539
+ [x: string]: unknown;
540
+ actions: {
541
+ scope: "dns-records";
542
+ action: "set" | "add";
543
+ records: {
544
+ name: string;
545
+ type: "A" | "AAAA" | "CNAME" | "MX" | "TXT" | "NS" | "SOA" | "PTR" | "SRV" | "CAA" | "DS" | "TLSA" | "SSHFP" | "HTTPS" | "SVCB" | "NAPTR" | "SPF";
546
+ rdata: string;
547
+ ttl?: number | undefined;
548
+ }[];
549
+ }[];
550
+ } | undefined;
551
+ requiredAction?: "EPP_UNLOCK_REQUIRED" | "EPP_AUTH_CODE_UPDATE_REQUIRED" | "UNDETERMINED" | undefined;
552
+ failureDetails?: {
553
+ requiredAction: "EPP_UNLOCK_REQUIRED" | "EPP_AUTH_CODE_UPDATE_REQUIRED" | "UNDETERMINED";
554
+ resolution: "TIMEOUT" | "USER_SIGNAL";
555
+ recordedAt: string;
556
+ actor?: "USER" | "ADMIN" | undefined;
557
+ actorId?: string | undefined;
558
+ timeoutMs?: number | undefined;
559
+ } | undefined;
560
+ backfilled_started_finished_at?: boolean | undefined;
561
+ legacyOrderItemMetadata?: {
562
+ source: "legacy";
563
+ type: "legacy-migration";
564
+ legacyItemId: string;
565
+ chainId: number;
566
+ receivingWalletAddress: string | null;
567
+ } | undefined;
568
+ } | undefined;
569
+ }[];
570
+ }, Error>;
571
+ registerWithRecords: _orpc_client.Client<Record<never, never>, {
572
+ normalizedDomainName: string;
573
+ durationInYears?: number | undefined;
574
+ records?: {
575
+ name: string;
576
+ type: "A" | "AAAA" | "CNAME" | "MX" | "TXT" | "NS" | "SOA" | "PTR" | "SRV" | "CAA" | "DS" | "TLSA" | "SSHFP" | "HTTPS" | "SVCB" | "NAPTR" | "SPF";
577
+ rdata: string;
578
+ ttl?: number | undefined;
579
+ }[] | undefined;
580
+ nftReceivinggWallet?: {
581
+ walletAddress: string;
582
+ chainId: number;
583
+ } | undefined;
584
+ }, {
585
+ id: string;
586
+ userId: string;
587
+ amountInUSDCents: number;
588
+ nftWalletAddress: string | null;
589
+ nftChainId: number | null;
590
+ items: {
591
+ startedAt: string | null;
592
+ finishedAt: string | null;
593
+ createdAt: string;
594
+ updatedAt: string;
595
+ durationInYears: number;
596
+ type: "REGISTER" | "IMPORT" | "RENEW";
597
+ registrar: string;
598
+ encryptionKeyId: string | null;
599
+ encryptedEppAuthorizationCode: string | null;
600
+ status: "CREATED" | "PROCESSING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "PARTIALLY_COMPLETED" | null;
601
+ amountInUSDCents: number;
602
+ normalizedDomainName: string & zod.$brand<"NamefiNormalizedDomain">;
603
+ orderId: string;
604
+ id: string;
605
+ metadata?: {
606
+ [x: string]: unknown;
607
+ freeClaim?: boolean | undefined;
608
+ groupOrCampaignKey?: string | undefined;
609
+ claimId?: string | undefined;
610
+ mintTransaction?: {
611
+ txHash: string;
612
+ recordedAt: string;
613
+ } | undefined;
614
+ postProcessOrderItem?: {
615
+ [x: string]: unknown;
616
+ actions: {
617
+ scope: "dns-records";
618
+ action: "set" | "add";
619
+ records: {
620
+ name: string;
621
+ type: "A" | "AAAA" | "CNAME" | "MX" | "TXT" | "NS" | "SOA" | "PTR" | "SRV" | "CAA" | "DS" | "TLSA" | "SSHFP" | "HTTPS" | "SVCB" | "NAPTR" | "SPF";
622
+ rdata: string;
623
+ ttl?: number | undefined;
624
+ }[];
625
+ }[];
626
+ } | undefined;
627
+ requiredAction?: "EPP_UNLOCK_REQUIRED" | "EPP_AUTH_CODE_UPDATE_REQUIRED" | "UNDETERMINED" | undefined;
628
+ failureDetails?: {
629
+ requiredAction: "EPP_UNLOCK_REQUIRED" | "EPP_AUTH_CODE_UPDATE_REQUIRED" | "UNDETERMINED";
630
+ resolution: "TIMEOUT" | "USER_SIGNAL";
631
+ recordedAt: string;
632
+ actor?: "USER" | "ADMIN" | undefined;
633
+ actorId?: string | undefined;
634
+ timeoutMs?: number | undefined;
635
+ } | undefined;
636
+ backfilled_started_finished_at?: boolean | undefined;
637
+ legacyOrderItemMetadata?: {
638
+ source: "legacy";
639
+ type: "legacy-migration";
640
+ legacyItemId: string;
641
+ chainId: number;
642
+ receivingWalletAddress: string | null;
643
+ } | undefined;
446
644
  } | undefined;
447
645
  }[];
448
646
  }, Error>;
@@ -553,4 +751,4 @@ declare function createNamefiClient({ authentication, logger, baseUrl, }: Create
553
751
  };
554
752
  };
555
753
 
556
- export { createNamefiClient };
754
+ export { type CreateNamefiClientAuth, type EIP712Signer, createNamefiClient };
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import {onError,onFinish,onStart,onSuccess,createORPCClient}from'@orpc/client';import {OpenAPILink}from'@orpc/openapi-client/fetch';var m=Object.defineProperty;var r=(o,t)=>m(o,"name",{value:t,configurable:true});var i={dnsRecords:{getRecords:{"~orpc":{errorMap:{},meta:{route:{path:"/dns/records",method:"GET",tags:["dns"],operationId:"getDnsRecords",summary:"Get DNS records",description:"Retrieve all DNS records for a specified domain zone. Returns an array of DNS records including A, AAAA, CNAME, MX, TXT, and other record types."}},route:{path:"/dns/records",method:"GET",tags:["dns"],operationId:"getDnsRecords",summary:"Get DNS records",description:"Retrieve all DNS records for a specified domain zone. Returns an array of DNS records including A, AAAA, CNAME, MX, TXT, and other record types."}}},createDnsRecord:{"~orpc":{errorMap:{},meta:{route:{path:"/dns/records",method:"POST",tags:["dns"],operationId:"createDnsRecord",summary:"Create DNS record",description:"Create a new DNS record for a domain. Requires domain ownership. The record will be validated against DNS zone rules before creation."}},route:{path:"/dns/records",method:"POST",tags:["dns"],operationId:"createDnsRecord",summary:"Create DNS record",description:"Create a new DNS record for a domain. Requires domain ownership. The record will be validated against DNS zone rules before creation."}}},updateRecord:{"~orpc":{errorMap:{},meta:{route:{path:"/dns/records/{id}",method:"PUT",tags:["dns"],operationId:"updateDnsRecord",summary:"Update DNS record",description:"Update an existing DNS record by its ID. Requires domain ownership. The updated record will be validated against DNS zone rules."}},route:{path:"/dns/records/{id}",method:"PUT",tags:["dns"],operationId:"updateDnsRecord",summary:"Update DNS record",description:"Update an existing DNS record by its ID. Requires domain ownership. The updated record will be validated against DNS zone rules."}}},deleteRecord:{"~orpc":{errorMap:{},meta:{route:{path:"/dns/records/{id}",method:"DELETE",tags:["dns"],operationId:"deleteDnsRecord",summary:"Delete DNS record",description:"Delete a DNS record by its ID. Requires domain ownership. The deletion will be validated to ensure zone integrity."}},route:{path:"/dns/records/{id}",method:"DELETE",tags:["dns"],operationId:"deleteDnsRecord",summary:"Delete DNS record",description:"Delete a DNS record by its ID. Requires domain ownership. The deletion will be validated to ensure zone integrity."}}},updateRecords:{"~orpc":{errorMap:{},meta:{route:{path:"/dns/records/batch",method:"PUT",tags:["dns"],operationId:"batchUpdateDnsRecords",summary:"Batch update DNS records",description:"Update multiple DNS records in a single transaction. Requires domain ownership. All records must belong to the same zone and will be validated together."}},route:{path:"/dns/records/batch",method:"PUT",tags:["dns"],operationId:"batchUpdateDnsRecords",summary:"Batch update DNS records",description:"Update multiple DNS records in a single transaction. Requires domain ownership. All records must belong to the same zone and will be validated together."}}},createRecords:{"~orpc":{errorMap:{},meta:{route:{path:"/dns/records/batch",method:"POST",tags:["dns"],operationId:"batchCreateDnsRecords",summary:"Batch create DNS records",description:"Create multiple DNS records in a single transaction. Requires domain ownership. All records will be validated together against DNS zone rules."}},route:{path:"/dns/records/batch",method:"POST",tags:["dns"],operationId:"batchCreateDnsRecords",summary:"Batch create DNS records",description:"Create multiple DNS records in a single transaction. Requires domain ownership. All records will be validated together against DNS zone rules."}}},deleteRecords:{"~orpc":{errorMap:{},meta:{route:{path:"/dns/records/batch",method:"DELETE",tags:["dns"],operationId:"batchDeleteDnsRecords",summary:"Batch delete DNS records",description:"Delete multiple DNS records by their IDs in a single transaction. Requires domain ownership. The zone will be validated after deletion."}},route:{path:"/dns/records/batch",method:"DELETE",tags:["dns"],operationId:"batchDeleteDnsRecords",summary:"Batch delete DNS records",description:"Delete multiple DNS records by their IDs in a single transaction. Requires domain ownership. The zone will be validated after deletion."}}},parkDomain:{"~orpc":{errorMap:{},meta:{route:{path:"/dns/park",method:"POST",tags:["dns"],operationId:"parkDomain",summary:"Park domain",description:"Park a domain by setting up default parking DNS records (A and AAAA records pointing to the parking server). Optionally override existing conflicting records."}},route:{path:"/dns/park",method:"POST",tags:["dns"],operationId:"parkDomain",summary:"Park domain",description:"Park a domain by setting up default parking DNS records (A and AAAA records pointing to the parking server). Optionally override existing conflicting records."}}},isDomainParked:{"~orpc":{errorMap:{},meta:{route:{path:"/dns/parked",method:"GET",tags:["dns"],operationId:"isDomainParked",summary:"Check if domain is parked",description:"Check whether a domain has the standard parking DNS records configured. Returns true if the domain is parked, false otherwise."}},route:{path:"/dns/parked",method:"GET",tags:["dns"],operationId:"isDomainParked",summary:"Check if domain is parked",description:"Check whether a domain has the standard parking DNS records configured. Returns true if the domain is parked, false otherwise."}}}},user:{getDomains:{"~orpc":{errorMap:{},meta:{route:{path:"/user/domains",method:"GET",tags:["user"],operationId:"getUserDomains",summary:"Get user domains",description:"Retrieve all domains owned by the current user. Returns domain details including DNS status, nameservers, and expiration dates."}},route:{path:"/user/domains",method:"GET",tags:["user"],operationId:"getUserDomains",summary:"Get user domains",description:"Retrieve all domains owned by the current user. Returns domain details including DNS status, nameservers, and expiration dates."}}},getUserCart:{"~orpc":{errorMap:{},meta:{route:{path:"/user/cart",method:"GET",tags:["user","cart"],operationId:"getUserCart",summary:"Get user cart",description:"Retrieve all items in the current user's shopping cart. Includes free claim eligibility information for each item."}},route:{path:"/user/cart",method:"GET",tags:["user","cart"],operationId:"getUserCart",summary:"Get user cart",description:"Retrieve all items in the current user's shopping cart. Includes free claim eligibility information for each item."}}},getUserOrders:{"~orpc":{errorMap:{},meta:{route:{path:"/user/orders",method:"GET",tags:["user","orders"],operationId:"getUserOrders",summary:"Get user orders",description:"Retrieve all order items for the current user. Returns order items sorted by creation date in descending order."}},route:{path:"/user/orders",method:"GET",tags:["user","orders"],operationId:"getUserOrders",summary:"Get user orders",description:"Retrieve all order items for the current user. Returns order items sorted by creation date in descending order."}}}},orders:{getOrder:{"~orpc":{errorMap:{},meta:{route:{path:"/orders/{orderId}",method:"GET",tags:["orders"],operationId:"getOrder",summary:"Get order details",description:"Retrieve detailed information about an order including items, payments, and user details. User must own the order."}},route:{path:"/orders/{orderId}",method:"GET",tags:["orders"],operationId:"getOrder",summary:"Get order details",description:"Retrieve detailed information about an order including items, payments, and user details. User must own the order."}}},getOrderItems:{"~orpc":{errorMap:{},meta:{route:{path:"/orders/items",method:"GET",tags:["orders"],operationId:"getOrderItems",summary:"Get user order items",description:"Retrieve all order items for the current user, sorted by creation date in descending order."}},route:{path:"/orders/items",method:"GET",tags:["orders"],operationId:"getOrderItems",summary:"Get user order items",description:"Retrieve all order items for the current user, sorted by creation date in descending order."}}},registerDomain:{"~orpc":{errorMap:{},meta:{route:{path:"/orders/register-domain",method:"POST",tags:["orders"],operationId:"registerDomain",summary:"Instant Register domain",description:"Purchase a single domain instantly without adding to cart. Validates domain availability, creates payments and order, then starts the order processing workflow."}},route:{path:"/orders/register-domain",method:"POST",tags:["orders"],operationId:"registerDomain",summary:"Instant Register domain",description:"Purchase a single domain instantly without adding to cart. Validates domain availability, creates payments and order, then starts the order processing workflow."}}},getOrderPaymentMethodsDetails:{"~orpc":{errorMap:{},meta:{route:{path:"/orders/{orderId}/payment-methods",method:"GET",tags:["orders"],operationId:"getOrderPaymentMethodsDetails",summary:"Get order payment methods",description:"Retrieve payment method details for an order, including card info for Stripe payments and wallet addresses for on-chain payments."}},route:{path:"/orders/{orderId}/payment-methods",method:"GET",tags:["orders"],operationId:"getOrderPaymentMethodsDetails",summary:"Get order payment methods",description:"Retrieve payment method details for an order, including card info for Stripe payments and wallet addresses for on-chain payments."}}}},balance:{getBalance:{"~orpc":{errorMap:{},meta:{route:{path:"/balance",method:"GET",tags:["balance"],operationId:"getBalance",summary:"Get NFSC balance",description:"Retrieve NFSC (Namefi Stable Coin) balance across all supported blockchain chains for the authenticated user's linked wallet addresses. Returns both raw contract values and human-readable USD amounts."}},route:{path:"/balance",method:"GET",tags:["balance"],operationId:"getBalance",summary:"Get NFSC balance",description:"Retrieve NFSC (Namefi Stable Coin) balance across all supported blockchain chains for the authenticated user's linked wallet addresses. Returns both raw contract values and human-readable USD amounts."}}}},search:{checkAvailability:{"~orpc":{errorMap:{},meta:{route:{path:"/search/availability",method:"GET",tags:["search"],operationId:"checkAvailability",summary:"Check domain availability",description:"Check if a domain is available for registration. Returns availability status, pricing details, current owner (if any), and registration constraints."}},route:{path:"/search/availability",method:"GET",tags:["search"],operationId:"checkAvailability",summary:"Check domain availability",description:"Check if a domain is available for registration. Returns availability status, pricing details, current owner (if any), and registration constraints."}}},getSuggestions:{"~orpc":{errorMap:{},meta:{route:{path:"/search/suggestions",method:"GET",tags:["search"],operationId:"getSuggestions",summary:"Get domain suggestions",description:"Generate domain suggestions based on a search query. Supports pagination and optional parent domain filtering for third-level domain suggestions."}},route:{path:"/search/suggestions",method:"GET",tags:["search"],operationId:"getSuggestions",summary:"Get domain suggestions",description:"Generate domain suggestions based on a search query. Supports pagination and optional parent domain filtering for third-level domain suggestions."}}}}};function k({authentication:o,logger:t,baseUrl:n="https://backend.astra.namefi.io"}){let{apiKey:d}=o,a=t?typeof t=="object"?t:{info:r((...e)=>console.log(...e),"info"),error:r((...e)=>console.error(...e),"error")}:void 0,s=new URL(n);s.pathname="/"+[...s.pathname.split("/").filter(Boolean),"v-next"].join("/");let c=new OpenAPILink(i,{url:s.toString(),headers:r(()=>({"x-api-key":d}),"headers"),fetch:r((e,p)=>globalThis.fetch(e,{...p,credentials:"include"}),"fetch"),interceptors:[onError(e=>{a?.error(e);}),onFinish(e=>{a?.info("Request finished");}),onStart(e=>{a?.info("Request started");}),onSuccess(e=>{a?.info("Request succeeded");})]});return createORPCClient(c)}r(k,"createNamefiClient");
2
- export{k as createNamefiClient};//# sourceMappingURL=index.js.map
1
+ import {onError,onFinish,onStart,onSuccess,createORPCClient}from'@orpc/client';import {OpenAPILink}from'@orpc/openapi-client/fetch';var h=Object.defineProperty;var n=(t,r)=>h(t,"name",{value:r,configurable:true});var p={dnsRecords:{getRecords:{"~orpc":{errorMap:{},meta:{eip712:{input:{acceptedPrimaryTypes:["ZoneSelectEnvelope"],types:{ZoneSelect:[{name:"zoneName",type:"string"}],ZoneSelectEnvelope:[{name:"payload",type:"ZoneSelect"},{name:"timestamp",type:"uint256"},{name:"nonce",type:"string"}]}}},route:{path:"/dns/records",method:"GET",tags:["dns","EIP712"],operationId:"getDnsRecords",summary:"Get DNS records",description:"Retrieve all DNS records for a specified domain zone. Returns an array of DNS records including A, AAAA, CNAME, MX, TXT, and other record types."}},route:{path:"/dns/records",method:"GET",tags:["dns","EIP712"],operationId:"getDnsRecords",summary:"Get DNS records",description:"Retrieve all DNS records for a specified domain zone. Returns an array of DNS records including A, AAAA, CNAME, MX, TXT, and other record types."}}},createDnsRecord:{"~orpc":{errorMap:{},meta:{eip712:{input:{acceptedPrimaryTypes:["CreateDnsRecordEnvelope"],types:{CreateDnsRecord:[{name:"name",type:"string"},{name:"rdata",type:"string"},{name:"ttl",type:"uint256"},{name:"zoneName",type:"string"}],CreateDnsRecordEnvelope:[{name:"payload",type:"CreateDnsRecord"},{name:"timestamp",type:"uint256"},{name:"nonce",type:"string"}]}}},route:{path:"/dns/records",method:"POST",tags:["dns","EIP712"],operationId:"createDnsRecord",summary:"Create DNS record",description:"Create a new DNS record for a domain. Requires domain ownership. The record will be validated against DNS zone rules before creation."}},route:{path:"/dns/records",method:"POST",tags:["dns","EIP712"],operationId:"createDnsRecord",summary:"Create DNS record",description:"Create a new DNS record for a domain. Requires domain ownership. The record will be validated against DNS zone rules before creation."}}},updateRecord:{"~orpc":{errorMap:{},meta:{eip712:{input:{acceptedPrimaryTypes:["UpdateDnsRecordEnvelope"],types:{UpdateDnsRecord:[{name:"id",type:"string"},{name:"zoneName",type:"string"},{name:"name",type:"string"},{name:"rdata",type:"string"},{name:"ttl",type:"uint256"}],UpdateDnsRecordEnvelope:[{name:"payload",type:"UpdateDnsRecord"},{name:"timestamp",type:"uint256"},{name:"nonce",type:"string"}]}}},route:{path:"/dns/records/{id}",method:"PUT",tags:["dns","EIP712"],operationId:"updateDnsRecord",summary:"Update DNS record",description:"Update an existing DNS record by its ID. Requires domain ownership. The updated record will be validated against DNS zone rules."}},route:{path:"/dns/records/{id}",method:"PUT",tags:["dns","EIP712"],operationId:"updateDnsRecord",summary:"Update DNS record",description:"Update an existing DNS record by its ID. Requires domain ownership. The updated record will be validated against DNS zone rules."}}},deleteRecord:{"~orpc":{errorMap:{},meta:{eip712:{input:{acceptedPrimaryTypes:["RecordSelectEnvelope"],types:{RecordSelect:[{name:"id",type:"string"},{name:"zoneName",type:"string"}],RecordSelectEnvelope:[{name:"payload",type:"RecordSelect"},{name:"timestamp",type:"uint256"},{name:"nonce",type:"string"}]}}},route:{path:"/dns/records/{id}",method:"DELETE",tags:["dns","EIP712"],operationId:"deleteDnsRecord",summary:"Delete DNS record",description:"Delete a DNS record by its ID. Requires domain ownership. The deletion will be validated to ensure zone integrity."}},route:{path:"/dns/records/{id}",method:"DELETE",tags:["dns","EIP712"],operationId:"deleteDnsRecord",summary:"Delete DNS record",description:"Delete a DNS record by its ID. Requires domain ownership. The deletion will be validated to ensure zone integrity."}}},updateRecords:{"~orpc":{errorMap:{},meta:{eip712:{input:{acceptedPrimaryTypes:["UpdateRecordsEnvelope"],types:{UpdateZoneRecord:[{name:"id",type:"string"},{name:"name",type:"string"},{name:"rdata",type:"string"},{name:"ttl",type:"uint256"}],UpdateRecords:[{name:"records",type:"UpdateZoneRecord[]"},{name:"zoneName",type:"string"}],UpdateRecordsEnvelope:[{name:"payload",type:"UpdateRecords"},{name:"timestamp",type:"uint256"},{name:"nonce",type:"string"}]}}},route:{path:"/dns/records/batch",method:"PUT",tags:["dns","EIP712"],operationId:"batchUpdateDnsRecords",summary:"Batch update DNS records",description:"Update multiple DNS records in a single transaction. Requires domain ownership. All records must belong to the same zone and will be validated together."}},route:{path:"/dns/records/batch",method:"PUT",tags:["dns","EIP712"],operationId:"batchUpdateDnsRecords",summary:"Batch update DNS records",description:"Update multiple DNS records in a single transaction. Requires domain ownership. All records must belong to the same zone and will be validated together."}}},createRecords:{"~orpc":{errorMap:{},meta:{eip712:{input:{acceptedPrimaryTypes:["CreateRecordsEnvelope"],types:{CreateRecords:[{name:"zoneName",type:"string"}],CreateRecordsEnvelope:[{name:"payload",type:"CreateRecords"},{name:"timestamp",type:"uint256"},{name:"nonce",type:"string"}]}}},route:{path:"/dns/records/batch",method:"POST",tags:["dns","EIP712"],operationId:"batchCreateDnsRecords",summary:"Batch create DNS records",description:"Create multiple DNS records in a single transaction. Requires domain ownership. All records will be validated together against DNS zone rules."}},route:{path:"/dns/records/batch",method:"POST",tags:["dns","EIP712"],operationId:"batchCreateDnsRecords",summary:"Batch create DNS records",description:"Create multiple DNS records in a single transaction. Requires domain ownership. All records will be validated together against DNS zone rules."}}},deleteRecords:{"~orpc":{errorMap:{},meta:{eip712:{input:{acceptedPrimaryTypes:["DeleteRecordsEnvelope"],types:{DeleteRecords:[{name:"recordsIds",type:"string[]"},{name:"zoneName",type:"string"}],DeleteRecordsEnvelope:[{name:"payload",type:"DeleteRecords"},{name:"timestamp",type:"uint256"},{name:"nonce",type:"string"}]}}},route:{path:"/dns/records/batch",method:"DELETE",tags:["dns","EIP712"],operationId:"batchDeleteDnsRecords",summary:"Batch delete DNS records",description:"Delete multiple DNS records by their IDs in a single transaction. Requires domain ownership. The zone will be validated after deletion."}},route:{path:"/dns/records/batch",method:"DELETE",tags:["dns","EIP712"],operationId:"batchDeleteDnsRecords",summary:"Batch delete DNS records",description:"Delete multiple DNS records by their IDs in a single transaction. Requires domain ownership. The zone will be validated after deletion."}}},parkDomain:{"~orpc":{errorMap:{},meta:{route:{path:"/dns/park",method:"POST",tags:["dns"],operationId:"parkDomain",summary:"Park domain",description:"Park a domain by setting up default parking DNS records (A and AAAA records pointing to the parking server). Optionally override existing conflicting records."}},route:{path:"/dns/park",method:"POST",tags:["dns"],operationId:"parkDomain",summary:"Park domain",description:"Park a domain by setting up default parking DNS records (A and AAAA records pointing to the parking server). Optionally override existing conflicting records."}}},isDomainParked:{"~orpc":{errorMap:{},meta:{route:{path:"/dns/parked",method:"GET",tags:["dns"],operationId:"isDomainParked",summary:"Check if domain is parked",description:"Check whether a domain has the standard parking DNS records configured. Returns true if the domain is parked, false otherwise."}},route:{path:"/dns/parked",method:"GET",tags:["dns"],operationId:"isDomainParked",summary:"Check if domain is parked",description:"Check whether a domain has the standard parking DNS records configured. Returns true if the domain is parked, false otherwise."}}}},user:{getDomains:{"~orpc":{errorMap:{},meta:{route:{path:"/user/domains",method:"GET",tags:["user"],operationId:"getUserDomains",summary:"Get user domains",description:"Retrieve all domains owned by the current user. Returns domain details including DNS status, nameservers, and expiration dates."}},route:{path:"/user/domains",method:"GET",tags:["user"],operationId:"getUserDomains",summary:"Get user domains",description:"Retrieve all domains owned by the current user. Returns domain details including DNS status, nameservers, and expiration dates."}}},requestNfscFaucet:{"~orpc":{errorMap:{},meta:{route:{path:"/user/faucet",method:"POST",tags:["user","balance"],operationId:"requestNfscFaucet",summary:"Request NFSC faucet",description:"Request NFSC test tokens on Sepolia. Rate limited by user and wallet address."}},route:{path:"/user/faucet",method:"POST",tags:["user","balance"],operationId:"requestNfscFaucet",summary:"Request NFSC faucet",description:"Request NFSC test tokens on Sepolia. Rate limited by user and wallet address."}}},getUserOrders:{"~orpc":{errorMap:{},meta:{route:{path:"/user/orders",method:"GET",tags:["user","orders"],operationId:"getUserOrders",summary:"Get user orders",description:"Retrieve all order items for the current user. Returns order items sorted by creation date in descending order."}},route:{path:"/user/orders",method:"GET",tags:["user","orders"],operationId:"getUserOrders",summary:"Get user orders",description:"Retrieve all order items for the current user. Returns order items sorted by creation date in descending order."}}}},orders:{getOrder:{"~orpc":{errorMap:{},meta:{route:{path:"/orders/{orderId}",method:"GET",tags:["orders"],operationId:"getOrder",summary:"Get order details",description:"Retrieve detailed information about an order including items, payments, and user details. User must own the order."}},route:{path:"/orders/{orderId}",method:"GET",tags:["orders"],operationId:"getOrder",summary:"Get order details",description:"Retrieve detailed information about an order including items, payments, and user details. User must own the order."}}},getOrderItems:{"~orpc":{errorMap:{},meta:{route:{path:"/orders/items",method:"GET",tags:["orders"],operationId:"getOrderItems",summary:"Get user order items",description:"Retrieve all order items for the current user, sorted by creation date in descending order."}},route:{path:"/orders/items",method:"GET",tags:["orders"],operationId:"getOrderItems",summary:"Get user order items",description:"Retrieve all order items for the current user, sorted by creation date in descending order."}}},registerDomain:{"~orpc":{errorMap:{},meta:{eip712:{input:{acceptedPrimaryTypes:["InstantRegisterDomainEnvelope","InstantRegisterDomainDefaultWalletEnvelope"],types:{InstantRegisterDomainEnvelope_Payload_NftReceivinggWallet:[{name:"chainId",type:"uint256"}],InstantRegisterDomain:[{name:"normalizedDomainName",type:"string"},{name:"durationInYears",type:"uint256"},{name:"nftReceivinggWallet",type:"InstantRegisterDomainEnvelope_Payload_NftReceivinggWallet"}],InstantRegisterDomainEnvelope:[{name:"payload",type:"InstantRegisterDomain"},{name:"timestamp",type:"uint256"},{name:"nonce",type:"string"}],InstantRegisterDomainDefaultWallet:[{name:"normalizedDomainName",type:"string"},{name:"durationInYears",type:"uint256"}],InstantRegisterDomainDefaultWalletEnvelope:[{name:"payload",type:"InstantRegisterDomainDefaultWallet"},{name:"timestamp",type:"uint256"},{name:"nonce",type:"string"}]}}},route:{path:"/orders/register-domain",method:"POST",tags:["orders","EIP712"],operationId:"registerDomain",summary:"Instant Register domain",description:"Purchase a single domain instantly without adding to cart. Validates domain availability, creates payments and order, then starts the order processing workflow."}},route:{path:"/orders/register-domain",method:"POST",tags:["orders","EIP712"],operationId:"registerDomain",summary:"Instant Register domain",description:"Purchase a single domain instantly without adding to cart. Validates domain availability, creates payments and order, then starts the order processing workflow."}}},registerWithRecords:{"~orpc":{errorMap:{},meta:{route:{path:"/orders/register-domain/records",method:"POST",tags:["orders"],operationId:"registerWithRecords",summary:"Instant register domain with records",description:"Purchase a single domain instantly and apply DNS records after processing."}},route:{path:"/orders/register-domain/records",method:"POST",tags:["orders"],operationId:"registerWithRecords",summary:"Instant register domain with records",description:"Purchase a single domain instantly and apply DNS records after processing."}}},getOrderPaymentMethodsDetails:{"~orpc":{errorMap:{},meta:{route:{path:"/orders/{orderId}/payment-methods",method:"GET",tags:["orders"],operationId:"getOrderPaymentMethodsDetails",summary:"Get order payment methods",description:"Retrieve payment method details for an order, including card info for Stripe payments and wallet addresses for on-chain payments."}},route:{path:"/orders/{orderId}/payment-methods",method:"GET",tags:["orders"],operationId:"getOrderPaymentMethodsDetails",summary:"Get order payment methods",description:"Retrieve payment method details for an order, including card info for Stripe payments and wallet addresses for on-chain payments."}}}},balance:{getBalance:{"~orpc":{errorMap:{},meta:{route:{path:"/balance",method:"GET",tags:["balance"],operationId:"getBalance",summary:"Get NFSC balance",description:"Retrieve NFSC (Namefi Stable Coin) balance across all supported blockchain chains for the authenticated user's linked wallet addresses. Returns both raw contract values and human-readable USD amounts."}},route:{path:"/balance",method:"GET",tags:["balance"],operationId:"getBalance",summary:"Get NFSC balance",description:"Retrieve NFSC (Namefi Stable Coin) balance across all supported blockchain chains for the authenticated user's linked wallet addresses. Returns both raw contract values and human-readable USD amounts."}}}},search:{checkAvailability:{"~orpc":{errorMap:{},meta:{route:{path:"/search/availability",method:"GET",tags:["search"],operationId:"checkAvailability",summary:"Check domain availability",description:"Check if a domain is available for registration. Returns availability status, pricing details, current owner (if any), and registration constraints."}},route:{path:"/search/availability",method:"GET",tags:["search"],operationId:"checkAvailability",summary:"Check domain availability",description:"Check if a domain is available for registration. Returns availability status, pricing details, current owner (if any), and registration constraints."}}},getSuggestions:{"~orpc":{errorMap:{},meta:{route:{path:"/search/suggestions",method:"GET",tags:["search"],operationId:"getSuggestions",summary:"Get domain suggestions",description:"Generate domain suggestions based on a search query. Supports pagination and optional parent domain filtering for third-level domain suggestions."}},route:{path:"/search/suggestions",method:"GET",tags:["search"],operationId:"getSuggestions",summary:"Get domain suggestions",description:"Generate domain suggestions based on a search query. Supports pagination and optional parent domain filtering for third-level domain suggestions."}}}}};function U({authentication:t,logger:r,baseUrl:a="https://backend.astra.namefi.io"}){let{type:o}=t,s=r?typeof r=="object"?r:{info:n((...e)=>console.log(...e),"info"),error:n((...e)=>console.error(...e),"error")}:void 0,i=new URL(a);i.pathname="/"+[...i.pathname.split("/").filter(Boolean),"v-next"].join("/");let l=new OpenAPILink(p,{url:i.toString(),headers:n(async(e,d,u)=>{if(o==="API_KEY")return {"x-api-key":t.apiKey};let m=N(d,p)?.["~orpc"]?.meta?.eip712,c=m?.input?.acceptedPrimaryTypes?.[0],{signature:g,address:y}=await t.signer.signTypedData({domain:{name:"Namefi",version:"1"},types:m?.input?.types??{},primaryType:c,message:{payload:u,timestamp:Math.trunc(Date.now()/1e3),nonce:t.signer.generateNonce()}});return {"x-namefi-signer":y,"x-namefi-signature":g,"x-namefi-eip712-type":c}},"headers"),fetch:n((e,d)=>globalThis.fetch(e,{...d,credentials:"include"}),"fetch"),interceptors:[onError(e=>{s?.error(e);}),onFinish(e=>{s?.info("Request finished");}),onStart(e=>{s?.info("Request started");}),onSuccess(e=>{s?.info("Request succeeded");})]});return createORPCClient(l)}n(U,"createNamefiClient");function N(t,r){let a=r;for(let o of t)if(a&&o in a)a=a[o];else return;return a}n(N,"getPath");
2
+ export{U as createNamefiClient};//# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map