@mintmoney/react 0.2.0-alpha.2 → 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/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 +22 -14
- 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 +140 -44
- package/dist/esm/checkout/providers/checkout-wallet.js.map +1 -1
- package/dist/esm/checkout/providers/wagmi-config.js +6 -3
- 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 +147 -0
- 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 +218 -890
- 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/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 -24
- 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/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 +105 -627
- 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 +4 -11
- 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 -44
- 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 +8 -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 +216 -225
- 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 +3 -9
- package/dist/esm/state/checkout/checkout-state.js.map +1 -1
- 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 +44 -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 +145 -144
- package/dist/esm/state/checkout/quote-lifecycle.js.map +1 -1
- 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 +222 -258
- package/dist/esm/state/checkout/store.js.map +1 -1
- package/dist/esm/state/checkout/wallet-payment.js +123 -32
- package/dist/esm/state/checkout/wallet-payment.js.map +1 -1
- 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 +4562 -707
- 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 +2 -3
- package/dist/types/checkout/providers/checkout-wallet.d.ts.map +1 -1
- 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 -0
- 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/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/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 +1 -1
- 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 +42 -10
- package/dist/types/state/checkout/checkout-state.d.ts.map +1 -1
- 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 +19 -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 +17 -6
- package/dist/types/state/checkout/quote-lifecycle.d.ts.map +1 -1
- 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 +25 -10
- package/dist/types/state/checkout/store.d.ts.map +1 -1
- package/dist/types/state/checkout/wallet-payment.d.ts +13 -2
- package/dist/types/state/checkout/wallet-payment.d.ts.map +1 -1
- 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/refund/confirmation.js +0 -30
- package/dist/esm/refund/confirmation.js.map +0 -1
- package/dist/types/refund/confirmation.d.ts +0 -14
- package/dist/types/refund/confirmation.d.ts.map +0 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { getManualPaymentOptions, } from "../../../api/payments.js";
|
|
3
|
+
import { sourceKey } from "../../../state/checkout/manual-route.js";
|
|
4
|
+
const ETHEREUM_ICON_URL = "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628";
|
|
5
|
+
export const getMonogram = (value) => {
|
|
6
|
+
const parts = value
|
|
7
|
+
.split(/\s+/)
|
|
8
|
+
.map((part) => part.trim())
|
|
9
|
+
.filter(Boolean);
|
|
10
|
+
if (parts.length === 0) {
|
|
11
|
+
return "?";
|
|
12
|
+
}
|
|
13
|
+
if (parts.length === 1) {
|
|
14
|
+
return parts[0].slice(0, 2).toUpperCase();
|
|
15
|
+
}
|
|
16
|
+
return `${parts[0][0]}${parts[1][0]}`.toUpperCase();
|
|
17
|
+
};
|
|
18
|
+
export const getChainAbbreviation = (chainName) => {
|
|
19
|
+
const normalized = chainName.toLowerCase();
|
|
20
|
+
if (normalized === "base")
|
|
21
|
+
return "B";
|
|
22
|
+
if (normalized === "ethereum")
|
|
23
|
+
return "ETH";
|
|
24
|
+
return getMonogram(chainName);
|
|
25
|
+
};
|
|
26
|
+
export const getManualChainIconUrl = (source) => {
|
|
27
|
+
const normalizedChain = source.chain.toLowerCase();
|
|
28
|
+
const normalizedChainName = source.chain_name.toLowerCase();
|
|
29
|
+
if (normalizedChain === "eip155:1" || normalizedChainName === "ethereum") {
|
|
30
|
+
return ETHEREUM_ICON_URL;
|
|
31
|
+
}
|
|
32
|
+
return source.chain_logo_url ?? null;
|
|
33
|
+
};
|
|
34
|
+
export const isEvmAddress = (value) => /^0x[0-9a-fA-F]{40}$/.test(value);
|
|
35
|
+
export const formatManualPaymentAmount = (amount, currency) => {
|
|
36
|
+
const amountText = String(amount);
|
|
37
|
+
return `${amountText} ${currency}`;
|
|
38
|
+
};
|
|
39
|
+
export const shouldUseRawManualAmount = (chainName, currency) => {
|
|
40
|
+
const normalizedChain = chainName.toLowerCase();
|
|
41
|
+
const normalizedCurrency = currency.toLowerCase();
|
|
42
|
+
return (normalizedChain.includes("sepolia") ||
|
|
43
|
+
normalizedChain.includes("testnet") ||
|
|
44
|
+
normalizedCurrency.includes("mock"));
|
|
45
|
+
};
|
|
46
|
+
export const isTestnetOrMockCurrency = (currency) => shouldUseRawManualAmount(currency.chain_name, currency.asset_name) ||
|
|
47
|
+
shouldUseRawManualAmount(currency.chain, currency.asset);
|
|
48
|
+
export const shouldLoadManualPaymentOptions = (currency) => !isTestnetOrMockCurrency(currency);
|
|
49
|
+
export const uniqueSourceOptions = (settlementCurrency, configuredSources) => {
|
|
50
|
+
const options = [settlementCurrency, ...(configuredSources ?? [])];
|
|
51
|
+
const seen = new Set();
|
|
52
|
+
return options.filter((option) => {
|
|
53
|
+
const key = sourceKey(option);
|
|
54
|
+
if (seen.has(key))
|
|
55
|
+
return false;
|
|
56
|
+
seen.add(key);
|
|
57
|
+
return true;
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
export const manualPaymentOptionToCurrency = (option) => ({
|
|
61
|
+
chain: option.from_chain.caip2,
|
|
62
|
+
asset: option.from_token.caip21,
|
|
63
|
+
chain_name: option.from_chain.name,
|
|
64
|
+
asset_name: option.from_token.name,
|
|
65
|
+
asset_id: option.id,
|
|
66
|
+
logo_url: option.from_token.logo_url,
|
|
67
|
+
chain_logo_url: option.from_chain.logo_url,
|
|
68
|
+
});
|
|
69
|
+
export const manualPaymentOptionKey = (option) => `${option.from_chain.caip2}__${option.from_token.caip21}`;
|
|
70
|
+
export const manualOptionLookupKey = (source) => `${source.chain}__${source.asset}`.toLowerCase();
|
|
71
|
+
export const getSourceTokenSymbol = (source, manualOptions) => manualOptions.find((option) => manualPaymentOptionKey(option).toLowerCase() ===
|
|
72
|
+
manualOptionLookupKey(source))?.from_token.symbol ?? source.asset_name;
|
|
73
|
+
export const getSourceTokenGroupKey = (source, manualOptions) => getSourceTokenSymbol(source, manualOptions).toLowerCase();
|
|
74
|
+
export const uniqueSourceTokens = (options, manualOptions) => {
|
|
75
|
+
const seen = new Set();
|
|
76
|
+
return options.filter((option) => {
|
|
77
|
+
const key = getSourceTokenGroupKey(option, manualOptions);
|
|
78
|
+
if (seen.has(key))
|
|
79
|
+
return false;
|
|
80
|
+
seen.add(key);
|
|
81
|
+
return true;
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
export const uniqueSourceChains = (options) => {
|
|
85
|
+
const seen = new Set();
|
|
86
|
+
return options.filter((option) => {
|
|
87
|
+
if (seen.has(option.chain))
|
|
88
|
+
return false;
|
|
89
|
+
seen.add(option.chain);
|
|
90
|
+
return true;
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
export const getManualInstructionSource = (instructions) => {
|
|
94
|
+
if (!instructions)
|
|
95
|
+
return null;
|
|
96
|
+
if ("source_chain" in instructions &&
|
|
97
|
+
"source_token" in instructions &&
|
|
98
|
+
typeof instructions.source_chain === "string" &&
|
|
99
|
+
typeof instructions.source_token === "string") {
|
|
100
|
+
return {
|
|
101
|
+
chain: instructions.source_chain,
|
|
102
|
+
token: instructions.source_token,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const tokenTransferInstructions = instructions;
|
|
106
|
+
if (typeof tokenTransferInstructions.chain === "string" &&
|
|
107
|
+
typeof tokenTransferInstructions.token === "string") {
|
|
108
|
+
return {
|
|
109
|
+
chain: tokenTransferInstructions.chain,
|
|
110
|
+
token: tokenTransferInstructions.token,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* The API's manual payment options for the payment, loaded again only when
|
|
117
|
+
* the payment or the settlement currency changes. Testnet and mock currencies
|
|
118
|
+
* have none.
|
|
119
|
+
*/
|
|
120
|
+
export const useManualPaymentOptions = (paymentId, settlementCurrency) => {
|
|
121
|
+
const requestKey = paymentId &&
|
|
122
|
+
settlementCurrency &&
|
|
123
|
+
shouldLoadManualPaymentOptions(settlementCurrency)
|
|
124
|
+
? `${paymentId}:${sourceKey(settlementCurrency)}`
|
|
125
|
+
: null;
|
|
126
|
+
const [result, setResult] = useState(null);
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
if (!paymentId || !requestKey)
|
|
129
|
+
return;
|
|
130
|
+
let cancelled = false;
|
|
131
|
+
getManualPaymentOptions(paymentId)
|
|
132
|
+
.then((options) => {
|
|
133
|
+
if (cancelled)
|
|
134
|
+
return;
|
|
135
|
+
setResult({ key: requestKey, options, status: "ready" });
|
|
136
|
+
})
|
|
137
|
+
.catch((error) => {
|
|
138
|
+
if (cancelled)
|
|
139
|
+
return;
|
|
140
|
+
console.error("Failed to load manual payment options:", error);
|
|
141
|
+
setResult({ key: requestKey, options: [], status: "failed" });
|
|
142
|
+
});
|
|
143
|
+
return () => {
|
|
144
|
+
cancelled = true;
|
|
145
|
+
};
|
|
146
|
+
}, [requestKey, paymentId]);
|
|
147
|
+
const current = result?.key === requestKey ? result : null;
|
|
148
|
+
return {
|
|
149
|
+
manualPaymentOptions: current?.options ?? [],
|
|
150
|
+
manualPaymentOptionsStatus: requestKey
|
|
151
|
+
? (current?.status ?? "loading")
|
|
152
|
+
: "idle",
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
//# sourceMappingURL=manual-sources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manual-sources.js","sourceRoot":"","sources":["../../../../../src/checkout/views/crypto-intent/manual-sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EACL,uBAAuB,GAExB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOpE,MAAM,iBAAiB,GACrB,kFAAkF,CAA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D,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,IAAI,SAAS;gBAAE,OAAO;YACtB,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;YAC/D,SAAS,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC;QAEL,OAAO,GAAG,EAAE;YACV,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;IAE5B,MAAM,OAAO,GAAG,MAAM,EAAE,GAAG,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3D,OAAO;QACL,oBAAoB,EAAE,OAAO,EAAE,OAAO,IAAI,EAAE;QAC5C,0BAA0B,EAAE,UAAU;YACpC,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,IAAI,SAAS,CAAC;YAChC,CAAC,CAAC,MAAM;KACX,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { BITCOIN, BITCOIN_CHAIN, } from "../../../integrations/bitcoin-source.js";
|
|
2
|
+
import { formatBaseUnits } from "../../../utils/token-amount.js";
|
|
3
|
+
import { formatManualPaymentAmount, shouldUseRawManualAmount, } from "./manual-sources.js";
|
|
4
|
+
const qrAmountParameter = /([?&]uint256=)\d+(?=&|$)/;
|
|
5
|
+
export function manualInstructionsMatchFunding(attempt, shortfall) {
|
|
6
|
+
const instructions = attempt?.payment_instructions;
|
|
7
|
+
if (!attempt)
|
|
8
|
+
return true;
|
|
9
|
+
if (instructions?.type === "token_transfer" &&
|
|
10
|
+
attempt.amount_to_pay &&
|
|
11
|
+
shortfall) {
|
|
12
|
+
// If funding preceded this quote, the estimate can be larger than the
|
|
13
|
+
// newly issued amount. Only a smaller remainder makes these details stale.
|
|
14
|
+
return BigInt(instructions.amount) <= BigInt(shortfall);
|
|
15
|
+
}
|
|
16
|
+
if (instructions?.type !== "relay_deposit_address")
|
|
17
|
+
return true;
|
|
18
|
+
const quotedAmount = instructions.quoted_destination_amount;
|
|
19
|
+
// A legacy Relay quote can be shown for a new payment, but its top-up basis is unknown.
|
|
20
|
+
if (quotedAmount === undefined)
|
|
21
|
+
return shortfall === null;
|
|
22
|
+
return quotedAmount === (shortfall ?? String(attempt.amount));
|
|
23
|
+
}
|
|
24
|
+
export function getManualTransferInstructions(attempt, source, funding, shortfall) {
|
|
25
|
+
if (!attempt)
|
|
26
|
+
return { kind: "missing" };
|
|
27
|
+
const instructions = attempt.payment_instructions;
|
|
28
|
+
const paymentAddress = instructions?.payment_address ?? attempt.destination_address;
|
|
29
|
+
if (!paymentAddress)
|
|
30
|
+
return { kind: "missing" };
|
|
31
|
+
const relay = instructions?.type === "relay_deposit_address";
|
|
32
|
+
const formatted = relay
|
|
33
|
+
? instructions.source_amount_formatted
|
|
34
|
+
: (instructions?.amount_formatted ?? attempt.amount_formatted);
|
|
35
|
+
const raw = relay
|
|
36
|
+
? instructions.source_amount
|
|
37
|
+
: (instructions?.amount ?? String(attempt.amount));
|
|
38
|
+
const useRaw = Boolean(raw) &&
|
|
39
|
+
raw !== String(formatted) &&
|
|
40
|
+
shouldUseRawManualAmount(source.chain, source.currency);
|
|
41
|
+
let amount = useRaw ? raw : formatted;
|
|
42
|
+
let amountUsd = instructions?.amount_usd;
|
|
43
|
+
let symbol = source.currency;
|
|
44
|
+
let qrPayload = instructions?.type === "token_transfer"
|
|
45
|
+
? instructions.qr_payload
|
|
46
|
+
: paymentAddress;
|
|
47
|
+
if (shortfall && !relay && attempt.amount_to_pay === undefined) {
|
|
48
|
+
if (instructions?.type !== "token_transfer" ||
|
|
49
|
+
funding?.token.toLowerCase() !== instructions.token.toLowerCase() ||
|
|
50
|
+
funding.chain.toLowerCase() !== instructions.chain.toLowerCase()) {
|
|
51
|
+
return { kind: "unavailable_top_up" };
|
|
52
|
+
}
|
|
53
|
+
amount = useRaw
|
|
54
|
+
? shortfall
|
|
55
|
+
: formatBaseUnits(shortfall, funding.token_decimals);
|
|
56
|
+
if (amount === null)
|
|
57
|
+
return { kind: "unavailable_top_up" };
|
|
58
|
+
// The original estimate describes the original transfer amount.
|
|
59
|
+
if (shortfall !== raw)
|
|
60
|
+
amountUsd = undefined;
|
|
61
|
+
symbol = instructions.token_symbol;
|
|
62
|
+
// A QR with an unrecognized format must not reuse the original amount.
|
|
63
|
+
qrPayload = qrAmountParameter.test(qrPayload)
|
|
64
|
+
? qrPayload.replace(qrAmountParameter, (_amount, parameter) => `${parameter}${shortfall}`)
|
|
65
|
+
: paymentAddress;
|
|
66
|
+
}
|
|
67
|
+
if (amount == null || amount === "")
|
|
68
|
+
return { kind: "missing" };
|
|
69
|
+
if (relay && instructions.source_chain === BITCOIN_CHAIN) {
|
|
70
|
+
symbol = BITCOIN.symbol;
|
|
71
|
+
qrPayload = BITCOIN.paymentUri(paymentAddress, amount);
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
kind: "ready",
|
|
75
|
+
paymentAddress,
|
|
76
|
+
sendAmount: useRaw
|
|
77
|
+
? String(amount)
|
|
78
|
+
: formatManualPaymentAmount(amount, symbol),
|
|
79
|
+
copyAmount: String(amount),
|
|
80
|
+
qrPayload,
|
|
81
|
+
amountUsd,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=manual-transfer-instructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manual-transfer-instructions.js","sourceRoot":"","sources":["../../../../../src/checkout/views/crypto-intent/manual-transfer-instructions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,aAAa,GACd,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EACL,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,IAAI,MAAM,KAAK,IAAI;YAAE,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,CAAC;QAC3D,gEAAgE;QAChE,IAAI,SAAS,KAAK,GAAG;YAAE,SAAS,GAAG,SAAS,CAAC;QAC7C,MAAM,GAAG,YAAY,CAAC,YAAY,CAAC;QACnC,uEAAuE;QACvE,SAAS,GAAG,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC;YAC3C,CAAC,CAAC,SAAS,CAAC,OAAO,CACf,iBAAiB,EACjB,CAAC,OAAO,EAAE,SAAiB,EAAE,EAAE,CAAC,GAAG,SAAS,GAAG,SAAS,EAAE,CAC3D;YACH,CAAC,CAAC,cAAc,CAAC;IACrB,CAAC;IAED,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,KAAK,EAAE;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAChE,IAAI,KAAK,IAAI,YAAY,CAAC,YAAY,KAAK,aAAa,EAAE,CAAC;QACzD,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QACxB,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC;IACD,OAAO;QACL,IAAI,EAAE,OAAO;QACb,cAAc;QACd,UAAU,EAAE,MAAM;YAChB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;YAChB,CAAC,CAAC,yBAAyB,CAAC,MAAM,EAAE,MAAM,CAAC;QAC7C,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC;QAC1B,SAAS;QACT,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { styled } from "styled-components";
|
|
2
|
+
export const PaymentRouteError = styled.div `
|
|
3
|
+
flex: 0 0 auto;
|
|
4
|
+
min-block-size: 1.45em;
|
|
5
|
+
overflow-wrap: anywhere;
|
|
6
|
+
font-size: 13px;
|
|
7
|
+
line-height: 1.45;
|
|
8
|
+
color: #b91c1c;
|
|
9
|
+
`;
|
|
10
|
+
//# sourceMappingURL=payment-route-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-route-error.js","sourceRoot":"","sources":["../../../../../src/checkout/views/crypto-intent/payment-route-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAO1C,CAAC"}
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useMemo } from "react";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useId, useMemo, useState } from "react";
|
|
3
3
|
import { styled } from "styled-components";
|
|
4
|
+
import { getPaymentRefundStatus } from "../../../api/payments.js";
|
|
4
5
|
import { PaymentStatus } from "../../../api/types.js";
|
|
5
|
-
import { useModalWithView, Loader, Text } from "../../../components/index.js";
|
|
6
|
+
import { useModalWithView, Loader, StyledButton, Text, } from "../../../components/index.js";
|
|
6
7
|
import { useMintMoneyConfig } from "../../../context.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
8
|
+
import { BITCOIN_EXPLORER_URL } from "../../../integrations/bitcoin-network.js";
|
|
9
|
+
import { BITCOIN_CHAIN } from "../../../integrations/bitcoin-source.js";
|
|
10
|
+
import { checkoutPhaseContext, getUncertainBitcoinSend, } from "../../../state/checkout/bitcoin-payment.js";
|
|
11
|
+
import { isPaymentConfirmed } from "../../../state/checkout/payment-lifecycle.js";
|
|
12
|
+
import { derivePaymentPhase, holdsPendingFunds, isAwaitingDeposit, isPendingPhase, } from "../../../state/checkout/payment-phase.js";
|
|
13
|
+
import { useCheckoutStore } from "../../../state/checkout/store.js";
|
|
14
|
+
import { claimableRefundUrl } from "../../claimable-funds.js";
|
|
15
|
+
import { confirmingTransfer, resolvePaymentStatus, } from "../../payment-status.js";
|
|
16
|
+
import { providerStatusLabel } from "../../provider-status.js";
|
|
9
17
|
import { formatRefundAvailability } from "../../refund-availability.js";
|
|
18
|
+
import { isManualTransfer, pendingManualTransfer, readCheckoutResumeState, writeCheckoutResumeState, } from "../../resume-state.js";
|
|
19
|
+
import { FundingProgress, PaymentFundingTimeline, settlementTokenSymbol, } from "../funding-timeline.js";
|
|
20
|
+
import { usePaymentReadKey } from "../payment-follower.js";
|
|
10
21
|
const Container = styled.div `
|
|
11
22
|
display: flex;
|
|
12
23
|
flex-direction: column;
|
|
@@ -31,6 +42,31 @@ const StatusText = styled.div `
|
|
|
31
42
|
max-width: 270px;
|
|
32
43
|
align-items: center;
|
|
33
44
|
`;
|
|
45
|
+
const TransferDetails = styled.section `
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
gap: 12px;
|
|
49
|
+
width: 100%;
|
|
50
|
+
text-align: left;
|
|
51
|
+
`;
|
|
52
|
+
const PartialPaymentPanel = styled.div `
|
|
53
|
+
display: grid;
|
|
54
|
+
gap: 14px;
|
|
55
|
+
width: 100%;
|
|
56
|
+
text-align: left;
|
|
57
|
+
`;
|
|
58
|
+
const PartialPaymentHeading = styled.h2 `
|
|
59
|
+
margin: 0;
|
|
60
|
+
color: #172334;
|
|
61
|
+
font-size: 18px;
|
|
62
|
+
line-height: 1.3;
|
|
63
|
+
`;
|
|
64
|
+
const PaymentDeadline = styled.p `
|
|
65
|
+
margin: 0;
|
|
66
|
+
color: #475569;
|
|
67
|
+
font-size: 13px;
|
|
68
|
+
line-height: 1.4;
|
|
69
|
+
`;
|
|
34
70
|
const ProviderPill = styled.div `
|
|
35
71
|
border-radius: 999px;
|
|
36
72
|
background: #f3f4f6;
|
|
@@ -40,21 +76,38 @@ const ProviderPill = styled.div `
|
|
|
40
76
|
padding: 6px 10px;
|
|
41
77
|
`;
|
|
42
78
|
export const CryptoIntentPaymentStatusViewContent = ({ onSuccess, }) => {
|
|
43
|
-
const { goToView } = useModalWithView();
|
|
79
|
+
const { goToView, viewProps } = useModalWithView();
|
|
44
80
|
const config = useMintMoneyConfig();
|
|
81
|
+
// Re-evaluate the local journal and deadline even when the API read is unchanged.
|
|
82
|
+
usePaymentReadKey();
|
|
45
83
|
const { payment } = useCheckoutStore();
|
|
84
|
+
const [showDetails, setShowDetails] = useState(false);
|
|
85
|
+
const detailsId = useId();
|
|
46
86
|
const confirmationStatus = config.cryptoCheckoutConfig.paymentConfirmationStatus;
|
|
47
|
-
const useSyntheticTestStatus = isTestMode();
|
|
48
87
|
const instructions = payment?.payment_attempt?.payment_instructions;
|
|
49
|
-
const
|
|
50
|
-
|
|
88
|
+
const progress = payment?.timeline?.provider_progress;
|
|
89
|
+
const providerStatus = progress?.status ??
|
|
90
|
+
(instructions?.type === "relay_deposit_address"
|
|
91
|
+
? instructions.provider_status
|
|
92
|
+
: null);
|
|
93
|
+
const bitcoinWallet = payment?.payment_attempt?.routing?.source?.chain === BITCOIN_CHAIN &&
|
|
94
|
+
payment.payment_attempt.payment_provider === "lifi";
|
|
95
|
+
const providerName = progress?.provider === "lifi" || bitcoinWallet ? "LI.FI" : "Relay";
|
|
96
|
+
const outcome = useMemo(() => resolvePaymentStatus(payment, confirmationStatus), [payment, confirmationStatus]);
|
|
97
|
+
const phase = derivePaymentPhase(payment, checkoutPhaseContext(payment));
|
|
98
|
+
const providerHandlingTransfer = phase.broadcast ||
|
|
99
|
+
providerStatus === "confirming_payment" ||
|
|
100
|
+
providerStatus === "paid" ||
|
|
101
|
+
providerStatus === "refund_pending";
|
|
102
|
+
const uncertainBitcoinSend = payment && (phase.kind === "failed" || isPendingPhase(phase))
|
|
103
|
+
? getUncertainBitcoinSend(payment)
|
|
51
104
|
: null;
|
|
52
|
-
const
|
|
105
|
+
const checkingBitcoinSend = Boolean(uncertainBitcoinSend);
|
|
53
106
|
useEffect(() => {
|
|
107
|
+
if (checkingBitcoinSend && outcome.type === "failed")
|
|
108
|
+
return;
|
|
54
109
|
// Notify synchronously before navigation; merchant promises never block UI.
|
|
55
|
-
if (payment &&
|
|
56
|
-
(outcome.type === "success" ||
|
|
57
|
-
(outcome.type === "hosted" && outcome.successful))) {
|
|
110
|
+
if (payment && isPaymentConfirmed(payment.status, confirmationStatus)) {
|
|
58
111
|
void onSuccess(payment.id);
|
|
59
112
|
}
|
|
60
113
|
switch (outcome.type) {
|
|
@@ -75,24 +128,114 @@ export const CryptoIntentPaymentStatusViewContent = ({ onSuccess, }) => {
|
|
|
75
128
|
goToView("failed", { reason: outcome.reason });
|
|
76
129
|
break;
|
|
77
130
|
}
|
|
78
|
-
}, [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
131
|
+
}, [
|
|
132
|
+
outcome,
|
|
133
|
+
goToView,
|
|
134
|
+
payment,
|
|
135
|
+
onSuccess,
|
|
136
|
+
confirmationStatus,
|
|
137
|
+
checkingBitcoinSend,
|
|
138
|
+
]);
|
|
139
|
+
const funding = payment?.funding;
|
|
140
|
+
const partlyFunded = phase.kind === "partly_funded";
|
|
141
|
+
const paymentWindowClosed = phase.cutoffPassed;
|
|
142
|
+
const paymentId = payment?.id;
|
|
143
|
+
const { manualTransfer } = readCheckoutResumeState(paymentId);
|
|
144
|
+
const awaitingManualTransfer = pendingManualTransfer(payment, manualTransfer ??
|
|
145
|
+
(isManualTransfer(viewProps.manualTransfer)
|
|
146
|
+
? viewProps.manualTransfer
|
|
147
|
+
: null));
|
|
148
|
+
const clearManualTransfer = Boolean(manualTransfer && !awaitingManualTransfer);
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
if (clearManualTransfer)
|
|
151
|
+
writeCheckoutResumeState(paymentId, { manualTransfer: null });
|
|
152
|
+
}, [clearManualTransfer, paymentId]);
|
|
153
|
+
const waitingForRefund = holdsPendingFunds(phase) && paymentWindowClosed;
|
|
154
|
+
const confirmingTopUp = Boolean(awaitingManualTransfer && partlyFunded && !paymentWindowClosed);
|
|
82
155
|
useEffect(() => {
|
|
83
|
-
if (!
|
|
156
|
+
if (!paymentId || !waitingForRefund)
|
|
84
157
|
return;
|
|
85
|
-
|
|
86
|
-
|
|
158
|
+
let active = true;
|
|
159
|
+
void getPaymentRefundStatus(paymentId)
|
|
160
|
+
.then((status) => {
|
|
161
|
+
const refundUrl = claimableRefundUrl(status, {
|
|
162
|
+
requireBalance: false,
|
|
163
|
+
});
|
|
164
|
+
if (active && refundUrl) {
|
|
165
|
+
goToView("refundAvailable", { kind: "refund", refundUrl });
|
|
166
|
+
}
|
|
167
|
+
})
|
|
168
|
+
.catch(() => { });
|
|
87
169
|
return () => {
|
|
88
|
-
|
|
170
|
+
active = false;
|
|
89
171
|
};
|
|
90
|
-
}, [payment
|
|
91
|
-
if (
|
|
172
|
+
}, [payment, paymentId, waitingForRefund, goToView]);
|
|
173
|
+
if (uncertainBitcoinSend) {
|
|
174
|
+
const { txid, canRebroadcast, networkSeen } = uncertainBitcoinSend;
|
|
175
|
+
let title = "Bitcoin payment needs review";
|
|
176
|
+
let message = "Checkout can’t safely resend this transaction. Check it in your wallet and share its ID with the merchant before paying again.";
|
|
177
|
+
if (networkSeen) {
|
|
178
|
+
title = "Bitcoin transfer submitted";
|
|
179
|
+
message =
|
|
180
|
+
"Your original transaction is on the Bitcoin network. Check here for its payment or refund status.";
|
|
181
|
+
}
|
|
182
|
+
else if (canRebroadcast) {
|
|
183
|
+
title = "Checking your Bitcoin transfer";
|
|
184
|
+
message =
|
|
185
|
+
"Checkout is checking your signed transfer and may resend that same transaction.";
|
|
186
|
+
}
|
|
187
|
+
return (_jsxs(PartialPaymentPanel, { children: [_jsx(PartialPaymentHeading, { children: title }), _jsx(PaymentDeadline, { children: message }), _jsx("a", { href: `${BITCOIN_EXPLORER_URL}/tx/${txid}`, target: "_blank", rel: "noreferrer", children: "Check Bitcoin transaction" })] }));
|
|
188
|
+
}
|
|
189
|
+
if (outcome.type !== "processing" && outcome.type !== "provider_returned")
|
|
92
190
|
return null;
|
|
93
191
|
const refundAvailability = payment?.status === PaymentStatus.REFUND_PENDING
|
|
94
192
|
? formatRefundAvailability(payment.refundable_at)
|
|
95
193
|
: null;
|
|
96
|
-
|
|
194
|
+
// A pending payment that holds part of the amount due waits for a top-up.
|
|
195
|
+
// The received amount, shortfall and cutoff are the API's values.
|
|
196
|
+
const cutoff = partlyFunded
|
|
197
|
+
? formatRefundAvailability(funding?.settlement_cutoff_at)
|
|
198
|
+
: null;
|
|
199
|
+
if (outcome.type === "provider_returned") {
|
|
200
|
+
return (_jsxs(PartialPaymentPanel, { children: [_jsx(Text, { weight: "semibold", children: "Transfer returned" }), _jsxs(Text, { size: "sm", children: [outcome.provider, " reported returning this transfer on its source network."] }), !paymentWindowClosed ? (_jsx(StyledButton, { onClick: () => goToView("cryptoIntent"), children: "Choose another method" })) : null] }));
|
|
201
|
+
}
|
|
202
|
+
if ((partlyFunded || waitingForRefund) && !confirmingTopUp) {
|
|
203
|
+
return (_jsxs(PartialPaymentPanel, { children: [_jsx(PartialPaymentHeading, { children: paymentWindowClosed ? "Payment window closed" : outcome.title }), paymentWindowClosed ? (_jsx(PaymentDeadline, { children: "Check back here to claim your refund when it\u2019s ready." })) : (_jsxs(_Fragment, { children: [_jsx(FundingProgress, { funding: funding, tokenSymbol: settlementTokenSymbol(payment?.payment_attempt) }), phase.relayFailed ? (_jsx(PaymentDeadline, { children: "The last transfer couldn\u2019t be completed. You can still send the remaining amount." })) : null, cutoff ? (_jsxs(PaymentDeadline, { children: ["Pay the balance by", " ", _jsx("time", { dateTime: funding?.settlement_cutoff_at ?? undefined, children: cutoff }), "."] })) : null, !providerHandlingTransfer ? (_jsx(StyledButton, { variant: "primary", onClick: () => goToView("cryptoIntentDirectDetails"), children: "Send the remaining amount" })) : null] }))] }));
|
|
204
|
+
}
|
|
205
|
+
const canReturnToInstructions = !providerHandlingTransfer &&
|
|
206
|
+
!paymentWindowClosed &&
|
|
207
|
+
!bitcoinWallet &&
|
|
208
|
+
Boolean(instructions) &&
|
|
209
|
+
(isAwaitingDeposit(phase) || confirmingTopUp);
|
|
210
|
+
const attempt = payment?.payment_attempt;
|
|
211
|
+
const tokenSymbol = settlementTokenSymbol(attempt);
|
|
212
|
+
const canReviewTransfer = !providerHandlingTransfer &&
|
|
213
|
+
!canReturnToInstructions &&
|
|
214
|
+
Boolean(attempt) &&
|
|
215
|
+
(payment?.status === PaymentStatus.CONFIRMING_PAYMENT ||
|
|
216
|
+
Boolean(awaitingManualTransfer));
|
|
217
|
+
const detailsOpen = canReviewTransfer && showDetails;
|
|
218
|
+
const { title, message } = awaitingManualTransfer
|
|
219
|
+
? confirmingTransfer
|
|
220
|
+
: outcome;
|
|
221
|
+
const canGoBackToDetails = canReviewTransfer ||
|
|
222
|
+
Boolean(awaitingManualTransfer) ||
|
|
223
|
+
viewProps.justSubmitted === true;
|
|
224
|
+
return (_jsxs(Container, { children: [_jsx(LoaderWrap, { children: _jsx(Loader, { asChild: true, width: 58, height: 58 }) }), _jsxs(StatusText, { children: [_jsx(Text, { size: "base", weight: "semibold", color: config.theme.font.color.primary, children: title }), message ? (_jsx(Text, { size: "sm", color: config.theme.font.color.secondary, style: { lineHeight: 1.45, textAlign: "center" }, children: message })) : null, refundAvailability ? (_jsxs(Text, { size: "sm", color: config.theme.font.color.secondary, style: { lineHeight: 1.45, textAlign: "center" }, children: ["If settlement does not complete first, your refund will be available after", " ", _jsx("time", { dateTime: payment?.refundable_at ?? undefined, children: refundAvailability }), "."] })) : null] }), providerStatus &&
|
|
225
|
+
providerStatus !== "pending" &&
|
|
226
|
+
!awaitingManualTransfer &&
|
|
227
|
+
!canReviewTransfer ? (_jsxs(ProviderPill, { children: [providerName, " status: ", providerStatusLabel(providerStatus)] })) : null, detailsOpen && payment && attempt ? (_jsxs(TransferDetails, { id: detailsId, "aria-label": "Payment details", children: [_jsxs(Text, { size: "sm", children: [tokenSymbol, " on ", attempt.settlement_config.chain_name] }), _jsx(PaymentFundingTimeline, { paymentId: payment.id, funding: funding, timeline: payment.timeline, tokenSymbol: tokenSymbol })] })) : null, canReturnToInstructions || canReviewTransfer ? (_jsx(StyledButton, { variant: "secondary", "aria-expanded": canReviewTransfer ? detailsOpen : undefined, "aria-controls": detailsOpen ? detailsId : undefined, onClick: () => {
|
|
228
|
+
if (canReviewTransfer) {
|
|
229
|
+
setShowDetails((open) => !open);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
goToView("cryptoIntentDirectDetails", {
|
|
233
|
+
showIssuedInstructions: true,
|
|
234
|
+
});
|
|
235
|
+
}, children: detailsOpen
|
|
236
|
+
? "Hide details"
|
|
237
|
+
: canGoBackToDetails
|
|
238
|
+
? "Back to details"
|
|
239
|
+
: "Show payment details" })) : null] }));
|
|
97
240
|
};
|
|
98
241
|
//# sourceMappingURL=processing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processing.js","sourceRoot":"","sources":["../../../../../src/checkout/views/crypto-intent/processing.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"processing.js","sourceRoot":"","sources":["../../../../../src/checkout/views/crypto-intent/processing.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EACL,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,IAAI,GACL,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE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