@b3dotfun/sdk 0.0.88-alpha.1 → 0.0.88-alpha.10
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 +2 -0
- package/dist/cjs/anyspend/constants/index.js +3 -1
- package/dist/cjs/anyspend/index.d.ts +2 -0
- package/dist/cjs/anyspend/index.js +3 -0
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/AnySpend.js +9 -6
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +3 -3
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +24 -20
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +7 -1
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +3 -3
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +14 -1
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +3 -2
- package/dist/cjs/anyspend/react/components/common/GasIndicator.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/common/GasIndicator.js +34 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +4 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +34 -6
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +3 -2
- package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.js +3 -4
- 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/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/useGasPrice.d.ts +37 -0
- package/dist/cjs/anyspend/react/hooks/useGasPrice.js +43 -0
- package/dist/cjs/anyspend/react/hooks/useValidatedClientReferenceId.js +1 -1
- package/dist/cjs/anyspend/services/gas.d.ts +21 -0
- package/dist/cjs/anyspend/services/gas.js +65 -0
- package/dist/cjs/anyspend/types/gas.d.ts +61 -0
- package/dist/cjs/anyspend/types/gas.js +2 -0
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +2 -3
- package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +5 -0
- package/dist/cjs/global-account/react/components/B3Provider/AuthenticationProvider.js +12 -0
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +2 -18
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +35 -52
- 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 +38 -35
- package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +3 -1
- package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +14 -4
- package/dist/cjs/global-account/react/components/B3Provider/useB3.js +4 -11
- package/dist/cjs/global-account/react/components/B3Provider/useB3Account.js +5 -2
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.d.ts +10 -2
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.js +18 -17
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +1 -2
- 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 +8 -9
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +76 -20
- 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 +3 -1
- package/dist/cjs/global-account/react/components/custom/ManageAccountButton.js +1 -2
- package/dist/cjs/global-account/react/components/index.d.ts +1 -2
- package/dist/cjs/global-account/react/components/index.js +3 -6
- package/dist/cjs/global-account/react/hooks/index.d.ts +2 -0
- package/dist/cjs/global-account/react/hooks/index.js +5 -1
- package/dist/cjs/global-account/react/hooks/useAuth.d.ts +76 -0
- package/dist/cjs/global-account/react/hooks/useAuth.js +337 -0
- 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 +3 -0
- package/dist/cjs/global-account/react/hooks/useTWAuth.js +8 -0
- package/dist/cjs/global-account/react/hooks/useTokenBalance.js +5 -5
- package/dist/cjs/global-account/react/hooks/useTokenBalancesByChain.js +4 -2
- package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.js +50 -22
- package/dist/cjs/global-account/react/hooks/useUser.d.ts +60 -0
- package/dist/cjs/global-account/react/hooks/useUser.js +20 -0
- package/dist/cjs/global-account/react/hooks/useUserQuery.js +9 -35
- package/dist/cjs/global-account/react/index.native.d.ts +0 -2
- package/dist/cjs/global-account/react/index.native.js +1 -5
- package/dist/cjs/global-account/react/stores/configStore.d.ts +24 -0
- package/dist/cjs/global-account/react/stores/configStore.js +30 -0
- package/dist/cjs/global-account/react/stores/index.d.ts +1 -0
- package/dist/cjs/global-account/react/stores/index.js +3 -1
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +10 -0
- package/dist/cjs/global-account/react/stores/userStore.d.ts +22 -0
- package/dist/cjs/global-account/react/stores/userStore.js +30 -0
- package/dist/esm/anyspend/constants/index.d.ts +2 -0
- package/dist/esm/anyspend/constants/index.js +2 -0
- package/dist/esm/anyspend/index.d.ts +2 -0
- package/dist/esm/anyspend/index.js +3 -0
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +6 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +11 -8
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +1 -0
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +3 -3
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +8 -4
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +7 -1
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +3 -3
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +14 -1
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +3 -2
- package/dist/esm/anyspend/react/components/common/GasIndicator.d.ts +6 -0
- package/dist/esm/anyspend/react/components/common/GasIndicator.js +31 -0
- package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +4 -0
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +36 -8
- package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +3 -2
- package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.js +3 -4
- 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/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/useGasPrice.d.ts +37 -0
- package/dist/esm/anyspend/react/hooks/useGasPrice.js +40 -0
- package/dist/esm/anyspend/react/hooks/useValidatedClientReferenceId.js +2 -2
- package/dist/esm/anyspend/services/gas.d.ts +21 -0
- package/dist/esm/anyspend/services/gas.js +59 -0
- package/dist/esm/anyspend/types/gas.d.ts +61 -0
- package/dist/esm/anyspend/types/gas.js +1 -0
- package/dist/esm/global-account/react/components/B3DynamicModal.js +3 -4
- package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +5 -0
- package/dist/esm/global-account/react/components/B3Provider/AuthenticationProvider.js +10 -0
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +2 -18
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +34 -53
- 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 +3 -1
- package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +14 -4
- package/dist/esm/global-account/react/components/B3Provider/useB3.js +4 -11
- package/dist/esm/global-account/react/components/B3Provider/useB3Account.js +5 -2
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.d.ts +10 -2
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.js +18 -17
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +2 -3
- 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 +2 -3
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +76 -20
- 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 +5 -3
- package/dist/esm/global-account/react/components/custom/ManageAccountButton.js +2 -3
- package/dist/esm/global-account/react/components/index.d.ts +1 -2
- package/dist/esm/global-account/react/components/index.js +1 -2
- package/dist/esm/global-account/react/hooks/index.d.ts +2 -0
- package/dist/esm/global-account/react/hooks/index.js +2 -0
- package/dist/esm/global-account/react/hooks/useAuth.d.ts +76 -0
- package/dist/esm/global-account/react/hooks/useAuth.js +331 -0
- 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 +3 -0
- package/dist/esm/global-account/react/hooks/useTWAuth.js +8 -0
- package/dist/esm/global-account/react/hooks/useTokenBalance.js +6 -6
- package/dist/esm/global-account/react/hooks/useTokenBalancesByChain.js +4 -2
- package/dist/esm/global-account/react/hooks/useTurnkeyAuth.js +50 -22
- package/dist/esm/global-account/react/hooks/useUser.d.ts +60 -0
- package/dist/esm/global-account/react/hooks/useUser.js +17 -0
- package/dist/esm/global-account/react/hooks/useUserQuery.js +1 -27
- package/dist/esm/global-account/react/index.native.d.ts +0 -2
- package/dist/esm/global-account/react/index.native.js +0 -2
- package/dist/esm/global-account/react/stores/configStore.d.ts +24 -0
- package/dist/esm/global-account/react/stores/configStore.js +27 -0
- package/dist/esm/global-account/react/stores/index.d.ts +1 -0
- package/dist/esm/global-account/react/stores/index.js +1 -0
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +10 -0
- package/dist/esm/global-account/react/stores/userStore.d.ts +22 -0
- package/dist/esm/global-account/react/stores/userStore.js +27 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/constants/index.d.ts +2 -0
- package/dist/types/anyspend/index.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpend.d.ts +6 -0
- package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +1 -0
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +7 -1
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
- package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/GasIndicator.d.ts +6 -0
- package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +4 -0
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useGasPrice.d.ts +37 -0
- package/dist/types/anyspend/services/gas.d.ts +21 -0
- package/dist/types/anyspend/types/gas.d.ts +61 -0
- package/dist/types/global-account/react/components/B3Provider/AuthenticationProvider.d.ts +5 -0
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +2 -18
- package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +5 -5
- package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +14 -4
- package/dist/types/global-account/react/components/B3Provider/useB3Config.d.ts +10 -2
- package/dist/types/global-account/react/components/index.d.ts +1 -2
- package/dist/types/global-account/react/hooks/index.d.ts +2 -0
- package/dist/types/global-account/react/hooks/useAuth.d.ts +76 -0
- package/dist/types/global-account/react/hooks/useTWAuth.d.ts +3 -0
- package/dist/types/global-account/react/hooks/useUser.d.ts +60 -0
- package/dist/types/global-account/react/index.native.d.ts +0 -2
- package/dist/types/global-account/react/stores/configStore.d.ts +24 -0
- package/dist/types/global-account/react/stores/index.d.ts +1 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +10 -0
- package/dist/types/global-account/react/stores/userStore.d.ts +22 -0
- package/package.json +1 -1
- package/src/anyspend/constants/index.ts +3 -0
- package/src/anyspend/index.ts +4 -0
- package/src/anyspend/react/components/AnySpend.tsx +28 -2
- package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +6 -0
- package/src/anyspend/react/components/AnySpendCustom.tsx +52 -47
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +23 -0
- package/src/anyspend/react/components/AnySpendDeposit.tsx +18 -1
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +4 -0
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +15 -1
- package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +5 -1
- package/src/anyspend/react/components/common/GasIndicator.tsx +59 -0
- package/src/anyspend/react/components/common/OrderDetails.tsx +60 -42
- package/src/anyspend/react/components/common/PanelOnramp.tsx +5 -1
- package/src/anyspend/react/components/common/PaymentStripeWeb2.tsx +3 -4
- package/src/anyspend/react/hooks/index.ts +1 -0
- 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/useGasPrice.ts +70 -0
- package/src/anyspend/react/hooks/useValidatedClientReferenceId.ts +2 -2
- package/src/anyspend/services/gas.test.ts +31 -0
- package/src/anyspend/services/gas.ts +73 -0
- package/src/anyspend/types/gas.ts +66 -0
- package/src/global-account/react/components/B3DynamicModal.tsx +3 -4
- package/src/global-account/react/components/B3Provider/AuthenticationProvider.tsx +19 -0
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +43 -54
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +44 -106
- package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +4 -1
- package/src/global-account/react/components/B3Provider/useB3.ts +4 -13
- package/src/global-account/react/components/B3Provider/useB3Account.ts +6 -2
- package/src/global-account/react/components/B3Provider/useB3Config.ts +18 -31
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +2 -4
- 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 +168 -100
- 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 +7 -4
- package/src/global-account/react/components/custom/ManageAccountButton.tsx +2 -3
- package/src/global-account/react/components/index.ts +1 -2
- package/src/global-account/react/hooks/index.ts +2 -0
- package/src/global-account/react/hooks/useAuth.ts +379 -0
- 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 +10 -0
- package/src/global-account/react/hooks/useTokenBalance.tsx +8 -7
- package/src/global-account/react/hooks/useTokenBalancesByChain.tsx +4 -2
- package/src/global-account/react/hooks/useTurnkeyAuth.ts +54 -23
- package/src/global-account/react/hooks/useUser.ts +20 -0
- package/src/global-account/react/hooks/useUserQuery.ts +1 -40
- package/src/global-account/react/index.native.ts +0 -2
- package/src/global-account/react/stores/configStore.ts +51 -0
- package/src/global-account/react/stores/index.ts +1 -0
- package/src/global-account/react/stores/useModalStore.ts +10 -0
- package/src/global-account/react/stores/userStore.ts +41 -0
- package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +0 -27
- package/dist/cjs/global-account/react/components/B3Provider/types.js +0 -24
- package/dist/esm/global-account/react/components/B3Provider/types.d.ts +0 -27
- package/dist/esm/global-account/react/components/B3Provider/types.js +0 -21
- package/dist/types/global-account/react/components/B3Provider/types.d.ts +0 -27
- package/src/global-account/react/components/B3Provider/types.ts +0 -50
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
useAnyspendCreateOrder,
|
|
15
15
|
useAnyspendOrderAndTransactions,
|
|
16
16
|
useAnyspendQuote,
|
|
17
|
+
useGasPrice,
|
|
17
18
|
useGeoOnrampOptions,
|
|
18
19
|
} from "@b3dotfun/sdk/anyspend/react";
|
|
19
20
|
import {
|
|
@@ -24,7 +25,7 @@ import {
|
|
|
24
25
|
toast,
|
|
25
26
|
TransitionPanel,
|
|
26
27
|
useAccountWallet,
|
|
27
|
-
|
|
28
|
+
useB3Config,
|
|
28
29
|
useModalStore,
|
|
29
30
|
useProfile,
|
|
30
31
|
useRouter,
|
|
@@ -55,6 +56,7 @@ import { CryptoPaySection } from "./common/CryptoPaySection";
|
|
|
55
56
|
import { CryptoReceiveSection } from "./common/CryptoReceiveSection";
|
|
56
57
|
import { FeeDetailPanel } from "./common/FeeDetailPanel";
|
|
57
58
|
import { FiatPaymentMethod, FiatPaymentMethodComponent } from "./common/FiatPaymentMethod";
|
|
59
|
+
import { GasIndicator } from "./common/GasIndicator";
|
|
58
60
|
import { OrderDetails, OrderDetailsLoadingView } from "./common/OrderDetails";
|
|
59
61
|
import { OrderHistory } from "./common/OrderHistory";
|
|
60
62
|
import { PanelOnramp } from "./common/PanelOnramp";
|
|
@@ -107,6 +109,12 @@ export function AnySpend(props: {
|
|
|
107
109
|
hideBottomNavigation?: boolean;
|
|
108
110
|
/** When true, disables URL parameter management for swap configuration */
|
|
109
111
|
disableUrlParamManagement?: boolean;
|
|
112
|
+
/** Custom URL to redirect to when clicking "Return to Home" on complete order screen */
|
|
113
|
+
returnToHomeUrl?: string;
|
|
114
|
+
/** Custom label for recipient display (e.g., "OBSN Telegram Bot") */
|
|
115
|
+
customRecipientLabel?: string;
|
|
116
|
+
/** Custom label for the return home button (overrides "Return to Home" / "Close") */
|
|
117
|
+
returnHomeLabel?: string;
|
|
110
118
|
}) {
|
|
111
119
|
const fingerprintConfig = getFingerprintConfig();
|
|
112
120
|
|
|
@@ -132,6 +140,9 @@ function AnySpendInner({
|
|
|
132
140
|
hideHeader,
|
|
133
141
|
hideBottomNavigation = false,
|
|
134
142
|
disableUrlParamManagement = false,
|
|
143
|
+
returnToHomeUrl,
|
|
144
|
+
customRecipientLabel,
|
|
145
|
+
returnHomeLabel,
|
|
135
146
|
}: {
|
|
136
147
|
sourceChainId?: number;
|
|
137
148
|
destinationTokenAddress?: string;
|
|
@@ -147,11 +158,14 @@ function AnySpendInner({
|
|
|
147
158
|
hideHeader?: boolean;
|
|
148
159
|
hideBottomNavigation?: boolean;
|
|
149
160
|
disableUrlParamManagement?: boolean;
|
|
161
|
+
returnToHomeUrl?: string;
|
|
162
|
+
customRecipientLabel?: string;
|
|
163
|
+
returnHomeLabel?: string;
|
|
150
164
|
}) {
|
|
151
165
|
const searchParams = useSearchParamsSSR();
|
|
152
166
|
const router = useRouter();
|
|
153
167
|
|
|
154
|
-
const { partnerId } =
|
|
168
|
+
const { partnerId } = useB3Config();
|
|
155
169
|
const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
|
|
156
170
|
|
|
157
171
|
// Determine if we're in "buy mode" based on whether destination token props are provided
|
|
@@ -545,6 +559,9 @@ function AnySpendInner({
|
|
|
545
559
|
const { geoData, coinbaseAvailablePaymentMethods, stripeOnrampSupport, stripeWeb2Support } =
|
|
546
560
|
useGeoOnrampOptions(srcAmountOnRamp);
|
|
547
561
|
|
|
562
|
+
// Get gas price for source chain (where the user pays from)
|
|
563
|
+
const { gasPrice: gasPriceData, isLoading: isLoadingGas } = useGasPrice(selectedSrcChainId);
|
|
564
|
+
|
|
548
565
|
// Helper function to map payment method to onramp vendor
|
|
549
566
|
const getOnrampVendor = (paymentMethod: FiatPaymentMethod): "coinbase" | "stripe" | "stripe-web2" | undefined => {
|
|
550
567
|
switch (paymentMethod) {
|
|
@@ -1066,6 +1083,8 @@ function AnySpendInner({
|
|
|
1066
1083
|
// Reset payment methods when going back
|
|
1067
1084
|
resetPaymentMethods();
|
|
1068
1085
|
}}
|
|
1086
|
+
returnToHomeUrl={returnToHomeUrl}
|
|
1087
|
+
returnHomeLabel={returnHomeLabel}
|
|
1069
1088
|
/>
|
|
1070
1089
|
)}
|
|
1071
1090
|
{/* {mode === "page" && <div className="h-12" />} */}
|
|
@@ -1157,6 +1176,7 @@ function AnySpendInner({
|
|
|
1157
1176
|
onShowPointsDetail={() => navigateToPanel(PanelView.POINTS_DETAIL, "forward")}
|
|
1158
1177
|
onShowFeeDetail={() => navigateToPanel(PanelView.FEE_DETAIL, "forward")}
|
|
1159
1178
|
customUsdInputValues={customUsdInputValues}
|
|
1179
|
+
customRecipientLabel={customRecipientLabel}
|
|
1160
1180
|
/>
|
|
1161
1181
|
</motion.div>
|
|
1162
1182
|
)}
|
|
@@ -1209,6 +1229,7 @@ function AnySpendInner({
|
|
|
1209
1229
|
isBuyMode={isBuyMode}
|
|
1210
1230
|
effectiveRecipientAddress={effectiveRecipientAddress}
|
|
1211
1231
|
recipientName={recipientName || undefined}
|
|
1232
|
+
customRecipientLabel={customRecipientLabel}
|
|
1212
1233
|
onSelectRecipient={() => navigateToPanel(PanelView.RECIPIENT_SELECTION, "forward")}
|
|
1213
1234
|
dstAmount={dstAmount}
|
|
1214
1235
|
dstToken={selectedDstToken}
|
|
@@ -1227,6 +1248,11 @@ function AnySpendInner({
|
|
|
1227
1248
|
)}
|
|
1228
1249
|
</div>
|
|
1229
1250
|
|
|
1251
|
+
{/* Gas indicator - show when source chain has gas data */}
|
|
1252
|
+
{gasPriceData && !isLoadingGas && activeTab === "crypto" && (
|
|
1253
|
+
<GasIndicator gasPrice={gasPriceData} className="mt-2 w-full" />
|
|
1254
|
+
)}
|
|
1255
|
+
|
|
1230
1256
|
{/* Main button section */}
|
|
1231
1257
|
<motion.div
|
|
1232
1258
|
initial={{ opacity: 0, y: 20, filter: "blur(10px)" }}
|
|
@@ -109,6 +109,10 @@ export interface AnySpendCollectorClubPurchaseProps {
|
|
|
109
109
|
* The partner ID
|
|
110
110
|
*/
|
|
111
111
|
packType: string;
|
|
112
|
+
/**
|
|
113
|
+
* Force fiat payment
|
|
114
|
+
*/
|
|
115
|
+
forceFiatPayment?: boolean;
|
|
112
116
|
}
|
|
113
117
|
|
|
114
118
|
export function AnySpendCollectorClubPurchase({
|
|
@@ -126,6 +130,7 @@ export function AnySpendCollectorClubPurchase({
|
|
|
126
130
|
showRecipient = true,
|
|
127
131
|
vendingMachineId,
|
|
128
132
|
packType,
|
|
133
|
+
forceFiatPayment,
|
|
129
134
|
}: AnySpendCollectorClubPurchaseProps) {
|
|
130
135
|
// Calculate total amount needed (pricePerPack * packAmount)
|
|
131
136
|
const totalAmount = useMemo(() => {
|
|
@@ -193,6 +198,7 @@ export function AnySpendCollectorClubPurchase({
|
|
|
193
198
|
onSuccess={onSuccess}
|
|
194
199
|
showRecipient={showRecipient}
|
|
195
200
|
srcFiatAmount={srcFiatAmount}
|
|
201
|
+
forceFiatPayment={forceFiatPayment}
|
|
196
202
|
/>
|
|
197
203
|
);
|
|
198
204
|
}
|
|
@@ -174,6 +174,7 @@ export function AnySpendCustom(props: {
|
|
|
174
174
|
dstChainId: number;
|
|
175
175
|
dstToken: components["schemas"]["Token"];
|
|
176
176
|
dstAmount: string;
|
|
177
|
+
forceFiatPayment?: boolean;
|
|
177
178
|
contractAddress: string;
|
|
178
179
|
encodedData: string;
|
|
179
180
|
metadata: any;
|
|
@@ -217,6 +218,7 @@ function AnySpendCustomInner({
|
|
|
217
218
|
showRecipient = true,
|
|
218
219
|
onShowPointsDetail,
|
|
219
220
|
srcFiatAmount: srcFiatAmountProps,
|
|
221
|
+
forceFiatPayment,
|
|
220
222
|
}: {
|
|
221
223
|
loadOrder?: string;
|
|
222
224
|
mode?: "modal" | "page";
|
|
@@ -241,6 +243,7 @@ function AnySpendCustomInner({
|
|
|
241
243
|
showRecipient?: boolean;
|
|
242
244
|
onShowPointsDetail?: () => void;
|
|
243
245
|
srcFiatAmount?: string;
|
|
246
|
+
forceFiatPayment?: boolean;
|
|
244
247
|
}) {
|
|
245
248
|
const hasMounted = useHasMounted();
|
|
246
249
|
|
|
@@ -861,65 +864,67 @@ function AnySpendCustomInner({
|
|
|
861
864
|
onValueChange={value => setActiveTab(value as "crypto" | "fiat")}
|
|
862
865
|
className="bg-b3-react-background max-h-[60dvh] w-full overflow-y-auto p-5"
|
|
863
866
|
>
|
|
864
|
-
|
|
865
|
-
<div className="
|
|
866
|
-
<div
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
className={cn(
|
|
876
|
-
"relative z-10 h-full w-full rounded-xl px-3 text-sm font-medium transition-colors duration-100",
|
|
877
|
-
activeTab === "crypto" ? "text-white" : "text-as-primary/70 hover:bg-as-on-surface-2 bg-transparent",
|
|
878
|
-
)}
|
|
879
|
-
onClick={() => {
|
|
880
|
-
setActiveTab("crypto");
|
|
881
|
-
// Reset payment methods when switching tabs
|
|
882
|
-
resetPaymentMethods();
|
|
883
|
-
setSelectedFiatPaymentMethod(FiatPaymentMethod.NONE);
|
|
884
|
-
}}
|
|
885
|
-
>
|
|
886
|
-
Pay with crypto
|
|
887
|
-
</button>
|
|
888
|
-
{isOnrampSupported ? (
|
|
867
|
+
{!forceFiatPayment && (
|
|
868
|
+
<div className="w-full">
|
|
869
|
+
<div className="bg-as-surface-secondary relative mb-4 grid h-10 grid-cols-2 rounded-xl">
|
|
870
|
+
<div
|
|
871
|
+
className={cn(
|
|
872
|
+
"bg-as-brand absolute bottom-0 left-0 top-0 z-0 rounded-xl transition-transform duration-100",
|
|
873
|
+
"h-full w-1/2",
|
|
874
|
+
activeTab === "fiat" ? "translate-x-full" : "translate-x-0",
|
|
875
|
+
)}
|
|
876
|
+
style={{ willChange: "transform" }}
|
|
877
|
+
/>
|
|
889
878
|
<button
|
|
890
879
|
className={cn(
|
|
891
880
|
"relative z-10 h-full w-full rounded-xl px-3 text-sm font-medium transition-colors duration-100",
|
|
892
|
-
activeTab === "
|
|
881
|
+
activeTab === "crypto" ? "text-white" : "text-as-primary/70 hover:bg-as-on-surface-2 bg-transparent",
|
|
893
882
|
)}
|
|
894
883
|
onClick={() => {
|
|
895
|
-
setActiveTab("
|
|
884
|
+
setActiveTab("crypto");
|
|
896
885
|
// Reset payment methods when switching tabs
|
|
897
886
|
resetPaymentMethods();
|
|
898
887
|
setSelectedFiatPaymentMethod(FiatPaymentMethod.NONE);
|
|
899
888
|
}}
|
|
900
889
|
>
|
|
901
|
-
Pay with
|
|
890
|
+
Pay with crypto
|
|
902
891
|
</button>
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
)
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
892
|
+
{isOnrampSupported ? (
|
|
893
|
+
<button
|
|
894
|
+
className={cn(
|
|
895
|
+
"relative z-10 h-full w-full rounded-xl px-3 text-sm font-medium transition-colors duration-100",
|
|
896
|
+
activeTab === "fiat" ? "text-white" : "text-as-primary/70 hover:bg-as-on-surface-2 bg-transparent",
|
|
897
|
+
)}
|
|
898
|
+
onClick={() => {
|
|
899
|
+
setActiveTab("fiat");
|
|
900
|
+
// Reset payment methods when switching tabs
|
|
901
|
+
resetPaymentMethods();
|
|
902
|
+
setSelectedFiatPaymentMethod(FiatPaymentMethod.NONE);
|
|
903
|
+
}}
|
|
904
|
+
>
|
|
905
|
+
Pay with fiat
|
|
906
|
+
</button>
|
|
907
|
+
) : (
|
|
908
|
+
<Tooltip>
|
|
909
|
+
<TooltipTrigger asChild>
|
|
910
|
+
<button
|
|
911
|
+
className={cn(
|
|
912
|
+
"relative z-10 h-full w-full rounded-xl px-3 text-sm font-medium transition-colors duration-100",
|
|
913
|
+
"text-as-primary/50 cursor-not-allowed bg-transparent",
|
|
914
|
+
)}
|
|
915
|
+
disabled
|
|
916
|
+
>
|
|
917
|
+
Pay with fiat
|
|
918
|
+
</button>
|
|
919
|
+
</TooltipTrigger>
|
|
920
|
+
<TooltipContent>
|
|
921
|
+
<span className="text-as-primary w-[140px]">Fiat payments are not supported for this amount</span>
|
|
922
|
+
</TooltipContent>
|
|
923
|
+
</Tooltip>
|
|
924
|
+
)}
|
|
925
|
+
</div>
|
|
921
926
|
</div>
|
|
922
|
-
|
|
927
|
+
)}
|
|
923
928
|
|
|
924
929
|
{/* Warning */}
|
|
925
930
|
{/* {srcChainId === base.id || dstChainId === base.id || activeTab === "fiat" ? (
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useGasPrice } from "@b3dotfun/sdk/anyspend/react";
|
|
1
2
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
2
3
|
import { GetQuoteResponse } from "@b3dotfun/sdk/anyspend/types/api_req_res";
|
|
3
4
|
import { normalizeAddress } from "@b3dotfun/sdk/anyspend/utils";
|
|
@@ -25,6 +26,7 @@ import { CryptoPaymentMethod, CryptoPaymentMethodType } from "./common/CryptoPay
|
|
|
25
26
|
import { CryptoReceiveSection } from "./common/CryptoReceiveSection";
|
|
26
27
|
import { FeeDetailPanel } from "./common/FeeDetailPanel";
|
|
27
28
|
import { FiatPaymentMethod, FiatPaymentMethodComponent } from "./common/FiatPaymentMethod";
|
|
29
|
+
import { GasIndicator } from "./common/GasIndicator";
|
|
28
30
|
import { OrderDetails } from "./common/OrderDetails";
|
|
29
31
|
import { PanelOnramp } from "./common/PanelOnramp";
|
|
30
32
|
import { PointsDetailPanel } from "./common/PointsDetailPanel";
|
|
@@ -66,6 +68,12 @@ export interface AnySpendCustomExactInProps {
|
|
|
66
68
|
anyspendPrice: GetQuoteResponse | undefined;
|
|
67
69
|
isLoadingAnyspendPrice: boolean;
|
|
68
70
|
}) => React.JSX.Element;
|
|
71
|
+
/** Custom URL to redirect to when clicking "Return to Home" on complete order screen */
|
|
72
|
+
returnToHomeUrl?: string;
|
|
73
|
+
/** Custom label for recipient display (e.g., "OBSN Telegram Bot") */
|
|
74
|
+
customRecipientLabel?: string;
|
|
75
|
+
/** Custom label for the return home button (overrides "Return to Home" / "Close") */
|
|
76
|
+
returnHomeLabel?: string;
|
|
69
77
|
}
|
|
70
78
|
|
|
71
79
|
export function AnySpendCustomExactIn(props: AnySpendCustomExactInProps) {
|
|
@@ -97,6 +105,9 @@ function AnySpendCustomExactInInner({
|
|
|
97
105
|
orderType = "custom_exact_in",
|
|
98
106
|
minDestinationAmount,
|
|
99
107
|
header,
|
|
108
|
+
returnToHomeUrl,
|
|
109
|
+
customRecipientLabel,
|
|
110
|
+
returnHomeLabel,
|
|
100
111
|
}: AnySpendCustomExactInProps) {
|
|
101
112
|
const actionLabel = customExactInConfig?.action ?? "Custom Execution";
|
|
102
113
|
|
|
@@ -159,6 +170,9 @@ function AnySpendCustomExactInInner({
|
|
|
159
170
|
|
|
160
171
|
const { connectedEOAWallet } = useAccountWallet();
|
|
161
172
|
const setActiveWallet = useSetActiveWallet();
|
|
173
|
+
|
|
174
|
+
// Get gas price for source chain (where the user pays from)
|
|
175
|
+
const { gasPrice: gasPriceData, isLoading: isLoadingGas } = useGasPrice(selectedSrcChainId);
|
|
162
176
|
const appliedPreferEoa = useRef(false);
|
|
163
177
|
|
|
164
178
|
useEffect(() => {
|
|
@@ -358,6 +372,7 @@ function AnySpendCustomExactInInner({
|
|
|
358
372
|
onShowPointsDetail={() => setActivePanel(PanelView.POINTS_DETAIL)}
|
|
359
373
|
onShowFeeDetail={() => setActivePanel(PanelView.FEE_DETAIL)}
|
|
360
374
|
customUsdInputValues={customUsdInputValues}
|
|
375
|
+
customRecipientLabel={customRecipientLabel}
|
|
361
376
|
/>
|
|
362
377
|
</motion.div>
|
|
363
378
|
)}
|
|
@@ -383,6 +398,7 @@ function AnySpendCustomExactInInner({
|
|
|
383
398
|
isBuyMode={true}
|
|
384
399
|
effectiveRecipientAddress={selectedRecipientOrDefault}
|
|
385
400
|
recipientName={recipientName || undefined}
|
|
401
|
+
customRecipientLabel={customRecipientLabel}
|
|
386
402
|
onSelectRecipient={() => setActivePanel(PanelView.RECIPIENT_SELECTION)}
|
|
387
403
|
dstAmount={dstAmount}
|
|
388
404
|
dstToken={selectedDstToken}
|
|
@@ -427,6 +443,11 @@ function AnySpendCustomExactInInner({
|
|
|
427
443
|
</ShinyButton>
|
|
428
444
|
</motion.div>
|
|
429
445
|
|
|
446
|
+
{/* Gas indicator - show when source chain has gas data */}
|
|
447
|
+
{gasPriceData && !isLoadingGas && paymentType === "crypto" && (
|
|
448
|
+
<GasIndicator gasPrice={gasPriceData} className="mt-2 w-full" />
|
|
449
|
+
)}
|
|
450
|
+
|
|
430
451
|
{mainFooter ? mainFooter : null}
|
|
431
452
|
</div>
|
|
432
453
|
);
|
|
@@ -532,6 +553,8 @@ function AnySpendCustomExactInInner({
|
|
|
532
553
|
}}
|
|
533
554
|
disableUrlParamManagement
|
|
534
555
|
points={oat.data.points || undefined}
|
|
556
|
+
returnToHomeUrl={returnToHomeUrl}
|
|
557
|
+
returnHomeLabel={returnHomeLabel}
|
|
535
558
|
/>
|
|
536
559
|
)}
|
|
537
560
|
</div>
|
|
@@ -106,6 +106,12 @@ export interface AnySpendDepositProps {
|
|
|
106
106
|
topChainsCount?: number;
|
|
107
107
|
/** Callback when close button is clicked */
|
|
108
108
|
onClose?: () => void;
|
|
109
|
+
/** Custom URL to redirect to when clicking "Return to Home" on complete order screen */
|
|
110
|
+
returnToHomeUrl?: string;
|
|
111
|
+
/** Custom label for recipient display (e.g., "OBSN Telegram Bot") */
|
|
112
|
+
customRecipientLabel?: string;
|
|
113
|
+
/** Custom label for the return home button (overrides "Return to Home" / "Close") */
|
|
114
|
+
returnHomeLabel?: string;
|
|
109
115
|
}
|
|
110
116
|
|
|
111
117
|
// Default supported chains
|
|
@@ -224,6 +230,9 @@ export function AnySpendDeposit({
|
|
|
224
230
|
minPoolSize = DEFAULT_MIN_POOL_SIZE,
|
|
225
231
|
topChainsCount = 3,
|
|
226
232
|
onClose,
|
|
233
|
+
returnToHomeUrl,
|
|
234
|
+
customRecipientLabel,
|
|
235
|
+
returnHomeLabel,
|
|
227
236
|
}: AnySpendDepositProps) {
|
|
228
237
|
const { connectedEOAWallet } = useAccountWallet();
|
|
229
238
|
const eoaAddress = connectedEOAWallet?.getAccount()?.address;
|
|
@@ -356,7 +365,7 @@ export function AnySpendDeposit({
|
|
|
356
365
|
)}
|
|
357
366
|
{/* Balance header */}
|
|
358
367
|
{!isBalanceLoading && totalBalance > 0 && (
|
|
359
|
-
<div className="anyspend-deposit-balance border-secondary border-b p-5">
|
|
368
|
+
<div className="anyspend-deposit-balance border-theme-border-secondary border-b p-5">
|
|
360
369
|
<p className="anyspend-deposit-balance-label text-as-secondary text-sm">Your Balance</p>
|
|
361
370
|
<p className="anyspend-deposit-balance-value text-as-primary text-3xl font-semibold">
|
|
362
371
|
{formatDecimal(totalBalance)} <span className="text-sm">USD</span>
|
|
@@ -525,6 +534,7 @@ export function AnySpendDeposit({
|
|
|
525
534
|
<div className={cn("anyspend-deposit-form-content", shouldShowChainSelection && "pt-8")}>
|
|
526
535
|
{isHyperliquidDeposit ? (
|
|
527
536
|
<AnySpend
|
|
537
|
+
key={selectedChainId}
|
|
528
538
|
loadOrder={loadOrder}
|
|
529
539
|
mode={mode}
|
|
530
540
|
defaultActiveTab={paymentType}
|
|
@@ -538,9 +548,13 @@ export function AnySpendDeposit({
|
|
|
538
548
|
hideHeader
|
|
539
549
|
hideBottomNavigation
|
|
540
550
|
disableUrlParamManagement
|
|
551
|
+
returnToHomeUrl={returnToHomeUrl}
|
|
552
|
+
customRecipientLabel={customRecipientLabel}
|
|
553
|
+
returnHomeLabel={returnHomeLabel}
|
|
541
554
|
/>
|
|
542
555
|
) : (
|
|
543
556
|
<AnySpendCustomExactIn
|
|
557
|
+
key={selectedChainId}
|
|
544
558
|
loadOrder={loadOrder}
|
|
545
559
|
mode={mode}
|
|
546
560
|
recipientAddress={recipientAddress}
|
|
@@ -559,6 +573,9 @@ export function AnySpendDeposit({
|
|
|
559
573
|
customUsdInputValues={customUsdInputValues}
|
|
560
574
|
preferEoa={preferEoa}
|
|
561
575
|
customExactInConfig={depositContractConfig}
|
|
576
|
+
returnToHomeUrl={returnToHomeUrl}
|
|
577
|
+
customRecipientLabel={customRecipientLabel}
|
|
578
|
+
returnHomeLabel={returnHomeLabel}
|
|
562
579
|
/>
|
|
563
580
|
)}
|
|
564
581
|
</div>
|
|
@@ -25,6 +25,10 @@ export interface AnySpendDepositHypeProps {
|
|
|
25
25
|
onTokenSelect?: (token: components["schemas"]["Token"], event: { preventDefault: () => void }) => void;
|
|
26
26
|
customUsdInputValues?: string[];
|
|
27
27
|
preferEoa?: boolean;
|
|
28
|
+
/** Custom URL to redirect to when clicking "Return to Home" on complete order screen */
|
|
29
|
+
returnToHomeUrl?: string;
|
|
30
|
+
/** Custom label for recipient display (e.g., "OBSN Telegram Bot") */
|
|
31
|
+
customRecipientLabel?: string;
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
export function AnySpendDepositHype({
|
|
@@ -6,6 +6,7 @@ import { shortenAddress } from "@b3dotfun/sdk/shared/utils/formatAddress";
|
|
|
6
6
|
import { client } from "@b3dotfun/sdk/shared/utils/thirdweb";
|
|
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";
|
|
9
10
|
import { useConnectedWalletDisplay } from "../../hooks/useConnectedWalletDisplay";
|
|
10
11
|
|
|
11
12
|
export enum CryptoPaymentMethodType {
|
|
@@ -15,6 +16,13 @@ export enum CryptoPaymentMethodType {
|
|
|
15
16
|
TRANSFER_CRYPTO = "transfer_crypto",
|
|
16
17
|
}
|
|
17
18
|
|
|
19
|
+
const recommendWallets = [
|
|
20
|
+
createWallet("io.metamask"),
|
|
21
|
+
createWallet("com.coinbase.wallet"),
|
|
22
|
+
createWallet("me.rainbow"),
|
|
23
|
+
createWallet("io.rabby"),
|
|
24
|
+
];
|
|
25
|
+
|
|
18
26
|
interface CryptoPaymentMethodProps {
|
|
19
27
|
selectedPaymentMethod: CryptoPaymentMethodType;
|
|
20
28
|
setSelectedPaymentMethod: (method: CryptoPaymentMethodType) => void;
|
|
@@ -47,7 +55,13 @@ export function CryptoPaymentMethod({
|
|
|
47
55
|
if (connectedEOAWallet) {
|
|
48
56
|
await disconnect(connectedEOAWallet);
|
|
49
57
|
}
|
|
50
|
-
const wallet = await openConnectModal({
|
|
58
|
+
const wallet = await openConnectModal({
|
|
59
|
+
client,
|
|
60
|
+
setActive: false,
|
|
61
|
+
size: "compact",
|
|
62
|
+
showThirdwebBranding: false,
|
|
63
|
+
wallets: recommendWallets,
|
|
64
|
+
});
|
|
51
65
|
if (wallet) {
|
|
52
66
|
// setActiveWallet(wallet);
|
|
53
67
|
setSelectedPaymentMethod(CryptoPaymentMethodType.CONNECT_WALLET);
|
|
@@ -15,6 +15,8 @@ interface CryptoReceiveSectionProps {
|
|
|
15
15
|
// Recipient data
|
|
16
16
|
effectiveRecipientAddress?: string;
|
|
17
17
|
recipientName?: string;
|
|
18
|
+
/** Custom label for recipient display (overrides recipientName) */
|
|
19
|
+
customRecipientLabel?: string;
|
|
18
20
|
onSelectRecipient: () => void;
|
|
19
21
|
// Token data
|
|
20
22
|
dstAmount: string;
|
|
@@ -41,6 +43,7 @@ export function CryptoReceiveSection({
|
|
|
41
43
|
isBuyMode = false,
|
|
42
44
|
effectiveRecipientAddress,
|
|
43
45
|
recipientName,
|
|
46
|
+
customRecipientLabel,
|
|
44
47
|
onSelectRecipient,
|
|
45
48
|
dstAmount,
|
|
46
49
|
dstToken,
|
|
@@ -78,7 +81,8 @@ export function CryptoReceiveSection({
|
|
|
78
81
|
>
|
|
79
82
|
<>
|
|
80
83
|
<span className="text-as-tertiarry flex items-center gap-1 text-sm">
|
|
81
|
-
{
|
|
84
|
+
{customRecipientLabel ||
|
|
85
|
+
(recipientName ? formatUsername(recipientName) : shortenAddress(effectiveRecipientAddress || ""))}
|
|
82
86
|
</span>
|
|
83
87
|
<ChevronRight className="h-4 w-4" />
|
|
84
88
|
</>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
4
|
+
import { motion } from "motion/react";
|
|
5
|
+
import type { GasPriceData } from "../../../types/gas";
|
|
6
|
+
|
|
7
|
+
export interface GasIndicatorProps {
|
|
8
|
+
gasPrice: GasPriceData;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const LEVEL_LABELS: Record<GasPriceData["level"], string> = {
|
|
13
|
+
low: "Low",
|
|
14
|
+
normal: "Normal",
|
|
15
|
+
elevated: "Elevated",
|
|
16
|
+
high: "High",
|
|
17
|
+
spike: "Spike",
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const LEVEL_STYLES: Record<GasPriceData["level"], string> = {
|
|
21
|
+
low: "bg-green-500/20 text-green-500",
|
|
22
|
+
normal: "bg-as-surface-tertiary text-as-secondary",
|
|
23
|
+
elevated: "bg-yellow-500/20 text-yellow-600",
|
|
24
|
+
high: "bg-orange-500/20 text-orange-500",
|
|
25
|
+
spike: "bg-red-500/20 text-red-500",
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
function formatGasPrice(gweiString: string): string {
|
|
29
|
+
const gwei = parseFloat(gweiString);
|
|
30
|
+
if (gwei < 0.001) return "<0.001";
|
|
31
|
+
if (gwei < 1) return gwei.toFixed(3);
|
|
32
|
+
if (gwei < 10) return gwei.toFixed(2);
|
|
33
|
+
return gwei.toFixed(1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function GasIndicator({ gasPrice, className }: GasIndicatorProps) {
|
|
37
|
+
return (
|
|
38
|
+
<motion.div
|
|
39
|
+
initial={{ opacity: 0, y: 10 }}
|
|
40
|
+
animate={{ opacity: 1, y: 0 }}
|
|
41
|
+
transition={{ duration: 0.2 }}
|
|
42
|
+
className={cn(
|
|
43
|
+
"flex items-center justify-between rounded-lg px-3 py-2",
|
|
44
|
+
gasPrice.isSpike ? "bg-yellow-500/10" : "bg-as-surface-secondary",
|
|
45
|
+
className,
|
|
46
|
+
)}
|
|
47
|
+
>
|
|
48
|
+
<div className="flex items-center gap-2">
|
|
49
|
+
<span className="text-as-secondary text-xs">Gas on {gasPrice.chainName}</span>
|
|
50
|
+
</div>
|
|
51
|
+
<div className="flex items-center gap-2">
|
|
52
|
+
<span className={cn("rounded px-1.5 py-0.5 text-xs font-medium", LEVEL_STYLES[gasPrice.level])}>
|
|
53
|
+
{LEVEL_LABELS[gasPrice.level]}
|
|
54
|
+
</span>
|
|
55
|
+
<span className="text-as-primary text-xs font-medium">{formatGasPrice(gasPrice.gasPriceGwei)} Gwei</span>
|
|
56
|
+
</div>
|
|
57
|
+
</motion.div>
|
|
58
|
+
);
|
|
59
|
+
}
|