@thenamespace/ens-components 0.8.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.
Files changed (107) hide show
  1. package/dist/index.css +316 -109
  2. package/dist/index.css.map +1 -1
  3. package/dist/index.d.ts +19157 -7819
  4. package/dist/index.js +129408 -2911
  5. package/dist/index.js.map +1 -1
  6. package/dist/types/backend/index.d.ts +1 -0
  7. package/dist/types/backend/list-manager/index.d.ts +57 -0
  8. package/dist/types/components/ens-names-registrar-component/ENSNamesRegistrarComponent.d.ts +17 -0
  9. package/dist/types/components/{ens-names-register-component → ens-names-registrar-component}/sub-components/CostSummary.d.ts +3 -1
  10. package/dist/types/components/ens-names-registrar-component/sub-components/Header.d.ts +8 -0
  11. package/dist/types/components/{ens-names-register-component → ens-names-registrar-component}/sub-components/NameSearch.d.ts +4 -1
  12. package/dist/types/components/{ens-names-register-component → ens-names-registrar-component}/sub-components/RegistrationForm.d.ts +8 -1
  13. package/dist/types/components/ens-names-registrar-component/sub-components/RegistrationProcess.d.ts +10 -0
  14. package/dist/types/components/index.d.ts +3 -3
  15. package/dist/types/components/{ens-offchain-register-modal/EnsOffChainRegisterModal.d.ts → subname-offchain-registrar-modal/SubnameOffChainRegistrarModal.d.ts} +3 -3
  16. package/dist/types/components/{ens-onchain-register-modal/EnsOnChainRegisterModal.d.ts → subname-onchain-registrar-modal/SubnameOnChainRegistrarModal.d.ts} +3 -3
  17. package/dist/types/components/{ens-onchain-register-modal → subname-onchain-registrar-modal}/sub-components/RegistrationStep.d.ts +1 -2
  18. package/dist/types/constants/records/addressConstants.d.ts +12 -0
  19. package/dist/types/context/account-context.d.ts +44 -0
  20. package/dist/types/context/account-filter-context.d.ts +32 -0
  21. package/dist/types/context/auth-context.d.ts +22 -0
  22. package/dist/types/context/crop-image-context.d.ts +27 -0
  23. package/dist/types/context/current-user-context.d.ts +19 -0
  24. package/dist/types/context/edit-profile-context.d.ts +13 -0
  25. package/dist/types/context/ens-profile-context.d.ts +54 -0
  26. package/dist/types/context/index.d.ts +6 -0
  27. package/dist/types/context/listing-form-context.d.ts +55 -0
  28. package/dist/types/context/listing-status-context.d.ts +19 -0
  29. package/dist/types/context/mint-subname-context.d.ts +12 -0
  30. package/dist/types/environment/index.d.ts +9 -0
  31. package/dist/types/hooks/efp/use-efp.d.ts +11 -0
  32. package/dist/types/hooks/ens/ens-local-cache.d.ts +18 -0
  33. package/dist/types/hooks/ens/use-ens-client.d.ts +763 -0
  34. package/dist/types/hooks/ens/use-ens-contract-address.d.ts +1 -0
  35. package/dist/types/hooks/ens/use-ens-name-profile.d.ts +15 -0
  36. package/dist/types/hooks/ens/use-ens.d.ts +21 -0
  37. package/dist/types/hooks/ens/use-eth-registrar-controller.d.ts +21 -0
  38. package/dist/types/hooks/ens/use-name-wrapper.d.ts +6 -0
  39. package/dist/types/hooks/ens/use-owned-ens-names.d.ts +9 -0
  40. package/dist/types/hooks/index.d.ts +24 -1
  41. package/dist/types/hooks/namespace/use-burn-l2-subname.d.ts +4 -0
  42. package/dist/types/hooks/namespace/use-hybrid-resolver.d.ts +10 -0
  43. package/dist/types/hooks/namespace/use-l2-controller.d.ts +8 -0
  44. package/dist/types/hooks/namespace/use-listing-manager.d.ts +2 -0
  45. package/dist/types/hooks/namespace/use-mint-client.d.ts +2 -0
  46. package/dist/types/hooks/namespace/use-mintable-listings.d.ts +7 -0
  47. package/dist/types/hooks/namespace/use-name-listings.d.ts +1 -0
  48. package/dist/types/hooks/namespace/use-namespace-account.d.ts +25 -0
  49. package/dist/types/hooks/namespace/use-namespace-indexer.d.ts +7 -0
  50. package/dist/types/hooks/namespace/use-re-render-image.d.ts +1 -0
  51. package/dist/types/hooks/namespace/use-trading-stats.d.ts +1 -0
  52. package/dist/types/hooks/upload-image/use-upload-image.d.ts +8 -0
  53. package/dist/types/hooks/use-error-modal.d.ts +4 -0
  54. package/dist/types/hooks/use-screen-size.d.ts +5 -0
  55. package/dist/types/hooks/useWeb3Clients.d.ts +30 -30
  56. package/dist/types/hooks/web3/alchemy-sdk-no-ssr.d.ts +0 -0
  57. package/dist/types/hooks/web3/use-alchemy-sdk.d.ts +4 -0
  58. package/dist/types/hooks/web3/use-block-explorer.d.ts +2 -0
  59. package/dist/types/hooks/web3/use-blockexplorer-url.d.ts +2 -0
  60. package/dist/types/hooks/web3/use-contract-addresses.d.ts +1 -0
  61. package/dist/types/hooks/web3/use-l1-name-minter.d.ts +5 -0
  62. package/dist/types/hooks/web3/use-main-chain.d.ts +10 -0
  63. package/dist/types/hooks/web3/use-main-public-client.d.ts +3624 -0
  64. package/dist/types/hooks/web3/use-name-resolver.d.ts +24 -0
  65. package/dist/types/hooks/web3/use-name-wrapper.d.ts +3 -0
  66. package/dist/types/hooks/web3/use-wait-for-transaction.d.ts +8 -0
  67. package/dist/types/hooks/web3/use-web3-clients.d.ts +8042 -0
  68. package/dist/types/index.d.ts +1 -0
  69. package/dist/types/types/auth.d.ts +8 -0
  70. package/dist/types/types/ens.d.ts +61 -0
  71. package/dist/types/types/errors.d.ts +2 -0
  72. package/dist/types/types/hybrid-resolver.d.ts +4 -0
  73. package/dist/types/types/index.d.ts +10 -0
  74. package/dist/types/types/indexer.d.ts +27 -0
  75. package/dist/types/types/l2.d.ts +34 -0
  76. package/dist/types/types/list-manager.d.ts +179 -0
  77. package/dist/types/types/listing.d.ts +136 -0
  78. package/dist/types/types/minting.d.ts +75 -0
  79. package/dist/types/types/name-listing/enums.d.ts +20 -0
  80. package/dist/types/types/name-listing/index.d.ts +3 -0
  81. package/dist/types/types/name-listing/l2-name-registry.d.ts +13 -0
  82. package/dist/types/types/name-listing/listing.d.ts +73 -0
  83. package/dist/types/types/networks.d.ts +16 -0
  84. package/dist/types/utils/ens.d.ts +3 -0
  85. package/dist/types/utils/image-event-emitter.d.ts +8 -0
  86. package/dist/types/utils/models.d.ts +24 -0
  87. package/dist/types/web3/abis/index.d.ts +300 -0
  88. package/dist/types/web3/chains.d.ts +12 -0
  89. package/dist/types/web3/contracts/addresses.d.ts +4 -0
  90. package/dist/types/web3/efp-provider.d.ts +2 -0
  91. package/dist/types/web3/index.d.ts +5 -0
  92. package/dist/types/web3/providers.d.ts +3 -0
  93. package/dist/types/web3/wallet-connect.d.ts +2 -0
  94. package/package.json +13 -3
  95. package/dist/types/components/ens-names-register-component/ENSNamesRegisterComponent.d.ts +0 -17
  96. package/dist/types/components/ens-names-register-component/sub-components/Header.d.ts +0 -7
  97. package/dist/types/components/ens-names-register-component/sub-components/RegistrationProcess.d.ts +0 -17
  98. /package/dist/types/components/{ens-names-register-component → ens-names-registrar-component}/sub-components/ProgressBar.d.ts +0 -0
  99. /package/dist/types/components/{ens-names-register-component → ens-names-registrar-component}/sub-components/StepItem.d.ts +0 -0
  100. /package/dist/types/components/{ens-names-register-component → ens-names-registrar-component}/sub-components/SuccessScreen.d.ts +0 -0
  101. /package/dist/types/components/{ens-names-register-component → ens-names-registrar-component}/sub-components/Timer.d.ts +0 -0
  102. /package/dist/types/components/{ens-offchain-register-modal → subname-offchain-registrar-modal}/sub-components/InitialStep.d.ts +0 -0
  103. /package/dist/types/components/{ens-offchain-register-modal → subname-offchain-registrar-modal}/sub-components/OffchainRegistrationProcess.d.ts +0 -0
  104. /package/dist/types/components/{ens-offchain-register-modal → subname-offchain-registrar-modal}/sub-components/OffchainSuccessScreen.d.ts +0 -0
  105. /package/dist/types/components/{ens-onchain-register-modal → subname-onchain-registrar-modal}/sub-components/ConfirmationStep.d.ts +0 -0
  106. /package/dist/types/components/{ens-onchain-register-modal → subname-onchain-registrar-modal}/sub-components/InitialStep.d.ts +0 -0
  107. /package/dist/types/components/{ens-onchain-register-modal → subname-onchain-registrar-modal}/sub-components/OnchainSuccessScreen.d.ts +0 -0
@@ -0,0 +1,24 @@
1
+ import { EnsRegistrationContext } from "@/hooks";
2
+ export interface NameRegistration {
3
+ label: string;
4
+ durationInYears: number;
5
+ price: {
6
+ isChecking: boolean;
7
+ ethValue: number;
8
+ weiValue: bigint;
9
+ };
10
+ }
11
+ export interface NameRegistrationProcessCache {
12
+ currentStep: number;
13
+ registrations: EnsRegistrationContext[];
14
+ }
15
+ export declare const formatPrice: (value: number) => number;
16
+ export declare enum EnsRegistrationSteps {
17
+ SelectNames = 0,
18
+ RegistrationBegin = 1,
19
+ CommitmentSent = 2,
20
+ TimerStarted = 3,
21
+ TimerCompleted = 4,
22
+ RegistrationSent = 5,
23
+ RegistrationCompleted = 6
24
+ }
@@ -0,0 +1,300 @@
1
+ export declare const Abis: {
2
+ ENS_REGISTRY: ({
3
+ inputs: {
4
+ internalType: string;
5
+ name: string;
6
+ type: string;
7
+ }[];
8
+ payable: boolean;
9
+ stateMutability: string;
10
+ type: string;
11
+ anonymous?: undefined;
12
+ name?: undefined;
13
+ constant?: undefined;
14
+ outputs?: undefined;
15
+ } | {
16
+ anonymous: boolean;
17
+ inputs: {
18
+ indexed: boolean;
19
+ internalType: string;
20
+ name: string;
21
+ type: string;
22
+ }[];
23
+ name: string;
24
+ type: string;
25
+ payable?: undefined;
26
+ stateMutability?: undefined;
27
+ constant?: undefined;
28
+ outputs?: undefined;
29
+ } | {
30
+ constant: boolean;
31
+ inputs: {
32
+ internalType: string;
33
+ name: string;
34
+ type: string;
35
+ }[];
36
+ name: string;
37
+ outputs: {
38
+ internalType: string;
39
+ name: string;
40
+ type: string;
41
+ }[];
42
+ payable: boolean;
43
+ stateMutability: string;
44
+ type: string;
45
+ anonymous?: undefined;
46
+ })[];
47
+ L1_MINT_CONTOLLER: ({
48
+ inputs: {
49
+ internalType: string;
50
+ name: string;
51
+ type: string;
52
+ }[];
53
+ stateMutability: string;
54
+ type: string;
55
+ name?: undefined;
56
+ anonymous?: undefined;
57
+ outputs?: undefined;
58
+ } | {
59
+ inputs: {
60
+ internalType: string;
61
+ name: string;
62
+ type: string;
63
+ }[];
64
+ name: string;
65
+ type: string;
66
+ stateMutability?: undefined;
67
+ anonymous?: undefined;
68
+ outputs?: undefined;
69
+ } | {
70
+ anonymous: boolean;
71
+ inputs: {
72
+ indexed: boolean;
73
+ internalType: string;
74
+ name: string;
75
+ type: string;
76
+ }[];
77
+ name: string;
78
+ type: string;
79
+ stateMutability?: undefined;
80
+ outputs?: undefined;
81
+ } | {
82
+ inputs: {
83
+ internalType: string;
84
+ name: string;
85
+ type: string;
86
+ }[];
87
+ name: string;
88
+ outputs: {
89
+ internalType: string;
90
+ name: string;
91
+ type: string;
92
+ }[];
93
+ stateMutability: string;
94
+ type: string;
95
+ anonymous?: undefined;
96
+ } | {
97
+ inputs: ({
98
+ components: {
99
+ internalType: string;
100
+ name: string;
101
+ type: string;
102
+ }[];
103
+ internalType: string;
104
+ name: string;
105
+ type: string;
106
+ } | {
107
+ internalType: string;
108
+ name: string;
109
+ type: string;
110
+ components?: undefined;
111
+ })[];
112
+ name: string;
113
+ outputs: never[];
114
+ stateMutability: string;
115
+ type: string;
116
+ anonymous?: undefined;
117
+ })[];
118
+ L2_MINT_CONTOLLER: ({
119
+ inputs: {
120
+ internalType: string;
121
+ name: string;
122
+ type: string;
123
+ }[];
124
+ stateMutability: string;
125
+ type: string;
126
+ name?: undefined;
127
+ anonymous?: undefined;
128
+ outputs?: undefined;
129
+ } | {
130
+ inputs: {
131
+ internalType: string;
132
+ name: string;
133
+ type: string;
134
+ }[];
135
+ name: string;
136
+ type: string;
137
+ stateMutability?: undefined;
138
+ anonymous?: undefined;
139
+ outputs?: undefined;
140
+ } | {
141
+ anonymous: boolean;
142
+ inputs: {
143
+ indexed: boolean;
144
+ internalType: string;
145
+ name: string;
146
+ type: string;
147
+ }[];
148
+ name: string;
149
+ type: string;
150
+ stateMutability?: undefined;
151
+ outputs?: undefined;
152
+ } | {
153
+ inputs: ({
154
+ components: {
155
+ internalType: string;
156
+ name: string;
157
+ type: string;
158
+ }[];
159
+ internalType: string;
160
+ name: string;
161
+ type: string;
162
+ } | {
163
+ internalType: string;
164
+ name: string;
165
+ type: string;
166
+ components?: undefined;
167
+ })[];
168
+ name: string;
169
+ outputs: never[];
170
+ stateMutability: string;
171
+ type: string;
172
+ anonymous?: undefined;
173
+ } | {
174
+ inputs: never[];
175
+ name: string;
176
+ outputs: {
177
+ internalType: string;
178
+ name: string;
179
+ type: string;
180
+ }[];
181
+ stateMutability: string;
182
+ type: string;
183
+ anonymous?: undefined;
184
+ })[];
185
+ L2_REGISTRY_RESOLVER: {
186
+ inputs: {
187
+ internalType: string;
188
+ name: string;
189
+ type: string;
190
+ }[];
191
+ name: string;
192
+ outputs: {
193
+ internalType: string;
194
+ name: string;
195
+ type: string;
196
+ }[];
197
+ stateMutability: string;
198
+ type: string;
199
+ }[];
200
+ HYBRID_RESOLVER: ({
201
+ inputs: {
202
+ internalType: string;
203
+ name: string;
204
+ type: string;
205
+ }[];
206
+ stateMutability: string;
207
+ type: string;
208
+ name?: undefined;
209
+ anonymous?: undefined;
210
+ outputs?: undefined;
211
+ } | {
212
+ inputs: {
213
+ internalType: string;
214
+ name: string;
215
+ type: string;
216
+ }[];
217
+ name: string;
218
+ type: string;
219
+ stateMutability?: undefined;
220
+ anonymous?: undefined;
221
+ outputs?: undefined;
222
+ } | {
223
+ anonymous: boolean;
224
+ inputs: {
225
+ indexed: boolean;
226
+ internalType: string;
227
+ name: string;
228
+ type: string;
229
+ }[];
230
+ name: string;
231
+ type: string;
232
+ stateMutability?: undefined;
233
+ outputs?: undefined;
234
+ } | {
235
+ inputs: {
236
+ internalType: string;
237
+ name: string;
238
+ type: string;
239
+ }[];
240
+ name: string;
241
+ outputs: {
242
+ internalType: string;
243
+ name: string;
244
+ type: string;
245
+ }[];
246
+ stateMutability: string;
247
+ type: string;
248
+ anonymous?: undefined;
249
+ })[];
250
+ NAME_WRAPPER: ({
251
+ inputs: {
252
+ internalType: string;
253
+ name: string;
254
+ type: string;
255
+ }[];
256
+ stateMutability: string;
257
+ type: string;
258
+ name?: undefined;
259
+ anonymous?: undefined;
260
+ outputs?: undefined;
261
+ } | {
262
+ inputs: {
263
+ internalType: string;
264
+ name: string;
265
+ type: string;
266
+ }[];
267
+ name: string;
268
+ type: string;
269
+ stateMutability?: undefined;
270
+ anonymous?: undefined;
271
+ outputs?: undefined;
272
+ } | {
273
+ anonymous: boolean;
274
+ inputs: {
275
+ indexed: boolean;
276
+ internalType: string;
277
+ name: string;
278
+ type: string;
279
+ }[];
280
+ name: string;
281
+ type: string;
282
+ stateMutability?: undefined;
283
+ outputs?: undefined;
284
+ } | {
285
+ inputs: {
286
+ internalType: string;
287
+ name: string;
288
+ type: string;
289
+ }[];
290
+ name: string;
291
+ outputs: {
292
+ internalType: string;
293
+ name: string;
294
+ type: string;
295
+ }[];
296
+ stateMutability: string;
297
+ type: string;
298
+ anonymous?: undefined;
299
+ })[];
300
+ };
@@ -0,0 +1,12 @@
1
+ import { INameListing } from "@/types";
2
+ import { ListingNetwork, NamespaceListing } from "@/types/list-manager";
3
+ import { SupportedChainName } from "@/types/networks";
4
+ import { Chain } from "viem";
5
+ export declare const getChain: (name: SupportedChainName) => Chain;
6
+ export declare const getChainById: (id: number) => Chain | undefined;
7
+ export declare const getChainName: (id: number) => SupportedChainName | null;
8
+ export declare const isL2Chain: (id: number) => boolean;
9
+ export declare const getChainForListing: (listing: INameListing) => Chain;
10
+ export declare const getChainForListingV2: (listing: NamespaceListing) => Chain;
11
+ export declare const getListingNetworkId: (listingNetwork: ListingNetwork) => Chain;
12
+ export declare const getListingNetwork: (chainId: number) => ListingNetwork;
@@ -0,0 +1,4 @@
1
+ import { Layer2Network, Web3Network } from "@/types";
2
+ export declare const getL1NamespaceContracts: () => import("@namespacesdk/addresses/dist/addresses").L1ContractAddresses;
3
+ export declare const getEnsContracts: (network: Web3Network) => import("@namespacesdk/addresses/dist/addresses").EnsContracts;
4
+ export declare const getL2NamespaceContracts: (network: Layer2Network) => import("@namespacesdk/addresses/dist/addresses").L2ContractAddresses;
@@ -0,0 +1,2 @@
1
+ import { PropsWithChildren } from "react";
2
+ export declare const EfpProviders: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1,6 @@
1
1
  export * from "./resolver-abi";
2
+ export * from "./wallet-connect";
3
+ export * from "./chains";
4
+ export * from "./contracts/addresses";
5
+ export * from "./providers";
6
+ export * from "./abis";
@@ -0,0 +1,3 @@
1
+ import { Layer2Network, Web3Network } from "@/types";
2
+ import { FallbackTransport, Transport } from "viem";
3
+ export declare const getProvider: (network: Web3Network | Layer2Network) => Transport | FallbackTransport;
@@ -0,0 +1,2 @@
1
+ import { PropsWithChildren } from "react";
2
+ export declare const WalletConnectProvider: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thenamespace/ens-components",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -12,9 +12,15 @@
12
12
  "**/*.css"
13
13
  ],
14
14
  "peerDependencies": {
15
- "@ensdomains/address-encoder": "^1.1.4",
16
- "@ensdomains/content-hash": "^3.0.0",
15
+ "@ensdomains/address-encoder": "1.1.4",
16
+ "@ensdomains/content-hash": "3.0.0",
17
+ "@ensdomains/ensjs": "^4.0.2",
18
+ "@namespacesdk/addresses": "^1.0.15",
19
+ "@namespacesdk/indexer": "^1.0.1",
20
+ "@namespacesdk/mint-manager": "^1.0.15",
17
21
  "@tanstack/react-query": "^5.87.0",
22
+ "alchemy-sdk": "^3.6.0",
23
+ "ethereum-identity-kit": "^0.2.39",
18
24
  "lucide-react": ">=0.525.0",
19
25
  "react": ">=18",
20
26
  "react-dom": ">=18",
@@ -84,6 +90,7 @@
84
90
  "prettier": "^3.6.2",
85
91
  "react": "^18.3.1",
86
92
  "react-dom": "^18.3.1",
93
+ "react-easy-crop": "^5.5.6",
87
94
  "rimraf": "^6.0.1",
88
95
  "rollup": "^4.50.1",
89
96
  "rollup-plugin-dts": "^6.2.3",
@@ -93,5 +100,8 @@
93
100
  "typescript": "^5.9.2",
94
101
  "vite": "^6.3.5",
95
102
  "vite-tsconfig-paths": "^5.1.4"
103
+ },
104
+ "dependencies": {
105
+ "react-confetti": "^6.4.0"
96
106
  }
97
107
  }
@@ -1,17 +0,0 @@
1
- import "./ENSNamesRegisterComponent.css";
2
- export interface ENSNamesRegisterComponentProps {
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 ENSNamesRegisterComponent({ name, duration: initialDuration, onNameChange, onDurationChange, onBack, onClose, onNext, onCompleteProfile, onOpenWallet, onCompleteRegistration, onRegisterAnother, onViewName, }: ENSNamesRegisterComponentProps): import("react/jsx-runtime").JSX.Element;
17
- export default ENSNamesRegisterComponent;
@@ -1,7 +0,0 @@
1
- interface HeaderProps {
2
- showBack?: boolean;
3
- onBack?: () => void;
4
- onClose?: () => void;
5
- }
6
- export declare function Header({ showBack, onBack, onClose }: HeaderProps): import("react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,17 +0,0 @@
1
- interface RegistrationProcessProps {
2
- expandedStep: number;
3
- completedSteps: number[];
4
- isTransactionInProgress: boolean;
5
- progress: number;
6
- timerSeconds: number;
7
- timerProgress: number;
8
- remainingHours: number;
9
- onBack: () => void;
10
- onClose?: () => void;
11
- onToggleStep: (stepNumber: number) => void;
12
- onOpenWallet: () => void;
13
- onCompleteRegistration: () => void;
14
- onCompleteProfile?: () => void;
15
- }
16
- export declare function RegistrationProcess({ expandedStep, completedSteps, isTransactionInProgress, progress, timerSeconds, timerProgress, remainingHours, onBack, onClose, onToggleStep, onOpenWallet, onCompleteRegistration, onCompleteProfile, }: RegistrationProcessProps): import("react/jsx-runtime").JSX.Element;
17
- export {};