@medialane/ui 0.403.0 → 0.406.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 +5 -9
- package/dist/components/asset-page.cjs.map +1 -1
- package/dist/components/asset-page.d.cts +3 -4
- package/dist/components/asset-page.d.ts +3 -4
- package/dist/components/asset-page.js +3 -7
- 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/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/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/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/token-card.cjs +5 -1
- package/dist/components/token-card.cjs.map +1 -1
- package/dist/components/token-card.js +5 -1
- package/dist/components/token-card.js.map +1 -1
- package/dist/i18n/catalog/pt.cjs +89 -1
- package/dist/i18n/catalog/pt.cjs.map +1 -1
- package/dist/i18n/catalog/pt.js +89 -1
- 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 +30 -2
- package/dist/index.d.ts +30 -2
- 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.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/server-reads.d.cts +1 -0
- package/dist/utils/server-reads.d.ts +1 -0
- package/dist/utils/token-kind.cjs +45 -0
- package/dist/utils/token-kind.cjs.map +1 -0
- package/dist/utils/token-kind.d.cts +8 -0
- package/dist/utils/token-kind.d.ts +8 -0
- package/dist/utils/token-kind.js +19 -0
- package/dist/utils/token-kind.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.d.cts +3 -0
- package/dist/utils/use-collections.d.ts +3 -0
- 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.d.cts +2 -0
- package/dist/utils/use-tokens-by-ip-type.d.ts +2 -0
- 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.d.cts +6 -0
- package/dist/utils/use-tokens.d.ts +6 -0
- package/dist/utils/use-tokens.js +4 -7
- package/dist/utils/use-tokens.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function isErc1155Standard(standard) {
|
|
2
|
+
return standard === "ERC1155";
|
|
3
|
+
}
|
|
4
|
+
function isKnownTokenStandard(standard) {
|
|
5
|
+
return standard === "ERC721" || standard === "ERC1155";
|
|
6
|
+
}
|
|
7
|
+
function resolveTokenStandard(preferred, fallback) {
|
|
8
|
+
if (isKnownTokenStandard(preferred)) return preferred;
|
|
9
|
+
if (isKnownTokenStandard(fallback)) return fallback;
|
|
10
|
+
return "UNKNOWN";
|
|
11
|
+
}
|
|
12
|
+
function orderNftStandard(order) {
|
|
13
|
+
return order.offer.itemType === "ERC20" ? order.consideration.itemType : order.offer.itemType;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
isErc1155Standard,
|
|
17
|
+
orderNftStandard,
|
|
18
|
+
resolveTokenStandard
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=token-standard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/marketplace/token-standard.ts"],"sourcesContent":["export type TokenStandard = \"ERC721\" | \"ERC1155\" | \"UNKNOWN\";\n\nexport function isErc1155Standard(standard: string | null | undefined): standard is \"ERC1155\" {\n return standard === \"ERC1155\";\n}\n\nfunction isKnownTokenStandard(\n standard: string | null | undefined\n): standard is Exclude<TokenStandard, \"UNKNOWN\"> {\n return standard === \"ERC721\" || standard === \"ERC1155\";\n}\n\nexport function resolveTokenStandard(\n preferred?: string | null,\n fallback?: string | null\n): TokenStandard {\n if (isKnownTokenStandard(preferred)) return preferred;\n if (isKnownTokenStandard(fallback)) return fallback;\n return \"UNKNOWN\";\n}\n\nexport function orderNftStandard(order: { offer: { itemType: string }; consideration: { itemType: string } }): string {\n return order.offer.itemType === \"ERC20\" ? order.consideration.itemType : order.offer.itemType;\n}\n"],"mappings":"AAEO,SAAS,kBAAkB,UAA4D;AAC5F,SAAO,aAAa;AACtB;AAEA,SAAS,qBACP,UAC+C;AAC/C,SAAO,aAAa,YAAY,aAAa;AAC/C;AAEO,SAAS,qBACd,WACA,UACe;AACf,MAAI,qBAAqB,SAAS,EAAG,QAAO;AAC5C,MAAI,qBAAqB,QAAQ,EAAG,QAAO;AAC3C,SAAO;AACT;AAEO,SAAS,iBAAiB,OAAqF;AACpH,SAAO,MAAM,MAAM,aAAa,UAAU,MAAM,cAAc,WAAW,MAAM,MAAM;AACvF;","names":[]}
|
|
@@ -0,0 +1,103 @@
|
|
|
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 use_accept_offer_exports = {};
|
|
21
|
+
__export(use_accept_offer_exports, {
|
|
22
|
+
useAcceptOffer: () => useAcceptOffer
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(use_accept_offer_exports);
|
|
25
|
+
var import_use_marketplace_transaction = require("./use-marketplace-transaction.js");
|
|
26
|
+
var import_intents = require("./intents.js");
|
|
27
|
+
var import_token_standard = require("./token-standard.js");
|
|
28
|
+
var import_react = require("react");
|
|
29
|
+
var import_use_erc20_balance = require("../media-wallet/use-erc20-balance.js");
|
|
30
|
+
function useAcceptOffer({ mutateListings, tokenStandard, activeListings = [] }) {
|
|
31
|
+
const tx = (0, import_use_marketplace_transaction.useMarketplaceTransaction)();
|
|
32
|
+
const [selectedOrder, setSelectedOrder] = (0, import_react.useState)(null);
|
|
33
|
+
const [confirmOpen, setConfirmOpen] = (0, import_react.useState)(false);
|
|
34
|
+
const [warningOpen, setWarningOpen] = (0, import_react.useState)(false);
|
|
35
|
+
const [pendingOrder, setPendingOrder] = (0, import_react.useState)(null);
|
|
36
|
+
const { rawBalance, decimals } = (0, import_use_erc20_balance.useTokenBalance)(
|
|
37
|
+
selectedOrder?.price.currency ?? null,
|
|
38
|
+
selectedOrder?.offerer ?? null
|
|
39
|
+
);
|
|
40
|
+
const buyerHasFunds = selectedOrder ? (0, import_use_erc20_balance.hasSufficientBalance)(rawBalance, selectedOrder.price.formatted ?? "", decimals) : null;
|
|
41
|
+
const accept = async (order) => {
|
|
42
|
+
const ok = await tx.start((ctx) => (0, import_intents.fulfillOrder)(ctx, {
|
|
43
|
+
orderHash: order.orderHash,
|
|
44
|
+
tokenStandard: tokenStandard ?? (0, import_token_standard.orderNftStandard)(order)
|
|
45
|
+
}));
|
|
46
|
+
if (ok) mutateListings();
|
|
47
|
+
};
|
|
48
|
+
const handleAcceptClick = (order) => {
|
|
49
|
+
setSelectedOrder(order);
|
|
50
|
+
tx.reset();
|
|
51
|
+
if (activeListings.length > 0) {
|
|
52
|
+
setPendingOrder(order);
|
|
53
|
+
setWarningOpen(true);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
setConfirmOpen(true);
|
|
57
|
+
};
|
|
58
|
+
const confirmAccept = () => {
|
|
59
|
+
setConfirmOpen(false);
|
|
60
|
+
if (selectedOrder) void accept(selectedOrder);
|
|
61
|
+
};
|
|
62
|
+
const proceedFromWarning = () => {
|
|
63
|
+
setWarningOpen(false);
|
|
64
|
+
if (!pendingOrder) return;
|
|
65
|
+
void accept(pendingOrder);
|
|
66
|
+
};
|
|
67
|
+
const dismissWarning = () => {
|
|
68
|
+
setWarningOpen(false);
|
|
69
|
+
setPendingOrder(null);
|
|
70
|
+
setSelectedOrder(null);
|
|
71
|
+
};
|
|
72
|
+
const dismiss = () => {
|
|
73
|
+
if (tx.busy) return;
|
|
74
|
+
tx.reset();
|
|
75
|
+
setSelectedOrder(null);
|
|
76
|
+
setConfirmOpen(false);
|
|
77
|
+
setWarningOpen(false);
|
|
78
|
+
setPendingOrder(null);
|
|
79
|
+
};
|
|
80
|
+
return {
|
|
81
|
+
isOpen: warningOpen || confirmOpen || tx.phase !== "idle",
|
|
82
|
+
selectedOrder,
|
|
83
|
+
buyerHasFunds,
|
|
84
|
+
phase: tx.phase,
|
|
85
|
+
busy: tx.busy,
|
|
86
|
+
txHash: tx.txHash,
|
|
87
|
+
error: tx.error,
|
|
88
|
+
retryable: tx.retryable,
|
|
89
|
+
failedAfterSubmit: tx.failedAfterSubmit,
|
|
90
|
+
handleAcceptClick,
|
|
91
|
+
confirmAccept,
|
|
92
|
+
dismiss,
|
|
93
|
+
warningOpen,
|
|
94
|
+
activeListings,
|
|
95
|
+
proceedFromWarning,
|
|
96
|
+
dismissWarning
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
100
|
+
0 && (module.exports = {
|
|
101
|
+
useAcceptOffer
|
|
102
|
+
});
|
|
103
|
+
//# sourceMappingURL=use-accept-offer.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/marketplace/use-accept-offer.ts"],"sourcesContent":["\"use client\";\n\nimport { useMarketplaceTransaction } from \"./use-marketplace-transaction.js\";\nimport { fulfillOrder } from \"./intents.js\";\nimport { orderNftStandard } from \"./token-standard.js\";\nimport { useState } from \"react\";\nimport { useTokenBalance, hasSufficientBalance } from \"../media-wallet/use-erc20-balance.js\";\nimport type { ApiOrder } from \"@medialane/sdk\";\n\ninterface UseAcceptOfferOptions {\n mutateListings: () => void;\n\n tokenStandard?: string;\n\n activeListings?: ApiOrder[];\n}\n\nexport function useAcceptOffer({ mutateListings, tokenStandard, activeListings = [] }: UseAcceptOfferOptions) {\n const tx = useMarketplaceTransaction();\n\n const [selectedOrder, setSelectedOrder] = useState<ApiOrder | null>(null);\n const [confirmOpen, setConfirmOpen] = useState(false);\n const [warningOpen, setWarningOpen] = useState(false);\n const [pendingOrder, setPendingOrder] = useState<ApiOrder | null>(null);\n\n const { rawBalance, decimals } = useTokenBalance(selectedOrder?.price.currency ?? null,\n selectedOrder?.offerer ?? null\n );\n const buyerHasFunds = selectedOrder\n ? hasSufficientBalance(rawBalance, selectedOrder.price.formatted ?? \"\", decimals)\n : null;\n\n const accept = async (order: ApiOrder) => {\n const ok = await tx.start((ctx) => fulfillOrder(ctx, {\n orderHash: order.orderHash,\n tokenStandard: tokenStandard ?? orderNftStandard(order),\n }));\n if (ok) mutateListings();\n };\n\n const handleAcceptClick = (order: ApiOrder) => {\n setSelectedOrder(order);\n tx.reset();\n if (activeListings.length > 0) {\n setPendingOrder(order);\n setWarningOpen(true);\n return;\n }\n setConfirmOpen(true);\n };\n\n const confirmAccept = () => {\n setConfirmOpen(false);\n if (selectedOrder) void accept(selectedOrder);\n };\n\n const proceedFromWarning = () => {\n setWarningOpen(false);\n if (!pendingOrder) return;\n void accept(pendingOrder);\n };\n\n const dismissWarning = () => {\n setWarningOpen(false);\n setPendingOrder(null);\n setSelectedOrder(null);\n };\n\n const dismiss = () => {\n if (tx.busy) return;\n tx.reset();\n setSelectedOrder(null);\n setConfirmOpen(false);\n setWarningOpen(false);\n setPendingOrder(null);\n };\n\n return {\n isOpen: warningOpen || confirmOpen || tx.phase !== \"idle\",\n selectedOrder,\n buyerHasFunds,\n phase: tx.phase,\n busy: tx.busy,\n txHash: tx.txHash,\n error: tx.error,\n retryable: tx.retryable,\n failedAfterSubmit: tx.failedAfterSubmit,\n handleAcceptClick,\n confirmAccept,\n dismiss,\n\n warningOpen,\n activeListings,\n proceedFromWarning,\n dismissWarning,\n };\n}\n\nexport type AcceptOfferHook = ReturnType<typeof useAcceptOffer>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,yCAA0C;AAC1C,qBAA6B;AAC7B,4BAAiC;AACjC,mBAAyB;AACzB,+BAAsD;AAW/C,SAAS,eAAe,EAAE,gBAAgB,eAAe,iBAAiB,CAAC,EAAE,GAA0B;AAC5G,QAAM,SAAK,8DAA0B;AAErC,QAAM,CAAC,eAAe,gBAAgB,QAAI,uBAA0B,IAAI;AACxE,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,KAAK;AACpD,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,KAAK;AACpD,QAAM,CAAC,cAAc,eAAe,QAAI,uBAA0B,IAAI;AAEtE,QAAM,EAAE,YAAY,SAAS,QAAI;AAAA,IAAgB,eAAe,MAAM,YAAY;AAAA,IAChF,eAAe,WAAW;AAAA,EAC5B;AACA,QAAM,gBAAgB,oBAClB,+CAAqB,YAAY,cAAc,MAAM,aAAa,IAAI,QAAQ,IAC9E;AAEJ,QAAM,SAAS,OAAO,UAAoB;AACxC,UAAM,KAAK,MAAM,GAAG,MAAM,CAAC,YAAQ,6BAAa,KAAK;AAAA,MACnD,WAAW,MAAM;AAAA,MACjB,eAAe,qBAAiB,wCAAiB,KAAK;AAAA,IACxD,CAAC,CAAC;AACF,QAAI,GAAI,gBAAe;AAAA,EACzB;AAEA,QAAM,oBAAoB,CAAC,UAAoB;AAC7C,qBAAiB,KAAK;AACtB,OAAG,MAAM;AACT,QAAI,eAAe,SAAS,GAAG;AAC7B,sBAAgB,KAAK;AACrB,qBAAe,IAAI;AACnB;AAAA,IACF;AACA,mBAAe,IAAI;AAAA,EACrB;AAEA,QAAM,gBAAgB,MAAM;AAC1B,mBAAe,KAAK;AACpB,QAAI,cAAe,MAAK,OAAO,aAAa;AAAA,EAC9C;AAEA,QAAM,qBAAqB,MAAM;AAC/B,mBAAe,KAAK;AACpB,QAAI,CAAC,aAAc;AACnB,SAAK,OAAO,YAAY;AAAA,EAC1B;AAEA,QAAM,iBAAiB,MAAM;AAC3B,mBAAe,KAAK;AACpB,oBAAgB,IAAI;AACpB,qBAAiB,IAAI;AAAA,EACvB;AAEA,QAAM,UAAU,MAAM;AACpB,QAAI,GAAG,KAAM;AACb,OAAG,MAAM;AACT,qBAAiB,IAAI;AACrB,mBAAe,KAAK;AACpB,mBAAe,KAAK;AACpB,oBAAgB,IAAI;AAAA,EACtB;AAEA,SAAO;AAAA,IACL,QAAQ,eAAe,eAAe,GAAG,UAAU;AAAA,IACnD;AAAA,IACA;AAAA,IACA,OAAO,GAAG;AAAA,IACV,MAAM,GAAG;AAAA,IACT,QAAQ,GAAG;AAAA,IACX,OAAO,GAAG;AAAA,IACV,WAAW,GAAG;AAAA,IACd,mBAAmB,GAAG;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { TransactionPhase } from '../use-transaction.cjs';
|
|
2
|
+
import { ApiOrder } from '@medialane/sdk';
|
|
3
|
+
import '@medialane/sdk/starknet';
|
|
4
|
+
import '../../components/fast-mint/types.cjs';
|
|
5
|
+
import 'starknet';
|
|
6
|
+
|
|
7
|
+
interface UseAcceptOfferOptions {
|
|
8
|
+
mutateListings: () => void;
|
|
9
|
+
tokenStandard?: string;
|
|
10
|
+
activeListings?: ApiOrder[];
|
|
11
|
+
}
|
|
12
|
+
declare function useAcceptOffer({ mutateListings, tokenStandard, activeListings }: UseAcceptOfferOptions): {
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
selectedOrder: {
|
|
15
|
+
id: string;
|
|
16
|
+
chain: string;
|
|
17
|
+
orderHash: string;
|
|
18
|
+
offerer: string;
|
|
19
|
+
offer: {
|
|
20
|
+
itemType: string;
|
|
21
|
+
token: string;
|
|
22
|
+
identifier: string;
|
|
23
|
+
startAmount: string;
|
|
24
|
+
endAmount: string;
|
|
25
|
+
};
|
|
26
|
+
consideration: {
|
|
27
|
+
itemType: string;
|
|
28
|
+
token: string;
|
|
29
|
+
identifier: string;
|
|
30
|
+
startAmount: string;
|
|
31
|
+
endAmount: string;
|
|
32
|
+
recipient: string;
|
|
33
|
+
};
|
|
34
|
+
startTime: string;
|
|
35
|
+
endTime: string;
|
|
36
|
+
status: "ACTIVE" | "FULFILLED" | "CANCELLED" | "EXPIRED";
|
|
37
|
+
fulfiller: string | null;
|
|
38
|
+
nftContract: string | null;
|
|
39
|
+
nftTokenId: string | null;
|
|
40
|
+
price: {
|
|
41
|
+
raw: string | null;
|
|
42
|
+
formatted: string | null;
|
|
43
|
+
currency: string | null;
|
|
44
|
+
decimals: number;
|
|
45
|
+
};
|
|
46
|
+
txHash: {
|
|
47
|
+
created: string | null;
|
|
48
|
+
fulfilled: string | null;
|
|
49
|
+
cancelled: string | null;
|
|
50
|
+
};
|
|
51
|
+
createdBlockNumber: string;
|
|
52
|
+
remainingAmount: string | null;
|
|
53
|
+
createdAt: string;
|
|
54
|
+
updatedAt: string;
|
|
55
|
+
token: {
|
|
56
|
+
name: string | null;
|
|
57
|
+
image: string | null;
|
|
58
|
+
description: string | null;
|
|
59
|
+
animationUrl: string | null;
|
|
60
|
+
} | null;
|
|
61
|
+
parentOrderHash?: string | null | undefined;
|
|
62
|
+
counterOfferMessage?: string | null | undefined;
|
|
63
|
+
hasActiveCounterOffer?: boolean | undefined;
|
|
64
|
+
} | null;
|
|
65
|
+
buyerHasFunds: boolean | null;
|
|
66
|
+
phase: TransactionPhase;
|
|
67
|
+
busy: boolean;
|
|
68
|
+
txHash: string | null;
|
|
69
|
+
error: string | null;
|
|
70
|
+
retryable: boolean;
|
|
71
|
+
failedAfterSubmit: boolean;
|
|
72
|
+
handleAcceptClick: (order: ApiOrder) => void;
|
|
73
|
+
confirmAccept: () => void;
|
|
74
|
+
dismiss: () => void;
|
|
75
|
+
warningOpen: boolean;
|
|
76
|
+
activeListings: {
|
|
77
|
+
id: string;
|
|
78
|
+
chain: string;
|
|
79
|
+
orderHash: string;
|
|
80
|
+
offerer: string;
|
|
81
|
+
offer: {
|
|
82
|
+
itemType: string;
|
|
83
|
+
token: string;
|
|
84
|
+
identifier: string;
|
|
85
|
+
startAmount: string;
|
|
86
|
+
endAmount: string;
|
|
87
|
+
};
|
|
88
|
+
consideration: {
|
|
89
|
+
itemType: string;
|
|
90
|
+
token: string;
|
|
91
|
+
identifier: string;
|
|
92
|
+
startAmount: string;
|
|
93
|
+
endAmount: string;
|
|
94
|
+
recipient: string;
|
|
95
|
+
};
|
|
96
|
+
startTime: string;
|
|
97
|
+
endTime: string;
|
|
98
|
+
status: "ACTIVE" | "FULFILLED" | "CANCELLED" | "EXPIRED";
|
|
99
|
+
fulfiller: string | null;
|
|
100
|
+
nftContract: string | null;
|
|
101
|
+
nftTokenId: string | null;
|
|
102
|
+
price: {
|
|
103
|
+
raw: string | null;
|
|
104
|
+
formatted: string | null;
|
|
105
|
+
currency: string | null;
|
|
106
|
+
decimals: number;
|
|
107
|
+
};
|
|
108
|
+
txHash: {
|
|
109
|
+
created: string | null;
|
|
110
|
+
fulfilled: string | null;
|
|
111
|
+
cancelled: string | null;
|
|
112
|
+
};
|
|
113
|
+
createdBlockNumber: string;
|
|
114
|
+
remainingAmount: string | null;
|
|
115
|
+
createdAt: string;
|
|
116
|
+
updatedAt: string;
|
|
117
|
+
token: {
|
|
118
|
+
name: string | null;
|
|
119
|
+
image: string | null;
|
|
120
|
+
description: string | null;
|
|
121
|
+
animationUrl: string | null;
|
|
122
|
+
} | null;
|
|
123
|
+
parentOrderHash?: string | null | undefined;
|
|
124
|
+
counterOfferMessage?: string | null | undefined;
|
|
125
|
+
hasActiveCounterOffer?: boolean | undefined;
|
|
126
|
+
}[];
|
|
127
|
+
proceedFromWarning: () => void;
|
|
128
|
+
dismissWarning: () => void;
|
|
129
|
+
};
|
|
130
|
+
type AcceptOfferHook = ReturnType<typeof useAcceptOffer>;
|
|
131
|
+
|
|
132
|
+
export { type AcceptOfferHook, useAcceptOffer };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { TransactionPhase } from '../use-transaction.js';
|
|
2
|
+
import { ApiOrder } from '@medialane/sdk';
|
|
3
|
+
import '@medialane/sdk/starknet';
|
|
4
|
+
import '../../components/fast-mint/types.js';
|
|
5
|
+
import 'starknet';
|
|
6
|
+
|
|
7
|
+
interface UseAcceptOfferOptions {
|
|
8
|
+
mutateListings: () => void;
|
|
9
|
+
tokenStandard?: string;
|
|
10
|
+
activeListings?: ApiOrder[];
|
|
11
|
+
}
|
|
12
|
+
declare function useAcceptOffer({ mutateListings, tokenStandard, activeListings }: UseAcceptOfferOptions): {
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
selectedOrder: {
|
|
15
|
+
id: string;
|
|
16
|
+
chain: string;
|
|
17
|
+
orderHash: string;
|
|
18
|
+
offerer: string;
|
|
19
|
+
offer: {
|
|
20
|
+
itemType: string;
|
|
21
|
+
token: string;
|
|
22
|
+
identifier: string;
|
|
23
|
+
startAmount: string;
|
|
24
|
+
endAmount: string;
|
|
25
|
+
};
|
|
26
|
+
consideration: {
|
|
27
|
+
itemType: string;
|
|
28
|
+
token: string;
|
|
29
|
+
identifier: string;
|
|
30
|
+
startAmount: string;
|
|
31
|
+
endAmount: string;
|
|
32
|
+
recipient: string;
|
|
33
|
+
};
|
|
34
|
+
startTime: string;
|
|
35
|
+
endTime: string;
|
|
36
|
+
status: "ACTIVE" | "FULFILLED" | "CANCELLED" | "EXPIRED";
|
|
37
|
+
fulfiller: string | null;
|
|
38
|
+
nftContract: string | null;
|
|
39
|
+
nftTokenId: string | null;
|
|
40
|
+
price: {
|
|
41
|
+
raw: string | null;
|
|
42
|
+
formatted: string | null;
|
|
43
|
+
currency: string | null;
|
|
44
|
+
decimals: number;
|
|
45
|
+
};
|
|
46
|
+
txHash: {
|
|
47
|
+
created: string | null;
|
|
48
|
+
fulfilled: string | null;
|
|
49
|
+
cancelled: string | null;
|
|
50
|
+
};
|
|
51
|
+
createdBlockNumber: string;
|
|
52
|
+
remainingAmount: string | null;
|
|
53
|
+
createdAt: string;
|
|
54
|
+
updatedAt: string;
|
|
55
|
+
token: {
|
|
56
|
+
name: string | null;
|
|
57
|
+
image: string | null;
|
|
58
|
+
description: string | null;
|
|
59
|
+
animationUrl: string | null;
|
|
60
|
+
} | null;
|
|
61
|
+
parentOrderHash?: string | null | undefined;
|
|
62
|
+
counterOfferMessage?: string | null | undefined;
|
|
63
|
+
hasActiveCounterOffer?: boolean | undefined;
|
|
64
|
+
} | null;
|
|
65
|
+
buyerHasFunds: boolean | null;
|
|
66
|
+
phase: TransactionPhase;
|
|
67
|
+
busy: boolean;
|
|
68
|
+
txHash: string | null;
|
|
69
|
+
error: string | null;
|
|
70
|
+
retryable: boolean;
|
|
71
|
+
failedAfterSubmit: boolean;
|
|
72
|
+
handleAcceptClick: (order: ApiOrder) => void;
|
|
73
|
+
confirmAccept: () => void;
|
|
74
|
+
dismiss: () => void;
|
|
75
|
+
warningOpen: boolean;
|
|
76
|
+
activeListings: {
|
|
77
|
+
id: string;
|
|
78
|
+
chain: string;
|
|
79
|
+
orderHash: string;
|
|
80
|
+
offerer: string;
|
|
81
|
+
offer: {
|
|
82
|
+
itemType: string;
|
|
83
|
+
token: string;
|
|
84
|
+
identifier: string;
|
|
85
|
+
startAmount: string;
|
|
86
|
+
endAmount: string;
|
|
87
|
+
};
|
|
88
|
+
consideration: {
|
|
89
|
+
itemType: string;
|
|
90
|
+
token: string;
|
|
91
|
+
identifier: string;
|
|
92
|
+
startAmount: string;
|
|
93
|
+
endAmount: string;
|
|
94
|
+
recipient: string;
|
|
95
|
+
};
|
|
96
|
+
startTime: string;
|
|
97
|
+
endTime: string;
|
|
98
|
+
status: "ACTIVE" | "FULFILLED" | "CANCELLED" | "EXPIRED";
|
|
99
|
+
fulfiller: string | null;
|
|
100
|
+
nftContract: string | null;
|
|
101
|
+
nftTokenId: string | null;
|
|
102
|
+
price: {
|
|
103
|
+
raw: string | null;
|
|
104
|
+
formatted: string | null;
|
|
105
|
+
currency: string | null;
|
|
106
|
+
decimals: number;
|
|
107
|
+
};
|
|
108
|
+
txHash: {
|
|
109
|
+
created: string | null;
|
|
110
|
+
fulfilled: string | null;
|
|
111
|
+
cancelled: string | null;
|
|
112
|
+
};
|
|
113
|
+
createdBlockNumber: string;
|
|
114
|
+
remainingAmount: string | null;
|
|
115
|
+
createdAt: string;
|
|
116
|
+
updatedAt: string;
|
|
117
|
+
token: {
|
|
118
|
+
name: string | null;
|
|
119
|
+
image: string | null;
|
|
120
|
+
description: string | null;
|
|
121
|
+
animationUrl: string | null;
|
|
122
|
+
} | null;
|
|
123
|
+
parentOrderHash?: string | null | undefined;
|
|
124
|
+
counterOfferMessage?: string | null | undefined;
|
|
125
|
+
hasActiveCounterOffer?: boolean | undefined;
|
|
126
|
+
}[];
|
|
127
|
+
proceedFromWarning: () => void;
|
|
128
|
+
dismissWarning: () => void;
|
|
129
|
+
};
|
|
130
|
+
type AcceptOfferHook = ReturnType<typeof useAcceptOffer>;
|
|
131
|
+
|
|
132
|
+
export { type AcceptOfferHook, useAcceptOffer };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMarketplaceTransaction } from "./use-marketplace-transaction.js";
|
|
3
|
+
import { fulfillOrder } from "./intents.js";
|
|
4
|
+
import { orderNftStandard } from "./token-standard.js";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { useTokenBalance, hasSufficientBalance } from "../media-wallet/use-erc20-balance.js";
|
|
7
|
+
function useAcceptOffer({ mutateListings, tokenStandard, activeListings = [] }) {
|
|
8
|
+
const tx = useMarketplaceTransaction();
|
|
9
|
+
const [selectedOrder, setSelectedOrder] = useState(null);
|
|
10
|
+
const [confirmOpen, setConfirmOpen] = useState(false);
|
|
11
|
+
const [warningOpen, setWarningOpen] = useState(false);
|
|
12
|
+
const [pendingOrder, setPendingOrder] = useState(null);
|
|
13
|
+
const { rawBalance, decimals } = useTokenBalance(
|
|
14
|
+
selectedOrder?.price.currency ?? null,
|
|
15
|
+
selectedOrder?.offerer ?? null
|
|
16
|
+
);
|
|
17
|
+
const buyerHasFunds = selectedOrder ? hasSufficientBalance(rawBalance, selectedOrder.price.formatted ?? "", decimals) : null;
|
|
18
|
+
const accept = async (order) => {
|
|
19
|
+
const ok = await tx.start((ctx) => fulfillOrder(ctx, {
|
|
20
|
+
orderHash: order.orderHash,
|
|
21
|
+
tokenStandard: tokenStandard ?? orderNftStandard(order)
|
|
22
|
+
}));
|
|
23
|
+
if (ok) mutateListings();
|
|
24
|
+
};
|
|
25
|
+
const handleAcceptClick = (order) => {
|
|
26
|
+
setSelectedOrder(order);
|
|
27
|
+
tx.reset();
|
|
28
|
+
if (activeListings.length > 0) {
|
|
29
|
+
setPendingOrder(order);
|
|
30
|
+
setWarningOpen(true);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
setConfirmOpen(true);
|
|
34
|
+
};
|
|
35
|
+
const confirmAccept = () => {
|
|
36
|
+
setConfirmOpen(false);
|
|
37
|
+
if (selectedOrder) void accept(selectedOrder);
|
|
38
|
+
};
|
|
39
|
+
const proceedFromWarning = () => {
|
|
40
|
+
setWarningOpen(false);
|
|
41
|
+
if (!pendingOrder) return;
|
|
42
|
+
void accept(pendingOrder);
|
|
43
|
+
};
|
|
44
|
+
const dismissWarning = () => {
|
|
45
|
+
setWarningOpen(false);
|
|
46
|
+
setPendingOrder(null);
|
|
47
|
+
setSelectedOrder(null);
|
|
48
|
+
};
|
|
49
|
+
const dismiss = () => {
|
|
50
|
+
if (tx.busy) return;
|
|
51
|
+
tx.reset();
|
|
52
|
+
setSelectedOrder(null);
|
|
53
|
+
setConfirmOpen(false);
|
|
54
|
+
setWarningOpen(false);
|
|
55
|
+
setPendingOrder(null);
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
isOpen: warningOpen || confirmOpen || tx.phase !== "idle",
|
|
59
|
+
selectedOrder,
|
|
60
|
+
buyerHasFunds,
|
|
61
|
+
phase: tx.phase,
|
|
62
|
+
busy: tx.busy,
|
|
63
|
+
txHash: tx.txHash,
|
|
64
|
+
error: tx.error,
|
|
65
|
+
retryable: tx.retryable,
|
|
66
|
+
failedAfterSubmit: tx.failedAfterSubmit,
|
|
67
|
+
handleAcceptClick,
|
|
68
|
+
confirmAccept,
|
|
69
|
+
dismiss,
|
|
70
|
+
warningOpen,
|
|
71
|
+
activeListings,
|
|
72
|
+
proceedFromWarning,
|
|
73
|
+
dismissWarning
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
useAcceptOffer
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=use-accept-offer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/marketplace/use-accept-offer.ts"],"sourcesContent":["\"use client\";\n\nimport { useMarketplaceTransaction } from \"./use-marketplace-transaction.js\";\nimport { fulfillOrder } from \"./intents.js\";\nimport { orderNftStandard } from \"./token-standard.js\";\nimport { useState } from \"react\";\nimport { useTokenBalance, hasSufficientBalance } from \"../media-wallet/use-erc20-balance.js\";\nimport type { ApiOrder } from \"@medialane/sdk\";\n\ninterface UseAcceptOfferOptions {\n mutateListings: () => void;\n\n tokenStandard?: string;\n\n activeListings?: ApiOrder[];\n}\n\nexport function useAcceptOffer({ mutateListings, tokenStandard, activeListings = [] }: UseAcceptOfferOptions) {\n const tx = useMarketplaceTransaction();\n\n const [selectedOrder, setSelectedOrder] = useState<ApiOrder | null>(null);\n const [confirmOpen, setConfirmOpen] = useState(false);\n const [warningOpen, setWarningOpen] = useState(false);\n const [pendingOrder, setPendingOrder] = useState<ApiOrder | null>(null);\n\n const { rawBalance, decimals } = useTokenBalance(selectedOrder?.price.currency ?? null,\n selectedOrder?.offerer ?? null\n );\n const buyerHasFunds = selectedOrder\n ? hasSufficientBalance(rawBalance, selectedOrder.price.formatted ?? \"\", decimals)\n : null;\n\n const accept = async (order: ApiOrder) => {\n const ok = await tx.start((ctx) => fulfillOrder(ctx, {\n orderHash: order.orderHash,\n tokenStandard: tokenStandard ?? orderNftStandard(order),\n }));\n if (ok) mutateListings();\n };\n\n const handleAcceptClick = (order: ApiOrder) => {\n setSelectedOrder(order);\n tx.reset();\n if (activeListings.length > 0) {\n setPendingOrder(order);\n setWarningOpen(true);\n return;\n }\n setConfirmOpen(true);\n };\n\n const confirmAccept = () => {\n setConfirmOpen(false);\n if (selectedOrder) void accept(selectedOrder);\n };\n\n const proceedFromWarning = () => {\n setWarningOpen(false);\n if (!pendingOrder) return;\n void accept(pendingOrder);\n };\n\n const dismissWarning = () => {\n setWarningOpen(false);\n setPendingOrder(null);\n setSelectedOrder(null);\n };\n\n const dismiss = () => {\n if (tx.busy) return;\n tx.reset();\n setSelectedOrder(null);\n setConfirmOpen(false);\n setWarningOpen(false);\n setPendingOrder(null);\n };\n\n return {\n isOpen: warningOpen || confirmOpen || tx.phase !== \"idle\",\n selectedOrder,\n buyerHasFunds,\n phase: tx.phase,\n busy: tx.busy,\n txHash: tx.txHash,\n error: tx.error,\n retryable: tx.retryable,\n failedAfterSubmit: tx.failedAfterSubmit,\n handleAcceptClick,\n confirmAccept,\n dismiss,\n\n warningOpen,\n activeListings,\n proceedFromWarning,\n dismissWarning,\n };\n}\n\nexport type AcceptOfferHook = ReturnType<typeof useAcceptOffer>;\n"],"mappings":";AAEA,SAAS,iCAAiC;AAC1C,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AACzB,SAAS,iBAAiB,4BAA4B;AAW/C,SAAS,eAAe,EAAE,gBAAgB,eAAe,iBAAiB,CAAC,EAAE,GAA0B;AAC5G,QAAM,KAAK,0BAA0B;AAErC,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAA0B,IAAI;AACxE,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AACpD,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AACpD,QAAM,CAAC,cAAc,eAAe,IAAI,SAA0B,IAAI;AAEtE,QAAM,EAAE,YAAY,SAAS,IAAI;AAAA,IAAgB,eAAe,MAAM,YAAY;AAAA,IAChF,eAAe,WAAW;AAAA,EAC5B;AACA,QAAM,gBAAgB,gBAClB,qBAAqB,YAAY,cAAc,MAAM,aAAa,IAAI,QAAQ,IAC9E;AAEJ,QAAM,SAAS,OAAO,UAAoB;AACxC,UAAM,KAAK,MAAM,GAAG,MAAM,CAAC,QAAQ,aAAa,KAAK;AAAA,MACnD,WAAW,MAAM;AAAA,MACjB,eAAe,iBAAiB,iBAAiB,KAAK;AAAA,IACxD,CAAC,CAAC;AACF,QAAI,GAAI,gBAAe;AAAA,EACzB;AAEA,QAAM,oBAAoB,CAAC,UAAoB;AAC7C,qBAAiB,KAAK;AACtB,OAAG,MAAM;AACT,QAAI,eAAe,SAAS,GAAG;AAC7B,sBAAgB,KAAK;AACrB,qBAAe,IAAI;AACnB;AAAA,IACF;AACA,mBAAe,IAAI;AAAA,EACrB;AAEA,QAAM,gBAAgB,MAAM;AAC1B,mBAAe,KAAK;AACpB,QAAI,cAAe,MAAK,OAAO,aAAa;AAAA,EAC9C;AAEA,QAAM,qBAAqB,MAAM;AAC/B,mBAAe,KAAK;AACpB,QAAI,CAAC,aAAc;AACnB,SAAK,OAAO,YAAY;AAAA,EAC1B;AAEA,QAAM,iBAAiB,MAAM;AAC3B,mBAAe,KAAK;AACpB,oBAAgB,IAAI;AACpB,qBAAiB,IAAI;AAAA,EACvB;AAEA,QAAM,UAAU,MAAM;AACpB,QAAI,GAAG,KAAM;AACb,OAAG,MAAM;AACT,qBAAiB,IAAI;AACrB,mBAAe,KAAK;AACpB,mBAAe,KAAK;AACpB,oBAAgB,IAAI;AAAA,EACtB;AAEA,SAAO;AAAA,IACL,QAAQ,eAAe,eAAe,GAAG,UAAU;AAAA,IACnD;AAAA,IACA;AAAA,IACA,OAAO,GAAG;AAAA,IACV,MAAM,GAAG;AAAA,IACT,QAAQ,GAAG;AAAA,IACX,OAAO,GAAG;AAAA,IACV,WAAW,GAAG;AAAA,IACd,mBAAmB,GAAG;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 use_cancel_order_exports = {};
|
|
21
|
+
__export(use_cancel_order_exports, {
|
|
22
|
+
useCancelOrder: () => useCancelOrder
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(use_cancel_order_exports);
|
|
25
|
+
var import_use_marketplace_transaction = require("./use-marketplace-transaction.js");
|
|
26
|
+
var import_intents = require("./intents.js");
|
|
27
|
+
var import_token_standard = require("./token-standard.js");
|
|
28
|
+
var import_react = require("react");
|
|
29
|
+
function useCancelOrder({ onSuccess, tokenStandard }) {
|
|
30
|
+
const tx = (0, import_use_marketplace_transaction.useMarketplaceTransaction)();
|
|
31
|
+
const [order, setOrder] = (0, import_react.useState)(null);
|
|
32
|
+
const select = (next) => {
|
|
33
|
+
tx.reset();
|
|
34
|
+
setOrder(next);
|
|
35
|
+
};
|
|
36
|
+
const confirm = () => {
|
|
37
|
+
if (!order) return;
|
|
38
|
+
const target = order;
|
|
39
|
+
void tx.start((ctx) => (0, import_intents.cancelOrder)(ctx, {
|
|
40
|
+
orderHash: target.orderHash,
|
|
41
|
+
tokenStandard: tokenStandard ?? (0, import_token_standard.orderNftStandard)(target)
|
|
42
|
+
})).then((ok) => {
|
|
43
|
+
if (ok) onSuccess?.();
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
const dismiss = () => {
|
|
47
|
+
if (tx.busy) return;
|
|
48
|
+
tx.reset();
|
|
49
|
+
setOrder(null);
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
order,
|
|
53
|
+
select,
|
|
54
|
+
confirm,
|
|
55
|
+
dismiss,
|
|
56
|
+
phase: tx.phase,
|
|
57
|
+
busy: tx.busy,
|
|
58
|
+
txHash: tx.txHash,
|
|
59
|
+
error: tx.error,
|
|
60
|
+
retryable: tx.retryable
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
+
0 && (module.exports = {
|
|
65
|
+
useCancelOrder
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=use-cancel-order.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/marketplace/use-cancel-order.ts"],"sourcesContent":["\"use client\";\n\nimport { useMarketplaceTransaction } from \"./use-marketplace-transaction.js\";\nimport { cancelOrder } from \"./intents.js\";\nimport { orderNftStandard } from \"./token-standard.js\";\nimport { useState } from \"react\";\nimport type { ApiOrder } from \"@medialane/sdk\";\n\ninterface UseCancelOrderOptions {\n onSuccess?: () => void;\n tokenStandard?: string;\n}\n\nexport function useCancelOrder({ onSuccess, tokenStandard }: UseCancelOrderOptions) {\n const tx = useMarketplaceTransaction();\n const [order, setOrder] = useState<ApiOrder | null>(null);\n\n const select = (next: ApiOrder) => {\n tx.reset();\n setOrder(next);\n };\n\n const confirm = () => {\n if (!order) return;\n const target = order;\n void tx\n .start((ctx) => cancelOrder(ctx, {\n orderHash: target.orderHash,\n tokenStandard: tokenStandard ?? orderNftStandard(target),\n }))\n .then((ok) => { if (ok) onSuccess?.(); });\n };\n\n const dismiss = () => {\n if (tx.busy) return;\n tx.reset();\n setOrder(null);\n };\n\n return {\n order,\n select,\n confirm,\n dismiss,\n phase: tx.phase,\n busy: tx.busy,\n txHash: tx.txHash,\n error: tx.error,\n retryable: tx.retryable,\n };\n}\n\nexport type CancelOrderHook = ReturnType<typeof useCancelOrder>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,yCAA0C;AAC1C,qBAA4B;AAC5B,4BAAiC;AACjC,mBAAyB;AAQlB,SAAS,eAAe,EAAE,WAAW,cAAc,GAA0B;AAClF,QAAM,SAAK,8DAA0B;AACrC,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAA0B,IAAI;AAExD,QAAM,SAAS,CAAC,SAAmB;AACjC,OAAG,MAAM;AACT,aAAS,IAAI;AAAA,EACf;AAEA,QAAM,UAAU,MAAM;AACpB,QAAI,CAAC,MAAO;AACZ,UAAM,SAAS;AACf,SAAK,GACF,MAAM,CAAC,YAAQ,4BAAY,KAAK;AAAA,MAC/B,WAAW,OAAO;AAAA,MAClB,eAAe,qBAAiB,wCAAiB,MAAM;AAAA,IACzD,CAAC,CAAC,EACD,KAAK,CAAC,OAAO;AAAE,UAAI,GAAI,aAAY;AAAA,IAAG,CAAC;AAAA,EAC5C;AAEA,QAAM,UAAU,MAAM;AACpB,QAAI,GAAG,KAAM;AACb,OAAG,MAAM;AACT,aAAS,IAAI;AAAA,EACf;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,GAAG;AAAA,IACV,MAAM,GAAG;AAAA,IACT,QAAQ,GAAG;AAAA,IACX,OAAO,GAAG;AAAA,IACV,WAAW,GAAG;AAAA,EAChB;AACF;","names":[]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { TransactionPhase } from '../use-transaction.cjs';
|
|
2
|
+
import { ApiOrder } from '@medialane/sdk';
|
|
3
|
+
import '@medialane/sdk/starknet';
|
|
4
|
+
import '../../components/fast-mint/types.cjs';
|
|
5
|
+
import 'starknet';
|
|
6
|
+
|
|
7
|
+
interface UseCancelOrderOptions {
|
|
8
|
+
onSuccess?: () => void;
|
|
9
|
+
tokenStandard?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function useCancelOrder({ onSuccess, tokenStandard }: UseCancelOrderOptions): {
|
|
12
|
+
order: {
|
|
13
|
+
id: string;
|
|
14
|
+
chain: string;
|
|
15
|
+
orderHash: string;
|
|
16
|
+
offerer: string;
|
|
17
|
+
offer: {
|
|
18
|
+
itemType: string;
|
|
19
|
+
token: string;
|
|
20
|
+
identifier: string;
|
|
21
|
+
startAmount: string;
|
|
22
|
+
endAmount: string;
|
|
23
|
+
};
|
|
24
|
+
consideration: {
|
|
25
|
+
itemType: string;
|
|
26
|
+
token: string;
|
|
27
|
+
identifier: string;
|
|
28
|
+
startAmount: string;
|
|
29
|
+
endAmount: string;
|
|
30
|
+
recipient: string;
|
|
31
|
+
};
|
|
32
|
+
startTime: string;
|
|
33
|
+
endTime: string;
|
|
34
|
+
status: "ACTIVE" | "FULFILLED" | "CANCELLED" | "EXPIRED";
|
|
35
|
+
fulfiller: string | null;
|
|
36
|
+
nftContract: string | null;
|
|
37
|
+
nftTokenId: string | null;
|
|
38
|
+
price: {
|
|
39
|
+
raw: string | null;
|
|
40
|
+
formatted: string | null;
|
|
41
|
+
currency: string | null;
|
|
42
|
+
decimals: number;
|
|
43
|
+
};
|
|
44
|
+
txHash: {
|
|
45
|
+
created: string | null;
|
|
46
|
+
fulfilled: string | null;
|
|
47
|
+
cancelled: string | null;
|
|
48
|
+
};
|
|
49
|
+
createdBlockNumber: string;
|
|
50
|
+
remainingAmount: string | null;
|
|
51
|
+
createdAt: string;
|
|
52
|
+
updatedAt: string;
|
|
53
|
+
token: {
|
|
54
|
+
name: string | null;
|
|
55
|
+
image: string | null;
|
|
56
|
+
description: string | null;
|
|
57
|
+
animationUrl: string | null;
|
|
58
|
+
} | null;
|
|
59
|
+
parentOrderHash?: string | null | undefined;
|
|
60
|
+
counterOfferMessage?: string | null | undefined;
|
|
61
|
+
hasActiveCounterOffer?: boolean | undefined;
|
|
62
|
+
} | null;
|
|
63
|
+
select: (next: ApiOrder) => void;
|
|
64
|
+
confirm: () => void;
|
|
65
|
+
dismiss: () => void;
|
|
66
|
+
phase: TransactionPhase;
|
|
67
|
+
busy: boolean;
|
|
68
|
+
txHash: string | null;
|
|
69
|
+
error: string | null;
|
|
70
|
+
retryable: boolean;
|
|
71
|
+
};
|
|
72
|
+
type CancelOrderHook = ReturnType<typeof useCancelOrder>;
|
|
73
|
+
|
|
74
|
+
export { type CancelOrderHook, useCancelOrder };
|