@medialane/ui 0.404.0 → 0.407.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/account-page.cjs +3 -1
- package/dist/components/account-page.cjs.map +1 -1
- package/dist/components/account-page.d.cts +2 -2
- package/dist/components/account-page.d.ts +2 -2
- package/dist/components/account-page.js +3 -1
- package/dist/components/account-page.js.map +1 -1
- package/dist/components/asset-page.cjs +2 -1
- package/dist/components/asset-page.cjs.map +1 -1
- package/dist/components/asset-page.d.cts +1 -1
- package/dist/components/asset-page.d.ts +1 -1
- package/dist/components/asset-page.js +2 -1
- package/dist/components/asset-page.js.map +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/claim/claim-collection-panel.cjs +210 -0
- package/dist/components/claim/claim-collection-panel.cjs.map +1 -0
- package/dist/components/claim/claim-collection-panel.d.cts +8 -0
- package/dist/components/claim/claim-collection-panel.d.ts +8 -0
- package/dist/components/claim/claim-collection-panel.js +176 -0
- package/dist/components/claim/claim-collection-panel.js.map +1 -0
- package/dist/components/coin-row.cjs +1 -1
- package/dist/components/coin-row.cjs.map +1 -1
- package/dist/components/coin-row.js +1 -1
- package/dist/components/coin-row.js.map +1 -1
- package/dist/components/coins-explorer.cjs +2 -2
- package/dist/components/coins-explorer.cjs.map +1 -1
- package/dist/components/coins-explorer.js +2 -2
- package/dist/components/coins-explorer.js.map +1 -1
- package/dist/components/collection-page.cjs +5 -2
- package/dist/components/collection-page.cjs.map +1 -1
- package/dist/components/collection-page.d.cts +2 -2
- package/dist/components/collection-page.d.ts +2 -2
- package/dist/components/collection-page.js +5 -2
- package/dist/components/collection-page.js.map +1 -1
- package/dist/components/collection-showcase.cjs +3 -3
- package/dist/components/collection-showcase.cjs.map +1 -1
- package/dist/components/collection-showcase.js +4 -4
- package/dist/components/collection-showcase.js.map +1 -1
- package/dist/components/collections-page.cjs +1 -1
- package/dist/components/collections-page.cjs.map +1 -1
- package/dist/components/collections-page.js +1 -1
- package/dist/components/collections-page.js.map +1 -1
- package/dist/components/creator-page.cjs +3 -1
- package/dist/components/creator-page.cjs.map +1 -1
- package/dist/components/creator-page.d.cts +2 -2
- package/dist/components/creator-page.d.ts +2 -2
- package/dist/components/creator-page.js +3 -1
- package/dist/components/creator-page.js.map +1 -1
- package/dist/components/discover-page.cjs +2 -1
- package/dist/components/discover-page.cjs.map +1 -1
- package/dist/components/discover-page.d.cts +1 -1
- package/dist/components/discover-page.d.ts +1 -1
- package/dist/components/discover-page.js +2 -1
- package/dist/components/discover-page.js.map +1 -1
- package/dist/components/external-link-field.cjs.map +1 -1
- package/dist/components/external-link-field.d.cts +1 -2
- package/dist/components/external-link-field.d.ts +1 -2
- package/dist/components/external-link-field.js.map +1 -1
- package/dist/components/fast-mint/fast-mint.d.cts +2 -2
- package/dist/components/fast-mint/fast-mint.d.ts +2 -2
- package/dist/components/floating-comments-button.cjs +2 -2
- package/dist/components/floating-comments-button.cjs.map +1 -1
- package/dist/components/floating-comments-button.js +3 -3
- package/dist/components/floating-comments-button.js.map +1 -1
- package/dist/components/home-page.cjs +2 -1
- package/dist/components/home-page.cjs.map +1 -1
- package/dist/components/home-page.d.cts +1 -1
- package/dist/components/home-page.d.ts +1 -1
- package/dist/components/home-page.js +2 -1
- package/dist/components/home-page.js.map +1 -1
- package/dist/components/ip-type-page.cjs +2 -1
- package/dist/components/ip-type-page.cjs.map +1 -1
- package/dist/components/ip-type-page.d.cts +1 -1
- package/dist/components/ip-type-page.d.ts +1 -1
- package/dist/components/ip-type-page.js +2 -1
- package/dist/components/ip-type-page.js.map +1 -1
- package/dist/components/launchpad/coin-create.cjs +2 -2
- package/dist/components/launchpad/coin-create.cjs.map +1 -1
- package/dist/components/launchpad/coin-create.js +2 -2
- package/dist/components/launchpad/coin-create.js.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.cjs +1 -1
- package/dist/components/launchpad/edition-mint-schema.cjs.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.d.cts +31 -35
- package/dist/components/launchpad/edition-mint-schema.d.ts +31 -35
- package/dist/components/launchpad/edition-mint-schema.js +1 -1
- package/dist/components/launchpad/edition-mint-schema.js.map +1 -1
- package/dist/components/launchpad/pop-create-fields.cjs.map +1 -1
- package/dist/components/launchpad/pop-create-fields.d.cts +3 -3
- package/dist/components/launchpad/pop-create-fields.d.ts +3 -3
- package/dist/components/launchpad/pop-create-fields.js.map +1 -1
- package/dist/components/launchpad/pop-create-schema.cjs.map +1 -1
- package/dist/components/launchpad/pop-create-schema.d.cts +6 -32
- package/dist/components/launchpad/pop-create-schema.d.ts +6 -32
- package/dist/components/launchpad/pop-create-schema.js.map +1 -1
- package/dist/components/launchpad/pop-create.cjs.map +1 -1
- package/dist/components/launchpad/pop-create.js.map +1 -1
- package/dist/components/launchpad/single-edition-mint.cjs +1 -1
- package/dist/components/launchpad/single-edition-mint.cjs.map +1 -1
- package/dist/components/launchpad/single-edition-mint.js +1 -1
- package/dist/components/launchpad/single-edition-mint.js.map +1 -1
- package/dist/components/launchpad/tier-mint-form.cjs +1 -1
- package/dist/components/launchpad/tier-mint-form.cjs.map +1 -1
- package/dist/components/launchpad/tier-mint-form.js +1 -1
- package/dist/components/launchpad/tier-mint-form.js.map +1 -1
- package/dist/components/launchpad-services.cjs +2 -2
- package/dist/components/launchpad-services.cjs.map +1 -1
- package/dist/components/launchpad-services.js +3 -3
- package/dist/components/launchpad-services.js.map +1 -1
- package/dist/components/lazy-panel.cjs +60 -0
- package/dist/components/lazy-panel.cjs.map +1 -0
- package/dist/components/lazy-panel.d.cts +14 -0
- package/dist/components/lazy-panel.d.ts +14 -0
- package/dist/components/lazy-panel.js +26 -0
- package/dist/components/lazy-panel.js.map +1 -0
- package/dist/components/listings-grid.cjs +9 -1
- package/dist/components/listings-grid.cjs.map +1 -1
- package/dist/components/listings-grid.d.cts +3 -2
- package/dist/components/listings-grid.d.ts +3 -2
- package/dist/components/listings-grid.js +9 -1
- package/dist/components/listings-grid.js.map +1 -1
- package/dist/components/markdown-renderer.cjs +49 -0
- package/dist/components/markdown-renderer.cjs.map +1 -0
- package/dist/components/markdown-renderer.d.cts +7 -0
- package/dist/components/markdown-renderer.d.ts +7 -0
- package/dist/components/markdown-renderer.js +19 -0
- package/dist/components/markdown-renderer.js.map +1 -0
- package/dist/components/markdown-text.cjs +3 -11
- package/dist/components/markdown-text.cjs.map +1 -1
- package/dist/components/markdown-text.js +3 -11
- package/dist/components/markdown-text.js.map +1 -1
- package/dist/components/marketplace/accept-offer-dialog.cjs +180 -0
- package/dist/components/marketplace/accept-offer-dialog.cjs.map +1 -0
- package/dist/components/marketplace/accept-offer-dialog.d.cts +17 -0
- package/dist/components/marketplace/accept-offer-dialog.d.ts +17 -0
- package/dist/components/marketplace/accept-offer-dialog.js +156 -0
- package/dist/components/marketplace/accept-offer-dialog.js.map +1 -0
- package/dist/components/marketplace/approve-mint-flow.cjs +85 -0
- package/dist/components/marketplace/approve-mint-flow.cjs.map +1 -0
- package/dist/components/marketplace/approve-mint-flow.d.cts +12 -0
- package/dist/components/marketplace/approve-mint-flow.d.ts +12 -0
- package/dist/components/marketplace/approve-mint-flow.js +61 -0
- package/dist/components/marketplace/approve-mint-flow.js.map +1 -0
- package/dist/components/marketplace/asset-market-actions.cjs +175 -0
- package/dist/components/marketplace/asset-market-actions.cjs.map +1 -0
- package/dist/components/marketplace/asset-market-actions.d.cts +9 -0
- package/dist/components/marketplace/asset-market-actions.d.ts +9 -0
- package/dist/components/marketplace/asset-market-actions.js +151 -0
- package/dist/components/marketplace/asset-market-actions.js.map +1 -0
- package/dist/components/marketplace/cancel-order-dialog.cjs +82 -0
- package/dist/components/marketplace/cancel-order-dialog.cjs.map +1 -0
- package/dist/components/marketplace/cancel-order-dialog.d.cts +17 -0
- package/dist/components/marketplace/cancel-order-dialog.d.ts +17 -0
- package/dist/components/marketplace/cancel-order-dialog.js +58 -0
- package/dist/components/marketplace/cancel-order-dialog.js.map +1 -0
- package/dist/components/marketplace/counter-offer-dialog.cjs +236 -0
- package/dist/components/marketplace/counter-offer-dialog.cjs.map +1 -0
- package/dist/components/marketplace/counter-offer-dialog.d.cts +16 -0
- package/dist/components/marketplace/counter-offer-dialog.d.ts +16 -0
- package/dist/components/marketplace/counter-offer-dialog.js +212 -0
- package/dist/components/marketplace/counter-offer-dialog.js.map +1 -0
- package/dist/components/marketplace/dialog-frame.cjs +65 -0
- package/dist/components/marketplace/dialog-frame.cjs.map +1 -0
- package/dist/components/marketplace/dialog-frame.d.cts +22 -0
- package/dist/components/marketplace/dialog-frame.d.ts +22 -0
- package/dist/components/marketplace/dialog-frame.js +38 -0
- package/dist/components/marketplace/dialog-frame.js.map +1 -0
- package/dist/components/marketplace/lazy-dialogs.cjs +66 -0
- package/dist/components/marketplace/lazy-dialogs.cjs.map +1 -0
- package/dist/components/marketplace/lazy-dialogs.d.cts +25 -0
- package/dist/components/marketplace/lazy-dialogs.d.ts +25 -0
- package/dist/components/marketplace/lazy-dialogs.js +26 -0
- package/dist/components/marketplace/lazy-dialogs.js.map +1 -0
- package/dist/components/marketplace/listing-dialog.cjs +183 -0
- package/dist/components/marketplace/listing-dialog.cjs.map +1 -0
- package/dist/components/marketplace/listing-dialog.d.cts +16 -0
- package/dist/components/marketplace/listing-dialog.d.ts +16 -0
- package/dist/components/marketplace/listing-dialog.js +159 -0
- package/dist/components/marketplace/listing-dialog.js.map +1 -0
- package/dist/components/marketplace/market-actions.cjs +59 -0
- package/dist/components/marketplace/market-actions.cjs.map +1 -0
- package/dist/components/marketplace/market-actions.d.cts +9 -0
- package/dist/components/marketplace/market-actions.d.ts +9 -0
- package/dist/components/marketplace/market-actions.js +35 -0
- package/dist/components/marketplace/market-actions.js.map +1 -0
- package/dist/components/marketplace/offer-dialog.cjs +194 -0
- package/dist/components/marketplace/offer-dialog.cjs.map +1 -0
- package/dist/components/marketplace/offer-dialog.d.cts +14 -0
- package/dist/components/marketplace/offer-dialog.d.ts +14 -0
- package/dist/components/marketplace/offer-dialog.js +170 -0
- package/dist/components/marketplace/offer-dialog.js.map +1 -0
- package/dist/components/marketplace/portfolio-actions.cjs +287 -0
- package/dist/components/marketplace/portfolio-actions.cjs.map +1 -0
- package/dist/components/marketplace/portfolio-actions.d.cts +16 -0
- package/dist/components/marketplace/portfolio-actions.d.ts +16 -0
- package/dist/components/marketplace/portfolio-actions.js +249 -0
- package/dist/components/marketplace/portfolio-actions.js.map +1 -0
- package/dist/components/marketplace/purchase-dialog.cjs +174 -0
- package/dist/components/marketplace/purchase-dialog.cjs.map +1 -0
- package/dist/components/marketplace/purchase-dialog.d.cts +12 -0
- package/dist/components/marketplace/purchase-dialog.d.ts +12 -0
- package/dist/components/marketplace/purchase-dialog.js +150 -0
- package/dist/components/marketplace/purchase-dialog.js.map +1 -0
- package/dist/components/marketplace/transfer-asset-dialog.cjs +74 -0
- package/dist/components/marketplace/transfer-asset-dialog.cjs.map +1 -0
- package/dist/components/marketplace/transfer-asset-dialog.d.cts +16 -0
- package/dist/components/marketplace/transfer-asset-dialog.d.ts +16 -0
- package/dist/components/marketplace/transfer-asset-dialog.js +50 -0
- package/dist/components/marketplace/transfer-asset-dialog.js.map +1 -0
- package/dist/components/marketplace-dialog-primitives.cjs +2 -2
- package/dist/components/marketplace-dialog-primitives.cjs.map +1 -1
- package/dist/components/marketplace-dialog-primitives.d.cts +9 -4
- package/dist/components/marketplace-dialog-primitives.d.ts +9 -4
- package/dist/components/marketplace-dialog-primitives.js +2 -2
- package/dist/components/marketplace-dialog-primitives.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-overlay.cjs +3 -64
- package/dist/components/media-wallet/media-wallet-overlay.cjs.map +1 -1
- package/dist/components/media-wallet/media-wallet-overlay.js +4 -65
- package/dist/components/media-wallet/media-wallet-overlay.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-panel.cjs +102 -0
- package/dist/components/media-wallet/media-wallet-panel.cjs.map +1 -0
- package/dist/components/media-wallet/media-wallet-panel.d.cts +14 -0
- package/dist/components/media-wallet/media-wallet-panel.d.ts +14 -0
- package/dist/components/media-wallet/media-wallet-panel.js +72 -0
- package/dist/components/media-wallet/media-wallet-panel.js.map +1 -0
- package/dist/components/media-wallet/success-dialog.cjs +1 -1
- package/dist/components/media-wallet/success-dialog.cjs.map +1 -1
- package/dist/components/media-wallet/success-dialog.js +1 -1
- package/dist/components/media-wallet/success-dialog.js.map +1 -1
- package/dist/components/medialane-app.cjs +24 -1
- package/dist/components/medialane-app.cjs.map +1 -1
- package/dist/components/medialane-app.d.cts +7 -1
- package/dist/components/medialane-app.d.ts +7 -1
- package/dist/components/medialane-app.js +13 -1
- package/dist/components/medialane-app.js.map +1 -1
- package/dist/components/motion-features.cjs +26 -0
- package/dist/components/motion-features.cjs.map +1 -0
- package/dist/components/motion-features.d.cts +2 -0
- package/dist/components/motion-features.d.ts +2 -0
- package/dist/components/motion-features.js +6 -0
- package/dist/components/motion-features.js.map +1 -0
- package/dist/components/motion-primitives.cjs +6 -6
- package/dist/components/motion-primitives.cjs.map +1 -1
- package/dist/components/motion-primitives.js +7 -7
- package/dist/components/motion-primitives.js.map +1 -1
- package/dist/components/nav-account-panel.cjs +75 -0
- package/dist/components/nav-account-panel.cjs.map +1 -0
- package/dist/components/nav-account-panel.d.cts +11 -0
- package/dist/components/nav-account-panel.d.ts +11 -0
- package/dist/components/nav-account-panel.js +55 -0
- package/dist/components/nav-account-panel.js.map +1 -0
- package/dist/components/nav-command-dialog.cjs +325 -0
- package/dist/components/nav-command-dialog.cjs.map +1 -0
- package/dist/components/nav-command-dialog.d.cts +11 -0
- package/dist/components/nav-command-dialog.d.ts +11 -0
- package/dist/components/nav-command-dialog.js +295 -0
- package/dist/components/nav-command-dialog.js.map +1 -0
- package/dist/components/nav-command-match.cjs +46 -0
- package/dist/components/nav-command-match.cjs.map +1 -0
- package/dist/components/nav-command-match.d.cts +9 -0
- package/dist/components/nav-command-match.d.ts +9 -0
- package/dist/components/nav-command-match.js +20 -0
- package/dist/components/nav-command-match.js.map +1 -0
- package/dist/components/nav-command-menu.cjs +5 -302
- package/dist/components/nav-command-menu.cjs.map +1 -1
- package/dist/components/nav-command-menu.d.cts +2 -4
- package/dist/components/nav-command-menu.d.ts +2 -4
- package/dist/components/nav-command-menu.js +5 -300
- package/dist/components/nav-command-menu.js.map +1 -1
- package/dist/components/nav-shell.cjs +3 -46
- package/dist/components/nav-shell.cjs.map +1 -1
- package/dist/components/nav-shell.js +4 -47
- package/dist/components/nav-shell.js.map +1 -1
- package/dist/components/portfolio-assets.cjs +2 -1
- package/dist/components/portfolio-assets.cjs.map +1 -1
- package/dist/components/portfolio-assets.d.cts +1 -1
- package/dist/components/portfolio-assets.d.ts +1 -1
- package/dist/components/portfolio-assets.js +2 -1
- package/dist/components/portfolio-assets.js.map +1 -1
- package/dist/components/portfolio-licensing-page.cjs +166 -0
- package/dist/components/portfolio-licensing-page.cjs.map +1 -0
- package/dist/components/portfolio-licensing-page.d.cts +5 -0
- package/dist/components/portfolio-licensing-page.d.ts +5 -0
- package/dist/components/portfolio-licensing-page.js +132 -0
- package/dist/components/portfolio-licensing-page.js.map +1 -0
- package/dist/components/portfolio-orders.cjs +8 -1
- package/dist/components/portfolio-orders.cjs.map +1 -1
- package/dist/components/portfolio-orders.d.cts +1 -1
- package/dist/components/portfolio-orders.d.ts +1 -1
- package/dist/components/portfolio-orders.js +8 -1
- package/dist/components/portfolio-orders.js.map +1 -1
- package/dist/components/rewards/rewards-dashboard.cjs +2 -2
- package/dist/components/rewards/rewards-dashboard.cjs.map +1 -1
- package/dist/components/rewards/rewards-dashboard.js +2 -2
- package/dist/components/rewards/rewards-dashboard.js.map +1 -1
- package/dist/data/launchpad-services.cjs +2 -2
- package/dist/data/launchpad-services.cjs.map +1 -1
- package/dist/data/launchpad-services.js +2 -2
- package/dist/data/launchpad-services.js.map +1 -1
- package/dist/data/nav-commands.cjs +1 -1
- package/dist/data/nav-commands.cjs.map +1 -1
- package/dist/data/nav-commands.js +1 -1
- package/dist/data/nav-commands.js.map +1 -1
- package/dist/i18n/catalog/pt.cjs +93 -7
- package/dist/i18n/catalog/pt.cjs.map +1 -1
- package/dist/i18n/catalog/pt.js +93 -7
- package/dist/i18n/catalog/pt.js.map +1 -1
- package/dist/index.cjs +121 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.js +82 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/app-client.cjs +60 -0
- package/dist/utils/app-client.cjs.map +1 -0
- package/dist/utils/app-client.d.cts +19 -0
- package/dist/utils/app-client.d.ts +19 -0
- package/dist/utils/app-client.js +38 -0
- package/dist/utils/app-client.js.map +1 -0
- package/dist/utils/duration-options.cjs +46 -0
- package/dist/utils/duration-options.cjs.map +1 -0
- package/dist/utils/duration-options.d.cts +40 -0
- package/dist/utils/duration-options.d.ts +40 -0
- package/dist/utils/duration-options.js +21 -0
- package/dist/utils/duration-options.js.map +1 -0
- package/dist/utils/launchpad-rules.d.cts +1 -1
- package/dist/utils/launchpad-rules.d.ts +1 -1
- package/dist/utils/marketplace/intents.cjs +178 -0
- package/dist/utils/marketplace/intents.cjs.map +1 -0
- package/dist/utils/marketplace/intents.d.cts +74 -0
- package/dist/utils/marketplace/intents.d.ts +74 -0
- package/dist/utils/marketplace/intents.js +148 -0
- package/dist/utils/marketplace/intents.js.map +1 -0
- package/dist/utils/marketplace/remix-approval.cjs +93 -0
- package/dist/utils/marketplace/remix-approval.cjs.map +1 -0
- package/dist/utils/marketplace/remix-approval.d.cts +26 -0
- package/dist/utils/marketplace/remix-approval.d.ts +26 -0
- package/dist/utils/marketplace/remix-approval.js +69 -0
- package/dist/utils/marketplace/remix-approval.js.map +1 -0
- package/dist/utils/marketplace/swap-intent.cjs +46 -0
- package/dist/utils/marketplace/swap-intent.cjs.map +1 -0
- package/dist/utils/marketplace/swap-intent.d.cts +18 -0
- package/dist/utils/marketplace/swap-intent.d.ts +18 -0
- package/dist/utils/marketplace/swap-intent.js +22 -0
- package/dist/utils/marketplace/swap-intent.js.map +1 -0
- package/dist/utils/marketplace/token-standard.cjs +46 -0
- package/dist/utils/marketplace/token-standard.cjs.map +1 -0
- package/dist/utils/marketplace/token-standard.d.cts +13 -0
- package/dist/utils/marketplace/token-standard.d.ts +13 -0
- package/dist/utils/marketplace/token-standard.js +20 -0
- package/dist/utils/marketplace/token-standard.js.map +1 -0
- package/dist/utils/marketplace/use-accept-offer.cjs +103 -0
- package/dist/utils/marketplace/use-accept-offer.cjs.map +1 -0
- package/dist/utils/marketplace/use-accept-offer.d.cts +132 -0
- package/dist/utils/marketplace/use-accept-offer.d.ts +132 -0
- package/dist/utils/marketplace/use-accept-offer.js +79 -0
- package/dist/utils/marketplace/use-accept-offer.js.map +1 -0
- package/dist/utils/marketplace/use-cancel-order.cjs +67 -0
- package/dist/utils/marketplace/use-cancel-order.cjs.map +1 -0
- package/dist/utils/marketplace/use-cancel-order.d.cts +74 -0
- package/dist/utils/marketplace/use-cancel-order.d.ts +74 -0
- package/dist/utils/marketplace/use-cancel-order.js +43 -0
- package/dist/utils/marketplace/use-cancel-order.js.map +1 -0
- package/dist/utils/marketplace/use-marketplace-transaction.cjs +80 -0
- package/dist/utils/marketplace/use-marketplace-transaction.cjs.map +1 -0
- package/dist/utils/marketplace/use-marketplace-transaction.d.cts +21 -0
- package/dist/utils/marketplace/use-marketplace-transaction.d.ts +21 -0
- package/dist/utils/marketplace/use-marketplace-transaction.js +55 -0
- package/dist/utils/marketplace/use-marketplace-transaction.js.map +1 -0
- package/dist/utils/marketplace/use-resolved-token-standard.cjs +40 -0
- package/dist/utils/marketplace/use-resolved-token-standard.cjs.map +1 -0
- package/dist/utils/marketplace/use-resolved-token-standard.d.cts +9 -0
- package/dist/utils/marketplace/use-resolved-token-standard.d.ts +9 -0
- package/dist/utils/marketplace/use-resolved-token-standard.js +16 -0
- package/dist/utils/marketplace/use-resolved-token-standard.js.map +1 -0
- package/dist/utils/media-wallet/confetti.cjs +6 -6
- package/dist/utils/media-wallet/confetti.cjs.map +1 -1
- package/dist/utils/media-wallet/confetti.d.cts +1 -1
- package/dist/utils/media-wallet/confetti.d.ts +1 -1
- package/dist/utils/media-wallet/confetti.js +2 -2
- package/dist/utils/media-wallet/confetti.js.map +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.cjs +0 -1
- package/dist/utils/media-wallet/use-erc20-balance.cjs.map +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.d.cts +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.d.ts +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.js +0 -1
- package/dist/utils/media-wallet/use-erc20-balance.js.map +1 -1
- package/dist/utils/order-form.d.cts +5 -23
- package/dist/utils/order-form.d.ts +5 -23
- package/dist/utils/security-headers.cjs +58 -0
- package/dist/utils/security-headers.cjs.map +1 -0
- package/dist/utils/security-headers.d.cts +16 -0
- package/dist/utils/security-headers.d.ts +16 -0
- package/dist/utils/security-headers.js +34 -0
- package/dist/utils/security-headers.js.map +1 -0
- package/dist/utils/seo.cjs +100 -0
- package/dist/utils/seo.cjs.map +1 -0
- package/dist/utils/seo.d.cts +55 -0
- package/dist/utils/seo.d.ts +55 -0
- package/dist/utils/seo.js +75 -0
- package/dist/utils/seo.js.map +1 -0
- package/dist/utils/use-accounts.cjs +1 -1
- package/dist/utils/use-accounts.cjs.map +1 -1
- package/dist/utils/use-accounts.js +1 -1
- package/dist/utils/use-accounts.js.map +1 -1
- package/dist/utils/use-activities.cjs +2 -4
- package/dist/utils/use-activities.cjs.map +1 -1
- package/dist/utils/use-activities.js +2 -4
- package/dist/utils/use-activities.js.map +1 -1
- package/dist/utils/use-coin-guarantees.cjs +1 -1
- package/dist/utils/use-coin-guarantees.cjs.map +1 -1
- package/dist/utils/use-coin-guarantees.js +1 -1
- package/dist/utils/use-coin-guarantees.js.map +1 -1
- package/dist/utils/use-coin-price.cjs +1 -1
- package/dist/utils/use-coin-price.cjs.map +1 -1
- package/dist/utils/use-coin-price.js +1 -1
- package/dist/utils/use-coin-price.js.map +1 -1
- package/dist/utils/use-coin-supply.cjs +1 -1
- package/dist/utils/use-coin-supply.cjs.map +1 -1
- package/dist/utils/use-coin-supply.js +1 -1
- package/dist/utils/use-coin-supply.js.map +1 -1
- package/dist/utils/use-collections.cjs +3 -6
- package/dist/utils/use-collections.cjs.map +1 -1
- package/dist/utils/use-collections.js +3 -6
- package/dist/utils/use-collections.js.map +1 -1
- package/dist/utils/use-comments.cjs +1 -1
- package/dist/utils/use-comments.cjs.map +1 -1
- package/dist/utils/use-comments.js +1 -1
- package/dist/utils/use-comments.js.map +1 -1
- package/dist/utils/use-confetti.cjs +1 -1
- package/dist/utils/use-confetti.cjs.map +1 -1
- package/dist/utils/use-confetti.js +1 -1
- package/dist/utils/use-confetti.js.map +1 -1
- package/dist/utils/use-drops.cjs +2 -2
- package/dist/utils/use-drops.cjs.map +1 -1
- package/dist/utils/use-drops.js +2 -2
- package/dist/utils/use-drops.js.map +1 -1
- package/dist/utils/use-full-token-data.cjs +1 -1
- package/dist/utils/use-full-token-data.cjs.map +1 -1
- package/dist/utils/use-full-token-data.js +1 -1
- package/dist/utils/use-full-token-data.js.map +1 -1
- package/dist/utils/use-gated-content.cjs +56 -0
- package/dist/utils/use-gated-content.cjs.map +1 -0
- package/dist/utils/use-gated-content.d.cts +7 -0
- package/dist/utils/use-gated-content.d.ts +7 -0
- package/dist/utils/use-gated-content.js +22 -0
- package/dist/utils/use-gated-content.js.map +1 -0
- package/dist/utils/use-my-remix-offers.cjs +0 -1
- package/dist/utils/use-my-remix-offers.cjs.map +1 -1
- package/dist/utils/use-my-remix-offers.js +0 -1
- package/dist/utils/use-my-remix-offers.js.map +1 -1
- package/dist/utils/use-my-username-claim.cjs +52 -0
- package/dist/utils/use-my-username-claim.cjs.map +1 -0
- package/dist/utils/use-my-username-claim.d.cts +15 -0
- package/dist/utils/use-my-username-claim.d.ts +15 -0
- package/dist/utils/use-my-username-claim.js +18 -0
- package/dist/utils/use-my-username-claim.js.map +1 -0
- package/dist/utils/use-orders.cjs +7 -9
- package/dist/utils/use-orders.cjs.map +1 -1
- package/dist/utils/use-orders.js +7 -9
- package/dist/utils/use-orders.js.map +1 -1
- package/dist/utils/use-platform-stats.cjs +1 -1
- package/dist/utils/use-platform-stats.cjs.map +1 -1
- package/dist/utils/use-platform-stats.js +1 -1
- package/dist/utils/use-platform-stats.js.map +1 -1
- package/dist/utils/use-pop.cjs +3 -5
- package/dist/utils/use-pop.cjs.map +1 -1
- package/dist/utils/use-pop.js +3 -5
- package/dist/utils/use-pop.js.map +1 -1
- package/dist/utils/use-profiles.cjs +3 -4
- package/dist/utils/use-profiles.cjs.map +1 -1
- package/dist/utils/use-profiles.js +3 -4
- package/dist/utils/use-profiles.js.map +1 -1
- package/dist/utils/use-remix-offers.cjs +1 -2
- package/dist/utils/use-remix-offers.cjs.map +1 -1
- package/dist/utils/use-remix-offers.js +1 -2
- package/dist/utils/use-remix-offers.js.map +1 -1
- package/dist/utils/use-rewards.cjs +5 -5
- package/dist/utils/use-rewards.cjs.map +1 -1
- package/dist/utils/use-rewards.js +5 -5
- package/dist/utils/use-rewards.js.map +1 -1
- package/dist/utils/use-search.cjs +1 -1
- package/dist/utils/use-search.cjs.map +1 -1
- package/dist/utils/use-search.js +1 -1
- package/dist/utils/use-search.js.map +1 -1
- package/dist/utils/use-sponsorship.cjs +6 -12
- package/dist/utils/use-sponsorship.cjs.map +1 -1
- package/dist/utils/use-sponsorship.js +6 -12
- package/dist/utils/use-sponsorship.js.map +1 -1
- package/dist/utils/use-swap-quote.cjs +0 -1
- package/dist/utils/use-swap-quote.cjs.map +1 -1
- package/dist/utils/use-swap-quote.js +0 -1
- package/dist/utils/use-swap-quote.js.map +1 -1
- package/dist/utils/use-tiers.cjs +6 -7
- package/dist/utils/use-tiers.cjs.map +1 -1
- package/dist/utils/use-tiers.js +6 -7
- package/dist/utils/use-tiers.js.map +1 -1
- package/dist/utils/use-tokens-by-ip-type.cjs +1 -2
- package/dist/utils/use-tokens-by-ip-type.cjs.map +1 -1
- package/dist/utils/use-tokens-by-ip-type.js +1 -2
- package/dist/utils/use-tokens-by-ip-type.js.map +1 -1
- package/dist/utils/use-tokens.cjs +4 -7
- package/dist/utils/use-tokens.cjs.map +1 -1
- package/dist/utils/use-tokens.js +4 -7
- package/dist/utils/use-tokens.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import Image from "next/image";
|
|
5
|
+
import { AlertCircle, CheckCircle2, ExternalLink, Loader2, Sparkles } from "lucide-react";
|
|
6
|
+
import { Button } from "../button.js";
|
|
7
|
+
import { useAcceptOffer } from "../../utils/marketplace/use-accept-offer.js";
|
|
8
|
+
import { useCancelOrder } from "../../utils/marketplace/use-cancel-order.js";
|
|
9
|
+
import { MarketplaceDialog } from "./dialog-frame.js";
|
|
10
|
+
import { AcceptOfferDialog, CancelOrderDialog, CounterOfferDialog, ListingDialog, TransferDialog } from "./lazy-dialogs.js";
|
|
11
|
+
import { SUPPORTED_TOKENS } from "@medialane/sdk";
|
|
12
|
+
import { EXPLORER_URL } from "../../utils/explorer-url.js";
|
|
13
|
+
import { ArchiveAssetDialog } from "../archive-asset-dialog.js";
|
|
14
|
+
import { formatDisplayPrice } from "../../utils/format.js";
|
|
15
|
+
import { IconTile } from "../icon-tile.js";
|
|
16
|
+
import { useMarketplaceTransaction } from "../../utils/marketplace/use-marketplace-transaction.js";
|
|
17
|
+
import { fulfillOrder } from "../../utils/marketplace/intents.js";
|
|
18
|
+
import { useImageUrl } from "../../utils/use-image-url.js";
|
|
19
|
+
import { useT } from "../../i18n/index.js";
|
|
20
|
+
function useCancelActions(variant, { refresh }) {
|
|
21
|
+
const cancel = useCancelOrder({ onSuccess: refresh });
|
|
22
|
+
return {
|
|
23
|
+
isProcessing: cancel.busy,
|
|
24
|
+
cancel: cancel.select,
|
|
25
|
+
dialogs: /* @__PURE__ */ jsx(CancelOrderDialog, { hook: cancel, variant })
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const useListingActions = (context) => useCancelActions("listing", context);
|
|
29
|
+
const useOfferActions = (context) => useCancelActions("offer", context);
|
|
30
|
+
function useReceivedOfferActions({ refresh }) {
|
|
31
|
+
const resolveImage = useImageUrl();
|
|
32
|
+
const acceptOffer = useAcceptOffer({ mutateListings: refresh });
|
|
33
|
+
const [counterOrder, setCounterOrder] = useState(null);
|
|
34
|
+
const token = counterOrder ? SUPPORTED_TOKENS.find((t) => t.symbol === counterOrder.price.currency) : void 0;
|
|
35
|
+
return {
|
|
36
|
+
isProcessing: acceptOffer.busy,
|
|
37
|
+
accept: (order) => acceptOffer.handleAcceptClick(order),
|
|
38
|
+
counter: setCounterOrder,
|
|
39
|
+
dialogs: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
40
|
+
/* @__PURE__ */ jsx(AcceptOfferDialog, { hook: acceptOffer }),
|
|
41
|
+
counterOrder && /* @__PURE__ */ jsx(
|
|
42
|
+
CounterOfferDialog,
|
|
43
|
+
{
|
|
44
|
+
open: !!counterOrder,
|
|
45
|
+
onOpenChange: (v) => {
|
|
46
|
+
if (!v) setCounterOrder(null);
|
|
47
|
+
},
|
|
48
|
+
originalOrderHash: counterOrder.orderHash,
|
|
49
|
+
tokenName: counterOrder.token?.name ?? void 0,
|
|
50
|
+
tokenImage: resolveImage(counterOrder.token?.image),
|
|
51
|
+
tokenId: counterOrder.nftTokenId ?? void 0,
|
|
52
|
+
currentBid: `${formatDisplayPrice(counterOrder.price.formatted)} ${counterOrder.price.currency}`,
|
|
53
|
+
currencySymbol: counterOrder.price.currency ?? "",
|
|
54
|
+
currencyDecimals: token?.decimals ?? 18
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
] })
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function useCounterOfferActions({ refresh }) {
|
|
61
|
+
const t = useT();
|
|
62
|
+
const resolveImage = useImageUrl();
|
|
63
|
+
const tx = useMarketplaceTransaction();
|
|
64
|
+
const [selectedCounter, setSelectedCounter] = useState(null);
|
|
65
|
+
const resultTxHash = tx.txHash;
|
|
66
|
+
const resultError = tx.error;
|
|
67
|
+
const handleAccept = (counter) => {
|
|
68
|
+
setSelectedCounter(counter);
|
|
69
|
+
void tx.start((ctx) => fulfillOrder(ctx, {
|
|
70
|
+
orderHash: counter.orderHash,
|
|
71
|
+
tokenStandard: counter.consideration.itemType
|
|
72
|
+
})).then(() => refresh());
|
|
73
|
+
};
|
|
74
|
+
const dismissResult = () => {
|
|
75
|
+
if (tx.busy) return;
|
|
76
|
+
tx.reset();
|
|
77
|
+
setSelectedCounter(null);
|
|
78
|
+
};
|
|
79
|
+
const counterDisplayName = selectedCounter?.token?.name || `#${selectedCounter?.nftTokenId ?? ""}`;
|
|
80
|
+
const counterImage = resolveImage(selectedCounter?.token?.image);
|
|
81
|
+
return {
|
|
82
|
+
isProcessing: tx.busy,
|
|
83
|
+
accept: handleAccept,
|
|
84
|
+
dialogs: /* @__PURE__ */ jsxs(
|
|
85
|
+
MarketplaceDialog,
|
|
86
|
+
{
|
|
87
|
+
open: tx.phase !== "idle",
|
|
88
|
+
onOpenChange: (v) => {
|
|
89
|
+
if (!v) dismissResult();
|
|
90
|
+
},
|
|
91
|
+
title: t("Counter-offer accept"),
|
|
92
|
+
description: t("On-chain status for the counter-offer you accepted."),
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-3 pt-6 px-6", children: [
|
|
95
|
+
/* @__PURE__ */ jsxs("div", { className: "relative h-24 w-24 rounded-xl overflow-hidden border border-border bg-muted", children: [
|
|
96
|
+
counterImage && /* @__PURE__ */ jsx(
|
|
97
|
+
Image,
|
|
98
|
+
{
|
|
99
|
+
src: counterImage,
|
|
100
|
+
alt: counterDisplayName,
|
|
101
|
+
fill: true,
|
|
102
|
+
unoptimized: true,
|
|
103
|
+
sizes: "96px",
|
|
104
|
+
className: "object-cover"
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
tx.phase === "success" && /* @__PURE__ */ jsx("div", { className: "absolute -bottom-1 -right-1 h-7 w-7 rounded-full bg-background flex items-center justify-center", children: /* @__PURE__ */ jsx(CheckCircle2, { className: "h-6 w-6 text-emerald-500" }) })
|
|
108
|
+
] }),
|
|
109
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-base text-center truncate w-full", children: counterDisplayName })
|
|
110
|
+
] }),
|
|
111
|
+
tx.busy && /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-4 p-6 pt-3", children: [
|
|
112
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-7 w-7 animate-spin text-primary" }),
|
|
113
|
+
/* @__PURE__ */ jsxs("div", { className: "text-center space-y-1", children: [
|
|
114
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold", children: t("Confirming onchain\u2026") }),
|
|
115
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("Keep this window open until it finishes.") })
|
|
116
|
+
] })
|
|
117
|
+
] }),
|
|
118
|
+
tx.phase === "success" && /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-4 p-6 pt-3", children: [
|
|
119
|
+
/* @__PURE__ */ jsxs("div", { className: "text-center space-y-1", children: [
|
|
120
|
+
/* @__PURE__ */ jsxs("p", { className: "font-bold text-lg flex items-center justify-center gap-1.5", children: [
|
|
121
|
+
t("Counter-offer accepted"),
|
|
122
|
+
/* @__PURE__ */ jsx(Sparkles, { className: "h-4 w-4 text-brand-orange" })
|
|
123
|
+
] }),
|
|
124
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("The token is now yours.") })
|
|
125
|
+
] }),
|
|
126
|
+
resultTxHash && /* @__PURE__ */ jsxs(
|
|
127
|
+
"a",
|
|
128
|
+
{
|
|
129
|
+
href: `${EXPLORER_URL}/tx/${resultTxHash}`,
|
|
130
|
+
target: "_blank",
|
|
131
|
+
rel: "noopener noreferrer",
|
|
132
|
+
className: "inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors tabular-nums",
|
|
133
|
+
children: [
|
|
134
|
+
resultTxHash.slice(0, 10),
|
|
135
|
+
"\u2026",
|
|
136
|
+
resultTxHash.slice(-8),
|
|
137
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "h-3 w-3" })
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
/* @__PURE__ */ jsx(Button, { className: "w-full h-11", onClick: dismissResult, children: t("Done") })
|
|
142
|
+
] }),
|
|
143
|
+
tx.phase === "error" && /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-4 p-6 pt-3", children: [
|
|
144
|
+
/* @__PURE__ */ jsx(IconTile, { destructive: true, children: /* @__PURE__ */ jsx(AlertCircle, {}) }),
|
|
145
|
+
/* @__PURE__ */ jsxs("div", { className: "text-center space-y-1", children: [
|
|
146
|
+
/* @__PURE__ */ jsx("p", { className: "font-bold text-base", children: t("Accept failed") }),
|
|
147
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: resultError })
|
|
148
|
+
] }),
|
|
149
|
+
/* @__PURE__ */ jsx(Button, { variant: "soft", className: "w-full h-11", onClick: dismissResult, children: t("Close") })
|
|
150
|
+
] })
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function useAssetActions({ refresh }) {
|
|
157
|
+
const [selectedToken, setSelectedToken] = useState(null);
|
|
158
|
+
const [listOpen, setListOpen] = useState(false);
|
|
159
|
+
const [transferToken, setTransferToken] = useState(null);
|
|
160
|
+
const [transferOpen, setTransferOpen] = useState(false);
|
|
161
|
+
const [archiveToken, setArchiveToken] = useState(null);
|
|
162
|
+
const [cancelToken, setCancelToken] = useState(null);
|
|
163
|
+
const cancelListing = useCancelOrder({ onSuccess: refresh });
|
|
164
|
+
const handleSuccess = refresh;
|
|
165
|
+
return {
|
|
166
|
+
list: (token) => {
|
|
167
|
+
setSelectedToken(token);
|
|
168
|
+
setListOpen(true);
|
|
169
|
+
},
|
|
170
|
+
transfer: (token) => {
|
|
171
|
+
setTransferToken(token);
|
|
172
|
+
setTransferOpen(true);
|
|
173
|
+
},
|
|
174
|
+
archive: setArchiveToken,
|
|
175
|
+
cancel: (token) => {
|
|
176
|
+
const listing = token.activeOrders?.[0];
|
|
177
|
+
if (!listing) return;
|
|
178
|
+
setCancelToken(token);
|
|
179
|
+
cancelListing.select(listing);
|
|
180
|
+
},
|
|
181
|
+
dialogs: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
182
|
+
selectedToken && /* @__PURE__ */ jsx(
|
|
183
|
+
ListingDialog,
|
|
184
|
+
{
|
|
185
|
+
open: listOpen,
|
|
186
|
+
onOpenChange: (v) => {
|
|
187
|
+
setListOpen(v);
|
|
188
|
+
if (!v) setSelectedToken(null);
|
|
189
|
+
},
|
|
190
|
+
assetContract: selectedToken.contractAddress,
|
|
191
|
+
tokenId: selectedToken.tokenId,
|
|
192
|
+
tokenName: selectedToken.metadata?.name ?? void 0,
|
|
193
|
+
tokenImage: selectedToken.metadata?.image ?? null,
|
|
194
|
+
tokenStandard: selectedToken.activeOrders?.some((o) => o.offer.itemType === "ERC1155") ? "ERC1155" : void 0,
|
|
195
|
+
onSuccess: handleSuccess
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
/* @__PURE__ */ jsx(
|
|
199
|
+
CancelOrderDialog,
|
|
200
|
+
{
|
|
201
|
+
hook: cancelListing,
|
|
202
|
+
variant: "listing",
|
|
203
|
+
tokenName: cancelToken?.metadata?.name,
|
|
204
|
+
tokenImage: cancelToken?.metadata?.image
|
|
205
|
+
}
|
|
206
|
+
),
|
|
207
|
+
transferToken && /* @__PURE__ */ jsx(
|
|
208
|
+
TransferDialog,
|
|
209
|
+
{
|
|
210
|
+
open: transferOpen,
|
|
211
|
+
onOpenChange: (v) => {
|
|
212
|
+
setTransferOpen(v);
|
|
213
|
+
if (!v) setTransferToken(null);
|
|
214
|
+
},
|
|
215
|
+
contractAddress: transferToken.contractAddress,
|
|
216
|
+
tokenId: transferToken.tokenId,
|
|
217
|
+
tokenName: transferToken.metadata?.name ?? void 0,
|
|
218
|
+
tokenImage: transferToken.metadata?.image ?? null,
|
|
219
|
+
hasActiveListing: !!transferToken.activeOrders?.[0],
|
|
220
|
+
tokenStandard: transferToken.activeOrders?.some((o) => o.offer.itemType === "ERC1155") ? "ERC1155" : void 0,
|
|
221
|
+
onSuccess: handleSuccess
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
archiveToken && /* @__PURE__ */ jsx(
|
|
225
|
+
ArchiveAssetDialog,
|
|
226
|
+
{
|
|
227
|
+
open: true,
|
|
228
|
+
onOpenChange: (open) => {
|
|
229
|
+
if (!open) setArchiveToken(null);
|
|
230
|
+
},
|
|
231
|
+
contractAddress: archiveToken.contractAddress,
|
|
232
|
+
tokenId: archiveToken.tokenId,
|
|
233
|
+
tokenName: archiveToken.metadata?.name ?? void 0,
|
|
234
|
+
tokenImage: archiveToken.metadata?.image ?? null,
|
|
235
|
+
hasActiveListing: !!archiveToken.activeOrders?.[0],
|
|
236
|
+
onSuccess: handleSuccess
|
|
237
|
+
}
|
|
238
|
+
)
|
|
239
|
+
] })
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
export {
|
|
243
|
+
useAssetActions,
|
|
244
|
+
useCounterOfferActions,
|
|
245
|
+
useListingActions,
|
|
246
|
+
useOfferActions,
|
|
247
|
+
useReceivedOfferActions
|
|
248
|
+
};
|
|
249
|
+
//# sourceMappingURL=portfolio-actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/marketplace/portfolio-actions.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport type { PortfolioAssetActions } from \"../portfolio-assets.js\";\nimport type { PortfolioOrderActions } from \"../portfolio-orders.js\";\nimport type { ApiOrder, ApiToken } from \"@medialane/sdk\";\nimport Image from \"next/image\";\nimport { AlertCircle, CheckCircle2, ExternalLink, Loader2, Sparkles } from \"lucide-react\";\nimport { Button } from \"../button.js\";\nimport { useAcceptOffer } from \"../../utils/marketplace/use-accept-offer.js\";\nimport { useCancelOrder } from \"../../utils/marketplace/use-cancel-order.js\";\nimport { MarketplaceDialog } from \"./dialog-frame.js\";\nimport { AcceptOfferDialog, CancelOrderDialog, CounterOfferDialog, ListingDialog, TransferDialog } from \"./lazy-dialogs.js\";\nimport { SUPPORTED_TOKENS } from \"@medialane/sdk\";\nimport { EXPLORER_URL } from \"../../utils/explorer-url.js\";\nimport { ArchiveAssetDialog } from \"../archive-asset-dialog.js\";\nimport { formatDisplayPrice } from \"../../utils/format.js\";\nimport { IconTile } from \"../icon-tile.js\";\nimport { useMarketplaceTransaction } from \"../../utils/marketplace/use-marketplace-transaction.js\";\nimport { fulfillOrder } from \"../../utils/marketplace/intents.js\";\nimport { useImageUrl } from \"../../utils/use-image-url.js\";\nimport { useT } from \"../../i18n/index.js\";\n\ntype Context = { refresh: () => void };\n\nfunction useCancelActions(variant: \"listing\" | \"offer\", { refresh }: Context): PortfolioOrderActions {\n const cancel = useCancelOrder({ onSuccess: refresh });\n return {\n isProcessing: cancel.busy,\n cancel: cancel.select,\n dialogs: <CancelOrderDialog hook={cancel} variant={variant} />,\n };\n}\n\nexport const useListingActions = (context: Context) => useCancelActions(\"listing\", context);\nexport const useOfferActions = (context: Context) => useCancelActions(\"offer\", context);\n\nexport function useReceivedOfferActions({ refresh }: Context): PortfolioOrderActions {\n const resolveImage = useImageUrl();\n const acceptOffer = useAcceptOffer({ mutateListings: refresh });\n const [counterOrder, setCounterOrder] = useState<ApiOrder | null>(null);\n const token = counterOrder ? SUPPORTED_TOKENS.find((t) => t.symbol === counterOrder.price.currency) : undefined;\n return {\n isProcessing: acceptOffer.busy,\n accept: (order) => acceptOffer.handleAcceptClick(order),\n counter: setCounterOrder,\n dialogs: (\n <>\n <AcceptOfferDialog hook={acceptOffer} />\n {counterOrder && (\n <CounterOfferDialog\n open={!!counterOrder}\n onOpenChange={(v) => { if (!v) setCounterOrder(null); }}\n originalOrderHash={counterOrder.orderHash}\n tokenName={counterOrder.token?.name ?? undefined}\n tokenImage={resolveImage(counterOrder.token?.image)}\n tokenId={counterOrder.nftTokenId ?? undefined}\n currentBid={`${formatDisplayPrice(counterOrder.price.formatted)} ${counterOrder.price.currency}`}\n currencySymbol={counterOrder.price.currency ?? \"\"}\n currencyDecimals={token?.decimals ?? 18}\n />\n )}\n </>\n ),\n };\n}\n\nexport function useCounterOfferActions({ refresh }: Context): PortfolioOrderActions {\n const t = useT();\n const resolveImage = useImageUrl();\n const tx = useMarketplaceTransaction();\n const [selectedCounter, setSelectedCounter] = useState<ApiOrder | null>(null);\n\n const resultTxHash = tx.txHash;\n const resultError = tx.error;\n\n const handleAccept = (counter: ApiOrder) => {\n setSelectedCounter(counter);\n void tx.start((ctx) => fulfillOrder(ctx, {\n orderHash: counter.orderHash,\n tokenStandard: counter.consideration.itemType,\n })).then(() => refresh());\n };\n\n const dismissResult = () => {\n if (tx.busy) return;\n tx.reset();\n setSelectedCounter(null);\n };\n\n const counterDisplayName =\n selectedCounter?.token?.name || `#${selectedCounter?.nftTokenId ?? \"\"}`;\n const counterImage = resolveImage(selectedCounter?.token?.image);\n\n return {\n isProcessing: tx.busy,\n accept: handleAccept,\n dialogs: (\n <MarketplaceDialog\n open={tx.phase !== \"idle\"}\n onOpenChange={(v) => { if (!v) dismissResult(); }}\n title={t(\"Counter-offer accept\")}\n description={t(\"On-chain status for the counter-offer you accepted.\")}\n >\n <div className=\"flex flex-col items-center gap-3 pt-6 px-6\">\n <div className=\"relative h-24 w-24 rounded-xl overflow-hidden border border-border bg-muted\">\n {counterImage && (\n <Image\n src={counterImage}\n alt={counterDisplayName}\n fill\n unoptimized\n sizes=\"96px\"\n className=\"object-cover\"\n />\n )}\n {tx.phase === \"success\" && (\n <div className=\"absolute -bottom-1 -right-1 h-7 w-7 rounded-full bg-background flex items-center justify-center\">\n <CheckCircle2 className=\"h-6 w-6 text-emerald-500\" />\n </div>\n )}\n </div>\n <p className=\"font-semibold text-base text-center truncate w-full\">\n {counterDisplayName}\n </p>\n </div>\n\n {tx.busy && (\n <div className=\"flex flex-col items-center gap-4 p-6 pt-3\">\n <Loader2 className=\"h-7 w-7 animate-spin text-primary\" />\n <div className=\"text-center space-y-1\">\n <p className=\"font-semibold\">{t(\"Confirming onchain…\")}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Keep this window open until it finishes.\")}\n </p>\n </div>\n </div>\n )}\n\n {tx.phase === \"success\" && (\n <div className=\"flex flex-col items-center gap-4 p-6 pt-3\">\n <div className=\"text-center space-y-1\">\n <p className=\"font-bold text-lg flex items-center justify-center gap-1.5\">\n {t(\"Counter-offer accepted\")}\n <Sparkles className=\"h-4 w-4 text-brand-orange\" />\n </p>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"The token is now yours.\")}\n </p>\n </div>\n {resultTxHash && (\n <a\n href={`${EXPLORER_URL}/tx/${resultTxHash}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors tabular-nums\"\n >\n {resultTxHash.slice(0, 10)}…{resultTxHash.slice(-8)}\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n )}\n <Button className=\"w-full h-11\" onClick={dismissResult}>\n {t(\"Done\")}\n </Button>\n </div>\n )}\n\n {tx.phase === \"error\" && (\n <div className=\"flex flex-col items-center gap-4 p-6 pt-3\">\n <IconTile destructive>\n <AlertCircle />\n </IconTile>\n <div className=\"text-center space-y-1\">\n <p className=\"font-bold text-base\">{t(\"Accept failed\")}</p>\n <p className=\"text-sm text-muted-foreground\">{resultError}</p>\n </div>\n <Button variant=\"soft\" className=\"w-full h-11\" onClick={dismissResult}>\n {t(\"Close\")}\n </Button>\n </div>\n )}\n </MarketplaceDialog>\n ),\n };\n}\n\nexport function useAssetActions({ refresh }: Context): PortfolioAssetActions {\n const [selectedToken, setSelectedToken] = useState<ApiToken | null>(null);\n const [listOpen, setListOpen] = useState(false);\n const [transferToken, setTransferToken] = useState<ApiToken | null>(null);\n const [transferOpen, setTransferOpen] = useState(false);\n const [archiveToken, setArchiveToken] = useState<ApiToken | null>(null);\n const [cancelToken, setCancelToken] = useState<ApiToken | null>(null);\n const cancelListing = useCancelOrder({ onSuccess: refresh });\n const handleSuccess = refresh;\n\n return {\n list: (token) => { setSelectedToken(token); setListOpen(true); },\n transfer: (token) => { setTransferToken(token); setTransferOpen(true); },\n archive: setArchiveToken,\n cancel: (token) => {\n const listing = token.activeOrders?.[0];\n if (!listing) return;\n setCancelToken(token);\n cancelListing.select(listing);\n },\n dialogs: (\n <>\n {selectedToken && (\n <ListingDialog\n open={listOpen}\n onOpenChange={(v) => {\n setListOpen(v);\n if (!v) setSelectedToken(null);\n }}\n assetContract={selectedToken.contractAddress}\n tokenId={selectedToken.tokenId}\n tokenName={selectedToken.metadata?.name ?? undefined}\n tokenImage={selectedToken.metadata?.image ?? null}\n tokenStandard={\n selectedToken.activeOrders?.some((o) => o.offer.itemType === \"ERC1155\")\n ? \"ERC1155\"\n : undefined\n }\n onSuccess={handleSuccess}\n />\n )}\n\n <CancelOrderDialog\n hook={cancelListing}\n variant=\"listing\"\n tokenName={cancelToken?.metadata?.name}\n tokenImage={cancelToken?.metadata?.image}\n />\n\n {transferToken && (\n <TransferDialog\n open={transferOpen}\n onOpenChange={(v) => {\n setTransferOpen(v);\n if (!v) setTransferToken(null);\n }}\n contractAddress={transferToken.contractAddress}\n tokenId={transferToken.tokenId}\n tokenName={transferToken.metadata?.name ?? undefined}\n tokenImage={transferToken.metadata?.image ?? null}\n hasActiveListing={!!transferToken.activeOrders?.[0]}\n tokenStandard={\n transferToken.activeOrders?.some((o) => o.offer.itemType === \"ERC1155\")\n ? \"ERC1155\"\n : undefined\n }\n onSuccess={handleSuccess}\n />\n )}\n {archiveToken && (\n <ArchiveAssetDialog\n open\n onOpenChange={(open) => { if (!open) setArchiveToken(null); }}\n contractAddress={archiveToken.contractAddress}\n tokenId={archiveToken.tokenId}\n tokenName={archiveToken.metadata?.name ?? undefined}\n tokenImage={archiveToken.metadata?.image ?? null}\n hasActiveListing={!!archiveToken.activeOrders?.[0]}\n onSuccess={handleSuccess}\n />\n )}\n </>\n ),\n };\n}\n"],"mappings":";AA8Ba,SAiBP,UAjBO,KAiBP,YAjBO;AA5Bb,SAAS,gBAAgB;AAIzB,OAAO,WAAW;AAClB,SAAS,aAAa,cAAc,cAAc,SAAS,gBAAgB;AAC3E,SAAS,cAAc;AACvB,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAClC,SAAS,mBAAmB,mBAAmB,oBAAoB,eAAe,sBAAsB;AACxG,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AACnC,SAAS,gBAAgB;AACzB,SAAS,iCAAiC;AAC1C,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,YAAY;AAIrB,SAAS,iBAAiB,SAA8B,EAAE,QAAQ,GAAmC;AACnG,QAAM,SAAS,eAAe,EAAE,WAAW,QAAQ,CAAC;AACpD,SAAO;AAAA,IACL,cAAc,OAAO;AAAA,IACrB,QAAQ,OAAO;AAAA,IACf,SAAS,oBAAC,qBAAkB,MAAM,QAAQ,SAAkB;AAAA,EAC9D;AACF;AAEO,MAAM,oBAAoB,CAAC,YAAqB,iBAAiB,WAAW,OAAO;AACnF,MAAM,kBAAkB,CAAC,YAAqB,iBAAiB,SAAS,OAAO;AAE/E,SAAS,wBAAwB,EAAE,QAAQ,GAAmC;AACnF,Q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,SAAS,cAAc;AAAA,UACvB,WAAW,cAAc,UAAU,QAAQ;AAAA,UAC3C,YAAY,cAAc,UAAU,SAAS;AAAA,UAC7C,kBAAkB,CAAC,CAAC,cAAc,eAAe,CAAC;AAAA,UAClD,eACE,cAAc,cAAc,KAAK,CAAC,MAAM,EAAE,MAAM,aAAa,SAAS,IAClE,YACA;AAAA,UAEN,WAAW;AAAA;AAAA,MACb;AAAA,MAED,gBACC;AAAA,QAAC;AAAA;AAAA,UACC,MAAI;AAAA,UACJ,cAAc,CAAC,SAAS;AAAE,gBAAI,CAAC,KAAM,iBAAgB,IAAI;AAAA,UAAG;AAAA,UAC5D,iBAAiB,aAAa;AAAA,UAC9B,SAAS,aAAa;AAAA,UACtB,WAAW,aAAa,UAAU,QAAQ;AAAA,UAC1C,YAAY,aAAa,UAAU,SAAS;AAAA,UAC5C,kBAAkB,CAAC,CAAC,aAAa,eAAe,CAAC;AAAA,UACjD,WAAW;AAAA;AAAA,MACb;AAAA,OAEJ;AAAA,EAEJ;AACF;","names":[]}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var purchase_dialog_exports = {};
|
|
21
|
+
__export(purchase_dialog_exports, {
|
|
22
|
+
PurchaseDialog: () => PurchaseDialog
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(purchase_dialog_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_describe_error = require("../../utils/describe-error.js");
|
|
27
|
+
var import_purchase_panel = require("../purchase-panel.js");
|
|
28
|
+
var import_transaction_dialog_states = require("../transaction-dialog-states.js");
|
|
29
|
+
var import_success_messages = require("../../utils/success-messages.js");
|
|
30
|
+
var import_action_button = require("../action-button.js");
|
|
31
|
+
var import_use_marketplace_transaction = require("../../utils/marketplace/use-marketplace-transaction.js");
|
|
32
|
+
var import_intents = require("../../utils/marketplace/intents.js");
|
|
33
|
+
var import_swap_intent = require("../../utils/marketplace/swap-intent.js");
|
|
34
|
+
var import_react = require("react");
|
|
35
|
+
var import_router = require("../router.js");
|
|
36
|
+
var import_lucide_react = require("lucide-react");
|
|
37
|
+
var import_use_confetti = require("../../utils/use-confetti.js");
|
|
38
|
+
var import_reward_earned = require("../rewards/reward-earned.js");
|
|
39
|
+
var import_sdk = require("@medialane/sdk");
|
|
40
|
+
var import_button = require("../button.js");
|
|
41
|
+
var import_dialog_frame = require("./dialog-frame.js");
|
|
42
|
+
var import_medialane_app = require("../medialane-app.js");
|
|
43
|
+
var import_use_on_open = require("../../utils/use-on-open.js");
|
|
44
|
+
var import_use_image_url = require("../../utils/use-image-url.js");
|
|
45
|
+
var import_provider = require("../../i18n/provider.js");
|
|
46
|
+
function PurchaseDialog({ order, open, onOpenChange, onSuccess }) {
|
|
47
|
+
const t = (0, import_provider.useT)();
|
|
48
|
+
const router = (0, import_router.useRouter)();
|
|
49
|
+
const { walletAddress, onTopUp, onRequireWallet, connectLabel } = (0, import_medialane_app.useMedialaneApp)();
|
|
50
|
+
const hasWallet = walletAddress !== null;
|
|
51
|
+
const resolveImage = (0, import_use_image_url.useImageUrl)();
|
|
52
|
+
const { phase, busy, txHash, error, retryable, start, reset } = (0, import_use_marketplace_transaction.useMarketplaceTransaction)();
|
|
53
|
+
const [quantity, setQuantity] = (0, import_react.useState)(1);
|
|
54
|
+
const [paymentSymbol, setPaymentSymbol] = (0, import_react.useState)(null);
|
|
55
|
+
const is1155 = order.offer?.itemType === "ERC1155";
|
|
56
|
+
const assetName = order.token?.name || `Token #${order.nftTokenId}`;
|
|
57
|
+
const assetImage = resolveImage(order.token?.image);
|
|
58
|
+
const swapFrom = paymentSymbol && paymentSymbol !== order.price?.currency ? paymentSymbol : null;
|
|
59
|
+
const addFunds = onTopUp ? () => {
|
|
60
|
+
onOpenChange(false);
|
|
61
|
+
onTopUp();
|
|
62
|
+
} : void 0;
|
|
63
|
+
const buy = async (values) => {
|
|
64
|
+
await start(async (ctx) => {
|
|
65
|
+
const qty = is1155 ? String(values.quantity) : void 0;
|
|
66
|
+
let swap;
|
|
67
|
+
if (values.paymentSymbol && order.price?.currency && walletAddress) {
|
|
68
|
+
try {
|
|
69
|
+
swap = await (0, import_swap_intent.createSwapIntent)(ctx.client, {
|
|
70
|
+
sell: values.paymentSymbol,
|
|
71
|
+
buy: order.price.currency,
|
|
72
|
+
amountRaw: ctx.client.purchaseCost(order, values.quantity).total.toString(),
|
|
73
|
+
takerAddress: walletAddress
|
|
74
|
+
});
|
|
75
|
+
} catch {
|
|
76
|
+
throw new import_describe_error.UserFacingError("Price moved before the swap could be prepared \u2014 please try again.");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return (0, import_intents.fulfillOrder)(ctx, {
|
|
80
|
+
orderHash: order.orderHash,
|
|
81
|
+
tokenStandard: order.offer.itemType,
|
|
82
|
+
quantity: qty,
|
|
83
|
+
swap
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
const handleBuyClick = () => {
|
|
88
|
+
if (!hasWallet || !paymentSymbol) return;
|
|
89
|
+
void buy({ quantity, paymentSymbol: swapFrom });
|
|
90
|
+
};
|
|
91
|
+
const isSuccess = phase === "success";
|
|
92
|
+
(0, import_use_confetti.useConfetti)(isSuccess);
|
|
93
|
+
const handleClose = (v) => {
|
|
94
|
+
if (busy || isSuccess) return;
|
|
95
|
+
onOpenChange(v);
|
|
96
|
+
};
|
|
97
|
+
(0, import_use_on_open.useOnOpen)(open, () => {
|
|
98
|
+
reset();
|
|
99
|
+
setQuantity(1);
|
|
100
|
+
setPaymentSymbol(null);
|
|
101
|
+
});
|
|
102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
103
|
+
import_dialog_frame.MarketplaceDialog,
|
|
104
|
+
{
|
|
105
|
+
open,
|
|
106
|
+
onOpenChange: handleClose,
|
|
107
|
+
title: isSuccess ? t("Purchase complete") : busy ? t("Processing purchase") : t("Buy now"),
|
|
108
|
+
description: t("Confirm the purchase."),
|
|
109
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
+
import_transaction_dialog_states.TransactionDialogStates,
|
|
111
|
+
{
|
|
112
|
+
phase,
|
|
113
|
+
asset: { name: assetName, image: assetImage },
|
|
114
|
+
txHash,
|
|
115
|
+
error,
|
|
116
|
+
success: import_success_messages.successMessages.purchased({ name: order.token?.name ?? "the asset", quantity: is1155 ? quantity : 1 }, t),
|
|
117
|
+
successActions: [
|
|
118
|
+
{
|
|
119
|
+
label: t("View asset"),
|
|
120
|
+
href: (0, import_sdk.assetHref)("STARKNET", order.nftContract, order.nftTokenId),
|
|
121
|
+
onClick: () => {
|
|
122
|
+
onOpenChange(false);
|
|
123
|
+
onSuccess?.();
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{ label: t("View portfolio"), onClick: () => {
|
|
127
|
+
onOpenChange(false);
|
|
128
|
+
router.push("/portfolio/assets");
|
|
129
|
+
} }
|
|
130
|
+
],
|
|
131
|
+
successChildren: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_reward_earned.RewardEarned, { actionType: "buy_asset" }),
|
|
132
|
+
errorTitle: t("Purchase failed"),
|
|
133
|
+
errorDescription: t("The purchase did not complete."),
|
|
134
|
+
onRetry: retryable ? reset : void 0,
|
|
135
|
+
onDone: () => onOpenChange(false),
|
|
136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
137
|
+
import_purchase_panel.PurchasePanel,
|
|
138
|
+
{
|
|
139
|
+
order,
|
|
140
|
+
image: assetImage,
|
|
141
|
+
quantity,
|
|
142
|
+
onQuantityChange: setQuantity,
|
|
143
|
+
walletAddress: hasWallet ? walletAddress : null,
|
|
144
|
+
payWith: paymentSymbol,
|
|
145
|
+
onPayWithChange: setPaymentSymbol,
|
|
146
|
+
onAddFunds: addFunds,
|
|
147
|
+
error,
|
|
148
|
+
children: !hasWallet ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
149
|
+
import_action_button.ActionButton,
|
|
150
|
+
{
|
|
151
|
+
solid: true,
|
|
152
|
+
className: "w-full",
|
|
153
|
+
onClick: () => {
|
|
154
|
+
onOpenChange(false);
|
|
155
|
+
onRequireWallet();
|
|
156
|
+
},
|
|
157
|
+
children: connectLabel ?? t("Connect")
|
|
158
|
+
}
|
|
159
|
+
) : error && !retryable ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "secondary", className: "w-full h-12 text-base font-semibold rounded-[11px]", onClick: () => onOpenChange(false), children: t("Close") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_action_button.ActionButton, { solid: true, className: "w-full", onClick: handleBuyClick, disabled: !paymentSymbol, children: [
|
|
160
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.RefreshCw, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ShoppingCart, { className: "h-4 w-4" }),
|
|
161
|
+
error ? t("Try again") : t("Buy now")
|
|
162
|
+
] })
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
171
|
+
0 && (module.exports = {
|
|
172
|
+
PurchaseDialog
|
|
173
|
+
});
|
|
174
|
+
//# sourceMappingURL=purchase-dialog.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/marketplace/purchase-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { UserFacingError } from \"../../utils/describe-error.js\";\nimport { PurchasePanel } from \"../purchase-panel.js\";\nimport { TransactionDialogStates } from \"../transaction-dialog-states.js\";\nimport { successMessages } from \"../../utils/success-messages.js\";\nimport { ActionButton } from \"../action-button.js\";\nimport { useMarketplaceTransaction } from \"../../utils/marketplace/use-marketplace-transaction.js\";\nimport { fulfillOrder } from \"../../utils/marketplace/intents.js\";\nimport { createSwapIntent } from \"../../utils/marketplace/swap-intent.js\";\nimport { useState } from \"react\";\nimport { useRouter } from \"../router.js\";\nimport { ShoppingCart, RefreshCw } from \"lucide-react\";\nimport { useConfetti } from \"../../utils/use-confetti.js\";\nimport { RewardEarned } from \"../rewards/reward-earned.js\";\nimport { assetHref as buildAssetHref } from \"@medialane/sdk\";\nimport { Button } from \"../button.js\";\nimport { MarketplaceDialog } from \"./dialog-frame.js\";\nimport { useMedialaneApp } from \"../medialane-app.js\";\nimport { useOnOpen } from \"../../utils/use-on-open.js\";\nimport type { ApiOrder } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../../utils/use-image-url.js\";\nimport { useT } from \"../../i18n/provider.js\";\n\nexport interface PurchaseDialogProps {\n order: ApiOrder;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n onSuccess?: () => void;\n}\n\n\nexport function PurchaseDialog({ order, open, onOpenChange, onSuccess }: PurchaseDialogProps) {\n const t = useT();\n const router = useRouter();\n const { walletAddress, onTopUp, onRequireWallet, connectLabel } = useMedialaneApp();\n const hasWallet = walletAddress !== null;\n const resolveImage = useImageUrl();\n const { phase, busy, txHash, error, retryable, start, reset } = useMarketplaceTransaction();\n\n const [quantity, setQuantity] = useState(1);\n const [paymentSymbol, setPaymentSymbol] = useState<string | null>(null);\n\n const is1155 = order.offer?.itemType === \"ERC1155\";\n const assetName = order.token?.name || `Token #${order.nftTokenId}`;\n const assetImage = resolveImage(order.token?.image);\n const swapFrom = paymentSymbol && paymentSymbol !== order.price?.currency ? paymentSymbol : null;\n\n const addFunds = onTopUp\n ? () => {\n onOpenChange(false);\n onTopUp();\n }\n : undefined;\n\n const buy = async (values: { quantity: number; paymentSymbol: string | null }) => {\n await start(async (ctx) => {\n const qty = is1155 ? String(values.quantity) : undefined;\n\n let swap: Awaited<ReturnType<typeof createSwapIntent>> | undefined;\n if (values.paymentSymbol && order.price?.currency && walletAddress) {\n try {\n swap = await createSwapIntent(ctx.client, {\n sell: values.paymentSymbol,\n buy: order.price.currency,\n amountRaw: ctx.client.purchaseCost(order, values.quantity).total.toString(),\n takerAddress: walletAddress,\n });\n } catch {\n throw new UserFacingError(\"Price moved before the swap could be prepared — please try again.\");\n }\n }\n\n return fulfillOrder(ctx, {\n orderHash: order.orderHash,\n tokenStandard: order.offer.itemType,\n quantity: qty,\n swap,\n });\n });\n };\n\n const handleBuyClick = () => {\n if (!hasWallet || !paymentSymbol) return;\n void buy({ quantity, paymentSymbol: swapFrom });\n };\n\n const isSuccess = phase === \"success\";\n useConfetti(isSuccess);\n\n const handleClose = (v: boolean) => {\n if (busy || isSuccess) return;\n onOpenChange(v);\n };\n\n useOnOpen(open, () => {\n reset();\n setQuantity(1);\n setPaymentSymbol(null);\n });\n\n return (\n <MarketplaceDialog\n open={open}\n onOpenChange={handleClose}\n title={isSuccess ? t(\"Purchase complete\") : busy ? t(\"Processing purchase\") : t(\"Buy now\")}\n description={t(\"Confirm the purchase.\")}\n >\n <TransactionDialogStates\n phase={phase}\n asset={{ name: assetName, image: assetImage }}\n txHash={txHash}\n error={error}\n success={successMessages.purchased({ name: order.token?.name ?? \"the asset\", quantity: is1155 ? quantity : 1 }, t)}\n successActions={[\n {\n label: t(\"View asset\"),\n href: buildAssetHref(\"STARKNET\", order.nftContract, order.nftTokenId),\n onClick: () => { onOpenChange(false); onSuccess?.(); },\n },\n { label: t(\"View portfolio\"), onClick: () => { onOpenChange(false); router.push(\"/portfolio/assets\"); } },\n ]}\n successChildren={<RewardEarned actionType=\"buy_asset\" />}\n errorTitle={t(\"Purchase failed\")}\n errorDescription={t(\"The purchase did not complete.\")}\n onRetry={retryable ? reset : undefined}\n onDone={() => onOpenChange(false)}\n >\n <PurchasePanel\n order={order}\n image={assetImage}\n quantity={quantity}\n onQuantityChange={setQuantity}\n walletAddress={hasWallet ? walletAddress : null}\n payWith={paymentSymbol}\n onPayWithChange={setPaymentSymbol}\n onAddFunds={addFunds}\n error={error}\n >\n {!hasWallet ? (\n <ActionButton\n solid\n className=\"w-full\"\n onClick={() => {\n onOpenChange(false);\n onRequireWallet();\n }}\n >\n {connectLabel ?? t(\"Connect\")}\n </ActionButton>\n ) : error && !retryable ? (\n <Button variant=\"secondary\" className=\"w-full h-12 text-base font-semibold rounded-[11px]\" onClick={() => onOpenChange(false)}>\n {t(\"Close\")}\n </Button>\n ) : (\n <ActionButton solid className=\"w-full\" onClick={handleBuyClick} disabled={!paymentSymbol}>\n {error ? <RefreshCw className=\"h-4 w-4\" /> : <ShoppingCart className=\"h-4 w-4\" />}\n {error ? t(\"Try again\") : t(\"Buy now\")}\n </ActionButton>\n )}\n </PurchasePanel>\n </TransactionDialogStates>\n </MarketplaceDialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0HyB;AAxHzB,4BAAgC;AAChC,4BAA8B;AAC9B,uCAAwC;AACxC,8BAAgC;AAChC,2BAA6B;AAC7B,yCAA0C;AAC1C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ialogProps {
|
|
5
|
+
order: ApiOrder;
|
|
6
|
+
open: boolean;
|
|
7
|
+
onOpenChange: (open: boolean) => void;
|
|
8
|
+
onSuccess?: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare function PurchaseDialog({ order, open, onOpenChange, onSuccess }: PurchaseDialogProps): react_jsx_runtime.JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { PurchaseDialog, type PurchaseDialogProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ApiOrder } from '@medialane/sdk';
|
|
3
|
+
|
|
4
|
+
interface PurchaseDialogProps {
|
|
5
|
+
order: ApiOrder;
|
|
6
|
+
open: boolean;
|
|
7
|
+
onOpenChange: (open: boolean) => void;
|
|
8
|
+
onSuccess?: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare function PurchaseDialog({ order, open, onOpenChange, onSuccess }: PurchaseDialogProps): react_jsx_runtime.JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { PurchaseDialog, type PurchaseDialogProps };
|