@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
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.1] - 2026-11-20
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Default to exact Permit2 approvals, require explicit consent for unlimited approval, and identify confirmed execution failures where no funds moved (xochi-fi/xochi-widget#177).
|
|
8
|
+
- Adopt a host wallet that already has an account without prompting again on mobile, and request accounts before attempting a chain switch (xochi-fi/xochi-widget#178).
|
|
9
|
+
|
|
10
|
+
- Clear the React 19 release gate with documented WalletConnect 2.26 overrides
|
|
11
|
+
for npm, pnpm, and Yarn. The packed consumer requires zero React peer problems.
|
|
12
|
+
Review of the Reown license remains an open legal item outside this release gate.
|
|
13
|
+
|
|
14
|
+
## [0.1.0] - 2026-11-18
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Pre-release embed contract change: Cash out (`offramp`) joins Buy and Swap under Trade. Send offers Wallet address and Stealth. Legacy `payment_app` URL entries are dropped. The configurator and its snippets use the updated contract. Bridge protocol v1 is unchanged.
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- Release hardening for the ramp and Send (xochi-sdk#180). Inside an iframe, Buy and Cash out stay unexecutable until a current-protocol host pins the frame, and say so (waiting, or a permanent refusal for a legacy loader). New deployment setting `onrampCanaryCapAtomic` (per-purchase cap, unset by default, enforced before any rail read), beside `offrampCanaryCapAtomic`. Activity resumes a submitted purchase or open cash-out when narrowing has removed Buy or Cash out. Ramp host events are deduplicated per fact, and a reload continues the stored `rampRef` instead of announcing a second operation. Setup prose for Peer's linked-session sign-in (the production `/v3/sign` 401) and `maker_account_setup`. Stealth copy discloses that Xochi sees the recipient's meta-address. Ramp call-to-action buttons use the shared button style. A release privacy test drives each ramp and Send flow through a scripted host and asserts nothing forbidden reaches messages, storage, logs or reports.
|
|
23
|
+
|
|
24
|
+
- Route a supported source asset into public Base USDC before Trade/Cash out (#179), with independent Xochi and Peer approvals and receipts. Peer stays blocked until route completion and fresh spendable wallet balance reads, including at Peer approval. Peer failure preserves the completed route and explains wallet versus escrow recovery. Show sanitized maker order totals and cancel superseded maker discovery reads.
|
|
25
|
+
|
|
26
|
+
- Optional Xochi routing after confirmed Peer Buy delivery and payout hold release (#178). A fresh quote and separate wallet approval can route Base USDC to a live supported EVM asset, the wallet's Stealth keys or another recipient's meta-address. The route keeps its own preview, expiry, status and receipt; failure preserves Peer completion and names the Base USDC wallet, retry quotes only Xochi, and skip keeps USDC. Existing Xochi Activity records the route without recipient keys or Peer handles; reload polls the original Xochi intent rather than resubmitting.
|
|
27
|
+
|
|
28
|
+
- Extract the complete hosted trading widget: wallet/Stealth providers, route selection, quote/sign/execute flows, claims, history, recovery, activity and agent panels, session adapters, styles, fonts and assets.
|
|
29
|
+
- Export the separate lightweight iframe configurator, shared configuration model, stylesheet and browser modules used by the private affiliate dashboard.
|
|
30
|
+
- Accept explicit immutable deployment settings and own the iframe bridge through widget mount/unmount, preserving signing consent, security pins and storage formats.
|
|
31
|
+
- Preserve the existing host's live theme updates with public loader `0.5.0`, including wallet dialogs and auto resolution, without resetting the frame or trading state.
|
|
32
|
+
- Replace the private shared-package dependency with public client and signer exports. Add isolated packed-consumer and published-dependency release gates.
|
|
33
|
+
- Canton Coin destination (xochi-sdk#116), behind `CANTON_DESTINATION_LIVE` (off): Base USDC -> Canton Coin to a Canton party, offered only while the live matrix advertises Canton (`cvm`) with an exact route, as a destination only, Canton Coin only, public only (Stealth and Shielded disabled). The party is validated with the client parser and sent byte for byte as typed. Recipient readiness copy and an actionable `recipient_not_preapproved` refusal. The escrow panel reads Riddler's attested `cantonUpdateId` and the Base lock (never a gateway completion or a balance), shows `refundableAt`, links the lock, the escrow and the Canton update (`https://ccview.io/updates/<id>`), and sends the taker's `refund(orderId)` from the injected wallet once it opens. New deployment setting `escrows` (the reviewed `RiddlerEscrow` per origin chain), passed to the machine only while the flag is on. Resume, local activity and embed parameters refuse Canton while it is off.
|
|
34
|
+
- Trade, Send, Activity and Claims tabs (xochi-sdk#193), replacing Swap, Activity and Claims. Trade holds Buy, Swap and Cash out. Send picks a destination: `address` (a public ERC-20 transfer on the wallet's chain, with chain-checked recipient validation, an exact-amount review and an explicit wallet approval; the public hash is shown and logged to Activity under the new `xochi_local_sends:<wallet>` key) and `stealth` (the existing Stealth settlement to your own stealth keys, handed to the Swap card with Stealth selected; key setup stays an explicit step). Tabs, modes and destinations share one roving-tabindex tablist, and their ids match the embed contract (`trade | send | activity | claims`, `onramp | swap | offramp`, `address | stealth`). Existing storage keys, embed URLs and `layout=swap` are unchanged.
|
|
35
|
+
- Send > Stealth can pay someone else's ERC-5564 stealth meta-address (xochi-sdk#199). "Someone else" takes a pasted `st:eth:0x...`, parsed strictly (prefix, exact length, hex, two compressed secp256k1 points on the curve, not a publicly known spending key) and refused with a reason otherwise; a review shows it abbreviated with a full copy, both networks, the amount and the asset. The Swap card quotes Stealth with those public keys in place of the wallet's own (no key setup, no signature on the way), names the recipient while it holds, and drops it with a toast the moment the order leaves Stealth. The flow's ending, Activity and Retry say the recipient claims it: the record keeps only `stealthPayee: "other"`, never their keys, offers no claim and refuses a retry. Copy states Stealth hides the recipient's address link, not the funding transaction, amount or timing.
|
|
36
|
+
|
|
37
|
+
- Live Peer rail availability (xochi-sdk#174) in Trade/Buy and Trade/Cash out. The critical privacy and liveness facts come before any rail; fresh `available` offers form a native radio group, and setup-required, temporarily unavailable (with retry time), unsupported, unknown and expired rails stay readable with a textual reason and next step. Offers expire in place at `valid_until`; amount/currency changes refetch and discard superseded responses. Selecting a rail executes nothing. The full layout now applies the host's `initialTab`, `tabs`, `initialMode`, `modes`, `sendDestinations`, `fiatCurrency` and `rampProviders` (narrowing only).
|
|
38
|
+
- Peer cash-out from Trade/Cash out (xochi-sdk#177): estimate, review (platform, currency, own-account payee masked after entry, deposit, approximate payout, public Base transaction), explicit wallet approvals for the USDC allowance and the deposit, order progress (awaiting buyer, matched, partly paid, delivered, returned), withdrawal of unmatched USDC through its own approval, and reload resume from the protected deposit mapping without a second deposit. A stale estimate cannot be confirmed; a non-Base-USDC source is shown as needing a separate Xochi route. Activity lists a sanitized summary under the new `xochi_local_offramps:<wallet>` key. New deployment settings `peerReferralCode` (unset by default; no code sent when unset) and `offrampCanaryCapAtomic` (per-cash-out cap, enforced before review).
|
|
39
|
+
|
|
40
|
+
- Resume and recover interrupted Peer onramps (xochi-sdk#176). Buy keeps sanitized operation summaries under the new `xochi_local_ramps` key (beside S4's `xochi:ramp/1:` snapshots; existing keys unchanged): rail, reviewed amounts, quote expiry, bounded state and the public bound wallet, never intent hashes, payment recipients, proofs, sessions or URLs. Reload or a lost view resumes the existing operation by its widget-minted id: a read-only lookup re-finds the signaled intent, one status reconciliation runs, and the shared step view continues without a second intent (a captured payment is re-captured, never re-paid). In-doubt shows "do not start another transfer" with status reconciliation only; a held payout shows an estimated release date that is never a guarantee; a quote expired before submission says no transfer was submitted. A purchase bound to another wallet names that wallet and cannot continue; only an unsubmitted one may be abandoned. While this wallet has an unsettled submitted purchase, no new rail can be chosen. Activity lists the connected wallet's purchases. Focus moves to the current step on resume and on return from the Peer extension or app.
|
|
41
|
+
|
|
42
|
+
### Fixed
|
|
43
|
+
|
|
44
|
+
- Read every Arc ERC-20 wallet balance (Circle EURC as well as USDC, and any token the live matrix advertises on Arc) through the balance endpoint, so an Arc EURC holding no longer shows as unknown.
|
|
45
|
+
- Preserve Tron USDT tag/refund retry prefills without allocating or signing on
|
|
46
|
+
mount. Keep the accepted tag through funding, history refresh and recovery;
|
|
47
|
+
stored deposit facts still require the independently pinned attestation.
|
|
48
|
+
- Reject stale-amount confirmation and clear quote identity when Send is cleared.
|
|
49
|
+
- Name verified Tron refund destinations instead of assuming the sender, and
|
|
50
|
+
keep long zk.money tags inside mobile and desktop confirmation/history layouts.
|
|
51
|
+
- Show exact live Stealth receive choices and unsupported-pair guidance before amount entry, while preserving explicit presets, host locks and Public selection.
|
|
52
|
+
- Require explicit asset selection when a live Stealth chain needs a different receive token; leave zk.money without retaining its tag or repairing the source.
|
|
53
|
+
- Name the live Stealth networks the picker would offer for the selected source beside the privacy controls before Stealth is selected, preserving the hosted widget's guidance; the open picker's exact-route guidance replaces it.
|
|
54
|
+
- Preserve integration-only browser initialization through package tree-shaking.
|
|
55
|
+
- Isolate framed Wagmi storage/discovery and reuse each bridge's config, preserving connected wallets across theme renders without relaxing auto-connect consent.
|
|
56
|
+
- Add an anonymous, exact published-prerequisite consumer mode alongside the explicitly local-artifact rehearsal.
|
|
57
|
+
- Revoke abandoned key-setup and sign-in attempts on teardown; publish reconnect authority changes even when React batches the transition, without retaining secret buffers or stale claim UI.
|
|
58
|
+
- Verify the default installed dependency graph without copying workspace overrides into the isolated consumer.
|
|
59
|
+
- Reconcile the workspace lockfile with its declared WalletConnect, UUID and WebSocket overrides using npm 10.
|
|
60
|
+
- Fail packing when declared files, licenses, notices or export targets are missing, and check redistribution permission in widget CI.
|
|
61
|
+
- Keep RainbowKit CSS in the stylesheet entry rather than emitted wallet-provider
|
|
62
|
+
declarations, so strict isolated consumers need no ambient CSS shim.
|
|
63
|
+
- Reuse the existing wallet/session authority repair: synchronously revoke scanned
|
|
64
|
+
keys on wallet/key/session changes, reject late scan/prepare replies, and verify
|
|
65
|
+
authority immediately before signing. Preserve already-submitted outcomes.
|
|
66
|
+
- Scope history and authentication responses to the initiating session generation.
|
|
67
|
+
Preserve explicit bridge ownership and consumer resubscription across effect restarts.
|
|
68
|
+
- Replace the dead mainnet and Polygon RPC fallbacks (`cloudflare-eth.com`,
|
|
69
|
+
`polygon-rpc.com`) with `eth.drpc.org` and `polygon.drpc.org`, as the hosted
|
|
70
|
+
widget did.
|
|
71
|
+
- Show the USDC icon for bridged USDC (`USDC_E`) on the send leg.
|
|
72
|
+
- Consume explicit sign-in scans through the fresh authenticated scanner. Wallet,
|
|
73
|
+
chain, connector and session changes cancel the pending scan instead of moving
|
|
74
|
+
it to another authority.
|
|
75
|
+
- Release Stealth setup loading when its wallet authority is revoked, including
|
|
76
|
+
same-wallet connector changes and reconnects. Obsolete signature replies cannot
|
|
77
|
+
clear a newer attempt's loading or replace its keys/cache.
|
|
78
|
+
|
|
79
|
+
No package has been published or host deployment changed by this extraction. Release versions require approval; the production host cutover follows real package publication.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Xochi Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,421 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @xochi/widget
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The complete Xochi trading widget and configurator, extracted from the hosted implementation without changing its iframe boundary. React and React DOM are peers. `@xochi/widget-lib` remains the separate, React-free host loader and wallet bridge.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
`@xochi/widget` requires WalletConnect 2.26 or later with React 19. Wagmi 2
|
|
8
|
+
pins an older WalletConnect provider whose transitive React peer range excludes
|
|
9
|
+
React 19. Add the following configuration for your package manager to your
|
|
10
|
+
application's root `package.json` before installing `@xochi/widget`.
|
|
11
|
+
Dependency overrides are applied by the consumer's package manager.
|
|
12
|
+
|
|
13
|
+
### npm
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"overrides": {
|
|
18
|
+
"@walletconnect/core": "^2.26.0",
|
|
19
|
+
"@walletconnect/ethereum-provider": "^2.26.0",
|
|
20
|
+
"@walletconnect/sign-client": "^2.26.0",
|
|
21
|
+
"@walletconnect/universal-provider": "^2.26.0",
|
|
22
|
+
"@walletconnect/utils": "^2.26.0"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### pnpm
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"pnpm": {
|
|
32
|
+
"overrides": {
|
|
33
|
+
"@walletconnect/core": "^2.26.0",
|
|
34
|
+
"@walletconnect/ethereum-provider": "^2.26.0",
|
|
35
|
+
"@walletconnect/sign-client": "^2.26.0",
|
|
36
|
+
"@walletconnect/universal-provider": "^2.26.0",
|
|
37
|
+
"@walletconnect/utils": "^2.26.0"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Yarn
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"resolutions": {
|
|
48
|
+
"@walletconnect/core": "^2.26.0",
|
|
49
|
+
"@walletconnect/ethereum-provider": "^2.26.0",
|
|
50
|
+
"@walletconnect/sign-client": "^2.26.0",
|
|
51
|
+
"@walletconnect/universal-provider": "^2.26.0",
|
|
52
|
+
"@walletconnect/utils": "^2.26.0"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`@xochi/widget-lib` is the iframe embed API. It has no wallet dependencies and
|
|
58
|
+
needs no WalletConnect overrides.
|
|
59
|
+
|
|
60
|
+
## Release state
|
|
61
|
+
|
|
62
|
+
The ramp release candidate pairs `@xochi/widget@0.1.0` with
|
|
63
|
+
`@xochi/widget-lib@0.6.0`, `@xochi/client@0.2.0` and the existing
|
|
64
|
+
`@xochi/signer@0.9.0`. A hosted shell serving ramps must mount at least widget
|
|
65
|
+
`0.1.0` at `/embed` and mount the configurator from that same exact package
|
|
66
|
+
version. Upgrade the hosted frame before enabling ramp entry points in hosts,
|
|
67
|
+
and use loader `0.6.0` or a compatible later loader. The bridge stays on protocol v1.
|
|
68
|
+
|
|
69
|
+
From the SDK root, rehearse the release with local package tarballs:
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
npm ci
|
|
73
|
+
npm run build
|
|
74
|
+
node scripts/verify-widget-consumer.mjs
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
This installs the signer, client, loader and widget tarballs into a scratch
|
|
78
|
+
consumer. It uses anonymous public npm resolution for external dependencies,
|
|
79
|
+
with the documented npm WalletConnect overrides and no workspace links. It
|
|
80
|
+
requires zero React peer problems, checks exports and strict declarations,
|
|
81
|
+
and builds the widget and the wallet-free configurator from their public entry points.
|
|
82
|
+
|
|
83
|
+
After release approval, publish the prerequisites from the reviewed main commit.
|
|
84
|
+
Push `client-v0.2.0` first and wait for `@xochi/client@0.2.0` to resolve from
|
|
85
|
+
the public registry. Then push `widget-lib-v0.6.0` and wait for
|
|
86
|
+
`@xochi/widget-lib@0.6.0` to resolve. The signer is already public at
|
|
87
|
+
`0.9.0`. Verify the widget against these exact public registry versions before
|
|
88
|
+
publishing it as `widget-v0.1.0`:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
npm run check:redistribution -w @xochi/widget
|
|
92
|
+
npm run check:published-dependencies -w @xochi/widget
|
|
93
|
+
node scripts/verify-widget-consumer.mjs --published-dependencies
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Published-dependencies verification checks registry tarball integrity, React peer
|
|
97
|
+
compatibility and the configurator's wallet boundary. Both verification modes
|
|
98
|
+
exercise the package installation and build without attempting a live trade.
|
|
99
|
+
|
|
100
|
+
The packed widget passes strict TypeScript checking without loading Peer SDK
|
|
101
|
+
declarations. Its discovery and unsigned maker ports use widget-owned types.
|
|
102
|
+
The runtime remains pinned to `@zkp2p/sdk@0.15.0-rc.11`. The rc.12 tarball still
|
|
103
|
+
contains unresolved `./types` imports in its ESM declarations.
|
|
104
|
+
|
|
105
|
+
The documented WalletConnect 2.26 overrides clear the React 19 release gate.
|
|
106
|
+
The release decision accepts WalletConnect 2.26 for now. Review of the Reown
|
|
107
|
+
license remains an open legal item outside this release gate.
|
|
108
|
+
|
|
109
|
+
## Rendering
|
|
110
|
+
|
|
111
|
+
Configure once, before rendering either lazy entry point. One document owns one widget runtime; change settings by reloading, not by changing signing authority in an active trading session.
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
import { Suspense } from "react";
|
|
115
|
+
import { createRoot } from "react-dom/client";
|
|
116
|
+
import { Widget, configureWidget, applyInitialWidgetTheme } from "@xochi/widget";
|
|
117
|
+
import "@xochi/widget/styles.css";
|
|
118
|
+
|
|
119
|
+
configureWidget({
|
|
120
|
+
apiUrl: "http://localhost:8788",
|
|
121
|
+
development: true,
|
|
122
|
+
solverPin: {
|
|
123
|
+
erc3009Allowlist: [],
|
|
124
|
+
permit2Allowlist: [],
|
|
125
|
+
requirePin: true,
|
|
126
|
+
},
|
|
127
|
+
depositAttestationSigner: "",
|
|
128
|
+
// Optional: the reviewed RiddlerEscrow per origin chain, used only for Canton
|
|
129
|
+
// escrow quotes while CANTON_DESTINATION_LIVE is on.
|
|
130
|
+
// escrows: { 8453: "0x4438a8b3EE5AAf58343B18629040a4BCB8b0feCb" },
|
|
131
|
+
});
|
|
132
|
+
applyInitialWidgetTheme(window.location.search);
|
|
133
|
+
createRoot(document.getElementById("root")!).render(
|
|
134
|
+
<Suspense fallback={null}>
|
|
135
|
+
<Widget />
|
|
136
|
+
</Suspense>,
|
|
137
|
+
);
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
These empty development pins deliberately fail closed. Provision real security pins independently of quotes and capabilities before trading. Never copy discovery data into a trust anchor.
|
|
141
|
+
|
|
142
|
+
Serve the configurator at `/` and the widget at `/embed`. Apply the initial frame theme only on `/embed`; do not apply a preview's theme to the configurator document. Unknown hosted routes should retain the host's redirect to `/`.
|
|
143
|
+
|
|
144
|
+
```tsx
|
|
145
|
+
import { Configurator } from "@xochi/widget/configurator";
|
|
146
|
+
// Render under Suspense after configureWidget(settings), with the same stylesheet.
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
The configurator mounts a query provider, not trading/wallet/Stealth providers. Its preview is an iframe of the serving origin's `/embed`. `@xochi/widget/configurator-model` exports the shared URL, preset, lock, route-selection and snippet operations. Existing snippets require the host to serve `widget-lib/0.6.0/index.js` and preserve every previously shipped versioned loader URL.
|
|
150
|
+
|
|
151
|
+
The published `@xochi/widget-lib@0.5.0` host's `updateTheme` changes the visual theme without reloading the iframe or resetting route, form, privacy or wallet state. Wallet dialogs and auto mode follow live theme resolution; runtime security settings remain immutable.
|
|
152
|
+
|
|
153
|
+
`@xochi/widget/integration` exposes moved wallet/session/presentation modules used by the separately hosted affiliate dashboard. Load it only after configuration. The dashboard itself is not part of this package.
|
|
154
|
+
|
|
155
|
+
## Runtime settings
|
|
156
|
+
|
|
157
|
+
`WidgetSettings` accepts API/auth URLs, app version/site metadata, WalletConnect project ID, browser RPC overrides, Arc/Gnosis launch flags, recipient-receipt availability, independent ERC-3009 and Permit2 allowlists, the ERC-3009 pin requirement, and the deposit-attestation signer. Values are copied; signing allowlists cannot be changed by mutating the caller's arrays. A second configuration call is refused.
|
|
158
|
+
|
|
159
|
+
The host supplies settings, never alternate trading algorithms. Exact route authorization, stale/fallback refusal, privacy preferences, signing checks and recovery live in public code. No Vite environment reads or import-time bridge handshake exist in this package. Mounting the widget owns the bridge; unmounting destroys it and rejects pending requests. Wallet signatures still require the existing explicit user actions.
|
|
160
|
+
|
|
161
|
+
The shell supplies Peer settings to `configureWidget` before mounting. Keep
|
|
162
|
+
them in deployment configuration and out of embed URLs and snippet defaults.
|
|
163
|
+
|
|
164
|
+
- `peerEnvironment`: `production` (default), `preproduction` or `staging`.
|
|
165
|
+
These select Peer endpoints. Peer has no testnet, so staging still uses Base
|
|
166
|
+
mainnet funds. Live transaction checks require explicit approval.
|
|
167
|
+
|
|
168
|
+
- `peerReferralCode`: six ASCII alphanumeric characters. Unset sends no referral code. Set it only after legal
|
|
169
|
+
sign-off on Peer referral income and a check against Peer's referral terms.
|
|
170
|
+
- `offrampCanaryCapAtomic` and `onrampCanaryCapAtomic`: the most Base USDC
|
|
171
|
+
(canonical atomic units, e.g. `"5000000"` for 5 USDC) one cash-out may deposit
|
|
172
|
+
or one purchase may receive. Each setting accepts a positive string of up to 31 digits without leading zeroes. Unset applies no extra deployment cap.
|
|
173
|
+
An amount over a set cap shows the limit and reads no rails.
|
|
174
|
+
|
|
175
|
+
Browser RPC URLs and WalletConnect identifiers are public bundle settings, not a place for secret provider keys. Preserve wallet telemetry opt-outs. Existing storage namespaces and history/session formats remain unchanged; signing keys are not persisted.
|
|
176
|
+
|
|
177
|
+
“Sign in to scan” starts scanning only after explicit authentication has produced
|
|
178
|
+
the current scanner authority. Wallet, chain, connector or session changes cancel
|
|
179
|
+
that requested scan. A connector change or reconnect also cancels an in-flight
|
|
180
|
+
Stealth setup and releases its busy state; deriving replacement keys still
|
|
181
|
+
requires a new explicit wallet signature. Late replies cannot replace newer keys.
|
|
182
|
+
|
|
183
|
+
Provider teardown revokes pending key setup and zeroes retained secret buffers. Abandoned sign-in callbacks cannot prompt, verify or store a session after their caller loses authority. Effect reactivation does not itself sign; a same-wallet reconnect requires fresh explicit key setup.
|
|
184
|
+
|
|
185
|
+
### Live Stealth destinations
|
|
186
|
+
|
|
187
|
+
Selecting Stealth is navigation, not wallet setup or signing consent. Before Stealth is selected, the panel names the live Stealth networks its picker would offer for the selected source; that line is guidance only and never grants route eligibility. Before an amount is entered, receive choices come from exact live routes for the selected source, independently trusted factories and host constraints. Unsupported explicit presets remain visible with guidance; they do not silently become Public or another token. Public selection keeps its existing catalog and repair behavior.
|
|
188
|
+
|
|
189
|
+
When a live chain requires a different receive asset, choosing that chain opens its eligible asset picker without changing either leg until the user selects the asset. Unlaunched Shielded destinations and the Public-only zk.money rail are excluded from Stealth choices. Switching out of zk.money clears its tag and quote, not the source leg. Quotes and execution retain all existing amount, authorization and signing checks.
|
|
190
|
+
|
|
191
|
+
### Tron USDT to zk.money
|
|
192
|
+
|
|
193
|
+
Offer this rail only when the live producer explicitly advertises the exact
|
|
194
|
+
Tron USDT to `zk_money` DAI route. Its settlement endpoint is a public Ethereum
|
|
195
|
+
DAI payout to the address resolved for the zk.money tag, funded by a public
|
|
196
|
+
manual TRC-20 send. Subsequent zk.money/Aztec credit and shielding are separate;
|
|
197
|
+
the local verification does not demonstrate funded end-to-end credit.
|
|
198
|
+
This does not enable native Shielded or Stealth funding.
|
|
199
|
+
|
|
200
|
+
Reservation requires explicit user action and matching wallet-bound sign-in.
|
|
201
|
+
The service signs the deposit attestation; the client verifies it against the
|
|
202
|
+
host's independent signer pin. EVM-owner authentication may require a wallet
|
|
203
|
+
signature. The manual TRON send does not use an EVM token-pull/permit signature.
|
|
204
|
+
Keep the allocation key on identical retries after unknown results; edits to
|
|
205
|
+
tag, refund, owner or trade terms revoke it. Verify deposit instructions against
|
|
206
|
+
the independent signer pin before display. History preserves the original tag
|
|
207
|
+
as display metadata, not signing authority, and re-verifies stored deposits on
|
|
208
|
+
resume. A refreshed or withdrawn route cannot relabel an already-issued order.
|
|
209
|
+
No new storage namespace/version or persisted secret key is introduced.
|
|
210
|
+
|
|
211
|
+
Server-only history does not contain the original refund address or deposit
|
|
212
|
+
attestation. Retry is a new order: review and re-enter its refund destination
|
|
213
|
+
when local recovery data is unavailable. Never reconstruct funding instructions
|
|
214
|
+
from history metadata.
|
|
215
|
+
|
|
216
|
+
## Self-hosting and origin permissions
|
|
217
|
+
|
|
218
|
+
Source availability does not grant access to a production API, solver or iframe origin. Obtain the required API-origin and service permissions independently. Preserve explicit `frame-ancestors` origins and the existing parent-window/origin/RPC validation. Never add wildcards or loosen validation to make an example work. The deployment host owns security headers and keeps versioned loader files available.
|
|
219
|
+
|
|
220
|
+
## Styles, assets and licenses
|
|
221
|
+
|
|
222
|
+
Import `@xochi/widget/styles.css` explicitly. The tarball ships its CSS, relative hashed image/font assets and declarations; no private asset checkout is needed. CSS and browser compatibility initialization are declared side effects. Styles preserve the hosted appearance rather than introducing a new design.
|
|
223
|
+
|
|
224
|
+
Xochi source and the extracted shared subset are MIT. Monaspace fonts remain SIL OFL 1.1 with reserved names and the full notice. RainbowKit's bundled CSS notice is retained. Artwork is covered by the requester's explicit authorization to redistribute the 25 listed files unchanged, not by a claimed MIT license. See `THIRD_PARTY_NOTICES.txt` and `licenses/assets.json` for scope and evidence limits.
|
|
225
|
+
|
|
226
|
+
## Embed IA and ramp lifecycle hooks
|
|
227
|
+
|
|
228
|
+
`readWidgetEmbedConfig(search?)`, exported from the existing public entry point and
|
|
229
|
+
`src/config.ts`, reads the current frame URL by default. It exposes validated
|
|
230
|
+
`initialTab`, `tabs`, `initialMode`, `modes`, `sendDestinations`, `fiatCurrency` and
|
|
231
|
+
`rampProviders`. Defaults excluded by a restriction are omitted. Explicit empty
|
|
232
|
+
lists remain empty. UI consumers must intersect these restrictions with their
|
|
233
|
+
supported surfaces and fresh live capabilities; a default or restriction never
|
|
234
|
+
grants executable availability. This config intentionally excludes trade `amount`. Legacy `payment_app`
|
|
235
|
+
entries are dropped from `sendDestinations`, including when that leaves an empty
|
|
236
|
+
restriction.
|
|
237
|
+
|
|
238
|
+
The full layout (`layout=full`) reads it once on mount and narrows what it
|
|
239
|
+
renders (`src/pages/trade/embedNarrowing.ts`): a tab, mode or destination the
|
|
240
|
+
host leaves out is hidden. Trade opens on Swap by default and offers Swap, Buy and Cash out. Send offers Wallet
|
|
241
|
+
address and Stealth. Narrowing `rampProviders` to exclude `peer` hides Buy and
|
|
242
|
+
Cash out. Stealth send depends on Swap for settlement. Trade and Send are hidden
|
|
243
|
+
when their respective lists have no supported options. `initialTab` and
|
|
244
|
+
`initialMode` pick among what remains, else Trade and Swap. `layout=swap` ignores
|
|
245
|
+
these parameters.
|
|
246
|
+
|
|
247
|
+
Narrowing removes ways to start a Peer operation, never the way back to one
|
|
248
|
+
already submitted: when Buy or Cash out is narrowed out, Activity resumes a
|
|
249
|
+
submitted, unsettled purchase or an open cash-out from this browser in a
|
|
250
|
+
recovery-only view (`src/pages/trade/RampRecovery.tsx`).
|
|
251
|
+
|
|
252
|
+
Inside an iframe, no Peer rail is offered until a host on the current widget
|
|
253
|
+
protocol has pinned the origin (`src/lib/rampHostGate.ts`, over
|
|
254
|
+
`HostConnection.hostProtocol()`). Before the handshake Buy and Cash out
|
|
255
|
+
say they are waiting for the host; a legacy loader, which may not drop ramp
|
|
256
|
+
events safely, gets a permanent refusal that says why. Recovery never consults
|
|
257
|
+
this gate. Outside an iframe there is nothing to check.
|
|
258
|
+
|
|
259
|
+
## Ramp rail availability
|
|
260
|
+
|
|
261
|
+
Trade/Buy (`onramp`) and Trade/Cash out (`offramp`) show live Peer rails
|
|
262
|
+
through `fetchPeerCapabilities` (`src/ramp/availability/`). The critical facts
|
|
263
|
+
(public Base settlement, what the fiat counterparty sees, the Peer/TEE
|
|
264
|
+
dependency, own-account payout and approximate estimates for Cash out) are shown
|
|
265
|
+
before any rail. Only an offer that `checkRampOffer` accepts at the current
|
|
266
|
+
clock is a radio; every other state (`setup_required`, `temporarily_unavailable`
|
|
267
|
+
with `retry_after`, `not_supported`, `availability_unknown`, expired) stays
|
|
268
|
+
readable as text with a next step. A timer re-reads the clock at the earliest
|
|
269
|
+
`valid_until`, so an expired offer stops being selectable without a reload.
|
|
270
|
+
Amount and currency changes refetch; a superseded response is discarded. Only
|
|
271
|
+
the visible surface reads Peer, and only with a connected wallet and an amount.
|
|
272
|
+
Selecting a rail alone executes nothing.
|
|
273
|
+
|
|
274
|
+
## Trade / Cash out
|
|
275
|
+
|
|
276
|
+
Trade/Cash out (`src/ramp/offramp/`) completes a Peer maker cash-out of Base
|
|
277
|
+
USDC to the user's own payment-app account. It reads rails through S5's offramp
|
|
278
|
+
provider (`createLivePeerOfframpProvider`), whose capabilities overlay seller
|
|
279
|
+
readiness on live Peer offers, and drives the lifecycle through S4's
|
|
280
|
+
`createRampClient`:
|
|
281
|
+
|
|
282
|
+
1. Rails, amount and currency. Only a fresh `available` offer can be estimated.
|
|
283
|
+
A supported source other than Base USDC first receives a separate fresh Xochi
|
|
284
|
+
quote and wallet approval. Peer remains blocked until the route completes and
|
|
285
|
+
an uncached Base USDC balance read confirms spendable funds in this wallet. An amount over the deployment canary cap
|
|
286
|
+
(`offrampCanaryCapAtomic`) shows its reason and reads no rails.
|
|
287
|
+
2. Review: platform, currency, deposit, an approximate payout (never a locked
|
|
288
|
+
rate or an ETA), the public Base deposit into Peer's escrow, and the payee.
|
|
289
|
+
The payee must be the user's own account; it is masked once entered and is
|
|
290
|
+
passed only to the provider-private `setOwnAccount`. An estimate past
|
|
291
|
+
`expires_at` cannot be confirmed.
|
|
292
|
+
3. Wallet: each step (`approve_usdc`, `create_deposit`, `withdraw_unmatched`) is
|
|
293
|
+
its own click. The wallet signs exactly the plan S5 hands out for the
|
|
294
|
+
connected account, on Base (a network switch is its own step). A declined
|
|
295
|
+
prompt is recorded as such; any other wallet failure stays `in_doubt` and is
|
|
296
|
+
settled only by status checks or by pasting the transaction's public hash.
|
|
297
|
+
4. Order: progress is S5's `orderStatus` (awaiting buyer, matched, partly paid,
|
|
298
|
+
delivered, returned), re-read every 15 seconds and on demand. Unmatched USDC
|
|
299
|
+
can be withdrawn through a separate prepare and wallet approval.
|
|
300
|
+
|
|
301
|
+
Activity shows a sanitized local summary under `xochi_local_offramps:<wallet>`:
|
|
302
|
+
operation reference, rail, currency, USDC amount and bounded status enums only.
|
|
303
|
+
A reload resumes the newest open order from S5's protected deposit mapping; it
|
|
304
|
+
never prepares another deposit. An order that never reached its deposit step is
|
|
305
|
+
marked not started. The live SDK client is built over a wallet client that
|
|
306
|
+
refuses to sign; only `sendTransaction` through the user's connector signs.
|
|
307
|
+
`peerReferralCode` (unset by default) is attached to deposit creation only when
|
|
308
|
+
the deployment sets it.
|
|
309
|
+
|
|
310
|
+
Frame flows can use `createRampEmitter(direction)` from `src/lib/rampLifecycle.ts`.
|
|
311
|
+
It uses the existing mounted `hostBridge`, mints one opaque `rampRef`, emits
|
|
312
|
+
`ramp:started`, and returns `status`, `recoveryRequired` and `terminal` methods for
|
|
313
|
+
that reference. Call it once per Peer operation, never for address or stealth sends.
|
|
314
|
+
A host hears each fact once: a repeated status is dropped, a recovery code
|
|
315
|
+
repeats only after its leg changes state, and nothing follows `ramp:terminal`.
|
|
316
|
+
The reference is kept in the sanitized summary (`ramp_ref` for purchases,
|
|
317
|
+
`rampRef` for cash-outs), and a reload continues it through
|
|
318
|
+
`resumeRampEmitter(ref)`: never a second `ramp:started`, and nothing at all for
|
|
319
|
+
a summary stored without one.
|
|
320
|
+
Pass normalized `ramp/1` leg states and error codes only. It adds no bridge or
|
|
321
|
+
provider session mapping and receives no amounts, assets or provider handles.
|
|
322
|
+
|
|
323
|
+
## Optional routing after Buy
|
|
324
|
+
|
|
325
|
+
After Peer confirms delivery of Base USDC (and releases any payout hold), Buy
|
|
326
|
+
and the resumed purchase view offer a separate Xochi route. The picker uses fresh
|
|
327
|
+
live EVM routes, configured wallet networks, existing token metadata and embed
|
|
328
|
+
restrictions. It quotes only on an explicit review action. The route has its own
|
|
329
|
+
exact payout preview, expiry, wallet approval, progress and receipt, using the
|
|
330
|
+
existing `useIntent` quote/sign/execute/poll interpreter and signer checks.
|
|
331
|
+
|
|
332
|
+
Public payouts go to the receiving wallet. Stealth uses the wallet's existing
|
|
333
|
+
keys or PR #201's strict meta-address parser for another recipient; no new crypto
|
|
334
|
+
is introduced. Another recipient's keys are kept only in memory, and a resumed
|
|
335
|
+
failed route asks for their meta-address again before it can quote.
|
|
336
|
+
|
|
337
|
+
Peer remains completed on every route failure. A safe failure shows the confirmed
|
|
338
|
+
Base USDC wallet and permits a fresh Xochi quote or skip. Unknown submission shows
|
|
339
|
+
that funds may have moved and permits status checks only. The route is recorded
|
|
340
|
+
in existing Xochi Activity before the wallet boundary, linked by a widget-minted
|
|
341
|
+
ramp reference. Reload polls that original Xochi intent and never quotes or signs
|
|
342
|
+
again. Missing local evidence remains in doubt; inspect Activity rather than
|
|
343
|
+
starting another transfer. No Peer handles, recipient keys, signatures or raw
|
|
344
|
+
provider responses are added to the activity record or ramp snapshots.
|
|
345
|
+
|
|
346
|
+
For a local, network-free visual preview, run `npm exec -w @xochi/widget vite --
|
|
347
|
+
--host 127.0.0.1 --port 5185` at the repository root and visit
|
|
348
|
+
`/preview-onramp-route.html` (append `?failure` for a failed quote). This harness
|
|
349
|
+
uses the production route view with in-memory provider and Xochi interfaces and
|
|
350
|
+
is excluded from the published widget.
|
|
351
|
+
|
|
352
|
+
### Route before cash-out
|
|
353
|
+
|
|
354
|
+
The Xochi prerequisite uses the shared `XochiRampLeg` and existing Swap interpreter,
|
|
355
|
+
with public settlement to the connected wallet on Base. Source choices require a
|
|
356
|
+
live route and honor embed restrictions. A route receipt alone never unlocks Peer:
|
|
357
|
+
the UI reads the Base USDC balance and rechecks it immediately before Peer approval.
|
|
358
|
+
A failed or uncertain Peer order cannot rerun a completed prerequisite. Before
|
|
359
|
+
deposit, Base USDC remains in the wallet; after deposit, use Peer reconciliation
|
|
360
|
+
and withdrawal of unmatched funds. The order displays sanitized deposited, filled,
|
|
361
|
+
reserved, withdrawable and withdrawn totals, with no totals while in doubt.
|
|
362
|
+
|
|
363
|
+
Each leg has its own review, approval and receipt. Unknown Xochi submissions expose
|
|
364
|
+
status checks only. Existing Xochi Activity retains the public route intent; Peer
|
|
365
|
+
resume uses its protected mapping. The prerequisite review itself is memory-only:
|
|
366
|
+
after reload, inspect Xochi Activity for the original route and continue with the
|
|
367
|
+
wallet's confirmed Base USDC rather than routing the source again. No live deposit
|
|
368
|
+
or mainnet spending is part of the deterministic checks.
|
|
369
|
+
|
|
370
|
+
`preview-offramp-route.html` and `?failure` render the actual presentation components
|
|
371
|
+
with in-memory route facts for 460px review and Peer-failure-after-route evidence.
|
|
372
|
+
|
|
373
|
+
## Support and recovery
|
|
374
|
+
|
|
375
|
+
Base settlement is public. Fiat participants see the payment and identity
|
|
376
|
+
information needed to settle, and Peer eligibility and the Peer TEE affect
|
|
377
|
+
availability. Buy requires desktop Chrome or Brave with the Peer extension, or
|
|
378
|
+
the Peer app. Mobile web shows setup guidance. A linked Peer sign-in can also be
|
|
379
|
+
required. The widget displays live rail availability and Cash-out estimates.
|
|
380
|
+
|
|
381
|
+
Direct users to Activity to resume a submitted operation. Ask for the sanitized
|
|
382
|
+
state and bounded support code, and use the public Base transaction hash if
|
|
383
|
+
already available in a receipt. An opaque `rampRef` can correlate events within
|
|
384
|
+
a host integration. Keep the credentials and other data listed in the contract's
|
|
385
|
+
secret boundary out of support tickets and telemetry.
|
|
386
|
+
|
|
387
|
+
- For `in_doubt`, reconcile the original leg before suggesting any further
|
|
388
|
+
action. Keep the operation pinned to its original provider.
|
|
389
|
+
- For a held Buy payout, wait for verified USDC release before offering a
|
|
390
|
+
Xochi route. Peer may hold eligible Venmo or PayPal payouts for up to 14 days.
|
|
391
|
+
The protocol cannot refund fiat paid for an expired or unverifiable intent.
|
|
392
|
+
- For cash-out, show verified fills and any returned Base USDC separately.
|
|
393
|
+
Withdrawal of unmatched escrow funds is a separate wallet approval when Peer
|
|
394
|
+
permits it.
|
|
395
|
+
- If Buy succeeds and routing fails, locate the confirmed Base USDC in the
|
|
396
|
+
wallet and offer recovery of the Xochi leg. If the route into cash-out
|
|
397
|
+
succeeds and Peer fails, determine whether Base USDC is in the wallet or
|
|
398
|
+
Peer escrow and recover only the Peer leg.
|
|
399
|
+
|
|
400
|
+
See the [ramp/1 contract and state diagrams](../client/ramp/README.md) and
|
|
401
|
+
[loader migration and event payloads](../widget-lib/README.md#tabs-and-ramp-integration).
|
|
402
|
+
|
|
403
|
+
## Release privacy inspection
|
|
404
|
+
|
|
405
|
+
`src/ramp/privacy.test.tsx` drives Buy (completion, Peer sign-in required, a
|
|
406
|
+
raw provider error, in doubt across a reload), Trade/Cash out (partial fill
|
|
407
|
+
to delivery, a lost deposit hash across a reload, a mixed fill-and-return) and
|
|
408
|
+
Send/Stealth to someone else's meta-address inside a scripted host frame. It
|
|
409
|
+
records every `postMessage` to the host, all `localStorage` and
|
|
410
|
+
`sessionStorage`, every console call and every Xochi API request other than
|
|
411
|
+
the quote a flow needs, and asserts none carries a payee handle, provider
|
|
412
|
+
deposit or intent id, proof or session material, a raw provider error, a
|
|
413
|
+
signature or calldata, or the recipient's meta-address. It also asserts one
|
|
414
|
+
`ramp:started` per operation across reloads.
|
|
415
|
+
|
|
416
|
+
## Testing
|
|
417
|
+
|
|
418
|
+
`npm test -w @xochi/widget` runs on Node 22 through 26 without flags. A
|
|
419
|
+
downstream suite on an older vitest whose jsdom storage is shadowed by Node
|
|
420
|
+
25+'s experimental global `localStorage` (the private deploy shell, for one)
|
|
421
|
+
needs `NODE_OPTIONS=--no-experimental-webstorage`.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
@xochi/widget source and third-party materials
|
|
2
|
+
|
|
3
|
+
Source code and styles authored by Xochi Contributors are provided under
|
|
4
|
+
MIT, Copyright (c) 2025-2026 Xochi Contributors. See LICENSE for the complete
|
|
5
|
+
permission and warranty notice. The extracted subset of @xochi-fi/shared
|
|
6
|
+
0.2.1 carries the same MIT notice, preserved in licenses/xochi-shared-MIT.txt.
|
|
7
|
+
This source license does not assign rights to third-party artwork.
|
|
8
|
+
|
|
9
|
+
Monaspace fonts
|
|
10
|
+
|
|
11
|
+
The 13 unchanged Monaspace Argon, Neon and Xenon WOFF2 font files under
|
|
12
|
+
src/assets/fonts (emitted under dist/assets when built) are separately
|
|
13
|
+
licensed under the SIL Open Font License 1.1, not MIT.
|
|
14
|
+
|
|
15
|
+
Copyright (c) 2023, GitHub https://github.com/githubnext/monaspace
|
|
16
|
+
with Reserved Font Name "Monaspace", including subfamilies: "Argon", "Neon",
|
|
17
|
+
"Xenon", "Radon", and "Krypton".
|
|
18
|
+
|
|
19
|
+
The full copyright notice, reserved-name notice and license are reproduced
|
|
20
|
+
in licenses/Monaspace-OFL-1.1.txt. Upstream evidence:
|
|
21
|
+
https://raw.githubusercontent.com/githubnext/monaspace/main/LICENSE
|
|
22
|
+
|
|
23
|
+
Artwork redistribution authorization
|
|
24
|
+
|
|
25
|
+
On 2026-11-10, the requester explicitly confirmed authority to permit public
|
|
26
|
+
redistribution of all 25 listed token, chain and DefiLlama images unchanged,
|
|
27
|
+
and granted that permission. No additional provenance documents or notices
|
|
28
|
+
were supplied. The complete scope is recorded in licenses/assets.json.
|
|
29
|
+
This authorization is not a claim that third-party artwork is MIT-licensed
|
|
30
|
+
and does not transfer ownership of any trademark.
|
|
31
|
+
|
|
32
|
+
Runtime packages remain separate dependencies under their own licenses;
|
|
33
|
+
React and React DOM remain peer dependencies. The production build does
|
|
34
|
+
not bundle their JavaScript. RainbowKit's imported stylesheet is emitted
|
|
35
|
+
with widget CSS and retains its upstream license obligations (MIT;
|
|
36
|
+
Copyright (c) 2024 Rainbow; see licenses/rainbowkit-MIT.txt).
|
|
37
|
+
|
|
38
|
+
Payment rail logos
|
|
39
|
+
|
|
40
|
+
Payment rail logos under src/assets/rails are third-party brand artwork.
|
|
41
|
+
The respective owners retain their trademark rights. The logos identify
|
|
42
|
+
payment rails and imply no endorsement. See dist/assets/rails/SOURCES.md
|
|
43
|
+
in the package for provenance and usage conditions. SVG data from Simple Icons
|
|
44
|
+
16.38.0 is CC0-1.0.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
4
|
+
import { useTheme } from "./hooks/useTheme.js";
|
|
5
|
+
import { Configurator } from "./pages/Configurator.js";
|
|
6
|
+
function ConfiguratorApp() {
|
|
7
|
+
useTheme();
|
|
8
|
+
const [queryClient] = useState(
|
|
9
|
+
() => new QueryClient({ defaultOptions: { queries: { refetchOnWindowFocus: false } } })
|
|
10
|
+
);
|
|
11
|
+
return /* @__PURE__ */ jsxs(QueryClientProvider, { client: queryClient, children: [
|
|
12
|
+
/* @__PURE__ */ jsx("div", { className: "pearl-bg demo-bg" }),
|
|
13
|
+
/* @__PURE__ */ jsx("div", { className: "dark-overlay demo-overlay" }),
|
|
14
|
+
/* @__PURE__ */ jsx(Configurator, {})
|
|
15
|
+
] });
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
ConfiguratorApp as default
|
|
19
|
+
};
|