@b3dotfun/sdk 0.1.2 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +7 -1
- package/dist/cjs/anyspend/react/components/AnySpend.js +66 -15
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +6 -2
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +4 -4
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +185 -50
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +6 -1
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +19 -4
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
- package/dist/cjs/anyspend/react/components/QRDeposit.d.ts +4 -1
- package/dist/cjs/anyspend/react/components/QRDeposit.js +12 -4
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.js +7 -5
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +4 -3
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +7 -6
- package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.js +15 -6
- package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +10 -6
- package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +3 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +11 -10
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +9 -9
- package/dist/cjs/anyspend/react/components/common/OrderHistory.js +2 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +2 -2
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +20 -7
- package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +3 -2
- package/dist/cjs/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
- package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +5 -2
- package/dist/cjs/anyspend/react/components/common/TabSection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/TabSection.js +16 -7
- package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +3 -2
- package/dist/cjs/anyspend/react/components/common/WarningText.d.ts +8 -7
- package/dist/cjs/anyspend/react/components/common/WarningText.js +5 -6
- package/dist/cjs/anyspend/react/components/index.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/types/classes.d.ts +390 -0
- package/dist/cjs/anyspend/react/components/types/classes.js +6 -0
- package/dist/cjs/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/cjs/anyspend/react/hooks/index.js +1 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +22 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +119 -15
- package/dist/cjs/anyspend/react/hooks/useDirectTransfer.d.ts +17 -0
- package/dist/cjs/anyspend/react/hooks/useDirectTransfer.js +46 -0
- package/dist/cjs/anyspend/react/hooks/useRecipientAddressState.js +1 -1
- package/dist/cjs/anyspend/utils/format.js +12 -2
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +1 -5
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +1 -3
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +1 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +1 -4
- 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 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +1 -1
- package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +1 -4
- package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.js +1 -3
- package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +1 -3
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +17 -3
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +19 -152
- package/dist/cjs/global-account/react/components/index.d.ts +0 -1
- package/dist/cjs/global-account/react/components/index.js +3 -6
- package/dist/cjs/global-account/react/hooks/index.d.ts +0 -1
- package/dist/cjs/global-account/react/hooks/index.js +2 -4
- package/dist/cjs/global-account/react/hooks/useAuth.d.ts +2 -3
- package/dist/cjs/global-account/react/hooks/useAuth.js +14 -31
- package/dist/cjs/global-account/react/hooks/useTWAuth.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useTWAuth.js +3 -3
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +8 -19
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +7 -1
- package/dist/esm/anyspend/react/components/AnySpend.js +68 -17
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +6 -2
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +4 -4
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +189 -54
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +6 -1
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +19 -4
- package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
- package/dist/esm/anyspend/react/components/QRDeposit.d.ts +4 -1
- package/dist/esm/anyspend/react/components/QRDeposit.js +12 -4
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.js +7 -5
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +4 -3
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +7 -6
- package/dist/esm/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/FeeDetailPanel.js +15 -6
- package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +10 -6
- package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +3 -0
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +11 -10
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +9 -9
- package/dist/esm/anyspend/react/components/common/OrderHistory.js +2 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +2 -2
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +20 -7
- package/dist/esm/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +3 -2
- package/dist/esm/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
- package/dist/esm/anyspend/react/components/common/RecipientSelection.js +5 -2
- package/dist/esm/anyspend/react/components/common/TabSection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/TabSection.js +16 -7
- package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +3 -2
- package/dist/esm/anyspend/react/components/common/WarningText.d.ts +8 -7
- package/dist/esm/anyspend/react/components/common/WarningText.js +5 -6
- package/dist/esm/anyspend/react/components/index.d.ts +1 -0
- package/dist/esm/anyspend/react/components/types/classes.d.ts +390 -0
- package/dist/esm/anyspend/react/components/types/classes.js +5 -0
- package/dist/esm/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/esm/anyspend/react/hooks/index.js +1 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +22 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +119 -16
- package/dist/esm/anyspend/react/hooks/useDirectTransfer.d.ts +17 -0
- package/dist/esm/anyspend/react/hooks/useDirectTransfer.js +43 -0
- package/dist/esm/anyspend/react/hooks/useRecipientAddressState.js +1 -1
- package/dist/esm/anyspend/utils/format.js +12 -2
- package/dist/esm/global-account/react/components/B3DynamicModal.js +1 -5
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +1 -3
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +1 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +1 -4
- 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 -1
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +1 -1
- package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +1 -4
- package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.js +1 -3
- package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +1 -3
- package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +16 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +20 -153
- package/dist/esm/global-account/react/components/index.d.ts +0 -1
- package/dist/esm/global-account/react/components/index.js +0 -2
- package/dist/esm/global-account/react/hooks/index.d.ts +0 -1
- package/dist/esm/global-account/react/hooks/index.js +0 -1
- package/dist/esm/global-account/react/hooks/useAuth.d.ts +2 -3
- package/dist/esm/global-account/react/hooks/useAuth.js +14 -31
- package/dist/esm/global-account/react/hooks/useTWAuth.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useTWAuth.js +3 -3
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +8 -19
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnySpend.d.ts +7 -1
- package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +6 -2
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +6 -1
- package/dist/types/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
- package/dist/types/anyspend/react/components/QRDeposit.d.ts +4 -1
- package/dist/types/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +3 -0
- package/dist/types/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
- package/dist/types/anyspend/react/components/common/TabSection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/WarningText.d.ts +8 -7
- package/dist/types/anyspend/react/components/index.d.ts +1 -0
- package/dist/types/anyspend/react/components/types/classes.d.ts +390 -0
- package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +22 -2
- package/dist/types/anyspend/react/hooks/useDirectTransfer.d.ts +17 -0
- package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +1 -3
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +1 -4
- package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +1 -1
- package/dist/types/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +1 -4
- package/dist/types/global-account/react/components/index.d.ts +0 -1
- package/dist/types/global-account/react/hooks/index.d.ts +0 -1
- package/dist/types/global-account/react/hooks/useAuth.d.ts +2 -3
- package/dist/types/global-account/react/hooks/useTWAuth.d.ts +1 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +8 -19
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +164 -36
- package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +11 -6
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +278 -69
- package/src/anyspend/react/components/AnySpendDeposit.tsx +176 -52
- package/src/anyspend/react/components/AnySpendStakeUpsideExactIn.tsx +3 -0
- package/src/anyspend/react/components/QRDeposit.tsx +91 -35
- package/src/anyspend/react/components/common/CryptoPaySection.tsx +31 -19
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +14 -4
- package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +43 -23
- package/src/anyspend/react/components/common/FeeDetailPanel.tsx +53 -32
- package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +26 -13
- package/src/anyspend/react/components/common/OrderDetails.tsx +20 -9
- package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +12 -7
- package/src/anyspend/react/components/common/OrderHistory.tsx +2 -1
- package/src/anyspend/react/components/common/PanelOnramp.tsx +4 -1
- package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +118 -40
- package/src/anyspend/react/components/common/PointsDetailPanel.tsx +28 -14
- package/src/anyspend/react/components/common/RecipientSelection.tsx +20 -5
- package/src/anyspend/react/components/common/TabSection.tsx +21 -12
- package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +12 -4
- package/src/anyspend/react/components/common/WarningText.tsx +10 -10
- package/src/anyspend/react/components/index.ts +16 -0
- package/src/anyspend/react/components/types/classes.ts +476 -0
- package/src/anyspend/react/hooks/index.ts +1 -0
- package/src/anyspend/react/hooks/useAnyspendFlow.ts +141 -17
- package/src/anyspend/react/hooks/useDirectTransfer.ts +67 -0
- package/src/anyspend/react/hooks/useRecipientAddressState.ts +1 -1
- package/src/anyspend/utils/format.ts +13 -2
- package/src/global-account/react/components/B3DynamicModal.tsx +0 -5
- package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +0 -4
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +1 -1
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +1 -11
- package/src/global-account/react/components/B3Provider/LocalSDKProvider.tsx +0 -6
- package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +1 -4
- package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +33 -1
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +27 -184
- package/src/global-account/react/components/index.ts +0 -3
- package/src/global-account/react/hooks/index.ts +0 -1
- package/src/global-account/react/hooks/useAuth.ts +14 -31
- package/src/global-account/react/hooks/useTWAuth.tsx +3 -5
- package/src/global-account/react/stores/useModalStore.ts +7 -20
- package/dist/cjs/global-account/react/components/TurnkeyAuthModal.d.ts +0 -8
- package/dist/cjs/global-account/react/components/TurnkeyAuthModal.js +0 -86
- package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.d.ts +0 -20
- package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.js +0 -142
- package/dist/esm/global-account/react/components/TurnkeyAuthModal.d.ts +0 -8
- package/dist/esm/global-account/react/components/TurnkeyAuthModal.js +0 -83
- package/dist/esm/global-account/react/hooks/useTurnkeyAuth.d.ts +0 -20
- package/dist/esm/global-account/react/hooks/useTurnkeyAuth.js +0 -136
- package/dist/types/global-account/react/components/TurnkeyAuthModal.d.ts +0 -8
- package/dist/types/global-account/react/hooks/useTurnkeyAuth.d.ts +0 -20
- package/src/global-account/react/components/TurnkeyAuthModal.tsx +0 -243
- package/src/global-account/react/hooks/useTurnkeyAuth.ts +0 -171
|
@@ -17,7 +17,7 @@ function PanelOnrampPayment(props) {
|
|
|
17
17
|
return ((0, jsx_runtime_1.jsx)(AnySpendFingerprintWrapper_1.AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: (0, jsx_runtime_1.jsx)(PanelOnrampPaymentInner, { ...props }) }));
|
|
18
18
|
}
|
|
19
19
|
function PanelOnrampPaymentInner(props) {
|
|
20
|
-
const { srcAmountOnRamp, recipientAddress, isBuyMode, destinationTokenChainId, destinationTokenAddress, selectedDstChainId, selectedDstToken, anyspendQuote, globalAddress, onOrderCreated, onBack, orderType, nft, tournament, payload, recipientEnsName, recipientImageUrl, } = props;
|
|
20
|
+
const { srcAmountOnRamp, recipientAddress, isBuyMode, destinationTokenChainId, destinationTokenAddress, selectedDstChainId, selectedDstToken, anyspendQuote, globalAddress, onOrderCreated, onBack, orderType, nft, tournament, payload, recipientEnsName, recipientImageUrl, classes, } = props;
|
|
21
21
|
const { geoData, coinbaseOnrampOptions, coinbaseAvailablePaymentMethods, stripeOnrampSupport, stripeWeb2Support, isLoading: isLoadingGeoOnramp, } = (0, react_1.useGeoOnrampOptions)(srcAmountOnRamp);
|
|
22
22
|
const isLoading = isLoadingGeoOnramp;
|
|
23
23
|
const { createOrder, isCreatingOrder } = (0, react_1.useAnyspendCreateOnrampOrder)({
|
|
@@ -87,20 +87,24 @@ function PanelOnrampPaymentInner(props) {
|
|
|
87
87
|
react_2.toast.error("Failed to create order: " + err.message);
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-full max-w-[460px] flex-col gap-6 px-5 pt-5", children: [(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("h2", { className: "-mb-3 text-lg font-semibold", children: "Order summary" }), (0, jsx_runtime_1.jsxs)("div", { className:
|
|
90
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: classes?.container || "mx-auto flex w-full max-w-[460px] flex-col gap-6 px-5 pt-5", children: [(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("h2", { className: classes?.summaryTitle || "-mb-3 text-lg font-semibold", children: "Order summary" }), (0, jsx_runtime_1.jsxs)("div", { className: classes?.summaryCard ||
|
|
91
|
+
"bg-b3-react-background border-b3-react-border flex flex-col gap-3 rounded-lg border p-4", children: [recipientAddress && ((0, jsx_runtime_1.jsxs)(react_3.motion.div, { initial: false, animate: {
|
|
91
92
|
opacity: 1,
|
|
92
93
|
y: 0,
|
|
93
94
|
filter: "blur(0px)",
|
|
94
|
-
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-b3-react-foreground/60", children: orderType === "swap"
|
|
95
|
+
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: classes?.summaryRow || "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("p", { className: classes?.summaryLabel || "text-b3-react-foreground/60", children: orderType === "swap"
|
|
95
96
|
? "Recipient"
|
|
96
97
|
: orderType === "mint_nft"
|
|
97
98
|
? "Receive NFT at"
|
|
98
99
|
: orderType === "join_tournament"
|
|
99
100
|
? "Join for"
|
|
100
|
-
: "Recipient" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [recipientImageUrl && ((0, jsx_runtime_1.jsx)("img", { src: recipientImageUrl, alt: recipientImageUrl, className: "bg-b3-react-foreground size-7 rounded-full object-cover opacity-100" })), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-end gap-1", children: [recipientEnsName && (0, jsx_runtime_1.jsxs)("span", { className: "text-b3-react-foreground/80", children: ["@", recipientEnsName] }), (0, jsx_runtime_1.jsx)("span", { className: "text-b3-react-foreground/80", children: (0, centerTruncate_1.default)(recipientAddress) })] })] })] })), (0, jsx_runtime_1.jsx)("div", { className: "border-b3-react-border border-t pt-3", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-b3-react-foreground font-semibold", children: "Amount" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-end gap-0.5", children: [(0, jsx_runtime_1.jsxs)("p", { className:
|
|
101
|
+
: "Recipient" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [recipientImageUrl && ((0, jsx_runtime_1.jsx)("img", { src: recipientImageUrl, alt: recipientImageUrl, className: "bg-b3-react-foreground size-7 rounded-full object-cover opacity-100" })), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-end gap-1", children: [recipientEnsName && ((0, jsx_runtime_1.jsxs)("span", { className: classes?.summaryValue || "text-b3-react-foreground/80", children: ["@", recipientEnsName] })), (0, jsx_runtime_1.jsx)("span", { className: classes?.summaryValue || "text-b3-react-foreground/80", children: (0, centerTruncate_1.default)(recipientAddress) })] })] })] })), (0, jsx_runtime_1.jsx)("div", { className: classes?.summaryDivider || "border-b3-react-border border-t pt-3", children: (0, jsx_runtime_1.jsxs)("div", { className: classes?.amountRow || "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("p", { className: classes?.summaryLabel || "text-b3-react-foreground font-semibold", children: "Amount" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-end gap-0.5", children: [(0, jsx_runtime_1.jsxs)("p", { className: classes?.amountValue ||
|
|
102
|
+
"text-b3-react-foreground hover:text-b3-react-foreground/80 cursor-pointer text-xl font-semibold transition-colors", onClick: onBack, children: ["$", parseFloat(srcAmountOnRamp).toFixed(2)] }), anyspendQuote?.data?.fee?.type === "standard_fee" &&
|
|
101
103
|
anyspendQuote.data.currencyIn?.amountUsd &&
|
|
102
104
|
anyspendQuote.data.fee.finalFeeBps > 0 && ((0, jsx_runtime_1.jsxs)("p", { className: "text-b3-react-foreground/60 text-xs", children: ["incl. $", ((Number(anyspendQuote.data.currencyIn.amountUsd) * anyspendQuote.data.fee.finalFeeBps) /
|
|
103
|
-
10000).toFixed(2), " ", "fee"] }))] })] }) })] })] }), isCreatingOrder ? ((0, jsx_runtime_1.jsxs)("div", { className:
|
|
105
|
+
10000).toFixed(2), " ", "fee"] }))] })] }) })] })] }), isCreatingOrder ? ((0, jsx_runtime_1.jsxs)("div", { className: classes?.loadingContainer ||
|
|
106
|
+
"bg-b3-react-background border-b3-react-border flex items-center justify-center gap-3 rounded-lg border p-6", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: classes?.loadingSpinner || "h-4 w-4 animate-spin" }), (0, jsx_runtime_1.jsx)("span", { className: classes?.loadingText || "text-as-primary/70", children: "Creating onramp order..." })] })) : isLoading ? ((0, jsx_runtime_1.jsxs)("div", { className: classes?.loadingContainer ||
|
|
107
|
+
"bg-b3-react-background border-b3-react-border flex items-center justify-center gap-3 rounded-lg border p-6", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: classes?.loadingSpinner || "h-4 w-4 animate-spin" }), (0, jsx_runtime_1.jsx)("span", { className: classes?.loadingText || "text-as-primary/70", children: "Loading payment options..." })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-3 flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("h2", { className: classes?.paymentMethodTitle || "text-lg font-semibold", children: "Payment method" }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1", children: coinbaseAvailablePaymentMethods.length > 0 &&
|
|
104
108
|
(() => {
|
|
105
109
|
const hasCard = coinbaseAvailablePaymentMethods.some(m => m.id === "CARD");
|
|
106
110
|
const hasApplePay = coinbaseAvailablePaymentMethods.some(m => m.id === "APPLE_PAY");
|
|
@@ -109,6 +113,15 @@ function PanelOnrampPaymentInner(props) {
|
|
|
109
113
|
})() })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-3", children: [coinbaseAvailablePaymentMethods.length > 0 &&
|
|
110
114
|
(() => {
|
|
111
115
|
const method = coinbaseAvailablePaymentMethods[0];
|
|
112
|
-
return ((0, jsx_runtime_1.jsxs)("button", { onClick: () => handlePaymentMethodClick("coinbase", method.id), disabled: isCreatingOrder, className:
|
|
113
|
-
|
|
116
|
+
return ((0, jsx_runtime_1.jsxs)("button", { onClick: () => handlePaymentMethodClick("coinbase", method.id), disabled: isCreatingOrder, className: classes?.paymentOption ||
|
|
117
|
+
"bg-b3-react-background border-b3-react-border hover:border-as-brand disabled:hover:border-b3-react-border group flex w-full items-center justify-between gap-4 rounded-xl border p-5 transition-all duration-200 hover:shadow-md disabled:cursor-not-allowed disabled:opacity-50", children: [(0, jsx_runtime_1.jsxs)("div", { className: classes?.paymentOptionContent || "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: classes?.paymentOptionIcon ||
|
|
118
|
+
"flex h-12 w-12 items-center justify-center rounded-full bg-blue-50", children: (0, jsx_runtime_1.jsx)("img", { src: "https://cdn.b3.fun/coinbase-wordmark-blue.svg", alt: "Coinbase", className: "h-6" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start text-left", children: [(0, jsx_runtime_1.jsx)("h4", { className: classes?.paymentOptionTitle || "text-b3-react-foreground text-lg font-semibold", children: "Coinbase Pay" }), (0, jsx_runtime_1.jsxs)("p", { className: classes?.paymentOptionDescription || "text-b3-react-foreground/60 text-sm", children: [method.id === "CARD" && "Debit card, bank account, or Coinbase Account", method.id === "FIAT_WALLET" && "Pay with your Coinbase account balance", method.id === "APPLE_PAY" && "Quick payment with Apple Pay", method.id === "ACH_BANK_ACCOUNT" && "Direct bank account transfer"] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-1 flex items-center gap-1", children: (0, jsx_runtime_1.jsx)("span", { className: classes?.paymentOptionFee || "text-xs font-medium text-green-600", children: "Free" }) })] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: classes?.paymentOptionChevron ||
|
|
119
|
+
"text-b3-react-foreground/40 group-hover:text-b3-react-foreground/60 h-5 w-5 transition-colors" })] }));
|
|
120
|
+
})(), stripeOnrampSupport && ((0, jsx_runtime_1.jsxs)("button", { onClick: () => handlePaymentMethodClick("stripe"), className: classes?.paymentOption ||
|
|
121
|
+
"bg-b3-react-background border-b3-react-border hover:border-as-brand group flex w-full items-center justify-between gap-4 rounded-xl border p-5 transition-all duration-200 hover:shadow-md", children: [(0, jsx_runtime_1.jsxs)("div", { className: classes?.paymentOptionContent || "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: classes?.paymentOptionIcon ||
|
|
122
|
+
"flex h-12 w-12 items-center justify-center rounded-full bg-purple-50", children: (0, jsx_runtime_1.jsx)("img", { src: "https://raw.githubusercontent.com/stripe/stripe.github.io/455f506a628dc3f6c505e3001db45a64e29e9fc3/images/stripe-logo.svg", alt: "Stripe", className: "h-5" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start text-left", children: [(0, jsx_runtime_1.jsx)("h4", { className: classes?.paymentOptionTitle || "text-b3-react-foreground text-lg font-semibold", children: "Credit/Debit Card" }), (0, jsx_runtime_1.jsx)("p", { className: classes?.paymentOptionDescription || "text-b3-react-foreground/60 text-sm", children: "Pay via Stripe checkout" }), stripeWeb2Support?.isSupport && stripeWeb2Support.formattedFeeUsd && ((0, jsx_runtime_1.jsx)("div", { className: "mt-1", children: (0, jsx_runtime_1.jsxs)("span", { className: classes?.paymentOptionFee || "text-xs text-gray-500", children: ["$", Number(stripeWeb2Support.formattedFeeUsd).toFixed(2), " fee"] }) }))] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: classes?.paymentOptionChevron ||
|
|
123
|
+
"text-b3-react-foreground/40 group-hover:text-b3-react-foreground/60 h-5 w-5 transition-colors" })] })), stripeWeb2Support.isSupport && ((0, jsx_runtime_1.jsxs)("button", { onClick: () => handlePaymentMethodClick("stripe-web2"), className: classes?.paymentOption ||
|
|
124
|
+
"bg-b3-react-background border-b3-react-border hover:border-as-brand group flex w-full items-center justify-between gap-4 rounded-xl border p-5 transition-all duration-200 hover:shadow-md", children: [(0, jsx_runtime_1.jsxs)("div", { className: classes?.paymentOptionContent || "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: classes?.paymentOptionIcon ||
|
|
125
|
+
"flex h-12 w-12 items-center justify-center rounded-full bg-purple-50", children: (0, jsx_runtime_1.jsx)("img", { src: "https://raw.githubusercontent.com/stripe/stripe.github.io/455f506a628dc3f6c505e3001db45a64e29e9fc3/images/stripe-logo.svg", alt: "Stripe", className: "h-5" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start text-left", children: [(0, jsx_runtime_1.jsx)("h4", { className: classes?.paymentOptionTitle || "text-b3-react-foreground text-lg font-semibold", children: "Quick Pay" }), (0, jsx_runtime_1.jsx)("p", { className: classes?.paymentOptionDescription || "text-b3-react-foreground/60 text-sm", children: "Credit or debit card" }), stripeWeb2Support.formattedFeeUsd && ((0, jsx_runtime_1.jsx)("div", { className: "mt-1", children: (0, jsx_runtime_1.jsxs)("span", { className: classes?.paymentOptionFee || "text-xs text-gray-500", children: ["$", Number(stripeWeb2Support.formattedFeeUsd).toFixed(2), " fee"] }) }))] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: classes?.paymentOptionChevron ||
|
|
126
|
+
"text-b3-react-foreground/40 group-hover:text-b3-react-foreground/60 h-5 w-5 transition-colors" })] })), (0, jsx_runtime_1.jsxs)(react_2.Button, { variant: "link", onClick: onBack, className: classes?.backButton || "text-b3-react-foreground/70 hover:text-b3-react-foreground/90 mt-2 w-full", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "mr-2 h-4 w-4" }), "Back"] })] })] }))] }));
|
|
114
127
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { PointsDetailPanelClasses } from "../types/classes";
|
|
1
2
|
interface PointsDetailPanelProps {
|
|
2
3
|
pointsAmount?: number;
|
|
3
4
|
onBack: () => void;
|
|
5
|
+
classes?: PointsDetailPanelClasses;
|
|
4
6
|
}
|
|
5
|
-
export declare function PointsDetailPanel({ pointsAmount, onBack }: PointsDetailPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function PointsDetailPanel({ pointsAmount, onBack, classes }: PointsDetailPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export {};
|
|
@@ -8,6 +8,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
8
8
|
const react_1 = require("../../../../global-account/react");
|
|
9
9
|
const cn_1 = require("../../../../shared/utils/cn");
|
|
10
10
|
const link_1 = __importDefault(require("next/link"));
|
|
11
|
-
function PointsDetailPanel({ pointsAmount = 0, onBack }) {
|
|
12
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-4 px-5", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-4 text-center", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-as-primary text-xl font-bold", children: "Earn Points with Every Swap" }), (0, jsx_runtime_1.jsxs)("p", { className: "text-as-primary/70 text-balance text-sm leading-relaxed", children: ["You'll earn ", (0, jsx_runtime_1.jsxs)("span", { className: "text-as-brand font-semibold", children: ["+", pointsAmount.toLocaleString(), " points"] }), " ", "towards the", " ", (0, jsx_runtime_1.jsx)(link_1.default, { href: "https://anyspend.com/points", target: "_blank", className: "text-as-brand underline", children: "next AnySpend airdrop" }), " ", "when you complete this transaction."] }), (0, jsx_runtime_1.jsxs)("div", { className:
|
|
11
|
+
function PointsDetailPanel({ pointsAmount = 0, onBack, classes }) {
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: classes?.container || "mx-auto flex w-[460px] max-w-full flex-col items-center gap-4 px-5", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-4 text-center", children: [(0, jsx_runtime_1.jsx)("h3", { className: classes?.title || "text-as-primary text-xl font-bold", children: "Earn Points with Every Swap" }), (0, jsx_runtime_1.jsxs)("p", { className: classes?.description || "text-as-primary/70 text-balance text-sm leading-relaxed", children: ["You'll earn", " ", (0, jsx_runtime_1.jsxs)("span", { className: classes?.highlightText || "text-as-brand font-semibold", children: ["+", pointsAmount.toLocaleString(), " points"] }), " ", "towards the", " ", (0, jsx_runtime_1.jsx)(link_1.default, { href: "https://anyspend.com/points", target: "_blank", className: classes?.link || "text-as-brand underline", children: "next AnySpend airdrop" }), " ", "when you complete this transaction."] }), (0, jsx_runtime_1.jsxs)("div", { className: classes?.infoCard ||
|
|
13
|
+
"bg-as-surface-primary border-as-border-secondary mt-2 w-full rounded-lg border p-4 text-left", children: [(0, jsx_runtime_1.jsx)("h4", { className: classes?.infoCardTitle || "text-as-primary mb-2 font-semibold", children: "How it works:" }), (0, jsx_runtime_1.jsxs)("ul", { className: classes?.infoList || "text-as-primary/70 space-y-1 text-sm", children: [(0, jsx_runtime_1.jsx)("li", { className: classes?.infoListItem, children: "\u2022 Points are earned based on transaction volume" }), (0, jsx_runtime_1.jsx)("li", { className: classes?.infoListItem, children: "\u2022 Higher volume = more points" }), (0, jsx_runtime_1.jsx)("li", { className: classes?.infoListItem, children: "\u2022 Points contribute to future airdrops" }), (0, jsx_runtime_1.jsx)("li", { className: classes?.infoListItem, children: "\u2022 Keep swapping to maximize your rewards" })] })] }), (0, jsx_runtime_1.jsx)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", onClick: onBack, className: classes?.backButton || (0, cn_1.cn)("as-main-button !bg-as-brand relative w-full"), textClassName: (0, cn_1.cn)("text-white"), children: "Back to Swap" })] }) }));
|
|
13
14
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RecipientSelectionClasses } from "../types/classes";
|
|
1
2
|
export interface RecipientSelectionProps {
|
|
2
3
|
/**
|
|
3
4
|
* Initial recipient address value
|
|
@@ -38,5 +39,9 @@ export interface RecipientSelectionProps {
|
|
|
38
39
|
* @returns true if valid, false otherwise
|
|
39
40
|
*/
|
|
40
41
|
validateAddress?: (address: string) => boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Custom classes for styling
|
|
44
|
+
*/
|
|
45
|
+
classes?: RecipientSelectionClasses;
|
|
41
46
|
}
|
|
42
|
-
export declare function RecipientSelection({ initialValue, placeholder, title, description, confirmText, onBack, onConfirm, autoFocus, validateAddress, }: RecipientSelectionProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare function RecipientSelection({ initialValue, placeholder, title, description, confirmText, onBack, onConfirm, autoFocus, validateAddress, classes, }: RecipientSelectionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,7 +5,7 @@ exports.RecipientSelection = RecipientSelection;
|
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const lucide_react_1 = require("lucide-react");
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
-
function RecipientSelection({ initialValue = "", placeholder = "Enter recipient address", title = "Add recipient address or ENS", description = "Swap and send tokens to another address", confirmText = "Confirm recipient address", onBack, onConfirm, autoFocus = true, validateAddress, }) {
|
|
8
|
+
function RecipientSelection({ initialValue = "", placeholder = "Enter recipient address", title = "Add recipient address or ENS", description = "Swap and send tokens to another address", confirmText = "Confirm recipient address", onBack, onConfirm, autoFocus = true, validateAddress, classes, }) {
|
|
9
9
|
const [recipientAddress, setRecipientAddress] = (0, react_1.useState)(initialValue);
|
|
10
10
|
// Update internal state when initialValue changes
|
|
11
11
|
(0, react_1.useEffect)(() => {
|
|
@@ -32,5 +32,8 @@ function RecipientSelection({ initialValue = "", placeholder = "Enter recipient
|
|
|
32
32
|
};
|
|
33
33
|
const isAddressValid = !validateAddress || !recipientAddress || validateAddress(recipientAddress);
|
|
34
34
|
const canConfirm = recipientAddress && isAddressValid;
|
|
35
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "recipient-selection mx-auto w-[460px] max-w-full p-5", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-around", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className:
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: classes?.container || "recipient-selection mx-auto w-[460px] max-w-full p-5", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: classes?.header || "flex justify-around", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: classes?.backButton ||
|
|
36
|
+
"text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-6 w-6" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 text-center", children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-lg font-semibold", children: title }), (0, jsx_runtime_1.jsx)("p", { className: "text-as-primary/60 text-sm", children: description })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-as-surface-secondary border-as-border-secondary flex h-12 w-full overflow-hidden rounded-xl border", children: [(0, jsx_runtime_1.jsx)("input", { type: "text", placeholder: placeholder, value: recipientAddress, onChange: e => setRecipientAddress(e.target.value), onKeyDown: handleKeyDown, className: classes?.searchInput ||
|
|
37
|
+
"text-as-primary placeholder:text-as-primary/50 flex-1 bg-transparent px-4 text-base focus:outline-none", autoFocus: autoFocus }), (0, jsx_runtime_1.jsx)("div", { className: "border-as-border-secondary border-l", children: (0, jsx_runtime_1.jsx)("button", { onClick: handlePaste, className: "text-as-primary/70 hover:text-as-primary hover:bg-as-surface-primary h-full px-4 font-semibold transition-colors", children: "Paste" }) })] }), recipientAddress && !isAddressValid && ((0, jsx_runtime_1.jsx)("div", { className: "text-as-red text-sm", children: "Please enter a valid address" })), (0, jsx_runtime_1.jsx)("button", { onClick: handleConfirm, disabled: !canConfirm, className: classes?.confirmButton ||
|
|
38
|
+
"bg-as-brand hover:bg-as-brand/90 disabled:bg-as-on-surface-2 disabled:text-as-secondary h-12 w-full rounded-xl font-medium text-white transition-colors disabled:cursor-not-allowed", children: confirmText })] })] }) }));
|
|
36
39
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
|
|
2
2
|
import { FiatPaymentMethod } from "./FiatPaymentMethod";
|
|
3
|
+
import type { TabSectionClasses } from "../types/classes";
|
|
3
4
|
interface TabSectionProps {
|
|
4
5
|
activeTab: "crypto" | "fiat";
|
|
5
6
|
setActiveTab: (tab: "crypto" | "fiat") => void;
|
|
6
7
|
setSelectedCryptoPaymentMethod: (method: CryptoPaymentMethodType) => void;
|
|
7
8
|
setSelectedFiatPaymentMethod: (method: FiatPaymentMethod) => void;
|
|
9
|
+
classes?: TabSectionClasses;
|
|
8
10
|
}
|
|
9
|
-
export declare function TabSection({ activeTab, setActiveTab, setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod, }: TabSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function TabSection({ activeTab, setActiveTab, setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod, classes, }: TabSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -5,14 +5,23 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const cn_1 = require("../../../../shared/utils/cn");
|
|
6
6
|
const CryptoPaymentMethod_1 = require("./CryptoPaymentMethod");
|
|
7
7
|
const FiatPaymentMethod_1 = require("./FiatPaymentMethod");
|
|
8
|
-
function TabSection({ activeTab, setActiveTab, setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod, }) {
|
|
9
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "tab-section w-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-as-surface-secondary relative mb-4 grid h-10 grid-cols-2 rounded-xl", children: [(0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)(
|
|
8
|
+
function TabSection({ activeTab, setActiveTab, setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod, classes, }) {
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: classes?.root || "tab-section w-full", children: (0, jsx_runtime_1.jsxs)("div", { className: classes?.container || "bg-as-surface-secondary relative mb-4 grid h-10 grid-cols-2 rounded-xl", children: [(0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)(classes?.tabIndicator ||
|
|
10
|
+
"bg-as-brand absolute bottom-0 left-0 top-0 z-0 h-full w-1/2 rounded-xl transition-transform duration-100", activeTab === "fiat" ? "translate-x-full" : "translate-x-0"), style: { willChange: "transform" } }), (0, jsx_runtime_1.jsx)("button", { className: (0, cn_1.cn)(activeTab === "crypto"
|
|
11
|
+
? classes?.tabButtonActive ||
|
|
12
|
+
"relative z-10 h-full w-full rounded-xl px-3 text-sm font-medium text-white transition-colors duration-100"
|
|
13
|
+
: classes?.tabButton ||
|
|
14
|
+
"text-as-primary/70 hover:bg-as-on-surface-2 relative z-10 h-full w-full rounded-xl bg-transparent px-3 text-sm font-medium transition-colors duration-100"), onClick: () => {
|
|
10
15
|
setActiveTab("crypto");
|
|
11
|
-
setSelectedCryptoPaymentMethod(CryptoPaymentMethod_1.CryptoPaymentMethodType.NONE);
|
|
12
|
-
setSelectedFiatPaymentMethod(FiatPaymentMethod_1.FiatPaymentMethod.NONE);
|
|
13
|
-
}, children: "Pay with crypto" }), (0, jsx_runtime_1.jsx)("button", { className: (0, cn_1.cn)(
|
|
16
|
+
setSelectedCryptoPaymentMethod(CryptoPaymentMethod_1.CryptoPaymentMethodType.NONE);
|
|
17
|
+
setSelectedFiatPaymentMethod(FiatPaymentMethod_1.FiatPaymentMethod.NONE);
|
|
18
|
+
}, children: "Pay with crypto" }), (0, jsx_runtime_1.jsx)("button", { className: (0, cn_1.cn)(activeTab === "fiat"
|
|
19
|
+
? classes?.tabButtonActive ||
|
|
20
|
+
"relative z-10 h-full w-full rounded-xl px-3 text-sm font-medium text-white transition-colors duration-100"
|
|
21
|
+
: classes?.tabButton ||
|
|
22
|
+
"text-as-primary/70 hover:bg-as-on-surface-2 relative z-10 h-full w-full rounded-xl bg-transparent px-3 text-sm font-medium transition-colors duration-100"), onClick: () => {
|
|
14
23
|
setActiveTab("fiat");
|
|
15
|
-
setSelectedCryptoPaymentMethod(CryptoPaymentMethod_1.CryptoPaymentMethodType.NONE);
|
|
16
|
-
setSelectedFiatPaymentMethod(FiatPaymentMethod_1.FiatPaymentMethod.NONE);
|
|
24
|
+
setSelectedCryptoPaymentMethod(CryptoPaymentMethod_1.CryptoPaymentMethodType.NONE);
|
|
25
|
+
setSelectedFiatPaymentMethod(FiatPaymentMethod_1.FiatPaymentMethod.NONE);
|
|
17
26
|
}, children: "Pay with Fiat" })] }) }));
|
|
18
27
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
|
|
3
|
+
import type { TransferCryptoDetailsClasses } from "../types/classes";
|
|
3
4
|
type Order = components["schemas"]["Order"];
|
|
4
5
|
type Token = components["schemas"]["Token"];
|
|
5
6
|
type Tournament = components["schemas"]["Tournament"];
|
|
@@ -13,6 +14,7 @@ interface TransferCryptoDetailsProps {
|
|
|
13
14
|
onBack: () => void;
|
|
14
15
|
recipientName?: string;
|
|
15
16
|
onPaymentMethodChange?: (method: CryptoPaymentMethodType) => void;
|
|
17
|
+
classes?: TransferCryptoDetailsClasses;
|
|
16
18
|
}
|
|
17
19
|
export declare const TransferCryptoDetails: import("react").NamedExoticComponent<TransferCryptoDetailsProps>;
|
|
18
20
|
export {};
|
|
@@ -15,7 +15,7 @@ const chains_1 = require("viem/chains");
|
|
|
15
15
|
const CryptoPaymentMethod_1 = require("./CryptoPaymentMethod");
|
|
16
16
|
const OrderDetailsCollapsible_1 = require("./OrderDetailsCollapsible");
|
|
17
17
|
const PaymentMethodSwitch_1 = require("./PaymentMethodSwitch");
|
|
18
|
-
exports.TransferCryptoDetails = (0, react_3.memo)(function TransferCryptoDetails({ order, srcToken, dstToken, tournament, nft, onBack, recipientName, onPaymentMethodChange, }) {
|
|
18
|
+
exports.TransferCryptoDetails = (0, react_3.memo)(function TransferCryptoDetails({ order, srcToken, dstToken, tournament, nft, onBack, recipientName, onPaymentMethodChange, classes, }) {
|
|
19
19
|
const [timeLeft, setTimeLeft] = (0, react_3.useState)(0);
|
|
20
20
|
(0, react_3.useEffect)(() => {
|
|
21
21
|
const calculateTimeLeft = () => {
|
|
@@ -66,7 +66,8 @@ exports.TransferCryptoDetails = (0, react_3.memo)(function TransferCryptoDetails
|
|
|
66
66
|
navigator.clipboard.writeText(order.globalAddress);
|
|
67
67
|
react_1.toast.success("Deposit address copied to clipboard");
|
|
68
68
|
};
|
|
69
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto flex w-full flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-header flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className:
|
|
69
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: classes?.container || "order-transfer-crypto flex w-full flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: classes?.header || "order-transfer-crypto-header flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: classes?.backButton ||
|
|
70
|
+
"order-transfer-crypto-back-btn text-as-primary/60 hover:text-as-primary flex h-10 w-10 items-center justify-center rounded-full transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { size: 24, className: "text-as-quaternary" }) }), (0, jsx_runtime_1.jsx)("h2", { className: classes?.title || "order-transfer-crypto-title text-as-primary text-lg font-semibold", children: "Transfer crypto" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-timer relative flex h-11 w-11 items-center justify-center", children: [(0, jsx_runtime_1.jsxs)("svg", { className: "order-transfer-crypto-timer-svg h-11 w-11 -rotate-90", viewBox: "0 0 44 44", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "22", cy: "22", r: "18", stroke: "currentColor", strokeWidth: "3", fill: "none", className: "order-transfer-crypto-timer-bg text-gray-200" }), (0, jsx_runtime_1.jsx)("circle", { cx: "22", cy: "22", r: "18", stroke: "currentColor", strokeWidth: "3", fill: "none", strokeLinecap: "round", className: "order-transfer-crypto-timer-progress text-blue-500", strokeDasharray: `${2 * Math.PI * 18}`, strokeDashoffset: `${2 * Math.PI * 18 * (1 - timeLeft / totalTime)}`, style: {
|
|
70
71
|
transition: "stroke-dashoffset 1s linear",
|
|
71
72
|
} })] }), (0, jsx_runtime_1.jsx)("div", { className: "order-transfer-crypto-timer-text absolute inset-0 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary text-[10px] font-semibold", children: formatTime(timeLeft) }) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-content flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-cards flex items-center gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-amount-card w-full", children: [(0, jsx_runtime_1.jsx)("span", { className: "order-transfer-crypto-amount-label text-as-content-secondary text-sm font-medium", children: "Amount" }), (0, jsx_runtime_1.jsx)("div", { className: "order-transfer-crypto-amount-container border-as-border-primary rounded-lg border p-2 shadow-sm", children: (0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: roundedUpSrcAmount || "", onCopy: () => {
|
|
72
73
|
react_1.toast.success("Amount copied to clipboard");
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { ChainWarningTextClasses, WarningTextClasses } from "../types/classes";
|
|
1
2
|
export interface WarningTextProps {
|
|
2
3
|
/** The warning message content */
|
|
3
4
|
children: React.ReactNode;
|
|
4
|
-
/**
|
|
5
|
-
|
|
5
|
+
/** Custom classes for styling */
|
|
6
|
+
classes?: WarningTextClasses;
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* A generic warning text component with consistent styling.
|
|
@@ -12,12 +13,12 @@ export interface WarningTextProps {
|
|
|
12
13
|
* Custom warning message
|
|
13
14
|
* </WarningText>
|
|
14
15
|
*/
|
|
15
|
-
export declare function WarningText({ children,
|
|
16
|
+
export declare function WarningText({ children, classes }: WarningTextProps): import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export interface ChainWarningTextProps {
|
|
17
18
|
/** The chain ID to display warning for */
|
|
18
19
|
chainId: number;
|
|
19
|
-
/**
|
|
20
|
-
|
|
20
|
+
/** Custom classes for styling */
|
|
21
|
+
classes?: ChainWarningTextClasses;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* A chain-aware warning text component that displays chain-specific warnings.
|
|
@@ -27,6 +28,6 @@ export interface ChainWarningTextProps {
|
|
|
27
28
|
* <ChainWarningText chainId={HYPERLIQUID_CHAIN_ID} />
|
|
28
29
|
*
|
|
29
30
|
* @example
|
|
30
|
-
* <ChainWarningText chainId={destinationChainId}
|
|
31
|
+
* <ChainWarningText chainId={destinationChainId} classes={{ root: "my-custom-class" }} />
|
|
31
32
|
*/
|
|
32
|
-
export declare function ChainWarningText({ chainId,
|
|
33
|
+
export declare function ChainWarningText({ chainId, classes }: ChainWarningTextProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -4,7 +4,6 @@ exports.WarningText = WarningText;
|
|
|
4
4
|
exports.ChainWarningText = ChainWarningText;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const anyspend_1 = require("../../../../anyspend");
|
|
7
|
-
const cn_1 = require("../../../../shared/utils/cn");
|
|
8
7
|
/**
|
|
9
8
|
* A generic warning text component with consistent styling.
|
|
10
9
|
*
|
|
@@ -13,8 +12,8 @@ const cn_1 = require("../../../../shared/utils/cn");
|
|
|
13
12
|
* Custom warning message
|
|
14
13
|
* </WarningText>
|
|
15
14
|
*/
|
|
16
|
-
function WarningText({ children,
|
|
17
|
-
return (0, jsx_runtime_1.jsx)("p", { className:
|
|
15
|
+
function WarningText({ children, classes }) {
|
|
16
|
+
return (0, jsx_runtime_1.jsx)("p", { className: classes?.root || "anyspend-warning text-center text-xs italic text-red-500", children: children });
|
|
18
17
|
}
|
|
19
18
|
/**
|
|
20
19
|
* A chain-aware warning text component that displays chain-specific warnings.
|
|
@@ -24,12 +23,12 @@ function WarningText({ children, className }) {
|
|
|
24
23
|
* <ChainWarningText chainId={HYPERLIQUID_CHAIN_ID} />
|
|
25
24
|
*
|
|
26
25
|
* @example
|
|
27
|
-
* <ChainWarningText chainId={destinationChainId}
|
|
26
|
+
* <ChainWarningText chainId={destinationChainId} classes={{ root: "my-custom-class" }} />
|
|
28
27
|
*/
|
|
29
|
-
function ChainWarningText({ chainId,
|
|
28
|
+
function ChainWarningText({ chainId, classes }) {
|
|
30
29
|
// Chain-specific warning messages
|
|
31
30
|
if (chainId === anyspend_1.HYPERLIQUID_CHAIN_ID) {
|
|
32
|
-
return ((0, jsx_runtime_1.jsxs)(WarningText, {
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)(WarningText, { classes: classes, children: ["Minimum deposit amount: ", (0, jsx_runtime_1.jsx)("b", { children: "$1" })] }));
|
|
33
32
|
}
|
|
34
33
|
// No warning for this chain
|
|
35
34
|
return null;
|
|
@@ -6,6 +6,7 @@ export { AnySpendCustom } from "./AnySpendCustom";
|
|
|
6
6
|
export { AnySpendCustomExactIn } from "./AnySpendCustomExactIn";
|
|
7
7
|
export { AnySpendDeposit } from "./AnySpendDeposit";
|
|
8
8
|
export type { AnySpendDepositProps, ChainConfig, DepositContractConfig } from "./AnySpendDeposit";
|
|
9
|
+
export type { AnySpendAllClasses, AnySpendClasses, AnySpendCustomExactInClasses, AnySpendDepositClasses, CryptoPaymentMethodClasses, CryptoPaySectionClasses, CryptoReceiveSectionClasses, FiatPaymentMethodClasses, OrderDetailsClasses, PanelOnrampClasses, QRDepositClasses, RecipientSelectionClasses, } from "./types/classes";
|
|
9
10
|
export { AnySpendDepositHype, HYPE_TOKEN_DETAILS } from "./AnyspendDepositHype";
|
|
10
11
|
export * from "./AnySpendFingerprintWrapper";
|
|
11
12
|
export { AnySpendNFT } from "./AnySpendNFT";
|