@mintmoney/react 0.1.0-alpha.8 → 0.2.0-alpha.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/README.md +13 -88
- package/dist/css/styles.css +168 -7
- package/dist/docs/customisation.md +67 -0
- package/dist/docs/overview.md +19 -0
- package/dist/docs/quickstart.md +171 -0
- package/dist/esm/api/checkouts.js +13 -12
- package/dist/esm/api/checkouts.js.map +1 -1
- package/dist/esm/api/generated.js +961 -51
- package/dist/esm/api/generated.js.map +1 -1
- package/dist/esm/api/index.js +2 -1
- package/dist/esm/api/index.js.map +1 -1
- package/dist/esm/api/payments.js +74 -11
- package/dist/esm/api/payments.js.map +1 -1
- package/dist/esm/api/types.js +7 -1
- package/dist/esm/api/types.js.map +1 -1
- package/dist/esm/checkout/container.js +1 -1
- package/dist/esm/checkout/index.js +74 -8
- package/dist/esm/checkout/index.js.map +1 -1
- package/dist/esm/checkout/launcher.js +6 -0
- package/dist/esm/checkout/launcher.js.map +1 -0
- package/dist/esm/checkout/modal.js +65 -36
- package/dist/esm/checkout/modal.js.map +1 -1
- package/dist/esm/checkout/providers/wagmi-config.js +108 -0
- package/dist/esm/checkout/providers/wagmi-config.js.map +1 -0
- package/dist/esm/checkout/providers/wallet-connect-resume.js +129 -0
- package/dist/esm/checkout/providers/wallet-connect-resume.js.map +1 -0
- package/dist/esm/checkout/resume-state.js +82 -0
- package/dist/esm/checkout/resume-state.js.map +1 -0
- package/dist/esm/checkout/surplus-refund.js +38 -0
- package/dist/esm/checkout/surplus-refund.js.map +1 -0
- package/dist/esm/checkout/views/amount-header.js +82 -0
- package/dist/esm/checkout/views/amount-header.js.map +1 -0
- package/dist/esm/checkout/views/back.js +2 -2
- package/dist/esm/checkout/views/back.js.map +1 -1
- package/dist/esm/checkout/views/crypto-intent/direct-details.js +1037 -12
- package/dist/esm/checkout/views/crypto-intent/direct-details.js.map +1 -1
- package/dist/esm/checkout/views/crypto-intent/manual-payment-summary.js +112 -0
- package/dist/esm/checkout/views/crypto-intent/manual-payment-summary.js.map +1 -0
- package/dist/esm/checkout/views/crypto-intent/manual-refund-preference.js +69 -0
- package/dist/esm/checkout/views/crypto-intent/manual-refund-preference.js.map +1 -0
- package/dist/esm/checkout/views/crypto-intent/methods.js +166 -18
- package/dist/esm/checkout/views/crypto-intent/methods.js.map +1 -1
- package/dist/esm/checkout/views/crypto-intent/processing.js +97 -27
- package/dist/esm/checkout/views/crypto-intent/processing.js.map +1 -1
- package/dist/esm/checkout/views/crypto-intent/success.js +87 -11
- package/dist/esm/checkout/views/crypto-intent/success.js.map +1 -1
- package/dist/esm/checkout/views/crypto-intent/test-payment.js +35 -0
- package/dist/esm/checkout/views/crypto-intent/test-payment.js.map +1 -0
- package/dist/esm/checkout/views/crypto-intent/wallet-payment-confirmation-amount.js +30 -0
- package/dist/esm/checkout/views/crypto-intent/wallet-payment-confirmation-amount.js.map +1 -0
- package/dist/esm/checkout/views/crypto-intent/wallet-payment-options.js +1207 -0
- package/dist/esm/checkout/views/crypto-intent/wallet-payment-options.js.map +1 -0
- package/dist/esm/checkout/views/crypto-intent/wallet-select.js +166 -0
- package/dist/esm/checkout/views/crypto-intent/wallet-select.js.map +1 -0
- package/dist/esm/checkout/views/failed.js +108 -0
- package/dist/esm/checkout/views/failed.js.map +1 -0
- package/dist/esm/checkout/views/initial.js +62 -12
- package/dist/esm/checkout/views/initial.js.map +1 -1
- package/dist/esm/checkout/views/method-select.js +22 -4
- package/dist/esm/checkout/views/method-select.js.map +1 -1
- package/dist/esm/checkout/views/restart.js +12 -0
- package/dist/esm/checkout/views/restart.js.map +1 -0
- package/dist/esm/components/buttons/async-button.js +16 -0
- package/dist/esm/components/buttons/async-button.js.map +1 -0
- package/dist/esm/components/buttons/index.js +102 -16
- package/dist/esm/components/buttons/index.js.map +1 -1
- package/dist/esm/components/buttons/use-async-button.js +44 -0
- package/dist/esm/components/buttons/use-async-button.js.map +1 -0
- package/dist/esm/components/crypto/currency-selector.js +26 -0
- package/dist/esm/components/crypto/currency-selector.js.map +1 -0
- package/dist/esm/components/icons/alert.js +20 -0
- package/dist/esm/components/icons/alert.js.map +1 -0
- package/dist/esm/components/icons/checkMark.js.map +1 -1
- package/dist/esm/components/icons/clipboard-add.js +20 -0
- package/dist/esm/components/icons/clipboard-add.js.map +1 -0
- package/dist/esm/components/icons/clipboard-check.js +20 -0
- package/dist/esm/components/icons/clipboard-check.js.map +1 -0
- package/dist/esm/components/icons/clock.js +4 -0
- package/dist/esm/components/icons/clock.js.map +1 -0
- package/dist/esm/components/icons/close.js.map +1 -1
- package/dist/esm/components/icons/edit.js +6 -0
- package/dist/esm/components/icons/edit.js.map +1 -0
- package/dist/esm/components/icons/index.js +9 -0
- package/dist/esm/components/icons/index.js.map +1 -1
- package/dist/esm/components/icons/link.js +20 -0
- package/dist/esm/components/icons/link.js.map +1 -0
- package/dist/esm/components/icons/loading.js +26 -0
- package/dist/esm/components/icons/loading.js.map +1 -0
- package/dist/esm/components/icons/log-out.js +6 -0
- package/dist/esm/components/icons/log-out.js.map +1 -0
- package/dist/esm/components/icons/send.js +6 -0
- package/dist/esm/components/icons/send.js.map +1 -0
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/components/inputs/index.js +47 -0
- package/dist/esm/components/inputs/index.js.map +1 -0
- package/dist/esm/components/lists/index.js.map +1 -1
- package/dist/esm/components/loading/index.js.map +1 -1
- package/dist/esm/components/modals/modal-with-views.js +7 -4
- package/dist/esm/components/modals/modal-with-views.js.map +1 -1
- package/dist/esm/components/modals/modal.js +3 -3
- package/dist/esm/components/modals/modal.js.map +1 -1
- package/dist/esm/components/modals/use-modal-with-views.js +11 -3
- package/dist/esm/components/modals/use-modal-with-views.js.map +1 -1
- package/dist/esm/components/quote-expiry/index.js +2 -0
- package/dist/esm/components/quote-expiry/index.js.map +1 -0
- package/dist/esm/components/quote-expiry/quote-expiry-countdown.js +35 -0
- package/dist/esm/components/quote-expiry/quote-expiry-countdown.js.map +1 -0
- package/dist/esm/components/quote-expiry/styles.js +109 -0
- package/dist/esm/components/quote-expiry/styles.js.map +1 -0
- package/dist/esm/components/quote-expiry/tiers.js +31 -0
- package/dist/esm/components/quote-expiry/tiers.js.map +1 -0
- package/dist/esm/components/text/index.js +2 -0
- package/dist/esm/components/text/index.js.map +1 -1
- package/dist/esm/components/wallet-selector/component.js +59 -0
- package/dist/esm/components/wallet-selector/component.js.map +1 -0
- package/dist/esm/components/wallet-selector/domain.js +2 -0
- package/dist/esm/components/wallet-selector/domain.js.map +1 -0
- package/dist/esm/components/wallet-selector/helper.js +12 -0
- package/dist/esm/components/wallet-selector/helper.js.map +1 -0
- package/dist/esm/components/wallet-selector/index.js +5 -0
- package/dist/esm/components/wallet-selector/index.js.map +1 -0
- package/dist/esm/components/wallet-selector/provider.js +15 -0
- package/dist/esm/components/wallet-selector/provider.js.map +1 -0
- package/dist/esm/components/wallet-selector/schemas.js +6 -0
- package/dist/esm/components/wallet-selector/schemas.js.map +1 -0
- package/dist/esm/components/wallet-selector/store.js +134 -0
- package/dist/esm/components/wallet-selector/store.js.map +1 -0
- package/dist/esm/components/wallet-selector/util/exceptions.js +16 -0
- package/dist/esm/components/wallet-selector/util/exceptions.js.map +1 -0
- package/dist/esm/components/wallet-selector/wallets/index.js +3 -0
- package/dist/esm/components/wallet-selector/wallets/index.js.map +1 -0
- package/dist/esm/components/wallet-selector/wallets/wagmi/index.js +218 -0
- package/dist/esm/components/wallet-selector/wallets/wagmi/index.js.map +1 -0
- package/dist/esm/components/wallet-selector/wallets/wagmi/usdt-abi.json +671 -0
- package/dist/esm/config.js +10 -1
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/context.js +2 -1
- package/dist/esm/context.js.map +1 -1
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/integrations/evm-chain.js +22 -0
- package/dist/esm/integrations/evm-chain.js.map +1 -0
- package/dist/esm/integrations/index.js +3 -0
- package/dist/esm/integrations/index.js.map +1 -0
- package/dist/esm/integrations/lifi.js +218 -0
- package/dist/esm/integrations/lifi.js.map +1 -0
- package/dist/esm/integrations/types.js +2 -0
- package/dist/esm/integrations/types.js.map +1 -0
- package/dist/esm/refund/confirmation.js +30 -0
- package/dist/esm/refund/confirmation.js.map +1 -0
- package/dist/esm/refund/index.js +599 -0
- package/dist/esm/refund/index.js.map +1 -0
- package/dist/esm/refund/prepare-guard.js +13 -0
- package/dist/esm/refund/prepare-guard.js.map +1 -0
- package/dist/esm/state/checkout/payment-attempt.js +46 -0
- package/dist/esm/state/checkout/payment-attempt.js.map +1 -0
- package/dist/esm/state/checkout/payment-lifecycle.js +66 -0
- package/dist/esm/state/checkout/payment-lifecycle.js.map +1 -0
- package/dist/esm/state/checkout/store.js +845 -55
- package/dist/esm/state/checkout/store.js.map +1 -1
- package/dist/esm/state/checkout/wallet-payment-options.js +44 -0
- package/dist/esm/state/checkout/wallet-payment-options.js.map +1 -0
- package/dist/esm/themes/default.js +48 -0
- package/dist/esm/themes/default.js.map +1 -1
- package/dist/esm/themes/types.js +1 -1
- package/dist/esm/themes/types.js.map +1 -1
- package/dist/esm/utils/string.js +35 -0
- package/dist/esm/utils/string.js.map +1 -0
- package/dist/esm/utils/wallet-errors.js +15 -0
- package/dist/esm/utils/wallet-errors.js.map +1 -0
- package/dist/types/api/checkouts.d.ts +2 -8
- package/dist/types/api/checkouts.d.ts.map +1 -1
- package/dist/types/api/generated.d.ts +4625 -269
- package/dist/types/api/generated.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +2 -0
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/payments.d.ts +53 -5
- package/dist/types/api/payments.d.ts.map +1 -1
- package/dist/types/api/types.d.ts +24 -7
- package/dist/types/api/types.d.ts.map +1 -1
- package/dist/types/checkout/index.d.ts +10 -2
- package/dist/types/checkout/index.d.ts.map +1 -1
- package/dist/types/checkout/launcher.d.ts +6 -0
- package/dist/types/checkout/launcher.d.ts.map +1 -0
- package/dist/types/checkout/modal.d.ts +4 -2
- package/dist/types/checkout/modal.d.ts.map +1 -1
- package/dist/types/checkout/providers/wagmi-config.d.ts +18 -0
- package/dist/types/checkout/providers/wagmi-config.d.ts.map +1 -0
- package/dist/types/checkout/providers/wallet-connect-resume.d.ts +9 -0
- package/dist/types/checkout/providers/wallet-connect-resume.d.ts.map +1 -0
- package/dist/types/checkout/resume-state.d.ts +13 -0
- package/dist/types/checkout/resume-state.d.ts.map +1 -0
- package/dist/types/checkout/surplus-refund.d.ts +10 -0
- package/dist/types/checkout/surplus-refund.d.ts.map +1 -0
- package/dist/types/checkout/views/amount-header.d.ts +10 -0
- package/dist/types/checkout/views/amount-header.d.ts.map +1 -0
- package/dist/types/checkout/views/back.d.ts +3 -1
- package/dist/types/checkout/views/back.d.ts.map +1 -1
- package/dist/types/checkout/views/crypto-intent/direct-details.d.ts +12 -1
- package/dist/types/checkout/views/crypto-intent/direct-details.d.ts.map +1 -1
- package/dist/types/checkout/views/crypto-intent/manual-payment-summary.d.ts +20 -0
- package/dist/types/checkout/views/crypto-intent/manual-payment-summary.d.ts.map +1 -0
- package/dist/types/checkout/views/crypto-intent/manual-refund-preference.d.ts +16 -0
- package/dist/types/checkout/views/crypto-intent/manual-refund-preference.d.ts.map +1 -0
- package/dist/types/checkout/views/crypto-intent/methods.d.ts.map +1 -1
- package/dist/types/checkout/views/crypto-intent/processing.d.ts +3 -0
- package/dist/types/checkout/views/crypto-intent/processing.d.ts.map +1 -1
- package/dist/types/checkout/views/crypto-intent/success.d.ts +2 -1
- package/dist/types/checkout/views/crypto-intent/success.d.ts.map +1 -1
- package/dist/types/checkout/views/crypto-intent/test-payment.d.ts +3 -0
- package/dist/types/checkout/views/crypto-intent/test-payment.d.ts.map +1 -0
- package/dist/types/checkout/views/crypto-intent/wallet-payment-confirmation-amount.d.ts +13 -0
- package/dist/types/checkout/views/crypto-intent/wallet-payment-confirmation-amount.d.ts.map +1 -0
- package/dist/types/checkout/views/crypto-intent/wallet-payment-options.d.ts +3 -0
- package/dist/types/checkout/views/crypto-intent/wallet-payment-options.d.ts.map +1 -0
- package/dist/types/checkout/views/crypto-intent/wallet-select.d.ts +3 -0
- package/dist/types/checkout/views/crypto-intent/wallet-select.d.ts.map +1 -0
- package/dist/types/checkout/views/failed.d.ts +2 -0
- package/dist/types/checkout/views/failed.d.ts.map +1 -0
- package/dist/types/checkout/views/initial.d.ts +6 -2
- package/dist/types/checkout/views/initial.d.ts.map +1 -1
- package/dist/types/checkout/views/method-select.d.ts +2 -0
- package/dist/types/checkout/views/method-select.d.ts.map +1 -1
- package/dist/types/checkout/views/restart.d.ts +4 -0
- package/dist/types/checkout/views/restart.d.ts.map +1 -0
- package/dist/types/components/buttons/async-button.d.ts +14 -0
- package/dist/types/components/buttons/async-button.d.ts.map +1 -0
- package/dist/types/components/buttons/index.d.ts +21 -3
- package/dist/types/components/buttons/index.d.ts.map +1 -1
- package/dist/types/components/buttons/use-async-button.d.ts +16 -0
- package/dist/types/components/buttons/use-async-button.d.ts.map +1 -0
- package/dist/types/components/crypto/currency-selector.d.ts +11 -0
- package/dist/types/components/crypto/currency-selector.d.ts.map +1 -0
- package/dist/types/components/icons/alert.d.ts +7 -0
- package/dist/types/components/icons/alert.d.ts.map +1 -0
- package/dist/types/components/icons/checkMark.d.ts.map +1 -1
- package/dist/types/components/icons/clipboard-add.d.ts +6 -0
- package/dist/types/components/icons/clipboard-add.d.ts.map +1 -0
- package/dist/types/components/icons/clipboard-check.d.ts +6 -0
- package/dist/types/components/icons/clipboard-check.d.ts.map +1 -0
- package/dist/types/components/icons/clock.d.ts +6 -0
- package/dist/types/components/icons/clock.d.ts.map +1 -0
- package/dist/types/components/icons/close.d.ts.map +1 -1
- package/dist/types/components/icons/edit.d.ts +6 -0
- package/dist/types/components/icons/edit.d.ts.map +1 -0
- package/dist/types/components/icons/index.d.ts +9 -0
- package/dist/types/components/icons/index.d.ts.map +1 -1
- package/dist/types/components/icons/link.d.ts +6 -0
- package/dist/types/components/icons/link.d.ts.map +1 -0
- package/dist/types/components/icons/loading.d.ts +6 -0
- package/dist/types/components/icons/loading.d.ts.map +1 -0
- package/dist/types/components/icons/log-out.d.ts +6 -0
- package/dist/types/components/icons/log-out.d.ts.map +1 -0
- package/dist/types/components/icons/send.d.ts +6 -0
- package/dist/types/components/icons/send.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/components/inputs/index.d.ts +7 -0
- package/dist/types/components/inputs/index.d.ts.map +1 -0
- package/dist/types/components/lists/index.d.ts.map +1 -1
- package/dist/types/components/loading/index.d.ts.map +1 -1
- package/dist/types/components/modals/modal-with-views.d.ts +1 -0
- package/dist/types/components/modals/modal-with-views.d.ts.map +1 -1
- package/dist/types/components/modals/modal.d.ts.map +1 -1
- package/dist/types/components/modals/use-modal-with-views.d.ts.map +1 -1
- package/dist/types/components/quote-expiry/index.d.ts +2 -0
- package/dist/types/components/quote-expiry/index.d.ts.map +1 -0
- package/dist/types/components/quote-expiry/quote-expiry-countdown.d.ts +15 -0
- package/dist/types/components/quote-expiry/quote-expiry-countdown.d.ts.map +1 -0
- package/dist/types/components/quote-expiry/styles.d.ts +22 -0
- package/dist/types/components/quote-expiry/styles.d.ts.map +1 -0
- package/dist/types/components/quote-expiry/tiers.d.ts +10 -0
- package/dist/types/components/quote-expiry/tiers.d.ts.map +1 -0
- package/dist/types/components/text/index.d.ts.map +1 -1
- package/dist/types/components/wallet-selector/component.d.ts +12 -0
- package/dist/types/components/wallet-selector/component.d.ts.map +1 -0
- package/dist/types/components/wallet-selector/domain.d.ts +96 -0
- package/dist/types/components/wallet-selector/domain.d.ts.map +1 -0
- package/dist/types/components/wallet-selector/helper.d.ts +4 -0
- package/dist/types/components/wallet-selector/helper.d.ts.map +1 -0
- package/dist/types/components/wallet-selector/index.d.ts +7 -0
- package/dist/types/components/wallet-selector/index.d.ts.map +1 -0
- package/dist/types/components/wallet-selector/provider.d.ts +10 -0
- package/dist/types/components/wallet-selector/provider.d.ts.map +1 -0
- package/dist/types/components/wallet-selector/schemas.d.ts +4 -0
- package/dist/types/components/wallet-selector/schemas.d.ts.map +1 -0
- package/dist/types/components/wallet-selector/store.d.ts +33 -0
- package/dist/types/components/wallet-selector/store.d.ts.map +1 -0
- package/dist/types/components/wallet-selector/util/exceptions.d.ts +7 -0
- package/dist/types/components/wallet-selector/util/exceptions.d.ts.map +1 -0
- package/dist/types/components/wallet-selector/wallets/index.d.ts +3 -0
- package/dist/types/components/wallet-selector/wallets/index.d.ts.map +1 -0
- package/dist/types/components/wallet-selector/wallets/wagmi/index.d.ts +519 -0
- package/dist/types/components/wallet-selector/wallets/wagmi/index.d.ts.map +1 -0
- package/dist/types/config.d.ts +74 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/context.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/integrations/evm-chain.d.ts +3 -0
- package/dist/types/integrations/evm-chain.d.ts.map +1 -0
- package/dist/types/integrations/index.d.ts +3 -0
- package/dist/types/integrations/index.d.ts.map +1 -0
- package/dist/types/integrations/lifi.d.ts +14 -0
- package/dist/types/integrations/lifi.d.ts.map +1 -0
- package/dist/types/integrations/types.d.ts +5 -0
- package/dist/types/integrations/types.d.ts.map +1 -0
- package/dist/types/refund/confirmation.d.ts +14 -0
- package/dist/types/refund/confirmation.d.ts.map +1 -0
- package/dist/types/refund/index.d.ts +26 -0
- package/dist/types/refund/index.d.ts.map +1 -0
- package/dist/types/refund/prepare-guard.d.ts +11 -0
- package/dist/types/refund/prepare-guard.d.ts.map +1 -0
- package/dist/types/state/checkout/payment-attempt.d.ts +9 -0
- package/dist/types/state/checkout/payment-attempt.d.ts.map +1 -0
- package/dist/types/state/checkout/payment-lifecycle.d.ts +37 -0
- package/dist/types/state/checkout/payment-lifecycle.d.ts.map +1 -0
- package/dist/types/state/checkout/store.d.ts +88 -40
- package/dist/types/state/checkout/store.d.ts.map +1 -1
- package/dist/types/state/checkout/wallet-payment-options.d.ts +24 -0
- package/dist/types/state/checkout/wallet-payment-options.d.ts.map +1 -0
- package/dist/types/themes/default.d.ts +2 -2
- package/dist/types/themes/default.d.ts.map +1 -1
- package/dist/types/themes/types.d.ts +20 -0
- package/dist/types/themes/types.d.ts.map +1 -1
- package/dist/types/utils/string.d.ts +24 -0
- package/dist/types/utils/string.d.ts.map +1 -0
- package/dist/types/utils/wallet-errors.d.ts +2 -0
- package/dist/types/utils/wallet-errors.d.ts.map +1 -0
- package/package.json +50 -7
- package/LICENSE +0 -21
- package/dist/esm/checkout/views/card-intent/details.js +0 -12
- package/dist/esm/checkout/views/card-intent/details.js.map +0 -1
- package/dist/esm/checkout/views/crypto-intent/curreny.js +0 -28
- package/dist/esm/checkout/views/crypto-intent/curreny.js.map +0 -1
- package/dist/types/checkout/views/card-intent/details.d.ts +0 -3
- package/dist/types/checkout/views/card-intent/details.d.ts.map +0 -1
- package/dist/types/checkout/views/crypto-intent/curreny.d.ts +0 -3
- package/dist/types/checkout/views/crypto-intent/curreny.d.ts.map +0 -1
|
@@ -0,0 +1,1207 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useAppKit } from "@reown/appkit/react";
|
|
3
|
+
import { disconnect } from "@wagmi/core";
|
|
4
|
+
import { useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
5
|
+
import { keyframes, styled } from "styled-components";
|
|
6
|
+
import { useAccount, useConfig } from "wagmi";
|
|
7
|
+
import { confirmPayment } from "../../../api/payments.js";
|
|
8
|
+
import { EditIcon, LogOutIcon } from "../../../components/icons/index.js";
|
|
9
|
+
import { QuoteExpiryCountdown, StyledButton, Text, useModalWithView, } from "../../../components/index.js";
|
|
10
|
+
import { WalletContext } from "../../../components/wallet-selector/provider.js";
|
|
11
|
+
import { useWalletActions } from "../../../components/wallet-selector/store.js";
|
|
12
|
+
import { WagmiWalletInterface } from "../../../components/wallet-selector/wallets/wagmi/index.js";
|
|
13
|
+
import { useMintMoneyConfig } from "../../../context.js";
|
|
14
|
+
import { executeWalletPaymentOption, fetchWalletPaymentQuote, findWalletPaymentOptions, } from "../../../integrations/index.js";
|
|
15
|
+
import { clearQuoteRefresh, checkChainStatus, configureWalletQuoteRefresh, createWalletOptionPaymentAttempt, executeTransfer, prepareWalletQuoteReplacement, resetWalletPaymentState, setProcessing, setSelectedCurrency, setWalletPaymentState, useCheckoutStore, } from "../../../state/checkout/store.js";
|
|
16
|
+
import { buildWalletPaymentOptionsLoadKey, buildWalletQuoteLoadKey, buildWalletPaymentOptionsReadyState, NO_WALLET_PAYMENT_OPTIONS_DESCRIPTION, NO_WALLET_PAYMENT_OPTIONS_TITLE, } from "../../../state/checkout/wallet-payment-options.js";
|
|
17
|
+
import { formatAddress } from "../../../utils/string.js";
|
|
18
|
+
import { messageForWalletError } from "../../../utils/wallet-errors.js";
|
|
19
|
+
import { ModalViewContainer } from "../../container.js";
|
|
20
|
+
import { clearCheckoutResumeState, readCheckoutResumeState, writeCheckoutResumeState, writePendingWalletConnectionResumeState, } from "../../resume-state.js";
|
|
21
|
+
import { ModalBackButton } from "../back.js";
|
|
22
|
+
import { resolveWalletPaymentConfirmationAmount } from "./wallet-payment-confirmation-amount.js";
|
|
23
|
+
const QUOTE_COUNTDOWN_URGENT_THRESHOLD_RATIO = 0.25;
|
|
24
|
+
const pillSlideIn = keyframes `
|
|
25
|
+
from {
|
|
26
|
+
opacity: 0;
|
|
27
|
+
transform: translateY(-6px);
|
|
28
|
+
}
|
|
29
|
+
to {
|
|
30
|
+
opacity: 1;
|
|
31
|
+
transform: translateY(0);
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
const ContextStrip = styled.div `
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
gap: 8px;
|
|
38
|
+
`;
|
|
39
|
+
const ContextPill = styled.div `
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
padding: 12px 14px;
|
|
42
|
+
border-radius: 14px;
|
|
43
|
+
background: ${({ $accent }) => ($accent ? "#f8fffc" : "#ffffff")};
|
|
44
|
+
border: 1px solid ${({ $accent }) => ($accent ? "#bbf7d0" : "#eef2f6")};
|
|
45
|
+
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
|
|
46
|
+
animation: ${pillSlideIn} 200ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
47
|
+
`;
|
|
48
|
+
const ContextPillToggle = styled.button `
|
|
49
|
+
width: 100%;
|
|
50
|
+
border: 0;
|
|
51
|
+
background: transparent;
|
|
52
|
+
color: inherit;
|
|
53
|
+
padding: 0;
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: 12px;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
text-align: left;
|
|
59
|
+
|
|
60
|
+
&:focus-visible {
|
|
61
|
+
outline: 2px solid #a7f3d0;
|
|
62
|
+
outline-offset: 4px;
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
const PillIconWrap = styled.div `
|
|
66
|
+
position: relative;
|
|
67
|
+
width: 40px;
|
|
68
|
+
height: 40px;
|
|
69
|
+
flex-shrink: 0;
|
|
70
|
+
`;
|
|
71
|
+
const PillTokenIcon = styled.div `
|
|
72
|
+
width: 100%;
|
|
73
|
+
height: 100%;
|
|
74
|
+
border-radius: 999px;
|
|
75
|
+
display: inline-flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
font-size: 11px;
|
|
79
|
+
font-weight: 700;
|
|
80
|
+
color: #1d4ed8;
|
|
81
|
+
background: linear-gradient(135deg, #dbeafe, #bfdbfe);
|
|
82
|
+
background-image: ${({ $iconUrl }) => $iconUrl ? `url(${$iconUrl})` : "none"};
|
|
83
|
+
background-size: cover;
|
|
84
|
+
background-position: center;
|
|
85
|
+
`;
|
|
86
|
+
const PillChainBadge = styled.div `
|
|
87
|
+
position: absolute;
|
|
88
|
+
right: -2px;
|
|
89
|
+
bottom: -2px;
|
|
90
|
+
width: 14px;
|
|
91
|
+
height: 14px;
|
|
92
|
+
border-radius: 999px;
|
|
93
|
+
border: 1.5px solid #ffffff;
|
|
94
|
+
background: #ffffff;
|
|
95
|
+
background-image: ${({ $iconUrl }) => $iconUrl ? `url(${$iconUrl})` : "none"};
|
|
96
|
+
background-size: 85%;
|
|
97
|
+
background-position: center;
|
|
98
|
+
background-repeat: no-repeat;
|
|
99
|
+
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
|
|
100
|
+
`;
|
|
101
|
+
const WalletDot = styled.div `
|
|
102
|
+
width: 22px;
|
|
103
|
+
height: 22px;
|
|
104
|
+
border-radius: 999px;
|
|
105
|
+
flex-shrink: 0;
|
|
106
|
+
background:
|
|
107
|
+
${({ $iconUrl }) => ($iconUrl ? `url(${$iconUrl})` : "none")},
|
|
108
|
+
linear-gradient(135deg, #22c55e, #60a5fa);
|
|
109
|
+
background-size: cover;
|
|
110
|
+
background-position: center;
|
|
111
|
+
`;
|
|
112
|
+
const WalletSwitchLink = styled.button `
|
|
113
|
+
flex-shrink: 0;
|
|
114
|
+
border: none;
|
|
115
|
+
background: transparent;
|
|
116
|
+
color: #94a3b8;
|
|
117
|
+
display: inline-flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
justify-content: center;
|
|
120
|
+
width: 24px;
|
|
121
|
+
height: 24px;
|
|
122
|
+
margin: -2px -2px -2px -6px;
|
|
123
|
+
padding: 0;
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
border-radius: 999px;
|
|
126
|
+
transition:
|
|
127
|
+
color 120ms ease,
|
|
128
|
+
background-color 120ms ease;
|
|
129
|
+
|
|
130
|
+
&:hover {
|
|
131
|
+
color: #0f172a;
|
|
132
|
+
background: #f1f5f9;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&:focus-visible {
|
|
136
|
+
outline: 2px solid #a7f3d0;
|
|
137
|
+
outline-offset: 2px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&:disabled {
|
|
141
|
+
opacity: 0.5;
|
|
142
|
+
cursor: not-allowed;
|
|
143
|
+
}
|
|
144
|
+
`;
|
|
145
|
+
const WalletDisconnectButton = styled.button `
|
|
146
|
+
flex-shrink: 0;
|
|
147
|
+
border: none;
|
|
148
|
+
background: transparent;
|
|
149
|
+
color: #dc2626;
|
|
150
|
+
display: inline-flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
justify-content: center;
|
|
153
|
+
width: 24px;
|
|
154
|
+
height: 24px;
|
|
155
|
+
margin: -2px -2px -2px -4px;
|
|
156
|
+
padding: 0;
|
|
157
|
+
border-radius: 999px;
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
transition:
|
|
160
|
+
background-color 120ms ease,
|
|
161
|
+
color 120ms ease;
|
|
162
|
+
|
|
163
|
+
&:hover {
|
|
164
|
+
background: #fee2e2;
|
|
165
|
+
color: #b91c1c;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&:focus-visible {
|
|
169
|
+
outline: 2px solid #fecaca;
|
|
170
|
+
outline-offset: 2px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&:disabled {
|
|
174
|
+
opacity: 0.5;
|
|
175
|
+
cursor: not-allowed;
|
|
176
|
+
}
|
|
177
|
+
`;
|
|
178
|
+
const WalletRowActions = styled.div `
|
|
179
|
+
display: inline-flex;
|
|
180
|
+
align-items: center;
|
|
181
|
+
gap: 6px;
|
|
182
|
+
flex-shrink: 0;
|
|
183
|
+
`;
|
|
184
|
+
const PillBody = styled.div `
|
|
185
|
+
display: flex;
|
|
186
|
+
flex-direction: column;
|
|
187
|
+
gap: 2px;
|
|
188
|
+
min-width: 0;
|
|
189
|
+
flex: 1;
|
|
190
|
+
`;
|
|
191
|
+
const PillEyebrow = styled.span `
|
|
192
|
+
font-size: 12px;
|
|
193
|
+
line-height: 1.2;
|
|
194
|
+
color: ${({ theme }) => theme.font.color.tertiary};
|
|
195
|
+
white-space: nowrap;
|
|
196
|
+
overflow: hidden;
|
|
197
|
+
text-overflow: ellipsis;
|
|
198
|
+
`;
|
|
199
|
+
const PillTitle = styled.span `
|
|
200
|
+
font-size: 14px;
|
|
201
|
+
font-weight: 600;
|
|
202
|
+
color: ${({ theme }) => theme.font.color.primary};
|
|
203
|
+
line-height: 1.3;
|
|
204
|
+
white-space: nowrap;
|
|
205
|
+
overflow: hidden;
|
|
206
|
+
text-overflow: ellipsis;
|
|
207
|
+
`;
|
|
208
|
+
const PillAction = styled.button `
|
|
209
|
+
flex-shrink: 0;
|
|
210
|
+
border: none;
|
|
211
|
+
background: transparent;
|
|
212
|
+
color: ${({ theme }) => theme.font.color.secondary};
|
|
213
|
+
font-size: 14px;
|
|
214
|
+
font-weight: 600;
|
|
215
|
+
padding: 6px 10px;
|
|
216
|
+
border-radius: 999px;
|
|
217
|
+
cursor: pointer;
|
|
218
|
+
transition:
|
|
219
|
+
background-color 120ms ease,
|
|
220
|
+
color 120ms ease;
|
|
221
|
+
|
|
222
|
+
&:hover {
|
|
223
|
+
background: #f1f5f9;
|
|
224
|
+
color: #0f172a;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
&:focus-visible {
|
|
228
|
+
outline: 2px solid #a7f3d0;
|
|
229
|
+
outline-offset: 2px;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
&:disabled {
|
|
233
|
+
opacity: 0.5;
|
|
234
|
+
cursor: not-allowed;
|
|
235
|
+
}
|
|
236
|
+
`;
|
|
237
|
+
const PillCaret = styled.span `
|
|
238
|
+
width: 24px;
|
|
239
|
+
height: 24px;
|
|
240
|
+
border-radius: 999px;
|
|
241
|
+
background: #f1f3fb;
|
|
242
|
+
display: inline-flex;
|
|
243
|
+
align-items: center;
|
|
244
|
+
justify-content: center;
|
|
245
|
+
font-size: 13px;
|
|
246
|
+
line-height: 1;
|
|
247
|
+
color: #6b7280;
|
|
248
|
+
transform: rotate(${({ $expanded }) => ($expanded ? "180deg" : "0deg")});
|
|
249
|
+
transition:
|
|
250
|
+
transform 0.15s ease,
|
|
251
|
+
background 0.15s ease;
|
|
252
|
+
flex-shrink: 0;
|
|
253
|
+
`;
|
|
254
|
+
const PillDetails = styled.div `
|
|
255
|
+
border-top: 1px solid #edf1f5;
|
|
256
|
+
margin-top: 12px;
|
|
257
|
+
padding-top: 12px;
|
|
258
|
+
display: flex;
|
|
259
|
+
flex-direction: column;
|
|
260
|
+
`;
|
|
261
|
+
const PillDetailRow = styled.div `
|
|
262
|
+
display: flex;
|
|
263
|
+
align-items: center;
|
|
264
|
+
justify-content: space-between;
|
|
265
|
+
gap: 12px;
|
|
266
|
+
border-bottom: 1px solid #edf1f5;
|
|
267
|
+
padding: 9px 0;
|
|
268
|
+
|
|
269
|
+
&:last-child {
|
|
270
|
+
border-bottom: 0;
|
|
271
|
+
padding-bottom: 0;
|
|
272
|
+
}
|
|
273
|
+
`;
|
|
274
|
+
const PillDetailLabel = styled.span `
|
|
275
|
+
font-size: 13px;
|
|
276
|
+
line-height: 1.3;
|
|
277
|
+
color: #475569;
|
|
278
|
+
`;
|
|
279
|
+
const PillDetailValue = styled.span `
|
|
280
|
+
display: inline-flex;
|
|
281
|
+
align-items: center;
|
|
282
|
+
justify-content: flex-end;
|
|
283
|
+
gap: 6px;
|
|
284
|
+
min-width: 0;
|
|
285
|
+
font-size: 13px;
|
|
286
|
+
line-height: 1.3;
|
|
287
|
+
font-weight: 600;
|
|
288
|
+
color: #0f172a;
|
|
289
|
+
text-align: right;
|
|
290
|
+
`;
|
|
291
|
+
const SectionLabel = styled.div `
|
|
292
|
+
font-size: 11px;
|
|
293
|
+
font-weight: 600;
|
|
294
|
+
letter-spacing: 0.06em;
|
|
295
|
+
text-transform: uppercase;
|
|
296
|
+
color: #94a3b8;
|
|
297
|
+
padding: 0 2px;
|
|
298
|
+
`;
|
|
299
|
+
const SectionRow = styled.div `
|
|
300
|
+
display: flex;
|
|
301
|
+
align-items: baseline;
|
|
302
|
+
justify-content: space-between;
|
|
303
|
+
gap: 12px;
|
|
304
|
+
padding: 0 2px;
|
|
305
|
+
`;
|
|
306
|
+
const ConnectedWalletRow = styled.div `
|
|
307
|
+
display: flex;
|
|
308
|
+
align-items: center;
|
|
309
|
+
justify-content: space-between;
|
|
310
|
+
gap: 12px;
|
|
311
|
+
padding: 2px 4px;
|
|
312
|
+
`;
|
|
313
|
+
const ConnectedWalletIdentity = styled.div `
|
|
314
|
+
display: inline-flex;
|
|
315
|
+
align-items: center;
|
|
316
|
+
gap: 10px;
|
|
317
|
+
min-width: 0;
|
|
318
|
+
font-size: 14px;
|
|
319
|
+
line-height: 1.4;
|
|
320
|
+
color: #64748b;
|
|
321
|
+
`;
|
|
322
|
+
const ConnectedWalletAddress = styled.span `
|
|
323
|
+
min-width: 0;
|
|
324
|
+
overflow: hidden;
|
|
325
|
+
text-overflow: ellipsis;
|
|
326
|
+
white-space: nowrap;
|
|
327
|
+
`;
|
|
328
|
+
const OptionsContainer = styled.div `
|
|
329
|
+
display: flex;
|
|
330
|
+
flex-direction: column;
|
|
331
|
+
flex: 1;
|
|
332
|
+
gap: 8px;
|
|
333
|
+
min-height: 0;
|
|
334
|
+
overflow-y: auto;
|
|
335
|
+
margin: -4px -4px -6px;
|
|
336
|
+
padding: 4px 4px 6px;
|
|
337
|
+
overscroll-behavior: contain;
|
|
338
|
+
scrollbar-width: none;
|
|
339
|
+
|
|
340
|
+
&::-webkit-scrollbar {
|
|
341
|
+
display: none;
|
|
342
|
+
}
|
|
343
|
+
`;
|
|
344
|
+
const OptionCard = styled.button `
|
|
345
|
+
border: 1px solid #eef2f6;
|
|
346
|
+
border-radius: 16px;
|
|
347
|
+
padding: 12px 14px;
|
|
348
|
+
background: #ffffff;
|
|
349
|
+
cursor: pointer;
|
|
350
|
+
width: 100%;
|
|
351
|
+
text-align: left;
|
|
352
|
+
display: flex;
|
|
353
|
+
align-items: center;
|
|
354
|
+
gap: 12px;
|
|
355
|
+
transition:
|
|
356
|
+
border-color 140ms ease,
|
|
357
|
+
box-shadow 140ms ease,
|
|
358
|
+
transform 140ms ease,
|
|
359
|
+
background-color 140ms ease;
|
|
360
|
+
|
|
361
|
+
&:hover {
|
|
362
|
+
border-color: #cdd9e3;
|
|
363
|
+
box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
|
|
364
|
+
transform: translateY(-1px);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
&:focus-visible {
|
|
368
|
+
outline: 2px solid #a7f3d0;
|
|
369
|
+
outline-offset: 2px;
|
|
370
|
+
}
|
|
371
|
+
`;
|
|
372
|
+
const OptionTokenIconWrap = styled.div `
|
|
373
|
+
position: relative;
|
|
374
|
+
width: 40px;
|
|
375
|
+
height: 40px;
|
|
376
|
+
flex-shrink: 0;
|
|
377
|
+
`;
|
|
378
|
+
const OptionTokenIcon = styled.div `
|
|
379
|
+
width: 100%;
|
|
380
|
+
height: 100%;
|
|
381
|
+
border-radius: 999px;
|
|
382
|
+
display: inline-flex;
|
|
383
|
+
align-items: center;
|
|
384
|
+
justify-content: center;
|
|
385
|
+
font-size: 12px;
|
|
386
|
+
font-weight: 700;
|
|
387
|
+
color: ${({ $token }) => ($token === "ETH" ? "#ffffff" : "#1d4ed8")};
|
|
388
|
+
background: ${({ $token }) => $token === "ETH"
|
|
389
|
+
? "linear-gradient(135deg, #64748b, #0f172a)"
|
|
390
|
+
: "linear-gradient(135deg, #dbeafe, #bfdbfe)"};
|
|
391
|
+
background-image: ${({ $iconUrl }) => $iconUrl ? `url(${$iconUrl})` : "none"};
|
|
392
|
+
background-size: cover;
|
|
393
|
+
background-position: center;
|
|
394
|
+
overflow: hidden;
|
|
395
|
+
`;
|
|
396
|
+
const OptionChainBadge = styled.div `
|
|
397
|
+
position: absolute;
|
|
398
|
+
right: -2px;
|
|
399
|
+
bottom: -2px;
|
|
400
|
+
width: 18px;
|
|
401
|
+
height: 18px;
|
|
402
|
+
border-radius: 999px;
|
|
403
|
+
border: 1.5px solid #ffffff;
|
|
404
|
+
background: #ffffff;
|
|
405
|
+
background-image: ${({ $iconUrl }) => $iconUrl ? `url(${$iconUrl})` : "none"};
|
|
406
|
+
background-size: 85%;
|
|
407
|
+
background-position: center;
|
|
408
|
+
background-repeat: no-repeat;
|
|
409
|
+
box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
|
|
410
|
+
overflow: hidden;
|
|
411
|
+
`;
|
|
412
|
+
const OptionIdentity = styled.div `
|
|
413
|
+
display: flex;
|
|
414
|
+
flex-direction: column;
|
|
415
|
+
gap: 2px;
|
|
416
|
+
min-width: 0;
|
|
417
|
+
flex: 1;
|
|
418
|
+
`;
|
|
419
|
+
const OptionBalance = styled.div `
|
|
420
|
+
display: flex;
|
|
421
|
+
flex-direction: column;
|
|
422
|
+
align-items: flex-end;
|
|
423
|
+
gap: 4px;
|
|
424
|
+
flex-shrink: 0;
|
|
425
|
+
`;
|
|
426
|
+
const FastBadge = styled.span `
|
|
427
|
+
display: inline-flex;
|
|
428
|
+
align-items: center;
|
|
429
|
+
border-radius: 999px;
|
|
430
|
+
gap: 4px;
|
|
431
|
+
background: #ecfdf5;
|
|
432
|
+
color: #047857;
|
|
433
|
+
font-size: 11px;
|
|
434
|
+
font-weight: 600;
|
|
435
|
+
line-height: 1;
|
|
436
|
+
padding: 4px 8px;
|
|
437
|
+
white-space: nowrap;
|
|
438
|
+
`;
|
|
439
|
+
const RoutedBadge = styled.span `
|
|
440
|
+
font-size: 11px;
|
|
441
|
+
font-weight: 500;
|
|
442
|
+
color: #94a3b8;
|
|
443
|
+
white-space: nowrap;
|
|
444
|
+
`;
|
|
445
|
+
const QuoteCard = styled.div `
|
|
446
|
+
background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
|
|
447
|
+
border: 1px solid #eef2f6;
|
|
448
|
+
border-radius: 18px;
|
|
449
|
+
padding: 16px 18px;
|
|
450
|
+
display: flex;
|
|
451
|
+
flex-direction: column;
|
|
452
|
+
gap: 10px;
|
|
453
|
+
box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
|
|
454
|
+
`;
|
|
455
|
+
const QuoteRow = styled.div `
|
|
456
|
+
display: flex;
|
|
457
|
+
align-items: baseline;
|
|
458
|
+
justify-content: space-between;
|
|
459
|
+
gap: 16px;
|
|
460
|
+
`;
|
|
461
|
+
const QuoteHairline = styled.div `
|
|
462
|
+
height: 1px;
|
|
463
|
+
background: #eef2f6;
|
|
464
|
+
margin: 2px 0;
|
|
465
|
+
`;
|
|
466
|
+
const QuoteFootnote = styled.div `
|
|
467
|
+
display: flex;
|
|
468
|
+
align-items: center;
|
|
469
|
+
gap: 6px;
|
|
470
|
+
font-size: 12px;
|
|
471
|
+
color: #94a3b8;
|
|
472
|
+
|
|
473
|
+
&::before {
|
|
474
|
+
content: "";
|
|
475
|
+
display: inline-block;
|
|
476
|
+
width: 6px;
|
|
477
|
+
height: 6px;
|
|
478
|
+
border-radius: 999px;
|
|
479
|
+
background: #22c55e;
|
|
480
|
+
box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
|
|
481
|
+
}
|
|
482
|
+
`;
|
|
483
|
+
const QuoteFootnoteWarn = styled(QuoteFootnote) `
|
|
484
|
+
color: #b45309;
|
|
485
|
+
|
|
486
|
+
&::before {
|
|
487
|
+
background: #f59e0b;
|
|
488
|
+
box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
|
|
489
|
+
}
|
|
490
|
+
`;
|
|
491
|
+
const SkeletonContainer = styled.div `
|
|
492
|
+
display: flex;
|
|
493
|
+
flex-direction: column;
|
|
494
|
+
gap: 8px;
|
|
495
|
+
`;
|
|
496
|
+
const skeletonShimmer = keyframes `
|
|
497
|
+
0% { background-position: -120% 0; }
|
|
498
|
+
100% { background-position: 220% 0; }
|
|
499
|
+
`;
|
|
500
|
+
const SkeletonRow = styled.div `
|
|
501
|
+
height: 64px;
|
|
502
|
+
border-radius: 16px;
|
|
503
|
+
border: 1px solid #eef2f6;
|
|
504
|
+
background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 50%, #f8fafc 100%);
|
|
505
|
+
background-size: 220% 100%;
|
|
506
|
+
animation: ${skeletonShimmer} 1.4s ease-in-out infinite;
|
|
507
|
+
`;
|
|
508
|
+
const EmptyState = styled.div `
|
|
509
|
+
position: relative;
|
|
510
|
+
border-radius: 22px;
|
|
511
|
+
padding: 22px 20px;
|
|
512
|
+
background: #ffffff;
|
|
513
|
+
border: 1px solid #ecf1ee;
|
|
514
|
+
display: flex;
|
|
515
|
+
flex-direction: column;
|
|
516
|
+
align-items: center;
|
|
517
|
+
gap: 10px;
|
|
518
|
+
text-align: center;
|
|
519
|
+
box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
|
|
520
|
+
`;
|
|
521
|
+
const EmptyHeadline = styled.div `
|
|
522
|
+
display: flex;
|
|
523
|
+
flex-direction: column;
|
|
524
|
+
gap: 4px;
|
|
525
|
+
max-width: 300px;
|
|
526
|
+
`;
|
|
527
|
+
const FallbackTopActions = styled.div `
|
|
528
|
+
display: flex;
|
|
529
|
+
justify-content: flex-end;
|
|
530
|
+
min-height: 32px;
|
|
531
|
+
`;
|
|
532
|
+
const FallbackDisconnectButton = styled(WalletDisconnectButton) `
|
|
533
|
+
width: 32px;
|
|
534
|
+
height: 32px;
|
|
535
|
+
margin: 0;
|
|
536
|
+
border: 1px solid #fee2e2;
|
|
537
|
+
background: #ffffff;
|
|
538
|
+
`;
|
|
539
|
+
const ContentStage = styled.div `
|
|
540
|
+
display: flex;
|
|
541
|
+
flex-direction: column;
|
|
542
|
+
flex: 1;
|
|
543
|
+
gap: 14px;
|
|
544
|
+
min-height: 0;
|
|
545
|
+
|
|
546
|
+
@media (max-width: 768px) {
|
|
547
|
+
justify-content: ${({ $mobileCentered }) => $mobileCentered ? "center" : "flex-start"};
|
|
548
|
+
}
|
|
549
|
+
`;
|
|
550
|
+
const formatDisplayAmount = (amount, maximumFractionDigits = 4) => {
|
|
551
|
+
if (!amount)
|
|
552
|
+
return null;
|
|
553
|
+
const parsed = Number(amount);
|
|
554
|
+
if (!Number.isFinite(parsed))
|
|
555
|
+
return amount;
|
|
556
|
+
if (parsed >= 1000)
|
|
557
|
+
return parsed.toLocaleString(undefined, { maximumFractionDigits: 2 });
|
|
558
|
+
if (parsed >= 1) {
|
|
559
|
+
return parsed.toLocaleString(undefined, {
|
|
560
|
+
minimumFractionDigits: 2,
|
|
561
|
+
maximumFractionDigits: 2,
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
if (parsed >= 0.01) {
|
|
565
|
+
return parsed.toLocaleString(undefined, {
|
|
566
|
+
minimumFractionDigits: 2,
|
|
567
|
+
maximumFractionDigits,
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
return parsed.toLocaleString(undefined, {
|
|
571
|
+
minimumFractionDigits: 4,
|
|
572
|
+
maximumFractionDigits,
|
|
573
|
+
});
|
|
574
|
+
};
|
|
575
|
+
const formatTokenBalance = (tokenName, amount) => {
|
|
576
|
+
const isEth = tokenName.toUpperCase() === "ETH";
|
|
577
|
+
const formatted = formatDisplayAmount(amount, isEth ? 8 : 4);
|
|
578
|
+
if (!formatted)
|
|
579
|
+
return null;
|
|
580
|
+
if (tokenName.toLowerCase().includes("usd"))
|
|
581
|
+
return `$${formatted}`;
|
|
582
|
+
if (isEth)
|
|
583
|
+
return `ETH ${formatted}`;
|
|
584
|
+
return formatted;
|
|
585
|
+
};
|
|
586
|
+
const formatMoneyAmount = (currency, amount) => {
|
|
587
|
+
try {
|
|
588
|
+
return new Intl.NumberFormat(undefined, {
|
|
589
|
+
style: "currency",
|
|
590
|
+
currency,
|
|
591
|
+
minimumFractionDigits: 2,
|
|
592
|
+
maximumFractionDigits: 2,
|
|
593
|
+
}).format(amount);
|
|
594
|
+
}
|
|
595
|
+
catch {
|
|
596
|
+
return `${currency} ${amount.toFixed(2)}`;
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
const getTokenMonogram = (tokenName, tokenSymbol) => {
|
|
600
|
+
if (tokenSymbol)
|
|
601
|
+
return tokenSymbol.slice(0, 2).toUpperCase();
|
|
602
|
+
return tokenName.slice(0, 2).toUpperCase();
|
|
603
|
+
};
|
|
604
|
+
const buildDirectQuote = (option, context) => {
|
|
605
|
+
const amount = String(context.cryptoPaymentAttempt.amount_formatted);
|
|
606
|
+
const formattedAmount = formatDisplayAmount(amount) ?? amount;
|
|
607
|
+
const amountDisplay = formatTokenBalance(option.fromTokenSymbol ?? option.fromTokenName, formattedAmount) ?? formattedAmount;
|
|
608
|
+
return {
|
|
609
|
+
quoteId: option.quoteId,
|
|
610
|
+
routeId: option.routeId,
|
|
611
|
+
toolName: "Direct transfer",
|
|
612
|
+
fromAmount: amount,
|
|
613
|
+
fromAmountDisplay: amountDisplay,
|
|
614
|
+
toAmount: amount,
|
|
615
|
+
toAmountDisplay: amountDisplay,
|
|
616
|
+
estimatedDurationMinutes: 1,
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
const CryptoIntentWalletPaymentOptionsAppKitViewContent = () => {
|
|
620
|
+
const modalRef = useRef(null);
|
|
621
|
+
const isChangingWalletRef = useRef(false);
|
|
622
|
+
const lastWalletOptionsLoadKeyRef = useRef(null);
|
|
623
|
+
const walletOptionsRequestRef = useRef(null);
|
|
624
|
+
const lastQuoteLoadKeyRef = useRef(null);
|
|
625
|
+
const { goToView } = useModalWithView();
|
|
626
|
+
const { open } = useAppKit();
|
|
627
|
+
const config = useMintMoneyConfig();
|
|
628
|
+
const wagmiConfig = useConfig();
|
|
629
|
+
const { wallet, setWallet } = useContext(WalletContext);
|
|
630
|
+
const { initialiseWallets } = useWalletActions();
|
|
631
|
+
const account = useAccount();
|
|
632
|
+
const { payment, cryptoPaymentAttempt, cryptoCurrency, walletPayment, quote, loading, processing, } = useCheckoutStore();
|
|
633
|
+
const [executingId, setExecutingId] = useState(null);
|
|
634
|
+
const [paymentDetailsExpanded, setPaymentDetailsExpanded] = useState(false);
|
|
635
|
+
const isWalletConnectionSettling = account.status === "connecting" || account.status === "reconnecting";
|
|
636
|
+
const connectorName = account.connector?.name || "Connected wallet";
|
|
637
|
+
const connectorIcon = typeof account.connector?.icon === "string"
|
|
638
|
+
? account.connector.icon
|
|
639
|
+
: undefined;
|
|
640
|
+
const connectedWagmiWallet = useMemo(() => {
|
|
641
|
+
if (!account.isConnected || !account.address || !account.connector) {
|
|
642
|
+
return null;
|
|
643
|
+
}
|
|
644
|
+
return new WagmiWalletInterface(account.connector, wagmiConfig);
|
|
645
|
+
}, [account.address, account.connector, account.isConnected, wagmiConfig]);
|
|
646
|
+
const activeWallet = connectedWagmiWallet ?? wallet;
|
|
647
|
+
useEffect(() => {
|
|
648
|
+
if (!connectedWagmiWallet) {
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
setWallet(connectedWagmiWallet);
|
|
652
|
+
initialiseWallets([() => connectedWagmiWallet]);
|
|
653
|
+
}, [connectedWagmiWallet, initialiseWallets, setWallet]);
|
|
654
|
+
const buildContext = useCallback(async (currentPayment) => {
|
|
655
|
+
const state = useCheckoutStore.getState();
|
|
656
|
+
const currentCheckout = state.checkout;
|
|
657
|
+
const currentCryptoCurrency = state.cryptoCurrency;
|
|
658
|
+
if (!currentCheckout || !currentCryptoCurrency || !activeWallet) {
|
|
659
|
+
throw new Error("Wallet payment context is not ready");
|
|
660
|
+
}
|
|
661
|
+
const resolvedPayment = currentPayment ?? state.payment;
|
|
662
|
+
if (!resolvedPayment) {
|
|
663
|
+
throw new Error("Missing payment");
|
|
664
|
+
}
|
|
665
|
+
const walletAddress = await activeWallet.getAddress();
|
|
666
|
+
if (!walletAddress) {
|
|
667
|
+
throw new Error("Failed to get wallet address");
|
|
668
|
+
}
|
|
669
|
+
return {
|
|
670
|
+
checkout: currentCheckout,
|
|
671
|
+
payment: resolvedPayment,
|
|
672
|
+
settlementCurrency: currentCryptoCurrency,
|
|
673
|
+
walletAddress,
|
|
674
|
+
};
|
|
675
|
+
}, [activeWallet]);
|
|
676
|
+
const loadWalletPaymentOptions = useCallback(async (isCancelled, options = {}) => {
|
|
677
|
+
const preparedContext = await buildContext();
|
|
678
|
+
const loadKey = buildWalletPaymentOptionsLoadKey({
|
|
679
|
+
paymentId: preparedContext.payment.id,
|
|
680
|
+
settlementChain: preparedContext.settlementCurrency.chain,
|
|
681
|
+
settlementAsset: preparedContext.settlementCurrency.asset,
|
|
682
|
+
walletAddress: preparedContext.walletAddress,
|
|
683
|
+
});
|
|
684
|
+
if (!loadKey) {
|
|
685
|
+
throw new Error("Wallet payment context is not ready");
|
|
686
|
+
}
|
|
687
|
+
const currentWalletPayment = useCheckoutStore.getState().walletPayment;
|
|
688
|
+
const isSameWallet = currentWalletPayment.walletAddress?.toLowerCase() ===
|
|
689
|
+
preparedContext.walletAddress.toLowerCase();
|
|
690
|
+
const canReuseLoadedOptions = !options.force &&
|
|
691
|
+
lastWalletOptionsLoadKeyRef.current === loadKey &&
|
|
692
|
+
isSameWallet &&
|
|
693
|
+
currentWalletPayment.status !== "failed";
|
|
694
|
+
if (canReuseLoadedOptions) {
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
setProcessing(true);
|
|
698
|
+
setSelectedCurrency(cryptoCurrency);
|
|
699
|
+
const shouldPreserveVisibleOptions = isSameWallet &&
|
|
700
|
+
currentWalletPayment.options.length > 0 &&
|
|
701
|
+
currentWalletPayment.status !== "failed";
|
|
702
|
+
if (shouldPreserveVisibleOptions) {
|
|
703
|
+
setWalletPaymentState({ status: "ready", error: null });
|
|
704
|
+
}
|
|
705
|
+
else {
|
|
706
|
+
resetWalletPaymentState();
|
|
707
|
+
setWalletPaymentState({ status: "loading", error: null, options: [] });
|
|
708
|
+
}
|
|
709
|
+
writeCheckoutResumeState(preparedContext.payment.id, {
|
|
710
|
+
view: "cryptoIntentWalletPaymentOptions",
|
|
711
|
+
walletAddress: preparedContext.walletAddress,
|
|
712
|
+
pendingWalletConnection: false,
|
|
713
|
+
});
|
|
714
|
+
const existingRequest = walletOptionsRequestRef.current;
|
|
715
|
+
const request = existingRequest?.key === loadKey
|
|
716
|
+
? existingRequest.promise
|
|
717
|
+
: findWalletPaymentOptions(preparedContext);
|
|
718
|
+
if (existingRequest?.key !== loadKey) {
|
|
719
|
+
walletOptionsRequestRef.current = {
|
|
720
|
+
key: loadKey,
|
|
721
|
+
promise: request,
|
|
722
|
+
};
|
|
723
|
+
void request
|
|
724
|
+
.finally(() => {
|
|
725
|
+
if (walletOptionsRequestRef.current?.key === loadKey) {
|
|
726
|
+
walletOptionsRequestRef.current = null;
|
|
727
|
+
}
|
|
728
|
+
})
|
|
729
|
+
.catch(() => undefined);
|
|
730
|
+
}
|
|
731
|
+
const providerOptions = await request;
|
|
732
|
+
if (isCancelled()) {
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
735
|
+
const resumeState = readCheckoutResumeState(preparedContext.payment.id);
|
|
736
|
+
const shouldRestoreSelectedOption = resumeState.walletAddress?.toLowerCase() ===
|
|
737
|
+
preparedContext.walletAddress.toLowerCase() &&
|
|
738
|
+
Boolean(resumeState.selectedWalletOptionId &&
|
|
739
|
+
providerOptions.some((option) => option.id === resumeState.selectedWalletOptionId));
|
|
740
|
+
setWalletPaymentState({
|
|
741
|
+
...buildWalletPaymentOptionsReadyState({
|
|
742
|
+
walletAddress: preparedContext.walletAddress,
|
|
743
|
+
options: providerOptions,
|
|
744
|
+
}),
|
|
745
|
+
selectedOptionId: shouldRestoreSelectedOption
|
|
746
|
+
? resumeState.selectedWalletOptionId || null
|
|
747
|
+
: null,
|
|
748
|
+
});
|
|
749
|
+
lastWalletOptionsLoadKeyRef.current = loadKey;
|
|
750
|
+
}, [buildContext, cryptoCurrency]);
|
|
751
|
+
const handleMissingAccount = useCallback(() => {
|
|
752
|
+
resetWalletPaymentState();
|
|
753
|
+
clearQuoteRefresh();
|
|
754
|
+
setProcessing(false);
|
|
755
|
+
goToView("cryptoIntent");
|
|
756
|
+
}, [goToView]);
|
|
757
|
+
const handleMissingWalletConnection = useCallback(() => {
|
|
758
|
+
goToView("failed", { reason: "wallet_not_connected" });
|
|
759
|
+
}, [goToView]);
|
|
760
|
+
const handleWalletPaymentOptionsError = useCallback((error) => {
|
|
761
|
+
const message = error instanceof Error ? error.message : "Failed to load payment options";
|
|
762
|
+
setWalletPaymentState({
|
|
763
|
+
status: "failed",
|
|
764
|
+
error: message,
|
|
765
|
+
options: [],
|
|
766
|
+
});
|
|
767
|
+
}, []);
|
|
768
|
+
const shouldPreserveSubmittedFailure = walletPayment.status === "failed" &&
|
|
769
|
+
walletPayment.options.length > 0 &&
|
|
770
|
+
Boolean(walletPayment.sourceTxHash);
|
|
771
|
+
useEffect(() => {
|
|
772
|
+
if (isWalletConnectionSettling) {
|
|
773
|
+
setProcessing(true);
|
|
774
|
+
return;
|
|
775
|
+
}
|
|
776
|
+
if (!account.isConnected || !account.address) {
|
|
777
|
+
if (isChangingWalletRef.current) {
|
|
778
|
+
setProcessing(false);
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
handleMissingAccount();
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
isChangingWalletRef.current = false;
|
|
785
|
+
if (!activeWallet || !cryptoCurrency) {
|
|
786
|
+
handleMissingWalletConnection();
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
if (shouldPreserveSubmittedFailure) {
|
|
790
|
+
setProcessing(false);
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
const currentWalletPayment = useCheckoutStore.getState().walletPayment;
|
|
794
|
+
if (currentWalletPayment.selectedOptionId ||
|
|
795
|
+
currentWalletPayment.status === "executing" ||
|
|
796
|
+
currentWalletPayment.status === "submitted") {
|
|
797
|
+
if (currentWalletPayment.status !== "executing") {
|
|
798
|
+
setProcessing(false);
|
|
799
|
+
}
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
let cancelled = false;
|
|
803
|
+
const loadOptions = async () => {
|
|
804
|
+
try {
|
|
805
|
+
await loadWalletPaymentOptions(() => cancelled);
|
|
806
|
+
}
|
|
807
|
+
catch (error) {
|
|
808
|
+
if (cancelled)
|
|
809
|
+
return;
|
|
810
|
+
handleWalletPaymentOptionsError(error);
|
|
811
|
+
}
|
|
812
|
+
finally {
|
|
813
|
+
if (!cancelled) {
|
|
814
|
+
setProcessing(false);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
};
|
|
818
|
+
void loadOptions();
|
|
819
|
+
return () => {
|
|
820
|
+
cancelled = true;
|
|
821
|
+
clearQuoteRefresh();
|
|
822
|
+
};
|
|
823
|
+
}, [
|
|
824
|
+
account.address,
|
|
825
|
+
account.isConnected,
|
|
826
|
+
activeWallet,
|
|
827
|
+
cryptoCurrency,
|
|
828
|
+
handleMissingAccount,
|
|
829
|
+
handleMissingWalletConnection,
|
|
830
|
+
handleWalletPaymentOptionsError,
|
|
831
|
+
isWalletConnectionSettling,
|
|
832
|
+
loadWalletPaymentOptions,
|
|
833
|
+
shouldPreserveSubmittedFailure,
|
|
834
|
+
walletPayment.selectedOptionId,
|
|
835
|
+
]);
|
|
836
|
+
const selectedOption = walletPayment.options.find((option) => option.id === walletPayment.selectedOptionId) ?? null;
|
|
837
|
+
const hasNoPaymentOptions = walletPayment.status === "ready" && walletPayment.options.length === 0;
|
|
838
|
+
const unsupportedWalletAddress = walletPayment.walletAddress ?? account.address ?? null;
|
|
839
|
+
const quoteLoadKey = buildWalletQuoteLoadKey({
|
|
840
|
+
paymentId: payment?.id,
|
|
841
|
+
paymentAmount: payment?.amount,
|
|
842
|
+
paymentCurrency: payment?.currency,
|
|
843
|
+
paymentExpiresAt: payment?.expires_at,
|
|
844
|
+
settlementChain: cryptoCurrency?.chain,
|
|
845
|
+
settlementAsset: cryptoCurrency?.asset,
|
|
846
|
+
walletAddress: walletPayment.walletAddress ?? account.address,
|
|
847
|
+
option: selectedOption,
|
|
848
|
+
});
|
|
849
|
+
const confirmationAmount = selectedOption && payment
|
|
850
|
+
? resolveWalletPaymentConfirmationAmount({
|
|
851
|
+
option: selectedOption,
|
|
852
|
+
quote: walletPayment.quote,
|
|
853
|
+
attempt: cryptoPaymentAttempt,
|
|
854
|
+
})
|
|
855
|
+
: null;
|
|
856
|
+
const displayedPayAmount = confirmationAmount?.amount ??
|
|
857
|
+
(selectedOption && walletPayment.quoteStatus === "loading"
|
|
858
|
+
? "Fetching quote..."
|
|
859
|
+
: selectedOption && walletPayment.quoteStatus === "failed"
|
|
860
|
+
? "Unavailable"
|
|
861
|
+
: null);
|
|
862
|
+
const formattedCost = formatMoneyAmount(payment?.currency ?? "USD", Number(payment?.amount ?? 0));
|
|
863
|
+
const handlePickOption = (option) => {
|
|
864
|
+
lastQuoteLoadKeyRef.current = null;
|
|
865
|
+
prepareWalletQuoteReplacement(walletPayment.walletAddress);
|
|
866
|
+
setPaymentDetailsExpanded(false);
|
|
867
|
+
writeCheckoutResumeState(payment?.id, {
|
|
868
|
+
view: "cryptoIntentWalletPaymentOptions",
|
|
869
|
+
walletAddress: walletPayment.walletAddress ?? account.address ?? null,
|
|
870
|
+
selectedWalletOptionId: option.id,
|
|
871
|
+
});
|
|
872
|
+
setWalletPaymentState({
|
|
873
|
+
selectedOptionId: option.id,
|
|
874
|
+
error: null,
|
|
875
|
+
quoteId: null,
|
|
876
|
+
routeId: null,
|
|
877
|
+
quoteStatus: "idle",
|
|
878
|
+
quote: null,
|
|
879
|
+
quoteError: null,
|
|
880
|
+
});
|
|
881
|
+
};
|
|
882
|
+
const handleReturnToOptions = () => {
|
|
883
|
+
lastQuoteLoadKeyRef.current = null;
|
|
884
|
+
prepareWalletQuoteReplacement(walletPayment.walletAddress);
|
|
885
|
+
setPaymentDetailsExpanded(false);
|
|
886
|
+
writeCheckoutResumeState(payment?.id, {
|
|
887
|
+
view: "cryptoIntentWalletPaymentOptions",
|
|
888
|
+
walletAddress: walletPayment.walletAddress ?? account.address ?? null,
|
|
889
|
+
selectedWalletOptionId: null,
|
|
890
|
+
});
|
|
891
|
+
setWalletPaymentState({
|
|
892
|
+
selectedOptionId: null,
|
|
893
|
+
error: null,
|
|
894
|
+
quoteStatus: "idle",
|
|
895
|
+
quote: null,
|
|
896
|
+
quoteError: null,
|
|
897
|
+
});
|
|
898
|
+
};
|
|
899
|
+
const handleChangeWallet = useCallback(() => {
|
|
900
|
+
isChangingWalletRef.current = true;
|
|
901
|
+
writePendingWalletConnectionResumeState(payment?.id, "cryptoIntentWalletPaymentOptions");
|
|
902
|
+
void open({ view: "Connect", namespace: "eip155" });
|
|
903
|
+
}, [open, payment?.id]);
|
|
904
|
+
const handleDisconnectWallet = useCallback(() => {
|
|
905
|
+
isChangingWalletRef.current = false;
|
|
906
|
+
clearCheckoutResumeState(payment?.id);
|
|
907
|
+
resetWalletPaymentState();
|
|
908
|
+
clearQuoteRefresh();
|
|
909
|
+
setWallet(null);
|
|
910
|
+
setProcessing(false);
|
|
911
|
+
goToView("cryptoIntent");
|
|
912
|
+
void disconnect(wagmiConfig).catch((error) => {
|
|
913
|
+
console.warn("Unable to disconnect wallet", error);
|
|
914
|
+
});
|
|
915
|
+
}, [goToView, payment?.id, setWallet, wagmiConfig]);
|
|
916
|
+
const confirmDirectWalletPayment = async (txHash) => {
|
|
917
|
+
if (!payment) {
|
|
918
|
+
throw new Error("Missing payment");
|
|
919
|
+
}
|
|
920
|
+
try {
|
|
921
|
+
await confirmPayment(payment.id, { txHash });
|
|
922
|
+
}
|
|
923
|
+
catch (error) {
|
|
924
|
+
const message = messageForWalletError(error, "Failed to confirm wallet payment");
|
|
925
|
+
setWalletPaymentState({
|
|
926
|
+
status: "failed",
|
|
927
|
+
error: message,
|
|
928
|
+
});
|
|
929
|
+
goToView("cryptoIntentWalletPaymentOptions");
|
|
930
|
+
}
|
|
931
|
+
};
|
|
932
|
+
useEffect(() => {
|
|
933
|
+
if (!selectedOption || !quoteLoadKey || !cryptoCurrency) {
|
|
934
|
+
if (!selectedOption) {
|
|
935
|
+
lastQuoteLoadKeyRef.current = null;
|
|
936
|
+
}
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
if (lastQuoteLoadKeyRef.current === quoteLoadKey) {
|
|
940
|
+
return;
|
|
941
|
+
}
|
|
942
|
+
lastQuoteLoadKeyRef.current = quoteLoadKey;
|
|
943
|
+
let cancelled = false;
|
|
944
|
+
const loadQuote = async () => {
|
|
945
|
+
const currentPayment = useCheckoutStore.getState().payment;
|
|
946
|
+
if (!currentPayment?.id) {
|
|
947
|
+
return;
|
|
948
|
+
}
|
|
949
|
+
try {
|
|
950
|
+
prepareWalletQuoteReplacement(walletPayment.walletAddress ?? account.address ?? null);
|
|
951
|
+
setWalletPaymentState({
|
|
952
|
+
quoteStatus: "loading",
|
|
953
|
+
quote: null,
|
|
954
|
+
quoteError: null,
|
|
955
|
+
quoteId: null,
|
|
956
|
+
routeId: null,
|
|
957
|
+
});
|
|
958
|
+
const preparedContext = await buildContext(currentPayment);
|
|
959
|
+
const walletAddress = await activeWallet?.getAddress();
|
|
960
|
+
if (!walletAddress) {
|
|
961
|
+
throw new Error("Failed to get wallet address");
|
|
962
|
+
}
|
|
963
|
+
const ensuredAttempt = await createWalletOptionPaymentAttempt(selectedOption, walletAddress, null);
|
|
964
|
+
if (cancelled) {
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
|
+
const quoteContext = {
|
|
968
|
+
...preparedContext,
|
|
969
|
+
cryptoPaymentAttempt: ensuredAttempt,
|
|
970
|
+
};
|
|
971
|
+
if (selectedOption.kind === "direct") {
|
|
972
|
+
const directQuote = buildDirectQuote(selectedOption, quoteContext);
|
|
973
|
+
setWalletPaymentState({
|
|
974
|
+
quoteStatus: "ready",
|
|
975
|
+
quote: directQuote,
|
|
976
|
+
quoteId: directQuote.quoteId,
|
|
977
|
+
routeId: directQuote.routeId,
|
|
978
|
+
quoteError: null,
|
|
979
|
+
});
|
|
980
|
+
configureWalletQuoteRefresh(walletAddress);
|
|
981
|
+
return;
|
|
982
|
+
}
|
|
983
|
+
const quote = await fetchWalletPaymentQuote({
|
|
984
|
+
option: selectedOption,
|
|
985
|
+
context: quoteContext,
|
|
986
|
+
});
|
|
987
|
+
if (cancelled) {
|
|
988
|
+
return;
|
|
989
|
+
}
|
|
990
|
+
setWalletPaymentState({
|
|
991
|
+
quoteStatus: "ready",
|
|
992
|
+
quote,
|
|
993
|
+
quoteId: quote.quoteId,
|
|
994
|
+
routeId: quote.routeId,
|
|
995
|
+
quoteError: null,
|
|
996
|
+
});
|
|
997
|
+
configureWalletQuoteRefresh(walletAddress);
|
|
998
|
+
}
|
|
999
|
+
catch (error) {
|
|
1000
|
+
if (cancelled) {
|
|
1001
|
+
return;
|
|
1002
|
+
}
|
|
1003
|
+
const message = error instanceof Error ? error.message : "Failed to load route quote";
|
|
1004
|
+
setWalletPaymentState({
|
|
1005
|
+
quoteStatus: "failed",
|
|
1006
|
+
quote: null,
|
|
1007
|
+
quoteError: message,
|
|
1008
|
+
});
|
|
1009
|
+
clearQuoteRefresh({ preserveWalletAddress: true });
|
|
1010
|
+
}
|
|
1011
|
+
};
|
|
1012
|
+
void loadQuote();
|
|
1013
|
+
return () => {
|
|
1014
|
+
cancelled = true;
|
|
1015
|
+
};
|
|
1016
|
+
}, [
|
|
1017
|
+
account.address,
|
|
1018
|
+
activeWallet,
|
|
1019
|
+
buildContext,
|
|
1020
|
+
cryptoCurrency,
|
|
1021
|
+
goToView,
|
|
1022
|
+
quoteLoadKey,
|
|
1023
|
+
selectedOption,
|
|
1024
|
+
walletPayment.walletAddress,
|
|
1025
|
+
]);
|
|
1026
|
+
const handleSelectOption = async (option) => {
|
|
1027
|
+
if (!activeWallet || !payment || !cryptoCurrency) {
|
|
1028
|
+
goToView("failed", { reason: "wallet_not_connected" });
|
|
1029
|
+
return;
|
|
1030
|
+
}
|
|
1031
|
+
try {
|
|
1032
|
+
setExecutingId(option.id);
|
|
1033
|
+
setProcessing(true);
|
|
1034
|
+
setSelectedCurrency(cryptoCurrency);
|
|
1035
|
+
setWalletPaymentState({
|
|
1036
|
+
status: "executing",
|
|
1037
|
+
selectedOptionId: option.id,
|
|
1038
|
+
error: null,
|
|
1039
|
+
quoteId: null,
|
|
1040
|
+
routeId: null,
|
|
1041
|
+
});
|
|
1042
|
+
const walletAddress = await activeWallet.getAddress();
|
|
1043
|
+
if (!walletAddress) {
|
|
1044
|
+
throw new Error("Failed to get wallet address");
|
|
1045
|
+
}
|
|
1046
|
+
writeCheckoutResumeState(payment.id, {
|
|
1047
|
+
view: "cryptoIntentWalletPaymentOptions",
|
|
1048
|
+
walletAddress,
|
|
1049
|
+
selectedWalletOptionId: option.id,
|
|
1050
|
+
});
|
|
1051
|
+
const ensuredAttempt = await createWalletOptionPaymentAttempt(option, walletAddress, option.kind === "direct" ? null : walletPayment.quote);
|
|
1052
|
+
const preparedContext = {
|
|
1053
|
+
...(await buildContext(payment)),
|
|
1054
|
+
cryptoPaymentAttempt: ensuredAttempt,
|
|
1055
|
+
};
|
|
1056
|
+
if (option.kind === "direct") {
|
|
1057
|
+
const txHash = await executeTransfer(activeWallet);
|
|
1058
|
+
if (!txHash) {
|
|
1059
|
+
throw new Error("Failed to get transaction hash");
|
|
1060
|
+
}
|
|
1061
|
+
setWalletPaymentState({
|
|
1062
|
+
status: "submitted",
|
|
1063
|
+
sourceTxHash: txHash,
|
|
1064
|
+
destinationTxHash: null,
|
|
1065
|
+
quoteId: null,
|
|
1066
|
+
routeId: null,
|
|
1067
|
+
});
|
|
1068
|
+
goToView("paymentStatus");
|
|
1069
|
+
void (async () => {
|
|
1070
|
+
try {
|
|
1071
|
+
await checkChainStatus(activeWallet);
|
|
1072
|
+
await confirmDirectWalletPayment(txHash);
|
|
1073
|
+
}
|
|
1074
|
+
catch (error) {
|
|
1075
|
+
const message = messageForWalletError(error, "Failed to confirm wallet payment");
|
|
1076
|
+
setWalletPaymentState({
|
|
1077
|
+
status: "failed",
|
|
1078
|
+
error: message,
|
|
1079
|
+
});
|
|
1080
|
+
goToView("cryptoIntentWalletPaymentOptions");
|
|
1081
|
+
}
|
|
1082
|
+
})();
|
|
1083
|
+
return;
|
|
1084
|
+
}
|
|
1085
|
+
else {
|
|
1086
|
+
const freshQuote = await fetchWalletPaymentQuote({
|
|
1087
|
+
option,
|
|
1088
|
+
context: preparedContext,
|
|
1089
|
+
});
|
|
1090
|
+
if (!freshQuote.quoteId) {
|
|
1091
|
+
throw new Error("Missing LI.FI quote id for routed wallet payment");
|
|
1092
|
+
}
|
|
1093
|
+
setWalletPaymentState({
|
|
1094
|
+
quoteStatus: "ready",
|
|
1095
|
+
quote: freshQuote,
|
|
1096
|
+
quoteId: freshQuote.quoteId,
|
|
1097
|
+
routeId: freshQuote.routeId,
|
|
1098
|
+
quoteError: null,
|
|
1099
|
+
});
|
|
1100
|
+
const result = await executeWalletPaymentOption({
|
|
1101
|
+
option,
|
|
1102
|
+
wallet: activeWallet,
|
|
1103
|
+
context: preparedContext,
|
|
1104
|
+
quote: freshQuote,
|
|
1105
|
+
});
|
|
1106
|
+
const confirmationTxHash = result?.destinationTxHash ?? null;
|
|
1107
|
+
if (!confirmationTxHash) {
|
|
1108
|
+
throw new Error("Missing destination transaction hash for routed wallet payment");
|
|
1109
|
+
}
|
|
1110
|
+
await confirmPayment(payment.id, {
|
|
1111
|
+
txHash: confirmationTxHash,
|
|
1112
|
+
lifiQuote: {
|
|
1113
|
+
quote_id: freshQuote.quoteId,
|
|
1114
|
+
route_id: freshQuote.routeId ?? null,
|
|
1115
|
+
route: freshQuote.raw,
|
|
1116
|
+
},
|
|
1117
|
+
});
|
|
1118
|
+
setWalletPaymentState({
|
|
1119
|
+
status: "submitted",
|
|
1120
|
+
sourceTxHash: result?.sourceTxHash ?? null,
|
|
1121
|
+
destinationTxHash: confirmationTxHash,
|
|
1122
|
+
quoteId: freshQuote.quoteId,
|
|
1123
|
+
routeId: freshQuote.routeId,
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1126
|
+
goToView("paymentStatus");
|
|
1127
|
+
}
|
|
1128
|
+
catch (error) {
|
|
1129
|
+
const message = messageForWalletError(error, "Failed to execute wallet payment");
|
|
1130
|
+
setWalletPaymentState({
|
|
1131
|
+
status: "failed",
|
|
1132
|
+
error: message,
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
finally {
|
|
1136
|
+
setExecutingId(null);
|
|
1137
|
+
setProcessing(false);
|
|
1138
|
+
}
|
|
1139
|
+
};
|
|
1140
|
+
const handleRetryWalletPayment = () => {
|
|
1141
|
+
if (selectedOption) {
|
|
1142
|
+
if (walletPayment.sourceTxHash &&
|
|
1143
|
+
useCheckoutStore.getState().transfer.chainStatus === "confirmed") {
|
|
1144
|
+
setWalletPaymentState({ status: "submitted", error: null });
|
|
1145
|
+
goToView("paymentStatus");
|
|
1146
|
+
void confirmDirectWalletPayment(walletPayment.sourceTxHash);
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
setWalletPaymentState({ status: "ready", error: null });
|
|
1150
|
+
void handleSelectOption(selectedOption);
|
|
1151
|
+
return;
|
|
1152
|
+
}
|
|
1153
|
+
const retry = async () => {
|
|
1154
|
+
try {
|
|
1155
|
+
await loadWalletPaymentOptions(() => false, { force: true });
|
|
1156
|
+
}
|
|
1157
|
+
catch (error) {
|
|
1158
|
+
handleWalletPaymentOptionsError(error);
|
|
1159
|
+
}
|
|
1160
|
+
finally {
|
|
1161
|
+
setProcessing(false);
|
|
1162
|
+
}
|
|
1163
|
+
};
|
|
1164
|
+
void retry();
|
|
1165
|
+
};
|
|
1166
|
+
const showWalletPill = account.isConnected &&
|
|
1167
|
+
Boolean(account.address) &&
|
|
1168
|
+
walletPayment.status !== "loading" &&
|
|
1169
|
+
walletPayment.status !== "failed";
|
|
1170
|
+
const walletAddressForPill = walletPayment.walletAddress ?? account.address ?? null;
|
|
1171
|
+
const walletAddressForHeader = walletPayment.walletAddress ?? account.address ?? null;
|
|
1172
|
+
return (_jsxs(ModalViewContainer, { ref: modalRef, children: [showWalletPill && walletAddressForPill && selectedOption ? (_jsxs(ContextStrip, { children: [_jsx(QuoteExpiryCountdown, { remainingMs: quote.remainingMs, totalDurationMs: quote.totalDurationMs, primaryColor: config.theme.btn.primary.default.backgroundColor, urgentThresholdRatio: QUOTE_COUNTDOWN_URGENT_THRESHOLD_RATIO }), _jsxs(ContextPill, { children: [_jsxs(ContextPillToggle, { type: "button", onClick: () => setPaymentDetailsExpanded((expanded) => !expanded), "aria-expanded": paymentDetailsExpanded, children: [_jsxs(PillIconWrap, { children: [_jsx(PillTokenIcon, { "$iconUrl": selectedOption.fromTokenIconUrl, children: !selectedOption.fromTokenIconUrl
|
|
1173
|
+
? getTokenMonogram(selectedOption.fromTokenName, selectedOption.fromTokenSymbol)
|
|
1174
|
+
: null }), selectedOption.fromChainIconUrl ? (_jsx(PillChainBadge, { "$iconUrl": selectedOption.fromChainIconUrl })) : null] }), _jsxs(PillBody, { children: [_jsx(PillEyebrow, { children: "You send" }), _jsxs(PillTitle, { children: [selectedOption.fromTokenSymbol, " on", " ", selectedOption.fromChainName] })] }), _jsx(PillAction, { type: "button", onClick: (event) => {
|
|
1175
|
+
event.stopPropagation();
|
|
1176
|
+
handleReturnToOptions();
|
|
1177
|
+
}, disabled: processing, children: "Change" }), _jsx(PillCaret, { "$expanded": paymentDetailsExpanded, children: "\u25BE" })] }), paymentDetailsExpanded ? (_jsxs(PillDetails, { children: [_jsxs(PillDetailRow, { children: [_jsx(PillDetailLabel, { children: "Connected wallet" }), _jsxs(PillDetailValue, { children: [_jsx(WalletDot, { "$iconUrl": connectorIcon, "aria-hidden": "true" }), formatAddress(walletAddressForPill), _jsx(WalletSwitchLink, { type: "button", onClick: handleChangeWallet, disabled: processing, "aria-label": "Switch wallet", title: "Switch wallet", children: _jsx(EditIcon, { size: 12 }) }), _jsx(WalletDisconnectButton, { type: "button", onClick: handleDisconnectWallet, disabled: processing, "aria-label": "Disconnect wallet", title: "Disconnect wallet", children: _jsx(LogOutIcon, { size: 12 }) })] })] }), _jsxs(PillDetailRow, { children: [_jsx(PillDetailLabel, { children: "Route" }), _jsx(PillDetailValue, { children: selectedOption.kind === "direct"
|
|
1178
|
+
? "Direct transfer"
|
|
1179
|
+
: "Routed transfer" })] })] })) : null] })] })) : null, walletPayment.status === "failed" ? (_jsxs(ContentStage, { "$mobileCentered": true, children: [account.isConnected && account.address ? (_jsx(FallbackTopActions, { children: _jsx(FallbackDisconnectButton, { type: "button", onClick: handleDisconnectWallet, disabled: processing, "aria-label": "Disconnect wallet", title: "Disconnect wallet", children: _jsx(LogOutIcon, { size: 16 }) }) })) : null, _jsx(EmptyState, { children: _jsx(Text, { size: "sm", color: config.theme.font.color.secondary, children: walletPayment.error ||
|
|
1180
|
+
"We could not find wallet payment options right now." }) }), _jsx(StyledButton, { onClick: handleRetryWalletPayment, disabled: processing || loading.CREATE_PAYMENT_ATTEMPT, children: "Try again" }), _jsx(ModalBackButton, { view: "cryptoIntent", disabled: processing, label: "Choose another payment method" })] })) : null, walletPayment.status === "loading" ? (_jsxs(ContentStage, { children: [walletAddressForHeader ? (_jsxs(ConnectedWalletRow, { children: [_jsxs(ConnectedWalletIdentity, { children: [_jsx(WalletDot, { "$iconUrl": connectorIcon, "aria-hidden": "true" }), _jsx(ConnectedWalletAddress, { children: formatAddress(walletAddressForHeader) })] }), _jsxs(WalletRowActions, { children: [_jsx(WalletSwitchLink, { type: "button", onClick: handleChangeWallet, disabled: processing, "aria-label": "Switch wallet", title: "Switch wallet", children: _jsx(EditIcon, { size: 12 }) }), _jsx(WalletDisconnectButton, { type: "button", onClick: handleDisconnectWallet, disabled: processing, "aria-label": "Disconnect wallet", title: "Disconnect wallet", children: _jsx(LogOutIcon, { size: 12 }) })] })] })) : null, _jsx(SectionLabel, { children: "Checking your wallet" }), _jsxs(SkeletonContainer, { children: [_jsx(SkeletonRow, {}), _jsx(SkeletonRow, { style: { opacity: 0.7 } }), _jsx(SkeletonRow, { style: { opacity: 0.4 } })] })] })) : null, walletPayment.status === "ready" ||
|
|
1181
|
+
walletPayment.status === "executing" ? (_jsx(ContentStage, { children: hasNoPaymentOptions ? (_jsxs(_Fragment, { children: [walletAddressForPill ? (_jsxs(ConnectedWalletRow, { children: [_jsxs(ConnectedWalletIdentity, { children: [_jsx(WalletDot, { "$iconUrl": connectorIcon, "aria-hidden": "true" }), _jsx(ConnectedWalletAddress, { children: formatAddress(walletAddressForPill) })] }), _jsxs(WalletRowActions, { children: [_jsx(WalletSwitchLink, { type: "button", onClick: handleChangeWallet, disabled: processing, "aria-label": "Switch wallet", title: "Switch wallet", children: _jsx(EditIcon, { size: 12 }) }), _jsx(WalletDisconnectButton, { type: "button", onClick: handleDisconnectWallet, disabled: processing, "aria-label": "Disconnect wallet", title: "Disconnect wallet", children: _jsx(LogOutIcon, { size: 12 }) })] })] })) : null, !walletAddressForPill &&
|
|
1182
|
+
account.isConnected &&
|
|
1183
|
+
account.address ? (_jsx(FallbackTopActions, { children: _jsx(FallbackDisconnectButton, { type: "button", onClick: handleDisconnectWallet, disabled: processing, "aria-label": "Disconnect wallet", title: "Disconnect wallet", children: _jsx(LogOutIcon, { size: 16 }) }) })) : null, _jsxs(EmptyState, { children: [_jsxs(EmptyHeadline, { children: [_jsx(Text, { size: "base", weight: "semibold", color: config.theme.font.color.primary, children: NO_WALLET_PAYMENT_OPTIONS_TITLE }), _jsx(Text, { size: "sm", color: config.theme.font.color.secondary, children: NO_WALLET_PAYMENT_OPTIONS_DESCRIPTION })] }), unsupportedWalletAddress && !walletAddressForPill ? (_jsxs(Text, { size: "xs", color: config.theme.font.color.tertiary, children: [connectorName, " ", formatAddress(unsupportedWalletAddress)] })) : null] }), _jsx(ModalBackButton, { view: "cryptoIntent", disabled: processing, label: "Choose another payment method" })] })) : !selectedOption ? (_jsxs(_Fragment, { children: [walletAddressForPill ? (_jsxs(ConnectedWalletRow, { children: [_jsxs(ConnectedWalletIdentity, { children: [_jsx(WalletDot, { "$iconUrl": connectorIcon, "aria-hidden": "true" }), _jsx(ConnectedWalletAddress, { children: formatAddress(walletAddressForPill) })] }), _jsxs(WalletRowActions, { children: [_jsx(WalletSwitchLink, { type: "button", onClick: handleChangeWallet, disabled: processing, "aria-label": "Switch wallet", title: "Switch wallet", children: _jsx(EditIcon, { size: 12 }) }), _jsx(WalletDisconnectButton, { type: "button", onClick: handleDisconnectWallet, disabled: processing, "aria-label": "Disconnect wallet", title: "Disconnect wallet", children: _jsx(LogOutIcon, { size: 12 }) })] })] })) : null, _jsxs(SectionRow, { children: [_jsx(SectionLabel, { children: "Pay with" }), _jsx(SectionLabel, { children: "Balance" })] }), _jsx(OptionsContainer, { children: walletPayment.options.map((option) => (_jsxs(OptionCard, { type: "button", onClick: () => handlePickOption(option), "aria-pressed": walletPayment.selectedOptionId === option.id, children: [_jsxs(OptionTokenIconWrap, { children: [_jsx(OptionTokenIcon, { "$token": option.fromTokenName === "ETH" ? "ETH" : "USD", "$iconUrl": option.fromTokenIconUrl, children: !option.fromTokenIconUrl
|
|
1184
|
+
? getTokenMonogram(option.fromTokenName, option.fromTokenSymbol)
|
|
1185
|
+
: null }), option.fromChainIconUrl ? (_jsx(OptionChainBadge, { "$iconUrl": option.fromChainIconUrl })) : null] }), _jsxs(OptionIdentity, { children: [_jsx(Text, { size: "base", weight: "semibold", color: config.theme.font.color.primary, children: option.fromTokenName }), _jsxs(Text, { size: "sm", color: config.theme.font.color.secondary, children: ["On ", option.fromChainName] })] }), _jsxs(OptionBalance, { children: [_jsx(Text, { size: "base", weight: "semibold", color: config.theme.font.color.primary, children: formatTokenBalance(option.fromTokenName, option.fromAmount) ?? "0" }), option.kind === "direct" ? (_jsxs(FastBadge, { children: [_jsx("span", { children: "\u26A1" }), _jsx("span", { children: "Fast" })] })) : typeof option.estimatedDurationMinutes ===
|
|
1186
|
+
"number" ? (_jsxs(RoutedBadge, { children: ["~", option.estimatedDurationMinutes, " min"] })) : null] })] }, option.id))) }), _jsx(ModalBackButton, { view: "cryptoIntent", disabled: processing })] })) : (_jsxs(_Fragment, { children: [_jsxs(QuoteCard, { children: [_jsxs(QuoteRow, { children: [_jsx(Text, { size: "sm", color: config.theme.font.color.secondary, children: "Cost" }), _jsx(Text, { size: "base", weight: "semibold", color: config.theme.font.color.primary, children: formattedCost })] }), displayedPayAmount ? (_jsxs(QuoteRow, { children: [_jsx(Text, { size: "sm", color: config.theme.font.color.secondary, children: "You pay" }), _jsx(Text, { size: "base", weight: "semibold", color: config.theme.font.color.primary, children: displayedPayAmount })] })) : null, typeof walletPayment.quote?.estimatedDurationMinutes ===
|
|
1187
|
+
"number" ? (_jsxs(QuoteRow, { children: [_jsx(Text, { size: "sm", color: config.theme.font.color.secondary, children: "Estimated time" }), _jsxs(Text, { size: "sm", weight: "semibold", color: config.theme.font.color.primary, children: ["~", walletPayment.quote.estimatedDurationMinutes, " min"] })] })) : null, walletPayment.quoteStatus === "loading" ? (_jsxs(_Fragment, { children: [_jsx(QuoteHairline, {}), _jsx(QuoteFootnote, { children: "Fetching the freshest quote\u2026" })] })) : null, walletPayment.quoteStatus === "failed" ? (_jsxs(_Fragment, { children: [_jsx(QuoteHairline, {}), _jsx(QuoteFootnoteWarn, { children: walletPayment.quoteError ||
|
|
1188
|
+
"We couldn't fetch a quote right now." })] })) : null] }), _jsx(StyledButton, { onClick: () => {
|
|
1189
|
+
if (selectedOption) {
|
|
1190
|
+
void handleSelectOption(selectedOption);
|
|
1191
|
+
}
|
|
1192
|
+
}, disabled: processing ||
|
|
1193
|
+
loading.CREATE_PAYMENT_ATTEMPT ||
|
|
1194
|
+
!selectedOption ||
|
|
1195
|
+
walletPayment.quoteStatus === "loading" ||
|
|
1196
|
+
(selectedOption.kind !== "direct" &&
|
|
1197
|
+
walletPayment.quoteStatus !== "ready"), children: executingId === selectedOption.id
|
|
1198
|
+
? "Preparing..."
|
|
1199
|
+
: walletPayment.quoteStatus === "loading"
|
|
1200
|
+
? "Fetching quote..."
|
|
1201
|
+
: `Pay with ${selectedOption.fromTokenName}` }), _jsx(StyledButton, { variant: "secondary", onClick: handleReturnToOptions, disabled: processing, children: "Back" })] })) })) : null] }));
|
|
1202
|
+
};
|
|
1203
|
+
const CryptoIntentWalletPaymentOptionsViewContent = () => {
|
|
1204
|
+
return _jsx(CryptoIntentWalletPaymentOptionsAppKitViewContent, {});
|
|
1205
|
+
};
|
|
1206
|
+
export { CryptoIntentWalletPaymentOptionsViewContent };
|
|
1207
|
+
//# sourceMappingURL=wallet-payment-options.js.map
|