@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,153 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useMemo, useEffect } from "react";
|
|
3
|
+
import { OnrampSteps } from "../peer/OnrampSteps.js";
|
|
4
|
+
import { OnrampRoute } from "../route/OnrampRoute.js";
|
|
5
|
+
import { usePeerOnrampRuntime, browserRampStore, useRampClient } from "../peer/runtime.js";
|
|
6
|
+
import { upsertRampSummary, summaryFromSnapshot, abandonRampSummary } from "./summaries.js";
|
|
7
|
+
import { formatUnits } from "viem";
|
|
8
|
+
import { resumeRampEmitter, emitSnapshot } from "../../lib/rampLifecycle.js";
|
|
9
|
+
const short = (address) => `${address.slice(0, 6)}…${address.slice(-4)}`;
|
|
10
|
+
const money = (value) => `${formatUnits(BigInt(value.atomic), value.asset.decimals)} ${value.asset.kind === "fiat" ? value.asset.currency : value.asset.symbol}`;
|
|
11
|
+
function ResumeOnramp({
|
|
12
|
+
summary,
|
|
13
|
+
connected,
|
|
14
|
+
wallet,
|
|
15
|
+
publicClient,
|
|
16
|
+
runtime: supplied,
|
|
17
|
+
store,
|
|
18
|
+
now = Date.now,
|
|
19
|
+
onDone
|
|
20
|
+
}) {
|
|
21
|
+
const bound = connected?.toLowerCase() === summary.wallet;
|
|
22
|
+
const { runtime } = usePeerOnrampRuntime({
|
|
23
|
+
supplied,
|
|
24
|
+
wallet: bound ? wallet : void 0,
|
|
25
|
+
publicClient
|
|
26
|
+
});
|
|
27
|
+
const [ownedStore] = useState(() => store ?? browserRampStore());
|
|
28
|
+
const client = useRampClient(bound && summary.submitted ? runtime : void 0, ownedStore);
|
|
29
|
+
const [snapshot, setRawSnapshot] = useState();
|
|
30
|
+
const [failed, setFailed] = useState(false);
|
|
31
|
+
const id = summary.operation_id;
|
|
32
|
+
const emitter = useMemo(() => resumeRampEmitter(summary.ramp_ref), [id]);
|
|
33
|
+
const setSnapshot = (next) => {
|
|
34
|
+
setRawSnapshot(next);
|
|
35
|
+
emitSnapshot(emitter, next);
|
|
36
|
+
};
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (!client || !runtime) return;
|
|
39
|
+
let live = true;
|
|
40
|
+
void (async () => {
|
|
41
|
+
try {
|
|
42
|
+
await runtime.resume(id, {
|
|
43
|
+
wallet: summary.wallet,
|
|
44
|
+
rail: summary.rail.id,
|
|
45
|
+
pay: summary.pay,
|
|
46
|
+
receive: summary.receive,
|
|
47
|
+
quoteExpiresAt: summary.quote_expires_at,
|
|
48
|
+
approvedAfter: Date.parse(summary.approved_at ?? summary.created_at)
|
|
49
|
+
});
|
|
50
|
+
await runtime.checkReadiness(summary.rail.id);
|
|
51
|
+
let current = await client.get(id);
|
|
52
|
+
if (!current.terminal && current.allowed_actions.includes("check_status"))
|
|
53
|
+
current = await client.recover(id, "peer", "check_status", {
|
|
54
|
+
expected_revision: current.revision,
|
|
55
|
+
idempotency_key: crypto.randomUUID()
|
|
56
|
+
});
|
|
57
|
+
if (!live) return;
|
|
58
|
+
setSnapshot(current);
|
|
59
|
+
upsertRampSummary(summaryFromSnapshot(summary, current));
|
|
60
|
+
} catch {
|
|
61
|
+
if (live) setFailed(true);
|
|
62
|
+
}
|
|
63
|
+
})();
|
|
64
|
+
return () => {
|
|
65
|
+
live = false;
|
|
66
|
+
};
|
|
67
|
+
}, [client, runtime, id]);
|
|
68
|
+
useEffect(() => () => runtime?.dispose(), [runtime]);
|
|
69
|
+
const facts = /* @__PURE__ */ jsxs("p", { children: [
|
|
70
|
+
"Reviewed purchase: ",
|
|
71
|
+
money(summary.receive),
|
|
72
|
+
" for ",
|
|
73
|
+
money(summary.pay),
|
|
74
|
+
" with Peer /",
|
|
75
|
+
" ",
|
|
76
|
+
summary.rail.label,
|
|
77
|
+
"."
|
|
78
|
+
] });
|
|
79
|
+
const abandon = /* @__PURE__ */ jsx("button", { type: "button", onClick: () => abandonRampSummary(id), children: "Abandon this unsubmitted purchase" });
|
|
80
|
+
if (!bound)
|
|
81
|
+
return /* @__PURE__ */ jsxs("section", { className: "onramp-resume", "aria-label": "Purchase waiting for another wallet", children: [
|
|
82
|
+
/* @__PURE__ */ jsx("h3", { className: "send-review__title", children: "Purchase waiting for another wallet" }),
|
|
83
|
+
facts,
|
|
84
|
+
/* @__PURE__ */ jsxs("p", { role: "alert", children: [
|
|
85
|
+
"This purchase is bound to wallet ",
|
|
86
|
+
short(summary.wallet),
|
|
87
|
+
". Reconnect that wallet to continue it; ",
|
|
88
|
+
connected ? "the connected wallet" : "another wallet",
|
|
89
|
+
" cannot."
|
|
90
|
+
] }),
|
|
91
|
+
summary.submitted ? summary.state === "in_doubt" && /* @__PURE__ */ jsx("p", { children: "Its submission status is uncertain. Do not start another transfer for it." }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
92
|
+
/* @__PURE__ */ jsx("p", { children: "No transfer was submitted for it." }),
|
|
93
|
+
abandon
|
|
94
|
+
] })
|
|
95
|
+
] });
|
|
96
|
+
if (!summary.submitted) {
|
|
97
|
+
const expired = Date.parse(summary.quote_expires_at) <= now();
|
|
98
|
+
return /* @__PURE__ */ jsxs("section", { className: "onramp-resume", "aria-label": "Unsubmitted purchase", children: [
|
|
99
|
+
/* @__PURE__ */ jsx("h3", { className: "send-review__title", children: expired ? "Quote expired before submission" : "Quote not submitted" }),
|
|
100
|
+
facts,
|
|
101
|
+
/* @__PURE__ */ jsxs("p", { role: "status", children: [
|
|
102
|
+
expired ? "The quote expired before submission. No transfer was submitted." : "This reviewed quote was not submitted. No transfer was submitted.",
|
|
103
|
+
" ",
|
|
104
|
+
"Review a new quote to buy."
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: () => abandonRampSummary(id), children: "Dismiss and review a new quote" })
|
|
107
|
+
] });
|
|
108
|
+
}
|
|
109
|
+
return /* @__PURE__ */ jsxs("section", { className: "onramp-resume", "aria-label": "Resumed purchase", children: [
|
|
110
|
+
/* @__PURE__ */ jsx("h3", { className: "send-review__title", children: "Resume your Peer purchase" }),
|
|
111
|
+
facts,
|
|
112
|
+
/* @__PURE__ */ jsx("p", { children: "Finish or reconcile this purchase before starting another." }),
|
|
113
|
+
!runtime || !client ? /* @__PURE__ */ jsxs("p", { role: "status", children: [
|
|
114
|
+
"Connect wallet ",
|
|
115
|
+
short(summary.wallet),
|
|
116
|
+
" on Base to resume this purchase."
|
|
117
|
+
] }) : snapshot ? /* @__PURE__ */ jsx(
|
|
118
|
+
OnrampSteps,
|
|
119
|
+
{
|
|
120
|
+
runtime,
|
|
121
|
+
client,
|
|
122
|
+
snapshot,
|
|
123
|
+
onSnapshot: (next) => {
|
|
124
|
+
setSnapshot(next);
|
|
125
|
+
upsertRampSummary(summaryFromSnapshot(summary, next));
|
|
126
|
+
},
|
|
127
|
+
wallet: summary.wallet,
|
|
128
|
+
connected,
|
|
129
|
+
submitted: summary.submitted,
|
|
130
|
+
heldSince: summary.held_since,
|
|
131
|
+
resumed: true
|
|
132
|
+
}
|
|
133
|
+
) : failed ? /* @__PURE__ */ jsx("p", { role: "status", children: "This purchase could not be loaded from this browser. Do not start another transfer; check it in Peer." }) : /* @__PURE__ */ jsx("p", { role: "status", children: "Resuming your existing purchase…" }),
|
|
134
|
+
snapshot?.peer.state === "completed" && snapshot.peer.payout_state !== "held" && runtime && /* @__PURE__ */ jsx(
|
|
135
|
+
OnrampRoute,
|
|
136
|
+
{
|
|
137
|
+
snapshot,
|
|
138
|
+
onSnapshot: (next) => {
|
|
139
|
+
setSnapshot(next);
|
|
140
|
+
upsertRampSummary(summaryFromSnapshot(summary, next));
|
|
141
|
+
},
|
|
142
|
+
store: ownedStore,
|
|
143
|
+
peer: runtime.provider,
|
|
144
|
+
received: summary.receive,
|
|
145
|
+
wallet: summary.wallet
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
snapshot?.terminal && onDone && /* @__PURE__ */ jsx("button", { type: "button", onClick: onDone, children: "Choose a new purchase" })
|
|
149
|
+
] });
|
|
150
|
+
}
|
|
151
|
+
export {
|
|
152
|
+
ResumeOnramp
|
|
153
|
+
};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { RampLegStateSchema, RampMoneySchema, RampErrorCodeSchema } from "@xochi/client";
|
|
2
|
+
import { RAMP_REF_PATTERN } from "@xochi/widget-lib";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { STORAGE_KEYS } from "../../constants.js";
|
|
5
|
+
const MAX_RECORDS = 50;
|
|
6
|
+
const PEER_HOLD_MS = 14 * 24 * 60 * 60 * 1e3;
|
|
7
|
+
const iso = z.string().max(40).refine((value) => Number.isFinite(Date.parse(value)));
|
|
8
|
+
const SummarySchema = z.object({
|
|
9
|
+
operation_id: z.string().regex(/^[A-Za-z0-9_-]{1,128}$/),
|
|
10
|
+
direction: z.literal("onramp"),
|
|
11
|
+
wallet: z.string().regex(/^0x[0-9a-f]{40}$/),
|
|
12
|
+
rail: z.object({
|
|
13
|
+
id: z.string().regex(/^[a-z0-9_-]{1,64}$/),
|
|
14
|
+
label: z.string().min(1).max(64)
|
|
15
|
+
}).strict(),
|
|
16
|
+
pay: RampMoneySchema,
|
|
17
|
+
receive: RampMoneySchema,
|
|
18
|
+
quote_expires_at: iso,
|
|
19
|
+
submitted: z.boolean(),
|
|
20
|
+
approved_at: iso.optional(),
|
|
21
|
+
ramp_ref: z.string().regex(RAMP_REF_PATTERN).optional(),
|
|
22
|
+
state: RampLegStateSchema,
|
|
23
|
+
terminal: z.boolean(),
|
|
24
|
+
payout_state: z.enum(["held", "released"]).optional(),
|
|
25
|
+
held_since: iso.optional(),
|
|
26
|
+
failure_code: RampErrorCodeSchema.optional(),
|
|
27
|
+
abandoned: z.boolean().optional(),
|
|
28
|
+
created_at: iso,
|
|
29
|
+
updated_at: iso
|
|
30
|
+
}).strict();
|
|
31
|
+
function parseRampSummary(value) {
|
|
32
|
+
const parsed = SummarySchema.safeParse(value);
|
|
33
|
+
if (!parsed.success) return null;
|
|
34
|
+
const v = parsed.data;
|
|
35
|
+
const money = (m) => m.asset.kind === "fiat" ? {
|
|
36
|
+
asset: { kind: "fiat", currency: m.asset.currency, decimals: m.asset.decimals },
|
|
37
|
+
atomic: m.atomic
|
|
38
|
+
} : {
|
|
39
|
+
asset: {
|
|
40
|
+
kind: "crypto",
|
|
41
|
+
chain_id: m.asset.chain_id,
|
|
42
|
+
asset_id: m.asset.asset_id,
|
|
43
|
+
symbol: m.asset.symbol,
|
|
44
|
+
decimals: m.asset.decimals
|
|
45
|
+
},
|
|
46
|
+
atomic: m.atomic
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
operation_id: v.operation_id,
|
|
50
|
+
direction: "onramp",
|
|
51
|
+
wallet: v.wallet,
|
|
52
|
+
rail: { id: v.rail.id, label: v.rail.label },
|
|
53
|
+
pay: money(v.pay),
|
|
54
|
+
receive: money(v.receive),
|
|
55
|
+
quote_expires_at: v.quote_expires_at,
|
|
56
|
+
submitted: v.submitted,
|
|
57
|
+
...v.approved_at ? { approved_at: v.approved_at } : {},
|
|
58
|
+
...v.ramp_ref ? { ramp_ref: v.ramp_ref } : {},
|
|
59
|
+
state: v.state,
|
|
60
|
+
terminal: v.terminal,
|
|
61
|
+
...v.payout_state ? { payout_state: v.payout_state } : {},
|
|
62
|
+
...v.held_since ? { held_since: v.held_since } : {},
|
|
63
|
+
...v.failure_code ? { failure_code: v.failure_code } : {},
|
|
64
|
+
...v.abandoned ? { abandoned: true } : {},
|
|
65
|
+
created_at: v.created_at,
|
|
66
|
+
updated_at: v.updated_at
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function summaryResolved(summary) {
|
|
70
|
+
return summary.abandoned === true || summary.terminal;
|
|
71
|
+
}
|
|
72
|
+
function summaryBlocksNewPurchase(summary) {
|
|
73
|
+
return summary.submitted && !summaryResolved(summary);
|
|
74
|
+
}
|
|
75
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
76
|
+
const live = /* @__PURE__ */ new Set();
|
|
77
|
+
function subscribeRampSummaries(listener) {
|
|
78
|
+
listeners.add(listener);
|
|
79
|
+
return () => listeners.delete(listener);
|
|
80
|
+
}
|
|
81
|
+
function notify() {
|
|
82
|
+
for (const l of listeners) l();
|
|
83
|
+
}
|
|
84
|
+
function markRampOperationLive(operationId, value = true) {
|
|
85
|
+
if (value) live.add(operationId);
|
|
86
|
+
else live.delete(operationId);
|
|
87
|
+
notify();
|
|
88
|
+
}
|
|
89
|
+
function rampOperationLive(operationId) {
|
|
90
|
+
return live.has(operationId);
|
|
91
|
+
}
|
|
92
|
+
function storage() {
|
|
93
|
+
try {
|
|
94
|
+
return typeof window === "undefined" ? void 0 : window.localStorage;
|
|
95
|
+
} catch {
|
|
96
|
+
return void 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function read() {
|
|
100
|
+
try {
|
|
101
|
+
const raw = storage()?.getItem(STORAGE_KEYS.localRamps);
|
|
102
|
+
if (!raw) return [];
|
|
103
|
+
const parsed = JSON.parse(raw);
|
|
104
|
+
if (!Array.isArray(parsed)) return [];
|
|
105
|
+
return parsed.map(parseRampSummary).filter((row) => row !== null);
|
|
106
|
+
} catch {
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function write(rows) {
|
|
111
|
+
try {
|
|
112
|
+
const store = storage();
|
|
113
|
+
if (!store) return false;
|
|
114
|
+
store.setItem(STORAGE_KEYS.localRamps, JSON.stringify(rows));
|
|
115
|
+
return true;
|
|
116
|
+
} catch {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function listRampSummaries() {
|
|
121
|
+
return read().sort((a, b) => Date.parse(b.created_at) - Date.parse(a.created_at));
|
|
122
|
+
}
|
|
123
|
+
function getRampSummary(operationId) {
|
|
124
|
+
return read().find((row) => row.operation_id === operationId);
|
|
125
|
+
}
|
|
126
|
+
function upsertRampSummary(summary) {
|
|
127
|
+
const clean = parseRampSummary(summary);
|
|
128
|
+
if (!clean) return;
|
|
129
|
+
const rows = read().filter((row) => row.operation_id !== clean.operation_id);
|
|
130
|
+
rows.unshift(clean);
|
|
131
|
+
rows.sort((a, b) => Date.parse(b.created_at) - Date.parse(a.created_at));
|
|
132
|
+
if (write(rows.slice(0, MAX_RECORDS))) notify();
|
|
133
|
+
}
|
|
134
|
+
function summaryFromSnapshot(summary, snapshot, now = Date.now()) {
|
|
135
|
+
const peer = snapshot.peer;
|
|
136
|
+
const held = peer.payout_state === "held";
|
|
137
|
+
const { failure_code: _previousFailure, payout_state: _previousPayout, ...rest } = summary;
|
|
138
|
+
return {
|
|
139
|
+
...rest,
|
|
140
|
+
submitted: summary.submitted || !["quoted", "not_started", "failed"].includes(peer.state),
|
|
141
|
+
state: peer.state,
|
|
142
|
+
terminal: snapshot.terminal,
|
|
143
|
+
...peer.payout_state ? { payout_state: peer.payout_state } : {},
|
|
144
|
+
...held && !summary.held_since ? { held_since: new Date(now).toISOString() } : {},
|
|
145
|
+
...peer.failure_code ? { failure_code: peer.failure_code } : {},
|
|
146
|
+
updated_at: new Date(now).toISOString()
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function abandonRampSummary(operationId, now = Date.now()) {
|
|
150
|
+
const row = getRampSummary(operationId);
|
|
151
|
+
if (!row || row.submitted) return false;
|
|
152
|
+
upsertRampSummary({ ...row, abandoned: true, updated_at: new Date(now).toISOString() });
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
function heldReleaseEstimate(summary) {
|
|
156
|
+
if (summary.payout_state !== "held" || !summary.held_since) return void 0;
|
|
157
|
+
return new Date(Date.parse(summary.held_since) + PEER_HOLD_MS);
|
|
158
|
+
}
|
|
159
|
+
export {
|
|
160
|
+
PEER_HOLD_MS,
|
|
161
|
+
abandonRampSummary,
|
|
162
|
+
getRampSummary,
|
|
163
|
+
heldReleaseEstimate,
|
|
164
|
+
listRampSummaries,
|
|
165
|
+
markRampOperationLive,
|
|
166
|
+
parseRampSummary,
|
|
167
|
+
rampOperationLive,
|
|
168
|
+
subscribeRampSummaries,
|
|
169
|
+
summaryBlocksNewPurchase,
|
|
170
|
+
summaryFromSnapshot,
|
|
171
|
+
summaryResolved,
|
|
172
|
+
upsertRampSummary
|
|
173
|
+
};
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useContext, useState, useRef, useMemo, useEffect } from "react";
|
|
3
|
+
import { WagmiContext, useAccount, useConfig } from "wagmi";
|
|
4
|
+
import { formatUnits } from "viem";
|
|
5
|
+
import { stealthDestinationChains, isChainId, createXochiRampLeg, createRampClient } from "@xochi/client";
|
|
6
|
+
import { STEALTH_PRIVACY_LIMITS } from "../../pages/trade/settlementCopy.js";
|
|
7
|
+
import { useClaimInXochiApp, CLAIM_IN_XOCHI_APP } from "../../components/widgetTabsContext.js";
|
|
8
|
+
import { useCapabilities } from "../../hooks/useCapabilities.js";
|
|
9
|
+
import { useStealth } from "../../hooks/useStealth.js";
|
|
10
|
+
import { useIntent } from "../../hooks/useIntent.js";
|
|
11
|
+
import { findTokenBySymbol } from "../../pages/trade/config.js";
|
|
12
|
+
import { parseStealthMetaAddress } from "../../pages/send/stealthRecipient.js";
|
|
13
|
+
import { chainName } from "../../pages/send/addressSend.js";
|
|
14
|
+
import { useEmbedDefaults } from "../../pages/trade/useEmbedDefaults.js";
|
|
15
|
+
import { policyHolds } from "../../pages/trade/embedParams.js";
|
|
16
|
+
import { findOnrampRoute } from "./routeActivity.js";
|
|
17
|
+
import { RampRouteSteps } from "./RampRouteSteps.js";
|
|
18
|
+
import { useXochiRampDriver, routeMachineStatus } from "./useXochiRampDriver.js";
|
|
19
|
+
function OnrampRoute(props) {
|
|
20
|
+
const config = useContext(WagmiContext);
|
|
21
|
+
if (!config)
|
|
22
|
+
return /* @__PURE__ */ jsx(RampRouteSteps, { ...props, disabled: true, onAction: () => {
|
|
23
|
+
}, children: /* @__PURE__ */ jsx("p", { children: "Connect the receiving wallet on Base to review an optional Xochi route." }) });
|
|
24
|
+
return /* @__PURE__ */ jsx(ConnectedOnrampRoute, { ...props });
|
|
25
|
+
}
|
|
26
|
+
function ConnectedOnrampRoute({
|
|
27
|
+
snapshot,
|
|
28
|
+
onSnapshot,
|
|
29
|
+
store,
|
|
30
|
+
peer,
|
|
31
|
+
received,
|
|
32
|
+
wallet
|
|
33
|
+
}) {
|
|
34
|
+
const { address, chainId } = useAccount();
|
|
35
|
+
const config = useConfig();
|
|
36
|
+
const { capabilities, state } = useCapabilities();
|
|
37
|
+
const stealth = useStealth();
|
|
38
|
+
const claimInApp = useClaimInXochiApp();
|
|
39
|
+
const embed = useEmbedDefaults();
|
|
40
|
+
const [restored] = useState(() => findOnrampRoute(wallet, snapshot.operation_id, received));
|
|
41
|
+
const [targetKey, setTargetKey] = useState(
|
|
42
|
+
restored ? `${restored.data.toChainId}:${restored.data.toToken}` : ""
|
|
43
|
+
);
|
|
44
|
+
const [settlement, setSettlement] = useState(
|
|
45
|
+
restored?.data.settlementType === "stealth" ? "stealth" : "public"
|
|
46
|
+
);
|
|
47
|
+
const [recipientKind, setRecipientKind] = useState(
|
|
48
|
+
restored?.data.stealthPayee === "other" ? "other" : "own"
|
|
49
|
+
);
|
|
50
|
+
const [metaInput, setMetaInput] = useState("");
|
|
51
|
+
const [busy, setBusy] = useState(false);
|
|
52
|
+
const [note, setNote] = useState("");
|
|
53
|
+
const lock = useRef(false);
|
|
54
|
+
const bound = address?.toLowerCase() === wallet.toLowerCase() && chainId === 8453;
|
|
55
|
+
const trustedStealth = stealthDestinationChains(capabilities);
|
|
56
|
+
const opened = embed.settled ?? embed.seed;
|
|
57
|
+
const targets = useMemo(() => {
|
|
58
|
+
if (state !== "live") return [];
|
|
59
|
+
const seen = /* @__PURE__ */ new Set();
|
|
60
|
+
return (capabilities.routes ?? []).flatMap((route) => {
|
|
61
|
+
const { origin, destination } = route;
|
|
62
|
+
if (origin.chainId !== 8453 || origin.token !== "USDC" || destination.kind !== "chain" || !isChainId(destination.chainId) || !config.chains.some((c) => c.id === destination.chainId))
|
|
63
|
+
return [];
|
|
64
|
+
const token = findTokenBySymbol(destination.chainId, destination.token);
|
|
65
|
+
if (!token || !policyHolds(
|
|
66
|
+
opened,
|
|
67
|
+
{
|
|
68
|
+
fromChainId: 8453,
|
|
69
|
+
fromSymbol: "USDC",
|
|
70
|
+
toChainId: destination.chainId,
|
|
71
|
+
toSymbol: token.symbol
|
|
72
|
+
},
|
|
73
|
+
formatUnits(BigInt(received.atomic), received.asset.decimals)
|
|
74
|
+
))
|
|
75
|
+
return [];
|
|
76
|
+
const key = `${destination.chainId}:${token.address}`;
|
|
77
|
+
if (seen.has(key)) return [];
|
|
78
|
+
seen.add(key);
|
|
79
|
+
return [{ key, chainId: destination.chainId, token, privacyModes: route.privacyModes }];
|
|
80
|
+
});
|
|
81
|
+
}, [capabilities, state, config.chains, opened, received]);
|
|
82
|
+
const target = targets.find((t) => t.key === targetKey) ?? targets[0];
|
|
83
|
+
const checked = parseStealthMetaAddress(metaInput);
|
|
84
|
+
const meta = recipientKind === "other" ? checked.ok ? checked.recipient : null : stealth.metaAddress;
|
|
85
|
+
const recipient = settlement === "public" ? wallet : recipientKind === "other" ? checked.ok ? checked.recipient.encoded : "" : stealth.encodedMetaAddress ?? "";
|
|
86
|
+
const authorized = bound && snapshot.peer.state === "completed" && snapshot.peer.payout_state !== "held" && state === "live" && !!target && target.privacyModes.includes(settlement) && (settlement === "public" || trustedStealth.includes(target.chainId) && !!meta);
|
|
87
|
+
const source = findTokenBySymbol(8453, "USDC");
|
|
88
|
+
const asset = target ? {
|
|
89
|
+
kind: "crypto",
|
|
90
|
+
chain_id: `eip155:${target.chainId}`,
|
|
91
|
+
asset_id: target.token.address,
|
|
92
|
+
symbol: target.token.symbol,
|
|
93
|
+
decimals: target.token.decimals
|
|
94
|
+
} : received.asset;
|
|
95
|
+
const intent = useIntent({
|
|
96
|
+
fromChainId: 8453,
|
|
97
|
+
toChainId: target?.chainId ?? 8453,
|
|
98
|
+
fromToken: source.address,
|
|
99
|
+
toToken: target?.token.address ?? source.address,
|
|
100
|
+
settlementPreference: settlement,
|
|
101
|
+
settlementAuthorized: authorized,
|
|
102
|
+
stealthMetaAddress: settlement === "stealth" && meta && target ? {
|
|
103
|
+
spendingPubKey: meta.spendingPubKey,
|
|
104
|
+
viewingPubKey: meta.viewingPubKey,
|
|
105
|
+
chainId: target.chainId
|
|
106
|
+
} : void 0,
|
|
107
|
+
paused: true,
|
|
108
|
+
manualQuoteRefresh: true,
|
|
109
|
+
ref: embed.codes.ref ?? void 0,
|
|
110
|
+
promo: embed.codes.promo ?? void 0
|
|
111
|
+
});
|
|
112
|
+
const driver = useXochiRampDriver({
|
|
113
|
+
intent,
|
|
114
|
+
pay: received,
|
|
115
|
+
receiveAsset: asset,
|
|
116
|
+
recipient,
|
|
117
|
+
settlement,
|
|
118
|
+
authorized,
|
|
119
|
+
operationId: snapshot.operation_id,
|
|
120
|
+
wallet,
|
|
121
|
+
payee: recipientKind,
|
|
122
|
+
routeState: snapshot.xochi?.state
|
|
123
|
+
});
|
|
124
|
+
const funding = useMemo(() => received, [received.atomic, JSON.stringify(received.asset)]);
|
|
125
|
+
const leg = useMemo(
|
|
126
|
+
() => createXochiRampLeg({ store, driver, delivered: funding }),
|
|
127
|
+
[store, driver, funding]
|
|
128
|
+
);
|
|
129
|
+
const client = useMemo(
|
|
130
|
+
() => createRampClient({ peer, xochi: leg, store, commandTimeoutMs: 18e4 }),
|
|
131
|
+
[peer, leg, store]
|
|
132
|
+
);
|
|
133
|
+
const held = leg.preview(snapshot.operation_id);
|
|
134
|
+
const preview = held?.receive.asset.kind === "crypto" && held.receive.asset.asset_id === (asset.kind === "crypto" ? asset.asset_id : void 0) && held.receive.asset.chain_id === (asset.kind === "crypto" ? asset.chain_id : void 0) && held?.recipient === recipient && held.settlement === settlement ? held : void 0;
|
|
135
|
+
const active = snapshot.xochi && ["processing", "in_doubt", "completed", "skipped"].includes(snapshot.xochi.state);
|
|
136
|
+
async function act(action) {
|
|
137
|
+
if (lock.current) return;
|
|
138
|
+
lock.current = true;
|
|
139
|
+
setBusy(true);
|
|
140
|
+
setNote("");
|
|
141
|
+
try {
|
|
142
|
+
const context = (s) => ({
|
|
143
|
+
expected_revision: s.revision,
|
|
144
|
+
idempotency_key: crypto.randomUUID()
|
|
145
|
+
});
|
|
146
|
+
const current = snapshot.xochi ? snapshot : await client.offerRoute(snapshot.operation_id, context(snapshot));
|
|
147
|
+
onSnapshot(current);
|
|
148
|
+
const next = await client.recover(current.operation_id, "xochi", action, context(current));
|
|
149
|
+
onSnapshot(next);
|
|
150
|
+
} catch {
|
|
151
|
+
setNote(
|
|
152
|
+
"The Xochi route could not be validated. Peer remains completed. Check route status after any wallet approval; do not start another transfer."
|
|
153
|
+
);
|
|
154
|
+
} finally {
|
|
155
|
+
lock.current = false;
|
|
156
|
+
setBusy(false);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
useEffect(() => {
|
|
160
|
+
if (busy || !snapshot.xochi || !["processing", "in_doubt"].includes(snapshot.xochi.state))
|
|
161
|
+
return;
|
|
162
|
+
const status = routeMachineStatus(intent);
|
|
163
|
+
if (status.state === snapshot.xochi.state || !["completed", "failed"].includes(status.state))
|
|
164
|
+
return;
|
|
165
|
+
void act("check_status");
|
|
166
|
+
}, [busy, snapshot, intent.status, intent.receipt.phase]);
|
|
167
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
168
|
+
/* @__PURE__ */ jsx(
|
|
169
|
+
RampRouteSteps,
|
|
170
|
+
{
|
|
171
|
+
snapshot,
|
|
172
|
+
preview,
|
|
173
|
+
wallet,
|
|
174
|
+
received,
|
|
175
|
+
busy,
|
|
176
|
+
quoteDisabled: !authorized,
|
|
177
|
+
completedNote: settlement === "stealth" ? recipientKind === "other" ? "The recipient claims this Stealth payment with their own keys. The sending wallet cannot claim it." : claimInApp ? CLAIM_IN_XOCHI_APP : "Find this Stealth payment in Claims with the receiving wallet." : void 0,
|
|
178
|
+
onAction: (action) => void act(action),
|
|
179
|
+
children: !active && /* @__PURE__ */ jsxs("fieldset", { disabled: busy, className: "ramp-route__fields", children: [
|
|
180
|
+
/* @__PURE__ */ jsx("legend", { children: "Optional destination" }),
|
|
181
|
+
/* @__PURE__ */ jsxs("label", { children: [
|
|
182
|
+
"Receive asset and network",
|
|
183
|
+
/* @__PURE__ */ jsx("select", { value: target?.key ?? "", onChange: (e) => setTargetKey(e.target.value), children: targets.map((t) => /* @__PURE__ */ jsxs("option", { value: t.key, children: [
|
|
184
|
+
t.token.symbol,
|
|
185
|
+
" on ",
|
|
186
|
+
chainName(t.chainId)
|
|
187
|
+
] }, t.key)) })
|
|
188
|
+
] }),
|
|
189
|
+
/* @__PURE__ */ jsxs("label", { children: [
|
|
190
|
+
"Settlement",
|
|
191
|
+
/* @__PURE__ */ jsxs(
|
|
192
|
+
"select",
|
|
193
|
+
{
|
|
194
|
+
value: settlement,
|
|
195
|
+
onChange: (e) => {
|
|
196
|
+
setSettlement(e.target.value);
|
|
197
|
+
setMetaInput("");
|
|
198
|
+
setRecipientKind("own");
|
|
199
|
+
},
|
|
200
|
+
children: [
|
|
201
|
+
/* @__PURE__ */ jsx("option", { value: "public", children: "Public (my wallet)" }),
|
|
202
|
+
/* @__PURE__ */ jsx("option", { value: "stealth", children: "Stealth recipient" })
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
] }),
|
|
207
|
+
settlement === "stealth" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
208
|
+
/* @__PURE__ */ jsx("p", { children: STEALTH_PRIVACY_LIMITS }),
|
|
209
|
+
/* @__PURE__ */ jsxs("label", { children: [
|
|
210
|
+
"Stealth recipient",
|
|
211
|
+
/* @__PURE__ */ jsxs(
|
|
212
|
+
"select",
|
|
213
|
+
{
|
|
214
|
+
value: recipientKind,
|
|
215
|
+
onChange: (e) => setRecipientKind(e.target.value),
|
|
216
|
+
children: [
|
|
217
|
+
/* @__PURE__ */ jsx("option", { value: "own", children: "My Stealth keys" }),
|
|
218
|
+
/* @__PURE__ */ jsx("option", { value: "other", children: "Another person's meta-address" })
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
] }),
|
|
223
|
+
recipientKind === "other" ? /* @__PURE__ */ jsxs("label", { children: [
|
|
224
|
+
"Recipient's Stealth meta-address",
|
|
225
|
+
/* @__PURE__ */ jsx(
|
|
226
|
+
"input",
|
|
227
|
+
{
|
|
228
|
+
value: metaInput,
|
|
229
|
+
onChange: (e) => setMetaInput(e.target.value),
|
|
230
|
+
autoComplete: "off",
|
|
231
|
+
spellCheck: false
|
|
232
|
+
}
|
|
233
|
+
),
|
|
234
|
+
!checked.ok && /* @__PURE__ */ jsx("span", { children: checked.error })
|
|
235
|
+
] }) : !meta && /* @__PURE__ */ jsx(
|
|
236
|
+
"button",
|
|
237
|
+
{
|
|
238
|
+
type: "button",
|
|
239
|
+
disabled: stealth.isLoading || !bound,
|
|
240
|
+
onClick: () => void stealth.initializeKeys(),
|
|
241
|
+
children: "Set up my Stealth keys"
|
|
242
|
+
}
|
|
243
|
+
)
|
|
244
|
+
] }),
|
|
245
|
+
!authorized && /* @__PURE__ */ jsx("p", { role: "status", children: !bound ? "Reconnect the receiving wallet on Base to route." : "Choose a live supported route and complete any Stealth recipient setup before requesting a quote." })
|
|
246
|
+
] })
|
|
247
|
+
}
|
|
248
|
+
),
|
|
249
|
+
intent.awaitingPull && /* @__PURE__ */ jsx("button", { type: "button", disabled: intent.isSigningPull, onClick: intent.signPull, children: "Authorize" }),
|
|
250
|
+
note && /* @__PURE__ */ jsx("p", { role: "status", children: note })
|
|
251
|
+
] });
|
|
252
|
+
}
|
|
253
|
+
export {
|
|
254
|
+
OnrampRoute
|
|
255
|
+
};
|