@b3dotfun/sdk 0.0.65-test.5 → 0.0.66
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 +69 -97
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +23 -10
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +45 -14
- package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.d.ts +11 -0
- package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.js +41 -0
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +14 -251
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +3 -5
- package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.js +1 -1
- package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
- package/dist/cjs/anyspend/react/components/common/OrderHistory.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/common/OrderHistory.js +3 -7
- package/dist/cjs/anyspend/react/components/common/OrderTokenAmount.js +2 -10
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +1 -1
- package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +1 -1
- package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +1 -1
- package/dist/cjs/anyspend/react/components/index.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/index.js +4 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +5 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +16 -10
- package/dist/cjs/anyspend/react/hooks/useAutoSelectCryptoPaymentMethod.d.ts +7 -5
- package/dist/cjs/anyspend/react/hooks/useAutoSelectCryptoPaymentMethod.js +13 -9
- package/dist/cjs/anyspend/react/hooks/useCryptoPaymentMethodState.d.ts +42 -0
- package/dist/cjs/anyspend/react/hooks/useCryptoPaymentMethodState.js +51 -0
- package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/cjs/global-account/react/components/AccountAssets/AccountAssets.js +2 -38
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +0 -1
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +35 -251
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +15 -23
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.d.ts +4 -6
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +279 -113
- package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.js +5 -6
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +193 -24
- package/dist/cjs/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +6 -0
- package/dist/cjs/global-account/react/components/ProfileEditor/ProfileEditor.js +141 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -3
- package/dist/cjs/global-account/react/components/index.d.ts +4 -5
- package/dist/cjs/global-account/react/components/index.js +9 -14
- 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 +1 -1
- package/dist/cjs/global-account/react/hooks/index.js +1 -3
- package/dist/cjs/global-account/react/hooks/useAccountWallet.d.ts +0 -1
- package/dist/cjs/global-account/react/hooks/useAccountWallet.js +0 -18
- package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +2 -2
- package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.js +0 -1
- package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +6 -14
- package/dist/cjs/global-account/react/hooks/useUserQuery.d.ts +2 -2
- package/dist/cjs/global-account/react/stores/index.d.ts +0 -1
- package/dist/cjs/global-account/react/stores/index.js +1 -3
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +26 -31
- package/dist/cjs/global-account/react/utils/profileDisplay.d.ts +0 -2
- package/dist/cjs/global-account/react/utils/profileDisplay.js +2 -2
- package/dist/cjs/shared/constants/chains/supported.d.ts +3 -3
- package/dist/cjs/shared/utils/ipfs.js +3 -10
- package/dist/esm/anyspend/react/components/AnySpend.js +70 -98
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +23 -10
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +3 -1
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +45 -14
- package/dist/esm/anyspend/react/components/AnySpendDepositUpside.d.ts +11 -0
- package/dist/esm/anyspend/react/components/AnySpendDepositUpside.js +38 -0
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +15 -249
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +6 -0
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +3 -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/OrderHistory.d.ts +1 -1
- package/dist/esm/anyspend/react/components/common/OrderHistory.js +5 -6
- package/dist/esm/anyspend/react/components/common/OrderTokenAmount.js +2 -10
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +1 -1
- package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +1 -1
- package/dist/esm/anyspend/react/components/common/RecipientSelection.js +1 -1
- package/dist/esm/anyspend/react/components/index.d.ts +1 -0
- package/dist/esm/anyspend/react/components/index.js +1 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +5 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +16 -10
- package/dist/esm/anyspend/react/hooks/useAutoSelectCryptoPaymentMethod.d.ts +7 -5
- package/dist/esm/anyspend/react/hooks/useAutoSelectCryptoPaymentMethod.js +13 -9
- package/dist/esm/anyspend/react/hooks/useCryptoPaymentMethodState.d.ts +42 -0
- package/dist/esm/anyspend/react/hooks/useCryptoPaymentMethodState.js +48 -0
- package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/esm/global-account/react/components/AccountAssets/AccountAssets.js +2 -38
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +0 -1
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +38 -254
- package/dist/esm/global-account/react/components/B3DynamicModal.js +15 -23
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.d.ts +4 -6
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +280 -113
- package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.js +5 -6
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +195 -26
- package/dist/esm/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +6 -0
- package/dist/esm/global-account/react/components/ProfileEditor/ProfileEditor.js +135 -0
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +2 -4
- package/dist/esm/global-account/react/components/index.d.ts +4 -5
- package/dist/esm/global-account/react/components/index.js +5 -9
- 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 +1 -1
- package/dist/esm/global-account/react/hooks/index.js +1 -1
- package/dist/esm/global-account/react/hooks/useAccountWallet.d.ts +0 -1
- package/dist/esm/global-account/react/hooks/useAccountWallet.js +0 -17
- package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +2 -2
- package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +0 -1
- package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +6 -14
- package/dist/esm/global-account/react/hooks/useUserQuery.d.ts +2 -2
- package/dist/esm/global-account/react/stores/index.d.ts +0 -1
- package/dist/esm/global-account/react/stores/index.js +0 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +26 -31
- package/dist/esm/global-account/react/utils/profileDisplay.d.ts +0 -2
- package/dist/esm/global-account/react/utils/profileDisplay.js +2 -2
- package/dist/esm/shared/constants/chains/supported.d.ts +3 -3
- package/dist/esm/shared/utils/ipfs.js +3 -10
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnySpendDepositUpside.d.ts +11 -0
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +1 -1
- package/dist/types/anyspend/react/components/common/CryptoPaymentMethod.d.ts +6 -0
- package/dist/types/anyspend/react/components/common/OrderHistory.d.ts +1 -1
- package/dist/types/anyspend/react/components/index.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +5 -1
- package/dist/types/anyspend/react/hooks/useAutoSelectCryptoPaymentMethod.d.ts +7 -5
- package/dist/types/anyspend/react/hooks/useCryptoPaymentMethodState.d.ts +42 -0
- package/dist/types/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/types/global-account/react/components/AvatarEditor/AvatarEditor.d.ts +0 -1
- package/dist/types/global-account/react/components/LinkAccount/LinkAccount.d.ts +4 -6
- package/dist/types/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +6 -0
- package/dist/types/global-account/react/components/index.d.ts +4 -5
- package/dist/types/global-account/react/hooks/index.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useAccountWallet.d.ts +0 -1
- package/dist/types/global-account/react/hooks/useAuthentication.d.ts +2 -2
- package/dist/types/global-account/react/hooks/useUserQuery.d.ts +2 -2
- package/dist/types/global-account/react/stores/index.d.ts +0 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +26 -31
- package/dist/types/global-account/react/utils/profileDisplay.d.ts +0 -2
- package/dist/types/shared/constants/chains/supported.d.ts +3 -3
- package/package.json +1 -2
- package/src/anyspend/react/components/AnySpend.tsx +218 -256
- package/src/anyspend/react/components/AnySpendCustom.tsx +31 -16
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +56 -13
- package/src/anyspend/react/components/AnySpendDepositUpside.tsx +81 -0
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +36 -524
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +14 -7
- package/src/anyspend/react/components/common/FeeDetailPanel.tsx +1 -1
- package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +2 -2
- package/src/anyspend/react/components/common/OrderHistory.tsx +13 -8
- package/src/anyspend/react/components/common/OrderTokenAmount.tsx +2 -13
- package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +1 -1
- package/src/anyspend/react/components/common/PointsDetailPanel.tsx +1 -1
- package/src/anyspend/react/components/common/RecipientSelection.tsx +1 -1
- package/src/anyspend/react/components/index.ts +1 -0
- package/src/anyspend/react/hooks/useAnyspendFlow.ts +24 -12
- package/src/anyspend/react/hooks/useAutoSelectCryptoPaymentMethod.ts +20 -12
- package/src/anyspend/react/hooks/useCryptoPaymentMethodState.ts +71 -0
- package/src/global-account/react/components/AccountAssets/AccountAssets.tsx +25 -115
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +128 -477
- package/src/global-account/react/components/B3DynamicModal.tsx +17 -28
- package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +433 -332
- package/src/global-account/react/components/ManageAccount/BalanceContent.tsx +10 -6
- package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +589 -73
- package/src/global-account/react/components/ProfileEditor/ProfileEditor.tsx +265 -0
- package/src/global-account/react/components/SignInWithB3/SignIn.tsx +7 -11
- package/src/global-account/react/components/index.ts +5 -11
- package/src/global-account/react/components/ui/Tabs.tsx +13 -5
- package/src/global-account/react/components/ui/dialog.tsx +14 -32
- package/src/global-account/react/components/ui/drawer.tsx +1 -1
- package/src/global-account/react/hooks/index.ts +0 -3
- package/src/global-account/react/hooks/useAccountWallet.tsx +0 -26
- package/src/global-account/react/hooks/useB3BalanceFromAddresses.ts +0 -1
- package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +6 -12
- package/src/global-account/react/stores/index.ts +0 -1
- package/src/global-account/react/stores/useModalStore.ts +28 -35
- package/src/global-account/react/utils/profileDisplay.ts +2 -4
- package/src/shared/utils/ipfs.ts +3 -10
- package/src/styles/index.css +9 -6
- package/dist/cjs/global-account/react/components/Deposit/Deposit.d.ts +0 -1
- package/dist/cjs/global-account/react/components/Deposit/Deposit.js +0 -65
- package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +0 -39
- package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +0 -37
- package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +0 -4
- package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.js +0 -331
- package/dist/cjs/global-account/react/components/ManageAccount/AppsContent.d.ts +0 -6
- package/dist/cjs/global-account/react/components/ManageAccount/AppsContent.js +0 -34
- package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.d.ts +0 -2
- package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.js +0 -23
- package/dist/cjs/global-account/react/components/ManageAccount/Header.d.ts +0 -3
- package/dist/cjs/global-account/react/components/ManageAccount/Header.js +0 -120
- package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.d.ts +0 -5
- package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.js +0 -43
- package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.d.ts +0 -6
- package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.js +0 -16
- package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.d.ts +0 -2
- package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.js +0 -15
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.d.ts +0 -2
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +0 -47
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.d.ts +0 -7
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +0 -50
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +0 -9
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.js +0 -8
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +0 -2
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +0 -106
- package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.d.ts +0 -2
- package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.js +0 -22
- package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.d.ts +0 -11
- package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.js +0 -12
- package/dist/cjs/global-account/react/components/Send/Send.d.ts +0 -5
- package/dist/cjs/global-account/react/components/Send/Send.js +0 -187
- package/dist/cjs/global-account/react/components/icons/BellIcon.d.ts +0 -3
- package/dist/cjs/global-account/react/components/icons/BellIcon.js +0 -5
- package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.d.ts +0 -2
- package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.js +0 -7
- package/dist/cjs/global-account/react/components/icons/CopyIcon.d.ts +0 -2
- package/dist/cjs/global-account/react/components/icons/CopyIcon.js +0 -7
- package/dist/cjs/global-account/react/components/icons/LinkIcon.d.ts +0 -3
- package/dist/cjs/global-account/react/components/icons/LinkIcon.js +0 -5
- package/dist/cjs/global-account/react/components/icons/LockIcon.d.ts +0 -3
- package/dist/cjs/global-account/react/components/icons/LockIcon.js +0 -5
- package/dist/cjs/global-account/react/components/icons/WalletIcon.d.ts +0 -2
- package/dist/cjs/global-account/react/components/icons/WalletIcon.js +0 -7
- package/dist/cjs/global-account/react/stores/useRecentAddressesStore.d.ts +0 -25
- package/dist/cjs/global-account/react/stores/useRecentAddressesStore.js +0 -36
- package/dist/esm/global-account/react/components/Deposit/Deposit.d.ts +0 -1
- package/dist/esm/global-account/react/components/Deposit/Deposit.js +0 -59
- package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +0 -39
- package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +0 -34
- package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +0 -4
- package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.js +0 -325
- package/dist/esm/global-account/react/components/ManageAccount/AppsContent.d.ts +0 -6
- package/dist/esm/global-account/react/components/ManageAccount/AppsContent.js +0 -32
- package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.d.ts +0 -2
- package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.js +0 -21
- package/dist/esm/global-account/react/components/ManageAccount/Header.d.ts +0 -3
- package/dist/esm/global-account/react/components/ManageAccount/Header.js +0 -81
- package/dist/esm/global-account/react/components/ManageAccount/HomeActions.d.ts +0 -5
- package/dist/esm/global-account/react/components/ManageAccount/HomeActions.js +0 -41
- package/dist/esm/global-account/react/components/ManageAccount/HomeContent.d.ts +0 -6
- package/dist/esm/global-account/react/components/ManageAccount/HomeContent.js +0 -10
- package/dist/esm/global-account/react/components/ManageAccount/NFTContent.d.ts +0 -2
- package/dist/esm/global-account/react/components/ManageAccount/NFTContent.js +0 -13
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.d.ts +0 -2
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +0 -45
- package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.d.ts +0 -7
- package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +0 -45
- package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +0 -9
- package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.js +0 -6
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +0 -2
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +0 -101
- package/dist/esm/global-account/react/components/ManageAccount/TokenContent.d.ts +0 -2
- package/dist/esm/global-account/react/components/ManageAccount/TokenContent.js +0 -20
- package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.d.ts +0 -11
- package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.js +0 -10
- package/dist/esm/global-account/react/components/Send/Send.d.ts +0 -5
- package/dist/esm/global-account/react/components/Send/Send.js +0 -181
- package/dist/esm/global-account/react/components/icons/BellIcon.d.ts +0 -3
- package/dist/esm/global-account/react/components/icons/BellIcon.js +0 -3
- package/dist/esm/global-account/react/components/icons/ChevronDownIcon.d.ts +0 -2
- package/dist/esm/global-account/react/components/icons/ChevronDownIcon.js +0 -4
- package/dist/esm/global-account/react/components/icons/CopyIcon.d.ts +0 -2
- package/dist/esm/global-account/react/components/icons/CopyIcon.js +0 -4
- package/dist/esm/global-account/react/components/icons/LinkIcon.d.ts +0 -3
- package/dist/esm/global-account/react/components/icons/LinkIcon.js +0 -3
- package/dist/esm/global-account/react/components/icons/LockIcon.d.ts +0 -3
- package/dist/esm/global-account/react/components/icons/LockIcon.js +0 -3
- package/dist/esm/global-account/react/components/icons/WalletIcon.d.ts +0 -2
- package/dist/esm/global-account/react/components/icons/WalletIcon.js +0 -4
- package/dist/esm/global-account/react/stores/useRecentAddressesStore.d.ts +0 -25
- package/dist/esm/global-account/react/stores/useRecentAddressesStore.js +0 -33
- package/dist/types/global-account/react/components/Deposit/Deposit.d.ts +0 -1
- package/dist/types/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +0 -39
- package/dist/types/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +0 -4
- package/dist/types/global-account/react/components/ManageAccount/AppsContent.d.ts +0 -6
- package/dist/types/global-account/react/components/ManageAccount/BottomNavigation.d.ts +0 -2
- package/dist/types/global-account/react/components/ManageAccount/Header.d.ts +0 -3
- package/dist/types/global-account/react/components/ManageAccount/HomeActions.d.ts +0 -5
- package/dist/types/global-account/react/components/ManageAccount/HomeContent.d.ts +0 -6
- package/dist/types/global-account/react/components/ManageAccount/NFTContent.d.ts +0 -2
- package/dist/types/global-account/react/components/ManageAccount/ProfileSection.d.ts +0 -2
- package/dist/types/global-account/react/components/ManageAccount/SettingsContent.d.ts +0 -7
- package/dist/types/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +0 -9
- package/dist/types/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +0 -2
- package/dist/types/global-account/react/components/ManageAccount/TokenContent.d.ts +0 -2
- package/dist/types/global-account/react/components/ModalHeader/ModalHeader.d.ts +0 -11
- package/dist/types/global-account/react/components/Send/Send.d.ts +0 -5
- package/dist/types/global-account/react/components/icons/BellIcon.d.ts +0 -3
- package/dist/types/global-account/react/components/icons/ChevronDownIcon.d.ts +0 -2
- package/dist/types/global-account/react/components/icons/CopyIcon.d.ts +0 -2
- package/dist/types/global-account/react/components/icons/LinkIcon.d.ts +0 -3
- package/dist/types/global-account/react/components/icons/LockIcon.d.ts +0 -3
- package/dist/types/global-account/react/components/icons/WalletIcon.d.ts +0 -2
- package/dist/types/global-account/react/stores/useRecentAddressesStore.d.ts +0 -25
- package/src/global-account/react/components/Deposit/Deposit.tsx +0 -211
- package/src/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.tsx +0 -84
- package/src/global-account/react/components/LinkAccount/LinkNewAccount.tsx +0 -490
- package/src/global-account/react/components/ManageAccount/AppsContent.tsx +0 -79
- package/src/global-account/react/components/ManageAccount/BottomNavigation.tsx +0 -83
- package/src/global-account/react/components/ManageAccount/Header.tsx +0 -230
- package/src/global-account/react/components/ManageAccount/HomeActions.tsx +0 -118
- package/src/global-account/react/components/ManageAccount/HomeContent.tsx +0 -42
- package/src/global-account/react/components/ManageAccount/NFTContent.tsx +0 -24
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +0 -79
- package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +0 -87
- package/src/global-account/react/components/ManageAccount/SettingsMenuItem.tsx +0 -31
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +0 -182
- package/src/global-account/react/components/ManageAccount/TokenContent.tsx +0 -41
- package/src/global-account/react/components/ModalHeader/ModalHeader.tsx +0 -61
- package/src/global-account/react/components/Send/Send.tsx +0 -585
- package/src/global-account/react/components/icons/BellIcon.tsx +0 -15
- package/src/global-account/react/components/icons/ChevronDownIcon.tsx +0 -17
- package/src/global-account/react/components/icons/CopyIcon.tsx +0 -22
- package/src/global-account/react/components/icons/LinkIcon.tsx +0 -15
- package/src/global-account/react/components/icons/LockIcon.tsx +0 -15
- package/src/global-account/react/components/icons/WalletIcon.tsx +0 -21
- package/src/global-account/react/stores/useRecentAddressesStore.ts +0 -55
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.HomeContent = HomeContent;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const Tabs_1 = require("../ui/Tabs");
|
|
9
|
-
const Header_1 = require("./Header");
|
|
10
|
-
const HomeActions_1 = __importDefault(require("./HomeActions"));
|
|
11
|
-
const NFTContent_1 = __importDefault(require("./NFTContent"));
|
|
12
|
-
const ProfileSection_1 = __importDefault(require("./ProfileSection"));
|
|
13
|
-
const TokenContent_1 = __importDefault(require("./TokenContent"));
|
|
14
|
-
function HomeContent({ showDeposit = false, showSwap = true }) {
|
|
15
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col", children: [(0, jsx_runtime_1.jsx)(Header_1.Header, {}), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col", children: [(0, jsx_runtime_1.jsx)(ProfileSection_1.default, {}), (0, jsx_runtime_1.jsx)(HomeActions_1.default, { showDeposit: showDeposit, showSwap: showSwap }), (0, jsx_runtime_1.jsx)("div", { className: "b3-modal-balance-content space-y-2 p-5", children: (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { defaultValue: "balance", children: [(0, jsx_runtime_1.jsxs)(Tabs_1.TabsList, { className: "b3-modal-balance-tabs-list", children: [(0, jsx_runtime_1.jsx)(Tabs_1.TabTrigger, { value: "balance", className: "font-neue-montreal-semibold p-0 pr-3", children: "Balance" }), (0, jsx_runtime_1.jsx)(Tabs_1.TabTrigger, { value: "nfts", className: "font-neue-montreal-semibold p-0 pr-3", children: "NFTs" })] }), (0, jsx_runtime_1.jsx)(Tabs_1.TabsContent, { value: "balance", className: "px-0 pb-4 pt-2", children: (0, jsx_runtime_1.jsx)(TokenContent_1.default, {}) }), (0, jsx_runtime_1.jsx)(Tabs_1.TabsContent, { value: "nfts", className: "px-0 pb-4 pt-2", children: (0, jsx_runtime_1.jsx)(NFTContent_1.default, {}) })] }) })] })] }));
|
|
16
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("thirdweb/react");
|
|
5
|
-
const __1 = require("..");
|
|
6
|
-
const hooks_1 = require("../../hooks");
|
|
7
|
-
const NFTContent = () => {
|
|
8
|
-
// Get active wallet state
|
|
9
|
-
const activeWallet = (0, react_1.useActiveWallet)();
|
|
10
|
-
const activeAccount = activeWallet?.getAccount();
|
|
11
|
-
const activeAddress = activeAccount?.address;
|
|
12
|
-
const { data: nfts, isLoading } = (0, hooks_1.useAccountAssets)(activeAddress);
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: { minHeight: "100px" }, children: nfts?.nftResponse ? ((0, jsx_runtime_1.jsx)(__1.AccountAssets, { nfts: nfts.nftResponse, isLoading: isLoading })) : ((0, jsx_runtime_1.jsx)("div", { className: "py-12 text-center text-gray-500", children: "No NFTs found" })) }));
|
|
14
|
-
};
|
|
15
|
-
exports.default = NFTContent;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("../../../../global-account/react");
|
|
5
|
-
const utils_1 = require("../../../../shared/utils");
|
|
6
|
-
const number_1 = require("../../../../shared/utils/number");
|
|
7
|
-
const lucide_react_1 = require("lucide-react");
|
|
8
|
-
const react_2 = require("react");
|
|
9
|
-
const react_3 = require("thirdweb/react");
|
|
10
|
-
const useFirstEOA_1 = require("../../hooks/useFirstEOA");
|
|
11
|
-
const IPFSMediaRenderer_1 = require("../IPFSMediaRenderer/IPFSMediaRenderer");
|
|
12
|
-
const ProfileSection = () => {
|
|
13
|
-
const account = (0, react_3.useActiveAccount)();
|
|
14
|
-
const { address: eoaAddress } = (0, useFirstEOA_1.useFirstEOA)();
|
|
15
|
-
const { address: smartWalletAddress } = (0, react_1.useAccountWallet)();
|
|
16
|
-
const { data: profile } = (0, react_1.useProfile)({
|
|
17
|
-
address: eoaAddress || account?.address,
|
|
18
|
-
fresh: true,
|
|
19
|
-
});
|
|
20
|
-
const { user } = (0, react_1.useB3)();
|
|
21
|
-
const setB3ModalOpen = (0, react_1.useModalStore)(state => state.setB3ModalOpen);
|
|
22
|
-
const setB3ModalContentType = (0, react_1.useModalStore)(state => state.setB3ModalContentType);
|
|
23
|
-
const navigateBack = (0, react_1.useModalStore)(state => state.navigateBack);
|
|
24
|
-
const { data: simBalance } = (0, react_1.useSimBalance)(smartWalletAddress);
|
|
25
|
-
// Calculate total balance in USD
|
|
26
|
-
const totalBalanceUsd = (0, react_2.useMemo)(() => {
|
|
27
|
-
if (!simBalance?.balances)
|
|
28
|
-
return 0;
|
|
29
|
-
return simBalance.balances.reduce((sum, token) => sum + (token.value_usd || 0), 0);
|
|
30
|
-
}, [simBalance]);
|
|
31
|
-
const handleEditAvatar = () => {
|
|
32
|
-
setB3ModalOpen(true);
|
|
33
|
-
setB3ModalContentType({
|
|
34
|
-
type: "avatarEditor",
|
|
35
|
-
onSuccess: () => {
|
|
36
|
-
// navigate back on success
|
|
37
|
-
navigateBack();
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
// IPFSMediaRenderer will handle IPFS URL conversion and validation
|
|
42
|
-
const avatarSrc = user?.avatar || profile?.avatar;
|
|
43
|
-
// Get current username - prioritize user.username, fallback to profile data
|
|
44
|
-
const currentUsername = user?.username || profile?.displayName || (0, utils_1.formatUsername)(profile?.name || "");
|
|
45
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between px-5 py-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile flex items-center gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile-avatar relative", children: [(0, jsx_runtime_1.jsx)(IPFSMediaRenderer_1.IPFSMediaRenderer, { src: avatarSrc, alt: "Profile Avatar", className: "border-b3-line border-1 bg-b3-primary-wash size-14 rounded-full border" }), (0, jsx_runtime_1.jsx)("button", { onClick: handleEditAvatar, className: "border-b3-background hover:bg-b3-grey/80 absolute -bottom-1 -right-1 flex size-6 items-center justify-center rounded-full border-4 bg-[#a0a0ab] transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Pencil, { size: 10, className: "text-b3-background" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile-info flex flex-col gap-1", children: [(0, jsx_runtime_1.jsxs)("h2", { className: "text-b3-grey font-neue-montreal-semibold flex h-[38px] items-center gap-1 text-xl", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-b3-foreground-muted", children: " $" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[30px]", children: (0, number_1.formatDisplayNumber)(totalBalanceUsd, { fractionDigits: 2 }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "b3-modal-username font-neue-montreal-semibold text-base leading-none text-[#0B57C2]", children: currentUsername })] })] }) }));
|
|
46
|
-
};
|
|
47
|
-
exports.default = ProfileSection;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const react_1 = require("../../../../global-account/react");
|
|
8
|
-
const LinkIcon_1 = __importDefault(require("../icons/LinkIcon"));
|
|
9
|
-
const ModalHeader_1 = __importDefault(require("../ModalHeader/ModalHeader"));
|
|
10
|
-
const SettingsMenuItem_1 = __importDefault(require("./SettingsMenuItem"));
|
|
11
|
-
const SettingsProfileCard_1 = __importDefault(require("./SettingsProfileCard"));
|
|
12
|
-
const SettingsContent = ({ partnerId, onLogout, chain, }) => {
|
|
13
|
-
const setB3ModalContentType = (0, react_1.useModalStore)(state => state.setB3ModalContentType);
|
|
14
|
-
const setB3ModalOpen = (0, react_1.useModalStore)(state => state.setB3ModalOpen);
|
|
15
|
-
const handleNavigate = (type) => {
|
|
16
|
-
if (type === "home") {
|
|
17
|
-
setB3ModalContentType({
|
|
18
|
-
type: "manageAccount",
|
|
19
|
-
chain,
|
|
20
|
-
partnerId,
|
|
21
|
-
onLogout,
|
|
22
|
-
activeTab: "home",
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
else if (type === "swap") {
|
|
26
|
-
setB3ModalContentType({
|
|
27
|
-
type: "manageAccount",
|
|
28
|
-
chain,
|
|
29
|
-
partnerId,
|
|
30
|
-
onLogout,
|
|
31
|
-
activeTab: "tokens",
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
else if (type === "linkAccount") {
|
|
35
|
-
setB3ModalContentType({
|
|
36
|
-
type: "linkAccount",
|
|
37
|
-
chain,
|
|
38
|
-
partnerId,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
setB3ModalContentType({
|
|
43
|
-
type: "avatarEditor",
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
setB3ModalOpen(true);
|
|
47
|
-
};
|
|
48
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex h-[470px] flex-col", children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.default, { showBackButton: false, showCloseButton: false, title: "Settings" }), (0, jsx_runtime_1.jsx)("div", { className: "p-5", children: (0, jsx_runtime_1.jsx)("div", { className: "b3-modal-settings-profile-card flex items-center rounded-xl border border-[#e4e4e7] bg-[#f4f4f5] p-4", children: (0, jsx_runtime_1.jsx)(SettingsProfileCard_1.default, {}) }) }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-3 px-5", children: (0, jsx_runtime_1.jsx)(SettingsMenuItem_1.default, { icon: (0, jsx_runtime_1.jsx)(LinkIcon_1.default, { className: "text-b3-grey-500" }), title: "Linked Accounts", subtitle: "3 connected accounts", onClick: () => handleNavigate("linkAccount") }) })] }));
|
|
49
|
-
};
|
|
50
|
-
exports.default = SettingsContent;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
interface SettingsMenuItemProps {
|
|
3
|
-
icon: ReactNode;
|
|
4
|
-
title: string;
|
|
5
|
-
subtitle: string;
|
|
6
|
-
onClick?: () => void;
|
|
7
|
-
}
|
|
8
|
-
declare const SettingsMenuItem: ({ icon, title, subtitle, onClick }: SettingsMenuItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export default SettingsMenuItem;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const lucide_react_1 = require("lucide-react");
|
|
5
|
-
const SettingsMenuItem = ({ icon, title, subtitle, onClick }) => {
|
|
6
|
-
return ((0, jsx_runtime_1.jsxs)("button", { onClick: onClick, className: "b3-modal-settings-menu-item flex w-full items-center gap-2 rounded-xl px-3 py-2 transition-colors hover:bg-[#f4f4f5]", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex size-10 items-center justify-center rounded-full bg-[#f4f4f5]", children: icon }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-1 flex-col items-start gap-1 text-left", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-neue-montreal-semibold text-[14px] leading-none tracking-[-0.28px] text-[#3f3f46]", children: title }), (0, jsx_runtime_1.jsx)("span", { className: "font-neue-montreal-medium text-[14px] leading-none tracking-[-0.28px] text-[#70707b]", children: subtitle })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { size: 20, className: "text-[#51525c]" })] }));
|
|
7
|
-
};
|
|
8
|
-
exports.default = SettingsMenuItem;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const app_1 = __importDefault(require("../../../../global-account/app"));
|
|
8
|
-
const react_1 = require("../../../../global-account/react");
|
|
9
|
-
const utils_1 = require("../../../../shared/utils");
|
|
10
|
-
const lucide_react_1 = require("lucide-react");
|
|
11
|
-
const react_2 = require("react");
|
|
12
|
-
const sonner_1 = require("sonner");
|
|
13
|
-
const react_3 = require("thirdweb/react");
|
|
14
|
-
const useFirstEOA_1 = require("../../hooks/useFirstEOA");
|
|
15
|
-
const IPFSMediaRenderer_1 = require("../IPFSMediaRenderer/IPFSMediaRenderer");
|
|
16
|
-
const SettingsProfileCard = () => {
|
|
17
|
-
const account = (0, react_3.useActiveAccount)();
|
|
18
|
-
const { address: eoaAddress } = (0, useFirstEOA_1.useFirstEOA)();
|
|
19
|
-
const { data: profile, refetch: refreshProfile } = (0, react_1.useProfile)({
|
|
20
|
-
address: eoaAddress || account?.address,
|
|
21
|
-
fresh: true,
|
|
22
|
-
});
|
|
23
|
-
const { user, setUser } = (0, react_1.useB3)();
|
|
24
|
-
const setB3ModalOpen = (0, react_1.useModalStore)(state => state.setB3ModalOpen);
|
|
25
|
-
const setB3ModalContentType = (0, react_1.useModalStore)(state => state.setB3ModalContentType);
|
|
26
|
-
const navigateBack = (0, react_1.useModalStore)(state => state.navigateBack);
|
|
27
|
-
// State for inline username editing
|
|
28
|
-
const [isEditingUsername, setIsEditingUsername] = (0, react_2.useState)(false);
|
|
29
|
-
const [editedUsername, setEditedUsername] = (0, react_2.useState)("");
|
|
30
|
-
const [isSaving, setIsSaving] = (0, react_2.useState)(false);
|
|
31
|
-
const inputRef = (0, react_2.useRef)(null);
|
|
32
|
-
// IPFSMediaRenderer will handle IPFS URL conversion and validation
|
|
33
|
-
const avatarSrc = user?.avatar || profile?.avatar;
|
|
34
|
-
// Get current username - prioritize user.username, fallback to profile data
|
|
35
|
-
const currentUsername = user?.username || profile?.displayName || (0, utils_1.formatUsername)(profile?.name || "");
|
|
36
|
-
// Focus input when entering edit mode
|
|
37
|
-
(0, react_2.useEffect)(() => {
|
|
38
|
-
if (isEditingUsername && inputRef.current) {
|
|
39
|
-
inputRef.current.focus();
|
|
40
|
-
inputRef.current.select();
|
|
41
|
-
}
|
|
42
|
-
}, [isEditingUsername]);
|
|
43
|
-
const handleEditAvatar = () => {
|
|
44
|
-
setB3ModalOpen(true);
|
|
45
|
-
setB3ModalContentType({
|
|
46
|
-
type: "avatarEditor",
|
|
47
|
-
onSuccess: () => {
|
|
48
|
-
// navigate back on success
|
|
49
|
-
navigateBack();
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
const handleEditUsername = () => {
|
|
54
|
-
setEditedUsername(currentUsername || "");
|
|
55
|
-
setIsEditingUsername(true);
|
|
56
|
-
};
|
|
57
|
-
const handleCancelEdit = () => {
|
|
58
|
-
setIsEditingUsername(false);
|
|
59
|
-
setEditedUsername("");
|
|
60
|
-
};
|
|
61
|
-
const handleSaveUsername = async () => {
|
|
62
|
-
if (!editedUsername.trim()) {
|
|
63
|
-
sonner_1.toast.error("Username cannot be empty");
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
if (editedUsername === currentUsername) {
|
|
67
|
-
// No change, just exit edit mode
|
|
68
|
-
handleCancelEdit();
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
setIsSaving(true);
|
|
72
|
-
try {
|
|
73
|
-
const updatedUser = await app_1.default.service("users").registerUsername({ username: editedUsername.trim() },
|
|
74
|
-
// @ts-expect-error - our typed client is expecting context even though it's set elsewhere
|
|
75
|
-
{});
|
|
76
|
-
// Update user state - registerUsername returns an array with single user
|
|
77
|
-
setUser(Array.isArray(updatedUser) ? updatedUser[0] : updatedUser);
|
|
78
|
-
// Refresh profile to get updated data
|
|
79
|
-
await refreshProfile();
|
|
80
|
-
sonner_1.toast.success("Username updated successfully!");
|
|
81
|
-
setIsEditingUsername(false);
|
|
82
|
-
setEditedUsername("");
|
|
83
|
-
}
|
|
84
|
-
catch (error) {
|
|
85
|
-
console.error("Error updating username:", error);
|
|
86
|
-
sonner_1.toast.error("Failed to update username. Please try again.");
|
|
87
|
-
}
|
|
88
|
-
finally {
|
|
89
|
-
setIsSaving(false);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
const handleKeyDown = (e) => {
|
|
93
|
-
if (e.key === "Enter") {
|
|
94
|
-
handleSaveUsername();
|
|
95
|
-
}
|
|
96
|
-
else if (e.key === "Escape") {
|
|
97
|
-
handleCancelEdit();
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex w-full items-center gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative shrink-0", children: [(0, jsx_runtime_1.jsx)(IPFSMediaRenderer_1.IPFSMediaRenderer, { src: avatarSrc, alt: "Profile", className: "border-black/8 size-14 rounded-full border object-cover" }), (0, jsx_runtime_1.jsx)("button", { onClick: handleEditAvatar, className: "absolute -bottom-0.5 -right-0.5 flex size-[18px] items-center justify-center rounded-full border-[1.5px] border-white bg-[#a0a0ab] transition-colors hover:bg-[#a0a0ab]/80", "aria-label": "Edit avatar", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Pencil, { size: 10, className: "text-white", strokeWidth: 2.5 }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex shrink-0 flex-col gap-1", children: isEditingUsername ? (
|
|
101
|
-
/* Edit mode - inline input */
|
|
102
|
-
(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, type: "text", value: editedUsername, onChange: e => setEditedUsername(e.target.value), onKeyDown: handleKeyDown, disabled: isSaving, className: "border-b3-line bg-b3-background text-b3-grey placeholder:text-b3-foreground-muted font-neue-montreal-semibold focus:border-b3-primary-blue w-full rounded-md border px-2 py-1 text-lg leading-none transition-colors focus:outline-none disabled:opacity-50", placeholder: "Enter username" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1", children: [(0, jsx_runtime_1.jsx)("button", { onClick: handleSaveUsername, disabled: isSaving, className: "text-b3-primary-blue hover:text-b3-primary-blue/80 flex items-center justify-center rounded-md p-1 transition-colors disabled:opacity-50", "aria-label": "Save username", children: isSaving ? (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { size: 18, className: "animate-spin" }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Check, { size: 18, strokeWidth: 2.5 }) }), (0, jsx_runtime_1.jsx)("button", { onClick: handleCancelEdit, disabled: isSaving, className: "text-b3-foreground-muted hover:text-b3-grey flex items-center justify-center rounded-md p-1 transition-colors disabled:opacity-50", "aria-label": "Cancel editing", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { size: 18, strokeWidth: 2.5 }) })] })] })) : (
|
|
103
|
-
/* Display mode */
|
|
104
|
-
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1", children: (0, jsx_runtime_1.jsx)("p", { className: "b3-modal-username font-neue-montreal-semibold text-lg leading-none text-[#0B57C2]", children: currentUsername }) }), (0, jsx_runtime_1.jsx)("button", { onClick: handleEditUsername, className: "flex items-center justify-center gap-1 text-left transition-opacity hover:opacity-80", children: (0, jsx_runtime_1.jsx)("p", { className: "font-inter text-sm font-semibold leading-5 text-[#51525C]", children: "Edit Username" }) })] })) })] }));
|
|
105
|
-
};
|
|
106
|
-
exports.default = SettingsProfileCard;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("../../../../global-account/react");
|
|
5
|
-
const react_2 = require("thirdweb/react");
|
|
6
|
-
const TokenIcon_1 = require("../TokenIcon");
|
|
7
|
-
const TokenBalanceRow_1 = require("./TokenBalanceRow");
|
|
8
|
-
const TokenContent = () => {
|
|
9
|
-
// Get active wallet state
|
|
10
|
-
const activeWallet = (0, react_2.useActiveWallet)();
|
|
11
|
-
//const globalAccountWallet = useGlobalWalletState(state => state.globalAccountWallet);
|
|
12
|
-
const activeAccount = activeWallet?.getAccount();
|
|
13
|
-
const activeAddress = activeAccount?.address;
|
|
14
|
-
// Balance data fetching - use active wallet address
|
|
15
|
-
const { data: activeNativeBalance } = (0, react_1.useNativeBalance)(activeAddress);
|
|
16
|
-
const { data: activeB3Balance } = (0, react_1.useB3BalanceFromAddresses)(activeAddress);
|
|
17
|
-
if (!activeAddress) {
|
|
18
|
-
return (0, jsx_runtime_1.jsx)("div", { className: "col-span-3 py-12 text-center text-gray-500", children: "No tokens found" });
|
|
19
|
-
}
|
|
20
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-3", children: [(0, jsx_runtime_1.jsx)(TokenBalanceRow_1.TokenBalanceRow, { icon: (0, jsx_runtime_1.jsx)(TokenIcon_1.B3TokenIcon, { className: "size-10" }), name: "B3", balance: `${activeB3Balance?.formattedTotal || "0.00"} B3`, usdValue: activeB3Balance?.balanceUsdFormatted || "0.00", priceChange: activeB3Balance?.priceChange24h }), (0, jsx_runtime_1.jsx)(TokenBalanceRow_1.TokenBalanceRow, { icon: (0, jsx_runtime_1.jsx)(TokenIcon_1.EthereumTokenIcon, { className: "size-10" }), name: "Ethereum", balance: `${activeNativeBalance?.formattedTotal || "0.00"} ETH`, usdValue: activeNativeBalance?.formattedTotalUsd || "0.00", priceChange: activeNativeBalance?.priceChange24h })] }));
|
|
21
|
-
};
|
|
22
|
-
exports.default = TokenContent;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare const ModalHeader: ({ showBackButton, handleBack, handleClose, title, children, showCloseButton, className, showBackWord, }: {
|
|
2
|
-
showBackButton?: boolean;
|
|
3
|
-
handleBack?: () => void;
|
|
4
|
-
handleClose?: () => void;
|
|
5
|
-
title: string;
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
showCloseButton?: boolean;
|
|
8
|
-
className?: string;
|
|
9
|
-
showBackWord?: boolean;
|
|
10
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default ModalHeader;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const utils_1 = require("../../../../shared/utils");
|
|
5
|
-
const lucide_react_1 = require("lucide-react");
|
|
6
|
-
const stores_1 = require("../../stores");
|
|
7
|
-
const ModalHeader = ({ showBackButton = true, handleBack, handleClose, title, children, showCloseButton = true, className, showBackWord = false, }) => {
|
|
8
|
-
const navigateBack = (0, stores_1.useModalStore)(state => state.navigateBack);
|
|
9
|
-
const setB3ModalOpen = (0, stores_1.useModalStore)(state => state.setB3ModalOpen);
|
|
10
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("b3-modal-header flex h-16 items-center justify-between border-b border-[#e4e4e7] bg-white px-5 py-3", className), children: [showBackButton ? ((0, jsx_runtime_1.jsxs)("button", { onClick: handleBack || navigateBack, className: "flex h-6 w-6 items-center justify-center transition-opacity hover:opacity-70", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-6 w-6 text-[#51525c]" }), showBackWord && (0, jsx_runtime_1.jsx)("span", { className: "text-sm font-medium", children: "Back" })] })) : ((0, jsx_runtime_1.jsx)("div", { className: "w-2" })), (0, jsx_runtime_1.jsx)("p", { className: "font-inter text-lg font-semibold leading-7 text-[#18181b]", children: title }), showCloseButton ? ((0, jsx_runtime_1.jsx)("button", { onClick: handleClose || (() => setB3ModalOpen(false)), className: "flex h-6 w-6 items-center justify-center transition-opacity hover:opacity-70", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-6 w-6 text-[#51525c]" }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "w-2" })), children] }));
|
|
11
|
-
};
|
|
12
|
-
exports.default = ModalHeader;
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Send = Send;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const anyspend_1 = require("../../../../anyspend");
|
|
9
|
-
const ChainTokenIcon_1 = require("../../../../anyspend/react/components/common/ChainTokenIcon");
|
|
10
|
-
const react_1 = require("../../../../global-account/react");
|
|
11
|
-
const number_1 = require("../../../../shared/utils/number");
|
|
12
|
-
const invariant_1 = __importDefault(require("invariant"));
|
|
13
|
-
const lucide_react_1 = require("lucide-react");
|
|
14
|
-
const react_2 = require("react");
|
|
15
|
-
const react_number_format_1 = require("react-number-format");
|
|
16
|
-
const sonner_1 = require("sonner");
|
|
17
|
-
const viem_1 = require("viem");
|
|
18
|
-
const useRecentAddressesStore_1 = require("../../stores/useRecentAddressesStore");
|
|
19
|
-
const ModalHeader_1 = __importDefault(require("../ModalHeader/ModalHeader"));
|
|
20
|
-
const button_1 = require("../ui/button");
|
|
21
|
-
function Send({ recipientAddress: initialRecipient, onSuccess }) {
|
|
22
|
-
const { address } = (0, react_1.useAccountWallet)();
|
|
23
|
-
const navigateBack = (0, react_1.useModalStore)(state => state.navigateBack);
|
|
24
|
-
const setB3ModalOpen = (0, react_1.useModalStore)(state => state.setB3ModalOpen);
|
|
25
|
-
// Wizard state
|
|
26
|
-
const [step, setStep] = (0, react_2.useState)("recipient");
|
|
27
|
-
const [selectedToken, setSelectedToken] = (0, react_2.useState)(null);
|
|
28
|
-
const [recipientAddress, setRecipientAddress] = (0, react_2.useState)(initialRecipient || "");
|
|
29
|
-
const [sendAmount, setSendAmount] = (0, react_2.useState)("");
|
|
30
|
-
const [isSending, setIsSending] = (0, react_2.useState)(false);
|
|
31
|
-
const [addressError, setAddressError] = (0, react_2.useState)("");
|
|
32
|
-
const [showValidatedResult, setShowValidatedResult] = (0, react_2.useState)(false);
|
|
33
|
-
// Hooks
|
|
34
|
-
const { data: simBalance, refetch: refetchSimBalance, isLoading: isLoadingBalance } = (0, react_1.useSimBalance)(address);
|
|
35
|
-
const { switchChainAndExecute } = (0, react_1.useUnifiedChainSwitchAndExecute)();
|
|
36
|
-
const { sendAnalyticsEvent } = (0, react_1.useAnalytics)();
|
|
37
|
-
// Recent addresses store
|
|
38
|
-
const recentAddresses = (0, useRecentAddressesStore_1.useRecentAddressesStore)(state => state.recentAddresses);
|
|
39
|
-
const addRecentAddress = (0, useRecentAddressesStore_1.useRecentAddressesStore)(state => state.addRecentAddress);
|
|
40
|
-
// Address validation
|
|
41
|
-
const handleRecipientAddressChange = (value) => {
|
|
42
|
-
setRecipientAddress(value);
|
|
43
|
-
setShowValidatedResult(false);
|
|
44
|
-
if (value && !(0, viem_1.isAddress)(value)) {
|
|
45
|
-
setAddressError("Please enter a valid EVM address (0x...)");
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
setAddressError("");
|
|
49
|
-
if (value && (0, viem_1.isAddress)(value)) {
|
|
50
|
-
setShowValidatedResult(true);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
// Paste from clipboard
|
|
55
|
-
const handlePaste = async () => {
|
|
56
|
-
try {
|
|
57
|
-
const text = await navigator.clipboard.readText();
|
|
58
|
-
const trimmedText = text.trim();
|
|
59
|
-
setRecipientAddress(trimmedText);
|
|
60
|
-
if (trimmedText && (0, viem_1.isAddress)(trimmedText)) {
|
|
61
|
-
setAddressError("");
|
|
62
|
-
setShowValidatedResult(true);
|
|
63
|
-
}
|
|
64
|
-
else if (trimmedText) {
|
|
65
|
-
setAddressError("Please enter a valid EVM address (0x...)");
|
|
66
|
-
setShowValidatedResult(false);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
catch (error) {
|
|
70
|
-
sonner_1.toast.error("Failed to read clipboard");
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
// Handle clicking on the validated result to proceed
|
|
74
|
-
const handleSelectValidatedAddress = () => {
|
|
75
|
-
if (recipientAddress && (0, viem_1.isAddress)(recipientAddress)) {
|
|
76
|
-
addRecentAddress(recipientAddress);
|
|
77
|
-
setStep("token");
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
// Go to previous step
|
|
81
|
-
const handleBack = () => {
|
|
82
|
-
if (step === "token")
|
|
83
|
-
setStep("recipient");
|
|
84
|
-
else if (step === "amount")
|
|
85
|
-
setStep("token");
|
|
86
|
-
else if (step === "confirm")
|
|
87
|
-
setStep("amount");
|
|
88
|
-
else
|
|
89
|
-
navigateBack();
|
|
90
|
-
};
|
|
91
|
-
// Get current selected token from fresh balance
|
|
92
|
-
const getCurrentSelectedToken = () => {
|
|
93
|
-
if (!selectedToken || !simBalance?.balances) {
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
const found = simBalance.balances.find(token => token.chain_id === selectedToken.chain_id && token.address === selectedToken.address);
|
|
97
|
-
return found || null;
|
|
98
|
-
};
|
|
99
|
-
// Percentage button handler
|
|
100
|
-
const handlePercentageClick = (percentage) => {
|
|
101
|
-
const currentToken = getCurrentSelectedToken();
|
|
102
|
-
if (currentToken) {
|
|
103
|
-
const tokenBalance = (BigInt(currentToken.amount) * BigInt(percentage)) / BigInt(100);
|
|
104
|
-
const amount = (0, number_1.formatTokenAmount)(tokenBalance, currentToken.decimals, 30, false);
|
|
105
|
-
setSendAmount(amount);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
// Send transaction
|
|
109
|
-
const handleSend = async () => {
|
|
110
|
-
const sendAmountWithoutCommas = sendAmount.replace(/,/g, "");
|
|
111
|
-
const currentToken = getCurrentSelectedToken();
|
|
112
|
-
if (!currentToken || !recipientAddress || !sendAmount || parseFloat(sendAmountWithoutCommas) <= 0) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
setIsSending(true);
|
|
116
|
-
const amountInWei = (0, viem_1.parseUnits)(sendAmountWithoutCommas, currentToken.decimals);
|
|
117
|
-
const analyticsData = {
|
|
118
|
-
amount: sendAmount,
|
|
119
|
-
symbol: currentToken.symbol,
|
|
120
|
-
chain_id: currentToken.chain_id,
|
|
121
|
-
address: currentToken.address,
|
|
122
|
-
};
|
|
123
|
-
try {
|
|
124
|
-
(0, invariant_1.default)((0, viem_1.isAddress)(recipientAddress), "Recipient address is not a valid address");
|
|
125
|
-
const sendTokenData = (0, viem_1.encodeFunctionData)({
|
|
126
|
-
abi: viem_1.erc20Abi,
|
|
127
|
-
functionName: "transfer",
|
|
128
|
-
args: [recipientAddress, amountInWei],
|
|
129
|
-
});
|
|
130
|
-
const tx = await switchChainAndExecute(currentToken.chain_id, {
|
|
131
|
-
to: currentToken.address === "native" ? recipientAddress : currentToken.address,
|
|
132
|
-
data: sendTokenData,
|
|
133
|
-
value: currentToken.address === "native" ? amountInWei : BigInt(0),
|
|
134
|
-
});
|
|
135
|
-
if (tx) {
|
|
136
|
-
sendAnalyticsEvent("send_token_button_click", {
|
|
137
|
-
...analyticsData,
|
|
138
|
-
success: true,
|
|
139
|
-
tx: (0, anyspend_1.getExplorerTxUrl)(currentToken.chain_id, tx),
|
|
140
|
-
});
|
|
141
|
-
setStep("success");
|
|
142
|
-
sonner_1.toast.success(`Successfully sent ${sendAmount} ${currentToken.symbol}`);
|
|
143
|
-
if (onSuccess) {
|
|
144
|
-
onSuccess(tx);
|
|
145
|
-
}
|
|
146
|
-
setTimeout(async () => {
|
|
147
|
-
await refetchSimBalance();
|
|
148
|
-
}, 1000);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
catch (error) {
|
|
152
|
-
sendAnalyticsEvent("send_token_button_click", {
|
|
153
|
-
...analyticsData,
|
|
154
|
-
success: false,
|
|
155
|
-
reason: error.message || "Unknown error",
|
|
156
|
-
});
|
|
157
|
-
sonner_1.toast.error(`Failed to send ${currentToken.symbol}: ${error.message || "Unknown error"}`);
|
|
158
|
-
}
|
|
159
|
-
finally {
|
|
160
|
-
setIsSending(false);
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
// Get step title
|
|
164
|
-
const getStepTitle = () => {
|
|
165
|
-
switch (step) {
|
|
166
|
-
case "recipient":
|
|
167
|
-
return "Select Recipient";
|
|
168
|
-
case "token":
|
|
169
|
-
return "Select Token";
|
|
170
|
-
case "amount":
|
|
171
|
-
return "Enter Amount";
|
|
172
|
-
case "confirm":
|
|
173
|
-
return "Confirm";
|
|
174
|
-
case "success":
|
|
175
|
-
return "Sent!";
|
|
176
|
-
default:
|
|
177
|
-
return "Send";
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex h-[600px] w-full flex-col bg-white", children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.default, { handleBack: handleBack, title: getStepTitle() }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 overflow-y-auto", children: [step === "recipient" && ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6 p-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex h-12 w-full items-stretch overflow-hidden rounded-lg border border-[#d1d1d6] bg-white", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex w-12 items-center justify-center bg-transparent px-3 py-2", children: (0, jsx_runtime_1.jsx)("span", { className: "font-neue-montreal-medium text-base text-[#3f3f46]", children: "To" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-1 items-center border-l border-[#d1d1d6] px-3 py-2", children: [(0, jsx_runtime_1.jsx)("input", { type: "text", value: recipientAddress, onChange: e => handleRecipientAddressChange(e.target.value), placeholder: "ENS or Address", className: "font-neue-montreal-medium flex-1 text-base text-[#70707b] outline-none placeholder:text-[#70707b]" }), (0, jsx_runtime_1.jsx)("button", { onClick: handlePaste, className: "font-inter ml-2 rounded-md border border-[#e4e4e7] bg-[#fafafa] px-2.5 py-0.5 text-sm font-medium text-[#3f3f46] transition-colors hover:bg-[#f4f4f5]", children: "Paste" })] })] }), addressError && (0, jsx_runtime_1.jsx)("p", { className: "font-neue-montreal-medium -mt-4 text-xs text-red-500", children: addressError }), showValidatedResult && recipientAddress && (0, viem_1.isAddress)(recipientAddress) && ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1", children: (0, jsx_runtime_1.jsx)("span", { className: "font-sf-pro-text text-sm font-semibold leading-[1.3] tracking-[-0.41px] text-[#0b57c2]", children: "Result" }) }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleSelectValidatedAddress, className: "flex items-center gap-2 rounded-xl bg-[#f4f4f5] px-3 py-2 transition-colors hover:bg-[#e4e4e7]", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-10 w-10 items-center justify-center rounded-full border border-[#e4e4e7] bg-[#f4f4f5]", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "h-5 w-5 text-[#a0a0ab]" }) }), (0, jsx_runtime_1.jsxs)("span", { className: "font-neue-montreal-medium text-base tracking-[-0.32px] text-[#70707b]", children: [recipientAddress.slice(0, 6), "...", recipientAddress.slice(-4)] })] })] })), recentAddresses.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Clock, { className: "h-3.5 w-3.5 text-[#3f3f46]" }), (0, jsx_runtime_1.jsx)("span", { className: "font-sf-pro-text text-sm font-semibold leading-[1.3] tracking-[-0.41px] text-[#3f3f46]", children: "Recents" })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col", children: recentAddresses.map((recent, index) => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => {
|
|
181
|
-
// Just fill the input and show validation - don't auto-proceed
|
|
182
|
-
handleRecipientAddressChange(recent.address);
|
|
183
|
-
}, className: "flex items-center gap-2 rounded-xl px-3 py-2 transition-colors hover:bg-[#fafafa]", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-10 w-10 items-center justify-center rounded-full border border-[#e4e4e7] bg-[#f4f4f5]", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "h-5 w-5 text-[#a0a0ab]" }) }), (0, jsx_runtime_1.jsxs)("span", { className: "font-neue-montreal-medium text-base tracking-[-0.32px] text-[#70707b]", children: [recent.address.slice(0, 6), "...", recent.address.slice(-4)] })] }, index))) })] }))] })), step === "token" && ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-col p-5", children: isLoadingBalance ? ((0, jsx_runtime_1.jsx)("div", { className: "space-y-4", children: (0, jsx_runtime_1.jsx)("div", { className: "space-y-1", children: [...Array(3)].map((_, index) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between rounded-xl p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line h-10 w-10 animate-pulse rounded-full" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line mb-1 h-4 w-16 animate-pulse rounded" }), (0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line h-3 w-24 animate-pulse rounded" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-right", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line mb-1 h-4 w-20 animate-pulse rounded" }), (0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line h-3 w-16 animate-pulse rounded" })] })] }, index))) }) })) : simBalance?.balances && simBalance.balances.length > 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "space-y-4", children: (0, jsx_runtime_1.jsx)("div", { className: "space-y-1", children: simBalance.balances.map(token => ((0, jsx_runtime_1.jsxs)("div", { className: "hover:bg-b3-line/60 dark:hover:bg-b3-primary-wash/40 group flex cursor-pointer items-center justify-between rounded-xl p-3 transition-all duration-200", onClick: () => {
|
|
184
|
-
setSelectedToken(token);
|
|
185
|
-
setStep("amount");
|
|
186
|
-
}, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-10 w-10 items-center justify-center rounded-full", children: anyspend_1.ALL_CHAINS[token.chain_id]?.logoUrl ? ((0, jsx_runtime_1.jsx)(ChainTokenIcon_1.ChainTokenIcon, { chainUrl: anyspend_1.ALL_CHAINS[token.chain_id].logoUrl, tokenUrl: token.token_metadata?.logo, className: "size-10" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.CircleHelp, { className: "text-b3-react-foreground size-10" })) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-b3-grey font-neue-montreal-semibold transition-colors duration-200 group-hover:font-bold group-hover:text-black", children: token.symbol }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm transition-colors duration-200 group-hover:text-gray-700", children: token.name })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-right", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-b3-grey font-neue-montreal-semibold transition-colors duration-200 group-hover:font-bold group-hover:text-black", children: (0, number_1.formatTokenAmount)(BigInt(token.amount), token.decimals) }), (0, jsx_runtime_1.jsx)("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm transition-colors duration-200 group-hover:text-gray-700", children: (0, number_1.formatDisplayNumber)(token.value_usd, { style: "currency", fractionDigits: 2 }) })] })] }, token.chain_id + "_" + token.address))) }) })) : ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CircleHelp, { className: "text-b3-foreground-muted mb-4 h-8 w-8" }), (0, jsx_runtime_1.jsx)("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "No tokens available" })] })) })), step === "amount" && selectedToken && ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6 p-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between rounded-xl border border-[#d1d1d6] bg-[#fafafa] p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-10 w-10 items-center justify-center", children: anyspend_1.ALL_CHAINS[selectedToken.chain_id]?.logoUrl ? ((0, jsx_runtime_1.jsx)(ChainTokenIcon_1.ChainTokenIcon, { chainUrl: anyspend_1.ALL_CHAINS[selectedToken.chain_id].logoUrl, tokenUrl: selectedToken.token_metadata?.logo, className: "size-10" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.CircleHelp, { className: "text-b3-react-foreground size-10" })) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "font-neue-montreal-semibold text-base text-[#18181b]", children: selectedToken.symbol }), (0, jsx_runtime_1.jsx)("div", { className: "font-neue-montreal-medium text-sm text-[#70707b]", children: (0, number_1.formatTokenAmount)(BigInt(selectedToken.amount), selectedToken.decimals) })] })] }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setStep("token"), className: "text-b3-primary-blue font-neue-montreal-semibold hover:text-b3-primary-blue/80 text-sm transition-colors", children: "Change" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsx)(react_number_format_1.NumericFormat, { decimalSeparator: ".", allowedDecimalSeparators: [","], thousandSeparator: true, inputMode: "decimal", autoComplete: "off", autoCorrect: "off", type: "text", placeholder: "0.00", minLength: 1, maxLength: 30, spellCheck: "false", className: "font-neue-montreal-medium placeholder:text-b3-foreground-muted w-full rounded-lg border border-[#d1d1d6] bg-white px-3 py-2 text-base text-[#18181b] outline-none focus:border-[#0c68e9]", pattern: "^[0-9]*[.,]?[0-9]*$", disabled: isSending, value: sendAmount, allowNegative: false, onValueChange: values => setSendAmount(values.value) }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-4 gap-2", children: [25, 50, 75, 100].map(percentage => ((0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", onClick: () => handlePercentageClick(percentage), className: "font-neue-montreal-medium border-[#d1d1d6] text-sm text-[#18181b] hover:bg-[#fafafa]", disabled: isSending, children: [percentage, "%"] }, percentage))) }), (0, jsx_runtime_1.jsxs)("div", { className: "font-neue-montreal-medium text-sm text-[#70707b]", children: ["Available: ", (0, number_1.formatTokenAmount)(BigInt(selectedToken.amount), selectedToken.decimals), " ", selectedToken.symbol] })] }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => setStep("confirm"), disabled: !sendAmount || parseFloat(sendAmount) <= 0, className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 font-neue-montreal-semibold disabled:bg-b3-line disabled:text-b3-foreground-muted h-12 w-full rounded-xl text-white", children: "Continue" })] })), step === "confirm" && selectedToken && ((0, jsx_runtime_1.jsxs)("div", { className: "flex min-h-full flex-col", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-4 px-5 pb-0 pt-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-14 w-14 items-center justify-center rounded-full bg-[#d5e5fd]", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Send, { className: "h-7 w-7 text-[#0c68e9]" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-neue-montreal-semibold text-[30px] leading-[38px] text-[#18181b]", children: sendAmount }), (0, jsx_runtime_1.jsx)("span", { className: "font-neue-montreal-semibold text-[30px] leading-[38px] text-[#70707b]", children: selectedToken.symbol })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "h-5" }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-3 px-5", children: (0, jsx_runtime_1.jsx)("div", { className: "rounded-xl border border-[#e4e4e7] bg-[#fafafa] p-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between border-b border-[#e4e4e7] pb-3", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-inter text-sm font-normal leading-5 text-[#51525c]", children: "To" }), (0, jsx_runtime_1.jsxs)("span", { className: "font-inter text-sm font-normal leading-5 text-[#18181b]", children: ["Wallet (", recipientAddress.slice(0, 6), "...", recipientAddress.slice(-4), ")"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between border-b border-[#e4e4e7] pb-3", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-inter text-sm font-normal leading-5 text-[#51525c]", children: "Network" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-inter text-sm font-normal leading-5 text-[#51525c]", children: anyspend_1.ALL_CHAINS[selectedToken.chain_id]?.name || "Unknown" }), anyspend_1.ALL_CHAINS[selectedToken.chain_id]?.logoUrl && ((0, jsx_runtime_1.jsx)("img", { src: anyspend_1.ALL_CHAINS[selectedToken.chain_id].logoUrl, alt: anyspend_1.ALL_CHAINS[selectedToken.chain_id]?.name, className: "h-4 w-4 rounded-full" }))] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-inter text-sm font-normal leading-5 text-[#51525c]", children: "Network fee" }), (0, jsx_runtime_1.jsx)("span", { className: "font-inter text-sm font-normal leading-5 text-[#18181b]", children: "$0.1" })] })] }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-4 border-t border-[#e4e4e7] bg-[#fafafa] p-4", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleBack, disabled: isSending, variant: "outline", className: "font-inter h-12 flex-1 rounded-xl border border-[#e4e4e7] bg-white text-base font-semibold text-[#3f3f46] shadow-[inset_0px_0px_0px_1px_rgba(10,13,18,0.18),inset_0px_-2px_0px_0px_rgba(10,13,18,0.05)] hover:bg-[#fafafa]", children: "Cancel" }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleSend, disabled: isSending, className: "font-inter border-white/12 h-12 flex-1 rounded-xl border-2 bg-[#0c68e9] text-base font-semibold text-white shadow-[inset_0px_0px_0px_1px_rgba(10,13,18,0.18),inset_0px_-2px_0px_0px_rgba(10,13,18,0.05)] hover:bg-[#0b5fd4]", children: isSending ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), "Sending..."] })) : ("Send") })] })] })), step === "success" && selectedToken && ((0, jsx_runtime_1.jsxs)("div", { className: "flex h-full flex-col items-center justify-center gap-6 p-5 text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-14 w-14 items-center justify-center rounded-full bg-green-100", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Send, { className: "h-7 w-7 text-green-600" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { className: "font-neue-montreal-semibold mb-2 text-xl text-[#18181b]", children: "Sent!" }), (0, jsx_runtime_1.jsxs)("p", { className: "font-neue-montreal-medium text-sm text-[#70707b]", children: [sendAmount, " ", selectedToken.symbol, " was sent to ", recipientAddress.slice(0, 6), "...", recipientAddress.slice(-4)] })] }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => setB3ModalOpen(false), className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 font-neue-montreal-semibold h-12 w-full rounded-xl text-white", children: "Done" })] }))] })] }));
|
|
187
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const BellIcon = (props) => ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M7.5 17.5H12.5M4.16667 7.5C4.16667 4.27834 6.77834 1.66667 10 1.66667C13.2217 1.66667 15.8333 4.27834 15.8333 7.5V8.33333C15.8333 9.61667 16.2167 10.8583 16.9167 11.9167L17.5 12.75C17.9417 13.3917 17.4833 14.1667 16.7333 14.1667H3.26667C2.51667 14.1667 2.05834 13.3917 2.5 12.75L3.08334 11.9167C3.78334 10.8583 4.16667 9.61667 4.16667 8.33333V7.5Z", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
5
|
-
exports.default = BellIcon;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ChevronDownIcon = ChevronDownIcon;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
function ChevronDownIcon({ className, ...props }) {
|
|
6
|
-
return ((0, jsx_runtime_1.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M6 9L12 15L18 9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CopyIcon = CopyIcon;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
function CopyIcon({ className, ...props }) {
|
|
6
|
-
return ((0, jsx_runtime_1.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M3.33333 3.33333V2C3.33333 1.63181 3.63181 1.33333 4 1.33333H10C10.3682 1.33333 10.6667 1.63181 10.6667 2V8C10.6667 8.36819 10.3682 8.66667 10 8.66667H8.66667M2 3.33333H8C8.36819 3.33333 8.66667 3.63181 8.66667 4V10C8.66667 10.3682 8.36819 10.6667 8 10.6667H2C1.63181 10.6667 1.33333 10.3682 1.33333 10V4C1.33333 3.63181 1.63181 3.33333 2 3.33333Z", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
7
|
-
}
|