@thenamespace/ens-components 1.4.0 → 1.5.1
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/README.md +28 -25
- package/dist/index.d.ts +1 -18
- package/dist/index.js +20577 -61525
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,6 +4,9 @@ Production-ready React components for ENS name registration, record editing, and
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@thenamespace/ens-components)
|
|
6
6
|
|
|
7
|
+
Record editing and onchain/offchain subname flows support native `.eth` names and
|
|
8
|
+
DNS names imported into ENS, such as `example.com`. The `.eth` registration form is limited to `.eth` registrations.
|
|
9
|
+
|
|
7
10
|
## Install
|
|
8
11
|
|
|
9
12
|
```bash
|
|
@@ -75,13 +78,13 @@ Full `.eth` name registration flow: search → commit → wait → register.
|
|
|
75
78
|
```tsx
|
|
76
79
|
<EnsNameRegistrationForm
|
|
77
80
|
isTestnet={false}
|
|
78
|
-
onNameRegistered={
|
|
81
|
+
onNameRegistered={name => console.log("Registered:", name)}
|
|
79
82
|
/>
|
|
80
83
|
```
|
|
81
84
|
|
|
82
|
-
| Prop
|
|
83
|
-
|
|
84
|
-
| `isTestnet`
|
|
85
|
+
| Prop | Type | Description |
|
|
86
|
+
| ------------------ | ------------------------ | -------------------------------------- |
|
|
87
|
+
| `isTestnet` | `boolean` | Use Sepolia testnet contracts |
|
|
85
88
|
| `onNameRegistered` | `(name: string) => void` | Callback after successful registration |
|
|
86
89
|
|
|
87
90
|
---
|
|
@@ -95,16 +98,16 @@ Edit all resolver records for an ENS name — addresses, text records, contentha
|
|
|
95
98
|
name="alice.eth"
|
|
96
99
|
existingRecords={{ texts: [], addresses: [] }}
|
|
97
100
|
isTestnet={false}
|
|
98
|
-
onRecordsSaved={
|
|
101
|
+
onRecordsSaved={records => console.log(records)}
|
|
99
102
|
/>
|
|
100
103
|
```
|
|
101
104
|
|
|
102
|
-
| Prop
|
|
103
|
-
|
|
104
|
-
| `name`
|
|
105
|
-
| `existingRecords` | `EnsRecords`
|
|
106
|
-
| `isTestnet`
|
|
107
|
-
| `onRecordsSaved`
|
|
105
|
+
| Prop | Type | Description |
|
|
106
|
+
| ----------------- | ------------------------------- | --------------------------------------------------------- |
|
|
107
|
+
| `name` | `string` | ENS name to edit (`.eth` or a DNS name imported into ENS) |
|
|
108
|
+
| `existingRecords` | `EnsRecords` | Current on-chain records to pre-populate |
|
|
109
|
+
| `isTestnet` | `boolean` | Use Sepolia testnet contracts |
|
|
110
|
+
| `onRecordsSaved` | `(records: EnsRecords) => void` | Callback after records are saved |
|
|
108
111
|
|
|
109
112
|
---
|
|
110
113
|
|
|
@@ -116,15 +119,15 @@ Mint an onchain subname from a Namespace listing.
|
|
|
116
119
|
<SubnameMintForm
|
|
117
120
|
parentName="alice.eth"
|
|
118
121
|
isTestnet={false}
|
|
119
|
-
onSubnameMinted={
|
|
122
|
+
onSubnameMinted={subname => console.log("Minted:", subname)}
|
|
120
123
|
/>
|
|
121
124
|
```
|
|
122
125
|
|
|
123
|
-
| Prop
|
|
124
|
-
|
|
125
|
-
| `parentName`
|
|
126
|
-
| `isTestnet`
|
|
127
|
-
| `onSubnameMinted` | `(subname: string) => void` | Callback after mint
|
|
126
|
+
| Prop | Type | Description |
|
|
127
|
+
| ----------------- | --------------------------- | -------------------------------------------------------------- |
|
|
128
|
+
| `parentName` | `string` | ENS parent (`.eth` or ENS-imported DNS) with an active listing |
|
|
129
|
+
| `isTestnet` | `boolean` | Use Sepolia testnet contracts |
|
|
130
|
+
| `onSubnameMinted` | `(subname: string) => void` | Callback after mint |
|
|
128
131
|
|
|
129
132
|
---
|
|
130
133
|
|
|
@@ -137,16 +140,16 @@ Create or update an offchain subname through the Namespace API.
|
|
|
137
140
|
name="alice.eth"
|
|
138
141
|
apiKeyOrToken="YOUR_NAMESPACE_API_KEY"
|
|
139
142
|
isTestnet={false}
|
|
140
|
-
onSubnameSaved={
|
|
143
|
+
onSubnameSaved={subname => console.log("Saved:", subname)}
|
|
141
144
|
/>
|
|
142
145
|
```
|
|
143
146
|
|
|
144
|
-
| Prop
|
|
145
|
-
|
|
146
|
-
| `name`
|
|
147
|
-
| `apiKeyOrToken`
|
|
148
|
-
| `isTestnet`
|
|
149
|
-
| `onSubnameSaved` | `(subname: string) => void` | Callback after save
|
|
147
|
+
| Prop | Type | Description |
|
|
148
|
+
| ---------------- | --------------------------- | -------------------------------------------- |
|
|
149
|
+
| `name` | `string` | Parent ENS name (`.eth` or ENS-imported DNS) |
|
|
150
|
+
| `apiKeyOrToken` | `string` | Namespace API key or SIWE token |
|
|
151
|
+
| `isTestnet` | `boolean` | Use Sepolia testnet contracts |
|
|
152
|
+
| `onSubnameSaved` | `(subname: string) => void` | Callback after save |
|
|
150
153
|
|
|
151
154
|
---
|
|
152
155
|
|
|
@@ -182,7 +185,7 @@ Components use CSS variables that can be overridden:
|
|
|
182
185
|
|
|
183
186
|
```css
|
|
184
187
|
:root {
|
|
185
|
-
--ns-color-primary: #
|
|
188
|
+
--ns-color-primary: #5a4bff;
|
|
186
189
|
--ns-color-bg: #ffffff;
|
|
187
190
|
--ns-color-fg: #111111;
|
|
188
191
|
--ns-radius-md: 12px;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import * as _thenamespace_offchain_manager from '@thenamespace/offchain-manager'
|
|
|
4
4
|
import { ChainName as ChainName$2, OffchainClient } from '@thenamespace/offchain-manager';
|
|
5
5
|
import * as React$1 from 'react';
|
|
6
6
|
import React__default, { ReactNode } from 'react';
|
|
7
|
+
import { UploadResult } from '@thenamespace/avatar';
|
|
7
8
|
|
|
8
9
|
interface EnsRecords$1 {
|
|
9
10
|
addresses: EnsAddressRecord$1[];
|
|
@@ -892,24 +893,6 @@ declare const useMintSubname: ({ chainId }: {
|
|
|
892
893
|
|
|
893
894
|
declare const useOffchainManager: (name: string, apiKeyOrToken: string, isTestnet?: boolean) => _thenamespace_offchain_manager.OffchainClient;
|
|
894
895
|
|
|
895
|
-
/**
|
|
896
|
-
* Upload result
|
|
897
|
-
*/
|
|
898
|
-
interface UploadResult {
|
|
899
|
-
/** URL of the uploaded image */
|
|
900
|
-
url: string;
|
|
901
|
-
/** Upload timestamp */
|
|
902
|
-
uploadedAt: string;
|
|
903
|
-
/** File size in bytes */
|
|
904
|
-
fileSize: number;
|
|
905
|
-
/** Whether this was an update to existing image */
|
|
906
|
-
isUpdate: boolean;
|
|
907
|
-
/** Whether the upload is pending (for unregistered names) */
|
|
908
|
-
pending?: boolean;
|
|
909
|
-
/** Optional message from the server */
|
|
910
|
-
message?: string;
|
|
911
|
-
}
|
|
912
|
-
|
|
913
896
|
interface UseAvatarClientParams {
|
|
914
897
|
isTestnet?: boolean;
|
|
915
898
|
domain?: string;
|