@b3dotfun/sdk 0.0.88 → 0.0.89-alpha.1
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 +4 -4
- 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 +4 -4
- 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 +53 -48
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +23 -0
- package/src/anyspend/react/components/AnySpendDeposit.tsx +27 -18
- 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
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { GasPriceData } from "../../../types/gas";
|
|
2
|
+
export interface GasIndicatorProps {
|
|
3
|
+
gasPrice: GasPriceData;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function GasIndicator({ gasPrice, className }: GasIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.GasIndicator = GasIndicator;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const cn_1 = require("../../../../shared/utils/cn");
|
|
7
|
+
const react_1 = require("motion/react");
|
|
8
|
+
const LEVEL_LABELS = {
|
|
9
|
+
low: "Low",
|
|
10
|
+
normal: "Normal",
|
|
11
|
+
elevated: "Elevated",
|
|
12
|
+
high: "High",
|
|
13
|
+
spike: "Spike",
|
|
14
|
+
};
|
|
15
|
+
const LEVEL_STYLES = {
|
|
16
|
+
low: "bg-green-500/20 text-green-500",
|
|
17
|
+
normal: "bg-as-surface-tertiary text-as-secondary",
|
|
18
|
+
elevated: "bg-yellow-500/20 text-yellow-600",
|
|
19
|
+
high: "bg-orange-500/20 text-orange-500",
|
|
20
|
+
spike: "bg-red-500/20 text-red-500",
|
|
21
|
+
};
|
|
22
|
+
function formatGasPrice(gweiString) {
|
|
23
|
+
const gwei = parseFloat(gweiString);
|
|
24
|
+
if (gwei < 0.001)
|
|
25
|
+
return "<0.001";
|
|
26
|
+
if (gwei < 1)
|
|
27
|
+
return gwei.toFixed(3);
|
|
28
|
+
if (gwei < 10)
|
|
29
|
+
return gwei.toFixed(2);
|
|
30
|
+
return gwei.toFixed(1);
|
|
31
|
+
}
|
|
32
|
+
function GasIndicator({ gasPrice, className }) {
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.motion.div, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.2 }, className: (0, cn_1.cn)("flex items-center justify-between rounded-lg px-3 py-2", gasPrice.isSpike ? "bg-yellow-500/10" : "bg-as-surface-secondary", className), children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsxs)("span", { className: "text-as-secondary text-xs", children: ["Gas on ", gasPrice.chainName] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: (0, cn_1.cn)("rounded px-1.5 py-0.5 text-xs font-medium", LEVEL_STYLES[gasPrice.level]), children: LEVEL_LABELS[gasPrice.level] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-as-primary text-xs font-medium", children: [formatGasPrice(gasPrice.gasPriceGwei), " Gwei"] })] })] }));
|
|
34
|
+
}
|
|
@@ -13,6 +13,10 @@ 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;
|
|
16
20
|
}
|
|
17
21
|
export declare const OrderDetails: import("react").NamedExoticComponent<OrderDetailsProps>;
|
|
18
22
|
export declare const OrderDetailsLoadingView: import("react/jsx-runtime").JSX.Element;
|
|
@@ -137,11 +137,11 @@ function roundTokenAmount(amount) {
|
|
|
137
137
|
const roundedDecimalPart = digits.join("");
|
|
138
138
|
return `${wholePart}.${roundedDecimalPart}`;
|
|
139
139
|
}
|
|
140
|
-
exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal", order, depositTxs, relayTxs, executeTx, refundTxs, cryptoPaymentMethod, selectedCryptoPaymentMethod, onPaymentMethodChange, onBack, disableUrlParamManagement = false, points, }) {
|
|
140
|
+
exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal", order, depositTxs, relayTxs, executeTx, refundTxs, cryptoPaymentMethod, selectedCryptoPaymentMethod, onPaymentMethodChange, onBack, disableUrlParamManagement = false, points, returnToHomeUrl, returnHomeLabel, }) {
|
|
141
141
|
const router = (0, hooks_1.useRouter)();
|
|
142
142
|
const searchParams = (0, hooks_1.useSearchParams)();
|
|
143
143
|
// Get theme from B3Provider context
|
|
144
|
-
const { theme } = (0, react_1.
|
|
144
|
+
const { theme } = (0, react_1.useB3Config)();
|
|
145
145
|
const colorMode = theme || "light";
|
|
146
146
|
// Read crypto payment method from URL parameters
|
|
147
147
|
const cryptoPaymentMethodFromUrl = searchParams.get("cryptoPaymentMethod");
|
|
@@ -271,6 +271,34 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
|
|
|
271
271
|
cleanupUrlParams();
|
|
272
272
|
onBack?.();
|
|
273
273
|
}, [cleanupUrlParams, onBack]);
|
|
274
|
+
// Handle "Return to Home" click - redirects to custom URL if provided
|
|
275
|
+
const handleReturnToHome = (0, react_5.useCallback)(() => {
|
|
276
|
+
if (returnToHomeUrl) {
|
|
277
|
+
// Validate URL to prevent Open Redirect / XSS attacks
|
|
278
|
+
try {
|
|
279
|
+
const url = new URL(returnToHomeUrl, window.location.origin);
|
|
280
|
+
// Only allow http/https protocols
|
|
281
|
+
if (url.protocol === "http:" || url.protocol === "https:") {
|
|
282
|
+
window.location.href = url.href;
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
catch {
|
|
287
|
+
// If URL parsing fails, check if it's a safe relative URL
|
|
288
|
+
if (returnToHomeUrl.startsWith("/") && !returnToHomeUrl.startsWith("//")) {
|
|
289
|
+
window.location.href = returnToHomeUrl;
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
// Fallback to handleBack if URL is not safe
|
|
294
|
+
handleBack();
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
handleBack();
|
|
298
|
+
}
|
|
299
|
+
}, [returnToHomeUrl, handleBack]);
|
|
300
|
+
// Reusable "Return to Home" / "Close" button
|
|
301
|
+
const returnHomeOrCloseButton = ((0, jsx_runtime_1.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" ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Return to Home ", (0, jsx_runtime_1.jsx)(lucide_react_1.Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") }));
|
|
274
302
|
(0, react_5.useEffect)(() => {
|
|
275
303
|
if (txSuccess) {
|
|
276
304
|
react_2.toast.success("Transaction successful! We are processing your order.", { duration: 10000 });
|
|
@@ -344,7 +372,7 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
|
|
|
344
372
|
: `Received ${(0, number_1.formatTokenAmount)(BigInt(dTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTx, isProcessing: false }, dTx.txHash)))
|
|
345
373
|
: null, refundTxs
|
|
346
374
|
? refundTxs.map(rTx => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: `Refunded ${(0, number_1.formatTokenAmount)(BigInt(rTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: rTx, isProcessing: false }, rTx.txHash)))
|
|
347
|
-
: null] }) })] }) }), order.errorDetails && ((0, jsx_runtime_1.jsx)("div", { className: "flex justify-center", children: (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/50 text-center text-sm", style: { maxWidth: "40ch" }, children: (0, anyspend_1.getErrorDisplay)(order.errorDetails) }) })),
|
|
375
|
+
: null] }) })] }) }), order.errorDetails && ((0, jsx_runtime_1.jsx)("div", { className: "flex justify-center", children: (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/50 text-center text-sm", style: { maxWidth: "40ch" }, children: (0, anyspend_1.getErrorDisplay)(order.errorDetails) }) })), returnHomeOrCloseButton] }));
|
|
348
376
|
}
|
|
349
377
|
if (executeTx) {
|
|
350
378
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points, isOpen: orderDetailsOpen, onOpenChange: setOrderDetailsOpen }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "execute-details", className: "order-details-execute-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "Transaction Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.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
|
|
@@ -369,7 +397,7 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
|
|
|
369
397
|
dstToken,
|
|
370
398
|
recipientName,
|
|
371
399
|
centerTruncate: centerTruncate_1.default,
|
|
372
|
-
}), (0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { className: "ml-2 h-4 w-4" })] }) }) }), order.type === "join_tournament" && order.status === "executed" && ((0, jsx_runtime_1.jsxs)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [(0, jsx_runtime_1.jsx)("span", { className: "pl-4", children: "Continue to Tournament" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" &&
|
|
400
|
+
}), (0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { className: "ml-2 h-4 w-4" })] }) }) }), order.type === "join_tournament" && order.status === "executed" && ((0, jsx_runtime_1.jsxs)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [(0, jsx_runtime_1.jsx)("span", { className: "pl-4", children: "Continue to Tournament" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" && returnHomeOrCloseButton] }));
|
|
373
401
|
}
|
|
374
402
|
if (relayTxs.length > 0 && relayTxs.every(tx => tx.status === "success")) {
|
|
375
403
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points, isOpen: orderDetailsOpen, onOpenChange: setOrderDetailsOpen }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "more-details", className: "order-details-more-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "More Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.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
|
|
@@ -390,7 +418,7 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
|
|
|
390
418
|
? "Depositing Hype Duel"
|
|
391
419
|
: order.type === "custom" || order.type === "custom_exact_in"
|
|
392
420
|
? "Executing Contract"
|
|
393
|
-
: "Processing Bridge", chainId: order.dstChain, isProcessing: true, tx: null, delay: 1 }))] }) })] }) }), order.type === "join_tournament" && order.status === "executed" && ((0, jsx_runtime_1.jsxs)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [(0, jsx_runtime_1.jsx)("span", { className: "pl-4", children: "Continue to Tournament" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" &&
|
|
421
|
+
: "Processing Bridge", chainId: order.dstChain, isProcessing: true, tx: null, delay: 1 }))] }) })] }) }), order.type === "join_tournament" && order.status === "executed" && ((0, jsx_runtime_1.jsxs)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [(0, jsx_runtime_1.jsx)("span", { className: "pl-4", children: "Continue to Tournament" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" && returnHomeOrCloseButton] }));
|
|
394
422
|
}
|
|
395
423
|
// This boolean indicates that user finish payment, and waiting for the deposit to be confirmed. We get this from query params (waitingForDeposit=true)
|
|
396
424
|
const waitingForDeposit = new URLSearchParams(window.location.search).get("waitingForDeposit") === "true";
|
|
@@ -407,7 +435,7 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
|
|
|
407
435
|
? "Funding Tournament"
|
|
408
436
|
: "Processing Transaction", chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 })) : ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
|
|
409
437
|
? `Waiting for payment`
|
|
410
|
-
: `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" && ((0, jsx_runtime_1.jsx)(InsufficientDepositPayment_1.InsufficientDepositPayment, { order: order, srcToken: srcToken, depositDeficit: depositDeficit, phantomWalletAddress: phantomWalletAddress, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, onPayment: handlePayment }))] }));
|
|
438
|
+
: `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" && ((0, jsx_runtime_1.jsx)(InsufficientDepositPayment_1.InsufficientDepositPayment, { order: order, srcToken: srcToken, depositDeficit: depositDeficit, phantomWalletAddress: phantomWalletAddress, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, onPayment: handlePayment })), (0, jsx_runtime_1.jsxs)("button", { className: "text-b3-primary-blue hover:text-b3-primary-blue/50 order-details-cancel-btn flex w-full items-center justify-center gap-2 underline", onClick: handleBack, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCcw, { className: "ml-2 h-4 w-4" }), " Cancel and start over"] })] }));
|
|
411
439
|
}
|
|
412
440
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), statusDisplay === "processing" && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: order.onrampMetadata ? ((0, jsx_runtime_1.jsx)(PaymentVendorUI_1.default, { order: order, dstTokenSymbol: dstToken.symbol })) : effectiveCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.CONNECT_WALLET ||
|
|
413
441
|
effectiveCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.GLOBAL_WALLET ? ((0, jsx_runtime_1.jsx)(ConnectWalletPayment_1.default, { order: order, onPayment: handlePayment, onCancel: handleBack, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, phantomWalletAddress: phantomWalletAddress, tournament: tournament, nft: nft, cryptoPaymentMethod: effectiveCryptoPaymentMethod, onPaymentMethodChange: onPaymentMethodChange })) : effectiveCryptoPaymentMethod === CryptoPaymentMethod_1.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, customRecipientLabel, }: {
|
|
5
5
|
srcAmountOnRamp: string;
|
|
6
6
|
setSrcAmountOnRamp: (amount: string) => void;
|
|
7
7
|
selectedPaymentMethod?: FiatPaymentMethod;
|
|
@@ -20,4 +20,6 @@ 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;
|
|
23
25
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,7 +13,7 @@ const FiatPaymentMethod_1 = require("./FiatPaymentMethod");
|
|
|
13
13
|
const OrderTokenAmountFiat_1 = require("./OrderTokenAmountFiat");
|
|
14
14
|
const PointsBadge_1 = require("./PointsBadge");
|
|
15
15
|
const ONE_CHAR_WIDTH = 30;
|
|
16
|
-
function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, recipientSelectionPanelIndex, dstTokenSymbol, hideDstToken = false, anyspendQuote, onShowPointsDetail, onShowFeeDetail, customUsdInputValues = ["5", "10", "20", "25"], }) {
|
|
16
|
+
function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, recipientSelectionPanelIndex, dstTokenSymbol, hideDstToken = false, anyspendQuote, onShowPointsDetail, onShowFeeDetail, customUsdInputValues = ["5", "10", "20", "25"], customRecipientLabel, }) {
|
|
17
17
|
// Helper function to get fees from anyspend quote
|
|
18
18
|
const getFeeFromApi = (paymentMethod) => {
|
|
19
19
|
// Try to get fee from anyspend quote first (most accurate)
|
|
@@ -90,7 +90,8 @@ function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMetho
|
|
|
90
90
|
.filter(v => !isNaN(Number(v)))
|
|
91
91
|
.map(value => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => handleQuickAmount(value), className: `bg-as-surface-secondary border-as-border-secondary hover:border-as-border-secondary h-7 w-14 rounded-lg border text-sm font-medium transition-all duration-200 ${srcAmountOnRamp === value
|
|
92
92
|
? "border-as-border-secondary bg-as-surface-secondary"
|
|
93
|
-
: "bg-as-surface-secondary hover:bg-as-surface-secondary"}`, children: ["$", value] }, value))) }), destinationToken && destinationChainId && !hideDstToken && ((0, jsx_runtime_1.jsx)(OrderTokenAmountFiat_1.OrderTokenAmountFiat, { address: _recipientAddress, context: "to", inputValue: destinationAmount || "0", onChangeInput: () => { }, chainId: destinationChainId, setChainId: onDestinationChainChange || (() => { }), token: destinationToken, setToken: onDestinationTokenChange || (() => { }) }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "border-as-border-secondary bg-as-surface-secondary mt-4 flex w-full flex-col gap-3 rounded-xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex w-full items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry flex items-center text-sm", children: "Recipient" }), _recipientAddress ? ((0, jsx_runtime_1.jsxs)("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(recipientSelectionPanelIndex), children: [(0, jsx_runtime_1.jsx)("span", { className: "text-sm", children:
|
|
93
|
+
: "bg-as-surface-secondary hover:bg-as-surface-secondary"}`, children: ["$", value] }, value))) }), destinationToken && destinationChainId && !hideDstToken && ((0, jsx_runtime_1.jsx)(OrderTokenAmountFiat_1.OrderTokenAmountFiat, { address: _recipientAddress, context: "to", inputValue: destinationAmount || "0", onChangeInput: () => { }, chainId: destinationChainId, setChainId: onDestinationChainChange || (() => { }), token: destinationToken, setToken: onDestinationTokenChange || (() => { }) }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "border-as-border-secondary bg-as-surface-secondary mt-4 flex w-full flex-col gap-3 rounded-xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex w-full items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry flex items-center text-sm", children: "Recipient" }), _recipientAddress ? ((0, jsx_runtime_1.jsxs)("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(recipientSelectionPanelIndex), children: [(0, jsx_runtime_1.jsx)("span", { className: "text-sm", children: customRecipientLabel ||
|
|
94
|
+
(recipientName ? (0, utils_1.formatUsername)(recipientName) : (0, formatAddress_1.formatAddress)(_recipientAddress)) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { size: 16 })] })) : ((0, jsx_runtime_1.jsxs)("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(5), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "text-as-brand", size: 16 }), "Select recipient", (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { size: 16 })] }))] }), (0, jsx_runtime_1.jsx)("div", { className: "divider w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry text-sm", children: "Expected to receive" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-wrap items-center justify-end gap-1", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-as-primary font-semibold", children: [destinationAmount || "0", " ", dstTokenSymbol || destinationToken?.symbol || ""] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-as-tertiarry text-sm", children: ["on ", destinationChainId ? chain_1.ALL_CHAINS[destinationChainId]?.name : ""] }), destinationToken && destinationChainId && destinationToken.metadata?.logoURI && ((0, jsx_runtime_1.jsx)("img", { src: chain_1.ALL_CHAINS[destinationChainId]?.logoUrl, alt: "Chain", className: "h-4 w-4 rounded-full" }))] })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "divider w-full" }), (0, jsx_runtime_1.jsx)("div", { className: "", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry text-sm", children: "Total" }), anyspendQuote?.data?.fee && onShowFeeDetail && ((0, jsx_runtime_1.jsx)("button", { onClick: onShowFeeDetail, className: "text-as-primary/40 hover:text-as-primary/60 transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Info, { className: "h-4 w-4" }) })), anyspendQuote?.data?.pointsAmount && anyspendQuote?.data?.pointsAmount > 0 && ((0, jsx_runtime_1.jsx)(PointsBadge_1.PointsBadge, { pointsAmount: anyspendQuote.data.pointsAmount, pointsMultiplier: anyspendQuote.data.pointsMultiplier, onClick: () => onShowPointsDetail?.() }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-end gap-0.5", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-as-primary font-semibold", children: ["$", getTotalAmount(selectedPaymentMethod || FiatPaymentMethod_1.FiatPaymentMethod.NONE).toFixed(2)] }), (() => {
|
|
94
95
|
// For fiat payments, show the fee from the payment method
|
|
95
96
|
const fiatFee = getFeeFromApi(selectedPaymentMethod || FiatPaymentMethod_1.FiatPaymentMethod.NONE);
|
|
96
97
|
if (fiatFee !== null && fiatFee > 0) {
|
|
@@ -5,11 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.default = PaymentStripeWeb2;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const payment_utils_1 = require("../../../../shared/utils/payment.utils");
|
|
9
8
|
const react_1 = require("../../../../anyspend/react");
|
|
10
9
|
const react_2 = require("../../../../global-account/react");
|
|
11
10
|
const number_1 = require("../../../../shared/utils/number");
|
|
12
|
-
const
|
|
11
|
+
const payment_utils_1 = require("../../../../shared/utils/payment.utils");
|
|
13
12
|
const react_stripe_js_1 = require("@stripe/react-stripe-js");
|
|
14
13
|
const lucide_react_1 = require("lucide-react");
|
|
15
14
|
const react_3 = require("react");
|
|
@@ -17,7 +16,7 @@ const AnySpendFingerprintWrapper_1 = require("../AnySpendFingerprintWrapper");
|
|
|
17
16
|
const HowItWorks_1 = __importDefault(require("./HowItWorks"));
|
|
18
17
|
const PaymentMethodIcons_1 = __importDefault(require("./PaymentMethodIcons"));
|
|
19
18
|
function PaymentStripeWeb2({ order, stripePaymentIntentId, onPaymentSuccess }) {
|
|
20
|
-
const { theme, stripePublishableKey } = (0, react_2.
|
|
19
|
+
const { theme, stripePublishableKey } = (0, react_2.useB3Config)();
|
|
21
20
|
const fingerprintConfig = (0, AnySpendFingerprintWrapper_1.getFingerprintConfig)();
|
|
22
21
|
const { clientSecret, isLoadingStripeClientSecret, stripeClientSecretError } = (0, react_1.useStripeClientSecret)(stripePaymentIntentId);
|
|
23
22
|
if (isLoadingStripeClientSecret) {
|
|
@@ -59,7 +58,7 @@ function StripePaymentForm({ order, clientSecret, onPaymentSuccess, }) {
|
|
|
59
58
|
try {
|
|
60
59
|
const paymentIntent = await stripe.retrievePaymentIntent(clientSecret);
|
|
61
60
|
const amount = paymentIntent.paymentIntent?.amount
|
|
62
|
-
? (0,
|
|
61
|
+
? (0, payment_utils_1.formatStripeAmount)(paymentIntent.paymentIntent.amount)
|
|
63
62
|
: null;
|
|
64
63
|
setAmount(amount);
|
|
65
64
|
}
|
|
@@ -7,6 +7,7 @@ export * from "./useAnyspendQuote";
|
|
|
7
7
|
export * from "./useAnyspendTokens";
|
|
8
8
|
export * from "./useCoinbaseOnrampOptions";
|
|
9
9
|
export * from "./useConnectedUserProfile";
|
|
10
|
+
export * from "./useGasPrice";
|
|
10
11
|
export * from "./useGeoOnrampOptions";
|
|
11
12
|
export * from "./useGetGeo";
|
|
12
13
|
export * from "./useHyperliquidTransfer";
|
|
@@ -23,6 +23,7 @@ __exportStar(require("./useAnyspendQuote"), exports);
|
|
|
23
23
|
__exportStar(require("./useAnyspendTokens"), exports);
|
|
24
24
|
__exportStar(require("./useCoinbaseOnrampOptions"), exports);
|
|
25
25
|
__exportStar(require("./useConnectedUserProfile"), exports);
|
|
26
|
+
__exportStar(require("./useGasPrice"), exports);
|
|
26
27
|
__exportStar(require("./useGeoOnrampOptions"), exports);
|
|
27
28
|
__exportStar(require("./useGetGeo"), exports);
|
|
28
29
|
__exportStar(require("./useHyperliquidTransfer"), exports);
|
|
@@ -17,7 +17,7 @@ const useValidatedClientReferenceId_1 = require("./useValidatedClientReferenceId
|
|
|
17
17
|
*/
|
|
18
18
|
function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
|
|
19
19
|
// Get B3 context values
|
|
20
|
-
const { partnerId } = (0, react_1.
|
|
20
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
21
21
|
// Get validated client reference ID from B3 context
|
|
22
22
|
const createValidatedClientReferenceId = (0, useValidatedClientReferenceId_1.useValidatedClientReferenceId)();
|
|
23
23
|
// Get fingerprint data
|
|
@@ -15,7 +15,7 @@ const useValidatedClientReferenceId_1 = require("./useValidatedClientReferenceId
|
|
|
15
15
|
*/
|
|
16
16
|
function useAnyspendCreateOrder({ onSuccess, onError } = {}) {
|
|
17
17
|
// Get B3 context values
|
|
18
|
-
const { partnerId } = (0, react_1.
|
|
18
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
19
19
|
// Get validated client reference ID from B3 context
|
|
20
20
|
const createValidatedClientReferenceId = (0, useValidatedClientReferenceId_1.useValidatedClientReferenceId)();
|
|
21
21
|
// Get fingerprint data
|
|
@@ -12,7 +12,7 @@ const react_2 = require("react");
|
|
|
12
12
|
* This order type doesn't require srcAmount - the user deposits tokens after the order is created.
|
|
13
13
|
*/
|
|
14
14
|
function useCreateDepositFirstOrder({ onSuccess, onError } = {}) {
|
|
15
|
-
const { partnerId } = (0, react_1.
|
|
15
|
+
const { partnerId } = (0, react_1.useB3Config)();
|
|
16
16
|
const { data: fpData } = (0, fingerprintjs_pro_react_1.useVisitorData)({ extendedResult: true }, { immediate: true });
|
|
17
17
|
const visitorData = fpData && {
|
|
18
18
|
requestId: fpData.requestId,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { GasPriceData } from "../../types/gas";
|
|
2
|
+
export interface UseGasPriceOptions {
|
|
3
|
+
/** Refetch interval in ms (default: 10000 = 10s) */
|
|
4
|
+
refetchInterval?: number;
|
|
5
|
+
/** Whether to enable the query (default: true if chainId is supported) */
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface UseGasPriceResult {
|
|
9
|
+
/** Gas price data */
|
|
10
|
+
gasPrice: GasPriceData | undefined;
|
|
11
|
+
/** Whether the query is loading */
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
/** Whether there's an error */
|
|
14
|
+
isError: boolean;
|
|
15
|
+
/** Error object if any */
|
|
16
|
+
error: Error | null;
|
|
17
|
+
/** Whether gas is currently spiking */
|
|
18
|
+
isSpike: boolean;
|
|
19
|
+
/** Refetch function */
|
|
20
|
+
refetch: () => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* React hook to fetch current gas price for a chain.
|
|
24
|
+
*
|
|
25
|
+
* @param chainId - The chain ID to fetch gas price for
|
|
26
|
+
* @param options - Optional configuration
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* const { gasPrice, isSpike, isLoading } = useGasPrice(8453); // Base
|
|
31
|
+
*
|
|
32
|
+
* if (isSpike) {
|
|
33
|
+
* return <Warning>Gas prices are high: {gasPrice?.recommendation}</Warning>;
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function useGasPrice(chainId: number | undefined, options?: UseGasPriceOptions): UseGasPriceResult;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGasPrice = useGasPrice;
|
|
4
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const gas_1 = require("../../services/gas");
|
|
7
|
+
/**
|
|
8
|
+
* React hook to fetch current gas price for a chain.
|
|
9
|
+
*
|
|
10
|
+
* @param chainId - The chain ID to fetch gas price for
|
|
11
|
+
* @param options - Optional configuration
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { gasPrice, isSpike, isLoading } = useGasPrice(8453); // Base
|
|
16
|
+
*
|
|
17
|
+
* if (isSpike) {
|
|
18
|
+
* return <Warning>Gas prices are high: {gasPrice?.recommendation}</Warning>;
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
function useGasPrice(chainId, options = {}) {
|
|
23
|
+
const { refetchInterval = 10000, enabled } = options;
|
|
24
|
+
const isSupported = chainId !== undefined && (0, gas_1.isGasOracleSupported)(chainId);
|
|
25
|
+
const queryEnabled = enabled ?? isSupported;
|
|
26
|
+
const { data, isLoading, isError, error, refetch } = (0, react_query_1.useQuery)({
|
|
27
|
+
queryKey: ["gasPrice", chainId],
|
|
28
|
+
queryFn: () => gas_1.gasService.fetch(chainId),
|
|
29
|
+
enabled: queryEnabled && chainId !== undefined,
|
|
30
|
+
refetchInterval,
|
|
31
|
+
staleTime: 5000, // Consider data fresh for 5s
|
|
32
|
+
retry: 2,
|
|
33
|
+
refetchOnWindowFocus: true,
|
|
34
|
+
});
|
|
35
|
+
return (0, react_1.useMemo)(() => ({
|
|
36
|
+
gasPrice: data,
|
|
37
|
+
isLoading,
|
|
38
|
+
isError,
|
|
39
|
+
error: error,
|
|
40
|
+
isSpike: data?.isSpike ?? false,
|
|
41
|
+
refetch,
|
|
42
|
+
}), [data, isLoading, isError, error, refetch]);
|
|
43
|
+
}
|
|
@@ -9,7 +9,7 @@ const react_2 = require("react");
|
|
|
9
9
|
* Gets the createClientReferenceId function from B3 context and validates the result
|
|
10
10
|
*/
|
|
11
11
|
function useValidatedClientReferenceId() {
|
|
12
|
-
const { createClientReferenceId } = (0, react_1.
|
|
12
|
+
const { createClientReferenceId } = (0, react_1.useB3Config)();
|
|
13
13
|
const createValidatedClientReferenceId = (0, react_2.useCallback)(async (params) => {
|
|
14
14
|
// If no function provided, return undefined
|
|
15
15
|
if (!createClientReferenceId) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { GasOracleResponse, GasPriceData } from "../types/gas";
|
|
2
|
+
/** Supported chain IDs for gas oracle */
|
|
3
|
+
export declare const GAS_ORACLE_SUPPORTED_CHAINS: readonly [1, 137, 42161, 8453, 56, 10, 43114, 8333, 2741, 4689, 3338, 1329];
|
|
4
|
+
export type GasOracleSupportedChainId = (typeof GAS_ORACLE_SUPPORTED_CHAINS)[number];
|
|
5
|
+
/** Check if a chain is supported by the gas oracle */
|
|
6
|
+
export declare function isGasOracleSupported(chainId: number): chainId is GasOracleSupportedChainId;
|
|
7
|
+
/** Fetch gas price data from the gas oracle */
|
|
8
|
+
export declare function fetchGasPrice(chainId: number): Promise<GasOracleResponse>;
|
|
9
|
+
/** Transform raw oracle response to simplified UI data */
|
|
10
|
+
export declare function toGasPriceData(response: GasOracleResponse): GasPriceData;
|
|
11
|
+
/** Gas service for fetching and transforming gas data */
|
|
12
|
+
export declare const gasService: {
|
|
13
|
+
/** Fetch raw gas oracle response */
|
|
14
|
+
fetchRaw: typeof fetchGasPrice;
|
|
15
|
+
/** Fetch and transform to UI-friendly format */
|
|
16
|
+
fetch: (chainId: number) => Promise<GasPriceData>;
|
|
17
|
+
/** Check if chain is supported */
|
|
18
|
+
isSupported: typeof isGasOracleSupported;
|
|
19
|
+
/** List of supported chain IDs */
|
|
20
|
+
supportedChains: readonly [1, 137, 42161, 8453, 56, 10, 43114, 8333, 2741, 4689, 3338, 1329];
|
|
21
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gasService = exports.GAS_ORACLE_SUPPORTED_CHAINS = void 0;
|
|
4
|
+
exports.isGasOracleSupported = isGasOracleSupported;
|
|
5
|
+
exports.fetchGasPrice = fetchGasPrice;
|
|
6
|
+
exports.toGasPriceData = toGasPriceData;
|
|
7
|
+
const constants_1 = require("../constants");
|
|
8
|
+
/** Supported chain IDs for gas oracle */
|
|
9
|
+
exports.GAS_ORACLE_SUPPORTED_CHAINS = [
|
|
10
|
+
1, // Ethereum
|
|
11
|
+
137, // Polygon
|
|
12
|
+
42161, // Arbitrum
|
|
13
|
+
8453, // Base
|
|
14
|
+
56, // BSC
|
|
15
|
+
10, // Optimism
|
|
16
|
+
43114, // Avalanche
|
|
17
|
+
8333, // B3
|
|
18
|
+
2741, // Abstract
|
|
19
|
+
4689, // IoTeX
|
|
20
|
+
3338, // Peaq
|
|
21
|
+
1329, // Sei
|
|
22
|
+
];
|
|
23
|
+
/** Check if a chain is supported by the gas oracle */
|
|
24
|
+
function isGasOracleSupported(chainId) {
|
|
25
|
+
return exports.GAS_ORACLE_SUPPORTED_CHAINS.includes(chainId);
|
|
26
|
+
}
|
|
27
|
+
/** Fetch gas price data from the gas oracle */
|
|
28
|
+
async function fetchGasPrice(chainId) {
|
|
29
|
+
const response = await fetch(`${constants_1.GAS_ORACLE_BASE_URL}/gas/${chainId}`);
|
|
30
|
+
if (!response.ok) {
|
|
31
|
+
throw new Error(`Failed to fetch gas price for chain ${chainId}: ${response.status}`);
|
|
32
|
+
}
|
|
33
|
+
return response.json();
|
|
34
|
+
}
|
|
35
|
+
/** Transform raw oracle response to simplified UI data */
|
|
36
|
+
function toGasPriceData(response) {
|
|
37
|
+
const { analysis } = response;
|
|
38
|
+
const isSpike = analysis.level === "elevated" || analysis.level === "high" || analysis.level === "spike";
|
|
39
|
+
return {
|
|
40
|
+
chainId: response.chainId,
|
|
41
|
+
chainName: response.chainName,
|
|
42
|
+
gasPriceGwei: response.gasPrice.standard,
|
|
43
|
+
baseFeeGwei: response.eip1559?.baseFee,
|
|
44
|
+
level: analysis.level,
|
|
45
|
+
isSpike,
|
|
46
|
+
recommendation: analysis.recommendation,
|
|
47
|
+
vsMedian: analysis.vs1h, // Use 1h as primary comparison
|
|
48
|
+
source: response.source,
|
|
49
|
+
timestamp: response.timestamp,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** Gas service for fetching and transforming gas data */
|
|
53
|
+
exports.gasService = {
|
|
54
|
+
/** Fetch raw gas oracle response */
|
|
55
|
+
fetchRaw: fetchGasPrice,
|
|
56
|
+
/** Fetch and transform to UI-friendly format */
|
|
57
|
+
fetch: async (chainId) => {
|
|
58
|
+
const response = await fetchGasPrice(chainId);
|
|
59
|
+
return toGasPriceData(response);
|
|
60
|
+
},
|
|
61
|
+
/** Check if chain is supported */
|
|
62
|
+
isSupported: isGasOracleSupported,
|
|
63
|
+
/** List of supported chain IDs */
|
|
64
|
+
supportedChains: exports.GAS_ORACLE_SUPPORTED_CHAINS,
|
|
65
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** Gas level classification based on historical percentiles */
|
|
2
|
+
export type GasLevel = "low" | "normal" | "elevated" | "high" | "spike";
|
|
3
|
+
/** Gas prices in Gwei for different speed tiers */
|
|
4
|
+
export interface GasPrices {
|
|
5
|
+
low: string;
|
|
6
|
+
standard: string;
|
|
7
|
+
fast: string;
|
|
8
|
+
instant?: string;
|
|
9
|
+
}
|
|
10
|
+
/** EIP-1559 specific gas data */
|
|
11
|
+
export interface Eip1559Data {
|
|
12
|
+
baseFee: string;
|
|
13
|
+
maxPriorityFee: GasPrices;
|
|
14
|
+
maxFee: GasPrices;
|
|
15
|
+
}
|
|
16
|
+
/** Spike analysis comparing current gas to historical data */
|
|
17
|
+
export interface GasSpikeAnalysis {
|
|
18
|
+
level: GasLevel;
|
|
19
|
+
percentile: number;
|
|
20
|
+
/** Ratio to 1h median (primary spike detection) */
|
|
21
|
+
vs1h: number;
|
|
22
|
+
/** Ratio to 4h median (short-term context) */
|
|
23
|
+
vs4h: number;
|
|
24
|
+
/** Ratio to 24h median (daily context) */
|
|
25
|
+
vs24h: number;
|
|
26
|
+
recommendation: string;
|
|
27
|
+
}
|
|
28
|
+
/** Full gas response from the gas oracle */
|
|
29
|
+
export interface GasOracleResponse {
|
|
30
|
+
chainId: number;
|
|
31
|
+
chainName: string;
|
|
32
|
+
timestamp: string;
|
|
33
|
+
blockNumber?: number;
|
|
34
|
+
source: "blocknative" | "rpc";
|
|
35
|
+
gasPrice: GasPrices;
|
|
36
|
+
eip1559?: Eip1559Data;
|
|
37
|
+
analysis: GasSpikeAnalysis;
|
|
38
|
+
cached: boolean;
|
|
39
|
+
cacheAge?: number;
|
|
40
|
+
}
|
|
41
|
+
/** Simplified gas data for UI display */
|
|
42
|
+
export interface GasPriceData {
|
|
43
|
+
chainId: number;
|
|
44
|
+
chainName: string;
|
|
45
|
+
/** Standard gas price in Gwei */
|
|
46
|
+
gasPriceGwei: string;
|
|
47
|
+
/** Base fee in Gwei (EIP-1559 chains) */
|
|
48
|
+
baseFeeGwei?: string;
|
|
49
|
+
/** Gas level classification */
|
|
50
|
+
level: GasLevel;
|
|
51
|
+
/** Whether gas is currently spiking (elevated, high, or spike) */
|
|
52
|
+
isSpike: boolean;
|
|
53
|
+
/** Human-readable recommendation */
|
|
54
|
+
recommendation: string;
|
|
55
|
+
/** Ratio to recent median (1 = normal, >1.5 = elevated) */
|
|
56
|
+
vsMedian: number;
|
|
57
|
+
/** Data source */
|
|
58
|
+
source: "blocknative" | "rpc";
|
|
59
|
+
/** Timestamp of the data */
|
|
60
|
+
timestamp: string;
|
|
61
|
+
}
|
|
@@ -17,7 +17,6 @@ const framer_motion_1 = require("framer-motion");
|
|
|
17
17
|
const react_3 = require("react");
|
|
18
18
|
const react_4 = require("thirdweb/react");
|
|
19
19
|
const AvatarEditor_1 = require("./AvatarEditor/AvatarEditor");
|
|
20
|
-
const useB3_1 = require("./B3Provider/useB3");
|
|
21
20
|
const Deposit_1 = require("./Deposit/Deposit");
|
|
22
21
|
const LinkAccount_1 = require("./LinkAccount/LinkAccount");
|
|
23
22
|
const LinkNewAccount_1 = require("./LinkAccount/LinkNewAccount");
|
|
@@ -26,8 +25,8 @@ const NotificationsContent_1 = __importDefault(require("./ManageAccount/Notifica
|
|
|
26
25
|
const RequestPermissions_1 = require("./RequestPermissions/RequestPermissions");
|
|
27
26
|
const Send_1 = require("./Send/Send");
|
|
28
27
|
const SignInWithB3Flow_1 = require("./SignInWithB3/SignInWithB3Flow");
|
|
29
|
-
const TurnkeyAuthModal_1 = require("./TurnkeyAuthModal");
|
|
30
28
|
const index_1 = require("./Toast/index");
|
|
29
|
+
const TurnkeyAuthModal_1 = require("./TurnkeyAuthModal");
|
|
31
30
|
const dialog_1 = require("./ui/dialog");
|
|
32
31
|
const drawer_1 = require("./ui/drawer");
|
|
33
32
|
const debug = (0, debug_1.debugB3React)("B3DynamicModal");
|
|
@@ -36,7 +35,7 @@ function B3DynamicModal() {
|
|
|
36
35
|
const setB3ModalOpen = (0, react_2.useModalStore)(state => state.setB3ModalOpen);
|
|
37
36
|
const contentType = (0, react_2.useModalStore)(state => state.contentType);
|
|
38
37
|
const navigateBack = (0, react_2.useModalStore)(state => state.navigateBack);
|
|
39
|
-
const { theme } = (0,
|
|
38
|
+
const { theme } = (0, react_2.useB3Config)();
|
|
40
39
|
const isMobile = (0, react_2.useIsMobile)();
|
|
41
40
|
const prevIsOpenRef = (0, react_3.useRef)(isOpen);
|
|
42
41
|
const { wallet } = (0, react_2.useGlobalAccount)();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const hooks_1 = require("../../hooks");
|
|
4
|
+
const useAutoSelectWallet_1 = require("../../hooks/useAutoSelectWallet");
|
|
5
|
+
const AuthenticationProvider = ({ partnerId, automaticallySetFirstEoa, }) => {
|
|
6
|
+
(0, hooks_1.useAuthentication)(partnerId);
|
|
7
|
+
(0, useAutoSelectWallet_1.useAutoSelectWallet)({
|
|
8
|
+
enabled: automaticallySetFirstEoa,
|
|
9
|
+
});
|
|
10
|
+
return null;
|
|
11
|
+
};
|
|
12
|
+
exports.default = AuthenticationProvider;
|