@0xsequence/marketplace-sdk 0.8.1 → 0.8.3

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 (101) hide show
  1. package/.changeset/flat-parks-clean.md +8 -0
  2. package/.changeset/red-buckets-deny.md +6 -0
  3. package/CHANGELOG.md +17 -0
  4. package/dist/{builder-types-QlHwc9bI.d.ts → builder-types-BY6eD6vD.d.ts} +1 -1
  5. package/dist/{chunk-IZ44XPBH.js → chunk-25CAMYCG.js} +2 -2
  6. package/dist/{chunk-ABSYNRT5.js → chunk-5ATGT5S4.js} +3 -11
  7. package/dist/chunk-5ATGT5S4.js.map +1 -0
  8. package/dist/{chunk-BNAUZXPV.js → chunk-ALICO7NG.js} +3 -3
  9. package/dist/chunk-ALICO7NG.js.map +1 -0
  10. package/dist/{chunk-Q5RKAMYF.js → chunk-BGY4WXER.js} +43 -1
  11. package/dist/chunk-BGY4WXER.js.map +1 -0
  12. package/dist/{chunk-X3QNSQER.js → chunk-DFI52A2E.js} +56 -86
  13. package/dist/chunk-DFI52A2E.js.map +1 -0
  14. package/dist/{chunk-A5ACY5YV.js → chunk-FH4TZRDV.js} +2 -2
  15. package/dist/{chunk-3JU7SQVE.js → chunk-FSJKN4YN.js} +61 -24
  16. package/dist/chunk-FSJKN4YN.js.map +1 -0
  17. package/dist/{chunk-3II5GLHE.js → chunk-HGKWWZWY.js} +2 -2
  18. package/dist/{chunk-BN36GABQ.js → chunk-QTV77W42.js} +89 -65
  19. package/dist/chunk-QTV77W42.js.map +1 -0
  20. package/dist/{chunk-BCO4CYE4.js → chunk-SJU6QZHM.js} +2 -2
  21. package/dist/{chunk-2VHHJNXY.js → chunk-WXKV5N4T.js} +3 -3
  22. package/dist/{chunk-GBQVYNCD.js → chunk-XUNDLCEH.js} +3 -3
  23. package/dist/{create-config-ClkUr27C.d.ts → create-config-qDML4ZNn.d.ts} +1 -1
  24. package/dist/{index-CnaFSNE9.d.ts → index-DtWR0b_l.d.ts} +1 -1
  25. package/dist/index.d.ts +3 -3
  26. package/dist/index.js +12 -10
  27. package/dist/{listCollectibles-B0tbqnRd.d.ts → lowestListing-DUZ_nYml.d.ts} +49 -42
  28. package/dist/{marketplace.gen-BTHxxhG2.d.ts → marketplace.gen-DS-MmGEB.d.ts} +35 -4
  29. package/dist/react/_internal/api/index.d.ts +2 -2
  30. package/dist/react/_internal/api/index.js +1 -1
  31. package/dist/react/_internal/databeat/index.d.ts +1 -1
  32. package/dist/react/_internal/databeat/index.js +10 -10
  33. package/dist/react/_internal/index.d.ts +5 -5
  34. package/dist/react/_internal/index.js +2 -2
  35. package/dist/react/_internal/wagmi/index.d.ts +3 -3
  36. package/dist/react/_internal/wagmi/index.js +2 -2
  37. package/dist/react/hooks/index.d.ts +68 -183
  38. package/dist/react/hooks/index.js +11 -13
  39. package/dist/react/hooks/options/index.d.ts +3 -3
  40. package/dist/react/hooks/options/index.js +4 -4
  41. package/dist/react/index.d.ts +8 -8
  42. package/dist/react/index.js +15 -17
  43. package/dist/react/queries/index.d.ts +2 -2
  44. package/dist/react/queries/index.js +11 -28
  45. package/dist/react/queries/index.js.map +1 -1
  46. package/dist/react/ssr/index.d.ts +2 -2
  47. package/dist/react/ssr/index.js +3 -3
  48. package/dist/react/ui/components/collectible-card/index.d.ts +1 -1
  49. package/dist/react/ui/components/collectible-card/index.js +13 -13
  50. package/dist/react/ui/icons/index.js +6 -6
  51. package/dist/react/ui/index.d.ts +1 -1
  52. package/dist/react/ui/index.js +13 -13
  53. package/dist/react/ui/modals/_internal/components/actionModal/index.js +10 -10
  54. package/dist/{services-ybGoDJd9.d.ts → services-BOX67E7W.d.ts} +1 -1
  55. package/dist/types/index.d.ts +3 -3
  56. package/dist/types/index.js +2 -4
  57. package/dist/{types-o_pKUpQG.d.ts → types-CJLhc2VZ.d.ts} +2 -2
  58. package/dist/utils/abi/index.js +5 -5
  59. package/dist/utils/index.d.ts +54 -2
  60. package/dist/utils/index.js +12 -8
  61. package/package.json +4 -2
  62. package/src/react/_internal/api/__mocks__/marketplace.msw.ts +5 -2
  63. package/src/react/_internal/api/marketplace.gen.ts +39 -6
  64. package/src/react/_internal/api/zod-schema.ts +7 -18
  65. package/src/react/hooks/__tests__/useGenerateListingTransaction.test.tsx +10 -2
  66. package/src/react/hooks/__tests__/useGenerateOfferTransaction.test.tsx +10 -2
  67. package/src/react/hooks/__tests__/useGenerateSellTransaction.test.tsx +5 -1
  68. package/src/react/hooks/__tests__/useHighestOffer.test.tsx +7 -8
  69. package/src/react/hooks/__tests__/useLowestListing.test.tsx +4 -5
  70. package/src/react/hooks/useCancelTransactionSteps.tsx +2 -2
  71. package/src/react/hooks/useHighestOffer.tsx +1 -39
  72. package/src/react/hooks/useLowestListing.tsx +4 -51
  73. package/src/react/queries/highestOffer.ts +25 -30
  74. package/src/react/queries/index.ts +1 -0
  75. package/src/react/queries/lowestListing.ts +52 -0
  76. package/src/react/ui/modals/BuyModal/ERC1155QuantityModal.tsx +6 -9
  77. package/src/react/ui/modals/BuyModal/Modal.tsx +26 -8
  78. package/src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts +6 -2
  79. package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +2 -2
  80. package/src/react/ui/modals/MakeOfferModal/Modal.tsx +4 -4
  81. package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +2 -2
  82. package/src/react/ui/modals/SellModal/hooks/useTransactionSteps.tsx +2 -2
  83. package/src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx +1 -5
  84. package/src/react/ui/modals/_internal/components/floorPriceText/index.tsx +4 -4
  85. package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/index.tsx +1 -1
  86. package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +18 -14
  87. package/src/types/api-types.ts +1 -2
  88. package/src/types/types.ts +5 -0
  89. package/src/utils/price.ts +103 -0
  90. package/dist/chunk-3JU7SQVE.js.map +0 -1
  91. package/dist/chunk-ABSYNRT5.js.map +0 -1
  92. package/dist/chunk-BN36GABQ.js.map +0 -1
  93. package/dist/chunk-BNAUZXPV.js.map +0 -1
  94. package/dist/chunk-Q5RKAMYF.js.map +0 -1
  95. package/dist/chunk-X3QNSQER.js.map +0 -1
  96. /package/dist/{chunk-IZ44XPBH.js.map → chunk-25CAMYCG.js.map} +0 -0
  97. /package/dist/{chunk-A5ACY5YV.js.map → chunk-FH4TZRDV.js.map} +0 -0
  98. /package/dist/{chunk-3II5GLHE.js.map → chunk-HGKWWZWY.js.map} +0 -0
  99. /package/dist/{chunk-BCO4CYE4.js.map → chunk-SJU6QZHM.js.map} +0 -0
  100. /package/dist/{chunk-2VHHJNXY.js.map → chunk-WXKV5N4T.js.map} +0 -0
  101. /package/dist/{chunk-GBQVYNCD.js.map → chunk-XUNDLCEH.js.map} +0 -0
@@ -2,13 +2,10 @@
2
2
 
3
3
  import {
4
4
  collectionOptions
5
- } from "./chunk-GBQVYNCD.js";
6
- import {
7
- marketplaceConfigOptions
8
- } from "./chunk-3II5GLHE.js";
5
+ } from "./chunk-XUNDLCEH.js";
9
6
  import {
10
7
  InfoIcon_default
11
- } from "./chunk-BCO4CYE4.js";
8
+ } from "./chunk-SJU6QZHM.js";
12
9
  import {
13
10
  SEQUENCE_MARKET_V1_ADDRESS,
14
11
  SEQUENCE_MARKET_V2_ADDRESS
@@ -16,25 +13,29 @@ import {
16
13
  import {
17
14
  compareAddress,
18
15
  getPresentableChainName
19
- } from "./chunk-Q5RKAMYF.js";
20
- import {
21
- EIP2981_ABI
22
- } from "./chunk-XX4EVWBF.js";
16
+ } from "./chunk-BGY4WXER.js";
23
17
  import {
24
18
  ERC1155_ABI
25
19
  } from "./chunk-FUM4OGOQ.js";
20
+ import {
21
+ EIP2981_ABI
22
+ } from "./chunk-XX4EVWBF.js";
26
23
  import {
27
24
  balanceOfCollectibleOptions,
28
25
  highestOfferOptions,
29
26
  listBalancesOptions,
30
- listCollectiblesOptions
31
- } from "./chunk-3JU7SQVE.js";
27
+ listCollectiblesOptions,
28
+ lowestListingOptions
29
+ } from "./chunk-FSJKN4YN.js";
30
+ import {
31
+ marketplaceConfigOptions
32
+ } from "./chunk-HGKWWZWY.js";
32
33
  import {
33
34
  AddressSchema,
34
35
  CollectableIdSchema,
35
36
  PROVIDER_ID,
36
37
  QueryArgSchema
37
- } from "./chunk-IZ44XPBH.js";
38
+ } from "./chunk-25CAMYCG.js";
38
39
  import {
39
40
  BaseError,
40
41
  ChainSwitchError,
@@ -42,7 +43,6 @@ import {
42
43
  CollectibleStatus,
43
44
  CollectionStatus,
44
45
  ContractType,
45
- ExecuteType,
46
46
  MarketplaceKind,
47
47
  NoWalletConnectedError,
48
48
  OrderSide,
@@ -71,7 +71,7 @@ import {
71
71
  getMarketplaceClient,
72
72
  getMetadataClient,
73
73
  getQueryClient
74
- } from "./chunk-BNAUZXPV.js";
74
+ } from "./chunk-ALICO7NG.js";
75
75
 
76
76
  // src/react/hooks/useAutoSelectFeeOption.tsx
77
77
  import { zeroAddress } from "viem";
@@ -345,7 +345,6 @@ var transactionOnRampProviderSchema = z2.nativeEnum(
345
345
  var transactionSwapProviderSchema = z2.nativeEnum(
346
346
  TransactionSwapProvider
347
347
  );
348
- var executeTypeSchema = z2.nativeEnum(ExecuteType);
349
348
  var sortBySchema = z2.object({
350
349
  column: z2.string(),
351
350
  order: sortOrderSchema
@@ -539,14 +538,6 @@ var generateOfferTransactionArgsSchema = z2.object({
539
538
  offer: createReqSchema,
540
539
  walletType: walletKindSchema.optional()
541
540
  });
542
- var executeArgsSchema = z2.object({
543
- signature: z2.string(),
544
- executeType: executeTypeSchema,
545
- body: z2.any()
546
- });
547
- var executeReturnSchema = z2.object({
548
- orderId: z2.string()
549
- });
550
541
  var getCountOfAllCollectiblesArgsSchema = z2.object({
551
542
  contractAddress: z2.string()
552
543
  });
@@ -833,13 +824,15 @@ var collectionSchema = z2.object({
833
824
  deletedAt: z2.string().optional()
834
825
  });
835
826
  var stepSchema = z2.object({
836
- id: stepTypeSchema,
837
- data: z2.string(),
838
- to: z2.string(),
839
- value: z2.string(),
827
+ id: z2.nativeEnum(StepType),
828
+ data: z2.string().optional(),
829
+ to: z2.string().optional(),
830
+ value: z2.string().optional(),
831
+ price: z2.string().optional(),
840
832
  signature: signatureSchema.optional(),
841
833
  post: postRequestSchema.optional(),
842
- executeType: executeTypeSchema.optional()
834
+ method: z2.string().optional(),
835
+ endpoint: z2.string().optional()
843
836
  });
844
837
  var generateBuyTransactionReturnSchema = z2.object({
845
838
  steps: z2.array(stepSchema)
@@ -1490,42 +1483,19 @@ var useCountListingsForCollectible = (args) => {
1490
1483
  };
1491
1484
 
1492
1485
  // src/react/hooks/useLowestListing.tsx
1493
- import { queryOptions as queryOptions17, useQuery as useQuery21 } from "@tanstack/react-query";
1494
- import { z as z16 } from "zod";
1495
- var UseLowestListingSchema = getCollectibleLowestListingArgsSchema.omit({
1496
- contractAddress: true
1497
- }).extend({
1498
- collectionAddress: AddressSchema,
1499
- chainId: z16.number(),
1500
- query: QueryArgSchema
1501
- });
1502
- var fetchLowestListing = async (args, config) => {
1503
- const parsedArgs = UseLowestListingSchema.parse(args);
1504
- const marketplaceClient = getMarketplaceClient(parsedArgs.chainId, config);
1505
- return marketplaceClient.getCollectibleLowestListing({
1506
- ...parsedArgs,
1507
- contractAddress: parsedArgs.collectionAddress
1508
- });
1509
- };
1510
- var lowestListingOptions = (args, config) => {
1511
- return queryOptions17({
1512
- ...args.query,
1513
- queryKey: [...collectableKeys.lowestListings, args, config],
1514
- queryFn: () => fetchLowestListing(args, config)
1515
- });
1516
- };
1517
- var useLowestListing = (args) => {
1486
+ import { useQuery as useQuery21 } from "@tanstack/react-query";
1487
+ function useLowestListing(args) {
1518
1488
  const config = useConfig();
1519
1489
  return useQuery21(lowestListingOptions(args, config));
1520
- };
1490
+ }
1521
1491
 
1522
1492
  // src/react/hooks/useRoyalty.tsx
1523
1493
  import { useReadContract } from "wagmi";
1524
- import { z as z17 } from "zod";
1525
- var UseRoyaltySchema = z17.object({
1526
- chainId: z17.number(),
1494
+ import { z as z16 } from "zod";
1495
+ var UseRoyaltySchema = z16.object({
1496
+ chainId: z16.number(),
1527
1497
  collectionAddress: AddressSchema,
1528
- collectibleId: z17.string(),
1498
+ collectibleId: z16.string(),
1529
1499
  query: QueryArgSchema.optional()
1530
1500
  });
1531
1501
  var useRoyalty = (args) => {
@@ -1607,10 +1577,10 @@ var useGenerateOfferTransaction = (params) => {
1607
1577
 
1608
1578
  // src/react/hooks/useGenerateSellTransaction.tsx
1609
1579
  import { useMutation as useMutation3 } from "@tanstack/react-query";
1610
- import { z as z18 } from "zod";
1611
- var UserGeneratSellTransactionArgsSchema = z18.object({
1612
- chainId: z18.number(),
1613
- onSuccess: z18.function().args(stepSchema.array().optional()).optional()
1580
+ import { z as z17 } from "zod";
1581
+ var UserGeneratSellTransactionArgsSchema = z17.object({
1582
+ chainId: z17.number(),
1583
+ onSuccess: z17.function().args(stepSchema.array().optional()).optional()
1614
1584
  });
1615
1585
  var generateSellTransaction = async (args, config, chainId) => {
1616
1586
  const marketplaceClient = getMarketplaceClient(chainId, config);
@@ -1631,10 +1601,10 @@ var useGenerateSellTransaction = (params) => {
1631
1601
 
1632
1602
  // src/react/hooks/useGenerateCancelTransaction.tsx
1633
1603
  import { useMutation as useMutation4 } from "@tanstack/react-query";
1634
- import { z as z19 } from "zod";
1635
- var UserGenerateCancelTransactionArgsSchema = z19.object({
1636
- chainId: z19.number(),
1637
- onSuccess: z19.function().args(stepSchema.array().optional()).optional()
1604
+ import { z as z18 } from "zod";
1605
+ var UserGenerateCancelTransactionArgsSchema = z18.object({
1606
+ chainId: z18.number(),
1607
+ onSuccess: z18.function().args(stepSchema.array().optional()).optional()
1638
1608
  });
1639
1609
  var generateCancelTransaction = async (args, config, chainId) => {
1640
1610
  const marketplaceClient = getMarketplaceClient(chainId, config);
@@ -1709,16 +1679,16 @@ var useTransferTokens = () => {
1709
1679
  };
1710
1680
 
1711
1681
  // src/react/hooks/useCheckoutOptions.tsx
1712
- import { queryOptions as queryOptions18, useQuery as useQuery22 } from "@tanstack/react-query";
1682
+ import { queryOptions as queryOptions17, useQuery as useQuery22 } from "@tanstack/react-query";
1713
1683
  import { useAccount as useAccount3 } from "wagmi";
1714
- import { z as z20 } from "zod";
1715
- var UseCheckoutOptionsSchema = z20.object({
1716
- chainId: z20.number(),
1717
- orders: z20.array(
1718
- z20.object({
1684
+ import { z as z19 } from "zod";
1685
+ var UseCheckoutOptionsSchema = z19.object({
1686
+ chainId: z19.number(),
1687
+ orders: z19.array(
1688
+ z19.object({
1719
1689
  collectionAddress: AddressSchema,
1720
- orderId: z20.string(),
1721
- marketplace: z20.nativeEnum(MarketplaceKind)
1690
+ orderId: z19.string(),
1691
+ marketplace: z19.nativeEnum(MarketplaceKind)
1722
1692
  })
1723
1693
  ),
1724
1694
  query: QueryArgSchema
@@ -1737,7 +1707,7 @@ var fetchCheckoutOptions = async (args, config) => {
1737
1707
  });
1738
1708
  };
1739
1709
  var checkoutOptionsOptions = (args, config) => {
1740
- return queryOptions18({
1710
+ return queryOptions17({
1741
1711
  queryKey: ["checkoutOptions", args],
1742
1712
  queryFn: () => fetchCheckoutOptions(args, config)
1743
1713
  });
@@ -1752,9 +1722,9 @@ var useCheckoutOptions = (args) => {
1752
1722
  };
1753
1723
 
1754
1724
  // src/react/hooks/useListCollections.tsx
1755
- import { queryOptions as queryOptions19, useQuery as useQuery23 } from "@tanstack/react-query";
1756
- import { z as z21 } from "zod";
1757
- var UseListCollectionsSchema = z21.object({
1725
+ import { queryOptions as queryOptions18, useQuery as useQuery23 } from "@tanstack/react-query";
1726
+ import { z as z20 } from "zod";
1727
+ var UseListCollectionsSchema = z20.object({
1758
1728
  query: QueryArgSchema.optional().default({})
1759
1729
  });
1760
1730
  var fetchListCollections = async ({ marketplaceConfig }, config) => {
@@ -1780,7 +1750,7 @@ var fetchListCollections = async ({ marketplaceConfig }, config) => {
1780
1750
  return results.flat();
1781
1751
  };
1782
1752
  var listCollectionsOptions = (args, config) => {
1783
- return queryOptions19({
1753
+ return queryOptions18({
1784
1754
  ...args.query,
1785
1755
  queryKey: [...collectionKeys.list],
1786
1756
  queryFn: () => fetchListCollections(args, config)
@@ -2387,7 +2357,8 @@ var useCancelTransactionSteps = ({
2387
2357
  );
2388
2358
  const result = await marketplaceClient.execute({
2389
2359
  signature,
2390
- executeType: "order" /* order */,
2360
+ method: signatureStep.post?.method,
2361
+ endpoint: signatureStep.post?.endpoint,
2391
2362
  body: signatureStep.post?.body
2392
2363
  });
2393
2364
  return result.orderId;
@@ -2471,7 +2442,7 @@ var useCancelOrder = ({
2471
2442
  };
2472
2443
 
2473
2444
  // src/react/hooks/useCollectionDetails.tsx
2474
- import { queryOptions as queryOptions20, useQuery as useQuery25 } from "@tanstack/react-query";
2445
+ import { queryOptions as queryOptions19, useQuery as useQuery25 } from "@tanstack/react-query";
2475
2446
  var fetchCollectionDetails = async (args, marketplaceClient) => {
2476
2447
  const { collection } = await marketplaceClient.getCollectionDetail({
2477
2448
  contractAddress: args.collectionAddress
@@ -2480,7 +2451,7 @@ var fetchCollectionDetails = async (args, marketplaceClient) => {
2480
2451
  };
2481
2452
  var collectionDetailsOptions = (args, config) => {
2482
2453
  const marketplaceClient = getMarketplaceClient(args.chainId, config);
2483
- return queryOptions20({
2454
+ return queryOptions19({
2484
2455
  queryKey: ["collectionDetails", args],
2485
2456
  queryFn: () => fetchCollectionDetails(args, marketplaceClient)
2486
2457
  });
@@ -2491,7 +2462,7 @@ var useCollectionDetails = (args) => {
2491
2462
  };
2492
2463
 
2493
2464
  // src/react/hooks/useCollectionDetailsPolling.tsx
2494
- import { queryOptions as queryOptions21, useQuery as useQuery26 } from "@tanstack/react-query";
2465
+ import { queryOptions as queryOptions20, useQuery as useQuery26 } from "@tanstack/react-query";
2495
2466
  var INITIAL_POLLING_INTERVAL = 2e3;
2496
2467
  var MAX_POLLING_INTERVAL = 3e4;
2497
2468
  var MAX_ATTEMPTS = 30;
@@ -2504,7 +2475,7 @@ var isTerminalState = (status) => {
2504
2475
  ].includes(status);
2505
2476
  };
2506
2477
  var collectionDetailsPollingOptions = (args, config) => {
2507
- return queryOptions21({
2478
+ return queryOptions20({
2508
2479
  ...collectionDetailsOptions(args, config),
2509
2480
  refetchInterval: (query) => {
2510
2481
  const data = query.state.data;
@@ -2576,7 +2547,6 @@ export {
2576
2547
  useListListingsForCollectible,
2577
2548
  countListingsForCollectibleOptions,
2578
2549
  useCountListingsForCollectible,
2579
- lowestListingOptions,
2580
2550
  useLowestListing,
2581
2551
  useRoyalty,
2582
2552
  dateToUnixTime,
@@ -2605,4 +2575,4 @@ export {
2605
2575
  collectionDetailsPollingOptions,
2606
2576
  useCollectionDetailsPolling
2607
2577
  };
2608
- //# sourceMappingURL=chunk-X3QNSQER.js.map
2578
+ //# sourceMappingURL=chunk-DFI52A2E.js.map