@0xsequence/marketplace-sdk 0.5.3 → 0.5.5
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/{builder-types-wOwfTJpd.d.ts → builder-types-Jl3Ymws8.d.ts} +1 -1
- package/dist/chunk-3BLBZYQX.js +56 -0
- package/dist/chunk-3BLBZYQX.js.map +1 -0
- package/dist/{chunk-BZD2LDJJ.js → chunk-7C7ADZ2H.js} +2 -2
- package/dist/{chunk-H5YWG6WN.js → chunk-AXTDPTRD.js} +317 -147
- package/dist/chunk-AXTDPTRD.js.map +1 -0
- package/dist/{chunk-BVXIRVEC.js → chunk-CIPPTQDA.js} +219 -72
- package/dist/chunk-CIPPTQDA.js.map +1 -0
- package/dist/{chunk-Y7YTLAO2.js → chunk-P7UNMRZ5.js} +3 -3
- package/dist/{chunk-WSCUPAGR.js → chunk-SA3U25NU.js} +2 -1
- package/dist/{chunk-WSCUPAGR.js.map → chunk-SA3U25NU.js.map} +1 -1
- package/dist/{chunk-MWDG7UTB.js → chunk-ZBLU3Q22.js} +1 -1
- package/dist/{create-config-Bltg8Enl.d.ts → create-config-DOUq8Day.d.ts} +2 -2
- package/dist/index.d.ts +4 -3
- package/dist/index.js +8 -8
- package/dist/{sdk-config-B32_2bG3.d.ts → marketplace.gen-D0ADxbfH.d.ts} +1 -24
- package/dist/react/_internal/api/index.d.ts +4 -2
- package/dist/react/_internal/api/index.js +1 -1
- package/dist/react/_internal/databeat/index.css +82 -0
- package/dist/react/_internal/databeat/index.css.map +1 -0
- package/dist/react/_internal/databeat/index.d.ts +68 -0
- package/dist/react/_internal/databeat/index.js +26 -0
- package/dist/react/_internal/databeat/index.js.map +1 -0
- package/dist/react/_internal/index.d.ts +6 -5
- package/dist/react/_internal/index.js +1 -1
- package/dist/react/_internal/wagmi/index.d.ts +4 -3
- package/dist/react/hooks/index.d.ts +446 -5
- package/dist/react/hooks/index.js +19 -5
- package/dist/react/index.d.ts +7 -6
- package/dist/react/index.js +22 -7
- package/dist/react/ssr/index.js +1 -0
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/collectible-card/index.d.ts +4 -3
- package/dist/react/ui/components/collectible-card/index.js +8 -7
- package/dist/react/ui/components/marketplace-logos/index.js +1 -1
- package/dist/react/ui/index.d.ts +4 -3
- package/dist/react/ui/index.js +8 -7
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +4 -3
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +6 -6
- package/dist/sdk-config-xWkdBdrL.d.ts +24 -0
- package/dist/{services-BRBVE0mm.d.ts → services-Dd2MoBTM.d.ts} +2 -1
- package/dist/types/index.d.ts +4 -3
- package/dist/types/index.js +1 -1
- package/dist/{types-BY3husBh.d.ts → types-vOfhbBkR.d.ts} +3 -2
- package/dist/utils/abi/index.js +5 -5
- package/dist/utils/index.d.ts +4 -3
- package/dist/utils/index.js +8 -8
- package/package.json +2 -1
- package/src/react/_internal/api/query-keys.ts +1 -0
- package/src/react/_internal/databeat/index.ts +63 -0
- package/src/react/_internal/databeat/types.ts +70 -0
- package/src/react/hooks/__tests__/useComparePrices.test.tsx +215 -0
- package/src/react/hooks/__tests__/useConvertPriceToUSD.test.tsx +173 -0
- package/src/react/hooks/__tests__/useListCollectiblesPaginated.test.tsx +217 -0
- package/src/react/hooks/index.ts +3 -0
- package/src/react/hooks/useComparePrices.tsx +106 -0
- package/src/react/hooks/useConvertPriceToUSD.tsx +102 -0
- package/src/react/hooks/useFilters.tsx +9 -3
- package/src/react/hooks/useListCollectiblesPaginated.tsx +78 -0
- package/src/react/ui/components/collectible-card/CollectibleCard.tsx +1 -0
- package/src/react/ui/components/collectible-card/Footer.tsx +10 -2
- package/src/react/ui/modals/BuyModal/hooks/useBuyCollectable.ts +30 -3
- package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +40 -4
- package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +26 -2
- package/src/react/ui/modals/SellModal/Modal.tsx +3 -1
- package/src/react/ui/modals/SellModal/hooks/useSell.tsx +10 -7
- package/src/react/ui/modals/SellModal/hooks/useTransactionSteps.tsx +51 -13
- package/src/react/ui/modals/_internal/components/floorPriceText/index.tsx +30 -12
- package/src/react/ui/modals/_internal/components/priceInput/__tests__/index.test.tsx +51 -4
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +24 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/chunk-BVXIRVEC.js.map +0 -1
- package/dist/chunk-H5YWG6WN.js.map +0 -1
- /package/dist/{chunk-BZD2LDJJ.js.map → chunk-7C7ADZ2H.js.map} +0 -0
- /package/dist/{chunk-Y7YTLAO2.js.map → chunk-P7UNMRZ5.js.map} +0 -0
- /package/dist/{chunk-MWDG7UTB.js.map → chunk-ZBLU3Q22.js.map} +0 -0
- /package/src/react/ui/modals/BuyModal/hooks/__tests__/{useBuyCollectable.test.tsx → useBuyCollectable.test.tsx.bak} +0 -0
|
@@ -18,13 +18,13 @@ import {
|
|
|
18
18
|
compareAddress,
|
|
19
19
|
getPresentableChainName,
|
|
20
20
|
getPublicRpcClient
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import {
|
|
23
|
-
EIP2981_ABI
|
|
24
|
-
} from "./chunk-3OHM45R3.js";
|
|
21
|
+
} from "./chunk-7C7ADZ2H.js";
|
|
25
22
|
import {
|
|
26
23
|
ERC1155_ABI
|
|
27
24
|
} from "./chunk-WFE6OCYF.js";
|
|
25
|
+
import {
|
|
26
|
+
EIP2981_ABI
|
|
27
|
+
} from "./chunk-3OHM45R3.js";
|
|
28
28
|
import {
|
|
29
29
|
AddressSchema,
|
|
30
30
|
ChainIdSchema,
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
getMarketplaceClient,
|
|
63
63
|
getMetadataClient,
|
|
64
64
|
getQueryClient
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-SA3U25NU.js";
|
|
66
66
|
import {
|
|
67
67
|
BaseError,
|
|
68
68
|
ChainSwitchError,
|
|
@@ -981,6 +981,15 @@ var useCollection = (args) => {
|
|
|
981
981
|
return useQuery5(collectionOptions(args, config));
|
|
982
982
|
};
|
|
983
983
|
|
|
984
|
+
// src/react/hooks/useComparePrices.tsx
|
|
985
|
+
import { queryOptions as queryOptions9, useQuery as useQuery9 } from "@tanstack/react-query";
|
|
986
|
+
import { z as z9 } from "zod";
|
|
987
|
+
|
|
988
|
+
// src/react/hooks/useConvertPriceToUSD.tsx
|
|
989
|
+
import { queryOptions as queryOptions8, useQuery as useQuery8 } from "@tanstack/react-query";
|
|
990
|
+
import { formatUnits } from "viem";
|
|
991
|
+
import { z as z8 } from "zod";
|
|
992
|
+
|
|
984
993
|
// src/react/hooks/useCurrencies.tsx
|
|
985
994
|
import { queryOptions as queryOptions7, useQuery as useQuery7 } from "@tanstack/react-query";
|
|
986
995
|
import { zeroAddress as zeroAddress2 } from "viem";
|
|
@@ -1091,17 +1100,127 @@ var useCurrencies = (args) => {
|
|
|
1091
1100
|
return useQuery7(currenciesOptions(args, config));
|
|
1092
1101
|
};
|
|
1093
1102
|
|
|
1094
|
-
// src/react/hooks/
|
|
1095
|
-
import { queryOptions as queryOptions8, useQuery as useQuery8 } from "@tanstack/react-query";
|
|
1096
|
-
import { z as z8 } from "zod";
|
|
1103
|
+
// src/react/hooks/useConvertPriceToUSD.tsx
|
|
1097
1104
|
var ChainIdCoerce2 = ChainIdSchema.transform((val) => val.toString());
|
|
1098
|
-
var
|
|
1105
|
+
var UseConvertPriceToUSDArgsSchema = z8.object({
|
|
1099
1106
|
chainId: ChainIdCoerce2,
|
|
1100
1107
|
currencyAddress: AddressSchema,
|
|
1108
|
+
amountRaw: z8.string(),
|
|
1109
|
+
query: QueryArgSchema
|
|
1110
|
+
});
|
|
1111
|
+
var convertPriceToUSD = async (args, config) => {
|
|
1112
|
+
const parsedArgs = UseConvertPriceToUSDArgsSchema.parse(args);
|
|
1113
|
+
const queryClient = getQueryClient();
|
|
1114
|
+
const currencies = await queryClient.fetchQuery(
|
|
1115
|
+
currenciesOptions(
|
|
1116
|
+
{
|
|
1117
|
+
chainId: parsedArgs.chainId
|
|
1118
|
+
},
|
|
1119
|
+
config
|
|
1120
|
+
)
|
|
1121
|
+
);
|
|
1122
|
+
const currencyDetails = currencies.find(
|
|
1123
|
+
(c) => c.contractAddress.toLowerCase() === parsedArgs.currencyAddress.toLowerCase()
|
|
1124
|
+
);
|
|
1125
|
+
if (!currencyDetails) {
|
|
1126
|
+
throw new Error("Currency not found");
|
|
1127
|
+
}
|
|
1128
|
+
const amountDecimal = Number(
|
|
1129
|
+
formatUnits(BigInt(parsedArgs.amountRaw), currencyDetails.decimals)
|
|
1130
|
+
);
|
|
1131
|
+
const usdAmount = amountDecimal * currencyDetails.exchangeRate;
|
|
1132
|
+
return {
|
|
1133
|
+
usdAmount,
|
|
1134
|
+
usdAmountFormatted: usdAmount.toFixed(2)
|
|
1135
|
+
};
|
|
1136
|
+
};
|
|
1137
|
+
var convertPriceToUSDOptions = (args, config) => {
|
|
1138
|
+
return queryOptions8({
|
|
1139
|
+
...args.query,
|
|
1140
|
+
queryKey: [
|
|
1141
|
+
...currencyKeys.conversion,
|
|
1142
|
+
args.chainId,
|
|
1143
|
+
args.currencyAddress,
|
|
1144
|
+
args.amountRaw
|
|
1145
|
+
],
|
|
1146
|
+
queryFn: () => convertPriceToUSD(args, config)
|
|
1147
|
+
});
|
|
1148
|
+
};
|
|
1149
|
+
var useConvertPriceToUSD = (args) => {
|
|
1150
|
+
const config = useConfig();
|
|
1151
|
+
return useQuery8(convertPriceToUSDOptions(args, config));
|
|
1152
|
+
};
|
|
1153
|
+
|
|
1154
|
+
// src/react/hooks/useComparePrices.tsx
|
|
1155
|
+
var ChainIdCoerce3 = ChainIdSchema.transform((val) => val.toString());
|
|
1156
|
+
var UseComparePricesArgsSchema = z9.object({
|
|
1157
|
+
chainId: ChainIdCoerce3,
|
|
1158
|
+
// First price details
|
|
1159
|
+
priceAmountRaw: z9.string(),
|
|
1160
|
+
priceCurrencyAddress: AddressSchema,
|
|
1161
|
+
// Second price details (to compare against)
|
|
1162
|
+
compareToPriceAmountRaw: z9.string(),
|
|
1163
|
+
compareToPriceCurrencyAddress: AddressSchema,
|
|
1164
|
+
query: QueryArgSchema
|
|
1165
|
+
});
|
|
1166
|
+
var comparePrices = async (args, config) => {
|
|
1167
|
+
const parsedArgs = UseComparePricesArgsSchema.parse(args);
|
|
1168
|
+
const [priceUSD, compareToPriceUSD] = await Promise.all([
|
|
1169
|
+
convertPriceToUSD(
|
|
1170
|
+
{
|
|
1171
|
+
chainId: parsedArgs.chainId,
|
|
1172
|
+
currencyAddress: parsedArgs.priceCurrencyAddress,
|
|
1173
|
+
amountRaw: parsedArgs.priceAmountRaw,
|
|
1174
|
+
query: {}
|
|
1175
|
+
},
|
|
1176
|
+
config
|
|
1177
|
+
),
|
|
1178
|
+
convertPriceToUSD(
|
|
1179
|
+
{
|
|
1180
|
+
chainId: parsedArgs.chainId,
|
|
1181
|
+
currencyAddress: parsedArgs.compareToPriceCurrencyAddress,
|
|
1182
|
+
amountRaw: parsedArgs.compareToPriceAmountRaw,
|
|
1183
|
+
query: {}
|
|
1184
|
+
},
|
|
1185
|
+
config
|
|
1186
|
+
)
|
|
1187
|
+
]);
|
|
1188
|
+
const difference = priceUSD.usdAmount - compareToPriceUSD.usdAmount;
|
|
1189
|
+
if (compareToPriceUSD.usdAmount === 0) {
|
|
1190
|
+
throw new Error("Cannot compare to zero price");
|
|
1191
|
+
}
|
|
1192
|
+
const percentageDifference = difference / compareToPriceUSD.usdAmount * 100;
|
|
1193
|
+
const isAbove = percentageDifference > 0;
|
|
1194
|
+
const isSame = percentageDifference === 0;
|
|
1195
|
+
return {
|
|
1196
|
+
percentageDifference,
|
|
1197
|
+
percentageDifferenceFormatted: Math.abs(percentageDifference).toFixed(2),
|
|
1198
|
+
status: isAbove ? "above" : isSame ? "same" : "below"
|
|
1199
|
+
};
|
|
1200
|
+
};
|
|
1201
|
+
var comparePricesOptions = (args, config) => {
|
|
1202
|
+
return queryOptions9({
|
|
1203
|
+
...args.query,
|
|
1204
|
+
queryKey: [...currencyKeys.conversion, "compare", args],
|
|
1205
|
+
queryFn: () => comparePrices(args, config)
|
|
1206
|
+
});
|
|
1207
|
+
};
|
|
1208
|
+
var useComparePrices = (args) => {
|
|
1209
|
+
const config = useConfig();
|
|
1210
|
+
return useQuery9(comparePricesOptions(args, config));
|
|
1211
|
+
};
|
|
1212
|
+
|
|
1213
|
+
// src/react/hooks/useCurrency.tsx
|
|
1214
|
+
import { queryOptions as queryOptions10, useQuery as useQuery10 } from "@tanstack/react-query";
|
|
1215
|
+
import { z as z10 } from "zod";
|
|
1216
|
+
var ChainIdCoerce4 = ChainIdSchema.transform((val) => val.toString());
|
|
1217
|
+
var UseCurrencyArgsSchema = z10.object({
|
|
1218
|
+
chainId: ChainIdCoerce4,
|
|
1219
|
+
currencyAddress: AddressSchema,
|
|
1101
1220
|
query: QueryArgSchema
|
|
1102
1221
|
});
|
|
1103
1222
|
var fetchCurrency = async (chainId, currencyAddress, config) => {
|
|
1104
|
-
const parsedChainId =
|
|
1223
|
+
const parsedChainId = ChainIdCoerce4.parse(chainId);
|
|
1105
1224
|
const queryClient = getQueryClient();
|
|
1106
1225
|
let currencies = queryClient.getQueryData([...currencyKeys.lists, chainId]);
|
|
1107
1226
|
if (!currencies) {
|
|
@@ -1120,7 +1239,7 @@ var fetchCurrency = async (chainId, currencyAddress, config) => {
|
|
|
1120
1239
|
return currency;
|
|
1121
1240
|
};
|
|
1122
1241
|
var currencyOptions = (args, config) => {
|
|
1123
|
-
return
|
|
1242
|
+
return queryOptions10({
|
|
1124
1243
|
...args.query,
|
|
1125
1244
|
queryKey: [...currencyKeys.details, args.chainId, args.currencyAddress],
|
|
1126
1245
|
queryFn: () => fetchCurrency(args.chainId, args.currencyAddress, config)
|
|
@@ -1128,16 +1247,16 @@ var currencyOptions = (args, config) => {
|
|
|
1128
1247
|
};
|
|
1129
1248
|
var useCurrency = (args) => {
|
|
1130
1249
|
const config = useConfig();
|
|
1131
|
-
return
|
|
1250
|
+
return useQuery10(currencyOptions(args, config));
|
|
1132
1251
|
};
|
|
1133
1252
|
|
|
1134
1253
|
// src/react/hooks/useFilters.tsx
|
|
1135
|
-
import { queryOptions as
|
|
1136
|
-
import { z as
|
|
1137
|
-
var UseFiltersSchema =
|
|
1138
|
-
chainId: ChainIdSchema.pipe(
|
|
1254
|
+
import { queryOptions as queryOptions11, useQuery as useQuery11 } from "@tanstack/react-query";
|
|
1255
|
+
import { z as z11 } from "zod";
|
|
1256
|
+
var UseFiltersSchema = z11.object({
|
|
1257
|
+
chainId: ChainIdSchema.pipe(z11.coerce.string()),
|
|
1139
1258
|
collectionAddress: AddressSchema,
|
|
1140
|
-
showAllFilters:
|
|
1259
|
+
showAllFilters: z11.boolean().default(false).optional(),
|
|
1141
1260
|
query: QueryArgSchema
|
|
1142
1261
|
});
|
|
1143
1262
|
var fetchFilters = async (args, config) => {
|
|
@@ -1155,7 +1274,8 @@ var fetchFilters = async (args, config) => {
|
|
|
1155
1274
|
const collectionFilters = marketplaceConfig.collections.find(
|
|
1156
1275
|
(c) => compareAddress(c.address, parsedArgs.collectionAddress)
|
|
1157
1276
|
)?.filterSettings;
|
|
1158
|
-
if (!collectionFilters
|
|
1277
|
+
if (!collectionFilters?.exclusions || collectionFilters.exclusions.length === 0 || !collectionFilters.filterOrder || collectionFilters.filterOrder.length === 0)
|
|
1278
|
+
return filters;
|
|
1159
1279
|
const { filterOrder, exclusions } = collectionFilters;
|
|
1160
1280
|
const sortedFilters = filters.toSorted((a, b) => {
|
|
1161
1281
|
const aIndex = filterOrder.indexOf(a.name) > -1 ? filterOrder.indexOf(a.name) : filterOrder.length;
|
|
@@ -1185,7 +1305,7 @@ var fetchFilters = async (args, config) => {
|
|
|
1185
1305
|
return filteredResults;
|
|
1186
1306
|
};
|
|
1187
1307
|
var filtersOptions = (args, config) => {
|
|
1188
|
-
return
|
|
1308
|
+
return queryOptions11({
|
|
1189
1309
|
...args.query,
|
|
1190
1310
|
queryKey: [...collectableKeys.filter, args, config],
|
|
1191
1311
|
queryFn: () => fetchFilters(args, config)
|
|
@@ -1193,14 +1313,14 @@ var filtersOptions = (args, config) => {
|
|
|
1193
1313
|
};
|
|
1194
1314
|
var useFilters = (args) => {
|
|
1195
1315
|
const config = useConfig();
|
|
1196
|
-
return
|
|
1316
|
+
return useQuery11(filtersOptions(args, config));
|
|
1197
1317
|
};
|
|
1198
1318
|
|
|
1199
1319
|
// src/react/hooks/useFloorOrder.tsx
|
|
1200
|
-
import { queryOptions as
|
|
1201
|
-
import { z as
|
|
1202
|
-
var UseFloorOrderSchema =
|
|
1203
|
-
chainId: ChainIdSchema.pipe(
|
|
1320
|
+
import { queryOptions as queryOptions12, useQuery as useQuery12 } from "@tanstack/react-query";
|
|
1321
|
+
import { z as z12 } from "zod";
|
|
1322
|
+
var UseFloorOrderSchema = z12.object({
|
|
1323
|
+
chainId: ChainIdSchema.pipe(z12.coerce.string()),
|
|
1204
1324
|
collectionAddress: AddressSchema,
|
|
1205
1325
|
query: QueryArgSchema
|
|
1206
1326
|
});
|
|
@@ -1209,24 +1329,24 @@ var fetchFloorOrder = async (args, config) => {
|
|
|
1209
1329
|
return marketplaceClient.getFloorOrder({ contractAddress: args.collectionAddress }).then((data) => data.collectible);
|
|
1210
1330
|
};
|
|
1211
1331
|
var floorOrderOptions = (args, config) => {
|
|
1212
|
-
return
|
|
1332
|
+
return queryOptions12({
|
|
1213
1333
|
queryKey: [...collectableKeys.floorOrders, args, config],
|
|
1214
1334
|
queryFn: () => fetchFloorOrder(args, config)
|
|
1215
1335
|
});
|
|
1216
1336
|
};
|
|
1217
1337
|
var useFloorOrder = (args) => {
|
|
1218
1338
|
const config = useConfig();
|
|
1219
|
-
return
|
|
1339
|
+
return useQuery12(floorOrderOptions(args, config));
|
|
1220
1340
|
};
|
|
1221
1341
|
|
|
1222
1342
|
// src/react/hooks/useHighestOffer.tsx
|
|
1223
|
-
import { queryOptions as
|
|
1224
|
-
import { z as
|
|
1343
|
+
import { queryOptions as queryOptions13, useQuery as useQuery13 } from "@tanstack/react-query";
|
|
1344
|
+
import { z as z13 } from "zod";
|
|
1225
1345
|
var UseHighestOfferArgsSchema = getCollectibleHighestOfferArgsSchema.omit({
|
|
1226
1346
|
contractAddress: true
|
|
1227
1347
|
}).extend({
|
|
1228
1348
|
collectionAddress: AddressSchema,
|
|
1229
|
-
chainId: ChainIdSchema.pipe(
|
|
1349
|
+
chainId: ChainIdSchema.pipe(z13.coerce.string()),
|
|
1230
1350
|
query: QueryArgSchema
|
|
1231
1351
|
});
|
|
1232
1352
|
var fetchHighestOffer = async (args, config) => {
|
|
@@ -1238,7 +1358,7 @@ var fetchHighestOffer = async (args, config) => {
|
|
|
1238
1358
|
});
|
|
1239
1359
|
};
|
|
1240
1360
|
var highestOfferOptions = (args, config) => {
|
|
1241
|
-
return
|
|
1361
|
+
return queryOptions13({
|
|
1242
1362
|
...args.query,
|
|
1243
1363
|
queryKey: [...collectableKeys.highestOffers, args, config],
|
|
1244
1364
|
queryFn: () => fetchHighestOffer(args, config)
|
|
@@ -1246,40 +1366,40 @@ var highestOfferOptions = (args, config) => {
|
|
|
1246
1366
|
};
|
|
1247
1367
|
var useHighestOffer = (args) => {
|
|
1248
1368
|
const config = useConfig();
|
|
1249
|
-
return
|
|
1369
|
+
return useQuery13(highestOfferOptions(args, config));
|
|
1250
1370
|
};
|
|
1251
1371
|
|
|
1252
1372
|
// src/react/hooks/useListBalances.tsx
|
|
1253
1373
|
import { SortOrder as SortOrder2 } from "@0xsequence/indexer";
|
|
1254
1374
|
import { infiniteQueryOptions, useInfiniteQuery } from "@tanstack/react-query";
|
|
1255
|
-
import { z as
|
|
1256
|
-
var metadataOptionsSchema =
|
|
1257
|
-
verifiedOnly:
|
|
1258
|
-
unverifiedOnly:
|
|
1259
|
-
includeContracts:
|
|
1260
|
-
});
|
|
1261
|
-
var sortOrderSchema2 =
|
|
1262
|
-
var sortBySchema2 =
|
|
1263
|
-
column:
|
|
1375
|
+
import { z as z14 } from "zod";
|
|
1376
|
+
var metadataOptionsSchema = z14.object({
|
|
1377
|
+
verifiedOnly: z14.boolean().optional(),
|
|
1378
|
+
unverifiedOnly: z14.boolean().optional(),
|
|
1379
|
+
includeContracts: z14.array(z14.string()).optional()
|
|
1380
|
+
});
|
|
1381
|
+
var sortOrderSchema2 = z14.nativeEnum(SortOrder2);
|
|
1382
|
+
var sortBySchema2 = z14.object({
|
|
1383
|
+
column: z14.string(),
|
|
1264
1384
|
order: sortOrderSchema2
|
|
1265
1385
|
});
|
|
1266
|
-
var pageSchema2 =
|
|
1267
|
-
page:
|
|
1268
|
-
column:
|
|
1269
|
-
before:
|
|
1270
|
-
after:
|
|
1271
|
-
sort:
|
|
1272
|
-
pageSize:
|
|
1273
|
-
more:
|
|
1274
|
-
});
|
|
1275
|
-
var useListBalancesArgsSchema =
|
|
1276
|
-
chainId: ChainIdSchema.pipe(
|
|
1386
|
+
var pageSchema2 = z14.object({
|
|
1387
|
+
page: z14.number().optional(),
|
|
1388
|
+
column: z14.string().optional(),
|
|
1389
|
+
before: z14.any().optional(),
|
|
1390
|
+
after: z14.any().optional(),
|
|
1391
|
+
sort: z14.array(sortBySchema2).optional(),
|
|
1392
|
+
pageSize: z14.number().optional(),
|
|
1393
|
+
more: z14.boolean().optional()
|
|
1394
|
+
});
|
|
1395
|
+
var useListBalancesArgsSchema = z14.object({
|
|
1396
|
+
chainId: ChainIdSchema.pipe(z14.coerce.number()),
|
|
1277
1397
|
accountAddress: AddressSchema.optional(),
|
|
1278
1398
|
contractAddress: AddressSchema.optional(),
|
|
1279
|
-
tokenId:
|
|
1280
|
-
includeMetadata:
|
|
1399
|
+
tokenId: z14.string().optional(),
|
|
1400
|
+
includeMetadata: z14.boolean().optional(),
|
|
1281
1401
|
metadataOptions: metadataOptionsSchema.optional(),
|
|
1282
|
-
includeCollectionTokens:
|
|
1402
|
+
includeCollectionTokens: z14.boolean().optional(),
|
|
1283
1403
|
page: pageSchema2.optional(),
|
|
1284
1404
|
query: QueryArgSchema
|
|
1285
1405
|
});
|
|
@@ -1307,7 +1427,7 @@ var useListBalances = (args) => {
|
|
|
1307
1427
|
};
|
|
1308
1428
|
|
|
1309
1429
|
// src/react/hooks/useListCollectibleActivities.tsx
|
|
1310
|
-
import { queryOptions as
|
|
1430
|
+
import { queryOptions as queryOptions14, useQuery as useQuery14 } from "@tanstack/react-query";
|
|
1311
1431
|
var fetchCollectibleActivities = async (args, config) => {
|
|
1312
1432
|
const marketplaceClient = getMarketplaceClient(args.chainId, config);
|
|
1313
1433
|
return marketplaceClient.listCollectibleActivities({
|
|
@@ -1324,7 +1444,7 @@ var fetchCollectibleActivities = async (args, config) => {
|
|
|
1324
1444
|
}));
|
|
1325
1445
|
};
|
|
1326
1446
|
var listCollectibleActivitiesOptions = (args, config) => {
|
|
1327
|
-
return
|
|
1447
|
+
return queryOptions14({
|
|
1328
1448
|
queryKey: [...collectableKeys.collectibleActivities, args, config],
|
|
1329
1449
|
queryFn: () => fetchCollectibleActivities(args, config),
|
|
1330
1450
|
enabled: args.query?.enabled ?? true
|
|
@@ -1332,17 +1452,17 @@ var listCollectibleActivitiesOptions = (args, config) => {
|
|
|
1332
1452
|
};
|
|
1333
1453
|
var useListCollectibleActivities = (args) => {
|
|
1334
1454
|
const config = useConfig();
|
|
1335
|
-
return
|
|
1455
|
+
return useQuery14(listCollectibleActivitiesOptions(args, config));
|
|
1336
1456
|
};
|
|
1337
1457
|
|
|
1338
1458
|
// src/react/hooks/useListCollectibles.tsx
|
|
1339
1459
|
import { infiniteQueryOptions as infiniteQueryOptions2, useInfiniteQuery as useInfiniteQuery2 } from "@tanstack/react-query";
|
|
1340
|
-
import { z as
|
|
1460
|
+
import { z as z15 } from "zod";
|
|
1341
1461
|
var UseListCollectiblesArgsSchema = listCollectiblesArgsSchema.omit({
|
|
1342
1462
|
contractAddress: true
|
|
1343
1463
|
}).extend({
|
|
1344
1464
|
collectionAddress: AddressSchema,
|
|
1345
|
-
chainId: ChainIdSchema.pipe(
|
|
1465
|
+
chainId: ChainIdSchema.pipe(z15.coerce.string()),
|
|
1346
1466
|
query: QueryArgSchema
|
|
1347
1467
|
});
|
|
1348
1468
|
var fetchCollectibles = async (args, marketplaceClient, page) => {
|
|
@@ -1369,8 +1489,51 @@ var useListCollectibles = (args) => {
|
|
|
1369
1489
|
return useInfiniteQuery2(listCollectiblesOptions(args, config));
|
|
1370
1490
|
};
|
|
1371
1491
|
|
|
1492
|
+
// src/react/hooks/useListCollectiblesPaginated.tsx
|
|
1493
|
+
import { queryOptions as queryOptions15, useQuery as useQuery15 } from "@tanstack/react-query";
|
|
1494
|
+
import { z as z16 } from "zod";
|
|
1495
|
+
var UseListCollectiblesPaginatedArgsSchema = listCollectiblesArgsSchema.omit({
|
|
1496
|
+
contractAddress: true
|
|
1497
|
+
}).extend({
|
|
1498
|
+
collectionAddress: AddressSchema,
|
|
1499
|
+
chainId: ChainIdSchema.pipe(z16.coerce.string()),
|
|
1500
|
+
query: z16.object({
|
|
1501
|
+
enabled: z16.boolean().optional(),
|
|
1502
|
+
page: z16.number().optional().default(1),
|
|
1503
|
+
pageSize: z16.number().optional().default(30)
|
|
1504
|
+
}).optional().default({})
|
|
1505
|
+
});
|
|
1506
|
+
var fetchCollectiblesPaginated = async (args, marketplaceClient) => {
|
|
1507
|
+
const parsedArgs = UseListCollectiblesPaginatedArgsSchema.parse(args);
|
|
1508
|
+
const page = {
|
|
1509
|
+
page: parsedArgs.query?.page ?? 1,
|
|
1510
|
+
pageSize: parsedArgs.query?.pageSize ?? 30
|
|
1511
|
+
};
|
|
1512
|
+
const arg = {
|
|
1513
|
+
...parsedArgs,
|
|
1514
|
+
contractAddress: parsedArgs.collectionAddress,
|
|
1515
|
+
page
|
|
1516
|
+
};
|
|
1517
|
+
return marketplaceClient.listCollectibles(arg);
|
|
1518
|
+
};
|
|
1519
|
+
var listCollectiblesPaginatedOptions = (args, config) => {
|
|
1520
|
+
const marketplaceClient = getMarketplaceClient(
|
|
1521
|
+
args.chainId,
|
|
1522
|
+
config
|
|
1523
|
+
);
|
|
1524
|
+
return queryOptions15({
|
|
1525
|
+
queryKey: [...collectableKeys.lists, "paginated", args],
|
|
1526
|
+
queryFn: () => fetchCollectiblesPaginated(args, marketplaceClient),
|
|
1527
|
+
enabled: args.query?.enabled ?? true
|
|
1528
|
+
});
|
|
1529
|
+
};
|
|
1530
|
+
var useListCollectiblesPaginated = (args) => {
|
|
1531
|
+
const config = useConfig();
|
|
1532
|
+
return useQuery15(listCollectiblesPaginatedOptions(args, config));
|
|
1533
|
+
};
|
|
1534
|
+
|
|
1372
1535
|
// src/react/hooks/useListCollectionActivities.tsx
|
|
1373
|
-
import { queryOptions as
|
|
1536
|
+
import { queryOptions as queryOptions16, useQuery as useQuery16 } from "@tanstack/react-query";
|
|
1374
1537
|
var fetchListCollectionActivities = async (args, config) => {
|
|
1375
1538
|
const marketplaceClient = getMarketplaceClient(args.chainId, config);
|
|
1376
1539
|
return marketplaceClient.listCollectionActivities({
|
|
@@ -1386,7 +1549,7 @@ var fetchListCollectionActivities = async (args, config) => {
|
|
|
1386
1549
|
}));
|
|
1387
1550
|
};
|
|
1388
1551
|
var listCollectionActivitiesOptions = (args, config) => {
|
|
1389
|
-
return
|
|
1552
|
+
return queryOptions16({
|
|
1390
1553
|
queryKey: [...collectionKeys.collectionActivities, args, config],
|
|
1391
1554
|
queryFn: () => fetchListCollectionActivities(args, config),
|
|
1392
1555
|
enabled: args.query?.enabled ?? true
|
|
@@ -1394,16 +1557,16 @@ var listCollectionActivitiesOptions = (args, config) => {
|
|
|
1394
1557
|
};
|
|
1395
1558
|
var useListCollectionActivities = (args) => {
|
|
1396
1559
|
const config = useConfig();
|
|
1397
|
-
return
|
|
1560
|
+
return useQuery16(listCollectionActivitiesOptions(args, config));
|
|
1398
1561
|
};
|
|
1399
1562
|
|
|
1400
1563
|
// src/react/hooks/useListOffersForCollectible.tsx
|
|
1401
|
-
import { queryOptions as
|
|
1402
|
-
import { z as
|
|
1564
|
+
import { queryOptions as queryOptions17, useQuery as useQuery17 } from "@tanstack/react-query";
|
|
1565
|
+
import { z as z17 } from "zod";
|
|
1403
1566
|
var UseListOffersForCollectibleArgsSchema = listOffersForCollectibleArgsSchema.extend({
|
|
1404
|
-
chainId: ChainIdSchema.pipe(
|
|
1405
|
-
collectionAddress:
|
|
1406
|
-
collectibleId:
|
|
1567
|
+
chainId: ChainIdSchema.pipe(z17.coerce.string()),
|
|
1568
|
+
collectionAddress: z17.string(),
|
|
1569
|
+
collectibleId: z17.string()
|
|
1407
1570
|
}).omit({ contractAddress: true, tokenId: true });
|
|
1408
1571
|
var fetchListOffersForCollectible = async (config, args) => {
|
|
1409
1572
|
const arg = {
|
|
@@ -1416,26 +1579,26 @@ var fetchListOffersForCollectible = async (config, args) => {
|
|
|
1416
1579
|
return marketplaceClient.listCollectibleOffers(arg);
|
|
1417
1580
|
};
|
|
1418
1581
|
var listOffersForCollectibleOptions = (args, config) => {
|
|
1419
|
-
return
|
|
1582
|
+
return queryOptions17({
|
|
1420
1583
|
queryKey: [...collectableKeys.offers, args, config],
|
|
1421
1584
|
queryFn: () => fetchListOffersForCollectible(config, args)
|
|
1422
1585
|
});
|
|
1423
1586
|
};
|
|
1424
1587
|
var useListOffersForCollectible = (args) => {
|
|
1425
1588
|
const config = useConfig();
|
|
1426
|
-
return
|
|
1589
|
+
return useQuery17(listOffersForCollectibleOptions(args, config));
|
|
1427
1590
|
};
|
|
1428
1591
|
|
|
1429
1592
|
// src/react/hooks/useCountOffersForCollectible.tsx
|
|
1430
|
-
import { queryOptions as
|
|
1431
|
-
import { z as
|
|
1593
|
+
import { queryOptions as queryOptions18, useQuery as useQuery18 } from "@tanstack/react-query";
|
|
1594
|
+
import { z as z18 } from "zod";
|
|
1432
1595
|
var UseCountOffersForCollectibleArgsSchema = countOffersForCollectibleArgsSchema.omit({
|
|
1433
1596
|
contractAddress: true,
|
|
1434
1597
|
tokenId: true
|
|
1435
1598
|
}).extend({
|
|
1436
1599
|
collectionAddress: AddressSchema,
|
|
1437
|
-
collectibleId:
|
|
1438
|
-
chainId: ChainIdSchema.pipe(
|
|
1600
|
+
collectibleId: z18.string(),
|
|
1601
|
+
chainId: ChainIdSchema.pipe(z18.coerce.string()),
|
|
1439
1602
|
query: QueryArgSchema
|
|
1440
1603
|
});
|
|
1441
1604
|
var fetchCountOffersForCollectible = async (args, config) => {
|
|
@@ -1448,7 +1611,7 @@ var fetchCountOffersForCollectible = async (args, config) => {
|
|
|
1448
1611
|
});
|
|
1449
1612
|
};
|
|
1450
1613
|
var countOffersForCollectibleOptions = (args, config) => {
|
|
1451
|
-
return
|
|
1614
|
+
return queryOptions18({
|
|
1452
1615
|
...args.query,
|
|
1453
1616
|
queryKey: [...collectableKeys.offersCount, args, config],
|
|
1454
1617
|
queryFn: () => fetchCountOffersForCollectible(args, config)
|
|
@@ -1456,16 +1619,16 @@ var countOffersForCollectibleOptions = (args, config) => {
|
|
|
1456
1619
|
};
|
|
1457
1620
|
var useCountOffersForCollectible = (args) => {
|
|
1458
1621
|
const config = useConfig();
|
|
1459
|
-
return
|
|
1622
|
+
return useQuery18(countOffersForCollectibleOptions(args, config));
|
|
1460
1623
|
};
|
|
1461
1624
|
|
|
1462
1625
|
// src/react/hooks/useListListingsForCollectible.tsx
|
|
1463
|
-
import { queryOptions as
|
|
1464
|
-
import { z as
|
|
1626
|
+
import { queryOptions as queryOptions19, useQuery as useQuery19 } from "@tanstack/react-query";
|
|
1627
|
+
import { z as z19 } from "zod";
|
|
1465
1628
|
var UseListListingsForCollectibleArgsSchema = listListingsForCollectibleArgsSchema.extend({
|
|
1466
|
-
chainId: ChainIdSchema.pipe(
|
|
1467
|
-
collectionAddress:
|
|
1468
|
-
collectibleId:
|
|
1629
|
+
chainId: ChainIdSchema.pipe(z19.coerce.string()),
|
|
1630
|
+
collectionAddress: z19.string(),
|
|
1631
|
+
collectibleId: z19.string()
|
|
1469
1632
|
}).omit({ contractAddress: true, tokenId: true });
|
|
1470
1633
|
var fetchListListingsForCollectible = async (config, args) => {
|
|
1471
1634
|
const arg = {
|
|
@@ -1478,26 +1641,26 @@ var fetchListListingsForCollectible = async (config, args) => {
|
|
|
1478
1641
|
return marketplaceClient.listCollectibleListings(arg);
|
|
1479
1642
|
};
|
|
1480
1643
|
var listListingsForCollectibleOptions = (args, config) => {
|
|
1481
|
-
return
|
|
1644
|
+
return queryOptions19({
|
|
1482
1645
|
queryKey: [...collectableKeys.listings, args, config],
|
|
1483
1646
|
queryFn: () => fetchListListingsForCollectible(config, args)
|
|
1484
1647
|
});
|
|
1485
1648
|
};
|
|
1486
1649
|
var useListListingsForCollectible = (args) => {
|
|
1487
1650
|
const config = useConfig();
|
|
1488
|
-
return
|
|
1651
|
+
return useQuery19(listListingsForCollectibleOptions(args, config));
|
|
1489
1652
|
};
|
|
1490
1653
|
|
|
1491
1654
|
// src/react/hooks/useCountListingsForCollectible.tsx
|
|
1492
|
-
import { queryOptions as
|
|
1493
|
-
import { z as
|
|
1655
|
+
import { queryOptions as queryOptions20, useQuery as useQuery20 } from "@tanstack/react-query";
|
|
1656
|
+
import { z as z20 } from "zod";
|
|
1494
1657
|
var UseCountListingsForCollectibleArgsSchema = countListingsForCollectibleArgsSchema.omit({
|
|
1495
1658
|
contractAddress: true,
|
|
1496
1659
|
tokenId: true
|
|
1497
1660
|
}).extend({
|
|
1498
1661
|
collectionAddress: AddressSchema,
|
|
1499
|
-
collectibleId:
|
|
1500
|
-
chainId: ChainIdSchema.pipe(
|
|
1662
|
+
collectibleId: z20.string(),
|
|
1663
|
+
chainId: ChainIdSchema.pipe(z20.coerce.string()),
|
|
1501
1664
|
query: QueryArgSchema
|
|
1502
1665
|
});
|
|
1503
1666
|
var fetchCountListingsForCollectible = async (args, config) => {
|
|
@@ -1510,7 +1673,7 @@ var fetchCountListingsForCollectible = async (args, config) => {
|
|
|
1510
1673
|
});
|
|
1511
1674
|
};
|
|
1512
1675
|
var countListingsForCollectibleOptions = (args, config) => {
|
|
1513
|
-
return
|
|
1676
|
+
return queryOptions20({
|
|
1514
1677
|
...args.query,
|
|
1515
1678
|
queryKey: [...collectableKeys.listingsCount, args, config],
|
|
1516
1679
|
queryFn: () => fetchCountListingsForCollectible(args, config)
|
|
@@ -1518,17 +1681,17 @@ var countListingsForCollectibleOptions = (args, config) => {
|
|
|
1518
1681
|
};
|
|
1519
1682
|
var useCountListingsForCollectible = (args) => {
|
|
1520
1683
|
const config = useConfig();
|
|
1521
|
-
return
|
|
1684
|
+
return useQuery20(countListingsForCollectibleOptions(args, config));
|
|
1522
1685
|
};
|
|
1523
1686
|
|
|
1524
1687
|
// src/react/hooks/useLowestListing.tsx
|
|
1525
|
-
import { queryOptions as
|
|
1526
|
-
import { z as
|
|
1688
|
+
import { queryOptions as queryOptions21, useQuery as useQuery21 } from "@tanstack/react-query";
|
|
1689
|
+
import { z as z21 } from "zod";
|
|
1527
1690
|
var UseLowestListingSchema = getCollectibleLowestListingArgsSchema.omit({
|
|
1528
1691
|
contractAddress: true
|
|
1529
1692
|
}).extend({
|
|
1530
1693
|
collectionAddress: AddressSchema,
|
|
1531
|
-
chainId: ChainIdSchema.pipe(
|
|
1694
|
+
chainId: ChainIdSchema.pipe(z21.coerce.string()),
|
|
1532
1695
|
query: QueryArgSchema
|
|
1533
1696
|
});
|
|
1534
1697
|
var fetchLowestListing = async (args, config) => {
|
|
@@ -1540,7 +1703,7 @@ var fetchLowestListing = async (args, config) => {
|
|
|
1540
1703
|
});
|
|
1541
1704
|
};
|
|
1542
1705
|
var lowestListingOptions = (args, config) => {
|
|
1543
|
-
return
|
|
1706
|
+
return queryOptions21({
|
|
1544
1707
|
...args.query,
|
|
1545
1708
|
queryKey: [...collectableKeys.lowestListings, args, config],
|
|
1546
1709
|
queryFn: () => fetchLowestListing(args, config)
|
|
@@ -1548,17 +1711,17 @@ var lowestListingOptions = (args, config) => {
|
|
|
1548
1711
|
};
|
|
1549
1712
|
var useLowestListing = (args) => {
|
|
1550
1713
|
const config = useConfig();
|
|
1551
|
-
return
|
|
1714
|
+
return useQuery21(lowestListingOptions(args, config));
|
|
1552
1715
|
};
|
|
1553
1716
|
|
|
1554
1717
|
// src/react/hooks/useRoyaltyPercentage.tsx
|
|
1555
|
-
import { queryOptions as
|
|
1718
|
+
import { queryOptions as queryOptions22, useQuery as useQuery22 } from "@tanstack/react-query";
|
|
1556
1719
|
import { getContract } from "viem";
|
|
1557
|
-
import { z as
|
|
1558
|
-
var UseRoyaletyPercentageSchema =
|
|
1559
|
-
chainId: ChainIdSchema.pipe(
|
|
1720
|
+
import { z as z22 } from "zod";
|
|
1721
|
+
var UseRoyaletyPercentageSchema = z22.object({
|
|
1722
|
+
chainId: ChainIdSchema.pipe(z22.coerce.string()),
|
|
1560
1723
|
collectionAddress: AddressSchema,
|
|
1561
|
-
collectibleId:
|
|
1724
|
+
collectibleId: z22.string(),
|
|
1562
1725
|
query: QueryArgSchema
|
|
1563
1726
|
});
|
|
1564
1727
|
var fetchRoyaletyPercentage = async (args) => {
|
|
@@ -1579,13 +1742,13 @@ var fetchRoyaletyPercentage = async (args) => {
|
|
|
1579
1742
|
return 0n;
|
|
1580
1743
|
}
|
|
1581
1744
|
};
|
|
1582
|
-
var royaletyPercentageOptions = (args) =>
|
|
1745
|
+
var royaletyPercentageOptions = (args) => queryOptions22({
|
|
1583
1746
|
...args.query,
|
|
1584
1747
|
queryKey: [...collectableKeys.royaltyPercentage, args],
|
|
1585
1748
|
queryFn: () => fetchRoyaletyPercentage(args)
|
|
1586
1749
|
});
|
|
1587
1750
|
var useRoyaltyPercentage = (args) => {
|
|
1588
|
-
return
|
|
1751
|
+
return useQuery22(royaletyPercentageOptions(args));
|
|
1589
1752
|
};
|
|
1590
1753
|
|
|
1591
1754
|
// src/react/hooks/useGenerateListingTransaction.tsx
|
|
@@ -1644,13 +1807,13 @@ var useGenerateOfferTransaction = (params) => {
|
|
|
1644
1807
|
|
|
1645
1808
|
// src/react/hooks/useGenerateSellTransaction.tsx
|
|
1646
1809
|
import { useMutation as useMutation3 } from "@tanstack/react-query";
|
|
1647
|
-
import { z as
|
|
1648
|
-
var UserGeneratSellTransactionArgsSchema =
|
|
1649
|
-
chainId: ChainIdSchema.pipe(
|
|
1650
|
-
onSuccess:
|
|
1810
|
+
import { z as z23 } from "zod";
|
|
1811
|
+
var UserGeneratSellTransactionArgsSchema = z23.object({
|
|
1812
|
+
chainId: ChainIdSchema.pipe(z23.coerce.string()),
|
|
1813
|
+
onSuccess: z23.function().args(stepSchema.array().optional()).optional()
|
|
1651
1814
|
});
|
|
1652
1815
|
var generateSellTransaction = async (args, config, chainId) => {
|
|
1653
|
-
const parsedChainId = ChainIdSchema.pipe(
|
|
1816
|
+
const parsedChainId = ChainIdSchema.pipe(z23.coerce.string()).parse(chainId);
|
|
1654
1817
|
const marketplaceClient = getMarketplaceClient(parsedChainId, config);
|
|
1655
1818
|
return marketplaceClient.generateSellTransaction(args).then((data) => data.steps);
|
|
1656
1819
|
};
|
|
@@ -1669,13 +1832,13 @@ var useGenerateSellTransaction = (params) => {
|
|
|
1669
1832
|
|
|
1670
1833
|
// src/react/hooks/useGenerateCancelTransaction.tsx
|
|
1671
1834
|
import { useMutation as useMutation4 } from "@tanstack/react-query";
|
|
1672
|
-
import { z as
|
|
1673
|
-
var UserGenerateCancelTransactionArgsSchema =
|
|
1674
|
-
chainId: ChainIdSchema.pipe(
|
|
1675
|
-
onSuccess:
|
|
1835
|
+
import { z as z24 } from "zod";
|
|
1836
|
+
var UserGenerateCancelTransactionArgsSchema = z24.object({
|
|
1837
|
+
chainId: ChainIdSchema.pipe(z24.coerce.string()),
|
|
1838
|
+
onSuccess: z24.function().args(stepSchema.array().optional()).optional()
|
|
1676
1839
|
});
|
|
1677
1840
|
var generateCancelTransaction = async (args, config, chainId) => {
|
|
1678
|
-
const parsedChainId = ChainIdSchema.pipe(
|
|
1841
|
+
const parsedChainId = ChainIdSchema.pipe(z24.coerce.string()).parse(chainId);
|
|
1679
1842
|
const marketplaceClient = getMarketplaceClient(parsedChainId, config);
|
|
1680
1843
|
return marketplaceClient.generateCancelTransaction(args).then((data) => data.steps);
|
|
1681
1844
|
};
|
|
@@ -1748,16 +1911,16 @@ var useTransferTokens = () => {
|
|
|
1748
1911
|
};
|
|
1749
1912
|
|
|
1750
1913
|
// src/react/hooks/useCheckoutOptions.tsx
|
|
1751
|
-
import { queryOptions as
|
|
1914
|
+
import { queryOptions as queryOptions23, useQuery as useQuery23 } from "@tanstack/react-query";
|
|
1752
1915
|
import { useAccount as useAccount3 } from "wagmi";
|
|
1753
|
-
import { z as
|
|
1754
|
-
var UseCheckoutOptionsSchema =
|
|
1755
|
-
chainId: ChainIdSchema.pipe(
|
|
1756
|
-
orders:
|
|
1757
|
-
|
|
1916
|
+
import { z as z25 } from "zod";
|
|
1917
|
+
var UseCheckoutOptionsSchema = z25.object({
|
|
1918
|
+
chainId: ChainIdSchema.pipe(z25.coerce.string()),
|
|
1919
|
+
orders: z25.array(
|
|
1920
|
+
z25.object({
|
|
1758
1921
|
collectionAddress: AddressSchema,
|
|
1759
|
-
orderId:
|
|
1760
|
-
marketplace:
|
|
1922
|
+
orderId: z25.string(),
|
|
1923
|
+
marketplace: z25.nativeEnum(MarketplaceKind)
|
|
1761
1924
|
})
|
|
1762
1925
|
),
|
|
1763
1926
|
query: QueryArgSchema
|
|
@@ -1776,7 +1939,7 @@ var fetchCheckoutOptions = async (args, config) => {
|
|
|
1776
1939
|
});
|
|
1777
1940
|
};
|
|
1778
1941
|
var checkoutOptionsOptions = (args, config) => {
|
|
1779
|
-
return
|
|
1942
|
+
return queryOptions23({
|
|
1780
1943
|
queryKey: ["checkoutOptions", args],
|
|
1781
1944
|
queryFn: () => fetchCheckoutOptions(args, config)
|
|
1782
1945
|
});
|
|
@@ -1784,16 +1947,16 @@ var checkoutOptionsOptions = (args, config) => {
|
|
|
1784
1947
|
var useCheckoutOptions = (args) => {
|
|
1785
1948
|
const { address } = useAccount3();
|
|
1786
1949
|
const config = useConfig();
|
|
1787
|
-
return
|
|
1950
|
+
return useQuery23(
|
|
1788
1951
|
// biome-ignore lint/style/noNonNullAssertion: <explanation>
|
|
1789
1952
|
checkoutOptionsOptions({ walletAddress: address, ...args }, config)
|
|
1790
1953
|
);
|
|
1791
1954
|
};
|
|
1792
1955
|
|
|
1793
1956
|
// src/react/hooks/useListCollections.tsx
|
|
1794
|
-
import { queryOptions as
|
|
1795
|
-
import { z as
|
|
1796
|
-
var UseListCollectionsSchema =
|
|
1957
|
+
import { queryOptions as queryOptions24, useQuery as useQuery24 } from "@tanstack/react-query";
|
|
1958
|
+
import { z as z26 } from "zod";
|
|
1959
|
+
var UseListCollectionsSchema = z26.object({
|
|
1797
1960
|
query: QueryArgSchema.optional().default({})
|
|
1798
1961
|
});
|
|
1799
1962
|
var fetchListCollections = async ({ marketplaceConfig }, config) => {
|
|
@@ -1819,7 +1982,7 @@ var fetchListCollections = async ({ marketplaceConfig }, config) => {
|
|
|
1819
1982
|
return results.flat();
|
|
1820
1983
|
};
|
|
1821
1984
|
var listCollectionsOptions = (args, config) => {
|
|
1822
|
-
return
|
|
1985
|
+
return queryOptions24({
|
|
1823
1986
|
...args.query,
|
|
1824
1987
|
queryKey: [...collectionKeys.list],
|
|
1825
1988
|
queryFn: () => fetchListCollections(args, config)
|
|
@@ -1828,7 +1991,7 @@ var listCollectionsOptions = (args, config) => {
|
|
|
1828
1991
|
var useListCollections = (args = {}) => {
|
|
1829
1992
|
const config = useConfig();
|
|
1830
1993
|
const { data: marketplaceConfig, isLoading: isLoadingConfig } = useMarketplaceConfig();
|
|
1831
|
-
return
|
|
1994
|
+
return useQuery24({
|
|
1832
1995
|
...listCollectionsOptions(
|
|
1833
1996
|
// biome-ignore lint/style/noNonNullAssertion: <explanation>
|
|
1834
1997
|
{ marketplaceConfig, query: args.query },
|
|
@@ -1839,21 +2002,21 @@ var useListCollections = (args = {}) => {
|
|
|
1839
2002
|
};
|
|
1840
2003
|
|
|
1841
2004
|
// src/react/hooks/useGenerateBuyTransaction.tsx
|
|
1842
|
-
import { queryOptions as
|
|
2005
|
+
import { queryOptions as queryOptions25, skipToken as skipToken2, useQuery as useQuery25 } from "@tanstack/react-query";
|
|
1843
2006
|
import { useAccount as useAccount4 } from "wagmi";
|
|
1844
|
-
import { z as
|
|
1845
|
-
var UseGenerateBuyTransactionArgsSchema =
|
|
1846
|
-
chainId: ChainIdSchema.pipe(
|
|
2007
|
+
import { z as z27 } from "zod";
|
|
2008
|
+
var UseGenerateBuyTransactionArgsSchema = z27.object({
|
|
2009
|
+
chainId: ChainIdSchema.pipe(z27.coerce.string()),
|
|
1847
2010
|
collectionAddress: AddressSchema,
|
|
1848
|
-
marketplace:
|
|
1849
|
-
ordersData:
|
|
1850
|
-
|
|
1851
|
-
orderId:
|
|
1852
|
-
quantity:
|
|
1853
|
-
marketplace:
|
|
2011
|
+
marketplace: z27.nativeEnum(MarketplaceKind),
|
|
2012
|
+
ordersData: z27.array(
|
|
2013
|
+
z27.object({
|
|
2014
|
+
orderId: z27.string(),
|
|
2015
|
+
quantity: z27.string(),
|
|
2016
|
+
marketplace: z27.string()
|
|
1854
2017
|
})
|
|
1855
2018
|
),
|
|
1856
|
-
walletType:
|
|
2019
|
+
walletType: z27.nativeEnum(WalletKind).optional(),
|
|
1857
2020
|
query: QueryArgSchema
|
|
1858
2021
|
});
|
|
1859
2022
|
var fetchGenerateBuyTransaction = async (args, config) => {
|
|
@@ -1867,7 +2030,7 @@ var fetchGenerateBuyTransaction = async (args, config) => {
|
|
|
1867
2030
|
}).then((data) => data.steps);
|
|
1868
2031
|
};
|
|
1869
2032
|
var generateBuyTransactionOptions = (args, config) => {
|
|
1870
|
-
return
|
|
2033
|
+
return queryOptions25({
|
|
1871
2034
|
queryKey: ["generateBuyTransaction", args],
|
|
1872
2035
|
queryFn: () => fetchGenerateBuyTransaction(args, config),
|
|
1873
2036
|
...args.query
|
|
@@ -1876,7 +2039,7 @@ var generateBuyTransactionOptions = (args, config) => {
|
|
|
1876
2039
|
var useGenerateBuyTransaction = (args) => {
|
|
1877
2040
|
const { address } = useAccount4();
|
|
1878
2041
|
const config = useConfig();
|
|
1879
|
-
return
|
|
2042
|
+
return useQuery25({
|
|
1880
2043
|
queryKey: ["generateBuyTransaction", args],
|
|
1881
2044
|
queryFn: address ? () => {
|
|
1882
2045
|
return fetchGenerateBuyTransaction(
|
|
@@ -1892,7 +2055,7 @@ import { useState, useEffect } from "react";
|
|
|
1892
2055
|
|
|
1893
2056
|
// src/react/_internal/wallet/useWallet.ts
|
|
1894
2057
|
import { useAccount as useAccount5, useChainId, useSwitchChain, useWalletClient } from "wagmi";
|
|
1895
|
-
import { useQuery as
|
|
2058
|
+
import { useQuery as useQuery26 } from "@tanstack/react-query";
|
|
1896
2059
|
|
|
1897
2060
|
// src/react/_internal/wallet/wallet.ts
|
|
1898
2061
|
import {
|
|
@@ -2152,7 +2315,7 @@ var useWallet = () => {
|
|
|
2152
2315
|
const { connector, isConnected, isConnecting } = useAccount5();
|
|
2153
2316
|
const sdkConfig = useConfig();
|
|
2154
2317
|
const chainId = useChainId();
|
|
2155
|
-
const { data, isLoading, isError } =
|
|
2318
|
+
const { data, isLoading, isError } = useQuery26({
|
|
2156
2319
|
queryKey: ["wallet", chainId, connector?.uid],
|
|
2157
2320
|
queryFn: () => {
|
|
2158
2321
|
if (!walletClient || !connector || !isConnected) {
|
|
@@ -2547,7 +2710,7 @@ var useCancelOrder = ({
|
|
|
2547
2710
|
};
|
|
2548
2711
|
|
|
2549
2712
|
// src/react/hooks/useCollectionDetails.tsx
|
|
2550
|
-
import { queryOptions as
|
|
2713
|
+
import { queryOptions as queryOptions26, useQuery as useQuery27 } from "@tanstack/react-query";
|
|
2551
2714
|
var fetchCollectionDetails = async (args, marketplaceClient) => {
|
|
2552
2715
|
const { collection } = await marketplaceClient.getCollectionDetail({
|
|
2553
2716
|
contractAddress: args.collectionAddress
|
|
@@ -2556,18 +2719,18 @@ var fetchCollectionDetails = async (args, marketplaceClient) => {
|
|
|
2556
2719
|
};
|
|
2557
2720
|
var collectionDetailsOptions = (args, config) => {
|
|
2558
2721
|
const marketplaceClient = getMarketplaceClient(args.chainId, config);
|
|
2559
|
-
return
|
|
2722
|
+
return queryOptions26({
|
|
2560
2723
|
queryKey: ["collectionDetails", args],
|
|
2561
2724
|
queryFn: () => fetchCollectionDetails(args, marketplaceClient)
|
|
2562
2725
|
});
|
|
2563
2726
|
};
|
|
2564
2727
|
var useCollectionDetails = (args) => {
|
|
2565
2728
|
const config = useConfig();
|
|
2566
|
-
return
|
|
2729
|
+
return useQuery27(collectionDetailsOptions(args, config));
|
|
2567
2730
|
};
|
|
2568
2731
|
|
|
2569
2732
|
// src/react/hooks/useCollectionDetailsPolling.tsx
|
|
2570
|
-
import { queryOptions as
|
|
2733
|
+
import { queryOptions as queryOptions27, useQuery as useQuery28 } from "@tanstack/react-query";
|
|
2571
2734
|
var INITIAL_POLLING_INTERVAL = 2e3;
|
|
2572
2735
|
var MAX_POLLING_INTERVAL = 3e4;
|
|
2573
2736
|
var MAX_ATTEMPTS = 30;
|
|
@@ -2580,7 +2743,7 @@ var isTerminalState = (status) => {
|
|
|
2580
2743
|
].includes(status);
|
|
2581
2744
|
};
|
|
2582
2745
|
var collectionDetailsPollingOptions = (args, config) => {
|
|
2583
|
-
return
|
|
2746
|
+
return queryOptions27({
|
|
2584
2747
|
...collectionDetailsOptions(args, config),
|
|
2585
2748
|
refetchInterval: (query) => {
|
|
2586
2749
|
const data = query.state.data;
|
|
@@ -2603,7 +2766,7 @@ var collectionDetailsPollingOptions = (args, config) => {
|
|
|
2603
2766
|
};
|
|
2604
2767
|
var useCollectionDetailsPolling = (args) => {
|
|
2605
2768
|
const config = useConfig();
|
|
2606
|
-
return
|
|
2769
|
+
return useQuery28(collectionDetailsPollingOptions(args, config));
|
|
2607
2770
|
};
|
|
2608
2771
|
|
|
2609
2772
|
export {
|
|
@@ -2626,6 +2789,11 @@ export {
|
|
|
2626
2789
|
useMarketplaceConfig,
|
|
2627
2790
|
currenciesOptions,
|
|
2628
2791
|
useCurrencies,
|
|
2792
|
+
convertPriceToUSD,
|
|
2793
|
+
convertPriceToUSDOptions,
|
|
2794
|
+
useConvertPriceToUSD,
|
|
2795
|
+
comparePricesOptions,
|
|
2796
|
+
useComparePrices,
|
|
2629
2797
|
currencyOptions,
|
|
2630
2798
|
useCurrency,
|
|
2631
2799
|
fetchFilters,
|
|
@@ -2642,6 +2810,8 @@ export {
|
|
|
2642
2810
|
useListCollectibleActivities,
|
|
2643
2811
|
listCollectiblesOptions,
|
|
2644
2812
|
useListCollectibles,
|
|
2813
|
+
listCollectiblesPaginatedOptions,
|
|
2814
|
+
useListCollectiblesPaginated,
|
|
2645
2815
|
listCollectionActivitiesOptions,
|
|
2646
2816
|
useListCollectionActivities,
|
|
2647
2817
|
listOffersForCollectibleOptions,
|
|
@@ -2684,4 +2854,4 @@ export {
|
|
|
2684
2854
|
collectionDetailsPollingOptions,
|
|
2685
2855
|
useCollectionDetailsPolling
|
|
2686
2856
|
};
|
|
2687
|
-
//# sourceMappingURL=chunk-
|
|
2857
|
+
//# sourceMappingURL=chunk-AXTDPTRD.js.map
|