@b3dotfun/sdk 0.0.40-test.6 → 0.0.41-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/anyspend/constants/index.d.ts +0 -1
- package/dist/cjs/anyspend/constants/index.js +1 -2
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +11 -1
- package/dist/cjs/anyspend/react/components/AnySpend.js +22 -10
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +0 -1
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +0 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +41 -20
- package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +0 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +8 -0
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +10 -8
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +1 -2
- package/dist/cjs/anyspend/react/components/common/ConnectWalletPayment.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/common/ConnectWalletPayment.js +7 -4
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.d.ts +4 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.js +9 -9
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +80 -10
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +40 -37
- package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +24 -23
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +9 -8
- package/dist/cjs/anyspend/react/components/common/OrderTokenAmount.d.ts +4 -1
- package/dist/cjs/anyspend/react/components/common/OrderTokenAmount.js +23 -9
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +4 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +10 -6
- package/dist/cjs/anyspend/react/components/common/PaymentMethodSwitch.d.ts +7 -0
- package/dist/cjs/anyspend/react/components/common/PaymentMethodSwitch.js +24 -0
- package/dist/cjs/anyspend/react/components/common/PointsBadge.d.ts +7 -0
- package/dist/cjs/anyspend/react/components/common/PointsBadge.js +7 -0
- package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +14 -0
- package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +6 -4
- package/dist/cjs/anyspend/react/contexts/FeatureFlagsContext.d.ts +11 -0
- package/dist/cjs/anyspend/react/contexts/FeatureFlagsContext.js +21 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +4 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +18 -8
- package/dist/cjs/anyspend/react/providers/AnyspendProvider.d.ts +5 -2
- package/dist/cjs/anyspend/react/providers/AnyspendProvider.js +5 -3
- package/dist/cjs/anyspend/react/providers/index.d.ts +1 -0
- package/dist/cjs/anyspend/react/providers/index.js +3 -0
- package/dist/cjs/anyspend/services/anyspend.d.ts +1 -1
- package/dist/cjs/anyspend/services/anyspend.js +2 -0
- package/dist/cjs/anyspend/types/api.d.ts +51 -1
- package/dist/cjs/anyspend/utils/chain.js +1 -1
- package/dist/cjs/anyspend/utils/orderPayload.js +3 -0
- package/dist/cjs/bondkit/bondkitToken.d.ts +37 -2
- package/dist/cjs/bondkit/bondkitToken.js +268 -2
- package/dist/cjs/bondkit/bondkitTokenFactory.d.ts +1 -1
- package/dist/cjs/bondkit/bondkitTokenFactory.js +2 -2
- package/dist/cjs/bondkit/components/TradingView.js +3 -4
- package/dist/cjs/bondkit/config.d.ts +1 -1
- package/dist/cjs/bondkit/config.js +5 -2
- package/dist/cjs/bondkit/constants.d.ts +4 -0
- package/dist/cjs/bondkit/constants.js +6 -1
- package/dist/cjs/bondkit/index.d.ts +1 -0
- package/dist/cjs/bondkit/index.js +4 -1
- package/dist/cjs/bondkit/swapService.d.ts +43 -0
- package/dist/cjs/bondkit/swapService.js +376 -0
- package/dist/cjs/bondkit/types.d.ts +10 -4
- package/dist/cjs/bondkit/types.js +4 -5
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +2 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +27 -28
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +63 -3
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +35 -2
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +4 -3
- package/dist/cjs/global-account/react/hooks/index.d.ts +1 -0
- package/dist/cjs/global-account/react/hooks/index.js +3 -1
- package/dist/cjs/global-account/react/hooks/useAccountAssets.js +5 -2
- package/dist/cjs/global-account/react/hooks/useAccountWallet.js +0 -12
- package/dist/cjs/global-account/react/hooks/useAuthentication.js +2 -3
- package/dist/cjs/global-account/react/hooks/useGlobalAccount.d.ts +6 -0
- package/dist/cjs/global-account/react/hooks/useGlobalAccount.js +32 -0
- package/dist/cjs/global-account/react/hooks/useQueryB3.js +5 -2
- package/dist/cjs/global-account/react/hooks/useQueryBSMNT.js +5 -2
- package/dist/cjs/global-account/react/hooks/useSimBalance.js +2 -2
- package/dist/cjs/global-account/react/hooks/useTokenBalancesByChain.js +7 -1
- package/dist/cjs/global-account/react/hooks/useTokenFromUrl.js +2 -2
- package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +28 -24
- package/dist/cjs/shared/utils/fetchBalances.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 +11 -1
- package/dist/esm/anyspend/react/components/AnySpend.js +23 -11
- package/dist/esm/anyspend/react/components/AnySpendBondKit.js +0 -1
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +0 -1
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +1 -0
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +41 -20
- package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +0 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +8 -0
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +11 -9
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +1 -2
- package/dist/esm/anyspend/react/components/common/ConnectWalletPayment.d.ts +2 -1
- package/dist/esm/anyspend/react/components/common/ConnectWalletPayment.js +8 -5
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.d.ts +4 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.js +9 -9
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +80 -10
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +2 -1
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +40 -37
- package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +25 -24
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +10 -9
- package/dist/esm/anyspend/react/components/common/OrderTokenAmount.d.ts +4 -1
- package/dist/esm/anyspend/react/components/common/OrderTokenAmount.js +23 -9
- package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +4 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +10 -6
- package/dist/esm/anyspend/react/components/common/PaymentMethodSwitch.d.ts +7 -0
- package/dist/esm/anyspend/react/components/common/PaymentMethodSwitch.js +21 -0
- package/dist/esm/anyspend/react/components/common/PointsBadge.d.ts +7 -0
- package/dist/esm/anyspend/react/components/common/PointsBadge.js +4 -0
- package/dist/esm/anyspend/react/components/common/PointsDetailPanel.d.ts +6 -0
- package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +8 -0
- package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +6 -4
- package/dist/esm/anyspend/react/contexts/FeatureFlagsContext.d.ts +11 -0
- package/dist/esm/anyspend/react/contexts/FeatureFlagsContext.js +17 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +4 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +18 -8
- package/dist/esm/anyspend/react/providers/AnyspendProvider.d.ts +5 -2
- package/dist/esm/anyspend/react/providers/AnyspendProvider.js +5 -3
- package/dist/esm/anyspend/react/providers/index.d.ts +1 -0
- package/dist/esm/anyspend/react/providers/index.js +1 -0
- package/dist/esm/anyspend/services/anyspend.d.ts +1 -1
- package/dist/esm/anyspend/services/anyspend.js +2 -0
- package/dist/esm/anyspend/types/api.d.ts +51 -1
- package/dist/esm/anyspend/utils/chain.js +1 -1
- package/dist/esm/anyspend/utils/orderPayload.js +3 -0
- package/dist/esm/bondkit/bondkitToken.d.ts +37 -2
- package/dist/esm/bondkit/bondkitToken.js +268 -2
- package/dist/esm/bondkit/bondkitTokenFactory.d.ts +1 -1
- package/dist/esm/bondkit/bondkitTokenFactory.js +2 -2
- package/dist/esm/bondkit/components/TradingView.js +3 -4
- package/dist/esm/bondkit/config.d.ts +1 -1
- package/dist/esm/bondkit/config.js +5 -2
- package/dist/esm/bondkit/constants.d.ts +4 -0
- package/dist/esm/bondkit/constants.js +5 -0
- package/dist/esm/bondkit/index.d.ts +1 -0
- package/dist/esm/bondkit/index.js +2 -0
- package/dist/esm/bondkit/swapService.d.ts +43 -0
- package/dist/esm/bondkit/swapService.js +372 -0
- package/dist/esm/bondkit/types.d.ts +10 -4
- package/dist/esm/bondkit/types.js +4 -5
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +2 -1
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +27 -28
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +65 -5
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +35 -2
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +3 -2
- package/dist/esm/global-account/react/hooks/index.d.ts +1 -0
- package/dist/esm/global-account/react/hooks/index.js +1 -0
- package/dist/esm/global-account/react/hooks/useAccountAssets.js +2 -2
- package/dist/esm/global-account/react/hooks/useAccountWallet.js +0 -12
- package/dist/esm/global-account/react/hooks/useAuthentication.js +2 -3
- package/dist/esm/global-account/react/hooks/useGlobalAccount.d.ts +6 -0
- package/dist/esm/global-account/react/hooks/useGlobalAccount.js +29 -0
- package/dist/esm/global-account/react/hooks/useQueryB3.js +5 -2
- package/dist/esm/global-account/react/hooks/useQueryBSMNT.js +5 -2
- package/dist/esm/global-account/react/hooks/useSimBalance.js +2 -2
- package/dist/esm/global-account/react/hooks/useTokenBalancesByChain.js +4 -1
- package/dist/esm/global-account/react/hooks/useTokenFromUrl.js +2 -2
- package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +29 -25
- package/dist/esm/shared/utils/fetchBalances.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 +11 -1
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +1 -0
- package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +8 -0
- package/dist/types/anyspend/react/components/common/ConnectWalletPayment.d.ts +2 -1
- package/dist/types/anyspend/react/components/common/CryptoPaySection.d.ts +4 -1
- package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +2 -1
- package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/OrderTokenAmount.d.ts +4 -1
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +4 -1
- package/dist/types/anyspend/react/components/common/PaymentMethodSwitch.d.ts +7 -0
- package/dist/types/anyspend/react/components/common/PointsBadge.d.ts +7 -0
- package/dist/types/anyspend/react/components/common/PointsDetailPanel.d.ts +6 -0
- package/dist/types/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
- package/dist/types/anyspend/react/contexts/FeatureFlagsContext.d.ts +11 -0
- package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +4 -1
- package/dist/types/anyspend/react/providers/AnyspendProvider.d.ts +5 -2
- package/dist/types/anyspend/react/providers/index.d.ts +1 -0
- package/dist/types/anyspend/services/anyspend.d.ts +1 -1
- package/dist/types/anyspend/types/api.d.ts +51 -1
- package/dist/types/bondkit/bondkitToken.d.ts +37 -2
- package/dist/types/bondkit/bondkitTokenFactory.d.ts +1 -1
- package/dist/types/bondkit/config.d.ts +1 -1
- package/dist/types/bondkit/constants.d.ts +4 -0
- package/dist/types/bondkit/index.d.ts +1 -0
- package/dist/types/bondkit/swapService.d.ts +43 -0
- package/dist/types/bondkit/types.d.ts +10 -4
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +2 -1
- package/dist/types/global-account/react/hooks/index.d.ts +1 -0
- package/dist/types/global-account/react/hooks/useGlobalAccount.d.ts +6 -0
- package/dist/types/shared/utils/fetchBalances.d.ts +1 -1
- package/package.json +1 -1
- package/src/anyspend/constants/index.ts +0 -2
- package/src/anyspend/react/components/AnySpend.tsx +52 -18
- package/src/anyspend/react/components/AnySpendBondKit.tsx +0 -1
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +0 -1
- package/src/anyspend/react/components/AnySpendCustom.tsx +82 -34
- package/src/anyspend/react/components/AnySpendNFT.tsx +3 -0
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +0 -1
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +38 -18
- package/src/anyspend/react/components/AnyspendSignatureMint.tsx +1 -2
- package/src/anyspend/react/components/common/ConnectWalletPayment.tsx +12 -4
- package/src/anyspend/react/components/common/CryptoPaySection.tsx +13 -8
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +170 -44
- package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +61 -45
- package/src/anyspend/react/components/common/OrderDetails.tsx +60 -47
- package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +62 -41
- package/src/anyspend/react/components/common/OrderTokenAmount.tsx +28 -8
- package/src/anyspend/react/components/common/PanelOnramp.tsx +28 -15
- package/src/anyspend/react/components/common/PaymentMethodSwitch.tsx +38 -0
- package/src/anyspend/react/components/common/PointsBadge.tsx +20 -0
- package/src/anyspend/react/components/common/PointsDetailPanel.tsx +55 -0
- package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +65 -43
- package/src/anyspend/react/contexts/FeatureFlagsContext.tsx +34 -0
- package/src/anyspend/react/hooks/useAnyspendFlow.ts +18 -8
- package/src/anyspend/react/hooks/useAnyspendOrderAndTransactions.ts +1 -1
- package/src/anyspend/react/hooks/useCoinbaseOnrampOptions.ts +1 -1
- package/src/anyspend/react/providers/AnyspendProvider.tsx +11 -6
- package/src/anyspend/react/providers/index.ts +1 -0
- package/src/anyspend/services/anyspend.ts +3 -1
- package/src/anyspend/types/api.ts +51 -1
- package/src/anyspend/types/api_req_res.ts +6 -10
- package/src/anyspend/utils/chain.ts +1 -1
- package/src/anyspend/utils/orderPayload.ts +3 -0
- package/src/bondkit/bondkitToken.ts +323 -3
- package/src/bondkit/bondkitTokenFactory.ts +2 -2
- package/src/bondkit/components/TradingView.tsx +3 -5
- package/src/bondkit/config.ts +5 -2
- package/src/bondkit/constants.ts +7 -0
- package/src/bondkit/index.ts +3 -0
- package/src/bondkit/swapService.ts +464 -0
- package/src/bondkit/types.ts +12 -5
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +31 -32
- package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +106 -32
- package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +60 -5
- package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +4 -2
- package/src/global-account/react/hooks/index.ts +1 -0
- package/src/global-account/react/hooks/useAccountAssets.ts +4 -3
- package/src/global-account/react/hooks/useAccountWallet.tsx +0 -13
- package/src/global-account/react/hooks/useAuthentication.ts +2 -3
- package/src/global-account/react/hooks/useGlobalAccount.tsx +36 -0
- package/src/global-account/react/hooks/useOneBalance.tsx +1 -1
- package/src/global-account/react/hooks/useQueryB3.ts +22 -15
- package/src/global-account/react/hooks/useQueryBSMNT.ts +22 -15
- package/src/global-account/react/hooks/useSimBalance.ts +2 -2
- package/src/global-account/react/hooks/useTokenBalancesByChain.tsx +4 -1
- package/src/global-account/react/hooks/useTokenFromUrl.tsx +2 -2
- package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +30 -26
- package/src/shared/utils/fetchBalances.ts +1 -1
- package/dist/cjs/global-account/examples/client-selection-example.d.ts +0 -5
- package/dist/cjs/global-account/examples/client-selection-example.js +0 -96
- package/dist/esm/global-account/examples/client-selection-example.d.ts +0 -5
- package/dist/esm/global-account/examples/client-selection-example.js +0 -93
- package/dist/types/global-account/examples/client-selection-example.d.ts +0 -5
- package/src/global-account/docs/client-selection.md +0 -292
- package/src/global-account/examples/client-selection-example.tsx +0 -197
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
ALL_CHAINS,
|
|
5
|
-
DEPOSIT_HYPE_ACTION,
|
|
6
5
|
getChainName,
|
|
7
6
|
getErrorDisplay,
|
|
8
7
|
getExplorerTxUrl,
|
|
@@ -53,6 +52,7 @@ import ConnectWalletPayment from "./ConnectWalletPayment";
|
|
|
53
52
|
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
|
|
54
53
|
import { InsufficientDepositPayment } from "./InsufficientDepositPayment";
|
|
55
54
|
import { OrderDetailsCollapsible } from "./OrderDetailsCollapsible";
|
|
55
|
+
import { OrderStatus } from "./OrderStatus";
|
|
56
56
|
import PaymentVendorUI from "./PaymentVendorUI";
|
|
57
57
|
import { TransferCryptoDetails } from "./TransferCryptoDetails";
|
|
58
58
|
|
|
@@ -64,6 +64,8 @@ interface OrderDetailsProps {
|
|
|
64
64
|
executeTx: components["schemas"]["ExecuteTx"] | null;
|
|
65
65
|
refundTxs: components["schemas"]["RefundTx"][];
|
|
66
66
|
cryptoPaymentMethod?: CryptoPaymentMethodType; // Now optional since we read from URL
|
|
67
|
+
selectedCryptoPaymentMethod?: CryptoPaymentMethodType; // For OrderStatus integration
|
|
68
|
+
onPaymentMethodChange?: (method: CryptoPaymentMethodType) => void; // Callback for payment method switching
|
|
67
69
|
onBack?: () => void;
|
|
68
70
|
disableUrlParamManagement?: boolean; // When true, will not modify URL parameters
|
|
69
71
|
}
|
|
@@ -73,6 +75,7 @@ function getOrderSuccessText({
|
|
|
73
75
|
order,
|
|
74
76
|
tournament,
|
|
75
77
|
formattedActualDstAmount,
|
|
78
|
+
formattedExpectedDstAmount,
|
|
76
79
|
dstToken,
|
|
77
80
|
recipientName,
|
|
78
81
|
centerTruncate,
|
|
@@ -80,6 +83,7 @@ function getOrderSuccessText({
|
|
|
80
83
|
order: components["schemas"]["Order"];
|
|
81
84
|
tournament?: any;
|
|
82
85
|
formattedActualDstAmount?: string;
|
|
86
|
+
formattedExpectedDstAmount?: string;
|
|
83
87
|
dstToken: any;
|
|
84
88
|
recipientName?: string;
|
|
85
89
|
centerTruncate: (address: string, n: number) => string;
|
|
@@ -100,15 +104,12 @@ function getOrderSuccessText({
|
|
|
100
104
|
case "fund_tournament":
|
|
101
105
|
actionText = `funded ${tournament?.name}`;
|
|
102
106
|
return `Successfully ${actionText}`;
|
|
107
|
+
case "hype_duel":
|
|
108
|
+
actionText = `deposited ${formattedExpectedDstAmount || "--"} HYPE`;
|
|
109
|
+
return `Successfully ${actionText} to ${recipient}`;
|
|
103
110
|
case "custom":
|
|
104
|
-
if (order.metadata.action === DEPOSIT_HYPE_ACTION) {
|
|
105
|
-
return `Successfully deposited ${formatTokenAmount(BigInt(order.payload?.amount || "0"), 18)} HYPE to ${recipient}`;
|
|
106
|
-
}
|
|
107
111
|
actionText = order.metadata.action || `executed contract`;
|
|
108
112
|
return `Successfully ${actionText}`;
|
|
109
|
-
case "hype_duel":
|
|
110
|
-
actionText = `deposited ${formattedActualDstAmount || "--"} HYPE`;
|
|
111
|
-
return `Successfully ${actionText} to ${recipient}`;
|
|
112
113
|
default:
|
|
113
114
|
throw new Error("Invalid order type");
|
|
114
115
|
}
|
|
@@ -207,6 +208,8 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
207
208
|
executeTx,
|
|
208
209
|
refundTxs,
|
|
209
210
|
cryptoPaymentMethod,
|
|
211
|
+
selectedCryptoPaymentMethod,
|
|
212
|
+
onPaymentMethodChange,
|
|
210
213
|
onBack,
|
|
211
214
|
disableUrlParamManagement = false,
|
|
212
215
|
}: OrderDetailsProps) {
|
|
@@ -220,7 +223,9 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
220
223
|
// Read crypto payment method from URL parameters
|
|
221
224
|
const cryptoPaymentMethodFromUrl = searchParams.get("cryptoPaymentMethod") as CryptoPaymentMethodType | null;
|
|
222
225
|
const effectiveCryptoPaymentMethod =
|
|
223
|
-
|
|
226
|
+
selectedCryptoPaymentMethod !== CryptoPaymentMethodType.NONE
|
|
227
|
+
? selectedCryptoPaymentMethod
|
|
228
|
+
: cryptoPaymentMethod || cryptoPaymentMethodFromUrl || CryptoPaymentMethodType.NONE;
|
|
224
229
|
|
|
225
230
|
const setB3ModalOpen = useModalStore((state: any) => state.setB3ModalOpen);
|
|
226
231
|
|
|
@@ -569,6 +574,7 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
569
574
|
if (refundTxs.length > 0) {
|
|
570
575
|
return (
|
|
571
576
|
<>
|
|
577
|
+
<OrderStatus order={order} selectedCryptoPaymentMethod={effectiveCryptoPaymentMethod} />
|
|
572
578
|
<OrderDetailsCollapsible
|
|
573
579
|
order={order}
|
|
574
580
|
dstToken={dstToken}
|
|
@@ -577,10 +583,10 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
577
583
|
recipientName={recipientName}
|
|
578
584
|
formattedExpectedDstAmount={formattedExpectedDstAmount}
|
|
579
585
|
/>
|
|
580
|
-
<Accordion type="single" collapsible className="w-full">
|
|
581
|
-
<AccordionItem value="refund-details">
|
|
582
|
-
<AccordionTrigger>Transaction Details</AccordionTrigger>
|
|
583
|
-
<AccordionContent className="pl-2">
|
|
586
|
+
<Accordion type="single" collapsible className="order-details-accordion w-full">
|
|
587
|
+
<AccordionItem value="refund-details" className="order-details-refund-item">
|
|
588
|
+
<AccordionTrigger className="accordion-trigger">Transaction Details</AccordionTrigger>
|
|
589
|
+
<AccordionContent className="accordion-content pl-2">
|
|
584
590
|
<div className="relative flex w-full flex-col gap-4">
|
|
585
591
|
<div className="bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2">
|
|
586
592
|
<motion.div
|
|
@@ -628,7 +634,7 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
628
634
|
</div>
|
|
629
635
|
)}
|
|
630
636
|
<button
|
|
631
|
-
className="order-close-button bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white"
|
|
637
|
+
className="order-close-button order-details-close-btn bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white"
|
|
632
638
|
onClick={mode === "page" ? handleBack : handleCloseModal}
|
|
633
639
|
>
|
|
634
640
|
{mode === "page" ? (
|
|
@@ -646,6 +652,7 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
646
652
|
if (executeTx) {
|
|
647
653
|
return (
|
|
648
654
|
<>
|
|
655
|
+
<OrderStatus order={order} selectedCryptoPaymentMethod={effectiveCryptoPaymentMethod} />
|
|
649
656
|
<OrderDetailsCollapsible
|
|
650
657
|
order={order}
|
|
651
658
|
dstToken={dstToken}
|
|
@@ -654,10 +661,10 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
654
661
|
recipientName={recipientName}
|
|
655
662
|
formattedExpectedDstAmount={formattedExpectedDstAmount}
|
|
656
663
|
/>
|
|
657
|
-
<Accordion type="single" collapsible className="w-full">
|
|
658
|
-
<AccordionItem value="execute-details">
|
|
659
|
-
<AccordionTrigger>Transaction Details</AccordionTrigger>
|
|
660
|
-
<AccordionContent className="pl-2">
|
|
664
|
+
<Accordion type="single" collapsible className="order-details-accordion w-full">
|
|
665
|
+
<AccordionItem value="execute-details" className="order-details-execute-item">
|
|
666
|
+
<AccordionTrigger className="accordion-trigger">Transaction Details</AccordionTrigger>
|
|
667
|
+
<AccordionContent className="accordion-content pl-2">
|
|
661
668
|
<div className="relative flex w-full flex-col gap-4">
|
|
662
669
|
<div className="bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2">
|
|
663
670
|
<motion.div
|
|
@@ -728,6 +735,7 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
728
735
|
order,
|
|
729
736
|
tournament,
|
|
730
737
|
formattedActualDstAmount: formattedActualDstAmount,
|
|
738
|
+
formattedExpectedDstAmount: formattedExpectedDstAmount,
|
|
731
739
|
dstToken,
|
|
732
740
|
recipientName,
|
|
733
741
|
centerTruncate,
|
|
@@ -752,7 +760,7 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
752
760
|
|
|
753
761
|
{order.status === "executed" && (
|
|
754
762
|
<button
|
|
755
|
-
className="order-close-button bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white"
|
|
763
|
+
className="order-close-button order-details-close-btn bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white"
|
|
756
764
|
onClick={mode === "page" ? handleBack : handleCloseModal}
|
|
757
765
|
>
|
|
758
766
|
{mode === "page" ? (
|
|
@@ -771,6 +779,7 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
771
779
|
if (relayTxs.length > 0 && relayTxs.every(tx => tx.status === "success")) {
|
|
772
780
|
return (
|
|
773
781
|
<>
|
|
782
|
+
<OrderStatus order={order} selectedCryptoPaymentMethod={effectiveCryptoPaymentMethod} />
|
|
774
783
|
<OrderDetailsCollapsible
|
|
775
784
|
order={order}
|
|
776
785
|
dstToken={dstToken}
|
|
@@ -779,10 +788,10 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
779
788
|
recipientName={recipientName}
|
|
780
789
|
formattedExpectedDstAmount={formattedExpectedDstAmount}
|
|
781
790
|
/>
|
|
782
|
-
<Accordion type="single" collapsible className="w-full">
|
|
783
|
-
<AccordionItem value="more-details">
|
|
784
|
-
<AccordionTrigger>More Details</AccordionTrigger>
|
|
785
|
-
<AccordionContent className="pl-2">
|
|
791
|
+
<Accordion type="single" collapsible className="order-details-accordion w-full">
|
|
792
|
+
<AccordionItem value="more-details" className="order-details-more-item">
|
|
793
|
+
<AccordionTrigger className="accordion-trigger">More Details</AccordionTrigger>
|
|
794
|
+
<AccordionContent className="accordion-content pl-2">
|
|
786
795
|
<div className="relative flex w-full flex-col gap-4">
|
|
787
796
|
<div className="bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2">
|
|
788
797
|
<motion.div
|
|
@@ -878,7 +887,7 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
878
887
|
|
|
879
888
|
{order.status === "executed" && (
|
|
880
889
|
<button
|
|
881
|
-
className="order-close-button bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white"
|
|
890
|
+
className="order-close-button order-details-close-btn bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white"
|
|
882
891
|
onClick={mode === "page" ? handleBack : handleCloseModal}
|
|
883
892
|
>
|
|
884
893
|
{mode === "page" ? (
|
|
@@ -899,6 +908,7 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
899
908
|
if (depositTxs?.length || waitingForDeposit) {
|
|
900
909
|
return (
|
|
901
910
|
<>
|
|
911
|
+
<OrderStatus order={order} selectedCryptoPaymentMethod={effectiveCryptoPaymentMethod} />
|
|
902
912
|
<OrderDetailsCollapsible
|
|
903
913
|
order={order}
|
|
904
914
|
dstToken={dstToken}
|
|
@@ -907,10 +917,10 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
907
917
|
recipientName={recipientName}
|
|
908
918
|
formattedExpectedDstAmount={formattedExpectedDstAmount}
|
|
909
919
|
/>
|
|
910
|
-
<Accordion type="single" collapsible className="w-full">
|
|
911
|
-
<AccordionItem value="deposit-details">
|
|
912
|
-
<AccordionTrigger>Transaction Details</AccordionTrigger>
|
|
913
|
-
<AccordionContent className="pl-2">
|
|
920
|
+
<Accordion type="single" collapsible className="order-details-accordion w-full">
|
|
921
|
+
<AccordionItem value="deposit-details" className="order-details-deposit-item">
|
|
922
|
+
<AccordionTrigger className="accordion-trigger">Transaction Details</AccordionTrigger>
|
|
923
|
+
<AccordionContent className="accordion-content pl-2">
|
|
914
924
|
<div className="relative flex w-full flex-col gap-6">
|
|
915
925
|
<div className="bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2">
|
|
916
926
|
<motion.div
|
|
@@ -997,6 +1007,7 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
997
1007
|
|
|
998
1008
|
return (
|
|
999
1009
|
<>
|
|
1010
|
+
<OrderStatus order={order} selectedCryptoPaymentMethod={effectiveCryptoPaymentMethod} />
|
|
1000
1011
|
{statusDisplay === "processing" && (
|
|
1001
1012
|
<>
|
|
1002
1013
|
{order.onrampMetadata ? (
|
|
@@ -1013,6 +1024,7 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
1013
1024
|
tournament={tournament}
|
|
1014
1025
|
nft={nft}
|
|
1015
1026
|
cryptoPaymentMethod={effectiveCryptoPaymentMethod}
|
|
1027
|
+
onPaymentMethodChange={onPaymentMethodChange}
|
|
1016
1028
|
/>
|
|
1017
1029
|
) : effectiveCryptoPaymentMethod === CryptoPaymentMethodType.TRANSFER_CRYPTO ? (
|
|
1018
1030
|
// Transfer Crypto Payment Method - Show new card-based UI
|
|
@@ -1024,23 +1036,24 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
1024
1036
|
tournament={tournament}
|
|
1025
1037
|
nft={nft}
|
|
1026
1038
|
onBack={handleBack}
|
|
1039
|
+
onPaymentMethodChange={onPaymentMethodChange}
|
|
1027
1040
|
/>
|
|
1028
1041
|
) : (
|
|
1029
|
-
<div className="relative flex w-full flex-1 flex-col">
|
|
1030
|
-
<div className={"flex flex-col gap-1"}>
|
|
1031
|
-
<span className={"text-as-primary/50"}>Please send</span>
|
|
1032
|
-
<div className="flex w-full flex-wrap items-center gap-6 sm:justify-between sm:gap-0">
|
|
1042
|
+
<div className="order-details-payment-section relative flex w-full flex-1 flex-col">
|
|
1043
|
+
<div className={"order-details-amount-section flex flex-col gap-1"}>
|
|
1044
|
+
<span className={"text-as-primary/50 order-details-amount-label"}>Please send</span>
|
|
1045
|
+
<div className="order-details-amount-container flex w-full flex-wrap items-center gap-6 sm:justify-between sm:gap-0">
|
|
1033
1046
|
<CopyToClipboard
|
|
1034
1047
|
text={roundedUpSrcAmount}
|
|
1035
1048
|
onCopy={() => {
|
|
1036
1049
|
toast.success("Copied to clipboard");
|
|
1037
1050
|
}}
|
|
1038
1051
|
>
|
|
1039
|
-
<div className="flex items-center gap-2">
|
|
1040
|
-
<strong className="border-as-brand text-as-primary border-b-2 pb-1 text-2xl font-semibold sm:text-xl">
|
|
1052
|
+
<div className="order-details-amount-display flex items-center gap-2">
|
|
1053
|
+
<strong className="border-as-brand text-as-primary order-details-amount-text border-b-2 pb-1 text-2xl font-semibold sm:text-xl">
|
|
1041
1054
|
{roundedUpSrcAmount} {srcToken.symbol}
|
|
1042
1055
|
</strong>
|
|
1043
|
-
<Copy className="text-as-primary/50 hover:text-as-primary h-5 w-5 cursor-pointer transition-all duration-200" />
|
|
1056
|
+
<Copy className="text-as-primary/50 hover:text-as-primary order-details-copy-icon h-5 w-5 cursor-pointer transition-all duration-200" />
|
|
1044
1057
|
</div>
|
|
1045
1058
|
</CopyToClipboard>
|
|
1046
1059
|
|
|
@@ -1053,7 +1066,7 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
1053
1066
|
/>
|
|
1054
1067
|
</Badge>
|
|
1055
1068
|
</div>
|
|
1056
|
-
<span className={"text-as-primary/50 mb-1 mt-2"}> to the address:</span>
|
|
1069
|
+
<span className={"text-as-primary/50 order-details-address-label mb-1 mt-2"}> to the address:</span>
|
|
1057
1070
|
</div>
|
|
1058
1071
|
<CopyToClipboard
|
|
1059
1072
|
text={order.globalAddress}
|
|
@@ -1061,11 +1074,11 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
1061
1074
|
toast.success("Copied to clipboard");
|
|
1062
1075
|
}}
|
|
1063
1076
|
>
|
|
1064
|
-
<div className="bg-b3-react-background border-b3-react-border hover:border-as-brand group flex cursor-pointer items-center justify-between gap-4 rounded-lg border p-3 px-4 shadow-md transition-all duration-200">
|
|
1065
|
-
<div className="text-as-primary overflow-hidden text-ellipsis whitespace-nowrap text-sm">
|
|
1077
|
+
<div className="bg-b3-react-background border-b3-react-border hover:border-as-brand order-details-address-container group flex cursor-pointer items-center justify-between gap-4 rounded-lg border p-3 px-4 shadow-md transition-all duration-200">
|
|
1078
|
+
<div className="text-as-primary order-details-address-text overflow-hidden text-ellipsis whitespace-nowrap text-sm">
|
|
1066
1079
|
{order.globalAddress}
|
|
1067
1080
|
</div>
|
|
1068
|
-
<Copy className="group-hover:text-as-brand text-as-primary/50 h-5 w-5 cursor-pointer transition-all duration-200" />
|
|
1081
|
+
<Copy className="group-hover:text-as-brand text-as-primary/50 order-details-address-copy-icon h-5 w-5 cursor-pointer transition-all duration-200" />
|
|
1069
1082
|
</div>
|
|
1070
1083
|
</CopyToClipboard>
|
|
1071
1084
|
|
|
@@ -1134,7 +1147,7 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
1134
1147
|
transition={{ duration: 0.5, ease: "easeInOut" }}
|
|
1135
1148
|
className="flex w-full items-center justify-evenly gap-4"
|
|
1136
1149
|
>
|
|
1137
|
-
<div className="mt-8 flex flex-col items-center rounded-lg bg-white p-6 pb-3">
|
|
1150
|
+
<div className="order-details-qr-container mt-8 flex flex-col items-center rounded-lg bg-white p-6 pb-3">
|
|
1138
1151
|
<QRCodeSVG
|
|
1139
1152
|
value={getPaymentUrl(
|
|
1140
1153
|
order.globalAddress,
|
|
@@ -1143,9 +1156,9 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
1143
1156
|
order.srcChain,
|
|
1144
1157
|
srcToken?.decimals,
|
|
1145
1158
|
)}
|
|
1146
|
-
className="max-w-[200px]"
|
|
1159
|
+
className="order-details-qr-code max-w-[200px]"
|
|
1147
1160
|
/>
|
|
1148
|
-
<div className="mt-3 flex items-center justify-center gap-2 text-sm">
|
|
1161
|
+
<div className="order-details-qr-wallets mt-3 flex items-center justify-center gap-2 text-sm">
|
|
1149
1162
|
<span className="label-style text-as-brand/70 text-sm">Scan with</span>
|
|
1150
1163
|
<TextLoop interval={3}>
|
|
1151
1164
|
<WalletMetamask className="h-5 w-5" variant="branded" />
|
|
@@ -1162,9 +1175,9 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
1162
1175
|
</>
|
|
1163
1176
|
)}
|
|
1164
1177
|
|
|
1165
|
-
<div className="flex w-full items-center justify-center gap-1 text-sm">
|
|
1166
|
-
<div className="text-as-primary/30">Time remaining:</div>
|
|
1167
|
-
<div className="text-as-primary">
|
|
1178
|
+
<div className="order-details-time-remaining flex w-full items-center justify-center gap-1 text-sm">
|
|
1179
|
+
<div className="text-as-primary/30 order-details-time-label">Time remaining:</div>
|
|
1180
|
+
<div className="text-as-primary order-details-time-value">
|
|
1168
1181
|
{depositEnoughAmount ? (
|
|
1169
1182
|
"Received"
|
|
1170
1183
|
) : order.status === "expired" ? (
|
|
@@ -1186,7 +1199,7 @@ export const OrderDetails = memo(function OrderDetails({
|
|
|
1186
1199
|
/>
|
|
1187
1200
|
)}
|
|
1188
1201
|
|
|
1189
|
-
<button className="flex w-full items-center justify-center gap-2" onClick={handleBack}>
|
|
1202
|
+
<button className="order-details-cancel-btn flex w-full items-center justify-center gap-2" onClick={handleBack}>
|
|
1190
1203
|
<RefreshCcw className="ml-2 h-4 w-4" /> Cancel and start over
|
|
1191
1204
|
</button>
|
|
1192
1205
|
|
|
@@ -1209,8 +1222,8 @@ function TransactionDetails({
|
|
|
1209
1222
|
delay?: number;
|
|
1210
1223
|
}) {
|
|
1211
1224
|
return (
|
|
1212
|
-
<div className={"relative flex w-full flex-1 items-center justify-between gap-4"}>
|
|
1213
|
-
<div className="flex grow items-center gap-4">
|
|
1225
|
+
<div className={"order-details-transaction-item relative flex w-full flex-1 items-center justify-between gap-4"}>
|
|
1226
|
+
<div className="order-details-transaction-content flex grow items-center gap-4">
|
|
1214
1227
|
<motion.div className="bg-as-surface-secondary relative h-10 w-10 rounded-full">
|
|
1215
1228
|
{isProcessing ? (
|
|
1216
1229
|
<motion.div
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { ALL_CHAINS, capitalizeFirstLetter,
|
|
3
|
+
import { ALL_CHAINS, capitalizeFirstLetter, getChainName } from "@b3dotfun/sdk/anyspend";
|
|
4
4
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
5
5
|
import { CopyToClipboard } from "@b3dotfun/sdk/global-account/react";
|
|
6
6
|
import { cn } from "@b3dotfun/sdk/shared/utils";
|
|
@@ -47,7 +47,8 @@ export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({
|
|
|
47
47
|
order.type === "mint_nft" ||
|
|
48
48
|
order.type === "join_tournament" ||
|
|
49
49
|
order.type === "fund_tournament" ||
|
|
50
|
-
order.type === "custom"
|
|
50
|
+
order.type === "custom" ||
|
|
51
|
+
order.type === "hype_duel"
|
|
51
52
|
? "0"
|
|
52
53
|
: order.payload.expectedDstAmount.toString();
|
|
53
54
|
|
|
@@ -55,79 +56,94 @@ export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({
|
|
|
55
56
|
formattedExpectedDstAmount || formatTokenAmount(BigInt(expectedDstAmount), dstToken.decimals);
|
|
56
57
|
|
|
57
58
|
return (
|
|
58
|
-
<div
|
|
59
|
+
<div
|
|
60
|
+
className={cn(
|
|
61
|
+
"order-details-collapsible bg-as-surface-secondary border-as-border-secondary rounded-xl border px-4 py-2",
|
|
62
|
+
className,
|
|
63
|
+
)}
|
|
64
|
+
>
|
|
59
65
|
{showOrderDetails ? (
|
|
60
66
|
<motion.div
|
|
61
|
-
className="w-full"
|
|
67
|
+
className="order-details-expanded w-full"
|
|
62
68
|
initial={{ opacity: 0, y: 20, filter: "blur(10px)" }}
|
|
63
69
|
animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
|
|
64
70
|
transition={{ duration: 0.3, delay: 0, ease: "easeInOut" }}
|
|
65
71
|
>
|
|
66
|
-
<div className="flex w-full flex-col items-center gap-3 whitespace-nowrap py-2 text-sm">
|
|
72
|
+
<div className="order-details-content flex w-full flex-col items-center gap-3 whitespace-nowrap py-2 text-sm">
|
|
67
73
|
{/* Recipient Section */}
|
|
68
|
-
<div className="flex w-full justify-between gap-4">
|
|
69
|
-
<div className="text-as-tertiarry">Recipient</div>
|
|
70
|
-
<div className="flex flex-col items-end gap-1">
|
|
71
|
-
{recipientName &&
|
|
74
|
+
<div className="order-details-recipient-section flex w-full justify-between gap-4">
|
|
75
|
+
<div className="order-details-recipient-label text-as-tertiarry">Recipient</div>
|
|
76
|
+
<div className="order-details-recipient-info flex flex-col items-end gap-1">
|
|
77
|
+
{recipientName && (
|
|
78
|
+
<div className="order-details-recipient-name text-as-primary font-semibold">{recipientName}</div>
|
|
79
|
+
)}
|
|
72
80
|
<CopyToClipboard
|
|
73
81
|
text={order.recipientAddress}
|
|
74
82
|
onCopy={() => {
|
|
75
83
|
toast.success("Copied recipient address to clipboard");
|
|
76
84
|
}}
|
|
77
85
|
>
|
|
78
|
-
<div className="text-as-primary flex items-center gap-2">
|
|
86
|
+
<div className="order-details-recipient-address text-as-primary flex items-center gap-2">
|
|
79
87
|
{centerTruncate(order.recipientAddress, 10)}
|
|
80
|
-
<Copy className="text-as-primary/50 hover:text-as-primary h-4 w-4 cursor-pointer transition-all duration-200" />
|
|
88
|
+
<Copy className="order-details-recipient-copy-icon text-as-primary/50 hover:text-as-primary h-4 w-4 cursor-pointer transition-all duration-200" />
|
|
81
89
|
</div>
|
|
82
90
|
</CopyToClipboard>
|
|
83
91
|
</div>
|
|
84
92
|
</div>
|
|
85
|
-
<div className="divider w-full" />
|
|
93
|
+
<div className="order-details-divider divider w-full" />
|
|
86
94
|
|
|
87
95
|
{/* Expected Amount/Action Section */}
|
|
88
|
-
<div className="flex w-full items-center justify-between gap-2">
|
|
89
|
-
<div className="text-as-tertiarry">
|
|
96
|
+
<div className="order-details-expected-section flex w-full items-center justify-between gap-2">
|
|
97
|
+
<div className="order-details-expected-label text-as-tertiarry">
|
|
90
98
|
{order.type === "swap" || order.type === "mint_nft"
|
|
91
99
|
? "Expected to receive"
|
|
92
100
|
: order.type === "join_tournament"
|
|
93
101
|
? "Join tournament"
|
|
94
102
|
: order.type === "fund_tournament"
|
|
95
103
|
? "Fund tournament"
|
|
96
|
-
: order.type === "
|
|
97
|
-
?
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
: order.type === "hype_duel"
|
|
105
|
+
? "Deposit HYPE"
|
|
106
|
+
: order.type === "custom"
|
|
107
|
+
? order.metadata.action
|
|
100
108
|
? capitalizeFirstLetter(order.metadata.action)
|
|
101
109
|
: "Contract execution"
|
|
102
|
-
|
|
110
|
+
: ""}
|
|
103
111
|
</div>
|
|
104
112
|
|
|
105
|
-
<div className="flex items-end gap-2">
|
|
113
|
+
<div className="order-details-expected-value flex items-end gap-2">
|
|
106
114
|
{order.type === "swap" ? (
|
|
107
115
|
`~${finalFormattedExpectedDstAmount} ${dstToken.symbol}`
|
|
108
116
|
) : order.type === "mint_nft" ? (
|
|
109
|
-
<div className="flex items-center gap-2">
|
|
110
|
-
<img src={nft?.imageUrl} alt={nft?.name || "NFT"} className="h-5 w-5" />
|
|
111
|
-
<div>{nft?.name || "NFT"}</div>
|
|
117
|
+
<div className="order-details-nft-info flex items-center gap-2">
|
|
118
|
+
<img src={nft?.imageUrl} alt={nft?.name || "NFT"} className="order-details-nft-image h-5 w-5" />
|
|
119
|
+
<div className="order-details-nft-name">{nft?.name || "NFT"}</div>
|
|
112
120
|
</div>
|
|
113
121
|
) : order.type === "join_tournament" || order.type === "fund_tournament" ? (
|
|
114
|
-
<div className="flex items-center gap-2">
|
|
115
|
-
<img
|
|
116
|
-
|
|
122
|
+
<div className="order-details-tournament-info flex items-center gap-2">
|
|
123
|
+
<img
|
|
124
|
+
src={tournament?.imageUrl}
|
|
125
|
+
alt={tournament?.name || "Tournament"}
|
|
126
|
+
className="order-details-tournament-image h-5 w-5"
|
|
127
|
+
/>
|
|
128
|
+
<div className="order-details-tournament-name">{tournament?.name || "Tournament"}</div>
|
|
117
129
|
</div>
|
|
118
|
-
) : order.type === "
|
|
119
|
-
<div className="flex items-center gap-2">
|
|
120
|
-
<div
|
|
130
|
+
) : order.type === "hype_duel" ? (
|
|
131
|
+
<div className="order-details-hype-info flex items-center gap-2">
|
|
132
|
+
<div className="order-details-hype-amount">
|
|
133
|
+
{formatTokenAmount(BigInt(order.payload.expectedDstAmount), dstToken.decimals)} HYPE
|
|
134
|
+
</div>
|
|
121
135
|
</div>
|
|
122
136
|
) : null}
|
|
123
137
|
|
|
124
|
-
<div className="text-as-primary/50 flex items-center gap-2">
|
|
125
|
-
<span
|
|
138
|
+
<div className="order-details-chain-info text-as-primary/50 flex items-center gap-2">
|
|
139
|
+
<span className="order-details-chain-text">
|
|
140
|
+
on {order.dstChain !== b3.id && getChainName(order.dstChain)}
|
|
141
|
+
</span>
|
|
126
142
|
<img
|
|
127
143
|
src={ALL_CHAINS[order.dstChain].logoUrl}
|
|
128
144
|
alt={getChainName(order.dstChain)}
|
|
129
145
|
className={cn(
|
|
130
|
-
"h-3",
|
|
146
|
+
"order-details-chain-logo h-3",
|
|
131
147
|
order.dstChain !== b3.id && "w-3 rounded-full",
|
|
132
148
|
order.dstChain === b3.id && "h-4",
|
|
133
149
|
)}
|
|
@@ -136,25 +152,30 @@ export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({
|
|
|
136
152
|
</div>
|
|
137
153
|
</div>
|
|
138
154
|
|
|
139
|
-
<div className="divider w-full" />
|
|
155
|
+
<div className="order-details-divider divider w-full" />
|
|
140
156
|
|
|
141
157
|
{/* Order ID / Total Section */}
|
|
142
|
-
<div className="flex w-full justify-between gap-4">
|
|
143
|
-
<div className="text-as-tertiarry">
|
|
144
|
-
|
|
158
|
+
<div className="order-details-id-total-section flex w-full justify-between gap-4">
|
|
159
|
+
<div className="order-details-id-total-label text-as-tertiarry">
|
|
160
|
+
{showTotal ? "Total (included fee)" : "Order ID"}
|
|
161
|
+
</div>
|
|
162
|
+
<div className="order-details-id-total-value text-as-primary overflow-hidden text-ellipsis whitespace-nowrap">
|
|
145
163
|
{showTotal && totalAmount ? totalAmount : order.id}
|
|
146
164
|
</div>
|
|
147
165
|
</div>
|
|
148
166
|
</div>
|
|
149
167
|
</motion.div>
|
|
150
168
|
) : (
|
|
151
|
-
<div className="flex w-full items-center">
|
|
152
|
-
<div className="divider w-full" />
|
|
153
|
-
<button
|
|
169
|
+
<div className="order-details-collapsed flex w-full items-center">
|
|
170
|
+
<div className="order-details-collapsed-divider divider w-full" />
|
|
171
|
+
<button
|
|
172
|
+
className="order-details-collapsed-button whitespace-nowrap text-sm"
|
|
173
|
+
onClick={() => setShowOrderDetails(true)}
|
|
174
|
+
>
|
|
154
175
|
Order Details
|
|
155
176
|
</button>
|
|
156
|
-
<ChevronDown className="text-as-primary mx-1 h-4 min-h-4 w-4 min-w-4" />
|
|
157
|
-
<div className="divider w-full" />
|
|
177
|
+
<ChevronDown className="order-details-collapsed-chevron text-as-primary mx-1 h-4 min-h-4 w-4 min-w-4" />
|
|
178
|
+
<div className="order-details-collapsed-divider divider w-full" />
|
|
158
179
|
</div>
|
|
159
180
|
)}
|
|
160
181
|
</div>
|
|
@@ -27,6 +27,7 @@ export function OrderTokenAmount({
|
|
|
27
27
|
innerClassName,
|
|
28
28
|
amountClassName,
|
|
29
29
|
tokenSelectClassName,
|
|
30
|
+
onTokenSelect,
|
|
30
31
|
}: {
|
|
31
32
|
disabled?: boolean;
|
|
32
33
|
inputValue: string;
|
|
@@ -43,6 +44,7 @@ export function OrderTokenAmount({
|
|
|
43
44
|
innerClassName?: string;
|
|
44
45
|
amountClassName?: string;
|
|
45
46
|
tokenSelectClassName?: string;
|
|
47
|
+
onTokenSelect?: (token: components["schemas"]["Token"], event: { preventDefault: () => void }) => void;
|
|
46
48
|
}) {
|
|
47
49
|
// Track previous token to detect changes
|
|
48
50
|
const prevTokenRef = useRef<string>(token.address);
|
|
@@ -64,6 +66,31 @@ export function OrderTokenAmount({
|
|
|
64
66
|
}, [token.address, chainId, context, onChangeInput]);
|
|
65
67
|
|
|
66
68
|
const handleTokenSelect = (newToken: any) => {
|
|
69
|
+
const token: components["schemas"]["Token"] = {
|
|
70
|
+
address: newToken.address,
|
|
71
|
+
chainId: newToken.chainId,
|
|
72
|
+
decimals: newToken.decimals,
|
|
73
|
+
metadata: { logoURI: newToken.logoURI },
|
|
74
|
+
name: newToken.name,
|
|
75
|
+
symbol: newToken.symbol,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// Call the onTokenSelect callback if provided
|
|
79
|
+
if (onTokenSelect) {
|
|
80
|
+
let isDefaultPrevented = false;
|
|
81
|
+
const event = {
|
|
82
|
+
preventDefault: () => {
|
|
83
|
+
isDefaultPrevented = true;
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
onTokenSelect(token, event);
|
|
88
|
+
|
|
89
|
+
if (isDefaultPrevented) {
|
|
90
|
+
return; // Early return if callback prevented default behavior
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
67
94
|
// Mark that we're about to change tokens
|
|
68
95
|
prevTokenRef.current = "changing"; // Temporary value to force effect
|
|
69
96
|
|
|
@@ -71,14 +98,7 @@ export function OrderTokenAmount({
|
|
|
71
98
|
setChainId(newToken.chainId);
|
|
72
99
|
|
|
73
100
|
// Then set the new token
|
|
74
|
-
setToken(
|
|
75
|
-
address: newToken.address,
|
|
76
|
-
chainId: newToken.chainId, // Use the new chain ID
|
|
77
|
-
decimals: newToken.decimals,
|
|
78
|
-
metadata: { logoURI: newToken.logoURI },
|
|
79
|
-
name: newToken.name,
|
|
80
|
-
symbol: newToken.symbol,
|
|
81
|
-
});
|
|
101
|
+
setToken(token);
|
|
82
102
|
|
|
83
103
|
// If this is the source token, reset the amount immediately
|
|
84
104
|
if (context === "from") {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useCoinbaseOnrampOptions, useGeoOnrampOptions } from "@b3dotfun/sdk/anyspend/react";
|
|
2
2
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
3
|
+
import { GetQuoteResponse } from "@b3dotfun/sdk/anyspend/types/api_req_res";
|
|
3
4
|
import { ALL_CHAINS } from "@b3dotfun/sdk/anyspend/utils/chain";
|
|
4
5
|
import { Input, useGetGeo, useProfile } from "@b3dotfun/sdk/global-account/react";
|
|
5
6
|
import { cn, formatUsername } from "@b3dotfun/sdk/shared/utils";
|
|
@@ -7,8 +8,10 @@ import { formatAddress } from "@b3dotfun/sdk/shared/utils/formatAddress";
|
|
|
7
8
|
import { ChevronRight, Wallet } from "lucide-react";
|
|
8
9
|
import { useRef } from "react";
|
|
9
10
|
import { toast } from "sonner";
|
|
11
|
+
import { useFeatureFlags } from "../../contexts/FeatureFlagsContext";
|
|
10
12
|
import { FiatPaymentMethod } from "./FiatPaymentMethod";
|
|
11
13
|
import { OrderTokenAmountFiat } from "./OrderTokenAmountFiat";
|
|
14
|
+
import { PointsBadge } from "./PointsBadge";
|
|
12
15
|
|
|
13
16
|
export function PanelOnramp({
|
|
14
17
|
srcAmountOnRamp,
|
|
@@ -25,6 +28,8 @@ export function PanelOnramp({
|
|
|
25
28
|
recipientSelectionPanelIndex,
|
|
26
29
|
dstTokenSymbol,
|
|
27
30
|
hideDstToken = false,
|
|
31
|
+
anyspendQuote,
|
|
32
|
+
onShowPointsDetail,
|
|
28
33
|
}: {
|
|
29
34
|
srcAmountOnRamp: string;
|
|
30
35
|
setSrcAmountOnRamp: (amount: string) => void;
|
|
@@ -40,7 +45,10 @@ export function PanelOnramp({
|
|
|
40
45
|
recipientSelectionPanelIndex: number;
|
|
41
46
|
dstTokenSymbol?: string;
|
|
42
47
|
hideDstToken?: boolean;
|
|
48
|
+
anyspendQuote?: GetQuoteResponse;
|
|
49
|
+
onShowPointsDetail?: () => void;
|
|
43
50
|
}) {
|
|
51
|
+
const featureFlags = useFeatureFlags();
|
|
44
52
|
// Get geo-based onramp options to access fee information
|
|
45
53
|
const { stripeWeb2Support } = useGeoOnrampOptions(srcAmountOnRamp);
|
|
46
54
|
|
|
@@ -245,21 +253,26 @@ export function PanelOnramp({
|
|
|
245
253
|
|
|
246
254
|
<div className="">
|
|
247
255
|
<div className="flex items-center justify-between">
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
256
|
+
<div className="flex items-center gap-2">
|
|
257
|
+
<span className="text-as-tertiarry text-sm">
|
|
258
|
+
{(() => {
|
|
259
|
+
const fee = getFeeFromApi(selectedPaymentMethod || FiatPaymentMethod.NONE);
|
|
260
|
+
return fee !== null ? `Total (included $${fee.toFixed(2)} fee)` : "Total";
|
|
261
|
+
})()}
|
|
262
|
+
</span>
|
|
263
|
+
{featureFlags.showPoints &&
|
|
264
|
+
anyspendQuote?.data?.pointsAmount &&
|
|
265
|
+
anyspendQuote?.data?.pointsAmount > 0 && (
|
|
266
|
+
<PointsBadge
|
|
267
|
+
pointsAmount={anyspendQuote.data.pointsAmount}
|
|
268
|
+
pointsMultiplier={anyspendQuote.data.pointsMultiplier}
|
|
269
|
+
onClick={() => onShowPointsDetail?.()}
|
|
270
|
+
/>
|
|
271
|
+
)}
|
|
272
|
+
</div>
|
|
273
|
+
<span className="text-as-primary font-semibold">
|
|
274
|
+
${getTotalAmount(selectedPaymentMethod || FiatPaymentMethod.NONE).toFixed(2)}
|
|
275
|
+
</span>
|
|
263
276
|
</div>
|
|
264
277
|
</div>
|
|
265
278
|
</div>
|