@b3dotfun/sdk 0.0.65-alpha.0 → 0.0.65-test.3
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 +77 -35
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +1 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +1 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +0 -6
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +5 -3
- 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/react/hooks/useSigMint.d.ts +1 -1
- package/dist/cjs/global-account/react/components/AccountAssets/AccountAssets.js +38 -2
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +184 -35
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +23 -12
- 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/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +39 -0
- package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +37 -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 +6 -5
- 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 +47 -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 +106 -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/SignInWithB3/SignIn.js +3 -1
- 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 +5 -4
- package/dist/cjs/global-account/react/components/index.js +14 -9
- 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/useAccountWallet.d.ts +1 -0
- package/dist/cjs/global-account/react/hooks/useAccountWallet.js +18 -0
- package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +2 -2
- package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.js +1 -0
- package/dist/cjs/global-account/react/hooks/useUserQuery.d.ts +2 -2
- 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 +31 -6
- 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 +3 -3
- package/dist/cjs/shared/utils/ipfs.js +10 -3
- package/dist/esm/anyspend/react/components/AnySpend.js +78 -36
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +1 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +1 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +0 -6
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +5 -3
- 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/react/hooks/useSigMint.d.ts +1 -1
- package/dist/esm/global-account/react/components/AccountAssets/AccountAssets.js +38 -2
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +186 -37
- package/dist/esm/global-account/react/components/B3DynamicModal.js +23 -12
- 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/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +39 -0
- package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +34 -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 +6 -5
- 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 +45 -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 +101 -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/SignInWithB3/SignIn.js +4 -2
- 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 +5 -4
- package/dist/esm/global-account/react/components/index.js +9 -5
- 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/useAccountWallet.d.ts +1 -0
- package/dist/esm/global-account/react/hooks/useAccountWallet.js +17 -0
- package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +2 -2
- package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +1 -0
- package/dist/esm/global-account/react/hooks/useUserQuery.d.ts +2 -2
- 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 +31 -6
- 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 +3 -3
- package/dist/esm/shared/utils/ipfs.js +10 -3
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/common/CryptoPaymentMethod.d.ts +0 -6
- package/dist/types/anyspend/react/components/common/OrderHistory.d.ts +1 -1
- package/dist/types/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/types/global-account/react/components/Deposit/Deposit.d.ts +1 -0
- package/dist/types/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +39 -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 +5 -4
- package/dist/types/global-account/react/hooks/index.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useAccountWallet.d.ts +1 -0
- package/dist/types/global-account/react/hooks/useAuthentication.d.ts +2 -2
- package/dist/types/global-account/react/hooks/useUserQuery.d.ts +2 -2
- package/dist/types/global-account/react/stores/index.d.ts +1 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +31 -6
- 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 +3 -3
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +229 -170
- package/src/anyspend/react/components/AnySpendCustom.tsx +1 -3
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +0 -2
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +0 -2
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +7 -14
- 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/global-account/react/components/AccountAssets/AccountAssets.tsx +115 -25
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +360 -128
- package/src/global-account/react/components/B3DynamicModal.tsx +28 -14
- package/src/global-account/react/components/Deposit/Deposit.tsx +211 -0
- package/src/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.tsx +84 -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 +6 -10
- 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 +72 -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 +180 -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/SignInWithB3/SignIn.tsx +11 -7
- 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 +11 -5
- 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/useAccountWallet.tsx +26 -0
- package/src/global-account/react/hooks/useB3BalanceFromAddresses.ts +1 -0
- package/src/global-account/react/stores/index.ts +1 -0
- package/src/global-account/react/stores/useModalStore.ts +35 -6
- 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 +10 -3
- package/src/styles/index.css +6 -1
- package/dist/cjs/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +0 -6
- package/dist/cjs/global-account/react/components/ProfileEditor/ProfileEditor.js +0 -141
- package/dist/esm/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +0 -6
- package/dist/esm/global-account/react/components/ProfileEditor/ProfileEditor.js +0 -135
- package/dist/types/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +0 -6
- package/src/global-account/react/components/ProfileEditor/ProfileEditor.tsx +0 -265
|
@@ -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,8 @@ 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";
|
|
28
|
+
import { useAccountWalletImage } from "@b3dotfun/sdk/global-account/react/hooks/useAccountWallet";
|
|
24
29
|
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
25
30
|
import { formatTokenAmount } from "@b3dotfun/sdk/shared/utils/number";
|
|
26
31
|
import invariant from "invariant";
|
|
@@ -28,6 +33,7 @@ import { ArrowDown, HistoryIcon, Loader2 } from "lucide-react";
|
|
|
28
33
|
import { motion } from "motion/react";
|
|
29
34
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
30
35
|
import { toast } from "sonner";
|
|
36
|
+
import { defineChain } from "thirdweb";
|
|
31
37
|
import { parseUnits } from "viem";
|
|
32
38
|
import { base, mainnet } from "viem/chains";
|
|
33
39
|
import { components } from "../../types/api";
|
|
@@ -120,6 +126,31 @@ function AnySpendInner({
|
|
|
120
126
|
const searchParams = useSearchParamsSSR();
|
|
121
127
|
const router = useRouter();
|
|
122
128
|
|
|
129
|
+
const { partnerId } = useB3();
|
|
130
|
+
const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
|
|
131
|
+
|
|
132
|
+
// Define base chain with RPC for modal props
|
|
133
|
+
const baseChain = useMemo(
|
|
134
|
+
() =>
|
|
135
|
+
defineChain({
|
|
136
|
+
id: 8453,
|
|
137
|
+
name: "Base",
|
|
138
|
+
nativeCurrency: {
|
|
139
|
+
name: "Ether",
|
|
140
|
+
symbol: "ETH",
|
|
141
|
+
decimals: 18,
|
|
142
|
+
},
|
|
143
|
+
rpc: "https://mainnet.base.org",
|
|
144
|
+
blockExplorers: [
|
|
145
|
+
{
|
|
146
|
+
name: "Basescan",
|
|
147
|
+
url: "https://basescan.org",
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
}),
|
|
151
|
+
[],
|
|
152
|
+
);
|
|
153
|
+
|
|
123
154
|
// Determine if we're in "buy mode" based on whether destination token props are provided
|
|
124
155
|
const isBuyMode = !!(destinationTokenAddress && destinationTokenChainId);
|
|
125
156
|
|
|
@@ -444,6 +475,8 @@ function AnySpendInner({
|
|
|
444
475
|
const recipientProfile = useProfile({ address: recipientAddress, fresh: true });
|
|
445
476
|
const recipientName = recipientProfile.data?.name;
|
|
446
477
|
|
|
478
|
+
const globalWalletImage = useAccountWalletImage();
|
|
479
|
+
|
|
447
480
|
// Auto-set active wallet from wagmi
|
|
448
481
|
useAutoSetActiveWalletFromWagmi();
|
|
449
482
|
|
|
@@ -769,6 +802,10 @@ function AnySpendInner({
|
|
|
769
802
|
const onClickHistory = () => {
|
|
770
803
|
setOrderId(undefined);
|
|
771
804
|
navigateToPanel(PanelView.HISTORY, "forward");
|
|
805
|
+
setB3ModalContentType({
|
|
806
|
+
type: "anySpendOrderHistory",
|
|
807
|
+
showBackButton: false,
|
|
808
|
+
});
|
|
772
809
|
// Remove orderId and paymentMethod from URL when going back to history
|
|
773
810
|
const params = new URLSearchParams(searchParams.toString());
|
|
774
811
|
params.delete("orderId");
|
|
@@ -952,7 +989,7 @@ function AnySpendInner({
|
|
|
952
989
|
);
|
|
953
990
|
|
|
954
991
|
const orderDetailsView = (
|
|
955
|
-
<div className={"mx-auto w-[460px] max-w-full"}>
|
|
992
|
+
<div className={"mx-auto w-[460px] max-w-full px-5"}>
|
|
956
993
|
<div className="relative flex flex-col gap-4">
|
|
957
994
|
{oat && (
|
|
958
995
|
<OrderDetails
|
|
@@ -979,185 +1016,209 @@ function AnySpendInner({
|
|
|
979
1016
|
|
|
980
1017
|
const mainView = (
|
|
981
1018
|
<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
|
-
|
|
1019
|
+
<div className={"flex w-full max-w-full flex-col items-center gap-2 px-5"}>
|
|
1020
|
+
{/* Token Header - Show when in buy mode */}
|
|
1021
|
+
{isBuyMode && (
|
|
1022
|
+
<div className="mb-4 flex flex-col items-center gap-3 text-center">
|
|
1023
|
+
{selectedDstToken.metadata?.logoURI && (
|
|
1024
|
+
<div className="relative">
|
|
1025
|
+
<img
|
|
1026
|
+
src={selectedDstToken.metadata.logoURI}
|
|
1027
|
+
alt={selectedDstToken.symbol}
|
|
1028
|
+
className="border-as-stroke h-12 w-12 rounded-full border-2 shadow-md"
|
|
1029
|
+
/>
|
|
1030
|
+
</div>
|
|
1031
|
+
)}
|
|
1032
|
+
<div>
|
|
1033
|
+
<h1 className="text-as-primary text-xl font-bold">Buy {selectedDstToken.symbol}</h1>
|
|
992
1034
|
</div>
|
|
993
|
-
)}
|
|
994
|
-
<div>
|
|
995
|
-
<h1 className="text-as-primary text-xl font-bold">Buy {selectedDstToken.symbol}</h1>
|
|
996
1035
|
</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
|
-
|
|
1036
|
+
)}
|
|
1037
|
+
|
|
1038
|
+
{/* Tab section */}
|
|
1039
|
+
<TabSection
|
|
1040
|
+
activeTab={activeTab}
|
|
1041
|
+
setActiveTab={setActiveTab}
|
|
1042
|
+
setSelectedCryptoPaymentMethod={setSelectedCryptoPaymentMethod}
|
|
1043
|
+
setSelectedFiatPaymentMethod={setSelectedFiatPaymentMethod}
|
|
1044
|
+
/>
|
|
1045
|
+
|
|
1046
|
+
<div className="relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2">
|
|
1047
|
+
{/* Send section */}
|
|
1048
|
+
{activeTab === "crypto" ? (
|
|
1049
|
+
<CryptoPaySection
|
|
1050
|
+
selectedSrcChainId={selectedSrcChainId}
|
|
1051
|
+
setSelectedSrcChainId={setSelectedSrcChainId}
|
|
1052
|
+
selectedSrcToken={selectedSrcToken}
|
|
1053
|
+
setSelectedSrcToken={setSelectedSrcToken}
|
|
1054
|
+
srcAmount={srcAmount}
|
|
1055
|
+
setSrcAmount={setSrcAmount}
|
|
1056
|
+
isSrcInputDirty={isSrcInputDirty}
|
|
1057
|
+
setIsSrcInputDirty={setIsSrcInputDirty}
|
|
1058
|
+
selectedCryptoPaymentMethod={selectedCryptoPaymentMethod}
|
|
1059
|
+
onSelectCryptoPaymentMethod={() => navigateToPanel(PanelView.CRYPTO_PAYMENT_METHOD, "forward")}
|
|
1060
|
+
anyspendQuote={anyspendQuote}
|
|
1061
|
+
onTokenSelect={onTokenSelect}
|
|
1062
|
+
onShowFeeDetail={() => navigateToPanel(PanelView.FEE_DETAIL, "forward")}
|
|
1063
|
+
/>
|
|
1064
|
+
) : (
|
|
1065
|
+
<motion.div
|
|
1066
|
+
initial={{ opacity: 0, y: 20, filter: "blur(10px)" }}
|
|
1067
|
+
animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
|
|
1068
|
+
transition={{ duration: 0.3, delay: 0, ease: "easeInOut" }}
|
|
1069
|
+
>
|
|
1070
|
+
<PanelOnramp
|
|
1071
|
+
srcAmountOnRamp={srcAmountOnRamp}
|
|
1072
|
+
setSrcAmountOnRamp={setSrcAmountOnRamp}
|
|
1073
|
+
selectedPaymentMethod={selectedFiatPaymentMethod}
|
|
1074
|
+
setActivePanel={(panelIndex: number) => {
|
|
1075
|
+
// Map panel index to navigation with direction
|
|
1076
|
+
const panelsWithForwardNav = [PanelView.FIAT_PAYMENT_METHOD, PanelView.RECIPIENT_SELECTION];
|
|
1077
|
+
if (panelsWithForwardNav.includes(panelIndex)) {
|
|
1078
|
+
navigateToPanel(panelIndex, "forward");
|
|
1079
|
+
} else {
|
|
1080
|
+
setActivePanel(panelIndex);
|
|
1081
|
+
}
|
|
1082
|
+
}}
|
|
1083
|
+
_recipientAddress={recipientAddress}
|
|
1084
|
+
destinationToken={selectedDstToken}
|
|
1085
|
+
destinationChainId={selectedDstChainId}
|
|
1086
|
+
destinationAmount={dstAmount}
|
|
1087
|
+
onDestinationTokenChange={setSelectedDstToken}
|
|
1088
|
+
onDestinationChainChange={setSelectedDstChainId}
|
|
1089
|
+
fiatPaymentMethodIndex={PanelView.FIAT_PAYMENT_METHOD}
|
|
1090
|
+
recipientSelectionPanelIndex={PanelView.RECIPIENT_SELECTION}
|
|
1091
|
+
hideDstToken={isBuyMode}
|
|
1092
|
+
anyspendQuote={anyspendQuote}
|
|
1093
|
+
onShowPointsDetail={() => navigateToPanel(PanelView.POINTS_DETAIL, "forward")}
|
|
1094
|
+
onShowFeeDetail={() => navigateToPanel(PanelView.FEE_DETAIL, "forward")}
|
|
1095
|
+
customUsdInputValues={customUsdInputValues}
|
|
1096
|
+
/>
|
|
1097
|
+
</motion.div>
|
|
1098
|
+
)}
|
|
1099
|
+
|
|
1100
|
+
{/* Reverse swap direction section */}
|
|
1101
|
+
<Button
|
|
1102
|
+
variant="ghost"
|
|
1103
|
+
className={cn(
|
|
1104
|
+
"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",
|
|
1105
|
+
isBuyMode && "top-[calc(50%+56px)] cursor-default",
|
|
1106
|
+
activeTab === "fiat" && "hidden",
|
|
1107
|
+
)}
|
|
1108
|
+
onClick={() => {
|
|
1109
|
+
if (activeTab === "fiat" || isBuyMode) {
|
|
1110
|
+
return;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
// Swap chain selections
|
|
1114
|
+
const tempSrcChainId = selectedSrcChainId;
|
|
1115
|
+
const tempDstChainId = selectedDstChainId;
|
|
1116
|
+
setSelectedSrcChainId(tempDstChainId);
|
|
1117
|
+
setSelectedDstChainId(tempSrcChainId);
|
|
1118
|
+
|
|
1119
|
+
// Swap token selections
|
|
1120
|
+
const tempSrcToken = selectedSrcToken;
|
|
1121
|
+
const tempDstToken = selectedDstToken;
|
|
1122
|
+
setSelectedSrcToken(tempDstToken);
|
|
1123
|
+
setSelectedDstToken(tempSrcToken);
|
|
1124
|
+
|
|
1125
|
+
// Swap amounts
|
|
1126
|
+
const tempSrcAmount = srcAmount;
|
|
1127
|
+
const tempDstAmount = dstAmount;
|
|
1128
|
+
setSrcAmount(tempDstAmount);
|
|
1129
|
+
setDstAmount(tempSrcAmount);
|
|
1130
|
+
}}
|
|
1031
1131
|
>
|
|
1032
|
-
<
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1132
|
+
<div className="relative flex items-center justify-center transition-opacity">
|
|
1133
|
+
<ArrowDown className="text-as-primary/50 h-5 w-5" />
|
|
1134
|
+
</div>
|
|
1135
|
+
</Button>
|
|
1136
|
+
|
|
1137
|
+
{/* Receive section - Hidden when fiat tab is active */}
|
|
1138
|
+
{activeTab === "crypto" && (
|
|
1139
|
+
<CryptoReceiveSection
|
|
1140
|
+
isDepositMode={false}
|
|
1141
|
+
isBuyMode={isBuyMode}
|
|
1142
|
+
selectedRecipientAddress={recipientAddress}
|
|
1143
|
+
recipientName={recipientName || undefined}
|
|
1144
|
+
onSelectRecipient={() => navigateToPanel(PanelView.RECIPIENT_SELECTION, "forward")}
|
|
1145
|
+
setRecipientAddress={setRecipientAddress}
|
|
1146
|
+
recipientAddressFromProps={recipientAddressFromProps}
|
|
1147
|
+
globalAddress={globalAddress}
|
|
1148
|
+
dstAmount={dstAmount}
|
|
1149
|
+
dstToken={selectedDstToken}
|
|
1150
|
+
selectedDstChainId={selectedDstChainId}
|
|
1151
|
+
setSelectedDstChainId={setSelectedDstChainId}
|
|
1152
|
+
setSelectedDstToken={setSelectedDstToken}
|
|
1153
|
+
isSrcInputDirty={isSrcInputDirty}
|
|
1154
|
+
onChangeDstAmount={value => {
|
|
1155
|
+
setIsSrcInputDirty(false);
|
|
1156
|
+
setDstAmount(value);
|
|
1044
1157
|
}}
|
|
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
1158
|
anyspendQuote={anyspendQuote}
|
|
1055
1159
|
onShowPointsDetail={() => navigateToPanel(PanelView.POINTS_DETAIL, "forward")}
|
|
1056
1160
|
onShowFeeDetail={() => navigateToPanel(PanelView.FEE_DETAIL, "forward")}
|
|
1057
|
-
|
|
1161
|
+
selectedCryptoPaymentMethod={selectedCryptoPaymentMethod}
|
|
1058
1162
|
/>
|
|
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
1163
|
)}
|
|
1070
|
-
|
|
1071
|
-
if (activeTab === "fiat" || isBuyMode) {
|
|
1072
|
-
return;
|
|
1073
|
-
}
|
|
1164
|
+
</div>
|
|
1074
1165
|
|
|
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
|
-
}}
|
|
1166
|
+
{/* Main button section */}
|
|
1167
|
+
<motion.div
|
|
1168
|
+
initial={{ opacity: 0, y: 20, filter: "blur(10px)" }}
|
|
1169
|
+
animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
|
|
1170
|
+
transition={{ duration: 0.3, delay: 0.2, ease: "easeInOut" }}
|
|
1171
|
+
className={cn("mt-4 flex w-full max-w-[460px] flex-col gap-2")}
|
|
1093
1172
|
>
|
|
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
|
-
)}
|
|
1173
|
+
<ShinyButton
|
|
1174
|
+
accentColor={"hsl(var(--as-brand))"}
|
|
1175
|
+
disabled={btnInfo.disable}
|
|
1176
|
+
onClick={onMainButtonClick}
|
|
1177
|
+
className={cn(
|
|
1178
|
+
"as-main-button relative w-full",
|
|
1179
|
+
btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand",
|
|
1180
|
+
)}
|
|
1181
|
+
textClassName={cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white")}
|
|
1182
|
+
>
|
|
1183
|
+
<div className="flex items-center justify-center gap-2">
|
|
1184
|
+
{btnInfo.loading && <Loader2 className="h-4 w-4 animate-spin" />}
|
|
1185
|
+
{btnInfo.text}
|
|
1186
|
+
</div>
|
|
1187
|
+
</ShinyButton>
|
|
1188
|
+
|
|
1189
|
+
{!hideTransactionHistoryButton && (globalAddress || recipientAddress) ? (
|
|
1190
|
+
<Button
|
|
1191
|
+
variant="link"
|
|
1192
|
+
onClick={onClickHistory}
|
|
1193
|
+
className="text-as-primary/50 hover:text-as-primary flex items-center gap-1 transition-colors"
|
|
1194
|
+
>
|
|
1195
|
+
<HistoryIcon className="h-4 w-4" /> <span className="pr-4">Transaction History</span>
|
|
1196
|
+
</Button>
|
|
1197
|
+
) : null}
|
|
1198
|
+
</motion.div>
|
|
1126
1199
|
</div>
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1200
|
+
<div className="w-full">
|
|
1201
|
+
<TabsPrimitive
|
|
1202
|
+
defaultValue="swap"
|
|
1203
|
+
onValueChange={value => {
|
|
1204
|
+
if (value === "settings" || value === "home") {
|
|
1205
|
+
setB3ModalContentType({
|
|
1206
|
+
type: "manageAccount",
|
|
1207
|
+
activeTab: value,
|
|
1208
|
+
setActiveTab: () => {},
|
|
1209
|
+
chain: baseChain,
|
|
1210
|
+
partnerId,
|
|
1211
|
+
});
|
|
1212
|
+
} else if (value === "swap") {
|
|
1213
|
+
setB3ModalContentType({
|
|
1214
|
+
type: "anySpend",
|
|
1215
|
+
});
|
|
1216
|
+
}
|
|
1217
|
+
}}
|
|
1144
1218
|
>
|
|
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>
|
|
1219
|
+
<BottomNavigation />
|
|
1220
|
+
</TabsPrimitive>
|
|
1221
|
+
</div>
|
|
1161
1222
|
</div>
|
|
1162
1223
|
);
|
|
1163
1224
|
|
|
@@ -1190,7 +1251,7 @@ function AnySpendInner({
|
|
|
1190
1251
|
}}
|
|
1191
1252
|
onBack={navigateBack}
|
|
1192
1253
|
recipientEnsName={globalWallet?.ensName}
|
|
1193
|
-
recipientImageUrl={
|
|
1254
|
+
recipientImageUrl={globalWalletImage}
|
|
1194
1255
|
/>
|
|
1195
1256
|
);
|
|
1196
1257
|
|
|
@@ -1207,8 +1268,6 @@ function AnySpendInner({
|
|
|
1207
1268
|
|
|
1208
1269
|
const cryptoPaymentMethodView = (
|
|
1209
1270
|
<CryptoPaymentMethod
|
|
1210
|
-
globalAddress={globalAddress}
|
|
1211
|
-
globalWallet={globalWallet}
|
|
1212
1271
|
selectedPaymentMethod={selectedCryptoPaymentMethod}
|
|
1213
1272
|
setSelectedPaymentMethod={setSelectedCryptoPaymentMethod}
|
|
1214
1273
|
isCreatingOrder={isCreatingOrder}
|
|
@@ -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
|
>
|
|
@@ -1237,8 +1237,6 @@ function AnySpendCustomInner({
|
|
|
1237
1237
|
const cryptoPaymentMethodView = (
|
|
1238
1238
|
<div className={cn("bg-as-surface-primary mx-auto w-[460px] max-w-full rounded-xl p-4")}>
|
|
1239
1239
|
<CryptoPaymentMethod
|
|
1240
|
-
globalAddress={currentWallet?.wallet?.address}
|
|
1241
|
-
globalWallet={currentWallet?.wallet}
|
|
1242
1240
|
selectedPaymentMethod={selectedCryptoPaymentMethod}
|
|
1243
1241
|
setSelectedPaymentMethod={setSelectedCryptoPaymentMethod}
|
|
1244
1242
|
isCreatingOrder={isCreatingOrder}
|
|
@@ -499,8 +499,6 @@ function AnySpendCustomExactInInner({
|
|
|
499
499
|
|
|
500
500
|
const cryptoPaymentMethodView = (
|
|
501
501
|
<CryptoPaymentMethod
|
|
502
|
-
globalAddress={globalAddress}
|
|
503
|
-
globalWallet={undefined}
|
|
504
502
|
selectedPaymentMethod={selectedCryptoPaymentMethod}
|
|
505
503
|
setSelectedPaymentMethod={setSelectedCryptoPaymentMethod}
|
|
506
504
|
isCreatingOrder={isCreatingOrder}
|
|
@@ -464,8 +464,6 @@ function AnySpendDepositHypeInner({
|
|
|
464
464
|
|
|
465
465
|
const cryptoPaymentMethodView = (
|
|
466
466
|
<CryptoPaymentMethod
|
|
467
|
-
globalAddress={globalAddress}
|
|
468
|
-
globalWallet={undefined}
|
|
469
467
|
selectedPaymentMethod={selectedCryptoPaymentMethod}
|
|
470
468
|
setSelectedPaymentMethod={setSelectedCryptoPaymentMethod}
|
|
471
469
|
isCreatingOrder={isCreatingOrder}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useAccountWallet } from "@b3dotfun/sdk/global-account/react";
|
|
4
|
+
import { useAccountWalletImage } from "@b3dotfun/sdk/global-account/react/hooks/useAccountWallet";
|
|
4
5
|
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
5
6
|
import { shortenAddress } from "@b3dotfun/sdk/shared/utils/formatAddress";
|
|
6
7
|
import { client } from "@b3dotfun/sdk/shared/utils/thirdweb";
|
|
@@ -22,12 +23,6 @@ export enum CryptoPaymentMethodType {
|
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
interface CryptoPaymentMethodProps {
|
|
25
|
-
globalAddress?: string;
|
|
26
|
-
globalWallet?: {
|
|
27
|
-
meta?: {
|
|
28
|
-
icon?: string;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
26
|
selectedPaymentMethod: CryptoPaymentMethodType;
|
|
32
27
|
setSelectedPaymentMethod: (method: CryptoPaymentMethodType) => void;
|
|
33
28
|
isCreatingOrder: boolean;
|
|
@@ -42,11 +37,7 @@ export function CryptoPaymentMethod({
|
|
|
42
37
|
onBack,
|
|
43
38
|
onSelectPaymentMethod,
|
|
44
39
|
}: CryptoPaymentMethodProps) {
|
|
45
|
-
const {
|
|
46
|
-
wallet: globalWallet,
|
|
47
|
-
connectedEOAWallet: connectedEOAWallet,
|
|
48
|
-
connectedSmartWallet: connectedSmartWallet,
|
|
49
|
-
} = useAccountWallet();
|
|
40
|
+
const { connectedEOAWallet: connectedEOAWallet, connectedSmartWallet: connectedSmartWallet } = useAccountWallet();
|
|
50
41
|
const { connector, address } = useAccount();
|
|
51
42
|
const { connect, connectors, isPending } = useConnect();
|
|
52
43
|
const { disconnect } = useDisconnect();
|
|
@@ -58,6 +49,8 @@ export function CryptoPaymentMethod({
|
|
|
58
49
|
const isConnected = !!connectedEOAWallet;
|
|
59
50
|
const globalAddress = connectedSmartWallet?.getAccount()?.address;
|
|
60
51
|
|
|
52
|
+
const walletImage = useAccountWalletImage();
|
|
53
|
+
|
|
61
54
|
// Use custom hook to determine wallet display logic
|
|
62
55
|
const { shouldShowConnectedEOA, shouldShowWagmiWallet } = useConnectedWalletDisplay(selectedPaymentMethod);
|
|
63
56
|
|
|
@@ -192,7 +185,7 @@ export function CryptoPaymentMethod({
|
|
|
192
185
|
};
|
|
193
186
|
|
|
194
187
|
return (
|
|
195
|
-
<div className="crypto-payment-method mx-auto h-fit w-[460px] max-w-full">
|
|
188
|
+
<div className="crypto-payment-method mx-auto h-fit w-[460px] max-w-full px-5 pb-5">
|
|
196
189
|
<div className={cn("relative flex flex-col gap-10")}>
|
|
197
190
|
{/* Header */}
|
|
198
191
|
<button
|
|
@@ -341,8 +334,8 @@ export function CryptoPaymentMethod({
|
|
|
341
334
|
>
|
|
342
335
|
<div className="flex items-center justify-between">
|
|
343
336
|
<div className="flex items-center gap-3">
|
|
344
|
-
{
|
|
345
|
-
<img src={
|
|
337
|
+
{walletImage ? (
|
|
338
|
+
<img src={walletImage} alt="Global Account" className="h-10 w-10 rounded-full" />
|
|
346
339
|
) : (
|
|
347
340
|
<div className="wallet-icon flex h-10 w-10 items-center justify-center rounded-full bg-purple-100">
|
|
348
341
|
<Wallet className="h-5 w-5 text-purple-600" />
|
|
@@ -83,7 +83,7 @@ export function FeeDetailPanel({ fee, transactionAmountUsd, onBack }: FeeDetailP
|
|
|
83
83
|
const [showAllDiscountTiers, setShowAllDiscountTiers] = useState(false);
|
|
84
84
|
|
|
85
85
|
return (
|
|
86
|
-
<div className="mx-auto flex w-[460px] max-w-full flex-col items-center gap-3">
|
|
86
|
+
<div className="mx-auto flex w-[460px] max-w-full flex-col items-center gap-3 px-5">
|
|
87
87
|
<div className="flex w-full flex-col gap-3">
|
|
88
88
|
<div className="text-center">
|
|
89
89
|
<h3 className="text-as-primary text-lg font-bold">Fee Breakdown</h3>
|
|
@@ -81,7 +81,7 @@ export function FiatPaymentMethodComponent({
|
|
|
81
81
|
// Show loading state while checking geo availability
|
|
82
82
|
if (isLoadingGeoOnramp) {
|
|
83
83
|
return (
|
|
84
|
-
<div className="fiat-payment-method mx-auto w-[460px] max-w-full">
|
|
84
|
+
<div className="fiat-payment-method mx-auto w-[460px] max-w-full px-5">
|
|
85
85
|
<div className="flex flex-col gap-6">
|
|
86
86
|
<div className="flex items-center gap-4">
|
|
87
87
|
<button
|
|
@@ -104,7 +104,7 @@ export function FiatPaymentMethodComponent({
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
return (
|
|
107
|
-
<div className="fiat-payment-method mx-auto w-[460px] max-w-full">
|
|
107
|
+
<div className="fiat-payment-method mx-auto w-[460px] max-w-full px-5">
|
|
108
108
|
<div className="flex flex-col gap-6">
|
|
109
109
|
{/* Header */}
|
|
110
110
|
<div className="flex items-center gap-4">
|