web3bio-profile-kit 0.1.3 → 0.1.4

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 (74) hide show
  1. package/dist/hooks/index.cjs +21 -0
  2. package/dist/hooks/index.js +8 -0
  3. package/dist/hooks/useBaseQuery.cjs +129 -0
  4. package/dist/{types/hooks → hooks}/useBaseQuery.d.ts +1 -2
  5. package/dist/hooks/useBaseQuery.js +127 -0
  6. package/dist/hooks/useBatchNS.cjs +25 -0
  7. package/dist/{types/hooks → hooks}/useBatchNS.d.ts +1 -1
  8. package/dist/hooks/useBatchNS.js +23 -0
  9. package/dist/hooks/useBatchProfile.cjs +25 -0
  10. package/dist/{types/hooks → hooks}/useBatchProfile.d.ts +1 -1
  11. package/dist/hooks/useBatchProfile.js +23 -0
  12. package/dist/hooks/useDomain.cjs +28 -0
  13. package/dist/{types/hooks → hooks}/useDomain.d.ts +1 -1
  14. package/dist/hooks/useDomain.js +26 -0
  15. package/dist/hooks/useNS.cjs +28 -0
  16. package/dist/{types/hooks → hooks}/useNS.d.ts +1 -1
  17. package/dist/hooks/useNS.js +26 -0
  18. package/dist/hooks/useProfile.cjs +28 -0
  19. package/dist/{types/hooks → hooks}/useProfile.d.ts +1 -1
  20. package/dist/hooks/useProfile.js +26 -0
  21. package/dist/hooks/useUniversalNS.cjs +28 -0
  22. package/dist/{types/hooks → hooks}/useUniversalNS.d.ts +1 -1
  23. package/dist/hooks/useUniversalNS.js +26 -0
  24. package/dist/hooks/useUniversalProfile.cjs +28 -0
  25. package/dist/{types/hooks → hooks}/useUniversalProfile.d.ts +1 -1
  26. package/dist/hooks/useUniversalProfile.js +26 -0
  27. package/dist/index.cjs +71 -0
  28. package/dist/index.d.ts +3 -441
  29. package/dist/index.js +18 -2038
  30. package/dist/types/cointype.cjs +29 -0
  31. package/dist/types/cointype.d.ts +26 -0
  32. package/dist/types/cointype.js +29 -0
  33. package/dist/types/hook.cjs +38 -0
  34. package/dist/types/hook.d.ts +195 -0
  35. package/dist/types/hook.js +38 -0
  36. package/dist/types/index.cjs +38 -0
  37. package/dist/types/index.d.ts +5 -7
  38. package/dist/types/index.js +5 -0
  39. package/dist/types/network.cjs +41 -0
  40. package/dist/types/{utils/network.d.ts → network.d.ts} +9 -4
  41. package/dist/types/network.js +41 -0
  42. package/dist/types/platform.cjs +110 -0
  43. package/dist/types/{utils/platform.d.ts → platform.d.ts} +19 -5
  44. package/dist/types/platform.js +110 -0
  45. package/dist/types/source.cjs +44 -0
  46. package/dist/types/{utils/source.d.ts → source.d.ts} +11 -3
  47. package/dist/types/source.js +44 -0
  48. package/dist/utils/helpers.cjs +119 -0
  49. package/dist/{types/utils → utils}/helpers.d.ts +4 -3
  50. package/dist/utils/helpers.js +112 -0
  51. package/dist/utils/index.cjs +27 -0
  52. package/dist/utils/index.d.ts +6 -0
  53. package/dist/utils/index.js +6 -0
  54. package/dist/utils/network.cjs +355 -0
  55. package/dist/utils/network.d.ts +4 -0
  56. package/dist/utils/network.js +353 -0
  57. package/dist/utils/platform.cjs +983 -0
  58. package/dist/utils/platform.d.ts +18 -0
  59. package/dist/utils/platform.js +979 -0
  60. package/dist/utils/regex.cjs +34 -0
  61. package/dist/utils/regex.d.ts +30 -0
  62. package/dist/utils/regex.js +32 -0
  63. package/dist/utils/source.cjs +144 -0
  64. package/dist/utils/source.d.ts +2 -0
  65. package/dist/utils/source.js +142 -0
  66. package/package.json +32 -12
  67. package/dist/index.esm.js +0 -2023
  68. package/dist/index.esm.js.map +0 -1
  69. package/dist/index.js.map +0 -1
  70. package/dist/types/utils/cointype.d.ts +0 -22
  71. package/dist/types/utils/constants.d.ts +0 -36
  72. package/dist/types/utils/types.d.ts +0 -74
  73. /package/dist/{types/hooks → hooks}/index.d.ts +0 -0
  74. /package/dist/{types/setupTests.d.ts → setupTests.d.ts} +0 -0
@@ -1,22 +0,0 @@
1
- export declare const CoinType: {
2
- btc: number;
3
- ltc: number;
4
- doge: number;
5
- dash: number;
6
- monacoin: number;
7
- eth: number;
8
- etc: number;
9
- xrp: number;
10
- atom: number;
11
- rootstock: number;
12
- ripple: number;
13
- bch: number;
14
- bnb: number;
15
- xlm: number;
16
- rsk: number;
17
- eos: number;
18
- xem: number;
19
- trx: number;
20
- xdai: number;
21
- matic: number;
22
- };
@@ -1,36 +0,0 @@
1
- export declare const API_ENDPOINT = "https://api.web3.bio";
2
- export declare enum ErrorMessages {
3
- NOT_FOUND = "Not Found",
4
- INVALID_RESOLVER = "Invalid Resolver Address",
5
- INVALID_RESOLVED = "Invalid Resolved Address",
6
- NOT_EXIST = "Does Not Exist",
7
- INVALID_IDENTITY = "Invalid Identity or Domain",
8
- INVALID_ADDRESS = "Invalid Address",
9
- UNKNOWN_ERROR = "Unknown Error Occurred",
10
- NETWORK_ERROR = "Network Error"
11
- }
12
- export declare enum QueryEndpoint {
13
- NS = "ns",
14
- PROFILE = "profile",
15
- DOMAIN = "domain"
16
- }
17
- export declare const REGEX: {
18
- ENS: RegExp;
19
- BASENAMES: RegExp;
20
- LINEA: RegExp;
21
- FARCASTER: RegExp;
22
- LENS: RegExp;
23
- CLUSTER: RegExp;
24
- SPACE_ID: RegExp;
25
- GENOME: RegExp;
26
- UNSTOPPABLE_DOMAINS: RegExp;
27
- CROSSBELL: RegExp;
28
- DOTBIT: RegExp;
29
- SNS: RegExp;
30
- ETH_ADDRESS: RegExp;
31
- BTC_ADDRESS: RegExp;
32
- SOLANA_ADDRESS: RegExp;
33
- LOWERCASE_EXEMPT: RegExp;
34
- TWITTER: RegExp;
35
- NEXT_ID: RegExp;
36
- };
@@ -1,74 +0,0 @@
1
- import { Network } from "./network";
2
- import type { PlatformType } from "./platform";
3
- import type { SourceType } from "./source";
4
- export type AddressRecord = {
5
- address: string;
6
- network: string;
7
- __typename: "Address";
8
- };
9
- export type SocialLinksItem = {
10
- link: string | null;
11
- handle: string | null;
12
- sources: SourceType[];
13
- };
14
- export type SocialLinks = Record<string, SocialLinksItem>;
15
- export type SocialRecord = {
16
- uid: number | null;
17
- follower: number;
18
- following: number;
19
- };
20
- export interface ProfileResponse extends NSResponse {
21
- email: string | null;
22
- contenthash: string | null;
23
- header: string | null;
24
- location: string | null;
25
- createdAt: string | null;
26
- status: string | null;
27
- error?: string;
28
- links: SocialLinks;
29
- social: SocialRecord | {};
30
- }
31
- export interface NSResponse {
32
- identity: string;
33
- address: string | null;
34
- avatar: string | null;
35
- description: string | null;
36
- platform: string;
37
- displayName: string | null;
38
- aliases?: string[];
39
- }
40
- export interface DomainResponse {
41
- identity: string;
42
- platform: PlatformType;
43
- resolvedAddress: string | null;
44
- ownerAddress: string | null;
45
- managerAddress: string | null;
46
- displayName: string | null;
47
- isPrimary: boolean;
48
- status: string;
49
- createdAt: string | null;
50
- updatedAt: string | null;
51
- expiredAt: string | null;
52
- contenthash: string | null;
53
- texts: Record<string, string>;
54
- addresses: Record<Network, string>;
55
- }
56
- export type QueryOptions = {
57
- /** API Key for authentication */
58
- apiKey?: string;
59
- /** Whether the query should execute */
60
- enabled?: boolean;
61
- };
62
- export type IdentityString = string | `${PlatformType},${string}`;
63
- export type QueryResult<T> = {
64
- data: T | null;
65
- isLoading: boolean;
66
- error: Error | null;
67
- };
68
- export type ProfileResult = QueryResult<ProfileResponse>;
69
- export type NSResult = QueryResult<NSResponse>;
70
- export type ProfileBatchResult = QueryResult<ProfileResponse[]>;
71
- export type NSBatchResult = QueryResult<NSResponse[]>;
72
- export type ProfileUniversalResult = QueryResult<ProfileResponse[]>;
73
- export type NSUniversalResult = QueryResult<NSResponse[]>;
74
- export type DomainResult = QueryResult<DomainResponse>;
File without changes
File without changes