@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
|
@@ -18,6 +18,7 @@ import { ChainWarningText } from "./common/WarningText";
|
|
|
18
18
|
import { CreditCardIcon } from "./icons/CreditCardIcon";
|
|
19
19
|
import { QrCodeIcon } from "./icons/QrCodeIcon";
|
|
20
20
|
import { QRDeposit } from "./QRDeposit";
|
|
21
|
+
import type { AnySpendAllClasses } from "./types/classes";
|
|
21
22
|
|
|
22
23
|
export interface DepositContractConfig {
|
|
23
24
|
/** Custom function ABI JSON string */
|
|
@@ -116,6 +117,10 @@ export interface AnySpendDepositProps {
|
|
|
116
117
|
* Defaults to false.
|
|
117
118
|
*/
|
|
118
119
|
isCustomDeposit?: boolean;
|
|
120
|
+
/** Custom class names for styling specific elements */
|
|
121
|
+
classes?: AnySpendAllClasses;
|
|
122
|
+
/** When true, allows direct transfer without swap if source and destination token/chain are the same */
|
|
123
|
+
allowDirectTransfer?: boolean;
|
|
119
124
|
}
|
|
120
125
|
|
|
121
126
|
// Default supported chains
|
|
@@ -238,7 +243,11 @@ export function AnySpendDeposit({
|
|
|
238
243
|
customRecipientLabel,
|
|
239
244
|
returnHomeLabel,
|
|
240
245
|
isCustomDeposit = false,
|
|
246
|
+
classes,
|
|
247
|
+
allowDirectTransfer = false,
|
|
241
248
|
}: AnySpendDepositProps) {
|
|
249
|
+
// Extract deposit-specific classes for convenience
|
|
250
|
+
const depositClasses = classes?.deposit;
|
|
242
251
|
const { connectedEOAWallet } = useAccountWallet();
|
|
243
252
|
const eoaAddress = connectedEOAWallet?.getAccount()?.address;
|
|
244
253
|
|
|
@@ -368,16 +377,22 @@ export function AnySpendDeposit({
|
|
|
368
377
|
if (step === "select-chain") {
|
|
369
378
|
return (
|
|
370
379
|
<div
|
|
371
|
-
className={
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
380
|
+
className={
|
|
381
|
+
depositClasses?.chainSelection ||
|
|
382
|
+
cn(
|
|
383
|
+
"anyspend-deposit anyspend-deposit-chain-selection font-inter bg-as-surface-primary relative mx-auto w-full max-w-[460px]",
|
|
384
|
+
mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl",
|
|
385
|
+
)
|
|
386
|
+
}
|
|
375
387
|
>
|
|
376
388
|
{/* Close button */}
|
|
377
389
|
{onClose && (
|
|
378
390
|
<button
|
|
379
391
|
onClick={onClose}
|
|
380
|
-
className=
|
|
392
|
+
className={
|
|
393
|
+
depositClasses?.closeButton ||
|
|
394
|
+
"anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10"
|
|
395
|
+
}
|
|
381
396
|
>
|
|
382
397
|
<svg className="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
383
398
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
|
|
@@ -386,19 +401,35 @@ export function AnySpendDeposit({
|
|
|
386
401
|
)}
|
|
387
402
|
{/* Balance header */}
|
|
388
403
|
{!isBalanceLoading && totalBalance > 0 && (
|
|
389
|
-
<div
|
|
390
|
-
|
|
391
|
-
|
|
404
|
+
<div
|
|
405
|
+
className={
|
|
406
|
+
depositClasses?.balanceContainer || "anyspend-deposit-balance border-theme-border-secondary border-b p-5"
|
|
407
|
+
}
|
|
408
|
+
>
|
|
409
|
+
<p className={depositClasses?.balanceLabel || "anyspend-deposit-balance-label text-as-secondary text-sm"}>
|
|
410
|
+
Your Balance
|
|
411
|
+
</p>
|
|
412
|
+
<p
|
|
413
|
+
className={
|
|
414
|
+
depositClasses?.balanceValue || "anyspend-deposit-balance-value text-as-primary text-3xl font-semibold"
|
|
415
|
+
}
|
|
416
|
+
>
|
|
392
417
|
{formatDecimal(totalBalance)} <span className="text-sm">USD</span>
|
|
393
418
|
</p>
|
|
394
419
|
</div>
|
|
395
420
|
)}
|
|
396
|
-
<div className="anyspend-deposit-options flex flex-col gap-2 p-6">
|
|
421
|
+
<div className={depositClasses?.optionsContainer || "anyspend-deposit-options flex flex-col gap-2 p-6"}>
|
|
397
422
|
{/* Loading state */}
|
|
398
423
|
{isBalanceLoading && (
|
|
399
|
-
<div className="anyspend-deposit-chains-skeleton flex flex-col gap-2">
|
|
424
|
+
<div className={depositClasses?.chainsSkeleton || "anyspend-deposit-chains-skeleton flex flex-col gap-2"}>
|
|
400
425
|
{[1, 2].map((_, i) => (
|
|
401
|
-
<div
|
|
426
|
+
<div
|
|
427
|
+
key={i}
|
|
428
|
+
className={
|
|
429
|
+
depositClasses?.skeletonItem ||
|
|
430
|
+
"border-border-primary flex items-center justify-between rounded-xl border p-4"
|
|
431
|
+
}
|
|
432
|
+
>
|
|
402
433
|
<div className="flex items-center gap-3">
|
|
403
434
|
<Skeleton className="h-6 w-6 rounded-full" />
|
|
404
435
|
<div className="flex flex-col gap-1">
|
|
@@ -414,93 +445,163 @@ export function AnySpendDeposit({
|
|
|
414
445
|
|
|
415
446
|
{/* Top chains with balance */}
|
|
416
447
|
{topChainsWithBalance.length > 0 && (
|
|
417
|
-
<div className="anyspend-deposit-chains flex flex-col gap-2">
|
|
448
|
+
<div className={depositClasses?.chainsContainer || "anyspend-deposit-chains flex flex-col gap-2"}>
|
|
418
449
|
{topChainsWithBalance.map(chain => (
|
|
419
450
|
<button
|
|
420
451
|
key={chain.id}
|
|
421
452
|
onClick={() => handleSelectChain(chain.id)}
|
|
422
|
-
className=
|
|
453
|
+
className={
|
|
454
|
+
depositClasses?.chainButton ||
|
|
455
|
+
"anyspend-deposit-chain-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all"
|
|
456
|
+
}
|
|
423
457
|
>
|
|
424
|
-
<div className="anyspend-deposit-chain-content">
|
|
425
|
-
<div className="anyspend-deposit-chain-info">
|
|
426
|
-
<span
|
|
458
|
+
<div className={depositClasses?.chainContent || "anyspend-deposit-chain-content"}>
|
|
459
|
+
<div className={depositClasses?.chainInfo || "anyspend-deposit-chain-info"}>
|
|
460
|
+
<span
|
|
461
|
+
className={
|
|
462
|
+
depositClasses?.chainName ||
|
|
463
|
+
"anyspend-deposit-chain-name text-as-primary flex items-center gap-1.5 font-medium"
|
|
464
|
+
}
|
|
465
|
+
>
|
|
427
466
|
Deposit from {chain.name}
|
|
428
|
-
<ChainIcon chainId={chain.id} className="h-5 w-5" />
|
|
467
|
+
<ChainIcon chainId={chain.id} className={depositClasses?.chainIcon || "h-5 w-5"} />
|
|
429
468
|
</span>
|
|
430
|
-
<p
|
|
469
|
+
<p
|
|
470
|
+
className={
|
|
471
|
+
depositClasses?.chainBalance || "anyspend-deposit-chain-balance text-as-secondary text-xs"
|
|
472
|
+
}
|
|
473
|
+
>
|
|
431
474
|
{formatUsd(chain.balance)} available
|
|
432
475
|
</p>
|
|
433
476
|
</div>
|
|
434
477
|
</div>
|
|
435
|
-
<ChevronRight
|
|
478
|
+
<ChevronRight
|
|
479
|
+
className={
|
|
480
|
+
depositClasses?.chainChevron || "anyspend-deposit-chain-chevron text-as-secondary h-5 w-5"
|
|
481
|
+
}
|
|
482
|
+
/>
|
|
436
483
|
</button>
|
|
437
484
|
))}
|
|
438
485
|
</div>
|
|
439
486
|
)}
|
|
440
487
|
|
|
441
488
|
{/* General deposit options */}
|
|
442
|
-
<div className="anyspend-deposit-general-options flex flex-col gap-2">
|
|
489
|
+
<div className={depositClasses?.generalOptions || "anyspend-deposit-general-options flex flex-col gap-2"}>
|
|
443
490
|
{/* Deposit Crypto - any chain */}
|
|
444
491
|
<button
|
|
445
492
|
onClick={handleSelectCrypto}
|
|
446
|
-
className=
|
|
493
|
+
className={
|
|
494
|
+
depositClasses?.cryptoButton ||
|
|
495
|
+
"anyspend-deposit-option-button anyspend-deposit-crypto-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all"
|
|
496
|
+
}
|
|
447
497
|
>
|
|
448
|
-
<div className="anyspend-deposit-option-content">
|
|
449
|
-
<div className="anyspend-deposit-option-info">
|
|
450
|
-
<span
|
|
451
|
-
|
|
498
|
+
<div className={depositClasses?.optionContent || "anyspend-deposit-option-content"}>
|
|
499
|
+
<div className={depositClasses?.optionInfo || "anyspend-deposit-option-info"}>
|
|
500
|
+
<span
|
|
501
|
+
className={
|
|
502
|
+
depositClasses?.optionTitle || "anyspend-deposit-option-title text-as-primary font-medium"
|
|
503
|
+
}
|
|
504
|
+
>
|
|
505
|
+
Deposit Crypto
|
|
506
|
+
</span>
|
|
507
|
+
<p
|
|
508
|
+
className={
|
|
509
|
+
depositClasses?.optionDescription ||
|
|
510
|
+
"anyspend-deposit-option-description text-as-secondary text-xs"
|
|
511
|
+
}
|
|
512
|
+
>
|
|
452
513
|
Swap from any token on any chain
|
|
453
514
|
</p>
|
|
454
515
|
</div>
|
|
455
516
|
</div>
|
|
456
|
-
<ChevronRight
|
|
517
|
+
<ChevronRight
|
|
518
|
+
className={depositClasses?.optionChevron || "anyspend-deposit-option-chevron text-as-secondary h-5 w-5"}
|
|
519
|
+
/>
|
|
457
520
|
</button>
|
|
458
521
|
|
|
459
|
-
<div className="anyspend-deposit-divider flex items-center gap-3">
|
|
460
|
-
<div className="bg-as-stroke h-px flex-1" />
|
|
461
|
-
<span
|
|
462
|
-
|
|
522
|
+
<div className={depositClasses?.divider || "anyspend-deposit-divider flex items-center gap-3"}>
|
|
523
|
+
<div className={depositClasses?.dividerLine || "bg-as-stroke h-px flex-1"} />
|
|
524
|
+
<span
|
|
525
|
+
className={depositClasses?.dividerText || "anyspend-deposit-divider-text text-as-secondary text-sm"}
|
|
526
|
+
>
|
|
527
|
+
More options
|
|
528
|
+
</span>
|
|
529
|
+
<div className={depositClasses?.dividerLine || "bg-as-stroke h-px flex-1"} />
|
|
463
530
|
</div>
|
|
464
531
|
|
|
465
532
|
{/* Deposit with QR Code */}
|
|
466
533
|
<button
|
|
467
534
|
onClick={handleSelectQrDeposit}
|
|
468
|
-
className=
|
|
535
|
+
className={
|
|
536
|
+
depositClasses?.qrButton ||
|
|
537
|
+
"anyspend-deposit-option-button anyspend-deposit-qr-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all"
|
|
538
|
+
}
|
|
469
539
|
>
|
|
470
|
-
<div
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
540
|
+
<div
|
|
541
|
+
className={depositClasses?.optionContent || "anyspend-deposit-option-content flex items-center gap-3"}
|
|
542
|
+
>
|
|
543
|
+
<QrCodeIcon className={depositClasses?.optionIcon || "anyspend-deposit-option-icon h-10 w-10"} />
|
|
544
|
+
<div className={depositClasses?.optionInfo || "anyspend-deposit-option-info"}>
|
|
545
|
+
<span
|
|
546
|
+
className={
|
|
547
|
+
depositClasses?.optionTitle || "anyspend-deposit-option-title text-as-primary font-medium"
|
|
548
|
+
}
|
|
549
|
+
>
|
|
474
550
|
Deposit with QR Code
|
|
475
551
|
</span>
|
|
476
|
-
<p
|
|
552
|
+
<p
|
|
553
|
+
className={
|
|
554
|
+
depositClasses?.optionDescription ||
|
|
555
|
+
"anyspend-deposit-option-description text-as-secondary text-xs"
|
|
556
|
+
}
|
|
557
|
+
>
|
|
477
558
|
Send tokens directly to deposit address
|
|
478
559
|
</p>
|
|
479
560
|
</div>
|
|
480
561
|
</div>
|
|
481
|
-
<ChevronRight
|
|
562
|
+
<ChevronRight
|
|
563
|
+
className={depositClasses?.optionChevron || "anyspend-deposit-option-chevron text-as-secondary h-5 w-5"}
|
|
564
|
+
/>
|
|
482
565
|
</button>
|
|
483
566
|
|
|
484
567
|
{/* Fund with Fiat */}
|
|
485
568
|
<button
|
|
486
569
|
onClick={handleSelectFiat}
|
|
487
|
-
className=
|
|
570
|
+
className={
|
|
571
|
+
depositClasses?.fiatButton ||
|
|
572
|
+
"anyspend-deposit-option-button anyspend-deposit-fiat-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left transition-all"
|
|
573
|
+
}
|
|
488
574
|
>
|
|
489
|
-
<div
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
575
|
+
<div
|
|
576
|
+
className={depositClasses?.optionContent || "anyspend-deposit-option-content flex items-center gap-3"}
|
|
577
|
+
>
|
|
578
|
+
<CreditCardIcon className={depositClasses?.optionIcon || "anyspend-deposit-option-icon h-10 w-10"} />
|
|
579
|
+
<div className={depositClasses?.optionInfo || "anyspend-deposit-option-info"}>
|
|
580
|
+
<span
|
|
581
|
+
className={
|
|
582
|
+
depositClasses?.optionTitle || "anyspend-deposit-option-title text-as-primary font-medium"
|
|
583
|
+
}
|
|
584
|
+
>
|
|
585
|
+
Fund with Fiat
|
|
586
|
+
</span>
|
|
587
|
+
<p
|
|
588
|
+
className={
|
|
589
|
+
depositClasses?.optionDescription ||
|
|
590
|
+
"anyspend-deposit-option-description text-as-secondary text-xs"
|
|
591
|
+
}
|
|
592
|
+
>
|
|
494
593
|
Pay with card or bank transfer
|
|
495
594
|
</p>
|
|
496
595
|
</div>
|
|
497
596
|
</div>
|
|
498
|
-
<ChevronRight
|
|
597
|
+
<ChevronRight
|
|
598
|
+
className={depositClasses?.optionChevron || "anyspend-deposit-option-chevron text-as-secondary h-5 w-5"}
|
|
599
|
+
/>
|
|
499
600
|
</button>
|
|
500
601
|
</div>
|
|
501
602
|
|
|
502
603
|
{/* Chain-specific warning */}
|
|
503
|
-
<ChainWarningText chainId={destinationTokenChainId}
|
|
604
|
+
<ChainWarningText chainId={destinationTokenChainId} classes={classes?.chainWarningText || { root: "mt-2" }} />
|
|
504
605
|
</div>
|
|
505
606
|
</div>
|
|
506
607
|
);
|
|
@@ -517,23 +618,32 @@ export function AnySpendDeposit({
|
|
|
517
618
|
depositContractConfig={depositContractConfig}
|
|
518
619
|
onBack={handleBack}
|
|
519
620
|
onClose={onClose ?? handleBack}
|
|
621
|
+
classes={classes?.qrDeposit}
|
|
520
622
|
/>
|
|
521
623
|
);
|
|
522
624
|
}
|
|
523
625
|
|
|
524
626
|
// Deposit view
|
|
525
627
|
return (
|
|
526
|
-
<div className="anyspend-deposit anyspend-deposit-form relative">
|
|
628
|
+
<div className={depositClasses?.form || "anyspend-deposit anyspend-deposit-form relative"}>
|
|
527
629
|
{/* Back button - only show if we came from chain selection */}
|
|
528
630
|
{shouldShowChainSelection && (
|
|
529
631
|
<button
|
|
530
632
|
onClick={handleBack}
|
|
531
|
-
className=
|
|
633
|
+
className={
|
|
634
|
+
depositClasses?.backButton ||
|
|
635
|
+
"anyspend-deposit-back-button text-as-secondary hover:text-as-primary absolute left-4 top-4 z-10 flex items-center gap-1"
|
|
636
|
+
}
|
|
532
637
|
>
|
|
533
|
-
<svg
|
|
638
|
+
<svg
|
|
639
|
+
className={depositClasses?.backIcon || "anyspend-deposit-back-icon h-5 w-5"}
|
|
640
|
+
fill="none"
|
|
641
|
+
viewBox="0 0 24 24"
|
|
642
|
+
stroke="currentColor"
|
|
643
|
+
>
|
|
534
644
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" />
|
|
535
645
|
</svg>
|
|
536
|
-
<span className="anyspend-deposit-back-text text-sm">Back</span>
|
|
646
|
+
<span className={depositClasses?.backText || "anyspend-deposit-back-text text-sm"}>Back</span>
|
|
537
647
|
</button>
|
|
538
648
|
)}
|
|
539
649
|
|
|
@@ -541,7 +651,10 @@ export function AnySpendDeposit({
|
|
|
541
651
|
{onClose && (
|
|
542
652
|
<button
|
|
543
653
|
onClick={onClose}
|
|
544
|
-
className=
|
|
654
|
+
className={
|
|
655
|
+
depositClasses?.closeButton ||
|
|
656
|
+
"anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10"
|
|
657
|
+
}
|
|
545
658
|
>
|
|
546
659
|
<svg className="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
547
660
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
|
|
@@ -549,7 +662,11 @@ export function AnySpendDeposit({
|
|
|
549
662
|
</button>
|
|
550
663
|
)}
|
|
551
664
|
|
|
552
|
-
<div
|
|
665
|
+
<div
|
|
666
|
+
className={
|
|
667
|
+
depositClasses?.formContent || cn("anyspend-deposit-form-content", shouldShowChainSelection && "pt-8")
|
|
668
|
+
}
|
|
669
|
+
>
|
|
553
670
|
{isCustomDeposit ? (
|
|
554
671
|
<AnySpendCustomExactIn
|
|
555
672
|
key={selectedChainId}
|
|
@@ -574,6 +691,8 @@ export function AnySpendDeposit({
|
|
|
574
691
|
returnToHomeUrl={returnToHomeUrl}
|
|
575
692
|
customRecipientLabel={customRecipientLabel}
|
|
576
693
|
returnHomeLabel={returnHomeLabel}
|
|
694
|
+
classes={classes?.customExactIn}
|
|
695
|
+
allowDirectTransfer={allowDirectTransfer}
|
|
577
696
|
/>
|
|
578
697
|
) : (
|
|
579
698
|
<AnySpend
|
|
@@ -594,12 +713,17 @@ export function AnySpendDeposit({
|
|
|
594
713
|
returnToHomeUrl={returnToHomeUrl}
|
|
595
714
|
customRecipientLabel={customRecipientLabel}
|
|
596
715
|
returnHomeLabel={returnHomeLabel}
|
|
716
|
+
classes={classes?.anySpend}
|
|
717
|
+
allowDirectTransfer={allowDirectTransfer}
|
|
597
718
|
/>
|
|
598
719
|
)}
|
|
599
720
|
</div>
|
|
600
721
|
|
|
601
722
|
{/* Chain-specific warning */}
|
|
602
|
-
<ChainWarningText
|
|
723
|
+
<ChainWarningText
|
|
724
|
+
chainId={destinationTokenChainId}
|
|
725
|
+
classes={classes?.chainWarningText || { root: "px-4 pb-4" }}
|
|
726
|
+
/>
|
|
603
727
|
</div>
|
|
604
728
|
);
|
|
605
729
|
}
|
|
@@ -22,6 +22,7 @@ export function AnySpendStakeUpsideExactIn({
|
|
|
22
22
|
recipientAddress,
|
|
23
23
|
sourceTokenAddress,
|
|
24
24
|
sourceTokenChainId,
|
|
25
|
+
destinationTokenAmount,
|
|
25
26
|
stakingContractAddress,
|
|
26
27
|
token,
|
|
27
28
|
onSuccess,
|
|
@@ -33,6 +34,7 @@ export function AnySpendStakeUpsideExactIn({
|
|
|
33
34
|
sourceTokenChainId?: number;
|
|
34
35
|
stakingContractAddress: string;
|
|
35
36
|
token: components["schemas"]["Token"];
|
|
37
|
+
destinationTokenAmount?: string;
|
|
36
38
|
onSuccess?: (amount: string) => void;
|
|
37
39
|
}) {
|
|
38
40
|
if (!recipientAddress) return null;
|
|
@@ -65,6 +67,7 @@ export function AnySpendStakeUpsideExactIn({
|
|
|
65
67
|
sourceTokenChainId={sourceTokenChainId}
|
|
66
68
|
destinationToken={token}
|
|
67
69
|
destinationChainId={base.id}
|
|
70
|
+
destinationTokenAmount={destinationTokenAmount}
|
|
68
71
|
customExactInConfig={customExactInConfig}
|
|
69
72
|
header={header}
|
|
70
73
|
onSuccess={onSuccess}
|
|
@@ -14,6 +14,7 @@ import { ChainTokenIcon } from "./common/ChainTokenIcon";
|
|
|
14
14
|
import { OrderDetails } from "./common/OrderDetails";
|
|
15
15
|
import { TransferResultScreen } from "./common/TransferResultScreen";
|
|
16
16
|
import { ChainWarningText, WarningText } from "./common/WarningText";
|
|
17
|
+
import type { QRDepositClasses } from "./types/classes";
|
|
17
18
|
|
|
18
19
|
export interface QRDepositProps {
|
|
19
20
|
/** Display mode */
|
|
@@ -40,6 +41,8 @@ export interface QRDepositProps {
|
|
|
40
41
|
onOrderCreated?: (orderId: string) => void;
|
|
41
42
|
/** Callback when deposit is completed */
|
|
42
43
|
onSuccess?: (txHash?: string) => void;
|
|
44
|
+
/** Custom classes for styling */
|
|
45
|
+
classes?: QRDepositClasses;
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
// Default source token: ETH on Base
|
|
@@ -81,6 +84,7 @@ export function QRDeposit({
|
|
|
81
84
|
onClose,
|
|
82
85
|
onOrderCreated,
|
|
83
86
|
onSuccess,
|
|
87
|
+
classes,
|
|
84
88
|
}: QRDepositProps) {
|
|
85
89
|
const [copied, setCopied] = useState(false);
|
|
86
90
|
const [orderId, setOrderId] = useState<string | undefined>();
|
|
@@ -238,12 +242,17 @@ export function QRDeposit({
|
|
|
238
242
|
if (oat?.data && oat.data.depositTxs && oat.data.depositTxs.length > 0) {
|
|
239
243
|
return (
|
|
240
244
|
<div
|
|
241
|
-
className={
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
+
className={
|
|
246
|
+
classes?.orderDetailsContainer ||
|
|
247
|
+
cn(
|
|
248
|
+
"anyspend-container anyspend-qr-order-details font-inter bg-as-surface-primary mx-auto w-full max-w-[460px] p-6",
|
|
249
|
+
mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl",
|
|
250
|
+
)
|
|
251
|
+
}
|
|
245
252
|
>
|
|
246
|
-
<div
|
|
253
|
+
<div
|
|
254
|
+
className={classes?.orderDetailsContent || "anyspend-qr-order-details-content relative flex flex-col gap-4"}
|
|
255
|
+
>
|
|
247
256
|
<OrderDetails
|
|
248
257
|
mode={mode}
|
|
249
258
|
order={oat.data.order}
|
|
@@ -262,14 +271,26 @@ export function QRDeposit({
|
|
|
262
271
|
if (isCreatingOrder && !orderId && !isPureTransfer) {
|
|
263
272
|
return (
|
|
264
273
|
<div
|
|
265
|
-
className={
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
274
|
+
className={
|
|
275
|
+
classes?.loadingContainer ||
|
|
276
|
+
cn(
|
|
277
|
+
"anyspend-container anyspend-qr-loading font-inter bg-as-surface-primary mx-auto w-full max-w-[460px] p-6",
|
|
278
|
+
mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl",
|
|
279
|
+
)
|
|
280
|
+
}
|
|
269
281
|
>
|
|
270
|
-
<div
|
|
271
|
-
|
|
272
|
-
|
|
282
|
+
<div
|
|
283
|
+
className={
|
|
284
|
+
classes?.loadingContent ||
|
|
285
|
+
"anyspend-qr-loading-content flex flex-col items-center justify-center gap-4 py-12"
|
|
286
|
+
}
|
|
287
|
+
>
|
|
288
|
+
<Loader2
|
|
289
|
+
className={classes?.loadingSpinner || "anyspend-qr-loading-spinner text-as-brand h-8 w-8 animate-spin"}
|
|
290
|
+
/>
|
|
291
|
+
<p className={classes?.loadingText || "anyspend-qr-loading-text text-as-secondary text-sm"}>
|
|
292
|
+
Creating deposit order...
|
|
293
|
+
</p>
|
|
273
294
|
</div>
|
|
274
295
|
</div>
|
|
275
296
|
);
|
|
@@ -277,22 +298,31 @@ export function QRDeposit({
|
|
|
277
298
|
|
|
278
299
|
return (
|
|
279
300
|
<div
|
|
280
|
-
className={
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
301
|
+
className={
|
|
302
|
+
classes?.container ||
|
|
303
|
+
cn(
|
|
304
|
+
"anyspend-container anyspend-qr-deposit font-inter bg-as-surface-primary mx-auto w-full max-w-[460px] p-6",
|
|
305
|
+
mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl",
|
|
306
|
+
)
|
|
307
|
+
}
|
|
284
308
|
>
|
|
285
|
-
<div className="anyspend-qr-deposit-content flex flex-col gap-4">
|
|
309
|
+
<div className={classes?.content || "anyspend-qr-deposit-content flex flex-col gap-4"}>
|
|
286
310
|
{/* Header with back button and close button */}
|
|
287
|
-
<div className="anyspend-qr-header flex items-center justify-between">
|
|
288
|
-
<button
|
|
311
|
+
<div className={classes?.header || "anyspend-qr-header flex items-center justify-between"}>
|
|
312
|
+
<button
|
|
313
|
+
onClick={handleBack}
|
|
314
|
+
className={classes?.backButton || "anyspend-qr-back-button text-as-secondary hover:text-as-primary"}
|
|
315
|
+
>
|
|
289
316
|
<svg className="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
290
317
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" />
|
|
291
318
|
</svg>
|
|
292
319
|
</button>
|
|
293
|
-
<h2 className="anyspend-qr-title text-as-primary text-base font-semibold">Deposit</h2>
|
|
320
|
+
<h2 className={classes?.title || "anyspend-qr-title text-as-primary text-base font-semibold"}>Deposit</h2>
|
|
294
321
|
{onClose ? (
|
|
295
|
-
<button
|
|
322
|
+
<button
|
|
323
|
+
onClick={handleClose}
|
|
324
|
+
className={classes?.closeButton || "anyspend-qr-close-button text-as-secondary hover:text-as-primary"}
|
|
325
|
+
>
|
|
296
326
|
<svg className="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
297
327
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
|
|
298
328
|
</svg>
|
|
@@ -303,8 +333,10 @@ export function QRDeposit({
|
|
|
303
333
|
</div>
|
|
304
334
|
|
|
305
335
|
{/* Token selector */}
|
|
306
|
-
<div className="anyspend-qr-token-selector flex flex-col gap-1.5">
|
|
307
|
-
<label className="anyspend-qr-token-label text-as-secondary text-sm">
|
|
336
|
+
<div className={classes?.tokenSelectorContainer || "anyspend-qr-token-selector flex flex-col gap-1.5"}>
|
|
337
|
+
<label className={classes?.tokenSelectorLabel || "anyspend-qr-token-label text-as-secondary text-sm"}>
|
|
338
|
+
Send
|
|
339
|
+
</label>
|
|
308
340
|
<TokenSelector
|
|
309
341
|
chainIdsFilter={getAvailableChainIds("from")}
|
|
310
342
|
context="from"
|
|
@@ -320,7 +352,10 @@ export function QRDeposit({
|
|
|
320
352
|
<Button
|
|
321
353
|
variant="outline"
|
|
322
354
|
role="combobox"
|
|
323
|
-
className=
|
|
355
|
+
className={
|
|
356
|
+
classes?.tokenSelectorTrigger ||
|
|
357
|
+
"anyspend-qr-token-trigger border-as-stroke bg-as-surface-secondary flex h-auto w-full items-center justify-between gap-2 rounded-xl border px-3 py-2.5"
|
|
358
|
+
}
|
|
324
359
|
>
|
|
325
360
|
<div className="flex items-center gap-2">
|
|
326
361
|
{sourceToken.metadata?.logoURI ? (
|
|
@@ -344,27 +379,40 @@ export function QRDeposit({
|
|
|
344
379
|
</div>
|
|
345
380
|
|
|
346
381
|
{/* QR Code and Address - horizontal layout */}
|
|
347
|
-
<div
|
|
382
|
+
<div
|
|
383
|
+
className={
|
|
384
|
+
classes?.qrContent || "anyspend-qr-content border-as-stroke flex items-start gap-4 rounded-xl border p-4"
|
|
385
|
+
}
|
|
386
|
+
>
|
|
348
387
|
{/* QR Code */}
|
|
349
|
-
<div className="anyspend-qr-code-container flex flex-col items-center gap-2">
|
|
350
|
-
<div className="anyspend-qr-code rounded-lg bg-white p-2">
|
|
388
|
+
<div className={classes?.qrCodeContainer || "anyspend-qr-code-container flex flex-col items-center gap-2"}>
|
|
389
|
+
<div className={classes?.qrCode || "anyspend-qr-code rounded-lg bg-white p-2"}>
|
|
351
390
|
<QRCodeSVG value={displayAddress} size={120} level="M" marginSize={0} />
|
|
352
391
|
</div>
|
|
353
|
-
<span className="anyspend-qr-scan-hint text-as-secondary text-xs">
|
|
392
|
+
<span className={classes?.qrScanHint || "anyspend-qr-scan-hint text-as-secondary text-xs"}>
|
|
354
393
|
SCAN WITH <span className="inline-block">🦊</span>
|
|
355
394
|
</span>
|
|
356
395
|
</div>
|
|
357
396
|
|
|
358
397
|
{/* Address info */}
|
|
359
|
-
<div className="anyspend-qr-address-container flex flex-1 flex-col gap-1">
|
|
360
|
-
<span className="anyspend-qr-address-label text-as-secondary text-sm">
|
|
361
|
-
|
|
362
|
-
|
|
398
|
+
<div className={classes?.addressContainer || "anyspend-qr-address-container flex flex-1 flex-col gap-1"}>
|
|
399
|
+
<span className={classes?.addressLabel || "anyspend-qr-address-label text-as-secondary text-sm"}>
|
|
400
|
+
Deposit address:
|
|
401
|
+
</span>
|
|
402
|
+
<div className={classes?.addressRow || "anyspend-qr-address-row flex items-start gap-1"}>
|
|
403
|
+
<span
|
|
404
|
+
className={
|
|
405
|
+
classes?.address || "anyspend-qr-address text-as-primary break-all font-mono text-sm leading-relaxed"
|
|
406
|
+
}
|
|
407
|
+
>
|
|
363
408
|
{displayAddress}
|
|
364
409
|
</span>
|
|
365
410
|
<button
|
|
366
411
|
onClick={handleCopyAddress}
|
|
367
|
-
className=
|
|
412
|
+
className={
|
|
413
|
+
classes?.addressCopyIcon ||
|
|
414
|
+
"anyspend-qr-copy-icon text-as-secondary hover:text-as-primary mt-0.5 shrink-0"
|
|
415
|
+
}
|
|
368
416
|
>
|
|
369
417
|
{copied ? <Check className="h-4 w-4" /> : <Copy className="h-4 w-4" />}
|
|
370
418
|
</button>
|
|
@@ -381,7 +429,12 @@ export function QRDeposit({
|
|
|
381
429
|
|
|
382
430
|
{/* Watching indicator for pure transfers */}
|
|
383
431
|
{isPureTransfer && isWatchingTransfer && (
|
|
384
|
-
<div
|
|
432
|
+
<div
|
|
433
|
+
className={
|
|
434
|
+
classes?.watchingIndicator ||
|
|
435
|
+
"anyspend-qr-watching flex items-center justify-center gap-2 rounded-lg bg-blue-500/10 p-3"
|
|
436
|
+
}
|
|
437
|
+
>
|
|
385
438
|
<Loader2 className="h-4 w-4 animate-spin text-blue-500" />
|
|
386
439
|
<span className="text-sm text-blue-500">Watching for incoming transfer...</span>
|
|
387
440
|
</div>
|
|
@@ -390,7 +443,10 @@ export function QRDeposit({
|
|
|
390
443
|
{/* Copy button */}
|
|
391
444
|
<button
|
|
392
445
|
onClick={handleCopyAddress}
|
|
393
|
-
className=
|
|
446
|
+
className={
|
|
447
|
+
classes?.copyButton ||
|
|
448
|
+
"anyspend-qr-copy-button flex w-full items-center justify-center gap-2 rounded-xl bg-blue-500 py-3.5 font-medium text-white transition-all hover:bg-blue-600"
|
|
449
|
+
}
|
|
394
450
|
>
|
|
395
451
|
Copy deposit address
|
|
396
452
|
</button>
|