@0xsequence/marketplace-sdk 0.9.0 → 0.10.0

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 (326) hide show
  1. package/.storybook/main.ts +63 -0
  2. package/.storybook/preview.ts +24 -0
  3. package/.storybook/vitest.setup.ts +6 -0
  4. package/CHANGELOG.md +77 -8
  5. package/dist/{CalendarIcon-DbQ7Vxcw.js → CalendarIcon-CqsuAuCm.js} +4 -51
  6. package/dist/CalendarIcon-CqsuAuCm.js.map +1 -0
  7. package/dist/{CollectibleCard-C8Ae64Ab.d.ts → CollectibleCard-Dd-CG6dE.d.ts} +8 -7
  8. package/dist/InfoIcon-v0w_Lu7t.js +53 -0
  9. package/dist/InfoIcon-v0w_Lu7t.js.map +1 -0
  10. package/dist/{_internal-BgWcRIak.js → _internal-C75gOSNo.js} +2 -10
  11. package/dist/_internal-C75gOSNo.js.map +1 -0
  12. package/dist/actionModal-CMUeVsFX.js +116 -0
  13. package/dist/actionModal-CMUeVsFX.js.map +1 -0
  14. package/dist/{alien_swap-B_76IMma.js → alien_swap-CYv6YlOF.js} +1 -1
  15. package/dist/{alien_swap-B_76IMma.js.map → alien_swap-CYv6YlOF.js.map} +1 -1
  16. package/dist/{api-DTIan01C.js → api-BiMGqWdz.js} +17 -34
  17. package/dist/api-BiMGqWdz.js.map +1 -0
  18. package/dist/{aqua-xyz-CMN_TFY5.js → aqua-xyz-Bzn5baeH.js} +1 -1
  19. package/dist/{aqua-xyz-CMN_TFY5.js.map → aqua-xyz-Bzn5baeH.js.map} +1 -1
  20. package/dist/{aura-Cye_TuHj.js → aura-DzIWh8WT.js} +1 -1
  21. package/dist/{aura-Cye_TuHj.js.map → aura-DzIWh8WT.js.map} +1 -1
  22. package/dist/base-DqaJPvfN.js +22 -0
  23. package/dist/base-DqaJPvfN.js.map +1 -0
  24. package/dist/{blur-DWDMyMpK.js → blur-DSH-Cbpj.js} +1 -1
  25. package/dist/{blur-DWDMyMpK.js.map → blur-DSH-Cbpj.js.map} +1 -1
  26. package/dist/{coinbase-ByA_XRB0.js → coinbase-Df8URNxq.js} +1 -1
  27. package/dist/{coinbase-ByA_XRB0.js.map → coinbase-Df8URNxq.js.map} +1 -1
  28. package/dist/{new-marketplace-types-Bfis0U4J.d.ts → create-config-DKJ-F0jc.d.ts} +402 -41
  29. package/dist/{wagmi-CDzEQbfk.js → create-config-fQ-jbJD1.js} +20 -10
  30. package/dist/create-config-fQ-jbJD1.js.map +1 -0
  31. package/dist/{element-b77CyXIZ.js → element-Cx6uJu5N.js} +1 -1
  32. package/dist/{element-b77CyXIZ.js.map → element-Cx6uJu5N.js.map} +1 -1
  33. package/dist/{foundation-DbOrKP9Y.js → foundation-D6U4aRLN.js} +1 -1
  34. package/dist/{foundation-DbOrKP9Y.js.map → foundation-D6U4aRLN.js.map} +1 -1
  35. package/dist/get-provider-CYYHfrlg.js +10 -0
  36. package/dist/get-provider-CYYHfrlg.js.map +1 -0
  37. package/dist/get-query-client-D19vvfJo.js +23 -0
  38. package/dist/get-query-client-D19vvfJo.js.map +1 -0
  39. package/dist/hooks-4pxIbLbM.js +4044 -0
  40. package/dist/hooks-4pxIbLbM.js.map +1 -0
  41. package/dist/{index-BL9RUSEK.d.ts → index-136YrWDH.d.ts} +1 -1
  42. package/dist/{index-D5v5iluA.d.ts → index-BAhaEfqY.d.ts} +1 -1
  43. package/dist/index-BKBin-rq.d.ts +979 -0
  44. package/dist/{index-BQsgAvtX.d.ts → index-BUWB_RXp.d.ts} +776 -570
  45. package/dist/{index-21LE7OhL.d.ts → index-BhVFc2rX.d.ts} +6 -3
  46. package/dist/{index-DXMfTZ1F.d.ts → index-C5aqo8xu.d.ts} +1 -1
  47. package/dist/{index-ByznONYE.d.ts → index-CKrYP7ot.d.ts} +20 -48
  48. package/dist/{index-DaE5ZNHb.d.ts → index-CUwMH7Ht.d.ts} +5 -5
  49. package/dist/{index-CLy8y5hm.d.ts → index-Cu70Lw-w.d.ts} +1 -1
  50. package/dist/index.css +414 -1
  51. package/dist/index.d.ts +8 -10
  52. package/dist/index.js +13 -9
  53. package/dist/{looks-rare-C1VqNcSM.js → looks-rare-ChBRBY-p.js} +1 -1
  54. package/dist/{looks-rare-C1VqNcSM.js.map → looks-rare-ChBRBY-p.js.map} +1 -1
  55. package/dist/{magic-eden-ea_AGCZr.js → magic-eden-D5U7N1xL.js} +1 -1
  56. package/dist/{magic-eden-ea_AGCZr.js.map → magic-eden-D5U7N1xL.js.map} +1 -1
  57. package/dist/{manifold-8y8J2sjT.js → manifold-CtLF52zU.js} +1 -1
  58. package/dist/{manifold-8y8J2sjT.js.map → manifold-CtLF52zU.js.map} +1 -1
  59. package/dist/{marketplace-nwnZv9Cb.js → marketplace-DmFiyBoS.js} +1 -1
  60. package/dist/{marketplace-nwnZv9Cb.js.map → marketplace-DmFiyBoS.js.map} +1 -1
  61. package/dist/{marketplace-logos-CSeGcPW4.js → marketplace-logos-Cd6W-qOq.js} +21 -21
  62. package/dist/{marketplace-logos-CSeGcPW4.js.map → marketplace-logos-Cd6W-qOq.js.map} +1 -1
  63. package/dist/{marketplace.gen-BSDIX7NZ.js → marketplace.gen-HpnpL5xU.js} +3 -3
  64. package/dist/marketplace.gen-HpnpL5xU.js.map +1 -0
  65. package/dist/{marketplaceConfig-C6X1SUik.js → marketplaceConfig-GQTTmihy.js} +3 -3
  66. package/dist/marketplaceConfig-GQTTmihy.js.map +1 -0
  67. package/dist/{mintify-LA68TzWg.js → mintify-Bi3Bce68.js} +1 -1
  68. package/dist/{mintify-LA68TzWg.js.map → mintify-Bi3Bce68.js.map} +1 -1
  69. package/dist/network-CGD0oKtS.js +15 -0
  70. package/dist/network-CGD0oKtS.js.map +1 -0
  71. package/dist/{nftx-D3Tc8nzd.js → nftx-BDQZjtkX.js} +1 -1
  72. package/dist/{nftx-D3Tc8nzd.js.map → nftx-BDQZjtkX.js.map} +1 -1
  73. package/dist/{okx-hbqg6oIJ.js → okx-D4meadLe.js} +1 -1
  74. package/dist/{okx-hbqg6oIJ.js.map → okx-D4meadLe.js.map} +1 -1
  75. package/dist/{open-sea-BccuK8-t.js → open-sea-DN0hgfVw.js} +1 -1
  76. package/dist/{open-sea-BccuK8-t.js.map → open-sea-DN0hgfVw.js.map} +1 -1
  77. package/dist/{primary-sale-C55ALnfQ.js → primary-sale-CmWxSfFQ.js} +1 -1
  78. package/dist/{primary-sale-C55ALnfQ.js.map → primary-sale-CmWxSfFQ.js.map} +1 -1
  79. package/dist/provider-DPGUA10G.js +125 -0
  80. package/dist/provider-DPGUA10G.js.map +1 -0
  81. package/dist/{queries-CUU65uYZ.js → queries-Ce_2othB.js} +165 -7
  82. package/dist/queries-Ce_2othB.js.map +1 -0
  83. package/dist/{rarible-BgTwwj9g.js → rarible-B0xlD88A.js} +1 -1
  84. package/dist/{rarible-BgTwwj9g.js.map → rarible-B0xlD88A.js.map} +1 -1
  85. package/dist/react/_internal/api/index.d.ts +2 -4
  86. package/dist/react/_internal/api/index.js +7 -4
  87. package/dist/react/_internal/databeat/index.d.ts +2 -73
  88. package/dist/react/_internal/databeat/index.js +4 -21
  89. package/dist/react/_internal/index.d.ts +2 -7
  90. package/dist/react/_internal/index.js +11 -6
  91. package/dist/react/_internal/wagmi/index.d.ts +2 -4
  92. package/dist/react/_internal/wagmi/index.js +5 -3
  93. package/dist/react/hooks/index.d.ts +12 -17
  94. package/dist/react/hooks/index.js +23 -19
  95. package/dist/react/hooks/options/index.d.ts +2 -3
  96. package/dist/react/hooks/options/index.js +12 -7
  97. package/dist/react/index.d.ts +12 -17
  98. package/dist/react/index.js +28 -19
  99. package/dist/react/queries/index.d.ts +9 -8
  100. package/dist/react/queries/index.js +20 -15
  101. package/dist/react/ssr/index.d.ts +7 -9
  102. package/dist/react/ssr/index.js +11 -6
  103. package/dist/react/ssr/index.js.map +1 -1
  104. package/dist/react/ui/components/marketplace-collectible-card/index.d.ts +3 -8
  105. package/dist/react/ui/components/marketplace-collectible-card/index.js +27 -18
  106. package/dist/react/ui/components/marketplace-collectible-card/utils/index.d.ts +2 -7
  107. package/dist/react/ui/components/marketplace-collectible-card/utils/index.js +11 -6
  108. package/dist/react/ui/components/marketplace-logos/index.d.ts +21 -21
  109. package/dist/react/ui/components/marketplace-logos/index.js +1 -1
  110. package/dist/react/ui/icons/index.js +13 -9
  111. package/dist/react/ui/index.d.ts +3 -8
  112. package/dist/react/ui/index.js +27 -18
  113. package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +2 -2
  114. package/dist/react/ui/modals/_internal/components/actionModal/index.js +23 -18
  115. package/dist/{react-DAIicQPT.js → react-DP0M2Wfm.js} +799 -4306
  116. package/dist/react-DP0M2Wfm.js.map +1 -0
  117. package/dist/{react-BbHBl6gg.css → react-DeDyTgo7.css} +1 -1
  118. package/dist/{react-BbHBl6gg.css.map → react-DeDyTgo7.css.map} +1 -1
  119. package/dist/{sequence-Do3kzb4J.js → sequence-BIrOVRXO.js} +1 -1
  120. package/dist/{sequence-Do3kzb4J.js.map → sequence-BIrOVRXO.js.map} +1 -1
  121. package/dist/{sudo-swap-B6vPKxBz.js → sudo-swap-BPMon-M5.js} +1 -1
  122. package/dist/{sudo-swap-B6vPKxBz.js.map → sudo-swap-BPMon-M5.js.map} +1 -1
  123. package/dist/{super-rare-eCm1SE6O.js → super-rare-kPN6Ua8i.js} +1 -1
  124. package/dist/{super-rare-eCm1SE6O.js.map → super-rare-kPN6Ua8i.js.map} +1 -1
  125. package/dist/{token-Da4TdyUk.js → token-CHSBPYVG.js} +1 -1
  126. package/dist/{token-Da4TdyUk.js.map → token-CHSBPYVG.js.map} +1 -1
  127. package/dist/{transaction-CcVViHEL.js → transaction-CnctdNzS.js} +3 -21
  128. package/dist/transaction-CnctdNzS.js.map +1 -0
  129. package/dist/types/index.d.ts +2 -3
  130. package/dist/types/index.js +2 -2
  131. package/dist/{types-DwWE6xOF.js → types-Yw2ywj6j.js} +1 -1
  132. package/dist/{types-DwWE6xOF.js.map → types-Yw2ywj6j.js.map} +1 -1
  133. package/dist/utils/abi/index.d.ts +4 -4
  134. package/dist/utils/abi/index.js +4 -4
  135. package/dist/utils/abi/marketplace/index.d.ts +1 -1
  136. package/dist/utils/abi/marketplace/index.js +1 -1
  137. package/dist/utils/abi/primary-sale/index.d.ts +1 -1
  138. package/dist/utils/abi/primary-sale/index.js +1 -1
  139. package/dist/utils/abi/token/index.d.ts +1 -1
  140. package/dist/utils/abi/token/index.js +1 -1
  141. package/dist/utils/index.d.ts +7 -8
  142. package/dist/utils/index.js +12 -9
  143. package/dist/{utils-CW2NA5KG.js → utils-9RXDgcBl.js} +4 -11
  144. package/dist/utils-9RXDgcBl.js.map +1 -0
  145. package/dist/{utils-BPYfgDSL.js → utils-DjVJ9tov.js} +5 -6
  146. package/dist/utils-DjVJ9tov.js.map +1 -0
  147. package/dist/wagmi-Do_KW5ke.js +0 -0
  148. package/dist/{x2y2-DD17tT91.js → x2y2-BLz-_Q2O.js} +1 -1
  149. package/dist/{x2y2-DD17tT91.js.map → x2y2-BLz-_Q2O.js.map} +1 -1
  150. package/dist/{zora-BpSG9UzS.js → zora-UGhKs-aL.js} +1 -1
  151. package/dist/{zora-BpSG9UzS.js.map → zora-UGhKs-aL.js.map} +1 -1
  152. package/eslint.config.mjs +4 -0
  153. package/package.json +27 -14
  154. package/postcss.config.mjs +6 -0
  155. package/src/index.css +5 -4
  156. package/src/index.ts +1 -0
  157. package/src/react/__tests__/provider.test.tsx +4 -3
  158. package/src/react/_internal/api/__mocks__/indexer.msw.ts +16 -0
  159. package/src/react/_internal/api/__mocks__/laos.msw.ts +387 -0
  160. package/src/react/_internal/api/__mocks__/marketplace.msw.ts +2 -0
  161. package/src/react/_internal/api/__tests__/laos-api.test.ts +756 -0
  162. package/src/react/_internal/api/laos-api.ts +3 -0
  163. package/src/react/_internal/api/marketplace.gen.ts +5 -3
  164. package/src/react/_internal/api/query-keys.ts +12 -4
  165. package/src/react/_internal/api/services.ts +2 -14
  166. package/src/react/_internal/databeat/index.ts +15 -14
  167. package/src/react/_internal/databeat/types.ts +22 -0
  168. package/src/react/_internal/databeat/utils.ts +26 -0
  169. package/src/react/_internal/utils.ts +4 -4
  170. package/src/react/_internal/wagmi/create-config.ts +28 -13
  171. package/src/react/_internal/wallet/wallet.ts +4 -4
  172. package/src/react/hooks/__tests__/useBalanceOfCollectible.laos.test.tsx +367 -0
  173. package/src/react/hooks/__tests__/useCheckoutOptions.test.tsx +158 -0
  174. package/src/react/hooks/__tests__/useCheckoutOptionsSalesContract.test.tsx +42 -65
  175. package/src/react/hooks/__tests__/useCollectionBalanceDetails.test.tsx +17 -0
  176. package/src/react/hooks/__tests__/useCollectionDetailsPolling.test.tsx +11 -3
  177. package/src/react/hooks/__tests__/useConvertPriceToUSD.test.tsx +3 -3
  178. package/src/react/hooks/__tests__/useCurrencyBalance.test.tsx +7 -3
  179. package/src/react/hooks/__tests__/useFilters.test.tsx +2 -2
  180. package/src/react/hooks/__tests__/useGetTokenRanges.test.tsx +111 -0
  181. package/src/react/hooks/__tests__/useListTokenMetadata.test.tsx +83 -57
  182. package/src/react/hooks/__tests__/useTransferTokens.test.tsx +469 -0
  183. package/src/react/hooks/index.ts +3 -1
  184. package/src/react/hooks/useCheckoutOptions.tsx +96 -0
  185. package/src/react/hooks/useCheckoutOptionsSalesContract.tsx +98 -57
  186. package/src/react/hooks/useCollectionBalanceDetails.tsx +95 -68
  187. package/src/react/hooks/useCollectionDetailsPolling.tsx +3 -7
  188. package/src/react/hooks/useComparePrices.tsx +90 -82
  189. package/src/react/hooks/useConvertPriceToUSD.tsx +85 -71
  190. package/src/react/hooks/useCurrencyBalance.tsx +132 -46
  191. package/src/react/hooks/useERC721SaleMintedTokens.tsx +8 -5
  192. package/src/react/hooks/useFilters.tsx +154 -111
  193. package/src/react/hooks/useGetCountOfPrimarySaleItems.tsx +48 -0
  194. package/src/react/hooks/useGetTokenRanges.tsx +83 -22
  195. package/src/react/hooks/useList1155ShopCardData.tsx +2 -0
  196. package/src/react/hooks/useList721ShopCardData.tsx +12 -7
  197. package/src/react/hooks/useListCollections.tsx +25 -25
  198. package/src/react/hooks/useListMarketCardData.tsx +2 -1
  199. package/src/react/hooks/useListPrimarySaleItems.tsx +66 -0
  200. package/src/react/hooks/useListTokenMetadata.ts +71 -0
  201. package/src/react/hooks/useOpenConnectModal.tsx +9 -0
  202. package/src/react/hooks/useTokenSaleDetailsBatch.tsx +3 -7
  203. package/src/react/hooks/useTokenSupplies.ts +81 -0
  204. package/src/react/hooks/useTransferTokens.tsx +2 -2
  205. package/src/react/provider.tsx +73 -9
  206. package/src/react/queries/__tests__/balanceOfCollectible.laos.test.ts +123 -0
  207. package/src/react/queries/__tests__/inventory.laos.test.ts +496 -0
  208. package/src/react/queries/balanceOfCollectible.ts +7 -4
  209. package/src/react/queries/checkoutOptions.ts +85 -0
  210. package/src/react/queries/checkoutOptionsSalesContract.ts +89 -0
  211. package/src/react/queries/collectionBalanceDetails.ts +92 -0
  212. package/src/react/queries/comparePrices.ts +108 -0
  213. package/src/react/queries/convertPriceToUSD.ts +92 -0
  214. package/src/react/queries/filters.ts +138 -0
  215. package/src/react/queries/getTokenRanges.ts +62 -0
  216. package/src/react/queries/index.ts +3 -0
  217. package/src/react/queries/inventory.ts +6 -0
  218. package/src/react/queries/listBalances.ts +4 -3
  219. package/src/react/queries/listCollections.ts +7 -3
  220. package/src/react/queries/listTokenMetadata.ts +2 -2
  221. package/src/react/queries/marketplaceConfig.ts +1 -1
  222. package/src/react/queries/primarySaleItems.ts +85 -0
  223. package/src/react/queries/primarySaleItemsCount.ts +64 -0
  224. package/src/react/queries/tokenSupplies.ts +93 -0
  225. package/src/react/ui/components/_internals/action-button/ActionButton.tsx +66 -66
  226. package/src/react/ui/components/_internals/action-button/__tests__/ActionButtonBody.test.tsx +22 -4
  227. package/src/react/ui/components/_internals/action-button/components/ActionButtonBody.tsx +5 -4
  228. package/src/react/ui/components/_internals/action-button/components/NonOwnerActions.tsx +3 -0
  229. package/src/react/ui/components/_internals/action-button/components/OwnerActions.tsx +4 -4
  230. package/src/react/ui/components/_internals/action-button/hooks/useActionButtonLogic.ts +13 -8
  231. package/src/react/ui/components/_internals/action-button/store.ts +44 -34
  232. package/src/react/ui/components/_internals/custom-select/CustomSelect.stories.tsx +582 -0
  233. package/src/react/ui/components/_internals/pill/Pill.stories.tsx +83 -0
  234. package/src/react/ui/components/marketplace-collectible-card/Footer.tsx +11 -4
  235. package/src/react/ui/components/marketplace-collectible-card/components/ActionButtonWrapper.tsx +7 -4
  236. package/src/react/ui/components/marketplace-collectible-card/types.ts +4 -3
  237. package/src/react/ui/components/marketplace-collectible-card/utils/supplyStatus.ts +4 -7
  238. package/src/react/ui/components/marketplace-collectible-card/variants/ShopCard.tsx +5 -1
  239. package/src/react/ui/components/marketplace-logos/marketplace-logos.stories.tsx +199 -0
  240. package/src/react/ui/components/media/Media.stories.tsx +642 -0
  241. package/src/react/ui/components/media/Media.tsx +24 -19
  242. package/src/react/ui/components/media/types.ts +6 -0
  243. package/src/react/ui/modals/BuyModal/__tests__/BuyModalRouter.test.tsx +15 -0
  244. package/src/react/ui/modals/BuyModal/__tests__/ERC1155ShopModal.test.tsx +6 -0
  245. package/src/react/ui/modals/BuyModal/__tests__/Modal1155.test.tsx +7 -1
  246. package/src/react/ui/modals/BuyModal/__tests__/store.test.ts +9 -1
  247. package/src/react/ui/modals/BuyModal/components/ERC1155QuantityModal.tsx +15 -8
  248. package/src/react/ui/modals/BuyModal/components/ERC1155ShopModal.tsx +3 -0
  249. package/src/react/ui/modals/BuyModal/hooks/__tests__/useERC1155Checkout.test.tsx +30 -27
  250. package/src/react/ui/modals/BuyModal/hooks/useCheckoutOptions.ts +2 -2
  251. package/src/react/ui/modals/BuyModal/hooks/useERC1155Checkout.ts +11 -2
  252. package/src/react/ui/modals/BuyModal/hooks/useERC721SalePaymentParams.ts +1 -1
  253. package/src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts +7 -0
  254. package/src/react/ui/modals/BuyModal/index.tsx +9 -1
  255. package/src/react/ui/modals/BuyModal/store.ts +26 -0
  256. package/src/react/ui/modals/CreateListingModal/Modal.tsx +28 -11
  257. package/src/react/ui/modals/CreateListingModal/store.ts +3 -3
  258. package/src/react/ui/modals/MakeOfferModal/Modal.tsx +30 -13
  259. package/src/react/ui/modals/MakeOfferModal/store.ts +3 -3
  260. package/src/react/ui/modals/SellModal/Modal.tsx +11 -8
  261. package/src/react/ui/modals/SellModal/store.ts +3 -3
  262. package/src/react/ui/modals/TransferModal/__tests__/__snapshots__/store.test.ts.snap +17 -0
  263. package/src/react/ui/modals/TransferModal/__tests__/store.test.ts +366 -0
  264. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/__tests__/useHandleTransfer.test.tsx +402 -0
  265. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/_components/TokenQuantityInput.tsx +51 -48
  266. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/_components/TransferButton.tsx +39 -47
  267. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/_components/WalletAddressInput.tsx +9 -8
  268. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +31 -35
  269. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/useHandleTransfer.tsx +19 -10
  270. package/src/react/ui/modals/TransferModal/index.tsx +28 -31
  271. package/src/react/ui/modals/TransferModal/messages.ts +1 -1
  272. package/src/react/ui/modals/TransferModal/store.ts +122 -0
  273. package/src/react/ui/modals/_internal/components/calendar/index.tsx +0 -1
  274. package/src/react/ui/modals/_internal/components/currencyImage/index.tsx +10 -14
  275. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/__tests__/index.test.tsx +5 -2
  276. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +23 -17
  277. package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +10 -10
  278. package/src/react/ui/modals/_internal/components/floorPriceText/__tests__/FloorPriceText.test.tsx +6 -6
  279. package/src/react/ui/modals/_internal/components/priceInput/__tests__/PriceInput.test.tsx +13 -5
  280. package/src/react/ui/modals/_internal/components/priceInput/index.tsx +41 -26
  281. package/src/react/ui/modals/_internal/components/quantityInput/__tests__/index.test.tsx +68 -59
  282. package/src/react/ui/modals/_internal/components/quantityInput/index.tsx +155 -20
  283. package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/__tests__/SelectWaasFeeOptions.test.tsx +339 -40
  284. package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/index.tsx +95 -101
  285. package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/store.ts +72 -14
  286. package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/useWaasFeeOptionManager.tsx +29 -13
  287. package/src/react/ui/modals/_internal/components/tokenPreview/index.tsx +2 -2
  288. package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +2 -2
  289. package/src/react/ui/modals/_internal/components/transactionPreview/index.tsx +88 -89
  290. package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/TransactionStatusModal.test.tsx +36 -10
  291. package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +32 -20
  292. package/src/react/ui/modals/_internal/components/transactionStatusModal/store.ts +91 -62
  293. package/src/react/ui/modals/_internal/components/waasFeeOptionsSelect/WaasFeeOptionsSelect.tsx +43 -44
  294. package/src/react/ui/modals/_internal/types.ts +2 -2
  295. package/src/types/sdk-config.ts +6 -1
  296. package/src/utils/network.ts +15 -0
  297. package/test/test-utils.tsx +2 -0
  298. package/vitest.shims.d.ts +2 -0
  299. package/vitest.storybook.config.js +33 -0
  300. package/dist/CalendarIcon-DbQ7Vxcw.js.map +0 -1
  301. package/dist/_internal-BgWcRIak.js.map +0 -1
  302. package/dist/api-DTIan01C.js.map +0 -1
  303. package/dist/builder-api-C_zj5mr3.d.ts +0 -12
  304. package/dist/index-BUVWziLP.d.ts +0 -60
  305. package/dist/index-COt10OgI.d.ts +0 -24
  306. package/dist/index-DPNWNa7t.d.ts +0 -414
  307. package/dist/index-DsfCs3-x.d.ts +0 -122
  308. package/dist/index-dUb6wb4Y.d.ts +0 -22
  309. package/dist/marketplace.gen-BSDIX7NZ.js.map +0 -1
  310. package/dist/marketplaceConfig-C6X1SUik.js.map +0 -1
  311. package/dist/queries-CUU65uYZ.js.map +0 -1
  312. package/dist/react-DAIicQPT.js.map +0 -1
  313. package/dist/transaction-CcVViHEL.js.map +0 -1
  314. package/dist/utils-BPYfgDSL.js.map +0 -1
  315. package/dist/utils-CW2NA5KG.js.map +0 -1
  316. package/dist/wagmi-CDzEQbfk.js.map +0 -1
  317. package/src/react/hooks/__tests__/useGetTokenSuppliesMap.test.tsx +0 -104
  318. package/src/react/hooks/useGetTokenSuppliesMap.tsx +0 -73
  319. package/src/react/hooks/useListPrimarySaleItems.ts +0 -102
  320. package/src/react/queries/getTokenSuppliesMap.ts +0 -77
  321. package/src/react/ui/modals/TransferModal/_store.ts +0 -66
  322. package/src/react/ui/modals/_internal/components/quantityInput/QuantityInputBase.tsx +0 -166
  323. package/src/react/ui/modals/_internal/stores/accountModal.ts +0 -3
  324. /package/dist/{abi-BKyRjVcZ.js → abi-BMvgNbKQ.js} +0 -0
  325. /package/dist/{index-C39K_8SG.d.ts → index-CD2bj_xW.d.ts} +0 -0
  326. /package/dist/{options-B4QN7Xou.js → options-BBBR8u_4.js} +0 -0
@@ -4,7 +4,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
4
4
  import { TransactionType } from '../../../../../../_internal/types';
5
5
  import type { ShowTransactionStatusModalArgs } from '../index';
6
6
  import TransactionStatusModal from '../index';
7
- import { transactionStatusModal$ } from '../store';
7
+ import { transactionStatusModalStore } from '../store';
8
8
 
9
9
  const mockTransactionArgs: ShowTransactionStatusModalArgs = {
10
10
  hash: '0x123' as `0x${string}`,
@@ -26,7 +26,7 @@ describe('TransactionStatusModal', () => {
26
26
  });
27
27
 
28
28
  beforeEach(() => {
29
- transactionStatusModal$.close();
29
+ transactionStatusModalStore.send({ type: 'close' });
30
30
  vi.clearAllMocks();
31
31
  vi.mocked(useTransactionStatus).mockReturnValue('PENDING');
32
32
  });
@@ -40,7 +40,12 @@ describe('TransactionStatusModal', () => {
40
40
 
41
41
  it('should show processing state when transaction is processing', async () => {
42
42
  vi.mocked(useTransactionStatus).mockReturnValue('PENDING');
43
- transactionStatusModal$.open(mockTransactionArgs);
43
+ const { type: transactionType, ...rest } = mockTransactionArgs;
44
+ transactionStatusModalStore.send({
45
+ type: 'open',
46
+ transactionType,
47
+ ...rest,
48
+ });
44
49
  render(<TransactionStatusModal />);
45
50
 
46
51
  await waitFor(() => {
@@ -56,7 +61,12 @@ describe('TransactionStatusModal', () => {
56
61
 
57
62
  it('should show success state when transaction is successful', async () => {
58
63
  vi.mocked(useTransactionStatus).mockReturnValue('SUCCESS');
59
- transactionStatusModal$.open(mockTransactionArgs);
64
+ const { type: transactionType, ...rest } = mockTransactionArgs;
65
+ transactionStatusModalStore.send({
66
+ type: 'open',
67
+ transactionType,
68
+ ...rest,
69
+ });
60
70
  render(<TransactionStatusModal />);
61
71
 
62
72
  await waitFor(() => {
@@ -72,7 +82,12 @@ describe('TransactionStatusModal', () => {
72
82
 
73
83
  it('should show failed state when transaction fails', async () => {
74
84
  vi.mocked(useTransactionStatus).mockReturnValue('FAILED');
75
- transactionStatusModal$.open(mockTransactionArgs);
85
+ const { type: transactionType, ...rest } = mockTransactionArgs;
86
+ transactionStatusModalStore.send({
87
+ type: 'open',
88
+ transactionType,
89
+ ...rest,
90
+ });
76
91
  render(<TransactionStatusModal />);
77
92
 
78
93
  await waitFor(() => {
@@ -86,7 +101,12 @@ describe('TransactionStatusModal', () => {
86
101
 
87
102
  it('should show timeout state when transaction times out', async () => {
88
103
  vi.mocked(useTransactionStatus).mockReturnValue('TIMEOUT');
89
- transactionStatusModal$.open(mockTransactionArgs);
104
+ const { type: transactionType, ...rest } = mockTransactionArgs;
105
+ transactionStatusModalStore.send({
106
+ type: 'open',
107
+ transactionType,
108
+ ...rest,
109
+ });
90
110
  render(<TransactionStatusModal />);
91
111
 
92
112
  await waitFor(() => {
@@ -107,8 +127,11 @@ describe('TransactionStatusModal', () => {
107
127
  return 'SUCCESS';
108
128
  });
109
129
 
110
- transactionStatusModal$.open({
111
- ...mockTransactionArgs,
130
+ const { type: transactionType, ...rest } = mockTransactionArgs;
131
+ transactionStatusModalStore.send({
132
+ type: 'open',
133
+ transactionType,
134
+ ...rest,
112
135
  callbacks: { onSuccess },
113
136
  });
114
137
  render(<TransactionStatusModal />);
@@ -128,8 +151,11 @@ describe('TransactionStatusModal', () => {
128
151
  return 'FAILED';
129
152
  });
130
153
 
131
- transactionStatusModal$.open({
132
- ...mockTransactionArgs,
154
+ const { type: transactionType, ...rest } = mockTransactionArgs;
155
+ transactionStatusModalStore.send({
156
+ type: 'open',
157
+ transactionType,
158
+ ...rest,
133
159
  callbacks: { onError },
134
160
  });
135
161
  render(<TransactionStatusModal />);
@@ -2,20 +2,23 @@
2
2
 
3
3
  import { Modal, Skeleton, Text } from '@0xsequence/design-system';
4
4
  import type { ChainId } from '@0xsequence/network';
5
- import { use$ } from '@legendapp/state/react';
6
5
  import type { QueryKey } from '@tanstack/react-query';
7
- import type { Hex } from 'viem';
6
+ import type { Address, Hex } from 'viem';
8
7
  import type { Price } from '../../../../../../types';
9
8
  import { getQueryClient } from '../../../../../_internal';
10
9
  import type { TransactionType } from '../../../../../_internal/types';
11
10
  import { useCollectible } from '../../../../../hooks';
12
11
  import type { ModalCallbacks } from '../../types';
13
12
  import { MODAL_OVERLAY_PROPS } from '../consts';
14
- import { selectWaasFeeOptions$ } from '../selectWaasFeeOptions/store';
13
+ import { selectWaasFeeOptionsStore } from '../selectWaasFeeOptions/store';
15
14
  import TransactionFooter from '../transaction-footer';
16
15
  import TransactionPreview from '../transactionPreview';
17
16
  import useTransactionStatus from './hooks/useTransactionStatus';
18
- import { transactionStatusModal$ } from './store';
17
+ import {
18
+ transactionStatusModalStore,
19
+ useIsOpen,
20
+ useTransactionModalState,
21
+ } from './store';
19
22
  import { getTransactionStatusModalMessage } from './util/getMessage';
20
23
  import { getTransactionStatusModalTitle } from './util/getTitle';
21
24
 
@@ -23,7 +26,7 @@ export type ShowTransactionStatusModalArgs = {
23
26
  hash?: Hex;
24
27
  orderId?: string;
25
28
  price?: Price;
26
- collectionAddress: Hex;
29
+ collectionAddress: Address;
27
30
  chainId: number;
28
31
  collectibleId: string;
29
32
  type: TransactionType;
@@ -46,20 +49,27 @@ const invalidateQueries = async (queriesToInvalidate?: QueryKey[]) => {
46
49
  export const useTransactionStatusModal = () => {
47
50
  return {
48
51
  show: (args: ShowTransactionStatusModalArgs) => {
49
- transactionStatusModal$.open(args);
52
+ const { type: transactionType, ...rest } = args;
53
+ transactionStatusModalStore.send({
54
+ type: 'open',
55
+ transactionType,
56
+ ...rest,
57
+ });
58
+ },
59
+ close: () => {
60
+ transactionStatusModalStore.send({ type: 'close' });
50
61
  },
51
- close: () => transactionStatusModal$.close(),
52
62
  };
53
63
  };
54
64
 
55
65
  const TransactionStatusModal = () => {
56
- const isOpen = use$(transactionStatusModal$.isOpen);
66
+ const isOpen = useIsOpen();
57
67
  return isOpen ? <TransactionStatusModalContent /> : null;
58
68
  };
59
69
 
60
70
  function TransactionStatusModalContent() {
61
71
  const {
62
- type,
72
+ transactionType: type,
63
73
  hash,
64
74
  orderId,
65
75
  price,
@@ -68,7 +78,7 @@ function TransactionStatusModalContent() {
68
78
  collectibleId,
69
79
  callbacks,
70
80
  queriesToInvalidate,
71
- } = use$(transactionStatusModal$.state);
81
+ } = useTransactionModalState();
72
82
 
73
83
  const { data: collectible, isLoading: collectibleLoading } = useCollectible({
74
84
  collectionAddress,
@@ -84,21 +94,23 @@ function TransactionStatusModalContent() {
84
94
  orderId,
85
95
  });
86
96
 
87
- const message = getTransactionStatusModalMessage({
88
- transactionStatus,
89
- transactionType: type,
90
- collectibleName: collectible?.name || '',
91
- orderId,
92
- price,
93
- });
97
+ const message = type
98
+ ? getTransactionStatusModalMessage({
99
+ transactionStatus,
100
+ transactionType: type,
101
+ collectibleName: collectible?.name || '',
102
+ orderId,
103
+ price,
104
+ })
105
+ : '';
94
106
 
95
107
  const handleClose = () => {
96
108
  invalidateQueries(queriesToInvalidate);
97
- if (selectWaasFeeOptions$.isVisible.get()) {
98
- selectWaasFeeOptions$.hide();
109
+ if (selectWaasFeeOptionsStore.getSnapshot().context.isVisible) {
110
+ selectWaasFeeOptionsStore.send({ type: 'hide' });
99
111
  }
100
112
 
101
- transactionStatusModal$.close();
113
+ transactionStatusModalStore.send({ type: 'close' });
102
114
  };
103
115
 
104
116
  return (
@@ -1,6 +1,7 @@
1
- import { observable } from '@legendapp/state';
2
1
  import type { QueryKey } from '@tanstack/react-query';
3
- import type { Hex } from 'viem';
2
+ import { createStore } from '@xstate/store';
3
+ import { useSelector } from '@xstate/store/react';
4
+ import type { Address, Hex } from 'viem';
4
5
  import type { Price } from '../../../../../../types';
5
6
  import type { TransactionType } from '../../../../../_internal/types';
6
7
  import type { ModalCallbacks } from '../../types';
@@ -15,69 +16,97 @@ export type ConfirmationStatus = {
15
16
 
16
17
  export type TransactionStatus = 'PENDING' | 'SUCCESS' | 'FAILED' | 'TIMEOUT';
17
18
 
18
- export interface TransactionStatusModalState {
19
+ interface TransactionStatusModalContext {
19
20
  isOpen: boolean;
20
- open: (args: ShowTransactionStatusModalArgs) => void;
21
- close: () => void;
22
- state: {
23
- hash: Hex | undefined;
24
- orderId: string | undefined;
25
- status: TransactionStatus;
26
- type: TransactionType;
27
- price: Price | undefined;
28
- collectionAddress: Hex;
29
- chainId: number;
30
- collectibleId: string;
31
- callbacks?: ModalCallbacks;
32
- queriesToInvalidate?: QueryKey[];
33
- };
21
+ hash: Hex | undefined;
22
+ orderId: string | undefined;
23
+ status: TransactionStatus;
24
+ transactionType: TransactionType | undefined;
25
+ price: Price | undefined;
26
+ collectionAddress: Address;
27
+ chainId: number;
28
+ collectibleId: string;
29
+ callbacks?: ModalCallbacks;
30
+ queriesToInvalidate?: QueryKey[];
34
31
  }
35
32
 
36
- export const initialState: TransactionStatusModalState = {
33
+ const initialContext: TransactionStatusModalContext = {
37
34
  isOpen: false,
38
- open: ({
39
- hash,
40
- orderId,
41
- price,
42
- collectionAddress,
43
- chainId,
44
- collectibleId,
45
- type,
46
- callbacks,
47
- queriesToInvalidate,
48
- }) => {
49
- transactionStatusModal$.state.set({
50
- ...transactionStatusModal$.state.get(),
51
- hash,
52
- orderId,
53
- price,
54
- collectionAddress,
55
- chainId,
56
- collectibleId,
57
- type,
58
- callbacks,
59
- queriesToInvalidate,
60
- });
61
- transactionStatusModal$.isOpen.set(true);
62
- },
63
- close: () => {
64
- transactionStatusModal$.isOpen.set(false);
65
- transactionStatusModal$.state.set({
66
- ...initialState.state,
67
- });
68
- },
69
- state: {
70
- hash: undefined,
71
- orderId: undefined,
72
- status: 'PENDING',
73
- price: undefined,
74
- collectionAddress: '' as Hex,
75
- chainId: 0,
76
- collectibleId: '',
77
- type: undefined as unknown as TransactionType,
78
- callbacks: undefined,
79
- queriesToInvalidate: [],
80
- },
35
+ hash: undefined,
36
+ orderId: undefined,
37
+ status: 'PENDING',
38
+ transactionType: undefined,
39
+ price: undefined,
40
+ collectionAddress: '' as Address,
41
+ chainId: 0,
42
+ collectibleId: '',
43
+ callbacks: undefined,
44
+ queriesToInvalidate: [],
81
45
  };
82
46
 
83
- export const transactionStatusModal$ = observable(initialState);
47
+ export const transactionStatusModalStore = createStore({
48
+ context: initialContext,
49
+ on: {
50
+ open: (
51
+ context,
52
+ event: Omit<ShowTransactionStatusModalArgs, 'type'> & {
53
+ transactionType: TransactionType;
54
+ },
55
+ ) => ({
56
+ ...context,
57
+ isOpen: true,
58
+ hash: event.hash,
59
+ orderId: event.orderId,
60
+ price: event.price,
61
+ collectionAddress: event.collectionAddress,
62
+ chainId: event.chainId,
63
+ collectibleId: event.collectibleId,
64
+ transactionType: event.transactionType,
65
+ callbacks: event.callbacks,
66
+ queriesToInvalidate: event.queriesToInvalidate,
67
+ status: 'PENDING' as TransactionStatus,
68
+ }),
69
+
70
+ close: () => ({
71
+ ...initialContext,
72
+ }),
73
+
74
+ updateStatus: (context, event: { status: TransactionStatus }) => ({
75
+ ...context,
76
+ status: event.status,
77
+ }),
78
+ },
79
+ });
80
+
81
+ // Selector hooks
82
+ export const useIsOpen = () =>
83
+ useSelector(transactionStatusModalStore, (state) => state.context.isOpen);
84
+
85
+ export const useTransactionModalState = () =>
86
+ useSelector(transactionStatusModalStore, (state) => state.context);
87
+
88
+ export const useTransactionHash = () =>
89
+ useSelector(transactionStatusModalStore, (state) => state.context.hash);
90
+
91
+ export const useTransactionType = () =>
92
+ useSelector(
93
+ transactionStatusModalStore,
94
+ (state) => state.context.transactionType,
95
+ );
96
+
97
+ export const useTransactionDetails = () =>
98
+ useSelector(transactionStatusModalStore, (state) => ({
99
+ hash: state.context.hash,
100
+ orderId: state.context.orderId,
101
+ transactionType: state.context.transactionType,
102
+ status: state.context.status,
103
+ chainId: state.context.chainId,
104
+ }));
105
+
106
+ export const useCollectibleInfo = () =>
107
+ useSelector(transactionStatusModalStore, (state) => ({
108
+ collectionAddress: state.context.collectionAddress,
109
+ collectibleId: state.context.collectibleId,
110
+ chainId: state.context.chainId,
111
+ price: state.context.price,
112
+ }));
@@ -1,61 +1,60 @@
1
1
  'use client';
2
2
 
3
3
  import { Image, Select, Text } from '@0xsequence/design-system';
4
- import type { Observable } from '@legendapp/state';
5
- import { observer } from '@legendapp/state/react';
6
4
  import { useEffect } from 'react';
7
5
  import { formatUnits, zeroAddress } from 'viem';
8
6
  import type { FeeOption } from '../../../../../../types/waas-types';
9
7
  import type { SelectItem } from '../../../../components/_internals/custom-select/CustomSelect';
10
8
 
11
- const WaasFeeOptionsSelect = observer(
12
- ({
13
- options,
14
- selectedFeeOption$,
15
- }: {
16
- options: FeeOption[];
17
- selectedFeeOption$: Observable<FeeOption | undefined>;
18
- }) => {
19
- options = options.map((option) => ({
20
- ...option,
21
- token: {
22
- ...option.token,
23
- contractAddress: option.token.contractAddress || zeroAddress,
24
- },
25
- }));
9
+ const WaasFeeOptionsSelect = ({
10
+ options,
11
+ selectedFeeOption,
12
+ onSelectedFeeOptionChange,
13
+ }: {
14
+ options: FeeOption[];
15
+ selectedFeeOption: FeeOption | undefined;
16
+ onSelectedFeeOptionChange: (option: FeeOption | undefined) => void;
17
+ }) => {
18
+ options = options.map((option) => ({
19
+ ...option,
20
+ token: {
21
+ ...option.token,
22
+ contractAddress: option.token.contractAddress || zeroAddress,
23
+ },
24
+ }));
26
25
 
27
- const feeOptions = options.map((option) => {
28
- const value = option.token.contractAddress ?? '';
26
+ const feeOptions = options.map((option) => {
27
+ const value = option.token.contractAddress ?? '';
29
28
 
30
- return FeeOptionSelectItem({ value, option });
31
- });
29
+ return FeeOptionSelectItem({ value, option });
30
+ });
32
31
 
33
- useEffect(() => {
34
- if (options.length > 0 && !selectedFeeOption$.get())
35
- selectedFeeOption$.set(options[0]);
36
- }, [options]);
32
+ useEffect(() => {
33
+ if (options.length > 0 && !selectedFeeOption) {
34
+ onSelectedFeeOptionChange(options[0]);
35
+ }
36
+ }, [options, selectedFeeOption, onSelectedFeeOptionChange]);
37
37
 
38
- if (options.length === 0 || !selectedFeeOption$.get()?.token) return null;
38
+ if (options.length === 0 || !selectedFeeOption?.token) return null;
39
39
 
40
- return (
41
- <Select
42
- name="fee-option"
43
- options={feeOptions.map((option) => ({
44
- label: option.content,
45
- value: option.value,
46
- }))}
47
- onValueChange={(value) => {
48
- const selectedOption = options.find(
49
- (option) => option.token.contractAddress === value,
50
- );
40
+ return (
41
+ <Select
42
+ name="fee-option"
43
+ options={feeOptions.map((option) => ({
44
+ label: option.content,
45
+ value: option.value,
46
+ }))}
47
+ onValueChange={(value) => {
48
+ const selectedOption = options.find(
49
+ (option) => option.token.contractAddress === value,
50
+ );
51
51
 
52
- selectedFeeOption$.set(selectedOption);
53
- }}
54
- defaultValue={options[0].token.contractAddress ?? undefined}
55
- />
56
- );
57
- },
58
- );
52
+ onSelectedFeeOptionChange(selectedOption);
53
+ }}
54
+ defaultValue={options[0].token.contractAddress ?? undefined}
55
+ />
56
+ );
57
+ };
59
58
 
60
59
  function FeeOptionSelectItem({
61
60
  value,
@@ -1,4 +1,4 @@
1
- import type { Hash, Hex } from 'viem';
1
+ import type { Address, Hash } from 'viem';
2
2
 
3
3
  export type ModalCallbacks = {
4
4
  onSuccess?: ({ hash, orderId }: { hash?: Hash; orderId?: string }) => void;
@@ -9,6 +9,6 @@ export type ModalCallbacks = {
9
9
  export type BaseModalState = {
10
10
  isOpen: boolean;
11
11
  chainId: number;
12
- collectionAddress: Hex;
12
+ collectionAddress: Address;
13
13
  callbacks?: ModalCallbacks;
14
14
  };
@@ -1,4 +1,5 @@
1
1
  import type { LookupMarketplaceReturn } from '../react/_internal/api/builder.gen';
2
+ import type { DatabeatAnalytics } from '../react/_internal/databeat';
2
3
  import type { MarketplaceConfig } from './types';
3
4
 
4
5
  export type Env = 'development' | 'production' | 'next';
@@ -17,7 +18,6 @@ export type SdkConfig = {
17
18
  prefetchedMarketplaceSettings?: LookupMarketplaceReturn;
18
19
  overrides?: {
19
20
  marketplaceConfig?: Partial<MarketplaceConfig>;
20
-
21
21
  api?: {
22
22
  builder?: ApiConfig;
23
23
  marketplace?: ApiConfig;
@@ -30,3 +30,8 @@ export type SdkConfig = {
30
30
  };
31
31
  };
32
32
  };
33
+
34
+ export type MarketplaceSdkContext = {
35
+ openConnectModal: () => void;
36
+ analytics: DatabeatAnalytics;
37
+ } & SdkConfig;
@@ -1,4 +1,19 @@
1
1
  import { networks } from '@0xsequence/network';
2
+ import { MissingConfigError } from './_internal/error/transaction';
3
+
4
+ type ChainNameOrId = string | number;
5
+
6
+ export const getNetwork = (nameOrId: ChainNameOrId) => {
7
+ for (const network of Object.values(networks)) {
8
+ if (
9
+ network.name === String(nameOrId).toLowerCase() ||
10
+ network.chainId === Number(nameOrId)
11
+ ) {
12
+ return network;
13
+ }
14
+ }
15
+ throw new MissingConfigError(`Network configuration for chain ${nameOrId}`);
16
+ };
2
17
 
3
18
  export const getPresentableChainName = (chainId: number) => {
4
19
  return networks[chainId as keyof typeof networks]?.title ?? 'Unknown Network';
@@ -20,6 +20,7 @@ import { type Config, createConfig, http, WagmiProvider } from 'wagmi';
20
20
  import { mock } from 'wagmi/connectors';
21
21
  import { handlers as marketplaceConfigHandlers } from '../src/react/_internal/api/__mocks__/builder.msw';
22
22
  import { handlers as indexerHandlers } from '../src/react/_internal/api/__mocks__/indexer.msw';
23
+ import { laosHandlers } from '../src/react/_internal/api/__mocks__/laos.msw';
23
24
  import { handlers as marketplaceHandlers } from '../src/react/_internal/api/__mocks__/marketplace.msw';
24
25
  import { handlers as metadataHandlers } from '../src/react/_internal/api/__mocks__/metadata.msw';
25
26
  import { TEST_ACCOUNTS, TEST_CHAIN, TEST_PRIVATE_KEYS } from './const';
@@ -36,6 +37,7 @@ export const server = setupServer(
36
37
  ...metadataHandlers,
37
38
  ...indexerHandlers,
38
39
  ...marketplaceConfigHandlers,
40
+ ...laosHandlers,
39
41
  tickHandler,
40
42
  );
41
43
 
@@ -0,0 +1,2 @@
1
+ /// <reference types="@vitest/browser/providers/playwright" />
2
+
@@ -0,0 +1,33 @@
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
4
+ import tsconfigPaths from 'vite-tsconfig-paths';
5
+ import { defineConfig } from 'vitest/config';
6
+
7
+ const dirname =
8
+ typeof __dirname !== 'undefined'
9
+ ? __dirname
10
+ : path.dirname(fileURLToPath(import.meta.url));
11
+
12
+ export default defineConfig({
13
+ plugins: [
14
+ tsconfigPaths(),
15
+ storybookTest({
16
+ configDir: path.join(dirname, '.storybook'),
17
+ }),
18
+ ],
19
+ test: {
20
+ name: 'storybook',
21
+ browser: {
22
+ enabled: true,
23
+ headless: true,
24
+ provider: 'playwright',
25
+ instances: [
26
+ {
27
+ browser: 'chromium',
28
+ },
29
+ ],
30
+ },
31
+ setupFiles: ['.storybook/vitest.setup.ts'],
32
+ },
33
+ });
@@ -1 +0,0 @@
1
- {"version":3,"file":"CalendarIcon-DbQ7Vxcw.js","names":["Svg","props: SVGProps<SVGSVGElement>","Svg","props: SVGProps<SVGSVGElement>","Svg","props: SVGProps<SVGSVGElement>","props: SVGProps<SVGSVGElement>"],"sources":["../src/react/ui/icons/iconVariants.ts","../src/react/ui/icons/InfoIcon.tsx","../src/react/ui/icons/CartIcon.tsx","../src/react/ui/icons/BellIcon.tsx","../src/react/ui/icons/CalendarIcon.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const iconVariants = cva('block shrink-0', {\n\tvariants: {\n\t\tsize: {\n\t\t\txs: 'w-4 h-4',\n\t\t\tsm: 'w-5 h-5',\n\t\t\tmd: 'w-6 h-6',\n\t\t\tlg: 'w-7 h-7',\n\t\t\txl: 'w-9 h-9',\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tsize: 'md',\n\t},\n});\n","'use client';\nimport type { IconProps } from '@0xsequence/design-system';\nimport type { SVGProps } from 'react';\nimport { cn } from '../../../utils';\nimport { iconVariants } from './iconVariants';\n\nconst Svg = (props: SVGProps<SVGSVGElement>) => (\n\t<svg\n\t\tclassName=\"h-20 w-20\"\n\t\tviewBox=\"0 0 20 20\"\n\t\tfill=\"none\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\trole=\"img\"\n\t\taria-label=\"Information\"\n\t\t{...props}\n\t>\n\t\t<title>Information icon</title>\n\t\t<path d=\"M10.75 8.75V13.75H9.25V8.75H10.75Z\" fill=\"white\" />\n\t\t<path\n\t\t\td=\"M9.37508 7.47656C9.55997 7.65885 9.78263 7.75 10.043 7.75C10.2097 7.75 10.3634 7.70833 10.504 7.625C10.6446 7.53906 10.7579 7.42578 10.8438 7.28516C10.9324 7.14193 10.9779 6.98438 10.9805 6.8125C10.9779 6.55729 10.8829 6.33854 10.6954 6.15625C10.5079 5.97396 10.2904 5.88281 10.043 5.88281C9.78263 5.88281 9.55997 5.97396 9.37508 6.15625C9.19279 6.33854 9.10294 6.55729 9.10555 6.8125C9.10294 7.07031 9.19279 7.29167 9.37508 7.47656Z\"\n\t\t\tfill=\"white\"\n\t\t/>\n\t\t<path\n\t\t\tfillRule=\"evenodd\"\n\t\t\tclipRule=\"evenodd\"\n\t\t\td=\"M10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 14.4183 5.58172 18 10 18ZM10 16.5C13.5899 16.5 16.5 13.5899 16.5 10C16.5 6.41015 13.5899 3.5 10 3.5C6.41015 3.5 3.5 6.41015 3.5 10C3.5 13.5899 6.41015 16.5 10 16.5Z\"\n\t\t\tfill=\"white\"\n\t\t/>\n\t</svg>\n);\n\nconst SvgInfoIcon = ({ className, size = 'sm', ...props }: IconProps) => (\n\t<Svg\n\t\tclassName={cn(\n\t\t\ticonVariants({\n\t\t\t\tsize,\n\t\t\t}),\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nexport default SvgInfoIcon;\n","'use client';\n\nimport type { IconProps } from '@0xsequence/design-system';\nimport type { SVGProps } from 'react';\nimport { cn } from '../../../utils';\nimport { iconVariants } from './iconVariants';\n\nconst Svg = (props: SVGProps<SVGSVGElement>) => (\n\t<svg\n\t\tclassName=\"h-20 w-20\"\n\t\tviewBox=\"0 0 20 20\"\n\t\tfill=\"none\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\trole=\"img\"\n\t\taria-labelledby=\"cart-title\"\n\t\t{...props}\n\t>\n\t\t<title id=\"cart-title\">Cart Icon</title>\n\t\t<path\n\t\t\tfillRule=\"evenodd\"\n\t\t\tclipRule=\"evenodd\"\n\t\t\td=\"M2.5 3.46836C2.5 3.20969 2.72366 3 2.99955 3H5.16925C5.88938 3 6.5077 3.48022 6.64172 4.14359L8.33188 12.5093C8.37655 12.7304 8.58266 12.8905 8.8227 12.8905H16.987C17.2629 12.8905 17.4866 13.1002 17.4866 13.3589C17.4866 13.6175 17.2629 13.8272 16.987 13.8272H8.8227C8.10257 13.8272 7.48425 13.347 7.35023 12.6836L5.66007 4.31793C5.6154 4.0968 5.40929 3.93673 5.16925 3.93673H2.99955C2.72366 3.93673 2.5 3.72704 2.5 3.46836Z\"\n\t\t\tfill=\"white\"\n\t\t/>\n\t\t<path\n\t\t\td=\"M18.0003 5.34182H6.40946L7.49564 10.8234H17.0736C17.3133 10.8234 17.5193 10.6637 17.5643 10.443L18.491 5.89813C18.5498 5.60942 18.3138 5.34182 18.0003 5.34182Z\"\n\t\t\tfill=\"white\"\n\t\t/>\n\t\t<path\n\t\t\td=\"M10.0889 15.8559C10.0889 16.4878 9.54259 17 8.86866 17C8.19473 17 7.64841 16.4878 7.64841 15.8559C7.64841 15.2241 8.19473 14.7119 8.86866 14.7119C9.54259 14.7119 10.0889 15.2241 10.0889 15.8559Z\"\n\t\t\tfill=\"white\"\n\t\t/>\n\t\t<path\n\t\t\td=\"M16.6268 15.8559C16.6268 16.4878 16.0804 17 15.4065 17C14.7326 17 14.1863 16.4878 14.1863 15.8559C14.1863 15.2241 14.7326 14.7119 15.4065 14.7119C16.0804 14.7119 16.6268 15.2241 16.6268 15.8559Z\"\n\t\t\tfill=\"white\"\n\t\t/>\n\t</svg>\n);\n\nconst SvgCartIcon = ({ className, size = 'sm', ...props }: IconProps) => (\n\t<Svg\n\t\tclassName={cn(\n\t\t\ticonVariants({\n\t\t\t\tsize,\n\t\t\t}),\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nexport default SvgCartIcon;\n","'use client';\n\nimport type { IconProps } from '@0xsequence/design-system';\nimport type { SVGProps } from 'react';\nimport { cn } from '../../../utils';\nimport { iconVariants } from './iconVariants';\n\nconst Svg = (props: SVGProps<SVGSVGElement>) => (\n\t<svg\n\t\tclassName=\"h-17 w-17\"\n\t\tviewBox=\"0 0 17 17\"\n\t\tfill=\"none\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\trole=\"img\"\n\t\taria-labelledby=\"bell-title\"\n\t\t{...props}\n\t>\n\t\t<title id=\"bell-title\">Notification Bell</title>\n\t\t<path\n\t\t\tfillRule=\"evenodd\"\n\t\t\tclipRule=\"evenodd\"\n\t\t\td=\"M12.3127 7.45705V9.74274C12.3127 10.3805 12.6293 10.6971 12.9647 11.0326L12.9652 11.033L12.9679 11.0358C13.3205 11.3893 13.6843 11.754 13.6843 12.4854C13.6843 12.5491 13.6335 12.5998 13.57 12.5998H3.51277C3.44959 12.5998 3.39844 12.5489 3.39844 12.4854C3.39844 11.7539 3.76242 11.389 4.11507 11.0354L4.11754 11.033C4.45305 10.6975 4.76984 10.3807 4.76984 9.74245V7.45676C4.76984 5.6932 5.98854 4.21248 7.62704 3.802V3.11399C7.62704 2.60926 8.03659 2.19971 8.54132 2.19971C9.04606 2.19971 9.45561 2.60926 9.45561 3.11399V3.802C11.094 4.21286 12.3127 5.69335 12.3127 7.45705ZM10.3698 13.1711C10.3698 14.1809 9.55099 14.9997 8.54121 14.9997C7.53128 14.9997 6.71272 14.181 6.71272 13.1711H10.3698ZM8.758 7.70501C9.30005 7.85574 9.6696 7.99832 9.86302 8.13224C10.1776 8.35015 10.3374 8.67657 10.338 9.106C10.338 9.7284 10.1359 10.1706 9.72956 10.4326C9.50571 10.5778 9.18295 10.6723 8.75846 10.7195V11.4005H8.42657V10.7195C7.74604 10.6746 7.28244 10.4349 7.04094 9.99812C6.90703 9.76157 6.83984 9.44246 6.83984 9.04019H7.46277C7.48004 9.35983 7.53041 9.59501 7.6135 9.74163C7.75837 10.0063 8.0303 10.1548 8.42664 10.1861V8.27703C7.9177 8.18078 7.54357 8.01963 7.30116 7.79532C7.0605 7.57102 6.93929 7.25914 6.93929 6.86234C6.93929 6.50686 7.06917 6.18768 7.32977 5.90212C7.58991 5.61657 7.95581 5.47132 8.42619 5.46675V5.00049H8.75808V5.45861C9.22343 5.4927 9.58119 5.62981 9.82863 5.87039C10.0787 6.11144 10.2086 6.43062 10.2204 6.82651H9.60569C9.5907 6.64899 9.54299 6.49507 9.4631 6.36884C9.31595 6.13183 9.08076 6.00697 8.758 5.99518V7.70501ZM7.80143 7.36315C7.95574 7.49478 8.16369 7.58608 8.42611 7.63691L8.42619 5.98886C8.11651 5.99936 7.89723 6.09424 7.76651 6.2681C7.63572 6.4447 7.57036 6.62815 7.57036 6.82019C7.57036 7.05081 7.64705 7.23289 7.80143 7.36315ZM8.75747 10.2033C9.15883 10.1847 9.43305 10.0394 9.58606 9.76522C9.66504 9.62408 9.70415 9.46285 9.70399 9.27948C9.70399 8.98624 9.59686 8.76376 9.38123 8.61121C9.2582 8.52219 9.05079 8.4391 8.75747 8.35921V10.2033Z\"\n\t\t\tfill=\"white\"\n\t\t/>\n\t</svg>\n);\n\nconst SvgBellIcon = ({ className, size = 'sm', ...props }: IconProps) => (\n\t<Svg\n\t\tclassName={cn(\n\t\t\ticonVariants({\n\t\t\t\tsize,\n\t\t\t}),\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nexport default SvgBellIcon;\n","'use client';\nimport type { IconProps } from '@0xsequence/design-system';\nimport type { SVGProps } from 'react';\nimport { cn } from '../../../utils';\nimport { iconVariants } from './iconVariants';\n\nconst Svg = (props: SVGProps<SVGSVGElement>) => (\n\t<svg\n\t\tclassName=\"h-20 w-20\"\n\t\tviewBox=\"0 0 20 20\"\n\t\tfill=\"none\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\trole=\"img\"\n\t\taria-label=\"Calendar icon\"\n\t\t{...props}\n\t>\n\t\t<title>Calendar icon</title>\n\t\t<path\n\t\t\td=\"M4.57634 17.5C3.73146 17.5 3.08946 17.2816 2.65034 16.8449C2.21678 16.4081 2 15.7586 2 14.8965V5.10352C2 4.24135 2.21678 3.59189 2.65034 3.15513C3.08946 2.71838 3.73146 2.5 4.57634 2.5H15.4237C16.2741 2.5 16.9161 2.72121 17.3497 3.16364C17.7832 3.6004 18 4.24702 18 5.10352V14.8965C18 15.753 17.7832 16.3996 17.3497 16.8364C16.9161 17.2788 16.2741 17.5 15.4237 17.5H4.57634ZM4.55133 15.9515H15.4403C15.7738 15.9515 16.0295 15.8636 16.2074 15.6877C16.3908 15.5062 16.4825 15.2396 16.4825 14.888V7.44328C16.4825 7.08593 16.3908 6.81934 16.2074 6.64351C16.0295 6.46767 15.7738 6.37975 15.4403 6.37975H4.55133C4.21782 6.37975 3.96213 6.46767 3.78426 6.64351C3.61195 6.81934 3.52579 7.08593 3.52579 7.44328V14.888C3.52579 15.2396 3.61195 15.5062 3.78426 15.6877C3.96213 15.8636 4.21782 15.9515 4.55133 15.9515ZM8.48671 9.17896C8.34775 9.17896 8.25048 9.15343 8.19489 9.10238C8.13931 9.05133 8.11152 8.95207 8.11152 8.80459V8.33664C8.11152 8.19484 8.13931 8.09841 8.19489 8.04736C8.25048 7.99064 8.34775 7.96228 8.48671 7.96228H8.94528C9.0898 7.96228 9.18708 7.99064 9.2371 8.04736C9.29269 8.09841 9.32048 8.19484 9.32048 8.33664V8.80459C9.32048 8.95207 9.29269 9.05133 9.2371 9.10238C9.18708 9.15343 9.0898 9.17896 8.94528 9.17896H8.48671ZM11.0714 9.17896C10.9269 9.17896 10.8268 9.15343 10.7712 9.10238C10.7212 9.05133 10.6962 8.95207 10.6962 8.80459V8.33664C10.6962 8.19484 10.7212 8.09841 10.7712 8.04736C10.8268 7.99064 10.9269 7.96228 11.0714 7.96228H11.5383C11.6773 7.96228 11.7745 7.99064 11.8301 8.04736C11.8857 8.09841 11.9135 8.19484 11.9135 8.33664V8.80459C11.9135 8.95207 11.8857 9.05133 11.8301 9.10238C11.7745 9.15343 11.6773 9.17896 11.5383 9.17896H11.0714ZM13.6477 9.17896C13.5088 9.17896 13.4115 9.15343 13.3559 9.10238C13.3003 9.05133 13.2725 8.95207 13.2725 8.80459V8.33664C13.2725 8.19484 13.3003 8.09841 13.3559 8.04736C13.4115 7.99064 13.5088 7.96228 13.6477 7.96228H14.1146C14.2592 7.96228 14.3564 7.99064 14.4065 8.04736C14.462 8.09841 14.4898 8.19484 14.4898 8.33664V8.80459C14.4898 8.95207 14.462 9.05133 14.4065 9.10238C14.3564 9.15343 14.2592 9.17896 14.1146 9.17896H13.6477ZM5.90203 11.7825C5.75751 11.7825 5.65746 11.7541 5.60188 11.6974C5.55185 11.6407 5.52684 11.5442 5.52684 11.4081V10.9317C5.52684 10.7842 5.55185 10.6849 5.60188 10.6339C5.65746 10.5828 5.75751 10.5573 5.90203 10.5573H6.36894C6.5079 10.5573 6.60518 10.5828 6.66076 10.6339C6.71635 10.6849 6.74414 10.7842 6.74414 10.9317V11.4081C6.74414 11.5442 6.71635 11.6407 6.66076 11.6974C6.60518 11.7541 6.5079 11.7825 6.36894 11.7825H5.90203ZM8.48671 11.7825C8.34775 11.7825 8.25048 11.7541 8.19489 11.6974C8.13931 11.6407 8.11152 11.5442 8.11152 11.4081V10.9317C8.11152 10.7842 8.13931 10.6849 8.19489 10.6339C8.25048 10.5828 8.34775 10.5573 8.48671 10.5573H8.94528C9.0898 10.5573 9.18708 10.5828 9.2371 10.6339C9.29269 10.6849 9.32048 10.7842 9.32048 10.9317V11.4081C9.32048 11.5442 9.29269 11.6407 9.2371 11.6974C9.18708 11.7541 9.0898 11.7825 8.94528 11.7825H8.48671ZM11.0714 11.7825C10.9269 11.7825 10.8268 11.7541 10.7712 11.6974C10.7212 11.6407 10.6962 11.5442 10.6962 11.4081V10.9317C10.6962 10.7842 10.7212 10.6849 10.7712 10.6339C10.8268 10.5828 10.9269 10.5573 11.0714 10.5573H11.5383C11.6773 10.5573 11.7745 10.5828 11.8301 10.6339C11.8857 10.6849 11.9135 10.7842 11.9135 10.9317V11.4081C11.9135 11.5442 11.8857 11.6407 11.8301 11.6974C11.7745 11.7541 11.6773 11.7825 11.5383 11.7825H11.0714ZM13.6477 11.7825C13.5088 11.7825 13.4115 11.7541 13.3559 11.6974C13.3003 11.6407 13.2725 11.5442 13.2725 11.4081V10.9317C13.2725 10.7842 13.3003 10.6849 13.3559 10.6339C13.4115 10.5828 13.5088 10.5573 13.6477 10.5573H14.1146C14.2592 10.5573 14.3564 10.5828 14.4065 10.6339C14.462 10.6849 14.4898 10.7842 14.4898 10.9317V11.4081C14.4898 11.5442 14.462 11.6407 14.4065 11.6974C14.3564 11.7541 14.2592 11.7825 14.1146 11.7825H13.6477ZM5.90203 14.369C5.75751 14.369 5.65746 14.3434 5.60188 14.2924C5.55185 14.2414 5.52684 14.1421 5.52684 13.9946V13.5267C5.52684 13.3849 5.55185 13.2884 5.60188 13.2374C5.65746 13.1807 5.75751 13.1523 5.90203 13.1523H6.36894C6.5079 13.1523 6.60518 13.1807 6.66076 13.2374C6.71635 13.2884 6.74414 13.3849 6.74414 13.5267V13.9946C6.74414 14.1421 6.71635 14.2414 6.66076 14.2924C6.60518 14.3434 6.5079 14.369 6.36894 14.369H5.90203ZM8.48671 14.369C8.34775 14.369 8.25048 14.3434 8.19489 14.2924C8.13931 14.2414 8.11152 14.1421 8.11152 13.9946V13.5267C8.11152 13.3849 8.13931 13.2884 8.19489 13.2374C8.25048 13.1807 8.34775 13.1523 8.48671 13.1523H8.94528C9.0898 13.1523 9.18708 13.1807 9.2371 13.2374C9.29269 13.2884 9.32048 13.3849 9.32048 13.5267V13.9946C9.32048 14.1421 9.29269 14.2414 9.2371 14.2924C9.18708 14.3434 9.0898 14.369 8.94528 14.369H8.48671ZM11.0714 14.369C10.9269 14.369 10.8268 14.3434 10.7712 14.2924C10.7212 14.2414 10.6962 14.1421 10.6962 13.9946V13.5267C10.6962 13.3849 10.7212 13.2884 10.7712 13.2374C10.8268 13.1807 10.9269 13.1523 11.0714 13.1523H11.5383C11.6773 13.1523 11.7745 13.1807 11.8301 13.2374C11.8857 13.2884 11.9135 13.3849 11.9135 13.5267V13.9946C11.9135 14.1421 11.8857 14.2414 11.8301 14.2924C11.7745 14.3434 11.6773 14.369 11.5383 14.369H11.0714Z\"\n\t\t\tfill=\"white\"\n\t\t/>\n\t</svg>\n);\n\nconst SvgCalendarIcon = ({ className, size = 'sm', ...props }: IconProps) => (\n\t<Svg\n\t\tclassName={cn(\n\t\t\ticonVariants({\n\t\t\t\tsize,\n\t\t\t}),\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nexport default SvgCalendarIcon;\n"],"mappings":";;;;;AAEA,MAAa,eAAe,IAAI,kBAAkB;CACjD,UAAU,EACT,MAAM;EACL,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;CACJ,EACD;CACD,iBAAiB,EAChB,MAAM,KACN;AACD,EAAC;;;;ACTF,MAAMA,QAAM,CAACC,0BACZ,KAAC;CACA,WAAU;CACV,SAAQ;CACR,MAAK;CACL,OAAM;CACN,MAAK;CACL,cAAW;CACX,GAAI;;kBAEJ,IAAC,qBAAM,qBAAwB;kBAC/B,IAAC;GAAK,GAAE;GAAqC,MAAK;IAAU;kBAC5D,IAAC;GACA,GAAE;GACF,MAAK;IACJ;kBACF,IAAC;GACA,UAAS;GACT,UAAS;GACT,GAAE;GACF,MAAK;IACJ;;EACG;AAGP,MAAM,cAAc,CAAC,EAAE,WAAW,OAAO,KAAM,GAAG,OAAkB,qBACnE,IAACD;CACA,WAAW,GACV,aAAa,EACZ,KACA,EAAC,EACF,UACA;CACD,GAAI;EACH;AAGH,uBAAe;;;;ACpCf,MAAME,QAAM,CAACC,0BACZ,KAAC;CACA,WAAU;CACV,SAAQ;CACR,MAAK;CACL,OAAM;CACN,MAAK;CACL,mBAAgB;CAChB,GAAI;;kBAEJ,IAAC;GAAM,IAAG;aAAa;IAAiB;kBACxC,IAAC;GACA,UAAS;GACT,UAAS;GACT,GAAE;GACF,MAAK;IACJ;kBACF,IAAC;GACA,GAAE;GACF,MAAK;IACJ;kBACF,IAAC;GACA,GAAE;GACF,MAAK;IACJ;kBACF,IAAC;GACA,GAAE;GACF,MAAK;IACJ;;EACG;AAGP,MAAM,cAAc,CAAC,EAAE,WAAW,OAAO,KAAM,GAAG,OAAkB,qBACnE,IAACD;CACA,WAAW,GACV,aAAa,EACZ,KACA,EAAC,EACF,UACA;CACD,GAAI;EACH;AAGH,uBAAe;;;;AC5Cf,MAAME,QAAM,CAACC,0BACZ,KAAC;CACA,WAAU;CACV,SAAQ;CACR,MAAK;CACL,OAAM;CACN,MAAK;CACL,mBAAgB;CAChB,GAAI;4BAEJ,IAAC;EAAM,IAAG;YAAa;GAAyB,kBAChD,IAAC;EACA,UAAS;EACT,UAAS;EACT,GAAE;EACF,MAAK;GACJ;EACG;AAGP,MAAM,cAAc,CAAC,EAAE,WAAW,OAAO,KAAM,GAAG,OAAkB,qBACnE,IAACD;CACA,WAAW,GACV,aAAa,EACZ,KACA,EAAC,EACF,UACA;CACD,GAAI;EACH;AAGH,uBAAe;;;;ACjCf,MAAM,MAAM,CAACE,0BACZ,KAAC;CACA,WAAU;CACV,SAAQ;CACR,MAAK;CACL,OAAM;CACN,MAAK;CACL,cAAW;CACX,GAAI;4BAEJ,IAAC,qBAAM,kBAAqB,kBAC5B,IAAC;EACA,GAAE;EACF,MAAK;GACJ;EACG;AAGP,MAAM,kBAAkB,CAAC,EAAE,WAAW,OAAO,KAAM,GAAG,OAAkB,qBACvE,IAAC;CACA,WAAW,GACV,aAAa,EACZ,KACA,EAAC,EACF,UACA;CACD,GAAI;EACH;AAGH,2BAAe"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"_internal-BgWcRIak.js","names":[],"sources":["../src/react/_internal/get-provider.ts","../src/react/_internal/types.ts"],"sourcesContent":["export const PROVIDER_ID = 'sdk-provider';\n\nexport function getProviderEl() {\n\tif (!globalThis.document) return null;\n\treturn document.getElementById(PROVIDER_ID);\n}\n","import type { ContractType, CreateReq } from '../../types';\nimport type { MarketplaceKind } from './api';\n\nexport interface QueryArg {\n\tenabled?: boolean;\n}\n\nexport type CollectableId = string | number;\n\nexport type CollectionType = ContractType.ERC1155 | ContractType.ERC721;\n\ntype TransactionStep = {\n\texist: boolean;\n\tisExecuting: boolean;\n\texecute: () => Promise<void>;\n};\n\nexport type TransactionSteps = {\n\tapproval: TransactionStep;\n\ttransaction: TransactionStep;\n};\n\nexport enum TransactionType {\n\tBUY = 'BUY',\n\tSELL = 'SELL',\n\tLISTING = 'LISTING',\n\tOFFER = 'OFFER',\n\tTRANSFER = 'TRANSFER',\n\tCANCEL = 'CANCEL',\n}\n\nexport interface BuyInput {\n\torderId: string;\n\tcollectableDecimals: number;\n\tmarketplace: MarketplaceKind;\n\tquantity: string;\n}\n\nexport interface SellInput {\n\torderId: string;\n\tmarketplace: MarketplaceKind;\n\tquantity?: string;\n}\n\nexport interface ListingInput {\n\tcontractType: ContractType;\n\tlisting: CreateReq;\n}\n\nexport interface OfferInput {\n\tcontractType: ContractType;\n\toffer: CreateReq;\n}\n\nexport interface CancelInput {\n\torderId: string;\n\tmarketplace: MarketplaceKind;\n}\n\nexport type ValuesOptional<T> = {\n\t[K in keyof T]: T[K] | undefined;\n};\n\nexport type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;\n"],"mappings":";AAAA,MAAa,cAAc;AAE3B,SAAgB,gBAAgB;AAC/B,MAAK,WAAW,SAAU,QAAO;AACjC,QAAO,SAAS,eAAe,YAAY;AAC3C;;;;ACiBD,IAAY,8DAAL;AACN;AACA;AACA;AACA;AACA;AACA;;AACA"}