@b3dotfun/sdk 0.0.73-test.3 → 0.0.74-alpha.0
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 +75 -50
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +9 -10
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +41 -41
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +17 -9
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +7 -8
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +7 -8
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +0 -6
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +18 -14
- 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/InsufficientDepositPayment.js +6 -6
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +35 -35
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +1 -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/OrderHistoryItem.js +1 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +4 -4
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +8 -9
- 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/components/common/TransferCryptoDetails.js +2 -3
- package/dist/cjs/anyspend/react/components/webview/WebviewOnrampOrderStatus.js +1 -2
- package/dist/cjs/anyspend/react/components/webview/WebviewOnrampPayment.js +12 -12
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +4 -5
- package/dist/cjs/anyspend/react/hooks/useConnectedWalletDisplay.js +3 -2
- package/dist/cjs/anyspend/react/hooks/usePhantomTransfer.js +17 -17
- package/dist/cjs/anyspend/react/utils/toast.d.ts +6 -0
- package/dist/cjs/anyspend/react/utils/toast.js +9 -0
- package/dist/cjs/global-account/react/components/AccountAssets/AccountAssets.js +38 -2
- package/dist/cjs/global-account/react/components/AvatarCreator/AvatarCreator.js +2 -3
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +1 -0
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +275 -39
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +40 -13
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +1 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +19 -3
- package/dist/cjs/global-account/react/components/Deposit/Deposit.d.ts +1 -0
- package/dist/cjs/global-account/react/components/Deposit/Deposit.js +61 -0
- package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +39 -0
- package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +34 -0
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.d.ts +6 -4
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +104 -283
- package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
- package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.js +320 -0
- package/dist/cjs/global-account/react/components/LinkAccount/LinkedAccountItem.d.ts +16 -0
- package/dist/cjs/global-account/react/components/LinkAccount/LinkedAccountItem.js +44 -0
- 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/ContentTokens.js +1 -2
- 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 +16 -194
- 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/NotificationChannel.d.ts +16 -0
- package/dist/cjs/global-account/react/components/ManageAccount/NotificationChannel.js +13 -0
- package/dist/cjs/global-account/react/components/ManageAccount/NotificationsContent.d.ts +8 -0
- package/dist/cjs/global-account/react/components/ManageAccount/NotificationsContent.js +152 -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 +60 -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 +116 -0
- package/dist/cjs/global-account/react/components/ManageAccount/TokenBalanceRow.d.ts +3 -3
- package/dist/cjs/global-account/react/components/ManageAccount/TokenBalanceRow.js +2 -2
- package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
- package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.js +44 -0
- package/dist/cjs/global-account/react/components/ManageAccount/channels/DiscordChannel.d.ts +11 -0
- package/dist/cjs/global-account/react/components/ManageAccount/channels/DiscordChannel.js +48 -0
- package/dist/cjs/global-account/react/components/ManageAccount/channels/EmailChannel.d.ts +11 -0
- package/dist/cjs/global-account/react/components/ManageAccount/channels/EmailChannel.js +68 -0
- package/dist/cjs/global-account/react/components/ManageAccount/channels/PhoneChannel.d.ts +14 -0
- package/dist/cjs/global-account/react/components/ManageAccount/channels/PhoneChannel.js +79 -0
- package/dist/cjs/global-account/react/components/ManageAccount/channels/TelegramChannel.d.ts +11 -0
- package/dist/cjs/global-account/react/components/ManageAccount/channels/TelegramChannel.js +79 -0
- package/dist/cjs/global-account/react/components/ManageAccount/channels/index.d.ts +4 -0
- package/dist/cjs/global-account/react/components/ManageAccount/channels/index.js +11 -0
- package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.d.ts +11 -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 +195 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +5 -4
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -1
- package/dist/cjs/global-account/react/components/Toast/ToastComponents.d.ts +15 -0
- package/dist/cjs/global-account/react/components/Toast/ToastComponents.js +54 -0
- package/dist/cjs/global-account/react/components/Toast/ToastContext.d.ts +19 -0
- package/dist/cjs/global-account/react/components/Toast/ToastContext.js +59 -0
- package/dist/cjs/global-account/react/components/Toast/index.d.ts +4 -0
- package/dist/cjs/global-account/react/components/Toast/index.js +12 -0
- package/dist/cjs/global-account/react/components/Toast/toastApi.d.ts +21 -0
- package/dist/cjs/global-account/react/components/Toast/toastApi.js +93 -0
- package/dist/cjs/global-account/react/components/WalletImage/WalletImage.d.ts +4 -0
- package/dist/cjs/global-account/react/components/WalletImage/WalletImage.js +13 -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 +10 -4
- package/dist/cjs/global-account/react/components/index.js +29 -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/components/ui/drawer.js +1 -1
- package/dist/cjs/global-account/react/hooks/index.d.ts +3 -2
- package/dist/cjs/global-account/react/hooks/index.js +7 -3
- 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/useB3BalanceFromAddresses.js +1 -0
- package/dist/cjs/global-account/react/hooks/useChainSwitchWithAction.js +11 -11
- package/dist/cjs/global-account/react/hooks/useNativeBalance.js +2 -2
- package/dist/cjs/global-account/react/hooks/useNotifications.d.ts +48 -0
- package/dist/cjs/global-account/react/hooks/useNotifications.js +189 -0
- package/dist/cjs/global-account/react/hooks/useSimBalance.js +3 -3
- package/dist/cjs/global-account/react/hooks/useTokenBalanceDirect.d.ts +1 -0
- package/dist/cjs/global-account/react/hooks/useTokenBalanceDirect.js +1 -0
- package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +17 -17
- 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 +47 -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/index.d.ts +4 -0
- package/dist/cjs/global-account/react/utils/index.js +20 -0
- package/dist/cjs/global-account/react/utils/notificationsAPI.d.ts +80 -0
- package/dist/cjs/global-account/react/utils/notificationsAPI.js +257 -0
- package/dist/cjs/global-account/react/utils/profileDisplay.d.ts +3 -0
- package/dist/cjs/global-account/react/utils/profileDisplay.js +8 -4
- package/dist/cjs/global-account/react/utils/toast.d.ts +6 -0
- package/dist/cjs/global-account/react/utils/toast.js +9 -0
- package/dist/cjs/shared/constants/chains/supported.d.ts +3 -2
- package/dist/cjs/shared/constants/chains/supported.js +4 -0
- package/dist/cjs/shared/utils/ipfs.js +10 -3
- package/dist/esm/anyspend/react/components/AnySpend.js +67 -42
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +1 -2
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +10 -10
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -0
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +12 -4
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +1 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +1 -2
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +0 -6
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +9 -5
- 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/InsufficientDepositPayment.js +1 -1
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +2 -2
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +1 -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/OrderHistoryItem.js +2 -2
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +4 -4
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +2 -3
- 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/components/common/TransferCryptoDetails.js +1 -2
- package/dist/esm/anyspend/react/components/webview/WebviewOnrampOrderStatus.js +1 -2
- package/dist/esm/anyspend/react/components/webview/WebviewOnrampPayment.js +1 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +1 -2
- package/dist/esm/anyspend/react/hooks/useConnectedWalletDisplay.js +3 -2
- package/dist/esm/anyspend/react/hooks/usePhantomTransfer.js +1 -1
- package/dist/esm/anyspend/react/utils/toast.d.ts +6 -0
- package/dist/esm/anyspend/react/utils/toast.js +5 -0
- package/dist/esm/global-account/react/components/AccountAssets/AccountAssets.js +38 -2
- package/dist/esm/global-account/react/components/AvatarCreator/AvatarCreator.js +1 -2
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +1 -0
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +276 -40
- package/dist/esm/global-account/react/components/B3DynamicModal.js +37 -13
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +1 -1
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +19 -3
- package/dist/esm/global-account/react/components/Deposit/Deposit.d.ts +1 -0
- package/dist/esm/global-account/react/components/Deposit/Deposit.js +55 -0
- package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +39 -0
- package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +31 -0
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.d.ts +6 -4
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +103 -283
- package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
- package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.js +314 -0
- package/dist/esm/global-account/react/components/LinkAccount/LinkedAccountItem.d.ts +16 -0
- package/dist/esm/global-account/react/components/LinkAccount/LinkedAccountItem.js +42 -0
- 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/ContentTokens.js +1 -2
- 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 +18 -196
- 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/NotificationChannel.d.ts +16 -0
- package/dist/esm/global-account/react/components/ManageAccount/NotificationChannel.js +9 -0
- package/dist/esm/global-account/react/components/ManageAccount/NotificationsContent.d.ts +8 -0
- package/dist/esm/global-account/react/components/ManageAccount/NotificationsContent.js +147 -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 +55 -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 +111 -0
- package/dist/esm/global-account/react/components/ManageAccount/TokenBalanceRow.d.ts +3 -3
- package/dist/esm/global-account/react/components/ManageAccount/TokenBalanceRow.js +3 -3
- package/dist/esm/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
- package/dist/esm/global-account/react/components/ManageAccount/TokenContent.js +42 -0
- package/dist/esm/global-account/react/components/ManageAccount/channels/DiscordChannel.d.ts +11 -0
- package/dist/esm/global-account/react/components/ManageAccount/channels/DiscordChannel.js +44 -0
- package/dist/esm/global-account/react/components/ManageAccount/channels/EmailChannel.d.ts +11 -0
- package/dist/esm/global-account/react/components/ManageAccount/channels/EmailChannel.js +64 -0
- package/dist/esm/global-account/react/components/ManageAccount/channels/PhoneChannel.d.ts +14 -0
- package/dist/esm/global-account/react/components/ManageAccount/channels/PhoneChannel.js +75 -0
- package/dist/esm/global-account/react/components/ManageAccount/channels/TelegramChannel.d.ts +11 -0
- package/dist/esm/global-account/react/components/ManageAccount/channels/TelegramChannel.js +75 -0
- package/dist/esm/global-account/react/components/ManageAccount/channels/index.d.ts +4 -0
- package/dist/esm/global-account/react/components/ManageAccount/channels/index.js +4 -0
- package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.d.ts +11 -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 +189 -0
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +7 -6
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -1
- package/dist/esm/global-account/react/components/Toast/ToastComponents.d.ts +15 -0
- package/dist/esm/global-account/react/components/Toast/ToastComponents.js +50 -0
- package/dist/esm/global-account/react/components/Toast/ToastContext.d.ts +19 -0
- package/dist/esm/global-account/react/components/Toast/ToastContext.js +55 -0
- package/dist/esm/global-account/react/components/Toast/index.d.ts +4 -0
- package/dist/esm/global-account/react/components/Toast/index.js +3 -0
- package/dist/esm/global-account/react/components/Toast/toastApi.d.ts +21 -0
- package/dist/esm/global-account/react/components/Toast/toastApi.js +89 -0
- package/dist/esm/global-account/react/components/WalletImage/WalletImage.d.ts +4 -0
- package/dist/esm/global-account/react/components/WalletImage/WalletImage.js +11 -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 +10 -4
- package/dist/esm/global-account/react/components/index.js +14 -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/components/ui/drawer.js +1 -1
- package/dist/esm/global-account/react/hooks/index.d.ts +3 -2
- package/dist/esm/global-account/react/hooks/index.js +3 -2
- 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/useB3BalanceFromAddresses.js +1 -0
- package/dist/esm/global-account/react/hooks/useChainSwitchWithAction.js +2 -2
- package/dist/esm/global-account/react/hooks/useNativeBalance.js +1 -1
- package/dist/esm/global-account/react/hooks/useNotifications.d.ts +48 -0
- package/dist/esm/global-account/react/hooks/useNotifications.js +186 -0
- package/dist/esm/global-account/react/hooks/useSimBalance.js +3 -3
- package/dist/esm/global-account/react/hooks/useTokenBalanceDirect.d.ts +1 -0
- package/dist/esm/global-account/react/hooks/useTokenBalanceDirect.js +1 -0
- package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +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 +47 -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/index.d.ts +4 -0
- package/dist/esm/global-account/react/utils/index.js +4 -0
- package/dist/esm/global-account/react/utils/notificationsAPI.d.ts +80 -0
- package/dist/esm/global-account/react/utils/notificationsAPI.js +254 -0
- package/dist/esm/global-account/react/utils/profileDisplay.d.ts +3 -0
- package/dist/esm/global-account/react/utils/profileDisplay.js +8 -4
- package/dist/esm/global-account/react/utils/toast.d.ts +6 -0
- package/dist/esm/global-account/react/utils/toast.js +5 -0
- package/dist/esm/shared/constants/chains/supported.d.ts +3 -2
- package/dist/esm/shared/constants/chains/supported.js +3 -0
- package/dist/esm/shared/utils/ipfs.js +10 -3
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -0
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +2 -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/utils/toast.d.ts +6 -0
- package/dist/types/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +1 -0
- package/dist/types/global-account/react/components/B3Provider/B3Provider.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/LinkAccount/LinkedAccountItem.d.ts +16 -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/NotificationChannel.d.ts +16 -0
- package/dist/types/global-account/react/components/ManageAccount/NotificationsContent.d.ts +8 -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/TokenBalanceRow.d.ts +3 -3
- package/dist/types/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
- package/dist/types/global-account/react/components/ManageAccount/channels/DiscordChannel.d.ts +11 -0
- package/dist/types/global-account/react/components/ManageAccount/channels/EmailChannel.d.ts +11 -0
- package/dist/types/global-account/react/components/ManageAccount/channels/PhoneChannel.d.ts +14 -0
- package/dist/types/global-account/react/components/ManageAccount/channels/TelegramChannel.d.ts +11 -0
- package/dist/types/global-account/react/components/ManageAccount/channels/index.d.ts +4 -0
- package/dist/types/global-account/react/components/ModalHeader/ModalHeader.d.ts +11 -0
- package/dist/types/global-account/react/components/Send/Send.d.ts +5 -0
- package/dist/types/global-account/react/components/Toast/ToastComponents.d.ts +15 -0
- package/dist/types/global-account/react/components/Toast/ToastContext.d.ts +19 -0
- package/dist/types/global-account/react/components/Toast/index.d.ts +4 -0
- package/dist/types/global-account/react/components/Toast/toastApi.d.ts +21 -0
- package/dist/types/global-account/react/components/WalletImage/WalletImage.d.ts +4 -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 +10 -4
- package/dist/types/global-account/react/hooks/index.d.ts +3 -2
- package/dist/types/global-account/react/hooks/useAccountWallet.d.ts +1 -0
- package/dist/types/global-account/react/hooks/useNotifications.d.ts +48 -0
- package/dist/types/global-account/react/hooks/useTokenBalanceDirect.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 +47 -6
- package/dist/types/global-account/react/stores/useRecentAddressesStore.d.ts +25 -0
- package/dist/types/global-account/react/utils/index.d.ts +4 -0
- package/dist/types/global-account/react/utils/notificationsAPI.d.ts +80 -0
- package/dist/types/global-account/react/utils/profileDisplay.d.ts +3 -0
- package/dist/types/global-account/react/utils/toast.d.ts +6 -0
- package/dist/types/shared/constants/chains/supported.d.ts +3 -2
- package/package.json +2 -1
- package/src/anyspend/react/components/AnySpend.tsx +213 -173
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +2 -1
- package/src/anyspend/react/components/AnySpendCustom.tsx +80 -77
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +20 -4
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +2 -1
- package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +2 -1
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +3 -0
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +56 -22
- 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/InsufficientDepositPayment.tsx +1 -1
- package/src/anyspend/react/components/common/OrderDetails.tsx +6 -2
- package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +2 -2
- package/src/anyspend/react/components/common/OrderHistory.tsx +8 -13
- package/src/anyspend/react/components/common/OrderHistoryItem.tsx +69 -25
- package/src/anyspend/react/components/common/PanelOnramp.tsx +6 -4
- package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +3 -3
- package/src/anyspend/react/components/common/PointsDetailPanel.tsx +1 -1
- package/src/anyspend/react/components/common/RecipientSelection.tsx +1 -1
- package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +2 -2
- package/src/anyspend/react/components/webview/WebviewOnrampOrderStatus.tsx +3 -3
- package/src/anyspend/react/components/webview/WebviewOnrampPayment.tsx +2 -1
- package/src/anyspend/react/hooks/useAnyspendFlow.ts +2 -1
- package/src/anyspend/react/hooks/useConnectedWalletDisplay.ts +3 -2
- package/src/anyspend/react/hooks/usePhantomTransfer.ts +1 -1
- package/src/anyspend/react/utils/toast.ts +6 -0
- package/src/global-account/react/components/AccountAssets/AccountAssets.tsx +115 -25
- package/src/global-account/react/components/AvatarCreator/AvatarCreator.tsx +2 -2
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +491 -130
- package/src/global-account/react/components/B3DynamicModal.tsx +76 -17
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +40 -20
- package/src/global-account/react/components/Deposit/Deposit.tsx +208 -0
- package/src/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.tsx +84 -0
- package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +269 -434
- package/src/global-account/react/components/LinkAccount/LinkNewAccount.tsx +480 -0
- package/src/global-account/react/components/LinkAccount/LinkedAccountItem.tsx +135 -0
- package/src/global-account/react/components/ManageAccount/BottomNavigation.tsx +83 -0
- package/src/global-account/react/components/ManageAccount/ContentTokens.tsx +2 -1
- 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 +74 -597
- package/src/global-account/react/components/ManageAccount/NFTContent.tsx +24 -0
- package/src/global-account/react/components/ManageAccount/NotificationChannel.tsx +94 -0
- package/src/global-account/react/components/ManageAccount/NotificationsContent.tsx +268 -0
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +79 -0
- package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +106 -0
- package/src/global-account/react/components/ManageAccount/SettingsMenuItem.tsx +31 -0
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +197 -0
- package/src/global-account/react/components/ManageAccount/TokenBalanceRow.tsx +20 -5
- package/src/global-account/react/components/ManageAccount/TokenContent.tsx +66 -0
- package/src/global-account/react/components/ManageAccount/channels/DiscordChannel.tsx +119 -0
- package/src/global-account/react/components/ManageAccount/channels/EmailChannel.tsx +168 -0
- package/src/global-account/react/components/ManageAccount/channels/PhoneChannel.tsx +227 -0
- package/src/global-account/react/components/ManageAccount/channels/TelegramChannel.tsx +150 -0
- package/src/global-account/react/components/ManageAccount/channels/index.ts +4 -0
- package/src/global-account/react/components/ModalHeader/ModalHeader.tsx +61 -0
- package/src/global-account/react/components/Send/Send.tsx +621 -0
- package/src/global-account/react/components/SignInWithB3/SignIn.tsx +13 -12
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +1 -1
- package/src/global-account/react/components/Toast/README.md +350 -0
- package/src/global-account/react/components/Toast/ToastComponents.tsx +159 -0
- package/src/global-account/react/components/Toast/ToastContext.tsx +86 -0
- package/src/global-account/react/components/Toast/index.ts +4 -0
- package/src/global-account/react/components/Toast/toastApi.ts +98 -0
- package/src/global-account/react/components/WalletImage/WalletImage.tsx +12 -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 +19 -5
- package/src/global-account/react/components/ui/Tabs.tsx +5 -13
- package/src/global-account/react/components/ui/dialog.tsx +23 -14
- package/src/global-account/react/components/ui/drawer.tsx +1 -1
- package/src/global-account/react/hooks/index.ts +5 -1
- 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/hooks/useChainSwitchWithAction.ts +3 -2
- package/src/global-account/react/hooks/useNativeBalance.tsx +2 -1
- package/src/global-account/react/hooks/useNotifications.ts +229 -0
- package/src/global-account/react/hooks/useSimBalance.ts +3 -3
- package/src/global-account/react/hooks/useTokenBalanceDirect.tsx +2 -0
- package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +3 -2
- package/src/global-account/react/stores/index.ts +1 -0
- package/src/global-account/react/stores/useModalStore.ts +53 -6
- package/src/global-account/react/stores/useRecentAddressesStore.ts +54 -0
- package/src/global-account/react/utils/index.ts +4 -0
- package/src/global-account/react/utils/notificationsAPI.ts +305 -0
- package/src/global-account/react/utils/profileDisplay.ts +12 -4
- package/src/global-account/react/utils/toast.ts +6 -0
- package/src/shared/constants/chains/supported.ts +4 -0
- package/src/shared/utils/ipfs.ts +10 -3
- package/src/styles/index.css +12 -1
- package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.d.ts +0 -7
- package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.js +0 -107
- package/dist/cjs/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +0 -6
- package/dist/cjs/global-account/react/components/ProfileEditor/ProfileEditor.js +0 -151
- package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.d.ts +0 -7
- package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.js +0 -104
- package/dist/esm/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +0 -6
- package/dist/esm/global-account/react/components/ProfileEditor/ProfileEditor.js +0 -145
- package/dist/types/global-account/react/components/ManageAccount/BalanceContent.d.ts +0 -7
- package/dist/types/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +0 -6
- package/src/global-account/react/components/ManageAccount/BalanceContent.tsx +0 -258
- package/src/global-account/react/components/ProfileEditor/ProfileEditor.tsx +0 -279
|
@@ -12,7 +12,6 @@ const react_2 = require("@web3icons/react");
|
|
|
12
12
|
const lucide_react_1 = require("lucide-react");
|
|
13
13
|
const react_3 = require("react");
|
|
14
14
|
const react_dom_1 = require("react-dom");
|
|
15
|
-
const sonner_1 = require("sonner");
|
|
16
15
|
const react_4 = require("thirdweb/react");
|
|
17
16
|
const wallets_1 = require("thirdweb/wallets");
|
|
18
17
|
const wagmi_1 = require("wagmi");
|
|
@@ -25,7 +24,7 @@ var CryptoPaymentMethodType;
|
|
|
25
24
|
CryptoPaymentMethodType["TRANSFER_CRYPTO"] = "transfer_crypto";
|
|
26
25
|
})(CryptoPaymentMethodType || (exports.CryptoPaymentMethodType = CryptoPaymentMethodType = {}));
|
|
27
26
|
function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentMethod, isCreatingOrder, onBack, onSelectPaymentMethod, }) {
|
|
28
|
-
const {
|
|
27
|
+
const { connectedEOAWallet: connectedEOAWallet, connectedSmartWallet: connectedSmartWallet } = (0, react_1.useAccountWallet)();
|
|
29
28
|
const { connector, address } = (0, wagmi_1.useAccount)();
|
|
30
29
|
const { connect, connectors, isPending } = (0, wagmi_1.useConnect)();
|
|
31
30
|
const { disconnect } = (0, wagmi_1.useDisconnect)();
|
|
@@ -37,6 +36,7 @@ function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentMethod,
|
|
|
37
36
|
const globalAddress = connectedSmartWallet?.getAccount()?.address;
|
|
38
37
|
// Use custom hook to determine wallet display logic
|
|
39
38
|
const { shouldShowConnectedEOA, shouldShowWagmiWallet } = (0, useConnectedWalletDisplay_1.useConnectedWalletDisplay)(selectedPaymentMethod);
|
|
39
|
+
console.log("shouldShowWagmiWallet :", shouldShowWagmiWallet);
|
|
40
40
|
// Map wagmi connector names to thirdweb wallet IDs
|
|
41
41
|
const getThirdwebWalletId = (connectorName) => {
|
|
42
42
|
const walletMap = {
|
|
@@ -117,7 +117,7 @@ function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentMethod,
|
|
|
117
117
|
await connect({ connector: walletConnector });
|
|
118
118
|
setSelectedPaymentMethod(CryptoPaymentMethodType.CONNECT_WALLET);
|
|
119
119
|
onSelectPaymentMethod(CryptoPaymentMethodType.CONNECT_WALLET);
|
|
120
|
-
|
|
120
|
+
react_1.toast.success(`Connected to ${walletConnector.name}`);
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
123
|
// If same wallet or no specific wallet, request permissions for account switching
|
|
@@ -126,7 +126,7 @@ function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentMethod,
|
|
|
126
126
|
method: "wallet_requestPermissions",
|
|
127
127
|
params: [{ eth_accounts: {} }],
|
|
128
128
|
});
|
|
129
|
-
|
|
129
|
+
react_1.toast.success("Account selection completed");
|
|
130
130
|
setSelectedPaymentMethod(CryptoPaymentMethodType.CONNECT_WALLET);
|
|
131
131
|
onSelectPaymentMethod(CryptoPaymentMethodType.CONNECT_WALLET);
|
|
132
132
|
}
|
|
@@ -142,30 +142,34 @@ function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentMethod,
|
|
|
142
142
|
if (errorMessage.includes("rejected") ||
|
|
143
143
|
errorMessage.includes("denied") ||
|
|
144
144
|
errorMessage.includes("cancelled")) {
|
|
145
|
-
|
|
145
|
+
react_1.toast.error("Account selection cancelled");
|
|
146
146
|
}
|
|
147
147
|
else {
|
|
148
|
-
|
|
148
|
+
react_1.toast.error("Failed to open account selection");
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
else {
|
|
152
|
-
|
|
152
|
+
react_1.toast.error("Failed to open account selection");
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "crypto-payment-method mx-auto h-fit w-[460px] max-w-full", children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("relative flex flex-col gap-10"), children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary absolute flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-6 w-6" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-around gap-4", children: (0, jsx_runtime_1.jsx)("div", { className: "flex-1 text-center", children: (0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-lg font-semibold", children: "Select a payment method" }) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "
|
|
156
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "crypto-payment-method mx-auto h-fit w-[460px] max-w-full px-5 pb-5 pt-5 sm:px-0 sm:pt-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("relative flex flex-col gap-10"), children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary absolute flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-6 w-6" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-around gap-4", children: (0, jsx_runtime_1.jsx)("div", { className: "flex-1 text-center", children: (0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-lg font-semibold", children: "Select a payment method" }) }) }), process.env.NODE_ENV === "development" && ((0, jsx_runtime_1.jsxs)("div", { className: "rounded-lg border border-yellow-500/50 bg-yellow-50 p-3 dark:bg-yellow-950/20", children: [(0, jsx_runtime_1.jsx)("p", { className: "mb-2 text-xs font-semibold text-yellow-800 dark:text-yellow-300", children: "\uD83E\uDDEA Toast Test (Dev Only)" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-wrap gap-2", children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => react_1.toast.success("Success! Transaction completed"), className: "rounded bg-green-600 px-2 py-1 text-xs font-medium text-white hover:bg-green-700", children: "Success" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => react_1.toast.error("Error! Transaction failed"), className: "rounded bg-red-600 px-2 py-1 text-xs font-medium text-white hover:bg-red-700", children: "Error" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => react_1.toast.info("Info: Processing your request..."), className: "rounded bg-blue-600 px-2 py-1 text-xs font-medium text-white hover:bg-blue-700", children: "Info" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => react_1.toast.warning("Warning: Low balance detected"), className: "rounded bg-yellow-600 px-2 py-1 text-xs font-medium text-white hover:bg-yellow-700", children: "Warning" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => {
|
|
157
|
+
react_1.toast.success("Multiple test 1");
|
|
158
|
+
setTimeout(() => react_1.toast.info("Multiple test 2"), 200);
|
|
159
|
+
setTimeout(() => react_1.toast.warning("Multiple test 3"), 400);
|
|
160
|
+
}, className: "rounded bg-purple-600 px-2 py-1 text-xs font-medium text-white hover:bg-purple-700", children: "Multiple" })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "crypto-payment-methods flex flex-col gap-4", children: [(shouldShowConnectedEOA || shouldShowWagmiWallet || globalAddress) && ((0, jsx_runtime_1.jsxs)("div", { className: "installed-wallets", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-as-primary/80 mb-3 text-sm font-medium", children: "Connected wallets" }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-2", children: [shouldShowConnectedEOA && ((0, jsx_runtime_1.jsx)("button", { onClick: () => {
|
|
157
161
|
setSelectedPaymentMethod(CryptoPaymentMethodType.CONNECT_WALLET);
|
|
158
162
|
onSelectPaymentMethod(CryptoPaymentMethodType.CONNECT_WALLET);
|
|
159
163
|
if (connectedEOAWallet) {
|
|
160
164
|
setActiveWallet(connectedEOAWallet);
|
|
161
165
|
}
|
|
162
|
-
|
|
166
|
+
react_1.toast.success(`Selected ${eoaWalletInfo?.name || connector?.name || "wallet"}`);
|
|
163
167
|
}, className: (0, cn_1.cn)("crypto-payment-method-connect-wallet eoa-wallet w-full rounded-xl border p-4 text-left transition-all hover:shadow-md", selectedPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET
|
|
164
168
|
? "connected-wallet border-as-brand bg-as-brand/5"
|
|
165
169
|
: "border-as-border-secondary bg-as-surface-primary hover:border-as-secondary/80"), children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "wallet-icon flex h-10 w-10 items-center justify-center rounded-full bg-blue-100", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "h-5 w-5 text-blue-600" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-primary font-semibold", children: eoaWalletInfo?.name || connector?.name || "Connected Wallet" }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/60 text-sm", children: (0, formatAddress_1.shortenAddress)(connectedEOAWallet?.getAccount()?.address || "") })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [selectedPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET && ((0, jsx_runtime_1.jsx)("div", { className: "h-2 w-2 rounded-full bg-green-500" })), (0, jsx_runtime_1.jsx)("button", { onClick: e => {
|
|
166
170
|
e.stopPropagation();
|
|
167
171
|
disconnect();
|
|
168
|
-
|
|
172
|
+
react_1.toast.success("Wallet disconnected");
|
|
169
173
|
if (selectedPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET) {
|
|
170
174
|
setSelectedPaymentMethod(CryptoPaymentMethodType.NONE);
|
|
171
175
|
}
|
|
@@ -179,23 +183,23 @@ function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentMethod,
|
|
|
179
183
|
setActiveWallet(thirdwebWallet);
|
|
180
184
|
}
|
|
181
185
|
}
|
|
182
|
-
|
|
186
|
+
react_1.toast.success(`Selected ${connector?.name || "wallet"}`);
|
|
183
187
|
}, className: (0, cn_1.cn)("crypto-payment-method-connect-wallet wagmi-wallet w-full rounded-xl border p-4 text-left transition-all hover:shadow-md", selectedPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET
|
|
184
188
|
? "connected-wallet border-as-brand bg-as-brand/5"
|
|
185
189
|
: "border-as-border-secondary bg-as-surface-primary hover:border-as-secondary/80"), children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "wallet-icon flex h-10 w-10 items-center justify-center rounded-full bg-blue-100", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "h-5 w-5 text-blue-600" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-primary font-semibold", children: connector?.name || "Connected Wallet" }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/60 text-sm", children: (0, formatAddress_1.shortenAddress)(address || "") })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [selectedPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET && ((0, jsx_runtime_1.jsx)("div", { className: "h-2 w-2 rounded-full bg-green-500" })), (0, jsx_runtime_1.jsx)("button", { onClick: e => {
|
|
186
190
|
e.stopPropagation();
|
|
187
191
|
disconnect();
|
|
188
|
-
|
|
192
|
+
react_1.toast.success("Wallet disconnected");
|
|
189
193
|
if (selectedPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET) {
|
|
190
194
|
setSelectedPaymentMethod(CryptoPaymentMethodType.NONE);
|
|
191
195
|
}
|
|
192
196
|
}, className: "text-as-primary/60 hover:text-as-primary/80 rounded-lg p-1.5 transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-4 w-4" }) })] })] }) })), globalAddress && ((0, jsx_runtime_1.jsx)("button", { onClick: () => {
|
|
193
197
|
setSelectedPaymentMethod(CryptoPaymentMethodType.GLOBAL_WALLET);
|
|
194
198
|
onSelectPaymentMethod(CryptoPaymentMethodType.GLOBAL_WALLET);
|
|
195
|
-
|
|
199
|
+
react_1.toast.success("Selected B3 Account");
|
|
196
200
|
}, className: (0, cn_1.cn)("crypto-payment-method-global-wallet w-full rounded-xl border p-4 text-left transition-all hover:shadow-md", selectedPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET
|
|
197
201
|
? "connected-wallet border-as-brand bg-as-brand/5"
|
|
198
|
-
: "border-as-border-secondary bg-as-surface-primary hover:border-as-secondary/80"), children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
202
|
+
: "border-as-border-secondary bg-as-surface-primary hover:border-as-secondary/80"), children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(react_1.WalletImage, { fallback: (0, jsx_runtime_1.jsx)("div", { className: "wallet-icon flex h-10 w-10 items-center justify-center rounded-full bg-purple-100", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "h-5 w-5 text-purple-600" }) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-primary font-semibold", children: "Global Account" }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/60 text-sm", children: (0, formatAddress_1.shortenAddress)(globalAddress || "") })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: selectedPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET && ((0, jsx_runtime_1.jsx)("div", { className: "h-2 w-2 rounded-full bg-green-500" })) })] }) }))] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "other-payment-methods", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-as-primary/80 mb-3 text-sm font-medium", children: "Payment methods" }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => {
|
|
199
203
|
// Always show wallet selection modal first
|
|
200
204
|
setShowWalletModal(true);
|
|
201
205
|
}, className: "crypto-payment-method-connect-wallet bg-as-surface-primary border-as-border-secondary hover:border-as-secondary/80 group flex w-full items-center justify-between gap-4 rounded-xl border px-4 py-3.5 transition-all duration-200 hover:shadow-md", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "wallet-icon flex h-8 w-8 items-center justify-center rounded-full bg-blue-100", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "h-4 w-4 text-blue-600" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col items-start text-left", children: (0, jsx_runtime_1.jsx)("h4", { className: "text-as-primary font-semibold", children: "Connect wallet" }) })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRightCircle, { className: "text-as-primary/40 group-hover:text-as-primary/60 h-5 w-5 transition-colors" })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => {
|
|
@@ -62,7 +62,7 @@ function FeeDetailPanel({ fee, transactionAmountUsd, onBack }) {
|
|
|
62
62
|
// State for expanding tier lists
|
|
63
63
|
const [showAllFeeTiers, setShowAllFeeTiers] = (0, react_2.useState)(false);
|
|
64
64
|
const [showAllDiscountTiers, setShowAllDiscountTiers] = (0, react_2.useState)(false);
|
|
65
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-3", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-center", children: (0, jsx_runtime_1.jsx)("h3", { className: "text-as-primary text-lg font-bold", children: "Fee Breakdown" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-as-surface-secondary border-as-border-secondary rounded-2xl border p-4", children: [(0, jsx_runtime_1.jsx)("h4", { className: "text-as-primary mb-3 text-sm font-semibold", children: isStripeFee ? "Fiat Fee Schedule" : "Base Fee Schedule" }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-1.5", children: isStripeFee
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-3 px-5", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-center", children: (0, jsx_runtime_1.jsx)("h3", { className: "text-as-primary text-lg font-bold", children: "Fee Breakdown" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-as-surface-secondary border-as-border-secondary rounded-2xl border p-4", children: [(0, jsx_runtime_1.jsx)("h4", { className: "text-as-primary mb-3 text-sm font-semibold", children: isStripeFee ? "Fiat Fee Schedule" : "Base Fee Schedule" }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-1.5", children: isStripeFee
|
|
66
66
|
? FIAT_FEE_TIERS.map((tier, idx) => {
|
|
67
67
|
const isCurrentTier = currentFiatTier?.label === tier.label;
|
|
68
68
|
const currentTierIndex = FIAT_FEE_TIERS.findIndex(t => t.label === currentFiatTier?.label);
|
|
@@ -60,9 +60,9 @@ function FiatPaymentMethodComponent({ selectedPaymentMethod, setSelectedPaymentM
|
|
|
60
60
|
}
|
|
61
61
|
// Show loading state while checking geo availability
|
|
62
62
|
if (isLoadingGeoOnramp) {
|
|
63
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "fiat-payment-method mx-auto w-[460px] max-w-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-6 w-6" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1", children: (0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-lg font-semibold", children: "Choose payment method" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-8", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-6 w-6 animate-spin" }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-secondary ml-2 text-sm", children: "Loading payment methods..." })] })] }) }));
|
|
63
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "fiat-payment-method mx-auto w-[460px] max-w-full p-5", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-6 w-6" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1", children: (0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-lg font-semibold", children: "Choose payment method" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-8", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-6 w-6 animate-spin" }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-secondary ml-2 text-sm", children: "Loading payment methods..." })] })] }) }));
|
|
64
64
|
}
|
|
65
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "fiat-payment-method mx-auto w-[460px] max-w-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-6 w-6" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1", children: (0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-lg font-semibold", children: "Choose payment method" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-3", children: availablePaymentMethods.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "fiat-payment-method-no-methods bg-as-surface-secondary border-as-border-secondary rounded-2xl border p-6 text-center", children: (0, jsx_runtime_1.jsx)("p", { className: "text-as-secondary text-sm", children: "No payment methods available in your region for the selected amount." }) })) : (availablePaymentMethods.map(method => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => {
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "fiat-payment-method mx-auto w-[460px] max-w-full p-5", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-6 w-6" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1", children: (0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-lg font-semibold", children: "Choose payment method" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-3", children: availablePaymentMethods.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "fiat-payment-method-no-methods bg-as-surface-secondary border-as-border-secondary rounded-2xl border p-6 text-center", children: (0, jsx_runtime_1.jsx)("p", { className: "text-as-secondary text-sm", children: "No payment methods available in your region for the selected amount." }) })) : (availablePaymentMethods.map(method => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => {
|
|
66
66
|
setSelectedPaymentMethod(method.id);
|
|
67
67
|
onSelectPaymentMethod(method.id);
|
|
68
68
|
}, className: (0, cn_1.cn)("fiat-payment-method-item bg-as-surface-secondary border-as-border-secondary flex w-full items-center gap-4 rounded-2xl border p-4 transition-all duration-200", selectedPaymentMethod === method.id
|
|
@@ -7,19 +7,19 @@ const anyspend_1 = require("../../../../anyspend");
|
|
|
7
7
|
const react_1 = require("../../../../global-account/react");
|
|
8
8
|
const utils_1 = require("../../../../shared/utils");
|
|
9
9
|
const chains_1 = require("viem/chains");
|
|
10
|
+
const react_2 = require("../../../../global-account/react");
|
|
10
11
|
const number_1 = require("../../../../shared/utils/number");
|
|
11
|
-
const
|
|
12
|
+
const react_3 = require("@web3icons/react");
|
|
12
13
|
const lucide_react_1 = require("lucide-react");
|
|
13
|
-
const
|
|
14
|
+
const react_4 = require("motion/react");
|
|
14
15
|
const qrcode_react_1 = require("qrcode.react");
|
|
15
|
-
const sonner_1 = require("sonner");
|
|
16
16
|
function InsufficientDepositPayment({ order, srcToken, depositDeficit, phantomWalletAddress, txLoading, isSwitchingOrExecuting, onPayment, }) {
|
|
17
17
|
const depositDeficitAmount = (0, number_1.formatUnits)(depositDeficit.toString(), srcToken.decimals);
|
|
18
18
|
return ((0, jsx_runtime_1.jsxs)("div", { className: "insufficient-deposit-payment relative flex w-full flex-1 flex-col", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "insufficient-deposit-payment-text text-as-primary/50", children: "Please send remaining" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full flex-wrap items-center gap-6 sm:justify-between sm:gap-0", children: [(0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: depositDeficitAmount, onCopy: () => {
|
|
19
|
-
|
|
19
|
+
react_2.toast.success("Copied to clipboard");
|
|
20
20
|
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("strong", { className: "border-as-brand text-as-primary border-b-2 pb-1 text-2xl font-semibold sm:text-xl", children: [depositDeficitAmount, " ", srcToken.symbol] }), (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "text-as-primary/50 hover:text-as-primary h-5 w-5 cursor-pointer transition-all duration-200" })] }) }), (0, jsx_runtime_1.jsxs)(react_1.Badge, { variant: "outline", className: "flex h-10 items-center gap-2 px-3 py-1 pr-2 text-sm", children: ["on ", (0, anyspend_1.getChainName)(order.srcChain), (0, jsx_runtime_1.jsx)("img", { src: anyspend_1.ALL_CHAINS[order.srcChain].logoUrl, alt: (0, anyspend_1.getChainName)(order.srcChain), className: (0, utils_1.cn)("h-6 rounded-full", order.srcChain === chains_1.b3.id && "h-5 rounded-none") })] })] }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/50 mb-1 mt-2", children: " to the address:" })] }), (0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: order.globalAddress, onCopy: () => {
|
|
21
|
-
|
|
21
|
+
react_2.toast.success("Copied to clipboard");
|
|
22
22
|
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "payment-address bg-b3-react-background border-b3-react-border hover:border-as-brand group flex cursor-pointer items-center justify-between gap-4 rounded-lg border p-3 px-4 shadow-md transition-all duration-200", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary overflow-hidden text-ellipsis whitespace-nowrap text-sm", children: order.globalAddress }), (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "group-hover:text-as-brand text-as-primary/50 h-5 w-5 cursor-pointer transition-all duration-200" })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "payment-buttons mt-4 flex w-full flex-col items-center gap-2", children: [(0, jsx_runtime_1.jsx)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-5/6 max-w-[400px] items-center gap-2 sm:px-0", disabled: txLoading || isSwitchingOrExecuting, onClick: onPayment, children: txLoading ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Transaction Pending", (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "ml-2 h-5 w-5 animate-spin" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "whitespace-nowrap pl-4 text-lg md:text-sm", children: order.srcChain === anyspend_1.RELAY_SOLANA_MAINNET_CHAIN_ID && phantomWalletAddress
|
|
23
23
|
? "Pay from Phantom Wallet"
|
|
24
|
-
: "Pay from Connected Wallet" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) }), (0, jsx_runtime_1.jsx)("div", { children: "Or" }), (0, jsx_runtime_1.jsx)(
|
|
24
|
+
: "Pay from Connected Wallet" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) }), (0, jsx_runtime_1.jsx)("div", { children: "Or" }), (0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0, filter: "blur(10px)" }, animate: { opacity: 1, filter: "blur(0px)" }, transition: { duration: 0.5, ease: "easeInOut" }, className: "flex w-full items-center justify-evenly gap-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "qr-code flex flex-col items-center rounded-lg pb-3", children: [(0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeSVG, { value: (0, anyspend_1.getPaymentUrl)(order.globalAddress, BigInt(depositDeficit), order.srcTokenAddress === anyspend_1.RELAY_ETH_ADDRESS ? srcToken?.symbol || "ETH" : order.srcTokenAddress, order.srcChain, srcToken?.decimals), className: "max-w-[200px]" }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-3 flex items-center justify-center gap-2 text-sm", children: [(0, jsx_runtime_1.jsx)("span", { className: "label-style text-as-brand/70 text-sm", children: "Scan with" }), (0, jsx_runtime_1.jsxs)(react_1.TextLoop, { interval: 3, children: [(0, jsx_runtime_1.jsx)(react_3.WalletMetamask, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletPhantom, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletTrust, { className: "h-5 w-5", variant: "branded" })] })] })] }) })] })] }));
|
|
25
25
|
}
|
|
@@ -12,13 +12,13 @@ const hooks_1 = require("../../../../shared/react/hooks");
|
|
|
12
12
|
const utils_1 = require("../../../../shared/utils");
|
|
13
13
|
const centerTruncate_1 = __importDefault(require("../../../../shared/utils/centerTruncate"));
|
|
14
14
|
const number_1 = require("../../../../shared/utils/number");
|
|
15
|
-
const react_2 = require("
|
|
15
|
+
const react_2 = require("../../../../global-account/react");
|
|
16
|
+
const react_3 = require("@web3icons/react");
|
|
16
17
|
const lucide_react_1 = require("lucide-react");
|
|
17
|
-
const
|
|
18
|
+
const react_4 = require("motion/react");
|
|
18
19
|
const qrcode_react_1 = require("qrcode.react");
|
|
19
|
-
const
|
|
20
|
+
const react_5 = require("react");
|
|
20
21
|
const react_timeago_1 = __importDefault(require("react-timeago"));
|
|
21
|
-
const sonner_1 = require("sonner");
|
|
22
22
|
const viem_1 = require("viem");
|
|
23
23
|
const chains_1 = require("viem/chains");
|
|
24
24
|
const wagmi_1 = require("wagmi");
|
|
@@ -136,7 +136,7 @@ function roundTokenAmount(amount) {
|
|
|
136
136
|
const roundedDecimalPart = digits.join("");
|
|
137
137
|
return `${wholePart}.${roundedDecimalPart}`;
|
|
138
138
|
}
|
|
139
|
-
exports.OrderDetails = (0,
|
|
139
|
+
exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal", order, depositTxs, relayTxs, executeTx, refundTxs, cryptoPaymentMethod, selectedCryptoPaymentMethod, onPaymentMethodChange, onBack, disableUrlParamManagement = false, points, }) {
|
|
140
140
|
const router = (0, hooks_1.useRouter)();
|
|
141
141
|
const searchParams = (0, hooks_1.useSearchParams)();
|
|
142
142
|
// Get theme from B3Provider context
|
|
@@ -156,15 +156,15 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
156
156
|
const recipientName = profile.data?.name?.replace(/\.b3\.fun/g, "");
|
|
157
157
|
const account = (0, react_1.useAccountWallet)();
|
|
158
158
|
const { data: walletClient } = (0, wagmi_1.useWalletClient)();
|
|
159
|
-
const [txHash, setTxHash] = (0,
|
|
160
|
-
const [showQRCode, setShowQRCode] = (0,
|
|
159
|
+
const [txHash, setTxHash] = (0, react_5.useState)();
|
|
160
|
+
const [showQRCode, setShowQRCode] = (0, react_5.useState)(false);
|
|
161
161
|
const { isLoading: txLoading, isSuccess: txSuccess } = (0, wagmi_1.useWaitForTransactionReceipt)({ hash: txHash });
|
|
162
162
|
const { switchChainAndExecuteWithEOA, switchChainAndExecute, isSwitchingOrExecuting } = (0, react_1.useUnifiedChainSwitchAndExecute)();
|
|
163
163
|
// Track if auto-payment was attempted to avoid re-triggering
|
|
164
|
-
const autoPaymentAttempted = (0,
|
|
164
|
+
const autoPaymentAttempted = (0, react_5.useRef)(false);
|
|
165
165
|
// Track if component is ready for auto-payment (all data loaded)
|
|
166
|
-
const [isComponentReady, setIsComponentReady] = (0,
|
|
167
|
-
const roundedUpSrcAmount = (0,
|
|
166
|
+
const [isComponentReady, setIsComponentReady] = (0, react_5.useState)(false);
|
|
167
|
+
const roundedUpSrcAmount = (0, react_5.useMemo)(() => {
|
|
168
168
|
// Display the full transfer amount without rounding since users need to see the exact value they're transferring.
|
|
169
169
|
// Use 21 significant digits (max allowed by Intl.NumberFormat)
|
|
170
170
|
const formattedSrcAmount = srcToken
|
|
@@ -173,20 +173,20 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
173
173
|
return roundTokenAmount(formattedSrcAmount);
|
|
174
174
|
}, [order.srcAmount, srcToken]);
|
|
175
175
|
// Calculate deposit amounts - moved here to be used in useCallback hooks
|
|
176
|
-
const depositedAmount = (0,
|
|
176
|
+
const depositedAmount = (0, react_5.useMemo)(() => {
|
|
177
177
|
return depositTxs ? depositTxs.reduce((acc, curr) => acc + BigInt(curr.amount), BigInt(0)) : BigInt(0);
|
|
178
178
|
}, [depositTxs]);
|
|
179
|
-
const depositDeficit = (0,
|
|
179
|
+
const depositDeficit = (0, react_5.useMemo)(() => {
|
|
180
180
|
return BigInt(order.srcAmount) - depositedAmount;
|
|
181
181
|
}, [order.srcAmount, depositedAmount]);
|
|
182
|
-
const depositEnoughAmount = (0,
|
|
182
|
+
const depositEnoughAmount = (0, react_5.useMemo)(() => {
|
|
183
183
|
return depositDeficit <= BigInt(0);
|
|
184
184
|
}, [depositDeficit]);
|
|
185
|
-
const formattedDepositDeficit = (0,
|
|
185
|
+
const formattedDepositDeficit = (0, react_5.useMemo)(() => {
|
|
186
186
|
return (0, number_1.formatTokenAmount)(BigInt(depositDeficit), srcToken.decimals);
|
|
187
187
|
}, [depositDeficit, srcToken.decimals]);
|
|
188
188
|
// Unified payment handler for both EOA and AA wallets
|
|
189
|
-
const handleUnifiedPaymentProcess = (0,
|
|
189
|
+
const handleUnifiedPaymentProcess = (0, react_5.useCallback)(async () => {
|
|
190
190
|
let txData;
|
|
191
191
|
let value;
|
|
192
192
|
let to;
|
|
@@ -222,7 +222,7 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
222
222
|
// Use Phantom transfer hook for Solana payments
|
|
223
223
|
const { initiateTransfer: initiatePhantomTransfer, getConnectedAddress: getPhantomAddress } = (0, usePhantomTransfer_1.usePhantomTransfer)();
|
|
224
224
|
// Main payment handler that triggers chain switch and payment
|
|
225
|
-
const handlePayment = (0,
|
|
225
|
+
const handlePayment = (0, react_5.useCallback)(async () => {
|
|
226
226
|
console.log("Initiating payment process. Target chain:", order.srcChain, "Current chain:", walletClient?.chain?.id);
|
|
227
227
|
if (order.srcChain === anyspend_1.RELAY_SOLANA_MAINNET_CHAIN_ID) {
|
|
228
228
|
// Use the existing depositDeficit calculation to determine amount to send
|
|
@@ -239,7 +239,7 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
239
239
|
}
|
|
240
240
|
}, [order, walletClient?.chain?.id, depositDeficit, handleUnifiedPaymentProcess, initiatePhantomTransfer]);
|
|
241
241
|
// When waitingForDeposit is true, we show a message to the user to wait for the deposit to be processed.
|
|
242
|
-
const setWaitingForDeposit = (0,
|
|
242
|
+
const setWaitingForDeposit = (0, react_5.useCallback)(() => {
|
|
243
243
|
if (disableUrlParamManagement)
|
|
244
244
|
return;
|
|
245
245
|
const params = new URLSearchParams(searchParams.toString());
|
|
@@ -247,7 +247,7 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
247
247
|
router.push(`?${params}`);
|
|
248
248
|
}, [router, searchParams, disableUrlParamManagement]);
|
|
249
249
|
// Clean up URL parameters before closing modal or navigating back
|
|
250
|
-
const cleanupUrlParams = (0,
|
|
250
|
+
const cleanupUrlParams = (0, react_5.useCallback)(() => {
|
|
251
251
|
if (disableUrlParamManagement)
|
|
252
252
|
return;
|
|
253
253
|
const params = new URLSearchParams(searchParams.toString());
|
|
@@ -260,27 +260,27 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
260
260
|
}
|
|
261
261
|
}, [router, searchParams, disableUrlParamManagement]);
|
|
262
262
|
// Helper functions that clean up URL params before executing actions
|
|
263
|
-
const handleCloseModal = (0,
|
|
263
|
+
const handleCloseModal = (0, react_5.useCallback)(() => {
|
|
264
264
|
cleanupUrlParams();
|
|
265
265
|
setB3ModalOpen(false);
|
|
266
266
|
}, [cleanupUrlParams, setB3ModalOpen]);
|
|
267
|
-
const handleBack = (0,
|
|
267
|
+
const handleBack = (0, react_5.useCallback)(() => {
|
|
268
268
|
cleanupUrlParams();
|
|
269
269
|
onBack?.();
|
|
270
270
|
}, [cleanupUrlParams, onBack]);
|
|
271
|
-
(0,
|
|
271
|
+
(0, react_5.useEffect)(() => {
|
|
272
272
|
if (txSuccess) {
|
|
273
|
-
|
|
273
|
+
react_2.toast.success("Transaction successful! We are processing your order.", { duration: 10000 });
|
|
274
274
|
setWaitingForDeposit();
|
|
275
275
|
setTxHash(undefined);
|
|
276
276
|
}
|
|
277
277
|
}, [setWaitingForDeposit, txSuccess]);
|
|
278
278
|
// Get connected Phantom wallet address if available
|
|
279
|
-
const phantomWalletAddress = (0,
|
|
279
|
+
const phantomWalletAddress = (0, react_5.useMemo)(() => getPhantomAddress(), [getPhantomAddress]);
|
|
280
280
|
// Calculate status display before using it
|
|
281
281
|
const { text: statusText, status: statusDisplay } = (0, anyspend_1.getStatusDisplay)(order);
|
|
282
282
|
// Memoize the payable state calculation to avoid recalculating on every render
|
|
283
|
-
const isPayableState = (0,
|
|
283
|
+
const isPayableState = (0, react_5.useMemo)(() => {
|
|
284
284
|
const waitingForDeposit = new URLSearchParams(window.location.search).get("waitingForDeposit") === "true";
|
|
285
285
|
return (refundTxs.length === 0 &&
|
|
286
286
|
!executeTx &&
|
|
@@ -302,14 +302,14 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
302
302
|
]);
|
|
303
303
|
// Mark component as ready once all critical data is available
|
|
304
304
|
// This ensures we don't trigger payment before the component has fully initialized
|
|
305
|
-
(0,
|
|
305
|
+
(0, react_5.useEffect)(() => {
|
|
306
306
|
if (!isComponentReady && srcToken && dstToken && statusDisplay) {
|
|
307
307
|
setIsComponentReady(true);
|
|
308
308
|
}
|
|
309
309
|
}, [isComponentReady, srcToken, dstToken, statusDisplay]);
|
|
310
310
|
// Auto-trigger payment when component is ready and order is in payable state
|
|
311
311
|
// This effect only runs when isPayableState or isComponentReady changes
|
|
312
|
-
(0,
|
|
312
|
+
(0, react_5.useEffect)(() => {
|
|
313
313
|
// Only trigger payment if:
|
|
314
314
|
// 1. We haven't attempted payment yet
|
|
315
315
|
// 2. Component is fully ready (all data loaded)
|
|
@@ -334,7 +334,7 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
334
334
|
? (0, number_1.formatTokenAmount)(BigInt(actualDstAmount), dstToken.decimals)
|
|
335
335
|
: undefined;
|
|
336
336
|
if (refundTxs.length > 0) {
|
|
337
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "refund-details", className: "order-details-refund-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "Transaction Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(
|
|
337
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "refund-details", className: "order-details-refund-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "Transaction Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "bg-as-border-primary absolute left-[2px] top-0 z-10 w-[3px]", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
|
|
338
338
|
? depositTxs.map(dTx => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
|
|
339
339
|
? `Received payment`
|
|
340
340
|
: `Received ${(0, number_1.formatTokenAmount)(BigInt(dTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTx, isProcessing: false }, dTx.txHash)))
|
|
@@ -343,7 +343,7 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
343
343
|
: null] }) })] }) }), order.errorDetails && ((0, jsx_runtime_1.jsx)("div", { className: "flex justify-center", children: (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/50 text-center text-sm", style: { maxWidth: "40ch" }, children: (0, anyspend_1.getErrorDisplay)(order.errorDetails) }) })), (0, jsx_runtime_1.jsx)("button", { className: "order-close-button order-details-close-btn bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white", onClick: mode === "page" ? handleBack : handleCloseModal, children: mode === "page" ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Return to Home ", (0, jsx_runtime_1.jsx)(lucide_react_1.Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") })] }));
|
|
344
344
|
}
|
|
345
345
|
if (executeTx) {
|
|
346
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "execute-details", className: "order-details-execute-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "Transaction Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(
|
|
346
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "execute-details", className: "order-details-execute-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "Transaction Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "bg-as-border-primary absolute left-[2px] top-0 z-10 w-[3px]", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
|
|
347
347
|
? depositTxs.map(dTxs => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
|
|
348
348
|
? `Received payment`
|
|
349
349
|
: `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
|
|
@@ -368,7 +368,7 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
368
368
|
}), (0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { className: "ml-2 h-4 w-4" })] }) }) }), order.type === "join_tournament" && order.status === "executed" && ((0, jsx_runtime_1.jsxs)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [(0, jsx_runtime_1.jsx)("span", { className: "pl-4", children: "Continue to Tournament" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" && ((0, jsx_runtime_1.jsx)("button", { className: "order-close-button order-details-close-btn bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white", onClick: mode === "page" ? handleBack : handleCloseModal, children: mode === "page" ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Return to Home ", (0, jsx_runtime_1.jsx)(lucide_react_1.Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") }))] }));
|
|
369
369
|
}
|
|
370
370
|
if (relayTxs.length > 0 && relayTxs.every(tx => tx.status === "success")) {
|
|
371
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "more-details", className: "order-details-more-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "More Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(
|
|
371
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "more-details", className: "order-details-more-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "More Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "bg-as-border-primary absolute left-[2px] top-0 z-10 w-[3px]", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
|
|
372
372
|
? depositTxs.map(dTxs => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
|
|
373
373
|
? `Received payment`
|
|
374
374
|
: `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
|
|
@@ -389,7 +389,7 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
389
389
|
// This boolean indicates that user finish payment, and waiting for the deposit to be confirmed. We get this from query params (waitingForDeposit=true)
|
|
390
390
|
const waitingForDeposit = new URLSearchParams(window.location.search).get("waitingForDeposit") === "true";
|
|
391
391
|
if (depositTxs?.length || waitingForDeposit) {
|
|
392
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "deposit-details", className: "order-details-deposit-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "Transaction Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(
|
|
392
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "deposit-details", className: "order-details-deposit-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "Transaction Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "from-as-brand/50 absolute left-[2px] top-0 z-10 w-[3px] bg-gradient-to-b from-20% via-purple-500/50 via-80% to-transparent", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1, ease: "easeInOut" } }) }), (depositTxs || []).map((dTxs, index) => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
|
|
393
393
|
? `Received payment`
|
|
394
394
|
: `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: index < (depositTxs || []).length - 1 ? false : !depositEnoughAmount }, dTxs.txHash))), statusDisplay === "failure" ? ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: statusText, chainId: order.srcChain, tx: null, isProcessing: false, delay: 0.5 })) : depositEnoughAmount ? ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.type === "swap"
|
|
395
395
|
? "Processing Swap"
|
|
@@ -407,18 +407,18 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
407
407
|
effectiveCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.GLOBAL_WALLET ? ((0, jsx_runtime_1.jsx)(ConnectWalletPayment_1.default, { order: order, onPayment: handlePayment, onCancel: handleBack, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, phantomWalletAddress: phantomWalletAddress, tournament: tournament, nft: nft, cryptoPaymentMethod: effectiveCryptoPaymentMethod, onPaymentMethodChange: onPaymentMethodChange })) : effectiveCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.TRANSFER_CRYPTO ? (
|
|
408
408
|
// Transfer Crypto Payment Method - Show new card-based UI
|
|
409
409
|
(0, jsx_runtime_1.jsx)(TransferCryptoDetails_1.TransferCryptoDetails, { order: order, recipientName: recipientName, srcToken: srcToken, dstToken: dstToken, tournament: tournament, nft: nft, onBack: handleBack, onPaymentMethodChange: onPaymentMethodChange })) : ((0, jsx_runtime_1.jsxs)("div", { className: "order-details-payment-section relative flex w-full flex-1 flex-col", children: [(0, jsx_runtime_1.jsxs)("div", { className: "order-details-amount-section flex flex-col gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/50 order-details-amount-label", children: "Please send" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-amount-container flex w-full flex-wrap items-center gap-6 sm:justify-between sm:gap-0", children: [(0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: roundedUpSrcAmount, onCopy: () => {
|
|
410
|
-
|
|
410
|
+
react_2.toast.success("Copied to clipboard");
|
|
411
411
|
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "order-details-amount-display flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("strong", { className: "border-as-brand text-as-primary order-details-amount-text border-b-2 pb-1 text-2xl font-semibold sm:text-xl", children: [roundedUpSrcAmount, " ", srcToken.symbol] }), (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "text-as-primary/50 hover:text-as-primary order-details-copy-icon h-5 w-5 cursor-pointer transition-all duration-200" })] }) }), (0, jsx_runtime_1.jsxs)(react_1.Badge, { variant: "outline", className: "flex h-10 items-center gap-2 px-3 py-1 pr-2 text-sm", children: ["on ", (0, anyspend_1.getChainName)(order.srcChain), (0, jsx_runtime_1.jsx)("img", { src: anyspend_1.ALL_CHAINS[order.srcChain].logoUrl, alt: (0, anyspend_1.getChainName)(order.srcChain), className: (0, utils_1.cn)("h-6 rounded-full", order.srcChain === chains_1.b3.id && "h-5 rounded-none") })] })] }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/50 order-details-address-label mb-1 mt-2", children: " to the address:" })] }), (0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: order.globalAddress, onCopy: () => {
|
|
412
|
-
|
|
412
|
+
react_2.toast.success("Copied to clipboard");
|
|
413
413
|
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-background border-b3-react-border hover:border-as-brand order-details-address-container group flex cursor-pointer items-center justify-between gap-4 rounded-lg border p-3 px-4 shadow-md transition-all duration-200", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary order-details-address-text overflow-hidden text-ellipsis whitespace-nowrap text-sm", children: order.globalAddress }), (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "group-hover:text-as-brand text-as-primary/50 order-details-address-copy-icon h-5 w-5 cursor-pointer transition-all duration-200" })] }) }), (account?.address || phantomWalletAddress) && !showQRCode ? ((0, jsx_runtime_1.jsx)("div", { className: "mb-4 mt-8 flex w-full flex-col items-center gap-4", children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col items-center gap-2", children: [(0, jsx_runtime_1.jsx)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-5/6 items-center gap-2 sm:px-0", disabled: txLoading || isSwitchingOrExecuting, onClick: handlePayment, children: txLoading ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Transaction Pending", (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "ml-2 h-5 w-5 animate-spin" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "pl-4 text-lg md:text-sm", children: order.srcChain === anyspend_1.RELAY_SOLANA_MAINNET_CHAIN_ID && phantomWalletAddress
|
|
414
414
|
? "Pay from Phantom Wallet"
|
|
415
415
|
: "Pay from Connected Wallet" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) }), (0, jsx_runtime_1.jsxs)("span", { className: "label-style text-as-primary/50 text-xs", children: ["Connected to:", " ", order.srcChain === anyspend_1.RELAY_SOLANA_MAINNET_CHAIN_ID && phantomWalletAddress
|
|
416
416
|
? (0, centerTruncate_1.default)(phantomWalletAddress, 6)
|
|
417
|
-
: (0, centerTruncate_1.default)(account?.address || "", 6)] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full flex-col items-center gap-2", children: [(0, jsx_runtime_1.jsxs)(react_1.ShinyButton, { accentColor: colorMode === "dark" ? "#ffffff" : "#000000", className: "flex w-5/6 items-center gap-2 sm:px-0", onClick: () => setShowQRCode(true), children: [(0, jsx_runtime_1.jsx)("span", { className: "pl-4 text-lg md:text-sm", children: "Pay from a different wallet" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(
|
|
417
|
+
: (0, centerTruncate_1.default)(account?.address || "", 6)] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full flex-col items-center gap-2", children: [(0, jsx_runtime_1.jsxs)(react_1.ShinyButton, { accentColor: colorMode === "dark" ? "#ffffff" : "#000000", className: "flex w-5/6 items-center gap-2 sm:px-0", onClick: () => setShowQRCode(true), children: [(0, jsx_runtime_1.jsx)("span", { className: "pl-4 text-lg md:text-sm", children: "Pay from a different wallet" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(react_3.WalletMetamask, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletPhantom, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletTrust, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletWalletConnect, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)("span", { className: "label-style text-as-primary/30 text-xs", children: "& more" })] })] })] }) })) : (
|
|
418
418
|
// Default case - existing QR code flow
|
|
419
|
-
(0, jsx_runtime_1.jsx)(
|
|
419
|
+
(0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0, filter: "blur(10px)" }, animate: { opacity: 1, filter: "blur(0px)" }, transition: { duration: 0.5, ease: "easeInOut" }, className: "flex w-full items-center justify-evenly gap-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "order-details-qr-container mt-8 flex flex-col items-center rounded-lg bg-white p-6 pb-3", children: [(0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeSVG, { value: (0, anyspend_1.getPaymentUrl)(order.globalAddress, BigInt(order.srcAmount), order.srcTokenAddress === anyspend_1.RELAY_ETH_ADDRESS ? srcToken?.symbol || "ETH" : order.srcTokenAddress, order.srcChain, srcToken?.decimals), className: "order-details-qr-code max-w-[200px]" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-qr-wallets mt-3 flex items-center justify-center gap-2 text-sm", children: [(0, jsx_runtime_1.jsx)("span", { className: "label-style text-as-brand/70 text-sm", children: "Scan with" }), (0, jsx_runtime_1.jsxs)(react_1.TextLoop, { interval: 3, children: [(0, jsx_runtime_1.jsx)(react_3.WalletMetamask, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletPhantom, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletTrust, { className: "h-5 w-5", variant: "branded" })] })] })] }) }))] })) })), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-time-remaining flex w-full items-center justify-center gap-1 text-sm", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/30 order-details-time-label", children: "Time remaining:" }), (0, jsx_runtime_1.jsx)("div", { className: "text-as-primary order-details-time-value", children: depositEnoughAmount ? ("Received") : order.status === "expired" ? ("Expired") : ((0, jsx_runtime_1.jsx)(react_timeago_1.default, { date: new Date(order.expiredAt), live: true })) })] }), statusDisplay !== "processing" && ((0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points })), (0, jsx_runtime_1.jsxs)("button", { className: "text-b3-primary-blue hover:text-b3-primary-blue/50 order-details-cancel-btn flex w-full items-center justify-center gap-2 underline", onClick: handleBack, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCcw, { className: "ml-2 h-4 w-4" }), " Cancel and start over"] })] }));
|
|
420
420
|
});
|
|
421
421
|
function TransactionDetails({ title, chainId, tx, isProcessing, delay, }) {
|
|
422
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "order-details-transaction-item relative flex w-full flex-1 items-center justify-between gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "order-details-transaction-content flex grow items-center gap-4", children: [(0, jsx_runtime_1.jsx)(
|
|
422
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "order-details-transaction-item relative flex w-full flex-1 items-center justify-between gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "order-details-transaction-content flex grow items-center gap-4", children: [(0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "bg-as-surface-secondary relative h-10 w-10 rounded-full", children: isProcessing ? ((0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0, scale: 0.3 }, animate: { opacity: 1, scale: 1 }, transition: { duration: 0.5, ease: "easeInOut", delay }, className: "border-as-border-secondary absolute z-10 m-2 flex h-6 w-6 items-center justify-center rounded-full border-2 shadow-lg backdrop-blur-sm", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "text-as-primary h-4 w-4 animate-spin" }) })) : ((0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0, scale: 0.3 }, animate: { opacity: 1, scale: 1 }, transition: { duration: 0.5, ease: "easeOut", delay }, className: "bg-as-success-secondary absolute z-10 m-2 flex h-6 w-6 items-center justify-center rounded-full border border-white/30 shadow-lg backdrop-blur-sm", children: (0, jsx_runtime_1.jsx)(lucide_react_1.CheckIcon, { className: "text-as-content-icon-success h-4 w-4" }) })) }), (0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, ease: "easeInOut", delay }, className: "shrink-0 text-base", children: isProcessing ? ((0, jsx_runtime_1.jsx)(react_1.TextShimmer, { duration: 1, children: title })) : ((0, jsx_runtime_1.jsx)("span", { className: "text-as-primary", children: title })) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-1", children: tx ? ((0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, ease: "easeInOut", delay: (delay || 0) + 0.3 }, className: "flex items-center gap-3", children: (0, jsx_runtime_1.jsx)("a", { href: (0, anyspend_1.getExplorerTxUrl)(chainId, tx.txHash), target: "_blank", children: (0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/30 font-mono text-xs", children: (0, centerTruncate_1.default)(tx?.txHash, 6) }) }) })) : null })] }));
|
|
423
423
|
}
|
|
424
424
|
exports.OrderDetailsLoadingView = ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-4", children: [(0, jsx_runtime_1.jsxs)(react_1.Badge, { variant: "default", className: "hover:bg-b3-react-background flex items-center gap-3 border-white/20 bg-white/10 px-4 py-1 text-base transition-colors", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "text-as-primary h-4 w-4 animate-spin" }), (0, jsx_runtime_1.jsx)(react_1.TextShimmer, { duration: 1, className: "font-sf-rounded text-base font-semibold", children: "Loading..." })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full flex-1 flex-col", children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-4 flex flex-col gap-1", children: [(0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-4 w-24" }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-2 flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-8 w-48" }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "ml-4 h-8 w-32" })] }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "mt-4 h-8 w-24" })] }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "mb-4 h-12 w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full items-center justify-between gap-4", children: [(0, jsx_runtime_1.jsxs)(react_1.Skeleton, { className: "rounded-lg p-6 pb-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-[200px] w-[200px]" }), (0, jsx_runtime_1.jsx)("div", { className: "mt-3 flex items-center justify-center gap-2", children: (0, jsx_runtime_1.jsx)("div", { className: "h-5 w-5 rounded-full" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-1 flex-col gap-2", children: [1, 2, 3].map(i => ((0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-10 w-full" }, i))) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-background mt-8 w-full rounded-lg p-4", children: [(0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "mb-3 h-4 w-48" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-10 flex-1" }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-10 flex-1" })] })] }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-10 w-full" })] }));
|
|
@@ -15,7 +15,6 @@ const number_1 = require("../../../../shared/utils/number");
|
|
|
15
15
|
const lucide_react_1 = require("lucide-react");
|
|
16
16
|
const react_2 = require("motion/react");
|
|
17
17
|
const react_3 = require("react");
|
|
18
|
-
const sonner_1 = require("sonner");
|
|
19
18
|
const chains_1 = require("viem/chains");
|
|
20
19
|
exports.OrderDetailsCollapsible = (0, react_3.memo)(function OrderDetailsCollapsible({ order, dstToken, tournament, nft, recipientName, formattedExpectedDstAmount, className, showTotal = false, totalAmount, points, }) {
|
|
21
20
|
const [showOrderDetails, setShowOrderDetails] = (0, react_3.useState)(true);
|
|
@@ -28,7 +27,7 @@ exports.OrderDetailsCollapsible = (0, react_3.memo)(function OrderDetailsCollaps
|
|
|
28
27
|
: order.payload.expectedDstAmount.toString();
|
|
29
28
|
const finalFormattedExpectedDstAmount = formattedExpectedDstAmount || (0, number_1.formatTokenAmount)(BigInt(expectedDstAmount), dstToken.decimals);
|
|
30
29
|
return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("order-details-collapsible bg-as-surface-secondary border-as-border-secondary rounded-xl border px-4 py-2", className), children: showOrderDetails ? ((0, jsx_runtime_1.jsx)(react_2.motion.div, { className: "order-details-expanded w-full", initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, children: (0, jsx_runtime_1.jsxs)("div", { className: "order-details-content flex w-full flex-col items-center gap-3 whitespace-nowrap py-2 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "order-details-recipient-section flex w-full justify-between gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-recipient-label text-as-tertiarry", children: "Recipient" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-recipient-info flex flex-col items-end gap-1", children: [recipientName && ((0, jsx_runtime_1.jsx)("div", { className: "order-details-recipient-name text-as-primary font-semibold", children: recipientName })), (0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: order.recipientAddress, onCopy: () => {
|
|
31
|
-
|
|
30
|
+
react_1.toast.success("Copied recipient address to clipboard");
|
|
32
31
|
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "order-details-recipient-address text-as-primary flex items-center gap-2", children: [(0, centerTruncate_1.default)(order.recipientAddress, 10), (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "order-details-recipient-copy-icon text-as-primary/50 hover:text-as-primary h-4 w-4 cursor-pointer transition-all duration-200" })] }) })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-divider divider w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-expected-section flex w-full items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-expected-label text-as-tertiarry", children: order.type === "swap" || order.type === "mint_nft" || order.type === "hype_duel"
|
|
33
32
|
? "Expected to receive"
|
|
34
33
|
: order.type === "join_tournament"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
interface OrderHistoryProps {
|
|
2
2
|
mode: "modal" | "page";
|
|
3
|
-
onBack
|
|
3
|
+
onBack?: () => void;
|
|
4
4
|
onSelectOrder?: (orderId: string) => void;
|
|
5
5
|
}
|
|
6
6
|
export declare function OrderHistory({ mode, onBack, onSelectOrder }: OrderHistoryProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
3
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
7
|
exports.OrderHistory = OrderHistory;
|
|
5
8
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
9
|
const react_1 = require("../../../../anyspend/react");
|
|
7
10
|
const react_2 = require("../../../../global-account/react");
|
|
11
|
+
const ModalHeader_1 = __importDefault(require("../../../../global-account/react/components/ModalHeader/ModalHeader"));
|
|
8
12
|
const lucide_react_1 = require("lucide-react");
|
|
9
13
|
const OrderHistoryItem_1 = require("./OrderHistoryItem");
|
|
10
14
|
function OrderHistory({ mode, onBack, onSelectOrder }) {
|
|
11
15
|
const { address } = (0, react_2.useAccountWallet)();
|
|
12
16
|
const { orderHistory, isLoadingOrderHistory, refetchOrderHistory } = (0, react_1.useAnyspendOrderHistory)(address);
|
|
13
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.default, { title: "Order History", showCloseButton: false, handleBack: onBack, className: "w-full", children: (0, jsx_runtime_1.jsx)(react_2.Button, { variant: "ghost", size: "icon", className: "hover:bg-as-surface-secondary", onClick: () => {
|
|
18
|
+
refetchOrderHistory();
|
|
19
|
+
}, children: (0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCcw, { className: "text-as-secondary hover:text-as-primary h-5 w-5 cursor-pointer transition-all hover:rotate-180" }) }) }), isLoadingOrderHistory ? ((0, jsx_runtime_1.jsx)("div", { className: "w-full space-y-3 px-5", children: [1, 2, 3].map(i => ((0, jsx_runtime_1.jsx)(react_2.Skeleton, { className: "h-[180px] w-full rounded-2xl" }, i))) })) : !orderHistory?.length ? ((0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary w-full rounded-2xl p-12 px-5 text-center", children: (0, jsx_runtime_1.jsx)("p", { className: "text-as-secondary text-sm", children: "No order history found" }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "mb-12 w-full px-5 pt-5", children: [...orderHistory]
|
|
16
20
|
.sort((a, b) => b.createdAt - a.createdAt)
|
|
17
21
|
.map(order => ((0, jsx_runtime_1.jsx)(OrderHistoryItem_1.OrderHistoryItem, { order: order, onSelectOrder: onSelectOrder, mode: mode }, order.id))) }))] }));
|
|
18
22
|
}
|