@thenamespace/ens-components 0.29.0 → 0.31.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.ts CHANGED
@@ -193,9 +193,10 @@ interface OffchainSubnameFormProps {
193
193
  label?: string;
194
194
  hideTitle?: boolean;
195
195
  onCancel?: () => void;
196
+ isTestnet?: boolean;
196
197
  onSuccess?: (data: OffchainSubnameCreatedData) => void;
197
198
  }
198
- declare const OffchainSubnameForm: ({ apiKeyOrToken, name, label: propLabel, hideTitle, onCancel, onSuccess, }: OffchainSubnameFormProps) => react_jsx_runtime.JSX.Element;
199
+ declare const OffchainSubnameForm: ({ apiKeyOrToken, name, label: propLabel, hideTitle, isTestnet, onCancel, onSuccess, }: OffchainSubnameFormProps) => react_jsx_runtime.JSX.Element;
199
200
 
200
201
  type ButtonVariant = "solid" | "outline" | "ghost" | "destructive";
201
202
  type ButtonSize = "sm" | "md" | "lg";
@@ -1282,7 +1283,7 @@ interface OffchainClient {
1282
1283
  getDataRecord(fullSubname: string, key: string): Promise<GetRecordResponse>;
1283
1284
  }
1284
1285
 
1285
- declare const useOffchainManager: (name: string, apiKeyOrToken: string) => OffchainClient;
1286
+ declare const useOffchainManager: (name: string, apiKeyOrToken: string, isTestnet?: boolean) => OffchainClient;
1286
1287
 
1287
1288
  export { Accordion, Alert, Button, Card, ChainIcon, ConnectAndSetChain, ContenthashIcon, ContenthashProtocol, ContractErrorLabel, Dropdown, ENS_RESOLVER_ABI, EnsNameRegistrationForm, EnsRecordsForm, Icon, Input, ListingNetwork, ListingType, MULTICALL, Modal, OffchainSubnameForm, PricingDisplay, ProfileHeader, ProgressBar, SET_ADDRESS_FUNC, SET_CONTENTHASH_FUNC, SET_TEXT_FUNC, SelectRecordsForm, ShurikenSpinner, SubnameMintForm, Text, TextRecordCategory, Textarea, ThemeProvider, Tooltip, TxProgress, WalletConnectProvider, capitalize, convertEVMChainIdToCoinType, convertToMulticallResolverData, convertToResolverData, createEnsReferer, debounce, deepCopy, diffToEnsRecords, ensureFloatInput, equalsIgnoreCase, formatFloat, getBlockExplorer, getBlockExplorerAddressUrl, getBlockExplorerName, getBlockExplorerTransactionUrl, getChainIdForListingNetwork, getEnsAppUrl, getEnsRecordsDiff, getSupportedAddressByChainId, getSupportedAddressByCoin, getSupportedAddressByName, getSupportedAddressMap, getSupportedChashByProtocol, getSupportedText, isCommitmentToNewErr, isContenthashValid, isUserDeniedError, supportedAddresses, supportedContenthashRecords, supportedTexts, useENSResolver, useMintManager, useMintSubname, useOffchainManager, useRegisterENS, useTheme, useWaitTransaction, validateEnsRecords };
1288
1289
  export type { AccordionProps, AlertPosition, AlertProps, AlertVariant, ButtonProps, ButtonSize, ButtonVariant, ChainName$2 as ChainName, ConnectAndSetChainProps, ContractErrorLabelProps, DropdownProps, EnsAddressRecord$1 as EnsAddressRecord, EnsContenthashRecord, EnsRecords$1 as EnsRecords, EnsRecordsDiff, EnsTextRecord$1 as EnsTextRecord, EstimatedFees, IconName, IconProps, InputProps, InputSize, InputType, ModalProps, ModalSize, NameListing, PricingDisplayProps, ProfileHeaderProps, RecordValidationError, RegistrationRequest, ShurikenSpinnerProps, SupportedContenthashRecord, SupportedEnsAddress, SupportedText, SupportedTextRecord, TextCategory, TextColor, TextProps, TextSize, TextWeight, TextareaProps, TextareaSize, ThemeContextValue, ThemeName, ThemeProviderProps, TooltipPosition, TooltipProps };
package/dist/index.js CHANGED
@@ -22385,6 +22385,7 @@ const encode$2 = (name, value) => {
22385
22385
 
22386
22386
  const convertToResolverData = (name, records) => {
22387
22387
  return convertToMulticallResolverData(name, {
22388
+ textsRemoved: [],
22388
22389
  textsAdded: records.texts,
22389
22390
  textsModified: [],
22390
22391
  addressesAdded: records.addresses,
@@ -22414,14 +22415,15 @@ const convertTextData = (node, resolverData, diff) => {
22414
22415
  });
22415
22416
  resolverData.push(data);
22416
22417
  });
22417
- diff.textsModified.forEach((text) => {
22418
- const data = encodeFunctionData({
22419
- functionName: "setText",
22420
- abi: parseAbi([SET_TEXT_FUNC]),
22421
- args: [node, text.key, ""]
22418
+ if (diff.textsRemoved?.length > 0) {
22419
+ diff.textsRemoved.forEach((key) => {
22420
+ resolverData.push(encodeFunctionData({
22421
+ functionName: "setText",
22422
+ abi: parseAbi([SET_TEXT_FUNC]),
22423
+ args: [node, key.key, ""]
22424
+ }));
22422
22425
  });
22423
- resolverData.push(data);
22424
- });
22426
+ }
22425
22427
  };
22426
22428
  const convertAddressData = (node, resolverData, diff) => {
22427
22429
  const modifiedAddressMap = {};
@@ -58597,11 +58599,12 @@ function requireDist () {
58597
58599
 
58598
58600
  var distExports = requireDist();
58599
58601
 
58600
- const useOffchainManager = (name, apiKeyOrToken) => {
58602
+ const useOffchainManager = (name, apiKeyOrToken, isTestnet = false) => {
58601
58603
  const client = useMemo(() => {
58602
58604
  const key = { [name]: apiKeyOrToken };
58603
58605
  return distExports.createOffchainClient({
58604
- domainApiKeys: key
58606
+ domainApiKeys: key,
58607
+ mode: isTestnet ? "sepolia" : "mainnet"
58605
58608
  });
58606
58609
  }, [name, apiKeyOrToken]);
58607
58610
  return client;
@@ -62519,10 +62522,11 @@ const OffchainSubnameForm = ({
62519
62522
  name,
62520
62523
  label: propLabel,
62521
62524
  hideTitle = false,
62525
+ isTestnet,
62522
62526
  onCancel,
62523
62527
  onSuccess
62524
62528
  }) => {
62525
- const client = useOffchainManager(name, apiKeyOrToken);
62529
+ const client = useOffchainManager(name, apiKeyOrToken, isTestnet);
62526
62530
  const [label, setLabel] = useState(propLabel || "");
62527
62531
  const [showProfile, setShowProfile] = useState(false);
62528
62532
  const [createStep, setCreateStep] = useState("form" /* Form */);