@b3dotfun/sdk 0.0.7 → 0.0.8-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/abis/{abi-usdc-base.js → abiUsdcBase.js} +97 -97
- package/dist/cjs/anyspend/abis/bondKit.d.ts +35 -0
- package/dist/cjs/anyspend/abis/bondKit.js +29 -0
- package/dist/cjs/anyspend/abis/{erc20-staking.js → erc20Staking.js} +51 -51
- package/dist/cjs/anyspend/abis/signatureMinting.d.ts +79 -0
- package/dist/cjs/anyspend/abis/signatureMinting.js +45 -0
- package/dist/cjs/anyspend/constants/index.js +13 -10
- package/dist/cjs/anyspend/index.d.ts +6 -4
- package/dist/cjs/anyspend/index.js +6 -6
- package/dist/cjs/anyspend/index.native.d.ts +2 -2
- package/dist/cjs/anyspend/index.native.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpend.js +69 -68
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +184 -0
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +68 -70
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +4 -4
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +159 -102
- package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +3 -2
- package/dist/cjs/anyspend/react/components/AnySpendNFT.js +7 -5
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +21 -20
- package/dist/cjs/anyspend/react/components/AnySpendTournament.js +7 -4
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.d.ts +8 -0
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +81 -0
- package/dist/cjs/anyspend/react/components/{AnySpendNFTButton.d.ts → common/AnySpendNFTButton.d.ts} +1 -1
- package/dist/cjs/anyspend/react/components/{AnySpendNFTButton.js → common/AnySpendNFTButton.js} +3 -3
- 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 +52 -63
- 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 +15 -14
- 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 +26 -25
- 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/common/Warning.d.ts +3 -0
- package/dist/cjs/anyspend/react/components/common/Warning.js +7 -0
- package/dist/cjs/anyspend/react/components/index.d.ts +4 -1
- package/dist/cjs/anyspend/react/components/index.js +9 -3
- 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 +0 -1
- package/dist/cjs/anyspend/react/components/webview/WebviewOnrampPayment.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/webview/WebviewOnrampPayment.js +26 -25
- package/dist/cjs/anyspend/react/hooks/index.d.ts +1 -2
- package/dist/cjs/anyspend/react/hooks/index.js +1 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +3 -18
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +6 -6
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +1 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +6 -6
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +14 -70
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderAndTransactions.js +2 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +14 -70
- 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/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/useSigMint.d.ts +140 -0
- package/dist/cjs/anyspend/react/hooks/useSigMint.js +39 -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 +7 -6
- package/dist/cjs/anyspend/services/anyspend.d.ts +9 -40
- package/dist/cjs/anyspend/services/anyspend.js +11 -24
- package/dist/cjs/anyspend/types/bondKit.d.ts +12 -0
- package/dist/cjs/anyspend/types/bondKit.js +2 -0
- 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/metadata.d.ts +26 -0
- package/dist/cjs/anyspend/types/metadata.js +16 -0
- package/dist/cjs/anyspend/types/nft.d.ts +7 -0
- package/dist/cjs/anyspend/types/nft.js +8 -6
- package/dist/cjs/anyspend/types/onramp.d.ts +3 -0
- package/dist/cjs/anyspend/types/onramp.js +2 -1
- package/dist/cjs/anyspend/types/order.d.ts +40 -200
- package/dist/cjs/anyspend/types/order.js +7 -12
- package/dist/cjs/anyspend/types/req-res/createOrder.d.ts +98 -235
- 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 +63 -305
- 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 +49 -235
- package/dist/cjs/anyspend/types/req-res/getOrderHistory.js +1 -1
- package/dist/cjs/anyspend/types/req-res/getQuote.d.ts +37 -0
- package/dist/cjs/anyspend/types/req-res/getQuote.js +14 -9
- package/dist/cjs/anyspend/types/req-res/getTokenList.js +3 -3
- package/dist/cjs/anyspend/types/req-res/index.d.ts +0 -1
- package/dist/cjs/anyspend/types/req-res/index.js +0 -1
- package/dist/cjs/anyspend/types/signatureMint.d.ts +69 -0
- package/dist/cjs/anyspend/types/signatureMint.js +2 -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 +2 -6
- package/dist/cjs/anyspend/utils/orderPayload.d.ts +3 -3
- package/dist/cjs/anyspend/utils/orderPayload.js +22 -8
- 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 +17 -3
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +3 -3
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +17 -16
- 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/SignIn.d.ts +14 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +50 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3.d.ts +1 -2
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3.js +12 -17
- 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 +0 -1
- 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/Icon.d.ts +7 -0
- package/dist/cjs/global-account/react/components/custom/Icon.js +52 -0
- package/dist/cjs/global-account/react/components/custom/ManageAccountButton.d.ts +4 -0
- package/dist/cjs/global-account/react/components/custom/ManageAccountButton.js +20 -0
- 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 +8 -4
- package/dist/cjs/global-account/react/hooks/useB3EnsName.js +32 -23
- 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 +40 -1
- 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/index.d.ts +0 -0
- package/dist/cjs/index.js +2 -0
- 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 +4 -1
- package/dist/cjs/shared/constants/index.d.ts +1 -0
- package/dist/cjs/shared/constants/index.js +3 -2
- package/dist/cjs/shared/react/hooks/index.d.ts +1 -0
- package/dist/cjs/shared/react/hooks/index.js +17 -0
- package/dist/cjs/shared/react/hooks/useNavigation.d.ts +17 -0
- package/dist/cjs/shared/react/hooks/useNavigation.js +57 -0
- package/dist/cjs/shared/react/index.d.ts +1 -0
- package/dist/cjs/shared/react/index.js +17 -0
- package/dist/cjs/shared/thirdweb/generated/sdk.gen.d.ts +2 -2
- package/dist/cjs/shared/thirdweb/generated/sdk.gen.js +1 -1
- 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/formatUsername.d.ts +1 -0
- package/dist/cjs/shared/utils/formatUsername.js +8 -0
- package/dist/cjs/shared/utils/index.d.ts +3 -1
- package/dist/cjs/shared/utils/index.js +4 -6
- 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/cjs/shared/utils/truncateAddress.d.ts +6 -0
- package/dist/cjs/shared/utils/truncateAddress.js +16 -0
- package/dist/esm/anyspend/abis/{abi-usdc-base.js → abiUsdcBase.js} +97 -97
- package/dist/esm/anyspend/abis/bondKit.d.ts +35 -0
- package/dist/esm/anyspend/abis/bondKit.js +26 -0
- package/dist/esm/anyspend/abis/{erc20-staking.js → erc20Staking.js} +51 -51
- package/dist/esm/anyspend/abis/signatureMinting.d.ts +79 -0
- package/dist/esm/anyspend/abis/signatureMinting.js +42 -0
- package/dist/esm/anyspend/constants/index.js +13 -10
- package/dist/esm/anyspend/index.d.ts +6 -4
- package/dist/esm/anyspend/index.js +6 -6
- package/dist/esm/anyspend/index.native.d.ts +2 -2
- package/dist/esm/anyspend/index.native.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpend.js +23 -22
- package/dist/esm/anyspend/react/components/AnySpendBondKit.d.ts +2 -0
- package/dist/esm/anyspend/react/components/AnySpendBondKit.js +181 -0
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +41 -43
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +4 -4
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +139 -82
- package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +3 -2
- package/dist/esm/anyspend/react/components/AnySpendNFT.js +7 -5
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +22 -21
- package/dist/esm/anyspend/react/components/AnySpendTournament.js +7 -4
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.d.ts +8 -0
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +75 -0
- package/dist/esm/anyspend/react/components/{AnySpendNFTButton.d.ts → common/AnySpendNFTButton.d.ts} +1 -1
- package/dist/esm/anyspend/react/components/{AnySpendNFTButton.js → common/AnySpendNFTButton.js} +3 -3
- 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 +53 -64
- 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 +9 -8
- 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 +14 -13
- 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/common/Warning.d.ts +3 -0
- package/dist/esm/anyspend/react/components/common/Warning.js +4 -0
- package/dist/esm/anyspend/react/components/index.d.ts +4 -1
- package/dist/esm/anyspend/react/components/index.js +4 -1
- 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 +0 -1
- package/dist/esm/anyspend/react/components/webview/WebviewOnrampPayment.d.ts +1 -1
- package/dist/esm/anyspend/react/components/webview/WebviewOnrampPayment.js +16 -15
- package/dist/esm/anyspend/react/hooks/index.d.ts +1 -2
- package/dist/esm/anyspend/react/hooks/index.js +1 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +3 -18
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +6 -6
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +1 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +7 -7
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +14 -70
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.js +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +14 -70
- 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/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/useSigMint.d.ts +140 -0
- package/dist/esm/anyspend/react/hooks/useSigMint.js +33 -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 +5 -4
- package/dist/esm/anyspend/services/anyspend.d.ts +9 -40
- package/dist/esm/anyspend/services/anyspend.js +12 -25
- package/dist/esm/anyspend/types/bondKit.d.ts +12 -0
- package/dist/esm/anyspend/types/bondKit.js +1 -0
- 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/metadata.d.ts +26 -0
- package/dist/esm/anyspend/types/metadata.js +11 -0
- package/dist/esm/anyspend/types/nft.d.ts +7 -0
- package/dist/esm/anyspend/types/nft.js +8 -6
- package/dist/esm/anyspend/types/onramp.d.ts +3 -0
- package/dist/esm/anyspend/types/onramp.js +2 -1
- package/dist/esm/anyspend/types/order.d.ts +40 -200
- package/dist/esm/anyspend/types/order.js +7 -12
- package/dist/esm/anyspend/types/req-res/createOrder.d.ts +98 -235
- 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 +63 -305
- 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 +49 -235
- package/dist/esm/anyspend/types/req-res/getOrderHistory.js +1 -1
- package/dist/esm/anyspend/types/req-res/getQuote.d.ts +37 -0
- package/dist/esm/anyspend/types/req-res/getQuote.js +14 -9
- package/dist/esm/anyspend/types/req-res/getTokenList.js +3 -3
- package/dist/esm/anyspend/types/req-res/index.d.ts +0 -1
- package/dist/esm/anyspend/types/req-res/index.js +0 -1
- package/dist/esm/anyspend/types/signatureMint.d.ts +69 -0
- package/dist/esm/anyspend/types/signatureMint.js +1 -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 +2 -6
- package/dist/esm/anyspend/utils/orderPayload.d.ts +3 -3
- package/dist/esm/anyspend/utils/orderPayload.js +23 -9
- 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 +18 -4
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +3 -3
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +8 -7
- 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/SignIn.d.ts +14 -0
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +44 -0
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3.d.ts +1 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3.js +8 -13
- 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 +0 -1
- 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/Icon.d.ts +7 -0
- package/dist/esm/global-account/react/components/custom/Icon.js +50 -0
- package/dist/esm/global-account/react/components/custom/ManageAccountButton.d.ts +4 -0
- package/dist/esm/global-account/react/components/custom/ManageAccountButton.js +17 -0
- 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 +8 -4
- package/dist/esm/global-account/react/hooks/useB3EnsName.js +34 -22
- 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 +40 -1
- 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/index.d.ts +0 -0
- package/dist/esm/index.js +2 -0
- 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 +4 -1
- package/dist/esm/shared/constants/index.d.ts +1 -0
- package/dist/esm/shared/constants/index.js +2 -1
- package/dist/esm/shared/react/hooks/index.d.ts +1 -0
- package/dist/esm/shared/react/hooks/index.js +1 -0
- package/dist/esm/shared/react/hooks/useNavigation.d.ts +17 -0
- package/dist/esm/shared/react/hooks/useNavigation.js +52 -0
- package/dist/esm/shared/react/index.d.ts +1 -0
- package/dist/esm/shared/react/index.js +1 -0
- package/dist/esm/shared/thirdweb/generated/sdk.gen.d.ts +2 -2
- package/dist/esm/shared/thirdweb/generated/sdk.gen.js +1 -1
- 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/formatUsername.d.ts +1 -0
- package/dist/esm/shared/utils/formatUsername.js +5 -0
- package/dist/esm/shared/utils/index.d.ts +3 -1
- package/dist/esm/shared/utils/index.js +4 -5
- 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/esm/shared/utils/truncateAddress.d.ts +6 -0
- package/dist/esm/shared/utils/truncateAddress.js +12 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/abis/bondKit.d.ts +35 -0
- package/dist/types/anyspend/abis/signatureMinting.d.ts +79 -0
- package/dist/types/anyspend/index.d.ts +6 -4
- package/dist/types/anyspend/index.native.d.ts +2 -2
- package/dist/types/anyspend/react/components/AnySpend.d.ts +1 -1
- package/dist/types/anyspend/react/components/AnySpendBondKit.d.ts +2 -0
- 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 +3 -2
- package/dist/types/anyspend/react/components/AnySpendStakeB3.d.ts +1 -1
- package/dist/types/anyspend/react/components/AnyspendSignatureMint.d.ts +8 -0
- 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/common/Warning.d.ts +3 -0
- package/dist/types/anyspend/react/components/index.d.ts +4 -1
- 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 +1 -2
- package/dist/types/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +3 -18
- package/dist/types/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +14 -70
- package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +14 -70
- package/dist/types/anyspend/react/hooks/useSigMint.d.ts +140 -0
- package/dist/types/anyspend/services/anyspend.d.ts +9 -40
- package/dist/types/anyspend/types/bondKit.d.ts +12 -0
- package/dist/types/anyspend/types/index.d.ts +1 -1
- package/dist/types/anyspend/types/metadata.d.ts +26 -0
- package/dist/types/anyspend/types/nft.d.ts +7 -0
- package/dist/types/anyspend/types/onramp.d.ts +3 -0
- package/dist/types/anyspend/types/order.d.ts +40 -200
- package/dist/types/anyspend/types/req-res/createOrder.d.ts +98 -235
- package/dist/types/anyspend/types/req-res/getOrderAndTransactions.d.ts +63 -305
- package/dist/types/anyspend/types/req-res/getOrderHistory.d.ts +49 -235
- package/dist/types/anyspend/types/req-res/getQuote.d.ts +37 -0
- package/dist/types/anyspend/types/req-res/index.d.ts +0 -1
- package/dist/types/anyspend/types/signatureMint.d.ts +69 -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/SignIn.d.ts +14 -0
- package/dist/types/global-account/react/components/SignInWithB3/SignInWithB3.d.ts +1 -2
- 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/custom/Icon.d.ts +7 -0
- package/dist/types/global-account/react/components/custom/ManageAccountButton.d.ts +4 -0
- 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 +8 -4
- 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 +40 -1
- package/dist/types/index.d.ts +0 -0
- package/dist/types/shared/constants/index.d.ts +1 -0
- package/dist/types/shared/react/hooks/index.d.ts +1 -0
- package/dist/types/shared/react/hooks/useNavigation.d.ts +17 -0
- package/dist/types/shared/react/index.d.ts +1 -0
- package/dist/types/shared/thirdweb/generated/sdk.gen.d.ts +2 -2
- package/dist/types/shared/utils/formatUsername.d.ts +1 -0
- package/dist/types/shared/utils/index.d.ts +3 -1
- package/dist/types/shared/utils/truncateAddress.d.ts +6 -0
- package/package.json +25 -4
- package/src/anyspend/README.md +12 -0
- package/src/anyspend/abis/{abi-usdc-base.ts → abiUsdcBase.ts} +97 -97
- package/src/anyspend/abis/bondKit.ts +26 -0
- package/src/anyspend/abis/{erc20-staking.ts → erc20Staking.ts} +51 -51
- package/src/anyspend/abis/signatureMinting.ts +43 -0
- package/src/anyspend/constants/index.ts +13 -11
- package/src/anyspend/index.native.ts +2 -2
- package/src/anyspend/index.ts +6 -8
- package/src/anyspend/react/components/AnySpend.tsx +44 -39
- package/src/anyspend/react/components/AnySpendBondKit.tsx +351 -0
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +46 -46
- package/src/anyspend/react/components/AnySpendCustom.tsx +217 -90
- package/src/anyspend/react/components/AnySpendNFT.tsx +11 -6
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +23 -22
- package/src/anyspend/react/components/AnySpendTournament.tsx +7 -4
- package/src/anyspend/react/components/AnyspendSignatureMint.tsx +159 -0
- package/src/anyspend/react/components/{AnySpendNFTButton.tsx → common/AnySpendNFTButton.tsx} +1 -1
- package/src/anyspend/react/components/common/ChainTokenIcon.tsx +1 -1
- package/src/anyspend/react/components/common/OrderDetails.tsx +75 -77
- 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 +9 -17
- 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 +16 -15
- package/src/anyspend/react/components/common/TokenBalance.tsx +2 -2
- package/src/anyspend/react/components/common/Warning.tsx +7 -0
- package/src/anyspend/react/components/index.ts +4 -1
- package/src/anyspend/react/components/modals/EnterRecipientModal.tsx +2 -2
- package/src/anyspend/react/components/webview/WebviewOnrampOrderStatus.tsx +0 -1
- package/src/anyspend/react/components/webview/WebviewOnrampPayment.tsx +18 -20
- package/src/anyspend/react/hooks/index.ts +1 -2
- package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +10 -20
- package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +9 -8
- 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/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/useSigMint.tsx +55 -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 +9 -4
- package/src/anyspend/services/anyspend.ts +21 -39
- package/src/anyspend/types/bondKit.ts +12 -0
- 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/metadata.ts +41 -0
- package/src/anyspend/types/nft.ts +10 -7
- package/src/anyspend/types/onramp.ts +3 -2
- package/src/anyspend/types/order.ts +9 -16
- 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 +14 -9
- package/src/anyspend/types/req-res/getTokenList.ts +4 -4
- package/src/anyspend/types/req-res/index.ts +0 -1
- package/src/anyspend/types/signatureMint.ts +77 -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 +2 -7
- package/src/anyspend/utils/orderPayload.ts +21 -9
- 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 +20 -6
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +4 -4
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +22 -20
- 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/SignIn.tsx +190 -0
- package/src/global-account/react/components/SignInWithB3/SignInWithB3.tsx +16 -28
- 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 +0 -1
- 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/Icon.tsx +102 -0
- package/src/global-account/react/components/custom/ManageAccountButton.tsx +33 -0
- 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 +43 -31
- 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 +47 -4
- 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/index.ts +1 -0
- 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 +6 -1
- package/src/shared/constants/index.ts +3 -1
- package/src/shared/react/hooks/index.ts +1 -0
- package/src/shared/react/hooks/useNavigation.ts +61 -0
- package/src/shared/react/index.ts +1 -0
- package/src/shared/thirdweb/generated/sdk.gen.ts +3 -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/formatUsername.ts +5 -0
- package/src/shared/utils/index.ts +4 -6
- 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/shared/utils/truncateAddress.ts +11 -0
- package/src/styles/index.css +5 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendSendPermitData.d.ts +0 -16
- package/dist/cjs/anyspend/react/hooks/useAnyspendSendPermitData.js +0 -39
- package/dist/cjs/anyspend/react/hooks/usePermitData.d.ts +0 -92
- package/dist/cjs/anyspend/react/hooks/usePermitData.js +0 -158
- package/dist/cjs/anyspend/types/permit.d.ts +0 -21
- package/dist/cjs/anyspend/types/permit.js +0 -11
- package/dist/cjs/anyspend/types/req-res/sendPermitData.d.ts +0 -66
- package/dist/cjs/anyspend/types/req-res/sendPermitData.js +0 -11
- package/dist/esm/anyspend/react/hooks/useAnyspendSendPermitData.d.ts +0 -16
- package/dist/esm/anyspend/react/hooks/useAnyspendSendPermitData.js +0 -36
- package/dist/esm/anyspend/react/hooks/usePermitData.d.ts +0 -92
- package/dist/esm/anyspend/react/hooks/usePermitData.js +0 -154
- package/dist/esm/anyspend/types/permit.d.ts +0 -21
- package/dist/esm/anyspend/types/permit.js +0 -8
- package/dist/esm/anyspend/types/req-res/sendPermitData.d.ts +0 -66
- package/dist/esm/anyspend/types/req-res/sendPermitData.js +0 -8
- package/dist/types/anyspend/react/hooks/useAnyspendSendPermitData.d.ts +0 -16
- package/dist/types/anyspend/react/hooks/usePermitData.d.ts +0 -92
- package/dist/types/anyspend/types/permit.d.ts +0 -21
- package/dist/types/anyspend/types/req-res/sendPermitData.d.ts +0 -66
- package/src/anyspend/react/hooks/useAnyspendSendPermitData.ts +0 -38
- package/src/anyspend/react/hooks/usePermitData.ts +0 -183
- package/src/anyspend/types/permit.ts +0 -10
- package/src/anyspend/types/req-res/sendPermitData.ts +0 -10
- /package/dist/cjs/anyspend/abis/{abi-usdc-base.d.ts → abiUsdcBase.d.ts} +0 -0
- /package/dist/cjs/anyspend/abis/{erc20-staking.d.ts → erc20Staking.d.ts} +0 -0
- /package/dist/esm/anyspend/abis/{abi-usdc-base.d.ts → abiUsdcBase.d.ts} +0 -0
- /package/dist/esm/anyspend/abis/{erc20-staking.d.ts → erc20Staking.d.ts} +0 -0
- /package/dist/types/anyspend/abis/{abi-usdc-base.d.ts → abiUsdcBase.d.ts} +0 -0
- /package/dist/types/anyspend/abis/{erc20-staking.d.ts → erc20Staking.d.ts} +0 -0
- /package/dist/types/anyspend/react/components/{AnySpendNFTButton.d.ts → common/AnySpendNFTButton.d.ts} +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { getDefaultToken, OrderType, TradeType, USDC_BASE
|
|
4
|
-
import {
|
|
3
|
+
import { getDefaultToken, OrderType, TradeType, USDC_BASE } from "../../../anyspend/index.js";
|
|
4
|
+
import { useAnyspendCreateOrder, useAnyspendOrderAndTransactions, useAnyspendQuote, } from "../../../anyspend/react/index.js";
|
|
5
|
+
import { Button, ShinyButton, StyleRoot, TransitionPanel, useAccountWallet, useOnchainName, useRouter, useSearchParamsSSR, useTokenData, useTokenFromUrl, } from "../../../global-account/react/index.js";
|
|
5
6
|
import { cn } from "../../../shared/utils/cn.js";
|
|
6
7
|
import { shortenAddress } from "../../../shared/utils/formatAddress.js";
|
|
7
8
|
import { formatDisplayNumber, formatTokenAmount } from "../../../shared/utils/number.js";
|
|
@@ -29,7 +30,7 @@ export var PanelView;
|
|
|
29
30
|
PanelView[PanelView["FIAT_PAYMENT"] = 4] = "FIAT_PAYMENT";
|
|
30
31
|
})(PanelView || (PanelView = {}));
|
|
31
32
|
const ANYSPEND_RECIPIENTS_KEY = "anyspend_recipients";
|
|
32
|
-
export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet = true, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps }) {
|
|
33
|
+
export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet = true, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, }) {
|
|
33
34
|
const searchParams = useSearchParamsSSR();
|
|
34
35
|
const router = useRouter();
|
|
35
36
|
// Determine if we're in "buy mode" based on whether destination token props are provided
|
|
@@ -54,7 +55,7 @@ export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isM
|
|
|
54
55
|
const defaultSrcToken = getDefaultToken(selectedSrcChainId);
|
|
55
56
|
const srcTokenFromUrl = useTokenFromUrl({
|
|
56
57
|
defaultToken: defaultSrcToken,
|
|
57
|
-
prefix: "from"
|
|
58
|
+
prefix: "from",
|
|
58
59
|
});
|
|
59
60
|
const [selectedSrcToken, setSelectedSrcToken] = useState(srcTokenFromUrl);
|
|
60
61
|
const { data: srcTokenMetadata } = useTokenData(selectedSrcToken?.chainId, selectedSrcToken?.address);
|
|
@@ -70,12 +71,12 @@ export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isM
|
|
|
70
71
|
address: destinationTokenAddress,
|
|
71
72
|
name: "",
|
|
72
73
|
decimals: 18,
|
|
73
|
-
metadata: {}
|
|
74
|
+
metadata: {},
|
|
74
75
|
}
|
|
75
76
|
: getDefaultToken(selectedDstChainId);
|
|
76
77
|
const dstTokenFromUrl = useTokenFromUrl({
|
|
77
78
|
defaultToken: defaultDstToken,
|
|
78
|
-
prefix: "to"
|
|
79
|
+
prefix: "to",
|
|
79
80
|
});
|
|
80
81
|
const [selectedDstToken, setSelectedDstToken] = useState(isBuyMode ? defaultDstToken : dstTokenFromUrl);
|
|
81
82
|
const { data: dstTokenMetadata } = useTokenData(selectedDstToken?.chainId, selectedDstToken?.address);
|
|
@@ -96,8 +97,8 @@ export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isM
|
|
|
96
97
|
name: srcTokenMetadata.name || selectedSrcToken.name,
|
|
97
98
|
metadata: {
|
|
98
99
|
...selectedSrcToken.metadata,
|
|
99
|
-
logoURI: srcTokenMetadata?.logoURI || selectedSrcToken.metadata.logoURI
|
|
100
|
-
}
|
|
100
|
+
logoURI: srcTokenMetadata?.logoURI || selectedSrcToken.metadata.logoURI,
|
|
101
|
+
},
|
|
101
102
|
};
|
|
102
103
|
setSelectedSrcToken(enhancedToken);
|
|
103
104
|
}
|
|
@@ -118,8 +119,8 @@ export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isM
|
|
|
118
119
|
name: dstTokenMetadata.name || selectedDstToken.name,
|
|
119
120
|
metadata: {
|
|
120
121
|
...selectedDstToken.metadata,
|
|
121
|
-
logoURI: dstTokenMetadata?.logoURI || selectedDstToken.metadata.logoURI
|
|
122
|
-
}
|
|
122
|
+
logoURI: dstTokenMetadata?.logoURI || selectedDstToken.metadata.logoURI,
|
|
123
|
+
},
|
|
123
124
|
};
|
|
124
125
|
setSelectedDstToken(enhancedToken);
|
|
125
126
|
}
|
|
@@ -185,7 +186,7 @@ export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isM
|
|
|
185
186
|
fromAmount: activeTab === "crypto" ? srcAmount : undefined,
|
|
186
187
|
toChainId: selectedDstChainId.toString(),
|
|
187
188
|
toCurrency: selectedDstToken.address,
|
|
188
|
-
toAmount: dstAmount
|
|
189
|
+
toAmount: dstAmount,
|
|
189
190
|
};
|
|
190
191
|
// Compare with last update to prevent unnecessary URL changes
|
|
191
192
|
const lastState = lastUrlUpdate.current;
|
|
@@ -234,7 +235,7 @@ export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isM
|
|
|
234
235
|
selectedDstToken.address,
|
|
235
236
|
dstAmount,
|
|
236
237
|
router,
|
|
237
|
-
srcAmountOnRamp
|
|
238
|
+
srcAmountOnRamp,
|
|
238
239
|
]);
|
|
239
240
|
// Update URL when relevant state changes - but only after initial render
|
|
240
241
|
useEffect(() => {
|
|
@@ -248,7 +249,7 @@ export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isM
|
|
|
248
249
|
selectedSrcToken.address,
|
|
249
250
|
selectedDstChainId,
|
|
250
251
|
selectedDstToken.address,
|
|
251
|
-
updateSwapParamsInURL
|
|
252
|
+
updateSwapParamsInURL,
|
|
252
253
|
]);
|
|
253
254
|
// Use our hook for ENS resolution
|
|
254
255
|
// const { address: resolvedAddress } = useResolveOnchainName(
|
|
@@ -287,7 +288,7 @@ export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isM
|
|
|
287
288
|
dstTokenAddress: isBuyMode ? destinationTokenAddress : selectedDstToken.address,
|
|
288
289
|
type: OrderType.Swap,
|
|
289
290
|
tradeType: isSrcInputDirty ? TradeType.EXACT_INPUT : TradeType.EXPECTED_OUTPUT,
|
|
290
|
-
amount: activeInputAmountInWei
|
|
291
|
+
amount: activeInputAmountInWei,
|
|
291
292
|
}
|
|
292
293
|
: {
|
|
293
294
|
srcChain: base.id,
|
|
@@ -296,7 +297,7 @@ export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isM
|
|
|
296
297
|
dstTokenAddress: isBuyMode ? destinationTokenAddress : selectedDstToken.address,
|
|
297
298
|
type: OrderType.Swap,
|
|
298
299
|
tradeType: TradeType.EXACT_INPUT,
|
|
299
|
-
amount: srcAmountOnrampInWei
|
|
300
|
+
amount: srcAmountOnrampInWei,
|
|
300
301
|
});
|
|
301
302
|
// Replace the old ENS lookup with our new hooks
|
|
302
303
|
const { name: recipientName } = useOnchainName(recipientAddress);
|
|
@@ -475,7 +476,7 @@ export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isM
|
|
|
475
476
|
onError: error => {
|
|
476
477
|
console.error(error);
|
|
477
478
|
toast.error("Failed to create order: " + error.message);
|
|
478
|
-
}
|
|
479
|
+
},
|
|
479
480
|
});
|
|
480
481
|
// Determine button state and text
|
|
481
482
|
const btnInfo = useMemo(() => {
|
|
@@ -500,7 +501,7 @@ export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isM
|
|
|
500
501
|
anyspendQuote,
|
|
501
502
|
activeTab,
|
|
502
503
|
isBuyMode,
|
|
503
|
-
selectedDstToken.symbol
|
|
504
|
+
selectedDstToken.symbol,
|
|
504
505
|
]);
|
|
505
506
|
// Handle main button click
|
|
506
507
|
const onMainButtonClick = async () => {
|
|
@@ -530,7 +531,7 @@ export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isM
|
|
|
530
531
|
: selectedDstToken,
|
|
531
532
|
srcAmount: srcAmountBigInt.toString(),
|
|
532
533
|
expectedDstAmount: anyspendQuote?.data?.currencyOut?.amount || "0",
|
|
533
|
-
creatorAddress: globalAddress
|
|
534
|
+
creatorAddress: globalAddress,
|
|
534
535
|
});
|
|
535
536
|
}
|
|
536
537
|
catch (err) {
|
|
@@ -598,7 +599,7 @@ export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isM
|
|
|
598
599
|
}
|
|
599
600
|
return {
|
|
600
601
|
percentage: Math.abs(percentageValue).toFixed(2),
|
|
601
|
-
isNegative: percentageValue < 0
|
|
602
|
+
isNegative: percentageValue < 0,
|
|
602
603
|
};
|
|
603
604
|
};
|
|
604
605
|
// Add state for rate details toggle
|
|
@@ -669,16 +670,16 @@ export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isM
|
|
|
669
670
|
: activePanel === PanelView.ORDER_DETAILS
|
|
670
671
|
? PanelView.MAIN
|
|
671
672
|
: activePanel, className: cn("w-full", {
|
|
672
|
-
"mt-0": mode === "modal"
|
|
673
|
+
"mt-0": mode === "modal",
|
|
673
674
|
}), variants: {
|
|
674
675
|
enter: { x: 300, opacity: 0 },
|
|
675
676
|
center: { x: 0, opacity: 1 },
|
|
676
|
-
exit: { x: -300, opacity: 0 }
|
|
677
|
+
exit: { x: -300, opacity: 0 },
|
|
677
678
|
}, transition: { type: "spring", stiffness: 300, damping: 30 }, children: [
|
|
678
679
|
_jsx("div", { children: mainView }, "main-view"),
|
|
679
680
|
_jsx("div", { children: historyView }, "history-view"),
|
|
680
681
|
_jsx("div", { children: orderDetailsView }, "order-details-view"),
|
|
681
682
|
_jsx("div", { children: OrderDetailsLoadingView }, "loading-view"),
|
|
682
|
-
_jsx("div", { children: onrampPaymentView }, "fiat-payment-view")
|
|
683
|
+
_jsx("div", { children: onrampPaymentView }, "fiat-payment-view"),
|
|
683
684
|
] }), _jsx(EnterRecipientModal, { isOpenPasteRecipientAddress: isOpenPasteRecipientAddressModal, setIsOpenPasteRecipientAddress: setIsOpenPasteRecipientAddressModal, recipientAddress: recipientAddress, setRecipientAddress: setRecipientAddress })] }) }));
|
|
684
685
|
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { BondkitToken } from "@b3dotfun/bondkit";
|
|
3
|
+
import { OrderType } from "../../../anyspend/index.js";
|
|
4
|
+
import { Button, GlareCardRounded, Input, StyleRoot, useHasMounted, useTokenData, } from "../../../global-account/react/index.js";
|
|
5
|
+
import { baseMainnet } from "../../../shared/constants/chains/supported.js";
|
|
6
|
+
import { motion } from "framer-motion";
|
|
7
|
+
import { useEffect, useMemo, useState } from "react";
|
|
8
|
+
import { createPublicClient, encodeFunctionData, formatEther, http, parseEther } from "viem";
|
|
9
|
+
import { ABI_bondKit } from "../../abis/bondKit.js";
|
|
10
|
+
import { AnySpendCustom } from "./AnySpendCustom.js";
|
|
11
|
+
// Debounce utility function
|
|
12
|
+
function debounce(func, wait) {
|
|
13
|
+
let timeout;
|
|
14
|
+
return (...args) => {
|
|
15
|
+
clearTimeout(timeout);
|
|
16
|
+
timeout = setTimeout(() => func(...args), wait);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
// Format number with commas
|
|
20
|
+
function formatNumberWithCommas(x) {
|
|
21
|
+
const parts = x.split(".");
|
|
22
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
23
|
+
return parts.join(".");
|
|
24
|
+
}
|
|
25
|
+
export function AnySpendBondKit({ mode = "modal", recipientAddress, contractAddress, minTokensOut = "0", imageUrl, onSuccess, }) {
|
|
26
|
+
const hasMounted = useHasMounted();
|
|
27
|
+
const [showAmountPrompt, setShowAmountPrompt] = useState(true);
|
|
28
|
+
const [ethAmount, setEthAmount] = useState("");
|
|
29
|
+
const [isAmountValid, setIsAmountValid] = useState(false);
|
|
30
|
+
const [validationError, setValidationError] = useState("");
|
|
31
|
+
const [tokenName, setTokenName] = useState("");
|
|
32
|
+
const [tokenSymbol, setTokenSymbol] = useState("");
|
|
33
|
+
const [quote, setQuote] = useState(null);
|
|
34
|
+
const [isLoadingQuote, setIsLoadingQuote] = useState(false);
|
|
35
|
+
// Create BondKit client
|
|
36
|
+
const bondkitTokenClient = useMemo(() => {
|
|
37
|
+
if (!contractAddress)
|
|
38
|
+
return null;
|
|
39
|
+
try {
|
|
40
|
+
const client = new BondkitToken(contractAddress);
|
|
41
|
+
client.connect();
|
|
42
|
+
return client;
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
console.error("Error creating bondkit client", error);
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
}, [contractAddress]);
|
|
49
|
+
// Create a public client for reading contract data
|
|
50
|
+
const basePublicClient = createPublicClient({
|
|
51
|
+
chain: baseMainnet,
|
|
52
|
+
transport: http(),
|
|
53
|
+
});
|
|
54
|
+
// Fetch token name from contract
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
async function fetchTokenName() {
|
|
57
|
+
try {
|
|
58
|
+
const [name, symbol] = await Promise.all([
|
|
59
|
+
basePublicClient.readContract({
|
|
60
|
+
address: contractAddress,
|
|
61
|
+
abi: ABI_bondKit,
|
|
62
|
+
functionName: "name",
|
|
63
|
+
}),
|
|
64
|
+
basePublicClient.readContract({
|
|
65
|
+
address: contractAddress,
|
|
66
|
+
abi: ABI_bondKit,
|
|
67
|
+
functionName: "symbol",
|
|
68
|
+
}),
|
|
69
|
+
]);
|
|
70
|
+
setTokenName(name);
|
|
71
|
+
setTokenSymbol(symbol);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
console.error("Error fetching token name:", error);
|
|
75
|
+
setTokenName("BondKit Token");
|
|
76
|
+
setTokenSymbol("BOND");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (contractAddress) {
|
|
80
|
+
fetchTokenName();
|
|
81
|
+
}
|
|
82
|
+
}, [contractAddress, basePublicClient]);
|
|
83
|
+
// Get native token data for the chain
|
|
84
|
+
const { data: tokenData, isError: isTokenError, isLoading, } = useTokenData(baseMainnet.id, "0x0000000000000000000000000000000000000000");
|
|
85
|
+
// Convert token data to AnySpend Token type
|
|
86
|
+
const dstToken = useMemo(() => {
|
|
87
|
+
if (!tokenData)
|
|
88
|
+
return null;
|
|
89
|
+
return {
|
|
90
|
+
address: tokenData.address,
|
|
91
|
+
chainId: baseMainnet.id,
|
|
92
|
+
name: tokenData.name,
|
|
93
|
+
symbol: tokenData.symbol,
|
|
94
|
+
decimals: tokenData.decimals,
|
|
95
|
+
metadata: {
|
|
96
|
+
logoURI: tokenData.logoURI,
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}, [tokenData]);
|
|
100
|
+
// Debounced quote fetching
|
|
101
|
+
const debouncedGetQuote = useMemo(() => debounce(async (val) => {
|
|
102
|
+
if (!val || Number(val) <= 0 || !bondkitTokenClient) {
|
|
103
|
+
setQuote(null);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
setIsLoadingQuote(true);
|
|
108
|
+
const parsedAmount = parseEther(val);
|
|
109
|
+
const buyQuote = await bondkitTokenClient.getAmountOfTokensToBuy(parsedAmount);
|
|
110
|
+
setQuote(buyQuote ? formatEther(buyQuote) : null);
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
console.error("Error getting buy quote:", error);
|
|
114
|
+
setQuote(null);
|
|
115
|
+
}
|
|
116
|
+
finally {
|
|
117
|
+
setIsLoadingQuote(false);
|
|
118
|
+
}
|
|
119
|
+
}, 500), [bondkitTokenClient]);
|
|
120
|
+
const validateAndSetAmount = (value) => {
|
|
121
|
+
// Allow empty input
|
|
122
|
+
if (value === "") {
|
|
123
|
+
setEthAmount("");
|
|
124
|
+
setIsAmountValid(false);
|
|
125
|
+
setValidationError("");
|
|
126
|
+
setQuote(null);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
// Only allow numbers and one decimal point
|
|
130
|
+
if (!/^\d*\.?\d*$/.test(value)) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
// Prevent multiple decimal points
|
|
134
|
+
if ((value.match(/\./g) || []).length > 1) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
// Prevent more than 18 decimal places (ETH precision)
|
|
138
|
+
const parts = value.split(".");
|
|
139
|
+
if (parts[1] && parts[1].length > 18) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
setEthAmount(value);
|
|
143
|
+
};
|
|
144
|
+
const header = () => (_jsx("div", { className: "w-full px-6 py-4", children: _jsxs("div", { className: "flex w-full flex-col items-center space-y-6", children: [_jsxs("h2", { className: "text-[28px] font-bold", children: [tokenName, " (", tokenSymbol, ")"] }), _jsxs("div", { className: "flex w-full flex-col items-center space-y-2", children: [_jsxs("span", { className: "text-[28px] font-bold", children: [ethAmount, " ETH"] }), quote && (_jsxs("span", { className: "text-lg", children: ["\u2248 ", formatNumberWithCommas(parseFloat(quote).toFixed(4)), " ", tokenSymbol] }))] })] }) }));
|
|
145
|
+
// Show loading state while fetching token data
|
|
146
|
+
if (isLoading) {
|
|
147
|
+
return (_jsx(StyleRoot, { children: _jsx("div", { className: "b3-root b3-modal bg-b3-react-background flex w-full flex-col items-center p-8", children: _jsx("p", { className: "text-as-primary/70 text-center text-sm", children: "Loading payment information..." }) }) }));
|
|
148
|
+
}
|
|
149
|
+
// If we don't have token data after loading, show error state
|
|
150
|
+
if (!dstToken || isTokenError) {
|
|
151
|
+
return (_jsx(StyleRoot, { children: _jsx("div", { className: "b3-root b3-modal bg-b3-react-background flex w-full flex-col items-center p-8", children: _jsxs("p", { className: "text-as-red text-center text-sm", children: ["Failed to fetch native token information for chain ", baseMainnet.id, ". Please try again."] }) }) }));
|
|
152
|
+
}
|
|
153
|
+
if (showAmountPrompt) {
|
|
154
|
+
return (_jsx(StyleRoot, { children: _jsxs("div", { className: "bg-b3-react-background flex w-full flex-col items-center", children: [_jsxs("div", { className: "w-full px-4 pb-2 pt-4", children: [_jsx(motion.div, { initial: false, animate: {
|
|
155
|
+
opacity: hasMounted ? 1 : 0,
|
|
156
|
+
y: hasMounted ? 0 : 20,
|
|
157
|
+
filter: hasMounted ? "blur(0px)" : "blur(10px)",
|
|
158
|
+
}, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, className: "mb-4 flex justify-center", children: imageUrl && (_jsxs("div", { className: "relative size-16", children: [_jsx("div", { className: "absolute inset-0 scale-95 rounded-[50%] bg-gradient-to-br from-blue-500/20 to-purple-600/20 blur-xl" }), _jsxs(GlareCardRounded, { className: "overflow-hidden rounded-full border-none bg-gradient-to-br from-blue-500/10 to-purple-600/10 backdrop-blur-sm", children: [_jsx("img", { alt: "token preview", className: "size-full rounded-lg object-cover", src: imageUrl }), _jsx("div", { className: "absolute inset-0 rounded-[50%] border border-white/20" })] })] })) }), _jsx(motion.div, { initial: false, animate: {
|
|
159
|
+
opacity: hasMounted ? 1 : 0,
|
|
160
|
+
y: hasMounted ? 0 : 20,
|
|
161
|
+
filter: hasMounted ? "blur(0px)" : "blur(10px)",
|
|
162
|
+
}, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "text-center", children: _jsxs("h2", { className: "font-sf-rounded text-as-primary mb-4 text-2xl font-bold", children: ["Buy ", tokenName] }) })] }), _jsx(motion.div, { initial: false, animate: {
|
|
163
|
+
opacity: hasMounted ? 1 : 0,
|
|
164
|
+
y: hasMounted ? 0 : 20,
|
|
165
|
+
filter: hasMounted ? "blur(0px)" : "blur(10px)",
|
|
166
|
+
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children: _jsxs("div", { className: "space-y-4", children: [_jsx("div", { className: "flex items-center justify-between", children: _jsx("p", { className: "text-as-primary/70 text-sm font-medium", children: "Amount in ETH" }) }), _jsx("div", { className: "relative", children: _jsx(Input, { type: "text", inputMode: "decimal", placeholder: "0.1", value: ethAmount, onChange: e => validateAndSetAmount(e.target.value), className: `h-14 px-4 text-lg ${!isAmountValid && ethAmount ? "border-as-red" : "border-b3-react-border"}` }) }), !isAmountValid && ethAmount && _jsx("p", { className: "text-as-red text-sm", children: validationError }), _jsxs("div", { className: "bg-as-on-surface-2/30 rounded-lg border border-white/10 p-4 backdrop-blur-sm", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-as-primary/70 text-sm font-medium", children: "Total Cost:" }), _jsx("div", { className: "flex items-center gap-2", children: _jsxs("span", { className: "text-as-primary text-lg font-bold", children: [ethAmount || "0", " ETH"] }) })] }), isLoadingQuote ? (_jsx("div", { className: "mt-2 text-center", children: _jsx("span", { className: "text-as-primary/70 text-sm", children: "Calculating tokens..." }) })) : quote ? (_jsxs("div", { className: "mt-2 flex items-center justify-between", children: [_jsx("span", { className: "text-as-primary/70 text-sm font-medium", children: "You'll receive:" }), _jsxs("span", { className: "text-as-primary text-sm font-medium", children: ["\u2248 ", formatNumberWithCommas(parseFloat(quote).toFixed(4)), " ", tokenSymbol] })] })) : null] }), _jsx(Button, { onClick: () => {
|
|
167
|
+
if (isAmountValid && ethAmount) {
|
|
168
|
+
setShowAmountPrompt(false);
|
|
169
|
+
}
|
|
170
|
+
}, disabled: !isAmountValid || !ethAmount || isLoadingQuote, className: "bg-as-brand hover:bg-as-brand/90 text-as-primary mt-4 h-14 w-full rounded-xl text-lg font-medium", children: "Continue" })] }) })] }) }));
|
|
171
|
+
}
|
|
172
|
+
const encodedData = encodeFunctionData({
|
|
173
|
+
abi: ABI_bondKit,
|
|
174
|
+
functionName: "buyFor",
|
|
175
|
+
args: [recipientAddress, BigInt(minTokensOut)],
|
|
176
|
+
});
|
|
177
|
+
return (_jsx(AnySpendCustom, { isMainnet: true, mode: mode, recipientAddress: recipientAddress, orderType: OrderType.Custom, dstChainId: baseMainnet.id, dstToken: dstToken, dstAmount: parseEther(ethAmount).toString(), contractAddress: contractAddress, encodedData: encodedData, metadata: {
|
|
178
|
+
type: OrderType.Custom,
|
|
179
|
+
action: "BondKit Buy",
|
|
180
|
+
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
181
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function AnySpendBuySpin({ isMainnet, loadOrder, mode, spinwheelContractAddress, chainId, recipientAddress, prefillQuantity, onSuccess }: {
|
|
1
|
+
export declare function AnySpendBuySpin({ isMainnet, loadOrder, mode, spinwheelContractAddress, chainId, recipientAddress, prefillQuantity, onSuccess, }: {
|
|
2
2
|
isMainnet?: boolean;
|
|
3
3
|
loadOrder?: string;
|
|
4
4
|
mode?: "modal" | "page";
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { B3_TOKEN, OrderType } from "../../../anyspend/index.js";
|
|
3
|
+
import { Button, GlareCardRounded, Input, StyleRoot, TextLoop, useChainSwitchWithAction, useHasMounted, useModalStore, useTokenBalance, } from "../../../global-account/react/index.js";
|
|
3
4
|
import { baseMainnet } from "../../../shared/constants/chains/supported.js";
|
|
4
|
-
import { EthIcon } from "./icons/EthIcon.js";
|
|
5
|
-
import { SolIcon } from "./icons/SolIcon.js";
|
|
6
|
-
import { UsdcIcon } from "./icons/USDCIcon.js";
|
|
7
|
-
import { StyleRoot } from "../../../global-account/react/index.js";
|
|
8
|
-
import { Button, GlareCardRounded, Input, TextLoop, useChainSwitchWithAction, useHasMounted, useTokenBalance, useModalStore } from "../../../global-account/react/index.js";
|
|
9
5
|
import { motion } from "framer-motion";
|
|
10
6
|
import invariant from "invariant";
|
|
11
7
|
import { ArrowRight, Loader2 } from "lucide-react";
|
|
@@ -14,6 +10,9 @@ import { toast } from "sonner";
|
|
|
14
10
|
import { createPublicClient, encodeFunctionData, erc20Abi, formatUnits, http } from "viem";
|
|
15
11
|
import { useAccount, useWaitForTransactionReceipt, useWriteContract } from "wagmi";
|
|
16
12
|
import { AnySpendCustom } from "./AnySpendCustom.js";
|
|
13
|
+
import { EthIcon } from "./icons/EthIcon.js";
|
|
14
|
+
import { SolIcon } from "./icons/SolIcon.js";
|
|
15
|
+
import { UsdcIcon } from "./icons/USDCIcon.js";
|
|
17
16
|
const SPIN_WHEEL_ABI = [
|
|
18
17
|
{
|
|
19
18
|
inputs: [],
|
|
@@ -22,27 +21,27 @@ const SPIN_WHEEL_ABI = [
|
|
|
22
21
|
{ internalType: "address", name: "paymentToken", type: "address" },
|
|
23
22
|
{ internalType: "uint256", name: "pricePerEntry", type: "uint256" },
|
|
24
23
|
{ internalType: "uint256", name: "maxEntriesPerUser", type: "uint256" },
|
|
25
|
-
{ internalType: "address", name: "paymentRecipient", type: "address" }
|
|
24
|
+
{ internalType: "address", name: "paymentRecipient", type: "address" },
|
|
26
25
|
],
|
|
27
26
|
stateMutability: "view",
|
|
28
|
-
type: "function"
|
|
27
|
+
type: "function",
|
|
29
28
|
},
|
|
30
29
|
{
|
|
31
30
|
inputs: [],
|
|
32
31
|
name: "entryModule",
|
|
33
32
|
outputs: [{ internalType: "contract IEntryModuleV2", name: "", type: "address" }],
|
|
34
33
|
stateMutability: "view",
|
|
35
|
-
type: "function"
|
|
34
|
+
type: "function",
|
|
36
35
|
},
|
|
37
36
|
{
|
|
38
37
|
inputs: [
|
|
39
38
|
{ internalType: "address", name: "user", type: "address" },
|
|
40
|
-
{ internalType: "uint256", name: "quantity", type: "uint256" }
|
|
39
|
+
{ internalType: "uint256", name: "quantity", type: "uint256" },
|
|
41
40
|
],
|
|
42
41
|
name: "buyEntriesAndSpin",
|
|
43
42
|
outputs: [],
|
|
44
43
|
stateMutability: "payable",
|
|
45
|
-
type: "function"
|
|
44
|
+
type: "function",
|
|
46
45
|
},
|
|
47
46
|
{
|
|
48
47
|
inputs: [],
|
|
@@ -53,16 +52,14 @@ const SPIN_WHEEL_ABI = [
|
|
|
53
52
|
{ internalType: "uint256", name: "endTime_", type: "uint256" },
|
|
54
53
|
{ internalType: "uint256", name: "totalPrizesAvailable_", type: "uint256" },
|
|
55
54
|
{ internalType: "uint256", name: "prizesRequestedCount_", type: "uint256" },
|
|
56
|
-
{ internalType: "enum SpinWheelV2.WheelState", name: "state_", type: "uint8" }
|
|
55
|
+
{ internalType: "enum SpinWheelV2.WheelState", name: "state_", type: "uint8" },
|
|
57
56
|
],
|
|
58
57
|
stateMutability: "view",
|
|
59
|
-
type: "function"
|
|
60
|
-
}
|
|
58
|
+
type: "function",
|
|
59
|
+
},
|
|
61
60
|
];
|
|
62
61
|
function getWheelStatus(wheelInfo) {
|
|
63
62
|
const now = BigInt(Math.floor(Date.now() / 1000));
|
|
64
|
-
console.log("@@anyspend-buy-spin:now:", now);
|
|
65
|
-
console.log("@@anyspend-buy-spin:wheelInfo:", wheelInfo);
|
|
66
63
|
if (now < wheelInfo.startTime_) {
|
|
67
64
|
return "not_started";
|
|
68
65
|
}
|
|
@@ -76,19 +73,18 @@ function getWheelStatus(wheelInfo) {
|
|
|
76
73
|
}
|
|
77
74
|
function generateEncodedDataForBuyEntriesAndSpin(user, quantity) {
|
|
78
75
|
invariant(BigInt(quantity) > 0, "Quantity must be greater than zero");
|
|
79
|
-
console.log("@@anyspend-buy-spin:encoded-data:", { user, quantity });
|
|
80
76
|
const encodedData = encodeFunctionData({
|
|
81
77
|
abi: SPIN_WHEEL_ABI,
|
|
82
78
|
functionName: "buyEntriesAndSpin",
|
|
83
|
-
args: [user, BigInt(quantity)]
|
|
79
|
+
args: [user, BigInt(quantity)],
|
|
84
80
|
});
|
|
85
81
|
return encodedData;
|
|
86
82
|
}
|
|
87
83
|
const basePublicClient = createPublicClient({
|
|
88
84
|
chain: baseMainnet,
|
|
89
|
-
transport: http()
|
|
85
|
+
transport: http(),
|
|
90
86
|
});
|
|
91
|
-
export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", spinwheelContractAddress, chainId, recipientAddress, prefillQuantity, onSuccess }) {
|
|
87
|
+
export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", spinwheelContractAddress, chainId, recipientAddress, prefillQuantity, onSuccess, }) {
|
|
92
88
|
const hasMounted = useHasMounted();
|
|
93
89
|
const { setB3ModalOpen } = useModalStore();
|
|
94
90
|
// Payment config state
|
|
@@ -97,8 +93,8 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
97
93
|
const [configError, setConfigError] = useState("");
|
|
98
94
|
const [wheelInfo, setWheelInfo] = useState(null);
|
|
99
95
|
// Fetch B3 token balance
|
|
100
|
-
const { formattedBalance: b3Balance, isLoading: isBalanceLoading, rawBalance: b3RawBalance } = useTokenBalance({
|
|
101
|
-
token: B3_TOKEN
|
|
96
|
+
const { formattedBalance: b3Balance, isLoading: isBalanceLoading, rawBalance: b3RawBalance, } = useTokenBalance({
|
|
97
|
+
token: B3_TOKEN,
|
|
102
98
|
});
|
|
103
99
|
// Wagmi hooks
|
|
104
100
|
const { address } = useAccount();
|
|
@@ -107,11 +103,11 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
107
103
|
// State for direct buying flow (when user has B3 tokens)
|
|
108
104
|
const [isBuying, setIsBuying] = useState(false);
|
|
109
105
|
const [buyingTxHash, setBuyingTxHash] = useState("");
|
|
110
|
-
const { isLoading: isTxPending, isSuccess: isTxSuccess, isError: isTxError, error: txError } = useWaitForTransactionReceipt({
|
|
106
|
+
const { isLoading: isTxPending, isSuccess: isTxSuccess, isError: isTxError, error: txError, } = useWaitForTransactionReceipt({
|
|
111
107
|
hash: buyingTxHash,
|
|
112
108
|
query: {
|
|
113
|
-
structuralSharing: false
|
|
114
|
-
}
|
|
109
|
+
structuralSharing: false,
|
|
110
|
+
},
|
|
115
111
|
});
|
|
116
112
|
// Handle transaction status
|
|
117
113
|
useEffect(() => {
|
|
@@ -154,29 +150,28 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
154
150
|
try {
|
|
155
151
|
setIsLoadingConfig(true);
|
|
156
152
|
setConfigError("");
|
|
157
|
-
console.log("@@anyspend-buy-spin:fetch-config:", { spinwheelContractAddress, chainId });
|
|
158
153
|
const [config, entryModuleAddress, wheelInfo] = await Promise.all([
|
|
159
154
|
basePublicClient.readContract({
|
|
160
155
|
address: spinwheelContractAddress,
|
|
161
156
|
abi: SPIN_WHEEL_ABI,
|
|
162
|
-
functionName: "getPaymentConfig"
|
|
157
|
+
functionName: "getPaymentConfig",
|
|
163
158
|
}),
|
|
164
159
|
basePublicClient.readContract({
|
|
165
160
|
address: spinwheelContractAddress,
|
|
166
161
|
abi: SPIN_WHEEL_ABI,
|
|
167
|
-
functionName: "entryModule"
|
|
162
|
+
functionName: "entryModule",
|
|
168
163
|
}),
|
|
169
164
|
basePublicClient.readContract({
|
|
170
165
|
address: spinwheelContractAddress,
|
|
171
166
|
abi: SPIN_WHEEL_ABI,
|
|
172
|
-
functionName: "getWheelInfo"
|
|
173
|
-
})
|
|
167
|
+
functionName: "getWheelInfo",
|
|
168
|
+
}),
|
|
174
169
|
]);
|
|
175
170
|
const paymentConfig = {
|
|
176
171
|
pricePerEntry: config[1],
|
|
177
172
|
maxEntriesPerUser: config[2],
|
|
178
173
|
paymentRecipient: config[3],
|
|
179
|
-
entryModule: entryModuleAddress
|
|
174
|
+
entryModule: entryModuleAddress,
|
|
180
175
|
};
|
|
181
176
|
const wheelInfoData = {
|
|
182
177
|
creator_: wheelInfo[0],
|
|
@@ -184,7 +179,7 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
184
179
|
endTime_: wheelInfo[2],
|
|
185
180
|
totalPrizesAvailable_: wheelInfo[3],
|
|
186
181
|
prizesRequestedCount_: wheelInfo[4],
|
|
187
|
-
state_: wheelInfo[5]
|
|
182
|
+
state_: wheelInfo[5],
|
|
188
183
|
};
|
|
189
184
|
setPaymentConfig(paymentConfig);
|
|
190
185
|
setWheelInfo(wheelInfoData);
|
|
@@ -232,7 +227,9 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
232
227
|
return;
|
|
233
228
|
}
|
|
234
229
|
// Check maximum entries per user (0 means no limit)
|
|
235
|
-
if (paymentConfig &&
|
|
230
|
+
if (paymentConfig &&
|
|
231
|
+
paymentConfig.maxEntriesPerUser > BigInt(0) &&
|
|
232
|
+
BigInt(numValue) > paymentConfig.maxEntriesPerUser) {
|
|
236
233
|
setIsQuantityValid(false);
|
|
237
234
|
setUserSpinQuantity("");
|
|
238
235
|
setValidationError(`Maximum ${paymentConfig.maxEntriesPerUser.toString()} spins allowed`);
|
|
@@ -266,7 +263,7 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
266
263
|
address: B3_TOKEN.address,
|
|
267
264
|
abi: erc20Abi,
|
|
268
265
|
functionName: "allowance",
|
|
269
|
-
args: [address, paymentConfig.entryModule]
|
|
266
|
+
args: [address, paymentConfig.entryModule],
|
|
270
267
|
});
|
|
271
268
|
// If allowance is insufficient, request approval
|
|
272
269
|
if (allowance < totalCost) {
|
|
@@ -275,7 +272,7 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
275
272
|
address: B3_TOKEN.address,
|
|
276
273
|
abi: erc20Abi,
|
|
277
274
|
functionName: "approve",
|
|
278
|
-
args: [paymentConfig.entryModule, totalCost]
|
|
275
|
+
args: [paymentConfig.entryModule, totalCost],
|
|
279
276
|
});
|
|
280
277
|
toast.info("Approval confirmed. Proceeding with spin purchase...");
|
|
281
278
|
}
|
|
@@ -285,7 +282,7 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
285
282
|
address: spinwheelContractAddress,
|
|
286
283
|
abi: SPIN_WHEEL_ABI,
|
|
287
284
|
functionName: "buyEntriesAndSpin",
|
|
288
|
-
args: [address, BigInt(userSpinQuantity)]
|
|
285
|
+
args: [address, BigInt(userSpinQuantity)],
|
|
289
286
|
});
|
|
290
287
|
setBuyingTxHash(buyHash);
|
|
291
288
|
toast.success("Spin purchase transaction submitted!");
|
|
@@ -332,7 +329,7 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
332
329
|
// Render quantity input prompt
|
|
333
330
|
if (showAmountPrompt) {
|
|
334
331
|
const pricePerEntry = formatUnits(paymentConfig.pricePerEntry, 18);
|
|
335
|
-
const remainingEntries = wheelInfo ? wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_ :
|
|
332
|
+
const remainingEntries = wheelInfo ? wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_ : BigInt(0);
|
|
336
333
|
const wheelStatus = wheelInfo ? getWheelStatus(wheelInfo) : null;
|
|
337
334
|
const isSoldOut = wheelStatus === "sold_out";
|
|
338
335
|
const isActive = wheelStatus === "active";
|
|
@@ -346,17 +343,17 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
346
343
|
case "not_started":
|
|
347
344
|
return {
|
|
348
345
|
title: "Spin Wheel Not Started",
|
|
349
|
-
message: `Starts at ${formatDate(wheelInfo.startTime_)}
|
|
346
|
+
message: `Starts at ${formatDate(wheelInfo.startTime_)}`,
|
|
350
347
|
};
|
|
351
348
|
case "ended":
|
|
352
349
|
return {
|
|
353
350
|
title: "Spin Wheel Ended",
|
|
354
|
-
message: `Ended at ${formatDate(wheelInfo.endTime_)}
|
|
351
|
+
message: `Ended at ${formatDate(wheelInfo.endTime_)}`,
|
|
355
352
|
};
|
|
356
353
|
case "sold_out":
|
|
357
354
|
return {
|
|
358
355
|
title: "All Spins Have Been Claimed",
|
|
359
|
-
message: "Stay tuned for the next spin wheel event!"
|
|
356
|
+
message: "Stay tuned for the next spin wheel event!",
|
|
360
357
|
};
|
|
361
358
|
default:
|
|
362
359
|
return null;
|
|
@@ -366,18 +363,18 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
366
363
|
return (_jsx(StyleRoot, { children: _jsxs("div", { className: "bg-b3-react-background flex w-full flex-col items-center", children: [_jsxs("div", { className: "w-full px-4 pb-2 pt-4", children: [_jsx(motion.div, { initial: false, animate: {
|
|
367
364
|
opacity: hasMounted ? 1 : 0,
|
|
368
365
|
y: hasMounted ? 0 : 20,
|
|
369
|
-
filter: hasMounted ? "blur(0px)" : "blur(10px)"
|
|
366
|
+
filter: hasMounted ? "blur(0px)" : "blur(10px)",
|
|
370
367
|
}, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, className: `flex justify-center ${isActive ? "mb-4" : ""}`, children: _jsx("img", { alt: "B3 Token", loading: "lazy", width: "64", height: "64", decoding: "async", className: "rounded-full", src: "https://cdn.b3.fun/b3-coin-3d.png" }) }), _jsx(motion.div, { initial: false, animate: {
|
|
371
368
|
opacity: hasMounted ? 1 : 0,
|
|
372
369
|
y: hasMounted ? 0 : 20,
|
|
373
|
-
filter: hasMounted ? "blur(0px)" : "blur(10px)"
|
|
370
|
+
filter: hasMounted ? "blur(0px)" : "blur(10px)",
|
|
374
371
|
}, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "text-center", children: isActive ? (_jsxs(_Fragment, { children: [_jsx("h2", { className: "font-sf-rounded text-as-primary mb-4 text-2xl font-bold", children: (() => {
|
|
375
372
|
const hasEnoughBalance = b3RawBalance && totalCost <= b3RawBalance;
|
|
376
373
|
return hasEnoughBalance || !debouncedQuantity ? "Buy Spins" : `Swap & Buy Spins`;
|
|
377
374
|
})() }), wheelInfo && (_jsxs("div", { className: "inline-flex items-center gap-2", children: [_jsx("div", { className: "bg-as-brand/10 border-as-brand/10 inline-flex items-center rounded-full border px-3 py-1", children: _jsxs("p", { className: "text-as-brand text-sm font-medium", children: [pricePerEntry, " $B3 per spin"] }) }), _jsx("div", { className: "bg-as-brand/10 border-as-brand/10 inline-flex items-center rounded-full border px-3 py-1", children: _jsxs("p", { className: "text-as-brand text-sm font-medium", children: [remainingEntries.toString(), " remaining"] }) })] }))] })) : (statusInfo && (_jsxs("div", { className: "text-center", children: [_jsx("p", { className: "text-as-primary text-lg font-semibold", children: statusInfo.title }), _jsx("p", { className: "text-as-primary/70 mt-2 text-sm", children: statusInfo.message })] }))) })] }), _jsx(motion.div, { initial: false, animate: {
|
|
378
375
|
opacity: hasMounted ? 1 : 0,
|
|
379
376
|
y: hasMounted ? 0 : 20,
|
|
380
|
-
filter: hasMounted ? "blur(0px)" : "blur(10px)"
|
|
377
|
+
filter: hasMounted ? "blur(0px)" : "blur(10px)",
|
|
381
378
|
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children: isActive ? (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("p", { className: "text-as-primary/70 text-sm font-medium", children: "Number of spins" }), _jsxs("span", { className: "text-as-primary/50 flex items-center gap-1 text-sm", children: ["Available: ", isBalanceLoading ? _jsx(Loader2, { className: "h-3 w-3 animate-spin" }) : `${b3Balance} B3`] })] }), _jsxs("div", { className: "relative", children: [_jsx(Input, { onFocus: onFocusQuantityInput, type: "text", placeholder: "1", value: displayQuantity, onChange: e => validateAndSetQuantity(e.target.value), className: `h-14 px-4 pr-20 text-lg ${!isQuantityValid && displayQuantity ? "border-as-red" : "border-b3-react-border"}` }), _jsx("div", { className: "font-pack absolute right-4 top-1/2 -translate-y-1/2 text-lg font-medium text-blue-500/70", children: displayQuantity === "1" ? "Spin" : "Spins" })] }), !isQuantityValid && displayQuantity && _jsx("p", { className: "text-as-red text-sm", children: validationError }), _jsx("div", { className: "bg-as-on-surface-2/30 rounded-lg border border-white/10 p-4 backdrop-blur-sm", children: _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-as-primary/70 text-sm font-medium", children: "Total Cost:" }), _jsx("div", { className: "flex items-center gap-2", children: _jsxs("span", { className: "text-as-primary text-lg font-bold", children: [displayQuantity && isQuantityValid ? formatUnits(totalCost, 18) : "0", " B3"] }) })] }) }), _jsx("div", { className: "mt-4", children: (() => {
|
|
382
379
|
const hasEnoughBalance = b3RawBalance && totalCost <= b3RawBalance;
|
|
383
380
|
if (!hasEnoughBalance && debouncedQuantity) {
|
|
@@ -388,6 +385,7 @@ export function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", s
|
|
|
388
385
|
// AnySpend flow for when user needs to swap to B3
|
|
389
386
|
const encodedData = generateEncodedDataForBuyEntriesAndSpin(address || "", userSpinQuantity);
|
|
390
387
|
return (_jsx(AnySpendCustom, { isMainnet: isMainnet, loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType: OrderType.Custom, dstChainId: chainId, dstToken: B3_TOKEN, dstAmount: totalCost.toString(), contractAddress: spinwheelContractAddress, spenderAddress: paymentConfig.entryModule, encodedData: encodedData, metadata: {
|
|
391
|
-
|
|
388
|
+
type: OrderType.Custom,
|
|
389
|
+
action: `buy ${userSpinQuantity} spin${userSpinQuantity !== "1" ? "s" : ""}`,
|
|
392
390
|
}, header: header, onSuccess: txHash => onSuccess?.(txHash), showRecipient: false }));
|
|
393
391
|
}
|