@thenamespace/ens-components 0.25.0 → 0.27.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.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +313 -64
- package/dist/index.js +33106 -906
- package/dist/index.js.map +1 -1
- package/dist/types/components/ens-records-form/EnsRecordsForm.d.ts +7 -2
- package/dist/types/components/ens-records-form/EnsUpdateRecordsForm.d.ts +5 -3
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/molecules/alert/Alert.d.ts +2 -0
- package/dist/types/components/molecules/index.d.ts +1 -0
- package/dist/types/components/molecules/pricing-display/PricingDisplay.d.ts +24 -0
- package/dist/types/components/molecules/pricing-display/index.d.ts +1 -0
- package/dist/types/components/subname-mint-form/MintFormActions.d.ts +11 -0
- package/dist/types/components/subname-mint-form/MintSuccess.d.ts +12 -0
- package/dist/types/components/subname-mint-form/NameAvailabilityInput.d.ts +11 -0
- package/dist/types/components/subname-mint-form/ProfileSelector.d.ts +4 -0
- package/dist/types/components/subname-mint-form/SetSubnameRecords.d.ts +10 -0
- package/dist/types/components/subname-mint-form/SubnameMintForm.d.ts +32 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/useMintManager.d.ts +9 -0
- package/dist/types/hooks/useMintSubname.d.ts +23 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/listing.d.ts +25 -0
- package/dist/types/utils/records.d.ts +1 -0
- package/package.json +5 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EnsRecords } from "@/types";
|
|
2
|
-
import { Address } from "viem";
|
|
2
|
+
import { Address, Hash } from "viem";
|
|
3
3
|
import "./EnsRecordsForm.css";
|
|
4
|
+
import { EnsRecordsDiff } from "@/utils";
|
|
4
5
|
export interface EnsRecordsFormProps {
|
|
5
6
|
resolverChainId?: number;
|
|
6
7
|
resolverAddress?: Address;
|
|
@@ -9,5 +10,9 @@ export interface EnsRecordsFormProps {
|
|
|
9
10
|
existingRecords: EnsRecords;
|
|
10
11
|
noBorder?: boolean;
|
|
11
12
|
className?: string;
|
|
13
|
+
onCancel?: () => void;
|
|
14
|
+
onRecordsUpdated?: (newRecords: EnsRecordsDiff) => void;
|
|
15
|
+
onGreat?: () => void;
|
|
16
|
+
onTransactionSent?: (hash: Hash) => void;
|
|
12
17
|
}
|
|
13
|
-
export declare const EnsRecordsForm: ({ name, existingRecords, resolverChainId, isTestnet, resolverAddress, noBorder, className, }: EnsRecordsFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const EnsRecordsForm: ({ name, existingRecords, resolverChainId, isTestnet, resolverAddress, noBorder, className, onCancel, onGreat, onRecordsUpdated, onTransactionSent }: EnsRecordsFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EnsRecords } from "@/types";
|
|
2
|
-
import { Address } from "viem";
|
|
2
|
+
import { Address, Hash } from "viem";
|
|
3
3
|
import { EnsRecordsDiff } from "@/utils";
|
|
4
4
|
import "./EnsUpdateRecordsForm.css";
|
|
5
5
|
interface EnsUpdateRecordsForm {
|
|
@@ -8,8 +8,10 @@ interface EnsUpdateRecordsForm {
|
|
|
8
8
|
isTestnet?: boolean;
|
|
9
9
|
name: string;
|
|
10
10
|
existingRecords: EnsRecords;
|
|
11
|
-
|
|
11
|
+
onCancel?: () => void;
|
|
12
|
+
onRecordsUpdated?: (diff: EnsRecordsDiff) => void;
|
|
12
13
|
onGreat?: () => void;
|
|
14
|
+
onTransactionSent?: (hash: Hash) => void;
|
|
13
15
|
}
|
|
14
|
-
export declare const EnsUpdateRecordsForm: ({ name, existingRecords, resolverChainId, resolverAddress, isTestnet, onGreat, onRecordsUpdated, }: EnsUpdateRecordsForm) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const EnsUpdateRecordsForm: ({ name, existingRecords, resolverChainId, resolverAddress, isTestnet, onGreat, onRecordsUpdated, onCancel, onTransactionSent, }: EnsUpdateRecordsForm) => import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { SelectRecordsForm } from "./select-records-form/SelectRecordsForm";
|
|
2
2
|
export { EnsNameRegistrationForm } from "./ens-name-registration/ENSNameRegistrationForm";
|
|
3
3
|
export { EnsRecordsForm } from "./ens-records-form/EnsRecordsForm";
|
|
4
|
+
export { SubnameMintForm } from "./subname-mint-form/SubnameMintForm";
|
|
4
5
|
export * from "./atoms";
|
|
5
6
|
export * from "./molecules";
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./Alert.css";
|
|
3
3
|
export type AlertVariant = "error" | "warning" | "info" | "success";
|
|
4
|
+
export type AlertPosition = "vertical" | "horizontal";
|
|
4
5
|
export interface AlertProps {
|
|
5
6
|
variant?: AlertVariant;
|
|
7
|
+
position?: AlertPosition;
|
|
6
8
|
children: React.ReactNode;
|
|
7
9
|
className?: string;
|
|
8
10
|
onClose?: () => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./PricingDisplay.css";
|
|
3
|
+
export interface PricingDisplayProps {
|
|
4
|
+
primaryFee: {
|
|
5
|
+
label: string;
|
|
6
|
+
amount: number | string;
|
|
7
|
+
isChecking: boolean;
|
|
8
|
+
};
|
|
9
|
+
networkFees?: {
|
|
10
|
+
amount: number | string;
|
|
11
|
+
isChecking: boolean;
|
|
12
|
+
};
|
|
13
|
+
total: {
|
|
14
|
+
amount: number | string;
|
|
15
|
+
isChecking: boolean;
|
|
16
|
+
};
|
|
17
|
+
expiryPicker?: {
|
|
18
|
+
years: number;
|
|
19
|
+
onYearsChange: (years: number) => void;
|
|
20
|
+
};
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const PricingDisplay: React.FC<PricingDisplayProps>;
|
|
24
|
+
export default PricingDisplay;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PricingDisplay";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface MintFormActionsProps {
|
|
2
|
+
onCancel: () => void;
|
|
3
|
+
onMint: () => void;
|
|
4
|
+
isMintDisabled: boolean;
|
|
5
|
+
isWaitingWallet?: boolean;
|
|
6
|
+
needsChainSwitch?: boolean;
|
|
7
|
+
chainName?: string;
|
|
8
|
+
onSwitchChain?: () => void;
|
|
9
|
+
isSwitchingChain?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const MintFormActions: ({ onCancel, onMint, isMintDisabled, isWaitingWallet, needsChainSwitch, chainName, onSwitchChain, isSwitchingChain, }: MintFormActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MintSuccessData } from "./SubnameMintForm";
|
|
3
|
+
import "../ens-name-registration/registration/SuccessScreen.css";
|
|
4
|
+
export interface MintSuccessProps {
|
|
5
|
+
data: MintSuccessData;
|
|
6
|
+
chainId: number;
|
|
7
|
+
isTestnet: boolean;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
onMintAnother?: () => void;
|
|
10
|
+
onViewName?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const MintSuccess: React.FC<MintSuccessProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface NameAvailabilityInputProps {
|
|
2
|
+
label: string;
|
|
3
|
+
parentName: string;
|
|
4
|
+
minLength: number;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
isChecking: boolean;
|
|
7
|
+
isAvailable: boolean;
|
|
8
|
+
isReserved: boolean;
|
|
9
|
+
onNameChange: (value: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const NameAvailabilityInput: ({ label, parentName, minLength, disabled, isChecking, isAvailable, isReserved, onNameChange, }: NameAvailabilityInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { EnsRecords } from "@/types";
|
|
3
|
+
export interface SetSubnameRecordsProps {
|
|
4
|
+
records: EnsRecords;
|
|
5
|
+
onRecordsChange: (records: EnsRecords) => void;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
onSave: () => void;
|
|
8
|
+
hasChanges?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const SetSubnameRecords: React.FC<SetSubnameRecordsProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import "./SubnameMintForm.css";
|
|
2
|
+
import { EnsRecords } from "@/types";
|
|
3
|
+
export interface MintSuccessData {
|
|
4
|
+
fullName: string;
|
|
5
|
+
label: string;
|
|
6
|
+
parentName: string;
|
|
7
|
+
txHash: string;
|
|
8
|
+
price: string;
|
|
9
|
+
transactionFees: string;
|
|
10
|
+
records: EnsRecords;
|
|
11
|
+
}
|
|
12
|
+
export interface SubnameMintedData {
|
|
13
|
+
label: string;
|
|
14
|
+
parentName: string;
|
|
15
|
+
fullSubname: string;
|
|
16
|
+
records: EnsRecords;
|
|
17
|
+
price: string;
|
|
18
|
+
transactionFees: string;
|
|
19
|
+
ownerAddress: string;
|
|
20
|
+
txHash: string;
|
|
21
|
+
chainId: number;
|
|
22
|
+
}
|
|
23
|
+
interface SubnameMintFormProps {
|
|
24
|
+
parentName: string;
|
|
25
|
+
label?: string;
|
|
26
|
+
isTestnet?: boolean;
|
|
27
|
+
onCancel?: () => void;
|
|
28
|
+
onSuccess?: (data: MintSuccessData) => void;
|
|
29
|
+
onSubnameMinted?: (data: SubnameMintedData) => void;
|
|
30
|
+
}
|
|
31
|
+
export declare const SubnameMintForm: ({ parentName, label, isTestnet, onCancel, onSuccess, onSubnameMinted, }: SubnameMintFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NameListing } from "@/types";
|
|
2
|
+
interface UseMintManagerParams {
|
|
3
|
+
isTestnet?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const useMintManager: ({ isTestnet }: UseMintManagerParams) => {
|
|
6
|
+
mintClient: import("@thenamespace/mint-manager").MintClient;
|
|
7
|
+
getListingDetails: (name: string) => Promise<NameListing>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Address, Hash } from "viem";
|
|
2
|
+
import { MintTransactionResponse } from "@thenamespace/mint-manager/dist/types";
|
|
3
|
+
interface MintSubnameResult {
|
|
4
|
+
txHash: Hash;
|
|
5
|
+
price: bigint;
|
|
6
|
+
}
|
|
7
|
+
export interface EstimatedFees {
|
|
8
|
+
gasEstimate: bigint;
|
|
9
|
+
gasPrice: bigint;
|
|
10
|
+
totalFeeWei: bigint;
|
|
11
|
+
totalFeeEth: number;
|
|
12
|
+
}
|
|
13
|
+
interface EstimateFeesParams {
|
|
14
|
+
mintTx: MintTransactionResponse;
|
|
15
|
+
account: Address;
|
|
16
|
+
}
|
|
17
|
+
export declare const useMintSubname: ({ chainId }: {
|
|
18
|
+
chainId: number;
|
|
19
|
+
}) => {
|
|
20
|
+
mintSubname: (mintTx: MintTransactionResponse) => Promise<MintSubnameResult>;
|
|
21
|
+
estimateTransactionFees: (params: EstimateFeesParams) => Promise<EstimatedFees | null>;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Address } from "viem";
|
|
2
|
+
export interface NameListing {
|
|
3
|
+
type: ListingType;
|
|
4
|
+
name: string;
|
|
5
|
+
isVerified: boolean;
|
|
6
|
+
l2Metadata?: {
|
|
7
|
+
isBurnable: boolean;
|
|
8
|
+
isExpirable: boolean;
|
|
9
|
+
registryAddress: Address;
|
|
10
|
+
registryNetwork: ListingNetwork;
|
|
11
|
+
};
|
|
12
|
+
nameNetwork: ListingNetwork;
|
|
13
|
+
}
|
|
14
|
+
export declare enum ListingType {
|
|
15
|
+
L1 = "L1",
|
|
16
|
+
L2 = "L2"
|
|
17
|
+
}
|
|
18
|
+
export declare enum ListingNetwork {
|
|
19
|
+
Base = "BASE",
|
|
20
|
+
Optimism = "OPTIMISM",
|
|
21
|
+
Mainnet = "MAINNET",
|
|
22
|
+
Sepolia = "SEPOLIA",
|
|
23
|
+
BaseSepolia = "BASE_SEPOLIA"
|
|
24
|
+
}
|
|
25
|
+
export declare const getChainIdForListingNetwork: (network: ListingNetwork) => number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thenamespace/ens-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -74,8 +74,6 @@
|
|
|
74
74
|
"@types/react": "^19.1.12",
|
|
75
75
|
"@types/react-dom": "^19.1.9",
|
|
76
76
|
"@vitejs/plugin-react": "^5.0.2",
|
|
77
|
-
"viem": "^2.38.4",
|
|
78
|
-
"wagmi": "^2.18.2",
|
|
79
77
|
"autoprefixer": "^10.4.21",
|
|
80
78
|
"axios": "^1.11.0",
|
|
81
79
|
"bootstrap": "^5.3.8",
|
|
@@ -93,8 +91,10 @@
|
|
|
93
91
|
"rollup-plugin-postcss": "^4.0.2",
|
|
94
92
|
"storybook": "^8.6.14",
|
|
95
93
|
"typescript": "^5.9.2",
|
|
94
|
+
"viem": "^2.38.4",
|
|
96
95
|
"vite": "^6.3.5",
|
|
97
|
-
"vite-tsconfig-paths": "^5.1.4"
|
|
96
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
97
|
+
"wagmi": "^2.18.2"
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
100
|
"@adraffy/ens-normalize": "^1.11.1",
|
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
"@namespacesdk/indexer": "^1.0.1",
|
|
105
105
|
"@namespacesdk/mint-manager": "^1.0.15",
|
|
106
106
|
"@thenamespace/addresses": "^1.1.0",
|
|
107
|
+
"@thenamespace/mint-manager": "^1.1.1",
|
|
107
108
|
"lodash": "^4.17.21",
|
|
108
109
|
"lucide-react": ">=0.525.0",
|
|
109
110
|
"react-confetti": "^6.4.0"
|