@thenamespace/ens-components 1.1.0 → 1.1.2
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 +38 -560
- package/dist/index.js +562 -1802
- package/dist/index.js.map +1 -1
- package/dist/types/components/ens-name-registration/ENSNameRegistrationForm.d.ts +1 -0
- package/dist/types/components/ens-name-registration/SetNameRecords.d.ts +2 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/offchain-subname-form/FormHeader.d.ts +3 -1
- package/dist/types/components/offchain-subname-form/OffchainSubnameForm.d.ts +16 -6
- package/dist/types/components/subname-mint-form/SubnameMintForm.d.ts +2 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Address, Hash, ContractFunctionExecutionError, TransactionReceipt } from 'viem';
|
|
3
|
+
import * as _thenamespace_offchain_manager from '@thenamespace/offchain-manager';
|
|
4
|
+
import { ChainName as ChainName$2, OffchainClient } from '@thenamespace/offchain-manager';
|
|
3
5
|
import * as React$1 from 'react';
|
|
4
6
|
import React__default, { ReactNode } from 'react';
|
|
5
7
|
|
|
@@ -28,7 +30,7 @@ declare enum ContenthashProtocol {
|
|
|
28
30
|
Swarm = "swarm"
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
type ChainName$
|
|
33
|
+
type ChainName$1 = "eth" | "arb" | "base" | "bitcoin" | "matic" | "op" | "sol" | "zora" | "celo";
|
|
32
34
|
|
|
33
35
|
declare enum TxProgress {
|
|
34
36
|
Pending = 0,
|
|
@@ -85,6 +87,7 @@ interface EnsNameRegistrationFormProps {
|
|
|
85
87
|
bannerImage?: string;
|
|
86
88
|
hideBanner?: boolean;
|
|
87
89
|
bannerWidth?: number;
|
|
90
|
+
avatarUploadDomain?: string;
|
|
88
91
|
onRegistrationSuccess?: (result: RegistrationSuccessData) => void;
|
|
89
92
|
onClose?: (isSuccess: boolean) => void;
|
|
90
93
|
onRegistrationStart?: (name: string) => void;
|
|
@@ -190,32 +193,43 @@ interface SubnameMintFormProps {
|
|
|
190
193
|
parentName: string;
|
|
191
194
|
label?: string;
|
|
192
195
|
isTestnet?: boolean;
|
|
196
|
+
avatarUploadDomain?: string;
|
|
193
197
|
onCancel?: () => void;
|
|
194
198
|
onSuccess?: (data: MintSuccessData) => void;
|
|
195
199
|
onSubnameMinted?: (data: SubnameMintedData) => void;
|
|
196
200
|
txConfirmations?: number;
|
|
197
201
|
onConnectWallet?: () => void;
|
|
198
202
|
}
|
|
199
|
-
declare const SubnameMintForm: ({ parentName, label, isTestnet, onCancel, onSuccess, onSubnameMinted, txConfirmations, onConnectWallet, }: SubnameMintFormProps) => react_jsx_runtime.JSX.Element;
|
|
203
|
+
declare const SubnameMintForm: ({ parentName, label, isTestnet, avatarUploadDomain, onCancel, onSuccess, onSubnameMinted, txConfirmations, onConnectWallet, }: SubnameMintFormProps) => react_jsx_runtime.JSX.Element;
|
|
200
204
|
|
|
201
205
|
interface OffchainSubnameCreatedData {
|
|
202
206
|
label: string;
|
|
203
207
|
parentName: string;
|
|
204
208
|
fullSubname: string;
|
|
205
|
-
|
|
206
|
-
|
|
209
|
+
addresses: Array<{
|
|
210
|
+
chain: ChainName$2;
|
|
211
|
+
value: string;
|
|
212
|
+
}>;
|
|
213
|
+
texts: Array<{
|
|
214
|
+
key: string;
|
|
215
|
+
value: string;
|
|
216
|
+
}>;
|
|
217
|
+
owner?: string;
|
|
207
218
|
}
|
|
208
219
|
interface OffchainSubnameFormProps {
|
|
209
|
-
|
|
220
|
+
offchainManager: OffchainClient;
|
|
210
221
|
name: string;
|
|
211
222
|
label?: string;
|
|
223
|
+
title?: string;
|
|
224
|
+
subtitle?: string;
|
|
212
225
|
hideTitle?: boolean;
|
|
213
226
|
onCancel?: () => void;
|
|
214
227
|
isTestnet?: boolean;
|
|
215
228
|
avatarUploadDomain?: string;
|
|
216
|
-
|
|
229
|
+
onSubnameCreated?: (data: OffchainSubnameCreatedData) => Promise<void> | void;
|
|
230
|
+
onSubnameUpdated?: (data: OffchainSubnameCreatedData) => Promise<void> | void;
|
|
217
231
|
}
|
|
218
|
-
declare const OffchainSubnameForm: ({
|
|
232
|
+
declare const OffchainSubnameForm: ({ offchainManager, name, label: propLabel, title, subtitle, hideTitle, isTestnet, avatarUploadDomain, onCancel, onSubnameCreated, onSubnameUpdated, }: OffchainSubnameFormProps) => react_jsx_runtime.JSX.Element;
|
|
219
233
|
|
|
220
234
|
type ButtonVariant = "solid" | "outline" | "ghost" | "destructive";
|
|
221
235
|
type ButtonSize = "sm" | "md" | "lg";
|
|
@@ -277,7 +291,7 @@ interface IconProps {
|
|
|
277
291
|
declare const Icon: React__default.FC<IconProps>;
|
|
278
292
|
|
|
279
293
|
interface ChainIconProps extends React__default.SVGProps<SVGSVGElement> {
|
|
280
|
-
chain: ChainName$
|
|
294
|
+
chain: ChainName$1;
|
|
281
295
|
size?: number;
|
|
282
296
|
}
|
|
283
297
|
declare const ChainIcon: React__default.FC<ChainIconProps>;
|
|
@@ -445,19 +459,28 @@ interface PricingDisplayProps {
|
|
|
445
459
|
}
|
|
446
460
|
declare const PricingDisplay: React__default.FC<PricingDisplayProps>;
|
|
447
461
|
|
|
462
|
+
interface TransactionPendingScreenProps {
|
|
463
|
+
message?: string;
|
|
464
|
+
hash: Hash;
|
|
465
|
+
isCompleted: boolean;
|
|
466
|
+
isTestnet?: boolean;
|
|
467
|
+
chainId?: number;
|
|
468
|
+
}
|
|
469
|
+
declare const TransactionPendingScreen: React__default.FC<TransactionPendingScreenProps>;
|
|
470
|
+
|
|
448
471
|
interface SupportedEnsAddress {
|
|
449
472
|
validateFunc?: (value: string) => boolean;
|
|
450
473
|
isEMV?: boolean;
|
|
451
474
|
label: string;
|
|
452
475
|
coinType: number;
|
|
453
476
|
chainId?: number;
|
|
454
|
-
chainName: ChainName$
|
|
477
|
+
chainName: ChainName$1;
|
|
455
478
|
placeholder?: string;
|
|
456
479
|
}
|
|
457
480
|
declare const supportedAddresses: SupportedEnsAddress[];
|
|
458
481
|
declare const getSupportedAddressMap: () => Record<number, SupportedEnsAddress>;
|
|
459
482
|
declare const getSupportedAddressByCoin: (coin: number) => SupportedEnsAddress | undefined;
|
|
460
|
-
declare const getSupportedAddressByName: (name: ChainName$
|
|
483
|
+
declare const getSupportedAddressByName: (name: ChainName$1) => SupportedEnsAddress | undefined;
|
|
461
484
|
declare const getSupportedAddressByChainId: (chainId: number) => SupportedEnsAddress | undefined;
|
|
462
485
|
type TextCategory = "profile" | "social";
|
|
463
486
|
interface SupportedText {
|
|
@@ -618,7 +641,7 @@ declare const useENSResolver: ({ resolverChainId, isTestnet, }: {
|
|
|
618
641
|
setUpdateRecordsTx: (update: UpdateRecordsRequest) => Promise<`0x${string}`>;
|
|
619
642
|
};
|
|
620
643
|
|
|
621
|
-
declare enum ChainName
|
|
644
|
+
declare enum ChainName {
|
|
622
645
|
Ethereum = "eth",
|
|
623
646
|
Default = "default",
|
|
624
647
|
Solana = "sol",
|
|
@@ -707,7 +730,7 @@ interface EnsTextRecord {
|
|
|
707
730
|
}
|
|
708
731
|
/** Address record for a specific chain (by coin type or ChainName). */
|
|
709
732
|
interface EnsAddressRecord {
|
|
710
|
-
chain: ChainName
|
|
733
|
+
chain: ChainName | number;
|
|
711
734
|
value: string;
|
|
712
735
|
}
|
|
713
736
|
/** Contenthash record (ipfs, ipns, swarm, etc.). */
|
|
@@ -783,552 +806,7 @@ declare const useMintSubname: ({ chainId }: {
|
|
|
783
806
|
estimateTransactionFees: (params: EstimateFeesParams) => Promise<EstimatedFees | null>;
|
|
784
807
|
};
|
|
785
808
|
|
|
786
|
-
|
|
787
|
-
* Complete subname data returned by the Namespace API.
|
|
788
|
-
* This represents a fully resolved ENS subname with all its associated records.
|
|
789
|
-
*
|
|
790
|
-
* @example
|
|
791
|
-
* ```typescript
|
|
792
|
-
* // Retrieved subname data
|
|
793
|
-
* const subname: SubnameDTO = {
|
|
794
|
-
* id: 'abc123',
|
|
795
|
-
* fullName: 'alice.example.eth',
|
|
796
|
-
* parentName: 'example.eth',
|
|
797
|
-
* label: 'alice',
|
|
798
|
-
* texts: { com.twitter: 'alice', url: 'https://alice.dev' },
|
|
799
|
-
* addresses: { '60': '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045' },
|
|
800
|
-
* metadata: {},
|
|
801
|
-
* namehash: '0x...',
|
|
802
|
-
* createdAt: '2024-01-01T00:00:00Z'
|
|
803
|
-
* };
|
|
804
|
-
* ```
|
|
805
|
-
*/
|
|
806
|
-
interface SubnameDTO {
|
|
807
|
-
/** Unique identifier for this subname */
|
|
808
|
-
id: string;
|
|
809
|
-
/** Full ENS name including parent domain (e.g., 'alice.example.eth') */
|
|
810
|
-
fullName: string;
|
|
811
|
-
/** Parent ENS domain (e.g., 'example.eth') */
|
|
812
|
-
parentName: string;
|
|
813
|
-
/** Subname label (e.g., 'alice') */
|
|
814
|
-
label: string;
|
|
815
|
-
/** Text records as key-value pairs */
|
|
816
|
-
texts: Record<string, string>;
|
|
817
|
-
/** Address records as coin type -> address mappings */
|
|
818
|
-
addresses: Record<string, string>;
|
|
819
|
-
/** Metadata records as key-value pairs */
|
|
820
|
-
metadata: Record<string, string>;
|
|
821
|
-
/** Optional IPFS content hash */
|
|
822
|
-
contenthash?: string;
|
|
823
|
-
/** ENS namehash for this subname */
|
|
824
|
-
namehash: string;
|
|
825
|
-
/** Optional owner address */
|
|
826
|
-
owner?: string;
|
|
827
|
-
/** Optional time-to-live in seconds */
|
|
828
|
-
ttl?: number;
|
|
829
|
-
/** Timestamp when the subname was created */
|
|
830
|
-
createdAt?: string;
|
|
831
|
-
/** Timestamp when the subname was last updated */
|
|
832
|
-
updatedAt?: string;
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
/**
|
|
836
|
-
* Response from checking if a subname is available for registration.
|
|
837
|
-
*/
|
|
838
|
-
interface GetAvailableResponse {
|
|
839
|
-
/** Whether the subname is available for registration */
|
|
840
|
-
isAvailable: boolean;
|
|
841
|
-
}
|
|
842
|
-
/**
|
|
843
|
-
* Response containing a single record value.
|
|
844
|
-
*/
|
|
845
|
-
interface GetRecordResponse {
|
|
846
|
-
/** The record value eg. thenamespaceninja for com.github */
|
|
847
|
-
record: string;
|
|
848
|
-
}
|
|
849
|
-
/**
|
|
850
|
-
* Generic paginated response wrapper.
|
|
851
|
-
*
|
|
852
|
-
* @template T - The type of items in the response
|
|
853
|
-
*/
|
|
854
|
-
interface PagedResponse<T> {
|
|
855
|
-
/** Total number of items across all pages */
|
|
856
|
-
totalItems: number;
|
|
857
|
-
/** Current page number (1-based) */
|
|
858
|
-
page: number;
|
|
859
|
-
/** Number of items per page */
|
|
860
|
-
size: number;
|
|
861
|
-
/** Array of items for the current page */
|
|
862
|
-
items: T;
|
|
863
|
-
}
|
|
864
|
-
/**
|
|
865
|
-
* Query parameters for searching and filtering subnames.
|
|
866
|
-
*
|
|
867
|
-
* @example
|
|
868
|
-
* ```typescript
|
|
869
|
-
* const query: QuerySubnamesRequest = {
|
|
870
|
-
* parentName: 'example.eth',
|
|
871
|
-
* labelSearch: 'alice',
|
|
872
|
-
* page: 1,
|
|
873
|
-
* size: 50
|
|
874
|
-
* };
|
|
875
|
-
* ```
|
|
876
|
-
*/
|
|
877
|
-
interface QuerySubnamesRequest {
|
|
878
|
-
/** Parent ENS domain to filter by */
|
|
879
|
-
parentName?: string;
|
|
880
|
-
/** Search term for subname labels */
|
|
881
|
-
labelSearch?: string;
|
|
882
|
-
/** Page number (1-based) */
|
|
883
|
-
page?: number;
|
|
884
|
-
/** Number of items per page (max 100) */
|
|
885
|
-
size?: number;
|
|
886
|
-
/** Filter by metadata records */
|
|
887
|
-
metadata?: Record<string, string>;
|
|
888
|
-
/** Array of parent names to filter by */
|
|
889
|
-
parentNames?: string[];
|
|
890
|
-
/** Filter by owner address */
|
|
891
|
-
owner?: string;
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
/**
|
|
895
|
-
* Supported blockchain networks for address records.
|
|
896
|
-
* Each chain has a corresponding coin type used internally for ENS address records.
|
|
897
|
-
*
|
|
898
|
-
* @example
|
|
899
|
-
* ```typescript
|
|
900
|
-
* import { ChainName } from '@thenamespace/offchain-manager';
|
|
901
|
-
*
|
|
902
|
-
* // Use in address records
|
|
903
|
-
* const addressRecord = {
|
|
904
|
-
* chain: ChainName.Ethereum,
|
|
905
|
-
* value: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
|
|
906
|
-
* };
|
|
907
|
-
* ```
|
|
908
|
-
*/
|
|
909
|
-
declare enum ChainName {
|
|
910
|
-
/** Ethereum mainnet */
|
|
911
|
-
Ethereum = "eth",
|
|
912
|
-
/** Default (EVM-compatible) */
|
|
913
|
-
Default = "default",
|
|
914
|
-
/** Solana */
|
|
915
|
-
Solana = "sol",
|
|
916
|
-
/** Arbitrum One */
|
|
917
|
-
Arbitrum = "arb",
|
|
918
|
-
/** Optimism */
|
|
919
|
-
Optimism = "op",
|
|
920
|
-
/** Base */
|
|
921
|
-
Base = "base",
|
|
922
|
-
/** Polygon (formerly Matic) */
|
|
923
|
-
Polygon = "polygon",
|
|
924
|
-
/** BNB Smart Chain (formerly BSC) */
|
|
925
|
-
Bsc = "bsc",
|
|
926
|
-
/** Avalanche C-Chain */
|
|
927
|
-
Avalanche = "avax",
|
|
928
|
-
/** Gnosis Chain (formerly xDai) */
|
|
929
|
-
Gnosis = "gnosis",
|
|
930
|
-
/** zkSync Era */
|
|
931
|
-
Zksync = "zksync",
|
|
932
|
-
/** Cosmos Hub */
|
|
933
|
-
Cosmos = "cosmos",
|
|
934
|
-
/** NEAR Protocol */
|
|
935
|
-
Near = "near",
|
|
936
|
-
/** Linea */
|
|
937
|
-
Linea = "linea",
|
|
938
|
-
/** Scroll */
|
|
939
|
-
Scroll = "scroll",
|
|
940
|
-
/** Bitcoin */
|
|
941
|
-
Bitcoin = "btc",
|
|
942
|
-
/** Starknet */
|
|
943
|
-
Starknet = "starknet",
|
|
944
|
-
/** Sui Network */
|
|
945
|
-
Sui = "sui",
|
|
946
|
-
/** Unichain */
|
|
947
|
-
Unichain = "unichain",
|
|
948
|
-
/** Berachain */
|
|
949
|
-
Berachain = "berachain",
|
|
950
|
-
/** WorldChain */
|
|
951
|
-
WorldChain = "world_chain",
|
|
952
|
-
/** Zora */
|
|
953
|
-
Zora = "zora",
|
|
954
|
-
/** Celo */
|
|
955
|
-
Celo = "celo",
|
|
956
|
-
/** Aptos */
|
|
957
|
-
Aptos = "aptos",
|
|
958
|
-
/** Algorand */
|
|
959
|
-
Algorand = "algorand",
|
|
960
|
-
/** Monad */
|
|
961
|
-
Monad = "monad",
|
|
962
|
-
/** Push Chain */
|
|
963
|
-
Push = "push"
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
/**
|
|
967
|
-
* Represents a text record for ENS subnames.
|
|
968
|
-
* Text records store arbitrary key-value pairs like social media handles, websites, etc.
|
|
969
|
-
*
|
|
970
|
-
* @example
|
|
971
|
-
* ```typescript
|
|
972
|
-
* const textRecord: TextRecord = {
|
|
973
|
-
* key: 'com.twitter',
|
|
974
|
-
* value: 'myhandle'
|
|
975
|
-
* };
|
|
976
|
-
* ```
|
|
977
|
-
*/
|
|
978
|
-
interface TextRecord {
|
|
979
|
-
/** The record key (e.g., 'description', 'com.twitter', 'com.github', 'url', 'avatar') */
|
|
980
|
-
key: string;
|
|
981
|
-
/** The record value (e.g., 'myhandle', 'https://mysite.com') */
|
|
982
|
-
value: string;
|
|
983
|
-
}
|
|
984
|
-
/**
|
|
985
|
-
* Represents an address record for ENS subnames.
|
|
986
|
-
* Address records map blockchain networks to wallet addresses.
|
|
987
|
-
*
|
|
988
|
-
* @example
|
|
989
|
-
* ```typescript
|
|
990
|
-
* const addressRecord: AddressRecord = {
|
|
991
|
-
* chain: ChainName.Ethereum,
|
|
992
|
-
* value: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
|
|
993
|
-
* };
|
|
994
|
-
* ```
|
|
995
|
-
*/
|
|
996
|
-
interface AddressRecord {
|
|
997
|
-
/** The blockchain network for this address */
|
|
998
|
-
chain: ChainName;
|
|
999
|
-
/** The wallet address on the specified chain */
|
|
1000
|
-
value: string;
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
/**
|
|
1004
|
-
* Request payload for creating a new ENS subname.
|
|
1005
|
-
*
|
|
1006
|
-
* @example
|
|
1007
|
-
* ```typescript
|
|
1008
|
-
* import { CreateSubnameRequest, ChainName } from '@thenamespace/offchain-manager';
|
|
1009
|
-
*
|
|
1010
|
-
* const request: CreateSubnameRequest = {
|
|
1011
|
-
* parentName: 'example.eth',
|
|
1012
|
-
* label: 'alice',
|
|
1013
|
-
* addresses: [{
|
|
1014
|
-
* chain: ChainName.Ethereum,
|
|
1015
|
-
* value: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
|
|
1016
|
-
* }],
|
|
1017
|
-
* texts: [{
|
|
1018
|
-
* key: 'com.twitter',
|
|
1019
|
-
* value: 'alice'
|
|
1020
|
-
* }]
|
|
1021
|
-
* };
|
|
1022
|
-
* ```
|
|
1023
|
-
*/
|
|
1024
|
-
interface CreateSubnameRequest {
|
|
1025
|
-
/** The parent ENS domain (e.g., 'example.eth') */
|
|
1026
|
-
parentName: string;
|
|
1027
|
-
/** The subname label (e.g., 'alice' for 'alice.example.eth') */
|
|
1028
|
-
label: string;
|
|
1029
|
-
/** Optional text records for social media, websites, etc. */
|
|
1030
|
-
texts?: TextRecord[];
|
|
1031
|
-
/** Optional address records for different blockchain networks */
|
|
1032
|
-
addresses?: AddressRecord[];
|
|
1033
|
-
/** Optional metadata records for custom data */
|
|
1034
|
-
metadata?: TextRecord[];
|
|
1035
|
-
/** Optional IPFS content hash */
|
|
1036
|
-
contenthash?: string;
|
|
1037
|
-
/** Optional time-to-live in seconds for DNS records */
|
|
1038
|
-
ttl?: number;
|
|
1039
|
-
owner?: string;
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
/**
|
|
1043
|
-
* Request payload for updating an existing ENS subname.
|
|
1044
|
-
* All fields are optional - only provided fields will be updated.
|
|
1045
|
-
*
|
|
1046
|
-
* @example
|
|
1047
|
-
* ```typescript
|
|
1048
|
-
* import { UpdateSubnameRequest, ChainName } from '@thenamespace/offchain-manager';
|
|
1049
|
-
*
|
|
1050
|
-
* const updateRequest: UpdateSubnameRequest = {
|
|
1051
|
-
* texts: [{
|
|
1052
|
-
* key: 'url',
|
|
1053
|
-
* value: 'https://alice.dev'
|
|
1054
|
-
* }],
|
|
1055
|
-
* addresses: [{
|
|
1056
|
-
* chain: ChainName.Base,
|
|
1057
|
-
* value: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
|
|
1058
|
-
* }]
|
|
1059
|
-
* };
|
|
1060
|
-
* ```
|
|
1061
|
-
*/
|
|
1062
|
-
interface UpdateSubnameRequest {
|
|
1063
|
-
/** Text records to update (replaces existing text records) */
|
|
1064
|
-
texts?: TextRecord[];
|
|
1065
|
-
/** Address records to update (replaces existing address records) */
|
|
1066
|
-
addresses?: AddressRecord[];
|
|
1067
|
-
/** Metadata records to update (replaces existing metadata) */
|
|
1068
|
-
metadata?: TextRecord[];
|
|
1069
|
-
/** IPFS content hash to set */
|
|
1070
|
-
contenthash?: string;
|
|
1071
|
-
/** Time-to-live in seconds for DNS records */
|
|
1072
|
-
ttl?: number;
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
/**
|
|
1076
|
-
* Main client interface for managing ENS subnames off-chain.
|
|
1077
|
-
* Provides methods for creating, updating, deleting, and querying subnames and their records.
|
|
1078
|
-
*
|
|
1079
|
-
* @example
|
|
1080
|
-
* ```typescript
|
|
1081
|
-
* import { createOffchainClient } from '@thenamespace/offchain-manager';
|
|
1082
|
-
*
|
|
1083
|
-
* const client = createOffchainClient();
|
|
1084
|
-
* client.setDefaultApiKey('your-api-key'); // Works with your address based ENS domain
|
|
1085
|
-
*
|
|
1086
|
-
* // Create a subname
|
|
1087
|
-
* await client.createSubname({
|
|
1088
|
-
* parentName: 'example.eth',
|
|
1089
|
-
* label: 'alice',
|
|
1090
|
-
* addresses: [{ chain: ChainName.Ethereum, value: '0x...' }]
|
|
1091
|
-
* });
|
|
1092
|
-
* ```
|
|
1093
|
-
*/
|
|
1094
|
-
interface OffchainClient {
|
|
1095
|
-
/**
|
|
1096
|
-
* Set API key for a specific ENS domain.
|
|
1097
|
-
* @param ensName - The ENS domain name (e.g., 'example.eth')
|
|
1098
|
-
* @param apiKey - Domain Based API key obtained from https://dev.namespace.ninja
|
|
1099
|
-
* @example
|
|
1100
|
-
* ```typescript
|
|
1101
|
-
* client.setApiKey('example.eth', 'your-domain-based-api-key');
|
|
1102
|
-
* ```
|
|
1103
|
-
*/
|
|
1104
|
-
setApiKey(ensName: string, apiKey: string): void;
|
|
1105
|
-
/**
|
|
1106
|
-
* Set a default API key to be used for all your ENS domains with Namespace Resolver.
|
|
1107
|
-
* This is useful when you want to use the same API key for all domains registered with the same address.
|
|
1108
|
-
* @param apiKey - Address Based API key obtained from https://dev.namespace.ninja
|
|
1109
|
-
* @example
|
|
1110
|
-
* ```typescript
|
|
1111
|
-
* client.setDefaultApiKey('your-address-based-api-key');
|
|
1112
|
-
* ```
|
|
1113
|
-
*/
|
|
1114
|
-
setDefaultApiKey(apiKey: string): void;
|
|
1115
|
-
/**
|
|
1116
|
-
* Set custom HTTP headers to be sent with each request.
|
|
1117
|
-
* Useful for tracing, multi-tenant routing, or additional auth metadata.
|
|
1118
|
-
*
|
|
1119
|
-
* WARNING: The API key is sent using the "x-auth-token" header by default.
|
|
1120
|
-
* If you pass a header with the same name here, it will overwrite the
|
|
1121
|
-
* API key value used for authentication.
|
|
1122
|
-
*
|
|
1123
|
-
* @param headers - A record of header keys and values
|
|
1124
|
-
* @example
|
|
1125
|
-
* ```typescript
|
|
1126
|
-
* client.setCustomHeaders({
|
|
1127
|
-
* 'x-trace-id': '123',
|
|
1128
|
-
* 'x-tenant-id': 'my-tenant',
|
|
1129
|
-
* });
|
|
1130
|
-
* ```
|
|
1131
|
-
*/
|
|
1132
|
-
setCustomHeaders(headers: Record<string, any>): void;
|
|
1133
|
-
/**
|
|
1134
|
-
* Create a new ENS subname with optional records.
|
|
1135
|
-
* @param request - Subname creation parameters
|
|
1136
|
-
* @throws {ValidationError} When request parameters are invalid
|
|
1137
|
-
* @throws {AuthenticationError} When API key is invalid
|
|
1138
|
-
* @throws {SubnameAlreadyExistsError} When subname already exists
|
|
1139
|
-
* @example
|
|
1140
|
-
* ```typescript
|
|
1141
|
-
* await client.createSubname({
|
|
1142
|
-
* parentName: 'example.eth',
|
|
1143
|
-
* label: 'alice',
|
|
1144
|
-
* owner: "0x123...",
|
|
1145
|
-
* addresses: [{ chain: ChainName.Ethereum, value: '0x123...' }],
|
|
1146
|
-
* texts: [{ key: 'com.twitter', value: 'alice' }],
|
|
1147
|
-
* contenthash: "ipfs://baf....",
|
|
1148
|
-
* metadata: [{ key: "sender", value: '0x123...' }],
|
|
1149
|
-
* });
|
|
1150
|
-
*/
|
|
1151
|
-
createSubname(request: CreateSubnameRequest): Promise<void>;
|
|
1152
|
-
/**
|
|
1153
|
-
* Update an existing ENS subname's records.
|
|
1154
|
-
* @param subname - Full subname (e.g., 'alice.example.eth')
|
|
1155
|
-
* @param request - Update parameters
|
|
1156
|
-
* @throws {ValidationError} When parameters are invalid
|
|
1157
|
-
* @throws {SubnameNotFoundError} When subname doesn't exist
|
|
1158
|
-
* @example
|
|
1159
|
-
* ```typescript
|
|
1160
|
-
* await client.updateSubname('alice.example.eth', {
|
|
1161
|
-
* addresses: [{ chain: ChainName.Ethereum, value: '0x...' }],
|
|
1162
|
-
* texts: [{ key: 'com.twitter', value: 'alice' }]
|
|
1163
|
-
* });
|
|
1164
|
-
* ```
|
|
1165
|
-
*/
|
|
1166
|
-
updateSubname(subname: string, request: UpdateSubnameRequest): Promise<void>;
|
|
1167
|
-
/**
|
|
1168
|
-
* Delete an ENS subname and all its records.
|
|
1169
|
-
* @param fullSubname - Full subname (e.g., 'alice.example.eth')
|
|
1170
|
-
* @throws {SubnameNotFoundError} When subname doesn't exist
|
|
1171
|
-
* @example
|
|
1172
|
-
* ```typescript
|
|
1173
|
-
* await client.deleteSubname('alice.example.eth');
|
|
1174
|
-
* ```
|
|
1175
|
-
*/
|
|
1176
|
-
deleteSubname(fullSubname: string): Promise<void>;
|
|
1177
|
-
/**
|
|
1178
|
-
* Check if a subname is available for registration.
|
|
1179
|
-
* @param fullSubname - Full subname to check (e.g., 'alice.example.eth')
|
|
1180
|
-
* @returns Promise resolving to availability status
|
|
1181
|
-
* @example
|
|
1182
|
-
* ```typescript
|
|
1183
|
-
* const availability = await client.isSubnameAvailable('alice.example.eth');
|
|
1184
|
-
* ```
|
|
1185
|
-
*/
|
|
1186
|
-
isSubnameAvailable(fullSubname: string): Promise<GetAvailableResponse>;
|
|
1187
|
-
/**
|
|
1188
|
-
* Get details of a specific subname.
|
|
1189
|
-
* @param fullName - Full subname (e.g., 'alice.example.eth')
|
|
1190
|
-
* @returns Promise resolving to subname data or null if not found
|
|
1191
|
-
* @example
|
|
1192
|
-
* ```typescript
|
|
1193
|
-
* const subname = await client.getSingleSubname('alice.example.eth');
|
|
1194
|
-
* ```
|
|
1195
|
-
*/
|
|
1196
|
-
getSingleSubname(fullName: string): Promise<SubnameDTO | null>;
|
|
1197
|
-
/**
|
|
1198
|
-
* Search and filter subnames with pagination.
|
|
1199
|
-
* @param query - Search and filter parameters
|
|
1200
|
-
* @returns Promise resolving to paginated subname results
|
|
1201
|
-
* @example
|
|
1202
|
-
* ```typescript
|
|
1203
|
-
* const subnames = await client.getFilteredSubnames({
|
|
1204
|
-
* parentName: 'example.eth',
|
|
1205
|
-
* page: 1,
|
|
1206
|
-
* size: 50,
|
|
1207
|
-
* });
|
|
1208
|
-
* ```
|
|
1209
|
-
*/
|
|
1210
|
-
getFilteredSubnames(query: QuerySubnamesRequest): Promise<PagedResponse<SubnameDTO[]>>;
|
|
1211
|
-
/**
|
|
1212
|
-
* Add an address record for a specific blockchain to a subname.
|
|
1213
|
-
* @param subname - Full subname (e.g., 'alice.example.eth')
|
|
1214
|
-
* @param chain - Blockchain network
|
|
1215
|
-
* @param value - Wallet address on the specified chain
|
|
1216
|
-
* @throws {ValidationError} When address format is invalid for the chain
|
|
1217
|
-
* @example
|
|
1218
|
-
* ```typescript
|
|
1219
|
-
* await client.addAddressRecord('alice.example.eth', ChainName.Ethereum, '0x...');
|
|
1220
|
-
* ```
|
|
1221
|
-
*/
|
|
1222
|
-
addAddressRecord(subname: string, chain: ChainName, value: string): Promise<void>;
|
|
1223
|
-
/**
|
|
1224
|
-
* Remove an address record for a specific blockchain from a subname.
|
|
1225
|
-
* @param subname - Full subname (e.g., 'alice.example.eth')
|
|
1226
|
-
* @param chain - Blockchain network to remove
|
|
1227
|
-
* @example
|
|
1228
|
-
* ```typescript
|
|
1229
|
-
* await client.deleteAddressRecord('alice.example.eth', ChainName.Ethereum);
|
|
1230
|
-
* ```
|
|
1231
|
-
*/
|
|
1232
|
-
deleteAddressRecord(subname: string, chain: ChainName): Promise<void>;
|
|
1233
|
-
/**
|
|
1234
|
-
* Set a default EVM address for all EVM-compatible chains to a subname.
|
|
1235
|
-
* This sets the same address for Ethereum, Arbitrum, Optimism, Base, Polygon, BSC, Avalanche, Gnosis, zkSync, Linea, Scroll, Unichain, Berachain, WorldChain, Zora, Celo, and Monad.
|
|
1236
|
-
* @param subname - Full subname (e.g., 'alice.example.eth')
|
|
1237
|
-
* @param value - EVM wallet address to set as default for all supported EVM chains
|
|
1238
|
-
* @throws {ValidationError} When address format is invalid
|
|
1239
|
-
* @example
|
|
1240
|
-
* ```typescript
|
|
1241
|
-
* await client.setDefaultEvmAddress('alice.example.eth', '0x...');
|
|
1242
|
-
* ```
|
|
1243
|
-
*/
|
|
1244
|
-
setDefaultEvmAddress(subname: string, value: string): Promise<void>;
|
|
1245
|
-
/**
|
|
1246
|
-
* Add a text record to a subname.
|
|
1247
|
-
* @param subname - Full subname (e.g., 'alice.example.eth')
|
|
1248
|
-
* @param key - Record key (e.g., 'com.twitter', 'com.github', 'url')
|
|
1249
|
-
* @param value - Record value (e.g., 'alice', 'https://alice.dev')
|
|
1250
|
-
* @example
|
|
1251
|
-
* ```typescript
|
|
1252
|
-
* await client.addTextRecord('alice.example.eth', 'com.twitter', 'alice');
|
|
1253
|
-
* ```
|
|
1254
|
-
*/
|
|
1255
|
-
addTextRecord(subname: string, key: string, value: string): Promise<void>;
|
|
1256
|
-
/**
|
|
1257
|
-
* Remove a text record from a subname.
|
|
1258
|
-
* @param subname - Full subname (e.g., 'alice.example.eth')
|
|
1259
|
-
* @param key - Record key to remove
|
|
1260
|
-
* @example
|
|
1261
|
-
* ```typescript
|
|
1262
|
-
* await client.deleteTextRecord('alice.example.eth', 'com.twitter');
|
|
1263
|
-
* ```
|
|
1264
|
-
*/
|
|
1265
|
-
deleteTextRecord(subname: string, key: string): Promise<void>;
|
|
1266
|
-
/**
|
|
1267
|
-
* Get all text records for a subname.
|
|
1268
|
-
* @param fullSubname - Full subname (e.g., 'alice.example.eth')
|
|
1269
|
-
* @returns Promise resolving to all the text records for the subname
|
|
1270
|
-
* @example
|
|
1271
|
-
* ```typescript
|
|
1272
|
-
* const textRecords = await client.getTextRecords('alice.example.eth');
|
|
1273
|
-
* ```
|
|
1274
|
-
*/
|
|
1275
|
-
getTextRecords(fullSubname: string): Promise<Record<string, string>>;
|
|
1276
|
-
/**
|
|
1277
|
-
* Get a specific text record for a subname.
|
|
1278
|
-
* @param fullSubname - Full subname (e.g., 'alice.example.eth')
|
|
1279
|
-
* @param key - Record key to retrieve
|
|
1280
|
-
* @returns Promise resolving to the record response
|
|
1281
|
-
* @example
|
|
1282
|
-
* ```typescript
|
|
1283
|
-
* const textRecord = await client.getTextRecord('alice.example.eth', 'com.twitter');
|
|
1284
|
-
* ```
|
|
1285
|
-
*/
|
|
1286
|
-
getTextRecord(fullSubname: string, key: string): Promise<GetRecordResponse>;
|
|
1287
|
-
/**
|
|
1288
|
-
* Add a metadata record to a subname.
|
|
1289
|
-
* @param fullSubname - Full subname (e.g., 'alice.example.eth')
|
|
1290
|
-
* @param key - Metadata key
|
|
1291
|
-
* @param data - Metadata value (will be JSON stringified if object)
|
|
1292
|
-
* @example
|
|
1293
|
-
* ```typescript
|
|
1294
|
-
* await client.addDataRecord('alice.example.eth', 'data', 'HODL ENS!');
|
|
1295
|
-
* ```
|
|
1296
|
-
*/
|
|
1297
|
-
addDataRecord(fullSubname: string, key: string, data: unknown): Promise<void>;
|
|
1298
|
-
/**
|
|
1299
|
-
* Remove a metadata record from a subname.
|
|
1300
|
-
* @param subname - Full subname (e.g., 'alice.example.eth')
|
|
1301
|
-
* @param key - Metadata key to remove
|
|
1302
|
-
* @example
|
|
1303
|
-
* ```typescript
|
|
1304
|
-
* await client.deleteDataRecord('alice.example.eth', 'data');
|
|
1305
|
-
* ```
|
|
1306
|
-
*/
|
|
1307
|
-
deleteDataRecord(subname: string, key: string): Promise<void>;
|
|
1308
|
-
/**
|
|
1309
|
-
* Get all metadata records for a subname.
|
|
1310
|
-
* @param fullSubname - Full subname (e.g., 'alice.example.eth')
|
|
1311
|
-
* @returns Promise resolving to key-value pairs of metadata records
|
|
1312
|
-
* @example
|
|
1313
|
-
* ```typescript
|
|
1314
|
-
* const dataRecords = await client.getDataRecords('alice.example.eth');
|
|
1315
|
-
* ```
|
|
1316
|
-
*/
|
|
1317
|
-
getDataRecords(fullSubname: string): Promise<Record<string, unknown>>;
|
|
1318
|
-
/**
|
|
1319
|
-
* Get a specific metadata record for a subname.
|
|
1320
|
-
* @param fullSubname - Full subname (e.g., 'alice.example.eth')
|
|
1321
|
-
* @param key - Metadata key to retrieve
|
|
1322
|
-
* @returns Promise resolving to the record response
|
|
1323
|
-
* @example
|
|
1324
|
-
* ```typescript
|
|
1325
|
-
* const dataRecord = await client.getDataRecord('alice.example.eth', 'data');
|
|
1326
|
-
* ```
|
|
1327
|
-
*/
|
|
1328
|
-
getDataRecord(fullSubname: string, key: string): Promise<GetRecordResponse>;
|
|
1329
|
-
}
|
|
1330
|
-
|
|
1331
|
-
declare const useOffchainManager: (name: string, apiKeyOrToken: string, isTestnet?: boolean) => OffchainClient;
|
|
809
|
+
declare const useOffchainManager: (name: string, apiKeyOrToken: string, isTestnet?: boolean) => _thenamespace_offchain_manager.OffchainClient;
|
|
1332
810
|
|
|
1333
811
|
/**
|
|
1334
812
|
* Upload result
|
|
@@ -1366,5 +844,5 @@ declare const useAvatarClient: ({ isTestnet, domain }: UseAvatarClientParams) =>
|
|
|
1366
844
|
getErrorMessage: (err: unknown, imageType?: UploadImageType) => string;
|
|
1367
845
|
};
|
|
1368
846
|
|
|
1369
|
-
export { Accordion, Alert, Button, Card, ChainIcon, ConnectAndSetChain, ContenthashIcon, ContenthashProtocol, ContractErrorLabel, Dropdown, ENS_RESOLVER_ABI, EnsNameRegistrationForm, EnsRecordsForm, Icon, Input, ListingNetwork, ListingType, MULTICALL, Modal, OffchainSubnameForm, PricingDisplay, ProfileHeader, ProgressBar, SET_ADDRESS_FUNC, SET_CONTENTHASH_FUNC, SET_TEXT_FUNC, SelectRecordsForm, ShurikenSpinner, SubnameMintForm, Text, TextRecordCategory, Textarea, ThemeProvider, Tooltip, TxProgress, capitalize, convertEVMChainIdToCoinType, convertToMulticallResolverData, convertToResolverData, createEnsReferer, debounce, deepCopy, diffToEnsRecords, ensureFloatInput, equalsIgnoreCase, formatFloat, getAvatarUploadErrorMessage, getBlockExplorer, getBlockExplorerAddressUrl, getBlockExplorerName, getBlockExplorerTransactionUrl, getChainIdForListingNetwork, getEnsAppUrl, getEnsRecordsDiff, getImageUploadErrorMessage, getSupportedAddressByChainId, getSupportedAddressByCoin, getSupportedAddressByName, getSupportedAddressMap, getSupportedChashByProtocol, getSupportedText, isCommitmentToNewErr, isContenthashValid, isUserDeniedError, supportedAddresses, supportedContenthashRecords, supportedTexts, useAvatarClient, useENSResolver, useMintManager, useMintSubname, useOffchainManager, useRegisterENS, useTheme, useWaitTransaction, validateEnsRecords, wait };
|
|
1370
|
-
export type { AccordionProps, AlertPosition, AlertProps, AlertVariant, ButtonProps, ButtonSize, ButtonVariant, ChainName$
|
|
847
|
+
export { Accordion, Alert, Button, Card, ChainIcon, ConnectAndSetChain, ContenthashIcon, ContenthashProtocol, ContractErrorLabel, Dropdown, ENS_RESOLVER_ABI, EnsNameRegistrationForm, EnsRecordsForm, Icon, Input, ListingNetwork, ListingType, MULTICALL, Modal, OffchainSubnameForm, PricingDisplay, ProfileHeader, ProgressBar, SET_ADDRESS_FUNC, SET_CONTENTHASH_FUNC, SET_TEXT_FUNC, SelectRecordsForm, ShurikenSpinner, SubnameMintForm, Text, TextRecordCategory, Textarea, ThemeProvider, Tooltip, TransactionPendingScreen, TxProgress, capitalize, convertEVMChainIdToCoinType, convertToMulticallResolverData, convertToResolverData, createEnsReferer, debounce, deepCopy, diffToEnsRecords, ensureFloatInput, equalsIgnoreCase, formatFloat, getAvatarUploadErrorMessage, getBlockExplorer, getBlockExplorerAddressUrl, getBlockExplorerName, getBlockExplorerTransactionUrl, getChainIdForListingNetwork, getEnsAppUrl, getEnsRecordsDiff, getImageUploadErrorMessage, getSupportedAddressByChainId, getSupportedAddressByCoin, getSupportedAddressByName, getSupportedAddressMap, getSupportedChashByProtocol, getSupportedText, isCommitmentToNewErr, isContenthashValid, isUserDeniedError, supportedAddresses, supportedContenthashRecords, supportedTexts, useAvatarClient, useENSResolver, useMintManager, useMintSubname, useOffchainManager, useRegisterENS, useTheme, useWaitTransaction, validateEnsRecords, wait };
|
|
848
|
+
export type { AccordionProps, AlertPosition, AlertProps, AlertVariant, ButtonProps, ButtonSize, ButtonVariant, ChainName$1 as ChainName, ConnectAndSetChainProps, ContractErrorLabelProps, DropdownProps, EnsAddressRecord$1 as EnsAddressRecord, EnsContenthashRecord, EnsRecords$1 as EnsRecords, EnsRecordsDiff, EnsTextRecord$1 as EnsTextRecord, EstimatedFees, IconName, IconProps, InputProps, InputSize, InputType, ModalPresentation, ModalProps, ModalResponsivePresentation, ModalSize, NameListing, OffchainSubnameCreatedData, PricingDisplayProps, ProfileHeaderProps, RecordValidationError, RegistrationRequest, ShurikenSpinnerProps, SupportedContenthashRecord, SupportedEnsAddress, SupportedText, SupportedTextRecord, TextCategory, TextColor, TextProps, TextSize, TextWeight, TextareaProps, TextareaSize, ThemeContextValue, ThemeName, ThemeProviderProps, TooltipPosition, TooltipProps, UploadAvatarParams, UploadImageType };
|