@b3dotfun/sdk 0.0.64 → 0.0.65-test.1
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 +73 -33
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +1 -5
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +1 -5
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +1 -5
- 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 +7 -3
- 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/anyspend/utils/index.d.ts +0 -1
- package/dist/cjs/anyspend/utils/index.js +0 -1
- package/dist/cjs/global-account/react/components/AccountAssets/AccountAssets.js +38 -2
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +139 -33
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +29 -13
- package/dist/cjs/global-account/react/components/Deposit/Deposit.d.ts +1 -0
- package/dist/cjs/global-account/react/components/Deposit/Deposit.js +65 -0
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.d.ts +6 -4
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +113 -279
- package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
- package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.js +331 -0
- package/dist/cjs/global-account/react/components/ManageAccount/AppsContent.d.ts +6 -0
- package/dist/cjs/global-account/react/components/ManageAccount/AppsContent.js +34 -0
- package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.js +2 -2
- package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.d.ts +2 -0
- package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.js +23 -0
- package/dist/cjs/global-account/react/components/ManageAccount/Header.d.ts +3 -0
- package/dist/cjs/global-account/react/components/ManageAccount/Header.js +120 -0
- package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.d.ts +5 -0
- package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.js +43 -0
- package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.d.ts +6 -0
- package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.js +16 -0
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +24 -193
- package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.d.ts +2 -0
- package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.js +15 -0
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.d.ts +2 -0
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +44 -0
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.d.ts +7 -0
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +50 -0
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +9 -0
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.js +8 -0
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +2 -0
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +38 -0
- package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
- package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.js +22 -0
- package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.d.ts +10 -0
- package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.js +12 -0
- package/dist/cjs/global-account/react/components/Send/Send.d.ts +5 -0
- package/dist/cjs/global-account/react/components/Send/Send.js +187 -0
- package/dist/cjs/global-account/react/components/icons/BellIcon.d.ts +3 -0
- package/dist/cjs/global-account/react/components/icons/BellIcon.js +5 -0
- package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.d.ts +2 -0
- package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.js +7 -0
- package/dist/cjs/global-account/react/components/icons/CopyIcon.d.ts +2 -0
- package/dist/cjs/global-account/react/components/icons/CopyIcon.js +7 -0
- package/dist/cjs/global-account/react/components/icons/LinkIcon.d.ts +3 -0
- package/dist/cjs/global-account/react/components/icons/LinkIcon.js +5 -0
- package/dist/cjs/global-account/react/components/icons/LockIcon.d.ts +3 -0
- package/dist/cjs/global-account/react/components/icons/LockIcon.js +5 -0
- package/dist/cjs/global-account/react/components/icons/WalletIcon.d.ts +2 -0
- package/dist/cjs/global-account/react/components/icons/WalletIcon.js +7 -0
- package/dist/cjs/global-account/react/components/index.d.ts +4 -2
- package/dist/cjs/global-account/react/components/index.js +11 -4
- 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 +3 -1
- package/dist/cjs/global-account/react/hooks/useAuthentication.js +0 -11
- package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.js +1 -0
- package/dist/cjs/global-account/react/hooks/useGlobalAccount.d.ts +1 -0
- package/dist/cjs/global-account/react/hooks/useGlobalAccount.js +3 -0
- package/dist/cjs/global-account/react/stores/index.d.ts +1 -0
- package/dist/cjs/global-account/react/stores/index.js +3 -1
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +34 -3
- package/dist/cjs/global-account/react/stores/useRecentAddressesStore.d.ts +25 -0
- package/dist/cjs/global-account/react/stores/useRecentAddressesStore.js +36 -0
- package/dist/cjs/global-account/react/utils/profileDisplay.d.ts +2 -0
- 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 +74 -34
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +1 -1
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +2 -6
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -6
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +2 -6
- 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 +6 -5
- 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/anyspend/utils/index.d.ts +0 -1
- package/dist/esm/anyspend/utils/index.js +0 -1
- package/dist/esm/global-account/react/components/AccountAssets/AccountAssets.js +38 -2
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +140 -34
- package/dist/esm/global-account/react/components/B3DynamicModal.js +30 -14
- package/dist/esm/global-account/react/components/Deposit/Deposit.d.ts +1 -0
- package/dist/esm/global-account/react/components/Deposit/Deposit.js +59 -0
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.d.ts +6 -4
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +113 -280
- package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
- package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.js +325 -0
- package/dist/esm/global-account/react/components/ManageAccount/AppsContent.d.ts +6 -0
- package/dist/esm/global-account/react/components/ManageAccount/AppsContent.js +32 -0
- package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.js +2 -2
- package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.d.ts +2 -0
- package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.js +21 -0
- package/dist/esm/global-account/react/components/ManageAccount/Header.d.ts +3 -0
- package/dist/esm/global-account/react/components/ManageAccount/Header.js +81 -0
- package/dist/esm/global-account/react/components/ManageAccount/HomeActions.d.ts +5 -0
- package/dist/esm/global-account/react/components/ManageAccount/HomeActions.js +41 -0
- package/dist/esm/global-account/react/components/ManageAccount/HomeContent.d.ts +6 -0
- package/dist/esm/global-account/react/components/ManageAccount/HomeContent.js +10 -0
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +26 -195
- package/dist/esm/global-account/react/components/ManageAccount/NFTContent.d.ts +2 -0
- package/dist/esm/global-account/react/components/ManageAccount/NFTContent.js +13 -0
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.d.ts +2 -0
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +42 -0
- package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.d.ts +7 -0
- package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +45 -0
- package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +9 -0
- package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.js +6 -0
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +2 -0
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +36 -0
- package/dist/esm/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
- package/dist/esm/global-account/react/components/ManageAccount/TokenContent.js +20 -0
- package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.d.ts +10 -0
- package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.js +10 -0
- package/dist/esm/global-account/react/components/Send/Send.d.ts +5 -0
- package/dist/esm/global-account/react/components/Send/Send.js +181 -0
- package/dist/esm/global-account/react/components/icons/BellIcon.d.ts +3 -0
- package/dist/esm/global-account/react/components/icons/BellIcon.js +3 -0
- package/dist/esm/global-account/react/components/icons/ChevronDownIcon.d.ts +2 -0
- package/dist/esm/global-account/react/components/icons/ChevronDownIcon.js +4 -0
- package/dist/esm/global-account/react/components/icons/CopyIcon.d.ts +2 -0
- package/dist/esm/global-account/react/components/icons/CopyIcon.js +4 -0
- package/dist/esm/global-account/react/components/icons/LinkIcon.d.ts +3 -0
- package/dist/esm/global-account/react/components/icons/LinkIcon.js +3 -0
- package/dist/esm/global-account/react/components/icons/LockIcon.d.ts +3 -0
- package/dist/esm/global-account/react/components/icons/LockIcon.js +3 -0
- package/dist/esm/global-account/react/components/icons/WalletIcon.d.ts +2 -0
- package/dist/esm/global-account/react/components/icons/WalletIcon.js +4 -0
- package/dist/esm/global-account/react/components/index.d.ts +4 -2
- package/dist/esm/global-account/react/components/index.js +7 -2
- 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/useAuthentication.js +0 -11
- package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +1 -0
- package/dist/esm/global-account/react/hooks/useGlobalAccount.d.ts +1 -0
- package/dist/esm/global-account/react/hooks/useGlobalAccount.js +3 -0
- package/dist/esm/global-account/react/stores/index.d.ts +1 -0
- package/dist/esm/global-account/react/stores/index.js +1 -0
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +34 -3
- package/dist/esm/global-account/react/stores/useRecentAddressesStore.d.ts +25 -0
- package/dist/esm/global-account/react/stores/useRecentAddressesStore.js +33 -0
- package/dist/esm/global-account/react/utils/profileDisplay.d.ts +2 -0
- 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/anyspend/utils/index.d.ts +0 -1
- package/dist/types/global-account/react/components/Deposit/Deposit.d.ts +1 -0
- package/dist/types/global-account/react/components/LinkAccount/LinkAccount.d.ts +6 -4
- package/dist/types/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
- package/dist/types/global-account/react/components/ManageAccount/AppsContent.d.ts +6 -0
- package/dist/types/global-account/react/components/ManageAccount/BottomNavigation.d.ts +2 -0
- package/dist/types/global-account/react/components/ManageAccount/Header.d.ts +3 -0
- package/dist/types/global-account/react/components/ManageAccount/HomeActions.d.ts +5 -0
- package/dist/types/global-account/react/components/ManageAccount/HomeContent.d.ts +6 -0
- package/dist/types/global-account/react/components/ManageAccount/NFTContent.d.ts +2 -0
- package/dist/types/global-account/react/components/ManageAccount/ProfileSection.d.ts +2 -0
- package/dist/types/global-account/react/components/ManageAccount/SettingsContent.d.ts +7 -0
- package/dist/types/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +9 -0
- package/dist/types/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +2 -0
- package/dist/types/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
- package/dist/types/global-account/react/components/ModalHeader/ModalHeader.d.ts +10 -0
- package/dist/types/global-account/react/components/Send/Send.d.ts +5 -0
- package/dist/types/global-account/react/components/icons/BellIcon.d.ts +3 -0
- package/dist/types/global-account/react/components/icons/ChevronDownIcon.d.ts +2 -0
- package/dist/types/global-account/react/components/icons/CopyIcon.d.ts +2 -0
- package/dist/types/global-account/react/components/icons/LinkIcon.d.ts +3 -0
- package/dist/types/global-account/react/components/icons/LockIcon.d.ts +3 -0
- package/dist/types/global-account/react/components/icons/WalletIcon.d.ts +2 -0
- package/dist/types/global-account/react/components/index.d.ts +4 -2
- package/dist/types/global-account/react/hooks/index.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useGlobalAccount.d.ts +1 -0
- package/dist/types/global-account/react/stores/index.d.ts +1 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +34 -3
- package/dist/types/global-account/react/stores/useRecentAddressesStore.d.ts +25 -0
- package/dist/types/global-account/react/utils/profileDisplay.d.ts +2 -0
- package/dist/types/shared/constants/chains/supported.d.ts +2 -2
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +225 -167
- package/src/anyspend/react/components/AnySpendCustom.tsx +1 -1
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +2 -6
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +2 -6
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +2 -7
- 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 +8 -13
- 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/anyspend/utils/index.ts +0 -1
- package/src/global-account/react/components/AccountAssets/AccountAssets.tsx +115 -25
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +303 -126
- package/src/global-account/react/components/B3DynamicModal.tsx +33 -15
- package/src/global-account/react/components/Deposit/Deposit.tsx +211 -0
- package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +332 -433
- package/src/global-account/react/components/LinkAccount/LinkNewAccount.tsx +490 -0
- package/src/global-account/react/components/ManageAccount/AppsContent.tsx +79 -0
- package/src/global-account/react/components/ManageAccount/BalanceContent.tsx +2 -3
- package/src/global-account/react/components/ManageAccount/BottomNavigation.tsx +83 -0
- package/src/global-account/react/components/ManageAccount/Header.tsx +230 -0
- package/src/global-account/react/components/ManageAccount/HomeActions.tsx +118 -0
- package/src/global-account/react/components/ManageAccount/HomeContent.tsx +42 -0
- package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +73 -589
- package/src/global-account/react/components/ManageAccount/NFTContent.tsx +24 -0
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +74 -0
- package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +87 -0
- package/src/global-account/react/components/ManageAccount/SettingsMenuItem.tsx +31 -0
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +74 -0
- package/src/global-account/react/components/ManageAccount/TokenContent.tsx +41 -0
- package/src/global-account/react/components/ModalHeader/ModalHeader.tsx +50 -0
- package/src/global-account/react/components/Send/Send.tsx +585 -0
- package/src/global-account/react/components/icons/BellIcon.tsx +15 -0
- package/src/global-account/react/components/icons/ChevronDownIcon.tsx +17 -0
- package/src/global-account/react/components/icons/CopyIcon.tsx +22 -0
- package/src/global-account/react/components/icons/LinkIcon.tsx +15 -0
- package/src/global-account/react/components/icons/LockIcon.tsx +15 -0
- package/src/global-account/react/components/icons/WalletIcon.tsx +21 -0
- package/src/global-account/react/components/index.ts +9 -2
- package/src/global-account/react/components/ui/Tabs.tsx +5 -13
- package/src/global-account/react/components/ui/dialog.tsx +32 -14
- package/src/global-account/react/hooks/index.ts +3 -0
- package/src/global-account/react/hooks/useAuthentication.ts +0 -12
- package/src/global-account/react/hooks/useB3BalanceFromAddresses.ts +1 -0
- package/src/global-account/react/hooks/useGlobalAccount.tsx +3 -1
- package/src/global-account/react/stores/index.ts +1 -0
- package/src/global-account/react/stores/useModalStore.ts +39 -2
- package/src/global-account/react/stores/useRecentAddressesStore.ts +55 -0
- package/src/global-account/react/utils/profileDisplay.ts +4 -2
- package/src/shared/utils/ipfs.ts +1 -1
- package/src/styles/index.css +6 -1
- package/dist/cjs/anyspend/utils/accountStore.d.ts +0 -7
- package/dist/cjs/anyspend/utils/accountStore.js +0 -8
- package/dist/esm/anyspend/utils/accountStore.d.ts +0 -7
- package/dist/esm/anyspend/utils/accountStore.js +0 -5
- package/dist/types/anyspend/utils/accountStore.d.ts +0 -7
- package/src/anyspend/utils/accountStore.ts +0 -12
|
@@ -13,6 +13,8 @@ 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";
|
|
16
18
|
export { AvatarEditor } from "./AvatarEditor/AvatarEditor";
|
|
17
19
|
export { ProfileEditor } from "./ProfileEditor/ProfileEditor";
|
|
18
20
|
export { RequestPermissions } from "./RequestPermissions/RequestPermissions";
|
|
@@ -40,8 +42,8 @@ export { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
|
|
|
40
42
|
export { ScrollArea, ScrollBar } from "./ui/scroll-area";
|
|
41
43
|
export { ShinyButton } from "./ui/ShinyButton";
|
|
42
44
|
export { Skeleton } from "./ui/skeleton";
|
|
43
|
-
export {
|
|
44
|
-
export {
|
|
45
|
+
export { TabsContent as TabsContentPrimitive, TabsList as TabsListPrimitive, Tabs as TabsPrimitive, TabTrigger as TabTriggerPrimitive, } from "./ui/Tabs";
|
|
46
|
+
export { Tabs, TabsContent, TabsList, TabsTransitionWrapper, TabTrigger } from "./ui/TabSystem";
|
|
45
47
|
export { TextLoop } from "./ui/text-loop";
|
|
46
48
|
export { TextShimmer } from "./ui/text-shimmer";
|
|
47
49
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./ui/tooltip";
|
|
@@ -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, type CombinedProfile, type PreferenceRequestBody, type Profile, } from "./useProfile";
|
|
26
|
+
export { useProfile, useProfilePreference, useProfileSettings, useDisplayName, type CombinedProfile, type PreferenceRequestBody, type Profile, type DisplayNameRequestBody, } from "./useProfile";
|
|
27
27
|
export { useQueryB3 } from "./useQueryB3";
|
|
28
28
|
export { useQueryBSMNT } from "./useQueryBSMNT";
|
|
29
29
|
export { useRemoveSessionKey } from "./useRemoveSessionKey";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { useAuthStore } from "./useAuthStore";
|
|
2
2
|
export { useModalStore } from "./useModalStore";
|
|
3
|
+
export { useRecentAddressesStore } from "./useRecentAddressesStore";
|
|
3
4
|
export type { AnySpendBuySpinProps, AnySpendFundTournamentProps, AnySpendJoinTournamentProps, AnySpendModalProps, AnySpendNftProps, AnySpendOrderHistoryProps, AnySpendStakeB3Props, AnyspendOrderDetailsProps, ManageAccountModalProps, ModalContentType, RequestPermissionsModalProps, SignInWithB3ModalProps, } from "./useModalStore";
|
|
@@ -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?: "home" | "tokens" | "nfts" | "apps" | "settings" | "swap";
|
|
81
81
|
/** Function to set the active tab */
|
|
82
|
-
setActiveTab?: (tab: "
|
|
82
|
+
setActiveTab?: (tab: "home" | "tokens" | "nfts" | "apps" | "settings" | "swap") => void;
|
|
83
83
|
/** Whether to show the referral information */
|
|
84
84
|
showReferralInfo?: boolean;
|
|
85
85
|
/** Whether to show the swap button */
|
|
@@ -325,6 +325,15 @@ 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
|
+
}
|
|
328
337
|
export interface AnySpendDepositHypeProps extends BaseModalProps {
|
|
329
338
|
/** Modal type identifier */
|
|
330
339
|
type: "anySpendDepositHype";
|
|
@@ -357,10 +366,32 @@ export interface ProfileEditorModalProps extends BaseModalProps {
|
|
|
357
366
|
/** Callback function called when profile is successfully updated */
|
|
358
367
|
onSuccess?: () => void;
|
|
359
368
|
}
|
|
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
|
+
}
|
|
360
391
|
/**
|
|
361
392
|
* Union type of all possible modal content types
|
|
362
393
|
*/
|
|
363
|
-
export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | ProfileEditorModalProps;
|
|
394
|
+
export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | ProfileEditorModalProps;
|
|
364
395
|
/**
|
|
365
396
|
* State interface for the modal store
|
|
366
397
|
*/
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface RecentAddress {
|
|
2
|
+
address: string;
|
|
3
|
+
timestamp: number;
|
|
4
|
+
}
|
|
5
|
+
interface RecentAddressesStore {
|
|
6
|
+
recentAddresses: RecentAddress[];
|
|
7
|
+
addRecentAddress: (address: string) => void;
|
|
8
|
+
clearRecentAddresses: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Store for managing recently used addresses in the Send flow
|
|
12
|
+
* Persists to localStorage and keeps the last 6 unique addresses
|
|
13
|
+
*/
|
|
14
|
+
export declare const useRecentAddressesStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<RecentAddressesStore>, "persist"> & {
|
|
15
|
+
persist: {
|
|
16
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<RecentAddressesStore, RecentAddressesStore>>) => void;
|
|
17
|
+
clearStorage: () => void;
|
|
18
|
+
rehydrate: () => Promise<void> | void;
|
|
19
|
+
hasHydrated: () => boolean;
|
|
20
|
+
onHydrate: (fn: (state: RecentAddressesStore) => void) => () => void;
|
|
21
|
+
onFinishHydration: (fn: (state: RecentAddressesStore) => void) => () => void;
|
|
22
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<RecentAddressesStore, RecentAddressesStore>>;
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
export {};
|
|
@@ -13,6 +13,8 @@ export interface ExtendedProfileDetails {
|
|
|
13
13
|
name?: string;
|
|
14
14
|
username?: string;
|
|
15
15
|
profileImageUrl?: string;
|
|
16
|
+
picture?: string;
|
|
17
|
+
pfpUrl?: string;
|
|
16
18
|
}
|
|
17
19
|
export interface ExtendedProfile extends Omit<Profile, "details"> {
|
|
18
20
|
details: ExtendedProfileDetails;
|
|
@@ -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/
|
|
56
|
+
export declare const b3MainnetThirdWeb: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
57
57
|
rpc: string;
|
|
58
58
|
}>;
|
|
59
|
-
export declare const b3TestnetThirdWeb: Readonly<import("thirdweb/
|
|
59
|
+
export declare const b3TestnetThirdWeb: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
60
60
|
rpc: string;
|
|
61
61
|
}>;
|
|
62
62
|
export declare const b3Mainnet: import("viem").Chain;
|
package/package.json
CHANGED
|
@@ -12,8 +12,11 @@ import {
|
|
|
12
12
|
Button,
|
|
13
13
|
ShinyButton,
|
|
14
14
|
StyleRoot,
|
|
15
|
+
TabsPrimitive,
|
|
15
16
|
TransitionPanel,
|
|
16
17
|
useAccountWallet,
|
|
18
|
+
useB3,
|
|
19
|
+
useModalStore,
|
|
17
20
|
useProfile,
|
|
18
21
|
useRouter,
|
|
19
22
|
useSearchParamsSSR,
|
|
@@ -21,6 +24,7 @@ import {
|
|
|
21
24
|
useTokenData,
|
|
22
25
|
useTokenFromUrl,
|
|
23
26
|
} from "@b3dotfun/sdk/global-account/react";
|
|
27
|
+
import BottomNavigation from "@b3dotfun/sdk/global-account/react/components/ManageAccount/BottomNavigation";
|
|
24
28
|
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
25
29
|
import { formatTokenAmount } from "@b3dotfun/sdk/shared/utils/number";
|
|
26
30
|
import invariant from "invariant";
|
|
@@ -28,6 +32,7 @@ import { ArrowDown, HistoryIcon, Loader2 } from "lucide-react";
|
|
|
28
32
|
import { motion } from "motion/react";
|
|
29
33
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
30
34
|
import { toast } from "sonner";
|
|
35
|
+
import { defineChain } from "thirdweb";
|
|
31
36
|
import { parseUnits } from "viem";
|
|
32
37
|
import { base, mainnet } from "viem/chains";
|
|
33
38
|
import { components } from "../../types/api";
|
|
@@ -120,6 +125,31 @@ function AnySpendInner({
|
|
|
120
125
|
const searchParams = useSearchParamsSSR();
|
|
121
126
|
const router = useRouter();
|
|
122
127
|
|
|
128
|
+
const { partnerId } = useB3();
|
|
129
|
+
const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
|
|
130
|
+
|
|
131
|
+
// Define base chain with RPC for modal props
|
|
132
|
+
const baseChain = useMemo(
|
|
133
|
+
() =>
|
|
134
|
+
defineChain({
|
|
135
|
+
id: 8453,
|
|
136
|
+
name: "Base",
|
|
137
|
+
nativeCurrency: {
|
|
138
|
+
name: "Ether",
|
|
139
|
+
symbol: "ETH",
|
|
140
|
+
decimals: 18,
|
|
141
|
+
},
|
|
142
|
+
rpc: "https://mainnet.base.org",
|
|
143
|
+
blockExplorers: [
|
|
144
|
+
{
|
|
145
|
+
name: "Basescan",
|
|
146
|
+
url: "https://basescan.org",
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
}),
|
|
150
|
+
[],
|
|
151
|
+
);
|
|
152
|
+
|
|
123
153
|
// Determine if we're in "buy mode" based on whether destination token props are provided
|
|
124
154
|
const isBuyMode = !!(destinationTokenAddress && destinationTokenChainId);
|
|
125
155
|
|
|
@@ -769,6 +799,10 @@ function AnySpendInner({
|
|
|
769
799
|
const onClickHistory = () => {
|
|
770
800
|
setOrderId(undefined);
|
|
771
801
|
navigateToPanel(PanelView.HISTORY, "forward");
|
|
802
|
+
setB3ModalContentType({
|
|
803
|
+
type: "anySpendOrderHistory",
|
|
804
|
+
showBackButton: false,
|
|
805
|
+
});
|
|
772
806
|
// Remove orderId and paymentMethod from URL when going back to history
|
|
773
807
|
const params = new URLSearchParams(searchParams.toString());
|
|
774
808
|
params.delete("orderId");
|
|
@@ -952,7 +986,7 @@ function AnySpendInner({
|
|
|
952
986
|
);
|
|
953
987
|
|
|
954
988
|
const orderDetailsView = (
|
|
955
|
-
<div className={"mx-auto w-[460px] max-w-full"}>
|
|
989
|
+
<div className={"mx-auto w-[460px] max-w-full px-5"}>
|
|
956
990
|
<div className="relative flex flex-col gap-4">
|
|
957
991
|
{oat && (
|
|
958
992
|
<OrderDetails
|
|
@@ -979,185 +1013,209 @@ function AnySpendInner({
|
|
|
979
1013
|
|
|
980
1014
|
const mainView = (
|
|
981
1015
|
<div className={"mx-auto flex w-[460px] max-w-full flex-col items-center gap-2"}>
|
|
982
|
-
{
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
<
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1016
|
+
<div className={"flex w-full max-w-full flex-col items-center gap-2 px-5"}>
|
|
1017
|
+
{/* Token Header - Show when in buy mode */}
|
|
1018
|
+
{isBuyMode && (
|
|
1019
|
+
<div className="mb-4 flex flex-col items-center gap-3 text-center">
|
|
1020
|
+
{selectedDstToken.metadata?.logoURI && (
|
|
1021
|
+
<div className="relative">
|
|
1022
|
+
<img
|
|
1023
|
+
src={selectedDstToken.metadata.logoURI}
|
|
1024
|
+
alt={selectedDstToken.symbol}
|
|
1025
|
+
className="border-as-stroke h-12 w-12 rounded-full border-2 shadow-md"
|
|
1026
|
+
/>
|
|
1027
|
+
</div>
|
|
1028
|
+
)}
|
|
1029
|
+
<div>
|
|
1030
|
+
<h1 className="text-as-primary text-xl font-bold">Buy {selectedDstToken.symbol}</h1>
|
|
992
1031
|
</div>
|
|
993
|
-
)}
|
|
994
|
-
<div>
|
|
995
|
-
<h1 className="text-as-primary text-xl font-bold">Buy {selectedDstToken.symbol}</h1>
|
|
996
1032
|
</div>
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1033
|
+
)}
|
|
1034
|
+
|
|
1035
|
+
{/* Tab section */}
|
|
1036
|
+
<TabSection
|
|
1037
|
+
activeTab={activeTab}
|
|
1038
|
+
setActiveTab={setActiveTab}
|
|
1039
|
+
setSelectedCryptoPaymentMethod={setSelectedCryptoPaymentMethod}
|
|
1040
|
+
setSelectedFiatPaymentMethod={setSelectedFiatPaymentMethod}
|
|
1041
|
+
/>
|
|
1042
|
+
|
|
1043
|
+
<div className="relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2">
|
|
1044
|
+
{/* Send section */}
|
|
1045
|
+
{activeTab === "crypto" ? (
|
|
1046
|
+
<CryptoPaySection
|
|
1047
|
+
selectedSrcChainId={selectedSrcChainId}
|
|
1048
|
+
setSelectedSrcChainId={setSelectedSrcChainId}
|
|
1049
|
+
selectedSrcToken={selectedSrcToken}
|
|
1050
|
+
setSelectedSrcToken={setSelectedSrcToken}
|
|
1051
|
+
srcAmount={srcAmount}
|
|
1052
|
+
setSrcAmount={setSrcAmount}
|
|
1053
|
+
isSrcInputDirty={isSrcInputDirty}
|
|
1054
|
+
setIsSrcInputDirty={setIsSrcInputDirty}
|
|
1055
|
+
selectedCryptoPaymentMethod={selectedCryptoPaymentMethod}
|
|
1056
|
+
onSelectCryptoPaymentMethod={() => navigateToPanel(PanelView.CRYPTO_PAYMENT_METHOD, "forward")}
|
|
1057
|
+
anyspendQuote={anyspendQuote}
|
|
1058
|
+
onTokenSelect={onTokenSelect}
|
|
1059
|
+
onShowFeeDetail={() => navigateToPanel(PanelView.FEE_DETAIL, "forward")}
|
|
1060
|
+
/>
|
|
1061
|
+
) : (
|
|
1062
|
+
<motion.div
|
|
1063
|
+
initial={{ opacity: 0, y: 20, filter: "blur(10px)" }}
|
|
1064
|
+
animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
|
|
1065
|
+
transition={{ duration: 0.3, delay: 0, ease: "easeInOut" }}
|
|
1066
|
+
>
|
|
1067
|
+
<PanelOnramp
|
|
1068
|
+
srcAmountOnRamp={srcAmountOnRamp}
|
|
1069
|
+
setSrcAmountOnRamp={setSrcAmountOnRamp}
|
|
1070
|
+
selectedPaymentMethod={selectedFiatPaymentMethod}
|
|
1071
|
+
setActivePanel={(panelIndex: number) => {
|
|
1072
|
+
// Map panel index to navigation with direction
|
|
1073
|
+
const panelsWithForwardNav = [PanelView.FIAT_PAYMENT_METHOD, PanelView.RECIPIENT_SELECTION];
|
|
1074
|
+
if (panelsWithForwardNav.includes(panelIndex)) {
|
|
1075
|
+
navigateToPanel(panelIndex, "forward");
|
|
1076
|
+
} else {
|
|
1077
|
+
setActivePanel(panelIndex);
|
|
1078
|
+
}
|
|
1079
|
+
}}
|
|
1080
|
+
_recipientAddress={recipientAddress}
|
|
1081
|
+
destinationToken={selectedDstToken}
|
|
1082
|
+
destinationChainId={selectedDstChainId}
|
|
1083
|
+
destinationAmount={dstAmount}
|
|
1084
|
+
onDestinationTokenChange={setSelectedDstToken}
|
|
1085
|
+
onDestinationChainChange={setSelectedDstChainId}
|
|
1086
|
+
fiatPaymentMethodIndex={PanelView.FIAT_PAYMENT_METHOD}
|
|
1087
|
+
recipientSelectionPanelIndex={PanelView.RECIPIENT_SELECTION}
|
|
1088
|
+
hideDstToken={isBuyMode}
|
|
1089
|
+
anyspendQuote={anyspendQuote}
|
|
1090
|
+
onShowPointsDetail={() => navigateToPanel(PanelView.POINTS_DETAIL, "forward")}
|
|
1091
|
+
onShowFeeDetail={() => navigateToPanel(PanelView.FEE_DETAIL, "forward")}
|
|
1092
|
+
customUsdInputValues={customUsdInputValues}
|
|
1093
|
+
/>
|
|
1094
|
+
</motion.div>
|
|
1095
|
+
)}
|
|
1096
|
+
|
|
1097
|
+
{/* Reverse swap direction section */}
|
|
1098
|
+
<Button
|
|
1099
|
+
variant="ghost"
|
|
1100
|
+
className={cn(
|
|
1101
|
+
"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",
|
|
1102
|
+
isBuyMode && "top-[calc(50%+56px)] cursor-default",
|
|
1103
|
+
activeTab === "fiat" && "hidden",
|
|
1104
|
+
)}
|
|
1105
|
+
onClick={() => {
|
|
1106
|
+
if (activeTab === "fiat" || isBuyMode) {
|
|
1107
|
+
return;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
// Swap chain selections
|
|
1111
|
+
const tempSrcChainId = selectedSrcChainId;
|
|
1112
|
+
const tempDstChainId = selectedDstChainId;
|
|
1113
|
+
setSelectedSrcChainId(tempDstChainId);
|
|
1114
|
+
setSelectedDstChainId(tempSrcChainId);
|
|
1115
|
+
|
|
1116
|
+
// Swap token selections
|
|
1117
|
+
const tempSrcToken = selectedSrcToken;
|
|
1118
|
+
const tempDstToken = selectedDstToken;
|
|
1119
|
+
setSelectedSrcToken(tempDstToken);
|
|
1120
|
+
setSelectedDstToken(tempSrcToken);
|
|
1121
|
+
|
|
1122
|
+
// Swap amounts
|
|
1123
|
+
const tempSrcAmount = srcAmount;
|
|
1124
|
+
const tempDstAmount = dstAmount;
|
|
1125
|
+
setSrcAmount(tempDstAmount);
|
|
1126
|
+
setDstAmount(tempSrcAmount);
|
|
1127
|
+
}}
|
|
1031
1128
|
>
|
|
1032
|
-
<
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1129
|
+
<div className="relative flex items-center justify-center transition-opacity">
|
|
1130
|
+
<ArrowDown className="text-as-primary/50 h-5 w-5" />
|
|
1131
|
+
</div>
|
|
1132
|
+
</Button>
|
|
1133
|
+
|
|
1134
|
+
{/* Receive section - Hidden when fiat tab is active */}
|
|
1135
|
+
{activeTab === "crypto" && (
|
|
1136
|
+
<CryptoReceiveSection
|
|
1137
|
+
isDepositMode={false}
|
|
1138
|
+
isBuyMode={isBuyMode}
|
|
1139
|
+
selectedRecipientAddress={recipientAddress}
|
|
1140
|
+
recipientName={recipientName || undefined}
|
|
1141
|
+
onSelectRecipient={() => navigateToPanel(PanelView.RECIPIENT_SELECTION, "forward")}
|
|
1142
|
+
setRecipientAddress={setRecipientAddress}
|
|
1143
|
+
recipientAddressFromProps={recipientAddressFromProps}
|
|
1144
|
+
globalAddress={globalAddress}
|
|
1145
|
+
dstAmount={dstAmount}
|
|
1146
|
+
dstToken={selectedDstToken}
|
|
1147
|
+
selectedDstChainId={selectedDstChainId}
|
|
1148
|
+
setSelectedDstChainId={setSelectedDstChainId}
|
|
1149
|
+
setSelectedDstToken={setSelectedDstToken}
|
|
1150
|
+
isSrcInputDirty={isSrcInputDirty}
|
|
1151
|
+
onChangeDstAmount={value => {
|
|
1152
|
+
setIsSrcInputDirty(false);
|
|
1153
|
+
setDstAmount(value);
|
|
1044
1154
|
}}
|
|
1045
|
-
_recipientAddress={recipientAddress}
|
|
1046
|
-
destinationToken={selectedDstToken}
|
|
1047
|
-
destinationChainId={selectedDstChainId}
|
|
1048
|
-
destinationAmount={dstAmount}
|
|
1049
|
-
onDestinationTokenChange={setSelectedDstToken}
|
|
1050
|
-
onDestinationChainChange={setSelectedDstChainId}
|
|
1051
|
-
fiatPaymentMethodIndex={PanelView.FIAT_PAYMENT_METHOD}
|
|
1052
|
-
recipientSelectionPanelIndex={PanelView.RECIPIENT_SELECTION}
|
|
1053
|
-
hideDstToken={isBuyMode}
|
|
1054
1155
|
anyspendQuote={anyspendQuote}
|
|
1055
1156
|
onShowPointsDetail={() => navigateToPanel(PanelView.POINTS_DETAIL, "forward")}
|
|
1056
1157
|
onShowFeeDetail={() => navigateToPanel(PanelView.FEE_DETAIL, "forward")}
|
|
1057
|
-
|
|
1158
|
+
selectedCryptoPaymentMethod={selectedCryptoPaymentMethod}
|
|
1058
1159
|
/>
|
|
1059
|
-
</motion.div>
|
|
1060
|
-
)}
|
|
1061
|
-
|
|
1062
|
-
{/* Reverse swap direction section */}
|
|
1063
|
-
<Button
|
|
1064
|
-
variant="ghost"
|
|
1065
|
-
className={cn(
|
|
1066
|
-
"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",
|
|
1067
|
-
isBuyMode && "top-[calc(50%+56px)] cursor-default",
|
|
1068
|
-
activeTab === "fiat" && "hidden",
|
|
1069
1160
|
)}
|
|
1070
|
-
|
|
1071
|
-
if (activeTab === "fiat" || isBuyMode) {
|
|
1072
|
-
return;
|
|
1073
|
-
}
|
|
1161
|
+
</div>
|
|
1074
1162
|
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
// Swap token selections
|
|
1082
|
-
const tempSrcToken = selectedSrcToken;
|
|
1083
|
-
const tempDstToken = selectedDstToken;
|
|
1084
|
-
setSelectedSrcToken(tempDstToken);
|
|
1085
|
-
setSelectedDstToken(tempSrcToken);
|
|
1086
|
-
|
|
1087
|
-
// Swap amounts
|
|
1088
|
-
const tempSrcAmount = srcAmount;
|
|
1089
|
-
const tempDstAmount = dstAmount;
|
|
1090
|
-
setSrcAmount(tempDstAmount);
|
|
1091
|
-
setDstAmount(tempSrcAmount);
|
|
1092
|
-
}}
|
|
1163
|
+
{/* Main button section */}
|
|
1164
|
+
<motion.div
|
|
1165
|
+
initial={{ opacity: 0, y: 20, filter: "blur(10px)" }}
|
|
1166
|
+
animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
|
|
1167
|
+
transition={{ duration: 0.3, delay: 0.2, ease: "easeInOut" }}
|
|
1168
|
+
className={cn("mt-4 flex w-full max-w-[460px] flex-col gap-2")}
|
|
1093
1169
|
>
|
|
1094
|
-
<
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
anyspendQuote={anyspendQuote}
|
|
1121
|
-
onShowPointsDetail={() => navigateToPanel(PanelView.POINTS_DETAIL, "forward")}
|
|
1122
|
-
onShowFeeDetail={() => navigateToPanel(PanelView.FEE_DETAIL, "forward")}
|
|
1123
|
-
selectedCryptoPaymentMethod={selectedCryptoPaymentMethod}
|
|
1124
|
-
/>
|
|
1125
|
-
)}
|
|
1170
|
+
<ShinyButton
|
|
1171
|
+
accentColor={"hsl(var(--as-brand))"}
|
|
1172
|
+
disabled={btnInfo.disable}
|
|
1173
|
+
onClick={onMainButtonClick}
|
|
1174
|
+
className={cn(
|
|
1175
|
+
"as-main-button relative w-full",
|
|
1176
|
+
btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand",
|
|
1177
|
+
)}
|
|
1178
|
+
textClassName={cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white")}
|
|
1179
|
+
>
|
|
1180
|
+
<div className="flex items-center justify-center gap-2">
|
|
1181
|
+
{btnInfo.loading && <Loader2 className="h-4 w-4 animate-spin" />}
|
|
1182
|
+
{btnInfo.text}
|
|
1183
|
+
</div>
|
|
1184
|
+
</ShinyButton>
|
|
1185
|
+
|
|
1186
|
+
{!hideTransactionHistoryButton && (globalAddress || recipientAddress) ? (
|
|
1187
|
+
<Button
|
|
1188
|
+
variant="link"
|
|
1189
|
+
onClick={onClickHistory}
|
|
1190
|
+
className="text-as-primary/50 hover:text-as-primary flex items-center gap-1 transition-colors"
|
|
1191
|
+
>
|
|
1192
|
+
<HistoryIcon className="h-4 w-4" /> <span className="pr-4">Transaction History</span>
|
|
1193
|
+
</Button>
|
|
1194
|
+
) : null}
|
|
1195
|
+
</motion.div>
|
|
1126
1196
|
</div>
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1197
|
+
<div className="w-full">
|
|
1198
|
+
<TabsPrimitive
|
|
1199
|
+
defaultValue="swap"
|
|
1200
|
+
onValueChange={value => {
|
|
1201
|
+
if (value === "settings" || value === "home") {
|
|
1202
|
+
setB3ModalContentType({
|
|
1203
|
+
type: "manageAccount",
|
|
1204
|
+
activeTab: value,
|
|
1205
|
+
setActiveTab: () => {},
|
|
1206
|
+
chain: baseChain,
|
|
1207
|
+
partnerId,
|
|
1208
|
+
});
|
|
1209
|
+
} else if (value === "swap") {
|
|
1210
|
+
setB3ModalContentType({
|
|
1211
|
+
type: "anySpend",
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
}}
|
|
1144
1215
|
>
|
|
1145
|
-
<
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
</div>
|
|
1149
|
-
</ShinyButton>
|
|
1150
|
-
|
|
1151
|
-
{!hideTransactionHistoryButton && (globalAddress || recipientAddress) ? (
|
|
1152
|
-
<Button
|
|
1153
|
-
variant="link"
|
|
1154
|
-
onClick={onClickHistory}
|
|
1155
|
-
className="text-as-primary/50 hover:text-as-primary flex items-center gap-1 transition-colors"
|
|
1156
|
-
>
|
|
1157
|
-
<HistoryIcon className="h-4 w-4" /> <span className="pr-4">Transaction History</span>
|
|
1158
|
-
</Button>
|
|
1159
|
-
) : null}
|
|
1160
|
-
</motion.div>
|
|
1216
|
+
<BottomNavigation />
|
|
1217
|
+
</TabsPrimitive>
|
|
1218
|
+
</div>
|
|
1161
1219
|
</div>
|
|
1162
1220
|
);
|
|
1163
1221
|
|
|
@@ -664,7 +664,7 @@ function AnySpendCustomInner({
|
|
|
664
664
|
const historyView = (
|
|
665
665
|
<div
|
|
666
666
|
className={cn(
|
|
667
|
-
"mx-auto flex w-full max-w-2xl flex-col items-center
|
|
667
|
+
"mx-auto flex w-full max-w-2xl flex-col items-center",
|
|
668
668
|
mode === "modal" && "bg-b3-react-background",
|
|
669
669
|
)}
|
|
670
670
|
>
|