@b3dotfun/sdk 0.0.65-test.1 → 0.0.65
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 +33 -73
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +1 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +1 -1
- package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.js +1 -1
- package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
- package/dist/cjs/anyspend/react/components/common/OrderHistory.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/common/OrderHistory.js +3 -7
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +1 -1
- package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +1 -1
- package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +1 -1
- package/dist/cjs/global-account/react/components/AccountAssets/AccountAssets.js +2 -38
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +33 -139
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +6 -25
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.d.ts +4 -6
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +279 -113
- package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.js +2 -2
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +193 -24
- package/dist/cjs/global-account/react/components/index.d.ts +2 -4
- package/dist/cjs/global-account/react/components/index.js +4 -11
- package/dist/cjs/global-account/react/components/ui/Tabs.js +2 -2
- package/dist/cjs/global-account/react/components/ui/dialog.js +2 -2
- package/dist/cjs/global-account/react/hooks/index.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/index.js +1 -3
- package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.js +0 -1
- package/dist/cjs/global-account/react/stores/index.d.ts +0 -1
- package/dist/cjs/global-account/react/stores/index.js +1 -3
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +3 -34
- package/dist/cjs/global-account/react/utils/profileDisplay.d.ts +0 -2
- package/dist/cjs/global-account/react/utils/profileDisplay.js +2 -2
- package/dist/cjs/shared/constants/chains/supported.d.ts +2 -2
- package/dist/cjs/shared/utils/ipfs.js +1 -1
- package/dist/esm/anyspend/react/components/AnySpend.js +34 -74
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +1 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +1 -1
- package/dist/esm/anyspend/react/components/common/FeeDetailPanel.js +1 -1
- package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
- package/dist/esm/anyspend/react/components/common/OrderHistory.d.ts +1 -1
- package/dist/esm/anyspend/react/components/common/OrderHistory.js +5 -6
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +1 -1
- package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +1 -1
- package/dist/esm/anyspend/react/components/common/RecipientSelection.js +1 -1
- package/dist/esm/global-account/react/components/AccountAssets/AccountAssets.js +2 -38
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +34 -140
- package/dist/esm/global-account/react/components/B3DynamicModal.js +6 -25
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.d.ts +4 -6
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +280 -113
- package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.js +2 -2
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +195 -26
- package/dist/esm/global-account/react/components/index.d.ts +2 -4
- package/dist/esm/global-account/react/components/index.js +2 -7
- package/dist/esm/global-account/react/components/ui/Tabs.js +2 -2
- package/dist/esm/global-account/react/components/ui/dialog.js +2 -2
- package/dist/esm/global-account/react/hooks/index.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/index.js +1 -1
- package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +0 -1
- package/dist/esm/global-account/react/stores/index.d.ts +0 -1
- package/dist/esm/global-account/react/stores/index.js +0 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +3 -34
- package/dist/esm/global-account/react/utils/profileDisplay.d.ts +0 -2
- package/dist/esm/global-account/react/utils/profileDisplay.js +2 -2
- package/dist/esm/shared/constants/chains/supported.d.ts +2 -2
- package/dist/esm/shared/utils/ipfs.js +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/common/OrderHistory.d.ts +1 -1
- package/dist/types/global-account/react/components/LinkAccount/LinkAccount.d.ts +4 -6
- package/dist/types/global-account/react/components/index.d.ts +2 -4
- package/dist/types/global-account/react/hooks/index.d.ts +1 -1
- package/dist/types/global-account/react/stores/index.d.ts +0 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +3 -34
- package/dist/types/global-account/react/utils/profileDisplay.d.ts +0 -2
- package/dist/types/shared/constants/chains/supported.d.ts +2 -2
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +167 -225
- package/src/anyspend/react/components/AnySpendCustom.tsx +1 -1
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +1 -1
- package/src/anyspend/react/components/common/FeeDetailPanel.tsx +1 -1
- package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +2 -2
- package/src/anyspend/react/components/common/OrderHistory.tsx +13 -8
- package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +1 -1
- package/src/anyspend/react/components/common/PointsDetailPanel.tsx +1 -1
- package/src/anyspend/react/components/common/RecipientSelection.tsx +1 -1
- package/src/global-account/react/components/AccountAssets/AccountAssets.tsx +25 -115
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +126 -303
- package/src/global-account/react/components/B3DynamicModal.tsx +6 -28
- package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +433 -332
- package/src/global-account/react/components/ManageAccount/BalanceContent.tsx +3 -2
- package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +589 -73
- package/src/global-account/react/components/index.ts +2 -9
- package/src/global-account/react/components/ui/Tabs.tsx +13 -5
- package/src/global-account/react/components/ui/dialog.tsx +14 -32
- package/src/global-account/react/hooks/index.ts +0 -3
- package/src/global-account/react/hooks/useB3BalanceFromAddresses.ts +0 -1
- package/src/global-account/react/stores/index.ts +0 -1
- package/src/global-account/react/stores/useModalStore.ts +2 -39
- package/src/global-account/react/utils/profileDisplay.ts +2 -4
- package/src/shared/utils/ipfs.ts +1 -1
- package/src/styles/index.css +1 -6
- package/dist/cjs/global-account/react/components/Deposit/Deposit.d.ts +0 -1
- package/dist/cjs/global-account/react/components/Deposit/Deposit.js +0 -65
- package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +0 -4
- package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.js +0 -331
- package/dist/cjs/global-account/react/components/ManageAccount/AppsContent.d.ts +0 -6
- package/dist/cjs/global-account/react/components/ManageAccount/AppsContent.js +0 -34
- package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.d.ts +0 -2
- package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.js +0 -23
- package/dist/cjs/global-account/react/components/ManageAccount/Header.d.ts +0 -3
- package/dist/cjs/global-account/react/components/ManageAccount/Header.js +0 -120
- package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.d.ts +0 -5
- package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.js +0 -43
- package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.d.ts +0 -6
- package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.js +0 -16
- package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.d.ts +0 -2
- package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.js +0 -15
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.d.ts +0 -2
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +0 -44
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.d.ts +0 -7
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +0 -50
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +0 -9
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.js +0 -8
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +0 -2
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +0 -38
- package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.d.ts +0 -2
- package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.js +0 -22
- package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.d.ts +0 -10
- package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.js +0 -12
- package/dist/cjs/global-account/react/components/Send/Send.d.ts +0 -5
- package/dist/cjs/global-account/react/components/Send/Send.js +0 -187
- package/dist/cjs/global-account/react/components/icons/BellIcon.d.ts +0 -3
- package/dist/cjs/global-account/react/components/icons/BellIcon.js +0 -5
- package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.d.ts +0 -2
- package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.js +0 -7
- package/dist/cjs/global-account/react/components/icons/CopyIcon.d.ts +0 -2
- package/dist/cjs/global-account/react/components/icons/CopyIcon.js +0 -7
- package/dist/cjs/global-account/react/components/icons/LinkIcon.d.ts +0 -3
- package/dist/cjs/global-account/react/components/icons/LinkIcon.js +0 -5
- package/dist/cjs/global-account/react/components/icons/LockIcon.d.ts +0 -3
- package/dist/cjs/global-account/react/components/icons/LockIcon.js +0 -5
- package/dist/cjs/global-account/react/components/icons/WalletIcon.d.ts +0 -2
- package/dist/cjs/global-account/react/components/icons/WalletIcon.js +0 -7
- package/dist/cjs/global-account/react/stores/useRecentAddressesStore.d.ts +0 -25
- package/dist/cjs/global-account/react/stores/useRecentAddressesStore.js +0 -36
- package/dist/esm/global-account/react/components/Deposit/Deposit.d.ts +0 -1
- package/dist/esm/global-account/react/components/Deposit/Deposit.js +0 -59
- package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +0 -4
- package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.js +0 -325
- package/dist/esm/global-account/react/components/ManageAccount/AppsContent.d.ts +0 -6
- package/dist/esm/global-account/react/components/ManageAccount/AppsContent.js +0 -32
- package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.d.ts +0 -2
- package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.js +0 -21
- package/dist/esm/global-account/react/components/ManageAccount/Header.d.ts +0 -3
- package/dist/esm/global-account/react/components/ManageAccount/Header.js +0 -81
- package/dist/esm/global-account/react/components/ManageAccount/HomeActions.d.ts +0 -5
- package/dist/esm/global-account/react/components/ManageAccount/HomeActions.js +0 -41
- package/dist/esm/global-account/react/components/ManageAccount/HomeContent.d.ts +0 -6
- package/dist/esm/global-account/react/components/ManageAccount/HomeContent.js +0 -10
- package/dist/esm/global-account/react/components/ManageAccount/NFTContent.d.ts +0 -2
- package/dist/esm/global-account/react/components/ManageAccount/NFTContent.js +0 -13
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.d.ts +0 -2
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +0 -42
- package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.d.ts +0 -7
- package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +0 -45
- package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +0 -9
- package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.js +0 -6
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +0 -2
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +0 -36
- package/dist/esm/global-account/react/components/ManageAccount/TokenContent.d.ts +0 -2
- package/dist/esm/global-account/react/components/ManageAccount/TokenContent.js +0 -20
- package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.d.ts +0 -10
- package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.js +0 -10
- package/dist/esm/global-account/react/components/Send/Send.d.ts +0 -5
- package/dist/esm/global-account/react/components/Send/Send.js +0 -181
- package/dist/esm/global-account/react/components/icons/BellIcon.d.ts +0 -3
- package/dist/esm/global-account/react/components/icons/BellIcon.js +0 -3
- package/dist/esm/global-account/react/components/icons/ChevronDownIcon.d.ts +0 -2
- package/dist/esm/global-account/react/components/icons/ChevronDownIcon.js +0 -4
- package/dist/esm/global-account/react/components/icons/CopyIcon.d.ts +0 -2
- package/dist/esm/global-account/react/components/icons/CopyIcon.js +0 -4
- package/dist/esm/global-account/react/components/icons/LinkIcon.d.ts +0 -3
- package/dist/esm/global-account/react/components/icons/LinkIcon.js +0 -3
- package/dist/esm/global-account/react/components/icons/LockIcon.d.ts +0 -3
- package/dist/esm/global-account/react/components/icons/LockIcon.js +0 -3
- package/dist/esm/global-account/react/components/icons/WalletIcon.d.ts +0 -2
- package/dist/esm/global-account/react/components/icons/WalletIcon.js +0 -4
- package/dist/esm/global-account/react/stores/useRecentAddressesStore.d.ts +0 -25
- package/dist/esm/global-account/react/stores/useRecentAddressesStore.js +0 -33
- package/dist/types/global-account/react/components/Deposit/Deposit.d.ts +0 -1
- package/dist/types/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +0 -4
- package/dist/types/global-account/react/components/ManageAccount/AppsContent.d.ts +0 -6
- package/dist/types/global-account/react/components/ManageAccount/BottomNavigation.d.ts +0 -2
- package/dist/types/global-account/react/components/ManageAccount/Header.d.ts +0 -3
- package/dist/types/global-account/react/components/ManageAccount/HomeActions.d.ts +0 -5
- package/dist/types/global-account/react/components/ManageAccount/HomeContent.d.ts +0 -6
- package/dist/types/global-account/react/components/ManageAccount/NFTContent.d.ts +0 -2
- package/dist/types/global-account/react/components/ManageAccount/ProfileSection.d.ts +0 -2
- package/dist/types/global-account/react/components/ManageAccount/SettingsContent.d.ts +0 -7
- package/dist/types/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +0 -9
- package/dist/types/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +0 -2
- package/dist/types/global-account/react/components/ManageAccount/TokenContent.d.ts +0 -2
- package/dist/types/global-account/react/components/ModalHeader/ModalHeader.d.ts +0 -10
- package/dist/types/global-account/react/components/Send/Send.d.ts +0 -5
- package/dist/types/global-account/react/components/icons/BellIcon.d.ts +0 -3
- package/dist/types/global-account/react/components/icons/ChevronDownIcon.d.ts +0 -2
- package/dist/types/global-account/react/components/icons/CopyIcon.d.ts +0 -2
- package/dist/types/global-account/react/components/icons/LinkIcon.d.ts +0 -3
- package/dist/types/global-account/react/components/icons/LockIcon.d.ts +0 -3
- package/dist/types/global-account/react/components/icons/WalletIcon.d.ts +0 -2
- package/dist/types/global-account/react/stores/useRecentAddressesStore.d.ts +0 -25
- package/src/global-account/react/components/Deposit/Deposit.tsx +0 -211
- package/src/global-account/react/components/LinkAccount/LinkNewAccount.tsx +0 -490
- package/src/global-account/react/components/ManageAccount/AppsContent.tsx +0 -79
- package/src/global-account/react/components/ManageAccount/BottomNavigation.tsx +0 -83
- package/src/global-account/react/components/ManageAccount/Header.tsx +0 -230
- package/src/global-account/react/components/ManageAccount/HomeActions.tsx +0 -118
- package/src/global-account/react/components/ManageAccount/HomeContent.tsx +0 -42
- package/src/global-account/react/components/ManageAccount/NFTContent.tsx +0 -24
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +0 -74
- package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +0 -87
- package/src/global-account/react/components/ManageAccount/SettingsMenuItem.tsx +0 -31
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +0 -74
- package/src/global-account/react/components/ManageAccount/TokenContent.tsx +0 -41
- package/src/global-account/react/components/ModalHeader/ModalHeader.tsx +0 -50
- package/src/global-account/react/components/Send/Send.tsx +0 -585
- package/src/global-account/react/components/icons/BellIcon.tsx +0 -15
- package/src/global-account/react/components/icons/ChevronDownIcon.tsx +0 -17
- package/src/global-account/react/components/icons/CopyIcon.tsx +0 -22
- package/src/global-account/react/components/icons/LinkIcon.tsx +0 -15
- package/src/global-account/react/components/icons/LockIcon.tsx +0 -15
- package/src/global-account/react/components/icons/WalletIcon.tsx +0 -21
- package/src/global-account/react/stores/useRecentAddressesStore.ts +0 -55
|
@@ -5,33 +5,202 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ManageAccount = ManageAccount;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const app_1 = __importDefault(require("../../../../global-account/app"));
|
|
8
9
|
const react_1 = require("../../../../global-account/react");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
10
|
+
const SignOutIcon_1 = require("../../../../global-account/react/components/icons/SignOutIcon");
|
|
11
|
+
const formatNumber_1 = require("../../../../shared/utils/formatNumber");
|
|
12
|
+
const thirdweb_1 = require("../../../../shared/utils/thirdweb");
|
|
13
|
+
const truncateAddress_1 = require("../../../../shared/utils/truncateAddress");
|
|
14
|
+
const lucide_react_1 = require("lucide-react");
|
|
15
|
+
const react_2 = require("react");
|
|
16
|
+
const sonner_1 = require("sonner");
|
|
17
|
+
const react_3 = require("thirdweb/react");
|
|
18
|
+
const viem_1 = require("viem");
|
|
19
|
+
const profileDisplay_1 = require("../../utils/profileDisplay");
|
|
20
|
+
const AccountAssets_1 = require("../AccountAssets/AccountAssets");
|
|
21
|
+
const ContentTokens_1 = require("./ContentTokens");
|
|
22
|
+
// Helper function to check if a string is a wallet address and format it
|
|
23
|
+
const formatProfileTitle = (title) => {
|
|
24
|
+
// Check if title looks like an Ethereum address (0x followed by 40 hex characters)
|
|
25
|
+
const isEthereumAddress = /^0x[a-fA-F0-9]{40}$/.test(title);
|
|
26
|
+
if (isEthereumAddress) {
|
|
27
|
+
return {
|
|
28
|
+
displayTitle: (0, truncateAddress_1.truncateAddress)(title),
|
|
29
|
+
isAddress: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
displayTitle: title,
|
|
34
|
+
isAddress: false,
|
|
35
|
+
};
|
|
20
36
|
};
|
|
37
|
+
const BalanceContent_1 = require("./BalanceContent");
|
|
21
38
|
function ManageAccount({ onLogout, onSwap: _onSwap, onDeposit: _onDeposit, chain, partnerId, showSwap, showDeposit, }) {
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
const [revokingSignerId, setRevokingSignerId] = (0, react_2.useState)(null);
|
|
40
|
+
const account = (0, react_3.useActiveAccount)();
|
|
41
|
+
const { data: nfts, isLoading } = (0, react_1.useAccountAssets)(account?.address);
|
|
42
|
+
const { data: signers, refetch: refetchSigners } = (0, react_1.useGetAllTWSigners)({
|
|
43
|
+
chain,
|
|
44
|
+
accountAddress: account?.address,
|
|
45
|
+
});
|
|
46
|
+
const { setB3ModalOpen, contentType } = (0, react_1.useModalStore)();
|
|
47
|
+
const { activeTab = "overview", setActiveTab } = contentType;
|
|
48
|
+
const { logout } = (0, react_1.useAuthentication)(partnerId);
|
|
49
|
+
const [logoutLoading, setLogoutLoading] = (0, react_2.useState)(false);
|
|
50
|
+
const { removeSessionKey } = (0, react_1.useRemoveSessionKey)({
|
|
51
|
+
chain,
|
|
52
|
+
onSuccess: tx => {
|
|
53
|
+
console.log("@@removeSessionKey:tx", tx);
|
|
54
|
+
setRevokingSignerId(null);
|
|
55
|
+
},
|
|
56
|
+
onError: error => {
|
|
57
|
+
console.error("Error revoking access:", error);
|
|
58
|
+
setRevokingSignerId(null);
|
|
59
|
+
},
|
|
60
|
+
refetchSigners: () => refetchSigners(),
|
|
61
|
+
});
|
|
62
|
+
const handleRevoke = async (signer) => {
|
|
63
|
+
setRevokingSignerId(signer.id);
|
|
64
|
+
await removeSessionKey(signer);
|
|
65
|
+
};
|
|
66
|
+
const onLogoutEnhanced = async () => {
|
|
67
|
+
setLogoutLoading(true);
|
|
68
|
+
await logout();
|
|
69
|
+
onLogout?.();
|
|
70
|
+
setB3ModalOpen(false);
|
|
71
|
+
setLogoutLoading(false);
|
|
72
|
+
};
|
|
73
|
+
const AppsContent = () => ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [signers?.map((signer) => ((0, jsx_runtime_1.jsx)("div", { className: "rounded-xl border border-gray-200 p-4 dark:border-gray-800", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-800", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-medium text-gray-600 dark:text-gray-400", children: "App" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { className: "font-medium text-gray-900 dark:text-white", children: signer.partner.name }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-2 space-y-1", children: [(0, jsx_runtime_1.jsxs)("p", { className: "text-xs text-gray-500", children: ["Added ", new Date(signer.createdAt).toLocaleDateString()] }), (0, jsx_runtime_1.jsxs)("p", { className: "text-xs text-gray-500", children: ["Expires ", new Date(Number(signer.endTimestamp) * 1000).toLocaleDateString()] }), (0, jsx_runtime_1.jsxs)("p", { className: "text-xs text-gray-500", children: ["Max spend: ", (0, formatNumber_1.formatNumber)(Number((0, viem_1.formatUnits)(signer.nativeTokenLimitPerTransaction, 18))), " ETH"] })] })] })] }), (0, jsx_runtime_1.jsx)(react_1.Button, { variant: "outline", size: "sm", className: "border-red-200 text-red-500 hover:border-red-300 hover:text-red-600", onClick: () => handleRevoke(signer), disabled: revokingSignerId === signer.id, children: revokingSignerId === signer.id ? "Revoking..." : "Revoke" })] }) }, signer.id))), !signers?.length && (0, jsx_runtime_1.jsx)("div", { className: "py-12 text-center text-gray-500", children: "No connected apps" })] }));
|
|
74
|
+
const SettingsContent = () => {
|
|
75
|
+
const [unlinkingAccountId, setUnlinkingAccountId] = (0, react_2.useState)(null);
|
|
76
|
+
const { data: profilesRaw = [], isLoading: isLoadingProfiles } = (0, react_3.useProfiles)({ client: thirdweb_1.client });
|
|
77
|
+
const { mutate: unlinkProfile, isPending: isUnlinking } = (0, react_3.useUnlinkProfile)();
|
|
78
|
+
const { setB3ModalOpen, setB3ModalContentType, isLinking, contentType } = (0, react_1.useModalStore)();
|
|
79
|
+
const { user, setUser } = (0, react_1.useB3)();
|
|
80
|
+
const [isUpdatingCode, setIsUpdatingCode] = (0, react_2.useState)(false);
|
|
81
|
+
const [newReferralCode, setNewReferralCode] = (0, react_2.useState)("");
|
|
82
|
+
const [isEditingCode, setIsEditingCode] = (0, react_2.useState)(false);
|
|
83
|
+
const referallCodeRef = (0, react_2.useRef)(null);
|
|
84
|
+
const { data: referrals, isLoading: isLoadingReferrals } = (0, react_1.useQueryB3)("referrals", "find", { query: { referrerId: user?.userId } }, !!user?.userId);
|
|
85
|
+
const showReferralInfo = contentType?.showReferralInfo ?? false;
|
|
86
|
+
const mutationOptions = {
|
|
87
|
+
onError: (error) => {
|
|
88
|
+
console.error("Error Unlinking account:", error);
|
|
89
|
+
sonner_1.toast.error(error.message);
|
|
90
|
+
},
|
|
91
|
+
onSuccess: async (data) => {
|
|
92
|
+
console.log("Raw Link Account Data:", data);
|
|
93
|
+
try {
|
|
94
|
+
console.log("Sync user data...");
|
|
95
|
+
await app_1.default.service("users").syncTwProfiles({});
|
|
32
96
|
}
|
|
33
|
-
|
|
34
|
-
|
|
97
|
+
catch (refreshError) {
|
|
98
|
+
console.warn("⚠️ Could not sync user data:", refreshError);
|
|
35
99
|
}
|
|
36
|
-
},
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
// Fetch referred users
|
|
103
|
+
const currentReferralCode = user?.referralCode || user?.userId || "";
|
|
104
|
+
const handleCopyCode = async () => {
|
|
105
|
+
try {
|
|
106
|
+
await navigator.clipboard.writeText(currentReferralCode);
|
|
107
|
+
sonner_1.toast.success("Referral code copied to clipboard!");
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
sonner_1.toast.error("Failed to copy referral code");
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const handleUpdateReferralCode = async () => {
|
|
114
|
+
if (!newReferralCode)
|
|
115
|
+
return;
|
|
116
|
+
setIsUpdatingCode(true);
|
|
117
|
+
try {
|
|
118
|
+
// @ts-expect-error - setReferralCode is not typed for some reason
|
|
119
|
+
const newUser = await app_1.default.service("users").setReferralCode({
|
|
120
|
+
userId: user?.userId,
|
|
121
|
+
referralCode: newReferralCode,
|
|
122
|
+
});
|
|
123
|
+
setUser(newUser);
|
|
124
|
+
sonner_1.toast.success("Referral code updated successfully!");
|
|
125
|
+
setIsEditingCode(false);
|
|
126
|
+
setNewReferralCode("");
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
sonner_1.toast.error("Failed to update referral code");
|
|
130
|
+
}
|
|
131
|
+
finally {
|
|
132
|
+
setIsUpdatingCode(false);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
const profiles = profilesRaw
|
|
136
|
+
.filter((profile) => !["custom_auth_endpoint"].includes(profile.type))
|
|
137
|
+
.map((profile) => ({
|
|
138
|
+
...(0, profileDisplay_1.getProfileDisplayInfo)(profile),
|
|
139
|
+
originalProfile: profile,
|
|
140
|
+
}));
|
|
141
|
+
const handleUnlink = async (profile) => {
|
|
142
|
+
setUnlinkingAccountId(profile.title);
|
|
143
|
+
try {
|
|
144
|
+
unlinkProfile({ client: thirdweb_1.client, profileToUnlink: profile.originalProfile }, mutationOptions);
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
console.error("Error unlinking account:", error);
|
|
148
|
+
}
|
|
149
|
+
finally {
|
|
150
|
+
setUnlinkingAccountId(null);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
const handleOpenLinkModal = () => {
|
|
154
|
+
setB3ModalOpen(true);
|
|
155
|
+
setB3ModalContentType({
|
|
156
|
+
type: "linkAccount",
|
|
157
|
+
showBackButton: true,
|
|
158
|
+
partnerId,
|
|
159
|
+
chain,
|
|
160
|
+
onSuccess: async () => {
|
|
161
|
+
// Let the LinkAccount component handle modal closing
|
|
162
|
+
},
|
|
163
|
+
onError: () => {
|
|
164
|
+
// Let the LinkAccount component handle errors
|
|
165
|
+
},
|
|
166
|
+
onClose: () => {
|
|
167
|
+
// Let the LinkAccount component handle closing
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
console.log("@@profiles", profiles);
|
|
172
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "linked-accounts-settings space-y-8", children: [(0, jsx_runtime_1.jsxs)("div", { className: "linked-accounts-section space-y-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "linked-accounts-header flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-b3-grey font-neue-montreal-semibold linked-accounts-settings-title text-xl", children: "Linked Accounts" }), (0, jsx_runtime_1.jsxs)(react_1.Button, { className: "linked-accounts-settings-button linked-accounts-link-button bg-b3-primary-wash hover:bg-b3-primary-wash/70 flex items-center gap-2 rounded-full px-4 py-2", onClick: handleOpenLinkModal, disabled: isLinking, children: [isLinking ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "linked-accounts-link-loading text-b3-primary-blue animate-spin", size: 16 })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.LinkIcon, { size: 16, className: "linked-accounts-link-icon text-b3-primary-blue" })), (0, jsx_runtime_1.jsx)("span", { className: "linked-accounts-link-text text-b3-grey font-neue-montreal-semibold", children: isLinking ? "Linking..." : "Link New Account" })] })] }), isLoadingProfiles ? ((0, jsx_runtime_1.jsx)("div", { className: "linked-accounts-loading flex justify-center py-8", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "text-b3-grey animate-spin" }) })) : profiles.length > 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "linked-accounts-list space-y-4", children: profiles.map(profile => ((0, jsx_runtime_1.jsxs)("div", { className: "linked-account-item bg-b3-line group flex items-center justify-between rounded-xl p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "linked-account-info flex items-center gap-3", children: [profile.imageUrl ? ((0, jsx_runtime_1.jsx)("img", { src: profile.imageUrl, alt: profile.title, className: "linked-account-avatar linked-account-avatar-image size-10 rounded-full" })) : ((0, jsx_runtime_1.jsx)("div", { className: "linked-account-avatar linked-account-avatar-placeholder bg-b3-primary-wash flex h-10 w-10 items-center justify-center rounded-full", children: (0, jsx_runtime_1.jsx)("span", { className: "linked-account-initial text-b3-grey font-neue-montreal-semibold text-sm uppercase", children: profile.initial }) })), (0, jsx_runtime_1.jsxs)("div", { className: "linked-account-details", children: [(0, jsx_runtime_1.jsxs)("div", { className: "linked-account-title-row flex items-center gap-2", children: [(() => {
|
|
173
|
+
const { displayTitle, isAddress } = formatProfileTitle(profile.title);
|
|
174
|
+
const handleCopyAddress = async (e) => {
|
|
175
|
+
e.stopPropagation();
|
|
176
|
+
try {
|
|
177
|
+
await navigator.clipboard.writeText(profile.title);
|
|
178
|
+
sonner_1.toast.success("Address copied to clipboard!");
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
sonner_1.toast.error("Failed to copy address");
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: `linked-account-title text-b3-grey font-neue-montreal-semibold ${isAddress
|
|
185
|
+
? "font-mono text-sm" // Use monospace font for addresses
|
|
186
|
+
: "break-words" // Use break-words for emails/names (better than break-all)
|
|
187
|
+
}`, title: isAddress ? profile.title : undefined, children: displayTitle }), isAddress && ((0, jsx_runtime_1.jsx)("button", { onClick: handleCopyAddress, className: "linked-account-copy-button ml-1 rounded p-1 opacity-0 transition-opacity hover:bg-gray-100 group-hover:opacity-100", title: "Copy full address", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { size: 12, className: "text-gray-500 hover:text-gray-700" }) }))] }));
|
|
188
|
+
})(), (0, jsx_runtime_1.jsx)("span", { className: "linked-account-type text-b3-foreground-muted font-neue-montreal-medium bg-b3-primary-wash rounded px-2 py-0.5 text-xs", children: profile.type.toUpperCase() })] }), (0, jsx_runtime_1.jsx)("div", { className: "linked-account-subtitle text-b3-foreground-muted font-neue-montreal-medium text-sm", children: profile.subtitle })] })] }), (0, jsx_runtime_1.jsx)(react_1.Button, { variant: "ghost", size: "icon", className: "linked-account-unlink-button text-b3-grey hover:text-b3-negative", onClick: () => handleUnlink(profile), disabled: unlinkingAccountId === profile.title || isUnlinking, children: unlinkingAccountId === profile.title || isUnlinking ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "linked-account-unlink-loading animate-spin" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.UnlinkIcon, { size: 16, className: "linked-account-unlink-icon" })) })] }, profile.title))) })) : ((0, jsx_runtime_1.jsx)("div", { className: "linked-accounts-empty text-b3-foreground-muted py-8 text-center", children: "No linked accounts found" }))] }), showReferralInfo && (
|
|
189
|
+
/* Referral Section */
|
|
190
|
+
(0, jsx_runtime_1.jsxs)("div", { className: "referrals-section space-y-4", children: [(0, jsx_runtime_1.jsx)("h3", { className: "referrals-title text-b3-grey font-neue-montreal-semibold text-xl", children: "Referrals" }), (0, jsx_runtime_1.jsxs)("div", { className: "referral-code-container bg-b3-line rounded-xl p-4", children: [isEditingCode && ((0, jsx_runtime_1.jsxs)("div", { className: "referral-code-header-editing", children: [(0, jsx_runtime_1.jsx)("div", { className: "referral-code-title text-b3-grey font-neue-montreal-semibold", children: "Your Referral Code" }), (0, jsx_runtime_1.jsx)("div", { className: "referral-code-description text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "Share this code with friends to earn rewards" })] })), (0, jsx_runtime_1.jsxs)("div", { className: "referral-code-content flex items-center justify-between", children: [!isEditingCode && ((0, jsx_runtime_1.jsxs)("div", { className: "referral-code-header", children: [(0, jsx_runtime_1.jsx)("div", { className: "referral-code-title text-b3-grey font-neue-montreal-semibold", children: "Your Referral Code" }), (0, jsx_runtime_1.jsx)("div", { className: "referral-code-description text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "Share this code with friends to earn rewards" })] })), (0, jsx_runtime_1.jsx)("div", { className: "referral-code-actions flex items-center gap-2", children: isEditingCode ? ((0, jsx_runtime_1.jsxs)("div", { className: "referral-code-edit-form flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("input", { type: "text", value: newReferralCode, onChange: e => setNewReferralCode(e.target.value), className: "referral-code-input rounded-lg border border-gray-200 bg-white px-3 py-1.5 text-sm", placeholder: "Enter new code", ref: referallCodeRef }), (0, jsx_runtime_1.jsx)(react_1.Button, { size: "sm", className: "referral-code-save-button", onClick: handleUpdateReferralCode, disabled: isUpdatingCode || !newReferralCode, children: isUpdatingCode ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "referral-code-save-loading h-4 w-4 animate-spin" })) : ("Save") }), (0, jsx_runtime_1.jsx)(react_1.Button, { size: "sm", variant: "ghost", className: "referral-code-cancel-button", onClick: () => {
|
|
191
|
+
setIsEditingCode(false);
|
|
192
|
+
setNewReferralCode("");
|
|
193
|
+
}, children: "Cancel" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "referral-code-display rounded-lg border border-gray-200 bg-white px-3 py-1.5 text-sm", children: currentReferralCode }), (0, jsx_runtime_1.jsx)(react_1.Button, { size: "icon", variant: "ghost", className: "referral-code-copy-button", onClick: handleCopyCode, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "referral-code-copy-icon h-4 w-4" }) }), (0, jsx_runtime_1.jsx)(react_1.Button, { size: "icon", variant: "ghost", className: "referral-code-edit-button", onClick: () => {
|
|
194
|
+
setIsEditingCode(true);
|
|
195
|
+
setTimeout(() => {
|
|
196
|
+
referallCodeRef.current?.focus();
|
|
197
|
+
}, 100);
|
|
198
|
+
}, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Pencil, { className: "referral-code-edit-icon h-4 w-4" }) })] })) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "referred-users-container bg-b3-line rounded-xl p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "referred-users-title text-b3-grey font-neue-montreal-semibold mb-4", children: "Referred Users" }), isLoadingReferrals ? ((0, jsx_runtime_1.jsx)("div", { className: "referred-users-loading flex justify-center py-4", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-6 w-6 animate-spin text-gray-400" }) })) : referrals?.data?.length ? ((0, jsx_runtime_1.jsx)("div", { className: "referred-users-list space-y-3", children: referrals.data.map((referral) => ((0, jsx_runtime_1.jsxs)("div", { className: "referred-user-item flex items-center justify-between rounded-lg bg-white p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "referred-user-id text-sm font-medium", children: referral.referreeId }), (0, jsx_runtime_1.jsx)("div", { className: "referred-user-date text-sm text-gray-500", children: new Date(referral.createdAt).toLocaleDateString() })] }, String(referral._id)))) })) : ((0, jsx_runtime_1.jsx)("div", { className: "referred-users-empty py-4 text-center text-gray-500", children: "No referred users yet" }))] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "account-preferences-section space-y-4", children: [(0, jsx_runtime_1.jsx)("h3", { className: "account-preferences-title text-b3-grey font-neue-montreal-semibold text-xl", children: "Account Preferences" }), (0, jsx_runtime_1.jsx)("div", { className: "account-preferences-container bg-b3-line rounded-xl p-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "account-preference-item flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "account-preference-info", children: [(0, jsx_runtime_1.jsx)("div", { className: "account-preference-title text-b3-grey font-neue-montreal-semibold", children: "Dark Mode" }), (0, jsx_runtime_1.jsx)("div", { className: "account-preference-description text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "Switch between light and dark theme" })] }), (0, jsx_runtime_1.jsx)("div", { className: "account-preference-toggle theme-toggle-placeholder bg-b3-primary-wash h-6 w-12 rounded-full" })] }) })] }), (0, jsx_runtime_1.jsxs)("button", { className: "logout-button logout-section border-b3-line hover:bg-b3-line relative flex w-full items-center justify-center rounded-2xl border p-4 transition-colors", onClick: onLogoutEnhanced, children: [(0, jsx_runtime_1.jsx)("span", { className: "logout-text font-neue-montreal-semibold text-b3-grey", children: "Sign out" }), (0, jsx_runtime_1.jsx)("div", { className: "logout-icon-container absolute right-4", children: logoutLoading ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "logout-loading animate-spin", size: 16 })) : ((0, jsx_runtime_1.jsx)(SignOutIcon_1.SignOutIcon, { size: 16, className: "logout-icon text-b3-grey" })) })] })] }));
|
|
199
|
+
};
|
|
200
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "b3-manage-account bg-b3-background flex flex-col rounded-xl", children: (0, jsx_runtime_1.jsx)("div", { className: "flex-1", children: (0, jsx_runtime_1.jsxs)(react_1.TabsPrimitive, { defaultValue: activeTab, onValueChange: value => {
|
|
201
|
+
const tab = value;
|
|
202
|
+
if (["overview", "tokens", "nfts", "apps", "settings"].includes(tab)) {
|
|
203
|
+
setActiveTab?.(tab);
|
|
204
|
+
}
|
|
205
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { className: "px-4", children: (0, jsx_runtime_1.jsxs)(react_1.TabsListPrimitive, { className: "grid h-auto grid-cols-2 grid-rows-2 gap-3 rounded-none border-none bg-transparent", children: [(0, jsx_runtime_1.jsxs)(react_1.TabTriggerPrimitive, { value: "overview", className: "data-[state=active]:bg-b3-primary-blue data-[state=active]:hover:bg-b3-primary-blue data-[state=active]:border-b3-primary-blue group flex h-12 w-full items-center justify-center gap-2 rounded-xl border border-gray-200 bg-white p-2 text-center shadow-sm transition-all duration-200 hover:bg-gray-50 hover:shadow-md data-[state=active]:shadow-lg", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.BarChart3, { size: 20, className: "text-b3-primary-blue shrink-0 group-data-[state=active]:text-white" }), (0, jsx_runtime_1.jsx)("span", { className: "text-b3-grey font-neue-montreal-semibold text-sm group-data-[state=active]:text-white", children: "Overview" })] }), (0, jsx_runtime_1.jsxs)(react_1.TabTriggerPrimitive, { value: "tokens", className: "data-[state=active]:bg-b3-primary-blue data-[state=active]:hover:bg-b3-primary-blue data-[state=active]:border-b3-primary-blue group flex h-12 w-full items-center justify-center gap-2 rounded-xl border border-gray-200 bg-white p-2 text-center shadow-sm transition-all duration-200 hover:bg-gray-50 hover:shadow-md data-[state=active]:shadow-lg", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Coins, { size: 20, className: "text-b3-primary-blue shrink-0 group-data-[state=active]:text-white" }), (0, jsx_runtime_1.jsx)("span", { className: "text-b3-grey font-neue-montreal-semibold text-sm group-data-[state=active]:text-white", children: "Tokens" })] }), (0, jsx_runtime_1.jsxs)(react_1.TabTriggerPrimitive, { value: "nfts", className: "data-[state=active]:bg-b3-primary-blue data-[state=active]:hover:bg-b3-primary-blue data-[state=active]:border-b3-primary-blue group flex h-12 w-full items-center justify-center gap-2 rounded-xl border border-gray-200 bg-white p-2 text-center shadow-sm transition-all duration-200 hover:bg-gray-50 hover:shadow-md data-[state=active]:shadow-lg", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Image, { size: 20, className: "text-b3-primary-blue shrink-0 group-data-[state=active]:text-white" }), (0, jsx_runtime_1.jsx)("span", { className: "text-b3-grey font-neue-montreal-semibold text-sm group-data-[state=active]:text-white", children: "NFTs" })] }), (0, jsx_runtime_1.jsxs)(react_1.TabTriggerPrimitive, { value: "settings", className: "data-[state=active]:bg-b3-primary-blue data-[state=active]:hover:bg-b3-primary-blue data-[state=active]:border-b3-primary-blue group flex h-12 w-full items-center justify-center gap-2 rounded-xl border border-gray-200 bg-white p-2 text-center shadow-sm transition-all duration-200 hover:bg-gray-50 hover:shadow-md data-[state=active]:shadow-lg", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Settings, { size: 20, className: "text-b3-primary-blue shrink-0 group-data-[state=active]:text-white" }), (0, jsx_runtime_1.jsx)("span", { className: "text-b3-grey font-neue-montreal-semibold text-sm group-data-[state=active]:text-white", children: "Settings" })] })] }) }), (0, jsx_runtime_1.jsx)(react_1.TabsContentPrimitive, { value: "overview", className: "px-4 pb-4 pt-2", children: (0, jsx_runtime_1.jsx)(BalanceContent_1.BalanceContent, { onLogout: onLogout, showDeposit: showDeposit, showSwap: showSwap }) }), (0, jsx_runtime_1.jsx)(react_1.TabsContentPrimitive, { value: "tokens", className: "px-4 pb-4 pt-2", children: (0, jsx_runtime_1.jsx)(ContentTokens_1.ContentTokens, { activeTab: activeTab }) }), (0, jsx_runtime_1.jsx)(react_1.TabsContentPrimitive, { value: "nfts", className: "px-4 pb-4 pt-2", children: (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-3 gap-4", children: nfts?.nftResponse ? ((0, jsx_runtime_1.jsx)(AccountAssets_1.AccountAssets, { nfts: nfts.nftResponse, isLoading: isLoading })) : ((0, jsx_runtime_1.jsx)("div", { className: "col-span-3 py-12 text-center text-gray-500", children: "No NFTs found" })) }) }), (0, jsx_runtime_1.jsx)(react_1.TabsContentPrimitive, { value: "apps", className: "px-4 pb-4 pt-2", children: (0, jsx_runtime_1.jsx)(AppsContent, {}) }), (0, jsx_runtime_1.jsx)(react_1.TabsContentPrimitive, { value: "settings", className: "px-4 pb-4 pt-2", children: (0, jsx_runtime_1.jsx)(SettingsContent, {}) })] }) }) }));
|
|
37
206
|
}
|
|
@@ -13,8 +13,6 @@ export { SignInWithB3Privy } from "./SignInWithB3/SignInWithB3Privy";
|
|
|
13
13
|
export { LoginStepContainer } from "./SignInWithB3/steps/LoginStep";
|
|
14
14
|
export { getConnectOptionsFromStrategy, isWalletType, type AllowedStrategy } from "./SignInWithB3/utils/signInUtils";
|
|
15
15
|
export { ManageAccount } from "./ManageAccount/ManageAccount";
|
|
16
|
-
export { Deposit } from "./Deposit/Deposit";
|
|
17
|
-
export { Send } from "./Send/Send";
|
|
18
16
|
export { AvatarEditor } from "./AvatarEditor/AvatarEditor";
|
|
19
17
|
export { ProfileEditor } from "./ProfileEditor/ProfileEditor";
|
|
20
18
|
export { RequestPermissions } from "./RequestPermissions/RequestPermissions";
|
|
@@ -42,8 +40,8 @@ export { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
|
|
|
42
40
|
export { ScrollArea, ScrollBar } from "./ui/scroll-area";
|
|
43
41
|
export { ShinyButton } from "./ui/ShinyButton";
|
|
44
42
|
export { Skeleton } from "./ui/skeleton";
|
|
45
|
-
export { TabsContent as TabsContentPrimitive, TabsList as TabsListPrimitive, Tabs as TabsPrimitive,
|
|
46
|
-
export { Tabs, TabsContent, TabsList, TabsTransitionWrapper
|
|
43
|
+
export { TabTrigger as TabTriggerPrimitive, TabsContent as TabsContentPrimitive, TabsList as TabsListPrimitive, Tabs as TabsPrimitive, } from "./ui/Tabs";
|
|
44
|
+
export { TabTrigger, Tabs, TabsContent, TabsList, TabsTransitionWrapper } from "./ui/TabSystem";
|
|
47
45
|
export { TextLoop } from "./ui/text-loop";
|
|
48
46
|
export { TextShimmer } from "./ui/text-shimmer";
|
|
49
47
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./ui/tooltip";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DialogDescription = exports.DialogContent = exports.DialogClose = exports.Dialog = exports.CommandShortcut = exports.CommandSeparator = exports.CommandList = exports.CommandItem = exports.CommandInput = exports.CommandGroup = exports.CommandEmpty = exports.CommandDialog = exports.Command = exports.buttonVariants = exports.Button = exports.badgeVariants = exports.Badge = exports.WalletConnectorIcon = exports.StaggeredFadeLoader = exports.CopyToClipboard = exports.ClientOnly = exports.customButtonVariants = exports.CustomButton = exports.SendERC20Button = exports.SendETHButton = exports.MintButton = exports.AccountAssets = exports.RequestPermissionsButton = exports.RequestPermissions = exports.ProfileEditor = exports.AvatarEditor = exports.
|
|
4
|
-
exports.AnimatedLottie = exports.TransitionPanel = exports.TooltipTrigger = exports.TooltipProvider = exports.TooltipContent = exports.Tooltip = exports.TextShimmer = exports.TextLoop = exports.
|
|
3
|
+
exports.DialogHeader = exports.DialogFooter = exports.DialogDescription = exports.DialogContent = exports.DialogClose = exports.Dialog = exports.CommandShortcut = exports.CommandSeparator = exports.CommandList = exports.CommandItem = exports.CommandInput = exports.CommandGroup = exports.CommandEmpty = exports.CommandDialog = exports.Command = exports.buttonVariants = exports.Button = exports.badgeVariants = exports.Badge = exports.WalletConnectorIcon = exports.StaggeredFadeLoader = exports.CopyToClipboard = exports.ClientOnly = exports.customButtonVariants = exports.CustomButton = exports.SendERC20Button = exports.SendETHButton = exports.MintButton = exports.AccountAssets = exports.RequestPermissionsButton = exports.RequestPermissions = exports.ProfileEditor = exports.AvatarEditor = exports.ManageAccount = exports.isWalletType = exports.getConnectOptionsFromStrategy = exports.LoginStepContainer = exports.SignInWithB3Privy = exports.SignInWithB3Flow = exports.SignInWithB3 = exports.WalletRow = exports.PermissionItem = exports.AuthButton = exports.StyleRoot = exports.useB3 = exports.B3Context = exports.RelayKitProviderWrapper = exports.InnerProvider = exports.B3Provider = exports.B3DynamicModal = void 0;
|
|
4
|
+
exports.AnimatedLottie = exports.TransitionPanel = exports.TooltipTrigger = exports.TooltipProvider = exports.TooltipContent = exports.Tooltip = exports.TextShimmer = exports.TextLoop = exports.TabsTransitionWrapper = exports.TabsList = exports.TabsContent = exports.Tabs = exports.TabTrigger = exports.TabsPrimitive = exports.TabsListPrimitive = exports.TabsContentPrimitive = exports.TabTriggerPrimitive = exports.Skeleton = exports.ShinyButton = exports.ScrollBar = exports.ScrollArea = exports.PopoverTrigger = exports.PopoverContent = exports.Popover = exports.Loading = exports.Input = exports.GlareCardRounded = exports.GlareCard = exports.DropdownMenuTrigger = exports.DropdownMenuSeparator = exports.DropdownMenuItem = exports.DropdownMenuContent = exports.DropdownMenu = exports.DrawerTrigger = exports.DrawerTitle = exports.DrawerPortal = exports.DrawerOverlay = exports.DrawerHeader = exports.DrawerFooter = exports.DrawerDescription = exports.DrawerContent = exports.DrawerClose = exports.Drawer = exports.DialogTrigger = exports.DialogTitle = exports.DialogPortal = exports.DialogOverlay = void 0;
|
|
5
5
|
// Core Components
|
|
6
6
|
var B3DynamicModal_1 = require("./B3DynamicModal");
|
|
7
7
|
Object.defineProperty(exports, "B3DynamicModal", { enumerable: true, get: function () { return B3DynamicModal_1.B3DynamicModal; } });
|
|
@@ -37,13 +37,6 @@ Object.defineProperty(exports, "isWalletType", { enumerable: true, get: function
|
|
|
37
37
|
// ManageAccount Components
|
|
38
38
|
var ManageAccount_1 = require("./ManageAccount/ManageAccount");
|
|
39
39
|
Object.defineProperty(exports, "ManageAccount", { enumerable: true, get: function () { return ManageAccount_1.ManageAccount; } });
|
|
40
|
-
// Deposit Components
|
|
41
|
-
var Deposit_1 = require("./Deposit/Deposit");
|
|
42
|
-
Object.defineProperty(exports, "Deposit", { enumerable: true, get: function () { return Deposit_1.Deposit; } });
|
|
43
|
-
// Send Components
|
|
44
|
-
var Send_1 = require("./Send/Send");
|
|
45
|
-
Object.defineProperty(exports, "Send", { enumerable: true, get: function () { return Send_1.Send; } });
|
|
46
|
-
// B3 Global Branding Wrapper
|
|
47
40
|
// Profile Components
|
|
48
41
|
var AvatarEditor_1 = require("./AvatarEditor/AvatarEditor");
|
|
49
42
|
Object.defineProperty(exports, "AvatarEditor", { enumerable: true, get: function () { return AvatarEditor_1.AvatarEditor; } });
|
|
@@ -143,16 +136,16 @@ Object.defineProperty(exports, "ShinyButton", { enumerable: true, get: function
|
|
|
143
136
|
var skeleton_1 = require("./ui/skeleton");
|
|
144
137
|
Object.defineProperty(exports, "Skeleton", { enumerable: true, get: function () { return skeleton_1.Skeleton; } });
|
|
145
138
|
var Tabs_1 = require("./ui/Tabs");
|
|
139
|
+
Object.defineProperty(exports, "TabTriggerPrimitive", { enumerable: true, get: function () { return Tabs_1.TabTrigger; } });
|
|
146
140
|
Object.defineProperty(exports, "TabsContentPrimitive", { enumerable: true, get: function () { return Tabs_1.TabsContent; } });
|
|
147
141
|
Object.defineProperty(exports, "TabsListPrimitive", { enumerable: true, get: function () { return Tabs_1.TabsList; } });
|
|
148
142
|
Object.defineProperty(exports, "TabsPrimitive", { enumerable: true, get: function () { return Tabs_1.Tabs; } });
|
|
149
|
-
Object.defineProperty(exports, "TabTriggerPrimitive", { enumerable: true, get: function () { return Tabs_1.TabTrigger; } });
|
|
150
143
|
var TabSystem_1 = require("./ui/TabSystem");
|
|
144
|
+
Object.defineProperty(exports, "TabTrigger", { enumerable: true, get: function () { return TabSystem_1.TabTrigger; } });
|
|
151
145
|
Object.defineProperty(exports, "Tabs", { enumerable: true, get: function () { return TabSystem_1.Tabs; } });
|
|
152
146
|
Object.defineProperty(exports, "TabsContent", { enumerable: true, get: function () { return TabSystem_1.TabsContent; } });
|
|
153
147
|
Object.defineProperty(exports, "TabsList", { enumerable: true, get: function () { return TabSystem_1.TabsList; } });
|
|
154
148
|
Object.defineProperty(exports, "TabsTransitionWrapper", { enumerable: true, get: function () { return TabSystem_1.TabsTransitionWrapper; } });
|
|
155
|
-
Object.defineProperty(exports, "TabTrigger", { enumerable: true, get: function () { return TabSystem_1.TabTrigger; } });
|
|
156
149
|
var text_loop_1 = require("./ui/text-loop");
|
|
157
150
|
Object.defineProperty(exports, "TextLoop", { enumerable: true, get: function () { return text_loop_1.TextLoop; } });
|
|
158
151
|
var text_shimmer_1 = require("./ui/text-shimmer");
|
|
@@ -43,10 +43,10 @@ const TabsPrimitive = __importStar(require("@radix-ui/react-tabs"));
|
|
|
43
43
|
const Tabs = ({ defaultValue, onValueChange, children, }) => ((0, jsx_runtime_1.jsx)(TabsPrimitive.Root, { defaultValue: defaultValue, onValueChange: onValueChange, children: children }));
|
|
44
44
|
exports.Tabs = Tabs;
|
|
45
45
|
function TabsList({ className, ...props }) {
|
|
46
|
-
return (0, jsx_runtime_1.jsx)(TabsPrimitive.List, { className: (0, utils_1.cn)("", className), ...props });
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)(TabsPrimitive.List, { className: (0, utils_1.cn)("border-b3-react-border bg-b3-react-background inline-flex h-12 w-full items-center justify-center rounded-lg border", className), ...props }));
|
|
47
47
|
}
|
|
48
48
|
function TabTrigger({ className, ...props }) {
|
|
49
|
-
return ((0, jsx_runtime_1.jsx)(TabsPrimitive.Trigger, { className: (0, utils_1.cn)("
|
|
49
|
+
return ((0, jsx_runtime_1.jsx)(TabsPrimitive.Trigger, { className: (0, utils_1.cn)("inline-flex h-full items-center justify-center whitespace-nowrap px-3 text-sm font-medium transition-all", "focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50", "data-[state=active]:bg-b3-react-subtle data-[state=active]:text-b3-react-primary data-[state=active]:font-bold", "border-b3-react-border hover:text-b3-react-foreground data-[state=inactive]:border-b3-react-border data-[state=inactive]:text-b3-react-muted-foreground", "flex-1 border-r", className), ...props }));
|
|
50
50
|
}
|
|
51
51
|
function TabsContent({ className, ...props }) {
|
|
52
52
|
return ((0, jsx_runtime_1.jsx)(TabsPrimitive.Content, { className: (0, utils_1.cn)("ring-offset-b3-react-background focus-visible:ring-b3-react-ring mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", className), ...props }));
|
|
@@ -51,9 +51,9 @@ exports.DialogClose = DialogClose;
|
|
|
51
51
|
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(DialogPrimitive.Overlay, { ref: ref, className: (0, utils_1.cn)("fixed inset-0 z-50 bg-black/80 backdrop-blur-[20px]", "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:backdrop-blur-none data-[state=open]:backdrop-blur-[20px]", "transition-all duration-300", className), ...props })));
|
|
52
52
|
exports.DialogOverlay = DialogOverlay;
|
|
53
53
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
54
|
-
const DialogContent = React.forwardRef(({ className, children, hideCloseButton =
|
|
54
|
+
const DialogContent = React.forwardRef(({ className, children, hideCloseButton = false, closeBtnClassName, ...props }, ref) => {
|
|
55
55
|
const container = typeof window !== "undefined" ? document.getElementById("b3-root") : null;
|
|
56
|
-
return ((0, jsx_runtime_1.jsxs)(DialogPortal, { container: container, children: [(0, jsx_runtime_1.jsx)(DialogOverlay, {}), (0, jsx_runtime_1.jsxs)(DialogPrimitive.Content, { ref: ref, className: (0, utils_1.cn)("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 border shadow-lg !outline-none", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 duration-500", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]", "[perspective:1200px] [transform-style:preserve-3d] sm:rounded-xl", "transition-all ease-out", className), ...props, children: [
|
|
56
|
+
return ((0, jsx_runtime_1.jsxs)(DialogPortal, { container: container, children: [(0, jsx_runtime_1.jsx)(DialogOverlay, {}), (0, jsx_runtime_1.jsxs)(DialogPrimitive.Content, { ref: ref, className: (0, utils_1.cn)("bg-b3-react-background fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg !outline-none", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 duration-500", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]", "[perspective:1200px] [transform-style:preserve-3d] sm:rounded-xl", "transition-all ease-out", className), ...props, children: [children, !hideCloseButton && ((0, jsx_runtime_1.jsxs)(DialogPrimitive.Close, { className: (0, utils_1.cn)("modal-close-button data-[state=open]:bg-b3-react-background data-[state=open]:text-b3-react-muted-foreground absolute right-2 top-2 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none dark:data-[state=open]:bg-gray-800 dark:data-[state=open]:text-gray-400", closeBtnClassName), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-5 w-5" }), (0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: "Close" })] }))] })] }));
|
|
57
57
|
});
|
|
58
58
|
exports.DialogContent = DialogContent;
|
|
59
59
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
@@ -23,7 +23,7 @@ export { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect";
|
|
|
23
23
|
export { useMediaQuery } from "./useMediaQuery";
|
|
24
24
|
export { useNativeBalance, useNativeBalanceFromRPC } from "./useNativeBalance";
|
|
25
25
|
export { useOneBalance } from "./useOneBalance";
|
|
26
|
-
export { useProfile, useProfilePreference,
|
|
26
|
+
export { useProfile, useProfilePreference, type CombinedProfile, type PreferenceRequestBody, type Profile, } from "./useProfile";
|
|
27
27
|
export { useQueryB3 } from "./useQueryB3";
|
|
28
28
|
export { useQueryBSMNT } from "./useQueryBSMNT";
|
|
29
29
|
export { useRemoveSessionKey } from "./useRemoveSessionKey";
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.useUnifiedChainSwitchAndExecute = exports.useURLParams = exports.useTokensFromAddress = exports.useTokenPriceWithFallback = exports.useTokenPrice = exports.useTokenFromUrl = exports.useTokenData = exports.useTokenBalancesByChain = exports.useTokenBalanceDirect = exports.useTokenBalance = exports.useSiwe = exports.useSimBalance = exports.useSearchParamsSSR = exports.useRouter = exports.useRemoveSessionKey = exports.useQueryBSMNT = exports.useQueryB3 = exports.
|
|
17
|
+
exports.useUnifiedChainSwitchAndExecute = exports.useURLParams = exports.useTokensFromAddress = exports.useTokenPriceWithFallback = exports.useTokenPrice = exports.useTokenFromUrl = exports.useTokenData = exports.useTokenBalancesByChain = exports.useTokenBalanceDirect = exports.useTokenBalance = exports.useSiwe = exports.useSimBalance = exports.useSearchParamsSSR = exports.useRouter = exports.useRemoveSessionKey = exports.useQueryBSMNT = exports.useQueryB3 = exports.useProfilePreference = exports.useProfile = exports.useOneBalance = exports.useNativeBalanceFromRPC = exports.useNativeBalance = exports.useMediaQuery = exports.useIsomorphicLayoutEffect = exports.useIsMobile = exports.useHasMounted = exports.useHandleConnectWithPrivy = exports.useGlobalAccount = exports.useGetGeo = exports.useGetAllTWSigners = exports.useFirstEOA = exports.useExchangeRate = exports.useConnect = exports.useClient = exports.useChainSwitchWithAction = exports.useBestTransactionPath = exports.useB3EnsName = exports.useB3BalanceFromAddresses = exports.useAuthentication = exports.useAnalytics = exports.useAddTWSessionKey = exports.useAccountWallet = exports.useAccountAssets = exports.createWagmiConfig = void 0;
|
|
18
18
|
var createWagmiConfig_1 = require("../utils/createWagmiConfig");
|
|
19
19
|
Object.defineProperty(exports, "createWagmiConfig", { enumerable: true, get: function () { return createWagmiConfig_1.createWagmiConfig; } });
|
|
20
20
|
var useAccountAssets_1 = require("./useAccountAssets");
|
|
@@ -68,8 +68,6 @@ Object.defineProperty(exports, "useOneBalance", { enumerable: true, get: functio
|
|
|
68
68
|
var useProfile_1 = require("./useProfile");
|
|
69
69
|
Object.defineProperty(exports, "useProfile", { enumerable: true, get: function () { return useProfile_1.useProfile; } });
|
|
70
70
|
Object.defineProperty(exports, "useProfilePreference", { enumerable: true, get: function () { return useProfile_1.useProfilePreference; } });
|
|
71
|
-
Object.defineProperty(exports, "useProfileSettings", { enumerable: true, get: function () { return useProfile_1.useProfileSettings; } });
|
|
72
|
-
Object.defineProperty(exports, "useDisplayName", { enumerable: true, get: function () { return useProfile_1.useDisplayName; } });
|
|
73
71
|
var useQueryB3_1 = require("./useQueryB3");
|
|
74
72
|
Object.defineProperty(exports, "useQueryB3", { enumerable: true, get: function () { return useQueryB3_1.useQueryB3; } });
|
|
75
73
|
var useQueryBSMNT_1 = require("./useQueryBSMNT");
|
|
@@ -77,7 +77,6 @@ function useB3BalanceFromAddresses(addresses, options) {
|
|
|
77
77
|
enabled: (options?.enabled ?? true) && normalizedAddresses.length > 0,
|
|
78
78
|
refetchInterval: options?.refetchInterval ?? 30000, // Default 30s refresh
|
|
79
79
|
staleTime: 10000, // Consider data stale after 10s
|
|
80
|
-
structuralSharing: false, // Disable structural sharing because data contains BigInt values
|
|
81
80
|
});
|
|
82
81
|
}
|
|
83
82
|
exports.default = useB3BalanceFromAddresses;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { useAuthStore } from "./useAuthStore";
|
|
2
2
|
export { useModalStore } from "./useModalStore";
|
|
3
|
-
export { useRecentAddressesStore } from "./useRecentAddressesStore";
|
|
4
3
|
export type { AnySpendBuySpinProps, AnySpendFundTournamentProps, AnySpendJoinTournamentProps, AnySpendModalProps, AnySpendNftProps, AnySpendOrderHistoryProps, AnySpendStakeB3Props, AnyspendOrderDetailsProps, ManageAccountModalProps, ModalContentType, RequestPermissionsModalProps, SignInWithB3ModalProps, } from "./useModalStore";
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.useModalStore = exports.useAuthStore = void 0;
|
|
4
4
|
var useAuthStore_1 = require("./useAuthStore");
|
|
5
5
|
Object.defineProperty(exports, "useAuthStore", { enumerable: true, get: function () { return useAuthStore_1.useAuthStore; } });
|
|
6
6
|
var useModalStore_1 = require("./useModalStore");
|
|
7
7
|
Object.defineProperty(exports, "useModalStore", { enumerable: true, get: function () { return useModalStore_1.useModalStore; } });
|
|
8
|
-
var useRecentAddressesStore_1 = require("./useRecentAddressesStore");
|
|
9
|
-
Object.defineProperty(exports, "useRecentAddressesStore", { enumerable: true, get: function () { return useRecentAddressesStore_1.useRecentAddressesStore; } });
|
|
@@ -77,9 +77,9 @@ export interface ManageAccountModalProps extends BaseModalProps {
|
|
|
77
77
|
/** Partner ID */
|
|
78
78
|
partnerId: string;
|
|
79
79
|
/** Active Tab */
|
|
80
|
-
activeTab?: "
|
|
80
|
+
activeTab?: "overview" | "tokens" | "nfts" | "apps" | "settings";
|
|
81
81
|
/** Function to set the active tab */
|
|
82
|
-
setActiveTab?: (tab: "
|
|
82
|
+
setActiveTab?: (tab: "overview" | "tokens" | "nfts" | "apps" | "settings") => void;
|
|
83
83
|
/** Whether to show the referral information */
|
|
84
84
|
showReferralInfo?: boolean;
|
|
85
85
|
/** Whether to show the swap button */
|
|
@@ -325,15 +325,6 @@ export interface LinkAccountModalProps extends BaseModalProps {
|
|
|
325
325
|
partnerId: string;
|
|
326
326
|
chain: Chain;
|
|
327
327
|
}
|
|
328
|
-
export interface LinkNewAccountModalProps extends BaseModalProps {
|
|
329
|
-
type: "linkNewAccount";
|
|
330
|
-
showBackButton?: boolean;
|
|
331
|
-
onSuccess?: () => void;
|
|
332
|
-
onError?: (error: Error) => void;
|
|
333
|
-
onClose?: () => void;
|
|
334
|
-
partnerId: string;
|
|
335
|
-
chain: Chain;
|
|
336
|
-
}
|
|
337
328
|
export interface AnySpendDepositHypeProps extends BaseModalProps {
|
|
338
329
|
/** Modal type identifier */
|
|
339
330
|
type: "anySpendDepositHype";
|
|
@@ -366,32 +357,10 @@ export interface ProfileEditorModalProps extends BaseModalProps {
|
|
|
366
357
|
/** Callback function called when profile is successfully updated */
|
|
367
358
|
onSuccess?: () => void;
|
|
368
359
|
}
|
|
369
|
-
/**
|
|
370
|
-
* Props for the Deposit modal
|
|
371
|
-
* Allows users to deposit tokens into their global account
|
|
372
|
-
*/
|
|
373
|
-
export interface DepositModalProps extends BaseModalProps {
|
|
374
|
-
/** Modal type identifier */
|
|
375
|
-
type: "deposit";
|
|
376
|
-
/** Callback function called when deposit is successful */
|
|
377
|
-
onSuccess?: () => void;
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* Props for the Send modal
|
|
381
|
-
* Allows users to send tokens from their global account to another address
|
|
382
|
-
*/
|
|
383
|
-
export interface SendModalProps extends BaseModalProps {
|
|
384
|
-
/** Modal type identifier */
|
|
385
|
-
type: "send";
|
|
386
|
-
/** Pre-filled recipient address (optional) */
|
|
387
|
-
recipientAddress?: string;
|
|
388
|
-
/** Callback function called when send is successful */
|
|
389
|
-
onSuccess?: (txHash?: string) => void;
|
|
390
|
-
}
|
|
391
360
|
/**
|
|
392
361
|
* Union type of all possible modal content types
|
|
393
362
|
*/
|
|
394
|
-
export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps |
|
|
363
|
+
export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | ProfileEditorModalProps;
|
|
395
364
|
/**
|
|
396
365
|
* State interface for the modal store
|
|
397
366
|
*/
|
|
@@ -13,8 +13,6 @@ export interface ExtendedProfileDetails {
|
|
|
13
13
|
name?: string;
|
|
14
14
|
username?: string;
|
|
15
15
|
profileImageUrl?: string;
|
|
16
|
-
picture?: string;
|
|
17
|
-
pfpUrl?: string;
|
|
18
16
|
}
|
|
19
17
|
export interface ExtendedProfile extends Omit<Profile, "details"> {
|
|
20
18
|
details: ExtendedProfileDetails;
|
|
@@ -82,7 +82,7 @@ function getProfileDisplayInfo(profile) {
|
|
|
82
82
|
displayInfo = {
|
|
83
83
|
title: details.name || details.username || "Unknown",
|
|
84
84
|
subtitle: details.username ? `@${details.username}` : "Farcaster Account",
|
|
85
|
-
imageUrl: validateImageUrl(details.
|
|
85
|
+
imageUrl: validateImageUrl(details.profileImageUrl),
|
|
86
86
|
initial: "F",
|
|
87
87
|
type,
|
|
88
88
|
};
|
|
@@ -91,7 +91,7 @@ function getProfileDisplayInfo(profile) {
|
|
|
91
91
|
displayInfo = {
|
|
92
92
|
title: details.name || details.email || "Unknown",
|
|
93
93
|
subtitle: details.email || "Google Account",
|
|
94
|
-
imageUrl: validateImageUrl(details.
|
|
94
|
+
imageUrl: validateImageUrl(details.profileImageUrl),
|
|
95
95
|
initial: "G",
|
|
96
96
|
type,
|
|
97
97
|
};
|
|
@@ -53,10 +53,10 @@ export declare function getCoingeckoChainInfo(chainId: number): {
|
|
|
53
53
|
name: string;
|
|
54
54
|
native_coin_id: string;
|
|
55
55
|
};
|
|
56
|
-
export declare const b3MainnetThirdWeb: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
56
|
+
export declare const b3MainnetThirdWeb: Readonly<import("thirdweb/dist/types/chains/types").ChainOptions & {
|
|
57
57
|
rpc: string;
|
|
58
58
|
}>;
|
|
59
|
-
export declare const b3TestnetThirdWeb: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
59
|
+
export declare const b3TestnetThirdWeb: Readonly<import("thirdweb/dist/types/chains/types").ChainOptions & {
|
|
60
60
|
rpc: string;
|
|
61
61
|
}>;
|
|
62
62
|
export declare const b3Mainnet: import("viem").Chain;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getIpfsUrl = getIpfsUrl;
|
|
4
4
|
const IPFS_GATEWAYS = [
|
|
5
|
-
"https://cloudflare-ipfs.com/ipfs",
|
|
6
5
|
"https://ipfs.io/ipfs",
|
|
6
|
+
"https://cloudflare-ipfs.com/ipfs",
|
|
7
7
|
// Can add more gateways as needed
|
|
8
8
|
];
|
|
9
9
|
/**
|