@thenamespace/ens-components 0.30.0 → 0.32.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
@@ -135,6 +135,8 @@ declare const getBlockExplorerAddressUrl: (chainId: number, address: string) =>
135
135
  declare const getBlockExplorerName: (chainId: number) => string;
136
136
  declare const getEnsAppUrl: (ensName: string, isTestnet?: boolean) => string;
137
137
 
138
+ declare const wait: (ms: number) => Promise<void>;
139
+
138
140
  interface EnsRecordsFormProps {
139
141
  resolverChainId?: number;
140
142
  resolverAddress?: Address;
@@ -1285,5 +1287,5 @@ interface OffchainClient {
1285
1287
 
1286
1288
  declare const useOffchainManager: (name: string, apiKeyOrToken: string, isTestnet?: boolean) => OffchainClient;
1287
1289
 
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 };
1290
+ 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, wait };
1289
1291
  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 = {};
@@ -22583,6 +22585,10 @@ const getEnsAppUrl = (ensName, isTestnet = false) => {
22583
22585
  return `${baseUrl}/${ensName}`;
22584
22586
  };
22585
22587
 
22588
+ const wait = (ms) => {
22589
+ return new Promise((resolve) => setTimeout(resolve, ms));
22590
+ };
22591
+
22586
22592
  const isValidEmvAddress = (value) => {
22587
22593
  return isAddress$1(value);
22588
22594
  };
@@ -26094,6 +26100,7 @@ const useWaitTransaction = ({ isTestnet, chainId }) => {
26094
26100
  let lastError = null;
26095
26101
  for (let attempt = 0; attempt <= retries; attempt++) {
26096
26102
  try {
26103
+ const startTime = Date.now();
26097
26104
  const receiptPromise = publicClient.waitForTransactionReceipt({
26098
26105
  hash
26099
26106
  });
@@ -26103,6 +26110,12 @@ const useWaitTransaction = ({ isTestnet, chainId }) => {
26103
26110
  }, timeout);
26104
26111
  });
26105
26112
  const receipt = await Promise.race([receiptPromise, timeoutPromise]);
26113
+ const elapsedTime = Date.now() - startTime;
26114
+ const minLoadingTime = 5e3;
26115
+ if (elapsedTime < minLoadingTime) {
26116
+ await wait(minLoadingTime - elapsedTime);
26117
+ }
26118
+ await wait(2e3);
26106
26119
  return receipt;
26107
26120
  } catch (err) {
26108
26121
  lastError = err;
@@ -26110,7 +26123,7 @@ const useWaitTransaction = ({ isTestnet, chainId }) => {
26110
26123
  throw err;
26111
26124
  }
26112
26125
  const delay = retryDelay * Math.pow(2, attempt);
26113
- await new Promise((resolve) => setTimeout(resolve, delay));
26126
+ await wait(delay);
26114
26127
  }
26115
26128
  }
26116
26129
  throw lastError || new Error("Failed to wait for transaction");
@@ -70557,5 +70570,5 @@ var walletConnectWalletYHWKVTDY = /*#__PURE__*/Object.freeze({
70557
70570
  default: walletConnectWallet_default
70558
70571
  });
70559
70572
 
70560
- 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$1 as Text, TextRecordCategory, Textarea, ThemeProvider, Tooltip, TxProgress, WalletConnectProvider, capitalize, convertEVMChainIdToCoinType, convertToMulticallResolverData, convertToResolverData, createEnsReferer, debounce$1 as 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 };
70573
+ 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$1 as Text, TextRecordCategory, Textarea, ThemeProvider, Tooltip, TxProgress, WalletConnectProvider, capitalize, convertEVMChainIdToCoinType, convertToMulticallResolverData, convertToResolverData, createEnsReferer, debounce$1 as 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, wait };
70561
70574
  //# sourceMappingURL=index.js.map