@thenamespace/ens-components 0.9.0 → 0.10.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 +316 -109
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +19157 -7819
- package/dist/index.js +129408 -2911
- package/dist/index.js.map +1 -1
- package/dist/types/backend/index.d.ts +1 -0
- package/dist/types/backend/list-manager/index.d.ts +57 -0
- package/dist/types/components/ens-names-registrar-component/ENSNamesRegistrarComponent.d.ts +17 -0
- package/dist/types/components/{ens-names-register-component → ens-names-registrar-component}/sub-components/CostSummary.d.ts +3 -1
- package/dist/types/components/ens-names-registrar-component/sub-components/Header.d.ts +8 -0
- package/dist/types/components/{ens-names-register-component → ens-names-registrar-component}/sub-components/NameSearch.d.ts +4 -1
- package/dist/types/components/{ens-names-register-component → ens-names-registrar-component}/sub-components/RegistrationForm.d.ts +8 -1
- package/dist/types/components/ens-names-registrar-component/sub-components/RegistrationProcess.d.ts +10 -0
- package/dist/types/components/index.d.ts +3 -3
- package/dist/types/components/{ens-offchain-register-modal/EnsOffChainRegisterModal.d.ts → subname-offchain-registrar-modal/SubnameOffChainRegistrarModal.d.ts} +3 -3
- package/dist/types/components/{ens-onchain-register-modal/EnsOnChainRegisterModal.d.ts → subname-onchain-registrar-modal/SubnameOnChainRegistrarModal.d.ts} +3 -3
- package/dist/types/components/{ens-onchain-register-modal → subname-onchain-registrar-modal}/sub-components/RegistrationStep.d.ts +1 -2
- package/dist/types/constants/records/addressConstants.d.ts +12 -0
- package/dist/types/context/account-context.d.ts +44 -0
- package/dist/types/context/account-filter-context.d.ts +32 -0
- package/dist/types/context/auth-context.d.ts +22 -0
- package/dist/types/context/crop-image-context.d.ts +27 -0
- package/dist/types/context/current-user-context.d.ts +19 -0
- package/dist/types/context/edit-profile-context.d.ts +13 -0
- package/dist/types/context/ens-profile-context.d.ts +54 -0
- package/dist/types/context/index.d.ts +6 -0
- package/dist/types/context/listing-form-context.d.ts +55 -0
- package/dist/types/context/listing-status-context.d.ts +19 -0
- package/dist/types/context/mint-subname-context.d.ts +12 -0
- package/dist/types/environment/index.d.ts +9 -0
- package/dist/types/hooks/efp/use-efp.d.ts +11 -0
- package/dist/types/hooks/ens/ens-local-cache.d.ts +18 -0
- package/dist/types/hooks/ens/use-ens-client.d.ts +763 -0
- package/dist/types/hooks/ens/use-ens-contract-address.d.ts +1 -0
- package/dist/types/hooks/ens/use-ens-name-profile.d.ts +15 -0
- package/dist/types/hooks/ens/use-ens.d.ts +21 -0
- package/dist/types/hooks/ens/use-eth-registrar-controller.d.ts +21 -0
- package/dist/types/hooks/ens/use-name-wrapper.d.ts +6 -0
- package/dist/types/hooks/ens/use-owned-ens-names.d.ts +9 -0
- package/dist/types/hooks/index.d.ts +24 -1
- package/dist/types/hooks/namespace/use-burn-l2-subname.d.ts +4 -0
- package/dist/types/hooks/namespace/use-hybrid-resolver.d.ts +10 -0
- package/dist/types/hooks/namespace/use-l2-controller.d.ts +8 -0
- package/dist/types/hooks/namespace/use-listing-manager.d.ts +2 -0
- package/dist/types/hooks/namespace/use-mint-client.d.ts +2 -0
- package/dist/types/hooks/namespace/use-mintable-listings.d.ts +7 -0
- package/dist/types/hooks/namespace/use-name-listings.d.ts +1 -0
- package/dist/types/hooks/namespace/use-namespace-account.d.ts +25 -0
- package/dist/types/hooks/namespace/use-namespace-indexer.d.ts +7 -0
- package/dist/types/hooks/namespace/use-re-render-image.d.ts +1 -0
- package/dist/types/hooks/namespace/use-trading-stats.d.ts +1 -0
- package/dist/types/hooks/upload-image/use-upload-image.d.ts +8 -0
- package/dist/types/hooks/use-error-modal.d.ts +4 -0
- package/dist/types/hooks/use-screen-size.d.ts +5 -0
- package/dist/types/hooks/useWeb3Clients.d.ts +30 -30
- package/dist/types/hooks/web3/alchemy-sdk-no-ssr.d.ts +0 -0
- package/dist/types/hooks/web3/use-alchemy-sdk.d.ts +4 -0
- package/dist/types/hooks/web3/use-block-explorer.d.ts +2 -0
- package/dist/types/hooks/web3/use-blockexplorer-url.d.ts +2 -0
- package/dist/types/hooks/web3/use-contract-addresses.d.ts +1 -0
- package/dist/types/hooks/web3/use-l1-name-minter.d.ts +5 -0
- package/dist/types/hooks/web3/use-main-chain.d.ts +10 -0
- package/dist/types/hooks/web3/use-main-public-client.d.ts +3624 -0
- package/dist/types/hooks/web3/use-name-resolver.d.ts +24 -0
- package/dist/types/hooks/web3/use-name-wrapper.d.ts +3 -0
- package/dist/types/hooks/web3/use-wait-for-transaction.d.ts +8 -0
- package/dist/types/hooks/web3/use-web3-clients.d.ts +8042 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types/auth.d.ts +8 -0
- package/dist/types/types/ens.d.ts +61 -0
- package/dist/types/types/errors.d.ts +2 -0
- package/dist/types/types/hybrid-resolver.d.ts +4 -0
- package/dist/types/types/index.d.ts +10 -0
- package/dist/types/types/indexer.d.ts +27 -0
- package/dist/types/types/l2.d.ts +34 -0
- package/dist/types/types/list-manager.d.ts +179 -0
- package/dist/types/types/listing.d.ts +136 -0
- package/dist/types/types/minting.d.ts +75 -0
- package/dist/types/types/name-listing/enums.d.ts +20 -0
- package/dist/types/types/name-listing/index.d.ts +3 -0
- package/dist/types/types/name-listing/l2-name-registry.d.ts +13 -0
- package/dist/types/types/name-listing/listing.d.ts +73 -0
- package/dist/types/types/networks.d.ts +16 -0
- package/dist/types/utils/ens.d.ts +3 -0
- package/dist/types/utils/image-event-emitter.d.ts +8 -0
- package/dist/types/utils/models.d.ts +24 -0
- package/dist/types/web3/abis/index.d.ts +300 -0
- package/dist/types/web3/chains.d.ts +12 -0
- package/dist/types/web3/contracts/addresses.d.ts +4 -0
- package/dist/types/web3/efp-provider.d.ts +2 -0
- package/dist/types/web3/index.d.ts +5 -0
- package/dist/types/web3/providers.d.ts +3 -0
- package/dist/types/web3/wallet-connect.d.ts +2 -0
- package/package.json +13 -3
- package/dist/types/components/ens-names-register-component/ENSNamesRegisterComponent.d.ts +0 -17
- package/dist/types/components/ens-names-register-component/sub-components/Header.d.ts +0 -7
- package/dist/types/components/ens-names-register-component/sub-components/RegistrationProcess.d.ts +0 -17
- /package/dist/types/components/{ens-names-register-component → ens-names-registrar-component}/sub-components/ProgressBar.d.ts +0 -0
- /package/dist/types/components/{ens-names-register-component → ens-names-registrar-component}/sub-components/StepItem.d.ts +0 -0
- /package/dist/types/components/{ens-names-register-component → ens-names-registrar-component}/sub-components/SuccessScreen.d.ts +0 -0
- /package/dist/types/components/{ens-names-register-component → ens-names-registrar-component}/sub-components/Timer.d.ts +0 -0
- /package/dist/types/components/{ens-offchain-register-modal → subname-offchain-registrar-modal}/sub-components/InitialStep.d.ts +0 -0
- /package/dist/types/components/{ens-offchain-register-modal → subname-offchain-registrar-modal}/sub-components/OffchainRegistrationProcess.d.ts +0 -0
- /package/dist/types/components/{ens-offchain-register-modal → subname-offchain-registrar-modal}/sub-components/OffchainSuccessScreen.d.ts +0 -0
- /package/dist/types/components/{ens-onchain-register-modal → subname-onchain-registrar-modal}/sub-components/ConfirmationStep.d.ts +0 -0
- /package/dist/types/components/{ens-onchain-register-modal → subname-onchain-registrar-modal}/sub-components/InitialStep.d.ts +0 -0
- /package/dist/types/components/{ens-onchain-register-modal → subname-onchain-registrar-modal}/sub-components/OnchainSuccessScreen.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./list-manager";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { SupportedNetwork } from "@/types";
|
|
2
|
+
import { CreateListingRequest, GetRegistryParametersRequest, GetRegistryParametersResponse, ListingNetwork, ListingStatusDTO, ListingSuggestion, ListingSuggestionRequest, NamespaceListing } from "@/types/list-manager";
|
|
3
|
+
import { Address } from "viem";
|
|
4
|
+
export interface GetListedNamesQuery {
|
|
5
|
+
owner?: Address;
|
|
6
|
+
isVerified?: boolean;
|
|
7
|
+
page: number;
|
|
8
|
+
size: number;
|
|
9
|
+
nameNetwork: ListingNetwork;
|
|
10
|
+
}
|
|
11
|
+
interface PageResponse<T> {
|
|
12
|
+
totalItems: number;
|
|
13
|
+
page: number;
|
|
14
|
+
size: number;
|
|
15
|
+
items: T[];
|
|
16
|
+
}
|
|
17
|
+
export interface WidgetConfiguration {
|
|
18
|
+
widgetType: string;
|
|
19
|
+
widgetId: string;
|
|
20
|
+
widgetOwner: string;
|
|
21
|
+
logo?: string;
|
|
22
|
+
selectedNames: string[];
|
|
23
|
+
showRegisterEns: boolean;
|
|
24
|
+
name: string;
|
|
25
|
+
}
|
|
26
|
+
export interface CreateWidgetRequest {
|
|
27
|
+
widgetType: string;
|
|
28
|
+
name: string;
|
|
29
|
+
selectedNames?: string[];
|
|
30
|
+
logo?: string;
|
|
31
|
+
showRegisterEns: boolean;
|
|
32
|
+
widgetId?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare class ListManagerClient {
|
|
35
|
+
private readonly backendURI;
|
|
36
|
+
private httpClient;
|
|
37
|
+
constructor(backendURI: string);
|
|
38
|
+
getListedName(ensName: string): Promise<NamespaceListing>;
|
|
39
|
+
deleteListing(ensName: string, network: SupportedNetwork, siweToken: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
40
|
+
getListedNames(query: GetListedNamesQuery): Promise<PageResponse<NamespaceListing>>;
|
|
41
|
+
verifyListing(name: string, nameNetwork: SupportedNetwork): Promise<boolean>;
|
|
42
|
+
getListingStatus(name: string, network: SupportedNetwork, refreshCache?: boolean): Promise<ListingStatusDTO>;
|
|
43
|
+
getListingSuggestions(request: ListingSuggestionRequest): Promise<PageResponse<ListingSuggestion>>;
|
|
44
|
+
waitForVerificationStatus(name: string, retries?: number, waitSeconds?: number): Promise<boolean>;
|
|
45
|
+
private waitForSeconds;
|
|
46
|
+
getRegistryDeploymentParameters(request: GetRegistryParametersRequest, siweToken: string): Promise<GetRegistryParametersResponse>;
|
|
47
|
+
toListingNetwork(network: SupportedNetwork): ListingNetwork;
|
|
48
|
+
createListing(request: CreateListingRequest, siweToken: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
49
|
+
updateListing(request: CreateListingRequest, siweToken: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
50
|
+
private getSiweHeaders;
|
|
51
|
+
getOwnedWidgets(owner: Address): Promise<WidgetConfiguration[]>;
|
|
52
|
+
createWidget(request: CreateWidgetRequest, siweToken: string): Promise<string>;
|
|
53
|
+
updateWidget(widgetId: string, request: CreateWidgetRequest, siweToken: string): Promise<any>;
|
|
54
|
+
deleteWidget(widgetId: string, siweToken: string): Promise<any>;
|
|
55
|
+
}
|
|
56
|
+
export declare const createListingManagerClient: (backendUri: string) => ListManagerClient;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./ENSNamesRegistrarComponent.css";
|
|
2
|
+
export interface ENSNamesRegistrarComponentProps {
|
|
3
|
+
name?: string;
|
|
4
|
+
duration?: number;
|
|
5
|
+
onNameChange?: (name: string) => void;
|
|
6
|
+
onDurationChange?: (duration: number) => void;
|
|
7
|
+
onBack?: () => void;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
onNext?: () => void;
|
|
10
|
+
onCompleteProfile?: () => void;
|
|
11
|
+
onOpenWallet?: () => void;
|
|
12
|
+
onCompleteRegistration?: () => void;
|
|
13
|
+
onRegisterAnother?: () => void;
|
|
14
|
+
onViewName?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function ENSNamesRegistrarComponent({ name, duration: initialDuration, onNameChange, onDurationChange, onBack, onClose, onNext, onCompleteProfile, onOpenWallet, onCompleteRegistration, onRegisterAnother, onViewName, }: ENSNamesRegistrarComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default ENSNamesRegistrarComponent;
|
|
@@ -5,6 +5,8 @@ interface CostSummaryProps {
|
|
|
5
5
|
total: number;
|
|
6
6
|
showExpiry?: boolean;
|
|
7
7
|
expiryDate?: string;
|
|
8
|
+
isLoading?: boolean;
|
|
9
|
+
priceError?: string | null;
|
|
8
10
|
}
|
|
9
|
-
export declare function CostSummary({ duration, registrationCost, networkFee, total, showExpiry, expiryDate, }: CostSummaryProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function CostSummary({ duration, registrationCost, networkFee, total, showExpiry, expiryDate, isLoading, priceError, }: CostSummaryProps): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -4,6 +4,9 @@ interface NameSearchProps {
|
|
|
4
4
|
onBack?: () => void;
|
|
5
5
|
onClose?: () => void;
|
|
6
6
|
onNext: () => void;
|
|
7
|
+
isChecking?: boolean;
|
|
8
|
+
isAvailable?: boolean;
|
|
9
|
+
isTaken?: boolean;
|
|
7
10
|
}
|
|
8
|
-
export declare function NameSearch({ ensName, onNameChange, onBack, onClose, onNext, }: NameSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function NameSearch({ ensName, onNameChange, onBack, onClose, onNext, isChecking, isAvailable, isTaken, }: NameSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
9
12
|
export {};
|
|
@@ -10,6 +10,13 @@ interface RegistrationFormProps {
|
|
|
10
10
|
onClose?: () => void;
|
|
11
11
|
onNext: () => void;
|
|
12
12
|
onCompleteProfile?: () => void;
|
|
13
|
+
isLoadingPrice?: boolean;
|
|
14
|
+
priceError?: string | null;
|
|
15
|
+
nameAvailability?: {
|
|
16
|
+
isAvailable: boolean;
|
|
17
|
+
isChecking: boolean;
|
|
18
|
+
};
|
|
19
|
+
canProceed?: boolean;
|
|
13
20
|
}
|
|
14
|
-
export declare function RegistrationForm({ ensName, duration, registrationCost, networkFee, total, onNameChange, onDurationChange, onBack, onClose, onNext, onCompleteProfile, }: RegistrationFormProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function RegistrationForm({ ensName, duration, registrationCost, networkFee, total, onNameChange, onDurationChange, onBack, onClose, onNext, onCompleteProfile, isLoadingPrice, priceError, nameAvailability, canProceed, }: RegistrationFormProps): import("react/jsx-runtime").JSX.Element;
|
|
15
22
|
export {};
|
package/dist/types/components/ens-names-registrar-component/sub-components/RegistrationProcess.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EnsRegistrationContext } from "@/hooks";
|
|
2
|
+
interface RegistrationProcessProps {
|
|
3
|
+
registrations: EnsRegistrationContext[];
|
|
4
|
+
onBack: () => void;
|
|
5
|
+
onClose?: () => void;
|
|
6
|
+
onCompleteProfile?: () => void;
|
|
7
|
+
onRegistrationComplete?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function RegistrationProcess({ registrations, onBack, onClose, onCompleteProfile, onRegistrationComplete, }: RegistrationProcessProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -3,8 +3,8 @@ export { PendingTransaction, TransactionState, } from "./pending-transaction/Pen
|
|
|
3
3
|
export { ENSNameCard } from "./ens-names-card/EnsNameCard";
|
|
4
4
|
export { ProfileCard } from "./ens-profile-card/ProfileCard";
|
|
5
5
|
export { NavbarProfileCard } from "./ens-navbar-profile-card/NavbarProfileCard";
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
6
|
+
export { SubnameOnChainRegistrarModal } from "./subname-onchain-registrar-modal/SubnameOnChainRegistrarModal";
|
|
7
|
+
export { SubnameOffChainRegistrarModal } from "./subname-offchain-registrar-modal/SubnameOffChainRegistrarModal";
|
|
8
|
+
export { ENSNamesRegistrarComponent } from "./ens-names-registrar-component/ENSNamesRegistrarComponent";
|
|
9
9
|
export * from "./atoms";
|
|
10
10
|
export * from "./molecules";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
export interface
|
|
1
|
+
import "./SubnameOffChainRegistrarModal.css";
|
|
2
|
+
export interface SubnameOffChainRegistrarModalProps {
|
|
3
3
|
step?: number;
|
|
4
4
|
name?: string;
|
|
5
5
|
profileComplete?: boolean;
|
|
@@ -15,4 +15,4 @@ export interface EnsOffChainRegisterModalProps {
|
|
|
15
15
|
onRegisterAnother?: () => void;
|
|
16
16
|
onViewName?: () => void;
|
|
17
17
|
}
|
|
18
|
-
export declare function
|
|
18
|
+
export declare function SubnameOffChainRegistrarModal({ step: initialStep, name: initialName, profileComplete, onStepChange, onNameChange, onProfileCompleteChange, onRegister, onCancel, onClose, onCompleteProfile, onOpenWallet, onCompleteRegistration, onRegisterAnother, onViewName, }: SubnameOffChainRegistrarModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
export interface
|
|
1
|
+
import "./SubnameOnChainRegistrarModal.css";
|
|
2
|
+
export interface SubnameOnChainRegistrarModalProps {
|
|
3
3
|
step?: number;
|
|
4
4
|
name?: string;
|
|
5
5
|
profileComplete?: boolean;
|
|
@@ -27,4 +27,4 @@ export interface EnsOnChainRegisterModalProps {
|
|
|
27
27
|
onViewName?: () => void;
|
|
28
28
|
onFinish?: () => void;
|
|
29
29
|
}
|
|
30
|
-
export declare function
|
|
30
|
+
export declare function SubnameOnChainRegistrarModal({ step: initialStep, name: initialName, profileComplete, domainSuffix, owner: initialOwner, duration: initialDuration, registrationFee, networkFee, totalCost, useAsPrimary: initialUseAsPrimary, profileImageUrl, onStepChange, onNameChange, onProfileCompleteChange, onOwnerChange, onDurationChange, onUseAsPrimaryChange, onRegister, onCancel, onClose, onCompleteProfile, onOpenWallet, onCompleteRegistration, onRegisterAnother, onViewName, onFinish, }: SubnameOnChainRegistrarModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,11 +12,10 @@ export interface RegistrationStepProps {
|
|
|
12
12
|
onBack?: () => void;
|
|
13
13
|
onCancel?: () => void;
|
|
14
14
|
onRegister?: () => void;
|
|
15
|
-
onNext?: () => void;
|
|
16
15
|
onClose?: () => void;
|
|
17
16
|
onOwnerChange?: (owner: string) => void;
|
|
18
17
|
onDurationChange?: (duration: number) => void;
|
|
19
18
|
onUseAsPrimaryChange?: (useAsPrimary: boolean) => void;
|
|
20
19
|
onCompleteProfile?: () => void;
|
|
21
20
|
}
|
|
22
|
-
export declare function RegistrationStep({ name, domainSuffix, owner, duration: initialDuration, registrationFee, networkFee, totalCost, useAsPrimary: initialUseAsPrimary, profileComplete, profileImageUrl, onBack, onCancel, onRegister,
|
|
21
|
+
export declare function RegistrationStep({ name, domainSuffix, owner, duration: initialDuration, registrationFee, networkFee, totalCost, useAsPrimary: initialUseAsPrimary, profileComplete, profileImageUrl, onBack, onCancel, onRegister, onClose, onOwnerChange, onDurationChange, onUseAsPrimaryChange, onCompleteProfile, }: RegistrationStepProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChainName } from "@/types";
|
|
2
|
+
import { IconName } from "@/components";
|
|
2
3
|
export interface SupportedEnsAddress {
|
|
3
4
|
validateFunc?: (value: string) => boolean;
|
|
4
5
|
isEMV?: boolean;
|
|
@@ -12,3 +13,14 @@ export declare const supportedAddresses: SupportedEnsAddress[];
|
|
|
12
13
|
export declare const getSupportedAddressMap: () => Record<number, SupportedEnsAddress>;
|
|
13
14
|
export declare const getSupportedAddressByCoin: (coin: number) => SupportedEnsAddress | undefined;
|
|
14
15
|
export declare const getSupportedAddressByName: (name: ChainName) => SupportedEnsAddress | undefined;
|
|
16
|
+
export type TextCategory = "profile" | "social";
|
|
17
|
+
export interface SupportedText {
|
|
18
|
+
iconUrl: string;
|
|
19
|
+
key: string;
|
|
20
|
+
category: TextCategory;
|
|
21
|
+
label: string;
|
|
22
|
+
placeholder: string;
|
|
23
|
+
iconName?: IconName;
|
|
24
|
+
hidden?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const SupportedTexts: SupportedText[];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { EnsName, GenericMintedName } from "@/types";
|
|
2
|
+
import { NamespaceListing } from "@/types/list-manager";
|
|
3
|
+
import { L2SubnameResponse } from "@namespacesdk/indexer";
|
|
4
|
+
import { PropsWithChildren } from "react";
|
|
5
|
+
import { Address } from "viem";
|
|
6
|
+
interface ISelectNameState {
|
|
7
|
+
selectedName?: string;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface IEnsNamesState {
|
|
11
|
+
ensNames: EnsName[];
|
|
12
|
+
subnames: GenericMintedName[];
|
|
13
|
+
isLoading: boolean;
|
|
14
|
+
isError: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface IListedNamesState {
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
isError: boolean;
|
|
19
|
+
items: NamespaceListing[];
|
|
20
|
+
}
|
|
21
|
+
interface IAccountContext {
|
|
22
|
+
listModalOpen: boolean;
|
|
23
|
+
selectedName?: string;
|
|
24
|
+
accountOwner: Address;
|
|
25
|
+
namesState: IEnsNamesState;
|
|
26
|
+
listingState: IListedNamesState;
|
|
27
|
+
selectNameState: ISelectNameState;
|
|
28
|
+
updateSelectNameState: (state: ISelectNameState) => void;
|
|
29
|
+
toggleListModal: (open: boolean, ensName: string) => void;
|
|
30
|
+
setApprovalGiven: (value: boolean) => void;
|
|
31
|
+
handleRemoveListing: (name: string) => void;
|
|
32
|
+
contextWrapped: boolean;
|
|
33
|
+
handleListingCreated: (ensName: string, verified: boolean) => void;
|
|
34
|
+
handleListingVerified: (ensName: string) => void;
|
|
35
|
+
}
|
|
36
|
+
interface AccountContextProps extends PropsWithChildren {
|
|
37
|
+
accountOwner: Address;
|
|
38
|
+
isConnectedUserAccount?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export declare const AccountContextProvider: ({ accountOwner, children, isConnectedUserAccount, }: AccountContextProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare const useAccountContext: () => IAccountContext;
|
|
42
|
+
export declare const addL2SubnameToGenericNames: (items: L2SubnameResponse[], arr: GenericMintedName[]) => void;
|
|
43
|
+
export declare const addL1SubnameToGenericName: (items: EnsName[], arr: GenericMintedName[]) => void;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SupportedChainName } from "@/types";
|
|
2
|
+
import { Dispatch, ReactNode, SetStateAction } from "react";
|
|
3
|
+
export type NetworksLabels = "Base" | "Base Sepolia" | "Ethereum Mainnet" | "Optimism" | "Ethereum Sepolia";
|
|
4
|
+
export type NetworksIcon = "base" | "mainnet" | "op" | "eth";
|
|
5
|
+
export type NetworksOptionsType = Partial<Record<SupportedChainName, {
|
|
6
|
+
icon: NetworksIcon;
|
|
7
|
+
label: NetworksLabels;
|
|
8
|
+
}>>;
|
|
9
|
+
export declare const networks: NetworksOptionsType;
|
|
10
|
+
export type NetworksFilterOptions = {
|
|
11
|
+
label: NetworksLabels;
|
|
12
|
+
icon: NetworksIcon;
|
|
13
|
+
};
|
|
14
|
+
type NetworkFilter = Partial<Record<SupportedChainName, NetworksFilterOptions>>;
|
|
15
|
+
type AccountFilterContextType = {
|
|
16
|
+
searchString: string;
|
|
17
|
+
setSearchString: Dispatch<SetStateAction<string>>;
|
|
18
|
+
networksFilterOptions: NetworkFilter;
|
|
19
|
+
setNetworksFilterOptions: Dispatch<SetStateAction<{}>>;
|
|
20
|
+
selectedNetworks: SupportedChainName[];
|
|
21
|
+
setSelectedNetworks: Dispatch<SetStateAction<SupportedChainName[]>>;
|
|
22
|
+
alphabetOrder: "alphabetAsc" | "alphabetDesc" | null;
|
|
23
|
+
setAlphabetOrder: Dispatch<SetStateAction<"alphabetAsc" | "alphabetDesc" | null>>;
|
|
24
|
+
view: "grid" | "list";
|
|
25
|
+
setView: Dispatch<SetStateAction<"grid" | "list">>;
|
|
26
|
+
};
|
|
27
|
+
type AccountFilterProviderProps = {
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
};
|
|
30
|
+
export declare const AccountFilterProvider: React.FC<AccountFilterProviderProps>;
|
|
31
|
+
export declare const useAccountFilterContext: () => AccountFilterContextType;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Address } from "viem";
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
3
|
+
export interface AccessTokens {
|
|
4
|
+
accessToken: string;
|
|
5
|
+
refreshToken: string;
|
|
6
|
+
}
|
|
7
|
+
interface IAuthContext {
|
|
8
|
+
isAuthenticated: boolean;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
tokens: Record<Address, AccessTokens>;
|
|
11
|
+
siweTokens: Record<Address, string>;
|
|
12
|
+
authenticate?: () => void;
|
|
13
|
+
checkAuthenticationForAddr?: (principal: Address) => Promise<boolean>;
|
|
14
|
+
getAccessToken?: (principal: Address) => Promise<string>;
|
|
15
|
+
denyAuth?: (principal: Address) => void;
|
|
16
|
+
getSiweToken?: (principal: Address) => void;
|
|
17
|
+
hasValidSiweToken?: (principal: Address) => boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const AUTH_TOKEN_KEY = "auth-tokens";
|
|
20
|
+
export declare const useAuthContext: () => IAuthContext;
|
|
21
|
+
export declare const AuthContextProvider: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Dispatch, ReactNode, SetStateAction } from "react";
|
|
2
|
+
import { Area } from "react-easy-crop";
|
|
3
|
+
export type CropImgContextType = {
|
|
4
|
+
newImgSrc: string;
|
|
5
|
+
setNewImgSrc: Dispatch<SetStateAction<string>>;
|
|
6
|
+
newCroppedImgSrc: string;
|
|
7
|
+
setNewCroppedImgSrc: Dispatch<SetStateAction<string>>;
|
|
8
|
+
croppedAreaPixels: Area;
|
|
9
|
+
setCroppedAreaPixels: Dispatch<SetStateAction<Area>>;
|
|
10
|
+
processingImg: boolean;
|
|
11
|
+
setProcessingImg: Dispatch<SetStateAction<boolean>>;
|
|
12
|
+
uploadedImgSrc: string;
|
|
13
|
+
setUploadedImgSrc: Dispatch<SetStateAction<string>>;
|
|
14
|
+
imageCategory: "avatar" | "header" | null;
|
|
15
|
+
setImageCategory: Dispatch<SetStateAction<"avatar" | "header" | null>>;
|
|
16
|
+
hideCoverUpload: boolean;
|
|
17
|
+
setHideCoverUpload: Dispatch<SetStateAction<boolean>>;
|
|
18
|
+
disableUploads: boolean;
|
|
19
|
+
setDisableUploads: Dispatch<SetStateAction<boolean>>;
|
|
20
|
+
};
|
|
21
|
+
export declare const CropImgContext: import("react").Context<CropImgContextType>;
|
|
22
|
+
type CropImgContextProps = {
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
};
|
|
25
|
+
export declare const CropImgProvider: React.FC<CropImgContextProps>;
|
|
26
|
+
export declare const useCropImgContext: () => CropImgContextType;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { Address, Chain } from "viem";
|
|
3
|
+
import { EnsRecords, IEnsNameFullProfile } from "@/types";
|
|
4
|
+
interface IConnectedAccountContext {
|
|
5
|
+
connectedAddress?: Address;
|
|
6
|
+
isConnected: boolean;
|
|
7
|
+
isAuthenticated: boolean;
|
|
8
|
+
chain?: Chain;
|
|
9
|
+
primaryName: {
|
|
10
|
+
isFetching: boolean;
|
|
11
|
+
isError?: boolean;
|
|
12
|
+
isPresent: boolean;
|
|
13
|
+
data?: IEnsNameFullProfile;
|
|
14
|
+
};
|
|
15
|
+
handleRecordsUpdated?: (records: EnsRecords) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const ConnectedPrincipalProvider: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const useConnectedPrincipal: () => IConnectedAccountContext;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Dispatch, ReactNode, SetStateAction } from "react";
|
|
2
|
+
export type EditProfileStepsType = ["profile", "crop-image", "upload-image"];
|
|
3
|
+
export type EditProfileContextType = {
|
|
4
|
+
step: "profile" | "crop-image" | "upload-image";
|
|
5
|
+
setStep: Dispatch<SetStateAction<"profile" | "crop-image" | "upload-image">>;
|
|
6
|
+
};
|
|
7
|
+
export declare const EditProfileContext: import("react").Context<EditProfileContextType>;
|
|
8
|
+
type EditProfileProviderProps = {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare const EditProfileProvider: React.FC<EditProfileProviderProps>;
|
|
12
|
+
export declare const useEditProfileContext: () => EditProfileContextType;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { EnsNameOwner, EnsRecords, EnsRecordsDecoded, GenericMintedName, Layer2Network } from "@/types";
|
|
2
|
+
import { NamespaceListing } from "@/types/list-manager";
|
|
3
|
+
import { ReactElement } from "react";
|
|
4
|
+
import { Address } from "viem";
|
|
5
|
+
export interface SubnamesFilter {
|
|
6
|
+
view: "grid" | "list";
|
|
7
|
+
searchString: string;
|
|
8
|
+
}
|
|
9
|
+
export interface NameProfileStats {
|
|
10
|
+
subnamesMinted: number;
|
|
11
|
+
totalSubnames: number;
|
|
12
|
+
totalVolume: number;
|
|
13
|
+
totalProfit: number;
|
|
14
|
+
}
|
|
15
|
+
interface EnsProfileState {
|
|
16
|
+
ensName: string;
|
|
17
|
+
ensRecords: EnsRecordsDecoded;
|
|
18
|
+
ownership: EnsNameOwner;
|
|
19
|
+
isFetching: boolean;
|
|
20
|
+
subnames: GenericMintedName[];
|
|
21
|
+
resolver: Address;
|
|
22
|
+
expiryUnix: number;
|
|
23
|
+
isL2: boolean;
|
|
24
|
+
listing: {
|
|
25
|
+
isListed: boolean;
|
|
26
|
+
listingData?: NamespaceListing;
|
|
27
|
+
isFetching: boolean;
|
|
28
|
+
};
|
|
29
|
+
stats: {
|
|
30
|
+
isLoading: boolean;
|
|
31
|
+
data: NameProfileStats;
|
|
32
|
+
};
|
|
33
|
+
isError?: boolean;
|
|
34
|
+
l2Metadata?: {
|
|
35
|
+
network: Layer2Network;
|
|
36
|
+
resolver: Address;
|
|
37
|
+
};
|
|
38
|
+
isListed: boolean;
|
|
39
|
+
}
|
|
40
|
+
interface EnsProfileContext extends EnsProfileState {
|
|
41
|
+
onRecordsUpdated?: (records: EnsRecords) => void;
|
|
42
|
+
onSubnameMinted?: (name: GenericMintedName) => void;
|
|
43
|
+
onL2SubnameBurned?: (subname: string | string[]) => void;
|
|
44
|
+
subnameFilter: SubnamesFilter;
|
|
45
|
+
onFilterChanged?: (filter: SubnamesFilter) => void;
|
|
46
|
+
}
|
|
47
|
+
export declare const EnsProfileContext: import("react").Context<EnsProfileContext>;
|
|
48
|
+
export declare const EnsProfileContextProvider: ({ ensName, children, isSubname }: {
|
|
49
|
+
ensName: string;
|
|
50
|
+
isSubname: boolean;
|
|
51
|
+
children: ReactElement;
|
|
52
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export declare const useEnsProfileContext: () => EnsProfileContext;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { L2Registry, ListingCurrency, ListingDeadline, ListingNetwork, ListingPrices, ListingType, ListingWhitelist, NamespaceListing, ReservedLabel, TokenGatedAccess } from "@/types/list-manager";
|
|
2
|
+
import { ReactElement } from "react";
|
|
3
|
+
import { Address } from "viem";
|
|
4
|
+
export interface IListingFormContent {
|
|
5
|
+
prices: ListingPrices;
|
|
6
|
+
whitelist?: ListingWhitelist;
|
|
7
|
+
tokenGatedAccess?: TokenGatedAccess;
|
|
8
|
+
deadline?: ListingDeadline;
|
|
9
|
+
currency: ListingCurrency;
|
|
10
|
+
reservations: ReservedLabel[];
|
|
11
|
+
listingType: ListingType;
|
|
12
|
+
}
|
|
13
|
+
export interface IListingFeatures {
|
|
14
|
+
whitelist: boolean;
|
|
15
|
+
deadline: boolean;
|
|
16
|
+
tokenGatedAccess: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare enum ListingInputGroups {
|
|
19
|
+
Setup = "Setup",
|
|
20
|
+
Prices = "Prices",
|
|
21
|
+
Reservations = "Reservations",
|
|
22
|
+
Deadline = "Deadline",
|
|
23
|
+
Whitelist = "Whitelist",
|
|
24
|
+
TokenGatedAccess = "TokenGatedAccess"
|
|
25
|
+
}
|
|
26
|
+
export interface IListingFormContext extends IListingFormContent {
|
|
27
|
+
setPrices?: (prices: ListingPrices) => void;
|
|
28
|
+
setCurrency?: (currency: ListingCurrency) => void;
|
|
29
|
+
setDeadline?: (deadline: ListingDeadline) => void;
|
|
30
|
+
removeDeadline?: () => void;
|
|
31
|
+
setWhitelist?: (whitelist: ListingWhitelist) => void;
|
|
32
|
+
setReservations?: (reservations: ReservedLabel[]) => void;
|
|
33
|
+
removeWhitelist?: () => void;
|
|
34
|
+
toggleFeature?: (feature: keyof IListingFeatures, toggle: boolean) => void;
|
|
35
|
+
setTokenGatedAccess?: (tga: TokenGatedAccess) => void;
|
|
36
|
+
setListingType?: (type: ListingType) => void;
|
|
37
|
+
setL2Registry?: (registry: Partial<L2Registry>) => void;
|
|
38
|
+
setPaymentWallet?: (val: Address) => void;
|
|
39
|
+
features: IListingFeatures;
|
|
40
|
+
existingListing?: NamespaceListing;
|
|
41
|
+
ensName: string;
|
|
42
|
+
isStateUpdated: boolean;
|
|
43
|
+
l2Registry?: Partial<L2Registry>;
|
|
44
|
+
paymentWallet: Address;
|
|
45
|
+
listingInputsValid: Record<ListingInputGroups, boolean>;
|
|
46
|
+
refetch: () => void;
|
|
47
|
+
}
|
|
48
|
+
export declare const ListingFormContextProvider: ({ ensName, children, selectedListingType, selectedL2Chain, }: {
|
|
49
|
+
ensName: string;
|
|
50
|
+
selectedListingType?: ListingType;
|
|
51
|
+
selectedL2Chain?: ListingNetwork;
|
|
52
|
+
children: ReactElement;
|
|
53
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare const useListingFormContext: () => IListingFormContext;
|
|
55
|
+
export declare const getListingCurrencyLabel: (currency: ListingCurrency) => "ETH" | "USD";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ListingStatusDTO } from "@/types/list-manager";
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
3
|
+
interface IListingStatusState {
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
isRefetching: boolean;
|
|
6
|
+
isError: boolean;
|
|
7
|
+
status: ListingStatusDTO;
|
|
8
|
+
}
|
|
9
|
+
interface IListingContext extends IListingStatusState {
|
|
10
|
+
refetch: () => void;
|
|
11
|
+
handleUnlist: () => void;
|
|
12
|
+
updateStatus: (status: Partial<ListingStatusDTO>) => void;
|
|
13
|
+
}
|
|
14
|
+
interface ListingStatusCtxProps extends PropsWithChildren {
|
|
15
|
+
ensName: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const ListingStatusContextProvider: ({ ensName, children, }: ListingStatusCtxProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const useListingStatusContext: () => IListingContext;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Dispatch, ReactNode, SetStateAction } from "react";
|
|
2
|
+
export type MintSubnameContextType = {
|
|
3
|
+
fullSubname: string | null;
|
|
4
|
+
setFullSubname: Dispatch<SetStateAction<string | null>>;
|
|
5
|
+
};
|
|
6
|
+
export declare const MintSubnameContext: import("react").Context<MintSubnameContextType>;
|
|
7
|
+
type MintSubnameProviderProps = {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export declare const MintSubnameProvider: React.FC<MintSubnameProviderProps>;
|
|
11
|
+
export declare const useMintSubnameContext: () => MintSubnameContextType;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Address } from "viem";
|
|
2
|
+
export interface EFPState {
|
|
3
|
+
isFetching: boolean;
|
|
4
|
+
isError: boolean;
|
|
5
|
+
followers: number;
|
|
6
|
+
following: number;
|
|
7
|
+
primaryList?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const useEFP: ({ ownerAddress }: {
|
|
10
|
+
ownerAddress: Address;
|
|
11
|
+
}) => EFPState;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EnsNameOwner, EnsTextRecord, EnsAddressRecord } from "@/types";
|
|
2
|
+
declare class EnsLocalCache {
|
|
3
|
+
constructor();
|
|
4
|
+
private ownershipCache;
|
|
5
|
+
private textsCache;
|
|
6
|
+
private addressesCache;
|
|
7
|
+
getCachedOwnership(ensName: string): EnsNameOwner | null;
|
|
8
|
+
getCachedTexts(ensName: string): EnsTextRecord[] | null;
|
|
9
|
+
getCachedAddrs(ensName: string): EnsAddressRecord[] | null;
|
|
10
|
+
cacheOwnership(ensName: string, ownership: EnsNameOwner): void;
|
|
11
|
+
cacheAddrs(ensName: string, addrs: EnsAddressRecord[]): void;
|
|
12
|
+
cacheTexts(ensName: string, texts: EnsTextRecord[]): void;
|
|
13
|
+
private isExpired;
|
|
14
|
+
private setToStorage;
|
|
15
|
+
private getFromStorage;
|
|
16
|
+
}
|
|
17
|
+
export declare const EnsCache: EnsLocalCache;
|
|
18
|
+
export {};
|