@b3dotfun/sdk 0.0.24 → 0.0.25
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/README.md +3 -8
- package/dist/cjs/anyspend/constants/index.d.ts +0 -1
- package/dist/cjs/anyspend/constants/index.js +1 -2
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +0 -1
- package/dist/cjs/anyspend/react/components/AnySpend.js +11 -15
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +9 -10
- package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendTournament.d.ts +0 -2
- package/dist/cjs/anyspend/react/components/AnySpendTournament.js +2 -2
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +1 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +4 -4
- package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +5 -5
- package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +0 -1
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +2 -2
- package/dist/cjs/anyspend/react/components/common/OrderHistory.js +1 -2
- package/dist/cjs/anyspend/react/components/common/OrderStatus.js +9 -3
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +2 -2
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.d.ts +0 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +2 -3
- package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.js +2 -2
- package/dist/cjs/anyspend/react/components/common/PaymentVendorUI.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/common/PaymentVendorUI.js +2 -2
- package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +1 -1
- package/dist/cjs/anyspend/react/components/webview/WebviewOnrampPayment.js +2 -3
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +1 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderAndTransactions.js +2 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +1 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.js +2 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendQuote.d.ts +1 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendQuote.js +3 -3
- package/dist/cjs/anyspend/react/hooks/useAnyspendTokens.d.ts +1 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendTokens.js +2 -2
- package/dist/cjs/anyspend/react/hooks/useCoinbaseOnrampOptions.d.ts +1 -1
- package/dist/cjs/anyspend/react/hooks/useCoinbaseOnrampOptions.js +3 -3
- package/dist/cjs/anyspend/react/hooks/useGeoOnrampOptions.d.ts +1 -1
- package/dist/cjs/anyspend/react/hooks/useGeoOnrampOptions.js +3 -3
- package/dist/cjs/anyspend/react/hooks/useStripeClientSecret.d.ts +1 -1
- package/dist/cjs/anyspend/react/hooks/useStripeClientSecret.js +3 -3
- package/dist/cjs/anyspend/react/hooks/useStripeSupport.d.ts +1 -1
- package/dist/cjs/anyspend/react/hooks/useStripeSupport.js +3 -3
- package/dist/cjs/anyspend/services/anyspend.d.ts +9 -10
- package/dist/cjs/anyspend/services/anyspend.js +18 -18
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +13 -15
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +1 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +2 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.d.ts +1 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +1 -3
- package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
- package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +4 -4
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.d.ts +1 -0
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +31 -20
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
- package/dist/cjs/global-account/react/components/custom/CopyToClipboard.d.ts +2 -1
- package/dist/cjs/global-account/react/components/custom/CopyToClipboard.js +3 -2
- package/dist/cjs/global-account/react/components/icons/BankIcon.d.ts +9 -0
- package/dist/cjs/global-account/react/components/icons/BankIcon.js +8 -0
- package/dist/cjs/global-account/react/components/icons/EditIcon.d.ts +9 -0
- package/dist/cjs/global-account/react/components/icons/EditIcon.js +8 -0
- package/dist/cjs/global-account/react/components/icons/SignOutIcon.d.ts +9 -0
- package/dist/cjs/global-account/react/components/icons/SignOutIcon.js +8 -0
- package/dist/cjs/global-account/react/components/icons/SwapIcon.d.ts +9 -0
- package/dist/cjs/global-account/react/components/icons/SwapIcon.js +8 -0
- package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.d.ts +6 -0
- package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.js +11 -0
- package/dist/cjs/global-account/react/hooks/useNativeBalance.d.ts +6 -0
- package/dist/cjs/global-account/react/hooks/useNativeBalance.js +39 -6
- package/dist/cjs/global-account/react/hooks/useTokenPrice.d.ts +10 -0
- package/dist/cjs/global-account/react/hooks/useTokenPrice.js +81 -2
- package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +6 -1
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +1 -1
- package/dist/esm/anyspend/constants/index.d.ts +0 -1
- package/dist/esm/anyspend/constants/index.js +0 -1
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +0 -1
- package/dist/esm/anyspend/react/components/AnySpend.js +13 -17
- package/dist/esm/anyspend/react/components/AnySpendBondKit.js +1 -1
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +10 -11
- package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendTournament.d.ts +0 -2
- package/dist/esm/anyspend/react/components/AnySpendTournament.js +2 -2
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +1 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +4 -4
- package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.d.ts +1 -2
- package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +5 -5
- package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +0 -1
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +2 -2
- package/dist/esm/anyspend/react/components/common/OrderHistory.js +1 -2
- package/dist/esm/anyspend/react/components/common/OrderStatus.js +7 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +2 -2
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.d.ts +0 -1
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +2 -3
- package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.d.ts +1 -2
- package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.js +2 -2
- package/dist/esm/anyspend/react/components/common/PaymentVendorUI.d.ts +1 -2
- package/dist/esm/anyspend/react/components/common/PaymentVendorUI.js +2 -2
- package/dist/esm/anyspend/react/components/common/RecipientSelection.js +1 -1
- package/dist/esm/anyspend/react/components/webview/WebviewOnrampPayment.js +2 -3
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +1 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.js +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +1 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.js +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendQuote.d.ts +1 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendQuote.js +3 -3
- package/dist/esm/anyspend/react/hooks/useAnyspendTokens.d.ts +1 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendTokens.js +2 -2
- package/dist/esm/anyspend/react/hooks/useCoinbaseOnrampOptions.d.ts +1 -1
- package/dist/esm/anyspend/react/hooks/useCoinbaseOnrampOptions.js +3 -3
- package/dist/esm/anyspend/react/hooks/useGeoOnrampOptions.d.ts +1 -1
- package/dist/esm/anyspend/react/hooks/useGeoOnrampOptions.js +3 -3
- package/dist/esm/anyspend/react/hooks/useStripeClientSecret.d.ts +1 -1
- package/dist/esm/anyspend/react/hooks/useStripeClientSecret.js +3 -3
- package/dist/esm/anyspend/react/hooks/useStripeSupport.d.ts +1 -1
- package/dist/esm/anyspend/react/hooks/useStripeSupport.js +3 -3
- package/dist/esm/anyspend/services/anyspend.d.ts +9 -10
- package/dist/esm/anyspend/services/anyspend.js +19 -19
- package/dist/esm/global-account/react/components/B3DynamicModal.js +13 -15
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +1 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +2 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.d.ts +1 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +1 -3
- package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
- package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +5 -5
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.d.ts +1 -0
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +33 -22
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
- package/dist/esm/global-account/react/components/custom/CopyToClipboard.d.ts +2 -1
- package/dist/esm/global-account/react/components/custom/CopyToClipboard.js +4 -3
- package/dist/esm/global-account/react/components/icons/BankIcon.d.ts +9 -0
- package/dist/esm/global-account/react/components/icons/BankIcon.js +5 -0
- package/dist/esm/global-account/react/components/icons/EditIcon.d.ts +9 -0
- package/dist/esm/global-account/react/components/icons/EditIcon.js +5 -0
- package/dist/esm/global-account/react/components/icons/SignOutIcon.d.ts +9 -0
- package/dist/esm/global-account/react/components/icons/SignOutIcon.js +5 -0
- package/dist/esm/global-account/react/components/icons/SwapIcon.d.ts +9 -0
- package/dist/esm/global-account/react/components/icons/SwapIcon.js +5 -0
- package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.d.ts +6 -0
- package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +11 -0
- package/dist/esm/global-account/react/hooks/useNativeBalance.d.ts +6 -0
- package/dist/esm/global-account/react/hooks/useNativeBalance.js +39 -6
- package/dist/esm/global-account/react/hooks/useTokenPrice.d.ts +10 -0
- package/dist/esm/global-account/react/hooks/useTokenPrice.js +78 -3
- package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +6 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/constants/index.d.ts +0 -1
- package/dist/types/anyspend/react/components/AnySpend.d.ts +0 -1
- package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendStakeB3.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendTournament.d.ts +0 -2
- package/dist/types/anyspend/react/components/common/FiatPaymentMethod.d.ts +1 -2
- package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +0 -1
- package/dist/types/anyspend/react/components/common/PanelOnrampPayment.d.ts +0 -1
- package/dist/types/anyspend/react/components/common/PaymentStripeWeb2.d.ts +1 -2
- package/dist/types/anyspend/react/components/common/PaymentVendorUI.d.ts +1 -2
- package/dist/types/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
- package/dist/types/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +1 -1
- package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +1 -1
- package/dist/types/anyspend/react/hooks/useAnyspendQuote.d.ts +1 -2
- package/dist/types/anyspend/react/hooks/useAnyspendTokens.d.ts +1 -1
- package/dist/types/anyspend/react/hooks/useCoinbaseOnrampOptions.d.ts +1 -1
- package/dist/types/anyspend/react/hooks/useGeoOnrampOptions.d.ts +1 -1
- package/dist/types/anyspend/react/hooks/useStripeClientSecret.d.ts +1 -1
- package/dist/types/anyspend/react/hooks/useStripeSupport.d.ts +1 -1
- package/dist/types/anyspend/services/anyspend.d.ts +9 -10
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +1 -2
- package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +1 -2
- package/dist/types/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
- package/dist/types/global-account/react/components/ManageAccount/ManageAccount.d.ts +1 -0
- package/dist/types/global-account/react/components/custom/CopyToClipboard.d.ts +2 -1
- package/dist/types/global-account/react/components/icons/BankIcon.d.ts +9 -0
- package/dist/types/global-account/react/components/icons/EditIcon.d.ts +9 -0
- package/dist/types/global-account/react/components/icons/SignOutIcon.d.ts +9 -0
- package/dist/types/global-account/react/components/icons/SwapIcon.d.ts +9 -0
- package/dist/types/global-account/react/hooks/useB3BalanceFromAddresses.d.ts +6 -0
- package/dist/types/global-account/react/hooks/useNativeBalance.d.ts +6 -0
- package/dist/types/global-account/react/hooks/useTokenPrice.d.ts +10 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +1 -1
- package/package.json +2 -1
- package/src/anyspend/constants/index.ts +0 -1
- package/src/anyspend/docs/components.md +1 -5
- package/src/anyspend/docs/error-handling.md +47 -47
- package/src/anyspend/docs/examples.md +29 -29
- package/src/anyspend/docs/hooks.md +22 -27
- package/src/anyspend/docs/installation.md +1 -5
- package/src/anyspend/react/components/AnySpend.tsx +8 -28
- package/src/anyspend/react/components/AnySpendBondKit.tsx +0 -1
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +0 -3
- package/src/anyspend/react/components/AnySpendCustom.tsx +8 -16
- package/src/anyspend/react/components/AnySpendNFT.tsx +0 -3
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +0 -3
- package/src/anyspend/react/components/AnySpendTournament.tsx +0 -4
- package/src/anyspend/react/components/AnyspendSignatureMint.tsx +0 -1
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +7 -7
- package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +5 -7
- package/src/anyspend/react/components/common/OrderDetails.tsx +1 -3
- package/src/anyspend/react/components/common/OrderHistory.tsx +1 -3
- package/src/anyspend/react/components/common/OrderStatus.tsx +7 -1
- package/src/anyspend/react/components/common/PanelOnramp.tsx +2 -2
- package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +1 -4
- package/src/anyspend/react/components/common/PaymentStripeWeb2.tsx +1 -3
- package/src/anyspend/react/components/common/PaymentVendorUI.tsx +2 -3
- package/src/anyspend/react/components/common/RecipientSelection.tsx +1 -1
- package/src/anyspend/react/components/webview/WebviewOnrampPayment.tsx +1 -3
- package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +0 -2
- package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +1 -13
- package/src/anyspend/react/hooks/useAnyspendOrderAndTransactions.ts +2 -2
- package/src/anyspend/react/hooks/useAnyspendOrderHistory.ts +2 -7
- package/src/anyspend/react/hooks/useAnyspendQuote.ts +3 -4
- package/src/anyspend/react/hooks/useAnyspendTokens.ts +2 -2
- package/src/anyspend/react/hooks/useCoinbaseOnrampOptions.ts +3 -8
- package/src/anyspend/react/hooks/useGeoOnrampOptions.ts +2 -3
- package/src/anyspend/react/hooks/useStripeClientSecret.ts +3 -3
- package/src/anyspend/react/hooks/useStripeSupport.ts +3 -8
- package/src/anyspend/services/anyspend.ts +19 -45
- package/src/global-account/react/components/B3DynamicModal.tsx +66 -39
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +1 -4
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +1 -3
- package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +4 -6
- package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +309 -137
- package/src/global-account/react/components/SignInWithB3/steps/LoginStep.tsx +4 -3
- package/src/global-account/react/components/custom/CopyToClipboard.tsx +7 -4
- package/src/global-account/react/components/icons/BankIcon.tsx +38 -0
- package/src/global-account/react/components/icons/EditIcon.tsx +33 -0
- package/src/global-account/react/components/icons/SignOutIcon.tsx +28 -0
- package/src/global-account/react/components/icons/SwapIcon.tsx +41 -0
- package/src/global-account/react/hooks/useB3BalanceFromAddresses.ts +18 -0
- package/src/global-account/react/hooks/useNativeBalance.tsx +51 -6
- package/src/global-account/react/hooks/useTokenPrice.tsx +138 -3
- package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +9 -3
- package/src/global-account/react/stores/useModalStore.ts +1 -1
- package/src/styles/index.css +328 -0
|
@@ -8,16 +8,19 @@ import {
|
|
|
8
8
|
TWSignerWithMetadata,
|
|
9
9
|
useAccountAssets,
|
|
10
10
|
useAuthentication,
|
|
11
|
-
useB3,
|
|
12
11
|
useB3BalanceFromAddresses,
|
|
13
12
|
useGetAllTWSigners,
|
|
14
13
|
useModalStore,
|
|
15
14
|
useNativeBalance,
|
|
15
|
+
useProfile,
|
|
16
16
|
useRemoveSessionKey,
|
|
17
17
|
} from "@b3dotfun/sdk/global-account/react";
|
|
18
|
-
import {
|
|
18
|
+
import { BankIcon } from "@b3dotfun/sdk/global-account/react/components/icons/BankIcon";
|
|
19
|
+
import { SignOutIcon } from "@b3dotfun/sdk/global-account/react/components/icons/SignOutIcon";
|
|
20
|
+
import { SwapIcon } from "@b3dotfun/sdk/global-account/react/components/icons/SwapIcon";
|
|
21
|
+
import { formatUsername } from "@b3dotfun/sdk/shared/utils";
|
|
19
22
|
import { formatNumber } from "@b3dotfun/sdk/shared/utils/formatNumber";
|
|
20
|
-
import {
|
|
23
|
+
import { Loader2, Pencil, Triangle } from "lucide-react";
|
|
21
24
|
import { useState } from "react";
|
|
22
25
|
import { Chain } from "thirdweb";
|
|
23
26
|
import { useActiveAccount } from "thirdweb/react";
|
|
@@ -32,6 +35,7 @@ interface ManageAccountProps {
|
|
|
32
35
|
onViewProfile?: () => void;
|
|
33
36
|
chain: Chain;
|
|
34
37
|
partnerId: string;
|
|
38
|
+
containerClassName?: string;
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
function centerTruncate(str: string, length = 4) {
|
|
@@ -46,17 +50,17 @@ export function ManageAccount({
|
|
|
46
50
|
chain,
|
|
47
51
|
partnerId,
|
|
48
52
|
}: ManageAccountProps) {
|
|
49
|
-
const { automaticallySetFirstEoa } = useB3();
|
|
50
53
|
const [activeTab, setActiveTab] = useState("balance");
|
|
51
54
|
const [revokingSignerId, setRevokingSignerId] = useState<string | null>(null);
|
|
52
55
|
const account = useActiveAccount();
|
|
53
|
-
const {
|
|
54
|
-
address: eoaAddress,
|
|
55
|
-
info: { data: eoaInfo },
|
|
56
|
-
} = useFirstEOA();
|
|
57
56
|
const { data: assets, isLoading } = useAccountAssets(account?.address);
|
|
58
57
|
const { data: b3Balance } = useB3BalanceFromAddresses(account?.address);
|
|
59
58
|
const { data: nativeBalance } = useNativeBalance(account?.address);
|
|
59
|
+
const { address: eoaAddress } = useFirstEOA();
|
|
60
|
+
const { data: profile } = useProfile({
|
|
61
|
+
address: eoaAddress || account?.address,
|
|
62
|
+
fresh: true,
|
|
63
|
+
});
|
|
60
64
|
const { data: eoaNativeBalance } = useNativeBalance(eoaAddress);
|
|
61
65
|
const { data: eoaB3Balance } = useB3BalanceFromAddresses(eoaAddress);
|
|
62
66
|
const { data: signers, refetch: refetchSigners } = useGetAllTWSigners({
|
|
@@ -67,6 +71,9 @@ export function ManageAccount({
|
|
|
67
71
|
const { logout } = useAuthentication(partnerId);
|
|
68
72
|
const [logoutLoading, setLogoutLoading] = useState(false);
|
|
69
73
|
|
|
74
|
+
console.log("account", account);
|
|
75
|
+
console.log("eoaAddress", eoaAddress);
|
|
76
|
+
|
|
70
77
|
const { removeSessionKey } = useRemoveSessionKey({
|
|
71
78
|
chain,
|
|
72
79
|
onSuccess: tx => {
|
|
@@ -93,187 +100,352 @@ export function ManageAccount({
|
|
|
93
100
|
setLogoutLoading(false);
|
|
94
101
|
};
|
|
95
102
|
|
|
96
|
-
const BalanceContent = () =>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
const BalanceContent = () => {
|
|
104
|
+
const { info: eoaInfo } = useFirstEOA();
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<div className="flex flex-col gap-6">
|
|
108
|
+
{/* Profile Section */}
|
|
109
|
+
<div className="flex items-center justify-between">
|
|
110
|
+
<div className="flex items-center gap-4">
|
|
111
|
+
<div className="relative">
|
|
112
|
+
{profile?.avatar ? (
|
|
113
|
+
<img src={profile?.avatar} alt="Profile" className="size-24 rounded-full" />
|
|
114
|
+
) : (
|
|
115
|
+
<div className="bg-b3-primary-wash size-24 rounded-full" />
|
|
116
|
+
)}
|
|
117
|
+
<div className="bg-b3-grey border-b3-background absolute -bottom-1 -right-1 flex size-8 items-center justify-center rounded-full border-4">
|
|
118
|
+
<Pencil size={16} className="text-b3-background" />
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
<div>
|
|
122
|
+
<h2 className="text-b3-grey text-xl font-semibold">
|
|
123
|
+
{profile?.displayName || formatUsername(profile?.name || "")}
|
|
124
|
+
</h2>
|
|
125
|
+
<span className="text-b3-foreground-muted">{formatUsername(profile?.name || "")}</span>
|
|
126
|
+
</div>
|
|
103
127
|
</div>
|
|
128
|
+
</div>
|
|
129
|
+
<div className="manage-account-address bg-b3-line flex h-11 items-center gap-2 rounded-full px-4">
|
|
130
|
+
<span className="text-b3-grey font-neue-montreal-semibold">{centerTruncate(account?.address || "")}</span>
|
|
131
|
+
<CopyToClipboard text={account?.address || ""} />
|
|
132
|
+
</div>
|
|
104
133
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
134
|
+
{/* Quick Actions */}
|
|
135
|
+
<div className="grid grid-cols-2 gap-3">
|
|
136
|
+
<Button
|
|
137
|
+
className="manage-account-deposit bg-b3-primary-wash hover:bg-b3-primary-wash/70 h-[84px] w-full flex-col items-start gap-2 rounded-2xl"
|
|
138
|
+
onClick={() => {
|
|
139
|
+
setB3ModalOpen(true);
|
|
140
|
+
setB3ModalContentType({
|
|
141
|
+
type: "anySpend",
|
|
142
|
+
defaultActiveTab: "fiat",
|
|
143
|
+
showBackButton: true,
|
|
144
|
+
});
|
|
145
|
+
}}
|
|
146
|
+
>
|
|
147
|
+
<BankIcon size={24} className="text-b3-primary-blue shrink-0" />
|
|
148
|
+
<div className="text-b3-grey font-neue-montreal-semibold">Deposit</div>
|
|
149
|
+
</Button>
|
|
150
|
+
<Button
|
|
151
|
+
className="manage-account-swap bg-b3-primary-wash hover:bg-b3-primary-wash/70 flex h-[84px] w-full flex-col items-start gap-2 rounded-2xl"
|
|
152
|
+
onClick={() => {
|
|
153
|
+
setB3ModalOpen(true);
|
|
154
|
+
setB3ModalContentType({
|
|
155
|
+
type: "anySpend",
|
|
156
|
+
showBackButton: true,
|
|
157
|
+
});
|
|
158
|
+
}}
|
|
159
|
+
>
|
|
160
|
+
<SwapIcon size={24} className="text-b3-primary-blue" />
|
|
161
|
+
<div className="text-b3-grey font-neue-montreal-semibold">Swap</div>
|
|
162
|
+
</Button>
|
|
163
|
+
</div>
|
|
164
|
+
|
|
165
|
+
{/* Balance Section */}
|
|
166
|
+
<div className="space-y-4">
|
|
167
|
+
<h3 className="text-b3-grey font-neue-montreal-semibold">Balance</h3>
|
|
168
|
+
|
|
169
|
+
{/* B3 Balance */}
|
|
170
|
+
<div className="flex items-center justify-between">
|
|
171
|
+
<div className="flex items-center gap-3">
|
|
172
|
+
<div className="flex h-10 w-10 items-center justify-center rounded-full">
|
|
173
|
+
<img src="https://cdn.b3.fun/b3-coin-3d.png" alt="B3" className="size-10" />
|
|
110
174
|
</div>
|
|
111
|
-
<div
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
175
|
+
<div>
|
|
176
|
+
<div className="flex items-center gap-2">
|
|
177
|
+
<span className="text-b3-grey font-neue-montreal-semibold">B3</span>
|
|
178
|
+
</div>
|
|
179
|
+
<div className="text-b3-foreground-muted font-neue-montreal-medium text-sm">
|
|
180
|
+
{b3Balance?.formattedTotal || "0.00"} B3
|
|
181
|
+
</div>
|
|
115
182
|
</div>
|
|
116
183
|
</div>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
<
|
|
122
|
-
{
|
|
123
|
-
|
|
124
|
-
|
|
184
|
+
<div className="text-right">
|
|
185
|
+
<div className="text-b3-grey font-neue-montreal-semibold">
|
|
186
|
+
${b3Balance?.balanceUsdFormatted || "0.00"}
|
|
187
|
+
</div>
|
|
188
|
+
<div className="flex items-center gap-1">
|
|
189
|
+
{b3Balance?.priceChange24h !== null && b3Balance?.priceChange24h !== undefined ? (
|
|
190
|
+
<>
|
|
191
|
+
<Triangle
|
|
192
|
+
className={`size-3 ${b3Balance.priceChange24h >= 0 ? "text-b3-positive fill-b3-positive" : "text-b3-negative fill-b3-negative rotate-180"}`}
|
|
193
|
+
/>
|
|
194
|
+
<span
|
|
195
|
+
className={`font-neue-montreal-medium text-sm ${b3Balance.priceChange24h >= 0 ? "text-b3-positive" : "text-b3-negative"}`}
|
|
196
|
+
>
|
|
197
|
+
{b3Balance.priceChange24h >= 0 ? "+" : ""}
|
|
198
|
+
{b3Balance.priceChange24h.toFixed(2)}%
|
|
199
|
+
</span>
|
|
200
|
+
</>
|
|
201
|
+
) : (
|
|
202
|
+
<span className="text-b3-foreground-muted font-neue-montreal-medium text-sm">--</span>
|
|
203
|
+
)}
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
</div>
|
|
207
|
+
|
|
208
|
+
{/* ETH Balance */}
|
|
209
|
+
<div className="flex items-center justify-between">
|
|
210
|
+
<div className="flex items-center gap-3">
|
|
211
|
+
<div className="flex h-10 w-10 items-center justify-center rounded-full">
|
|
212
|
+
<img src="https://cdn.b3.fun/ethereum.svg" alt="ETH" className="size-10" />
|
|
213
|
+
</div>
|
|
214
|
+
<div>
|
|
215
|
+
<div className="flex items-center gap-2">
|
|
216
|
+
<span className="text-b3-grey font-neue-montreal-semibold">Ethereum</span>
|
|
217
|
+
</div>
|
|
218
|
+
<div className="text-b3-foreground-muted font-neue-montreal-medium text-sm">
|
|
219
|
+
{nativeBalance?.formattedTotal || "0.00"} ETH
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
<div className="text-right">
|
|
224
|
+
<div className="text-b3-grey font-neue-montreal-semibold">
|
|
225
|
+
${nativeBalance?.formattedTotalUsd || "0.00"}
|
|
226
|
+
</div>
|
|
227
|
+
<div className="flex items-center gap-2">
|
|
228
|
+
{nativeBalance?.priceChange24h !== null && nativeBalance?.priceChange24h !== undefined ? (
|
|
229
|
+
<>
|
|
230
|
+
<Triangle
|
|
231
|
+
className={`size-3 ${nativeBalance.priceChange24h >= 0 ? "text-b3-positive fill-b3-positive" : "text-b3-negative fill-b3-negative rotate-180"}`}
|
|
232
|
+
/>
|
|
233
|
+
<span
|
|
234
|
+
className={`font-neue-montreal-medium text-sm ${nativeBalance.priceChange24h >= 0 ? "text-b3-positive" : "text-b3-negative"}`}
|
|
235
|
+
>
|
|
236
|
+
{nativeBalance.priceChange24h >= 0 ? "+" : ""}
|
|
237
|
+
{nativeBalance.priceChange24h.toFixed(2)}%
|
|
238
|
+
</span>
|
|
239
|
+
</>
|
|
240
|
+
) : (
|
|
241
|
+
<span className="text-b3-foreground-muted font-neue-montreal-medium text-sm">--</span>
|
|
242
|
+
)}
|
|
243
|
+
</div>
|
|
125
244
|
</div>
|
|
126
245
|
</div>
|
|
127
246
|
</div>
|
|
128
|
-
</div>
|
|
129
247
|
|
|
130
|
-
|
|
248
|
+
{/* EOA Account Balance Section - matching global balance styling */}
|
|
131
249
|
{eoaAddress && (
|
|
132
|
-
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
250
|
+
<div className="space-y-4">
|
|
251
|
+
<h3 className="text-b3-grey font-neue-montreal-semibold">Connected {eoaInfo?.data?.name || "Wallet"}</h3>
|
|
252
|
+
|
|
253
|
+
{/* EOA Address */}
|
|
254
|
+
<div className="manage-account-address bg-b3-line flex h-11 items-center gap-2 rounded-full px-4">
|
|
255
|
+
<span className="text-b3-grey font-neue-montreal-semibold">{centerTruncate(eoaAddress)}</span>
|
|
256
|
+
<CopyToClipboard text={eoaAddress} />
|
|
257
|
+
</div>
|
|
258
|
+
|
|
259
|
+
{/* EOA B3 Balance */}
|
|
260
|
+
<div className="flex items-center justify-between">
|
|
261
|
+
<div className="flex items-center gap-3">
|
|
262
|
+
<div className="flex h-10 w-10 items-center justify-center rounded-full">
|
|
263
|
+
<img src="https://cdn.b3.fun/b3-coin-3d.png" alt="B3" className="size-10" />
|
|
264
|
+
</div>
|
|
265
|
+
<div>
|
|
266
|
+
<div className="flex items-center gap-2">
|
|
267
|
+
<span className="text-b3-grey font-neue-montreal-semibold">B3</span>
|
|
268
|
+
</div>
|
|
269
|
+
<div className="text-b3-foreground-muted font-neue-montreal-medium text-sm">
|
|
270
|
+
{eoaB3Balance?.formattedTotal || "0.00"} B3
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
273
|
+
</div>
|
|
274
|
+
<div className="text-right">
|
|
275
|
+
<div className="text-b3-grey font-neue-montreal-semibold">
|
|
276
|
+
${eoaB3Balance?.balanceUsdFormatted || "0.00"}
|
|
277
|
+
</div>
|
|
278
|
+
<div className="flex items-center gap-1">
|
|
279
|
+
{eoaB3Balance?.priceChange24h !== null && eoaB3Balance?.priceChange24h !== undefined ? (
|
|
280
|
+
<>
|
|
281
|
+
<Triangle
|
|
282
|
+
className={`size-3 ${eoaB3Balance.priceChange24h >= 0 ? "text-b3-positive fill-b3-positive" : "text-b3-negative fill-b3-negative rotate-180"}`}
|
|
283
|
+
/>
|
|
284
|
+
<span
|
|
285
|
+
className={`font-neue-montreal-medium text-sm ${eoaB3Balance.priceChange24h >= 0 ? "text-b3-positive" : "text-b3-negative"}`}
|
|
286
|
+
>
|
|
287
|
+
{eoaB3Balance.priceChange24h >= 0 ? "+" : ""}
|
|
288
|
+
{eoaB3Balance.priceChange24h.toFixed(2)}%
|
|
289
|
+
</span>
|
|
290
|
+
</>
|
|
291
|
+
) : (
|
|
292
|
+
<span className="text-b3-foreground-muted font-neue-montreal-medium text-sm">--</span>
|
|
293
|
+
)}
|
|
294
|
+
</div>
|
|
138
295
|
</div>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
296
|
+
</div>
|
|
297
|
+
|
|
298
|
+
{/* EOA ETH Balance */}
|
|
299
|
+
<div className="flex items-center justify-between">
|
|
300
|
+
<div className="flex items-center gap-3">
|
|
301
|
+
<div className="flex h-10 w-10 items-center justify-center rounded-full">
|
|
302
|
+
<img src="https://cdn.b3.fun/ethereum.svg" alt="ETH" className="size-10" />
|
|
303
|
+
</div>
|
|
304
|
+
<div>
|
|
305
|
+
<div className="flex items-center gap-2">
|
|
306
|
+
<span className="text-b3-grey font-neue-montreal-semibold">Ethereum</span>
|
|
307
|
+
</div>
|
|
308
|
+
<div className="text-b3-foreground-muted font-neue-montreal-medium text-sm">
|
|
309
|
+
{eoaNativeBalance?.formattedTotal || "0.00"} ETH
|
|
310
|
+
</div>
|
|
311
|
+
</div>
|
|
143
312
|
</div>
|
|
144
|
-
<div className="text-
|
|
145
|
-
<
|
|
146
|
-
|
|
313
|
+
<div className="text-right">
|
|
314
|
+
<div className="text-b3-grey font-neue-montreal-semibold">
|
|
315
|
+
${eoaNativeBalance?.formattedTotalUsd || "0.00"}
|
|
316
|
+
</div>
|
|
317
|
+
<div className="flex items-center gap-2">
|
|
318
|
+
{eoaNativeBalance?.priceChange24h !== null && eoaNativeBalance?.priceChange24h !== undefined ? (
|
|
319
|
+
<>
|
|
320
|
+
<Triangle
|
|
321
|
+
className={`size-3 ${eoaNativeBalance.priceChange24h >= 0 ? "text-b3-positive fill-b3-positive" : "text-b3-negative fill-b3-negative rotate-180"}`}
|
|
322
|
+
/>
|
|
323
|
+
<span
|
|
324
|
+
className={`font-neue-montreal-medium text-sm ${eoaNativeBalance.priceChange24h >= 0 ? "text-b3-positive" : "text-b3-negative"}`}
|
|
325
|
+
>
|
|
326
|
+
{eoaNativeBalance.priceChange24h >= 0 ? "+" : ""}
|
|
327
|
+
{eoaNativeBalance.priceChange24h.toFixed(2)}%
|
|
328
|
+
</span>
|
|
329
|
+
</>
|
|
330
|
+
) : (
|
|
331
|
+
<span className="text-b3-foreground-muted font-neue-montreal-medium text-sm">--</span>
|
|
332
|
+
)}
|
|
333
|
+
</div>
|
|
147
334
|
</div>
|
|
148
335
|
</div>
|
|
149
|
-
|
|
336
|
+
</div>
|
|
150
337
|
)}
|
|
151
|
-
</div>
|
|
152
338
|
|
|
153
|
-
|
|
154
|
-
<
|
|
155
|
-
className="
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
setB3ModalContentType({
|
|
173
|
-
type: "anySpend",
|
|
174
|
-
showBackButton: true,
|
|
175
|
-
});
|
|
176
|
-
}}
|
|
177
|
-
>
|
|
178
|
-
<ArrowRightLeft className="mr-2 h-4 w-4" />
|
|
179
|
-
Swap
|
|
180
|
-
</Button>
|
|
339
|
+
{/* Global Account Info */}
|
|
340
|
+
<div className="border-b3-line flex items-center justify-between rounded-2xl border p-4">
|
|
341
|
+
<div className="">
|
|
342
|
+
<div className="flex items-center gap-2">
|
|
343
|
+
<img src="https://cdn.b3.fun/b3_logo.svg" alt="B3" className="h-4" />
|
|
344
|
+
<h3 className="font-neue-montreal-semibold text-b3-grey">Global Account</h3>
|
|
345
|
+
</div>
|
|
346
|
+
|
|
347
|
+
<p className="text-b3-foreground-muted font-neue-montreal-medium mt-2 text-sm">
|
|
348
|
+
Your universal account for all B3-powered apps
|
|
349
|
+
</p>
|
|
350
|
+
</div>
|
|
351
|
+
<button
|
|
352
|
+
className="text-b3-grey hover:text-b3-grey/80 hover:bg-b3-line border-b3-line flex size-12 items-center justify-center rounded-full border"
|
|
353
|
+
onClick={onLogoutEnhanced}
|
|
354
|
+
>
|
|
355
|
+
{logoutLoading ? <Loader2 className="animate-spin" /> : <SignOutIcon size={16} className="text-b3-grey" />}
|
|
356
|
+
</button>
|
|
357
|
+
</div>
|
|
181
358
|
</div>
|
|
182
|
-
|
|
183
|
-
|
|
359
|
+
);
|
|
360
|
+
};
|
|
184
361
|
|
|
185
362
|
const AssetsContent = () => (
|
|
186
|
-
<div className="
|
|
187
|
-
{assets?.nftResponse
|
|
363
|
+
<div className="grid grid-cols-3 gap-4">
|
|
364
|
+
{assets?.nftResponse ? (
|
|
365
|
+
<AccountAssets nfts={assets.nftResponse} isLoading={isLoading} />
|
|
366
|
+
) : (
|
|
367
|
+
<div className="col-span-3 py-12 text-center text-gray-500">No NFTs found</div>
|
|
368
|
+
)}
|
|
188
369
|
</div>
|
|
189
370
|
);
|
|
190
371
|
|
|
191
372
|
const AppsContent = () => (
|
|
192
|
-
<div className="
|
|
373
|
+
<div className="space-y-4">
|
|
193
374
|
{signers?.map((signer: TWSignerWithMetadata) => (
|
|
194
|
-
<div
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
<
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
</
|
|
211
|
-
<span className="text-b3-react-muted-foreground font-mono text-xs">
|
|
212
|
-
Max spend: {formatNumber(Number(formatUnits(signer.nativeTokenLimitPerTransaction, 18)))} ETH
|
|
213
|
-
</span>
|
|
214
|
-
<span className="text-b3-react-muted-foreground font-mono text-xs">
|
|
215
|
-
Approved Contracts: {signer.approvedTargets.map(formatAddress).join(", ")}
|
|
216
|
-
</span>
|
|
375
|
+
<div key={signer.id} className="rounded-xl border border-gray-200 p-4 dark:border-gray-800">
|
|
376
|
+
<div className="flex items-start justify-between">
|
|
377
|
+
<div className="flex items-start gap-4">
|
|
378
|
+
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-800">
|
|
379
|
+
<span className="text-xs font-medium text-gray-600 dark:text-gray-400">App</span>
|
|
380
|
+
</div>
|
|
381
|
+
<div>
|
|
382
|
+
<h3 className="font-medium text-gray-900 dark:text-white">{signer.partner.name}</h3>
|
|
383
|
+
<div className="mt-2 space-y-1">
|
|
384
|
+
<p className="text-xs text-gray-500">Added {new Date(signer.createdAt).toLocaleDateString()}</p>
|
|
385
|
+
<p className="text-xs text-gray-500">
|
|
386
|
+
Expires {new Date(Number(signer.endTimestamp) * 1000).toLocaleDateString()}
|
|
387
|
+
</p>
|
|
388
|
+
<p className="text-xs text-gray-500">
|
|
389
|
+
Max spend: {formatNumber(Number(formatUnits(signer.nativeTokenLimitPerTransaction, 18)))} ETH
|
|
390
|
+
</p>
|
|
391
|
+
</div>
|
|
217
392
|
</div>
|
|
218
393
|
</div>
|
|
394
|
+
<Button
|
|
395
|
+
variant="outline"
|
|
396
|
+
size="sm"
|
|
397
|
+
className="border-red-200 text-red-500 hover:border-red-300 hover:text-red-600"
|
|
398
|
+
onClick={() => handleRevoke(signer)}
|
|
399
|
+
disabled={revokingSignerId === signer.id}
|
|
400
|
+
>
|
|
401
|
+
{revokingSignerId === signer.id ? "Revoking..." : "Revoke"}
|
|
402
|
+
</Button>
|
|
219
403
|
</div>
|
|
220
|
-
<Button
|
|
221
|
-
variant="outline"
|
|
222
|
-
size="sm"
|
|
223
|
-
className="h-8 border-0 bg-red-500/80 px-4 text-xs font-medium text-white hover:bg-red-600/90"
|
|
224
|
-
onClick={() => handleRevoke(signer)}
|
|
225
|
-
disabled={revokingSignerId === signer.id}
|
|
226
|
-
>
|
|
227
|
-
{revokingSignerId === signer.id ? "Revoking..." : "Revoke"}
|
|
228
|
-
</Button>
|
|
229
404
|
</div>
|
|
230
405
|
))}
|
|
231
406
|
|
|
232
|
-
{!signers?.length && <div className="
|
|
407
|
+
{!signers?.length && <div className="py-12 text-center text-gray-500">No connected apps</div>}
|
|
233
408
|
</div>
|
|
234
409
|
);
|
|
235
410
|
|
|
236
411
|
return (
|
|
237
|
-
<div className="flex flex-col
|
|
412
|
+
<div className="b3-manage-account bg-b3-background flex flex-col rounded-xl">
|
|
238
413
|
<div className="flex-1">
|
|
239
414
|
<TabsPrimitive defaultValue={activeTab} onValueChange={setActiveTab}>
|
|
240
|
-
<TabsListPrimitive className="
|
|
241
|
-
<TabTriggerPrimitive
|
|
242
|
-
|
|
415
|
+
<TabsListPrimitive className="font-neue-montreal-semibold text-b3-grey flex h-8 w-full items-start justify-start gap-8 border-0 text-xl md:p-4">
|
|
416
|
+
<TabTriggerPrimitive
|
|
417
|
+
value="balance"
|
|
418
|
+
className="data-[state=active]:text-b3-primary-blue data-[state=active]:border-b-b3-primary-blue flex-none rounded-none border-0 p-0 pb-1 text-xl leading-none tracking-wide transition-colors data-[state=active]:border-b data-[state=active]:bg-white md:pb-4"
|
|
419
|
+
>
|
|
420
|
+
Overview
|
|
243
421
|
</TabTriggerPrimitive>
|
|
244
|
-
<TabTriggerPrimitive
|
|
245
|
-
|
|
422
|
+
<TabTriggerPrimitive
|
|
423
|
+
value="assets"
|
|
424
|
+
className="data-[state=active]:text-b3-primary-blue data-[state=active]:border-b-b3-primary-blue flex-none rounded-none border-0 p-0 pb-1 text-xl leading-none tracking-wide transition-colors data-[state=active]:border-b data-[state=active]:bg-white md:pb-4"
|
|
425
|
+
>
|
|
426
|
+
Mints
|
|
246
427
|
</TabTriggerPrimitive>
|
|
247
|
-
<TabTriggerPrimitive
|
|
428
|
+
<TabTriggerPrimitive
|
|
429
|
+
value="apps"
|
|
430
|
+
className="data-[state=active]:text-b3-primary-blue data-[state=active]:border-b-b3-primary-blue flex-none rounded-none border-0 p-0 pb-1 text-xl leading-none tracking-wide transition-colors data-[state=active]:border-b data-[state=active]:bg-white md:pb-4"
|
|
431
|
+
>
|
|
248
432
|
Apps
|
|
249
433
|
</TabTriggerPrimitive>
|
|
250
434
|
</TabsListPrimitive>
|
|
251
435
|
|
|
252
|
-
<TabsContentPrimitive value="balance">
|
|
436
|
+
<TabsContentPrimitive value="balance" className="pt-4 md:p-4">
|
|
253
437
|
<BalanceContent />
|
|
254
438
|
</TabsContentPrimitive>
|
|
255
439
|
|
|
256
|
-
<TabsContentPrimitive value="assets">
|
|
440
|
+
<TabsContentPrimitive value="assets" className="pt-4 md:p-4">
|
|
257
441
|
<AssetsContent />
|
|
258
442
|
</TabsContentPrimitive>
|
|
259
443
|
|
|
260
|
-
<TabsContentPrimitive value="apps">
|
|
444
|
+
<TabsContentPrimitive value="apps" className="pt-4 md:p-4">
|
|
261
445
|
<AppsContent />
|
|
262
446
|
</TabsContentPrimitive>
|
|
263
447
|
</TabsPrimitive>
|
|
264
448
|
</div>
|
|
265
|
-
|
|
266
|
-
<div className="flex flex-col gap-2">
|
|
267
|
-
<div className="border-b3-react-border border-t" />
|
|
268
|
-
<Button
|
|
269
|
-
variant="outline"
|
|
270
|
-
size="sm"
|
|
271
|
-
className="font-neue-montreal-medium text-b3-react-muted-foreground hover:text-b3-react-foreground"
|
|
272
|
-
onClick={onLogoutEnhanced}
|
|
273
|
-
>
|
|
274
|
-
{logoutLoading ? "Logging out..." : "Logout"}
|
|
275
|
-
</Button>
|
|
276
|
-
</div>
|
|
277
449
|
</div>
|
|
278
450
|
);
|
|
279
451
|
}
|
|
@@ -42,10 +42,10 @@ export function LoginStepContainer({ children, partnerId }: LoginStepContainerPr
|
|
|
42
42
|
const partnerLogo = partner?.data?.[0]?.loginCustomization?.logoUrl;
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
|
-
<div className="flex flex-col items-center justify-center
|
|
46
|
-
{partnerLogo && <img src={partnerLogo} alt="Partner Logo" className="mb-
|
|
45
|
+
<div className="flex flex-col items-center justify-center">
|
|
46
|
+
{partnerLogo && <img src={partnerLogo} alt="Partner Logo" className="mb-6 mt-6 h-12 w-auto object-contain" />}
|
|
47
47
|
{children}
|
|
48
|
-
<h2 className="mt-
|
|
48
|
+
<h2 className="mt-6 flex items-center gap-2 text-lg font-bold">
|
|
49
49
|
Powered by
|
|
50
50
|
<img alt="B3 Logo" className="h-5" src="https://cdn.b3.fun/b3_logo.svg" />
|
|
51
51
|
Connect
|
|
@@ -111,6 +111,7 @@ export function LoginStep({ onSuccess, onError, partnerId, chain }: LoginStepPro
|
|
|
111
111
|
title: "Sign in with B3",
|
|
112
112
|
titleIcon: "https://cdn.b3.fun/b3_logo.svg",
|
|
113
113
|
}}
|
|
114
|
+
className="b3-login-step"
|
|
114
115
|
onConnect={async wallet => {
|
|
115
116
|
try {
|
|
116
117
|
setIsAuthenticating(true);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cn } from "@b3dotfun/sdk/shared/utils";
|
|
1
2
|
import { Check, Copy } from "lucide-react";
|
|
2
3
|
import { useState } from "react";
|
|
3
4
|
|
|
@@ -5,9 +6,10 @@ interface CopyToClipboardProps {
|
|
|
5
6
|
text?: string;
|
|
6
7
|
onCopy?: () => void;
|
|
7
8
|
children?: React.ReactNode;
|
|
9
|
+
className?: string;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
|
-
export function CopyToClipboard({ text, onCopy, children }: CopyToClipboardProps) {
|
|
12
|
+
export function CopyToClipboard({ text, onCopy, children, className }: CopyToClipboardProps) {
|
|
11
13
|
const [copied, setCopied] = useState(false);
|
|
12
14
|
|
|
13
15
|
const handleCopy = async () => {
|
|
@@ -29,17 +31,18 @@ export function CopyToClipboard({ text, onCopy, children }: CopyToClipboardProps
|
|
|
29
31
|
return (
|
|
30
32
|
<div
|
|
31
33
|
onClick={handleCopy}
|
|
32
|
-
className=
|
|
34
|
+
className={cn(
|
|
35
|
+
"text-b3-foreground-muted hover:text-b3-foreground-muted/80 flex cursor-pointer items-center gap-1 text-xs transition-all duration-200",
|
|
36
|
+
className,
|
|
37
|
+
)}
|
|
33
38
|
>
|
|
34
39
|
{copied ? (
|
|
35
40
|
<>
|
|
36
41
|
<Check className="h-4 w-4" />
|
|
37
|
-
<span>Copied</span>
|
|
38
42
|
</>
|
|
39
43
|
) : (
|
|
40
44
|
<>
|
|
41
45
|
<Copy className="h-4 w-4" />
|
|
42
|
-
<span>Copy</span>
|
|
43
46
|
</>
|
|
44
47
|
)}
|
|
45
48
|
</div>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export interface BankIconProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
size?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function BankIcon({ className, size = 24, color = "#3268EF", style }: BankIconProps) {
|
|
11
|
+
return (
|
|
12
|
+
<svg
|
|
13
|
+
width={size}
|
|
14
|
+
height={size}
|
|
15
|
+
viewBox="0 0 24 24"
|
|
16
|
+
fill="none"
|
|
17
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
18
|
+
className={className}
|
|
19
|
+
style={style}
|
|
20
|
+
>
|
|
21
|
+
<path
|
|
22
|
+
d="M2.25 9H21.75L12 3L2.25 9Z"
|
|
23
|
+
stroke={color}
|
|
24
|
+
strokeWidth="2.25"
|
|
25
|
+
strokeLinecap="round"
|
|
26
|
+
strokeLinejoin="round"
|
|
27
|
+
/>
|
|
28
|
+
<path d="M5.25 9V15.75" stroke={color} strokeWidth="2.25" strokeLinecap="round" strokeLinejoin="round" />
|
|
29
|
+
<path d="M9.75 9V15.75" stroke={color} strokeWidth="2.25" strokeLinecap="round" strokeLinejoin="round" />
|
|
30
|
+
<path d="M14.25 9V15.75" stroke={color} strokeWidth="2.25" strokeLinecap="round" strokeLinejoin="round" />
|
|
31
|
+
<path d="M18.75 9V15.75" stroke={color} strokeWidth="2.25" strokeLinecap="round" strokeLinejoin="round" />
|
|
32
|
+
<path d="M3 15.75H21" stroke={color} strokeWidth="2.25" strokeLinecap="round" strokeLinejoin="round" />
|
|
33
|
+
<path d="M1.5 19.5H22.5" stroke={color} strokeWidth="2.25" strokeLinecap="round" strokeLinejoin="round" />
|
|
34
|
+
</svg>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default BankIcon;
|