{t('input.sendName.views.summary.fields.summary.updates.role', {
role: 'Manager',
address: shortenedAddress,
@@ -31,14 +31,16 @@ export const SummarySection = () => {
+
{t('input.sendName.views.summary.fields.summary.updates.eth-record', {
address: shortenedAddress,
})}
)}
{transactions.resetProfile && (
-
{t('input.sendName.views.summary.fields.summary.remove.profile')}
+
+ {t('input.sendName.views.summary.fields.summary.remove.profile')}
+
)}
)
diff --git a/src/transaction-flow/input/SyncManager/utils/checkCanSyncManager.ts b/src/transaction-flow/input/SyncManager/utils/checkCanSyncManager.ts
index 164318472..04602c33b 100644
--- a/src/transaction-flow/input/SyncManager/utils/checkCanSyncManager.ts
+++ b/src/transaction-flow/input/SyncManager/utils/checkCanSyncManager.ts
@@ -1,25 +1,25 @@
import { P, match } from 'ts-pattern'
-import type { useNameDetails } from '@app/hooks/useNameDetails'
-import type { useNameType } from '@app/hooks/useNameType'
+import type { NameType } from '@app/hooks/useNameType'
export const checkCanSyncManager = ({
address,
nameType,
- details,
+ registrant,
+ owner,
+ dnsOwner,
}: {
address?: string | null
- nameType: ReturnType
['data']
- details: ReturnType
+ nameType?: NameType | null
+ registrant?: string | null
+ owner?: string | null
+ dnsOwner?: string | null
}) => {
return match(nameType)
- .with(
- 'eth-unwrapped-2ld',
- () => details.ownerData?.registrant === address && details.ownerData?.owner !== address,
- )
+ .with('eth-unwrapped-2ld', () => registrant === address && owner !== address)
.with(
P.union('dns-unwrapped-2ld', 'dns-wrapped-2ld'),
- () => details.dnsOwner === address && details.ownerData?.owner !== address,
+ () => dnsOwner === address && owner !== address,
)
.with(
P.union(
diff --git a/src/transaction-flow/input/index.tsx b/src/transaction-flow/input/index.tsx
index 977fc3cb4..a1ad4cb9f 100644
--- a/src/transaction-flow/input/index.tsx
+++ b/src/transaction-flow/input/index.tsx
@@ -16,8 +16,7 @@ import type { Props as ProfileEditorProps } from './ProfileEditor/ProfileEditor-
import type { Props as ResetPrimaryNameProps } from './ResetPrimaryName/ResetPrimaryName-flow'
import type { Props as RevokePermissionsProps } from './RevokePermissions/RevokePermissions-flow'
import type { Props as SelectPrimaryNameProps } from './SelectPrimaryName/SelectPrimaryName-flow'
-import type { Props as SendNameProps } from './SendName-flow'
-import type { Props as SendName2Props } from './SendName/SendName-flow'
+import type { Props as SendNameProps } from './SendName/SendName-flow'
import type { Props as SyncManagerProps } from './SyncManager/SyncManager-flow'
import type { Props as TransferProfileProps } from './TransferProfile/TransferProfile-flow'
import type { Props as UnknownLabelsProps } from './UnknownLabels/UnknownLabels-flow'
@@ -65,8 +64,7 @@ const RevokePermissions = dynamicHelper(
const SelectPrimaryName = dynamicHelper(
'SelectPrimaryName/SelectPrimaryName',
)
-const SendName = dynamicHelper('SendName')
-const SendName2 = dynamicHelper('SendName/SendName')
+const SendName = dynamicHelper('SendName/SendName')
const SyncManager = dynamicHelper('SyncManager/SyncManager')
const TransferProfile = dynamicHelper('TransferProfile/TransferProfile')
const UnknownLabels = dynamicHelper('UnknownLabels/UnknownLabels')
@@ -85,7 +83,6 @@ export const DataInputComponents = {
RevokePermissions,
SelectPrimaryName,
SendName,
- SendName2,
SyncManager,
TransferProfile,
UnknownLabels,
diff --git a/src/transaction-flow/transaction/index.ts b/src/transaction-flow/transaction/index.ts
index 128db7939..1c9a4ee31 100644
--- a/src/transaction-flow/transaction/index.ts
+++ b/src/transaction-flow/transaction/index.ts
@@ -12,6 +12,7 @@ import migrateProfileWithReset from './migrateProfileWithReset'
import registerName from './registerName'
import resetPrimaryName from './resetPrimaryName'
import resetProfile from './resetProfile'
+import resetProfileWithRecords from './resetProfileWithRecords'
import setPrimaryName from './setPrimaryName'
import syncManager from './syncManager'
import testSendName from './testSendName'
@@ -40,6 +41,7 @@ export const transactions = {
registerName,
resetPrimaryName,
resetProfile,
+ resetProfileWithRecords,
setPrimaryName,
syncManager,
testSendName,
diff --git a/src/transaction-flow/transaction/resetProfileWithRecords.ts b/src/transaction-flow/transaction/resetProfileWithRecords.ts
new file mode 100644
index 000000000..1a646acf6
--- /dev/null
+++ b/src/transaction-flow/transaction/resetProfileWithRecords.ts
@@ -0,0 +1,67 @@
+import type { JsonRpcSigner } from '@ethersproject/providers'
+import { TFunction } from 'i18next'
+import { P, match } from 'ts-pattern'
+
+import { RecordOptions } from '@ensdomains/ensjs/utils/recordHelpers'
+
+import { PublicENS, Transaction, TransactionDisplayItem } from '@app/types'
+import { recordOptionsToToupleList } from '@app/utils/records'
+
+type Data = {
+ name: string
+ records: RecordOptions
+ resolver: string
+}
+
+const displayItems = ({ name, records }: Data, t: TFunction): TransactionDisplayItem[] => {
+ const recordsList = recordOptionsToToupleList(records)
+ const recordsItem = match(recordsList.length)
+ .with(
+ P.when((length) => length > 3),
+ (length) => [
+ {
+ label: 'update',
+ value: t('transaction.itemValue.records', { count: length }),
+ } as TransactionDisplayItem,
+ ],
+ )
+ .with(
+ P.when((length) => length > 0),
+ () => [
+ {
+ label: 'records',
+ value: recordsList,
+ type: 'records',
+ } as TransactionDisplayItem,
+ ],
+ )
+ .otherwise(() => [])
+ return [
+ {
+ label: 'name',
+ value: name,
+ type: 'name',
+ },
+ {
+ label: 'action',
+ value: t('transaction.description.resetProfileWithRecords'),
+ },
+ ...recordsItem,
+ ]
+}
+
+const transaction = (signer: JsonRpcSigner, ens: PublicENS, data: Data) => {
+ return ens.setRecords.populateTransaction(data.name, {
+ records: {
+ ...data.records,
+ clearRecords: true,
+ },
+ resolverAddress: data.resolver,
+ signer,
+ })
+}
+
+export default {
+ displayItems,
+ transaction,
+} as Transaction
diff --git a/src/utils/cacheKeyFactory.ts b/src/utils/cacheKeyFactory.ts
index 482eca3dd..61b2a455b 100644
--- a/src/utils/cacheKeyFactory.ts
+++ b/src/utils/cacheKeyFactory.ts
@@ -1,6 +1,7 @@
import { useAccount } from 'wagmi'
import type { uniqueTransactionIdentifierGenerator } from '@app/components/@molecules/TransactionDialogManager/stage/TransactionStageModal'
+import { ResolverInterfaceName } from '@app/constants/resolverInterfaceIds'
import { useChainId } from '@app/hooks/useChainId'
import type { RegistrationProps } from '@app/hooks/useEstimateRegistration'
import type { TransactionItem } from '@app/transaction-flow/transaction'
@@ -130,6 +131,14 @@ export const useQueryKeys = () => {
interfaceNames,
'resolverHasInterfaces',
],
+ resolverSupportsInterfaces: (resolverAddress: string, interfaces: ResolverInterfaceName[]) => [
+ ...globalKeys,
+ 'resolverSupportsInterfaces',
+ 'resolverAddress',
+ resolverAddress,
+ 'interfaces',
+ interfaces.join('-'),
+ ],
resolverIsAuthorized: (name: string, resolver: string) => [
...globalKeys,
'resolverIsAuthorised',
diff --git a/src/utils/utils.ts b/src/utils/utils.ts
index 63952c1f7..ba1938985 100644
--- a/src/utils/utils.ts
+++ b/src/utils/utils.ts
@@ -88,6 +88,13 @@ export const checkETH2LDFromName = (name: string) => {
return true
}
+export const checkDNS2LDFromName = (name: string) => {
+ const labels = name.split('.')
+ if (labels.length !== 2) return false
+ if (labels[1] === 'eth') return false
+ return true
+}
+
export const checkSubname = (name: string) => name.split('.').length > 2
export const isLabelTooLong = (label: string) => {