@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.
- package/dist/{chunk-5UCKYAMR.js → chunk-7WCZP6FN.js} +21 -9
- package/dist/{chunk-5UCKYAMR.js.map → chunk-7WCZP6FN.js.map} +1 -1
- package/dist/{chunk-ZEH4JI2U.js → chunk-FCF57DZI.js} +7 -2
- package/dist/chunk-FCF57DZI.js.map +1 -0
- package/dist/{chunk-R7GVMKMM.js → chunk-WRMJ5FZM.js} +17 -1
- package/dist/chunk-WRMJ5FZM.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/react/_internal/index.js +1 -1
- package/dist/react/_internal/wagmi/index.js +1 -1
- package/dist/react/hooks/index.js +3 -3
- package/dist/react/index.js +4 -4
- package/dist/react/ssr/index.js +6 -1
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/collectible-card/index.js +4 -4
- package/dist/react/ui/index.js +4 -4
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +2 -2
- package/dist/types/index.js +1 -1
- package/dist/utils/index.js +2 -2
- package/package.json +3 -2
- package/src/react/__tests__/provider.test.tsx +75 -0
- package/src/react/_internal/wagmi/__tests__/create-config.test.ts +196 -0
- package/src/react/_internal/wagmi/create-config.ts +9 -1
- package/src/react/provider.tsx +5 -0
- package/src/react/ui/components/collectible-card/CollectibleCard.tsx +9 -8
- package/src/react/ui/components/collectible-card/Footer.tsx +4 -1
- package/src/react/ui/modals/BuyModal/Modal.tsx +11 -2
- package/src/react/ui/modals/BuyModal/modals/CheckoutModal.tsx +7 -0
- package/src/react/ui/modals/SuccessfulPurchaseModal/__tests__/Modal.test.tsx +145 -0
- package/src/utils/_internal/error/config.ts +16 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/chunk-R7GVMKMM.js.map +0 -1
- 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-
|
|
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:
|
|
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:
|
|
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
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
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-
|
|
4316
|
+
//# sourceMappingURL=chunk-7WCZP6FN.js.map
|