@thenamespace/ens-components 0.34.0 → 0.36.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.js CHANGED
@@ -57288,25 +57288,19 @@ const LIST_MANAGER_API = "https://list-manager.namespace.ninja";
57288
57288
  const LIST_MANAGER_TESTNET_API = "https://staging.list-manager.namespace.ninja";
57289
57289
  const useMintManager = ({ isTestnet }) => {
57290
57290
  const mintClient = useMemo(() => {
57291
+ console.info(`Creating a mint clinet, testnet: ${isTestnet}`);
57291
57292
  return distExports$1.createMintClient({
57292
57293
  cursomRpcUrls: {},
57293
57294
  isTestnet: isTestnet || false
57294
57295
  });
57295
57296
  }, [isTestnet]);
57296
- const getListManagerApi = useCallback(() => {
57297
- return isTestnet ? LIST_MANAGER_TESTNET_API : LIST_MANAGER_API;
57298
- }, [isTestnet]);
57299
- const getListingNetwork = useCallback(() => {
57300
- return isTestnet ? ListingNetwork.Sepolia : ListingNetwork.Mainnet;
57301
- }, [isTestnet]);
57302
- const getListingDetails = useCallback(
57303
- async (name) => {
57304
- return fetch(
57305
- `${getListManagerApi()}/api/v1/listing/network/${getListingNetwork()}/name/${name}`
57306
- ).then((res) => res.json());
57307
- },
57308
- [getListManagerApi, getListingNetwork]
57309
- );
57297
+ const getListingDetails = async (name) => {
57298
+ const listManagerApi = isTestnet ? LIST_MANAGER_TESTNET_API : LIST_MANAGER_API;
57299
+ const listingNetwork = isTestnet ? ListingNetwork.Sepolia : ListingNetwork.Mainnet;
57300
+ return fetch(
57301
+ `${listManagerApi}/api/v1/listing/network/${listingNetwork}/name/${name}`
57302
+ ).then((res) => res.json());
57303
+ };
57310
57304
  return {
57311
57305
  mintClient,
57312
57306
  getListingDetails
@@ -61702,7 +61696,7 @@ const MIN_ENS_LEN$1 = 1;
61702
61696
  const SubnameMintForm = ({
61703
61697
  parentName,
61704
61698
  label,
61705
- isTestnet = false,
61699
+ isTestnet,
61706
61700
  onCancel,
61707
61701
  onSuccess,
61708
61702
  onSubnameMinted,
@@ -61734,7 +61728,8 @@ const SubnameMintForm = ({
61734
61728
  isChecking: false,
61735
61729
  isListingValid: false,
61736
61730
  listingChainId: 0,
61737
- isL2: false
61731
+ isL2: false,
61732
+ error: e?.message || "Failed to load listing details. Please try again later."
61738
61733
  });
61739
61734
  });
61740
61735
  }, [getListingDetails, parentName]);
@@ -61751,6 +61746,9 @@ const SubnameMintForm = ({
61751
61746
  }
61752
61747
  ) });
61753
61748
  }
61749
+ if (initState.error) {
61750
+ return /* @__PURE__ */ jsx("div", { className: "ns-subname-mint-form", children: /* @__PURE__ */ jsx(Alert, { variant: "error", position: "vertical", children: /* @__PURE__ */ jsx(Text$1, { size: "sm", children: initState.error }) }) });
61751
+ }
61754
61752
  if (!initState.isListingValid) {
61755
61753
  return /* @__PURE__ */ jsx("div", { className: "ns-subname-mint-form", children: /* @__PURE__ */ jsx(Alert, { variant: "error", position: "vertical", children: /* @__PURE__ */ jsxs(Text$1, { size: "sm", children: [
61756
61754
  "ENS name ",
@@ -61769,7 +61767,8 @@ const SubnameMintForm = ({
61769
61767
  isExpirable: initState.isExpirable || false,
61770
61768
  onCancel,
61771
61769
  onSuccess,
61772
- onSubnameMinted
61770
+ onSubnameMinted,
61771
+ txConfirmations
61773
61772
  }
61774
61773
  ) });
61775
61774
  };