@0xsequence/marketplace-sdk 0.5.1 → 0.5.2

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.
@@ -2910,7 +2910,7 @@ var TransactionModalView = observer8(() => {
2910
2910
  import { Box as Box16 } from "@0xsequence/design-system";
2911
2911
  import { Show as Show4, observer as observer9 } from "@legendapp/state/react";
2912
2912
  import { parseUnits as parseUnits4 } from "viem";
2913
- import { useAccount as useAccount4 } from "wagmi";
2913
+ import { useAccount as useAccount5 } from "wagmi";
2914
2914
 
2915
2915
  // src/react/ui/modals/CreateListingModal/store.ts
2916
2916
  import { observable as observable7 } from "@legendapp/state";
@@ -2974,10 +2974,12 @@ import { useEffect as useEffect6 } from "react";
2974
2974
 
2975
2975
  // src/react/ui/modals/CreateListingModal/hooks/useGetTokenApproval.ts
2976
2976
  import { skipToken as skipToken3, useQuery as useQuery4 } from "@tanstack/react-query";
2977
+ import { useAccount as useAccount4 } from "wagmi";
2977
2978
  var ONE_DAY_IN_SECONDS2 = 60 * 60 * 24;
2978
2979
  var useGetTokenApprovalData3 = (params) => {
2979
2980
  const config = useConfig();
2980
2981
  const { wallet } = useWallet();
2982
+ const { address } = useAccount4();
2981
2983
  const marketplaceClient = getMarketplaceClient(params.chainId, config);
2982
2984
  const listing = {
2983
2985
  tokenId: params.tokenId,
@@ -2986,9 +2988,9 @@ var useGetTokenApprovalData3 = (params) => {
2986
2988
  pricePerToken: "100000",
2987
2989
  expiry: String(Number(dateToUnixTime(/* @__PURE__ */ new Date())) + ONE_DAY_IN_SECONDS2)
2988
2990
  };
2989
- const isEnabled = wallet && params.query?.enabled !== false;
2991
+ const isEnabled = wallet && address && (params.query?.enabled ?? true) && !!params.currencyAddress;
2990
2992
  const { data, isLoading, isSuccess } = useQuery4({
2991
- queryKey: ["token-approval-data", params.currencyAddress],
2993
+ queryKey: ["token-approval-data", params, address],
2992
2994
  queryFn: isEnabled ? async () => {
2993
2995
  const args = {
2994
2996
  collectionAddress: params.collectionAddress,
@@ -3262,7 +3264,7 @@ var Modal5 = observer9(() => {
3262
3264
  chainId,
3263
3265
  collectionAddress
3264
3266
  });
3265
- const { address } = useAccount4();
3267
+ const { address } = useAccount5();
3266
3268
  const { data: balance } = useBalanceOfCollectible({
3267
3269
  chainId,
3268
3270
  collectionAddress,
@@ -3893,7 +3895,7 @@ import { observer as observer12 } from "@legendapp/state/react";
3893
3895
 
3894
3896
  // src/react/ui/components/_internals/action-button/hooks/useActionButtonLogic.ts
3895
3897
  import { useEffect as useEffect8 } from "react";
3896
- import { useAccount as useAccount5 } from "wagmi";
3898
+ import { useAccount as useAccount6 } from "wagmi";
3897
3899
 
3898
3900
  // src/react/ui/components/_internals/action-button/store.ts
3899
3901
  import { observable as observable9 } from "@legendapp/state";
@@ -3928,7 +3930,7 @@ var useActionButtonLogic = ({
3928
3930
  action,
3929
3931
  onCannotPerformAction
3930
3932
  }) => {
3931
- const { address } = useAccount5();
3933
+ const { address } = useAccount6();
3932
3934
  const actionsThatOwnersCannotPerform = [
3933
3935
  "Buy" /* BUY */,
3934
3936
  "Make an offer" /* OFFER */
@@ -3973,7 +3975,7 @@ var useActionButtonLogic = ({
3973
3975
 
3974
3976
  // src/react/ui/components/_internals/action-button/components/ActionButtonBody.tsx
3975
3977
  import { Button as Button5 } from "@0xsequence/design-system";
3976
- import { useAccount as useAccount6 } from "wagmi";
3978
+ import { useAccount as useAccount7 } from "wagmi";
3977
3979
  import { useOpenConnectModal } from "@0xsequence/kit";
3978
3980
 
3979
3981
  // src/react/ui/components/_internals/action-button/styles.css.ts
@@ -3988,7 +3990,7 @@ function ActionButtonBody({
3988
3990
  icon,
3989
3991
  action
3990
3992
  }) {
3991
- const { address } = useAccount6();
3993
+ const { address } = useAccount7();
3992
3994
  const { setOpenConnectModal } = useOpenConnectModal();
3993
3995
  const handleClick = (e) => {
3994
3996
  e.preventDefault();
@@ -4576,4 +4578,4 @@ export {
4576
4578
  useBuyModal,
4577
4579
  CollectibleCard
4578
4580
  };
4579
- //# sourceMappingURL=chunk-F4E3WJ2K.js.map
4581
+ //# sourceMappingURL=chunk-MSTTVFVQ.js.map