@0xsequence/marketplace-sdk 0.4.7 → 0.4.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.
Files changed (32) hide show
  1. package/dist/{chunk-5UCKYAMR.js → chunk-7WCZP6FN.js} +21 -9
  2. package/dist/{chunk-5UCKYAMR.js.map → chunk-7WCZP6FN.js.map} +1 -1
  3. package/dist/{chunk-ZEH4JI2U.js → chunk-FCF57DZI.js} +7 -2
  4. package/dist/chunk-FCF57DZI.js.map +1 -0
  5. package/dist/{chunk-R7GVMKMM.js → chunk-WRMJ5FZM.js} +17 -1
  6. package/dist/chunk-WRMJ5FZM.js.map +1 -0
  7. package/dist/index.js +2 -2
  8. package/dist/react/_internal/index.js +1 -1
  9. package/dist/react/_internal/wagmi/index.js +1 -1
  10. package/dist/react/hooks/index.js +3 -3
  11. package/dist/react/index.js +4 -4
  12. package/dist/react/ssr/index.js +6 -1
  13. package/dist/react/ssr/index.js.map +1 -1
  14. package/dist/react/ui/components/collectible-card/index.js +4 -4
  15. package/dist/react/ui/index.js +4 -4
  16. package/dist/react/ui/modals/_internal/components/actionModal/index.js +2 -2
  17. package/dist/types/index.js +1 -1
  18. package/dist/utils/index.js +2 -2
  19. package/package.json +3 -2
  20. package/src/react/__tests__/provider.test.tsx +75 -0
  21. package/src/react/_internal/wagmi/__tests__/create-config.test.ts +196 -0
  22. package/src/react/_internal/wagmi/create-config.ts +9 -1
  23. package/src/react/provider.tsx +5 -0
  24. package/src/react/ui/components/collectible-card/CollectibleCard.tsx +9 -8
  25. package/src/react/ui/components/collectible-card/Footer.tsx +4 -1
  26. package/src/react/ui/modals/BuyModal/Modal.tsx +11 -2
  27. package/src/react/ui/modals/BuyModal/modals/CheckoutModal.tsx +7 -0
  28. package/src/react/ui/modals/SuccessfulPurchaseModal/__tests__/Modal.test.tsx +145 -0
  29. package/src/utils/_internal/error/config.ts +16 -0
  30. package/tsconfig.tsbuildinfo +1 -1
  31. package/dist/chunk-R7GVMKMM.js.map +0 -1
  32. package/dist/chunk-ZEH4JI2U.js.map +0 -1
@@ -52,7 +52,7 @@ import {
52
52
  useMarketplaceConfig,
53
53
  useRoyaltyPercentage,
54
54
  useTransferTokens
55
- } from "./chunk-R7GVMKMM.js";
55
+ } from "./chunk-WRMJ5FZM.js";
56
56
  import {
57
57
  AlertMessage,
58
58
  switchChainModal_default,
@@ -3432,6 +3432,8 @@ import { useEffect as useEffect7 } from "react";
3432
3432
  import { parseUnits as parseUnits5 } from "viem";
3433
3433
  function CheckoutModal({ buy, collectable, order }) {
3434
3434
  useEffect7(() => {
3435
+ if (buyModal$.state.checkoutModalIsLoading.get() || buyModal$.state.checkoutModalLoaded.get())
3436
+ return;
3435
3437
  const executeBuy = () => {
3436
3438
  buy({
3437
3439
  orderId: order.orderId,
@@ -3723,6 +3725,13 @@ var BuyModalContent = () => {
3723
3725
  setCheckoutModalIsLoading,
3724
3726
  setCheckoutModalLoaded
3725
3727
  });
3728
+ const buyAction = (input) => {
3729
+ if (buy && checkoutOptions) {
3730
+ buy({ ...input, checkoutOptions });
3731
+ } else {
3732
+ console.error("buy is null or undefined");
3733
+ }
3734
+ };
3726
3735
  if (isLoading || checkoutModalIsLoading || !collection || !collectable || !checkoutOptions || buyIsLoading) {
3727
3736
  return /* @__PURE__ */ jsx26(
3728
3737
  LoadingModal,
@@ -3748,7 +3757,7 @@ var BuyModalContent = () => {
3748
3757
  return collection.type === "ERC721" /* ERC721 */ ? /* @__PURE__ */ jsx26(
3749
3758
  CheckoutModal,
3750
3759
  {
3751
- buy: (input) => buy({ ...input, checkoutOptions }),
3760
+ buy: buyAction,
3752
3761
  collectable,
3753
3762
  order
3754
3763
  },
@@ -3756,7 +3765,7 @@ var BuyModalContent = () => {
3756
3765
  ) : /* @__PURE__ */ jsx26(
3757
3766
  ERC1155QuantityModal,
3758
3767
  {
3759
- buy: (input) => buy({ ...input, checkoutOptions }),
3768
+ buy: buyAction,
3760
3769
  collectable,
3761
3770
  order,
3762
3771
  chainId,
@@ -4186,11 +4195,14 @@ function CollectibleCard({
4186
4195
  collectionAddress,
4187
4196
  tokenId: collectibleId
4188
4197
  });
4189
- const currencyOptions = useCurrencyOptions({ collectionAddress });
4190
- const { data: currencies } = useCurrencies({ chainId, currencyOptions });
4191
- const lowestListingCurrency = currencies?.find(
4192
- (currency) => currency.contractAddress === lowestListing?.order?.priceCurrencyAddress
4193
- );
4198
+ const { data: lowestListingCurrency } = useCurrency({
4199
+ chainId,
4200
+ // biome-ignore lint/style/noNonNullAssertion: <explanation>
4201
+ currencyAddress: lowestListing?.order?.priceCurrencyAddress,
4202
+ query: {
4203
+ enabled: !!lowestListing?.order?.priceCurrencyAddress
4204
+ }
4205
+ });
4194
4206
  if (highestOfferLoading || cardLoading) {
4195
4207
  return /* @__PURE__ */ jsx32(CollectibleSkeleton, {});
4196
4208
  }
@@ -4301,4 +4313,4 @@ export {
4301
4313
  useBuyModal,
4302
4314
  CollectibleCard
4303
4315
  };
4304
- //# sourceMappingURL=chunk-5UCKYAMR.js.map
4316
+ //# sourceMappingURL=chunk-7WCZP6FN.js.map