@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.
- package/CHANGELOG.md +79 -0
- package/LICENSE +21 -0
- package/README.md +420 -2
- package/THIRD_PARTY_NOTICES.txt +44 -0
- package/dist/ConfiguratorApp.js +19 -0
- package/dist/EmbedApp.js +57 -0
- package/dist/assets/MonaspaceArgon-Bold-D9kWRRK5.woff2 +0 -0
- package/dist/assets/MonaspaceArgon-Light-Dt_6qXbW.woff2 +0 -0
- package/dist/assets/MonaspaceArgon-Medium-B1gMZwrU.woff2 +0 -0
- package/dist/assets/MonaspaceArgon-Regular-RS-2TGNg.woff2 +0 -0
- package/dist/assets/MonaspaceArgon-SemiBold-PYusZXE_.woff2 +0 -0
- package/dist/assets/MonaspaceNeon-Italic-C9u9eioB.woff2 +0 -0
- package/dist/assets/MonaspaceNeon-Light-CJkxpyfT.woff2 +0 -0
- package/dist/assets/MonaspaceNeon-Medium-DCChELAx.woff2 +0 -0
- package/dist/assets/MonaspaceNeon-Regular-BZtV1wRa.woff2 +0 -0
- package/dist/assets/MonaspaceXenon-Bold-KacFhGOf.woff2 +0 -0
- package/dist/assets/MonaspaceXenon-Medium-Dqqg-cnL.woff2 +0 -0
- package/dist/assets/MonaspaceXenon-Regular-BRsdKART.woff2 +0 -0
- package/dist/assets/MonaspaceXenon-SemiBold-DNjPl3uE.woff2 +0 -0
- package/dist/assets/alipay-3tx9-HPp.svg +1 -0
- package/dist/assets/arb-CCfLcB_X.svg +7 -0
- package/dist/assets/arc-Dy98eSCd.svg +10 -0
- package/dist/assets/aztec-DiLp9qTG.svg +4 -0
- package/dist/assets/base-Ch0ino36.svg +4 -0
- package/dist/assets/cashapp-lOg0DIt8.svg +1 -0
- package/dist/assets/chains/arbitrum.svg.js +4 -0
- package/dist/assets/chains/arc.svg.js +4 -0
- package/dist/assets/chains/aztec.svg.js +4 -0
- package/dist/assets/chains/base.svg.js +4 -0
- package/dist/assets/chains/ethereum.svg.js +4 -0
- package/dist/assets/chains/gnosis.png.js +4 -0
- package/dist/assets/chains/index.js +31 -0
- package/dist/assets/chains/optimism.svg.js +4 -0
- package/dist/assets/chains/polygon.svg.js +4 -0
- package/dist/assets/chains/robinhood.svg.js +4 -0
- package/dist/assets/chains/tron.svg.js +4 -0
- package/dist/assets/chains/xochi.svg.js +4 -0
- package/dist/assets/dai-XuyZLceZ.png +0 -0
- package/dist/assets/defillama-BU037Unq.svg +1 -0
- package/dist/assets/defillama.svg.js +4 -0
- package/dist/assets/eth-Dvbng9UB.svg +8 -0
- package/dist/assets/eurc-NI9zNgOQ.png +0 -0
- package/dist/assets/eure-BH9vpwcv.png +0 -0
- package/dist/assets/gnosis-fRzAZQFj.png +0 -0
- package/dist/assets/mercadopago-gjsFb6F7.svg +1 -0
- package/dist/assets/monzo-B9XD4bL5.png +0 -0
- package/dist/assets/monzo-SZnIdUKN.svg +1 -0
- package/dist/assets/monzo-dark-Bwzg90UC.png +0 -0
- package/dist/assets/n26-cANcjY2T.svg +1 -0
- package/dist/assets/op-DF67SbB6.png +0 -0
- package/dist/assets/optimism-B3cTNxEQ.svg +4 -0
- package/dist/assets/paypal-D8xqXEtN.svg +1 -0
- package/dist/assets/pol-uLmSo2O8.svg +3 -0
- package/dist/assets/rails/SOURCES.md +50 -0
- package/dist/assets/rails/alipay.svg.js +4 -0
- package/dist/assets/rails/cashapp.svg.js +4 -0
- package/dist/assets/rails/index.js +59 -0
- package/dist/assets/rails/mercadopago.svg.js +4 -0
- package/dist/assets/rails/monzo-dark.png.js +4 -0
- package/dist/assets/rails/monzo.png.js +4 -0
- package/dist/assets/rails/monzo.svg.js +4 -0
- package/dist/assets/rails/n26.svg.js +4 -0
- package/dist/assets/rails/paypal.svg.js +4 -0
- package/dist/assets/rails/revolut-dark.png.js +4 -0
- package/dist/assets/rails/revolut.png.js +4 -0
- package/dist/assets/rails/revolut.svg.js +4 -0
- package/dist/assets/rails/venmo.svg.js +4 -0
- package/dist/assets/rails/wise-dark.png.js +4 -0
- package/dist/assets/rails/wise.png.js +4 -0
- package/dist/assets/rails/wise.svg.js +4 -0
- package/dist/assets/rails/xmoney.svg.js +4 -0
- package/dist/assets/rails/zelle.svg.js +4 -0
- package/dist/assets/raxol-86FmC34h.png +0 -0
- package/dist/assets/revolut-CiBtyALA.png +0 -0
- package/dist/assets/revolut-D7qr5Vzs.svg +1 -0
- package/dist/assets/revolut-dark-RQdWGM_p.png +0 -0
- package/dist/assets/robinhood-DgdGTQ1I.svg +8 -0
- package/dist/assets/tokens/arb.svg.js +4 -0
- package/dist/assets/tokens/dai.png.js +4 -0
- package/dist/assets/tokens/eth.svg.js +4 -0
- package/dist/assets/tokens/eurc.png.js +4 -0
- package/dist/assets/tokens/eure.png.js +4 -0
- package/dist/assets/tokens/index.js +36 -0
- package/dist/assets/tokens/op.png.js +4 -0
- package/dist/assets/tokens/pol.svg.js +4 -0
- package/dist/assets/tokens/raxol.png.js +4 -0
- package/dist/assets/tokens/usdc.png.js +4 -0
- package/dist/assets/tokens/usdg.png.js +4 -0
- package/dist/assets/tokens/usdt.png.js +4 -0
- package/dist/assets/tokens/wbtc.png.js +4 -0
- package/dist/assets/tokens/wsteth.png.js +4 -0
- package/dist/assets/tokens/zchf.png.js +4 -0
- package/dist/assets/tron-Dtumyzha.svg +4 -0
- package/dist/assets/usdc-UHSd0FoM.png +0 -0
- package/dist/assets/usdg-Cd5nCzbC.png +0 -0
- package/dist/assets/usdt-3G3YdPq8.png +0 -0
- package/dist/assets/venmo-CMHeCn-D.svg +1 -0
- package/dist/assets/wbtc-CV8uE44Q.png +0 -0
- package/dist/assets/wise-BUOflsWL.svg +1 -0
- package/dist/assets/wise-JLpDvCdq.png +0 -0
- package/dist/assets/wise-dark-_Q8pbCom.png +0 -0
- package/dist/assets/wsteth-BamwtTCR.png +0 -0
- package/dist/assets/xmoney-CwY9KVlD.svg +1 -0
- package/dist/assets/xochi-DL2f8G4R.svg +4 -0
- package/dist/assets/zchf-BLBNdTGJ.png +0 -0
- package/dist/assets/zelle-t15cG4SB.svg +1 -0
- package/dist/browser.js +4 -0
- package/dist/components/AccountChip.js +29 -0
- package/dist/components/ActivityFeed.js +710 -0
- package/dist/components/AssetsStrip.js +133 -0
- package/dist/components/AuthorizedAgents.js +197 -0
- package/dist/components/Chevron.js +22 -0
- package/dist/components/ErrorDisplay.js +68 -0
- package/dist/components/InfoButton.js +27 -0
- package/dist/components/IntentTimeline.js +202 -0
- package/dist/components/LinksSignIn.js +26 -0
- package/dist/components/MobileSigningBanner.js +44 -0
- package/dist/components/PrivacyBars.js +44 -0
- package/dist/components/PrivacyPanel.js +99 -0
- package/dist/components/QuoteDetails.js +327 -0
- package/dist/components/ReceiptCommand.js +46 -0
- package/dist/components/SessionReloadBanner.js +19 -0
- package/dist/components/SolverRace.js +62 -0
- package/dist/components/StealthClaims.js +179 -0
- package/dist/components/SwapFlowModal.js +408 -0
- package/dist/components/Toast.js +40 -0
- package/dist/components/TokenIcon.js +21 -0
- package/dist/components/TokenSearchModal.js +331 -0
- package/dist/components/TransactionPreview.js +230 -0
- package/dist/components/WalletProvider.js +41 -0
- package/dist/components/WrapModal.js +192 -0
- package/dist/components/swap-flow/CantonEscrowPanel.js +28 -0
- package/dist/components/swap-flow/CantonEscrowStatus.js +160 -0
- package/dist/components/swap-flow/DepositInstructions.js +156 -0
- package/dist/components/swap-flow/QrCode.js +22 -0
- package/dist/components/swap-flow/SwapResult.js +325 -0
- package/dist/components/swap-flow/depositScreen.js +36 -0
- package/dist/components/widgetTabsContext.js +17 -0
- package/dist/config.js +132 -0
- package/dist/configurator-model.js +71 -0
- package/dist/configurator.js +11 -0
- package/dist/constants.js +53 -0
- package/dist/hooks/applyTheme.js +10 -0
- package/dist/hooks/useAgentRegistry.js +28 -0
- package/dist/hooks/useAgentStream.js +89 -0
- package/dist/hooks/useCantonEscrow.js +89 -0
- package/dist/hooks/useCapabilities.js +86 -0
- package/dist/hooks/useEmbedLook.js +23 -0
- package/dist/hooks/useFocusTrap.js +44 -0
- package/dist/hooks/useIntent.js +485 -0
- package/dist/hooks/useIntentStatusPoll.js +71 -0
- package/dist/hooks/useIntentStream.js +95 -0
- package/dist/hooks/useLocalActivity.js +114 -0
- package/dist/hooks/useLocalSends.js +15 -0
- package/dist/hooks/useLocalStorage.js +26 -0
- package/dist/hooks/useOrderHistory.js +307 -0
- package/dist/hooks/usePermit.js +203 -0
- package/dist/hooks/usePrices.js +49 -0
- package/dist/hooks/usePublicBalances.js +186 -0
- package/dist/hooks/useRampSummaries.js +19 -0
- package/dist/hooks/useRecipientBalance.js +98 -0
- package/dist/hooks/useSettlements.js +33 -0
- package/dist/hooks/useStealth.js +324 -0
- package/dist/hooks/useStealthClaim.js +183 -0
- package/dist/hooks/useStealthScanner.js +259 -0
- package/dist/hooks/useTheme.js +48 -0
- package/dist/hooks/useTierInfo.js +20 -0
- package/dist/hooks/useTrustScore.js +16 -0
- package/dist/hooks/useWalletSession.js +70 -0
- package/dist/hooks/useWrapEth.js +60 -0
- package/dist/index.js +41 -0
- package/dist/integration.js +19 -0
- package/dist/lib/activityValue.js +20 -0
- package/dist/lib/agentConnect.js +11 -0
- package/dist/lib/agentRegistry.js +83 -0
- package/dist/lib/agentStreamVerify.js +47 -0
- package/dist/lib/api.js +67 -0
- package/dist/lib/auth.js +8 -0
- package/dist/lib/authFetch.js +33 -0
- package/dist/lib/aztecTokens.js +13 -0
- package/dist/lib/balances.js +77 -0
- package/dist/lib/capabilities.js +40 -0
- package/dist/lib/claimSubmitPoll.js +63 -0
- package/dist/lib/debug.js +7 -0
- package/dist/lib/declineGuidance.js +31 -0
- package/dist/lib/displayFallbacks.js +25 -0
- package/dist/lib/eip712.js +38 -0
- package/dist/lib/errorCategory.js +202 -0
- package/dist/lib/errorReport.js +19 -0
- package/dist/lib/explorerLinks.js +30 -0
- package/dist/lib/feesLabel.js +19 -0
- package/dist/lib/glyphs.js +58 -0
- package/dist/lib/hostBridge.js +41 -0
- package/dist/lib/hostOrigin.js +52 -0
- package/dist/lib/intentAPI.js +39 -0
- package/dist/lib/linksSignIn.js +9 -0
- package/dist/lib/localActivity.js +247 -0
- package/dist/lib/localSends.js +129 -0
- package/dist/lib/mobileWallet.js +17 -0
- package/dist/lib/pairAvailability.js +29 -0
- package/dist/lib/paymentSummary.js +23 -0
- package/dist/lib/permits.js +27 -0
- package/dist/lib/priceImpact.js +101 -0
- package/dist/lib/providers.js +124 -0
- package/dist/lib/qr.js +20 -0
- package/dist/lib/quoteCost.js +34 -0
- package/dist/lib/quoteCountdown.js +24 -0
- package/dist/lib/rampHostGate.js +24 -0
- package/dist/lib/rampLifecycle.js +63 -0
- package/dist/lib/receiptCost.js +64 -0
- package/dist/lib/recipient/index.js +302 -0
- package/dist/lib/recipient/recent.js +47 -0
- package/dist/lib/recipientReceipt.js +16 -0
- package/dist/lib/reportClient.js +32 -0
- package/dist/lib/sessionExpiry.js +11 -0
- package/dist/lib/settlementAvailability.js +34 -0
- package/dist/lib/stealth.js +110 -0
- package/dist/lib/swapFlowPhase.js +52 -0
- package/dist/lib/swapStatusCopy.js +59 -0
- package/dist/lib/tradeLifecycle.js +40 -0
- package/dist/lib/tronlink.js +71 -0
- package/dist/lib/walletSession.js +87 -0
- package/dist/pages/Configurator.js +390 -0
- package/dist/pages/Trade.js +635 -0
- package/dist/pages/configurator/AllowedAssetsSection.js +98 -0
- package/dist/pages/configurator/AppearanceSection.js +44 -0
- package/dist/pages/configurator/CodeDock.js +140 -0
- package/dist/pages/configurator/DeveloperSection.js +40 -0
- package/dist/pages/configurator/IntegrationSection.js +105 -0
- package/dist/pages/configurator/LayoutSection.js +83 -0
- package/dist/pages/configurator/PolicyNote.js +7 -0
- package/dist/pages/configurator/PreviewStage.js +165 -0
- package/dist/pages/configurator/PrivacySection.js +54 -0
- package/dist/pages/configurator/RouteSection.js +211 -0
- package/dist/pages/configurator/Settings.js +35 -0
- package/dist/pages/configurator/SharedLinkBanner.js +25 -0
- package/dist/pages/configurator/SurfaceSection.js +124 -0
- package/dist/pages/configurator/WhatUsersSee.js +268 -0
- package/dist/pages/configurator/codeShown.js +8 -0
- package/dist/pages/configurator/configuratorUrl.js +33 -0
- package/dist/pages/configurator/paramsDraft.js +82 -0
- package/dist/pages/configurator/previewModel.js +10 -0
- package/dist/pages/configurator/previewQuote.js +109 -0
- package/dist/pages/configurator/routePicks.js +131 -0
- package/dist/pages/configurator/snippets.js +98 -0
- package/dist/pages/configurator/surfaceParams.js +51 -0
- package/dist/pages/configurator/useCodeCheck.js +79 -0
- package/dist/pages/configurator/useConfiguratorUrl.js +24 -0
- package/dist/pages/configurator/useMediaQuery.js +20 -0
- package/dist/pages/configurator/useParamsDraft.js +33 -0
- package/dist/pages/configurator/usePreviewFee.js +100 -0
- package/dist/pages/send/MetaAddressValue.js +28 -0
- package/dist/pages/send/Receive.js +168 -0
- package/dist/pages/send/RecentRecipients.js +23 -0
- package/dist/pages/send/RecipientChip.js +26 -0
- package/dist/pages/send/ScanRecipient.js +85 -0
- package/dist/pages/send/SendForm.js +516 -0
- package/dist/pages/send/SendPanel.js +30 -0
- package/dist/pages/send/ShieldedDisclosure.js +12 -0
- package/dist/pages/send/StealthInvite.js +27 -0
- package/dist/pages/send/addressSend.js +92 -0
- package/dist/pages/send/sendCopy.js +10 -0
- package/dist/pages/send/sendRetry.js +24 -0
- package/dist/pages/send/stealthRecipient.js +65 -0
- package/dist/pages/send/stealthSend.js +15 -0
- package/dist/pages/send/useAddressSend.js +257 -0
- package/dist/pages/send/useSendRecipient.js +61 -0
- package/dist/pages/trade/BuyPanel.js +70 -0
- package/dist/pages/trade/RampRecovery.js +41 -0
- package/dist/pages/trade/RecipientSheet.js +182 -0
- package/dist/pages/trade/Selectors.js +152 -0
- package/dist/pages/trade/SwapPanel.js +972 -0
- package/dist/pages/trade/WidgetTabs.js +109 -0
- package/dist/pages/trade/canton.js +122 -0
- package/dist/pages/trade/config.js +70 -0
- package/dist/pages/trade/embedNarrowing.js +25 -0
- package/dist/pages/trade/embedParams.js +532 -0
- package/dist/pages/trade/embedTheme.js +9 -0
- package/dist/pages/trade/orderMinimum.js +8 -0
- package/dist/pages/trade/resumeSwap.js +55 -0
- package/dist/pages/trade/settlementCopy.js +32 -0
- package/dist/pages/trade/useAmountFit.js +31 -0
- package/dist/pages/trade/useEmbedDefaults.js +18 -0
- package/dist/pages/trade/useSettlementGating.js +289 -0
- package/dist/pages/trade/useSwapAmount.js +191 -0
- package/dist/pages/trade/useSwapFlow.js +511 -0
- package/dist/pages/trade/useSwapPanel.js +475 -0
- package/dist/pages/trade/useSwapRoute.js +634 -0
- package/dist/pages/trade/useTronLinkFill.js +34 -0
- package/dist/pages/trade/zkMoney.js +46 -0
- package/dist/promiseWithResolvers.js +20 -0
- package/dist/ramp/availability/RailTiles.js +156 -0
- package/dist/ramp/availability/RampDisclosure.js +38 -0
- package/dist/ramp/availability/RampRails.js +170 -0
- package/dist/ramp/availability/model.js +207 -0
- package/dist/ramp/availability/useRampDiscovery.js +83 -0
- package/dist/ramp/offramp/CompletedPrerequisite.js +23 -0
- package/dist/ramp/offramp/OfframpActivityList.js +16 -0
- package/dist/ramp/offramp/OfframpRoute.js +222 -0
- package/dist/ramp/offramp/OfframpRouteReview.js +94 -0
- package/dist/ramp/offramp/PaymentAppSend.js +765 -0
- package/dist/ramp/offramp/localOfframps.js +101 -0
- package/dist/ramp/offramp/model.js +154 -0
- package/dist/ramp/offramp/port.js +134 -0
- package/dist/ramp/offramp/prerequisite.js +143 -0
- package/dist/ramp/offramp/useOfframp.js +505 -0
- package/dist/ramp/offramp/useOfframpRails.js +73 -0
- package/dist/ramp/peer/BuyOnramp.js +292 -0
- package/dist/ramp/peer/OnrampSteps.js +148 -0
- package/dist/ramp/peer/buyerDriver.js +461 -0
- package/dist/ramp/peer/discovery.js +231 -0
- package/dist/ramp/peer/environment.js +7 -0
- package/dist/ramp/peer/liveProvider.js +87 -0
- package/dist/ramp/peer/liveReads.js +488 -0
- package/dist/ramp/peer/maker.js +92 -0
- package/dist/ramp/peer/normalization.js +184 -0
- package/dist/ramp/peer/offramp.js +648 -0
- package/dist/ramp/peer/onramp.js +353 -0
- package/dist/ramp/peer/preview.js +52 -0
- package/dist/ramp/peer/protectedMapping.js +67 -0
- package/dist/ramp/peer/runtime.js +55 -0
- package/dist/ramp/peer/sdkMaker.js +107 -0
- package/dist/ramp/recovery/ResumeOnramp.js +153 -0
- package/dist/ramp/recovery/summaries.js +173 -0
- package/dist/ramp/route/OnrampRoute.js +255 -0
- package/dist/ramp/route/RampRouteSteps.js +148 -0
- package/dist/ramp/route/routeActivity.js +12 -0
- package/dist/ramp/route/useXochiRampDriver.js +203 -0
- package/dist/styles.css +17473 -0
- package/dist/styles.js +2 -0
- package/dist/types/ConfiguratorApp.d.ts +6 -0
- package/dist/types/EmbedApp.d.ts +2 -0
- package/dist/types/activity.js +50 -0
- package/dist/types/asset.d.ts +2 -0
- package/dist/types/assets/chains/index.d.ts +3 -0
- package/dist/types/assets/rails/index.d.ts +12 -0
- package/dist/types/assets/tokens/index.d.ts +1 -0
- package/dist/types/browser.d.ts +1 -0
- package/dist/types/components/AccountChip.d.ts +10 -0
- package/dist/types/components/ActivityFeed.d.ts +46 -0
- package/dist/types/components/AssetsStrip.d.ts +14 -0
- package/dist/types/components/AuthorizedAgents.d.ts +15 -0
- package/dist/types/components/Chevron.d.ts +16 -0
- package/dist/types/components/ErrorDisplay.d.ts +46 -0
- package/dist/types/components/InfoButton.d.ts +6 -0
- package/dist/types/components/IntentTimeline.d.ts +41 -0
- package/dist/types/components/LinksSignIn.d.ts +13 -0
- package/dist/types/components/MobileSigningBanner.d.ts +16 -0
- package/dist/types/components/PermitBadge.d.ts +17 -0
- package/dist/types/components/PrivacyBars.d.ts +12 -0
- package/dist/types/components/PrivacyPanel.d.ts +33 -0
- package/dist/types/components/QuoteDetails.d.ts +56 -0
- package/dist/types/components/RampActivityList.d.ts +14 -0
- package/dist/types/components/ReceiptCommand.d.ts +12 -0
- package/dist/types/components/SessionReloadBanner.d.ts +8 -0
- package/dist/types/components/SolverRace.d.ts +35 -0
- package/dist/types/components/StealthClaims.d.ts +51 -0
- package/dist/types/components/SwapFlowModal.d.ts +142 -0
- package/dist/types/components/Toast.d.ts +10 -0
- package/dist/types/components/TokenIcon.d.ts +17 -0
- package/dist/types/components/TokenSearchModal.d.ts +28 -0
- package/dist/types/components/TransactionPreview.d.ts +37 -0
- package/dist/types/components/WalletProvider.d.ts +12 -0
- package/dist/types/components/WrapModal.d.ts +19 -0
- package/dist/types/components/swap-flow/CantonEscrowPanel.d.ts +14 -0
- package/dist/types/components/swap-flow/CantonEscrowStatus.d.ts +30 -0
- package/dist/types/components/swap-flow/DepositInstructions.d.ts +75 -0
- package/dist/types/components/swap-flow/QrCode.d.ts +18 -0
- package/dist/types/components/swap-flow/SwapResult.d.ts +68 -0
- package/dist/types/components/swap-flow/depositScreen.d.ts +67 -0
- package/dist/types/components/widgetTabsContext.d.ts +21 -0
- package/dist/types/config.d.ts +104 -0
- package/dist/types/configurator-model.d.ts +9 -0
- package/dist/types/configurator.d.ts +3 -0
- package/dist/types/constants.d.ts +52 -0
- package/dist/types/hooks/applyTheme.d.ts +7 -0
- package/dist/types/hooks/useAgentRegistry.d.ts +13 -0
- package/dist/types/hooks/useAgentStream.d.ts +15 -0
- package/dist/types/hooks/useCantonEscrow.d.ts +40 -0
- package/dist/types/hooks/useCapabilities.d.ts +83 -0
- package/dist/types/hooks/useEmbedLook.d.ts +4 -0
- package/dist/types/hooks/useFocusTrap.d.ts +7 -0
- package/dist/types/hooks/useIntent.d.ts +161 -0
- package/dist/types/hooks/useIntentStatusPoll.d.ts +107 -0
- package/dist/types/hooks/useIntentStream.d.ts +34 -0
- package/dist/types/hooks/useLocalActivity.d.ts +22 -0
- package/dist/types/hooks/useLocalSends.d.ts +8 -0
- package/dist/types/hooks/useLocalStorage.d.ts +8 -0
- package/dist/types/hooks/useOrderHistory.d.ts +52 -0
- package/dist/types/hooks/usePermit.d.ts +90 -0
- package/dist/types/hooks/usePrices.d.ts +72 -0
- package/dist/types/hooks/usePublicBalances.d.ts +19 -0
- package/dist/types/hooks/useRampSummaries.d.ts +9 -0
- package/dist/types/hooks/useRecipientBalance.d.ts +58 -0
- package/dist/types/hooks/useSettlements.d.ts +14 -0
- package/dist/types/hooks/useStealth.d.ts +72 -0
- package/dist/types/hooks/useStealthClaim.d.ts +96 -0
- package/dist/types/hooks/useStealthScanner.d.ts +44 -0
- package/dist/types/hooks/useTheme.d.ts +29 -0
- package/dist/types/hooks/useTierInfo.d.ts +23 -0
- package/dist/types/hooks/useTrustScore.d.ts +16 -0
- package/dist/types/hooks/useWalletSession.d.ts +21 -0
- package/dist/types/hooks/useWrapEth.d.ts +21 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.js +8 -0
- package/dist/types/integration.d.ts +9 -0
- package/dist/types/intent.js +85 -0
- package/dist/types/lib/activityValue.d.ts +16 -0
- package/dist/types/lib/agentConnect.d.ts +23 -0
- package/dist/types/lib/agentRegistry.d.ts +47 -0
- package/dist/types/lib/agentStreamVerify.d.ts +29 -0
- package/dist/types/lib/api.d.ts +41 -0
- package/dist/types/lib/auth.d.ts +6 -0
- package/dist/types/lib/authFetch.d.ts +14 -0
- package/dist/types/lib/aztecTokens.d.ts +15 -0
- package/dist/types/lib/balances.d.ts +88 -0
- package/dist/types/lib/capabilities.d.ts +3 -0
- package/dist/types/lib/claimSubmitPoll.d.ts +114 -0
- package/dist/types/lib/debug.d.ts +13 -0
- package/dist/types/lib/declineGuidance.d.ts +55 -0
- package/dist/types/lib/displayFallbacks.d.ts +7 -0
- package/dist/types/lib/eip712.d.ts +61 -0
- package/dist/types/lib/errorCategory.d.ts +50 -0
- package/dist/types/lib/errorReport.d.ts +15 -0
- package/dist/types/lib/explorerLinks.d.ts +67 -0
- package/dist/types/lib/feesLabel.d.ts +20 -0
- package/dist/types/lib/glyphs.d.ts +52 -0
- package/dist/types/lib/hostBridge.d.ts +11 -0
- package/dist/types/lib/hostOrigin.d.ts +30 -0
- package/dist/types/lib/intentAPI.d.ts +15 -0
- package/dist/types/lib/linksSignIn.d.ts +13 -0
- package/dist/types/lib/localActivity.d.ts +135 -0
- package/dist/types/lib/localSends.d.ts +55 -0
- package/dist/types/lib/mobileWallet.d.ts +27 -0
- package/dist/types/lib/pairAvailability.d.ts +106 -0
- package/dist/types/lib/paymentSummary.d.ts +18 -0
- package/dist/types/lib/permits.d.ts +25 -0
- package/dist/types/lib/priceImpact.d.ts +165 -0
- package/dist/types/lib/providers.d.ts +14 -0
- package/dist/types/lib/qr.d.ts +19 -0
- package/dist/types/lib/quoteCost.d.ts +45 -0
- package/dist/types/lib/quoteCountdown.d.ts +34 -0
- package/dist/types/lib/rampHostGate.d.ts +15 -0
- package/dist/types/lib/rampLifecycle.d.ts +20 -0
- package/dist/types/lib/receiptCost.d.ts +64 -0
- package/dist/types/lib/recipient/index.d.ts +33 -0
- package/dist/types/lib/recipient/recent.d.ts +5 -0
- package/dist/types/lib/recipientReceipt.d.ts +25 -0
- package/dist/types/lib/reportClient.d.ts +9 -0
- package/dist/types/lib/sessionExpiry.d.ts +11 -0
- package/dist/types/lib/settlementAvailability.d.ts +61 -0
- package/dist/types/lib/stealth.d.ts +75 -0
- package/dist/types/lib/swapFlowPhase.d.ts +76 -0
- package/dist/types/lib/swapStatusCopy.d.ts +57 -0
- package/dist/types/lib/tierProgressDisplay.d.ts +35 -0
- package/dist/types/lib/tierUnlock.d.ts +25 -0
- package/dist/types/lib/tradeLifecycle.d.ts +32 -0
- package/dist/types/lib/tronlink.d.ts +62 -0
- package/dist/types/lib/walletSession.d.ts +38 -0
- package/dist/types/pages/Configurator.d.ts +25 -0
- package/dist/types/pages/Trade.d.ts +36 -0
- package/dist/types/pages/configurator/AllowedAssetsSection.d.ts +17 -0
- package/dist/types/pages/configurator/AppearanceSection.d.ts +22 -0
- package/dist/types/pages/configurator/CodeDock.d.ts +19 -0
- package/dist/types/pages/configurator/DeveloperSection.d.ts +12 -0
- package/dist/types/pages/configurator/IntegrationSection.d.ts +20 -0
- package/dist/types/pages/configurator/LayoutSection.d.ts +20 -0
- package/dist/types/pages/configurator/PolicyNote.d.ts +6 -0
- package/dist/types/pages/configurator/PreviewStage.d.ts +22 -0
- package/dist/types/pages/configurator/PrivacySection.d.ts +16 -0
- package/dist/types/pages/configurator/RouteSection.d.ts +30 -0
- package/dist/types/pages/configurator/Settings.d.ts +25 -0
- package/dist/types/pages/configurator/SharedLinkBanner.d.ts +16 -0
- package/dist/types/pages/configurator/SurfaceSection.d.ts +5 -0
- package/dist/types/pages/configurator/WhatUsersSee.d.ts +30 -0
- package/dist/types/pages/configurator/codeShown.d.ts +15 -0
- package/dist/types/pages/configurator/configuratorUrl.d.ts +38 -0
- package/dist/types/pages/configurator/paramsDraft.d.ts +32 -0
- package/dist/types/pages/configurator/previewModel.d.ts +20 -0
- package/dist/types/pages/configurator/previewQuote.d.ts +96 -0
- package/dist/types/pages/configurator/routePicks.d.ts +75 -0
- package/dist/types/pages/configurator/snippets.d.ts +23 -0
- package/dist/types/pages/configurator/surfaceParams.d.ts +9 -0
- package/dist/types/pages/configurator/useCodeCheck.d.ts +56 -0
- package/dist/types/pages/configurator/useConfiguratorUrl.d.ts +21 -0
- package/dist/types/pages/configurator/useMediaQuery.d.ts +5 -0
- package/dist/types/pages/configurator/useParamsDraft.d.ts +29 -0
- package/dist/types/pages/configurator/usePreviewFee.d.ts +74 -0
- package/dist/types/pages/send/MetaAddressValue.d.ts +9 -0
- package/dist/types/pages/send/Receive.d.ts +3 -0
- package/dist/types/pages/send/RecentRecipients.d.ts +3 -0
- package/dist/types/pages/send/RecipientChip.d.ts +4 -0
- package/dist/types/pages/send/ScanRecipient.d.ts +3 -0
- package/dist/types/pages/send/SendForm.d.ts +17 -0
- package/dist/types/pages/send/SendPanel.d.ts +19 -0
- package/dist/types/pages/send/ShieldedDisclosure.d.ts +1 -0
- package/dist/types/pages/send/StealthInvite.d.ts +1 -0
- package/dist/types/pages/send/addressSend.d.ts +62 -0
- package/dist/types/pages/send/sendCopy.d.ts +9 -0
- package/dist/types/pages/send/sendRetry.d.ts +10 -0
- package/dist/types/pages/send/stealthRecipient.d.ts +37 -0
- package/dist/types/pages/send/stealthSend.d.ts +18 -0
- package/dist/types/pages/send/useAddressSend.d.ts +61 -0
- package/dist/types/pages/send/useSendRecipient.d.ts +13 -0
- package/dist/types/pages/trade/BuyPanel.d.ts +22 -0
- package/dist/types/pages/trade/RampRecovery.d.ts +22 -0
- package/dist/types/pages/trade/RecipientSheet.d.ts +11 -0
- package/dist/types/pages/trade/Selectors.d.ts +24 -0
- package/dist/types/pages/trade/SwapPanel.d.ts +34 -0
- package/dist/types/pages/trade/WidgetTabs.d.ts +46 -0
- package/dist/types/pages/trade/canton.d.ts +94 -0
- package/dist/types/pages/trade/config.d.ts +185 -0
- package/dist/types/pages/trade/embedNarrowing.d.ts +28 -0
- package/dist/types/pages/trade/embedParams.d.ts +299 -0
- package/dist/types/pages/trade/embedTheme.d.ts +14 -0
- package/dist/types/pages/trade/harness.d.ts +120 -0
- package/dist/types/pages/trade/orderMinimum.d.ts +5 -0
- package/dist/types/pages/trade/resumeSwap.d.ts +139 -0
- package/dist/types/pages/trade/settlementCopy.d.ts +42 -0
- package/dist/types/pages/trade/useAmountFit.d.ts +25 -0
- package/dist/types/pages/trade/useEmbedDefaults.d.ts +28 -0
- package/dist/types/pages/trade/useSettlementGating.d.ts +152 -0
- package/dist/types/pages/trade/useSwapAmount.d.ts +93 -0
- package/dist/types/pages/trade/useSwapFlow.d.ts +152 -0
- package/dist/types/pages/trade/useSwapPanel.d.ts +170 -0
- package/dist/types/pages/trade/useSwapRoute.d.ts +215 -0
- package/dist/types/pages/trade/useTronLinkFill.d.ts +13 -0
- package/dist/types/pages/trade/zkMoney.d.ts +28 -0
- package/dist/types/promiseWithResolvers.d.ts +12 -0
- package/dist/types/ramp/availability/RailTiles.d.ts +26 -0
- package/dist/types/ramp/availability/RampDisclosure.d.ts +9 -0
- package/dist/types/ramp/availability/RampRails.d.ts +27 -0
- package/dist/types/ramp/availability/model.d.ts +51 -0
- package/dist/types/ramp/availability/useRampDiscovery.d.ts +60 -0
- package/dist/types/ramp/offramp/CompletedPrerequisite.d.ts +5 -0
- package/dist/types/ramp/offramp/OfframpActivityList.d.ts +12 -0
- package/dist/types/ramp/offramp/OfframpRoute.d.ts +8 -0
- package/dist/types/ramp/offramp/OfframpRouteReview.d.ts +12 -0
- package/dist/types/ramp/offramp/PaymentAppSend.d.ts +27 -0
- package/dist/types/ramp/offramp/localOfframps.d.ts +58 -0
- package/dist/types/ramp/offramp/model.d.ts +46 -0
- package/dist/types/ramp/offramp/port.d.ts +55 -0
- package/dist/types/ramp/offramp/prerequisite.d.ts +271 -0
- package/dist/types/ramp/offramp/useOfframp.d.ts +87 -0
- package/dist/types/ramp/offramp/useOfframpRails.d.ts +36 -0
- package/dist/types/ramp/peer/BuyOnramp.d.ts +21 -0
- package/dist/types/ramp/peer/OnrampSteps.d.ts +32 -0
- package/dist/types/ramp/peer/buyerDriver.d.ts +48 -0
- package/dist/types/ramp/peer/discovery.d.ts +17 -0
- package/dist/types/ramp/peer/environment.d.ts +2 -0
- package/dist/types/ramp/peer/index.d.ts +14 -0
- package/dist/types/ramp/peer/liveProvider.d.ts +15 -0
- package/dist/types/ramp/peer/liveReads.d.ts +102 -0
- package/dist/types/ramp/peer/maker.d.ts +4 -0
- package/dist/types/ramp/peer/normalization.d.ts +33 -0
- package/dist/types/ramp/peer/offramp.d.ts +130 -0
- package/dist/types/ramp/peer/onramp.d.ts +134 -0
- package/dist/types/ramp/peer/preview.d.ts +14 -0
- package/dist/types/ramp/peer/protectedMapping.d.ts +22 -0
- package/dist/types/ramp/peer/runtime.d.ts +15 -0
- package/dist/types/ramp/peer/sdkMaker.d.ts +67 -0
- package/dist/types/ramp/peer/types.d.ts +64 -0
- package/dist/types/ramp/recovery/ResumeOnramp.d.ts +37 -0
- package/dist/types/ramp/recovery/summaries.d.ts +71 -0
- package/dist/types/ramp/route/OnrampRoute.d.ts +12 -0
- package/dist/types/ramp/route/RampRouteSteps.d.ts +16 -0
- package/dist/types/ramp/route/routeActivity.d.ts +4 -0
- package/dist/types/ramp/route/useXochiRampDriver.d.ts +22 -0
- package/dist/types/result.js +14 -0
- package/dist/types/styles.d.ts +1 -0
- package/dist/types/types/activity.d.ts +184 -0
- package/dist/types/types/index.d.ts +20 -0
- package/dist/types/types/intent.d.ts +85 -0
- package/dist/types/types/result.d.ts +53 -0
- package/dist/types/utils/format.d.ts +88 -0
- package/dist/types/wagmi.d.ts +143 -0
- package/dist/types/widgetLibModule.d.ts +8 -0
- package/dist/utils/format.js +109 -0
- package/dist/wagmi.js +210 -0
- package/dist/widgetLibModule.js +4 -0
- package/licenses/Monaspace-OFL-1.1.txt +93 -0
- package/licenses/assets.json +132 -0
- package/licenses/rainbowkit-MIT.txt +9 -0
- package/licenses/xochi-shared-MIT.txt +21 -0
- package/package.json +115 -4
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SwapFlowModal
|
|
3
|
+
*
|
|
4
|
+
* One focused surface for the whole swap lifecycle: Confirm -> Confirm in wallet
|
|
5
|
+
* -> Submitting -> Bridging/Settling -> Done/Failed, derived from useIntent's
|
|
6
|
+
* receipt phase (the single source of truth). Owns the overlay, header, focus
|
|
7
|
+
* trap and aria-live; routes to the confirm body (TransactionPreview), the
|
|
8
|
+
* progress view (IntentTimeline), or the terminal view (SwapResult).
|
|
9
|
+
*
|
|
10
|
+
* The caller decides reset semantics in onClose: never reset while in flight
|
|
11
|
+
* (it would drop the WebSocket subscription); reset only on a terminal phase.
|
|
12
|
+
*/
|
|
13
|
+
import type { IntentStatus, QuoteResponse, IntentDestination, SelectableChainId, PermitType, OriginApproval, RaceWebSocketMessage } from "../types/intent.js";
|
|
14
|
+
import type { EscrowStatusData } from "@xochi/client";
|
|
15
|
+
import { type Receipt, type StructuredError } from "@xochi/client";
|
|
16
|
+
import type { StoredDepositAttestation } from "@xochi/client";
|
|
17
|
+
import { type SendRecipientDisplay } from "../pages/send/sendCopy.js";
|
|
18
|
+
/**
|
|
19
|
+
* The intent facts this modal renders, as ONE object.
|
|
20
|
+
*
|
|
21
|
+
* Eighteen of these were separate props, drilled `useIntent` -> `useSwapPanel`
|
|
22
|
+
* -> `SwapPanel` -> here and then re-drilled into four children, which made
|
|
23
|
+
* every new intent field a four-file edit and put a second path beside every
|
|
24
|
+
* fact. `attestedDeposit` documents where that second path bites: it MUST come
|
|
25
|
+
* off the intent rather than the live `wallet`, because `awaiting_deposit` is
|
|
26
|
+
* deliberately not wallet-interruptible, so the two disagree during an account
|
|
27
|
+
* switch and the wallet-derived one names an address the attestation never
|
|
28
|
+
* covered. With one object there is no second path to pick the wrong side of.
|
|
29
|
+
*
|
|
30
|
+
* Structural, not `UseIntentReturn`: this names exactly the fields the flow
|
|
31
|
+
* surface reads, so `useIntent`'s full return satisfies it without the modal
|
|
32
|
+
* gaining a dependency on the hook.
|
|
33
|
+
*/
|
|
34
|
+
export interface IntentView {
|
|
35
|
+
status: IntentStatus;
|
|
36
|
+
error: string | StructuredError | null;
|
|
37
|
+
/** Plain-language refund explanation; shown on the refunded terminal view. */
|
|
38
|
+
refundReason: string | null;
|
|
39
|
+
intentId: string | null;
|
|
40
|
+
quoteId: string | null;
|
|
41
|
+
txHash: string | null;
|
|
42
|
+
receivingTxHash: string | null;
|
|
43
|
+
/** Public fill receipt (Riddler #632) + its chain; drives the receipt CTA. */
|
|
44
|
+
settlementTxHash: string | null;
|
|
45
|
+
settlementChainId: SelectableChainId | null;
|
|
46
|
+
/** Riddler's granular fill substatus; distinguishes a delivered leg (xochi#376). */
|
|
47
|
+
substatus: string | null;
|
|
48
|
+
/**
|
|
49
|
+
* A Canton order's escrow fields from the status poll. Its progress is read
|
|
50
|
+
* off these and the lock (`CantonEscrowPanel`), never off the phase.
|
|
51
|
+
*/
|
|
52
|
+
escrow?: EscrowStatusData | null;
|
|
53
|
+
quote: QuoteResponse | null;
|
|
54
|
+
permitType: PermitType;
|
|
55
|
+
/** Whether the pull needs an approval transaction first; the confirm copy states it. */
|
|
56
|
+
approval: OriginApproval;
|
|
57
|
+
approvalMayNeedReset: boolean;
|
|
58
|
+
unlimitedApproval: boolean;
|
|
59
|
+
setUnlimitedApproval: (enabled: boolean) => void;
|
|
60
|
+
/** Two-step signing (deep-link wallets): awaiting the user's tap for signature 2. */
|
|
61
|
+
awaitingPull: boolean;
|
|
62
|
+
/** The pull signature prompt (step 2) is in flight. */
|
|
63
|
+
isSigningPull: boolean;
|
|
64
|
+
/** Seconds until the quote hard-expires; drives the confirm-button countdown. */
|
|
65
|
+
quoteExpiresIn: number | null;
|
|
66
|
+
/** Live race frames for this intent. Display-only. */
|
|
67
|
+
raceEvents: RaceWebSocketMessage[];
|
|
68
|
+
/** Measured solver fill time in ms (submit -> filled); shown on success. */
|
|
69
|
+
fillMs: number | null;
|
|
70
|
+
/**
|
|
71
|
+
* Payout address the live quote's attestation was VERIFIED against, echoed on
|
|
72
|
+
* the deposit screen. Absent on every EVM route.
|
|
73
|
+
*/
|
|
74
|
+
attestedDeposit: StoredDepositAttestation | null;
|
|
75
|
+
/**
|
|
76
|
+
* The status poll has hit its ceiling and stopped. The difference between "no
|
|
77
|
+
* deposit seen yet" and "no longer looking" -- the deposit screen states which
|
|
78
|
+
* out loud. Derived here rather than at the call site: `depositCheckActive`
|
|
79
|
+
* used to be computed in SwapPanel, which is the same duplicated-fact shape
|
|
80
|
+
* the drill above created.
|
|
81
|
+
*/
|
|
82
|
+
pollExhausted: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* The machine's receipt (`view(model)`). The phase is its phase, so this modal
|
|
85
|
+
* and the panel's close (`handleCloseFlow`) cannot disagree about it, and the
|
|
86
|
+
* confirm surface reads why a sign ceremony was refused off its signing slot,
|
|
87
|
+
* never off raw state.
|
|
88
|
+
*/
|
|
89
|
+
receipt: Pick<Receipt, "phase" | "signing">;
|
|
90
|
+
notExecuted: boolean;
|
|
91
|
+
}
|
|
92
|
+
interface SwapFlowModalProps {
|
|
93
|
+
open: boolean;
|
|
94
|
+
/** Everything the flow renders about the intent itself. */
|
|
95
|
+
intent: IntentView;
|
|
96
|
+
fromAmount: string;
|
|
97
|
+
fromSymbol: string;
|
|
98
|
+
fromDecimals: number;
|
|
99
|
+
toSymbol: string;
|
|
100
|
+
toDecimals: number;
|
|
101
|
+
receivedAmount?: string;
|
|
102
|
+
fromChainId: SelectableChainId;
|
|
103
|
+
toChainId: SelectableChainId;
|
|
104
|
+
swapRecipientLabel?: string;
|
|
105
|
+
destination: IntentDestination & {
|
|
106
|
+
sendRecipientDisplay?: SendRecipientDisplay;
|
|
107
|
+
};
|
|
108
|
+
/** On a Stealth destination: `"other"` paid someone else's keys, so the ending has no claim. */
|
|
109
|
+
stealthPayee?: "self" | "other";
|
|
110
|
+
isCrossChain: boolean;
|
|
111
|
+
estimatedDuration: number;
|
|
112
|
+
startTime?: number;
|
|
113
|
+
wallet?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Deposit facts restored from the persisted record, for a swap resumed after
|
|
116
|
+
* the tab was lost. Used only when there is no live quote, which is the state
|
|
117
|
+
* a resumed intent is always in (no quote is ever synthesized, because a
|
|
118
|
+
* fabricated price shown as current would be a lie). Absent on every ordinary
|
|
119
|
+
* swap and on every pull route.
|
|
120
|
+
*/
|
|
121
|
+
resumedDeposit?: StoredDepositAttestation | null;
|
|
122
|
+
/**
|
|
123
|
+
* Abandon a deposit swap whose window has closed and free the panel to quote
|
|
124
|
+
* again. Distinct from `onClose`, which deliberately keeps the intent alive at
|
|
125
|
+
* the deposit phase and therefore leaves the panel unable to re-quote.
|
|
126
|
+
*/
|
|
127
|
+
onStartOver?: () => void;
|
|
128
|
+
onConfirm: () => void;
|
|
129
|
+
/** Cancel a wallet prompt that was dismissed without a provider reply. */
|
|
130
|
+
onCancelSign: () => void;
|
|
131
|
+
/** Tap handler for signature 2 of 2 (deep-link wallets). */
|
|
132
|
+
onSignPull?: () => void;
|
|
133
|
+
onRetry: () => void;
|
|
134
|
+
onClose: () => void;
|
|
135
|
+
/**
|
|
136
|
+
* Stealth completion handoff: close the flow and land on the claims surface
|
|
137
|
+
* (pass-1 4.6, "Claim your payment"). Absent on public routes.
|
|
138
|
+
*/
|
|
139
|
+
onGoToClaims?: () => void;
|
|
140
|
+
}
|
|
141
|
+
export declare function SwapFlowModal(props: SwapFlowModalProps): import("react").ReactPortal | null;
|
|
142
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
type ToastType = "info" | "success" | "error";
|
|
3
|
+
interface ToastContextType {
|
|
4
|
+
showToast: (message: string, type?: ToastType) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function ToastProvider({ children }: {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
export declare function useToast(): ToastContextType;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface TokenIconProps {
|
|
2
|
+
symbol: string;
|
|
3
|
+
/** Sizing/positioning class, e.g. "inline-token-icon" or "token-icon-img". */
|
|
4
|
+
className?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Renders a token's logo, falling back to a letter chip when no icon asset is
|
|
9
|
+
* registered for the symbol. The fallback carries the same sizing class as the
|
|
10
|
+
* image so the box matches at every call site (see `.token-fallback` in
|
|
11
|
+
* components.css for the per-size letter styling).
|
|
12
|
+
*
|
|
13
|
+
* Icons are decorative: every call site renders the symbol as adjacent text, so
|
|
14
|
+
* an `alt`/announcement here would double up for screen readers.
|
|
15
|
+
*/
|
|
16
|
+
export declare function TokenIcon({ symbol, className, title }: TokenIconProps): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type PairAvailability } from "../lib/pairAvailability.js";
|
|
2
|
+
import type { Token } from "../types/intent.js";
|
|
3
|
+
import { type SelectableChainId } from "@xochi/client";
|
|
4
|
+
export type TokenSearchMode = "token" | "chain";
|
|
5
|
+
export type ChainSelection = {
|
|
6
|
+
readonly kind: "chain";
|
|
7
|
+
readonly chainId: SelectableChainId;
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: "zk.money";
|
|
10
|
+
};
|
|
11
|
+
export interface TokenSearchModalProps {
|
|
12
|
+
open: boolean;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
onSelect: (token: Token) => void;
|
|
15
|
+
selectedToken?: Token;
|
|
16
|
+
chainIds: readonly SelectableChainId[];
|
|
17
|
+
tokensByChain: ReadonlyMap<SelectableChainId, readonly Token[]>;
|
|
18
|
+
classify: (token: Token) => PairAvailability;
|
|
19
|
+
initialChainId?: SelectableChainId | null;
|
|
20
|
+
mode?: TokenSearchMode;
|
|
21
|
+
onChainSelect?: (selection: ChainSelection) => void;
|
|
22
|
+
chainBlockedReason?: (chainId: SelectableChainId) => string | null;
|
|
23
|
+
zkMoney?: {
|
|
24
|
+
readonly selected: boolean;
|
|
25
|
+
};
|
|
26
|
+
portalTarget?: HTMLElement | null;
|
|
27
|
+
}
|
|
28
|
+
export declare function TokenSearchModal({ open, onClose, onSelect, selectedToken, chainIds, tokensByChain, classify, initialChainId, mode, onChainSelect, chainBlockedReason, zkMoney, portalTarget, }: TokenSearchModalProps): import("react").ReactPortal | null;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TransactionPreview Component
|
|
3
|
+
*
|
|
4
|
+
* The "confirm" body of the swap flow modal: what leaves the wallet, what
|
|
5
|
+
* arrives, and the fees, plus the Confirm/Cancel actions. The modal
|
|
6
|
+
* shell (SwapFlowModal) owns the overlay, header, focus trap, and aria-live.
|
|
7
|
+
*/
|
|
8
|
+
import type { QuoteResponse, IntentDestination, SelectableChainId, PermitType, OriginApproval } from "../types/intent.js";
|
|
9
|
+
import { type SendRecipientDisplay } from "../pages/send/sendCopy.js";
|
|
10
|
+
interface TransactionPreviewProps {
|
|
11
|
+
quote: QuoteResponse;
|
|
12
|
+
fromAmount: string;
|
|
13
|
+
fromSymbol: string;
|
|
14
|
+
fromDecimals: number;
|
|
15
|
+
toSymbol: string;
|
|
16
|
+
toDecimals: number;
|
|
17
|
+
fromChainId: SelectableChainId;
|
|
18
|
+
toChainId: SelectableChainId;
|
|
19
|
+
destination: IntentDestination;
|
|
20
|
+
sendRecipientDisplay?: SendRecipientDisplay;
|
|
21
|
+
onConfirm: () => void;
|
|
22
|
+
onCancel: () => void;
|
|
23
|
+
isLoading: boolean;
|
|
24
|
+
permitType?: PermitType;
|
|
25
|
+
/** Whether the pull needs an approval transaction first (usePermit, on-chain allowance). */
|
|
26
|
+
approval: OriginApproval;
|
|
27
|
+
approvalMayNeedReset: boolean;
|
|
28
|
+
unlimitedApproval: boolean;
|
|
29
|
+
setUnlimitedApproval: (enabled: boolean) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Seconds until the quote hard-expires. The modal pauses auto-refresh, so
|
|
32
|
+
* this counts down to expiry; at 0 the modal's expired notice takes over.
|
|
33
|
+
*/
|
|
34
|
+
quoteExpiresIn?: number | null;
|
|
35
|
+
}
|
|
36
|
+
export declare function TransactionPreview({ quote, fromAmount, fromSymbol, fromDecimals, toSymbol, toDecimals, toChainId, destination, sendRecipientDisplay, onConfirm, onCancel, isLoading, permitType, approval, approvalMayNeedReset, unlimitedApproval, setUnlimitedApproval, quoteExpiresIn, }: TransactionPreviewProps): import("react").JSX.Element;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type AppTheme } from "../hooks/useTheme.js";
|
|
3
|
+
import type { HostConnection } from "@xochi/widget-lib";
|
|
4
|
+
interface WalletProviderProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** The frame's current theme, or null to follow the stored/system choice. */
|
|
7
|
+
theme?: AppTheme | null;
|
|
8
|
+
/** The embedding page's bridge. Its wallet appears only while one is attached. */
|
|
9
|
+
hostWallet?: HostConnection | null;
|
|
10
|
+
}
|
|
11
|
+
export declare function WalletProvider({ children, theme, hostWallet }: WalletProviderProps): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WrapModal
|
|
3
|
+
*
|
|
4
|
+
* Wrap native ETH into WETH and unwrap WETH back to ETH on the connected
|
|
5
|
+
* chain. Reads real balances (usePublicBalances) and writes via useWrapEth.
|
|
6
|
+
* Useful for turning received WETH back into spendable ETH.
|
|
7
|
+
*
|
|
8
|
+
* Pass `unwrapOnly` to present the wallet escape hatch: unwrap WETH -> ETH with
|
|
9
|
+
* no wrap direction (Xochi settles stables, so wrapping into WETH is not a
|
|
10
|
+
* supported action there). The trade flow opens it in full mode.
|
|
11
|
+
*/
|
|
12
|
+
interface WrapModalProps {
|
|
13
|
+
open: boolean;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
/** Restrict to unwrap (WETH -> ETH) only, hiding the wrap direction. */
|
|
16
|
+
unwrapOnly?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function WrapModal({ open, onClose, unwrapOnly }: WrapModalProps): import("react").ReactPortal | null;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CantonEscrowPanel: reads a Canton order's lock and sends its refund
|
|
3
|
+
* (`useCantonEscrow`), and renders `CantonEscrowStatus`. Mounted only on a
|
|
4
|
+
* Canton destination past signing, so no other route touches the wallet hooks.
|
|
5
|
+
*/
|
|
6
|
+
import type { EscrowStatusData, SelectableChainId } from "@xochi/client";
|
|
7
|
+
interface CantonEscrowPanelProps {
|
|
8
|
+
fromChainId: SelectableChainId;
|
|
9
|
+
orderId: string | null;
|
|
10
|
+
escrow: EscrowStatusData | null;
|
|
11
|
+
lockTxHash: string | null;
|
|
12
|
+
}
|
|
13
|
+
export declare function CantonEscrowPanel({ fromChainId, orderId, escrow, lockTxHash, }: CantonEscrowPanelProps): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CantonEscrowStatus
|
|
3
|
+
*
|
|
4
|
+
* The progress and ending of a Canton order, read off its escrow alone
|
|
5
|
+
* (`cantonEscrowView`): the Base lock, Riddler's attested delivery on Canton,
|
|
6
|
+
* the solver's claim, or the taker's refund. It never reads the intent's
|
|
7
|
+
* top-level status, a fill receipt or a balance, so a transfer the Canton
|
|
8
|
+
* gateway reports completed cannot render as delivered here.
|
|
9
|
+
*
|
|
10
|
+
* Presentational: `CantonEscrowPanel` reads the lock and sends the refund.
|
|
11
|
+
*/
|
|
12
|
+
import { type SelectableChainId } from "@xochi/client";
|
|
13
|
+
import { type CantonEscrowView } from "../../pages/trade/canton.js";
|
|
14
|
+
interface CantonEscrowStatusProps {
|
|
15
|
+
view: CantonEscrowView;
|
|
16
|
+
/** The origin chain the escrow lives on (Base). */
|
|
17
|
+
fromChainId: SelectableChainId;
|
|
18
|
+
/** The origin transaction: the escrow lock the venue opened for the taker. */
|
|
19
|
+
lockTxHash: string | null;
|
|
20
|
+
/** The pinned escrow, linked for its claim and refund history. */
|
|
21
|
+
escrowAddress: string | null;
|
|
22
|
+
refundTxHash: string | null;
|
|
23
|
+
refunding: boolean;
|
|
24
|
+
refundError: string | null;
|
|
25
|
+
/** The last lock read failed, so the refund time is not known yet. */
|
|
26
|
+
lockReadFailed: boolean;
|
|
27
|
+
onRefund: () => void;
|
|
28
|
+
}
|
|
29
|
+
export declare function CantonEscrowStatus({ view, fromChainId, lockTxHash, escrowAddress, refundTxHash, refunding, refundError, lockReadFailed, onRefund, }: CantonEscrowStatusProps): import("react").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DepositInstructions
|
|
3
|
+
*
|
|
4
|
+
* The "deposit" phase of the swap flow (Tron-origin routes). There is no wallet
|
|
5
|
+
* signature: the user sends TRC-20 from an external Tron wallet to a per-intent
|
|
6
|
+
* address, and the solver settles on detection. Shows the exact amount, the
|
|
7
|
+
* deposit address (copyable, verbatim base58), a network warning, an immutable
|
|
8
|
+
* payout line, and a waiting indicator while the poll runs.
|
|
9
|
+
*
|
|
10
|
+
* The deposit address was already attestation-verified at quote-ingest
|
|
11
|
+
* (useIntent), so reaching this view means it recovered to the pinned signer.
|
|
12
|
+
*/
|
|
13
|
+
import type { SelectableChainId } from "../../types/intent.js";
|
|
14
|
+
interface DepositInstructionsProps {
|
|
15
|
+
/** Per-intent deposit address (base58, verbatim -- never transformed). */
|
|
16
|
+
depositAddress: string;
|
|
17
|
+
/** Origin amount in base units. */
|
|
18
|
+
fromAmount: string;
|
|
19
|
+
fromSymbol: string;
|
|
20
|
+
fromDecimals: number;
|
|
21
|
+
fromChainId: SelectableChainId;
|
|
22
|
+
/** Destination token + chain for the payout line. */
|
|
23
|
+
toSymbol: string;
|
|
24
|
+
toChainId: SelectableChainId;
|
|
25
|
+
/** Formatted payout estimate, if known. */
|
|
26
|
+
receivedAmount?: string;
|
|
27
|
+
/** Accepted-order display metadata, never a source of attested funding facts. */
|
|
28
|
+
recipientTag?: string;
|
|
29
|
+
swapRecipientLabel?: string;
|
|
30
|
+
/**
|
|
31
|
+
* EVM payout address the attestation was VERIFIED against, not the connected
|
|
32
|
+
* wallet. Those are the same value at quote time and diverge afterwards: an
|
|
33
|
+
* account switch is deliberately not interrupted at this phase, so the live
|
|
34
|
+
* wallet moves while the signed recipient cannot. On a resumed swap it is the
|
|
35
|
+
* value `verifyStoredDeposit` re-proved out of storage.
|
|
36
|
+
*
|
|
37
|
+
* Same rule as `refundAddress` below. Absent renders no address at all rather
|
|
38
|
+
* than falling back to a live one.
|
|
39
|
+
*/
|
|
40
|
+
payoutAddress?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Origin-chain refund address the user named, if any (xochi#358). Absent means
|
|
43
|
+
* Riddler's refund-to-sender fallback, which IS echoed and carries an extra
|
|
44
|
+
* warning: "back where it came from" is an address the user does not control
|
|
45
|
+
* when they withdrew from an exchange.
|
|
46
|
+
*
|
|
47
|
+
* Must be the value the attestation was verified against, not live panel
|
|
48
|
+
* state. Both come off the verified binding (`attestedDeposit` in
|
|
49
|
+
* types/intent.ts, or the re-proven stored one on a resume).
|
|
50
|
+
*/
|
|
51
|
+
refundAddress?: string;
|
|
52
|
+
/** Deposit-acceptance deadline (unix seconds); drives the countdown. */
|
|
53
|
+
depositDeadline?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the status poll is still running. A spinner reading "checking" is a
|
|
56
|
+
* claim about the client, not the solver, and it must not outlive the poll: a
|
|
57
|
+
* stopped poll and a poll that has found nothing yet otherwise render exactly
|
|
58
|
+
* the same, which is the failure mode where absent input looks like a negative
|
|
59
|
+
* result. Defaults true so an omitted prop cannot silently mute the indicator.
|
|
60
|
+
*/
|
|
61
|
+
checkActive?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Clear this swap and return the panel to a usable state, so the closed-window
|
|
64
|
+
* view can offer a fresh address.
|
|
65
|
+
*
|
|
66
|
+
* Needed because closing the modal does NOT do this at the deposit phase: the
|
|
67
|
+
* panel deliberately holds the intent, which leaves it in `awaiting_deposit`,
|
|
68
|
+
* a state that suppresses re-quoting. "Close this and start again" was
|
|
69
|
+
* therefore an instruction the state machine refused to honour. Absent, the
|
|
70
|
+
* button is not rendered rather than rendered dead.
|
|
71
|
+
*/
|
|
72
|
+
onStartOver?: () => void;
|
|
73
|
+
}
|
|
74
|
+
export declare function DepositInstructions({ depositAddress, fromAmount, fromSymbol, fromDecimals, fromChainId, toSymbol, toChainId, receivedAmount, recipientTag, swapRecipientLabel, payoutAddress, refundAddress, depositDeadline, checkActive, onStartOver, }: DepositInstructionsProps): import("react").JSX.Element;
|
|
75
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QrCode
|
|
3
|
+
*
|
|
4
|
+
* Renders a value as an inline SVG QR code. Self-contained (draws its own light
|
|
5
|
+
* quiet-zone background + dark modules) so it scans without relying on the
|
|
6
|
+
* surrounding element, and resolution-independent via a module-unit viewBox.
|
|
7
|
+
* Colors come from CSS custom properties (`--qr-bg` / `--qr-fg`) so the frame
|
|
8
|
+
* can theme them while keeping dark-on-light contrast for scanners.
|
|
9
|
+
*/
|
|
10
|
+
interface QrCodeProps {
|
|
11
|
+
/** Encoded verbatim (e.g. a base58 deposit address). */
|
|
12
|
+
value: string;
|
|
13
|
+
/** Accessible label; the raw value is not announced (it is shown as text). */
|
|
14
|
+
label: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function QrCode({ value, label, className }: QrCodeProps): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type SendRecipientDisplay } from "../../pages/send/sendCopy.js";
|
|
2
|
+
import type { SelectableChainId } from "../../types/intent.js";
|
|
3
|
+
import { type SwapFailureRef } from "../../lib/swapFlowPhase.js";
|
|
4
|
+
interface SwapResultProps {
|
|
5
|
+
variant: "success" | "refunded" | "failed" | "may-have-moved" | "pending";
|
|
6
|
+
/** SDK safe failure verdict; after submission only the worker marker permits it. */
|
|
7
|
+
notExecuted?: boolean;
|
|
8
|
+
/** Stealth settlement: funds land at a one-time address the user must claim. */
|
|
9
|
+
isStealth?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* `"other"`: the Stealth payout went to someone else's meta-address. The
|
|
12
|
+
* recipient claims it with their own keys, so no ending offers a claim here.
|
|
13
|
+
*/
|
|
14
|
+
stealthPayee?: "self" | "other";
|
|
15
|
+
sendRecipientDisplay?: SendRecipientDisplay;
|
|
16
|
+
swapRecipientLabel?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The zk.money tag the DAI was sent for. Our side ends at the confirmed L1
|
|
19
|
+
* transfer; the credit shows up in zk.money, so the ending links there.
|
|
20
|
+
*/
|
|
21
|
+
recipientTag?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Riddler's granular fill substatus. `filled` means the destination leg landed
|
|
24
|
+
* even while the top-level status is still `settling`, which is a state Riddler
|
|
25
|
+
* can hold indefinitely (xochi#376). Combined with the fill receipt below to
|
|
26
|
+
* decide whether a stealth swap has DELIVERED, which is a different thing to
|
|
27
|
+
* tell the user than "still settling".
|
|
28
|
+
*/
|
|
29
|
+
substatus?: string | null;
|
|
30
|
+
fromChainId: SelectableChainId;
|
|
31
|
+
toChainId: SelectableChainId;
|
|
32
|
+
isCrossChain: boolean;
|
|
33
|
+
txHash: string | null;
|
|
34
|
+
receivingTxHash?: string | null;
|
|
35
|
+
/** Public fill receipt (Riddler #632) + its chain; the primary receipt CTA keys off these. */
|
|
36
|
+
settlementTxHash?: string | null;
|
|
37
|
+
settlementChainId?: SelectableChainId | null;
|
|
38
|
+
/** Formatted received amount, success only. */
|
|
39
|
+
receivedAmount?: string;
|
|
40
|
+
toSymbol: string;
|
|
41
|
+
/**
|
|
42
|
+
* Measured solver fill time in ms (submit -> filled), success only. Null or
|
|
43
|
+
* absent hides the row entirely: it means the time could not be measured
|
|
44
|
+
* honestly (a poll-observed completion is up to STATUS_POLL_MS late), and a
|
|
45
|
+
* quantized guess presented as a measurement is worse than no number.
|
|
46
|
+
*/
|
|
47
|
+
fillMs?: number | null;
|
|
48
|
+
/** Failure reference, failed and may-have-moved only. */
|
|
49
|
+
failureRef?: SwapFailureRef | null;
|
|
50
|
+
/** HTTP status of a structured failure (429/503), failed only. */
|
|
51
|
+
errorCode?: number;
|
|
52
|
+
/** Stable category, including quote-time tag lookup failures. */
|
|
53
|
+
errorCategory?: string;
|
|
54
|
+
/** Absolute unix-seconds retry target for 429/503 backpressure, failed only. */
|
|
55
|
+
retryAfter?: number;
|
|
56
|
+
/** Plain-language refund explanation, refunded only. */
|
|
57
|
+
refundReason?: string | null;
|
|
58
|
+
/** Independently verified attested refund target, never form or history metadata. */
|
|
59
|
+
refundAddress?: string | null;
|
|
60
|
+
/** Solver-supported origin tokens for the unsupported-route copy. */
|
|
61
|
+
originTokens?: readonly string[];
|
|
62
|
+
onRetry: () => void;
|
|
63
|
+
onClose: () => void;
|
|
64
|
+
/** Stealth completion handoff to the claims surface (pass-1 4.6). */
|
|
65
|
+
onGoToClaims?: () => void;
|
|
66
|
+
}
|
|
67
|
+
export declare function SwapResult({ variant, notExecuted, isStealth, stealthPayee, sendRecipientDisplay, swapRecipientLabel, recipientTag, substatus, fromChainId, toChainId, isCrossChain, txHash, receivingTxHash, settlementTxHash, settlementChainId, receivedAmount, toSymbol, fillMs, failureRef, errorCode, errorCategory, retryAfter, refundReason, refundAddress, originTokens, onRetry, onClose, onGoToClaims, }: SwapResultProps): import("react").JSX.Element;
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything the deposit screen renders, resolved from the ATTESTED binding and
|
|
3
|
+
* from nothing else.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS EXISTS. `SwapFlowModal` already sourced the four money-routing lines
|
|
6
|
+
* (address, payout, refund, deadline) off the verified binding. The other half of
|
|
7
|
+
* the screen still came from live panel props: the amount to send, its symbol and
|
|
8
|
+
* decimals, the origin chain, the destination symbol and the payout estimate. So
|
|
9
|
+
* the single most consequential sentence in the app,
|
|
10
|
+
*
|
|
11
|
+
* "Send exactly {amount} {symbol} on {chain} to this address"
|
|
12
|
+
*
|
|
13
|
+
* had a proven address and an unproven instruction attached to it, followed by a
|
|
14
|
+
* warning that a different token or network "cannot be recovered".
|
|
15
|
+
*
|
|
16
|
+
* That split was reachable two ways, neither of them exotic:
|
|
17
|
+
*
|
|
18
|
+
* - With no attacker at all. `resolveTokenForChain` in useSwapRoute re-runs when
|
|
19
|
+
* the solver's capability matrix refreshes, with no guard on the flow modal
|
|
20
|
+
* being open, and calls `setFromToken`. A refresh while the deposit screen is
|
|
21
|
+
* up re-rendered the instruction with a different symbol and different
|
|
22
|
+
* DECIMALS under a live, correctly attested address.
|
|
23
|
+
* - On a resumed swap, those props originate in `record.data`, which is
|
|
24
|
+
* localStorage: same-origin mutable state that `verifyStoredDeposit` does not
|
|
25
|
+
* cover. It binds `intentId` and `wallet` and proves the signature; it says
|
|
26
|
+
* nothing about `data.fromAmount`. Leaving the attestation byte-identical and
|
|
27
|
+
* editing that one field passes every check while telling the user to send a
|
|
28
|
+
* different amount to a genuine address.
|
|
29
|
+
*
|
|
30
|
+
* The fix is not another comparison. It is removing the second derivation: every
|
|
31
|
+
* value below comes off the one object the signature covers, so there is nothing
|
|
32
|
+
* left to drift. `DepositAttestationFields` binds all of them (v3 signs the
|
|
33
|
+
* destination side precisely so a substituted quote has to be economically
|
|
34
|
+
* identical), so nothing here is fabricated or re-derived from live state.
|
|
35
|
+
*
|
|
36
|
+
* Returns null on a binding this client cannot render faithfully. That is a
|
|
37
|
+
* refusal, not a fallback: the caller shows the unavailable view rather than a
|
|
38
|
+
* partially-attested screen, which is the failure mode this module removes.
|
|
39
|
+
*/
|
|
40
|
+
import type { SelectableChainId } from "@xochi/client";
|
|
41
|
+
import type { DepositAttestationFields } from "@xochi/client";
|
|
42
|
+
/** The deposit screen's inputs, every one of them attested. */
|
|
43
|
+
export interface DepositScreenView {
|
|
44
|
+
depositAddress: string;
|
|
45
|
+
/** Origin amount in base units, as signed. */
|
|
46
|
+
fromAmount: string;
|
|
47
|
+
fromSymbol: string;
|
|
48
|
+
fromDecimals: number;
|
|
49
|
+
fromChainId: SelectableChainId;
|
|
50
|
+
toSymbol: string;
|
|
51
|
+
toChainId: SelectableChainId;
|
|
52
|
+
/** Display-formatted attested payout, or undefined if it will not parse. */
|
|
53
|
+
receivedAmount?: string;
|
|
54
|
+
payoutAddress?: string;
|
|
55
|
+
refundAddress?: string;
|
|
56
|
+
depositDeadline?: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Resolve the deposit screen from a proven binding, or null if it cannot be.
|
|
60
|
+
*
|
|
61
|
+
* The chain ids are narrowed rather than cast. They are typed `number` on the
|
|
62
|
+
* binding because that is what the solver sends and what the message signs, and
|
|
63
|
+
* a chain this build cannot name is one whose token registry, explorer and
|
|
64
|
+
* display name are all absent. Rendering "Send exactly 100 USDT on undefined" is
|
|
65
|
+
* worse than saying we cannot show the screen.
|
|
66
|
+
*/
|
|
67
|
+
export declare function buildDepositScreen(attested: DepositAttestationFields | null | undefined): DepositScreenView | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the frame shows its Activity and Claims tabs (`layout`,
|
|
3
|
+
* xochi-fi/xochi-widget#38). Flow copy that sends the user to a tab reads it:
|
|
4
|
+
* without tabs (`layout=swap`) those places do not exist in the frame, and a
|
|
5
|
+
* claim happens on the full widget, opened in a new tab. Trade provides it;
|
|
6
|
+
* anything rendered outside Trade sees the full widget.
|
|
7
|
+
*/
|
|
8
|
+
export declare const WidgetTabsContext: import("react").Context<boolean>;
|
|
9
|
+
export declare function useWidgetTabsShown(): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Whether a frame without tabs claims stealth payments outside the widget
|
|
12
|
+
* (decided 2026-10-31): its wallet is the host page's, lent over
|
|
13
|
+
* `@xochi/widget-lib`, which a tab of the widget's own cannot reach, so the
|
|
14
|
+
* full widget opened there could not claim. The frame then offers no Claim
|
|
15
|
+
* payment and says where to claim instead (`CLAIM_IN_XOCHI_APP`). Trade
|
|
16
|
+
* provides it; anything outside Trade claims in the widget.
|
|
17
|
+
*/
|
|
18
|
+
export declare const ClaimInXochiAppContext: import("react").Context<boolean>;
|
|
19
|
+
export declare function useClaimInXochiApp(): boolean;
|
|
20
|
+
/** Where a host-wallet frame sends a stealth recipient to claim. */
|
|
21
|
+
export declare const CLAIM_IN_XOCHI_APP = "Claim it in the Xochi app with the receiving wallet.";
|