@thenamespace/ens-components 0.28.0 → 0.30.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.
@@ -2,5 +2,6 @@ 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
4
  export { SubnameMintForm } from "./subname-mint-form/SubnameMintForm";
5
+ export { OffchainSubnameForm } from "./offchain-subname-form/OffchainSubnameForm";
5
6
  export * from "./atoms";
6
7
  export * from "./molecules";
@@ -0,0 +1,8 @@
1
+ interface FormHeaderProps {
2
+ isUpdateMode: boolean;
3
+ label: string;
4
+ parentName: string;
5
+ showFullName: boolean;
6
+ }
7
+ export declare const FormHeader: ({ isUpdateMode, label, parentName, showFullName }: FormHeaderProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,20 @@
1
+ import { EnsRecords } from "@/types";
2
+ import "./OffchainSubnameForm.css";
3
+ export interface OffchainSubnameCreatedData {
4
+ label: string;
5
+ parentName: string;
6
+ fullSubname: string;
7
+ records: EnsRecords;
8
+ ownerAddress?: string;
9
+ }
10
+ interface OffchainSubnameFormProps {
11
+ apiKeyOrToken: string;
12
+ name: string;
13
+ label?: string;
14
+ hideTitle?: boolean;
15
+ onCancel?: () => void;
16
+ isTestnet?: boolean;
17
+ onSuccess?: (data: OffchainSubnameCreatedData) => void;
18
+ }
19
+ export declare const OffchainSubnameForm: ({ apiKeyOrToken, name, label: propLabel, hideTitle, isTestnet, onCancel, onSuccess, }: OffchainSubnameFormProps) => import("react/jsx-runtime").JSX.Element;
20
+ export {};
@@ -0,0 +1,7 @@
1
+ interface OwnerAddressInputProps {
2
+ value: string;
3
+ error: string | null;
4
+ onChange: (value: string) => void;
5
+ }
6
+ export declare const OwnerAddressInput: ({ value, error, onChange }: OwnerAddressInputProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,13 @@
1
+ interface SubnameInputProps {
2
+ value: string;
3
+ parentName: string;
4
+ isUpdateMode: boolean;
5
+ isLoading: boolean;
6
+ isChecking: boolean;
7
+ isDisabled: boolean;
8
+ isAvailable: boolean;
9
+ minLength: number;
10
+ onChange: (value: string) => void;
11
+ }
12
+ export declare const SubnameInput: ({ value, parentName, isUpdateMode, isLoading, isChecking, isDisabled, isAvailable, minLength, onChange, }: SubnameInputProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,7 @@
1
+ interface SuccessScreenProps {
2
+ fullSubname: string;
3
+ isUpdateMode: boolean;
4
+ onContinue: () => void;
5
+ }
6
+ export declare const SuccessScreen: ({ fullSubname, isUpdateMode, onContinue }: SuccessScreenProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ export { OffchainSubnameForm } from "./OffchainSubnameForm";
2
+ export type { OffchainSubnameCreatedData } from "./OffchainSubnameForm";
3
+ export { SuccessScreen } from "./SuccessScreen";
4
+ export { FormHeader } from "./FormHeader";
5
+ export { SubnameInput } from "./SubnameInput";
6
+ export { OwnerAddressInput } from "./OwnerAddressInput";
7
+ export { buildSubnameRequest } from "./requestBuilder";
8
+ export type { SubnameRequest } from "./requestBuilder";
9
+ export { useOwnerValidation } from "./useSubnameValidation";
10
+ export { useSubnameChecker } from "./useSubnameChecker";
@@ -0,0 +1,17 @@
1
+ import { EnsRecords } from "@/types";
2
+ import { ChainName } from "@thenamespace/offchain-manager";
3
+ export interface SubnameRequest {
4
+ addresses: Array<{
5
+ chain: ChainName;
6
+ value: string;
7
+ }>;
8
+ texts: Array<{
9
+ key: string;
10
+ value: string;
11
+ }>;
12
+ owner?: string;
13
+ }
14
+ /**
15
+ * Convert EnsRecords to the format required by offchain-manager API
16
+ */
17
+ export declare const buildSubnameRequest: (ensRecords: EnsRecords, ownerAddress?: string) => SubnameRequest;
@@ -0,0 +1,17 @@
1
+ import { EnsRecords } from "@/types";
2
+ import { OffchainClient } from "@thenamespace/offchain-manager";
3
+ interface SubnameCheckResult {
4
+ exists: boolean;
5
+ records?: EnsRecords;
6
+ owner?: string;
7
+ }
8
+ /**
9
+ * Hook for checking if subname exists and fetching its data
10
+ */
11
+ export declare const useSubnameChecker: (client: OffchainClient, parentName: string) => {
12
+ isLoadingSubname: boolean;
13
+ error: string | null;
14
+ setError: import("react").Dispatch<import("react").SetStateAction<string | null>>;
15
+ checkSubname: (label: string) => Promise<SubnameCheckResult>;
16
+ };
17
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Hook for validating owner address
3
+ */
4
+ export declare const useOwnerValidation: () => {
5
+ ownerAddressError: string | null;
6
+ validateOwnerAddress: (address: string) => boolean;
7
+ clearError: () => void;
8
+ };
@@ -0,0 +1,11 @@
1
+ import { EnsRecords } from "@/types";
2
+ import { SubnameDTO, ChainName } from "@thenamespace/offchain-manager";
3
+ /**
4
+ * Map coinType to ChainName
5
+ * This reverses the getCoinType() function
6
+ */
7
+ export declare const coinTypeToChainName: (_coinType: number) => ChainName | null;
8
+ /**
9
+ * Convert offchain manager SubnameDTO to EnsRecords format
10
+ */
11
+ export declare const offchainRecordsToEnsRecords: (subname: SubnameDTO) => EnsRecords;
@@ -3,3 +3,4 @@ export * from "./useWaitTransaction";
3
3
  export * from "./useENSResolver";
4
4
  export * from "./useMintManager";
5
5
  export * from "./useMintSubname";
6
+ export * from "./useOffchainManager";
@@ -0,0 +1 @@
1
+ export declare const useOffchainManager: (name: string, apiKeyOrToken: string, isTestnet?: boolean) => import("@thenamespace/offchain-manager").OffchainClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thenamespace/ens-components",
3
- "version": "0.28.0",
3
+ "version": "0.30.0",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -102,9 +102,9 @@
102
102
  "@ensdomains/content-hash": "^3.1.0-rc.1",
103
103
  "@namespacesdk/addresses": "^1.0.15",
104
104
  "@namespacesdk/indexer": "^1.0.1",
105
- "@namespacesdk/mint-manager": "^1.0.15",
106
105
  "@thenamespace/addresses": "^1.1.0",
107
106
  "@thenamespace/mint-manager": "^1.1.1",
107
+ "@thenamespace/offchain-manager": "^1.0.10",
108
108
  "lodash": "^4.17.21",
109
109
  "lucide-react": ">=0.525.0",
110
110
  "react-confetti": "^6.4.0"