@xochi/widget 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +76 -0
- package/LICENSE +21 -0
- package/README.md +420 -2
- package/THIRD_PARTY_NOTICES.txt +44 -0
- package/dist/ConfiguratorApp.js +19 -0
- package/dist/EmbedApp.js +57 -0
- package/dist/assets/MonaspaceArgon-Bold-D9kWRRK5.woff2 +0 -0
- package/dist/assets/MonaspaceArgon-Light-Dt_6qXbW.woff2 +0 -0
- package/dist/assets/MonaspaceArgon-Medium-B1gMZwrU.woff2 +0 -0
- package/dist/assets/MonaspaceArgon-Regular-RS-2TGNg.woff2 +0 -0
- package/dist/assets/MonaspaceArgon-SemiBold-PYusZXE_.woff2 +0 -0
- package/dist/assets/MonaspaceNeon-Italic-C9u9eioB.woff2 +0 -0
- package/dist/assets/MonaspaceNeon-Light-CJkxpyfT.woff2 +0 -0
- package/dist/assets/MonaspaceNeon-Medium-DCChELAx.woff2 +0 -0
- package/dist/assets/MonaspaceNeon-Regular-BZtV1wRa.woff2 +0 -0
- package/dist/assets/MonaspaceXenon-Bold-KacFhGOf.woff2 +0 -0
- package/dist/assets/MonaspaceXenon-Medium-Dqqg-cnL.woff2 +0 -0
- package/dist/assets/MonaspaceXenon-Regular-BRsdKART.woff2 +0 -0
- package/dist/assets/MonaspaceXenon-SemiBold-DNjPl3uE.woff2 +0 -0
- package/dist/assets/alipay-3tx9-HPp.svg +1 -0
- package/dist/assets/arb-CCfLcB_X.svg +7 -0
- package/dist/assets/arc-Dy98eSCd.svg +10 -0
- package/dist/assets/aztec-DiLp9qTG.svg +4 -0
- package/dist/assets/base-Ch0ino36.svg +4 -0
- package/dist/assets/cashapp-lOg0DIt8.svg +1 -0
- package/dist/assets/chains/arbitrum.svg.js +4 -0
- package/dist/assets/chains/arc.svg.js +4 -0
- package/dist/assets/chains/aztec.svg.js +4 -0
- package/dist/assets/chains/base.svg.js +4 -0
- package/dist/assets/chains/ethereum.svg.js +4 -0
- package/dist/assets/chains/gnosis.png.js +4 -0
- package/dist/assets/chains/index.js +31 -0
- package/dist/assets/chains/optimism.svg.js +4 -0
- package/dist/assets/chains/polygon.svg.js +4 -0
- package/dist/assets/chains/robinhood.svg.js +4 -0
- package/dist/assets/chains/tron.svg.js +4 -0
- package/dist/assets/chains/xochi.svg.js +4 -0
- package/dist/assets/dai-XuyZLceZ.png +0 -0
- package/dist/assets/defillama-BU037Unq.svg +1 -0
- package/dist/assets/defillama.svg.js +4 -0
- package/dist/assets/eth-Dvbng9UB.svg +8 -0
- package/dist/assets/eurc-NI9zNgOQ.png +0 -0
- package/dist/assets/eure-BH9vpwcv.png +0 -0
- package/dist/assets/gnosis-fRzAZQFj.png +0 -0
- package/dist/assets/mercadopago-gjsFb6F7.svg +1 -0
- package/dist/assets/monzo-B9XD4bL5.png +0 -0
- package/dist/assets/monzo-SZnIdUKN.svg +1 -0
- package/dist/assets/monzo-dark-Bwzg90UC.png +0 -0
- package/dist/assets/n26-cANcjY2T.svg +1 -0
- package/dist/assets/op-DF67SbB6.png +0 -0
- package/dist/assets/optimism-B3cTNxEQ.svg +4 -0
- package/dist/assets/paypal-D8xqXEtN.svg +1 -0
- package/dist/assets/pol-uLmSo2O8.svg +3 -0
- package/dist/assets/rails/SOURCES.md +50 -0
- package/dist/assets/rails/alipay.svg.js +4 -0
- package/dist/assets/rails/cashapp.svg.js +4 -0
- package/dist/assets/rails/index.js +59 -0
- package/dist/assets/rails/mercadopago.svg.js +4 -0
- package/dist/assets/rails/monzo-dark.png.js +4 -0
- package/dist/assets/rails/monzo.png.js +4 -0
- package/dist/assets/rails/monzo.svg.js +4 -0
- package/dist/assets/rails/n26.svg.js +4 -0
- package/dist/assets/rails/paypal.svg.js +4 -0
- package/dist/assets/rails/revolut-dark.png.js +4 -0
- package/dist/assets/rails/revolut.png.js +4 -0
- package/dist/assets/rails/revolut.svg.js +4 -0
- package/dist/assets/rails/venmo.svg.js +4 -0
- package/dist/assets/rails/wise-dark.png.js +4 -0
- package/dist/assets/rails/wise.png.js +4 -0
- package/dist/assets/rails/wise.svg.js +4 -0
- package/dist/assets/rails/xmoney.svg.js +4 -0
- package/dist/assets/rails/zelle.svg.js +4 -0
- package/dist/assets/raxol-86FmC34h.png +0 -0
- package/dist/assets/revolut-CiBtyALA.png +0 -0
- package/dist/assets/revolut-D7qr5Vzs.svg +1 -0
- package/dist/assets/revolut-dark-RQdWGM_p.png +0 -0
- package/dist/assets/robinhood-DgdGTQ1I.svg +8 -0
- package/dist/assets/tokens/arb.svg.js +4 -0
- package/dist/assets/tokens/dai.png.js +4 -0
- package/dist/assets/tokens/eth.svg.js +4 -0
- package/dist/assets/tokens/eurc.png.js +4 -0
- package/dist/assets/tokens/eure.png.js +4 -0
- package/dist/assets/tokens/index.js +36 -0
- package/dist/assets/tokens/op.png.js +4 -0
- package/dist/assets/tokens/pol.svg.js +4 -0
- package/dist/assets/tokens/raxol.png.js +4 -0
- package/dist/assets/tokens/usdc.png.js +4 -0
- package/dist/assets/tokens/usdg.png.js +4 -0
- package/dist/assets/tokens/usdt.png.js +4 -0
- package/dist/assets/tokens/wbtc.png.js +4 -0
- package/dist/assets/tokens/wsteth.png.js +4 -0
- package/dist/assets/tokens/zchf.png.js +4 -0
- package/dist/assets/tron-Dtumyzha.svg +4 -0
- package/dist/assets/usdc-UHSd0FoM.png +0 -0
- package/dist/assets/usdg-Cd5nCzbC.png +0 -0
- package/dist/assets/usdt-3G3YdPq8.png +0 -0
- package/dist/assets/venmo-CMHeCn-D.svg +1 -0
- package/dist/assets/wbtc-CV8uE44Q.png +0 -0
- package/dist/assets/wise-BUOflsWL.svg +1 -0
- package/dist/assets/wise-JLpDvCdq.png +0 -0
- package/dist/assets/wise-dark-_Q8pbCom.png +0 -0
- package/dist/assets/wsteth-BamwtTCR.png +0 -0
- package/dist/assets/xmoney-CwY9KVlD.svg +1 -0
- package/dist/assets/xochi-DL2f8G4R.svg +4 -0
- package/dist/assets/zchf-BLBNdTGJ.png +0 -0
- package/dist/assets/zelle-t15cG4SB.svg +1 -0
- package/dist/browser.js +4 -0
- package/dist/components/AccountChip.js +29 -0
- package/dist/components/ActivityFeed.js +710 -0
- package/dist/components/AssetsStrip.js +133 -0
- package/dist/components/AuthorizedAgents.js +197 -0
- package/dist/components/Chevron.js +22 -0
- package/dist/components/ErrorDisplay.js +66 -0
- package/dist/components/InfoButton.js +27 -0
- package/dist/components/IntentTimeline.js +202 -0
- package/dist/components/LinksSignIn.js +26 -0
- package/dist/components/MobileSigningBanner.js +44 -0
- package/dist/components/PrivacyBars.js +44 -0
- package/dist/components/PrivacyPanel.js +99 -0
- package/dist/components/QuoteDetails.js +327 -0
- package/dist/components/ReceiptCommand.js +46 -0
- package/dist/components/SessionReloadBanner.js +19 -0
- package/dist/components/SolverRace.js +62 -0
- package/dist/components/StealthClaims.js +179 -0
- package/dist/components/SwapFlowModal.js +398 -0
- package/dist/components/Toast.js +40 -0
- package/dist/components/TokenIcon.js +21 -0
- package/dist/components/TokenSearchModal.js +331 -0
- package/dist/components/TransactionPreview.js +207 -0
- package/dist/components/WalletProvider.js +41 -0
- package/dist/components/WrapModal.js +192 -0
- package/dist/components/swap-flow/CantonEscrowPanel.js +28 -0
- package/dist/components/swap-flow/CantonEscrowStatus.js +160 -0
- package/dist/components/swap-flow/DepositInstructions.js +156 -0
- package/dist/components/swap-flow/QrCode.js +22 -0
- package/dist/components/swap-flow/SwapResult.js +323 -0
- package/dist/components/swap-flow/depositScreen.js +36 -0
- package/dist/components/widgetTabsContext.js +17 -0
- package/dist/config.js +132 -0
- package/dist/configurator-model.js +71 -0
- package/dist/configurator.js +11 -0
- package/dist/constants.js +53 -0
- package/dist/hooks/applyTheme.js +10 -0
- package/dist/hooks/useAgentRegistry.js +28 -0
- package/dist/hooks/useAgentStream.js +89 -0
- package/dist/hooks/useCantonEscrow.js +89 -0
- package/dist/hooks/useCapabilities.js +86 -0
- package/dist/hooks/useEmbedLook.js +23 -0
- package/dist/hooks/useFocusTrap.js +44 -0
- package/dist/hooks/useIntent.js +435 -0
- package/dist/hooks/useIntentStatusPoll.js +71 -0
- package/dist/hooks/useIntentStream.js +95 -0
- package/dist/hooks/useLocalActivity.js +114 -0
- package/dist/hooks/useLocalSends.js +15 -0
- package/dist/hooks/useLocalStorage.js +26 -0
- package/dist/hooks/useOrderHistory.js +307 -0
- package/dist/hooks/usePermit.js +131 -0
- package/dist/hooks/usePrices.js +49 -0
- package/dist/hooks/usePublicBalances.js +186 -0
- package/dist/hooks/useRampSummaries.js +19 -0
- package/dist/hooks/useRecipientBalance.js +98 -0
- package/dist/hooks/useSettlements.js +33 -0
- package/dist/hooks/useStealth.js +324 -0
- package/dist/hooks/useStealthClaim.js +183 -0
- package/dist/hooks/useStealthScanner.js +259 -0
- package/dist/hooks/useTheme.js +48 -0
- package/dist/hooks/useTierInfo.js +20 -0
- package/dist/hooks/useTrustScore.js +16 -0
- package/dist/hooks/useWalletSession.js +70 -0
- package/dist/hooks/useWrapEth.js +60 -0
- package/dist/index.js +41 -0
- package/dist/integration.js +19 -0
- package/dist/lib/activityValue.js +20 -0
- package/dist/lib/agentConnect.js +11 -0
- package/dist/lib/agentRegistry.js +83 -0
- package/dist/lib/agentStreamVerify.js +47 -0
- package/dist/lib/api.js +67 -0
- package/dist/lib/auth.js +8 -0
- package/dist/lib/authFetch.js +33 -0
- package/dist/lib/aztecTokens.js +13 -0
- package/dist/lib/balances.js +77 -0
- package/dist/lib/capabilities.js +40 -0
- package/dist/lib/claimSubmitPoll.js +63 -0
- package/dist/lib/debug.js +7 -0
- package/dist/lib/declineGuidance.js +31 -0
- package/dist/lib/displayFallbacks.js +25 -0
- package/dist/lib/eip712.js +38 -0
- package/dist/lib/errorCategory.js +200 -0
- package/dist/lib/errorReport.js +19 -0
- package/dist/lib/explorerLinks.js +30 -0
- package/dist/lib/feesLabel.js +19 -0
- package/dist/lib/glyphs.js +58 -0
- package/dist/lib/hostBridge.js +41 -0
- package/dist/lib/hostOrigin.js +52 -0
- package/dist/lib/intentAPI.js +39 -0
- package/dist/lib/linksSignIn.js +9 -0
- package/dist/lib/localActivity.js +247 -0
- package/dist/lib/localSends.js +129 -0
- package/dist/lib/mobileWallet.js +17 -0
- package/dist/lib/pairAvailability.js +29 -0
- package/dist/lib/paymentSummary.js +23 -0
- package/dist/lib/permits.js +27 -0
- package/dist/lib/priceImpact.js +101 -0
- package/dist/lib/providers.js +124 -0
- package/dist/lib/qr.js +20 -0
- package/dist/lib/quoteCost.js +34 -0
- package/dist/lib/quoteCountdown.js +24 -0
- package/dist/lib/rampHostGate.js +24 -0
- package/dist/lib/rampLifecycle.js +63 -0
- package/dist/lib/receiptCost.js +64 -0
- package/dist/lib/recipient/index.js +302 -0
- package/dist/lib/recipient/recent.js +47 -0
- package/dist/lib/recipientReceipt.js +16 -0
- package/dist/lib/reportClient.js +32 -0
- package/dist/lib/sessionExpiry.js +11 -0
- package/dist/lib/settlementAvailability.js +34 -0
- package/dist/lib/stealth.js +110 -0
- package/dist/lib/swapFlowPhase.js +52 -0
- package/dist/lib/swapStatusCopy.js +59 -0
- package/dist/lib/tradeLifecycle.js +40 -0
- package/dist/lib/tronlink.js +71 -0
- package/dist/lib/walletSession.js +87 -0
- package/dist/pages/Configurator.js +390 -0
- package/dist/pages/Trade.js +635 -0
- package/dist/pages/configurator/AllowedAssetsSection.js +98 -0
- package/dist/pages/configurator/AppearanceSection.js +44 -0
- package/dist/pages/configurator/CodeDock.js +140 -0
- package/dist/pages/configurator/DeveloperSection.js +40 -0
- package/dist/pages/configurator/IntegrationSection.js +105 -0
- package/dist/pages/configurator/LayoutSection.js +83 -0
- package/dist/pages/configurator/PolicyNote.js +7 -0
- package/dist/pages/configurator/PreviewStage.js +165 -0
- package/dist/pages/configurator/PrivacySection.js +54 -0
- package/dist/pages/configurator/RouteSection.js +211 -0
- package/dist/pages/configurator/Settings.js +35 -0
- package/dist/pages/configurator/SharedLinkBanner.js +25 -0
- package/dist/pages/configurator/SurfaceSection.js +124 -0
- package/dist/pages/configurator/WhatUsersSee.js +268 -0
- package/dist/pages/configurator/codeShown.js +8 -0
- package/dist/pages/configurator/configuratorUrl.js +33 -0
- package/dist/pages/configurator/paramsDraft.js +82 -0
- package/dist/pages/configurator/previewModel.js +10 -0
- package/dist/pages/configurator/previewQuote.js +109 -0
- package/dist/pages/configurator/routePicks.js +131 -0
- package/dist/pages/configurator/snippets.js +98 -0
- package/dist/pages/configurator/surfaceParams.js +51 -0
- package/dist/pages/configurator/useCodeCheck.js +79 -0
- package/dist/pages/configurator/useConfiguratorUrl.js +24 -0
- package/dist/pages/configurator/useMediaQuery.js +20 -0
- package/dist/pages/configurator/useParamsDraft.js +33 -0
- package/dist/pages/configurator/usePreviewFee.js +100 -0
- package/dist/pages/send/MetaAddressValue.js +28 -0
- package/dist/pages/send/Receive.js +168 -0
- package/dist/pages/send/RecentRecipients.js +23 -0
- package/dist/pages/send/RecipientChip.js +26 -0
- package/dist/pages/send/ScanRecipient.js +85 -0
- package/dist/pages/send/SendForm.js +516 -0
- package/dist/pages/send/SendPanel.js +30 -0
- package/dist/pages/send/ShieldedDisclosure.js +12 -0
- package/dist/pages/send/StealthInvite.js +27 -0
- package/dist/pages/send/addressSend.js +92 -0
- package/dist/pages/send/sendCopy.js +10 -0
- package/dist/pages/send/sendRetry.js +24 -0
- package/dist/pages/send/stealthRecipient.js +65 -0
- package/dist/pages/send/stealthSend.js +15 -0
- package/dist/pages/send/useAddressSend.js +257 -0
- package/dist/pages/send/useSendRecipient.js +61 -0
- package/dist/pages/trade/BuyPanel.js +70 -0
- package/dist/pages/trade/RampRecovery.js +41 -0
- package/dist/pages/trade/RecipientSheet.js +182 -0
- package/dist/pages/trade/Selectors.js +152 -0
- package/dist/pages/trade/SwapPanel.js +971 -0
- package/dist/pages/trade/WidgetTabs.js +109 -0
- package/dist/pages/trade/canton.js +122 -0
- package/dist/pages/trade/config.js +70 -0
- package/dist/pages/trade/embedNarrowing.js +25 -0
- package/dist/pages/trade/embedParams.js +532 -0
- package/dist/pages/trade/embedTheme.js +9 -0
- package/dist/pages/trade/orderMinimum.js +8 -0
- package/dist/pages/trade/resumeSwap.js +55 -0
- package/dist/pages/trade/settlementCopy.js +32 -0
- package/dist/pages/trade/useAmountFit.js +31 -0
- package/dist/pages/trade/useEmbedDefaults.js +18 -0
- package/dist/pages/trade/useSettlementGating.js +289 -0
- package/dist/pages/trade/useSwapAmount.js +191 -0
- package/dist/pages/trade/useSwapFlow.js +511 -0
- package/dist/pages/trade/useSwapPanel.js +475 -0
- package/dist/pages/trade/useSwapRoute.js +634 -0
- package/dist/pages/trade/useTronLinkFill.js +34 -0
- package/dist/pages/trade/zkMoney.js +46 -0
- package/dist/promiseWithResolvers.js +20 -0
- package/dist/ramp/availability/RailTiles.js +156 -0
- package/dist/ramp/availability/RampDisclosure.js +38 -0
- package/dist/ramp/availability/RampRails.js +170 -0
- package/dist/ramp/availability/model.js +207 -0
- package/dist/ramp/availability/useRampDiscovery.js +83 -0
- package/dist/ramp/offramp/CompletedPrerequisite.js +23 -0
- package/dist/ramp/offramp/OfframpActivityList.js +16 -0
- package/dist/ramp/offramp/OfframpRoute.js +222 -0
- package/dist/ramp/offramp/OfframpRouteReview.js +94 -0
- package/dist/ramp/offramp/PaymentAppSend.js +765 -0
- package/dist/ramp/offramp/localOfframps.js +101 -0
- package/dist/ramp/offramp/model.js +154 -0
- package/dist/ramp/offramp/port.js +134 -0
- package/dist/ramp/offramp/prerequisite.js +143 -0
- package/dist/ramp/offramp/useOfframp.js +505 -0
- package/dist/ramp/offramp/useOfframpRails.js +73 -0
- package/dist/ramp/peer/BuyOnramp.js +292 -0
- package/dist/ramp/peer/OnrampSteps.js +148 -0
- package/dist/ramp/peer/buyerDriver.js +461 -0
- package/dist/ramp/peer/discovery.js +231 -0
- package/dist/ramp/peer/environment.js +7 -0
- package/dist/ramp/peer/liveProvider.js +87 -0
- package/dist/ramp/peer/liveReads.js +488 -0
- package/dist/ramp/peer/maker.js +92 -0
- package/dist/ramp/peer/normalization.js +184 -0
- package/dist/ramp/peer/offramp.js +648 -0
- package/dist/ramp/peer/onramp.js +353 -0
- package/dist/ramp/peer/preview.js +52 -0
- package/dist/ramp/peer/protectedMapping.js +67 -0
- package/dist/ramp/peer/runtime.js +55 -0
- package/dist/ramp/peer/sdkMaker.js +107 -0
- package/dist/ramp/recovery/ResumeOnramp.js +153 -0
- package/dist/ramp/recovery/summaries.js +173 -0
- package/dist/ramp/route/OnrampRoute.js +255 -0
- package/dist/ramp/route/RampRouteSteps.js +148 -0
- package/dist/ramp/route/routeActivity.js +12 -0
- package/dist/ramp/route/useXochiRampDriver.js +203 -0
- package/dist/styles.css +17448 -0
- package/dist/styles.js +2 -0
- package/dist/types/ConfiguratorApp.d.ts +6 -0
- package/dist/types/EmbedApp.d.ts +2 -0
- package/dist/types/activity.js +50 -0
- package/dist/types/asset.d.ts +2 -0
- package/dist/types/assets/chains/index.d.ts +3 -0
- package/dist/types/assets/rails/index.d.ts +12 -0
- package/dist/types/assets/tokens/index.d.ts +1 -0
- package/dist/types/browser.d.ts +1 -0
- package/dist/types/components/AccountChip.d.ts +10 -0
- package/dist/types/components/ActivityFeed.d.ts +46 -0
- package/dist/types/components/AssetsStrip.d.ts +14 -0
- package/dist/types/components/AuthorizedAgents.d.ts +15 -0
- package/dist/types/components/Chevron.d.ts +16 -0
- package/dist/types/components/ErrorDisplay.d.ts +44 -0
- package/dist/types/components/InfoButton.d.ts +6 -0
- package/dist/types/components/IntentTimeline.d.ts +41 -0
- package/dist/types/components/LinksSignIn.d.ts +13 -0
- package/dist/types/components/MobileSigningBanner.d.ts +16 -0
- package/dist/types/components/PermitBadge.d.ts +17 -0
- package/dist/types/components/PrivacyBars.d.ts +12 -0
- package/dist/types/components/PrivacyPanel.d.ts +33 -0
- package/dist/types/components/QuoteDetails.d.ts +56 -0
- package/dist/types/components/RampActivityList.d.ts +14 -0
- package/dist/types/components/ReceiptCommand.d.ts +12 -0
- package/dist/types/components/SessionReloadBanner.d.ts +8 -0
- package/dist/types/components/SolverRace.d.ts +35 -0
- package/dist/types/components/StealthClaims.d.ts +51 -0
- package/dist/types/components/SwapFlowModal.d.ts +138 -0
- package/dist/types/components/Toast.d.ts +10 -0
- package/dist/types/components/TokenIcon.d.ts +17 -0
- package/dist/types/components/TokenSearchModal.d.ts +28 -0
- package/dist/types/components/TransactionPreview.d.ts +34 -0
- package/dist/types/components/WalletProvider.d.ts +12 -0
- package/dist/types/components/WrapModal.d.ts +19 -0
- package/dist/types/components/swap-flow/CantonEscrowPanel.d.ts +14 -0
- package/dist/types/components/swap-flow/CantonEscrowStatus.d.ts +30 -0
- package/dist/types/components/swap-flow/DepositInstructions.d.ts +75 -0
- package/dist/types/components/swap-flow/QrCode.d.ts +18 -0
- package/dist/types/components/swap-flow/SwapResult.d.ts +66 -0
- package/dist/types/components/swap-flow/depositScreen.d.ts +67 -0
- package/dist/types/components/widgetTabsContext.d.ts +21 -0
- package/dist/types/config.d.ts +104 -0
- package/dist/types/configurator-model.d.ts +9 -0
- package/dist/types/configurator.d.ts +3 -0
- package/dist/types/constants.d.ts +52 -0
- package/dist/types/hooks/applyTheme.d.ts +7 -0
- package/dist/types/hooks/useAgentRegistry.d.ts +13 -0
- package/dist/types/hooks/useAgentStream.d.ts +15 -0
- package/dist/types/hooks/useCantonEscrow.d.ts +40 -0
- package/dist/types/hooks/useCapabilities.d.ts +83 -0
- package/dist/types/hooks/useEmbedLook.d.ts +4 -0
- package/dist/types/hooks/useFocusTrap.d.ts +7 -0
- package/dist/types/hooks/useIntent.d.ts +156 -0
- package/dist/types/hooks/useIntentStatusPoll.d.ts +107 -0
- package/dist/types/hooks/useIntentStream.d.ts +34 -0
- package/dist/types/hooks/useLocalActivity.d.ts +22 -0
- package/dist/types/hooks/useLocalSends.d.ts +8 -0
- package/dist/types/hooks/useLocalStorage.d.ts +8 -0
- package/dist/types/hooks/useOrderHistory.d.ts +52 -0
- package/dist/types/hooks/usePermit.d.ts +84 -0
- package/dist/types/hooks/usePrices.d.ts +72 -0
- package/dist/types/hooks/usePublicBalances.d.ts +19 -0
- package/dist/types/hooks/useRampSummaries.d.ts +9 -0
- package/dist/types/hooks/useRecipientBalance.d.ts +58 -0
- package/dist/types/hooks/useSettlements.d.ts +14 -0
- package/dist/types/hooks/useStealth.d.ts +72 -0
- package/dist/types/hooks/useStealthClaim.d.ts +96 -0
- package/dist/types/hooks/useStealthScanner.d.ts +44 -0
- package/dist/types/hooks/useTheme.d.ts +29 -0
- package/dist/types/hooks/useTierInfo.d.ts +23 -0
- package/dist/types/hooks/useTrustScore.d.ts +16 -0
- package/dist/types/hooks/useWalletSession.d.ts +21 -0
- package/dist/types/hooks/useWrapEth.d.ts +21 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.js +8 -0
- package/dist/types/integration.d.ts +9 -0
- package/dist/types/intent.js +85 -0
- package/dist/types/lib/activityValue.d.ts +16 -0
- package/dist/types/lib/agentConnect.d.ts +23 -0
- package/dist/types/lib/agentRegistry.d.ts +47 -0
- package/dist/types/lib/agentStreamVerify.d.ts +29 -0
- package/dist/types/lib/api.d.ts +41 -0
- package/dist/types/lib/auth.d.ts +6 -0
- package/dist/types/lib/authFetch.d.ts +14 -0
- package/dist/types/lib/aztecTokens.d.ts +15 -0
- package/dist/types/lib/balances.d.ts +88 -0
- package/dist/types/lib/capabilities.d.ts +3 -0
- package/dist/types/lib/claimSubmitPoll.d.ts +114 -0
- package/dist/types/lib/debug.d.ts +13 -0
- package/dist/types/lib/declineGuidance.d.ts +55 -0
- package/dist/types/lib/displayFallbacks.d.ts +7 -0
- package/dist/types/lib/eip712.d.ts +61 -0
- package/dist/types/lib/errorCategory.d.ts +48 -0
- package/dist/types/lib/errorReport.d.ts +15 -0
- package/dist/types/lib/explorerLinks.d.ts +67 -0
- package/dist/types/lib/feesLabel.d.ts +20 -0
- package/dist/types/lib/glyphs.d.ts +52 -0
- package/dist/types/lib/hostBridge.d.ts +11 -0
- package/dist/types/lib/hostOrigin.d.ts +30 -0
- package/dist/types/lib/intentAPI.d.ts +15 -0
- package/dist/types/lib/linksSignIn.d.ts +13 -0
- package/dist/types/lib/localActivity.d.ts +135 -0
- package/dist/types/lib/localSends.d.ts +55 -0
- package/dist/types/lib/mobileWallet.d.ts +27 -0
- package/dist/types/lib/pairAvailability.d.ts +106 -0
- package/dist/types/lib/paymentSummary.d.ts +18 -0
- package/dist/types/lib/permits.d.ts +25 -0
- package/dist/types/lib/priceImpact.d.ts +165 -0
- package/dist/types/lib/providers.d.ts +14 -0
- package/dist/types/lib/qr.d.ts +19 -0
- package/dist/types/lib/quoteCost.d.ts +45 -0
- package/dist/types/lib/quoteCountdown.d.ts +34 -0
- package/dist/types/lib/rampHostGate.d.ts +15 -0
- package/dist/types/lib/rampLifecycle.d.ts +20 -0
- package/dist/types/lib/receiptCost.d.ts +64 -0
- package/dist/types/lib/recipient/index.d.ts +33 -0
- package/dist/types/lib/recipient/recent.d.ts +5 -0
- package/dist/types/lib/recipientReceipt.d.ts +25 -0
- package/dist/types/lib/reportClient.d.ts +9 -0
- package/dist/types/lib/sessionExpiry.d.ts +11 -0
- package/dist/types/lib/settlementAvailability.d.ts +61 -0
- package/dist/types/lib/stealth.d.ts +75 -0
- package/dist/types/lib/swapFlowPhase.d.ts +76 -0
- package/dist/types/lib/swapStatusCopy.d.ts +57 -0
- package/dist/types/lib/tierProgressDisplay.d.ts +35 -0
- package/dist/types/lib/tierUnlock.d.ts +25 -0
- package/dist/types/lib/tradeLifecycle.d.ts +32 -0
- package/dist/types/lib/tronlink.d.ts +62 -0
- package/dist/types/lib/walletSession.d.ts +38 -0
- package/dist/types/pages/Configurator.d.ts +25 -0
- package/dist/types/pages/Trade.d.ts +36 -0
- package/dist/types/pages/configurator/AllowedAssetsSection.d.ts +17 -0
- package/dist/types/pages/configurator/AppearanceSection.d.ts +22 -0
- package/dist/types/pages/configurator/CodeDock.d.ts +19 -0
- package/dist/types/pages/configurator/DeveloperSection.d.ts +12 -0
- package/dist/types/pages/configurator/IntegrationSection.d.ts +20 -0
- package/dist/types/pages/configurator/LayoutSection.d.ts +20 -0
- package/dist/types/pages/configurator/PolicyNote.d.ts +6 -0
- package/dist/types/pages/configurator/PreviewStage.d.ts +22 -0
- package/dist/types/pages/configurator/PrivacySection.d.ts +16 -0
- package/dist/types/pages/configurator/RouteSection.d.ts +30 -0
- package/dist/types/pages/configurator/Settings.d.ts +25 -0
- package/dist/types/pages/configurator/SharedLinkBanner.d.ts +16 -0
- package/dist/types/pages/configurator/SurfaceSection.d.ts +5 -0
- package/dist/types/pages/configurator/WhatUsersSee.d.ts +30 -0
- package/dist/types/pages/configurator/codeShown.d.ts +15 -0
- package/dist/types/pages/configurator/configuratorUrl.d.ts +38 -0
- package/dist/types/pages/configurator/paramsDraft.d.ts +32 -0
- package/dist/types/pages/configurator/previewModel.d.ts +20 -0
- package/dist/types/pages/configurator/previewQuote.d.ts +96 -0
- package/dist/types/pages/configurator/routePicks.d.ts +75 -0
- package/dist/types/pages/configurator/snippets.d.ts +23 -0
- package/dist/types/pages/configurator/surfaceParams.d.ts +9 -0
- package/dist/types/pages/configurator/useCodeCheck.d.ts +56 -0
- package/dist/types/pages/configurator/useConfiguratorUrl.d.ts +21 -0
- package/dist/types/pages/configurator/useMediaQuery.d.ts +5 -0
- package/dist/types/pages/configurator/useParamsDraft.d.ts +29 -0
- package/dist/types/pages/configurator/usePreviewFee.d.ts +74 -0
- package/dist/types/pages/send/MetaAddressValue.d.ts +9 -0
- package/dist/types/pages/send/Receive.d.ts +3 -0
- package/dist/types/pages/send/RecentRecipients.d.ts +3 -0
- package/dist/types/pages/send/RecipientChip.d.ts +4 -0
- package/dist/types/pages/send/ScanRecipient.d.ts +3 -0
- package/dist/types/pages/send/SendForm.d.ts +17 -0
- package/dist/types/pages/send/SendPanel.d.ts +19 -0
- package/dist/types/pages/send/ShieldedDisclosure.d.ts +1 -0
- package/dist/types/pages/send/StealthInvite.d.ts +1 -0
- package/dist/types/pages/send/addressSend.d.ts +62 -0
- package/dist/types/pages/send/sendCopy.d.ts +9 -0
- package/dist/types/pages/send/sendRetry.d.ts +10 -0
- package/dist/types/pages/send/stealthRecipient.d.ts +37 -0
- package/dist/types/pages/send/stealthSend.d.ts +18 -0
- package/dist/types/pages/send/useAddressSend.d.ts +61 -0
- package/dist/types/pages/send/useSendRecipient.d.ts +13 -0
- package/dist/types/pages/trade/BuyPanel.d.ts +22 -0
- package/dist/types/pages/trade/RampRecovery.d.ts +22 -0
- package/dist/types/pages/trade/RecipientSheet.d.ts +11 -0
- package/dist/types/pages/trade/Selectors.d.ts +24 -0
- package/dist/types/pages/trade/SwapPanel.d.ts +34 -0
- package/dist/types/pages/trade/WidgetTabs.d.ts +46 -0
- package/dist/types/pages/trade/canton.d.ts +94 -0
- package/dist/types/pages/trade/config.d.ts +185 -0
- package/dist/types/pages/trade/embedNarrowing.d.ts +28 -0
- package/dist/types/pages/trade/embedParams.d.ts +299 -0
- package/dist/types/pages/trade/embedTheme.d.ts +14 -0
- package/dist/types/pages/trade/harness.d.ts +120 -0
- package/dist/types/pages/trade/orderMinimum.d.ts +5 -0
- package/dist/types/pages/trade/resumeSwap.d.ts +139 -0
- package/dist/types/pages/trade/settlementCopy.d.ts +42 -0
- package/dist/types/pages/trade/useAmountFit.d.ts +25 -0
- package/dist/types/pages/trade/useEmbedDefaults.d.ts +28 -0
- package/dist/types/pages/trade/useSettlementGating.d.ts +152 -0
- package/dist/types/pages/trade/useSwapAmount.d.ts +93 -0
- package/dist/types/pages/trade/useSwapFlow.d.ts +152 -0
- package/dist/types/pages/trade/useSwapPanel.d.ts +170 -0
- package/dist/types/pages/trade/useSwapRoute.d.ts +215 -0
- package/dist/types/pages/trade/useTronLinkFill.d.ts +13 -0
- package/dist/types/pages/trade/zkMoney.d.ts +28 -0
- package/dist/types/promiseWithResolvers.d.ts +12 -0
- package/dist/types/ramp/availability/RailTiles.d.ts +26 -0
- package/dist/types/ramp/availability/RampDisclosure.d.ts +9 -0
- package/dist/types/ramp/availability/RampRails.d.ts +27 -0
- package/dist/types/ramp/availability/model.d.ts +51 -0
- package/dist/types/ramp/availability/useRampDiscovery.d.ts +60 -0
- package/dist/types/ramp/offramp/CompletedPrerequisite.d.ts +5 -0
- package/dist/types/ramp/offramp/OfframpActivityList.d.ts +12 -0
- package/dist/types/ramp/offramp/OfframpRoute.d.ts +8 -0
- package/dist/types/ramp/offramp/OfframpRouteReview.d.ts +12 -0
- package/dist/types/ramp/offramp/PaymentAppSend.d.ts +27 -0
- package/dist/types/ramp/offramp/localOfframps.d.ts +58 -0
- package/dist/types/ramp/offramp/model.d.ts +46 -0
- package/dist/types/ramp/offramp/port.d.ts +55 -0
- package/dist/types/ramp/offramp/prerequisite.d.ts +271 -0
- package/dist/types/ramp/offramp/useOfframp.d.ts +87 -0
- package/dist/types/ramp/offramp/useOfframpRails.d.ts +36 -0
- package/dist/types/ramp/peer/BuyOnramp.d.ts +21 -0
- package/dist/types/ramp/peer/OnrampSteps.d.ts +32 -0
- package/dist/types/ramp/peer/buyerDriver.d.ts +48 -0
- package/dist/types/ramp/peer/discovery.d.ts +17 -0
- package/dist/types/ramp/peer/environment.d.ts +2 -0
- package/dist/types/ramp/peer/index.d.ts +14 -0
- package/dist/types/ramp/peer/liveProvider.d.ts +15 -0
- package/dist/types/ramp/peer/liveReads.d.ts +102 -0
- package/dist/types/ramp/peer/maker.d.ts +4 -0
- package/dist/types/ramp/peer/normalization.d.ts +33 -0
- package/dist/types/ramp/peer/offramp.d.ts +130 -0
- package/dist/types/ramp/peer/onramp.d.ts +134 -0
- package/dist/types/ramp/peer/preview.d.ts +14 -0
- package/dist/types/ramp/peer/protectedMapping.d.ts +22 -0
- package/dist/types/ramp/peer/runtime.d.ts +15 -0
- package/dist/types/ramp/peer/sdkMaker.d.ts +67 -0
- package/dist/types/ramp/peer/types.d.ts +64 -0
- package/dist/types/ramp/recovery/ResumeOnramp.d.ts +37 -0
- package/dist/types/ramp/recovery/summaries.d.ts +71 -0
- package/dist/types/ramp/route/OnrampRoute.d.ts +12 -0
- package/dist/types/ramp/route/RampRouteSteps.d.ts +16 -0
- package/dist/types/ramp/route/routeActivity.d.ts +4 -0
- package/dist/types/ramp/route/useXochiRampDriver.d.ts +22 -0
- package/dist/types/result.js +14 -0
- package/dist/types/styles.d.ts +1 -0
- package/dist/types/types/activity.d.ts +184 -0
- package/dist/types/types/index.d.ts +20 -0
- package/dist/types/types/intent.d.ts +85 -0
- package/dist/types/types/result.d.ts +53 -0
- package/dist/types/utils/format.d.ts +88 -0
- package/dist/types/wagmi.d.ts +142 -0
- package/dist/types/widgetLibModule.d.ts +8 -0
- package/dist/utils/format.js +109 -0
- package/dist/wagmi.js +188 -0
- package/dist/widgetLibModule.js +4 -0
- package/licenses/Monaspace-OFL-1.1.txt +93 -0
- package/licenses/assets.json +132 -0
- package/licenses/rainbowkit-MIT.txt +9 -0
- package/licenses/xochi-shared-MIT.txt +21 -0
- package/package.json +115 -4
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { parseEventLogs, type Hex, type PublicClient, type WalletClient } from "viem";
|
|
2
|
+
import type { PeerDiscoveryOptions } from "./types.js";
|
|
3
|
+
import type { PeerBuyerDriver } from "./onramp.js";
|
|
4
|
+
declare function termsDigest(facts: {
|
|
5
|
+
owner: string;
|
|
6
|
+
to: string;
|
|
7
|
+
escrow: string;
|
|
8
|
+
depositId: bigint;
|
|
9
|
+
amount: bigint;
|
|
10
|
+
conversionRate: bigint;
|
|
11
|
+
paymentMethod: string;
|
|
12
|
+
fiatCurrency: string;
|
|
13
|
+
}): string;
|
|
14
|
+
/** A receipt must contain the exact reviewed USDC amount paid to this recipient. */
|
|
15
|
+
export declare function peerRecipientTransfer(logs: Parameters<typeof parseEventLogs>[0]["logs"], token: string, recipient: string, amount: bigint, from?: string): boolean;
|
|
16
|
+
interface PeerIndexedBuyerIntent {
|
|
17
|
+
owner: string;
|
|
18
|
+
toAddress: string;
|
|
19
|
+
orchestratorAddress: string;
|
|
20
|
+
paymentMethodHash?: string | null;
|
|
21
|
+
fiatCurrency: string;
|
|
22
|
+
signalTimestamp: string;
|
|
23
|
+
amount: string;
|
|
24
|
+
conversionRate: string;
|
|
25
|
+
depositId: string;
|
|
26
|
+
intentHash: string;
|
|
27
|
+
signalTxHash: string;
|
|
28
|
+
fulfillTxHash?: string | null;
|
|
29
|
+
status: string;
|
|
30
|
+
}
|
|
31
|
+
type PeerChainBuyerIntent = Parameters<typeof termsDigest>[0] & {
|
|
32
|
+
payeeId: Hex;
|
|
33
|
+
timestamp: bigint;
|
|
34
|
+
};
|
|
35
|
+
/** SDK wallet writes are prepared separately, then submitted through the connected wallet. */
|
|
36
|
+
export declare function createPeerBuyerDriver(options: PeerDiscoveryOptions & {
|
|
37
|
+
wallet: WalletClient;
|
|
38
|
+
publicClient: PublicClient;
|
|
39
|
+
/** Protected correlation storage; never part of public summaries or events. */
|
|
40
|
+
resumeStorage?: Pick<Storage, "getItem" | "setItem">;
|
|
41
|
+
/** Trusted read ports for deterministic recovery tests. */
|
|
42
|
+
resumeReads?: {
|
|
43
|
+
ownerIntents(): Promise<PeerIndexedBuyerIntent[]>;
|
|
44
|
+
intent(hash: Hex): Promise<PeerChainBuyerIntent>;
|
|
45
|
+
payee(id: string, rail: string): Promise<string | undefined>;
|
|
46
|
+
};
|
|
47
|
+
}): PeerBuyerDriver;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type NormalizedPeerQuote } from "./normalization.js";
|
|
2
|
+
import type { PeerConfiguration, PeerDiscoveryOptions, PeerDiscoveryReads, PeerDiscoveryResult } from "./types.js";
|
|
3
|
+
/** Fixed public cancellation error; never forwards AbortSignal.reason or provider errors. */
|
|
4
|
+
export declare class PeerReadAborted extends Error {
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
export declare function checkPeerAbort(signal?: AbortSignal): void;
|
|
8
|
+
export declare function boundedPeerRead<T>(read: (signal: AbortSignal) => Promise<T>, signal?: AbortSignal): Promise<T>;
|
|
9
|
+
/** Uses the exact deployment config bundled in the selected SDK graph. */
|
|
10
|
+
export declare function peerConfiguration(options?: PeerDiscoveryOptions): PeerConfiguration;
|
|
11
|
+
export declare function peerReads(options: PeerDiscoveryOptions): PeerDiscoveryReads;
|
|
12
|
+
/** Internal shared read path for discovery and preview; no retained provider payloads. */
|
|
13
|
+
export declare function readPeerQuotes(input: unknown, options?: PeerDiscoveryOptions, rail?: string): Promise<{
|
|
14
|
+
quotes: NormalizedPeerQuote[];
|
|
15
|
+
result: PeerDiscoveryResult;
|
|
16
|
+
}>;
|
|
17
|
+
export declare function fetchPeerCapabilities(intent: unknown, options?: PeerDiscoveryOptions): Promise<PeerDiscoveryResult>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "reflect-metadata";
|
|
2
|
+
export { fetchPeerCapabilities, peerConfiguration, PeerReadAborted } from "./discovery.js";
|
|
3
|
+
export { normalizePeerQuotes } from "./normalization.js";
|
|
4
|
+
export { normalizePeerMakerEvidence } from "./maker.js";
|
|
5
|
+
export { previewPeerOffer } from "./preview.js";
|
|
6
|
+
export type { PeerConfiguration, PeerDiscoveryOptions, PeerDiscoveryReads, PeerBestQuoteRequest, PeerQuoteRequest, PeerDiscoveryResult, PeerOfferEstimate, } from "./types.js";
|
|
7
|
+
export type { PeerPreviewResult } from "./preview.js";
|
|
8
|
+
export { createPeerOfframpProvider, PeerMakerPrivateStore, MakerSetupRequired, MakerWithdrawalBlocked, } from "./offramp.js";
|
|
9
|
+
export type { PeerOfframpProvider, PeerMakerIO, MakerReadiness, MakerUnsignedPlan, MakerPreparedTransaction, MakerDepositFacts, MakerOrderAmounts, MakerReconciliation, MakerPhase, MakerReason, MakerWalletAction, } from "./offramp.js";
|
|
10
|
+
export { createSDKMakerIO } from "./sdkMaker.js";
|
|
11
|
+
export type { MakerExecutionTerms, UnsignedMakerSDK } from "./sdkMaker.js";
|
|
12
|
+
export { createLivePeerOfframpProvider } from "./liveProvider.js";
|
|
13
|
+
export type { MakerPublicClient } from "./liveReads.js";
|
|
14
|
+
export type { MakerMappingStorage } from "./protectedMapping.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type MakerPublicClient } from "./liveReads.js";
|
|
2
|
+
import { type UnsignedMakerSDK } from "./sdkMaker.js";
|
|
3
|
+
import { type MakerMappingStorage } from "./protectedMapping.js";
|
|
4
|
+
import type { PeerDiscoveryOptions, PeerDiscoveryReads } from "./types.js";
|
|
5
|
+
/** Production default: public Base RPC and public indexer, no approved-key maker API. */
|
|
6
|
+
export declare function createLivePeerOfframpProvider(options: {
|
|
7
|
+
publicClient: MakerPublicClient;
|
|
8
|
+
sdk: UnsignedMakerSDK;
|
|
9
|
+
wallet: string;
|
|
10
|
+
environment?: PeerDiscoveryOptions["environment"];
|
|
11
|
+
storage?: MakerMappingStorage;
|
|
12
|
+
fetch?: typeof fetch;
|
|
13
|
+
now?: () => number;
|
|
14
|
+
discoveryReads?: Pick<PeerDiscoveryReads, "bestByPlatform" | "quote">;
|
|
15
|
+
}): import("./offramp.js").PeerOfframpProvider;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { type RampIntent } from "@xochi/client";
|
|
2
|
+
import { type Hex, type PublicClient } from "viem";
|
|
3
|
+
import type { MakerDepositFacts, MakerPreparedTransaction, MakerReadiness, MakerReconciliation, PeerMakerIO } from "./offramp.js";
|
|
4
|
+
import type { ProtectedMakerMapping } from "./protectedMapping.js";
|
|
5
|
+
import type { PeerDiscoveryOptions } from "./types.js";
|
|
6
|
+
export interface MakerChainTransaction {
|
|
7
|
+
chainId?: number;
|
|
8
|
+
from: string;
|
|
9
|
+
to: string | null;
|
|
10
|
+
input: Hex;
|
|
11
|
+
value: bigint;
|
|
12
|
+
}
|
|
13
|
+
export interface MakerChainReceipt {
|
|
14
|
+
status: "success" | "reverted";
|
|
15
|
+
blockNumber: bigint;
|
|
16
|
+
transactionHash: Hex;
|
|
17
|
+
logs: readonly {
|
|
18
|
+
address: string;
|
|
19
|
+
topics: readonly Hex[];
|
|
20
|
+
data: Hex;
|
|
21
|
+
}[];
|
|
22
|
+
}
|
|
23
|
+
interface MakerRPCTransport {
|
|
24
|
+
type?: string;
|
|
25
|
+
url?: string;
|
|
26
|
+
fetchOptions?: RequestInit;
|
|
27
|
+
transports?: readonly {
|
|
28
|
+
config: {
|
|
29
|
+
type: string;
|
|
30
|
+
};
|
|
31
|
+
value?: MakerRPCTransport;
|
|
32
|
+
}[];
|
|
33
|
+
}
|
|
34
|
+
export type MakerPublicClient = {
|
|
35
|
+
/** Custom transports must bind cancellation to their underlying requests. */
|
|
36
|
+
withSignal?(signal: AbortSignal): MakerPublicClient;
|
|
37
|
+
transport?: MakerRPCTransport;
|
|
38
|
+
} & Pick<PublicClient, "getChainId" | "getBlockNumber" | "readContract" | "call"> & {
|
|
39
|
+
getTransaction(input: {
|
|
40
|
+
hash: Hex;
|
|
41
|
+
}): Promise<MakerChainTransaction>;
|
|
42
|
+
getTransactionReceipt(input: {
|
|
43
|
+
hash: Hex;
|
|
44
|
+
}): Promise<MakerChainReceipt>;
|
|
45
|
+
};
|
|
46
|
+
/** Bind a read/simulation to an independent transport scope. */
|
|
47
|
+
export declare function makerClientWithSignal(source: MakerPublicClient, signal?: AbortSignal): MakerPublicClient;
|
|
48
|
+
/** No automatic retries/sleeps: Retry-After prevents subsequent requests until its deadline. */
|
|
49
|
+
export declare function createMakerIndexer(options: {
|
|
50
|
+
environment?: PeerDiscoveryOptions["environment"];
|
|
51
|
+
fetch?: typeof fetch;
|
|
52
|
+
now?: () => number;
|
|
53
|
+
}): (query: string, variables: Record<string, string>, signal?: AbortSignal) => Promise<unknown>;
|
|
54
|
+
export declare function createDefaultMakerReads(options: {
|
|
55
|
+
publicClient: MakerPublicClient;
|
|
56
|
+
/** Internal request scope, propagated by the public read wrappers below. */
|
|
57
|
+
signal?: AbortSignal;
|
|
58
|
+
indexer?: ReturnType<typeof createMakerIndexer>;
|
|
59
|
+
wallet: string;
|
|
60
|
+
environment?: PeerDiscoveryOptions["environment"];
|
|
61
|
+
fetch?: typeof fetch;
|
|
62
|
+
now?: () => number;
|
|
63
|
+
/** Provider-private registration success, not caller UI metadata. */
|
|
64
|
+
registered(rail: string): boolean;
|
|
65
|
+
}): {
|
|
66
|
+
reads: {
|
|
67
|
+
readiness: (intent: RampIntent, rail: string, signal?: AbortSignal) => Promise<MakerReadiness>;
|
|
68
|
+
allowance: (owner: string, amount: string, signal?: AbortSignal) => Promise<boolean>;
|
|
69
|
+
reconcile: (hash: string, action: Parameters<PeerMakerIO["reconcile"]>[1], owner: string, expected: MakerPreparedTransaction, signal?: AbortSignal) => Promise<MakerReconciliation>;
|
|
70
|
+
deposit: (id: string, owner: string, signal?: AbortSignal) => Promise<MakerDepositFacts>;
|
|
71
|
+
};
|
|
72
|
+
executionTerms: (intent: RampIntent, rail: string, signal?: AbortSignal) => Promise<{
|
|
73
|
+
minimum: string;
|
|
74
|
+
maximum: string;
|
|
75
|
+
conversionRate: string;
|
|
76
|
+
validUntil: string;
|
|
77
|
+
capabilityRevision: string;
|
|
78
|
+
}>;
|
|
79
|
+
makerEvidence: (intent: RampIntent, rail: string, signal?: AbortSignal) => ReturnType<(intent: RampIntent, rail: string) => Promise<{
|
|
80
|
+
rate: {
|
|
81
|
+
numerator: string;
|
|
82
|
+
denominator: string;
|
|
83
|
+
};
|
|
84
|
+
bounds: {
|
|
85
|
+
minimum: string;
|
|
86
|
+
maximum: string;
|
|
87
|
+
};
|
|
88
|
+
fees: never[];
|
|
89
|
+
credential: string;
|
|
90
|
+
wallet: string;
|
|
91
|
+
region?: string | undefined;
|
|
92
|
+
observed_at: string;
|
|
93
|
+
valid_until: string;
|
|
94
|
+
rail: string;
|
|
95
|
+
currency: string;
|
|
96
|
+
chain_id: string;
|
|
97
|
+
asset_id: string;
|
|
98
|
+
decimals: number;
|
|
99
|
+
}>>;
|
|
100
|
+
rebuild: (mapping: ProtectedMakerMapping, hash?: string, signal?: AbortSignal) => ReturnType<NonNullable<PeerMakerIO["rebuild"]>>;
|
|
101
|
+
};
|
|
102
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type RampIntent } from "@xochi/client";
|
|
2
|
+
import { type NormalizedPeerQuote } from "./normalization.js";
|
|
3
|
+
import type { PeerConfiguration } from "./types.js";
|
|
4
|
+
export declare function normalizePeerMakerEvidence(raw: unknown, intent: RampIntent, config: PeerConfiguration, rail: string, now: number, user?: string): NormalizedPeerQuote;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { atomic, type RampAvailability, type RampIntent, type RampOffer } from "@xochi/client";
|
|
2
|
+
import type { PeerConfiguration, PeerDiscoveryResult } from "./types.js";
|
|
3
|
+
export declare const PEER_FRESHNESS_MS = 30000;
|
|
4
|
+
export declare const peerDisclosures: {
|
|
5
|
+
public_state: string[];
|
|
6
|
+
identity_visible_to: string[];
|
|
7
|
+
liveness_dependencies: string[];
|
|
8
|
+
};
|
|
9
|
+
export declare function digest(value: unknown): `0x${string}`;
|
|
10
|
+
export declare function unavailable(code?: "capabilities_unavailable" | "capability_unavailable"): PeerDiscoveryResult;
|
|
11
|
+
export declare function makeOffer(intent: RampIntent, config: PeerConfiguration, rail: string, now: number, availability: RampAvailability, revision: unknown): RampOffer;
|
|
12
|
+
export interface NormalizedPeerQuote {
|
|
13
|
+
offer: RampOffer;
|
|
14
|
+
pay: {
|
|
15
|
+
asset: RampIntent["fiat"] | RampIntent["crypto"];
|
|
16
|
+
atomic: ReturnType<typeof atomic>;
|
|
17
|
+
};
|
|
18
|
+
receive: {
|
|
19
|
+
asset: RampIntent["fiat"] | RampIntent["crypto"];
|
|
20
|
+
atomic: ReturnType<typeof atomic>;
|
|
21
|
+
};
|
|
22
|
+
fees: {
|
|
23
|
+
code: string;
|
|
24
|
+
money: {
|
|
25
|
+
asset: RampIntent["crypto"];
|
|
26
|
+
atomic: ReturnType<typeof atomic>;
|
|
27
|
+
};
|
|
28
|
+
}[];
|
|
29
|
+
}
|
|
30
|
+
/** Provider-only parsing: copies an allowlist; never returns provider IDs, payees, URLs or messages. */
|
|
31
|
+
export declare function normalizePeerQuotes(raw: unknown, intent: RampIntent, config: PeerConfiguration, now: number, selectedRail?: string): NormalizedPeerQuote[];
|
|
32
|
+
/** Only live response platform names are candidates; a static catalog can only narrow them. */
|
|
33
|
+
export declare function livePeerRails(raw: unknown, config: PeerConfiguration, intent: RampIntent, now: number): string[];
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { type RampMoney, type RampAction, type RampCommandContext, type RampIntent, type RampPreview, type RampProvider, type RampSnapshot } from "@xochi/client";
|
|
2
|
+
import type { Address, Hex } from "viem";
|
|
3
|
+
import { type MakerMappingStorage, type ProtectedMakerMapping } from "./protectedMapping.js";
|
|
4
|
+
import type { PeerDiscoveryOptions, PeerDiscoveryResult } from "./types.js";
|
|
5
|
+
export type MakerPhase = "awaiting_buyer" | "matched" | "delivering" | "delivered" | "returned";
|
|
6
|
+
export type MakerReason = "setup_required" | "active_intent_blocks_withdrawal" | "quote_expired" | "quote_changed";
|
|
7
|
+
export type MakerWalletAction = "approve_usdc" | "create_deposit" | "withdraw_unmatched";
|
|
8
|
+
/** Unsigned transaction passed to the connected wallet. */
|
|
9
|
+
export interface MakerPreparedTransaction {
|
|
10
|
+
to: Address;
|
|
11
|
+
data: Hex;
|
|
12
|
+
value: bigint;
|
|
13
|
+
chainId: number;
|
|
14
|
+
}
|
|
15
|
+
/** Wallet-only material, never an event, snapshot, bridge payload or persistence record. */
|
|
16
|
+
export interface MakerUnsignedPlan {
|
|
17
|
+
readonly action: MakerWalletAction;
|
|
18
|
+
readonly transaction: MakerPreparedTransaction;
|
|
19
|
+
/** The connected wallet must match this public sender before signing. */
|
|
20
|
+
readonly account: string;
|
|
21
|
+
readonly expiresAt: string;
|
|
22
|
+
}
|
|
23
|
+
/** Public Base USDC atomic totals; filled includes fees debited by verified fills. */
|
|
24
|
+
export interface MakerOrderAmounts {
|
|
25
|
+
readonly deposited: string;
|
|
26
|
+
readonly filled: string;
|
|
27
|
+
/** Active reservations, including reserved fees unavailable for withdrawal. */
|
|
28
|
+
readonly reserved: string;
|
|
29
|
+
readonly withdrawable: string;
|
|
30
|
+
readonly withdrawn: string;
|
|
31
|
+
readonly deliveredFiat?: RampMoney;
|
|
32
|
+
}
|
|
33
|
+
export interface MakerReadiness {
|
|
34
|
+
readonly oracleFresh: boolean;
|
|
35
|
+
readonly requiresIdentityAttestation: boolean;
|
|
36
|
+
readonly identityAttested: boolean;
|
|
37
|
+
/** A refusal is authoritative; unknown never implies Autopilot is unnecessary. */
|
|
38
|
+
readonly sellerSetup: "ready" | "required" | "unknown";
|
|
39
|
+
}
|
|
40
|
+
/** Fresh, coherent protocol/indexer facts. Amounts include reserved fees in unavailable funds. */
|
|
41
|
+
export interface MakerDepositFacts {
|
|
42
|
+
readonly deliveredFiat?: RampMoney;
|
|
43
|
+
readonly remaining: string;
|
|
44
|
+
readonly unmatched: string;
|
|
45
|
+
/** Gross USDC debited by verified fills, including protocol fees; never pending fiat. */
|
|
46
|
+
readonly filled: string;
|
|
47
|
+
readonly withdrawn: string;
|
|
48
|
+
readonly activeIntents: number;
|
|
49
|
+
readonly closed: boolean;
|
|
50
|
+
}
|
|
51
|
+
export type MakerReconciliation = {
|
|
52
|
+
readonly state: "pending";
|
|
53
|
+
} | {
|
|
54
|
+
readonly state: "reverted";
|
|
55
|
+
} | {
|
|
56
|
+
readonly state: "confirmed";
|
|
57
|
+
readonly depositId?: string;
|
|
58
|
+
};
|
|
59
|
+
/** Trusted I/O only. Implementations must not log raw errors, registration data or identifiers. */
|
|
60
|
+
export interface PeerMakerIO {
|
|
61
|
+
rebuild?(mapping: ProtectedMakerMapping, pendingWithdrawalHash?: string, signal?: AbortSignal): Promise<{
|
|
62
|
+
state: "pending";
|
|
63
|
+
} | {
|
|
64
|
+
state: "confirmed";
|
|
65
|
+
depositId: string;
|
|
66
|
+
amount: string;
|
|
67
|
+
}>;
|
|
68
|
+
readiness(intent: RampIntent, rail: string, signal?: AbortSignal): Promise<MakerReadiness>;
|
|
69
|
+
/** POST /v2/makers/create, via SDK registerPayeeDetails. Own account only. */
|
|
70
|
+
registerOwnPayee(rail: string, ownAccount: string): Promise<string>;
|
|
71
|
+
allowance(owner: string, amount: string, signal?: AbortSignal): Promise<boolean>;
|
|
72
|
+
prepareApproval(amount: string): Promise<MakerPreparedTransaction>;
|
|
73
|
+
prepareDeposit(input: {
|
|
74
|
+
intent: RampIntent;
|
|
75
|
+
rail: string;
|
|
76
|
+
amount: string;
|
|
77
|
+
payeeHash: string;
|
|
78
|
+
capabilityRevision: string;
|
|
79
|
+
}, signal?: AbortSignal): Promise<MakerPreparedTransaction>;
|
|
80
|
+
/** Confirm the receipt AND exact sender, chain, target, calldata and value against expected.
|
|
81
|
+
* For creation, return only the deposit ID decoded from that successful escrow receipt.
|
|
82
|
+
* Missing/unknown receipts remain pending; never infer absence or resubmit. */
|
|
83
|
+
reconcile(hash: string, action: MakerWalletAction, owner: string, expected: MakerPreparedTransaction, signal?: AbortSignal): Promise<MakerReconciliation>;
|
|
84
|
+
/** Validate deposit owner, Base USDC identity, confirmation/finality and indexer/chain
|
|
85
|
+
* coherence; derive totals from deposit, active intents and verified fills/withdrawals.
|
|
86
|
+
* Never label signalled or payment-pending intents as filled. Throw on missing/stale data. */
|
|
87
|
+
deposit(depositId: string, owner: string, signal?: AbortSignal): Promise<MakerDepositFacts>;
|
|
88
|
+
prepareWithdrawal(depositId: string, amount: string, full: boolean, signal?: AbortSignal): Promise<MakerPreparedTransaction>;
|
|
89
|
+
}
|
|
90
|
+
/** Safe bounded failures; never use Error.message from a provider response. */
|
|
91
|
+
export declare class MakerSetupRequired extends Error {
|
|
92
|
+
constructor();
|
|
93
|
+
}
|
|
94
|
+
export declare class MakerWithdrawalBlocked extends Error {
|
|
95
|
+
constructor();
|
|
96
|
+
}
|
|
97
|
+
export declare class PeerMakerPrivateStore {
|
|
98
|
+
constructor();
|
|
99
|
+
}
|
|
100
|
+
export interface PeerOfframpProvider extends RampProvider {
|
|
101
|
+
approve(preview: RampPreview, context: RampCommandContext, signal?: AbortSignal): Promise<RampSnapshot>;
|
|
102
|
+
interact(operationId: string, context: RampCommandContext, signal?: AbortSignal): Promise<RampSnapshot>;
|
|
103
|
+
recover(operationId: string, action: RampAction, context: RampCommandContext, signal?: AbortSignal): Promise<RampSnapshot>;
|
|
104
|
+
status(operationId: string, signal?: AbortSignal): Promise<RampSnapshot>;
|
|
105
|
+
/** Explicit setup-only registration; returns no payee/provider identifier. */
|
|
106
|
+
setupOwnAccount(rail: string, account: string, ownership: "own_account"): Promise<void>;
|
|
107
|
+
/** Trusted local UI input. This confirms the handle belongs to the connected user. */
|
|
108
|
+
setOwnAccount(operationId: string, account: string, ownership: "own_account"): Promise<void>;
|
|
109
|
+
/** Single-use handoff to the caller's wallet. Claiming creates uncertainty until reconciled. */
|
|
110
|
+
takeUnsignedPlan(operationId: string, signal?: AbortSignal): Promise<MakerUnsignedPlan>;
|
|
111
|
+
recordSubmission(operationId: string, action: MakerWalletAction, transactionHash: string): Promise<void>;
|
|
112
|
+
/** Use only when the wallet confirms that no transaction was broadcast. */
|
|
113
|
+
recordWalletRejection(operationId: string): Promise<void>;
|
|
114
|
+
prepareWithdrawal(operationId: string, amount: string, context: RampCommandContext, signal?: AbortSignal): Promise<RampSnapshot>;
|
|
115
|
+
orderStatus(operationId: string, signal?: AbortSignal): Promise<{
|
|
116
|
+
snapshot: RampSnapshot;
|
|
117
|
+
phase?: MakerPhase;
|
|
118
|
+
reason?: MakerReason;
|
|
119
|
+
amounts?: MakerOrderAmounts;
|
|
120
|
+
depositTransaction?: string;
|
|
121
|
+
}>;
|
|
122
|
+
}
|
|
123
|
+
export declare function createPeerOfframpProvider(options: {
|
|
124
|
+
io: PeerMakerIO;
|
|
125
|
+
discovery: PeerDiscoveryOptions;
|
|
126
|
+
store?: PeerMakerPrivateStore;
|
|
127
|
+
mintOperationId?: () => string;
|
|
128
|
+
storage?: MakerMappingStorage | null;
|
|
129
|
+
}): PeerOfframpProvider;
|
|
130
|
+
export type { PeerDiscoveryResult };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { type RampIntent, type RampOffer, type RampPreview, type RampProvider } from "@xochi/client";
|
|
2
|
+
import type { PeerDiscoveryOptions } from "./types.js";
|
|
3
|
+
export declare const PEER_ATTESTATION_ORIGIN = "https://attestation-service.zkp2p.xyz";
|
|
4
|
+
export type PeerSetupCode = "peer_desktop_extension_or_app" | "peer_extension_install" | "peer_extension_connection" | "peer_extension_update" | "peer_wallet_linked_session";
|
|
5
|
+
export type BuyerPhase = "review" | "payment" | "capture" | "finalize" | "processing" | "held" | "completed";
|
|
6
|
+
type PeerPaymentParams = Record<string, string | number | boolean>;
|
|
7
|
+
/** Transient payment capture used only inside the trusted runtime. */
|
|
8
|
+
export interface PeerBuyerPaymentProof {
|
|
9
|
+
proofType: "buyerTee";
|
|
10
|
+
encryptedSessionMaterial: string;
|
|
11
|
+
params: PeerPaymentParams;
|
|
12
|
+
actionPlatform?: string;
|
|
13
|
+
actionType?: string;
|
|
14
|
+
}
|
|
15
|
+
interface PeerBuyerMetadata {
|
|
16
|
+
platform: string;
|
|
17
|
+
requestId: string;
|
|
18
|
+
expiresAt: number;
|
|
19
|
+
errorMessage?: string;
|
|
20
|
+
metadata: {
|
|
21
|
+
hidden: boolean;
|
|
22
|
+
currency?: string;
|
|
23
|
+
recipient?: string;
|
|
24
|
+
date?: string;
|
|
25
|
+
amount?: string;
|
|
26
|
+
params?: PeerPaymentParams;
|
|
27
|
+
}[];
|
|
28
|
+
buyerTeeCapture?: {
|
|
29
|
+
encryptedSessionMaterial: string;
|
|
30
|
+
params?: PeerPaymentParams[];
|
|
31
|
+
} | null;
|
|
32
|
+
}
|
|
33
|
+
export interface PeerBuyerExtension {
|
|
34
|
+
getState(): Promise<"needs_install" | "needs_connection" | "ready">;
|
|
35
|
+
getVersion(): Promise<string>;
|
|
36
|
+
requestConnection(): Promise<boolean>;
|
|
37
|
+
openInstallPage(): void;
|
|
38
|
+
onMetadataMessage(callback: (message: PeerBuyerMetadata) => void): () => void;
|
|
39
|
+
authenticate(input: {
|
|
40
|
+
platform: string;
|
|
41
|
+
actionType: string;
|
|
42
|
+
captureMode: "buyerTee";
|
|
43
|
+
attestationServiceUrl: string;
|
|
44
|
+
callerAddress: string;
|
|
45
|
+
}): void;
|
|
46
|
+
}
|
|
47
|
+
/** All inputs and outputs of this port are provider-private; never persist or emit them. */
|
|
48
|
+
export interface PeerBuyerDriver {
|
|
49
|
+
quote(intent: RampIntent, offer: RampOffer, signal?: AbortSignal): Promise<{
|
|
50
|
+
preview: RampPreview;
|
|
51
|
+
paymentRecipient: string;
|
|
52
|
+
signal(): Promise<{
|
|
53
|
+
intentHash: string;
|
|
54
|
+
expiresAt: number;
|
|
55
|
+
paymentRecipient?: string;
|
|
56
|
+
signaledAt?: number;
|
|
57
|
+
}>;
|
|
58
|
+
}>;
|
|
59
|
+
/** Must verify on-chain intent identity/amount/recipient before requesting attestation. */
|
|
60
|
+
fulfill(intentHash: string, proof: PeerBuyerPaymentProof): Promise<void>;
|
|
61
|
+
status(intentHash: string): Promise<"pending" | "held" | "paid" | "released" | "unknown">;
|
|
62
|
+
/**
|
|
63
|
+
* Re-find an intent this wallet already signaled, after the transient runtime was
|
|
64
|
+
* lost (reload). Read-only: must never sign, signal or submit. `undefined` means
|
|
65
|
+
* the outcome cannot be established, which the caller treats as in doubt.
|
|
66
|
+
*/
|
|
67
|
+
resume?(binding: PeerResumeBinding): Promise<PeerResumeResult | undefined>;
|
|
68
|
+
}
|
|
69
|
+
/** Public, sanitized facts from the local summary; no provider handle is persisted. */
|
|
70
|
+
export interface PeerResumeBinding {
|
|
71
|
+
readonly operationId?: string;
|
|
72
|
+
readonly wallet: string;
|
|
73
|
+
readonly rail: string;
|
|
74
|
+
readonly currency: string;
|
|
75
|
+
readonly payAtomic: string;
|
|
76
|
+
readonly receiveAtomic: string;
|
|
77
|
+
/** The wallet approval happened at or after this time (ms). */
|
|
78
|
+
readonly approvedAfter: number;
|
|
79
|
+
}
|
|
80
|
+
export type PeerResumeResult = {
|
|
81
|
+
kind: "active";
|
|
82
|
+
intentHash: string;
|
|
83
|
+
expiresAt: number;
|
|
84
|
+
signaledAt: number;
|
|
85
|
+
/** Absent when Peer cannot return it; the payment step then cannot be captured. */
|
|
86
|
+
paymentRecipient?: string;
|
|
87
|
+
} | {
|
|
88
|
+
kind: "fulfilled";
|
|
89
|
+
intentHash: string;
|
|
90
|
+
} | {
|
|
91
|
+
kind: "expired";
|
|
92
|
+
};
|
|
93
|
+
export interface PeerBuyerOptions extends PeerDiscoveryOptions {
|
|
94
|
+
extension: PeerBuyerExtension;
|
|
95
|
+
driver: PeerBuyerDriver;
|
|
96
|
+
/** Injection for deterministic environment tests; true can only narrow the real mobile gate. */
|
|
97
|
+
desktop?: boolean;
|
|
98
|
+
}
|
|
99
|
+
export declare function peerVersionSupported(version: string, platform: string): boolean;
|
|
100
|
+
export declare class PeerSigningSetupRequired extends Error {
|
|
101
|
+
constructor();
|
|
102
|
+
}
|
|
103
|
+
/** Inspect a bounded error classification only; never expose the upstream message. */
|
|
104
|
+
export declare function peerRequiresLinkedSession(error: unknown): boolean;
|
|
105
|
+
/** One transient provider runtime. No credentials, proof sessions or provider handles leave this closure. */
|
|
106
|
+
export declare function createPeerOnrampProvider(options: PeerBuyerOptions): {
|
|
107
|
+
provider: RampProvider;
|
|
108
|
+
resume: (id: string, summary: {
|
|
109
|
+
wallet: string;
|
|
110
|
+
rail: string;
|
|
111
|
+
pay: RampPreview["pay"];
|
|
112
|
+
receive: RampPreview["receive"];
|
|
113
|
+
quoteExpiresAt: string;
|
|
114
|
+
approvedAfter: number;
|
|
115
|
+
}) => Promise<void>;
|
|
116
|
+
checkReadiness: (platform: string) => Promise<PeerSetupCode | undefined>;
|
|
117
|
+
setupRequired: () => PeerSetupCode | undefined;
|
|
118
|
+
setupAvailability: () => {
|
|
119
|
+
state: "setup_required";
|
|
120
|
+
requirement_codes: PeerSetupCode[];
|
|
121
|
+
} | undefined;
|
|
122
|
+
phase: (id: string) => BuyerPhase | undefined;
|
|
123
|
+
rail: (id: string) => string | undefined;
|
|
124
|
+
/** Private rendered provider instructions, never a bridge/snapshot payload. */
|
|
125
|
+
paymentRecipient: (id: string) => string;
|
|
126
|
+
expiresAt: (id: string) => number | undefined;
|
|
127
|
+
connectFromGesture: () => Promise<boolean>;
|
|
128
|
+
installFromGesture: () => void;
|
|
129
|
+
/** Call directly in the click handler BEFORE any await or client command. */
|
|
130
|
+
openFromGesture(id: string): boolean;
|
|
131
|
+
dispose(): void;
|
|
132
|
+
};
|
|
133
|
+
export type PeerOnrampRuntime = ReturnType<typeof createPeerOnrampProvider>;
|
|
134
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type RampErrorCode, type RampPreview } from "@xochi/client";
|
|
2
|
+
import type { PeerDiscoveryOptions } from "./types.js";
|
|
3
|
+
export type PeerPreviewResult = {
|
|
4
|
+
ok: true;
|
|
5
|
+
preview: RampPreview;
|
|
6
|
+
estimate: boolean;
|
|
7
|
+
} | {
|
|
8
|
+
ok: false;
|
|
9
|
+
code: RampErrorCode;
|
|
10
|
+
replacement?: RampPreview;
|
|
11
|
+
estimate?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/** Always re-read. A replacement quote must be reviewed before it is accepted. */
|
|
14
|
+
export declare function previewPeerOffer(offer: unknown, intent: unknown, operationId: string, options?: PeerDiscoveryOptions): Promise<PeerPreviewResult>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const mapping: z.ZodObject<{
|
|
3
|
+
operationRef: z.ZodString;
|
|
4
|
+
escrowAddress: z.ZodString;
|
|
5
|
+
depositId: z.ZodNullable<z.ZodString>;
|
|
6
|
+
creationTxHash: z.ZodNullable<z.ZodString>;
|
|
7
|
+
legRevision: z.ZodString;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
export type ProtectedMakerMapping = z.infer<typeof mapping>;
|
|
10
|
+
export type MakerMappingStorage = Pick<Storage, "getItem" | "setItem" | "removeItem">;
|
|
11
|
+
/** Provider-private, distinct from public activity. No handle, account, intent, quote or error data. */
|
|
12
|
+
export declare class ProtectedMakerMappings {
|
|
13
|
+
#private;
|
|
14
|
+
private readonly storage;
|
|
15
|
+
private readonly escrow;
|
|
16
|
+
constructor(storage: MakerMappingStorage, wallet: string, escrow: string);
|
|
17
|
+
get(operationRef: string): ProtectedMakerMapping | undefined;
|
|
18
|
+
put(value: ProtectedMakerMapping): void;
|
|
19
|
+
remove(operationRef: string): void;
|
|
20
|
+
}
|
|
21
|
+
export declare function browserMakerStorage(): MakerMappingStorage | undefined;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type RampClient, type RampOperationStore } from "@xochi/client";
|
|
2
|
+
import type { PublicClient, WalletClient } from "viem";
|
|
3
|
+
import { type PeerOnrampRuntime } from "./onramp.js";
|
|
4
|
+
/** S4's browser-local store: sanitized snapshots and receipts under `xochi:ramp/1:`. */
|
|
5
|
+
export declare function browserRampStore(): RampOperationStore;
|
|
6
|
+
/** One provider runtime per connected wallet; pinned once an operation is submitted. */
|
|
7
|
+
export declare function usePeerOnrampRuntime(options: {
|
|
8
|
+
supplied?: PeerOnrampRuntime;
|
|
9
|
+
wallet?: WalletClient;
|
|
10
|
+
publicClient?: PublicClient;
|
|
11
|
+
}): {
|
|
12
|
+
runtime?: PeerOnrampRuntime;
|
|
13
|
+
pin: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function useRampClient(runtime: PeerOnrampRuntime | undefined, store?: RampOperationStore): RampClient | undefined;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type RampIntent } from "@xochi/client";
|
|
2
|
+
import { type Address } from "viem";
|
|
3
|
+
import { type PeerMakerIO, type MakerPreparedTransaction } from "./offramp.js";
|
|
4
|
+
import type { PeerDiscoveryOptions } from "./types.js";
|
|
5
|
+
/** Only unsigned SDK methods are admitted; no wallet client, key, send or signature method. */
|
|
6
|
+
export interface UnsignedMakerSDK {
|
|
7
|
+
registerPayeeDetails(input: {
|
|
8
|
+
processorNames: string[];
|
|
9
|
+
payeeData: {
|
|
10
|
+
offchainId: string;
|
|
11
|
+
}[];
|
|
12
|
+
}): Promise<{
|
|
13
|
+
hashedOnchainIds: string[];
|
|
14
|
+
}>;
|
|
15
|
+
prepareCreateDeposit(input: {
|
|
16
|
+
token: Address;
|
|
17
|
+
escrowAddress: Address;
|
|
18
|
+
amount: bigint;
|
|
19
|
+
intentAmountRange: {
|
|
20
|
+
min: bigint;
|
|
21
|
+
max: bigint;
|
|
22
|
+
};
|
|
23
|
+
processorNames: string[];
|
|
24
|
+
payeeDetailsHashes: string[];
|
|
25
|
+
conversionRates: {
|
|
26
|
+
currency: string;
|
|
27
|
+
conversionRate: string;
|
|
28
|
+
}[][];
|
|
29
|
+
retainOnEmpty: boolean;
|
|
30
|
+
referralCode?: string;
|
|
31
|
+
}): Promise<{
|
|
32
|
+
prepared: MakerPreparedTransaction;
|
|
33
|
+
}>;
|
|
34
|
+
removeFunds: {
|
|
35
|
+
prepare(input: {
|
|
36
|
+
depositId: bigint;
|
|
37
|
+
amount: bigint;
|
|
38
|
+
escrowAddress: Address;
|
|
39
|
+
}): Promise<MakerPreparedTransaction>;
|
|
40
|
+
};
|
|
41
|
+
withdrawDeposit: {
|
|
42
|
+
prepare(input: {
|
|
43
|
+
depositId: bigint;
|
|
44
|
+
escrowAddress: Address;
|
|
45
|
+
}): Promise<MakerPreparedTransaction>;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export interface MakerExecutionTerms {
|
|
49
|
+
/** Current provider/protocol bounds and price, independently of buyer quotes. */
|
|
50
|
+
minimum: string;
|
|
51
|
+
maximum: string;
|
|
52
|
+
conversionRate: string;
|
|
53
|
+
validUntil: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Construct the SDK-backed write preparation port. The application's trusted read layer supplies
|
|
57
|
+
* authoritative chain/indexer reconciliation and oracle/account reads. Missing reads fail closed;
|
|
58
|
+
* no packaged catalog, guessed seller status or buyer price is substituted for maker evidence.
|
|
59
|
+
*/
|
|
60
|
+
export declare function createSDKMakerIO(options: {
|
|
61
|
+
sdk: UnsignedMakerSDK;
|
|
62
|
+
discovery?: PeerDiscoveryOptions;
|
|
63
|
+
reads: Pick<PeerMakerIO, "readiness" | "allowance" | "reconcile" | "deposit">;
|
|
64
|
+
executionTerms(intent: RampIntent, rail: string, signal?: AbortSignal): Promise<MakerExecutionTerms & {
|
|
65
|
+
capabilityRevision: string;
|
|
66
|
+
}>;
|
|
67
|
+
}): PeerMakerIO;
|