uvd-x402-sdk 2.41.0 → 2.42.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.
package/README.md CHANGED
@@ -1014,34 +1014,58 @@ The facilitator's `/supported` endpoint advertises both `'escrow'` and `'commerc
1014
1014
 
1015
1015
  Register and discover paid x402 resources across the network.
1016
1016
 
1017
+ The Bazaar is served by the facilitator itself under `/discovery/*`. No API key, no separate host.
1018
+
1017
1019
  ```typescript
1018
- import { BazaarClient } from 'uvd-x402-sdk/backend';
1020
+ import { BazaarClient, isAlive } from 'uvd-x402-sdk/backend';
1019
1021
 
1020
- const bazaar = new BazaarClient({ apiKey: 'your-api-key' });
1022
+ const bazaar = new BazaarClient();
1021
1023
 
1022
- // Discover resources
1023
- const results = await bazaar.discover({
1024
- category: 'ai',
1025
- network: 'base',
1026
- maxPrice: '0.10',
1024
+ // List resources. Every filter is applied server-side over the whole catalog,
1025
+ // so `pagination.total` is the real number of matches -- filtering one page
1026
+ // locally is not the same thing and will under-report.
1027
+ const page = await bazaar.listResources({
1028
+ network: 'eip155:8453',
1029
+ health: 'alive', // only endpoints a probe actually reached
1030
+ tier: 'vip', // first_party | vip | verified | listed
1031
+ limit: 20,
1027
1032
  });
1028
1033
 
1029
- for (const resource of results.resources) {
1030
- console.log(`${resource.name}: ${resource.url}`);
1034
+ for (const r of page.items) {
1035
+ console.log(r.url, r.health?.status, `${r.health?.latencyMs}ms`, r.curation?.label);
1036
+ }
1037
+ console.log(`${page.items.length} of ${page.pagination.total}`);
1038
+
1039
+ // Free-text search. The parameter is `q`; anything else is rejected with a 400.
1040
+ const hits = await bazaar.listResources({ q: 'logs' });
1041
+
1042
+ // Walk the whole filtered catalog, one page at a time
1043
+ for await (const r of bazaar.iterateResources({ health: 'alive' })) {
1044
+ if (isAlive(r)) console.log(r.url);
1031
1045
  }
1032
1046
 
1033
- // Register a resource
1034
- const resource = await bazaar.register({
1047
+ // Register a resource. Registration is open and rate limited.
1048
+ await bazaar.registerResource({
1035
1049
  url: 'https://api.example.com/v1/generate',
1036
- name: 'Image Generator API',
1037
1050
  description: 'Generate images with AI',
1038
- category: 'ai',
1039
- networks: ['base', 'ethereum'],
1040
- price: '0.05',
1041
- payTo: '0x1234...',
1051
+ accepts: [{
1052
+ scheme: 'exact',
1053
+ network: 'eip155:8453',
1054
+ asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
1055
+ amount: '50000',
1056
+ payTo: '0x1234...',
1057
+ maxTimeoutSeconds: 60,
1058
+ }],
1059
+ metadata: { category: 'ai', tags: ['image'] },
1042
1060
  });
1061
+
1062
+ // Aggregate catalog metrics
1063
+ const stats = await bazaar.getStats();
1064
+ console.log(stats.total, stats.visible, stats.byHealth.alive);
1043
1065
  ```
1044
1066
 
1067
+ Timestamps (`firstSeen`, `lastSeen`, `lastUpdated`, `health.lastChecked`) are Unix epoch **seconds**. Use `epochToDate()` to get a `Date`.
1068
+
1045
1069
  ## Facilitator Info
1046
1070
 
1047
1071
  Query the facilitator for version, supported networks, and compliance data.
@@ -526,301 +526,316 @@ declare function createHonoMiddleware(options: HonoMiddlewareOptions): (c: {
526
526
  set?: (key: string, value: unknown) => void;
527
527
  }, next: () => Promise<void>) => Promise<unknown>;
528
528
  /**
529
- * Resource category for discovery
530
- */
531
- type BazaarCategory = 'api' | 'data' | 'ai' | 'media' | 'compute' | 'storage' | 'other';
532
- /**
533
- * Network/chain filter for discovery
534
- */
535
- type BazaarNetwork = 'base' | 'ethereum' | 'polygon' | 'arbitrum' | 'optimism' | 'avalanche' | 'celo' | 'hyperevm' | 'unichain' | 'monad' | 'scroll' | 'skale-base' | 'robinhood' | 'robinhood-testnet' | 'solana' | 'fogo' | 'stellar' | 'near' | 'algorand' | 'sui' | 'xrpl-mainnet' | 'xrpl-testnet';
536
- /**
537
- * Token/asset filter for discovery
529
+ * Maximum length of the free-text `q` filter.
530
+ *
531
+ * Mirrors the facilitator's `MAX_SEARCH_LEN`; a longer needle is rejected
532
+ * server-side with a 400.
538
533
  */
539
- type BazaarToken = 'USDC' | 'EURC' | 'AUSD' | 'PYUSD' | 'USDT' | 'USDG';
534
+ declare const MAX_SEARCH_LEN = 128;
540
535
  /**
541
- * Resource registered in the Bazaar
542
- */
543
- interface BazaarResource {
544
- /** Unique resource ID */
545
- id: string;
546
- /** Resource URL */
547
- url: string;
548
- /** Human-readable name */
549
- name: string;
550
- /** Description of the resource */
551
- description: string;
552
- /** Category of the resource */
553
- category: BazaarCategory;
554
- /** Supported networks for payment */
555
- networks: BazaarNetwork[];
556
- /** Supported tokens for payment */
557
- tokens: BazaarToken[];
558
- /** Price per request in atomic units */
559
- pricePerRequest: string;
560
- /** Price currency (e.g., "USDC") */
561
- priceCurrency: BazaarToken;
562
- /** Recipient address for payments */
563
- payTo: string;
564
- /** MIME type of the resource */
565
- mimeType: string;
566
- /** Optional output schema */
567
- outputSchema?: unknown;
568
- /** Resource owner/provider */
569
- provider?: string;
570
- /** Resource tags for search */
571
- tags?: string[];
572
- /** Whether the resource is active */
573
- isActive: boolean;
574
- /** ISO timestamp of creation */
575
- createdAt: string;
576
- /** ISO timestamp of last update */
577
- updatedAt: string;
536
+ * Liveness of a registered resource, as measured by the facilitator's prober.
537
+ *
538
+ * Resources that stop answering are quarantined rather than deleted, so filter
539
+ * on this before paying anyone.
540
+ */
541
+ type DiscoveryHealthStatus = 'alive' | 'degraded' | 'auth_gated' | 'quarantined' | 'unknown' | 'unprobeable';
542
+ /** Values accepted by the `health` filter, including the `any` escape hatch. */
543
+ declare const HEALTH_FILTERS: readonly ["alive", "degraded", "auth_gated", "quarantined", "unknown", "unprobeable", "any"];
544
+ /** Curated tier, in descending order of trust. */
545
+ type DiscoveryTier = 'first_party' | 'vip' | 'verified' | 'listed';
546
+ /** Values accepted by the `tier` filter. */
547
+ declare const TIER_FILTERS: readonly ["first_party", "vip", "verified", "listed"];
548
+ /** How a resource got into the registry. */
549
+ type DiscoverySource = 'self_registered' | 'settlement' | 'crawled' | 'aggregated';
550
+ /** Health of a single resource, as reported by the registry's prober. */
551
+ interface DiscoveryHealth {
552
+ /** Last observed liveness */
553
+ status?: DiscoveryHealthStatus;
554
+ /** Unix epoch seconds of the last probe */
555
+ lastChecked?: number;
556
+ /** HTTP status the probe got back (402 is the healthy answer for x402) */
557
+ httpStatus?: number;
558
+ /** Round-trip time of the last probe, in milliseconds */
559
+ latencyMs?: number;
560
+ }
561
+ /** Curation metadata attached to a resource. */
562
+ interface DiscoveryCuration {
563
+ /** Curated tier */
564
+ tier?: DiscoveryTier;
565
+ /** Human-readable name of the curated set */
566
+ label?: string;
567
+ }
568
+ /** One payment method a resource declares. */
569
+ interface DiscoveryAccepts {
570
+ /** Payment scheme ("exact", "escrow", "commerce") */
571
+ scheme: string;
572
+ /** CAIP-2 network id, e.g. "eip155:8453" */
573
+ network: string;
574
+ /** Token contract address */
575
+ asset?: string;
576
+ /** Price in atomic units of `asset` */
577
+ amount?: string;
578
+ /** Recipient address */
579
+ payTo?: string;
580
+ /** Settlement deadline in seconds */
581
+ maxTimeoutSeconds?: number;
582
+ /** Scheme-specific extras (EIP-712 domain, etc.) */
583
+ extra?: Record<string, unknown>;
584
+ /** Anything the registry adds later */
585
+ [key: string]: unknown;
578
586
  }
579
587
  /**
580
- * Options for registering a resource
588
+ * A discoverable paid resource, exactly as `GET /discovery/resources` serves it.
589
+ *
590
+ * Timestamps are Unix epoch **seconds**, not ISO strings and not milliseconds.
581
591
  */
582
- interface BazaarRegisterOptions {
583
- /** Resource URL (must be unique) */
592
+ interface DiscoveryResource {
593
+ /** Resource URL. This is the registry's primary key -- there is no `id` */
584
594
  url: string;
585
- /** Human-readable name */
586
- name: string;
587
- /** Description of the resource */
588
- description: string;
589
- /** Category of the resource */
590
- category: BazaarCategory;
591
- /** Supported networks for payment */
592
- networks: BazaarNetwork[];
593
- /** Supported tokens for payment */
594
- tokens?: BazaarToken[];
595
- /** Price per request (e.g., "0.01") */
596
- price: string;
597
- /** Price currency (default: USDC) */
598
- priceCurrency?: BazaarToken;
599
- /** Recipient address for payments */
600
- payTo: string;
601
- /** MIME type of the resource (default: application/json) */
602
- mimeType?: string;
603
- /** Optional output schema */
604
- outputSchema?: unknown;
605
- /** Resource tags for search */
606
- tags?: string[];
595
+ /** Resource type ("http", "mcp", "a2a") */
596
+ type: string;
597
+ /** x402 protocol version the resource speaks */
598
+ x402Version: number;
599
+ /** Human-readable description */
600
+ description?: string;
601
+ /** Payment methods the resource accepts */
602
+ accepts: DiscoveryAccepts[];
603
+ /** Free-form metadata (category, provider, tags) */
604
+ metadata?: Record<string, unknown>;
605
+ /** How this resource entered the registry */
606
+ source?: DiscoverySource;
607
+ /** Facilitator this resource was aggregated from */
608
+ sourceFacilitator?: string;
609
+ /** Unix epoch seconds when the registry first saw this resource */
610
+ firstSeen?: number;
611
+ /** Unix epoch seconds when the registry last saw this resource */
612
+ lastSeen?: number;
613
+ /** Unix epoch seconds of the last change to this record */
614
+ lastUpdated?: number;
615
+ /** Liveness, when the resource has been probed */
616
+ health?: DiscoveryHealth;
617
+ /** Curation tier, when the resource has been curated */
618
+ curation?: DiscoveryCuration;
619
+ /** Anything the registry adds later */
620
+ [key: string]: unknown;
621
+ }
622
+ /** Pagination envelope of `GET /discovery/resources`. */
623
+ interface DiscoveryPagination {
624
+ /** Page size that was applied */
625
+ limit: number;
626
+ /** Offset that was applied */
627
+ offset: number;
628
+ /** Total number of resources matching the filters, across all pages */
629
+ total: number;
630
+ }
631
+ /** Paginated response from `GET /discovery/resources`. */
632
+ interface DiscoveryResponse {
633
+ /** x402 protocol version of the response envelope */
634
+ x402Version: number;
635
+ /** Resources on this page */
636
+ items: DiscoveryResource[];
637
+ /** Pagination state */
638
+ pagination: DiscoveryPagination;
607
639
  }
608
640
  /**
609
- * Options for discovering resources
641
+ * Filters for `listResources()`.
642
+ *
643
+ * Every one of these is applied server-side over the whole catalog, so
644
+ * `pagination.total` reflects the filtered set. Filtering a page after the
645
+ * fact is not the same thing and will under-report.
610
646
  */
611
- interface BazaarDiscoverOptions {
647
+ interface DiscoveryListOptions {
648
+ /** Page size (default: 10, max: 100) */
649
+ limit?: number;
650
+ /** Number of resources to skip */
651
+ offset?: number;
612
652
  /** Filter by category */
613
- category?: BazaarCategory;
614
- /** Filter by network */
615
- network?: BazaarNetwork;
616
- /** Filter by token */
617
- token?: BazaarToken;
618
- /** Filter by provider address */
653
+ category?: string;
654
+ /** Filter by network, CAIP-2 or v1 name */
655
+ network?: string;
656
+ /** Filter by provider name */
619
657
  provider?: string;
620
- /** Filter by tags (match any) */
621
- tags?: string[];
622
- /** Search query (name, description) */
623
- query?: string;
624
- /** Maximum price filter (e.g., "0.10") */
625
- maxPrice?: string;
626
- /** Page number (1-indexed) */
627
- page?: number;
628
- /** Results per page (default: 20, max: 100) */
629
- limit?: number;
630
- /** Sort order */
631
- sortBy?: 'price' | 'createdAt' | 'name';
632
- /** Sort direction */
633
- sortOrder?: 'asc' | 'desc';
658
+ /** Filter by tag */
659
+ tag?: string;
660
+ /** Filter by how the resource was discovered */
661
+ source?: DiscoverySource;
662
+ /** Filter by originating facilitator */
663
+ sourceFacilitator?: string;
664
+ /** Filter by liveness, or 'any' to opt out of the default visibility rules */
665
+ health?: DiscoveryHealthStatus | 'any';
666
+ /** Filter by curated tier */
667
+ tier?: DiscoveryTier;
668
+ /** Free-text search over url / description / provider / category / tags */
669
+ q?: string;
634
670
  }
635
- /**
636
- * Paginated discovery response
637
- */
638
- interface BazaarDiscoverResponse {
639
- /** List of resources matching the query */
640
- resources: BazaarResource[];
641
- /** Total number of matching resources */
671
+ /** Options for `registerResource()`. */
672
+ interface DiscoveryRegisterOptions {
673
+ /** URL of the paid resource. Doubles as its identity in the registry */
674
+ url: string;
675
+ /** Resource type (default: "http") */
676
+ type?: string;
677
+ /** Human-readable description */
678
+ description?: string;
679
+ /** Payment methods the resource accepts */
680
+ accepts?: DiscoveryAccepts[];
681
+ /** Free-form metadata (category, provider, tags) */
682
+ metadata?: Record<string, unknown>;
683
+ }
684
+ /** Aggregate catalog metrics from `GET /discovery/stats`. */
685
+ interface DiscoveryStats {
686
+ /** Every record the registry holds, including quarantined ones */
642
687
  total: number;
643
- /** Current page number */
644
- page: number;
645
- /** Results per page */
646
- limit: number;
647
- /** Total number of pages */
648
- totalPages: number;
649
- /** Whether there are more pages */
650
- hasMore: boolean;
688
+ /** Records served by default listings */
689
+ visible: number;
690
+ /** Counts by discovery source */
691
+ bySource: Record<string, number>;
692
+ /** Counts by originating facilitator */
693
+ bySourceFacilitator: Record<string, number>;
694
+ /** Counts by CAIP-2 network */
695
+ byNetwork: Record<string, number>;
696
+ /** Counts by curated tier */
697
+ byTier: Record<string, number>;
698
+ /** Counts by liveness */
699
+ byHealth: Record<string, number>;
700
+ /** Unix epoch seconds this snapshot was computed (60s cache) */
701
+ generatedAt?: number;
651
702
  }
652
- /**
653
- * Options for the BazaarClient
654
- */
703
+ /** Options for the {@link BazaarClient}. */
655
704
  interface BazaarClientOptions {
656
- /** Base URL of the Bazaar API (default: https://bazaar.ultravioletadao.xyz) */
705
+ /** Facilitator base URL (default: https://facilitator.ultravioletadao.xyz) */
657
706
  baseUrl?: string;
658
- /** API key for authenticated operations (required for register/update/delete) */
659
- apiKey?: string;
660
707
  /** Request timeout in milliseconds (default: 30000) */
661
708
  timeout?: number;
662
709
  }
710
+ /** Render an epoch-seconds field as a `Date`. */
711
+ declare function epochToDate(seconds?: number): Date | undefined;
712
+ /** True when the last probe reached this resource. */
713
+ declare function isAlive(resource: DiscoveryResource): boolean;
663
714
  /**
664
- * Client for interacting with the x402 Bazaar Discovery API
715
+ * Client for the x402 Bazaar Discovery API.
665
716
  *
666
- * The Bazaar is a discovery service for x402-enabled resources.
667
- * Providers can register their APIs and consumers can discover them.
717
+ * The Bazaar is the facilitator's own registry of x402-enabled resources.
718
+ * Providers register their endpoints and consumers discover them, with a
719
+ * liveness probe and a curation tier attached to every record.
668
720
  *
669
721
  * @example
670
722
  * ```ts
671
- * // Discover resources (no auth required)
672
723
  * const bazaar = new BazaarClient();
673
- * const results = await bazaar.discover({
674
- * category: 'ai',
675
- * network: 'base',
676
- * maxPrice: '0.10',
677
- * });
678
724
  *
679
- * // Register a resource (requires API key)
680
- * const authBazaar = new BazaarClient({ apiKey: 'your-api-key' });
681
- * const resource = await authBazaar.register({
682
- * url: 'https://api.example.com/v1/chat',
683
- * name: 'AI Chat API',
684
- * description: 'Pay-per-message AI chat',
685
- * category: 'ai',
686
- * networks: ['base', 'ethereum'],
687
- * price: '0.01',
688
- * payTo: '0x...',
725
+ * // Only endpoints a probe actually reached, best-curated first
726
+ * const page = await bazaar.listResources({ limit: 20, health: 'alive', tier: 'vip' });
727
+ * for (const r of page.items) {
728
+ * console.log(r.url, r.health?.status, r.health?.latencyMs, r.curation?.label);
729
+ * }
730
+ *
731
+ * // Free-text search runs server-side over the whole catalog
732
+ * const hits = await bazaar.listResources({ q: 'logs' });
733
+ * console.log(hits.pagination.total);
734
+ *
735
+ * // Register your own
736
+ * await bazaar.registerResource({
737
+ * url: 'https://api.example.com/v1/generate',
738
+ * description: 'Generate images with AI',
739
+ * accepts: [{
740
+ * scheme: 'exact',
741
+ * network: 'eip155:8453',
742
+ * asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
743
+ * amount: '10000',
744
+ * payTo: '0xYourWallet...',
745
+ * maxTimeoutSeconds: 60,
746
+ * }],
747
+ * metadata: { category: 'ai', tags: ['image'] },
689
748
  * });
690
749
  * ```
691
750
  */
692
751
  declare class BazaarClient {
693
752
  private readonly baseUrl;
694
- private readonly apiKey?;
695
753
  private readonly timeout;
696
754
  constructor(options?: BazaarClientOptions);
697
755
  /**
698
- * Discover x402-enabled resources
756
+ * Issue a request against the facilitator with the configured timeout.
757
+ */
758
+ private request;
759
+ /**
760
+ * List resources from the discovery registry.
699
761
  *
700
- * @param options - Discovery filters
701
- * @returns Paginated list of matching resources
762
+ * @param options - Server-side filters and pagination
763
+ * @returns One page of resources plus the total across all pages
702
764
  *
703
765
  * @example
704
766
  * ```ts
705
- * // Find AI APIs on Base with USDC under $0.10
706
- * const results = await bazaar.discover({
707
- * category: 'ai',
708
- * network: 'base',
709
- * token: 'USDC',
710
- * maxPrice: '0.10',
711
- * });
712
- *
713
- * for (const resource of results.resources) {
714
- * console.log(`${resource.name}: ${resource.url}`);
715
- * }
767
+ * const page = await bazaar.listResources({ network: 'eip155:8453', health: 'alive' });
716
768
  * ```
717
769
  */
718
- discover(options?: BazaarDiscoverOptions): Promise<BazaarDiscoverResponse>;
719
- /**
720
- * Get a specific resource by ID
721
- *
722
- * @param resourceId - Resource ID
723
- * @returns Resource details
724
- */
725
- getResource(resourceId: string): Promise<BazaarResource>;
726
- /**
727
- * Get a resource by its URL
728
- *
729
- * @param resourceUrl - Resource URL
730
- * @returns Resource details
731
- */
732
- getResourceByUrl(resourceUrl: string): Promise<BazaarResource>;
770
+ listResources(options?: DiscoveryListOptions): Promise<DiscoveryResponse>;
733
771
  /**
734
- * Register a new resource in the Bazaar
772
+ * Walk the whole filtered catalog, one page at a time.
735
773
  *
736
- * Requires API key authentication.
774
+ * Pages are fetched in sequence rather than in parallel: the read routes are
775
+ * rate limited, and a burst of parallel pages is how a legitimate catalog
776
+ * walk turns into a wall of 429s.
737
777
  *
738
- * @param options - Resource registration options
739
- * @returns Registered resource
778
+ * @param options - Same filters as {@link listResources}; `limit` is the page size
740
779
  *
741
780
  * @example
742
781
  * ```ts
743
- * const resource = await bazaar.register({
744
- * url: 'https://api.example.com/v1/generate',
745
- * name: 'Image Generator API',
746
- * description: 'Generate images with AI',
747
- * category: 'ai',
748
- * networks: ['base', 'ethereum', 'polygon'],
749
- * price: '0.05',
750
- * payTo: '0x1234...',
751
- * tags: ['ai', 'image', 'generator'],
752
- * });
782
+ * for await (const r of bazaar.iterateResources({ health: 'alive' })) {
783
+ * console.log(r.url);
784
+ * }
753
785
  * ```
754
786
  */
755
- register(options: BazaarRegisterOptions): Promise<BazaarResource>;
756
- /**
757
- * Update an existing resource
758
- *
759
- * Requires API key authentication. Only the owner can update.
760
- *
761
- * @param resourceId - Resource ID to update
762
- * @param updates - Partial update options
763
- * @returns Updated resource
764
- */
765
- update(resourceId: string, updates: Partial<BazaarRegisterOptions>): Promise<BazaarResource>;
787
+ iterateResources(options?: DiscoveryListOptions): AsyncGenerator<DiscoveryResource, void, undefined>;
766
788
  /**
767
- * Delete a resource from the Bazaar
789
+ * Look up a single resource by its URL.
768
790
  *
769
- * Requires API key authentication. Only the owner can delete.
791
+ * The registry keys on URL and has no by-id lookup, so this searches and
792
+ * then matches exactly.
770
793
  *
771
- * @param resourceId - Resource ID to delete
794
+ * @param resourceUrl - Exact URL of the resource
795
+ * @returns The resource, or null when it is not registered
772
796
  */
773
- delete(resourceId: string): Promise<void>;
797
+ getResourceByUrl(resourceUrl: string): Promise<DiscoveryResource | null>;
774
798
  /**
775
- * Deactivate a resource (soft delete)
799
+ * Register a paid resource in the discovery registry.
776
800
  *
777
- * Requires API key authentication. Only the owner can deactivate.
801
+ * Registration is open and rate limited; re-registering a known URL updates
802
+ * the existing record rather than creating a duplicate.
778
803
  *
779
- * @param resourceId - Resource ID to deactivate
780
- * @returns Updated resource with isActive: false
804
+ * @param options - Resource details
805
+ * @returns The registry's acknowledgement
781
806
  */
782
- deactivate(resourceId: string): Promise<BazaarResource>;
807
+ registerResource(options: DiscoveryRegisterOptions): Promise<Record<string, unknown>>;
783
808
  /**
784
- * Reactivate a deactivated resource
809
+ * Aggregate catalog metrics (60s cached server-side).
785
810
  *
786
- * Requires API key authentication. Only the owner can reactivate.
787
- *
788
- * @param resourceId - Resource ID to reactivate
789
- * @returns Updated resource with isActive: true
811
+ * @returns Counts by source, facilitator, network, tier and liveness
790
812
  */
791
- reactivate(resourceId: string): Promise<BazaarResource>;
813
+ getStats(): Promise<DiscoveryStats>;
792
814
  /**
793
- * List all resources owned by the authenticated user
794
- *
795
- * Requires API key authentication.
815
+ * Check that the facilitator serving the registry is up.
796
816
  *
797
- * @param options - Pagination options
798
- * @returns Paginated list of owned resources
799
- */
800
- listMyResources(options?: {
801
- page?: number;
802
- limit?: number;
803
- includeInactive?: boolean;
804
- }): Promise<BazaarDiscoverResponse>;
805
- /**
806
- * Get Bazaar API health status
807
- *
808
- * @returns True if the Bazaar API is healthy
817
+ * @returns True when the facilitator answers its health check
809
818
  */
810
819
  healthCheck(): Promise<boolean>;
811
820
  /**
812
- * Get Bazaar statistics
813
- *
814
- * @returns Global statistics about the Bazaar
821
+ * @deprecated Renamed to {@link listResources}, which returns the registry's
822
+ * real `{ items, pagination }` envelope. The old `discover()` returned a
823
+ * `{ resources, page, totalPages }` shape that no endpoint ever served.
815
824
  */
816
- getStats(): Promise<{
817
- totalResources: number;
818
- activeResources: number;
819
- totalProviders: number;
820
- categoryCounts: Record<BazaarCategory, number>;
821
- networkCounts: Record<BazaarNetwork, number>;
822
- }>;
825
+ discover(options?: DiscoveryListOptions): Promise<DiscoveryResponse>;
823
826
  }
827
+ /**
828
+ * @deprecated Use {@link DiscoveryResource}. The old shape (`id`, `name`,
829
+ * `pricePerRequest`, `isActive`, ISO `createdAt`) described an API that was
830
+ * never deployed.
831
+ */
832
+ type BazaarResource = DiscoveryResource;
833
+ /** @deprecated Use {@link DiscoveryResponse}. */
834
+ type BazaarDiscoverResponse = DiscoveryResponse;
835
+ /** @deprecated Use {@link DiscoveryListOptions}. */
836
+ type BazaarDiscoverOptions = DiscoveryListOptions;
837
+ /** @deprecated Use {@link DiscoveryRegisterOptions}. */
838
+ type BazaarRegisterOptions = DiscoveryRegisterOptions;
824
839
  /**
825
840
  * Escrow payment status
826
841
  */
@@ -2171,4 +2186,4 @@ declare class AdvancedEscrowClient {
2171
2186
  private sendViaAdapter;
2172
2187
  }
2173
2188
 
2174
- export { type AdvancedAuthorizationResult, AdvancedEscrowClient, type AdvancedEscrowClientOptions, type AdvancedEscrowContracts, type AdvancedEscrowTaskTier, type AdvancedPaymentInfo, type AdvancedTransactionResult, type AgentId, type AgentIdentity, type AgentRegistration, type AgentRegistrationFile, type AgentService, BASE_MAINNET_CONTRACTS, type BazaarCategory, BazaarClient, type BazaarClientOptions, type BazaarDiscoverOptions, type BazaarDiscoverResponse, type BazaarNetwork, type BazaarRegisterOptions, type BazaarResource, type BazaarToken, type CreateEscrowOptions, DEPOSIT_LIMIT_USDC, type Dispute, type DisputeOutcome, ERC8004_CONTRACTS, ERC8004_EXTENSION_ID, ESCROW_CONTRACTS, ESCROW_TIMEOUT_MS, Erc8004Client, type Erc8004ClientOptions, type Erc8004Network, EscrowClient, type EscrowClientOptions, type EscrowPayment, type EscrowStateResponse, type EscrowStatus, FacilitatorClient, type FacilitatorClientOptions, type FeedbackEntry, type FeedbackParams, type FeedbackRequest, type FeedbackResponse, type HonoMiddlewareOptions, type IdentityByOwnerResponse, type IdentityMetadataResponse, type IdentityTotalSupplyResponse, type MetadataEntryParam, OPERATOR_ABI, OPERATOR_ABI_CREATE3, PAYMENT_INFO_TYPEHASH, type PaymentAcceptance, type PaymentMiddlewareOptions, type PaymentRequirementResolver, type PaymentRequirements, type PaymentRequirementsOptions, type ProofOfPayment, type RefundRequest, type RefundStatus, type RegisterAgentRequest, type RegisterAgentResponse, type ReputationResponse, type ReputationSummary, type RequestRefundOptions, type SettleRequest, type SettleResponse, type SettleResponseWithProof, TIER_TIMINGS, USDC_DOMAIN_NAME, type VerifiedPaymentState, type VerifyRequest, type VerifyResponse, X402_CORS_HEADERS, X402_HEADER_NAMES, ZERO_ADDRESS, buildErc8004PaymentRequirements, buildPaymentRequirements, buildSettleRequest, buildVerifyRequest, canRefundEscrow, canReleaseEscrow, create402Response, createHonoMiddleware, createPaymentMiddleware, escrowTimeRemaining, extractPaymentFromHeaders, getCorsHeaders, getEscrowContractsByChainId, getEscrowSupportedChainIds, isEscrowExpired, isEscrowSupportedOnChain, parsePaymentHeader };
2189
+ export { type AdvancedAuthorizationResult, AdvancedEscrowClient, type AdvancedEscrowClientOptions, type AdvancedEscrowContracts, type AdvancedEscrowTaskTier, type AdvancedPaymentInfo, type AdvancedTransactionResult, type AgentId, type AgentIdentity, type AgentRegistration, type AgentRegistrationFile, type AgentService, BASE_MAINNET_CONTRACTS, BazaarClient, type BazaarClientOptions, type BazaarDiscoverOptions, type BazaarDiscoverResponse, type BazaarRegisterOptions, type BazaarResource, type CreateEscrowOptions, DEPOSIT_LIMIT_USDC, type DiscoveryAccepts, type DiscoveryCuration, type DiscoveryHealth, type DiscoveryHealthStatus, type DiscoveryListOptions, type DiscoveryPagination, type DiscoveryRegisterOptions, type DiscoveryResource, type DiscoveryResponse, type DiscoverySource, type DiscoveryStats, type DiscoveryTier, type Dispute, type DisputeOutcome, ERC8004_CONTRACTS, ERC8004_EXTENSION_ID, ESCROW_CONTRACTS, ESCROW_TIMEOUT_MS, Erc8004Client, type Erc8004ClientOptions, type Erc8004Network, EscrowClient, type EscrowClientOptions, type EscrowPayment, type EscrowStateResponse, type EscrowStatus, FacilitatorClient, type FacilitatorClientOptions, type FeedbackEntry, type FeedbackParams, type FeedbackRequest, type FeedbackResponse, HEALTH_FILTERS, type HonoMiddlewareOptions, type IdentityByOwnerResponse, type IdentityMetadataResponse, type IdentityTotalSupplyResponse, MAX_SEARCH_LEN, type MetadataEntryParam, OPERATOR_ABI, OPERATOR_ABI_CREATE3, PAYMENT_INFO_TYPEHASH, type PaymentAcceptance, type PaymentMiddlewareOptions, type PaymentRequirementResolver, type PaymentRequirements, type PaymentRequirementsOptions, type ProofOfPayment, type RefundRequest, type RefundStatus, type RegisterAgentRequest, type RegisterAgentResponse, type ReputationResponse, type ReputationSummary, type RequestRefundOptions, type SettleRequest, type SettleResponse, type SettleResponseWithProof, TIER_FILTERS, TIER_TIMINGS, USDC_DOMAIN_NAME, type VerifiedPaymentState, type VerifyRequest, type VerifyResponse, X402_CORS_HEADERS, X402_HEADER_NAMES, ZERO_ADDRESS, buildErc8004PaymentRequirements, buildPaymentRequirements, buildSettleRequest, buildVerifyRequest, canRefundEscrow, canReleaseEscrow, create402Response, createHonoMiddleware, createPaymentMiddleware, epochToDate, escrowTimeRemaining, extractPaymentFromHeaders, getCorsHeaders, getEscrowContractsByChainId, getEscrowSupportedChainIds, isAlive, isEscrowExpired, isEscrowSupportedOnChain, parsePaymentHeader };