@openzeppelin/ui-react 3.0.0 → 3.1.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/dist/index.d.cts CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as react0 from "react";
2
- import React, { ReactNode } from "react";
3
- import { BaseComponentProps, Connector, EcosystemRuntime, EcosystemSpecificReactHooks, EcosystemWalletComponents, NativeConfigLoader, NetworkCatalogCapability, NetworkConfig, RuntimeCapability, UiKitConfiguration, WalletCapability } from "@openzeppelin/ui-types";
2
+ import React, { Context, ReactNode } from "react";
3
+ import { BaseComponentProps, Connector, EcosystemRuntime, EcosystemSpecificReactHooks, EcosystemWalletComponents, NameResolutionError, NameResolver, NativeConfigLoader, NetworkCatalogCapability, NetworkConfig, ResolvedAddress, ResolvedName, RuntimeCapability, UiKitConfiguration, WalletCapability } from "@openzeppelin/ui-types";
4
4
  import * as react_jsx_runtime0 from "react/jsx-runtime";
5
+ import { QueryClient } from "@tanstack/react-query";
5
6
 
6
7
  //#region src/version.d.ts
7
8
  declare const VERSION: string;
@@ -36,7 +37,6 @@ interface RuntimeContextValue {
36
37
  declare const RuntimeContext: react0.Context<RuntimeContextValue | null>;
37
38
  //#endregion
38
39
  //#region src/hooks/AdapterProvider.d.ts
39
-
40
40
  interface RuntimeProviderProps {
41
41
  children: ReactNode;
42
42
  /** Function to resolve/create a runtime instance for a given NetworkConfig. */
@@ -406,6 +406,224 @@ declare function useDerivedDisconnect(): DerivedDisconnectStatus;
406
406
  */
407
407
  declare function useWalletReconnectionHandler(selectedNetworkConfigId: string | null, selectedCapability: RuntimeCapability | null, networkToSwitchTo: string | null, onRequeueSwitch: (networkId: string) => void): void;
408
408
  //#endregion
409
+ //#region src/hooks/nameResolution/resolutionState.d.ts
410
+ /**
411
+ * Lifecycle status shared by both resolution hooks. `debouncing` is distinct from
412
+ * `loading` so an input field can show a subtle "typing…" state separate from an
413
+ * in-flight call (the reverse hook omits `debouncing`; see {@link UseResolveAddressResult}).
414
+ */
415
+ type NameResolutionStatus = 'idle' | 'debouncing' | 'loading' | 'resolved' | 'error';
416
+ /**
417
+ * Forward-resolution (`useResolveName`) result. A discriminated union keyed on
418
+ * `status` so illegal field combinations — e.g. holding both `data` and `error`,
419
+ * or reading `.data` without narrowing — are unrepresentable (INV-23). This is the
420
+ * component-boundary shadow of SC-004: an unresolved name can never be read as a
421
+ * resolved address.
422
+ */
423
+ type UseResolveNameResult = {
424
+ readonly status: 'idle';
425
+ } | {
426
+ readonly status: 'debouncing';
427
+ readonly name: string;
428
+ } | {
429
+ readonly status: 'loading';
430
+ readonly name: string;
431
+ } | {
432
+ readonly status: 'resolved';
433
+ readonly name: string;
434
+ readonly data: ResolvedAddress;
435
+ } | {
436
+ readonly status: 'error';
437
+ readonly name: string;
438
+ readonly error: NameResolutionError;
439
+ readonly retry: () => void;
440
+ };
441
+ /**
442
+ * Reverse-resolution (`useResolveAddress`) result. No `debouncing` arm — reverse
443
+ * debounce defaults to 0 (addresses are pasted, not typed). A caller-supplied
444
+ * non-zero `debounceMs` surfaces as `loading` rather than widening this type.
445
+ */
446
+ type UseResolveAddressResult = {
447
+ readonly status: 'idle';
448
+ } | {
449
+ readonly status: 'loading';
450
+ readonly address: string;
451
+ } | {
452
+ readonly status: 'resolved';
453
+ readonly address: string;
454
+ readonly data: ResolvedName;
455
+ } | {
456
+ readonly status: 'error';
457
+ readonly address: string;
458
+ readonly error: NameResolutionError;
459
+ readonly retry: () => void;
460
+ };
461
+ //#endregion
462
+ //#region src/hooks/nameResolution/useResolveName.d.ts
463
+ /** Options for {@link useResolveName}. */
464
+ interface UseResolveNameOptions {
465
+ /** Override the forward debounce window (ms). Default: `config.forwardDebounceMs` (300). */
466
+ readonly debounceMs?: number;
467
+ /** When `false`, the hook stays `idle` and issues no resolution. Default `true`. */
468
+ readonly enabled?: boolean;
469
+ }
470
+ /**
471
+ * Forward-resolve a name to an address. Soft-reads the active runtime from
472
+ * `WalletStateContext` (never throws when no provider is mounted — degrades to
473
+ * idle / UNSUPPORTED_NETWORK) and calls `runtime.nameResolution?.resolveName`.
474
+ * Debounces `name`, caches per (network, name) via the owned QueryClient, and is
475
+ * protected against out-of-order responses (distinct inputs → distinct query keys).
476
+ *
477
+ * Returns a discriminated union keyed on `status`; it never throws for expected
478
+ * failures (they surface in the `error` arm) and never pairs a name with a
479
+ * different name's resolved address (INV-24).
480
+ *
481
+ * @param name - The name to resolve. `null` / empty / a value failing the
482
+ * adapter's `isValidName` yields `status: 'idle'` (never `error`).
483
+ * @param options - `debounceMs` / `enabled` overrides.
484
+ * @returns The current {@link UseResolveNameResult}.
485
+ */
486
+ declare function useResolveName(name: string | null | undefined, options?: UseResolveNameOptions): UseResolveNameResult;
487
+ //#endregion
488
+ //#region src/hooks/nameResolution/useResolveAddress.d.ts
489
+ /** Options for {@link useResolveAddress}. */
490
+ interface UseResolveAddressOptions {
491
+ /** Override the reverse debounce window (ms). Default: `config.reverseDebounceMs` (0). */
492
+ readonly debounceMs?: number;
493
+ /** When `false`, the hook stays `idle` and issues no resolution. Default `true`. */
494
+ readonly enabled?: boolean;
495
+ }
496
+ /**
497
+ * Reverse-resolve an address to a name. Soft-reads the active runtime from
498
+ * `WalletStateContext` (never throws when no provider is mounted — degrades to
499
+ * idle / UNSUPPORTED_NETWORK) and calls `runtime.nameResolution?.resolveAddress`.
500
+ * Caches per (network, address) via the owned QueryClient. Not debounced by
501
+ * default — addresses are pasted, not typed char-by-char.
502
+ *
503
+ * Applies no client-side address-shape check (INV-32): resolution is attempted on
504
+ * any non-empty input and malformed addresses are rejected via the adapter's typed
505
+ * error union. Address-shape validation is SF-3's concern.
506
+ *
507
+ * @param address - The address to reverse-resolve. `null` / empty yields
508
+ * `status: 'idle'`.
509
+ * @param options - `debounceMs` / `enabled` overrides.
510
+ * @returns The current {@link UseResolveAddressResult}.
511
+ */
512
+ declare function useResolveAddress(address: string | null | undefined, options?: UseResolveAddressOptions): UseResolveAddressResult;
513
+ //#endregion
514
+ //#region src/hooks/nameResolution/resolutionConfig.d.ts
515
+ /**
516
+ * Tunable knobs for the resolution hooks, overridable per-app via
517
+ * `NameResolutionProvider`'s `config` prop and merged over {@link DEFAULT_CONFIG}.
518
+ */
519
+ interface ResolutionConfig {
520
+ /** Time a resolved value is considered fresh (no refetch). Maps to react-query `staleTime`. */
521
+ readonly staleTimeMs: number;
522
+ /** Time an unobserved cache entry is retained before GC. Maps to react-query `gcTime`. */
523
+ readonly gcTimeMs: number;
524
+ /** Debounce window (ms) for the forward hook before a settled input becomes the query key. */
525
+ readonly forwardDebounceMs: number;
526
+ /** Debounce window (ms) for the reverse hook. Addresses are pasted/stable, so this defaults to 0. */
527
+ readonly reverseDebounceMs: number;
528
+ /** Max retries for TRANSIENT errors. Definitive negatives are never retried. */
529
+ readonly transientRetryCount: number;
530
+ }
531
+ /**
532
+ * Default resolution config. Values sit within the spec's "seconds-to-minutes"
533
+ * caching guidance; forward debounce is 300ms (typed char-by-char), reverse is 0.
534
+ */
535
+ declare const DEFAULT_CONFIG: ResolutionConfig;
536
+ //#endregion
537
+ //#region src/hooks/nameResolution/NameResolutionProvider.d.ts
538
+ /**
539
+ * Props for {@link NameResolutionProvider}. Mounting the Provider is OPTIONAL —
540
+ * absent it, hooks use the module-singleton client and {@link DEFAULT_CONFIG}
541
+ * (INV-48). Mount it only to override config or share the cache with an existing
542
+ * QueryClient.
543
+ */
544
+ interface NameResolutionProviderProps {
545
+ readonly children: ReactNode;
546
+ /** Partial override of the default config (TTLs, debounce, retry count). Merged per-field. */
547
+ readonly config?: Partial<ResolutionConfig>;
548
+ /**
549
+ * Inject a QueryClient to SHARE the resolution cache with the app / adapter
550
+ * client (unified devtools / persistence). Omit for an isolated owned client.
551
+ */
552
+ readonly queryClient?: QueryClient;
553
+ }
554
+ /**
555
+ * Optional provider that overrides resolution config and/or the QueryClient for
556
+ * its subtree. It does NOT render a `QueryClientProvider`: the client is passed
557
+ * explicitly to `useQuery` (INV-48), so no ambient react-query provider is needed.
558
+ *
559
+ * Config is merged field-by-field over {@link DEFAULT_CONFIG} (INV-30), and the
560
+ * context value is memoized so a Provider re-render does not cascade to every hook
561
+ * (INV-38).
562
+ */
563
+ declare function NameResolutionProvider({
564
+ children,
565
+ config,
566
+ queryClient
567
+ }: NameResolutionProviderProps): ReactNode;
568
+ //#endregion
569
+ //#region src/hooks/nameResolution/NameResolutionContext.d.ts
570
+ /**
571
+ * Value carried by {@link NameResolutionContext}: the owned QueryClient (passed
572
+ * explicitly to `useQuery`, never via an ambient `QueryClientProvider`) and the
573
+ * merged resolution config.
574
+ */
575
+ interface NameResolutionContextValue {
576
+ /** OWNED resolution QueryClient, passed explicitly to `useQuery` (INV-48). */
577
+ readonly queryClient: QueryClient;
578
+ /** Effective config (Provider overrides merged over {@link DEFAULT_CONFIG}). */
579
+ readonly config: ResolutionConfig;
580
+ }
581
+ /**
582
+ * React context for resolution. `null` default triggers the module-singleton
583
+ * fallback in {@link useNameResolutionContext} — no Provider is required (INV-48).
584
+ */
585
+ declare const NameResolutionContext: Context<NameResolutionContextValue | null>;
586
+ /**
587
+ * Read the resolution context, falling back to the zero-wiring default (global
588
+ * singleton client + {@link DEFAULT_CONFIG}) when no `NameResolutionProvider` is
589
+ * mounted (INV-48). Never throws for a missing provider.
590
+ *
591
+ * @returns The active {@link NameResolutionContextValue}.
592
+ */
593
+ declare function useNameResolutionContext(): NameResolutionContextValue;
594
+ //#endregion
595
+ //#region src/hooks/nameResolution/useRuntimeNameResolver.d.ts
596
+ /**
597
+ * Project the active runtime's `NameResolutionCapability` into the injected
598
+ * {@link NameResolver} seam consumed by `@openzeppelin/ui-components` (SF-3, D3).
599
+ * Mounted ambiently by the renderer:
600
+ *
601
+ * ```tsx
602
+ * <NameResolverProvider {...useRuntimeNameResolver()}>{form}</NameResolverProvider>
603
+ * ```
604
+ *
605
+ * Each imperative call is backed by SF-2's **owned** resolution `QueryClient`
606
+ * via `fetchQuery`, reusing SF-2's exact query-key convention
607
+ * (`buildResolutionKey('name', networkId, normalizedName)`) — so a name
608
+ * resolved through the field and the same name resolved by a bare
609
+ * `useResolveName` hit the SAME cache entry: shared cache, dedupe, and
610
+ * out-of-order safety, never a parallel cache (INV-119).
611
+ *
612
+ * Degradation, in order (all method-omission, never a throw):
613
+ * - No `WalletStateProvider` mounted → empty resolver. The context is read
614
+ * directly (not via `useWalletState()`, which throws) so the ambient
615
+ * renderer mount stays safe for wallet-less usage.
616
+ * - No active runtime, or runtime without the capability → empty resolver.
617
+ * - Capability without `resolveName` → `isValidName` only; forward unsupported.
618
+ *
619
+ * When the capability is present but the network itself is unsupported, the
620
+ * adapter's `resolveName` resolves `{ ok: false, error: UNSUPPORTED_NETWORK }`
621
+ * and that result passes through unchanged.
622
+ *
623
+ * @returns A referentially stable {@link NameResolver} for the active runtime.
624
+ */
625
+ declare function useRuntimeNameResolver(): NameResolver;
626
+ //#endregion
409
627
  //#region src/components/WalletConnectionHeader.d.ts
410
628
  /**
411
629
  * Component that renders the wallet connection UI.
@@ -481,5 +699,5 @@ interface NetworkSwitchManagerProps {
481
699
  */
482
700
  declare const NetworkSwitchManager: React.FC<NetworkSwitchManagerProps>;
483
701
  //#endregion
484
- export { AnalyticsContext, type AnalyticsContextValue, AnalyticsProvider, type AnalyticsProviderProps, type DerivedAccountStatus, type DerivedChainInfo, type DerivedConnectStatus, type DerivedDisconnectStatus, type DerivedSwitchChainStatus, NetworkSwitchManager, type NetworkSwitchManagerProps, RuntimeContext, type RuntimeContextValue, RuntimeProvider, type RuntimeProviderProps, type RuntimeRegistry, VERSION, WalletConnectionHeader, WalletConnectionUI, type WalletConnectionUIProps, WalletStateContext, type WalletStateContextValue, WalletStateProvider, type WalletStateProviderProps, useAnalytics, useDerivedAccountStatus, useDerivedChainInfo, useDerivedConnectStatus, useDerivedDisconnect, useDerivedSwitchChainStatus, useRuntimeContext, useWalletComponents, useWalletReconnectionHandler, useWalletState };
702
+ export { AnalyticsContext, type AnalyticsContextValue, AnalyticsProvider, type AnalyticsProviderProps, DEFAULT_CONFIG, type DerivedAccountStatus, type DerivedChainInfo, type DerivedConnectStatus, type DerivedDisconnectStatus, type DerivedSwitchChainStatus, NameResolutionContext, type NameResolutionContextValue, NameResolutionProvider, type NameResolutionProviderProps, type NameResolutionStatus, NetworkSwitchManager, type NetworkSwitchManagerProps, type ResolutionConfig, RuntimeContext, type RuntimeContextValue, RuntimeProvider, type RuntimeProviderProps, type RuntimeRegistry, type UseResolveAddressOptions, type UseResolveAddressResult, type UseResolveNameOptions, type UseResolveNameResult, VERSION, WalletConnectionHeader, WalletConnectionUI, type WalletConnectionUIProps, WalletStateContext, type WalletStateContextValue, WalletStateProvider, type WalletStateProviderProps, useAnalytics, useDerivedAccountStatus, useDerivedChainInfo, useDerivedConnectStatus, useDerivedDisconnect, useDerivedSwitchChainStatus, useNameResolutionContext, useResolveAddress, useResolveName, useRuntimeContext, useRuntimeNameResolver, useWalletComponents, useWalletReconnectionHandler, useWalletState };
485
703
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/version.ts","../src/hooks/AdapterContext.tsx","../src/hooks/AdapterProvider.tsx","../src/hooks/WalletStateContext.ts","../src/hooks/WalletStateProvider.tsx","../src/hooks/AnalyticsContext.tsx","../src/hooks/AnalyticsProvider.tsx","../src/hooks/useAnalytics.ts","../src/hooks/useAdapterContext.ts","../src/hooks/useWalletComponents.ts","../src/hooks/useDerivedAccountStatus.ts","../src/hooks/useDerivedSwitchChainStatus.ts","../src/hooks/useDerivedChainInfo.ts","../src/hooks/useDerivedConnectStatus.ts","../src/hooks/useDerivedDisconnect.ts","../src/hooks/useWalletReconnectionHandler.ts","../src/components/WalletConnectionHeader.tsx","../src/components/WalletConnectionUI.tsx","../src/components/NetworkSwitchManager.tsx"],"sourcesContent":[],"mappings":";;;;;;cACa;;;;;;UCiBI,eAAA;uBACM;ADlBvB;;;;ACiBA;AASA;AAgBa,UAhBI,mBAAA,CAgBU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;;gBAEiB;;EbRrB;caUC;;;EZOG;EASA,KAAA,EYZR,KZYQ,GAAA,IAAA;EAgBJ;qBY1BQ;;;AXKrB;;;;AAGoD,iBWQpC,uBAAA,CAAA,CXRoC,EWQT,oBXRS;;;UYrBnC,uBAAA;;4BAEW;;;;EdLf,KAAA,EcSJ,KdTyC,GAAA,IAAA;;;;ACiBlD;AASA;AAgBA;iBanBgB,oBAAA,CAAA,GAAwB;;;;;;;;AdvBxC;;;;ACiBA;AASA;AAgBA;iBcxBgB,4BAAA,6DAEM;;;;;;;cCZT,wBAAwB,KAAA,CAAM;;;;;;UCE1B,uBAAA;EjBVJ;;;uBiBcU;EhBGN;EASA,mBAAA,CAAA,EgBVO,kBhBWgB;EAe3B;yBgBxBY;;;AfGzB;;;;;;AAgBA;;;;;;;;;AC7BA;;;;;;AAagD,ccsBnC,kBdtBmC,EcsBf,KAAA,CAAM,EdtBS,CcsBN,uBdtBM,CAAA;;;;;;UeX/B,yBAAA;ElBVJ;UkBYH;;kBAEQ;EjBGD;EASA,eAAA,EAAA,MAAmB;EAgBvB;;;;ACrBb;;;;;;AAgBA;;;;;;;cgBFa,sBAAsB,KAAA,CAAM,GAAG"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/version.ts","../src/hooks/AdapterContext.tsx","../src/hooks/AdapterProvider.tsx","../src/hooks/WalletStateContext.ts","../src/hooks/WalletStateProvider.tsx","../src/hooks/AnalyticsContext.tsx","../src/hooks/AnalyticsProvider.tsx","../src/hooks/useAnalytics.ts","../src/hooks/useAdapterContext.ts","../src/hooks/useWalletComponents.ts","../src/hooks/useDerivedAccountStatus.ts","../src/hooks/useDerivedSwitchChainStatus.ts","../src/hooks/useDerivedChainInfo.ts","../src/hooks/useDerivedConnectStatus.ts","../src/hooks/useDerivedDisconnect.ts","../src/hooks/useWalletReconnectionHandler.ts","../src/hooks/nameResolution/resolutionState.ts","../src/hooks/nameResolution/useResolveName.ts","../src/hooks/nameResolution/useResolveAddress.ts","../src/hooks/nameResolution/resolutionConfig.ts","../src/hooks/nameResolution/NameResolutionProvider.tsx","../src/hooks/nameResolution/NameResolutionContext.ts","../src/hooks/nameResolution/useRuntimeNameResolver.ts","../src/components/WalletConnectionHeader.tsx","../src/components/WalletConnectionUI.tsx","../src/components/NetworkSwitchManager.tsx"],"sourcesContent":[],"mappings":";;;;;;;cACa;;;;;;UCiBI,eAAA;uBACM;;ADlBvB;;;;ACiBA;AASiB,UAAA,mBAAA,CACuB;EAe3B,oBAAgE,EAAA,CAAA,aAAlD,EAfa,aAeb,GAAA,IAAA,EAAA,GAAA;aAdd;;;ECPI;;;;EAGmC,cAAA,EAAA,CAAA,SAAA,EAAA,MAAA,EAAA,GAAA,IAAA;;AAapD;;;;AAAkF,cDKrE,cCLqE,EDKvD,MAAA,CAAA,OCLuD,CDKvD,mBCLuD,GAAA,IAAA,CAAA;;;AAhBjE,UAAA,oBAAA,CAAoB;EACzB,QAAA,EAAA,SAAA;EAEsB;EAA0B,cAAA,EAAA,CAAA,aAAA,EAA1B,aAA0B,EAAA,GAAR,OAAQ,CAAA,gBAAA,CAAA;;;AAa5D;;;;;;;;;AC7BiB,iBD6BD,eAAA,CC7BwB;EAAA,QAAA;EAAA;AAAA,CAAA,ED6BsB,oBC7BtB,CAAA,ED6B0C,kBAAA,CAAA,GAAA,CAAA,OC7B1C;;;UAAvB,uBAAA;;;uBAIM;iBAGN;EHfJ,gBAAqC,EAAA,OAAA;qBGoB7B;yCACoB,QAAQ;;AFJhC,cEgFJ,kBF/EU,EE+EQ,KAAA,CAAA,OF/EQ,CE+ER,uBF/EQ,GAAA,SAAA,CAAA;AAQvC;AAgBA;;;iBE6DgB,cAAA,CAAA,GAAkB;;;UCpFjB,wBAAA;YACL;;;;EJpBC,oBAAqC,EAAA,CAAA,SAAA,EAAA,MAAA,EAAA,GI0B3C,OJ1B2C,CI0BnC,aJ1BmC,GAAA,IAAA,GAAA,SAAA,CAAA,GI0BC,aJ1BD,GAAA,IAAA,GAAA,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,WlBFY;;;;;;AAgBrC;;;;;AAAkF,iBkBFlE,sBAAA,ClBEkE;EAAA,QAAA;EAAA,MAAA;EAAA;AAAA,CAAA,EkBE/E,2BlBF+E,CAAA,EkBEjD,SlBFiD;;;;;;;AFrClF;UqBaiB,0BAAA;;wBAEO;EpBEP;EASA,SAAA,MAAA,EoBTE,gBpBUqB;AAexC;;;;ACrBA;AACY,cmBqBC,qBnBrBD,EmBqBsB,OnBrBtB,CmBqBsB,0BnBrBtB,GAAA,IAAA,CAAA;;;;;AAeZ;;;AAA8D,iBmBgC9C,wBAAA,CAAA,CnBhC8C,EmBgClB,0BnBhCkB;;;;;;;;;AFrC9D;;;;ACiBA;AASA;AAgBA;;;;ACrBA;;;;;;AAgBA;;;;;;;iBoBOgB,sBAAA,CAAA,GAA0B;;;;;;;cCpC7B,wBAAwB,KAAA,CAAM;;;;;;UCE1B,uBAAA;;ExBVJ,SAAA,CAAqC,EAAA,MAAA;;uBwBc3B;;EvBGN,mBAAe,CAAA,EuBDR,kBvBED;EAQN;EAgBJ,oBAAgE,CAAA,EuBxBpD,kBvBwBE;;;;ACrB3B;;;;;;AAgBA;;;;;;;;;AC7BA;;;;;AAayC,cqBsB5B,kBrBtB4B,EqBsBR,KAAA,CAAM,ErBtBE,CqBsBC,uBrBtBD,CAAA;;;;;;UsBXxB,yBAAA;;EzBVJ,MAAA,EyBYH,gBzBZwC;;kByBchC;;ExBGD,eAAA,EAAA,MAAe;EASf;EAgBJ,uBAAgE,CAAA,EAAA,GAAlD,GAAA,IAAA;;;;ACrB3B;;;;;;AAgBA;;;;;;cuBFa,sBAAsB,KAAA,CAAM,GAAG"}
package/dist/index.d.mts CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as react0 from "react";
2
- import React, { ReactNode } from "react";
2
+ import React, { Context, ReactNode } from "react";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
- import { BaseComponentProps, Connector, EcosystemRuntime, EcosystemSpecificReactHooks, EcosystemWalletComponents, NativeConfigLoader, NetworkCatalogCapability, NetworkConfig, RuntimeCapability, UiKitConfiguration, WalletCapability } from "@openzeppelin/ui-types";
4
+ import { QueryClient } from "@tanstack/react-query";
5
+ import { BaseComponentProps, Connector, EcosystemRuntime, EcosystemSpecificReactHooks, EcosystemWalletComponents, NameResolutionError, NameResolver, NativeConfigLoader, NetworkCatalogCapability, NetworkConfig, ResolvedAddress, ResolvedName, RuntimeCapability, UiKitConfiguration, WalletCapability } from "@openzeppelin/ui-types";
5
6
 
6
7
  //#region src/version.d.ts
7
8
  declare const VERSION: string;
@@ -36,7 +37,6 @@ interface RuntimeContextValue {
36
37
  declare const RuntimeContext: react0.Context<RuntimeContextValue | null>;
37
38
  //#endregion
38
39
  //#region src/hooks/AdapterProvider.d.ts
39
-
40
40
  interface RuntimeProviderProps {
41
41
  children: ReactNode;
42
42
  /** Function to resolve/create a runtime instance for a given NetworkConfig. */
@@ -406,6 +406,224 @@ declare function useDerivedDisconnect(): DerivedDisconnectStatus;
406
406
  */
407
407
  declare function useWalletReconnectionHandler(selectedNetworkConfigId: string | null, selectedCapability: RuntimeCapability | null, networkToSwitchTo: string | null, onRequeueSwitch: (networkId: string) => void): void;
408
408
  //#endregion
409
+ //#region src/hooks/nameResolution/resolutionState.d.ts
410
+ /**
411
+ * Lifecycle status shared by both resolution hooks. `debouncing` is distinct from
412
+ * `loading` so an input field can show a subtle "typing…" state separate from an
413
+ * in-flight call (the reverse hook omits `debouncing`; see {@link UseResolveAddressResult}).
414
+ */
415
+ type NameResolutionStatus = 'idle' | 'debouncing' | 'loading' | 'resolved' | 'error';
416
+ /**
417
+ * Forward-resolution (`useResolveName`) result. A discriminated union keyed on
418
+ * `status` so illegal field combinations — e.g. holding both `data` and `error`,
419
+ * or reading `.data` without narrowing — are unrepresentable (INV-23). This is the
420
+ * component-boundary shadow of SC-004: an unresolved name can never be read as a
421
+ * resolved address.
422
+ */
423
+ type UseResolveNameResult = {
424
+ readonly status: 'idle';
425
+ } | {
426
+ readonly status: 'debouncing';
427
+ readonly name: string;
428
+ } | {
429
+ readonly status: 'loading';
430
+ readonly name: string;
431
+ } | {
432
+ readonly status: 'resolved';
433
+ readonly name: string;
434
+ readonly data: ResolvedAddress;
435
+ } | {
436
+ readonly status: 'error';
437
+ readonly name: string;
438
+ readonly error: NameResolutionError;
439
+ readonly retry: () => void;
440
+ };
441
+ /**
442
+ * Reverse-resolution (`useResolveAddress`) result. No `debouncing` arm — reverse
443
+ * debounce defaults to 0 (addresses are pasted, not typed). A caller-supplied
444
+ * non-zero `debounceMs` surfaces as `loading` rather than widening this type.
445
+ */
446
+ type UseResolveAddressResult = {
447
+ readonly status: 'idle';
448
+ } | {
449
+ readonly status: 'loading';
450
+ readonly address: string;
451
+ } | {
452
+ readonly status: 'resolved';
453
+ readonly address: string;
454
+ readonly data: ResolvedName;
455
+ } | {
456
+ readonly status: 'error';
457
+ readonly address: string;
458
+ readonly error: NameResolutionError;
459
+ readonly retry: () => void;
460
+ };
461
+ //#endregion
462
+ //#region src/hooks/nameResolution/useResolveName.d.ts
463
+ /** Options for {@link useResolveName}. */
464
+ interface UseResolveNameOptions {
465
+ /** Override the forward debounce window (ms). Default: `config.forwardDebounceMs` (300). */
466
+ readonly debounceMs?: number;
467
+ /** When `false`, the hook stays `idle` and issues no resolution. Default `true`. */
468
+ readonly enabled?: boolean;
469
+ }
470
+ /**
471
+ * Forward-resolve a name to an address. Soft-reads the active runtime from
472
+ * `WalletStateContext` (never throws when no provider is mounted — degrades to
473
+ * idle / UNSUPPORTED_NETWORK) and calls `runtime.nameResolution?.resolveName`.
474
+ * Debounces `name`, caches per (network, name) via the owned QueryClient, and is
475
+ * protected against out-of-order responses (distinct inputs → distinct query keys).
476
+ *
477
+ * Returns a discriminated union keyed on `status`; it never throws for expected
478
+ * failures (they surface in the `error` arm) and never pairs a name with a
479
+ * different name's resolved address (INV-24).
480
+ *
481
+ * @param name - The name to resolve. `null` / empty / a value failing the
482
+ * adapter's `isValidName` yields `status: 'idle'` (never `error`).
483
+ * @param options - `debounceMs` / `enabled` overrides.
484
+ * @returns The current {@link UseResolveNameResult}.
485
+ */
486
+ declare function useResolveName(name: string | null | undefined, options?: UseResolveNameOptions): UseResolveNameResult;
487
+ //#endregion
488
+ //#region src/hooks/nameResolution/useResolveAddress.d.ts
489
+ /** Options for {@link useResolveAddress}. */
490
+ interface UseResolveAddressOptions {
491
+ /** Override the reverse debounce window (ms). Default: `config.reverseDebounceMs` (0). */
492
+ readonly debounceMs?: number;
493
+ /** When `false`, the hook stays `idle` and issues no resolution. Default `true`. */
494
+ readonly enabled?: boolean;
495
+ }
496
+ /**
497
+ * Reverse-resolve an address to a name. Soft-reads the active runtime from
498
+ * `WalletStateContext` (never throws when no provider is mounted — degrades to
499
+ * idle / UNSUPPORTED_NETWORK) and calls `runtime.nameResolution?.resolveAddress`.
500
+ * Caches per (network, address) via the owned QueryClient. Not debounced by
501
+ * default — addresses are pasted, not typed char-by-char.
502
+ *
503
+ * Applies no client-side address-shape check (INV-32): resolution is attempted on
504
+ * any non-empty input and malformed addresses are rejected via the adapter's typed
505
+ * error union. Address-shape validation is SF-3's concern.
506
+ *
507
+ * @param address - The address to reverse-resolve. `null` / empty yields
508
+ * `status: 'idle'`.
509
+ * @param options - `debounceMs` / `enabled` overrides.
510
+ * @returns The current {@link UseResolveAddressResult}.
511
+ */
512
+ declare function useResolveAddress(address: string | null | undefined, options?: UseResolveAddressOptions): UseResolveAddressResult;
513
+ //#endregion
514
+ //#region src/hooks/nameResolution/resolutionConfig.d.ts
515
+ /**
516
+ * Tunable knobs for the resolution hooks, overridable per-app via
517
+ * `NameResolutionProvider`'s `config` prop and merged over {@link DEFAULT_CONFIG}.
518
+ */
519
+ interface ResolutionConfig {
520
+ /** Time a resolved value is considered fresh (no refetch). Maps to react-query `staleTime`. */
521
+ readonly staleTimeMs: number;
522
+ /** Time an unobserved cache entry is retained before GC. Maps to react-query `gcTime`. */
523
+ readonly gcTimeMs: number;
524
+ /** Debounce window (ms) for the forward hook before a settled input becomes the query key. */
525
+ readonly forwardDebounceMs: number;
526
+ /** Debounce window (ms) for the reverse hook. Addresses are pasted/stable, so this defaults to 0. */
527
+ readonly reverseDebounceMs: number;
528
+ /** Max retries for TRANSIENT errors. Definitive negatives are never retried. */
529
+ readonly transientRetryCount: number;
530
+ }
531
+ /**
532
+ * Default resolution config. Values sit within the spec's "seconds-to-minutes"
533
+ * caching guidance; forward debounce is 300ms (typed char-by-char), reverse is 0.
534
+ */
535
+ declare const DEFAULT_CONFIG: ResolutionConfig;
536
+ //#endregion
537
+ //#region src/hooks/nameResolution/NameResolutionProvider.d.ts
538
+ /**
539
+ * Props for {@link NameResolutionProvider}. Mounting the Provider is OPTIONAL —
540
+ * absent it, hooks use the module-singleton client and {@link DEFAULT_CONFIG}
541
+ * (INV-48). Mount it only to override config or share the cache with an existing
542
+ * QueryClient.
543
+ */
544
+ interface NameResolutionProviderProps {
545
+ readonly children: ReactNode;
546
+ /** Partial override of the default config (TTLs, debounce, retry count). Merged per-field. */
547
+ readonly config?: Partial<ResolutionConfig>;
548
+ /**
549
+ * Inject a QueryClient to SHARE the resolution cache with the app / adapter
550
+ * client (unified devtools / persistence). Omit for an isolated owned client.
551
+ */
552
+ readonly queryClient?: QueryClient;
553
+ }
554
+ /**
555
+ * Optional provider that overrides resolution config and/or the QueryClient for
556
+ * its subtree. It does NOT render a `QueryClientProvider`: the client is passed
557
+ * explicitly to `useQuery` (INV-48), so no ambient react-query provider is needed.
558
+ *
559
+ * Config is merged field-by-field over {@link DEFAULT_CONFIG} (INV-30), and the
560
+ * context value is memoized so a Provider re-render does not cascade to every hook
561
+ * (INV-38).
562
+ */
563
+ declare function NameResolutionProvider({
564
+ children,
565
+ config,
566
+ queryClient
567
+ }: NameResolutionProviderProps): ReactNode;
568
+ //#endregion
569
+ //#region src/hooks/nameResolution/NameResolutionContext.d.ts
570
+ /**
571
+ * Value carried by {@link NameResolutionContext}: the owned QueryClient (passed
572
+ * explicitly to `useQuery`, never via an ambient `QueryClientProvider`) and the
573
+ * merged resolution config.
574
+ */
575
+ interface NameResolutionContextValue {
576
+ /** OWNED resolution QueryClient, passed explicitly to `useQuery` (INV-48). */
577
+ readonly queryClient: QueryClient;
578
+ /** Effective config (Provider overrides merged over {@link DEFAULT_CONFIG}). */
579
+ readonly config: ResolutionConfig;
580
+ }
581
+ /**
582
+ * React context for resolution. `null` default triggers the module-singleton
583
+ * fallback in {@link useNameResolutionContext} — no Provider is required (INV-48).
584
+ */
585
+ declare const NameResolutionContext: Context<NameResolutionContextValue | null>;
586
+ /**
587
+ * Read the resolution context, falling back to the zero-wiring default (global
588
+ * singleton client + {@link DEFAULT_CONFIG}) when no `NameResolutionProvider` is
589
+ * mounted (INV-48). Never throws for a missing provider.
590
+ *
591
+ * @returns The active {@link NameResolutionContextValue}.
592
+ */
593
+ declare function useNameResolutionContext(): NameResolutionContextValue;
594
+ //#endregion
595
+ //#region src/hooks/nameResolution/useRuntimeNameResolver.d.ts
596
+ /**
597
+ * Project the active runtime's `NameResolutionCapability` into the injected
598
+ * {@link NameResolver} seam consumed by `@openzeppelin/ui-components` (SF-3, D3).
599
+ * Mounted ambiently by the renderer:
600
+ *
601
+ * ```tsx
602
+ * <NameResolverProvider {...useRuntimeNameResolver()}>{form}</NameResolverProvider>
603
+ * ```
604
+ *
605
+ * Each imperative call is backed by SF-2's **owned** resolution `QueryClient`
606
+ * via `fetchQuery`, reusing SF-2's exact query-key convention
607
+ * (`buildResolutionKey('name', networkId, normalizedName)`) — so a name
608
+ * resolved through the field and the same name resolved by a bare
609
+ * `useResolveName` hit the SAME cache entry: shared cache, dedupe, and
610
+ * out-of-order safety, never a parallel cache (INV-119).
611
+ *
612
+ * Degradation, in order (all method-omission, never a throw):
613
+ * - No `WalletStateProvider` mounted → empty resolver. The context is read
614
+ * directly (not via `useWalletState()`, which throws) so the ambient
615
+ * renderer mount stays safe for wallet-less usage.
616
+ * - No active runtime, or runtime without the capability → empty resolver.
617
+ * - Capability without `resolveName` → `isValidName` only; forward unsupported.
618
+ *
619
+ * When the capability is present but the network itself is unsupported, the
620
+ * adapter's `resolveName` resolves `{ ok: false, error: UNSUPPORTED_NETWORK }`
621
+ * and that result passes through unchanged.
622
+ *
623
+ * @returns A referentially stable {@link NameResolver} for the active runtime.
624
+ */
625
+ declare function useRuntimeNameResolver(): NameResolver;
626
+ //#endregion
409
627
  //#region src/components/WalletConnectionHeader.d.ts
410
628
  /**
411
629
  * Component that renders the wallet connection UI.
@@ -481,5 +699,5 @@ interface NetworkSwitchManagerProps {
481
699
  */
482
700
  declare const NetworkSwitchManager: React.FC<NetworkSwitchManagerProps>;
483
701
  //#endregion
484
- export { AnalyticsContext, type AnalyticsContextValue, AnalyticsProvider, type AnalyticsProviderProps, type DerivedAccountStatus, type DerivedChainInfo, type DerivedConnectStatus, type DerivedDisconnectStatus, type DerivedSwitchChainStatus, NetworkSwitchManager, type NetworkSwitchManagerProps, RuntimeContext, type RuntimeContextValue, RuntimeProvider, type RuntimeProviderProps, type RuntimeRegistry, VERSION, WalletConnectionHeader, WalletConnectionUI, type WalletConnectionUIProps, WalletStateContext, type WalletStateContextValue, WalletStateProvider, type WalletStateProviderProps, useAnalytics, useDerivedAccountStatus, useDerivedChainInfo, useDerivedConnectStatus, useDerivedDisconnect, useDerivedSwitchChainStatus, useRuntimeContext, useWalletComponents, useWalletReconnectionHandler, useWalletState };
702
+ export { AnalyticsContext, type AnalyticsContextValue, AnalyticsProvider, type AnalyticsProviderProps, DEFAULT_CONFIG, type DerivedAccountStatus, type DerivedChainInfo, type DerivedConnectStatus, type DerivedDisconnectStatus, type DerivedSwitchChainStatus, NameResolutionContext, type NameResolutionContextValue, NameResolutionProvider, type NameResolutionProviderProps, type NameResolutionStatus, NetworkSwitchManager, type NetworkSwitchManagerProps, type ResolutionConfig, RuntimeContext, type RuntimeContextValue, RuntimeProvider, type RuntimeProviderProps, type RuntimeRegistry, type UseResolveAddressOptions, type UseResolveAddressResult, type UseResolveNameOptions, type UseResolveNameResult, VERSION, WalletConnectionHeader, WalletConnectionUI, type WalletConnectionUIProps, WalletStateContext, type WalletStateContextValue, WalletStateProvider, type WalletStateProviderProps, useAnalytics, useDerivedAccountStatus, useDerivedChainInfo, useDerivedConnectStatus, useDerivedDisconnect, useDerivedSwitchChainStatus, useNameResolutionContext, useResolveAddress, useResolveName, useRuntimeContext, useRuntimeNameResolver, useWalletComponents, useWalletReconnectionHandler, useWalletState };
485
703
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/version.ts","../src/hooks/AdapterContext.tsx","../src/hooks/AdapterProvider.tsx","../src/hooks/WalletStateContext.ts","../src/hooks/WalletStateProvider.tsx","../src/hooks/AnalyticsContext.tsx","../src/hooks/AnalyticsProvider.tsx","../src/hooks/useAnalytics.ts","../src/hooks/useAdapterContext.ts","../src/hooks/useWalletComponents.ts","../src/hooks/useDerivedAccountStatus.ts","../src/hooks/useDerivedSwitchChainStatus.ts","../src/hooks/useDerivedChainInfo.ts","../src/hooks/useDerivedConnectStatus.ts","../src/hooks/useDerivedDisconnect.ts","../src/hooks/useWalletReconnectionHandler.ts","../src/components/WalletConnectionHeader.tsx","../src/components/WalletConnectionUI.tsx","../src/components/NetworkSwitchManager.tsx"],"sourcesContent":[],"mappings":";;;;;;cACa;;;;;;UCiBI,eAAA;uBACM;ADlBvB;;;;ACiBA;AASA;AAgBa,UAhBI,mBAAA,CAgBU;wCAfa;aAC3B;;ECPI,CAAA;EACL;;;;EAE+C,cAAA,EAAA,CAAA,SAAA,EAAA,MAAA,EAAA,GAAA,IAAA;AAa3D;;;;;AAAkF,cDKrE,cCLqE,EDKvD,MAAA,CAAA,OCLuD,CDKvD,mBCLuD,GAAA,IAAA,CAAA;;;;AAftE,UADK,oBAAA,CACL;EAEsB,QAAA,EAFtB,SAEsB;EAA0B;EAAR,cAAA,EAAA,CAAA,aAAA,EAAlB,aAAkB,EAAA,GAAA,OAAA,CAAQ,gBAA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DAEM;;;;;;;cCZT,wBAAwB,KAAA,CAAM;;;;;;UCE1B,uBAAA;EjBVJ;;;uBiBcU;EhBGN;EASA,mBAAA,CAAA,EgBVO,kBhBWgB;EAe3B;yBgBxBY;;;AfGzB;;;;;;AAgBA;;;;;;;;;AC7BA;;;;;;AAagD,ccsBnC,kBdtBmC,EcsBf,KAAA,CAAM,EdtBS,CcsBN,uBdtBM,CAAA;;;;;;UeX/B,yBAAA;ElBVJ;UkBYH;;kBAEQ;EjBGD;EASA,eAAA,EAAA,MAAmB;EAgBvB;;;;ACrBb;;;;;;AAgBA;;;;;;;cgBFa,sBAAsB,KAAA,CAAM,GAAG"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/version.ts","../src/hooks/AdapterContext.tsx","../src/hooks/AdapterProvider.tsx","../src/hooks/WalletStateContext.ts","../src/hooks/WalletStateProvider.tsx","../src/hooks/AnalyticsContext.tsx","../src/hooks/AnalyticsProvider.tsx","../src/hooks/useAnalytics.ts","../src/hooks/useAdapterContext.ts","../src/hooks/useWalletComponents.ts","../src/hooks/useDerivedAccountStatus.ts","../src/hooks/useDerivedSwitchChainStatus.ts","../src/hooks/useDerivedChainInfo.ts","../src/hooks/useDerivedConnectStatus.ts","../src/hooks/useDerivedDisconnect.ts","../src/hooks/useWalletReconnectionHandler.ts","../src/hooks/nameResolution/resolutionState.ts","../src/hooks/nameResolution/useResolveName.ts","../src/hooks/nameResolution/useResolveAddress.ts","../src/hooks/nameResolution/resolutionConfig.ts","../src/hooks/nameResolution/NameResolutionProvider.tsx","../src/hooks/nameResolution/NameResolutionContext.ts","../src/hooks/nameResolution/useRuntimeNameResolver.ts","../src/components/WalletConnectionHeader.tsx","../src/components/WalletConnectionUI.tsx","../src/components/NetworkSwitchManager.tsx"],"sourcesContent":[],"mappings":";;;;;;;cACa;;;;;;UCiBI,eAAA;uBACM;;ADlBvB;;;;ACiBA;AASiB,UAAA,mBAAA,CACuB;EAe3B,oBAAgE,EAAA,CAAA,aAA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