@mintmoney/react 0.2.0-alpha.2 → 0.2.0-alpha.4

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.
Files changed (312) hide show
  1. package/dist/css/styles.css +12 -1
  2. package/dist/docs/customisation.md +4 -0
  3. package/dist/docs/quickstart.md +2 -0
  4. package/dist/esm/api/errors.js +89 -0
  5. package/dist/esm/api/errors.js.map +1 -0
  6. package/dist/esm/api/generated.js +825 -65
  7. package/dist/esm/api/generated.js.map +1 -1
  8. package/dist/esm/api/payments.js +36 -2
  9. package/dist/esm/api/payments.js.map +1 -1
  10. package/dist/esm/api/tokens.js +34 -0
  11. package/dist/esm/api/tokens.js.map +1 -0
  12. package/dist/esm/api/types.js.map +1 -1
  13. package/dist/esm/checkout/claimable-funds.js +19 -10
  14. package/dist/esm/checkout/claimable-funds.js.map +1 -1
  15. package/dist/esm/checkout/creation-error-modal.js +2 -2
  16. package/dist/esm/checkout/creation-error-modal.js.map +1 -1
  17. package/dist/esm/checkout/index.js +54 -13
  18. package/dist/esm/checkout/index.js.map +1 -1
  19. package/dist/esm/checkout/modal.js +52 -23
  20. package/dist/esm/checkout/modal.js.map +1 -1
  21. package/dist/esm/checkout/payment-status.js +68 -28
  22. package/dist/esm/checkout/payment-status.js.map +1 -1
  23. package/dist/esm/checkout/provider-status.js +9 -0
  24. package/dist/esm/checkout/provider-status.js.map +1 -0
  25. package/dist/esm/checkout/providers/checkout-wallet.js +140 -44
  26. package/dist/esm/checkout/providers/checkout-wallet.js.map +1 -1
  27. package/dist/esm/checkout/providers/wagmi-config.js +6 -3
  28. package/dist/esm/checkout/providers/wagmi-config.js.map +1 -1
  29. package/dist/esm/checkout/refund-notice.js +16 -0
  30. package/dist/esm/checkout/refund-notice.js.map +1 -0
  31. package/dist/esm/checkout/resume-state.js +207 -1
  32. package/dist/esm/checkout/resume-state.js.map +1 -1
  33. package/dist/esm/checkout/surplus-refund.js +12 -0
  34. package/dist/esm/checkout/surplus-refund.js.map +1 -1
  35. package/dist/esm/checkout/views/amount-header.js +11 -2
  36. package/dist/esm/checkout/views/amount-header.js.map +1 -1
  37. package/dist/esm/checkout/views/claimable-funds.js +21 -13
  38. package/dist/esm/checkout/views/claimable-funds.js.map +1 -1
  39. package/dist/esm/checkout/views/crypto-intent/direct-details.js +288 -888
  40. package/dist/esm/checkout/views/crypto-intent/direct-details.js.map +1 -1
  41. package/dist/esm/checkout/views/crypto-intent/manual-instruction-card.js +239 -0
  42. package/dist/esm/checkout/views/crypto-intent/manual-instruction-card.js.map +1 -0
  43. package/dist/esm/checkout/views/crypto-intent/manual-payment-summary.js +2 -26
  44. package/dist/esm/checkout/views/crypto-intent/manual-payment-summary.js.map +1 -1
  45. package/dist/esm/checkout/views/crypto-intent/manual-refresh.js +19 -0
  46. package/dist/esm/checkout/views/crypto-intent/manual-refresh.js.map +1 -0
  47. package/dist/esm/checkout/views/crypto-intent/manual-refund-preference.js +151 -23
  48. package/dist/esm/checkout/views/crypto-intent/manual-refund-preference.js.map +1 -1
  49. package/dist/esm/checkout/views/crypto-intent/manual-route-picker.js +309 -0
  50. package/dist/esm/checkout/views/crypto-intent/manual-route-picker.js.map +1 -0
  51. package/dist/esm/checkout/views/crypto-intent/manual-sources.js +155 -0
  52. package/dist/esm/checkout/views/crypto-intent/manual-sources.js.map +1 -0
  53. package/dist/esm/checkout/views/crypto-intent/manual-transfer-instructions.js +84 -0
  54. package/dist/esm/checkout/views/crypto-intent/manual-transfer-instructions.js.map +1 -0
  55. package/dist/esm/checkout/views/crypto-intent/payment-route-error.js +10 -0
  56. package/dist/esm/checkout/views/crypto-intent/payment-route-error.js.map +1 -0
  57. package/dist/esm/checkout/views/crypto-intent/processing.js +183 -32
  58. package/dist/esm/checkout/views/crypto-intent/processing.js.map +1 -1
  59. package/dist/esm/checkout/views/crypto-intent/success.js +74 -46
  60. package/dist/esm/checkout/views/crypto-intent/success.js.map +1 -1
  61. package/dist/esm/checkout/views/crypto-intent/wallet-payment-confirmation-amount.js +14 -24
  62. package/dist/esm/checkout/views/crypto-intent/wallet-payment-confirmation-amount.js.map +1 -1
  63. package/dist/esm/checkout/views/crypto-intent/wallet-payment-discovery.js +61 -0
  64. package/dist/esm/checkout/views/crypto-intent/wallet-payment-discovery.js.map +1 -0
  65. package/dist/esm/checkout/views/crypto-intent/wallet-payment-options.js +105 -627
  66. package/dist/esm/checkout/views/crypto-intent/wallet-payment-options.js.map +1 -1
  67. package/dist/esm/checkout/views/crypto-intent/wallet-payment-options.styles.js +506 -0
  68. package/dist/esm/checkout/views/crypto-intent/wallet-payment-options.styles.js.map +1 -0
  69. package/dist/esm/checkout/views/crypto-intent/wallet-select.js +4 -11
  70. package/dist/esm/checkout/views/crypto-intent/wallet-select.js.map +1 -1
  71. package/dist/esm/checkout/views/failed.js +44 -55
  72. package/dist/esm/checkout/views/failed.js.map +1 -1
  73. package/dist/esm/checkout/views/funding-timeline.js +182 -0
  74. package/dist/esm/checkout/views/funding-timeline.js.map +1 -0
  75. package/dist/esm/checkout/views/initial.js +35 -46
  76. package/dist/esm/checkout/views/initial.js.map +1 -1
  77. package/dist/esm/checkout/views/method-select.js +6 -4
  78. package/dist/esm/checkout/views/method-select.js.map +1 -1
  79. package/dist/esm/checkout/views/payment-follower.js +128 -0
  80. package/dist/esm/checkout/views/payment-follower.js.map +1 -0
  81. package/dist/esm/checkout/views/restart.js +17 -2
  82. package/dist/esm/checkout/views/restart.js.map +1 -1
  83. package/dist/esm/checkout/views/use-checkout-refund-status.js +75 -0
  84. package/dist/esm/checkout/views/use-checkout-refund-status.js.map +1 -0
  85. package/dist/esm/components/buttons/index.js +3 -2
  86. package/dist/esm/components/buttons/index.js.map +1 -1
  87. package/dist/esm/components/icons/search.js +5 -0
  88. package/dist/esm/components/icons/search.js.map +1 -0
  89. package/dist/esm/components/loading/index.js +2 -2
  90. package/dist/esm/components/loading/index.js.map +1 -1
  91. package/dist/esm/components/modals/modal-with-views.js +8 -14
  92. package/dist/esm/components/modals/modal-with-views.js.map +1 -1
  93. package/dist/esm/components/modals/modal.js +3 -3
  94. package/dist/esm/components/modals/modal.js.map +1 -1
  95. package/dist/esm/components/modals/transition-view.js +16 -0
  96. package/dist/esm/components/modals/transition-view.js.map +1 -0
  97. package/dist/esm/components/modals/use-modal-with-views.js +17 -19
  98. package/dist/esm/components/modals/use-modal-with-views.js.map +1 -1
  99. package/dist/esm/components/wallet-selector/wallets/wagmi/index.js +36 -2
  100. package/dist/esm/components/wallet-selector/wallets/wagmi/index.js.map +1 -1
  101. package/dist/esm/config.js.map +1 -1
  102. package/dist/esm/integrations/bitcoin-metamask.js +87 -0
  103. package/dist/esm/integrations/bitcoin-metamask.js.map +1 -0
  104. package/dist/esm/integrations/bitcoin-network.js +59 -0
  105. package/dist/esm/integrations/bitcoin-network.js.map +1 -0
  106. package/dist/esm/integrations/bitcoin-psbt.js +4 -0
  107. package/dist/esm/integrations/bitcoin-psbt.js.map +1 -0
  108. package/dist/esm/integrations/bitcoin-source.js +12 -0
  109. package/dist/esm/integrations/bitcoin-source.js.map +1 -0
  110. package/dist/esm/integrations/bitcoin-wallet.js +225 -0
  111. package/dist/esm/integrations/bitcoin-wallet.js.map +1 -0
  112. package/dist/esm/integrations/evm-chain.js +18 -0
  113. package/dist/esm/integrations/evm-chain.js.map +1 -1
  114. package/dist/esm/integrations/guarded-wallet-client.js +19 -0
  115. package/dist/esm/integrations/guarded-wallet-client.js.map +1 -0
  116. package/dist/esm/integrations/lifi.js +134 -45
  117. package/dist/esm/integrations/lifi.js.map +1 -1
  118. package/dist/esm/refund/index.js +237 -227
  119. package/dist/esm/refund/index.js.map +1 -1
  120. package/dist/esm/state/checkout/bitcoin-payment.js +254 -0
  121. package/dist/esm/state/checkout/bitcoin-payment.js.map +1 -0
  122. package/dist/esm/state/checkout/checkout-state.js +5 -11
  123. package/dist/esm/state/checkout/checkout-state.js.map +1 -1
  124. package/dist/esm/state/checkout/funding.js +5 -0
  125. package/dist/esm/state/checkout/funding.js.map +1 -0
  126. package/dist/esm/state/checkout/issuance-conflicts.js +29 -0
  127. package/dist/esm/state/checkout/issuance-conflicts.js.map +1 -0
  128. package/dist/esm/state/checkout/manual-route.js +10 -0
  129. package/dist/esm/state/checkout/manual-route.js.map +1 -0
  130. package/dist/esm/state/checkout/payment-attempt.js +44 -20
  131. package/dist/esm/state/checkout/payment-attempt.js.map +1 -1
  132. package/dist/esm/state/checkout/payment-lifecycle.js +9 -15
  133. package/dist/esm/state/checkout/payment-lifecycle.js.map +1 -1
  134. package/dist/esm/state/checkout/payment-observer.js +148 -0
  135. package/dist/esm/state/checkout/payment-observer.js.map +1 -0
  136. package/dist/esm/state/checkout/payment-phase.js +142 -0
  137. package/dist/esm/state/checkout/payment-phase.js.map +1 -0
  138. package/dist/esm/state/checkout/quote-countdown.js +26 -0
  139. package/dist/esm/state/checkout/quote-countdown.js.map +1 -0
  140. package/dist/esm/state/checkout/quote-lifecycle.js +145 -144
  141. package/dist/esm/state/checkout/quote-lifecycle.js.map +1 -1
  142. package/dist/esm/state/checkout/route-estimate.js +77 -0
  143. package/dist/esm/state/checkout/route-estimate.js.map +1 -0
  144. package/dist/esm/state/checkout/store.js +348 -313
  145. package/dist/esm/state/checkout/store.js.map +1 -1
  146. package/dist/esm/state/checkout/wallet-payment.js +334 -37
  147. package/dist/esm/state/checkout/wallet-payment.js.map +1 -1
  148. package/dist/esm/state/checkout/wallet-transfer-receipt.js +68 -0
  149. package/dist/esm/state/checkout/wallet-transfer-receipt.js.map +1 -0
  150. package/dist/esm/utils/string.js +2 -0
  151. package/dist/esm/utils/string.js.map +1 -1
  152. package/dist/esm/utils/token-amount.js +88 -0
  153. package/dist/esm/utils/token-amount.js.map +1 -0
  154. package/dist/esm/utils/wallet-errors.js +21 -4
  155. package/dist/esm/utils/wallet-errors.js.map +1 -1
  156. package/dist/types/api/errors.d.ts +37 -0
  157. package/dist/types/api/errors.d.ts.map +1 -0
  158. package/dist/types/api/generated.d.ts +4570 -707
  159. package/dist/types/api/generated.d.ts.map +1 -1
  160. package/dist/types/api/payments.d.ts +22 -2
  161. package/dist/types/api/payments.d.ts.map +1 -1
  162. package/dist/types/api/tokens.d.ts +6 -0
  163. package/dist/types/api/tokens.d.ts.map +1 -0
  164. package/dist/types/api/types.d.ts +30 -2
  165. package/dist/types/api/types.d.ts.map +1 -1
  166. package/dist/types/checkout/claimable-funds.d.ts +12 -2
  167. package/dist/types/checkout/claimable-funds.d.ts.map +1 -1
  168. package/dist/types/checkout/creation-error-modal.d.ts +2 -1
  169. package/dist/types/checkout/creation-error-modal.d.ts.map +1 -1
  170. package/dist/types/checkout/index.d.ts +23 -2
  171. package/dist/types/checkout/index.d.ts.map +1 -1
  172. package/dist/types/checkout/modal.d.ts +5 -2
  173. package/dist/types/checkout/modal.d.ts.map +1 -1
  174. package/dist/types/checkout/payment-status.d.ts +10 -2
  175. package/dist/types/checkout/payment-status.d.ts.map +1 -1
  176. package/dist/types/checkout/provider-status.d.ts +11 -0
  177. package/dist/types/checkout/provider-status.d.ts.map +1 -0
  178. package/dist/types/checkout/providers/checkout-wallet.d.ts +2 -3
  179. package/dist/types/checkout/providers/checkout-wallet.d.ts.map +1 -1
  180. package/dist/types/checkout/providers/wagmi-config.d.ts.map +1 -1
  181. package/dist/types/checkout/refund-notice.d.ts +7 -0
  182. package/dist/types/checkout/refund-notice.d.ts.map +1 -0
  183. package/dist/types/checkout/resume-state.d.ts +63 -1
  184. package/dist/types/checkout/resume-state.d.ts.map +1 -1
  185. package/dist/types/checkout/surplus-refund.d.ts +8 -0
  186. package/dist/types/checkout/surplus-refund.d.ts.map +1 -1
  187. package/dist/types/checkout/views/amount-header.d.ts +1 -0
  188. package/dist/types/checkout/views/amount-header.d.ts.map +1 -1
  189. package/dist/types/checkout/views/claimable-funds.d.ts.map +1 -1
  190. package/dist/types/checkout/views/crypto-intent/direct-details.d.ts +3 -13
  191. package/dist/types/checkout/views/crypto-intent/direct-details.d.ts.map +1 -1
  192. package/dist/types/checkout/views/crypto-intent/manual-instruction-card.d.ts +11 -0
  193. package/dist/types/checkout/views/crypto-intent/manual-instruction-card.d.ts.map +1 -0
  194. package/dist/types/checkout/views/crypto-intent/manual-payment-summary.d.ts +4 -11
  195. package/dist/types/checkout/views/crypto-intent/manual-payment-summary.d.ts.map +1 -1
  196. package/dist/types/checkout/views/crypto-intent/manual-refresh.d.ts +4 -0
  197. package/dist/types/checkout/views/crypto-intent/manual-refresh.d.ts.map +1 -0
  198. package/dist/types/checkout/views/crypto-intent/manual-refund-preference.d.ts +14 -10
  199. package/dist/types/checkout/views/crypto-intent/manual-refund-preference.d.ts.map +1 -1
  200. package/dist/types/checkout/views/crypto-intent/manual-route-picker.d.ts +18 -0
  201. package/dist/types/checkout/views/crypto-intent/manual-route-picker.d.ts.map +1 -0
  202. package/dist/types/checkout/views/crypto-intent/manual-sources.d.ts +33 -0
  203. package/dist/types/checkout/views/crypto-intent/manual-sources.d.ts.map +1 -0
  204. package/dist/types/checkout/views/crypto-intent/manual-transfer-instructions.d.ts +18 -0
  205. package/dist/types/checkout/views/crypto-intent/manual-transfer-instructions.d.ts.map +1 -0
  206. package/dist/types/checkout/views/crypto-intent/payment-route-error.d.ts +2 -0
  207. package/dist/types/checkout/views/crypto-intent/payment-route-error.d.ts.map +1 -0
  208. package/dist/types/checkout/views/crypto-intent/processing.d.ts +3 -2
  209. package/dist/types/checkout/views/crypto-intent/processing.d.ts.map +1 -1
  210. package/dist/types/checkout/views/crypto-intent/success.d.ts +2 -1
  211. package/dist/types/checkout/views/crypto-intent/success.d.ts.map +1 -1
  212. package/dist/types/checkout/views/crypto-intent/wallet-payment-confirmation-amount.d.ts +8 -8
  213. package/dist/types/checkout/views/crypto-intent/wallet-payment-confirmation-amount.d.ts.map +1 -1
  214. package/dist/types/checkout/views/crypto-intent/wallet-payment-discovery.d.ts +17 -0
  215. package/dist/types/checkout/views/crypto-intent/wallet-payment-discovery.d.ts.map +1 -0
  216. package/dist/types/checkout/views/crypto-intent/wallet-payment-options.d.ts +2 -1
  217. package/dist/types/checkout/views/crypto-intent/wallet-payment-options.d.ts.map +1 -1
  218. package/dist/types/checkout/views/crypto-intent/wallet-payment-options.styles.d.ts +61 -0
  219. package/dist/types/checkout/views/crypto-intent/wallet-payment-options.styles.d.ts.map +1 -0
  220. package/dist/types/checkout/views/crypto-intent/wallet-select.d.ts +1 -2
  221. package/dist/types/checkout/views/crypto-intent/wallet-select.d.ts.map +1 -1
  222. package/dist/types/checkout/views/failed.d.ts +6 -0
  223. package/dist/types/checkout/views/failed.d.ts.map +1 -1
  224. package/dist/types/checkout/views/funding-timeline.d.ts +21 -0
  225. package/dist/types/checkout/views/funding-timeline.d.ts.map +1 -0
  226. package/dist/types/checkout/views/initial.d.ts +2 -4
  227. package/dist/types/checkout/views/initial.d.ts.map +1 -1
  228. package/dist/types/checkout/views/method-select.d.ts +2 -1
  229. package/dist/types/checkout/views/method-select.d.ts.map +1 -1
  230. package/dist/types/checkout/views/payment-follower.d.ts +12 -0
  231. package/dist/types/checkout/views/payment-follower.d.ts.map +1 -0
  232. package/dist/types/checkout/views/restart.d.ts +1 -1
  233. package/dist/types/checkout/views/restart.d.ts.map +1 -1
  234. package/dist/types/checkout/views/use-checkout-refund-status.d.ts +74 -0
  235. package/dist/types/checkout/views/use-checkout-refund-status.d.ts.map +1 -0
  236. package/dist/types/components/buttons/index.d.ts.map +1 -1
  237. package/dist/types/components/icons/search.d.ts +2 -0
  238. package/dist/types/components/icons/search.d.ts.map +1 -0
  239. package/dist/types/components/loading/index.d.ts +6 -1
  240. package/dist/types/components/loading/index.d.ts.map +1 -1
  241. package/dist/types/components/modals/modal-with-views.d.ts +3 -1
  242. package/dist/types/components/modals/modal-with-views.d.ts.map +1 -1
  243. package/dist/types/components/modals/modal.d.ts +2 -1
  244. package/dist/types/components/modals/modal.d.ts.map +1 -1
  245. package/dist/types/components/modals/transition-view.d.ts +2 -0
  246. package/dist/types/components/modals/transition-view.d.ts.map +1 -0
  247. package/dist/types/components/modals/use-modal-with-views.d.ts +2 -1
  248. package/dist/types/components/modals/use-modal-with-views.d.ts.map +1 -1
  249. package/dist/types/components/wallet-selector/domain.d.ts +1 -1
  250. package/dist/types/components/wallet-selector/domain.d.ts.map +1 -1
  251. package/dist/types/components/wallet-selector/wallets/wagmi/index.d.ts +2 -1
  252. package/dist/types/components/wallet-selector/wallets/wagmi/index.d.ts.map +1 -1
  253. package/dist/types/config.d.ts +2 -0
  254. package/dist/types/config.d.ts.map +1 -1
  255. package/dist/types/integrations/bitcoin-metamask.d.ts +11 -0
  256. package/dist/types/integrations/bitcoin-metamask.d.ts.map +1 -0
  257. package/dist/types/integrations/bitcoin-network.d.ts +13 -0
  258. package/dist/types/integrations/bitcoin-network.d.ts.map +1 -0
  259. package/dist/types/integrations/bitcoin-psbt.d.ts +5 -0
  260. package/dist/types/integrations/bitcoin-psbt.d.ts.map +1 -0
  261. package/dist/types/integrations/bitcoin-source.d.ts +12 -0
  262. package/dist/types/integrations/bitcoin-source.d.ts.map +1 -0
  263. package/dist/types/integrations/bitcoin-wallet.d.ts +63 -0
  264. package/dist/types/integrations/bitcoin-wallet.d.ts.map +1 -0
  265. package/dist/types/integrations/evm-chain.d.ts +5 -0
  266. package/dist/types/integrations/evm-chain.d.ts.map +1 -1
  267. package/dist/types/integrations/guarded-wallet-client.d.ts +4 -0
  268. package/dist/types/integrations/guarded-wallet-client.d.ts.map +1 -0
  269. package/dist/types/integrations/lifi.d.ts +42 -0
  270. package/dist/types/integrations/lifi.d.ts.map +1 -1
  271. package/dist/types/refund/index.d.ts +1 -1
  272. package/dist/types/refund/index.d.ts.map +1 -1
  273. package/dist/types/state/checkout/bitcoin-payment.d.ts +28 -0
  274. package/dist/types/state/checkout/bitcoin-payment.d.ts.map +1 -0
  275. package/dist/types/state/checkout/checkout-state.d.ts +46 -13
  276. package/dist/types/state/checkout/checkout-state.d.ts.map +1 -1
  277. package/dist/types/state/checkout/funding.d.ts +6 -0
  278. package/dist/types/state/checkout/funding.d.ts.map +1 -0
  279. package/dist/types/state/checkout/issuance-conflicts.d.ts +22 -0
  280. package/dist/types/state/checkout/issuance-conflicts.d.ts.map +1 -0
  281. package/dist/types/state/checkout/manual-route.d.ts +13 -0
  282. package/dist/types/state/checkout/manual-route.d.ts.map +1 -0
  283. package/dist/types/state/checkout/payment-attempt.d.ts +19 -1
  284. package/dist/types/state/checkout/payment-attempt.d.ts.map +1 -1
  285. package/dist/types/state/checkout/payment-lifecycle.d.ts +6 -8
  286. package/dist/types/state/checkout/payment-lifecycle.d.ts.map +1 -1
  287. package/dist/types/state/checkout/payment-observer.d.ts +42 -0
  288. package/dist/types/state/checkout/payment-observer.d.ts.map +1 -0
  289. package/dist/types/state/checkout/payment-phase.d.ts +118 -0
  290. package/dist/types/state/checkout/payment-phase.d.ts.map +1 -0
  291. package/dist/types/state/checkout/quote-countdown.d.ts +15 -0
  292. package/dist/types/state/checkout/quote-countdown.d.ts.map +1 -0
  293. package/dist/types/state/checkout/quote-lifecycle.d.ts +17 -6
  294. package/dist/types/state/checkout/quote-lifecycle.d.ts.map +1 -1
  295. package/dist/types/state/checkout/route-estimate.d.ts +38 -0
  296. package/dist/types/state/checkout/route-estimate.d.ts.map +1 -0
  297. package/dist/types/state/checkout/store.d.ts +35 -15
  298. package/dist/types/state/checkout/store.d.ts.map +1 -1
  299. package/dist/types/state/checkout/wallet-payment.d.ts +15 -2
  300. package/dist/types/state/checkout/wallet-payment.d.ts.map +1 -1
  301. package/dist/types/state/checkout/wallet-transfer-receipt.d.ts +18 -0
  302. package/dist/types/state/checkout/wallet-transfer-receipt.d.ts.map +1 -0
  303. package/dist/types/utils/string.d.ts +2 -0
  304. package/dist/types/utils/string.d.ts.map +1 -1
  305. package/dist/types/utils/token-amount.d.ts +18 -0
  306. package/dist/types/utils/token-amount.d.ts.map +1 -0
  307. package/dist/types/utils/wallet-errors.d.ts.map +1 -1
  308. package/package.json +3 -1
  309. package/dist/esm/refund/confirmation.js +0 -30
  310. package/dist/esm/refund/confirmation.js.map +0 -1
  311. package/dist/types/refund/confirmation.d.ts +0 -14
  312. package/dist/types/refund/confirmation.d.ts.map +0 -1
@@ -1,11 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from "react";
2
+ import { useEffect } from "react";
3
3
  import { styled } from "styled-components";
4
- import { getPaymentRefundStatus } from "../../api/payments.js";
5
4
  import { AlertCircleIcon } from "../../components/icons/alert.js";
6
5
  import { useModalWithView } from "../../components/modals/use-modal-with-views.js";
7
6
  import { Text } from "../../components/text/index.js";
7
+ import { useMintMoneyConfig } from "../../context.js";
8
+ import { isPaymentConfirmed } from "../../state/checkout/payment-lifecycle.js";
9
+ import { derivePaymentPhase } from "../../state/checkout/payment-phase.js";
8
10
  import { useCheckoutStore } from "../../state/checkout/store.js";
11
+ import { claimableRefundUrl, isRefundOpeningSoon } from "../claimable-funds.js";
12
+ import { useCheckoutRefundStatus } from "./use-checkout-refund-status.js";
9
13
  const FailedContainer = styled.div `
10
14
  display: flex;
11
15
  flex-direction: column;
@@ -28,64 +32,49 @@ const REASON_MESSAGES = {
28
32
  };
29
33
  const describeReason = (reason) => (reason && (REASON_MESSAGES[reason] ?? reason)) ||
30
34
  "Something went wrong with your payment. You can try again.";
35
+ const CLOSED_PAYMENT_MESSAGE = "This payment has ended.";
36
+ const REFUND_PREPARING_MESSAGE = "Your refund is being prepared — this page will update shortly.";
37
+ /**
38
+ * A reason identifies a retryable error in loading, confirming or sending.
39
+ * A terminal API failure requires a new payment link.
40
+ */
41
+ export const canTryFailedPaymentAgain = (payment, reason) => Boolean(reason) || derivePaymentPhase(payment).kind !== "failed";
31
42
  export const FailedViewContent = () => {
32
43
  const { goToView, viewProps } = useModalWithView();
44
+ const config = useMintMoneyConfig();
33
45
  const reason = viewProps.reason;
34
46
  const { payment, cryptoPaymentAttempt } = useCheckoutStore();
35
- const [refundOpeningSoon, setRefundOpeningSoon] = useState(false);
47
+ // A failed payment can still settle: a settlement that lands before refunds
48
+ // open makes it paid (QCT D4). The payment status view then shows success and
49
+ // notifies the merchant, so this view follows the polled payment there.
50
+ const settled = isPaymentConfirmed(payment?.status, config.cryptoCheckoutConfig.paymentConfirmationStatus);
36
51
  useEffect(() => {
37
- let cancelled = false;
38
- let retryTimeout;
39
- setRefundOpeningSoon(false);
40
- const paymentId = payment?.id;
41
- if (!paymentId || (!payment?.payment_attempt && !cryptoPaymentAttempt)) {
52
+ if (settled)
53
+ goToView("paymentStatus");
54
+ }, [goToView, settled]);
55
+ const attemptId = cryptoPaymentAttempt?.attempt_id ?? payment?.payment_attempt?.attempt_id;
56
+ const refundStatus = useCheckoutRefundStatus({
57
+ paymentId: payment?.id,
58
+ attemptId,
59
+ enabled: Boolean(attemptId) && !settled && !payment?.is_test,
60
+ });
61
+ const refundOpeningSoon = refundStatus?.attempt_status === "failed" &&
62
+ isRefundOpeningSoon(refundStatus);
63
+ useEffect(() => {
64
+ if (!refundStatus)
42
65
  return;
43
- }
44
- // Best-effort: a failed crypto payment is usually a contract-level
45
- // underpayment/late settlement, in which case the receiver still holds the
46
- // funds and the payer can self-serve a refund. Surface that as "Get refund".
47
- const loadRefundStatus = async () => {
48
- try {
49
- const status = await getPaymentRefundStatus(paymentId);
50
- if (cancelled)
51
- return;
52
- const openingSoon = status.attempt_status === "failed" &&
53
- status.current_refundable_balance !== "0" &&
54
- Boolean(status.refund_url);
55
- setRefundOpeningSoon(openingSoon);
56
- if (status.attempt_status === "refund_available" &&
57
- status.current_refundable_balance !== "0" &&
58
- status.refund_url) {
59
- goToView("refundAvailable", {
60
- kind: "refund",
61
- refundUrl: status.refund_url,
62
- });
63
- return;
64
- }
65
- // The on-chain refund window can open moments after the payment fails;
66
- // refresh once that timestamp passes so the CTA appears without a reload.
67
- if (openingSoon) {
68
- const retryInMs = new Date(status.expires_at).getTime() - Date.now();
69
- if (retryInMs > 0) {
70
- retryTimeout = setTimeout(() => void loadRefundStatus(), retryInMs + 1000);
71
- }
72
- }
73
- }
74
- catch {
75
- // Refund status is supplementary; ignore failures and show the generic
76
- // "try again" message.
77
- }
78
- };
79
- void loadRefundStatus();
80
- return () => {
81
- cancelled = true;
82
- if (retryTimeout)
83
- clearTimeout(retryTimeout);
84
- };
85
- }, [cryptoPaymentAttempt, goToView, payment?.id, payment?.payment_attempt]);
86
- const message = refundOpeningSoon
87
- ? "Your refund is being prepared — this page will update shortly."
88
- : describeReason(reason);
89
- 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 })] }));
66
+ const refundUrl = claimableRefundUrl(refundStatus, {
67
+ requireBalance: true,
68
+ });
69
+ if (refundUrl)
70
+ goToView("refundAvailable", { kind: "refund", refundUrl });
71
+ }, [goToView, refundStatus]);
72
+ const retryable = canTryFailedPaymentAgain(payment, reason);
73
+ const message = !retryable
74
+ ? CLOSED_PAYMENT_MESSAGE
75
+ : refundOpeningSoon
76
+ ? REFUND_PREPARING_MESSAGE
77
+ : describeReason(reason);
78
+ 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] }));
90
79
  };
91
80
  //# sourceMappingURL=failed.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"failed.js","sourceRoot":"","sources":["../../../../src/checkout/views/failed.tsx"],"names":[],"mappings":";AAAA,OAAO,EA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1B,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAE7B,OAAO,CACL,MAAC,eAAe,eACd,KAAC,aAAa,cACZ,KAAC,eAAe,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,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,IACQ,CACnB,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,182 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { styled } from "styled-components";
3
+ import { fundingShortfall, hasReceivedFunds, } from "../../state/checkout/funding.js";
4
+ import { fallbackTokenDecimals, formatTokenValue, transactionUrl, } from "../../utils/token-amount.js";
5
+ import { providerStatusLabel } from "../provider-status.js";
6
+ import { formatRefundAvailability } from "../refund-availability.js";
7
+ const Section = styled.section `
8
+ display: flex;
9
+ flex-direction: column;
10
+ gap: 12px;
11
+ width: 100%;
12
+ color: inherit;
13
+ text-align: left;
14
+ `;
15
+ const Heading = styled.h3 `
16
+ margin: 0;
17
+ font-size: 13px;
18
+ line-height: 1.3;
19
+ font-weight: 600;
20
+ letter-spacing: 0.04em;
21
+ text-transform: uppercase;
22
+ opacity: 0.7;
23
+ `;
24
+ const Rows = styled.dl `
25
+ margin: 0;
26
+ display: flex;
27
+ flex-direction: column;
28
+ border: 1px solid rgba(148, 163, 184, 0.28);
29
+ border-radius: 14px;
30
+ overflow: hidden;
31
+ `;
32
+ const FundingRows = styled(Rows) `
33
+ background: #f6f8fa;
34
+ color: #172334;
35
+
36
+ dt {
37
+ color: #475569;
38
+ opacity: 1;
39
+ }
40
+ `;
41
+ const Row = styled.div `
42
+ display: flex;
43
+ justify-content: space-between;
44
+ gap: 16px;
45
+ padding: 10px 14px;
46
+ font-size: 14px;
47
+ line-height: 1.4;
48
+ border-bottom: 1px solid rgba(148, 163, 184, 0.28);
49
+
50
+ &:last-child {
51
+ border-bottom: 0;
52
+ }
53
+
54
+ dt {
55
+ opacity: 0.75;
56
+ }
57
+
58
+ dd {
59
+ margin: 0;
60
+ font-weight: 600;
61
+ text-align: right;
62
+ overflow-wrap: anywhere;
63
+ }
64
+ `;
65
+ const Note = styled.p `
66
+ margin: 0;
67
+ font-size: 13px;
68
+ line-height: 1.45;
69
+ opacity: 0.8;
70
+ `;
71
+ const Items = styled.ol `
72
+ margin: 0;
73
+ padding: 4px 14px 0;
74
+ list-style: none;
75
+ display: flex;
76
+ flex-direction: column;
77
+ gap: 14px;
78
+ `;
79
+ const HiddenTransactions = styled(Note) `
80
+ display: flex;
81
+ align-items: center;
82
+ gap: 8px;
83
+ margin-block: -4px;
84
+ font-size: 12px;
85
+
86
+ span {
87
+ font-size: 16px;
88
+ line-height: 1;
89
+ }
90
+ `;
91
+ const Item = styled.li `
92
+ display: flex;
93
+ flex-direction: column;
94
+ gap: 2px;
95
+ font-size: 14px;
96
+ line-height: 1.4;
97
+ `;
98
+ const ItemHeader = styled.div `
99
+ display: flex;
100
+ justify-content: space-between;
101
+ gap: 12px;
102
+
103
+ strong {
104
+ font-weight: 600;
105
+ }
106
+
107
+ span {
108
+ font-variant-numeric: tabular-nums;
109
+ }
110
+ `;
111
+ const ItemMeta = styled.div `
112
+ display: flex;
113
+ justify-content: space-between;
114
+ gap: 12px;
115
+ font-size: 12px;
116
+ opacity: 0.75;
117
+
118
+ time {
119
+ text-wrap: balance;
120
+ }
121
+
122
+ a {
123
+ color: inherit;
124
+ }
125
+ `;
126
+ const ITEM_LABELS = {
127
+ deposit: "Deposit",
128
+ settlement: "Settlement",
129
+ claim: "Refund claim",
130
+ };
131
+ const shortHash = (hash) => `${hash.slice(0, 10)}...${hash.slice(-6)}`;
132
+ const providerName = (provider) => provider ? `${provider.charAt(0).toUpperCase()}${provider.slice(1)}` : "";
133
+ /** The settlement token's symbol from issued instructions, else its name. */
134
+ export const settlementTokenSymbol = (attempt) => attempt?.payment_instructions?.type === "token_transfer"
135
+ ? attempt.payment_instructions.token_symbol
136
+ : (attempt?.settlement_config?.asset_name ?? null);
137
+ 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;
138
+ /** "Received" and, while something is missing, "Still needed". */
139
+ const ReceivedRows = ({ funding, formatAmount, }) => {
140
+ const shortfall = fundingShortfall(funding);
141
+ 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] }));
142
+ };
143
+ /**
144
+ * What a partly funded payment has received and still needs, as the API
145
+ * reports it. Hidden until something arrives.
146
+ */
147
+ export function FundingProgress({ funding, tokenSymbol, }) {
148
+ if (!funding || !hasReceivedFunds(funding))
149
+ return null;
150
+ 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 })] }));
151
+ }
152
+ /** Renders funding balances and a short preview of confirmed transactions. */
153
+ export function PaymentFundingTimeline({ funding, timeline, tokenSymbol, }) {
154
+ const allItems = timeline?.items ?? [];
155
+ const hasHiddenTransactions = allItems.length > 3 ||
156
+ Boolean(timeline?.has_hidden_transactions || timeline?.next_cursor);
157
+ const items = allItems.length > 0 && hasHiddenTransactions
158
+ ? [allItems[0], null, ...allItems.slice(Math.max(1, allItems.length - 2))]
159
+ : allItems;
160
+ const providerProgress = timeline?.provider_progress ?? null;
161
+ const earlierReturn = timeline?.provider_return?.recovery === "refunded";
162
+ if (!funding &&
163
+ items.length === 0 &&
164
+ !providerProgress &&
165
+ !earlierReturn &&
166
+ !hasHiddenTransactions)
167
+ return null;
168
+ // History items are in the settlement token, so the funding's decimals apply.
169
+ const decimals = funding
170
+ ? (funding.token_decimals ?? fallbackTokenDecimals(funding.token))
171
+ : null;
172
+ const formatAmount = (rawAmount, token) => formatTokenValue(rawAmount, token, decimals, tokenSymbol);
173
+ return (_jsxs(Section, { children: [_jsx(Heading, { children: "Transaction preview" }), 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) })] })] })) : null, funding ? _jsx(ReconciliationNote, { funding: funding }) : null, providerProgress || earlierReturn ? (_jsxs(Rows, { "aria-label": "Provider progress", children: [providerProgress ? (_jsxs(Row, { children: [_jsx("dt", { children: `${providerName(providerProgress.provider)} status` }), _jsx("dd", { children: providerStatusLabel(providerProgress.status) })] })) : null, earlierReturn ? (_jsxs(Row, { children: [_jsx("dt", { children: "Earlier transfer" }), _jsx("dd", { children: "Returned" })] })) : null] })) : null, items.length > 0 ? (_jsx(Items, { "aria-label": "Confirmed transactions", children: items.map((item) => {
174
+ if (!item) {
175
+ return (_jsxs(HiddenTransactions, { as: "li", role: "presentation", children: [_jsx("span", { "aria-hidden": "true", children: "\u22EE" }), "Other transactions hidden"] }, "hidden"));
176
+ }
177
+ const url = transactionUrl(item.chain, item.transaction_hash);
178
+ const occurredAt = formatRefundAvailability(item.occurred_at);
179
+ 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));
180
+ }) })) : null, hasHiddenTransactions && items.length === 0 ? (_jsx(Note, { children: "Other transactions hidden" })) : null] }));
181
+ }
182
+ //# 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,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EACL,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AASrE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;;;;;;;C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AC1C,IACE,CACZ,CAAC,CAAC,CAAC,IAAI,KA1BC,IAAI,CAAC,EAAE,CA2BX,CACR,CAAC;gBACJ,CAAC,CAAC,GACI,CACT,CAAC,CAAC,CAAC,IAAI,EACP,qBAAqB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAC7C,KAAC,IAAI,4CAAiC,CACvC,CAAC,CAAC,CAAC,IAAI,IACA,CACX,CAAC;AACJ,CAAC"}
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from "react";
3
3
  import { styled } from "styled-components";
4
- import { PaymentStatus } from "../../api/types.js";
5
4
  import { Loader, useModalWithView } from "../../components/index.js";
6
- import { canCreateFreshAttempt } from "../../state/checkout/payment-lifecycle.js";
7
- import { ACTIONS, initialiseStore, useCheckoutStore, } from "../../state/checkout/store.js";
8
- import { isResumableCheckoutView, readCheckoutResumeState, } from "../resume-state.js";
5
+ import { checkoutPhaseContext } from "../../state/checkout/bitcoin-payment.js";
6
+ import { ACTIONS, getCurrentWalletTopUp, initialiseStore, useCheckoutStore, } from "../../state/checkout/store.js";
7
+ import { readCheckoutResumeState, resolveInitialCheckoutView, } from "../resume-state.js";
8
+ import { ManualPaymentRefresh } from "./crypto-intent/manual-refresh.js";
9
9
  const LoadingPanel = styled.div `
10
10
  width: 100%;
11
11
  flex: 1;
@@ -14,48 +14,11 @@ const LoadingPanel = styled.div `
14
14
  align-items: center;
15
15
  justify-content: center;
16
16
  `;
17
- const hasRelayDepositAttempt = (payment) => {
18
- const instructions = payment?.payment_attempt?.payment_instructions;
19
- return instructions?.type === "relay_deposit_address";
20
- };
21
- export const shouldResumeRelayProcessing = (payment) => {
22
- if (!hasRelayDepositAttempt(payment))
23
- return false;
24
- if (payment?.status === PaymentStatus.FAILED)
25
- return false;
26
- if (!canCreateFreshAttempt(payment)) {
27
- return true;
28
- }
29
- const instructions = payment?.payment_attempt?.payment_instructions;
30
- const providerStatus = instructions?.type === "relay_deposit_address"
31
- ? instructions.provider_status
32
- : payment?.payment_attempt?.provider_status;
33
- const normalizedProviderStatus = providerStatus?.trim().toLowerCase();
34
- return Boolean(normalizedProviderStatus &&
35
- normalizedProviderStatus !== "waiting" &&
36
- normalizedProviderStatus !== "created");
37
- };
38
- export const getInitialCheckoutView = (payment) => shouldResumeRelayProcessing(payment) ? "paymentStatus" : "methods";
39
- export const canResumePaymentStatusView = (payment) => Boolean(payment &&
40
- payment.status !== PaymentStatus.FAILED &&
41
- (!canCreateFreshAttempt(payment) || shouldResumeRelayProcessing(payment)));
42
- export const resolveInitialCheckoutView = (payment, persistedView) => {
43
- // A funded payment owns the destination, even if the payer last visited
44
- // manual instructions or wallet selection before leaving checkout.
45
- if (persistedView && canResumePaymentStatusView(payment)) {
46
- return "paymentStatus";
47
- }
48
- if (persistedView && !isResumableCheckoutView(persistedView)) {
49
- persistedView = null;
50
- }
51
- if (persistedView === "paymentStatus") {
52
- return getInitialCheckoutView(payment);
53
- }
54
- return persistedView || getInitialCheckoutView(payment);
55
- };
56
17
  const InitialiseCheckoutViewContent = (props) => {
57
18
  const { goToView } = useModalWithView();
58
- const { error, checkout, payment } = useCheckoutStore();
19
+ const state = useCheckoutStore();
20
+ const { error, checkout, payment, manualTransfer } = state;
21
+ const walletTopUp = getCurrentWalletTopUp(state);
59
22
  const [loading, setLoading] = useState(true);
60
23
  useEffect(() => {
61
24
  let cancelled = false;
@@ -76,10 +39,36 @@ const InitialiseCheckoutViewContent = (props) => {
76
39
  return;
77
40
  }
78
41
  if (checkout && payment && !loading) {
42
+ if (props.resumePaymentSelection &&
43
+ payment.status === "pending" &&
44
+ !payment.payment_attempt) {
45
+ const selection = props.resumePaymentSelection;
46
+ goToView(selection.kind === "manual"
47
+ ? "cryptoIntentDirectDetails"
48
+ : "cryptoIntentWalletPaymentOptions", { resumePaymentSelection: selection });
49
+ return;
50
+ }
79
51
  const resumeView = readCheckoutResumeState(payment.id).view;
80
- goToView(resolveInitialCheckoutView(payment, resumeView));
52
+ const context = checkoutPhaseContext(payment);
53
+ goToView(resolveInitialCheckoutView(payment, resumeView, {
54
+ ...context,
55
+ walletBroadcast: Boolean(walletTopUp) || context.walletBroadcast,
56
+ }, manualTransfer));
81
57
  }
82
- }, [error, checkout, payment, props.payment, loading, goToView]);
58
+ }, [
59
+ error,
60
+ checkout,
61
+ payment,
62
+ props.payment,
63
+ props.resumePaymentSelection,
64
+ loading,
65
+ goToView,
66
+ manualTransfer,
67
+ walletTopUp,
68
+ ]);
69
+ if (props.resumePaymentSelection?.kind === "manual") {
70
+ return _jsx(ManualPaymentRefresh, {});
71
+ }
83
72
  return loading ? (_jsx(LoadingPanel, { children: _jsx(Loader, { asChild: true }) })) : null;
84
73
  };
85
74
  export { InitialiseCheckoutViewContent };
@@ -1 +1 @@
1
- {"version":3,"file":"initial.js","sourceRoot":"","sources":["../../../../src/checkout/views/initial.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAW,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EACL,OAAO,EACP,eAAe,EACf,gBAAgB,GACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAM5B,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAO9B,CAAC;AAEF,MAAM,sBAAsB,GAAG,CAAC,OAAuB,EAAW,EAAE;IAClE,MAAM,YAAY,GAAG,OAAO,EAAE,eAAe,EAAE,oBAAoB,CAAC;IACpE,OAAO,YAAY,EAAE,IAAI,KAAK,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C;gBACD,MAAM,SAAS,GAAG,KAAK,CAAC,sBAAsB,CAAC;gBAC/C,QAAQ,CACN,SAAS,CAAC,IAAI,KAAK,QAAQ;oBACzB,CAAC,CAAC,2BAA2B;oBAC7B,CAAC,CAAC,kCAAkC,EACtC,EAAE,sBAAsB,EAAE,SAAS,EAAE,CACtC,CAAC;gBACF,OAAO;YACT,CAAC;YACD,MAAM,UAAU,GAAG,uBAAuB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC;YAC5D,MAAM,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;YAC9C,QAAQ,CACN,0BAA0B,CACxB,OAAO,EACP,UAAU,EACV;gBACE,GAAG,OAAO;gBACV,eAAe,EAAE,OAAO,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC,eAAe;aACjE,EACD,cAAc,CACf,CACF,CAAC;QACJ,CAAC;IACH,CAAC,EAAE;QACD,KAAK;QACL,QAAQ;QACR,OAAO;QACP,KAAK,CAAC,OAAO;QACb,KAAK,CAAC,sBAAsB;QAC5B,OAAO;QACP,QAAQ;QACR,cAAc;QACd,WAAW;KACZ,CAAC,CAAC;IAEH,IAAI,KAAK,CAAC,sBAAsB,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;QACpD,OAAO,KAAC,oBAAoB,KAAG,CAAC;IAClC,CAAC;IAED,OAAO,OAAO,CAAC,CAAC,CAAC,CACf,KAAC,YAAY,cACX,KAAC,MAAM,IAAC,OAAO,SAAG,GACL,CAChB,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC;AAEF,OAAO,EAAE,6BAA6B,EAAE,CAAC"}
@@ -2,9 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useRef } from "react";
3
3
  import { styled } from "styled-components";
4
4
  import { Loader, useModalWithView, SelectableList, } from "../../components/index.js";
5
+ import { checkoutPhaseContext } from "../../state/checkout/bitcoin-payment.js";
6
+ import { belongsOnStatusView, derivePaymentPhase, } from "../../state/checkout/payment-phase.js";
5
7
  import { useCheckoutStore, ACTIONS, setCheckoutMethod, isTestMode, } from "../../state/checkout/store.js";
6
8
  import { ModalViewContainer } from "../container.js";
7
- import { canResumePaymentStatusView } from "./initial.js";
8
9
  const LoadingPanel = styled.div `
9
10
  width: 100%;
10
11
  flex: 1;
@@ -19,7 +20,7 @@ const MethodSelectViewContent = () => {
19
20
  const { methods, loading, payment } = useCheckoutStore();
20
21
  const handleSelectMethod = (method) => {
21
22
  setCheckoutMethod(method);
22
- goToView(getCheckoutMethodDestination(method, payment, isTestMode()));
23
+ goToView(getCheckoutMethodDestination(method, payment, isTestMode(), checkoutPhaseContext(payment)));
23
24
  };
24
25
  if (loading[ACTIONS.GET_CHECKOUT_CONFIG] || !methods) {
25
26
  return (_jsx(ModalViewContainer, { ref: modalRef, children: _jsx(LoadingPanel, { children: _jsx(Loader, { asChild: true }) }) }));
@@ -27,9 +28,10 @@ const MethodSelectViewContent = () => {
27
28
  return (_jsx(ModalViewContainer, { ref: modalRef, children: _jsx(SelectableList, { title: "Select payment method", items: methods, getKey: (method) => method.name, getLabel: (method) => method.name, onSelect: handleSelectMethod }) }));
28
29
  };
29
30
  export const shouldUseTestPaymentStatusView = (_method, testMode) => testMode;
30
- export const getCheckoutMethodDestination = (method, payment, testMode) => {
31
+ export const getCheckoutMethodDestination = (method, payment, testMode, context) => {
32
+ // Choosing Crypto is navigation: the payment's phase decides as on reopen.
31
33
  if (method.intentName === "cryptoIntent" &&
32
- canResumePaymentStatusView(payment)) {
34
+ belongsOnStatusView(derivePaymentPhase(payment, context), true)) {
33
35
  return "paymentStatus";
34
36
  }
35
37
  return shouldUseTestPaymentStatusView(method, testMode)
@@ -1 +1 @@
1
- {"version":3,"file":"method-select.js","sourceRoot":"","sources":["../../../../src/checkout/views/method-select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,m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EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EACjD,QAAQ,EAAE,kBAAkB,GAC5B,GACiB,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC5C,OAAuB,EACvB,QAAiB,EACR,EAAE,CAAC,QAAQ,CAAC;AAEvB,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,MAAsB,EACtB,OAAuB,EACvB,QAAiB,EACjB,EAAE;IACF,IACE,MAAM,CAAC,UAAU,KAAK,cAAc;QACpC,0BAA0B,CAAC,OAAO,CAAC,EACnC,CAAC;QACD,OAAO,eAAe,CAAC;IACzB,CAAC;IACD,OAAO,8BAA8B,CAAC,MAAM,EAAE,QAAQ,CAAC;QACrD,CAAC,CAAC,mBAAmB;QACrB,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;AACxB,CAAC,CAAC;AAEF,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"method-select.js","sourceRoot":"","sources":["../../../../src/checkout/views/method-select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EACL,mBAAmB,EACnB,kBAAkB,GAEnB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,gBAAgB,EAChB,OAAO,EACP,iBAAiB,EACjB,UAAU,GACX,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAO9B,CAAC;AAEF,MAAM,uBAAuB,GAAG,GAAG,EAAE;IACnC,MAAM,EAA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