@thenamespace/ens-components 0.32.0 → 0.33.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
@@ -179,8 +179,9 @@ interface SubnameMintFormProps {
179
179
  onCancel?: () => void;
180
180
  onSuccess?: (data: MintSuccessData) => void;
181
181
  onSubnameMinted?: (data: SubnameMintedData) => void;
182
+ txConfirmations?: number;
182
183
  }
183
- declare const SubnameMintForm: ({ parentName, label, isTestnet, onCancel, onSuccess, onSubnameMinted, }: SubnameMintFormProps) => react_jsx_runtime.JSX.Element;
184
+ declare const SubnameMintForm: ({ parentName, label, isTestnet, onCancel, onSuccess, onSubnameMinted, txConfirmations }: SubnameMintFormProps) => react_jsx_runtime.JSX.Element;
184
185
 
185
186
  interface OffchainSubnameCreatedData {
186
187
  label: string;
@@ -571,8 +572,9 @@ interface WaitTransactionOptions {
571
572
  retries?: number;
572
573
  retryDelay?: number;
573
574
  timeout?: number;
575
+ txConfirmations?: number;
574
576
  }
575
- declare const useWaitTransaction: ({ isTestnet, chainId }: {
577
+ declare const useWaitTransaction: ({ isTestnet, chainId, }: {
576
578
  isTestnet?: boolean;
577
579
  chainId?: number;
578
580
  }) => {
package/dist/index.js CHANGED
@@ -26094,15 +26094,17 @@ const useWaitTransaction = ({ isTestnet, chainId }) => {
26094
26094
  hash,
26095
26095
  retries = 3,
26096
26096
  retryDelay = 2e3,
26097
- timeout = 6e4
26097
+ timeout = 6e4,
26098
26098
  // 1 minute default timeout
26099
+ txConfirmations = 1
26099
26100
  } = options;
26100
26101
  let lastError = null;
26101
26102
  for (let attempt = 0; attempt <= retries; attempt++) {
26102
26103
  try {
26103
26104
  const startTime = Date.now();
26104
26105
  const receiptPromise = publicClient.waitForTransactionReceipt({
26105
- hash
26106
+ hash,
26107
+ confirmations: txConfirmations
26106
26108
  });
26107
26109
  const timeoutPromise = new Promise((_, reject) => {
26108
26110
  setTimeout(() => {
@@ -61083,7 +61085,8 @@ const EnsUpdateRecordsForm = ({
61083
61085
  onGreat,
61084
61086
  onRecordsUpdated,
61085
61087
  onCancel,
61086
- onTransactionSent
61088
+ onTransactionSent,
61089
+ txConfirmations
61087
61090
  }) => {
61088
61091
  const [recordsTemplate, setRecordsTemplate] = useState(
61089
61092
  deepCopy(existingRecords)
@@ -61155,7 +61158,7 @@ const EnsUpdateRecordsForm = ({
61155
61158
  }
61156
61159
  try {
61157
61160
  onTransactionSent?.(tx);
61158
- await waitTx({ hash: tx });
61161
+ await waitTx({ hash: tx, txConfirmations: txConfirmations || 1 });
61159
61162
  setUpdateTx({ hash: tx, status: TxProgress.Success });
61160
61163
  setIsUpdating({ waitingWallet: false, waitingTx: false });
61161
61164
  onRecordsUpdated?.(diff);
@@ -61700,7 +61703,8 @@ const SubnameMintForm = ({
61700
61703
  isTestnet = false,
61701
61704
  onCancel,
61702
61705
  onSuccess,
61703
- onSubnameMinted
61706
+ onSubnameMinted,
61707
+ txConfirmations
61704
61708
  }) => {
61705
61709
  const { getListingDetails } = useMintManager({ isTestnet });
61706
61710
  const [initState, setInitState] = useState({
@@ -61783,7 +61787,8 @@ const SubnameMintFormContent = ({
61783
61787
  isExpirable = false,
61784
61788
  onCancel,
61785
61789
  onSuccess,
61786
- onSubnameMinted
61790
+ onSubnameMinted,
61791
+ txConfirmations
61787
61792
  }) => {
61788
61793
  const { address: connectedAddress, chain: currentChain } = useAccount();
61789
61794
  const { switchChain, isPending: isSwitchingChain } = useSwitchChain();
@@ -62098,7 +62103,7 @@ const SubnameMintFormContent = ({
62098
62103
  return;
62099
62104
  }
62100
62105
  try {
62101
- const receipt = await waitTx({ hash: tx });
62106
+ const receipt = await waitTx({ hash: tx, txConfirmations: txConfirmations || 1 });
62102
62107
  const gasUsed = receipt.gasUsed;
62103
62108
  const gasPrice = receipt.effectiveGasPrice || BigInt(0);
62104
62109
  const txFees = gasUsed * gasPrice;