@net-protocol/profiles 0.1.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.
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Profile metadata stored as JSON in the metadata storage key
3
+ */
4
+ interface ProfileMetadata {
5
+ x_username?: string;
6
+ }
7
+ /**
8
+ * User display name derived from ENS or address
9
+ */
10
+ interface UserDisplayName {
11
+ displayName: string;
12
+ ensName?: string;
13
+ isLoading: boolean;
14
+ error?: Error;
15
+ }
16
+ /**
17
+ * Basic profile metadata returned by useBasicUserProfileMetadata
18
+ */
19
+ interface BasicUserProfileMetadata {
20
+ profilePicture?: string;
21
+ xUsername?: string;
22
+ forwardedTo?: string;
23
+ isLoading: boolean;
24
+ }
25
+ /**
26
+ * Options for profile hooks
27
+ */
28
+ interface UseProfileOptions {
29
+ chainId: number;
30
+ userAddress: string;
31
+ enabled?: boolean;
32
+ }
33
+ /**
34
+ * Arguments prepared for Storage.put() transaction
35
+ */
36
+ interface ProfileStorageArgs {
37
+ bytesKey: `0x${string}`;
38
+ topic: string;
39
+ bytesValue: `0x${string}`;
40
+ }
41
+ /**
42
+ * Full profile data combining all profile fields
43
+ */
44
+ interface UserProfile {
45
+ address: string;
46
+ profilePicture?: string;
47
+ xUsername?: string;
48
+ canvas?: string;
49
+ forwardedTo?: string;
50
+ }
51
+
52
+ export type { BasicUserProfileMetadata as B, ProfileStorageArgs as P, UserDisplayName as U, ProfileMetadata as a, UseProfileOptions as b, UserProfile as c };
package/package.json ADDED
@@ -0,0 +1,90 @@
1
+ {
2
+ "name": "@net-protocol/profiles",
3
+ "version": "0.1.0",
4
+ "description": "Net Profiles SDK for reading and writing user profile data on the Net protocol",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "module": "./dist/index.mjs",
8
+ "sideEffects": false,
9
+ "typesVersions": {
10
+ "*": {
11
+ "react": [
12
+ "./dist/react.d.ts"
13
+ ]
14
+ }
15
+ },
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.mjs",
20
+ "require": "./dist/index.js"
21
+ },
22
+ "./react": {
23
+ "types": "./dist/react.d.ts",
24
+ "import": "./dist/react.mjs",
25
+ "require": "./dist/react.js"
26
+ }
27
+ },
28
+ "files": [
29
+ "dist",
30
+ "README.md"
31
+ ],
32
+ "scripts": {
33
+ "build": "tsup",
34
+ "build:watch": "tsup --watch",
35
+ "clean": "rm -rf dist",
36
+ "typecheck": "tsc --noEmit",
37
+ "prepack": "../../scripts/prepack-modify-deps.sh",
38
+ "prepublishOnly": "yarn build",
39
+ "postpublish": "../../scripts/postpublish-restore-deps.sh",
40
+ "test": "vitest --run",
41
+ "test:watch": "vitest --watch",
42
+ "test:ui": "vitest --ui"
43
+ },
44
+ "dependencies": {
45
+ "@net-protocol/core": "^0.1.6",
46
+ "@net-protocol/storage": "^0.1.11",
47
+ "viem": "^2.31.4"
48
+ },
49
+ "devDependencies": {
50
+ "@tanstack/react-query": "^5.0.0",
51
+ "@types/node": "^20.0.0",
52
+ "@types/react": "^18.0.0",
53
+ "@vitest/ui": "^1.0.0",
54
+ "react": "^18.0.0",
55
+ "tsup": "^8.0.0",
56
+ "typescript": "^5.0.0",
57
+ "vitest": "^1.0.0"
58
+ },
59
+ "peerDependencies": {
60
+ "react": "^18.0.0",
61
+ "wagmi": "^2.15.0"
62
+ },
63
+ "peerDependenciesMeta": {
64
+ "react": {
65
+ "optional": true
66
+ },
67
+ "wagmi": {
68
+ "optional": true
69
+ }
70
+ },
71
+ "publishConfig": {
72
+ "access": "public",
73
+ "registry": "https://registry.npmjs.org/"
74
+ },
75
+ "repository": {
76
+ "type": "git",
77
+ "url": "https://github.com/stuckinaboot/net-public.git",
78
+ "directory": "packages/net-profiles"
79
+ },
80
+ "keywords": [
81
+ "net",
82
+ "protocol",
83
+ "blockchain",
84
+ "ethereum",
85
+ "profiles",
86
+ "user-profiles",
87
+ "storage"
88
+ ],
89
+ "license": "MIT"
90
+ }