@mintmoney/react 0.2.0-alpha.1 → 0.2.0-alpha.3
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/css/styles.css +12 -1
- package/dist/docs/customisation.md +8 -0
- package/dist/esm/api/errors.js +89 -0
- package/dist/esm/api/errors.js.map +1 -0
- package/dist/esm/api/generated.js +825 -65
- package/dist/esm/api/generated.js.map +1 -1
- package/dist/esm/api/payments.js +26 -2
- package/dist/esm/api/payments.js.map +1 -1
- package/dist/esm/api/tokens.js +34 -0
- package/dist/esm/api/tokens.js.map +1 -0
- package/dist/esm/api/types.js.map +1 -1
- package/dist/esm/checkout/claimable-funds.js +20 -10
- package/dist/esm/checkout/claimable-funds.js.map +1 -1
- package/dist/esm/checkout/creation-error-modal.js +2 -2
- package/dist/esm/checkout/creation-error-modal.js.map +1 -1
- package/dist/esm/checkout/index.js +48 -8
- package/dist/esm/checkout/index.js.map +1 -1
- package/dist/esm/checkout/modal.js +78 -78
- package/dist/esm/checkout/modal.js.map +1 -1
- package/dist/esm/checkout/payment-status.js +68 -28
- package/dist/esm/checkout/payment-status.js.map +1 -1
- package/dist/esm/checkout/provider-status.js +9 -0
- package/dist/esm/checkout/provider-status.js.map +1 -0
- package/dist/esm/checkout/providers/checkout-wallet.js +315 -0
- package/dist/esm/checkout/providers/checkout-wallet.js.map +1 -0
- package/dist/esm/checkout/providers/wagmi-config.js +55 -49
- package/dist/esm/checkout/providers/wagmi-config.js.map +1 -1
- package/dist/esm/checkout/refund-notice.js +16 -0
- package/dist/esm/checkout/refund-notice.js.map +1 -0
- package/dist/esm/checkout/resume-state.js +151 -13
- package/dist/esm/checkout/resume-state.js.map +1 -1
- package/dist/esm/checkout/surplus-refund.js +12 -0
- package/dist/esm/checkout/surplus-refund.js.map +1 -1
- package/dist/esm/checkout/views/amount-header.js +1 -1
- package/dist/esm/checkout/views/amount-header.js.map +1 -1
- package/dist/esm/checkout/views/claimable-funds.js +22 -13
- package/dist/esm/checkout/views/claimable-funds.js.map +1 -1
- package/dist/esm/checkout/views/crypto-intent/direct-details.js +226 -887
- package/dist/esm/checkout/views/crypto-intent/direct-details.js.map +1 -1
- package/dist/esm/checkout/views/crypto-intent/manual-instruction-card.js +235 -0
- package/dist/esm/checkout/views/crypto-intent/manual-instruction-card.js.map +1 -0
- package/dist/esm/checkout/views/crypto-intent/manual-payment-summary.js +2 -26
- package/dist/esm/checkout/views/crypto-intent/manual-payment-summary.js.map +1 -1
- package/dist/esm/checkout/views/crypto-intent/manual-refresh.js +19 -0
- package/dist/esm/checkout/views/crypto-intent/manual-refresh.js.map +1 -0
- package/dist/esm/checkout/views/crypto-intent/manual-refund-preference.js +151 -23
- package/dist/esm/checkout/views/crypto-intent/manual-refund-preference.js.map +1 -1
- package/dist/esm/checkout/views/crypto-intent/manual-route-picker.js +295 -0
- package/dist/esm/checkout/views/crypto-intent/manual-route-picker.js.map +1 -0
- package/dist/esm/checkout/views/crypto-intent/manual-sources.js +155 -0
- package/dist/esm/checkout/views/crypto-intent/manual-sources.js.map +1 -0
- package/dist/esm/checkout/views/crypto-intent/manual-transfer-instructions.js +84 -0
- package/dist/esm/checkout/views/crypto-intent/manual-transfer-instructions.js.map +1 -0
- package/dist/esm/checkout/views/crypto-intent/methods.js +22 -123
- package/dist/esm/checkout/views/crypto-intent/methods.js.map +1 -1
- package/dist/esm/checkout/views/crypto-intent/payment-route-error.js +10 -0
- package/dist/esm/checkout/views/crypto-intent/payment-route-error.js.map +1 -0
- package/dist/esm/checkout/views/crypto-intent/processing.js +167 -25
- package/dist/esm/checkout/views/crypto-intent/processing.js.map +1 -1
- package/dist/esm/checkout/views/crypto-intent/success.js +74 -46
- package/dist/esm/checkout/views/crypto-intent/success.js.map +1 -1
- package/dist/esm/checkout/views/crypto-intent/test-payment.js +11 -1
- package/dist/esm/checkout/views/crypto-intent/test-payment.js.map +1 -1
- package/dist/esm/checkout/views/crypto-intent/wallet-payment-confirmation-amount.js +14 -24
- package/dist/esm/checkout/views/crypto-intent/wallet-payment-confirmation-amount.js.map +1 -1
- package/dist/esm/checkout/views/crypto-intent/wallet-payment-discovery.js +61 -0
- package/dist/esm/checkout/views/crypto-intent/wallet-payment-discovery.js.map +1 -0
- package/dist/esm/checkout/views/crypto-intent/wallet-payment-options.js +136 -1169
- package/dist/esm/checkout/views/crypto-intent/wallet-payment-options.js.map +1 -1
- package/dist/esm/checkout/views/crypto-intent/wallet-payment-options.styles.js +506 -0
- package/dist/esm/checkout/views/crypto-intent/wallet-payment-options.styles.js.map +1 -0
- package/dist/esm/checkout/views/crypto-intent/wallet-select.js +7 -164
- package/dist/esm/checkout/views/crypto-intent/wallet-select.js.map +1 -1
- package/dist/esm/checkout/views/failed.js +62 -26
- package/dist/esm/checkout/views/failed.js.map +1 -1
- package/dist/esm/checkout/views/funding-timeline.js +255 -0
- package/dist/esm/checkout/views/funding-timeline.js.map +1 -0
- package/dist/esm/checkout/views/initial.js +25 -41
- package/dist/esm/checkout/views/initial.js.map +1 -1
- package/dist/esm/checkout/views/method-select.js +6 -4
- package/dist/esm/checkout/views/method-select.js.map +1 -1
- package/dist/esm/checkout/views/payment-follower.js +105 -0
- package/dist/esm/checkout/views/payment-follower.js.map +1 -0
- package/dist/esm/checkout/views/restart.js +11 -2
- package/dist/esm/checkout/views/restart.js.map +1 -1
- package/dist/esm/components/buttons/index.js +3 -2
- package/dist/esm/components/buttons/index.js.map +1 -1
- package/dist/esm/components/icons/search.js +5 -0
- package/dist/esm/components/icons/search.js.map +1 -0
- package/dist/esm/components/loading/index.js +2 -2
- package/dist/esm/components/loading/index.js.map +1 -1
- package/dist/esm/components/modals/modal-with-views.js +6 -12
- 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/transition-view.js +16 -0
- package/dist/esm/components/modals/transition-view.js.map +1 -0
- package/dist/esm/components/modals/use-modal-with-views.js +17 -19
- package/dist/esm/components/modals/use-modal-with-views.js.map +1 -1
- package/dist/esm/components/wallet-selector/wallets/wagmi/index.js +21 -2
- package/dist/esm/components/wallet-selector/wallets/wagmi/index.js.map +1 -1
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/integrations/bitcoin-metamask.js +87 -0
- package/dist/esm/integrations/bitcoin-metamask.js.map +1 -0
- package/dist/esm/integrations/bitcoin-network.js +59 -0
- package/dist/esm/integrations/bitcoin-network.js.map +1 -0
- package/dist/esm/integrations/bitcoin-psbt.js +4 -0
- package/dist/esm/integrations/bitcoin-psbt.js.map +1 -0
- package/dist/esm/integrations/bitcoin-source.js +12 -0
- package/dist/esm/integrations/bitcoin-source.js.map +1 -0
- package/dist/esm/integrations/bitcoin-wallet.js +225 -0
- package/dist/esm/integrations/bitcoin-wallet.js.map +1 -0
- package/dist/esm/integrations/evm-chain.js +18 -0
- package/dist/esm/integrations/evm-chain.js.map +1 -1
- package/dist/esm/integrations/guarded-wallet-client.js +19 -0
- package/dist/esm/integrations/guarded-wallet-client.js.map +1 -0
- package/dist/esm/integrations/lifi.js +85 -38
- package/dist/esm/integrations/lifi.js.map +1 -1
- package/dist/esm/refund/index.js +217 -226
- package/dist/esm/refund/index.js.map +1 -1
- package/dist/esm/state/checkout/bitcoin-payment.js +253 -0
- package/dist/esm/state/checkout/bitcoin-payment.js.map +1 -0
- package/dist/esm/state/checkout/checkout-state.js +54 -0
- package/dist/esm/state/checkout/checkout-state.js.map +1 -0
- package/dist/esm/state/checkout/funding.js +5 -0
- package/dist/esm/state/checkout/funding.js.map +1 -0
- package/dist/esm/state/checkout/issuance-conflicts.js +29 -0
- package/dist/esm/state/checkout/issuance-conflicts.js.map +1 -0
- package/dist/esm/state/checkout/manual-route.js +10 -0
- package/dist/esm/state/checkout/manual-route.js.map +1 -0
- package/dist/esm/state/checkout/payment-attempt.js +50 -20
- package/dist/esm/state/checkout/payment-attempt.js.map +1 -1
- package/dist/esm/state/checkout/payment-lifecycle.js +9 -15
- package/dist/esm/state/checkout/payment-lifecycle.js.map +1 -1
- package/dist/esm/state/checkout/payment-observer.js +147 -0
- package/dist/esm/state/checkout/payment-observer.js.map +1 -0
- package/dist/esm/state/checkout/payment-phase.js +131 -0
- package/dist/esm/state/checkout/payment-phase.js.map +1 -0
- package/dist/esm/state/checkout/quote-countdown.js +26 -0
- package/dist/esm/state/checkout/quote-countdown.js.map +1 -0
- package/dist/esm/state/checkout/quote-lifecycle.js +378 -0
- package/dist/esm/state/checkout/quote-lifecycle.js.map +1 -0
- package/dist/esm/state/checkout/route-estimate.js +77 -0
- package/dist/esm/state/checkout/route-estimate.js.map +1 -0
- package/dist/esm/state/checkout/store.js +350 -708
- package/dist/esm/state/checkout/store.js.map +1 -1
- package/dist/esm/state/checkout/wallet-payment-options.js +0 -32
- package/dist/esm/state/checkout/wallet-payment-options.js.map +1 -1
- package/dist/esm/state/checkout/wallet-payment.js +249 -0
- package/dist/esm/state/checkout/wallet-payment.js.map +1 -0
- package/dist/esm/utils/string.js +2 -0
- package/dist/esm/utils/string.js.map +1 -1
- package/dist/esm/utils/token-amount.js +88 -0
- package/dist/esm/utils/token-amount.js.map +1 -0
- package/dist/esm/utils/wallet-errors.js +21 -4
- package/dist/esm/utils/wallet-errors.js.map +1 -1
- package/dist/types/api/errors.d.ts +37 -0
- package/dist/types/api/errors.d.ts.map +1 -0
- package/dist/types/api/generated.d.ts +4570 -695
- package/dist/types/api/generated.d.ts.map +1 -1
- package/dist/types/api/payments.d.ts +28 -1
- package/dist/types/api/payments.d.ts.map +1 -1
- package/dist/types/api/tokens.d.ts +6 -0
- package/dist/types/api/tokens.d.ts.map +1 -0
- package/dist/types/api/types.d.ts +28 -2
- package/dist/types/api/types.d.ts.map +1 -1
- package/dist/types/checkout/claimable-funds.d.ts +15 -2
- package/dist/types/checkout/claimable-funds.d.ts.map +1 -1
- package/dist/types/checkout/creation-error-modal.d.ts +2 -1
- package/dist/types/checkout/creation-error-modal.d.ts.map +1 -1
- package/dist/types/checkout/index.d.ts +21 -1
- package/dist/types/checkout/index.d.ts.map +1 -1
- package/dist/types/checkout/modal.d.ts +4 -1
- package/dist/types/checkout/modal.d.ts.map +1 -1
- package/dist/types/checkout/payment-status.d.ts +10 -2
- package/dist/types/checkout/payment-status.d.ts.map +1 -1
- package/dist/types/checkout/provider-status.d.ts +11 -0
- package/dist/types/checkout/provider-status.d.ts.map +1 -0
- package/dist/types/checkout/providers/checkout-wallet.d.ts +23 -0
- package/dist/types/checkout/providers/checkout-wallet.d.ts.map +1 -0
- package/dist/types/checkout/providers/wagmi-config.d.ts +8 -2
- package/dist/types/checkout/providers/wagmi-config.d.ts.map +1 -1
- package/dist/types/checkout/refund-notice.d.ts +7 -0
- package/dist/types/checkout/refund-notice.d.ts.map +1 -0
- package/dist/types/checkout/resume-state.d.ts +41 -4
- package/dist/types/checkout/resume-state.d.ts.map +1 -1
- package/dist/types/checkout/surplus-refund.d.ts +8 -0
- package/dist/types/checkout/surplus-refund.d.ts.map +1 -1
- package/dist/types/checkout/views/amount-header.d.ts.map +1 -1
- package/dist/types/checkout/views/claimable-funds.d.ts.map +1 -1
- package/dist/types/checkout/views/crypto-intent/direct-details.d.ts +3 -13
- package/dist/types/checkout/views/crypto-intent/direct-details.d.ts.map +1 -1
- package/dist/types/checkout/views/crypto-intent/manual-instruction-card.d.ts +10 -0
- package/dist/types/checkout/views/crypto-intent/manual-instruction-card.d.ts.map +1 -0
- package/dist/types/checkout/views/crypto-intent/manual-payment-summary.d.ts +4 -11
- package/dist/types/checkout/views/crypto-intent/manual-payment-summary.d.ts.map +1 -1
- package/dist/types/checkout/views/crypto-intent/manual-refresh.d.ts +4 -0
- package/dist/types/checkout/views/crypto-intent/manual-refresh.d.ts.map +1 -0
- package/dist/types/checkout/views/crypto-intent/manual-refund-preference.d.ts +14 -10
- package/dist/types/checkout/views/crypto-intent/manual-refund-preference.d.ts.map +1 -1
- package/dist/types/checkout/views/crypto-intent/manual-route-picker.d.ts +18 -0
- package/dist/types/checkout/views/crypto-intent/manual-route-picker.d.ts.map +1 -0
- package/dist/types/checkout/views/crypto-intent/manual-sources.d.ts +33 -0
- package/dist/types/checkout/views/crypto-intent/manual-sources.d.ts.map +1 -0
- package/dist/types/checkout/views/crypto-intent/manual-transfer-instructions.d.ts +18 -0
- package/dist/types/checkout/views/crypto-intent/manual-transfer-instructions.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/payment-route-error.d.ts +2 -0
- package/dist/types/checkout/views/crypto-intent/payment-route-error.d.ts.map +1 -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.map +1 -1
- package/dist/types/checkout/views/crypto-intent/wallet-payment-confirmation-amount.d.ts +8 -8
- package/dist/types/checkout/views/crypto-intent/wallet-payment-confirmation-amount.d.ts.map +1 -1
- package/dist/types/checkout/views/crypto-intent/wallet-payment-discovery.d.ts +17 -0
- package/dist/types/checkout/views/crypto-intent/wallet-payment-discovery.d.ts.map +1 -0
- package/dist/types/checkout/views/crypto-intent/wallet-payment-options.d.ts +2 -1
- package/dist/types/checkout/views/crypto-intent/wallet-payment-options.d.ts.map +1 -1
- package/dist/types/checkout/views/crypto-intent/wallet-payment-options.styles.d.ts +61 -0
- package/dist/types/checkout/views/crypto-intent/wallet-payment-options.styles.d.ts.map +1 -0
- package/dist/types/checkout/views/crypto-intent/wallet-select.d.ts +1 -2
- package/dist/types/checkout/views/crypto-intent/wallet-select.d.ts.map +1 -1
- package/dist/types/checkout/views/failed.d.ts +6 -0
- package/dist/types/checkout/views/failed.d.ts.map +1 -1
- package/dist/types/checkout/views/funding-timeline.d.ts +49 -0
- package/dist/types/checkout/views/funding-timeline.d.ts.map +1 -0
- package/dist/types/checkout/views/initial.d.ts +2 -4
- package/dist/types/checkout/views/initial.d.ts.map +1 -1
- package/dist/types/checkout/views/method-select.d.ts +2 -1
- package/dist/types/checkout/views/method-select.d.ts.map +1 -1
- package/dist/types/checkout/views/payment-follower.d.ts +31 -0
- package/dist/types/checkout/views/payment-follower.d.ts.map +1 -0
- package/dist/types/checkout/views/restart.d.ts +1 -1
- package/dist/types/checkout/views/restart.d.ts.map +1 -1
- package/dist/types/components/buttons/index.d.ts.map +1 -1
- package/dist/types/components/icons/search.d.ts +2 -0
- package/dist/types/components/icons/search.d.ts.map +1 -0
- package/dist/types/components/loading/index.d.ts +6 -1
- package/dist/types/components/loading/index.d.ts.map +1 -1
- package/dist/types/components/modals/modal-with-views.d.ts +2 -0
- package/dist/types/components/modals/modal-with-views.d.ts.map +1 -1
- package/dist/types/components/modals/modal.d.ts +2 -1
- package/dist/types/components/modals/modal.d.ts.map +1 -1
- package/dist/types/components/modals/transition-view.d.ts +2 -0
- package/dist/types/components/modals/transition-view.d.ts.map +1 -0
- package/dist/types/components/modals/use-modal-with-views.d.ts +2 -1
- package/dist/types/components/modals/use-modal-with-views.d.ts.map +1 -1
- package/dist/types/components/wallet-selector/domain.d.ts +1 -1
- package/dist/types/components/wallet-selector/domain.d.ts.map +1 -1
- package/dist/types/components/wallet-selector/wallets/wagmi/index.d.ts +2 -2
- package/dist/types/components/wallet-selector/wallets/wagmi/index.d.ts.map +1 -1
- package/dist/types/config.d.ts +1 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/integrations/bitcoin-metamask.d.ts +11 -0
- package/dist/types/integrations/bitcoin-metamask.d.ts.map +1 -0
- package/dist/types/integrations/bitcoin-network.d.ts +13 -0
- package/dist/types/integrations/bitcoin-network.d.ts.map +1 -0
- package/dist/types/integrations/bitcoin-psbt.d.ts +5 -0
- package/dist/types/integrations/bitcoin-psbt.d.ts.map +1 -0
- package/dist/types/integrations/bitcoin-source.d.ts +12 -0
- package/dist/types/integrations/bitcoin-source.d.ts.map +1 -0
- package/dist/types/integrations/bitcoin-wallet.d.ts +63 -0
- package/dist/types/integrations/bitcoin-wallet.d.ts.map +1 -0
- package/dist/types/integrations/evm-chain.d.ts +5 -0
- package/dist/types/integrations/evm-chain.d.ts.map +1 -1
- package/dist/types/integrations/guarded-wallet-client.d.ts +4 -0
- package/dist/types/integrations/guarded-wallet-client.d.ts.map +1 -0
- package/dist/types/integrations/lifi.d.ts +22 -0
- package/dist/types/integrations/lifi.d.ts.map +1 -1
- package/dist/types/refund/index.d.ts +1 -1
- package/dist/types/refund/index.d.ts.map +1 -1
- package/dist/types/state/checkout/bitcoin-payment.d.ts +28 -0
- package/dist/types/state/checkout/bitcoin-payment.d.ts.map +1 -0
- package/dist/types/state/checkout/checkout-state.d.ts +102 -0
- package/dist/types/state/checkout/checkout-state.d.ts.map +1 -0
- package/dist/types/state/checkout/funding.d.ts +6 -0
- package/dist/types/state/checkout/funding.d.ts.map +1 -0
- package/dist/types/state/checkout/issuance-conflicts.d.ts +22 -0
- package/dist/types/state/checkout/issuance-conflicts.d.ts.map +1 -0
- package/dist/types/state/checkout/manual-route.d.ts +13 -0
- package/dist/types/state/checkout/manual-route.d.ts.map +1 -0
- package/dist/types/state/checkout/payment-attempt.d.ts +20 -1
- package/dist/types/state/checkout/payment-attempt.d.ts.map +1 -1
- package/dist/types/state/checkout/payment-lifecycle.d.ts +6 -8
- package/dist/types/state/checkout/payment-lifecycle.d.ts.map +1 -1
- package/dist/types/state/checkout/payment-observer.d.ts +41 -0
- package/dist/types/state/checkout/payment-observer.d.ts.map +1 -0
- package/dist/types/state/checkout/payment-phase.d.ts +116 -0
- package/dist/types/state/checkout/payment-phase.d.ts.map +1 -0
- package/dist/types/state/checkout/quote-countdown.d.ts +15 -0
- package/dist/types/state/checkout/quote-countdown.d.ts.map +1 -0
- package/dist/types/state/checkout/quote-lifecycle.d.ts +39 -0
- package/dist/types/state/checkout/quote-lifecycle.d.ts.map +1 -0
- package/dist/types/state/checkout/route-estimate.d.ts +38 -0
- package/dist/types/state/checkout/route-estimate.d.ts.map +1 -0
- package/dist/types/state/checkout/store.d.ts +38 -90
- package/dist/types/state/checkout/store.d.ts.map +1 -1
- package/dist/types/state/checkout/wallet-payment-options.d.ts +0 -16
- package/dist/types/state/checkout/wallet-payment-options.d.ts.map +1 -1
- package/dist/types/state/checkout/wallet-payment.d.ts +24 -0
- package/dist/types/state/checkout/wallet-payment.d.ts.map +1 -0
- package/dist/types/utils/string.d.ts +2 -0
- package/dist/types/utils/string.d.ts.map +1 -1
- package/dist/types/utils/token-amount.d.ts +18 -0
- package/dist/types/utils/token-amount.d.ts.map +1 -0
- package/dist/types/utils/wallet-errors.d.ts.map +1 -1
- package/package.json +3 -1
- package/dist/esm/checkout/providers/wallet-connect-resume.js +0 -129
- package/dist/esm/checkout/providers/wallet-connect-resume.js.map +0 -1
- package/dist/esm/refund/confirmation.js +0 -30
- package/dist/esm/refund/confirmation.js.map +0 -1
- package/dist/types/checkout/providers/wallet-connect-resume.d.ts +0 -9
- package/dist/types/checkout/providers/wallet-connect-resume.d.ts.map +0 -1
- package/dist/types/refund/confirmation.d.ts +0 -14
- package/dist/types/refund/confirmation.d.ts.map +0 -1
|
@@ -1,166 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
-
import {
|
|
3
|
-
import { disconnect } from "@wagmi/core";
|
|
4
|
-
import { useCallback, useContext, useEffect, useRef } from "react";
|
|
5
|
-
import { styled } from "styled-components";
|
|
6
|
-
import { useAccount, useConfig } from "wagmi";
|
|
7
|
-
import { LogOutIcon, StyledButton, Text, useModalWithView, } from "../../../components/index.js";
|
|
8
|
-
import { WalletContext } from "../../../components/wallet-selector/provider.js";
|
|
9
|
-
import { useWalletActions } from "../../../components/wallet-selector/store.js";
|
|
10
|
-
import { WagmiWalletInterface } from "../../../components/wallet-selector/wallets/wagmi/index.js";
|
|
11
|
-
import { useMintMoneyConfig } from "../../../context.js";
|
|
12
|
-
import { formatAddress } from "../../../utils/string.js";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { StyledButton } from "../../../components/index.js";
|
|
13
3
|
import { ModalViewContainer } from "../../container.js";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
display: flex;
|
|
20
|
-
align-items: center;
|
|
21
|
-
justify-content: space-between;
|
|
22
|
-
gap: 14px;
|
|
23
|
-
`;
|
|
24
|
-
const ConnectedWalletIdentity = styled.div `
|
|
25
|
-
display: flex;
|
|
26
|
-
align-items: center;
|
|
27
|
-
gap: 12px;
|
|
28
|
-
min-width: 0;
|
|
29
|
-
flex: 1;
|
|
30
|
-
`;
|
|
31
|
-
const WalletIcon = styled.div `
|
|
32
|
-
width: 44px;
|
|
33
|
-
height: 44px;
|
|
34
|
-
border-radius: 14px;
|
|
35
|
-
flex-shrink: 0;
|
|
36
|
-
background:
|
|
37
|
-
${({ $iconUrl }) => ($iconUrl ? `url(${$iconUrl})` : "none")},
|
|
38
|
-
linear-gradient(135deg, #22c55e, #60a5fa);
|
|
39
|
-
background-size: cover;
|
|
40
|
-
background-position: center;
|
|
41
|
-
`;
|
|
42
|
-
const WalletTextBlock = styled.div `
|
|
43
|
-
min-width: 0;
|
|
44
|
-
display: flex;
|
|
45
|
-
flex-direction: column;
|
|
46
|
-
gap: 6px;
|
|
47
|
-
`;
|
|
48
|
-
const ConnectedBadge = styled.span `
|
|
49
|
-
border-radius: 999px;
|
|
50
|
-
background: #ecfdf5;
|
|
51
|
-
color: #047857;
|
|
52
|
-
font-size: 12px;
|
|
53
|
-
font-weight: 700;
|
|
54
|
-
line-height: 1;
|
|
55
|
-
padding: 7px 10px;
|
|
56
|
-
white-space: nowrap;
|
|
57
|
-
`;
|
|
58
|
-
const DisconnectBadge = styled.button `
|
|
59
|
-
border: none;
|
|
60
|
-
border-radius: 999px;
|
|
61
|
-
background: transparent;
|
|
62
|
-
color: #dc2626;
|
|
63
|
-
width: 28px;
|
|
64
|
-
height: 28px;
|
|
65
|
-
padding: 0;
|
|
66
|
-
display: inline-flex;
|
|
67
|
-
align-items: center;
|
|
68
|
-
justify-content: center;
|
|
69
|
-
cursor: pointer;
|
|
70
|
-
|
|
71
|
-
&:hover {
|
|
72
|
-
background: #fee2e2;
|
|
73
|
-
color: #b91c1c;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&:focus-visible {
|
|
77
|
-
outline: 2px solid #fecaca;
|
|
78
|
-
outline-offset: 2px;
|
|
79
|
-
}
|
|
80
|
-
`;
|
|
81
|
-
const ConnectedWalletCardActions = styled.div `
|
|
82
|
-
display: inline-flex;
|
|
83
|
-
align-items: center;
|
|
84
|
-
gap: 8px;
|
|
85
|
-
flex-shrink: 0;
|
|
86
|
-
`;
|
|
87
|
-
const WalletActions = styled.div `
|
|
88
|
-
display: flex;
|
|
89
|
-
flex-direction: column;
|
|
90
|
-
gap: 10px;
|
|
91
|
-
`;
|
|
92
|
-
const CryptoIntentSelectWalletAppKitViewContent = () => {
|
|
93
|
-
const modalRef = useRef(null);
|
|
94
|
-
const config = useMintMoneyConfig();
|
|
95
|
-
const wagmiConfig = useConfig();
|
|
96
|
-
const { goToView } = useModalWithView();
|
|
97
|
-
const { setWallet } = useContext(WalletContext);
|
|
98
|
-
const { initialiseWallets } = useWalletActions();
|
|
99
|
-
const { open } = useAppKit();
|
|
100
|
-
const account = useAccount();
|
|
101
|
-
const hasAutoOpenedRef = useRef(false);
|
|
102
|
-
const handledAccountRef = useRef(null);
|
|
103
|
-
const isWalletConnectionSettling = account.status === "connecting" || account.status === "reconnecting";
|
|
104
|
-
const connectorName = account.connector?.name || "Wallet";
|
|
105
|
-
const connectorIcon = typeof account.connector?.icon === "string"
|
|
106
|
-
? account.connector.icon
|
|
107
|
-
: undefined;
|
|
108
|
-
useEffect(() => {
|
|
109
|
-
if (!isWalletConnectionSettling &&
|
|
110
|
-
!account.isConnected &&
|
|
111
|
-
!hasAutoOpenedRef.current) {
|
|
112
|
-
hasAutoOpenedRef.current = true;
|
|
113
|
-
void open({ view: "Connect", namespace: "eip155" });
|
|
114
|
-
}
|
|
115
|
-
}, [account.isConnected, isWalletConnectionSettling, open]);
|
|
116
|
-
const handleContinue = useCallback(() => {
|
|
117
|
-
if (isWalletConnectionSettling) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
if (!account.isConnected || !account.address || !account.connector) {
|
|
121
|
-
void open({ view: "Connect", namespace: "eip155" });
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
const wallet = new WagmiWalletInterface(account.connector, wagmiConfig);
|
|
125
|
-
setWallet(wallet);
|
|
126
|
-
initialiseWallets([() => wallet]);
|
|
127
|
-
goToView("cryptoIntentWalletPaymentOptions");
|
|
128
|
-
}, [
|
|
129
|
-
account.isConnected,
|
|
130
|
-
account.address,
|
|
131
|
-
account.connector,
|
|
132
|
-
isWalletConnectionSettling,
|
|
133
|
-
open,
|
|
134
|
-
wagmiConfig,
|
|
135
|
-
setWallet,
|
|
136
|
-
initialiseWallets,
|
|
137
|
-
goToView,
|
|
138
|
-
]);
|
|
139
|
-
const handleDisconnect = useCallback(() => {
|
|
140
|
-
handledAccountRef.current = null;
|
|
141
|
-
setWallet(null);
|
|
142
|
-
goToView("cryptoIntent");
|
|
143
|
-
void disconnect(wagmiConfig).catch((error) => {
|
|
144
|
-
console.warn("Unable to disconnect wallet", error);
|
|
145
|
-
});
|
|
146
|
-
}, [goToView, setWallet, wagmiConfig]);
|
|
147
|
-
useEffect(() => {
|
|
148
|
-
if (!account.isConnected || !account.address || !account.connector) {
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
const accountKey = `${account.connector.id}:${account.address}`;
|
|
152
|
-
if (handledAccountRef.current === accountKey) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
handledAccountRef.current = accountKey;
|
|
156
|
-
handleContinue();
|
|
157
|
-
}, [account.address, account.connector, account.isConnected, handleContinue]);
|
|
158
|
-
return (_jsxs(ModalViewContainer, { ref: modalRef, children: [_jsx(Text, { size: "base", weight: "normal", color: config.theme.font.color.secondary, children: "Select your wallet" }), account.isConnected && account.address ? (_jsxs(_Fragment, { children: [_jsxs(ConnectedWalletCard, { children: [_jsxs(ConnectedWalletIdentity, { children: [_jsx(WalletIcon, { "$iconUrl": connectorIcon, "aria-hidden": "true" }), _jsxs(WalletTextBlock, { children: [_jsx(Text, { size: "base", weight: "semibold", color: config.theme.font.color.primary, children: connectorName }), _jsx(Text, { size: "sm", weight: "normal", color: config.theme.font.color.secondary, children: formatAddress(account.address) })] })] }), _jsxs(ConnectedWalletCardActions, { children: [_jsx(ConnectedBadge, { children: "Connected" }), _jsx(DisconnectBadge, { type: "button", onClick: handleDisconnect, "aria-label": "Disconnect wallet", title: "Disconnect wallet", children: _jsx(LogOutIcon, { size: 14 }) })] })] }), _jsxs(WalletActions, { children: [_jsx(StyledButton, { onClick: handleContinue, children: "Continue with this wallet" }), _jsx(StyledButton, { variant: "secondary", onClick: () => void open({ view: "Connect", namespace: "eip155" }), children: "Connect another wallet" })] })] })) : (_jsx(StyledButton, { onClick: () => void open({ view: "Connect", namespace: "eip155" }), disabled: isWalletConnectionSettling, children: isWalletConnectionSettling
|
|
159
|
-
? "Connecting wallet..."
|
|
160
|
-
: "Connect wallet" }))] }));
|
|
161
|
-
};
|
|
162
|
-
const CryptoIntentSelectWalletViewContent = () => {
|
|
163
|
-
return _jsx(CryptoIntentSelectWalletAppKitViewContent, {});
|
|
164
|
-
};
|
|
165
|
-
export { CryptoIntentSelectWalletViewContent };
|
|
4
|
+
import { useCheckoutWallet } from "../../providers/checkout-wallet.js";
|
|
5
|
+
export function CryptoIntentSelectWalletViewContent() {
|
|
6
|
+
const { ready, connecting, error, connect } = useCheckoutWallet();
|
|
7
|
+
return (_jsxs(ModalViewContainer, { children: [error ? _jsx("p", { role: "alert", children: error }) : null, _jsx(StyledButton, { onClick: () => void connect(), disabled: !ready, children: connecting ? "Connecting wallet..." : "Connect Wallet" })] }));
|
|
8
|
+
}
|
|
166
9
|
//# sourceMappingURL=wallet-select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet-select.js","sourceRoot":"","sources":["../../../../../src/checkout/views/crypto-intent/wallet-select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"wallet-select.js","sourceRoot":"","sources":["../../../../../src/checkout/views/crypto-intent/wallet-select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,MAAM,UAAU,mCAAmC;IACjD,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAClE,OAAO,CACL,MAAC,kBAAkB,eAChB,KAAK,CAAC,CAAC,CAAC,YAAG,IAAI,EAAC,OAAO,YAAE,KAAK,GAAK,CAAC,CAAC,CAAC,IAAI,EAC3C,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,KAAK,YAC1D,UAAU,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,gBAAgB,GAC1C,IACI,CACtB,CAAC;AACJ,CAAC"}
|
|
@@ -5,7 +5,12 @@ import { getPaymentRefundStatus } from "../../api/payments.js";
|
|
|
5
5
|
import { AlertCircleIcon } from "../../components/icons/alert.js";
|
|
6
6
|
import { useModalWithView } from "../../components/modals/use-modal-with-views.js";
|
|
7
7
|
import { Text } from "../../components/text/index.js";
|
|
8
|
+
import { useMintMoneyConfig } from "../../context.js";
|
|
9
|
+
import { isPaymentConfirmed } from "../../state/checkout/payment-lifecycle.js";
|
|
10
|
+
import { derivePaymentPhase } from "../../state/checkout/payment-phase.js";
|
|
8
11
|
import { useCheckoutStore } from "../../state/checkout/store.js";
|
|
12
|
+
import { claimableRefundUrl, isRefundOpeningSoon } from "../claimable-funds.js";
|
|
13
|
+
import { CheckoutPaymentHistory, usePaymentReadKey, } from "./payment-follower.js";
|
|
9
14
|
const FailedContainer = styled.div `
|
|
10
15
|
display: flex;
|
|
11
16
|
flex-direction: column;
|
|
@@ -21,6 +26,14 @@ const IconContainer = styled.div `
|
|
|
21
26
|
justify-content: center;
|
|
22
27
|
margin-bottom: 1rem;
|
|
23
28
|
`;
|
|
29
|
+
const HistoryContainer = styled.div `
|
|
30
|
+
width: 100%;
|
|
31
|
+
margin-top: 1.25rem;
|
|
32
|
+
|
|
33
|
+
&:empty {
|
|
34
|
+
display: none;
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
24
37
|
const REASON_MESSAGES = {
|
|
25
38
|
wallet_not_connected: "Please connect your wallet and try again.",
|
|
26
39
|
confirm_payment: "We couldn't confirm your payment. Please try again.",
|
|
@@ -28,38 +41,51 @@ const REASON_MESSAGES = {
|
|
|
28
41
|
};
|
|
29
42
|
const describeReason = (reason) => (reason && (REASON_MESSAGES[reason] ?? reason)) ||
|
|
30
43
|
"Something went wrong with your payment. You can try again.";
|
|
44
|
+
const CLOSED_PAYMENT_MESSAGE = "This payment can no longer be completed. Ask the merchant for a new payment link.";
|
|
45
|
+
const REFUND_PREPARING_MESSAGE = "Your refund is being prepared — this page will update shortly.";
|
|
46
|
+
/**
|
|
47
|
+
* A reason identifies a retryable error in loading, confirming or sending.
|
|
48
|
+
* A terminal API failure requires a new payment link.
|
|
49
|
+
*/
|
|
50
|
+
export const canTryFailedPaymentAgain = (payment, reason) => Boolean(reason) || derivePaymentPhase(payment).kind !== "failed";
|
|
31
51
|
export const FailedViewContent = () => {
|
|
32
52
|
const { goToView, viewProps } = useModalWithView();
|
|
53
|
+
const config = useMintMoneyConfig();
|
|
33
54
|
const reason = viewProps.reason;
|
|
34
55
|
const { payment, cryptoPaymentAttempt } = useCheckoutStore();
|
|
35
56
|
const [refundOpeningSoon, setRefundOpeningSoon] = useState(false);
|
|
57
|
+
// A failed payment can still settle: a settlement that lands before refunds
|
|
58
|
+
// open makes it paid (QCT D4). The payment status view then shows success and
|
|
59
|
+
// notifies the merchant, so this view follows the polled payment there.
|
|
60
|
+
const settled = isPaymentConfirmed(payment?.status, config.cryptoCheckoutConfig.paymentConfirmationStatus);
|
|
36
61
|
useEffect(() => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
62
|
+
if (settled)
|
|
63
|
+
goToView("paymentStatus");
|
|
64
|
+
}, [goToView, settled]);
|
|
65
|
+
const paymentId = payment?.id;
|
|
66
|
+
const paymentReadKey = usePaymentReadKey();
|
|
67
|
+
const attemptId = cryptoPaymentAttempt?.attempt_id ?? payment?.payment_attempt?.attempt_id;
|
|
68
|
+
useEffect(() => setRefundOpeningSoon(false), [paymentId, attemptId]);
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (!paymentId || !attemptId || settled || payment?.is_test)
|
|
42
71
|
return;
|
|
43
|
-
|
|
72
|
+
const request = new AbortController();
|
|
73
|
+
let retryTimeout;
|
|
44
74
|
// Best-effort: a failed crypto payment is usually a contract-level
|
|
45
75
|
// underpayment/late settlement, in which case the receiver still holds the
|
|
46
76
|
// funds and the payer can self-serve a refund. Surface that as "Get refund".
|
|
47
77
|
const loadRefundStatus = async () => {
|
|
48
78
|
try {
|
|
49
|
-
const status = await getPaymentRefundStatus(paymentId
|
|
50
|
-
|
|
79
|
+
const status = await getPaymentRefundStatus(paymentId, {
|
|
80
|
+
signal: request.signal,
|
|
81
|
+
});
|
|
82
|
+
if (request.signal.aborted)
|
|
51
83
|
return;
|
|
52
|
-
const openingSoon = status
|
|
53
|
-
status.current_refundable_balance !== "0" &&
|
|
54
|
-
Boolean(status.refund_url);
|
|
84
|
+
const openingSoon = isRefundOpeningSoon(status);
|
|
55
85
|
setRefundOpeningSoon(openingSoon);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
goToView("refundAvailable", {
|
|
60
|
-
kind: "refund",
|
|
61
|
-
refundUrl: status.refund_url,
|
|
62
|
-
});
|
|
86
|
+
const refundUrl = claimableRefundUrl(status, { requireBalance: true });
|
|
87
|
+
if (refundUrl) {
|
|
88
|
+
goToView("refundAvailable", { kind: "refund", refundUrl });
|
|
63
89
|
return;
|
|
64
90
|
}
|
|
65
91
|
// The on-chain refund window can open moments after the payment fails;
|
|
@@ -72,20 +98,30 @@ export const FailedViewContent = () => {
|
|
|
72
98
|
}
|
|
73
99
|
}
|
|
74
100
|
catch {
|
|
75
|
-
//
|
|
76
|
-
// "try again" message.
|
|
101
|
+
// The next payment read also retries refund status, even if funding is unchanged.
|
|
77
102
|
}
|
|
78
103
|
};
|
|
79
104
|
void loadRefundStatus();
|
|
80
105
|
return () => {
|
|
81
|
-
|
|
106
|
+
request.abort();
|
|
82
107
|
if (retryTimeout)
|
|
83
108
|
clearTimeout(retryTimeout);
|
|
84
109
|
};
|
|
85
|
-
}, [
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
110
|
+
}, [
|
|
111
|
+
attemptId,
|
|
112
|
+
goToView,
|
|
113
|
+
paymentId,
|
|
114
|
+
paymentReadKey,
|
|
115
|
+
payment?.is_test,
|
|
116
|
+
settled,
|
|
117
|
+
]);
|
|
118
|
+
// A failed payment keeps its history. The merchant can start a new payment.
|
|
119
|
+
const retryable = canTryFailedPaymentAgain(payment, reason);
|
|
120
|
+
const message = !retryable
|
|
121
|
+
? CLOSED_PAYMENT_MESSAGE
|
|
122
|
+
: refundOpeningSoon
|
|
123
|
+
? REFUND_PREPARING_MESSAGE
|
|
124
|
+
: describeReason(reason);
|
|
125
|
+
return (_jsxs(FailedContainer, { children: [_jsx(IconContainer, { children: _jsx(AlertCircleIcon, { size: 32, color: "#ef4444" }) }), _jsx(Text, { size: "lg", weight: "semibold", color: "#111827", style: { marginBottom: "0.5rem" }, children: "Action needed" }), _jsx(Text, { size: "sm", color: "#6b7280", align: "center", style: { maxWidth: "18rem" }, children: message }), !retryable && refundOpeningSoon ? (_jsx(Text, { size: "sm", color: "#6b7280", align: "center", style: { maxWidth: "18rem", marginTop: "0.5rem" }, children: REFUND_PREPARING_MESSAGE })) : null, _jsx(HistoryContainer, { children: _jsx(CheckoutPaymentHistory, {}) })] }));
|
|
90
126
|
};
|
|
91
127
|
//# sourceMappingURL=failed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"failed.js","sourceRoot":"","sources":["../../../../src/checkout/views/failed.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"failed.js","sourceRoot":"","sources":["../../../../src/checkout/views/failed.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AACnF,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE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K,EAAC,SAAS,GAAG,GAC/B,EAEhB,KAAC,IAAI,IACH,IAAI,EAAC,IAAI,EACT,MAAM,EAAC,UAAU,EACjB,KAAK,EAAC,SAAS,EACf,KAAK,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,8BAG5B,EAEP,KAAC,IAAI,IACH,IAAI,EAAC,IAAI,EACT,KAAK,EAAC,SAAS,EACf,KAAK,EAAC,QAAQ,EACd,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,YAE3B,OAAO,GACH,EACN,CAAC,SAAS,IAAI,iBAAiB,CAAC,CAAC,CAAC,CACjC,KAAC,IAAI,IACH,IAAI,EAAC,IAAI,EACT,KAAK,EAAC,SAAS,EACf,KAAK,EAAC,QAAQ,EACd,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,YAEhD,wBAAwB,GACpB,CACR,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,gBAAgB,cACf,KAAC,sBAAsB,KAAG,GACT,IACH,CACnB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { styled } from "styled-components";
|
|
4
|
+
import { describeRequestFailure } from "../../api/errors.js";
|
|
5
|
+
import { getPublicPaymentTimeline, } from "../../api/payments.js";
|
|
6
|
+
import { StyledButton } from "../../components/buttons/index.js";
|
|
7
|
+
import { fundingShortfall, hasReceivedFunds, } from "../../state/checkout/funding.js";
|
|
8
|
+
import { fallbackTokenDecimals, formatTokenValue, transactionUrl, } from "../../utils/token-amount.js";
|
|
9
|
+
import { providerStatusLabel } from "../provider-status.js";
|
|
10
|
+
import { formatRefundAvailability } from "../refund-availability.js";
|
|
11
|
+
export const TIMELINE_PAGE_SIZE = 50;
|
|
12
|
+
const Section = styled.section `
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: 12px;
|
|
16
|
+
width: 100%;
|
|
17
|
+
color: inherit;
|
|
18
|
+
text-align: left;
|
|
19
|
+
`;
|
|
20
|
+
const Heading = styled.h3 `
|
|
21
|
+
margin: 0;
|
|
22
|
+
font-size: 13px;
|
|
23
|
+
line-height: 1.3;
|
|
24
|
+
font-weight: 600;
|
|
25
|
+
letter-spacing: 0.04em;
|
|
26
|
+
text-transform: uppercase;
|
|
27
|
+
opacity: 0.7;
|
|
28
|
+
`;
|
|
29
|
+
const Rows = styled.dl `
|
|
30
|
+
margin: 0;
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
border: 1px solid rgba(148, 163, 184, 0.28);
|
|
34
|
+
border-radius: 14px;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
`;
|
|
37
|
+
const FundingRows = styled(Rows) `
|
|
38
|
+
background: #f6f8fa;
|
|
39
|
+
color: #172334;
|
|
40
|
+
|
|
41
|
+
dt {
|
|
42
|
+
color: #475569;
|
|
43
|
+
opacity: 1;
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
const Row = styled.div `
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: space-between;
|
|
49
|
+
gap: 16px;
|
|
50
|
+
padding: 10px 14px;
|
|
51
|
+
font-size: 14px;
|
|
52
|
+
line-height: 1.4;
|
|
53
|
+
border-bottom: 1px solid rgba(148, 163, 184, 0.28);
|
|
54
|
+
|
|
55
|
+
&:last-child {
|
|
56
|
+
border-bottom: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
dt {
|
|
60
|
+
opacity: 0.75;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
dd {
|
|
64
|
+
margin: 0;
|
|
65
|
+
font-weight: 600;
|
|
66
|
+
text-align: right;
|
|
67
|
+
overflow-wrap: anywhere;
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
const Note = styled.p `
|
|
71
|
+
margin: 0;
|
|
72
|
+
font-size: 13px;
|
|
73
|
+
line-height: 1.45;
|
|
74
|
+
opacity: 0.8;
|
|
75
|
+
`;
|
|
76
|
+
const Items = styled.ol `
|
|
77
|
+
margin: 0;
|
|
78
|
+
padding: 0;
|
|
79
|
+
list-style: none;
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
border: 1px solid rgba(148, 163, 184, 0.28);
|
|
83
|
+
border-radius: 14px;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
`;
|
|
86
|
+
const Item = styled.li `
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
gap: 2px;
|
|
90
|
+
padding: 10px 14px;
|
|
91
|
+
font-size: 14px;
|
|
92
|
+
line-height: 1.4;
|
|
93
|
+
border-bottom: 1px solid rgba(148, 163, 184, 0.28);
|
|
94
|
+
|
|
95
|
+
&:last-child {
|
|
96
|
+
border-bottom: 0;
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
const ItemHeader = styled.div `
|
|
100
|
+
display: flex;
|
|
101
|
+
justify-content: space-between;
|
|
102
|
+
gap: 12px;
|
|
103
|
+
|
|
104
|
+
strong {
|
|
105
|
+
font-weight: 600;
|
|
106
|
+
}
|
|
107
|
+
`;
|
|
108
|
+
const ItemMeta = styled.div `
|
|
109
|
+
display: flex;
|
|
110
|
+
justify-content: space-between;
|
|
111
|
+
gap: 12px;
|
|
112
|
+
font-size: 12px;
|
|
113
|
+
opacity: 0.75;
|
|
114
|
+
|
|
115
|
+
a {
|
|
116
|
+
color: inherit;
|
|
117
|
+
}
|
|
118
|
+
`;
|
|
119
|
+
const ErrorText = styled.p `
|
|
120
|
+
margin: 0;
|
|
121
|
+
color: #dc2626;
|
|
122
|
+
font-size: 13px;
|
|
123
|
+
line-height: 1.4;
|
|
124
|
+
`;
|
|
125
|
+
const ITEM_LABELS = {
|
|
126
|
+
deposit: "Deposit",
|
|
127
|
+
settlement: "Settlement",
|
|
128
|
+
claim: "Refund claim",
|
|
129
|
+
};
|
|
130
|
+
const shortHash = (hash) => `${hash.slice(0, 10)}...${hash.slice(-6)}`;
|
|
131
|
+
const providerName = (provider) => provider ? `${provider.charAt(0).toUpperCase()}${provider.slice(1)}` : "";
|
|
132
|
+
/** First-page items plus loaded pages, in chain order and without repeats. */
|
|
133
|
+
export function visibleTimelineItems(firstPage, loaded) {
|
|
134
|
+
const seen = new Set();
|
|
135
|
+
return [...firstPage, ...loaded].filter((item) => {
|
|
136
|
+
if (seen.has(item.id))
|
|
137
|
+
return false;
|
|
138
|
+
seen.add(item.id);
|
|
139
|
+
return true;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/** Reads the page after `cursor` through the public, link-scoped timeline. */
|
|
143
|
+
export function fetchTimelinePage(paymentId, cursor, apiUrl) {
|
|
144
|
+
return getPublicPaymentTimeline(paymentId, {
|
|
145
|
+
cursor,
|
|
146
|
+
limit: TIMELINE_PAGE_SIZE,
|
|
147
|
+
apiUrl,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Loaded pages after reading `page` at `cursor`. Reading the last page again
|
|
152
|
+
* keeps what is shown and adds the items and continuation that arrived since.
|
|
153
|
+
*/
|
|
154
|
+
export function mergeTimelinePage(current, paymentId, cursor, page) {
|
|
155
|
+
return {
|
|
156
|
+
paymentId,
|
|
157
|
+
items: visibleTimelineItems(current?.paymentId === paymentId ? current.items : [], page.items),
|
|
158
|
+
cursor: page.next_cursor,
|
|
159
|
+
lastCursor: cursor,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
const usePaymentTimelinePages = (paymentId, timeline, readKey, apiUrl) => {
|
|
163
|
+
const [loaded, setLoaded] = useState(null);
|
|
164
|
+
const [loading, setLoading] = useState(false);
|
|
165
|
+
const [error, setError] = useState(null);
|
|
166
|
+
const rereadingLastPage = useRef(false);
|
|
167
|
+
const pages = loaded?.paymentId === paymentId ? loaded : null;
|
|
168
|
+
useEffect(() => {
|
|
169
|
+
setError(null);
|
|
170
|
+
}, [paymentId]);
|
|
171
|
+
// Until a page is loaded, the first page's cursor leads. Polled snapshots
|
|
172
|
+
// refresh the first page; loaded pages stay and repeats are dropped.
|
|
173
|
+
const nextCursor = pages ? pages.cursor : (timeline?.next_cursor ?? null);
|
|
174
|
+
const items = visibleTimelineItems(timeline?.items ?? [], pages?.items ?? []);
|
|
175
|
+
// Once the last page is loaded, each payment read reads it again, so items
|
|
176
|
+
// that arrived after it, and a new continuation, appear.
|
|
177
|
+
useEffect(() => {
|
|
178
|
+
const lastCursor = pages?.cursor === null ? pages.lastCursor : null;
|
|
179
|
+
if (!lastCursor || rereadingLastPage.current)
|
|
180
|
+
return;
|
|
181
|
+
rereadingLastPage.current = true;
|
|
182
|
+
fetchTimelinePage(paymentId, lastCursor, apiUrl)
|
|
183
|
+
.then((page) => {
|
|
184
|
+
setLoaded((current) => current?.paymentId === paymentId && current.lastCursor === lastCursor
|
|
185
|
+
? mergeTimelinePage(current, paymentId, lastCursor, page)
|
|
186
|
+
: current);
|
|
187
|
+
})
|
|
188
|
+
.catch(() => {
|
|
189
|
+
// Keep what is shown; the next snapshot reads the page again.
|
|
190
|
+
})
|
|
191
|
+
.finally(() => {
|
|
192
|
+
rereadingLastPage.current = false;
|
|
193
|
+
});
|
|
194
|
+
// Only a new read triggers this read, not the page that just loaded.
|
|
195
|
+
}, [timeline, readKey]);
|
|
196
|
+
const loadMore = async () => {
|
|
197
|
+
if (!nextCursor || loading)
|
|
198
|
+
return;
|
|
199
|
+
setLoading(true);
|
|
200
|
+
setError(null);
|
|
201
|
+
try {
|
|
202
|
+
const page = await fetchTimelinePage(paymentId, nextCursor, apiUrl);
|
|
203
|
+
setLoaded((current) => mergeTimelinePage(current, paymentId, nextCursor, page));
|
|
204
|
+
}
|
|
205
|
+
catch (loadError) {
|
|
206
|
+
setError(describeRequestFailure(loadError, "We couldn't load more history. Please try again."));
|
|
207
|
+
}
|
|
208
|
+
finally {
|
|
209
|
+
setLoading(false);
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
return { items, nextCursor, loadMore, loading, error };
|
|
213
|
+
};
|
|
214
|
+
/** The settlement token's symbol from issued instructions, else its name. */
|
|
215
|
+
export const settlementTokenSymbol = (attempt) => attempt?.payment_instructions?.type === "token_transfer"
|
|
216
|
+
? attempt.payment_instructions.token_symbol
|
|
217
|
+
: (attempt?.settlement_config?.asset_name ?? null);
|
|
218
|
+
const ReconciliationNote = ({ funding }) => funding.reconciliation.status === "stale" ? (_jsx(Note, { role: "status", children: "Chain data is catching up. These amounts may be incomplete." })) : funding.reconciliation.status === "discrepancy" ? (_jsx(Note, { role: "status", children: "We are checking this payment's balance. These amounts may be incomplete." })) : null;
|
|
219
|
+
/** "Received" and, while something is missing, "Still needed". */
|
|
220
|
+
const ReceivedRows = ({ funding, formatAmount, }) => {
|
|
221
|
+
const shortfall = fundingShortfall(funding);
|
|
222
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Row, { children: [_jsx("dt", { children: "Received" }), _jsx("dd", { children: formatAmount(funding.received_amount) })] }), shortfall ? (_jsxs(Row, { children: [_jsx("dt", { children: "Still needed" }), _jsx("dd", { children: formatAmount(shortfall) })] })) : null] }));
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* What a partly funded payment has received and still needs, as the API
|
|
226
|
+
* reports it. Hidden until something arrives.
|
|
227
|
+
*/
|
|
228
|
+
export function FundingProgress({ funding, tokenSymbol, }) {
|
|
229
|
+
if (!funding || !hasReceivedFunds(funding))
|
|
230
|
+
return null;
|
|
231
|
+
return (_jsxs(Section, { children: [_jsx(FundingRows, { "aria-label": "Funding progress", children: _jsx(ReceivedRows, { funding: funding, formatAmount: (rawAmount) => formatTokenValue(rawAmount, funding.token, funding.token_decimals, tokenSymbol) }) }), _jsx(ReconciliationNote, { funding: funding })] }));
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Renders the API's funding view and confirmed history (QCT D5). Balances,
|
|
235
|
+
* the cutoff and refund timing are the API's values; nothing is derived here.
|
|
236
|
+
*/
|
|
237
|
+
export function PaymentFundingTimeline({ paymentId, funding, timeline, tokenSymbol, readKey, apiUrl, }) {
|
|
238
|
+
const { items, nextCursor, loadMore, loading, error } = usePaymentTimelinePages(paymentId, timeline, readKey, apiUrl);
|
|
239
|
+
const providerProgress = timeline?.provider_progress ?? null;
|
|
240
|
+
if (!funding && items.length === 0 && !providerProgress)
|
|
241
|
+
return null;
|
|
242
|
+
// History items are in the settlement token, so the funding's decimals apply.
|
|
243
|
+
const decimals = funding
|
|
244
|
+
? (funding.token_decimals ?? fallbackTokenDecimals(funding.token))
|
|
245
|
+
: null;
|
|
246
|
+
const formatAmount = (rawAmount, token) => formatTokenValue(rawAmount, token, decimals, tokenSymbol);
|
|
247
|
+
const cutoff = formatRefundAvailability(funding?.settlement_cutoff_at);
|
|
248
|
+
const refundOpens = formatRefundAvailability(funding?.refund_opens_after);
|
|
249
|
+
return (_jsxs(Section, { children: [_jsx(Heading, { children: "Payment history" }), funding ? (_jsxs(Rows, { "aria-label": "Funding", children: [_jsx(ReceivedRows, { funding: funding, formatAmount: (rawAmount) => formatAmount(rawAmount, funding.token) }), _jsxs(Row, { children: [_jsx("dt", { children: "Remaining balance" }), _jsx("dd", { children: formatAmount(funding.remaining_balance, funding.token) })] }), cutoff ? (_jsxs(Row, { children: [_jsx("dt", { children: "Settlement cutoff" }), _jsx("dd", { children: _jsx("time", { dateTime: funding.settlement_cutoff_at ?? undefined, children: cutoff }) })] })) : null, refundOpens ? (_jsxs(Row, { children: [_jsx("dt", { children: "Refunds open after" }), _jsx("dd", { children: _jsx("time", { dateTime: funding.refund_opens_after, children: refundOpens }) })] })) : null] })) : null, funding ? _jsx(ReconciliationNote, { funding: funding }) : null, providerProgress ? (_jsx(Rows, { "aria-label": "Provider progress", children: _jsxs(Row, { children: [_jsx("dt", { children: `${providerName(providerProgress.provider)} status` }), _jsx("dd", { children: providerStatusLabel(providerProgress.status) })] }) })) : null, items.length > 0 ? (_jsx(Items, { "aria-label": "Confirmed transactions", children: items.map((item) => {
|
|
250
|
+
const url = transactionUrl(item.chain, item.transaction_hash);
|
|
251
|
+
const occurredAt = formatRefundAvailability(item.occurred_at);
|
|
252
|
+
return (_jsxs(Item, { children: [_jsxs(ItemHeader, { children: [_jsx("strong", { children: ITEM_LABELS[item.kind] }), _jsx("span", { children: formatAmount(item.amount, item.token) })] }), _jsxs(ItemMeta, { children: [occurredAt ? (_jsx("time", { dateTime: item.occurred_at, children: occurredAt })) : (_jsx("span", {})), url ? (_jsx("a", { href: url, target: "_blank", rel: "noreferrer", children: shortHash(item.transaction_hash) })) : (_jsx("span", { children: shortHash(item.transaction_hash) }))] }), item.residual_amount && item.residual_amount !== "0" ? (_jsxs(ItemMeta, { children: [_jsx("span", { children: "Left in the payment contract" }), _jsx("span", { children: formatAmount(item.residual_amount, item.token) })] })) : null] }, item.id));
|
|
253
|
+
}) })) : null, nextCursor ? (_jsx(StyledButton, { type: "button", variant: "secondary", size: "small", onClick: () => void loadMore(), disabled: loading, "aria-busy": loading, children: loading ? "Loading..." : "Load more history" })) : null, error ? _jsx(ErrorText, { role: "alert", children: error }) : null] }));
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=funding-timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"funding-timeline.js","sourceRoot":"","sources":["../../../../src/checkout/views/funding-timeline.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACL,wBAAwB,GAEzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OA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