@xochi/widget 0.0.0-stage → 0.1.0
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 +76 -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 +66 -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 +398 -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 +207 -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 +323 -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 +435 -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 +131 -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 +200 -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 +971 -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 +17448 -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 +44 -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 +138 -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 +34 -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 +66 -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 +156 -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 +84 -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 +48 -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 +142 -0
- package/dist/types/widgetLibModule.d.ts +8 -0
- package/dist/utils/format.js +109 -0
- package/dist/wagmi.js +188 -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,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the settlement control behaves: which mode buttons respond, which
|
|
3
|
+
* select, and the one fix an unavailable mode shows.
|
|
4
|
+
*
|
|
5
|
+
* The typed capability route is the authority. A quote's
|
|
6
|
+
* `settlementOptions` may narrow an advertised mode at runtime, but never add
|
|
7
|
+
* one; `settlementFallback` handles a failed non-public request.
|
|
8
|
+
*/
|
|
9
|
+
import type { SettlementType } from "../types/intent.js";
|
|
10
|
+
/** Automatic Public is provisional; a selected/defaulted Stealth is never downgraded. */
|
|
11
|
+
export declare function defaultSettlementSelection(selected: SettlementType | null, stealthEligible: boolean): SettlementType | null;
|
|
12
|
+
/**
|
|
13
|
+
* What the user can do about an unavailable settlement mode. Exactly one per
|
|
14
|
+
* mode: connect a wallet, choose a stealth destination, try another route
|
|
15
|
+
* (the solver turned this one down), nothing (the mode is not offered), wait
|
|
16
|
+
* for the route matrix, retry a failed route-matrix load, or choose another
|
|
17
|
+
* destination (Canton is public only).
|
|
18
|
+
*/
|
|
19
|
+
export type SettlementFix = "wallet" | "setup" | "quote" | "destination" | "route" | "unavailable" | "route_loading" | "route_unavailable" | "public_only";
|
|
20
|
+
/**
|
|
21
|
+
* The one fix the Stealth button shows, or null when stealth is available.
|
|
22
|
+
* Ordered by what the user must do first. The frame's panel and the
|
|
23
|
+
* configurator's "What users see" panel both read it, so the two cannot name
|
|
24
|
+
* different fixes for the same route.
|
|
25
|
+
*/
|
|
26
|
+
export declare function stealthFixFor(input: {
|
|
27
|
+
live: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Live exact route data is on hand. False for stale, fallback, or failed
|
|
30
|
+
* capability state: those states cannot authorize private quoting or signing.
|
|
31
|
+
*/
|
|
32
|
+
stealthChainsKnown: boolean;
|
|
33
|
+
/** Whether capability data is currently loading or retrying. */
|
|
34
|
+
capabilitiesLoading: boolean;
|
|
35
|
+
/** The solver advertises at least one stealth destination chain. */
|
|
36
|
+
hasStealthChains: boolean;
|
|
37
|
+
connected: boolean;
|
|
38
|
+
destinationSupported: boolean;
|
|
39
|
+
/** Omitted by consumers that do not own a wallet's keys. */
|
|
40
|
+
metaAddressReady?: boolean;
|
|
41
|
+
/** Held quote's requested mode; omit when no private quote is being awaited. */
|
|
42
|
+
quotedSettlement?: SettlementType;
|
|
43
|
+
routeAvailable: boolean | undefined;
|
|
44
|
+
}): SettlementFix | null;
|
|
45
|
+
/** The one fix the Shielded button shows, or null when shielded is available. */
|
|
46
|
+
export declare function shieldedFixFor(input: {
|
|
47
|
+
live: boolean;
|
|
48
|
+
routeAvailable: boolean | undefined;
|
|
49
|
+
}): SettlementFix | null;
|
|
50
|
+
export type SettlementSelectionDecision = "select_public" | "show_wallet_nudge" | "show_shielded_soon" | "select_stealth" | "select_shielded" | "ignore";
|
|
51
|
+
/**
|
|
52
|
+
* Privacy navigation is separate from quote and execution authorization.
|
|
53
|
+
* Stealth records explicit intent before route discovery or wallet setup.
|
|
54
|
+
* Shielded keeps its pre-live explanation and live eligibility rules.
|
|
55
|
+
*/
|
|
56
|
+
export declare function settlementSelectionDecision(input: {
|
|
57
|
+
next: SettlementType;
|
|
58
|
+
connected: boolean;
|
|
59
|
+
shieldedSelectable: boolean;
|
|
60
|
+
shieldedPreLive: boolean;
|
|
61
|
+
}): SettlementSelectionDecision;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stealth announcement scanning (ERC-5564), the on-chain half.
|
|
3
|
+
*
|
|
4
|
+
* The pure crypto (key derivation, view tags, the stealth owner derivation and
|
|
5
|
+
* the metadata layout) lives in `@xochi/signer`. What stays here reads the
|
|
6
|
+
* chain: the factory's `getAddress` for the counterfactual match, behind the
|
|
7
|
+
* factory trust check, and the token balance that filters swept payments.
|
|
8
|
+
*
|
|
9
|
+
* @see https://eips.ethereum.org/EIPS/eip-5564
|
|
10
|
+
*/
|
|
11
|
+
import { type Hex, type PublicClient } from "viem";
|
|
12
|
+
import { type StealthAnnouncement, type StealthPayment } from "@xochi/signer";
|
|
13
|
+
export interface CounterfactualAddressParams {
|
|
14
|
+
/**
|
|
15
|
+
* Stealth EOA that owns the SimpleAccount. This is the ERC-5564 stealth
|
|
16
|
+
* address derived client-side (address(P')), used as the SimpleAccount owner.
|
|
17
|
+
*/
|
|
18
|
+
owner: Hex;
|
|
19
|
+
/**
|
|
20
|
+
* viem public client bound to the DESTINATION chain. The derivation is an
|
|
21
|
+
* on-chain `eth_call`, so the client must target the chain where the
|
|
22
|
+
* SimpleAccount will be deployed.
|
|
23
|
+
*/
|
|
24
|
+
client: PublicClient;
|
|
25
|
+
/**
|
|
26
|
+
* SimpleAccountFactory address. Defaults to the pinned v0.8 factory; pass the
|
|
27
|
+
* factory from `/xochi/capabilities` once Riddler exposes it.
|
|
28
|
+
*/
|
|
29
|
+
factory?: Hex;
|
|
30
|
+
/** CREATE2 salt. One account per stealth EOA -> 0. */
|
|
31
|
+
salt?: bigint;
|
|
32
|
+
/**
|
|
33
|
+
* Destination chain id. LOAD-BEARING: the factory allowlist is per-chain, so
|
|
34
|
+
* this is what the trust check is evaluated against. Omitting it fails closed
|
|
35
|
+
* rather than skipping the check.
|
|
36
|
+
*/
|
|
37
|
+
chainId: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Compute the counterfactual SimpleAccount address for a stealth owner.
|
|
41
|
+
*
|
|
42
|
+
* Parity with Riddler is guaranteed by calling the factory's `getAddress`
|
|
43
|
+
* on-chain (viem `readContract`) on the destination chain rather than
|
|
44
|
+
* reimplementing the CREATE2 + ERC1967 proxy derivation. This is an RPC call,
|
|
45
|
+
* so it is async and cannot be exercised offline.
|
|
46
|
+
*/
|
|
47
|
+
export declare function computeCounterfactualAddress(params: CounterfactualAddressParams): Promise<Hex>;
|
|
48
|
+
/**
|
|
49
|
+
* Check if we can spend from a stealth announcement.
|
|
50
|
+
*
|
|
51
|
+
* In the counterfactual SimpleAccount model the announcement carries the
|
|
52
|
+
* counterfactual SimpleAccount address, NOT the stealth owner EOA. So the full
|
|
53
|
+
* check derives the owner EOA (pure), computes the counterfactual from it via
|
|
54
|
+
* the factory (on-chain), and matches the announced address against that.
|
|
55
|
+
*
|
|
56
|
+
* This is async because the counterfactual derivation is an `eth_call`.
|
|
57
|
+
*/
|
|
58
|
+
export declare function canSpendFromAddress(announcement: StealthAnnouncement, spendingPrivKey: Uint8Array, viewingPrivKey: Uint8Array, client: PublicClient, factory: Hex | undefined, chainId: number): Promise<StealthPayment | null>;
|
|
59
|
+
/**
|
|
60
|
+
* Scan announcements for payments to us.
|
|
61
|
+
*
|
|
62
|
+
* Three passes, cheapest first: the view tag (pure, no RPC), the counterfactual
|
|
63
|
+
* match (one `eth_call` per candidate factory), then the on-chain balance (one
|
|
64
|
+
* more `eth_call`) to drop payments that have already been swept. Multiple
|
|
65
|
+
* trusted factories keep payments discoverable across a factory rotation.
|
|
66
|
+
*
|
|
67
|
+
* The balance pass exists because a match alone says "this payment was sent to
|
|
68
|
+
* an address you control", not "these funds are still there". A claimed payment
|
|
69
|
+
* kept matching forever and kept a live CLAIM button, and clicking it spent a
|
|
70
|
+
* claim rate-limit token to receive an error: Riddler drops the intent out of
|
|
71
|
+
* `claimable?` once `receiving_tx_hash` is set, so the answer is always a
|
|
72
|
+
* refusal. With `claimAll` walking the list top-down, every dead row was a
|
|
73
|
+
* guaranteed wasted token before any real payment was reached (#470).
|
|
74
|
+
*/
|
|
75
|
+
export declare function scanAnnouncements(announcements: StealthAnnouncement[], spendingPrivKey: Uint8Array, viewingPrivKey: Uint8Array, client: PublicClient, factories: Hex | readonly Hex[] | undefined, chainId: number): Promise<StealthPayment[]>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swap flow phase helpers
|
|
3
|
+
*
|
|
4
|
+
* The phase itself (`phaseFromStatus`) is the machine's (@xochi/client); this
|
|
5
|
+
* module holds what the flow surfaces derive around it: the delivered-while-
|
|
6
|
+
* settling backstop and the failure-reference payload used by the "Copy
|
|
7
|
+
* details" affordance and the support mailto.
|
|
8
|
+
*/
|
|
9
|
+
import type { IntentStatus } from "../types/intent.js";
|
|
10
|
+
import type { SwapActivityItem } from "../types/activity.js";
|
|
11
|
+
/**
|
|
12
|
+
* Bounded settling-age backstop (#257).
|
|
13
|
+
*
|
|
14
|
+
* A destination leg can land while the DB status still reads `settling`. There
|
|
15
|
+
* are two independent signals that it has, and either is sufficient:
|
|
16
|
+
*
|
|
17
|
+
* - A renderable `settlementTxHash` fill receipt.
|
|
18
|
+
* - Riddler's granular `substatus: "filled"`, which it can report while holding
|
|
19
|
+
* the top-level status at `settling` indefinitely (xochi#376). This is the
|
|
20
|
+
* signal that survives when the fill hash never reaches us.
|
|
21
|
+
*
|
|
22
|
+
* Past a bounded window with delivery confirmed, the live modal should stop
|
|
23
|
+
* spinning on "Settling / still confirming" and surface a fund-safe delivered
|
|
24
|
+
* state. Display-only: the server keeps the intent non-terminal (the invariant
|
|
25
|
+
* stays strict), so this never marks the swap completed. It just stops the UI
|
|
26
|
+
* implying the swap is stuck when the money already landed.
|
|
27
|
+
*
|
|
28
|
+
* NOTE for a stealth intent, delivered does NOT mean claimable. The funds are at
|
|
29
|
+
* the one-time address, but taking custody additionally needs the settlement
|
|
30
|
+
* announced (ERC-5564) so the recipient can derive the spending key. Callers must
|
|
31
|
+
* not turn this into a claim CTA; see the copy in SwapResult.
|
|
32
|
+
*/
|
|
33
|
+
export declare const SETTLING_DELIVERED_MS = 30000;
|
|
34
|
+
export declare function isDeliveredWhileSettling(input: {
|
|
35
|
+
status: IntentStatus;
|
|
36
|
+
/** A renderable on-chain fill receipt (settlementTxHash) is present. */
|
|
37
|
+
hasSettlementReceipt: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Riddler's granular substatus, verbatim. `filled` means the destination leg
|
|
40
|
+
* landed even when the top-level status is still `settling` -- a state Riddler
|
|
41
|
+
* can hold indefinitely. Treated as equivalent to a receipt so delivery does
|
|
42
|
+
* not depend on a single field arriving.
|
|
43
|
+
*/
|
|
44
|
+
substatus?: string | null;
|
|
45
|
+
/** Time in the swap flow, in ms (since submit). */
|
|
46
|
+
elapsedMs: number;
|
|
47
|
+
thresholdMs?: number;
|
|
48
|
+
}): boolean;
|
|
49
|
+
export interface SwapFailureRef {
|
|
50
|
+
intentId: string | null;
|
|
51
|
+
quoteId: string | null;
|
|
52
|
+
status: IntentStatus;
|
|
53
|
+
reason: string;
|
|
54
|
+
fromChainId: number;
|
|
55
|
+
toChainId: number;
|
|
56
|
+
fromToken: string;
|
|
57
|
+
toToken: string;
|
|
58
|
+
fromAmount: string;
|
|
59
|
+
wallet?: string;
|
|
60
|
+
timestamp: string;
|
|
61
|
+
appVersion: string;
|
|
62
|
+
}
|
|
63
|
+
/** Assemble a copyable/reportable failure reference. Stamps the time at call. */
|
|
64
|
+
export declare function buildFailureRef(input: Omit<SwapFailureRef, "timestamp">): SwapFailureRef;
|
|
65
|
+
/** Human-readable reference block for clipboard + email body. */
|
|
66
|
+
export declare function formatFailureRef(ref: SwapFailureRef): string;
|
|
67
|
+
/**
|
|
68
|
+
* Build a failure reference from a settled history row (Activity feed), so a
|
|
69
|
+
* failed/expired/refunded order can be reported after its live modal has closed.
|
|
70
|
+
* The granular `intentStatus` is preserved as both status and reason; there is no
|
|
71
|
+
* stored quote id in history, so `quoteId` is null. Token addresses are resolved
|
|
72
|
+
* to symbols to match the modal-built reference.
|
|
73
|
+
*/
|
|
74
|
+
export declare function buildHistoryFailureRef(item: SwapActivityItem, wallet: string | undefined, appVersion: string): SwapFailureRef;
|
|
75
|
+
/** Prefilled support email link carrying the failure reference. */
|
|
76
|
+
export declare function supportMailto(ref: SwapFailureRef): string;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human-readable status copy for a swap in the activity feed / order view.
|
|
3
|
+
*
|
|
4
|
+
* The badge (getSwapStatusBadge) gives a one-word chip; this gives the fuller,
|
|
5
|
+
* reassuring sentence a user needs when funds have moved: what state the order is
|
|
6
|
+
* in, that a cross-chain fill legitimately takes a bit, and that a refund is a
|
|
7
|
+
* safe terminal outcome (money returned), NOT a failure.
|
|
8
|
+
*
|
|
9
|
+
* Pure and data-only: everything here comes from fields already on the /status
|
|
10
|
+
* response (status, isCrossChain, dest chain, elapsed since submit, the pulled
|
|
11
|
+
* amount, and the plain-language refund reason). No backend change required.
|
|
12
|
+
*/
|
|
13
|
+
import type { IntentStatus } from "../types/intent.js";
|
|
14
|
+
/** Visual tone the caller maps to a colour. Refund is deliberately distinct from
|
|
15
|
+
* both success (filled) and error (failed). */
|
|
16
|
+
export type SwapStateTone = "progress" | "success" | "refund" | "error" | "neutral";
|
|
17
|
+
export interface SwapStateCopy {
|
|
18
|
+
tone: SwapStateTone;
|
|
19
|
+
/** Primary line, e.g. "Payment received -- settling". */
|
|
20
|
+
headline: string;
|
|
21
|
+
/** Optional supporting line (cross-chain hint, reassurance, refund detail). */
|
|
22
|
+
detail?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface SwapStateInput {
|
|
25
|
+
isCrossChain?: boolean;
|
|
26
|
+
/** Short destination chain name, e.g. "Arbitrum". */
|
|
27
|
+
destChainName?: string;
|
|
28
|
+
/** Milliseconds since the order was submitted (in-flight rows only). */
|
|
29
|
+
elapsedMs?: number;
|
|
30
|
+
/** Formatted pulled amount for the refund line, e.g. "2 USDC". */
|
|
31
|
+
amount?: string;
|
|
32
|
+
/** Plain-language refund reason from /status (refunded rows). */
|
|
33
|
+
refundReason?: string | null;
|
|
34
|
+
depositRoute?: boolean;
|
|
35
|
+
/** Verified attested refund target; absent when history cannot prove it. */
|
|
36
|
+
refundAddress?: string | null;
|
|
37
|
+
/**
|
|
38
|
+
* True once a public fill receipt (Riddler #632 `settlementTxHash`) has landed.
|
|
39
|
+
* The fill is on-chain, so the order is settled even if the status row still
|
|
40
|
+
* reads `settling` -- never escalate to the "still settling, email us" copy.
|
|
41
|
+
*/
|
|
42
|
+
hasSettlementReceipt?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Riddler's granular fill substatus. `filled` is an independent confirmation
|
|
45
|
+
* that the destination leg landed, and it survives when the fill hash never
|
|
46
|
+
* reaches us. Same predicate the flow modal uses (isDeliveredWhileSettling), so
|
|
47
|
+
* the feed and the modal cannot disagree about whether the money arrived
|
|
48
|
+
* (xochi#376). The Worker's `awaiting_recipient` on a `settling` row means
|
|
49
|
+
* paid on Aztec, waiting for the recipient's receipt.
|
|
50
|
+
*/
|
|
51
|
+
substatus?: string | null;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Describe a swap's state for the order view. Returns null for pre-submit states
|
|
55
|
+
* (idle/pending/quoting/quoted/signing) that never show in the settled feed.
|
|
56
|
+
*/
|
|
57
|
+
export declare function describeSwapState(status: IntentStatus, input?: SwapStateInput): SwapStateCopy | null;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tier progress display gating.
|
|
3
|
+
*
|
|
4
|
+
* Decides which affordances the TierProgress widget may show. The "N pts to
|
|
5
|
+
* <tier> / Unlocks: ..." block promises a fee or privacy benefit, so the ladder
|
|
6
|
+
* is only climbable when credentials actually change the tier (Xochi's
|
|
7
|
+
* TRUST_ECONOMICS_LIVE flag, xochi#656) or a caller wires an attestation
|
|
8
|
+
* handler. Until then the widget shows the current tier and a neutral "coming
|
|
9
|
+
* soon" note instead of an actionable block or a dead "Add attestation" button.
|
|
10
|
+
* Keeping this pure lets it be unit-tested without rendering the component.
|
|
11
|
+
*/
|
|
12
|
+
export interface TierProgressVisibility {
|
|
13
|
+
/** Show the "N pts to <next tier> / Unlocks: ..." progress block. */
|
|
14
|
+
showNextTier: boolean;
|
|
15
|
+
/** Show the "Add attestation to level up" button. */
|
|
16
|
+
showAddAttestation: boolean;
|
|
17
|
+
/** Show the neutral "verification coming soon" note. */
|
|
18
|
+
showComingSoon: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface TierProgressVisibilityParams {
|
|
21
|
+
/** Whether credentials change the fee and privacy tier (TRUST_ECONOMICS_LIVE). */
|
|
22
|
+
trustEconomicsLive: boolean;
|
|
23
|
+
/** Whether a higher tier exists above the current one. */
|
|
24
|
+
hasNextTier: boolean;
|
|
25
|
+
/** Points remaining to the next tier, or null at the max tier. */
|
|
26
|
+
pointsToNextTier: number | null;
|
|
27
|
+
/** Whether the caller supplied an onAddAttestation handler. */
|
|
28
|
+
hasAttestationHandler: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The ladder is climbable when trust economics is live, or when a caller opts in by
|
|
32
|
+
* wiring an attestation handler (e.g. a future Option-A host). Otherwise the
|
|
33
|
+
* widget stays honest: current tier plus a coming-soon note, no dead CTA.
|
|
34
|
+
*/
|
|
35
|
+
export declare function tierProgressVisibility(params: TierProgressVisibilityParams): TierProgressVisibility;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tier unlock copy + launch status.
|
|
3
|
+
*
|
|
4
|
+
* Maps the next trust tier to the single headline benefit shown on the trade
|
|
5
|
+
* screen's tier progress ("Unlocks: ..."). The status mirrors the settlement
|
|
6
|
+
* roadmap taxonomy (live / soon / later): a fee reduction is a real
|
|
7
|
+
* benefit today ("live"), while recipient-private Shielded needs independent
|
|
8
|
+
* discovery/spend and all launch gates; Sovereign is excluded ("later").
|
|
9
|
+
* L1 stealth is open to every tier, so it is not a tier unlock. Keeping
|
|
10
|
+
* the mapping in one pure module lets it be unit-tested without rendering the
|
|
11
|
+
* component, and keeps a single source of honesty for what an upgrade grants.
|
|
12
|
+
*/
|
|
13
|
+
import type { TierName } from "@xochi/client";
|
|
14
|
+
export type UnlockStatus = "live" | "soon" | "later";
|
|
15
|
+
export interface TierUnlock {
|
|
16
|
+
/** Normie-plain label for the benefit an upgrade to this tier grants. */
|
|
17
|
+
label: string;
|
|
18
|
+
/** Launch status, mirroring the settlement roadmap taxonomy. */
|
|
19
|
+
status: UnlockStatus;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Returns the label and launch status for the benefit unlocked by reaching the
|
|
23
|
+
* given tier. Callers pass the *next* tier name (the one being unlocked).
|
|
24
|
+
*/
|
|
25
|
+
export declare function nextTierUnlock(tierName: TierName): TierUnlock;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The trade lifecycle events the frame reports to its host
|
|
3
|
+
* (`@xochi/widget-lib` `XochiWidgetEvent`), derived from one machine step.
|
|
4
|
+
*
|
|
5
|
+
* Each event names its trade by `tradeRef`, a reference this frame mints from
|
|
6
|
+
* random bytes when the trade starts (`@xochi/widget-lib` `mintTradeRef`) and
|
|
7
|
+
* reuses on every event of that trade. It is never the intent id nor derived
|
|
8
|
+
* from it: the host page can correlate a trade's events but learns nothing it
|
|
9
|
+
* could look up at the Worker. Refs live in memory only, so a trade resumed
|
|
10
|
+
* after a reload is reported under a fresh one.
|
|
11
|
+
*
|
|
12
|
+
* - `trade:submitted`: the execute call answered and the API accepted the
|
|
13
|
+
* order: the reply neither failed the intent nor left it not sent
|
|
14
|
+
* (`intent.notSent`, the Worker's answer that it ended its own claim). A
|
|
15
|
+
* thrown execute is not reported: in doubt (transport failure), the status
|
|
16
|
+
* poll that resolves it reports the terminal outcome; not accepted (the 503
|
|
17
|
+
* the machine resends), the resend's answer reports.
|
|
18
|
+
* - `trade:completed` / `trade:failed`: the intent reached a terminal status.
|
|
19
|
+
* Only for a trade the user confirmed or an already-dispatched intent resumed
|
|
20
|
+
* after reload: a quote that fails or expires while being browsed is not a
|
|
21
|
+
* trade, and reporting it would tell the host a trade failed that nobody
|
|
22
|
+
* attempted. The failure reason can be the server's unbounded status text;
|
|
23
|
+
* the bridge's `emit` cuts it to the length the host accepts.
|
|
24
|
+
*/
|
|
25
|
+
import { type Model, type MsgBody } from "@xochi/client";
|
|
26
|
+
import { type XochiWidgetEvent } from "@xochi/widget-lib";
|
|
27
|
+
/**
|
|
28
|
+
* The events one step produced. `attempted` maps the intent ids whose terminal
|
|
29
|
+
* outcomes belong to the host to their trade refs; the caller keeps it across
|
|
30
|
+
* steps and it never leaves the frame.
|
|
31
|
+
*/
|
|
32
|
+
export declare function tradeEvents(before: Model, after: Model, body: MsgBody, attempted: Map<string, string>): XochiWidgetEvent[];
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The slice of TronLink we use, declared structurally.
|
|
3
|
+
*
|
|
4
|
+
* Deliberately not the extension's full type: we call one method and read one
|
|
5
|
+
* field, and a narrow local shape is what lets the tests build a real provider
|
|
6
|
+
* instead of standing up a fake extension.
|
|
7
|
+
*/
|
|
8
|
+
export interface TronLinkProvider {
|
|
9
|
+
request(args: {
|
|
10
|
+
method: string;
|
|
11
|
+
}): Promise<unknown>;
|
|
12
|
+
tronWeb?: {
|
|
13
|
+
defaultAddress?: {
|
|
14
|
+
base58?: unknown;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Every way this can end. Split by cause so the caller can say something true:
|
|
20
|
+
* "install it", "you declined", "unlock it" and "that is not an address" want
|
|
21
|
+
* different copy, and collapsing them would put the wrong instruction on screen.
|
|
22
|
+
*/
|
|
23
|
+
export type TronAddressOutcome = {
|
|
24
|
+
kind: "ok";
|
|
25
|
+
address: string;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "unavailable";
|
|
28
|
+
} | {
|
|
29
|
+
kind: "rejected";
|
|
30
|
+
} | {
|
|
31
|
+
kind: "locked";
|
|
32
|
+
} | {
|
|
33
|
+
kind: "malformed";
|
|
34
|
+
received: string;
|
|
35
|
+
} | {
|
|
36
|
+
kind: "failed";
|
|
37
|
+
cause: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Ask TronLink for the user's address.
|
|
41
|
+
*
|
|
42
|
+
* Total by construction: it never throws and never returns undefined, so a
|
|
43
|
+
* caller cannot fall through to a success path on a failure it forgot to check.
|
|
44
|
+
* Pass `undefined` for a browser with no extension.
|
|
45
|
+
*/
|
|
46
|
+
export declare function readTronAddress(provider: TronLinkProvider | undefined): Promise<TronAddressOutcome>;
|
|
47
|
+
/**
|
|
48
|
+
* The injected provider, or undefined when TronLink is not installed.
|
|
49
|
+
*
|
|
50
|
+
* The only part of this module that touches a global, kept to one line so the
|
|
51
|
+
* decision logic above stays testable without patching `window`.
|
|
52
|
+
*/
|
|
53
|
+
export declare function getTronLinkProvider(): TronLinkProvider | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Plain-language copy for each non-success outcome.
|
|
56
|
+
*
|
|
57
|
+
* Lives beside the outcomes so a new kind cannot be added without a message:
|
|
58
|
+
* the switch is exhaustive and the build fails if one is missed.
|
|
59
|
+
*/
|
|
60
|
+
export declare function describeTronOutcome(outcome: Exclude<TronAddressOutcome, {
|
|
61
|
+
kind: "ok";
|
|
62
|
+
}>): string;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sign-In-With-Wallet session (client).
|
|
3
|
+
*
|
|
4
|
+
* Wallet-scoped reads (history, settlements, stealth meta-address, ...) now
|
|
5
|
+
* require a JWT that proves ownership of the wallet. The pseudonymous passkey
|
|
6
|
+
* JWT cannot -- so a connected wallet signs a server-issued challenge once and
|
|
7
|
+
* receives a wallet-bound token. That token is preferred over the passkey token
|
|
8
|
+
* for all authenticated API calls (see getActiveToken in authFetch.ts).
|
|
9
|
+
*
|
|
10
|
+
* POST /api/auth/wallet/challenge { wallet } -> { message, nonce }
|
|
11
|
+
* -> wallet signs `message`
|
|
12
|
+
* POST /api/auth/wallet/verify { nonce, signature } -> { token, wallet }
|
|
13
|
+
*
|
|
14
|
+
* The session is bound to a specific wallet; if the connected wallet changes we
|
|
15
|
+
* clear it so a stale token can never be sent for a different wallet's data.
|
|
16
|
+
*/
|
|
17
|
+
/** In-memory authority epoch; never persisted with the session. */
|
|
18
|
+
export declare const getWalletSessionGeneration: () => number;
|
|
19
|
+
/** Subscribe to local sign-in/logout authority changes. */
|
|
20
|
+
export declare const subscribeWalletSession: (listener: () => void) => (() => void);
|
|
21
|
+
/** The active wallet-bound JWT, if any. */
|
|
22
|
+
export declare const getWalletToken: () => string | null;
|
|
23
|
+
/** The wallet the active session is bound to (lowercased), if any. */
|
|
24
|
+
export declare const getWalletSessionAddress: () => string | null;
|
|
25
|
+
export declare const clearWalletSession: () => void;
|
|
26
|
+
/** True when a session exists for exactly this wallet. */
|
|
27
|
+
export declare const hasWalletSession: (wallet: string) => boolean;
|
|
28
|
+
type SignMessage = (args: {
|
|
29
|
+
message: string;
|
|
30
|
+
}) => Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Ensure a wallet-bound session exists for `wallet`, signing in if absent or
|
|
33
|
+
* bound to a different wallet. Returns the token. Throws if the user rejects the
|
|
34
|
+
* signature or the server rejects the proof -- callers surface a retry. The
|
|
35
|
+
* caller's authority predicate also cancels work without clearing shared sessions.
|
|
36
|
+
*/
|
|
37
|
+
export declare const ensureWalletSession: (wallet: string, signMessage: SignMessage, isCurrent: () => boolean) => Promise<string>;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configurator (xochi-fi/xochi-widget#21, #35, #36, #37, #47, #48)
|
|
3
|
+
*
|
|
4
|
+
* The integrator-facing page at `/`: a settings list on one side (a row per
|
|
5
|
+
* section, each drilling into its options), a live preview of the real frame on
|
|
6
|
+
* a stand-in host page on the other, and the embed code. Every option is a frame URL
|
|
7
|
+
* parameter (src/pages/trade/embedParams.ts), and every control is built from
|
|
8
|
+
* the capability matrix the frame itself reads, so it only offers routes the
|
|
9
|
+
* solver fills. Options that are not backed by a shipped slice are absent, not
|
|
10
|
+
* disabled.
|
|
11
|
+
*
|
|
12
|
+
* The configuration lives in one resolved value (`resolveEmbedDefaults`, the
|
|
13
|
+
* same function the frame runs on load), and the preview params, every Get code
|
|
14
|
+
* format and the Developer parameters are all written from it by `embedOverrides`,
|
|
15
|
+
* so the code reproduces the preview by construction. The page keeps the same
|
|
16
|
+
* options in its own URL (configurator/configuratorUrl.ts), so a configuration
|
|
17
|
+
* is shared by its address.
|
|
18
|
+
*
|
|
19
|
+
* This component owns the state and the layout. Each section's controls are a
|
|
20
|
+
* component in configurator/, the Developer draft is `useParamsDraft`, and the
|
|
21
|
+
* page URL is `useConfiguratorUrl`.
|
|
22
|
+
*/
|
|
23
|
+
/** Quiet time after the last change before the preview reloads. */
|
|
24
|
+
export declare const PREVIEW_DEBOUNCE_MS = 400;
|
|
25
|
+
export declare function Configurator(): import("react").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trade -- the widget.
|
|
3
|
+
*
|
|
4
|
+
* Trade (Buy, Swap and Cash out), Send (wallet or Stealth address),
|
|
5
|
+
* Activity (holdings and transaction logs) and Claims
|
|
6
|
+
* (private receiving). No site chrome: the widget is served alone, framed by
|
|
7
|
+
* its host (xochi-fi/xochi-widget#20). Most protocol traffic is agents (via the MCP /
|
|
8
|
+
* OpenAPI surface); this is the simple human path: connect a wallet, swap
|
|
9
|
+
* cross-chain with public or stealth settlement, watch it settle.
|
|
10
|
+
*
|
|
11
|
+
* A host may drop parts of it (`look`, from the frame URL, xochi-widget#38):
|
|
12
|
+
* `layout=swap` leaves the card without the tab row, so a stealth recipient
|
|
13
|
+
* claims on the full widget in a tab of its own, opened on Claims.
|
|
14
|
+
*/
|
|
15
|
+
import { type EmbedLook } from "./trade/embedParams.js";
|
|
16
|
+
import { type HostConnection } from "@xochi/widget-lib";
|
|
17
|
+
import { type WidgetEmbedConfig } from "../config.js";
|
|
18
|
+
type WalletUiConnection = Pick<HostConnection, "walletUi" | "requestConnect" | "onWalletUi">;
|
|
19
|
+
interface TradeProps {
|
|
20
|
+
/**
|
|
21
|
+
* What the frame shows and how tall it is (embedParams.ts). Required, so a
|
|
22
|
+
* caller cannot silently drop the host's layout: EmbedApp passes the URL's.
|
|
23
|
+
*/
|
|
24
|
+
look: EmbedLook;
|
|
25
|
+
/** Connection override for focused host/standalone behavior tests. */
|
|
26
|
+
hostConnection?: WalletUiConnection | null;
|
|
27
|
+
/**
|
|
28
|
+
* The host's tab/mode/destination narrowing and fiat default. Defaults to
|
|
29
|
+
* the frame URL's (`readWidgetEmbedConfig`), read once on mount.
|
|
30
|
+
*/
|
|
31
|
+
embed?: WidgetEmbedConfig;
|
|
32
|
+
/** Show agent authorization even when this wallet has no agents yet. */
|
|
33
|
+
enableAgents?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare function Trade({ look, hostConnection, embed, enableAgents, }: TradeProps): import("react").JSX.Element;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Allowed assets section (xochi-fi/xochi-widget#39): which chains and
|
|
3
|
+
* tokens each leg of the frame may use. Every box ticked is no list at all;
|
|
4
|
+
* unticking writes the list (`fromChains`, `toChains`, `sellTokens`,
|
|
5
|
+
* `buyTokens`, embedParams.ts). The lists are shown as asked, so one the frame
|
|
6
|
+
* ignores stays visible here with the frame's reason.
|
|
7
|
+
*/
|
|
8
|
+
import { type EmbedAllowLists, type EmbedIgnored, type EmbedOffer } from "../trade/embedParams.js";
|
|
9
|
+
interface AllowedAssetsSectionProps {
|
|
10
|
+
/** The frame's full offer (not narrowed): every option a list can keep. */
|
|
11
|
+
offer: EmbedOffer;
|
|
12
|
+
asked: EmbedAllowLists;
|
|
13
|
+
ignored: EmbedIgnored;
|
|
14
|
+
onLists: (lists: EmbedAllowLists) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function AllowedAssetsSection({ offer, asked, ignored, onLists, }: AllowedAssetsSectionProps): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Appearance section (xochi-fi/xochi-widget#37): the frame's theme, as a
|
|
3
|
+
* preset per theme the app already ships (src/styles/themes.css). Custom
|
|
4
|
+
* colours with a contrast floor are xochi-fi/xochi#581, not here.
|
|
5
|
+
*
|
|
6
|
+
* Each thumbnail is a miniature card painted with its theme's own tokens,
|
|
7
|
+
* copied into configurator.css (the configurator page wears one theme, so it
|
|
8
|
+
* cannot read another's live); themeThumbs.test.ts holds the copies to the
|
|
9
|
+
* shipped values.
|
|
10
|
+
*/
|
|
11
|
+
import { type EmbedTheme } from "@xochi/widget-lib";
|
|
12
|
+
/** Each preset's name and what it looks like, for its card and its row. */
|
|
13
|
+
export declare const THEME_PRESET: Record<EmbedTheme, {
|
|
14
|
+
name: string;
|
|
15
|
+
meta: string;
|
|
16
|
+
}>;
|
|
17
|
+
interface AppearanceSectionProps {
|
|
18
|
+
theme: EmbedTheme;
|
|
19
|
+
onTheme: (theme: EmbedTheme) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function AppearanceSection({ theme, onTheme }: AppearanceSectionProps): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get code (xochi-fi/xochi-widget#36): the footer of the options column, with
|
|
3
|
+
* the public widget library as HTML or React, or the frame URL as a fallback.
|
|
4
|
+
*
|
|
5
|
+
* The code is written on this page's own origin, so a staging or preview build
|
|
6
|
+
* hands out code for itself. Anywhere but production that is said next to Copy.
|
|
7
|
+
*/
|
|
8
|
+
import type { EmbedParams } from "@xochi/widget-lib";
|
|
9
|
+
/** Where the production widget is served. */
|
|
10
|
+
export declare const PRODUCTION_HOST = "widget.xochi.fi";
|
|
11
|
+
interface CodeDockProps {
|
|
12
|
+
/** The widget origin and complete public params the preview is showing. */
|
|
13
|
+
origin: string;
|
|
14
|
+
params: EmbedParams;
|
|
15
|
+
/** The host the widget is served from, for the embedding note. */
|
|
16
|
+
host: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function CodeDock({ origin, params, host }: CodeDockProps): import("react").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Developer section (xochi-fi/xochi-widget#36): the `/embed` parameters as
|
|
3
|
+
* editable text, with every problem the frame would silently swallow named.
|
|
4
|
+
*/
|
|
5
|
+
import type { ParamsDraftState } from "./useParamsDraft.js";
|
|
6
|
+
interface DeveloperSectionProps {
|
|
7
|
+
params: ParamsDraftState;
|
|
8
|
+
/** The user typed in the draft (before it is checked). */
|
|
9
|
+
onEdit: (text: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function DeveloperSection({ params, onEdit }: DeveloperSectionProps): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Integration section (xochi-fi/xochi-widget#48): the promo code for the
|
|
3
|
+
* snippet (`promo`), checked live on a preview quote while the section is
|
|
4
|
+
* open. The widget never shows the code: the frame sends it on every quote,
|
|
5
|
+
* and an unusable one never blocks it. A referral code (`ref`) is set through
|
|
6
|
+
* Developer only: it applies only under a publishable key, which the widget
|
|
7
|
+
* does not send.
|
|
8
|
+
*/
|
|
9
|
+
import { type EmbedDefaults } from "../trade/embedParams.js";
|
|
10
|
+
/** The section's row summary. */
|
|
11
|
+
export declare function integrationSummary(config: Pick<EmbedDefaults, "ref" | "promo">): string;
|
|
12
|
+
interface IntegrationSectionProps {
|
|
13
|
+
config: EmbedDefaults;
|
|
14
|
+
promoText: string;
|
|
15
|
+
onPromo: (text: string) => void;
|
|
16
|
+
/** Quiet time after typing before the preview quote. */
|
|
17
|
+
delayMs: number;
|
|
18
|
+
}
|
|
19
|
+
export declare function IntegrationSection({ config, promoText, onPromo, delayMs, }: IntegrationSectionProps): import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Layout section (xochi-fi/xochi-widget#38): what the frame leaves out
|
|
3
|
+
* and how tall it is. Every option removes or fixes; none adds to the card.
|
|
4
|
+
* Without a height the frame fits its content (`@xochi/widget-lib`'s
|
|
5
|
+
* `createXochiWidget` resizes the iframe over `xochi:resize`); with one,
|
|
6
|
+
* `createXochiWidget` mounts and keeps the iframe at it and the widget
|
|
7
|
+
* scrolls inside.
|
|
8
|
+
*/
|
|
9
|
+
import { type EmbedLayout } from "@xochi/widget-lib";
|
|
10
|
+
interface LayoutSectionProps {
|
|
11
|
+
layout: EmbedLayout;
|
|
12
|
+
onLayout: (layout: EmbedLayout) => void;
|
|
13
|
+
howItWorks: boolean;
|
|
14
|
+
onHowItWorks: (shown: boolean) => void;
|
|
15
|
+
/** The height as typed, which may be one the frame refuses. */
|
|
16
|
+
heightText: string;
|
|
17
|
+
onHeight: (text: string) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function LayoutSection({ layout, onLayout, howItWorks, onHowItWorks, heightText, onHeight, }: LayoutSectionProps): import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one line every lock and allow-list carries (xochi-fi/xochi-widget#39):
|
|
3
|
+
* they shape the widget, but nothing enforces them until publishable keys
|
|
4
|
+
* (xochi-fi/xochi#579) carry the same policy server-side.
|
|
5
|
+
*/
|
|
6
|
+
export declare function PolicyNote(): import("react").JSX.Element;
|