@xochi/widget 0.0.0-stage → 0.1.1

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 (585) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/LICENSE +21 -0
  3. package/README.md +420 -2
  4. package/THIRD_PARTY_NOTICES.txt +44 -0
  5. package/dist/ConfiguratorApp.js +19 -0
  6. package/dist/EmbedApp.js +57 -0
  7. package/dist/assets/MonaspaceArgon-Bold-D9kWRRK5.woff2 +0 -0
  8. package/dist/assets/MonaspaceArgon-Light-Dt_6qXbW.woff2 +0 -0
  9. package/dist/assets/MonaspaceArgon-Medium-B1gMZwrU.woff2 +0 -0
  10. package/dist/assets/MonaspaceArgon-Regular-RS-2TGNg.woff2 +0 -0
  11. package/dist/assets/MonaspaceArgon-SemiBold-PYusZXE_.woff2 +0 -0
  12. package/dist/assets/MonaspaceNeon-Italic-C9u9eioB.woff2 +0 -0
  13. package/dist/assets/MonaspaceNeon-Light-CJkxpyfT.woff2 +0 -0
  14. package/dist/assets/MonaspaceNeon-Medium-DCChELAx.woff2 +0 -0
  15. package/dist/assets/MonaspaceNeon-Regular-BZtV1wRa.woff2 +0 -0
  16. package/dist/assets/MonaspaceXenon-Bold-KacFhGOf.woff2 +0 -0
  17. package/dist/assets/MonaspaceXenon-Medium-Dqqg-cnL.woff2 +0 -0
  18. package/dist/assets/MonaspaceXenon-Regular-BRsdKART.woff2 +0 -0
  19. package/dist/assets/MonaspaceXenon-SemiBold-DNjPl3uE.woff2 +0 -0
  20. package/dist/assets/alipay-3tx9-HPp.svg +1 -0
  21. package/dist/assets/arb-CCfLcB_X.svg +7 -0
  22. package/dist/assets/arc-Dy98eSCd.svg +10 -0
  23. package/dist/assets/aztec-DiLp9qTG.svg +4 -0
  24. package/dist/assets/base-Ch0ino36.svg +4 -0
  25. package/dist/assets/cashapp-lOg0DIt8.svg +1 -0
  26. package/dist/assets/chains/arbitrum.svg.js +4 -0
  27. package/dist/assets/chains/arc.svg.js +4 -0
  28. package/dist/assets/chains/aztec.svg.js +4 -0
  29. package/dist/assets/chains/base.svg.js +4 -0
  30. package/dist/assets/chains/ethereum.svg.js +4 -0
  31. package/dist/assets/chains/gnosis.png.js +4 -0
  32. package/dist/assets/chains/index.js +31 -0
  33. package/dist/assets/chains/optimism.svg.js +4 -0
  34. package/dist/assets/chains/polygon.svg.js +4 -0
  35. package/dist/assets/chains/robinhood.svg.js +4 -0
  36. package/dist/assets/chains/tron.svg.js +4 -0
  37. package/dist/assets/chains/xochi.svg.js +4 -0
  38. package/dist/assets/dai-XuyZLceZ.png +0 -0
  39. package/dist/assets/defillama-BU037Unq.svg +1 -0
  40. package/dist/assets/defillama.svg.js +4 -0
  41. package/dist/assets/eth-Dvbng9UB.svg +8 -0
  42. package/dist/assets/eurc-NI9zNgOQ.png +0 -0
  43. package/dist/assets/eure-BH9vpwcv.png +0 -0
  44. package/dist/assets/gnosis-fRzAZQFj.png +0 -0
  45. package/dist/assets/mercadopago-gjsFb6F7.svg +1 -0
  46. package/dist/assets/monzo-B9XD4bL5.png +0 -0
  47. package/dist/assets/monzo-SZnIdUKN.svg +1 -0
  48. package/dist/assets/monzo-dark-Bwzg90UC.png +0 -0
  49. package/dist/assets/n26-cANcjY2T.svg +1 -0
  50. package/dist/assets/op-DF67SbB6.png +0 -0
  51. package/dist/assets/optimism-B3cTNxEQ.svg +4 -0
  52. package/dist/assets/paypal-D8xqXEtN.svg +1 -0
  53. package/dist/assets/pol-uLmSo2O8.svg +3 -0
  54. package/dist/assets/rails/SOURCES.md +50 -0
  55. package/dist/assets/rails/alipay.svg.js +4 -0
  56. package/dist/assets/rails/cashapp.svg.js +4 -0
  57. package/dist/assets/rails/index.js +59 -0
  58. package/dist/assets/rails/mercadopago.svg.js +4 -0
  59. package/dist/assets/rails/monzo-dark.png.js +4 -0
  60. package/dist/assets/rails/monzo.png.js +4 -0
  61. package/dist/assets/rails/monzo.svg.js +4 -0
  62. package/dist/assets/rails/n26.svg.js +4 -0
  63. package/dist/assets/rails/paypal.svg.js +4 -0
  64. package/dist/assets/rails/revolut-dark.png.js +4 -0
  65. package/dist/assets/rails/revolut.png.js +4 -0
  66. package/dist/assets/rails/revolut.svg.js +4 -0
  67. package/dist/assets/rails/venmo.svg.js +4 -0
  68. package/dist/assets/rails/wise-dark.png.js +4 -0
  69. package/dist/assets/rails/wise.png.js +4 -0
  70. package/dist/assets/rails/wise.svg.js +4 -0
  71. package/dist/assets/rails/xmoney.svg.js +4 -0
  72. package/dist/assets/rails/zelle.svg.js +4 -0
  73. package/dist/assets/raxol-86FmC34h.png +0 -0
  74. package/dist/assets/revolut-CiBtyALA.png +0 -0
  75. package/dist/assets/revolut-D7qr5Vzs.svg +1 -0
  76. package/dist/assets/revolut-dark-RQdWGM_p.png +0 -0
  77. package/dist/assets/robinhood-DgdGTQ1I.svg +8 -0
  78. package/dist/assets/tokens/arb.svg.js +4 -0
  79. package/dist/assets/tokens/dai.png.js +4 -0
  80. package/dist/assets/tokens/eth.svg.js +4 -0
  81. package/dist/assets/tokens/eurc.png.js +4 -0
  82. package/dist/assets/tokens/eure.png.js +4 -0
  83. package/dist/assets/tokens/index.js +36 -0
  84. package/dist/assets/tokens/op.png.js +4 -0
  85. package/dist/assets/tokens/pol.svg.js +4 -0
  86. package/dist/assets/tokens/raxol.png.js +4 -0
  87. package/dist/assets/tokens/usdc.png.js +4 -0
  88. package/dist/assets/tokens/usdg.png.js +4 -0
  89. package/dist/assets/tokens/usdt.png.js +4 -0
  90. package/dist/assets/tokens/wbtc.png.js +4 -0
  91. package/dist/assets/tokens/wsteth.png.js +4 -0
  92. package/dist/assets/tokens/zchf.png.js +4 -0
  93. package/dist/assets/tron-Dtumyzha.svg +4 -0
  94. package/dist/assets/usdc-UHSd0FoM.png +0 -0
  95. package/dist/assets/usdg-Cd5nCzbC.png +0 -0
  96. package/dist/assets/usdt-3G3YdPq8.png +0 -0
  97. package/dist/assets/venmo-CMHeCn-D.svg +1 -0
  98. package/dist/assets/wbtc-CV8uE44Q.png +0 -0
  99. package/dist/assets/wise-BUOflsWL.svg +1 -0
  100. package/dist/assets/wise-JLpDvCdq.png +0 -0
  101. package/dist/assets/wise-dark-_Q8pbCom.png +0 -0
  102. package/dist/assets/wsteth-BamwtTCR.png +0 -0
  103. package/dist/assets/xmoney-CwY9KVlD.svg +1 -0
  104. package/dist/assets/xochi-DL2f8G4R.svg +4 -0
  105. package/dist/assets/zchf-BLBNdTGJ.png +0 -0
  106. package/dist/assets/zelle-t15cG4SB.svg +1 -0
  107. package/dist/browser.js +4 -0
  108. package/dist/components/AccountChip.js +29 -0
  109. package/dist/components/ActivityFeed.js +710 -0
  110. package/dist/components/AssetsStrip.js +133 -0
  111. package/dist/components/AuthorizedAgents.js +197 -0
  112. package/dist/components/Chevron.js +22 -0
  113. package/dist/components/ErrorDisplay.js +68 -0
  114. package/dist/components/InfoButton.js +27 -0
  115. package/dist/components/IntentTimeline.js +202 -0
  116. package/dist/components/LinksSignIn.js +26 -0
  117. package/dist/components/MobileSigningBanner.js +44 -0
  118. package/dist/components/PrivacyBars.js +44 -0
  119. package/dist/components/PrivacyPanel.js +99 -0
  120. package/dist/components/QuoteDetails.js +327 -0
  121. package/dist/components/ReceiptCommand.js +46 -0
  122. package/dist/components/SessionReloadBanner.js +19 -0
  123. package/dist/components/SolverRace.js +62 -0
  124. package/dist/components/StealthClaims.js +179 -0
  125. package/dist/components/SwapFlowModal.js +408 -0
  126. package/dist/components/Toast.js +40 -0
  127. package/dist/components/TokenIcon.js +21 -0
  128. package/dist/components/TokenSearchModal.js +331 -0
  129. package/dist/components/TransactionPreview.js +230 -0
  130. package/dist/components/WalletProvider.js +41 -0
  131. package/dist/components/WrapModal.js +192 -0
  132. package/dist/components/swap-flow/CantonEscrowPanel.js +28 -0
  133. package/dist/components/swap-flow/CantonEscrowStatus.js +160 -0
  134. package/dist/components/swap-flow/DepositInstructions.js +156 -0
  135. package/dist/components/swap-flow/QrCode.js +22 -0
  136. package/dist/components/swap-flow/SwapResult.js +325 -0
  137. package/dist/components/swap-flow/depositScreen.js +36 -0
  138. package/dist/components/widgetTabsContext.js +17 -0
  139. package/dist/config.js +132 -0
  140. package/dist/configurator-model.js +71 -0
  141. package/dist/configurator.js +11 -0
  142. package/dist/constants.js +53 -0
  143. package/dist/hooks/applyTheme.js +10 -0
  144. package/dist/hooks/useAgentRegistry.js +28 -0
  145. package/dist/hooks/useAgentStream.js +89 -0
  146. package/dist/hooks/useCantonEscrow.js +89 -0
  147. package/dist/hooks/useCapabilities.js +86 -0
  148. package/dist/hooks/useEmbedLook.js +23 -0
  149. package/dist/hooks/useFocusTrap.js +44 -0
  150. package/dist/hooks/useIntent.js +485 -0
  151. package/dist/hooks/useIntentStatusPoll.js +71 -0
  152. package/dist/hooks/useIntentStream.js +95 -0
  153. package/dist/hooks/useLocalActivity.js +114 -0
  154. package/dist/hooks/useLocalSends.js +15 -0
  155. package/dist/hooks/useLocalStorage.js +26 -0
  156. package/dist/hooks/useOrderHistory.js +307 -0
  157. package/dist/hooks/usePermit.js +203 -0
  158. package/dist/hooks/usePrices.js +49 -0
  159. package/dist/hooks/usePublicBalances.js +186 -0
  160. package/dist/hooks/useRampSummaries.js +19 -0
  161. package/dist/hooks/useRecipientBalance.js +98 -0
  162. package/dist/hooks/useSettlements.js +33 -0
  163. package/dist/hooks/useStealth.js +324 -0
  164. package/dist/hooks/useStealthClaim.js +183 -0
  165. package/dist/hooks/useStealthScanner.js +259 -0
  166. package/dist/hooks/useTheme.js +48 -0
  167. package/dist/hooks/useTierInfo.js +20 -0
  168. package/dist/hooks/useTrustScore.js +16 -0
  169. package/dist/hooks/useWalletSession.js +70 -0
  170. package/dist/hooks/useWrapEth.js +60 -0
  171. package/dist/index.js +41 -0
  172. package/dist/integration.js +19 -0
  173. package/dist/lib/activityValue.js +20 -0
  174. package/dist/lib/agentConnect.js +11 -0
  175. package/dist/lib/agentRegistry.js +83 -0
  176. package/dist/lib/agentStreamVerify.js +47 -0
  177. package/dist/lib/api.js +67 -0
  178. package/dist/lib/auth.js +8 -0
  179. package/dist/lib/authFetch.js +33 -0
  180. package/dist/lib/aztecTokens.js +13 -0
  181. package/dist/lib/balances.js +77 -0
  182. package/dist/lib/capabilities.js +40 -0
  183. package/dist/lib/claimSubmitPoll.js +63 -0
  184. package/dist/lib/debug.js +7 -0
  185. package/dist/lib/declineGuidance.js +31 -0
  186. package/dist/lib/displayFallbacks.js +25 -0
  187. package/dist/lib/eip712.js +38 -0
  188. package/dist/lib/errorCategory.js +202 -0
  189. package/dist/lib/errorReport.js +19 -0
  190. package/dist/lib/explorerLinks.js +30 -0
  191. package/dist/lib/feesLabel.js +19 -0
  192. package/dist/lib/glyphs.js +58 -0
  193. package/dist/lib/hostBridge.js +41 -0
  194. package/dist/lib/hostOrigin.js +52 -0
  195. package/dist/lib/intentAPI.js +39 -0
  196. package/dist/lib/linksSignIn.js +9 -0
  197. package/dist/lib/localActivity.js +247 -0
  198. package/dist/lib/localSends.js +129 -0
  199. package/dist/lib/mobileWallet.js +17 -0
  200. package/dist/lib/pairAvailability.js +29 -0
  201. package/dist/lib/paymentSummary.js +23 -0
  202. package/dist/lib/permits.js +27 -0
  203. package/dist/lib/priceImpact.js +101 -0
  204. package/dist/lib/providers.js +124 -0
  205. package/dist/lib/qr.js +20 -0
  206. package/dist/lib/quoteCost.js +34 -0
  207. package/dist/lib/quoteCountdown.js +24 -0
  208. package/dist/lib/rampHostGate.js +24 -0
  209. package/dist/lib/rampLifecycle.js +63 -0
  210. package/dist/lib/receiptCost.js +64 -0
  211. package/dist/lib/recipient/index.js +302 -0
  212. package/dist/lib/recipient/recent.js +47 -0
  213. package/dist/lib/recipientReceipt.js +16 -0
  214. package/dist/lib/reportClient.js +32 -0
  215. package/dist/lib/sessionExpiry.js +11 -0
  216. package/dist/lib/settlementAvailability.js +34 -0
  217. package/dist/lib/stealth.js +110 -0
  218. package/dist/lib/swapFlowPhase.js +52 -0
  219. package/dist/lib/swapStatusCopy.js +59 -0
  220. package/dist/lib/tradeLifecycle.js +40 -0
  221. package/dist/lib/tronlink.js +71 -0
  222. package/dist/lib/walletSession.js +87 -0
  223. package/dist/pages/Configurator.js +390 -0
  224. package/dist/pages/Trade.js +635 -0
  225. package/dist/pages/configurator/AllowedAssetsSection.js +98 -0
  226. package/dist/pages/configurator/AppearanceSection.js +44 -0
  227. package/dist/pages/configurator/CodeDock.js +140 -0
  228. package/dist/pages/configurator/DeveloperSection.js +40 -0
  229. package/dist/pages/configurator/IntegrationSection.js +105 -0
  230. package/dist/pages/configurator/LayoutSection.js +83 -0
  231. package/dist/pages/configurator/PolicyNote.js +7 -0
  232. package/dist/pages/configurator/PreviewStage.js +165 -0
  233. package/dist/pages/configurator/PrivacySection.js +54 -0
  234. package/dist/pages/configurator/RouteSection.js +211 -0
  235. package/dist/pages/configurator/Settings.js +35 -0
  236. package/dist/pages/configurator/SharedLinkBanner.js +25 -0
  237. package/dist/pages/configurator/SurfaceSection.js +124 -0
  238. package/dist/pages/configurator/WhatUsersSee.js +268 -0
  239. package/dist/pages/configurator/codeShown.js +8 -0
  240. package/dist/pages/configurator/configuratorUrl.js +33 -0
  241. package/dist/pages/configurator/paramsDraft.js +82 -0
  242. package/dist/pages/configurator/previewModel.js +10 -0
  243. package/dist/pages/configurator/previewQuote.js +109 -0
  244. package/dist/pages/configurator/routePicks.js +131 -0
  245. package/dist/pages/configurator/snippets.js +98 -0
  246. package/dist/pages/configurator/surfaceParams.js +51 -0
  247. package/dist/pages/configurator/useCodeCheck.js +79 -0
  248. package/dist/pages/configurator/useConfiguratorUrl.js +24 -0
  249. package/dist/pages/configurator/useMediaQuery.js +20 -0
  250. package/dist/pages/configurator/useParamsDraft.js +33 -0
  251. package/dist/pages/configurator/usePreviewFee.js +100 -0
  252. package/dist/pages/send/MetaAddressValue.js +28 -0
  253. package/dist/pages/send/Receive.js +168 -0
  254. package/dist/pages/send/RecentRecipients.js +23 -0
  255. package/dist/pages/send/RecipientChip.js +26 -0
  256. package/dist/pages/send/ScanRecipient.js +85 -0
  257. package/dist/pages/send/SendForm.js +516 -0
  258. package/dist/pages/send/SendPanel.js +30 -0
  259. package/dist/pages/send/ShieldedDisclosure.js +12 -0
  260. package/dist/pages/send/StealthInvite.js +27 -0
  261. package/dist/pages/send/addressSend.js +92 -0
  262. package/dist/pages/send/sendCopy.js +10 -0
  263. package/dist/pages/send/sendRetry.js +24 -0
  264. package/dist/pages/send/stealthRecipient.js +65 -0
  265. package/dist/pages/send/stealthSend.js +15 -0
  266. package/dist/pages/send/useAddressSend.js +257 -0
  267. package/dist/pages/send/useSendRecipient.js +61 -0
  268. package/dist/pages/trade/BuyPanel.js +70 -0
  269. package/dist/pages/trade/RampRecovery.js +41 -0
  270. package/dist/pages/trade/RecipientSheet.js +182 -0
  271. package/dist/pages/trade/Selectors.js +152 -0
  272. package/dist/pages/trade/SwapPanel.js +972 -0
  273. package/dist/pages/trade/WidgetTabs.js +109 -0
  274. package/dist/pages/trade/canton.js +122 -0
  275. package/dist/pages/trade/config.js +70 -0
  276. package/dist/pages/trade/embedNarrowing.js +25 -0
  277. package/dist/pages/trade/embedParams.js +532 -0
  278. package/dist/pages/trade/embedTheme.js +9 -0
  279. package/dist/pages/trade/orderMinimum.js +8 -0
  280. package/dist/pages/trade/resumeSwap.js +55 -0
  281. package/dist/pages/trade/settlementCopy.js +32 -0
  282. package/dist/pages/trade/useAmountFit.js +31 -0
  283. package/dist/pages/trade/useEmbedDefaults.js +18 -0
  284. package/dist/pages/trade/useSettlementGating.js +289 -0
  285. package/dist/pages/trade/useSwapAmount.js +191 -0
  286. package/dist/pages/trade/useSwapFlow.js +511 -0
  287. package/dist/pages/trade/useSwapPanel.js +475 -0
  288. package/dist/pages/trade/useSwapRoute.js +634 -0
  289. package/dist/pages/trade/useTronLinkFill.js +34 -0
  290. package/dist/pages/trade/zkMoney.js +46 -0
  291. package/dist/promiseWithResolvers.js +20 -0
  292. package/dist/ramp/availability/RailTiles.js +156 -0
  293. package/dist/ramp/availability/RampDisclosure.js +38 -0
  294. package/dist/ramp/availability/RampRails.js +170 -0
  295. package/dist/ramp/availability/model.js +207 -0
  296. package/dist/ramp/availability/useRampDiscovery.js +83 -0
  297. package/dist/ramp/offramp/CompletedPrerequisite.js +23 -0
  298. package/dist/ramp/offramp/OfframpActivityList.js +16 -0
  299. package/dist/ramp/offramp/OfframpRoute.js +222 -0
  300. package/dist/ramp/offramp/OfframpRouteReview.js +94 -0
  301. package/dist/ramp/offramp/PaymentAppSend.js +765 -0
  302. package/dist/ramp/offramp/localOfframps.js +101 -0
  303. package/dist/ramp/offramp/model.js +154 -0
  304. package/dist/ramp/offramp/port.js +134 -0
  305. package/dist/ramp/offramp/prerequisite.js +143 -0
  306. package/dist/ramp/offramp/useOfframp.js +505 -0
  307. package/dist/ramp/offramp/useOfframpRails.js +73 -0
  308. package/dist/ramp/peer/BuyOnramp.js +292 -0
  309. package/dist/ramp/peer/OnrampSteps.js +148 -0
  310. package/dist/ramp/peer/buyerDriver.js +461 -0
  311. package/dist/ramp/peer/discovery.js +231 -0
  312. package/dist/ramp/peer/environment.js +7 -0
  313. package/dist/ramp/peer/liveProvider.js +87 -0
  314. package/dist/ramp/peer/liveReads.js +488 -0
  315. package/dist/ramp/peer/maker.js +92 -0
  316. package/dist/ramp/peer/normalization.js +184 -0
  317. package/dist/ramp/peer/offramp.js +648 -0
  318. package/dist/ramp/peer/onramp.js +353 -0
  319. package/dist/ramp/peer/preview.js +52 -0
  320. package/dist/ramp/peer/protectedMapping.js +67 -0
  321. package/dist/ramp/peer/runtime.js +55 -0
  322. package/dist/ramp/peer/sdkMaker.js +107 -0
  323. package/dist/ramp/recovery/ResumeOnramp.js +153 -0
  324. package/dist/ramp/recovery/summaries.js +173 -0
  325. package/dist/ramp/route/OnrampRoute.js +255 -0
  326. package/dist/ramp/route/RampRouteSteps.js +148 -0
  327. package/dist/ramp/route/routeActivity.js +12 -0
  328. package/dist/ramp/route/useXochiRampDriver.js +203 -0
  329. package/dist/styles.css +17473 -0
  330. package/dist/styles.js +2 -0
  331. package/dist/types/ConfiguratorApp.d.ts +6 -0
  332. package/dist/types/EmbedApp.d.ts +2 -0
  333. package/dist/types/activity.js +50 -0
  334. package/dist/types/asset.d.ts +2 -0
  335. package/dist/types/assets/chains/index.d.ts +3 -0
  336. package/dist/types/assets/rails/index.d.ts +12 -0
  337. package/dist/types/assets/tokens/index.d.ts +1 -0
  338. package/dist/types/browser.d.ts +1 -0
  339. package/dist/types/components/AccountChip.d.ts +10 -0
  340. package/dist/types/components/ActivityFeed.d.ts +46 -0
  341. package/dist/types/components/AssetsStrip.d.ts +14 -0
  342. package/dist/types/components/AuthorizedAgents.d.ts +15 -0
  343. package/dist/types/components/Chevron.d.ts +16 -0
  344. package/dist/types/components/ErrorDisplay.d.ts +46 -0
  345. package/dist/types/components/InfoButton.d.ts +6 -0
  346. package/dist/types/components/IntentTimeline.d.ts +41 -0
  347. package/dist/types/components/LinksSignIn.d.ts +13 -0
  348. package/dist/types/components/MobileSigningBanner.d.ts +16 -0
  349. package/dist/types/components/PermitBadge.d.ts +17 -0
  350. package/dist/types/components/PrivacyBars.d.ts +12 -0
  351. package/dist/types/components/PrivacyPanel.d.ts +33 -0
  352. package/dist/types/components/QuoteDetails.d.ts +56 -0
  353. package/dist/types/components/RampActivityList.d.ts +14 -0
  354. package/dist/types/components/ReceiptCommand.d.ts +12 -0
  355. package/dist/types/components/SessionReloadBanner.d.ts +8 -0
  356. package/dist/types/components/SolverRace.d.ts +35 -0
  357. package/dist/types/components/StealthClaims.d.ts +51 -0
  358. package/dist/types/components/SwapFlowModal.d.ts +142 -0
  359. package/dist/types/components/Toast.d.ts +10 -0
  360. package/dist/types/components/TokenIcon.d.ts +17 -0
  361. package/dist/types/components/TokenSearchModal.d.ts +28 -0
  362. package/dist/types/components/TransactionPreview.d.ts +37 -0
  363. package/dist/types/components/WalletProvider.d.ts +12 -0
  364. package/dist/types/components/WrapModal.d.ts +19 -0
  365. package/dist/types/components/swap-flow/CantonEscrowPanel.d.ts +14 -0
  366. package/dist/types/components/swap-flow/CantonEscrowStatus.d.ts +30 -0
  367. package/dist/types/components/swap-flow/DepositInstructions.d.ts +75 -0
  368. package/dist/types/components/swap-flow/QrCode.d.ts +18 -0
  369. package/dist/types/components/swap-flow/SwapResult.d.ts +68 -0
  370. package/dist/types/components/swap-flow/depositScreen.d.ts +67 -0
  371. package/dist/types/components/widgetTabsContext.d.ts +21 -0
  372. package/dist/types/config.d.ts +104 -0
  373. package/dist/types/configurator-model.d.ts +9 -0
  374. package/dist/types/configurator.d.ts +3 -0
  375. package/dist/types/constants.d.ts +52 -0
  376. package/dist/types/hooks/applyTheme.d.ts +7 -0
  377. package/dist/types/hooks/useAgentRegistry.d.ts +13 -0
  378. package/dist/types/hooks/useAgentStream.d.ts +15 -0
  379. package/dist/types/hooks/useCantonEscrow.d.ts +40 -0
  380. package/dist/types/hooks/useCapabilities.d.ts +83 -0
  381. package/dist/types/hooks/useEmbedLook.d.ts +4 -0
  382. package/dist/types/hooks/useFocusTrap.d.ts +7 -0
  383. package/dist/types/hooks/useIntent.d.ts +161 -0
  384. package/dist/types/hooks/useIntentStatusPoll.d.ts +107 -0
  385. package/dist/types/hooks/useIntentStream.d.ts +34 -0
  386. package/dist/types/hooks/useLocalActivity.d.ts +22 -0
  387. package/dist/types/hooks/useLocalSends.d.ts +8 -0
  388. package/dist/types/hooks/useLocalStorage.d.ts +8 -0
  389. package/dist/types/hooks/useOrderHistory.d.ts +52 -0
  390. package/dist/types/hooks/usePermit.d.ts +90 -0
  391. package/dist/types/hooks/usePrices.d.ts +72 -0
  392. package/dist/types/hooks/usePublicBalances.d.ts +19 -0
  393. package/dist/types/hooks/useRampSummaries.d.ts +9 -0
  394. package/dist/types/hooks/useRecipientBalance.d.ts +58 -0
  395. package/dist/types/hooks/useSettlements.d.ts +14 -0
  396. package/dist/types/hooks/useStealth.d.ts +72 -0
  397. package/dist/types/hooks/useStealthClaim.d.ts +96 -0
  398. package/dist/types/hooks/useStealthScanner.d.ts +44 -0
  399. package/dist/types/hooks/useTheme.d.ts +29 -0
  400. package/dist/types/hooks/useTierInfo.d.ts +23 -0
  401. package/dist/types/hooks/useTrustScore.d.ts +16 -0
  402. package/dist/types/hooks/useWalletSession.d.ts +21 -0
  403. package/dist/types/hooks/useWrapEth.d.ts +21 -0
  404. package/dist/types/index.d.ts +6 -0
  405. package/dist/types/index.js +8 -0
  406. package/dist/types/integration.d.ts +9 -0
  407. package/dist/types/intent.js +85 -0
  408. package/dist/types/lib/activityValue.d.ts +16 -0
  409. package/dist/types/lib/agentConnect.d.ts +23 -0
  410. package/dist/types/lib/agentRegistry.d.ts +47 -0
  411. package/dist/types/lib/agentStreamVerify.d.ts +29 -0
  412. package/dist/types/lib/api.d.ts +41 -0
  413. package/dist/types/lib/auth.d.ts +6 -0
  414. package/dist/types/lib/authFetch.d.ts +14 -0
  415. package/dist/types/lib/aztecTokens.d.ts +15 -0
  416. package/dist/types/lib/balances.d.ts +88 -0
  417. package/dist/types/lib/capabilities.d.ts +3 -0
  418. package/dist/types/lib/claimSubmitPoll.d.ts +114 -0
  419. package/dist/types/lib/debug.d.ts +13 -0
  420. package/dist/types/lib/declineGuidance.d.ts +55 -0
  421. package/dist/types/lib/displayFallbacks.d.ts +7 -0
  422. package/dist/types/lib/eip712.d.ts +61 -0
  423. package/dist/types/lib/errorCategory.d.ts +50 -0
  424. package/dist/types/lib/errorReport.d.ts +15 -0
  425. package/dist/types/lib/explorerLinks.d.ts +67 -0
  426. package/dist/types/lib/feesLabel.d.ts +20 -0
  427. package/dist/types/lib/glyphs.d.ts +52 -0
  428. package/dist/types/lib/hostBridge.d.ts +11 -0
  429. package/dist/types/lib/hostOrigin.d.ts +30 -0
  430. package/dist/types/lib/intentAPI.d.ts +15 -0
  431. package/dist/types/lib/linksSignIn.d.ts +13 -0
  432. package/dist/types/lib/localActivity.d.ts +135 -0
  433. package/dist/types/lib/localSends.d.ts +55 -0
  434. package/dist/types/lib/mobileWallet.d.ts +27 -0
  435. package/dist/types/lib/pairAvailability.d.ts +106 -0
  436. package/dist/types/lib/paymentSummary.d.ts +18 -0
  437. package/dist/types/lib/permits.d.ts +25 -0
  438. package/dist/types/lib/priceImpact.d.ts +165 -0
  439. package/dist/types/lib/providers.d.ts +14 -0
  440. package/dist/types/lib/qr.d.ts +19 -0
  441. package/dist/types/lib/quoteCost.d.ts +45 -0
  442. package/dist/types/lib/quoteCountdown.d.ts +34 -0
  443. package/dist/types/lib/rampHostGate.d.ts +15 -0
  444. package/dist/types/lib/rampLifecycle.d.ts +20 -0
  445. package/dist/types/lib/receiptCost.d.ts +64 -0
  446. package/dist/types/lib/recipient/index.d.ts +33 -0
  447. package/dist/types/lib/recipient/recent.d.ts +5 -0
  448. package/dist/types/lib/recipientReceipt.d.ts +25 -0
  449. package/dist/types/lib/reportClient.d.ts +9 -0
  450. package/dist/types/lib/sessionExpiry.d.ts +11 -0
  451. package/dist/types/lib/settlementAvailability.d.ts +61 -0
  452. package/dist/types/lib/stealth.d.ts +75 -0
  453. package/dist/types/lib/swapFlowPhase.d.ts +76 -0
  454. package/dist/types/lib/swapStatusCopy.d.ts +57 -0
  455. package/dist/types/lib/tierProgressDisplay.d.ts +35 -0
  456. package/dist/types/lib/tierUnlock.d.ts +25 -0
  457. package/dist/types/lib/tradeLifecycle.d.ts +32 -0
  458. package/dist/types/lib/tronlink.d.ts +62 -0
  459. package/dist/types/lib/walletSession.d.ts +38 -0
  460. package/dist/types/pages/Configurator.d.ts +25 -0
  461. package/dist/types/pages/Trade.d.ts +36 -0
  462. package/dist/types/pages/configurator/AllowedAssetsSection.d.ts +17 -0
  463. package/dist/types/pages/configurator/AppearanceSection.d.ts +22 -0
  464. package/dist/types/pages/configurator/CodeDock.d.ts +19 -0
  465. package/dist/types/pages/configurator/DeveloperSection.d.ts +12 -0
  466. package/dist/types/pages/configurator/IntegrationSection.d.ts +20 -0
  467. package/dist/types/pages/configurator/LayoutSection.d.ts +20 -0
  468. package/dist/types/pages/configurator/PolicyNote.d.ts +6 -0
  469. package/dist/types/pages/configurator/PreviewStage.d.ts +22 -0
  470. package/dist/types/pages/configurator/PrivacySection.d.ts +16 -0
  471. package/dist/types/pages/configurator/RouteSection.d.ts +30 -0
  472. package/dist/types/pages/configurator/Settings.d.ts +25 -0
  473. package/dist/types/pages/configurator/SharedLinkBanner.d.ts +16 -0
  474. package/dist/types/pages/configurator/SurfaceSection.d.ts +5 -0
  475. package/dist/types/pages/configurator/WhatUsersSee.d.ts +30 -0
  476. package/dist/types/pages/configurator/codeShown.d.ts +15 -0
  477. package/dist/types/pages/configurator/configuratorUrl.d.ts +38 -0
  478. package/dist/types/pages/configurator/paramsDraft.d.ts +32 -0
  479. package/dist/types/pages/configurator/previewModel.d.ts +20 -0
  480. package/dist/types/pages/configurator/previewQuote.d.ts +96 -0
  481. package/dist/types/pages/configurator/routePicks.d.ts +75 -0
  482. package/dist/types/pages/configurator/snippets.d.ts +23 -0
  483. package/dist/types/pages/configurator/surfaceParams.d.ts +9 -0
  484. package/dist/types/pages/configurator/useCodeCheck.d.ts +56 -0
  485. package/dist/types/pages/configurator/useConfiguratorUrl.d.ts +21 -0
  486. package/dist/types/pages/configurator/useMediaQuery.d.ts +5 -0
  487. package/dist/types/pages/configurator/useParamsDraft.d.ts +29 -0
  488. package/dist/types/pages/configurator/usePreviewFee.d.ts +74 -0
  489. package/dist/types/pages/send/MetaAddressValue.d.ts +9 -0
  490. package/dist/types/pages/send/Receive.d.ts +3 -0
  491. package/dist/types/pages/send/RecentRecipients.d.ts +3 -0
  492. package/dist/types/pages/send/RecipientChip.d.ts +4 -0
  493. package/dist/types/pages/send/ScanRecipient.d.ts +3 -0
  494. package/dist/types/pages/send/SendForm.d.ts +17 -0
  495. package/dist/types/pages/send/SendPanel.d.ts +19 -0
  496. package/dist/types/pages/send/ShieldedDisclosure.d.ts +1 -0
  497. package/dist/types/pages/send/StealthInvite.d.ts +1 -0
  498. package/dist/types/pages/send/addressSend.d.ts +62 -0
  499. package/dist/types/pages/send/sendCopy.d.ts +9 -0
  500. package/dist/types/pages/send/sendRetry.d.ts +10 -0
  501. package/dist/types/pages/send/stealthRecipient.d.ts +37 -0
  502. package/dist/types/pages/send/stealthSend.d.ts +18 -0
  503. package/dist/types/pages/send/useAddressSend.d.ts +61 -0
  504. package/dist/types/pages/send/useSendRecipient.d.ts +13 -0
  505. package/dist/types/pages/trade/BuyPanel.d.ts +22 -0
  506. package/dist/types/pages/trade/RampRecovery.d.ts +22 -0
  507. package/dist/types/pages/trade/RecipientSheet.d.ts +11 -0
  508. package/dist/types/pages/trade/Selectors.d.ts +24 -0
  509. package/dist/types/pages/trade/SwapPanel.d.ts +34 -0
  510. package/dist/types/pages/trade/WidgetTabs.d.ts +46 -0
  511. package/dist/types/pages/trade/canton.d.ts +94 -0
  512. package/dist/types/pages/trade/config.d.ts +185 -0
  513. package/dist/types/pages/trade/embedNarrowing.d.ts +28 -0
  514. package/dist/types/pages/trade/embedParams.d.ts +299 -0
  515. package/dist/types/pages/trade/embedTheme.d.ts +14 -0
  516. package/dist/types/pages/trade/harness.d.ts +120 -0
  517. package/dist/types/pages/trade/orderMinimum.d.ts +5 -0
  518. package/dist/types/pages/trade/resumeSwap.d.ts +139 -0
  519. package/dist/types/pages/trade/settlementCopy.d.ts +42 -0
  520. package/dist/types/pages/trade/useAmountFit.d.ts +25 -0
  521. package/dist/types/pages/trade/useEmbedDefaults.d.ts +28 -0
  522. package/dist/types/pages/trade/useSettlementGating.d.ts +152 -0
  523. package/dist/types/pages/trade/useSwapAmount.d.ts +93 -0
  524. package/dist/types/pages/trade/useSwapFlow.d.ts +152 -0
  525. package/dist/types/pages/trade/useSwapPanel.d.ts +170 -0
  526. package/dist/types/pages/trade/useSwapRoute.d.ts +215 -0
  527. package/dist/types/pages/trade/useTronLinkFill.d.ts +13 -0
  528. package/dist/types/pages/trade/zkMoney.d.ts +28 -0
  529. package/dist/types/promiseWithResolvers.d.ts +12 -0
  530. package/dist/types/ramp/availability/RailTiles.d.ts +26 -0
  531. package/dist/types/ramp/availability/RampDisclosure.d.ts +9 -0
  532. package/dist/types/ramp/availability/RampRails.d.ts +27 -0
  533. package/dist/types/ramp/availability/model.d.ts +51 -0
  534. package/dist/types/ramp/availability/useRampDiscovery.d.ts +60 -0
  535. package/dist/types/ramp/offramp/CompletedPrerequisite.d.ts +5 -0
  536. package/dist/types/ramp/offramp/OfframpActivityList.d.ts +12 -0
  537. package/dist/types/ramp/offramp/OfframpRoute.d.ts +8 -0
  538. package/dist/types/ramp/offramp/OfframpRouteReview.d.ts +12 -0
  539. package/dist/types/ramp/offramp/PaymentAppSend.d.ts +27 -0
  540. package/dist/types/ramp/offramp/localOfframps.d.ts +58 -0
  541. package/dist/types/ramp/offramp/model.d.ts +46 -0
  542. package/dist/types/ramp/offramp/port.d.ts +55 -0
  543. package/dist/types/ramp/offramp/prerequisite.d.ts +271 -0
  544. package/dist/types/ramp/offramp/useOfframp.d.ts +87 -0
  545. package/dist/types/ramp/offramp/useOfframpRails.d.ts +36 -0
  546. package/dist/types/ramp/peer/BuyOnramp.d.ts +21 -0
  547. package/dist/types/ramp/peer/OnrampSteps.d.ts +32 -0
  548. package/dist/types/ramp/peer/buyerDriver.d.ts +48 -0
  549. package/dist/types/ramp/peer/discovery.d.ts +17 -0
  550. package/dist/types/ramp/peer/environment.d.ts +2 -0
  551. package/dist/types/ramp/peer/index.d.ts +14 -0
  552. package/dist/types/ramp/peer/liveProvider.d.ts +15 -0
  553. package/dist/types/ramp/peer/liveReads.d.ts +102 -0
  554. package/dist/types/ramp/peer/maker.d.ts +4 -0
  555. package/dist/types/ramp/peer/normalization.d.ts +33 -0
  556. package/dist/types/ramp/peer/offramp.d.ts +130 -0
  557. package/dist/types/ramp/peer/onramp.d.ts +134 -0
  558. package/dist/types/ramp/peer/preview.d.ts +14 -0
  559. package/dist/types/ramp/peer/protectedMapping.d.ts +22 -0
  560. package/dist/types/ramp/peer/runtime.d.ts +15 -0
  561. package/dist/types/ramp/peer/sdkMaker.d.ts +67 -0
  562. package/dist/types/ramp/peer/types.d.ts +64 -0
  563. package/dist/types/ramp/recovery/ResumeOnramp.d.ts +37 -0
  564. package/dist/types/ramp/recovery/summaries.d.ts +71 -0
  565. package/dist/types/ramp/route/OnrampRoute.d.ts +12 -0
  566. package/dist/types/ramp/route/RampRouteSteps.d.ts +16 -0
  567. package/dist/types/ramp/route/routeActivity.d.ts +4 -0
  568. package/dist/types/ramp/route/useXochiRampDriver.d.ts +22 -0
  569. package/dist/types/result.js +14 -0
  570. package/dist/types/styles.d.ts +1 -0
  571. package/dist/types/types/activity.d.ts +184 -0
  572. package/dist/types/types/index.d.ts +20 -0
  573. package/dist/types/types/intent.d.ts +85 -0
  574. package/dist/types/types/result.d.ts +53 -0
  575. package/dist/types/utils/format.d.ts +88 -0
  576. package/dist/types/wagmi.d.ts +143 -0
  577. package/dist/types/widgetLibModule.d.ts +8 -0
  578. package/dist/utils/format.js +109 -0
  579. package/dist/wagmi.js +210 -0
  580. package/dist/widgetLibModule.js +4 -0
  581. package/licenses/Monaspace-OFL-1.1.txt +93 -0
  582. package/licenses/assets.json +132 -0
  583. package/licenses/rainbowkit-MIT.txt +9 -0
  584. package/licenses/xochi-shared-MIT.txt +21 -0
  585. package/package.json +115 -4
@@ -0,0 +1,139 @@
1
+ /**
2
+ * Resume plan for a swap the tab lost.
3
+ *
4
+ * On mobile, deep-linking to the wallet backgrounds the tab and the OS often
5
+ * evicts it. The in-memory intent dies with it, so on return the user lands on a
6
+ * blank trade form and it reads as "the app didn't register that I signed", even
7
+ * though the solver settled server-side. The swap itself was never at risk: the
8
+ * local activity log persists it and polls it to a terminal state. What is
9
+ * missing is the VIEW.
10
+ *
11
+ * This turns a persisted record into everything the panel needs to rebuild that
12
+ * view, or null when it cannot be rebuilt honestly. Kept pure and separate from
13
+ * `useSwapPanel` so the decision is testable without a React renderer, matching
14
+ * how the rest of the panel's logic is factored (@xochi/client, swapFlowPhase,
15
+ * pickDefaultToken). See xochi#339.
16
+ */
17
+ import { type SelectableChainId } from "@xochi/client";
18
+ import type { Token } from "../../types/intent.js";
19
+ import type { IntentStatus } from "../../types/intent.js";
20
+ import { type IntentDestination } from "../../types/intent.js";
21
+ import type { SwapActivityItem, DepositActivity } from "../../types/activity.js";
22
+ export interface ResumePlan {
23
+ /** The dispatched intent to adopt, so useIntent re-arms its status poll. */
24
+ intentId: string;
25
+ status: IntentStatus;
26
+ fromChainId: SelectableChainId;
27
+ toChainId: SelectableChainId;
28
+ fromToken: Token;
29
+ toToken: Token;
30
+ /** Display-formatted origin amount for the panel input. */
31
+ amount: string;
32
+ /** Served payout captured at submit time, raw units. Null when unknown. */
33
+ toAmount: string | null;
34
+ /**
35
+ * Deposit facts captured at submit time, on a deposit route only.
36
+ *
37
+ * This is what makes resuming a deposit swap worth doing at all: no quote is
38
+ * synthesized, so without these the modal reopens at `awaiting_deposit` with
39
+ * nothing on it, and the user has to leave the browser to send. Null on every
40
+ * pull route, and on a deposit record written before this was persisted.
41
+ */
42
+ deposit: DepositActivity | null;
43
+ /**
44
+ * The destination the order was DISPATCHED with, from the record's
45
+ * `settlementType` (written from the destination bound at confirm).
46
+ *
47
+ * The modal's ending describes this, never the live toggle, which starts on
48
+ * Public after a reload. Without it a resumed stealth order ended on a public
49
+ * receipt: an explorer link for a privacy-sensitive hash and no claim step. A
50
+ * record with no marker reads as public, as every other reader treats it.
51
+ */
52
+ destination: IntentDestination;
53
+ /** The record's `stealthPayee`: whose keys a resumed Stealth ending describes. */
54
+ stealthPayee: "self" | "other";
55
+ /**
56
+ * When the swap was submitted, so the modal's elapsed counter reads real time
57
+ * in flight rather than restarting from zero (which would tell a user waiting
58
+ * ten minutes that they had just started).
59
+ */
60
+ startedAt: number;
61
+ }
62
+ /**
63
+ * Build the plan, or null if the record cannot be rendered faithfully.
64
+ *
65
+ * Returns null rather than a partial plan on an unresolvable leg: a chain
66
+ * outside the selectable set, or a token since retired from it. Reopening the
67
+ * flow with the wrong pair in it would be worse than not reopening: the user
68
+ * would be shown a live status over a trade they did not make. The activity feed
69
+ * still lists and advances the swap either way.
70
+ *
71
+ * A Tron leg is NOT unresolvable and no longer refuses here. Both directions
72
+ * rebuild: the destination corridor is live, and the origin (deposit) corridor
73
+ * is the one that most needs this, since it cannot be completed without leaving
74
+ * the browser.
75
+ *
76
+ * A Canton destination rebuilds only while its corridor is live
77
+ * (`isOfferedChainId`), and Canton is never an origin.
78
+ */
79
+ export declare function planResume(record: SwapActivityItem | null | undefined): ResumePlan | null;
80
+ /** The resumed swap the panel is holding: its identity and its captured facts. */
81
+ export interface ResumedSwap {
82
+ intentId: string;
83
+ /** Served payout captured at submit time, raw units. Null when unknown. */
84
+ toAmount: string | null;
85
+ /**
86
+ * Deposit facts captured at submit time, or null on a pull route.
87
+ *
88
+ * Keyed to the intent id by living on this object, exactly as `toAmount` is
89
+ * and for the same reason: a bare deposit address would outlive the swap it
90
+ * belongs to and could be rendered against a trade that never had one.
91
+ */
92
+ deposit: DepositActivity | null;
93
+ /** The dispatched order's destination, keyed to the intent id like the rest. */
94
+ destination: IntentDestination;
95
+ /** Whose stealth keys it paid; absent reads as the wallet's own. */
96
+ stealthPayee?: "self" | "other";
97
+ }
98
+ /**
99
+ * Which payout the panel's "Receive" field should show, in raw units, or
100
+ * null for "show nothing".
101
+ *
102
+ * Extracted from the panel because it is the fabricated-payout guard, and every
103
+ * regression in this area has been a missing case rather than wrong arithmetic:
104
+ * both #389 and the two found in adversarial review of #398 rendered a real
105
+ * number next to a trade it did not belong to. A pure function makes each case
106
+ * assertable; inside a `useMemo` none of them were.
107
+ *
108
+ * The rules, and why each exists:
109
+ *
110
+ * - A live SOLVABLE quote always wins. Ordinary path.
111
+ * - A live DECLINED quote shows nothing. `mapQuoteResponse` defaults an absent
112
+ * `to_amount` to "0", so reading it directly renders a fabricated "Receive
113
+ * 0" beside the decline notice (#389). We were not quoted zero; we were not
114
+ * quoted at all. Critically this must NOT fall through to the resumed payout,
115
+ * or a decline would display the resumed swap's number instead.
116
+ * - With NO quote at all, the resumed payout applies -- but only while the
117
+ * resumed intent is still the one on screen. Keyed by id so it cannot outlive
118
+ * its swap and reappear against a pair that was never quoted.
119
+ */
120
+ export declare function selectPayoutSource(quote: {
121
+ canSolve: boolean;
122
+ toAmount: string | null;
123
+ } | null | undefined, resumed: Pick<ResumedSwap, "intentId" | "toAmount"> | null | undefined, currentIntentId: string | null | undefined): string | null;
124
+ /**
125
+ * Whether the panel should write this intent into the local activity log.
126
+ *
127
+ * A RESUMED intent must not: the capture write sources `toAmount` and `feeRate`
128
+ * from the live quote, a resumed intent has none, and `upsertLocalSwap` replaces
129
+ * the nested `data` block wholesale -- so it would overwrite the record it was
130
+ * restored FROM with nulls, destroying the served payout permanently for exactly
131
+ * the swap the feature exists to serve. The record is already correct, and
132
+ * `useLocalActivity` keeps its status and hashes fresh by polling. See xochi#339.
133
+ */
134
+ export declare function shouldCaptureToActivity(input: {
135
+ hasOwner: boolean;
136
+ hasIntentId: boolean;
137
+ isCapturedStatus: boolean;
138
+ isResumedIntent: boolean;
139
+ }): boolean;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Settlement-mode copy: what each mode does, the one fix for a mode that is
3
+ * unavailable, and the payout contract. Plain short sentences that state what
4
+ * is hidden and what stays visible, never the requirements.
5
+ *
6
+ * The frame renders these, and the configurator's "What users see" panel
7
+ * (xochi-fi/xochi-widget#40) imports the same constants, so the panel cannot
8
+ * describe a mode in words the frame does not use.
9
+ */
10
+ import type { SettlementType } from "../../types/index.js";
11
+ import type { SettlementFix } from "../../lib/settlementAvailability.js";
12
+ /**
13
+ * The one description of each mode: the line under the segment. Nothing else in
14
+ * the frame restates it.
15
+ */
16
+ export declare const SHIELDED_DESCRIPTION = "Amounts and participants hidden inside zk.money.";
17
+ export declare const MODE_META: Record<SettlementType, string>;
18
+ /**
19
+ * What Stealth does and does not hide, stated wherever someone else is paid.
20
+ * The venue derives the one-time address from the meta-address in the quote
21
+ * request, so it learns the meta-address: the copy must not claim the venue
22
+ * cannot link sender and recipient.
23
+ */
24
+ export declare const STEALTH_PRIVACY_LIMITS = "Stealth hides the recipient from public view. Xochi sees the recipient's meta-address and uses it to derive the one-time address, so it can link the payment to them. Stealth does not hide your funding transaction, amount or timing.";
25
+ export declare const SHIELDED_UNAVAILABLE_CAPTION = "Shielded is unavailable. Amounts and participants hidden inside zk.money.";
26
+ /** The one fix an unavailable mode shows, in place of its meta line. */
27
+ export declare const SETTLEMENT_FIX_LINE: Record<SettlementFix, string>;
28
+ /**
29
+ * The quote headline: the payout and the failure outcome in one sentence. The
30
+ * true contract (xochi CLAUDE.md "Payout Guarantee"): the cross-token leg is
31
+ * exact-output-or-revert with an atomic refund, and a float payout pays the
32
+ * stored amount, so the quoted figure is paid exactly or the order is fully
33
+ * refunded. There is no floor to show.
34
+ *
35
+ * The figure is a display rounding of the quoted amount (2 decimals at or above
36
+ * 1,000 tokens), so the sentence never calls that figure exact: "paid as
37
+ * quoted" carries the guarantee without claiming the rounded number is it.
38
+ */
39
+ export declare const payoutHeadline: (payout: string) => string;
40
+ /** The same guarantee where no figure is shown (the configurator's preview). */
41
+ export declare const PAYOUT_GUARANTEE = "Receive exactly the quoted amount, or a full refund.";
42
+ export declare const SHIELDED_DEPOSIT_NOTE = "Deposit is public on Ethereum.";
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Shrink-to-fit with a floor, for the Send / Receive amounts.
3
+ *
4
+ * The type shrinks with the character count (`--amount-chars`, read by
5
+ * `.amount-fit` in trade-layout.css) down to a 13px floor. Past the floor the
6
+ * value is truncated with an ellipsis rather than shrunk into illegibility, and
7
+ * the user can reveal it: `expanded` gives the amount the row's full width on
8
+ * its own line, above the token selector.
9
+ *
10
+ * Truncation is measured, not predicted: glyph widths, the selector's width and
11
+ * the container all vary, so the only honest test is whether the input's text
12
+ * is wider than its box.
13
+ */
14
+ import { type CSSProperties, type RefObject } from "react";
15
+ export interface AmountFit<T extends HTMLElement = HTMLInputElement> {
16
+ /** The element holding the value: the amount field, or a read-only value. */
17
+ ref: RefObject<T | null>;
18
+ /** The value is wider than its box at the floor size, so it shows an ellipsis. */
19
+ truncated: boolean;
20
+ /** The user asked to see the whole value. */
21
+ expanded: boolean;
22
+ toggle: () => void;
23
+ style: CSSProperties;
24
+ }
25
+ export declare function useAmountFit<T extends HTMLElement = HTMLInputElement>(value: string): AmountFit<T>;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * useEmbedDefaults
3
+ *
4
+ * The frame URL parameters (embedParams.ts) as the swap panel's opening state.
5
+ * Read from the URL ONCE, at mount, which in the frame is page load: a host
6
+ * that wants other defaults loads another URL.
7
+ *
8
+ * Two answers, because the capability matrix arrives after the first render:
9
+ *
10
+ * seed resolved against whatever matrix is on hand at mount (normally
11
+ * the fallback), so the panel opens on the requested route at once
12
+ * rather than flashing the defaults first;
13
+ * settled resolved again once the matrix has answered (live, or failed and
14
+ * left on the fallback). Null until then.
15
+ * codes referral and promo codes, sent on every quote.
16
+ *
17
+ * The composition applies `settled` over `seed` only while the opening is
18
+ * untouched. Bare URLs also resolve: a served trusted Stealth route is preferred
19
+ * over the static fallback without moving a route the user or host selected.
20
+ */
21
+ import { type EmbedCodes, type EmbedDefaults } from "./embedParams.js";
22
+ export interface UseEmbedDefaultsResult {
23
+ seed: EmbedDefaults;
24
+ settled: EmbedDefaults | null;
25
+ codes: EmbedCodes;
26
+ settlementPreference: "public" | "stealth" | undefined;
27
+ }
28
+ export declare function useEmbedDefaults(): UseEmbedDefaultsResult;
@@ -0,0 +1,152 @@
1
+ /**
2
+ * useSettlementGating
3
+ *
4
+ * The privacy half of the swap panel's view-model: which settlement mode the
5
+ * order runs in, whether the deeper modes are offerable at all, the single
6
+ * guidance line that answers a settlement tap, and the two leg-scoped address
7
+ * inputs (recipient on a non-EVM destination, refund on a non-EVM origin).
8
+ * Split out of the 1666-line `useSwapPanel` closure (DEBT-014 step 3).
9
+ *
10
+ * Owns the quote as well (`useIntent`), and that is deliberate rather than
11
+ * incidental: the intent request is parameterized by the settlement mode, the
12
+ * recipient and the refund address -- all owned here -- on top of the legs this
13
+ * hook receives, and the availability answers it gates on
14
+ * (`quote.settlementOptions`, the decline `error`) come straight back out of
15
+ * it. Splitting the two would put the settlement state in the composition and
16
+ * the gating that polices it down here, which is the ownership split DEBT-014
17
+ * exists to remove. Every group downstream reads the intent from this hook's
18
+ * result.
19
+ *
20
+ * Deliberately does NOT own the financial legs, pay amount, or flow modal.
21
+ *
22
+ * A new eligible route defaults to Stealth without prompting. A Public opt-in,
23
+ * an explicit host mode, and a restored order remain sticky. Setup is explicit;
24
+ * Stealth quotes require a wallet, keys, and live exact-route authorization.
25
+ * Opening confirm and signing also require a matching private quote.
26
+ *
27
+ * A Stealth order pays the wallet's own keys unless Send handed over another
28
+ * person's meta-address (`stealthRecipient`). That recipient needs no keys of
29
+ * the wallet's own, rides only a Stealth quote, and is dropped, with a toast,
30
+ * the moment the order stops being Stealth: it never becomes a Public payout.
31
+ */
32
+ import { type Dispatch, type SetStateAction } from "react";
33
+ import type { EmbedCodes } from "./embedParams.js";
34
+ import { type UseIntentReturn } from "../../hooks/useIntent.js";
35
+ import type { SettlementType } from "../../types/index.js";
36
+ import { type IntentDestination, type ChainId } from "../../types/intent.js";
37
+ import type { RoutePrivacyMode, SolverCapabilities } from "@xochi/signer";
38
+ import { type SelectableChainId } from "@xochi/client";
39
+ import type { CapabilityState } from "@xochi/client";
40
+ import { type SettlementFix } from "../../lib/settlementAvailability.js";
41
+ import type { ResolvedRecipient } from "../../lib/recipient/index.js";
42
+ import type { StealthRecipient } from "../send/stealthRecipient.js";
43
+ /** The explicit settlement notice; live destination guidance is derived separately. */
44
+ export type PanelNotice = "stealth_needs_wallet" | "shielded_soon";
45
+ export interface UseSettlementGatingParams {
46
+ fromChainId: SelectableChainId;
47
+ toChainId: SelectableChainId;
48
+ /** Token addresses, not the Token objects: only the quote request needs them. */
49
+ fromTokenAddress: string;
50
+ toTokenAddress: string;
51
+ capabilities: SolverCapabilities;
52
+ /** Privacy modes advertised on this exact selected route. */
53
+ routePrivacyModes: readonly RoutePrivacyMode[];
54
+ /** Destinations advertising Stealth for this origin/token and receive token. */
55
+ stealthDestinationChainIds: readonly SelectableChainId[];
56
+ /** Only `live` capability data may authorize settlement, including Public. */
57
+ capabilityState: CapabilityState;
58
+ /** A capability load, retry, or refresh is currently in flight. */
59
+ capabilitiesFetching: boolean;
60
+ isNonEvmDest: boolean;
61
+ isNonEvmOrigin: boolean;
62
+ /** The destination is zk.money (useSwapRoute): one tag field, settled public. */
63
+ zkMoneyDestination: boolean;
64
+ swapRecipient?: ResolvedRecipient | null;
65
+ isConnected: boolean;
66
+ address: string | undefined;
67
+ trustScore: number;
68
+ slippageBps: number;
69
+ /** Confirm modal open: the quote refresh runs in silent mode while it is. */
70
+ flowOpen: boolean;
71
+ /** Fired once when a stealth swap settles, so the receive panel can auto-scan. */
72
+ onStealthSettled?: () => void;
73
+ /**
74
+ * An explicit host preference. Omitted means Stealth on an eligible route.
75
+ * Read once; subsequent wallet and quote changes never replace a choice.
76
+ */
77
+ initialSettlement?: SettlementType;
78
+ /** Do not persist a provisional route's automatic mode before URL hydration. */
79
+ openingSettled: boolean;
80
+ /** Referral and promo codes from the frame URL (embedParams.ts), sent on every quote. */
81
+ codes?: EmbedCodes;
82
+ }
83
+ export interface UseSettlementGatingResult {
84
+ intent: UseIntentReturn;
85
+ settlement: SettlementType;
86
+ handleSettlementChange: (next: SettlementType) => void;
87
+ setupStealth: () => Promise<void>;
88
+ stealthSetupLoading: boolean;
89
+ stealthSetupError: string | null;
90
+ dismissSettlementNotice: () => void;
91
+ notice: PanelNotice | null;
92
+ shieldedClickable: boolean;
93
+ shieldedPreLive: boolean;
94
+ shieldedRefusalReason: string | null;
95
+ shieldedRouteAvailable: boolean | undefined;
96
+ stealthSelectable: boolean;
97
+ stealthClickable: boolean;
98
+ /** The one fix an unavailable mode shows; null when the mode is available. */
99
+ stealthFix: SettlementFix | null;
100
+ shieldedFix: SettlementFix | null;
101
+ /** The selected mode's fix: non-null means submit is blocked until acted on. */
102
+ settlementFix: SettlementFix | null;
103
+ stealthUnavailable: boolean;
104
+ stealthRequestRejected: boolean;
105
+ stealthRouteAvailable: boolean | undefined;
106
+ stealthRefusalReason: string | null;
107
+ /** Trusted stealth destinations in solver-advertised order. */
108
+ stealthChains: readonly ChainId[];
109
+ stealthDestinationSupported: boolean;
110
+ recipientAddress: string;
111
+ setRecipientAddress: Dispatch<SetStateAction<string>>;
112
+ recipientInvalid: boolean;
113
+ swapRecipientIssue: string | null;
114
+ recipientMissing: boolean;
115
+ recipientCheck: {
116
+ valid: boolean;
117
+ error?: string;
118
+ };
119
+ /**
120
+ * The recipient as the quote sends it: trimmed on Tron, byte for byte as
121
+ * typed on Canton (a party id is never trimmed or case-folded).
122
+ */
123
+ sentRecipient: string;
124
+ /** The destination is Canton: public only, a party recipient, an escrow order. */
125
+ cantonDestination: boolean;
126
+ /** The tag field as typed; `zkMoneyTag` is what the quote asks for. */
127
+ recipientTag: string;
128
+ setRecipientTag: Dispatch<SetStateAction<string>>;
129
+ zkMoneyTag: string;
130
+ zkMoneyTagError: string | null;
131
+ refundAddress: string;
132
+ setRefundAddress: Dispatch<SetStateAction<string>>;
133
+ refundError: string | null;
134
+ refundInvalid: boolean;
135
+ /** The destination as the LIVE form describes it; the flow binds it at confirm. */
136
+ destination: IntentDestination;
137
+ /** Who actually receives the payout, for the recipient balance lookup. */
138
+ payoutAddress: string | undefined;
139
+ /** Put the shielded line down; the composition wires it to trade edits. */
140
+ dismissShieldedNotice: () => void;
141
+ /** Restore a mode from a record (retry prefill), bypassing the tap decision. */
142
+ restoreSettlement: (next: SettlementType) => void;
143
+ /** Drop the recipient: any destination change invalidates it. */
144
+ clearRecipient: () => void;
145
+ /** Drop the refund address: it is origin-chain-VM-shaped. */
146
+ clearRefund: () => void;
147
+ /** Another person's meta-address the Stealth order pays; null pays the wallet's own keys. */
148
+ stealthRecipient: StealthRecipient | null;
149
+ /** Set or drop it from a Send hand-off (the prefill), never from typing here. */
150
+ restoreStealthRecipient: (next: StealthRecipient | null) => void;
151
+ }
152
+ export declare function useSettlementGating({ fromChainId, toChainId, fromTokenAddress, toTokenAddress, capabilities, routePrivacyModes, stealthDestinationChainIds, capabilityState, capabilitiesFetching, isNonEvmDest, isNonEvmOrigin, zkMoneyDestination, swapRecipient, isConnected, address, trustScore, slippageBps, flowOpen, onStealthSettled, initialSettlement, openingSettled, codes, }: UseSettlementGatingParams): UseSettlementGatingResult;
@@ -0,0 +1,93 @@
1
+ /**
2
+ * useSwapAmount
3
+ *
4
+ * The amount half of the swap panel's view-model: what the user is paying,
5
+ * what the wallet actually holds, what the quote says arrives, and every bound
6
+ * that can refuse the size (balance, the solver's stable USD minimum, the price
7
+ * impact ceiling, the served minimum). Split out of the 1666-line
8
+ * `useSwapPanel` closure (DEBT-014 step 3) and constructed after the route and
9
+ * settlement groups, because every figure here is denominated in their legs and
10
+ * read off their quote.
11
+ *
12
+ * Owns the pay amount, the wrap-modal flag, the balance readers and the price
13
+ * feed. It also holds the input-driven re-quote, which is the one effect that
14
+ * turns an edited amount into a request.
15
+ *
16
+ * Deliberately does NOT own the legs, the quote (`useIntent`) or the CTA
17
+ * verdict: the button text weighs these bounds against wallet and flow state,
18
+ * so it belongs to the flow group downstream. `setAmount` is exported for the
19
+ * two writers outside this group -- a leg change clears it, and a restored
20
+ * order (retry prefill, resumed swap) fills it.
21
+ */
22
+ import { type Dispatch, type SetStateAction } from "react";
23
+ import { type UseRecipientBalanceReturn } from "../../hooks/useRecipientBalance.js";
24
+ import type { UseIntentReturn } from "../../hooks/useIntent.js";
25
+ import { type Token } from "../../types/intent.js";
26
+ import { type SelectableChainId } from "@xochi/client";
27
+ import type { SolverCapabilities } from "@xochi/signer";
28
+ import type { ResumedSwap } from "./resumeSwap.js";
29
+ import { type AmountTooSmallGuidance } from "../../lib/declineGuidance.js";
30
+ export interface UseSwapAmountParams {
31
+ fromChainId: SelectableChainId;
32
+ toChainId: SelectableChainId;
33
+ fromToken: Token;
34
+ toToken: Token;
35
+ capabilities: SolverCapabilities;
36
+ /**
37
+ * The route is refused, or not yet confirmed by the live matrix: no point
38
+ * requesting a quote the solver drops (see `RouteCheck`).
39
+ */
40
+ routeBlocked: boolean;
41
+ isNonEvmDest: boolean;
42
+ intent: UseIntentReturn;
43
+ /** A restored swap carries the only payout figure it will ever have. */
44
+ resumed: ResumedSwap | null;
45
+ /** Recipient of the payout, for the destination-side balance lookup. */
46
+ payoutAddress: string | undefined;
47
+ /** A required-but-unusable recipient also suppresses the re-quote. */
48
+ recipientInvalid: boolean;
49
+ isConnected: boolean;
50
+ /** The wallet's actual chain; undefined or unconfigured balances remain unknown. */
51
+ connectedChainId: number | undefined;
52
+ /** Confirm modal open: the input is frozen, so skip the input-driven quote. */
53
+ flowOpen: boolean;
54
+ /** The pay amount the panel opens on, read once at mount (frame URL parameter). */
55
+ initialAmount?: string;
56
+ /**
57
+ * The host locked the amount (`lock=amount`): the user cannot type, max or
58
+ * bump it. Restores (`setAmount`) still write it.
59
+ */
60
+ amountLocked?: boolean;
61
+ }
62
+ export interface UseSwapAmountResult {
63
+ amount: string;
64
+ handleAmountChange: (raw: string) => void;
65
+ handlePreset: (percent: number) => void;
66
+ amountBigInt: bigint;
67
+ /** Origin balance, or null when it is not known (non-EVM origin, read pending or failed). */
68
+ currentBalance: bigint | null;
69
+ destinationBalance: bigint | null;
70
+ recipientBalance: UseRecipientBalanceReturn;
71
+ nativeEthDisplay: string;
72
+ showWrapNudge: boolean;
73
+ showWrap: boolean;
74
+ setShowWrap: Dispatch<SetStateAction<boolean>>;
75
+ outputAmount: string;
76
+ /** The same payout for the narrow receive field (payoutFieldDecimals). */
77
+ payoutField: string;
78
+ insufficientBalance: boolean;
79
+ orderOutOfBounds: boolean;
80
+ orderBoundsNotice: string | null;
81
+ excessiveSlippage: boolean;
82
+ amountGuidance: AmountTooSmallGuidance | null;
83
+ handleIncreaseToMinimum: () => void;
84
+ /** Write the pay amount from outside this group (leg change, order restore). */
85
+ setAmount: Dispatch<SetStateAction<string>>;
86
+ }
87
+ /**
88
+ * The text a balance preset writes into the pay field. Anything that names the
89
+ * amount a preset will fill (the "Use max (...)" CTA) formats it here too, so the
90
+ * label and the filled value are one string.
91
+ */
92
+ export declare const presetAmountText: (amount: bigint, decimals: number) => string;
93
+ export declare function useSwapAmount({ fromChainId, toChainId, fromToken, toToken, capabilities, routeBlocked, isNonEvmDest, intent, resumed, payoutAddress, recipientInvalid, isConnected, connectedChainId, flowOpen, initialAmount, amountLocked, }: UseSwapAmountParams): UseSwapAmountResult;
@@ -0,0 +1,152 @@
1
+ /**
2
+ * useSwapFlow
3
+ *
4
+ * The dispatch half of the swap panel's view-model: submitting the order,
5
+ * driving the flow modal, restoring an order the tab lost, recording what ran,
6
+ * and the single CTA sentence that weighs every other group's verdict. Split
7
+ * out of the 1666-line `useSwapPanel` closure (DEBT-014 step 3) and
8
+ * constructed LAST, because it reads all three groups upstream -- the legs, the
9
+ * amount bounds, the settlement mode and the quote -- and writes back into them
10
+ * on the two restore paths (retry prefill, resumed swap) through the narrow
11
+ * setters they export.
12
+ *
13
+ * Owns the executed order's own destination (bound at confirm, never re-read
14
+ * from the live toggle), the execution clock, and the local activity capture.
15
+ *
16
+ * Deliberately does NOT own the quote (it receives the intent), the flow-modal
17
+ * flag (`flowOpen` also pauses the quote refresh and suppresses the re-quote,
18
+ * so the composition holds it) or the restored payout record (`resumed`, read
19
+ * by the amount group for its payout line).
20
+ */
21
+ import { type Dispatch, type SetStateAction } from "react";
22
+ import type { UseIntentReturn } from "../../hooks/useIntent.js";
23
+ import { type SettlementType } from "../../types/index.js";
24
+ import { type IntentDestination, type Token } from "../../types/intent.js";
25
+ import { type SelectableChainId } from "@xochi/client";
26
+ import type { ResolvedRecipient } from "../../lib/recipient/index.js";
27
+ import type { ResumedSwap } from "./resumeSwap.js";
28
+ import type { RouteCheck, SwapRouteLegs } from "./useSwapRoute.js";
29
+ import type { SettlementFix } from "../../lib/settlementAvailability.js";
30
+ import type { DepositActivity, SwapActivityItem } from "../../types/activity.js";
31
+ import type { SendRecipientDisplay } from "../send/sendCopy.js";
32
+ import type { StealthRecipient } from "../send/stealthRecipient.js";
33
+ /**
34
+ * Retry prefill from a history row. The panel resolves the token addresses back
35
+ * to selectable Token objects on their chains and formats the raw amount. The
36
+ * `nonce` makes each Retry click distinct so a repeated click re-applies, while
37
+ * the effect never runs on unrelated re-renders (so it can't clobber typing).
38
+ */
39
+ export interface SwapPrefill {
40
+ nonce: number;
41
+ /**
42
+ * Selectable, not EVM-only: a history row can now carry a Tron leg, and Retry
43
+ * is offered on any failed/refunded/expired row. Typing these as `ChainId`
44
+ * would make every Tron retry take the "chain you can't reload" branch.
45
+ */
46
+ fromChainId: SelectableChainId;
47
+ toChainId: SelectableChainId;
48
+ fromToken: string;
49
+ toToken: string;
50
+ fromAmount: string;
51
+ fromSend?: true;
52
+ swapRecipientRetry?: {
53
+ input?: string;
54
+ zkMoneyDestination?: boolean;
55
+ };
56
+ sendRecipientDisplay?: SendRecipientDisplay;
57
+ /**
58
+ * Settlement mode of the original order, restored on retry (Phase 6).
59
+ * Absent on rows captured before the field existed, which reads as public.
60
+ */
61
+ settlement?: SettlementType;
62
+ recipientTag?: string;
63
+ refundAddress?: string;
64
+ /**
65
+ * Another person's stealth meta-address, from Send > Stealth: public keys
66
+ * only, and only with `settlement: "stealth"`. Absent pays the wallet's own
67
+ * keys.
68
+ */
69
+ stealthRecipient?: StealthRecipient;
70
+ /** A history row's marker that its order paid someone else's keys. */
71
+ stealthPayee?: "other";
72
+ }
73
+ export interface UseSwapFlowParams {
74
+ prefill: SwapPrefill | null | undefined;
75
+ sendRecipient?: ResolvedRecipient;
76
+ intent: UseIntentReturn;
77
+ isConnected: boolean;
78
+ address: string | undefined;
79
+ /** The wallet's actual chain (`useAccount().chainId`); may be one wagmi has no config for. */
80
+ connectedChainId: number | undefined;
81
+ /** Route facts and the restore write. */
82
+ fromChainId: SelectableChainId;
83
+ toChainId: SelectableChainId;
84
+ fromToken: Token;
85
+ toToken: Token;
86
+ routeCheck: RouteCheck;
87
+ applyRoute: (legs: SwapRouteLegs) => void;
88
+ /** Amount facts and the restore write. */
89
+ amount: string;
90
+ amountBigInt: bigint;
91
+ insufficientBalance: boolean;
92
+ /** Origin balance, for the "Use max" CTA an over-balance amount gets. */
93
+ currentBalance: bigint | null;
94
+ excessiveSlippage: boolean;
95
+ orderOutOfBounds: boolean;
96
+ setAmount: (value: string) => void;
97
+ /** Settlement facts and the restore writes. */
98
+ settlement: SettlementType;
99
+ /** The selected mode's fix; non-null blocks submit until the user acts. */
100
+ settlementFix: SettlementFix | null;
101
+ destination: IntentDestination;
102
+ swapRecipientLabel?: string;
103
+ swapRecipient?: ResolvedRecipient | null;
104
+ swapRecipientRetryInput?: string;
105
+ restoreSwapRecipient?: (retry: SwapPrefill["swapRecipientRetry"]) => void;
106
+ recipientMissing: boolean;
107
+ recipientInvalid: boolean;
108
+ restoreSettlement: (next: SettlementType) => void;
109
+ clearRecipient: () => void;
110
+ restoreRecipientTag: (tag: string) => void;
111
+ restoreRefundAddress: (address: string) => void;
112
+ /** The live form's payee: someone else's meta-address (`"other"`) or the wallet's own keys. */
113
+ stealthPayee: "self" | "other";
114
+ restoreStealthRecipient: (next: StealthRecipient | null) => void;
115
+ /** Flow-modal state, held by the composition (it also pauses the quote). */
116
+ flowOpen: boolean;
117
+ setFlowOpen: (open: boolean) => void;
118
+ /** The restored swap record, read here and by the amount group's payout. */
119
+ resumed: ResumedSwap | null;
120
+ setResumed: Dispatch<SetStateAction<ResumedSwap | null>>;
121
+ }
122
+ /** The submit button: what it says and what a click on it does. */
123
+ export interface SwapCta {
124
+ label: string;
125
+ /** "useMax" fills the pay field with the balance instead of submitting. */
126
+ action: "submit" | "useMax";
127
+ }
128
+ type ActivityRecipientDisplay = Pick<SwapActivityItem["data"], "sendRecipientDisplay" | "swapRecipientLabel" | "swapRecipientRetryInput">;
129
+ type FlowDestination = IntentDestination & ActivityRecipientDisplay & {
130
+ sendRecipient?: ResolvedRecipient;
131
+ swapRecipient?: ResolvedRecipient | null;
132
+ };
133
+ export interface UseSwapFlowResult {
134
+ handleMarketSubmit: () => Promise<void>;
135
+ handleConfirmSwap: () => void;
136
+ handleCancelSign: () => void;
137
+ /** The amount on screen differs from the held quote's; submit waits for the re-quote. */
138
+ quoteStale: boolean;
139
+ handleCloseFlow: () => void;
140
+ handleStartOver: () => void;
141
+ flowReopenable: boolean;
142
+ flowDestination: FlowDestination;
143
+ /** Whose keys the modal's Stealth ending describes, bound like `flowDestination`. */
144
+ flowStealthPayee: "self" | "other";
145
+ executionStartTime: number | null;
146
+ resumedDeposit: DepositActivity | null;
147
+ /** The one CTA, from one precedence chain: label and action cannot disagree. */
148
+ cta: SwapCta;
149
+ needsChainSwitch: boolean;
150
+ }
151
+ export declare function useSwapFlow({ prefill, sendRecipient, intent, isConnected, address, connectedChainId, fromChainId, toChainId, fromToken, toToken, routeCheck, applyRoute, amount, amountBigInt, insufficientBalance, currentBalance, excessiveSlippage, orderOutOfBounds, setAmount, settlement, settlementFix, destination, swapRecipientLabel, swapRecipient, swapRecipientRetryInput, restoreSwapRecipient, recipientMissing, recipientInvalid, restoreSettlement, clearRecipient, restoreRecipientTag, restoreRefundAddress, stealthPayee, restoreStealthRecipient, flowOpen, setFlowOpen, resumed, setResumed, }: UseSwapFlowParams): UseSwapFlowResult;
152
+ export {};