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