@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,92 @@
|
|
|
1
|
+
import { getAddress } from "viem";
|
|
2
|
+
import { CHAIN_NAMES, TOKENS, validateAddressForVm } from "@xochi/client";
|
|
3
|
+
import { parseTokenAmount } from "../../utils/format.js";
|
|
4
|
+
const SEND_TOKENS = Object.fromEntries(
|
|
5
|
+
Object.entries(TOKENS).map(([chainId, tokens]) => [
|
|
6
|
+
Number(chainId),
|
|
7
|
+
tokens.map((token) => ({ ...token, chainId: Number(chainId) }))
|
|
8
|
+
])
|
|
9
|
+
);
|
|
10
|
+
function sendTokens(chainId) {
|
|
11
|
+
return SEND_TOKENS[chainId] ?? [];
|
|
12
|
+
}
|
|
13
|
+
function defaultSendToken(chainId) {
|
|
14
|
+
const tokens = sendTokens(chainId);
|
|
15
|
+
return tokens.find((t) => t.symbol === "USDC") ?? tokens[0];
|
|
16
|
+
}
|
|
17
|
+
function sendChainIds(configured) {
|
|
18
|
+
return configured.filter((id) => sendTokens(id).length > 0);
|
|
19
|
+
}
|
|
20
|
+
function chainName(chainId) {
|
|
21
|
+
return CHAIN_NAMES[chainId] ?? `Chain ${chainId}`;
|
|
22
|
+
}
|
|
23
|
+
function checkSendAmount(typed, token, balance) {
|
|
24
|
+
if (typed.trim() === "") return { error: "Enter an amount" };
|
|
25
|
+
let amount;
|
|
26
|
+
try {
|
|
27
|
+
amount = parseTokenAmount(typed, token.decimals);
|
|
28
|
+
} catch {
|
|
29
|
+
return {
|
|
30
|
+
error: `Enter an amount in ${token.symbol}, up to ${token.decimals} decimals`
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (amount <= 0n) return { error: "Enter an amount above zero" };
|
|
34
|
+
if (balance !== null && amount > balance) {
|
|
35
|
+
return { error: `More than your ${token.symbol} balance` };
|
|
36
|
+
}
|
|
37
|
+
return { amount };
|
|
38
|
+
}
|
|
39
|
+
function recipientError(draft, token) {
|
|
40
|
+
const trimmed = draft.recipient.trim();
|
|
41
|
+
if (trimmed === "") return { error: "Enter the recipient's address" };
|
|
42
|
+
const check = validateAddressForVm(trimmed, "evm");
|
|
43
|
+
if (!check.valid) {
|
|
44
|
+
return {
|
|
45
|
+
error: `${check.error ?? "Invalid address"}. Enter an address on ${chainName(draft.chainId)}.`
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const recipient = getAddress(trimmed);
|
|
49
|
+
if (recipient === getAddress(token.address)) {
|
|
50
|
+
return { error: `That is the ${token.symbol} contract, not a wallet` };
|
|
51
|
+
}
|
|
52
|
+
return { recipient };
|
|
53
|
+
}
|
|
54
|
+
function checkAddressSend(draft, context) {
|
|
55
|
+
const token = context.chainIds.includes(draft.chainId) ? sendTokens(draft.chainId).find(
|
|
56
|
+
(t) => t.address.toLowerCase() === draft.tokenAddress.toLowerCase()
|
|
57
|
+
) : void 0;
|
|
58
|
+
if (!token) return { ok: false, errors: { asset: "Choose an asset to send" } };
|
|
59
|
+
const amount = checkSendAmount(draft.amount, token, context.balance);
|
|
60
|
+
const recipient = recipientError(draft, token);
|
|
61
|
+
if ("error" in amount || "error" in recipient) {
|
|
62
|
+
return {
|
|
63
|
+
ok: false,
|
|
64
|
+
errors: {
|
|
65
|
+
..."error" in amount && { amount: amount.error },
|
|
66
|
+
..."error" in recipient && { recipient: recipient.error }
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
ok: true,
|
|
72
|
+
order: {
|
|
73
|
+
chainId: draft.chainId,
|
|
74
|
+
token,
|
|
75
|
+
amount: amount.amount,
|
|
76
|
+
recipient: recipient.recipient
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function defaultSendChain(chainIds, preferred) {
|
|
81
|
+
if (preferred !== void 0 && chainIds.includes(preferred)) return preferred;
|
|
82
|
+
return chainIds.includes(8453) ? 8453 : chainIds[0] ?? 0;
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
chainName,
|
|
86
|
+
checkAddressSend,
|
|
87
|
+
checkSendAmount,
|
|
88
|
+
defaultSendChain,
|
|
89
|
+
defaultSendToken,
|
|
90
|
+
sendChainIds,
|
|
91
|
+
sendTokens
|
|
92
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const recipients = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
const submitted = /* @__PURE__ */ new Map();
|
|
3
|
+
function rememberSendRecipient(display, recipient) {
|
|
4
|
+
if (recipient.kind === "address" || recipient.kind === "stealth_meta") {
|
|
5
|
+
recipients.set(display, recipient);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
function rememberSendIntent(intentId, display) {
|
|
9
|
+
const recipient = recipients.get(display);
|
|
10
|
+
if (!recipient || submitted.has(intentId)) return;
|
|
11
|
+
submitted.set(intentId, recipient);
|
|
12
|
+
if (submitted.size > 50) {
|
|
13
|
+
const oldest = submitted.keys().next();
|
|
14
|
+
if (!oldest.done) submitted.delete(oldest.value);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function recallSendRecipient(intentId) {
|
|
18
|
+
return submitted.get(intentId);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
recallSendRecipient,
|
|
22
|
+
rememberSendIntent,
|
|
23
|
+
rememberSendRecipient
|
|
24
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { secp256k1 } from "@noble/curves/secp256k1";
|
|
2
|
+
import { isCompromisedStealthSpendingPubKey } from "@xochi/signer";
|
|
3
|
+
const PREFIX = "st:eth:0x";
|
|
4
|
+
const BODY_HEX = 2 * 33 * 2;
|
|
5
|
+
function keyError(name, hex) {
|
|
6
|
+
const prefix = hex.slice(0, 2);
|
|
7
|
+
if (prefix !== "02" && prefix !== "03") {
|
|
8
|
+
return `The ${name} key is not a compressed public key (it must start with 02 or 03).`;
|
|
9
|
+
}
|
|
10
|
+
try {
|
|
11
|
+
secp256k1.ProjectivePoint.fromHex(hex);
|
|
12
|
+
} catch {
|
|
13
|
+
return `The ${name} key is not a valid secp256k1 public key.`;
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
function parseStealthMetaAddress(input) {
|
|
18
|
+
const value = input.trim();
|
|
19
|
+
if (value.length === 0) {
|
|
20
|
+
return { ok: false, error: "Paste the recipient's stealth meta-address." };
|
|
21
|
+
}
|
|
22
|
+
if (!value.startsWith(PREFIX)) {
|
|
23
|
+
return {
|
|
24
|
+
ok: false,
|
|
25
|
+
error: "A stealth meta-address starts with st:eth:0x. Ask the recipient for theirs."
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const body = value.slice(PREFIX.length);
|
|
29
|
+
if (!/^[0-9a-fA-F]*$/.test(body)) {
|
|
30
|
+
return { ok: false, error: "The meta-address has characters that are not hex." };
|
|
31
|
+
}
|
|
32
|
+
if (body.length !== BODY_HEX) {
|
|
33
|
+
return {
|
|
34
|
+
ok: false,
|
|
35
|
+
error: `The meta-address is ${body.length} hex characters after st:eth:0x; it must be ${BODY_HEX}.`
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const lower = body.toLowerCase();
|
|
39
|
+
const spending = lower.slice(0, BODY_HEX / 2);
|
|
40
|
+
const viewing = lower.slice(BODY_HEX / 2);
|
|
41
|
+
const error = keyError("spending", spending) ?? keyError("viewing", viewing);
|
|
42
|
+
if (error) return { ok: false, error };
|
|
43
|
+
if (isCompromisedStealthSpendingPubKey(spending)) {
|
|
44
|
+
return {
|
|
45
|
+
ok: false,
|
|
46
|
+
error: "This meta-address uses a publicly known spending key, so anyone could take a payment to it."
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
ok: true,
|
|
51
|
+
recipient: {
|
|
52
|
+
encoded: `${PREFIX}${lower}`,
|
|
53
|
+
spendingPubKey: `0x${spending}`,
|
|
54
|
+
viewingPubKey: `0x${viewing}`
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function abbreviateMetaAddress(encoded) {
|
|
59
|
+
const body = encoded.slice(PREFIX.length);
|
|
60
|
+
return body.length <= 12 ? encoded : `${PREFIX}${body.slice(0, 6)}…${body.slice(-6)}`;
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
abbreviateMetaAddress,
|
|
64
|
+
parseStealthMetaAddress
|
|
65
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { sendTokens } from "./addressSend.js";
|
|
2
|
+
function stealthSendDestinations(caps, state, chainId, symbol) {
|
|
3
|
+
if (state !== "live" || caps.routes === null) return [];
|
|
4
|
+
const out = [];
|
|
5
|
+
for (const route of caps.routes) {
|
|
6
|
+
const { origin, destination } = route;
|
|
7
|
+
if (origin.chainId === chainId && origin.token === symbol && destination.kind === "chain" && destination.token === symbol && route.privacyModes.includes("stealth") && sendTokens(destination.chainId).some((t) => t.symbol === symbol) && !out.includes(destination.chainId)) {
|
|
8
|
+
out.push(destination.chainId);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return out;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
stealthSendDestinations
|
|
15
|
+
};
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { useState, useRef, useEffect, useCallback } from "react";
|
|
2
|
+
import { useConfig, useAccount } from "wagmi";
|
|
3
|
+
import { switchChain, getTransaction, getTransactionReceipt, getBlock, writeContract } from "wagmi/actions";
|
|
4
|
+
import { waitForTransactionReceipt } from "viem/actions";
|
|
5
|
+
import { isHash, encodeFunctionData, erc20Abi } from "viem";
|
|
6
|
+
import { isUserRejection } from "../../lib/eip712.js";
|
|
7
|
+
import { readSendAttempt, withSendAttemptLock, saveSendAttempt, listLocalSends, clearSendAttempt, upsertLocalSend } from "../../lib/localSends.js";
|
|
8
|
+
import { sendTokens } from "./addressSend.js";
|
|
9
|
+
const DECLINED = "You declined in your wallet. Nothing was sent.";
|
|
10
|
+
const UNKNOWN_SUBMISSION = "Submission status is unknown. Do not send again. Attach the transaction hash to check this transfer.";
|
|
11
|
+
const NOT_SWITCHED = "The wallet did not switch networks.";
|
|
12
|
+
function restore(wallet) {
|
|
13
|
+
try {
|
|
14
|
+
const attempt = readSendAttempt(wallet);
|
|
15
|
+
if (!attempt) return null;
|
|
16
|
+
const { data } = attempt;
|
|
17
|
+
const token = sendTokens(data.chainId).find(
|
|
18
|
+
(token2) => token2.address.toLowerCase() === data.token.toLowerCase()
|
|
19
|
+
);
|
|
20
|
+
if (!token || token.decimals !== data.decimals) return { step: "blocked" };
|
|
21
|
+
return {
|
|
22
|
+
step: "in_doubt",
|
|
23
|
+
attempt,
|
|
24
|
+
order: {
|
|
25
|
+
chainId: data.chainId,
|
|
26
|
+
token,
|
|
27
|
+
amount: BigInt(data.amount),
|
|
28
|
+
recipient: data.recipient
|
|
29
|
+
},
|
|
30
|
+
notice: UNKNOWN_SUBMISSION
|
|
31
|
+
};
|
|
32
|
+
} catch {
|
|
33
|
+
return { step: "blocked" };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function useAddressSend() {
|
|
37
|
+
const config = useConfig();
|
|
38
|
+
const { address, chainId, connector } = useAccount();
|
|
39
|
+
const [phase, setPhase] = useState({ step: "edit" });
|
|
40
|
+
const busy = useRef(false);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (address) {
|
|
43
|
+
const saved = restore(address);
|
|
44
|
+
if (saved) setPhase(saved);
|
|
45
|
+
}
|
|
46
|
+
}, [address]);
|
|
47
|
+
const sender = useRef(null);
|
|
48
|
+
const binding = address && connector ? `${address.toLowerCase()}:${connector.uid}` : null;
|
|
49
|
+
const reviewedBinding = useRef(null);
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (reviewedBinding.current === null || reviewedBinding.current === binding) return;
|
|
52
|
+
reviewedBinding.current = null;
|
|
53
|
+
sender.current = null;
|
|
54
|
+
setPhase(
|
|
55
|
+
(current) => current.step === "review" || current.step === "switching" ? { step: "edit" } : current
|
|
56
|
+
);
|
|
57
|
+
}, [binding]);
|
|
58
|
+
const review = useCallback(
|
|
59
|
+
(order2) => {
|
|
60
|
+
if (!address || !connector || binding === null) return;
|
|
61
|
+
const saved = restore(address);
|
|
62
|
+
if (saved) {
|
|
63
|
+
setPhase(saved);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
reviewedBinding.current = binding;
|
|
67
|
+
sender.current = { address };
|
|
68
|
+
setPhase({ step: "review", order: order2 });
|
|
69
|
+
},
|
|
70
|
+
[address, connector, binding]
|
|
71
|
+
);
|
|
72
|
+
const edit = useCallback(() => {
|
|
73
|
+
if (busy.current || address && restore(address)) return;
|
|
74
|
+
reviewedBinding.current = null;
|
|
75
|
+
sender.current = null;
|
|
76
|
+
setPhase({ step: "edit" });
|
|
77
|
+
}, [address]);
|
|
78
|
+
const reset = edit;
|
|
79
|
+
const order = "order" in phase ? phase.order : null;
|
|
80
|
+
const needsSwitch = order !== null && chainId !== order.chainId;
|
|
81
|
+
const switchNetwork = useCallback(async () => {
|
|
82
|
+
if (phase.step !== "review") return;
|
|
83
|
+
const reviewed = phase.order;
|
|
84
|
+
setPhase({ step: "switching", order: reviewed });
|
|
85
|
+
try {
|
|
86
|
+
await switchChain(config, { chainId: reviewed.chainId });
|
|
87
|
+
setPhase({ step: "review", order: reviewed });
|
|
88
|
+
} catch (err) {
|
|
89
|
+
setPhase({
|
|
90
|
+
step: "review",
|
|
91
|
+
order: reviewed,
|
|
92
|
+
notice: isUserRejection(err) ? "You declined the network switch." : NOT_SWITCHED
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}, [config, phase]);
|
|
96
|
+
const approve = async () => {
|
|
97
|
+
if (phase.step !== "review" || needsSwitch || busy.current || !address) return;
|
|
98
|
+
const order2 = phase.order;
|
|
99
|
+
const from = sender.current;
|
|
100
|
+
if (!from || reviewedBinding.current !== binding) {
|
|
101
|
+
edit();
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
busy.current = true;
|
|
105
|
+
try {
|
|
106
|
+
await withSendAttemptLock(from.address, async () => {
|
|
107
|
+
const saved = restore(from.address);
|
|
108
|
+
if (saved) {
|
|
109
|
+
setPhase(saved);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const attempt = {
|
|
113
|
+
wallet: from.address,
|
|
114
|
+
timestamp: Date.now(),
|
|
115
|
+
data: {
|
|
116
|
+
chainId: order2.chainId,
|
|
117
|
+
token: order2.token.address,
|
|
118
|
+
symbol: order2.token.symbol,
|
|
119
|
+
decimals: order2.token.decimals,
|
|
120
|
+
amount: order2.amount.toString(),
|
|
121
|
+
recipient: order2.recipient
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
saveSendAttempt(attempt);
|
|
125
|
+
setPhase({ step: "approving", order: order2 });
|
|
126
|
+
let hash;
|
|
127
|
+
try {
|
|
128
|
+
hash = await writeContract(config, {
|
|
129
|
+
address: order2.token.address,
|
|
130
|
+
abi: erc20Abi,
|
|
131
|
+
functionName: "transfer",
|
|
132
|
+
args: [order2.recipient, order2.amount],
|
|
133
|
+
chainId: order2.chainId,
|
|
134
|
+
account: from.address
|
|
135
|
+
});
|
|
136
|
+
} catch (error) {
|
|
137
|
+
if (explicitWalletRefusal(error)) {
|
|
138
|
+
try {
|
|
139
|
+
clearSendAttempt(from.address);
|
|
140
|
+
setPhase({ step: "review", order: order2, notice: DECLINED });
|
|
141
|
+
return;
|
|
142
|
+
} catch {
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
setPhase({ step: "in_doubt", order: order2, attempt, notice: UNKNOWN_SUBMISSION });
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
try {
|
|
149
|
+
if (!isHash(hash)) throw new Error("Invalid transaction hash");
|
|
150
|
+
attempt.hash = hash;
|
|
151
|
+
saveSendAttempt(attempt);
|
|
152
|
+
recordSend(attempt, hash, "pending");
|
|
153
|
+
setPhase({ step: "sent", order: order2, hash, outcome: "pending" });
|
|
154
|
+
const receipt = await waitForTransactionReceipt(
|
|
155
|
+
config.getClient({ chainId: order2.chainId }),
|
|
156
|
+
{
|
|
157
|
+
hash,
|
|
158
|
+
checkReplacement: false,
|
|
159
|
+
timeout: 6e4
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
finish(attempt, order2, hash, receipt.status === "success");
|
|
163
|
+
} catch {
|
|
164
|
+
setPhase({ step: "in_doubt", order: order2, attempt, notice: UNKNOWN_SUBMISSION });
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
} catch {
|
|
168
|
+
setPhase({ step: "blocked" });
|
|
169
|
+
} finally {
|
|
170
|
+
busy.current = false;
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
function finish(attempt, order2, hash, success) {
|
|
174
|
+
if (!recordSend(attempt, hash, success ? "completed" : "failed"))
|
|
175
|
+
throw new Error("Send activity unavailable");
|
|
176
|
+
clearSendAttempt(attempt.wallet);
|
|
177
|
+
reviewedBinding.current = null;
|
|
178
|
+
sender.current = null;
|
|
179
|
+
setPhase({ step: "sent", order: order2, hash, outcome: success ? "confirmed" : "reverted" });
|
|
180
|
+
}
|
|
181
|
+
const reconcile = async (supplied) => {
|
|
182
|
+
if (phase.step !== "in_doubt" || busy.current || address?.toLowerCase() !== phase.attempt.wallet.toLowerCase())
|
|
183
|
+
return;
|
|
184
|
+
const { order: order2 } = phase;
|
|
185
|
+
const hash = phase.attempt.hash ?? supplied.trim();
|
|
186
|
+
if (!isHash(hash)) {
|
|
187
|
+
setPhase({ ...phase, notice: "Enter a valid transaction hash. Do not send again." });
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
busy.current = true;
|
|
191
|
+
let attempt = phase.attempt;
|
|
192
|
+
try {
|
|
193
|
+
await withSendAttemptLock(attempt.wallet, async () => {
|
|
194
|
+
const saved = readSendAttempt(attempt.wallet);
|
|
195
|
+
if (!saved || saved.timestamp !== attempt.timestamp) {
|
|
196
|
+
setPhase(restore(attempt.wallet) ?? { step: "edit" });
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (saved.hash && saved.hash.toLowerCase() !== hash.toLowerCase()) {
|
|
200
|
+
setPhase(restore(attempt.wallet) ?? { step: "blocked" });
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const chainId2 = order2.chainId;
|
|
204
|
+
const tx = await getTransaction(config, { hash, chainId: chainId2 });
|
|
205
|
+
const expected = encodeFunctionData({
|
|
206
|
+
abi: erc20Abi,
|
|
207
|
+
functionName: "transfer",
|
|
208
|
+
args: [order2.recipient, order2.amount]
|
|
209
|
+
});
|
|
210
|
+
if (tx.from.toLowerCase() !== saved.wallet.toLowerCase() || tx.to?.toLowerCase() !== order2.token.address.toLowerCase() || tx.input.toLowerCase() !== expected.toLowerCase() || tx.value !== 0n)
|
|
211
|
+
throw new Error("Transaction does not match");
|
|
212
|
+
if (!saved.hash) {
|
|
213
|
+
attempt = { ...saved, candidateHash: hash };
|
|
214
|
+
saveSendAttempt(attempt);
|
|
215
|
+
}
|
|
216
|
+
const receipt = await getTransactionReceipt(config, { hash, chainId: chainId2 });
|
|
217
|
+
if (!saved.hash) {
|
|
218
|
+
const block = await getBlock(config, { blockHash: receipt.blockHash, chainId: chainId2 });
|
|
219
|
+
if (block.timestamp < BigInt(Math.floor(saved.timestamp / 1e3)) || listLocalSends(saved.wallet).some((row) => row.id.toLowerCase() === hash.toLowerCase()))
|
|
220
|
+
throw new Error("Transaction predates this attempt");
|
|
221
|
+
attempt = { wallet: saved.wallet, timestamp: saved.timestamp, data: saved.data, hash };
|
|
222
|
+
saveSendAttempt(attempt);
|
|
223
|
+
}
|
|
224
|
+
finish(attempt, order2, hash, receipt.status === "success");
|
|
225
|
+
});
|
|
226
|
+
} catch {
|
|
227
|
+
setPhase({
|
|
228
|
+
...phase,
|
|
229
|
+
attempt,
|
|
230
|
+
notice: "Unable to verify this transfer. Do not send again. Check the hash and try checking status later."
|
|
231
|
+
});
|
|
232
|
+
} finally {
|
|
233
|
+
busy.current = false;
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
return { phase, review, edit, switchNetwork, approve, reset, needsSwitch, reconcile };
|
|
237
|
+
}
|
|
238
|
+
function explicitWalletRefusal(error) {
|
|
239
|
+
let cause = error;
|
|
240
|
+
for (let depth = 0; depth < 8 && cause && typeof cause === "object"; depth++) {
|
|
241
|
+
if ("code" in cause && cause.code === 4001) return true;
|
|
242
|
+
cause = "cause" in cause ? cause.cause : null;
|
|
243
|
+
}
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
function recordSend(attempt, hash, status) {
|
|
247
|
+
return upsertLocalSend(attempt.wallet, {
|
|
248
|
+
id: hash,
|
|
249
|
+
type: "send",
|
|
250
|
+
timestamp: attempt.timestamp,
|
|
251
|
+
status,
|
|
252
|
+
data: { ...attempt.data, txHash: hash }
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
export {
|
|
256
|
+
useAddressSend
|
|
257
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { useMemo, useState, useEffect } from "react";
|
|
2
|
+
import { getPublicClient } from "@wagmi/core";
|
|
3
|
+
import { useConfig } from "wagmi";
|
|
4
|
+
import { toCoinType } from "viem";
|
|
5
|
+
import { resolveRecipient } from "../../lib/recipient/index.js";
|
|
6
|
+
const LOOKING = { status: "looking" };
|
|
7
|
+
const EMPTY = { status: "empty" };
|
|
8
|
+
function useRecipientDeps() {
|
|
9
|
+
const config = useConfig();
|
|
10
|
+
return useMemo(() => {
|
|
11
|
+
const clientFor = (chainId) => config.chains.some((chain) => chain.id === chainId) ? getPublicClient(config, { chainId }) : void 0;
|
|
12
|
+
const mainnetClient = clientFor(1);
|
|
13
|
+
return mainnetClient ? { mainnetClient, clientFor } : void 0;
|
|
14
|
+
}, [config]);
|
|
15
|
+
}
|
|
16
|
+
function useSendRecipient(input, chainId, attempt = 0) {
|
|
17
|
+
const deps = useRecipientDeps();
|
|
18
|
+
const [result, setResult] = useState();
|
|
19
|
+
const value = input.trim();
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!value) return;
|
|
22
|
+
const controller = new AbortController();
|
|
23
|
+
const { signal } = controller;
|
|
24
|
+
const publish = (lookup) => {
|
|
25
|
+
if (!signal.aborted) setResult({ input, chainId, deps, lookup, attempt });
|
|
26
|
+
};
|
|
27
|
+
const timer = setTimeout(() => {
|
|
28
|
+
void (async () => {
|
|
29
|
+
if (!deps) {
|
|
30
|
+
publish({ status: "unavailable", reason: "Lookup unavailable" });
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const lookup = await resolveRecipient(value, deps, signal);
|
|
34
|
+
const recipient = lookup.status === "resolved" ? lookup.recipient : void 0;
|
|
35
|
+
if (recipient?.kind !== "ens" || !recipient.address || !recipient.name || chainId === 1) {
|
|
36
|
+
publish(lookup);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
signal.throwIfAborted();
|
|
40
|
+
const chainAddress = await deps.mainnetClient.getEnsAddress({
|
|
41
|
+
name: recipient.name,
|
|
42
|
+
coinType: toCoinType(chainId)
|
|
43
|
+
}).catch(() => null);
|
|
44
|
+
publish({
|
|
45
|
+
...lookup,
|
|
46
|
+
networkMismatch: !!chainAddress && chainAddress.toLowerCase() !== recipient.address.toLowerCase()
|
|
47
|
+
});
|
|
48
|
+
})().catch(() => publish({ status: "unavailable", reason: "Lookup unavailable" }));
|
|
49
|
+
}, 250);
|
|
50
|
+
return () => {
|
|
51
|
+
clearTimeout(timer);
|
|
52
|
+
controller.abort();
|
|
53
|
+
};
|
|
54
|
+
}, [input, value, chainId, deps, attempt]);
|
|
55
|
+
if (!value) return EMPTY;
|
|
56
|
+
return result?.input === input && result.chainId === chainId && result.deps === deps && result.attempt === attempt ? result.lookup : LOOKING;
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
useRecipientDeps,
|
|
60
|
+
useSendRecipient
|
|
61
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { useAccount, useSwitchChain, useWalletClient, usePublicClient } from "wagmi";
|
|
4
|
+
import { BuyOnramp } from "../../ramp/peer/BuyOnramp.js";
|
|
5
|
+
import { RampRails } from "../../ramp/availability/RampRails.js";
|
|
6
|
+
import { ResumeOnramp } from "../../ramp/recovery/ResumeOnramp.js";
|
|
7
|
+
import { summaryResolved, rampOperationLive } from "../../ramp/recovery/summaries.js";
|
|
8
|
+
import { useRampSummaries } from "../../hooks/useRampSummaries.js";
|
|
9
|
+
import { useRampHostGate, RAMP_HOST_GATE_COPY } from "../../lib/rampHostGate.js";
|
|
10
|
+
function BuyPanel({ active, fiatCurrency, onConnectRequest }) {
|
|
11
|
+
const { address, chainId } = useAccount();
|
|
12
|
+
const { switchChain, isPending } = useSwitchChain();
|
|
13
|
+
const { data: wallet } = useWalletClient();
|
|
14
|
+
const publicClient = usePublicClient({ chainId: 8453 });
|
|
15
|
+
const summaries = useRampSummaries();
|
|
16
|
+
const me = address?.toLowerCase();
|
|
17
|
+
const [pinned, setPinned] = useState();
|
|
18
|
+
const gate = useRampHostGate();
|
|
19
|
+
const waiting = summaries.filter(
|
|
20
|
+
(row) => !summaryResolved(row) && !rampOperationLive(row.operation_id)
|
|
21
|
+
);
|
|
22
|
+
const candidate = waiting.find((row) => row.wallet === me) ?? waiting[0];
|
|
23
|
+
const kept = summaries.find((row) => row.operation_id === pinned && !row.abandoned);
|
|
24
|
+
const resume = kept ?? candidate;
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!kept && candidate?.operation_id !== pinned) setPinned(candidate?.operation_id);
|
|
27
|
+
}, [kept, candidate, pinned]);
|
|
28
|
+
const blocked = resume !== void 0 && !(resume.terminal && resume.operation_id === kept?.operation_id) && (resume.wallet === me || !resume.submitted);
|
|
29
|
+
return /* @__PURE__ */ jsxs("div", { className: "send-card", children: [
|
|
30
|
+
/* @__PURE__ */ jsx("h2", { className: "sr-only", children: "Buy" }),
|
|
31
|
+
address && chainId !== 8453 && /* @__PURE__ */ jsx("button", { type: "button", disabled: isPending, onClick: () => switchChain({ chainId: 8453 }), children: "Switch to Base" }),
|
|
32
|
+
resume && /* @__PURE__ */ jsx(
|
|
33
|
+
ResumeOnramp,
|
|
34
|
+
{
|
|
35
|
+
summary: resume,
|
|
36
|
+
connected: address,
|
|
37
|
+
wallet: chainId === 8453 ? wallet : void 0,
|
|
38
|
+
publicClient,
|
|
39
|
+
onDone: () => setPinned(void 0)
|
|
40
|
+
},
|
|
41
|
+
`${resume.operation_id}:${me ?? ""}`
|
|
42
|
+
),
|
|
43
|
+
blocked ? /* @__PURE__ */ jsx("p", { className: "ramp-resume__blocked", children: "Resolve the purchase above before starting another. Do not start another transfer for it." }) : gate !== "ready" ? /* @__PURE__ */ jsx("p", { className: "ramp-resume__blocked", role: "status", children: RAMP_HOST_GATE_COPY[gate] }) : /* @__PURE__ */ jsx(
|
|
44
|
+
RampRails,
|
|
45
|
+
{
|
|
46
|
+
direction: "onramp",
|
|
47
|
+
account: address,
|
|
48
|
+
fiatCurrency,
|
|
49
|
+
active,
|
|
50
|
+
onConnectRequest,
|
|
51
|
+
renderSelected: (intent, offer, lock) => /* @__PURE__ */ jsx(
|
|
52
|
+
BuyOnramp,
|
|
53
|
+
{
|
|
54
|
+
intent,
|
|
55
|
+
offer,
|
|
56
|
+
wallet: chainId === 8453 ? wallet : void 0,
|
|
57
|
+
publicClient,
|
|
58
|
+
connected: address,
|
|
59
|
+
onSubmit: () => lock(),
|
|
60
|
+
onReset: () => lock(false)
|
|
61
|
+
},
|
|
62
|
+
offer.capability_revision
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
BuyPanel
|
|
70
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useAccount, useWalletClient, usePublicClient } from "wagmi";
|
|
3
|
+
import { useRampSummaries } from "../../hooks/useRampSummaries.js";
|
|
4
|
+
import { ResumeOnramp } from "../../ramp/recovery/ResumeOnramp.js";
|
|
5
|
+
import { summaryBlocksNewPurchase, rampOperationLive } from "../../ramp/recovery/summaries.js";
|
|
6
|
+
import { PaymentAppSend } from "../../ramp/offramp/PaymentAppSend.js";
|
|
7
|
+
import { resumableOfframp } from "../../ramp/offramp/localOfframps.js";
|
|
8
|
+
function PurchaseRecovery() {
|
|
9
|
+
const { address, chainId } = useAccount();
|
|
10
|
+
const { data: wallet } = useWalletClient();
|
|
11
|
+
const publicClient = usePublicClient({ chainId: 8453 });
|
|
12
|
+
const me = address?.toLowerCase();
|
|
13
|
+
const row = useRampSummaries().find(
|
|
14
|
+
(r) => r.wallet === me && summaryBlocksNewPurchase(r) && !rampOperationLive(r.operation_id)
|
|
15
|
+
);
|
|
16
|
+
if (!row) return null;
|
|
17
|
+
return /* @__PURE__ */ jsx("section", { className: "send-card", "aria-label": "Purchase to recover", children: /* @__PURE__ */ jsx(
|
|
18
|
+
ResumeOnramp,
|
|
19
|
+
{
|
|
20
|
+
summary: row,
|
|
21
|
+
connected: address,
|
|
22
|
+
wallet: chainId === 8453 ? wallet : void 0,
|
|
23
|
+
publicClient,
|
|
24
|
+
onDone: () => {
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
`${row.operation_id}:${me ?? ""}`
|
|
28
|
+
) });
|
|
29
|
+
}
|
|
30
|
+
function CashOutRecovery({
|
|
31
|
+
items,
|
|
32
|
+
fiatCurrency,
|
|
33
|
+
active
|
|
34
|
+
}) {
|
|
35
|
+
if (!resumableOfframp(items)) return null;
|
|
36
|
+
return /* @__PURE__ */ jsx("section", { className: "send-card", "aria-label": "Cash-out to recover", children: /* @__PURE__ */ jsx(PaymentAppSend, { fiatCurrency, active }) });
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
CashOutRecovery,
|
|
40
|
+
PurchaseRecovery
|
|
41
|
+
};
|