@thenamespace/ens-components 0.32.0 → 0.34.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 +6 -3
- package/dist/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/dist/types/components/ens-records-form/EnsRecordsForm.d.ts +2 -1
- package/dist/types/components/ens-records-form/EnsUpdateRecordsForm.d.ts +2 -1
- package/dist/types/components/subname-mint-form/SubnameMintForm.d.ts +2 -1
- package/dist/types/hooks/useWaitTransaction.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -149,8 +149,9 @@ interface EnsRecordsFormProps {
|
|
|
149
149
|
onRecordsUpdated?: (newRecords: EnsRecordsDiff) => void;
|
|
150
150
|
onGreat?: () => void;
|
|
151
151
|
onTransactionSent?: (hash: Hash) => void;
|
|
152
|
+
txConfirmations?: number;
|
|
152
153
|
}
|
|
153
|
-
declare const EnsRecordsForm: ({ name, existingRecords, resolverChainId, isTestnet, resolverAddress, noBorder, className, onCancel, onGreat, onRecordsUpdated, onTransactionSent }: EnsRecordsFormProps) => react_jsx_runtime.JSX.Element;
|
|
154
|
+
declare const EnsRecordsForm: ({ name, existingRecords, resolverChainId, isTestnet, resolverAddress, noBorder, className, onCancel, onGreat, onRecordsUpdated, onTransactionSent, txConfirmations }: EnsRecordsFormProps) => react_jsx_runtime.JSX.Element;
|
|
154
155
|
|
|
155
156
|
interface MintSuccessData {
|
|
156
157
|
fullName: string;
|
|
@@ -179,8 +180,9 @@ interface SubnameMintFormProps {
|
|
|
179
180
|
onCancel?: () => void;
|
|
180
181
|
onSuccess?: (data: MintSuccessData) => void;
|
|
181
182
|
onSubnameMinted?: (data: SubnameMintedData) => void;
|
|
183
|
+
txConfirmations?: number;
|
|
182
184
|
}
|
|
183
|
-
declare const SubnameMintForm: ({ parentName, label, isTestnet, onCancel, onSuccess, onSubnameMinted, }: SubnameMintFormProps) => react_jsx_runtime.JSX.Element;
|
|
185
|
+
declare const SubnameMintForm: ({ parentName, label, isTestnet, onCancel, onSuccess, onSubnameMinted, txConfirmations }: SubnameMintFormProps) => react_jsx_runtime.JSX.Element;
|
|
184
186
|
|
|
185
187
|
interface OffchainSubnameCreatedData {
|
|
186
188
|
label: string;
|
|
@@ -571,8 +573,9 @@ interface WaitTransactionOptions {
|
|
|
571
573
|
retries?: number;
|
|
572
574
|
retryDelay?: number;
|
|
573
575
|
timeout?: number;
|
|
576
|
+
txConfirmations?: number;
|
|
574
577
|
}
|
|
575
|
-
declare const useWaitTransaction: ({ isTestnet, chainId }: {
|
|
578
|
+
declare const useWaitTransaction: ({ isTestnet, chainId, }: {
|
|
576
579
|
isTestnet?: boolean;
|
|
577
580
|
chainId?: number;
|
|
578
581
|
}) => {
|
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);
|
|
@@ -61237,7 +61240,8 @@ const EnsRecordsForm = ({
|
|
|
61237
61240
|
onCancel,
|
|
61238
61241
|
onGreat,
|
|
61239
61242
|
onRecordsUpdated,
|
|
61240
|
-
onTransactionSent
|
|
61243
|
+
onTransactionSent,
|
|
61244
|
+
txConfirmations
|
|
61241
61245
|
}) => {
|
|
61242
61246
|
const mainnetChainId = isTestnet ? sepolia$1.id : mainnet$1.id;
|
|
61243
61247
|
const resolverChain = resolverChainId ? resolverChainId : mainnetChainId;
|
|
@@ -61330,7 +61334,8 @@ const EnsRecordsForm = ({
|
|
|
61330
61334
|
},
|
|
61331
61335
|
onGreat,
|
|
61332
61336
|
onCancel,
|
|
61333
|
-
onTransactionSent
|
|
61337
|
+
onTransactionSent,
|
|
61338
|
+
txConfirmations
|
|
61334
61339
|
}
|
|
61335
61340
|
)
|
|
61336
61341
|
]
|
|
@@ -61700,7 +61705,8 @@ const SubnameMintForm = ({
|
|
|
61700
61705
|
isTestnet = false,
|
|
61701
61706
|
onCancel,
|
|
61702
61707
|
onSuccess,
|
|
61703
|
-
onSubnameMinted
|
|
61708
|
+
onSubnameMinted,
|
|
61709
|
+
txConfirmations
|
|
61704
61710
|
}) => {
|
|
61705
61711
|
const { getListingDetails } = useMintManager({ isTestnet });
|
|
61706
61712
|
const [initState, setInitState] = useState({
|
|
@@ -61783,7 +61789,8 @@ const SubnameMintFormContent = ({
|
|
|
61783
61789
|
isExpirable = false,
|
|
61784
61790
|
onCancel,
|
|
61785
61791
|
onSuccess,
|
|
61786
|
-
onSubnameMinted
|
|
61792
|
+
onSubnameMinted,
|
|
61793
|
+
txConfirmations
|
|
61787
61794
|
}) => {
|
|
61788
61795
|
const { address: connectedAddress, chain: currentChain } = useAccount();
|
|
61789
61796
|
const { switchChain, isPending: isSwitchingChain } = useSwitchChain();
|
|
@@ -62098,7 +62105,7 @@ const SubnameMintFormContent = ({
|
|
|
62098
62105
|
return;
|
|
62099
62106
|
}
|
|
62100
62107
|
try {
|
|
62101
|
-
const receipt = await waitTx({ hash: tx });
|
|
62108
|
+
const receipt = await waitTx({ hash: tx, txConfirmations: txConfirmations || 1 });
|
|
62102
62109
|
const gasUsed = receipt.gasUsed;
|
|
62103
62110
|
const gasPrice = receipt.effectiveGasPrice || BigInt(0);
|
|
62104
62111
|
const txFees = gasUsed * gasPrice;
|