@b3dotfun/sdk 0.0.35-alpha.3 → 0.0.35-alpha.5

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 (89) hide show
  1. package/dist/cjs/global-account/bsmnt.d.ts +2 -0
  2. package/dist/cjs/global-account/bsmnt.js +42 -1
  3. package/dist/cjs/global-account/react/components/AvatarCreator/AvatarCreator.d.ts +6 -0
  4. package/dist/cjs/global-account/react/components/AvatarCreator/AvatarCreator.js +55 -0
  5. package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +6 -0
  6. package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +108 -0
  7. package/dist/cjs/global-account/react/components/B3DynamicModal.js +9 -1
  8. package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.d.ts +3 -1
  9. package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +21 -11
  10. package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.js +16 -2
  11. package/dist/cjs/global-account/react/components/icons/AppleIcon.d.ts +9 -0
  12. package/dist/cjs/global-account/react/components/icons/AppleIcon.js +8 -0
  13. package/dist/cjs/global-account/react/components/icons/DiscordIcon.d.ts +9 -0
  14. package/dist/cjs/global-account/react/components/icons/DiscordIcon.js +8 -0
  15. package/dist/cjs/global-account/react/components/icons/FarcasterIcon.d.ts +9 -0
  16. package/dist/cjs/global-account/react/components/icons/FarcasterIcon.js +8 -0
  17. package/dist/cjs/global-account/react/components/icons/GoogleIcon.d.ts +8 -0
  18. package/dist/cjs/global-account/react/components/icons/GoogleIcon.js +8 -0
  19. package/dist/cjs/global-account/react/components/icons/XIcon.d.ts +9 -0
  20. package/dist/cjs/global-account/react/components/icons/XIcon.js +8 -0
  21. package/dist/cjs/global-account/react/hooks/useAccountWallet.js +3 -2
  22. package/dist/cjs/global-account/react/hooks/useAuthentication.js +7 -0
  23. package/dist/cjs/global-account/react/hooks/useProfile.d.ts +1 -1
  24. package/dist/cjs/global-account/react/hooks/useRPMToken.d.ts +7 -0
  25. package/dist/cjs/global-account/react/hooks/useRPMToken.js +11 -0
  26. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +7 -1
  27. package/dist/cjs/global-account/react/utils/updateAvatar.d.ts +4 -0
  28. package/dist/cjs/global-account/react/utils/updateAvatar.js +54 -0
  29. package/dist/esm/global-account/bsmnt.d.ts +2 -0
  30. package/dist/esm/global-account/bsmnt.js +39 -0
  31. package/dist/esm/global-account/react/components/AvatarCreator/AvatarCreator.d.ts +6 -0
  32. package/dist/esm/global-account/react/components/AvatarCreator/AvatarCreator.js +52 -0
  33. package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +6 -0
  34. package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +102 -0
  35. package/dist/esm/global-account/react/components/B3DynamicModal.js +9 -1
  36. package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.d.ts +3 -1
  37. package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +22 -12
  38. package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.js +17 -3
  39. package/dist/esm/global-account/react/components/icons/AppleIcon.d.ts +9 -0
  40. package/dist/esm/global-account/react/components/icons/AppleIcon.js +5 -0
  41. package/dist/esm/global-account/react/components/icons/DiscordIcon.d.ts +9 -0
  42. package/dist/esm/global-account/react/components/icons/DiscordIcon.js +5 -0
  43. package/dist/esm/global-account/react/components/icons/FarcasterIcon.d.ts +9 -0
  44. package/dist/esm/global-account/react/components/icons/FarcasterIcon.js +5 -0
  45. package/dist/esm/global-account/react/components/icons/GoogleIcon.d.ts +8 -0
  46. package/dist/esm/global-account/react/components/icons/GoogleIcon.js +5 -0
  47. package/dist/esm/global-account/react/components/icons/XIcon.d.ts +9 -0
  48. package/dist/esm/global-account/react/components/icons/XIcon.js +5 -0
  49. package/dist/esm/global-account/react/hooks/useAccountWallet.js +3 -2
  50. package/dist/esm/global-account/react/hooks/useAuthentication.js +7 -0
  51. package/dist/esm/global-account/react/hooks/useProfile.d.ts +1 -1
  52. package/dist/esm/global-account/react/hooks/useRPMToken.d.ts +7 -0
  53. package/dist/esm/global-account/react/hooks/useRPMToken.js +8 -0
  54. package/dist/esm/global-account/react/stores/useModalStore.d.ts +7 -1
  55. package/dist/esm/global-account/react/utils/updateAvatar.d.ts +4 -0
  56. package/dist/esm/global-account/react/utils/updateAvatar.js +18 -0
  57. package/dist/styles/index.css +1 -1
  58. package/dist/types/global-account/bsmnt.d.ts +2 -0
  59. package/dist/types/global-account/react/components/AvatarCreator/AvatarCreator.d.ts +6 -0
  60. package/dist/types/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +6 -0
  61. package/dist/types/global-account/react/components/LinkAccount/LinkAccount.d.ts +3 -1
  62. package/dist/types/global-account/react/components/icons/AppleIcon.d.ts +9 -0
  63. package/dist/types/global-account/react/components/icons/DiscordIcon.d.ts +9 -0
  64. package/dist/types/global-account/react/components/icons/FarcasterIcon.d.ts +9 -0
  65. package/dist/types/global-account/react/components/icons/GoogleIcon.d.ts +8 -0
  66. package/dist/types/global-account/react/components/icons/XIcon.d.ts +9 -0
  67. package/dist/types/global-account/react/hooks/useProfile.d.ts +1 -1
  68. package/dist/types/global-account/react/hooks/useRPMToken.d.ts +7 -0
  69. package/dist/types/global-account/react/stores/useModalStore.d.ts +7 -1
  70. package/dist/types/global-account/react/utils/updateAvatar.d.ts +4 -0
  71. package/package.json +6 -5
  72. package/src/global-account/bsmnt.ts +47 -0
  73. package/src/global-account/react/components/AvatarCreator/AvatarCreator.tsx +90 -0
  74. package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +233 -0
  75. package/src/global-account/react/components/B3DynamicModal.tsx +27 -2
  76. package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +40 -18
  77. package/src/global-account/react/components/ManageAccount/BalanceContent.tsx +25 -5
  78. package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +0 -1
  79. package/src/global-account/react/components/icons/AppleIcon.tsx +33 -0
  80. package/src/global-account/react/components/icons/DiscordIcon.tsx +32 -0
  81. package/src/global-account/react/components/icons/FarcasterIcon.tsx +37 -0
  82. package/src/global-account/react/components/icons/GoogleIcon.tsx +40 -0
  83. package/src/global-account/react/components/icons/XIcon.tsx +28 -0
  84. package/src/global-account/react/hooks/useAccountWallet.tsx +3 -2
  85. package/src/global-account/react/hooks/useAuthentication.ts +9 -0
  86. package/src/global-account/react/hooks/useProfile.ts +1 -1
  87. package/src/global-account/react/hooks/useRPMToken.ts +17 -0
  88. package/src/global-account/react/stores/useModalStore.ts +9 -1
  89. package/src/global-account/react/utils/updateAvatar.ts +21 -0
@@ -0,0 +1,7 @@
1
+ export declare function useRPMToken(): {
2
+ token: string;
3
+ accountId: string;
4
+ refetch: (queryParams: undefined) => Promise<any>;
5
+ isLoading: boolean;
6
+ isError: Error | null;
7
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useRPMToken = useRPMToken;
5
+ const useQueryBSMNT_1 = require("../../../global-account/react/hooks/useQueryBSMNT");
6
+ function useRPMToken() {
7
+ const { data, runQuery: refetch, isLoading, error: isError, } = (0, useQueryBSMNT_1.useQueryBSMNT)("profiles", "getReadyPlayerMeToken", undefined, true);
8
+ const token = data?.token || "";
9
+ const accountId = data?.accountId || "";
10
+ return { token, accountId, refetch, isLoading, isError };
11
+ }
@@ -291,10 +291,16 @@ export interface AnySpendDepositHypeProps extends BaseModalProps {
291
291
  /** Callback function called when the deposit is successful */
292
292
  onSuccess?: (amount?: string) => void;
293
293
  }
294
+ export interface AvatarEditorModalProps extends BaseModalProps {
295
+ /** Modal type identifier */
296
+ type: "avatarEditor";
297
+ /** Callback function called when avatar is successfully set */
298
+ onSuccess?: () => void;
299
+ }
294
300
  /**
295
301
  * Union type of all possible modal content types
296
302
  */
297
- export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | AnySpendDepositHypeProps;
303
+ export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps;
298
304
  /**
299
305
  * State interface for the modal store
300
306
  */
@@ -0,0 +1,4 @@
1
+ export declare function updateAvatar(avatar: string): Promise<{
2
+ success: boolean;
3
+ error?: string;
4
+ }>;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.updateAvatar = updateAvatar;
37
+ const bsmnt_1 = __importStar(require("../../../global-account/bsmnt"));
38
+ const debug_1 = require("../../../shared/utils/debug");
39
+ const debug = (0, debug_1.debugB3React)("updateAvatar");
40
+ async function updateAvatar(avatar) {
41
+ try {
42
+ // Extract avatar ID from URL
43
+ const avatarID = (0, bsmnt_1.extractAvatarIdFromUrl)(avatar);
44
+ if (!avatarID) {
45
+ throw new Error("Invalid avatar URL");
46
+ }
47
+ // Set the avatar in the profiles service
48
+ return await bsmnt_1.default.service("profiles").setAvatar({ avatarUrl: String(avatar), avatarID: String(avatarID) }, {});
49
+ }
50
+ catch (error) {
51
+ debug("Failed to update avatar:", error);
52
+ throw error; // Re-throw to handle in component
53
+ }
54
+ }
@@ -1,4 +1,6 @@
1
1
  declare const app: import("@b3dotfun/basement-api").ClientApplication;
2
2
  export declare const authenticate: (accessToken: string, identityToken: string, params?: Record<string, any>) => Promise<import("@feathersjs/authentication").AuthenticationResult | null>;
3
3
  export declare const resetSocket: () => void;
4
+ export declare function extractAvatarIdFromUrl(url: string): string | null;
5
+ export declare const authenticateWithB3JWT: (fullToken: string, params?: Record<string, any>) => Promise<import("@feathersjs/authentication").AuthenticationResult | null>;
4
6
  export default app;
@@ -1,8 +1,10 @@
1
1
  import { createClient } from "@b3dotfun/basement-api";
2
+ import { debugB3React } from "../shared/utils/debug.js";
2
3
  import { AuthenticationClient } from "@feathersjs/authentication-client";
3
4
  import socketio from "@feathersjs/socketio-client";
4
5
  import Cookies from "js-cookie";
5
6
  import io from "socket.io-client";
7
+ const debug = debugB3React("bsmnt");
6
8
  // Also use b3 auth token since we are using b3-jwt strategy
7
9
  const BSMNT_AUTH_COOKIE_NAME = "b3-auth";
8
10
  const BSMNT_API_URL = process.env.EXPO_PUBLIC_BSMNT_API ||
@@ -58,4 +60,41 @@ export const resetSocket = () => {
58
60
  socket.connect();
59
61
  // reset the socket connection
60
62
  };
63
+ export function extractAvatarIdFromUrl(url) {
64
+ const regex = /https:\/\/models\.readyplayer\.me\/([a-f0-9]{24})\.[a-zA-Z0-9]+/;
65
+ const match = url.match(regex);
66
+ return match ? match[1] : null;
67
+ }
68
+ export const authenticateWithB3JWT = async (fullToken, params) => {
69
+ // Do not authenticate if there is no token
70
+ if (!fullToken) {
71
+ console.log("No token found, not authenticating");
72
+ return null;
73
+ }
74
+ debug("Authenticating with token:12", fullToken);
75
+ try {
76
+ const response = await app.authenticate({
77
+ strategy: "b3-jwt",
78
+ accessToken: fullToken,
79
+ }, {
80
+ query: params || {},
81
+ });
82
+ debug("Authenticated", response);
83
+ // Store streamToken if it exists in the response
84
+ if (response?.streamToken) {
85
+ Cookies.set("stream-token", response.streamToken, {
86
+ expires: new Date(response.authExpires),
87
+ secure: process.env.NODE_ENV === "production",
88
+ sameSite: "strict",
89
+ });
90
+ debug("Stream token stored in cookies");
91
+ }
92
+ return response;
93
+ }
94
+ catch (error) {
95
+ debug(`Authentication error:5`, error);
96
+ debug("Authentication JWT", fullToken);
97
+ return null;
98
+ }
99
+ };
61
100
  export default app;
@@ -0,0 +1,6 @@
1
+ interface AvatarCreatorProps {
2
+ onSetAvatar?: () => void;
3
+ className?: string;
4
+ }
5
+ export declare function AvatarCreator({ onSetAvatar, className }: AvatarCreatorProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,52 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useProfile } from "../../../../global-account/react/index.js";
4
+ import { useRPMToken } from "../../../../global-account/react/hooks/useRPMToken.js";
5
+ import { updateAvatar } from "../../../../global-account/react/utils/updateAvatar.js";
6
+ import { cn } from "../../../../shared/utils/cn.js";
7
+ import { debugB3React } from "../../../../shared/utils/debug.js";
8
+ import { AvatarCreator as AvatarCreatorRPM, } from "@readyplayerme/react-avatar-creator";
9
+ import { useState } from "react";
10
+ import { toast } from "sonner";
11
+ import { useActiveAccount } from "thirdweb/react";
12
+ const debug = debugB3React("AvatarCreator");
13
+ const config = {
14
+ clearCache: true,
15
+ bodyType: "fullbody",
16
+ quickStart: true,
17
+ language: "en",
18
+ };
19
+ export function AvatarCreator({ onSetAvatar, className }) {
20
+ const { token, refetch: refetchRPMToken } = useRPMToken();
21
+ const [loading, setIsLoading] = useState(false);
22
+ const account = useActiveAccount();
23
+ const { data: profile, refetch: refreshProfile } = useProfile({
24
+ address: account?.address,
25
+ fresh: true,
26
+ });
27
+ const hasAvatar = profile?.avatar;
28
+ const handleOnAvatarExported = async (event) => {
29
+ setIsLoading(true);
30
+ debug("@@AvatarExportedEvent", event);
31
+ try {
32
+ const avatarUpload = await updateAvatar(event.data.url);
33
+ debug("@@avatarUpload", avatarUpload);
34
+ await refreshProfile();
35
+ toast.success(hasAvatar ? "Nice look! Your avatar has been updated!" : "Looks great! Your avatar has been saved!");
36
+ onSetAvatar?.();
37
+ await refetchRPMToken(undefined);
38
+ }
39
+ catch (e) {
40
+ debug("@@error:AvatarCreator", e);
41
+ toast.error("Failed to update avatar. Please try again.");
42
+ }
43
+ setIsLoading(false);
44
+ };
45
+ if (loading) {
46
+ return (_jsxs("div", { className: "flex h-[80vh] w-full flex-col items-center justify-center gap-4", children: [_jsx("div", { className: "border-primary h-8 w-8 animate-spin rounded-full border-4 border-t-transparent" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: "Saving your avatar" })] }));
47
+ }
48
+ if (!token) {
49
+ return (_jsxs("div", { className: "flex h-[80vh] w-full flex-col items-center justify-center gap-4", children: [_jsx("div", { className: "border-primary h-8 w-8 animate-spin rounded-full border-4 border-t-transparent" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: "Loading avatar creator" })] }));
50
+ }
51
+ return (_jsx("div", { className: cn("h-[calc(90vh-2px)] w-full", className), children: _jsx(AvatarCreatorRPM, { className: "h-full w-full", subdomain: "b3", config: { ...config, token }, onAvatarExported: handleOnAvatarExported }) }));
52
+ }
@@ -0,0 +1,6 @@
1
+ interface AvatarEditorProps {
2
+ onSetAvatar?: () => void;
3
+ className?: string;
4
+ }
5
+ export declare function AvatarEditor({ onSetAvatar, className }: AvatarEditorProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,102 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import app from "../../../../global-account/app.js";
4
+ import { Button, useB3, useProfile } from "../../../../global-account/react/index.js";
5
+ import { cn } from "../../../../shared/utils/cn.js";
6
+ import { debugB3React } from "../../../../shared/utils/debug.js";
7
+ import { client } from "../../../../shared/utils/thirdweb.js";
8
+ import { Check, Loader2, Upload, X } from "lucide-react";
9
+ import { useRef, useState } from "react";
10
+ import { toast } from "sonner";
11
+ import { useActiveAccount } from "thirdweb/react";
12
+ import { upload } from "thirdweb/storage";
13
+ const debug = debugB3React("AvatarEditor");
14
+ export function AvatarEditor({ onSetAvatar, className }) {
15
+ const [selectedFile, setSelectedFile] = useState(null);
16
+ const [previewUrl, setPreviewUrl] = useState(null);
17
+ const [isUploading, setIsUploading] = useState(false);
18
+ const [isSaving, setIsSaving] = useState(false);
19
+ const fileInputRef = useRef(null);
20
+ const { setUser } = useB3();
21
+ const account = useActiveAccount();
22
+ const { data: profile, refetch: refreshProfile } = useProfile({
23
+ address: account?.address,
24
+ fresh: true,
25
+ });
26
+ // Thirdweb upload function
27
+ const hasAvatar = profile?.avatar;
28
+ const handleFileSelect = (event) => {
29
+ const file = event.target.files?.[0];
30
+ if (file) {
31
+ // Validate file type
32
+ if (!file.type.startsWith("image/")) {
33
+ toast.error("Please select an image file");
34
+ return;
35
+ }
36
+ // Validate file size (max 5MB)
37
+ if (file.size > 5 * 1024 * 1024) {
38
+ toast.error("File size must be less than 5MB");
39
+ return;
40
+ }
41
+ setSelectedFile(file);
42
+ // Create preview URL
43
+ const url = URL.createObjectURL(file);
44
+ setPreviewUrl(url);
45
+ }
46
+ };
47
+ const handleRemoveFile = () => {
48
+ setSelectedFile(null);
49
+ if (previewUrl) {
50
+ URL.revokeObjectURL(previewUrl);
51
+ setPreviewUrl(null);
52
+ }
53
+ if (fileInputRef.current) {
54
+ fileInputRef.current.value = "";
55
+ }
56
+ };
57
+ const handleUpload = async () => {
58
+ if (!selectedFile) {
59
+ toast.error("Please select an image first");
60
+ return;
61
+ }
62
+ setIsUploading(true);
63
+ try {
64
+ debug("Starting upload to IPFS", selectedFile);
65
+ // Upload to IPFS using Thirdweb
66
+ const ipfsUrl = await upload({
67
+ client,
68
+ files: [selectedFile],
69
+ });
70
+ debug("Upload successful", ipfsUrl);
71
+ // Save avatar URL using profiles service
72
+ setIsSaving(true);
73
+ const user = await app.service("users").setAvatar({
74
+ avatar: ipfsUrl,
75
+ },
76
+ // @ts-expect-error - our typed client is expecting context even though it's set elsewhere
77
+ {});
78
+ // update user
79
+ // @ts-expect-error this resolved fine, look into why expect-error needed
80
+ setUser(user);
81
+ // Refresh profile to get updated avatar
82
+ await refreshProfile();
83
+ toast.success(hasAvatar ? "Nice look! Your avatar has been updated!" : "Looks great! Your avatar has been saved!");
84
+ onSetAvatar?.();
85
+ // Clean up
86
+ handleRemoveFile();
87
+ }
88
+ catch (error) {
89
+ debug("Error uploading avatar:", error);
90
+ toast.error("Failed to upload avatar. Please try again.");
91
+ }
92
+ finally {
93
+ setIsUploading(false);
94
+ setIsSaving(false);
95
+ }
96
+ };
97
+ const handleFileInputClick = () => {
98
+ fileInputRef.current?.click();
99
+ };
100
+ const isLoading = isUploading || isSaving;
101
+ return (_jsxs("div", { className: cn("flex flex-col items-center justify-center space-y-6 p-8", className), children: [_jsxs("div", { className: "space-y-2 text-center", children: [_jsx("h2", { className: "font-neue-montreal-semibold text-b3-grey text-2xl", children: hasAvatar ? "Update Your Avatar" : "Set Your Avatar" }), _jsx("p", { className: "text-b3-foreground-muted font-neue-montreal-medium", children: "Upload an image to personalize your profile" })] }), hasAvatar && !previewUrl && (_jsx("div", { className: "relative", children: _jsx("div", { className: "border-b3-primary-blue h-32 w-32 overflow-hidden rounded-full border-4", children: _jsx("img", { src: profile.avatar, alt: "Current avatar", className: "h-full w-full object-cover" }) }) })), _jsxs("div", { className: "w-full max-w-md", children: [!selectedFile ? (_jsxs("div", { onClick: handleFileInputClick, className: "border-b3-line hover:border-b3-primary-blue hover:bg-b3-primary-wash/20 cursor-pointer rounded-xl border-2 border-dashed p-8 text-center transition-colors", children: [_jsx(Upload, { className: "text-b3-grey mx-auto mb-4 h-12 w-12" }), _jsx("p", { className: "text-b3-grey font-neue-montreal-semibold mb-2", children: "Click to select an image" }), _jsx("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "PNG, JPG, or GIF up to 5MB" })] })) : (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "relative", children: [_jsx("div", { className: "border-b3-primary-blue mx-auto h-32 w-32 overflow-hidden rounded-full border-4", children: previewUrl ? (_jsx("img", { src: previewUrl, alt: "Preview", className: "h-full w-full object-cover" })) : (_jsx("div", { className: "bg-b3-primary-wash flex h-full w-full items-center justify-center rounded-full", children: _jsx("p", { className: "text-b3-grey font-neue-montreal-semibold text-sm", children: "No file selected" }) })) }), _jsx("button", { onClick: handleRemoveFile, className: "bg-b3-negative absolute -right-2 -top-2 flex h-8 w-8 items-center justify-center rounded-full text-white transition-colors hover:bg-red-600", disabled: isLoading, children: _jsx(X, { size: 16 }) })] }), _jsxs("div", { className: "space-y-1 text-center", children: [_jsx("p", { className: "text-b3-grey font-neue-montreal-semibold text-sm", children: selectedFile.name }), _jsxs("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-xs", children: [(selectedFile.size / 1024 / 1024).toFixed(2), " MB"] })] })] })), _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", onChange: handleFileSelect, className: "hidden" })] }), _jsxs("div", { className: "flex w-full max-w-md gap-3", children: [selectedFile && (_jsx(Button, { onClick: handleUpload, disabled: isLoading, className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 flex-1 text-white", children: isLoading ? (_jsxs(_Fragment, { children: [_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), isUploading ? "Uploading..." : "Saving..."] })) : (_jsxs(_Fragment, { children: [_jsx(Check, { className: "mr-2 h-4 w-4" }), hasAvatar ? "Update Avatar" : "Set Avatar"] })) })), _jsxs(Button, { variant: "outline", onClick: handleFileInputClick, disabled: isLoading, className: "flex-1", children: [_jsx(Upload, { className: "mr-2 h-4 w-4" }), selectedFile ? "Change Image" : "Select Image"] })] }), _jsx("div", { className: "text-b3-foreground-muted font-neue-montreal-medium max-w-md text-center text-xs", children: _jsx("p", { children: "Your avatar will be uploaded to IPFS and stored securely. Make sure you have the rights to use this image." }) })] }));
102
+ }
@@ -4,6 +4,7 @@ import { AnySpendDepositHype } from "../../../anyspend/react/components/Anyspend
4
4
  import { useIsMobile, useModalStore } from "../../../global-account/react/index.js";
5
5
  import { cn } from "../../../shared/utils/cn.js";
6
6
  import { debugB3React } from "../../../shared/utils/debug.js";
7
+ import { AvatarEditor } from "./AvatarEditor/AvatarEditor.js";
7
8
  import { useB3 } from "./B3Provider/useB3.js";
8
9
  import { LinkAccount } from "./LinkAccount/LinkAccount.js";
9
10
  import { ManageAccount } from "./ManageAccount/ManageAccount.js";
@@ -29,6 +30,7 @@ export function B3DynamicModal() {
29
30
  "anySpendSignatureMint",
30
31
  "anySpendBondKit",
31
32
  "linkAccount",
33
+ "avatarEditor",
32
34
  ];
33
35
  const freestyleTypes = [
34
36
  "anySpendNft",
@@ -80,6 +82,8 @@ export function B3DynamicModal() {
80
82
  return _jsx(LinkAccount, { ...contentType });
81
83
  case "anySpendDepositHype":
82
84
  return _jsx(AnySpendDepositHype, { ...contentType, mode: "modal" });
85
+ case "avatarEditor":
86
+ return _jsx(AvatarEditor, { onSetAvatar: contentType.onSuccess });
83
87
  // Add other modal types here
84
88
  default:
85
89
  return null;
@@ -89,5 +93,9 @@ export function B3DynamicModal() {
89
93
  const ModalContent = isMobile ? DrawerContent : DialogContent;
90
94
  const ModalTitle = isMobile ? DrawerTitle : DialogTitle;
91
95
  const ModalDescription = isMobile ? DrawerDescription : DialogDescription;
92
- return (_jsx(ModalComponent, { open: isOpen, onOpenChange: setB3ModalOpen, children: _jsxs(ModalContent, { className: cn(contentClass, "rounded-2xl bg-white shadow-xl dark:bg-gray-900", "border border-gray-200 dark:border-gray-800", "mx-auto w-full max-w-md", "sm:max-w-lg sm:rounded-b-none"), hideCloseButton: hideCloseButton, children: [_jsx(ModalTitle, { className: "sr-only hidden", children: contentType?.type || "Modal" }), _jsx(ModalDescription, { className: "sr-only hidden", children: contentType?.type || "Modal Body" }), _jsxs("div", { className: cn("no-scrollbar max-h-[90dvh] overflow-auto sm:max-h-[80dvh]"), children: [history.length > 0 && contentType?.showBackButton && (_jsxs("button", { onClick: navigateBack, className: "flex items-center gap-2 px-6 py-4 text-gray-600 transition-colors hover:text-gray-900 dark:text-gray-400 dark:hover:text-white", children: [_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M15.8337 10H4.16699", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M10.0003 15.8334L4.16699 10L10.0003 4.16669", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }), _jsx("span", { className: "text-sm font-medium", children: "Back" })] })), renderContent()] })] }) }));
96
+ return (_jsxs(ModalComponent, { open: isOpen, onOpenChange: setB3ModalOpen, children: [_jsxs(ModalContent, { className: cn(contentClass, "rounded-2xl bg-white shadow-xl dark:bg-gray-900", "border border-gray-200 dark:border-gray-800",
97
+ // Remove default width classes for avatar editor
98
+ contentType?.type === "avatarEditor"
99
+ ? "!w-[90vw] !max-w-none" // Use !important to override default styles
100
+ : "mx-auto w-full max-w-md sm:max-w-lg"), hideCloseButton: hideCloseButton, children: [_jsx(ModalTitle, { className: "sr-only hidden", children: contentType?.type || "Modal" }), _jsx(ModalDescription, { className: "sr-only hidden", children: contentType?.type || "Modal Body" }), _jsxs("div", { className: cn("no-scrollbar max-h-[90dvh] overflow-auto sm:max-h-[80dvh]"), children: [history.length > 0 && contentType?.showBackButton && (_jsxs("button", { onClick: navigateBack, className: "flex items-center gap-2 px-6 py-4 text-gray-600 transition-colors hover:text-gray-900 dark:text-gray-400 dark:hover:text-white", children: [_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M15.8337 10H4.16699", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M10.0003 15.8334L4.16699 10L10.0003 4.16669", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }), _jsx("span", { className: "text-sm font-medium", children: "Back" })] })), renderContent()] })] }), contentType?.type === "avatarEditor" && (_jsx("button", { onClick: () => setB3ModalOpen(false), className: "fixed right-5 top-5 z-[100] cursor-pointer text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white", children: _jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M18 6L6 18M6 6L18 18", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) }))] }));
93
101
  }
@@ -1,2 +1,4 @@
1
1
  import { LinkAccountModalProps } from "../../stores/useModalStore";
2
- export declare function LinkAccount({ onSuccess: onSuccessCallback, onError, onClose, chain, partnerId, }: LinkAccountModalProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function LinkAccount({ onSuccess: onSuccessCallback, onError, onClose, chain, partnerId, className, }: LinkAccountModalProps & {
3
+ className?: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import app from "../../../../global-account/app.js";
2
3
  import { ecosystemWalletId } from "../../../../shared/constants/index.js";
3
4
  import { client } from "../../../../shared/utils/thirdweb.js";
4
- import { Loader2 } from "lucide-react";
5
+ import { Loader2, Mail, Phone } from "lucide-react";
5
6
  import { useCallback, useEffect, useState } from "react";
6
7
  import { toast } from "sonner";
7
8
  import { useLinkProfile, useProfiles } from "thirdweb/react";
@@ -9,18 +10,27 @@ import { preAuthenticate } from "thirdweb/wallets";
9
10
  import { useModalStore } from "../../stores/useModalStore.js";
10
11
  import { getProfileDisplayInfo } from "../../utils/profileDisplay.js";
11
12
  import { useB3 } from "../B3Provider/useB3.js";
13
+ import { AppleIcon } from "../icons/AppleIcon.js";
14
+ import { DiscordIcon } from "../icons/DiscordIcon.js";
15
+ import { FarcasterIcon } from "../icons/FarcasterIcon.js";
16
+ import { GoogleIcon } from "../icons/GoogleIcon.js";
17
+ import { XIcon } from "../icons/XIcon.js";
12
18
  import { Button } from "../ui/button.js";
13
- import app from "../../../../global-account/app.js";
14
19
  const AUTH_METHODS = [
15
- { id: "email", label: "Email", enabled: true },
16
- { id: "phone", label: "Phone", enabled: true },
17
- { id: "google", label: "Google", enabled: true },
18
- { id: "x", label: "X (Twitter)", enabled: true },
19
- { id: "discord", label: "Discord", enabled: true },
20
- { id: "apple", label: "Apple", enabled: true },
21
- { id: "farcaster", label: "Farcaster", enabled: true },
20
+ { id: "email", label: "Email", enabled: true, icon: _jsx(Mail, { className: "text-b3-primary-blue size-6" }) },
21
+ { id: "phone", label: "Phone", enabled: true, icon: _jsx(Phone, { className: "text-b3-primary-blue size-6" }) },
22
+ { id: "google", label: "Google", enabled: true, icon: _jsx(GoogleIcon, { className: "size-6" }) },
23
+ { id: "x", label: "X (Twitter)", enabled: true, icon: _jsx(XIcon, { className: "size-6" }) },
24
+ { id: "discord", label: "Discord", enabled: true, icon: _jsx(DiscordIcon, { className: "size-6" }) },
25
+ { id: "apple", label: "Apple", enabled: true, icon: _jsx(AppleIcon, { className: "size-6" }) },
26
+ {
27
+ id: "farcaster",
28
+ label: "Farcaster",
29
+ enabled: true,
30
+ icon: _jsx(FarcasterIcon, { className: "size-6" }),
31
+ },
22
32
  ];
23
- export function LinkAccount({ onSuccess: onSuccessCallback, onError, onClose, chain, partnerId, }) {
33
+ export function LinkAccount({ onSuccess: onSuccessCallback, onError, onClose, chain, partnerId, className, }) {
24
34
  const { isLinking, linkingMethod, setLinkingState, navigateBack, setB3ModalContentType } = useModalStore();
25
35
  const [selectedMethod, setSelectedMethod] = useState(null);
26
36
  const [email, setEmail] = useState("");
@@ -239,12 +249,12 @@ export function LinkAccount({ onSuccess: onSuccessCallback, onError, onClose, ch
239
249
  if (!account) {
240
250
  return _jsx("div", { className: "text-b3-foreground-muted py-8 text-center", children: "Please connect your account first" });
241
251
  }
242
- return (_jsxs("div", { className: "space-y-6 p-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-b3-grey font-neue-montreal-semibold text-2xl", children: "Link New Account" }), selectedMethod && (_jsx(Button, { variant: "ghost", className: "text-b3-grey hover:text-b3-grey/80", onClick: handleBack, children: "Backs" }))] }), !selectedMethod ? (_jsxs("div", { className: "grid gap-3", children: [availableAuthMethods.map(method => (_jsx(Button, { className: "bg-b3-primary-wash hover:bg-b3-primary-wash/70 text-b3-grey font-neue-montreal-semibold h-16 justify-start px-6 text-lg", onClick: () => {
252
+ return (_jsxs("div", { className: `b3-link-account space-y-6 p-6 ${className || ""}`, "data-testid": "link-account", children: [_jsxs("div", { className: "b3-link-account-header flex items-center justify-between", children: [_jsx("h2", { className: "b3-link-account-title text-b3-grey font-neue-montreal-semibold text-2xl", children: "Link New Account" }), selectedMethod && (_jsx(Button, { variant: "ghost", className: "text-b3-grey hover:text-b3-grey/80", onClick: handleBack, children: "Backs" }))] }), !selectedMethod ? (_jsxs("div", { className: "b3-link-account-methods grid gap-3", children: [availableAuthMethods.map(method => (_jsx(Button, { variant: "outline", className: "b3-link-account-method-button border-b3-line hover:border-b3-primary-blue/30 hover:bg-b3-primary-blue/5 text-b3-grey font-neue-montreal-medium h-14 justify-start bg-transparent px-6 text-base transition-all duration-200", "data-method": method.id, onClick: () => {
243
253
  if (method.id === "email" || method.id === "phone") {
244
254
  setSelectedMethod(method.id);
245
255
  }
246
256
  else {
247
257
  handleSocialLink(method.id);
248
258
  }
249
- }, disabled: linkingMethod === method.id, children: isLinking && linkingMethod === method.id ? _jsx(Loader2, { className: "animate-spin" }) : method.label }, method.id))), availableAuthMethods.length === 0 && (_jsx("div", { className: "text-b3-foreground-muted py-8 text-center", children: "All available authentication methods have been connected" }))] })) : (_jsxs("div", { className: "space-y-4", children: [selectedMethod === "email" && (_jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-b3-grey font-neue-montreal-medium text-sm", children: "Email Address" }), _jsx("input", { type: "email", placeholder: "Enter your email", className: "bg-b3-line text-b3-grey font-neue-montreal-medium focus:ring-b3-primary-blue/20 w-full rounded-xl p-4 focus:outline-none focus:ring-2", value: email, onChange: e => setEmail(e.target.value), disabled: otpSent || (isLinking && linkingMethod === "email") })] })), selectedMethod === "phone" && (_jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-b3-grey font-neue-montreal-medium text-sm", children: "Phone Number" }), _jsx("input", { type: "tel", placeholder: "Enter your phone number", className: "bg-b3-line text-b3-grey font-neue-montreal-medium focus:ring-b3-primary-blue/20 w-full rounded-xl p-4 focus:outline-none focus:ring-2", value: phone, onChange: e => setPhone(e.target.value), disabled: otpSent || (isLinking && linkingMethod === "phone") }), _jsx("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "Include country code (e.g., +1 for US)" })] })), error && _jsx("div", { className: "text-b3-negative font-neue-montreal-medium py-2 text-sm", children: error }), otpSent ? (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-b3-grey font-neue-montreal-medium text-sm", children: "Verification Code" }), _jsx("input", { type: "text", placeholder: "Enter verification code", className: "bg-b3-line text-b3-grey font-neue-montreal-medium focus:ring-b3-primary-blue/20 w-full rounded-xl p-4 focus:outline-none focus:ring-2", value: otp, onChange: e => setOtp(e.target.value) })] }), _jsx(Button, { className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 font-neue-montreal-semibold h-12 w-full text-white", onClick: handleLinkAccount, children: "Link Account" })] })) : (_jsx(Button, { className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 font-neue-montreal-semibold h-12 w-full text-white", onClick: handleSendOTP, disabled: (!email && !phone) || (isLinking && linkingMethod === selectedMethod), children: isLinking && linkingMethod === selectedMethod ? (_jsx(Loader2, { className: "animate-spin" })) : ("Send Verification Code") }))] }))] }));
259
+ }, disabled: linkingMethod === method.id, children: isLinking && linkingMethod === method.id ? (_jsx(Loader2, { className: "h-5 w-5 animate-spin" })) : (_jsxs("div", { className: "b3-link-account-method-content flex items-center gap-4", children: [_jsx("div", { className: "b3-link-account-method-icon flex items-center justify-center rounded-full", children: method.icon }), _jsx("span", { className: "b3-link-account-method-label font-medium", children: method.label })] })) }, method.id))), availableAuthMethods.length === 0 && (_jsx("div", { className: "text-b3-foreground-muted py-8 text-center", children: "All available authentication methods have been connected" }))] })) : (_jsxs("div", { className: "b3-link-account-form space-y-4", children: [selectedMethod === "email" && (_jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-b3-grey font-neue-montreal-medium text-sm", children: "Email Address" }), _jsx("input", { type: "email", placeholder: "Enter your email", className: "bg-b3-line text-b3-grey font-neue-montreal-medium focus:ring-b3-primary-blue/20 w-full rounded-xl p-4 focus:outline-none focus:ring-2", value: email, onChange: e => setEmail(e.target.value), disabled: otpSent || (isLinking && linkingMethod === "email") })] })), selectedMethod === "phone" && (_jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-b3-grey font-neue-montreal-medium text-sm", children: "Phone Number" }), _jsx("input", { type: "tel", placeholder: "Enter your phone number", className: "bg-b3-line text-b3-grey font-neue-montreal-medium focus:ring-b3-primary-blue/20 w-full rounded-xl p-4 focus:outline-none focus:ring-2", value: phone, onChange: e => setPhone(e.target.value), disabled: otpSent || (isLinking && linkingMethod === "phone") }), _jsx("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "Include country code (e.g., +1 for US)" })] })), error && _jsx("div", { className: "text-b3-negative font-neue-montreal-medium py-2 text-sm", children: error }), otpSent ? (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-b3-grey font-neue-montreal-medium text-sm", children: "Verification Code" }), _jsx("input", { type: "text", placeholder: "Enter verification code", className: "bg-b3-line text-b3-grey font-neue-montreal-medium focus:ring-b3-primary-blue/20 w-full rounded-xl p-4 focus:outline-none focus:ring-2", value: otp, onChange: e => setOtp(e.target.value) })] }), _jsx(Button, { className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 font-neue-montreal-semibold h-12 w-full text-white", onClick: handleLinkAccount, children: "Link Account" })] })) : (_jsx(Button, { className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 font-neue-montreal-semibold h-12 w-full text-white", onClick: handleSendOTP, disabled: (!email && !phone) || (isLinking && linkingMethod === selectedMethod), children: isLinking && linkingMethod === selectedMethod ? (_jsx(Loader2, { className: "animate-spin" })) : ("Send Verification Code") }))] }))] }));
250
260
  }
@@ -1,9 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, CopyToClipboard, useAuthentication, useB3BalanceFromAddresses, useModalStore, useNativeBalance, useProfile, } from "../../../../global-account/react/index.js";
2
+ import { Button, CopyToClipboard, useAuthentication, useB3, useB3BalanceFromAddresses, useModalStore, useNativeBalance, useProfile, } from "../../../../global-account/react/index.js";
3
3
  import { BankIcon } from "../../../../global-account/react/components/icons/BankIcon.js";
4
4
  import { SignOutIcon } from "../../../../global-account/react/components/icons/SignOutIcon.js";
5
5
  import { SwapIcon } from "../../../../global-account/react/components/icons/SwapIcon.js";
6
6
  import { formatUsername } from "../../../../shared/utils/index.js";
7
+ import { getIpfsUrl } from "../../../../shared/utils/ipfs.js";
7
8
  import { Loader2, Pencil } from "lucide-react";
8
9
  import { useEffect, useRef, useState } from "react";
9
10
  import { useActiveAccount } from "thirdweb/react";
@@ -23,11 +24,24 @@ export function BalanceContent({ onLogout, partnerId, showDeposit = true, showSw
23
24
  address: eoaAddress || account?.address,
24
25
  fresh: true,
25
26
  });
26
- const { setB3ModalOpen, setB3ModalContentType } = useModalStore();
27
+ const { user } = useB3();
28
+ const { setB3ModalOpen, setB3ModalContentType, navigateBack } = useModalStore();
27
29
  const { logout } = useAuthentication(partnerId);
28
30
  const [logoutLoading, setLogoutLoading] = useState(false);
29
31
  const [openAccordions, setOpenAccordions] = useState([]);
30
32
  const hasExpandedRef = useRef(false);
33
+ const avatarUrl = user?.avatar ? getIpfsUrl(user?.avatar) : profile?.avatar;
34
+ const handleEditAvatar = () => {
35
+ setB3ModalOpen(true);
36
+ setB3ModalContentType({
37
+ type: "avatarEditor",
38
+ showBackButton: true,
39
+ onSuccess: () => {
40
+ // navigate back on success
41
+ navigateBack();
42
+ },
43
+ });
44
+ };
31
45
  console.log("eoaAddress", eoaAddress);
32
46
  console.log("account?.address", account?.address);
33
47
  // Balance data fetching
@@ -71,7 +85,7 @@ export function BalanceContent({ onLogout, partnerId, showDeposit = true, showSw
71
85
  setB3ModalOpen(false);
72
86
  setLogoutLoading(false);
73
87
  };
74
- return (_jsxs("div", { className: "flex flex-col gap-6", children: [_jsx("div", { className: "flex items-center justify-between", children: _jsxs("div", { className: "global-account-profile flex items-center gap-4", children: [_jsxs("div", { className: "global-account-profile-avatar relative", children: [profile?.avatar ? (_jsx("img", { src: profile?.avatar, alt: "Profile", className: "size-24 rounded-full" })) : (_jsx("div", { className: "bg-b3-primary-wash size-24 rounded-full" })), _jsx("div", { className: "bg-b3-grey border-b3-background absolute -bottom-1 -right-1 flex size-8 items-center justify-center rounded-full border-4", children: _jsx(Pencil, { size: 16, className: "text-b3-background" }) })] }), _jsxs("div", { className: "global-account-profile-info", children: [_jsx("h2", { className: "text-b3-grey text-xl font-semibold", children: profile?.displayName || formatUsername(profile?.name || "") }), _jsxs("div", { className: "address-button border-b3-line bg-b3-line/20 hover:bg-b3-line/40 flex w-fit items-center gap-2 rounded-full border px-3 py-1 transition-colors", children: [_jsx("span", { className: "text-b3-foreground-muted font-mono text-xs", children: centerTruncate(account?.address || "", 6) }), _jsx(CopyToClipboard, { text: account?.address || "" })] })] })] }) }), (showDeposit || showSwap) && (_jsxs("div", { className: "grid grid-cols-2 gap-3", children: [showDeposit && (_jsxs(Button, { className: "manage-account-deposit bg-b3-primary-wash hover:bg-b3-primary-wash/70 h-[84px] w-full flex-col items-start gap-2 rounded-2xl", onClick: () => {
88
+ return (_jsxs("div", { className: "flex flex-col gap-6", children: [_jsx("div", { className: "flex items-center justify-between", children: _jsxs("div", { className: "global-account-profile flex items-center gap-4", children: [_jsxs("div", { className: "global-account-profile-avatar relative", children: [avatarUrl ? (_jsx("img", { src: avatarUrl, alt: "Profile", className: "size-24 rounded-full" })) : (_jsx("div", { className: "bg-b3-primary-wash size-24 rounded-full" })), _jsx("button", { onClick: handleEditAvatar, className: "bg-b3-grey border-b3-background hover:bg-b3-grey/80 absolute -bottom-1 -right-1 flex size-8 items-center justify-center rounded-full border-4 transition-colors", children: _jsx(Pencil, { size: 16, className: "text-b3-background" }) })] }), _jsxs("div", { className: "global-account-profile-info", children: [_jsx("h2", { className: "text-b3-grey text-xl font-semibold", children: profile?.displayName || formatUsername(profile?.name || "") }), _jsxs("div", { className: "address-button border-b3-line bg-b3-line/20 hover:bg-b3-line/40 flex w-fit items-center gap-2 rounded-full border px-3 py-1 transition-colors", children: [_jsx("span", { className: "text-b3-foreground-muted font-mono text-xs", children: centerTruncate(account?.address || "", 6) }), _jsx(CopyToClipboard, { text: account?.address || "" })] })] })] }) }), (showDeposit || showSwap) && (_jsxs("div", { className: "grid grid-cols-2 gap-3", children: [showDeposit && (_jsxs(Button, { className: "manage-account-deposit bg-b3-primary-wash hover:bg-b3-primary-wash/70 h-[84px] w-full flex-col items-start gap-2 rounded-2xl", onClick: () => {
75
89
  setB3ModalOpen(true);
76
90
  setB3ModalContentType({
77
91
  type: "anySpend",
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export interface AppleIconProps {
3
+ className?: string;
4
+ size?: number;
5
+ color?: string;
6
+ style?: React.CSSProperties;
7
+ }
8
+ export declare function AppleIcon({ className, size, color, style }: AppleIconProps): import("react/jsx-runtime").JSX.Element;
9
+ export default AppleIcon;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function AppleIcon({ className, size = 24, color = "currentColor", style }) {
3
+ return (_jsx("svg", { width: size, height: size, viewBox: "0 0 41.5 51", xmlns: "http://www.w3.org/2000/svg", className: className, style: style, children: _jsx("g", { children: _jsx("path", { fill: color, d: "M40.2,17.4c-3.4,2.1-5.5,5.7-5.5,9.7c0,4.5,2.7,8.6,6.8,10.3c-0.8,2.6-2,5-3.5,7.2c-2.2,3.1-4.5,6.3-7.9,6.3s-4.4-2-8.4-2\n\t\tc-3.9,0-5.3,2.1-8.5,2.1s-5.4-2.9-7.9-6.5C2,39.5,0.1,33.7,0,27.6c0-9.9,6.4-15.2,12.8-15.2c3.4,0,6.2,2.2,8.3,2.2\n\t\tc2,0,5.2-2.3,9-2.3C34.1,12.2,37.9,14.1,40.2,17.4z M28.3,8.1C30,6.1,30.9,3.6,31,1c0-0.3,0-0.7-0.1-1c-2.9,0.3-5.6,1.7-7.5,3.9\n\t\tc-1.7,1.9-2.7,4.3-2.8,6.9c0,0.3,0,0.6,0.1,0.9c0.2,0,0.5,0.1,0.7,0.1C24.1,11.6,26.6,10.2,28.3,8.1z" }) }) }));
4
+ }
5
+ export default AppleIcon;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export interface DiscordIconProps {
3
+ className?: string;
4
+ size?: number;
5
+ color?: string;
6
+ style?: React.CSSProperties;
7
+ }
8
+ export declare function DiscordIcon({ className, size, color, style }: DiscordIconProps): import("react/jsx-runtime").JSX.Element;
9
+ export default DiscordIcon;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function DiscordIcon({ className, size = 24, color = "#5865F2", style }) {
3
+ return (_jsx("svg", { width: size, height: size, viewBox: "0 -28.5 256 256", xmlns: "http://www.w3.org/2000/svg", className: className, style: style, preserveAspectRatio: "xMidYMid", children: _jsx("g", { children: _jsx("path", { d: "M216.856339,16.5966031 C200.285002,8.84328665 182.566144,3.2084988 164.041564,0 C161.766523,4.11318106 159.108624,9.64549908 157.276099,14.0464379 C137.583995,11.0849896 118.072967,11.0849896 98.7430163,14.0464379 C96.9108417,9.64549908 94.1925838,4.11318106 91.8971895,0 C73.3526068,3.2084988 55.6133949,8.86399117 39.0420583,16.6376612 C5.61752293,67.146514 -3.4433191,116.400813 1.08711069,164.955721 C23.2560196,181.510915 44.7403634,191.567697 65.8621325,198.148576 C71.0772151,190.971126 75.7283628,183.341335 79.7352139,175.300261 C72.104019,172.400575 64.7949724,168.822202 57.8887866,164.667963 C59.7209612,163.310589 61.5131304,161.891452 63.2445898,160.431257 C105.36741,180.133187 151.134928,180.133187 192.754523,160.431257 C194.506336,161.891452 196.298154,163.310589 198.110326,164.667963 C191.183787,168.842556 183.854737,172.420929 176.223542,175.320965 C180.230393,183.341335 184.861538,190.991831 190.096624,198.16893 C211.238746,191.588051 232.743023,181.531619 254.911949,164.955721 C260.227747,108.668201 245.831087,59.8662432 216.856339,16.5966031 Z M85.4738752,135.09489 C72.8290281,135.09489 62.4592217,123.290155 62.4592217,108.914901 C62.4592217,94.5396472 72.607595,82.7145587 85.4738752,82.7145587 C98.3405064,82.7145587 108.709962,94.5189427 108.488529,108.914901 C108.508531,123.290155 98.3405064,135.09489 85.4738752,135.09489 Z M170.525237,135.09489 C157.88039,135.09489 147.510584,123.290155 147.510584,108.914901 C147.510584,94.5396472 157.658606,82.7145587 170.525237,82.7145587 C183.391518,82.7145587 193.761324,94.5189427 193.539891,108.914901 C193.539891,123.290155 183.391518,135.09489 170.525237,135.09489 Z", fill: color, fillRule: "nonzero" }) }) }));
4
+ }
5
+ export default DiscordIcon;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export interface FarcasterIconProps {
3
+ className?: string;
4
+ size?: number;
5
+ color?: string;
6
+ style?: React.CSSProperties;
7
+ }
8
+ export declare function FarcasterIcon({ className, size, color, style }: FarcasterIconProps): import("react/jsx-runtime").JSX.Element;
9
+ export default FarcasterIcon;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function FarcasterIcon({ className, size = 24, color = "#855DCD", style }) {
3
+ return (_jsxs("svg", { width: size, height: size, viewBox: "0 0 1000 1000", xmlns: "http://www.w3.org/2000/svg", className: className, style: style, children: [_jsx("rect", { width: "1000", height: "1000", rx: "200", fill: color }), _jsx("path", { d: "M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z", fill: "white" }), _jsx("path", { d: "M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z", fill: "white" }), _jsx("path", { d: "M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z", fill: "white" })] }));
4
+ }
5
+ export default FarcasterIcon;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ export interface GoogleIconProps {
3
+ className?: string;
4
+ size?: number;
5
+ style?: React.CSSProperties;
6
+ }
7
+ export declare function GoogleIcon({ className, size, style }: GoogleIconProps): import("react/jsx-runtime").JSX.Element;
8
+ export default GoogleIcon;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function GoogleIcon({ className, size = 24, style }) {
3
+ return (_jsxs("svg", { width: size, height: size, viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg", className: className, style: style, children: [_jsx("path", { fill: "#EA4335", d: "M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z" }), _jsx("path", { fill: "#4285F4", d: "M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z" }), _jsx("path", { fill: "#FBBC05", d: "M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z" }), _jsx("path", { fill: "#34A853", d: "M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z" }), _jsx("path", { fill: "none", d: "M0 0h48v48H0z" })] }));
4
+ }
5
+ export default GoogleIcon;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export interface XIconProps {
3
+ className?: string;
4
+ size?: number;
5
+ color?: string;
6
+ style?: React.CSSProperties;
7
+ }
8
+ export declare function XIcon({ className, size, color, style }: XIconProps): import("react/jsx-runtime").JSX.Element;
9
+ export default XIcon;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function XIcon({ className, size = 24, color = "currentColor", style }) {
3
+ return (_jsx("svg", { width: size, height: size, viewBox: "0 0 300 300.251", xmlns: "http://www.w3.org/2000/svg", className: className, style: style, children: _jsx("path", { d: "M178.57 127.15 290.27 0h-26.46l-97.03 110.38L89.34 0H0l117.13 166.93L0 300.25h26.46l102.4-116.59 81.8 116.59h89.34M36.01 19.54H76.66l187.13 262.13h-40.66", fill: color }) }));
4
+ }
5
+ export default XIcon;