@0xsequence/marketplace-sdk 1.1.1 → 1.2.1

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 (381) hide show
  1. package/CHANGELOG.md +54 -3
  2. package/dist/{BellIcon-ByhygxBO.js → BellIcon.js} +4 -4
  3. package/dist/BellIcon.js.map +1 -0
  4. package/dist/{CartIcon-Bt3rQYGk.js → CartIcon.js} +7 -7
  5. package/dist/CartIcon.js.map +1 -0
  6. package/dist/CollectibleCard.d.ts +8 -0
  7. package/dist/{_internal-DkS2VUn5.js → _internal.js} +2 -2
  8. package/dist/_internal.js.map +1 -0
  9. package/dist/{abi-fa-o9gH3.js → abi.js} +2 -2
  10. package/dist/abi.js.map +1 -0
  11. package/dist/{alien_swap-DoY6XfMA.js → alien_swap.js} +1 -1
  12. package/dist/alien_swap.js.map +1 -0
  13. package/dist/{api-BoO0V5aJ.js → api.js} +13 -64
  14. package/dist/api.js.map +1 -0
  15. package/dist/{aqua-xyz-BBDxnG14.js → aqua-xyz.js} +1 -1
  16. package/dist/aqua-xyz.js.map +1 -0
  17. package/dist/{aura-DGx2zwvF.js → aura.js} +1 -1
  18. package/dist/aura.js.map +1 -0
  19. package/dist/{blur-D8GKrRrq.js → blur.js} +1 -1
  20. package/dist/blur.js.map +1 -0
  21. package/dist/{builder-api-BFuZNOaN.js → builder-api.js} +3 -3
  22. package/dist/builder-api.js.map +1 -0
  23. package/dist/{builder.gen-B9wR2nvF.js → builder.gen.js} +3 -6
  24. package/dist/builder.gen.js.map +1 -0
  25. package/dist/{coinbase-DOry4PXY.js → coinbase.js} +1 -1
  26. package/dist/coinbase.js.map +1 -0
  27. package/dist/{collectibles-C_H8jMGH.js → collectibles.js} +9 -48
  28. package/dist/collectibles.js.map +1 -0
  29. package/dist/{collections-CKummc-R.js → collections.js} +79 -8
  30. package/dist/collections.js.map +1 -0
  31. package/dist/{components-CosnX7F9.js → components.js} +12 -14
  32. package/dist/components.js.map +1 -0
  33. package/dist/{contracts-BP_0vX48.js → contracts.js} +4 -4
  34. package/dist/contracts.js.map +1 -0
  35. package/dist/{create-config-ZOB7i4ZJ.d.ts → create-config.d.ts} +47 -60
  36. package/dist/{create-config-CIfejoCk.js → create-config.js} +10 -13
  37. package/dist/create-config.js.map +1 -0
  38. package/dist/{element-ciybd_VF.js → element.js} +1 -1
  39. package/dist/element.js.map +1 -0
  40. package/dist/{filters-V-V8Dn8f.d.ts → filters.d.ts} +7 -7
  41. package/dist/{foundation-Bq4lRz4x.js → foundation.js} +1 -1
  42. package/dist/foundation.js.map +1 -0
  43. package/dist/index.d.ts +8 -8
  44. package/dist/index.js +16 -16
  45. package/dist/{index-DUXfvhxs.d.ts → index10.d.ts} +14 -29
  46. package/dist/{index-CxA34wP1.d.ts → index11.d.ts} +101 -23
  47. package/dist/{index-BtWMBHeP.d.ts → index12.d.ts} +11 -9
  48. package/dist/{index-DmudgrsN.d.ts → index13.d.ts} +16 -16
  49. package/dist/{index-U-zp70of.d.ts → index14.d.ts} +9 -13
  50. package/dist/{index-Stm5u0I0.d.ts → index16.d.ts} +7 -10
  51. package/dist/{index-BZIJTQT0.d.ts → index17.d.ts} +9 -9
  52. package/dist/{index-CnEbXm_t.d.ts → index19.d.ts} +50 -12
  53. package/dist/{index-C-745li7.d.ts → index2.d.ts} +2 -2
  54. package/dist/{index-BOiHR01C.d.ts → index21.d.ts} +9 -9
  55. package/dist/{index-Bsx6XsC2.d.ts → index23.d.ts} +100 -59
  56. package/dist/{index-CPzvNmq9.d.ts → index24.d.ts} +36 -36
  57. package/dist/{index-DFEnA6Wa.d.ts → index25.d.ts} +18 -18
  58. package/dist/{index-DqXd1EeB.d.ts → index26.d.ts} +14 -7
  59. package/dist/{index-NlPMNcqh.d.ts → index27.d.ts} +102 -114
  60. package/dist/{index-DWt6yrIG.d.ts → index28.d.ts} +8 -8
  61. package/dist/{index-C4MUKshG.d.ts → index29.d.ts} +3 -3
  62. package/dist/{index-BeRV-7AX.d.ts → index3.d.ts} +2 -2
  63. package/dist/{index-Bxzjy0d1.d.ts → index4.d.ts} +2 -2
  64. package/dist/{index-DwKr18CI.d.ts → index5.d.ts} +2 -2
  65. package/dist/{index-D9LPlmbC.d.ts → index6.d.ts} +2 -2
  66. package/dist/{index-CS65jqOq.d.ts → index7.d.ts} +19 -3
  67. package/dist/index8.d.ts +18 -0
  68. package/dist/{index-CxpFwGvR.d.ts → index9.d.ts} +4 -4
  69. package/dist/{inventory-Dd7TazvZ.js → inventory.js} +11 -15
  70. package/dist/inventory.js.map +1 -0
  71. package/dist/{listCollectiblesPaginated-Cy2_qEZA.d.ts → listCollectiblesPaginated.d.ts} +24 -29
  72. package/dist/{listCollections-BB9FxKj2.d.ts → listCollections.d.ts} +170 -100
  73. package/dist/{looks-rare-6H--x3AM.js → looks-rare.js} +1 -1
  74. package/dist/looks-rare.js.map +1 -0
  75. package/dist/{lowestListing-Cbsi6M1K.d.ts → lowestListing.d.ts} +28 -28
  76. package/dist/{magic-eden-BoxEQ1Li.js → magic-eden.js} +1 -1
  77. package/dist/magic-eden.js.map +1 -0
  78. package/dist/{manifold-DycKsljb.js → manifold.js} +1 -1
  79. package/dist/manifold.js.map +1 -0
  80. package/dist/{market-C3HV-awQ.js → market.js} +7 -9
  81. package/dist/market.js.map +1 -0
  82. package/dist/{marketCurrencies-Bpw1bIO0.d.ts → marketCurrencies.d.ts} +19 -9
  83. package/dist/{marketCurrencies-sKrTX0og.js → marketCurrencies.js} +10 -7
  84. package/dist/marketCurrencies.js.map +1 -0
  85. package/dist/{marketplace-logos-D4dS1Foy.js → marketplace-logos.js} +23 -23
  86. package/dist/marketplace-logos.js.map +1 -0
  87. package/dist/{marketplace.gen-ksUafDqS.js → marketplace.gen.js} +25 -9
  88. package/dist/marketplace.gen.js.map +1 -0
  89. package/dist/{marketplace-NQB-sEQL.js → marketplace.js} +2 -2
  90. package/dist/marketplace.js.map +1 -0
  91. package/dist/{marketplaceConfig-UHQMM9fq.js → marketplaceConfig.js} +3 -3
  92. package/dist/marketplaceConfig.js.map +1 -0
  93. package/dist/{mintify-Dyqyo8jQ.js → mintify.js} +1 -1
  94. package/dist/mintify.js.map +1 -0
  95. package/dist/{network-DtmiMhcg.js → network.js} +3 -3
  96. package/dist/network.js.map +1 -0
  97. package/dist/{networkconfigToWagmiChain-DbUf6HiO.js → networkconfigToWagmiChain.js} +4 -3
  98. package/dist/networkconfigToWagmiChain.js.map +1 -0
  99. package/dist/{nftx-2LbFjj9Q.js → nftx.js} +1 -1
  100. package/dist/nftx.js.map +1 -0
  101. package/dist/{okx-CBEWJNsR.js → okx.js} +1 -1
  102. package/dist/okx.js.map +1 -0
  103. package/dist/{open-sea-Dxntz_PA.js → open-sea.js} +1 -1
  104. package/dist/open-sea.js.map +1 -0
  105. package/dist/{orders-DnFfZAXV.js → orders.js} +10 -10
  106. package/dist/orders.js.map +1 -0
  107. package/dist/{primary-sale-1u4QlPdA.js → primary-sale.js} +2 -2
  108. package/dist/primary-sale.js.map +1 -0
  109. package/dist/{primary-sales-Dmsi6bqj.js → primary-sales.js} +41 -3
  110. package/dist/primary-sales.js.map +1 -0
  111. package/dist/{query-BWbCsXLY.d.ts → query.d.ts} +2 -2
  112. package/dist/{rarible-CS0SupHr.js → rarible.js} +1 -1
  113. package/dist/rarible.js.map +1 -0
  114. package/dist/react/_internal/api/index.d.ts +2 -2
  115. package/dist/react/_internal/api/index.js +7 -7
  116. package/dist/react/_internal/databeat/index.d.ts +1 -1
  117. package/dist/react/_internal/databeat/index.js +37 -38
  118. package/dist/react/_internal/index.d.ts +2 -2
  119. package/dist/react/_internal/index.js +11 -11
  120. package/dist/react/_internal/wagmi/index.d.ts +1 -1
  121. package/dist/react/_internal/wagmi/index.js +5 -5
  122. package/dist/react/hooks/config/index.d.ts +8 -8
  123. package/dist/react/hooks/config/index.js +37 -38
  124. package/dist/react/hooks/contracts/index.d.ts +6 -6
  125. package/dist/react/hooks/contracts/index.js +15 -15
  126. package/dist/react/hooks/data/collectibles/index.d.ts +4 -10
  127. package/dist/react/hooks/data/collectibles/index.js +37 -38
  128. package/dist/react/hooks/data/collections/index.d.ts +11 -11
  129. package/dist/react/hooks/data/collections/index.js +38 -39
  130. package/dist/react/hooks/data/index.d.ts +37 -37
  131. package/dist/react/hooks/data/index.js +38 -39
  132. package/dist/react/hooks/data/inventory/index.d.ts +36 -36
  133. package/dist/react/hooks/data/inventory/index.js +37 -38
  134. package/dist/react/hooks/data/market/index.d.ts +5 -11
  135. package/dist/react/hooks/data/market/index.js +37 -38
  136. package/dist/react/hooks/data/orders/index.d.ts +4 -10
  137. package/dist/react/hooks/data/orders/index.js +37 -38
  138. package/dist/react/hooks/data/primary-sales/index.d.ts +37 -37
  139. package/dist/react/hooks/data/primary-sales/index.js +38 -39
  140. package/dist/react/hooks/data/tokens/index.d.ts +4 -4
  141. package/dist/react/hooks/data/tokens/index.js +37 -38
  142. package/dist/react/hooks/index.d.ts +37 -37
  143. package/dist/react/hooks/index.js +38 -39
  144. package/dist/react/hooks/transactions/index.d.ts +2 -2
  145. package/dist/react/hooks/transactions/index.js +37 -38
  146. package/dist/react/hooks/ui/index.d.ts +4 -4
  147. package/dist/react/hooks/ui/index.js +37 -38
  148. package/dist/react/hooks/utils/index.d.ts +36 -36
  149. package/dist/react/hooks/utils/index.js +37 -38
  150. package/dist/react/index.d.ts +37 -37
  151. package/dist/react/index.js +38 -39
  152. package/dist/react/queries/collectibles/index.d.ts +4 -10
  153. package/dist/react/queries/collectibles/index.js +20 -21
  154. package/dist/react/queries/collections/index.d.ts +11 -11
  155. package/dist/react/queries/collections/index.js +19 -19
  156. package/dist/react/queries/index.d.ts +24 -24
  157. package/dist/react/queries/index.js +30 -31
  158. package/dist/react/queries/inventory/index.d.ts +2 -2
  159. package/dist/react/queries/inventory/index.js +20 -20
  160. package/dist/react/queries/market/index.d.ts +5 -5
  161. package/dist/react/queries/market/index.js +20 -20
  162. package/dist/react/queries/orders/index.d.ts +4 -10
  163. package/dist/react/queries/orders/index.js +11 -11
  164. package/dist/react/queries/primary-sales/index.d.ts +4 -4
  165. package/dist/react/queries/primary-sales/index.js +12 -12
  166. package/dist/react/queries/tokens/index.d.ts +4 -4
  167. package/dist/react/queries/tokens/index.js +11 -12
  168. package/dist/react/queries/utils/index.d.ts +3 -3
  169. package/dist/react/queries/utils/index.js +20 -20
  170. package/dist/react/ssr/index.d.ts +7 -7
  171. package/dist/react/ssr/index.js +13 -16
  172. package/dist/react/ssr/index.js.map +1 -1
  173. package/dist/react/ui/components/marketplace-collectible-card/components/footer/components/index.d.ts +2 -2
  174. package/dist/react/ui/components/marketplace-collectible-card/components/footer/components/index.js +20 -20
  175. package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.d.ts +7 -10
  176. package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.js +37 -38
  177. package/dist/react/ui/components/marketplace-collectible-card/index.d.ts +4 -4
  178. package/dist/react/ui/components/marketplace-collectible-card/index.js +37 -38
  179. package/dist/react/ui/components/marketplace-collectible-card/utils/index.d.ts +2 -2
  180. package/dist/react/ui/components/marketplace-collectible-card/utils/index.js +11 -11
  181. package/dist/react/ui/components/marketplace-logos/index.d.ts +21 -21
  182. package/dist/react/ui/components/marketplace-logos/index.js +1 -1
  183. package/dist/react/ui/icons/index.js +14 -14
  184. package/dist/react/ui/index.d.ts +4 -4
  185. package/dist/react/ui/index.js +37 -38
  186. package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +2 -2
  187. package/dist/react/ui/modals/_internal/components/actionModal/index.js +37 -38
  188. package/dist/react/utils/index.d.ts +1 -1
  189. package/dist/react/utils/index.js +7 -7
  190. package/dist/{react-DE852KeT.js → react.js} +720 -926
  191. package/dist/react.js.map +1 -0
  192. package/dist/{sequence-paCCener.js → sequence.js} +1 -1
  193. package/dist/sequence.js.map +1 -0
  194. package/dist/{src-Dz2CfBL0.js → src.js} +2 -2
  195. package/dist/src.js.map +1 -0
  196. package/dist/styles/index.css +1 -1
  197. package/dist/{sudo-swap-9rH2EgfT.js → sudo-swap.js} +1 -1
  198. package/dist/sudo-swap.js.map +1 -0
  199. package/dist/{super-rare-DHIuWtRw.js → super-rare.js} +1 -1
  200. package/dist/super-rare.js.map +1 -0
  201. package/dist/{token-Cv7l2ZaL.js → token.js} +2 -2
  202. package/dist/token.js.map +1 -0
  203. package/dist/{tokenBalances-ibDerNmM.js → tokenBalances.js} +4 -11
  204. package/dist/tokenBalances.js.map +1 -0
  205. package/dist/{tokenSupplies-Bfe8RHzI.d.ts → tokenSupplies.d.ts} +19 -30
  206. package/dist/{tokens-cGxMadd8.js → tokens.js} +47 -22
  207. package/dist/tokens.js.map +1 -0
  208. package/dist/{transaction-DZUW5RHu.js → transaction.js} +2 -2
  209. package/dist/transaction.js.map +1 -0
  210. package/dist/types/index.d.ts +1 -1
  211. package/dist/types/index.js +3 -3
  212. package/dist/{types-D2TJ1dwv.d.ts → types.d.ts} +3 -3
  213. package/dist/{types-B_-cnkcP.js → types.js} +2 -2
  214. package/dist/types.js.map +1 -0
  215. package/dist/utils/abi/index.d.ts +4 -4
  216. package/dist/utils/abi/index.js +4 -4
  217. package/dist/utils/abi/marketplace/index.d.ts +1 -1
  218. package/dist/utils/abi/marketplace/index.js +1 -1
  219. package/dist/utils/abi/primary-sale/index.d.ts +1 -1
  220. package/dist/utils/abi/primary-sale/index.js +1 -1
  221. package/dist/utils/abi/token/index.d.ts +1 -1
  222. package/dist/utils/abi/token/index.js +1 -1
  223. package/dist/utils/index.d.ts +7 -7
  224. package/dist/utils/index.js +13 -13
  225. package/dist/{utils-BfpDVibN.js → utils.js} +42 -4
  226. package/dist/utils.js.map +1 -0
  227. package/dist/{utils-BCgNhBFR.js → utils2.js} +11 -5
  228. package/dist/utils2.js.map +1 -0
  229. package/dist/{utils-BqxcalL2.js → utils3.js} +3 -3
  230. package/dist/utils3.js.map +1 -0
  231. package/dist/{waitForTransactionReceipt-DieAnV52.js → waitForTransactionReceipt.js} +3 -3
  232. package/dist/waitForTransactionReceipt.js.map +1 -0
  233. package/dist/{x2y2-45WDooeh.js → x2y2.js} +1 -1
  234. package/dist/x2y2.js.map +1 -0
  235. package/dist/{zora-CbeBoLvQ.js → zora.js} +1 -1
  236. package/dist/zora.js.map +1 -0
  237. package/package.json +42 -42
  238. package/src/react/_internal/api/__mocks__/marketplace.msw.ts +13 -0
  239. package/src/react/_internal/api/index.ts +0 -1
  240. package/src/react/_internal/api/marketplace.gen.ts +70 -26
  241. package/src/react/_internal/api/query-keys.ts +9 -0
  242. package/src/react/_internal/wagmi/get-connectors.ts +12 -1
  243. package/src/react/hooks/data/collectibles/useBalanceOfCollectible.tsx +0 -9
  244. package/src/react/hooks/data/collectibles/useListCollectibles.tsx +1 -16
  245. package/src/react/hooks/data/collectibles/useTokenBalances.tsx +0 -9
  246. package/src/react/hooks/data/collections/index.ts +2 -0
  247. package/src/react/hooks/data/collections/useCollectionActiveListingsCurrencies.test.tsx +112 -0
  248. package/src/react/hooks/data/collections/useCollectionActiveListingsCurrencies.tsx +74 -0
  249. package/src/react/hooks/data/collections/useCollectionActiveOffersCurrencies.test.tsx +110 -0
  250. package/src/react/hooks/data/collections/useCollectionActiveOffersCurrencies.tsx +74 -0
  251. package/src/react/hooks/data/inventory/useInventory.tsx +1 -10
  252. package/src/react/hooks/data/market/useMarketCurrencies.test.tsx +31 -2
  253. package/src/react/hooks/data/primary-sales/index.ts +1 -0
  254. package/src/react/hooks/data/primary-sales/usePrimarySaleItem.tsx +71 -0
  255. package/src/react/hooks/data/tokens/useListBalances.tsx +1 -10
  256. package/src/react/hooks/data/tokens/useTokenSupplies.ts +1 -13
  257. package/src/react/hooks/transactions/useGenerateOfferTransaction.test.tsx +2 -0
  258. package/src/react/hooks/transactions/useProcessStep.test.tsx +8 -6
  259. package/src/react/hooks/transactions/useProcessStep.ts +8 -6
  260. package/src/react/hooks/utils/useComparePrices.test.tsx +1 -1
  261. package/src/react/providers/modal-provider.tsx +2 -1
  262. package/src/react/queries/collectibles/balanceOfCollectible.ts +1 -15
  263. package/src/react/queries/collectibles/listCollectibles.ts +1 -54
  264. package/src/react/queries/collectibles/tokenBalances.ts +1 -15
  265. package/src/react/queries/collections/activeListingsCurrencies.ts +84 -0
  266. package/src/react/queries/collections/activeOffersCurrencies.ts +84 -0
  267. package/src/react/queries/collections/index.ts +2 -0
  268. package/src/react/queries/inventory/inventory.ts +2 -9
  269. package/src/react/queries/market/marketCurrencies.ts +8 -1
  270. package/src/react/queries/primary-sales/index.ts +1 -0
  271. package/src/react/queries/primary-sales/primarySaleItem.ts +80 -0
  272. package/src/react/queries/tokens/listBalances.ts +1 -21
  273. package/src/react/queries/tokens/tokenSupplies.ts +2 -31
  274. package/src/react/queries/utils/comparePrices.ts +13 -1
  275. package/src/react/ui/components/_internals/action-button/ActionButton.stories.tsx +2 -0
  276. package/src/react/ui/components/marketplace-collectible-card/components/footer/Footer.tsx +4 -18
  277. package/src/react/ui/components/marketplace-collectible-card/variants/MarketCard.tsx +2 -2
  278. package/src/react/ui/components/marketplace-collectible-card/variants/ShopCard.tsx +0 -2
  279. package/src/react/ui/modals/BuyModal/__tests__/BuyModalRouter.test.tsx +3 -0
  280. package/src/react/ui/modals/BuyModal/__tests__/ERC1155ShopModal.test.tsx +152 -141
  281. package/src/react/ui/modals/BuyModal/__tests__/Modal1155.test.tsx +1 -0
  282. package/src/react/ui/modals/BuyModal/components/ERC1155ShopModal.tsx +44 -60
  283. package/src/react/ui/modals/BuyModal/hooks/__tests__/useERC1155SalePaymentParams.test.tsx +381 -0
  284. package/src/react/ui/modals/BuyModal/hooks/useERC1155SalePaymentParams.ts +257 -0
  285. package/src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts +0 -23
  286. package/src/react/ui/modals/MakeOfferModal/Modal.tsx +22 -2
  287. package/src/react/ui/modals/MakeOfferModal/__tests__/Modal.test.tsx +2 -0
  288. package/src/react/ui/modals/MakeOfferModal/hooks/useGetTokenApproval.tsx +2 -0
  289. package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +2 -0
  290. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +1 -1
  291. package/src/react/ui/modals/TransferModal/index.tsx +24 -2
  292. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +15 -12
  293. package/src/react/ui/modals/_internal/components/floorPriceText/__tests__/FloorPriceText.test.tsx +2 -0
  294. package/src/react/ui/modals/_internal/components/floorPriceText/index.tsx +1 -1
  295. package/src/react/ui/modals/_internal/components/priceInput/index.tsx +148 -11
  296. package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +1 -1
  297. package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/utils.test.ts +2 -0
  298. package/src/styles/styles.ts +2 -2
  299. package/src/utils/networkconfigToWagmiChain.ts +7 -0
  300. package/src/utils/price.ts +58 -0
  301. package/test/const.ts +2 -0
  302. package/test/server-setup.ts +0 -2
  303. package/tsdown.config.ts +1 -0
  304. package/.changeset/honest-peas-arrive.md +0 -5
  305. package/.changeset/real-tips-stick.md +0 -8
  306. package/.changeset/tall-pandas-wear.md +0 -8
  307. package/dist/BellIcon-ByhygxBO.js.map +0 -1
  308. package/dist/CartIcon-Bt3rQYGk.js.map +0 -1
  309. package/dist/CollectibleCard-CVpdgXA8.d.ts +0 -8
  310. package/dist/_internal-DkS2VUn5.js.map +0 -1
  311. package/dist/abi-fa-o9gH3.js.map +0 -1
  312. package/dist/alien_swap-DoY6XfMA.js.map +0 -1
  313. package/dist/api-BoO0V5aJ.js.map +0 -1
  314. package/dist/aqua-xyz-BBDxnG14.js.map +0 -1
  315. package/dist/aura-DGx2zwvF.js.map +0 -1
  316. package/dist/blur-D8GKrRrq.js.map +0 -1
  317. package/dist/builder-api-BFuZNOaN.js.map +0 -1
  318. package/dist/builder.gen-B9wR2nvF.js.map +0 -1
  319. package/dist/coinbase-DOry4PXY.js.map +0 -1
  320. package/dist/collectibles-C_H8jMGH.js.map +0 -1
  321. package/dist/collections-CKummc-R.js.map +0 -1
  322. package/dist/components-CosnX7F9.js.map +0 -1
  323. package/dist/contracts-BP_0vX48.js.map +0 -1
  324. package/dist/create-config-CIfejoCk.js.map +0 -1
  325. package/dist/element-ciybd_VF.js.map +0 -1
  326. package/dist/foundation-Bq4lRz4x.js.map +0 -1
  327. package/dist/index-DNNUeZEq.d.ts +0 -18
  328. package/dist/inventory-Dd7TazvZ.js.map +0 -1
  329. package/dist/listBalances-BxpxBCvn.js +0 -57
  330. package/dist/listBalances-BxpxBCvn.js.map +0 -1
  331. package/dist/looks-rare-6H--x3AM.js.map +0 -1
  332. package/dist/magic-eden-BoxEQ1Li.js.map +0 -1
  333. package/dist/manifold-DycKsljb.js.map +0 -1
  334. package/dist/market-C3HV-awQ.js.map +0 -1
  335. package/dist/marketCurrencies-sKrTX0og.js.map +0 -1
  336. package/dist/marketplace-NQB-sEQL.js.map +0 -1
  337. package/dist/marketplace-logos-D4dS1Foy.js.map +0 -1
  338. package/dist/marketplace.gen-ksUafDqS.js.map +0 -1
  339. package/dist/marketplaceConfig-UHQMM9fq.js.map +0 -1
  340. package/dist/mintify-Dyqyo8jQ.js.map +0 -1
  341. package/dist/network-DtmiMhcg.js.map +0 -1
  342. package/dist/networkconfigToWagmiChain-DbUf6HiO.js.map +0 -1
  343. package/dist/nftx-2LbFjj9Q.js.map +0 -1
  344. package/dist/okx-CBEWJNsR.js.map +0 -1
  345. package/dist/open-sea-Dxntz_PA.js.map +0 -1
  346. package/dist/orders-DnFfZAXV.js.map +0 -1
  347. package/dist/primary-sale-1u4QlPdA.js.map +0 -1
  348. package/dist/primary-sales-Dmsi6bqj.js.map +0 -1
  349. package/dist/rarible-CS0SupHr.js.map +0 -1
  350. package/dist/react-DE852KeT.js.map +0 -1
  351. package/dist/sequence-paCCener.js.map +0 -1
  352. package/dist/src-Dz2CfBL0.js.map +0 -1
  353. package/dist/sudo-swap-9rH2EgfT.js.map +0 -1
  354. package/dist/super-rare-DHIuWtRw.js.map +0 -1
  355. package/dist/token-Cv7l2ZaL.js.map +0 -1
  356. package/dist/tokenBalances-ibDerNmM.js.map +0 -1
  357. package/dist/tokens-cGxMadd8.js.map +0 -1
  358. package/dist/transaction-DZUW5RHu.js.map +0 -1
  359. package/dist/types-B_-cnkcP.js.map +0 -1
  360. package/dist/utils-BCgNhBFR.js.map +0 -1
  361. package/dist/utils-BfpDVibN.js.map +0 -1
  362. package/dist/utils-BqxcalL2.js.map +0 -1
  363. package/dist/waitForTransactionReceipt-DieAnV52.js.map +0 -1
  364. package/dist/x2y2-45WDooeh.js.map +0 -1
  365. package/dist/zora-CbeBoLvQ.js.map +0 -1
  366. package/src/react/_internal/api/__mocks__/laos.msw.ts +0 -387
  367. package/src/react/_internal/api/__tests__/laos-api.test.ts +0 -756
  368. package/src/react/_internal/api/laos-api.ts +0 -106
  369. package/src/react/hooks/data/collectibles/useBalanceOfCollectible.laos.test.tsx +0 -367
  370. package/src/react/queries/collectibles/__tests__/balanceOfCollectible.laos.test.ts +0 -123
  371. package/src/react/queries/collectibles/__tests__/tokenBalances.laos.test.ts +0 -123
  372. package/src/react/queries/inventory/__tests__/inventory.laos.test.ts +0 -499
  373. package/src/react/ui/modals/BuyModal/hooks/__tests__/useERC1155Checkout.test.tsx +0 -395
  374. package/src/react/ui/modals/BuyModal/hooks/useERC1155Checkout.ts +0 -103
  375. package/src/react/ui/modals/_internal/constants/opensea-currencies.ts +0 -481
  376. /package/dist/{index-6wsMChsg.d.ts → index15.d.ts} +0 -0
  377. /package/dist/{index-CZUtOTjh.d.ts → index18.d.ts} +0 -0
  378. /package/dist/{index-DW3njUfb.d.ts → index20.d.ts} +0 -0
  379. /package/dist/{index-DewGsFz5.d.ts → index22.d.ts} +0 -0
  380. /package/dist/{queries-KOcILNJO.js → queries.js} +0 -0
  381. /package/dist/{wagmi-Bseovd6Q.js → wagmi.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { LaosAPI, getIndexerClient, getMetadataClient, tokenKeys } from "./api-BoO0V5aJ.js";
1
+ import { c as balanceQueries, i as getMetadataClient, m as tokenKeys, n as getIndexerClient } from "./api.js";
2
2
  import { infiniteQueryOptions, queryOptions } from "@tanstack/react-query";
3
3
 
4
4
  //#region src/react/queries/tokens/getTokenRanges.ts
@@ -32,6 +32,47 @@ function getTokenRangesQueryOptions(params) {
32
32
  });
33
33
  }
34
34
 
35
+ //#endregion
36
+ //#region src/react/queries/tokens/listBalances.ts
37
+ async function fetchBalances(args, config, page) {
38
+ return getIndexerClient(args.chainId, config).getTokenBalances({
39
+ ...args,
40
+ tokenID: args.tokenId,
41
+ page
42
+ });
43
+ }
44
+ function getListBalancesQueryKey(args) {
45
+ const apiArgs = {
46
+ chainId: args.chainId,
47
+ accountAddress: args.accountAddress,
48
+ contractAddress: args.contractAddress,
49
+ tokenID: args.tokenId,
50
+ includeMetadata: args.includeMetadata,
51
+ metadataOptions: args.metadataOptions,
52
+ includeCollectionTokens: args.includeCollectionTokens
53
+ };
54
+ return [...balanceQueries.lists, apiArgs];
55
+ }
56
+ /**
57
+ * Creates a tanstack infinite query options object for the balances query
58
+ *
59
+ * @param args - The query arguments
60
+ * @param config - SDK configuration
61
+ * @returns Query options configuration
62
+ */
63
+ function listBalancesOptions(args, config) {
64
+ return infiniteQueryOptions({
65
+ ...args.query,
66
+ queryKey: getListBalancesQueryKey(args),
67
+ queryFn: ({ pageParam }) => fetchBalances(args, config, pageParam),
68
+ initialPageParam: {
69
+ page: 1,
70
+ pageSize: 30
71
+ },
72
+ getNextPageParam: (lastPage) => lastPage.page.after
73
+ });
74
+ }
75
+
35
76
  //#endregion
36
77
  //#region src/react/queries/tokens/listTokenMetadata.ts
37
78
  /**
@@ -129,24 +170,10 @@ function searchTokenMetadataQueryOptions(params) {
129
170
  //#endregion
130
171
  //#region src/react/queries/tokens/tokenSupplies.ts
131
172
  /**
132
- * Fetches token supplies with support for both indexer and LAOS APIs
133
- * Uses the more efficient single-contract APIs from both services
173
+ * Fetches token supplies with support for indexer API
134
174
  */
135
175
  async function fetchTokenSupplies(params) {
136
- const { chainId, collectionAddress, config, isLaos721,...rest } = params;
137
- if (isLaos721) {
138
- const laosApi = new LaosAPI();
139
- const laosPage = rest.page ? { sort: rest.page.sort?.map((sortBy) => ({
140
- column: sortBy.column,
141
- order: sortBy.order
142
- })) || [] } : void 0;
143
- return await laosApi.getTokenSupplies({
144
- chainId: chainId.toString(),
145
- contractAddress: collectionAddress,
146
- includeMetadata: rest.includeMetadata,
147
- page: laosPage
148
- });
149
- }
176
+ const { chainId, collectionAddress, config, ...rest } = params;
150
177
  const indexerClient = getIndexerClient(chainId, config);
151
178
  const apiArgs = {
152
179
  contractAddress: collectionAddress,
@@ -159,8 +186,7 @@ function getTokenSuppliesQueryKey(params) {
159
186
  chainId: params.chainId,
160
187
  contractAddress: params.collectionAddress,
161
188
  includeMetadata: params.includeMetadata,
162
- metadataOptions: params.metadataOptions,
163
- isLaos721: params.isLaos721
189
+ metadataOptions: params.metadataOptions
164
190
  };
165
191
  return [...tokenKeys.supplies, apiArgs];
166
192
  }
@@ -174,7 +200,6 @@ function tokenSuppliesQueryOptions(params) {
174
200
  chainId: params.chainId,
175
201
  collectionAddress: params.collectionAddress,
176
202
  config: params.config,
177
- isLaos721: params.isLaos721,
178
203
  includeMetadata: params.includeMetadata,
179
204
  metadataOptions: params.metadataOptions,
180
205
  page: pageParam
@@ -190,5 +215,5 @@ function tokenSuppliesQueryOptions(params) {
190
215
  }
191
216
 
192
217
  //#endregion
193
- export { fetchGetTokenRanges, fetchListTokenMetadata, fetchSearchTokenMetadata, fetchTokenSupplies, getListTokenMetadataQueryKey, getSearchTokenMetadataQueryKey, getTokenRangesQueryKey, getTokenRangesQueryOptions, getTokenSuppliesQueryKey, listTokenMetadataQueryOptions, searchTokenMetadataQueryOptions, tokenSuppliesQueryOptions };
194
- //# sourceMappingURL=tokens-cGxMadd8.js.map
218
+ export { getSearchTokenMetadataQueryKey as a, getListTokenMetadataQueryKey as c, getListBalancesQueryKey as d, listBalancesOptions as f, getTokenRangesQueryOptions as h, fetchSearchTokenMetadata as i, listTokenMetadataQueryOptions as l, getTokenRangesQueryKey as m, getTokenSuppliesQueryKey as n, searchTokenMetadataQueryOptions as o, fetchGetTokenRanges as p, tokenSuppliesQueryOptions as r, fetchListTokenMetadata as s, fetchTokenSupplies as t, fetchBalances as u };
219
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","names":["apiArgs: GetTokenSuppliesArgs"],"sources":["../src/react/queries/tokens/getTokenRanges.ts","../src/react/queries/tokens/listBalances.ts","../src/react/queries/tokens/listTokenMetadata.ts","../src/react/queries/tokens/searchTokenMetadata.ts","../src/react/queries/tokens/tokenSupplies.ts"],"sourcesContent":["import type { GetTokenIDRangesReturn } from '@0xsequence/indexer';\nimport { queryOptions } from '@tanstack/react-query';\nimport type { Address } from 'viem';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tgetIndexerClient,\n\ttokenKeys,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchGetTokenRangesParams {\n\tchainId: number;\n\tcollectionAddress: Address;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches token ID ranges for a collection from the Indexer API\n */\nexport async function fetchGetTokenRanges(\n\tparams: FetchGetTokenRangesParams,\n): Promise<GetTokenIDRangesReturn> {\n\tconst { chainId, collectionAddress, config } = params;\n\n\tconst indexerClient = getIndexerClient(chainId, config);\n\n\tconst response = await indexerClient.getTokenIDRanges({\n\t\tcontractAddress: collectionAddress,\n\t});\n\n\tif (!response) {\n\t\tthrow new Error('Failed to fetch token ranges');\n\t}\n\n\treturn response;\n}\n\nexport type GetTokenRangesQueryOptions =\n\tValuesOptional<FetchGetTokenRangesParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getTokenRangesQueryKey(params: GetTokenRangesQueryOptions) {\n\tconst apiArgs = {\n\t\tchainId: params.chainId!,\n\t\tcontractAddress: params.collectionAddress!,\n\t};\n\n\treturn [...tokenKeys.ranges, apiArgs] as const;\n}\n\nexport function getTokenRangesQueryOptions(params: GetTokenRangesQueryOptions) {\n\tconst enabled = Boolean(\n\t\tparams.chainId &&\n\t\t\tparams.collectionAddress &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getTokenRangesQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchGetTokenRanges({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcollectionAddress: params.collectionAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import type { GetTokenBalancesReturn, Page } from '@0xsequence/indexer';\nimport { infiniteQueryOptions } from '@tanstack/react-query';\nimport type { Address, Hex } from 'viem';\nimport type { SdkConfig } from '../../../types';\nimport { balanceQueries, getIndexerClient } from '../../_internal';\n\nexport type UseListBalancesArgs = {\n\tchainId: number;\n\taccountAddress?: Address;\n\tcontractAddress?: Address;\n\ttokenId?: string;\n\tincludeMetadata?: boolean;\n\tmetadataOptions?: {\n\t\tverifiedOnly?: boolean;\n\t\tunverifiedOnly?: boolean;\n\t\tincludeContracts?: Hex[];\n\t};\n\tincludeCollectionTokens?: boolean;\n\tpage?: Page;\n\t//TODO: More options\n\tquery?: {\n\t\tenabled?: boolean;\n\t};\n};\n\nexport async function fetchBalances(\n\targs: UseListBalancesArgs,\n\tconfig: SdkConfig,\n\tpage: Page,\n): Promise<GetTokenBalancesReturn> {\n\tconst indexerClient = getIndexerClient(args.chainId, config);\n\treturn indexerClient.getTokenBalances({\n\t\t...args,\n\t\ttokenID: args.tokenId,\n\t\tpage: page,\n\t});\n}\n\nexport function getListBalancesQueryKey(args: UseListBalancesArgs) {\n\tconst apiArgs = {\n\t\tchainId: args.chainId,\n\t\taccountAddress: args.accountAddress,\n\t\tcontractAddress: args.contractAddress,\n\t\ttokenID: args.tokenId,\n\t\tincludeMetadata: args.includeMetadata,\n\t\tmetadataOptions: args.metadataOptions,\n\t\tincludeCollectionTokens: args.includeCollectionTokens,\n\t};\n\n\treturn [...balanceQueries.lists, apiArgs] as const;\n}\n\n/**\n * Creates a tanstack infinite query options object for the balances query\n *\n * @param args - The query arguments\n * @param config - SDK configuration\n * @returns Query options configuration\n */\nexport function listBalancesOptions(\n\targs: UseListBalancesArgs,\n\tconfig: SdkConfig,\n) {\n\treturn infiniteQueryOptions({\n\t\t...args.query,\n\t\tqueryKey: getListBalancesQueryKey(args),\n\t\tqueryFn: ({ pageParam }) => fetchBalances(args, config, pageParam),\n\t\tinitialPageParam: { page: 1, pageSize: 30 } as Page,\n\t\tgetNextPageParam: (lastPage) => lastPage.page.after,\n\t});\n}\n","import type { GetTokenMetadataArgs } from '@0xsequence/metadata';\nimport { queryOptions } from '@tanstack/react-query';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tgetMetadataClient,\n\ttype QueryKeyArgs,\n\ttokenKeys,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchListTokenMetadataParams {\n\tchainId: number;\n\tcontractAddress: string;\n\ttokenIds: string[];\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches token metadata from the metadata API\n */\nexport async function fetchListTokenMetadata(\n\tparams: FetchListTokenMetadataParams,\n) {\n\tconst { chainId, contractAddress, tokenIds, config } = params;\n\tconst metadataClient = getMetadataClient(config);\n\n\tconst response = await metadataClient.getTokenMetadata({\n\t\tchainID: chainId.toString(),\n\t\tcontractAddress: contractAddress,\n\t\ttokenIDs: tokenIds,\n\t});\n\n\treturn response.tokenMetadata;\n}\n\nexport type ListTokenMetadataQueryOptions =\n\tValuesOptional<FetchListTokenMetadataParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getListTokenMetadataQueryKey(\n\tparams: ListTokenMetadataQueryOptions,\n) {\n\tconst apiArgs = {\n\t\tchainID: String(params.chainId),\n\t\tcontractAddress: params.contractAddress,\n\t\ttokenIDs: params.tokenIds,\n\t} satisfies QueryKeyArgs<GetTokenMetadataArgs>;\n\n\treturn [...tokenKeys.metadata, apiArgs] as const;\n}\n\nexport function listTokenMetadataQueryOptions(\n\tparams: ListTokenMetadataQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.chainId &&\n\t\t\tparams.contractAddress &&\n\t\t\tparams.tokenIds?.length &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getListTokenMetadataQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchListTokenMetadata({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcontractAddress: params.contractAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\ttokenIds: params.tokenIds!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import type {\n\tFilter,\n\tPage,\n\tSearchTokenMetadataArgs,\n\tSearchTokenMetadataReturn,\n} from '@0xsequence/metadata';\nimport { infiniteQueryOptions } from '@tanstack/react-query';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tgetMetadataClient,\n\ttype QueryKeyArgs,\n\ttokenKeys,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchSearchTokenMetadataParams {\n\tchainId: number;\n\tcollectionAddress: string;\n\tfilter?: Filter;\n\tpage?: Page;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches token metadata from the metadata API using search filters\n */\nexport async function fetchSearchTokenMetadata(\n\tparams: FetchSearchTokenMetadataParams,\n): Promise<SearchTokenMetadataReturn> {\n\tconst { chainId, collectionAddress, filter, page, config } = params;\n\tconst metadataClient = getMetadataClient(config);\n\n\tconst response = await metadataClient.searchTokenMetadata({\n\t\tchainID: chainId.toString(),\n\t\tcontractAddress: collectionAddress,\n\t\tfilter: filter ?? {},\n\t\tpage,\n\t});\n\n\treturn {\n\t\ttokenMetadata: response.tokenMetadata,\n\t\tpage: response.page,\n\t};\n}\n\nexport type SearchTokenMetadataQueryOptions =\n\tValuesOptional<FetchSearchTokenMetadataParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getSearchTokenMetadataQueryKey(\n\tparams: SearchTokenMetadataQueryOptions,\n) {\n\tconst apiArgs = {\n\t\tchainID: String(params.chainId!),\n\t\tcontractAddress: params.collectionAddress!,\n\t\tfilter: params.filter,\n\t} satisfies QueryKeyArgs<Omit<SearchTokenMetadataArgs, 'page'>>;\n\n\treturn [...tokenKeys.metadata, 'search', apiArgs] as const;\n}\n\nexport function searchTokenMetadataQueryOptions(\n\tparams: SearchTokenMetadataQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.chainId &&\n\t\t\tparams.collectionAddress &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\tconst initialPageParam = { page: 1, pageSize: 30 };\n\n\treturn infiniteQueryOptions({\n\t\tqueryKey: getSearchTokenMetadataQueryKey(params),\n\t\tqueryFn: ({ pageParam = initialPageParam }) =>\n\t\t\tfetchSearchTokenMetadata({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcollectionAddress: params.collectionAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tfilter: params.filter!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t\tpage: pageParam,\n\t\t\t}),\n\t\tinitialPageParam,\n\t\tgetNextPageParam: (lastPage) => {\n\t\t\tif (!lastPage.page?.more) return undefined;\n\t\t\treturn {\n\t\t\t\tpage: (lastPage.page.page || 1) + 1,\n\t\t\t\tpageSize: lastPage.page.pageSize || 20,\n\t\t\t};\n\t\t},\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import type { GetTokenSuppliesArgs, Page } from '@0xsequence/indexer';\nimport { infiniteQueryOptions } from '@tanstack/react-query';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tgetIndexerClient,\n\ttokenKeys,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type { StandardInfiniteQueryOptions } from '../../types/query';\n\nexport interface FetchTokenSuppliesParams\n\textends Omit<GetTokenSuppliesArgs, 'contractAddress'> {\n\tchainId: number;\n\tcollectionAddress: string;\n\tconfig: SdkConfig;\n\tpage?: Page;\n}\n\n/**\n * Fetches token supplies with support for indexer API\n */\nexport async function fetchTokenSupplies(params: FetchTokenSuppliesParams) {\n\tconst { chainId, collectionAddress, config, ...rest } = params;\n\n\tconst indexerClient = getIndexerClient(chainId, config);\n\n\tconst apiArgs: GetTokenSuppliesArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\t...rest,\n\t};\n\n\tconst result = await indexerClient.getTokenSupplies(apiArgs);\n\treturn result;\n}\n\nexport type TokenSuppliesQueryOptions =\n\tValuesOptional<FetchTokenSuppliesParams> & {\n\t\tquery?: StandardInfiniteQueryOptions;\n\t};\n\nexport function getTokenSuppliesQueryKey(params: TokenSuppliesQueryOptions) {\n\tconst apiArgs = {\n\t\tchainId: params.chainId!,\n\t\tcontractAddress: params.collectionAddress!,\n\t\tincludeMetadata: params.includeMetadata,\n\t\tmetadataOptions: params.metadataOptions,\n\t};\n\n\treturn [...tokenKeys.supplies, apiArgs] as const;\n}\n\nexport function tokenSuppliesQueryOptions(params: TokenSuppliesQueryOptions) {\n\tconst enabled = Boolean(\n\t\tparams.chainId &&\n\t\t\tparams.collectionAddress &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\tconst initialPageParam = { page: 1, pageSize: 30 } as Page;\n\n\tconst queryFn = async ({ pageParam = initialPageParam }) =>\n\t\tfetchTokenSupplies({\n\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\tchainId: params.chainId!,\n\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\tcollectionAddress: params.collectionAddress!,\n\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\tconfig: params.config!,\n\t\t\tincludeMetadata: params.includeMetadata,\n\t\t\tmetadataOptions: params.metadataOptions,\n\t\t\tpage: pageParam,\n\t\t});\n\n\treturn infiniteQueryOptions({\n\t\tqueryKey: getTokenSuppliesQueryKey(params),\n\t\tqueryFn,\n\t\tinitialPageParam,\n\t\tgetNextPageParam: (lastPage) =>\n\t\t\tlastPage.page?.more ? lastPage.page : undefined,\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n"],"mappings":"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"}
@@ -72,5 +72,5 @@ var MissingConfigError = class extends TransactionError {
72
72
  };
73
73
 
74
74
  //#endregion
75
- export { BaseError, ChainSwitchError, InvalidContractTypeError, MissingConfigError, NoWalletConnectedError, TransactionExecutionError, TransactionSignatureError, UserRejectedRequestError };
76
- //# sourceMappingURL=transaction-DZUW5RHu.js.map
75
+ export { TransactionExecutionError as a, BaseError as c, NoWalletConnectedError as i, InvalidContractTypeError as n, TransactionSignatureError as o, MissingConfigError as r, UserRejectedRequestError as s, ChainSwitchError as t };
76
+ //# sourceMappingURL=transaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.js","names":[],"sources":["../src/utils/_internal/error/base.ts","../src/utils/_internal/error/transaction.ts"],"sourcesContent":["export type ErrorType<name extends string = 'Error'> = Error & { name: name };\n\nexport type Compute<type> = { [key in keyof type]: type[key] } & unknown;\n\ntype BaseErrorOptions = Compute<\n\t{ details?: string | undefined } | { cause: BaseError | Error }\n>;\n\nexport class BaseError extends Error {\n\tdetails: string;\n\tshortMessage: string;\n\n\tname = 'MarketplaceSdkBaseError';\n\n\tconstructor(shortMessage: string, options: BaseErrorOptions = {}) {\n\t\tsuper();\n\n\t\tconst details = 'details' in options ? options.details : '';\n\t\tthis.message = [\n\t\t\tshortMessage || 'An error occurred.',\n\t\t\t'',\n\t\t\t...(details ? [`Details: ${details}`] : []),\n\t\t].join('\\n');\n\n\t\tif ('cause' in options && options.cause) {\n\t\t\tthis.cause = options.cause;\n\t\t}\n\n\t\tthis.details = details || '';\n\t\tthis.shortMessage = shortMessage;\n\t}\n}\n","import type { Address } from 'viem';\nimport { BaseError } from './base';\n\nexport type TransactionErrorType<name extends string = 'TransactionError'> =\n\tBaseError & { name: name };\n\nexport class TransactionError extends BaseError {\n\toverride name = 'TransactionError';\n}\n\nexport class ChainSwitchError extends TransactionError {\n\toverride name = 'ChainSwitchError';\n\tconstructor(currentChainId: number, targetChainId: number) {\n\t\tsuper(\n\t\t\t`Failed to switch network from ${currentChainId} to ${targetChainId}`,\n\t\t\t{\n\t\t\t\tdetails:\n\t\t\t\t\t'The user may have rejected the network switch or there might be a network connectivity issue.',\n\t\t\t},\n\t\t);\n\t}\n}\n\nexport class ChainSwitchUserRejectedError extends TransactionError {\n\toverride name = 'ChainSwitchUserRejectedError';\n\tconstructor() {\n\t\tsuper('User rejected chain switch', {\n\t\t\tdetails: 'The user rejected the chain switch request.',\n\t\t});\n\t}\n}\n\nexport class TransactionExecutionError extends TransactionError {\n\toverride name = 'TransactionExecutionError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to execute transaction step: ${stepId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction may have been rejected or failed during execution.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class TransactionSignatureError extends TransactionError {\n\toverride name = 'TransactionSignatureError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to sign transaction step: ${stepId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The signature request may have been rejected by the user.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class NoWalletConnectedError extends TransactionError {\n\toverride name = 'NoWalletConnectedError';\n\tconstructor() {\n\t\tsuper('No wallet connected', {\n\t\t\tdetails: 'Please connect your wallet before attempting this transaction.',\n\t\t});\n\t}\n}\n\nexport class NoMarketplaceConfigError extends TransactionError {\n\toverride name = 'NoMarketplaceConfigError';\n\tconstructor() {\n\t\tsuper('Marketplace configuration not found', {\n\t\t\tdetails:\n\t\t\t\t'The marketplace configuration is missing or invalid. This could be due to an initialization error.',\n\t\t});\n\t}\n}\n\nexport class UserRejectedRequestError extends TransactionError {\n\toverride name = 'UserRejectedRequestError';\n\tconstructor() {\n\t\tsuper('User rejected the request', {\n\t\t\tdetails: 'The user cancelled or rejected the transaction request.',\n\t\t});\n\t}\n}\n\nexport class InsufficientFundsError extends TransactionError {\n\toverride name = 'InsufficientFundsError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Insufficient funds for transaction', {\n\t\t\tdetails:\n\t\t\t\t'The wallet does not have enough funds to complete this transaction.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class SignatureExecutionError extends TransactionError {\n\toverride name = 'SignatureExecutionError';\n\tconstructor(signature: string, cause?: Error) {\n\t\tsuper(`Failed to execute signature: ${signature}`, {\n\t\t\tdetails: cause?.message || 'The execution of the signature failed.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class StepExecutionError extends TransactionError {\n\toverride name = 'StepExecutionError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to execute step ${stepId})`, {\n\t\t\tdetails: cause?.message || 'The step execution failed unexpectedly.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class StepGenerationError extends TransactionError {\n\toverride name = 'StepGenerationError';\n\tconstructor(transactionType: string, cause?: Error) {\n\t\tsuper(`Failed to generate steps for ${transactionType}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message || 'Could not generate the required transaction steps.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class PaymentModalError extends TransactionError {\n\toverride name = 'PaymentModalError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Payment modal operation failed', {\n\t\t\tdetails:\n\t\t\t\tcause?.message || 'The payment modal operation was unsuccessful.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class InvalidStepError extends TransactionError {\n\toverride name = 'InvalidStepError';\n\tconstructor(stepId: string, reason: string) {\n\t\tsuper(`Invalid step configuration for ${stepId}`, {\n\t\t\tdetails: reason,\n\t\t});\n\t}\n}\n\nexport class TransactionConfirmationError extends TransactionError {\n\toverride name = 'TransactionConfirmationError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Failed to confirm transaction ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction could not be confirmed on the network.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class OrderNotFoundError extends TransactionError {\n\toverride name = 'OrderNotFoundError';\n\tconstructor(orderId: string) {\n\t\tsuper(`Order ${orderId} not found`, {\n\t\t\tdetails: 'The requested order could not be found in the marketplace.',\n\t\t});\n\t}\n}\n\nexport class MissingStepDataError extends TransactionError {\n\toverride name = 'MissingStepDataError';\n\tconstructor() {\n\t\tsuper('Step is missing required data', {\n\t\t\tdetails:\n\t\t\t\t'The transaction step is missing required \"to\" or \"signature\" data.',\n\t\t});\n\t}\n}\n\nexport class MissingSignatureDataError extends TransactionError {\n\toverride name = 'MissingSignatureDataError';\n\tconstructor() {\n\t\tsuper('Step is missing signature data', {\n\t\t\tdetails:\n\t\t\t\t'The signature step is missing required signature data configuration.',\n\t\t});\n\t}\n}\n\nexport class InvalidSignatureStepError extends TransactionError {\n\toverride name = 'InvalidSignatureStepError';\n\tconstructor(stepId: string) {\n\t\tsuper(`Invalid signature step type: ${stepId}`, {\n\t\t\tdetails: 'The signature step type is not supported.',\n\t\t});\n\t}\n}\n\nexport class MissingPostStepError extends TransactionError {\n\toverride name = 'MissingPostStepError';\n\tconstructor() {\n\t\tsuper('Missing post step configuration', {\n\t\t\tdetails:\n\t\t\t\t'The signature step is missing required post-step configuration.',\n\t\t});\n\t}\n}\n\nexport class UnexpectedStepsError extends TransactionError {\n\toverride name = 'UnexpectedStepsError';\n\tconstructor() {\n\t\tsuper('Unexpected steps found', {\n\t\t\tdetails: 'The transaction contains more steps than expected.',\n\t\t});\n\t}\n}\n\nexport class NoExecutionStepError extends TransactionError {\n\toverride name = 'NoExecutionStepError';\n\tconstructor() {\n\t\tsuper('No execution step found', {\n\t\t\tdetails: 'The transaction is missing the required execution step.',\n\t\t});\n\t}\n}\n\nexport class NoStepsFoundError extends TransactionError {\n\toverride name = 'NoStepsFoundError';\n\tconstructor() {\n\t\tsuper('No steps found', {\n\t\t\tdetails: 'The transaction contains no steps to execute.',\n\t\t});\n\t}\n}\n\nexport class UnknownTransactionTypeError extends TransactionError {\n\toverride name = 'UnknownTransactionTypeError';\n\tconstructor(type: string) {\n\t\tsuper(`Unknown transaction type: ${type}`, {\n\t\t\tdetails: 'The specified transaction type is not supported.',\n\t\t});\n\t}\n}\n\nexport class InvalidContractTypeError extends TransactionError {\n\toverride name = 'InvalidContractTypeError';\n\tconstructor(contractType: string | undefined) {\n\t\tsuper(`Invalid contract type: ${contractType}`, {\n\t\t\tdetails: 'The contract type must be either ERC721 or ERC1155.',\n\t\t});\n\t}\n}\n\nexport class CollectionNotFoundError extends TransactionError {\n\toverride name = 'CollectionNotFoundError';\n\tconstructor(collectionAddress: string) {\n\t\tsuper(`Collection not found: ${collectionAddress}`, {\n\t\t\tdetails:\n\t\t\t\t'The specified collection address could not be found in the marketplace configuration.',\n\t\t});\n\t}\n}\n\nexport class InvalidCurrencyOptionsError extends TransactionError {\n\toverride name = 'InvalidCurrencyOptionsError';\n\tconstructor(currencyOptions: Address[]) {\n\t\tsuper(`Invalid currency options: ${currencyOptions}`, {\n\t\t\tdetails:\n\t\t\t\t'The currency options must be an array of valid currency contract addresses.',\n\t\t});\n\t}\n}\n\nexport class ProjectNotFoundError extends TransactionError {\n\toverride name = 'ProjectNotFoundError';\n\tconstructor(projectId: string, url: string) {\n\t\tsuper('Project not found', {\n\t\t\tdetails: `Project id: ${projectId} not found at ${url}`,\n\t\t});\n\t}\n}\n\nexport class MarketplaceConfigFetchError extends TransactionError {\n\toverride name = 'MarketplaceConfigFetchError';\n\tconstructor(message: string) {\n\t\tsuper('Failed to fetch marketplace config', {\n\t\t\tdetails: message,\n\t\t});\n\t}\n}\n\nexport class MissingConfigError extends TransactionError {\n\toverride name = 'MissingConfigError';\n\tconstructor(configName: string) {\n\t\tsuper(`Missing required config: ${configName}`, {\n\t\t\tdetails: 'A required configuration parameter is missing.',\n\t\t});\n\t}\n}\n\nexport class TransactionValidationError extends TransactionError {\n\toverride name = 'TransactionValidationError';\n\tconstructor(reason: string) {\n\t\tsuper('Transaction validation failed', {\n\t\t\tdetails: reason,\n\t\t});\n\t}\n}\n\nexport class ChainIdUnavailableError extends TransactionError {\n\toverride name = 'ChainIdUnavailableError';\n\tconstructor() {\n\t\tsuper('Chain ID is not available', {\n\t\t\tdetails: 'Could not determine the current chain ID from the wallet.',\n\t\t});\n\t}\n}\n\nexport class TransactionReceiptError extends TransactionError {\n\toverride name = 'TransactionReceiptError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Failed to get transaction receipt for ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the transaction receipt from the network.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class PaymentModalTransactionError extends TransactionError {\n\toverride name = 'PaymentModalTransactionError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Payment modal transaction failed for ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction initiated from the payment modal failed.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class CheckoutOptionsError extends TransactionError {\n\toverride name = 'CheckoutOptionsError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Failed to get checkout options', {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the checkout options from the marketplace.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class OrdersFetchError extends TransactionError {\n\toverride name = 'OrdersFetchError';\n\tconstructor(orderId: string, cause?: Error) {\n\t\tsuper(`Failed to fetch order ${orderId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the order details from the marketplace.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class SalesContractError extends TransactionError {\n\toverride name = 'SalesContractError';\n\tconstructor(contractAddress: string, method?: string, cause?: Error) {\n\t\tsuper(`Sales contract operation failed: ${contractAddress}`, {\n\t\t\tdetails: `Failed to interact with sales contract${\n\t\t\t\tmethod ? ` on method: ${method}` : ''\n\t\t\t}. ${cause?.message || 'Contract may be paused or misconfigured.'}`,\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class QuantityValidationError extends TransactionError {\n\toverride name = 'QuantityValidationError';\n\tconstructor(provided: number, available: number, tokenId?: string) {\n\t\tsuper(`Invalid quantity: ${provided}`, {\n\t\t\tdetails: `Requested quantity (${provided}) exceeds available supply (${available})${\n\t\t\t\ttokenId ? ` for token ${tokenId}` : ''\n\t\t\t}.`,\n\t\t});\n\t}\n}\n\nexport class ShopDataValidationError extends TransactionError {\n\toverride name = 'ShopDataValidationError';\n\tconstructor(missingField: string) {\n\t\tsuper(`Invalid shop configuration: missing ${missingField}`, {\n\t\t\tdetails: `The shop is missing required field: ${missingField}. Check your marketplace configuration.`,\n\t\t});\n\t}\n}\n\nexport type TransactionErrorTypes =\n\t| ChainIdUnavailableError\n\t| TransactionReceiptError\n\t| PaymentModalTransactionError\n\t| CheckoutOptionsError\n\t| OrdersFetchError\n\t| TransactionConfirmationError\n\t| TransactionValidationError\n\t| MissingConfigError\n\t| MarketplaceConfigFetchError\n\t| ProjectNotFoundError\n\t| CollectionNotFoundError\n\t| InvalidCurrencyOptionsError\n\t| InvalidContractTypeError\n\t| UnknownTransactionTypeError\n\t| NoStepsFoundError\n\t| NoExecutionStepError\n\t| UnexpectedStepsError\n\t| MissingPostStepError\n\t| InvalidSignatureStepError\n\t| MissingSignatureDataError\n\t| MissingStepDataError\n\t| OrderNotFoundError\n\t| TransactionConfirmationError\n\t| InvalidStepError\n\t| PaymentModalError\n\t| StepGenerationError\n\t| StepExecutionError\n\t| UserRejectedRequestError\n\t| NoMarketplaceConfigError\n\t| InsufficientFundsError\n\t| ChainSwitchUserRejectedError\n\t| ChainSwitchError\n\t| TransactionSignatureError\n\t| TransactionExecutionError\n\t| NoWalletConnectedError\n\t| TransactionError\n\t| SalesContractError\n\t| QuantityValidationError\n\t| ShopDataValidationError;\n"],"mappings":";AAQA,IAAa,YAAb,cAA+B,MAAM;CACpC;CACA;CAEA,OAAO;CAEP,YAAY,cAAsB,UAA4B,EAAE,EAAE;AACjE,SAAO;EAEP,MAAM,UAAU,aAAa,UAAU,QAAQ,UAAU;AACzD,OAAK,UAAU;GACd,gBAAgB;GAChB;GACA,GAAI,UAAU,CAAC,YAAY,UAAU,GAAG,EAAE;GAC1C,CAAC,KAAK,KAAK;AAEZ,MAAI,WAAW,WAAW,QAAQ,MACjC,MAAK,QAAQ,QAAQ;AAGtB,OAAK,UAAU,WAAW;AAC1B,OAAK,eAAe;;;;;;ACvBtB,IAAa,mBAAb,cAAsC,UAAU;CAC/C,AAAS,OAAO;;AAGjB,IAAa,mBAAb,cAAsC,iBAAiB;CACtD,AAAS,OAAO;CAChB,YAAY,gBAAwB,eAAuB;AAC1D,QACC,iCAAiC,eAAe,MAAM,iBACtD,EACC,SACC,iGACD,CACD;;;AAaH,IAAa,4BAAb,cAA+C,iBAAiB;CAC/D,AAAS,OAAO;CAChB,YAAY,QAAgB,OAAe;AAC1C,QAAM,uCAAuC,UAAU;GACtD,SACC,OAAO,WACP;GACD;GACA,CAAC;;;AAIJ,IAAa,4BAAb,cAA+C,iBAAiB;CAC/D,AAAS,OAAO;CAChB,YAAY,QAAgB,OAAe;AAC1C,QAAM,oCAAoC,UAAU;GACnD,SACC,OAAO,WACP;GACD;GACA,CAAC;;;AAIJ,IAAa,yBAAb,cAA4C,iBAAiB;CAC5D,AAAS,OAAO;CAChB,cAAc;AACb,QAAM,uBAAuB,EAC5B,SAAS,kEACT,CAAC;;;AAcJ,IAAa,2BAAb,cAA8C,iBAAiB;CAC9D,AAAS,OAAO;CAChB,cAAc;AACb,QAAM,6BAA6B,EAClC,SAAS,2DACT,CAAC;;;AAkKJ,IAAa,2BAAb,cAA8C,iBAAiB;CAC9D,AAAS,OAAO;CAChB,YAAY,cAAkC;AAC7C,QAAM,0BAA0B,gBAAgB,EAC/C,SAAS,uDACT,CAAC;;;AA0CJ,IAAa,qBAAb,cAAwC,iBAAiB;CACxD,AAAS,OAAO;CAChB,YAAY,YAAoB;AAC/B,QAAM,4BAA4B,cAAc,EAC/C,SAAS,kDACT,CAAC"}
@@ -1,2 +1,2 @@
1
- import { Activity, AdditionalFee, ApiConfig, Asset, CardType, CheckoutOptions, CheckoutOptionsItem, CheckoutOptionsMarketplaceOrder, Collectible, CollectibleCardAction, CollectibleOrder, CollectibleStatus, CollectiblesFilter, Collection, CollectionConfig, CollectionFilterSettings, CollectionLastSynced, CollectionStatus, ContractType, CreateReq, Currency, Domain, EcosystemWalletSettings, Env, FeeBreakdown, Filter, FilterCondition, GetOrdersInput, MarketCollection, MarketPage, MarketplaceConfig, MarketplaceKind, MarketplaceSdkContext, MarketplaceSocials, MarketplaceWallet, MarketplaceWalletOptions, MarketplaceWalletWaasSettings, MetadataFilterRule, Order, OrderData, OrderFilter, OrderSide, OrderStatus, OrderbookKind, Page, PostRequest, Price, Project, ProjectStatus, PropertyFilter, PropertyType, SdkConfig, ShopCollection, ShopPage, Signature, SortBy, SortOrder, SourceKind, Step, StepType, TokenMetadata, TransactionCrypto, WalletKind, fetchMarketplaceConfig, marketplaceConfigOptions } from "../create-config-ZOB7i4ZJ.js";
1
+ import { $r as Order, At as CollectibleStatus, Ci as Signature, Di as Step, Dt as CollectibleOrder, Ei as SourceKind, Et as Collectible, G as SdkConfig, H as ApiConfig, It as CollectionStatus, J as MarketCollection, K as CardType, Kt as CreateReq, Lt as ContractType, Mt as Collection, Nt as CollectionConfig, Oi as StepType, Pt as CollectionLastSynced, Ri as TokenMetadata, St as CheckoutOptionsMarketplaceOrder, Ti as SortOrder, U as Env, W as MarketplaceSdkContext, X as ShopCollection, Xi as WalletKind, Y as Price, a as CollectionFilterSettings, ba as MarketplaceWallet, bi as PropertyFilter, bt as CheckoutOptionsItem, c as MarketplaceConfig, ci as PostRequest, cn as Filter, cr as GetOrdersInput, d as MarketplaceWalletWaasSettings, ei as OrderData, f as MetadataFilterRule, ft as Activity, gi as Project, gt as AdditionalFee, i as marketplaceConfigOptions, ii as OrderbookKind, jt as CollectiblesFilter, l as MarketplaceSocials, ni as OrderSide, o as EcosystemWalletSettings, oi as Page, on as FeeBreakdown, p as ShopPage, q as CollectibleCardAction, qr as MarketplaceKind, qt as Currency, r as fetchMarketplaceConfig, ri as OrderStatus, s as MarketPage, ti as OrderFilter, tn as Domain, u as MarketplaceWalletOptions, vt as Asset, wi as SortBy, xi as PropertyType, ya as FilterCondition, yi as ProjectStatus, yt as CheckoutOptions, zi as TransactionCrypto } from "../create-config.js";
2
2
  export { Activity, AdditionalFee, ApiConfig, Asset, CardType, CheckoutOptions, CheckoutOptionsItem, CheckoutOptionsMarketplaceOrder, Collectible, CollectibleCardAction, CollectibleOrder, CollectibleStatus, CollectiblesFilter, Collection, CollectionConfig, CollectionFilterSettings, CollectionLastSynced, CollectionStatus, ContractType, CreateReq, Currency, Domain, EcosystemWalletSettings, Env, FeeBreakdown, Filter, FilterCondition, GetOrdersInput, MarketCollection, MarketPage, MarketplaceConfig, MarketplaceKind, MarketplaceSdkContext, MarketplaceSocials, MarketplaceWallet, MarketplaceWalletOptions, MarketplaceWalletWaasSettings, MetadataFilterRule, Order, OrderData, OrderFilter, OrderSide, OrderStatus, OrderbookKind, Page, PostRequest, Price, Project, ProjectStatus, PropertyFilter, PropertyType, SdkConfig, ShopCollection, ShopPage, Signature, SortBy, SortOrder, SourceKind, Step, StepType, TokenMetadata, TransactionCrypto, WalletKind, fetchMarketplaceConfig, marketplaceConfigOptions };
@@ -1,5 +1,5 @@
1
- import { FilterCondition } from "../builder.gen-B9wR2nvF.js";
2
- import { CollectibleStatus, CollectionStatus, ContractType, MarketplaceKind, OrderSide, OrderStatus, OrderbookKind, ProjectStatus, PropertyType, SortOrder, SourceKind, StepType, TransactionCrypto, WalletKind } from "../marketplace.gen-ksUafDqS.js";
3
- import { CollectibleCardAction } from "../types-B_-cnkcP.js";
1
+ import { t as FilterCondition } from "../builder.gen.js";
2
+ import { A as PropertyType, I as TransactionCrypto, M as SortOrder, N as SourceKind, P as StepType, S as OrderbookKind, U as WalletKind, b as OrderSide, i as CollectibleStatus, k as ProjectStatus, m as MarketplaceKind, o as CollectionStatus, s as ContractType, x as OrderStatus } from "../marketplace.gen.js";
3
+ import { t as CollectibleCardAction } from "../types.js";
4
4
 
5
5
  export { CollectibleCardAction, CollectibleStatus, CollectionStatus, ContractType, FilterCondition, MarketplaceKind, OrderSide, OrderStatus, OrderbookKind, ProjectStatus, PropertyType, SortOrder, SourceKind, StepType, TransactionCrypto, WalletKind };
@@ -1,4 +1,4 @@
1
- import { CardType, CollectibleCardAction, CollectibleOrder, ContractType, Order, OrderbookKind, TokenMetadata as TokenMetadata$1 } from "./create-config-ZOB7i4ZJ.js";
1
+ import { $r as Order, Dt as CollectibleOrder, K as CardType, Lt as ContractType, Ri as TokenMetadata$1, ii as OrderbookKind, q as CollectibleCardAction } from "./create-config.js";
2
2
  import { TokenMetadata } from "@0xsequence/metadata";
3
3
  import { Address } from "viem";
4
4
 
@@ -74,5 +74,5 @@ type NonTradableInventoryCardProps = MarketplaceCardBaseProps & NonTradableInven
74
74
  };
75
75
  type CollectibleCardProps = ShopCollectibleCardProps | MarketCollectibleCardProps | NonTradableInventoryCardProps;
76
76
  //#endregion
77
- export { type CollectibleCardProps, type MarketCardSpecificProps, type MarketCollectibleCardProps, type MarketplaceCardBaseProps, type MarketplaceCollectibleCardProps, type NonTradableInventoryCardProps, type ShopCardSpecificProps, type ShopCollectibleCardProps };
78
- //# sourceMappingURL=types-D2TJ1dwv.d.ts.map
77
+ export { MarketplaceCollectibleCardProps as a, ShopCollectibleCardProps as c, MarketplaceCardBaseProps as i, MarketCardSpecificProps as n, NonTradableInventoryCardProps as o, MarketCollectibleCardProps as r, ShopCardSpecificProps as s, CollectibleCardProps as t };
78
+ //# sourceMappingURL=types.d.ts.map
@@ -9,5 +9,5 @@ let CollectibleCardAction = /* @__PURE__ */ function(CollectibleCardAction$1) {
9
9
  }({});
10
10
 
11
11
  //#endregion
12
- export { CollectibleCardAction };
13
- //# sourceMappingURL=types-B_-cnkcP.js.map
12
+ export { CollectibleCardAction as t };
13
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["../src/types/types.ts"],"sourcesContent":["import type { Currency } from './api-types';\nimport type { MarketplaceConfig } from './new-marketplace-types';\n\nexport * from './new-marketplace-types';\n\nexport type Price = {\n\tamountRaw: string;\n\tcurrency: Currency;\n};\n\nexport type CardType = 'market' | 'shop' | 'inventory-non-tradable';\n\nexport enum CollectibleCardAction {\n\tBUY = 'Buy',\n\tSELL = 'Sell',\n\tLIST = 'Create listing',\n\tOFFER = 'Make an offer',\n\tTRANSFER = 'Transfer',\n}\n\nexport type MarketCollection =\n\tMarketplaceConfig['market']['collections'][number];\n\nexport type ShopCollection = MarketplaceConfig['shop']['collections'][number];\n\n// export type Order = Omit<APIOrder, 'priceAmount' | 'priceAmountNet'> & {\n// \tpriceAmount: bigint;\n// \tpriceAmountNet: bigint;\n// };\n"],"mappings":";AAYA,IAAY,0EAAL;AACN;AACA;AACA;AACA;AACA"}
@@ -1,5 +1,5 @@
1
- import { MAIN_MODULE_ABI } from "../../index-BeRV-7AX.js";
2
- import { EIP2981_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI } from "../../index-Bxzjy0d1.js";
3
- import { ERC1155_SALES_CONTRACT_ABI_V0, ERC1155_SALES_CONTRACT_ABI_V1, ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1 } from "../../index-DwKr18CI.js";
4
- import { ERC1155_ABI, ERC20_ABI, ERC721_ABI, SEQUENCE_1155_ITEMS_ABI } from "../../index-D9LPlmbC.js";
1
+ import { t as MAIN_MODULE_ABI } from "../../index3.js";
2
+ import { n as SequenceMarketplaceV1_ABI, r as EIP2981_ABI, t as SequenceMarketplaceV2_ABI } from "../../index4.js";
3
+ import { i as ERC721_SALE_ABI_V0, n as ERC1155_SALES_CONTRACT_ABI_V0, r as ERC721_SALE_ABI_V1, t as ERC1155_SALES_CONTRACT_ABI_V1 } from "../../index5.js";
4
+ import { i as ERC20_ABI, n as ERC1155_ABI, r as ERC721_ABI, t as SEQUENCE_1155_ITEMS_ABI } from "../../index6.js";
5
5
  export { EIP2981_ABI, ERC1155_ABI, ERC1155_SALES_CONTRACT_ABI_V0, ERC1155_SALES_CONTRACT_ABI_V1, ERC20_ABI, ERC721_ABI, ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1, MAIN_MODULE_ABI, SEQUENCE_1155_ITEMS_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI };
@@ -1,6 +1,6 @@
1
- import { MAIN_MODULE_ABI } from "../../abi-fa-o9gH3.js";
2
- import { EIP2981_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI } from "../../marketplace-NQB-sEQL.js";
3
- import { ERC1155_SALES_CONTRACT_ABI_V0, ERC1155_SALES_CONTRACT_ABI_V1, ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1 } from "../../primary-sale-1u4QlPdA.js";
4
- import { ERC1155_ABI, ERC20_ABI, ERC721_ABI, SEQUENCE_1155_ITEMS_ABI } from "../../token-Cv7l2ZaL.js";
1
+ import { t as MAIN_MODULE_ABI } from "../../abi.js";
2
+ import { n as SequenceMarketplaceV1_ABI, r as EIP2981_ABI, t as SequenceMarketplaceV2_ABI } from "../../marketplace.js";
3
+ import { i as ERC721_SALE_ABI_V0, n as ERC1155_SALES_CONTRACT_ABI_V0, r as ERC721_SALE_ABI_V1, t as ERC1155_SALES_CONTRACT_ABI_V1 } from "../../primary-sale.js";
4
+ import { i as ERC20_ABI, n as ERC1155_ABI, r as ERC721_ABI, t as SEQUENCE_1155_ITEMS_ABI } from "../../token.js";
5
5
 
6
6
  export { EIP2981_ABI, ERC1155_ABI, ERC1155_SALES_CONTRACT_ABI_V0, ERC1155_SALES_CONTRACT_ABI_V1, ERC20_ABI, ERC721_ABI, ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1, MAIN_MODULE_ABI, SEQUENCE_1155_ITEMS_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI };
@@ -1,2 +1,2 @@
1
- import { EIP2981_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI } from "../../../index-Bxzjy0d1.js";
1
+ import { n as SequenceMarketplaceV1_ABI, r as EIP2981_ABI, t as SequenceMarketplaceV2_ABI } from "../../../index4.js";
2
2
  export { EIP2981_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI };
@@ -1,3 +1,3 @@
1
- import { EIP2981_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI } from "../../../marketplace-NQB-sEQL.js";
1
+ import { n as SequenceMarketplaceV1_ABI, r as EIP2981_ABI, t as SequenceMarketplaceV2_ABI } from "../../../marketplace.js";
2
2
 
3
3
  export { EIP2981_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI };
@@ -1,2 +1,2 @@
1
- import { ERC1155_SALES_CONTRACT_ABI_V0, ERC1155_SALES_CONTRACT_ABI_V1, ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1 } from "../../../index-DwKr18CI.js";
1
+ import { i as ERC721_SALE_ABI_V0, n as ERC1155_SALES_CONTRACT_ABI_V0, r as ERC721_SALE_ABI_V1, t as ERC1155_SALES_CONTRACT_ABI_V1 } from "../../../index5.js";
2
2
  export { ERC1155_SALES_CONTRACT_ABI_V0, ERC1155_SALES_CONTRACT_ABI_V1, ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1 };
@@ -1,3 +1,3 @@
1
- import { ERC1155_SALES_CONTRACT_ABI_V0, ERC1155_SALES_CONTRACT_ABI_V1, ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1 } from "../../../primary-sale-1u4QlPdA.js";
1
+ import { i as ERC721_SALE_ABI_V0, n as ERC1155_SALES_CONTRACT_ABI_V0, r as ERC721_SALE_ABI_V1, t as ERC1155_SALES_CONTRACT_ABI_V1 } from "../../../primary-sale.js";
2
2
 
3
3
  export { ERC1155_SALES_CONTRACT_ABI_V0, ERC1155_SALES_CONTRACT_ABI_V1, ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1 };
@@ -1,2 +1,2 @@
1
- import { ERC1155_ABI, ERC20_ABI, ERC721_ABI, SEQUENCE_1155_ITEMS_ABI } from "../../../index-D9LPlmbC.js";
1
+ import { i as ERC20_ABI, n as ERC1155_ABI, r as ERC721_ABI, t as SEQUENCE_1155_ITEMS_ABI } from "../../../index6.js";
2
2
  export { ERC1155_ABI, ERC20_ABI, ERC721_ABI, SEQUENCE_1155_ITEMS_ABI };
@@ -1,3 +1,3 @@
1
- import { ERC1155_ABI, ERC20_ABI, ERC721_ABI, SEQUENCE_1155_ITEMS_ABI } from "../../../token-Cv7l2ZaL.js";
1
+ import { i as ERC20_ABI, n as ERC1155_ABI, r as ERC721_ABI, t as SEQUENCE_1155_ITEMS_ABI } from "../../../token.js";
2
2
 
3
3
  export { ERC1155_ABI, ERC20_ABI, ERC721_ABI, SEQUENCE_1155_ITEMS_ABI };
@@ -1,7 +1,7 @@
1
- import "../create-config-ZOB7i4ZJ.js";
2
- import { MAIN_MODULE_ABI } from "../index-BeRV-7AX.js";
3
- import { EIP2981_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI } from "../index-Bxzjy0d1.js";
4
- import { ERC1155_SALES_CONTRACT_ABI_V0, ERC1155_SALES_CONTRACT_ABI_V1, ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1 } from "../index-DwKr18CI.js";
5
- import { ERC1155_ABI, ERC20_ABI, ERC721_ABI, SEQUENCE_1155_ITEMS_ABI } from "../index-D9LPlmbC.js";
6
- import { calculateEarningsAfterFees, calculatePriceDifferencePercentage, cn, compareAddress, formatPrice, formatPriceWithFee, getMarketplaceDetails, getNetwork, getPresentableChainName, networkToWagmiChain, truncateEnd, truncateMiddle } from "../index-CS65jqOq.js";
7
- export { EIP2981_ABI, ERC1155_ABI, ERC1155_SALES_CONTRACT_ABI_V0, ERC1155_SALES_CONTRACT_ABI_V1, ERC20_ABI, ERC721_ABI, ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1, MAIN_MODULE_ABI, SEQUENCE_1155_ITEMS_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI, calculateEarningsAfterFees, calculatePriceDifferencePercentage, cn, compareAddress, formatPrice, formatPriceWithFee, getMarketplaceDetails, getNetwork, getPresentableChainName, networkToWagmiChain, truncateEnd, truncateMiddle };
1
+ import "../create-config.js";
2
+ import { t as MAIN_MODULE_ABI } from "../index3.js";
3
+ import { n as SequenceMarketplaceV1_ABI, r as EIP2981_ABI, t as SequenceMarketplaceV2_ABI } from "../index4.js";
4
+ import { i as ERC721_SALE_ABI_V0, n as ERC1155_SALES_CONTRACT_ABI_V0, r as ERC721_SALE_ABI_V1, t as ERC1155_SALES_CONTRACT_ABI_V1 } from "../index5.js";
5
+ import { i as ERC20_ABI, n as ERC1155_ABI, r as ERC721_ABI, t as SEQUENCE_1155_ITEMS_ABI } from "../index6.js";
6
+ import { a as formatPriceWithFee, c as getNetwork, d as cn, f as compareAddress, i as formatPrice, l as getPresentableChainName, m as truncateMiddle, n as calculatePriceDifferencePercentage, o as validateOpenseaOfferDecimals, p as truncateEnd, r as calculateTotalOfferCost, s as networkToWagmiChain, t as calculateEarningsAfterFees, u as getMarketplaceDetails } from "../index7.js";
7
+ export { EIP2981_ABI, ERC1155_ABI, ERC1155_SALES_CONTRACT_ABI_V0, ERC1155_SALES_CONTRACT_ABI_V1, ERC20_ABI, ERC721_ABI, ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1, MAIN_MODULE_ABI, SEQUENCE_1155_ITEMS_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI, calculateEarningsAfterFees, calculatePriceDifferencePercentage, calculateTotalOfferCost, cn, compareAddress, formatPrice, formatPriceWithFee, getMarketplaceDetails, getNetwork, getPresentableChainName, networkToWagmiChain, truncateEnd, truncateMiddle, validateOpenseaOfferDecimals };
@@ -1,14 +1,14 @@
1
- import "../builder.gen-B9wR2nvF.js";
2
- import { networkToWagmiChain } from "../networkconfigToWagmiChain-DbUf6HiO.js";
3
- import "../transaction-DZUW5RHu.js";
4
- import "../marketplace.gen-ksUafDqS.js";
5
- import { getNetwork, getPresentableChainName } from "../network-DtmiMhcg.js";
6
- import "../types-B_-cnkcP.js";
7
- import { MAIN_MODULE_ABI } from "../abi-fa-o9gH3.js";
8
- import { EIP2981_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI } from "../marketplace-NQB-sEQL.js";
9
- import { ERC1155_SALES_CONTRACT_ABI_V0, ERC1155_SALES_CONTRACT_ABI_V1, ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1 } from "../primary-sale-1u4QlPdA.js";
10
- import { ERC1155_ABI, ERC20_ABI, ERC721_ABI, SEQUENCE_1155_ITEMS_ABI } from "../token-Cv7l2ZaL.js";
11
- import { calculateEarningsAfterFees, calculatePriceDifferencePercentage, cn, compareAddress, formatPrice, formatPriceWithFee, getMarketplaceDetails, truncateEnd, truncateMiddle } from "../utils-BfpDVibN.js";
12
- import "../marketplace-logos-D4dS1Foy.js";
1
+ import "../builder.gen.js";
2
+ import { t as networkToWagmiChain } from "../networkconfigToWagmiChain.js";
3
+ import "../transaction.js";
4
+ import "../marketplace.gen.js";
5
+ import { n as getPresentableChainName, t as getNetwork } from "../network.js";
6
+ import "../types.js";
7
+ import { t as MAIN_MODULE_ABI } from "../abi.js";
8
+ import { n as SequenceMarketplaceV1_ABI, r as EIP2981_ABI, t as SequenceMarketplaceV2_ABI } from "../marketplace.js";
9
+ import { i as ERC721_SALE_ABI_V0, n as ERC1155_SALES_CONTRACT_ABI_V0, r as ERC721_SALE_ABI_V1, t as ERC1155_SALES_CONTRACT_ABI_V1 } from "../primary-sale.js";
10
+ import { i as ERC20_ABI, n as ERC1155_ABI, r as ERC721_ABI, t as SEQUENCE_1155_ITEMS_ABI } from "../token.js";
11
+ import { a as formatPriceWithFee, c as cn, d as truncateMiddle, i as formatPrice, l as compareAddress, n as calculatePriceDifferencePercentage, o as validateOpenseaOfferDecimals, r as calculateTotalOfferCost, s as getMarketplaceDetails, t as calculateEarningsAfterFees, u as truncateEnd } from "../utils.js";
12
+ import "../marketplace-logos.js";
13
13
 
14
- export { EIP2981_ABI, ERC1155_ABI, ERC1155_SALES_CONTRACT_ABI_V0, ERC1155_SALES_CONTRACT_ABI_V1, ERC20_ABI, ERC721_ABI, ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1, MAIN_MODULE_ABI, SEQUENCE_1155_ITEMS_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI, calculateEarningsAfterFees, calculatePriceDifferencePercentage, cn, compareAddress, formatPrice, formatPriceWithFee, getMarketplaceDetails, getNetwork, getPresentableChainName, networkToWagmiChain, truncateEnd, truncateMiddle };
14
+ export { EIP2981_ABI, ERC1155_ABI, ERC1155_SALES_CONTRACT_ABI_V0, ERC1155_SALES_CONTRACT_ABI_V1, ERC20_ABI, ERC721_ABI, ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1, MAIN_MODULE_ABI, SEQUENCE_1155_ITEMS_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI, calculateEarningsAfterFees, calculatePriceDifferencePercentage, calculateTotalOfferCost, cn, compareAddress, formatPrice, formatPriceWithFee, getMarketplaceDetails, getNetwork, getPresentableChainName, networkToWagmiChain, truncateEnd, truncateMiddle, validateOpenseaOfferDecimals };
@@ -1,5 +1,5 @@
1
- import { MarketplaceKind } from "./marketplace.gen-ksUafDqS.js";
2
- import { AlienSwapLogo, BlurLogo, LooksRareLogo, MagicEdenLogo, MintifyLogo, OpenSeaLogo, SequenceLogo, X2y2Logo } from "./marketplace-logos-D4dS1Foy.js";
1
+ import { m as MarketplaceKind } from "./marketplace.gen.js";
2
+ import { c as LooksRareLogo, d as MintifyLogo, g as SequenceLogo, i as BlurLogo, l as MagicEdenLogo, m as OpenSeaLogo, t as AlienSwapLogo, y as X2y2Logo } from "./marketplace-logos.js";
3
3
  import { clsx } from "clsx";
4
4
  import { twMerge } from "tailwind-merge";
5
5
  import * as dn from "dnum";
@@ -186,7 +186,45 @@ const formatPriceWithFee = (amount, decimals, feePercentage) => {
186
186
  return "0";
187
187
  }
188
188
  };
189
+ const calculateTotalOfferCost = (offerAmountRaw, decimals, royaltyPercentage = 0) => {
190
+ try {
191
+ const dnumAmount = [offerAmountRaw, decimals];
192
+ let totalCost = dn.from(dnumAmount);
193
+ if (royaltyPercentage > 0) {
194
+ const royaltyFee = dn.multiply(totalCost, dn.from((royaltyPercentage / 100).toString(), decimals));
195
+ totalCost = dn.add(totalCost, royaltyFee);
196
+ }
197
+ const cleanAmount = dn.format(totalCost, {
198
+ digits: decimals,
199
+ trailingZeros: true
200
+ }).replace(/,/g, "");
201
+ return BigInt(Math.round(Number(cleanAmount) * 10 ** decimals));
202
+ } catch (error) {
203
+ console.error("Error calculating total offer cost:", error);
204
+ return offerAmountRaw;
205
+ }
206
+ };
207
+ /**
208
+ * Validates if a price value meets OpenSea's decimal constraints for offers
209
+ * OpenSea allows maximum 4 decimal places for offers and minimum 0.0001
210
+ * @param value - The price value as a string
211
+ * @returns Object containing validation result and error message
212
+ * @example
213
+ * ```ts
214
+ * const result = validateOpenseaOfferDecimals('0.12345');
215
+ * // Returns { isValid: false, errorMessage: "Offer amount must be at least 0.0001" }
216
+ * ```
217
+ */
218
+ const validateOpenseaOfferDecimals = (value) => {
219
+ if (!value || value === "0") return { isValid: true };
220
+ const [_, decimals = ""] = value.split(".");
221
+ if (decimals.length > 4) return {
222
+ isValid: false,
223
+ errorMessage: "Offer amount must be at least 0.0001"
224
+ };
225
+ return { isValid: true };
226
+ };
189
227
 
190
228
  //#endregion
191
- export { calculateEarningsAfterFees, calculatePriceDifferencePercentage, cn, compareAddress, formatPrice, formatPriceWithFee, getMarketplaceDetails, truncateEnd, truncateMiddle };
192
- //# sourceMappingURL=utils-BfpDVibN.js.map
229
+ export { formatPriceWithFee as a, cn as c, truncateMiddle as d, formatPrice as i, compareAddress as l, calculatePriceDifferencePercentage as n, validateOpenseaOfferDecimals as o, calculateTotalOfferCost as r, getMarketplaceDetails as s, calculateEarningsAfterFees as t, truncateEnd as u };
230
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","names":["MARKETPLACES: Record<string, Marketplace>","KIND_TO_MARKETPLACE: Partial<\n\tRecord<MarketplaceKind, keyof typeof MARKETPLACES>\n>"],"sources":["../src/utils/address.ts","../src/utils/cn.ts","../src/utils/getMarketplaceDetails.ts","../src/utils/price.ts"],"sourcesContent":["export const truncateMiddle = (\n\taddress: string,\n\tminPrefix = 20,\n\tminSuffix = 3,\n): string => {\n\tif (minPrefix + minSuffix >= 40) {\n\t\treturn address;\n\t}\n\treturn `${address.substring(0, 2 + minPrefix)}…${address.substring(address.length - minSuffix)}`;\n};\n\nexport const truncateEnd = (text: string | undefined, truncateAt: number) => {\n\tif (!text) return '';\n\n\tlet finalText = text;\n\n\tif (text.length >= truncateAt) {\n\t\tfinalText = `${text.slice(0, truncateAt)}...`;\n\t}\n\n\treturn finalText;\n};\n\nexport const compareAddress = (a = '', b = '') => {\n\treturn a.toLowerCase() === b.toLowerCase();\n};\n","import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","import type { Image } from '@0xsequence/design-system';\nimport type { ComponentType } from 'react';\nimport {\n\tAlienSwapLogo,\n\tBlurLogo,\n\tLooksRareLogo,\n\tMagicEdenLogo,\n\tMintifyLogo,\n\tOpenSeaLogo,\n\tSequenceLogo,\n\tX2y2Logo,\n} from '../react/ui/components/marketplace-logos';\nimport { MarketplaceKind } from '../types';\n\ninterface Marketplace {\n\tlogo: ComponentType<React.ComponentProps<typeof Image>>;\n\tdisplayName: string;\n}\n\nconst MARKETPLACES: Record<string, Marketplace> = {\n\tsequence: {\n\t\tlogo: SequenceLogo,\n\t\tdisplayName: 'Sequence',\n\t},\n\topensea: {\n\t\tlogo: OpenSeaLogo,\n\t\tdisplayName: 'OpenSea',\n\t},\n\tmagiceden: {\n\t\tlogo: MagicEdenLogo,\n\t\tdisplayName: 'Magic Eden',\n\t},\n\tmintify: {\n\t\tlogo: MintifyLogo,\n\t\tdisplayName: 'Mintify',\n\t},\n\tlooksrare: {\n\t\tlogo: LooksRareLogo,\n\t\tdisplayName: 'Looks Rare',\n\t},\n\tx2y2: {\n\t\tlogo: X2y2Logo,\n\t\tdisplayName: 'X2Y2',\n\t},\n\tblur: {\n\t\tlogo: BlurLogo,\n\t\tdisplayName: 'Blur',\n\t},\n\talienswap: {\n\t\tlogo: AlienSwapLogo,\n\t\tdisplayName: 'AlienSwap',\n\t},\n} as const;\n\nconst KIND_TO_MARKETPLACE: Partial<\n\tRecord<MarketplaceKind, keyof typeof MARKETPLACES>\n> = {\n\t[MarketplaceKind.sequence_marketplace_v1]: 'sequence',\n\t[MarketplaceKind.sequence_marketplace_v2]: 'sequence',\n\t[MarketplaceKind.opensea]: 'opensea',\n\t[MarketplaceKind.mintify]: 'mintify',\n\t[MarketplaceKind.looks_rare]: 'looksrare',\n\t[MarketplaceKind.x2y2]: 'x2y2',\n\t[MarketplaceKind.blur]: 'blur',\n\t[MarketplaceKind.magic_eden]: 'magiceden',\n};\n\ntype MarketplaceDetailsProp = {\n\toriginName: string;\n\tkind: MarketplaceKind;\n};\n\n// TODO: add support for more marketplaces and improve detection of marketplace\nexport function getMarketplaceDetails({\n\toriginName,\n\tkind,\n}: MarketplaceDetailsProp) {\n\tif (\n\t\tkind === MarketplaceKind.sequence_marketplace_v1 ||\n\t\tkind === MarketplaceKind.sequence_marketplace_v2\n\t) {\n\t\treturn MARKETPLACES.sequence;\n\t}\n\n\tlet name = originName.toLowerCase();\n\n\ttry {\n\t\t//Check if the name can be parsed as a url\n\t\tnew URL(name);\n\t\t// if it can we are naively trying to extract the root domain\n\t\tname = getRootDomain(name) || name;\n\t} catch {}\n\n\tname = name.replace(/ /g, '');\n\n\tconst details = MARKETPLACES[name];\n\n\tif (details) {\n\t\treturn details;\n\t}\n\n\tif (KIND_TO_MARKETPLACE[kind]) {\n\t\treturn MARKETPLACES[KIND_TO_MARKETPLACE[kind]];\n\t}\n}\n\nfunction getRootDomain(url: string) {\n\tconst domain = url.replace(/^(https?:\\/\\/)?(www\\.)?/, '');\n\tconst parts = domain.split('.');\n\treturn parts[parts.length - 2] || parts[0];\n}\n","import * as dn from 'dnum';\nimport { formatUnits } from 'viem';\n\ntype CalculatePriceDifferencePercentageArgs = {\n\tinputPriceRaw: bigint;\n\tbasePriceRaw: bigint;\n\tdecimals: number;\n};\n\n/**\n * Calculates the percentage difference between two prices\n * @param args - Object containing input price, base price, and decimals\n * @returns The percentage difference as a string with 2 decimal places\n * @example\n * ```ts\n * const diff = calculatePriceDifferencePercentage({\n * inputPriceRaw: 1000000n,\n * basePriceRaw: 900000n,\n * decimals: 6\n * }); // Returns \"11.11\"\n * ```\n */\nexport const calculatePriceDifferencePercentage = ({\n\tinputPriceRaw,\n\tbasePriceRaw,\n\tdecimals,\n}: CalculatePriceDifferencePercentageArgs) => {\n\tconst inputPrice = Number(formatUnits(inputPriceRaw, decimals));\n\tconst basePrice = Number(formatUnits(basePriceRaw, decimals));\n\tconst difference = inputPrice - basePrice;\n\tconst percentageDifference = (difference / basePrice) * 100;\n\n\treturn percentageDifference.toFixed(2);\n};\n\n/**\n * Formats a raw price amount with the specified number of decimal places\n * @param amount - The raw price amount as a bigint\n * @param decimals - Number of decimal places to format to\n * @returns Formatted price string with proper decimal and thousands separators\n * @example\n * ```ts\n * const formatted = formatPrice(1000000n, 6); // Returns \"1.000000\"\n * ```\n */\nexport const formatPrice = (amount: bigint, decimals: number): string => {\n\tconst formattedUnits = Number(formatUnits(amount, decimals));\n\treturn formattedUnits.toLocaleString('en-US', {\n\t\tminimumFractionDigits: 0,\n\t\tmaximumFractionDigits: decimals,\n\t});\n};\n\n/**\n * Calculates the final earnings amount after applying multiple fee percentages\n * @param amount - The raw amount as a bigint (e.g., from a blockchain transaction)\n * @param decimals - The number of decimal places for the currency (e.g., 18 for ETH, 6 for USDC)\n * @param fees - Array of fee percentages to apply (e.g., [2.5, 1.0] for 2.5% and 1% fees)\n * @returns Formatted string representing the final earnings after all fees are applied\n * @throws Will return '0' if there's an error in calculation\n * @example\n * ```ts\n * const earnings = calculateEarningsAfterFees(\n * 1000000000000000000n, // 1 ETH\n * 18, // ETH decimals\n * [2.5, 1.0] // 2.5% and 1% fees\n * ); // Returns \"0.96525\" (1 ETH after 2.5% and 1% fees)\n * ```\n */\nexport const calculateEarningsAfterFees = (\n\tamount: bigint,\n\tdecimals: number,\n\tfees: number[],\n): string => {\n\ttry {\n\t\tconst decimalAmount = Number(formatUnits(amount, decimals));\n\t\tlet earnings = dn.from(decimalAmount.toString(), decimals);\n\n\t\tfor (const fee of fees) {\n\t\t\tif (fee > 0) {\n\t\t\t\tconst feeMultiplier = dn.from((1 - fee / 100).toString(), decimals);\n\t\t\t\tearnings = dn.multiply(earnings, feeMultiplier);\n\t\t\t}\n\t\t}\n\n\t\treturn dn.format(earnings, {\n\t\t\tdigits: decimals,\n\t\t\ttrailingZeros: false,\n\t\t\tlocale: 'en-US',\n\t\t});\n\t} catch (error) {\n\t\tconsole.error('Error calculating earnings after fees:', error);\n\t\treturn '0';\n\t}\n};\n\n/**\n * Formats a price amount with fee applied\n * @param amount - The raw price amount as a bigint\n * @param decimals - Number of decimal places for the currency\n * @param feePercentage - Fee percentage to apply (e.g., 3.5 for 3.5%)\n * @returns Formatted price string with fee applied and proper decimal/thousands separators\n * @example\n * ```ts\n * const priceWithFee = formatPriceWithFee(1000000n, 6, 3.5); // Returns \"1.035\"\n * ```\n */\nexport const formatPriceWithFee = (\n\tamount: bigint,\n\tdecimals: number,\n\tfeePercentage: number,\n): string => {\n\ttry {\n\t\tconst decimalAmount = Number(formatUnits(amount, decimals));\n\t\tconst price = dn.from(decimalAmount.toString(), decimals);\n\t\tconst feeMultiplier = dn.from(\n\t\t\t(1 + feePercentage / 100).toString(),\n\t\t\tdecimals,\n\t\t);\n\t\tconst totalPrice = dn.multiply(price, feeMultiplier);\n\n\t\treturn dn.format(totalPrice, {\n\t\t\tdigits: decimals,\n\t\t\ttrailingZeros: false,\n\t\t\tlocale: 'en-US',\n\t\t});\n\t} catch (error) {\n\t\tconsole.error('Error formatting price with fee:', error);\n\t\treturn '0';\n\t}\n};\n\nexport const calculateTotalOfferCost = (\n\tofferAmountRaw: bigint,\n\tdecimals: number,\n\troyaltyPercentage = 0,\n): bigint => {\n\ttry {\n\t\tconst dnumAmount = [offerAmountRaw, decimals] as dn.Dnum;\n\t\tlet totalCost = dn.from(dnumAmount);\n\n\t\tif (royaltyPercentage > 0) {\n\t\t\tconst royaltyFee = dn.multiply(\n\t\t\t\ttotalCost,\n\t\t\t\tdn.from((royaltyPercentage / 100).toString(), decimals),\n\t\t\t);\n\t\t\ttotalCost = dn.add(totalCost, royaltyFee);\n\t\t}\n\n\t\tconst totalCostString = dn.format(totalCost, {\n\t\t\tdigits: decimals,\n\t\t\ttrailingZeros: true,\n\t\t});\n\n\t\tconst cleanAmount = totalCostString.replace(/,/g, '');\n\n\t\treturn BigInt(Math.round(Number(cleanAmount) * 10 ** decimals));\n\t} catch (error) {\n\t\tconsole.error('Error calculating total offer cost:', error);\n\t\treturn offerAmountRaw;\n\t}\n};\n\n/**\n * Validates if a price value meets OpenSea's decimal constraints for offers\n * OpenSea allows maximum 4 decimal places for offers and minimum 0.0001\n * @param value - The price value as a string\n * @returns Object containing validation result and error message\n * @example\n * ```ts\n * const result = validateOpenseaOfferDecimals('0.12345');\n * // Returns { isValid: false, errorMessage: \"Offer amount must be at least 0.0001\" }\n * ```\n */\nexport const validateOpenseaOfferDecimals = (\n\tvalue: string,\n): { isValid: boolean; errorMessage?: string } => {\n\tif (!value || value === '0') return { isValid: true };\n\n\tconst [_, decimals = ''] = value.split('.');\n\tif (decimals.length > 4) {\n\t\treturn {\n\t\t\tisValid: false,\n\t\t\terrorMessage: 'Offer amount must be at least 0.0001',\n\t\t};\n\t}\n\n\treturn { isValid: true };\n};\n"],"mappings":";;;;;;;;AAAA,MAAa,kBACZ,SACA,YAAY,IACZ,YAAY,MACA;AACZ,KAAI,YAAY,aAAa,GAC5B,QAAO;AAER,QAAO,GAAG,QAAQ,UAAU,GAAG,IAAI,UAAU,CAAC,GAAG,QAAQ,UAAU,QAAQ,SAAS,UAAU;;AAG/F,MAAa,eAAe,MAA0B,eAAuB;AAC5E,KAAI,CAAC,KAAM,QAAO;CAElB,IAAI,YAAY;AAEhB,KAAI,KAAK,UAAU,WAClB,aAAY,GAAG,KAAK,MAAM,GAAG,WAAW,CAAC;AAG1C,QAAO;;AAGR,MAAa,kBAAkB,IAAI,IAAI,IAAI,OAAO;AACjD,QAAO,EAAE,aAAa,KAAK,EAAE,aAAa;;;;;ACrB3C,SAAgB,GAAG,GAAG,QAAsB;AAC3C,QAAO,QAAQ,KAAK,OAAO,CAAC;;;;;ACe7B,MAAMA,eAA4C;CACjD,UAAU;EACT,MAAM;EACN,aAAa;EACb;CACD,SAAS;EACR,MAAM;EACN,aAAa;EACb;CACD,WAAW;EACV,MAAM;EACN,aAAa;EACb;CACD,SAAS;EACR,MAAM;EACN,aAAa;EACb;CACD,WAAW;EACV,MAAM;EACN,aAAa;EACb;CACD,MAAM;EACL,MAAM;EACN,aAAa;EACb;CACD,MAAM;EACL,MAAM;EACN,aAAa;EACb;CACD,WAAW;EACV,MAAM;EACN,aAAa;EACb;CACD;AAED,MAAMC,sBAEF;EACF,gBAAgB,0BAA0B;EAC1C,gBAAgB,0BAA0B;EAC1C,gBAAgB,UAAU;EAC1B,gBAAgB,UAAU;EAC1B,gBAAgB,aAAa;EAC7B,gBAAgB,OAAO;EACvB,gBAAgB,OAAO;EACvB,gBAAgB,aAAa;CAC9B;AAQD,SAAgB,sBAAsB,EACrC,YACA,QAC0B;AAC1B,KACC,SAAS,gBAAgB,2BACzB,SAAS,gBAAgB,wBAEzB,QAAO,aAAa;CAGrB,IAAI,OAAO,WAAW,aAAa;AAEnC,KAAI;AAEH,MAAI,IAAI,KAAK;AAEb,SAAO,cAAc,KAAK,IAAI;SACvB;AAER,QAAO,KAAK,QAAQ,MAAM,GAAG;CAE7B,MAAM,UAAU,aAAa;AAE7B,KAAI,QACH,QAAO;AAGR,KAAI,oBAAoB,MACvB,QAAO,aAAa,oBAAoB;;AAI1C,SAAS,cAAc,KAAa;CAEnC,MAAM,QADS,IAAI,QAAQ,2BAA2B,GAAG,CACpC,MAAM,IAAI;AAC/B,QAAO,MAAM,MAAM,SAAS,MAAM,MAAM;;;;;;;;;;;;;;;;;;ACvFzC,MAAa,sCAAsC,EAClD,eACA,cACA,eAC6C;CAC7C,MAAM,aAAa,OAAO,YAAY,eAAe,SAAS,CAAC;CAC/D,MAAM,YAAY,OAAO,YAAY,cAAc,SAAS,CAAC;AAI7D,UAHmB,aAAa,aACW,YAAa,KAE5B,QAAQ,EAAE;;;;;;;;;;;;AAavC,MAAa,eAAe,QAAgB,aAA6B;AAExE,QADuB,OAAO,YAAY,QAAQ,SAAS,CAAC,CACtC,eAAe,SAAS;EAC7C,uBAAuB;EACvB,uBAAuB;EACvB,CAAC;;;;;;;;;;;;;;;;;;AAmBH,MAAa,8BACZ,QACA,UACA,SACY;AACZ,KAAI;EACH,MAAM,gBAAgB,OAAO,YAAY,QAAQ,SAAS,CAAC;EAC3D,IAAI,WAAW,GAAG,KAAK,cAAc,UAAU,EAAE,SAAS;AAE1D,OAAK,MAAM,OAAO,KACjB,KAAI,MAAM,GAAG;GACZ,MAAM,gBAAgB,GAAG,MAAM,IAAI,MAAM,KAAK,UAAU,EAAE,SAAS;AACnE,cAAW,GAAG,SAAS,UAAU,cAAc;;AAIjD,SAAO,GAAG,OAAO,UAAU;GAC1B,QAAQ;GACR,eAAe;GACf,QAAQ;GACR,CAAC;UACM,OAAO;AACf,UAAQ,MAAM,0CAA0C,MAAM;AAC9D,SAAO;;;;;;;;;;;;;;AAeT,MAAa,sBACZ,QACA,UACA,kBACY;AACZ,KAAI;EACH,MAAM,gBAAgB,OAAO,YAAY,QAAQ,SAAS,CAAC;EAC3D,MAAM,QAAQ,GAAG,KAAK,cAAc,UAAU,EAAE,SAAS;EACzD,MAAM,gBAAgB,GAAG,MACvB,IAAI,gBAAgB,KAAK,UAAU,EACpC,SACA;EACD,MAAM,aAAa,GAAG,SAAS,OAAO,cAAc;AAEpD,SAAO,GAAG,OAAO,YAAY;GAC5B,QAAQ;GACR,eAAe;GACf,QAAQ;GACR,CAAC;UACM,OAAO;AACf,UAAQ,MAAM,oCAAoC,MAAM;AACxD,SAAO;;;AAIT,MAAa,2BACZ,gBACA,UACA,oBAAoB,MACR;AACZ,KAAI;EACH,MAAM,aAAa,CAAC,gBAAgB,SAAS;EAC7C,IAAI,YAAY,GAAG,KAAK,WAAW;AAEnC,MAAI,oBAAoB,GAAG;GAC1B,MAAM,aAAa,GAAG,SACrB,WACA,GAAG,MAAM,oBAAoB,KAAK,UAAU,EAAE,SAAS,CACvD;AACD,eAAY,GAAG,IAAI,WAAW,WAAW;;EAQ1C,MAAM,cALkB,GAAG,OAAO,WAAW;GAC5C,QAAQ;GACR,eAAe;GACf,CAAC,CAEkC,QAAQ,MAAM,GAAG;AAErD,SAAO,OAAO,KAAK,MAAM,OAAO,YAAY,GAAG,MAAM,SAAS,CAAC;UACvD,OAAO;AACf,UAAQ,MAAM,uCAAuC,MAAM;AAC3D,SAAO;;;;;;;;;;;;;;AAeT,MAAa,gCACZ,UACiD;AACjD,KAAI,CAAC,SAAS,UAAU,IAAK,QAAO,EAAE,SAAS,MAAM;CAErD,MAAM,CAAC,GAAG,WAAW,MAAM,MAAM,MAAM,IAAI;AAC3C,KAAI,SAAS,SAAS,EACrB,QAAO;EACN,SAAS;EACT,cAAc;EACd;AAGF,QAAO,EAAE,SAAS,MAAM"}
@@ -1,6 +1,7 @@
1
- import { currencyKeys, getQueryClient } from "./api-BoO0V5aJ.js";
2
- import { marketCurrenciesQueryOptions } from "./marketCurrencies-sKrTX0og.js";
1
+ import { _ as getQueryClient, p as currencyKeys } from "./api.js";
2
+ import { r as marketCurrenciesQueryOptions } from "./marketCurrencies.js";
3
3
  import { queryOptions } from "@tanstack/react-query";
4
+ import * as dn from "dnum";
4
5
  import { formatUnits } from "viem";
5
6
 
6
7
  //#region src/react/queries/utils/convertPriceToUSD.ts
@@ -70,9 +71,14 @@ async function fetchComparePrices(params) {
70
71
  const percentageDifference = difference / compareToPriceUSD.usdAmount * 100;
71
72
  const isAbove = percentageDifference > 0;
72
73
  const isSame = percentageDifference === 0;
74
+ const absPercentage = Math.abs(percentageDifference);
73
75
  return {
74
76
  percentageDifference,
75
- percentageDifferenceFormatted: Math.abs(percentageDifference).toFixed(2),
77
+ percentageDifferenceFormatted: dn.format([BigInt(Math.round(absPercentage * 100)), 2], {
78
+ digits: 2,
79
+ trailingZeros: true,
80
+ locale: "en-US"
81
+ }),
76
82
  status: isAbove ? "above" : isSame ? "same" : "below"
77
83
  };
78
84
  }
@@ -108,5 +114,5 @@ function comparePricesQueryOptions(params) {
108
114
  }
109
115
 
110
116
  //#endregion
111
- export { comparePricesQueryOptions, convertPriceToUSDQueryOptions, fetchComparePrices, fetchConvertPriceToUSD, getComparePricesQueryKey, getConvertPriceToUSDQueryKey };
112
- //# sourceMappingURL=utils-BCgNhBFR.js.map
117
+ export { fetchConvertPriceToUSD as a, convertPriceToUSDQueryOptions as i, fetchComparePrices as n, getConvertPriceToUSDQueryKey as o, getComparePricesQueryKey as r, comparePricesQueryOptions as t };
118
+ //# sourceMappingURL=utils2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils2.js","names":[],"sources":["../src/react/queries/utils/convertPriceToUSD.ts","../src/react/queries/utils/comparePrices.ts"],"sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { type Address, formatUnits } from 'viem';\nimport type { SdkConfig } from '../../../types';\nimport {\n\ttype Currency,\n\tcurrencyKeys,\n\tgetQueryClient,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\nimport { marketCurrenciesQueryOptions } from '../market/marketCurrencies';\n\nexport interface FetchConvertPriceToUSDParams {\n\tchainId: number;\n\tcurrencyAddress: Address;\n\tamountRaw: string;\n\tconfig: SdkConfig;\n}\n\nexport interface ConvertPriceToUSDReturn {\n\tusdAmount: number;\n\tusdAmountFormatted: string;\n}\n\n/**\n * Converts a price amount from a specific currency to USD using exchange rates\n */\nexport async function fetchConvertPriceToUSD(\n\tparams: FetchConvertPriceToUSDParams,\n): Promise<ConvertPriceToUSDReturn> {\n\tconst { chainId, currencyAddress, amountRaw, config } = params;\n\n\tconst queryClient = getQueryClient();\n\tconst currencies = (await queryClient.fetchQuery(\n\t\tmarketCurrenciesQueryOptions({\n\t\t\tchainId,\n\t\t\tconfig,\n\t\t}),\n\t)) as Currency[];\n\n\tconst currencyDetails = currencies.find(\n\t\t(c: Currency) =>\n\t\t\tc.contractAddress.toLowerCase() === currencyAddress.toLowerCase(),\n\t);\n\n\tif (!currencyDetails) {\n\t\tthrow new Error('Currency not found');\n\t}\n\n\tconst amountDecimal = Number(\n\t\tformatUnits(BigInt(amountRaw), currencyDetails.decimals),\n\t);\n\tconst usdAmount = amountDecimal * currencyDetails.exchangeRate;\n\n\treturn {\n\t\tusdAmount,\n\t\tusdAmountFormatted: usdAmount.toFixed(2),\n\t};\n}\n\nexport type ConvertPriceToUSDQueryOptions =\n\tValuesOptional<FetchConvertPriceToUSDParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getConvertPriceToUSDQueryKey(\n\tparams: ConvertPriceToUSDQueryOptions,\n) {\n\tconst apiArgs = {\n\t\tchainId: params.chainId!,\n\t\tcurrencyAddress: params.currencyAddress!,\n\t\tamountRaw: params.amountRaw!,\n\t};\n\n\treturn [...currencyKeys.conversion, 'usd', apiArgs] as const;\n}\n\nexport function convertPriceToUSDQueryOptions(\n\tparams: ConvertPriceToUSDQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.chainId &&\n\t\t\tparams.currencyAddress &&\n\t\t\tparams.amountRaw &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getConvertPriceToUSDQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchConvertPriceToUSD({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcurrencyAddress: params.currencyAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tamountRaw: params.amountRaw!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport * as dn from 'dnum';\nimport type { Address } from 'viem';\nimport type { SdkConfig } from '../../../types';\nimport { currencyKeys, type ValuesOptional } from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\nimport { fetchConvertPriceToUSD } from './convertPriceToUSD';\n\nexport interface FetchComparePricesParams {\n\tchainId: number;\n\t// First price details\n\tpriceAmountRaw: string;\n\tpriceCurrencyAddress: Address;\n\t// Second price details (to compare against)\n\tcompareToPriceAmountRaw: string;\n\tcompareToPriceCurrencyAddress: Address;\n\tconfig: SdkConfig;\n}\n\nexport type ComparePricesReturn = {\n\tpercentageDifference: number;\n\tpercentageDifferenceFormatted: string;\n\tstatus: 'above' | 'same' | 'below';\n};\n\n/**\n * Compares prices between different currencies by converting both to USD\n */\nexport async function fetchComparePrices(\n\tparams: FetchComparePricesParams,\n): Promise<ComparePricesReturn> {\n\tconst {\n\t\tchainId,\n\t\tpriceAmountRaw,\n\t\tpriceCurrencyAddress,\n\t\tcompareToPriceAmountRaw,\n\t\tcompareToPriceCurrencyAddress,\n\t\tconfig,\n\t} = params;\n\n\tconst [priceUSD, compareToPriceUSD] = await Promise.all([\n\t\tfetchConvertPriceToUSD({\n\t\t\tchainId,\n\t\t\tcurrencyAddress: priceCurrencyAddress,\n\t\t\tamountRaw: priceAmountRaw,\n\t\t\tconfig,\n\t\t}),\n\t\tfetchConvertPriceToUSD({\n\t\t\tchainId,\n\t\t\tcurrencyAddress: compareToPriceCurrencyAddress,\n\t\t\tamountRaw: compareToPriceAmountRaw,\n\t\t\tconfig,\n\t\t}),\n\t]);\n\n\tconst difference = priceUSD.usdAmount - compareToPriceUSD.usdAmount;\n\n\tif (compareToPriceUSD.usdAmount === 0) {\n\t\tthrow new Error('Cannot compare to zero price');\n\t}\n\n\tconst percentageDifference = (difference / compareToPriceUSD.usdAmount) * 100;\n\tconst isAbove = percentageDifference > 0;\n\tconst isSame = percentageDifference === 0;\n\n\t// proper comma separators\n\tconst absPercentage = Math.abs(percentageDifference);\n\tconst formattedPercentage = dn.format(\n\t\t[BigInt(Math.round(absPercentage * 100)), 2],\n\t\t{\n\t\t\tdigits: 2,\n\t\t\ttrailingZeros: true,\n\t\t\tlocale: 'en-US',\n\t\t},\n\t);\n\n\treturn {\n\t\tpercentageDifference,\n\t\tpercentageDifferenceFormatted: formattedPercentage,\n\t\tstatus: isAbove ? 'above' : isSame ? 'same' : 'below',\n\t};\n}\n\nexport type ComparePricesQueryOptions =\n\tValuesOptional<FetchComparePricesParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getComparePricesQueryKey(params: ComparePricesQueryOptions) {\n\tconst apiArgs = {\n\t\tchainId: params.chainId!,\n\t\tpriceAmountRaw: params.priceAmountRaw!,\n\t\tpriceCurrencyAddress: params.priceCurrencyAddress!,\n\t\tcompareToPriceAmountRaw: params.compareToPriceAmountRaw!,\n\t\tcompareToPriceCurrencyAddress: params.compareToPriceCurrencyAddress!,\n\t};\n\n\treturn [...currencyKeys.conversion, 'compare', apiArgs] as const;\n}\n\nexport function comparePricesQueryOptions(params: ComparePricesQueryOptions) {\n\tconst enabled = Boolean(\n\t\tparams.chainId &&\n\t\t\tparams.priceAmountRaw &&\n\t\t\tparams.priceCurrencyAddress &&\n\t\t\tparams.compareToPriceAmountRaw &&\n\t\t\tparams.compareToPriceCurrencyAddress &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getComparePricesQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchComparePrices({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tpriceAmountRaw: params.priceAmountRaw!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tpriceCurrencyAddress: params.priceCurrencyAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcompareToPriceAmountRaw: params.compareToPriceAmountRaw!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcompareToPriceCurrencyAddress: params.compareToPriceCurrencyAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n"],"mappings":";;;;;;;;;;AA2BA,eAAsB,uBACrB,QACmC;CACnC,MAAM,EAAE,SAAS,iBAAiB,WAAW,WAAW;CAUxD,MAAM,mBAPc,MADA,gBAAgB,CACE,WACrC,6BAA6B;EAC5B;EACA;EACA,CAAC,CACF,EAEkC,MACjC,MACA,EAAE,gBAAgB,aAAa,KAAK,gBAAgB,aAAa,CAClE;AAED,KAAI,CAAC,gBACJ,OAAM,IAAI,MAAM,qBAAqB;CAMtC,MAAM,YAHgB,OACrB,YAAY,OAAO,UAAU,EAAE,gBAAgB,SAAS,CACxD,GACiC,gBAAgB;AAElD,QAAO;EACN;EACA,oBAAoB,UAAU,QAAQ,EAAE;EACxC;;AAQF,SAAgB,6BACf,QACC;CACD,MAAM,UAAU;EACf,SAAS,OAAO;EAChB,iBAAiB,OAAO;EACxB,WAAW,OAAO;EAClB;AAED,QAAO;EAAC,GAAG,aAAa;EAAY;EAAO;EAAQ;;AAGpD,SAAgB,8BACf,QACC;CACD,MAAM,UAAU,QACf,OAAO,WACN,OAAO,mBACP,OAAO,aACP,OAAO,WACN,OAAO,OAAO,WAAW,MAC3B;AAED,QAAO,aAAa;EACnB,UAAU,6BAA6B,OAAO;EAC9C,eACC,uBAAuB;GAEtB,SAAS,OAAO;GAEhB,iBAAiB,OAAO;GAExB,WAAW,OAAO;GAElB,QAAQ,OAAO;GACf,CAAC;EACH,GAAG,OAAO;EACV;EACA,CAAC;;;;;;;;AC3EH,eAAsB,mBACrB,QAC+B;CAC/B,MAAM,EACL,SACA,gBACA,sBACA,yBACA,+BACA,WACG;CAEJ,MAAM,CAAC,UAAU,qBAAqB,MAAM,QAAQ,IAAI,CACvD,uBAAuB;EACtB;EACA,iBAAiB;EACjB,WAAW;EACX;EACA,CAAC,EACF,uBAAuB;EACtB;EACA,iBAAiB;EACjB,WAAW;EACX;EACA,CAAC,CACF,CAAC;CAEF,MAAM,aAAa,SAAS,YAAY,kBAAkB;AAE1D,KAAI,kBAAkB,cAAc,EACnC,OAAM,IAAI,MAAM,+BAA+B;CAGhD,MAAM,uBAAwB,aAAa,kBAAkB,YAAa;CAC1E,MAAM,UAAU,uBAAuB;CACvC,MAAM,SAAS,yBAAyB;CAGxC,MAAM,gBAAgB,KAAK,IAAI,qBAAqB;AAUpD,QAAO;EACN;EACA,+BAX2B,GAAG,OAC9B,CAAC,OAAO,KAAK,MAAM,gBAAgB,IAAI,CAAC,EAAE,EAAE,EAC5C;GACC,QAAQ;GACR,eAAe;GACf,QAAQ;GACR,CACD;EAKA,QAAQ,UAAU,UAAU,SAAS,SAAS;EAC9C;;AAQF,SAAgB,yBAAyB,QAAmC;CAC3E,MAAM,UAAU;EACf,SAAS,OAAO;EAChB,gBAAgB,OAAO;EACvB,sBAAsB,OAAO;EAC7B,yBAAyB,OAAO;EAChC,+BAA+B,OAAO;EACtC;AAED,QAAO;EAAC,GAAG,aAAa;EAAY;EAAW;EAAQ;;AAGxD,SAAgB,0BAA0B,QAAmC;CAC5E,MAAM,UAAU,QACf,OAAO,WACN,OAAO,kBACP,OAAO,wBACP,OAAO,2BACP,OAAO,iCACP,OAAO,WACN,OAAO,OAAO,WAAW,MAC3B;AAED,QAAO,aAAa;EACnB,UAAU,yBAAyB,OAAO;EAC1C,eACC,mBAAmB;GAElB,SAAS,OAAO;GAEhB,gBAAgB,OAAO;GAEvB,sBAAsB,OAAO;GAE7B,yBAAyB,OAAO;GAEhC,+BAA+B,OAAO;GAEtC,QAAQ,OAAO;GACf,CAAC;EACH,GAAG,OAAO;EACV;EACA,CAAC"}
@@ -1,4 +1,4 @@
1
- import { ContractType } from "./marketplace.gen-ksUafDqS.js";
1
+ import { s as ContractType } from "./marketplace.gen.js";
2
2
  import { formatUnits } from "viem";
3
3
 
4
4
  //#region src/react/ui/components/marketplace-collectible-card/utils/formatPrice.ts
@@ -39,5 +39,5 @@ const getSupplyStatusText = ({ quantityRemaining, collectionType, unlimitedSuppl
39
39
  };
40
40
 
41
41
  //#endregion
42
- export { OVERFLOW_PRICE, UNDERFLOW_PRICE, formatPriceNumber, getSupplyStatusText };
43
- //# sourceMappingURL=utils-BqxcalL2.js.map
42
+ export { formatPriceNumber as i, OVERFLOW_PRICE as n, UNDERFLOW_PRICE as r, getSupplyStatusText as t };
43
+ //# sourceMappingURL=utils3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils3.js","names":[],"sources":["../src/react/ui/components/marketplace-collectible-card/utils/formatPrice.ts","../src/react/ui/components/marketplace-collectible-card/utils/supplyStatus.ts"],"sourcesContent":["import { formatUnits } from 'viem';\n\nexport const OVERFLOW_PRICE = 100000000;\nexport const UNDERFLOW_PRICE = 0.0001;\n\nexport const formatPriceNumber = (\n\tamount: string,\n\tdecimals: number,\n): {\n\tformattedNumber: string;\n\tisUnderflow: boolean;\n\tisOverflow: boolean;\n} => {\n\tconst formattedPrice = formatUnits(BigInt(amount), decimals);\n\tconst numericPrice = Number.parseFloat(formattedPrice);\n\n\tif (numericPrice < UNDERFLOW_PRICE) {\n\t\treturn {\n\t\t\tformattedNumber: UNDERFLOW_PRICE.toString(),\n\t\t\tisUnderflow: true,\n\t\t\tisOverflow: false,\n\t\t};\n\t}\n\n\tif (numericPrice > OVERFLOW_PRICE) {\n\t\treturn {\n\t\t\tformattedNumber: OVERFLOW_PRICE.toLocaleString('en-US', {\n\t\t\t\tmaximumFractionDigits: 2,\n\t\t\t}),\n\t\t\tisUnderflow: false,\n\t\t\tisOverflow: true,\n\t\t};\n\t}\n\n\tconst maxDecimals = numericPrice < 0.01 ? 6 : 4;\n\n\treturn {\n\t\tformattedNumber: numericPrice.toLocaleString('en-US', {\n\t\t\tminimumFractionDigits: 0,\n\t\t\tmaximumFractionDigits: maxDecimals,\n\t\t}),\n\t\tisUnderflow: false,\n\t\tisOverflow: false,\n\t};\n};\n","import { ContractType } from '../../../../_internal';\n\nexport const getSupplyStatusText = ({\n\tquantityRemaining,\n\tcollectionType,\n\tunlimitedSupply,\n}: {\n\tquantityRemaining: string | undefined;\n\tcollectionType: ContractType;\n\tunlimitedSupply?: boolean;\n}): string => {\n\tif (unlimitedSupply) {\n\t\treturn 'Unlimited Supply';\n\t}\n\n\tif (\n\t\tcollectionType === ContractType.ERC721 &&\n\t\tquantityRemaining === undefined\n\t) {\n\t\treturn 'Out of stock';\n\t}\n\n\tif (\n\t\tcollectionType === ContractType.ERC1155 &&\n\t\t!unlimitedSupply &&\n\t\tquantityRemaining === '0'\n\t) {\n\t\treturn 'Out of stock';\n\t}\n\n\tif (quantityRemaining && Number(quantityRemaining) > 0) {\n\t\treturn `Supply: ${quantityRemaining}`;\n\t}\n\n\treturn 'Out of stock';\n};\n"],"mappings":";;;;AAEA,MAAa,iBAAiB;AAC9B,MAAa,kBAAkB;AAE/B,MAAa,qBACZ,QACA,aAKI;CACJ,MAAM,iBAAiB,YAAY,OAAO,OAAO,EAAE,SAAS;CAC5D,MAAM,eAAe,OAAO,WAAW,eAAe;AAEtD,KAAI,eAAe,gBAClB,QAAO;EACN,iBAAiB,gBAAgB,UAAU;EAC3C,aAAa;EACb,YAAY;EACZ;AAGF,KAAI,eAAe,eAClB,QAAO;EACN,iBAAiB,eAAe,eAAe,SAAS,EACvD,uBAAuB,GACvB,CAAC;EACF,aAAa;EACb,YAAY;EACZ;CAGF,MAAM,cAAc,eAAe,MAAO,IAAI;AAE9C,QAAO;EACN,iBAAiB,aAAa,eAAe,SAAS;GACrD,uBAAuB;GACvB,uBAAuB;GACvB,CAAC;EACF,aAAa;EACb,YAAY;EACZ;;;;;ACzCF,MAAa,uBAAuB,EACnC,mBACA,gBACA,sBAKa;AACb,KAAI,gBACH,QAAO;AAGR,KACC,mBAAmB,aAAa,UAChC,sBAAsB,OAEtB,QAAO;AAGR,KACC,mBAAmB,aAAa,WAChC,CAAC,mBACD,sBAAsB,IAEtB,QAAO;AAGR,KAAI,qBAAqB,OAAO,kBAAkB,GAAG,EACpD,QAAO,WAAW;AAGnB,QAAO"}
@@ -1,4 +1,4 @@
1
- import { getIndexerClient } from "./api-BoO0V5aJ.js";
1
+ import { n as getIndexerClient } from "./api.js";
2
2
  import { TransactionReceiptNotFoundError } from "viem";
3
3
 
4
4
  //#region src/react/utils/waitForTransactionReceipt.ts
@@ -21,5 +21,5 @@ const waitForTransactionReceipt = async ({ txHash, chainId, sdkConfig, maxBlockW
21
21
  };
22
22
 
23
23
  //#endregion
24
- export { waitForTransactionReceipt };
25
- //# sourceMappingURL=waitForTransactionReceipt-DieAnV52.js.map
24
+ export { waitForTransactionReceipt as t };
25
+ //# sourceMappingURL=waitForTransactionReceipt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waitForTransactionReceipt.js","names":[],"sources":["../src/react/utils/waitForTransactionReceipt.ts"],"sourcesContent":["import type { TransactionReceipt } from '@0xsequence/indexer';\nimport { type Hex, TransactionReceiptNotFoundError } from 'viem';\nimport type { SdkConfig } from '../../types';\nimport { getIndexerClient } from '../_internal/api';\n\nconst MAX_RETRIES = 3;\nconst MAX_BLOCK_WAIT = 30;\n\nexport const waitForTransactionReceipt = async ({\n\ttxHash,\n\tchainId,\n\tsdkConfig,\n\tmaxBlockWait = MAX_BLOCK_WAIT,\n}: {\n\ttxHash: Hex;\n\tchainId: number;\n\tsdkConfig: SdkConfig;\n\tmaxBlockWait?: number;\n}): Promise<TransactionReceipt> => {\n\tconst indexer = getIndexerClient(chainId, sdkConfig);\n\tlet retries = 0;\n\n\twhile (retries < MAX_RETRIES) {\n\t\ttry {\n\t\t\tconst result = await indexer.fetchTransactionReceipt({\n\t\t\t\ttxnHash: txHash,\n\t\t\t\tmaxBlockWait,\n\t\t\t});\n\t\t\treturn result.receipt;\n\t\t} catch (error) {\n\t\t\tretries++;\n\t\t\tconsole.error(\n\t\t\t\t`Failed to fetch transaction receipt (attempt ${retries}/${MAX_RETRIES}):`,\n\t\t\t\terror,\n\t\t\t);\n\t\t\tif (retries >= MAX_RETRIES) {\n\t\t\t\tthrow TransactionReceiptNotFoundError;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow TransactionReceiptNotFoundError;\n};\n"],"mappings":";;;;AAKA,MAAM,cAAc;AACpB,MAAM,iBAAiB;AAEvB,MAAa,4BAA4B,OAAO,EAC/C,QACA,SACA,WACA,eAAe,qBAMmB;CAClC,MAAM,UAAU,iBAAiB,SAAS,UAAU;CACpD,IAAI,UAAU;AAEd,QAAO,UAAU,YAChB,KAAI;AAKH,UAJe,MAAM,QAAQ,wBAAwB;GACpD,SAAS;GACT;GACA,CAAC,EACY;UACN,OAAO;AACf;AACA,UAAQ,MACP,gDAAgD,QAAQ,GAAG,YAAY,KACvE,MACA;AACD,MAAI,WAAW,YACd,OAAM;;AAKT,OAAM"}
@@ -3,4 +3,4 @@ var x2y2_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAA
3
3
 
4
4
  //#endregion
5
5
  export { x2y2_default as default };
6
- //# sourceMappingURL=x2y2-45WDooeh.js.map
6
+ //# sourceMappingURL=x2y2.js.map