@b3dotfun/sdk 0.0.35 → 0.0.36
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/cjs/anyspend/react/components/AnySpend.js +5 -3
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/cjs/anyspend/react/components/common/ConnectWalletPayment.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/ConnectWalletPayment.js +5 -2
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.d.ts +16 -0
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.js +58 -0
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +22 -15
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +12 -4
- package/dist/cjs/anyspend/react/components/common/PaySection.d.ts +2 -6
- package/dist/cjs/anyspend/react/components/common/PaySection.js +10 -15
- package/dist/cjs/anyspend/react/components/index.d.ts +2 -2
- package/dist/cjs/anyspend/react/components/index.js +5 -5
- package/dist/cjs/global-account/bsmnt.d.ts +2 -0
- package/dist/cjs/global-account/bsmnt.js +42 -1
- package/dist/cjs/global-account/react/components/AvatarCreator/AvatarCreator.d.ts +6 -0
- package/dist/cjs/global-account/react/components/AvatarCreator/AvatarCreator.js +55 -0
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +6 -0
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +108 -0
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +9 -1
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.d.ts +3 -1
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +21 -11
- package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.d.ts +3 -1
- package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.js +19 -5
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.d.ts +3 -1
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +6 -6
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3.js +2 -2
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -13
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -3
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.js +0 -3
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +0 -3
- package/dist/cjs/global-account/react/components/icons/AppleIcon.d.ts +9 -0
- package/dist/cjs/global-account/react/components/icons/AppleIcon.js +8 -0
- package/dist/cjs/global-account/react/components/icons/DiscordIcon.d.ts +9 -0
- package/dist/cjs/global-account/react/components/icons/DiscordIcon.js +8 -0
- package/dist/cjs/global-account/react/components/icons/FarcasterIcon.d.ts +9 -0
- package/dist/cjs/global-account/react/components/icons/FarcasterIcon.js +8 -0
- package/dist/cjs/global-account/react/components/icons/GoogleIcon.d.ts +8 -0
- package/dist/cjs/global-account/react/components/icons/GoogleIcon.js +8 -0
- package/dist/cjs/global-account/react/components/icons/XIcon.d.ts +9 -0
- package/dist/cjs/global-account/react/components/icons/XIcon.js +8 -0
- package/dist/cjs/global-account/react/hooks/useAccountWallet.js +3 -2
- package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +1 -2
- package/dist/cjs/global-account/react/hooks/useAuthentication.js +16 -15
- package/dist/cjs/global-account/react/hooks/useProfile.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useRPMToken.d.ts +7 -0
- package/dist/cjs/global-account/react/hooks/useRPMToken.js +11 -0
- package/dist/cjs/global-account/react/stores/useAuthStore.d.ts +2 -4
- package/dist/cjs/global-account/react/stores/useAuthStore.js +2 -4
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +11 -1
- package/dist/cjs/global-account/react/utils/updateAvatar.d.ts +4 -0
- package/dist/cjs/global-account/react/utils/updateAvatar.js +54 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +5 -3
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/esm/anyspend/react/components/common/ConnectWalletPayment.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/ConnectWalletPayment.js +5 -2
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.d.ts +16 -0
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.js +55 -0
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +1 -0
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +22 -15
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +12 -4
- package/dist/esm/anyspend/react/components/common/PaySection.d.ts +2 -6
- package/dist/esm/anyspend/react/components/common/PaySection.js +10 -15
- package/dist/esm/anyspend/react/components/index.d.ts +2 -2
- package/dist/esm/anyspend/react/components/index.js +2 -2
- package/dist/esm/global-account/bsmnt.d.ts +2 -0
- package/dist/esm/global-account/bsmnt.js +39 -0
- package/dist/esm/global-account/react/components/AvatarCreator/AvatarCreator.d.ts +6 -0
- package/dist/esm/global-account/react/components/AvatarCreator/AvatarCreator.js +52 -0
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +6 -0
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +102 -0
- package/dist/esm/global-account/react/components/B3DynamicModal.js +9 -1
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.d.ts +3 -1
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +22 -12
- package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.d.ts +3 -1
- package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.js +20 -6
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.d.ts +3 -1
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +6 -6
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -13
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -3
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +0 -3
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +0 -3
- package/dist/esm/global-account/react/components/icons/AppleIcon.d.ts +9 -0
- package/dist/esm/global-account/react/components/icons/AppleIcon.js +5 -0
- package/dist/esm/global-account/react/components/icons/DiscordIcon.d.ts +9 -0
- package/dist/esm/global-account/react/components/icons/DiscordIcon.js +5 -0
- package/dist/esm/global-account/react/components/icons/FarcasterIcon.d.ts +9 -0
- package/dist/esm/global-account/react/components/icons/FarcasterIcon.js +5 -0
- package/dist/esm/global-account/react/components/icons/GoogleIcon.d.ts +8 -0
- package/dist/esm/global-account/react/components/icons/GoogleIcon.js +5 -0
- package/dist/esm/global-account/react/components/icons/XIcon.d.ts +9 -0
- package/dist/esm/global-account/react/components/icons/XIcon.js +5 -0
- package/dist/esm/global-account/react/hooks/useAccountWallet.js +3 -2
- package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +1 -2
- package/dist/esm/global-account/react/hooks/useAuthentication.js +16 -15
- package/dist/esm/global-account/react/hooks/useProfile.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useRPMToken.d.ts +7 -0
- package/dist/esm/global-account/react/hooks/useRPMToken.js +8 -0
- package/dist/esm/global-account/react/stores/useAuthStore.d.ts +2 -4
- package/dist/esm/global-account/react/stores/useAuthStore.js +2 -4
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +11 -1
- package/dist/esm/global-account/react/utils/updateAvatar.d.ts +4 -0
- package/dist/esm/global-account/react/utils/updateAvatar.js +18 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/common/ConnectWalletPayment.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/CryptoPaySection.d.ts +16 -0
- package/dist/types/anyspend/react/components/common/CryptoPaymentMethod.d.ts +1 -0
- package/dist/types/anyspend/react/components/common/PaySection.d.ts +2 -6
- package/dist/types/anyspend/react/components/index.d.ts +2 -2
- package/dist/types/global-account/bsmnt.d.ts +2 -0
- package/dist/types/global-account/react/components/AvatarCreator/AvatarCreator.d.ts +6 -0
- package/dist/types/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +6 -0
- package/dist/types/global-account/react/components/LinkAccount/LinkAccount.d.ts +3 -1
- package/dist/types/global-account/react/components/ManageAccount/BalanceContent.d.ts +3 -1
- package/dist/types/global-account/react/components/ManageAccount/ManageAccount.d.ts +3 -1
- package/dist/types/global-account/react/components/icons/AppleIcon.d.ts +9 -0
- package/dist/types/global-account/react/components/icons/DiscordIcon.d.ts +9 -0
- package/dist/types/global-account/react/components/icons/FarcasterIcon.d.ts +9 -0
- package/dist/types/global-account/react/components/icons/GoogleIcon.d.ts +8 -0
- package/dist/types/global-account/react/components/icons/XIcon.d.ts +9 -0
- package/dist/types/global-account/react/hooks/useAuthentication.d.ts +1 -2
- package/dist/types/global-account/react/hooks/useProfile.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useRPMToken.d.ts +7 -0
- package/dist/types/global-account/react/stores/useAuthStore.d.ts +2 -4
- package/dist/types/global-account/react/stores/useModalStore.d.ts +11 -1
- package/dist/types/global-account/react/utils/updateAvatar.d.ts +4 -0
- package/package.json +8 -7
- package/src/anyspend/react/components/AnySpend.tsx +7 -6
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +2 -5
- package/src/anyspend/react/components/common/ConnectWalletPayment.tsx +6 -1
- package/src/anyspend/react/components/common/CryptoPaySection.tsx +153 -0
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +80 -43
- package/src/anyspend/react/components/common/OrderDetails.tsx +13 -4
- package/src/anyspend/react/components/common/PaySection.tsx +64 -140
- package/src/anyspend/react/components/index.ts +2 -2
- package/src/global-account/bsmnt.ts +47 -0
- package/src/global-account/react/components/AvatarCreator/AvatarCreator.tsx +90 -0
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +233 -0
- package/src/global-account/react/components/B3DynamicModal.tsx +27 -2
- package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +40 -18
- package/src/global-account/react/components/ManageAccount/BalanceContent.tsx +63 -35
- package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +106 -78
- package/src/global-account/react/components/SignInWithB3/SignInWithB3.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +1 -13
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +1 -3
- package/src/global-account/react/components/SignInWithB3/steps/LoginStep.tsx +0 -3
- package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +0 -3
- package/src/global-account/react/components/icons/AppleIcon.tsx +33 -0
- package/src/global-account/react/components/icons/DiscordIcon.tsx +32 -0
- package/src/global-account/react/components/icons/FarcasterIcon.tsx +37 -0
- package/src/global-account/react/components/icons/GoogleIcon.tsx +40 -0
- package/src/global-account/react/components/icons/XIcon.tsx +28 -0
- package/src/global-account/react/hooks/useAccountWallet.tsx +3 -2
- package/src/global-account/react/hooks/useAuthentication.ts +18 -15
- package/src/global-account/react/hooks/useProfile.ts +1 -1
- package/src/global-account/react/hooks/useRPMToken.ts +17 -0
- package/src/global-account/react/stores/useAuthStore.ts +4 -8
- package/src/global-account/react/stores/useModalStore.ts +13 -1
- package/src/global-account/react/utils/updateAvatar.ts +21 -0
|
@@ -25,7 +25,6 @@ function LoginStep({ onSuccess, onError, partnerId, chain }) {
|
|
|
25
25
|
});
|
|
26
26
|
const { theme } = (0, react_1.useB3)();
|
|
27
27
|
const setIsAuthenticating = (0, react_1.useAuthStore)(state => state.setIsAuthenticating);
|
|
28
|
-
const setIsAuthenticatingV2 = (0, react_1.useAuthStore)(state => state.setIsAuthenticatingV2);
|
|
29
28
|
const setIsAuthenticated = (0, react_1.useAuthStore)(state => state.setIsAuthenticated);
|
|
30
29
|
const { logout } = (0, react_1.useAuthentication)(partnerId);
|
|
31
30
|
return ((0, jsx_runtime_1.jsx)(LoginStepContainer, { partnerId: partnerId, children: (0, jsx_runtime_1.jsx)(react_2.ConnectEmbed, { showThirdwebBranding: false, client: thirdweb_1.client, chain: chain, wallets: [wallet], theme: theme === "light"
|
|
@@ -66,7 +65,6 @@ function LoginStep({ onSuccess, onError, partnerId, chain }) {
|
|
|
66
65
|
}, className: "b3-login-step", onConnect: async (wallet) => {
|
|
67
66
|
try {
|
|
68
67
|
setIsAuthenticating(true);
|
|
69
|
-
setIsAuthenticatingV2(true);
|
|
70
68
|
(0, debug_1.debug)("setIsAuthenticating:true:6");
|
|
71
69
|
const account = wallet.getAccount();
|
|
72
70
|
if (!account)
|
|
@@ -83,7 +81,6 @@ function LoginStep({ onSuccess, onError, partnerId, chain }) {
|
|
|
83
81
|
finally {
|
|
84
82
|
(0, debug_1.debug)("setIsAuthenticating:false:6");
|
|
85
83
|
setIsAuthenticating(false);
|
|
86
|
-
setIsAuthenticatingV2(false);
|
|
87
84
|
}
|
|
88
85
|
} }) }));
|
|
89
86
|
}
|
|
@@ -13,7 +13,6 @@ function LoginStepCustom({ onSuccess, onError, partnerId, chain, strategies, max
|
|
|
13
13
|
const [showAllWallets, setShowAllWallets] = (0, react_2.useState)(false);
|
|
14
14
|
const { connect } = (0, react_1.useConnect)(partnerId, chain);
|
|
15
15
|
const setIsAuthenticating = (0, react_1.useAuthStore)(state => state.setIsAuthenticating);
|
|
16
|
-
const setIsAuthenticatingV2 = (0, react_1.useAuthStore)(state => state.setIsAuthenticatingV2);
|
|
17
16
|
const setIsAuthenticated = (0, react_1.useAuthStore)(state => state.setIsAuthenticated);
|
|
18
17
|
const { logout } = (0, react_1.useAuthentication)(partnerId);
|
|
19
18
|
const { connect: connectTW } = (0, react_3.useConnect)();
|
|
@@ -27,7 +26,6 @@ function LoginStepCustom({ onSuccess, onError, partnerId, chain, strategies, max
|
|
|
27
26
|
setIsLoading(true);
|
|
28
27
|
(0, debug_1.debug)("setIsAuthenticating:true:3");
|
|
29
28
|
setIsAuthenticating(true);
|
|
30
|
-
setIsAuthenticatingV2(true);
|
|
31
29
|
const options = (0, react_1.getConnectOptionsFromStrategy)(strategy);
|
|
32
30
|
let connectResult;
|
|
33
31
|
if (automaticallySetFirstEoa) {
|
|
@@ -62,7 +60,6 @@ function LoginStepCustom({ onSuccess, onError, partnerId, chain, strategies, max
|
|
|
62
60
|
setIsLoading(false);
|
|
63
61
|
(0, debug_1.debug)("setIsAuthenticating:false:3");
|
|
64
62
|
setIsAuthenticating(false);
|
|
65
|
-
setIsAuthenticatingV2(false);
|
|
66
63
|
}
|
|
67
64
|
};
|
|
68
65
|
return ((0, jsx_runtime_1.jsxs)(react_1.LoginStepContainer, { partnerId: partnerId, children: [authStrategies.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "mb-6 grid w-full grid-cols-4 gap-4", children: authStrategies.map(strategy => {
|
|
@@ -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,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppleIcon = AppleIcon;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
function AppleIcon({ className, size = 24, color = "currentColor", style }) {
|
|
6
|
+
return ((0, jsx_runtime_1.jsx)("svg", { width: size, height: size, viewBox: "0 0 41.5 51", xmlns: "http://www.w3.org/2000/svg", className: className, style: style, children: (0, jsx_runtime_1.jsx)("g", { children: (0, jsx_runtime_1.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" }) }) }));
|
|
7
|
+
}
|
|
8
|
+
exports.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,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiscordIcon = DiscordIcon;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
function DiscordIcon({ className, size = 24, color = "#5865F2", style }) {
|
|
6
|
+
return ((0, jsx_runtime_1.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: (0, jsx_runtime_1.jsx)("g", { children: (0, jsx_runtime_1.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" }) }) }));
|
|
7
|
+
}
|
|
8
|
+
exports.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,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FarcasterIcon = FarcasterIcon;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
function FarcasterIcon({ className, size = 24, color = "#855DCD", style }) {
|
|
6
|
+
return ((0, jsx_runtime_1.jsxs)("svg", { width: size, height: size, viewBox: "0 0 1000 1000", xmlns: "http://www.w3.org/2000/svg", className: className, style: style, children: [(0, jsx_runtime_1.jsx)("rect", { width: "1000", height: "1000", rx: "200", fill: color }), (0, jsx_runtime_1.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" }), (0, jsx_runtime_1.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" }), (0, jsx_runtime_1.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" })] }));
|
|
7
|
+
}
|
|
8
|
+
exports.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,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GoogleIcon = GoogleIcon;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
function GoogleIcon({ className, size = 24, style }) {
|
|
6
|
+
return ((0, jsx_runtime_1.jsxs)("svg", { width: size, height: size, viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg", className: className, style: style, children: [(0, jsx_runtime_1.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" }), (0, jsx_runtime_1.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" }), (0, jsx_runtime_1.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" }), (0, jsx_runtime_1.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" }), (0, jsx_runtime_1.jsx)("path", { fill: "none", d: "M0 0h48v48H0z" })] }));
|
|
7
|
+
}
|
|
8
|
+
exports.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,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.XIcon = XIcon;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
function XIcon({ className, size = 24, color = "currentColor", style }) {
|
|
6
|
+
return ((0, jsx_runtime_1.jsx)("svg", { width: size, height: size, viewBox: "0 0 300 300.251", xmlns: "http://www.w3.org/2000/svg", className: className, style: style, children: (0, jsx_runtime_1.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 }) }));
|
|
7
|
+
}
|
|
8
|
+
exports.default = XIcon;
|
|
@@ -4,6 +4,7 @@ exports.useAccountWallet = useAccountWallet;
|
|
|
4
4
|
const react_1 = require("../../../global-account/react");
|
|
5
5
|
const constants_1 = require("../../../shared/constants");
|
|
6
6
|
const debug_1 = require("../../../shared/utils/debug");
|
|
7
|
+
const ipfs_1 = require("../../../shared/utils/ipfs");
|
|
7
8
|
const react_2 = require("react");
|
|
8
9
|
const react_3 = require("thirdweb/react");
|
|
9
10
|
const in_app_1 = require("thirdweb/wallets/in-app");
|
|
@@ -20,7 +21,7 @@ function useLastAuthProvider() {
|
|
|
20
21
|
return lastAuthProvider;
|
|
21
22
|
}
|
|
22
23
|
function useAccountWallet() {
|
|
23
|
-
const { account } = (0, react_1.useB3)();
|
|
24
|
+
const { account, user } = (0, react_1.useB3)();
|
|
24
25
|
const activeWallet = (0, react_3.useActiveWallet)();
|
|
25
26
|
const connectedWallets = (0, react_3.useConnectedWallets)();
|
|
26
27
|
const connectedSmartWallet = connectedWallets.find(wallet => wallet.id === constants_1.ecosystemWalletId);
|
|
@@ -41,7 +42,7 @@ function useAccountWallet() {
|
|
|
41
42
|
: "https://gradvatar.com/0x0000000000000000000000000000000000000000"; // show smart wallet of eoa wallet is gradvatar
|
|
42
43
|
const { data: profileData } = (0, react_1.useProfile)({ address: account?.address });
|
|
43
44
|
const ensName = profileData?.displayName?.replace(/\.b3\.fun/g, "");
|
|
44
|
-
const avatarUrl = profileData?.avatar;
|
|
45
|
+
const avatarUrl = user?.avatar ? (0, ipfs_1.getIpfsUrl)(user?.avatar) : profileData?.avatar;
|
|
45
46
|
const res = (0, react_2.useMemo)(() => ({
|
|
46
47
|
wallet: {
|
|
47
48
|
...account,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { preAuthenticate } from "thirdweb/wallets/in-app";
|
|
2
2
|
export declare function useAuthentication(partnerId: string, loginWithSiwe?: boolean): {
|
|
3
3
|
logout: (callback?: () => void) => Promise<void>;
|
|
4
|
-
isAuthenticating: boolean;
|
|
5
4
|
isAuthenticated: boolean;
|
|
6
5
|
isReady: boolean;
|
|
7
6
|
isConnecting: boolean;
|
|
@@ -9,5 +8,5 @@ export declare function useAuthentication(partnerId: string, loginWithSiwe?: boo
|
|
|
9
8
|
wallet: import("thirdweb/dist/types/wallets/in-app/core/wallet/types").EcosystemWallet;
|
|
10
9
|
preAuthenticate: typeof preAuthenticate;
|
|
11
10
|
connect: (strategyOptions?: import("thirdweb/wallets").SingleStepAuthArgsType) => Promise<import("thirdweb/wallets").Wallet | null>;
|
|
12
|
-
|
|
11
|
+
isAuthenticating: boolean;
|
|
13
12
|
};
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.useAuthentication = useAuthentication;
|
|
7
7
|
const app_1 = __importDefault(require("../../../global-account/app"));
|
|
8
|
+
const bsmnt_1 = require("../../../global-account/bsmnt");
|
|
8
9
|
const react_1 = require("../../../global-account/react");
|
|
9
10
|
const constants_1 = require("../../../shared/constants");
|
|
10
11
|
const supported_1 = require("../../../shared/constants/chains/supported");
|
|
@@ -23,17 +24,15 @@ function useAuthentication(partnerId, loginWithSiwe) {
|
|
|
23
24
|
const activeWallet = (0, react_3.useActiveWallet)();
|
|
24
25
|
const { authenticate } = (0, useSiwe_1.useSiwe)();
|
|
25
26
|
const { setUser } = (0, react_1.useB3)();
|
|
26
|
-
const isAuthenticating = (0, react_1.useAuthStore)(state => state.isAuthenticating);
|
|
27
27
|
const isAuthenticated = (0, react_1.useAuthStore)(state => state.isAuthenticated);
|
|
28
28
|
const setIsAuthenticated = (0, react_1.useAuthStore)(state => state.setIsAuthenticated);
|
|
29
|
-
const setIsAuthenticating = (0, react_1.useAuthStore)(state => state.setIsAuthenticating);
|
|
30
29
|
const setIsConnecting = (0, react_1.useAuthStore)(state => state.setIsConnecting);
|
|
31
30
|
const setIsConnected = (0, react_1.useAuthStore)(state => state.setIsConnected);
|
|
32
31
|
const isConnecting = (0, react_1.useAuthStore)(state => state.isConnecting);
|
|
33
32
|
const isConnected = (0, react_1.useAuthStore)(state => state.isConnected);
|
|
34
33
|
const useAutoConnectLoadingPrevious = (0, react_2.useRef)(false);
|
|
35
|
-
const
|
|
36
|
-
const
|
|
34
|
+
const setIsAuthenticating = (0, react_1.useAuthStore)(state => state.setIsAuthenticating);
|
|
35
|
+
const isAuthenticating = (0, react_1.useAuthStore)(state => state.isAuthenticating);
|
|
37
36
|
const hasStartedConnecting = (0, react_1.useAuthStore)(state => state.hasStartedConnecting);
|
|
38
37
|
const setHasStartedConnecting = (0, react_1.useAuthStore)(state => state.setHasStartedConnecting);
|
|
39
38
|
const { connect } = (0, useConnect_1.useConnect)(partnerId, supported_1.b3MainnetThirdWeb);
|
|
@@ -50,11 +49,10 @@ function useAuthentication(partnerId, loginWithSiwe) {
|
|
|
50
49
|
if (!loginWithSiwe) {
|
|
51
50
|
debug("Skipping SIWE login", { loginWithSiwe });
|
|
52
51
|
setIsAuthenticated(true);
|
|
53
|
-
|
|
52
|
+
setIsAuthenticating(false);
|
|
54
53
|
return;
|
|
55
54
|
}
|
|
56
55
|
debug("setIsAuthenticating:true:4");
|
|
57
|
-
setIsAuthenticating(true);
|
|
58
56
|
const account = await wallet.getAccount();
|
|
59
57
|
if (!account) {
|
|
60
58
|
throw new Error("No account found during auto-connect");
|
|
@@ -64,8 +62,11 @@ function useAuthentication(partnerId, loginWithSiwe) {
|
|
|
64
62
|
const userAuth = await app_1.default.reAuthenticate();
|
|
65
63
|
setUser(userAuth.user);
|
|
66
64
|
setIsAuthenticated(true);
|
|
67
|
-
|
|
65
|
+
setIsAuthenticating(false);
|
|
68
66
|
debug("Re-authenticated successfully", { userAuth });
|
|
67
|
+
// Authenticate on BSMNT with B3 JWT
|
|
68
|
+
const b3Jwt = await (0, bsmnt_1.authenticateWithB3JWT)(userAuth.accessToken);
|
|
69
|
+
console.log("@@b3Jwt", b3Jwt);
|
|
69
70
|
}
|
|
70
71
|
catch (error) {
|
|
71
72
|
// If re-authentication fails, try fresh authentication
|
|
@@ -73,8 +74,11 @@ function useAuthentication(partnerId, loginWithSiwe) {
|
|
|
73
74
|
const userAuth = await authenticate(account, partnerId);
|
|
74
75
|
setUser(userAuth.user);
|
|
75
76
|
setIsAuthenticated(true);
|
|
76
|
-
|
|
77
|
+
setIsAuthenticating(false);
|
|
77
78
|
debug("Fresh authentication successful", { userAuth });
|
|
79
|
+
// Authenticate on BSMNT with B3 JWT
|
|
80
|
+
const b3Jwt = await (0, bsmnt_1.authenticateWithB3JWT)(userAuth.accessToken);
|
|
81
|
+
console.log("@@b3Jwt", b3Jwt);
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
catch (error) {
|
|
@@ -83,7 +87,7 @@ function useAuthentication(partnerId, loginWithSiwe) {
|
|
|
83
87
|
debug("setIsAuthenticating:false:4");
|
|
84
88
|
setUser();
|
|
85
89
|
}
|
|
86
|
-
|
|
90
|
+
setIsAuthenticating(false);
|
|
87
91
|
},
|
|
88
92
|
});
|
|
89
93
|
/**
|
|
@@ -91,7 +95,7 @@ function useAuthentication(partnerId, loginWithSiwe) {
|
|
|
91
95
|
*/
|
|
92
96
|
(0, react_2.useEffect)(() => {
|
|
93
97
|
if (!useAutoConnectLoading && useAutoConnectLoadingPrevious.current && !hasStartedConnecting) {
|
|
94
|
-
|
|
98
|
+
setIsAuthenticating(false);
|
|
95
99
|
}
|
|
96
100
|
useAutoConnectLoadingPrevious.current = useAutoConnectLoading;
|
|
97
101
|
}, [useAutoConnectLoading]);
|
|
@@ -105,17 +109,15 @@ function useAuthentication(partnerId, loginWithSiwe) {
|
|
|
105
109
|
// This prevents the flicker state where both isAuthenticating and isAuthenticated are false
|
|
106
110
|
const timeout = setTimeout(() => {
|
|
107
111
|
debug("setIsAuthenticating:false:5a");
|
|
108
|
-
setIsAuthenticating(false);
|
|
109
112
|
setIsConnecting(false);
|
|
110
113
|
}, 100); // Add a small delay to prevent quick flickers
|
|
111
114
|
return () => clearTimeout(timeout);
|
|
112
115
|
}
|
|
113
116
|
else {
|
|
114
117
|
debug("setIsAuthenticating:false:5b");
|
|
115
|
-
setIsAuthenticating(false);
|
|
116
118
|
setIsConnecting(false);
|
|
117
119
|
}
|
|
118
|
-
}, [useAutoConnectLoading, isAuthenticated,
|
|
120
|
+
}, [useAutoConnectLoading, isAuthenticated, setIsConnecting, setIsConnected]);
|
|
119
121
|
const logout = async (callback) => {
|
|
120
122
|
if (activeWallet) {
|
|
121
123
|
debug("@@logout:activeWallet", activeWallet);
|
|
@@ -145,7 +147,6 @@ function useAuthentication(partnerId, loginWithSiwe) {
|
|
|
145
147
|
const isReady = isAuthenticated && !useAutoConnectLoading && !isAuthenticating;
|
|
146
148
|
return {
|
|
147
149
|
logout,
|
|
148
|
-
isAuthenticating: useAutoConnectLoading || isAuthenticating,
|
|
149
150
|
isAuthenticated,
|
|
150
151
|
isReady,
|
|
151
152
|
isConnecting,
|
|
@@ -153,6 +154,6 @@ function useAuthentication(partnerId, loginWithSiwe) {
|
|
|
153
154
|
wallet,
|
|
154
155
|
preAuthenticate: in_app_1.preAuthenticate,
|
|
155
156
|
connect,
|
|
156
|
-
|
|
157
|
+
isAuthenticating,
|
|
157
158
|
};
|
|
158
159
|
}
|
|
@@ -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
|
+
}
|
|
@@ -5,7 +5,6 @@ interface AuthState {
|
|
|
5
5
|
provider?: string;
|
|
6
6
|
accessToken?: string;
|
|
7
7
|
chain?: Chain;
|
|
8
|
-
isAuthenticating: boolean;
|
|
9
8
|
isAuthenticated: boolean;
|
|
10
9
|
isConnecting: boolean;
|
|
11
10
|
isConnected: boolean;
|
|
@@ -15,7 +14,6 @@ interface AuthState {
|
|
|
15
14
|
setStep: (step: "login" | "permissions") => void;
|
|
16
15
|
setIsConnecting: (isConnecting: boolean) => void;
|
|
17
16
|
setIsConnected: (isConnected: boolean) => void;
|
|
18
|
-
setIsAuthenticating: (isAuthenticating: boolean) => void;
|
|
19
17
|
setIsAuthenticated: (isAuthenticated: boolean) => void;
|
|
20
18
|
startAuth: (params: {
|
|
21
19
|
provider: string;
|
|
@@ -25,8 +23,8 @@ interface AuthState {
|
|
|
25
23
|
onError?: (error: Error) => void;
|
|
26
24
|
}) => void;
|
|
27
25
|
reset: () => void;
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
isAuthenticating: boolean;
|
|
27
|
+
setIsAuthenticating: (isAuthenticating: boolean) => void;
|
|
30
28
|
hasStartedConnecting: boolean;
|
|
31
29
|
setHasStartedConnecting: (hasStartedConnecting: boolean) => void;
|
|
32
30
|
}
|
|
@@ -8,7 +8,6 @@ exports.useAuthStore = (0, zustand_1.create)(set => ({
|
|
|
8
8
|
provider: undefined,
|
|
9
9
|
accessToken: undefined,
|
|
10
10
|
chain: undefined,
|
|
11
|
-
isAuthenticating: false,
|
|
12
11
|
isAuthenticated: false,
|
|
13
12
|
isConnecting: false,
|
|
14
13
|
isConnected: false,
|
|
@@ -18,7 +17,6 @@ exports.useAuthStore = (0, zustand_1.create)(set => ({
|
|
|
18
17
|
setStep: step => set({ step }),
|
|
19
18
|
setIsConnecting: isConnecting => set({ isConnecting }),
|
|
20
19
|
setIsConnected: isConnected => set({ isConnected }),
|
|
21
|
-
setIsAuthenticating: isAuthenticating => set({ isAuthenticating }),
|
|
22
20
|
setIsAuthenticated: isAuthenticated => set({ isAuthenticated }),
|
|
23
21
|
startAuth: params => set({
|
|
24
22
|
isOpen: true,
|
|
@@ -40,8 +38,8 @@ exports.useAuthStore = (0, zustand_1.create)(set => ({
|
|
|
40
38
|
onSuccess: undefined,
|
|
41
39
|
onError: undefined,
|
|
42
40
|
}),
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
isAuthenticating: true,
|
|
42
|
+
setIsAuthenticating: isAuthenticating => set({ isAuthenticating: isAuthenticating }),
|
|
45
43
|
hasStartedConnecting: false,
|
|
46
44
|
setHasStartedConnecting: hasStartedConnecting => set({ hasStartedConnecting }),
|
|
47
45
|
}));
|
|
@@ -84,6 +84,10 @@ export interface ManageAccountModalProps extends BaseModalProps {
|
|
|
84
84
|
setActiveTab?: (tab: "overview" | "tokens" | "nfts" | "apps" | "settings") => void;
|
|
85
85
|
/** Whether to show the referral information */
|
|
86
86
|
showReferralInfo?: boolean;
|
|
87
|
+
/** Whether to show the swap button */
|
|
88
|
+
showSwap?: boolean;
|
|
89
|
+
/** Whether to show the deposit button */
|
|
90
|
+
showDeposit?: boolean;
|
|
87
91
|
}
|
|
88
92
|
/**
|
|
89
93
|
* Props for the AnySpend modal
|
|
@@ -287,10 +291,16 @@ export interface AnySpendDepositHypeProps extends BaseModalProps {
|
|
|
287
291
|
/** Callback function called when the deposit is successful */
|
|
288
292
|
onSuccess?: (amount?: string) => void;
|
|
289
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
|
+
}
|
|
290
300
|
/**
|
|
291
301
|
* Union type of all possible modal content types
|
|
292
302
|
*/
|
|
293
|
-
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;
|
|
294
304
|
/**
|
|
295
305
|
* State interface for the modal store
|
|
296
306
|
*/
|
|
@@ -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
|
+
}
|
|
@@ -14,6 +14,7 @@ import { parseUnits } from "viem";
|
|
|
14
14
|
import { base, mainnet } from "viem/chains";
|
|
15
15
|
import { AnySpendFingerprintWrapper, getFingerprintConfig } from "./AnySpendFingerprintWrapper.js";
|
|
16
16
|
import { CryptoPaymentMethod, CryptoPaymentMethodType } from "./common/CryptoPaymentMethod.js";
|
|
17
|
+
import { CryptoPaySection } from "./common/CryptoPaySection.js";
|
|
17
18
|
import { CryptoReceiveSection } from "./common/CryptoReceiveSection.js";
|
|
18
19
|
import { ErrorSection } from "./common/ErrorSection.js";
|
|
19
20
|
import { FiatPaymentMethod, FiatPaymentMethodComponent } from "./common/FiatPaymentMethod.js";
|
|
@@ -22,7 +23,6 @@ import { OrderHistory } from "./common/OrderHistory.js";
|
|
|
22
23
|
import { OrderStatus } from "./common/OrderStatus.js";
|
|
23
24
|
import { PanelOnramp } from "./common/PanelOnramp.js";
|
|
24
25
|
import { PanelOnrampPayment } from "./common/PanelOnrampPayment.js";
|
|
25
|
-
import { PaySection } from "./common/PaySection.js";
|
|
26
26
|
import { RecipientSelection } from "./common/RecipientSelection.js";
|
|
27
27
|
import { TabSection } from "./common/TabSection.js";
|
|
28
28
|
export var PanelView;
|
|
@@ -444,7 +444,8 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
|
|
|
444
444
|
return { text: "Choose payment method", disable: false, error: false };
|
|
445
445
|
}
|
|
446
446
|
// If payment method selected, show appropriate action
|
|
447
|
-
if (selectedCryptoPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET
|
|
447
|
+
if (selectedCryptoPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET ||
|
|
448
|
+
selectedCryptoPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET) {
|
|
448
449
|
return { text: "Swap", disable: false, error: false };
|
|
449
450
|
}
|
|
450
451
|
if (selectedCryptoPaymentMethod === CryptoPaymentMethodType.TRANSFER_CRYPTO) {
|
|
@@ -501,6 +502,7 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
|
|
|
501
502
|
}
|
|
502
503
|
// If payment method is selected, create order with payment method info
|
|
503
504
|
if (selectedCryptoPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET ||
|
|
505
|
+
selectedCryptoPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET ||
|
|
504
506
|
selectedCryptoPaymentMethod === CryptoPaymentMethodType.TRANSFER_CRYPTO) {
|
|
505
507
|
console.log("Creating crypto order with payment method:", selectedCryptoPaymentMethod);
|
|
506
508
|
await handleCryptoSwap(selectedCryptoPaymentMethod);
|
|
@@ -655,7 +657,7 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
|
|
|
655
657
|
setActivePanel(PanelView.MAIN);
|
|
656
658
|
setSelectedCryptoPaymentMethod(CryptoPaymentMethodType.NONE); // Reset payment method when going back
|
|
657
659
|
} })] })) }) }));
|
|
658
|
-
const mainView = (_jsxs("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [isBuyMode && (_jsxs("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: [selectedDstToken.metadata?.logoURI && (_jsx("div", { className: "relative", children: _jsx("img", { src: selectedDstToken.metadata.logoURI, alt: selectedDstToken.symbol, className: "border-as-stroke h-12 w-12 rounded-full border-2 shadow-md" }) })), _jsx("div", { children: _jsxs("h1", { className: "text-as-primary text-xl font-bold", children: ["Buy ", selectedDstToken.symbol] }) })] })), _jsx(TabSection, { activeTab: activeTab, setActiveTab: setActiveTab, setSelectedCryptoPaymentMethod: setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod: setSelectedFiatPaymentMethod }), _jsxs("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [activeTab === "crypto" ? (_jsx(
|
|
660
|
+
const mainView = (_jsxs("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [isBuyMode && (_jsxs("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: [selectedDstToken.metadata?.logoURI && (_jsx("div", { className: "relative", children: _jsx("img", { src: selectedDstToken.metadata.logoURI, alt: selectedDstToken.symbol, className: "border-as-stroke h-12 w-12 rounded-full border-2 shadow-md" }) })), _jsx("div", { children: _jsxs("h1", { className: "text-as-primary text-xl font-bold", children: ["Buy ", selectedDstToken.symbol] }) })] })), _jsx(TabSection, { activeTab: activeTab, setActiveTab: setActiveTab, setSelectedCryptoPaymentMethod: setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod: setSelectedFiatPaymentMethod }), _jsxs("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [activeTab === "crypto" ? (_jsx(CryptoPaySection, { selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(PanelView.CRYPTO_PAYMENT_METHOD), anyspendQuote: anyspendQuote })) : (_jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, children: _jsx(PanelOnramp, { srcAmountOnRamp: srcAmountOnRamp, setSrcAmountOnRamp: setSrcAmountOnRamp, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: setActivePanel, _recipientAddress: recipientAddress, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, destinationAmount: dstAmount, onDestinationTokenChange: setSelectedDstToken, onDestinationChainChange: setSelectedDstChainId, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION, hideDstToken: isBuyMode }) })), _jsx(Button, { variant: "ghost", className: cn("border-as-stroke bg-as-surface-primary absolute left-1/2 top-1/2 z-10 h-10 w-10 -translate-x-1/2 -translate-y-1/2 rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl", isBuyMode && "top-[calc(50%+56px)] cursor-default", activeTab === "fiat" && "hidden"), onClick: () => {
|
|
659
661
|
if (activeTab === "fiat" || isBuyMode) {
|
|
660
662
|
return;
|
|
661
663
|
}
|
|
@@ -9,13 +9,13 @@ import { toast } from "sonner";
|
|
|
9
9
|
import { base } from "viem/chains";
|
|
10
10
|
import { PanelView, useAnyspendFlow } from "../hooks/useAnyspendFlow.js";
|
|
11
11
|
import { AnySpendFingerprintWrapper, getFingerprintConfig } from "./AnySpendFingerprintWrapper.js";
|
|
12
|
+
import { CryptoPaySection } from "./common/CryptoPaySection.js";
|
|
12
13
|
import { CryptoPaymentMethod, CryptoPaymentMethodType } from "./common/CryptoPaymentMethod.js";
|
|
13
14
|
import { CryptoReceiveSection } from "./common/CryptoReceiveSection.js";
|
|
14
15
|
import { ErrorSection } from "./common/ErrorSection.js";
|
|
15
16
|
import { FiatPaymentMethod, FiatPaymentMethodComponent } from "./common/FiatPaymentMethod.js";
|
|
16
17
|
import { OrderDetails } from "./common/OrderDetails.js";
|
|
17
18
|
import { OrderStatus } from "./common/OrderStatus.js";
|
|
18
|
-
import { PaySection } from "./common/PaySection.js";
|
|
19
19
|
import { RecipientSelection } from "./common/RecipientSelection.js";
|
|
20
20
|
import { ArrowDown } from "lucide-react";
|
|
21
21
|
import { PanelOnramp } from "./common/PanelOnramp.js";
|
|
@@ -112,7 +112,7 @@ function AnySpendDepositHypeInner({ loadOrder, mode = "modal", recipientAddress,
|
|
|
112
112
|
await handleFiatOrder();
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
|
-
const mainView = (_jsxs("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [_jsx("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: _jsx("div", { children: _jsx("h1", { className: "text-as-primary text-xl font-bold", children: paymentType === "crypto" ? "Deposit Crypto" : "Fund with Fiat" }) }) }), _jsx("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: _jsxs("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [paymentType === "crypto" ? (_jsx(
|
|
115
|
+
const mainView = (_jsxs("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [_jsx("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: _jsx("div", { children: _jsx("h1", { className: "text-as-primary text-xl font-bold", children: paymentType === "crypto" ? "Deposit Crypto" : "Fund with Fiat" }) }) }), _jsx("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: _jsxs("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [paymentType === "crypto" ? (_jsx(CryptoPaySection, { selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(PanelView.CRYPTO_PAYMENT_METHOD), anyspendQuote: anyspendQuote })) : (_jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, children: _jsx(PanelOnramp, { srcAmountOnRamp: srcAmount, setSrcAmountOnRamp: setSrcAmount, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: setActivePanel, _recipientAddress: recipientAddress, destinationToken: B3_TOKEN, destinationChainId: base.id, dstTokenSymbol: HYPE_TOKEN_DETAILS.SYMBOL, hideDstToken: true, destinationAmount: dstAmount, onDestinationTokenChange: () => { }, onDestinationChainChange: () => { }, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION }) })), _jsx("div", { className: cn("relative -my-1 flex h-0 items-center justify-center", paymentType === "fiat" && "hidden"), children: _jsx(Button, { variant: "ghost", className: cn("swap-direction-button border-as-stroke bg-as-surface-primary z-10 h-10 w-10 cursor-default rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl"), children: _jsx("div", { className: "relative flex items-center justify-center transition-opacity", children: _jsx(ArrowDown, { className: "text-as-primary/50 h-5 w-5" }) }) }) }), paymentType === "crypto" && (_jsx(CryptoReceiveSection, { isDepositMode: false, isBuyMode: true, selectedRecipientAddress: recipientAddress, recipientName: recipientName || undefined, onSelectRecipient: () => setActivePanel(PanelView.RECIPIENT_SELECTION), dstAmount: dstAmount, dstToken: B3_TOKEN, dstTokenSymbol: HYPE_TOKEN_DETAILS.SYMBOL, dstTokenLogoURI: HYPE_TOKEN_DETAILS.LOGO_URI, selectedDstChainId: base.id, setSelectedDstChainId: () => { }, setSelectedDstToken: () => { }, onChangeDstAmount: value => {
|
|
116
116
|
setIsSrcInputDirty(false);
|
|
117
117
|
setSrcAmount(value);
|
|
118
118
|
}, anyspendQuote: anyspendQuote }))] }) }), _jsx(ErrorSection, { error: getAnyspendQuoteError }), _jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: cn("mt-4 flex w-full max-w-[460px] flex-col gap-2", getAnyspendQuoteError && "mt-0"), children: _jsx(ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: cn("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: btnInfo.text }) }), mainFooter ? mainFooter : null] }));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { components } from "../../../../anyspend/types/api";
|
|
2
|
+
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
|
|
2
3
|
type Tournament = components["schemas"]["Tournament"];
|
|
3
4
|
type NFT = components["schemas"]["NFT"];
|
|
4
5
|
interface ConnectWalletPaymentProps {
|
|
@@ -10,6 +11,7 @@ interface ConnectWalletPaymentProps {
|
|
|
10
11
|
phantomWalletAddress?: string | null;
|
|
11
12
|
tournament?: Tournament;
|
|
12
13
|
nft?: NFT;
|
|
14
|
+
cryptoPaymentMethod: CryptoPaymentMethodType;
|
|
13
15
|
}
|
|
14
|
-
export default function ConnectWalletPayment({ order, onPayment, txLoading, isSwitchingOrExecuting, phantomWalletAddress, tournament, nft, }: ConnectWalletPaymentProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default function ConnectWalletPayment({ order, onPayment, txLoading, isSwitchingOrExecuting, phantomWalletAddress, tournament, nft, cryptoPaymentMethod, }: ConnectWalletPaymentProps): import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
export {};
|