@b3dotfun/sdk 0.0.7-alpha.13 → 0.0.7-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/anyspend/abis/abi-usdc-base.js +97 -97
- package/dist/cjs/anyspend/abis/erc20-staking.js +51 -51
- package/dist/cjs/anyspend/constants/index.js +10 -10
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpend.js +20 -20
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +32 -32
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +29 -29
- package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendNFT.js +4 -4
- 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 +17 -17
- package/dist/cjs/anyspend/react/components/AnySpendTournament.js +4 -4
- 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 +9 -9
- 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 +2 -2
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +7 -7
- 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 +12 -12
- package/dist/cjs/anyspend/react/components/common/TokenBalance.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/common/TokenBalance.js +2 -2
- package/dist/cjs/anyspend/react/components/index.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/index.js +3 -1
- package/dist/cjs/anyspend/react/components/modals/EnterRecipientModal.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/modals/EnterRecipientModal.js +1 -1
- package/dist/cjs/anyspend/react/components/webview/WebviewOnrampPayment.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/webview/WebviewOnrampPayment.js +14 -14
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +6 -6
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +6 -6
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderAndTransactions.js +2 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.js +3 -3
- package/dist/cjs/anyspend/react/hooks/useAnyspendQuote.js +2 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendSendPermitData.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/usePermitData.js +19 -19
- 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 +3 -3
- package/dist/cjs/anyspend/services/anyspend.d.ts +1 -1
- package/dist/cjs/anyspend/services/anyspend.js +13 -13
- package/dist/cjs/anyspend/types/custom.js +2 -2
- package/dist/cjs/anyspend/types/globalWallet.js +1 -1
- package/dist/cjs/anyspend/types/nft.js +6 -6
- package/dist/cjs/anyspend/types/onramp.js +1 -1
- package/dist/cjs/anyspend/types/order.js +7 -7
- package/dist/cjs/anyspend/types/permit.js +1 -1
- 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.js +4 -4
- package/dist/cjs/anyspend/types/req-res/getOrderByCreator.js +2 -2
- package/dist/cjs/anyspend/types/req-res/getOrderHistory.js +1 -1
- package/dist/cjs/anyspend/types/req-res/getQuote.js +8 -8
- package/dist/cjs/anyspend/types/req-res/getTokenList.js +3 -3
- package/dist/cjs/anyspend/types/req-res/sendPermitData.js +2 -2
- 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 -2
- package/dist/cjs/anyspend/utils/orderPayload.js +6 -6
- 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 +1 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +2 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +5 -5
- 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.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3.js +1 -1
- 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/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.js +1 -1
- package/dist/cjs/global-account/react/components/custom/ManageAccountButton.js +1 -1
- 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/hooks/useAccountAssets.js +4 -4
- package/dist/cjs/global-account/react/hooks/useAccountWallet.js +4 -4
- 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.js +5 -5
- 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 +10 -10
- 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.js +3 -3
- package/dist/cjs/global-account/server.js +3 -3
- package/dist/cjs/global-account/types/chain-networks.js +8 -8
- package/dist/cjs/global-account/types/feature-flags.js +1 -1
- package/dist/cjs/shared/constants/chains/b3Chain.js +35 -35
- package/dist/cjs/shared/constants/chains/chainPlatformMap.js +1 -1
- package/dist/cjs/shared/constants/chains/supported.js +1 -1
- package/dist/cjs/shared/constants/index.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/insights.js +28 -28
- package/dist/cjs/shared/utils/ipfs.js +1 -1
- package/dist/cjs/shared/utils/number.js +3 -3
- package/dist/cjs/shared/utils/simplehash.js +22 -22
- package/dist/cjs/shared/utils/thirdweb-insights.js +15 -15
- package/dist/esm/anyspend/abis/abi-usdc-base.js +97 -97
- package/dist/esm/anyspend/abis/erc20-staking.js +51 -51
- package/dist/esm/anyspend/constants/index.js +10 -10
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpend.js +22 -22
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +33 -33
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +31 -31
- package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpendNFT.js +4 -4
- 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 +18 -18
- package/dist/esm/anyspend/react/components/AnySpendTournament.js +4 -4
- 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 +12 -12
- 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 +2 -2
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.d.ts +1 -1
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +8 -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 +12 -12
- package/dist/esm/anyspend/react/components/common/TokenBalance.d.ts +1 -1
- package/dist/esm/anyspend/react/components/common/TokenBalance.js +2 -2
- package/dist/esm/anyspend/react/components/index.d.ts +1 -0
- package/dist/esm/anyspend/react/components/index.js +1 -0
- package/dist/esm/anyspend/react/components/modals/EnterRecipientModal.d.ts +1 -1
- package/dist/esm/anyspend/react/components/modals/EnterRecipientModal.js +1 -1
- package/dist/esm/anyspend/react/components/webview/WebviewOnrampPayment.d.ts +1 -1
- package/dist/esm/anyspend/react/components/webview/WebviewOnrampPayment.js +15 -15
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +6 -6
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +6 -6
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.js +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.js +3 -3
- package/dist/esm/anyspend/react/hooks/useAnyspendQuote.js +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendSendPermitData.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/usePermitData.js +19 -19
- 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 +3 -3
- package/dist/esm/anyspend/services/anyspend.d.ts +1 -1
- package/dist/esm/anyspend/services/anyspend.js +14 -14
- package/dist/esm/anyspend/types/custom.js +2 -2
- package/dist/esm/anyspend/types/globalWallet.js +1 -1
- package/dist/esm/anyspend/types/nft.js +6 -6
- package/dist/esm/anyspend/types/onramp.js +1 -1
- package/dist/esm/anyspend/types/order.js +7 -7
- package/dist/esm/anyspend/types/permit.js +1 -1
- 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.js +4 -4
- package/dist/esm/anyspend/types/req-res/getOrderByCreator.js +2 -2
- package/dist/esm/anyspend/types/req-res/getOrderHistory.js +1 -1
- package/dist/esm/anyspend/types/req-res/getQuote.js +8 -8
- package/dist/esm/anyspend/types/req-res/getTokenList.js +3 -3
- package/dist/esm/anyspend/types/req-res/sendPermitData.js +2 -2
- 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 -2
- package/dist/esm/anyspend/utils/orderPayload.js +6 -6
- 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 +2 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +2 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +5 -5
- 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.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3.js +2 -2
- 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/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.js +1 -1
- package/dist/esm/global-account/react/components/custom/ManageAccountButton.js +1 -1
- 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/hooks/useAccountAssets.js +4 -4
- package/dist/esm/global-account/react/hooks/useAccountWallet.js +4 -4
- 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.js +5 -5
- 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 +10 -10
- 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.js +3 -3
- package/dist/esm/global-account/server.js +3 -3
- package/dist/esm/global-account/types/chain-networks.js +8 -8
- package/dist/esm/global-account/types/feature-flags.js +1 -1
- package/dist/esm/shared/constants/chains/b3Chain.js +35 -35
- package/dist/esm/shared/constants/chains/chainPlatformMap.js +1 -1
- package/dist/esm/shared/constants/chains/supported.js +1 -1
- package/dist/esm/shared/constants/index.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/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/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 +2 -2
- package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +1 -1
- package/dist/types/anyspend/react/components/AnySpendStakeB3.d.ts +1 -1
- package/dist/types/anyspend/react/components/common/ChainTokenIcon.d.ts +1 -1
- package/dist/types/anyspend/react/components/common/OrderToken.d.ts +1 -1
- package/dist/types/anyspend/react/components/common/OrderTokenAmount.d.ts +1 -1
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +1 -1
- package/dist/types/anyspend/react/components/common/PanelOnrampPayment.d.ts +1 -1
- package/dist/types/anyspend/react/components/common/TokenBalance.d.ts +1 -1
- package/dist/types/anyspend/react/components/index.d.ts +1 -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/services/anyspend.d.ts +1 -1
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +2 -2
- 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/SignInWithB3Flow.d.ts +1 -1
- package/dist/types/global-account/react/components/SignInWithB3/components/AuthButton.d.ts +1 -1
- package/dist/types/global-account/react/components/SignInWithB3/components/WalletRow.d.ts +1 -1
- package/dist/types/global-account/react/components/SignInWithB3/steps/LoginStepCustom.d.ts +1 -1
- package/dist/types/global-account/react/components/index.d.ts +4 -4
- package/dist/types/global-account/react/components/ui/ShinyButton.d.ts +1 -1
- package/dist/types/global-account/react/components/ui/Tabs.d.ts +1 -1
- package/dist/types/global-account/react/components/ui/command.d.ts +1 -1
- package/dist/types/global-account/react/components/ui/dialog.d.ts +1 -1
- package/dist/types/global-account/react/components/ui/drawer.d.ts +1 -1
- package/dist/types/global-account/react/components/ui/text-loop.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useAddTWSessionKey.d.ts +2 -2
- package/dist/types/global-account/react/hooks/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/package.json +1 -1
- package/src/anyspend/abis/abi-usdc-base.ts +97 -97
- package/src/anyspend/abis/erc20-staking.ts +51 -51
- package/src/anyspend/constants/index.ts +10 -10
- package/src/anyspend/react/components/AnySpend.tsx +32 -32
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +34 -34
- package/src/anyspend/react/components/AnySpendCustom.tsx +39 -39
- package/src/anyspend/react/components/AnySpendNFT.tsx +4 -4
- package/src/anyspend/react/components/AnySpendNFTButton.tsx +1 -1
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +18 -18
- package/src/anyspend/react/components/AnySpendTournament.tsx +4 -4
- package/src/anyspend/react/components/common/ChainTokenIcon.tsx +1 -1
- package/src/anyspend/react/components/common/OrderDetails.tsx +15 -15
- 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 +3 -3
- package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +8 -8
- 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 +14 -14
- package/src/anyspend/react/components/common/TokenBalance.tsx +2 -2
- package/src/anyspend/react/components/index.ts +1 -0
- package/src/anyspend/react/components/modals/EnterRecipientModal.tsx +1 -1
- package/src/anyspend/react/components/webview/WebviewOnrampPayment.tsx +18 -18
- package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +7 -7
- package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +7 -7
- 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 +5 -5
- package/src/anyspend/react/hooks/useAnyspendSendPermitData.ts +3 -3
- package/src/anyspend/react/hooks/useAnyspendTokens.ts +4 -4
- package/src/anyspend/react/hooks/useCoinbaseOnrampOptions.ts +3 -3
- package/src/anyspend/react/hooks/useGeoOnrampOptions.ts +3 -3
- package/src/anyspend/react/hooks/useGetGeo.ts +1 -1
- package/src/anyspend/react/hooks/usePermitData.ts +19 -19
- 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 +3 -3
- package/src/anyspend/services/anyspend.ts +23 -23
- 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/nft.ts +7 -7
- package/src/anyspend/types/onramp.ts +2 -2
- package/src/anyspend/types/order.ts +9 -9
- package/src/anyspend/types/permit.ts +1 -1
- 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 +8 -8
- package/src/anyspend/types/req-res/getTokenList.ts +4 -4
- package/src/anyspend/types/req-res/sendPermitData.ts +2 -2
- 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 -2
- package/src/anyspend/utils/orderPayload.ts +6 -6
- 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 +3 -3
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +4 -4
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +5 -5
- 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 +4 -4
- package/src/global-account/react/components/SignInWithB3/SignInWithB3.tsx +2 -2
- 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/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 +1 -1
- package/src/global-account/react/components/custom/ManageAccountButton.tsx +1 -1
- 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 +1 -1
- package/src/global-account/react/hooks/useAccountAssets.ts +4 -4
- package/src/global-account/react/hooks/useAccountWallet.tsx +5 -5
- 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 +6 -6
- 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 +11 -11
- 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 +3 -3
- package/src/global-account/server.ts +3 -3
- package/src/global-account/types/chain-networks.ts +10 -10
- package/src/global-account/types/feature-flags.ts +2 -2
- package/src/shared/constants/chains/b3Chain.ts +35 -35
- package/src/shared/constants/chains/chainPlatformMap.ts +1 -1
- package/src/shared/constants/chains/supported.ts +1 -1
- package/src/shared/constants/index.ts +1 -1
- 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/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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { Dialog, DialogContent, Input, ShinyButton } from "../../../../global-account/react/index.js";
|
|
4
|
-
export function EnterRecipientModal({ isOpenPasteRecipientAddress, setIsOpenPasteRecipientAddress, recipientAddress, setRecipientAddress }) {
|
|
4
|
+
export function EnterRecipientModal({ isOpenPasteRecipientAddress, setIsOpenPasteRecipientAddress, recipientAddress, setRecipientAddress, }) {
|
|
5
5
|
const [modalRecipientAddress, setModalRecipientAddress] = useState(recipientAddress || "");
|
|
6
6
|
useEffect(() => {
|
|
7
7
|
setModalRecipientAddress(recipientAddress || "");
|
|
@@ -8,5 +8,5 @@ interface WebviewOnrampPaymentProps {
|
|
|
8
8
|
onPaymentSuccess: (orderId: string) => void;
|
|
9
9
|
userId?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare function WebviewOnrampPayment({ srcAmountOnRamp, recipientAddress, destinationToken, anyspendQuote, onPaymentSuccess, userId, partnerId }: WebviewOnrampPaymentProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function WebviewOnrampPayment({ srcAmountOnRamp, recipientAddress, destinationToken, anyspendQuote, onPaymentSuccess, userId, partnerId, }: WebviewOnrampPaymentProps): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getChainName, OnrampVendor, OrderType, STRIPE_CONFIG, useAnyspendCreateOnrampOrder, useGeoOnrampOptions, useStripeClientSecret } from "../../../../anyspend/index.js";
|
|
2
|
+
import { getChainName, OnrampVendor, OrderType, STRIPE_CONFIG, useAnyspendCreateOnrampOrder, useGeoOnrampOptions, useStripeClientSecret, } from "../../../../anyspend/index.js";
|
|
3
3
|
import centerTruncate from "../../../../shared/utils/centerTruncate.js";
|
|
4
4
|
import { Elements, PaymentElement, useElements, useStripe } from "@stripe/react-stripe-js";
|
|
5
5
|
import { loadStripe } from "@stripe/stripe-js";
|
|
@@ -25,7 +25,7 @@ function StripePaymentForm({ order, onPaymentSuccess }) {
|
|
|
25
25
|
try {
|
|
26
26
|
const { error: submitError } = await stripe.confirmPayment({
|
|
27
27
|
elements,
|
|
28
|
-
redirect: "if_required"
|
|
28
|
+
redirect: "if_required",
|
|
29
29
|
});
|
|
30
30
|
if (submitError) {
|
|
31
31
|
setError(submitError.message || "An error occurred");
|
|
@@ -49,13 +49,13 @@ function StripePaymentForm({ order, onPaymentSuccess }) {
|
|
|
49
49
|
defaultValues: {
|
|
50
50
|
billingDetails: {
|
|
51
51
|
name: "",
|
|
52
|
-
email: ""
|
|
53
|
-
}
|
|
54
|
-
}
|
|
52
|
+
email: "",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
55
|
};
|
|
56
56
|
return (_jsx("form", { onSubmit: handleSubmit, className: "w-full", children: _jsx("div", { className: "overflow-hidden rounded-xl bg-white", children: _jsxs("div", { className: "px-6 py-4", children: [_jsx("h2", { className: "mb-4 text-lg font-semibold", children: "Payment Details" }), _jsx(PaymentElement, { options: stripeElementOptions }), error && (_jsx("div", { className: "mt-4 rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-600", children: error })), _jsx("button", { type: "submit", disabled: !stripe || isProcessing, className: "mt-6 w-full rounded-xl bg-blue-600 px-4 py-3 font-medium text-white hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-50", children: isProcessing ? (_jsxs("div", { className: "flex items-center justify-center gap-2", children: [_jsx(Loader2, { className: "h-5 w-5 animate-spin" }), _jsx("span", { children: "Processing..." })] })) : (_jsx("span", { children: "Complete Payment" })) })] }) }) }));
|
|
57
57
|
}
|
|
58
|
-
export function WebviewOnrampPayment({ srcAmountOnRamp, recipientAddress, destinationToken, anyspendQuote, onPaymentSuccess, userId, partnerId }) {
|
|
58
|
+
export function WebviewOnrampPayment({ srcAmountOnRamp, recipientAddress, destinationToken, anyspendQuote, onPaymentSuccess, userId, partnerId, }) {
|
|
59
59
|
const [stableAmountForGeo, setStableAmountForGeo] = useState(srcAmountOnRamp);
|
|
60
60
|
const hasInitialized = useRef(false);
|
|
61
61
|
const [createdOrder, setCreatedOrder] = useState(null);
|
|
@@ -67,7 +67,7 @@ export function WebviewOnrampPayment({ srcAmountOnRamp, recipientAddress, destin
|
|
|
67
67
|
hasInitialized.current = true;
|
|
68
68
|
}
|
|
69
69
|
}, [srcAmountOnRamp]);
|
|
70
|
-
const { geoData, isStripeWeb2Supported, isLoading: isLoadingGeoOnramp } = useGeoOnrampOptions(true, stableAmountForGeo);
|
|
70
|
+
const { geoData, isStripeWeb2Supported, isLoading: isLoadingGeoOnramp, } = useGeoOnrampOptions(true, stableAmountForGeo);
|
|
71
71
|
const { createOrder, isCreatingOrder } = useAnyspendCreateOnrampOrder({
|
|
72
72
|
onSuccess: data => {
|
|
73
73
|
const orderId = data.data.id;
|
|
@@ -76,7 +76,7 @@ export function WebviewOnrampPayment({ srcAmountOnRamp, recipientAddress, destin
|
|
|
76
76
|
onError: error => {
|
|
77
77
|
console.error(error);
|
|
78
78
|
toast.error("Failed to create order: " + error.message);
|
|
79
|
-
}
|
|
79
|
+
},
|
|
80
80
|
});
|
|
81
81
|
const { clientSecret, isLoadingStripeClientSecret } = useStripeClientSecret(true, createdOrder?.stripePaymentIntentId || "");
|
|
82
82
|
// Create order when component mounts and all required data is available
|
|
@@ -95,7 +95,7 @@ export function WebviewOnrampPayment({ srcAmountOnRamp, recipientAddress, destin
|
|
|
95
95
|
return {
|
|
96
96
|
...destinationToken,
|
|
97
97
|
chainId: destinationToken.chainId,
|
|
98
|
-
address: destinationToken.address
|
|
98
|
+
address: destinationToken.address,
|
|
99
99
|
};
|
|
100
100
|
};
|
|
101
101
|
createOrder({
|
|
@@ -110,10 +110,10 @@ export function WebviewOnrampPayment({ srcAmountOnRamp, recipientAddress, destin
|
|
|
110
110
|
paymentMethod: "",
|
|
111
111
|
country: geoData.country || "US",
|
|
112
112
|
ipAddress: geoData.ip,
|
|
113
|
-
redirectUrl: `${window.location.origin}${userId ? `?userId=${userId}` : ""}
|
|
113
|
+
redirectUrl: `${window.location.origin}${userId ? `?userId=${userId}` : ""}`,
|
|
114
114
|
},
|
|
115
115
|
expectedDstAmount: anyspendQuote.data?.currencyOut?.amount?.toString() || "0",
|
|
116
|
-
partnerId
|
|
116
|
+
partnerId,
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
catch (err) {
|
|
@@ -132,7 +132,7 @@ export function WebviewOnrampPayment({ srcAmountOnRamp, recipientAddress, destin
|
|
|
132
132
|
createOrder,
|
|
133
133
|
destinationToken,
|
|
134
134
|
userId,
|
|
135
|
-
partnerId
|
|
135
|
+
partnerId,
|
|
136
136
|
]);
|
|
137
137
|
// Check if all required data is loaded
|
|
138
138
|
const isLoading = isLoadingGeoOnramp || !anyspendQuote || !destinationToken.metadata?.logoURI;
|
|
@@ -155,9 +155,9 @@ export function WebviewOnrampPayment({ srcAmountOnRamp, recipientAddress, destin
|
|
|
155
155
|
variables: {
|
|
156
156
|
colorPrimary: "#2563eb",
|
|
157
157
|
colorBackground: "#ffffff",
|
|
158
|
-
borderRadius: "12px"
|
|
159
|
-
}
|
|
160
|
-
}
|
|
158
|
+
borderRadius: "12px",
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
161
|
}, children: _jsx(StripePaymentForm, { order: createdOrder, onPaymentSuccess: onPaymentSuccess }) })] }));
|
|
162
162
|
}
|
|
163
163
|
// Show initial order summary while waiting for order creation
|
|
@@ -12,7 +12,7 @@ import { base } from "viem/chains";
|
|
|
12
12
|
export function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
|
|
13
13
|
const { mutate: createOrder, isPending } = useMutation({
|
|
14
14
|
mutationFn: async (params) => {
|
|
15
|
-
const { isMainnet, recipientAddress, orderType, dstChain, dstToken, srcFiatAmount, onramp, creatorAddress, expectedDstAmount, nft, tournament, payload, partnerId } = params;
|
|
15
|
+
const { isMainnet, recipientAddress, orderType, dstChain, dstToken, srcFiatAmount, onramp, creatorAddress, expectedDstAmount, nft, tournament, payload, partnerId, } = params;
|
|
16
16
|
try {
|
|
17
17
|
// Validate Stripe onramp options
|
|
18
18
|
if (onramp.vendor === "stripe" && !onramp.ipAddress) {
|
|
@@ -42,7 +42,7 @@ export function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
|
|
|
42
42
|
expectedDstAmount,
|
|
43
43
|
nft,
|
|
44
44
|
tournament,
|
|
45
|
-
payload
|
|
45
|
+
payload,
|
|
46
46
|
}),
|
|
47
47
|
onramp,
|
|
48
48
|
metadata: buildMetadata(orderType, {
|
|
@@ -52,10 +52,10 @@ export function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
|
|
|
52
52
|
expectedDstAmount,
|
|
53
53
|
nft,
|
|
54
54
|
tournament,
|
|
55
|
-
payload
|
|
55
|
+
payload,
|
|
56
56
|
}),
|
|
57
57
|
creatorAddress: creatorAddress ? normalizeAddress(creatorAddress) : undefined,
|
|
58
|
-
partnerId
|
|
58
|
+
partnerId,
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
catch (error) {
|
|
@@ -72,10 +72,10 @@ export function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
|
|
|
72
72
|
},
|
|
73
73
|
onError: (error) => {
|
|
74
74
|
onError?.(error);
|
|
75
|
-
}
|
|
75
|
+
},
|
|
76
76
|
});
|
|
77
77
|
return useMemo(() => ({
|
|
78
78
|
createOrder,
|
|
79
|
-
isCreatingOrder: isPending
|
|
79
|
+
isCreatingOrder: isPending,
|
|
80
80
|
}), [createOrder, isPending]);
|
|
81
81
|
}
|
|
@@ -10,7 +10,7 @@ import { useMemo } from "react";
|
|
|
10
10
|
export function useAnyspendCreateOrder({ onSuccess, onError } = {}) {
|
|
11
11
|
const { mutate: createOrder, isPending } = useMutation({
|
|
12
12
|
mutationFn: async (params) => {
|
|
13
|
-
const { isMainnet, recipientAddress, orderType, srcChain, dstChain, srcToken, dstToken, srcAmount, creatorAddress } = params;
|
|
13
|
+
const { isMainnet, recipientAddress, orderType, srcChain, dstChain, srcToken, dstToken, srcAmount, creatorAddress, } = params;
|
|
14
14
|
try {
|
|
15
15
|
return await anyspendService.createOrder({
|
|
16
16
|
isMainnet,
|
|
@@ -28,7 +28,7 @@ export function useAnyspendCreateOrder({ onSuccess, onError } = {}) {
|
|
|
28
28
|
expectedDstAmount: params.expectedDstAmount,
|
|
29
29
|
nft: params.nft,
|
|
30
30
|
tournament: params.tournament,
|
|
31
|
-
payload: params.payload
|
|
31
|
+
payload: params.payload,
|
|
32
32
|
}),
|
|
33
33
|
metadata: buildMetadata(orderType, {
|
|
34
34
|
orderType,
|
|
@@ -37,9 +37,9 @@ export function useAnyspendCreateOrder({ onSuccess, onError } = {}) {
|
|
|
37
37
|
expectedDstAmount: params.expectedDstAmount,
|
|
38
38
|
nft: params.nft,
|
|
39
39
|
tournament: params.tournament,
|
|
40
|
-
payload: params.payload
|
|
40
|
+
payload: params.payload,
|
|
41
41
|
}),
|
|
42
|
-
creatorAddress: creatorAddress ? normalizeAddress(creatorAddress) : undefined
|
|
42
|
+
creatorAddress: creatorAddress ? normalizeAddress(creatorAddress) : undefined,
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
catch (error) {
|
|
@@ -56,10 +56,10 @@ export function useAnyspendCreateOrder({ onSuccess, onError } = {}) {
|
|
|
56
56
|
},
|
|
57
57
|
onError: (error) => {
|
|
58
58
|
onError?.(error);
|
|
59
|
-
}
|
|
59
|
+
},
|
|
60
60
|
});
|
|
61
61
|
return useMemo(() => ({
|
|
62
62
|
createOrder,
|
|
63
|
-
isCreatingOrder: isPending
|
|
63
|
+
isCreatingOrder: isPending,
|
|
64
64
|
}), [createOrder, isPending]);
|
|
65
65
|
}
|
|
@@ -20,12 +20,12 @@ export function useAnyspendOrderAndTransactions(isMainnet, orderId) {
|
|
|
20
20
|
if (isEqual(oldData, newData))
|
|
21
21
|
return oldData;
|
|
22
22
|
return newData;
|
|
23
|
-
}
|
|
23
|
+
},
|
|
24
24
|
});
|
|
25
25
|
return useMemo(() => ({
|
|
26
26
|
orderAndTransactions: data,
|
|
27
27
|
isLoadingOrderAndTransactions: isLoading,
|
|
28
28
|
getOrderAndTransactionsError: error,
|
|
29
|
-
refetchOrderAndTransactions: refetch
|
|
29
|
+
refetchOrderAndTransactions: refetch,
|
|
30
30
|
}), [data, error, isLoading, refetch]);
|
|
31
31
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { anyspendService } from "../../../anyspend/services/anyspend.js";
|
|
2
2
|
import { useQuery } from "@tanstack/react-query";
|
|
3
3
|
export function useAnyspendOrderHistory(isMainnet, creatorAddress, limit = 100, offset = 0) {
|
|
4
|
-
const { data: rawData = [], isLoading, refetch, error } = useQuery({
|
|
4
|
+
const { data: rawData = [], isLoading, refetch, error, } = useQuery({
|
|
5
5
|
queryKey: ["getOrderHistory", creatorAddress, limit, offset],
|
|
6
6
|
queryFn: async () => {
|
|
7
7
|
const response = await anyspendService.getOrderHistory(isMainnet, creatorAddress, limit, offset);
|
|
8
8
|
return response.data;
|
|
9
|
-
}
|
|
9
|
+
},
|
|
10
10
|
});
|
|
11
11
|
return {
|
|
12
12
|
orderHistory: rawData,
|
|
13
13
|
isLoadingOrderHistory: isLoading,
|
|
14
14
|
getOrderHistoryError: error,
|
|
15
|
-
refetchOrderHistory: refetch
|
|
15
|
+
refetchOrderHistory: refetch,
|
|
16
16
|
};
|
|
17
17
|
}
|
|
@@ -38,12 +38,12 @@ export function useAnyspendQuote(isMainnet, req) {
|
|
|
38
38
|
? req.fundAmount
|
|
39
39
|
: req.payload.amount) !== BigInt(0)),
|
|
40
40
|
refetchInterval: 10000,
|
|
41
|
-
retry: false
|
|
41
|
+
retry: false,
|
|
42
42
|
});
|
|
43
43
|
return useMemo(() => ({
|
|
44
44
|
anyspendQuote: data,
|
|
45
45
|
isLoadingAnyspendQuote: isLoading,
|
|
46
46
|
getAnyspendQuoteError: error,
|
|
47
|
-
refetchAnyspendQuote: refetch
|
|
47
|
+
refetchAnyspendQuote: refetch,
|
|
48
48
|
}), [data, error, isLoading, refetch]);
|
|
49
49
|
}
|
|
@@ -7,7 +7,7 @@ export function useAnyspendSendPermitData({ onSuccess, onError } = {}) {
|
|
|
7
7
|
const response = await anyspendService.sendPermitData({
|
|
8
8
|
isMainnet,
|
|
9
9
|
orderId,
|
|
10
|
-
permitData
|
|
10
|
+
permitData,
|
|
11
11
|
});
|
|
12
12
|
if (response.statusCode !== 200)
|
|
13
13
|
throw response;
|
|
@@ -27,10 +27,10 @@ export function useAnyspendSendPermitData({ onSuccess, onError } = {}) {
|
|
|
27
27
|
},
|
|
28
28
|
onError: (error) => {
|
|
29
29
|
onError?.(error);
|
|
30
|
-
}
|
|
30
|
+
},
|
|
31
31
|
});
|
|
32
32
|
return {
|
|
33
33
|
sendPermitData,
|
|
34
|
-
isSendingPermitData: isPending
|
|
34
|
+
isSendingPermitData: isPending,
|
|
35
35
|
};
|
|
36
36
|
}
|
|
@@ -2,14 +2,14 @@ import { anyspendService } from "../../../anyspend/services/anyspend.js";
|
|
|
2
2
|
import { useQuery } from "@tanstack/react-query";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
export function useAnyspendTokenList(isMainnet, chainId, query) {
|
|
5
|
-
const { data = [], isLoading, refetch } = useQuery({
|
|
5
|
+
const { data = [], isLoading, refetch, } = useQuery({
|
|
6
6
|
queryKey: ["getAnyspendTokenList", chainId, query],
|
|
7
7
|
queryFn: () => anyspendService.getTokenList(isMainnet, chainId, query),
|
|
8
|
-
enabled: true
|
|
8
|
+
enabled: true,
|
|
9
9
|
});
|
|
10
10
|
return useMemo(() => ({
|
|
11
11
|
data,
|
|
12
12
|
isLoading,
|
|
13
|
-
refetch
|
|
13
|
+
refetch,
|
|
14
14
|
}), [data, isLoading, refetch]);
|
|
15
15
|
}
|
|
@@ -5,12 +5,12 @@ export function useCoinbaseOnrampOptions(isMainnet, country) {
|
|
|
5
5
|
const { data, isLoading, error, refetch } = useQuery({
|
|
6
6
|
queryKey: ["getCoinbaseOnrampOptions", isMainnet, country],
|
|
7
7
|
queryFn: () => anyspendService.getCoinbaseOnrampOptions(isMainnet, country),
|
|
8
|
-
enabled: Boolean(country)
|
|
8
|
+
enabled: Boolean(country),
|
|
9
9
|
});
|
|
10
10
|
return useMemo(() => ({
|
|
11
11
|
coinbaseOnrampOptions: data,
|
|
12
12
|
isLoadingCoinbaseOnrampOptions: isLoading,
|
|
13
13
|
coinbaseOnrampOptionsError: error,
|
|
14
|
-
refetchCoinbaseOnrampOptions: refetch
|
|
14
|
+
refetchCoinbaseOnrampOptions: refetch,
|
|
15
15
|
}), [data, isLoading, error, refetch]);
|
|
16
16
|
}
|
|
@@ -33,7 +33,7 @@ export function useGeoOnrampOptions(isMainnet, srcFiatAmount) {
|
|
|
33
33
|
isLoadingStripeSupport,
|
|
34
34
|
geoError,
|
|
35
35
|
coinbaseOnrampOptionsError,
|
|
36
|
-
stripeSupportError
|
|
36
|
+
stripeSupportError,
|
|
37
37
|
}), [
|
|
38
38
|
geoData,
|
|
39
39
|
coinbaseOnrampOptions,
|
|
@@ -45,6 +45,6 @@ export function useGeoOnrampOptions(isMainnet, srcFiatAmount) {
|
|
|
45
45
|
isLoadingStripeSupport,
|
|
46
46
|
geoError,
|
|
47
47
|
coinbaseOnrampOptionsError,
|
|
48
|
-
stripeSupportError
|
|
48
|
+
stripeSupportError,
|
|
49
49
|
]);
|
|
50
50
|
}
|
|
@@ -7,6 +7,6 @@ async function fetchGeoData() {
|
|
|
7
7
|
return response.json();
|
|
8
8
|
}
|
|
9
9
|
export function useGetGeo() {
|
|
10
|
-
const { data: geoData, isLoading: loading, error } = useQuery({ queryKey: ["useGetGeo"], queryFn: fetchGeoData, retry: 3 });
|
|
10
|
+
const { data: geoData, isLoading: loading, error, } = useQuery({ queryKey: ["useGetGeo"], queryFn: fetchGeoData, retry: 3 });
|
|
11
11
|
return { geoData, loading, error };
|
|
12
12
|
}
|
|
@@ -12,18 +12,18 @@ const EIP5267_ABI = [
|
|
|
12
12
|
{ name: "version", type: "string" },
|
|
13
13
|
{ name: "chainId", type: "uint256" },
|
|
14
14
|
{ name: "verifyingContract", type: "address" },
|
|
15
|
-
{ name: "salt", type: "bytes32" }
|
|
15
|
+
{ name: "salt", type: "bytes32" },
|
|
16
16
|
],
|
|
17
17
|
stateMutability: "view",
|
|
18
|
-
type: "function"
|
|
19
|
-
}
|
|
18
|
+
type: "function",
|
|
19
|
+
},
|
|
20
20
|
];
|
|
21
21
|
export async function getPermitData(p) {
|
|
22
22
|
console.log("Start getting permit data...");
|
|
23
23
|
if (!isEvmChain(p.chainId) || isNativeToken(p.tokenAddress) || !p.ownerAddress) {
|
|
24
24
|
return {
|
|
25
25
|
canPermit: false,
|
|
26
|
-
data: null
|
|
26
|
+
data: null,
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
const publicClient = chainIdToPublicClient(p.chainId);
|
|
@@ -31,12 +31,12 @@ export async function getPermitData(p) {
|
|
|
31
31
|
address: p.tokenAddress,
|
|
32
32
|
abi: ABI_USDC_BASE,
|
|
33
33
|
functionName: "balanceOf",
|
|
34
|
-
args: [p.ownerAddress]
|
|
34
|
+
args: [p.ownerAddress],
|
|
35
35
|
});
|
|
36
36
|
if (balance < p.amount) {
|
|
37
37
|
return {
|
|
38
38
|
canPermit: false,
|
|
39
|
-
data: null
|
|
39
|
+
data: null,
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
// Domain parameters
|
|
@@ -47,7 +47,7 @@ export async function getPermitData(p) {
|
|
|
47
47
|
const domainData = await publicClient.readContract({
|
|
48
48
|
address: p.tokenAddress,
|
|
49
49
|
abi: EIP5267_ABI,
|
|
50
|
-
functionName: "eip712Domain"
|
|
50
|
+
functionName: "eip712Domain",
|
|
51
51
|
});
|
|
52
52
|
console.log("Found EIP-5267 eip712Domain function");
|
|
53
53
|
name = domainData[1]; // name is the second return value
|
|
@@ -64,14 +64,14 @@ export async function getPermitData(p) {
|
|
|
64
64
|
name = await publicClient.readContract({
|
|
65
65
|
address: p.tokenAddress,
|
|
66
66
|
abi: ABI_USDC_BASE,
|
|
67
|
-
functionName: "name"
|
|
67
|
+
functionName: "name",
|
|
68
68
|
});
|
|
69
69
|
// Try to get version from contract
|
|
70
70
|
try {
|
|
71
71
|
version = await publicClient.readContract({
|
|
72
72
|
address: p.tokenAddress,
|
|
73
73
|
abi: ABI_USDC_BASE,
|
|
74
|
-
functionName: "version"
|
|
74
|
+
functionName: "version",
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
catch (error) {
|
|
@@ -83,7 +83,7 @@ export async function getPermitData(p) {
|
|
|
83
83
|
.readContract({
|
|
84
84
|
address: p.tokenAddress,
|
|
85
85
|
abi: ABI_USDC_BASE,
|
|
86
|
-
functionName: "PERMIT_TYPEHASH"
|
|
86
|
+
functionName: "PERMIT_TYPEHASH",
|
|
87
87
|
})
|
|
88
88
|
.catch(() => {
|
|
89
89
|
console.log("PERMIT_TYPEHASH not directly accessible, using standard EIP-2612 value");
|
|
@@ -93,7 +93,7 @@ export async function getPermitData(p) {
|
|
|
93
93
|
const contractDomainSeparator = await publicClient.readContract({
|
|
94
94
|
address: p.tokenAddress,
|
|
95
95
|
abi: ABI_USDC_BASE,
|
|
96
|
-
functionName: "DOMAIN_SEPARATOR"
|
|
96
|
+
functionName: "DOMAIN_SEPARATOR",
|
|
97
97
|
});
|
|
98
98
|
console.log("Contract name:", name);
|
|
99
99
|
console.log("Contract version:", version);
|
|
@@ -104,7 +104,7 @@ export async function getPermitData(p) {
|
|
|
104
104
|
name,
|
|
105
105
|
version,
|
|
106
106
|
chainId: p.chainId,
|
|
107
|
-
verifyingContract: p.tokenAddress
|
|
107
|
+
verifyingContract: p.tokenAddress,
|
|
108
108
|
};
|
|
109
109
|
// EIP-2612 Permit type definition
|
|
110
110
|
// This must match the structure used to compute the PERMIT_TYPEHASH in the contract
|
|
@@ -113,14 +113,14 @@ export async function getPermitData(p) {
|
|
|
113
113
|
{ name: "spender", type: "address" },
|
|
114
114
|
{ name: "value", type: "uint256" },
|
|
115
115
|
{ name: "nonce", type: "uint256" },
|
|
116
|
-
{ name: "deadline", type: "uint256" }
|
|
116
|
+
{ name: "deadline", type: "uint256" },
|
|
117
117
|
];
|
|
118
118
|
const multicall3 = getMulticall3Address(p.chainId);
|
|
119
119
|
const nonce = await publicClient.readContract({
|
|
120
120
|
address: p.tokenAddress,
|
|
121
121
|
abi: ABI_USDC_BASE,
|
|
122
122
|
functionName: "nonces",
|
|
123
|
-
args: [p.ownerAddress]
|
|
123
|
+
args: [p.ownerAddress],
|
|
124
124
|
});
|
|
125
125
|
const deadlineInSeconds = BigInt(Math.floor(Date.now() / 1000) + 60 * 60); // 60 minutes
|
|
126
126
|
// Permit data to sign
|
|
@@ -129,26 +129,26 @@ export async function getPermitData(p) {
|
|
|
129
129
|
spender: multicall3,
|
|
130
130
|
value: p.amount,
|
|
131
131
|
nonce,
|
|
132
|
-
deadline: deadlineInSeconds
|
|
132
|
+
deadline: deadlineInSeconds,
|
|
133
133
|
};
|
|
134
134
|
return {
|
|
135
135
|
canPermit: true,
|
|
136
136
|
data: {
|
|
137
137
|
domain,
|
|
138
138
|
types: { Permit: PermitType },
|
|
139
|
-
messageToSign
|
|
140
|
-
}
|
|
139
|
+
messageToSign,
|
|
140
|
+
},
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
143
|
export function usePermitData(p) {
|
|
144
144
|
const { data, isLoading, error, refetch } = useQuery({
|
|
145
145
|
queryKey: ["usePermitData", p.chainId, p.tokenAddress],
|
|
146
|
-
queryFn: () => getPermitData(p)
|
|
146
|
+
queryFn: () => getPermitData(p),
|
|
147
147
|
});
|
|
148
148
|
return {
|
|
149
149
|
permitData: data,
|
|
150
150
|
isCheckingPermit: isLoading,
|
|
151
151
|
checkPermitError: error,
|
|
152
|
-
recheckPermit: refetch
|
|
152
|
+
recheckPermit: refetch,
|
|
153
153
|
};
|
|
154
154
|
}
|
|
@@ -4,12 +4,12 @@ import { anyspendService } from "../../../anyspend/services/anyspend.js";
|
|
|
4
4
|
export function useStripeClientSecret(isMainnet, paymentIntentId) {
|
|
5
5
|
const { data, isLoading, error, refetch } = useQuery({
|
|
6
6
|
queryKey: ["stripeClientSecret", isMainnet, paymentIntentId],
|
|
7
|
-
queryFn: () => anyspendService.getStripeClientSecret(isMainnet, paymentIntentId)
|
|
7
|
+
queryFn: () => anyspendService.getStripeClientSecret(isMainnet, paymentIntentId),
|
|
8
8
|
});
|
|
9
9
|
return useMemo(() => ({
|
|
10
10
|
clientSecret: data || null,
|
|
11
11
|
isLoadingStripeClientSecret: isLoading,
|
|
12
12
|
stripeClientSecretError: error,
|
|
13
|
-
refetchStripeClientSecret: refetch
|
|
13
|
+
refetchStripeClientSecret: refetch,
|
|
14
14
|
}), [data, isLoading, error, refetch]);
|
|
15
15
|
}
|
|
@@ -5,13 +5,13 @@ export function useStripeSupport(isMainnet, ipAddress, usdAmount) {
|
|
|
5
5
|
const { data, isLoading, error, refetch } = useQuery({
|
|
6
6
|
queryKey: ["useStripeSupport", isMainnet, ipAddress, usdAmount],
|
|
7
7
|
queryFn: () => anyspendService.checkStripeSupport(isMainnet, ipAddress, usdAmount),
|
|
8
|
-
enabled: !!ipAddress
|
|
8
|
+
enabled: !!ipAddress,
|
|
9
9
|
});
|
|
10
10
|
return useMemo(() => ({
|
|
11
11
|
isStripeOnrampSupported: data?.stripeOnramp || false,
|
|
12
12
|
isStripeWeb2Supported: data?.stripeWeb2 || false,
|
|
13
13
|
isLoadingStripeSupport: isLoading,
|
|
14
14
|
stripeSupportError: error,
|
|
15
|
-
refetchStripeSupport: refetch
|
|
15
|
+
refetchStripeSupport: refetch,
|
|
16
16
|
}), [data, isLoading, error, refetch]);
|
|
17
17
|
}
|
|
@@ -4,7 +4,7 @@ export declare const anyspendService: {
|
|
|
4
4
|
getTokenList: (isMainnet: boolean, chainId: number, query: string) => Promise<Token[]>;
|
|
5
5
|
getToken: (isMainnet: boolean, chainId: number, tokenAddress: string) => Promise<Token>;
|
|
6
6
|
getQuote: (isMainnet: boolean, req: GetQuoteRequest) => Promise<GetQuoteResponse>;
|
|
7
|
-
createOrder: ({ isMainnet, recipientAddress, type, srcChain, dstChain, srcTokenAddress, dstTokenAddress, srcAmount, payload, onramp, metadata, creatorAddress, partnerId }: {
|
|
7
|
+
createOrder: ({ isMainnet, recipientAddress, type, srcChain, dstChain, srcTokenAddress, dstTokenAddress, srcAmount, payload, onramp, metadata, creatorAddress, partnerId, }: {
|
|
8
8
|
isMainnet: boolean;
|
|
9
9
|
recipientAddress: string;
|
|
10
10
|
type: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ANYSPEND_MAINNET_BASE_URL, ANYSPEND_TESTNET_BASE_URL } from "../../anyspend/constants/index.js";
|
|
2
|
-
import { zGetCoinbaseOnrampOptionsResponse, zGetOrderAndTxsResponse, zGetOrderHistoryResponse, zGetTokenListResponse } from "../../anyspend/types/index.js";
|
|
2
|
+
import { zGetCoinbaseOnrampOptionsResponse, zGetOrderAndTxsResponse, zGetOrderHistoryResponse, zGetTokenListResponse, } from "../../anyspend/types/index.js";
|
|
3
3
|
import { getNativeToken, isNativeToken } from "../../anyspend/utils/index.js";
|
|
4
4
|
import invariant from "invariant";
|
|
5
5
|
// Service functions
|
|
@@ -27,9 +27,9 @@ export const anyspendService = {
|
|
|
27
27
|
const response = await fetch(url, {
|
|
28
28
|
method: "POST",
|
|
29
29
|
headers: {
|
|
30
|
-
"Content-Type": "application/json"
|
|
30
|
+
"Content-Type": "application/json",
|
|
31
31
|
},
|
|
32
|
-
body: JSON.stringify(req)
|
|
32
|
+
body: JSON.stringify(req),
|
|
33
33
|
});
|
|
34
34
|
const data = await response.json();
|
|
35
35
|
if (response.status !== 200)
|
|
@@ -37,11 +37,11 @@ export const anyspendService = {
|
|
|
37
37
|
return data;
|
|
38
38
|
},
|
|
39
39
|
// Order related
|
|
40
|
-
createOrder: async ({ isMainnet, recipientAddress, type, srcChain, dstChain, srcTokenAddress, dstTokenAddress, srcAmount, payload, onramp, metadata, creatorAddress, partnerId }) => {
|
|
40
|
+
createOrder: async ({ isMainnet, recipientAddress, type, srcChain, dstChain, srcTokenAddress, dstTokenAddress, srcAmount, payload, onramp, metadata, creatorAddress, partnerId, }) => {
|
|
41
41
|
const response = await fetch(`${isMainnet ? ANYSPEND_MAINNET_BASE_URL : ANYSPEND_TESTNET_BASE_URL}/orders`, {
|
|
42
42
|
method: "POST",
|
|
43
43
|
headers: {
|
|
44
|
-
"Content-Type": "application/json"
|
|
44
|
+
"Content-Type": "application/json",
|
|
45
45
|
},
|
|
46
46
|
body: JSON.stringify({
|
|
47
47
|
recipientAddress,
|
|
@@ -55,8 +55,8 @@ export const anyspendService = {
|
|
|
55
55
|
onramp,
|
|
56
56
|
metadata,
|
|
57
57
|
creatorAddress,
|
|
58
|
-
partnerId
|
|
59
|
-
})
|
|
58
|
+
partnerId,
|
|
59
|
+
}),
|
|
60
60
|
});
|
|
61
61
|
const data = await response.json();
|
|
62
62
|
invariant(data.statusCode === 200, data.message);
|
|
@@ -71,7 +71,7 @@ export const anyspendService = {
|
|
|
71
71
|
getOrderHistory: async (isMainnet, creatorAddress, limit = 100, offset = 0) => {
|
|
72
72
|
const params = new URLSearchParams({
|
|
73
73
|
limit: limit.toString(),
|
|
74
|
-
offset: offset.toString()
|
|
74
|
+
offset: offset.toString(),
|
|
75
75
|
});
|
|
76
76
|
if (creatorAddress) {
|
|
77
77
|
params.append("creatorAddress", creatorAddress);
|
|
@@ -83,7 +83,7 @@ export const anyspendService = {
|
|
|
83
83
|
},
|
|
84
84
|
getCoinbaseOnrampOptions: async (isMainnet, country) => {
|
|
85
85
|
const params = new URLSearchParams({
|
|
86
|
-
country
|
|
86
|
+
country,
|
|
87
87
|
});
|
|
88
88
|
const response = await fetch(`${isMainnet ? ANYSPEND_MAINNET_BASE_URL : ANYSPEND_TESTNET_BASE_URL}/onramp/coinbase/options?${params.toString()}`);
|
|
89
89
|
const data = await response.json();
|
|
@@ -93,7 +93,7 @@ export const anyspendService = {
|
|
|
93
93
|
checkStripeSupport: async (isMainnet, ipAddress, usdAmount) => {
|
|
94
94
|
const params = new URLSearchParams({
|
|
95
95
|
ipAddress,
|
|
96
|
-
usdAmount: usdAmount || ""
|
|
96
|
+
usdAmount: usdAmount || "",
|
|
97
97
|
});
|
|
98
98
|
const response = await fetch(`${isMainnet ? ANYSPEND_MAINNET_BASE_URL : ANYSPEND_TESTNET_BASE_URL}/onramp/stripe/supported?${params.toString()}`);
|
|
99
99
|
const data = await response.json();
|
|
@@ -104,12 +104,12 @@ export const anyspendService = {
|
|
|
104
104
|
const response = await fetch(`${isMainnet ? ANYSPEND_MAINNET_BASE_URL : ANYSPEND_TESTNET_BASE_URL}/orders/send-permit`, {
|
|
105
105
|
method: "POST",
|
|
106
106
|
headers: {
|
|
107
|
-
"Content-Type": "application/json"
|
|
107
|
+
"Content-Type": "application/json",
|
|
108
108
|
},
|
|
109
109
|
body: JSON.stringify({
|
|
110
110
|
orderId,
|
|
111
|
-
permitData
|
|
112
|
-
})
|
|
111
|
+
permitData,
|
|
112
|
+
}),
|
|
113
113
|
});
|
|
114
114
|
return response.json();
|
|
115
115
|
},
|
|
@@ -117,5 +117,5 @@ export const anyspendService = {
|
|
|
117
117
|
const response = await fetch(`${isMainnet ? ANYSPEND_MAINNET_BASE_URL : ANYSPEND_TESTNET_BASE_URL}/stripe/clientSecret?paymentIntentId=${paymentIntentId}`);
|
|
118
118
|
const data = await response.json();
|
|
119
119
|
return data.data;
|
|
120
|
-
}
|
|
120
|
+
},
|
|
121
121
|
};
|
|
@@ -4,10 +4,10 @@ export const zCustomPayload = z.object({
|
|
|
4
4
|
data: z.string(),
|
|
5
5
|
to: z.string(),
|
|
6
6
|
spenderAddress: z.string().optional(),
|
|
7
|
-
amount: z.string()
|
|
7
|
+
amount: z.string(),
|
|
8
8
|
});
|
|
9
9
|
export const zCustomMetadata = z.object({
|
|
10
10
|
srcToken: zToken,
|
|
11
11
|
dstToken: zToken,
|
|
12
|
-
action: z.string().optional()
|
|
12
|
+
action: z.string().optional(),
|
|
13
13
|
});
|