@b3dotfun/sdk 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/anyspend/abis/abi-usdc-base.js +97 -97
- package/dist/cjs/anyspend/abis/erc20-staking.js +51 -51
- package/dist/cjs/anyspend/abis/signature-minting.d.ts +79 -0
- package/dist/cjs/anyspend/abis/signature-minting.js +45 -0
- package/dist/cjs/anyspend/constants/index.js +13 -10
- package/dist/cjs/anyspend/index.d.ts +4 -2
- package/dist/cjs/anyspend/index.js +4 -4
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpend.js +69 -68
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +68 -66
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +4 -4
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +158 -101
- 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/AnySpendNFTButton.js +1 -1
- 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 +77 -0
- 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 +2 -0
- package/dist/cjs/anyspend/react/components/index.js +5 -1
- 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/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/signature-mint.d.ts +69 -0
- package/dist/cjs/anyspend/types/signature-mint.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 +13 -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 +18 -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 +97 -97
- package/dist/esm/anyspend/abis/erc20-staking.js +51 -51
- package/dist/esm/anyspend/abis/signature-minting.d.ts +79 -0
- package/dist/esm/anyspend/abis/signature-minting.js +42 -0
- package/dist/esm/anyspend/constants/index.js +13 -10
- package/dist/esm/anyspend/index.d.ts +4 -2
- package/dist/esm/anyspend/index.js +4 -4
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpend.js +23 -22
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +41 -39
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +4 -4
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +138 -81
- 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/AnySpendNFTButton.js +1 -1
- 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 +71 -0
- 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 +2 -0
- package/dist/esm/anyspend/react/components/index.js +2 -0
- 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/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/signature-mint.d.ts +69 -0
- package/dist/esm/anyspend/types/signature-mint.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 +14 -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 +18 -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/signature-minting.d.ts +79 -0
- package/dist/types/anyspend/index.d.ts +4 -2
- package/dist/types/anyspend/react/components/AnySpend.d.ts +1 -1
- package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +1 -1
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +4 -4
- package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +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 +2 -0
- 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/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/signature-mint.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 +18 -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 +24 -4
- package/src/anyspend/README.md +12 -0
- package/src/anyspend/abis/abi-usdc-base.ts +97 -97
- package/src/anyspend/abis/erc20-staking.ts +51 -51
- package/src/anyspend/abis/signature-minting.ts +43 -0
- package/src/anyspend/constants/index.ts +13 -11
- package/src/anyspend/index.ts +4 -6
- package/src/anyspend/react/components/AnySpend.tsx +44 -39
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +46 -41
- package/src/anyspend/react/components/AnySpendCustom.tsx +214 -89
- package/src/anyspend/react/components/AnySpendNFT.tsx +11 -6
- package/src/anyspend/react/components/AnySpendNFTButton.tsx +1 -1
- 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 +147 -0
- 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 +2 -0
- 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/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/signature-mint.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 +15 -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 +23 -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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OrderType } from "../../anyspend/types/index.js";
|
|
1
|
+
import { NftType, OrderType } from "../../anyspend/types/index.js";
|
|
2
2
|
import { normalizeAddress } from "../../anyspend/utils/index.js";
|
|
3
3
|
export const buildPayload = (orderType, params) => {
|
|
4
4
|
const { nft, tournament, payload, expectedDstAmount } = params;
|
|
@@ -6,22 +6,36 @@ export const buildPayload = (orderType, params) => {
|
|
|
6
6
|
case OrderType.Swap:
|
|
7
7
|
return {
|
|
8
8
|
expectedDstAmount,
|
|
9
|
-
actualDstAmount: null
|
|
9
|
+
actualDstAmount: null,
|
|
10
10
|
};
|
|
11
11
|
case OrderType.MintNFT:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
if (nft?.type === NftType.ERC1155) {
|
|
13
|
+
return {
|
|
14
|
+
contractAddress: normalizeAddress(nft.contractAddress),
|
|
15
|
+
nftPrice: nft?.price || "",
|
|
16
|
+
tokenId: nft?.tokenId,
|
|
17
|
+
contractType: nft?.type,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
else if (nft?.type === NftType.ERC721) {
|
|
21
|
+
return {
|
|
22
|
+
contractAddress: normalizeAddress(nft.contractAddress),
|
|
23
|
+
nftPrice: nft?.price || "",
|
|
24
|
+
contractType: nft?.type,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
throw new Error(`Invalid nft payload: ${JSON.stringify(nft)}`);
|
|
29
|
+
}
|
|
16
30
|
case OrderType.JoinTournament:
|
|
17
31
|
return {
|
|
18
32
|
contractAddress: tournament?.contractAddress,
|
|
19
|
-
entryPrice: tournament?.entryPriceOrFundAmount
|
|
33
|
+
entryPrice: tournament?.entryPriceOrFundAmount,
|
|
20
34
|
};
|
|
21
35
|
case OrderType.FundTournament:
|
|
22
36
|
return {
|
|
23
37
|
contractAddress: tournament?.contractAddress,
|
|
24
|
-
fundAmount: tournament?.entryPriceOrFundAmount
|
|
38
|
+
fundAmount: tournament?.entryPriceOrFundAmount,
|
|
25
39
|
};
|
|
26
40
|
case OrderType.Custom:
|
|
27
41
|
return { ...payload };
|
|
@@ -33,7 +47,7 @@ export const buildMetadata = (orderType, params) => {
|
|
|
33
47
|
const { srcToken, dstToken, nft, tournament, payload } = params;
|
|
34
48
|
const baseMetadata = {
|
|
35
49
|
srcToken,
|
|
36
|
-
dstToken
|
|
50
|
+
dstToken,
|
|
37
51
|
};
|
|
38
52
|
switch (orderType) {
|
|
39
53
|
case OrderType.Swap:
|
|
@@ -11,8 +11,8 @@ export function getSolanaToken() {
|
|
|
11
11
|
name: "Solana",
|
|
12
12
|
decimals: 9,
|
|
13
13
|
metadata: {
|
|
14
|
-
logoURI: "https://assets.relay.link/icons/square/792703809/light.png"
|
|
15
|
-
}
|
|
14
|
+
logoURI: "https://assets.relay.link/icons/square/792703809/light.png",
|
|
15
|
+
},
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
export function getEthToken(chainId) {
|
|
@@ -23,8 +23,8 @@ export function getEthToken(chainId) {
|
|
|
23
23
|
name: "Ethereum",
|
|
24
24
|
decimals: 18,
|
|
25
25
|
metadata: {
|
|
26
|
-
logoURI: "https://assets.relay.link/icons/square/1/light.png"
|
|
27
|
-
}
|
|
26
|
+
logoURI: "https://assets.relay.link/icons/square/1/light.png",
|
|
27
|
+
},
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
export function getPolToken() {
|
|
@@ -35,8 +35,8 @@ export function getPolToken() {
|
|
|
35
35
|
name: "Polygon",
|
|
36
36
|
decimals: 18,
|
|
37
37
|
metadata: {
|
|
38
|
-
logoURI: "https://s2.coinmarketcap.com/static/img/coins/64x64/28321.png"
|
|
39
|
-
}
|
|
38
|
+
logoURI: "https://s2.coinmarketcap.com/static/img/coins/64x64/28321.png",
|
|
39
|
+
},
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
export function getBnbToken() {
|
|
@@ -47,8 +47,8 @@ export function getBnbToken() {
|
|
|
47
47
|
name: "BNB",
|
|
48
48
|
decimals: 18,
|
|
49
49
|
metadata: {
|
|
50
|
-
logoURI: "https://s2.coinmarketcap.com/static/img/coins/64x64/1839.png"
|
|
51
|
-
}
|
|
50
|
+
logoURI: "https://s2.coinmarketcap.com/static/img/coins/64x64/1839.png",
|
|
51
|
+
},
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
export function getAvaxToken() {
|
|
@@ -59,7 +59,7 @@ export function getAvaxToken() {
|
|
|
59
59
|
name: "AVAX",
|
|
60
60
|
decimals: 18,
|
|
61
61
|
metadata: {
|
|
62
|
-
logoURI: "https://s2.coinmarketcap.com/static/img/coins/64x64/5805.png"
|
|
63
|
-
}
|
|
62
|
+
logoURI: "https://s2.coinmarketcap.com/static/img/coins/64x64/5805.png",
|
|
63
|
+
},
|
|
64
64
|
};
|
|
65
65
|
}
|
|
@@ -24,9 +24,9 @@ const app = createClient(socketio(socket), {
|
|
|
24
24
|
},
|
|
25
25
|
removeItem: (key) => {
|
|
26
26
|
Cookies.remove(key);
|
|
27
|
-
}
|
|
27
|
+
},
|
|
28
28
|
},
|
|
29
|
-
storageKey: B3_AUTH_COOKIE_NAME
|
|
29
|
+
storageKey: B3_AUTH_COOKIE_NAME,
|
|
30
30
|
});
|
|
31
31
|
export const authenticate = async (accessToken, identityToken, params) => {
|
|
32
32
|
const fullToken = `${accessToken}+${identityToken}`;
|
|
@@ -38,9 +38,9 @@ export const authenticate = async (accessToken, identityToken, params) => {
|
|
|
38
38
|
try {
|
|
39
39
|
const response = await app.authenticate({
|
|
40
40
|
strategy: "jwt",
|
|
41
|
-
accessToken: fullToken
|
|
41
|
+
accessToken: fullToken,
|
|
42
42
|
}, {
|
|
43
|
-
query: params || {}
|
|
43
|
+
query: params || {},
|
|
44
44
|
});
|
|
45
45
|
return response;
|
|
46
46
|
}
|
|
@@ -56,9 +56,9 @@ const app = createClient(socketio(socket), {
|
|
|
56
56
|
},
|
|
57
57
|
removeItem: (key) => {
|
|
58
58
|
localStorage.deleteItem(key);
|
|
59
|
-
}
|
|
59
|
+
},
|
|
60
60
|
},
|
|
61
|
-
storageKey: B3_AUTH_COOKIE_NAME
|
|
61
|
+
storageKey: B3_AUTH_COOKIE_NAME,
|
|
62
62
|
});
|
|
63
63
|
export const authenticate = async (accessToken, identityToken, params) => {
|
|
64
64
|
const fullToken = `${accessToken}+${identityToken}`;
|
|
@@ -70,9 +70,9 @@ export const authenticate = async (accessToken, identityToken, params) => {
|
|
|
70
70
|
try {
|
|
71
71
|
const response = await app.authenticate({
|
|
72
72
|
strategy: "jwt",
|
|
73
|
-
accessToken: fullToken
|
|
73
|
+
accessToken: fullToken,
|
|
74
74
|
}, {
|
|
75
|
-
query: params || {}
|
|
75
|
+
query: params || {},
|
|
76
76
|
});
|
|
77
77
|
return response;
|
|
78
78
|
}
|
|
@@ -28,9 +28,9 @@ const app = createClient(socketio(socket), {
|
|
|
28
28
|
},
|
|
29
29
|
removeItem: (key) => {
|
|
30
30
|
Cookies.remove(key);
|
|
31
|
-
}
|
|
31
|
+
},
|
|
32
32
|
},
|
|
33
|
-
storageKey: BSMNT_AUTH_COOKIE_NAME
|
|
33
|
+
storageKey: BSMNT_AUTH_COOKIE_NAME,
|
|
34
34
|
});
|
|
35
35
|
export const authenticate = async (accessToken, identityToken, params) => {
|
|
36
36
|
const fullToken = `${accessToken}+${identityToken}`;
|
|
@@ -42,9 +42,9 @@ export const authenticate = async (accessToken, identityToken, params) => {
|
|
|
42
42
|
try {
|
|
43
43
|
const response = await app.authenticate({
|
|
44
44
|
strategy: "b3-jwt",
|
|
45
|
-
accessToken: fullToken
|
|
45
|
+
accessToken: fullToken,
|
|
46
46
|
}, {
|
|
47
|
-
query: params || {}
|
|
47
|
+
query: params || {},
|
|
48
48
|
});
|
|
49
49
|
return response;
|
|
50
50
|
}
|
|
@@ -59,9 +59,9 @@ const app = createClient(socketio(socket), {
|
|
|
59
59
|
},
|
|
60
60
|
removeItem: (key) => {
|
|
61
61
|
localStorage.deleteItem(key);
|
|
62
|
-
}
|
|
62
|
+
},
|
|
63
63
|
},
|
|
64
|
-
storageKey: BSMNT_AUTH_COOKIE_NAME
|
|
64
|
+
storageKey: BSMNT_AUTH_COOKIE_NAME,
|
|
65
65
|
});
|
|
66
66
|
export const authenticate = async (accessToken, identityToken, params) => {
|
|
67
67
|
const fullToken = `${accessToken}+${identityToken}`;
|
|
@@ -73,9 +73,9 @@ export const authenticate = async (accessToken, identityToken, params) => {
|
|
|
73
73
|
try {
|
|
74
74
|
const response = await app.authenticate({
|
|
75
75
|
strategy: "jwt",
|
|
76
|
-
accessToken: fullToken
|
|
76
|
+
accessToken: fullToken,
|
|
77
77
|
}, {
|
|
78
|
-
query: params || {}
|
|
78
|
+
query: params || {},
|
|
79
79
|
});
|
|
80
80
|
return response;
|
|
81
81
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { AnySpend, AnySpendBuySpin, AnySpendNFT, AnySpendStakeB3, AnySpendTournament, OrderHistory } from "../../../anyspend/react/index.js";
|
|
2
|
+
import { AnySpend, AnySpendBuySpin, AnySpendNFT, AnySpendStakeB3, AnySpendTournament, AnyspendSignatureMint, OrderHistory, } from "../../../anyspend/react/index.js";
|
|
3
3
|
import { useIsMobile, useModalStore } from "../../../global-account/react/index.js";
|
|
4
4
|
import { debugB3React } from "../../../shared/utils/debug.js";
|
|
5
5
|
import { useB3 } from "./B3Provider/useB3.js";
|
|
@@ -24,11 +24,19 @@ export function B3DynamicModal() {
|
|
|
24
24
|
"anySpendStakeB3",
|
|
25
25
|
"anySpendBuySpin",
|
|
26
26
|
"anySpendOrderHistory",
|
|
27
|
-
"signInWithB3"
|
|
27
|
+
"signInWithB3",
|
|
28
|
+
"anySpendSignatureMint",
|
|
28
29
|
].find(type => contentType?.type === type)) {
|
|
29
30
|
contentClass += " max-h-[90dvh] overflow-y-auto no-scrollbar w-full";
|
|
30
31
|
}
|
|
31
|
-
if ([
|
|
32
|
+
if ([
|
|
33
|
+
"anySpendNft",
|
|
34
|
+
"anySpendJoinTournament",
|
|
35
|
+
"anySpendFundTournament",
|
|
36
|
+
"anySpendStakeB3",
|
|
37
|
+
"anySpendBuySpin",
|
|
38
|
+
"anySpendSignatureMint",
|
|
39
|
+
].find(type => contentType?.type === type)) {
|
|
32
40
|
// Due to the dynamic of (Pay with crypto),(Pay with fiat), we want the height fixed to 90dvh but still scrollable.
|
|
33
41
|
// NOTE: Just leave it here in case we want the fixed height
|
|
34
42
|
// contentClass += " min-h-[90dvh] b3-modal-freestyle";
|
|
@@ -67,6 +75,8 @@ export function B3DynamicModal() {
|
|
|
67
75
|
return _jsx(AnySpendStakeB3, { ...contentType, mode: "modal" });
|
|
68
76
|
case "anySpendBuySpin":
|
|
69
77
|
return _jsx(AnySpendBuySpin, { ...contentType, mode: "modal" });
|
|
78
|
+
case "anySpendSignatureMint":
|
|
79
|
+
return _jsx(AnyspendSignatureMint, { ...contentType, mode: "modal" });
|
|
70
80
|
// Add other modal types here
|
|
71
81
|
default:
|
|
72
82
|
return null;
|
|
@@ -76,5 +86,5 @@ export function B3DynamicModal() {
|
|
|
76
86
|
const ModalContent = isMobile ? DrawerContent : DialogContent;
|
|
77
87
|
const ModalTitle = isMobile ? DrawerTitle : DialogTitle;
|
|
78
88
|
const ModalDescription = isMobile ? DrawerDescription : DialogDescription;
|
|
79
|
-
return (_jsx(ModalComponent, { open: isOpen, onOpenChange: setB3ModalOpen, children: _jsxs(ModalContent, { className: contentClass, hideCloseButton: hideCloseButton, children: [_jsx(ModalTitle, { className: "sr-only hidden", children: contentType?.type || "Modal" }), _jsx(ModalDescription, { className: "sr-only hidden", children: contentType?.type || "Modal Body" }), _jsxs("div", { className: "overflow-
|
|
89
|
+
return (_jsx(ModalComponent, { open: isOpen, onOpenChange: setB3ModalOpen, children: _jsxs(ModalContent, { className: contentClass, hideCloseButton: hideCloseButton, children: [_jsx(ModalTitle, { className: "sr-only hidden", children: contentType?.type || "Modal" }), _jsx(ModalDescription, { className: "sr-only hidden", children: contentType?.type || "Modal Body" }), _jsxs("div", { className: "overflow-auto", children: [history.length > 0 && contentType?.showBackButton && (_jsxs("button", { onClick: navigateBack, className: "b3-modal-back-button mb-4 flex items-center gap-2 transition-colors hover:text-white", children: [_jsx("span", { children: "\u2190" }), _jsx("span", { className: "text-sm", children: "Back" })] })), renderContent()] })] }) }));
|
|
80
90
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { PermissionsConfig } from "../../../../global-account/types/permissions";
|
|
2
2
|
import { Account } from "thirdweb/wallets";
|
|
3
|
-
import "@reservoir0x/relay-kit-ui/styles.css";
|
|
4
3
|
import { B3ContextType } from "./types";
|
|
4
|
+
import "@reservoir0x/relay-kit-ui/styles.css";
|
|
5
5
|
export declare const wagmiConfig: import("wagmi").Config<readonly [import("viem").Chain, ...import("viem").Chain[]], any, readonly import("wagmi").CreateConnectorFn[]>;
|
|
6
6
|
/**
|
|
7
7
|
* Main B3Provider component
|
|
8
8
|
*/
|
|
9
|
-
export declare function B3Provider({ isMainnetAnySpend, theme, children, accountOverride, environment, automaticallySetFirstEoa }: {
|
|
9
|
+
export declare function B3Provider({ isMainnetAnySpend, theme, children, accountOverride, environment, automaticallySetFirstEoa, }: {
|
|
10
10
|
isMainnetAnySpend?: boolean;
|
|
11
11
|
theme: "light" | "dark";
|
|
12
12
|
children: React.ReactNode;
|
|
@@ -17,7 +17,7 @@ export declare function B3Provider({ isMainnetAnySpend, theme, children, account
|
|
|
17
17
|
/**
|
|
18
18
|
* Inner provider component that provides the actual B3Context
|
|
19
19
|
*/
|
|
20
|
-
export declare function InnerProvider({ children, accountOverride, environment, defaultPermissions, automaticallySetFirstEoa, theme }: {
|
|
20
|
+
export declare function InnerProvider({ children, accountOverride, environment, defaultPermissions, automaticallySetFirstEoa, theme, }: {
|
|
21
21
|
children: React.ReactNode;
|
|
22
22
|
accountOverride?: Account;
|
|
23
23
|
environment: B3ContextType["environment"];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { TooltipProvider } from "../../../../global-account/react/index.js";
|
|
2
3
|
import { supportedChains } from "../../../../shared/constants/chains/supported.js";
|
|
3
4
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
4
5
|
import { useEffect, useState } from "react";
|
|
@@ -7,8 +8,8 @@ import { ThirdwebProvider, useActiveAccount, useConnectedWallets, useSetActiveWa
|
|
|
7
8
|
import { createConfig, http, WagmiProvider } from "wagmi";
|
|
8
9
|
import { RelayKitProviderWrapper } from "../RelayKitProviderWrapper.js";
|
|
9
10
|
import { StyleRoot } from "../StyleRoot.js";
|
|
10
|
-
import "@reservoir0x/relay-kit-ui/styles.css";
|
|
11
11
|
import { B3Context } from "./types.js";
|
|
12
|
+
import "@reservoir0x/relay-kit-ui/styles.css";
|
|
12
13
|
/**
|
|
13
14
|
* Default permissions configuration for B3 provider
|
|
14
15
|
*/
|
|
@@ -16,24 +17,24 @@ const DEFAULT_PERMISSIONS = {
|
|
|
16
17
|
approvedTargets: ["0xa8e42121e318e3D3BeD7f5969AF6D360045317DD"], // Example contract
|
|
17
18
|
nativeTokenLimitPerTransaction: 0.1, // in ETH
|
|
18
19
|
startDate: new Date(),
|
|
19
|
-
endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365) // 1 year from now
|
|
20
|
+
endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year from now
|
|
20
21
|
};
|
|
21
22
|
export const wagmiConfig = createConfig({
|
|
22
23
|
chains: [supportedChains[0], ...supportedChains.slice(1)],
|
|
23
|
-
transports: Object.fromEntries(supportedChains.map(chain => [chain.id, http()]))
|
|
24
|
+
transports: Object.fromEntries(supportedChains.map(chain => [chain.id, http()])),
|
|
24
25
|
});
|
|
25
26
|
// Create queryClient instance
|
|
26
27
|
const queryClient = new QueryClient();
|
|
27
28
|
/**
|
|
28
29
|
* Main B3Provider component
|
|
29
30
|
*/
|
|
30
|
-
export function B3Provider({ isMainnetAnySpend = true, theme = "light", children, accountOverride, environment, automaticallySetFirstEoa }) {
|
|
31
|
-
return (_jsx(WagmiProvider, { config: wagmiConfig, children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx(ThirdwebProvider, { children: _jsx(InnerProvider, { accountOverride: accountOverride, environment: environment, theme: theme, automaticallySetFirstEoa: !!automaticallySetFirstEoa, children: _jsxs(RelayKitProviderWrapper, { isMainnet: isMainnetAnySpend, children: [children, _jsx(StyleRoot, { id: "b3-root" }), _jsx(Toaster, { theme: theme })] }) }) }) }) }));
|
|
31
|
+
export function B3Provider({ isMainnetAnySpend = true, theme = "light", children, accountOverride, environment, automaticallySetFirstEoa, }) {
|
|
32
|
+
return (_jsx(WagmiProvider, { config: wagmiConfig, children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx(ThirdwebProvider, { children: _jsx(TooltipProvider, { children: _jsx(InnerProvider, { accountOverride: accountOverride, environment: environment, theme: theme, automaticallySetFirstEoa: !!automaticallySetFirstEoa, children: _jsxs(RelayKitProviderWrapper, { isMainnet: isMainnetAnySpend, children: [children, _jsx(StyleRoot, { id: "b3-root" }), _jsx(Toaster, { theme: theme })] }) }) }) }) }) }));
|
|
32
33
|
}
|
|
33
34
|
/**
|
|
34
35
|
* Inner provider component that provides the actual B3Context
|
|
35
36
|
*/
|
|
36
|
-
export function InnerProvider({ children, accountOverride, environment, defaultPermissions = DEFAULT_PERMISSIONS, automaticallySetFirstEoa, theme = "light" }) {
|
|
37
|
+
export function InnerProvider({ children, accountOverride, environment, defaultPermissions = DEFAULT_PERMISSIONS, automaticallySetFirstEoa, theme = "light", }) {
|
|
37
38
|
const activeAccount = useActiveAccount();
|
|
38
39
|
const [manuallySetAccount, setManuallySetAccount] = useState(undefined);
|
|
39
40
|
const [manuallySelectedWallet, setManuallySelectedWallet] = useState(undefined);
|
|
@@ -77,6 +78,6 @@ export function InnerProvider({ children, accountOverride, environment, defaultP
|
|
|
77
78
|
automaticallySetFirstEoa,
|
|
78
79
|
environment,
|
|
79
80
|
defaultPermissions,
|
|
80
|
-
theme
|
|
81
|
+
theme,
|
|
81
82
|
}, children: children }));
|
|
82
83
|
}
|
|
@@ -4,7 +4,7 @@ import { B3ContextType } from "./types";
|
|
|
4
4
|
/**
|
|
5
5
|
* Main B3Provider component
|
|
6
6
|
*/
|
|
7
|
-
export declare function B3Provider({ isMainnetAnySpend, theme, children, accountOverride, environment }: {
|
|
7
|
+
export declare function B3Provider({ isMainnetAnySpend, theme, children, accountOverride, environment, }: {
|
|
8
8
|
isMainnetAnySpend?: boolean;
|
|
9
9
|
theme: "light" | "dark";
|
|
10
10
|
children: React.ReactNode;
|
|
@@ -14,7 +14,7 @@ export declare function B3Provider({ isMainnetAnySpend, theme, children, account
|
|
|
14
14
|
/**
|
|
15
15
|
* Inner provider component that provides the actual B3Context
|
|
16
16
|
*/
|
|
17
|
-
export declare function InnerProvider({ children, accountOverride, environment, defaultPermissions, theme }: {
|
|
17
|
+
export declare function InnerProvider({ children, accountOverride, environment, defaultPermissions, theme, }: {
|
|
18
18
|
children: React.ReactNode;
|
|
19
19
|
accountOverride?: Account;
|
|
20
20
|
environment: B3ContextType["environment"];
|
|
@@ -10,20 +10,20 @@ const DEFAULT_PERMISSIONS = {
|
|
|
10
10
|
approvedTargets: ["0xa8e42121e318e3D3BeD7f5969AF6D360045317DD"], // Example contract
|
|
11
11
|
nativeTokenLimitPerTransaction: 0.1, // in ETH
|
|
12
12
|
startDate: new Date(),
|
|
13
|
-
endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365) // 1 year from now
|
|
13
|
+
endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year from now
|
|
14
14
|
};
|
|
15
15
|
// Create queryClient instance
|
|
16
16
|
const queryClient = new QueryClient();
|
|
17
17
|
/**
|
|
18
18
|
* Main B3Provider component
|
|
19
19
|
*/
|
|
20
|
-
export function B3Provider({ isMainnetAnySpend = true, theme = "light", children, accountOverride, environment }) {
|
|
20
|
+
export function B3Provider({ isMainnetAnySpend = true, theme = "light", children, accountOverride, environment, }) {
|
|
21
21
|
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(ThirdwebProvider, { children: _jsx(InnerProvider, { accountOverride: accountOverride, environment: environment, theme: theme, children: children }) }) }));
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Inner provider component that provides the actual B3Context
|
|
25
25
|
*/
|
|
26
|
-
export function InnerProvider({ children, accountOverride, environment, defaultPermissions = DEFAULT_PERMISSIONS, theme = "light" }) {
|
|
26
|
+
export function InnerProvider({ children, accountOverride, environment, defaultPermissions = DEFAULT_PERMISSIONS, theme = "light", }) {
|
|
27
27
|
const activeAccount = useActiveAccount();
|
|
28
28
|
const [manuallySetAccount, setManuallySetAccount] = useState(undefined);
|
|
29
29
|
const [user, setUser] = useState(undefined);
|
|
@@ -44,6 +44,6 @@ export function InnerProvider({ children, accountOverride, environment, defaultP
|
|
|
44
44
|
ready: !!effectiveAccount,
|
|
45
45
|
environment,
|
|
46
46
|
defaultPermissions,
|
|
47
|
-
theme
|
|
47
|
+
theme,
|
|
48
48
|
}, children: children }));
|
|
49
49
|
}
|
|
@@ -7,5 +7,5 @@ interface ManageAccountProps {
|
|
|
7
7
|
chain: Chain;
|
|
8
8
|
partnerId: string;
|
|
9
9
|
}
|
|
10
|
-
export declare function ManageAccount({ onLogout, onSwap: _onSwap, onDeposit: _onDeposit, chain, partnerId }: ManageAccountProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function ManageAccount({ onLogout, onSwap: _onSwap, onDeposit: _onDeposit, chain, partnerId, }: ManageAccountProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, CopyToClipboard, useAccountAssets, useAuthentication, useB3BalanceFromAddresses, useGetAllTWSigners, useNativeBalance, useRemoveSessionKey, useModalStore, TabsPrimitive, TabsContentPrimitive, TabsListPrimitive, TabTriggerPrimitive } from "../../../../global-account/react/index.js";
|
|
2
|
+
import { Button, CopyToClipboard, useAccountAssets, useAuthentication, useB3BalanceFromAddresses, useGetAllTWSigners, useNativeBalance, useRemoveSessionKey, useModalStore, TabsPrimitive, TabsContentPrimitive, TabsListPrimitive, TabTriggerPrimitive, } from "../../../../global-account/react/index.js";
|
|
3
3
|
import { formatAddress } from "../../../../shared/utils/formatAddress.js";
|
|
4
4
|
import { formatNumber } from "../../../../shared/utils/formatNumber.js";
|
|
5
5
|
import { ArrowRightLeft } from "lucide-react";
|
|
@@ -12,7 +12,7 @@ function centerTruncate(str, length = 4) {
|
|
|
12
12
|
return str;
|
|
13
13
|
return `${str.slice(0, length)}...${str.slice(-length)}`;
|
|
14
14
|
}
|
|
15
|
-
export function ManageAccount({ onLogout, onSwap: _onSwap, onDeposit: _onDeposit, chain, partnerId }) {
|
|
15
|
+
export function ManageAccount({ onLogout, onSwap: _onSwap, onDeposit: _onDeposit, chain, partnerId, }) {
|
|
16
16
|
const [activeTab, setActiveTab] = useState("balance");
|
|
17
17
|
const [revokingSignerId, setRevokingSignerId] = useState(null);
|
|
18
18
|
const account = useActiveAccount();
|
|
@@ -21,7 +21,7 @@ export function ManageAccount({ onLogout, onSwap: _onSwap, onDeposit: _onDeposit
|
|
|
21
21
|
const { data: nativeBalance } = useNativeBalance(account?.address);
|
|
22
22
|
const { data: signers, refetch: refetchSigners } = useGetAllTWSigners({
|
|
23
23
|
chain,
|
|
24
|
-
accountAddress: account?.address
|
|
24
|
+
accountAddress: account?.address,
|
|
25
25
|
});
|
|
26
26
|
const { setB3ModalOpen, setB3ModalContentType } = useModalStore();
|
|
27
27
|
const { logout } = useAuthentication(partnerId);
|
|
@@ -37,7 +37,7 @@ export function ManageAccount({ onLogout, onSwap: _onSwap, onDeposit: _onDeposit
|
|
|
37
37
|
console.error("Error revoking access:", error);
|
|
38
38
|
setRevokingSignerId(null);
|
|
39
39
|
},
|
|
40
|
-
refetchSigners: () => refetchSigners()
|
|
40
|
+
refetchSigners: () => refetchSigners(),
|
|
41
41
|
});
|
|
42
42
|
const handleRevoke = async (signer) => {
|
|
43
43
|
setRevokingSignerId(signer.id);
|
|
@@ -55,13 +55,13 @@ export function ManageAccount({ onLogout, onSwap: _onSwap, onDeposit: _onDeposit
|
|
|
55
55
|
setB3ModalContentType({
|
|
56
56
|
type: "anySpend",
|
|
57
57
|
defaultActiveTab: "fiat",
|
|
58
|
-
showBackButton: true
|
|
58
|
+
showBackButton: true,
|
|
59
59
|
});
|
|
60
60
|
}, children: "Deposit" }), _jsxs(Button, { variant: "default", className: "font-neue-montreal-medium flex-1", onClick: () => {
|
|
61
61
|
setB3ModalOpen(true);
|
|
62
62
|
setB3ModalContentType({
|
|
63
63
|
type: "anySpend",
|
|
64
|
-
showBackButton: true
|
|
64
|
+
showBackButton: true,
|
|
65
65
|
});
|
|
66
66
|
}, children: [_jsx(ArrowRightLeft, { className: "mr-2 h-4 w-4" }), "Swap"] })] })] }));
|
|
67
67
|
const AssetsContent = () => (_jsx("div", { className: "bg-b3-react-card border-b3-react-border rounded-lg border p-4", children: _jsx(AccountAssets, { nfts: assets?.nftResponse, isLoading: isLoading }) }));
|
|
@@ -13,5 +13,5 @@ interface MintButtonProps {
|
|
|
13
13
|
onSuccess?: (tx: `0x${string}`) => void;
|
|
14
14
|
onError?: (error: Error) => void;
|
|
15
15
|
}
|
|
16
|
-
export declare function MintButton({ contractAddress, quantity, chain, account, to, tokenId, className, children, onSuccess, onError }: MintButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function MintButton({ contractAddress, quantity, chain, account, to, tokenId, className, children, onSuccess, onError, }: MintButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
export {};
|
|
@@ -3,7 +3,7 @@ import { Button, useClaim } from "../../../../global-account/react/index.js";
|
|
|
3
3
|
import { client } from "../../../../shared/utils/thirdweb.js";
|
|
4
4
|
import { useActiveAccount } from "thirdweb/react";
|
|
5
5
|
import { smartWallet } from "thirdweb/wallets";
|
|
6
|
-
export function MintButton({ contractAddress, quantity = 1, chain, account, to, tokenId, className, children = "Mint", onSuccess, onError }) {
|
|
6
|
+
export function MintButton({ contractAddress, quantity = 1, chain, account, to, tokenId, className, children = "Mint", onSuccess, onError, }) {
|
|
7
7
|
const ecoSystemWallet = useActiveAccount();
|
|
8
8
|
console.log("@@ecoSystemWallet", ecoSystemWallet);
|
|
9
9
|
const { claim, isMinting } = useClaim({
|
|
@@ -11,7 +11,7 @@ export function MintButton({ contractAddress, quantity = 1, chain, account, to,
|
|
|
11
11
|
quantity,
|
|
12
12
|
chain,
|
|
13
13
|
to,
|
|
14
|
-
tokenId
|
|
14
|
+
tokenId,
|
|
15
15
|
});
|
|
16
16
|
const smartAccountWithSignerOverride = ecoSystemWallet?.address !== to;
|
|
17
17
|
const handleMint = async () => {
|
|
@@ -21,12 +21,12 @@ export function MintButton({ contractAddress, quantity = 1, chain, account, to,
|
|
|
21
21
|
chain,
|
|
22
22
|
sponsorGas: true,
|
|
23
23
|
overrides: {
|
|
24
|
-
accountAddress: ecoSystemWallet?.address
|
|
25
|
-
}
|
|
24
|
+
accountAddress: ecoSystemWallet?.address,
|
|
25
|
+
},
|
|
26
26
|
});
|
|
27
27
|
const smartAccountWithSigner = await wallet.connect({
|
|
28
28
|
client,
|
|
29
|
-
personalAccount: account
|
|
29
|
+
personalAccount: account,
|
|
30
30
|
});
|
|
31
31
|
const tx = await claim(smartAccountWithSigner);
|
|
32
32
|
onSuccess?.(tx);
|
|
@@ -16,11 +16,11 @@ export function RelayKitProviderWrapper({ isMainnet, children }) {
|
|
|
16
16
|
source: "anyspend",
|
|
17
17
|
duneConfig: {
|
|
18
18
|
apiKey: "OkvN2bWlBPwXkvtmnTeYMQR1hYZBGDJt",
|
|
19
|
-
apiBaseUrl: "https://api.dune.com"
|
|
19
|
+
apiBaseUrl: "https://api.dune.com",
|
|
20
20
|
},
|
|
21
21
|
chains: relayChains,
|
|
22
22
|
privateChainIds: undefined,
|
|
23
23
|
appName: "AnySpend",
|
|
24
|
-
useGasFeeEstimations: true
|
|
24
|
+
useGasFeeEstimations: true,
|
|
25
25
|
}, children: _jsx(_Fragment, { children: children }) }));
|
|
26
26
|
}
|
|
@@ -3,4 +3,4 @@ import { RequestPermissionsModalProps } from "../../../../global-account/react";
|
|
|
3
3
|
* Component for requesting permissions to access user accounts and contracts
|
|
4
4
|
* Allows users to approve session keys with specific permission settings
|
|
5
5
|
*/
|
|
6
|
-
export declare function RequestPermissions({ onSuccess, onError, chain, sessionKeyAddress, permissions }: RequestPermissionsModalProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function RequestPermissions({ onSuccess, onError, chain, sessionKeyAddress, permissions, }: RequestPermissionsModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, useB3, useAddTWSessionKey, useGetAllTWSigners } from "../../../../global-account/react/index.js";
|
|
2
|
+
import { Button, useB3, useAddTWSessionKey, useGetAllTWSigners, } from "../../../../global-account/react/index.js";
|
|
3
3
|
import { PermissionItem } from "../../../../global-account/react/index.js";
|
|
4
4
|
import { debugB3React } from "../../../../shared/utils/debug.js";
|
|
5
5
|
import { formatAddress } from "../../../../shared/utils/formatAddress.js";
|
|
@@ -12,14 +12,14 @@ const debug = debugB3React("RequestPermissions");
|
|
|
12
12
|
* Component for requesting permissions to access user accounts and contracts
|
|
13
13
|
* Allows users to approve session keys with specific permission settings
|
|
14
14
|
*/
|
|
15
|
-
export function RequestPermissions({ onSuccess, onError, chain, sessionKeyAddress, permissions }) {
|
|
15
|
+
export function RequestPermissions({ onSuccess, onError, chain, sessionKeyAddress, permissions, }) {
|
|
16
16
|
const [isApproving, setIsApproving] = useState(false);
|
|
17
17
|
const account = useActiveAccount();
|
|
18
18
|
const { defaultPermissions } = useB3();
|
|
19
19
|
const DEFAULT_PERMISSIONS = useMemo(() => permissions ?? defaultPermissions, [defaultPermissions, permissions]);
|
|
20
20
|
const { refetch: refetchSigners } = useGetAllTWSigners({
|
|
21
21
|
chain,
|
|
22
|
-
accountAddress: account?.address
|
|
22
|
+
accountAddress: account?.address,
|
|
23
23
|
});
|
|
24
24
|
const { newSessionKey } = useAddTWSessionKey({
|
|
25
25
|
onSuccess: transactionResult => {
|
|
@@ -33,7 +33,7 @@ export function RequestPermissions({ onSuccess, onError, chain, sessionKeyAddres
|
|
|
33
33
|
refetchSigners: () => {
|
|
34
34
|
return refetchSigners();
|
|
35
35
|
},
|
|
36
|
-
chain
|
|
36
|
+
chain,
|
|
37
37
|
});
|
|
38
38
|
const handleApprove = useCallback(async () => {
|
|
39
39
|
debug("@@handleApprove");
|
|
@@ -48,7 +48,7 @@ export function RequestPermissions({ onSuccess, onError, chain, sessionKeyAddres
|
|
|
48
48
|
approvedTargets: DEFAULT_PERMISSIONS.approvedTargets,
|
|
49
49
|
nativeTokenLimitPerTransaction: DEFAULT_PERMISSIONS.nativeTokenLimitPerTransaction,
|
|
50
50
|
permissionStartTimestamp: DEFAULT_PERMISSIONS.startDate,
|
|
51
|
-
permissionEndTimestamp: DEFAULT_PERMISSIONS.endDate
|
|
51
|
+
permissionEndTimestamp: DEFAULT_PERMISSIONS.endDate,
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
catch (error) {
|
|
@@ -62,7 +62,7 @@ export function RequestPermissions({ onSuccess, onError, chain, sessionKeyAddres
|
|
|
62
62
|
const formatDate = (date) => {
|
|
63
63
|
return new Intl.DateTimeFormat("en-US", {
|
|
64
64
|
dateStyle: "medium",
|
|
65
|
-
timeStyle: "short"
|
|
65
|
+
timeStyle: "short",
|
|
66
66
|
}).format(date);
|
|
67
67
|
};
|
|
68
68
|
return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "text-center", children: [_jsx("h2", { className: "mb-2 text-2xl font-bold", children: "Allow Access" }), _jsx("p", { className: "text-b3-react-muted-foreground opacity-70", children: "This app would like permission to:" })] }), _jsx(PermissionItem, { title: "Make transactions on your behalf", description: _jsxs("span", { children: ["Up to", " ", _jsxs("span", { className: "text-b3-react-primary font-medium", children: [DEFAULT_PERMISSIONS.nativeTokenLimitPerTransaction, " ETH"] }), " ", "per transaction"] }), icon: _jsx(CreditCard, { className: "h-5 w-5" }) }), _jsx(PermissionItem, { title: "View your account", description: "See your wallet address and balance", icon: _jsx(Eye, { className: "h-5 w-5" }) }), _jsxs("div", { className: "bg-b3-react-card rounded-lg border p-5 py-4", children: [_jsx("h3", { className: "mb-2 text-base font-medium", children: "Approved Contracts" }), _jsx("div", { className: "space-y-2", children: DEFAULT_PERMISSIONS.approvedTargets.map((target) => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "bg-b3-react-background text-b3-react-muted-foreground rounded-md border px-3 py-2 font-mono text-sm", children: formatAddress(target) }), _jsx("span", { className: "text-b3-react-muted-foreground text-sm", children: "\u2022 Game Contract" })] }, target))) })] }), _jsxs("div", { className: "bg-b3-react-card rounded-lg border p-5 py-4", children: [_jsx("h3", { className: "mb-2 text-base font-medium", children: "Permission" }), _jsxs("div", { className: "space-y-1 text-sm", children: [_jsxs("div", { className: "text-b3-react-muted-foreground", children: [_jsx("span", { children: `Valid for ` }), _jsx("span", { children: _jsx(TimeAgo, { date: DEFAULT_PERMISSIONS.endDate, live: false, formatter: (value, unit) => {
|
package/dist/esm/global-account/react/components/RequestPermissions/RequestPermissionsButton.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ type RequestPermissionsButtonProps = {
|
|
|
7
7
|
permissions?: PermissionsConfig;
|
|
8
8
|
closeOnSuccess?: boolean;
|
|
9
9
|
};
|
|
10
|
-
export declare function RequestPermissionsButton({ chain, sessionKeyAddress, onSuccess, onError, permissions, closeOnSuccess }: RequestPermissionsButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function RequestPermissionsButton({ chain, sessionKeyAddress, onSuccess, onError, permissions, closeOnSuccess, }: RequestPermissionsButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
package/dist/esm/global-account/react/components/RequestPermissions/RequestPermissionsButton.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button, useModalStore } from "../../../../global-account/react/index.js";
|
|
3
|
-
export function RequestPermissionsButton({ chain, sessionKeyAddress, onSuccess, onError, permissions, closeOnSuccess = true }) {
|
|
3
|
+
export function RequestPermissionsButton({ chain, sessionKeyAddress, onSuccess, onError, permissions, closeOnSuccess = true, }) {
|
|
4
4
|
const { setB3ModalOpen, setB3ModalContentType } = useModalStore();
|
|
5
5
|
const handleClick = () => {
|
|
6
6
|
setB3ModalContentType({
|
|
@@ -14,7 +14,7 @@ export function RequestPermissionsButton({ chain, sessionKeyAddress, onSuccess,
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
onError,
|
|
17
|
-
permissions
|
|
17
|
+
permissions,
|
|
18
18
|
});
|
|
19
19
|
setB3ModalOpen(true);
|
|
20
20
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SignInWithB3ModalProps } from "../../../../global-account/react";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
type SignInProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
isMobile?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type SignInWithB3Props = Omit<SignInWithB3ModalProps, "type" | "showBackButton"> & {
|
|
8
|
+
buttonText?: string | ReactNode;
|
|
9
|
+
loggedInButtonText?: string | ReactNode;
|
|
10
|
+
loadingButtonText?: string | ReactNode;
|
|
11
|
+
withLogo?: boolean;
|
|
12
|
+
} & SignInProps;
|
|
13
|
+
export declare function SignIn(props: SignInWithB3Props): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default SignIn;
|