@b3dotfun/sdk 0.0.88-alpha.10 → 0.0.88-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/anyspend/constants/index.d.ts +0 -2
- package/dist/cjs/anyspend/constants/index.js +1 -3
- package/dist/cjs/anyspend/index.d.ts +0 -2
- package/dist/cjs/anyspend/index.js +0 -3
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +0 -6
- package/dist/cjs/anyspend/react/components/AnySpend.js +6 -9
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +1 -5
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +3 -3
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -6
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +20 -24
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +1 -7
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +3 -3
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +0 -4
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +1 -14
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +1 -3
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +2 -3
- package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +0 -4
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +6 -34
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +1 -3
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +2 -3
- package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.js +4 -3
- package/dist/cjs/anyspend/react/hooks/index.d.ts +0 -1
- package/dist/cjs/anyspend/react/hooks/index.js +0 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -1
- package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.js +1 -1
- package/dist/cjs/anyspend/react/hooks/useValidatedClientReferenceId.js +1 -1
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +3 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +57 -35
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +35 -38
- package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +1 -3
- package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +27 -0
- package/dist/cjs/global-account/react/components/B3Provider/types.js +24 -0
- package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +4 -14
- package/dist/cjs/global-account/react/components/B3Provider/useB3.js +11 -4
- package/dist/cjs/global-account/react/components/B3Provider/useB3Account.js +2 -5
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.js +17 -18
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +2 -1
- package/dist/cjs/global-account/react/components/ManageAccount/channels/DiscordChannel.js +6 -6
- package/dist/cjs/global-account/react/components/ManageAccount/channels/EmailChannel.js +7 -7
- package/dist/cjs/global-account/react/components/ManageAccount/channels/PhoneChannel.js +7 -7
- package/dist/cjs/global-account/react/components/ManageAccount/channels/TelegramChannel.js +5 -5
- package/dist/cjs/global-account/react/components/RequestPermissions/RequestPermissions.js +9 -8
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +20 -76
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +1 -1
- package/dist/cjs/global-account/react/components/StyleRoot.js +3 -3
- package/dist/cjs/global-account/react/components/TurnkeyAuthModal.js +1 -3
- package/dist/cjs/global-account/react/components/custom/ManageAccountButton.js +2 -1
- package/dist/cjs/global-account/react/components/index.d.ts +2 -1
- package/dist/cjs/global-account/react/components/index.js +6 -3
- package/dist/cjs/global-account/react/hooks/index.d.ts +0 -2
- package/dist/cjs/global-account/react/hooks/index.js +1 -5
- package/dist/cjs/global-account/react/hooks/useClient.js +1 -1
- package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.js +1 -1
- package/dist/cjs/global-account/react/hooks/useNotifications.js +14 -14
- package/dist/cjs/global-account/react/hooks/useTWAuth.d.ts +0 -3
- package/dist/cjs/global-account/react/hooks/useTWAuth.js +0 -8
- package/dist/cjs/global-account/react/hooks/useTokenBalance.js +5 -5
- package/dist/cjs/global-account/react/hooks/useTokenBalancesByChain.js +2 -4
- package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.js +22 -50
- package/dist/cjs/global-account/react/hooks/useUserQuery.js +35 -9
- package/dist/cjs/global-account/react/index.native.d.ts +2 -0
- package/dist/cjs/global-account/react/index.native.js +5 -1
- package/dist/cjs/global-account/react/stores/index.d.ts +0 -1
- package/dist/cjs/global-account/react/stores/index.js +1 -3
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +0 -10
- package/dist/esm/anyspend/constants/index.d.ts +0 -2
- package/dist/esm/anyspend/constants/index.js +0 -2
- package/dist/esm/anyspend/index.d.ts +0 -2
- package/dist/esm/anyspend/index.js +0 -3
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +0 -6
- package/dist/esm/anyspend/react/components/AnySpend.js +8 -11
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +1 -5
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +3 -3
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -6
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +4 -8
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +1 -7
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +3 -3
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +0 -4
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +1 -14
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +1 -3
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +2 -3
- package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +0 -4
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +8 -36
- package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +1 -3
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +2 -3
- package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.js +4 -3
- package/dist/esm/anyspend/react/hooks/index.d.ts +0 -1
- package/dist/esm/anyspend/react/hooks/index.js +0 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +2 -2
- package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +2 -2
- package/dist/esm/anyspend/react/hooks/useValidatedClientReferenceId.js +2 -2
- package/dist/esm/global-account/react/components/B3DynamicModal.js +4 -3
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +58 -34
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +36 -36
- package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +1 -3
- package/dist/esm/global-account/react/components/B3Provider/types.d.ts +27 -0
- package/dist/esm/global-account/react/components/B3Provider/types.js +21 -0
- package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +4 -14
- package/dist/esm/global-account/react/components/B3Provider/useB3.js +11 -4
- package/dist/esm/global-account/react/components/B3Provider/useB3Account.js +2 -5
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.js +17 -18
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +3 -2
- package/dist/esm/global-account/react/components/ManageAccount/channels/DiscordChannel.js +2 -2
- package/dist/esm/global-account/react/components/ManageAccount/channels/EmailChannel.js +2 -2
- package/dist/esm/global-account/react/components/ManageAccount/channels/PhoneChannel.js +2 -2
- package/dist/esm/global-account/react/components/ManageAccount/channels/TelegramChannel.js +2 -2
- package/dist/esm/global-account/react/components/RequestPermissions/RequestPermissions.js +3 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +20 -76
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +2 -2
- package/dist/esm/global-account/react/components/StyleRoot.js +3 -3
- package/dist/esm/global-account/react/components/TurnkeyAuthModal.js +3 -5
- package/dist/esm/global-account/react/components/custom/ManageAccountButton.js +3 -2
- package/dist/esm/global-account/react/components/index.d.ts +2 -1
- package/dist/esm/global-account/react/components/index.js +2 -1
- package/dist/esm/global-account/react/hooks/index.d.ts +0 -2
- package/dist/esm/global-account/react/hooks/index.js +0 -2
- package/dist/esm/global-account/react/hooks/useClient.js +2 -2
- package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.js +2 -2
- package/dist/esm/global-account/react/hooks/useNotifications.js +2 -2
- package/dist/esm/global-account/react/hooks/useTWAuth.d.ts +0 -3
- package/dist/esm/global-account/react/hooks/useTWAuth.js +0 -8
- package/dist/esm/global-account/react/hooks/useTokenBalance.js +6 -6
- package/dist/esm/global-account/react/hooks/useTokenBalancesByChain.js +2 -4
- package/dist/esm/global-account/react/hooks/useTurnkeyAuth.js +22 -50
- package/dist/esm/global-account/react/hooks/useUserQuery.js +27 -1
- package/dist/esm/global-account/react/index.native.d.ts +2 -0
- package/dist/esm/global-account/react/index.native.js +2 -0
- package/dist/esm/global-account/react/stores/index.d.ts +0 -1
- package/dist/esm/global-account/react/stores/index.js +0 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +0 -10
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/constants/index.d.ts +0 -2
- package/dist/types/anyspend/index.d.ts +0 -2
- package/dist/types/anyspend/react/components/AnySpend.d.ts +0 -6
- package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +1 -5
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -6
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +1 -7
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +0 -4
- package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +1 -3
- package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +0 -4
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +1 -3
- package/dist/types/anyspend/react/hooks/index.d.ts +0 -1
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +18 -2
- package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
- package/dist/types/global-account/react/components/B3Provider/types.d.ts +27 -0
- package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +4 -14
- package/dist/types/global-account/react/components/B3Provider/useB3Config.d.ts +2 -10
- package/dist/types/global-account/react/components/index.d.ts +2 -1
- package/dist/types/global-account/react/hooks/index.d.ts +0 -2
- package/dist/types/global-account/react/hooks/useTWAuth.d.ts +0 -3
- package/dist/types/global-account/react/index.native.d.ts +2 -0
- package/dist/types/global-account/react/stores/index.d.ts +0 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +0 -10
- package/package.json +1 -1
- package/src/anyspend/constants/index.ts +0 -3
- package/src/anyspend/index.ts +0 -4
- package/src/anyspend/react/components/AnySpend.tsx +2 -28
- package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +0 -6
- package/src/anyspend/react/components/AnySpendCustom.tsx +47 -52
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +0 -23
- package/src/anyspend/react/components/AnySpendDeposit.tsx +1 -18
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +0 -4
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +1 -15
- package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +1 -5
- package/src/anyspend/react/components/common/OrderDetails.tsx +42 -60
- package/src/anyspend/react/components/common/PanelOnramp.tsx +1 -5
- package/src/anyspend/react/components/common/PaymentStripeWeb2.tsx +4 -3
- package/src/anyspend/react/hooks/index.ts +0 -1
- package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +2 -2
- package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +2 -2
- package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +2 -2
- package/src/anyspend/react/hooks/useValidatedClientReferenceId.ts +2 -2
- package/src/global-account/react/components/B3DynamicModal.tsx +4 -3
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +54 -43
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +117 -44
- package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +1 -4
- package/src/global-account/react/components/B3Provider/types.ts +50 -0
- package/src/global-account/react/components/B3Provider/useB3.ts +13 -4
- package/src/global-account/react/components/B3Provider/useB3Account.ts +2 -6
- package/src/global-account/react/components/B3Provider/useB3Config.ts +31 -18
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +4 -2
- package/src/global-account/react/components/ManageAccount/channels/DiscordChannel.tsx +2 -2
- package/src/global-account/react/components/ManageAccount/channels/EmailChannel.tsx +2 -2
- package/src/global-account/react/components/ManageAccount/channels/PhoneChannel.tsx +2 -2
- package/src/global-account/react/components/ManageAccount/channels/TelegramChannel.tsx +2 -2
- package/src/global-account/react/components/RequestPermissions/RequestPermissions.tsx +4 -4
- package/src/global-account/react/components/SignInWithB3/SignIn.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +100 -168
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/steps/LoginStep.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +2 -2
- package/src/global-account/react/components/StyleRoot.tsx +3 -3
- package/src/global-account/react/components/TurnkeyAuthModal.tsx +4 -7
- package/src/global-account/react/components/custom/ManageAccountButton.tsx +3 -2
- package/src/global-account/react/components/index.ts +2 -1
- package/src/global-account/react/hooks/index.ts +0 -2
- package/src/global-account/react/hooks/useClient.ts +2 -2
- package/src/global-account/react/hooks/useHandleConnectWithPrivy.tsx +2 -2
- package/src/global-account/react/hooks/useNotifications.ts +2 -2
- package/src/global-account/react/hooks/useTWAuth.tsx +0 -10
- package/src/global-account/react/hooks/useTokenBalance.tsx +7 -8
- package/src/global-account/react/hooks/useTokenBalancesByChain.tsx +2 -4
- package/src/global-account/react/hooks/useTurnkeyAuth.ts +23 -54
- package/src/global-account/react/hooks/useUserQuery.ts +40 -1
- package/src/global-account/react/index.native.ts +2 -0
- package/src/global-account/react/stores/index.ts +0 -1
- package/src/global-account/react/stores/useModalStore.ts +0 -10
- package/dist/cjs/anyspend/react/components/common/GasIndicator.d.ts +0 -6
- package/dist/cjs/anyspend/react/components/common/GasIndicator.js +0 -34
- package/dist/cjs/anyspend/react/hooks/useGasPrice.d.ts +0 -37
- package/dist/cjs/anyspend/react/hooks/useGasPrice.js +0 -43
- package/dist/cjs/anyspend/services/gas.d.ts +0 -21
- package/dist/cjs/anyspend/services/gas.js +0 -65
- package/dist/cjs/anyspend/types/gas.d.ts +0 -61
- package/dist/cjs/anyspend/types/gas.js +0 -2
- package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
- package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.js +0 -12
- package/dist/cjs/global-account/react/hooks/useAuth.d.ts +0 -76
- package/dist/cjs/global-account/react/hooks/useAuth.js +0 -337
- package/dist/cjs/global-account/react/hooks/useUser.d.ts +0 -60
- package/dist/cjs/global-account/react/hooks/useUser.js +0 -20
- package/dist/cjs/global-account/react/stores/configStore.d.ts +0 -24
- package/dist/cjs/global-account/react/stores/configStore.js +0 -30
- package/dist/cjs/global-account/react/stores/userStore.d.ts +0 -22
- package/dist/cjs/global-account/react/stores/userStore.js +0 -30
- package/dist/esm/anyspend/react/components/common/GasIndicator.d.ts +0 -6
- package/dist/esm/anyspend/react/components/common/GasIndicator.js +0 -31
- package/dist/esm/anyspend/react/hooks/useGasPrice.d.ts +0 -37
- package/dist/esm/anyspend/react/hooks/useGasPrice.js +0 -40
- package/dist/esm/anyspend/services/gas.d.ts +0 -21
- package/dist/esm/anyspend/services/gas.js +0 -59
- package/dist/esm/anyspend/types/gas.d.ts +0 -61
- package/dist/esm/anyspend/types/gas.js +0 -1
- package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
- package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.js +0 -10
- package/dist/esm/global-account/react/hooks/useAuth.d.ts +0 -76
- package/dist/esm/global-account/react/hooks/useAuth.js +0 -331
- package/dist/esm/global-account/react/hooks/useUser.d.ts +0 -60
- package/dist/esm/global-account/react/hooks/useUser.js +0 -17
- package/dist/esm/global-account/react/stores/configStore.d.ts +0 -24
- package/dist/esm/global-account/react/stores/configStore.js +0 -27
- package/dist/esm/global-account/react/stores/userStore.d.ts +0 -22
- package/dist/esm/global-account/react/stores/userStore.js +0 -27
- package/dist/types/anyspend/react/components/common/GasIndicator.d.ts +0 -6
- package/dist/types/anyspend/react/hooks/useGasPrice.d.ts +0 -37
- package/dist/types/anyspend/services/gas.d.ts +0 -21
- package/dist/types/anyspend/types/gas.d.ts +0 -61
- package/dist/types/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +0 -5
- package/dist/types/global-account/react/hooks/useAuth.d.ts +0 -76
- package/dist/types/global-account/react/hooks/useUser.d.ts +0 -60
- package/dist/types/global-account/react/stores/configStore.d.ts +0 -24
- package/dist/types/global-account/react/stores/userStore.d.ts +0 -22
- package/src/anyspend/react/components/common/GasIndicator.tsx +0 -59
- package/src/anyspend/react/hooks/useGasPrice.ts +0 -70
- package/src/anyspend/services/gas.test.ts +0 -31
- package/src/anyspend/services/gas.ts +0 -73
- package/src/anyspend/types/gas.ts +0 -66
- package/src/global-account/react/components/B3Provider/AuthenticationProvider.tsx +0 -19
- package/src/global-account/react/hooks/useAuth.ts +0 -379
- package/src/global-account/react/hooks/useUser.ts +0 -20
- package/src/global-account/react/stores/configStore.ts +0 -51
- package/src/global-account/react/stores/userStore.ts +0 -41
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { eqci, getDefaultToken, getHyperliquidUSDCToken, HYPERLIQUID_CHAIN_ID, HYPERLIQUID_USDC_ADDRESS, USDC_BASE, ZERO_ADDRESS, } from "../../../anyspend/index.js";
|
|
4
|
-
import { useAnyspendCreateOnrampOrder, useAnyspendCreateOrder, useAnyspendOrderAndTransactions, useAnyspendQuote,
|
|
5
|
-
import { Button, ShinyButton, StyleRoot, TabsPrimitive, toast, TransitionPanel, useAccountWallet,
|
|
4
|
+
import { useAnyspendCreateOnrampOrder, useAnyspendCreateOrder, useAnyspendOrderAndTransactions, useAnyspendQuote, useGeoOnrampOptions, } from "../../../anyspend/react/index.js";
|
|
5
|
+
import { Button, ShinyButton, StyleRoot, TabsPrimitive, toast, TransitionPanel, useAccountWallet, useB3, useModalStore, useProfile, useRouter, useSearchParamsSSR, useTokenBalanceDirect, useTokenData, useTokenFromUrl, } from "../../../global-account/react/index.js";
|
|
6
6
|
import BottomNavigation from "../../../global-account/react/components/ManageAccount/BottomNavigation.js";
|
|
7
7
|
import { useAccountWalletImage } from "../../../global-account/react/hooks/useAccountWallet.js";
|
|
8
8
|
import { getThirdwebChain } from "../../../shared/constants/chains/supported.js";
|
|
@@ -24,7 +24,6 @@ import { CryptoPaySection } from "./common/CryptoPaySection.js";
|
|
|
24
24
|
import { CryptoReceiveSection } from "./common/CryptoReceiveSection.js";
|
|
25
25
|
import { FeeDetailPanel } from "./common/FeeDetailPanel.js";
|
|
26
26
|
import { FiatPaymentMethod, FiatPaymentMethodComponent } from "./common/FiatPaymentMethod.js";
|
|
27
|
-
import { GasIndicator } from "./common/GasIndicator.js";
|
|
28
27
|
import { OrderDetails, OrderDetailsLoadingView } from "./common/OrderDetails.js";
|
|
29
28
|
import { OrderHistory } from "./common/OrderHistory.js";
|
|
30
29
|
import { PanelOnramp } from "./common/PanelOnramp.js";
|
|
@@ -51,10 +50,10 @@ export function AnySpend(props) {
|
|
|
51
50
|
const fingerprintConfig = getFingerprintConfig();
|
|
52
51
|
return (_jsx(AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: _jsx(AnySpendInner, { ...props }) }));
|
|
53
52
|
}
|
|
54
|
-
function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, hideHeader, hideBottomNavigation = false, disableUrlParamManagement = false,
|
|
53
|
+
function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, hideHeader, hideBottomNavigation = false, disableUrlParamManagement = false, }) {
|
|
55
54
|
const searchParams = useSearchParamsSSR();
|
|
56
55
|
const router = useRouter();
|
|
57
|
-
const { partnerId } =
|
|
56
|
+
const { partnerId } = useB3();
|
|
58
57
|
const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
|
|
59
58
|
// Determine if we're in "buy mode" based on whether destination token props are provided
|
|
60
59
|
const isBuyMode = !!(destinationTokenAddress && destinationTokenChainId);
|
|
@@ -366,8 +365,6 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
|
|
|
366
365
|
});
|
|
367
366
|
// Get geo-based onramp options for fiat payments
|
|
368
367
|
const { geoData, coinbaseAvailablePaymentMethods, stripeOnrampSupport, stripeWeb2Support } = useGeoOnrampOptions(srcAmountOnRamp);
|
|
369
|
-
// Get gas price for source chain (where the user pays from)
|
|
370
|
-
const { gasPrice: gasPriceData, isLoading: isLoadingGas } = useGasPrice(selectedSrcChainId);
|
|
371
368
|
// Helper function to map payment method to onramp vendor
|
|
372
369
|
const getOnrampVendor = (paymentMethod) => {
|
|
373
370
|
switch (paymentMethod) {
|
|
@@ -821,7 +818,7 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
|
|
|
821
818
|
navigateBack();
|
|
822
819
|
// Reset payment methods when going back
|
|
823
820
|
resetPaymentMethods();
|
|
824
|
-
}
|
|
821
|
+
} })) }) }));
|
|
825
822
|
const mainView = (_jsxs("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2 pt-5", children: [_jsxs("div", { className: "flex w-full max-w-full flex-col items-center gap-2 px-5", children: [isBuyMode && !hideHeader && (_jsxs("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: [selectedDstToken.metadata?.logoURI && (_jsx("div", { className: "relative", children: _jsx("img", { src: selectedDstToken.metadata.logoURI, alt: selectedDstToken.symbol, className: "border-as-stroke h-12 w-12 rounded-full border-2 shadow-md" }) })), _jsx("div", { children: _jsxs("h1", { className: "text-as-primary text-xl font-bold", children: ["Buy ", selectedDstToken.symbol] }) })] })), _jsx(TabSection, { activeTab: activeTab, setActiveTab: tab => {
|
|
826
823
|
setActiveTab(tab);
|
|
827
824
|
// Reset payment methods when switching tabs
|
|
@@ -836,7 +833,7 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
|
|
|
836
833
|
else {
|
|
837
834
|
setActivePanel(panelIndex);
|
|
838
835
|
}
|
|
839
|
-
}, _recipientAddress: effectiveRecipientAddress, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, destinationAmount: dstAmount, onDestinationTokenChange: setSelectedDstToken, onDestinationChainChange: setSelectedDstChainId, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION, hideDstToken: isBuyMode, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward"), onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward"), customUsdInputValues: customUsdInputValues
|
|
836
|
+
}, _recipientAddress: effectiveRecipientAddress, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, destinationAmount: dstAmount, onDestinationTokenChange: setSelectedDstToken, onDestinationChainChange: setSelectedDstChainId, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION, hideDstToken: isBuyMode, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward"), onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward"), customUsdInputValues: customUsdInputValues }) })), activeTab === "crypto" && (_jsx("div", { className: "z-10 -my-6 flex justify-center", children: _jsx(Button, { variant: "ghost", className: cn("border-as-stroke bg-as-surface-primary h-10 w-10 rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl", isBuyMode && "cursor-default", selectedDstChainId === HYPERLIQUID_CHAIN_ID && "cursor-not-allowed opacity-50"), onClick: () => {
|
|
840
837
|
if (isBuyMode) {
|
|
841
838
|
return;
|
|
842
839
|
}
|
|
@@ -853,10 +850,10 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
|
|
|
853
850
|
// Swap amounts
|
|
854
851
|
setSrcAmount(dstAmount);
|
|
855
852
|
setDstAmount(srcAmount);
|
|
856
|
-
}, children: _jsx("div", { className: "relative flex items-center justify-center transition-opacity", children: _jsx(ArrowDown, { className: "text-as-primary/50 h-5 w-5" }) }) }) })), activeTab === "crypto" && (_jsx(CryptoReceiveSection, { isDepositMode: false, isBuyMode: isBuyMode, effectiveRecipientAddress: effectiveRecipientAddress, recipientName: recipientName || undefined,
|
|
853
|
+
}, children: _jsx("div", { className: "relative flex items-center justify-center transition-opacity", children: _jsx(ArrowDown, { className: "text-as-primary/50 h-5 w-5" }) }) }) })), activeTab === "crypto" && (_jsx(CryptoReceiveSection, { isDepositMode: false, isBuyMode: isBuyMode, effectiveRecipientAddress: effectiveRecipientAddress, recipientName: recipientName || undefined, onSelectRecipient: () => navigateToPanel(PanelView.RECIPIENT_SELECTION, "forward"), dstAmount: dstAmount, dstToken: selectedDstToken, selectedDstChainId: selectedDstChainId, setSelectedDstChainId: setSelectedDstChainId, setSelectedDstToken: setSelectedDstToken, isSrcInputDirty: isSrcInputDirty, onChangeDstAmount: value => {
|
|
857
854
|
setIsSrcInputDirty(false);
|
|
858
855
|
setDstAmount(value);
|
|
859
|
-
}, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward"), onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward") }))] }),
|
|
856
|
+
}, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward"), onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward") }))] }), _jsxs(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: cn("mt-4 flex w-full max-w-[460px] flex-col gap-2"), children: [_jsx(ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: cn("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: _jsxs("div", { className: "flex items-center justify-center gap-2", children: [btnInfo.loading && _jsx(Loader2, { className: "h-4 w-4 animate-spin" }), btnInfo.text] }) }), !hideTransactionHistoryButton && (globalAddress || effectiveRecipientAddress) ? (_jsxs(Button, { variant: "link", onClick: onClickHistory, className: "text-as-primary/50 hover:text-as-primary flex items-center gap-1 transition-colors", children: [_jsx(HistoryIcon, { className: "h-4 w-4" }), " ", _jsx("span", { className: "pr-4", children: "Transaction History" })] })) : null] })] }), _jsx("div", { className: "w-full", children: _jsx(TabsPrimitive, { defaultValue: "swap", onValueChange: value => {
|
|
860
857
|
if (value === "settings" || value === "home") {
|
|
861
858
|
setB3ModalContentType({
|
|
862
859
|
type: "manageAccount",
|
|
@@ -61,9 +61,5 @@ export interface AnySpendCollectorClubPurchaseProps {
|
|
|
61
61
|
* The partner ID
|
|
62
62
|
*/
|
|
63
63
|
packType: string;
|
|
64
|
-
/**
|
|
65
|
-
* Force fiat payment
|
|
66
|
-
*/
|
|
67
|
-
forceFiatPayment?: boolean;
|
|
68
64
|
}
|
|
69
|
-
export declare function AnySpendCollectorClubPurchase({ loadOrder, mode, activeTab, packId, packAmount, pricePerPack, paymentToken, recipientAddress, spenderAddress, onSuccess, header, showRecipient, vendingMachineId, packType,
|
|
65
|
+
export declare function AnySpendCollectorClubPurchase({ loadOrder, mode, activeTab, packId, packAmount, pricePerPack, paymentToken, recipientAddress, spenderAddress, onSuccess, header, showRecipient, vendingMachineId, packType, }: AnySpendCollectorClubPurchaseProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -45,7 +45,7 @@ const BUY_PACKS_FOR_ABI = {
|
|
|
45
45
|
stateMutability: "nonpayable",
|
|
46
46
|
type: "function",
|
|
47
47
|
};
|
|
48
|
-
export function AnySpendCollectorClubPurchase({ loadOrder, mode = "modal", activeTab = "crypto", packId, packAmount, pricePerPack, paymentToken = USDC_BASE, recipientAddress, spenderAddress = CC_SHOP_ADDRESS, onSuccess, header, showRecipient = true, vendingMachineId, packType,
|
|
48
|
+
export function AnySpendCollectorClubPurchase({ loadOrder, mode = "modal", activeTab = "crypto", packId, packAmount, pricePerPack, paymentToken = USDC_BASE, recipientAddress, spenderAddress = CC_SHOP_ADDRESS, onSuccess, header, showRecipient = true, vendingMachineId, packType, }) {
|
|
49
49
|
// Calculate total amount needed (pricePerPack * packAmount)
|
|
50
50
|
const totalAmount = useMemo(() => {
|
|
51
51
|
try {
|
|
@@ -84,5 +84,5 @@ export function AnySpendCollectorClubPurchase({ loadOrder, mode = "modal", activ
|
|
|
84
84
|
pricePerPack,
|
|
85
85
|
vendingMachineId,
|
|
86
86
|
packType,
|
|
87
|
-
}, header: header || defaultHeader, onSuccess: onSuccess, showRecipient: showRecipient, srcFiatAmount: srcFiatAmount
|
|
87
|
+
}, header: header || defaultHeader, onSuccess: onSuccess, showRecipient: showRecipient, srcFiatAmount: srcFiatAmount }));
|
|
88
88
|
}
|
|
@@ -107,7 +107,7 @@ export function AnySpendCustom(props) {
|
|
|
107
107
|
const fingerprintConfig = getFingerprintConfig();
|
|
108
108
|
return (_jsx(AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: _jsx(AnySpendCustomInner, { ...props }) }));
|
|
109
109
|
}
|
|
110
|
-
function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabProps = "crypto", recipientAddress: recipientAddressProps, spenderAddress, orderType, dstChainId, dstToken, dstAmount, contractAddress, encodedData, metadata, header, onSuccess, showRecipient = true, onShowPointsDetail, srcFiatAmount: srcFiatAmountProps,
|
|
110
|
+
function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabProps = "crypto", recipientAddress: recipientAddressProps, spenderAddress, orderType, dstChainId, dstToken, dstAmount, contractAddress, encodedData, metadata, header, onSuccess, showRecipient = true, onShowPointsDetail, srcFiatAmount: srcFiatAmountProps, }) {
|
|
111
111
|
const hasMounted = useHasMounted();
|
|
112
112
|
const searchParams = useSearchParamsSSR();
|
|
113
113
|
const router = useRouter();
|
|
@@ -506,7 +506,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
506
506
|
return null;
|
|
507
507
|
};
|
|
508
508
|
// Confirm order view.
|
|
509
|
-
const confirmOrderView = (_jsxs("div", { className: "relative mx-auto flex w-full flex-col items-center", children: [header({ anyspendPrice: anyspendQuote, isLoadingAnyspendPrice: isLoadingAnyspendQuote }), _jsxs(Tabs, { value: activeTab, onValueChange: value => setActiveTab(value), className: "bg-b3-react-background max-h-[60dvh] w-full overflow-y-auto p-5", children: [
|
|
509
|
+
const confirmOrderView = (_jsxs("div", { className: "relative mx-auto flex w-full flex-col items-center", children: [header({ anyspendPrice: anyspendQuote, isLoadingAnyspendPrice: isLoadingAnyspendQuote }), _jsxs(Tabs, { value: activeTab, onValueChange: value => setActiveTab(value), className: "bg-b3-react-background max-h-[60dvh] w-full overflow-y-auto p-5", children: [_jsx("div", { className: "w-full", children: _jsxs("div", { className: "bg-as-surface-secondary relative mb-4 grid h-10 grid-cols-2 rounded-xl", children: [_jsx("div", { className: cn("bg-as-brand absolute bottom-0 left-0 top-0 z-0 rounded-xl transition-transform duration-100", "h-full w-1/2", activeTab === "fiat" ? "translate-x-full" : "translate-x-0"), style: { willChange: "transform" } }), _jsx("button", { className: cn("relative z-10 h-full w-full rounded-xl px-3 text-sm font-medium transition-colors duration-100", activeTab === "crypto" ? "text-white" : "text-as-primary/70 hover:bg-as-on-surface-2 bg-transparent"), onClick: () => {
|
|
510
510
|
setActiveTab("crypto");
|
|
511
511
|
// Reset payment methods when switching tabs
|
|
512
512
|
resetPaymentMethods();
|
|
@@ -516,7 +516,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
516
516
|
// Reset payment methods when switching tabs
|
|
517
517
|
resetPaymentMethods();
|
|
518
518
|
setSelectedFiatPaymentMethod(FiatPaymentMethod.NONE);
|
|
519
|
-
}, children: "Pay with fiat" })) : (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { className: cn("relative z-10 h-full w-full rounded-xl px-3 text-sm font-medium transition-colors duration-100", "text-as-primary/50 cursor-not-allowed bg-transparent"), disabled: true, children: "Pay with fiat" }) }), _jsx(TooltipContent, { children: _jsx("span", { className: "text-as-primary w-[140px]", children: "Fiat payments are not supported for this amount" }) })] }))] }) })
|
|
519
|
+
}, children: "Pay with fiat" })) : (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { className: cn("relative z-10 h-full w-full rounded-xl px-3 text-sm font-medium transition-colors duration-100", "text-as-primary/50 cursor-not-allowed bg-transparent"), disabled: true, children: "Pay with fiat" }) }), _jsx(TooltipContent, { children: _jsx("span", { className: "text-as-primary w-[140px]", children: "Fiat payments are not supported for this amount" }) })] }))] }) }), _jsx(TabsContent, { value: "crypto", children: _jsxs("div", { className: "mt-2 flex flex-col gap-6", children: [_jsxs("div", { className: "border-as-border-secondary bg-as-surface-secondary flex w-full flex-col gap-4 rounded-xl border p-4", children: [_jsxs(motion.div, { initial: false, animate: {
|
|
520
520
|
opacity: hasMounted ? 1 : 0,
|
|
521
521
|
y: hasMounted ? 0 : 20,
|
|
522
522
|
filter: hasMounted ? "blur(0px)" : "blur(10px)",
|
|
@@ -32,12 +32,6 @@ export interface AnySpendCustomExactInProps {
|
|
|
32
32
|
anyspendPrice: GetQuoteResponse | undefined;
|
|
33
33
|
isLoadingAnyspendPrice: boolean;
|
|
34
34
|
}) => React.JSX.Element;
|
|
35
|
-
/** Custom URL to redirect to when clicking "Return to Home" on complete order screen */
|
|
36
|
-
returnToHomeUrl?: string;
|
|
37
|
-
/** Custom label for recipient display (e.g., "OBSN Telegram Bot") */
|
|
38
|
-
customRecipientLabel?: string;
|
|
39
|
-
/** Custom label for the return home button (overrides "Return to Home" / "Close") */
|
|
40
|
-
returnHomeLabel?: string;
|
|
41
35
|
}
|
|
42
36
|
export declare function AnySpendCustomExactIn(props: AnySpendCustomExactInProps): import("react/jsx-runtime").JSX.Element;
|
|
43
37
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useGasPrice } from "../../../anyspend/react/index.js";
|
|
3
2
|
import { normalizeAddress } from "../../../anyspend/utils/index.js";
|
|
4
3
|
import { Button, ShinyButton, StyleRoot, toast, TransitionPanel, useAccountWallet, } from "../../../global-account/react/index.js";
|
|
5
4
|
import { cn } from "../../../shared/utils/cn.js";
|
|
@@ -17,7 +16,6 @@ import { CryptoPaymentMethod, CryptoPaymentMethodType } from "./common/CryptoPay
|
|
|
17
16
|
import { CryptoReceiveSection } from "./common/CryptoReceiveSection.js";
|
|
18
17
|
import { FeeDetailPanel } from "./common/FeeDetailPanel.js";
|
|
19
18
|
import { FiatPaymentMethod, FiatPaymentMethodComponent } from "./common/FiatPaymentMethod.js";
|
|
20
|
-
import { GasIndicator } from "./common/GasIndicator.js";
|
|
21
19
|
import { OrderDetails } from "./common/OrderDetails.js";
|
|
22
20
|
import { PanelOnramp } from "./common/PanelOnramp.js";
|
|
23
21
|
import { PointsDetailPanel } from "./common/PointsDetailPanel.js";
|
|
@@ -27,7 +25,7 @@ export function AnySpendCustomExactIn(props) {
|
|
|
27
25
|
const fingerprintConfig = getFingerprintConfig();
|
|
28
26
|
return (_jsx(AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: _jsx(AnySpendCustomExactInInner, { ...props }) }));
|
|
29
27
|
}
|
|
30
|
-
function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, destinationToken, destinationChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, customExactInConfig, orderType = "custom_exact_in", minDestinationAmount, header,
|
|
28
|
+
function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, destinationToken, destinationChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, customExactInConfig, orderType = "custom_exact_in", minDestinationAmount, header, }) {
|
|
31
29
|
const actionLabel = customExactInConfig?.action ?? "Custom Execution";
|
|
32
30
|
const DESTINATION_TOKEN_DETAILS = {
|
|
33
31
|
SYMBOL: destinationToken.symbol ?? "TOKEN",
|
|
@@ -48,8 +46,6 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
|
|
|
48
46
|
});
|
|
49
47
|
const { connectedEOAWallet } = useAccountWallet();
|
|
50
48
|
const setActiveWallet = useSetActiveWallet();
|
|
51
|
-
// Get gas price for source chain (where the user pays from)
|
|
52
|
-
const { gasPrice: gasPriceData, isLoading: isLoadingGas } = useGasPrice(selectedSrcChainId);
|
|
53
49
|
const appliedPreferEoa = useRef(false);
|
|
54
50
|
useEffect(() => {
|
|
55
51
|
if (preferEoa && !appliedPreferEoa.current) {
|
|
@@ -179,10 +175,10 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
|
|
|
179
175
|
}
|
|
180
176
|
};
|
|
181
177
|
const headerContent = header ? (header({ anyspendPrice: anyspendQuote, isLoadingAnyspendPrice: isLoadingAnyspendQuote })) : (_jsx("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: _jsxs("div", { children: [_jsx("h1", { className: "text-as-primary text-xl font-bold", children: actionLabel }), _jsx("p", { className: "text-as-secondary text-sm", children: "Pay from any token to execute a custom exact-in transaction." })] }) }));
|
|
182
|
-
const mainView = (_jsxs("div", { className: "anyspend-custom-exact-in-container mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [headerContent, _jsx("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: _jsxs("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [paymentType === "crypto" ? (_jsx(CryptoPaySection, { selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, isSrcInputDirty: isSrcInputDirty, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(PanelView.CRYPTO_PAYMENT_METHOD), anyspendQuote: anyspendQuote, onTokenSelect: onTokenSelect })) : (_jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, children: _jsx(PanelOnramp, { srcAmountOnRamp: srcAmount, setSrcAmountOnRamp: setSrcAmount, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: setActivePanel, _recipientAddress: selectedRecipientOrDefault, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, dstTokenSymbol: DESTINATION_TOKEN_DETAILS.SYMBOL, hideDstToken: true, destinationAmount: dstAmount, onDestinationTokenChange: () => { }, onDestinationChainChange: () => { }, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION, anyspendQuote: anyspendQuote, onShowPointsDetail: () => setActivePanel(PanelView.POINTS_DETAIL), onShowFeeDetail: () => setActivePanel(PanelView.FEE_DETAIL), customUsdInputValues: customUsdInputValues
|
|
178
|
+
const mainView = (_jsxs("div", { className: "anyspend-custom-exact-in-container mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [headerContent, _jsx("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: _jsxs("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [paymentType === "crypto" ? (_jsx(CryptoPaySection, { selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, isSrcInputDirty: isSrcInputDirty, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(PanelView.CRYPTO_PAYMENT_METHOD), anyspendQuote: anyspendQuote, onTokenSelect: onTokenSelect })) : (_jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, children: _jsx(PanelOnramp, { srcAmountOnRamp: srcAmount, setSrcAmountOnRamp: setSrcAmount, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: setActivePanel, _recipientAddress: selectedRecipientOrDefault, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, dstTokenSymbol: DESTINATION_TOKEN_DETAILS.SYMBOL, hideDstToken: true, destinationAmount: dstAmount, onDestinationTokenChange: () => { }, onDestinationChainChange: () => { }, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION, anyspendQuote: anyspendQuote, onShowPointsDetail: () => setActivePanel(PanelView.POINTS_DETAIL), onShowFeeDetail: () => setActivePanel(PanelView.FEE_DETAIL), customUsdInputValues: customUsdInputValues }) })), _jsx("div", { className: cn("relative -my-1 flex h-0 items-center justify-center", paymentType === "fiat" && "hidden"), children: _jsx(Button, { variant: "ghost", className: cn("swap-direction-button border-as-stroke bg-as-surface-primary z-10 h-10 w-10 cursor-default rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl"), children: _jsx("div", { className: "relative flex items-center justify-center transition-opacity", children: _jsx(ArrowDown, { className: "text-as-primary/50 h-5 w-5" }) }) }) }), paymentType === "crypto" && (_jsx(CryptoReceiveSection, { isDepositMode: false, isBuyMode: true, effectiveRecipientAddress: selectedRecipientOrDefault, recipientName: recipientName || undefined, onSelectRecipient: () => setActivePanel(PanelView.RECIPIENT_SELECTION), dstAmount: dstAmount, dstToken: selectedDstToken, dstTokenSymbol: DESTINATION_TOKEN_DETAILS.SYMBOL, dstTokenLogoURI: DESTINATION_TOKEN_DETAILS.LOGO_URI, selectedDstChainId: selectedDstChainId, setSelectedDstChainId: () => { }, setSelectedDstToken: () => { }, isSrcInputDirty: isSrcInputDirty, onChangeDstAmount: value => {
|
|
183
179
|
setIsSrcInputDirty(false);
|
|
184
180
|
setSrcAmount(value);
|
|
185
|
-
}, anyspendQuote: anyspendQuote, onShowPointsDetail: () => setActivePanel(PanelView.POINTS_DETAIL), onShowFeeDetail: () => setActivePanel(PanelView.FEE_DETAIL) }))] }) }), _jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: cn("mt-4 flex w-full max-w-[460px] flex-col gap-2"), children: _jsx(ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: cn("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: _jsxs("div", { className: "flex items-center justify-center gap-2", children: [btnInfo.loading && _jsx(Loader2, { className: "h-4 w-4 animate-spin" }), btnInfo.text] }) }) }),
|
|
181
|
+
}, anyspendQuote: anyspendQuote, onShowPointsDetail: () => setActivePanel(PanelView.POINTS_DETAIL), onShowFeeDetail: () => setActivePanel(PanelView.FEE_DETAIL) }))] }) }), _jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: cn("mt-4 flex w-full max-w-[460px] flex-col gap-2"), children: _jsx(ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: cn("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: _jsxs("div", { className: "flex items-center justify-center gap-2", children: [btnInfo.loading && _jsx(Loader2, { className: "h-4 w-4 animate-spin" }), btnInfo.text] }) }) }), mainFooter ? mainFooter : null] }));
|
|
186
182
|
const handleCryptoOrder = async () => {
|
|
187
183
|
try {
|
|
188
184
|
invariant(anyspendQuote, "Relay price is not found");
|
|
@@ -262,7 +258,7 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
|
|
|
262
258
|
const orderDetailsView = (_jsx("div", { className: "mx-auto w-[460px] max-w-full", children: _jsx("div", { className: "relative flex flex-col gap-4", children: oat && (_jsx(OrderDetails, { mode: mode, order: oat.data.order, depositTxs: oat.data.depositTxs, relayTxs: oat.data.relayTxs, executeTx: oat.data.executeTx, refundTxs: oat.data.refundTxs, cryptoPaymentMethod: paymentType === "fiat" ? CryptoPaymentMethodType.NONE : effectiveCryptoPaymentMethod, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod, onPaymentMethodChange: setSelectedCryptoPaymentMethod, onBack: () => {
|
|
263
259
|
setOrderId(undefined);
|
|
264
260
|
setActivePanel(PanelView.MAIN);
|
|
265
|
-
}, disableUrlParamManagement: true, points: oat.data.points || undefined
|
|
261
|
+
}, disableUrlParamManagement: true, points: oat.data.points || undefined })) }) }));
|
|
266
262
|
const loadingView = (_jsx("div", { className: "mx-auto flex w-full flex-col items-center gap-4 p-5", children: _jsx("div", { className: "text-as-primary", children: "Loading order details..." }) }));
|
|
267
263
|
const recipientSelectionView = (_jsx(RecipientSelection, { initialValue: selectedRecipientOrDefault || "", onBack: () => setActivePanel(PanelView.MAIN), onConfirm: address => {
|
|
268
264
|
setSelectedRecipientAddress(address);
|
|
@@ -83,12 +83,6 @@ export interface AnySpendDepositProps {
|
|
|
83
83
|
topChainsCount?: number;
|
|
84
84
|
/** Callback when close button is clicked */
|
|
85
85
|
onClose?: () => void;
|
|
86
|
-
/** Custom URL to redirect to when clicking "Return to Home" on complete order screen */
|
|
87
|
-
returnToHomeUrl?: string;
|
|
88
|
-
/** Custom label for recipient display (e.g., "OBSN Telegram Bot") */
|
|
89
|
-
customRecipientLabel?: string;
|
|
90
|
-
/** Custom label for the return home button (overrides "Return to Home" / "Close") */
|
|
91
|
-
returnHomeLabel?: string;
|
|
92
86
|
}
|
|
93
87
|
/**
|
|
94
88
|
* A flexible deposit component that wraps AnySpendCustomExactIn with optional chain selection.
|
|
@@ -125,4 +119,4 @@ export interface AnySpendDepositProps {
|
|
|
125
119
|
* onSuccess={(amount) => console.log(`Deposited ${amount}`)}
|
|
126
120
|
* />
|
|
127
121
|
*/
|
|
128
|
-
export declare function AnySpendDeposit({ loadOrder, mode, recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationToken, destinationChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains, minPoolSize, topChainsCount, onClose,
|
|
122
|
+
export declare function AnySpendDeposit({ loadOrder, mode, recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationToken, destinationChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains, minPoolSize, topChainsCount, onClose, }: AnySpendDepositProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -95,7 +95,7 @@ function ChainIcon({ chainId, className }) {
|
|
|
95
95
|
* onSuccess={(amount) => console.log(`Deposited ${amount}`)}
|
|
96
96
|
* />
|
|
97
97
|
*/
|
|
98
|
-
export function AnySpendDeposit({ loadOrder, mode = "modal", recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationToken, destinationChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains = DEFAULT_SUPPORTED_CHAINS, minPoolSize = DEFAULT_MIN_POOL_SIZE, topChainsCount = 3, onClose,
|
|
98
|
+
export function AnySpendDeposit({ loadOrder, mode = "modal", recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationToken, destinationChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains = DEFAULT_SUPPORTED_CHAINS, minPoolSize = DEFAULT_MIN_POOL_SIZE, topChainsCount = 3, onClose, }) {
|
|
99
99
|
const { connectedEOAWallet } = useAccountWallet();
|
|
100
100
|
const eoaAddress = connectedEOAWallet?.getAccount()?.address;
|
|
101
101
|
// Determine if we should show chain selection
|
|
@@ -174,7 +174,7 @@ export function AnySpendDeposit({ loadOrder, mode = "modal", recipientAddress, p
|
|
|
174
174
|
};
|
|
175
175
|
// Chain selection view
|
|
176
176
|
if (step === "select-chain") {
|
|
177
|
-
return (_jsxs("div", { className: cn("anyspend-deposit anyspend-deposit-chain-selection font-inter bg-as-surface-primary relative mx-auto w-full max-w-[460px]", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: [onClose && (_jsx("button", { onClick: onClose, className: "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: _jsx("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), !isBalanceLoading && totalBalance > 0 && (_jsxs("div", { className: "anyspend-deposit-balance border-
|
|
177
|
+
return (_jsxs("div", { className: cn("anyspend-deposit anyspend-deposit-chain-selection font-inter bg-as-surface-primary relative mx-auto w-full max-w-[460px]", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: [onClose && (_jsx("button", { onClick: onClose, className: "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: _jsx("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), !isBalanceLoading && totalBalance > 0 && (_jsxs("div", { className: "anyspend-deposit-balance border-secondary border-b p-5", children: [_jsx("p", { className: "anyspend-deposit-balance-label text-as-secondary text-sm", children: "Your Balance" }), _jsxs("p", { className: "anyspend-deposit-balance-value text-as-primary text-3xl font-semibold", children: [formatDecimal(totalBalance), " ", _jsx("span", { className: "text-sm", children: "USD" })] })] })), _jsxs("div", { className: "anyspend-deposit-options flex flex-col gap-2 p-6", children: [isBalanceLoading && (_jsx("div", { className: "anyspend-deposit-chains-skeleton flex flex-col gap-2", children: [1, 2].map((_, i) => (_jsxs("div", { className: "border-border-primary flex items-center justify-between rounded-xl border p-4", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Skeleton, { className: "h-6 w-6 rounded-full" }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Skeleton, { className: "h-4 w-32" }), _jsx(Skeleton, { className: "h-3 w-20" })] })] }), _jsx(Skeleton, { className: "h-5 w-5" })] }, i))) })), topChainsWithBalance.length > 0 && (_jsx("div", { className: "anyspend-deposit-chains flex flex-col gap-2", children: topChainsWithBalance.map(chain => (_jsxs("button", { onClick: () => handleSelectChain(chain.id), className: "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", children: [_jsx("div", { className: "anyspend-deposit-chain-content", children: _jsxs("div", { className: "anyspend-deposit-chain-info", children: [_jsxs("span", { className: "anyspend-deposit-chain-name text-as-primary flex items-center gap-1.5 font-medium", children: ["Deposit from ", chain.name, _jsx(ChainIcon, { chainId: chain.id, className: "h-5 w-5" })] }), _jsxs("p", { className: "anyspend-deposit-chain-balance text-as-secondary text-xs", children: [formatUsd(chain.balance), " available"] })] }) }), _jsx(ChevronRight, { className: "anyspend-deposit-chain-chevron text-as-secondary h-5 w-5" })] }, chain.id))) })), _jsxs("div", { className: "anyspend-deposit-general-options flex flex-col gap-2", children: [_jsxs("button", { onClick: handleSelectCrypto, className: "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", children: [_jsx("div", { className: "anyspend-deposit-option-content", children: _jsxs("div", { className: "anyspend-deposit-option-info", children: [_jsx("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Deposit Crypto" }), _jsx("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Swap from any token on any chain" })] }) }), _jsx(ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] }), _jsxs("div", { className: "anyspend-deposit-divider flex items-center gap-3", children: [_jsx("div", { className: "bg-as-stroke h-px flex-1" }), _jsx("span", { className: "anyspend-deposit-divider-text text-as-secondary text-sm", children: "More options" }), _jsx("div", { className: "bg-as-stroke h-px flex-1" })] }), _jsxs("button", { onClick: handleSelectQrDeposit, className: "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", children: [_jsxs("div", { className: "anyspend-deposit-option-content flex items-center gap-3", children: [_jsx(QrCodeIcon, { className: "anyspend-deposit-option-icon h-10 w-10" }), _jsxs("div", { className: "anyspend-deposit-option-info", children: [_jsx("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Deposit with QR Code" }), _jsx("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Send tokens directly to deposit address" })] })] }), _jsx(ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] }), _jsxs("button", { onClick: handleSelectFiat, className: "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", children: [_jsxs("div", { className: "anyspend-deposit-option-content flex items-center gap-3", children: [_jsx(CreditCardIcon, { className: "anyspend-deposit-option-icon h-10 w-10" }), _jsxs("div", { className: "anyspend-deposit-option-info", children: [_jsx("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Fund with Fiat" }), _jsx("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Pay with card or bank transfer" })] })] }), _jsx(ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] })] }), _jsx(ChainWarningText, { chainId: destinationChainId, className: "mt-2" })] })] }));
|
|
178
178
|
}
|
|
179
179
|
// QR Deposit view
|
|
180
180
|
if (step === "qr-deposit") {
|
|
@@ -183,5 +183,5 @@ export function AnySpendDeposit({ loadOrder, mode = "modal", recipientAddress, p
|
|
|
183
183
|
// Check if destination is Hyperliquid
|
|
184
184
|
const isHyperliquidDeposit = destinationChainId === HYPERLIQUID_CHAIN_ID;
|
|
185
185
|
// Deposit view
|
|
186
|
-
return (_jsxs("div", { className: "anyspend-deposit anyspend-deposit-form relative", children: [shouldShowChainSelection && (_jsxs("button", { onClick: handleBack, className: "anyspend-deposit-back-button text-as-secondary hover:text-as-primary absolute left-4 top-4 z-10 flex items-center gap-1", children: [_jsx("svg", { className: "anyspend-deposit-back-icon h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }), _jsx("span", { className: "anyspend-deposit-back-text text-sm", children: "Back" })] })), onClose && (_jsx("button", { onClick: onClose, className: "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: _jsx("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), _jsx("div", { className: cn("anyspend-deposit-form-content", shouldShowChainSelection && "pt-8"), children: isHyperliquidDeposit ? (_jsx(AnySpend, { loadOrder: loadOrder, mode: mode, defaultActiveTab: paymentType, recipientAddress: recipientAddress, sourceChainId: selectedChainId, destinationTokenAddress: destinationToken.address, destinationTokenChainId: destinationChainId, onSuccess: txHash => onSuccess?.(txHash ?? ""), onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, hideHeader: true, hideBottomNavigation: true, disableUrlParamManagement: true
|
|
186
|
+
return (_jsxs("div", { className: "anyspend-deposit anyspend-deposit-form relative", children: [shouldShowChainSelection && (_jsxs("button", { onClick: handleBack, className: "anyspend-deposit-back-button text-as-secondary hover:text-as-primary absolute left-4 top-4 z-10 flex items-center gap-1", children: [_jsx("svg", { className: "anyspend-deposit-back-icon h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }), _jsx("span", { className: "anyspend-deposit-back-text text-sm", children: "Back" })] })), onClose && (_jsx("button", { onClick: onClose, className: "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: _jsx("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), _jsx("div", { className: cn("anyspend-deposit-form-content", shouldShowChainSelection && "pt-8"), children: isHyperliquidDeposit ? (_jsx(AnySpend, { loadOrder: loadOrder, mode: mode, defaultActiveTab: paymentType, recipientAddress: recipientAddress, sourceChainId: selectedChainId, destinationTokenAddress: destinationToken.address, destinationTokenChainId: destinationChainId, onSuccess: txHash => onSuccess?.(txHash ?? ""), onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, hideHeader: true, hideBottomNavigation: true, disableUrlParamManagement: true })) : (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: selectedChainId, destinationToken: destinationToken, destinationChainId: destinationChainId, orderType: effectiveOrderType, minDestinationAmount: minDestinationAmount, header: header ?? defaultHeader, onSuccess: onSuccess, onOpenCustomModal: onOpenCustomModal, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa, customExactInConfig: depositContractConfig })) }), _jsx(ChainWarningText, { chainId: destinationChainId, className: "px-4 pb-4" })] }));
|
|
187
187
|
}
|
|
@@ -22,9 +22,5 @@ export interface AnySpendDepositHypeProps {
|
|
|
22
22
|
}) => void;
|
|
23
23
|
customUsdInputValues?: string[];
|
|
24
24
|
preferEoa?: boolean;
|
|
25
|
-
/** Custom URL to redirect to when clicking "Return to Home" on complete order screen */
|
|
26
|
-
returnToHomeUrl?: string;
|
|
27
|
-
/** Custom label for recipient display (e.g., "OBSN Telegram Bot") */
|
|
28
|
-
customRecipientLabel?: string;
|
|
29
25
|
}
|
|
30
26
|
export declare function AnySpendDepositHype({ loadOrder, mode, recipientAddress, paymentType, sourceTokenAddress, sourceTokenChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, }: AnySpendDepositHypeProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -6,7 +6,6 @@ import { shortenAddress } from "../../../../shared/utils/formatAddress.js";
|
|
|
6
6
|
import { client } from "../../../../shared/utils/thirdweb.js";
|
|
7
7
|
import { ChevronLeft, ChevronRightCircle, Wallet, X, ZapIcon } from "lucide-react";
|
|
8
8
|
import { useConnectModal, useDisconnect, useWalletInfo } from "thirdweb/react";
|
|
9
|
-
import { createWallet } from "thirdweb/wallets";
|
|
10
9
|
import { useConnectedWalletDisplay } from "../../hooks/useConnectedWalletDisplay.js";
|
|
11
10
|
export var CryptoPaymentMethodType;
|
|
12
11
|
(function (CryptoPaymentMethodType) {
|
|
@@ -15,12 +14,6 @@ export var CryptoPaymentMethodType;
|
|
|
15
14
|
CryptoPaymentMethodType["GLOBAL_WALLET"] = "global_wallet";
|
|
16
15
|
CryptoPaymentMethodType["TRANSFER_CRYPTO"] = "transfer_crypto";
|
|
17
16
|
})(CryptoPaymentMethodType || (CryptoPaymentMethodType = {}));
|
|
18
|
-
const recommendWallets = [
|
|
19
|
-
createWallet("io.metamask"),
|
|
20
|
-
createWallet("com.coinbase.wallet"),
|
|
21
|
-
createWallet("me.rainbow"),
|
|
22
|
-
createWallet("io.rabby"),
|
|
23
|
-
];
|
|
24
17
|
export function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentMethod, isCreatingOrder, onBack, onSelectPaymentMethod, }) {
|
|
25
18
|
const { connectedEOAWallet, connectedSmartWallet } = useAccountWallet();
|
|
26
19
|
const { disconnect } = useDisconnect();
|
|
@@ -36,13 +29,7 @@ export function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentM
|
|
|
36
29
|
if (connectedEOAWallet) {
|
|
37
30
|
await disconnect(connectedEOAWallet);
|
|
38
31
|
}
|
|
39
|
-
const wallet = await openConnectModal({
|
|
40
|
-
client,
|
|
41
|
-
setActive: false,
|
|
42
|
-
size: "compact",
|
|
43
|
-
showThirdwebBranding: false,
|
|
44
|
-
wallets: recommendWallets,
|
|
45
|
-
});
|
|
32
|
+
const wallet = await openConnectModal({ client, setActive: false });
|
|
46
33
|
if (wallet) {
|
|
47
34
|
// setActiveWallet(wallet);
|
|
48
35
|
setSelectedPaymentMethod(CryptoPaymentMethodType.CONNECT_WALLET);
|
|
@@ -4,8 +4,6 @@ interface CryptoReceiveSectionProps {
|
|
|
4
4
|
isBuyMode?: boolean;
|
|
5
5
|
effectiveRecipientAddress?: string;
|
|
6
6
|
recipientName?: string;
|
|
7
|
-
/** Custom label for recipient display (overrides recipientName) */
|
|
8
|
-
customRecipientLabel?: string;
|
|
9
7
|
onSelectRecipient: () => void;
|
|
10
8
|
dstAmount: string;
|
|
11
9
|
dstToken: components["schemas"]["Token"];
|
|
@@ -20,5 +18,5 @@ interface CryptoReceiveSectionProps {
|
|
|
20
18
|
onShowPointsDetail?: () => void;
|
|
21
19
|
onShowFeeDetail?: () => void;
|
|
22
20
|
}
|
|
23
|
-
export declare function CryptoReceiveSection({ isDepositMode, isBuyMode, effectiveRecipientAddress, recipientName,
|
|
21
|
+
export declare function CryptoReceiveSection({ isDepositMode, isBuyMode, effectiveRecipientAddress, recipientName, onSelectRecipient, dstAmount, dstToken, selectedDstChainId, setSelectedDstChainId, setSelectedDstToken, isSrcInputDirty, onChangeDstAmount, anyspendQuote, dstTokenSymbol, dstTokenLogoURI, onShowPointsDetail, onShowFeeDetail, }: CryptoReceiveSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
24
22
|
export {};
|
|
@@ -8,9 +8,8 @@ import { ChevronRight, Info } from "lucide-react";
|
|
|
8
8
|
import { motion } from "motion/react";
|
|
9
9
|
import { OrderTokenAmount } from "./OrderTokenAmount.js";
|
|
10
10
|
import { PointsBadge } from "./PointsBadge.js";
|
|
11
|
-
export function CryptoReceiveSection({ isDepositMode = false, isBuyMode = false, effectiveRecipientAddress, recipientName,
|
|
12
|
-
return (_jsxs(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "receive-section bg-as-surface-secondary border-as-border-secondary relative flex w-full flex-col gap-2 rounded-2xl border p-4 sm:p-6", children: [_jsxs("div", { className: "flex w-full items-center justify-between", children: [_jsxs("div", { className: "text-as-primary/50 flex h-7 items-center gap-1.5 text-sm", children: [isDepositMode ? "Deposit" : "Receive", isSrcInputDirty && anyspendQuote?.data?.fee && onShowFeeDetail && (_jsx("button", { onClick: onShowFeeDetail, className: "text-as-primary/40 hover:text-as-primary/60 transition-colors", children: _jsx(Info, { className: "h-4 w-4" }) }))] }), effectiveRecipientAddress ? (_jsx("button", { className: cn("text-as-tertiarry flex h-7 items-center gap-2 rounded-lg"), onClick: onSelectRecipient, children: _jsxs(_Fragment, { children: [_jsx("span", { className: "text-as-tertiarry flex items-center gap-1 text-sm", children:
|
|
13
|
-
(recipientName ? formatUsername(recipientName) : shortenAddress(effectiveRecipientAddress || "")) }), _jsx(ChevronRight, { className: "h-4 w-4" })] }) })) : (_jsx("button", { className: "text-as-primary/70 flex items-center gap-1 rounded-lg", onClick: onSelectRecipient, children: _jsx("div", { className: "text-sm font-medium", children: "Select recipient" }) }))] }), isBuyMode || isDepositMode ? (
|
|
11
|
+
export function CryptoReceiveSection({ isDepositMode = false, isBuyMode = false, effectiveRecipientAddress, recipientName, onSelectRecipient, dstAmount, dstToken, selectedDstChainId, setSelectedDstChainId, setSelectedDstToken, isSrcInputDirty, onChangeDstAmount, anyspendQuote, dstTokenSymbol, dstTokenLogoURI, onShowPointsDetail, onShowFeeDetail, }) {
|
|
12
|
+
return (_jsxs(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "receive-section bg-as-surface-secondary border-as-border-secondary relative flex w-full flex-col gap-2 rounded-2xl border p-4 sm:p-6", children: [_jsxs("div", { className: "flex w-full items-center justify-between", children: [_jsxs("div", { className: "text-as-primary/50 flex h-7 items-center gap-1.5 text-sm", children: [isDepositMode ? "Deposit" : "Receive", isSrcInputDirty && anyspendQuote?.data?.fee && onShowFeeDetail && (_jsx("button", { onClick: onShowFeeDetail, className: "text-as-primary/40 hover:text-as-primary/60 transition-colors", children: _jsx(Info, { className: "h-4 w-4" }) }))] }), effectiveRecipientAddress ? (_jsx("button", { className: cn("text-as-tertiarry flex h-7 items-center gap-2 rounded-lg"), onClick: onSelectRecipient, children: _jsxs(_Fragment, { children: [_jsx("span", { className: "text-as-tertiarry flex items-center gap-1 text-sm", children: recipientName ? formatUsername(recipientName) : shortenAddress(effectiveRecipientAddress || "") }), _jsx(ChevronRight, { className: "h-4 w-4" })] }) })) : (_jsx("button", { className: "text-as-primary/70 flex items-center gap-1 rounded-lg", onClick: onSelectRecipient, children: _jsx("div", { className: "text-sm font-medium", children: "Select recipient" }) }))] }), isBuyMode || isDepositMode ? (
|
|
14
13
|
// Fixed destination token display for buy mode and deposit mode
|
|
15
14
|
_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-as-primary text-2xl font-bold", children: dstAmount || "0" }), _jsxs("div", { className: "bg-as-brand/10 border-as-brand/30 flex items-center gap-3 rounded-xl border px-4 py-3", children: [(dstTokenLogoURI || dstToken.metadata?.logoURI) && (_jsxs("div", { className: "relative", children: [_jsx("img", { src: dstTokenLogoURI || dstToken.metadata?.logoURI, alt: dstTokenSymbol || dstToken.symbol, className: "h-8 w-8 rounded-full" }), ALL_CHAINS[dstToken.chainId]?.logoUrl && (_jsx("img", { src: ALL_CHAINS[dstToken.chainId].logoUrl, alt: "Chain", className: "absolute -bottom-1 -right-1 h-4 w-4 rounded-full border border-white" }))] })), _jsx("span", { className: "text-as-brand text-lg font-bold", children: dstTokenSymbol || dstToken.symbol })] })] })) : (
|
|
16
15
|
// Token selection for regular swap mode
|
|
@@ -13,10 +13,6 @@ interface OrderDetailsProps {
|
|
|
13
13
|
onBack?: () => void;
|
|
14
14
|
disableUrlParamManagement?: boolean;
|
|
15
15
|
points?: number | undefined;
|
|
16
|
-
/** Custom URL to redirect to when clicking "Return to Home" on complete order screen */
|
|
17
|
-
returnToHomeUrl?: string;
|
|
18
|
-
/** Custom label for the return home button (overrides "Return to Home" / "Close") */
|
|
19
|
-
returnHomeLabel?: string;
|
|
20
16
|
}
|
|
21
17
|
export declare const OrderDetails: import("react").NamedExoticComponent<OrderDetailsProps>;
|
|
22
18
|
export declare const OrderDetailsLoadingView: import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx,
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { ALL_CHAINS, getChainName, getErrorDisplay, getExplorerTxUrl, getPaymentUrl, getStatusDisplay, isNativeToken, RELAY_SOLANA_MAINNET_CHAIN_ID, ZERO_ADDRESS, } from "../../../../anyspend/index.js";
|
|
4
|
-
import { Badge, Button, CopyToClipboard, ShinyButton, Skeleton, TextLoop, TextShimmer, useAccountWallet,
|
|
4
|
+
import { Badge, Button, CopyToClipboard, ShinyButton, Skeleton, TextLoop, TextShimmer, useAccountWallet, useB3, useModalStore, useProfile, useUnifiedChainSwitchAndExecute, } from "../../../../global-account/react/index.js";
|
|
5
5
|
import { useRouter, useSearchParams } from "../../../../shared/react/hooks/index.js";
|
|
6
6
|
import { cn } from "../../../../shared/utils/index.js";
|
|
7
7
|
import centerTruncate from "../../../../shared/utils/centerTruncate.js";
|
|
@@ -131,11 +131,11 @@ function roundTokenAmount(amount) {
|
|
|
131
131
|
const roundedDecimalPart = digits.join("");
|
|
132
132
|
return `${wholePart}.${roundedDecimalPart}`;
|
|
133
133
|
}
|
|
134
|
-
export const OrderDetails = memo(function OrderDetails({ mode = "modal", order, depositTxs, relayTxs, executeTx, refundTxs, cryptoPaymentMethod, selectedCryptoPaymentMethod, onPaymentMethodChange, onBack, disableUrlParamManagement = false, points,
|
|
134
|
+
export const OrderDetails = memo(function OrderDetails({ mode = "modal", order, depositTxs, relayTxs, executeTx, refundTxs, cryptoPaymentMethod, selectedCryptoPaymentMethod, onPaymentMethodChange, onBack, disableUrlParamManagement = false, points, }) {
|
|
135
135
|
const router = useRouter();
|
|
136
136
|
const searchParams = useSearchParams();
|
|
137
137
|
// Get theme from B3Provider context
|
|
138
|
-
const { theme } =
|
|
138
|
+
const { theme } = useB3();
|
|
139
139
|
const colorMode = theme || "light";
|
|
140
140
|
// Read crypto payment method from URL parameters
|
|
141
141
|
const cryptoPaymentMethodFromUrl = searchParams.get("cryptoPaymentMethod");
|
|
@@ -265,34 +265,6 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
|
|
|
265
265
|
cleanupUrlParams();
|
|
266
266
|
onBack?.();
|
|
267
267
|
}, [cleanupUrlParams, onBack]);
|
|
268
|
-
// Handle "Return to Home" click - redirects to custom URL if provided
|
|
269
|
-
const handleReturnToHome = useCallback(() => {
|
|
270
|
-
if (returnToHomeUrl) {
|
|
271
|
-
// Validate URL to prevent Open Redirect / XSS attacks
|
|
272
|
-
try {
|
|
273
|
-
const url = new URL(returnToHomeUrl, window.location.origin);
|
|
274
|
-
// Only allow http/https protocols
|
|
275
|
-
if (url.protocol === "http:" || url.protocol === "https:") {
|
|
276
|
-
window.location.href = url.href;
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
catch {
|
|
281
|
-
// If URL parsing fails, check if it's a safe relative URL
|
|
282
|
-
if (returnToHomeUrl.startsWith("/") && !returnToHomeUrl.startsWith("//")) {
|
|
283
|
-
window.location.href = returnToHomeUrl;
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
// Fallback to handleBack if URL is not safe
|
|
288
|
-
handleBack();
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
291
|
-
handleBack();
|
|
292
|
-
}
|
|
293
|
-
}, [returnToHomeUrl, handleBack]);
|
|
294
|
-
// Reusable "Return to Home" / "Close" button
|
|
295
|
-
const returnHomeOrCloseButton = (_jsx("button", { className: "order-close-button order-details-close-btn bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white", onClick: returnToHomeUrl ? handleReturnToHome : mode === "page" ? handleBack : handleCloseModal, children: returnHomeLabel ? (returnHomeLabel) : mode === "page" ? (_jsxs(_Fragment, { children: ["Return to Home ", _jsx(Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") }));
|
|
296
268
|
useEffect(() => {
|
|
297
269
|
if (txSuccess) {
|
|
298
270
|
toast.success("Transaction successful! We are processing your order.", { duration: 10000 });
|
|
@@ -366,7 +338,7 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
|
|
|
366
338
|
: `Received ${formatTokenAmount(BigInt(dTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTx, isProcessing: false }, dTx.txHash)))
|
|
367
339
|
: null, refundTxs
|
|
368
340
|
? refundTxs.map(rTx => (_jsx(TransactionDetails, { title: `Refunded ${formatTokenAmount(BigInt(rTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: rTx, isProcessing: false }, rTx.txHash)))
|
|
369
|
-
: null] }) })] }) }), order.errorDetails && (_jsx("div", { className: "flex justify-center", children: _jsx("span", { className: "text-as-primary/50 text-center text-sm", style: { maxWidth: "40ch" }, children: getErrorDisplay(order.errorDetails) }) })),
|
|
341
|
+
: null] }) })] }) }), order.errorDetails && (_jsx("div", { className: "flex justify-center", children: _jsx("span", { className: "text-as-primary/50 text-center text-sm", style: { maxWidth: "40ch" }, children: getErrorDisplay(order.errorDetails) }) })), _jsx("button", { className: "order-close-button order-details-close-btn bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white", onClick: mode === "page" ? handleBack : handleCloseModal, children: mode === "page" ? (_jsxs(_Fragment, { children: ["Return to Home ", _jsx(Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") })] }));
|
|
370
342
|
}
|
|
371
343
|
if (executeTx) {
|
|
372
344
|
return (_jsxs(_Fragment, { children: [_jsx(OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), _jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points, isOpen: orderDetailsOpen, onOpenChange: setOrderDetailsOpen }), _jsx(Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: _jsxs(AccordionItem, { value: "execute-details", className: "order-details-execute-item", children: [_jsx(AccordionTrigger, { className: "accordion-trigger", children: "Transaction Details" }), _jsx(AccordionContent, { className: "accordion-content pl-2", children: _jsxs("div", { className: "relative flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(motion.div, { className: "bg-as-border-primary absolute left-[2px] top-0 z-10 w-[3px]", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
|
|
@@ -391,7 +363,7 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
|
|
|
391
363
|
dstToken,
|
|
392
364
|
recipientName,
|
|
393
365
|
centerTruncate,
|
|
394
|
-
}), _jsx(ExternalLink, { className: "ml-2 h-4 w-4" })] }) }) }), order.type === "join_tournament" && order.status === "executed" && (_jsxs(ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [_jsx("span", { className: "pl-4", children: "Continue to Tournament" }), _jsx(ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" &&
|
|
366
|
+
}), _jsx(ExternalLink, { className: "ml-2 h-4 w-4" })] }) }) }), order.type === "join_tournament" && order.status === "executed" && (_jsxs(ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [_jsx("span", { className: "pl-4", children: "Continue to Tournament" }), _jsx(ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" && (_jsx("button", { className: "order-close-button order-details-close-btn bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white", onClick: mode === "page" ? handleBack : handleCloseModal, children: mode === "page" ? (_jsxs(_Fragment, { children: ["Return to Home ", _jsx(Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") }))] }));
|
|
395
367
|
}
|
|
396
368
|
if (relayTxs.length > 0 && relayTxs.every(tx => tx.status === "success")) {
|
|
397
369
|
return (_jsxs(_Fragment, { children: [_jsx(OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), _jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points, isOpen: orderDetailsOpen, onOpenChange: setOrderDetailsOpen }), _jsx(Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: _jsxs(AccordionItem, { value: "more-details", className: "order-details-more-item", children: [_jsx(AccordionTrigger, { className: "accordion-trigger", children: "More Details" }), _jsx(AccordionContent, { className: "accordion-content pl-2", children: _jsxs("div", { className: "relative flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(motion.div, { className: "bg-as-border-primary absolute left-[2px] top-0 z-10 w-[3px]", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
|
|
@@ -412,7 +384,7 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
|
|
|
412
384
|
? "Depositing Hype Duel"
|
|
413
385
|
: order.type === "custom" || order.type === "custom_exact_in"
|
|
414
386
|
? "Executing Contract"
|
|
415
|
-
: "Processing Bridge", chainId: order.dstChain, isProcessing: true, tx: null, delay: 1 }))] }) })] }) }), order.type === "join_tournament" && order.status === "executed" && (_jsxs(ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [_jsx("span", { className: "pl-4", children: "Continue to Tournament" }), _jsx(ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" &&
|
|
387
|
+
: "Processing Bridge", chainId: order.dstChain, isProcessing: true, tx: null, delay: 1 }))] }) })] }) }), order.type === "join_tournament" && order.status === "executed" && (_jsxs(ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [_jsx("span", { className: "pl-4", children: "Continue to Tournament" }), _jsx(ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" && (_jsx("button", { className: "order-close-button order-details-close-btn bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white", onClick: mode === "page" ? handleBack : handleCloseModal, children: mode === "page" ? (_jsxs(_Fragment, { children: ["Return to Home ", _jsx(Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") }))] }));
|
|
416
388
|
}
|
|
417
389
|
// This boolean indicates that user finish payment, and waiting for the deposit to be confirmed. We get this from query params (waitingForDeposit=true)
|
|
418
390
|
const waitingForDeposit = new URLSearchParams(window.location.search).get("waitingForDeposit") === "true";
|
|
@@ -429,7 +401,7 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
|
|
|
429
401
|
? "Funding Tournament"
|
|
430
402
|
: "Processing Transaction", chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 })) : (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
|
|
431
403
|
? `Waiting for payment`
|
|
432
|
-
: `Waiting for deposit ${formattedDepositDeficit} ${srcToken.symbol}`, chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 }))] }) })] }) }), depositTxs?.length > 0 && !depositEnoughAmount && order.status === "scanning_deposit_transaction" && (_jsx(InsufficientDepositPayment, { order: order, srcToken: srcToken, depositDeficit: depositDeficit, phantomWalletAddress: phantomWalletAddress, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, onPayment: handlePayment }))
|
|
404
|
+
: `Waiting for deposit ${formattedDepositDeficit} ${srcToken.symbol}`, chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 }))] }) })] }) }), depositTxs?.length > 0 && !depositEnoughAmount && order.status === "scanning_deposit_transaction" && (_jsx(InsufficientDepositPayment, { order: order, srcToken: srcToken, depositDeficit: depositDeficit, phantomWalletAddress: phantomWalletAddress, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, onPayment: handlePayment }))] }));
|
|
433
405
|
}
|
|
434
406
|
return (_jsxs(_Fragment, { children: [_jsx(OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), statusDisplay === "processing" && (_jsx(_Fragment, { children: order.onrampMetadata ? (_jsx(PaymentVendorUI, { order: order, dstTokenSymbol: dstToken.symbol })) : effectiveCryptoPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET ||
|
|
435
407
|
effectiveCryptoPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET ? (_jsx(ConnectWalletPayment, { order: order, onPayment: handlePayment, onCancel: handleBack, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, phantomWalletAddress: phantomWalletAddress, tournament: tournament, nft: nft, cryptoPaymentMethod: effectiveCryptoPaymentMethod, onPaymentMethodChange: onPaymentMethodChange })) : effectiveCryptoPaymentMethod === CryptoPaymentMethodType.TRANSFER_CRYPTO ? (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
import { GetQuoteResponse } from "../../../../anyspend/types/api_req_res";
|
|
3
3
|
import { FiatPaymentMethod } from "./FiatPaymentMethod";
|
|
4
|
-
export declare function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, recipientSelectionPanelIndex, dstTokenSymbol, hideDstToken, anyspendQuote, onShowPointsDetail, onShowFeeDetail, customUsdInputValues,
|
|
4
|
+
export declare function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, recipientSelectionPanelIndex, dstTokenSymbol, hideDstToken, anyspendQuote, onShowPointsDetail, onShowFeeDetail, customUsdInputValues, }: {
|
|
5
5
|
srcAmountOnRamp: string;
|
|
6
6
|
setSrcAmountOnRamp: (amount: string) => void;
|
|
7
7
|
selectedPaymentMethod?: FiatPaymentMethod;
|
|
@@ -20,6 +20,4 @@ export declare function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selec
|
|
|
20
20
|
onShowPointsDetail?: () => void;
|
|
21
21
|
onShowFeeDetail?: () => void;
|
|
22
22
|
customUsdInputValues?: string[];
|
|
23
|
-
/** Custom label for recipient display (overrides recipientName) */
|
|
24
|
-
customRecipientLabel?: string;
|
|
25
23
|
}): import("react/jsx-runtime").JSX.Element;
|