@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.cts 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 };