@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,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The preview side of the configurator (xochi-fi/xochi-widget#35): the public
|
|
3
|
+
* widget library on a stand-in host page, exactly as an integrator mounts it.
|
|
4
|
+
*
|
|
5
|
+
* The background and the device width describe the HOST, not the widget, so
|
|
6
|
+
* nothing here feeds the widget params or the code: they only change how the
|
|
7
|
+
* preview is looked at.
|
|
8
|
+
*/
|
|
9
|
+
import { type EmbedParams } from "@xochi/widget-lib";
|
|
10
|
+
import { type Backdrop, type PreviewDevice } from "./previewModel.js";
|
|
11
|
+
interface PreviewStageProps {
|
|
12
|
+
/** The frame path, `/embed?...`, for the standalone preview link. */
|
|
13
|
+
path: string;
|
|
14
|
+
/** The same frame parameters in their structured form. */
|
|
15
|
+
params: EmbedParams;
|
|
16
|
+
backdrop: Backdrop;
|
|
17
|
+
onBackdrop: (backdrop: Backdrop) => void;
|
|
18
|
+
device: PreviewDevice;
|
|
19
|
+
onDevice: (device: PreviewDevice) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function PreviewStage({ path, params, backdrop, onBackdrop, device, onDevice, }: PreviewStageProps): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Privacy section (xochi-fi/xochi-widget#35): the settlement mode the frame
|
|
3
|
+
* opens on. Stealth is offered only where the destination can carry it.
|
|
4
|
+
*/
|
|
5
|
+
import { type EmbedDefaults } from "../trade/embedParams.js";
|
|
6
|
+
import { type EmbedSettlement } from "@xochi/widget-lib";
|
|
7
|
+
import type { SolverCapabilities } from "@xochi/signer";
|
|
8
|
+
import type { CapabilityState } from "@xochi/client";
|
|
9
|
+
interface PrivacySectionProps {
|
|
10
|
+
config: EmbedDefaults;
|
|
11
|
+
capabilities: SolverCapabilities;
|
|
12
|
+
capabilityState: CapabilityState;
|
|
13
|
+
onSettlement: (settlement: EmbedSettlement) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function PrivacySection({ config, capabilities, capabilityState, onSettlement, }: PrivacySectionProps): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Route section (xochi-fi/xochi-widget#35, #46): the route row (send leg,
|
|
3
|
+
* flip, receive leg), the amount, and the locks. Each leg is the frame's own
|
|
4
|
+
* token and chain picker (`TokenSelector`), so the configurator shows a route
|
|
5
|
+
* the way the card does. Every choice the pickers list that leaves no route
|
|
6
|
+
* the solver fills stays listed with the frame's reason and cannot be chosen
|
|
7
|
+
* (routePicks.ts).
|
|
8
|
+
*/
|
|
9
|
+
import { type EmbedLock } from "@xochi/widget-lib";
|
|
10
|
+
import { type EmbedDefaults, type EmbedOffer } from "../trade/embedParams.js";
|
|
11
|
+
import { type RouteChoice } from "./routePicks.js";
|
|
12
|
+
/** The route in words, for its row: `250 USDT on Base to USDC on Ethereum`. */
|
|
13
|
+
export declare function routeSummary(config: EmbedDefaults): string;
|
|
14
|
+
interface RouteSectionProps {
|
|
15
|
+
offer: EmbedOffer;
|
|
16
|
+
/** What the frame opens on now. */
|
|
17
|
+
config: EmbedDefaults;
|
|
18
|
+
/** The amount as typed, which may be one the frame refuses. */
|
|
19
|
+
amountText: string;
|
|
20
|
+
/** A control changed the route; this is the whole route it leaves. */
|
|
21
|
+
onRoute: (route: RouteChoice) => void;
|
|
22
|
+
onAmount: (text: string) => void;
|
|
23
|
+
/** The locks as asked (the frame may drop an amount lock with no amount). */
|
|
24
|
+
locks: readonly EmbedLock[];
|
|
25
|
+
onLocks: (locks: readonly EmbedLock[]) => void;
|
|
26
|
+
/** Why the frame drops a lock, if it does. */
|
|
27
|
+
lockProblem: string | undefined;
|
|
28
|
+
}
|
|
29
|
+
export declare function RouteSection({ offer, config, amountText, onRoute, onAmount, locks, onLocks, lockProblem, }: RouteSectionProps): import("react").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The settings list (xochi-fi/xochi-widget#35): one row per section with a
|
|
3
|
+
* summary of its current value, and a sub-panel each row drills into.
|
|
4
|
+
*/
|
|
5
|
+
import { type ReactNode, type Ref } from "react";
|
|
6
|
+
interface SettingsRowProps {
|
|
7
|
+
title: string;
|
|
8
|
+
/** The section's current value, in words. */
|
|
9
|
+
summary: string;
|
|
10
|
+
onOpen: () => void;
|
|
11
|
+
ref?: Ref<HTMLButtonElement>;
|
|
12
|
+
}
|
|
13
|
+
/** A row that opens its section. Its accessible name is title then summary. */
|
|
14
|
+
export declare function SettingsRow({ title, summary, onOpen, ref }: SettingsRowProps): import("react").JSX.Element;
|
|
15
|
+
interface SettingsPanelProps {
|
|
16
|
+
title: string;
|
|
17
|
+
onBack: () => void;
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* One section's options. Opening it moves focus to its heading, so a screen
|
|
22
|
+
* reader announces where the user landed.
|
|
23
|
+
*/
|
|
24
|
+
export declare function SettingsPanel({ title, onBack, children }: SettingsPanelProps): import("react").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared-link notice (xochi-fi/xochi-widget#47). A configurator link can
|
|
3
|
+
* preset what the widget opens on (an amount, stealth settlement), and an
|
|
4
|
+
* integrator who copies the code straight away ships those presets to their
|
|
5
|
+
* own users. So a page opened with widget options in its URL says which, until
|
|
6
|
+
* dismissed.
|
|
7
|
+
*/
|
|
8
|
+
import { type EmbedParams } from "@xochi/widget-lib";
|
|
9
|
+
/** The link's widget presets as `key=value`, in the frame's parameter order. */
|
|
10
|
+
export declare function sharedPresets(params: EmbedParams): string[];
|
|
11
|
+
interface SharedLinkBannerProps {
|
|
12
|
+
presets: readonly string[];
|
|
13
|
+
onDismiss: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function SharedLinkBanner({ presets, onDismiss }: SharedLinkBannerProps): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "What users see" (xochi-fi/xochi-widget#40): a read-only panel beside the
|
|
3
|
+
* preview that says, for the configured route, what an end user is shown
|
|
4
|
+
* before signing: the fee, what each privacy mode does, and the payout
|
|
5
|
+
* contract.
|
|
6
|
+
*
|
|
7
|
+
* What the user sees is never restated here. The fee is a live, indicative
|
|
8
|
+
* preview price from the frame's own transport, laid out by the same derivation as the frame's
|
|
9
|
+
* receipt (lib/quoteCost.ts); the mode descriptions, their button lines and the
|
|
10
|
+
* payout clause are the frame's own constants (trade/settlementCopy.ts) and its
|
|
11
|
+
* own fix logic (lib/settlementAvailability.ts). The panel's own words are
|
|
12
|
+
* only the framing around them: what was priced, and why a price is missing.
|
|
13
|
+
*
|
|
14
|
+
* Read-only and outside the card: it changes neither the frame nor its URL.
|
|
15
|
+
* On a wide screen it is a third column; narrower (which includes a 390px
|
|
16
|
+
* phone) it is collapsed behind a disclosure, and asks for no quote until it
|
|
17
|
+
* is opened.
|
|
18
|
+
*/
|
|
19
|
+
import type { EmbedDefaults } from "../trade/embedParams.js";
|
|
20
|
+
/**
|
|
21
|
+
* Wide enough for the panel to be a third column beside the preview without
|
|
22
|
+
* squeezing the 460px frame. The same width as the `(min-width: 1280px)` rule
|
|
23
|
+
* in configurator.css (pinned by WhatUsersSee.test.tsx).
|
|
24
|
+
*/
|
|
25
|
+
export declare const SEES_COLUMN_MEDIA = "(min-width: 1280px)";
|
|
26
|
+
interface WhatUsersSeeProps {
|
|
27
|
+
config: EmbedDefaults;
|
|
28
|
+
}
|
|
29
|
+
export declare function WhatUsersSee({ config }: WhatUsersSeeProps): import("react").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the Get code dock opens with its code shown (xochi-fi/xochi-widget#35).
|
|
3
|
+
*
|
|
4
|
+
* On desktop the dock is pinned under the settings column and takes its height
|
|
5
|
+
* from it, so on a short viewport an open dock hides the lower half of a
|
|
6
|
+
* section (Route's Receive leg at 1280x720). There it opens collapsed to its
|
|
7
|
+
* head row, which still copies. Stacked (760px and below) the dock is in the
|
|
8
|
+
* page flow and covers nothing, so it opens shown.
|
|
9
|
+
*
|
|
10
|
+
* 920px: the open dock with format tabs and the non-production notice is
|
|
11
|
+
* about 410px tall, which still clipped Route's Receive leg at 900-913px.
|
|
12
|
+
*/
|
|
13
|
+
export declare const CODE_SHOWN_MEDIA = "(min-height: 920px), (max-width: 760px)";
|
|
14
|
+
/** Read once at mount; the user's toggle wins after that. */
|
|
15
|
+
export declare function codeShownByDefault(): boolean;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The configurator's own URL (xochi-fi/xochi-widget#36): every option, so a
|
|
3
|
+
* configuration can be shared by its address.
|
|
4
|
+
*
|
|
5
|
+
* The widget options use the frame's parameter names and its writer
|
|
6
|
+
* (`embedOverrides`), so `/?toChain=1&sell=USDT` configures what
|
|
7
|
+
* `/embed?toChain=1&sell=USDT` opens on. The preview's host background and
|
|
8
|
+
* device ride along under names the frame does not read:
|
|
9
|
+
*
|
|
10
|
+
* bg light | dark | checker | custom bg=dark
|
|
11
|
+
* bgColor the custom colour, 6 hex digits bgColor=2b3a55
|
|
12
|
+
* device desktop | phone device=phone
|
|
13
|
+
*/
|
|
14
|
+
import { type EmbedDefaults } from "../trade/embedParams.js";
|
|
15
|
+
import { type EmbedParams } from "@xochi/widget-lib";
|
|
16
|
+
import { type Backdrop, type PreviewDevice } from "./previewModel.js";
|
|
17
|
+
/**
|
|
18
|
+
* The configurator-only query keys. They share one query string with the
|
|
19
|
+
* frame's keys (EMBED_PARAM), so they must never collide with them (tested).
|
|
20
|
+
*/
|
|
21
|
+
export declare const VIEW_PARAM: {
|
|
22
|
+
readonly backdrop: "bg";
|
|
23
|
+
readonly color: "bgColor";
|
|
24
|
+
readonly device: "device";
|
|
25
|
+
};
|
|
26
|
+
export interface ConfiguratorState {
|
|
27
|
+
/** The widget options asked for, not yet resolved against the matrix. */
|
|
28
|
+
params: EmbedParams;
|
|
29
|
+
backdrop: Backdrop;
|
|
30
|
+
device: PreviewDevice;
|
|
31
|
+
}
|
|
32
|
+
/** Read a configurator URL's query string. Anything malformed takes its default. */
|
|
33
|
+
export declare function readConfiguratorSearch(search: string): ConfiguratorState;
|
|
34
|
+
/**
|
|
35
|
+
* The query string for an explicitly selected route and privacy mode, plus
|
|
36
|
+
* preview-only settings that differ from their defaults.
|
|
37
|
+
*/
|
|
38
|
+
export declare function configuratorSearch(config: EmbedDefaults, backdrop: Backdrop, device: PreviewDevice, params?: EmbedParams): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Developer section's editable `/embed` parameters (xochi-fi/xochi-widget#36).
|
|
3
|
+
*
|
|
4
|
+
* The text is one `key=value` per line. A pasted query string or a whole
|
|
5
|
+
* `/embed` URL reads the same, as the frame would read it: from its query, with
|
|
6
|
+
* any `#fragment` dropped and percent-encoding decoded. A draft applies only
|
|
7
|
+
* when every entry is something the frame would honour. What it would drop, it
|
|
8
|
+
* drops silently, so each problem is named here and the draft is held back.
|
|
9
|
+
*
|
|
10
|
+
* Every rule is the frame's own (trade/embedParams.ts): its parser decides what
|
|
11
|
+
* is well-formed, its resolver decides what is honoured and says why not. This
|
|
12
|
+
* module only splits the text and words the result.
|
|
13
|
+
*/
|
|
14
|
+
import { type FrameField, type EmbedDefaults, type EmbedOffer } from "../trade/embedParams.js";
|
|
15
|
+
import { type EmbedParams } from "@xochi/widget-lib";
|
|
16
|
+
import { SURFACE_FIELDS } from "./surfaceParams.js";
|
|
17
|
+
type ParamField = FrameField | (typeof SURFACE_FIELDS)[number];
|
|
18
|
+
/** The field each query key the frame resolves sets: EMBED_PARAM inverted. */
|
|
19
|
+
export declare const FIELD_BY_KEY: Readonly<Record<string, ParamField | undefined>>;
|
|
20
|
+
/** The parameter names, for messages. */
|
|
21
|
+
export declare const PARAM_KEYS: string;
|
|
22
|
+
/** The parameters that open the frame on `config`, one per line. */
|
|
23
|
+
export declare function paramsText(config: EmbedDefaults, params?: EmbedParams): string;
|
|
24
|
+
export interface ParamsDraft {
|
|
25
|
+
/** The well-formed parameters in the draft. */
|
|
26
|
+
params: EmbedParams;
|
|
27
|
+
/** Why the draft cannot apply, one sentence each; empty when it can. */
|
|
28
|
+
problems: string[];
|
|
29
|
+
}
|
|
30
|
+
/** Check a draft against the frame's parser, then against its resolver. */
|
|
31
|
+
export declare function readParamsDraft(text: string, offer: EmbedOffer): ParamsDraft;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The preview's host-only vocabulary (xochi-fi/xochi-widget#35, #47): the
|
|
3
|
+
* host-page backdrops and the device widths. A plain module, so the pure code
|
|
4
|
+
* (the configurator URL) and the PreviewStage component read one list each,
|
|
5
|
+
* and a new kind or device reaches both.
|
|
6
|
+
*/
|
|
7
|
+
/** The phone viewport the device toggle previews. */
|
|
8
|
+
export declare const PHONE_WIDTH = 390;
|
|
9
|
+
/** The host-page backdrops, in toolbar order. */
|
|
10
|
+
export declare const BACKDROP_KINDS: readonly ["light", "dark", "checker", "custom"];
|
|
11
|
+
export type BackdropKind = (typeof BACKDROP_KINDS)[number];
|
|
12
|
+
/** The host page behind the frame. `custom` is the colour used for `custom`. */
|
|
13
|
+
export interface Backdrop {
|
|
14
|
+
kind: BackdropKind;
|
|
15
|
+
custom: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const DEFAULT_BACKDROP: Backdrop;
|
|
18
|
+
/** The device widths the preview shows, in toolbar order; the first is the default. */
|
|
19
|
+
export declare const PREVIEW_DEVICES: readonly ["desktop", "phone"];
|
|
20
|
+
export type PreviewDevice = (typeof PREVIEW_DEVICES)[number];
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The quote the "What users see" panel prices a configuration with
|
|
3
|
+
* (xochi-fi/xochi-widget#40): the one an end user's frame asks for before a
|
|
4
|
+
* wallet connects.
|
|
5
|
+
*
|
|
6
|
+
* That visitor's quote is a PREVIEW (`preview: true`): the worker prices it at
|
|
7
|
+
* the Standard tier, strips the signing payload and persists nothing, so the
|
|
8
|
+
* panel can ask for one on every route change without creating a quote, an
|
|
9
|
+
* intent or a deposit route. It is always Public: stealth needs keys derived
|
|
10
|
+
* from the wallet, so until one connects the frame quotes Public whatever mode
|
|
11
|
+
* is selected (useSettlementGating, `quotedSettlement`).
|
|
12
|
+
*
|
|
13
|
+
* The frame withholds a quote in four cases, and so does the panel, for the
|
|
14
|
+
* same reasons and with the frame's own checks:
|
|
15
|
+
* - no amount: the frame quotes nothing until one is typed. The panel prices
|
|
16
|
+
* a reference order instead, sized inside the solver's bounds and labelled
|
|
17
|
+
* as such, so the default configuration still shows a live fee;
|
|
18
|
+
* - a non-EVM destination: the frame waits for the recipient address;
|
|
19
|
+
* - an amount outside the solver's advertised USD bounds: the frame shows
|
|
20
|
+
* the bounds notice instead;
|
|
21
|
+
* - capability state is not live, or the exact typed route is absent or
|
|
22
|
+
* lacks Public privacy: stale and display fallback metadata never authorize
|
|
23
|
+
* a preview quote.
|
|
24
|
+
*/
|
|
25
|
+
import { type CapabilityState, type ResolvedRouteAvailability, type QuoteRequest } from "@xochi/client";
|
|
26
|
+
import type { RoutePrivacyMode, SolverCapabilities } from "@xochi/signer";
|
|
27
|
+
import type { EmbedDefaults } from "../trade/embedParams.js";
|
|
28
|
+
/** The trust score a visitor's preview is priced at: Standard. */
|
|
29
|
+
export declare const VISITOR_TRUST_SCORE = 0;
|
|
30
|
+
/** The order priced when the configuration sets no amount, in USD, before the bounds. */
|
|
31
|
+
export declare const REFERENCE_ORDER_USD = 100;
|
|
32
|
+
/** The amount a preview is priced for. */
|
|
33
|
+
export interface PricedAmount {
|
|
34
|
+
/** As shown, in whole tokens ("100"). */
|
|
35
|
+
text: string;
|
|
36
|
+
/** In origin base units, as sent with the request. */
|
|
37
|
+
baseUnits: string;
|
|
38
|
+
/** The reference order's size in USD, or null when the amount is configured. */
|
|
39
|
+
referenceUsd: number | null;
|
|
40
|
+
}
|
|
41
|
+
export type UnconfirmedReason = "stale" | "fallback" | "failed" | "route" | "private";
|
|
42
|
+
export type PreviewPlan = {
|
|
43
|
+
/** Privacy modes authorized by the exact selected live route. */
|
|
44
|
+
routePrivacyModes: readonly RoutePrivacyMode[];
|
|
45
|
+
} &
|
|
46
|
+
/** No amount is configured and none can be sized: no live price for a non-dollar token. */
|
|
47
|
+
({
|
|
48
|
+
kind: "no_amount";
|
|
49
|
+
}
|
|
50
|
+
/** A non-EVM destination: the frame waits for the user's recipient address. */
|
|
51
|
+
| {
|
|
52
|
+
kind: "needs_recipient";
|
|
53
|
+
chainName: string;
|
|
54
|
+
}
|
|
55
|
+
/** Why this configuration cannot ask for an anonymous preview quote. */
|
|
56
|
+
| {
|
|
57
|
+
kind: "unconfirmed";
|
|
58
|
+
reason: UnconfirmedReason;
|
|
59
|
+
}
|
|
60
|
+
/** Outside the solver's bounds: the frame shows `notice` instead of a quote. */
|
|
61
|
+
| {
|
|
62
|
+
kind: "out_of_bounds";
|
|
63
|
+
amount: PricedAmount;
|
|
64
|
+
notice: string;
|
|
65
|
+
}
|
|
66
|
+
/** Ask for this quote. `key` changes exactly when the request does. */
|
|
67
|
+
| {
|
|
68
|
+
kind: "quote";
|
|
69
|
+
amount: PricedAmount;
|
|
70
|
+
key: string;
|
|
71
|
+
});
|
|
72
|
+
/** What the plan reads besides the configuration. */
|
|
73
|
+
export interface PreviewInputs {
|
|
74
|
+
capabilities: SolverCapabilities;
|
|
75
|
+
/** Only `live` may authorize the exact route and its Public privacy mode. */
|
|
76
|
+
capabilityState: CapabilityState;
|
|
77
|
+
/** The price feed the frame reads (live, or its fallback). */
|
|
78
|
+
prices: Record<string, number>;
|
|
79
|
+
/** The prices are live, not the hard-coded fallback. */
|
|
80
|
+
pricesLive: boolean;
|
|
81
|
+
}
|
|
82
|
+
/** Resolve the exact configured route against typed live capabilities. */
|
|
83
|
+
export declare function previewRouteAvailability(config: EmbedDefaults, inputs: Pick<PreviewInputs, "capabilities" | "capabilityState">): ResolvedRouteAvailability;
|
|
84
|
+
/** What the panel does for `config`. */
|
|
85
|
+
export declare function previewPlan(config: EmbedDefaults, inputs: PreviewInputs): PreviewPlan;
|
|
86
|
+
/**
|
|
87
|
+
* The visitor's preview request for `config` at `amount`, stamped at `nowMs`,
|
|
88
|
+
* or the first reason it is not a sendable request.
|
|
89
|
+
*/
|
|
90
|
+
export declare function previewQuoteRequest(config: EmbedDefaults, amount: PricedAmount, nowMs: number): {
|
|
91
|
+
ok: true;
|
|
92
|
+
request: QuoteRequest;
|
|
93
|
+
} | {
|
|
94
|
+
ok: false;
|
|
95
|
+
error: string;
|
|
96
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the Route section's pickers offer (xochi-fi/xochi-widget#35, #46).
|
|
3
|
+
*
|
|
4
|
+
* The pickers are the frame's own (`TokenSelector`); this module decides, for
|
|
5
|
+
* each capability-derived token and chain they list, whether the exact typed
|
|
6
|
+
* route remains available. An unavailable choice stays listed with the route
|
|
7
|
+
* model's reason and cannot be chosen. Non-live capability snapshots remain
|
|
8
|
+
* unknown and are not offered as executable routes.
|
|
9
|
+
*/
|
|
10
|
+
import type { SelectableChainId } from "@xochi/client";
|
|
11
|
+
import type { Token } from "../../types/intent.js";
|
|
12
|
+
import type { PairAvailability } from "../../lib/pairAvailability.js";
|
|
13
|
+
import { type EmbedDefaults, type EmbedOffer, type EmbedPolicy } from "../trade/embedParams.js";
|
|
14
|
+
/** The route fields a control can change. */
|
|
15
|
+
export interface RouteChange {
|
|
16
|
+
fromChainId?: SelectableChainId;
|
|
17
|
+
toChainId?: SelectableChainId;
|
|
18
|
+
sellSymbol?: string;
|
|
19
|
+
buySymbol?: string;
|
|
20
|
+
}
|
|
21
|
+
/** A whole route, as one control change leaves it. */
|
|
22
|
+
export type RouteChoice = Required<RouteChange>;
|
|
23
|
+
interface Route {
|
|
24
|
+
fromChainId: SelectableChainId;
|
|
25
|
+
toChainId: SelectableChainId;
|
|
26
|
+
fromToken: Token;
|
|
27
|
+
toToken: Token;
|
|
28
|
+
}
|
|
29
|
+
type Leg = "sell" | "buy";
|
|
30
|
+
/**
|
|
31
|
+
* The route after one control changes, keeping every other choice that still
|
|
32
|
+
* fills: the coin across a chain change when the new chain lists it, and the
|
|
33
|
+
* receive coin when it still pairs with the send coin. Null when the change
|
|
34
|
+
* leaves no route the solver fills.
|
|
35
|
+
*/
|
|
36
|
+
export declare function changeRoute(offer: EmbedOffer, current: EmbedDefaults, change: RouteChange): RouteChoice | null;
|
|
37
|
+
/**
|
|
38
|
+
* Why the frame would refuse this route, in the words its panel shows, or
|
|
39
|
+
* null when it fills. A pair that is only unknown (off the live matrix) reads
|
|
40
|
+
* as the panel's own "route list unavailable" line.
|
|
41
|
+
*/
|
|
42
|
+
export declare function routeRefusal(offer: EmbedOffer, route: Route): string | null;
|
|
43
|
+
/** A chain id the leg offers, narrowed to its type, or null. */
|
|
44
|
+
export declare function offeredChain(offer: EmbedOffer, leg: Leg, chainId: number): SelectableChainId | null;
|
|
45
|
+
/**
|
|
46
|
+
* The configuration's allow-lists without its locks: what the pickers narrow
|
|
47
|
+
* to. A lock holds the value set on this page, so the value stays a control.
|
|
48
|
+
*/
|
|
49
|
+
export declare function allowListPolicy(config: EmbedDefaults): EmbedPolicy;
|
|
50
|
+
/**
|
|
51
|
+
* Whether a token the picker lists can be chosen for a leg, and if not why.
|
|
52
|
+
* The send coin keeps any receive coin that still pairs with it
|
|
53
|
+
* (`changeRoute`), so it is refused only when none does; the receive coin is
|
|
54
|
+
* refused by the pair it would make with the send coin.
|
|
55
|
+
*/
|
|
56
|
+
export declare function tokenAvailability(offer: EmbedOffer, config: EmbedDefaults, leg: Leg, token: Token): PairAvailability;
|
|
57
|
+
/**
|
|
58
|
+
* Why a chain the picker lists cannot be chosen for a leg, or null when it
|
|
59
|
+
* can. A chain change keeps the coins where they still fill (`changeRoute`),
|
|
60
|
+
* so the reason is the one the current coins meet there.
|
|
61
|
+
*/
|
|
62
|
+
export declare function chainRefusal(offer: EmbedOffer, config: EmbedDefaults, leg: Leg, chainId: number): string | null;
|
|
63
|
+
/**
|
|
64
|
+
* The route reversed, or why it cannot be. The frame's flip rule comes first
|
|
65
|
+
* (`routeFlipBlockedReason`: a lock holds the route, an allow-list one
|
|
66
|
+
* direction), then the reversed pair has to be one the frame opens on.
|
|
67
|
+
*/
|
|
68
|
+
export declare function flipRoute(offer: EmbedOffer, config: EmbedDefaults): {
|
|
69
|
+
route: RouteChoice;
|
|
70
|
+
blocked: null;
|
|
71
|
+
} | {
|
|
72
|
+
route: null;
|
|
73
|
+
blocked: string;
|
|
74
|
+
};
|
|
75
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The code the configurator hands an integrator (xochi-fi/xochi-widget#36),
|
|
3
|
+
* one per Get code tab. HTML loads the exact-version browser ESM module the
|
|
4
|
+
* widget's own origin serves (no third-party script on the integrator's page);
|
|
5
|
+
* React uses the npm package; URL is the raw-frame fallback.
|
|
6
|
+
*/
|
|
7
|
+
import { type EmbedParams } from "@xochi/widget-lib";
|
|
8
|
+
/** The browser ESM entry served beside the frame at `origin`. */
|
|
9
|
+
export declare const widgetLibModuleUrl: (origin: string) => string;
|
|
10
|
+
export type CodeFormat = "html" | "react" | "url" | "ramp";
|
|
11
|
+
export declare const CODE_FORMATS: readonly {
|
|
12
|
+
id: CodeFormat;
|
|
13
|
+
tab: string;
|
|
14
|
+
label: string;
|
|
15
|
+
}[];
|
|
16
|
+
/** The HTML and module code to paste into an integrator's page. */
|
|
17
|
+
export declare function htmlSnippet(origin: string, params: EmbedParams): string;
|
|
18
|
+
/** A React component with the same mount and complete unmount cleanup. */
|
|
19
|
+
export declare function reactSnippet(origin: string, params: EmbedParams): string;
|
|
20
|
+
/** The code for one tab, for the public widget at `origin`. */
|
|
21
|
+
export declare function codeFor(format: CodeFormat, origin: string, params: EmbedParams): string;
|
|
22
|
+
/** The public ramp facade takes direction, while updateParams carries EmbedParams. */
|
|
23
|
+
export declare function rampSnippet(origin: string, params: EmbedParams): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type EmbedParams, WIDGET_TABS as TABS, TRADE_MODES as MODES, SEND_DESTINATIONS as DESTINATIONS } from "@xochi/widget-lib";
|
|
2
|
+
export { TABS, MODES, DESTINATIONS };
|
|
3
|
+
export declare const SURFACE_FIELDS: readonly ["initialTab", "tabs", "initialMode", "modes", "sendDestinations", "fiatCurrency", "rampProviders"];
|
|
4
|
+
export type SurfaceParams = Pick<EmbedParams, (typeof SURFACE_FIELDS)[number]>;
|
|
5
|
+
/** Defaults and visibility only. No capability or execution state lives here. */
|
|
6
|
+
export declare function surfaceParams(params: EmbedParams): SurfaceParams;
|
|
7
|
+
export declare function withSurfaceParams(base: EmbedParams, asked: EmbedParams): EmbedParams;
|
|
8
|
+
/** Replace the surface configuration while retaining unrelated route and look choices. */
|
|
9
|
+
export declare function replaceSurfaceParams(previous: EmbedParams, next: SurfaceParams): EmbedParams;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Integration section's live check of the promo code
|
|
3
|
+
* (xochi-fi/xochi-widget#48): a non-persisted preview quote for the configured
|
|
4
|
+
* route, carrying the codes the frame would send, read for what the Worker
|
|
5
|
+
* says about the promo code.
|
|
6
|
+
*
|
|
7
|
+
* Only the Worker's answer is shown, and only from a quote it priced. A preview
|
|
8
|
+
* that no solver priced (`can_solve: false`: no bid, or a route the solver
|
|
9
|
+
* declines) judged no code at all, so it is reported as no bid, never as a code
|
|
10
|
+
* that was turned down. On a priced quote, codes the Worker applies come back
|
|
11
|
+
* named; a code it looks at and does not apply comes back with one fixed note
|
|
12
|
+
* for every reason (unknown, expired, used up, not valid under this key); and a
|
|
13
|
+
* Worker with codes turned off answers with neither, which is shown as that.
|
|
14
|
+
*/
|
|
15
|
+
import { type QuoteRequest } from "@xochi/client";
|
|
16
|
+
import type { QuoteResponse } from "../../types/intent.js";
|
|
17
|
+
import type { EmbedDefaults } from "../trade/embedParams.js";
|
|
18
|
+
/** What the Worker said about the promo code on a quote it priced. */
|
|
19
|
+
export type CodeOutcome = Pick<QuoteResponse, "promo" | "promoNote">;
|
|
20
|
+
export type CodeCheck =
|
|
21
|
+
/** No promo code is set: nothing to check. */
|
|
22
|
+
{
|
|
23
|
+
kind: "none";
|
|
24
|
+
}
|
|
25
|
+
/** Waiting for a pause in typing, or for the preview quote. */
|
|
26
|
+
| {
|
|
27
|
+
kind: "checking";
|
|
28
|
+
} | {
|
|
29
|
+
kind: "checked";
|
|
30
|
+
outcome: CodeOutcome;
|
|
31
|
+
}
|
|
32
|
+
/** No solver priced the preview, so no code was judged; why, in words. */
|
|
33
|
+
| {
|
|
34
|
+
kind: "no_bid";
|
|
35
|
+
reason: string;
|
|
36
|
+
}
|
|
37
|
+
/** The preview quote itself failed; why, in words. */
|
|
38
|
+
| {
|
|
39
|
+
kind: "failed";
|
|
40
|
+
reason: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The amount a check quotes when none is configured: an ordinary order, so the
|
|
44
|
+
* route prices (codes are judged the same at any amount). 0.05 of ETH or WETH,
|
|
45
|
+
* 100 of anything else, which is right for the dollar and euro coins; a token
|
|
46
|
+
* worth far less can get no bid, and the check then says to set an amount.
|
|
47
|
+
*/
|
|
48
|
+
export declare function probeAmount(config: Pick<EmbedDefaults, "amount" | "fromToken">): string;
|
|
49
|
+
/** The preview quote that checks `config`'s promo code; null when it sets none. */
|
|
50
|
+
export declare function codeCheckRequest(config: EmbedDefaults, nowMs: number): QuoteRequest | null;
|
|
51
|
+
/** A quote reply as a check result. */
|
|
52
|
+
export declare function readCodeCheck(quote: QuoteResponse): CodeCheck;
|
|
53
|
+
/** A failed preview quote, in words. */
|
|
54
|
+
export declare function checkFailure(err: unknown): CodeCheck;
|
|
55
|
+
/** Check `config`'s codes after `delayMs` of quiet; re-checked on any change. */
|
|
56
|
+
export declare function useCodeCheck(config: EmbedDefaults, delayMs: number): CodeCheck;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The configurator's own address (xochi-fi/xochi-widget#36, #47): read once
|
|
3
|
+
* when the page opens, then kept in step with every option so a configuration
|
|
4
|
+
* is shared by its URL. The format is in configuratorUrl.ts.
|
|
5
|
+
*/
|
|
6
|
+
import { type ConfiguratorState } from "./configuratorUrl.js";
|
|
7
|
+
/** What the page's URL carried when it opened. Read once; never re-read. */
|
|
8
|
+
export declare function useOpenedConfiguration(): ConfiguratorState;
|
|
9
|
+
/**
|
|
10
|
+
* Write `search` into the page URL after `delayMs` without a newer change.
|
|
11
|
+
*
|
|
12
|
+
* Browsers cap history writes (WebKit throws past 100 in 10s, Firefox drops
|
|
13
|
+
* them) and a colour-picker drag changes the URL every frame, hence the pause;
|
|
14
|
+
* a refused write is logged, never thrown into the page.
|
|
15
|
+
*
|
|
16
|
+
* @param writable False leaves the URL exactly as it is. The caller holds it
|
|
17
|
+
* false for an untouched page until the live matrix answers: a shared URL's
|
|
18
|
+
* route may be one the fallback cannot confirm, and rewriting it would drop
|
|
19
|
+
* what the sender chose.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useConfiguratorUrl(search: string, writable: boolean, delayMs: number): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Developer parameters as a draft, two-way synced with the controls
|
|
3
|
+
* (xochi-fi/xochi-widget#36, #47).
|
|
4
|
+
*
|
|
5
|
+
* A control change rewrites the draft. A draft the frame would fully honour
|
|
6
|
+
* drives the controls through `apply`; one with problems is kept as typed and
|
|
7
|
+
* not applied. Leaving the field tidies an applied draft to canonical form.
|
|
8
|
+
*/
|
|
9
|
+
import { type EmbedDefaults, type EmbedOffer } from "../trade/embedParams.js";
|
|
10
|
+
import { type EmbedParams } from "@xochi/widget-lib";
|
|
11
|
+
export interface ParamsDraftState {
|
|
12
|
+
/** The text as it stands. */
|
|
13
|
+
draft: string;
|
|
14
|
+
/** Why the draft is not applied; empty when it is. */
|
|
15
|
+
problems: string[];
|
|
16
|
+
/** The user typed `text`. */
|
|
17
|
+
edit: (text: string) => void;
|
|
18
|
+
/** The user left the draft: tidy it if it applied. */
|
|
19
|
+
settle: () => void;
|
|
20
|
+
/** Empty the draft (Reset). */
|
|
21
|
+
clear: () => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @param config What the frame opens on now, as the controls show it.
|
|
25
|
+
* @param apply Make `params` the configuration. The caller resolves them with
|
|
26
|
+
* `resolveEmbedDefaults` against the same `offer`, which is what lets the
|
|
27
|
+
* draft predict the controls' next state below and keep the text as typed.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useParamsDraft(config: EmbedDefaults, offer: EmbedOffer, apply: (params: EmbedParams) => void, publicParams?: EmbedParams): ParamsDraftState;
|