@0xsequence/marketplace-sdk 0.4.5 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alien_swap-4GAIV7PA.png +0 -0
- package/dist/alien_swap-IZONL4XB.js +8 -0
- package/dist/alien_swap-PMYKGY6A.js +8 -0
- package/dist/aqua-xyz-HLNZIFE2.js +8 -0
- package/dist/aqua-xyz-HLNZIFE2.js.map +1 -0
- package/dist/aqua-xyz-JY5QCI5L.js +8 -0
- package/dist/aqua-xyz-JY5QCI5L.js.map +1 -0
- package/dist/aqua-xyz-WU4JVU2K.png +0 -0
- package/dist/aura-CYKEACX2.js +8 -0
- package/dist/aura-CYKEACX2.js.map +1 -0
- package/dist/aura-HLMWKNSP.js +8 -0
- package/dist/aura-HLMWKNSP.js.map +1 -0
- package/dist/aura-RITZV42R.png +0 -0
- package/dist/blur-2ABQMPTL.png +0 -0
- package/dist/blur-MIPRQYJL.js +8 -0
- package/dist/blur-MIPRQYJL.js.map +1 -0
- package/dist/blur-XDIGHYB7.js +8 -0
- package/dist/blur-XDIGHYB7.js.map +1 -0
- package/dist/{chunk-SEISACMH.js → chunk-5UCKYAMR.js} +771 -788
- package/dist/chunk-5UCKYAMR.js.map +1 -0
- package/dist/{chunk-KILOCWY2.js → chunk-6R4G7J6Q.js} +87 -27
- package/dist/chunk-6R4G7J6Q.js.map +1 -0
- package/dist/{chunk-CKOWM2ZR.js → chunk-AQT3BQ67.js} +9 -9
- package/dist/chunk-AQT3BQ67.js.map +1 -0
- package/dist/{chunk-KL5JPUPS.js → chunk-FWN2MCLI.js} +18 -12
- package/dist/chunk-FWN2MCLI.js.map +1 -0
- package/dist/{chunk-PAZ4MQXZ.js → chunk-JEOUQFT3.js} +17 -129
- package/dist/chunk-JEOUQFT3.js.map +1 -0
- package/dist/chunk-MWDG7UTB.js +132 -0
- package/dist/chunk-MWDG7UTB.js.map +1 -0
- package/dist/{chunk-KZGDOIZY.js → chunk-R7GVMKMM.js} +154 -76
- package/dist/chunk-R7GVMKMM.js.map +1 -0
- package/dist/chunk-RK6KYMZM.js +18 -0
- package/dist/chunk-RK6KYMZM.js.map +1 -0
- package/dist/{chunk-YUETNNZQ.js → chunk-WM4RGBFQ.js} +1 -10
- package/dist/{chunk-YUETNNZQ.js.map → chunk-WM4RGBFQ.js.map} +1 -1
- package/dist/chunk-XP3WY5AX.js +174 -0
- package/dist/chunk-XP3WY5AX.js.map +1 -0
- package/dist/{chunk-ZEKRTFBU.js → chunk-YOKGP2EQ.js} +12 -2
- package/dist/chunk-YOKGP2EQ.js.map +1 -0
- package/dist/{chunk-HTFBQVLV.js → chunk-ZEH4JI2U.js} +2 -2
- package/dist/chunk-ZUEQGPLO.js +302 -0
- package/dist/chunk-ZUEQGPLO.js.map +1 -0
- package/dist/coinbase-MIJPE653.js +8 -0
- package/dist/coinbase-MIJPE653.js.map +1 -0
- package/dist/coinbase-MZUBBEC4.png +0 -0
- package/dist/coinbase-T24XHLQL.js +8 -0
- package/dist/coinbase-T24XHLQL.js.map +1 -0
- package/dist/{create-config-DMBOGsJp.d.ts → create-config-D5WqfUft.d.ts} +2 -2
- package/dist/element-GHIPFSB6.png +0 -0
- package/dist/element-MWATR3ON.js +8 -0
- package/dist/element-MWATR3ON.js.map +1 -0
- package/dist/element-X45NH4D7.js +8 -0
- package/dist/element-X45NH4D7.js.map +1 -0
- package/dist/foundation-BDJUT6CK.js +8 -0
- package/dist/foundation-BDJUT6CK.js.map +1 -0
- package/dist/foundation-FJKIXLS5.png +0 -0
- package/dist/foundation-Z6D6U74V.js +8 -0
- package/dist/foundation-Z6D6U74V.js.map +1 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +12 -6
- package/dist/looks-rare-B6G3OQAP.png +0 -0
- package/dist/looks-rare-LBHT6EXZ.js +8 -0
- package/dist/looks-rare-LBHT6EXZ.js.map +1 -0
- package/dist/looks-rare-STS6IKI4.js +8 -0
- package/dist/looks-rare-STS6IKI4.js.map +1 -0
- package/dist/magic-eden-HA3X3P2O.png +0 -0
- package/dist/magic-eden-RMZ24554.js +8 -0
- package/dist/magic-eden-RMZ24554.js.map +1 -0
- package/dist/magic-eden-YMTLPKLE.js +8 -0
- package/dist/magic-eden-YMTLPKLE.js.map +1 -0
- package/dist/manifold-I4NT4V5L.png +0 -0
- package/dist/manifold-L7FLFDRO.js +8 -0
- package/dist/manifold-L7FLFDRO.js.map +1 -0
- package/dist/manifold-YIUSABCZ.js +8 -0
- package/dist/manifold-YIUSABCZ.js.map +1 -0
- package/dist/{marketplace-config-0Rft6_Hv.d.ts → marketplace-config-C_fDWzz0.d.ts} +2 -2
- package/dist/marketplace.gen-B8S8fflj.d.ts +390 -0
- package/dist/mintify-ARDASD5Z.js +8 -0
- package/dist/mintify-ARDASD5Z.js.map +1 -0
- package/dist/mintify-OLOGFTWQ.png +0 -0
- package/dist/mintify-TSZA3SQT.js +8 -0
- package/dist/mintify-TSZA3SQT.js.map +1 -0
- package/dist/nftx-67RX7ZV6.js +8 -0
- package/dist/nftx-67RX7ZV6.js.map +1 -0
- package/dist/nftx-DJIV3PYG.png +0 -0
- package/dist/nftx-KVJ3T3G2.js +8 -0
- package/dist/nftx-KVJ3T3G2.js.map +1 -0
- package/dist/okx-MOA2EFVR.js +8 -0
- package/dist/okx-MOA2EFVR.js.map +1 -0
- package/dist/okx-WNQRV3WE.png +0 -0
- package/dist/okx-WQA7H7EM.js +8 -0
- package/dist/okx-WQA7H7EM.js.map +1 -0
- package/dist/open-sea-2HWFM4P6.js +8 -0
- package/dist/open-sea-2HWFM4P6.js.map +1 -0
- package/dist/open-sea-C57XWTAR.png +0 -0
- package/dist/open-sea-GESD6S2M.js +8 -0
- package/dist/open-sea-GESD6S2M.js.map +1 -0
- package/dist/rarible-GHMFCPBT.js +8 -0
- package/dist/rarible-GHMFCPBT.js.map +1 -0
- package/dist/rarible-QNNAZZQC.js +8 -0
- package/dist/rarible-QNNAZZQC.js.map +1 -0
- package/dist/rarible-ZCE7U3I5.png +0 -0
- package/dist/react/_internal/api/index.d.ts +4 -3
- package/dist/react/_internal/api/index.js +6 -2
- package/dist/react/_internal/index.d.ts +6 -7
- package/dist/react/_internal/index.js +10 -4
- package/dist/react/_internal/wagmi/index.d.ts +3 -4
- package/dist/react/_internal/wagmi/index.js +2 -2
- package/dist/react/hooks/index.d.ts +779 -116
- package/dist/react/hooks/index.js +17 -7
- package/dist/react/index.d.ts +7 -8
- package/dist/react/index.js +19 -10
- package/dist/react/ssr/index.js +8 -30
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/collectible-card/index.css.map +1 -0
- package/dist/react/ui/components/{index.d.ts → collectible-card/index.d.ts} +4 -3
- package/dist/react/ui/components/collectible-card/index.js +29 -0
- package/dist/react/ui/components/collectible-card/index.js.map +1 -0
- package/dist/react/ui/components/marketplace-logos/index.d.ts +26 -0
- package/dist/react/ui/components/marketplace-logos/index.js +46 -0
- package/dist/react/ui/components/marketplace-logos/index.js.map +1 -0
- package/dist/react/ui/icons/index.js +0 -8
- package/dist/react/ui/icons/index.js.map +1 -1
- package/dist/react/ui/index.d.ts +6 -5
- package/dist/react/ui/index.js +11 -10
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +4 -2
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +9 -7
- package/dist/{marketplace.gen-jdKqutnd.d.ts → sdk-config-BXVH8PS2.d.ts} +91 -16
- package/dist/sequence-JAFBEQNI.png +0 -0
- package/dist/sequence-OIPVNE5P.js +8 -0
- package/dist/sequence-OIPVNE5P.js.map +1 -0
- package/dist/sequence-QNNBU34G.js +8 -0
- package/dist/sequence-QNNBU34G.js.map +1 -0
- package/dist/{services-C2O-7p_M.d.ts → services-CdXAIjt1.d.ts} +1 -2
- package/dist/sudo-swap-D3FAP7W4.js +8 -0
- package/dist/sudo-swap-D3FAP7W4.js.map +1 -0
- package/dist/sudo-swap-XNJ3BIUD.js +8 -0
- package/dist/sudo-swap-XNJ3BIUD.js.map +1 -0
- package/dist/sudo-swap-Y6GICQTL.png +0 -0
- package/dist/super-rare-VIUS3P6B.js +8 -0
- package/dist/super-rare-VIUS3P6B.js.map +1 -0
- package/dist/super-rare-WWXZ3MQL.png +0 -0
- package/dist/super-rare-YPU3Y7EF.js +8 -0
- package/dist/super-rare-YPU3Y7EF.js.map +1 -0
- package/dist/types/index.d.ts +3 -4
- package/dist/types/index.js +9 -6
- package/dist/types-eX4P9xju.d.ts +70 -0
- package/dist/utils/index.d.ts +16 -3
- package/dist/utils/index.js +9 -2
- package/dist/x2y2-CXOXXZKS.png +0 -0
- package/dist/x2y2-G2SXS5VR.js +8 -0
- package/dist/x2y2-G2SXS5VR.js.map +1 -0
- package/dist/x2y2-GKWTQTPB.js +8 -0
- package/dist/x2y2-GKWTQTPB.js.map +1 -0
- package/dist/zora-3DPG4KAY.png +0 -0
- package/dist/zora-JUDT67NX.js +8 -0
- package/dist/zora-JUDT67NX.js.map +1 -0
- package/dist/zora-Z5VR477F.js +8 -0
- package/dist/zora-Z5VR477F.js.map +1 -0
- package/package.json +33 -19
- package/src/react/_internal/api/__mocks__/marketplace.msw.ts +218 -0
- package/src/react/_internal/api/marketplace.gen.ts +125 -42
- package/src/react/_internal/api/query-keys.ts +8 -0
- package/src/react/_internal/api/zod-schema.ts +33 -0
- package/src/react/_internal/test-utils.tsx +68 -0
- package/src/react/_internal/types.ts +51 -1
- package/src/react/_internal/{transaction-machine/utils.ts → utils.ts} +1 -1
- package/src/react/_internal/{transaction-machine → wallet}/wallet.ts +2 -2
- package/src/react/hooks/index.ts +2 -0
- package/src/react/hooks/options/__mocks__/marketplaceConfig.msw.ts +77 -0
- package/src/react/hooks/options/__tests__/marketplaceConfigOptions.test.tsx +144 -0
- package/src/react/hooks/useCancelOrder.tsx +22 -3
- package/src/react/hooks/useCancelTransactionSteps.tsx +8 -10
- package/src/react/hooks/useCurrencies.tsx +14 -19
- package/src/react/hooks/useCurrency.tsx +10 -1
- package/src/react/hooks/useCurrencyBalance.tsx +38 -36
- package/src/react/hooks/useGetReceiptFromHash.tsx +1 -1
- package/src/react/hooks/useListCollectibleActivities.tsx +57 -0
- package/src/react/hooks/useListCollectionActivities.tsx +57 -0
- package/src/react/ssr/create-ssr-client.ts +1 -1
- package/src/react/ui/components/_internals/action-button/ActionButton.tsx +1 -1
- package/src/react/ui/components/_internals/custom-select/__tests__/CustomSelect.test.tsx +89 -0
- package/src/react/ui/components/collectible-card/CollectibleCard.tsx +1 -1
- package/src/react/ui/components/collectible-card/index.ts +1 -0
- package/src/react/ui/components/marketplace-logos/index.ts +23 -0
- package/src/react/ui/components/marketplace-logos/marketplace-logos.tsx +111 -0
- package/src/react/ui/images/marketplaces/alien_swap.png +0 -0
- package/src/react/ui/images/marketplaces/aqua-xyz.png +0 -0
- package/src/react/ui/images/marketplaces/aura.png +0 -0
- package/src/react/ui/images/marketplaces/blur.png +0 -0
- package/src/react/ui/images/marketplaces/coinbase.png +0 -0
- package/src/react/ui/images/marketplaces/element.png +0 -0
- package/src/react/ui/images/marketplaces/foundation.png +0 -0
- package/src/react/ui/images/marketplaces/looks-rare.png +0 -0
- package/src/react/ui/images/marketplaces/magic-eden.png +0 -0
- package/src/react/ui/images/marketplaces/manifold.png +0 -0
- package/src/react/ui/images/marketplaces/mintify.png +0 -0
- package/src/react/ui/images/marketplaces/nftx.png +0 -0
- package/src/react/ui/images/marketplaces/okx.png +0 -0
- package/src/react/ui/images/marketplaces/open-sea.png +0 -0
- package/src/react/ui/images/marketplaces/rarible.png +0 -0
- package/src/react/ui/images/marketplaces/sequence.png +0 -0
- package/src/react/ui/images/marketplaces/sudo-swap.png +0 -0
- package/src/react/ui/images/marketplaces/super-rare.png +0 -0
- package/src/react/ui/images/marketplaces/x2y2.png +0 -0
- package/src/react/ui/images/marketplaces/zora.png +0 -0
- package/src/react/ui/modals/BuyModal/Modal.tsx +3 -1
- package/src/react/ui/modals/BuyModal/hooks/useBuyCollectable.ts +8 -7
- package/src/react/ui/modals/BuyModal/hooks/useCheckoutOptions.ts +1 -1
- package/src/react/ui/modals/BuyModal/modals/CheckoutModal.tsx +12 -3
- package/src/react/ui/modals/CreateListingModal/Modal.tsx +2 -1
- package/src/react/ui/modals/CreateListingModal/__tests__/Modal.test.tsx +208 -0
- package/src/react/ui/modals/CreateListingModal/hooks/useCreateListing.tsx +11 -2
- package/src/react/ui/modals/CreateListingModal/hooks/useGetTokenApproval.ts +1 -1
- package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +8 -22
- package/src/react/ui/modals/CreateListingModal/store.ts +29 -19
- package/src/react/ui/modals/MakeOfferModal/Modal.tsx +17 -24
- package/src/react/ui/modals/MakeOfferModal/__tests__/Modal.test.tsx +199 -0
- package/src/react/ui/modals/MakeOfferModal/hooks/useGetTokenApproval.tsx +2 -2
- package/src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx +19 -3
- package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +9 -23
- package/src/react/ui/modals/MakeOfferModal/store.ts +31 -20
- package/src/react/ui/modals/SellModal/Modal.tsx +1 -0
- package/src/react/ui/modals/SellModal/__tests__/Modal.test.tsx +192 -0
- package/src/react/ui/modals/SellModal/hooks/useGetTokenApproval.tsx +4 -4
- package/src/react/ui/modals/SellModal/hooks/useSell.tsx +3 -3
- package/src/react/ui/modals/SellModal/hooks/useTransactionSteps.tsx +14 -26
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/useHandleTransfer.tsx +1 -1
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx +3 -1
- package/src/react/ui/modals/_internal/components/actionModal/ErrorModal.tsx +10 -2
- package/src/react/ui/modals/_internal/components/actionModal/LoadingModal.tsx +7 -1
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/__tests__/index.test.tsx +159 -0
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +5 -2
- package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +11 -1
- package/src/react/ui/modals/_internal/components/priceInput/__tests__/index.test.tsx +124 -0
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +51 -45
- package/src/react/ui/modals/_internal/components/switchChainModal/__tests__/SwitchChainModal.test.tsx +221 -0
- package/src/react/ui/modals/_internal/components/switchChainModal/index.tsx +24 -5
- package/src/react/ui/modals/_internal/components/switchChainModal/store.ts +2 -2
- package/src/react/ui/modals/_internal/components/transactionPreview/index.tsx +16 -2
- package/src/react/ui/modals/_internal/components/transactionPreview/useTransactionPreviewTitle.tsx +1 -1
- package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/TransactionStatusModal.test.tsx +147 -0
- package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/utils.test.ts +218 -0
- package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +28 -11
- package/src/react/ui/modals/_internal/components/transactionStatusModal/store.ts +1 -1
- package/src/react/ui/modals/_internal/components/transactionStatusModal/util/getFormattedType.ts +1 -1
- package/src/react/ui/modals/_internal/components/transactionStatusModal/util/getMessage.ts +3 -3
- package/src/react/ui/modals/_internal/components/transactionStatusModal/util/getTitle.ts +1 -1
- package/src/react/ui/modals/modal-provider.tsx +0 -2
- package/src/types/marketplace-config.ts +1 -1
- package/src/utils/__tests__/address.test.ts +65 -0
- package/src/utils/__tests__/date.test.ts +31 -0
- package/src/utils/__tests__/get-public-rpc-client.test.ts +109 -0
- package/src/utils/__tests__/getMarketplaceDetails.test.ts +134 -0
- package/src/utils/__tests__/price.test.ts +42 -0
- package/src/utils/get-public-rpc-client.ts +6 -0
- package/src/utils/getMarketplaceDetails.ts +110 -0
- package/src/utils/index.ts +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/vitest.config.js +10 -0
- package/dist/chunk-6WB4GCCJ.js +0 -38
- package/dist/chunk-6WB4GCCJ.js.map +0 -1
- package/dist/chunk-CKOWM2ZR.js.map +0 -1
- package/dist/chunk-CP2IVRMX.js +0 -85
- package/dist/chunk-CP2IVRMX.js.map +0 -1
- package/dist/chunk-FT3J32ZV.js +0 -86
- package/dist/chunk-FT3J32ZV.js.map +0 -1
- package/dist/chunk-KILOCWY2.js.map +0 -1
- package/dist/chunk-KL5JPUPS.js.map +0 -1
- package/dist/chunk-KZGDOIZY.js.map +0 -1
- package/dist/chunk-MJ4YU7RW.js +0 -2
- package/dist/chunk-PAZ4MQXZ.js.map +0 -1
- package/dist/chunk-SEISACMH.js.map +0 -1
- package/dist/chunk-ZEKRTFBU.js.map +0 -1
- package/dist/react/ui/components/index.css.map +0 -1
- package/dist/react/ui/components/index.js +0 -28
- package/dist/sdk-config-xWkdBdrL.d.ts +0 -24
- package/dist/types-DZb7GsfL.d.ts +0 -28
- package/src/react/_internal/transaction-machine/execute-transaction.ts +0 -676
- package/src/react/_internal/transaction-machine/useTransactionMachine.ts +0 -140
- package/src/react/ui/components/index.ts +0 -1
- package/src/react/ui/modals/Account/index.tsx +0 -29
- package/src/react/ui/modals/_internal/components/priceInput/hooks/useBalanceCheck.ts +0 -67
- package/src/react/ui/modals/_internal/components/priceInput/hooks/usePriceInput.ts +0 -54
- /package/dist/{chunk-MJ4YU7RW.js.map → alien_swap-IZONL4XB.js.map} +0 -0
- /package/dist/{react/ui/components/index.js.map → alien_swap-PMYKGY6A.js.map} +0 -0
- /package/dist/{chunk-HTFBQVLV.js.map → chunk-ZEH4JI2U.js.map} +0 -0
- /package/dist/react/ui/components/{index.css → collectible-card/index.css} +0 -0
- /package/src/react/_internal/{transaction-machine/logger.ts → logger.ts} +0 -0
- /package/src/react/_internal/{transaction-machine → wallet}/useWallet.ts +0 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ActionModal,
|
|
4
4
|
CustomSelect,
|
|
5
5
|
useCurrencyBalance
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AQT3BQ67.js";
|
|
7
7
|
import {
|
|
8
8
|
CalendarIcon_default,
|
|
9
9
|
MinusIcon_default,
|
|
@@ -46,20 +46,19 @@ import {
|
|
|
46
46
|
useGenerateListingTransaction,
|
|
47
47
|
useGenerateOfferTransaction,
|
|
48
48
|
useGenerateSellTransaction,
|
|
49
|
-
useGetReceiptFromHash,
|
|
50
49
|
useHighestOffer,
|
|
51
50
|
useListBalances,
|
|
52
51
|
useLowestListing,
|
|
53
52
|
useMarketplaceConfig,
|
|
54
53
|
useRoyaltyPercentage,
|
|
55
54
|
useTransferTokens
|
|
56
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-R7GVMKMM.js";
|
|
57
56
|
import {
|
|
58
57
|
AlertMessage,
|
|
59
58
|
switchChainModal_default,
|
|
60
59
|
useSwitchChainModal,
|
|
61
60
|
useWallet
|
|
62
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-FWN2MCLI.js";
|
|
63
62
|
import {
|
|
64
63
|
iconVariants
|
|
65
64
|
} from "./chunk-LF44FCG5.js";
|
|
@@ -67,46 +66,28 @@ import {
|
|
|
67
66
|
calculatePriceDifferencePercentage,
|
|
68
67
|
getPublicRpcClient,
|
|
69
68
|
truncateMiddle
|
|
70
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-XP3WY5AX.js";
|
|
71
70
|
import {
|
|
72
71
|
getProviderEl
|
|
73
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-YOKGP2EQ.js";
|
|
74
73
|
import {
|
|
75
74
|
balanceQueries,
|
|
76
75
|
collectableKeys,
|
|
77
76
|
getMarketplaceClient,
|
|
78
77
|
getQueryClient
|
|
79
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-6R4G7J6Q.js";
|
|
80
79
|
import {
|
|
81
80
|
InvalidContractTypeError,
|
|
82
81
|
InvalidStepError
|
|
83
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-WM4RGBFQ.js";
|
|
84
83
|
|
|
85
84
|
// src/react/ui/modals/modal-provider.tsx
|
|
86
|
-
import { observer as
|
|
87
|
-
|
|
88
|
-
// src/react/ui/modals/Account/index.tsx
|
|
89
|
-
import { Box, Button, Modal, Text } from "@0xsequence/design-system";
|
|
90
|
-
import { observable } from "@legendapp/state";
|
|
91
|
-
import { observer } from "@legendapp/state/react";
|
|
92
|
-
import { useAccount } from "wagmi";
|
|
93
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
94
|
-
var accountModalOpen$ = observable(false);
|
|
95
|
-
var AccountModal = observer(function AccountModal2() {
|
|
96
|
-
const { address } = useAccount();
|
|
97
|
-
return accountModalOpen$.get() && /* @__PURE__ */ jsxs(Modal, { children: [
|
|
98
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
99
|
-
/* @__PURE__ */ jsx(Text, { children: "Wallet address" }),
|
|
100
|
-
/* @__PURE__ */ jsx(Text, { children: address })
|
|
101
|
-
] }),
|
|
102
|
-
/* @__PURE__ */ jsx(Button, { label: "Sign out" })
|
|
103
|
-
] });
|
|
104
|
-
});
|
|
85
|
+
import { observer as observer12 } from "@legendapp/state/react";
|
|
105
86
|
|
|
106
87
|
// src/react/ui/modals/MakeOfferModal/Modal.tsx
|
|
107
|
-
import { Show, observer as
|
|
108
|
-
import { useState as
|
|
109
|
-
import { parseUnits as parseUnits2
|
|
88
|
+
import { Show, observer as observer5 } from "@legendapp/state/react";
|
|
89
|
+
import { useState as useState6 } from "react";
|
|
90
|
+
import { parseUnits as parseUnits2 } from "viem";
|
|
110
91
|
|
|
111
92
|
// src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx
|
|
112
93
|
import { useEffect as useEffect3 } from "react";
|
|
@@ -122,7 +103,7 @@ var useGetTokenApprovalData = (params) => {
|
|
|
122
103
|
tokenId: params.tokenId,
|
|
123
104
|
quantity: "1",
|
|
124
105
|
currencyAddress: params.currencyAddress,
|
|
125
|
-
pricePerToken: "
|
|
106
|
+
pricePerToken: "1",
|
|
126
107
|
expiry: String(Number(dateToUnixTime(/* @__PURE__ */ new Date())) + ONE_DAY_IN_SECONDS)
|
|
127
108
|
};
|
|
128
109
|
const isEnabled = wallet && params.query?.enabled !== false;
|
|
@@ -137,8 +118,8 @@ var useGetTokenApprovalData = (params) => {
|
|
|
137
118
|
orderbook: params.orderbook,
|
|
138
119
|
offer
|
|
139
120
|
};
|
|
140
|
-
const
|
|
141
|
-
const tokenApprovalStep =
|
|
121
|
+
const steps3 = await marketplaceClient.generateOfferTransaction(args).then((resp) => resp.steps);
|
|
122
|
+
const tokenApprovalStep = steps3.find(
|
|
142
123
|
(step) => step.id === "tokenApproval" /* tokenApproval */
|
|
143
124
|
);
|
|
144
125
|
if (!tokenApprovalStep) {
|
|
@@ -159,26 +140,23 @@ var useGetTokenApprovalData = (params) => {
|
|
|
159
140
|
};
|
|
160
141
|
};
|
|
161
142
|
|
|
162
|
-
// src/react/_internal/transaction-machine/execute-transaction.ts
|
|
163
|
-
import { avalanche, optimism } from "viem/chains";
|
|
164
|
-
|
|
165
143
|
// src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx
|
|
166
144
|
import {
|
|
167
145
|
CloseIcon,
|
|
168
146
|
IconButton,
|
|
169
147
|
Skeleton as Skeleton2,
|
|
170
|
-
Text as
|
|
148
|
+
Text as Text4
|
|
171
149
|
} from "@0xsequence/design-system";
|
|
172
150
|
import { TRANSACTION_CONFIRMATIONS_DEFAULT } from "@0xsequence/kit";
|
|
173
|
-
import { observer as
|
|
151
|
+
import { observer as observer2 } from "@legendapp/state/react";
|
|
174
152
|
import { Close, Content, Overlay, Portal, Root } from "@radix-ui/react-dialog";
|
|
175
153
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
176
154
|
import { WaitForTransactionReceiptTimeoutError } from "viem";
|
|
177
155
|
|
|
178
156
|
// src/react/ui/modals/_internal/components/transaction-footer/index.tsx
|
|
179
157
|
import { networks } from "@0xsequence/network";
|
|
180
|
-
import { Box
|
|
181
|
-
import { jsx
|
|
158
|
+
import { Box, Text, Spinner } from "@0xsequence/design-system";
|
|
159
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
182
160
|
function TransactionFooter({
|
|
183
161
|
transactionHash,
|
|
184
162
|
orderId,
|
|
@@ -188,13 +166,13 @@ function TransactionFooter({
|
|
|
188
166
|
isTimeout,
|
|
189
167
|
chainId
|
|
190
168
|
}) {
|
|
191
|
-
const icon = (isConfirmed || orderId) && /* @__PURE__ */
|
|
169
|
+
const icon = (isConfirmed || orderId) && /* @__PURE__ */ jsx(PositiveCircleIcon_default, { size: "md" }) || isConfirming && /* @__PURE__ */ jsx(Spinner, { size: "md" });
|
|
192
170
|
const title = (isConfirmed || orderId) && "Transaction complete" || isConfirming && "Processing transaction" || isFailed && "Transaction failed" || isTimeout && "Transaction took longer than expected";
|
|
193
171
|
const transactionUrl = `${networks[chainId]?.blockExplorer?.rootUrl}tx/${transactionHash}`;
|
|
194
|
-
return /* @__PURE__ */
|
|
172
|
+
return /* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", children: [
|
|
195
173
|
icon,
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
|
|
174
|
+
/* @__PURE__ */ jsx(
|
|
175
|
+
Text,
|
|
198
176
|
{
|
|
199
177
|
color: "text50",
|
|
200
178
|
fontSize: "normal",
|
|
@@ -204,8 +182,8 @@ function TransactionFooter({
|
|
|
204
182
|
children: title
|
|
205
183
|
}
|
|
206
184
|
),
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
|
|
185
|
+
/* @__PURE__ */ jsx(
|
|
186
|
+
Box,
|
|
209
187
|
{
|
|
210
188
|
as: "a",
|
|
211
189
|
flexGrow: "1",
|
|
@@ -215,8 +193,8 @@ function TransactionFooter({
|
|
|
215
193
|
rel: "noopener noreferrer",
|
|
216
194
|
textAlign: "right",
|
|
217
195
|
textDecoration: "none",
|
|
218
|
-
children: /* @__PURE__ */
|
|
219
|
-
|
|
196
|
+
children: /* @__PURE__ */ jsx(
|
|
197
|
+
Text,
|
|
220
198
|
{
|
|
221
199
|
textAlign: "right",
|
|
222
200
|
fontSize: "normal",
|
|
@@ -235,23 +213,23 @@ function TransactionFooter({
|
|
|
235
213
|
|
|
236
214
|
// src/react/ui/modals/_internal/components/transactionPreview/index.tsx
|
|
237
215
|
import {
|
|
238
|
-
Box as
|
|
216
|
+
Box as Box3,
|
|
239
217
|
Image,
|
|
240
218
|
NetworkImage,
|
|
241
219
|
Skeleton,
|
|
242
|
-
Text as
|
|
220
|
+
Text as Text3
|
|
243
221
|
} from "@0xsequence/design-system";
|
|
244
|
-
import { observer
|
|
222
|
+
import { observer } from "@legendapp/state/react";
|
|
245
223
|
import { formatUnits } from "viem";
|
|
246
224
|
|
|
247
225
|
// src/react/ui/images/chess-tile.png
|
|
248
226
|
var chess_tile_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAACuCAYAAABAzl3QAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAInSURBVHgB7dyxbUMxEAXBs6FEjagv91/AD+keeNFCMw1csmBEvJ/P53Nm4Xme2Xi/37Ph/nfeP+f8/Q5EiZcs8ZIlXrLES5Z4yRIvWeIlS7xkiZcs8ZIlXrLES5Z4yRIvWS//Ud2v3vfykiVessRLlnjJEi9Z4iVLvGSJlyzxkiVessRLlnjJEi9Z4iVLvGS9/Ed1v3j/nOPlpUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWeMmyz+v+bNjnhQviJUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWfV73Z8M+L1wQL1niJUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6y7PO6Pxv2eeGCeMkSL1niJUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSZZ/X/dmwzwsXxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPu87s+GfV64IF6yxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZNnndX827PPCBfGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWeMkSL1niJcs+r/uzYZ8XLoiXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWeMkSL1n2ed2fDfu8cEG8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6y/gF97MkwfJRH7QAAAABJRU5ErkJggg==";
|
|
249
227
|
|
|
250
228
|
// src/react/ui/modals/_internal/components/timeAgo/index.tsx
|
|
251
|
-
import { Box as
|
|
229
|
+
import { Box as Box2, Text as Text2 } from "@0xsequence/design-system";
|
|
252
230
|
import { formatDistanceToNow } from "date-fns";
|
|
253
231
|
import { useEffect, useState } from "react";
|
|
254
|
-
import { jsx as
|
|
232
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
255
233
|
function TimeAgo({ date }) {
|
|
256
234
|
const [timeAgo, setTimeAgo] = useState("");
|
|
257
235
|
useEffect(() => {
|
|
@@ -260,20 +238,20 @@ function TimeAgo({ date }) {
|
|
|
260
238
|
}, 1e3);
|
|
261
239
|
return () => clearInterval(interval);
|
|
262
240
|
}, [date]);
|
|
263
|
-
return /* @__PURE__ */
|
|
264
|
-
|
|
241
|
+
return /* @__PURE__ */ jsx2(
|
|
242
|
+
Box2,
|
|
265
243
|
{
|
|
266
244
|
flexGrow: "1",
|
|
267
245
|
display: "flex",
|
|
268
246
|
alignItems: "center",
|
|
269
247
|
justifyContent: "flex-end",
|
|
270
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ jsx2(Text2, { color: "text50", fontSize: "small", children: timeAgo })
|
|
271
249
|
}
|
|
272
250
|
);
|
|
273
251
|
}
|
|
274
252
|
|
|
275
253
|
// src/react/ui/modals/_internal/components/transactionStatusModal/store.ts
|
|
276
|
-
import { observable
|
|
254
|
+
import { observable } from "@legendapp/state";
|
|
277
255
|
var initialState = {
|
|
278
256
|
isOpen: false,
|
|
279
257
|
open: ({
|
|
@@ -326,7 +304,7 @@ var initialState = {
|
|
|
326
304
|
blocked: false
|
|
327
305
|
}
|
|
328
306
|
};
|
|
329
|
-
var transactionStatusModal$ =
|
|
307
|
+
var transactionStatusModal$ = observable(initialState);
|
|
330
308
|
|
|
331
309
|
// src/react/ui/modals/_internal/components/transactionPreview/consts.ts
|
|
332
310
|
var TRANSACTION_TITLES = {
|
|
@@ -374,8 +352,8 @@ function useTransactionPreviewTitle(orderId, status, type) {
|
|
|
374
352
|
}
|
|
375
353
|
|
|
376
354
|
// src/react/ui/modals/_internal/components/transactionPreview/index.tsx
|
|
377
|
-
import { jsx as
|
|
378
|
-
var TransactionPreview =
|
|
355
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
356
|
+
var TransactionPreview = observer(
|
|
379
357
|
({
|
|
380
358
|
orderId,
|
|
381
359
|
price,
|
|
@@ -404,88 +382,110 @@ var TransactionPreview = observer2(
|
|
|
404
382
|
const collectionName = collection?.name;
|
|
405
383
|
const priceFormatted = price ? formatUnits(BigInt(price?.amountRaw), price?.currency.decimals) : void 0;
|
|
406
384
|
if (collectibleLoading || collectionLoading) {
|
|
407
|
-
return /* @__PURE__ */
|
|
385
|
+
return /* @__PURE__ */ jsx3(Box3, { style: { height: 83 }, width: "full", borderRadius: "md", children: /* @__PURE__ */ jsx3(Skeleton, { style: { width: "100%", height: "100%" } }) });
|
|
408
386
|
}
|
|
409
|
-
return /* @__PURE__ */
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
387
|
+
return /* @__PURE__ */ jsxs2(
|
|
388
|
+
Box3,
|
|
389
|
+
{
|
|
390
|
+
padding: "3",
|
|
391
|
+
background: "backgroundSecondary",
|
|
392
|
+
borderRadius: "md",
|
|
393
|
+
"data-testid": "transaction-preview",
|
|
394
|
+
children: [
|
|
395
|
+
/* @__PURE__ */ jsxs2(Box3, { display: "flex", alignItems: "center", children: [
|
|
396
|
+
/* @__PURE__ */ jsx3(
|
|
397
|
+
Text3,
|
|
398
|
+
{
|
|
399
|
+
color: "text50",
|
|
400
|
+
fontSize: "small",
|
|
401
|
+
fontWeight: "medium",
|
|
402
|
+
marginRight: "1",
|
|
403
|
+
fontFamily: "body",
|
|
404
|
+
"data-testid": "transaction-preview-title",
|
|
405
|
+
children: title
|
|
406
|
+
}
|
|
407
|
+
),
|
|
408
|
+
/* @__PURE__ */ jsx3(NetworkImage, { chainId: Number(chainId), size: "xs" }),
|
|
409
|
+
isConfirming && /* @__PURE__ */ jsx3(TimeAgo, { date: /* @__PURE__ */ new Date() })
|
|
410
|
+
] }),
|
|
411
|
+
/* @__PURE__ */ jsxs2(Box3, { display: "flex", alignItems: "center", marginTop: "2", children: [
|
|
412
|
+
/* @__PURE__ */ jsx3(
|
|
413
|
+
Image,
|
|
414
|
+
{
|
|
415
|
+
src: collectibleImage2 || chess_tile_default,
|
|
416
|
+
alt: collectibleName,
|
|
417
|
+
width: "9",
|
|
418
|
+
height: "9",
|
|
419
|
+
borderRadius: "xs",
|
|
420
|
+
marginRight: "3",
|
|
421
|
+
style: { objectFit: "cover" },
|
|
422
|
+
"data-testid": "transaction-preview-image"
|
|
423
|
+
}
|
|
424
|
+
),
|
|
425
|
+
/* @__PURE__ */ jsxs2(
|
|
426
|
+
Box3,
|
|
427
|
+
{
|
|
428
|
+
display: "flex",
|
|
429
|
+
flexDirection: "column",
|
|
430
|
+
alignItems: "flex-start",
|
|
431
|
+
gap: "0.5",
|
|
432
|
+
children: [
|
|
433
|
+
/* @__PURE__ */ jsx3(
|
|
434
|
+
Text3,
|
|
435
|
+
{
|
|
436
|
+
color: "text80",
|
|
437
|
+
fontSize: "small",
|
|
438
|
+
fontWeight: "medium",
|
|
439
|
+
fontFamily: "body",
|
|
440
|
+
"data-testid": "transaction-preview-collectible-name",
|
|
441
|
+
children: collectibleName
|
|
442
|
+
}
|
|
443
|
+
),
|
|
444
|
+
/* @__PURE__ */ jsx3(
|
|
445
|
+
Text3,
|
|
446
|
+
{
|
|
447
|
+
color: "text100",
|
|
448
|
+
fontSize: "small",
|
|
449
|
+
fontFamily: "body",
|
|
450
|
+
"data-testid": "transaction-preview-collection-name",
|
|
451
|
+
children: collectionName
|
|
452
|
+
}
|
|
453
|
+
)
|
|
454
|
+
]
|
|
455
|
+
}
|
|
456
|
+
),
|
|
457
|
+
price && /* @__PURE__ */ jsxs2(
|
|
458
|
+
Box3,
|
|
459
|
+
{
|
|
460
|
+
flexGrow: "1",
|
|
461
|
+
display: "flex",
|
|
462
|
+
alignItems: "center",
|
|
463
|
+
justifyContent: "flex-end",
|
|
464
|
+
gap: "1",
|
|
465
|
+
"data-testid": "transaction-preview-price",
|
|
466
|
+
children: [
|
|
467
|
+
/* @__PURE__ */ jsx3(Image, { src: currencyImageUrl, width: "3", height: "3" }),
|
|
468
|
+
/* @__PURE__ */ jsxs2(
|
|
469
|
+
Text3,
|
|
470
|
+
{
|
|
471
|
+
color: "text80",
|
|
472
|
+
fontSize: "small",
|
|
473
|
+
fontWeight: "medium",
|
|
474
|
+
fontFamily: "body",
|
|
475
|
+
children: [
|
|
476
|
+
priceFormatted,
|
|
477
|
+
" ",
|
|
478
|
+
price?.currency.symbol
|
|
479
|
+
]
|
|
480
|
+
}
|
|
481
|
+
)
|
|
482
|
+
]
|
|
483
|
+
}
|
|
484
|
+
)
|
|
485
|
+
] })
|
|
486
|
+
]
|
|
487
|
+
}
|
|
488
|
+
);
|
|
489
489
|
}
|
|
490
490
|
);
|
|
491
491
|
var transactionPreview_default = TransactionPreview;
|
|
@@ -538,7 +538,7 @@ function getTransactionStatusModalMessage({
|
|
|
538
538
|
case "PENDING":
|
|
539
539
|
return `You just ${getFormattedType(transactionType, true)}${!hideCollectibleName ? ` ${collectibleName}` : ""}. It should be confirmed on the blockchain shortly.`;
|
|
540
540
|
case "SUCCESS":
|
|
541
|
-
return `You just ${getFormattedType(transactionType, true)}${!hideCollectibleName ? ` ${collectibleName}` : ""}. It
|
|
541
|
+
return `You just ${getFormattedType(transactionType, true)}${!hideCollectibleName ? ` ${collectibleName}` : ""}. It's been confirmed on the blockchain!`;
|
|
542
542
|
case "FAILED":
|
|
543
543
|
return `Your ${getFormattedType(transactionType)} has failed.`;
|
|
544
544
|
case "TIMEOUT":
|
|
@@ -575,7 +575,7 @@ function getTransactionStatusModalTitle({
|
|
|
575
575
|
}
|
|
576
576
|
|
|
577
577
|
// src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx
|
|
578
|
-
import { jsx as
|
|
578
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
579
579
|
var useTransactionStatusModal = () => {
|
|
580
580
|
return {
|
|
581
581
|
show: (args) => {
|
|
@@ -591,7 +591,7 @@ var invalidateQueries = async (queriesToInvalidate) => {
|
|
|
591
591
|
await queryClient.invalidateQueries({ queryKey });
|
|
592
592
|
}
|
|
593
593
|
};
|
|
594
|
-
var TransactionStatusModal =
|
|
594
|
+
var TransactionStatusModal = observer2(() => {
|
|
595
595
|
const {
|
|
596
596
|
type,
|
|
597
597
|
hash,
|
|
@@ -613,6 +613,11 @@ var TransactionStatusModal = observer3(() => {
|
|
|
613
613
|
orderId ? "SUCCESS" : "PENDING"
|
|
614
614
|
);
|
|
615
615
|
const queryClient = getQueryClient();
|
|
616
|
+
const publicClient = chainId ? getPublicRpcClient(chainId) : null;
|
|
617
|
+
const waitForTransactionReceiptPromise = publicClient?.waitForTransactionReceipt({
|
|
618
|
+
confirmations: confirmations || TRANSACTION_CONFIRMATIONS_DEFAULT,
|
|
619
|
+
hash: hash || "0x"
|
|
620
|
+
});
|
|
616
621
|
useEffect2(() => {
|
|
617
622
|
if (!transactionStatusModal$.isOpen.get() || orderId) return;
|
|
618
623
|
console.log("Waiting for transaction receipt ...");
|
|
@@ -666,65 +671,91 @@ var TransactionStatusModal = observer3(() => {
|
|
|
666
671
|
orderId,
|
|
667
672
|
price
|
|
668
673
|
});
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
674
|
+
return /* @__PURE__ */ jsx4(Root, { open: transactionStatusModal$.isOpen.get(), children: /* @__PURE__ */ jsxs3(Portal, { container: getProviderEl(), children: [
|
|
675
|
+
/* @__PURE__ */ jsx4(Overlay, { className: dialogOverlay3 }),
|
|
676
|
+
/* @__PURE__ */ jsxs3(
|
|
677
|
+
Content,
|
|
678
|
+
{
|
|
679
|
+
className: transactionStatusModalContent,
|
|
680
|
+
"data-testid": "transaction-status-modal",
|
|
681
|
+
children: [
|
|
682
|
+
title ? /* @__PURE__ */ jsx4(
|
|
683
|
+
Text4,
|
|
684
|
+
{
|
|
685
|
+
fontSize: "large",
|
|
686
|
+
fontWeight: "bold",
|
|
687
|
+
color: "text100",
|
|
688
|
+
fontFamily: "body",
|
|
689
|
+
"data-testid": "transaction-status-title",
|
|
690
|
+
children: title
|
|
691
|
+
}
|
|
692
|
+
) : /* @__PURE__ */ jsx4(
|
|
693
|
+
Skeleton2,
|
|
694
|
+
{
|
|
695
|
+
width: "16",
|
|
696
|
+
height: "6",
|
|
697
|
+
"data-testid": "transaction-modal-title-skeleton"
|
|
698
|
+
}
|
|
699
|
+
),
|
|
700
|
+
message ? /* @__PURE__ */ jsx4(
|
|
701
|
+
Text4,
|
|
702
|
+
{
|
|
703
|
+
fontSize: "small",
|
|
704
|
+
color: "text80",
|
|
705
|
+
fontFamily: "body",
|
|
706
|
+
"data-testid": "transaction-status-message",
|
|
707
|
+
children: message
|
|
708
|
+
}
|
|
709
|
+
) : /* @__PURE__ */ jsx4(
|
|
710
|
+
Skeleton2,
|
|
711
|
+
{
|
|
712
|
+
width: "20",
|
|
713
|
+
height: "4",
|
|
714
|
+
"data-testid": "transaction-modal-content-skeleton"
|
|
715
|
+
}
|
|
716
|
+
),
|
|
717
|
+
/* @__PURE__ */ jsx4(
|
|
718
|
+
transactionPreview_default,
|
|
719
|
+
{
|
|
720
|
+
orderId,
|
|
721
|
+
price,
|
|
722
|
+
collectionAddress,
|
|
723
|
+
chainId,
|
|
724
|
+
collectible,
|
|
725
|
+
collectibleLoading,
|
|
726
|
+
currencyImageUrl: price?.currency.imageUrl,
|
|
727
|
+
isConfirming: transactionStatus === "PENDING",
|
|
728
|
+
isConfirmed: transactionStatus === "SUCCESS",
|
|
729
|
+
isFailed: transactionStatus === "FAILED",
|
|
730
|
+
isTimeout: transactionStatus === "TIMEOUT"
|
|
731
|
+
}
|
|
732
|
+
),
|
|
733
|
+
/* @__PURE__ */ jsx4(
|
|
734
|
+
TransactionFooter,
|
|
735
|
+
{
|
|
736
|
+
transactionHash: hash,
|
|
737
|
+
orderId,
|
|
738
|
+
isConfirming: transactionStatus === "PENDING",
|
|
739
|
+
isConfirmed: transactionStatus === "SUCCESS",
|
|
740
|
+
isFailed: transactionStatus === "FAILED",
|
|
741
|
+
isTimeout: transactionStatus === "TIMEOUT",
|
|
742
|
+
chainId
|
|
743
|
+
}
|
|
744
|
+
),
|
|
745
|
+
/* @__PURE__ */ jsx4(
|
|
746
|
+
Close,
|
|
747
|
+
{
|
|
748
|
+
onClick: () => {
|
|
749
|
+
transactionStatusModal$.close();
|
|
750
|
+
},
|
|
751
|
+
className: closeButton3,
|
|
752
|
+
asChild: true,
|
|
753
|
+
children: /* @__PURE__ */ jsx4(IconButton, { size: "xs", "aria-label": "Close modal", icon: CloseIcon })
|
|
754
|
+
}
|
|
755
|
+
)
|
|
756
|
+
]
|
|
757
|
+
}
|
|
758
|
+
)
|
|
728
759
|
] }) });
|
|
729
760
|
});
|
|
730
761
|
var transactionStatusModal_default = TransactionStatusModal;
|
|
@@ -744,11 +775,10 @@ var useTransactionSteps = ({
|
|
|
744
775
|
const { show: showTransactionStatusModal } = useTransactionStatusModal();
|
|
745
776
|
const sdkConfig = useConfig();
|
|
746
777
|
const marketplaceClient = getMarketplaceClient(chainId, sdkConfig);
|
|
747
|
-
const { waitForReceipt } = useGetReceiptFromHash();
|
|
748
778
|
const { generateOfferTransactionAsync, isPending: generatingSteps } = useGenerateOfferTransaction({
|
|
749
779
|
chainId,
|
|
750
|
-
onSuccess: (
|
|
751
|
-
if (!
|
|
780
|
+
onSuccess: (steps3) => {
|
|
781
|
+
if (!steps3) return;
|
|
752
782
|
}
|
|
753
783
|
});
|
|
754
784
|
const { data: currency } = useCurrency({
|
|
@@ -759,7 +789,7 @@ var useTransactionSteps = ({
|
|
|
759
789
|
if (!wallet) return;
|
|
760
790
|
try {
|
|
761
791
|
const address = await wallet.address();
|
|
762
|
-
const
|
|
792
|
+
const steps3 = await generateOfferTransactionAsync({
|
|
763
793
|
collectionAddress,
|
|
764
794
|
maker: address,
|
|
765
795
|
walletType: wallet.walletKind,
|
|
@@ -770,7 +800,7 @@ var useTransactionSteps = ({
|
|
|
770
800
|
expiry
|
|
771
801
|
}
|
|
772
802
|
});
|
|
773
|
-
return
|
|
803
|
+
return steps3;
|
|
774
804
|
} catch (error) {
|
|
775
805
|
if (callbacks?.onError) {
|
|
776
806
|
callbacks.onError(error);
|
|
@@ -784,17 +814,15 @@ var useTransactionSteps = ({
|
|
|
784
814
|
try {
|
|
785
815
|
steps$.approval.isExecuting.set(true);
|
|
786
816
|
const approvalStep = await getOfferSteps().then(
|
|
787
|
-
(
|
|
817
|
+
(steps3) => steps3?.find((step) => step.id === "tokenApproval" /* tokenApproval */)
|
|
788
818
|
);
|
|
789
819
|
const hash = await wallet.handleSendTransactionStep(
|
|
790
820
|
Number(chainId),
|
|
791
821
|
approvalStep
|
|
792
822
|
);
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
steps$.approval.exist.set(false);
|
|
797
|
-
}
|
|
823
|
+
await wallet.handleConfirmTransactionStep(hash, Number(chainId));
|
|
824
|
+
steps$.approval.isExecuting.set(false);
|
|
825
|
+
steps$.approval.exist.set(false);
|
|
798
826
|
} catch (error) {
|
|
799
827
|
steps$.approval.isExecuting.set(false);
|
|
800
828
|
}
|
|
@@ -803,11 +831,11 @@ var useTransactionSteps = ({
|
|
|
803
831
|
if (!wallet) return;
|
|
804
832
|
try {
|
|
805
833
|
steps$.transaction.isExecuting.set(true);
|
|
806
|
-
const
|
|
807
|
-
const transactionStep =
|
|
834
|
+
const steps3 = await getOfferSteps();
|
|
835
|
+
const transactionStep = steps3?.find(
|
|
808
836
|
(step) => step.id === "createOffer" /* createOffer */
|
|
809
837
|
);
|
|
810
|
-
const signatureStep =
|
|
838
|
+
const signatureStep = steps3?.find(
|
|
811
839
|
(step) => step.id === "signEIP712" /* signEIP712 */
|
|
812
840
|
);
|
|
813
841
|
console.debug("transactionStep", transactionStep);
|
|
@@ -844,19 +872,13 @@ var useTransactionSteps = ({
|
|
|
844
872
|
}
|
|
845
873
|
});
|
|
846
874
|
if (hash) {
|
|
847
|
-
await
|
|
875
|
+
await wallet.handleConfirmTransactionStep(hash, Number(chainId));
|
|
848
876
|
steps$.transaction.isExecuting.set(false);
|
|
849
877
|
steps$.transaction.exist.set(false);
|
|
850
|
-
if (callbacks?.onSuccess && typeof callbacks.onSuccess === "function") {
|
|
851
|
-
callbacks.onSuccess({ hash });
|
|
852
|
-
}
|
|
853
878
|
}
|
|
854
879
|
if (orderId) {
|
|
855
880
|
steps$.transaction.isExecuting.set(false);
|
|
856
881
|
steps$.transaction.exist.set(false);
|
|
857
|
-
if (callbacks?.onSuccess && typeof callbacks.onSuccess === "function") {
|
|
858
|
-
callbacks.onSuccess({ orderId });
|
|
859
|
-
}
|
|
860
882
|
}
|
|
861
883
|
} catch (error) {
|
|
862
884
|
steps$.transaction.isExecuting.set(false);
|
|
@@ -907,13 +929,21 @@ var useMakeOffer = ({
|
|
|
907
929
|
closeMainModal,
|
|
908
930
|
steps$
|
|
909
931
|
}) => {
|
|
932
|
+
const { data: marketplaceConfig, isLoading: marketplaceIsLoading } = useMarketplaceConfig();
|
|
933
|
+
const collectionConfig = marketplaceConfig?.collections.find(
|
|
934
|
+
(c) => c.collectionAddress === collectionAddress
|
|
935
|
+
);
|
|
936
|
+
orderbookKind = orderbookKind ?? collectionConfig?.destinationMarketplace ?? "sequence_marketplace_v2" /* sequence_marketplace_v2 */;
|
|
910
937
|
const { data: tokenApproval, isLoading: tokenApprovalIsLoading } = useGetTokenApprovalData({
|
|
911
938
|
chainId,
|
|
912
939
|
tokenId: offerInput.offer.tokenId,
|
|
913
940
|
collectionAddress,
|
|
914
941
|
currencyAddress: offerInput.offer.currencyAddress,
|
|
915
942
|
contractType: offerInput.contractType,
|
|
916
|
-
orderbook: orderbookKind
|
|
943
|
+
orderbook: orderbookKind,
|
|
944
|
+
query: {
|
|
945
|
+
enabled: !marketplaceIsLoading
|
|
946
|
+
}
|
|
917
947
|
});
|
|
918
948
|
useEffect3(() => {
|
|
919
949
|
if (tokenApproval?.step && !tokenApprovalIsLoading) {
|
|
@@ -939,14 +969,15 @@ var useMakeOffer = ({
|
|
|
939
969
|
};
|
|
940
970
|
|
|
941
971
|
// src/react/ui/modals/_internal/components/actionModal/ErrorModal.tsx
|
|
942
|
-
import { Box as
|
|
943
|
-
import { jsx as
|
|
972
|
+
import { Box as Box4 } from "@0xsequence/design-system";
|
|
973
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
944
974
|
var ErrorModal = ({
|
|
945
975
|
isOpen,
|
|
946
976
|
chainId,
|
|
947
977
|
onClose,
|
|
948
|
-
title
|
|
949
|
-
|
|
978
|
+
title,
|
|
979
|
+
message
|
|
980
|
+
}) => /* @__PURE__ */ jsx5(
|
|
950
981
|
ActionModal,
|
|
951
982
|
{
|
|
952
983
|
isOpen,
|
|
@@ -954,19 +985,29 @@ var ErrorModal = ({
|
|
|
954
985
|
onClose,
|
|
955
986
|
title,
|
|
956
987
|
ctas: [],
|
|
957
|
-
children: /* @__PURE__ */
|
|
988
|
+
children: /* @__PURE__ */ jsx5(
|
|
989
|
+
Box4,
|
|
990
|
+
{
|
|
991
|
+
"data-testid": "error-modal",
|
|
992
|
+
display: "flex",
|
|
993
|
+
justifyContent: "center",
|
|
994
|
+
alignItems: "center",
|
|
995
|
+
padding: "4",
|
|
996
|
+
children: message || "Error loading item details"
|
|
997
|
+
}
|
|
998
|
+
)
|
|
958
999
|
}
|
|
959
1000
|
);
|
|
960
1001
|
|
|
961
1002
|
// src/react/ui/modals/_internal/components/actionModal/LoadingModal.tsx
|
|
962
|
-
import { Box as
|
|
963
|
-
import { jsx as
|
|
1003
|
+
import { Box as Box5, Spinner as Spinner2 } from "@0xsequence/design-system";
|
|
1004
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
964
1005
|
var LoadingModal = ({
|
|
965
1006
|
isOpen,
|
|
966
1007
|
chainId,
|
|
967
1008
|
onClose,
|
|
968
1009
|
title
|
|
969
|
-
}) => /* @__PURE__ */
|
|
1010
|
+
}) => /* @__PURE__ */ jsx6(
|
|
970
1011
|
ActionModal,
|
|
971
1012
|
{
|
|
972
1013
|
isOpen,
|
|
@@ -974,27 +1015,37 @@ var LoadingModal = ({
|
|
|
974
1015
|
onClose,
|
|
975
1016
|
title,
|
|
976
1017
|
ctas: [],
|
|
977
|
-
children: /* @__PURE__ */
|
|
1018
|
+
children: /* @__PURE__ */ jsx6(
|
|
1019
|
+
Box5,
|
|
1020
|
+
{
|
|
1021
|
+
"data-testid": "loading-modal",
|
|
1022
|
+
display: "flex",
|
|
1023
|
+
justifyContent: "center",
|
|
1024
|
+
alignItems: "center",
|
|
1025
|
+
padding: "4",
|
|
1026
|
+
children: /* @__PURE__ */ jsx6(Spinner2, { size: "lg" })
|
|
1027
|
+
}
|
|
1028
|
+
)
|
|
978
1029
|
}
|
|
979
1030
|
);
|
|
980
1031
|
|
|
981
1032
|
// src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx
|
|
982
|
-
import { Box as
|
|
983
|
-
import { observer as
|
|
1033
|
+
import { Box as Box6, Skeleton as Skeleton3, Text as Text5 } from "@0xsequence/design-system";
|
|
1034
|
+
import { observer as observer3 } from "@legendapp/state/react";
|
|
984
1035
|
import { addDays } from "date-fns";
|
|
985
1036
|
|
|
986
1037
|
// src/react/ui/modals/_internal/components/calendarPopover/index.tsx
|
|
987
|
-
import { Button
|
|
1038
|
+
import { Button } from "@0xsequence/design-system";
|
|
988
1039
|
import { Content as Content2, Portal as Portal2, Root as Root2, Trigger } from "@radix-ui/react-popover";
|
|
989
1040
|
import { format } from "date-fns";
|
|
990
1041
|
|
|
991
1042
|
// src/react/ui/modals/_internal/components/calendar/index.tsx
|
|
992
1043
|
import { DayPicker } from "react-day-picker";
|
|
993
1044
|
import "react-day-picker/style.css";
|
|
994
|
-
import { jsx as
|
|
1045
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
995
1046
|
function Calendar({ ...props }) {
|
|
996
1047
|
const { selectedDate, setSelectedDate } = props;
|
|
997
|
-
return /* @__PURE__ */
|
|
1048
|
+
return /* @__PURE__ */ jsx7(
|
|
998
1049
|
DayPicker,
|
|
999
1050
|
{
|
|
1000
1051
|
disabled: {
|
|
@@ -1042,14 +1093,14 @@ Calendar.displayName = "Calendar";
|
|
|
1042
1093
|
var calendar_default = Calendar;
|
|
1043
1094
|
|
|
1044
1095
|
// src/react/ui/modals/_internal/components/calendarPopover/index.tsx
|
|
1045
|
-
import { jsx as
|
|
1096
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1046
1097
|
function CalendarPopover({
|
|
1047
1098
|
selectedDate,
|
|
1048
1099
|
setSelectedDate
|
|
1049
1100
|
}) {
|
|
1050
|
-
return /* @__PURE__ */
|
|
1051
|
-
/* @__PURE__ */
|
|
1052
|
-
|
|
1101
|
+
return /* @__PURE__ */ jsxs4(Root2, { children: [
|
|
1102
|
+
/* @__PURE__ */ jsx8(Trigger, { asChild: true, children: /* @__PURE__ */ jsx8(
|
|
1103
|
+
Button,
|
|
1053
1104
|
{
|
|
1054
1105
|
leftIcon: CalendarIcon_default,
|
|
1055
1106
|
className: dateSelectButton,
|
|
@@ -1058,7 +1109,7 @@ function CalendarPopover({
|
|
|
1058
1109
|
shape: "square"
|
|
1059
1110
|
}
|
|
1060
1111
|
) }),
|
|
1061
|
-
/* @__PURE__ */
|
|
1112
|
+
/* @__PURE__ */ jsx8(Portal2, { children: /* @__PURE__ */ jsx8(Content2, { className: dateSelectPopoverContent, sideOffset: 5, children: /* @__PURE__ */ jsx8(
|
|
1062
1113
|
calendar_default,
|
|
1063
1114
|
{
|
|
1064
1115
|
selectedDate,
|
|
@@ -1071,7 +1122,12 @@ function CalendarPopover({
|
|
|
1071
1122
|
|
|
1072
1123
|
// src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx
|
|
1073
1124
|
import { useState as useState3 } from "react";
|
|
1074
|
-
import { jsx as
|
|
1125
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1126
|
+
var setToEndOfDay = (date) => {
|
|
1127
|
+
const endOfDay = new Date(date);
|
|
1128
|
+
endOfDay.setHours(23, 59, 59, 999);
|
|
1129
|
+
return endOfDay;
|
|
1130
|
+
};
|
|
1075
1131
|
var PRESET_RANGES = {
|
|
1076
1132
|
TODAY: {
|
|
1077
1133
|
label: "Today",
|
|
@@ -1099,7 +1155,7 @@ var PRESET_RANGES = {
|
|
|
1099
1155
|
offset: 30
|
|
1100
1156
|
}
|
|
1101
1157
|
};
|
|
1102
|
-
var ExpirationDateSelect =
|
|
1158
|
+
var ExpirationDateSelect = observer3(function ExpirationDateSelect2({
|
|
1103
1159
|
className,
|
|
1104
1160
|
$date
|
|
1105
1161
|
}) {
|
|
@@ -1113,18 +1169,19 @@ var ExpirationDateSelect = observer4(function ExpirationDateSelect2({
|
|
|
1113
1169
|
if (!presetRange) {
|
|
1114
1170
|
return;
|
|
1115
1171
|
}
|
|
1116
|
-
const
|
|
1172
|
+
const baseDate = /* @__PURE__ */ new Date();
|
|
1173
|
+
const newDate = presetRange.value === "today" ? setToEndOfDay(baseDate) : addDays(baseDate, presetRange.offset);
|
|
1117
1174
|
$date.set(newDate);
|
|
1118
1175
|
}
|
|
1119
1176
|
function handleDateValueChange(date) {
|
|
1120
1177
|
$date.set(date);
|
|
1121
1178
|
}
|
|
1122
1179
|
if (!$date.get()) {
|
|
1123
|
-
return /* @__PURE__ */
|
|
1180
|
+
return /* @__PURE__ */ jsx9(Skeleton3, { borderRadius: "lg", width: "20", height: "7", marginRight: "3" });
|
|
1124
1181
|
}
|
|
1125
|
-
return /* @__PURE__ */
|
|
1126
|
-
/* @__PURE__ */
|
|
1127
|
-
|
|
1182
|
+
return /* @__PURE__ */ jsxs5(Box6, { width: "full", position: "relative", children: [
|
|
1183
|
+
/* @__PURE__ */ jsx9(
|
|
1184
|
+
Text5,
|
|
1128
1185
|
{
|
|
1129
1186
|
fontSize: "small",
|
|
1130
1187
|
fontWeight: "medium",
|
|
@@ -1135,8 +1192,8 @@ var ExpirationDateSelect = observer4(function ExpirationDateSelect2({
|
|
|
1135
1192
|
children: "Set expiry"
|
|
1136
1193
|
}
|
|
1137
1194
|
),
|
|
1138
|
-
/* @__PURE__ */
|
|
1139
|
-
|
|
1195
|
+
/* @__PURE__ */ jsxs5(
|
|
1196
|
+
Box6,
|
|
1140
1197
|
{
|
|
1141
1198
|
className,
|
|
1142
1199
|
width: "full",
|
|
@@ -1145,14 +1202,14 @@ var ExpirationDateSelect = observer4(function ExpirationDateSelect2({
|
|
|
1145
1202
|
gap: "2",
|
|
1146
1203
|
marginTop: "0.5",
|
|
1147
1204
|
children: [
|
|
1148
|
-
/* @__PURE__ */
|
|
1149
|
-
|
|
1205
|
+
/* @__PURE__ */ jsx9(
|
|
1206
|
+
Box6,
|
|
1150
1207
|
{
|
|
1151
1208
|
position: "absolute",
|
|
1152
1209
|
right: "0",
|
|
1153
1210
|
onClick: (e) => e.stopPropagation(),
|
|
1154
1211
|
zIndex: "10",
|
|
1155
|
-
children: /* @__PURE__ */
|
|
1212
|
+
children: /* @__PURE__ */ jsx9(
|
|
1156
1213
|
CustomSelect,
|
|
1157
1214
|
{
|
|
1158
1215
|
items: Object.values(PRESET_RANGES).map((preset) => ({
|
|
@@ -1169,7 +1226,7 @@ var ExpirationDateSelect = observer4(function ExpirationDateSelect2({
|
|
|
1169
1226
|
)
|
|
1170
1227
|
}
|
|
1171
1228
|
),
|
|
1172
|
-
/* @__PURE__ */
|
|
1229
|
+
/* @__PURE__ */ jsx9(
|
|
1173
1230
|
CalendarPopover,
|
|
1174
1231
|
{
|
|
1175
1232
|
selectedDate: $date.get(),
|
|
@@ -1184,8 +1241,8 @@ var ExpirationDateSelect = observer4(function ExpirationDateSelect2({
|
|
|
1184
1241
|
var expirationDateSelect_default = ExpirationDateSelect;
|
|
1185
1242
|
|
|
1186
1243
|
// src/react/ui/modals/_internal/components/floorPriceText/index.tsx
|
|
1187
|
-
import { Text as
|
|
1188
|
-
import { jsx as
|
|
1244
|
+
import { Text as Text6 } from "@0xsequence/design-system";
|
|
1245
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1189
1246
|
function FloorPriceText({
|
|
1190
1247
|
chainId,
|
|
1191
1248
|
collectionAddress,
|
|
@@ -1210,8 +1267,8 @@ function FloorPriceText({
|
|
|
1210
1267
|
decimals: price.currency.decimals
|
|
1211
1268
|
});
|
|
1212
1269
|
const floorPriceDifferenceText = floorPriceRaw === price.amountRaw ? "Same as floor price" : `${floorPriceDifference}% ${floorPriceRaw > price.amountRaw ? "below" : "above"} floor price`;
|
|
1213
|
-
return /* @__PURE__ */
|
|
1214
|
-
|
|
1270
|
+
return /* @__PURE__ */ jsx10(
|
|
1271
|
+
Text6,
|
|
1215
1272
|
{
|
|
1216
1273
|
fontSize: "small",
|
|
1217
1274
|
fontWeight: "medium",
|
|
@@ -1225,22 +1282,21 @@ function FloorPriceText({
|
|
|
1225
1282
|
}
|
|
1226
1283
|
|
|
1227
1284
|
// src/react/ui/modals/_internal/components/priceInput/index.tsx
|
|
1228
|
-
import { Box as
|
|
1229
|
-
import {
|
|
1230
|
-
import {
|
|
1231
|
-
import { useAccount as useAccount2 } from "wagmi";
|
|
1285
|
+
import { Box as Box8, NumericInput, Text as Text7 } from "@0xsequence/design-system";
|
|
1286
|
+
import { parseUnits } from "viem";
|
|
1287
|
+
import { useAccount } from "wagmi";
|
|
1232
1288
|
|
|
1233
1289
|
// src/react/ui/modals/_internal/components/currencyImage/index.tsx
|
|
1234
|
-
import { Box as
|
|
1290
|
+
import { Box as Box7, TokenImage } from "@0xsequence/design-system";
|
|
1235
1291
|
import { useState as useState4 } from "react";
|
|
1236
|
-
import { jsx as
|
|
1292
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1237
1293
|
function CurrencyImage({ price$ }) {
|
|
1238
1294
|
const [imageLoadErrorCurrencyAddresses, setImageLoadErrorCurrencyAddresses] = useState4(null);
|
|
1239
1295
|
if (imageLoadErrorCurrencyAddresses?.includes(
|
|
1240
1296
|
price$.currency.contractAddress.get()
|
|
1241
1297
|
)) {
|
|
1242
|
-
return /* @__PURE__ */
|
|
1243
|
-
|
|
1298
|
+
return /* @__PURE__ */ jsx11(
|
|
1299
|
+
Box7,
|
|
1244
1300
|
{
|
|
1245
1301
|
width: "3",
|
|
1246
1302
|
height: "3",
|
|
@@ -1249,7 +1305,7 @@ function CurrencyImage({ price$ }) {
|
|
|
1249
1305
|
}
|
|
1250
1306
|
);
|
|
1251
1307
|
}
|
|
1252
|
-
return /* @__PURE__ */
|
|
1308
|
+
return /* @__PURE__ */ jsx11(
|
|
1253
1309
|
TokenImage,
|
|
1254
1310
|
{
|
|
1255
1311
|
src: price$.currency.imageUrl.get(),
|
|
@@ -1277,20 +1333,22 @@ var currencyImage_default = CurrencyImage;
|
|
|
1277
1333
|
|
|
1278
1334
|
// src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx
|
|
1279
1335
|
import { Skeleton as Skeleton4 } from "@0xsequence/design-system";
|
|
1280
|
-
import { observer as
|
|
1336
|
+
import { observer as observer4 } from "@legendapp/state/react";
|
|
1281
1337
|
import { useEffect as useEffect4 } from "react";
|
|
1282
|
-
import { jsx as
|
|
1283
|
-
var CurrencyOptionsSelect =
|
|
1338
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1339
|
+
var CurrencyOptionsSelect = observer4(function CurrencyOptionsSelect2({
|
|
1284
1340
|
chainId,
|
|
1285
1341
|
collectionAddress,
|
|
1286
1342
|
secondCurrencyAsDefault,
|
|
1287
|
-
selectedCurrency
|
|
1343
|
+
selectedCurrency$,
|
|
1344
|
+
includeNativeCurrency
|
|
1288
1345
|
}) {
|
|
1289
1346
|
const currency = selectedCurrency$.get();
|
|
1290
1347
|
const currencyOptions = useCurrencyOptions({ collectionAddress });
|
|
1291
1348
|
const { data: currencies, isLoading: currenciesLoading } = useCurrencies({
|
|
1292
1349
|
chainId,
|
|
1293
|
-
currencyOptions
|
|
1350
|
+
currencyOptions,
|
|
1351
|
+
includeNativeCurrency
|
|
1294
1352
|
});
|
|
1295
1353
|
useEffect4(() => {
|
|
1296
1354
|
if (currencies && currencies.length > 0 && !selectedCurrency$.get()?.contractAddress) {
|
|
@@ -1301,8 +1359,8 @@ var CurrencyOptionsSelect = observer5(function CurrencyOptionsSelect2({
|
|
|
1301
1359
|
}
|
|
1302
1360
|
}
|
|
1303
1361
|
}, [currencies]);
|
|
1304
|
-
if (!currencies || currenciesLoading || !currency
|
|
1305
|
-
return /* @__PURE__ */
|
|
1362
|
+
if (!currencies || currenciesLoading || !currency?.symbol) {
|
|
1363
|
+
return /* @__PURE__ */ jsx12(Skeleton4, { borderRadius: "lg", width: "20", height: "7", marginRight: "3" });
|
|
1306
1364
|
}
|
|
1307
1365
|
const options = currencies.map(
|
|
1308
1366
|
(currency2) => ({
|
|
@@ -1317,7 +1375,7 @@ var CurrencyOptionsSelect = observer5(function CurrencyOptionsSelect2({
|
|
|
1317
1375
|
);
|
|
1318
1376
|
selectedCurrency$.set(selectedCurrency);
|
|
1319
1377
|
};
|
|
1320
|
-
return /* @__PURE__ */
|
|
1378
|
+
return /* @__PURE__ */ jsx12(
|
|
1321
1379
|
CustomSelect,
|
|
1322
1380
|
{
|
|
1323
1381
|
items: options,
|
|
@@ -1331,163 +1389,73 @@ var CurrencyOptionsSelect = observer5(function CurrencyOptionsSelect2({
|
|
|
1331
1389
|
});
|
|
1332
1390
|
var currencyOptionsSelect_default = CurrencyOptionsSelect;
|
|
1333
1391
|
|
|
1334
|
-
// src/react/ui/modals/_internal/components/priceInput/hooks/usePriceInput.ts
|
|
1335
|
-
import { useState as useState5, useEffect as useEffect5 } from "react";
|
|
1336
|
-
import { parseUnits } from "viem";
|
|
1337
|
-
var usePriceInput = ({
|
|
1338
|
-
price$,
|
|
1339
|
-
currencyDecimals,
|
|
1340
|
-
onPriceChange
|
|
1341
|
-
}) => {
|
|
1342
|
-
const [value, setValue] = useState5("");
|
|
1343
|
-
useEffect5(() => {
|
|
1344
|
-
const currentAmount = value.replace(/,/g, "");
|
|
1345
|
-
if (currentAmount) {
|
|
1346
|
-
try {
|
|
1347
|
-
const parsedAmount = parseUnits(
|
|
1348
|
-
currentAmount,
|
|
1349
|
-
Number(currencyDecimals)
|
|
1350
|
-
);
|
|
1351
|
-
price$.amountRaw.set(parsedAmount.toString());
|
|
1352
|
-
} catch {
|
|
1353
|
-
price$.amountRaw.set("0");
|
|
1354
|
-
}
|
|
1355
|
-
}
|
|
1356
|
-
}, [currencyDecimals, value, price$]);
|
|
1357
|
-
const handlePriceChange = (newValue) => {
|
|
1358
|
-
setValue(newValue);
|
|
1359
|
-
try {
|
|
1360
|
-
const parsedAmount = parseUnits(newValue, Number(currencyDecimals));
|
|
1361
|
-
price$.amountRaw.set(parsedAmount.toString());
|
|
1362
|
-
if (onPriceChange && parsedAmount !== 0n) {
|
|
1363
|
-
onPriceChange();
|
|
1364
|
-
}
|
|
1365
|
-
} catch {
|
|
1366
|
-
price$.amountRaw.set("0");
|
|
1367
|
-
}
|
|
1368
|
-
};
|
|
1369
|
-
return {
|
|
1370
|
-
value,
|
|
1371
|
-
handlePriceChange
|
|
1372
|
-
};
|
|
1373
|
-
};
|
|
1374
|
-
|
|
1375
|
-
// src/react/ui/modals/_internal/components/priceInput/hooks/useBalanceCheck.ts
|
|
1376
|
-
import { useState as useState6, useEffect as useEffect6 } from "react";
|
|
1377
|
-
var useBalanceCheck = ({
|
|
1378
|
-
checkBalance,
|
|
1379
|
-
price$,
|
|
1380
|
-
currencyAddress,
|
|
1381
|
-
chainId,
|
|
1382
|
-
userAddress,
|
|
1383
|
-
currencyDecimals
|
|
1384
|
-
}) => {
|
|
1385
|
-
const [balanceError, setBalanceError] = useState6("");
|
|
1386
|
-
const { data: balance, isSuccess: isBalanceSuccess } = useCurrencyBalance({
|
|
1387
|
-
currencyAddress,
|
|
1388
|
-
chainId,
|
|
1389
|
-
userAddress
|
|
1390
|
-
});
|
|
1391
|
-
useEffect6(() => {
|
|
1392
|
-
if (!checkBalance?.enabled) {
|
|
1393
|
-
setBalanceError("");
|
|
1394
|
-
return;
|
|
1395
|
-
}
|
|
1396
|
-
const priceAmountRaw = price$.amountRaw.get() || "0";
|
|
1397
|
-
const hasInsufficientBalance = isBalanceSuccess && priceAmountRaw && currencyDecimals && BigInt(priceAmountRaw) > (balance?.value || 0n);
|
|
1398
|
-
if (hasInsufficientBalance) {
|
|
1399
|
-
setBalanceError("Insufficient balance");
|
|
1400
|
-
checkBalance.callback(true);
|
|
1401
|
-
} else {
|
|
1402
|
-
setBalanceError("");
|
|
1403
|
-
checkBalance.callback(false);
|
|
1404
|
-
}
|
|
1405
|
-
}, [
|
|
1406
|
-
price$.amountRaw.get(),
|
|
1407
|
-
currencyAddress,
|
|
1408
|
-
balance?.value,
|
|
1409
|
-
isBalanceSuccess,
|
|
1410
|
-
checkBalance,
|
|
1411
|
-
currencyDecimals
|
|
1412
|
-
]);
|
|
1413
|
-
return {
|
|
1414
|
-
balanceError
|
|
1415
|
-
};
|
|
1416
|
-
};
|
|
1417
|
-
|
|
1418
1392
|
// src/react/ui/modals/_internal/components/priceInput/index.tsx
|
|
1419
|
-
import {
|
|
1420
|
-
|
|
1393
|
+
import { use$ } from "@legendapp/state/react";
|
|
1394
|
+
import { useState as useState5 } from "react";
|
|
1395
|
+
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1396
|
+
function PriceInput({
|
|
1421
1397
|
chainId,
|
|
1422
1398
|
collectionAddress,
|
|
1423
1399
|
$price,
|
|
1424
1400
|
onPriceChange,
|
|
1425
1401
|
checkBalance,
|
|
1426
|
-
secondCurrencyAsDefault
|
|
1402
|
+
secondCurrencyAsDefault,
|
|
1403
|
+
includeNativeCurrency
|
|
1427
1404
|
}) {
|
|
1428
|
-
const { address: accountAddress } =
|
|
1429
|
-
const currencyDecimals = $price.currency.decimals
|
|
1430
|
-
const currencyAddress = $price.currency.contractAddress
|
|
1431
|
-
const
|
|
1432
|
-
|
|
1433
|
-
currencyDecimals,
|
|
1434
|
-
onPriceChange
|
|
1435
|
-
});
|
|
1436
|
-
const { balanceError } = useBalanceCheck({
|
|
1437
|
-
checkBalance,
|
|
1438
|
-
price$: $price,
|
|
1405
|
+
const { address: accountAddress } = useAccount();
|
|
1406
|
+
const currencyDecimals = use$($price.currency.decimals);
|
|
1407
|
+
const currencyAddress = use$($price.currency.contractAddress);
|
|
1408
|
+
const priceAmountRaw = use$($price.amountRaw);
|
|
1409
|
+
const { data: balance, isSuccess: isBalanceSuccess } = useCurrencyBalance({
|
|
1439
1410
|
currencyAddress,
|
|
1440
1411
|
chainId: Number(chainId),
|
|
1441
|
-
userAddress: accountAddress
|
|
1442
|
-
currencyDecimals
|
|
1412
|
+
userAddress: accountAddress
|
|
1443
1413
|
});
|
|
1444
|
-
const
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1414
|
+
const balanceError = !!checkBalance?.enabled && !!isBalanceSuccess && !!priceAmountRaw && !!currencyDecimals && BigInt(priceAmountRaw) > BigInt(balance?.value || 0n);
|
|
1415
|
+
if (checkBalance?.enabled) {
|
|
1416
|
+
checkBalance.callback(balanceError);
|
|
1417
|
+
}
|
|
1418
|
+
const [value, setValue] = useState5("0");
|
|
1419
|
+
const handleChange = (event) => {
|
|
1420
|
+
const newValue = event.target.value;
|
|
1421
|
+
setValue(newValue);
|
|
1422
|
+
try {
|
|
1423
|
+
const parsedAmount = parseUnits(newValue, Number(currencyDecimals));
|
|
1424
|
+
$price.amountRaw.set(parsedAmount.toString());
|
|
1425
|
+
if (onPriceChange && parsedAmount !== 0n) {
|
|
1426
|
+
onPriceChange();
|
|
1456
1427
|
}
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
);
|
|
1465
|
-
return /* @__PURE__ */ jsxs7(Box9, { className: priceInputWrapper, position: "relative", children: [
|
|
1466
|
-
/* @__PURE__ */ jsx14(
|
|
1467
|
-
Box9,
|
|
1428
|
+
} catch {
|
|
1429
|
+
$price.amountRaw.set("0");
|
|
1430
|
+
}
|
|
1431
|
+
};
|
|
1432
|
+
return /* @__PURE__ */ jsxs6(Box8, { className: priceInputWrapper, position: "relative", children: [
|
|
1433
|
+
/* @__PURE__ */ jsx13(
|
|
1434
|
+
Box8,
|
|
1468
1435
|
{
|
|
1469
1436
|
className: priceInputCurrencyImage,
|
|
1470
1437
|
position: "absolute",
|
|
1471
1438
|
left: "2",
|
|
1472
1439
|
display: "flex",
|
|
1473
1440
|
alignItems: "center",
|
|
1474
|
-
children: /* @__PURE__ */
|
|
1441
|
+
children: /* @__PURE__ */ jsx13(currencyImage_default, { price$: $price })
|
|
1475
1442
|
}
|
|
1476
1443
|
),
|
|
1477
|
-
/* @__PURE__ */
|
|
1444
|
+
/* @__PURE__ */ jsx13(
|
|
1478
1445
|
NumericInput,
|
|
1479
1446
|
{
|
|
1480
1447
|
name: "price-input",
|
|
1481
1448
|
decimals: currencyDecimals,
|
|
1482
1449
|
label: "Enter price",
|
|
1483
1450
|
labelLocation: "top",
|
|
1484
|
-
controls: /* @__PURE__ */
|
|
1451
|
+
controls: /* @__PURE__ */ jsx13(
|
|
1485
1452
|
currencyOptionsSelect_default,
|
|
1486
1453
|
{
|
|
1487
1454
|
selectedCurrency$: $price.currency,
|
|
1488
1455
|
collectionAddress,
|
|
1489
1456
|
chainId,
|
|
1490
|
-
secondCurrencyAsDefault
|
|
1457
|
+
secondCurrencyAsDefault,
|
|
1458
|
+
includeNativeCurrency
|
|
1491
1459
|
}
|
|
1492
1460
|
),
|
|
1493
1461
|
value,
|
|
@@ -1495,14 +1463,24 @@ var PriceInput = observer6(function PriceInput2({
|
|
|
1495
1463
|
width: "full"
|
|
1496
1464
|
}
|
|
1497
1465
|
),
|
|
1498
|
-
|
|
1466
|
+
balanceError && /* @__PURE__ */ jsx13(
|
|
1467
|
+
Text7,
|
|
1468
|
+
{
|
|
1469
|
+
color: "negative",
|
|
1470
|
+
fontSize: "xsmall",
|
|
1471
|
+
fontFamily: "body",
|
|
1472
|
+
fontWeight: "semibold",
|
|
1473
|
+
position: "absolute",
|
|
1474
|
+
style: { bottom: "-13px" },
|
|
1475
|
+
children: "Insufficient balance"
|
|
1476
|
+
}
|
|
1477
|
+
)
|
|
1499
1478
|
] });
|
|
1500
|
-
}
|
|
1501
|
-
var priceInput_default = PriceInput;
|
|
1479
|
+
}
|
|
1502
1480
|
|
|
1503
1481
|
// src/react/ui/modals/_internal/components/quantityInput/index.tsx
|
|
1504
|
-
import { Box as
|
|
1505
|
-
import { jsx as
|
|
1482
|
+
import { Box as Box9, IconButton as IconButton2, NumericInput as NumericInput2 } from "@0xsequence/design-system";
|
|
1483
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1506
1484
|
function QuantityInput({
|
|
1507
1485
|
$quantity,
|
|
1508
1486
|
$invalidQuantity,
|
|
@@ -1563,8 +1541,8 @@ function QuantityInput({
|
|
|
1563
1541
|
}
|
|
1564
1542
|
const quantity = $quantity.get();
|
|
1565
1543
|
const invalidQuantity = $invalidQuantity.get();
|
|
1566
|
-
return /* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1544
|
+
return /* @__PURE__ */ jsxs7(Box9, { className: quantityInputWrapper, children: [
|
|
1545
|
+
/* @__PURE__ */ jsx14(
|
|
1568
1546
|
NumericInput2,
|
|
1569
1547
|
{
|
|
1570
1548
|
name: "quantity",
|
|
@@ -1572,15 +1550,15 @@ function QuantityInput({
|
|
|
1572
1550
|
paddingLeft: "1",
|
|
1573
1551
|
label: "Enter quantity",
|
|
1574
1552
|
labelLocation: "top",
|
|
1575
|
-
controls: /* @__PURE__ */
|
|
1576
|
-
|
|
1553
|
+
controls: /* @__PURE__ */ jsxs7(
|
|
1554
|
+
Box9,
|
|
1577
1555
|
{
|
|
1578
1556
|
display: "flex",
|
|
1579
1557
|
alignItems: "center",
|
|
1580
1558
|
gap: "1",
|
|
1581
1559
|
marginRight: "2",
|
|
1582
1560
|
children: [
|
|
1583
|
-
/* @__PURE__ */
|
|
1561
|
+
/* @__PURE__ */ jsx14(
|
|
1584
1562
|
IconButton2,
|
|
1585
1563
|
{
|
|
1586
1564
|
disabled: !quantity || Number(quantity) <= 1,
|
|
@@ -1590,7 +1568,7 @@ function QuantityInput({
|
|
|
1590
1568
|
icon: MinusIcon_default
|
|
1591
1569
|
}
|
|
1592
1570
|
),
|
|
1593
|
-
/* @__PURE__ */
|
|
1571
|
+
/* @__PURE__ */ jsx14(
|
|
1594
1572
|
IconButton2,
|
|
1595
1573
|
{
|
|
1596
1574
|
disabled: !quantity || Number(quantity) >= Number(maxQuantity),
|
|
@@ -1609,13 +1587,13 @@ function QuantityInput({
|
|
|
1609
1587
|
width: "full"
|
|
1610
1588
|
}
|
|
1611
1589
|
),
|
|
1612
|
-
invalidQuantity && /* @__PURE__ */
|
|
1590
|
+
invalidQuantity && /* @__PURE__ */ jsx14(Box9, { color: "negative", fontSize: "small", children: invalidQuantity })
|
|
1613
1591
|
] });
|
|
1614
1592
|
}
|
|
1615
1593
|
|
|
1616
1594
|
// src/react/ui/modals/_internal/components/tokenPreview/index.tsx
|
|
1617
|
-
import { Box as
|
|
1618
|
-
import { jsx as
|
|
1595
|
+
import { Box as Box10, Image as Image2, Skeleton as Skeleton5, Text as Text8 } from "@0xsequence/design-system";
|
|
1596
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1619
1597
|
function TokenPreview({
|
|
1620
1598
|
collectionName,
|
|
1621
1599
|
collectionAddress,
|
|
@@ -1628,16 +1606,16 @@ function TokenPreview({
|
|
|
1628
1606
|
collectibleId
|
|
1629
1607
|
});
|
|
1630
1608
|
if (collectibleLoading) {
|
|
1631
|
-
return /* @__PURE__ */
|
|
1632
|
-
/* @__PURE__ */
|
|
1633
|
-
/* @__PURE__ */
|
|
1634
|
-
/* @__PURE__ */
|
|
1635
|
-
/* @__PURE__ */
|
|
1609
|
+
return /* @__PURE__ */ jsxs8(Box10, { display: "flex", alignItems: "center", gap: "3", width: "full", children: [
|
|
1610
|
+
/* @__PURE__ */ jsx15(Skeleton5, { width: "9", height: "9", borderRadius: "xs" }),
|
|
1611
|
+
/* @__PURE__ */ jsxs8(Box10, { display: "flex", flexGrow: "1", gap: "1", flexDirection: "column", children: [
|
|
1612
|
+
/* @__PURE__ */ jsx15(Skeleton5, { width: "1/3", height: "3" }),
|
|
1613
|
+
/* @__PURE__ */ jsx15(Skeleton5, { width: "1/2", height: "3" })
|
|
1636
1614
|
] })
|
|
1637
1615
|
] });
|
|
1638
1616
|
}
|
|
1639
|
-
return /* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1617
|
+
return /* @__PURE__ */ jsxs8(Box10, { className: tokenPreview, children: [
|
|
1618
|
+
/* @__PURE__ */ jsx15(
|
|
1641
1619
|
Image2,
|
|
1642
1620
|
{
|
|
1643
1621
|
src: collectable?.image || chess_tile_default,
|
|
@@ -1648,9 +1626,9 @@ function TokenPreview({
|
|
|
1648
1626
|
style: { objectFit: "cover" }
|
|
1649
1627
|
}
|
|
1650
1628
|
),
|
|
1651
|
-
/* @__PURE__ */
|
|
1652
|
-
/* @__PURE__ */
|
|
1653
|
-
|
|
1629
|
+
/* @__PURE__ */ jsxs8(Box10, { display: "flex", flexDirection: "column", marginLeft: "3", children: [
|
|
1630
|
+
/* @__PURE__ */ jsx15(
|
|
1631
|
+
Text8,
|
|
1654
1632
|
{
|
|
1655
1633
|
fontSize: "small",
|
|
1656
1634
|
color: "text80",
|
|
@@ -1659,8 +1637,8 @@ function TokenPreview({
|
|
|
1659
1637
|
children: collectionName
|
|
1660
1638
|
}
|
|
1661
1639
|
),
|
|
1662
|
-
/* @__PURE__ */
|
|
1663
|
-
|
|
1640
|
+
/* @__PURE__ */ jsx15(
|
|
1641
|
+
Text8,
|
|
1664
1642
|
{
|
|
1665
1643
|
fontSize: "small",
|
|
1666
1644
|
fontWeight: "bold",
|
|
@@ -1674,36 +1652,40 @@ function TokenPreview({
|
|
|
1674
1652
|
}
|
|
1675
1653
|
|
|
1676
1654
|
// src/react/ui/modals/MakeOfferModal/store.ts
|
|
1677
|
-
import { observable as
|
|
1655
|
+
import { observable as observable2 } from "@legendapp/state";
|
|
1678
1656
|
import { addDays as addDays2 } from "date-fns/addDays";
|
|
1657
|
+
var offerPrice = {
|
|
1658
|
+
amountRaw: "0",
|
|
1659
|
+
currency: {}
|
|
1660
|
+
};
|
|
1661
|
+
var approval = {
|
|
1662
|
+
exist: false,
|
|
1663
|
+
isExecuting: false,
|
|
1664
|
+
execute: () => Promise.resolve()
|
|
1665
|
+
};
|
|
1666
|
+
var transaction = {
|
|
1667
|
+
exist: false,
|
|
1668
|
+
isExecuting: false,
|
|
1669
|
+
execute: () => Promise.resolve()
|
|
1670
|
+
};
|
|
1671
|
+
var steps = {
|
|
1672
|
+
approval: { ...approval },
|
|
1673
|
+
transaction: { ...transaction }
|
|
1674
|
+
};
|
|
1679
1675
|
var initialState2 = {
|
|
1680
1676
|
isOpen: false,
|
|
1681
1677
|
collectionAddress: "",
|
|
1682
1678
|
chainId: "",
|
|
1683
1679
|
collectibleId: "",
|
|
1684
|
-
orderbookKind:
|
|
1680
|
+
orderbookKind: void 0,
|
|
1685
1681
|
callbacks: void 0,
|
|
1686
|
-
offerPrice: {
|
|
1687
|
-
amountRaw: "0",
|
|
1688
|
-
currency: {}
|
|
1689
|
-
},
|
|
1682
|
+
offerPrice: { ...offerPrice },
|
|
1690
1683
|
offerPriceChanged: false,
|
|
1691
1684
|
quantity: "1",
|
|
1692
1685
|
invalidQuantity: false,
|
|
1693
1686
|
expiry: new Date(addDays2(/* @__PURE__ */ new Date(), 7).toJSON()),
|
|
1694
1687
|
collectionType: void 0,
|
|
1695
|
-
steps: {
|
|
1696
|
-
approval: {
|
|
1697
|
-
exist: false,
|
|
1698
|
-
isExecuting: false,
|
|
1699
|
-
execute: () => Promise.resolve()
|
|
1700
|
-
},
|
|
1701
|
-
transaction: {
|
|
1702
|
-
exist: false,
|
|
1703
|
-
isExecuting: false,
|
|
1704
|
-
execute: () => Promise.resolve()
|
|
1705
|
-
}
|
|
1706
|
-
}
|
|
1688
|
+
steps: { ...steps }
|
|
1707
1689
|
};
|
|
1708
1690
|
var actions = {
|
|
1709
1691
|
open: (args) => {
|
|
@@ -1717,25 +1699,27 @@ var actions = {
|
|
|
1717
1699
|
close: () => {
|
|
1718
1700
|
makeOfferModal$.isOpen.set(false);
|
|
1719
1701
|
makeOfferModal$.set({ ...initialState2, ...actions });
|
|
1702
|
+
makeOfferModal$.steps.set({ ...steps });
|
|
1703
|
+
makeOfferModal$.offerPrice.set({ ...offerPrice });
|
|
1704
|
+
makeOfferModal$.steps.set({ ...steps });
|
|
1720
1705
|
}
|
|
1721
1706
|
};
|
|
1722
|
-
var makeOfferModal$ =
|
|
1707
|
+
var makeOfferModal$ = observable2({
|
|
1723
1708
|
...initialState2,
|
|
1724
1709
|
...actions
|
|
1725
1710
|
});
|
|
1726
1711
|
|
|
1727
1712
|
// src/react/ui/modals/MakeOfferModal/Modal.tsx
|
|
1728
|
-
import {
|
|
1729
|
-
import { Fragment, jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1713
|
+
import { Fragment, jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1730
1714
|
var MakeOfferModal = () => {
|
|
1731
|
-
return /* @__PURE__ */
|
|
1715
|
+
return /* @__PURE__ */ jsx16(Show, { if: makeOfferModal$.isOpen, children: () => /* @__PURE__ */ jsx16(Modal, {}) });
|
|
1732
1716
|
};
|
|
1733
|
-
var
|
|
1717
|
+
var Modal = observer5(() => {
|
|
1734
1718
|
const state = makeOfferModal$.get();
|
|
1735
1719
|
const {
|
|
1736
1720
|
collectionAddress,
|
|
1737
1721
|
chainId,
|
|
1738
|
-
offerPrice,
|
|
1722
|
+
offerPrice: offerPrice2,
|
|
1739
1723
|
offerPriceChanged,
|
|
1740
1724
|
invalidQuantity,
|
|
1741
1725
|
collectibleId,
|
|
@@ -1743,7 +1727,7 @@ var Modal2 = observer7(() => {
|
|
|
1743
1727
|
callbacks
|
|
1744
1728
|
} = state;
|
|
1745
1729
|
const steps$ = makeOfferModal$.steps;
|
|
1746
|
-
const [insufficientBalance, setInsufficientBalance] =
|
|
1730
|
+
const [insufficientBalance, setInsufficientBalance] = useState6(false);
|
|
1747
1731
|
const {
|
|
1748
1732
|
data: collectible,
|
|
1749
1733
|
isLoading: collectableIsLoading,
|
|
@@ -1768,9 +1752,9 @@ var Modal2 = observer7(() => {
|
|
|
1768
1752
|
isError: currenciesIsError
|
|
1769
1753
|
} = useCurrencies({
|
|
1770
1754
|
chainId,
|
|
1771
|
-
currencyOptions
|
|
1755
|
+
currencyOptions,
|
|
1756
|
+
includeNativeCurrency: false
|
|
1772
1757
|
});
|
|
1773
|
-
const selectedCurrency = use$(makeOfferModal$.offerPrice.currency);
|
|
1774
1758
|
const { isLoading, executeApproval, makeOffer } = useMakeOffer({
|
|
1775
1759
|
offerInput: {
|
|
1776
1760
|
contractType: collection?.type,
|
|
@@ -1781,8 +1765,8 @@ var Modal2 = observer7(() => {
|
|
|
1781
1765
|
collectible?.decimals || 0
|
|
1782
1766
|
).toString(),
|
|
1783
1767
|
expiry: dateToUnixTime(makeOfferModal$.expiry.get()),
|
|
1784
|
-
currencyAddress:
|
|
1785
|
-
pricePerToken:
|
|
1768
|
+
currencyAddress: offerPrice2.currency.contractAddress,
|
|
1769
|
+
pricePerToken: offerPrice2.amountRaw
|
|
1786
1770
|
}
|
|
1787
1771
|
},
|
|
1788
1772
|
chainId,
|
|
@@ -1793,7 +1777,7 @@ var Modal2 = observer7(() => {
|
|
|
1793
1777
|
steps$
|
|
1794
1778
|
});
|
|
1795
1779
|
if (collectableIsLoading || collectionIsLoading || currenciesLoading) {
|
|
1796
|
-
return /* @__PURE__ */
|
|
1780
|
+
return /* @__PURE__ */ jsx16(
|
|
1797
1781
|
LoadingModal,
|
|
1798
1782
|
{
|
|
1799
1783
|
isOpen: makeOfferModal$.isOpen.get(),
|
|
@@ -1804,7 +1788,7 @@ var Modal2 = observer7(() => {
|
|
|
1804
1788
|
);
|
|
1805
1789
|
}
|
|
1806
1790
|
if (collectableIsError || collectionIsError || currenciesIsError) {
|
|
1807
|
-
return /* @__PURE__ */
|
|
1791
|
+
return /* @__PURE__ */ jsx16(
|
|
1808
1792
|
ErrorModal,
|
|
1809
1793
|
{
|
|
1810
1794
|
isOpen: makeOfferModal$.isOpen.get(),
|
|
@@ -1814,7 +1798,18 @@ var Modal2 = observer7(() => {
|
|
|
1814
1798
|
}
|
|
1815
1799
|
);
|
|
1816
1800
|
}
|
|
1817
|
-
|
|
1801
|
+
if (!currencies || currencies.length === 0) {
|
|
1802
|
+
return /* @__PURE__ */ jsx16(
|
|
1803
|
+
ErrorModal,
|
|
1804
|
+
{
|
|
1805
|
+
isOpen: makeOfferModal$.isOpen.get(),
|
|
1806
|
+
chainId: Number(chainId),
|
|
1807
|
+
onClose: makeOfferModal$.close,
|
|
1808
|
+
title: "Make an offer",
|
|
1809
|
+
message: "No ERC-20s are configured for the marketplace, contact the marketplace owners"
|
|
1810
|
+
}
|
|
1811
|
+
);
|
|
1812
|
+
}
|
|
1818
1813
|
const ctas = [
|
|
1819
1814
|
{
|
|
1820
1815
|
label: "Approve TOKEN",
|
|
@@ -1822,17 +1817,16 @@ var Modal2 = observer7(() => {
|
|
|
1822
1817
|
hidden: !steps$.approval.exist.get(),
|
|
1823
1818
|
pending: steps$.approval.isExecuting.get(),
|
|
1824
1819
|
variant: "glass",
|
|
1825
|
-
disabled: invalidQuantity || isLoading || insufficientBalance ||
|
|
1820
|
+
disabled: invalidQuantity || isLoading || insufficientBalance || offerPrice2.amountRaw === "0" || !offerPriceChanged
|
|
1826
1821
|
},
|
|
1827
1822
|
{
|
|
1828
1823
|
label: "Make offer",
|
|
1829
1824
|
onClick: () => makeOffer(),
|
|
1830
1825
|
pending: steps$.transaction.isExecuting.get(),
|
|
1831
|
-
disabled: steps$.approval.isExecuting.get() || steps$.approval.exist.get() ||
|
|
1826
|
+
disabled: steps$.approval.isExecuting.get() || steps$.approval.exist.get() || offerPrice2.amountRaw === "0" || insufficientBalance || isLoading || invalidQuantity
|
|
1832
1827
|
}
|
|
1833
1828
|
];
|
|
1834
|
-
|
|
1835
|
-
return /* @__PURE__ */ jsx17(Fragment, { children: /* @__PURE__ */ jsxs10(
|
|
1829
|
+
return /* @__PURE__ */ jsx16(Fragment, { children: /* @__PURE__ */ jsxs9(
|
|
1836
1830
|
ActionModal,
|
|
1837
1831
|
{
|
|
1838
1832
|
isOpen: makeOfferModal$.isOpen.get(),
|
|
@@ -1841,7 +1835,7 @@ var Modal2 = observer7(() => {
|
|
|
1841
1835
|
title: "Make an offer",
|
|
1842
1836
|
ctas,
|
|
1843
1837
|
children: [
|
|
1844
|
-
/* @__PURE__ */
|
|
1838
|
+
/* @__PURE__ */ jsx16(
|
|
1845
1839
|
TokenPreview,
|
|
1846
1840
|
{
|
|
1847
1841
|
collectionName: collection?.name,
|
|
@@ -1850,21 +1844,21 @@ var Modal2 = observer7(() => {
|
|
|
1850
1844
|
chainId
|
|
1851
1845
|
}
|
|
1852
1846
|
),
|
|
1853
|
-
/* @__PURE__ */
|
|
1854
|
-
|
|
1847
|
+
/* @__PURE__ */ jsx16(
|
|
1848
|
+
PriceInput,
|
|
1855
1849
|
{
|
|
1856
1850
|
chainId,
|
|
1857
1851
|
collectionAddress,
|
|
1858
1852
|
$price: makeOfferModal$.offerPrice,
|
|
1859
1853
|
onPriceChange: () => makeOfferModal$.offerPriceChanged.set(true),
|
|
1860
|
-
|
|
1854
|
+
includeNativeCurrency: false,
|
|
1861
1855
|
checkBalance: {
|
|
1862
1856
|
enabled: true,
|
|
1863
1857
|
callback: (state2) => setInsufficientBalance(state2)
|
|
1864
1858
|
}
|
|
1865
1859
|
}
|
|
1866
1860
|
),
|
|
1867
|
-
collection?.type === "ERC1155" /* ERC1155 */ && /* @__PURE__ */
|
|
1861
|
+
collection?.type === "ERC1155" /* ERC1155 */ && /* @__PURE__ */ jsx16(
|
|
1868
1862
|
QuantityInput,
|
|
1869
1863
|
{
|
|
1870
1864
|
$quantity: makeOfferModal$.quantity,
|
|
@@ -1873,30 +1867,29 @@ var Modal2 = observer7(() => {
|
|
|
1873
1867
|
maxQuantity: String(Number.MAX_SAFE_INTEGER)
|
|
1874
1868
|
}
|
|
1875
1869
|
),
|
|
1876
|
-
|
|
1870
|
+
offerPrice2.amountRaw !== "0" && offerPriceChanged && !insufficientBalance && /* @__PURE__ */ jsx16(
|
|
1877
1871
|
FloorPriceText,
|
|
1878
1872
|
{
|
|
1879
1873
|
tokenId: collectibleId,
|
|
1880
1874
|
chainId,
|
|
1881
1875
|
collectionAddress,
|
|
1882
|
-
price:
|
|
1876
|
+
price: offerPrice2
|
|
1883
1877
|
}
|
|
1884
1878
|
),
|
|
1885
|
-
/* @__PURE__ */
|
|
1886
|
-
invalidCurrency && /* @__PURE__ */ jsx17(Box12, { color: "negative", fontSize: "small", children: "Native currency offers are not supported on this marketplace. Please select another currency to continue" })
|
|
1879
|
+
/* @__PURE__ */ jsx16(expirationDateSelect_default, { $date: makeOfferModal$.expiry })
|
|
1887
1880
|
]
|
|
1888
1881
|
}
|
|
1889
1882
|
) });
|
|
1890
1883
|
});
|
|
1891
1884
|
|
|
1892
1885
|
// src/react/ui/modals/SellModal/Modal.tsx
|
|
1893
|
-
import { Show as Show2, observer as
|
|
1886
|
+
import { Show as Show2, observer as observer6 } from "@legendapp/state/react";
|
|
1894
1887
|
import { parseUnits as parseUnits3 } from "viem";
|
|
1895
1888
|
|
|
1896
1889
|
// src/react/ui/modals/_internal/components/transactionDetails/index.tsx
|
|
1897
|
-
import { Box as
|
|
1890
|
+
import { Box as Box11, Image as Image3, Skeleton as Skeleton6, Text as Text9 } from "@0xsequence/design-system";
|
|
1898
1891
|
import { formatUnits as formatUnits3 } from "viem";
|
|
1899
|
-
import { jsx as
|
|
1892
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1900
1893
|
var DEFAULT_MARKETPLACE_FEE_PERCENTAGE = 2.5;
|
|
1901
1894
|
function TransactionDetails({
|
|
1902
1895
|
collectibleId,
|
|
@@ -1923,18 +1916,18 @@ function TransactionDetails({
|
|
|
1923
1916
|
if (marketplaceFeePercentage !== void 0 && formattedAmount && price) {
|
|
1924
1917
|
formattedAmount = (Number.parseFloat(formattedAmount) - Number.parseFloat(formattedAmount) * marketplaceFeePercentage / 100).toFixed(price.currency.decimals);
|
|
1925
1918
|
}
|
|
1926
|
-
return /* @__PURE__ */
|
|
1927
|
-
|
|
1919
|
+
return /* @__PURE__ */ jsxs10(
|
|
1920
|
+
Box11,
|
|
1928
1921
|
{
|
|
1929
1922
|
width: "full",
|
|
1930
1923
|
display: "flex",
|
|
1931
1924
|
justifyContent: "space-between",
|
|
1932
1925
|
alignItems: "center",
|
|
1933
1926
|
children: [
|
|
1934
|
-
/* @__PURE__ */
|
|
1935
|
-
/* @__PURE__ */
|
|
1936
|
-
/* @__PURE__ */
|
|
1937
|
-
priceLoading ? /* @__PURE__ */
|
|
1927
|
+
/* @__PURE__ */ jsx17(Text9, { fontSize: "small", color: "text50", fontFamily: "body", children: "Total earnings" }),
|
|
1928
|
+
/* @__PURE__ */ jsxs10(Box11, { display: "flex", alignItems: "center", gap: "2", children: [
|
|
1929
|
+
/* @__PURE__ */ jsx17(Image3, { src: currencyImageUrl, width: "3", height: "3" }),
|
|
1930
|
+
priceLoading ? /* @__PURE__ */ jsx17(Skeleton6, { width: "16", height: "4" }) : /* @__PURE__ */ jsxs10(Text9, { fontSize: "small", color: "text100", fontFamily: "body", children: [
|
|
1938
1931
|
showPlaceholderPrice ? "0" : formattedAmount,
|
|
1939
1932
|
" ",
|
|
1940
1933
|
price.currency.symbol
|
|
@@ -1946,17 +1939,17 @@ function TransactionDetails({
|
|
|
1946
1939
|
}
|
|
1947
1940
|
|
|
1948
1941
|
// src/react/ui/modals/_internal/components/transactionHeader/index.tsx
|
|
1949
|
-
import { Box as
|
|
1942
|
+
import { Box as Box12, Image as Image4, Skeleton as Skeleton7, Text as Text10 } from "@0xsequence/design-system";
|
|
1950
1943
|
import { formatDistanceToNow as formatDistanceToNow2 } from "date-fns";
|
|
1951
|
-
import { jsx as
|
|
1944
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1952
1945
|
function TransactionHeader({
|
|
1953
1946
|
title,
|
|
1954
1947
|
currencyImageUrl,
|
|
1955
1948
|
date
|
|
1956
1949
|
}) {
|
|
1957
|
-
return /* @__PURE__ */
|
|
1958
|
-
/* @__PURE__ */
|
|
1959
|
-
|
|
1950
|
+
return /* @__PURE__ */ jsxs11(Box12, { display: "flex", alignItems: "center", width: "full", children: [
|
|
1951
|
+
/* @__PURE__ */ jsx18(
|
|
1952
|
+
Text10,
|
|
1960
1953
|
{
|
|
1961
1954
|
fontSize: "small",
|
|
1962
1955
|
fontWeight: "medium",
|
|
@@ -1966,9 +1959,9 @@ function TransactionHeader({
|
|
|
1966
1959
|
children: title
|
|
1967
1960
|
}
|
|
1968
1961
|
),
|
|
1969
|
-
/* @__PURE__ */
|
|
1970
|
-
date && /* @__PURE__ */
|
|
1971
|
-
|
|
1962
|
+
/* @__PURE__ */ jsx18(Image4, { src: currencyImageUrl, width: "3", height: "3", marginRight: "1" }),
|
|
1963
|
+
date && /* @__PURE__ */ jsxs11(
|
|
1964
|
+
Text10,
|
|
1972
1965
|
{
|
|
1973
1966
|
fontSize: "small",
|
|
1974
1967
|
color: "text50",
|
|
@@ -1980,12 +1973,12 @@ function TransactionHeader({
|
|
|
1980
1973
|
" ago"
|
|
1981
1974
|
]
|
|
1982
1975
|
}
|
|
1983
|
-
) || /* @__PURE__ */
|
|
1976
|
+
) || /* @__PURE__ */ jsx18(Skeleton7, { width: "8", height: "4" })
|
|
1984
1977
|
] });
|
|
1985
1978
|
}
|
|
1986
1979
|
|
|
1987
1980
|
// src/react/ui/modals/SellModal/store.ts
|
|
1988
|
-
import { observable as
|
|
1981
|
+
import { observable as observable3 } from "@legendapp/state";
|
|
1989
1982
|
var initialState3 = {
|
|
1990
1983
|
isOpen: false,
|
|
1991
1984
|
collectionAddress: "",
|
|
@@ -2018,13 +2011,13 @@ var initialState3 = {
|
|
|
2018
2011
|
}
|
|
2019
2012
|
}
|
|
2020
2013
|
};
|
|
2021
|
-
var sellModal$ =
|
|
2014
|
+
var sellModal$ = observable3(initialState3);
|
|
2022
2015
|
|
|
2023
2016
|
// src/react/ui/modals/SellModal/hooks/useGetTokenApproval.tsx
|
|
2024
2017
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
2025
2018
|
|
|
2026
2019
|
// src/react/ui/modals/BuyModal/hooks/useFees.ts
|
|
2027
|
-
import { avalanche
|
|
2020
|
+
import { avalanche, optimism } from "viem/chains";
|
|
2028
2021
|
var useFees = ({
|
|
2029
2022
|
chainId,
|
|
2030
2023
|
collectionAddress
|
|
@@ -2036,7 +2029,7 @@ var useFees = ({
|
|
|
2036
2029
|
const collection = marketplaceConfig?.collections.find(
|
|
2037
2030
|
(collection2) => collection2.collectionAddress.toLowerCase() === collectionAddress.toLowerCase() && chainId === Number(collection2.chainId)
|
|
2038
2031
|
);
|
|
2039
|
-
const avalancheOrOptimism = chainId ===
|
|
2032
|
+
const avalancheOrOptimism = chainId === avalanche.id || chainId === optimism.id;
|
|
2040
2033
|
const receiver = avalancheOrOptimism ? avalancheAndOptimismPlatformFeeRecipient : defaultPlatformFeeRecipient;
|
|
2041
2034
|
const percentageToBPS = (percentage) => Number(percentage) * 1e4 / 100;
|
|
2042
2035
|
return {
|
|
@@ -2073,8 +2066,8 @@ var useGetTokenApprovalData2 = (params) => {
|
|
|
2073
2066
|
}
|
|
2074
2067
|
]
|
|
2075
2068
|
};
|
|
2076
|
-
const
|
|
2077
|
-
const tokenApprovalStep =
|
|
2069
|
+
const steps3 = await marketplaceClient.generateSellTransaction(args).then((resp) => resp.steps);
|
|
2070
|
+
const tokenApprovalStep = steps3.find(
|
|
2078
2071
|
(step) => step.id === "tokenApproval" /* tokenApproval */
|
|
2079
2072
|
);
|
|
2080
2073
|
if (!tokenApprovalStep) {
|
|
@@ -2110,22 +2103,21 @@ var useTransactionSteps2 = ({
|
|
|
2110
2103
|
const { show: showTransactionStatusModal } = useTransactionStatusModal();
|
|
2111
2104
|
const sdkConfig = useConfig();
|
|
2112
2105
|
const marketplaceClient = getMarketplaceClient(chainId, sdkConfig);
|
|
2113
|
-
const { waitForReceipt } = useGetReceiptFromHash();
|
|
2114
2106
|
const { amount, receiver } = useFees({
|
|
2115
2107
|
chainId: Number(chainId),
|
|
2116
2108
|
collectionAddress
|
|
2117
2109
|
});
|
|
2118
2110
|
const { generateSellTransactionAsync, isPending: generatingSteps } = useGenerateSellTransaction({
|
|
2119
2111
|
chainId,
|
|
2120
|
-
onSuccess: (
|
|
2121
|
-
if (!
|
|
2112
|
+
onSuccess: (steps3) => {
|
|
2113
|
+
if (!steps3) return;
|
|
2122
2114
|
}
|
|
2123
2115
|
});
|
|
2124
2116
|
const getSellSteps = async () => {
|
|
2125
2117
|
if (!wallet) return;
|
|
2126
2118
|
try {
|
|
2127
2119
|
const address = await wallet.address();
|
|
2128
|
-
const
|
|
2120
|
+
const steps3 = await generateSellTransactionAsync({
|
|
2129
2121
|
collectionAddress,
|
|
2130
2122
|
walletType: wallet.walletKind,
|
|
2131
2123
|
marketplace,
|
|
@@ -2138,7 +2130,7 @@ var useTransactionSteps2 = ({
|
|
|
2138
2130
|
],
|
|
2139
2131
|
seller: address
|
|
2140
2132
|
});
|
|
2141
|
-
return
|
|
2133
|
+
return steps3;
|
|
2142
2134
|
} catch (error) {
|
|
2143
2135
|
if (callbacks?.onError) {
|
|
2144
2136
|
callbacks.onError(error);
|
|
@@ -2152,17 +2144,15 @@ var useTransactionSteps2 = ({
|
|
|
2152
2144
|
try {
|
|
2153
2145
|
steps$.approval.isExecuting.set(true);
|
|
2154
2146
|
const approvalStep = await getSellSteps().then(
|
|
2155
|
-
(
|
|
2147
|
+
(steps3) => steps3?.find((step) => step.id === "tokenApproval" /* tokenApproval */)
|
|
2156
2148
|
);
|
|
2157
2149
|
const hash = await wallet.handleSendTransactionStep(
|
|
2158
2150
|
Number(chainId),
|
|
2159
2151
|
approvalStep
|
|
2160
2152
|
);
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
steps$.approval.exist.set(false);
|
|
2165
|
-
}
|
|
2153
|
+
await wallet.handleConfirmTransactionStep(hash, Number(chainId));
|
|
2154
|
+
steps$.approval.isExecuting.set(false);
|
|
2155
|
+
steps$.approval.exist.set(false);
|
|
2166
2156
|
} catch (error) {
|
|
2167
2157
|
steps$.approval.isExecuting.set(false);
|
|
2168
2158
|
}
|
|
@@ -2171,9 +2161,9 @@ var useTransactionSteps2 = ({
|
|
|
2171
2161
|
if (!wallet) return;
|
|
2172
2162
|
try {
|
|
2173
2163
|
steps$.transaction.isExecuting.set(true);
|
|
2174
|
-
const
|
|
2175
|
-
const transactionStep =
|
|
2176
|
-
const signatureStep =
|
|
2164
|
+
const steps3 = await getSellSteps();
|
|
2165
|
+
const transactionStep = steps3?.find((step) => step.id === "sell" /* sell */);
|
|
2166
|
+
const signatureStep = steps3?.find(
|
|
2177
2167
|
(step) => step.id === "signEIP712" /* signEIP712 */
|
|
2178
2168
|
);
|
|
2179
2169
|
console.debug("transactionStep", transactionStep);
|
|
@@ -2200,19 +2190,13 @@ var useTransactionSteps2 = ({
|
|
|
2200
2190
|
queriesToInvalidate: [balanceQueries.all, collectableKeys.userBalances]
|
|
2201
2191
|
});
|
|
2202
2192
|
if (hash) {
|
|
2203
|
-
await
|
|
2193
|
+
await wallet.handleConfirmTransactionStep(hash, Number(chainId));
|
|
2204
2194
|
steps$.transaction.isExecuting.set(false);
|
|
2205
2195
|
steps$.transaction.exist.set(false);
|
|
2206
|
-
if (callbacks?.onSuccess && typeof callbacks.onSuccess === "function") {
|
|
2207
|
-
callbacks.onSuccess({ hash });
|
|
2208
|
-
}
|
|
2209
2196
|
}
|
|
2210
2197
|
if (orderId) {
|
|
2211
2198
|
steps$.transaction.isExecuting.set(false);
|
|
2212
2199
|
steps$.transaction.exist.set(false);
|
|
2213
|
-
if (callbacks?.onSuccess && typeof callbacks.onSuccess === "function") {
|
|
2214
|
-
callbacks.onSuccess({ orderId });
|
|
2215
|
-
}
|
|
2216
2200
|
}
|
|
2217
2201
|
} catch (error) {
|
|
2218
2202
|
steps$.transaction.isExecuting.set(false);
|
|
@@ -2254,7 +2238,7 @@ var useTransactionSteps2 = ({
|
|
|
2254
2238
|
};
|
|
2255
2239
|
|
|
2256
2240
|
// src/react/ui/modals/SellModal/hooks/useSell.tsx
|
|
2257
|
-
import { useEffect as
|
|
2241
|
+
import { useEffect as useEffect5 } from "react";
|
|
2258
2242
|
var useSell = ({
|
|
2259
2243
|
collectibleId,
|
|
2260
2244
|
chainId,
|
|
@@ -2271,7 +2255,7 @@ var useSell = ({
|
|
|
2271
2255
|
ordersData,
|
|
2272
2256
|
marketplace
|
|
2273
2257
|
});
|
|
2274
|
-
|
|
2258
|
+
useEffect5(() => {
|
|
2275
2259
|
if (tokenApproval?.step && !tokenApprovalIsLoading) {
|
|
2276
2260
|
steps$.approval.exist.set(true);
|
|
2277
2261
|
}
|
|
@@ -2296,11 +2280,11 @@ var useSell = ({
|
|
|
2296
2280
|
};
|
|
2297
2281
|
|
|
2298
2282
|
// src/react/ui/modals/SellModal/Modal.tsx
|
|
2299
|
-
import { jsx as
|
|
2283
|
+
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2300
2284
|
var SellModal = () => {
|
|
2301
|
-
return /* @__PURE__ */
|
|
2285
|
+
return /* @__PURE__ */ jsx19(Show2, { if: sellModal$.isOpen, children: () => /* @__PURE__ */ jsx19(Modal2, {}) });
|
|
2302
2286
|
};
|
|
2303
|
-
var
|
|
2287
|
+
var Modal2 = observer6(() => {
|
|
2304
2288
|
const { tokenId, collectionAddress, chainId, order, callbacks } = sellModal$.get();
|
|
2305
2289
|
const steps$ = sellModal$.steps;
|
|
2306
2290
|
const { data: collectible } = useCollection({
|
|
@@ -2342,7 +2326,7 @@ var Modal3 = observer8(() => {
|
|
|
2342
2326
|
steps$
|
|
2343
2327
|
});
|
|
2344
2328
|
if (collectionLoading || currencyLoading) {
|
|
2345
|
-
return /* @__PURE__ */
|
|
2329
|
+
return /* @__PURE__ */ jsx19(
|
|
2346
2330
|
LoadingModal,
|
|
2347
2331
|
{
|
|
2348
2332
|
isOpen: sellModal$.isOpen.get(),
|
|
@@ -2353,7 +2337,7 @@ var Modal3 = observer8(() => {
|
|
|
2353
2337
|
);
|
|
2354
2338
|
}
|
|
2355
2339
|
if (collectionError || order === void 0 || currencyError) {
|
|
2356
|
-
return /* @__PURE__ */
|
|
2340
|
+
return /* @__PURE__ */ jsx19(
|
|
2357
2341
|
ErrorModal,
|
|
2358
2342
|
{
|
|
2359
2343
|
isOpen: sellModal$.isOpen.get(),
|
|
@@ -2376,10 +2360,10 @@ var Modal3 = observer8(() => {
|
|
|
2376
2360
|
label: "Accept",
|
|
2377
2361
|
onClick: () => sell(),
|
|
2378
2362
|
pending: steps$.transaction.isExecuting.get(),
|
|
2379
|
-
disabled: steps$.approval.isExecuting.get() || steps$.approval.exist.get() || order?.quantityRemaining === "0"
|
|
2363
|
+
disabled: isLoading || steps$.approval.isExecuting.get() || steps$.approval.exist.get() || order?.quantityRemaining === "0"
|
|
2380
2364
|
}
|
|
2381
2365
|
];
|
|
2382
|
-
return /* @__PURE__ */
|
|
2366
|
+
return /* @__PURE__ */ jsxs12(
|
|
2383
2367
|
ActionModal,
|
|
2384
2368
|
{
|
|
2385
2369
|
isOpen: sellModal$.isOpen.get(),
|
|
@@ -2388,7 +2372,7 @@ var Modal3 = observer8(() => {
|
|
|
2388
2372
|
title: "You have an offer",
|
|
2389
2373
|
ctas,
|
|
2390
2374
|
children: [
|
|
2391
|
-
/* @__PURE__ */
|
|
2375
|
+
/* @__PURE__ */ jsx19(
|
|
2392
2376
|
TransactionHeader,
|
|
2393
2377
|
{
|
|
2394
2378
|
title: "Offer received",
|
|
@@ -2396,7 +2380,7 @@ var Modal3 = observer8(() => {
|
|
|
2396
2380
|
date: order && new Date(order.createdAt)
|
|
2397
2381
|
}
|
|
2398
2382
|
),
|
|
2399
|
-
/* @__PURE__ */
|
|
2383
|
+
/* @__PURE__ */ jsx19(
|
|
2400
2384
|
TokenPreview,
|
|
2401
2385
|
{
|
|
2402
2386
|
collectionName: collection?.name,
|
|
@@ -2405,7 +2389,7 @@ var Modal3 = observer8(() => {
|
|
|
2405
2389
|
chainId
|
|
2406
2390
|
}
|
|
2407
2391
|
),
|
|
2408
|
-
/* @__PURE__ */
|
|
2392
|
+
/* @__PURE__ */ jsx19(
|
|
2409
2393
|
TransactionDetails,
|
|
2410
2394
|
{
|
|
2411
2395
|
collectibleId: tokenId,
|
|
@@ -2425,19 +2409,19 @@ var Modal3 = observer8(() => {
|
|
|
2425
2409
|
|
|
2426
2410
|
// src/react/ui/modals/SuccessfulPurchaseModal/index.tsx
|
|
2427
2411
|
import {
|
|
2428
|
-
Box as
|
|
2429
|
-
Button as
|
|
2412
|
+
Box as Box13,
|
|
2413
|
+
Button as Button2,
|
|
2430
2414
|
CloseIcon as CloseIcon2,
|
|
2431
2415
|
ExternalLinkIcon,
|
|
2432
2416
|
IconButton as IconButton3,
|
|
2433
2417
|
Image as Image5,
|
|
2434
|
-
Text as
|
|
2418
|
+
Text as Text11
|
|
2435
2419
|
} from "@0xsequence/design-system";
|
|
2436
|
-
import { observer as
|
|
2420
|
+
import { observer as observer7 } from "@legendapp/state/react";
|
|
2437
2421
|
import { Close as Close2, Content as Content3, Overlay as Overlay2, Portal as Portal3, Root as Root3 } from "@radix-ui/react-dialog";
|
|
2438
2422
|
|
|
2439
2423
|
// src/react/ui/modals/SuccessfulPurchaseModal/_store.ts
|
|
2440
|
-
import { observable as
|
|
2424
|
+
import { observable as observable4 } from "@legendapp/state";
|
|
2441
2425
|
var initialState4 = {
|
|
2442
2426
|
isOpen: false,
|
|
2443
2427
|
open: ({
|
|
@@ -2476,23 +2460,23 @@ var initialState4 = {
|
|
|
2476
2460
|
},
|
|
2477
2461
|
callbacks: void 0
|
|
2478
2462
|
};
|
|
2479
|
-
var successfulPurchaseModal$ =
|
|
2463
|
+
var successfulPurchaseModal$ = observable4(initialState4);
|
|
2480
2464
|
|
|
2481
2465
|
// src/react/ui/modals/SuccessfulPurchaseModal/index.tsx
|
|
2482
|
-
import { jsx as
|
|
2466
|
+
import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2483
2467
|
var useSuccessfulPurchaseModal = (callbacks) => {
|
|
2484
2468
|
return {
|
|
2485
2469
|
show: (args) => successfulPurchaseModal$.open({ ...args, defaultCallbacks: callbacks }),
|
|
2486
2470
|
close: () => successfulPurchaseModal$.close()
|
|
2487
2471
|
};
|
|
2488
2472
|
};
|
|
2489
|
-
var SuccessfulPurchaseModal =
|
|
2490
|
-
return /* @__PURE__ */
|
|
2491
|
-
/* @__PURE__ */
|
|
2492
|
-
/* @__PURE__ */
|
|
2493
|
-
/* @__PURE__ */
|
|
2494
|
-
/* @__PURE__ */
|
|
2495
|
-
|
|
2473
|
+
var SuccessfulPurchaseModal = observer7(() => {
|
|
2474
|
+
return /* @__PURE__ */ jsx20(Root3, { open: successfulPurchaseModal$.isOpen.get(), children: /* @__PURE__ */ jsxs13(Portal3, { children: [
|
|
2475
|
+
/* @__PURE__ */ jsx20(Overlay2, { className: dialogOverlay }),
|
|
2476
|
+
/* @__PURE__ */ jsxs13(Content3, { className: dialogContent.narrow, children: [
|
|
2477
|
+
/* @__PURE__ */ jsxs13(Box13, { display: "flex", flexDirection: "column", gap: "4", width: "full", children: [
|
|
2478
|
+
/* @__PURE__ */ jsx20(
|
|
2479
|
+
Text11,
|
|
2496
2480
|
{
|
|
2497
2481
|
textAlign: "center",
|
|
2498
2482
|
fontSize: "medium",
|
|
@@ -2501,21 +2485,21 @@ var SuccessfulPurchaseModal = observer9(() => {
|
|
|
2501
2485
|
children: "Successful purchase!"
|
|
2502
2486
|
}
|
|
2503
2487
|
),
|
|
2504
|
-
/* @__PURE__ */
|
|
2488
|
+
/* @__PURE__ */ jsx20(
|
|
2505
2489
|
CollectiblesGrid,
|
|
2506
2490
|
{
|
|
2507
2491
|
collectibles: successfulPurchaseModal$.state.get().collectibles
|
|
2508
2492
|
}
|
|
2509
2493
|
),
|
|
2510
|
-
/* @__PURE__ */
|
|
2511
|
-
/* @__PURE__ */
|
|
2512
|
-
/* @__PURE__ */
|
|
2513
|
-
/* @__PURE__ */
|
|
2514
|
-
/* @__PURE__ */
|
|
2494
|
+
/* @__PURE__ */ jsxs13(Box13, { display: "flex", alignItems: "center", gap: "1", children: [
|
|
2495
|
+
/* @__PURE__ */ jsx20(Text11, { fontSize: "normal", fontWeight: "medium", color: "text80", children: "You bought" }),
|
|
2496
|
+
/* @__PURE__ */ jsx20(Text11, { fontSize: "normal", fontWeight: "medium", color: "text100", children: successfulPurchaseModal$.state.get().collectibles.length }),
|
|
2497
|
+
/* @__PURE__ */ jsx20(Text11, { fontSize: "normal", fontWeight: "medium", color: "text80", children: "items for" }),
|
|
2498
|
+
/* @__PURE__ */ jsx20(Text11, { fontSize: "normal", fontWeight: "medium", color: "text100", children: successfulPurchaseModal$.state.get().totalPrice })
|
|
2515
2499
|
] }),
|
|
2516
|
-
/* @__PURE__ */
|
|
2500
|
+
/* @__PURE__ */ jsx20(SuccessfulPurchaseActions, {})
|
|
2517
2501
|
] }),
|
|
2518
|
-
/* @__PURE__ */
|
|
2502
|
+
/* @__PURE__ */ jsx20(
|
|
2519
2503
|
Close2,
|
|
2520
2504
|
{
|
|
2521
2505
|
onClick: () => {
|
|
@@ -2523,16 +2507,16 @@ var SuccessfulPurchaseModal = observer9(() => {
|
|
|
2523
2507
|
},
|
|
2524
2508
|
className: closeButton,
|
|
2525
2509
|
asChild: true,
|
|
2526
|
-
children: /* @__PURE__ */
|
|
2510
|
+
children: /* @__PURE__ */ jsx20(IconButton3, { size: "xs", "aria-label": "Close modal", icon: CloseIcon2 })
|
|
2527
2511
|
}
|
|
2528
2512
|
)
|
|
2529
2513
|
] })
|
|
2530
2514
|
] }) });
|
|
2531
2515
|
});
|
|
2532
2516
|
function SuccessfulPurchaseActions() {
|
|
2533
|
-
return /* @__PURE__ */
|
|
2534
|
-
successfulPurchaseModal$.state.ctaOptions.get() && /* @__PURE__ */
|
|
2535
|
-
|
|
2517
|
+
return /* @__PURE__ */ jsxs13(Box13, { display: "flex", flexDirection: "column", gap: "2", children: [
|
|
2518
|
+
successfulPurchaseModal$.state.ctaOptions.get() && /* @__PURE__ */ jsx20(
|
|
2519
|
+
Button2,
|
|
2536
2520
|
{
|
|
2537
2521
|
shape: "square",
|
|
2538
2522
|
leftIcon: successfulPurchaseModal$.state.ctaOptions.ctaIcon.get() || void 0,
|
|
@@ -2541,8 +2525,8 @@ function SuccessfulPurchaseActions() {
|
|
|
2541
2525
|
onClick: successfulPurchaseModal$.state.ctaOptions.ctaOnClick.get() || void 0
|
|
2542
2526
|
}
|
|
2543
2527
|
),
|
|
2544
|
-
/* @__PURE__ */
|
|
2545
|
-
|
|
2528
|
+
/* @__PURE__ */ jsx20(
|
|
2529
|
+
Button2,
|
|
2546
2530
|
{
|
|
2547
2531
|
as: "a",
|
|
2548
2532
|
href: successfulPurchaseModal$.state.explorerUrl.get(),
|
|
@@ -2559,15 +2543,15 @@ function SuccessfulPurchaseActions() {
|
|
|
2559
2543
|
function CollectiblesGrid({ collectibles }) {
|
|
2560
2544
|
const total = collectibles.length;
|
|
2561
2545
|
const shownCollectibles = total > 4 ? collectibles.slice(0, 4) : collectibles;
|
|
2562
|
-
return /* @__PURE__ */
|
|
2546
|
+
return /* @__PURE__ */ jsx20(Box13, { className: collectiblesGrid, display: "grid", gap: "2", children: shownCollectibles.map((collectible) => {
|
|
2563
2547
|
const showPlus = total > 4 && collectibles.indexOf(collectible) === 3;
|
|
2564
|
-
return /* @__PURE__ */
|
|
2565
|
-
|
|
2548
|
+
return /* @__PURE__ */ jsxs13(
|
|
2549
|
+
Box13,
|
|
2566
2550
|
{
|
|
2567
2551
|
className: collectiblesGridItem,
|
|
2568
2552
|
position: "relative",
|
|
2569
2553
|
children: [
|
|
2570
|
-
/* @__PURE__ */
|
|
2554
|
+
/* @__PURE__ */ jsx20(
|
|
2571
2555
|
Image5,
|
|
2572
2556
|
{
|
|
2573
2557
|
src: collectible.image,
|
|
@@ -2578,8 +2562,8 @@ function CollectiblesGrid({ collectibles }) {
|
|
|
2578
2562
|
borderRadius: "sm"
|
|
2579
2563
|
}
|
|
2580
2564
|
),
|
|
2581
|
-
showPlus && /* @__PURE__ */
|
|
2582
|
-
|
|
2565
|
+
showPlus && /* @__PURE__ */ jsx20(
|
|
2566
|
+
Box13,
|
|
2583
2567
|
{
|
|
2584
2568
|
position: "absolute",
|
|
2585
2569
|
top: "0",
|
|
@@ -2591,8 +2575,8 @@ function CollectiblesGrid({ collectibles }) {
|
|
|
2591
2575
|
justifyContent: "center",
|
|
2592
2576
|
background: "backgroundOverlay",
|
|
2593
2577
|
backdropFilter: "blur",
|
|
2594
|
-
children: /* @__PURE__ */
|
|
2595
|
-
|
|
2578
|
+
children: /* @__PURE__ */ jsxs13(
|
|
2579
|
+
Text11,
|
|
2596
2580
|
{
|
|
2597
2581
|
fontSize: "small",
|
|
2598
2582
|
fontWeight: "medium",
|
|
@@ -2620,12 +2604,12 @@ var SuccessfulPurchaseModal_default = SuccessfulPurchaseModal;
|
|
|
2620
2604
|
|
|
2621
2605
|
// src/react/ui/modals/TransferModal/index.tsx
|
|
2622
2606
|
import { CloseIcon as CloseIcon3, IconButton as IconButton4 } from "@0xsequence/design-system";
|
|
2623
|
-
import { Show as Show3, observer as
|
|
2607
|
+
import { Show as Show3, observer as observer9 } from "@legendapp/state/react";
|
|
2624
2608
|
import { Close as Close3, Content as Content4, Overlay as Overlay3, Portal as Portal4, Root as Root4 } from "@radix-ui/react-dialog";
|
|
2625
|
-
import { useAccount as
|
|
2609
|
+
import { useAccount as useAccount3 } from "wagmi";
|
|
2626
2610
|
|
|
2627
2611
|
// src/react/ui/modals/TransferModal/_store.ts
|
|
2628
|
-
import { observable as
|
|
2612
|
+
import { observable as observable5 } from "@legendapp/state";
|
|
2629
2613
|
var initialState5 = {
|
|
2630
2614
|
isOpen: false,
|
|
2631
2615
|
open: ({
|
|
@@ -2661,13 +2645,13 @@ var initialState5 = {
|
|
|
2661
2645
|
view: "enterReceiverAddress",
|
|
2662
2646
|
hash: void 0
|
|
2663
2647
|
};
|
|
2664
|
-
var transferModal$ =
|
|
2648
|
+
var transferModal$ = observable5(initialState5);
|
|
2665
2649
|
|
|
2666
2650
|
// src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx
|
|
2667
|
-
import { Box as
|
|
2668
|
-
import { observable as
|
|
2651
|
+
import { Box as Box14, Button as Button3, Text as Text12, TextInput } from "@0xsequence/design-system";
|
|
2652
|
+
import { observable as observable6 } from "@legendapp/state";
|
|
2669
2653
|
import { isAddress } from "viem";
|
|
2670
|
-
import { useAccount as
|
|
2654
|
+
import { useAccount as useAccount2 } from "wagmi";
|
|
2671
2655
|
|
|
2672
2656
|
// src/react/ui/modals/TransferModal/messages.ts
|
|
2673
2657
|
var baseMessages = {
|
|
@@ -2736,12 +2720,12 @@ var useHandleTransfer = () => {
|
|
|
2736
2720
|
var useHandleTransfer_default = useHandleTransfer;
|
|
2737
2721
|
|
|
2738
2722
|
// src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx
|
|
2739
|
-
import { Fragment as Fragment2, jsx as
|
|
2723
|
+
import { Fragment as Fragment2, jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2740
2724
|
var EnterWalletAddressView = () => {
|
|
2741
|
-
const { address } =
|
|
2725
|
+
const { address } = useAccount2();
|
|
2742
2726
|
const { collectionAddress, collectibleId, chainId, collectionType } = transferModal$.state.get();
|
|
2743
2727
|
const $quantity = transferModal$.state.quantity;
|
|
2744
|
-
const $invalidQuantity =
|
|
2728
|
+
const $invalidQuantity = observable6(false);
|
|
2745
2729
|
const isWalletAddressValid = isAddress(
|
|
2746
2730
|
transferModal$.state.receiverAddress.get()
|
|
2747
2731
|
);
|
|
@@ -2769,17 +2753,17 @@ var EnterWalletAddressView = () => {
|
|
|
2769
2753
|
transfer();
|
|
2770
2754
|
transferModal$.view.set("followWalletInstructions");
|
|
2771
2755
|
}
|
|
2772
|
-
return /* @__PURE__ */
|
|
2773
|
-
/* @__PURE__ */
|
|
2774
|
-
/* @__PURE__ */
|
|
2775
|
-
/* @__PURE__ */
|
|
2756
|
+
return /* @__PURE__ */ jsxs14(Box14, { display: "grid", gap: "6", flexGrow: "1", children: [
|
|
2757
|
+
/* @__PURE__ */ jsx21(Text12, { color: "white", fontSize: "large", fontWeight: "bold", fontFamily: "body", children: "Transfer your item" }),
|
|
2758
|
+
/* @__PURE__ */ jsxs14(Box14, { display: "flex", flexDirection: "column", gap: "3", children: [
|
|
2759
|
+
/* @__PURE__ */ jsx21(
|
|
2776
2760
|
AlertMessage,
|
|
2777
2761
|
{
|
|
2778
2762
|
message: getMessage("enterReceiverAddress"),
|
|
2779
2763
|
type: "warning"
|
|
2780
2764
|
}
|
|
2781
2765
|
),
|
|
2782
|
-
/* @__PURE__ */
|
|
2766
|
+
/* @__PURE__ */ jsx21(
|
|
2783
2767
|
TextInput,
|
|
2784
2768
|
{
|
|
2785
2769
|
label: "Wallet address",
|
|
@@ -2790,8 +2774,8 @@ var EnterWalletAddressView = () => {
|
|
|
2790
2774
|
placeholder: "Enter wallet address of recipient"
|
|
2791
2775
|
}
|
|
2792
2776
|
),
|
|
2793
|
-
collectionType === "ERC1155" /* ERC1155 */ && balanceAmount && /* @__PURE__ */
|
|
2794
|
-
/* @__PURE__ */
|
|
2777
|
+
collectionType === "ERC1155" /* ERC1155 */ && balanceAmount && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
2778
|
+
/* @__PURE__ */ jsx21(
|
|
2795
2779
|
QuantityInput,
|
|
2796
2780
|
{
|
|
2797
2781
|
$quantity,
|
|
@@ -2800,8 +2784,8 @@ var EnterWalletAddressView = () => {
|
|
|
2800
2784
|
maxQuantity: balanceAmount
|
|
2801
2785
|
}
|
|
2802
2786
|
),
|
|
2803
|
-
/* @__PURE__ */
|
|
2804
|
-
|
|
2787
|
+
/* @__PURE__ */ jsx21(
|
|
2788
|
+
Text12,
|
|
2805
2789
|
{
|
|
2806
2790
|
color: insufficientBalance ? "negative" : "text50",
|
|
2807
2791
|
fontSize: "small",
|
|
@@ -2812,8 +2796,8 @@ var EnterWalletAddressView = () => {
|
|
|
2812
2796
|
)
|
|
2813
2797
|
] })
|
|
2814
2798
|
] }),
|
|
2815
|
-
/* @__PURE__ */
|
|
2816
|
-
|
|
2799
|
+
/* @__PURE__ */ jsx21(
|
|
2800
|
+
Button3,
|
|
2817
2801
|
{
|
|
2818
2802
|
onClick: handleChangeView,
|
|
2819
2803
|
disabled: !isWalletAddressValid || insufficientBalance || !$quantity.get(),
|
|
@@ -2831,21 +2815,21 @@ var EnterWalletAddressView = () => {
|
|
|
2831
2815
|
var enterWalletAddress_default = EnterWalletAddressView;
|
|
2832
2816
|
|
|
2833
2817
|
// src/react/ui/modals/TransferModal/_views/followWalletInstructions/index.tsx
|
|
2834
|
-
import { Box as
|
|
2835
|
-
import { observer as
|
|
2836
|
-
import { jsx as
|
|
2837
|
-
var FollowWalletInstructionsView =
|
|
2838
|
-
return /* @__PURE__ */
|
|
2839
|
-
/* @__PURE__ */
|
|
2840
|
-
/* @__PURE__ */
|
|
2818
|
+
import { Box as Box15, Button as Button4, Text as Text13 } from "@0xsequence/design-system";
|
|
2819
|
+
import { observer as observer8 } from "@legendapp/state/react";
|
|
2820
|
+
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2821
|
+
var FollowWalletInstructionsView = observer8(() => {
|
|
2822
|
+
return /* @__PURE__ */ jsxs15(Box15, { display: "grid", gap: "6", flexGrow: "1", children: [
|
|
2823
|
+
/* @__PURE__ */ jsx22(Text13, { color: "white", fontSize: "large", fontWeight: "bold", fontFamily: "body", children: "Transfer your item" }),
|
|
2824
|
+
/* @__PURE__ */ jsx22(Box15, { display: "flex", flexDirection: "column", gap: "3", children: /* @__PURE__ */ jsx22(
|
|
2841
2825
|
AlertMessage,
|
|
2842
2826
|
{
|
|
2843
2827
|
message: getMessage("followWalletInstructions"),
|
|
2844
2828
|
type: "info"
|
|
2845
2829
|
}
|
|
2846
2830
|
) }),
|
|
2847
|
-
/* @__PURE__ */
|
|
2848
|
-
|
|
2831
|
+
/* @__PURE__ */ jsx22(
|
|
2832
|
+
Button4,
|
|
2849
2833
|
{
|
|
2850
2834
|
disabled: true,
|
|
2851
2835
|
title: "Transfer",
|
|
@@ -2862,9 +2846,9 @@ var FollowWalletInstructionsView = observer10(() => {
|
|
|
2862
2846
|
var followWalletInstructions_default = FollowWalletInstructionsView;
|
|
2863
2847
|
|
|
2864
2848
|
// src/react/ui/modals/TransferModal/index.tsx
|
|
2865
|
-
import { jsx as
|
|
2849
|
+
import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2866
2850
|
var useTransferModal = () => {
|
|
2867
|
-
const { chainId: accountChainId } =
|
|
2851
|
+
const { chainId: accountChainId } = useAccount3();
|
|
2868
2852
|
const { show: showSwitchNetworkModal } = useSwitchChainModal();
|
|
2869
2853
|
const openModal = (args) => {
|
|
2870
2854
|
transferModal$.open(args);
|
|
@@ -2898,41 +2882,59 @@ var useTransferModal = () => {
|
|
|
2898
2882
|
};
|
|
2899
2883
|
};
|
|
2900
2884
|
var TransferModal = () => {
|
|
2901
|
-
return /* @__PURE__ */
|
|
2885
|
+
return /* @__PURE__ */ jsx23(Show3, { if: transferModal$.isOpen, children: /* @__PURE__ */ jsx23(Modal3, {}) });
|
|
2902
2886
|
};
|
|
2903
|
-
var
|
|
2904
|
-
return /* @__PURE__ */
|
|
2887
|
+
var Modal3 = () => {
|
|
2888
|
+
return /* @__PURE__ */ jsx23(ModalContent, {});
|
|
2905
2889
|
};
|
|
2906
|
-
var ModalContent =
|
|
2907
|
-
return /* @__PURE__ */
|
|
2908
|
-
/* @__PURE__ */
|
|
2909
|
-
/* @__PURE__ */
|
|
2910
|
-
/* @__PURE__ */
|
|
2911
|
-
/* @__PURE__ */
|
|
2890
|
+
var ModalContent = observer9(() => {
|
|
2891
|
+
return /* @__PURE__ */ jsx23(Root4, { open: true, children: /* @__PURE__ */ jsxs16(Portal4, { children: [
|
|
2892
|
+
/* @__PURE__ */ jsx23(Overlay3, { className: dialogOverlay2 }),
|
|
2893
|
+
/* @__PURE__ */ jsxs16(Content4, { className: transferModalContent, children: [
|
|
2894
|
+
/* @__PURE__ */ jsx23(TransactionModalView, {}),
|
|
2895
|
+
/* @__PURE__ */ jsx23(Close3, { onClick: transferModal$.close, className: closeButton2, asChild: true, children: /* @__PURE__ */ jsx23(IconButton4, { size: "xs", "aria-label": "Close modal", icon: CloseIcon3 }) })
|
|
2912
2896
|
] })
|
|
2913
2897
|
] }) });
|
|
2914
2898
|
});
|
|
2915
|
-
var TransactionModalView =
|
|
2899
|
+
var TransactionModalView = observer9(() => {
|
|
2916
2900
|
const { view } = transferModal$.get();
|
|
2917
2901
|
switch (view) {
|
|
2918
2902
|
case "enterReceiverAddress":
|
|
2919
|
-
return /* @__PURE__ */
|
|
2903
|
+
return /* @__PURE__ */ jsx23(enterWalletAddress_default, {});
|
|
2920
2904
|
case "followWalletInstructions":
|
|
2921
|
-
return /* @__PURE__ */
|
|
2905
|
+
return /* @__PURE__ */ jsx23(followWalletInstructions_default, {});
|
|
2922
2906
|
default:
|
|
2923
2907
|
return null;
|
|
2924
2908
|
}
|
|
2925
2909
|
});
|
|
2926
2910
|
|
|
2927
2911
|
// src/react/ui/modals/CreateListingModal/Modal.tsx
|
|
2928
|
-
import { Box as
|
|
2929
|
-
import { Show as Show4, observer as
|
|
2912
|
+
import { Box as Box16 } from "@0xsequence/design-system";
|
|
2913
|
+
import { Show as Show4, observer as observer10 } from "@legendapp/state/react";
|
|
2930
2914
|
import { parseUnits as parseUnits4 } from "viem";
|
|
2931
|
-
import { useAccount as
|
|
2915
|
+
import { useAccount as useAccount4 } from "wagmi";
|
|
2932
2916
|
|
|
2933
2917
|
// src/react/ui/modals/CreateListingModal/store.ts
|
|
2934
|
-
import { observable as
|
|
2918
|
+
import { observable as observable7 } from "@legendapp/state";
|
|
2935
2919
|
import { addDays as addDays3 } from "date-fns/addDays";
|
|
2920
|
+
var listingPrice = {
|
|
2921
|
+
amountRaw: "0",
|
|
2922
|
+
currency: {}
|
|
2923
|
+
};
|
|
2924
|
+
var approval2 = {
|
|
2925
|
+
exist: false,
|
|
2926
|
+
isExecuting: false,
|
|
2927
|
+
execute: () => Promise.resolve()
|
|
2928
|
+
};
|
|
2929
|
+
var transaction2 = {
|
|
2930
|
+
exist: false,
|
|
2931
|
+
isExecuting: false,
|
|
2932
|
+
execute: () => Promise.resolve()
|
|
2933
|
+
};
|
|
2934
|
+
var steps2 = {
|
|
2935
|
+
approval: { ...approval2 },
|
|
2936
|
+
transaction: { ...transaction2 }
|
|
2937
|
+
};
|
|
2936
2938
|
var initialState6 = {
|
|
2937
2939
|
isOpen: false,
|
|
2938
2940
|
collectionAddress: "",
|
|
@@ -2941,26 +2943,12 @@ var initialState6 = {
|
|
|
2941
2943
|
orderbookKind: "sequence_marketplace_v2" /* sequence_marketplace_v2 */,
|
|
2942
2944
|
collectionName: "",
|
|
2943
2945
|
collectionType: void 0,
|
|
2944
|
-
listingPrice: {
|
|
2945
|
-
amountRaw: "0",
|
|
2946
|
-
currency: {}
|
|
2947
|
-
},
|
|
2946
|
+
listingPrice: { ...listingPrice },
|
|
2948
2947
|
quantity: "1",
|
|
2949
2948
|
invalidQuantity: false,
|
|
2950
2949
|
expiry: new Date(addDays3(/* @__PURE__ */ new Date(), 7).toJSON()),
|
|
2951
2950
|
callbacks: void 0,
|
|
2952
|
-
steps: {
|
|
2953
|
-
approval: {
|
|
2954
|
-
exist: false,
|
|
2955
|
-
isExecuting: false,
|
|
2956
|
-
execute: () => Promise.resolve()
|
|
2957
|
-
},
|
|
2958
|
-
transaction: {
|
|
2959
|
-
exist: false,
|
|
2960
|
-
isExecuting: false,
|
|
2961
|
-
execute: () => Promise.resolve()
|
|
2962
|
-
}
|
|
2963
|
-
}
|
|
2951
|
+
steps: { ...steps2 }
|
|
2964
2952
|
};
|
|
2965
2953
|
var actions2 = {
|
|
2966
2954
|
open: (args) => {
|
|
@@ -2974,15 +2962,17 @@ var actions2 = {
|
|
|
2974
2962
|
close: () => {
|
|
2975
2963
|
createListingModal$.isOpen.set(false);
|
|
2976
2964
|
createListingModal$.set({ ...initialState6, ...actions2 });
|
|
2965
|
+
createListingModal$.listingPrice.set({ ...listingPrice });
|
|
2966
|
+
createListingModal$.steps.set({ ...steps2 });
|
|
2977
2967
|
}
|
|
2978
2968
|
};
|
|
2979
|
-
var createListingModal$ =
|
|
2969
|
+
var createListingModal$ = observable7({
|
|
2980
2970
|
...initialState6,
|
|
2981
2971
|
...actions2
|
|
2982
2972
|
});
|
|
2983
2973
|
|
|
2984
2974
|
// src/react/ui/modals/CreateListingModal/hooks/useCreateListing.tsx
|
|
2985
|
-
import { useEffect as
|
|
2975
|
+
import { useEffect as useEffect6 } from "react";
|
|
2986
2976
|
|
|
2987
2977
|
// src/react/ui/modals/CreateListingModal/hooks/useGetTokenApproval.ts
|
|
2988
2978
|
import { skipToken as skipToken2, useQuery as useQuery3 } from "@tanstack/react-query";
|
|
@@ -3010,8 +3000,8 @@ var useGetTokenApprovalData3 = (params) => {
|
|
|
3010
3000
|
orderbook: params.orderbook,
|
|
3011
3001
|
listing
|
|
3012
3002
|
};
|
|
3013
|
-
const
|
|
3014
|
-
const tokenApprovalStep =
|
|
3003
|
+
const steps3 = await marketplaceClient.generateListingTransaction(args).then((resp) => resp.steps);
|
|
3004
|
+
const tokenApprovalStep = steps3.find(
|
|
3015
3005
|
(step) => step.id === "tokenApproval" /* tokenApproval */
|
|
3016
3006
|
);
|
|
3017
3007
|
if (!tokenApprovalStep) {
|
|
@@ -3046,18 +3036,17 @@ var useTransactionSteps3 = ({
|
|
|
3046
3036
|
const { show: showTransactionStatusModal } = useTransactionStatusModal();
|
|
3047
3037
|
const sdkConfig = useConfig();
|
|
3048
3038
|
const marketplaceClient = getMarketplaceClient(chainId, sdkConfig);
|
|
3049
|
-
const { waitForReceipt } = useGetReceiptFromHash();
|
|
3050
3039
|
const { generateListingTransactionAsync, isPending: generatingSteps } = useGenerateListingTransaction({
|
|
3051
3040
|
chainId,
|
|
3052
|
-
onSuccess: (
|
|
3053
|
-
if (!
|
|
3041
|
+
onSuccess: (steps3) => {
|
|
3042
|
+
if (!steps3) return;
|
|
3054
3043
|
}
|
|
3055
3044
|
});
|
|
3056
3045
|
const getListingSteps = async () => {
|
|
3057
3046
|
if (!wallet) return;
|
|
3058
3047
|
try {
|
|
3059
3048
|
const address = await wallet.address();
|
|
3060
|
-
const
|
|
3049
|
+
const steps3 = await generateListingTransactionAsync({
|
|
3061
3050
|
collectionAddress,
|
|
3062
3051
|
owner: address,
|
|
3063
3052
|
walletType: wallet.walletKind,
|
|
@@ -3068,7 +3057,7 @@ var useTransactionSteps3 = ({
|
|
|
3068
3057
|
expiry
|
|
3069
3058
|
}
|
|
3070
3059
|
});
|
|
3071
|
-
return
|
|
3060
|
+
return steps3;
|
|
3072
3061
|
} catch (error) {
|
|
3073
3062
|
if (callbacks?.onError) {
|
|
3074
3063
|
callbacks.onError(error);
|
|
@@ -3082,17 +3071,15 @@ var useTransactionSteps3 = ({
|
|
|
3082
3071
|
try {
|
|
3083
3072
|
steps$.approval.isExecuting.set(true);
|
|
3084
3073
|
const approvalStep = await getListingSteps().then(
|
|
3085
|
-
(
|
|
3074
|
+
(steps3) => steps3?.find((step) => step.id === "tokenApproval" /* tokenApproval */)
|
|
3086
3075
|
);
|
|
3087
3076
|
const hash = await wallet.handleSendTransactionStep(
|
|
3088
3077
|
Number(chainId),
|
|
3089
3078
|
approvalStep
|
|
3090
3079
|
);
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
steps$.approval.exist.set(false);
|
|
3095
|
-
}
|
|
3080
|
+
await wallet.handleConfirmTransactionStep(hash, Number(chainId));
|
|
3081
|
+
steps$.approval.isExecuting.set(false);
|
|
3082
|
+
steps$.approval.exist.set(false);
|
|
3096
3083
|
} catch (error) {
|
|
3097
3084
|
steps$.approval.isExecuting.set(false);
|
|
3098
3085
|
}
|
|
@@ -3101,11 +3088,11 @@ var useTransactionSteps3 = ({
|
|
|
3101
3088
|
if (!wallet) return;
|
|
3102
3089
|
try {
|
|
3103
3090
|
steps$.transaction.isExecuting.set(true);
|
|
3104
|
-
const
|
|
3105
|
-
const transactionStep =
|
|
3091
|
+
const steps3 = await getListingSteps();
|
|
3092
|
+
const transactionStep = steps3?.find(
|
|
3106
3093
|
(step) => step.id === "createListing" /* createListing */
|
|
3107
3094
|
);
|
|
3108
|
-
const signatureStep =
|
|
3095
|
+
const signatureStep = steps3?.find(
|
|
3109
3096
|
(step) => step.id === "signEIP712" /* signEIP712 */
|
|
3110
3097
|
);
|
|
3111
3098
|
console.debug("transactionStep", transactionStep);
|
|
@@ -3138,19 +3125,13 @@ var useTransactionSteps3 = ({
|
|
|
3138
3125
|
]
|
|
3139
3126
|
});
|
|
3140
3127
|
if (hash) {
|
|
3141
|
-
await
|
|
3128
|
+
await wallet.handleConfirmTransactionStep(hash, Number(chainId));
|
|
3142
3129
|
steps$.transaction.isExecuting.set(false);
|
|
3143
3130
|
steps$.transaction.exist.set(false);
|
|
3144
|
-
if (callbacks?.onSuccess && typeof callbacks.onSuccess === "function") {
|
|
3145
|
-
callbacks.onSuccess({ hash });
|
|
3146
|
-
}
|
|
3147
3131
|
}
|
|
3148
3132
|
if (orderId) {
|
|
3149
3133
|
steps$.transaction.isExecuting.set(false);
|
|
3150
3134
|
steps$.transaction.exist.set(false);
|
|
3151
|
-
if (callbacks?.onSuccess && typeof callbacks.onSuccess === "function") {
|
|
3152
|
-
callbacks.onSuccess({ orderId });
|
|
3153
|
-
}
|
|
3154
3135
|
}
|
|
3155
3136
|
} catch (error) {
|
|
3156
3137
|
steps$.transaction.isExecuting.set(false);
|
|
@@ -3217,7 +3198,7 @@ var useCreateListing = ({
|
|
|
3217
3198
|
enabled: !marketplaceIsLoading
|
|
3218
3199
|
}
|
|
3219
3200
|
});
|
|
3220
|
-
|
|
3201
|
+
useEffect6(() => {
|
|
3221
3202
|
if (tokenApproval?.step && !tokenApprovalIsLoading) {
|
|
3222
3203
|
steps$.approval.exist.set(true);
|
|
3223
3204
|
}
|
|
@@ -3241,16 +3222,16 @@ var useCreateListing = ({
|
|
|
3241
3222
|
};
|
|
3242
3223
|
|
|
3243
3224
|
// src/react/ui/modals/CreateListingModal/Modal.tsx
|
|
3244
|
-
import { jsx as
|
|
3225
|
+
import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3245
3226
|
var CreateListingModal = () => {
|
|
3246
|
-
return /* @__PURE__ */
|
|
3227
|
+
return /* @__PURE__ */ jsx24(Show4, { if: createListingModal$.isOpen, children: () => /* @__PURE__ */ jsx24(Modal4, {}) });
|
|
3247
3228
|
};
|
|
3248
|
-
var
|
|
3229
|
+
var Modal4 = observer10(() => {
|
|
3249
3230
|
const state = createListingModal$.get();
|
|
3250
3231
|
const {
|
|
3251
3232
|
collectionAddress,
|
|
3252
3233
|
chainId,
|
|
3253
|
-
listingPrice,
|
|
3234
|
+
listingPrice: listingPrice2,
|
|
3254
3235
|
collectibleId,
|
|
3255
3236
|
orderbookKind,
|
|
3256
3237
|
callbacks
|
|
@@ -3273,7 +3254,7 @@ var Modal5 = observer12(() => {
|
|
|
3273
3254
|
chainId,
|
|
3274
3255
|
collectionAddress
|
|
3275
3256
|
});
|
|
3276
|
-
const { address } =
|
|
3257
|
+
const { address } = useAccount4();
|
|
3277
3258
|
const { data: balance } = useBalanceOfCollectible({
|
|
3278
3259
|
chainId,
|
|
3279
3260
|
collectionAddress,
|
|
@@ -3290,8 +3271,8 @@ var Modal5 = observer12(() => {
|
|
|
3290
3271
|
collectible?.decimals || 0
|
|
3291
3272
|
).toString(),
|
|
3292
3273
|
expiry: dateToUnixTime(createListingModal$.expiry.get()),
|
|
3293
|
-
currencyAddress:
|
|
3294
|
-
pricePerToken:
|
|
3274
|
+
currencyAddress: listingPrice2.currency.contractAddress,
|
|
3275
|
+
pricePerToken: listingPrice2.amountRaw
|
|
3295
3276
|
}
|
|
3296
3277
|
},
|
|
3297
3278
|
chainId,
|
|
@@ -3302,7 +3283,7 @@ var Modal5 = observer12(() => {
|
|
|
3302
3283
|
steps$
|
|
3303
3284
|
});
|
|
3304
3285
|
if (collectableIsLoading || collectionIsLoading) {
|
|
3305
|
-
return /* @__PURE__ */
|
|
3286
|
+
return /* @__PURE__ */ jsx24(
|
|
3306
3287
|
LoadingModal,
|
|
3307
3288
|
{
|
|
3308
3289
|
isOpen: createListingModal$.isOpen.get(),
|
|
@@ -3313,7 +3294,7 @@ var Modal5 = observer12(() => {
|
|
|
3313
3294
|
);
|
|
3314
3295
|
}
|
|
3315
3296
|
if (collectableIsError || collectionIsError) {
|
|
3316
|
-
return /* @__PURE__ */
|
|
3297
|
+
return /* @__PURE__ */ jsx24(
|
|
3317
3298
|
ErrorModal,
|
|
3318
3299
|
{
|
|
3319
3300
|
isOpen: createListingModal$.isOpen.get(),
|
|
@@ -3330,16 +3311,17 @@ var Modal5 = observer12(() => {
|
|
|
3330
3311
|
hidden: !steps$.approval.exist.get(),
|
|
3331
3312
|
pending: steps$?.approval.isExecuting.get(),
|
|
3332
3313
|
variant: "glass",
|
|
3333
|
-
disabled: createListingModal$.invalidQuantity.get() ||
|
|
3314
|
+
disabled: createListingModal$.invalidQuantity.get() || listingPrice2.amountRaw === "0" || steps$?.approval.isExecuting.get() || tokenApprovalIsLoading || isLoading
|
|
3334
3315
|
},
|
|
3335
3316
|
{
|
|
3336
3317
|
label: "List item for sale",
|
|
3337
3318
|
onClick: () => createListing(),
|
|
3338
3319
|
pending: steps$?.transaction.isExecuting.get(),
|
|
3339
|
-
|
|
3320
|
+
testid: "create-listing-submit-button",
|
|
3321
|
+
disabled: steps$.approval.exist.get() || tokenApprovalIsLoading || listingPrice2.amountRaw === "0" || createListingModal$.invalidQuantity.get() || isLoading
|
|
3340
3322
|
}
|
|
3341
3323
|
];
|
|
3342
|
-
return /* @__PURE__ */
|
|
3324
|
+
return /* @__PURE__ */ jsxs17(
|
|
3343
3325
|
ActionModal,
|
|
3344
3326
|
{
|
|
3345
3327
|
isOpen: createListingModal$.isOpen.get(),
|
|
@@ -3348,7 +3330,7 @@ var Modal5 = observer12(() => {
|
|
|
3348
3330
|
title: "List item for sale",
|
|
3349
3331
|
ctas,
|
|
3350
3332
|
children: [
|
|
3351
|
-
/* @__PURE__ */
|
|
3333
|
+
/* @__PURE__ */ jsx24(
|
|
3352
3334
|
TokenPreview,
|
|
3353
3335
|
{
|
|
3354
3336
|
collectionName: collection?.name,
|
|
@@ -3357,26 +3339,26 @@ var Modal5 = observer12(() => {
|
|
|
3357
3339
|
chainId
|
|
3358
3340
|
}
|
|
3359
3341
|
),
|
|
3360
|
-
/* @__PURE__ */
|
|
3361
|
-
/* @__PURE__ */
|
|
3362
|
-
|
|
3342
|
+
/* @__PURE__ */ jsxs17(Box16, { display: "flex", flexDirection: "column", width: "full", gap: "1", children: [
|
|
3343
|
+
/* @__PURE__ */ jsx24(
|
|
3344
|
+
PriceInput,
|
|
3363
3345
|
{
|
|
3364
3346
|
chainId,
|
|
3365
3347
|
collectionAddress,
|
|
3366
3348
|
$price: createListingModal$.listingPrice
|
|
3367
3349
|
}
|
|
3368
3350
|
),
|
|
3369
|
-
|
|
3351
|
+
listingPrice2.amountRaw !== "0" && /* @__PURE__ */ jsx24(
|
|
3370
3352
|
FloorPriceText,
|
|
3371
3353
|
{
|
|
3372
3354
|
tokenId: collectibleId,
|
|
3373
3355
|
chainId,
|
|
3374
3356
|
collectionAddress,
|
|
3375
|
-
price:
|
|
3357
|
+
price: listingPrice2
|
|
3376
3358
|
}
|
|
3377
3359
|
)
|
|
3378
3360
|
] }),
|
|
3379
|
-
collection?.type === "ERC1155" && balance && /* @__PURE__ */
|
|
3361
|
+
collection?.type === "ERC1155" && balance && /* @__PURE__ */ jsx24(
|
|
3380
3362
|
QuantityInput,
|
|
3381
3363
|
{
|
|
3382
3364
|
$quantity: createListingModal$.quantity,
|
|
@@ -3385,15 +3367,15 @@ var Modal5 = observer12(() => {
|
|
|
3385
3367
|
maxQuantity: balance?.balance
|
|
3386
3368
|
}
|
|
3387
3369
|
),
|
|
3388
|
-
/* @__PURE__ */
|
|
3389
|
-
/* @__PURE__ */
|
|
3370
|
+
/* @__PURE__ */ jsx24(expirationDateSelect_default, { $date: createListingModal$.expiry }),
|
|
3371
|
+
/* @__PURE__ */ jsx24(
|
|
3390
3372
|
TransactionDetails,
|
|
3391
3373
|
{
|
|
3392
3374
|
collectibleId,
|
|
3393
3375
|
collectionAddress,
|
|
3394
3376
|
chainId,
|
|
3395
3377
|
price: createListingModal$.listingPrice.get(),
|
|
3396
|
-
currencyImageUrl:
|
|
3378
|
+
currencyImageUrl: listingPrice2.currency.imageUrl
|
|
3397
3379
|
}
|
|
3398
3380
|
)
|
|
3399
3381
|
]
|
|
@@ -3405,7 +3387,7 @@ var Modal5 = observer12(() => {
|
|
|
3405
3387
|
import { use$ as use$2 } from "@legendapp/state/react";
|
|
3406
3388
|
|
|
3407
3389
|
// src/react/ui/modals/BuyModal/store.ts
|
|
3408
|
-
import { observable as
|
|
3390
|
+
import { observable as observable8 } from "@legendapp/state";
|
|
3409
3391
|
var initialState7 = {
|
|
3410
3392
|
isOpen: false,
|
|
3411
3393
|
open: ({
|
|
@@ -3443,13 +3425,13 @@ var initialState7 = {
|
|
|
3443
3425
|
},
|
|
3444
3426
|
callbacks: void 0
|
|
3445
3427
|
};
|
|
3446
|
-
var buyModal$ =
|
|
3428
|
+
var buyModal$ = observable8(initialState7);
|
|
3447
3429
|
|
|
3448
3430
|
// src/react/ui/modals/BuyModal/modals/CheckoutModal.tsx
|
|
3449
|
-
import { useEffect as
|
|
3431
|
+
import { useEffect as useEffect7 } from "react";
|
|
3450
3432
|
import { parseUnits as parseUnits5 } from "viem";
|
|
3451
3433
|
function CheckoutModal({ buy, collectable, order }) {
|
|
3452
|
-
|
|
3434
|
+
useEffect7(() => {
|
|
3453
3435
|
const executeBuy = () => {
|
|
3454
3436
|
buy({
|
|
3455
3437
|
orderId: order.orderId,
|
|
@@ -3464,11 +3446,11 @@ function CheckoutModal({ buy, collectable, order }) {
|
|
|
3464
3446
|
}
|
|
3465
3447
|
|
|
3466
3448
|
// src/react/ui/modals/BuyModal/modals/Modal1155.tsx
|
|
3467
|
-
import { Box as
|
|
3468
|
-
import { observer as
|
|
3449
|
+
import { Box as Box17, Text as Text14, TokenImage as TokenImage2 } from "@0xsequence/design-system";
|
|
3450
|
+
import { observer as observer11 } from "@legendapp/state/react";
|
|
3469
3451
|
import { formatUnits as formatUnits4, parseUnits as parseUnits6 } from "viem";
|
|
3470
|
-
import { jsx as
|
|
3471
|
-
var ERC1155QuantityModal =
|
|
3452
|
+
import { jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3453
|
+
var ERC1155QuantityModal = observer11(
|
|
3472
3454
|
({ buy, collectable, order }) => {
|
|
3473
3455
|
const currencyOptions = useCurrencyOptions({
|
|
3474
3456
|
collectionAddress: order.collectionContractAddress
|
|
@@ -3486,7 +3468,7 @@ var ERC1155QuantityModal = observer13(
|
|
|
3486
3468
|
if (buyModal$.state.checkoutModalLoaded.get()) {
|
|
3487
3469
|
return null;
|
|
3488
3470
|
}
|
|
3489
|
-
return /* @__PURE__ */
|
|
3471
|
+
return /* @__PURE__ */ jsx25(
|
|
3490
3472
|
ActionModal,
|
|
3491
3473
|
{
|
|
3492
3474
|
isOpen: buyModal$.isOpen.get(),
|
|
@@ -3512,8 +3494,8 @@ var ERC1155QuantityModal = observer13(
|
|
|
3512
3494
|
pending: buyModal$.state.checkoutModalIsLoading.get()
|
|
3513
3495
|
}
|
|
3514
3496
|
],
|
|
3515
|
-
children: /* @__PURE__ */
|
|
3516
|
-
/* @__PURE__ */
|
|
3497
|
+
children: /* @__PURE__ */ jsxs18(Box17, { display: "flex", flexDirection: "column", gap: "4", children: [
|
|
3498
|
+
/* @__PURE__ */ jsx25(
|
|
3517
3499
|
QuantityInput,
|
|
3518
3500
|
{
|
|
3519
3501
|
$quantity: buyModal$.state.quantity,
|
|
@@ -3522,11 +3504,11 @@ var ERC1155QuantityModal = observer13(
|
|
|
3522
3504
|
maxQuantity: order.quantityRemaining
|
|
3523
3505
|
}
|
|
3524
3506
|
),
|
|
3525
|
-
/* @__PURE__ */
|
|
3526
|
-
/* @__PURE__ */
|
|
3527
|
-
/* @__PURE__ */
|
|
3528
|
-
/* @__PURE__ */
|
|
3529
|
-
/* @__PURE__ */
|
|
3507
|
+
/* @__PURE__ */ jsxs18(Box17, { display: "flex", justifyContent: "space-between", children: [
|
|
3508
|
+
/* @__PURE__ */ jsx25(Text14, { color: "text50", fontSize: "small", children: "Total Price" }),
|
|
3509
|
+
/* @__PURE__ */ jsxs18(Box17, { display: "flex", alignItems: "center", gap: "2", children: [
|
|
3510
|
+
/* @__PURE__ */ jsx25(TokenImage2, { src: currency?.imageUrl, size: "xs" }),
|
|
3511
|
+
/* @__PURE__ */ jsx25(Text14, { color: "text100", fontSize: "small", fontWeight: "bold", children: formatUnits4(BigInt(totalPrice), currency?.decimals || 0) })
|
|
3530
3512
|
] })
|
|
3531
3513
|
] })
|
|
3532
3514
|
] })
|
|
@@ -3647,7 +3629,8 @@ var useBuyCollectable = ({
|
|
|
3647
3629
|
isLoading,
|
|
3648
3630
|
isError,
|
|
3649
3631
|
buy: async (input) => {
|
|
3650
|
-
|
|
3632
|
+
setCheckoutModalIsLoading(true);
|
|
3633
|
+
const { steps: steps3 } = await marketplaceClient.generateBuyTransaction({
|
|
3651
3634
|
collectionAddress,
|
|
3652
3635
|
buyer: await wallet.address(),
|
|
3653
3636
|
marketplace: input.marketplace,
|
|
@@ -3662,7 +3645,7 @@ var useBuyCollectable = ({
|
|
|
3662
3645
|
});
|
|
3663
3646
|
setCheckoutModalLoaded(true);
|
|
3664
3647
|
setCheckoutModalIsLoading(false);
|
|
3665
|
-
const step =
|
|
3648
|
+
const step = steps3[0];
|
|
3666
3649
|
openSelectPaymentModal({
|
|
3667
3650
|
chain: chainId,
|
|
3668
3651
|
collectibles: [
|
|
@@ -3701,11 +3684,11 @@ var useBuyCollectable = ({
|
|
|
3701
3684
|
};
|
|
3702
3685
|
|
|
3703
3686
|
// src/react/ui/modals/BuyModal/Modal.tsx
|
|
3704
|
-
import { jsx as
|
|
3687
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
3705
3688
|
var BuyModal = () => {
|
|
3706
3689
|
const isOpen = use$2(buyModal$.isOpen);
|
|
3707
3690
|
if (!isOpen) return null;
|
|
3708
|
-
return /* @__PURE__ */
|
|
3691
|
+
return /* @__PURE__ */ jsx26(BuyModalContent, {});
|
|
3709
3692
|
};
|
|
3710
3693
|
var BuyModalContent = () => {
|
|
3711
3694
|
const chainId = String(use$2(buyModal$.state.order.chainId));
|
|
@@ -3717,6 +3700,7 @@ var BuyModalContent = () => {
|
|
|
3717
3700
|
const callbacks = use$2(buyModal$.callbacks);
|
|
3718
3701
|
const order = use$2(buyModal$.state.order);
|
|
3719
3702
|
const isOpen = use$2(buyModal$.isOpen);
|
|
3703
|
+
const checkoutModalIsLoading = use$2(buyModal$.state.checkoutModalIsLoading);
|
|
3720
3704
|
const setCheckoutModalIsLoading = use$2(buyModal$.setCheckoutModalIsLoading);
|
|
3721
3705
|
const setCheckoutModalLoaded = use$2(buyModal$.setCheckoutModalLoaded);
|
|
3722
3706
|
const { collection, collectable, checkoutOptions, isLoading, isError } = useLoadData({
|
|
@@ -3739,8 +3723,8 @@ var BuyModalContent = () => {
|
|
|
3739
3723
|
setCheckoutModalIsLoading,
|
|
3740
3724
|
setCheckoutModalLoaded
|
|
3741
3725
|
});
|
|
3742
|
-
if (isLoading || !collection || !collectable || !checkoutOptions || buyIsLoading) {
|
|
3743
|
-
return /* @__PURE__ */
|
|
3726
|
+
if (isLoading || checkoutModalIsLoading || !collection || !collectable || !checkoutOptions || buyIsLoading) {
|
|
3727
|
+
return /* @__PURE__ */ jsx26(
|
|
3744
3728
|
LoadingModal,
|
|
3745
3729
|
{
|
|
3746
3730
|
isOpen,
|
|
@@ -3751,7 +3735,7 @@ var BuyModalContent = () => {
|
|
|
3751
3735
|
);
|
|
3752
3736
|
}
|
|
3753
3737
|
if (buyIsError || isError) {
|
|
3754
|
-
return /* @__PURE__ */
|
|
3738
|
+
return /* @__PURE__ */ jsx26(
|
|
3755
3739
|
ErrorModal,
|
|
3756
3740
|
{
|
|
3757
3741
|
isOpen,
|
|
@@ -3761,7 +3745,7 @@ var BuyModalContent = () => {
|
|
|
3761
3745
|
}
|
|
3762
3746
|
);
|
|
3763
3747
|
}
|
|
3764
|
-
return collection.type === "ERC721" /* ERC721 */ ? /* @__PURE__ */
|
|
3748
|
+
return collection.type === "ERC721" /* ERC721 */ ? /* @__PURE__ */ jsx26(
|
|
3765
3749
|
CheckoutModal,
|
|
3766
3750
|
{
|
|
3767
3751
|
buy: (input) => buy({ ...input, checkoutOptions }),
|
|
@@ -3769,7 +3753,7 @@ var BuyModalContent = () => {
|
|
|
3769
3753
|
order
|
|
3770
3754
|
},
|
|
3771
3755
|
modalId
|
|
3772
|
-
) : /* @__PURE__ */
|
|
3756
|
+
) : /* @__PURE__ */ jsx26(
|
|
3773
3757
|
ERC1155QuantityModal,
|
|
3774
3758
|
{
|
|
3775
3759
|
buy: (input) => buy({ ...input, checkoutOptions }),
|
|
@@ -3783,18 +3767,17 @@ var BuyModalContent = () => {
|
|
|
3783
3767
|
};
|
|
3784
3768
|
|
|
3785
3769
|
// src/react/ui/modals/modal-provider.tsx
|
|
3786
|
-
import { Fragment as Fragment3, jsx as
|
|
3787
|
-
var ModalProvider =
|
|
3788
|
-
return /* @__PURE__ */
|
|
3789
|
-
/* @__PURE__ */
|
|
3790
|
-
/* @__PURE__ */
|
|
3791
|
-
/* @__PURE__ */
|
|
3792
|
-
/* @__PURE__ */
|
|
3793
|
-
/* @__PURE__ */
|
|
3794
|
-
/* @__PURE__ */
|
|
3795
|
-
/* @__PURE__ */
|
|
3796
|
-
/* @__PURE__ */
|
|
3797
|
-
/* @__PURE__ */ jsx28(transactionStatusModal_default, {})
|
|
3770
|
+
import { Fragment as Fragment3, jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3771
|
+
var ModalProvider = observer12(() => {
|
|
3772
|
+
return /* @__PURE__ */ jsxs19(Fragment3, { children: [
|
|
3773
|
+
/* @__PURE__ */ jsx27(CreateListingModal, {}),
|
|
3774
|
+
/* @__PURE__ */ jsx27(MakeOfferModal, {}),
|
|
3775
|
+
/* @__PURE__ */ jsx27(TransferModal, {}),
|
|
3776
|
+
/* @__PURE__ */ jsx27(SellModal, {}),
|
|
3777
|
+
/* @__PURE__ */ jsx27(BuyModal, {}),
|
|
3778
|
+
/* @__PURE__ */ jsx27(SuccessfulPurchaseModal_default, {}),
|
|
3779
|
+
/* @__PURE__ */ jsx27(switchChainModal_default, {}),
|
|
3780
|
+
/* @__PURE__ */ jsx27(transactionStatusModal_default, {})
|
|
3798
3781
|
] });
|
|
3799
3782
|
});
|
|
3800
3783
|
|
|
@@ -3829,14 +3812,14 @@ var useBuyModal = (callbacks) => {
|
|
|
3829
3812
|
};
|
|
3830
3813
|
|
|
3831
3814
|
// src/react/ui/components/collectible-card/CollectibleCard.tsx
|
|
3832
|
-
import { useState as
|
|
3833
|
-
import { Box as
|
|
3834
|
-
import { useAccount as
|
|
3815
|
+
import { useState as useState7 } from "react";
|
|
3816
|
+
import { Box as Box21, IconButton as IconButton6, Skeleton as Skeleton8 } from "@0xsequence/design-system";
|
|
3817
|
+
import { useAccount as useAccount6 } from "wagmi";
|
|
3835
3818
|
|
|
3836
3819
|
// src/react/ui/icons/DiamondEye.tsx
|
|
3837
|
-
import { Box as
|
|
3838
|
-
import { jsx as
|
|
3839
|
-
var Svg = () => /* @__PURE__ */
|
|
3820
|
+
import { Box as Box18 } from "@0xsequence/design-system";
|
|
3821
|
+
import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3822
|
+
var Svg = () => /* @__PURE__ */ jsxs20(
|
|
3840
3823
|
"svg",
|
|
3841
3824
|
{
|
|
3842
3825
|
width: "16",
|
|
@@ -3847,8 +3830,8 @@ var Svg = () => /* @__PURE__ */ jsxs21(
|
|
|
3847
3830
|
role: "img",
|
|
3848
3831
|
"aria-labelledby": "diamond-eye-title",
|
|
3849
3832
|
children: [
|
|
3850
|
-
/* @__PURE__ */
|
|
3851
|
-
/* @__PURE__ */
|
|
3833
|
+
/* @__PURE__ */ jsx28("title", { id: "diamond-eye-title", children: "Diamond Eye Icon" }),
|
|
3834
|
+
/* @__PURE__ */ jsx28(
|
|
3852
3835
|
"path",
|
|
3853
3836
|
{
|
|
3854
3837
|
fillRule: "evenodd",
|
|
@@ -3860,8 +3843,8 @@ var Svg = () => /* @__PURE__ */ jsxs21(
|
|
|
3860
3843
|
]
|
|
3861
3844
|
}
|
|
3862
3845
|
);
|
|
3863
|
-
var SvgDiamondEyeIcon = ({ size = "sm", ...props }) => /* @__PURE__ */
|
|
3864
|
-
|
|
3846
|
+
var SvgDiamondEyeIcon = ({ size = "sm", ...props }) => /* @__PURE__ */ jsx28(
|
|
3847
|
+
Box18,
|
|
3865
3848
|
{
|
|
3866
3849
|
as: Svg,
|
|
3867
3850
|
className: iconVariants({
|
|
@@ -3873,10 +3856,10 @@ var SvgDiamondEyeIcon = ({ size = "sm", ...props }) => /* @__PURE__ */ jsx29(
|
|
|
3873
3856
|
var DiamondEye_default = SvgDiamondEyeIcon;
|
|
3874
3857
|
|
|
3875
3858
|
// src/react/ui/components/_internals/action-button/ActionButton.tsx
|
|
3876
|
-
import { Button as
|
|
3877
|
-
import { observer as
|
|
3878
|
-
import { jsx as
|
|
3879
|
-
var ActionButton =
|
|
3859
|
+
import { Button as Button5 } from "@0xsequence/design-system";
|
|
3860
|
+
import { observer as observer13 } from "@legendapp/state/react";
|
|
3861
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3862
|
+
var ActionButton = observer13(
|
|
3880
3863
|
({
|
|
3881
3864
|
collectionAddress,
|
|
3882
3865
|
chainId,
|
|
@@ -3894,7 +3877,7 @@ var ActionButton = observer15(
|
|
|
3894
3877
|
if (action === "Buy" /* BUY */) {
|
|
3895
3878
|
if (!lowestListing)
|
|
3896
3879
|
throw new InvalidStepError("BUY", "lowestListing is required");
|
|
3897
|
-
return /* @__PURE__ */
|
|
3880
|
+
return /* @__PURE__ */ jsx29(
|
|
3898
3881
|
ActionButtonBody,
|
|
3899
3882
|
{
|
|
3900
3883
|
label: "Buy",
|
|
@@ -3910,7 +3893,7 @@ var ActionButton = observer15(
|
|
|
3910
3893
|
if (action === "Sell" /* SELL */) {
|
|
3911
3894
|
if (!highestOffer)
|
|
3912
3895
|
throw new InvalidStepError("SELL", "highestOffer is required");
|
|
3913
|
-
return /* @__PURE__ */
|
|
3896
|
+
return /* @__PURE__ */ jsx29(
|
|
3914
3897
|
ActionButtonBody,
|
|
3915
3898
|
{
|
|
3916
3899
|
label: "Sell",
|
|
@@ -3924,7 +3907,7 @@ var ActionButton = observer15(
|
|
|
3924
3907
|
);
|
|
3925
3908
|
}
|
|
3926
3909
|
if (action === "Create listing" /* LIST */) {
|
|
3927
|
-
return /* @__PURE__ */
|
|
3910
|
+
return /* @__PURE__ */ jsx29(
|
|
3928
3911
|
ActionButtonBody,
|
|
3929
3912
|
{
|
|
3930
3913
|
label: "Create listing",
|
|
@@ -3938,7 +3921,7 @@ var ActionButton = observer15(
|
|
|
3938
3921
|
);
|
|
3939
3922
|
}
|
|
3940
3923
|
if (action === "Make an offer" /* OFFER */) {
|
|
3941
|
-
return /* @__PURE__ */
|
|
3924
|
+
return /* @__PURE__ */ jsx29(
|
|
3942
3925
|
ActionButtonBody,
|
|
3943
3926
|
{
|
|
3944
3927
|
label: "Make an offer",
|
|
@@ -3952,7 +3935,7 @@ var ActionButton = observer15(
|
|
|
3952
3935
|
);
|
|
3953
3936
|
}
|
|
3954
3937
|
if (action === "Transfer" /* TRANSFER */) {
|
|
3955
|
-
return /* @__PURE__ */
|
|
3938
|
+
return /* @__PURE__ */ jsx29(
|
|
3956
3939
|
ActionButtonBody,
|
|
3957
3940
|
{
|
|
3958
3941
|
label: "Transfer",
|
|
@@ -3968,8 +3951,8 @@ var ActionButton = observer15(
|
|
|
3968
3951
|
}
|
|
3969
3952
|
);
|
|
3970
3953
|
function ActionButtonBody({ label, onClick }) {
|
|
3971
|
-
return /* @__PURE__ */
|
|
3972
|
-
|
|
3954
|
+
return /* @__PURE__ */ jsx29(
|
|
3955
|
+
Button5,
|
|
3973
3956
|
{
|
|
3974
3957
|
variant: "primary",
|
|
3975
3958
|
label,
|
|
@@ -3986,14 +3969,14 @@ function ActionButtonBody({ label, onClick }) {
|
|
|
3986
3969
|
}
|
|
3987
3970
|
|
|
3988
3971
|
// src/react/ui/components/collectible-card/Footer.tsx
|
|
3989
|
-
import { Box as
|
|
3972
|
+
import { Box as Box20, IconButton as IconButton5, Image as Image6, Text as Text15 } from "@0xsequence/design-system";
|
|
3990
3973
|
import { formatUnits as formatUnits5 } from "viem";
|
|
3991
|
-
import { useAccount as
|
|
3974
|
+
import { useAccount as useAccount5 } from "wagmi";
|
|
3992
3975
|
|
|
3993
3976
|
// src/react/ui/icons/Bell.tsx
|
|
3994
|
-
import { Box as
|
|
3995
|
-
import { jsx as
|
|
3996
|
-
var Svg2 = () => /* @__PURE__ */
|
|
3977
|
+
import { Box as Box19 } from "@0xsequence/design-system";
|
|
3978
|
+
import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3979
|
+
var Svg2 = () => /* @__PURE__ */ jsxs21(
|
|
3997
3980
|
"svg",
|
|
3998
3981
|
{
|
|
3999
3982
|
width: "17",
|
|
@@ -4004,8 +3987,8 @@ var Svg2 = () => /* @__PURE__ */ jsxs22(
|
|
|
4004
3987
|
role: "img",
|
|
4005
3988
|
"aria-labelledby": "bell-title",
|
|
4006
3989
|
children: [
|
|
4007
|
-
/* @__PURE__ */
|
|
4008
|
-
/* @__PURE__ */
|
|
3990
|
+
/* @__PURE__ */ jsx30("title", { id: "bell-title", children: "Notification Bell" }),
|
|
3991
|
+
/* @__PURE__ */ jsx30(
|
|
4009
3992
|
"path",
|
|
4010
3993
|
{
|
|
4011
3994
|
fillRule: "evenodd",
|
|
@@ -4017,8 +4000,8 @@ var Svg2 = () => /* @__PURE__ */ jsxs22(
|
|
|
4017
4000
|
]
|
|
4018
4001
|
}
|
|
4019
4002
|
);
|
|
4020
|
-
var SvgBellIcon = ({ size = "sm", ...props }) => /* @__PURE__ */
|
|
4021
|
-
|
|
4003
|
+
var SvgBellIcon = ({ size = "sm", ...props }) => /* @__PURE__ */ jsx30(
|
|
4004
|
+
Box19,
|
|
4022
4005
|
{
|
|
4023
4006
|
as: Svg2,
|
|
4024
4007
|
className: iconVariants({
|
|
@@ -4030,7 +4013,7 @@ var SvgBellIcon = ({ size = "sm", ...props }) => /* @__PURE__ */ jsx31(
|
|
|
4030
4013
|
var Bell_default = SvgBellIcon;
|
|
4031
4014
|
|
|
4032
4015
|
// src/react/ui/components/collectible-card/Footer.tsx
|
|
4033
|
-
import { jsx as
|
|
4016
|
+
import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4034
4017
|
var Footer = ({
|
|
4035
4018
|
name,
|
|
4036
4019
|
type,
|
|
@@ -4041,7 +4024,7 @@ var Footer = ({
|
|
|
4041
4024
|
balance,
|
|
4042
4025
|
isAnimated
|
|
4043
4026
|
}) => {
|
|
4044
|
-
const { address } =
|
|
4027
|
+
const { address } = useAccount5();
|
|
4045
4028
|
const listed = !!lowestListingPriceAmount && !!lowestListingCurrency;
|
|
4046
4029
|
if (name.length > 15 && highestOffer) {
|
|
4047
4030
|
name = `${name.substring(0, 13)}...`;
|
|
@@ -4049,8 +4032,8 @@ var Footer = ({
|
|
|
4049
4032
|
if (name.length > 17 && !highestOffer) {
|
|
4050
4033
|
name = `${name.substring(0, 17)}...`;
|
|
4051
4034
|
}
|
|
4052
|
-
return /* @__PURE__ */
|
|
4053
|
-
|
|
4035
|
+
return /* @__PURE__ */ jsxs22(
|
|
4036
|
+
Box20,
|
|
4054
4037
|
{
|
|
4055
4038
|
display: "flex",
|
|
4056
4039
|
flexDirection: "column",
|
|
@@ -4061,8 +4044,8 @@ var Footer = ({
|
|
|
4061
4044
|
position: "relative",
|
|
4062
4045
|
className: !!address && isAnimated ? footer.animated : footer.static,
|
|
4063
4046
|
children: [
|
|
4064
|
-
/* @__PURE__ */
|
|
4065
|
-
|
|
4047
|
+
/* @__PURE__ */ jsxs22(
|
|
4048
|
+
Box20,
|
|
4066
4049
|
{
|
|
4067
4050
|
display: "flex",
|
|
4068
4051
|
alignItems: "center",
|
|
@@ -4070,8 +4053,8 @@ var Footer = ({
|
|
|
4070
4053
|
position: "relative",
|
|
4071
4054
|
width: "full",
|
|
4072
4055
|
children: [
|
|
4073
|
-
/* @__PURE__ */
|
|
4074
|
-
|
|
4056
|
+
/* @__PURE__ */ jsx31(
|
|
4057
|
+
Text15,
|
|
4075
4058
|
{
|
|
4076
4059
|
color: "text100",
|
|
4077
4060
|
fontSize: "normal",
|
|
@@ -4081,7 +4064,7 @@ var Footer = ({
|
|
|
4081
4064
|
children: name
|
|
4082
4065
|
}
|
|
4083
4066
|
),
|
|
4084
|
-
highestOffer && onOfferClick && /* @__PURE__ */
|
|
4067
|
+
highestOffer && onOfferClick && /* @__PURE__ */ jsx31(
|
|
4085
4068
|
IconButton5,
|
|
4086
4069
|
{
|
|
4087
4070
|
size: "xs",
|
|
@@ -4094,16 +4077,16 @@ var Footer = ({
|
|
|
4094
4077
|
e.stopPropagation();
|
|
4095
4078
|
onOfferClick?.();
|
|
4096
4079
|
},
|
|
4097
|
-
icon: (props) => /* @__PURE__ */
|
|
4080
|
+
icon: (props) => /* @__PURE__ */ jsx31(Bell_default, { ...props, size: "xs" })
|
|
4098
4081
|
}
|
|
4099
4082
|
)
|
|
4100
4083
|
]
|
|
4101
4084
|
}
|
|
4102
4085
|
),
|
|
4103
|
-
/* @__PURE__ */
|
|
4104
|
-
listed && /* @__PURE__ */
|
|
4105
|
-
/* @__PURE__ */
|
|
4106
|
-
|
|
4086
|
+
/* @__PURE__ */ jsxs22(Box20, { display: "flex", alignItems: "center", gap: "1", children: [
|
|
4087
|
+
listed && /* @__PURE__ */ jsx31(Image6, { src: lowestListingCurrency?.imageUrl, width: "3", height: "3" }),
|
|
4088
|
+
/* @__PURE__ */ jsxs22(
|
|
4089
|
+
Text15,
|
|
4107
4090
|
{
|
|
4108
4091
|
color: listed ? "text100" : "text50",
|
|
4109
4092
|
fontSize: "small",
|
|
@@ -4120,7 +4103,7 @@ var Footer = ({
|
|
|
4120
4103
|
}
|
|
4121
4104
|
)
|
|
4122
4105
|
] }),
|
|
4123
|
-
/* @__PURE__ */
|
|
4106
|
+
/* @__PURE__ */ jsx31(TokenTypeBalancePill, { balance, type })
|
|
4124
4107
|
]
|
|
4125
4108
|
}
|
|
4126
4109
|
);
|
|
@@ -4130,8 +4113,8 @@ var TokenTypeBalancePill = ({
|
|
|
4130
4113
|
type
|
|
4131
4114
|
}) => {
|
|
4132
4115
|
const displayText = type === "ERC1155" /* ERC1155 */ ? balance ? `Owned: ${balance}` : "ERC-1155" : "ERC-721";
|
|
4133
|
-
return /* @__PURE__ */
|
|
4134
|
-
|
|
4116
|
+
return /* @__PURE__ */ jsx31(
|
|
4117
|
+
Text15,
|
|
4135
4118
|
{
|
|
4136
4119
|
background: "backgroundSecondary",
|
|
4137
4120
|
color: "text80",
|
|
@@ -4147,25 +4130,25 @@ var TokenTypeBalancePill = ({
|
|
|
4147
4130
|
};
|
|
4148
4131
|
|
|
4149
4132
|
// src/react/ui/components/collectible-card/CollectibleCard.tsx
|
|
4150
|
-
import { jsx as
|
|
4133
|
+
import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4151
4134
|
function CollectibleSkeleton() {
|
|
4152
|
-
return /* @__PURE__ */
|
|
4153
|
-
|
|
4135
|
+
return /* @__PURE__ */ jsxs23(
|
|
4136
|
+
Box21,
|
|
4154
4137
|
{
|
|
4155
4138
|
className: collectibleCard,
|
|
4156
4139
|
borderRadius: "md",
|
|
4157
4140
|
overflow: "hidden",
|
|
4158
4141
|
background: "backgroundPrimary",
|
|
4159
4142
|
children: [
|
|
4160
|
-
/* @__PURE__ */
|
|
4143
|
+
/* @__PURE__ */ jsx32(
|
|
4161
4144
|
Skeleton8,
|
|
4162
4145
|
{
|
|
4163
4146
|
size: "lg",
|
|
4164
4147
|
style: { width: "100%", height: 164, borderRadius: 0, paddingTop: 16 }
|
|
4165
4148
|
}
|
|
4166
4149
|
),
|
|
4167
|
-
/* @__PURE__ */
|
|
4168
|
-
|
|
4150
|
+
/* @__PURE__ */ jsxs23(
|
|
4151
|
+
Box21,
|
|
4169
4152
|
{
|
|
4170
4153
|
display: "flex",
|
|
4171
4154
|
flexDirection: "column",
|
|
@@ -4174,8 +4157,8 @@ function CollectibleSkeleton() {
|
|
|
4174
4157
|
paddingBottom: "4",
|
|
4175
4158
|
marginTop: "2",
|
|
4176
4159
|
children: [
|
|
4177
|
-
/* @__PURE__ */
|
|
4178
|
-
/* @__PURE__ */
|
|
4160
|
+
/* @__PURE__ */ jsx32(Skeleton8, { size: "lg" }),
|
|
4161
|
+
/* @__PURE__ */ jsx32(Skeleton8, { size: "sm" })
|
|
4179
4162
|
]
|
|
4180
4163
|
}
|
|
4181
4164
|
)
|
|
@@ -4195,9 +4178,9 @@ function CollectibleCard({
|
|
|
4195
4178
|
balance,
|
|
4196
4179
|
cardLoading
|
|
4197
4180
|
}) {
|
|
4198
|
-
const { address: accountAddress } =
|
|
4181
|
+
const { address: accountAddress } = useAccount6();
|
|
4199
4182
|
const collectibleMetadata = lowestListing?.metadata;
|
|
4200
|
-
const [imageLoadingError, setImageLoadingError] =
|
|
4183
|
+
const [imageLoadingError, setImageLoadingError] = useState7(false);
|
|
4201
4184
|
const { data: highestOffer, isLoading: highestOfferLoading } = useHighestOffer({
|
|
4202
4185
|
chainId: String(chainId),
|
|
4203
4186
|
collectionAddress,
|
|
@@ -4209,21 +4192,21 @@ function CollectibleCard({
|
|
|
4209
4192
|
(currency) => currency.contractAddress === lowestListing?.order?.priceCurrencyAddress
|
|
4210
4193
|
);
|
|
4211
4194
|
if (highestOfferLoading || cardLoading) {
|
|
4212
|
-
return /* @__PURE__ */
|
|
4195
|
+
return /* @__PURE__ */ jsx32(CollectibleSkeleton, {});
|
|
4213
4196
|
}
|
|
4214
4197
|
const action = balance ? highestOffer?.order && "Sell" /* SELL */ || !lowestListing?.order && "Create listing" /* LIST */ || "Transfer" /* TRANSFER */ : lowestListing?.order && "Buy" /* BUY */ || "Make an offer" /* OFFER */;
|
|
4215
4198
|
const name = collectibleMetadata?.name;
|
|
4216
4199
|
const image = collectibleMetadata?.image;
|
|
4217
4200
|
const externalUrl = collectibleMetadata?.external_url;
|
|
4218
|
-
return /* @__PURE__ */
|
|
4219
|
-
|
|
4201
|
+
return /* @__PURE__ */ jsx32(
|
|
4202
|
+
Box21,
|
|
4220
4203
|
{
|
|
4221
4204
|
className: collectibleCard,
|
|
4222
4205
|
borderRadius: "md",
|
|
4223
4206
|
overflow: "hidden",
|
|
4224
4207
|
background: "backgroundPrimary",
|
|
4225
|
-
children: /* @__PURE__ */
|
|
4226
|
-
|
|
4208
|
+
children: /* @__PURE__ */ jsx32(
|
|
4209
|
+
Box21,
|
|
4227
4210
|
{
|
|
4228
4211
|
display: "flex",
|
|
4229
4212
|
flexDirection: "column",
|
|
@@ -4238,8 +4221,8 @@ function CollectibleCard({
|
|
|
4238
4221
|
cursor: "pointer",
|
|
4239
4222
|
padding: "0",
|
|
4240
4223
|
className: collectibleTileWrapper,
|
|
4241
|
-
children: /* @__PURE__ */
|
|
4242
|
-
externalUrl && /* @__PURE__ */
|
|
4224
|
+
children: /* @__PURE__ */ jsxs23("article", { style: { width: "100%" }, children: [
|
|
4225
|
+
externalUrl && /* @__PURE__ */ jsx32(
|
|
4243
4226
|
IconButton6,
|
|
4244
4227
|
{
|
|
4245
4228
|
as: "a",
|
|
@@ -4256,7 +4239,7 @@ function CollectibleCard({
|
|
|
4256
4239
|
icon: DiamondEye_default
|
|
4257
4240
|
}
|
|
4258
4241
|
),
|
|
4259
|
-
/* @__PURE__ */
|
|
4242
|
+
/* @__PURE__ */ jsx32(
|
|
4260
4243
|
"img",
|
|
4261
4244
|
{
|
|
4262
4245
|
src: imageLoadingError ? chess_tile_default : image || chess_tile_default,
|
|
@@ -4265,7 +4248,7 @@ function CollectibleCard({
|
|
|
4265
4248
|
onError: () => setImageLoadingError(true)
|
|
4266
4249
|
}
|
|
4267
4250
|
),
|
|
4268
|
-
/* @__PURE__ */
|
|
4251
|
+
/* @__PURE__ */ jsx32(
|
|
4269
4252
|
Footer,
|
|
4270
4253
|
{
|
|
4271
4254
|
name: name || "",
|
|
@@ -4278,15 +4261,15 @@ function CollectibleCard({
|
|
|
4278
4261
|
isAnimated: !!action
|
|
4279
4262
|
}
|
|
4280
4263
|
),
|
|
4281
|
-
accountAddress && (highestOffer || lowestListing) && /* @__PURE__ */
|
|
4282
|
-
|
|
4264
|
+
accountAddress && (highestOffer || lowestListing) && /* @__PURE__ */ jsx32(
|
|
4265
|
+
Box21,
|
|
4283
4266
|
{
|
|
4284
4267
|
display: "flex",
|
|
4285
4268
|
alignItems: "center",
|
|
4286
4269
|
justifyContent: "center",
|
|
4287
4270
|
padding: "2",
|
|
4288
4271
|
className: actionWrapper,
|
|
4289
|
-
children: /* @__PURE__ */
|
|
4272
|
+
children: /* @__PURE__ */ jsx32(
|
|
4290
4273
|
ActionButton,
|
|
4291
4274
|
{
|
|
4292
4275
|
chainId: String(chainId),
|
|
@@ -4318,4 +4301,4 @@ export {
|
|
|
4318
4301
|
useBuyModal,
|
|
4319
4302
|
CollectibleCard
|
|
4320
4303
|
};
|
|
4321
|
-
//# sourceMappingURL=chunk-
|
|
4304
|
+
//# sourceMappingURL=chunk-5UCKYAMR.js.map
|