@b3dotfun/sdk 0.0.7-alpha.27 → 0.0.7-alpha.3
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/abis/abi-usdc-base.js +97 -97
- package/dist/cjs/anyspend/abis/erc20-staking.js +51 -51
- package/dist/cjs/anyspend/constants/index.js +10 -13
- package/dist/cjs/anyspend/index.d.ts +2 -4
- package/dist/cjs/anyspend/index.js +4 -4
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpend.js +68 -69
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +66 -68
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +4 -4
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +101 -158
- package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +2 -3
- package/dist/cjs/anyspend/react/components/AnySpendNFT.js +5 -7
- package/dist/cjs/anyspend/react/components/AnySpendNFTButton.js +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +20 -21
- package/dist/cjs/anyspend/react/components/AnySpendTournament.js +4 -7
- package/dist/cjs/anyspend/react/components/common/ChainTokenIcon.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/common/ChainTokenIcon.js +1 -1
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +62 -51
- package/dist/cjs/anyspend/react/components/common/OrderHistory.js +6 -6
- package/dist/cjs/anyspend/react/components/common/OrderToken.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/common/OrderToken.js +4 -4
- package/dist/cjs/anyspend/react/components/common/OrderTokenAmount.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/common/OrderTokenAmount.js +2 -2
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +9 -9
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +14 -15
- package/dist/cjs/anyspend/react/components/common/PaymentMethodIcons.js +1 -1
- package/dist/cjs/anyspend/react/components/common/PaymentOneClick.js +3 -3
- package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.js +25 -26
- package/dist/cjs/anyspend/react/components/common/TokenBalance.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/common/TokenBalance.js +2 -2
- package/dist/cjs/anyspend/react/components/index.d.ts +0 -2
- package/dist/cjs/anyspend/react/components/index.js +1 -5
- package/dist/cjs/anyspend/react/components/modals/EnterRecipientModal.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/modals/EnterRecipientModal.js +6 -6
- package/dist/cjs/anyspend/react/components/webview/WebviewOnrampOrderStatus.js +1 -0
- package/dist/cjs/anyspend/react/components/webview/WebviewOnrampPayment.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/webview/WebviewOnrampPayment.js +25 -26
- package/dist/cjs/anyspend/react/hooks/index.d.ts +2 -1
- package/dist/cjs/anyspend/react/hooks/index.js +2 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +18 -3
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +6 -6
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +6 -6
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +70 -14
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderAndTransactions.js +2 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +70 -14
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.js +3 -3
- package/dist/cjs/anyspend/react/hooks/useAnyspendQuote.js +3 -3
- package/dist/cjs/anyspend/react/hooks/useAnyspendSendPermitData.d.ts +16 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendSendPermitData.js +39 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendTokens.js +3 -3
- package/dist/cjs/anyspend/react/hooks/useCoinbaseOnrampOptions.js +2 -2
- package/dist/cjs/anyspend/react/hooks/useGeoOnrampOptions.js +2 -2
- package/dist/cjs/anyspend/react/hooks/useGetGeo.js +1 -1
- package/dist/cjs/anyspend/react/hooks/usePermitData.d.ts +92 -0
- package/dist/cjs/anyspend/react/hooks/usePermitData.js +158 -0
- package/dist/cjs/anyspend/react/hooks/useStripeClientSecret.js +2 -2
- package/dist/cjs/anyspend/react/hooks/useStripeSupport.js +2 -2
- package/dist/cjs/anyspend/react/providers/AnyspendProvider.js +6 -7
- package/dist/cjs/anyspend/services/anyspend.d.ts +40 -9
- package/dist/cjs/anyspend/services/anyspend.js +24 -11
- package/dist/cjs/anyspend/types/custom.js +2 -2
- package/dist/cjs/anyspend/types/globalWallet.js +1 -1
- package/dist/cjs/anyspend/types/index.d.ts +1 -1
- package/dist/cjs/anyspend/types/index.js +1 -1
- package/dist/cjs/anyspend/types/nft.d.ts +0 -7
- package/dist/cjs/anyspend/types/nft.js +6 -8
- package/dist/cjs/anyspend/types/onramp.d.ts +0 -3
- package/dist/cjs/anyspend/types/onramp.js +1 -2
- package/dist/cjs/anyspend/types/order.d.ts +200 -40
- package/dist/cjs/anyspend/types/order.js +12 -7
- package/dist/cjs/anyspend/types/permit.d.ts +21 -0
- package/dist/cjs/anyspend/types/permit.js +11 -0
- package/dist/cjs/anyspend/types/req-res/createOrder.d.ts +235 -98
- package/dist/cjs/anyspend/types/req-res/createOrder.js +9 -9
- package/dist/cjs/anyspend/types/req-res/getCoinbaseOnrampOptions.js +5 -5
- package/dist/cjs/anyspend/types/req-res/getOrderAndTransactions.d.ts +305 -63
- package/dist/cjs/anyspend/types/req-res/getOrderAndTransactions.js +4 -4
- package/dist/cjs/anyspend/types/req-res/getOrderByCreator.js +2 -2
- package/dist/cjs/anyspend/types/req-res/getOrderHistory.d.ts +235 -49
- package/dist/cjs/anyspend/types/req-res/getOrderHistory.js +1 -1
- package/dist/cjs/anyspend/types/req-res/getQuote.d.ts +0 -37
- package/dist/cjs/anyspend/types/req-res/getQuote.js +9 -14
- package/dist/cjs/anyspend/types/req-res/getTokenList.js +3 -3
- package/dist/cjs/anyspend/types/req-res/index.d.ts +1 -0
- package/dist/cjs/anyspend/types/req-res/index.js +1 -0
- package/dist/cjs/anyspend/types/req-res/sendPermitData.d.ts +66 -0
- package/dist/cjs/anyspend/types/req-res/sendPermitData.js +11 -0
- package/dist/cjs/anyspend/types/swap.js +2 -2
- package/dist/cjs/anyspend/types/token.js +2 -2
- package/dist/cjs/anyspend/types/tournament.js +4 -4
- package/dist/cjs/anyspend/types/transaction.js +4 -4
- package/dist/cjs/anyspend/utils/chain.js +16 -16
- package/dist/cjs/anyspend/utils/format.js +6 -2
- package/dist/cjs/anyspend/utils/orderPayload.d.ts +3 -3
- package/dist/cjs/anyspend/utils/orderPayload.js +8 -22
- package/dist/cjs/anyspend/utils/token.js +10 -10
- package/dist/cjs/global-account/app.js +4 -4
- package/dist/cjs/global-account/app.native.js +4 -4
- package/dist/cjs/global-account/bsmnt.js +4 -4
- package/dist/cjs/global-account/bsmnt.native.js +4 -4
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +3 -13
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +3 -3
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +16 -17
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.d.ts +2 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +4 -4
- package/dist/cjs/global-account/react/components/B3Provider/types.js +1 -1
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.d.ts +1 -1
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +5 -5
- package/dist/cjs/global-account/react/components/MintButton/MintButton.d.ts +1 -1
- package/dist/cjs/global-account/react/components/MintButton/MintButton.js +5 -5
- package/dist/cjs/global-account/react/components/RelayKitProviderWrapper.js +2 -2
- package/dist/cjs/global-account/react/components/RequestPermissions/RequestPermissions.d.ts +1 -1
- package/dist/cjs/global-account/react/components/RequestPermissions/RequestPermissions.js +5 -5
- package/dist/cjs/global-account/react/components/RequestPermissions/RequestPermissionsButton.d.ts +1 -1
- package/dist/cjs/global-account/react/components/RequestPermissions/RequestPermissionsButton.js +2 -2
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3.d.ts +2 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3.js +17 -12
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.d.ts +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +12 -12
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/components/AuthButton.d.ts +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/components/AuthButton.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/components/WalletRow.d.ts +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/components/WalletRow.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.js +9 -9
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.d.ts +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +2 -2
- package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.js +2 -2
- package/dist/cjs/global-account/react/components/StyleRoot.js +1 -0
- package/dist/cjs/global-account/react/components/Transak/TransakModal.js +4 -4
- package/dist/cjs/global-account/react/components/custom/Button.js +5 -5
- package/dist/cjs/global-account/react/components/custom/StaggeredFadeLoader.js +3 -3
- package/dist/cjs/global-account/react/components/index.d.ts +4 -4
- package/dist/cjs/global-account/react/components/magicui/AnimatedLottie.js +1 -1
- package/dist/cjs/global-account/react/components/ui/Loading.js +2 -2
- package/dist/cjs/global-account/react/components/ui/ShinyButton.d.ts +1 -1
- package/dist/cjs/global-account/react/components/ui/ShinyButton.js +3 -3
- package/dist/cjs/global-account/react/components/ui/TabSystem.js +1 -1
- package/dist/cjs/global-account/react/components/ui/Tabs.d.ts +1 -1
- package/dist/cjs/global-account/react/components/ui/Tabs.js +1 -1
- package/dist/cjs/global-account/react/components/ui/badge.js +4 -4
- package/dist/cjs/global-account/react/components/ui/button.js +5 -5
- package/dist/cjs/global-account/react/components/ui/command.d.ts +1 -1
- package/dist/cjs/global-account/react/components/ui/dialog.d.ts +1 -1
- package/dist/cjs/global-account/react/components/ui/drawer.d.ts +1 -1
- package/dist/cjs/global-account/react/components/ui/glare-card-rounded.js +12 -12
- package/dist/cjs/global-account/react/components/ui/glare-card.js +11 -11
- package/dist/cjs/global-account/react/components/ui/input.js +1 -1
- package/dist/cjs/global-account/react/components/ui/text-loop.d.ts +1 -1
- package/dist/cjs/global-account/react/components/ui/text-loop.js +2 -2
- package/dist/cjs/global-account/react/components/ui/text-shimmer.js +2 -2
- package/dist/cjs/global-account/react/components/ui/tooltip.js +1 -1
- package/dist/cjs/global-account/react/hooks/useAccountAssets.js +4 -4
- package/dist/cjs/global-account/react/hooks/useAccountWallet.js +8 -8
- package/dist/cjs/global-account/react/hooks/useAddTWSessionKey.d.ts +2 -2
- package/dist/cjs/global-account/react/hooks/useAddTWSessionKey.js +6 -6
- package/dist/cjs/global-account/react/hooks/useAuthentication.js +3 -3
- package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.js +7 -7
- package/dist/cjs/global-account/react/hooks/useB3EnsName.d.ts +4 -8
- package/dist/cjs/global-account/react/hooks/useB3EnsName.js +23 -32
- package/dist/cjs/global-account/react/hooks/useBestTransactionPath.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useBestTransactionPath.js +10 -10
- package/dist/cjs/global-account/react/hooks/useBsmntProfile.js +1 -1
- package/dist/cjs/global-account/react/hooks/useChainSwitchWithAction.js +3 -3
- package/dist/cjs/global-account/react/hooks/useClaim.js +4 -4
- package/dist/cjs/global-account/react/hooks/useConnect.js +3 -3
- package/dist/cjs/global-account/react/hooks/useExchangeRate.js +3 -3
- package/dist/cjs/global-account/react/hooks/useGetAllTWSigners.js +7 -7
- package/dist/cjs/global-account/react/hooks/useGetGeo.js +1 -1
- package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.js +2 -2
- package/dist/cjs/global-account/react/hooks/useNativeBalance.js +6 -6
- package/dist/cjs/global-account/react/hooks/useOnchainName.js +10 -10
- package/dist/cjs/global-account/react/hooks/useOneBalance.js +2 -2
- package/dist/cjs/global-account/react/hooks/useRemoveSessionKey.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useRemoveSessionKey.js +3 -3
- package/dist/cjs/global-account/react/hooks/useRouter.js +6 -6
- package/dist/cjs/global-account/react/hooks/useSiwe.js +4 -4
- package/dist/cjs/global-account/react/hooks/useTokenBalance.js +6 -6
- package/dist/cjs/global-account/react/hooks/useTokenBalancesByChain.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useTokenBalancesByChain.js +9 -9
- package/dist/cjs/global-account/react/hooks/useTokenData.js +3 -3
- package/dist/cjs/global-account/react/hooks/useTokenFromUrl.js +14 -14
- package/dist/cjs/global-account/react/hooks/useTokenPrice.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useTokenPrice.js +6 -6
- package/dist/cjs/global-account/react/hooks/useTokenPriceWithFallback.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useTokenPriceWithFallback.js +7 -7
- package/dist/cjs/global-account/react/hooks/useTokensFromAddress.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useTokensFromAddress.js +2 -2
- package/dist/cjs/global-account/react/hooks/useURLParams.js +1 -1
- package/dist/cjs/global-account/react/stores/index.d.ts +1 -1
- package/dist/cjs/global-account/react/stores/useAuthStore.js +3 -3
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +1 -18
- package/dist/cjs/global-account/react/stores/useModalStore.js +3 -3
- package/dist/cjs/global-account/server.js +3 -3
- package/dist/cjs/global-account/types/chain-networks.js +8 -8
- package/dist/cjs/global-account/types/feature-flags.js +1 -1
- package/dist/cjs/shared/constants/chains/b3Chain.js +35 -35
- package/dist/cjs/shared/constants/chains/chainPlatformMap.js +1 -1
- package/dist/cjs/shared/constants/chains/supported.js +1 -1
- package/dist/cjs/shared/constants/index.d.ts +0 -1
- package/dist/cjs/shared/constants/index.js +2 -3
- package/dist/cjs/shared/thirdweb/initiateClient.js +2 -2
- package/dist/cjs/shared/thirdweb/openapi-ts.config.js +1 -1
- package/dist/cjs/shared/utils/b3Ens.js +4 -4
- package/dist/cjs/shared/utils/chain-transformers.js +9 -9
- package/dist/cjs/shared/utils/fetchBalances.js +4 -4
- package/dist/cjs/shared/utils/index.d.ts +0 -9
- package/dist/cjs/shared/utils/index.js +0 -17
- package/dist/cjs/shared/utils/insights.js +28 -28
- package/dist/cjs/shared/utils/ipfs.js +1 -1
- package/dist/cjs/shared/utils/number.js +3 -3
- package/dist/cjs/shared/utils/simplehash.js +22 -22
- package/dist/cjs/shared/utils/thirdweb-insights.js +15 -15
- package/dist/esm/anyspend/abis/abi-usdc-base.js +97 -97
- package/dist/esm/anyspend/abis/erc20-staking.js +51 -51
- package/dist/esm/anyspend/constants/index.js +10 -13
- package/dist/esm/anyspend/index.d.ts +2 -4
- package/dist/esm/anyspend/index.js +4 -4
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpend.js +22 -23
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +39 -41
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +4 -4
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +81 -138
- package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +2 -3
- package/dist/esm/anyspend/react/components/AnySpendNFT.js +5 -7
- package/dist/esm/anyspend/react/components/AnySpendNFTButton.js +1 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +21 -22
- package/dist/esm/anyspend/react/components/AnySpendTournament.js +4 -7
- package/dist/esm/anyspend/react/components/common/ChainTokenIcon.d.ts +1 -1
- package/dist/esm/anyspend/react/components/common/ChainTokenIcon.js +1 -1
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +63 -52
- package/dist/esm/anyspend/react/components/common/OrderHistory.js +1 -1
- package/dist/esm/anyspend/react/components/common/OrderToken.d.ts +1 -1
- package/dist/esm/anyspend/react/components/common/OrderToken.js +4 -4
- package/dist/esm/anyspend/react/components/common/OrderTokenAmount.d.ts +1 -1
- package/dist/esm/anyspend/react/components/common/OrderTokenAmount.js +2 -2
- package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +1 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +3 -3
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.d.ts +1 -1
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +8 -9
- package/dist/esm/anyspend/react/components/common/PaymentMethodIcons.js +1 -1
- package/dist/esm/anyspend/react/components/common/PaymentOneClick.js +3 -3
- package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.js +13 -14
- package/dist/esm/anyspend/react/components/common/TokenBalance.d.ts +1 -1
- package/dist/esm/anyspend/react/components/common/TokenBalance.js +2 -2
- package/dist/esm/anyspend/react/components/index.d.ts +0 -2
- package/dist/esm/anyspend/react/components/index.js +0 -2
- package/dist/esm/anyspend/react/components/modals/EnterRecipientModal.d.ts +1 -1
- package/dist/esm/anyspend/react/components/modals/EnterRecipientModal.js +2 -2
- package/dist/esm/anyspend/react/components/webview/WebviewOnrampOrderStatus.js +1 -0
- package/dist/esm/anyspend/react/components/webview/WebviewOnrampPayment.d.ts +1 -1
- package/dist/esm/anyspend/react/components/webview/WebviewOnrampPayment.js +15 -16
- package/dist/esm/anyspend/react/hooks/index.d.ts +2 -1
- package/dist/esm/anyspend/react/hooks/index.js +2 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +18 -3
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +6 -6
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +7 -7
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +70 -14
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.js +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +70 -14
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.js +3 -3
- package/dist/esm/anyspend/react/hooks/useAnyspendQuote.js +3 -3
- package/dist/esm/anyspend/react/hooks/useAnyspendSendPermitData.d.ts +16 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendSendPermitData.js +36 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendTokens.js +3 -3
- package/dist/esm/anyspend/react/hooks/useCoinbaseOnrampOptions.js +2 -2
- package/dist/esm/anyspend/react/hooks/useGeoOnrampOptions.js +2 -2
- package/dist/esm/anyspend/react/hooks/useGetGeo.js +1 -1
- package/dist/esm/anyspend/react/hooks/usePermitData.d.ts +92 -0
- package/dist/esm/anyspend/react/hooks/usePermitData.js +154 -0
- package/dist/esm/anyspend/react/hooks/useStripeClientSecret.js +2 -2
- package/dist/esm/anyspend/react/hooks/useStripeSupport.js +2 -2
- package/dist/esm/anyspend/react/providers/AnyspendProvider.js +4 -5
- package/dist/esm/anyspend/services/anyspend.d.ts +40 -9
- package/dist/esm/anyspend/services/anyspend.js +25 -12
- package/dist/esm/anyspend/types/custom.js +2 -2
- package/dist/esm/anyspend/types/globalWallet.js +1 -1
- package/dist/esm/anyspend/types/index.d.ts +1 -1
- package/dist/esm/anyspend/types/index.js +1 -1
- package/dist/esm/anyspend/types/nft.d.ts +0 -7
- package/dist/esm/anyspend/types/nft.js +6 -8
- package/dist/esm/anyspend/types/onramp.d.ts +0 -3
- package/dist/esm/anyspend/types/onramp.js +1 -2
- package/dist/esm/anyspend/types/order.d.ts +200 -40
- package/dist/esm/anyspend/types/order.js +12 -7
- package/dist/esm/anyspend/types/permit.d.ts +21 -0
- package/dist/esm/anyspend/types/permit.js +8 -0
- package/dist/esm/anyspend/types/req-res/createOrder.d.ts +235 -98
- package/dist/esm/anyspend/types/req-res/createOrder.js +9 -9
- package/dist/esm/anyspend/types/req-res/getCoinbaseOnrampOptions.js +5 -5
- package/dist/esm/anyspend/types/req-res/getOrderAndTransactions.d.ts +305 -63
- package/dist/esm/anyspend/types/req-res/getOrderAndTransactions.js +4 -4
- package/dist/esm/anyspend/types/req-res/getOrderByCreator.js +2 -2
- package/dist/esm/anyspend/types/req-res/getOrderHistory.d.ts +235 -49
- package/dist/esm/anyspend/types/req-res/getOrderHistory.js +1 -1
- package/dist/esm/anyspend/types/req-res/getQuote.d.ts +0 -37
- package/dist/esm/anyspend/types/req-res/getQuote.js +9 -14
- package/dist/esm/anyspend/types/req-res/getTokenList.js +3 -3
- package/dist/esm/anyspend/types/req-res/index.d.ts +1 -0
- package/dist/esm/anyspend/types/req-res/index.js +1 -0
- package/dist/esm/anyspend/types/req-res/sendPermitData.d.ts +66 -0
- package/dist/esm/anyspend/types/req-res/sendPermitData.js +8 -0
- package/dist/esm/anyspend/types/swap.js +2 -2
- package/dist/esm/anyspend/types/token.js +2 -2
- package/dist/esm/anyspend/types/tournament.js +4 -4
- package/dist/esm/anyspend/types/transaction.js +4 -4
- package/dist/esm/anyspend/utils/chain.js +18 -18
- package/dist/esm/anyspend/utils/format.js +6 -2
- package/dist/esm/anyspend/utils/orderPayload.d.ts +3 -3
- package/dist/esm/anyspend/utils/orderPayload.js +9 -23
- package/dist/esm/anyspend/utils/token.js +10 -10
- package/dist/esm/global-account/app.js +4 -4
- package/dist/esm/global-account/app.native.js +4 -4
- package/dist/esm/global-account/bsmnt.js +4 -4
- package/dist/esm/global-account/bsmnt.native.js +4 -4
- package/dist/esm/global-account/react/components/B3DynamicModal.js +4 -14
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +3 -3
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +7 -8
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.d.ts +2 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +4 -4
- package/dist/esm/global-account/react/components/B3Provider/types.js +1 -1
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.d.ts +1 -1
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +6 -6
- package/dist/esm/global-account/react/components/MintButton/MintButton.d.ts +1 -1
- package/dist/esm/global-account/react/components/MintButton/MintButton.js +5 -5
- package/dist/esm/global-account/react/components/RelayKitProviderWrapper.js +2 -2
- package/dist/esm/global-account/react/components/RequestPermissions/RequestPermissions.d.ts +1 -1
- package/dist/esm/global-account/react/components/RequestPermissions/RequestPermissions.js +6 -6
- package/dist/esm/global-account/react/components/RequestPermissions/RequestPermissionsButton.d.ts +1 -1
- package/dist/esm/global-account/react/components/RequestPermissions/RequestPermissionsButton.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3.d.ts +2 -1
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3.js +13 -8
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.d.ts +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +13 -13
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/components/AuthButton.d.ts +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/components/AuthButton.js +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/components/WalletRow.d.ts +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/components/WalletRow.js +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +9 -9
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.d.ts +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +3 -3
- package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.js +2 -2
- package/dist/esm/global-account/react/components/StyleRoot.js +1 -0
- package/dist/esm/global-account/react/components/Transak/TransakModal.js +4 -4
- package/dist/esm/global-account/react/components/custom/Button.js +5 -5
- package/dist/esm/global-account/react/components/custom/StaggeredFadeLoader.js +3 -3
- package/dist/esm/global-account/react/components/custom/WalletConnectorIcon.js +1 -1
- package/dist/esm/global-account/react/components/index.d.ts +4 -4
- package/dist/esm/global-account/react/components/index.js +4 -4
- package/dist/esm/global-account/react/components/magicui/AnimatedLottie.js +1 -1
- package/dist/esm/global-account/react/components/ui/Loading.js +2 -2
- package/dist/esm/global-account/react/components/ui/ShinyButton.d.ts +1 -1
- package/dist/esm/global-account/react/components/ui/ShinyButton.js +3 -3
- package/dist/esm/global-account/react/components/ui/TabSystem.js +1 -1
- package/dist/esm/global-account/react/components/ui/Tabs.d.ts +1 -1
- package/dist/esm/global-account/react/components/ui/Tabs.js +1 -1
- package/dist/esm/global-account/react/components/ui/badge.js +4 -4
- package/dist/esm/global-account/react/components/ui/button.js +5 -5
- package/dist/esm/global-account/react/components/ui/command.d.ts +1 -1
- package/dist/esm/global-account/react/components/ui/command.js +1 -1
- package/dist/esm/global-account/react/components/ui/dialog.d.ts +1 -1
- package/dist/esm/global-account/react/components/ui/dialog.js +1 -1
- package/dist/esm/global-account/react/components/ui/drawer.d.ts +1 -1
- package/dist/esm/global-account/react/components/ui/drawer.js +1 -1
- package/dist/esm/global-account/react/components/ui/glare-card-rounded.js +12 -12
- package/dist/esm/global-account/react/components/ui/glare-card.js +11 -11
- package/dist/esm/global-account/react/components/ui/input.js +1 -1
- package/dist/esm/global-account/react/components/ui/text-loop.d.ts +1 -1
- package/dist/esm/global-account/react/components/ui/text-loop.js +2 -2
- package/dist/esm/global-account/react/components/ui/text-shimmer.js +2 -2
- package/dist/esm/global-account/react/components/ui/tooltip.js +1 -1
- package/dist/esm/global-account/react/hooks/useAccountAssets.js +4 -4
- package/dist/esm/global-account/react/hooks/useAccountWallet.js +8 -8
- package/dist/esm/global-account/react/hooks/useAddTWSessionKey.d.ts +2 -2
- package/dist/esm/global-account/react/hooks/useAddTWSessionKey.js +6 -6
- package/dist/esm/global-account/react/hooks/useAuthentication.js +3 -3
- package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +7 -7
- package/dist/esm/global-account/react/hooks/useB3EnsName.d.ts +4 -8
- package/dist/esm/global-account/react/hooks/useB3EnsName.js +22 -34
- package/dist/esm/global-account/react/hooks/useBestTransactionPath.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useBestTransactionPath.js +10 -10
- package/dist/esm/global-account/react/hooks/useBsmntProfile.js +1 -1
- package/dist/esm/global-account/react/hooks/useChainSwitchWithAction.js +3 -3
- package/dist/esm/global-account/react/hooks/useClaim.js +4 -4
- package/dist/esm/global-account/react/hooks/useConnect.js +3 -3
- package/dist/esm/global-account/react/hooks/useExchangeRate.js +3 -3
- package/dist/esm/global-account/react/hooks/useGetAllTWSigners.js +7 -7
- package/dist/esm/global-account/react/hooks/useGetGeo.js +1 -1
- package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.js +2 -2
- package/dist/esm/global-account/react/hooks/useNativeBalance.js +6 -6
- package/dist/esm/global-account/react/hooks/useOnchainName.js +10 -10
- package/dist/esm/global-account/react/hooks/useOneBalance.js +2 -2
- package/dist/esm/global-account/react/hooks/useRemoveSessionKey.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useRemoveSessionKey.js +3 -3
- package/dist/esm/global-account/react/hooks/useRouter.js +6 -6
- package/dist/esm/global-account/react/hooks/useSiwe.js +4 -4
- package/dist/esm/global-account/react/hooks/useTokenBalance.js +6 -6
- package/dist/esm/global-account/react/hooks/useTokenBalancesByChain.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useTokenBalancesByChain.js +9 -9
- package/dist/esm/global-account/react/hooks/useTokenData.js +3 -3
- package/dist/esm/global-account/react/hooks/useTokenFromUrl.js +13 -13
- package/dist/esm/global-account/react/hooks/useTokenPrice.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useTokenPrice.js +6 -6
- package/dist/esm/global-account/react/hooks/useTokenPriceWithFallback.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useTokenPriceWithFallback.js +7 -7
- package/dist/esm/global-account/react/hooks/useTokensFromAddress.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useTokensFromAddress.js +2 -2
- package/dist/esm/global-account/react/hooks/useURLParams.js +1 -1
- package/dist/esm/global-account/react/stores/index.d.ts +1 -1
- package/dist/esm/global-account/react/stores/useAuthStore.js +3 -3
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +1 -18
- package/dist/esm/global-account/react/stores/useModalStore.js +3 -3
- package/dist/esm/global-account/server.js +3 -3
- package/dist/esm/global-account/types/chain-networks.js +8 -8
- package/dist/esm/global-account/types/feature-flags.js +1 -1
- package/dist/esm/shared/constants/chains/b3Chain.js +35 -35
- package/dist/esm/shared/constants/chains/chainPlatformMap.js +1 -1
- package/dist/esm/shared/constants/chains/supported.js +1 -1
- package/dist/esm/shared/constants/index.d.ts +0 -1
- package/dist/esm/shared/constants/index.js +1 -2
- package/dist/esm/shared/thirdweb/initiateClient.js +2 -2
- package/dist/esm/shared/thirdweb/openapi-ts.config.js +1 -1
- package/dist/esm/shared/utils/b3Ens.js +4 -4
- package/dist/esm/shared/utils/chain-transformers.js +9 -9
- package/dist/esm/shared/utils/fetchBalances.js +4 -4
- package/dist/esm/shared/utils/index.d.ts +0 -9
- package/dist/esm/shared/utils/index.js +0 -15
- package/dist/esm/shared/utils/insights.js +28 -28
- package/dist/esm/shared/utils/ipfs.js +1 -1
- package/dist/esm/shared/utils/number.js +3 -3
- package/dist/esm/shared/utils/simplehash.js +23 -23
- package/dist/esm/shared/utils/thirdweb-insights.js +15 -15
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/index.d.ts +2 -4
- package/dist/types/anyspend/react/components/AnySpend.d.ts +1 -1
- package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +1 -1
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +4 -4
- package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +2 -3
- package/dist/types/anyspend/react/components/AnySpendStakeB3.d.ts +1 -1
- package/dist/types/anyspend/react/components/common/ChainTokenIcon.d.ts +1 -1
- package/dist/types/anyspend/react/components/common/OrderToken.d.ts +1 -1
- package/dist/types/anyspend/react/components/common/OrderTokenAmount.d.ts +1 -1
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +1 -1
- package/dist/types/anyspend/react/components/common/PanelOnrampPayment.d.ts +1 -1
- package/dist/types/anyspend/react/components/common/TokenBalance.d.ts +1 -1
- package/dist/types/anyspend/react/components/index.d.ts +0 -2
- package/dist/types/anyspend/react/components/modals/EnterRecipientModal.d.ts +1 -1
- package/dist/types/anyspend/react/components/webview/WebviewOnrampPayment.d.ts +1 -1
- package/dist/types/anyspend/react/hooks/index.d.ts +2 -1
- package/dist/types/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +18 -3
- package/dist/types/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
- package/dist/types/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +70 -14
- package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +70 -14
- package/dist/types/anyspend/react/hooks/useAnyspendSendPermitData.d.ts +16 -0
- package/dist/types/anyspend/react/hooks/usePermitData.d.ts +92 -0
- package/dist/types/anyspend/services/anyspend.d.ts +40 -9
- package/dist/types/anyspend/types/index.d.ts +1 -1
- package/dist/types/anyspend/types/nft.d.ts +0 -7
- package/dist/types/anyspend/types/onramp.d.ts +0 -3
- package/dist/types/anyspend/types/order.d.ts +200 -40
- package/dist/types/anyspend/types/permit.d.ts +21 -0
- package/dist/types/anyspend/types/req-res/createOrder.d.ts +235 -98
- package/dist/types/anyspend/types/req-res/getOrderAndTransactions.d.ts +305 -63
- package/dist/types/anyspend/types/req-res/getOrderHistory.d.ts +235 -49
- package/dist/types/anyspend/types/req-res/getQuote.d.ts +0 -37
- package/dist/types/anyspend/types/req-res/index.d.ts +1 -0
- package/dist/types/anyspend/types/req-res/sendPermitData.d.ts +66 -0
- package/dist/types/anyspend/utils/orderPayload.d.ts +3 -3
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +3 -3
- package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +2 -2
- package/dist/types/global-account/react/components/ManageAccount/ManageAccount.d.ts +1 -1
- package/dist/types/global-account/react/components/MintButton/MintButton.d.ts +1 -1
- package/dist/types/global-account/react/components/RequestPermissions/RequestPermissions.d.ts +1 -1
- package/dist/types/global-account/react/components/RequestPermissions/RequestPermissionsButton.d.ts +1 -1
- package/dist/types/global-account/react/components/SignInWithB3/SignInWithB3.d.ts +2 -1
- package/dist/types/global-account/react/components/SignInWithB3/SignInWithB3Flow.d.ts +1 -1
- package/dist/types/global-account/react/components/SignInWithB3/components/AuthButton.d.ts +1 -1
- package/dist/types/global-account/react/components/SignInWithB3/components/WalletRow.d.ts +1 -1
- package/dist/types/global-account/react/components/SignInWithB3/steps/LoginStepCustom.d.ts +1 -1
- package/dist/types/global-account/react/components/index.d.ts +4 -4
- package/dist/types/global-account/react/components/ui/ShinyButton.d.ts +1 -1
- package/dist/types/global-account/react/components/ui/Tabs.d.ts +1 -1
- package/dist/types/global-account/react/components/ui/command.d.ts +1 -1
- package/dist/types/global-account/react/components/ui/dialog.d.ts +1 -1
- package/dist/types/global-account/react/components/ui/drawer.d.ts +1 -1
- package/dist/types/global-account/react/components/ui/text-loop.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useAddTWSessionKey.d.ts +2 -2
- package/dist/types/global-account/react/hooks/useB3EnsName.d.ts +4 -8
- package/dist/types/global-account/react/hooks/useBestTransactionPath.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useRemoveSessionKey.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useTokenBalancesByChain.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useTokenPrice.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useTokenPriceWithFallback.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useTokensFromAddress.d.ts +1 -1
- package/dist/types/global-account/react/stores/index.d.ts +1 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +1 -18
- package/dist/types/shared/constants/index.d.ts +0 -1
- package/dist/types/shared/utils/index.d.ts +0 -9
- package/package.json +4 -17
- package/src/anyspend/abis/abi-usdc-base.ts +97 -97
- package/src/anyspend/abis/erc20-staking.ts +51 -51
- package/src/anyspend/constants/index.ts +11 -13
- package/src/anyspend/index.ts +6 -4
- package/src/anyspend/react/components/AnySpend.tsx +39 -44
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +41 -46
- package/src/anyspend/react/components/AnySpendCustom.tsx +89 -214
- package/src/anyspend/react/components/AnySpendNFT.tsx +6 -11
- package/src/anyspend/react/components/AnySpendNFTButton.tsx +1 -1
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +22 -23
- package/src/anyspend/react/components/AnySpendTournament.tsx +4 -7
- package/src/anyspend/react/components/common/ChainTokenIcon.tsx +1 -1
- package/src/anyspend/react/components/common/OrderDetails.tsx +76 -74
- package/src/anyspend/react/components/common/OrderHistory.tsx +1 -1
- package/src/anyspend/react/components/common/OrderHistoryItem.tsx +3 -3
- package/src/anyspend/react/components/common/OrderToken.tsx +5 -5
- package/src/anyspend/react/components/common/OrderTokenAmount.tsx +4 -4
- package/src/anyspend/react/components/common/PanelOnramp.tsx +4 -4
- package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +17 -9
- package/src/anyspend/react/components/common/PaymentMethodIcons.tsx +1 -1
- package/src/anyspend/react/components/common/PaymentOneClick.tsx +3 -3
- package/src/anyspend/react/components/common/PaymentStripeWeb2.tsx +15 -16
- package/src/anyspend/react/components/common/TokenBalance.tsx +2 -2
- package/src/anyspend/react/components/index.ts +0 -2
- package/src/anyspend/react/components/modals/EnterRecipientModal.tsx +2 -2
- package/src/anyspend/react/components/webview/WebviewOnrampOrderStatus.tsx +1 -0
- package/src/anyspend/react/components/webview/WebviewOnrampPayment.tsx +20 -18
- package/src/anyspend/react/hooks/index.ts +2 -1
- package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +20 -10
- package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +8 -9
- package/src/anyspend/react/hooks/useAnyspendOrderAndTransactions.ts +3 -3
- package/src/anyspend/react/hooks/useAnyspendOrderHistory.ts +4 -4
- package/src/anyspend/react/hooks/useAnyspendQuote.ts +6 -6
- package/src/anyspend/react/hooks/useAnyspendSendPermitData.ts +38 -0
- package/src/anyspend/react/hooks/useAnyspendTokens.ts +4 -4
- package/src/anyspend/react/hooks/useCoinbaseOnrampOptions.ts +3 -3
- package/src/anyspend/react/hooks/useGeoOnrampOptions.ts +3 -3
- package/src/anyspend/react/hooks/useGetGeo.ts +1 -1
- package/src/anyspend/react/hooks/usePermitData.ts +183 -0
- package/src/anyspend/react/hooks/useStripeClientSecret.ts +3 -3
- package/src/anyspend/react/hooks/useStripeSupport.ts +3 -3
- package/src/anyspend/react/providers/AnyspendProvider.tsx +4 -9
- package/src/anyspend/services/anyspend.ts +39 -21
- package/src/anyspend/types/chain.ts +1 -1
- package/src/anyspend/types/custom.ts +2 -2
- package/src/anyspend/types/globalWallet.ts +1 -1
- package/src/anyspend/types/index.ts +1 -1
- package/src/anyspend/types/nft.ts +7 -10
- package/src/anyspend/types/onramp.ts +2 -3
- package/src/anyspend/types/order.ts +16 -9
- package/src/anyspend/types/permit.ts +10 -0
- package/src/anyspend/types/relay.ts +1 -1
- package/src/anyspend/types/req-res/createOrder.ts +9 -9
- package/src/anyspend/types/req-res/getCoinbaseOnrampOptions.ts +5 -5
- package/src/anyspend/types/req-res/getOrderAndTransactions.ts +4 -4
- package/src/anyspend/types/req-res/getOrderByCreator.ts +2 -2
- package/src/anyspend/types/req-res/getOrderHistory.ts +1 -1
- package/src/anyspend/types/req-res/getQuote.ts +9 -14
- package/src/anyspend/types/req-res/getTokenList.ts +4 -4
- package/src/anyspend/types/req-res/index.ts +1 -0
- package/src/anyspend/types/req-res/sendPermitData.ts +10 -0
- package/src/anyspend/types/swap.ts +2 -2
- package/src/anyspend/types/token.ts +2 -2
- package/src/anyspend/types/tournament.ts +4 -4
- package/src/anyspend/types/transaction.ts +4 -4
- package/src/anyspend/utils/chain.ts +25 -25
- package/src/anyspend/utils/format.ts +7 -2
- package/src/anyspend/utils/orderPayload.ts +9 -21
- package/src/anyspend/utils/token.ts +10 -10
- package/src/global-account/app.native.ts +5 -5
- package/src/global-account/app.ts +5 -5
- package/src/global-account/bsmnt.native.ts +5 -5
- package/src/global-account/bsmnt.ts +5 -5
- package/src/global-account/react/components/B3DynamicModal.tsx +6 -15
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +4 -4
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +20 -22
- package/src/global-account/react/components/B3Provider/types.ts +1 -1
- package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +6 -6
- package/src/global-account/react/components/MintButton/MintButton.tsx +5 -5
- package/src/global-account/react/components/RelayKitProviderWrapper.tsx +2 -2
- package/src/global-account/react/components/RequestPermissions/RequestPermissions.tsx +7 -7
- package/src/global-account/react/components/RequestPermissions/RequestPermissionsButton.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/SignInWithB3.tsx +28 -16
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +14 -14
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +2 -2
- package/src/global-account/react/components/SignInWithB3/components/AuthButton.tsx +1 -1
- package/src/global-account/react/components/SignInWithB3/components/WalletRow.tsx +1 -1
- package/src/global-account/react/components/SignInWithB3/steps/LoginStep.tsx +10 -10
- package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +3 -3
- package/src/global-account/react/components/SignInWithB3/utils/signInUtils.ts +2 -2
- package/src/global-account/react/components/StyleRoot.tsx +1 -0
- package/src/global-account/react/components/Transak/TransakModal.tsx +4 -4
- package/src/global-account/react/components/custom/Button.tsx +7 -7
- package/src/global-account/react/components/custom/StaggeredFadeLoader.tsx +3 -3
- package/src/global-account/react/components/custom/WalletConnectorIcon.tsx +1 -1
- package/src/global-account/react/components/index.ts +4 -4
- package/src/global-account/react/components/magicui/AnimatedLottie.tsx +5 -5
- package/src/global-account/react/components/ui/Loading.tsx +2 -2
- package/src/global-account/react/components/ui/ShinyButton.tsx +5 -5
- package/src/global-account/react/components/ui/TabSystem.tsx +2 -2
- package/src/global-account/react/components/ui/Tabs.tsx +4 -4
- package/src/global-account/react/components/ui/badge.tsx +5 -5
- package/src/global-account/react/components/ui/button.tsx +7 -7
- package/src/global-account/react/components/ui/command.tsx +5 -5
- package/src/global-account/react/components/ui/dialog.tsx +5 -5
- package/src/global-account/react/components/ui/drawer.tsx +2 -2
- package/src/global-account/react/components/ui/glare-card-rounded.tsx +12 -12
- package/src/global-account/react/components/ui/glare-card.tsx +11 -11
- package/src/global-account/react/components/ui/input.tsx +2 -2
- package/src/global-account/react/components/ui/popover.tsx +1 -1
- package/src/global-account/react/components/ui/scroll-area.tsx +1 -1
- package/src/global-account/react/components/ui/text-loop.tsx +2 -2
- package/src/global-account/react/components/ui/text-shimmer.tsx +3 -3
- package/src/global-account/react/components/ui/tooltip.tsx +2 -2
- package/src/global-account/react/hooks/useAccountAssets.ts +4 -4
- package/src/global-account/react/hooks/useAccountWallet.tsx +9 -9
- package/src/global-account/react/hooks/useAddTWSessionKey.tsx +7 -7
- package/src/global-account/react/hooks/useAuthentication.ts +3 -3
- package/src/global-account/react/hooks/useB3BalanceFromAddresses.ts +9 -9
- package/src/global-account/react/hooks/useB3EnsName.ts +31 -43
- package/src/global-account/react/hooks/useBestTransactionPath.tsx +11 -11
- package/src/global-account/react/hooks/useBsmntProfile.ts +1 -1
- package/src/global-account/react/hooks/useChainSwitchWithAction.ts +4 -4
- package/src/global-account/react/hooks/useClaim.tsx +5 -5
- package/src/global-account/react/hooks/useConnect.tsx +4 -4
- package/src/global-account/react/hooks/useExchangeRate.tsx +3 -3
- package/src/global-account/react/hooks/useGetAllTWSigners.tsx +9 -9
- package/src/global-account/react/hooks/useGetGeo.tsx +1 -1
- package/src/global-account/react/hooks/useHandleConnectWithPrivy.tsx +2 -2
- package/src/global-account/react/hooks/useMediaQuery.tsx +1 -1
- package/src/global-account/react/hooks/useNativeBalance.tsx +7 -7
- package/src/global-account/react/hooks/useOnchainName.tsx +11 -11
- package/src/global-account/react/hooks/useOneBalance.tsx +2 -2
- package/src/global-account/react/hooks/useQueryB3.ts +2 -2
- package/src/global-account/react/hooks/useQueryBSMNT.ts +2 -2
- package/src/global-account/react/hooks/useRemoveSessionKey.tsx +5 -5
- package/src/global-account/react/hooks/useRouter.tsx +6 -6
- package/src/global-account/react/hooks/useSiwe.tsx +4 -4
- package/src/global-account/react/hooks/useTokenBalance.tsx +6 -6
- package/src/global-account/react/hooks/useTokenBalancesByChain.tsx +10 -10
- package/src/global-account/react/hooks/useTokenData.ts +3 -3
- package/src/global-account/react/hooks/useTokenFromUrl.tsx +14 -14
- package/src/global-account/react/hooks/useTokenPrice.tsx +7 -7
- package/src/global-account/react/hooks/useTokenPriceWithFallback.tsx +7 -7
- package/src/global-account/react/hooks/useTokensFromAddress.ts +2 -2
- package/src/global-account/react/hooks/useURLParams.ts +2 -2
- package/src/global-account/react/stores/index.ts +1 -1
- package/src/global-account/react/stores/useAuthStore.ts +3 -3
- package/src/global-account/react/stores/useModalStore.ts +4 -23
- package/src/global-account/server.ts +3 -3
- package/src/global-account/types/chain-networks.ts +10 -10
- package/src/global-account/types/feature-flags.ts +2 -2
- package/src/shared/constants/chains/b3Chain.ts +35 -35
- package/src/shared/constants/chains/chainPlatformMap.ts +1 -1
- package/src/shared/constants/chains/supported.ts +1 -1
- package/src/shared/constants/index.ts +1 -3
- package/src/shared/thirdweb/initiateClient.ts +2 -2
- package/src/shared/thirdweb/openapi-ts.config.ts +1 -1
- package/src/shared/utils/b3Ens.ts +4 -4
- package/src/shared/utils/chain-transformers.ts +9 -9
- package/src/shared/utils/fetchBalances.ts +5 -5
- package/src/shared/utils/fetchBsmntProfile.ts +1 -1
- package/src/shared/utils/index.ts +0 -16
- package/src/shared/utils/insights.ts +31 -31
- package/src/shared/utils/ipfs.ts +1 -1
- package/src/shared/utils/number.ts +5 -5
- package/src/shared/utils/simplehash.ts +28 -28
- package/src/shared/utils/thirdweb-insights.ts +20 -20
- package/src/styles/index.css +2 -5
- package/dist/cjs/anyspend/abis/signature-minting.d.ts +0 -79
- package/dist/cjs/anyspend/abis/signature-minting.js +0 -45
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.d.ts +0 -8
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +0 -77
- package/dist/cjs/anyspend/react/components/common/Warning.d.ts +0 -3
- package/dist/cjs/anyspend/react/components/common/Warning.js +0 -7
- package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +0 -140
- package/dist/cjs/anyspend/react/hooks/useSigMint.js +0 -39
- package/dist/cjs/anyspend/types/metadata.d.ts +0 -26
- package/dist/cjs/anyspend/types/metadata.js +0 -16
- package/dist/cjs/anyspend/types/signature-mint.d.ts +0 -69
- package/dist/cjs/anyspend/types/signature-mint.js +0 -2
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.d.ts +0 -14
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +0 -50
- package/dist/cjs/global-account/react/components/custom/Icon.d.ts +0 -7
- package/dist/cjs/global-account/react/components/custom/Icon.js +0 -52
- package/dist/cjs/global-account/react/components/custom/ManageAccountButton.d.ts +0 -4
- package/dist/cjs/global-account/react/components/custom/ManageAccountButton.js +0 -20
- package/dist/cjs/shared/react/hooks/index.d.ts +0 -1
- package/dist/cjs/shared/react/hooks/index.js +0 -17
- package/dist/cjs/shared/react/hooks/useNavigation.d.ts +0 -17
- package/dist/cjs/shared/react/hooks/useNavigation.js +0 -57
- package/dist/cjs/shared/react/index.d.ts +0 -1
- package/dist/cjs/shared/react/index.js +0 -17
- package/dist/esm/anyspend/abis/signature-minting.d.ts +0 -79
- package/dist/esm/anyspend/abis/signature-minting.js +0 -42
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.d.ts +0 -8
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +0 -71
- package/dist/esm/anyspend/react/components/common/Warning.d.ts +0 -3
- package/dist/esm/anyspend/react/components/common/Warning.js +0 -4
- package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +0 -140
- package/dist/esm/anyspend/react/hooks/useSigMint.js +0 -33
- package/dist/esm/anyspend/types/metadata.d.ts +0 -26
- package/dist/esm/anyspend/types/metadata.js +0 -11
- package/dist/esm/anyspend/types/signature-mint.d.ts +0 -69
- package/dist/esm/anyspend/types/signature-mint.js +0 -1
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.d.ts +0 -14
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +0 -44
- package/dist/esm/global-account/react/components/custom/Icon.d.ts +0 -7
- package/dist/esm/global-account/react/components/custom/Icon.js +0 -50
- package/dist/esm/global-account/react/components/custom/ManageAccountButton.d.ts +0 -4
- package/dist/esm/global-account/react/components/custom/ManageAccountButton.js +0 -17
- package/dist/esm/shared/react/hooks/index.d.ts +0 -1
- package/dist/esm/shared/react/hooks/index.js +0 -1
- package/dist/esm/shared/react/hooks/useNavigation.d.ts +0 -17
- package/dist/esm/shared/react/hooks/useNavigation.js +0 -52
- package/dist/esm/shared/react/index.d.ts +0 -1
- package/dist/esm/shared/react/index.js +0 -1
- package/dist/types/anyspend/abis/signature-minting.d.ts +0 -79
- package/dist/types/anyspend/react/components/AnyspendSignatureMint.d.ts +0 -8
- package/dist/types/anyspend/react/components/common/Warning.d.ts +0 -3
- package/dist/types/anyspend/react/hooks/useSigMint.d.ts +0 -140
- package/dist/types/anyspend/types/metadata.d.ts +0 -26
- package/dist/types/anyspend/types/signature-mint.d.ts +0 -69
- package/dist/types/global-account/react/components/SignInWithB3/SignIn.d.ts +0 -14
- package/dist/types/global-account/react/components/custom/Icon.d.ts +0 -7
- package/dist/types/global-account/react/components/custom/ManageAccountButton.d.ts +0 -4
- package/dist/types/shared/react/hooks/index.d.ts +0 -1
- package/dist/types/shared/react/hooks/useNavigation.d.ts +0 -17
- package/dist/types/shared/react/index.d.ts +0 -1
- package/src/anyspend/abis/signature-minting.ts +0 -43
- package/src/anyspend/react/components/AnyspendSignatureMint.tsx +0 -147
- package/src/anyspend/react/components/common/Warning.tsx +0 -7
- package/src/anyspend/react/hooks/useSigMint.tsx +0 -55
- package/src/anyspend/types/metadata.ts +0 -41
- package/src/anyspend/types/signature-mint.ts +0 -77
- package/src/global-account/react/components/SignInWithB3/SignIn.tsx +0 -190
- package/src/global-account/react/components/custom/Icon.tsx +0 -102
- package/src/global-account/react/components/custom/ManageAccountButton.tsx +0 -33
- package/src/shared/react/hooks/index.ts +0 -1
- package/src/shared/react/hooks/useNavigation.ts +0 -61
- package/src/shared/react/index.ts +0 -1
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { getDefaultToken, OrderType, Token, TradeType, USDC_BASE } from "@b3dotfun/sdk/anyspend";
|
|
4
3
|
import {
|
|
4
|
+
getDefaultToken,
|
|
5
|
+
OrderType,
|
|
6
|
+
Token,
|
|
7
|
+
TradeType,
|
|
8
|
+
USDC_BASE,
|
|
5
9
|
useAnyspendCreateOrder,
|
|
6
10
|
useAnyspendOrderAndTransactions,
|
|
7
|
-
useAnyspendQuote
|
|
8
|
-
} from "@b3dotfun/sdk/anyspend
|
|
11
|
+
useAnyspendQuote
|
|
12
|
+
} from "@b3dotfun/sdk/anyspend";
|
|
9
13
|
import {
|
|
10
14
|
Button,
|
|
11
15
|
ShinyButton,
|
|
@@ -16,7 +20,7 @@ import {
|
|
|
16
20
|
useRouter,
|
|
17
21
|
useSearchParamsSSR,
|
|
18
22
|
useTokenData,
|
|
19
|
-
useTokenFromUrl
|
|
23
|
+
useTokenFromUrl
|
|
20
24
|
} from "@b3dotfun/sdk/global-account/react";
|
|
21
25
|
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
22
26
|
import { shortenAddress } from "@b3dotfun/sdk/shared/utils/formatAddress";
|
|
@@ -27,7 +31,7 @@ import { ArrowDown, ChevronRightCircle, ChevronsUpDown, CircleAlert, ClipboardIc
|
|
|
27
31
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
28
32
|
import { toast } from "sonner";
|
|
29
33
|
import { parseUnits } from "viem";
|
|
30
|
-
import {
|
|
34
|
+
import { b3Sepolia, base, mainnet, sepolia } from "viem/chains";
|
|
31
35
|
import { OrderDetails, OrderDetailsLoadingView } from "./common/OrderDetails";
|
|
32
36
|
import { OrderHistory } from "./common/OrderHistory";
|
|
33
37
|
import { OrderStatus } from "./common/OrderStatus";
|
|
@@ -35,7 +39,6 @@ import { OrderTokenAmount } from "./common/OrderTokenAmount";
|
|
|
35
39
|
import { PanelOnramp } from "./common/PanelOnramp";
|
|
36
40
|
import { PanelOnrampPayment } from "./common/PanelOnrampPayment";
|
|
37
41
|
import { TokenBalance } from "./common/TokenBalance";
|
|
38
|
-
import { Warning } from "./common/Warning";
|
|
39
42
|
import { EnterRecipientModal } from "./modals/EnterRecipientModal";
|
|
40
43
|
|
|
41
44
|
export interface RecipientOption {
|
|
@@ -50,7 +53,7 @@ export enum PanelView {
|
|
|
50
53
|
HISTORY,
|
|
51
54
|
ORDER_DETAILS,
|
|
52
55
|
LOADING,
|
|
53
|
-
FIAT_PAYMENT
|
|
56
|
+
FIAT_PAYMENT
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
const ANYSPEND_RECIPIENTS_KEY = "anyspend_recipients";
|
|
@@ -63,7 +66,7 @@ export function AnySpend({
|
|
|
63
66
|
defaultActiveTab = "crypto",
|
|
64
67
|
loadOrder,
|
|
65
68
|
hideTransactionHistoryButton,
|
|
66
|
-
recipientAddress: recipientAddressFromProps
|
|
69
|
+
recipientAddress: recipientAddressFromProps
|
|
67
70
|
}: {
|
|
68
71
|
destinationTokenAddress?: string;
|
|
69
72
|
destinationTokenChainId?: number;
|
|
@@ -103,7 +106,7 @@ export function AnySpend({
|
|
|
103
106
|
const [orderId, setOrderId] = useState<string | undefined>(loadOrder);
|
|
104
107
|
const { orderAndTransactions: oat, getOrderAndTransactionsError } = useAnyspendOrderAndTransactions(
|
|
105
108
|
isMainnet,
|
|
106
|
-
orderId
|
|
109
|
+
orderId
|
|
107
110
|
);
|
|
108
111
|
!!getOrderAndTransactionsError && console.log("getOrderAndTransactionsError", getOrderAndTransactionsError);
|
|
109
112
|
|
|
@@ -123,7 +126,7 @@ export function AnySpend({
|
|
|
123
126
|
const defaultSrcToken = getDefaultToken(selectedSrcChainId);
|
|
124
127
|
const srcTokenFromUrl = useTokenFromUrl({
|
|
125
128
|
defaultToken: defaultSrcToken,
|
|
126
|
-
prefix: "from"
|
|
129
|
+
prefix: "from"
|
|
127
130
|
});
|
|
128
131
|
const [selectedSrcToken, setSelectedSrcToken] = useState<Token>(srcTokenFromUrl);
|
|
129
132
|
const { data: srcTokenMetadata } = useTokenData(selectedSrcToken?.chainId, selectedSrcToken?.address);
|
|
@@ -141,12 +144,12 @@ export function AnySpend({
|
|
|
141
144
|
address: destinationTokenAddress,
|
|
142
145
|
name: "",
|
|
143
146
|
decimals: 18,
|
|
144
|
-
metadata: {}
|
|
147
|
+
metadata: {}
|
|
145
148
|
}
|
|
146
149
|
: getDefaultToken(selectedDstChainId);
|
|
147
150
|
const dstTokenFromUrl = useTokenFromUrl({
|
|
148
151
|
defaultToken: defaultDstToken,
|
|
149
|
-
prefix: "to"
|
|
152
|
+
prefix: "to"
|
|
150
153
|
});
|
|
151
154
|
const [selectedDstToken, setSelectedDstToken] = useState<Token>(isBuyMode ? defaultDstToken : dstTokenFromUrl);
|
|
152
155
|
const { data: dstTokenMetadata } = useTokenData(selectedDstToken?.chainId, selectedDstToken?.address);
|
|
@@ -170,8 +173,8 @@ export function AnySpend({
|
|
|
170
173
|
name: srcTokenMetadata.name || selectedSrcToken.name,
|
|
171
174
|
metadata: {
|
|
172
175
|
...selectedSrcToken.metadata,
|
|
173
|
-
logoURI: srcTokenMetadata?.logoURI || selectedSrcToken.metadata.logoURI
|
|
174
|
-
}
|
|
176
|
+
logoURI: srcTokenMetadata?.logoURI || selectedSrcToken.metadata.logoURI
|
|
177
|
+
}
|
|
175
178
|
};
|
|
176
179
|
|
|
177
180
|
setSelectedSrcToken(enhancedToken);
|
|
@@ -196,8 +199,8 @@ export function AnySpend({
|
|
|
196
199
|
name: dstTokenMetadata.name || selectedDstToken.name,
|
|
197
200
|
metadata: {
|
|
198
201
|
...selectedDstToken.metadata,
|
|
199
|
-
logoURI: dstTokenMetadata?.logoURI || selectedDstToken.metadata.logoURI
|
|
200
|
-
}
|
|
202
|
+
logoURI: dstTokenMetadata?.logoURI || selectedDstToken.metadata.logoURI
|
|
203
|
+
}
|
|
201
204
|
};
|
|
202
205
|
|
|
203
206
|
setSelectedDstToken(enhancedToken);
|
|
@@ -270,7 +273,7 @@ export function AnySpend({
|
|
|
270
273
|
fromAmount: activeTab === "crypto" ? srcAmount : undefined,
|
|
271
274
|
toChainId: selectedDstChainId.toString(),
|
|
272
275
|
toCurrency: selectedDstToken.address,
|
|
273
|
-
toAmount: dstAmount
|
|
276
|
+
toAmount: dstAmount
|
|
274
277
|
};
|
|
275
278
|
|
|
276
279
|
// Compare with last update to prevent unnecessary URL changes
|
|
@@ -328,7 +331,7 @@ export function AnySpend({
|
|
|
328
331
|
selectedDstToken.address,
|
|
329
332
|
dstAmount,
|
|
330
333
|
router,
|
|
331
|
-
srcAmountOnRamp
|
|
334
|
+
srcAmountOnRamp
|
|
332
335
|
]);
|
|
333
336
|
|
|
334
337
|
// Update URL when relevant state changes - but only after initial render
|
|
@@ -343,7 +346,7 @@ export function AnySpend({
|
|
|
343
346
|
selectedSrcToken.address,
|
|
344
347
|
selectedDstChainId,
|
|
345
348
|
selectedDstToken.address,
|
|
346
|
-
updateSwapParamsInURL
|
|
349
|
+
updateSwapParamsInURL
|
|
347
350
|
]);
|
|
348
351
|
|
|
349
352
|
// Use our hook for ENS resolution
|
|
@@ -390,7 +393,7 @@ export function AnySpend({
|
|
|
390
393
|
dstTokenAddress: isBuyMode ? destinationTokenAddress : selectedDstToken.address,
|
|
391
394
|
type: OrderType.Swap,
|
|
392
395
|
tradeType: isSrcInputDirty ? TradeType.EXACT_INPUT : TradeType.EXPECTED_OUTPUT,
|
|
393
|
-
amount: activeInputAmountInWei
|
|
396
|
+
amount: activeInputAmountInWei
|
|
394
397
|
}
|
|
395
398
|
: {
|
|
396
399
|
srcChain: base.id,
|
|
@@ -399,8 +402,8 @@ export function AnySpend({
|
|
|
399
402
|
dstTokenAddress: isBuyMode ? destinationTokenAddress : selectedDstToken.address,
|
|
400
403
|
type: OrderType.Swap,
|
|
401
404
|
tradeType: TradeType.EXACT_INPUT,
|
|
402
|
-
amount: srcAmountOnrampInWei
|
|
403
|
-
}
|
|
405
|
+
amount: srcAmountOnrampInWei
|
|
406
|
+
}
|
|
404
407
|
);
|
|
405
408
|
|
|
406
409
|
// Replace the old ENS lookup with our new hooks
|
|
@@ -598,7 +601,7 @@ export function AnySpend({
|
|
|
598
601
|
onError: error => {
|
|
599
602
|
console.error(error);
|
|
600
603
|
toast.error("Failed to create order: " + error.message);
|
|
601
|
-
}
|
|
604
|
+
}
|
|
602
605
|
});
|
|
603
606
|
|
|
604
607
|
// Determine button state and text
|
|
@@ -618,7 +621,7 @@ export function AnySpend({
|
|
|
618
621
|
anyspendQuote,
|
|
619
622
|
activeTab,
|
|
620
623
|
isBuyMode,
|
|
621
|
-
selectedDstToken.symbol
|
|
624
|
+
selectedDstToken.symbol
|
|
622
625
|
]);
|
|
623
626
|
|
|
624
627
|
// Handle main button click
|
|
@@ -653,7 +656,7 @@ export function AnySpend({
|
|
|
653
656
|
: selectedDstToken,
|
|
654
657
|
srcAmount: srcAmountBigInt.toString(),
|
|
655
658
|
expectedDstAmount: anyspendQuote?.data?.currencyOut?.amount || "0",
|
|
656
|
-
creatorAddress: globalAddress
|
|
659
|
+
creatorAddress: globalAddress
|
|
657
660
|
});
|
|
658
661
|
} catch (err: any) {
|
|
659
662
|
console.error(err);
|
|
@@ -732,7 +735,7 @@ export function AnySpend({
|
|
|
732
735
|
|
|
733
736
|
return {
|
|
734
737
|
percentage: Math.abs(percentageValue).toFixed(2),
|
|
735
|
-
isNegative: percentageValue < 0
|
|
738
|
+
isNegative: percentageValue < 0
|
|
736
739
|
};
|
|
737
740
|
};
|
|
738
741
|
|
|
@@ -797,14 +800,14 @@ export function AnySpend({
|
|
|
797
800
|
className={cn(
|
|
798
801
|
"bg-as-brand absolute bottom-0 left-0 top-0 z-0 rounded-xl transition-transform duration-100",
|
|
799
802
|
"h-full w-1/2",
|
|
800
|
-
activeTab === "fiat" ? "translate-x-full" : "translate-x-0"
|
|
803
|
+
activeTab === "fiat" ? "translate-x-full" : "translate-x-0"
|
|
801
804
|
)}
|
|
802
805
|
style={{ willChange: "transform" }}
|
|
803
806
|
/>
|
|
804
807
|
<button
|
|
805
808
|
className={cn(
|
|
806
809
|
"relative z-10 h-full w-full rounded-xl px-6 text-sm font-medium transition-colors duration-100",
|
|
807
|
-
activeTab === "crypto" ? "text-white" : "text-as-primary/70 hover:bg-as-on-surface-2 bg-transparent"
|
|
810
|
+
activeTab === "crypto" ? "text-white" : "text-as-primary/70 hover:bg-as-on-surface-2 bg-transparent"
|
|
808
811
|
)}
|
|
809
812
|
onClick={() => setActiveTab("crypto")}
|
|
810
813
|
>
|
|
@@ -813,7 +816,7 @@ export function AnySpend({
|
|
|
813
816
|
<button
|
|
814
817
|
className={cn(
|
|
815
818
|
"relative z-10 h-full w-full rounded-xl px-6 text-sm font-medium transition-colors duration-100",
|
|
816
|
-
activeTab === "fiat" ? "text-white" : "text-as-primary/70 hover:bg-as-on-surface-2 bg-transparent"
|
|
819
|
+
activeTab === "fiat" ? "text-white" : "text-as-primary/70 hover:bg-as-on-surface-2 bg-transparent"
|
|
817
820
|
)}
|
|
818
821
|
onClick={() => setActiveTab("fiat")}
|
|
819
822
|
>
|
|
@@ -821,14 +824,6 @@ export function AnySpend({
|
|
|
821
824
|
</button>
|
|
822
825
|
</div>
|
|
823
826
|
|
|
824
|
-
{/* {selectedSrcChainId === base.id || selectedDstChainId === base.id || activeTab === "fiat" ? (
|
|
825
|
-
<>
|
|
826
|
-
<Warning text="Base is experiencing temporary issues. Please check back later." />
|
|
827
|
-
|
|
828
|
-
<div className="h-1" />
|
|
829
|
-
</>
|
|
830
|
-
) : null} */}
|
|
831
|
-
|
|
832
827
|
<div className="relative flex max-w-[calc(100vw-32px)] flex-col gap-2">
|
|
833
828
|
{/* Send section */}
|
|
834
829
|
{activeTab === "crypto" ? (
|
|
@@ -881,7 +876,7 @@ export function AnySpend({
|
|
|
881
876
|
variant="ghost"
|
|
882
877
|
className={cn(
|
|
883
878
|
"bg-as-n-8 border-as-stroke absolute left-1/2 top-1/2 z-10 h-10 w-10 -translate-x-1/2 -translate-y-1/2 rounded-2xl border-2 sm:h-8 sm:w-8 sm:rounded-xl",
|
|
884
|
-
(activeTab === "fiat" || isBuyMode) && "top-[calc(50%+56px)] cursor-default"
|
|
879
|
+
(activeTab === "fiat" || isBuyMode) && "top-[calc(50%+56px)] cursor-default"
|
|
885
880
|
)}
|
|
886
881
|
onClick={() => {
|
|
887
882
|
if (activeTab === "fiat" || isBuyMode) {
|
|
@@ -927,7 +922,7 @@ export function AnySpend({
|
|
|
927
922
|
"text-as-primary/50 flex h-7 items-center gap-1 rounded-lg px-2",
|
|
928
923
|
globalAddress && recipientAddress === globalAddress
|
|
929
924
|
? "bg-as-on-surface-2 hover:bg-as-on-surface-3"
|
|
930
|
-
: "bg-as-yellow/70 hover:bg-as-yellow text-as-primary"
|
|
925
|
+
: "bg-as-yellow/70 hover:bg-as-yellow text-as-primary"
|
|
931
926
|
)}
|
|
932
927
|
onClick={() => setIsOpenPasteRecipientAddressModal(true)}
|
|
933
928
|
>
|
|
@@ -991,7 +986,7 @@ export function AnySpend({
|
|
|
991
986
|
(() => {
|
|
992
987
|
const { percentage, isNegative } = calculatePriceImpact(
|
|
993
988
|
anyspendQuote.data.currencyIn.amountUsd,
|
|
994
|
-
anyspendQuote.data.currencyOut.amountUsd
|
|
989
|
+
anyspendQuote.data.currencyOut.amountUsd
|
|
995
990
|
);
|
|
996
991
|
|
|
997
992
|
// Parse the percentage as a number for comparison
|
|
@@ -1056,7 +1051,7 @@ export function AnySpend({
|
|
|
1056
1051
|
onClick={onMainButtonClick}
|
|
1057
1052
|
className={cn(
|
|
1058
1053
|
"relative w-full",
|
|
1059
|
-
btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"
|
|
1054
|
+
btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"
|
|
1060
1055
|
)}
|
|
1061
1056
|
textClassName={cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white")}
|
|
1062
1057
|
>
|
|
@@ -1124,12 +1119,12 @@ export function AnySpend({
|
|
|
1124
1119
|
: activePanel
|
|
1125
1120
|
}
|
|
1126
1121
|
className={cn("w-full", {
|
|
1127
|
-
"mt-0": mode === "modal"
|
|
1122
|
+
"mt-0": mode === "modal"
|
|
1128
1123
|
})}
|
|
1129
1124
|
variants={{
|
|
1130
1125
|
enter: { x: 300, opacity: 0 },
|
|
1131
1126
|
center: { x: 0, opacity: 1 },
|
|
1132
|
-
exit: { x: -300, opacity: 0 }
|
|
1127
|
+
exit: { x: -300, opacity: 0 }
|
|
1133
1128
|
}}
|
|
1134
1129
|
transition={{ type: "spring", stiffness: 300, damping: 30 }}
|
|
1135
1130
|
>
|
|
@@ -1138,7 +1133,7 @@ export function AnySpend({
|
|
|
1138
1133
|
<div key="history-view">{historyView}</div>,
|
|
1139
1134
|
<div key="order-details-view">{orderDetailsView}</div>,
|
|
1140
1135
|
<div key="loading-view">{OrderDetailsLoadingView}</div>,
|
|
1141
|
-
<div key="fiat-payment-view">{onrampPaymentView}</div
|
|
1136
|
+
<div key="fiat-payment-view">{onrampPaymentView}</div>
|
|
1142
1137
|
]}
|
|
1143
1138
|
</TransitionPanel>
|
|
1144
1139
|
<EnterRecipientModal
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { B3_TOKEN, OrderType } from "@b3dotfun/sdk/anyspend";
|
|
2
|
+
import { baseMainnet } from "@b3dotfun/sdk/shared/constants/chains/supported";
|
|
3
|
+
import { EthIcon } from "./icons/EthIcon";
|
|
4
|
+
import { SolIcon } from "./icons/SolIcon";
|
|
5
|
+
import { UsdcIcon } from "./icons/USDCIcon";
|
|
6
|
+
import { StyleRoot } from "@b3dotfun/sdk/global-account/react";
|
|
2
7
|
import {
|
|
3
8
|
Button,
|
|
4
9
|
GlareCardRounded,
|
|
5
10
|
Input,
|
|
6
|
-
StyleRoot,
|
|
7
11
|
TextLoop,
|
|
8
12
|
useChainSwitchWithAction,
|
|
9
13
|
useHasMounted,
|
|
10
|
-
useModalStore,
|
|
11
14
|
useTokenBalance,
|
|
15
|
+
useModalStore
|
|
12
16
|
} from "@b3dotfun/sdk/global-account/react";
|
|
13
|
-
import { baseMainnet } from "@b3dotfun/sdk/shared/constants/chains/supported";
|
|
14
17
|
import { motion } from "framer-motion";
|
|
15
18
|
import invariant from "invariant";
|
|
16
19
|
import { ArrowRight, Loader2 } from "lucide-react";
|
|
@@ -19,9 +22,6 @@ import { toast } from "sonner";
|
|
|
19
22
|
import { createPublicClient, encodeFunctionData, erc20Abi, formatUnits, http } from "viem";
|
|
20
23
|
import { useAccount, useWaitForTransactionReceipt, useWriteContract } from "wagmi";
|
|
21
24
|
import { AnySpendCustom } from "./AnySpendCustom";
|
|
22
|
-
import { EthIcon } from "./icons/EthIcon";
|
|
23
|
-
import { SolIcon } from "./icons/SolIcon";
|
|
24
|
-
import { UsdcIcon } from "./icons/USDCIcon";
|
|
25
25
|
|
|
26
26
|
const SPIN_WHEEL_ABI = [
|
|
27
27
|
{
|
|
@@ -31,27 +31,27 @@ const SPIN_WHEEL_ABI = [
|
|
|
31
31
|
{ internalType: "address", name: "paymentToken", type: "address" },
|
|
32
32
|
{ internalType: "uint256", name: "pricePerEntry", type: "uint256" },
|
|
33
33
|
{ internalType: "uint256", name: "maxEntriesPerUser", type: "uint256" },
|
|
34
|
-
{ internalType: "address", name: "paymentRecipient", type: "address" }
|
|
34
|
+
{ internalType: "address", name: "paymentRecipient", type: "address" }
|
|
35
35
|
],
|
|
36
36
|
stateMutability: "view",
|
|
37
|
-
type: "function"
|
|
37
|
+
type: "function"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
inputs: [],
|
|
41
41
|
name: "entryModule",
|
|
42
42
|
outputs: [{ internalType: "contract IEntryModuleV2", name: "", type: "address" }],
|
|
43
43
|
stateMutability: "view",
|
|
44
|
-
type: "function"
|
|
44
|
+
type: "function"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
inputs: [
|
|
48
48
|
{ internalType: "address", name: "user", type: "address" },
|
|
49
|
-
{ internalType: "uint256", name: "quantity", type: "uint256" }
|
|
49
|
+
{ internalType: "uint256", name: "quantity", type: "uint256" }
|
|
50
50
|
],
|
|
51
51
|
name: "buyEntriesAndSpin",
|
|
52
52
|
outputs: [],
|
|
53
53
|
stateMutability: "payable",
|
|
54
|
-
type: "function"
|
|
54
|
+
type: "function"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
inputs: [],
|
|
@@ -62,11 +62,11 @@ const SPIN_WHEEL_ABI = [
|
|
|
62
62
|
{ internalType: "uint256", name: "endTime_", type: "uint256" },
|
|
63
63
|
{ internalType: "uint256", name: "totalPrizesAvailable_", type: "uint256" },
|
|
64
64
|
{ internalType: "uint256", name: "prizesRequestedCount_", type: "uint256" },
|
|
65
|
-
{ internalType: "enum SpinWheelV2.WheelState", name: "state_", type: "uint8" }
|
|
65
|
+
{ internalType: "enum SpinWheelV2.WheelState", name: "state_", type: "uint8" }
|
|
66
66
|
],
|
|
67
67
|
stateMutability: "view",
|
|
68
|
-
type: "function"
|
|
69
|
-
}
|
|
68
|
+
type: "function"
|
|
69
|
+
}
|
|
70
70
|
] as const;
|
|
71
71
|
|
|
72
72
|
interface PaymentConfig {
|
|
@@ -113,14 +113,14 @@ function generateEncodedDataForBuyEntriesAndSpin(user: string, quantity: string)
|
|
|
113
113
|
const encodedData = encodeFunctionData({
|
|
114
114
|
abi: SPIN_WHEEL_ABI,
|
|
115
115
|
functionName: "buyEntriesAndSpin",
|
|
116
|
-
args: [user as `0x${string}`, BigInt(quantity)]
|
|
116
|
+
args: [user as `0x${string}`, BigInt(quantity)]
|
|
117
117
|
});
|
|
118
118
|
return encodedData;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
const basePublicClient = createPublicClient({
|
|
122
122
|
chain: baseMainnet,
|
|
123
|
-
transport: http()
|
|
123
|
+
transport: http()
|
|
124
124
|
});
|
|
125
125
|
|
|
126
126
|
export function AnySpendBuySpin({
|
|
@@ -131,7 +131,7 @@ export function AnySpendBuySpin({
|
|
|
131
131
|
chainId,
|
|
132
132
|
recipientAddress,
|
|
133
133
|
prefillQuantity,
|
|
134
|
-
onSuccess
|
|
134
|
+
onSuccess
|
|
135
135
|
}: {
|
|
136
136
|
isMainnet?: boolean;
|
|
137
137
|
loadOrder?: string;
|
|
@@ -155,9 +155,9 @@ export function AnySpendBuySpin({
|
|
|
155
155
|
const {
|
|
156
156
|
formattedBalance: b3Balance,
|
|
157
157
|
isLoading: isBalanceLoading,
|
|
158
|
-
rawBalance: b3RawBalance
|
|
158
|
+
rawBalance: b3RawBalance
|
|
159
159
|
} = useTokenBalance({
|
|
160
|
-
token: B3_TOKEN
|
|
160
|
+
token: B3_TOKEN
|
|
161
161
|
});
|
|
162
162
|
|
|
163
163
|
// Wagmi hooks
|
|
@@ -172,12 +172,12 @@ export function AnySpendBuySpin({
|
|
|
172
172
|
isLoading: isTxPending,
|
|
173
173
|
isSuccess: isTxSuccess,
|
|
174
174
|
isError: isTxError,
|
|
175
|
-
error: txError
|
|
175
|
+
error: txError
|
|
176
176
|
} = useWaitForTransactionReceipt({
|
|
177
177
|
hash: buyingTxHash as `0x${string}`,
|
|
178
178
|
query: {
|
|
179
|
-
structuralSharing: false
|
|
180
|
-
}
|
|
179
|
+
structuralSharing: false
|
|
180
|
+
}
|
|
181
181
|
});
|
|
182
182
|
|
|
183
183
|
// Handle transaction status
|
|
@@ -232,25 +232,25 @@ export function AnySpendBuySpin({
|
|
|
232
232
|
basePublicClient.readContract({
|
|
233
233
|
address: spinwheelContractAddress as `0x${string}`,
|
|
234
234
|
abi: SPIN_WHEEL_ABI,
|
|
235
|
-
functionName: "getPaymentConfig"
|
|
235
|
+
functionName: "getPaymentConfig"
|
|
236
236
|
}),
|
|
237
237
|
basePublicClient.readContract({
|
|
238
238
|
address: spinwheelContractAddress as `0x${string}`,
|
|
239
239
|
abi: SPIN_WHEEL_ABI,
|
|
240
|
-
functionName: "entryModule"
|
|
240
|
+
functionName: "entryModule"
|
|
241
241
|
}),
|
|
242
242
|
basePublicClient.readContract({
|
|
243
243
|
address: spinwheelContractAddress as `0x${string}`,
|
|
244
244
|
abi: SPIN_WHEEL_ABI,
|
|
245
|
-
functionName: "getWheelInfo"
|
|
246
|
-
})
|
|
245
|
+
functionName: "getWheelInfo"
|
|
246
|
+
})
|
|
247
247
|
]);
|
|
248
248
|
|
|
249
249
|
const paymentConfig: PaymentConfig = {
|
|
250
250
|
pricePerEntry: config[1],
|
|
251
251
|
maxEntriesPerUser: config[2],
|
|
252
252
|
paymentRecipient: config[3],
|
|
253
|
-
entryModule: entryModuleAddress
|
|
253
|
+
entryModule: entryModuleAddress
|
|
254
254
|
};
|
|
255
255
|
|
|
256
256
|
const wheelInfoData: WheelInfo = {
|
|
@@ -259,7 +259,7 @@ export function AnySpendBuySpin({
|
|
|
259
259
|
endTime_: wheelInfo[2],
|
|
260
260
|
totalPrizesAvailable_: wheelInfo[3],
|
|
261
261
|
prizesRequestedCount_: wheelInfo[4],
|
|
262
|
-
state_: wheelInfo[5]
|
|
262
|
+
state_: wheelInfo[5]
|
|
263
263
|
};
|
|
264
264
|
|
|
265
265
|
setPaymentConfig(paymentConfig);
|
|
@@ -315,11 +315,7 @@ export function AnySpendBuySpin({
|
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
// Check maximum entries per user (0 means no limit)
|
|
318
|
-
if (
|
|
319
|
-
paymentConfig &&
|
|
320
|
-
paymentConfig.maxEntriesPerUser > BigInt(0) &&
|
|
321
|
-
BigInt(numValue) > paymentConfig.maxEntriesPerUser
|
|
322
|
-
) {
|
|
318
|
+
if (paymentConfig && paymentConfig.maxEntriesPerUser > 0n && BigInt(numValue) > paymentConfig.maxEntriesPerUser) {
|
|
323
319
|
setIsQuantityValid(false);
|
|
324
320
|
setUserSpinQuantity("");
|
|
325
321
|
setValidationError(`Maximum ${paymentConfig.maxEntriesPerUser.toString()} spins allowed`);
|
|
@@ -331,7 +327,7 @@ export function AnySpendBuySpin({
|
|
|
331
327
|
setIsQuantityValid(false);
|
|
332
328
|
setUserSpinQuantity("");
|
|
333
329
|
setValidationError(
|
|
334
|
-
`Only ${(wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_).toString()} spins remaining
|
|
330
|
+
`Only ${(wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_).toString()} spins remaining`
|
|
335
331
|
);
|
|
336
332
|
return;
|
|
337
333
|
}
|
|
@@ -358,7 +354,7 @@ export function AnySpendBuySpin({
|
|
|
358
354
|
address: B3_TOKEN.address as `0x${string}`,
|
|
359
355
|
abi: erc20Abi,
|
|
360
356
|
functionName: "allowance",
|
|
361
|
-
args: [address, paymentConfig.entryModule as `0x${string}`]
|
|
357
|
+
args: [address, paymentConfig.entryModule as `0x${string}`]
|
|
362
358
|
});
|
|
363
359
|
|
|
364
360
|
// If allowance is insufficient, request approval
|
|
@@ -369,7 +365,7 @@ export function AnySpendBuySpin({
|
|
|
369
365
|
address: B3_TOKEN.address as `0x${string}`,
|
|
370
366
|
abi: erc20Abi,
|
|
371
367
|
functionName: "approve",
|
|
372
|
-
args: [paymentConfig.entryModule as `0x${string}`, totalCost]
|
|
368
|
+
args: [paymentConfig.entryModule as `0x${string}`, totalCost]
|
|
373
369
|
});
|
|
374
370
|
|
|
375
371
|
toast.info("Approval confirmed. Proceeding with spin purchase...");
|
|
@@ -381,7 +377,7 @@ export function AnySpendBuySpin({
|
|
|
381
377
|
address: spinwheelContractAddress as `0x${string}`,
|
|
382
378
|
abi: SPIN_WHEEL_ABI,
|
|
383
379
|
functionName: "buyEntriesAndSpin",
|
|
384
|
-
args: [address, BigInt(userSpinQuantity)]
|
|
380
|
+
args: [address, BigInt(userSpinQuantity)]
|
|
385
381
|
});
|
|
386
382
|
|
|
387
383
|
setBuyingTxHash(buyHash);
|
|
@@ -469,7 +465,7 @@ export function AnySpendBuySpin({
|
|
|
469
465
|
// Render quantity input prompt
|
|
470
466
|
if (showAmountPrompt) {
|
|
471
467
|
const pricePerEntry = formatUnits(paymentConfig.pricePerEntry, 18);
|
|
472
|
-
const remainingEntries = wheelInfo ? wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_ :
|
|
468
|
+
const remainingEntries = wheelInfo ? wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_ : 0n;
|
|
473
469
|
const wheelStatus = wheelInfo ? getWheelStatus(wheelInfo) : null;
|
|
474
470
|
const isSoldOut = wheelStatus === "sold_out";
|
|
475
471
|
const isActive = wheelStatus === "active";
|
|
@@ -485,17 +481,17 @@ export function AnySpendBuySpin({
|
|
|
485
481
|
case "not_started":
|
|
486
482
|
return {
|
|
487
483
|
title: "Spin Wheel Not Started",
|
|
488
|
-
message: `Starts at ${formatDate(wheelInfo.startTime_)}
|
|
484
|
+
message: `Starts at ${formatDate(wheelInfo.startTime_)}`
|
|
489
485
|
};
|
|
490
486
|
case "ended":
|
|
491
487
|
return {
|
|
492
488
|
title: "Spin Wheel Ended",
|
|
493
|
-
message: `Ended at ${formatDate(wheelInfo.endTime_)}
|
|
489
|
+
message: `Ended at ${formatDate(wheelInfo.endTime_)}`
|
|
494
490
|
};
|
|
495
491
|
case "sold_out":
|
|
496
492
|
return {
|
|
497
493
|
title: "All Spins Have Been Claimed",
|
|
498
|
-
message: "Stay tuned for the next spin wheel event!"
|
|
494
|
+
message: "Stay tuned for the next spin wheel event!"
|
|
499
495
|
};
|
|
500
496
|
default:
|
|
501
497
|
return null;
|
|
@@ -513,7 +509,7 @@ export function AnySpendBuySpin({
|
|
|
513
509
|
animate={{
|
|
514
510
|
opacity: hasMounted ? 1 : 0,
|
|
515
511
|
y: hasMounted ? 0 : 20,
|
|
516
|
-
filter: hasMounted ? "blur(0px)" : "blur(10px)"
|
|
512
|
+
filter: hasMounted ? "blur(0px)" : "blur(10px)"
|
|
517
513
|
}}
|
|
518
514
|
transition={{ duration: 0.3, delay: 0, ease: "easeInOut" }}
|
|
519
515
|
className={`flex justify-center ${isActive ? "mb-4" : ""}`}
|
|
@@ -533,7 +529,7 @@ export function AnySpendBuySpin({
|
|
|
533
529
|
animate={{
|
|
534
530
|
opacity: hasMounted ? 1 : 0,
|
|
535
531
|
y: hasMounted ? 0 : 20,
|
|
536
|
-
filter: hasMounted ? "blur(0px)" : "blur(10px)"
|
|
532
|
+
filter: hasMounted ? "blur(0px)" : "blur(10px)"
|
|
537
533
|
}}
|
|
538
534
|
transition={{ duration: 0.3, delay: 0.1, ease: "easeInOut" }}
|
|
539
535
|
className="text-center"
|
|
@@ -573,7 +569,7 @@ export function AnySpendBuySpin({
|
|
|
573
569
|
animate={{
|
|
574
570
|
opacity: hasMounted ? 1 : 0,
|
|
575
571
|
y: hasMounted ? 0 : 20,
|
|
576
|
-
filter: hasMounted ? "blur(0px)" : "blur(10px)"
|
|
572
|
+
filter: hasMounted ? "blur(0px)" : "blur(10px)"
|
|
577
573
|
}}
|
|
578
574
|
transition={{ duration: 0.3, delay: 0.2, ease: "easeInOut" }}
|
|
579
575
|
className="bg-b3-react-background w-full p-6"
|
|
@@ -672,8 +668,7 @@ export function AnySpendBuySpin({
|
|
|
672
668
|
spenderAddress={paymentConfig.entryModule}
|
|
673
669
|
encodedData={encodedData}
|
|
674
670
|
metadata={{
|
|
675
|
-
|
|
676
|
-
action: `buy ${userSpinQuantity} spin${userSpinQuantity !== "1" ? "s" : ""}`,
|
|
671
|
+
action: `buy ${userSpinQuantity} spin${userSpinQuantity !== "1" ? "s" : ""}`
|
|
677
672
|
}}
|
|
678
673
|
header={header}
|
|
679
674
|
onSuccess={txHash => onSuccess?.(txHash)}
|